From e23b520d2e35420d17928ee45fa52808f6fc4add Mon Sep 17 00:00:00 2001 From: delvedor Date: Wed, 17 Feb 2021 12:09:01 +0100 Subject: [PATCH] Added test --- codecov.yml | 11 + test/acceptance/events-order.test.js | 463 +++ test/acceptance/observability.test.js | 376 ++ test/acceptance/proxy.test.js | 149 + test/acceptance/resurrect.test.js | 213 + test/acceptance/sniff.test.js | 297 ++ test/fixtures/https.cert | 19 + test/fixtures/https.key | 27 + test/fixtures/small-dataset.ndjson | 3 + test/fixtures/stackoverflow.ndjson | 5000 +++++++++++++++++++++++ test/types/connection-pool.test-d.ts | 110 + test/types/connection.test-d.ts | 54 + test/types/errors.test-d.ts | 104 + test/types/serializer.test-d.ts | 28 + test/types/transport.test-d.ts | 182 + test/unit/base-connection-pool.test.js | 505 +++ test/unit/cloud-connection-pool.test.js | 48 + test/unit/connection-pool.test.js | 801 ++++ test/unit/connection.test.js | 949 +++++ test/unit/errors.test.js | 105 + test/unit/events.test.js | 258 ++ test/unit/selectors.test.js | 42 + test/unit/serializer.test.js | 159 + test/unit/transport.test.js | 2621 ++++++++++++ test/utils/MockConnection.js | 179 + test/utils/TestClient.js | 137 + test/utils/buildCluster.js | 110 + test/utils/buildProxy.js | 60 + test/utils/buildServer.js | 73 + test/utils/index.js | 52 + 30 files changed, 13135 insertions(+) create mode 100644 codecov.yml create mode 100644 test/acceptance/events-order.test.js create mode 100644 test/acceptance/observability.test.js create mode 100644 test/acceptance/proxy.test.js create mode 100644 test/acceptance/resurrect.test.js create mode 100644 test/acceptance/sniff.test.js create mode 100644 test/fixtures/https.cert create mode 100644 test/fixtures/https.key create mode 100644 test/fixtures/small-dataset.ndjson create mode 100644 test/fixtures/stackoverflow.ndjson create mode 100644 test/types/connection-pool.test-d.ts create mode 100644 test/types/connection.test-d.ts create mode 100644 test/types/errors.test-d.ts create mode 100644 test/types/serializer.test-d.ts create mode 100644 test/types/transport.test-d.ts create mode 100644 test/unit/base-connection-pool.test.js create mode 100644 test/unit/cloud-connection-pool.test.js create mode 100644 test/unit/connection-pool.test.js create mode 100644 test/unit/connection.test.js create mode 100644 test/unit/errors.test.js create mode 100644 test/unit/events.test.js create mode 100644 test/unit/selectors.test.js create mode 100644 test/unit/serializer.test.js create mode 100644 test/unit/transport.test.js create mode 100644 test/utils/MockConnection.js create mode 100644 test/utils/TestClient.js create mode 100644 test/utils/buildCluster.js create mode 100644 test/utils/buildProxy.js create mode 100644 test/utils/buildServer.js create mode 100644 test/utils/index.js diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..890f1c4 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,11 @@ +comment: off + +coverage: + precision: 2 + round: down + range: "95...100" + + status: + project: yes + patch: yes + changes: no diff --git a/test/acceptance/events-order.test.js b/test/acceptance/events-order.test.js new file mode 100644 index 0000000..6e561a0 --- /dev/null +++ b/test/acceptance/events-order.test.js @@ -0,0 +1,463 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +'use strict' + +const { test } = require('tap') +const intoStream = require('into-stream') +const { Connection, events } = require('../../index') +const { + TimeoutError, + ConnectionError, + ResponseError, + RequestAbortedError, + SerializationError, + DeserializationError +} = require('../../lib/errors') +const { + TestClient, + buildServer, + connection: { + MockConnection, + MockConnectionError, + MockConnectionTimeout, + buildMockConnection + } +} = require('../utils') + +test('No errors', t => { + t.plan(10) + + const client = new TestClient({ + node: 'http://localhost:9200', + Connection: MockConnection + }) + + const order = [ + events.SERIALIZATION, + events.REQUEST, + events.DESERIALIZATION, + events.RESPONSE + ] + + client.on(events.SERIALIZATION, (err, request) => { + t.error(err) + t.strictEqual(order.shift(), events.SERIALIZATION) + }) + + client.on(events.REQUEST, (err, request) => { + t.error(err) + t.strictEqual(order.shift(), events.REQUEST) + }) + + client.on(events.DESERIALIZATION, (err, request) => { + t.error(err) + t.strictEqual(order.shift(), events.DESERIALIZATION) + }) + + client.on(events.RESPONSE, (err, request) => { + t.error(err) + t.strictEqual(order.shift(), events.RESPONSE) + }) + + client.request((err, result) => { + t.error(err) + t.strictEqual(order.length, 0) + }) +}) + +test('Connection error', t => { + t.plan(10) + + const client = new TestClient({ + node: 'http://localhost:9200', + Connection: MockConnectionError, + maxRetries: 1 + }) + + const order = [ + events.SERIALIZATION, + events.REQUEST, + events.REQUEST, + events.RESPONSE + ] + + client.on(events.SERIALIZATION, (err, request) => { + t.error(err) + t.strictEqual(order.shift(), events.SERIALIZATION) + }) + + client.on(events.REQUEST, (err, request) => { + t.error(err) + t.strictEqual(order.shift(), events.REQUEST) + }) + + client.on(events.DESERIALIZATION, (_err, request) => { + t.fail('Should not be called') + }) + + client.on(events.RESPONSE, (err, request) => { + t.ok(err instanceof ConnectionError) + t.strictEqual(order.shift(), events.RESPONSE) + }) + + client.request((err, result) => { + t.ok(err instanceof ConnectionError) + t.strictEqual(order.length, 0) + }) +}) + +test('TimeoutError error', t => { + t.plan(10) + + const client = new TestClient({ + node: 'http://localhost:9200', + Connection: MockConnectionTimeout, + maxRetries: 1 + }) + + const order = [ + events.SERIALIZATION, + events.REQUEST, + events.REQUEST, + events.RESPONSE + ] + + client.on(events.SERIALIZATION, (err, request) => { + t.error(err) + t.strictEqual(order.shift(), events.SERIALIZATION) + }) + + client.on(events.REQUEST, (err, request) => { + t.error(err) + t.strictEqual(order.shift(), events.REQUEST) + }) + + client.on(events.DESERIALIZATION, (_err, request) => { + t.fail('Should not be called') + }) + + client.on(events.RESPONSE, (err, request) => { + t.ok(err instanceof TimeoutError) + t.strictEqual(order.shift(), events.RESPONSE) + }) + + client.request((err, result) => { + t.ok(err instanceof TimeoutError) + t.strictEqual(order.length, 0) + }) +}) + +test('RequestAbortedError error', t => { + t.plan(8) + + const client = new TestClient({ + node: 'http://localhost:9200', + Connection: MockConnectionTimeout, + maxRetries: 1 + }) + + const order = [ + events.SERIALIZATION, + events.REQUEST, + events.RESPONSE + ] + + client.on(events.SERIALIZATION, (err, request) => { + t.error(err) + t.strictEqual(order.shift(), events.SERIALIZATION) + }) + + client.on(events.REQUEST, (err, request) => { + t.error(err) + t.strictEqual(order.shift(), events.REQUEST) + }) + + client.on(events.DESERIALIZATION, (_err, request) => { + t.fail('Should not be called') + }) + + client.on(events.RESPONSE, (err, request) => { + t.ok(err instanceof RequestAbortedError) + t.strictEqual(order.shift(), events.RESPONSE) + }) + + const request = client.request((err, result) => { + t.ok(err instanceof RequestAbortedError) + t.strictEqual(order.length, 0) + }) + + request.abort() +}) + +test('ResponseError error (no retry)', t => { + t.plan(10) + + const MockConnection = buildMockConnection({ + onRequest (params) { + return { + statusCode: 400, + body: { hello: 'world' } + } + } + }) + + const client = new TestClient({ + node: 'http://localhost:9200', + Connection: MockConnection, + maxRetries: 1 + }) + + const order = [ + events.SERIALIZATION, + events.REQUEST, + events.DESERIALIZATION, + events.RESPONSE + ] + + client.on(events.SERIALIZATION, (err, request) => { + t.error(err) + t.strictEqual(order.shift(), events.SERIALIZATION) + }) + + client.on(events.REQUEST, (err, request) => { + t.error(err) + t.strictEqual(order.shift(), events.REQUEST) + }) + + client.on(events.DESERIALIZATION, (err, request) => { + t.error(err) + t.strictEqual(order.shift(), events.DESERIALIZATION) + }) + + client.on(events.RESPONSE, (err, request) => { + t.ok(err instanceof ResponseError) + t.strictEqual(order.shift(), events.RESPONSE) + }) + + client.request((err, result) => { + t.ok(err instanceof ResponseError) + t.strictEqual(order.length, 0) + }) +}) + +test('ResponseError error (with retry)', t => { + t.plan(14) + + const MockConnection = buildMockConnection({ + onRequest (params) { + return { + statusCode: 504, + body: { hello: 'world' } + } + } + }) + + const client = new TestClient({ + node: 'http://localhost:9200', + Connection: MockConnection, + maxRetries: 1 + }) + + const order = [ + events.SERIALIZATION, + events.REQUEST, + events.DESERIALIZATION, + events.REQUEST, + events.DESERIALIZATION, + events.RESPONSE + ] + + client.on(events.SERIALIZATION, (err, request) => { + t.error(err) + t.strictEqual(order.shift(), events.SERIALIZATION) + }) + + client.on(events.REQUEST, (err, request) => { + t.error(err) + t.strictEqual(order.shift(), events.REQUEST) + }) + + client.on(events.DESERIALIZATION, (err, request) => { + t.error(err) + t.strictEqual(order.shift(), events.DESERIALIZATION) + }) + + client.on(events.RESPONSE, (err, request) => { + t.ok(err instanceof ResponseError) + t.strictEqual(order.shift(), events.RESPONSE) + }) + + client.request((err, result) => { + t.ok(err instanceof ResponseError) + t.strictEqual(order.length, 0) + }) +}) + +test('Serialization Error', t => { + t.plan(6) + + const client = new TestClient({ + node: 'http://localhost:9200', + Connection: MockConnection, + maxRetries: 1 + }) + + const order = [ + events.SERIALIZATION, + events.REQUEST + ] + + client.on(events.SERIALIZATION, (err, request) => { + t.error(err) + t.strictEqual(order.shift(), events.SERIALIZATION) + }) + + client.on(events.REQUEST, (err, request) => { + t.ok(err instanceof SerializationError) + t.strictEqual(order.shift(), events.REQUEST) + }) + + client.on(events.DESERIALIZATION, (_err, request) => { + t.fail('Should not be called') + }) + + client.on(events.RESPONSE, (_err, request) => { + t.fail('Should not be called') + }) + + const body = {} + body.o = body + client.request({ index: 'test', body }, (err, result) => { + t.ok(err instanceof SerializationError) + t.strictEqual(order.length, 0) + }) +}) + +test('Deserialization Error', t => { + t.plan(10) + + class MockConnection extends Connection { + request (params, callback) { + const body = '{"hello":"wor' + const stream = intoStream(body) + stream.statusCode = 200 + stream.headers = { + 'content-type': 'application/json;utf=8', + 'content-length': body.length, + connection: 'keep-alive', + date: new Date().toISOString() + } + stream.on('close', () => t.pass('Stream destroyed')) + process.nextTick(callback, null, stream) + return { abort () {} } + } + } + + const client = new TestClient({ + node: 'http://localhost:9200', + Connection: MockConnection, + maxRetries: 1 + }) + + const order = [ + events.SERIALIZATION, + events.REQUEST, + events.DESERIALIZATION, + events.RESPONSE + ] + + client.on(events.SERIALIZATION, (err, request) => { + t.error(err) + t.strictEqual(order.shift(), events.SERIALIZATION) + }) + + client.on(events.REQUEST, (err, request) => { + t.error(err) + t.strictEqual(order.shift(), events.REQUEST) + }) + + client.on(events.DESERIALIZATION, (err, request) => { + t.error(err) + t.strictEqual(order.shift(), events.DESERIALIZATION) + }) + + client.on(events.RESPONSE, (err, request) => { + t.ok(err instanceof DeserializationError) + t.strictEqual(order.shift(), events.RESPONSE) + }) + + client.request((err, result) => { + t.ok(err instanceof DeserializationError) + t.strictEqual(order.length, 0) + }) +}) + +test('Socket destroyed while reading the body', t => { + t.plan(14) + + function handler (req, res) { + const body = JSON.stringify({ hello: 'world' }) + res.setHeader('Content-Type', 'application/json;utf=8') + res.setHeader('Content-Length', body.length + '') + res.write(body.slice(0, -5)) + setTimeout(() => { + res.socket.destroy() + }, 500) + } + + buildServer(handler, ({ port }, server) => { + const client = new TestClient({ node: `http://localhost:${port}`, maxRetries: 1 }) + + const order = [ + events.SERIALIZATION, + events.REQUEST, + events.DESERIALIZATION, + events.REQUEST, + events.DESERIALIZATION, + events.RESPONSE + ] + + client.on(events.SERIALIZATION, (err, request) => { + t.error(err) + t.strictEqual(order.shift(), events.SERIALIZATION) + }) + + client.on(events.REQUEST, (err, request) => { + t.error(err) + t.strictEqual(order.shift(), events.REQUEST) + }) + + client.on(events.DESERIALIZATION, (err, request) => { + t.error(err) + t.strictEqual(order.shift(), events.DESERIALIZATION) + }) + + client.on(events.RESPONSE, (err, request) => { + t.ok(err instanceof ConnectionError) + t.strictEqual(order.shift(), events.RESPONSE) + }) + + client.request((err, result) => { + t.ok(err instanceof ConnectionError) + t.strictEqual(order.length, 0) + server.stop() + }) + }) +}) diff --git a/test/acceptance/observability.test.js b/test/acceptance/observability.test.js new file mode 100644 index 0000000..20803df --- /dev/null +++ b/test/acceptance/observability.test.js @@ -0,0 +1,376 @@ +'use strict' + +const { test } = require('tap') +const FakeTimers = require('@sinonjs/fake-timers') +const { Transport } = require('../../index') +const { + TestClient, + connection: { MockConnection, MockConnectionSniff } +} = require('../utils') +const noop = () => {} + +test('Request id', t => { + t.test('Default generateRequestId', t => { + const { generateRequestId } = Transport.internals + t.type(generateRequestId, 'function') + + const genReqId = generateRequestId() + t.type(genReqId, 'function') + + for (var i = 1; i <= 10; i++) { + t.strictEqual(genReqId(), i) + } + + t.end() + }) + + t.test('Custom generateRequestId', t => { + t.plan(7) + + const options = { context: { winter: 'is coming' } } + + const client = new TestClient({ + node: 'http://localhost:9200', + Connection: MockConnection, + generateRequestId: function (requestParams, requestOptions) { + t.match(requestParams, { method: 'GET', path: '/' }) + t.match(requestOptions, options) + return 'custom-id' + } + }) + + client.on('request', (err, { meta }) => { + t.error(err) + t.strictEqual(meta.request.id, 'custom-id') + }) + + client.on('response', (err, { meta }) => { + t.error(err) + t.strictEqual(meta.request.id, 'custom-id') + }) + + client.request({}, options, t.error) + }) + + t.test('Custom request id in method options', t => { + t.plan(5) + + const client = new TestClient({ + node: 'http://localhost:9200', + Connection: MockConnection + }) + + client.on('request', (err, { meta }) => { + t.error(err) + t.strictEqual(meta.request.id, 'custom-id') + }) + + client.on('response', (err, { meta }) => { + t.error(err) + t.strictEqual(meta.request.id, 'custom-id') + }) + + client.request({}, { id: 'custom-id' }, t.error) + }) + + t.test('Sniff and correlation id', t => { + t.test('sniffOnStart - should autogenerate the id', t => { + t.plan(2) + + const client = new TestClient({ + node: 'http://localhost:9200', + Connection: MockConnectionSniff, + sniffOnStart: true + }) + + client.on('sniff', (err, { meta }) => { + t.error(err) + t.strictEqual(meta.request.id, 1) + }) + }) + + t.test('sniffOnConnectionFault - should use the request id', t => { + t.plan(5) + + const client = new TestClient({ + nodes: ['http://localhost:9200', 'http://localhost:9201'], + Connection: MockConnectionSniff, + sniffOnConnectionFault: true, + maxRetries: 0 + }) + + client.on('request', (e, { meta }) => { + t.strictEqual(meta.request.id, 'custom') + }) + + client.on('response', (e, { meta }) => { + t.strictEqual(meta.request.id, 'custom') + }) + + client.on('sniff', (e, { meta }) => { + t.strictEqual(meta.request.id, 'custom') + }) + + client.transport.request({ + path: '/500', + method: 'GET' + }, { + id: 'custom', + headers: { timeout: 'true' } + }, noop) + }) + + t.end() + }) + + t.test('Resurrect should use the same request id of the request that starts it', t => { + t.plan(2) + + const clock = FakeTimers.install({ toFake: ['Date'] }) + const client = new TestClient({ + node: 'http://localhost:9200', + Connection: MockConnection, + sniffOnConnectionFault: true, + maxRetries: 0 + }) + + const conn = client.connectionPool.getConnection() + client.connectionPool.markDead(conn) + clock.tick(1000 * 61) + + client.on('resurrect', (err, meta) => { + t.error(err) + t.strictEqual(meta.request.id, 'custom') + clock.uninstall() + }) + + client.request({}, { id: 'custom' }, noop) + }) + + t.end() +}) + +test('Request context', t => { + t.test('no value', t => { + t.plan(5) + + const client = new TestClient({ + node: 'http://localhost:9200', + Connection: MockConnection + }) + + client.on('request', (err, { meta }) => { + t.error(err) + t.strictEqual(meta.context, null) + }) + + client.on('response', (err, { meta }) => { + t.error(err) + t.strictEqual(meta.context, null) + }) + + client.request(t.error) + }) + + t.test('custom value', t => { + t.plan(5) + + const client = new TestClient({ + node: 'http://localhost:9200', + Connection: MockConnection + }) + + client.on('request', (err, { meta }) => { + t.error(err) + t.deepEqual(meta.context, { winter: 'is coming' }) + }) + + client.on('response', (err, { meta }) => { + t.error(err) + t.deepEqual(meta.context, { winter: 'is coming' }) + }) + + client.request({}, { context: { winter: 'is coming' } }, t.error) + }) + + t.test('global value', t => { + t.plan(5) + + const client = new TestClient({ + node: 'http://localhost:9200', + Connection: MockConnection, + context: { winter: 'is coming' } + }) + + client.on('request', (err, { meta }) => { + t.error(err) + t.deepEqual(meta.context, { winter: 'is coming' }) + }) + + client.on('response', (err, { meta }) => { + t.error(err) + t.deepEqual(meta.context, { winter: 'is coming' }) + }) + + client.request(t.error) + }) + + t.test('override global', t => { + t.plan(5) + + const client = new TestClient({ + node: 'http://localhost:9200', + Connection: MockConnection, + context: { winter: 'is coming' } + }) + + client.on('request', (err, { meta }) => { + t.error(err) + t.deepEqual(meta.context, { winter: 'has come' }) + }) + + client.on('response', (err, { meta }) => { + t.error(err) + t.deepEqual(meta.context, { winter: 'has come' }) + }) + + client.request({}, { context: { winter: 'has come' } }, t.error) + }) + + t.end() +}) + +test('Client name', t => { + t.test('Property of the client instance', t => { + const client = new TestClient({ + node: 'http://localhost:9200', + name: 'cluster' + }) + t.strictEqual(client.name, 'cluster') + t.end() + }) + + t.test('Is present in the event metadata (as string)', t => { + t.plan(6) + const client = new TestClient({ + node: 'http://localhost:9200', + Connection: MockConnection, + name: 'cluster' + }) + + client.on('request', (err, { meta }) => { + t.error(err) + t.strictEqual(meta.name, 'cluster') + }) + + client.on('response', (err, { meta }) => { + t.error(err) + t.strictEqual(meta.name, 'cluster') + }) + + client.request((err, { meta }) => { + t.error(err) + t.strictEqual(meta.name, 'cluster') + }) + }) + + t.test('Is present in the event metadata (as symbol)', t => { + t.plan(6) + const symbol = Symbol('cluster') + const client = new TestClient({ + node: 'http://localhost:9200', + Connection: MockConnection, + name: symbol + }) + + client.on('request', (err, { meta }) => { + t.error(err) + t.strictEqual(meta.name, symbol) + }) + + client.on('response', (err, { meta }) => { + t.error(err) + t.strictEqual(meta.name, symbol) + }) + + client.request((err, { meta }) => { + t.error(err) + t.strictEqual(meta.name, symbol) + }) + }) + + t.test('Sniff and client name', t => { + t.test('sniffOnStart', t => { + t.plan(2) + + const client = new TestClient({ + node: 'http://localhost:9200', + Connection: MockConnectionSniff, + sniffOnStart: true + }) + + client.on('sniff', (err, { meta }) => { + t.error(err) + t.strictEqual(meta.name, 'elasticsearch-js') + }) + }) + + t.test('sniffOnConnectionFault', t => { + t.plan(5) + + const client = new TestClient({ + nodes: ['http://localhost:9200', 'http://localhost:9201'], + Connection: MockConnectionSniff, + sniffOnConnectionFault: true, + maxRetries: 0 + }) + + client.on('request', (e, { meta }) => { + t.strictEqual(meta.name, 'elasticsearch-js') + }) + + client.on('response', (e, { meta }) => { + t.strictEqual(meta.name, 'elasticsearch-js') + }) + + client.on('sniff', (e, { meta }) => { + t.strictEqual(meta.name, 'elasticsearch-js') + }) + + client.transport.request({ + path: '/500', + method: 'GET' + }, { + headers: { timeout: 'true' } + }, noop) + }) + + t.end() + }) + + t.test('Resurrect should have the client name configured', t => { + t.plan(2) + + const clock = FakeTimers.install({ toFake: ['Date'] }) + const client = new TestClient({ + node: 'http://localhost:9200', + Connection: MockConnection, + sniffOnConnectionFault: true, + maxRetries: 0 + }) + + const conn = client.connectionPool.getConnection() + client.connectionPool.markDead(conn) + clock.tick(1000 * 61) + + client.on('resurrect', (err, meta) => { + t.error(err) + t.strictEqual(meta.name, 'elasticsearch-js') + clock.uninstall() + }) + + client.request({}, { id: 'custom' }, noop) + }) + + t.end() +}) diff --git a/test/acceptance/proxy.test.js b/test/acceptance/proxy.test.js new file mode 100644 index 0000000..69a7ec5 --- /dev/null +++ b/test/acceptance/proxy.test.js @@ -0,0 +1,149 @@ +'use strict' + +// We are using self-signed certificates +process.env.NODE_TLS_REJECT_UNAUTHORIZED = 0 + +const { test } = require('tap') +const { + TestClient, + buildProxy: { + createProxy, + createSecureProxy, + createServer, + createSecureServer + } +} = require('../utils') + +test('http-http proxy support', async t => { + const server = await createServer() + const proxy = await createProxy() + server.on('request', (req, res) => { + t.strictEqual(req.url, '/_cluster/health') + res.setHeader('content-type', 'application/json') + res.end(JSON.stringify({ hello: 'world' })) + }) + + const client = new TestClient({ + node: `http://${server.address().address}:${server.address().port}`, + proxy: `http://${proxy.address().address}:${proxy.address().port}` + }) + + const response = await client.request({ path: '/_cluster/health', method: 'GET' }) + t.deepEqual(response.body, { hello: 'world' }) + + server.close() + proxy.close() +}) + +test('http-https proxy support', async t => { + const server = await createSecureServer() + const proxy = await createProxy() + server.on('request', (req, res) => { + t.strictEqual(req.url, '/_cluster/health') + res.setHeader('content-type', 'application/json') + res.end(JSON.stringify({ hello: 'world' })) + }) + + const client = new TestClient({ + node: `https://${server.address().address}:${server.address().port}`, + proxy: `http://${proxy.address().address}:${proxy.address().port}` + }) + + const response = await client.request({ path: '/_cluster/health', method: 'GET' }) + t.deepEqual(response.body, { hello: 'world' }) + + server.close() + proxy.close() +}) + +test('https-http proxy support', async t => { + const server = await createServer() + const proxy = await createSecureProxy() + server.on('request', (req, res) => { + t.strictEqual(req.url, '/_cluster/health') + res.setHeader('content-type', 'application/json') + res.end(JSON.stringify({ hello: 'world' })) + }) + + const client = new TestClient({ + node: `http://${server.address().address}:${server.address().port}`, + proxy: `https://${proxy.address().address}:${proxy.address().port}` + }) + + const response = await client.request({ path: '/_cluster/health', method: 'GET' }) + t.deepEqual(response.body, { hello: 'world' }) + + server.close() + proxy.close() +}) + +test('https-https proxy support', async t => { + const server = await createSecureServer() + const proxy = await createSecureProxy() + server.on('request', (req, res) => { + t.strictEqual(req.url, '/_cluster/health') + res.setHeader('content-type', 'application/json') + res.end(JSON.stringify({ hello: 'world' })) + }) + + const client = new TestClient({ + node: `https://${server.address().address}:${server.address().port}`, + proxy: `https://${proxy.address().address}:${proxy.address().port}` + }) + + const response = await client.request({ path: '/_cluster/health', method: 'GET' }) + t.deepEqual(response.body, { hello: 'world' }) + + server.close() + proxy.close() +}) + +test('http basic authentication', async t => { + const server = await createServer() + const proxy = await createProxy() + server.on('request', (req, res) => { + t.strictEqual(req.url, '/_cluster/health') + res.setHeader('content-type', 'application/json') + res.end(JSON.stringify({ hello: 'world' })) + }) + + proxy.authenticate = function (req, fn) { + fn(null, req.headers['proxy-authorization'] === `Basic ${Buffer.from('hello:world').toString('base64')}`) + } + + const client = new TestClient({ + node: `http://${server.address().address}:${server.address().port}`, + proxy: `http://hello:world@${proxy.address().address}:${proxy.address().port}` + }) + + const response = await client.request({ path: '/_cluster/health', method: 'GET' }) + t.deepEqual(response.body, { hello: 'world' }) + + server.close() + proxy.close() +}) + +test('https basic authentication', async t => { + const server = await createSecureServer() + const proxy = await createProxy() + server.on('request', (req, res) => { + t.strictEqual(req.url, '/_cluster/health') + res.setHeader('content-type', 'application/json') + res.end(JSON.stringify({ hello: 'world' })) + }) + + proxy.authenticate = function (req, fn) { + fn(null, req.headers['proxy-authorization'] === `Basic ${Buffer.from('hello:world').toString('base64')}`) + } + + const client = new TestClient({ + node: `https://${server.address().address}:${server.address().port}`, + proxy: `http://hello:world@${proxy.address().address}:${proxy.address().port}` + }) + + const response = await client.request({ path: '/_cluster/health', method: 'GET' }) + t.deepEqual(response.body, { hello: 'world' }) + + server.close() + proxy.close() +}) diff --git a/test/acceptance/resurrect.test.js b/test/acceptance/resurrect.test.js new file mode 100644 index 0000000..624d9f5 --- /dev/null +++ b/test/acceptance/resurrect.test.js @@ -0,0 +1,213 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +'use strict' + +const { test } = require('tap') +const { URL } = require('url') +const FakeTimers = require('@sinonjs/fake-timers') +const workq = require('workq') +const { buildCluster, TestClient } = require('../utils') +const { events } = require('../../index') + +/** + * The aim of this test is to verify how the resurrect logic behaves + * in a multi node situation. + * The `buildCluster` utility can boot an arbitrary number + * of nodes, that you can kill or spawn at your will. + * The resurrect API can be tested with its callback + * or by using the `resurrect` event (to handle automatically + * triggered resurrections). + */ + +test('Should execute the recurrect API with the ping strategy', t => { + t.plan(8) + + const clock = FakeTimers.install({ toFake: ['Date'] }) + const q = workq() + + buildCluster({ numberOfNodes: 2 }, cluster => { + const client = new TestClient({ + nodes: [{ + url: new URL(cluster.nodes[Object.keys(cluster.nodes)[0]].url), + id: 'node0' + }, { + url: new URL(cluster.nodes[Object.keys(cluster.nodes)[1]].url), + id: 'node1' + }], + maxRetries: 0 + }) + + client.on(events.RESURRECT, (err, meta) => { + t.error(err) + t.strictEqual(meta.strategy, 'ping') + t.false(meta.isAlive) + t.strictEqual(meta.connection.id, 'node0') + t.strictEqual(meta.name, 'elasticsearch-js') + t.deepEqual(meta.request, { id: 2 }) + }) + + q.add((q, done) => { + cluster.kill('node0', done) + }) + + q.add((q, done) => { + client.request((err, result) => { + t.ok(err) + done() + }) + }) + + q.add((q, done) => { + clock.tick(1000 * 61) + client.request((err, result) => { + t.error(err) + done() + }) + }) + + t.teardown(() => { + clock.uninstall() + cluster.shutdown() + }) + }) +}) + +test('Resurrect a node and handle 502/3/4 status code', t => { + t.plan(15) + + const clock = FakeTimers.install({ toFake: ['Date'] }) + const q = workq() + + var count = 0 + function handler (req, res) { + res.statusCode = count++ < 2 ? 502 : 200 + res.setHeader('content-type', 'application/json') + res.end(JSON.stringify({ hello: 'world' })) + } + + buildCluster({ handler, numberOfNodes: 2 }, ({ nodes, shutdown }) => { + const client = new TestClient({ + nodes: [{ + url: new URL(nodes[Object.keys(nodes)[0]].url), + id: 'node0' + }, { + url: new URL(nodes[Object.keys(nodes)[1]].url), + id: 'node1' + }], + maxRetries: 0 + }) + + var idCount = 2 + client.on(events.RESURRECT, (err, meta) => { + t.error(err) + t.strictEqual(meta.strategy, 'ping') + t.strictEqual(meta.connection.id, 'node0') + t.strictEqual(meta.name, 'elasticsearch-js') + t.deepEqual(meta.request, { id: idCount++ }) + if (count < 4) { + t.false(meta.isAlive) + } else { + t.true(meta.isAlive) + } + }) + + q.add((q, done) => { + client.request((err, result) => { + t.ok(err) + done() + }) + }) + + q.add((q, done) => { + clock.tick(1000 * 61) + client.request((err, result) => { + t.error(err) + done() + }) + }) + + q.add((q, done) => { + clock.tick(1000 * 10 * 60) + client.request((err, result) => { + t.error(err) + done() + }) + }) + + t.teardown(() => { + clock.uninstall() + shutdown() + }) + }) +}) + +test('Should execute the recurrect API with the optimistic strategy', t => { + t.plan(8) + + const clock = FakeTimers.install({ toFake: ['Date'] }) + const q = workq() + + buildCluster({ numberOfNodes: 2 }, cluster => { + const client = new TestClient({ + nodes: [{ + url: new URL(cluster.nodes[Object.keys(cluster.nodes)[0]].url), + id: 'node0' + }, { + url: new URL(cluster.nodes[Object.keys(cluster.nodes)[1]].url), + id: 'node1' + }], + maxRetries: 0, + resurrectStrategy: 'optimistic' + }) + + client.on(events.RESURRECT, (err, meta) => { + t.error(err) + t.strictEqual(meta.strategy, 'optimistic') + t.true(meta.isAlive) + t.strictEqual(meta.connection.id, 'node0') + t.strictEqual(meta.name, 'elasticsearch-js') + t.deepEqual(meta.request, { id: 2 }) + }) + + q.add((q, done) => { + cluster.kill('node0', done) + }) + + q.add((q, done) => { + client.request((err, result) => { + t.ok(err) + done() + }) + }) + + q.add((q, done) => { + clock.tick(1000 * 61) + client.request((err, result) => { + t.error(err) + done() + }) + }) + + t.teardown(() => { + clock.uninstall() + cluster.shutdown() + }) + }) +}) diff --git a/test/acceptance/sniff.test.js b/test/acceptance/sniff.test.js new file mode 100644 index 0000000..0fda336 --- /dev/null +++ b/test/acceptance/sniff.test.js @@ -0,0 +1,297 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +'use strict' + +const { test } = require('tap') +const { URL } = require('url') +const FakeTimers = require('@sinonjs/fake-timers') +const workq = require('workq') +const { buildCluster, TestClient } = require('../utils') +const { Connection, Transport, events, errors } = require('../../index') + +/** + * The aim of this test is to verify how the sniffer behaves + * in a multi node situation. + * The `buildCluster` utility can boot an arbitrary number + * of nodes, that you can kill or spawn at your will. + * The sniffer component can be tested with its callback + * or by using the `sniff` event (to handle automatically + * triggered sniff). + */ + +test('Should update the connection pool', t => { + t.plan(10) + + buildCluster(({ nodes, shutdown }) => { + const client = new TestClient({ + node: nodes[Object.keys(nodes)[0]].url + }) + t.strictEqual(client.connectionPool.size, 1) + + client.on(events.SNIFF, (err, request) => { + t.error(err) + t.strictEqual( + request.meta.sniff.reason, + Transport.sniffReasons.DEFAULT + ) + }) + + // run the sniffer + client.transport.sniff((err, hosts) => { + t.error(err) + t.strictEqual(hosts.length, 4) + + const ids = Object.keys(nodes) + for (var i = 0; i < hosts.length; i++) { + const id = ids[i] + // the first node will be an update of the existing one + if (id === 'node0') { + t.deepEqual(hosts[i], { + url: new URL(nodes[id].url), + id: id, + roles: { + master: true, + data: true, + ingest: true, + ml: false + } + }) + } else { + t.deepEqual(hosts[i], { + url: new URL(nodes[id].url), + id: id, + roles: { + master: true, + data: true, + ingest: true, + ml: false + }, + ssl: null, + agent: null, + proxy: null + }) + } + } + + t.strictEqual(client.connectionPool.size, 4) + }) + t.teardown(shutdown) + }) +}) + +test('Should handle hostnames in publish_address', t => { + t.plan(10) + + buildCluster({ hostPublishAddress: true }, ({ nodes, shutdown }) => { + const client = new TestClient({ + node: nodes[Object.keys(nodes)[0]].url + }) + t.strictEqual(client.connectionPool.size, 1) + + client.on(events.SNIFF, (err, request) => { + t.error(err) + t.strictEqual( + request.meta.sniff.reason, + Transport.sniffReasons.DEFAULT + ) + }) + + // run the sniffer + client.transport.sniff((err, hosts) => { + t.error(err) + t.strictEqual(hosts.length, 4) + + for (var i = 0; i < hosts.length; i++) { + // the first node will be an update of the existing one + t.strictEqual(hosts[i].url.hostname, 'localhost') + } + + t.strictEqual(client.connectionPool.size, 4) + }) + t.teardown(shutdown) + }) +}) + +test('Sniff interval', t => { + t.plan(11) + const clock = FakeTimers.install({ toFake: ['Date'] }) + const q = workq() + + buildCluster(({ nodes, shutdown, kill }) => { + const client = new TestClient({ + node: nodes[Object.keys(nodes)[0]].url, + sniffInterval: 50 + }) + + // this event will be triggered by api calls + client.on(events.SNIFF, (err, request) => { + t.error(err) + const { hosts, reason } = request.meta.sniff + t.strictEqual( + client.connectionPool.size, + hosts.length + ) + t.strictEqual(reason, Transport.sniffReasons.SNIFF_INTERVAL) + }) + + t.strictEqual(client.connectionPool.size, 1) + + q.add((q, done) => { + clock.tick(51) + client.request(err => { + t.error(err) + waitSniffEnd(() => { + t.strictEqual(client.connectionPool.size, 4) + done() + }) + }) + }) + + q.add((q, done) => { + kill('node1', done) + }) + + q.add((q, done) => { + clock.tick(51) + client.request(err => { + t.error(err) + waitSniffEnd(() => { + t.strictEqual(client.connectionPool.size, 3) + done() + }) + }) + }) + + t.teardown(shutdown) + + // it can happen that the sniff operation resolves + // after the API call that trioggered it, so to + // be sure that we are checking the connectionPool size + // at the right moment, we verify that the transport + // is no longer sniffing + function waitSniffEnd (callback) { + if (client.transport._isSniffing) { + setTimeout(waitSniffEnd, 500, callback) + } else { + callback() + } + } + }) +}) + +test('Sniff on start', t => { + t.plan(4) + + buildCluster(({ nodes, shutdown, kill }) => { + const client = new TestClient({ + node: nodes[Object.keys(nodes)[0]].url, + sniffOnStart: true + }) + + client.on(events.SNIFF, (err, request) => { + t.error(err) + const { hosts, reason } = request.meta.sniff + t.strictEqual( + client.connectionPool.size, + hosts.length + ) + t.strictEqual(reason, Transport.sniffReasons.SNIFF_ON_START) + }) + + t.strictEqual(client.connectionPool.size, 1) + t.teardown(shutdown) + }) +}) + +test('Should not close living connections', t => { + t.plan(3) + + buildCluster(({ nodes, shutdown, kill }) => { + class MyConnection extends Connection { + close () { + t.fail('Should not be called') + } + } + + const client = new TestClient({ + node: { + url: new URL(nodes[Object.keys(nodes)[0]].url), + id: 'node1' + }, + Connection: MyConnection + }) + + t.strictEqual(client.connectionPool.size, 1) + client.transport.sniff((err, hosts) => { + t.error(err) + t.strictEqual( + client.connectionPool.size, + hosts.length + ) + }) + + t.teardown(shutdown) + }) +}) + +test('Sniff on connection fault', t => { + t.plan(5) + + buildCluster(({ nodes, shutdown, kill }) => { + class MyConnection extends Connection { + request (params, callback) { + if (this.id === 'http://localhost:9200/') { + callback(new errors.ConnectionError('kaboom'), null) + return {} + } else { + return super.request(params, callback) + } + } + } + + const client = new TestClient({ + nodes: [ + 'http://localhost:9200', + nodes[Object.keys(nodes)[0]].url + ], + maxRetries: 0, + sniffOnConnectionFault: true, + Connection: MyConnection + }) + + t.strictEqual(client.connectionPool.size, 2) + // this event will be triggered by the connection fault + client.on(events.SNIFF, (err, request) => { + t.error(err) + const { hosts, reason } = request.meta.sniff + t.strictEqual( + client.connectionPool.size, + hosts.length + ) + t.strictEqual(reason, Transport.sniffReasons.SNIFF_ON_CONNECTION_FAULT) + }) + + client.request((err, result) => { + t.ok(err instanceof errors.ConnectionError) + }) + + t.teardown(shutdown) + }) +}) diff --git a/test/fixtures/https.cert b/test/fixtures/https.cert new file mode 100644 index 0000000..d859cfa --- /dev/null +++ b/test/fixtures/https.cert @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDBzCCAe+gAwIBAgIJALbQMeb7k/WqMA0GCSqGSIb3DQEBBQUAMBoxGDAWBgNV +BAMMD3d3dy5mYXN0aWZ5Lm9yZzAeFw0xNzAyMDcyMDE5NDJaFw0yNzAyMDUyMDE5 +NDJaMBoxGDAWBgNVBAMMD3d3dy5mYXN0aWZ5Lm9yZzCCASIwDQYJKoZIhvcNAQEB +BQADggEPADCCAQoCggEBAKtfXzDMmU+n3A7oVVOiqp6Z5cgu1t+qgj7TadwXONvO +RZvuOcE8BZpM9tQEDE5XEIdcszDx0tWKHHSobgZAxDaEuK1PMhh/RTNvw1KzYJFm +2G38mqgm11JUni87xmIFqpgJfeCApHnWUv+3/npuQniOoVSL13jdXEifeFM8onQn +R73TVDyvMOjljTulMo0n9V8pYhVSzPnm2uxTu03p5+HosQE2bU0QKj7k8/8dwRVX +EqnTtbLoW+Wf7V2W3cr/UnfPH8JSaBWTqct0pgXqYIqOSTiWQkO7pE69mGPHrRlm +7+whp4WRriTacB3Ul+Cbx28wHU+D83ver4A8LKGVDSECAwEAAaNQME4wHQYDVR0O +BBYEFHVzTr/tNziIUrR75UHXXA84yqmgMB8GA1UdIwQYMBaAFHVzTr/tNziIUrR7 +5UHXXA84yqmgMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAKVSdGeF +vYcZOi0TG2WX7O3tSmu4G4nGxTldFiEVF89G0AU+HhNy9iwKXQLjDB7zMe/ZKbtJ +cQgc6s8eZWxBk/OoPD1WNFGstx2EO2kRkSUBKhwnOct7CIS5X+NPXyHx2Yi03JHX +unMA4WaHyo0dK4vAuali4OYdQqajNwL74avkRIxXFnZQeHzaq6tc6gX+ryB4dDSr +tYn46Lo14D5jH6PtZ8DlGK+jIzM4IE7TEp2iv0CgaTU4ryt/SHPnLxfwZUpl7gSO +EqkMAy3TlRMpv0oXM2Vh/CsyJzq2P/nY/O3bolsashSPWo9WsQTH4giYVA51ZVDK +lGksQD+oWpfa3X0= +-----END CERTIFICATE----- diff --git a/test/fixtures/https.key b/test/fixtures/https.key new file mode 100644 index 0000000..e3778a1 --- /dev/null +++ b/test/fixtures/https.key @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpQIBAAKCAQEAq19fMMyZT6fcDuhVU6KqnpnlyC7W36qCPtNp3Bc4285Fm+45 +wTwFmkz21AQMTlcQh1yzMPHS1YocdKhuBkDENoS4rU8yGH9FM2/DUrNgkWbYbfya +qCbXUlSeLzvGYgWqmAl94ICkedZS/7f+em5CeI6hVIvXeN1cSJ94UzyidCdHvdNU +PK8w6OWNO6UyjSf1XyliFVLM+eba7FO7Tenn4eixATZtTRAqPuTz/x3BFVcSqdO1 +suhb5Z/tXZbdyv9Sd88fwlJoFZOpy3SmBepgio5JOJZCQ7ukTr2YY8etGWbv7CGn +hZGuJNpwHdSX4JvHbzAdT4Pze96vgDwsoZUNIQIDAQABAoIBAG278ys/R8he1yVg +lgqo9ZH7P8zwWTz9ZMsv+vAomor9SUtwvuDCO2AzejYGpY6gZ4AV1tQ3dOaxukjk +9Rbh8AJs+AhZ1t0i2b/3B95z6BkS/vFmt+2GeYhJkMT0BLMNp9AU+9p+5VLy71C5 +k6T3525k/l8x8HZ/YDFMk/LQt8GhvM6A3J3BNElKraiDVO6ZIWgQQ5wiefJkApo1 +BsptHNTx83FbnkEbAahmOR8PfKcRdKY/mZDM2WrlfoU2uwVzPV0/KdYucpsfg2et +jb5bdJzcvZDuDF4GsPi1asCSC1c403R0XGuPFW9TiBuOPxbfhYK2o60yTggX6H2X +39WBc/ECgYEA3KNGgXEWzDSLpGciUisP+MzulOdQPawBTUHNykpQklEppnZbNWCX +07dv6uasnp0pFHG4WlhZJ4+IQBpZH6xAVy9y68PvN7IDYdgMiEiYPSyqQu0rvJGa +2ZR79SHDokZ8K5oofocC839RzleNRqWqxIwhHt29sxVs73kvml6OQm0CgYEAxtbA +zbQwf6DXtFwutSgfOLgdXQK72beBdyeTcpUGbkonl5xHSbtz0CFmRpKiPnXfgg4W +GXlTrqlYF/o048B7dU9+jCKY5DXx1Yzg/EFisEIClad3WXMhNOz1vBYVH6xU3Zq1 +YuYr5dcqiCWDv89e6Y6WJOhwIDZi6RqikD2EJQUCgYEAnWSAJFCnIa8OOo4z5oe/ +kg2m2GQWUphEKXeatQbEaUwquQvPTsmEJUzDMr+xPkkAiAwDpbdGijkSyh/Bmh2H +nGpFwbf5CzMaxI6ZihK3P1SAdNO5koAQBcytjJW0eCtt4rDK2E+5pDgcBGVia5Y8 +to78BYfLDlhnaIF7mtR/CRUCgYEAvGCuzvOcUv4F/eirk5NMaQb9QqYZZD2XWVTU +O2T2b7yvX9J+M1t1cESESe4X6cbwlp1T0JSCdGIZhLXWL8Om80/52zfX07VLxP6w +FCy6G7SeEDxVNRh+6E5qzOO65YP17vDoUacxBZJgyBWKiUkkaW9dzd+sgsgj0yYZ +xz+QlyUCgYEAxdNWQnz0pR5Rt2dbIedPs7wmiZ7eAe0VjCdhMa52IyJpejdeB6Bn +Es+3lkHr0Xzty8XlQZcpbswhM8UZRgPVoBvvwQdQbv5yV+LdUu69pLM7InsdZy8u +opPY/+q9lRdJt4Pbep3pOWYeLP7k5l4vei2vOEMHRjHnoqM5etSb6RU= +-----END RSA PRIVATE KEY----- diff --git a/test/fixtures/small-dataset.ndjson b/test/fixtures/small-dataset.ndjson new file mode 100644 index 0000000..adc0952 --- /dev/null +++ b/test/fixtures/small-dataset.ndjson @@ -0,0 +1,3 @@ +{"user":"jon","age":23} +{"user":"arya","age":18} +{"user":"tyrion","age":39} diff --git a/test/fixtures/stackoverflow.ndjson b/test/fixtures/stackoverflow.ndjson new file mode 100644 index 0000000..3872524 --- /dev/null +++ b/test/fixtures/stackoverflow.ndjson @@ -0,0 +1,5000 @@ +{"id":"4821394","title":"Serializing a private struct - Can it be done?","body":"\u003cp\u003eI have a public class that contains a private struct. The struct contains properties (mostly string) that I want to serialize. When I attempt to serialize the struct and stream it to disk, using XmlSerializer, I get an error saying only public types can be serialized. I don't need, and don't want, this struct to be public. Is there a way I can serialize it and keep it private?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2011-01-27 20:19:13.563 UTC","last_activity_date":"2011-01-27 20:21:37.59 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"163534","post_type_id":"1","score":"0","tags":"c#|serialization|xml-serialization","view_count":"296"} +{"id":"3367882","title":"How do I prevent floated-right content from overlapping main content?","body":"\u003cp\u003eI have the following HTML:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;td class='a'\u0026gt;\n \u0026lt;img src='/images/some_icon.png' alt='Some Icon' /\u0026gt;\n \u0026lt;span\u0026gt;Some content that's waaaaaaaaay too long to fit in the allotted space, but which can get cut off.\u0026lt;/span\u0026gt;\n\u0026lt;/td\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt should display as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[Some content that's wa [ICON]]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have the following CSS:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etd.a span {\n overflow: hidden;\n white-space: nowrap;\n z-index: 1;\n}\n\ntd.a img {\n display: block;\n float: right;\n z-index: 2;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I resize the browser to cut off the text, it cuts off at the edge of the \u003ccode\u003e\u0026lt;td\u0026gt;\u003c/code\u003e rather than before the \u003ccode\u003e\u0026lt;img\u0026gt;\u003c/code\u003e, which leaves the \u003ccode\u003e\u0026lt;img\u0026gt;\u003c/code\u003e overlapping the \u003ccode\u003e\u0026lt;span\u0026gt;\u003c/code\u003e content. I've tried various \u003ccode\u003epadding\u003c/code\u003e and \u003ccode\u003emargin\u003c/code\u003es, but nothing seemed to work. Is this possible?\u003c/p\u003e\n\n\u003cp\u003eNB: It's \u003cem\u003every\u003c/em\u003e difficult to add a \u003ccode\u003e\u0026lt;td\u0026gt;\u003c/code\u003e that just contains the \u003ccode\u003e\u0026lt;img\u0026gt;\u003c/code\u003e here. If it were easy, I'd just do that :)\u003c/p\u003e","accepted_answer_id":"3367943","answer_count":"2","comment_count":"2","creation_date":"2010-07-30 00:01:50.9 UTC","favorite_count":"0","last_activity_date":"2012-05-10 14:16:05.143 UTC","last_edit_date":"2012-05-10 14:16:05.143 UTC","last_editor_display_name":"","last_editor_user_id":"44390","owner_display_name":"","owner_user_id":"1190","post_type_id":"1","score":"2","tags":"css|overflow|css-float|crop","view_count":"4121"} +{"id":"31682135","title":"Gradle command line","body":"\u003cp\u003eI'm trying to run a shell script with gradle. I currently have something like this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef test = project.tasks.create(\"test\", Exec) {\n commandLine 'bash', '-c', 'bash C:/my file dir/script.sh'\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe problem is that I cannot run this script because i have spaces in my dir name. I have tried everything e.g: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecommandLine 'bash', '-c', 'bash C:/my file dir/script.sh'.tokenize() \ncommandLine 'bash', '-c', ['bash', 'C:/my file dir/script.sh']\ncommandLine 'bash', '-c', new StringBuilder().append('bash').append('C:/my file dir/script.sh')\ncommandLine 'bash', '-c', 'bash \"C:/my file dir/script.sh\"'\nFile dir = file('C:/my file dir/script.sh')\ncommandLine 'bash', '-c', 'bash ' + dir.getAbsolutePath();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIm using windows7 64bit and if I use a path without spaces the script runs perfectly, therefore the only issue as I can see is how gradle handles spaces.\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2015-07-28 16:30:18.28 UTC","last_activity_date":"2015-07-28 16:32:15.117 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1299158","post_type_id":"1","score":"1","tags":"bash|shell|android-studio|gradle","view_count":"259"} +{"id":"20218536","title":"Loop variable as parameter in asynchronous function call","body":"\u003cp\u003eI have an object with the following form.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esortedFilters:\n {\n task:{...},\n appointment:{...},\n email:{...}\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow i want to use a \u003ccode\u003efor-in\u003c/code\u003e loop, to build my tasks array for \u003ccode\u003easync.parallel\u003c/code\u003e, which contains the functions to be executed asynchronously:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar tasks = [];\nfor (var entity in sortedFilters) {\n tasks.push(function(callback) {\n var entityResult = fetchRecordsForEntity(entity, businessUnits, sortedFilters);\n var formattedEntityResults = formatResults(entity, entityResult); \n callback(null, formattedEntityResults);\n });\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe problem is, that at the moment the functions are called, \u003ccode\u003eentity\u003c/code\u003e points at the last value of the loop (in this case it would be \u003ccode\u003eemail\u003c/code\u003e).\u003c/p\u003e\n\n\u003cp\u003eHow can i nail the exact value at the moment the function is added to the array?\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2013-11-26 13:34:49.957 UTC","favorite_count":"1","last_activity_date":"2013-11-26 15:07:50.8 UTC","last_edit_date":"2013-11-26 15:02:47.993 UTC","last_editor_display_name":"","last_editor_user_id":"1333873","owner_display_name":"","owner_user_id":"642751","post_type_id":"1","score":"0","tags":"javascript|asynchronous|foreach|async.js","view_count":"120"} +{"id":"19941459","title":"Canot get the href value","body":"\u003cp\u003eHi I need to valid the href is empty or not on my page using javascript. I searched the site and found some example, but it didn't worked for me. I must miss something that I didn't notice. Would someone point me the good direction and my mistake. I got the error\" Unable to get property 'getattribute' of undefined or null reference. The \u003ccode\u003e\u0026lt;a\u0026gt;\u003c/code\u003e element is like that \u003ccode\u003e\u0026lt;a name=\"playback\" href=\"\"\u0026gt;\u003c/code\u003e on html file.\u003c/p\u003e\n\n\u003cp\u003eThanks in advance.\u003c/p\u003e\n\n\u003cp\u003eThere is my code which is run on load event: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar anchors = document.getElementsByTagName(\"a\");\nfor (var i = 0; i \u0026lt; anchors.length; i++)\n{\n anchors[i].onclick = function() {\n if (anchors == null) {\n alert('null');\n }\n else {\n var link = anchors[i].getAttribute(\"href\");\n //var link= anchors[i].attributes['href'] this line doesn't work too.\n }\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"19941620","answer_count":"5","comment_count":"1","creation_date":"2013-11-12 22:41:36.11 UTC","last_activity_date":"2013-11-12 23:48:34.67 UTC","last_edit_date":"2013-11-12 22:43:42.97 UTC","last_editor_display_name":"","last_editor_user_id":"21886","owner_display_name":"","owner_user_id":"819774","post_type_id":"1","score":"0","tags":"javascript","view_count":"97"} +{"id":"10091740","title":"How to send values to from android to a html page in webview","body":"\u003cp\u003eI need to pass a value from java to the html in android.\ni am having a list view, from which i am selecting a particular item,\nthe selected item should appear on the html page in a webview\nis there any way to do it in android, kindly help me please,\ni have searched many websites but all got in vain, \u003c/p\u003e\n\n\u003cp\u003eThanks and Regards\u003c/p\u003e\n\n\u003cp\u003erajesh\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2012-04-10 15:32:45.13 UTC","favorite_count":"0","last_activity_date":"2012-04-10 15:38:29.043 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1324236","post_type_id":"1","score":"0","tags":"android","view_count":"493"} +{"id":"21045569","title":"Why is Python's weekday() different from tm_wday in C?","body":"\u003cp\u003ePython documentation defines \u003ccode\u003edatetime.weekday()\u003c/code\u003e as \u003ca href=\"http://docs.python.org/2/library/datetime.html#datetime.date.weekday\"\u003ean integer, where Monday is 0 and Sunday is 6\u003c/a\u003e, while C's \u003ccode\u003etm.tm_wday\u003c/code\u003e is defined as \u003ca href=\"http://www.cplusplus.com/reference/ctime/tm/\"\u003edays since Sunday\u003c/a\u003e. Therefore \u003ccode\u003etm_wday\u003c/code\u003e is \u003ccode\u003e(datetime.weekday() + 1) % 7\u003c/code\u003e, which is quite inconvenient. Given that Python generally sticks close to C equivalents, why was this made this way?\u003c/p\u003e","accepted_answer_id":"21045622","answer_count":"1","comment_count":"14","creation_date":"2014-01-10 13:27:56.853 UTC","favorite_count":"1","last_activity_date":"2014-01-10 23:38:47.747 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"882478","post_type_id":"1","score":"9","tags":"python|c|datetime","view_count":"1016"} +{"id":"10881784","title":"get new inserted ID in MVC Controller to jQuery","body":"\u003cp\u003eI am updating an entity normally inside a controller as follows :-\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[HttpPost]\npublic ActionResult Create(Project project)\n{\n //var model = new CompositeImageModel(0);\n if (ModelState.IsValid)\n {\n //var model = new CompositeImageModel(project.ProjectID);\n db.Projects.Add(project);\n db.SaveChanges();\n ViewBag.ProjectID = project.ProjectID;\n\n return RedirectToAction(\"Index\");\n }\n\n return View();\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd I wish to grab this new id \"ViewBag.ProjectID\" inside my Jquery AJAX code :-\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eonSaveBegin: function () {\n //CODE FOR SAVE BEGIN \n $('#imageList').fadeIn('slow');\n $(\"#imageList\").click(function () { $(\"#imageList\").load(\"/File/ImageUpload/222\"); }); \n\n},\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003einstead of the hardcoded \"222\".\u003c/p\u003e\n\n\u003cp\u003eHow can I get it?\u003c/p\u003e\n\n\u003cp\u003eThanks for your help and time\u003c/p\u003e\n\n\u003cp\u003e\u003cem\u003e\u003cstrong\u003e\u003c/em\u003e**\u003cem\u003e*\u003c/em\u003e**\u003cem\u003e*\u003c/em\u003e****\u003c/strong\u003e\u003cem\u003eUPDATE\u003c/em\u003e\u003cstrong\u003e\u003cem\u003e*\u003c/em\u003e**\u003cem\u003e*\u003c/em\u003e**\u003cem\u003e*\u003c/em\u003e**\u003cem\u003e*\u003c/em\u003e**\u003cem\u003e*\u003c/em\u003e**\u003cem\u003e*\u003c/em\u003e**\u003cem\u003e*\u003c/em\u003e**\u003cem\u003e*\u003c/em\u003e**\u003cem\u003e*\u003c/em\u003e***\u003c/strong\u003e\nSo I have updated my Jquery as follows :-\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;script type=\"text/javascript\"\u0026gt;\n$(document).ready(function () {\n\n var imageList = $('#imageList'),\n submitButt = $('#submitButt');\n\n //hide the imageList initially\n imageList.hide(); //hide all but the first paragraph\n\n });\n\n\n var Project = {\n save: function () {\n var projectForm = $(\"#projectForm\");\n if (projectForm.valid()) {\n projectForm.submit();\n }\n else {\n Project.onInvalidForm();\n }\n },\n onInvalidForm: function () {\n //CODE FOR INVALID FORM \n },\n onSaveBegin: function () {\n //CODE FOR SAVE BEGIN \n $('#imageList').fadeIn('slow');\n },\n onSaveSuccess: function () {\n //CODE FOR SAVE SUCCESS \n },\n onSaveFailure: function () {\n //CODE FOR SAVE FAILURE \n alert(ViewBag.ProjectID);\n },\n onSaveComplete: function () {\n //CODE FOR SAVE COMPLETE \n //var hfProjectId = $(\"#hfProjectId\").val();\n //$(\"#imageList\").click(function () { $(\"#imageList\").load(\"/File/ImageUpload/\" + hfProjectId); });\n $(\"#imageList\").click(function () { $(\"#imageList\").load(\"/File/ImageUpload/\"+@(ViewBag.ProjectID) ); }); \n }\n }; \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003c/p\u003e\n\n\u003cp\u003eI have moved the code to onSaveComplete, since I should have the ProjectID then, but still am not able to get it yet.\nhowever both options will not work.\u003c/p\u003e\n\n\u003cp\u003e\u003cem\u003e\u003cstrong\u003e\u003c/em\u003e**\u003cem\u003e*\u003c/em\u003e**\u003cem\u003e*\u003c/em\u003e****\u003c/strong\u003e\u003cem\u003eUPDATE 2 \u003cstrong\u003e\u003c/em\u003e**\u003cem\u003e*\u003c/em\u003e**\u003cem\u003e*\u003c/em\u003e**\u003cem\u003e*\u003c/em\u003e**\u003cem\u003e*\u003c/em\u003e**\u003cem\u003e*\u003c/em\u003e**\u003cem\u003e*\u003c/em\u003e**\u003cem\u003e*\u003c/em\u003e**\u003cem\u003e*\u003c/em\u003e**\u003cem\u003e*\u003c/em\u003e\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@model MvcCommons.Models.Project\n\n@{\nViewBag.Title = \"Create\";\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e}\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;h2\u0026gt;Create\u0026lt;/h2\u0026gt;\n\n@{ \nLayout = \"~/Views/Shared/_Layout.cshtml\"; \nHtml.EnableClientValidation(); \nHtml.EnableUnobtrusiveJavaScript(); \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e}\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;script type=\"text/javascript\" src=\"@Url.Content(\"~/Scripts/jquery.validate.min.js\")\"\u0026gt;\u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;script type=\"text/javascript\"\u0026gt;\n $(document).ready(function () {\n\n var imageList = $('#imageList'),\n submitButt = $('#submitButt');\n\n //hide the imageList initially\n imageList.hide(); //hide all but the first paragraph\n\n });\n\n\n var Project = {\n save: function () {\n var projectForm = $(\"#projectForm\");\n if (projectForm.valid()) {\n projectForm.submit();\n }\n else {\n Project.onInvalidForm();\n }\n },\n onInvalidForm: function () {\n //CODE FOR INVALID FORM \n },\n onSaveBegin: function () {\n //CODE FOR SAVE BEGIN \n $('#imageList').fadeIn('slow');\n },\n onSaveSuccess: function () {\n //CODE FOR SAVE SUCCESS \n },\n onSaveFailure: function () {\n //CODE FOR SAVE FAILURE \n alert(ViewBag.ProjectID);\n },\n onSaveComplete: function () {\n //CODE FOR SAVE COMPLETE \n //var hfProjectId = $(\"#hfProjectId\").val();\n //$(\"#imageList\").click(function () { $(\"#imageList\").load(\"/File/ImageUpload/\" + hfProjectId); });\n\n $(\"#imageList\").click(function () { $(\"#imageList\").load(\"/File/ImageUpload/\"+@(ViewBag.ProjectID) ); }); \n }\n }; \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003c/p\u003e\n\n\u003cp\u003e@{\n var projectID = int.Parse(ViewBag.ProjectID);\u003cbr\u003e\n }\u003c/p\u003e\n\n\u003cp\u003e@using (Ajax.BeginForm(\u003cbr\u003e\n \"/Create\",\u003cbr\u003e\n new { },\u003cbr\u003e\n new AjaxOptions\u003cbr\u003e\n {\u003cbr\u003e\n InsertionMode = InsertionMode.Replace,\u003cbr\u003e\n UpdateTargetId = \"projectFormContainer\",\u003cbr\u003e\n OnComplete = \"Project.onSaveComplete\",\u003cbr\u003e\n OnFailure = \"Project.onSaveFailure\",\n OnSuccess = \"Project.onSaveSuccess\",\n OnBegin = \"Project.onSaveBegin\"\u003cbr\u003e\n },\u003cbr\u003e\n new { id = \"projectForm\", name = \"projectForm\" }))\u003cbr\u003e\n {\u003cbr\u003e\n \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e @Html.Hidden(\"hfProjectId\", ViewBag.ProjectID)\n\n \u0026lt;div class=\"editor-label\"\u0026gt; \n @Html.LabelFor(m =\u0026gt; m.ProjectTitle) \n \u0026lt;/div\u0026gt; \n \u0026lt;div class=\"editor-field\"\u0026gt; \n @Html.TextBoxFor(m =\u0026gt; m.ProjectTitle) \n @Html.ValidationMessageFor(m =\u0026gt; m.ProjectTitle) \n \u0026lt;/div\u0026gt; \n \u0026lt;div class=\"editor-label\"\u0026gt; \n @Html.LabelFor(m =\u0026gt; m.ProjectText) \n \u0026lt;/div\u0026gt; \n \u0026lt;div class=\"editor-field\"\u0026gt; \n @Html.TextBoxFor(m =\u0026gt; m.ProjectText) \n @Html.ValidationMessageFor(m =\u0026gt; m.ProjectText) \n \u0026lt;/div\u0026gt; \n \u0026lt;p\u0026gt; \n \u0026lt;input type=\"submit\" value=\"Submit\" onclick=\"Project.save();\" /\u0026gt; \n \u0026lt;/p\u0026gt; \n \u0026lt;/div\u0026gt; \n}\n\n\n\u0026lt;div id='imageList'\u0026gt;\n \u0026lt;h2\u0026gt;Upload Image(s)\u0026lt;/h2\u0026gt;\n @{ \n Html.RenderPartial(\"~/Views/File/ImageUpload.cshtml\", new MvcCommons.ViewModels.ImageModel((int)ViewBag.ProjectID));\n }\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\n @Html.ActionLink(\"Back to List\", \"Index\")\n\n\n\u003cp\u003eCode updated with latest changes\u003c/p\u003e\n\n\u003cp\u003e\u003cem\u003e\u003cstrong\u003e\u003c/em\u003e**\u003cem\u003e*\u003c/em\u003e**\u003cem\u003e*\u003c/em\u003e**\u003cem\u003e*\u003c/em\u003e**\u003c/strong\u003e\u003cem\u003eUPDATED\u003c/em\u003e\u003cstrong\u003e\u003cem\u003e*\u003c/em\u003e**\u003cem\u003e*\u003c/em\u003e**\u003cem\u003e*\u003c/em\u003e**\u003cem\u003e*\u003c/em\u003e**\u003cem\u003e*\u003c/em\u003e**\u003cem\u003e*\u003c/em\u003e**\u003cem\u003e*\u003c/em\u003e**\u003cem\u003e*\u003c/em\u003e***\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eMode updates :-\nChange the @Html.Hidden to this now :-\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e @if(Model != null)\n {\n @Html.Hidden(\"hfProjectId\", Model.ProjectID)\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe Javascript is still the same :=\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e onSaveComplete: function () {\n //CODE FOR SAVE COMPLETE \n var hfProjectId = $(\"#hfProjectId\").val();\n alert(hfProjectId);\n $(\"#imageList\").click(function () { $(\"#imageList\").load(\"/File/ImageUpload/\" + hfProjectId); });\n //$(\"#imageList\").click(function () { $(\"#imageList\").load(\"/File/ImageUpload/\"+@(ViewBag.ProjectID) ); }); \n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003echange the var projectID\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@{\nif (Model != null) \n{\n var projectID = Model.ProjectID;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e}\u003c/p\u003e\n\n\u003cp\u003ein the controller, returning a \"View\", with the model\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e [HttpPost]\n public ActionResult Create(Project project)\n {\n if (ModelState.IsValid)\n {\n db.Projects.Add(project);\n db.SaveChanges();\n ViewBag.ProjectID = project.ProjectID;\n //return RedirectToAction(\"Index\");\n return View(\"Create\", project);\n }\n\n return View();\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eStill no luck though!\u003c/p\u003e\n\n\u003cp\u003e\u003cem\u003e\u003cstrong\u003e\u003c/em\u003e**\u003cem\u003e*\u003c/em\u003e**\u003cem\u003e*\u003c/em\u003e**\u003cem\u003e*\u003c/em\u003e*\u003c/strong\u003e FINAL UPDATE \u003cstrong\u003e\u003cem\u003e*\u003c/em\u003e**\u003cem\u003e*\u003c/em\u003e**\u003cem\u003e*\u003c/em\u003e**\u003cem\u003e*\u003c/em\u003e**\u003cem\u003e*\u003c/em\u003e**\u003cem\u003e*\u003c/em\u003e**\u003cem\u003e*\u003c/em\u003e**\u003cem\u003e*\u003c/em\u003e**\u003cem\u003e*\u003c/em\u003e***\u003c/strong\u003e\nI have decided to create a Project View Model and try to pass variables through it, since the ViewBag was not working in my case. So I changed the HttpPost Create function in the Controller to look as follows :-\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e [HttpPost]\n public ActionResult Create(Project project)\n {\n ProjectModel viewModel = new ProjectModel();\n\n if (ModelState.IsValid)\n {\n db.Projects.Add(project);\n db.SaveChanges();\n viewModel.Project = project;\n return View(\"Index\", viewModel);\n }\n\n return View();\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever this still did not refresh the ProjectID, and so I have decided to abandon this for the time being and try to come up with a better design. However if you could see soemthign wrong that I am doing please comment on this.\u003c/p\u003e\n\n\u003cp\u003eThis is my final Create View :-\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@model MvcCommons.ViewModels.ProjectModel\n@{\nvar projectID = Model.Project.ProjectID;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e}\u003c/p\u003e\n\n\u003cp\u003e@{\n ViewBag.Title = \"Create\";\n}\u003c/p\u003e\n\n\u003ch2\u003eCreate\u003c/h2\u003e\n\n\u003cpre\u003e\u003ccode\u003e@{ \nLayout = \"~/Views/Shared/_Layout.cshtml\"; \nHtml.EnableClientValidation(); \nHtml.EnableUnobtrusiveJavaScript(); \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e}\u003c/p\u003e\n\n\u003cp\u003e`\u003c/p\u003e\n\n\n\n\u003cp\u003e` \n $(document).ready(function () {\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e var imageList = $('#imageList'),\n submitButt = $('#submitButt');\n\n //hide the imageList initially\n imageList.hide(); //hide all but the first paragraph\n\n });\n\n var Project = {\n save: function () {\n var projectForm = $(\"#projectForm\");\n if (projectForm.valid()) {\n projectForm.submit();\n }\n else {\n Project.onInvalidForm();\n }\n },\n onInvalidForm: function () {\n //CODE FOR INVALID FORM \n },\n onSaveBegin: function () {\n //CODE FOR SAVE BEGIN \n alert('onSaveBegin ' + @(projectID));\n $('#imageList').fadeIn('slow');\n },\n onSaveSuccess: function () {\n //CODE FOR SAVE SUCCESS \n //alert('onSaveSuccess')\n },\n onSaveFailure: function () {\n //CODE FOR SAVE FAILURE \n //alert('onSaveFailure ' + @(projectID));\n },\n onSaveComplete: function () {\n //CODE FOR SAVE COMPLETE \n //alert('onSaveComplete ' + @(projectID))\n //$(\"#imageList\").click(function () { $(\"#imageList\").load(\"/File/ImageUpload/\"+@(projectID)); });\n $(\"#imageList\").click(function () { $(\"#imageList\").load(\"/File/ImageUpload/\" + hfProjectId); });\n }\n }; \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@using (Ajax.BeginForm( \n\"/Create\", \nnew { }, \nnew AjaxOptions \n{ \n InsertionMode = InsertionMode.Replace, \n UpdateTargetId = \"projectFormContainer\", \n OnComplete = \"Project.onSaveComplete\", \n OnFailure = \"Project.onSaveFailure\",\n OnSuccess = \"Project.onSaveSuccess\",\n OnBegin = \"Project.onSaveBegin\" \n}, \nnew { id = \"projectForm\", name = \"projectForm\" })) \n{ \n \u0026lt;div\u0026gt; \n\n @*@Html.Hidden(\"hfProjectId\", projectID)*@ \n @Html.Hidden(\"hfProjectId\", Model.Project.ProjectID) \n\n \u0026lt;div class=\"editor-label\"\u0026gt; \n @Html.LabelFor(m =\u0026gt; m.Project.ProjectTitle) \n \u0026lt;/div\u0026gt; \n \u0026lt;div class=\"editor-field\"\u0026gt; \n @Html.TextBoxFor(m =\u0026gt; m.Project.ProjectTitle) \n @Html.ValidationMessageFor(m =\u0026gt; m.Project.ProjectTitle) \n \u0026lt;/div\u0026gt; \n \u0026lt;div class=\"editor-label\"\u0026gt; \n @Html.LabelFor(m =\u0026gt; m.Project.ProjectText) \n \u0026lt;/div\u0026gt; \n \u0026lt;div class=\"editor-field\"\u0026gt; \n @Html.TextBoxFor(m =\u0026gt; m.Project.ProjectText) \n @Html.ValidationMessageFor(m =\u0026gt; m.Project.ProjectText) \n \u0026lt;/div\u0026gt; \n \u0026lt;p\u0026gt; \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e@* *@\u003cbr\u003e\n \u003cbr\u003e\n \u003c/p\u003e\u003cbr\u003e\n \u003cbr\u003e\n }\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div id='imageList'\u0026gt;\n \u0026lt;h2\u0026gt;Upload Image(s)\u0026lt;/h2\u0026gt;\n @{ \n //Html.RenderPartial(\"~/Views/File/ImageUpload.cshtml\", new MvcCommons.ViewModels.ImageModel((int)ViewBag.ProjectID));\n Html.RenderPartial(\"~/Views/File/ImageUpload.cshtml\", new MvcCommons.ViewModels.ImageModel(projectID));\n }\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\n @Html.ActionLink(\"Back to List\", \"Index\")","accepted_answer_id":"10881815","answer_count":"1","comment_count":"2","creation_date":"2012-06-04 13:00:57 UTC","last_activity_date":"2012-06-05 10:06:04.15 UTC","last_edit_date":"2012-06-05 10:06:04.15 UTC","last_editor_display_name":"","last_editor_user_id":"165078","owner_display_name":"","owner_user_id":"165078","post_type_id":"1","score":"1","tags":"asp.net-mvc|jquery|asp.net-ajax|partial-views","view_count":"1245"} +{"id":"19944126","title":"Datagridview not showing up in webpage","body":"\u003cp\u003eI'm using MS Visual Studio 2010 (ASP.NET - C#) and MS SQL Server 2005, and I'm trying to retrieve all the records in my table \u003ccode\u003etblEmployee\u003c/code\u003e from my database \u003ccode\u003eEMPLOYEES\u003c/code\u003e. There's no error when I debug my program in Visual Studio but when the localhost webpage opens, the datagridview \u003ccode\u003edgvEmployee\u003c/code\u003e is not there. There are no retrieved records as well. Here's my code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSqlConnection sConn;\nSqlDataAdapter daEmp;\nDataSet dsEmp;\n\nconst string sStr = \"Server = Server-PC\\\\SQLEXPRESS; Database = EMPLOYEES; Integrated Security = SSPI\";\n\nprotected void Page_Load(object sender, EventArgs e)\n{\n sConn = new SqlConnection(sStr);\n daEmp = new SqlDataAdapter(\"SELECT * FROM tblEmployee\", sConn);\n dsEmp = new DataSet();\n\n daEmp.Fill(dsEmp, \"tblEmployee\");\n\n dsEmp.Tables[\"tblEmployee\"].PrimaryKey = new DataColumn[] { dsEmp.Tables[\"tblEmployee\"].Columns[\"EmployeeID\"] };\n\n dgvEmployee.DataSource = dsEmp.Tables[\"tblEmployee\"];\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is the code in my Defaultpage.aspx:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;asp:GridView ID=\"dgvEmployee\" runat=\"server\"\u0026gt;\n\u0026lt;/asp:GridView\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe database and table name is correct, the table have records, and I'm running both programs as Admin. I just can't figure out what's wrong... Is this regarding with the permissions?\u003c/p\u003e","accepted_answer_id":"19944186","answer_count":"2","comment_count":"0","creation_date":"2013-11-13 02:31:03.253 UTC","last_activity_date":"2013-11-13 02:49:52.193 UTC","last_edit_date":"2013-11-13 02:49:52.193 UTC","last_editor_display_name":"","last_editor_user_id":"1246391","owner_display_name":"","owner_user_id":"2971155","post_type_id":"1","score":"5","tags":"c#|asp.net|sql|sql-server|datagridview","view_count":"2132"} +{"id":"8973110","title":"dnn linqtosql Object reference not set to an instance of an object exception","body":"\u003cp\u003eI have such a code that tries to save some informations to database but my datacontext cannot be created. And it gives such an exception \"\u003cstrong\u003eObject reference not set to an instance of an object\u003c/strong\u003e.\" When i debugged, it jumps form \"DataContext1 db = new DataContext1();\" line to catch block and gives that exception. Is there any solution to this? \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class AuthorPaperDetails\n{\n public void SaveAuthorPaperDetails(string pTitle, string confMakerId, \n string additionalPaperTitle,string mainAuthor, \n int regFeeForFirstAuthor,int regFeeForAdditionalPaper, int RegFeeForCoAuthors)\n {\n\n try\n {\n DataContext1 db = new DataContext1();\n AuthorPaperDetail authorPaperDetail = new AuthorPaperDetail();\n\n authorPaperDetail.paper_title = pTitle;\n authorPaperDetail.conference_maker_id = confMakerId;\n authorPaperDetail.additional_paper_title = additionalPaperTitle;\n authorPaperDetail.areYouMainAuthor = mainAuthor;\n authorPaperDetail.feeForFirstAuthorPaper = regFeeForFirstAuthor;\n authorPaperDetail.feeForAdditionalPaper = regFeeForAdditionalPaper;\n authorPaperDetail.feeForParticipCoAuthors = RegFeeForCoAuthors;\n\n db.AuthorPaperDetails.InsertOnSubmit(authorPaperDetail);\n db.SubmitChanges();\n }\n catch (Exception)\n {\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"8973282","answer_count":"1","comment_count":"0","creation_date":"2012-01-23 14:25:20.647 UTC","last_activity_date":"2012-01-23 14:37:36.73 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"828258","post_type_id":"1","score":"1","tags":"c#|asp.net|linq-to-sql|dotnetnuke","view_count":"670"} +{"id":"41301716","title":"Cannot assign a value on a integer in bash Linux","body":"\u003cp\u003eI asked A few days ago about an error in a bash script. In the meantime I had rebuilded the code and now I still have 1 problem. I want to assign the value of \"waarde to \"vorigewaarde\" in the if loop that looks how much your score is. while I tried to find the problem with bash -x (filename),it says that the value of \"vorigewaarde\" empty is, but I don't see how that can happen.\u003c/p\u003e\n\n\u003cp\u003eThe code (I have marked the line where the fault is, it is after the until code line)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#!/bin/bash\nscore=0\nuitkomst=juist\nwaardegok=0\n\n\n\nNumber=$(($RANDOM % 52))\n\nKAARTEN=(Harten1 Harten2 Harten3 Harten4 Harten5 Harten6 Harten7 Harten8\nHarten9 Harten10 Harten11 Harten12 Harten13 Klaver1 Klaver2 Klaver3\nKlaver4 Klaver5 Klaver6 Klaver7 Klaver8 Klaver9 Klaver10 Klaver11 Klaver12\nKlaver13 Schop1 Schop2 Schop3 Schop4 Schop5 Schop6 Schop7 Schop8 Schop9 \nSchop10 Schop11 Schop12 Schop13 Ruit1 Ruit2 Ruit3 Ruit4 Ruit5 Ruit6 Ruit7\nRuit8 Ruit9 Ruit10 Ruit11 Ruit12 Ruit13)\n\n\nGokkaart=${KAARTEN[$Number]}\necho \" \"\nif (( \"$Number\" \u0026gt;= 0 )) \u0026amp;\u0026amp; (( \"$Number\" \u0026lt;= 12 ));then\n case $Gokkaart in\n Harten1) waarde=1;;\n Harten2) waarde=2;;\n Harten3) waarde=3;;\n Harten4) waarde=4;;\n Harten5) waarde=5;;\n Harten6) waarde=6;;\n Harten7) waarde=7;;\n Harten8) waarde=8;;\n Harten9) waarde=9;;\n Harten10) waarde=10;;\n Harten11) waarde=11;;\n Harten12) waarde=12;;\n Harten13) waarde=13;;\nesac\n\nelif (( \"$Number\" \u0026gt;= 13 )) \u0026amp;\u0026amp; (( \"$Number\" \u0026lt;= 25 ));then\ncase $Gokkaart in\n ##same for Harten only now for Klaveren\nesac\n\nelif (( \"$Number\" \u0026gt;= 26 )) \u0026amp;\u0026amp; (( \"$Number\" \u0026lt;= 38 ));then\ncase $Gokkaart in\n ##same for Klaveren only now for Schoppen\nesac\n\nelif (( \"$Number\" \u0026gt;= 39 )) \u0026amp;\u0026amp; (( \"$Number\" \u0026lt;= 52 ));then\ncase $Gokkaart in\n ##Same for Schoppen only now for Ruiten\nesac\nfi\necho \"De eerste kaart is een $Gokkaart\"\necho \" \"\necho \"$waarde\"\nuntil [ $uitkomst != juist ]\ndo\n echo \" \"\n echo -n \"hoger of lager? type [H of L] \u0026gt; \"\n read gok\n echo \"gok: $gok\"\n\n if [ \"$gok\" = \"H\" ];then\n\n echo \"Uw gok is hoger\"\n waardegok=14\n\n elif [ \"$gok\" = \"L\" ];then\n echo \"Uw gok is lager\"\n waardegok=0\n fi\n\n if (( \"$score\" \u0026gt;= 1 ));then\n\n vorigekaart=$Gokkaart2\n vorigewaarde=$waarde2\n echo \"De vorige kaart was een $Gokkaart2\"\n echo \" \"\n elif (( \"$score\" == 0 ));then **#Here is the error**\n\n vorigekaart=$Gokkaart\n vorigewaarde=$waarde\n echo \"Laten we beginnen\"\n echo \" \"\n fi\n\n Number2=$(($RANDOM % 52))\n\n KAARTEN2=(#same that of array as KAARTEN but now for KAARTEN2 and Gokkaart2)\n\n Gokkaart2=${KAARTEN2[$Number2]}\n\n if (( \"$Number2\"==\"$Number\" ));then\n\n Number2=$(($RANDOM % 52))\n Gokkaart2=${KAARTEN2[$Number2]}\n\n elif (( \"$Number2\" \u0026gt;= 0 )) \u0026amp;\u0026amp; (( \"$Number2\" \u0026lt;= 12 ));then\n\n echo \"De volgende kaart is een harten, namelijk $Gokkaart2\"\n case $Gokkaart2 in\n Harten1) waarde2=1;;\n Harten2) waarde2=2;;\n Harten3) waarde2=3;;\n Harten4) waarde2=4;;\n Harten5) waarde2=5;;\n Harten6) waarde2=6;;\n Harten7) waarde2=7;;\n Harten8) waarde2=8;;\n Harten9) waarde2=9;;\n Harten10) waarde2=10;;\n Harten11) waarde2=11;;\n Harten12) waarde2=12;;\n Harten13) waarde2=13;;\n esac\n\n if (( \"$waardegok\" \u0026gt; \"$waarde2\" )) \u0026amp;\u0026amp; (( \"$waarde2\" \u0026gt; \"$vorigewaarde\" ));then\n\n echo \"$Gokkaart2\"\n echo \"Goed gegokt!\"\n score=$((score+1))\n echo \"Uw score is nu : \"$score\"\"\n echo \" \"\n\n elif (( \"$waardegok\" \u0026lt; \"$waarde2\" )) \u0026amp;\u0026amp; (( \"$waarde2\" \u0026lt; \"$vorigewaarde\" ));then\n\n echo \"$Gokkaart2\"\n echo \"Goed gegokt!\"\n score=$((score+1))\n echo \"Uw score is nu : \"$score\"\"\n echo \" \"\n\n else\n echo \"Fout, maar goed geprobeert!\"\n uitkomst=false\n fi\n\n##this is also the same way for number higher than 12 all the way to 52\ndone\necho \" uw score was $score\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have also edited the code a bit more, now I check everything at the end but it still gives the same error.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eelif (( \"$Number2\" \u0026gt;= 39 )) \u0026amp;\u0026amp; (( \"$Number2\" \u0026lt;= 52 ));then\ncase $Gokkaart2 in\n##same as harten but now for Ruiten\nesac\ncontrolewaarde=$waarde2\n\nfi\n\necho \" \"\necho -n \"hoger of lager? type [H of L] \u0026gt; \"\nread -r gok\necho \"gok: $gok\"\n\nif (( \"$score\" \u0026gt;= 1 ));then\n\n vorigewaarde=$waarde2\n\n echo \"De vorige kaart was een $Gokkaart2\"\n echo \" \"\nelif (( \"$score\" == 0 ));then\n\n vorigewaarde=$waarde\n echo \"Laten we beginnen\"\n echo \"De eerste kaart is een $Gokkaart\"\n echo \" \"\nfi\n\nif [ \"$gok\" = \"H\" ];then\n\n echo \"Uw gok is hoger\"\n waardegok=14\n\nelif [ \"$gok\" = \"L\" ];then\n echo \"Uw gok is lager\"\n waardegok=0\nfi\n\nif (( \"$Number2\" \u0026gt;= 0 )) \u0026amp;\u0026amp; (( \"$Number2\" \u0026lt;= 12 ));then\n\n echo \"De volgende kaart is een harten, namelijk $Gokkaart2\"\n\nelif (( \"$Number2\" \u0026gt;= 13 )) \u0026amp;\u0026amp; (( \"$Number2\" \u0026lt;= 25 ));then\n echo \"De volgende kaart is een klaver, namelijk $Gokkaart2\"\n\nelif (( \"$Number2\" \u0026gt;= 26 )) \u0026amp;\u0026amp; (( \"$Number2\" \u0026lt;= 38 ));then\n echo \"De volgende kaart is een Schoppen, namelijk $Gokkaart2\"\n\nelif (( \"$Number2\" \u0026gt;= 39 )) \u0026amp;\u0026amp; (( \"$Number2\" \u0026lt;= 52 ));then\n echo \"De volgende kaart is een Ruiten, namelijk $Gokkaart2\"\nfi\n\nif (( \"$waardegok\" \u0026gt; \"$waarde2\" )) \u0026amp;\u0026amp; (( \"$controlewaarde\" \u0026gt; \"$vorigewaarde\" ));then\n\n echo \"$Gokkaart2\"\n echo \"Goed gegokt!\"\n score=$((score+1))\n echo \"Uw score is nu : $score\"\n echo \" \"\n\nelif (( \"$waardegok\" \u0026lt; \"$waarde2\" )) \u0026amp;\u0026amp; (( \"$controlewaarde\" \u0026lt; \"$vorigewaarde\" ));then\n\n echo \"$Gokkaart2\"\n echo \"Goed gegokt!\"\n score=$((score+1))\n echo \"Uw score is nu : $score\"\n echo \" \"\n\nelse\n echo \"Fout, maar goed geprobeert!\"\n uitkomst=false\n fi\ndone\necho \" uw score was $score\"\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"9","creation_date":"2016-12-23 12:39:56.183 UTC","last_activity_date":"2016-12-23 15:19:44.287 UTC","last_edit_date":"2016-12-23 15:19:44.287 UTC","last_editor_display_name":"","last_editor_user_id":"7326525","owner_display_name":"","owner_user_id":"7326525","post_type_id":"1","score":"0","tags":"linux|bash|scripting","view_count":"41"} +{"id":"11816186","title":"C# Package Relationship Id","body":"\u003cp\u003eI'm experimenting with the System.IO.Packaging namespace to store some custom files and then read them out later back into code.\u003c/p\u003e\n\n\u003cp\u003eI'm having difficulty finding a definitive example on how to use/set the ID property of a PackagePartRelationship.\u003c/p\u003e\n\n\u003cp\u003eFor example if I have the following:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar relationship = packagePart.CreateRelationship(documentPart.Uri, TargetMode.Internal, relationshipType, relationshipId);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat format should the parameter 'relationshipId' have? All that is stated in the MSDN documentation is that it should adhere to the rules for a valid xsd:Id value from the XML scheme datatype definitions. But searching through that, I can't find a set answer either.\u003c/p\u003e\n\n\u003cp\u003eAlso, in case anyone asks, the reason I want to specify the Id rather than letting it be auto generated is because the will be some relationship chains in the package that only have on \"child\" or \"relationship\" associated with it. So rather than looping over\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epackagePart.GetRelationships()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOr\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epackagePart.GetRelationshipByType(relationshipType)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to be able to do\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epackagePart.GetRelationship(relationshipId)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMany thanks.\u003c/p\u003e","accepted_answer_id":"11816237","answer_count":"1","comment_count":"0","creation_date":"2012-08-05 11:54:22.023 UTC","last_activity_date":"2012-08-05 12:01:28.88 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1013461","post_type_id":"1","score":"0","tags":"c#|.net|xml|package","view_count":"290"} +{"id":"278432","title":"wsdl2java Error: Emitter failure. Invalid endpoint address in port","body":"\u003cp\u003eI am trying to run the wsdl2java command on a WSDL file that was given to me from another group in my company. I know wsdl2java works because I can run the examples but when I try it on the wsdl given to me it fails. The one big difference is that the WSDL given to me uses SSL.\u003c/p\u003e\n\n\u003cp\u003eI’m using Java 1.4 (checked it a few time) and made sure all the correct jars are in my class path, jsse.jar is there.\u003c/p\u003e\n\n\u003cp\u003eCOMMAND: java org.apache.axis.wsdl.WSDL2Java --server-side GenericWebService.wsdl \u003c/p\u003e\n\n\u003cp\u003eERROR:\u003c/p\u003e\n\n\u003cp\u003elog4j:WARN No appenders could be found for logger (org.apache.axis.i18n.ProjectResourceBundle).\nlog4j:WARN Please initialize the log4j system properly.\n**java.io.IOException: Emitter failure. Invalid endpoint address in port AC_x0020_Generic_x0020_Web_0020_ServiceSoap in service AC_x0020_Generic_x0020_Web_x0020_ServiceLocator: **\n at org.apache.axis.wsdl.toJava.JavaServiceImplWriter.writeFileBody(JavaServiceImplWriter.ja\na:242)\n at org.apache.axis.wsdl.toJava.JavaWriter.generate(JavaWriter.java:127)\n at org.apache.axis.wsdl.toJava.JavaServiceWriter.generate(JavaServiceWriter.java:112)\n at org.apache.axis.wsdl.toJava.JavaGeneratorFactory$Writers.generate(JavaGeneratorFactory.j\nva:421)\n at org.apache.axis.wsdl.gen.Parser.generate(Parser.java:476)\n at org.apache.axis.wsdl.gen.Parser.access$000(Parser.java:45)\n at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:362)\n at java.lang.Thread.run(Thread.java:534)\u003c/p\u003e\n\n\u003cp\u003easdf\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;wsdl:portType name=\"AC_x0020_Generic_x0020_Web_x0020_ServiceSoap\"\u0026gt;\n \u0026lt;wsdl:operation name=\"Provision\"\u0026gt;\n \u0026lt;wsdl:input message=\"tns:ProvisionSoapIn\" /\u0026gt;\n \u0026lt;wsdl:output message=\"tns:ProvisionSoapOut\" /\u0026gt;\n \u0026lt;/wsdl:operation\u0026gt;\n\u0026lt;/wsdl:portType\u0026gt;\n\n\u0026lt;wsdl:binding name=\"AC_x0020_Generic_x0020_Web_x0020_ServiceSoap\" type=\"tns:AC_x0020_Generic_x0020_Web_x0020_ServiceSoap\"\u0026gt;\n \u0026lt;soap:binding transport=\"http://schemas.xmlsoap.org/soap/http\" /\u0026gt;\n \u0026lt;wsdl:operation name=\"Provision\"\u0026gt;\n \u0026lt;soap:operation soapAction=\"http://xmlns.fmr.com/systems/dev/aar/2008/05/GenericWebService/Provision\" style=\"document\" /\u0026gt;\n \u0026lt;wsdl:input\u0026gt;\n \u0026lt;soap:body use=\"literal\" /\u0026gt;\n \u0026lt;soap:header message=\"tns:ProvisionServiceProcessingDirectives\" part=\"ServiceProcessingDirectives\" use=\"literal\" /\u0026gt;\n \u0026lt;soap:header message=\"tns:ProvisionServiceCallContext\" part=\"ServiceCallContext\" use=\"literal\" /\u0026gt;\n \u0026lt;/wsdl:input\u0026gt;\n \u0026lt;wsdl:output\u0026gt;\n \u0026lt;soap:body use=\"literal\" /\u0026gt;\n \u0026lt;/wsdl:output\u0026gt;\n \u0026lt;/wsdl:operation\u0026gt;\n\u0026lt;/wsdl:binding\u0026gt;\n\n\n\u0026lt;wsdl:service name=\"AC_x0020_Generic_x0020_Web_x0020_Service\"\u0026gt;\n \u0026lt;wsdl:documentation xmlns:wsdl=\"http://schemas.xmlsoap.org/wsdl/\"\u0026gt;Generic web service definition for provisioning requests callable by AccessCENTRAL\u0026lt;/wsdl:documentation\u0026gt;\n \u0026lt;wsdl:port name=\"AC_x0020_Generic_x0020_Web_x0020_ServiceSoap\" binding=\"tns:AC_x0020_Generic_x0020_Web_x0020_ServiceSoap\"\u0026gt;\n \u0026lt;soap:address location=\"\" /\u0026gt;\n \u0026lt;/wsdl:port\u0026gt;\n\u0026lt;/wsdl:service\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eUPDATED SOLUTION:\u003c/strong\u003e\nThe problem was that the parser needed a value in the \u0026lt;soap:address location=\"\" /\u0026gt; for it to complete. I added the URL of my service and it worked.\u003cbr\u003e\nNew Lines looked like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;soap:address location=\"\" http://localhost:8080/axis/services/AC_x0020_Generic_x0020_Web_x0020_Service\" /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"278851","answer_count":"1","comment_count":"2","creation_date":"2008-11-10 16:49:12.883 UTC","last_activity_date":"2009-08-11 14:04:41.557 UTC","last_edit_date":"2009-08-11 14:04:41.557 UTC","last_editor_display_name":"Ben","last_editor_user_id":"16424","owner_display_name":"Ben","owner_user_id":"16424","post_type_id":"1","score":"1","tags":"java|web-services","view_count":"8524"} +{"id":"13022205","title":"how to make a UIImageView rotate around its center","body":"\u003cp\u003eim making an ios app in xcode 4 and I need a square UIImageView to rotate around its center to the number of degrees I give it.\u003c/p\u003e\n\n\u003cp\u003edoes anyone know how to do this??\u003c/p\u003e\n\n\u003cp\u003ethanks\u003c/p\u003e","accepted_answer_id":"13023228","answer_count":"2","comment_count":"0","creation_date":"2012-10-23 01:06:08.34 UTC","last_activity_date":"2012-10-23 03:40:26.753 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1664945","post_type_id":"1","score":"1","tags":"objective-c|ios|uiimageview","view_count":"1250"} +{"id":"39799351","title":"Create Sitecore cshtml Rendering for Inserting JavaScript","body":"\u003cp\u003eI need to create a cshtml rendering and Sitecore control that allows me to insert JavaScript from a Sitecore field. I can then attach this control to the layout to insert the JavaScript on the page.\u003c/p\u003e\n\n\u003cp\u003eI tried inserting \u003ccode\u003e\u0026lt;script\u0026gt;\u003c/code\u003e into a control that uses a rich text editor, but Sitecore strips out \u003ccode\u003e\u0026lt;script\u0026gt;\u003c/code\u003e from the editor by default, which led me to this solution.\u003c/p\u003e\n\n\u003cp\u003eI know the basics--there needs to be the cshtml rendering, a template (assuming one field only, a multiline text field), and a layout rendering with the path to the cshtml file, but not much more than that. \u003c/p\u003e\n\n\u003cp\u003eThe developers have used Glass Mapper, I don't know how that plays into the above, or how to re-instance this. This will be my first control. Here's a sample cshtml file if it helps:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@inherits Glass.Mapper.Sc.Web.Mvc.GlassView\u0026lt;Company.Model.TDS.sitecore.templates.User_Defined.Company.Platform.Modules.Common.Sidebar_Text_Callout\u0026gt;\n\n @if (Model != null)\n {\n \u0026lt;div class=\"sidebar-text-callout\"\u0026gt;\n \u0026lt;h3\u0026gt;@Editable(Model, x =\u0026gt; x.Sidebar_Callout_Title)\u0026lt;/h3\u0026gt;\n \u0026lt;p\u0026gt;@Editable(Model, x =\u0026gt; x.Sidebar_Callout_Copy)\u0026lt;/p\u0026gt;\n @if (Model.Sidebar_Callout_Link != null)\n {\n \u0026lt;div class=\"all-caps-callout\"\u0026gt;\n \u0026lt;a class=\"link-with-icon\" href=\"@Model.Sidebar_Callout_Link.Url\" target=\"@Model.Sidebar_Callout_Link.Target\"\u0026gt;@Model.Sidebar_Callout_Link.Text \u0026lt;span class=\"svg\"\u0026gt;@Html.Partial(\"~/Views/Icons/arrowRight.cshtml\")\u0026lt;/span\u0026gt;\u0026lt;/a\u0026gt;\n \u0026lt;/div\u0026gt;\n }\n \u0026lt;/div\u0026gt;\n }\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"39799972","answer_count":"1","comment_count":"0","creation_date":"2016-09-30 20:08:33.58 UTC","last_activity_date":"2016-10-09 07:35:55.003 UTC","last_edit_date":"2016-10-09 07:35:55.003 UTC","last_editor_display_name":"","last_editor_user_id":"1016716","owner_display_name":"","owner_user_id":"3595575","post_type_id":"1","score":"1","tags":"javascript|razor|sitecore","view_count":"212"} +{"id":"8012589","title":"opengl color conversion / or SDI signal conversion?","body":"\u003cul\u003e\n\u003cli\u003e\u003cp\u003eI draw in opengl with RGBA colors these texts (with the color between parenthesis) :\nRED-alpha50 (255,0,0,50) RED-alpha128 (255,0,0,128) RED-alpha255 (255,0,0,255)\nGREEN-alpha50 (0,255,0,50) GREEN-alpha128 (0,255,0,128) GREEN-alpha255 (0,255,0,255)\nBLUE-alpha50 (0,0,255,50) BLUE-alpha128 (0,0,255,128) BLUE-alpha255 (0,0,255,255)\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eI memcpy in the buffer (getByte) of a frame created with the format bmdFormat8BitBGRA\nat the size of 1280 pixels by 720 pixels,\nand then send it to the SDI output of a video capture card.\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eHere are links to screenshot of what we see on the TV set :\nChannel A (should be the fill : so we expect RGB values)\n\u003ca href=\"http://www.hostingpics.net/viewer.php?id=444718SDIChA.jpg\" rel=\"nofollow noreferrer\"\u003eHeberger image http://img11.hostingpics.net/thumbs/mini_444718SDIChA.jpg\u003c/a\u003e\u003c/p\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eChannel B (should be the key : so we expect grey-scale values)\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://www.hostingpics.net/viewer.php?id=449411SDIChB.jpg\" rel=\"nofollow noreferrer\"\u003eHeberger image http://img11.hostingpics.net/thumbs/mini_449411SDIChB.jpg\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI am not sure which color conversion I should try.\u003c/p\u003e\n\n\u003cp\u003e=\u003e Can someone give me hint or working tracks for why the background which should be black is a \"half\" green (I reckon it to be green with 50% alpha : 0,255,0,128 or else in YUV) ?\u003c/p\u003e\n\n\u003cp\u003e=\u003e Is it a question of unsigned byte vs byte : why do I obtain black with (255,0,0,128) and red with (255,0,0,255) : why is the red range reached with alpha between 128 and 255 ?\n(but green gets whiter at (0,255,0,255) and blue is a little greenish at (0,0,255,128)).\u003c/p\u003e\n\n\u003cp\u003e=\u003e is it a question of converting SDI to HDMI or a HDCP issue ?\u003c/p\u003e\n\n\u003cp\u003eThanks to all for any help,\nI am a bit dazzled, and quite new to color conversion,\nany help will be so great,\ncheers,\u003c/p\u003e","accepted_answer_id":"8080244","answer_count":"1","comment_count":"1","creation_date":"2011-11-04 16:29:53.427 UTC","last_activity_date":"2011-11-10 13:30:54.663 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"706318","post_type_id":"1","score":"0","tags":"opengl|colors","view_count":"192"} +{"id":"8453519","title":"Does javascript on iOS have to be downloaded *by* the WebKit framework in addition to executing within its framework?","body":"\u003cp\u003eThe agreement says this:\u003c/p\u003e\n\n\u003cp\u003e3.3.2 An Internal Use Application may not download or install executable code. Interpreted code may only be used in an Application if all scripts, code and interpreters are packaged in the Application and not downloaded. The only exception to the foregoing is scripts and code downloaded and run by Apple's built-in WebKit framework.\u003c/p\u003e\n\n\u003cp\u003eIt particular it says \".. code downloaded .. by Webkit framework\".\u003c/p\u003e\n\n\u003cp\u003eDoes anybody know if for a native app using UIWebView this means Javascript has to be downloaded automatically by Webkit i.e. as a consequence of the user clicking on an external url link. Or if it would be acceptable for the scripts to be downloaded by creating my own HTTP connection to a server and downloading them myself - but they would be executed within Webkit (via UIWebView) ?\u003c/p\u003e\n\n\u003cp\u003eI presume this restriction is for security purposes, so does the security come from limiting the execution to within WebKit, as opposed to where the scripts are downloaded from?\u003c/p\u003e\n\n\u003cp\u003eI realize its unlikely anybody can definitively answer this except Apple, but speculate answers are very welcome.\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","accepted_answer_id":"8454951","answer_count":"1","comment_count":"3","creation_date":"2011-12-10 00:58:31.99 UTC","last_activity_date":"2011-12-10 06:46:14.093 UTC","last_edit_date":"2011-12-10 01:44:10.64 UTC","last_editor_display_name":"","last_editor_user_id":"1082219","owner_display_name":"","owner_user_id":"1082219","post_type_id":"1","score":"3","tags":"ios|app-store","view_count":"1903"} +{"id":"24206311","title":"ColdFusion Object to String","body":"\u003cp\u003eI'm really new to ColdFusion and am trying to pull data out of the database and send it to an email function I have created.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emyQry = new Query();\nmyQry.setSQL(\"select * from stocknotifications LEFT JOIN options ON stocknotifications.stocknotification_id = options.option_id ORDER BY stocknotification_id DESC LIMIT 1 \"); //set query\n\n\nqryRes = myQry.execute();\n\nwritedump(qryRes.getResult(), false);\n\nMail = variables.NotificationService.newMail();\nMail.setTo(\"bfrench@destinationcms.co.uk\");\nMail.setSubject( \"New Stock Request\" );\n\n// render body with layout which uses the rc.emailView\nMail.setBody(ToString(qryRes.getResult()));\nvariables.NotificationService.sendMail( Mail );\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy writeDump() works and shows the last item in table. The only problem is I can't pass it into setBody() without it throwing an error. \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e\u003cem\u003eCan't cast Complex Object Type Query to String\n Use Built-In-Function \"serialize(Query):String\" to create a String from Query\u003c/em\u003e\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eAny ideas? \u003c/p\u003e","accepted_answer_id":"24209436","answer_count":"2","comment_count":"3","creation_date":"2014-06-13 13:18:37.403 UTC","last_activity_date":"2014-06-13 17:09:35.93 UTC","last_edit_date":"2014-06-13 13:39:14.52 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"1583972","post_type_id":"1","score":"2","tags":"coldfusion|railo","view_count":"556"} +{"id":"6029057","title":"Write a list of Complex Numbers as Binary Data","body":"\u003cp\u003eI'm trying to output some data from a python script to a binary file.\u003c/p\u003e\n\n\u003cp\u003eIf I have a list of floats I've been using this \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eout_file = open(\"filename\", \"wb\")\nfloat_array.array(\"f\", [])\nfloat_array.fromlist(mylist)\nfloat_array.tofile(out_file)\nout_file.close()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis seems to work fine, at least it's resulting in a file with the correct number of bytes.\u003c/p\u003e\n\n\u003cp\u003eHow can I do the same thing but using a list of complex numbers?\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","accepted_answer_id":"6029175","answer_count":"2","comment_count":"2","creation_date":"2011-05-17 09:45:56.91 UTC","last_activity_date":"2011-05-17 09:58:23.093 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"566986","post_type_id":"1","score":"1","tags":"python","view_count":"1110"} +{"id":"10704000","title":"Rails 3 wicked_pdf and pagination","body":"\u003cp\u003eIs there any simple solution for custom paginating pdf? I was thinking about some javascript which will check the div height and paginate when next element will overflow the aggregating div - is there something like this implemented already?\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2012-05-22 14:22:17.587 UTC","last_activity_date":"2013-03-07 20:20:00.533 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1004946","post_type_id":"1","score":"1","tags":"javascript|ruby-on-rails-3|pagination|pdf-generation|wicked-pdf","view_count":"806"} +{"id":"14449279","title":"32bit or 64bit Android SDK on Windows 64bit OS?","body":"\u003cp\u003eInstalling a dev machine for Android development. 64bit Win7, soon will upgrade to Win8, 16GB RAM. Now the selection at the android download:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e64bit or 32bit Android SDK?\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat should Duffman do? Seems most poeple here go for the 64bit version, but are there arguments for/against? Hasslefree installation?\u003c/p\u003e\n\n\u003cp\u003eEDIT\u003c/p\u003e\n\n\u003cp\u003eThis question was posted because I wanted to setup JetBrains IntelliJ together with the SDK. Reason was that I did not like Eclipse in the past. So when I reached the 32/64 question while downloading I was not sure and did research. The result was that there were many troubles dependent on the 32/64bit-version. In the end I gave the current Eclipse/ADT version a try and got it running quickly. I got great support from a Jetbrains guy, but finally did not follow that route, since the Eclipse toolset just worked.\u003c/p\u003e\n\n\u003cp\u003eEDIT 29.7.2013\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003e64bit Version Eclipse works just fine\u003c/strong\u003e\u003c/p\u003e","accepted_answer_id":"14450615","answer_count":"1","comment_count":"7","creation_date":"2013-01-21 23:51:09.343 UTC","favorite_count":"2","last_activity_date":"2013-07-29 15:03:39.653 UTC","last_edit_date":"2013-07-29 15:03:39.653 UTC","last_editor_display_name":"","last_editor_user_id":"857848","owner_display_name":"","owner_user_id":"857848","post_type_id":"1","score":"22","tags":"android|windows|sdk","view_count":"33332"} +{"id":"20960780","title":"best way to refractor this code?","body":"\u003cpre\u003e\u003ccode\u003epackage com.example.moviesearch;\n\nimport java.util.ArrayList;\n\nimport org.json.JSONArray;\nimport org.json.JSONException;\nimport org.json.JSONObject;\n\nimport android.util.Log;\n\npublic class ParseJSON {\n private ArrayList\u0026lt;Movie\u0026gt; movies;\n private String genres;\n private String rated;\n private String language;\n private int rating;\n private String country;\n private String release_date;\n private String title;\n private String directors;\n private String actors;\n private String plot_simple;\n private String poster;\n private String runtime;\n private String imdb_url;\n\n public ArrayList\u0026lt;Movie\u0026gt; parseJson(String json) {\n movies = new ArrayList\u0026lt;Movie\u0026gt;();\n try {\n JSONArray jArray = new JSONArray(json);\n for (int i = 0; i \u0026lt; jArray.length(); i++) {\n JSONObject j = jArray.getJSONObject(i);\n try {\n genres = j.getString(\"genres\").replace(\"[\", \"\")\n .replace(\"]\", \"\").replaceAll(\"\\\"\", \"\");\n } catch (Exception e) {\n genres = \"notfound\";\n }\n try {\n rated = j.getString(\"rated\");\n } catch (Exception e) {\n rated = \"not found\";\n }\n try {\n language = j.getString(\"language\").replace(\"[\", \"\")\n .replace(\"]\", \"\").replaceAll(\"\\\"\", \"\");\n } catch (Exception e) {\n language = \"notfound\";\n }\n\n try {\n rating = j.getInt(\"rating\");\n } catch (Exception e) {\n rating = 404;\n }\n\n try {\n country = j.getString(\"country\").replace(\"[\", \"\")\n .replace(\"]\", \"\").replaceAll(\"\\\"\", \"\");\n } catch (Exception e) {\n country = \"not found\";\n }\n try {\n release_date = j.getString(\"release_date\");\n } catch (Exception e) {\n release_date = \"notfound\";\n }\n try {\n title = j.getString(\"title\").replace(\"\\n\", \"\");\n } catch (Exception e) {\n title = \"notfound\";\n }\n try {\n directors = j.getString(\"directors\").replace(\"[\", \"\")\n .replace(\"]\", \"\").replaceAll(\"\\\"\", \"\");\n } catch (Exception e) {\n directors = \"notfound\";\n }\n try {\n actors = j.getString(\"actors\").replace(\"[\", \"\")\n .replace(\"]\", \"\").replaceAll(\"\\\"\", \"\");\n } catch (Exception e) {\n actors = \"notfound\";\n }\n try {\n plot_simple = j.getString(\"plot_simple\");\n } catch (Exception e) {\n poster = \"notfound\";\n }\n try {\n JSONObject c = j.getJSONObject(\"poster\");\n poster = c.getString(\"cover\");\n } catch (Exception e) {\n poster = \"notfound\";\n }\n try {\n runtime = j.getString(\"runtime\").replace(\"[\", \"\")\n .replace(\"]\", \"\").replaceAll(\"\\\"\", \"\");\n } catch (Exception e) {\n runtime = \"notfound\";\n }\n try {\n imdb_url = j.getString(\"imdb_url\");\n } catch (Exception e) {\n imdb_url = \"notfound\";\n }\n Movie movie = new Movie(genres, rated, language, rating,\n country, release_date, title, directors, actors,\n plot_simple, poster, runtime, imdb_url);\n movies.add(movie);\n }\n\n } catch (JSONException e) {\n Log.e(\"jsonerror\", \"\", e);\n }\n return movies;\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am making an android app and needing to parse json data. I turn this json data into a custom Class. Sometimes the json I parse doesn't exist so I have to put in a default value for it, I feel this is too brute.\u003c/p\u003e","accepted_answer_id":"20960840","answer_count":"1","comment_count":"4","creation_date":"2014-01-06 22:48:55.43 UTC","favorite_count":"1","last_activity_date":"2014-01-06 22:53:14.78 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1650393","post_type_id":"1","score":"-3","tags":"java|android|json","view_count":"347"} +{"id":"40737799","title":"Language Hierarchy in Java","body":"\u003cpre\u003e\u003ccode\u003epublic class BLLanguageProvider extends LanguageProvider {\n @Override\n public LanguageEmbedding\u0026lt;?\u0026gt; findLanguageEmbedding(Token\u0026lt;?\u0026gt; token, LanguagePath lp, InputAttributes ia) {\n return null;\n }\n\n @Override\n public Language\u0026lt;?\u0026gt; findLanguage(String mimeType) {\n if(\"text/x-bl\".equals(mimeType)){\n return new BLLanguageHierarchy().language();\n }\n\n return null;\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm having a problem with my code.\nI already imported LanguageHierarchy but it's returning \"cannot find symbol\"\u003c/p\u003e\n\n\u003cp\u003eI'm following a tutorial at the following link:\n\u003ca href=\"http://wiki.netbeans.org/SyntaxColoringANTLR#Using_an_ANTLR_Lexer_For_Syntax_Coloring_Tutorial\" rel=\"nofollow noreferrer\"\u003ehttp://wiki.netbeans.org/SyntaxColoringANTLR#Using_an_ANTLR_Lexer_For_Syntax_Coloring_Tutorial\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI'm at the part of making the C Minus language provider which I replaced with BL.\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2016-11-22 09:13:38.633 UTC","last_activity_date":"2016-11-22 09:24:16.92 UTC","last_edit_date":"2016-11-22 09:18:50.507 UTC","last_editor_display_name":"","last_editor_user_id":"6404321","owner_display_name":"","owner_user_id":"6398398","post_type_id":"1","score":"0","tags":"java|netbeans|antlr","view_count":"69"} +{"id":"46912202","title":"Call function from React Component from function","body":"\u003cp\u003eI have a React Component\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eexport function sendAlert(msg) {\n showAlert() //How to call in normal function a function from React.Component\n}\n\n\nexport class Alert extends React.Component {\n\n showAlert = () =\u0026gt; {\n alert(\"a\")\n };\n\n render() {\n return (\n \u0026lt;div\u0026gt;\n \u0026lt;h1\u0026gt;Component\u0026lt;/h1\u0026gt;\n \u0026lt;/div\u0026gt;\n )\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIts possible to call function which call a function from \u003ccode\u003eReact.Component\u003c/code\u003e\u003c/p\u003e","accepted_answer_id":"46912368","answer_count":"3","comment_count":"0","creation_date":"2017-10-24 13:45:47.32 UTC","last_activity_date":"2017-10-24 14:21:56.56 UTC","last_edit_date":"2017-10-24 14:02:21.04 UTC","last_editor_display_name":"","last_editor_user_id":"4089357","owner_display_name":"","owner_user_id":"7047952","post_type_id":"1","score":"2","tags":"javascript|reactjs","view_count":"29"} +{"id":"9789560","title":"Dimension-independent loop over boost::multi_array?","body":"\u003cp\u003eSay I've got an N-dimensional boost::multi_array (of type int for simplicity), where \u003ccode\u003eN\u003c/code\u003e is known at compile time but can vary (i.e. is a non-type template parameter). Let's assume that all dimensions have equal size \u003ccode\u003em\u003c/code\u003e.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etypedef boost::multi_array\u0026lt;int, N\u0026gt; tDataArray;\nboost::array\u0026lt;tDataArray::index, N\u0026gt; shape;\nshape.fill(m);\ntDataArray A(shape);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow I would like to loop over all entries in \u003ccode\u003eA\u003c/code\u003e, e.g. to print them. If N was 2 for example I think I would write something like this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e boost::array\u0026lt;tDataArray::index, 2\u0026gt; index;\n for ( int i = 0; i \u0026lt; m; i++ )\n {\n for ( int j = 0; j \u0026lt; m; j++ )\n {\n index = {{ i, j }};\n cout \u0026lt;\u0026lt; A ( index ) \u0026lt;\u0026lt; endl;\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI've used an index object to access the elements as I think this is more flexible than the []-operator here.\u003c/p\u003e\n\n\u003cp\u003eBut how could I write this without knowing the number of dimensions \u003ccode\u003eN\u003c/code\u003e. Is there any built-in way? The documentation of multi_array is not very clear on which types of iterators exist, etc.\nOr would I have to resort to some custom method with custom pointers, computing indices from the pointers, etc.? If so - any suggestions how such an algorithm could look like?\u003c/p\u003e","accepted_answer_id":"9837332","answer_count":"3","comment_count":"4","creation_date":"2012-03-20 15:17:45.25 UTC","favorite_count":"1","last_activity_date":"2016-05-10 14:33:20.56 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"392772","post_type_id":"1","score":"5","tags":"c++|algorithm|boost|multidimensional-array","view_count":"1807"} +{"id":"43787891","title":"Get element being sorted within helper function","body":"\u003cp\u003ei'm using jQuery UI and would like to modify the helper So I do this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(\"#container\").sortable({\n helper: function(event, ui) {\n var newHelper = ; // new helper HTML\n return newHelper;\n }\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy question is: How can I get the element being sorted within the helper function? I want to get the height of the sorted element but can't get the element to begin with. I have tried the following with no luck:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eui.item;\nui.element;\nui.helper; \n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"43788125","answer_count":"2","comment_count":"2","creation_date":"2017-05-04 16:06:37.347 UTC","last_activity_date":"2017-05-04 16:36:31.59 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3758078","post_type_id":"1","score":"-1","tags":"jquery|user-interface|jquery-ui-sortable","view_count":"75"} +{"id":"18972984","title":"How am I supposed to get the Container instance for my app","body":"\u003cp\u003eI can get access to this variable using the private instance variable \u003ccode\u003eApp.__container__\u003c/code\u003e, but this is obviously bad practice.\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2013-09-24 04:30:05.153 UTC","last_activity_date":"2013-09-24 04:30:05.153 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"822249","post_type_id":"1","score":"0","tags":"ember.js","view_count":"22"} +{"id":"38158235","title":"How topojson's world map scale has set?","body":"\u003cp\u003ein \u003ca href=\"https://github.com/mbostock/topojson/blob/master/examples/world-110m.json\" rel=\"nofollow\"\u003eworld-110m.json\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003ethere is a scale value.\n\u003ccode\u003e[0.0036000360003600037, 0.0017364686646866468]\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eand I got this values are computed from \u003ccode\u003e[360/99990, 173.64513/99999]\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eok, \u003ccode\u003e360\u003c/code\u003e from latitude, \u003ccode\u003e173.64\u003c/code\u003e from longitude, just for including northernmost lang point.\u003c/p\u003e\n\n\u003cp\u003ebut where does that denominators (\u003ccode\u003e99990\u003c/code\u003e and \u003ccode\u003e99999\u003c/code\u003e) came from?\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2016-07-02 08:44:30.547 UTC","last_activity_date":"2016-07-02 16:54:09.733 UTC","last_edit_date":"2016-07-02 08:55:26.807 UTC","last_editor_display_name":"","last_editor_user_id":"5107380","owner_display_name":"","owner_user_id":"5107380","post_type_id":"1","score":"0","tags":"d3.js|geospatial|topojson","view_count":"29"} +{"id":"17394826","title":"JS events source detection","body":"\u003cp\u003eI'm working on a part of my web site where people can vote on publications, I have many in the same page, and next every publication there are two images one to agree and the other to disagree. I want to change the images, so when someone votes, whether agree or not, the image changes to say he already voted.\nHere's my code:\u003c/p\u003e\n\n\u003cp\u003eJPS:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;logic:iterate id=\"comment\" name=\"Liste_Comments\" scope=\"request\"\u0026gt; \n\u0026lt;html:img src=\"pages/images/ok.png\" alt=\"Vote pour!\" paramId=\"code\" paramName=\"comment\" paramProperty=\"code\" onclick=\"voterComment('pour');\"/\u0026gt; \n\n\u0026lt;html:img src=\"pages/images/ko.png\" alt=\"Vote contre!\" paramId=\"code\" paramName=\"comment\" paramProperty=\"code\" onclick=\"voterComment('contre');\"/\u0026gt; \n\n \u0026lt;bean:write name=\"comment\" property=\"libelle\" /\u0026gt; \n \u0026lt;bean:write name=\"comment\" property=\"subject\" /\u0026gt; \n \u0026lt;br\u0026gt; \n\u0026lt;/logic:iterate\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eScript:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;script type=\"text/javascript\"\u0026gt;\n function voterComment(vote) { \n var url = \"\u0026lt;%=request.getContextPath()%\u0026gt;/VoteComment.do\";\n new Ajax.Request(url, {\n parameters: {vote: vote},\n onSuccess: function(transport, json) {\n if (json.error) {\n alert(json.error);\n }\n else{\n window.event.srcElement.src = \"pages/images/photo.jpg\";\n }\n }\n });\n }\n \u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have a problem to access to the image that was clicked!!\u003c/p\u003e\n\n\u003cp\u003eThanks guys, in advance, for your great helping :)\u003c/p\u003e","accepted_answer_id":"17394886","answer_count":"1","comment_count":"0","creation_date":"2013-06-30 21:02:45.877 UTC","last_activity_date":"2013-06-30 22:51:40.343 UTC","last_edit_date":"2013-06-30 22:51:40.343 UTC","last_editor_display_name":"","last_editor_user_id":"249624","owner_display_name":"","owner_user_id":"2490377","post_type_id":"1","score":"0","tags":"javascript","view_count":"47"} +{"id":"20116426","title":"Quick algorithm of comparing sums of two arrays?","body":"\u003cp\u003eSuppose I have 2 integer arrays, they could be not in same length and value on any index is a valid integer (min ~ max). such as:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eint data1[] = {1227210749, 382745290, 567552295, 1910060611,\n 577735884, 75518037, 742485551, 1202127013, \n 386030509, 308032134};\n\nint data2[] = {1729472635, 1258098863, 259427472, 1664987257, \n 994376913, 1581883691, 1728724734, 2034013490};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow could I quickly compare of them to know which one have a bigger sum?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eint compare(int a[], int len_a, int b[], int len_b)\n{\n // compares if the sum of data1 is bigger than sum of data2\n} \n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"20116775","answer_count":"4","comment_count":"3","creation_date":"2013-11-21 09:01:26.533 UTC","last_activity_date":"2013-11-21 10:34:19.043 UTC","last_edit_date":"2013-11-21 09:04:01.78 UTC","last_editor_display_name":"","last_editor_user_id":"28169","owner_display_name":"","owner_user_id":"768722","post_type_id":"1","score":"-5","tags":"c++|c|algorithm|sorting","view_count":"176"} +{"id":"10094601","title":"Erlang Web framework and SSL?","body":"\u003cp\u003eCan anyone either 1) tell me how to do it, or 2) point me to a resource on how to run/enable/use SSL with the Erlang Web framework? I can't find anything in any docs or online web searches, and it looks like the last post to their mailing list is a couple of years old.\u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2012-04-10 18:46:37.64 UTC","last_activity_date":"2012-04-11 07:51:34.913 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1324831","post_type_id":"1","score":"1","tags":"ssl|frameworks|erlang","view_count":"448"} +{"id":"35016448","title":"Find optimum value based on multiple constraints algorithm","body":"\u003cp\u003eI have the following vectors (or C matrix and V vector) and K1, K2, K3 constants\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eConstraints [c11 + c12 + c13 + ... + c1n] \u0026lt;= K1\n [c21 + c22 + c23 + ... + c2n] \u0026lt;= K2\n [c31 + c32 + c33 + ... + c3n] \u0026lt;= K3\n-------------------------------------------------\nValues [ v1 + v2 + v3 + ... + vn] -\u0026gt; Max\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAs an input I am getting values of C and V, and as an output I want to provide the \u003cstrong\u003eX vector which contains only 0 and 1 values and\u003c/strong\u003e gives me\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e [c11 * x1 + c12 * x2 + c13 * x3 + ... + c1n * xn \u0026lt;= K1\n [c21 * x1 + c22 * x2 + c23 * x3 + ... + c2n * xn \u0026lt;= K2\n [c31 * x1 + c32 * x2 + c33 * x3 + ... + c3n * xn \u0026lt;= K3\n ------------------------------------------------------\n [ v1 * x1 + v2 * x2 + v3 * x3 + ... + vn * xn] -\u0026gt; Max\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAs an over simplified example:\u003c/p\u003e\n\n\u003cp\u003eInput:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e K1 = 15\n K2 = 20\n K3 = 10\n\n c1 = [3, 6, 8] | sum(c1 * X) \u0026lt;= 15 \n c2 = [8, 9, 3] | sum(c2 * X) \u0026lt;= 20\n c3 = [7, 5, 2] | sum(c3 * x) \u0026lt;= 10\n v = [2, 5, 3] | sum( v * X) -\u0026gt; Max\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOutput providing X vector which is maximizing the value within the constrains:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e X = [0, 1, 1]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am looking for an elegant algorithm (may be a Java or C# implementation as well) giving me the output based on the input. We can assume that the number of constraints is always 3 and all values of C and V (and K1, K2, K3) are provided.\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003eAnother simple example could be: You have a room (3D), so your constraints are the \u003cem\u003ewidth\u003c/em\u003e, \u003cem\u003eheight\u003c/em\u003e and \u003cem\u003elength\u003c/em\u003e of the room (\u003cem\u003eK1\u003c/em\u003e, \u003cem\u003eK2\u003c/em\u003e, \u003cem\u003eK3\u003c/em\u003e) and you have a list of furniture items (\u003cem\u003en items\u003c/em\u003e). All i furniture item has it's own \u003cem\u003elenght\u003c/em\u003e (\u003cem\u003ec1i\u003c/em\u003e), \u003cem\u003ewidth\u003c/em\u003e (\u003cem\u003ec2i\u003c/em\u003e) and \u003cem\u003eheight\u003c/em\u003e (\u003cem\u003ec3i\u003c/em\u003e) and value (\u003cem\u003evi\u003c/em\u003e). You want to pack the room with the \u003cstrong\u003emost valuable\u003c/strong\u003e furniture items which \u003cstrong\u003efits inside the rooms dimensions\u003c/strong\u003e. So the output is an n-long X variable which contains only 0 and 1 values, if xi = 1, the i-th element gets picked to be in the room, if xi = 0 the ith element won't be picked to be in the room.\u003c/p\u003e","accepted_answer_id":"35018238","answer_count":"2","comment_count":"10","creation_date":"2016-01-26 14:39:14.37 UTC","last_activity_date":"2016-01-27 13:23:41.987 UTC","last_edit_date":"2016-01-26 15:57:05.03 UTC","last_editor_display_name":"","last_editor_user_id":"3278822","owner_display_name":"","owner_user_id":"3278822","post_type_id":"1","score":"0","tags":"algorithm|linear-programming","view_count":"226"} +{"id":"40449347","title":"How to pass multidimensional values to a json array?","body":"\u003cp\u003eI am trying to pass the value to an api through json request.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e $payload = json_encode( array(\"phones\"=\u0026gt; \"971xxxxxxx\",\n\"emails\"=\u0026gt; \"fadfad@xyz.com\",\n\"id\"=\u0026gt; \"1\"\n ) );\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow will i pass the below multi dimensional values to a json request like the above code?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e { \"contactList\": [ { \"phones\" : [\"+91 9000000034\"], \"emails\" : [fadfad@xyz.com], \"id\" : 1 }, { \"phones\" : [\"+91 903-310-00-001\"], \"emails\" : [krs@xyz.in], \"id\" : 2 } ] }\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"40449480","answer_count":"1","comment_count":"2","creation_date":"2016-11-06 12:29:48.137 UTC","last_activity_date":"2016-11-06 12:43:56.25 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1859390","post_type_id":"1","score":"0","tags":"json|multidimensional-array","view_count":"37"} +{"id":"44392646","title":"How to add support for 10.5 inch iPad Pro","body":"\u003cp\u003eI've just downloaded the latest Xcode 8.3.3 update from the MAS. \u003cstrong\u003eI was wondering how to add support for the new 10.5-inch iPad Pro?\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI'm using storyboards with auto-layout, a launch screen storyboard and all app icon sizes are added to the xcassets.\u003c/p\u003e","accepted_answer_id":"44393188","answer_count":"2","comment_count":"0","creation_date":"2017-06-06 14:22:56.387 UTC","favorite_count":"3","last_activity_date":"2017-07-04 13:40:23.857 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7421005","post_type_id":"1","score":"12","tags":"xcode|ios-simulator|ios10|ios11|ipad-10.5","view_count":"2424"} +{"id":"1107016","title":"Are objects in PHP passed by value or reference?","body":"\u003cp\u003eIn this code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\nclass Foo\n{\n var $value;\n\n function foo($value)\n {\n $this-\u0026gt;setValue($value);\n }\n\n function setValue($value)\n {\n $this-\u0026gt;value=$value;\n }\n}\n\nclass Bar\n{\n var $foos=array();\n\n function Bar()\n {\n for ($x=1; $x\u0026lt;=10; $x++)\n {\n $this-\u0026gt;foos[$x]=new Foo(\"Foo # $x\");\n }\n }\n\n function getFoo($index)\n {\n return $this-\u0026gt;foos[$index];\n }\n\n function test()\n {\n $testFoo=$this-\u0026gt;getFoo(5);\n $testFoo-\u0026gt;setValue(\"My value has now changed\");\n }\n}\n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen the method \u003ccode\u003eBar::test()\u003c/code\u003e is run and it changes the value of foo # 5 in the array of foo objects, will the actual foo # 5 in the array be affected, or will the \u003ccode\u003e$testFoo\u003c/code\u003e variable be only a local variable which would cease to exist at the end of the function?\u003c/p\u003e","accepted_answer_id":"1107046","answer_count":"3","comment_count":"1","creation_date":"2009-07-09 23:49:24.237 UTC","last_activity_date":"2012-07-09 23:07:06.693 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"49153","post_type_id":"1","score":"12","tags":"php|oop","view_count":"13005"} +{"id":"15101926","title":"jQuery works in jsfiddle, but not in html file?","body":"\u003cp\u003eI checked many times, but I have no idea why the jQuery wont work. It works in jsfiddle!\u003c/p\u003e\n\n\u003cp\u003ehtml:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;!doctype html\u0026gt;\n\u0026lt;html\u0026gt;\n\u0026lt;head\u0026gt;\n\u0026lt;meta charset=\"utf-8\"\u0026gt;\n\u0026lt;title\u0026gt;Josue Espinosa\u0026lt;/title\u0026gt;\n\u0026lt;link href=\"style.css\" rel=\"stylesheet\" type=\"text/css\"\u0026gt;\n\u0026lt;script src=\"animate.js\"\u0026gt;\u0026lt;/script\u0026gt;\n\u0026lt;script src=\"http://code.jquery.com/jquery-latest.min.js\"\n type=\"text/javascript\"\u0026gt;\u0026lt;/script\u0026gt;\n\u0026lt;/head\u0026gt;\n\u0026lt;body\u0026gt;\n\u0026lt;div id=\"menu\"\u0026gt;\n\n\u0026lt;/div\u0026gt;\n\u0026lt;/body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ecss:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#menu{\n width:15px;\n height:200px;\n background:red; \n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ejquery:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$('#menu').hover(function(){\n $(\"#menu\").stop().animate({width : \"300px\"});\n});\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"15102035","answer_count":"3","comment_count":"1","creation_date":"2013-02-27 00:13:41.217 UTC","last_activity_date":"2013-02-27 00:25:09.027 UTC","last_edit_date":"2013-02-27 00:15:04.72 UTC","last_editor_display_name":"","last_editor_user_id":"454533","owner_display_name":"","owner_user_id":"1947256","post_type_id":"1","score":"1","tags":"javascript|jquery|html","view_count":"581"} +{"id":"46358376","title":"How can I disable swift-Mixpanel on development?","body":"\u003cp\u003eOn appDelegate, I used to write like this on obj-c, but in swift, it will crash on development when the app call Mixpanel.mainInstance().track(event: \"\")\u003c/p\u003e\n\n\u003cp\u003eWhat is a good way not to send mixpanel data on development mode?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#if DEBUG\n#else\n Mixpanel.initialize(token: Key.Mixpanel.token)\n#endif\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-09-22 06:41:50.907 UTC","last_activity_date":"2017-09-22 06:41:50.907 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"743663","post_type_id":"1","score":"0","tags":"swift|mixpanel","view_count":"11"} +{"id":"20186943","title":"how to send data to controller ruby by ajax","body":"\u003cp\u003eIn application.js :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction get_cell_id(select_id)\n{\n $.ajax({\n url: \"/assign_variable\",\n\n type: \"GET\",\n data:{channel:\"abc\"},\n error: function(){ \n alert('fail')\n }\n });\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ein static_pages_controller \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef assign_variable\n @Four_Season_Set_Channel= params[:channel]\n end\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ein routes.rb\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e match '/assign_variable', to:'static_pages#assign_variable', via: 'Get'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut i got alert fail, please help me fix it.\u003c/p\u003e","accepted_answer_id":"20187097","answer_count":"1","comment_count":"4","creation_date":"2013-11-25 07:31:19.657 UTC","last_activity_date":"2013-11-25 07:42:20.14 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3020985","post_type_id":"1","score":"0","tags":"javascript|ruby-on-rails|ruby|ajax","view_count":"134"} +{"id":"15488816","title":"Autcomplete - custom renderItem/Menu and item selection issue","body":"\u003cp\u003eI am using jQueryUI (1.10.2) and jQuery (1.9.1) with the autocomplete tool.\u003c/p\u003e\n\n\u003cp\u003eI have remote json data AND categories AND custom display with an image for each item from the json data (showed in the autocomplete list).\u003c/p\u003e\n\n\u003cp\u003eThis is my autocomplete init\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar autoSearch = $(\"#header-search-text\").autocomplete({\n source: function( request, response ) {\n $.ajax({\n //I have items with label, value, category and imgPath info\n });\n },\n focus: function( event, ui ) {\n console.log(\"focus is \");\n //This line shows \"null\"\n console.log(ui);\n return false;\n },\n minLength: 4,\n select: function( event, ui ) {\n //Never shows up\n console.log(\"selected is \");\n console.log( ui.item);/* ?\n \"Selected: \" + ui.item.label :\n \"Nothing selected, input was \" + this.value);*/\n },\n open: function() {\n $( this ).removeClass( \"ui-corner-all\" ).addClass( \"ui-corner-top\" );\n },\n close: function() {\n $( this ).removeClass( \"ui-corner-top\" ).addClass( \"ui-corner-all\" );\n }\n}).data('ui-autocomplete');\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have a custom _renderMenu\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e//Working\nautoSearch._renderMenu = function( ul, items ) {\n var that = this,\n currentCategory = \"\";\n $.each( items, function( index, item ) {\n console.log(item);\n if ( item.category != currentCategory ) {\n ul.append( \"\u0026lt;li class='ui-autocomplete-category'\u0026gt;\" + item.category + \"\u0026lt;/li\u0026gt;\" );\n currentCategory = item.category;\n }\n that._renderItem( ul, item );\n });\n};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut when I had the _renderItem, the keys (up and down) for selection doesn't work anymore and I cannot click on anything (no :hover CSS showing up)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eautoSearch._renderItem = function(ul, item) {\n console.log(\"ul is \");\n console.log(ul);\n return $('\u0026lt;li\u0026gt;')\n .data('item.autocomplete', item)\n .append('\u0026lt;img style=\"width:50px;height:50px;\" src=\"' + base_url + \"/\"+ item.imgPath + '\" alt=\"\" /\u0026gt;' + item.label)\n .appendTo(ul);\n};\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"15497019","answer_count":"1","comment_count":"0","creation_date":"2013-03-18 23:22:36.463 UTC","last_activity_date":"2013-03-19 10:32:11.66 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"836501","post_type_id":"1","score":"1","tags":"javascript|jquery|ajax|jquery-ui|autocomplete","view_count":"3356"} +{"id":"15883240","title":"Hotel prices spanning multiple dates issue","body":"\u003cp\u003eQuestion is somehow related to this one, with the exception that I use parameters.\nI have this on my button click :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprocedure TForm1.Button1Click(Sender: TObject);\nbegin\nwith ABSQuery1 do begin\nABSQuery1.Close;\nABSQuery1.SQL.Clear;\nABSQuery1.SQL.Add('select * from ROOM_RATES where CENIK_ID = :a4 and ROOM_TYPE = :A1');\nABSQuery1.SQL.Add('and rate_Start_DATE \u0026lt; :a3 AND rate_End_DATE \u0026gt; :a2 ORDER BY rate_Start_DATE ASC ');\nABSQuery1.Params.ParamByName('a1').Value:= cxLookupComboBox2.Text;\nABSQuery1.Params.ParamByName('a2').Value:= cxDateEdit1.Date;\nABSQuery1.Params.ParamByName('a3').Value := cxDateEdit2.Date;\nABSQuery1.Params.ParamByName('a4').Value := cxLookupComboBox1.Text;\nABSQuery1.Open;\nend;\nend;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis kind of works but not what I want actually.Problem is related to this one:\n\u003ca href=\"https://stackoverflow.com/questions/5452774/hotel-booking-rates-sql-problem\"\u003eHotel Booking Rates SQL Problem\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eProblem is with the overlapping dates like in the mentioned hyperlink.Right now I am getting this :\u003c/p\u003e\n\n\u003cp\u003eHow can I obtain result similar in the mentioned hyperlink with the above example ? \u003c/p\u003e\n\n\u003cp\u003eThis is the snapshot of the db table :\n\u003cimg src=\"https://i.stack.imgur.com/Qucz9.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eUpdate (NEW): \nThis is the code on the button click : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprocedure TForm1.AdvGlowButton1Click(Sender: TObject);\nvar\n nxt : integer;\n mem_from : TDateTime;\n mem_to : TDateTime;\n mem_RATE_ID : integer;\n mem_ROOM_TYPE : string[10];\n mem_Start_DATE_1 : TDateTime;\n mem_End_DATE_1 : TDateTime;\n mem_RATE_Price_1 : Currency;\n mem_calc_END : TDateTime;\n mem_calc_DAYS : integer;\n c_from : TDateTime;\n c_to : TDateTime;\n c_from_test : TDateTime;\n c_to_test : TDateTime;\n\nbegin\nABSQuery2.Close;\nABSQuery2.SQL.Text:='DELETE from TEMP';\nABSQuery2.ExecSQL;\nABSQuery2.SQL.Text:='SELECT * from TEMP ORDER BY ID ';\nABSQuery2.Open;\n\nc_from := cxDateEdit1.Date;\nc_to := cxDateEdit2.Date;\n\nmem_from := cxDateEdit1.Date;\nmem_to := cxDateEdit2.Date;\n\nwith ABSQuery1 do begin\nABSQuery1.Close;\nABSQuery1.SQL.Clear;\nABSQuery1.SQL.Add('select * from ROOM_RATES where CENIK_ID = :a4 and ROOM_TYPE = :A1');\nABSQuery1.SQL.Add('and rate_Start_DATE \u0026lt; :a3 AND rate_End_DATE \u0026gt; :a2 ORDER BY rate_Start_DATE ASC ');\nABSQuery1.Params.ParamByName('a1').Value:= cxLookupComboBox2.Text;\nABSQuery1.Params.ParamByName('a2').Value:= cxDateEdit1.Date;\nABSQuery1.Params.ParamByName('a3').Value := cxDateEdit2.Date;\nABSQuery1.Params.ParamByName('a4').Value := cxLookupComboBox1.Text;\nABSQuery1.Open;\n\n nxt := 1;\n mem_RATE_ID := ABSQuery1.FieldByName('RATE_ID').AsInteger;\n mem_ROOM_TYPE := ABSQuery1.FieldByName('ROOM_TYPE').AsString ;\n mem_Start_DATE_1 := ABSQuery1.FieldByName('RATE_START_DATE').AsDateTime;\n mem_End_DATE_1 := ABSQuery1.FieldByName('RATE_END_DATE').AsDateTime;\n mem_RATE_Price_1 := ABSQuery1.FieldByName('RATE_PRICE').AsCurrency;\n\n if mem_to \u0026gt; mem_End_DATE_1 then begin\n mem_calc_END := mem_End_DATE_1;\n mem_calc_DAYS := Daysbetween(mem_from,mem_End_DATE_1);\n end else begin\n mem_calc_END := mem_to;\n mem_calc_DAYS := Daysbetween(mem_from,mem_calc_END);\n end;\nend;\n\nif ABSQuery1.RecordCount \u0026gt; nxt then ABSQuery1.Next;\nwith ABSQuery2 do begin\nopen;\nInsert;\n ABSQuery2.FieldByName('RATE_ID').AsInteger:=mem_RATE_ID;\n ABSQuery2.FieldByName('ROOM_TYPE').AsString:=mem_ROOM_TYPE;\n ABSQuery2.FieldByName('DATE_FROM').AsDateTime:=mem_from;\n ABSQuery2.FieldByName('DATE_TO').AsDateTime:= mem_to;//mem_calc_END;\n ABSQuery2.FieldByName('RATE_PRICE').AsCurrency:=mem_RATE_PRICE_1;\n ABSQuery2.FieldByName('DAYS').AsInteger:=mem_calc_DAYS;\n ABSQuery2.FieldByName('TOTAL').AsCurrency:=mem_RATE_PRICE_1 * mem_calc_DAYS;\npost;\nend; ///////////////////////////////////////////////////////////////////\nif ABSQuery1.RecordCount \u0026gt; nxt then begin\n inc(nxt);\n\n if mem_to \u0026lt; ABSQuery1.FieldByName('rate_End_DATE').AsDateTime then begin\n mem_calc_END := mem_to;\n mem_calc_DAYS := Daysbetween(ABSQuery1.FieldByName('rate_Start_DATE').AsDateTime,mem_calc_END);\n end else begin\n mem_calc_END := ABSQuery1.FieldByName('rate_End_DATE').AsDateTime;\n mem_calc_DAYS := Daysbetween(ABSQuery1.FieldByName('rate_Start_DATE').AsDateTime, ABSQuery1.FieldByName('rate_End_DATE').AsDateTime);\n end;\n mem_RATE_ID := ABSQuery1.FieldByName('RATE_ID').AsInteger;\n mem_ROOM_TYPE := ABSQuery1.FieldByName('ROOM_TYPE').AsString;\n mem_Start_DATE_1 := ABSQuery1.FieldByName('rate_Start_DATE').AsDateTime;\n mem_End_DATE_1 := ABSQuery1.FieldByName('rate_End_DATE').AsDateTime;\n mem_Rate_Price_1 := ABSQuery1.FieldByName('RATE_PRICE').AsCurrency;\n\n // calculation : second row.\nwith ABSQuery2 do begin\nInsert;\n FieldByName('RATE_ID').AsInteger:=mem_RATE_ID;\n FieldByName('ROOM_TYPE').AsString:=mem_ROOM_TYPE;\n FieldByName('DATE_FROM').AsDateTime:=mem_Start_DATE_1;\n FieldByName('DATE_TO').AsDateTime:= mem_calc_END;\n FieldByName('RATE_PRICE').AsCurrency:=mem_RATE_PRICE_1;\n FieldByName('DAYS').AsInteger:=mem_calc_DAYS;\n FieldByName('TOTAL').AsCurrency:=mem_RATE_PRICE_1 * mem_calc_DAYS;\npost;\nend;\n ABSQuery2.refresh;\nend;\nend;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe result I get is this :\n\u003cimg src=\"https://i.stack.imgur.com/tGXpd.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eAs you can see from the database snapshot, prices are set OK. \u003c/p\u003e","accepted_answer_id":"15893301","answer_count":"1","comment_count":"10","creation_date":"2013-04-08 15:34:21.72 UTC","favorite_count":"0","last_activity_date":"2013-04-14 18:35:43.827 UTC","last_edit_date":"2017-05-23 12:08:18.46 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"763539","post_type_id":"1","score":"0","tags":"sql|delphi|delphi-xe2|delphi-xe","view_count":"354"} +{"id":"8920131","title":"variable manipulation in Less","body":"\u003cp\u003eall\u003cbr\u003e\nI want to calculate the height of the page ,and in my \u003ccode\u003etest.less\u003c/code\u003e \u003c/p\u003e\n\n\u003cpre\u003e@clientHeight:`$(window).height()`;\u003c/pre\u003e\n\n\u003cp\u003ewhen I use the \u003ccode\u003e@clientHeight\u003c/code\u003e,as jquery return just a number,I need to plus the unit like \u003ccode\u003epx\u003c/code\u003e\u003cbr\u003e\nSo,I tried these ways:\u003cbr\u003e\n1) \u003c/p\u003e\n\n\u003cpre\u003ediv{height: @clientHeight+px;\u003c/pre\u003e\n\n\u003cp\u003eIt came out :\u003cbr\u003e\n\u003ccode\u003eheight: 705 px;\u003c/code\u003e\n(Note that there's a space between them)\u003cbr\u003e\n2) \u003c/p\u003e\n\n\u003cpre\u003e@clientHeight:`$(window).height()+'px'`\u003c/pre\u003e\n\n\u003cp\u003eIt came out :\u003cbr\u003e\n\u003ccode\u003eheight: \"705px\";\u003c/code\u003e \u003c/p\u003e","accepted_answer_id":"9157075","answer_count":"3","comment_count":"2","creation_date":"2012-01-19 01:54:50.633 UTC","favorite_count":"2","last_activity_date":"2013-09-13 14:28:14.18 UTC","last_edit_date":"2012-01-19 01:55:51.897 UTC","last_editor_display_name":"","last_editor_user_id":"601179","owner_display_name":"","owner_user_id":"612428","post_type_id":"1","score":"2","tags":"javascript|jquery|css|less","view_count":"2902"} +{"id":"14071915","title":"grunt-init not recognised / added to path (windows)","body":"\u003cp\u003eI'm on Windows and installed the new grunt using:\nnpm install -g grunt-cli\nnpm install -g grunt-init\u003c/p\u003e\n\n\u003cp\u003egrunt-init is the issue here.\u003c/p\u003e\n\n\u003cp\u003eIf I try to run \"grunt-init\" in the command console, it is not recognised. Also after restarting the PC it's a nogo.\nI checked the environment settings and grunt-init is indeed not included. In fact, when checking the node_modules directory (in \"C:\\Users\\\\AppData\\Roaming\\npm\\node_modules\") I see a directory \"grunt-init\", but there is no .cmd or other executable whatsoever.\u003c/p\u003e\n\n\u003cp\u003eBefore I file a bug I wanted to ask here, because it seems that other Windows users have no issues with this..\u003c/p\u003e","accepted_answer_id":"14086665","answer_count":"2","comment_count":"1","creation_date":"2012-12-28 15:36:35.26 UTC","last_activity_date":"2013-01-03 20:31:50.747 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1783174","post_type_id":"1","score":"2","tags":"gruntjs","view_count":"2582"} +{"id":"40969032","title":"How to set path inside of c++ program using system() function","body":"\u003cp\u003eI need to write c++ program which sets path using system() function:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esystem(\"set PATH=%PATH%;C:\\\\Program Files (x86)\\\\Microsoft Visual Studio 12.0\\\\VC\\\\bin\\\\amd64\");\nsystem(\"nvcc -x cu -o cudapair cudapair.c\");\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut it doesnt work. It throws error, because path wasn't set. What's the problem?\u003c/p\u003e","answer_count":"1","comment_count":"7","creation_date":"2016-12-05 07:19:14.513 UTC","favorite_count":"0","last_activity_date":"2016-12-06 20:15:47.12 UTC","last_edit_date":"2016-12-05 07:31:13.827 UTC","last_editor_display_name":"","last_editor_user_id":"3560634","owner_display_name":"","owner_user_id":"3560634","post_type_id":"1","score":"0","tags":"c++|path|system","view_count":"835"} +{"id":"14472768","title":"HTML form doesnt allow spaces on inputs","body":"\u003cp\u003eI have an HTML form loaded in via ajax to a lightbox. \u003c/p\u003e\n\n\u003cp\u003eYou can see the behaviour on the homepage of \u003ca href=\"http://www.powerbuy.com.au/\" rel=\"nofollow\"\u003ehttp://www.powerbuy.com.au/\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eIn the bottom right of the page there is a Link 'Let us negotiate a deal for you' Clicking this creates a lightbox and loads the form. \u003c/p\u003e\n\n\u003cp\u003eThe issue is that you cannot put in spaces to any of the fields, it appears to be accepting any other characters, numbers and symbols, but not spaces. \u003c/p\u003e\n\n\u003cp\u003eI have looked through the code for any keyCode in the JS, but I cant find anything related to spaces. \u003c/p\u003e\n\n\u003cp\u003eCan you replicate the issue? Can you tell me what is going on?\u003c/p\u003e","accepted_answer_id":"14597549","answer_count":"4","comment_count":"6","creation_date":"2013-01-23 05:01:22.203 UTC","last_activity_date":"2014-11-29 18:49:08.967 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2002620","post_type_id":"1","score":"2","tags":"javascript|html|ajax","view_count":"1898"} +{"id":"36417777","title":"Using \u003cnav\u003e \u003cul\u003e and \u003cli\u003e to make navbar instead of a table. How do I make whole block clickable while spanning the width of the page?","body":"\u003cp\u003eThere are three goals I have with this nav bar. \u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eTo make it 140px tall to fit a logo. This block will have a fixed width. \u003c/li\u003e\n\u003cli\u003eTo make each link block have an even width and have the nav bar span the page.\u003c/li\u003e\n\u003cli\u003eTo make the entire block clickable to the link.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eHere is my code:\u003c/p\u003e\n\n\u003cp\u003e\u003cdiv class=\"snippet\" data-lang=\"js\" data-hide=\"false\"\u003e\r\n\u003cdiv class=\"snippet-code\"\u003e\r\n\u003cpre class=\"snippet-code-css lang-css prettyprint-override\"\u003e\u003ccode\u003enav {\r\n position: absolute;\r\n list-style-type: none;\r\n z-index: 1;\r\n width: 100%;\r\n text-align: center;\r\n height: 140px;\r\n vertical-align: middle;\r\n overflow: hidden;\r\n}\r\nli {\r\n width: 16.7%;\r\n display: inline-block;\r\n vertical-align: middle;\r\n}\r\nli a {\r\n display: inline-block;\r\n color: white;\r\n font-size: 100%;\r\n font-family: 'Arial Narrow', Arial, sans-serif;\r\n text-decoration: none;\r\n}\u003c/code\u003e\u003c/pre\u003e\r\n\u003cpre class=\"snippet-code-html lang-html prettyprint-override\"\u003e\u003ccode\u003e\u0026lt;nav\u0026gt;\r\n \u0026lt;ul\u0026gt;\r\n \u0026lt;li\u0026gt;\r\n \u0026lt;a href=\"homepage\" title=\"Home Page\"\u0026gt;\r\n \u0026lt;img src=\"r3wmod.png\"\u0026gt;\r\n \u0026lt;/a\u0026gt;\r\n \u0026lt;/li\u0026gt;\r\n \u0026lt;li\u0026gt;\u0026lt;a href=\"about\" title=\"About Me\"\u0026gt;ABOUT\u0026lt;/a\u0026gt;\r\n \u0026lt;/li\u0026gt;\r\n \u0026lt;li\u0026gt;\u0026lt;a href=\"projects\" title=\"Projects\"\u0026gt;PROJECTS\u0026lt;/a\u0026gt;\r\n \u0026lt;/li\u0026gt;\r\n \u0026lt;li\u0026gt;\u0026lt;a href=\"thoughts\" title=\"Thoughts\"\u0026gt;THOUGHTS\u0026lt;/a\u0026gt;\r\n \u0026lt;/li\u0026gt;\r\n \u0026lt;li\u0026gt;\u0026lt;a href=\"resume\" title=\"Resume\"\u0026gt;RESUME\u0026lt;/a\u0026gt;\r\n \u0026lt;/li\u0026gt;\r\n \u0026lt;/ul\u0026gt;\r\n\u0026lt;/nav\u0026gt;\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003c/p\u003e","answer_count":"0","comment_count":"4","creation_date":"2016-04-05 05:25:22.88 UTC","favorite_count":"2","last_activity_date":"2016-04-05 05:25:22.88 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6159352","post_type_id":"1","score":"0","tags":"html|css|html-lists|nav","view_count":"36"} +{"id":"13873384","title":"character string buffer too small error","body":"\u003cp\u003eI'm trying to create a table with a select statement. I want to populate this new table with the aggregated value from a VIEW. Following is the code used for creating the VIEW,\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e create or replace view FINAL_WEB_LOG\n as\n select SESSION_ID, \n SESSION_DT, \n C_IP, \n CS_USER_AGENT,\n tab_to_string(CAST(COLLECT(web_link) AS t_varchar2_tab)) WEBLINKS\n from web_views_tab \n group by C_IP, CS_USER_AGENT, SESSION_DT;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to create a table with WEBLINKS and SESSION_ID which is a sequence from another table.And when I try to create a table from VIEW (the one without the SESSION_ID), I get the following error,\u003c/p\u003e\n\n\u003cp\u003eSQL Error: ORA-06502: PL/SQL: numeric or value error: character string buffer too small\u003c/p\u003e\n\n\u003cp\u003eThis has to do with the field, Weblinks, it does have longer values. What can I do now to get around this error??\u003c/p\u003e\n\n\u003cp\u003eMore information on the aggregate function can be found in \u003ca href=\"http://www.oracle-base.com/articles/misc/string-aggregation-techniques.php#collect\" rel=\"nofollow\"\u003eAskTom\u003c/a\u003e\u003c/p\u003e","answer_count":"5","comment_count":"0","creation_date":"2012-12-14 05:47:37.36 UTC","last_activity_date":"2012-12-14 16:19:58.907 UTC","last_edit_date":"2012-12-14 11:38:38.78 UTC","last_editor_display_name":"","last_editor_user_id":"1874311","owner_display_name":"","owner_user_id":"1874311","post_type_id":"1","score":"0","tags":"sql|oracle11g","view_count":"863"} +{"id":"34075914","title":"Overriding javascript function on different page","body":"\u003cp\u003eThis is new to me, and I don't know how to handle it.\u003c/p\u003e\n\n\u003cp\u003eThe page has a logo that uses transitions to change its size and color and is triggered by this on the bottom of the HTML: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edocument.onload=\"initialize()\"\nsetInterval(function(){\n setTimeout(function(){\n $('#path1').css('transform','scale(.95)');\n $('#path2').css('transform','scale(.95)');\n $('#path2').css('fill','#F7A700');\n }, 2000);\n$('#path1').css('transform','scale(1.05)');\n $('#path2').css('transform','scale(1.00)');\n $('#path2').css('fill','#FFCF55');\n}, 4000);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis starts the transition and changes the color of the svg path in coordination. On a separate script page there is a function that determines the current page slider and I need to change the css fill on \u003ccode\u003e#path2\u003c/code\u003e for a specific page. I've tried \u003ccode\u003eif...else\u003c/code\u003e statements, moving the \u003ccode\u003esetInterval()\u003c/code\u003e function to the same page, etc, but nothing is letting me override the fill color in the \u003ccode\u003esetInterval()\u003c/code\u003e function.\u003c/p\u003e\n\n\u003cp\u003eREVISION: Its included in the html and there is a separate js page with all of the other functions. So I thought maybe it had something to do with that but now I'm understanding it is running on an infinite loop so any changes I try to make are going to be overridden. Its a logo that is a svg with multiple paths and on the homepage slide one path needs to be white and everything else stay the same for all other pages slides. There is only one page of html and the content slides on a slider. Not sure if I explained it any better. I'm working with existing code done by someone else so I'm trying to work with what I've been given but maybe there is a better solution to run this? maybe through css? I need it to load on window or document load and run infinitely but need to be able to modify the css on it. I have to use css transforms to set it up.\u003c/p\u003e","answer_count":"1","comment_count":"4","creation_date":"2015-12-03 20:54:02.647 UTC","last_activity_date":"2016-01-05 12:24:24.377 UTC","last_edit_date":"2016-01-05 12:24:24.377 UTC","last_editor_display_name":"","last_editor_user_id":"1300910","owner_display_name":"","owner_user_id":"4443707","post_type_id":"1","score":"3","tags":"javascript|html|css|svg|css-transitions","view_count":"97"} +{"id":"13402288","title":"Jquery Plugins for Financial Reporting?","body":"\u003cp\u003eAny suggestions on some \u003ccode\u003eJquery\u003c/code\u003e plugins for reporting a \u003ccode\u003ebalance sheet\u003c/code\u003e or \u003ccode\u003eincome statement\u003c/code\u003e?\u003c/p\u003e","answer_count":"1","comment_count":"5","creation_date":"2012-11-15 16:48:02.253 UTC","last_activity_date":"2016-10-14 19:09:54.617 UTC","last_edit_date":"2012-11-15 16:57:31.89 UTC","last_editor_display_name":"","last_editor_user_id":"1667829","owner_display_name":"","owner_user_id":"461316","post_type_id":"1","score":"1","tags":"javascript|jquery|ajax","view_count":"696"} +{"id":"10008659","title":"jquery has no method error","body":"\u003cp\u003eI am writing an ajax navigation script.\nI found out i could highlight the current section into the menu by using\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e('a[href=' + document.location.hash + ']').addClass('current');\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut I am getting this Error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eObject a[href=\"#home\"] has no method 'addClass'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny suggestion?\u003c/p\u003e","accepted_answer_id":"10008703","answer_count":"2","comment_count":"0","creation_date":"2012-04-04 09:43:57.317 UTC","last_activity_date":"2012-04-04 12:28:43.137 UTC","last_edit_date":"2012-04-04 12:28:43.137 UTC","last_editor_display_name":"","last_editor_user_id":"1292622","owner_display_name":"","owner_user_id":"1031276","post_type_id":"1","score":"1","tags":"jquery|jquery-selectors|href|addclass","view_count":"1130"} +{"id":"6449393","title":"How to find all WiFi networks that are not in range?","body":"\u003cp\u003eI am writing an application to display the WiFi network types and status. How do I find all the \"not in range\" WiFi networks? Is it possible to get the list of all configured (previously seen) WiFi networks that are out of range?\u003c/p\u003e\n\n\u003cp\u003eI used the below code to get the result\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e WifiManager mWifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);\n List\u0026lt;WifiConfiguration\u0026gt; configs = mWifiManager.getConfiguredNetworks();\n List\u0026lt;ScanResult\u0026gt; results = mWifiManager.getScanResults();\n if (configs != null) {\n for (WifiConfiguration config : configs) {\n for (ScanResult result : results) {\n if (result.SSID == null || result.SSID.length() == 0) {\n continue;\n }\n\n else {\n if (result.SSID.equals(MyString.removeDoubleQuotes(config.SSID))) {\n int level = mWifiManager.CalculateSignalLevel(result.level, 4);\n Log.d(\"MyApp\", Config.SSID + \" \" + level);\n }\n }\n }\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut if configured network is high in number then it will take long time to execute. Is there any way to optimize this problem? By getting the scanned result of only the configured network.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2011-06-23 04:39:13.553 UTC","favorite_count":"1","last_activity_date":"2011-06-23 09:06:18.723 UTC","last_edit_date":"2011-06-23 07:40:36.423 UTC","last_editor_display_name":"","last_editor_user_id":"785373","owner_display_name":"","owner_user_id":"785373","post_type_id":"1","score":"1","tags":"android|networking|wifi","view_count":"2420"} +{"id":"45448936","title":"popup image viewer doesn't resize the image when it is bigger than the screen resolution","body":"\u003cp\u003eI'm working with Bootstrap, i used this template of \u003ca href=\"https://bootsnipp.com/snippets/QoZeX\" rel=\"nofollow noreferrer\"\u003eGallery Image\u003c/a\u003e.\u003c/p\u003e\n\n\u003cp\u003eThe website demo works great because the images are horizontal :\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/9vTIr.jpg\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/9vTIr.jpg\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eBut when i edited the code and put my picture (which are verticals), i think it is trying to fill them horizontally so the image isn't visible at 100%.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/o96xI.jpg\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/o96xI.jpg\" alt=\"Wrong\"\u003e\u003c/a\u003e \u003c/p\u003e\n\n\u003cp\u003eHow can i fix that, here is the code i think (I'm newbie so I'm not sure) : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;script\u0026gt;\n popup = {\n init: function(){\n $('figure').click(function(){\n popup.open($(this));\n });\n\n $(document).on('click', '.popup img', function(){\n return false;\n }).on('click', '.popup', function(){\n popup.close();\n })\n },\n open: function($figure) {\n $('.gallery').addClass('pop');\n $popup = $('\u0026lt;div class=\"popup\" /\u0026gt;').appendTo($('body'));\n $fig = $figure.clone().appendTo($('.popup'));\n $bg = $('\u0026lt;div class=\"bg\" /\u0026gt;').appendTo($('.popup'));\n $close = $('\u0026lt;div class=\"close\"\u0026gt;\u0026lt;svg\u0026gt;\u0026lt;use xlink:href=\"#close\"\u0026gt;\u0026lt;/use\u0026gt;\u0026lt;/svg\u0026gt;\u0026lt;/div\u0026gt;').appendTo($fig);\n $shadow = $('\u0026lt;div class=\"shadow\" /\u0026gt;').appendTo($fig);\n src = $('img', $fig).attr('src');\n $shadow.css({backgroundImage: 'url(' + src + ')'});\n $bg.css({backgroundImage: 'url(' + src + ')'});\n setTimeout(function(){\n $('.popup').addClass('pop');\n }, 10);\n },\n close: function(){\n $('.gallery, .popup').removeClass('pop');\n setTimeout(function(){\n $('.popup').remove()\n }, 100);\n }\n }\n\n popup.init()\n\n \u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"1","creation_date":"2017-08-01 23:03:47.053 UTC","last_activity_date":"2017-08-02 02:17:54.287 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1484184","post_type_id":"1","score":"0","tags":"javascript|html|popup","view_count":"32"} +{"id":"46930597","title":"How to properly handle hibernate/SQL exception","body":"\u003cp\u003eIn my Spring mvc + hibernate web-app, I'd like to handle SQL exception. so i have implement my GlobalExceptionHandler().\u003c/p\u003e\n\n\u003cp\u003eactually i send a duplicated value to simulate error\u003c/p\u003e\n\n\u003cp\u003ehere console :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eWARN : org.hibernate.engine.jdbc.spi.SqlExceptionHelper - SQL Error: 0, SQLState: 23505\nERROR: org.hibernate.engine.jdbc.spi.SqlExceptionHelper - ERROR: duplicate key value violates unique constraint \"profiles_registration_number_key\"\n Détail : Key (registration_number)=(1) already exists.\nINFO : org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl - HHH000010: On release of batch it still contained JDBC statements\nERROR: org.hibernate.internal.ExceptionMapperStandardImpl - HHH000346: Error during managed flush [org.hibernate.exception.ConstraintViolationException: could not execute statement]\n11:40:20.792 [http-nio-8080-exec-2] DEBUG org.springframework.orm.jpa.JpaTransactionManager - Initiating transaction rollback after commit exception\norg.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; constraint [profiles_registration_number_key]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement\n at org.springframework.orm.jpa.vendor.HibernateJpaDialect.convertHibernateAccessException(HibernateJpaDialect.java:278)\n at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:244)\n at org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:521)\n at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:761)\n at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:730)\n at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:504)\n at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:292)\n at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)\n at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)\n at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)\n at com.sun.proxy.$Proxy87.save(Unknown Source)\n at tn.alveodata.studyink.controllers.PersonController.save(PersonController.java:143)\n at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)\n at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)\n at java.lang.reflect.Method.invoke(Unknown Source)\n at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)\n at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)\n at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97)\n at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)\n at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)\n at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)\n at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967)\n at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)\n at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)\n at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)\n at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)\n at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)\n at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)\n at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)\n at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\n at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)\n at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\n at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\n at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)\n at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)\n at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)\n at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)\n at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)\n at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)\n at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)\n at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)\n at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799)\n at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)\n at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)\n at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1457)\n at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)\n at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)\n at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)\n at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)\n at java.lang.Thread.run(Unknown Source)\nCaused by: org.hibernate.exception.ConstraintViolationException: could not execute statement\n at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:112)\n at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42)\n at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:111)\n at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:97)\n at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:178)\n at org.hibernate.engine.jdbc.batch.internal.NonBatchingBatch.addToBatch(NonBatchingBatch.java:45)\n at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3013)\n at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3513)\n at org.hibernate.action.internal.EntityInsertAction.execute(EntityInsertAction.java:89)\n at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:589)\n at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:463)\n at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:337)\n at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:39)\n at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1437)\n at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:493)\n at org.hibernate.internal.SessionImpl.flushBeforeTransactionCompletion(SessionImpl.java:3207)\n at org.hibernate.internal.SessionImpl.beforeTransactionCompletion(SessionImpl.java:2413)\n at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.beforeTransactionCompletion(JdbcCoordinatorImpl.java:467)\n at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.beforeCompletionCallback(JdbcResourceLocalTransactionCoordinatorImpl.java:156)\n at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.access$100(JdbcResourceLocalTransactionCoordinatorImpl.java:38)\n at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl$TransactionDriverControlImpl.commit(JdbcResourceLocalTransactionCoordinatorImpl.java:231)\n at org.hibernate.engine.transaction.internal.TransactionImpl.commit(TransactionImpl.java:68)\n at org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:517)\n ... 48 common frames omitted\nCaused by: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint \"profiles_registration_number_key\"\n Détail : Key (registration_number)=(1) already exists.\n at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2477)\n at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2190)\n at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:300)\n at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:428)\n at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:354)\n at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:169)\n at org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:136)\n at org.apache.tomcat.dbcp.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:97)\n at org.apache.tomcat.dbcp.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:97)\n at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:175)\n ... 66 common frames omitted\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003emy GlobalExceptionHandler()\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@ControllerAdvice\npublic class GlobalExceptionHandler {\n\n @ExceptionHandler(DataIntegrityViolationException.class)\n public @ResponseBody ExceptionBean handle(DataIntegrityViolationException ex) {\n return new exceptionBean(ex.getMessage());\n }\n...\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow to properly handle SQLException so in my console i'll get rid with wran messages.\u003c/p\u003e\n\n\u003cp\u003el have also tried with @ExceptionHandler(SQLException ex) in order to handle all kind of SQLException but exception was not handled\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-10-25 10:57:09.73 UTC","last_activity_date":"2017-10-25 10:57:09.73 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7362744","post_type_id":"1","score":"0","tags":"hibernate|spring-mvc|exception|sqlexception","view_count":"71"} +{"id":"23935369","title":"How to merge two git repos - local and remote?","body":"\u003cp\u003eI started developing some code at my laptop, so I executed git init and then made some commits. After that I even created branch on my local repo. I didn't expect that my colleague in the meantime will push some his work to remote repo I was planning to push my code (it was empty). What is the easiest way to merge those two repos into one?\u003c/p\u003e","accepted_answer_id":"23935868","answer_count":"1","comment_count":"0","creation_date":"2014-05-29 14:08:12.293 UTC","favorite_count":"1","last_activity_date":"2014-06-09 20:22:11.96 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2459706","post_type_id":"1","score":"-1","tags":"git|merge","view_count":"29"} +{"id":"23654707","title":"Gulp, browserify and remapify","body":"\u003cp\u003eI'm trying to find a nice way to map directories with browserify and gulp so I don't have lots of paths link this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar uriparser = require('../../../app/assets/javascripts/app/module/mymodule.coffee')\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo I have been trying to use remapify with gulp so I have recipe like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar gulp = require('gulp');\nvar browserify = require('browserify');\nvar remapify = require('remapify');\nvar source = require('vinyl-source-stream');\n\ngulp.task(\"test\", function () {\n var b = browserify({entries:['./spec/javascripts/modules/tests.coffee'],\n extensions: ['.coffee']\n });\n\n b.plugin(remapify, [\n {\n src: './app/assets/javascripts/app/**/*.coffee'\n , expose: 'app'\n , cwd:__dirname\n }\n\n ])\n\n\n\n libs.forEach(function (lib) {\n b.external(lib);\n });\n\n\n\n return b.bundle()\n .pipe(source(\"app.js\"))\n .pipe(gulp.dest('./spec/javascripts/specs/helpers'));\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNot sure what I am missing, but it simply not mapping the paths correctly, maybe this isn't the best tool, but have tried quite a few options with no success, so any help would be great!\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2014-05-14 12:25:31.973 UTC","last_activity_date":"2014-09-04 17:14:00.647 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"482751","post_type_id":"1","score":"1","tags":"coffeescript|gulp|browserify","view_count":"706"} +{"id":"34270679","title":"How to set first letter to upperCase on button click","body":"\u003cp\u003eWhen i click button and it appears on web-page i want to do the first letter toUpperCase(); But i don't know how to it properly. I made it like this: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction toUpper() {\n arr.charAt(0).toUpperCase() + arr.slice(1);\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut this seems not correct, please explain how to do it right way?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;input type=\"text\" id=\"inp\"\u0026gt;\n \u0026lt;button class=\"btn\"\u0026gt;Push to array\u0026lt;/button\u0026gt;\n \u0026lt;button class=\"delete\"\u0026gt;Delete\u0026lt;/button\u0026gt;\n \u0026lt;br\u0026gt;\u0026lt;br\u0026gt;\n \u0026lt;div id=\"list\"\u0026gt;\u0026lt;/div\u0026gt;\n\n\u0026lt;script\u0026gt;\n\nvar inp = document.getElementById(\"inp\");\nvar btn = document.querySelector(\".btn\");\nvar list = document.querySelector('#list');\nvar del = document.querySelector(\".delete\");\nvar arr = [];\n\nbtn.addEventListener('click', function() {\n var valInp = inp.value; \n if (valInp === '') { return; }\n arr.push(valInp);\n inp.value = \"\";\n list.innerHTML = arr.join(\"\u0026lt;br\u0026gt;\").trim();\n\n function toUpper() {\n arr.charAt(0).toUpperCase() + arr.slice(1);\n }\n});\n\n del.addEventListener('click', function(){\n arr.pop();\n list.innerHTML = arr.join(\"\u0026lt;br\u0026gt;\").trim(); \n});\n\n\u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"34270830","answer_count":"1","comment_count":"1","creation_date":"2015-12-14 15:25:42.47 UTC","last_activity_date":"2015-12-14 15:40:45.997 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4825305","post_type_id":"1","score":"2","tags":"javascript","view_count":"54"} +{"id":"7214603","title":"SQL injection help","body":"\u003cp\u003eSo I was just testing out the \u003ccode\u003emysql_real_escape();\u003c/code\u003e function and what that does is puts a \u003ccode\u003e\\\u003c/code\u003e before the \u003ccode\u003e\"\u003c/code\u003e. The when the content is echoed back out onto the page I just get content with \u003ccode\u003e\\'\u003c/code\u003es before any \u003ccode\u003e\"\u003c/code\u003e. So let's say I posted \u003ccode\u003e\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\u003c/code\u003e all I get is \u003ccode\u003e\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\u003c/code\u003e echoed back. \u003c/p\u003e\n\n\u003cp\u003eIs there some code to remove the \u003ccode\u003e\\\u003c/code\u003e when it's echoed back onto the page?\u003c/p\u003e","answer_count":"4","comment_count":"2","creation_date":"2011-08-27 12:38:39.013 UTC","favorite_count":"0","last_activity_date":"2011-08-27 12:57:41.923 UTC","last_edit_date":"2011-08-27 12:57:41.923 UTC","last_editor_display_name":"","last_editor_user_id":"736054","owner_display_name":"","owner_user_id":"915470","post_type_id":"1","score":"0","tags":"php|mysql|sql-injection","view_count":"103"} +{"id":"8875999","title":"Windows Phone 7 ListBox index operator","body":"\u003cp\u003eI am trying to add Strings in a ListBox in Silverlight for Windows Phone 7. I want the strings to appear in fixed width columns, and for the ListBox to scroll into view when a new row is started in the listBox. Additionally, one word is added to the listBox at a time when the user clicks a button. I tried using a WrapPanel, but that did not allow for scrolling into view. Now my current solution would be valid, however the index operator gives me an index out of bounds error and the insert method gives me duplicate entries that appear on the next row down...\u003c/p\u003e\n\n\u003cp\u003eI am trying to use either the Insert method or the index operator (obviously not both) like so:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ethis.wordListBox.Items.Insert(numRows, formatRow);\nthis.wordListBox.Items[numRows] = formatRow;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is an idea of the flow of my program, Example:\nThe user clicks a button and a Word is concatenated to the presently null formatRow and formatRow is added to the wordListBox at numRows which is presently 0. The button is clicked again and another word is concatenated to formatRow and formatRow is added to the wordListBox at numRows which is still 0. Thus, I now have the first element of wordListBox set to a string that contains two words. This repeats until 5 words have been added to formatRow and then, numRows is incremented and formatRow is set to null. Now, words will be added to the next row in the wordListBox, and the wordListBox will scroll into view because each element of the ListBox will be one string.\u003c/p\u003e\n\n\u003cp\u003eCan anyone point out my error with the insert method of index operator or show me how to make these functions work for my purposes?\nAlso, If anyone needs a better explanation I will try my best to explain in more detail.\u003c/p\u003e","accepted_answer_id":"8878261","answer_count":"1","comment_count":"0","creation_date":"2012-01-16 05:08:51.827 UTC","last_activity_date":"2012-01-18 07:23:57.127 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1104823","post_type_id":"1","score":"0","tags":"silverlight|windows-phone-7|insert|listbox|indexing","view_count":"406"} +{"id":"26973812","title":"Allocating dynamic array within a function of a structure","body":"\u003cp\u003eI have a BST structure: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003estruct bst {\n int *data;\n int max;\n}; \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd I have a function to create a bst initially: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003estruct bst *create_bst(int max) {\n struct bst *b;\n b-\u0026gt;data = malloc(pow(2, max) * sizeof(int));\n\n return b;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut I'm getting error at the line where I'm allocating memory to data.\u003cbr\u003e\nAm I doing something wrong?\u003c/p\u003e","accepted_answer_id":"26973978","answer_count":"1","comment_count":"15","creation_date":"2014-11-17 13:29:33.833 UTC","last_activity_date":"2014-11-17 13:47:14 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4221417","post_type_id":"1","score":"1","tags":"c|arrays|memory|struct","view_count":"65"} +{"id":"15434955","title":"Can't generate javadoc in eclipse","body":"\u003cp\u003eThis really should be a stupid question, but I'm trying to generate javadoc in my Android eclipse project and I'm getting errors. I'm on a mac and the javadoc command is set at\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/javadoc\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut for some reason it seems to be using 1.3\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e annotations are not supported in -source 1.3\n (use -source 5 or higher to enable annotations)\n @Override\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHas anyone else run into this? \u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2013-03-15 14:29:23.967 UTC","favorite_count":"1","last_activity_date":"2013-09-26 23:34:54.233 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"450847","post_type_id":"1","score":"1","tags":"eclipse|javadoc","view_count":"4304"} +{"id":"10315523","title":"strip timestamp/syntax-sequence from python string","body":"\u003cp\u003eI'm working on a python script which retrieves values from an sdict as a string value. Many of the returned values contain a timestamp depending on the sdict, which is a tad annoying.\u003c/p\u003e\n\n\u003cp\u003eEg. \u003ccode\u003e\u0026lt;2006-12-20 00:10:24 Cattle is a tree\u0026gt;\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eI cannot for the life of me, figure out how to remove the \u003ccode\u003e2006-12-20 00:10:24\u003c/code\u003e from the returned value. Has anyone got any ideas? I was thinking I could strip anything between - characters. However, the returned values often contain - throughout. \u003c/p\u003e","accepted_answer_id":"10315602","answer_count":"1","comment_count":"5","creation_date":"2012-04-25 12:23:15.92 UTC","last_activity_date":"2012-04-25 12:27:55.92 UTC","last_edit_date":"2012-04-25 12:23:31.393 UTC","last_editor_display_name":"","last_editor_user_id":"1219006","owner_display_name":"","owner_user_id":"1338494","post_type_id":"1","score":"0","tags":"python|string|timestamp|strip","view_count":"629"} +{"id":"44152738","title":"PyCharm does not recognize iPython when installed via Ubuntu's apt-get","body":"\u003cp\u003eI've installed \u003ccode\u003eiPython\u003c/code\u003e for Ubuntu's default Python installation (because I couldn't compile some particular program with Anaconda) using \u003ccode\u003esudo apt-get install ipython\u003c/code\u003e. I can use \u003ccode\u003e/usr/bin/ipython\u003c/code\u003e in the command line.\u003c/p\u003e\n\n\u003cp\u003eHowever, when linked against the default python interpreter in the project settings (/usr/bin/python3.5), the python command line does not support ipython and is the standard python command line.\u003c/p\u003e\n\n\u003cp\u003eThe project interpreter window also does not list ipython as installed package for the \u003ccode\u003e/usr/bin/python3.5\u003c/code\u003e configuration. But it is there:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esudo apt-get install ipython\nReading package lists... Done\nBuilding dependency tree \nReading state information... Done\nipython is already the newest version (2.4.1-1).\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow can I fix this?\u003c/p\u003e\n\n\u003cp\u003eOutput from initializing command line:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e/usr/bin/python3.5 /opt/pycharm-2016.3.2/helpers/pydev/pydevconsole.py 44543 41206\nPyDev console: starting.\nimport sys; print('Python %s on %s' % (sys.version, sys.platform))\nsys.path.extend(['$$projectPath$$'])\nPython 3.5.2 (default, Nov 17 2016, 17:05:23) \n[GCC 5.4.0 20160609] on linux\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"3","creation_date":"2017-05-24 08:15:49.933 UTC","last_activity_date":"2017-05-24 08:42:52.9 UTC","last_edit_date":"2017-05-24 08:42:52.9 UTC","last_editor_display_name":"","last_editor_user_id":"1082349","owner_display_name":"","owner_user_id":"1082349","post_type_id":"1","score":"0","tags":"python|ubuntu|pycharm","view_count":"39"} +{"id":"25230257","title":"jpanel not showing contents","body":"\u003cp\u003eI am trying to make a generic Ok/Cancel dialog that can accept a subclassed JPanel that adds two abstract methods (void ok() and void cancel());\u003c/p\u003e\n\n\u003cp\u003eThe idea is that when the Ok button or the Cancel button is pushed, the appropriate methods on the subclassed panel are called. However, I cannot get the main frame to show the JPanel.\u003c/p\u003e\n\n\u003cp\u003ehere is the OkCancelFrame code. If it is run, it should show an Ok/Cancel form with the text \"Now you see me\".\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport javax.swing.JLabel;\n\npublic class OkCancelForm extends javax.swing.JFrame {\n\n private OkCancelPanel okCancelPanel;\n\n public OkCancelForm(OkCancelPanel okCancelPanel) {\n this.okCancelPanel = okCancelPanel;\n initComponents();\n mainPanel.add(okCancelPanel);\n mainPanel.revalidate();\n mainPanel.repaint();\n pack();\n }\n\n private void initComponents() {\n java.awt.GridBagConstraints gridBagConstraints;\n\n mainPanel = new javax.swing.JPanel();\n javax.swing.JPanel buttonPanel = new javax.swing.JPanel();\n javax.swing.JButton ok = new javax.swing.JButton();\n javax.swing.JButton cancel = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n getContentPane().setLayout(new java.awt.GridBagLayout());\n\n mainPanel.setLayout(null);\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n gridBagConstraints.weightx = 1.0;\n gridBagConstraints.weighty = 1.0;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n getContentPane().add(mainPanel, gridBagConstraints);\n\n buttonPanel.setLayout(new java.awt.GridBagLayout());\n\n ok.setText(\"Ok\");\n ok.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n okActionPerformed(evt);\n }\n });\n buttonPanel.add(ok, new java.awt.GridBagConstraints());\n\n cancel.setText(\"Cancel\");\n cancel.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n cancelActionPerformed(evt);\n }\n });\n buttonPanel.add(cancel, new java.awt.GridBagConstraints());\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 1;\n gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END;\n gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);\n getContentPane().add(buttonPanel, gridBagConstraints);\n\n pack();\n }\n\n private void cancelActionPerformed(java.awt.event.ActionEvent evt) { \n okCancelPanel.cancel();\n this.dispose();\n } \n\n private void okActionPerformed(java.awt.event.ActionEvent evt) { \n okCancelPanel.ok();\n this.dispose();\n } \n\n public static void main(String args[]) {\n OkCancelPanel panel = new OkCancelPanel() {\n public void ok() { }\n public void cancel() { }\n };\n\n panel.add(new JLabel(\"Now you see me\"));\n\n new OkCancelForm(panel).setVisible(true);\n }\n\n private javax.swing.JPanel mainPanel;\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"10","creation_date":"2014-08-10 15:45:00.14 UTC","last_activity_date":"2014-08-11 07:14:51.707 UTC","last_edit_date":"2014-08-11 07:14:51.707 UTC","last_editor_display_name":"","last_editor_user_id":"714968","owner_display_name":"user3194227","post_type_id":"1","score":"0","tags":"java|swing|jframe","view_count":"198"} +{"id":"11075804","title":"Create small read-only unfocused buffer","body":"\u003cp\u003eI have a problem explaining what I need, and this is why I can't find it (probably), but I'll try my best.\u003c/p\u003e\n\n\u003cp\u003eI need one line of text on top of modeline, kind of a footer in the buffer. It is for displaying help, so \u003ccode\u003ewith-electric-help\u003c/code\u003e gets very close to it except that there's an issue with focus (I can move focus back to the original window, but the key bindings will be of the help buffer - not good).\u003c/p\u003e\n\n\u003cp\u003eIdeally it would be just a line of text which stays on top of modeline (doesn't scroll with the buffer).\u003c/p\u003e\n\n\u003cp\u003eMy issues with creating just a separate buffer: I don't know how to find out that the user removed focus from the buffer which was previously showing the \"small buffer\", so I don't know when to hide it.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2012-06-18 00:17:06.703 UTC","last_activity_date":"2012-06-18 15:22:54.663 UTC","last_editor_display_name":"","owner_display_name":"user797257","post_type_id":"1","score":"1","tags":"emacs|buffer","view_count":"62"} +{"id":"40900497","title":"Do any distributed computing platforms use a common format to exchange messages?","body":"\u003cp\u003eI'm writing my own toy platform and I'd like to make it compatible with others if possible. Is there a common message format that allows nodes from different platforms to communicate with one another?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eedit\u003c/strong\u003e: Added terminology tag for clarity. I've seen the phrase 'exchange format' used to describe what I'm asking for but I don't know whether that is a canonical term.\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2016-12-01 00:09:26.807 UTC","last_activity_date":"2016-12-01 00:09:26.807 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1467202","post_type_id":"1","score":"1","tags":"protocols|terminology|distributed-computing","view_count":"15"} +{"id":"43403271","title":"Is let validators: { [s: string]: StringValidator; } = {}; the same as ...?","body":"\u003cp\u003eThe typescript handbook has the following example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e// Validators to use\nlet validators: { [s: string]: StringValidator; } = {};\nvalidators[\"ZIP code\"] = new ZipCodeValidator();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs doing: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elet validators: { [s: string]: StringValidator; } = {};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe same as:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elet validators = {};\nvalidators[\"s\"] = new StringValidator();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf you could elaborate on the details on how the syntax works that would be great.\u003c/p\u003e","accepted_answer_id":"43403486","answer_count":"2","comment_count":"0","creation_date":"2017-04-13 23:40:52.28 UTC","last_activity_date":"2017-04-14 00:06:13.02 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1684269","post_type_id":"1","score":"0","tags":"typescript","view_count":"46"} +{"id":"14384549","title":"How do I access a third party DLL from a Tcl script?","body":"\u003cp\u003eI am trying to learn how to access a third party DLL from a Tcl script. There are a lot of tidbits of information on this topic in numerous places, but nothing that provides a nice, concise start-to-finish description of how to do it. I've tried a number of things, with varying degrees of failure. I've gotten the closest to success using SWIG and Visual Studio Express 2012 (both of which I am a complete newbie...)\u003c/p\u003e\n\n\u003cp\u003eI saw a previous response to a similar question here \u003ca href=\"https://stackoverflow.com/questions/11693047/how-to-create-a-dll-with-swig-from-visual-studio-2010\"\u003eHow to create a DLL with SWIG from Visual Studio 2010\u003c/a\u003e, in which the goal was to \u003cem\u003ecreate\u003c/em\u003e a DLL from C code. I do not have the source for the DLL, only the .dll, .h, and .lib files from the vendor who created the DLL.\u003c/p\u003e\n\n\u003cp\u003eThe responder in that post had instructions that are very close to what I'm looking for, I think. He stated that the process for wrapping a DLL is similar, and to ask if instructions were needed to accomplish that. I'm hoping he responds to this post... \u003c/p\u003e\n\n\u003cp\u003e(Disclaimer: I'm a complete newbie to this forum as well, and I couldn't figure out a way to follow up on that post directly. Please forgve my ignorance...)\u003c/p\u003e\n\n\u003cp\u003eCan anyone povide detailed instructions on how to accomplish my goal? Thanks in advance!\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2013-01-17 17:18:59.663 UTC","last_activity_date":"2013-11-11 21:23:54.417 UTC","last_edit_date":"2017-05-23 12:12:16.657 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"1987464","post_type_id":"1","score":"3","tags":"visual-studio|dll|tcl|swig","view_count":"177"} +{"id":"44346041","title":"Linking to local video file for video background HTML/CSS","body":"\u003cp\u003eI've been stuck trying to make a video on my computer be the video in the background. My video is titled \"runbg.avi\" and it is in the same folder as my HTML and CSS files.\u003c/p\u003e\n\n\u003cp\u003eThese are a couple of many websites that I visited to search for an answer.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://www.overclock.net/t/1249732/css-background-image-using-local-file\" rel=\"nofollow noreferrer\"\u003eUsing file:// instead of http:// when trying to get video from my computer rather than the web.\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://slicejack.com/fullscreen-html5-video-background-css/\" rel=\"nofollow noreferrer\"\u003eI can point to video on the web but not locally.\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eMy program so far. \u003c/p\u003e\n\n\u003cp\u003e\u003cdiv class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\"\u003e\r\n\u003cdiv class=\"snippet-code\"\u003e\r\n\u003cpre class=\"snippet-code-css lang-css prettyprint-override\"\u003e\u003ccode\u003e/* BACKGROUND */\r\nvideo#vid {\r\nposition: fixed; \r\nright: 0; \r\nbottom: 0;\r\nmin-width: 100%; \r\nmin-height: 100%;\r\nwidth: auto; \r\nheight: auto; \r\nz-index: -100;\r\nbackground-size: cover;\r\nmargin: 0 auto;\r\n}\u003c/code\u003e\u003c/pre\u003e\r\n\u003cpre class=\"snippet-code-html lang-html prettyprint-override\"\u003e\u003ccode\u003e\u0026lt;!DOCTYPE html\u0026gt;\r\n\u0026lt;head\u0026gt;\r\n\u0026lt;title\u0026gt;Seb's Fitness\u0026lt;/title\u0026gt;\r\n\r\n\u0026lt;link rel = \"stylesheet\"\r\n type = \"text/css\"\r\n href = \"css.css\" /\u0026gt;\r\n\r\n \u0026lt;video autoplay loop poster=\"\" id=\"vid\"\u0026gt;\r\n \u0026lt;source src=\"file://runbg.avi\" type=\"video/avi\"\u0026gt;\r\n \u0026lt;/video\u0026gt;\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003c/p\u003e","answer_count":"2","comment_count":"3","creation_date":"2017-06-03 16:19:00.727 UTC","last_activity_date":"2017-06-03 16:40:23.873 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4705945","post_type_id":"1","score":"0","tags":"html|css|video|background|html5-video","view_count":"322"} +{"id":"13978842","title":"msysgit and git-cheetah having issues on winXP with \"Git Bash\" context menu","body":"\u003cp\u003eI've installed msysgit version 1.8.0 on Windows XP and I chose to use the plugin \"advanced\" version for the context menu. If i start up git bash from the shortcut icon, it starts up fine. But if I use the right click context menu, I got the following errors:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eWelcome to Git (version 1.8.0-preview20121022)\n\nRun 'git help git' to display the help index.\nRun 'git help \u0026lt;command\u0026gt;' to display help for specific commands.\nsh: /bin/stty: No such file or directory \nsh: /bin/stty: No such file or directory\nsh: hostname: command not found\nsh: unalias: cm: not found\n:Desktop/2 part Auth/GoogleAuth\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI used the same version on my home windows 7 machine and had no issues at all.\u003c/p\u003e\n\n\u003cp\u003eAny clues?\u003c/p\u003e\n\n\u003cp\u003eThanks,\nJustin\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2012-12-20 19:08:34.213 UTC","favorite_count":"1","last_activity_date":"2012-12-20 19:08:34.213 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"559525","post_type_id":"1","score":"1","tags":"git|msysgit","view_count":"193"} +{"id":"20087695","title":"How to upload Site in WHM SERVER?","body":"\u003cp\u003e\u003cem\u003e\u003cstrong\u003eI have a WHM Control Panel. I want to Upload Site on WHM SERVER But i am not getting File Manager Like in Cpanel Hosting Where we can upload site form File Manager.\u003c/em\u003e\u003c/strong\u003e \u003c/p\u003e","accepted_answer_id":"20088107","answer_count":"3","comment_count":"0","creation_date":"2013-11-20 04:56:33.757 UTC","last_activity_date":"2013-11-21 04:41:47.297 UTC","last_edit_date":"2013-11-21 04:41:47.297 UTC","last_editor_display_name":"","last_editor_user_id":"2385479","owner_display_name":"","owner_user_id":"2979242","post_type_id":"1","score":"1","tags":"php|mysql|whm","view_count":"1874"} +{"id":"41212721","title":"Generate list from user input","body":"\u003cp\u003eHow could I have a user input something like \u003ccode\u003eBlah Blah [1-30] Blah\u003c/code\u003e and then parse it to get a list like so:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[\n 'Blah Blah 1 Blah',\n 'Blah Blah 2 Blah',\n etc...\n 'Blah Blah 30 Blah',\n]\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"41212894","answer_count":"3","comment_count":"0","creation_date":"2016-12-18 20:48:05.14 UTC","last_activity_date":"2016-12-19 03:49:34.76 UTC","last_edit_date":"2016-12-18 21:05:00.64 UTC","last_editor_display_name":"","last_editor_user_id":"4952130","owner_display_name":"","owner_user_id":"4333465","post_type_id":"1","score":"0","tags":"python|regex|list|python-3.x|python-3.4","view_count":"65"} +{"id":"9051331","title":"How to insert the rows in the database mysql table in the following?","body":"\u003cp\u003eI have two table named: \u003cstrong\u003eBlog\u003c/strong\u003e for displaying blogs post and \u003cstrong\u003ecomments\u003c/strong\u003e for displaying comments section for each blog post.\u003c/p\u003e\n\n\u003cp\u003eThe fields for these are as follows: \u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eFor Blog:\u003c/strong\u003e \u003c/p\u003e\n\n\u003cp\u003e1: blog_id\u003c/p\u003e\n\n\u003cp\u003e2: title\u003c/p\u003e\n\n\u003cp\u003e3: body\u003c/p\u003e\n\n\u003cp\u003e4: author\u003c/p\u003e\n\n\u003cp\u003e5: updated\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eFor Comments:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e1: comments_id\u003c/p\u003e\n\n\u003cp\u003e2: name\u003c/p\u003e\n\n\u003cp\u003e3: email\u003c/p\u003e\n\n\u003cp\u003e4: body\u003c/p\u003e\n\n\u003cp\u003e5: blog_id\u003c/p\u003e\n\n\u003cp\u003eThe field \u003cstrong\u003eblog_id\u003c/strong\u003e must be the same for both the table.\u003c/p\u003e\n\n\u003cp\u003eNow what i want is that suppose for blog_id = \"2\", I am writing comment, so what would be the insert query so that when i visit index.php?blog_id=2, I get the comments for only that particular post.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eI mean how to insert the comments for a particular blog_id?\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI tried this query to insert:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eINSERT INTO cms.comments(blog_id, name,email,comments_body)\n VALUES (\n '\".$arr['blog_id'].\"',\n '\".$arr['name'].\"',\n\n '\".$arr['email'].\"',\n '\".$arr['body'].\"'\n ) );\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"9059952","answer_count":"3","comment_count":"4","creation_date":"2012-01-29 06:14:41.87 UTC","last_activity_date":"2012-01-30 06:00:42.963 UTC","last_edit_date":"2012-01-30 06:00:42.963 UTC","last_editor_display_name":"","last_editor_user_id":"2231861","owner_display_name":"","owner_user_id":"2231861","post_type_id":"1","score":"0","tags":"mysql","view_count":"87"} +{"id":"31536496","title":"How do I make an erasing animation in CSS?","body":"\u003cp\u003eI have a webpage designed in CSS and HTML that shows stuff written on a blackboard.\u003c/p\u003e\n\n\u003cp\u003eWhen the user clicks on a link on the homepage, I want the user to see a huge hand with a duster act like erasing the content to reveal the new webpage.\u003c/p\u003e\n\n\u003cp\u003eIs it possible to achieve this animation using only CSS? If not, then how do I do this in Javascript?\u003c/p\u003e","accepted_answer_id":"31536702","answer_count":"1","comment_count":"1","creation_date":"2015-07-21 10:26:26.38 UTC","last_activity_date":"2015-07-21 10:36:39.017 UTC","last_edit_date":"2015-07-21 10:28:52.103 UTC","last_editor_display_name":"","last_editor_user_id":"5132099","owner_display_name":"","owner_user_id":"5132099","post_type_id":"1","score":"-1","tags":"javascript|html|css|webpage","view_count":"57"} +{"id":"9318838","title":"Deserializing Json using .Net","body":"\u003cp\u003eI have an external vendor API that returns JSON in this format\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\"3\":{\"id\":1,\"name\":\"Scott Foo\",\"age\":55},\n\"59\":{\"id\":2,\"name\":\"Jim Morris\",\"age\":62}}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am trying to deserialize it using the following code\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[DataContract]\npublic class Name\n{\n [DataMember]\n public int id { get; set; }\n\n [DataMember]\n public string name { get; set; }\n\n [DataMember]\n public int age{ get; set; }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCode to deserialize is\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eList\u0026lt;Name\u0026gt; nameList = Deserialize\u0026lt;List\u0026lt;Name\u0026gt;\u0026gt;(temp); \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhere the Deserialize is defined as\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic static T Deserialize\u0026lt;T\u0026gt;(string json)\n{\n T obj = Activator.CreateInstance\u0026lt;T\u0026gt;();\nMemoryStream ms = new MemoryStream(Encoding.Unicode.GetBytes(json));\n DataContractJsonSerializer serializer = new DataContractJsonSerializer(obj.GetType());\n obj = (T)serializer.ReadObject(ms);\n ms.Close();\n ms.Dispose();\n return obj;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe object returned in nameList is of zero count. Any idea how this JSON can be deserialized in .Net (i.e. not using Json.Net or any such third-party dll)?\u003c/p\u003e","answer_count":"2","comment_count":"3","creation_date":"2012-02-16 20:51:21.613 UTC","favorite_count":"1","last_activity_date":"2012-03-01 02:47:18.6 UTC","last_edit_date":"2012-02-16 21:14:23.707 UTC","last_editor_display_name":"","last_editor_user_id":"22539","owner_display_name":"","owner_user_id":"1214791","post_type_id":"1","score":"0","tags":"c#|.net|json|deserialization","view_count":"1364"} +{"id":"33936838","title":"Angular UI Router reset $scope","body":"\u003cp\u003eI'm building a quiz using AngularJS and UI Router.\u003c/p\u003e\n\n\u003cp\u003eI have my app structured like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e - intro screen\n - app screen (where you play the actual quiz)\n - results screen (where i display the score)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe app use the same controller (MainCTRL). I store in the MainCTRL in \u003ccode\u003e$scope.score\u003c/code\u003e the score.\u003c/p\u003e\n\n\u003cp\u003eThe problem is that when I \u003ccode\u003e$state.go('results');\u003c/code\u003e the controller is being reseted I think and the \u003ccode\u003e$scope.score\u003c/code\u003e is equal to 0.\u003c/p\u003e\n\n\u003cp\u003eHow can I fix this problem?\u003c/p\u003e","accepted_answer_id":"33937063","answer_count":"1","comment_count":"0","creation_date":"2015-11-26 10:56:50.833 UTC","last_activity_date":"2015-11-26 11:08:41.633 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4690276","post_type_id":"1","score":"0","tags":"angularjs","view_count":"187"} +{"id":"11130021","title":"What is the best way to update the DOM with AJAX to reflect changes in the DB?","body":"\u003cp\u003eI'm building this application using PHP, MySQL and jQuery. Essentially it's a checklist management application. \u003c/p\u003e\n\n\u003cp\u003eI have these checklists (laid out as tables, much like a spreadsheet) that can be edited asynchronously; every time there's a change, it's reported through an AJAX call to PHP which updates MySQL. \u003c/p\u003e\n\n\u003cp\u003eThe tricky part is that it's possible for other people to be editing the same checklist at the same time, the content of the checklist is updated if jQuery notices a change between the JSON object (it fires of an HTTP request periodically to ping the DB) and the content in the HTML table row.\u003c/p\u003e\n\n\u003cp\u003eThis works fine for a limited number of items in my checklist, but when when my checklist numbers a considerable amount of rows, it kinda craps itself and lags out. I know that the inefficiency lays in the fact that every time an HTTP request is made for the most recent items in the checklist, I loop through every row in the HTML table and compare the contents of the row with the corresponding checklist item in the JSON object to see if there was a change.\u003c/p\u003e\n\n\u003cp\u003eI was wondering if there's a more efficient way to detect changes between my JSON object and what I have on the screen without looping through the DOM?\u003c/p\u003e\n\n\u003cp\u003eEssentially, how do I keep a large dataset in sync asychronously with minimal DOM manipulation?\u003c/p\u003e\n\n\u003cp\u003eThanks a lot!\u003c/p\u003e","accepted_answer_id":"11130053","answer_count":"1","comment_count":"1","creation_date":"2012-06-21 00:26:26.643 UTC","favorite_count":"1","last_activity_date":"2012-06-21 00:32:20.773 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"885155","post_type_id":"1","score":"0","tags":"php|javascript|jquery|mysql|ajax","view_count":"187"} +{"id":"38120626","title":"Angular ui-router not updating view","body":"\u003cp\u003eI have the following code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar app = angular.module('app', ['ui.router', 'ui.router.title']);\n\napp.config(function($stateProvider, $urlRouterProvider) {\n // For any unmatched url, redirect to /state1\n$urlRouterProvider.otherwise(\"/\");\n //\n // Now set up the states\n$stateProvider\n.state('activity', {\n title: \"activity\",\n url: \"/activity\",\n templateUrl: \"/app/activity\",\n resolve: {\n $title: function() { return 'Home'; }\n }\n})\n.state('friends', {\n title: \"Friends\",\n url: \"/friends\",\n templateUrl: \"/app/friends\",\n resolve: {\n $title: function() { return 'Friends'; }\n }\n})\n\n});\n\n\u0026lt;a ui-sref=\"activity\" data-ui-sref-opts=\"{reload: true}\" ui-sref-active=\"active\"\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, what happens here is that, when there's a change in the Friends' view, it doesn't reflect unless i manually have to refresh the page myself.\u003c/p\u003e\n\n\u003cp\u003eI've tried things like \u003ccode\u003edata-ui-sref-opts=\"{reload: true}\"\u003c/code\u003e but that still doesn't get the job done.\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2016-06-30 10:35:04.26 UTC","last_activity_date":"2016-06-30 10:35:04.26 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6532872","post_type_id":"1","score":"1","tags":"angularjs|angular-ui-router","view_count":"48"} +{"id":"25312060","title":"Adobe DPS Web Viewer Authentication","body":"\u003cp\u003eI'm attempting to use Adobe's \u003ccode\u003eDigital Publishing Suite Web Viewer.\u003c/code\u003e I've set up my Web Viewer correctly - it is working within my website. However, it is not authenticating that each user has access to the folio that the Web Viewer is accessing. Adobe has a sort of \u003ca href=\"http://www.adobe.com/devnet-docs/digitalpublishingsuite/ContentViewerForWebSDK-2.0/modules/Authentication.html\" rel=\"nofollow\"\u003edocumentation\u003c/a\u003e on how to do this, but their documentation seems lacking. It seems as if Adobe is asking me to get users' username and password to Adobe - but that can't be right. I doubt Adobe would invite phising. But that isn't the only point I'm lost on.\u003c/p\u003e\n\n\u003cp\u003eMy current script is as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e var wvQueryParamGroups = location.search.match(/[?\u0026amp;^#]wv=(s[\\/%\\-.\\w]+)/),\n wvQueryParam = wvQueryParamGroups \u0026amp;\u0026amp; wvQueryParamGroups.length === 2 ? decodeURIComponent(wvQueryParamGroups[1]) : null;\n\n function loadXMLDoc(url, successCallback, failCallback) {\n if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari\n xmlhttp = new XMLHttpRequest();\n }\n else {// code for IE6, IE5\n xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n xmlhttp.onreadystatechange = function () {\n if (xmlhttp.readyState == 4 \u0026amp;\u0026amp; xmlhttp.status == 200) {\n var parser = new DOMParser();\n var xmlDoc = parser.parseFromString(xmlhttp.responseText, \"application/xml\");\n successCallback(xmlDoc);\n } else if (xmlhttp.readyState == 4 \u0026amp;\u0026amp; xmlhttp.status == 0) {\n alert(\"unsuccessful cross-domain data access attempt?\");\n failCallback(xmlhttp.status);\n } else if (xmlhttp.readyState == 4) {\n failCallback(xmlhttp.status);\n } else {\n console.log('readystate=' + xmlhttp.readyState + ', status=' + xmlhttp.status);\n }\n }\n xmlhttp.open(\"GET\", url, true);\n xmlhttp.send();\n }\n\n function directEntitlementSignIn(directEntitlementURL, emailAddress, password, appID, authTokenSuccess, authTokenFail) {\n var response;\n if (!authTokenSuccess || !authTokenFail) {\n throw new Error('Callbacks are required: ');\n }\n loadXMLDoc(directEntitlementURL + '?emailAddress=' + emailAddress + '\u0026amp;password=' + password + '\u0026amp;appId=' + appID,\n handleToken = function (data) {\n token = data.documentElement.childNodes[0].innerHTML;\n authTokenSuccess(token);\n }\n );\n }\n\n function onAuthTokenSuccess(token) {\n alert(token);\n // pass the token into the Authenticator class's login method\n }\n\n function onAuthTokenFail(status) {\n alert(\"fail: \" + status);\n // prompt the user to try logging in again\n }\n\n function signIn(emailAddress, password) {\n var deAPIURL = 'http://127.0.0.1/hostDemos r27/authHard/test.php';\n var emailAddress; // user's login ID.....get from form\n var password; // user's password ... get from form\n var appID = 'com.publisher.magazine';\n\n directEntitlementSignIn(deAPIURL, emailAddress, password, appID, onAuthTokenSuccess, onAuthTokenFail);\n }\n\n function eventCallback(ev) {\n if (ev.eventType == \"paywall\") {\n return false;\n }\n if (ev.eventType == \"metadata\") {\n return true;\n }\n console.log(ev);\n return true;\n }\n\n function errorCallback (message) {\n console.log(message);\n return true;\n }\n\n function redirectCallbackHandler (message) {\n console.log(message);\n }\n\n var wv_appName = \"Professional Roofing\";\n var wv_accountID = Account_ID_Is_Here; //Hiding account ID purposely\n var wv_folio = \"August 2014 Issue\";\n var wv_article = \"Cover\";\n var wv_url = '/s/' + wv_appName + '/' + wv_accountID + '/' + wv_folio + '/' + wv_article + '.html';\n console.log(wv_url);\n\n var bridge = adobeDPS.frameService.createFrame({\n boolIsFullScreen : true,\n parentDiv : 'mainContainer',\n wrapperClasses : 'uniqueFrame',\n iframeID : 'demoFrame',\n accountIDs : wv_accountID,\n wvParam : wvQueryParam ? wvQueryParam : wv_url,\n curtainClasses : 'mask hidden',\n eventCallback : eventCallback,\n errorCallback : errorCallback,\n redirectCallback : redirectCallbackHandler\n });\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-08-14 15:36:58.393 UTC","last_activity_date":"2014-08-18 17:31:17.303 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2701739","post_type_id":"1","score":"2","tags":"javascript|adobe-dps","view_count":"362"} +{"id":"16516046","title":"How to delete all nodes of same value from linklist/Queue","body":"\u003cp\u003eI have been trying hard to resolve this however yet not succeed I have data structs as follow (which actually is very complex I just simplifies for discussion) :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etypedef struct node{\n struct node* next;\n void* arg;\n}node_t;\n\ntypedef struct queue{\nnode_t* head;\nnode_t* tail;\n}queue_t;\n\naddQ(queue_t*ptr , int data)\n{\n queue_t* q = ptr;\n node_t * n = malloc(sizeof(*n));\n\n n-\u0026gt;arg = data;\n n-\u0026gt;next = NULL;\n\n if(NULL == q-\u0026gt;head){\n q-\u0026gt;head = q-\u0026gt;tail = n;\n return ;\n }\n q-\u0026gt;tail-\u0026gt;next = n;\n q-\u0026gt;tail = q-\u0026gt;tail-\u0026gt;next;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow I want to delete node of same value ( I have tried couple ways however yet not succeed ) , Just consider this sequence for reference:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eaddQ(q, 12);\naddQ(q, 12);\naddQ(q, 4);\naddQ(q, 12);\naddQ(q, 12);\naddQ(q, 14);\naddQ(q, 12);\naddQ(q, 12);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to Delete all the nodes with value 12.\u003c/p\u003e","answer_count":"3","comment_count":"6","creation_date":"2013-05-13 06:30:29.907 UTC","favorite_count":"1","last_activity_date":"2013-05-14 02:31:44.08 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1181347","post_type_id":"1","score":"3","tags":"c|algorithm|linked-list|queue","view_count":"682"} +{"id":"29495279","title":"XCode Storyboard - how are sceneId's generated?","body":"\u003cp\u003eI'm reverse engineering XCode Storyboards and theyre easy to generate except I was wondering if anyone one know the method call/format/algorithm Apple use to generate \u003cstrong\u003esceneId\u003c/strong\u003e for each storyboard scene.\nIn this example sceneId is \u003cstrong\u003e\"dA0-dT-CWd\"\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;!--CLKSyncLogViewController--\u0026gt;\n \u0026lt;scene sceneID=\"dA0-dT-CWd\"\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNearest I can think of is a short version of a guid you might use in windows? But not seen these short ids in mac/ios dev before?\u003c/p\u003e\n\n\u003cp\u003eany clues?\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2015-04-07 15:26:48 UTC","last_activity_date":"2015-04-07 15:26:48 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"181947","post_type_id":"1","score":"1","tags":"objective-c|xcode|storyboard","view_count":"55"} +{"id":"43263738","title":"DropDownListFor value cannot be null","body":"\u003cp\u003eI am new to MVC. I am using a DropDownListFor to populate a number of Customer fields when a Company is selected. I am using the following code for the DropDownListFor:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e @Html.DropDownListFor(model =\u0026gt; model.CustomerId, new SelectList(ViewBag.Customers, \"CustomerId\", \"Company\"), \"---Select one---\", new { htmlAttributes = new { @class = \"company\" } });\n @Html.HiddenFor(model =\u0026gt; model.Company)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis code retrieves the Customer data:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[HttpPost]\npublic ActionResult GetCustomer(int custId)\n{\n var data = db.Customers.Find(custId);\n return Json(data);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe relevant fields in the ViewModel (from the Customer table) are:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic int CustomerId { get; set; }\npublic string Company { get; set; }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe code in the Create method that creates the ViewBag:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic ActionResult Create()\n{\n QuoteViewModel qvm = new QuoteViewModel();\n qvm.QuoteDetail = new List\u0026lt;QuoteDetail\u0026gt;(); \n var customers = db.Customers.ToList();\n ViewBag.Customers = customers;\n return View(qvm);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd here is the code for the POST:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[HttpPost]\n[ValidateAntiForgeryToken]\npublic ActionResult Create(QuoteViewModel qvm)\n{\n if (ModelState.IsValid)\n {\n Quote quote1 = new Quote();\n quote1.CustomerId = qvm.CustomerId;\n ...\n db.Quotes.Add(quote1);\n customer.CustomerId = qvm.CustomerId;\n ...\n db.Entry(customer).State = EntityState.Modified;\n bool saveFailed;\n do\n {\n saveFailed = false;\n try\n {\n db.SaveChanges();\n }\n catch (DbUpdateConcurrencyException ex)\n {\n saveFailed = true;\n var objContext = ((IObjectContextAdapter)db).ObjectContext;\n // Get failed entry\n var entry = ex.Entries.Single();\n // Now call refresh on ObjectContext\n objContext.Refresh(RefreshMode.ClientWins, entry.Entity);\n }\n } while (saveFailed);\n return RedirectToAction(\"Index\");\n }\n return View(qvm);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe population of the fields works fine, but when I attempt to Create the view model I get an error \"Value cannot be null\" on the DropDownListFor. I have researched others having this issue but cannot find an answer that applies to this case. Any help would be much appreciated.\u003c/p\u003e","accepted_answer_id":"43265339","answer_count":"2","comment_count":"2","creation_date":"2017-04-06 19:03:49.317 UTC","last_activity_date":"2017-04-06 21:42:51.747 UTC","last_edit_date":"2017-04-06 21:42:51.747 UTC","last_editor_display_name":"","last_editor_user_id":"6906732","owner_display_name":"","owner_user_id":"6906732","post_type_id":"1","score":"0","tags":"asp.net-mvc","view_count":"331"} +{"id":"44845748","title":"Adding a package with pre-release dependencies","body":"\u003cp\u003eUsing LINQPad I've added a private feed to Visual Studio Team Services. However one of my packages requires a pre-release package: Quartz.Net in my case. I've ticked Include Prerelease but I think it's getting confused and trying to load the package from my private feed rather than NuGet.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/WL6Px.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/WL6Px.png\" alt=\"LINQ NuGet Package Manager\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI've tried to work around the issue by loading the package into the local package cache. LINQPad doesn't seem to consider this. Other than uploading these packages into my own private feed, what options do I have? I'm not going to alter my own packages to get around LINQPad's shortcomings.\u003c/p\u003e\n\n\u003cp\u003eNote: I've setup the VSTS feed according this \u003ca href=\"https://stackoverflow.com/questions/40514300/how-to-use-visual-studio-team-services-as-a-nuget-feed-in-linqpad\"\u003equestion\u003c/a\u003e.\u003c/p\u003e\n\n\u003cp\u003eHere is what my NuGet feeds look like in LINQPad\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/T1tD0.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/T1tD0.png\" alt=\"LINQ NuGet Feeds\"\u003e\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"44923160","answer_count":"1","comment_count":"4","creation_date":"2017-06-30 11:48:03.903 UTC","last_activity_date":"2017-07-05 12:08:11.037 UTC","last_edit_date":"2017-07-04 08:06:55.023 UTC","last_editor_display_name":"","last_editor_user_id":"271200","owner_display_name":"","owner_user_id":"271200","post_type_id":"1","score":"2","tags":"vsts|linqpad|vsts-package-management","view_count":"114"} +{"id":"5386997","title":"Assign a URL to Url.AbsoluteUri in ASP.NET","body":"\u003cp\u003eCan I assign a URL to \u003ccode\u003eUrl.AbsoluteUri\u003c/code\u003e in ASP.NET?\u003c/p\u003e","accepted_answer_id":"5387037","answer_count":"3","comment_count":"0","creation_date":"2011-03-22 04:56:41.127 UTC","last_activity_date":"2011-03-22 05:02:57.977 UTC","last_edit_date":"2011-03-22 05:00:43.137 UTC","last_editor_display_name":"","last_editor_user_id":"23897","owner_display_name":"","owner_user_id":"670599","post_type_id":"1","score":"0","tags":"c#|.net|asp.net","view_count":"1004"} +{"id":"21183480","title":"How to make number in first line of file as variable?","body":"\u003cp\u003eI have a file with a list of number like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e10\n15..135\n140..433\n444..598\n600..783\n800\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe first and last lines are always single number without \"..\". So the problem is that, how to edit the first and last line to be like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e1..10\n15..135\n140..433\n444..598\n600..783\n800..900\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFor the first line.. I need to put \"1..\" in front of the number IF THE NUMBER IS NOT 0. If the number is already 0, no \"1..\" need to be there.\u003c/p\u003e\n\n\u003cp\u003eFor last line.. I always want to edit (in this case I add \"\u003ccode\u003e..900\u003c/code\u003e\"). Can somebody give me some idea?\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2014-01-17 10:25:40.973 UTC","last_activity_date":"2014-01-17 10:50:50.13 UTC","last_edit_date":"2014-01-17 10:30:45.857 UTC","last_editor_display_name":"","last_editor_user_id":"205233","owner_display_name":"","owner_user_id":"3206122","post_type_id":"1","score":"-1","tags":"perl|variables","view_count":"45"} +{"id":"18216697","title":"\"GET Variable to Segment URL Redirect\" Plugin for EE2","body":"\u003cp\u003eUsing EE2, this is the plugin in question: \u003ca href=\"http://devot-ee.com/add-ons/get-variable-to-segment-url-redirect\" rel=\"nofollow\"\u003eGET Variable to Segment URL Redirect\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThis is exactly the plugin I need to solve a project problem, but I cannot get it to work. It doesn't do anything, and I'm sure its my own mistake but I cannot find any other helpful tidbits on this..\u003c/p\u003e\n\n\u003cp\u003eMy form is: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div id=\"sidebar\"\u0026gt;\n \u0026lt;div class=\"aliance\"\u0026gt;\n \u0026lt;h2\u0026gt;Clergy\u0026lt;/h2\u0026gt;\n \u0026lt;a href=\"{path='PCP/partner_congregations/'}\" class=\"more\"\u0026gt;Show All\u0026lt;/a\u0026gt;\n \u0026lt;ul\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"http://alliance-marketing.madmonkdev2.com/index.php/PCP/congregation_list?State=21\"\u0026gt;Sort By\u0026lt;/a\u0026gt;\n \u0026lt;form action=\"{path='PCP/congregation_list'}\" method=\"get\"\u0026gt;\n \u0026lt;select name=\"State\"\u0026gt;\n {exp:gwcode_categories cat_id=\"16\" incl_self=\"no\"}\n \u0026lt;option value=\"{cat_id}\"\u0026gt;\u0026amp;#123;cat_name\u0026amp;#125;\u0026lt;/option\u0026gt;\n {/exp:gwcode_categories\u0026amp;#}\n \u0026lt;/select\u0026gt;\n \u0026lt;input type=\"submit\" value=\"Submit\" /\u0026gt;\n \u0026lt;/form\u0026gt;\n \u0026lt;/li\u0026gt; \n \u0026lt;/ul\u0026gt;\n \u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere's the plugin code: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{exp:get_segment_redirect get_variable=“State” base_url=”/PCP/”}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe URL it should be redirecting but doesn't: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ehttp://blahblahblah.com/index.php/PCP/congregation_list?State=17\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI simply have to be overlooking something real simple here.. Because it's not doing anything at all for me.\u003c/p\u003e","accepted_answer_id":"18228027","answer_count":"1","comment_count":"0","creation_date":"2013-08-13 18:40:16.807 UTC","last_activity_date":"2013-08-16 22:16:27.367 UTC","last_edit_date":"2013-08-16 22:16:27.367 UTC","last_editor_display_name":"","last_editor_user_id":"955002","owner_display_name":"","owner_user_id":"2132925","post_type_id":"1","score":"0","tags":"url|plugins|expressionengine","view_count":"43"} +{"id":"15580728","title":"Android: draw Bitmap to TextView not working","body":"\u003cp\u003eAnother day, another error, ah the life of a new programmer. I'm trying to draw a \u003ccode\u003ebitmap\u003c/code\u003e into a \u003ccode\u003eTextView\u003c/code\u003e or \u003ccode\u003eImageView\u003c/code\u003e and its not working. I have been looking at this code for a couple hours, trying to figure out why it's not working. Below is the code. I'm not receiving any errors, and the program runs, it simply does not display the bitmap\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eCustomView.java\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class CustomView extends ImageView {\n\npublic CustomView(Context context) {\n super(context); \n // TODO Auto-generated constructor stub\n}\n\npublic CustomView(Context context, AttributeSet attrs) {\n super(context, attrs); \n // TODO Auto-generated constructor stub\n}\n\npublic CustomView(Context context, AttributeSet attrs, int defStyle) {\n super(context, attrs, defStyle); \n // TODO Auto-generated constructor stub\n} \n\n@Override\npublic void onDraw(Canvas canvas) {\n Bitmap line = BitmapFactory.decodeResource(getResources(), R.drawable.line);\n canvas.drawBitmap(line, 0, 0, null);\n super.onDraw(canvas); \n}\n}\n\n@Override \nprotected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n // Hail Mary. If this works then look up how to really use 'onMeasure()'.\n setMeasuredDimension(200, 50);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eMain Activity\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@Override\npublic void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n setContentView(R.layout.activity_main); \n\n refreshView();\n}\n\nprivate void refreshView() {\n Spinner spinner = (Spinner) findViewById(R.id.location_spinner);\n\n ArrayAdapter\u0026lt;String\u0026gt; adapter = new ArrayAdapter\u0026lt;String\u0026gt;(this,\n android.R.layout.simple_spinner_item, model.getLocationsArray());\n\n adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n\n spinner.setAdapter(adapter);\n\n SimpleDateFormat sdf = new SimpleDateFormat(\"E, MMM dd\");\n\n TextView goalText = (TextView) findViewById(R.id.goal_Id);\n TextView dateText = (TextView) findViewById(R.id.date_Id);\n TextView countText = (TextView) findViewById(R.id.count);\n TextView daysText = (TextView) findViewById(R.id.days);\n TextView totalText = (TextView) findViewById(R.id.total);\n TextView aveText = (TextView) findViewById(R.id.ave); \n\n GregorianCalendar now = new GregorianCalendar();\n goalText.setTextColor(Color.RED);\n goalText.setText(\"Today's Goal: Don't Smoke at \");\n dateText.setText(sdf.format(now.getTime()));\n //get today's count from data in the SQLite table - count entries with today's date\n countText.setText(\"\" + mySmokinDatabase.getTodaysCount());\n // Table data\n daysText.setText(\"\" + String.format(\"%10d\", model.getDays()));\n totalText.setText(\"\" + mySmokinDatabase.getTotal());\n\n if (model.getDays() \u0026gt; 0)\n aveText.setText(\"\" + mySmokinDatabase.getTotal()/model.getDays());\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eMainActivity.xml\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;ImageView class=\"com.example.smokin4thomassullivan.CustomView\"\n android:id=\"@+id/line_Id\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\"\n android:text=\"@string/line\"\n android:textAppearance=\"?android:attr/textAppearanceSmall\" /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eLogcat\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e03-22 20:17:47.272: E/AndroidRuntime(1474): FATAL EXCEPTION: main\n03-22 20:17:47.272: E/AndroidRuntime(1474): java.lang.RuntimeException: Unable to start \nactivity ComponentInfo{com.example.smokin4ThomasSullivan/com.example.smokin4\nThomasSullivan.MainActivity}: android.view.InflateException: Binary XML file line #21: \nError inflating class com.example.smokin4thomassullivan.CustomView\n03-22 20:17:47.272: E/AndroidRuntime(1474): at \nandroid.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)\n03-22 20:17:47.272: E/AndroidRuntime(1474): at \nandroid.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)\n03-22 20:17:47.272: E/AndroidRuntime(1474): at \nandroid.app.ActivityThread.access$600(ActivityThread.java:130)\n03-22 20:17:47.272: E/AndroidRuntime(1474): at \nandroid.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)\n03-22 20:17:47.272: E/AndroidRuntime(1474): at \nandroid.os.Handler.dispatchMessage(Handler.java:99)\n03-22 20:17:47.272: E/AndroidRuntime(1474): at \nandroid.os.Looper.loop(Looper.java:137)\n03-22 20:17:47.272: E/AndroidRuntime(1474): at \nandroid.app.ActivityThread.main(ActivityThread.java:4745)\n03-22 20:17:47.272: E/AndroidRuntime(1474): at \njava.lang.reflect.Method.invokeNative(Native Method)\n03-22 20:17:47.272: E/AndroidRuntime(1474): at \njava.lang.reflect.Method.invoke(Method.java:511)\n03-22 20:17:47.272: E/AndroidRuntime(1474): at \ncom.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)\n03-22 20:17:47.272: E/AndroidRuntime(1474): at \ncom.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)\n03-22 20:17:47.272: E/AndroidRuntime(1474): at \ndalvik.system.NativeStart.main(Native Method)\n03-22 20:17:47.272: E/AndroidRuntime(1474): Caused by: android.view.InflateException: \nBinary XML file line #21: Error inflating class \ncom.example.smokin4thomassullivan.CustomView\n03-22 20:17:47.272: E/AndroidRuntime(1474): at \nandroid.view.LayoutInflater.createViewFromTag(LayoutInflater.java:698)\n03-22 20:17:47.272: E/AndroidRuntime(1474): at \nandroid.view.LayoutInflater.rInflate(LayoutInflater.java:746)\n03-22 20:17:47.272: E/AndroidRuntime(1474): at \nandroid.view.LayoutInflater.inflate(LayoutInflater.java:489)\n03-22 20:17:47.272: E/AndroidRuntime(1474): at \nandroid.view.LayoutInflater.inflate(LayoutInflater.java:396)\n03-22 20:17:47.272: E/AndroidRuntime(1474): at \nandroid.view.LayoutInflater.inflate(LayoutInflater.java:352)\n03-22 20:17:47.272: E/AndroidRuntime(1474): at \ncom.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:256)\n03-22 20:17:47.272: E/AndroidRuntime(1474): at \nandroid.app.Activity.setContentView(Activity.java:1867)\n03-22 20:17:47.272: E/AndroidRuntime(1474): at \ncom.example.smokin4ThomasSullivan.MainActivity.onCreate(MainActivity.java:40)\n03-22 20:17:47.272: E/AndroidRuntime(1474): at \nandroid.app.Activity.performCreate(Activity.java:5008)\n03-22 20:17:47.272: E/AndroidRuntime(1474): at \nandroid.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)\n03-22 20:17:47.272: E/AndroidRuntime(1474): at \nandroid.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)\n03-22 20:17:47.272: E/AndroidRuntime(1474): ... 11 more\n03-22 20:17:47.272: E/AndroidRuntime(1474): Caused by: \njava.lang.ClassNotFoundException: com.example.smokin4thomassullivan.CustomView\n03-22 20:17:47.272: E/AndroidRuntime(1474): at \ndalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)\n03-22 20:17:47.272: E/AndroidRuntime(1474): at \njava.lang.ClassLoader.loadClass(ClassLoader.java:501)\n03-22 20:17:47.272: E/AndroidRuntime(1474): at \njava.lang.ClassLoader.loadClass(ClassLoader.java:461)\n03-22 20:17:47.272: E/AndroidRuntime(1474): at \nandroid.view.LayoutInflater.createView(LayoutInflater.java:552)\n03-22 20:17:47.272: E/AndroidRuntime(1474): at \nandroid.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)\n03-22 20:17:47.272: E/AndroidRuntime(1474): ... 21 more`\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks for any help!\u003c/p\u003e","accepted_answer_id":"15580927","answer_count":"3","comment_count":"10","creation_date":"2013-03-22 22:15:11.82 UTC","last_activity_date":"2013-03-23 07:42:52.09 UTC","last_edit_date":"2013-03-23 07:42:52.09 UTC","last_editor_display_name":"","last_editor_user_id":"635608","owner_display_name":"","owner_user_id":"2138555","post_type_id":"1","score":"0","tags":"android|bitmap","view_count":"1403"} +{"id":"25973287","title":"Why do print and printf show different numbers of decimal places by default","body":"\u003cp\u003eAs part of my degree I am required to take a programming course in Java; I am an experienced C# developer, so perhaps what I would expect from C# is conflicting with how Java actually works. The professor of the course couldn't give me a good reason why print and printf produce different results, so I have turned to the internet. \u003c/p\u003e\n\n\u003cp\u003eAs the title implies, I am getting different output when I use printf and print in a very basic Java application. The user is prompted for three values: the number of starting organisms (double), the percent change in population (double), and the number of days the population will multiply (int). I then run a calculation and output the values to the screen like so:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e for(int x = 1; x \u0026lt; days; x++)\n {\n startingOrganisms = startingOrganisms + (startingOrganisms * (increasePercent));\n System.out.printf(\"%d\\t\\t%f\\n\", (x + 1), startingOrganisms); \n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe problem is that this produces different output than if I just do:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e System.out.print((x + 1) + \"\\t\\t\" + startingOrganisms+ \"\\n\");\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe image below shows what is produced with the first code sample. My expectation is that both print and printf would yield the same result, but that is not the case. Can anyone explain what the difference is? Cursory searches of Google didn't turn anything up.\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/2VVdW.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e","accepted_answer_id":"25973443","answer_count":"4","comment_count":"1","creation_date":"2014-09-22 11:42:13.02 UTC","last_activity_date":"2014-09-22 13:35:11.657 UTC","last_edit_date":"2014-09-22 11:47:35.2 UTC","last_editor_display_name":"","last_editor_user_id":"545127","owner_display_name":"","owner_user_id":"245091","post_type_id":"1","score":"1","tags":"java","view_count":"193"} +{"id":"35160733","title":"How to Check if State of Cisco Phone is Ringback - Cisco JTapi","body":"\u003cp\u003eI am using JTapi to control Cisco phones. I am familiar with the various states of connections, terminals, calls etc. However, I have noticed that there is no state similar to ringback. Is there a way to determine if the status of the phone is \"ringback\"? From what I understand, a calling phone should have \"ringback\" status when the called phone has the status \"alerting\". Any help would be greatly appreciated.\u003c/p\u003e\n\n\u003cp\u003eBy the way, this is what I have so far. Not sure if it is right.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eint counter = 0;\n\nCallControlCall abc = (CallControlCall)provider.getAddress(phone).getConnections()[0].getCall();\n\nfor(Connection conn: abc.getConnections()){\n if(abc.getCallingAddress().equals(conn.getAddress()) \u0026amp;\u0026amp; conn.getState() == Connection.CONNECTED)\n counter++;\n if(abc.getCalledAddress().equals(conn.getAddress()) \u0026amp;\u0026amp; conn.getState() == Connection.ALERTING)\n counter++;\n }\nif(counter == 2)\n System.out.println(\"The state of the calling phone is ringback!\");\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"35171525","answer_count":"1","comment_count":"0","creation_date":"2016-02-02 18:06:10.74 UTC","last_activity_date":"2016-02-03 08:04:26.273 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4568145","post_type_id":"1","score":"0","tags":"java|telephony|cisco|jtapi|cisco-jtapi","view_count":"110"} +{"id":"13117030","title":"how to load gridview from javascript in jquery mobile","body":"\u003cp\u003eHi i'm a beginner in jquerymobile.\nIs there any possibility to load a gridview from javascript?\nin which i need to load gridview from javascript.\nmy html page is \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;body onload=\"loadGridView()\"\u0026gt;\n\u0026lt;fieldset class=\"ui-grid-b\" id=\"mygrid\"\u0026gt;\n\u0026lt;/filedset\u0026gt;\n\u0026lt;/body\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand the javascript function is \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction loadGridview()\n{\nvar img_grid=$(\"#mygrid\"); \n img_grid.append(' \u0026lt;div class=\"ui-block-a\"\u0026gt;\n \u0026lt;img alt=\"\" src=\"images.jpg\" style=\"width: 80px; height: 80px\" /\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"ui-block-b\"\u0026gt;\n \u0026lt;img alt=\"\" src=\"images.jpg\" style=\"width: 80px; height: 80px\" /\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"ui-block-c\"\u0026gt;\n \u0026lt;img alt=\"\" src=\"images.jpg\" style=\"width: 80px; height: 80px\" /\u0026gt;\n \u0026lt;/div\u0026gt;');\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAm i wrong or missing something?\nthanks in advance.\u003c/p\u003e","accepted_answer_id":"13125366","answer_count":"1","comment_count":"1","creation_date":"2012-10-29 06:46:08.44 UTC","last_activity_date":"2012-10-29 16:08:03.733 UTC","last_editor_display_name":"","owner_display_name":"user1305855","post_type_id":"1","score":"0","tags":"javascript|jquery-mobile|gridview","view_count":"696"} +{"id":"43878208","title":"Ionic 2 run android: Failed to load native library 'native-platform.dll' for Windows 10 amd64","body":"\u003cp\u003eI'm working with ionic 2, and I get this error message while running \n\u003ccode\u003eionic run android\u003c/code\u003e command.\n\u003ccode\u003e* What went wrong:\nFailed to load native library 'native-platform.dll' for Windows 10 amd64.\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eFull error message:\nUnzipping C:\\Users\\XXX.gradle\\wrapper\\dists\\gradle-2.14.1-all\\4cj8p00t3e5ni9e8iofg8ghv\nk7\\gradle-2.14.1-all.zip to C:\\Users\\XXX.gradle\\wrapper\\dists\\gradle-2.14.1-all\\4cj8p0\n0t3e5ni9e8iofg8ghvk7\u003c/p\u003e\n\n\u003cp\u003eFAILURE:\nBuild failed with an exception.\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003cp\u003eWhat went wrong:\nFailed to load native library 'native-platform.dll' for Windows 10 amd64.\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eTry:\nRun with --stacktrace option to get the stack trace. Run with --info or --debug option t\no get more log output.\u003c/p\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eError: cmd: Command failed with exit code 1 Error output:\nFAILURE: Build failed with an exception.\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003cp\u003eWhat went wrong:\nFailed to load native library 'native-platform.dll' for Windows 10 amd64.\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eTry:\nRun with --stacktrace option to get the stack trace. Run with --info or --debug option t\no get more log output.\u003c/p\u003e\u003c/li\u003e\n\u003c/ul\u003e","answer_count":"0","comment_count":"2","creation_date":"2017-05-09 19:19:43.75 UTC","last_activity_date":"2017-05-09 19:19:43.75 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7421822","post_type_id":"1","score":"0","tags":"ionic2|android-gradle","view_count":"66"} +{"id":"42274703","title":"How can I solve an incident regarding connecting a SQL Server instance in a nested virtual machine through a domain control server?","body":"\u003cp\u003eAs context, I have created a virtual machine with VMWare Workstation 9, installing Windows 2008 Enterprise Server R2. In this server, I created a domain control server DC.\nAfterwards, I installed Hyper-V Manager and created a nested virtual machine with Windows 2008 Server R2 Standard edition and SQL Server 2012 evaluation license, linked to DC server.\nI configure Firewall TCP port inbound rule to allow connection to port 1433 at DC server and SQL server. Besides, I configure network protocols at SQL Server configuration manager and restarted SQLServer services.\nI still cannot get to have the TCP port 1433 listening. I used netstat -an | find \"1433\" command in command line interface. However, I can ping DC and SQLServer virtual machines from host machine using ping command.\nWould you please advise what I could have missed or what should I do?\nThanks\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-02-16 12:59:09.38 UTC","last_activity_date":"2017-02-16 12:59:09.38 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7008664","post_type_id":"1","score":"0","tags":"tcp|sql-server-2012|port|windows-server-2008-r2","view_count":"12"} +{"id":"28053593","title":"Creating a getList method with a csv file as an input parameter","body":"\u003cp\u003eThe first assignment of my algorithms class is that I have to create a program that reads a series of book titles from a provided csv file, sorts them, and then prints them out. The assignment has very specific parameters, and one of them is that I have to create a static List getList(String file) method. The specifics of what this method entails are as follows:\u003c/p\u003e\n\n\u003cp\u003e\"The method getList should readin the data from the csv\nfile book.csv. If a line doesn’t follow the pattern\ntitle,author,year then a message should be written\nto the standard error stream (see sample output) The\nprogram should continue reading in the next line. NO\nexception should be thrown .\"\u003c/p\u003e\n\n\u003cp\u003eI don't have much experience with the usage of List, ArrayList, or reading in files, so as you can guess this is very difficult for me. Here's what I have so far for the method:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic static List\u0026lt;Book\u0026gt; getList(String file)\n{\n List\u0026lt;Book\u0026gt; list = new ArrayList\u0026lt;Book\u0026gt;();\n\n return list;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCurrently, my best guess is to make a for loop and instantiate a new Book object into the List using i as the index, but I wouldn't know how high to set the loop, as I don't have any method to tell the program how, say, many lines there are in the csv. I also wouldn't know how to get it to differentiate each book's title, author, and year in the csv.\u003c/p\u003e\n\n\u003cp\u003eSorry for the long-winded question. I'd appreciate any help. Thanks.\u003c/p\u003e","accepted_answer_id":"28053786","answer_count":"2","comment_count":"3","creation_date":"2015-01-20 19:26:34.18 UTC","last_activity_date":"2015-01-20 20:59:41.147 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4084357","post_type_id":"1","score":"1","tags":"java|list|csv","view_count":"1213"} +{"id":"39108551","title":"How to make SSO among SpringBoot apps running on same Tomcat under different context?","body":"\u003cp\u003eHow can one build/configure single authentication for apps built by SpringBoot and running under different contexts in Tomcat? It seems to me very common scenario, we have multiple apps that we maintain separately but they have to share the same login, so user can switch among them without authenticate to each one with the same credentials. Any idea how to make it done easily?\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2016-08-23 18:42:40.373 UTC","last_activity_date":"2016-08-23 18:42:40.373 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"324879","post_type_id":"1","score":"2","tags":"spring-security|spring-boot","view_count":"55"} +{"id":"28124719","title":"How to do chatacter matching in OpenCV","body":"\u003cp\u003eI am learning OpenCV. I am trying to develop a character matching application which will take an image from a camera and match it with a provided image template. So far I have tried \u003ccode\u003ematchShapes\u003c/code\u003e of contours which is not working correctly on characters, it's working fine for simple shapes. I tried using \u003ccode\u003ematchTemplate\u003c/code\u003e but that's also not working correctly if I change size, font or rotation of character written in image captured from camera and try matching it with template image.\u003c/p\u003e\n\n\u003cp\u003eI am now thinking I need to do feature extraction after segmenting the camera image in sets and compare these sets with a feature set of reference images. Can anyone please give me a starting off direction or suggestion. Thanks.\u003c/p\u003e\n\n\u003cp\u003eFor example, this is an image from camera\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/yEDDG.jpg\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eand I need to find a template image\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/OyaE5.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2015-01-24 10:55:13.143 UTC","last_activity_date":"2015-01-24 18:06:52.32 UTC","last_edit_date":"2015-01-24 16:08:54.377 UTC","last_editor_display_name":"","last_editor_user_id":"2283946","owner_display_name":"","owner_user_id":"827710","post_type_id":"1","score":"2","tags":"opencv|ocr|image-recognition","view_count":"502"} +{"id":"38947627","title":"imshow() giving error in Python for image","body":"\u003cpre\u003e\u003ccode\u003eimport cv2\nimport numpy as np\n\nimg=cv2.imread(\"drop.jpg\",cv2.IMREAD_GRAYSCALE)\n\ncv2.imshow(\"blue\", img)\ncv2.waitKey(0)\ncv2.destroyAllWindows()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe \u003ccode\u003eimshow\u003c/code\u003e function is giving error, the rest of the code is working fine.\u003c/p\u003e\n\n\u003cp\u003eError message:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eOpenCV Error: Assertion failed (size.width\u003e0 \u0026amp;\u0026amp; size.height\u003e0) in\n cv::imshow, file\n D:\\Build\\OpenCV\\opencv-3.1.0\\modules\\highgui\\src\\window.cpp, line 289\n Traceback (most recent call last): File \"C:\\Users\\D\\Desktop\\new \n 2.py\", line 6, in \n cv2.imshow(\"image\",img) cv2.error: D:\\Build\\OpenCV\\opencv-3.1.0\\modules\\highgui\\src\\window.cpp:289:\n error: (-215) size.width\u003e0 \u0026amp;\u0026amp; size.height\u003e0 in function cv::imshow\u003c/p\u003e\n\u003c/blockquote\u003e","answer_count":"4","comment_count":"3","creation_date":"2016-08-14 23:47:14.483 UTC","last_activity_date":"2017-09-24 10:55:35.687 UTC","last_edit_date":"2016-08-15 00:21:23.493 UTC","last_editor_display_name":"","last_editor_user_id":"5106637","owner_display_name":"","owner_user_id":"5106637","post_type_id":"1","score":"-1","tags":"python|opencv","view_count":"3427"} +{"id":"45415972","title":"Yii2 Trailing Slashes in URL is breaking the route","body":"\u003cp\u003eI configured UrlManager in a project and It was working the way I wanted. \nNow i tried to add a content whose name contains a trailing slash but i get an error 404 (Object not found).\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eFor example:\u003c/strong\u003e \nwww.test.com/article/detail/id_of_article/title_of_article\u003c/p\u003e\n\n\u003cp\u003etitle_of_article = \u003cstrong\u003ePeople are ...\u003c/strong\u003e =\u003e \u003cstrong\u003eWork\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003etitle_of_article = \u003cstrong\u003e1/3 of People are ...\u003c/strong\u003e =\u003e \u003cstrong\u003eDoesn't Work (Object not Found)\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eThe Trailing Slash is breaking the Url although it is encoded in \u003cstrong\u003e%2F\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eThis is how i create url: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eHtml::a(Html::encode($model-\u0026gt;title), \n ['article/detail', 'id' =\u0026gt; $model-\u0026gt;id, 'title' =\u0026gt; $model-\u0026gt;title])\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI don't really know how I can deal with that.\u003c/p\u003e","accepted_answer_id":"45416253","answer_count":"3","comment_count":"0","creation_date":"2017-07-31 12:28:49.297 UTC","last_activity_date":"2017-07-31 12:47:12.697 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4726857","post_type_id":"1","score":"0","tags":".htaccess|yii2|yii-url-manager","view_count":"99"} +{"id":"46022972","title":"How get Virtual Machine Network Speed from inside of the machine?","body":"\u003cp\u003eHow I can get Network speed capacity in Virtual Machine (Ubuntu) using command line?\u003cbr\u003e\nI am trying this line\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecat /sys/class/net/eth0/speed\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut the result is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e/$ cat /sys/class/net/eth0/speed\ncat: /sys/class/net/eth0/speed: Invalid argument\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI can't even open the \u003ccode\u003espeed\u003c/code\u003e file directly using notepad or any other application. is there any way to check the speed or parse \u003ccode\u003espeed file\u003c/code\u003e content?\u003cbr\u003e\u003cbr\u003e\np.s: I can use programming too. if there is any coding solutions, it will help too\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-09-03 11:28:00.49 UTC","last_activity_date":"2017-09-03 11:33:56.567 UTC","last_edit_date":"2017-09-03 11:33:56.567 UTC","last_editor_display_name":"","last_editor_user_id":"4991669","owner_display_name":"","owner_user_id":"4991669","post_type_id":"1","score":"0","tags":"shell|ubuntu|amazon-ec2|command|virtual-machine","view_count":"11"} +{"id":"37301173","title":"IE11 nested flexbox issue with parent table","body":"\u003cp\u003eWe have a scenario with nested flexbox and whose parent is a table. Although in chrome trhis behaves as expected, in IE-11 the flexboxes do not wrap.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://jsfiddle.net/arnabgh/qg5rojc9/3/\" rel=\"nofollow\"\u003ehttps://jsfiddle.net/arnabgh/qg5rojc9/3/\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eWe cannot make the table-layout:fixed. Is there any other better way to fix the same?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;table style=\"border:1px solid red;width:50%\";\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;\n \u0026lt;div class=\"layout flex\"\u0026gt;\n \u0026lt;div class=\"con flex\"\u0026gt;\n \u0026lt;label\u0026gt;First name\u0026lt;/label\u0026gt;\n \u0026lt;div class=\"field-item\"\u0026gt;\u0026lt;input /\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"con flex\"\u0026gt;\n \u0026lt;label\u0026gt;Last name\u0026lt;/label\u0026gt;\n \u0026lt;div class=\"field-item\"\u0026gt;\u0026lt;input /\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"con flex\"\u0026gt;\n \u0026lt;label\u0026gt;Address 1\u0026lt;/label\u0026gt;\n \u0026lt;div class=\"field-item\"\u0026gt;\u0026lt;input /\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"con flex\"\u0026gt;\n \u0026lt;label\u0026gt;Address 2\u0026lt;/label\u0026gt;\n \u0026lt;div class=\"field-item\"\u0026gt;\u0026lt;input /\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"con flex\"\u0026gt;\n \u0026lt;label\u0026gt;City\u0026lt;/label\u0026gt;\n \u0026lt;div class=\"field-item\"\u0026gt;\u0026lt;input /\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"con flex\"\u0026gt;\n \u0026lt;label\u0026gt;State\u0026lt;/label\u0026gt;\n \u0026lt;div class=\"field-item\"\u0026gt;\u0026lt;input /\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;/table\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe CSS is as folllows-\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e* {\n box-sizing: border-box;\n}\n\n\n\n.layout.flex {\n display: flex;\n flex-flow:row wrap;\n width:100%;\n}\n\n.con {\n width:auto;\n display: flex;\n flex-direction:column;\n\n}\n\nlabel {\n width: 120px;\n}\n\n.field-item {\n flex: 1;\n\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"1","creation_date":"2016-05-18 13:31:06.08 UTC","last_activity_date":"2016-05-18 19:24:54.45 UTC","last_edit_date":"2016-05-18 15:08:39.413 UTC","last_editor_display_name":"","last_editor_user_id":"3597276","owner_display_name":"","owner_user_id":"2626086","post_type_id":"1","score":"0","tags":"html|css|css3|flexbox|internet-explorer-11","view_count":"294"} +{"id":"23851178","title":"Posting score to facebook","body":"\u003cp\u003eI created an app in \u003ccode\u003eSpriteKit\u003c/code\u003e with xcode where when the game is over, it shows you your score, and I want to add the feature to post your score to facebook. Pretty much all my code is in \u003ccode\u003eMyScene.m\u003c/code\u003e where it can't access \u003ccode\u003epresentViewController\u003c/code\u003e. Only my ViewController.m file can access that, so I tried calling a instance method in Viewcontroller from Myscene.m but I can't find a way to do that. The only way I have found calling methods from other files is using \u003ccode\u003e+(void)\u003c/code\u003e which is a class method I think. \u003c/p\u003e\n\n\u003cp\u003eMyscene.m:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e if (location.x \u0026lt; 315 \u0026amp;\u0026amp; location.x \u0026gt; 261 \u0026amp;\u0026amp; location.y \u0026lt; 404 \u0026amp;\u0026amp; location.y \u0026gt; 361) {\n //if you click the post to facebook button (btw, location is a variable for where you tapped on the screen)\n\n [ViewController facebook];\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eViewController.m:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e+(void)facebook{\n\n if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) {\n SLComposeViewController *facebook = [[SLComposeViewController alloc] init];\n facebook = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];\n\n [facebook setInitialText:@\"initial text\"]; \n }\n\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo that worked, and it called the facebook class method correctly, but when I put \u003ccode\u003e[self presentViewController:facebook animated:YES]\u003c/code\u003e after the setInitialText brackets, it gives me this error: No known class method for selector 'presentViewController:animated:'\u003c/p\u003e\n\n\u003cp\u003eBy the way it lets me use \u003ccode\u003epresentViewController\u003c/code\u003e in a instance method but I can't call that method from inside the class method or from my Myscene file. Is there any way to either call an instance method from another file, or access \u003ccode\u003epresentViewController\u003c/code\u003e from a class method? Thanks \u003c/p\u003e","accepted_answer_id":"23856587","answer_count":"1","comment_count":"1","creation_date":"2014-05-25 01:20:48.793 UTC","favorite_count":"1","last_activity_date":"2014-05-25 14:57:14.23 UTC","last_edit_date":"2014-05-25 14:49:07.363 UTC","last_editor_display_name":"","last_editor_user_id":"791935","owner_display_name":"","owner_user_id":"3386154","post_type_id":"1","score":"3","tags":"facebook|sprite-kit|slcomposeviewcontroller","view_count":"938"} +{"id":"45720269","title":"HikariCP Address Specification and Documentation","body":"\u003cp\u003eSo, after searching Google and Github for answers, I'm left confounded as to how most people know how to use HikariCP. I can't seem to find any straight up documentation on HikariCP.\u003c/p\u003e\n\n\u003cp\u003eMy question is: how do I specify the host address without a JDBC URL? The \u003ca href=\"https://github.com/brettwooldridge/HikariCP#configuration-knobs-baby\" rel=\"nofollow noreferrer\"\u003emain page of HikariCP\u003c/a\u003e on Github clearly says that JDBC URL specification is optional and instead to simply use HikariConfig#setDataSourceClassName(String). However, I'm confused then as to how I would specify my address and I can't seem to find the answer anywhere. Like with SQLite, where do I specify the path to where the database file should go?\u003c/p\u003e\n\n\u003cp\u003eThis is the code I currently have:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efinal HikariConfig hikariConfig = new HikariConfig();\nhikariConfig.setPoolName(\"SQLite\");\nhikariConfig.setDataSourceClassName(\"org.sqlite.SQLiteDataSource\");\n\nHikariDataSource ds = new HikariDataSource(hikariConfig);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf I was to not use HikariCP I would simply specify the JDBC URL like such:\n\u003ccode\u003ejdbc:sqlite:path/to/database.db\u003c/code\u003e. However, how do you do this without using a JDBC URL?\u003c/p\u003e\n\n\u003cp\u003eThanks for any help.\u003c/p\u003e","accepted_answer_id":"45734275","answer_count":"1","comment_count":"4","creation_date":"2017-08-16 18:03:51.107 UTC","last_activity_date":"2017-08-17 20:43:17.24 UTC","last_edit_date":"2017-08-17 20:43:17.24 UTC","last_editor_display_name":"","last_editor_user_id":"8333995","owner_display_name":"","owner_user_id":"8333995","post_type_id":"1","score":"0","tags":"java|mysql|sqlite|jdbc|hikaricp","view_count":"52"} +{"id":"36358387","title":"Azure CDN management over API (Authentication issue)","body":"\u003cp\u003eSo basically I want to manage a CDN from an API. The only thing I'm stuck with is authentication. HOW DO I DO THAT? I found it for blob storage and various other services, but not for CDN's. Does anyone got an idea or could help me?\u003c/p\u003e","accepted_answer_id":"36359042","answer_count":"1","comment_count":"0","creation_date":"2016-04-01 14:04:23.777 UTC","last_activity_date":"2016-04-09 01:48:29.317 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5095829","post_type_id":"1","score":"0","tags":"azure|cdn|azure-cdn","view_count":"125"} +{"id":"1218425","title":"cannot get to fancybox to work at all","body":"\u003cp\u003ei feel i have done everything right but i cannot get lightbox to work at all. It is also coming up with the error that jQuery is not defined in the jQuery file.\nfile is \u003ca href=\"http://www.lotuswebdzine.com/lotusweb/portfolio.php\" rel=\"nofollow noreferrer\"\u003ehttp://www.lotuswebdzine.com/lotusweb/portfolio.php\u003c/a\u003e\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2009-08-02 08:24:55.067 UTC","last_activity_date":"2009-08-02 08:27:41.927 UTC","last_editor_display_name":"","owner_display_name":"kerri lotus","post_type_id":"1","score":"2","tags":"jquery|fancybox","view_count":"3102"} +{"id":"5314943","title":"ASP.NET Custom Profile Object Fails After Changing to MSBuild Deployment","body":"\u003cp\u003eWe have an ASP.NET 2.0 web forms app that used to be deployed via a web deployment project. Recently we deployed a new version built by TFS/MSBuild and the change seems to have caused a problem with the deserialization of a custom profile object.\u003c/p\u003e\n\n\u003cp\u003eHere is the entry in our profile/properties section in web.config.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;add name=\"MyKey\" type=\"OurApp.UserData\" serializeAs=\"Binary\" /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis did not change as a result of the build process, nor did OurApp.UserData change. \u003c/p\u003e\n\n\u003cp\u003eHowever, when the app attempts to read the data for a given user, nothing is found.\u003c/p\u003e\n\n\u003cp\u003eOne obvious difference is that in the web deployment version, a single OurApp.dll was created for the web site, whereas the new version is composed of multiple, \"name-mangled\" assemblies. Could that cause the profile to miss reading the properties stored in the OurApp.UserData type?\u003c/p\u003e","accepted_answer_id":"5731041","answer_count":"1","comment_count":"0","creation_date":"2011-03-15 16:41:32.857 UTC","last_activity_date":"2011-04-20 13:24:49.64 UTC","last_edit_date":"2011-03-15 16:47:19.98 UTC","last_editor_display_name":"","last_editor_user_id":"12260","owner_display_name":"","owner_user_id":"12260","post_type_id":"1","score":"0","tags":"asp.net|profile|asp.net-profiles|binary-serialization","view_count":"132"} +{"id":"46725165","title":"jquery length error when trying to find json file through Ajax within .Net core","body":"\u003cp\u003eI have been receiving this error within jquery:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eUnhandled exception at line 422, column 4 in http://localhost:59307/lib/jquery/dist/jquery.js\n0x800a138f - JavaScript runtime error: Unable to get property 'length' of undefined or null reference occurred\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is displayed within this jquery method:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003egrep: function( elems, callback, invert ) {\n var callbackInverse,\n matches = [],\n i = 0,\n length = elems.length,\n callbackExpect = !invert;\n\n // Go through the array, only saving the items\n // that pass the validator function\n for ( ; i \u0026lt; length; i++ ) {\n callbackInverse = !callback( elems[ i ], i );\n if ( callbackInverse !== callbackExpect ) {\n matches.push( elems[ i ] );\n }\n }\n\n return matches;\n},\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSpecifically the line:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elength = elems.length\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is being caused by this Ajax statement which is trying to find a json file that is within a json folder on wwwroot:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction GetBucklingData() {\n var returnData;\n $.ajax({\n url: \"/json/BucklingData.json\",\n async: false\n }).done(function (data) {\n returnData = JSON.parse(data);\n });\n\n return returnData;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is an example grep statement from within a function:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e var rods = $.grep(bucklingData, function (s) {\n return (s.Bore == boreValue);\n });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe statement is called like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar bucklingData = GetBucklingData();\nPopulateBoreDropdown(bucklingData);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt seems that ajax isnt able to find the json file. The code is working outside of .net with a simple html page and a standalone folder so the json file appears to be fine.\u003c/p\u003e\n\n\u003cp\u003eAny ideas?\u003c/p\u003e","answer_count":"1","comment_count":"6","creation_date":"2017-10-13 07:56:35.767 UTC","last_activity_date":"2017-10-13 08:37:26.12 UTC","last_edit_date":"2017-10-13 08:37:26.12 UTC","last_editor_display_name":"","last_editor_user_id":"4846276","owner_display_name":"","owner_user_id":"4846276","post_type_id":"1","score":"0","tags":"javascript|jquery|.net|ajax","view_count":"42"} +{"id":"14505673","title":"SQL Query with binary data (PHP and MySQL)","body":"\u003cp\u003eThis site had helped me a lot in the past, but now I am lost. Thanks in advance for your guidance.\u003c/p\u003e\n\n\u003cp\u003eI have a MySQL table that contains a Binary value, like the example below. I cannot change the table. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCREATE TABLE `test` (\n `id` int(10) unsigned NOT NULL AUTO_INCREMENT,\n `nid` binary(16) NOT NULL,\n `test` varchar(45) DEFAULT NULL,\nPRIMARY KEY (`id`))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis an example value of nid: \u003ccode\u003eÞFÈ\u0026gt;ZPÎ×jRZ{æ×\u003c/code\u003e (not all showing, but all 16 are there)\u003c/p\u003e\n\n\u003cp\u003eNow I want to create a SQL Query to look for the id of the row where this value is true.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT id FROM test WHERE nid = 'ÞFÈ\u0026gt;ZPÎ×jRZ{æ×';\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e... does not work. Any idea? \u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eSOLUTION\u003c/strong\u003e\nObtaining the nid in HEX format did the trick. It results in DE46C83E5A50CED70E6A525A7BE6D709 and when I use this in the query like this ...\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT id FROM test WHERE HEX(nid) = 'DE46C83E5A50CED70E6A525A7BE6D709';\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am getting the right result.\u003c/p\u003e","accepted_answer_id":"14505773","answer_count":"3","comment_count":"3","creation_date":"2013-01-24 16:07:33.08 UTC","favorite_count":"1","last_activity_date":"2016-02-24 19:23:17.243 UTC","last_edit_date":"2013-03-19 12:55:13.063 UTC","last_editor_display_name":"","last_editor_user_id":"58074","owner_display_name":"","owner_user_id":"2007877","post_type_id":"1","score":"10","tags":"php|mysql|binary-data","view_count":"14143"} +{"id":"10215432","title":"Dynamica string count in NSMutableArray in NSMutableDictionary","body":"\u003cp\u003eI am familiar with getting a string count from a known array\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e int numberOfWords = [self.wordArray count]; \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut I have an unknown number of strings in an unknown number of arrays, all referenced by a dictionary. This works - good.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e NSMutableDictionary *eqClasses = [[NSMutableDictionary alloc] init];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe arrays and strings are added at runtime (with help of this board):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e NSMutableArray* array = [eqClasses objectForKey:wordPattern];\n if(!array) {\n // create new array and add to dictionary if wordPattern not found\n array = [NSMutableArray array];\n [eqClasses setObject:array forKey:wordPattern];\n }\n [array addObject:tempWordStr];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow I need to iterate through the dictionary and get the array with the largest word count. Is there a way to scroll through all the arrays in the dictionary without using a key (I won't know all the word patterns as they are generated dynamically), AND once I find the array with the most words, get that array/value and key/wordpattern?\u003c/p\u003e","accepted_answer_id":"10215550","answer_count":"3","comment_count":"0","creation_date":"2012-04-18 18:15:14.573 UTC","last_activity_date":"2012-04-18 19:10:27.417 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1278974","post_type_id":"1","score":"0","tags":"ios|nsmutabledictionary|nsmutablestring","view_count":"566"} +{"id":"7344744","title":"Haskell program built on Ubuntu 11.10 doesn't run on Ubuntu 10.04","body":"\u003cp\u003eI'm trying to provide the users of my program with some Linux binaries in addition to the current Windows ones, so I installed Ubuntu 11.10 (since the haskell-platform package on 11.04 is still the 2010 version). When I try to run the resulting binary on Ubuntu 10.04, however, I get the message that it cannot find libgmp.so.10. Checking /usr/lib reveals that 10.04 comes with libgmp.so.3 whereas 11.10 has libgmp.so.10. It would appear therefore that GHC is linking to libgmp dynamically rather than statically, which I thought was the default.\u003c/p\u003e\n\n\u003cp\u003eIs there any way to tell GHC to statically include libgmp in the binary? If not, is there some other solution that does not require the user to install a different version of libgmp?\u003c/p\u003e","accepted_answer_id":"7355348","answer_count":"3","comment_count":"2","creation_date":"2011-09-08 07:44:49.267 UTC","last_activity_date":"2011-09-09 07:37:26.873 UTC","last_edit_date":"2011-09-08 22:41:26.797 UTC","last_editor_display_name":"","last_editor_user_id":"188501","owner_display_name":"","owner_user_id":"188501","post_type_id":"1","score":"4","tags":"linux|haskell|ubuntu|ghc|static-linking","view_count":"1307"} +{"id":"18714615","title":"Cucumber Test Cannot find field when its there","body":"\u003cp\u003eWhile I was writing cucumber test code,\nI get:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eUnable to find field \"username\" (Capybara::ElementNotFound)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut I have the following on the page itself.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;%= f.text_field :username, :placeholder =\u0026gt; \"Username\" %\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI've checked that it lands on the correct page using\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esave_and_open_page\nfill_in \"username\", :with =\u0026gt; \"TESTUSER\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eisn't the tag :username? What am I supposed to write instead?\u003c/p\u003e","accepted_answer_id":"18716520","answer_count":"1","comment_count":"6","creation_date":"2013-09-10 08:59:01.877 UTC","last_activity_date":"2013-09-10 10:29:42.493 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1634454","post_type_id":"1","score":"0","tags":"ruby-on-rails|cucumber|capybara|erb","view_count":"1014"} +{"id":"19308898","title":"Python: Deleteting Dictionary Entries after a certain time","body":"\u003cp\u003eI am runnning a code and saving entries in a dictionary. \nHOw can I hold on to this dictionary for 1 min, after which I want to delete its entries, except for those that are 10 sec old?\u003c/p\u003e\n\n\u003cp\u003eI am running a certain function in a loop, and I want to save some data generated in that function for analysis in another function later on.\u003c/p\u003e\n\n\u003cp\u003eTime calculation: How can I measure one min ?\u003c/p\u003e\n\n\u003cp\u003eThere's the following, \u003ca href=\"https://stackoverflow.com/questions/7370801/measure-time-elapsed-in-python\"\u003eMeasure time elapsed in Python?\u003c/a\u003e\n But that I think wont work with the following code structure.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport time \ndict={}\ndef function_run_in_main():\n global dict\n dict[key]=value\n # check time here and delete\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"2","creation_date":"2013-10-11 01:34:41.84 UTC","last_activity_date":"2013-10-11 01:58:50.213 UTC","last_edit_date":"2017-05-23 11:57:20.053 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"1890093","post_type_id":"1","score":"1","tags":"python|time|dictionary","view_count":"64"} +{"id":"18158629","title":"What is the point of using absolute positioning in CSS?","body":"\u003cp\u003e\u003ca href=\"http://www.w3schools.com/css/css_positioning.asp\" rel=\"nofollow\"\u003eThis link says\u003c/a\u003e\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eAn absolute position element is positioned relative to the first\n parent element that has a position other than static. If no such\n element is found, the containing block is \u003ccode\u003e\u0026lt;html\u0026gt;\u003c/code\u003e\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eSo absolute is in fact relative. So why not just use relative instead? Are there any practical use cases which can only be done by using absolute positioning but not relative?\u003c/p\u003e","answer_count":"2","comment_count":"7","creation_date":"2013-08-10 04:30:05.95 UTC","last_activity_date":"2013-08-10 05:04:48 UTC","last_edit_date":"2013-08-10 04:34:39.193 UTC","last_editor_display_name":"","last_editor_user_id":"23897","owner_display_name":"","owner_user_id":"365256","post_type_id":"1","score":"-4","tags":"html|css","view_count":"347"} +{"id":"41564019","title":"React Native: onLayout triggered multiple times on orientation","body":"\u003cp\u003eMy app structure has parent container view \u003e 2 Sub views.\nThe app orientation is triggered multiple times on first render and on orientation change.\nWhat could be the problem? onLayout is attached to the parent container view\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-01-10 08:10:01.38 UTC","last_activity_date":"2017-01-10 08:10:01.38 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1114559","post_type_id":"1","score":"1","tags":"javascript|android|ios|reactjs|react-native","view_count":"156"} +{"id":"42954951","title":"C# int to String ... output in Textbox","body":"\u003cp\u003eI'm new to C#\nand I was trying to code a small addition only calculator.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e int z = 0; //Meine Zahl\n // string b = 0; // Mein String\n\n public Form1()\n {\n InitializeComponent();\n }\n\n private void button1_Click(object sender, EventArgs e)\n {\n int a = z + 1;\n textBox1.Text = a;\n }\n\n private void button2_Click(object sender, EventArgs e)\n {\n textBox1.Text = \"2\";\n }\n...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003emy question is how do I fix it?\u003c/p\u003e","answer_count":"2","comment_count":"3","creation_date":"2017-03-22 14:44:22.487 UTC","favorite_count":"0","last_activity_date":"2017-03-22 14:54:45.567 UTC","last_edit_date":"2017-03-22 14:54:45.567 UTC","last_editor_display_name":"","last_editor_user_id":"7752002","owner_display_name":"","owner_user_id":"7752002","post_type_id":"1","score":"1","tags":"c#|string|int|calculator","view_count":"64"} +{"id":"3589342","title":"change domain.com/folder/stuff to domain.com/stuff using mod_rewrite","body":"\u003cp\u003eI would like to 301 redirect\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edomain.com/folder/blah_blah\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eto\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edomain.com/blah_blah\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow can I do this using mod_rewrite?\u003c/p\u003e","answer_count":"3","comment_count":"0","creation_date":"2010-08-28 03:22:31.157 UTC","last_activity_date":"2011-05-07 08:54:32.873 UTC","last_edit_date":"2011-05-07 08:54:32.873 UTC","last_editor_display_name":"","last_editor_user_id":"2961","owner_display_name":"","owner_user_id":"433505","post_type_id":"1","score":"1","tags":".htaccess|mod-rewrite","view_count":"164"} +{"id":"28056692","title":"Entity framework 6 many to many code first eager loading gives recursive result","body":"\u003cp\u003eI'm trying to learn Entity Framework 6 code first using VS 2013.\u003c/p\u003e\n\n\u003cp\u003eI'm doing the exact same thing as in this question: \u003ca href=\"https://stackoverflow.com/questions/5851169/how-to-eagerly-load-a-many-to-many-relationship-with-the-entity-framework-code-f\"\u003eHow to eagerly load a many to many relationship with the entity framework code first?\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eUsing the same setup\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class Student\n{\n public int Id {get;set}\n public string FullName {get;set;}\n public virtual ICollection\u0026lt;Course\u0026gt; Courses {get;set;}\n}\n\npublic class Course\n{\n public int Id {get;set;}\n public string FullName {get;set;}\n public virtual ICollection\u0026lt;Student\u0026gt; Students {get;set;}\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd the answer\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar allStudents = context.Students.Include( s =\u0026gt; s.Courses);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut when debugging I get a recursive result.\nEvery Student contains a list of Courses and those Courses contains a list of Students, which contains Courses, that contains Students and so on....\u003c/p\u003e\n\n\u003cp\u003eThe same thing without using the method \u003ccode\u003e.Include(...\u003c/code\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar allStudents = context.Students;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm using this in a scaffolded MVC 5 ApiController which throws:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eSystem.Runtime.Serialization.SerializationException\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eRemoving \u003ccode\u003eVirtual\u003c/code\u003e from the Models and still using \u003ccode\u003e.Include(...\u003c/code\u003e throws:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eObject graph for type 'SchoolEF.Models.Course' contains cycles\n and cannot be serialized if reference tracking is disabled.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI guess i have not fully understood how to do eager loading and how to use the .Include() method.\u003c/p\u003e","accepted_answer_id":"28056989","answer_count":"2","comment_count":"0","creation_date":"2015-01-20 22:55:37.503 UTC","last_activity_date":"2015-01-20 23:42:38.413 UTC","last_edit_date":"2017-05-23 12:12:49.547 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"1842358","post_type_id":"1","score":"0","tags":"c#|entity-framework|ef-code-first|eager-loading","view_count":"884"} +{"id":"9217305","title":"Single Animation - Multiple Views","body":"\u003cp\u003eIs there any way to animate multiple views at the same time?\u003c/p\u003e\n\n\u003cp\u003eWhat I want to do is translate animations:\u003c/p\u003e\n\n\u003cp\u003eI have 5 TextViews and 4 coloured strips (plain RelativeLayouts with a background). At the start of the animations, the stips are stacked with the TextViews in a horizontal row. At the end I want all the TextViews stacked between the strips:\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/u0A4Y.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eThis is a very simple drawing, but it demonstrates what I want to do. Is there any way of doing this with animations, or do I have to use canvas animations.\u003c/p\u003e","accepted_answer_id":"9217652","answer_count":"3","comment_count":"0","creation_date":"2012-02-09 19:21:10.027 UTC","favorite_count":"3","last_activity_date":"2016-10-13 14:07:06.807 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1117914","post_type_id":"1","score":"15","tags":"android|animation|views","view_count":"20912"} +{"id":"45739825","title":"In Quartz.net, how can I delay all scheduled jobs by a certain time span?","body":"\u003cp\u003eI am using Quartz.net to schedule various API calls.\nThe API I am using restricts the number of requests that can be made per time period and if that is exceeded, then my account is penalized for the next minute (no requests can be made).\u003c/p\u003e\n\n\u003cp\u003eIf I ever receive a notification that I have made too many requests and my account will be throttled for the next minute, I will need to ensure that no scheduled jobs fire during that period. How can I best delay firing of all scheduled jobs by a minute or two?\u003c/p\u003e\n\n\u003cp\u003eI was originally intending to call Scheduler.GetTriggerKeys() and loop over and update every existing trigger like so:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eforeach(var triggerKey in SchedInstance.GetTriggerKeys(GroupMatcher\u0026lt;TriggerKey\u0026gt;.AnyGroup()))\n{\n var oldTrigger = SchedInstance.GetTrigger(triggerKey);\n TriggerBuilder tb = oldTrigger.GetTriggerBuilder();\n // Update the schedule associated with the builder and build the new trigger\n tb.StartAt(oldTrigger.StartTimeUtc.AddSeconds(63));\n var newTrigger = tb.Build();\n SchedInstance.RescheduleJob(oldTrigger.Key, newTrigger);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs this the right approach or would it be better to simply stop the scheduler for the same time period and then restart it?\u003c/p\u003e","accepted_answer_id":"45813648","answer_count":"1","comment_count":"2","creation_date":"2017-08-17 15:54:35.943 UTC","last_activity_date":"2017-08-22 11:16:12.517 UTC","last_edit_date":"2017-08-22 10:14:57.497 UTC","last_editor_display_name":"","last_editor_user_id":"6666799","owner_display_name":"","owner_user_id":"4424504","post_type_id":"1","score":"1","tags":"c#|quartz.net|quartz.net-2.0","view_count":"80"} +{"id":"1726888","title":"mod re-write OS X 10.6","body":"\u003cp\u003eI have OS X 10.6 and am working on a website. When I look at the http.conf file in /private/etc/apache2/httpd.conf\u003c/p\u003e\n\n\u003cp\u003eit appears that the mod-rewrite module is loaded yet when I add a simple .htaccess file to the root of my site, it doesn't seem to do anything:\u003c/p\u003e\n\n\u003cp\u003eOptions +FollowSymLinks RewriteEngine on RewriteCond $1 !^(index.php|index.html|static|admin_static|admin2_static|images|css|js|robots.txt) RewriteRule ^(.*)$ /index.php?/$1 [L]\u003c/p\u003e\n\n\u003cp\u003eHow can I ensure mod-re-write is working?\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2009-11-13 03:09:08.207 UTC","last_activity_date":"2009-12-22 20:45:03.513 UTC","last_edit_date":"2009-12-22 20:45:03.513 UTC","last_editor_display_name":"","last_editor_user_id":"19750","owner_display_name":"","owner_user_id":"210149","post_type_id":"1","score":"0","tags":"apache|osx|mod-rewrite","view_count":"263"} +{"id":"46880707","title":"Mongoose stops to $push to array if the field already exists in a document","body":"\u003cp\u003eI am using Node and Mongoose, and trying to set an array of \u003ccode\u003eISODate\u003c/code\u003e elements:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \"visitLog\" : [\n ISODate(\"2017-10-22T22:43:49.571Z\"),\n ISODate(\"2017-10-22T22:44:39.572Z\"),\n ISODate(\"2017-10-22T23:35:36.111Z\"),\n ISODate(\"2017-10-22T23:48:26.516Z\"),\n ISODate(\"2017-10-22T23:50:33.378Z\"),\n ISODate(\"2017-10-22T23:53:56.227Z\"),\n ISODate(\"2017-10-22T23:57:20.986Z\")\n ]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo I had an existing schema where \u003ccode\u003evisitLog\u003c/code\u003e field did not existed, added new field to a schema - \u003ccode\u003evisitLog: [ {type: Date, default: '' }],\u003c/code\u003eand it worked - the result is what you see above.\nBut when I created a new document with updated schema that already has an empty array in it - \u003ccode\u003e\"visitLog\" : [ ]\u003c/code\u003e , \u003ccode\u003e$push\u003c/code\u003e just stopped working.\u003c/p\u003e\n\n\u003cp\u003eHere is mongoose query, if needed:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e // conditions is a ternary operator that checks whether req.body username\n // is an email or not, and puts needed condition to a query\n var conditions = (!/^[a-zA-Z0-9\\-\\_\\.\\+]+@[a-zA-Z0-9\\-\\_\\.]+\\.[a-zA-Z0-9\\-\\_]+$/.test(req.body.username)) ? ' {email: req.body.username } ' : ' {username: req.body.username } ';\n var fieldsToSet = {\n $push: {\n visitLog: new Date().toISOString(),\n }\n };\n var options = { upsert: true }; \n User.findOneAndUpdate(conditions, fieldsToSet, options, function(err, user) { ... \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe working document was created in mongo console, while the second was generated on a server, but I can't how can this make any difference.\nUsing \u003ccode\u003e$push\u003c/code\u003e shuld work with empty arrays. Can someone explain what's wrong here?\u003c/p\u003e\n\n\u003cp\u003eThank you.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdit\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eIt figures that using \u003ccode\u003efindByIdAndUpdate\u003c/code\u003e without \u003ccode\u003econditions\u003c/code\u003e works for both documents:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar fieldsToSet = {\n $push: {\n visitLog: new Date().toISOString(),\n }\n};\nvar options = { new: true };\nreq.app.db.models.User\n.findByIdAndUpdate(req.user.id, fieldsToSet, options, function(err, user) {\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"3","creation_date":"2017-10-23 01:13:16.237 UTC","last_activity_date":"2017-10-23 11:35:45.033 UTC","last_edit_date":"2017-10-23 11:35:45.033 UTC","last_editor_display_name":"","last_editor_user_id":"7134027","owner_display_name":"","owner_user_id":"7134027","post_type_id":"1","score":"0","tags":"arrays|node.js|datetime|mongoose","view_count":"34"} +{"id":"31911594","title":"Merge String with a date in excel 2003","body":"\u003cp\u003eHow to merge a string with a date in \u003cem\u003eexcel 2003\u003c/em\u003e, =A1\u0026amp;\" \"\u0026amp;TEXT(B1,\"m/dd/yyyy\") not working in 2003 but working in 2007. Asuming \"A1\" As a string and \"B1\" as a date\"\u003c/p\u003e","accepted_answer_id":"31917018","answer_count":"1","comment_count":"4","creation_date":"2015-08-10 04:21:54.133 UTC","last_activity_date":"2015-08-10 10:17:57.76 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1360444","post_type_id":"1","score":"0","tags":"excel","view_count":"24"} +{"id":"40415864","title":"Sending variable sized packets over the network using TCP/IP","body":"\u003cp\u003eI want to send variable sized packets between 2 linux OSes over an internal network. The packet is variable sized and its length and CRC are indicated in the header which is also sent along with the packet. Something roughly like-\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003estruct hdr {\n uint32 crc;\n uint32 dataSize;\n void *data;\n};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm using CRC at the application layer to overcome the inherent \u003ca href=\"https://stackoverflow.com/questions/3830206/can-a-tcp-checksum-produce-a-false-positive-if-yes-how-is-this-dealt-with\"\u003elimitation of TCP checksums\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThe problem I have is, there is a chance that the \u003ccode\u003edataSize\u003c/code\u003e field itself is corrupted, in which case, I dont know where the next packet starts? Cos at the reciver, when I read the socket buffer, I read \u003ccode\u003en\u003c/code\u003e such packets next to one another. So \u003ccode\u003edataSize\u003c/code\u003e is the only way I can get to the next packet correctly. \u003c/p\u003e\n\n\u003cp\u003eSome ideas I have is to-\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eRestart the connection if a CRC mismatch occurs.\u003c/li\u003e\n\u003cli\u003eAggregate \u003ccode\u003eX\u003c/code\u003e such packets into one big packet of fixed size and discard the big packet if any CRC error is detected. The big packet is to make sure we lose \u0026lt;= sizeof of one packet in case of errors\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eAny other ideas for these variable sized packets? \u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2016-11-04 05:30:21.297 UTC","last_activity_date":"2016-11-04 09:39:02.047 UTC","last_edit_date":"2017-05-23 12:16:40.643 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"457237","post_type_id":"1","score":"1","tags":"c|linux|sockets|networking|tcp","view_count":"71"} +{"id":"21354299","title":"Dispatcher.BeginInvoke Skips loading UI controls in Prism","body":"\u003cp\u003eI have a WPF application developed with Prism. I am facing a typical scenario for a code change I implemented for performance improvement. \u003c/p\u003e\n\n\u003cp\u003eI have a UI Grid which shows a list of entities. I select some 10 entities in the Grid and try to open it, which inturn should open a new window and load the corresponding 10 entities by resolving corresponding containers and their dependencies.\u003c/p\u003e\n\n\u003cp\u003eThe sample code is below,,, I have commented the operations that are occuring..\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate void OpenSelectedEntities(List\u0026lt;Entity\u0026gt; entities)\n {\n foreach (Entity entity in entities)\n {\n if (Application.Current != null)\n {\n //I implemented opening entity in async so that 10 entities will be opened without stalling the UI.\n Dispatcher.BeginInvoke(DispatcherPriority.Background,\n new Action(() =\u0026gt;\n {\n OpenEntity(entity, false);\n }));\n }\n }\n }\n\n\n public void OpenEntity(Entity entity, boolean val)\n {\n //Creating Container to load the controls.\n\n //Adding Container to Region\n\n //Loading the other UI related and triggering operation threads\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe problem I am facing is, When I select some entities and verify it in my local development environment, I am able to see all the 10 entities opened and working well. However, When I deploy the code in Server and test it there,, Only two entities were opened, the first entity and last entity in the selected entities.. I am completely clueless what is causing this problem. I have cross checked twice, I am getting this problem while calling OpenEntity as Asynchronous.\u003c/p\u003e\n\n\u003cp\u003eHas anyone encountered situation like this using WPF and Prism.\u003c/p\u003e","accepted_answer_id":"21388720","answer_count":"1","comment_count":"2","creation_date":"2014-01-25 18:11:41.237 UTC","last_activity_date":"2014-01-27 18:29:26.657 UTC","last_edit_date":"2014-01-27 03:40:52.39 UTC","last_editor_display_name":"","last_editor_user_id":"2652454","owner_display_name":"","owner_user_id":"2652454","post_type_id":"1","score":"0","tags":"wpf|c#-4.0|asynchronous|prism|dispatcher","view_count":"366"} +{"id":"25381731","title":"Automatic Login Via Devise after Password Change","body":"\u003cp\u003eWhen i change the password in my app via devise, the user gets logged out.\nIs there a quick way so that the same user will get signed in and redirected to some path in devise without doing anything in view.\u003c/p\u003e","accepted_answer_id":"25382240","answer_count":"1","comment_count":"0","creation_date":"2014-08-19 11:01:13.08 UTC","favorite_count":"2","last_activity_date":"2014-08-19 11:27:38.997 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2400445","post_type_id":"1","score":"2","tags":"ruby-on-rails|ruby|ruby-on-rails-4","view_count":"759"} +{"id":"12013519","title":"How to set default category in Movable Type","body":"\u003cp\u003eIs there a way to set the default category for each entry in Movable Type. I am using Movable Type version 5.12\u003c/p\u003e\n\n\u003cp\u003eI could not find any method for it. Is there any way or a plugin to do this?\u003c/p\u003e","accepted_answer_id":"12014914","answer_count":"2","comment_count":"0","creation_date":"2012-08-17 21:38:26.12 UTC","last_activity_date":"2013-02-14 20:56:17.597 UTC","last_edit_date":"2012-08-20 21:17:36.807 UTC","last_editor_display_name":"","last_editor_user_id":"347220","owner_display_name":"","owner_user_id":"387247","post_type_id":"1","score":"2","tags":"movabletype","view_count":"92"} +{"id":"13568332","title":"how can I print this in MVC 4.0 View Pages","body":"\u003cp\u003eI have a class student:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public class Student\n {\n public int StudentId{get;set;}\n public string StudentName{get;set;}\n public int Age{get;set;}\n public List\u0026lt;Course\u0026gt; Courses{get;set;}\n public List\u0026lt;string\u0026gt; MobileNumbers{get;set;}\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd the Course class is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public class Course\n {\n public int CourseId {get;set;}\n public string CourseName {get;set;}\n public List\u0026lt;Staff\u0026gt; Staff {get;set;}\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe Staff class has the following structure:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public class Staff\n {\n public int StaffId {get;set;}\n public string StaffName {get;set;}\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have put the data in the ViewBag , but I am not able figuring it out how should I use foreach statement to print all those records in the following View.\nView:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;table class=\"tableStyle\" width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"\u0026gt;\n\n \u0026lt;thead\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;th\u0026gt;Student Name\u0026lt;/th\u0026gt;\n \u0026lt;th\u0026gt;Courses\u0026lt;/th\u0026gt;\n \u0026lt;th\u0026gt;Staffs\u0026lt;/th\u0026gt;\n \u0026lt;th\u0026gt;Mobile Numbers\u0026lt;/th\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;/thead\u0026gt;\n\n @foreach (Student stud in ViewBag.students)\n { \n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;@stud.StudentName\u0026lt;/td\u0026gt;\n foreach(Course course in ViewBag.courses)\n { \n \u0026lt;td\u0026gt;@course.CourseName\u0026lt;/td\u0026gt;\n\n }\n foreach(Staff staff in ViewBag.staff)\n {\n \u0026lt;td\u0026gt;@staff.StaffName\u0026lt;/td\u0026gt;\n }\n\n \u0026lt;/tr\u0026gt;\n }\n \u0026lt;/table\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut, this prints courses taken by all the students for the single student as they are in the first foreach loop. Please , suggest me a way to do this...!!\u003c/p\u003e","accepted_answer_id":"13568669","answer_count":"1","comment_count":"2","creation_date":"2012-11-26 15:51:18.997 UTC","last_activity_date":"2012-11-26 16:22:15.073 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1844389","post_type_id":"1","score":"0","tags":"c#|asp.net-mvc-4","view_count":"256"} +{"id":"46384381","title":"Java: Could I have the control of the BufferedWriter?","body":"\u003cp\u003eCould I take the control of the buffer (BufferedWriter) to send the data before it is full?\u003c/p\u003e\n\n\u003cp\u003eedit: The scenario is that. We put String like \"Luck\" together with other Strings into the buffer (BufferedWriter), then onto a FileWriter. Well, the BufferWriter holds all the data until is full. \u003c/p\u003e","accepted_answer_id":"46384436","answer_count":"1","comment_count":"4","creation_date":"2017-09-23 21:20:02.227 UTC","last_activity_date":"2017-09-23 22:01:09.51 UTC","last_edit_date":"2017-09-23 22:01:09.51 UTC","last_editor_display_name":"","last_editor_user_id":"8658199","owner_display_name":"","owner_user_id":"8658199","post_type_id":"1","score":"-1","tags":"java|class|buffer","view_count":"19"} +{"id":"7770304","title":"Optimize PDF Word Search","body":"\u003cp\u003eI have an application that iterates over a directory of pdf files and searches for a string. I am using PDFBox to extract the text from the PDF and the code is pretty straightforward. At first to search through 13 files it was taking a minute in a half to load the results but I noticed that PDFBox was putting a lot of stuff in the log file file. I changed the logging level and that helped alot but it is still taking over 30 seconds to load a page. Does anybody have any suggestions on how I can optimize the code or another way to determine how many hits are in a document? I played around with Lucene but it seems to only give you the number of hits in a directory not number of hits in a particular file. \u003c/p\u003e\n\n\u003cp\u003eHere is my code to get the text out of a PDF. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic static String parsePDF (String filename) throws IOException \n {\n\n FileInputStream fi = new FileInputStream(new File(filename)); \n\n PDFParser parser = new PDFParser(fi); \n parser.parse(); \n COSDocument cd = parser.getDocument(); \n PDFTextStripper stripper = new PDFTextStripper(); \n String pdfText = stripper.getText(new PDDocument(cd)); \n\n cd.close();\n\n return pdfText;\n }\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2011-10-14 15:58:23.31 UTC","favorite_count":"1","last_activity_date":"2011-10-14 20:08:29.447 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"984701","post_type_id":"1","score":"0","tags":"java|pdf|lucene","view_count":"954"} +{"id":"14113884","title":"Protect C++ program against decompiling","body":"\u003cblockquote\u003e\n \u003cp\u003e\u003cstrong\u003ePossible Duplicate:\u003c/strong\u003e\u003cbr\u003e\n \u003ca href=\"https://stackoverflow.com/questions/11156104/is-it-possible-to-decompile-c-builder-exe-is-c-builder-exe-safe\"\u003eIs it possible to decompile C++ Builder exe? Is C++ Builder exe safe?\u003c/a\u003e \u003c/p\u003e\n\u003c/blockquote\u003e\n\n\n\n\u003cp\u003eI use Microsoft Visual C++ 2010 Express to write my programs. When i want to distribute my program I compile it with 'Release' configuration and also I set the linker to not add debug information. So my question is, Is my executable safe or anyone can decompile it and see the source code? If it is unsafe, how can I prevent it from being decompiled?\u003c/p\u003e","accepted_answer_id":"14113903","answer_count":"4","comment_count":"4","creation_date":"2013-01-01 20:20:19.967 UTC","favorite_count":"1","last_activity_date":"2015-08-18 12:05:14.57 UTC","last_edit_date":"2017-05-23 12:15:51.85 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"1938503","post_type_id":"1","score":"3","tags":"c++|windows|obfuscation|decompiling|source-code-protection","view_count":"2138"} +{"id":"22842148","title":"Filtering MS Access subform with vba","body":"\u003cp\u003eI have a quick question. I've developed a booking system that has a sub form containing all the rooms booked on the date displayed (in main form). I've added a combo box to allow users to filter the rooms to only see the ones they select from combo box (re-query the sub-form and then filter).\u003c/p\u003e\n\n\u003cp\u003eThis works fine apart from the fact my code would sometimes loop through the filtering sub for no apparent reason after reaching the end of the sub?. It displays everything correctly, so this I'm not bothered about (unless it's connected to the real problem).\u003c/p\u003e\n\n\u003cp\u003eThe real problem I'm having however is when I choose a room that has no bookings for the date displayed. The filter works fine (empty display), but when I then try to choose another room from the combo box the re-query function behind the after update of the combo box does not work!\u003c/p\u003e\n\n\u003cp\u003eHas anyone else experienced this before?\u003c/p\u003e\n\n\u003cp\u003eThe workflow:\u003c/p\u003e\n\n\u003cp\u003eCombo box triggers 'after update' event. This re-queries the sub-form, where behind the 'on current' event the filtering of the sub-form happens.\u003c/p\u003e\n\n\u003cp\u003eWhen sub-form is empty I'm unable to perform any further sub-form re-queries.\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2014-04-03 15:24:35.113 UTC","last_activity_date":"2014-04-03 21:47:14.5 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1887979","post_type_id":"1","score":"0","tags":"ms-access|filter|subform","view_count":"782"} +{"id":"46250979","title":"Why does a 3D point appear to be behind the camera?","body":"\u003cp\u003eI wrote a simple script to project 3D points into an image bases on the camera intrinsics and extrintics. But when I have a camera at the origin pointing down the z-axis and a 3D points further down the z-axis it appears to be behind the camera instead of in front of it. Here's my script, I've checked it so many times. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport numpy as np\n\ndef project(point, P):\n Hp = P.dot(point)\n\n if Hp[-1] \u0026lt; 0:\n print 'Point is behind camera'\n\n Hp = Hp / Hp[-1]\n print Hp[0][0], 'x', Hp[1][0]\n return Hp[0][0], Hp[1][0]\n\nif __name__ == '__main__':\n\n # Rc and C are the camera orientation and location in world coordinates\n # Camera posed at origin pointed down the negative z-axis\n Rc = np.eye(3)\n C = np.array([0, 0, 0])\n\n # Camera extrinsics\n R = Rc.T\n t = -R.dot(C).reshape(3, 1)\n\n # The camera projection matrix is then:\n # P = K [ R | t] which projects 3D world points \n # to 2D homogenous image coordinates.\n\n # Example intrinsics dont really matter ...\n\n K = np.array([\n [2000, 0, 2000],\n [0, 2000, 1500],\n [0, 0, 1],\n ])\n\n\n # Sample point in front of camera\n # i.e. further down the negative x-axis\n # should project into center of image\n point = np.array([[0, 0, -10, 1]]).T\n\n # Project point into the camera\n P = K.dot(np.hstack((R, t)))\n\n # But when projecting it appears to be behind the camera?\n project(point,P)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe only thing I can think of is that the identify rotation matrix doesn't correspond to the camera pointing down the negative z-axis with the up vector in the direction of the positive y-axis. But I can't see how this wouldn't be the case is for example I had constructed Rc from a function like gluLookAt and given it a camera at the origin pointing down the negative z-axis I would get the identity matrix.\u003c/p\u003e","answer_count":"2","comment_count":"1","creation_date":"2017-09-16 06:46:23.703 UTC","favorite_count":"0","last_activity_date":"2017-09-27 19:00:31.843 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1185242","post_type_id":"1","score":"6","tags":"computer-vision|camera-calibration|projection-matrix","view_count":"141"} +{"id":"24819415","title":"Making Responsive menu more User Friendly","body":"\u003cp\u003eI have a mega menu which is working fine for me in responsive mode but I want to make it more user friendly when it is responsive because it takes a lot of space when it drops down.\u003c/p\u003e\n\n\u003cp\u003eHere is the code I am using:\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eHTML:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div id=\"menu-wrapper\"\u0026gt;\n \u0026lt;ul class=\"nav\"\u0026gt;\n \u0026lt;li\u0026gt;\n \u0026lt;a href='#'\u0026gt;Brands\u0026lt;/a\u0026gt;\n \u0026lt;div\u0026gt;\n \u0026lt;div class=\"nav-column\"\u0026gt;\n \u0026lt;ul\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"index.php?brands=1\"\u0026gt;Siemens\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"index.php?brands=2\"\u0026gt;KSB\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"index.php?brands=3\"\u0026gt;Dadex\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"index.php?brands=4\"\u0026gt;Hyundai\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\n \u0026lt;a href='#'\u0026gt;Products\u0026lt;/a\u0026gt;\n \u0026lt;div\u0026gt;\n \u0026lt;div class=\"nav-column\"\u0026gt;\n \u0026lt;h3\u0026gt;Automation\u0026lt;/h3\u0026gt;\n \u0026lt;ul\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"index.php?stypes=1\"\u0026gt;Logo!\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"index.php?stypes=2\"\u0026gt;Simatic-S7-200\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"index.php?stypes=3\"\u0026gt;Simatic-S7-400\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"index.php?stypes=4\"\u0026gt;Simatic-S7-1200\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"index.php?stypes=5\"\u0026gt;HMI\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"nav-column\"\u0026gt;\n \u0026lt;h3\u0026gt;Pumps\u0026lt;/h3\u0026gt;\n \u0026lt;ul\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"index.php?products=7\"\u0026gt;Etanorm\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"index.php?products=8\"\u0026gt;KWP\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"index.php?products=9\"\u0026gt;ZORO\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"index.php?products=10\"\u0026gt;DWT\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#\"\u0026gt;About ME\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#\"\u0026gt;News\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#\"\u0026gt;Contact US\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCSS:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e/* Reset */\n.nav, .nav a, .nav ul, .nav li, .nav div, .nav form, .nav input {\n margin: 0;\n padding: 0;\n border: none;\n outline: none;\n}\n.nav a {\n text-decoration: none;\n}\n.nav li {\n list-style: none;\n}\n/* Menu Container */\n#menu-wrapper {\n border: 0 solid #000;\n width: 870px;\n margin: 10px 0 0 380px;\n}\n.nav {\n display: inline-block;\n position: relative;\n margin: 30px 0 0 0;\n cursor: default;\n z-index: 500;\n border: 0;\n}\n/* Menu List */\n.nav \u0026gt; li {\n display: block;\n float: left;\n}\n/* Menu Links */\n.nav \u0026gt; li \u0026gt; a {\n position: relative;\n display: block;\n z-index: 510;\n height: 54px;\n padding: 0 20px;\n line-height: 54px;\n font-family: Helvetica, Arial, sans-serif;\n font-size: 14px;\n letter-spacing: 1px;\n color: #434343;\n background: #d8d8d8;\n background-image: -moz-linear-gradient(top, #afafaf, #d8d8d8);\n background-image: -webkit-linear-gradient(top, #afafaf, #d8d8d8);\n background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#afafaf), to(#d8d8d8));\n background-image: -ms-linear-gradient(top, #afafaf, #d8d8d8);\n background-image: -o-linear-gradient(top, #afafaf, #d8d8d8);\n background-image: linear-gradient(top, #afafaf, #d8d8d8);\n border-left: 1px dotted #c8c8c8;\n border-right: 1px dotted #c8c8c8;\n -webkit-transition: all .3s ease;\n -moz-transition: all .3s ease;\n -o-transition: all .3s ease;\n -ms-transition: all .3s ease;\n transition: all .3s ease;\n}\n.nav \u0026gt; li:hover \u0026gt; a {\n background: #c8c8c8;\n}\n.nav \u0026gt; li:first-child \u0026gt; a {\n border-radius: 3px 0 0 3px;\n border-left: none;\n}\n/* Search Form */\n.nav \u0026gt; li.nav-search \u0026gt; form {\n position: relative;\n width: inherit;\n height: 54px;\n z-index: 510;\n border-left: 1px solid #c8c8c8;\n}\n.nav \u0026gt; li.nav-search input[type=\"text\"] {\n display: block;\n float: left;\n width: 1px;\n height: 24px;\n padding: 15px 0;\n line-height: 24px;\n font-family: Helvetica, Arial, sans-serif;\n font-size: 12px;\n color: #434343;\n background: #d8d8d8;\n background-image: -moz-linear-gradient(top, #afafaf, #d8d8d8);\n background-image: -webkit-linear-gradient(top, #afafaf, #d8d8d8);\n background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#afafaf), to(#d8d8d8));\n background-image: -ms-linear-gradient(top, #afafaf, #d8d8d8);\n background-image: -o-linear-gradient(top, #afafaf, #d8d8d8);\n background-image: linear-gradient(top, #afafaf, #d8d8d8);\n -webkit-transition: all .3s ease 1s;\n -moz-transition: all .3s ease 1s;\n -o-transition: all .3s ease 1s;\n -ms-transition: all .3s ease 1s;\n transition: all .3s ease 1s;\n}\n.nav \u0026gt; li.nav-search input[type=\"text\"]:focus {\n color: #434343;\n}\n.nav \u0026gt; li.nav-search input[type=\"text\"]:focus, .nav \u0026gt; li.nav-search:hover input[type=\"text\"] {\n width: 50px;\n padding: 15px 20px;\n border: 0 solid #000;\n -webkit-transition: all .3s ease .1s;\n -moz-transition: all .3s ease .1s;\n -o-transition: all .3s ease .1s;\n -ms-transition: all .3s ease .1s;\n transition: all .3s ease .1s;\n}\n.nav \u0026gt; li.nav-search input[type=\"submit\"] {\n display: block;\n float: left;\n width: 10px;\n height: 54px;\n padding: 0 25px;\n cursor: pointer;\n background: #d8d8d8 url(../images/header/search1.png) no-repeat center center;\n border-radius: 0 3px 3px 0;\n -webkit-transition: all .3s ease;\n -moz-transition: all .3s ease;\n -o-transition: all .3s ease;\n -ms-transition: all .3s ease;\n transition: all .3s ease;\n}\n.nav \u0026gt; li.nav-search input[type=\"submit\"]:hover {\n background-color: #d8d8d8;\n}\n/* Menu Dropdown */\n.nav \u0026gt; li \u0026gt; div {\n position: absolute;\n display: block;\n width: 100%;\n top: 50px;\n left: 0;\n opacity: 0;\n visibility: hidden;\n overflow: hidden;\n background: #d8d8d8;\n background-image: -moz-linear-gradient(top, #afafaf, #d8d8d8);\n background-image: -webkit-linear-gradient(top, #afafaf, #d8d8d8);\n background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#afafaf), to(#d8d8d8));\n background-image: -ms-linear-gradient(top, #afafaf, #d8d8d8);\n background-image: -o-linear-gradient(top, #afafaf, #d8d8d8);\n background-image: linear-gradient(top, #afafaf, #d8d8d8);\n border-radius: 0 0 3px 3px;\n -webkit-transition: all .3s ease .15s;\n -moz-transition: all .3s ease .15s;\n -o-transition: all .3s ease .15s;\n -ms-transition: all .3s ease .15s;\n transition: all .3s ease .15s;\n}\n.nav \u0026gt; li:hover \u0026gt; div {\n opacity: 1;\n visibility: visible;\n overflow: visible;\n}\n/* Menu Content Styles */\n.nav .nav-column {\n float: left;\n width: 20%;\n padding: 2.5%;\n border-right: 1px dotted #c8c8c8;\n}\n.nav .nav-column h3 {\n margin: 20px 0 10px 0;\n line-height: 18px;\n font-family: Helvetica, Arial, sans-serif;\n font-weight: bold;\n font-size: 14px;\n color: #372f2b;\n text-transform: uppercase;\n}\n.nav .nav-column li a {\n display: block;\n line-height: 26px;\n font-family: Helvetica, Arial, sans-serif;\n font-weight: bold;\n font-size: 13px;\n color: #888888;\n}\n.nav .nav-column li a:hover {\n color: #666666;\n}\n\n@media screen and (max-width: 480px) {\n #menu-wrapper {\n float: none;\n margin: 0 0 0 0;\n width: 100%;\n }\n .nav {\n display: block;\n margin: 0 0 0 0;\n cursor: default;\n border: 0 solid #000;\n padding: 0 0 0 0;\n }\n .nav\u0026gt;li {\n background: #efefef;\n display: block;\n margin: 0 0 0 0;\n float: none;\n width: 100%;\n padding: 0 0 0 0;\n }\n .nav \u0026gt;li\u0026gt;a {\n display: block;\n padding: 0 0 0 0;\n text-align: center;\n margin: 0 0 0 0;\n }\n .nav \u0026gt;li:hover \u0026gt; div {\n display: block;\n z-index: 999;\n position: static;\n }\n .nav .nav-column {\n float: none;\n width: 100%\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat I want to achieve is when a user clicks on the products \u003ccode\u003e\u0026lt;li\u0026gt;\u003c/code\u003e, all of the \u003ccode\u003e\u0026lt;h3\u0026gt;\u003c/code\u003e under the products \u003ccode\u003e\u0026lt;li\u0026gt;\u003c/code\u003e gets displayed only the \u003ccode\u003e\u0026lt;h3\u0026gt;\u003c/code\u003e gets displayed all of them. Then when a user clicks on an \u003ccode\u003e\u0026lt;h3\u0026gt;\u003c/code\u003e tag, only its corresponding \u003ccode\u003eul\u003c/code\u003e gets displayed.\u003c/p\u003e\n\n\u003cp\u003eHere is a fiddle showing what I have tried so far:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://jsfiddle.net/yH39r/4/\" rel=\"nofollow\"\u003ehttp://jsfiddle.net/yH39r/4/\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"24820341","answer_count":"1","comment_count":"5","creation_date":"2014-07-18 07:25:15.38 UTC","last_activity_date":"2014-07-18 10:21:25.267 UTC","last_edit_date":"2014-07-18 09:02:37.637 UTC","last_editor_display_name":"","last_editor_user_id":"3851942","owner_display_name":"","owner_user_id":"3851942","post_type_id":"1","score":"-1","tags":"html|css","view_count":"86"} +{"id":"2681313","title":"How to check whether a PE file (DLL,EXE) is a COM component?","body":"\u003cp\u003eI need to write a stub module which, when given a PE (DLL/EXE) as input, will determine whether it is a normal Win32 DLL/EXE or COM DLL/EXE. I need to determine this programatically.\u003c/p\u003e\n\n\u003cp\u003eAre there any Windows APIs for this purpose?\u003c/p\u003e","accepted_answer_id":"2681468","answer_count":"2","comment_count":"0","creation_date":"2010-04-21 08:25:57.83 UTC","last_activity_date":"2012-05-10 21:25:00.957 UTC","last_edit_date":"2010-07-09 19:55:52.773 UTC","last_editor_display_name":"","last_editor_user_id":"811","owner_display_name":"","owner_user_id":"273330","post_type_id":"1","score":"4","tags":"com|winapi|portable-executable","view_count":"1939"} +{"id":"23127088","title":"How to receive emails using imap in scala play using play libraries?","body":"\u003cp\u003eIs there any way to receive/synch emails using imap in scala play?\u003c/p\u003e\n\n\u003cp\u003eBut i don't want to use javax.mail library\u003c/p\u003e\n\n\u003cp\u003eInstead i am looking for play libraries\u003c/p\u003e\n\n\u003cp\u003ePlease suggest any ideas\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2014-04-17 07:28:35.983 UTC","last_activity_date":"2014-05-27 14:45:08.69 UTC","last_edit_date":"2014-05-27 14:45:08.69 UTC","last_editor_display_name":"","last_editor_user_id":"3351247","owner_display_name":"","owner_user_id":"3351247","post_type_id":"1","score":"1","tags":"scala|playframework|imap","view_count":"244"} +{"id":"21853732","title":"how to create date format during table creation in query browser","body":"\u003cp\u003ehow to define date format during table creation,for example i need to create table with date field in sql query browser but i don't have any idea to create date in this format \u003ccode\u003edd-mm-yyyy\u003c/code\u003e.\nWhether is it possible to create table with date field in this format.\u003c/p\u003e","answer_count":"2","comment_count":"1","creation_date":"2014-02-18 12:23:54.17 UTC","last_activity_date":"2014-02-18 18:06:56.387 UTC","last_edit_date":"2014-02-18 18:06:56.387 UTC","last_editor_display_name":"","last_editor_user_id":"285587","owner_display_name":"","owner_user_id":"3274940","post_type_id":"1","score":"0","tags":"mysql","view_count":"425"} +{"id":"11269481","title":"how to get source code syntax working in the maven-fluido-skin maven site skin?","body":"\u003cp\u003eThe bootstrap based maven-fluido-skin skin is eye candy but I cannot figure out how to get source code to render within the apt pages. Does anyone have an example of how to put an xml or java code snippet into the source apt so that it renders as syntax highlighted in the output html page? \u003c/p\u003e","accepted_answer_id":"11281614","answer_count":"1","comment_count":"5","creation_date":"2012-06-29 21:57:42.637 UTC","favorite_count":"1","last_activity_date":"2012-07-01 11:36:44.117 UTC","last_edit_date":"2012-06-30 07:11:09.25 UTC","last_editor_display_name":"","last_editor_user_id":"329496","owner_display_name":"","owner_user_id":"329496","post_type_id":"1","score":"0","tags":"apache|maven|apt","view_count":"523"} +{"id":"24025872","title":"C# Speech Recognition disable grammar","body":"\u003cp\u003eI'm trying to use several grammars for a Speech Recognition in C# and I want to disable them in certain cases.\u003c/p\u003e\n\n\u003cp\u003eMy problem is that if I disable them nothing changes, here's a part of my code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003erecognizer.LoadGrammar(g_init);\nrecognizer.LoadGrammar(g_menu);\nrecognizer.LoadGrammar(g_timer);\nrecognizer.LoadGrammar(g_say);\n\nrecognizer.Grammars[recognizer.Grammars.IndexOf(g_menu)].Enabled = false;\nrecognizer.Grammars[recognizer.Grammars.IndexOf(g_timer)].Enabled = false;\nrecognizer.Grammars[recognizer.Grammars.IndexOf(g_say)].Enabled = false;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere I want to disable the init grammar and enable the menu grammar\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003erecognizer.Grammars[recognizer.Grammars.IndexOf(g_init)].Enabled = false;\nrecognizer.Grammars[recognizer.Grammars.IndexOf(g_menu)].Enabled = true;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to know how to disable grammars and enable them in a later stage\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-06-03 22:14:36.99 UTC","last_activity_date":"2014-06-04 03:36:35.03 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2885898","post_type_id":"1","score":"0","tags":"c#|speech-recognition|speech-to-text","view_count":"343"} +{"id":"19299461","title":"Displaying query results from database, approaches, any ci helper?","body":"\u003cp\u003eUPDATE:\u003c/p\u003e\n\n\u003cp\u003eHow could/would i be able to display the results. My mind is blocked, i cant seem to think coz all my mind prioritizes is the design/look of how it would be displayed. If someone could show me in code how to display each of the data, i would be able to finish.\u003c/p\u003e\n\n\u003cp\u003eI have little to no time to make a better database structure so one table would suffice. :)\u003c/p\u003e\n\n\u003cp\u003eTable columns:\nid\nname\nmeal\ncuisine\ncooking\ndifficulty\ndescription \u003c/p\u003e\n\n\u003cp\u003eSearch View: 1st step\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;h2\u0026gt;Results:\u0026lt;/h2\u0026gt;\n\n \u0026lt;?php if($result == 0):?\u0026gt;\n No records found.\n \u0026lt;?php else:?\u0026gt;\n \u0026lt;?php foreach($result as $r):?\u0026gt;\n \u0026lt;?=anchor('recipe_controller/show_recipe_search/'.$r-\u0026gt;id,$r-\u0026gt;name);?\u0026gt;\u0026lt;br /\u0026gt;\n \u0026lt;?php endforeach;?\u0026gt;\n \u0026lt;?php endif;?\u0026gt;\n \u0026lt;p\u0026gt;\n \u0026lt;?=$links?\u0026gt;\n \u0026lt;/p\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eController: 2nd step\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic function show_recipe_search()\n {\n\n $to_show = $this-\u0026gt;uri-\u0026gt;segment(3);\n $this-\u0026gt;db-\u0026gt;where('id', $to_Show);\n $query = $this-\u0026gt;db-\u0026gt;get('recipe');\n $data['result'] = $query-\u0026gt;result_array();\n\n $this-\u0026gt;load-\u0026gt;view('display_recipe',$data);\n\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eView: 3rd step\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php foreach($result as $r):?\u0026gt;\n\u0026lt;h2\u0026gt;\u0026lt;?php echo '$name'; ?\u0026gt;\u0026lt;/h2\u0026gt; // Recipe name\n \u0026lt;?=$r-\u0026gt;echo rest of row;?\u0026gt;\u0026lt;br /\u0026gt;\n \u0026lt;?php endforeach;?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSince my view is incomplete as my mind is rendering me paralyzed. IDK why. I just cant think of how i would be able to display the result. Should be easy but until i can picture the design i cant echo the results yet.\u003c/p\u003e\n\n\u003cp\u003eWhat does this error imply?\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003ea php error was encountered\u003c/p\u003e\n \n \u003cp\u003eseverity: notice\u003c/p\u003e\n \n \u003cp\u003emessage: trying to get property of non-object\u003c/p\u003e\n \n \u003cp\u003efilename: views/display_recipe.php\u003c/p\u003e\n \n \u003cp\u003eline number: 63\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eline 63 is \u003ccode\u003e\u0026lt;h2\u0026gt;\u0026lt;?php echo $r-\u0026gt;name; ?\u0026gt;\u0026lt;/h2\u0026gt;\u003c/code\u003e\u003c/p\u003e","accepted_answer_id":"19306109","answer_count":"1","comment_count":"4","creation_date":"2013-10-10 15:04:33.583 UTC","last_activity_date":"2013-10-10 20:57:57.817 UTC","last_edit_date":"2013-10-10 17:20:01.3 UTC","last_editor_display_name":"","last_editor_user_id":"2855169","owner_display_name":"","owner_user_id":"2855169","post_type_id":"1","score":"1","tags":"php|database|codeigniter|pagination","view_count":"91"} +{"id":"11249633","title":"Make Localhost a Custom Domain in IIS Express","body":"\u003cp\u003eI am using IIS Express in Visual Studio 2010 and right now it runs on localhost:61156. But I need it to run on a domain. Is it possible to make IIS Express to run on devserver.com, instead of localhost:61156? So basically when I run debug I want devserver,com, instead of localhost:61156. I've come across a few things on google, but no luck. Any ideas on how to do this?\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","accepted_answer_id":"11250513","answer_count":"2","comment_count":"0","creation_date":"2012-06-28 17:09:10.767 UTC","favorite_count":"10","last_activity_date":"2016-10-10 14:39:25.783 UTC","last_editor_display_name":"","owner_display_name":"user482375","post_type_id":"1","score":"13","tags":"visual-studio-2010|iis-7.5|iis-express","view_count":"7152"} +{"id":"16769723","title":"How to send mail with attachment in asp.net","body":"\u003cblockquote\u003e\n \u003cp\u003eTHIS IS MY ATTEMPT I AM GETTING AN ERROR:\u003c/p\u003e\n \n \u003cp\u003eMy SendMail.aspx\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"\u0026gt;\n\u0026lt;html xmlns=\"http://www.w3.org/1999/xhtml\"\u0026gt;\n\u0026lt;head runat=\"server\"\u0026gt;\n \u0026lt;title\u0026gt;\u0026lt;/title\u0026gt;\n\u0026lt;/head\u0026gt;\n\u0026lt;body\u0026gt;\n \u0026lt;form id=\"form1\" runat=\"server\"\u0026gt;\n \u0026lt;div\u0026gt;\n \u0026lt;table style=\"border: 1px solid\" align=\"center\"\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td colspan=\"2\" align=\"center\"\u0026gt;\n \u0026lt;b\u0026gt;Send Mail with Attachment using asp.net\u0026lt;/b\u0026gt;\n \u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;\n From:\n \u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\n \u0026lt;asp:TextBox ID=\"txtFrom\" runat=\"server\"\u0026gt;\u0026lt;/asp:TextBox\u0026gt;\n \u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;\n To:\n \u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\n \u0026lt;asp:TextBox ID=\"txtTo\" runat=\"server\"\u0026gt;\u0026lt;/asp:TextBox\u0026gt;\n \u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;\n Subject:\n \u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\n \u0026lt;asp:TextBox ID=\"txtSubject\" runat=\"server\"\u0026gt;\u0026lt;/asp:TextBox\u0026gt;\n \u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;\n Attach a file:\n \u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\n \u0026lt;asp:FileUpload ID=\"fileUpload1\" runat=\"server\" /\u0026gt;\n \u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td valign=\"top\"\u0026gt;\n Body:\n \u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\n \u0026lt;asp:TextBox ID=\"txtBody\" runat=\"server\" TextMode=\"MultiLine\" Columns=\"30\" Rows=\"10\"\u0026gt;\u0026lt;/asp:TextBox\u0026gt;\n \u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;\n \u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\n \u0026lt;asp:Button ID=\"btnSubmit\" Text=\"Send\" runat=\"server\" OnClick=\"btnSubmit_Click\" /\u0026gt;\n \u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;/table\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/form\u0026gt;\n\u0026lt;/body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eMy SendMail.aspx.cs\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cpre\u003e\u003ccode\u003eusing System.Net.Mail;\nusing System.Net;\n\nprotected void btnSubmit_Click(object sender, EventArgs e)\n {\n MailMessage mail = new MailMessage();\n mail.To.Add(txtTo.Text);\n //mail.To.Add(\"amit_jain_online@yahoo.com\");\n mail.From = new MailAddress(txtFrom.Text);\n mail.Subject = txtSubject.Text;\n mail.Body = txtBody.Text;\n mail.IsBodyHtml = true;\n\n //Attach file using FileUpload Control and put the file in memory stream\n if (fileUpload1.HasFile)\n {\n mail.Attachments.Add(new Attachment(fileUpload1.PostedFile.InputStream, fileUpload1.FileName));\n }\n SmtpClient smtp = new SmtpClient();\n //Or Your SMTP Server Address\n\n NetworkCredential nc = new NetworkCredential();\n nc.UserName=\"myusername@gmail.com\";\n nc.Password=\"mypassword\";\n smtp.Credentials = nc;\n smtp.Port = 587;\n smtp.Host = \"smtp.gmail.com\";\n smtp.UseDefaultCredentials = false;\n //Or your Smtp Email ID and Password\n smtp.EnableSsl = true;\n smtp.Send(mail);\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eI am getting this Error dont know what to do:\u003c/p\u003e\n \n \u003cp\u003eThe SMTP server requires a secure connection or the client was not authenticated. The \u003eserver response was: 5.5.1 Authentication Required.\n Learn more at\u003c/p\u003e\n\u003c/blockquote\u003e","answer_count":"1","comment_count":"4","creation_date":"2013-05-27 09:04:21.033 UTC","last_activity_date":"2013-10-06 08:49:17.93 UTC","last_editor_display_name":"","owner_display_name":"user2028367","post_type_id":"1","score":"0","tags":"asp.net|email","view_count":"5066"} +{"id":"19686217","title":"How to set up splash screen","body":"\u003cp\u003eWith Android Studio I want to put in my app, a splash screen loading for 6 seconds before opening the activity of the game. I put both the java code and xml but when I start the device, the splash screen does not appear. I do not understand what is the error.\nCan you help me?`\u003c/p\u003e\n\n\u003cp\u003eThis is my SplashScreenActivity.java\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class SplashScreenActivity extends Activity {\n\nprivate final int SPLASH_DISPLAY_LENGHT = 6000;\n\n/** Called when the activity is first created. */\n@Override\npublic void onCreate(Bundle icicle) {\n super.onCreate(icicle);\n setContentView(R.layout.splash);\n\n /* New Handler to start the Menu-Activity\n * and close this Splash-Screen after some seconds.*/\n new Handler().postDelayed(new Runnable(){\n @Override\n public void run() {\n /* Create an Intent that will start the Menu-Activity. */\n Intent mainIntent = new Intent(SplashScreenActivity.this,Menu.class);\n SplashScreenActivity.this.startActivity(mainIntent);\n SplashScreenActivity.this.finish();\n }\n }, SPLASH_DISPLAY_LENGHT);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e}\u003c/p\u003e\n\n\u003cp\u003eAnd the file xml :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;RelativeLayout\nandroid:id=\"@+id/LinearLayout01\"\nandroid:layout_width=\"fill_parent\"\nandroid:layout_height=\"fill_parent\"\nxmlns:android=\"http://schemas.android.com/apk/res/android\"\nandroid:gravity=\"center\"\nandroid:background=\"#ff000000\"\u0026gt;\n\u0026lt;TextView android:id=\"@+id/TextView01\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:textSize=\"18sp\"\n android:textStyle=\"bold\"\n android:textColor=\"#fff\"\n android:text=\"LOADING...\"\n android:layout_marginTop=\"250dp\"\n android:layout_marginLeft=\"30dp\"/\u0026gt;\n\u0026lt;TextView\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_marginTop=\"500dp\"\n android:textColor=\"#ffffffff\"\n android:text=\"\"\n android:gravity=\"center\"/\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003c/p\u003e","accepted_answer_id":"19686289","answer_count":"1","comment_count":"2","creation_date":"2013-10-30 14:51:45.927 UTC","favorite_count":"2","last_activity_date":"2017-09-16 05:54:15.32 UTC","last_edit_date":"2013-10-30 15:10:04.037 UTC","last_editor_display_name":"","last_editor_user_id":"2675569","owner_display_name":"","owner_user_id":"2675569","post_type_id":"1","score":"0","tags":"java|android|splash-screen","view_count":"338"} +{"id":"8651547","title":"Error compiling the compiler GCC","body":"\u003cp\u003eI know, it's an irony to compile a compiler. But I need a specific version of this compiler, and the CentOS 5.x repositories have not the most recent versions of GCC.\u003c/p\u003e\n\n\u003cp\u003eThe version what i need is 4.3.2 but I only have 4.1.1.\u003c/p\u003e\n\n\u003cp\u003eI followed this tutorial to install the gcc \u003ca href=\"http://www.mjmwired.net/resources/mjm-fedora-gcc.html\" rel=\"nofollow\"\u003ehttp://www.mjmwired.net/resources/mjm-fedora-gcc.html\u003c/a\u003e and I used the following parameters at configure (before compiling):\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e/root/gcc/gcc-4.3.6/configure --prefix=/opt/gcc43 --program-suffix=43 --enable-languages=c,c++ --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --disable-multilib\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eThe last option \u003ccode\u003e--disable-multilib\u003c/code\u003e save me for a another error that I got in previous compile tries (after a long compiling time...)\u003c/p\u003e\n\n\u003cp\u003eAlso i set an enviroment variable, because in previous tries, i got errors, so i set as following:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eexport LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib:$LD_LIBRARY_PATH\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThat ensure the compiler to search mpfr and gmp libraries (which are needed) in that directory\u003c/p\u003e\n\n\u003cp\u003eSo, i execute the 'make' command.\u003c/p\u003e\n\n\u003cp\u003eI though it was everything ok, because this time took more time (in my last try before setting that variable took me around 2 hours compiling)\u003c/p\u003e\n\n\u003cp\u003eI used a Micro instance in Amazon Web Services, this instance only have 1 single core x86_64 processor and 613 MB of RAM, \u003cstrong\u003eso it took about 9 HOURS to compile.\u003c/strong\u003e \u003c/p\u003e\n\n\u003cp\u003eUnfortunetly, i got errors again!!, now I got this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emake[2]: Entering directory `/root/gcc/build'\nmake[3]: Entering directory `/root/gcc/build'\nrm -f stage_current\nmake[3]: Leaving directory `/root/gcc/build'\nComparing stages 2 and 3\nwarning: ./cc1-checksum.o differs\nwarning: ./cc1plus-checksum.o differs\nBootstrap comparison failure!\n./gcc.o differs\n./varasm.o differs\n./except.o differs\n./i386.o differs\nmake[2]: *** [compare] Error 1\nmake[2]: Leaving directory `/root/gcc/build'\nmake[1]: *** [stage3-bubble] Error 2\nmake[1]: Leaving directory `/root/gcc/build'\nmake: *** [all] Error 2\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny suggestions?\u003c/p\u003e","accepted_answer_id":"8651606","answer_count":"2","comment_count":"1","creation_date":"2011-12-28 03:31:13.003 UTC","favorite_count":"2","last_activity_date":"2011-12-28 04:11:53.673 UTC","last_edit_date":"2011-12-28 03:33:48.51 UTC","last_editor_display_name":"","last_editor_user_id":"118068","owner_display_name":"","owner_user_id":"598070","post_type_id":"1","score":"4","tags":"gcc|makefile|centos|centos5|gcc4","view_count":"6924"} +{"id":"30318756","title":"How to send Text RTD Record from nfc to android?","body":"\u003cp\u003eI am trying to communicate nfc module pn532 with Android mobile.\u003c/p\u003e\n\n\u003cp\u003eI used \u003ca href=\"https://www.raspberrypi.org/forums/viewtopic.php?f=45\u0026amp;t=78966\" rel=\"nofollow\"\u003eitead nfc\u003c/a\u003e module interface with rasberry pi and using libnfc(1.7.1) and libllcp for communicate with mobile.\u003c/p\u003e\n\n\u003cp\u003eAfter run libllcp test program (snep-client.c) example,\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$ LIBNFC_LOG_LEVEL=3 ./examples/snep-client/snep-client\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI get this error\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e\"error libnfc.driver.pn532_spi Unable to wait for SPI data. (RX)\u003c/p\u003e\n \n \u003cp\u003elibllcp.mac.link Could not send 2 bytes\"\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003e\u003cstrong\u003eLog :\u003c/strong\u003e \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edebug libnfc.bus.spi RX: 00\ndebug libnfc.bus.spi TX: 02\ndebug libnfc.bus.spi RX: 00\ndebug libnfc.bus.spi TX: 02\ndebug libnfc.bus.spi RX: 00\ndebug libnfc.bus.spi TX: 02\ndebug libnfc.bus.spi RX: 01\ndebug libnfc.bus.spi TX: 03\ndebug libnfc.bus.spi RX: 00 00 ff 20\ndebug libnfc.bus.spi RX: e0\ndebug libnfc.bus.spi TX: 03\ndebug libnfc.bus.spi RX: d5\ndebug libnfc.bus.spi TX: 03\ndebug libnfc.bus.spi RX: 57\ndebug libnfc.bus.spi RX: 00\ndebug libnfc.bus.spi TX: 03\ndebug libnfc.bus.spi RX: 01 df 0b 63 89 dc 35 50 ec 59 a2 00 00 00 0e 32 46 66 6d 01 01 11 03 02 00 13 04 01 96\ndebug libnfc.bus.spi RX: 96\ndebug libnfc.bus.spi TX: 03\ndebug libnfc.bus.spi RX: 00\nlibllcp.mac.link (pn532_spi:/dev/spidev0.0) nfc_initiator_poll_dep_target() succeeded\nlibllcp.mac.link (pn532_spi:/dev/spidev0.0) LLCP Link activated (initiator)\nlibllcp.llc.link llc_link_configure (0x143d80, (nil), 0)\nlibllcp.llc.link mq_open (/libllcp-2532-0x143d80-up)\nlibllcp.llc.link mq_open (/libllcp-2532-0x143d80-down)\nlibllcp.llc.link LLC Link started successfully\nlibllcp.mac.link Sending 2 bytes\nlibllcp.mac.link LTOs: 1000 ms (local), 100 ms (remote)\ndebug libnfc.chip.pn53x InDataExchange\ndebug libnfc.chip.pn53x Timeout value: 1100libllcp.llc.llc (0xb6d16470) Link activated\nlibllcp.llc.llc (0xb6d16470) mq_receive+\ndebug libnfc.bus.spi TX: 01 00 00 ff 05 fb d4 40 01 00 00 eb\ndebug libnfc.bus.spi TX: 02\ndebug libnfc.bus.spi RX: 01\ndebug libnfc.bus.spi TX: 03\ndebug libnfc.bus.spi RX: 00 00 ff 00 ff 00\ndebug libnfc.chip.pn53x PN53x ACKed\ndebug libnfc.bus.spi TX: 02\ndebug libnfc.bus.spi RX: 00\ndebug libnfc.bus.spi TX: 02\ndebug libnfc.bus.spi RX: 00\n.\n.\n.\n.\n***** AFTER SOME SAME LOG********\n.\n.\n.\ndebug libnfc.bus.spi RX: 00\ndebug libnfc.bus.spi TX: 02\ndebug libnfc.bus.spi RX: 00\ndebug libnfc.bus.spi TX: 02\ndebug libnfc.bus.spi RX: 00\ndebug libnfc.bus.spi TX: 02\ndebug libnfc.bus.spi RX: 00\ndebug libnfc.bus.spi TX: 02\ndebug libnfc.bus.spi RX: 00\nerror libnfc.driver.pn532_spi Unable to wait for SPI data. (RX)\nlibllcp.mac.link Could not send 2 bytes\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI used pn532(itead nfc) module to communicate with android 4.3 (samsung S3).\u003c/p\u003e\n\n\u003cp\u003eI used libnfc -\u003e libllcp -\u003e libndef to send data from raspberry pi to android.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eProblem:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eMy mobile vibrate when I tap it with nfc module, but not showing any message and error occurs at pi console.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eQuestions:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eIs 1.7.1 libnfc version is right to use with libllcp library and snep protocol to send my NDEF message to android?\u003c/p\u003e\n\n\u003cp\u003eIf I send Text RTD Record to android, than will phone display text on screen?\u003c/p\u003e\n\n\u003cp\u003ePlease comment your view about this error log, May it help me to solve error.\u003c/p\u003e\n\n\u003cp\u003eThank you\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2015-05-19 07:00:45.383 UTC","last_activity_date":"2015-05-29 06:19:05.553 UTC","last_edit_date":"2015-05-29 06:19:05.553 UTC","last_editor_display_name":"","last_editor_user_id":"4914815","owner_display_name":"","owner_user_id":"4914815","post_type_id":"1","score":"1","tags":"android|raspberry-pi|nfc|nfc-p2p|lib-nfc","view_count":"517"} +{"id":"5788287","title":"IDataErrorInfo - not seeing any error message even though one gets picked up","body":"\u003cp\u003eI have ItemType that implements everything one would need for Validation with the help of IDataErrorInfo interface:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#region IDataErrorInfo implementation\n //WPF doesn't need this one\n public string Error\n { get { return null; } }\n\n public string this[string propertyName]\n {\n get { return GetValidationError(propertyName); }\n }\n #endregion\n\n #region Validation\n public bool IsValid\n {\n get\n {\n foreach (string property in ValidatedProperties)\n {\n if (GetValidationError(property) != null)\n {\n return false;\n }\n }\n\n return true;\n }\n }\n\n static readonly string[] ValidatedProperties =\n {\n \"Name\"\n };\n\n private string GetValidationError(string propertyName)\n {\n if (Array.IndexOf(ValidatedProperties, propertyName) \u0026lt; 0)\n return null;\n\n string error = null;\n\n switch (propertyName)\n {\n case \"Name\":\n error = ValidateName();\n break;\n default:\n Debug.Fail(\"Unexpected property being validated on Customer: \" + propertyName);\n break;\n }\n\n return error;\n }\n\n string ValidateName()\n {\n if (!IsStringMissing(Name))\n {\n return \"Name can not be empty!\";\n }\n\n return null;\n }\n\n static bool IsStringMissing(string value)\n {\n return string.IsNullOrEmpty(value) ||\n value.Trim() == String.Empty;\n }\n #endregion\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eItemType is wrapped with ItemViewModel. On the ItemViewModel I have a command for when a user clicks the Save Button:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic ICommand SaveItemType\n {\n get\n {\n if (saveItemType == null)\n {\n saveItemType = new RelayCommand(() =\u0026gt; Save());\n }\n\n return saveItemType;\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThen, in the DetailsView, I have the following xaml code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;TextBlock Text=\"Name:\" /\u0026gt;\n\u0026lt;TextBox Grid.Column=\"1\" Name=\"NameTextBox\" Text=\"{Binding Name, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}\"\n Validation.ErrorTemplate=\"{x:Null}\" /\u0026gt;\n\n\u0026lt;ContentPresenter Grid.Row=\"13\" Grid.Column=\"2\"\n Content=\"{Binding ElementName=NameTextBox, Path=(Validation.Errors).CurrentItem}\" /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethe following architecture going on (it is not clear, but the form is actually an independent xaml file (User Control), where the datacontext of the grid in the form is set to the ObservableCollection):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;Grid DataContext=\"{Binding Items}\"\u0026gt;\n \u0026lt;Grid.ColumnDefinitions\u0026gt;\n \u0026lt;ColumnDefinition /\u0026gt;\n \u0026lt;ColumnDefinition /\u0026gt;\n \u0026lt;/Grid.ColumnDefinitions\u0026gt;\n \u0026lt;Grid.RowDefinitions\u0026gt;\n \u0026lt;RowDefinition Height=\"Auto\" /\u0026gt;\n \u0026lt;RowDefinition Height=\"Auto\" /\u0026gt;\n \u0026lt;RowDefinition Height=\"Auto\" /\u0026gt;\n \u0026lt;RowDefinition Height=\"Auto\" /\u0026gt;\n \u0026lt;RowDefinition Height=\"Auto\" /\u0026gt;\n \u0026lt;RowDefinition Height=\"Auto\" /\u0026gt;\n \u0026lt;RowDefinition Height=\"Auto\" /\u0026gt;\n \u0026lt;RowDefinition Height=\"Auto\" /\u0026gt;\n \u0026lt;RowDefinition Height=\"Auto\" /\u0026gt;\n \u0026lt;RowDefinition Height=\"Auto\" /\u0026gt;\n \u0026lt;RowDefinition Height=\"Auto\" /\u0026gt;\n \u0026lt;RowDefinition Height=\"Auto\" /\u0026gt;\n \u0026lt;RowDefinition Height=\"Auto\" /\u0026gt;\n \u0026lt;RowDefinition Height=\"Auto\" /\u0026gt;\n \u0026lt;RowDefinition Height=\"Auto\" /\u0026gt;\n \u0026lt;/Grid.RowDefinitions\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/jdKnI.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eThe problem that I am having is that error messages are not showing up. When I breakpoint and check if it validates correctly and if I have any error messages, then I do have them. But somehow the error message does not arrive in the xaml.\u003c/p\u003e\n\n\u003cp\u003eWhat is the missing piece of the puzzle?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT - THE MISSING PIECE\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eRight, so, what it was was the following:\u003c/p\u003e\n\n\u003cp\u003eI implemented IDataErrorInfo on my model, but not on the ViewModel that wraps the model. What I had to do was as well was implement the IDataErrorInfo interface on the ViewModel, and get it from the model.\u003c/p\u003e\n\n\u003cp\u003eViewModel Implementation of IDataErrorInfo:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{ get { return (ItemType as IDataErrorInfo).Error; } }\n\npublic string this[string propertyName]\n{\n get\n {\n return (ItemType as IDataErrorInfo)[propertyName];\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"5788707","answer_count":"2","comment_count":"0","creation_date":"2011-04-26 09:15:17.933 UTC","favorite_count":"1","last_activity_date":"2013-12-09 22:54:44.047 UTC","last_edit_date":"2011-04-26 10:41:01.207 UTC","last_editor_display_name":"","last_editor_user_id":"712383","owner_display_name":"","owner_user_id":"712383","post_type_id":"1","score":"2","tags":"wpf|mvvm|binding","view_count":"4854"} +{"id":"38731075","title":"Can I make Gradle only pull in needed dependencies?","body":"\u003cp\u003eI am making an Android library that allows the developer to choose which options they would like to use of the library. Each option depends on a different external dependency that is pulled in through Gradle. \u003c/p\u003e\n\n\u003cp\u003eMy question: Is it possible to make Gradle only pull in dependency A if option B and C are not being used to make the library as small as possible? \u003c/p\u003e\n\n\u003cp\u003eI have looked into Dependency Injection but I don't think I understand it enough to determine if this is what I am looking for. \u003c/p\u003e","accepted_answer_id":"38731823","answer_count":"1","comment_count":"5","creation_date":"2016-08-02 21:50:09.553 UTC","last_activity_date":"2016-08-02 23:05:58.597 UTC","last_edit_date":"2016-08-02 21:56:22.1 UTC","last_editor_display_name":"","last_editor_user_id":"606664","owner_display_name":"","owner_user_id":"6558168","post_type_id":"1","score":"1","tags":"java|android|gradle|dependency-injection","view_count":"41"} +{"id":"32631182","title":"Could not synchronize database state with session org.hibernate.exception.LockAcquisitionException: could not update:","body":"\u003cp\u003eHi I am getting the error in the logs, please let me know hwat is wrong with session.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[9/17/15 12:49:12:127 BST] 00000015 SystemOut O 2015-09-17 12:49:12 WARN JDBCExceptionReporter:100 - SQL Error: -911, SQLState: 40001\n[9/17/15 12:49:12:128 BST] 00000015 SystemOut O 2015-09-17 12:49:12 ERROR JDBCExceptionReporter:101 - DB2 SQL Error: SQLCODE=-911, SQLSTATE=40001, SQLERRMC=2, DRIVER=3.58.81\n[9/17/15 12:49:12:136 BST] 00000015 SystemOut O 2015-09-17 12:49:12 ERROR AbstractFlushingEventListener:324 - Could not synchronize database state with session\norg.hibernate.exception.LockAcquisitionException: could not update: [*********]\nat org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:105)\nat org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)\nat org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2443)\nat org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2325)\nat org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2625)\nat org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:115)\nat org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)\nat org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)\nat org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:168)\nat org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)\nat org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)\nat org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1028)\nat com.persistance.ApplicationDAOImpl.getUniqueId(ApplicationDAOImpl.java:573)\nat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)\nat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)\nat java.lang.reflect.Method.invoke(Method.java:611)\nat org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)\nat org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)\nat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)\nat org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)\nat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)\nat org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)\nat com.sun.proxy.$Proxy52.getCapeUniqueId(Unknown Source)\nat com.util.CapeSequenceGenerator.getCapeUniqueId(SequenceGenerator.java:32)\nat com..serviceimpl.CreditApplicationServiceImpl.processAppMessage(ApplicationServiceImpl.java:148)\nat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)\nat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)\nat java.lang.reflect.Method.invoke(Method.java:611)\nat org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)\nat org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)\nat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)\nat org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)\nat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)\nat org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCaused by: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecom.ibm.db2.jcc.am.to: DB2 SQL Error: SQLCODE=-911, SQLSTATE=40001, SQLERRMC=2, DRIVER=3.58.81\nat com.ibm.db2.jcc.am.ed.a(ed.java:663)\nat com.ibm.db2.jcc.am.ed.a(ed.java:60)\nat com.ibm.db2.jcc.am.ed.a(ed.java:127)\nat com.ibm.db2.jcc.am.tm.c(tm.java:2523)\nat com.ibm.db2.jcc.t4.fb.s(fb.java:940)\nat com.ibm.db2.jcc.t4.fb.k(fb.java:390)\nat com.ibm.db2.jcc.t4.fb.a(fb.java:61)\nat com.ibm.db2.jcc.t4.t.a(t.java:50)\nat com.ibm.db2.jcc.t4.vb.b(vb.java:218)\nat com.ibm.db2.jcc.am.um.jc(um.java:2860)\nat com.ibm.db2.jcc.am.um.b(um.java:3795)\nat com.ibm.db2.jcc.am.um.ac(um.java:709)\nat com.ibm.db2.jcc.am.um.executeUpdate(um.java:692)\nat com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.pmiExecuteUpdate(WSJdbcPreparedStatement.java:1185)\nat com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.executeUpdate(WSJdbcPreparedStatement.java:802)\nat org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:46)\nat org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2421)\n... 45 more\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBelow is my code which is causing the above error\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCriteria criteria = session.createCriteria(Sequence.class);\n\nList capeSequence = criteria.list(); \nfor (Iterator iterator = capeSequence.iterator(); iterator.hasNext();) {\n Sequence uniqueSequence = (Sequence)iterator.next();\n existingId = uniqueSequence.getSequence();\n minVal = uniqueSequence.getMinVal();\n maxVal = uniqueSequence.getMaxVal();\n}\nif (existingId == maxVal) { \n existingId = minVal; \n} else {\n existingId = existingId+1;\n}\n\nSequence eequenceObj = (CSequence) session.get(Sequence.class, SEQUENCE_NAME, LockMode.UPGRADE);\nSequenceObj.setSequence(existingId);\nsession.update(capeSequenceObj);\nsession.flush();\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"2","creation_date":"2015-09-17 13:11:39.793 UTC","last_activity_date":"2015-09-18 07:51:17.187 UTC","last_edit_date":"2015-09-18 07:51:17.187 UTC","last_editor_display_name":"","last_editor_user_id":"201557","owner_display_name":"","owner_user_id":"3501498","post_type_id":"1","score":"0","tags":"spring|hibernate","view_count":"387"} +{"id":"388062","title":"Release Management Software","body":"\u003cp\u003eOn the topic of Release Management, I'm investigating my options for software that will essentially perform the features WSUS offers as far as I'm aware (remote installation, version querying, per-machine/group settings, etc) but for my custom software. It also needs to be able to run third-party executables (e.g. a graphics driver installer), notify if software is currently running before updating, etc.\u003c/p\u003e\n\n\u003cp\u003eUPDATE: I'm primarily looking at C#/C++.NET code to be installed, but I'm looking for a solution for pushing out updates simultaneously from one server to a dozen clients. Is that something I'm going to have to wrapper around, say, an NSIS installer building script, or are there hybrid administration/management/installation tools? I'm currently looking at NSIS/WiX as my main contenders with some sort of scripting for filling in the gaps (advice on language for that, too? Windows PowerShell?).\u003c/p\u003e","accepted_answer_id":"390656","answer_count":"2","comment_count":"0","creation_date":"2008-12-23 03:04:09.573 UTC","favorite_count":"1","last_activity_date":"2008-12-24 02:46:57.22 UTC","last_edit_date":"2008-12-24 02:21:33.683 UTC","last_editor_display_name":"Bremen","last_editor_user_id":"2072","owner_display_name":"Bremen","owner_user_id":"2072","post_type_id":"1","score":"2","tags":"release-management|configuration-management","view_count":"788"} +{"id":"11140841","title":"How to write a large number of nested records in JSON with Python","body":"\u003cp\u003eI want to produce a JSON file, containing some initial parameters and then records of data like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n \"measurement\" : 15000,\n \"imi\" : 0.5,\n \"times\" : 30,\n \"recalibrate\" : false,\n {\n \"colorlist\" : [234, 431, 134]\n \"speclist\" : [0.34, 0.42, 0.45, 0.34, 0.78]\n }\n {\n \"colorlist\" : [214, 451, 114]\n \"speclist\" : [0.44, 0.32, 0.45, 0.37, 0.53]\n }\n ...\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow can this be achieved using the Python json module? The data records cannot be added by hand as there are very many.\u003c/p\u003e\n\n\u003cp\u003eEDIT: Solved with help from @Aprillion. Here is the resulting code as in the program:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edata=[]\ni=0\nwhile i\u0026lt;measurement:\n data.append({\"colorlist\" : listcolorlist[i], \"speclist\" : listspeclist[i]})\n i+=1\npython_data = {\n \"measurement\" : measurement,\n \"imi\" : imi,\n \"times\" : times,\n \"recalibrate\" : recalibrate,\n \"data\": data\n}\nprint(json.dumps(python_data, indent=4))\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"11141216","answer_count":"2","comment_count":"7","creation_date":"2012-06-21 14:53:30.07 UTC","last_activity_date":"2015-12-02 22:07:58.47 UTC","last_edit_date":"2015-12-02 22:07:58.47 UTC","last_editor_display_name":"","last_editor_user_id":"4370109","owner_display_name":"","owner_user_id":"1472461","post_type_id":"1","score":"-1","tags":"python|json|records","view_count":"258"} +{"id":"28774274","title":"How to use the string inside brackets","body":"\u003cp\u003eFrom another answer I got this code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eNSURLSession *aSession = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]];\n[[aSession dataTaskWithURL:[NSURL URLWithString:@\"http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml\"] completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\nif (((NSHTTPURLResponse *)response).statusCode == 200) {\n if (data) {\n NSString *contentOfURL = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];\n NSLog(@\"%@\", contentOfURL);\n }\n}\n}] resume];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow I want to use String \"contentOfURL\" outside the brackets and XCode doesn't let me use it... Why? When I want do for example this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eNSURLSession *aSession = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]];\n[[aSession dataTaskWithURL:[NSURL URLWithString:@\"http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml\"] completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\nif (((NSHTTPURLResponse *)response).statusCode == 200) {\n if (data) {\n NSString *contentOfURL = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];\n NSLog(@\"%@\", contentOfURL);\n }\n}\n}] resume];\n\nNSLog(@\"%@\", contentOfURL); //than here it shows me an error...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy question is, how to use String \"contentOfURL\" outside the brackets...\nThank you for questions\u003c/p\u003e","accepted_answer_id":"28776884","answer_count":"2","comment_count":"1","creation_date":"2015-02-27 21:07:22.62 UTC","last_activity_date":"2015-02-28 01:06:13.497 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4614182","post_type_id":"1","score":"0","tags":"ios|objective-c","view_count":"61"} +{"id":"17980397","title":"How do I generate ID when I have composite keys in Doctrine?","body":"\u003cp\u003eI have a \u003ccode\u003eEntity\u003c/code\u003e with composite keys. See below:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass BankAccount {\n\n /**\n * @ORM\\Id\n * @ORM\\Column(type=\"integer\")\n * \n */\n protected $bank;\n\n /**\n * @ORM\\Id\n * @ORM\\ManyToOne(targetEntity=\"CompanyBundle\\Entity\\Company\")\n */\n protected $company;\n\n ...\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebecause Doctrine has some issues with composite keys it won't generates sequences (I'm working in PostgreSQL), how do I deal with this in order to generate \u003ccode\u003e$bank\u003c/code\u003e which is the PK? \u003c/p\u003e","accepted_answer_id":"17985709","answer_count":"1","comment_count":"1","creation_date":"2013-07-31 20:32:17.373 UTC","last_activity_date":"2013-08-01 05:16:17.763 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2238121","post_type_id":"1","score":"0","tags":"symfony|doctrine2|symfony-2.3","view_count":"73"} +{"id":"23025078","title":"Append string to the end of a JSON request in javascript","body":"\u003cp\u003eI am trying to append data data from a form to a request so that the complete URL is sent as the request. I know I can do this in PHP but want to know if I can also do it in the javascript\n For example the json request is sent to \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\"http://api.wunderground.com/api/myapi/conditions/q/ZIP.json\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhere ZIP will be replaced by the user submission\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e $(function() {\n $(\"#getzip\").submit(function() {\n var zip_data =$(this).serialize();\n $.getJSON(\"get_weather.php\",null , function(data); {\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs it possible to pass it in stead of the null? And how would I go about appending it to the request strictly in the javascript?\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2014-04-12 01:40:31.867 UTC","last_activity_date":"2014-04-12 01:53:33.07 UTC","last_edit_date":"2014-04-12 01:46:14.403 UTC","last_editor_display_name":"","last_editor_user_id":"3525721","owner_display_name":"","owner_user_id":"3525721","post_type_id":"1","score":"1","tags":"javascript|php|jquery|json","view_count":"49"} +{"id":"28487309","title":"Assign JavaScript variable value from view to controller variable","body":"\u003cp\u003eI am trying to assign a value from a variable created in JavaScript in my view to a variable in my controller. How can I do that? I am new to CodeIgniter and JavaScript.\u003c/p\u003e\n\n\u003cp\u003eThe idea is that I validate an email input field in my view with JavaScript and then assign that value to a controller variable and then retrieve that value in my controller.\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003e$john_email\u003c/code\u003e is my controller variable and \u003ccode\u003eemail\u003c/code\u003e my JavaScript variable\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$('#submitRequests').click(function(){\nconsole.log(\"Clicked submit\");\nvar data = getTableContent();\nconsole.log(\"machines: \");\nconsole.log(data);\nvar email = $(\"#emailInput\").val();\nif(isEmail(email)){\n $john_email = email; // something like this!\n uploadMachines(data);\n}\nelse \n alert(\"Incorrect email\");\n});\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"3","comment_count":"0","creation_date":"2015-02-12 20:38:25.757 UTC","last_activity_date":"2015-02-13 15:43:34.133 UTC","last_edit_date":"2015-02-12 22:23:12.933 UTC","last_editor_display_name":"","last_editor_user_id":"2468158","owner_display_name":"","owner_user_id":"4552279","post_type_id":"1","score":"0","tags":"javascript|php|codeigniter","view_count":"371"} +{"id":"25098433","title":"How to get a canvas with TRGBTriple?","body":"\u003cp\u003eHello im using this code to get the screen on a canvas\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprocedure GetScreen(var vBitmap : TBitmap);\nvar vDC : hdc;\n vCanvas : TCanvas;\nbegin\n vDC := GetDC(0);\n vCanvas := TCanvas.Create;\n vCanvas.Handle := vDC;\n\n vBitmap.Canvas.CopyRect(Rect(0, 0, Screen.Width, Screen.Height),\n vCanvas,\n Rect(0, 0, Screen.Width, Screen.Height));\n\n vCanvas.Free;\n ReleaseDC(0, vDC);\n\nend;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhich takes about 20 ms to execute, having that i run in each pixel and compare with a given color using this function\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction CompareColor(Color1, Color2 : TRGBTriple): Double;\nvar vR, vG, vB : Byte;\nbegin\n vR := abs(Color1.rgbtRed - Color2.rgbtRed);\n vG := abs(Color1.rgbtGreen - Color2.rgbtGreen);\n vB := abs(Color1.rgbtBlue - Color2.rgbtBlue);\n\n Result := (((vR + vG + vB) / 3) / 255);\nend;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut since i need to convert each TColor to a TRGBTriple \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evCorCmp.rgbtRed := GetRValue(vBitmap.Canvas.Pixels[nX, nY]);\nvCorCmp.rgbtGreen := GetGValue(vBitmap.Canvas.Pixels[nX, nY]);\nvCorCmp.rgbtBlue := GetBValue(vBitmap.Canvas.Pixels[nX, nY]);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ei lose more than a second to convert the entire TCanvas, my question is, how can i get an TRGBTriple array of the screen instead of a TColor array?\u003c/p\u003e","answer_count":"2","comment_count":"15","creation_date":"2014-08-02 19:05:42.363 UTC","last_activity_date":"2014-08-07 08:38:11.527 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3902689","post_type_id":"1","score":"1","tags":"delphi|canvas|graphic","view_count":"929"} +{"id":"5659342","title":"collecting metrics from java applications -parsing byte code","body":"\u003cp\u003eWhat are the advantages and disadvantages of parsing byte code as opposed to parsing source code?\u003c/p\u003e","answer_count":"3","comment_count":"5","creation_date":"2011-04-14 06:19:23.987 UTC","favorite_count":"1","last_activity_date":"2011-04-14 07:51:06.13 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"707365","post_type_id":"1","score":"0","tags":"java","view_count":"735"} +{"id":"9688907","title":"How to refresh UITextField within UITableViewCell after data selection from modal","body":"\u003cp\u003eI have a tableview with UITextFields to build a form. I then have a button in the toolbar which launches a modal view controller to select some data which is then passed back to the tableview. However, the new data that was selected does not get refreshed into the UITextField using textField.text = valueReturnedFromModal syntax. Is there something I'm missing?\u003c/p\u003e\n\n\u003cp\u003eI see that the data is being returned properly from the modal so that is not the issue. I'm just having trouble forcing the UITextField to refresh with the new data. I've tried forcing a reloadData on the tableview as well.\u003c/p\u003e\n\n\u003cp\u003eSo from the modal view, here's the code that passes data back:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e- (void)doneAccountSelection:(id)sender\n{\n [delegate didSelectAccount:currentAccount];\n [self dismissModalViewControllerAnimated:YES];\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand here's the actual method in the delegate:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e- (void)didSelectAccount:(SFAccount *)selectedAccount\n{\n //Ensure a valid deal exists for the account to be attached to\n [self createDealObjectIfNeeded];\n\n //Set the deal account\n [self.deal setAccount:selectedAccount];\n\n //Refresh the text fields\n //Tag 3: Account Name field\n UITextField *acct_name = (UITextField *) [self.view viewWithTag:3];\n [acct_name setText:self.deal.account.field_acct_name_value];\n\n //Tag 4: Account City field\n UITextField *acct_city = (UITextField *) [self.view viewWithTag:4];\n [acct_city setText:self.deal.account.field_acct_city_value];\n\n //Save the context changes. A new deal gets created above if one does not exist.\n if ([self saveModel]) NSLog(@\"Acct object created, attached to deal successfully!\");\n\n [self.tableView reloadData];\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"9707978","answer_count":"3","comment_count":"0","creation_date":"2012-03-13 17:22:25.143 UTC","last_activity_date":"2012-03-14 18:33:19.07 UTC","last_edit_date":"2012-03-14 15:32:26.61 UTC","last_editor_display_name":"","last_editor_user_id":"671233","owner_display_name":"","owner_user_id":"671233","post_type_id":"1","score":"1","tags":"ios|uitableview|uitextfield|modalviewcontroller","view_count":"2151"} +{"id":"37812093","title":"oracle 11g using index on mixed order by statement","body":"\u003cp\u003eCreating the table:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eCREATE TABLE TEST1(\n N1 NUMBER, N2 NUMBER, N3 NUMBER);\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eSo the statement is the following:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eSELECT N3 FROM TEST1\u003c/p\u003e\n \n \u003cp\u003eWHERE N1=:bind\u003c/p\u003e\n \n \u003cp\u003eORDER BY N1 ASC, N2 DESC;\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003einsert into the table some data:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eBEGIN\u003c/p\u003e\n \n \u003cp\u003eFOR i IN 1..200000\u003c/p\u003e\n \n \u003cp\u003eLOOP\u003c/p\u003e\n \n \u003cp\u003eINSERT INTO TEST1 VALUES(\u003c/p\u003e\n \n \u003cp\u003eROUND(DBMS_RANDOM.VALUE(1,20000))\u003c/p\u003e\n \n \u003cp\u003e,ROUND(DBMS_RANDOM.VALUE(1,20000))\u003c/p\u003e\n \n \u003cp\u003e,ROUND(DBMS_RANDOM.VALUE(1,20000))\u003c/p\u003e\n \n \u003cp\u003e);\u003c/p\u003e\n \n \u003cp\u003eEND LOOP;\u003c/p\u003e\n \n \u003cp\u003eEND;\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003enow i have the following indexes:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eCREATE INDEX IND ON TEST1(N1 ASC,N2 DESC);\u003c/p\u003e\n \n \u003cp\u003eCREATE INDEX IND ON TEST1(N1 DESC,N2 ASC);\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eRunning execution plans i noticed that a descending index scan has less cost. \u003cbr\u003e\n\u003ca href=\"http://i.stack.imgur.com/bfacg.png\" rel=\"nofollow\"\u003ehas same order as in the order by\u003c/a\u003e \u003cbr\u003e\n\u003ca href=\"http://i.stack.imgur.com/5rufP.png\" rel=\"nofollow\"\u003ehas reversed order as in the order by\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eMy questions is: does this happen all the time or it's based on the data in the table? (indexed parameters always have to be in the reversed order compared to the order by statement?\u003c/p\u003e","accepted_answer_id":"37812463","answer_count":"1","comment_count":"3","creation_date":"2016-06-14 12:30:22.117 UTC","last_activity_date":"2016-06-14 12:45:52.4 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6464441","post_type_id":"1","score":"2","tags":"oracle|oracle11g","view_count":"46"} +{"id":"5717551","title":"Visual web page segmentation","body":"\u003cp\u003eI have a task where I need to segment a web page visually so that I may be able to calculate the distance between two segments of the web page at various levels of the DOM tree. In the simple way I want to be able to obtain the boxes that enclose the display of the pages on the screen. e.g. consider this image: \u003ca href=\"http://i.stack.imgur.com/BLuic.png\" rel=\"nofollow\"\u003eImage to visual of DOM structure as on display \u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThis I drew using Chrome, which provides for each DOM node the corresponding rectangle on the display of the page in the browser. How can I get these boxes in my program so that I can process the page based upon how it looks on the screen.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2011-04-19 14:00:05.307 UTC","last_activity_date":"2013-01-15 09:17:15.53 UTC","last_edit_date":"2013-01-15 09:17:15.53 UTC","last_editor_display_name":"","last_editor_user_id":"1714410","owner_display_name":"","owner_user_id":"69746","post_type_id":"1","score":"2","tags":"dom|image-segmentation","view_count":"420"} +{"id":"4568616","title":"django: cannot import settings, cannot login to admin, cannot change admin password","body":"\u003cp\u003eIt seems that I am completely lost here. Yesterday I noticed that I cannot login to the admin panel (don't use it much, so it's been some weeks since last login). I thought that I might have changed the admin password and now I can't remember it (though I doubt it).\u003c/p\u003e\n\n\u003cp\u003eI tried django-admin.py changepassword (using django 1.2.1) but it said that 'changepassword' is unknown command (I have all the necessary imports in my settings.py. Admin interface used to work ok).\u003c/p\u003e\n\n\u003cp\u003eThen I gave a django-admin.py validate. Then the hell begun. django-admin.py validate gave me this error: Error: Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined.\u003c/p\u003e\n\n\u003cp\u003eI then gave a set DJANGO_SETTINGS_MODULE=myproject.settings\u003c/p\u003e\n\n\u003cp\u003eand then again a django-admin.py validate\u003c/p\u003e\n\n\u003cp\u003eThis is what I get now: Error: Could not import settings 'myproject.settings' (Is it on sys.path? Does it have syntax errors?): No module named myproject.settings\u003c/p\u003e\n\n\u003cp\u003eand now I am lost. I tried django console and sys.path.append('c:\\workspace') or sys.append('c:\\workspace\\myproject') but still get the same errors.\u003c/p\u003e\n\n\u003cp\u003eI use windows 7 and my project dir is c:\\workspace. I don't use a PYTHONPATH variable (although I tried setting it temporarily to C:\\workspace but I still get the same error). I don't use Apache, just the django development server. \u003c/p\u003e\n\n\u003cp\u003eWhat am I doing wrong? My web page works fine. I think that the fact that I can't login as admin is related to the previous import error, no?\u003c/p\u003e\n\n\u003cp\u003ePS: I also tried this: \u003ca href=\"http://coderseye.com/2007/howto-reset-the-admin-password-in-django.html\" rel=\"nofollow\"\u003ehttp://coderseye.com/2007/howto-reset-the-admin-password-in-django.html\u003c/a\u003e but still I couldn't change admin password for some reason. Although I could create another admin user (with which I couldn't login). \u003c/p\u003e\n\n\u003cp\u003e-EDIT- I forgot to mention that I use postgresql.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2010-12-31 06:48:22.2 UTC","last_activity_date":"2011-11-08 05:44:21.633 UTC","last_edit_date":"2010-12-31 08:38:03.79 UTC","last_editor_display_name":"","last_editor_user_id":"356875","owner_display_name":"","owner_user_id":"356875","post_type_id":"1","score":"1","tags":"django|settings","view_count":"811"} +{"id":"12943531","title":"PUT without data, is it RESTful?","body":"\u003cp\u003eSimple question: what if I'm NOT sending data (content) via HTTP POST/PUT method on my resource — is it still RESTful?\u003c/p\u003e\n\n\u003cp\u003eObviously, the question is in which case would I want use PUT without data. Imagine a user that wants to reset his/her password (like in \u003ca href=\"https://stackoverflow.com/questions/3077229/restful-password-reset\"\u003ethis older topic\u003c/a\u003e).\u003c/p\u003e\n\n\u003cp\u003eWhat do you think of it? Is it okay NOT to send content with POST/PUT methods? Personally I have no problem with it but I'm just curious what would other people say.\u003c/p\u003e","accepted_answer_id":"12943705","answer_count":"2","comment_count":"0","creation_date":"2012-10-17 21:16:57.353 UTC","last_activity_date":"2012-10-18 09:20:56.783 UTC","last_edit_date":"2017-05-23 11:43:40.38 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"597222","post_type_id":"1","score":"7","tags":"http|rest","view_count":"761"} +{"id":"28908529","title":"Remove records based on other record values in R","body":"\u003cp\u003eI have three columns of data: Recipient_ID, Offer_Key, and Response_Code\u003c/p\u003e\n\n\u003cp\u003eWhenever an email is sent, a record is generated with Response_Code = 1\u003c/p\u003e\n\n\u003cp\u003eWhenever an email bounces, the Response_Code = 2, 3, or 4, depending on the type of bounce.\u003c/p\u003e\n\n\u003cp\u003eWhat I want to do is find the bounced email records, remove the corresponding sent email records for each one(with the same Offer_Key), then remove the bounced email records.\u003c/p\u003e\n\n\u003cp\u003eAny ideas?\u003c/p\u003e","accepted_answer_id":"28908819","answer_count":"1","comment_count":"0","creation_date":"2015-03-06 22:09:22.78 UTC","last_activity_date":"2015-03-07 06:59:16.097 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3384596","post_type_id":"1","score":"0","tags":"database|r|record","view_count":"45"} +{"id":"13193872","title":"Core Data, NSPredicate, ANY key.path == nil","body":"\u003cp\u003eI came up with a solution to this using subquery, but I don't understand why what I was trying to do first didn't work.\u003c/p\u003e\n\n\u003cp\u003eHere's my data model. I'm fetching on Advice.\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/vgOE2.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eI can do the following as a predicate:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[NSPredicate predicateWithFormat:@\"ANY conditions.terrain == %@\", aTerrainObject];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethat works fine, and returns any piece of advice where at least one of its conditions has that terrain type.\u003c/p\u003e\n\n\u003cp\u003eHowever, when I try to do this, it fails:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[NSPredicate predicateWithFormat:@\"ANY conditions.terrain == nil\"];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat I want to do is return any piece of advice where at least one of its conditions doesn't have a terrain type set.\u003c/p\u003e\n\n\u003cp\u003eHowever, the following does work:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[NSPredicate predicateWithFormat:@\"SUBQUERY(conditions, $x, $x.terrain == nil).@count \u0026gt; 0\"];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCan anyone explain why, when searching for nil, I can't use the \u003ccode\u003eANY\u003c/code\u003e syntax?\u003c/p\u003e","accepted_answer_id":"13200639","answer_count":"2","comment_count":"1","creation_date":"2012-11-02 10:57:16.99 UTC","favorite_count":"3","last_activity_date":"2012-11-02 17:56:38.13 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"244340","post_type_id":"1","score":"8","tags":"core-data|nspredicate","view_count":"4458"} +{"id":"8019921","title":"Android sqlite from pc","body":"\u003cp\u003eI have a pre-baked sqlite database that I want to use in my Android application.\u003c/p\u003e\n\n\u003cp\u003eI've followed this tutorial: \n\u003ca href=\"http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/\" rel=\"nofollow noreferrer\"\u003ehttp://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eHowever nothing is throwing an exception during the process of building and copying the db,\nbut when I access the db tables, they are not there, like they don't exist.\u003c/p\u003e\n\n\u003cp\u003eI made this sql query:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edatabase.rawQuery(\"SELECT * FROM sqlite_master\", null).getCount();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand I got the answer: 1. (I have 5 tables)\u003c/p\u003e\n\n\u003cp\u003eAny help?\u003c/p\u003e","accepted_answer_id":"8020141","answer_count":"2","comment_count":"1","creation_date":"2011-11-05 11:38:36.62 UTC","last_activity_date":"2016-11-11 15:58:27.85 UTC","last_edit_date":"2016-11-11 15:58:27.85 UTC","last_editor_display_name":"","last_editor_user_id":"4370109","owner_display_name":"","owner_user_id":"906364","post_type_id":"1","score":"0","tags":"android|database|sqlite","view_count":"788"} +{"id":"41583139","title":"Appending Jquery Var to a function URL","body":"\u003cp\u003eHere I would like to append the variable arr_icao and dep_icao to the url\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar arr_icao = document.getElementById(\"arr_icao\").value;\nvar dep_icao = document.getElementById(\"dep_icao\").value;\n\n$.ajax({\n type: 'POST',\n url: \"http://localhost/position/route_finder/\" + arr_icao + dep_icao,\n success: function (data) {\n $(\".route-results\").html(data);\n }\n});\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"4","comment_count":"1","creation_date":"2017-01-11 05:11:43.437 UTC","last_activity_date":"2017-01-11 06:19:02.01 UTC","last_edit_date":"2017-01-11 05:14:14.053 UTC","last_editor_display_name":"","last_editor_user_id":"1288198","owner_display_name":"","owner_user_id":"7188833","post_type_id":"1","score":"-3","tags":"php|html|ajax|codeigniter","view_count":"28"} +{"id":"21124558","title":"Custom Client MessageInspector recording requests but not responses","body":"\u003cp\u003eI have a Custom ClientMessageInspector that records requests but not replies to my service.\u003c/p\u003e\n\n\u003cp\u003eThe code is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enamespace MessageListener.Instrumentation\n{\n public class MessageInspector : IClientMessageInspector\n {\n\n private Message TraceMessage(MessageBuffer buffer)\n {\n // Must use a buffer rather than the original message, because the Message's body can be processed only once.\n Message msg = buffer.CreateMessage();\n\n using (RREM_GilbaneEntities3 entities3 = new RREM_GilbaneEntities3())\n {\n SOAPMessage soapMessages = new SOAPMessage\n {\n SOAPMessage1 = msg.ToString(),\n created = DateTime.Now,\n source = \"Interface12\",\n sourceIP = \"Interface12\"\n };\n entities3.SOAPMessages.Add(soapMessages);\n entities3.SaveChanges();\n }\n\n //Return copy of origonal message with unalterd State\n return buffer.CreateMessage();\n }\n\n public void AfterReceiveReply(ref System.ServiceModel.Channels.Message reply, object correlationState)\n {\n reply = TraceMessage(reply.CreateBufferedCopy(int.MaxValue));\n }\n\n public object BeforeSendRequest(ref System.ServiceModel.Channels.Message request, System.ServiceModel.IClientChannel channel)\n {\n request = TraceMessage(request.CreateBufferedCopy(int.MaxValue));\n return null;\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat seems to be happening is both AfterRecievReply and BeforeSendRequest are being called. In AfterRecieveReply before I call TraceMessage, I can see the whole reply. Inside TraceMessage, when I do:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e// Must use a buffer rather than the original message, because the Message's body can be processed only once.\n\n Message msg = buffer.CreateMessage();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eit turns the reply into junk:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emsg {\u0026lt;soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"\u0026gt;\n \u0026lt;soap:Header /\u0026gt;\n \u0026lt;soap:Body\u0026gt;... stream ...\u0026lt;/soap:Body\u0026gt;\n\u0026lt;/soap:Envelope\u0026gt;}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat's going on?\u003c/p\u003e","accepted_answer_id":"21174892","answer_count":"1","comment_count":"0","creation_date":"2014-01-14 21:39:03.487 UTC","favorite_count":"2","last_activity_date":"2014-01-16 23:16:08.727 UTC","last_edit_date":"2014-01-14 21:46:14.437 UTC","last_editor_display_name":"","last_editor_user_id":"2471435","owner_display_name":"","owner_user_id":"2471435","post_type_id":"1","score":"0","tags":"wcf","view_count":"137"} +{"id":"34534672","title":"How to Remove Border of Bootstrap Carousel","body":"\u003cp\u003eI need to remove the Border of Carousel in Bootstrap here is my work:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e.carousel-indicators .active{ background: #31708f; } \n.content{ margin-top:20px; } \n.adjust1{ float:left; width:100%; margin-bottom:0; } \n.adjust2{ margin:0; } \n.carousel-indicators li{ border :1px solid #ccc; } \n.carousel-control{ color:#31708f; width:5%; } \n.carousel-control:hover, \n.carousel-control:focus{ color:#31708f; } \n.carousel-control.left, .carousel-control.right { background-image: none; } \n.media-object{ margin:auto; margin-top:15%; } \n@media screen and (max-width: 768px) { .media-object{ margin-top:0; } }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm trying to use \"border:0px\" but it doesnt work \u003cbr\u003e\nAny Idea ?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-12-30 17:59:19.817 UTC","last_activity_date":"2015-12-30 18:02:06.847 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2519696","post_type_id":"1","score":"0","tags":"twitter-bootstrap-3|carousel","view_count":"1275"} +{"id":"7167666","title":"Is .append() time-consuming?","body":"\u003cp\u003eI've been manipulating huge text files these days. Sometimes I need to delete lines.\nMy way of doing is like below:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ef=open('txt','r').readlines()\nlist=[]\nfor line in f:\n if blablablabla:\n list.append(line)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI know for large files, .readlines()is rate-limiting step, but what about .append() step? Does append cost lots of extra time after readlines?\nIf so, maybe I should find way to directly delete lines I don't want, instead of appending lines I want.\u003c/p\u003e\n\n\u003cp\u003ethx\u003c/p\u003e","accepted_answer_id":"7167731","answer_count":"5","comment_count":"0","creation_date":"2011-08-23 21:17:26.193 UTC","last_activity_date":"2011-08-24 01:59:57.58 UTC","last_edit_date":"2011-08-23 21:19:03.72 UTC","last_editor_display_name":"","last_editor_user_id":"311207","owner_display_name":"","owner_user_id":"815408","post_type_id":"1","score":"0","tags":"python|append|readlines","view_count":"340"} +{"id":"45904869","title":"Kestrel behind HAproxy or HAproxy and then Apache/Nginx","body":"\u003cp\u003eI have a server that I need to set up for a web site which uses asp. The server runs Ubuntu 16.04 and serves multiple sites using HAproxy. I can get the site running, no problem, but I am not sure if I can have HAproxy work as the only redirection for Kestrel or I should have Apache or Nginx in between as well.\u003c/p\u003e\n\n\u003cp\u003eWhen it comes to Kestrel, it has some known flaws, as can be seen at \u003ca href=\"https://docs.microsoft.com/en-us/aspnet/core/publishing/linuxproduction?tabs=aspnetcore2x\" rel=\"nofollow noreferrer\"\u003eMicrosoft\u003c/a\u003e under \"Securing our application\". Can HAproxy secure the same flaws or should I still use a robust webserver in between?\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-08-27 12:18:19.073 UTC","last_activity_date":"2017-08-27 12:18:19.073 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5230262","post_type_id":"1","score":"1","tags":"haproxy|kestrel-http-server|kestrel","view_count":"33"} +{"id":"36580723","title":"Reading from .txt file and using .startsWith","body":"\u003cp\u003eI am having issues with storing data read from a .txt file, I am trying to store the data depending on what key is at the start of the line. but for some reason it is just printing out the document as it is. \u003c/p\u003e\n\n\u003cp\u003eHere is the code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eFile file = new File(selectedFile.getAbsolutePath());\n\n\n }\n\n if (connectionTab.startsWith(\"Connection: \")) {\n continue;\n }\n\n if (!sca.hasNext()) {\n break;\n }\n\n String connection = sca.next();\n\n\n if (!sca.hasNext()) {\n continue;\n }\n String otherConnection = sca.next();\n\n if (!sca.hasNextDouble()) {\n continue;\n }\n double distance = sca.nextDouble();\n\n\n TrainNetwork.newStation.addConnection(connection, otherConnection, distance);\n System.out.println(connection + \" \" + otherConnection + \" \" + distance);\n\n }\n\n} catch (FileNotFoundException e) {\n System.out.println(\"File not found\");\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"3","creation_date":"2016-04-12 17:57:19.253 UTC","last_activity_date":"2016-04-12 20:47:17.94 UTC","last_edit_date":"2016-04-12 20:47:17.94 UTC","last_editor_display_name":"","last_editor_user_id":"4183674","owner_display_name":"","owner_user_id":"4183674","post_type_id":"1","score":"0","tags":"java","view_count":"31"} +{"id":"10226378","title":"Cakephp 2.1 Form Error","body":"\u003cp\u003eI have just started using cakePHP 2.1. After submiting a form. If there is a validation error how to check the params whether there is an error ?\u003c/p\u003e\n\n\u003cp\u003eBefore we used to do something like \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$this-\u0026gt;data['params'];\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"10227397","answer_count":"2","comment_count":"1","creation_date":"2012-04-19 10:43:32.037 UTC","last_activity_date":"2012-04-20 06:46:49.393 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"155196","post_type_id":"1","score":"0","tags":"cakephp|cakephp-2.1","view_count":"317"} +{"id":"3809811","title":"How to find Gmail mailboxes in other languages","body":"\u003cp\u003eI need to select the 'Sent' and 'Spam' folders in Gmail, but I have an account that does not work. I've found out later that the folders are in non-English language, but it doesn't seem to represent the unicode characters of those language either. Does anybody know how to find out which one is the 'Sent' or 'Spam' folder of a Gmail account?\u003c/p\u003e","accepted_answer_id":"3846248","answer_count":"3","comment_count":"0","creation_date":"2010-09-28 05:03:00.727 UTC","favorite_count":"1","last_activity_date":"2017-04-17 06:57:34.94 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"188912","post_type_id":"1","score":"3","tags":"gmail|imap","view_count":"945"} +{"id":"10272924","title":"How to fix this java.util.Scanner.next, throwing java.util.NoSuchElementException","body":"\u003cp\u003eI am filtering new lines but first time it worked on second loop its failing for \u003ccode\u003eline 2\u003c/code\u003e filering.\u003c/p\u003e\n\n\u003cp\u003eException:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003erun:\na[line 1]l[0]\nException in thread \"main\" java.util.NoSuchElementException\na[line 2]l[1]\na[line 3]l[2]\nb[line 1]l[0]\nb[line 3]l[1]\n at java.util.Scanner.throwFor(Scanner.java:855)\n at java.util.Scanner.next(Scanner.java:1364)\n at ui.Test.main(Test.java:82)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCode:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e// a) Lines\nString a = \"line 1\\n\\r\" +\n \"line 2\\n\\r\" +\n \"line 3\\n\\r\"; \n// b) Total length \nint len = 0; \nScanner sc = new Scanner(a).useDelimiter(\"\\r?\\n\\r|\\\\|\");\nwhile (sc.hasNext()) {\n System.out.println(\"a[\" + sc.next() + \"]l[\" + len + \"]\" ); \n len++;\n}\n\n// c) Prepare array \nString[] value;\nvalue = new String[len+1];\nlen = 0; \nsc = new Scanner(a).useDelimiter(\"\\r?\\n\\r|\\\\|\");\nwhile (sc.hasNext()) {\n System.out.println(\"b[\" + sc.next() + \"]l[\" + len + \"]\" ); \n value[len] = sc.next();\n len++;\n}\n\n// d) Goal - use the value for JComboBox\nSystem.out.println(value);\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"10272942","answer_count":"1","comment_count":"1","creation_date":"2012-04-22 23:02:41.63 UTC","last_activity_date":"2012-04-22 23:06:22.563 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"285594","post_type_id":"1","score":"1","tags":"java|java.util.scanner|jcombobox","view_count":"2194"} +{"id":"34708996","title":"Servlet add dynamically?","body":"\u003cp\u003eI have the following request:\u003c/p\u003e\n\n\u003cp\u003eI want to creat with follow request(POST)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elocalhost:8080/Anwendung/bla?createServlet=machine\u0026amp;input=2\u0026amp;name\u0026amp;state\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ea new „request possibility“ After i executed the above URL i can add with follow POST\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elocalhost:8080/Anwendung/machine?name =\u0026amp;state=off\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ea new machine in a database. Now i can get with a GET request:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elocalhost:8080/Anwendung/machine?name\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethe machine as JSON File.\u003c/p\u003e\n\n\u003cp\u003eMy first idea is that i make for every „request possibility“ a new servlet, which i add dynamically at the runtime. After i made the above example i have „machine.java“, which i compiling and add(hot deployment(??)) in my server(tomcat).\nIt es possible? \nI think there is a better possibility\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2016-01-10 18:10:08.243 UTC","favorite_count":"0","last_activity_date":"2016-01-10 18:10:08.243 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5770509","post_type_id":"1","score":"1","tags":"http|servlets|dynamically-generated","view_count":"22"} +{"id":"136129","title":"Windows Forms: How do you change the font color for a disabled label","body":"\u003cp\u003eI am trying to set the disabled font characteristics for a Label Control. I can set all of the Font characteristics (size, bold, etc), but the color is overridden by the default windows behavior which seems to be one of these two colors:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eIf background color is transparent then ForeColor is same as TextBox disabled Color.\u003c/li\u003e\n\u003cli\u003eIf background color is set to anything else, ForeColor is a Dark Gray color.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eThe image below demonstrates the behavior -- Column 1 is Labels, Column 2 is TextBoxs, and Column 3 is ComboBoxes.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://highplainstech.com/images/testForm.png\"\u003ealt text http://highplainstech.com/images/testForm.png\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eEdit -- Explaining the image: The first two rows are default styles for a label, textbox, and combobox. In the second two rows, I set the Background color to Red and Foreground to White. The disabled font style handling by Microsoft is inconsistent.\u003c/p\u003e","accepted_answer_id":"136265","answer_count":"7","comment_count":"0","creation_date":"2008-09-25 21:05:01.597 UTC","favorite_count":"3","last_activity_date":"2013-06-19 16:31:59.783 UTC","last_edit_date":"2008-09-26 14:06:36.077 UTC","last_editor_display_name":"mistrmark","last_editor_user_id":"19242","owner_display_name":"mistrmark","owner_user_id":"19242","post_type_id":"1","score":"11","tags":"winforms","view_count":"19391"} +{"id":"17466467","title":"How to check with java, if a specific XML Element are existing in a XML Document","body":"\u003cp\u003eI have the following question:\u003c/p\u003e\n\n\u003cp\u003eI would like to check, whether a XML document contains a specific XML element. Is it possible to check, for example with a java method of a specific API, which returns a boolean value, wheter a specific XML element are available in a XML document?\u003c/p\u003e\n\n\u003cp\u003eThis is my XML document as example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;Test xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\u0026gt;\n \u0026lt;ServiceRequest\u0026gt; \n \u0026lt;RequestPayload\u0026gt;\n \u0026lt;LocationInformationRequest\u0026gt;\n \u0026lt;InitialInput\u0026gt;\n \u0026lt;GeoRestriction\u0026gt;\n \u0026lt;Area\u0026gt;\n \u0026lt;PolylinePoint\u0026gt;\n \u0026lt;Longitude\u0026gt;11.0\u0026lt;/Longitude\u0026gt;\n \u0026lt;Latitude\u0026gt;12.0\u0026lt;/Latitude\u0026gt;\n \u0026lt;Altitude\u0026gt;13.0\u0026lt;/Altitude\u0026gt;\n \u0026lt;/PolylinePoint\u0026gt; \n \u0026lt;/Area\u0026gt;\n \u0026lt;/GeoRestriction\u0026gt;\n \u0026lt;/InitialInput\u0026gt;\n \u0026lt;/LocationInformationRequest\u0026gt;\n \u0026lt;/RequestPayload\u0026gt;\n \u0026lt;/ServiceRequest\u0026gt;\n\u0026lt;/Test\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI need the information as a boolean value, wheter the XML element Area are existing or not existing. The XML Document is used in my own java classes as a type of string.\u003c/p\u003e\n\n\u003cp\u003eThanks for help !\u003c/p\u003e","answer_count":"5","comment_count":"0","creation_date":"2013-07-04 09:16:53.223 UTC","favorite_count":"3","last_activity_date":"2013-07-08 12:51:18.5 UTC","last_edit_date":"2013-07-04 09:26:48.4 UTC","last_editor_display_name":"","last_editor_user_id":"831531","owner_display_name":"","owner_user_id":"2504767","post_type_id":"1","score":"8","tags":"java|xml","view_count":"18620"} +{"id":"17939694","title":"Using Valgrind on an Embedded project","body":"\u003cp\u003eCurrently I am working on an Embedded Project. I am using IAR Embedded Workbench IDE and target platform is 8051-based microcontroller. Is it possible to use Valgrind tool to check the code I wrote?\u003c/p\u003e","accepted_answer_id":"17983567","answer_count":"2","comment_count":"3","creation_date":"2013-07-30 06:24:26.523 UTC","favorite_count":"1","last_activity_date":"2013-08-01 01:16:35.527 UTC","last_edit_date":"2013-07-30 08:34:16.61 UTC","last_editor_display_name":"","last_editor_user_id":"1961634","owner_display_name":"","owner_user_id":"720239","post_type_id":"1","score":"5","tags":"embedded|valgrind","view_count":"2271"} +{"id":"24322948","title":"Global variables of function inside function of a class","body":"\u003cpre\u003e\u003ccode\u003eclass Someclass{\n\n function topFunction()\n { \n\n function makeMeGlobal($var)\n {\n global $a, $b;\n\n $a = \"a\".$var;\n $b = \"b\".$var;\n }\n\n makeMeGlobal(1); \n echo \"$a \u0026lt;br\u0026gt;\";\n echo \"$b \u0026lt;br\u0026gt;\";\n\n makeMeGlobal(2); \n echo \"$a \u0026lt;br\u0026gt;\";\n echo \"$b \u0026lt;br\u0026gt;\";\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am using that test code on codeigniter but nothings happen.\u003c/p\u003e\n\n\u003cp\u003eI suppose to print a result like this \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ea1\nb1\na2\nb2 \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow to handle those functions inside a class?\u003c/p\u003e","accepted_answer_id":"24323128","answer_count":"2","comment_count":"0","creation_date":"2014-06-20 08:23:53.693 UTC","last_activity_date":"2014-06-20 08:39:28.5 UTC","last_edit_date":"2014-06-20 08:29:05.247 UTC","last_editor_display_name":"","last_editor_user_id":"3612977","owner_display_name":"","owner_user_id":"1557430","post_type_id":"1","score":"1","tags":"function|codeigniter|global-variables","view_count":"41"} +{"id":"1460136","title":"Why pysqlite does not work properly?","body":"\u003cp\u003eI tried to install pysqlite. Some suspicious things start to appear during the installation. Why I typed:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epython setup.py build\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI got the following message in the end:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esrc/module.c:286: error: ‘SQLITE_PRAGMA’ undeclared here (not in a function)\nsrc/module.c:287: error: ‘SQLITE_READ’ undeclared here (not in a function)\nsrc/module.c:288: error: ‘SQLITE_SELECT’ undeclared here (not in a function)\nsrc/module.c:289: error: ‘SQLITE_TRANSACTION’ undeclared here (not in a function)\nsrc/module.c:290: error: ‘SQLITE_UPDATE’ undeclared here (not in a function)\nsrc/module.c:291: error: ‘SQLITE_ATTACH’ undeclared here (not in a function)\nsrc/module.c:292: error: ‘SQLITE_DETACH’ undeclared here (not in a function)\nsrc/module.c: In function ‘init_sqlite’:\nsrc/module.c:419: warning: implicit declaration of function ‘sqlite3_libversion’\nsrc/module.c:419: warning: passing argument 1 of ‘PyString_FromString’ makes pointer from integer without a cast\nerror: command 'gcc' failed with exit status 1\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI just ignored the last line and decided to continue. So, I typed:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epython setup.py install\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd than, again, I got similar error message:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esrc/module.c:288: error: ‘SQLITE_SELECT’ undeclared here (not in a function)\nsrc/module.c:289: error: ‘SQLITE_TRANSACTION’ undeclared here (not in a function)\nsrc/module.c:290: error: ‘SQLITE_UPDATE’ undeclared here (not in a function)\nsrc/module.c:291: error: ‘SQLITE_ATTACH’ undeclared here (not in a function)\nsrc/module.c:292: error: ‘SQLITE_DETACH’ undeclared here (not in a function)\nsrc/module.c: In function ‘init_sqlite’:\nsrc/module.c:419: warning: implicit declaration of function ‘sqlite3_libversion’\nsrc/module.c:419: warning: passing argument 1 of ‘PyString_FromString’ makes pointer from integer without a cast\nerror: command 'gcc' failed with exit status 1\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAfter that I wanted to try if pysqlite works.\nIf in the python-command-line mode I type\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efrom pysqlite2 import *\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ePython does not complain. However, if I try to follow an exmaple in my book:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efrom pysqlite2 import dbapi2 as sqlite\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI get a error message:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eTraceback (most recent call last):\n File \"\u0026lt;stdin\u0026gt;\", line 1, in \u0026lt;module\u0026gt;\n File \"pysqlite2/dbapi2.py\", line 27, in \u0026lt;module\u0026gt;\n from pysqlite2._sqlite import *\nImportError: No module named _sqlite\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eDoes anybody have any ideas why it happens and how this problem can be solved. By the way, I have installed a new version of Python. \"python -V\" gives me \"Python 2.6.2\". Thank you in advance for any help.\u003c/p\u003e","accepted_answer_id":"1460311","answer_count":"3","comment_count":"1","creation_date":"2009-09-22 13:34:17.853 UTC","last_activity_date":"2010-11-19 04:30:21.963 UTC","last_edit_date":"2009-09-22 13:36:30.27 UTC","last_editor_display_name":"","last_editor_user_id":"6946","owner_display_name":"","owner_user_id":"175960","post_type_id":"1","score":"1","tags":"python|sqlite|installation|pysqlite","view_count":"1489"} +{"id":"11289308","title":"outputting proper complex json format from mysql","body":"\u003cp\u003eI have issues when I attempt to outputting record from mysql for complex json to send back to jquery...\u003c/p\u003e\n\n\u003cp\u003emy table\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ebil iduser name experience\n0 001 jacobs bus driver \n1 002 max painter\n2 001 jacobs racing driver\n3 003 john engineer\n4 001 jacobs retiree\n5 002 max designer\n6 003 john senior engineer\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethe desire json result is should be\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[\n {\n \"iduser\":001,\n \"name\":\"jacobs\", \n \"exprience\":[{\"exp\":\"bus driver\"},{\"exp\":\"racing driver\"},{\"exp\":\"retiree\"}]\n },\n {\n \"iduser\":002,\n \"name\":\"max\", \n \"exprience\":[{\"exp\":\"painter\"},{\"exp\":\"designer\"}]\n }\n]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand sort of....I'm okay with simple json format but this type of complex format I'm totally failed...stuck up here..\u003c/p\u003e\n\n\u003cp\u003ehope someone will shed me some light on how to format it by using php\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2012-07-02 07:22:43.077 UTC","last_activity_date":"2012-07-02 09:16:41.227 UTC","last_edit_date":"2012-07-02 09:16:41.227 UTC","last_editor_display_name":"","last_editor_user_id":"569101","owner_display_name":"","owner_user_id":"637852","post_type_id":"1","score":"0","tags":"jquery|json","view_count":"81"} +{"id":"3507526","title":"Paragraph translation in Python/Django","body":"\u003cp\u003eI translated a site using django i18n, I have no problems for menus, little paragraph, etc..\nThe thing I dont understand is for translating big paragraph. On my site, the admin can write some news by administration page, but he wants them in differents languages.\u003c/p\u003e\n\n\u003cp\u003eI can imagine some methods to do that :\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eone field per langage, but it will be difficult to manage with severals languages (for example news table has title and content, we will have 4 fields ? title_en title_fr content_en content_fr ?\u003c/li\u003e\n\u003cli\u003eupdate the .po file for each new news ?\u003c/li\u003e\n\u003cli\u003ethe real solution ?\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eWhat is the best solution for that ?\u003c/p\u003e\n\n\u003cp\u003eThanks ! (sorry for my english)\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2010-08-17 22:36:01.613 UTC","favorite_count":"1","last_activity_date":"2010-08-18 00:11:23.907 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"423390","post_type_id":"1","score":"1","tags":"python|django|internationalization","view_count":"343"} +{"id":"26385104","title":"AngularJS - Deletion from list lags when using ngAnimate","body":"\u003cp\u003eI am using the \u003ccode\u003engAnimate\u003c/code\u003e module in my project to animate items in my list on a certain condition. The problem is if I use \u003ccode\u003engAnimate\u003c/code\u003e then deletion from list takes a little bit more time than without animation. \u003ca href=\"http://plnkr.co/edit/6wDlTh5xbNzk2H0oeLJe?p=preview\" rel=\"nofollow\"\u003ePlease check the plunker I've created.\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThis is my HTML:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;body ng-app=\"JU\"\u0026gt;\n\u0026lt;div ng-app ng-controller=\"MyCtrl\"\u0026gt;\n \u0026lt;h3\u0026gt;Non Laggin List\u0026lt;/h3\u0026gt;\n \u0026lt;ul\u0026gt;\n \u0026lt;li ng-repeat=\"i in items\" class=\"\"\u0026gt;{{i}}\u0026lt;button ng-click=\"remove($index)\"\u0026gt;Delete\u0026lt;/button\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n \u0026lt;br/\u0026gt;\n \u0026lt;h3\u0026gt;Lagging List\u0026lt;/h3\u0026gt;\n \u0026lt;ul\u0026gt;\n \u0026lt;li ng-repeat=\"i in items2\" class=\"animated error\"\u0026gt;{{i}}\u0026lt;button ng-click=\"remove2($index)\"\u0026gt;Delete\u0026lt;/button\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003c/p\u003e\n\n\u003cp\u003eJS: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar JU = angular.module('JU', [\n 'ngAnimate'\n]);\n\nJU.controller('MyCtrl', ['$scope', function ($scope) {\n $scope.items = [\n 'Hello',\n 'Click',\n 'To Delete',\n 'ME from',\n 'This list'\n ];\n $scope.items2 = [\n 'Hello',\n 'Click',\n 'To Delete',\n 'ME from',\n 'This list'\n ];\n $scope.remove = function (index) {\n $scope.items.splice(index, 1);\n };\n $scope.remove2 = function (index) {\n $scope.items2.splice(index, 1);\n };\n}]);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eDeleting from the first list is fast and responsive. Deletion from the second list feels laggy and unresponsive. I am using an implementation similar to the second list in my code. Is there a way I can fix it?\u003c/p\u003e","accepted_answer_id":"26405505","answer_count":"1","comment_count":"6","creation_date":"2014-10-15 14:30:11.773 UTC","last_activity_date":"2014-10-16 14:26:00.53 UTC","last_edit_date":"2014-10-16 14:26:00.53 UTC","last_editor_display_name":"","last_editor_user_id":"1009603","owner_display_name":"","owner_user_id":"1473556","post_type_id":"1","score":"2","tags":"javascript|css|angularjs|angularjs-ng-repeat|ng-animate","view_count":"454"} +{"id":"18057819","title":"How to model REST URIs from a dynamic XML tree","body":"\u003cp\u003eI'm a newbie with REST approach and I have a challenge to solve with it.\nI have a xml tree on my server and it could be dynamically changed both in deepness and contents at each time.\nThat means I should to find a way to get dynamically the root node A, then its children, for example nodes B-C-D, then the sub-tree associated with node C (nodes C.1,C.2,C.3) and the leaves associated with C.1 that are for example C.1.1 and C.1.2.\nBut In the next time I will have a different xml file and so the nodes of tree will change.\nHow can i model my REST URIs with this dynamic tree structure?\nHave you any suggestions to solve this problem?\u003c/p\u003e\n\n\u003cp\u003eThanks in advance,\u003c/p\u003e\n\n\u003cp\u003eclizia \u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-08-05 12:10:01.013 UTC","last_activity_date":"2013-08-06 07:58:47.76 UTC","last_edit_date":"2013-08-06 07:58:47.76 UTC","last_editor_display_name":"","last_editor_user_id":"1817564","owner_display_name":"","owner_user_id":"1817564","post_type_id":"1","score":"0","tags":"xml|rest|jersey|jquery-dynatree","view_count":"137"} +{"id":"20741862","title":"jQuery get params of onerror event","body":"\u003cp\u003e\u003cstrong\u003eJs code:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ewindow.onerror = function(message, source, lineno)\n {\n alert(\"Ошибка:\"+message +\"\\n\" + \"файл:\" + source + \"\\n\" + \"строка:\" + lineno);\n };\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003ejQuery code:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(window).bind('error', function (event) \n { \n console.log(event); \n //event.data\n //.message ?\n //.lineno ?\n //.source ?\n }\n);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow get \"message\", \"lineno\" and \"source\" values from jQuery-event? \nValue event.data is null.\u003c/p\u003e","answer_count":"0","comment_count":"4","creation_date":"2013-12-23 10:45:21.287 UTC","last_activity_date":"2013-12-23 10:45:21.287 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1706506","post_type_id":"1","score":"1","tags":"jquery|bind|params|onerror","view_count":"831"} +{"id":"15007042","title":"Google closure compiler application using multiple files and how not to print standard output","body":"\u003cp\u003eI'm using Google closure compiler application and can't figure out which of the following commands from the help menu would turn off the printing of standard output.\u003c/p\u003e\n\n\u003cp\u003eI'm combining multiple js files:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecompiler-latest TimPeterson$ java -jar compiler.jar --js assets/js/file1.js \nassets/js/file2.js --js_output_file assets/js/file.min.js\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cem\u003enote:\u003c/em\u003e here's the command to access the help menu\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e compiler-latest TimPeterson$ java -jar compiler.jar --help\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"15068897","answer_count":"2","comment_count":"4","creation_date":"2013-02-21 16:13:56.867 UTC","last_activity_date":"2014-01-08 12:15:03.177 UTC","last_edit_date":"2013-02-21 16:36:55.853 UTC","last_editor_display_name":"","last_editor_user_id":"702275","owner_display_name":"","owner_user_id":"702275","post_type_id":"1","score":"1","tags":"google-closure-compiler","view_count":"1148"} +{"id":"39116869","title":"Epson printer - print two images horizontally from iOS","body":"\u003cp\u003eI downloaded the ios (swift) sdk for epson epos2 printer and I integrate with my application without any problem. Now I can print the images or texts vertically one by one. But my problem is I want to print two image and one text horizaontal. For this format I tried \u003ccode\u003eaddpageArea(x,y,width,height)\u003c/code\u003e \u003ccode\u003eaddpagebegin()\u003c/code\u003e, \u003ccode\u003eaddpageEnd()\u003c/code\u003e and I tried with \u003ccode\u003eaddPagePosition(x,y)\u003c/code\u003e also. These methods also print in vertical format only.\u003c/p\u003e","answer_count":"0","comment_count":"8","creation_date":"2016-08-24 07:22:36.24 UTC","last_activity_date":"2016-08-24 07:38:44.7 UTC","last_edit_date":"2016-08-24 07:38:44.7 UTC","last_editor_display_name":"","last_editor_user_id":"771231","owner_display_name":"","owner_user_id":"4590781","post_type_id":"1","score":"0","tags":"ios|swift|printers|epson","view_count":"181"} +{"id":"3926224","title":"VirtualHost problem","body":"\u003cp\u003eCan someone tell me why I can't view my index.php from the subdir \u003ccode\u003e/oorbellenboutique/\u003c/code\u003e?\u003c/p\u003e\n\n\u003cp\u003eIt shows \u003ccode\u003ehttp:// www.oorbellenboutique.nl/startpagina/index.php\u003c/code\u003e, but it must be the index.php from \u003ccode\u003ef:/inetpub/wwwroot/oorbellenboutique\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eThe correct URL is: \u003ccode\u003ehttp:// www.oorbellenboutique.nl/index.php\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eMy DNS is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eA *.oorbellenboutique.nl → 83.87.163.224\n\nA oorbellenboutique.nl → 83.87.163.224\n\nCNAME www.oorbellenboutique.nl → oorbellenboutique.nl\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy URL is: \u003ca href=\"http://www.oorbellenboutique.nl\" rel=\"nofollow\"\u003ehttp://www.oorbellenboutique.nl\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI'm running Apache 2.x\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eNameVirtualHost 192.168.0.199:80\n\nNameVirtualHost 192.168.0.199:443\n\u003c/code\u003e\u003c/pre\u003e\n\n\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;VirtualHost 192.168.0.199:80 192.168.0.199:443\u0026gt;\nServerName oorbellenboutique.nl\nServerAlias www.oorbellenboutique.nl\nDocumentRoot f:/inetpub/wwwroot/oorbellenboutique\nRewriteEngine On\nKeepAlive Off\nDocumentRoot \"f:/inetpub/wwwroot\"\n \u0026lt;Directory f:/inetpub/wwwroot/oorbellenboutique\u0026gt;\n DirectoryIndex index.php\n Order deny,allow\n Allow from all\n \u0026lt;/Directory\u0026gt;\nRewriteCond %{HTTP_HOST} ^(?:www\\.)?oorbellenboutique\\.nl$\nReWriteRule ^(.*) /oorbellenboutique/$1\n\u0026lt;/virtualhost\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003chr\u003e\n\n\u003cp\u003e\u003cstrong\u003eThis works but the URL is now:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003ehttp:// www.oorbellenboutique.nl/oorbellenboutique/index.php\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eHow can I make the URL shorter like:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003ehttp:// www.oorbellenboutique.nl/index.php\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eNameVirtualHost 192.168.0.199:80\u003c/p\u003e\n\n\u003cp\u003eNameVirtualHost 192.168.0.199:443\u003c/p\u003e\n\n\u003cp\u003e\u0026lt; VirtualHost 192.168.0.199:80 192.168.0.199:443\u003e\u003c/p\u003e\n\n\u003cp\u003eServerName www.oorbellenboutique.nl\u003c/p\u003e\n\n\u003cp\u003eServerAlias *.oorbellenboutique.nl oorbellenboutique.nl\u003c/p\u003e\n\n\u003cp\u003eOptions +FollowSymLinks\u003c/p\u003e\n\n\u003cp\u003eRewriteEngine On\u003c/p\u003e\n\n\u003cp\u003eRewriteCond %{HTTP_HOST} ^(?:www.)?oorbellenboutique.nl$\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;Directory f:/inetpub/wwwroot/oorbellenboutique\u0026gt;\n DirectoryIndex index.html index.php\n Order deny,allow\n Allow from all\n\u0026lt;/Directory\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eRewriteRule ^/$ /oorbellenboutique/ [R]\u003c/p\u003e\n\n\u003cp\u003e\u0026lt; /virtualhost\u003e\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2010-10-13 17:16:24.767 UTC","last_activity_date":"2011-08-10 02:17:20.313 UTC","last_edit_date":"2011-08-10 02:17:20.313 UTC","last_editor_display_name":"","last_editor_user_id":"1288","owner_display_name":"","owner_user_id":"471714","post_type_id":"1","score":"1","tags":"apache|mod-rewrite|virtualhost","view_count":"583"} +{"id":"26065272","title":"How to make a circle with CSS3 around font-awesome icon?","body":"\u003cp\u003eI want to make a css3 circle around the icon that I want to draw. I am using the meyers reset before any other css: \u003ca href=\"http://meyerweb.com/eric/tools/css/reset/reset.css\" rel=\"nofollow\"\u003ehttp://meyerweb.com/eric/tools/css/reset/reset.css\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eand I am unable to get the effect I want. This is my css:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ei {\n display: inline-block;\n -moz-border-radius: 60px;\n -webkit-border-radius: 60px;\n border-radius: 50px;\n -moz-box-shadow: 0px 0px 2px #888;\n -webkit-box-shadow: 0px 0px 2px #888;\n box-shadow: 0px 0px 2px #888;\nborder: 3px solid red;\n}\n\n\u0026lt;i\u0026gt;H\u0026lt;/i\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf possible to make this responsive. What is the best way to do this? \nIf possible, it would be nice to have the circle and text resize on its own as the user resizes\u003c/p\u003e","answer_count":"4","comment_count":"3","creation_date":"2014-09-26 17:37:40.197 UTC","last_activity_date":"2017-06-01 17:51:01.147 UTC","last_edit_date":"2014-09-26 17:43:53.373 UTC","last_editor_display_name":"","last_editor_user_id":"971888","owner_display_name":"","owner_user_id":"971888","post_type_id":"1","score":"2","tags":"css","view_count":"9452"} +{"id":"45568983","title":"Highcharts, set legend height dynamically","body":"\u003cp\u003eI would like to set the height of the legend dynamically, so when the container gets resized, the legend height will be adjusted automatically.\nIdeally, the height of the legend should be half of the height of the charts container.\u003c/p\u003e\n\n\u003cp\u003efiddle: \n\u003ca href=\"https://jsfiddle.net/rredondo/awac1dw8/\" rel=\"nofollow noreferrer\"\u003ehttps://jsfiddle.net/rredondo/awac1dw8/\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eNote that as the container gets smaller, the chart's plot area also becomes smaller until it disappears because the legend is taking up the space. This is the behavior I want to avoid. \nAlso, I tried setting \u003ccode\u003emaxHeight\u003c/code\u003e to some number. The problem with this approach is that it is not dynamic, and it wastes a lot of space if the value is too small.\u003c/p\u003e\n\n\u003cp\u003eThe legend options are:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elegend: {\n align: 'center',\n verticalAlign: 'bottom',\n layout: 'vertical',\n enabled: true,\n //maxHeight: 150\n},\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe layout must be set to vertical, and the legend must be positioned below the chart.\u003c/p\u003e","accepted_answer_id":"45584526","answer_count":"2","comment_count":"0","creation_date":"2017-08-08 12:55:42.613 UTC","last_activity_date":"2017-08-09 10:47:48.21 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4608114","post_type_id":"1","score":"0","tags":"javascript|highcharts|legend","view_count":"195"} +{"id":"18115130","title":"Minified jQuery redirecting to non-minified jquery from Google CDN","body":"\u003cp\u003eI am loading the minified jquery script from Google CDN at //ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js\u003c/p\u003e\n\n\u003cp\u003eHowever, when I load my page on the browser, according to chrome developer tools, it looks as though the standard jquery (non-minified) file is being loaded. Why is this happening? The jquery is also trying to load an image which does not exist (css/images/ui-bg_highlight-soft_100_eeeeee_1x100.png)\u003c/p\u003e","answer_count":"2","comment_count":"1","creation_date":"2013-08-07 22:51:01.19 UTC","last_activity_date":"2014-02-11 09:22:59.207 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1727405","post_type_id":"1","score":"0","tags":"jquery|cdn","view_count":"138"} +{"id":"32401477","title":"PostgreSQL, Groupwise Min and Max values","body":"\u003cp\u003eI have a table like;\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCREATE TABLE public.user_locations\n(\n id integer NOT NULL DEFAULT nextval('user_locations_id_seq'::regclass),\n user_id integer,\n created_at timestamp without time zone,\n location geography(Point,4326),\n cluster_id integer,\n CONSTRAINT user_locations_pkey PRIMARY KEY (id)\n)\nWITH (\n OIDS=FALSE\n);\n\nCREATE INDEX index_user_locations_on_location\n ON public.user_locations\n USING gist\n (location);\n\nCREATE INDEX index_user_locations_on_user_id\n ON public.user_locations\n USING btree\n (user_id);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI would like to get minimum and maximum \u003ccode\u003ecreated_at\u003c/code\u003e values for each cluster for a specific user. So that i will see how long the user stayed in a cluster.\u003c/p\u003e\n\n\u003cp\u003eCurrently i do this;\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT * FROM (\n (\n SELECT DISTINCT ON (cluster_id) * FROM user_locations \n WHERE user_id = 6\n ORDER BY cluster_id, created_at DESC\n )\n UNION\n (\n SELECT DISTINCT ON (cluster_id) * FROM user_locations \n WHERE user_id = 6\n ORDER BY cluster_id, created_at ASC\n )\n) a\nORDER BY cluster_id, created_at\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI think this is not a good solution. Is this the right query for my problem? If not could you suggest better ways to retrieve the minimum and maximum values for each cluster for a specific user?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-09-04 15:18:49.13 UTC","last_activity_date":"2015-09-04 15:59:52.99 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"894705","post_type_id":"1","score":"0","tags":"sql|postgresql","view_count":"105"} +{"id":"22614242","title":"How to handle JSON encoding","body":"\u003cp\u003eI believe that a valid \u003ccode\u003eJSON\u003c/code\u003e does not contain any encoding information (as opposed to XML, for instance). Is it correct ? Does it have any \"standard\" encoding (e.g. \u003ccode\u003eutf-8\u003c/code\u003e) ? How am I supposed to handle the \u003ccode\u003eJSON\u003c/code\u003e encoding ?\u003c/p\u003e","accepted_answer_id":"22614724","answer_count":"2","comment_count":"0","creation_date":"2014-03-24 15:51:43.877 UTC","last_activity_date":"2014-03-24 16:10:58.83 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"521070","post_type_id":"1","score":"1","tags":"json|encoding","view_count":"33"} +{"id":"39166171","title":"Insert linked picture next to text without line break-causing placeholder","body":"\u003cp\u003eOn a Jekyll markdown post, I want to insert a picture \u003cem\u003e(in below picture: red box)\u003c/em\u003e right next to a div \u003cem\u003e(blue)\u003c/em\u003e. In the below picture, the position of the red box is perfect. \u003cstrong\u003eImportant:\u003c/strong\u003e The picture is linked to some text content in the div \u003cem\u003e(here: \"Text of red box\")\u003c/em\u003e. But the way I do this, the box creates a placeholder in the blue div and causes early line breaks. \u003cstrong\u003eHow can I let the red box float next to the div at the height of the anchor in the text without creating the empty space in the div?\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/gWy7u.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/gWy7u.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eHere is the code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eThe grapefruit (Citrus × paradisi) is a \n\u0026lt;span class=\"sidenote\"\u0026gt;\n \u0026lt;cite class=\"quelle\"\u0026gt;\u0026lt;/cite\u0026gt;\n \u0026lt;span\u0026gt;Text of red box\u0026lt;/span\u0026gt;\n\u0026lt;/span\u0026gt;\nsubtropical citrus tree known for its sour to semi-sweet fruit. Grapefruit is a hybrid originating in Barbados as an accidental cross between two.\nThe grapefruit (Citrus × paradisi) is a subtropical citrus tree known for its sour to semi-sweet fruit. The grapefruit (Citrus × paradisi) is a subtropical citrus tree known for its sour to semi-sweet fruit.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd the css:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e.icon-source:before, .sidenote \u0026gt; cite.quelle:before {\n background-size: 45px 45px;\n background-color: red;\n position: relative;\n right: -45px;\n display: inline-block;\n float: right;\n padding-top: -15px;\n width: 45px; \n height: 45px;\n content:\"\";\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"39167051","answer_count":"4","comment_count":"2","creation_date":"2016-08-26 12:17:33.58 UTC","last_activity_date":"2016-08-26 13:11:19.207 UTC","last_edit_date":"2016-08-26 12:55:34.98 UTC","last_editor_display_name":"","last_editor_user_id":"3889242","owner_display_name":"","owner_user_id":"3889242","post_type_id":"1","score":"2","tags":"javascript|jquery|html|css|markdown","view_count":"43"} +{"id":"45442840","title":"jQuery modal not appearing, getting \"Uncaught DOMException: Failed to execute 'appendChild' on 'Node': The new child element contains the parent\"","body":"\u003cp\u003e\u003ca href=\"https://jsfiddle.net/k4hwq7vL/2/\" rel=\"nofollow noreferrer\"\u003eJS Fiddle here.\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eCode in question:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$('#infoTable').click(infoModal);\n\nfunction infoModal(){\n var table = \"THIS IS A TABLE\";\n $(\"#dialogContainer\").dialog({\n appendTo: \"#msg-dialog\",\n autoOpen: false,\n width: 400,\n modal: true,\n resizable: false,\n buttons: {\n close: { text: 'Close', click: function(){\n $(this).dialog(\"close\");\n console.log(\"Thanks for using this!\");\n }\n }\n }\n });\n //Append table variable to dialog box\n $('#msg-dialog').after(table);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm new to using the jQueryUI dialog feature, and I think my approach is wrong here. I'm just trying to get the dialog box to show up, but all I get is the \u003ccode\u003eUncaught DOMException: Failed to execute 'appendChild' on 'Node': The new child element contains the parent\u003c/code\u003e error. As far as I know, the child div element (#msg-dialog) is contained inside the \u003ccode\u003e#dialogContainer\u003c/code\u003e div, not the other way around. Is there something I need to add/remove to get this working?\u003c/p\u003e","accepted_answer_id":"45443004","answer_count":"1","comment_count":"5","creation_date":"2017-08-01 16:14:55.327 UTC","last_activity_date":"2017-08-01 16:22:59.007 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2812650","post_type_id":"1","score":"1","tags":"javascript|jquery|html|css|jquery-ui","view_count":"40"} +{"id":"22553425","title":"Want to remove a space char in an API call where the query requires a space","body":"\u003cp\u003eI am attempting to use www.undata-api.org/ to gather UN Health data. However, if I use their call for getting the available data sets, I get a 404 error:u'Record does not exist'\u003c/p\u003e\n\n\u003cp\u003eGET \u003ca href=\"http://api.undata-api.org/\" rel=\"nofollow\"\u003ehttp://api.undata-api.org/\u003c/a\u003e{organization}/{database}/database_datasets?app_id= {app_id}\u0026amp;app_key={app_key}\u003c/p\u003e\n\n\u003cp\u003ebut the database name is 'WHO Data' -- it has a space in it, and so this call doesn't work. I looked around a bit and saw that people had suggested replacing the space with a '%20' or a +. Neither has worked for me.\u003c/p\u003e\n\n\u003cp\u003eI'm using urllib2 in python for this project.\u003c/p\u003e","accepted_answer_id":"22553486","answer_count":"1","comment_count":"0","creation_date":"2014-03-21 08:12:22.563 UTC","favorite_count":"1","last_activity_date":"2014-03-21 08:15:56.293 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2727875","post_type_id":"1","score":"1","tags":"python|api|urllib2","view_count":"52"} +{"id":"33730353","title":"How to display the confirmed friends","body":"\u003cp\u003eI have a table named user_join:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e| join_to_id | join_by_id | approved |\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e\u003ccode\u003ejoin_to_id\u003c/code\u003e means to whom user sending the request\u003c/p\u003e\n \n \u003cp\u003e\u003ccode\u003ejoin_by_id\u003c/code\u003e means who is sending request\u003c/p\u003e\n \n \u003cp\u003e\u003ccode\u003eapproved\u003c/code\u003e means request accepted or not, if accepted value will be 'Yes' else value will be 'No'\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eNow I want to display the names of those users who APPROVED BY current id user or who APPROVED CURRENT id user.\u003c/p\u003e\n\n\u003cp\u003eHere is my code :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$query = \"SELECT * FROM user_join where (join_to_id = '\".$_GET['id'].\"' and approved = 'Yes' and join_by_id != '\".$_GET['id'].\"' ) \n or (join_by_id = '\".$_GET['id'].\"' and approved = 'Yes' and join_to_id != '\".$_GET['id'].\"') ORDER BY id DESC\";\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"1","creation_date":"2015-11-16 07:32:11.563 UTC","last_activity_date":"2015-11-16 08:25:53.6 UTC","last_edit_date":"2015-11-16 08:14:17.813 UTC","last_editor_display_name":"","last_editor_user_id":"3399252","owner_display_name":"","owner_user_id":"5563731","post_type_id":"1","score":"0","tags":"php|mysql","view_count":"32"} +{"id":"20872436","title":"Generating a Shadow under Xlib Window","body":"\u003cp\u003eapparently the Window Manager (Compiz in my case) handles the drop shadow you see under all Xlib windows in Ubuntu, so communicating to the X Window system won't affect the default shadow generated on a window that I have created in my code. Therefore how do I communicate through my code with Compiz to assign a larger/smaller/different color shadow under the newly created window?\u003c/p\u003e\n\n\u003cp\u003eEdit: I'm using just c++ and the xlib library, not QT\u003c/p\u003e\n\n\u003cp\u003eEdit: The method of talking to the window manager is seeming increasingly complex the more I try, so anyone have any other suggestions? Maybe a second window behind the original with some sort of setup?\u003c/p\u003e","answer_count":"1","comment_count":"7","creation_date":"2014-01-01 19:36:56.653 UTC","last_activity_date":"2014-01-03 23:41:35.677 UTC","last_edit_date":"2014-01-01 21:57:55.777 UTC","last_editor_display_name":"","last_editor_user_id":"1909464","owner_display_name":"","owner_user_id":"1909464","post_type_id":"1","score":"0","tags":"linux|window|shadow|xlib|compiz","view_count":"236"} +{"id":"14193800","title":"Read/Store different types of strings (utf8/utf16/ansi)","body":"\u003cp\u003eI'm parsing a file that among other things contains various strings in different encodings. The way these strings are stored is this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e0xFF 0xFF - block header 2 bytes\n0xXX 0xXX - length in bytes 2 bytes\n0xXX - encoding (can be 0, 1, 2, 3) 1 byte\n... - actual string num bytes per length\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is generally quite easy, however I'm not sure how to deal with encodings. Encoding can be one of:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e0x00 - regular ascii string (that is, actual bytes represent char*)\n0x01 - utf-16 with BOM (wchar_t* with the first two bytes being 0xFF 0xFE or 0xFE 0xFF)\n0x02 - utf-16 without BOM (wchar_t* directly)\n0x03 - utf-8 encoded string (char* to utf-8 strings)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI need to read/store this somehow. Initially I was thinking on simple \u003ccode\u003estring\u003c/code\u003e but that wouldn't work with \u003ccode\u003ewchar_t*\u003c/code\u003e. Then I thought about converting everything to \u003ccode\u003ewstring\u003c/code\u003e, yet this would be quite a bit of unnecessary conversion. The next thing came to mind was \u003ccode\u003eboost::variant\u0026lt;string, wstring\u0026gt;\u003c/code\u003e (I'm already using \u003ccode\u003eboost::variant\u003c/code\u003e in another place in the code). This seems to me to be a reasonable choice. So now I'm a bit stuck with parsing it. I'm thinking somewhere along these lines:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e//after reading the bytes, I have these:\nint length;\nchar encoding;\nchar* bytes;\n\nboost::variant\u0026lt;string, wstring\u0026gt; value;\nswitch(encoding) {\n case 0x00:\n case 0x03:\n value = string(bytes, length);\n break;\n case 0x01:\n value = wstring(??);\n //how do I use BOM in creating the wstring?\n break;\n case 0x02:\n value = wstring(bytes, length \u0026gt;\u0026gt; 1);\n break;\n default:\n throw ERROR_INVALID_STRING_ENCODING;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAs I do little more than print these strings later, I can store UTF8 in a simple \u003ccode\u003estring\u003c/code\u003e without too much bother.\u003c/p\u003e\n\n\u003cp\u003eThe two questions I have are:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003e\u003cp\u003eIs such approach a reasonable one (i.e. using boost::variant)?\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eHow do I create \u003ccode\u003ewstring\u003c/code\u003e with a specific BOM?\u003c/p\u003e\u003c/li\u003e\n\u003c/ol\u003e","accepted_answer_id":"14196283","answer_count":"2","comment_count":"2","creation_date":"2013-01-07 10:14:47.937 UTC","last_activity_date":"2013-01-07 12:47:59.647 UTC","last_edit_date":"2013-01-07 10:20:25.45 UTC","last_editor_display_name":"","last_editor_user_id":"440558","owner_display_name":"","owner_user_id":"717214","post_type_id":"1","score":"1","tags":"c++|string|unicode|byte-order-mark|wstring","view_count":"1368"} +{"id":"37596764","title":"skipuntil including match in Where method","body":"\u003cp\u003eGood day,\u003c/p\u003e\n\n\u003cp\u003eI have below script:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$firstline = \"Some text\"\n$csvpre = $csvimport.Where({ $_ -like \"$firstline\" },'SkipUntil')\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis deletes all rows until, but not including, row equal to \"Some text\"\u003c/p\u003e\n\n\u003cp\u003eIs there a way to also delete the matching row?\u003c/p\u003e\n\n\u003cp\u003eMany thanks\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2016-06-02 15:57:34.227 UTC","last_activity_date":"2016-06-02 15:57:34.227 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5851785","post_type_id":"1","score":"0","tags":"csv|powershell","view_count":"49"} +{"id":"15264367","title":"what's the 'index' term on inspect.getouterframes() function?","body":"\u003cp\u003eI did a \"help(inspect.getouterframes)\" on python, and here's what it gave me:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003egetouterframes(frame, **context**=1)\nGet a list of records for a frame and all higher (calling) frames.\n\nEach record contains a frame object, filename, line number, function\nname, a list of lines of context, and **index within the context**.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm just wondering...what do these \"context\" and \"index\" mean?\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-03-07 06:13:26.397 UTC","favorite_count":"1","last_activity_date":"2013-03-07 07:38:55.893 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1894397","post_type_id":"1","score":"2","tags":"python","view_count":"338"} +{"id":"23511983","title":"Yacc parser for nested while loop","body":"\u003cp\u003ei was trying to code a parser using yacc and lex that count the number of nested loops (while or for).I started the implementation for just while loops.But for some reason the parser gives me an error at the end of a closing brace.\u003c/p\u003e\n\n\u003cp\u003eHere is the code.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e%{\n#include\u0026lt;stdio.h\u0026gt;\n/*parser for counting while loops*/\nextern int yyerror(char* error);\nint while_count=0;\nextern int yylex();\n%}\n\n%token NUMBER\n%token VAR\n%token WHILE\n%%\n\nstatement_list : statement'\\n'\n | statement_list statement'\\n'\n ;\nstatement :\n while_stmt '\\n''{' statement_list '}' \n | VAR '=' NUMBER ';'\n ;\nwhile_stmt :\n WHILE '('condition')' {while_count++;}\n ;\n\ncondition :\n VAR cond_op VAR\n ;\n\ncond_op : '\u0026gt;'\n | '\u0026lt;'\n | '=''='\n | '!''='\n ;\n\n%%\n\nint main(void){\n yyparse();\n printf(\"while count:%d\\n\",while_count);\n}\n\nint yyerror(char *s){\n printf(\"Error:%s\\n\",s);\n return 1;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhat is wrong with that code.And is there a way in yacc to mention optional arguments? like the \"\\n\" after while?\u003c/p\u003e\n\n\u003cp\u003ehere is the lexer code\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e%{\n#include\"y.tab.h\"\n/*lexer for scanning nested while loops*/\n%}\n\n%%\n[\\t ] ; /*ignore white spaces*/\n\n\"while\" {return WHILE;}\n\n[a-zA-Z]+ {return VAR;}\n\n[0-9]+ {return NUMBER;}\n\n'$' {return 0;}\n\n'\\n' {return '\\n' ;}\n\n. {return yytext[0];}\n%%\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eVAR is a variable name with just ascii characters and WHILE is the keyword while.type is not taken into consideration on variable assignments\u003c/p\u003e","answer_count":"1","comment_count":"11","creation_date":"2014-05-07 07:55:45.147 UTC","last_activity_date":"2014-05-08 16:52:45.957 UTC","last_edit_date":"2014-05-07 18:55:54.597 UTC","last_editor_display_name":"","last_editor_user_id":"2811020","owner_display_name":"","owner_user_id":"2811020","post_type_id":"1","score":"1","tags":"parsing|compiler-construction|yacc","view_count":"2977"} +{"id":"19658526","title":"dynamic sql query php with AND","body":"\u003cp\u003eI have some sql code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e $id = \"2000\";\n $model = $_GET[\"model\"]\n\n $result = mysql_query(\"SELECT\n Left(Right(Base.inputs.Data_inf,4),3) As 'Datas',\n count(Base.Data.Data_ID) As `U_Count`\n FROM\n Base.Data\n WHERE\n Product = '$id'\n AND model in ('a','b','c')\n GROUP BY \");\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI would like to make AND part of query to be dynamic. Something like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$m= $model;\nswitch ($m)\n{\n case \"basic\":\n $m = \"AND model in ('a','b','c')\";\n break;\n\n case \"upgrade\":\n $m = \"AND model in ('d','e','f')\";\n break;\n\n default:\n $m = \"AND model in ('a','b','c')\";\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI put $m in the query and it doesn't work:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eWHERE\n Product = '$id'\n '$m'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny suggestion will be appreciated.\u003c/p\u003e","accepted_answer_id":"19658653","answer_count":"3","comment_count":"0","creation_date":"2013-10-29 12:42:03.47 UTC","last_activity_date":"2013-10-29 15:10:19.763 UTC","last_edit_date":"2013-10-29 15:10:19.763 UTC","last_editor_display_name":"","last_editor_user_id":"2885593","owner_display_name":"","owner_user_id":"2885593","post_type_id":"1","score":"0","tags":"php|sql","view_count":"61"} +{"id":"4418606","title":"Clojure's # lambda marco is not always the same as (fn)?","body":"\u003cpre\u003e\u003ccode\u003euser\u0026gt; (map (fn [k] [k]) [1 2 3])\n([1] [2] [3])\nuser\u0026gt; (map #([%1]) [1 2 3])\n.... Error..\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhy is the second example an error?\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2010-12-11 19:46:49.997 UTC","favorite_count":"2","last_activity_date":"2010-12-12 07:37:22.703 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"539114","post_type_id":"1","score":"4","tags":"clojure","view_count":"2108"} +{"id":"46896306","title":"iterate pandas series with geocoders","body":"\u003cp\u003eI'm trying to iterate over a dataframe of international addresses in pandas, pass each row to geocoder, parse, and save the results. However, the same results are being returned for every row and I can't figure out why. When I try an example like \u003ccode\u003e3327 WEST 2ND AVE VANCOUVER BC V6R,1\u003c/code\u003e geocoder parses the value as expected but this iteration doesn't work. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport geocoder\ng = 'GOOGLE_API_KEY'\n\nfor i, row in df.iterrows():\n result = geocoder.google(df, key=g)\n df.set_value(i, 'address', result.address)\n df.set_value(i, 'city', result.city)\n df.set_value(i, 'state', result.state)\n df.set_value(i, 'postal', result.postal)\n df.set_value(i, 'country', result.country)\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"46896653","answer_count":"1","comment_count":"2","creation_date":"2017-10-23 18:39:53.803 UTC","last_activity_date":"2017-10-23 19:01:01.157 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6178749","post_type_id":"1","score":"0","tags":"python|google-maps|pandas|google-geocoder","view_count":"35"} +{"id":"46851685","title":"How to access element of JSON using Qt","body":"\u003cp\u003eI have this Json object and I want to access the \"duration\" and show it on console using Qt : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n \"kind\": \"youtube#videoListResponse\",\n \"etag\": \"\\\"cbz3lIQ2N25AfwNr-BdxUVxJ_QY/brZ0pmrmXldPPKpGPRM-8I4dDFQ\\\"\",\n \"pageInfo\": {\n \"totalResults\": 1,\n \"resultsPerPage\": 1\n },\n \"items\": [\n {\n \"kind\": \"youtube#video\",\n \"etag\": \"\\\"cbz3lIQ2N25AfwNr-BdxUVxJ_QY/PkTW6UN9MH0O2kDApjC3penIiKs\\\"\",\n \"id\": \"WkC18w6Ys7Y\",\n \"contentDetails\": {\n \"duration\": \"PT58M21S\",\n \"dimension\": \"2d\",\n \"definition\": \"hd\",\n \"caption\": \"false\",\n \"licensedContent\": true,\n \"projection\": \"rectangular\"\n }\n }\n ]\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd my Qt code is this :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n QJsonDocument jsonResponse = QJsonDocument::fromJson(message);\n results = jsonResponse.object();\n\n QJsonValue v1 = results.value(\"items\");\n\n qDebug() \u0026lt;\u0026lt; \"v1 = \" \u0026lt;\u0026lt; v1;\n\n QJsonValue v2 = v1.toObject().value(\"contentDetails\");\n\n qDebug() \u0026lt;\u0026lt;\"v2 = \" \u0026lt;\u0026lt; v2;\n\n QString v3 = v2.toObject().value(\"duration\").toString();\n\n qDebug() \u0026lt;\u0026lt; \"v3 = \" \u0026lt;\u0026lt; v3;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever my output is :\u003c/p\u003e\n\n\u003cp\u003ev1 = QJsonValue(array, QJsonArray([{\"contentDetails\":{\"caption\":\"false\",\"definition\":\"hd\",\"dimension\":\"2d\",\"duration\":\"PT58M21S\",\"licensedContent\":true,\"projection\":\"rectangular\"},\"etag\":\"\\\"cbz3lIQ2N25AfwNr-BdxUVxJ_QY/PkTW6UN9MH0O2kDApjC3penIiKs\\\"\",\"id\":\"WkC18w6Ys7Y\",\"kind\":\"youtube#video\"}]))\u003c/p\u003e\n\n\u003cp\u003ev2 = QJsonValue(undefined)\u003c/p\u003e\n\n\u003cp\u003ev3 = \"\"\u003c/p\u003e\n\n\u003cp\u003eSo v1 is fine but v2 becomes undefined.What am I doing wrong and how can I access the \"duration\" item correctly?\u003c/p\u003e","accepted_answer_id":"46852655","answer_count":"2","comment_count":"0","creation_date":"2017-10-20 14:47:33.68 UTC","last_activity_date":"2017-10-20 15:42:49.34 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"8712563","post_type_id":"1","score":"0","tags":"c++|json|qt|youtube-api|qjsonobject","view_count":"63"} +{"id":"31176233","title":"How can I access the array saved in the for loop? (objective c)","body":"\u003cpre\u003e\u003ccode\u003e-(void) queryRestuarantsName {\n\nNSMutableArray* restaurantNameArray = [[NSMutableArray alloc] init];\n\nPFQuery *query = [PFQuery queryWithClassName:@\"Menus\"];\n[query selectKeys: @[@\"Resturant\", @\"Description\", @\"Name\"]];\nquery.limit = 1000000;\n\n[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {\n\n\n for (PFObject *object in objects) {\n\n NSString* restaurant = [object objectForKey: @\"Resturant\"];\n [restaurantNameArray addObject:restaurant];\n\n } \n}];\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCurrently, outside of the for loop, \u003ccode\u003erestaurantNameArray\u003c/code\u003e is said to be empty. However, in the for loop, it has objects. How can I access the objects outside of the loop?\u003c/p\u003e","answer_count":"3","comment_count":"2","creation_date":"2015-07-02 05:28:21.233 UTC","last_activity_date":"2015-07-02 06:00:46.69 UTC","last_edit_date":"2015-07-02 05:47:33.703 UTC","last_editor_display_name":"","last_editor_user_id":"4536708","owner_display_name":"","owner_user_id":"5072260","post_type_id":"1","score":"0","tags":"ios|objective-c|parse.com","view_count":"86"} +{"id":"42904026","title":"join two pivot tables","body":"\u003cp\u003eI have two queries in MS SQL Server 2012 :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e**Query for Uploads:** \nselect Contract_Code, [201612] as '201612',[201701] as '201701', [201702] as '201702' from (select OrderID, Creation_Date_YYYYMM, Contract_Code from Raw_Data_A) p\n pivot(count(OrderID) for Creation_Date_YYYYMM in ([201612],[201701],[201702])) as pvt\n order by Contract_Code\n\n\n**Query for REal Orders:** \nselect Contract_Code, [201612] as '201612',[201701] as '201701', [201702] as '201702' from (select OrderID, concat(year([Creation_Date]),format([Creation_date],'MM')) as Creation_Date_YYYYMM, Contract_Code from Raw_Data_B) p2\n pivot(count(OrderID) for Creation_Date_YYYYMM in ([201612],[201701],[201702])) as pvt\n order by Contract_Code\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethat each produce results like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eContract_Code 201612 201701 201702\nContract1 3 1 0\nContract2 17 0 6\nContract3 23 8 14\nContract4 48 45 6\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI would like to join them in order to achieve the following output:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e 201612 201701 201702 \nContractNameRealUploadRealUploadRealUpload\nContract1 23 24 35 26 27 28\nContract2 24 45 36 26 27 28\nContract3 25 45 37 26 27 28\nContract4 26 45 38 26 27 28\nContract5 27 45 39 26 27 28\nContract6 28 45 40 26 27 28\nContract7 29 45 41 26 27 28\nContract8 30 45 42 26 27 28\nContract9 31 45 43 26 27 28\nContract10 32 45 44 26 27 28\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHope you can help me. Thanks\u003c/p\u003e","accepted_answer_id":"42947638","answer_count":"1","comment_count":"0","creation_date":"2017-03-20 12:47:16.04 UTC","last_activity_date":"2017-03-22 09:37:15.143 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7734653","post_type_id":"1","score":"0","tags":"join|pivot","view_count":"37"} +{"id":"29260307","title":"Django - Exclude options from ModelChoiceField","body":"\u003cp\u003eI am having a hard time trying to exclude choices from a ModelChoiceField using queryset. I am not very experienced with django and python, your help would be very appreciated.\u003c/p\u003e\n\n\u003cp\u003eI am trying to make a form to assign users to a project.\nI use an inlineformset and I'd like to remove the users that are already assigned to this project from the user combobox in the formset.\u003c/p\u003e\n\n\u003cp\u003eThe ModelForm:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass ProjectUserForm(forms.ModelForm):\n user = forms.ModelChoiceField(queryset=User.objects.all())\n\n def __init__(self, *args, **kwargs):\n project = kwargs.pop('project', None)\n super(ProjectUserForm, self).__init__(*args, **kwargs)\n\n if project:\n self.fields['user'].queryset = User.objects.exclude(project=project)\n\n class Meta:\n model = ProjectUser\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe View:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@login_required\ndef project_update(request, pk):\n if pk is None:\n project = Project()\n else:\n project = Project.objects.get(id=pk)\n\n ProjectUserFormset = inlineformset_factory(Project, ProjectUser,\n form=ProjectUserForm(project=project),\n extra=0,\n max_num=User.objects.count(),\n fk_name='project',\n can_delete=False,\n )\n\n if request.method == 'POST':\n project_form = ProjectForm(\n request.POST,\n instance=project\n )\n project_user_formset = ProjectUserFormset(\n request.POST,\n instance=project,\n prefix='project_user'\n ) \n if project_form.is_valid() and project_user_formset.is_valid():\n project = project_form.save(commit=False)\n project_user_formset.save()\n project.save()\n\n else:\n project_form = ProjectForm(instance=project)\n project_user_formset = ProjectUserFormset(\n instance=project,\n prefix='project_user'\n )\n\n return render(request, \"Nexquality/project_form.html\", {\n 'title': 'Modify project: '+project.name,\n 'form': project_form,\n 'project_user_formset': project_user_formset,\n })\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"29260467","answer_count":"1","comment_count":"0","creation_date":"2015-03-25 15:46:26.593 UTC","last_activity_date":"2015-03-25 15:53:13.1 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4712850","post_type_id":"1","score":"0","tags":"python|django|web|frameworks","view_count":"76"} +{"id":"6109490","title":"Cell-Based Liquid Simulation: Local pressure model?","body":"\u003cp\u003eI'm attempting to add semi-realistic water into my tile-based, 2D platformer. The water must act somewhat lifelike, with a pressure model that runs entirely local. (IE. Can only use data from cells near it) This model is needed because of the nature of my game, where you cannot be certain that the data you need isn't inside an area that isn't in memory.\u003c/p\u003e\n\n\u003cp\u003eI've tried one method so far, but I could not refine it enough to work with my constraints.\u003c/p\u003e\n\n\u003cp\u003eFor that model, each cell would be slightly compressible, depending on the amount of water in the above cell. When a cell's water content was larger than the normal capacity, the cell would try to expand upwards. This created a fairly nice simulation, abeit slow (Not lag; Changes in the water were taking a while to propagate.), at times. When I tried to implement this into my engine, I found that my limitations lacked the precision required for it to work. I can provide a more indepth explanation or a link to the original concept if you wish.\u003c/p\u003e\n\n\u003cp\u003eMy constraints:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eOnly 256 discrete values for water level. (No floating point variables :( ) -- EDIT. Floats are fine.\u003c/li\u003e\n\u003cli\u003eFixed grid size.\u003c/li\u003e\n\u003cli\u003e2D Only.\u003c/li\u003e\n\u003cli\u003eU-Bend Configurations must work.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eThe language that I'm using is C#, but I can probably take other languages and translate it to C#.\u003c/p\u003e\n\n\u003cp\u003eThe question is, can anyone give me a pressure model for water, following my constraints as closely as possible?\u003c/p\u003e","accepted_answer_id":"6194949","answer_count":"3","comment_count":"14","creation_date":"2011-05-24 11:09:47.163 UTC","favorite_count":"2","last_activity_date":"2011-06-01 12:52:24.62 UTC","last_edit_date":"2011-05-27 21:08:05.717 UTC","last_editor_display_name":"","last_editor_user_id":"356778","owner_display_name":"","owner_user_id":"356778","post_type_id":"1","score":"11","tags":"c#|simulation","view_count":"3134"} +{"id":"34552246","title":"Import .jsx files with SystemJS","body":"\u003cp\u003eSince the JSX plugin is deprecated I've been struggling to have Babel handle my jsx files. I finally managed to convince SystemJS to load my app with:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e System.import('scripts/app.jsx!babel')\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut this doesn't import any imported jsx files like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport Login from './components/Login' // File is Login.jsx\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWith the old plugin this worked but now I am not sure how to get it working now.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-12-31 22:54:28.647 UTC","last_activity_date":"2016-01-07 21:54:00.49 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"856498","post_type_id":"1","score":"0","tags":"babeljs|systemjs","view_count":"221"} +{"id":"44778816","title":"Python, Google Calendar define a datezone","body":"\u003cp\u003eI am getting a list of my Google Calendar, but I want to restrict the collection in a datezone. I have a \"now\" like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enow = datetime.datetime.utcnow().isoformat() + 'Z'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd I want something like this :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eend = the end of the day of now\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut I don't know how to do it, have you any idea ?\nI am using the list like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eresponse = calendar.events().list(calendarId='primary', timeMin=now).execute()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThank you !\u003c/p\u003e","accepted_answer_id":"44778927","answer_count":"1","comment_count":"0","creation_date":"2017-06-27 11:10:56.88 UTC","last_activity_date":"2017-06-27 11:17:18.77 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6784511","post_type_id":"1","score":"0","tags":"python|date|google-calendar","view_count":"49"} +{"id":"27284251","title":"Vector tiles with Google Maps V3","body":"\u003cp\u003eI have a bunch of very large polygons that I'd like to overlay on my Google map. I have a tile server that serves GeoJSON features, and which also takes care of the various geometric operations I need to make the app work (joining polygons, simplification to zoom level, tiling, etc).\u003c/p\u003e\n\n\u003cp\u003eAt present, we're just displaying the large polygons on the map as data layers, but ideally we'd be able to display simplified versions of the polygons at lesser zoom levels and increase their complexity inline with zoom level.\u003c/p\u003e\n\n\u003cp\u003eMy options seem to be:\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003e1) Data Layers\u003c/strong\u003e: hook into the various map change events and then add/remove from the map as appropriate (where adding would be fetching the appropriate tile). Difficulty here would be that there seem to be a lot of map change events and finding the smoothest way to achieve could take considerable effort. Plus, it feels as though I'm working against the data API here.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003e2) OverlayView\u003c/strong\u003e: similar to the above, but as an absolute sized OverlayView (i.e. a full covering). The thinking would be that the overlay would listen to draw events, fetch the appropriate tile, and add/clean-up as required. This seems like it'd be a more predictable solution, but again there's a lot to it. \u003c/p\u003e\n\n\u003cp\u003eI don't know enough about how maps works under-the-hood to provide much more insight, but my eventual solution (in so much as it helps) would be something that takes a tile server URL and then fits as smoothly as possible into how maps works to load the right tile, for the right zoom level (and given they're vector tiles, I could possibly also progressively enhance/degrade as zoom levels or position changed).\u003c/p\u003e\n\n\u003cp\u003eCan anyone shed any insight? How would you approach it?\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2014-12-04 00:31:35.8 UTC","favorite_count":"6","last_activity_date":"2015-11-17 15:14:09.973 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1993954","post_type_id":"1","score":"11","tags":"google-maps|google-maps-api-3","view_count":"3106"} +{"id":"22746407","title":"Make footer stay at bottom","body":"\u003cp\u003eHi I want a footer to always stay at the bottom of the page. If I use:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#footer {\n position:fixed;\n bottom:0\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI get a footer that will overlap my content div (if it gets to long). So is there any way to get to footer at the bottom of the page even if I don't have enough content in the div above? Like have a div that expands if the content div is to short? I know that this question must have been asked before but I can't find a good answer.\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e\n\n\u003cp\u003eedit:\u003c/p\u003e\n\n\u003cp\u003eI probably was not clear enough,\u003c/p\u003e\n\n\u003cp\u003eright now my website looks like this:\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/MtdK1.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003ewith whitespace under the footer, which I don't want.\u003c/p\u003e\n\n\u003cp\u003eI want it to be like this:\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/AnGdP.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003ethe footer at the bottom, but if I use the code that you guys provided then I get a problem when I have more content.\u003c/p\u003e\n\n\u003cp\u003eSo when I have more content I want my footer to act like in the first pic or like this:\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/o8i3A.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eSo that my content will push down the footer.\u003c/p\u003e\n\n\u003cp\u003eThanks! :)\u003c/p\u003e","answer_count":"3","comment_count":"2","creation_date":"2014-03-30 16:18:52.43 UTC","last_activity_date":"2014-04-06 15:59:59.367 UTC","last_edit_date":"2014-04-06 15:59:59.367 UTC","last_editor_display_name":"","last_editor_user_id":"3082887","owner_display_name":"","owner_user_id":"3082887","post_type_id":"1","score":"0","tags":"html|css|footer","view_count":"114"} +{"id":"12115049","title":"VS 2010 setup project, Properties | Prerequisites doesn't show VC++ Runtime x64 libs","body":"\u003cp\u003eVisual Studio 2010 Professional,\ntarget framework/platform: .Net 4/x64 \u003c/p\u003e\n\n\u003cp\u003eI built a setup project for my application, and when opening its Properties and then Prerequisites, I do not see \"Visual C++ 2010 Runtime Libraries (x64)\" listed. The x86 version \u003cem\u003eis\u003c/em\u003e listed in Prerequisites, however. Both the vcredist_x86 and vcredist_x64 directories have been confirmed as existing in:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eC:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\Bootstrapper\\Packages\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have confirmed this on two different development machines, and with different solutions having setup projects.\u003c/p\u003e\n\n\u003cp\u003eThe GenericBootstrapper path for 4.0 in\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eHKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\GenericBootstrapper\\4.0\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ehas been confirmed as pointing to the correct directory.\u003c/p\u003e\n\n\u003cp\u003eWhen going though the registry entries for the packages in\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eHKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Installer\\Folders\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI noticed that paths for the x86 redistributable were present\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\Bootstrapper\\Packages\\vcredist_x86\\\n C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\Bootstrapper\\Packages\\vcredist_x86\\en\\\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut the paths for the x64 package were \u003cem\u003enot\u003c/em\u003e present. I added the two x64 paths as String Values to the folders directory (I've successfully done this before when building new packages, in order to have new packages appear in the prerequisites listing), but still no luck.\u003c/p\u003e\n\n\u003cp\u003eAny thoughts?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2012-08-24 18:48:51.61 UTC","last_activity_date":"2012-09-05 16:37:18.67 UTC","last_edit_date":"2012-08-24 19:22:49.973 UTC","last_editor_display_name":"","last_editor_user_id":"1623351","owner_display_name":"","owner_user_id":"1623351","post_type_id":"1","score":"1","tags":"visual-studio-2010|64bit|visual-c++-2010|prerequisites","view_count":"1087"} +{"id":"28498807","title":"How test if _ensureIndex is working?","body":"\u003cp\u003eIs there some way to display the index – and see if it is working? Thanks!\u003c/p\u003e\n\n\u003cp\u003eI'm building it at startup:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e// create a compound index\nif (Meteor.isServer) {\n Meteor.startup(function() {\n MyPix.files._ensureIndex({'metadata.tags': 1, 'original.name': 1, 'uploadedAt': -1})\n })\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"3","comment_count":"0","creation_date":"2015-02-13 11:42:04.16 UTC","last_activity_date":"2015-02-15 11:06:40.79 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1051251","post_type_id":"1","score":"0","tags":"javascript|mongodb|meteor","view_count":"265"} +{"id":"44823961","title":"react-datetime + set interval in React","body":"\u003cp\u003eI am using react-datetime control for npm package :\u003ca href=\"https://www.npmjs.com/package/react-datetime\" rel=\"nofollow noreferrer\"\u003eclick here\u003c/a\u003e.\nIn that time picker how should I set Interval. For example I want to set interval in every 5 minutes so first show 0 then 5,10,15 etc. how can I achive this?\u003c/p\u003e\n\n\u003cp\u003eI am using look like this but not working :\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/wSupR.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/wSupR.png\" alt=\"Example\"\u003e\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"44824046","answer_count":"1","comment_count":"2","creation_date":"2017-06-29 11:32:28.947 UTC","last_activity_date":"2017-06-29 11:49:57.503 UTC","last_edit_date":"2017-06-29 11:49:01.303 UTC","last_editor_display_name":"","last_editor_user_id":"5514754","owner_display_name":"","owner_user_id":"5514754","post_type_id":"1","score":"1","tags":"reactjs|datetime|npm|react-datetime","view_count":"62"} +{"id":"17613518","title":"one function accepts different models and dynamically creates object according to that in django","body":"\u003cp\u003eI want to create a function like\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef dynamic_model(model_name,**kwargs)\n obj=model_name.object.create(**dct)\n return obj\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebecause I don't want to do again and again create object and save them in database.you pass model name in function and object create according to passed **kwargs. How I import path runtime and what would be the body of function.\u003c/p\u003e\n\n\u003cp\u003e*\u003cem\u003eAnd main thing I don't know which model and from where it import .all things get visible me at runtime so how can I import the path regarding to model name in function *\u003c/em\u003e\u003c/p\u003e","answer_count":"2","comment_count":"3","creation_date":"2013-07-12 11:05:59.683 UTC","last_activity_date":"2013-12-06 10:32:12.1 UTC","last_edit_date":"2013-12-06 10:32:12.1 UTC","last_editor_display_name":"","last_editor_user_id":"759866","owner_display_name":"","owner_user_id":"2576049","post_type_id":"1","score":"0","tags":"django|function|python-2.7|import","view_count":"112"} +{"id":"1763753","title":"Can .local files be used during VB6 compile to avoid registering COM ocx and dll files","body":"\u003cp\u003eIn an attempt to keep my build machine clean can .local files be used during the compile of an application or is there a better way to keep the bloat off the machine.\u003c/p\u003e","accepted_answer_id":"1764418","answer_count":"1","comment_count":"0","creation_date":"2009-11-19 14:41:25.75 UTC","favorite_count":"2","last_activity_date":"2009-11-19 16:05:48.027 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"117527","post_type_id":"1","score":"4","tags":"com|vb6|build","view_count":"575"} +{"id":"19512033","title":"How to find Nearest Locations in Google Maps with radius and a particular area(without having Latitude \u0026 Longitude) as parameters in Asp.Net","body":"\u003cp\u003eHi i am trying to get the near by locations of a particular area surrounding 3 kms distance. \u003c/p\u003e\n\n\u003cp\u003eHere i am passing two parameters, \n1) one is radius i.e; surrounding 3 kms distance.\n2) second is particular area without having latitude and longitudes values.\u003c/p\u003e\n\n\u003ch2\u003eFor Example:\u003c/h2\u003e\n\n\u003cp\u003eI have Countries, States, Cities and Areas in by SQL Server database.\u003c/p\u003e\n\n\u003cp\u003eI have 4 dropdowns boxes for selecting above data.\u003c/p\u003e\n\n\u003cp\u003eNow i will select Country-India, State-A.P, City-Hyderabad, Area-Banjara Hills. \u003c/p\u003e\n\n\u003cp\u003eI need to get my output with areas surrounding 3 kms from selected area.\u003c/p\u003e\n\n\u003cp\u003eCan anyone Please help me in solving this Problem.\u003c/p\u003e\n\n\u003cp\u003eThanks, Chakri.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-10-22 07:49:03.563 UTC","last_activity_date":"2013-10-22 08:04:17.303 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2905833","post_type_id":"1","score":"0","tags":"asp.net|google-maps","view_count":"1091"} +{"id":"38818379","title":"Adding reactive.rb to project","body":"\u003cp\u003eI have a trouble with adding react.rb to my project.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eAt first,\u003c/strong\u003e \u003ca href=\"https://github.com/reactrb/todo-tutorial\" rel=\"nofollow\"\u003eafter all steps\u003c/a\u003e with adding \u003ccode\u003ereactive_rails_generator\u003c/code\u003e is done, and i started my app, i have got the error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eActionView::Template::Error (undefined method `load_asset' for Opal::Sprockets:Module):\n\n\u0026lt;%= javascript_include_tag 'application', 'data-turbolinks-track' =\u0026gt; true %\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eapp/views/layouts/grid/layout.html.erb:15:\u003c/p\u003e\n\n\u003cp\u003eI see all need gem's In Gemfile to work with react.rb\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003egem 'reactive-ruby' gem 'react-rails', '~\u0026gt; 1.3.0' gem 'opal-rails' gem 'therubyracer', platforms: :ruby gem 'react-router-rails', '~\u0026gt;0.13.3' gem 'reactive-router' gem 'reactive-record'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCan anyone help with that?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eAt second,\u003c/strong\u003e i have a rake task message:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eWarning:[rake --tasks] DEPRECATION WARNING: Sprockets method `register_engine` is deprecated.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ePlease register a mime type using \u003ccode\u003eregister_mime_type\u003c/code\u003e then\nuse \u003ccode\u003eregister_compressor\u003c/code\u003e or \u003ccode\u003eregister_transformer\u003c/code\u003e.\n\u003ca href=\"https://github.com/rails/sprockets/blob/master/guides/extending_sprockets.md#supporting-all-versions-of-sprockets-in-processors\" rel=\"nofollow\"\u003ehttps://github.com/rails/sprockets/blob/master/guides/extending_sprockets.md#supporting-all-versions-of-sprockets-in-processors\u003c/a\u003e\n(called from at /Users/serzh/.rvm/gems/ruby-2.3.1@global/gems/opal-0.8.0/lib/opal/sprockets/processor.rb:165)\nDEPRECATION WARNING: Sprockets method \u003ccode\u003eregister_engine\u003c/code\u003e is deprecated.\nPlease register a mime type using \u003ccode\u003eregister_mime_type\u003c/code\u003e then\nuse \u003ccode\u003eregister_compressor\u003c/code\u003e or \u003ccode\u003eregister_transformer\u003c/code\u003e.\n\u003ca href=\"https://github.com/rails/sprockets/blob/master/guides/extending_sprockets.md#supporting-all-versions-of-sprockets-in-processors\" rel=\"nofollow\"\u003ehttps://github.com/rails/sprockets/blob/master/guides/extending_sprockets.md#supporting-all-versions-of-sprockets-in-processors\u003c/a\u003e\n(called from at /Users/serzh/.rvm/gems/ruby-2.3.1@global/gems/opal-0.8.0/lib/opal/sprockets/processor.rb:166)\nDEPRECATION WARNING: Sprockets method \u003ccode\u003eregister_engine\u003c/code\u003e is deprecated.\nPlease register a mime type using \u003ccode\u003eregister_mime_type\u003c/code\u003e then\nuse \u003ccode\u003eregister_compressor\u003c/code\u003e or \u003ccode\u003eregister_transformer\u003c/code\u003e.\n\u003ca href=\"https://github.com/rails/sprockets/blob/master/guides/extending_sprockets.md#supporting-all-versions-of-sprockets-in-processors\" rel=\"nofollow\"\u003ehttps://github.com/rails/sprockets/blob/master/guides/extending_sprockets.md#supporting-all-versions-of-sprockets-in-processors\u003c/a\u003e\n(called from at /Users/serzh/.rvm/gems/ruby-2.3.1@global/gems/opal-0.8.0/lib/opal/sprockets/erb.rb:23)\u003c/p\u003e","accepted_answer_id":"38834236","answer_count":"2","comment_count":"5","creation_date":"2016-08-07 20:44:46.42 UTC","last_activity_date":"2016-08-08 16:27:58.127 UTC","last_edit_date":"2016-08-07 22:04:09.787 UTC","last_editor_display_name":"","last_editor_user_id":"1334421","owner_display_name":"","owner_user_id":"1334421","post_type_id":"1","score":"0","tags":"ruby-on-rails|react.rb","view_count":"144"} +{"id":"17155554","title":"what are difference of int initialize values?","body":"\u003cp\u003eI had some confusions about \u003ca href=\"https://stackoverflow.com/questions/17147553/int-num-new-int-what-happens-when-this-line-executes\"\u003e\u003cstrong\u003ethis thread\u003c/strong\u003e\u003c/a\u003e.\u003c/p\u003e\n\n\u003cp\u003eWhat are differences between these terms? When should I use what?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eint x = default(int);\nint x = 0;\nint x = new int(); \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI read here in \u003cstrong\u003e\u003ca href=\"http://bytes.com/topic/c-sharp/answers/662786-int-n-default-system-int32\" rel=\"nofollow noreferrer\"\u003ethis thread\u003c/a\u003e\u003c/strong\u003e. \u003c/p\u003e","answer_count":"3","comment_count":"4","creation_date":"2013-06-17 19:47:41.203 UTC","last_activity_date":"2017-07-30 02:34:45.9 UTC","last_edit_date":"2017-07-30 02:34:45.9 UTC","last_editor_display_name":"","last_editor_user_id":"1033581","owner_display_name":"","owner_user_id":"2469282","post_type_id":"1","score":"1","tags":"c#","view_count":"127"} +{"id":"22458853","title":"Powershell - How to use webclient login a webpage (Cacti)","body":"\u003cp\u003eDoes anyone know how to use webclient to login Cacti?\u003cbr\u003e\nI am trying to use PowerShell to log into a website (Realm : Local).\u003cbr\u003e\nHowever I stuck on login page.\u003cbr\u003e\n\u003cimg src=\"https://i.stack.imgur.com/retRW.jpg\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eHtml code for this page : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;tr\u0026gt;\n \u0026lt;td colspan=\"2\"\u0026gt;Please enter your user name and password below:\u0026lt;/td\u0026gt;\n\u0026lt;/tr\u0026gt;\n\u0026lt;tr style=\"height: 10px;\"\u0026gt;\u0026lt;td\u0026gt;\u0026lt;/td\u0026gt;\u0026lt;/tr\u0026gt;\n\u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;User Name:\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;input name=\"login_username\" style=\"width: 295px;\" type=\"text\" size=\"40\" value=\"\"\u0026gt;\u0026lt;/td\u0026gt;\n\u0026lt;/tr\u0026gt;\n\u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;Password:\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;input name=\"login_password\" style=\"width: 295px;\" type=\"password\" size=\"40\"\u0026gt;\u0026lt;/td\u0026gt;\n\u0026lt;/tr\u0026gt;\n\u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;Realm:\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\n \u0026lt;select name=\"realm\" style=\"width: 295px;\"\u0026gt;\u0026lt;option value=\"local\"\u0026gt;Local\u0026lt;/option\u0026gt;\u0026lt;option value=\"ldap\" selected=\"\"\u0026gt;LDAP\u0026lt;/option\u0026gt;\n \u0026lt;/select\u0026gt;\n \u0026lt;/td\u0026gt;\n\u0026lt;/tr\u0026gt;\n \u0026lt;tr style=\"height: 10px;\"\u0026gt;\u0026lt;td\u0026gt;\u0026lt;/td\u0026gt;\u0026lt;/tr\u0026gt;\n\u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;input type=\"submit\" value=\"Login\"\u0026gt;\u0026lt;/td\u0026gt;\n\u0026lt;/tr\u0026gt; \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is my powershell code : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$username=\"MyAccount\"\n$passowrd=\"MyPassowrd\"\n$realm=\"local\"\n\n$webclient = new-object System.Net.WebClient\n$webclient.Credentials = new-object System.Net.NetworkCredential($username, $password, $realm)\n$webclient.DownloadFile($url, \"C:\\temp\\test.jpg\")\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"22459686","answer_count":"1","comment_count":"0","creation_date":"2014-03-17 15:45:20.523 UTC","last_activity_date":"2014-03-18 16:45:44.663 UTC","last_edit_date":"2014-03-18 16:45:44.663 UTC","last_editor_display_name":"","last_editor_user_id":"3354227","owner_display_name":"","owner_user_id":"3354227","post_type_id":"1","score":"0","tags":"powershell|webclient|cacti","view_count":"931"} +{"id":"22891757","title":"using img element with cover","body":"\u003cp\u003eI want to show images to same ratio.But image sizes get different.Maybe 16:10 or 10:10 aspect ratio.Some images look vertical, some images look horizontal.\u003c/p\u003e\n\n\u003cp\u003eI did background cover center with div.But I have to use this to img element.\u003c/p\u003e\n\n\u003cp\u003eHow can I do that with img ?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ediv.image-content\n{\n width: 210px;\n margin: 15px;\n float: left;\n height: 210px;\n overflow: hidden;\n background: no-repeat center center;\n background-size: cover;\n -webkit-background-size: cover;\n -moz-background-size: cover;\n -o-background-size: cover; \n }\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-04-06 08:39:15.637 UTC","last_activity_date":"2014-04-06 08:41:10.277 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3396095","post_type_id":"1","score":"0","tags":"css|image|background-image","view_count":"230"} +{"id":"10036973","title":"Regular expression in python to capture multiple forms of badly formatted addresses","body":"\u003cp\u003eI have been tweaking a regular expression over several days to try to capture, with a single definition, several cases of inconsistent format in the address field of a database. \u003c/p\u003e\n\n\u003cp\u003eI am new to Python and regular expressions, and have gotten great feedback here is stackoverflow, and with my new knowledge, I built a RegEx that is getting close to the final result, but still can't spot the problem.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport re\n\nr1 = r\"([\\w\\s+]+),?\\s*\\(?([\\w\\s+\\\\/]+)\\)?\\s*\\(?([\\w\\s+\\\\/]+)\\)?\"\n\nmatch1 = re.match(r1, 'caracas, venezuela')\nmatch2 = re.match(r1, 'caracas (venezuela)')\nmatch3 = re.match(r1, 'caracas, (venezuela) (df)')\n\ngroup1 = match1.groups()\ngroup2 = match2.groups()\ngroup3 = match3.groups()\n\nprint group1\nprint group2\nprint group3\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis thing should return 'caracas, venezuela' for groups 1 and 2, and 'caracas, venezuela, df' for group 3, instead, it returns:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e('caracas', 'venezuel' 'a') \n('caracas ', 'venezuel' 'a')\n('caracas', 'venezuela', 'df')\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe only perfect match is group 3. The other 2 are isolating the 'a' at the end, and the 2nd one has an extra space at the end of 'caracas '.\nThanks in advance for any insight.\u003c/p\u003e\n\n\u003cp\u003eCheers!\u003c/p\u003e","accepted_answer_id":"10037364","answer_count":"2","comment_count":"1","creation_date":"2012-04-05 22:36:23.01 UTC","last_activity_date":"2012-04-05 23:27:38.717 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1290147","post_type_id":"1","score":"0","tags":"python|regex","view_count":"124"} +{"id":"6929403","title":"Qooxdoo and Javascript - Table(Model) - Hide Table Cell?","body":"\u003cp\u003ecan't find a way to Hide a Table Cell in my Qooxdoo Table. Does anyone know a possibility?\u003c/p\u003e\n\n\u003cp\u003ethis.getTableObj().getTableModel()...\u003c/p\u003e\n\n\u003cp\u003e..and then I think it has to be like..\u003c/p\u003e\n\n\u003cp\u003e... .getTableCell(TableRow, TableColumn).cellrenderer.Replace(null);\u003c/p\u003e\n\n\u003cp\u003eor maybe just like .getTableCell(TableRow, TableColumn).hideCell(); would be perfect.\u003c/p\u003e\n\n\u003cp\u003eEDIT: I need this functionality for showing a pressable button in a cell (just a picture). I can hide the renderer (the picture itself) but not the onclick event on the cell. this for, i would need some kind of ..cell.isVisible(false);\u003c/p\u003e\n\n\u003cp\u003eThanx in advance,\u003c/p\u003e\n\n\u003cp\u003ebest regards,\nStephan\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2011-08-03 15:53:39.157 UTC","last_activity_date":"2011-08-04 11:23:26.917 UTC","last_edit_date":"2011-08-04 11:23:26.917 UTC","last_editor_display_name":"","last_editor_user_id":"659017","owner_display_name":"","owner_user_id":"659017","post_type_id":"1","score":"0","tags":"javascript|qooxdoo","view_count":"528"} +{"id":"10416767","title":"How do I restore a project from a CVS Backup Directory (without the server)","body":"\u003cp\u003eI have a Backup Directory of a Project that was managed in CVS.\u003c/p\u003e\n\n\u003cp\u003eHow can I extract it so that the files are \"normal\" again?\nAll the extensions seem to end in ,v and the files themselves have got CVS comments that render the files rather useless to me.\u003c/p\u003e\n\n\u003cp\u003eThe original CVS Server does not exist anymore unfortunately.\u003c/p\u003e\n\n\u003cp\u003eAny help would be greatly appreciated.\u003c/p\u003e","accepted_answer_id":"10442779","answer_count":"1","comment_count":"0","creation_date":"2012-05-02 15:23:18.417 UTC","last_activity_date":"2012-05-05 03:11:15.26 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"976399","post_type_id":"1","score":"2","tags":"cvs|restore","view_count":"1236"} +{"id":"46179938","title":"Using Executors in very high-load enviroment","body":"\u003cp\u003eI manage to write a REST API using Stripe Framework. Inside my API, I have several tasks which need to execute and combine their results. I come up with an approach, borrowed from JavaScript, which will spawn tasks into several threads and join rather than chronological implementation. Thus, I used \u003ccode\u003eExecutorService\u003c/code\u003e but I found a bottleneck on the implementation when the number of requests is quite big, tasks are finished on a longer time than I expect.\u003c/p\u003e\n\n\u003cp\u003eMy question is related to an alternate way to achieve the same purpose.\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eHow can I create an Executors per request\u003c/li\u003e\n\u003cli\u003eHow can I expand Executors' size\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eTo demonstrate, let consider this way on Javascript\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport Promise from 'bluebird';\nlet tasks = [];\ntasks.push(task01);\ntasks.push(task02);\nPromise.all(tasks).then(results =\u0026gt; { do_sth_here!} )\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBring this idea to Java, I have implemented like below\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eExecutorService exec = Executors.newCachedThreadPool();\nList\u0026lt;Callable\u0026lt;Promise\u0026gt;\u0026gt; tasks = new ArrayList\u0026lt;\u0026gt;();\nList\u0026lt;Future\u0026lt;Promise\u0026gt;\u0026gt; PromiseAll;\n\ntry {\n tasks.add(() -\u0026gt; TaskPromises(Input));\n tasks.add(() -\u0026gt; TaskPromise(Input));\n PromiseAll = exec.invokeAll(tasks);\n for (Future\u0026lt;Promise\u0026gt; fr : PromiseAll) {\n // do_some_thing_next\n } \n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"5","creation_date":"2017-09-12 15:09:09.127 UTC","last_activity_date":"2017-09-12 15:09:47.467 UTC","last_edit_date":"2017-09-12 15:09:47.467 UTC","last_editor_display_name":"","last_editor_user_id":"157247","owner_display_name":"","owner_user_id":"1432142","post_type_id":"1","score":"1","tags":"java|java.util.concurrent","view_count":"44"} +{"id":"31948013","title":"iOS 9 Beta 5 made my app not work","body":"\u003cp\u003eI am relatively new to iOS coding, and swift. I have only coded in Swift, and not Swift 2. I am nervous that updating to the latest XCode will delete my files, or do something crazy, because that has happened before, so I have kept the last version, Xcode 6.3 (i think). Now, when I test my applications on my iPhone 6 with the iOS 9 Beta 5 software, most of my tableviews are not showing anything in them. They load the correct amount of rows, but they are not displaying anything. \u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eHow should I go about fixing this?\u003c/li\u003e\n\u003cli\u003eShould I update to Xcode 7? \u003c/li\u003e\n\u003cli\u003eIf I do, will I have to change the code, and will my apps then still be able to be used on previous iOS operating systems? In other words, will there be a transition from Swift to Swift 2? \u003c/li\u003e\n\u003c/ol\u003e","answer_count":"1","comment_count":"5","creation_date":"2015-08-11 17:15:33.653 UTC","last_activity_date":"2015-08-11 17:19:40.153 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4954930","post_type_id":"1","score":"0","tags":"ios|xcode|swift2|ios9","view_count":"244"} +{"id":"24506018","title":"SailsJs - cannot generate api (using v0.10.0-rc8)","body":"\u003cp\u003eI cannot make generation work using beta SailsJs (v0.10.0-rc8).\nI tried this and that but with no success.\nAny ideas would be appreciated.\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003e~/dev$ npm -g ls | grep sails\n├─┬ sails@0.10.0-rc8\n│ ├── grunt-sails-linker@0.9.5\n│ ├── sails-build-dictionary@0.10.1\n│ ├─┬ sails-disk@0.10.1\n│ ├─┬ sails-generate@0.10.3\n│ │ ├── sails-generate-adapter@0.10.4\n│ │ ├── sails-generate-backend@0.10.13\n│ │ ├─┬ sails-generate-controller@0.10.6\n│ │ ├── sails-generate-frontend@0.10.18\n│ │ ├── sails-generate-generator@0.10.11\n│ │ ├── sails-generate-gruntfile@0.10.10\n│ │ ├─┬ sails-generate-model@0.10.9\n│ │ ├── sails-generate-new@0.10.16\n│ │ ├── sails-generate-views@0.10.1\n│ │ └── sails-generate-views-jade@0.10.0\n│ ├── sails-stringfile@0.3.2\n│ ├─┬ sails-util@0.10.2\n\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003e~/dev$ sails new project\ninfo: Created a new Sails app 'project'!\n\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003e~/dev/project$ sails generate api user\nerror: No generator called 'controller' found; perhaps you meant 'sails generate api controller'?\nerror: No generator called 'model' found; perhaps you meant 'sails generate api model'?\n\u003c/code\u003e\u003c/p\u003e","accepted_answer_id":"24515195","answer_count":"1","comment_count":"0","creation_date":"2014-07-01 08:46:44.563 UTC","favorite_count":"1","last_activity_date":"2014-07-18 05:46:18.07 UTC","last_edit_date":"2014-07-18 05:46:18.07 UTC","last_editor_display_name":"","last_editor_user_id":"3266689","owner_display_name":"","owner_user_id":"3266689","post_type_id":"1","score":"0","tags":"frameworks|sails.js","view_count":"560"} +{"id":"10926733","title":"Need to pass a NSMutableString object from a view controller to the AppDelegate","body":"\u003cp\u003eI've struggled for 6 hrs trying to pass a mutable string object from a view controller to the AppDelegate. I've seen a lot of comments on passing data between view controllers and have worked some of those tutorials, but can't seem to figure out how to pass data to the AppDelegate.\u003c/p\u003e\n\n\u003cp\u003eThanks for any ideas\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2012-06-07 06:30:41.233 UTC","last_activity_date":"2012-06-07 06:33:05.603 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1441426","post_type_id":"1","score":"0","tags":"ios|delegates|pass-data","view_count":"220"} +{"id":"15432052","title":"What is the meaning of git reset --hard origin/master?","body":"\u003cp\u003eI did a git pull and got an error \"The following working tree files would be overwritten by merge... Please move or remove them before you can merge\". To resolve this I did the following\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003egit fetch\ngit reset --hard origin/master\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow when I do git pull, it says everything up to date.I want to know what exactly happens when i run these commands. I know \u003ccode\u003egit fetch\u003c/code\u003e fetches the changes from the remote repo without merging them into my local repo.\u003c/p\u003e\n\n\u003cp\u003eWhat is the meaning of \u003ccode\u003egit reset --hard origin/master\u003c/code\u003e? How does it work?\u003c/p\u003e","accepted_answer_id":"15432250","answer_count":"1","comment_count":"0","creation_date":"2013-03-15 12:06:57.02 UTC","favorite_count":"21","last_activity_date":"2013-12-21 07:42:11.27 UTC","last_edit_date":"2013-12-21 07:42:11.27 UTC","last_editor_display_name":"","last_editor_user_id":"363437","owner_display_name":"","owner_user_id":"1154018","post_type_id":"1","score":"82","tags":"git|version-control","view_count":"115026"} +{"id":"24548872","title":"CSS doesn't work in Chrome but works in Firefox","body":"\u003cp\u003eI have piece of CSS code which works fine in Firefox but not in Chrome.\nI guess made a mistake when using \u003ccode\u003e-webkit-linear-gradient\u003c/code\u003e which shows invalid value in chrome\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eHTML code:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"laptop\"\u0026gt;\n \u0026lt;div class=\"glare-xl\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;div class=\"screen-xl\"\u0026gt;\n \u0026lt;img src=\"http://www.psdgraphics.com/file/silver-laptop-icon.jpg\" alt=\"laptop\" /\u0026gt; \n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"base-xl\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;div class=\"addons-xl \"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;div class=\"button-xl\"\u0026gt;\u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eCSS code:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e.laptop:before {\n background: none repeat scroll 0 0 padding-box #d3d4d6;\n border-color: #cecece #b7b7b9 #5e5d62;\n border-radius: 12px 12px 0 0;\n border-style: solid;\n border-width: 1px;\n bottom: 0;\n content: \"\";\n height: 317px;\n left: 0;\n margin-bottom: -1px;\n margin-left: -6px;\n margin-top: -6px;\n position: absolute;\n top: 0;\n width: 536px;\n z-index: -3;\n}\n.laptop:after {\n background: none repeat scroll 0 0 padding-box #000000;\n border: 1px solid #bdbec0;\n border-radius: 10px 10px 0 0;\n bottom: 0;\n content: \"\";\n height: 311px;\n left: 1px;\n margin-bottom: -1px;\n margin-left: -5px;\n margin-top: -6px;\n position: absolute;\n top: 2px;\n width: 532px;\n z-index: -2;\n}\n.laptop {\n background: none repeat scroll 0 0 padding-box #010101;\n border: 1px solid #101113;\n border-radius: 8px 8px 0 0;\n display: inline-block;\n height: 230px;\n margin-bottom: 40px;\n margin-left: 60px;\n position: relative;\n width: 528px;\n}\n\n\n\n.glare-xl {\n background-clip: padding-box;\n background-image: -moz-linear-gradient(-27% bottom , rgba(0, 0, 0, 0.1) 55%, rgba(0, 0, 0, 0.1) 55%, rgba(255, 255, 255, 0.25) 55.05%);\n background-image: -webkit-linear-gradient(-27% bottom , rgba(0, 0, 0, 0.1) 55%, rgba(0, 0, 0, 0.1) 55%, rgba(255, 255, 255, 0.25) 55.05%);\n background-image: -ms-linear-gradient(-27% bottom , rgba(0, 0, 0, 0.1) 55%, rgba(0, 0, 0, 0.1) 55%, rgba(255, 255, 255, 0.25) 55.05%);\n background-image: -o-linear-gradient(-27% bottom , rgba(0, 0, 0, 0.1) 55%, rgba(0, 0, 0, 0.1) 55%, rgba(255, 255, 255, 0.25) 55.05%);\n background-image: linear-gradient(-27% bottom , rgba(0, 0, 0, 0.1) 55%, rgba(0, 0, 0, 0.1) 55%, rgba(255, 255, 255, 0.25) 55.05%);\n border-radius: 7px 7px 0 0;\n height: 308px;\n position: absolute;\n top: -1px;\n width: 610px;\n z-index: 100;\n}\n\n\n\n.screen-xl:before {\n background: -moz-linear-gradient(center top , #303235 0%, #0a0a0a 100%) repeat scroll 0 0 padding-box rgba(0, 0, 0, 0);\n background: -webkit-linear-gradient(center top , #303235 0%, #0a0a0a 100%) repeat scroll 0 0 padding-box rgba(0, 0, 0, 0);\n background: -ms-linear-gradient(center top , #303235 0%, #0a0a0a 100%) repeat scroll 0 0 padding-box rgba(0, 0, 0, 0);\n background: -o-linear-gradient(center top , #303235 0%, #0a0a0a 100%) repeat scroll 0 0 padding-box rgba(0, 0, 0, 0);\n background: linear-gradient(center top , #303235 0%, #0a0a0a 100%) repeat scroll 0 0 padding-box rgba(0, 0, 0, 0);\n border-color: #000000;\n border-radius: 7px 7px 0 0;\n border-style: solid;\n border-width: 9px 7px;\n content: \"\";\n height: 272px;\n left: -6px;\n position: absolute;\n top: -5px;\n width: 500px;\n z-index: 3;\n}\n.screen-xl:after {\n background: -moz-linear-gradient(center top , #5c5c5c 0%, #656565 8%, #4f4f4f 42%, #727272 100%) repeat scroll 0 0 padding-box rgba(0, 0, 0, 0);\n background: -webkit-linear-gradient(center top , #5c5c5c 0%, #656565 8%, #4f4f4f 42%, #727272 100%) repeat scroll 0 0 padding-box rgba(0, 0, 0, 0);\n background: -ms-linear-gradient(center top , #5c5c5c 0%, #656565 8%, #4f4f4f 42%, #727272 100%) repeat scroll 0 0 padding-box rgba(0, 0, 0, 0);\n background: -o-linear-gradient(center top , #5c5c5c 0%, #656565 8%, #4f4f4f 42%, #727272 100%) repeat scroll 0 0 padding-box rgba(0, 0, 0, 0);\n background: linear-gradient(center top , #5c5c5c 0%, #656565 8%, #4f4f4f 42%, #727272 100%) repeat scroll 0 0 padding-box rgba(0, 0, 0, 0);\n border: 1px solid #404040;\n border-radius: 25px;\n box-shadow: 0 0 2px #ffffff;\n content: \"\";\n height: 3px;\n left: 49%;\n position: absolute;\n top: -8px;\n width: 3px;\n z-index: 130;\n}\n.screen-xl {\n border: 1px solid #141414;\n border-radius: 2px 2px 0 0;\n height: 276px;\n left: 10px;\n position: absolute;\n top: 12px;\n width: 502px;\n}\n\n.screen-xl img {\n border-radius: 2px;\n height: 272px;\n left: 0;\n margin-left: 1px;\n margin-top: 4px;\n position: absolute;\n width: 500px;\n z-index: 100;\n}\n\n.base-xl:before {\n background: -moz-linear-gradient(center top , #c5c4c6 0%, #aeadb1 6%, #99989d 25%, #98979d 31%, #918f96 38%, #686a6d 63%, #4c5254 75%, #43484a 81%, #2c2f30 94%, #16191a 100%) repeat scroll 0 0 padding-box rgba(0, 0, 0, 0);\n background: -webkit-linear-gradient(center top , #c5c4c6 0%, #aeadb1 6%, #99989d 25%, #98979d 31%, #918f96 38%, #686a6d 63%, #4c5254 75%, #43484a 81%, #2c2f30 94%, #16191a 100%) repeat scroll 0 0 padding-box rgba(0, 0, 0, 0);\n background: -ms-linear-gradient(center top , #c5c4c6 0%, #aeadb1 6%, #99989d 25%, #98979d 31%, #918f96 38%, #686a6d 63%, #4c5254 75%, #43484a 81%, #2c2f30 94%, #16191a 100%) repeat scroll 0 0 padding-box rgba(0, 0, 0, 0);\n background: -o-linear-gradient(center top , #c5c4c6 0%, #aeadb1 6%, #99989d 25%, #98979d 31%, #918f96 38%, #686a6d 63%, #4c5254 75%, #43484a 81%, #2c2f30 94%, #16191a 100%) repeat scroll 0 0 padding-box rgba(0, 0, 0, 0);\n background: linear-gradient(center top , #c5c4c6 0%, #aeadb1 6%, #99989d 25%, #98979d 31%, #918f96 38%, #686a6d 63%, #4c5254 75%, #43484a 81%, #2c2f30 94%, #16191a 100%) repeat scroll 0 0 padding-box rgba(0, 0, 0, 0);\n border-radius: 0 0 400px 400px / 0 0 100px 100px;\n bottom: -15px;\n box-shadow: 7px 0 3px #6a6d71 inset, -7px 0 3px #6a6d71 inset;\n content: \"\";\n height: 15px;\n left: -1px;\n position: absolute;\n width: 655px;\n z-index: 130;\n}\n.base-xl {\n background: -moz-linear-gradient(left center , #979ba0 1%, #dfdfdf 4%, #f2f2f2 6%, #e3e3e5 14%, #e3e3e5 86%, #f2f2f2 94%, #dfdfdf 96%, #6a6d71 100%) repeat scroll 0 0 padding-box rgba(0, 0, 0, 0);\n background: -webkit-linear-gradient(left center , #979ba0 1%, #dfdfdf 4%, #f2f2f2 6%, #e3e3e5 14%, #e3e3e5 86%, #f2f2f2 94%, #dfdfdf 96%, #6a6d71 100%) repeat scroll 0 0 padding-box rgba(0, 0, 0, 0);\n background: -ms-linear-gradient(left center , #979ba0 1%, #dfdfdf 4%, #f2f2f2 6%, #e3e3e5 14%, #e3e3e5 86%, #f2f2f2 94%, #dfdfdf 96%, #6a6d71 100%) repeat scroll 0 0 padding-box rgba(0, 0, 0, 0);\n background: -o-linear-gradient(left center , #979ba0 1%, #dfdfdf 4%, #f2f2f2 6%, #e3e3e5 14%, #e3e3e5 86%, #f2f2f2 94%, #dfdfdf 96%, #6a6d71 100%) repeat scroll 0 0 padding-box rgba(0, 0, 0, 0);\n background: linear-gradient(left center , #979ba0 1%, #dfdfdf 4%, #f2f2f2 6%, #e3e3e5 14%, #e3e3e5 86%, #f2f2f2 94%, #dfdfdf 96%, #6a6d71 100%) repeat scroll 0 0 padding-box rgba(0, 0, 0, 0);\n border-color: #6b6e72;\n border-radius: 3px 3px 0 0;\n border-style: solid;\n border-width: 1px 1px 0;\n bottom: -101px;\n box-shadow: 0 1px 2px #ffffff inset;\n float: left;\n height: 22px;\n left: -125px;\n margin-left: 60px;\n position: absolute;\n width: 654px;\n z-index: 4;\n}\n\n.addons-xl:before {\n background-color: #000000;\n border-radius: 55px 55px 5px 5px;\n bottom: -115px;\n content: \"\";\n height: 5px;\n left: 4%;\n position: absolute;\n width: 5px;\n z-index: 1000;\n}\n.addons-xl:after {\n background-color: #000000;\n border-radius: 55px 55px 5px 5px;\n bottom: -115px;\n content: \"\";\n height: 5px;\n position: absolute;\n right: 4%;\n width: 5px;\n z-index: 1000;\n}\n.addons-xl {\n background-color: rgba(0, 0, 0, 0);\n border-radius: 10px;\n height: 3px;\n margin-left: 53%;\n margin-top: 5px;\n width: 3px;\n z-index: 1000;\n}\n\n\n.button-xl:after {\n background: -moz-linear-gradient(center top , #1a2226 0%, #535a61 64%, #68778c 100%) repeat scroll 0 0 padding-box rgba(0, 0, 0, 0);\n background: -webkit-linear-gradient(center top , #1a2226 0%, #535a61 64%, #68778c 100%) repeat scroll 0 0 padding-box rgba(0, 0, 0, 0);\n background: -ms-linear-gradient(center top , #1a2226 0%, #535a61 64%, #68778c 100%) repeat scroll 0 0 padding-box rgba(0, 0, 0, 0);\n background: -o-linear-gradient(center top , #1a2226 0%, #535a61 64%, #68778c 100%) repeat scroll 0 0 padding-box rgba(0, 0, 0, 0);\n background: linear-gradient(center top , #1a2226 0%, #535a61 64%, #68778c 100%) repeat scroll 0 0 padding-box rgba(0, 0, 0, 0);\n border-radius: 10px;\n bottom: -6px;\n box-shadow: 0 0 1px #ffffff;\n content: \"\";\n height: 3px;\n left: 274px;\n position: absolute;\n width: 20px;\n z-index: 4;\n}\n.button-xl {\n background: -moz-linear-gradient(left center , #979ba0 1%, #dfdfdf 4%, #f2f2f2 6%, #b1b3b6 14%, #b1b3b6 86%, #f2f2f2 94%, #dfdfdf 96%, #6a6d71 100%) repeat scroll 0 0 padding-box rgba(0, 0, 0, 0);\n background: -webkit-linear-gradient(left center , #979ba0 1%, #dfdfdf 4%, #f2f2f2 6%, #b1b3b6 14%, #b1b3b6 86%, #f2f2f2 94%, #dfdfdf 96%, #6a6d71 100%) repeat scroll 0 0 padding-box rgba(0, 0, 0, 0);\n background: -ms-linear-gradient(left center , #979ba0 1%, #dfdfdf 4%, #f2f2f2 6%, #b1b3b6 14%, #b1b3b6 86%, #f2f2f2 94%, #dfdfdf 96%, #6a6d71 100%) repeat scroll 0 0 padding-box rgba(0, 0, 0, 0);\n background: -o-linear-gradient(left center , #979ba0 1%, #dfdfdf 4%, #f2f2f2 6%, #b1b3b6 14%, #b1b3b6 86%, #f2f2f2 94%, #dfdfdf 96%, #6a6d71 100%) repeat scroll 0 0 padding-box rgba(0, 0, 0, 0);\n background: linear-gradient(left center , #979ba0 1%, #dfdfdf 4%, #f2f2f2 6%, #b1b3b6 14%, #b1b3b6 86%, #f2f2f2 94%, #dfdfdf 96%, #6a6d71 100%) repeat scroll 0 0 padding-box rgba(0, 0, 0, 0);\n border-color: #5c6064;\n border-radius: 0 0 50px 50px;\n border-style: solid;\n border-width: 0 1px 1px;\n bottom: -87px;\n box-shadow: 0 1px 5px #ffffff, 0 1px 1px #ffffff inset;\n content: \"\";\n height: 6px;\n left: 44%;\n position: absolute;\n width: 60px;\n z-index: 4;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eQuestions:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e1)Why CSS doesn't work in Chrome\u003c/p\u003e\n\n\u003cp\u003e2)How I can make this all structure i.e laptop as responsive as I tried max-width at all places but it doesn't work?\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://jsfiddle.net/shoaibista/gxb2C/\" rel=\"nofollow\"\u003e\u003cstrong\u003eJS FIDDLE\u003c/strong\u003e\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"24549431","answer_count":"1","comment_count":"6","creation_date":"2014-07-03 08:38:48.62 UTC","last_activity_date":"2014-07-03 09:04:34.71 UTC","last_edit_date":"2014-07-03 08:55:35.45 UTC","last_editor_display_name":"","last_editor_user_id":"2396624","owner_display_name":"","owner_user_id":"2396624","post_type_id":"1","score":"1","tags":"html|css3|google-chrome|responsive-design|gradient","view_count":"410"} +{"id":"28359045","title":"How do I add up two scatter points with the same values of x but different values of y?","body":"\u003cp\u003eOn a stem plot, how can I add points that have the same values of \u003ccode\u003ex\u003c/code\u003e but different values of \u003ccode\u003ey\u003c/code\u003e? \u003c/p\u003e\n\n\u003cp\u003eFor example, given the following code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ex = [1 2 3 6 6 4 5];\ny = [3 6 1 8 9 4 2];\nstem(x,y);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf you plot \u003ccode\u003ex\u003c/code\u003e, and \u003ccode\u003ey\u003c/code\u003e, this will be the output:\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/vEDY6.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eI want to add up \u003ccode\u003e(6,8)\u003c/code\u003e and \u003ccode\u003e(6,9)\u003c/code\u003e so it becomes \u003ccode\u003e(6,17)\u003c/code\u003e, just like what the image is showing.\u003c/p\u003e\n\n\u003cp\u003eHow can I achieve this?\u003c/p\u003e","accepted_answer_id":"28360150","answer_count":"1","comment_count":"2","creation_date":"2015-02-06 05:19:43.677 UTC","favorite_count":"1","last_activity_date":"2015-02-06 07:11:22.46 UTC","last_edit_date":"2015-02-06 07:11:22.46 UTC","last_editor_display_name":"","last_editor_user_id":"3250829","owner_display_name":"","owner_user_id":"4503052","post_type_id":"1","score":"1","tags":"matlab","view_count":"157"} +{"id":"31137442","title":"How to fade animate an image icon in html/css","body":"\u003cp\u003eHi I am trying to duplicate the flame icon animations on the left and right of this wix webite:How can i position the flame icon to the far right or left and also make it have a fade animatiion\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://jirungu2012.wix.com/firebrandoption2\" rel=\"nofollow\"\u003ehttp://jirungu2012.wix.com/firebrandoption2\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThis is the htm code \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;section id=\"ourfires\" class=\"portfolio page-section add-top add-bottom\"\u0026gt;\n \u0026lt;div id=\"right\"\u0026gt;\n \u0026lt;img src=\"http://static.wixstatic.com/media/d57153_09c71d3fe10848c3a04b18f8d8a6c2b3.png_srz_p_487_587_75_22_0.50_1.20_0.00_png_srz\" /\u0026gt;\n \u0026lt;!-- inner-section : starts --\u0026gt;\n \u0026lt;section class=\"inner-section\"\u0026gt;\n\n \u0026lt;!-- container : starts --\u0026gt;\n \u0026lt;section class=\"container\"\u0026gt;\n\n \u0026lt;div class=\"row\"\u0026gt;\n \u0026lt;article class=\"col-md-12\"\u0026gt;\n \u0026lt;h1 style=\"text-align:left;\"\u0026gt;\u0026lt;span class=\"animated\" data-fx=\"bounceInRight\"\u0026gt;Our fire\u0026lt;/span\u0026gt;\u0026lt;/h1\u0026gt;\n \u0026lt;article id=\"article\"\u0026gt;\u0026lt;hr class=\"hr\"\u0026gt;\u0026lt;/hr\u0026gt;\u0026lt;/article\u0026gt;\n \u0026lt;div class=\"clearfix\"\u0026gt;\u0026lt;/div\u0026gt;\n\n\n\n \u0026lt;div id=\"mid\"\u0026gt;\n\n \u0026lt;p class=\"promod-text dark-text\"\u0026gt;Our fire is all about \u0026lt;b\u0026gt;Big Brand Ideas\u0026lt;/b\u0026gt; that not only have an \u0026lt;b\u0026gt;edge in the market\u0026lt;/b\u0026gt; and make a difference in the \u0026lt;b\u0026gt;bottom line\u0026lt;/b\u0026gt;,but ieas are: \u0026lt;/p\u0026gt;\n\n\n\n \u0026lt;p\u0026gt;\n \u0026lt;ul id=\"navlist\" class=\"promod-text dark-text\" \u0026gt;\n \u0026lt;li\u0026gt;Locally relevant\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;Creatively imagined and executed\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;Internationally recognized\u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n \u0026lt;/p\u0026gt;\n \u0026lt;br\u0026gt;\u0026lt;br\u0026gt;\u0026lt;br\u0026gt;\u0026lt;br\u0026gt;\u0026lt;br\u0026gt; \n \u0026lt;/div\u0026gt;\n\n \u0026lt;/article\u0026gt;\n \u0026lt;/div \n \u0026gt;\u0026lt;/section\u0026gt;\n \u0026lt;!-- container : ends --\u0026gt;\n \u0026lt;/section\u0026gt;\n \u0026lt;!-- inner-section : ends --\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/section\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe css\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#ourfires{\n\n background: url('../images/bg/03.jpg');\n background-color:#ffffff;\n\n\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"5","creation_date":"2015-06-30 11:48:38.203 UTC","last_activity_date":"2015-07-01 14:06:17.263 UTC","last_edit_date":"2015-06-30 12:55:10.453 UTC","last_editor_display_name":"","last_editor_user_id":"2260344","owner_display_name":"","owner_user_id":"2260344","post_type_id":"1","score":"0","tags":"html|html5|css3|css-transitions","view_count":"796"} +{"id":"5143051","title":"Alfresco deployment on Tomcat","body":"\u003cp\u003eI'm building Alfresco from source and want to deploy it on Tomcat. Can please anybody explain this to me ? There is not enough information about it \u003ca href=\"http://wiki.alfresco.com/wiki/Alfresco_SVN_Development_Environment\" rel=\"nofollow\"\u003ehere\u003c/a\u003e .\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eAPP_TOMCAT_HOME (can be used to host the Slingshot webapp)\n\nVIRTUAL_TOMCAT_HOME (NOTE: this must be a totally separate installation of Tomcat; it is required for virtualization) \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI suppose that APP_TOMCAT_HOME can be the same location as TOMCAT_HOME, but what about the virtualization ? What is it about ? Why ?\u003c/p\u003e\n\n\u003cp\u003eI found \u003ca href=\"http://forums.alfresco.com/en/viewtopic.php?f=8\u0026amp;t=20896\" rel=\"nofollow\"\u003ethis thread\u003c/a\u003e and it is like : \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eForget about virtualization server\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cul\u003e\n\u003cli\u003eIn that case, the build script deploys stuff in to ${env.var.that.is.not.set}\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eI end up with \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ejava.lang.ClassNotFoundException: org.apache.catalina.storeconfig.StoreConfigLifecycleListener\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFrom what I read in here \u003ca href=\"http://wiki.alfresco.com/wiki/Virtualization_Server_FAQ\" rel=\"nofollow\"\u003eVirtualization_Server_FAQ\u003c/a\u003e , I don't need it at all, but the build script kinda count on the VIRTUAL_TOMCAT_HOME variable and it deploys some tomcat 5.x stuff like common and server directories\u003c/p\u003e\n\n\u003cp\u003eFinally I tried to find what is going on in \u003ca href=\"http://wiki.alfresco.com/wiki/Install_Tomcat6\" rel=\"nofollow\"\u003ethis wiki entry\u003c/a\u003e but it is also \"out of context\" ...\u003c/p\u003e\n\n\u003cp\u003eThis is How far I got :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eINFO: Initializing Coyote HTTP/1.1 on http-8080\nFeb 28, 2011 4:24:49 PM org.apache.catalina.startup.Catalina load\nINFO: Initialization processed in 466 ms\nFeb 28, 2011 4:24:49 PM org.apache.catalina.core.StandardService start\nINFO: Starting service Catalina\nFeb 28, 2011 4:24:49 PM org.apache.catalina.core.StandardEngine start\nINFO: Starting Servlet Engine: Apache Tomcat/6.0.29\nFeb 28, 2011 4:24:49 PM org.apache.catalina.startup.HostConfig deployDescriptor\nINFO: Deploying configuration descriptor alfresco.xml\nFeb 28, 2011 4:24:50 PM org.apache.catalina.core.StandardContext addApplicationListener\nINFO: The listener \"org.apache.myfaces.webapp.StartupServletContextListener\" is already configured for this context. The duplicate definition has been ignored.\n16:24:55,574 INFO [alfresco.config.JndiPropertiesFactoryBean] Loading properties file from class path resource [alfresco/repository.properties]\n16:24:55,576 INFO [alfresco.config.JndiPropertiesFactoryBean] Loading properties file from class path resource [alfresco/domain/transaction.properties]\n16:24:55,619 INFO [alfresco.config.JndiPropertyPlaceholderConfigurer] Loading properties file from class path resource [alfresco/alfresco-shared.properties]\n16:24:55,727 INFO [alfresco.config.FixedPropertyPlaceholderConfigurer] Loading properties file from class path resource [alfresco/version.properties]\n16:24:55,760 INFO [alfresco.config.FixedPropertyPlaceholderConfigurer] Loading properties file from class path resource [alfresco/domain/cache-strategies.properties]\n16:25:07,058 INFO [extensions.webscripts.TemplateProcessorRegistry] Registered template processor Repository Template Processor for extension ftl\n16:25:07,061 INFO [extensions.webscripts.ScriptProcessorRegistry] Registered script processor Repository Script Processor for extension js\n16:25:14,227 INFO [domain.schema.SchemaBootstrap] Schema managed by database dialect org.hibernate.dialect.MySQLInnoDBDialect.\n16:25:14,481 INFO [domain.schema.SchemaBootstrap] No changes were made to the schema.\n1 6:25:14,531 INFO [management.subsystems.ChildApplicationContextFactory] Starting 'sysAdmin' subsystem, ID: [sysAdmin, default]\n16:25:14,543 INFO [alfresco.config.FixedPropertyPlaceholderConfigurer] Loading properties file from class path resource [alfresco/version.properties]\n16:25:14,543 INFO [alfresco.config.JndiPropertyPlaceholderConfigurer] Loading properties file from class path resource [alfresco/alfresco-shared.properties]\n16:25:14,544 INFO [alfresco.config.FixedPropertyPlaceholderConfigurer] Loading properties file from class path resource [alfresco/domain/cache-strategies.properties]\n16:25:14,554 INFO [management.subsystems.ChildApplicationContextFactory] Startup of 'sysAdmin' subsystem, ID: [sysAdmin, default] complete\njava.lang.reflect.InvocationTargetException\nException in thread \"main\" Exception in thread \"RMI RenewClean-[127.0.0.1:50504]\" Exception in thread \"RMI RenewClean-[127.0.0.1:50506]\" Exception in thread \"RMI RenewClean-[127.0.0.1:50502]\" Exception in thread \"RMI RenewClean-[127.0.0.1:50505]\" Exception in thread \"RMI RenewClean-[127.0.0.1:50508]\" Exception in thread \"RMI RenewClean-[127.0.0.1:50501]\" Exception in thread \"RMI TCP Connection(idle)\" Exception in thread \"RMI TCP Connection(idle)\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eenvironment: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eAlfresco Revision 25908\ntomcat 6.0.29\njava version \"1.6.0_16\"\nlinux x86_64\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThank you\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2011-02-28 14:11:18.91 UTC","favorite_count":"2","last_activity_date":"2015-07-14 13:33:19.737 UTC","last_edit_date":"2015-07-14 13:33:19.737 UTC","last_editor_display_name":"","last_editor_user_id":"2742111","owner_display_name":"","owner_user_id":"306488","post_type_id":"1","score":"2","tags":"java|tomcat6|alfresco","view_count":"2133"} +{"id":"23690789","title":"Youtube API : HTTP Error: Unable to connect","body":"\u003cp\u003eI am trying to upload videos to youtube using Google_Service_YouTube.\u003c/p\u003e\n\n\u003cp\u003eIIS7.5 , php5.5 \u003c/p\u003e\n\n\u003cp\u003eReturn value with below code : \u003c/p\u003e\n\n\u003cp\u003e\"\nI got token!! \nI got file!! \nCaught exception: HTTP Error: Unable to connect\n\"\u003c/p\u003e\n\n\u003cp\u003eI also tried same code and file on Linux server.And it worked well without any error. \u003c/p\u003e\n\n\u003cp\u003eAny help ? \u003c/p\u003e\n\n\u003cp\u003ethanks \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$client = new Google_Client();\n$client-\u0026gt;setClientId($OAUTH2_CLIENT_ID);\n$client-\u0026gt;setClientSecret($OAUTH2_CLIENT_SECRET);\n$client-\u0026gt;setScopes('https://www.googleapis.com/auth/youtube');\n$redirect = filter_var('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'], FILTER_SANITIZE_URL);\n\n$client-\u0026gt;setRedirectUri($redirect);\n\n$youtube = new Google_Service_YouTube($client);\n\n\nif (isset($_GET['code'])) {\n\n if (strval($_SESSION['state']) !== strval($_GET['state'])) {\n\n die('The session state did not match.' . strval($_SESSION['state']) .\" :: \" . strval($_GET['state']) );\n\n }\n\n $client-\u0026gt;authenticate($_GET['code']);\n $_SESSION['token'] = $client-\u0026gt;getAccessToken();\n header('Location: ' . $redirect);\n\n}\n\n\nif (isset($_SESSION['token'])) {\n $client-\u0026gt;setAccessToken($_SESSION['token']);\n}\n\n\nif ($client-\u0026gt;getAccessToken()) {\n $htmlBody =\"\"; \n\n\nif($client-\u0026gt;isAccessTokenExpired()) {\n $authUrl = $client-\u0026gt;createAuthUrl();\n header('Location: ' . filter_var($authUrl, FILTER_SANITIZE_URL));\n}\n\ntry{\n echo \"I got token!! \u0026lt;br\u0026gt;\";\n $videoPath = \"./youTubeUpload/gizmo.mp4\"; \n if(file_exists($videoPath)){\n echo \"I got file!! \u0026lt;br\u0026gt;\";\n }\n\n $snippet = new Google_Service_YouTube_VideoSnippet();\n $snippet-\u0026gt;setTitle(\"Test title\");\n $snippet-\u0026gt;setDescription(\"Test description\");\n $snippet-\u0026gt;setTags(array(\"tag1\", \"tag2\"));\n\n\n\n $snippet-\u0026gt;setCategoryId(\"22\");\n\n\n $status = new Google_Service_YouTube_VideoStatus();\n $status-\u0026gt;privacyStatus = \"public\";\n\n $video = new Google_Service_YouTube_Video();\n $video-\u0026gt;setSnippet($snippet);\n $video-\u0026gt;setStatus($status);\n\n $chunkSizeBytes = 1 * 1024 * 1024;\n $client-\u0026gt;setDefer(true);\n\n $insertRequest = $youtube-\u0026gt;videos-\u0026gt;insert(\"status,snippet\", $video);\n\n\n $media = new Google_Http_MediaFileUpload(\n $client,\n $insertRequest,\n 'video/*',\n null,\n true,\n $chunkSizeBytes\n );\n $media-\u0026gt;setFileSize(filesize($videoPath));\n\n $status = false;\n $handle = fopen($videoPath, \"rb\");\n\n\n while (!$status \u0026amp;\u0026amp; !feof($handle)) {\n\n $chunk = fread($handle, $chunkSizeBytes);\n\n try{\n $status = $media-\u0026gt;nextChunk($chunk); // @!@ Here is Error point \n } catch(Exception $e){\n echo 'Caught exception: ', $e-\u0026gt;getMessage(), \"\\n\";\n }\n\n }\n\n fclose($handle);\n\n $client-\u0026gt;setDefer(false);\n\n $htmlBody .= \"\u0026lt;h3\u0026gt;Video Uploaded\u0026lt;/h3\u0026gt;\u0026lt;ul\u0026gt;\";\n $htmlBody .= sprintf('\u0026lt;li\u0026gt;%s (%s)\u0026lt;/li\u0026gt;',\n $status['snippet']['title'],\n $status['id']);\n\n $htmlBody .= '\u0026lt;/ul\u0026gt;';\n\n} catch (Google_ServiceException $e) {\n $htmlBody .= sprintf('\u0026lt;p\u0026gt;A service error occurred: \u0026lt;code\u0026gt;%s\u0026lt;/code\u0026gt;\u0026lt;/p\u0026gt;',\n htmlspecialchars($e-\u0026gt;getMessage()));\n} catch (Google_Exception $e) {\n $htmlBody .= sprintf('\u0026lt;p\u0026gt;An client error occurred: \u0026lt;code\u0026gt;%s\u0026lt;/code\u0026gt;\u0026lt;/p\u0026gt;',\n htmlspecialchars($e-\u0026gt;getMessage()));\n}\n\n$_SESSION['token'] = $client-\u0026gt;getAccessToken();\n} else {\n$state = mt_rand();\n$client-\u0026gt;setState($state);\n$_SESSION['state'] = $state;\n\n$authUrl = $client-\u0026gt;createAuthUrl();\n$htmlBody = \u0026lt;\u0026lt;\u0026lt;END\n\u0026lt;h3\u0026gt;Authorization Required\u0026lt;/h3\u0026gt;\n\u0026lt;p\u0026gt;You need to \u0026lt;a href=\"$authUrl\"\u0026gt;authorize access\u0026lt;/a\u0026gt; before proceeding.\u0026lt;p\u0026gt;\nEND;\n}\n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-05-16 00:25:15.287 UTC","last_activity_date":"2014-06-08 13:43:19.43 UTC","last_edit_date":"2014-05-16 00:32:08.357 UTC","last_editor_display_name":"","last_editor_user_id":"3642918","owner_display_name":"","owner_user_id":"3642918","post_type_id":"1","score":"-1","tags":"php|upload|youtube","view_count":"209"} +{"id":"4716598","title":"Safe way to connect to RPC server","body":"\u003cp\u003eThis question is related to \u003ca href=\"https://stackoverflow.com/questions/4696642/how-do-we-handle-python-xmlrpclib-connection-refused\"\u003eHow do we handle Python xmlrpclib Connection Refused?\u003c/a\u003e \u003c/p\u003e\n\n\u003cp\u003eWhen I try to use the following code, with my RPC server down, _get_rpc() returns False and I'm good to go. However if the server is running, it fails with unknown method. Is it trying to execute .connect() on the remote server? How can I get around this, when I needed to use .connect() to detect if the returned proxy worked (see related question)?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport xmlrpclib\nimport socket\n\ndef _get_rpc():\n try:\n a = xmlrpclib.ServerProxy('http://dd:LNXFhcZnYshy5mKyOFfy@127.0.0.1:9001')\n a.connect() # Try to connect to the server\n return a.supervisor\n except socket.error:\n return False\n\n\nif not _get_rpc():\n print \"Failed to connect\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is the issue:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eahiscox@lenovo:~/code/dd$ python xmlrpctest2.py\nFailed to connect\nahiscox@lenovo:~/code/dd$ supervisord -c ~/.supervisor # start up RPC server\nahiscox@lenovo:~/code/dd$ python xmlrpctest2.py\nTraceback (most recent call last):\n File \"xmlrpctest2.py\", line 13, in \u0026lt;module\u0026gt;\n if not _get_rpc():\n File \"xmlrpctest2.py\", line 7, in _get_rpc\n a.connect() # Try to connect to the server\n File \"/usr/lib/python2.6/xmlrpclib.py\", line 1199, in __call__\n return self.__send(self.__name, args)\n File \"/usr/lib/python2.6/xmlrpclib.py\", line 1489, in __request\n verbose=self.__verbose\n File \"/usr/lib/python2.6/xmlrpclib.py\", line 1253, in request\n return self._parse_response(h.getfile(), sock)\n File \"/usr/lib/python2.6/xmlrpclib.py\", line 1392, in _parse_response\n return u.close()\n File \"/usr/lib/python2.6/xmlrpclib.py\", line 838, in close\n raise Fault(**self._stack[0])\nxmlrpclib.Fault: \u0026lt;Fault 1: 'UNKNOWN_METHOD'\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"4716664","answer_count":"1","comment_count":"0","creation_date":"2011-01-17 18:39:18.913 UTC","favorite_count":"2","last_activity_date":"2011-01-17 23:40:51.103 UTC","last_edit_date":"2017-05-23 12:15:24.903 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"576289","post_type_id":"1","score":"3","tags":"python|xmlrpclib","view_count":"4456"} +{"id":"14461429","title":"Ruby on Rails - How to recall a method from a closed do block","body":"\u003cp\u003eI've got this code in my matches index:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;table\u0026gt;\n\u0026lt;% @matches.each do |match| %\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;%= match.team_a %\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;%= match.team_b %\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;%= match.score_a %\u0026gt; - \u0026lt;%= match.score_b %\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;%= match.field %\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;%= render \"shared/asterisk_message\", :target =\u0026gt; [match.team_b, match.team_a] %\u0026gt;\n\u0026lt;% end %\u0026gt;\n\u0026lt;/table\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to move the rendered asterisk_message \u003cstrong\u003eoutside\u003c/strong\u003e the table, but this would mean to put it after the \u003ccode\u003e\u0026lt;% end %\u0026gt;\u003c/code\u003e, which obviously gives me this error:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eundefined local variable or method `match' for #\u0026lt;#:0xb6da40d8\u003e\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eHow can I work it out?\u003c/p\u003e","accepted_answer_id":"14461569","answer_count":"1","comment_count":"3","creation_date":"2013-01-22 14:55:22.697 UTC","last_activity_date":"2013-01-22 15:02:20.187 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1916588","post_type_id":"1","score":"0","tags":"ruby-on-rails|methods|erb","view_count":"127"} +{"id":"33307796","title":"Customizing the Vendor Page on Marketify Theme Wordpress","body":"\u003cp\u003eI am using the Marketify theme on Wordpress and want to customize the vendor page. I want it so that everything is centered. At the top is the featured image of the vendor. Below would be the name of the vendor. Below that would be the author's subscription. Then below that would be the list of products the vendor had.\u003c/p\u003e\n\n\u003cp\u003eI tried reaching out to Marketify's support but they told me to just get a freelancer pretty much.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/OVcki.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/OVcki.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI appreciate any and all help! This issue needs to be addressed because there are no tutorials or any documentation on how to customize the vendor page on the Marketify theme.\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2015-10-23 17:01:17.323 UTC","last_activity_date":"2015-10-23 17:01:17.323 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2662371","post_type_id":"1","score":"1","tags":"php|css|wordpress|themes|vendor","view_count":"172"} +{"id":"27025665","title":"Slider control is deactivated when i reopen my workbook","body":"\u003cp\u003eI have two problem with Excel 2007:\u003c/p\u003e\n\n\u003cp\u003e1 - I created a slider Control (Microsoft Slider control version 6.0) but when i close Excel and open my workbook again, the Slider control is not recognized or desabled. This is strange cause i don't have this problem when i open the same workbook in Excel 2010. \u003c/p\u003e\n\n\u003cp\u003e2 - To fix the problem i decided to create my slider control with VBA. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e*ActiveSheet.OLEObjects.Add(ClassType:=\"MSComctlLib.Slider.2\", link:=False, _\n DisplayAsIcon:=False, Left:=27, Top:=166.5, Width:=380.25, Height:= 26.25).Select\nSelection.ShapeRange.ScaleWidth 1.08, msoFalse, msoScaleFromTopLeft\nSelection.Verb Verb:=xlOpen\nSelection.ShapeRange.IncrementLeft 11.25\nSelection.ShapeRange.IncrementTop -17.25\nSelection.ShapeRange.ScaleHeight 1.11, msoFalse, msoScaleFromTopLeft*\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI don't know why but the Slider Control is not directly activated (as if the control was in design mode). I manage to make the control works by first activate the \"design mode\", then desable it. I tried to use the update property (Slider21.Update) but i got an error (1004) \u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-11-19 19:47:46.193 UTC","last_activity_date":"2017-08-13 06:16:59.313 UTC","last_edit_date":"2017-08-13 06:16:59.313 UTC","last_editor_display_name":"","last_editor_user_id":"1033581","owner_display_name":"","owner_user_id":"1753526","post_type_id":"1","score":"1","tags":"excel|vba|excel-vba","view_count":"169"} +{"id":"25807366","title":"Sequentially reading down a matrix column in MATLAB","body":"\u003cp\u003eMy original problem was to create a scenario whereby there is a line of a specific length (x=100), and a barrier at specific position (pos=50). Multiple rounds of sampling are carried out, within which a specific amount of random numbers (p) are made. The numbers generated can either fall to left or right of the barrier. The program outputs the difference between the largest number generated to the left of the barrier and the smallest number generated to the right. This is much clearer to see here:\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/hkdw9.png\" alt=\"\"\u003e\u003c/p\u003e\n\n\u003cp\u003eIn this example, the system has created 4 numbers (a,b,c,d). It will ignore a and d and output the difference between b and c. Essentially, it will output the smallest possible fragment of the line that still contains the barrier. \u003c/p\u003e\n\n\u003cp\u003eThe code I have been using to do this is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ex = 100; % length of the grid\npos = 50; % position of the barrier\nlen1 = 0; % left edge of the grid\nlen2 = x; % right edge of the grid\n\nsample = 1000; % number of samples to make\nnn = 1:12 % number of points to generate (will loop over these)\n\nlen = zeros(sample, length(nn)); % array to record the results\n\nfor n = 1:length(nn) % For each number of pts to generate\n numpts = nn(n);\n for i = 1:sample % For each round of sampling,\n p = round(rand(numpts,1) * x); % generate 'numpts' random points.\n if any(p\u0026gt;pos) % If any are to the right of the barrier,\n pright = min(p(p\u0026gt;pos)); % pick the smallest.\n else\n pright = len2;\n end\n if any(p\u0026lt;pos) % If any are to the left of the barrier,\n pleft = max(p(p\u0026lt;pos)); % pick the largest.\n else\n pleft = len1;\n end\n len(i,n) = pright - pleft; % Record the length of the interval.\n end\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eMy current problem\u003c/strong\u003e: I'd like to make this more complex. For example, I would like to be able to use more than just one random number count in each round. Specifically I would like to relate this to Poisson distributions with different mean values:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e% Create poisson distributions for λ = 1:12\nrange = 0:20;\nfor l=1:12;\n y = poisspdf(range,l);\n dist(:,l) = y;\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFrom this, i'd like to take 1000 samples for each λ but within each round of 1000 samples, the random number count is no longer the same for all 1000 samples. Instead it depends on the poisson distribution. For example, within a mean value of 1, the probabilities are:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e0 - 0.3678\n1 - 0.3678\n2 - 0.1839\n3 - 0.0613\n4 - 0.0153\n5 - 0.0030\n6 - 0.0005\n7 - 0.0001\n8 - 0.0000\n9 - 0.0000\n10 - 0.0000\n11 - 0.0000\n12 - 0.0000\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo for the first round of 1000 samples, 367 of them would be carried out generating just 1 number, 367 carried out generating 2 numbers, 183 carried out generating 3 numbers and so on. The program will then repeat this using new values it gains from a mean value of 2 and so on. I'd then like to simply collect together all the fragment sizes (\u003ccode\u003epright-pleft\u003c/code\u003e) into a column of a matrix - a column for each value of λ. \u003c/p\u003e\n\n\u003cp\u003eI know I could do something like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eamount = dist*sample\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eTo multiply the poisson distributions by the sample size to gain how many of each number generation it should do - however i'm really stuck on how to incorporate this into the for-loop and alter the code to meet to tackle this new problem. I am also not sure how to read down a column on a matrix to use each probability value to determine how much of each type of RNG it should do. \u003c/p\u003e\n\n\u003cp\u003eAny help would be greatly appreciated,\u003c/p\u003e\n\n\u003cp\u003eAnna. \u003c/p\u003e","accepted_answer_id":"25809433","answer_count":"1","comment_count":"4","creation_date":"2014-09-12 11:33:52.663 UTC","last_activity_date":"2014-09-12 15:27:15.2 UTC","last_edit_date":"2014-09-12 14:34:39.667 UTC","last_editor_display_name":"","last_editor_user_id":"4012442","owner_display_name":"","owner_user_id":"4030463","post_type_id":"1","score":"2","tags":"matlab","view_count":"125"} +{"id":"39211710","title":"Does vwo(visual website optimizer) slow down website load time in any manner?","body":"\u003cp\u003eVisual website optimizer is a A/B testing tool which can help one site owner to analyze his site with a modified of that. It puts a simple code in your website and make a new version of your web page.Then it show one version of your webpage to 50% of your visitors and another ver to rest of the 50%. This way the owner can analyze which ver of the site is generating more revenue \u0026amp; dump the other one.\u003c/p\u003e\n\n\u003cp\u003eSo my question is can vwo reduce the site loading time somehow?Or what is the drawbacks of using vwo in a website?\u003c/p\u003e","answer_count":"2","comment_count":"1","creation_date":"2016-08-29 17:17:02.553 UTC","last_activity_date":"2017-07-31 12:54:17.01 UTC","last_edit_date":"2016-08-29 19:44:26.847 UTC","last_editor_display_name":"","last_editor_user_id":"3328979","owner_display_name":"","owner_user_id":"6771193","post_type_id":"1","score":"1","tags":"optimization|web|website|vwo","view_count":"116"} +{"id":"34348263","title":"Using tkinter library in Python","body":"\u003cp\u003eI have two python files \u003ccode\u003egui.py\u003c/code\u003e, \u003ccode\u003estudent.py\u003c/code\u003e. i have imported \u003ccode\u003etkinter\u003c/code\u003e, i will ask the user to enter their name, id, email, and address, Using tkinter widget i will display all in a list. How to do this using class ?\u003c/p\u003e\n\n\u003cp\u003ethis is \u003ccode\u003egui.py\u003c/code\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e import tkinter\n import student\n\n class MyGUI:\n def __init__(self):\n self.__students = []\n\n # Create the main window widget\n self.main_window = tkinter.Tk()\n\n self.name_f = tkinter.Frame(self.main_window)\n self.id_f = tkinter.Frame(self.main_window)\n self.email_f = tkinter.Frame(self.main_window)\n self.addy_f = tkinter.Frame(self.main_window)\n self.buttons_f = tkinter.Frame(self.main_window)\n\n # Create a Label and Entry widget for each item in\n # the Student class\n self.name_l = tkinter.Label(self.name_f, text='Name: ')\n self.name_e = tkinter.Entry(self.name_f, width=10)\n self.id_l = tkinter.Label(self.id_f, text='ID: ')\n self.id_e = tkinter.Entry(self.id_f, width=10)\n self.email_l = tkinter.Label(self.email_f, text='Email: ')\n self.email_e = tkinter.Entry(self.email_f, width=10)\n self.addy_l = tkinter.Label(self.addy_f, text='Address: ')\n self.addy_e = tkinter.Entry(self.addy_f, width=10)\n\n self.add_b = tkinter.Button(self.buttons_f, text='Add Current Data', command=self.add)\n self.display_b = tkinter.Button(self.buttons_f, text='List All', command=self.display)\n self.quit_b = tkinter.Button(self.buttons_f, text='Quit', command=self.main_window.destroy)\n\n self.name_l.pack(side='left')\n self.name_e.pack(side='left')\n self.id_l.pack(side='left')\n self.id_e.pack(side='left')\n self.email_l.pack(side='left')\n self.email_e.pack(side='left')\n self.addy_l.pack(side='left')\n self.addy_e.pack(side='left')\n\n self.add_b.pack(side='left')\n self.display_b.pack(side='left')\n self.quit_b.pack(side='left')\n\n self.name_f.pack()\n self.id_f.pack()\n self.email_f.pack()\n self.addy_f.pack()\n self.buttons_f.pack()\n\n #Enter the tkinter main loop\n tkinter.mainloop()\n\n def add(self):\n # we will do this in class\n pass\n\n def display(self):\n # we will do this in class\n pass\n\n\n# Create an instance of the MyGUI class\nmy_gui = MyGUI()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand this is the \u003ccode\u003estudent.py\u003c/code\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass Student:\n# this a comment\n# most languages define attributes sep\n# Declare String name\ndef setName(self, n):\n self.name = n\n\ndef setId(self, i):\n self.sid = i\n\ndef setEmail(self, e):\n # check to see if e has an @ sign\n self.email = e\n\ndef setAddy(self, a):\n self.addy = a\n\ndef getName(self):\n return self.name\n\ndef getId(self):\n return self.sid\n\ndef getEmail(self):\n return self.email\n\ndef getAddy(self):\n return self.addy\n\ndef printInfo(self):\n info = \"Name: \"\n info += self.name\n info += '\\nID: '\n info += self.sid\n info += '\\nEmail: '\n info += self.email\n info += '\\nAddress: '\n info += self.addy\n info += '\\n'\n return info\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"1","creation_date":"2015-12-18 03:49:35.7 UTC","last_activity_date":"2015-12-18 04:24:06.243 UTC","last_edit_date":"2015-12-18 04:24:06.243 UTC","last_editor_display_name":"","last_editor_user_id":"2029198","owner_display_name":"","owner_user_id":"4630091","post_type_id":"1","score":"-2","tags":"python|tkinter|display|mygui","view_count":"148"} +{"id":"20088421","title":"How to stretch first column to fill the screen in android tablelayout?","body":"\u003cp\u003eIn my android app, I have a table layout of 2 columns.\u003c/p\u003e\n\n\u003cp\u003eI want to stretch the first column width to fill the screen as much as possible. However in this code, it just wraps the width as much as possible...\u003c/p\u003e\n\n\u003cp\u003eDoes anyone know what's wrong here?\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e TableLayout mytable = (TableLayout)findViewById(R.id.studentContainer);\n\n TableRow tablerow = new TableRow(this);\n tablerow.setOrientation(TableRow.VERTICAL);\n EditText g = new EditText(this);\n g.setText(\"AAAAA\");\n g.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.FILL_PARENT, TableRow.LayoutParams.WRAP_CONTENT));\n EditText g2 = new EditText(this);\n g2.setText(\"BBBBB\");\n g2.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT));\n tablerow.addView(g);\n tablerow.addView(g2);\n mytable.addView(tablerow, new TableLayout.LayoutParams(TableLayout.LayoutParams.FILL_PARENT, TableLayout.LayoutParams.WRAP_CONTENT));\n\n TableRow tablerow2 = new TableRow(this);\n tablerow2.setOrientation(TableRow.VERTICAL);\n EditText g4 = new EditText(this);\n g4.setText(\"AAAAA\");\n g4.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.FILL_PARENT, TableRow.LayoutParams.WRAP_CONTENT));\n EditText g5 = new EditText(this);\n g5.setText(\"BBBBB\");\n g5.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT));\n tablerow2.addView(g4);\n tablerow2.addView(g5);\n mytable.addView(tablerow2, new TableLayout.LayoutParams(TableLayout.LayoutParams.FILL_PARENT, TableLayout.LayoutParams.WRAP_CONTENT));\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eXML\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;TableLayout \n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\"\n android:stretchColumns=\"0\"\n android:orientation=\"vertical\"\n android:id=\"@+id/studentContainer\" \u0026gt;\n \u0026lt;/TableLayout \u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"5","creation_date":"2013-11-20 05:53:12.93 UTC","last_activity_date":"2013-11-20 06:18:04.183 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1497454","post_type_id":"1","score":"0","tags":"android|tablelayout","view_count":"941"} +{"id":"33408138","title":"How to skip \"Welcome Page\" in Chrome using adb","body":"\u003cp\u003eI am trying to open a URL in Google Chrome using adb command line. Have set \"--no-first-run\" using following command -\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eadb shell 'echo \"chrome --no-first-run\" \u0026gt; /data/local/tmp/chrome-command-line'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHave taken the command line switch from the following website - \u003ca href=\"http://peter.sh/experiments/chromium-command-line-switches/\" rel=\"nofollow\"\u003ehttp://peter.sh/experiments/chromium-command-line-switches/\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThen I execute the following commands, \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eadb -s TA99300UFC shell am set-debug-app com.android.chrome\nadb -s TA99300UFC shell am start -n com.android.chrome/com.google.android.apps.chrome.Main -d 'http://wikipedia.org'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eStill the \"Welcome Page\" shows up.\u003c/p\u003e\n\n\u003cp\u003eHow can I skip this and go directly to the website URL passed in command?\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2015-10-29 07:22:13.77 UTC","last_activity_date":"2017-03-02 10:30:08.303 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"452031","post_type_id":"1","score":"1","tags":"android|google-chrome|adb","view_count":"1176"} +{"id":"16598342","title":"getting a black screen when using setRequestedOrientation()","body":"\u003cp\u003eI have a FragmentActivity with some fragments in them. When I go from the fragment I am on (Fragment A) which I have the phone in the portrait position to the next fragment (Fragment B) which I have set in the code setOrientation() to Landscape I get a black screen when I hold the phone in portrait and the layout will not show on the second fragment until I turn my phone to Landscape. I was under the impression that no matter how you are holding the phone that when you do setRequestedOrientation() it should forcefully show the layout you provided\u003c/p\u003e\n\n\u003cp\u003eVisual:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e----------- ----------- \n| | | | ---------------\n| | | | | |\n| Frag A | -\u0026gt; | Frag B | -\u0026gt; Until I turn -\u0026gt; | Frag B | \n| |(then to)| (black) | it to Landscape | (not black | \n| | | | | anymore) |\n| | | | ---------------\n----------- -----------\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCode:\u003c/p\u003e\n\n\u003cp\u003eMainActivity which holds the orientation changes:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e // Set Orientation of the Activity.\npublic void setOrientation(int sensor) {\n if (sensor == 1) {\n setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR);\n } else if (sensor == 2) {\n setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT);\n } else if (sensor == 3) {\n setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);\n } else if (sensor == 4) {\n setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);\n } else if (sensor == 5) {\n setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFragA:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@Override\npublic View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n\n // Set the orientation to be in portrait and landscape.\n ((MainActivity) getActivity()).setOrientation(1);\n ...\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFragB:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@Override\npublic View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n\n // Set the orientation to be in landscape.\n ((MainActivity) getActivity()).setOrientation(5);\n ...\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-05-16 22:11:02.143 UTC","last_activity_date":"2013-08-02 00:06:18.323 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1621913","post_type_id":"1","score":"1","tags":"java|android|orientation","view_count":"418"} +{"id":"37006480","title":"{{ }} is not getting parsed by pyjade as expected with django","body":"\u003cp\u003eI have line of pyjade\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e a.js-track(data-track-data=\"{\\\"Job ID\\\":\\\"{{ job_details|get_or_na:'id' }}\\\",\\\"Job Title\\\":\\\"{{ job_details|get_or_na:'title' }}\\\",\\\"Company Name\\\":\\\"{{ job_details|get_or_na:'organization'|get_or_na:'name' }}\\\"}\", data-track-dynamic-attrs=\"[\\\"Stakeholder\\\"]\",href=\"{% url 'job_detail' job_details.title|slugify job_details.id %}\")\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhich is being rendered as \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;a href=\"/job/operations-manager/b1ac846e-6834-40c4-8bcf-122c093820b1/\" data-track-data=\"{\"Job ID\":\"{{ job_details|get_or_na:'id' }}\",\"Job Title\":\"{{ job_details|get_or_na:'title' }}\",\"Company Name\":\"{{ job_details|get_or_na:'organization'|get_or_na:'name' }}\"}\" data-track-dynamic-attrs=\"[\"Stakeholder\"]\" class=\"js-track\"\u0026gt; \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI expect it to {{ }} being replaced by intended values rather than being rendered with html.\u003cbr\u003e\nI am using 4.0.0 version of pyjade here as templating language.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-05-03 14:05:22.003 UTC","last_activity_date":"2017-02-22 19:58:01.057 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2669708","post_type_id":"1","score":"0","tags":"django|django-templates|pug|pyjade","view_count":"83"} +{"id":"7822704","title":"How to append NSString wiht number?","body":"\u003cp\u003eI'm new in Cocoa.\u003c/p\u003e\n\n\u003cp\u003eI have NSString - (e.g) MUSIC . I want to add some new NSString in Array,\nAnd want to check something like this\u003c/p\u003e\n\n\u003cp\u003eif MUSIC already contained in Array, add Music_1 , after Music_2 and so on. \u003c/p\u003e\n\n\u003cp\u003eSo I need to be able read that integer from NSString, and append it +1 . \u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","accepted_answer_id":"7822816","answer_count":"4","comment_count":"0","creation_date":"2011-10-19 14:18:33.173 UTC","favorite_count":"1","last_activity_date":"2011-10-19 18:59:18.81 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"963718","post_type_id":"1","score":"0","tags":"objective-c|osx|cocoa","view_count":"2237"} +{"id":"3114035","title":"Dynamically Inserting \u003cscript\u003e tags into HTML on Page Load","body":"\u003cp\u003eI'm trying to dynamically insert the Tweetmeme button using Javascript. I'm currently using jQuery throughout the site. Here's the script that I'm using. I basically want to cycle through all the blog entries with a class of journal-entry and append the following JavaScript to the end. This Javascript comes straight from tweetmeme.com. This doesn't work for me though and it has something to do with the code between append(). It doesn't like the second set of script tags.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;script type=\"text/javascript\"\u0026gt; \n$(document).ready(function() {\n\n$('.journal-entry').each(function(index) {\n $(this).append('\u0026lt;script type=\"text/javascript\" src=\"http://tweetmeme.com/i/scripts/button.js\"\u0026gt;\u0026lt;/script\u0026gt;');\n });\n\n});\n\u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny help is appreciated.\nThanks.\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2010-06-24 21:32:25.62 UTC","last_activity_date":"2012-05-09 15:44:19.267 UTC","last_edit_date":"2012-05-09 15:44:19.267 UTC","last_editor_display_name":"","last_editor_user_id":"41153","owner_display_name":"","owner_user_id":"375715","post_type_id":"1","score":"1","tags":"javascript|jquery","view_count":"1762"} +{"id":"13117235","title":"Is it possible to process and query mondrian cubes without deploying to pentaho bi-server?","body":"\u003cp\u003eIf yes, please give a reference. I did a little googling with no result.\nI want to use olap4j to query the cubes and use the result in a web application. But, I don't need any of the features of bi-server.\nAccording to tutorials, the olap schemas have to be published on an instance of bi-server. So isn't it really possible to have cubes built, processed and queried independently?\u003c/p\u003e","accepted_answer_id":"13726447","answer_count":"4","comment_count":"1","creation_date":"2012-10-29 07:05:16.34 UTC","last_activity_date":"2014-03-10 09:23:34.213 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"651647","post_type_id":"1","score":"1","tags":"mdx|olap|pentaho|mondrian|olap4j","view_count":"1304"} +{"id":"34145843","title":"Calling function C#","body":"\u003cp\u003eHow would I call this function\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public void AdvertisingBot(Player player, PlayerTextPacket packet)\n {\n string name = \"Bot\";\n var plr = player.Manager.FindPlayer(name);\n\n if (packet.Text.Contains(\"servernameexample\"))\n {\n plr.Manager.Chat.Say(plr, \"Please do not avertise, I'm watching..\");\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003edoesnt really matter what the code does i dont think but if you have to know, it just looks for the player in-game named Bot and when a player says whats in the quote, the Bot will send a message saying no advertising.\u003c/p\u003e","accepted_answer_id":"34145911","answer_count":"1","comment_count":"1","creation_date":"2015-12-08 00:17:46.257 UTC","last_activity_date":"2015-12-08 00:25:43.777 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5415573","post_type_id":"1","score":"-11","tags":"c#|function","view_count":"67"} +{"id":"40235590","title":"Delete from one, add to another Listbox and vice versa with the same sorting like before","body":"\u003cp\u003eI have to small events to delete the selected items from one list and add them to another and vice versa and it works fine.\nThe Problem is that when i delete the items from the second list and add them again to the first list that the sorting is add the end of the list.\nIs it possible to save the \"position\" to add them on the same place like before? \u003c/p\u003e\n\n\u003cp\u003eSolutions like list.sort() wouldn't work because its a database with all tables and triggers and so on...\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e private void LstSelectedDbTables_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)\n {\n if (lstSelectedDbTables.SelectedIndex != -1)\n if (e.KeyValue == (char) Keys.Delete || e.KeyValue == (char) Keys.Back)\n {\n var selectedItems = lstSelectedDbTables.SelectedItems;\n var bdHashSet = new List\u0026lt;string\u0026gt;(lstSourceDatabaseTables.Items.Cast\u0026lt;string\u0026gt;());\n for (int i = selectedItems.Count - 1; i \u0026gt;= 0; i--)\n {\n bdHashSet.Add(selectedItems[i].ToString());\n lstSelectedDbTables.Items.Remove(selectedItems[i]);\n }\n lstSourceDatabaseTables.DataSource = bdHashSet;\n }\n }\n\n private void lstSourceDatabaseTables_DoubleClick(object sender, EventArgs e)\n {\n if (lstSourceDatabaseTables.SelectedIndex != -1)\n {\n var bdHashSet = new HashSet\u0026lt;string\u0026gt;(lstSourceDatabaseTables.Items.Cast\u0026lt;string\u0026gt;());\n var selectedItems = lstSourceDatabaseTables.SelectedItems;\n\n for (int i = selectedItems.Count - 1; i \u0026gt;= 0; i--)\n {\n lstSelectedDbTables.Items.Add(selectedItems[i]);\n bdHashSet.Remove(selectedItems[i].ToString());\n }\n lstSourceDatabaseTables.DataSource = bdHashSet.ToList();\n }\n }\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"40235942","answer_count":"2","comment_count":"0","creation_date":"2016-10-25 08:55:45.887 UTC","last_activity_date":"2016-10-25 09:17:47.683 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1898396","post_type_id":"1","score":"1","tags":"c#","view_count":"26"} +{"id":"19304683","title":"getting the click event in a kendo grid","body":"\u003cp\u003eI'm trying to get the click event for a Kendo Grid so I can bind stuff to shift and ctrl clicking. I can't use the inherent multiselect Kendo provides because it doesn't support drag and drop. When I create a function after the dataBound event, my function gets called on clicking, but it's not the typical click event.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar onDataBound = function () {\n selectItem.apply(this);\n}\n\ngrid.dataBound = onDataBound;\n\nvar selectItem.apply = function (e) {\n console.log(e);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny thoughts? Thanks in advance.\u003c/p\u003e","accepted_answer_id":"19305906","answer_count":"2","comment_count":"0","creation_date":"2013-10-10 19:34:40.74 UTC","last_activity_date":"2015-07-29 08:45:25.39 UTC","last_edit_date":"2015-05-27 05:11:49.437 UTC","last_editor_display_name":"","last_editor_user_id":"1312004","owner_display_name":"","owner_user_id":"207524","post_type_id":"1","score":"4","tags":"javascript|jquery|html|kendo-ui","view_count":"13459"} +{"id":"22451083","title":"Is possible to acessing a SSL certified page using Phonegap Application?","body":"\u003cp\u003eI know this is a duplicate post..\u003c/p\u003e\n\n\u003cp\u003eI want to knew,android or phonegap application is preferrable for an banking application with Webservice to acess the SSL certified page to acess the private details (account number, Account details etc) ?\u003c/p\u003e\n\n\u003cp\u003e1.What are the pros and cons for acessing a SSL certified page (Android Vs Phonegap)?\u003c/p\u003e\n\n\u003cp\u003e2.What are security issues?\u003c/p\u003e\n\n\u003cp\u003e3.How to resolve this problem?(Guide to attain this goal)\u003c/p\u003e\n\n\u003cp\u003eNeed some helpfull documentation to clear my doubts...Thanks in Advance\u003c/p\u003e","accepted_answer_id":"22688361","answer_count":"4","comment_count":"0","creation_date":"2014-03-17 09:48:55.06 UTC","favorite_count":"5","last_activity_date":"2015-04-07 23:16:20.277 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3007795","post_type_id":"1","score":"2","tags":"android|ssl|cordova|phonegap-plugins","view_count":"4285"} +{"id":"39793444","title":"Error in gridviewUpdating asp.net with a timestamp update","body":"\u003cp\u003eI have two buttons, SetIn and SetOut. They both have the commandName UPDATE ( I have two buttons as I'd like the text to be different on the button depending on the value of one field in the row. \u003c/p\u003e\n\n\u003cp\u003eI'm getting a problem in that when I run the update SQL statement, it throws an error at me. It says: \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eAn exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll but was not handled in user code\u003cbr\u003e\n Additional information: Incorrect syntax near '14'.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eThis means that there is an issue with the date and time stamp that I am trying to update the row with (I'm making the update at 14.02pm).\u003c/p\u003e\n\n\u003cp\u003eMy aspx.cs page code is: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e protected void GridView1_RowUpdating(object sender, System.Web.UI.WebControls.GridViewUpdateEventArgs e)\n{\n Label id = GridView1.Rows[e.RowIndex].FindControl(\"lbl_Index\") as Label;\n int rowToUpdate = Int32.Parse(id.Text);\n con = new SqlConnection(cs);\n\n int scopeValue;\n con = new SqlConnection(cs);\n cmd = new SqlCommand();\n\n cmd.CommandText = \"SELECT in_scope FROM \" + databaseName + \" WHERE id = '\" + rowToUpdate + \"'\";\n cmd.Parameters.AddWithValue(\"@id\", rowToUpdate);\n cmd.Connection = con;\n\n try\n {\n con.Open();\n scopeValue = Convert.ToInt32(cmd.ExecuteScalar());\n //database_entries.Text = recordCount.ToString();\n }\n finally\n {\n con.Close();\n }\n\n string modifiedBy = userManagement.getWeldID();\n string updateDate = DateTime.UtcNow.ToString(\"dd/MMM/yyyy HH:mm:ss\");\n {\n if (scopeValue == 1)\n {\n // Label id = GridView1.Rows[e.RowIndex].FindControl(\"lbl_Index\") as Label;\n string sqlStatement = \"\";\n con = new SqlConnection(cs);\n // SqlCommand cmd = new SqlCommand();\n sqlStatement = @\"update dbo.Fair_Use_InScope_MIF_Alex_temp set in_scope = '0', modified_by = \" + modifiedBy + \", date_updated = \" + updateDate + \" where id = '\" + rowToUpdate + \"'\";\n\n con.Open();\n cmd = new SqlCommand(sqlStatement, con);\n cmd.ExecuteNonQuery();\n con.Close();\n ShowData();\n }\n if (scopeValue == 0)\n {\n // Label id = GridView1.Rows[e.RowIndex].FindControl(\"lbl_Index\") as Label;\n string sqlStatement = \"\";\n con = new SqlConnection(cs);\n // SqlCommand cmd = new SqlCommand();\n sqlStatement = @\"update dbo.Fair_Use_InScope_MIF_Alex_temp set in_scope = '1', modified_by = \" + modifiedBy + \", date_updated = \" + updateDate + \" where id = '\" + rowToUpdate + \"'\";\n con.Open();\n cmd = new SqlCommand(sqlStatement, con);\n cmd.ExecuteNonQuery();\n con.Close();\n ShowData();\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm basically trying to get the scopeValue (0 or 1) of the row, and if the Update command is called, and the scopeValue was previously 0, set it to 1 now and vice versa. I also need to update the time that the change was made and who made the change in that row. (these are both displayed in the gridview)\u003c/p\u003e\n\n\u003cp\u003eAny help would be much appreciated as I am a beginner to ASP.NET and C# and SQL SERVER!!\u003c/p\u003e","accepted_answer_id":"39794916","answer_count":"1","comment_count":"0","creation_date":"2016-09-30 14:07:04.563 UTC","last_activity_date":"2016-09-30 15:27:14.453 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6648874","post_type_id":"1","score":"0","tags":"c#|mysql|asp.net|sql-server","view_count":"48"} +{"id":"29457491","title":"SUM of Multiple columns of MySQL table","body":"\u003cp\u003eThis is tbl_user:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e-----------------\nID | Username\n-----------------\n1 user one\n2 user two\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is tbl_x1:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e-------------------------\nID | User_id | Sum\n-------------------------\n1 1 10\n2 1 20\n3 2 30\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is tbl_x2:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e-------------------------\nID | User_id | Sum\n-------------------------\n1 1 10\n2 1 20\n3 1 30\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is tbl_y:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e-------------------------\nID | User_id | Days\n-------------------------\n1 1 10\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to select sum(x1.sum + x2.sum) and sum(y.Days).\u003cbr\u003e\nIn other words, \u003cstrong\u003eI want the following result:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e-------------------------------------\nID | Username | Sum | Days\n-------------------------------------\n1 user one 90 10\n2 user two 30 0\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI tried with this code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eselect u.id as ID, u.username as Username, sum(y.days) as Days,(ifnull(sum( x1.sum), 0) + ifnull(sum( x2.sum), 0)) as Sum from tbl_user u left join tbl_x1 x1 on u.id = x1.user_id left join tbl_x2 g on u.id = x2.user_id left join tbl_y y on u.id = y.user_id group by u.id\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut i get the wrong result.\u003c/p\u003e","accepted_answer_id":"29457749","answer_count":"1","comment_count":"2","creation_date":"2015-04-05 12:55:00.09 UTC","favorite_count":"1","last_activity_date":"2015-04-05 13:22:16.41 UTC","last_edit_date":"2015-04-05 13:10:11.763 UTC","last_editor_display_name":"","last_editor_user_id":"4401901","owner_display_name":"","owner_user_id":"4401901","post_type_id":"1","score":"0","tags":"mysql|sql|group-by|sum","view_count":"34"} +{"id":"29090507","title":"Page in Page View Controller has a sudden dropping down motion","body":"\u003cp\u003eI have 2 pages in my app that are transitioned with a UIPageViewController.\nThe first page loads fine but the second page will have a 'dropping' motion similar to the .gif image below.\n\u003cimg src=\"https://i.stack.imgur.com/JEPFs.gif\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eThis will only occur once when the page is loaded.\nI am not really sure what causes this but my suspicions could be the constraints. It seems to be applying the constraints when the page is loaded.\u003c/p\u003e\n\n\u003cp\u003eI am currently looking at a solution to pre-load the pages first and if this works, i will expand the solution to pre-load only the previous and next page (if any). If there are any better solutions out there, do share with me.\u003c/p\u003e","accepted_answer_id":"29159869","answer_count":"3","comment_count":"1","creation_date":"2015-03-17 02:49:59.833 UTC","last_activity_date":"2015-06-19 02:59:27.04 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1796386","post_type_id":"1","score":"1","tags":"ios|swift|uipageviewcontroller","view_count":"220"} +{"id":"5536907","title":"MySQL table schema help needed","body":"\u003cp\u003eI've a problem deciding where to place a certain table field within my database.\nThe database is for a classified ads website.\nI want registered and non-registered users to be able to post ads. If an unregistered user posts an ad, the site should ask him for the contact phone, if the user is already registered, then the contact phone stored in the users' table should be used.\u003c/p\u003e\n\n\u003cp\u003eNow my question is, would it be possible to store the contact phone for both registered and unregistered users in the same table field?\nIf so, where should that field be put, in the Classified ads table, or in the users' table (noting that each user within the table has a unique Id, thus, filling the users' table with unregistered users just to get their contact phone will just fill the table with useless data)\u003c/p\u003e\n\n\u003cp\u003eThanks in advance !\u003c/p\u003e","accepted_answer_id":"5537206","answer_count":"3","comment_count":"0","creation_date":"2011-04-04 09:54:56.587 UTC","last_activity_date":"2011-04-04 10:26:45.447 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"690882","post_type_id":"1","score":"0","tags":"mysql|database-design","view_count":"423"} +{"id":"21859872","title":"CUDA Separate compilation issues using cmake","body":"\u003cp\u003eI have a CUDA project which I compile with cmake. It worked fine until I wanted to add a new class containing a device function described in new files (.cu and .cuh). This is the CMakeList file :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eproject(SINS)\n\ncmake_minimum_required(VERSION 2.8)\n\n# CUDA\nset(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} \"./\")\n\nfind_package(CUDA) # This command includes a lot of new stuff, see FindCUDA.cmake for details\n\ninclude_directories(${CUDA_INCLUDE_DIRS}/include)\n\nset(CUDA_LIBRARIES ${CUDA_LIBRARIES} \"$ENV{CUDA_BIN_PATH}/lib64/libcurand.so\")\n\n[find ODEINT stuff]\n\ninclude_directories(${PROJECT_SOURCE_DIR}/code/src)\ninclude_directories(${PROJECT_SOURCE_DIR}/code/include)\n\nset(SINS_SRC\n code/src/SINS_constants.cu\n code/src/SINS_IOManager.cu\n code/src/SINS_statistics.cu\n code/src/SINS_bufferGas.cu\n)\n\nset(SINS_HEADER\n code/include/SINS_constants.cuh\n code/include/SINS_IOManager.cuh\n code/include/SINS_statistics.cuh\n code/include/SINS_ODEINT.cuh\n code/include/SINS_bufferGas.cuh\n)\n\nset(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} \"-arch=sm_20;--compiler-bindir=/usr/bin/g++;-DSINS_COMPUTE_ON_GPU\")\n\n# Compile application\nCUDA_ADD_EXECUTABLE(SINS code/SINS_core.cu ${SINS_SRC} ${SINS_HEADER})\n\n# Link it to CUDA\ntarget_link_libraries(SINS ${CUDA_LIBRARIES})\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn SINS_ODEINT.cuh :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \"SINS_bufferGas.cuh\"\n\nstruct motion_system\n{ \n struct motion_functor\n {\n void operator()(T zippedStates) const\n {\n [...]\n SINS_bufferGas::doTheRobot(y);\n [...]\n }\n };\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn SINS_bufferGas.cuh :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#ifndef SINS_bufferGas_H\n#define SINS_bufferGas_H\n\n#include \"SINS_constants.cuh\"\n\nclass SINS_bufferGas\n{\n public:\n __host__ __device__ static void doTheRobot(value_type \u0026amp;x);\n};\n\n#endif\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ein SINS_bufferGas.cu :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \"SINS_bufferGas.cuh\"\n__host__ __device__ void SINS_bufferGas::doTheRobot(value_type \u0026amp;x) {x = -666.666;}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe compilation yields :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eptxas fatal : Unresolved extern function '_ZN14SINS_bufferGas10doTheRobotERd'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI tried adding -dc in the CUDA_NVCC_FLAGS, setting on the variable CUDA_SEPARABLE_COMPILATION coming from FindCUDA.cmake, multiple combinations of what is suggested in this \u003ca href=\"https://stackoverflow.com/questions/13683575/cuda-5-0-separate-compilation-of-library-with-cmake\"\u003epost\u003c/a\u003e, trying to understand what is \u003ca href=\"http://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#using-separate-compilation-in-cuda\" rel=\"nofollow noreferrer\"\u003ehere\u003c/a\u003e (no cmake) to no avail...\u003c/p\u003e\n\n\u003cp\u003eI am using CUDA 5.0, have access to 2.0 compute capability and cmake 2.8.7 - I would really appreciate an explanation of what is going on and how I can fix it nicely. Thank you for any advice.\u003c/p\u003e\n\n\u003cp\u003eEDIT : Added informations asked by David Kernin.\u003c/p\u003e\n\n\u003cp\u003eCMake output :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e-- The C compiler identification is GNU\n-- The CXX compiler identification is GNU\n-- Check for working C compiler: /usr/bin/gcc\n-- Check for working C compiler: /usr/bin/gcc -- works\n-- Detecting C compiler ABI info\n-- Detecting C compiler ABI info - done\n-- Check for working CXX compiler: /usr/bin/c++\n-- Check for working CXX compiler: /usr/bin/c++ -- works\n-- Detecting CXX compiler ABI info\n-- Detecting CXX compiler ABI info - done\n\n~~~ CUDA ~~~\nCUDA_BIN_PATH set to /usr/local/cuda-5.0.\n-- Found CUDA: /usr/local/cuda-5.0 (found version \"5.0\")\n\n~~~ ODEINT ~~~\nODEINT_PATH environment variable found and set to : /a/given/path/software/odeint\n\n~~~ ROOT ~~~\n-- Found ROOT 5.34/01 in /opt/cern/root/root_v5.34.01\n\n~~~ Host or device ? ~~~\nSimulation will be computed on GPUs.\n-arch=sm_20;--compiler-bindir=/usr/bin/g++;-DSINS_COMPUTE_ON_GPU\n\n~~~ Double or short precision ? ~~~\nDouble precision will be used.\n\n~~~ Stepper ? ~~~\nFixed controlled step size will be used.\n\n~~~ Electric field ? ~~~\nTrapping field ON\n\n~~~ Space charge ? ~~~\nSpace charge OFF\n\n~~~ Buffer gas ? ~~~\nBuffer gas cooling ON (EXPERIMENTAL)\n\n-- Configuring done\n-- Generating done\n-- Build files have been written to: /a/path/workdir\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd the full output of make :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e/usr/bin/cmake -H/data/pieges/fabian/SINS -B/data/pieges/fabian/SINS/workdir --check-build-system CMakeFiles/Makefile.cmake 0\n/usr/bin/cmake -E cmake_progress_start /data/pieges/fabian/SINS/workdir/CMakeFiles /data/pieges/fabian/SINS/workdir/CMakeFiles/progress.marks\nmake -f CMakeFiles/Makefile2 all\nmake[1]: entrant dans le répertoire « /data/pieges/fabian/SINS/workdir »\nmake -f CMakeFiles/SINS.dir/build.make CMakeFiles/SINS.dir/depend\nmake[2]: entrant dans le répertoire « /data/pieges/fabian/SINS/workdir »\n/usr/bin/cmake -E cmake_progress_report /data/pieges/fabian/SINS/workdir/CMakeFiles 5\n/usr/bin/cmake -E cmake_progress_report /data/pieges/fabian/SINS/workdir/CMakeFiles 1\n/usr/bin/cmake -E cmake_progress_report /data/pieges/fabian/SINS/workdir/CMakeFiles 2\n/usr/bin/cmake -E cmake_progress_report /data/pieges/fabian/SINS/workdir/CMakeFiles 3\n/usr/bin/cmake -E cmake_progress_report /data/pieges/fabian/SINS/workdir/CMakeFiles 4\n[ 40%] [ 80%] [100%] [100%] [100%] Building NVCC (Device) object CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_bufferGas.cu.o\ncd /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src \u0026amp;\u0026amp; /usr/bin/cmake -E make_directory /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/.\nBuilding NVCC (Device) object CMakeFiles/SINS.dir/code/./SINS_generated_SINS_core.cu.o\ncd /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code \u0026amp;\u0026amp; /usr/bin/cmake -E make_directory /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/.\nBuilding NVCC (Device) object CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_constants.cu.o\nBuilding NVCC (Device) object CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_IOManager.cu.o\nBuilding NVCC (Device) object CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_statistics.cu.o\ncd /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src \u0026amp;\u0026amp; /usr/bin/cmake -E make_directory /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/.\ncd /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src \u0026amp;\u0026amp; /usr/bin/cmake -E make_directory /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/.\ncd /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src \u0026amp;\u0026amp; /usr/bin/cmake -E make_directory /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/.\ncd /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src \u0026amp;\u0026amp; /usr/bin/cmake -D verbose:BOOL=1 -D build_configuration:STRING= -D generated_file:STRING=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_IOManager.cu.o -D generated_cubin_file:STRING=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_IOManager.cu.o.cubin.txt -P /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_IOManager.cu.o.cmake\ncd /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src \u0026amp;\u0026amp; /usr/bin/cmake -D verbose:BOOL=1 -D build_configuration:STRING= -D generated_file:STRING=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_bufferGas.cu.o -D generated_cubin_file:STRING=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_bufferGas.cu.o.cubin.txt -P /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_bufferGas.cu.o.cmake\ncd /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src \u0026amp;\u0026amp; /usr/bin/cmake -D verbose:BOOL=1 -D build_configuration:STRING= -D generated_file:STRING=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_constants.cu.o -D generated_cubin_file:STRING=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_constants.cu.o.cubin.txt -P /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_constants.cu.o.cmake\ncd /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src \u0026amp;\u0026amp; /usr/bin/cmake -D verbose:BOOL=1 -D build_configuration:STRING= -D generated_file:STRING=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_statistics.cu.o -D generated_cubin_file:STRING=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_statistics.cu.o.cubin.txt -P /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_statistics.cu.o.cmake\ncd /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code \u0026amp;\u0026amp; /usr/bin/cmake -D verbose:BOOL=1 -D build_configuration:STRING= -D generated_file:STRING=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/./SINS_generated_SINS_core.cu.o -D generated_cubin_file:STRING=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/./SINS_generated_SINS_core.cu.o.cubin.txt -P /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/SINS_generated_SINS_core.cu.o.cmake\n-- Removing /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_constants.cu.o\n-- Removing /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_IOManager.cu.o\n-- Removing /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_bufferGas.cu.o\n-- Removing /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_statistics.cu.o\n-- Removing /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/./SINS_generated_SINS_core.cu.o\n/usr/bin/cmake -E remove /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_constants.cu.o\n/usr/bin/cmake -E remove /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/./SINS_generated_SINS_core.cu.o\n/usr/bin/cmake -E remove /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_bufferGas.cu.o\n/usr/bin/cmake -E remove /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_IOManager.cu.o\n/usr/bin/cmake -E remove /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_statistics.cu.o\n-- Generating dependency file: /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/SINS_generated_SINS_core.cu.o.NVCC-depend\n-- Generating dependency file: /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_statistics.cu.o.NVCC-depend\n-- Generating dependency file: /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_IOManager.cu.o.NVCC-depend\n-- Generating dependency file: /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_bufferGas.cu.o.NVCC-depend\n-- Generating dependency file: /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_constants.cu.o.NVCC-depend\n/usr/local/cuda-5.0/bin/nvcc -M -D__CUDACC__ /data/pieges/fabian/SINS/code/src/SINS_bufferGas.cu -o /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_bufferGas.cu.o.NVCC-depend -m64 -DHAS_ROOT -DSINS_DO_ELECTRIC_FIELD -DSINS_DO_BUFFER_GAS -Xcompiler ,\\\"-g\\\" -arch=sm_20 --compiler-bindir=/usr/bin/g++ -DSINS_COMPUTE_ON_GPU -DNVCC -I/usr/local/cuda-5.0/include -I/usr/local/cuda-5.0/include/include -I/home/fabian/software/odeint -I/opt/cern/root/root_v5.34.01/include -I/data/pieges/fabian/SINS/code/src -I/data/pieges/fabian/SINS/code/include -I/usr/local/cuda-5.0/include\n/usr/local/cuda-5.0/bin/nvcc -M -D__CUDACC__ /data/pieges/fabian/SINS/code/src/SINS_constants.cu -o /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_constants.cu.o.NVCC-depend -m64 -DHAS_ROOT -DSINS_DO_ELECTRIC_FIELD -DSINS_DO_BUFFER_GAS -Xcompiler ,\\\"-g\\\" -arch=sm_20 --compiler-bindir=/usr/bin/g++ -DSINS_COMPUTE_ON_GPU -DNVCC -I/usr/local/cuda-5.0/include -I/usr/local/cuda-5.0/include/include -I/home/fabian/software/odeint -I/opt/cern/root/root_v5.34.01/include -I/data/pieges/fabian/SINS/code/src -I/data/pieges/fabian/SINS/code/include -I/usr/local/cuda-5.0/include\n/usr/local/cuda-5.0/bin/nvcc -M -D__CUDACC__ /data/pieges/fabian/SINS/code/src/SINS_IOManager.cu -o /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_IOManager.cu.o.NVCC-depend -m64 -DHAS_ROOT -DSINS_DO_ELECTRIC_FIELD -DSINS_DO_BUFFER_GAS -Xcompiler ,\\\"-g\\\" -arch=sm_20 --compiler-bindir=/usr/bin/g++ -DSINS_COMPUTE_ON_GPU -DNVCC -I/usr/local/cuda-5.0/include -I/usr/local/cuda-5.0/include/include -I/home/fabian/software/odeint -I/opt/cern/root/root_v5.34.01/include -I/data/pieges/fabian/SINS/code/src -I/data/pieges/fabian/SINS/code/include -I/usr/local/cuda-5.0/include\n/usr/local/cuda-5.0/bin/nvcc -M -D__CUDACC__ /data/pieges/fabian/SINS/code/SINS_core.cu -o /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/SINS_generated_SINS_core.cu.o.NVCC-depend -m64 -DHAS_ROOT -DSINS_DO_ELECTRIC_FIELD -DSINS_DO_BUFFER_GAS -Xcompiler ,\\\"-g\\\" -arch=sm_20 --compiler-bindir=/usr/bin/g++ -DSINS_COMPUTE_ON_GPU -DNVCC -I/usr/local/cuda-5.0/include -I/usr/local/cuda-5.0/include/include -I/home/fabian/software/odeint -I/opt/cern/root/root_v5.34.01/include -I/data/pieges/fabian/SINS/code/src -I/data/pieges/fabian/SINS/code/include -I/usr/local/cuda-5.0/include\n/usr/local/cuda-5.0/bin/nvcc -M -D__CUDACC__ /data/pieges/fabian/SINS/code/src/SINS_statistics.cu -o /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_statistics.cu.o.NVCC-depend -m64 -DHAS_ROOT -DSINS_DO_ELECTRIC_FIELD -DSINS_DO_BUFFER_GAS -Xcompiler ,\\\"-g\\\" -arch=sm_20 --compiler-bindir=/usr/bin/g++ -DSINS_COMPUTE_ON_GPU -DNVCC -I/usr/local/cuda-5.0/include -I/usr/local/cuda-5.0/include/include -I/home/fabian/software/odeint -I/opt/cern/root/root_v5.34.01/include -I/data/pieges/fabian/SINS/code/src -I/data/pieges/fabian/SINS/code/include -I/usr/local/cuda-5.0/include\n-- Generating temporary cmake readable file: /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_bufferGas.cu.o.depend.tmp\n-- Generating temporary cmake readable file: /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_constants.cu.o.depend.tmp\n-- Generating temporary cmake readable file: /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_statistics.cu.o.depend.tmp\n/usr/bin/cmake -D input_file:FILEPATH=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_constants.cu.o.NVCC-depend -D output_file:FILEPATH=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_constants.cu.o.depend.tmp -P /usr/share/cmake-2.8/Modules/FindCUDA/make2cmake.cmake\n/usr/bin/cmake -D input_file:FILEPATH=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_bufferGas.cu.o.NVCC-depend -D output_file:FILEPATH=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_bufferGas.cu.o.depend.tmp -P /usr/share/cmake-2.8/Modules/FindCUDA/make2cmake.cmake\n/usr/bin/cmake -D input_file:FILEPATH=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_statistics.cu.o.NVCC-depend -D output_file:FILEPATH=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_statistics.cu.o.depend.tmp -P /usr/share/cmake-2.8/Modules/FindCUDA/make2cmake.cmake\n-- Generating temporary cmake readable file: /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_IOManager.cu.o.depend.tmp\n/usr/bin/cmake -D input_file:FILEPATH=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_IOManager.cu.o.NVCC-depend -D output_file:FILEPATH=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_IOManager.cu.o.depend.tmp -P /usr/share/cmake-2.8/Modules/FindCUDA/make2cmake.cmake\n-- Copy if different /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_constants.cu.o.depend.tmp to /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_constants.cu.o.depend\n-- Copy if different /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_statistics.cu.o.depend.tmp to /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_statistics.cu.o.depend\n-- Copy if different /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_bufferGas.cu.o.depend.tmp to /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_bufferGas.cu.o.depend\n/usr/bin/cmake -E copy_if_different /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_constants.cu.o.depend.tmp /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_constants.cu.o.depend\n/usr/bin/cmake -E copy_if_different /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_statistics.cu.o.depend.tmp /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_statistics.cu.o.depend\n/usr/bin/cmake -E copy_if_different /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_bufferGas.cu.o.depend.tmp /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_bufferGas.cu.o.depend\n-- Removing /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_constants.cu.o.depend.tmp and /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_constants.cu.o.NVCC-depend\n-- Removing /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_statistics.cu.o.depend.tmp and /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_statistics.cu.o.NVCC-depend\n-- Removing /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_bufferGas.cu.o.depend.tmp and /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_bufferGas.cu.o.NVCC-depend\n/usr/bin/cmake -E remove /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_constants.cu.o.depend.tmp /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_constants.cu.o.NVCC-depend\n/usr/bin/cmake -E remove /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_statistics.cu.o.depend.tmp /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_statistics.cu.o.NVCC-depend\n-- Copy if different /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_IOManager.cu.o.depend.tmp to /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_IOManager.cu.o.depend\n/usr/bin/cmake -E remove /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_bufferGas.cu.o.depend.tmp /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_bufferGas.cu.o.NVCC-depend\n/usr/bin/cmake -E copy_if_different /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_IOManager.cu.o.depend.tmp /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_IOManager.cu.o.depend\n-- Generating /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_constants.cu.o\n-- Generating /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_statistics.cu.o\n-- Generating /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_bufferGas.cu.o\n/usr/local/cuda-5.0/bin/nvcc /data/pieges/fabian/SINS/code/src/SINS_constants.cu -c -o /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_constants.cu.o -m64 -DHAS_ROOT -DSINS_DO_ELECTRIC_FIELD -DSINS_DO_BUFFER_GAS -Xcompiler ,\\\"-g\\\" -arch=sm_20 --compiler-bindir=/usr/bin/g++ -DSINS_COMPUTE_ON_GPU -DNVCC -I/usr/local/cuda-5.0/include -I/usr/local/cuda-5.0/include/include -I/home/fabian/software/odeint -I/opt/cern/root/root_v5.34.01/include -I/data/pieges/fabian/SINS/code/src -I/data/pieges/fabian/SINS/code/include -I/usr/local/cuda-5.0/include\n/usr/local/cuda-5.0/bin/nvcc /data/pieges/fabian/SINS/code/src/SINS_statistics.cu -c -o /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_statistics.cu.o -m64 -DHAS_ROOT -DSINS_DO_ELECTRIC_FIELD -DSINS_DO_BUFFER_GAS -Xcompiler ,\\\"-g\\\" -arch=sm_20 --compiler-bindir=/usr/bin/g++ -DSINS_COMPUTE_ON_GPU -DNVCC -I/usr/local/cuda-5.0/include -I/usr/local/cuda-5.0/include/include -I/home/fabian/software/odeint -I/opt/cern/root/root_v5.34.01/include -I/data/pieges/fabian/SINS/code/src -I/data/pieges/fabian/SINS/code/include -I/usr/local/cuda-5.0/include\n-- Removing /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_IOManager.cu.o.depend.tmp and /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_IOManager.cu.o.NVCC-depend\n/usr/local/cuda-5.0/bin/nvcc /data/pieges/fabian/SINS/code/src/SINS_bufferGas.cu -c -o /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_bufferGas.cu.o -m64 -DHAS_ROOT -DSINS_DO_ELECTRIC_FIELD -DSINS_DO_BUFFER_GAS -Xcompiler ,\\\"-g\\\" -arch=sm_20 --compiler-bindir=/usr/bin/g++ -DSINS_COMPUTE_ON_GPU -DNVCC -I/usr/local/cuda-5.0/include -I/usr/local/cuda-5.0/include/include -I/home/fabian/software/odeint -I/opt/cern/root/root_v5.34.01/include -I/data/pieges/fabian/SINS/code/src -I/data/pieges/fabian/SINS/code/include -I/usr/local/cuda-5.0/include\n/usr/bin/cmake -E remove /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_IOManager.cu.o.depend.tmp /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/SINS_generated_SINS_IOManager.cu.o.NVCC-depend\n-- Generating /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_IOManager.cu.o\n/usr/local/cuda-5.0/bin/nvcc /data/pieges/fabian/SINS/code/src/SINS_IOManager.cu -c -o /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_IOManager.cu.o -m64 -DHAS_ROOT -DSINS_DO_ELECTRIC_FIELD -DSINS_DO_BUFFER_GAS -Xcompiler ,\\\"-g\\\" -arch=sm_20 --compiler-bindir=/usr/bin/g++ -DSINS_COMPUTE_ON_GPU -DNVCC -I/usr/local/cuda-5.0/include -I/usr/local/cuda-5.0/include/include -I/home/fabian/software/odeint -I/opt/cern/root/root_v5.34.01/include -I/data/pieges/fabian/SINS/code/src -I/data/pieges/fabian/SINS/code/include -I/usr/local/cuda-5.0/include\n/opt/cern/root/root_v5.34.01/include/TMap.h(134): warning: unrecognized GCC pragma\n\n/opt/cern/root/root_v5.34.01/include/TMap.h(135): warning: unrecognized GCC pragma\n\n/opt/cern/root/root_v5.34.01/include/TMap.h(176): warning: unrecognized GCC pragma\n\n-- Generating temporary cmake readable file: /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/SINS_generated_SINS_core.cu.o.depend.tmp\n/usr/bin/cmake -D input_file:FILEPATH=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/SINS_generated_SINS_core.cu.o.NVCC-depend -D output_file:FILEPATH=/data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/SINS_generated_SINS_core.cu.o.depend.tmp -P /usr/share/cmake-2.8/Modules/FindCUDA/make2cmake.cmake\n/opt/cern/root/root_v5.34.01/include/TMap.h(134): warning: unrecognized GCC pragma\n\n/opt/cern/root/root_v5.34.01/include/TMap.h(135): warning: unrecognized GCC pragma\n\n/opt/cern/root/root_v5.34.01/include/TMap.h(176): warning: unrecognized GCC pragma\n\n-- Copy if different /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/SINS_generated_SINS_core.cu.o.depend.tmp to /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/SINS_generated_SINS_core.cu.o.depend\n/usr/bin/cmake -E copy_if_different /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/SINS_generated_SINS_core.cu.o.depend.tmp /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/SINS_generated_SINS_core.cu.o.depend\n-- Removing /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/SINS_generated_SINS_core.cu.o.depend.tmp and /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/SINS_generated_SINS_core.cu.o.NVCC-depend\n/usr/bin/cmake -E remove /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/SINS_generated_SINS_core.cu.o.depend.tmp /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/SINS_generated_SINS_core.cu.o.NVCC-depend\n-- Generating /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/./SINS_generated_SINS_core.cu.o\n/usr/local/cuda-5.0/bin/nvcc /data/pieges/fabian/SINS/code/SINS_core.cu -c -o /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/./SINS_generated_SINS_core.cu.o -m64 -DHAS_ROOT -DSINS_DO_ELECTRIC_FIELD -DSINS_DO_BUFFER_GAS -Xcompiler ,\\\"-g\\\" -arch=sm_20 --compiler-bindir=/usr/bin/g++ -DSINS_COMPUTE_ON_GPU -DNVCC -I/usr/local/cuda-5.0/include -I/usr/local/cuda-5.0/include/include -I/home/fabian/software/odeint -I/opt/cern/root/root_v5.34.01/include -I/data/pieges/fabian/SINS/code/src -I/data/pieges/fabian/SINS/code/include -I/usr/local/cuda-5.0/include\nGenerated /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_bufferGas.cu.o successfully.\nGenerated /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_constants.cu.o successfully.\nGenerated /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_IOManager.cu.o successfully.\nGenerated /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/src/./SINS_generated_SINS_statistics.cu.o successfully.\n/opt/cern/root/root_v5.34.01/include/TMap.h(134): warning: unrecognized GCC pragma\n\n/opt/cern/root/root_v5.34.01/include/TMap.h(135): warning: unrecognized GCC pragma\n\n/opt/cern/root/root_v5.34.01/include/TMap.h(176): warning: unrecognized GCC pragma\n\n/data/pieges/fabian/SINS/code/SINS_core.cu(316): warning: variable \"collisionTable\" is used before its value is set\n\n/data/pieges/fabian/SINS/code/SINS_core.cu(215): warning: variable \"dummy\" was set but never used\n\n/opt/cern/root/root_v5.34.01/include/TMap.h(134): warning: unrecognized GCC pragma\n\n/opt/cern/root/root_v5.34.01/include/TMap.h(135): warning: unrecognized GCC pragma\n\n/opt/cern/root/root_v5.34.01/include/TMap.h(176): warning: unrecognized GCC pragma\n\n/data/pieges/fabian/SINS/code/SINS_core.cu(316): warning: variable \"collisionTable\" is used before its value is set\n\n/data/pieges/fabian/SINS/code/SINS_core.cu(215): warning: variable \"dummy\" was set but never used\n\nptxas fatal : Unresolved extern function '_ZN14SINS_bufferGas10doTheRobotERd'\n-- Removing /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/./SINS_generated_SINS_core.cu.o\n/usr/bin/cmake -E remove /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/./SINS_generated_SINS_core.cu.o\nCMake Error at SINS_generated_SINS_core.cu.o.cmake:256 (message):\n Error generating file\n /data/pieges/fabian/SINS/workdir/CMakeFiles/SINS.dir/code/./SINS_generated_SINS_core.cu.o\n\n\nmake[2]: *** [CMakeFiles/SINS.dir/code/./SINS_generated_SINS_core.cu.o] Erreur 1\nmake[2]: quittant le répertoire « /data/pieges/fabian/SINS/workdir »\nmake[1]: *** [CMakeFiles/SINS.dir/all] Erreur 2\nmake[1]: quittant le répertoire « /data/pieges/fabian/SINS/workdir »\nmake: *** [all] Erreur 2\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"17","creation_date":"2014-02-18 16:35:35.027 UTC","favorite_count":"1","last_activity_date":"2014-02-18 20:19:43.527 UTC","last_edit_date":"2017-05-23 10:31:56.723 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"1410010","post_type_id":"1","score":"2","tags":"cuda|compilation|cmake|code-separation","view_count":"480"} +{"id":"34624368","title":"Why isn't the following function selecting all the checkboxes inside this directive?","body":"\u003cp\u003eThe following directive has two tabels: one with checkboxes and another without checkboxes. It also has a function which selects all the checkboxes:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e .directive('tableList', function() {\n return {\n restrict: 'EA',\n template: '\u0026lt;button ng-if=\"listAll\" type=\"button\" class=\"btn btn-primary btn-lg\" data-toggle=\"modal\" data-target=\"#myModal\"\u0026gt;' +\n 'Launch demo modal' +\n '\u0026lt;/button\u0026gt;' +\n '\u0026lt;table class=\"table table-stripped\"\u0026gt;' +\n '\u0026lt;thead\u0026gt;' +\n '\u0026lt;th\u0026gt;SOME CODE\u0026lt;/th\u0026gt;' +\n '\u0026lt;/tr\u0026gt;' +\n '\u0026lt;/thead\u0026gt;' +\n '\u0026lt;tbody\u0026gt;' +\n '\u0026lt;tr ng-repeat=\"item in listThis\"\u0026gt;' +\n '\u0026lt;th scope=\"row\"\u0026gt;{{$index + 1}}\u0026lt;/th\u0026gt;' +\n '\u0026lt;td\u0026gt;\u0026lt;a href=\"#/groups/{{item.id}}\"\u0026gt;{{item.name}}\u0026lt;/a\u0026gt;\u0026lt;/td\u0026gt;' +\n '\u0026lt;td\u0026gt;SOME CODE\u0026lt;/td\u0026gt;' +\n '\u0026lt;/tr\u0026gt;' +\n '\u0026lt;/tbody\u0026gt;' +\n '\u0026lt;/table\u0026gt;' +\n '\u0026lt;div ng-if=\"listAll\" class=\"\" id=\"myModal\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"myModalLabel\"\u0026gt;' +\n '\u0026lt;div class=\"modal-dialog\"\u0026gt;' +\n '\u0026lt;div class=\"modal-content\"\u0026gt;' +\n '\u0026lt;div class=\"modal-header\"\u0026gt;' +\n '\u0026lt;button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\"\u0026gt;\u0026lt;span aria-hidden=\"true\"\u0026gt;\u0026amp;times;\u0026lt;/span\u0026gt;\u0026lt;/button\u0026gt;' +\n '\u0026lt;h4 class=\"modal-title\"\u0026gt;Modal title\u0026lt;/h4\u0026gt;' +\n '\u0026lt;/div\u0026gt;' +\n '\u0026lt;div class=\"modal-body\"\u0026gt;' +\n '\u0026lt;table class=\"table table-stripped list-all\"\u0026gt;' +\n '\u0026lt;thead\u0026gt;' +\n '\u0026lt;tr\u0026gt;' +\n '\u0026lt;th\u0026gt;\u0026lt;input type=\"checkbox\" ng-model=\"selectedAll\" ng-click=\"checkAll()\" /\u0026gt;\u0026lt;/th\u0026gt;' +\n '\u0026lt;th\u0026gt;SOME CODE\u0026lt;/th\u0026gt;' +\n '\u0026lt;/tr\u0026gt;' +\n '\u0026lt;/thead\u0026gt;' +\n '\u0026lt;tbody\u0026gt;' +\n '\u0026lt;tr ng-repeat=\"item in listAll\"\u0026gt;' +\n '\u0026lt;th scope=\"row\"\u0026gt;\u0026lt;input type=\"checkbox\" value=\"0\" ng-model=\"item.selected\"\u0026gt;\u0026lt;/th\u0026gt;' +\n '\u0026lt;td\u0026gt;\u0026lt;a href=\"#/groups/{{item.id}}\"\u0026gt;{{item.name}}\u0026lt;/a\u0026gt;\u0026lt;/td\u0026gt;' +\n '\u0026lt;td\u0026gt;SOME CODE\u0026lt;/td\u0026gt;' +\n '\u0026lt;/tr\u0026gt;' +\n '\u0026lt;/tbody\u0026gt;' +\n '\u0026lt;/table\u0026gt;' +\n '\u0026lt;/div\u0026gt;' +\n '\u0026lt;div class=\"modal-footer\"\u0026gt;' +\n '\u0026lt;button type=\"button\" class=\"btn btn-primary\"\u0026gt;Save changes\u0026lt;/button\u0026gt;' +\n '\u0026lt;/div\u0026gt;' +\n '\u0026lt;/div\u0026gt;\u0026lt;!-- /.modal-content --\u0026gt;' +\n '\u0026lt;/div\u0026gt;\u0026lt;!-- /.modal-dialog --\u0026gt;' +\n '\u0026lt;/div\u0026gt;\u0026lt;!-- /.modal --\u0026gt;',\n scope: {\n listThis: \"=\",\n listAll: \"=\",\n submit: \"\u0026amp;\"\n },\n controller: function() {\n },\n link: function(scope, elem, attr, ctrl) {\n scope.checkAll = function() {\n if (scope.selectedAll) {\n scope.selectedAll = true\n } else {\n scope.selectedAll = false\n }\n angular.forEach(scope.listAll, function (item) {\n item.selected = scope.selectedAll\n })\n }\n }\n };\n})\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe checkboxes work. This is how it looks like if I check the first item:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[\n {\n \"id\": \"1\",\n \"name\": \"User 1\",\n \"selected\": true\n },\n {\n \"id\": \"2\",\n \"name\": \"User 2\",\n \"selected\": false\n },\n {\n \"id\": \"3\",\n \"name\": \"User 3\",\n \"selected\": false\n }\n]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut when I click the checkboxe that checks all the items nothing happens:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/HMSIi.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/HMSIi.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eWhat could be the problem?\u003c/p\u003e\n\n\u003cp\u003eThis is how I'm using the directive:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;table-list\nlist-this=\"users\"\nlist-all=\"users\"\nsubmit=\"submit(event)\"\u0026gt;\n \u0026lt;/table-list\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"34624452","answer_count":"1","comment_count":"0","creation_date":"2016-01-06 01:48:03.573 UTC","last_activity_date":"2016-01-06 01:59:41.123 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"122536","post_type_id":"1","score":"0","tags":"javascript|angularjs|checkbox","view_count":"29"} +{"id":"5779500","title":"why do i need EventQueue to start a new thread in java EDT? (JAVA)","body":"\u003cp\u003eDid I get it right? EDT is the main thread of GUI. To start a long operation, it's preferred to run it in new thread. So why do we need to use EventQueue for that? Why can't we simply create and run new thread just like in non-Swing programs?\u003c/p\u003e","accepted_answer_id":"5779543","answer_count":"2","comment_count":"0","creation_date":"2011-04-25 14:42:32.153 UTC","last_activity_date":"2011-04-25 15:01:51.993 UTC","last_edit_date":"2011-04-25 14:50:24.74 UTC","last_editor_display_name":"","last_editor_user_id":"66686","owner_display_name":"","owner_user_id":"700998","post_type_id":"1","score":"1","tags":"java|multithreading|swing|thread-safety|eventqueue","view_count":"252"} +{"id":"18855571","title":"Rails has_many, habtm SQL join not returning any results","body":"\u003cp\u003eI'm trying to get an array of customers who have purchase at least two items. The associations are pretty simple, but I'm just not getting any results in my test. Maybe another set of eyes can see what I'm missing.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e# customer.rb\nclass Customer \u0026lt; Person\n has_many :orders, foreign_key: 'person_id'\n has_many :items, through: :orders\n\n\n # This is what I'm needing help with:\n def self.min_2_orders\n joins(:items).group('items_orders.item_id').having('COUNT(items_orders.item_id) \u0026gt;= ?', 2)\n end\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e-\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e# order.rb\nclass Order \u0026lt; ActiveRecord::Base\n belongs_to :customer, foreign_key: 'person_id'\n has_and_belongs_to_many :items\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e-\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e# item.rb\nclass Item \u0026lt; ActiveRecord::Base\n has_and_belongs_to_many :orders\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e-\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e# customer_spec.rb\nit \"finds customers who have ordered a min of 2 items\" do\n @order1, @order2 = FactoryGirl.create_list(:order, 2) #returns 2 created orders\n\n @order2.items \u0026lt;\u0026lt; FactoryGirl.create_list(:item, 2) #returns 2 created items\n\n @customer1 = @order2.customer\n @customer2 = @order1.customer\n\n ## Debug tests\n Order.count.should == 2 #pass\n Customer.count.should == 2 #pass\n Item.count.should == 2 #pass\n @order_min.items.count.should == 2 #pass\n @customer1.items.count.should == 2 #pass\n\n puts Order.all.to_yaml # debug. see below\n puts Customer.all.to_yaml # debug. see below\n puts Item.all.to_yaml # debug. see below\n # End debugging\n\n # The final test\n Customer.min_2_orders.should == [@customer1] # FAIL. returns []\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere are the debugging logs (the sql query, and the YAML db data):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\"SELECT 'people'.* FROM 'people'\n INNER JOIN 'orders' ON 'orders'.'person_id' = 'people'.'id'\n INNER JOIN 'items_orders' ON 'items_orders'.'order_id' = 'orders'.'id'\n INNER JOIN 'items' ON 'items'.'id' = 'items_orders'.'item_id'\nWHERE 'people'.'type' IN ('Customer')\n GROUP BY items_orders.item_id\n HAVING COUNT(items_orders.item_id) \u0026gt;= 2\"\n\n---\n- !ruby/object:Order\n attributes:\n id: 1\n person_id: 1\n created_at: 2013-06-18 16:42:17.558683000 Z\n updated_at: 2013-09-17 16:42:17.597082000 Z\n- !ruby/object:Order\n attributes:\n id: 2\n person_id: 2\n created_at: 2013-09-17 16:42:17.600267000 Z\n updated_at: 2013-09-17 16:42:17.600267000 Z\n---\n- !ruby/object:Customer\n attributes:\n id: 1\n first_name: Wes\n type: Customer\n created_at: 2013-09-17 16:42:17.565677000 Z\n updated_at: 2013-09-17 16:42:17.565677000 Z\n- !ruby/object:Customer\n attributes:\n id: 2\n first_name: Wes\n type: Customer\n created_at: 2013-09-17 16:42:17.599013000 Z\n updated_at: 2013-09-17 16:42:17.599013000 Z\n---\n- !ruby/object:Item\n attributes:\n id: 1\n name: Product 1\n created_at: 2013-09-17 16:42:17.632347000 Z\n updated_at: 2013-09-17 16:42:17.632347000 Z\n- !ruby/object:Item\n attributes:\n id: 2\n name: Product 2\n created_at: 2013-09-17 16:42:17.633920000 Z\n updated_at: 2013-09-17 16:42:17.633920000 Z\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"18857003","answer_count":"1","comment_count":"0","creation_date":"2013-09-17 16:54:30.78 UTC","last_activity_date":"2013-09-17 18:15:07.947 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1207687","post_type_id":"1","score":"1","tags":"sql|ruby-on-rails|ruby-on-rails-3|scope|associations","view_count":"185"} +{"id":"31878165","title":"Adding a 0 in a Date variable","body":"\u003cp\u003eIm doing a report via Reporting Services. One of my textbox have an expression that is receving a parameter that is basically a string that contains a date for example '20110410' and I need to convert this string to date, add the / and place the day first,month,year.\u003c/p\u003e\n\n\u003cp\u003eThis has been done already. But the thing is that I need to add a 0 after the day and month when these are below 10, so instead of having 1/4/2011 I want 01/04/2011.\u003c/p\u003e\n\n\u003cp\u003eI dont know how to use the Tag code so sorry in advance if the code is not showing properly.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e=IIF(Parameters!Uperiodo.Value = \"Día\",\nIIF(Day(FormatDateTime(\nCDate(mid(Parameters!Desde.Value,5,2) \u0026amp; \"/\" \u0026amp; mid(Parameters!Desde.Value,1,4) \u0026amp; \"/\" \u0026amp; mid(Parameters!Desde.Value,7,2)),DateFormat.ShortDate))\u0026lt;10,\n\"0\"+Day(FormatDateTime(\nCDate(mid(Parameters!Desde.Value,5,2) \u0026amp; \"/\" \u0026amp; mid(Parameters!Desde.Value,1,4) \u0026amp; \"/\" \u0026amp; mid(Parameters!Desde.Value,7,2)),DateFormat.ShortDate)),\n(Day(FormatDateTime(\nCDate(mid(Parameters!Desde.Value,5,2) \u0026amp; \"/\" \u0026amp; mid(Parameters!Desde.Value,1,4) \u0026amp; \"/\" \u0026amp; mid(Parameters!Desde.Value,7,2)),DateFormat.ShortDate))))\n\u0026amp; \"/\" \u0026amp; \nMonth(FormatDateTime(\nCDate(mid(Parameters!Desde.Value,5,2) \u0026amp; \"/\" \u0026amp; mid(Parameters!Desde.Value,1,4) \u0026amp; \"/\" \u0026amp; mid(Parameters!Desde.Value,7,2)),DateFormat.ShortDate)) \n\u0026amp; \"/\" \u0026amp; \nYear(FormatDateTime(\nCDate(mid(Parameters!Desde.Value,5,2) \u0026amp; \"/\" \u0026amp; mid(Parameters!Desde.Value,1,4) \u0026amp; \"/\" \u0026amp; mid(Parameters!Desde.Value,7,2)),DateFormat.ShortDate))\n,\nMonth(FormatDateTime(\nCDate(mid(Parameters!Desde.Value,5,2) \u0026amp; \"/\" \u0026amp; mid(Parameters!Desde.Value,1,4) \u0026amp; \"/\" \u0026amp; mid(Parameters!Desde.Value,7,2)),DateFormat.ShortDate)) \n\u0026amp; \"/\" \u0026amp; \nYear(FormatDateTime(\nCDate(mid(Parameters!Desde.Value,5,2) \u0026amp; \"/\" \u0026amp; mid(Parameters!Desde.Value,1,4) \u0026amp; \"/\" \u0026amp; mid(Parameters!Desde.Value,7,2)),DateFormat.ShortDate))\n)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e\n\n\u003cp\u003eEDIT: Sorry I did not explain why we do this. We need to do this as the server where the report needs to be downloaded have an english format (mm/dd/yyyy).\u003c/p\u003e\n\n\u003cp\u003eBest Regards,\u003c/p\u003e","answer_count":"2","comment_count":"4","creation_date":"2015-08-07 12:50:32.737 UTC","last_activity_date":"2015-08-07 13:36:22.78 UTC","last_edit_date":"2015-08-07 13:20:19.797 UTC","last_editor_display_name":"","last_editor_user_id":"5186377","owner_display_name":"","owner_user_id":"5186377","post_type_id":"1","score":"-1","tags":"asp.net|reporting-services","view_count":"49"} +{"id":"22038236","title":"Creating a segue for a TableViewController cell's detail accessory button","body":"\u003cp\u003eI'm trying to implement segueing from a tableview controller when the user taps the cell's accessory button.\u003c/p\u003e\n\n\u003cp\u003eI've searched on here and have some new things to try but I just wanted to ask whether in the storyboard you can actually create the segues from the accessory button, or whether you just need to create them from the tableviewcontroller.\u003c/p\u003e\n\n\u003cp\u003eIt'll be within the accessoryButtonTappedForRowWithIndexPath that I'll want to act on the tap, but I see some answers on here say that you have to just go from the tableviewcontroller when creating your segues where as another answer said that the sender within prepare for segue would be set to the cell that contains your accessory view.\u003c/p\u003e\n\n\u003cp\u003eWhenever I try to ctrl drag from the accessory button in my prototype cell it just gets rid of the already existing on-selected segue I'd setup for that cell.\u003c/p\u003e\n\n\u003cp\u003eJust wanted to know for sure, what the best practice was before I started making all my detail accessory segues just go from the root TableViewController and passing through accessoryButtonTappedForRowWithIndexPath's indexPath (or it's row) as the sender to my prepareForSegue.\u003c/p\u003e\n\n\u003cp\u003eCheers\u003c/p\u003e","accepted_answer_id":"22096127","answer_count":"1","comment_count":"2","creation_date":"2014-02-26 10:17:11.573 UTC","last_activity_date":"2014-02-28 13:10:16.547 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3325278","post_type_id":"1","score":"0","tags":"ios7|storyboard|uitableview|segue","view_count":"363"} +{"id":"37484341","title":"Javascript sums total with addrow","body":"\u003cp\u003eFirst of all, sorry for my bad english language.\u003c/p\u003e\n\n\u003cp\u003eSo, I want to sums my 2 coloumn, but i have add.row condition.\nHere my code :\u003c/p\u003e\n\n\u003cp\u003e\u003cdiv class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\"\u003e\r\n\u003cdiv class=\"snippet-code\"\u003e\r\n\u003cpre class=\"snippet-code-js lang-js prettyprint-override\"\u003e\u003ccode\u003e\u0026lt;script\u0026gt;\r\n$(function(){\r\n $('.qty, .unit').on('blur', function(e){\r\n var qty = parseFloat( $('.qty').val() ), \r\n unit = parseFloat( $('.unit').val() );\r\n \r\n if( isNaN(qty) || isNaN(unit) ) {\r\n $('.result').text('');\r\n return false;\r\n }\r\n \r\n var total = qty * unit;\r\n $('.result').text( total );\r\n });\r\n});\r\n\u0026lt;/script\u0026gt;\u003c/code\u003e\u003c/pre\u003e\r\n\u003cpre class=\"snippet-code-html lang-html prettyprint-override\"\u003e\u003ccode\u003e\u0026lt;script src=\"https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\r\n\u0026lt;td\u0026gt;\u0026lt;input type=\"text\" class=\"form-control qty\" name=\"p_qty[]\" /\u0026gt;\u0026lt;/td\u0026gt;\r\n\u0026lt;td\u0026gt;\u0026lt;input type=\"text\" class=\"form-control unit\" name=\"p_harga[]\" /\u0026gt;\u0026lt;/td\u0026gt;\r\n\u0026lt;td\u0026gt;\u0026lt;strong\u0026gt;\u0026lt;span class=\"result\" name=\"p_jumlah[]\"\u0026gt;\u0026lt;/span\u0026gt;\u0026lt;/strong\u0026gt;\u0026lt;/td\u0026gt;\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003c/p\u003e\n\n\u003cp\u003ehere my screenshoot\n\u003ca href=\"http://i.stack.imgur.com/szRHL.png\" rel=\"nofollow\"\u003eScreenshoot\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003ewhen im run, this code success but only in row 1 and not work in row 2++\nhow can i fix it?\u003c/p\u003e\n\n\u003cp\u003eThank you so much.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-05-27 13:07:33.907 UTC","last_activity_date":"2016-05-27 13:44:18.7 UTC","last_edit_date":"2016-05-27 13:29:37.753 UTC","last_editor_display_name":"","last_editor_user_id":"6391083","owner_display_name":"","owner_user_id":"6391083","post_type_id":"1","score":"0","tags":"javascript|php","view_count":"23"} +{"id":"4185234","title":"Render Apostrophe of Twitter feed is not correct in IE","body":"\u003cp\u003eCheck out this page using IE : \u003ca href=\"http://search.twitter.com/search?q=%23testvoorklant\" rel=\"nofollow\"\u003ehttp://search.twitter.com/search?q=%23testvoorklant\u003c/a\u003e\nYou will find out the apostrophe is rendered as \u0026amp; apos ;!\u003c/p\u003e\n\n\u003cp\u003eIf I want to use these feeds in my website, how should I handle this problem?\u003c/p\u003e\n\n\u003cp\u003eRegards\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2010-11-15 14:23:01.693 UTC","last_activity_date":"2010-11-15 14:46:19.673 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"493473","post_type_id":"1","score":"0","tags":"html|apostrophe","view_count":"419"} +{"id":"31341089","title":"JavaScript Pass Function Argument Out Along With Return Value","body":"\u003cp\u003eHow do I pass out the function argument of an ajax get in Java Script along with the return value?\u003c/p\u003e\n\n\u003cp\u003eIn the example below, I want to bring through the value of the GetServer function argument \u003ccode\u003eid\u003c/code\u003e and make it accessible to the function \u003ccode\u003ereturnValue\u003c/code\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction getServerList(id) {\n $.ajax({\n type: \"GET\",\n url: \"/BackEndFunction/\" + id,\n contentType: \"application/json; charset=utf-8\",\n dataType: \"json\",\n success: returnValue\n });\n}\n\nfunction returnValue(Data) {\n var _size = 0;\n var id= id // passed from getserverlist\n for (var i = 0; i\u0026lt; Data.length; i++) {\n _size += Data[i]._size;\n }\n data_dictionary[id] = _size;\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"31341174","answer_count":"2","comment_count":"3","creation_date":"2015-07-10 12:42:16.877 UTC","last_activity_date":"2015-07-10 12:48:45.227 UTC","last_edit_date":"2015-07-10 12:48:38.963 UTC","last_editor_display_name":"","last_editor_user_id":"4248776","owner_display_name":"","owner_user_id":"4248776","post_type_id":"1","score":"1","tags":"javascript|jquery","view_count":"41"} +{"id":"12283996","title":"Is it possible to /manipulate/ functions as it is strings?","body":"\u003cpre\u003e\u003ccode\u003evar myString = '';\nmyString += 'foo';\nmyString += 'bar';\nmyString = myString.replace(/oba/, 'qux');\n\nconsole.log(myString) // produces \"foquxr\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs there any way to likewise tinker around with functions, like, say, turning \u003ccode\u003efunction(a) { a += 'b'; return a; }\u003c/code\u003e info \u003ccode\u003efunction(a) { a += 'b'; console.log(a); return a + 'c'; }\u003c/code\u003e?\u003c/p\u003e","accepted_answer_id":"12284070","answer_count":"2","comment_count":"7","creation_date":"2012-09-05 14:41:24.36 UTC","last_activity_date":"2012-09-05 15:28:05.223 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1597180","post_type_id":"1","score":"0","tags":"javascript|function|semantics","view_count":"59"} +{"id":"25297526","title":"How to display slide full screen image from SD card in Android","body":"\u003cp\u003e\u003cstrong\u003eNeed help!\u003c/strong\u003e\nI want to display images on full screen in Android and change by sliding.\u003c/p\u003e\n\n\u003cp\u003eWhen the application will run, it will load all images from SD card and direct display on the screen. and the user can change image by swipe.\u003c/p\u003e\n\n\u003cp\u003eI am following the tutorial but can't see the image since its very complex: \u003ca href=\"http://www.androidhive.info/2013/09/android-fullscreen-image-slider-with-swipe-and-pinch-zoom-gestures/\" rel=\"nofollow\"\u003eclick here\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eIf someone please help me? You can download my code from here please: \u003ca href=\"https://www.dropbox.com/s/lakfpxw80t653fx/ImageViewTestProj.rar\" rel=\"nofollow\"\u003eDropbox\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"25298315","answer_count":"1","comment_count":"2","creation_date":"2014-08-13 22:54:06.473 UTC","last_activity_date":"2014-08-14 00:31:01.507 UTC","last_editor_display_name":"","owner_display_name":"user3897419","post_type_id":"1","score":"1","tags":"android|imageview","view_count":"326"} +{"id":"33174763","title":"How to modify a function for different dim?","body":"\u003cp\u003eI have got a function which was used for his data \u003ccode\u003edim(1000*1000)\u003c/code\u003e.My data are the same but with different \u003ccode\u003edim (500*1300)\u003c/code\u003e.How Can I adapt the function to my dims? \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e image.arr = array(dim = c(1000, 1000, 20)))\n interpolated.lst = vector(mode = \"list\", length = 1000)\n system.time(\n {\n for(i in 1:1200){\n interpolated.lst[[i]] = \n apply(image.arr[i, , ], 1,\n FUN = function(x){\n imageSpline(x = dates, y = x, xout = 1:365)$y\n }\n )\n }\n}\n)\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"33174822","answer_count":"1","comment_count":"0","creation_date":"2015-10-16 15:57:57.923 UTC","last_activity_date":"2015-10-16 17:29:34.463 UTC","last_edit_date":"2015-10-16 17:29:34.463 UTC","last_editor_display_name":"","last_editor_user_id":"5142717","owner_display_name":"","owner_user_id":"5142717","post_type_id":"1","score":"0","tags":"r","view_count":"21"} +{"id":"43675608","title":"asp.net core can't get xml data from url","body":"\u003cp\u003eI'm using Amazon API to generate request for ItemLookup. After signing the request I got a url:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://webservices.amazon.com/onca/xml?AWSAccessKeyId=[AccessKey]\u0026amp;AssociateTag=[AssociateTag]\u0026amp;ItemId=B06XBCY6DW\u0026amp;Operation=ItemLookup\u0026amp;ResponseGroup=Images%2CItemAttributes%2COffers%2CReviews\u0026amp;Service=AWSECommerceService\u0026amp;Timestamp=2050-02-13T12:00:00Z\u0026amp;Version=2016-02-12\u0026amp;Signature=[Signature]\" rel=\"nofollow noreferrer\"\u003ehttp://webservices.amazon.com/onca/xml?AWSAccessKeyId=[AccessKey]\u0026amp;AssociateTag=[AssociateTag]\u0026amp;ItemId=B06XBCY6DW\u0026amp;Operation=ItemLookup\u0026amp;ResponseGroup=Images%2CItemAttributes%2COffers%2CReviews\u0026amp;Service=AWSECommerceService\u0026amp;Timestamp=2050-02-13T12:00:00Z\u0026amp;Version=2016-02-12\u0026amp;Signature=[Signature]\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eWhich I use in browser and I can see nice xml with item's data, but When I try to get that data with c# I get error \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eThe Uri parameter must be a file system relative or absolute path.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eThe method I'm using to get data is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar itemXml = XElement.Load(url);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow can I get that xml in c#??\u003c/p\u003e","accepted_answer_id":"43676244","answer_count":"1","comment_count":"3","creation_date":"2017-04-28 08:30:06.4 UTC","last_activity_date":"2017-04-28 09:03:54.41 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3633116","post_type_id":"1","score":"0","tags":"c#|asp.net|xml|amazon-web-services|asp.net-core","view_count":"283"} +{"id":"32770797","title":"How do I overload `__eq__` to compare pandas DataFrames and Series?","body":"\u003cp\u003eFor clarity I will extract an excerpt from my code and use general names. I have a class \u003ccode\u003eFoo()\u003c/code\u003e that stores a DataFrame to an attribute.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport pandas as pd\nimport pandas.util.testing as pdt\n\nclass Foo():\n\n def __init__(self, bar):\n self.bar = bar # dict of dicts\n self.df = pd.DataFrame(bar) # pandas object \n\n def __eq__(self, other):\n if isinstance(other, self.__class__):\n return self.__dict__ == other.__dict__\n return NotImplemented\n\n def __ne__(self, other):\n result = self.__eq__(other)\n if result is NotImplemented:\n return result\n return not result\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, when I try to compare two instances of \u003ccode\u003eFoo\u003c/code\u003e, I get an excepetion related to the ambiguity of comparing two DataFrames (the comparison should work fine without the 'df' key in \u003ccode\u003eFoo.__dict__\u003c/code\u003e). \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ed1 = {'A' : pd.Series([1, 2], index=['a', 'b']),\n 'B' : pd.Series([1, 2], index=['a', 'b'])}\nd2 = d1.copy()\n\nfoo1 = Foo(d1)\nfoo2 = Foo(d2)\n\nfoo1.bar # dict\nfoo1.df # pandas DataFrame\n\nfoo1 == foo2 # ValueError \n\n[Out] ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFortunately, pandas has utility functions for asserting whether two DataFrames or Series are true. I'd like to use this function's comparison operation if possible.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epdt.assert_frame_equal(pd.DataFrame(d1), pd.DataFrame(d2)) # no raises\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThere are a few options to resolve the comparison of two \u003ccode\u003eFoo\u003c/code\u003e instances:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003ecompare a copy of \u003ccode\u003e__dict__\u003c/code\u003e, where \u003ccode\u003enew_dict\u003c/code\u003e lacks the df key\u003c/li\u003e\n\u003cli\u003edelete the df key from \u003ccode\u003e__dict__\u003c/code\u003e (not ideal) \u003c/li\u003e\n\u003cli\u003edon't compare \u003ccode\u003e__dict__\u003c/code\u003e, but only parts of it contained in a tuple \u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eoverload the \u003ccode\u003e__eq__\u003c/code\u003e to facilitate pandas DataFrame comparisons\u003c/strong\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eThe last option seems the most robust in the long-run, but I am not sure of the best approach. In the end, \u003cstrong\u003eI would like to refactor \u003ccode\u003e__eq__\u003c/code\u003e to compare all items from \u003ccode\u003eFoo.__dict__\u003c/code\u003e, including DataFrames (and Series).\u003c/strong\u003e Any ideas on how to accomplish this?\u003c/p\u003e","accepted_answer_id":"32771208","answer_count":"2","comment_count":"1","creation_date":"2015-09-24 20:58:48.127 UTC","last_activity_date":"2015-09-28 13:13:07.083 UTC","last_edit_date":"2015-09-28 09:28:10.047 UTC","last_editor_display_name":"","last_editor_user_id":"402884","owner_display_name":"","owner_user_id":"4531270","post_type_id":"1","score":"1","tags":"python|pandas|overloading|equality","view_count":"133"} +{"id":"42775997","title":"How to redirect with htaccess to https while adding a language paramterer","body":"\u003cp\u003eI have two domains example.com and example.de. Bot are pointing to the same server with the same website.\nIf somebody is opening the site he should be redirected to use \u003ca href=\"https://example.com\" rel=\"nofollow noreferrer\"\u003ehttps://example.com\u003c/a\u003e regardless of the queried domain.\u003c/p\u003e\n\n\u003cp\u003eUntil now I'm using the following htacces code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eRewriteEngine On\nRewriteCond %{HTTPS} off [OR]\nRewriteCond %{HTTP_HOST} !^example\\.com$ [NC]\nRewriteRule ^(.*) https://example.com/$1 [R=301,NE,L]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut now I want that everybody who was initially querying example.com is \"redirected\" to use the language parameter \u003ccode\u003e?l=2\u003c/code\u003e and everybode who opened example.de to use \u003ccode\u003e?l=1\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eIt would be great if anybody knows how to combine that with https.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-03-14 00:46:51.55 UTC","last_activity_date":"2017-03-14 04:03:20.787 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7705922","post_type_id":"1","score":"0","tags":".htaccess|redirect|https|get","view_count":"13"} +{"id":"44302321","title":"passport js authentication not working between node front end and backend server","body":"\u003cp\u003eI have 2 different express servers, one for front end serving react js files and another backend server.\u003c/p\u003e\n\n\u003cp\u003eFrontend server runs on the port:3003, backend server runs on the port:8000.\u003c/p\u003e\n\n\u003cp\u003eWhen i am firing a request from frontend server for login using Local Strategy, it returns me the user details but for further requests i have to login again.\u003c/p\u003e\n\n\u003cp\u003eThis is not the case when i have both frontend and backend code running on in same server.\u003c/p\u003e\n\n\u003cp\u003eSimilarly Facebook and Google Login Doesn't work.\u003c/p\u003e\n\n\u003cp\u003eIs it not supported to have different servers for frontend backend in passportJS?\u003c/p\u003e\n\n\u003cp\u003eCan some please suggest how to make it work\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2017-06-01 08:27:55.29 UTC","last_activity_date":"2017-06-01 08:27:55.29 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2033575","post_type_id":"1","score":"1","tags":"node.js|express|passport.js","view_count":"83"} +{"id":"27826990","title":"Storing multiple selected cells of type string from a datagridview to a list","body":"\u003cp\u003eI am working on a C# windows application where I have a DataGridView some some data on it. \nNow, I am trying to select multiple cells and want to access the values in the selected cells and store them in a list. I was able to store one cell in a variable but not sure I can get multiple cell values to a list\u003c/p\u003e\n\n\u003cp\u003eI used the following lines to store cell value in a variable\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e string product = dataGridViewIndex.CurrentCell.Value.ToString();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eMay I know a way to solve this?\u003c/strong\u003e\u003c/p\u003e","accepted_answer_id":"27827205","answer_count":"1","comment_count":"0","creation_date":"2015-01-07 19:19:00.047 UTC","last_activity_date":"2015-01-07 19:32:42.953 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2639188","post_type_id":"1","score":"-1","tags":"c#|list|datagridview","view_count":"235"} +{"id":"32703715","title":"Enable monitoring mode for RTL8188CUS via USB on Raspbian","body":"\u003cp\u003eI am trying to enable monitoring mode for a USB wifi dongle with the RTL8188CUS chipset on a raspberry pi model b+ (or any raspberry pi for that matter).\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$ lsusb\nBus 001 Device 005: ID 0bda:8176 Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN Adapter\n$ sudo iwconfig wlan0 mode monitor\nError for wireless request \"Set Mode\" (8B06) :\n SET failed on device wlan0 ; Invalid argument.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAccording to \u003ca href=\"https://github.com/raspberrypi/linux/issues/369\" rel=\"nofollow noreferrer\"\u003egithub/raspberrypi/linux/issues/369\u003c/a\u003e, you need to enable the rtlwifi/rtl8192cu kernel module that is included with the kernel distribution but not compiled. This requires minor modifications to some files as diff'ed below in 'STEP 2'. \u003c/p\u003e\n\n\u003cp\u003eThe USB issue mentioned in that thread has been resolved as of 4.1.6+, so the rtlwifi driver should work.\u003c/p\u003e\n\n\u003cp\u003eSteps to recreate on a fresh raspberry pi (model B+)...\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eSTEP 0: Update existing modules and kernel to latest\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$ sudo apt-get update\n$ sudo rpi-update\n$ uname -a\nLinux raspberrypi 4.1.7+ #815 PREEMPT Thu Sep 17 17:59:24 BST 2015 armv6l GNU/Linux\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eSTEP 1: Get the raspbian kernel source and add missing dependencies\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$ git clone --depth=1 https://github.com/raspberrypi/linux\n$ sudo apt-get install bc lshw\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eSTEP 2: Enable the rtlwifi (kernel) drivers for RTL8188CUS (RTL8192)\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eedit linux/drivers/net/wireless/Kconfig\n-#source \"drivers/net/wireless/rtlwifi/Kconfig\"\n-source \"drivers/net/wireless/rtl8192cu/Kconfig\"\n+source \"drivers/net/wireless/rtlwifi/Kconfig\"\n+#source \"drivers/net/wireless/rtl8192cu/Kconfig\"\n\n(Wheezy) edit linux/drivers/net/wireless/Makefile\n-#obj-$(CONFIG_RTLWIFI) += rtlwifi/\n+obj-$(CONFIG_RTLWIFI) += rtlwifi/\n\n(Jessie) edit linux/drivers/net/wireless/realtek/Makefile\n-#obj-$(CONFIG_RTLWIFI) += rtlwifi/\n+obj-$(CONFIG_RTLWIFI) += rtlwifi/\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eSTEP 3: Compile and install kernel (took many hours)\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eSummarized from \u003ca href=\"https://www.raspberrypi.org/documentation/linux/kernel/building.md\" rel=\"nofollow noreferrer\"\u003ekernel building documentation\u003c/a\u003e .\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$ cd linux\n$ KERNEL=kernel\n$ make bcmrpi_defconfig\n\n$ make zImage modules dtbs\n$ sudo make modules_install\n$ sudo cp arch/arm/boot/dts/*.dtb /boot/\n$ sudo cp arch/arm/boot/dts/overlays/*.dtb* /boot/overlays/\n$ sudo cp arch/arm/boot/dts/overlays/README /boot/overlays/\n$ sudo scripts/mkknlimg arch/arm/boot/zImage /boot/$KERNEL.img\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eSTEP 4: Reboot\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$ sudo reboot\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eSTEP 5: Check that the rtlwifi/rtl8192cu module is loaded\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$ lsmod | fgrep rtl8192cu\nrtl8192cu 100806 0 \nrtl_usb 14781 1 rtl8192cu\nrtl8192c_common 72091 1 rtl8192cu\nrtlwifi 101122 3 rtl_usb,rtl8192c_common,rtl8192cu\nmac80211 623281 3 rtl_usb,rtlwifi,rtl8192cu\n$\n$ lshw\n *-network:0\n description: Ethernet interface\n physical id: 1\n bus info: usb@1:1.3\n logical name: wlan0\n serial: 00:0b:81:94:e9:a3\n capabilities: ethernet physical\n configuration: broadcast=yes driver=rtl8192cu driverversion=4.1.7+ firmware=N/A link=no multicast=yes\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eSTEP 6: Try to activate monitoring mode\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$ sudo iwconfig wlan0 mode monitor\nError for wireless request \"Set Mode\" (8B06) :\n SET failed on device wlan0 ; Operation not supported.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat did i miss?\u003cbr\u003e\nIssue 369 seems to indicate that it can work with the rtlwifi driver?\u003c/p\u003e","accepted_answer_id":"33578428","answer_count":"1","comment_count":"2","creation_date":"2015-09-21 20:09:43.147 UTC","favorite_count":"4","last_activity_date":"2016-10-17 21:21:47.863 UTC","last_edit_date":"2016-06-19 18:30:53.487 UTC","last_editor_display_name":"","last_editor_user_id":"1601579","owner_display_name":"","owner_user_id":"1601579","post_type_id":"1","score":"9","tags":"linux|linux-kernel|wifi|raspbian|wificonfiguration","view_count":"8460"} +{"id":"14014311","title":"Java - Trying to generate factorials","body":"\u003cp\u003eI'm making a calculator, and am adding a few more complicated buttons. The one I can't get my head around is factorial. I know what it is, but can't seem to make it. When I look at other people's questions, the code - for me anyway - doesn't work (Btw this is not a homework question). Here is the bit of code around where the algorithm (is that the word for it?) for the factorial:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e} else if (oper.equals(\"shriek\")) {\n\n resultm.setText(\"\" + answer);\n resultl.setText(\"\");\n resultr.setText(\"\");\n oper = \"\";\n currentNuml = \"\";\n currentNumr = \"\";\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNB: The gap between\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e} else if (oper.equals(\"shriek\")) {\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eresultm.setText(\"\" + answer);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eis where the algorithm would go.\nThanks, any help would be appreciated!\u003c/p\u003e","accepted_answer_id":"14014530","answer_count":"1","comment_count":"2","creation_date":"2012-12-23 20:06:59.41 UTC","last_activity_date":"2012-12-23 20:38:15.39 UTC","last_edit_date":"2012-12-23 20:08:44.553 UTC","last_editor_display_name":"","last_editor_user_id":"635608","owner_display_name":"","owner_user_id":"1916880","post_type_id":"1","score":"2","tags":"java|calculator","view_count":"603"} +{"id":"45473061","title":"When reading CSV with `pd.read_csv`, the decimal places change (Pandas)","body":"\u003cpre\u003e\u003ccode\u003eexcel = pd.read_csv(\"EH_damages.csv\")\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHello! \nI used the above code to read a csv file into python. However \u003ccode\u003e0.289798953\u003c/code\u003e in original excel changed to \u003ccode\u003e0.289799\u003c/code\u003e. Even when I saved the number to text mode in the excel, python still read it as float and the number has fewer digits like \u003ccode\u003e0.289799\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eWhat is wrong with my code? THANKS!! \u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-08-03 00:44:28.757 UTC","last_activity_date":"2017-08-03 01:05:03.09 UTC","last_edit_date":"2017-08-03 00:52:12.613 UTC","last_editor_display_name":"","last_editor_user_id":"4909087","owner_display_name":"","owner_user_id":"8238003","post_type_id":"1","score":"-1","tags":"python|excel|pandas|csv|dataframe","view_count":"176"} +{"id":"7930999","title":"Can a Wordpress plugin (Blogroll) work on a non-Wordpress webpage?","body":"\u003cp\u003eSpecifically, we would like to have a Blogroll plugin on the Wordpress page, but have that also appear on a website. So when we update info in the Blogroll, that automatically appears on the website too. Both the website and Wordpress are on the same server. Would there be a specific Blogroll plugin that would do this, or is it generally possible with plugins?\u003c/p\u003e","accepted_answer_id":"7931272","answer_count":"1","comment_count":"0","creation_date":"2011-10-28 14:58:16.717 UTC","last_activity_date":"2011-10-28 15:19:20.43 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"652259","post_type_id":"1","score":"0","tags":"wordpress","view_count":"62"} +{"id":"18104622","title":"How can I 301 Redirect and Change Url with .htaccess?","body":"\u003cp\u003eI just discovered that I have some duplicate pages that I need to remove but some pages that should not exist are indexed and generating small amounts of traffic. I want to redirect those urls to the original ones.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://www.example.com/buy-something.php\" rel=\"nofollow\"\u003ehttp://www.example.com/buy-something.php\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eto \u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://www.example.com/something.php\" rel=\"nofollow\"\u003ehttp://www.example.com/something.php\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI basically need to remove the \"buy-\" in the urls and make sure the page is redirected to the proper page. Here is what I have so far:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#301 Redirect buy- to none\nRewriteRule ^([a-zA-Z\\.]+).php$ /buy-$1.php [L,R=301]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut this does nothing to the pages that should be redirected and adds a loop of buy-buy-buy-buy-buy-buy- to other pages and causes them to time out. I have tried a few other variations but to no prevail. \u003c/p\u003e\n\n\u003cp\u003eYour help is greatly appreciated.\u003c/p\u003e","accepted_answer_id":"18104803","answer_count":"2","comment_count":"1","creation_date":"2013-08-07 13:24:44.133 UTC","last_activity_date":"2013-08-07 13:57:00.227 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"878703","post_type_id":"1","score":"0","tags":"php|.htaccess|redirect|mod-rewrite","view_count":"90"} +{"id":"42195634","title":"How do I read the last line in the console output?","body":"\u003cp\u003eSo im trying to make a Java program that uses adb and fastboot to root my Nexus 6P. I have a class that can run the commands, but I need to capture the device ID from the output. when I run \u003ccode\u003eadb\u003c/code\u003e or \u003ccode\u003efastboot\u003c/code\u003e the output either looks like one of the three options below\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eList of devices attached\n* daemon not running. starting it now on port 5037 *\n* daemon started successfully *\n5VT7N16324000434 device\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eor\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eList of devices attached\n5VT7N16324000434 device\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eor\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e5VT7N16324000434 device\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow I need to capture the \u003ccode\u003e5VT7N16324000434\u003c/code\u003e and save it to a string. Though it will not always be the same. I have searched for hours with nothing helpful, and have no idea where to even start.\u003c/p\u003e\n\n\u003cp\u003eI run adb with this class\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport java.io.BufferedReader;\nimport java.io.InputStreamReader;\n\npublic class ExecuteShellCommand {\n\npublic static void main(String inputCommand) {\n\n ExecuteShellCommand obj = new ExecuteShellCommand();\n\n String command = inputCommand;\n\n String output = obj.executeCommand(command);\n\n System.out.println(output);\n\n}\n\nprivate String executeCommand(String command) {\n\n StringBuffer output = new StringBuffer();\n\n Process p;\n try {\n p = Runtime.getRuntime().exec(command);\n p.waitFor();\n BufferedReader reader =\n new BufferedReader(new InputStreamReader(p.getInputStream()));\n\n String line = \"\";\n while ((line = reader.readLine())!= null) {\n output.append(line + \"\\n\");\n }\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return output.toString();\n\n}\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI then need to read the out put for \u003ccode\u003e5VT7N16324000434\u003c/code\u003e or any string that could be in that place.\u003c/p\u003e","answer_count":"0","comment_count":"7","creation_date":"2017-02-13 02:09:46.157 UTC","last_activity_date":"2017-02-13 08:29:59.36 UTC","last_edit_date":"2017-02-13 08:29:59.36 UTC","last_editor_display_name":"","last_editor_user_id":"104891","owner_display_name":"","owner_user_id":"6772235","post_type_id":"1","score":"0","tags":"java|console|output|console-application","view_count":"177"} +{"id":"731598","title":"Unable to connect to Web Developers built in web server","body":"\u003cp\u003eWhen I yesterday returned to Visual Web Developer I was no longer able to run/debug my projects. Clicking the green play button launches ASP.NET Development Server (and it shows up in the systray) but the browser only shows the error message \"Firefox is not able to connect to localhost:58127\" (translated from Swedish). IE7 says \"Cannot show web page\".\u003c/p\u003e\n\n\u003cp\u003eI cannot figure out why this happens. It worked a couple of weeks back. Could there be a Windows setting that mess things up? (I've tried to disable the firewall without any change.)\u003c/p\u003e","accepted_answer_id":"732282","answer_count":"4","comment_count":"0","creation_date":"2009-04-08 20:06:00.603 UTC","last_activity_date":"2014-03-27 22:07:58.417 UTC","last_edit_date":"2009-04-08 20:46:12.723 UTC","last_editor_display_name":"","last_editor_user_id":"6144","owner_display_name":"","owner_user_id":"18215","post_type_id":"1","score":"1","tags":"asp.net|windows|webserver|visual-web-developer","view_count":"932"} +{"id":"37635201","title":"ExtJS 6 gridStore.model.setFields not a function","body":"\u003cp\u003eI used to work with \u003ccode\u003eExtJS 4.2\u003c/code\u003e and I used to work using:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003egridStore.model.setFields(...);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow in \u003ccode\u003eExtJS 6\u003c/code\u003e I tried to used that and I get:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/p2yM9.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/p2yM9.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eAny clue on what can I use now?\u003c/p\u003e\n\u003c/blockquote\u003e","answer_count":"1","comment_count":"1","creation_date":"2016-06-04 21:29:56.393 UTC","favorite_count":"1","last_activity_date":"2016-06-08 12:51:07.98 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1253667","post_type_id":"1","score":"0","tags":"extjs|extjs5|extjs6","view_count":"187"} +{"id":"23711009","title":"Drawing lines in part of a UIViewController","body":"\u003cp\u003eDrawing in a UIView works but it uses the entire screen. I have a UIViewController with a lot of text and results being displayed. I want to add draw some lines showing the tilt and roll angle of a a ship.I could do this with some \u003ccode\u003eCGAffineTransform rotate\u003c/code\u003e but would prefer not to.\u003c/p\u003e\n\n\u003cp\u003eWhat I have not worked out is how to implement CG components in a UIViewController where it is only addressing part of the screen.\u003c/p\u003e\n\n\u003cp\u003eIs this allowed?\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2014-05-17 11:52:39.153 UTC","last_activity_date":"2014-05-17 11:52:39.153 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1307542","post_type_id":"1","score":"0","tags":"ios|uiview|uiviewcontroller","view_count":"41"} +{"id":"9671793","title":"Limiting a Lua script's memory usage?","body":"\u003cp\u003eI've seen it said multiple times that there is no way to limit a Lua script's memory usage, including people jumping through hoops to prevent Lua scripts from creating functions and tables. But given that lua_newstate allows you to pass a custom allocator, couldn't one just use that to limit memory consumption? At worst, one could use an arena-based allocator and put a hard limit even on the amount of memory that could be used by fragmentation.\u003c/p\u003e\n\n\u003cp\u003eAm I missing something here?\u003c/p\u003e","accepted_answer_id":"9672205","answer_count":"1","comment_count":"4","creation_date":"2012-03-12 17:23:58.76 UTC","favorite_count":"2","last_activity_date":"2017-11-01 16:01:03.477 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"238431","post_type_id":"1","score":"6","tags":"lua|sandbox","view_count":"2639"} +{"id":"17156005","title":"Most efficent way of determing if a value is in a table","body":"\u003cp\u003eI often run into the situation where I want to determine if a value is in a table. Queries often happen often in a short time period and with similar values being searched therefore I want to do this the most efficient way. What I have now is\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eif($statment = mysqli_prepare($link, 'SELECT name FROM inventory WHERE name = ? LIMIT 1'))//name and inventory are arbitrarily chosen for this example\n{\n mysqli_stmt_bind_param($statement, 's', $_POST['check']);\n mysqli_stmt_execute($statement);\n mysqli_stmt_bind_result($statement, $result);\n mysqli_stmt_store_result($statement);//needed for mysqli_stmt_num_rows\n mysqli_stmt_fetch($statement);\n}\nif(mysqli_stmt_num_rows($statement) == 0)\n //value in table\nelse\n //value not in table\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs it necessary to call all the \u003ccode\u003emysqli_stmt_*\u003c/code\u003e functions? As discussed in \u003ca href=\"https://stackoverflow.com/questions/17095360/whats-the-difference-between-the-mysqli-functions-bind-result-store-result-and\"\u003ethis question\u003c/a\u003e for \u003ccode\u003emysqli_stmt_num_rows()\u003c/code\u003e to work the entire result set must be downloaded from the database server. I'm worried this is a waste and takes too long as I know there is 1 or 0 rows. Would it be more efficient to use the SQL \u003ccode\u003ecount()\u003c/code\u003e function and not bother with the \u003ccode\u003emysqli_stmt_store_result()\u003c/code\u003e? Any other ideas?\u003c/p\u003e\n\n\u003cp\u003eI noticed the \u003ca href=\"http://www.php.net/manual/en/mysqli.quickstart.prepared-statements.php\" rel=\"nofollow noreferrer\"\u003eprepared statement manual\u003c/a\u003e says \"A prepared statement or a parametrized statement is used to execute the same statement repeatedly with high efficiency\". What is highly efficient about it and what does it mean \u003cem\u003esame statement\u003c/em\u003e? For example if two separate prepared statements evaluated to be the same would it still be more efficient?\u003c/p\u003e\n\n\u003cp\u003eBy the way I'm using MySQL but didn't want to add the tag as a solution may be non-MySQL specific.\u003c/p\u003e","answer_count":"3","comment_count":"4","creation_date":"2013-06-17 20:14:15.743 UTC","last_activity_date":"2013-06-17 22:01:24.113 UTC","last_edit_date":"2017-05-23 11:50:01.317 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"1279820","post_type_id":"1","score":"0","tags":"php|sql|performance","view_count":"72"} +{"id":"1504954","title":"What is a lightweight CMS plugin with web interface?","body":"\u003cp\u003eI have an ASP.NET website with several standard pages like an About page, FAQ pages, Contact Info pages, etc. I would like to make the content on those pages easily editable by a few users through a backend web interface. The editor does not need to be fancy, or WYSIWYG, in fact I would prefer it use some sort of wiki markup, as long as there is a web interface which can be setup on a subdomain of the website. I don't have a preference as to how the content is stored, I can go for an XML or a SQL Server store. I would like to be able to place a control on the part of the page that needs the editable content, and not integrate the rest of the page with the CMS. I don't need extensive workflow functions, maybe just edit logging with the user who made the edit.\u003c/p\u003e","accepted_answer_id":"1505017","answer_count":"2","comment_count":"0","creation_date":"2009-10-01 16:16:46.573 UTC","favorite_count":"1","last_activity_date":"2014-10-13 18:17:13.157 UTC","last_edit_date":"2014-10-13 18:17:13.157 UTC","last_editor_display_name":"","last_editor_user_id":"321731","owner_display_name":"","owner_user_id":"13855","post_type_id":"1","score":"0","tags":"asp.net|plugins|content-management-system","view_count":"1157"} +{"id":"27664252","title":"Trouble passing the graphics class","body":"\u003cp\u003eI have a very simple Game Engine that I am trying to set up and I am clueless as to why it is throwing an exception but I'm not very experienced so I understand I'm probably doing something wrong.\u003c/p\u003e\n\n\u003cp\u003eI want to draw directly to a JFrame with a buffer strategy using the Graphics class. Everything works until I try to pass the Graphics g in to another class and then I get a thread error. Here is what I have:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport java.awt.Dimension;\nimport java.awt.Toolkit;\nimport javax.swing.JFrame;\n\n@SuppressWarnings(\"serial\")\npublic class GameFrame extends JFrame implements Runnable {\n\n public static final int WIDTH = 1280;\n public static final int HEIGHT = WIDTH * 9 / 16;\n private final int FPS = 60;\n\n private Thread thread;\n private long lastTime;\n\n private Game game;\n\n public GameFrame() {\n game = new Game(this);\n setLocation((int) ((Toolkit.getDefaultToolkit().getScreenSize().getWidth() - WIDTH) / 2), (int) ((Toolkit.getDefaultToolkit().getScreenSize().getHeight() - HEIGHT) / 2));\n setSize(new Dimension(WIDTH, HEIGHT));\n setResizable(false);\n thread = new Thread(this);\n setVisible(true);\n createBufferStrategy(3);\n setDefaultCloseOperation(EXIT_ON_CLOSE);\n thread.start();\n }\n\n public void run() {\n lastTime = System.currentTimeMillis();\n\n while (true) {\n long time = System.currentTimeMillis();\n if ((time - lastTime) * FPS \u0026gt; 1000) {\n lastTime = time;\n tick();\n draw();\n getBufferStrategy().show();\n }\n }\n }\n\n private void tick() {\n game.tick();\n }\n\n private void draw() {\n game.draw();\n }\n\n public static void main(String[] args) {\n new GameFrame();\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport java.awt.Graphics2D;\n\npublic class Game {\n\n private GameFrame frame;\n private Map map;\n\n public Game(GameFrame frame) {\n this.frame = frame;\n }\n\n public void tick() {\n\n }\n\n public void draw() {\n Graphics2D g = (Graphics2D) frame.getBufferStrategy().getDrawGraphics();\n g.fillRect(0, 0, 50, 50);\n map.draw(g);\n g.dispose();\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe rectangle from the draw method inside of Game will work but if I pass g to my Map class (which will be drawing the same thing) it causes a thread NullPointerException.\u003c/p\u003e\n\n\u003cp\u003eThanks so much in advance for any help with this or any additional comments you can provide!\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2014-12-27 04:09:12.443 UTC","last_activity_date":"2014-12-27 04:25:10.42 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2277786","post_type_id":"1","score":"0","tags":"java|swing|graphics|game-engine","view_count":"83"} +{"id":"35075628","title":"Multiple Infinite While Loops","body":"\u003cp\u003eWhen given this snippet of code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ewhile(true){\n ...\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow many times can this be asynchronously performed? \u003c/p\u003e\n\n\u003cp\u003eI've written this to test and how it interacts with \u003ca href=\"https://developers.google.com/v8/\" rel=\"nofollow\"\u003eGoogle's JavaScript V8 Engine\u003c/a\u003e and only one while loop is active at a time.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar cycles = 0;\nvar counter = new Date();\nvar OpsStore = [];\nvar threads = [];\n\nfor(var i = 0; i \u0026lt; 10; i++){\n setTimeout(newThread(i),0);\n}\nfunction renew(){\n if (secondPassed(counter, new Date())){\n counter = new Date();\n Ops();\n }\n cycles++;\n}\n\nfunction newThread(id){\n threads.push({id: id, active: true});\n return function(){\n while(true){\n console.log(id);\n threads[id].active = true;\n renew();\n }\n }\n}\n\nfunction Ops(){\n OpsStore.push(cycles);\n console.log(cycles, ' avg: ', getAvgOps());\n console.log(threads);\n cycles = 0;\n for(var i = 0; i \u0026lt; threads.length; i++){\n threads[i].active = false;\n }\n}\n\nfunction secondPassed(d1, d2){\n return ((d2 - d1) \u0026gt;= 1000); \n}\n\nfunction getAvgOps(){\n var sum = 0;\n for (var i = 0; i \u0026lt; OpsStore.length; i++){\n sum += OpsStore[i];\n }\n return sum / OpsStore.length;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eResult:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e4147371 ' avg: ' 4147371\n[ { id: 0, active: true },\n { id: 1, active: true },\n { id: 2, active: true },\n { id: 3, active: true },\n { id: 4, active: true },\n { id: 5, active: true },\n { id: 6, active: true },\n { id: 7, active: true },\n { id: 8, active: true },\n { id: 9, active: true } ]\n4071504 ' avg: ' 4109437.5\n[ { id: 0, active: true },\n { id: 1, active: false },\n { id: 2, active: false },\n { id: 3, active: false },\n { id: 4, active: false },\n { id: 5, active: false },\n { id: 6, active: false },\n { id: 7, active: false },\n { id: 8, active: false },\n { id: 9, active: false } ]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFor educational purposes, is it possible to have more than ONE while loop constantly iterating in JavaScript?\u003c/p\u003e","accepted_answer_id":"35075836","answer_count":"3","comment_count":"3","creation_date":"2016-01-29 02:00:04.923 UTC","favorite_count":"2","last_activity_date":"2017-05-18 11:17:14.203 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2475432","post_type_id":"1","score":"1","tags":"javascript|node.js|v8","view_count":"272"} +{"id":"37445485","title":"Rendering in looping using django","body":"\u003cp\u003eThe goal is rendering data to html using django every 5 second, but the problem is the looping does not working. This is the code:\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eview.py\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef form(request):\ntry:\n file_name = request.FILES['files'].name\n nama = \"uploads/\" + file_name\n seq_act, num_obsv, observer, list_obsv = pr.readexcel(nama,0)\n p, A, B = pr.make_initial(observer,num_obsv)\n p_lampau, A_lampau, B_lampau = pr.baum_welch(p, A, B, seq_act)\n\n while True:\n if len(temp)==0:\n break\n seq_act_test = list(temp)\n temp[:] = []\n\n real_seq, repair_seq = pr.process(p_lampau, A_lampau, B_lampau,\n seq_act_test, observer_test,\n num_obsv)\n return render(request,'main/form2.html',{'real_seq' : real_seq,\n 'repair_seq': repair_seq})\n time.sleep(5)\n\nexcept:\n return redirect('/main/awal')\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eform2.html\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;html\u0026gt;\n\u0026lt;head\u0026gt;\n {% load staticfiles %}\n \u0026lt;link rel=\"stylesheet\" type=\"text/css\" href=\"{% static 'main/vis.css' %}\" /\u0026gt;\n \u0026lt;script type=\"text/javascript\" src=\"{% static 'main/vis.js' %}\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;link href=\"{% static 'main/css/prism.css' %}\" rel=\"stylesheet\"\u0026gt;\n \u0026lt;link href=\"{% static 'main/css/ghpages-materialize.css' %}\" type=\"text/css\" rel=\"stylesheet\" media=\"screen,projection\"\u0026gt;\n \u0026lt;link href=\"http://fonts.googleapis.com/css?family=Inconsolata\" rel=\"stylesheet\" type=\"text/css\"\u0026gt;\n \u0026lt;link href=\"http://fonts.googleapis.com/icon?family=Material+Icons\" rel=\"stylesheet\"\u0026gt;\n \u0026lt;style type=\"text/css\"\u0026gt;\n #mynetwork {\n width: 100%;\n height: 600px;\n border: 1px solid lightgray;\n }\n \u0026lt;/style\u0026gt;\n\u0026lt;/head\u0026gt;\n\u0026lt;/html\u0026gt;\n\u0026lt;body\u0026gt;\n \u0026lt;div\u0026gt;\n \u0026lt;center\u0026gt;\n \u0026lt;b\u0026gt; {{ real_seq }}\u0026lt;br\u0026gt;\n \u0026lt;b\u0026gt;{{ repair_seq }}\n \u0026lt;/center\u0026gt;\n \u0026lt;/div\u0026gt;\n\u0026lt;/body\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks for everybody who looking and helping to solve the problem.\u003c/p\u003e","accepted_answer_id":"37445667","answer_count":"1","comment_count":"3","creation_date":"2016-05-25 18:57:37.347 UTC","favorite_count":"0","last_activity_date":"2016-05-25 19:11:16.447 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6382742","post_type_id":"1","score":"1","tags":"python|html|django","view_count":"36"} +{"id":"26032439","title":"ORMLite Android and ForeignCollection the bind value at index 1 is null","body":"\u003cp\u003eI have a problems with organizing many-to-many relations with ORMLite, which I cannot overcome. I have a users and want to establish friendship relations between them, so I user the following code:\nI have class User.java:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class User {\n\n @DatabaseField(id = true, columnName = \"_id\")\n public long id;\n @ForeignCollectionField(columnName = COLUMN_FRIENDS, foreignFieldName = \"user\")\n public ForeignCollection\u0026lt;UserFriendship\u0026gt; friends;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThen I try to build many-to-many relations between users with UserFriendship\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@DatabaseTable\npublic class UserFriendship {\n public static final String USER_1_FIELD_NAME = \"user\";\n public static final String USER_2_FIELD_NAME = \"friend\";\n @DatabaseField(columnName = USER_1_FIELD_NAME, foreign = true, uniqueCombo = true)\n public User user;\n public User friend;\n @DatabaseField(columnName = BaseColumns._ID, generatedId = true)\n private long id;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have created a simple test to check everything is OK:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic testUserFriendship() {\n User user = weClient.getEntityFactory().createUser();\n user.id = 101;\n user.nickName = \"user\";\n User friend = weClient.getEntityFactory().createUser();\n friend.id = 102;\n friend.nickName = \"user2\";\n\n user.friends.add(new UserFriendship(user, friend));\n dao.getUserDAO().createOrUpdate(user);\n dao.getUserDAO().createOrUpdate(friend);\n\n User user2;\n user2 = dao.getUserDAO().queryForId(user.id);\n\n assertEquals(user.friends.size(), user2.friends.size());\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe test return the error and here is a backtrace:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ejava.lang.IllegalArgumentException: the bind value at index 1 is null\n09-25 10:39:26.509 8101-8114/? W/System.err﹕ at android.database.sqlite.SQLiteProgram.bindString(SQLiteProgram.java:164)\n09-25 10:39:26.509 8101-8114/? W/System.err﹕ at android.database.sqlite.SQLiteProgram.bindAllArgsAsStrings(SQLiteProgram.java:200)\n09-25 10:39:26.509 8101-8114/? W/System.err﹕ at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:47)\n09-25 10:39:26.509 8101-8114/? W/System.err﹕ at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1314)\n09-25 10:39:26.509 8101-8114/? W/System.err﹕ at android.database.sqlite.SQLiteDatabase.rawQuery(SQLiteDatabase.java:1253)\n09-25 10:39:26.509 8101-8114/? W/System.err﹕ at com.j256.ormlite.android.compat.JellyBeanApiCompatibility.rawQuery(JellyBeanApiCompatibility.java:21)\n09-25 10:39:26.509 8101-8114/? W/System.err﹕ at com.j256.ormlite.android.AndroidCompiledStatement.getCursor(AndroidCompiledStatement.java:180)\n09-25 10:39:26.509 8101-8114/? W/System.err﹕ at com.j256.ormlite.android.AndroidCompiledStatement.runQuery(AndroidCompiledStatement.java:65)\n09-25 10:39:26.509 8101-8114/? W/System.err﹕ at com.j256.ormlite.stmt.SelectIterator.\u0026lt;init\u0026gt;(SelectIterator.java:55)\n09-25 10:39:26.509 8101-8114/? W/System.err﹕ at com.j256.ormlite.stmt.StatementExecutor.buildIterator(StatementExecutor.java:247)\n09-25 10:39:26.509 8101-8114/? W/System.err﹕ at com.j256.ormlite.dao.BaseDaoImpl.createIterator(BaseDaoImpl.java:964)\n09-25 10:39:26.509 8101-8114/? W/System.err﹕ at com.j256.ormlite.dao.BaseDaoImpl.iterator(BaseDaoImpl.java:533)\n09-25 10:39:26.509 8101-8114/? W/System.err﹕ at com.j256.ormlite.dao.LazyForeignCollection.seperateIteratorThrow(LazyForeignCollection.java:313)\n09-25 10:39:26.509 8101-8114/? W/System.err﹕ at com.j256.ormlite.dao.LazyForeignCollection.iteratorThrow(LazyForeignCollection.java:71)\n09-25 10:39:26.509 8101-8114/? W/System.err﹕ at com.j256.ormlite.dao.LazyForeignCollection.closeableIterator(LazyForeignCollection.java:60)\n09-25 10:39:26.509 8101-8114/? W/System.err﹕ at com.j256.ormlite.dao.LazyForeignCollection.iterator(LazyForeignCollection.java:47)\n09-25 10:39:26.509 8101-8114/? W/System.err﹕ at com.j256.ormlite.dao.LazyForeignCollection.size(LazyForeignCollection.java:106)\n09-25 10:39:26.509 8101-8114/? W/System.err﹕ at co.wecommunicate.test.ORMTest.testUserFriendship(ORMTest.java:179)enter code here\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eData from tables show no problems:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esqlite\u0026gt; select * from user;\n|user|0|101|0.0|0.0|0|0|0|0\n|user2|0|102|0.0|0.0|0|0|0|0\nsqlite\u0026gt; select * from userfriendship;\n102|101|1\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I started debugging the library, I found that \u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2014-09-25 06:55:02.5 UTC","last_activity_date":"2014-09-25 06:55:02.5 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2703827","post_type_id":"1","score":"1","tags":"java|android|ormlite|foreign-collection","view_count":"404"} +{"id":"7559534","title":"C# Problem with a List Displaying in a Textbox","body":"\u003cp\u003eI have a small application that has several checkboxes, a submit button, and a textbox. I want the user to be able to check what they want, click the submit button, and have the results display in the textbox. The application runs but instead of the values displaying I get \"System.Collections.Generic.List`1[System.String]\" displayed in the textbox. I am very new to this and would appreciate any help. My code is as follows...\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enamespace MY_App\n{\n\npublic partial class Form1 : Form\n{\n\n public Form1()\n {\n InitializeComponent();\n }\n\n List\u0026lt;string\u0026gt; ls = new List\u0026lt;string\u0026gt;();\n\n private void Checkbox1_CheckedChanged(object sender, EventArgs e)\n {\n ls.Add( \"P.C. \");\n }\n\n private void Checkbox2_CheckedChanged(object sender, EventArgs e)\n {\n ls.Add( \"WYSE Terminal\" );\n }\n\n private void Checkbox3_CheckedChanged(object sender, EventArgs e)\n {\n\n ls.Add(\"Dual Monitors \"); \n }\n\n private void button1_Click(object sender, EventArgs e)\n {\n string line = string.Join(\",\", ls.ToString());\n textBoxTEST.Text = line;\n\n }\n\n private void textBoxTEST_TextChanged(object sender, EventArgs e)\n {\n\n }\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"7559585","answer_count":"4","comment_count":"0","creation_date":"2011-09-26 18:28:59.253 UTC","last_activity_date":"2011-09-26 18:44:52.85 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"665094","post_type_id":"1","score":"2","tags":"c#|list|textbox","view_count":"2653"} +{"id":"41992211","title":"OpenCV - Distance for each pixel","body":"\u003cp\u003eThis is the flow of creation of Disparity map:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eTake pictures of stereo camera.\u003c/li\u003e\n\u003cli\u003eCorrect distortion based on calibration information and collimate (\u003ccode\u003einitUndistortRectifyMap\u003c/code\u003e, \u003ccode\u003eremap\u003c/code\u003e).\u003c/li\u003e\n\u003cli\u003eCreate a disparity map (\u003ccode\u003estereoBM\u003c/code\u003e or \u003ccode\u003estereoSGBM\u003c/code\u003e).\u003c/li\u003e\n\u003cli\u003eCalculate the distance map (\u003ccode\u003ereprojectImageTo3D\u003c/code\u003e).\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eI would like to assign a distance for each pixel of the left image of step 1, but am unsure how to do this. \u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eCan you do this after step 4?\u003c/li\u003e\n\u003cli\u003eIs it possible to create a disparity map for the left image in Step 3?\u003c/li\u003e\n\u003cli\u003eOr is there a better way to do it?\u003c/li\u003e\n\u003c/ul\u003e","answer_count":"0","comment_count":"3","creation_date":"2017-02-02 00:13:58.747 UTC","last_activity_date":"2017-02-02 11:45:32.097 UTC","last_edit_date":"2017-02-02 11:45:32.097 UTC","last_editor_display_name":"","last_editor_user_id":"5008845","owner_display_name":"","owner_user_id":"7503328","post_type_id":"1","score":"0","tags":"opencv","view_count":"94"} +{"id":"39943841","title":"matrix inside data.frame in R or other nested structure","body":"\u003cp\u003eI need to construct a data structure in R containing a \u003ccode\u003ematrix\u003c/code\u003e (or \u003ccode\u003edata.frame\u003c/code\u003e) for each observation. Ideally, it would be a \u003ccode\u003ematrix\u003c/code\u003e inside a \u003ccode\u003edata.frame\u003c/code\u003e. So far, I can only think of nested lists, to achieve it, but then I am afraid to have poor performance.\u003c/p\u003e\n\n\u003ch1\u003eExample\u003c/h1\u003e\n\n\u003cp\u003eFor example, for the data.frame element \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edf \u0026lt;- data.frame(start=c(\"A\", \"B\", \"C\"), end=c(\"A\", \"B\", \"C\"))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI would like to add a column containing a matrix in each cell (resulting from the distance function). For example for element start==\"A\", end==\"B\" it could be the matrix (or data.frame)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ehaversineStart haversineEnd tripLengthDiff startCountry endCountry truckDiff\n160.5408 308.1947 198.745 1 1 1\n152.4168 308.1947 20.710 1 1 1\n273.7599 2228.3508 2903.212 0 1 1\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eTheoretically, it would just be some kind of 3d data structure. In Python, it would be list of lists containing a \u003ccode\u003eNumPy\u003c/code\u003e-array. Is something like that possible in R?\u003c/p\u003e\n\n\u003ch1\u003eBackground\u003c/h1\u003e\n\n\u003cp\u003eI want to perform knn with a custom distance function and I need to normalize the distances before performing the \u003ccode\u003eknn\u003c/code\u003e\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2016-10-09 12:52:39.19 UTC","last_activity_date":"2016-10-09 19:52:03.6 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3429586","post_type_id":"1","score":"0","tags":"r|multidimensional-array|dataframe|distance|knn","view_count":"268"} +{"id":"41371170","title":"ggsn global map scale bar looks wrong","body":"\u003cp\u003eI need to add a scale bar to a global map made in ggplot2 in R, and the \u003ca href=\"https://stackoverflow.com/questions/33356798/what-is-the-simplest-way-to-add-a-scale-to-a-map-in-ggmap\"\u003eeasiest way\u003c/a\u003e seemed to be via the ggsn package. \u003c/p\u003e\n\n\u003cp\u003eBut the scale bar doesn't look right when I eyeball the map - e.g., it's ~4000km across Australia E-W, and a bit less than that across Africa at the equator. The 2000km scale bar looks wider than Africa at the equator and almost as wide as Australia.\u003c/p\u003e\n\n\u003cp\u003eThanks for your thoughts!\u003c/p\u003e\n\n\u003cp\u003eReproducible code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elibrary(ggplot2)\nlibrary(ggsn)\nlibrary(dplyr)\n\nGG.GlobalMap = map_data(\"world\") %\u0026gt;%\n filter(region != \"Antarctica\")\n\nggplot(GG.GlobalMap, aes(long, lat, group = group)) +\n geom_path(color = \"black\") +\n scalebar(data = GG.GlobalMap, dist = 1000, dd2km = TRUE, model = \"WGS84\",\n st.size = 3, location = \"bottomright\") +\n theme_void()\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"41373569","answer_count":"1","comment_count":"3","creation_date":"2016-12-28 23:32:05.52 UTC","last_activity_date":"2016-12-29 16:37:26.89 UTC","last_edit_date":"2017-05-23 12:00:04.727 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"6357433","post_type_id":"1","score":"0","tags":"r|ggplot2|geospatial","view_count":"116"} +{"id":"37034847","title":"After reverting to Windows 7, Visual Studio and IIS were broken","body":"\u003cp\u003eIt's taken me two days of debugging to fix this, so I thought I would share it with anyone having the same problem.\u003c/p\u003e\n\n\u003cp\u003eI decided to upgrade my Win7 Pro development system to Win 10, and discovered that various important stuff didn't work, so decided to revert back to Win 7 Pro. Most stuff started working again, but Visual Studio 2013 Ultimate could not debug web applications. I didn't save the exact error message but it came from global.asax and was something like \"Parser error message: Cannot load type 'myclass.MvcApplication'\" It was basically the same for Forms projects.\u003c/p\u003e\n\n\u003cp\u003eI rebuilt the project, tried various fixes that I found here and other places like moving to /bin, but nothing worked. Fortunately I have another system with VS, and by sharing the disk was able to create a working project on that disk with the other system, and then see it fail with my development system, so I knew that the compile and code was ok. Then I tried running just with IIS, no VS, and when it failed too that told me that it wasn't really VS, it was deeper.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-05-04 18:01:01.43 UTC","last_activity_date":"2016-05-04 18:01:01.43 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3520633","post_type_id":"1","score":"0","tags":"c#|asp.net|visual-studio","view_count":"26"} +{"id":"6953147","title":"Oracle CONNECT BY in java","body":"\u003cp\u003eI am thinking how would I traverse a resultset in java the data fetched by \u003cstrong\u003eCONNECT BY\u003c/strong\u003e caluse to form a tree like structure in java, i.e. populate a tree from the resultset, in a simple and elegant way.\u003c/p\u003e\n\n\u003cp\u003eTable A (parentID,ChildID), root id has null as parent;\u003cbr\u003e\nTable B (AllNodeId, other ...details) ... \u003c/p\u003e\n\n\u003cp\u003eMy query would be somethong similar to \u003ca href=\"https://stackoverflow.com/questions/3525641/oracle-connect-by-syntax\"\u003eOracle \u0026#39;CONNECT BY\u0026#39; Syntax\u003c/a\u003e, \nSample ResultSet\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;document\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;23144946\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;23144946\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;0\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/23144946\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;23144946\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;1689492987\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;1\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/23144946/1689492987\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;113277169\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;113277169\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;0\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/113277169\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;790541\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;4\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/1233405579/790541\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;14646058\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;4\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1083969008/1005206668/131703171/14646058\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;16784627\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;11\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1485541514/933218116/737836991/1821262032/815244280/432050030/952291444/16784627\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;19573544\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;11\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1485541514/933218116/737836991/1821262032/815244280/432050030/1831158756/19573544\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;23564053\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;9\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1485541514/933218116/391696182/554081241/1185845591/23564053\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;38115735\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;4\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1083969008/1005206668/131703171/38115735\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;44433320\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;3\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/995530578/1188888861/44433320\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;47646137\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;9\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1485541514/933218116/737836991/1684372104/1523485897/47646137\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;75846508\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;3\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1669289089/75846508\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;85779271\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;5\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/1278449944/2122202731/85779271\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;100811601\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;9\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1485541514/933218116/737836991/1821262032/815244280/100811601\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;109839044\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;6\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1956931946/1015923615/109839044\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;114948361\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;4\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1083969008/1005206668/131703171/114948361\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;115488049\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;4\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/115488049\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;129417638\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;4\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1429865312/682965646/129417638\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;131703171\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;3\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1083969008/1005206668/131703171\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;183808673\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;0\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;211390361\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;9\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1485541514/933218116/737836991/1821262032/815244280/211390361\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;276479611\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;4\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/995530578/1188888861/44433320/276479611\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;304547397\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;7\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1956931946/1015923615/650744752/304547397\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;352187851\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;6\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/995530578/1188888861/44433320/276479611/595142527/352187851\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;365429210\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;3\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/365429210\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;369026526\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;4\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/454170517/1145254633/369026526\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;391696182\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;6\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1485541514/933218116/391696182\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;400097551\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;6\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1956931946/1015923615/400097551\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;401755216\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;5\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/454170517/615529502/815372538/401755216\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;403840816\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;8\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1485541514/933218116/737836991/1821262032/403840816\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;424873848\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;5\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/454170517/1145254633/369026526/424873848\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;432050030\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;9\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1485541514/933218116/737836991/1821262032/815244280/432050030\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;454170517\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;2\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/454170517\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;491126406\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;5\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1485541514/491126406\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;500250070\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;8\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1956931946/1015923615/650744752/304547397/500250070\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;502158013\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;9\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1485541514/933218116/737836991/1821262032/815244280/502158013\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;519779271\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;4\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/1233405579/519779271\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;523872306\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;5\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1083969008/1005206668/131703171/114948361/523872306\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;534191475\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;2\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/995530578/534191475\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;535941812\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;2\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1083969008/535941812\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;553384481\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;8\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1956931946/1015923615/650744752/304547397/553384481\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;554081241\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;7\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1485541514/933218116/391696182/554081241\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;566617455\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;7\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1485541514/933218116/391696182/566617455\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;573638062\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;2\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/995530578/573638062\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;576957715\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;5\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1669289089/75846508/1126004892/576957715\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;592972055\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;10\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1485541514/933218116/737836991/1684372104/1523485897/2064290221/592972055\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;594701533\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;7\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1485541514/933218116/737836991/594701533\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;595142527\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;5\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/995530578/1188888861/44433320/276479611/595142527\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;609738725\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;4\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1669289089/1271022965/609738725\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;615529502\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;3\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/454170517/615529502\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;631002699\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;5\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/454170517/615529502/815372538/631002699\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;650744752\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;6\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1956931946/1015923615/650744752\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;673584488\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;9\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1485541514/933218116/391696182/554081241/924869194/673584488\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;677402781\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;5\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1956931946/677402781\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;682965646\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;3\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1429865312/682965646\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;707659408\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;7\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1485541514/933218116/391696182/707659408\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;722249469\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;5\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1485541514/722249469\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;726948710\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;4\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/1081453568/726948710\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;737836991\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;6\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1485541514/933218116/737836991\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;767305753\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;3\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;776460562\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;5\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/995530578/1188888861/44433320/276479611/776460562\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;776659244\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;10\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1485541514/933218116/737836991/1684372104/1523485897/47646137/776659244\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;783216187\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;3\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1429865312/783216187\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;796976474\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;5\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/454170517/1145254633/1127558447/796976474\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;810820101\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;3\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1769878426/810820101\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;813464598\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;1\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/813464598\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;815244280\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;8\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1485541514/933218116/737836991/1821262032/815244280\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;815372538\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;4\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/454170517/615529502/815372538\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;842204238\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;6\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1504652627/1416416984/842204238\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;885391170\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;5\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1083969008/1005206668/131703171/14646058/885391170\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;893931060\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;11\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1485541514/933218116/737836991/1821262032/815244280/432050030/952291444/893931060\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;901031516\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;5\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/454170517/1145254633/369026526/901031516\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;907984148\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;8\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1485541514/933218116/1600259447/1406865856/907984148\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;922222178\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;3\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1083969008/535941812/922222178\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;924869194\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;8\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1485541514/933218116/391696182/554081241/924869194\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;933218116\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;5\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1485541514/933218116\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;952291444\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;10\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1485541514/933218116/737836991/1821262032/815244280/432050030/952291444\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;957153589\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;5\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1083969008/1005206668/131703171/14646058/957153589\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;981039439\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;4\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/454170517/1813751044/981039439\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;986423433\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;6\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/454170517/615529502/815372538/631002699/986423433\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;995530578\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;1\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/995530578\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;1005206668\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;2\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1083969008/1005206668\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;1015923615\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;5\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1956931946/1015923615\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;1027240335\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;5\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1504652627/1027240335\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;1081453568\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;3\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/1081453568\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;1083969008\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;1\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1083969008\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;1088422179\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;9\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1485541514/933218116/391696182/554081241/924869194/1088422179\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;1092348367\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;2\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;1099858981\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;6\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1429865312/682965646/2014539687/2084415589/1099858981\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;1116560546\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;4\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/1278449944/1116560546\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;1123337792\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;4\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1083969008/1005206668/131703171/1123337792\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;1126004892\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;4\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1669289089/75846508/1126004892\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;1127558447\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;4\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/454170517/1145254633/1127558447\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;1138249535\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;3\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1083969008/1005206668/1138249535\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;1145254633\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;3\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/454170517/1145254633\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;1146365403\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;2\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/995530578/1146365403\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;1151779933\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;3\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1083969008/535941812/1151779933\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;1170646214\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;4\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1083969008/1005206668/131703171/1170646214\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;1172997272\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;3\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/1172997272\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;1179167955\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;5\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1669289089/1271022965/609738725/1179167955\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;1185845591\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;8\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1485541514/933218116/391696182/554081241/1185845591\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;1188888861\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;2\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/995530578/1188888861\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;1192911107\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;10\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1485541514/933218116/391696182/554081241/924869194/1088422179/1192911107\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;1193878524\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;3\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/454170517/1193878524\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;1227638545\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;7\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1485541514/933218116/391696182/1227638545\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;1233240387\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;5\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/1278449944/2122202731/1233240387\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;1233405579\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;3\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/1233405579\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;1251154360\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;4\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/995530578/1188888861/1280285645/1251154360\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;1255932158\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;8\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1485541514/933218116/737836991/1821262032/1255932158\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;1258654284\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;4\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1669289089/75846508/1258654284\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;1269778678\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;11\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1485541514/933218116/391696182/554081241/924869194/673584488/1392044734/1269778678\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;1271022965\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;3\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1669289089/1271022965\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;1278449944\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;3\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/1278449944\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;1280285645\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;3\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/995530578/1188888861/1280285645\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;1281099433\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;11\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1485541514/933218116/391696182/554081241/924869194/673584488/1392044734/1281099433\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;1286317965\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;3\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1083969008/535941812/1286317965\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;1302793450\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;4\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1769878426/810820101/1302793450\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;1324128558\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;9\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1956931946/1015923615/650744752/304547397/553384481/1324128558\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;1365613266\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;7\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/1278449944/2122202731/1233240387/1931411284/1365613266\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;1369151856\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;7\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1504652627/1416416984/842204238/1369151856\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;1388426250\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;5\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1956931946/1388426250\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;1392044734\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;10\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1485541514/933218116/391696182/554081241/924869194/673584488/1392044734\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;1406865856\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;7\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1485541514/933218116/1600259447/1406865856\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;1416416984\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;5\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1504652627/1416416984\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;1429865312\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;2\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1429865312\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;row\u0026gt;\n \u0026lt;Parent_ID\u0026gt;183808673\u0026lt;/Parent_ID \u0026gt;\n \u0026lt;Node_ID\u0026gt;1458937639\u0026lt;/Node_ID \u0026gt;\n \u0026lt;Pathlen\u0026gt;12\u0026lt;/Pathlen \u0026gt;\n \u0026lt;Path\u0026gt;/183808673/1941767124/1092348367/767305753/1485541514/933218116/391696182/554081241/924869194/1088422179/1506147450/1882077561/1458937639\u0026lt;/Path \u0026gt;\n \u0026lt;/row\u0026gt;\n \u0026lt;/document\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"3","creation_date":"2011-08-05 07:55:55.653 UTC","last_activity_date":"2011-08-05 10:24:59.357 UTC","last_edit_date":"2017-05-23 09:58:56.15 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"268203","post_type_id":"1","score":"0","tags":"java|oracle|tree","view_count":"375"} +{"id":"37288303","title":"Sending data from another controller to another View MVC C#","body":"\u003cp\u003eI'm tring to send the data from Another Controller to another View.\nI have a Home Controller but I don't want to send to Home View data because I need this data in Car View where I get dropdownlist from database\u003c/p\u003e\n\n\u003cp\u003eHome COntroller: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Web;\nusing System.Web.Mvc;\nusing System.Data.Entity;\nusing Automarket.Models;\nusing System.ComponentModel.DataAnnotations;\nusing static System.Net.Mime.MediaTypeNames;\n\nnamespace Automarket.Controllers\n{\n public class HomeController : Controller\n {\n OurDBContext db = new OurDBContext();\n // Controller for populate dropdownlist\n // GET: Home\n public ActionResult Index()\n {\n return View();\n }\n\n public ActionResult Price()\n {\n OurDBContext db = new OurDBContext();\n ViewBag.price = new SelectList(db.prices, \"Id\", \"price\");\n return View(\"Car\");\n }\n\n\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCar View\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@using Automarket.Models;\n@{\n ViewBag.Title = \"Index\";\n Layout = \"~/Views/Shared/_Layout.cshtml\";\n List\u0026lt;Marke\u0026gt; marke = ViewData[\"marke\"] as List\u0026lt;Marke\u0026gt;;\n List\u0026lt;Modeli\u0026gt; modeli = ViewData[\"modeli\"] as List\u0026lt;Modeli\u0026gt;;\n\n string deps = ViewData[\"deps\"] as string;\n}\n\n\u0026lt;h2\u0026gt;Automarket\u0026lt;/h2\u0026gt;\n\n\n\n\u0026lt;div\u0026gt;\n\n @Html.DropDownList(\"Prices\" , \"--Select Item--\")\n\u0026lt;/div\u0026gt;\n\n\n\n\n\n\n \u0026lt;div class=\"dropdown\"\u0026gt;\n \u0026lt;select id=\"brand\" onchange=\"popMod(@deps)\" name=\"brand\" class=\"form-control\"\u0026gt;\n @foreach (var mrka in marke)\n {\n \u0026lt;option value=\"@mrka.Id\"\u0026gt;@mrka.Name\u0026lt;/option\u0026gt;\n }\n \u0026lt;/select\u0026gt;\n \u0026lt;/div\u0026gt;\n\n\n\n\u0026lt;p\u0026gt;\n \u0026lt;select id=\"modeli\" name=\"model\" class=\"form-control\"\u0026gt;\n @foreach (var modell in modeli)\n {\n \u0026lt;option value=\"@modell.Id\"\u0026gt;@modell.Name\u0026lt;/option\u0026gt;\n }\n \u0026lt;/select\u0026gt;\n\u0026lt;/p\u0026gt;\n\n\n\n\n\n\n\n\n\u0026lt;script\u0026gt;\n\n function popMod(mo) {\n var mod = document.getElementById(\"modeli\");\n var len = mod.length;\n while (mod.options.length \u0026gt; 0) {\n mod.remove(0);\n }\n var sel = document.getElementById(\"brand\");\n var id = sel.options[sel.selectedIndex].value;\n for (el in mo) {\n if (mo[el].MarkeId == id) {\n var op=document.createElement(\"option\");\n op.value=mo[el].Id;\n op.innerHTML=mo[el].Name;\n mod.appendChild(op);\n\n }\n }\n }\n\u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"3","creation_date":"2016-05-18 00:29:01.807 UTC","last_activity_date":"2016-05-18 03:27:19.68 UTC","last_edit_date":"2016-05-18 03:27:19.68 UTC","last_editor_display_name":"","last_editor_user_id":"3559349","owner_display_name":"","owner_user_id":"6342954","post_type_id":"1","score":"0","tags":"c#|asp.net-mvc","view_count":"80"} +{"id":"2169631","title":"Best way to handle this? (Website frontend, server backend and SSH)","body":"\u003cp\u003eSorry about the title, don't know how to phrase this.\u003c/p\u003e\n\n\u003cp\u003eI have my own machine running Ubuntu 9.10 and I have some scripts on their that I occasionally SSH into the machine and run. I would like to make a front end interface for this in the form of a website. How would I go about having the website SSH into my machine and run these scripts?\u003c/p\u003e\n\n\u003cp\u003eI thought about having the website write to a database and then the scripts on the machine would always be checking for new commands in the database. This seems inefficient as it would always be running as some scripts require user input.\u003c/p\u003e","accepted_answer_id":"2169659","answer_count":"2","comment_count":"2","creation_date":"2010-01-30 22:07:21.853 UTC","last_activity_date":"2010-01-30 22:31:19.673 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"49887","post_type_id":"1","score":"1","tags":"ssh","view_count":"215"} +{"id":"25461862","title":"How can I send bitmap from service to a main in java, android?","body":"\u003cp\u003eI'm making a service in my application to download images, that's unclear for me how can i send result (bitmap) from service to a main activity. Can I do that? Or in service there is only a possibitlity to save downloaded image somewhere and send only useless messages?\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2014-08-23 12:20:26.06 UTC","last_activity_date":"2015-03-26 23:20:35.5 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3937738","post_type_id":"1","score":"0","tags":"java|android|service|bitmap|send","view_count":"561"} +{"id":"42491311","title":"SQL Bulk Copy by mapping columns dynamically","body":"\u003cp\u003eI read the file data into dataset and trying to bulk insert using SQL bulk copy by mapping the columns. All my column names in the database are in lower case which is created from my code.\u003c/p\u003e\n\n\u003cp\u003eI am not sure why I get \"The specified column doesn't exist in the database\" exception. Although I see all the columns mapped in the bulk copy object. Please advise. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic static void BatchBulkCopy(DataTable dataTable, string DestinationTbl, List\u0026lt;string\u0026gt; columnMapping,string filename)\n{ \n // Get the DataTable \n DataTable dtInsertRows = dataTable;\n\n using (SqlBulkCopy sbc = new SqlBulkCopy(program.connectionStr.ToString()))\n {\n try \n {\n foreach (DataColumn col in dataTable.Columns)\n { \n sbc.ColumnMappings.Add(col.ColumnName.ToLower(), col.ColumnName.ToLower());\n // Console.WriteLine(\"ok\\n\");\n }\n\n sbc.DestinationTableName = DestinationTbl.ToLower();\n sbc.BulkCopyTimeout = 8000;\n sbc.DestinationTableName = \"[\"+ DestinationTbl.ToLower() + \"]\";\n sbc.WriteToServer(dtInsertRows);\n sbc.Close();\n }\n\n catch (Exception ex)\n { \n\n } \n }\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"3","creation_date":"2017-02-27 16:52:35.873 UTC","last_activity_date":"2017-02-27 19:13:41.837 UTC","last_edit_date":"2017-02-27 19:13:41.837 UTC","last_editor_display_name":"","last_editor_user_id":"5619143","owner_display_name":"","owner_user_id":"1046415","post_type_id":"1","score":"0","tags":"c#|sql|sqlbulkcopy|columnmappings","view_count":"1155"} +{"id":"3995894","title":"Update original data in detached signature created by crypto.signText","body":"\u003cp\u003eI got the BASE64 encoded text by using crypto.signText method. but that dose not contain original to data which is signed.\u003c/p\u003e\n\n\u003cp\u003ecan anyone tell me how to update that encoded text to attach data to it.\u003c/p\u003e","accepted_answer_id":"4040227","answer_count":"1","comment_count":"1","creation_date":"2010-10-22 10:21:22.19 UTC","favorite_count":"0","last_activity_date":"2010-10-28 06:03:52.17 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"480088","post_type_id":"1","score":"1","tags":"digital-signature|pkcs#7","view_count":"420"} +{"id":"39119806","title":"Username/Password Invalid Login Android Apps","body":"\u003cp\u003eHi guys can you help me why the user and password always invalid, i'm sure the URL is good to call the data of user, but i dont know why this happen ? before the apps can login \u003c/p\u003e\n\n\u003cp\u003eHere is my LoginActivity :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport java.io.IOException;\n\nimport org.apache.http.client.ClientProtocolException;\nimport org.json.JSONException;\nimport org.json.JSONObject;\n\nimport android.app.Activity;\nimport android.app.ProgressDialog;\nimport android.content.Context;\nimport android.content.Intent;\nimport android.content.SharedPreferences;\nimport android.os.AsyncTask;\nimport android.os.Bundle;\nimport android.text.method.LinkMovementMethod;\nimport android.util.Log;\nimport android.view.Menu;\nimport android.view.MenuItem;\nimport android.view.View;\nimport android.widget.CheckBox;\nimport android.widget.EditText;\nimport android.widget.TextView;\nimport android.widget.Toast;\n\nimport com.inarts.mobile.merch.md.info.AppInfo;\nimport com.inarts.mobile.merch.md.info.UserInfo;\nimport com.inarts.rest.RequestMethod;\nimport com.inarts.rest.RestClient;\n\npublic class LoginActivity extends Activity {\n\n public String targetUrl = \"\";\n public String userName = \"\";\n public String userUsername = \"\";\n public String userPassword = \"\";\n public boolean userSaveCB = false;\n public static Context ctx;\n public static final String PREFS_NAME = \"MyPrefsFile\";\n\n /**\n * Called when the activity is first created.\n */\n @Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.main);\n ctx = this.getApplicationContext();\n targetUrl = Config.getEndPointUrl() + \"/login.json\";\n\n TextView tvcopyright = (TextView) findViewById(R.id.main_copyright);\n tvcopyright.setMovementMethod(LinkMovementMethod.getInstance());\n\n EditText tvUsername = (EditText) findViewById(R.id.main_user_txt);\n EditText tvPassword = (EditText) findViewById(R.id.main_pass_txt);\n CheckBox cbSavePassword = (CheckBox) findViewById(R.id.main_save_cb);\n\n if (isSavePassword()) {\n tvUsername.setText(getSavedUsername().toString());\n tvPassword.setText(getSavedPassword().toString());\n cbSavePassword.setChecked(true);\n } else {\n cbSavePassword.setChecked(false);\n }\n\n if (getLoginState()) {\n Log.i(\"ncdebug\", \"I am logged in\");\n goToMainActivity();\n } else {\n\n }\n }\n\n\n @Override\n public boolean onCreateOptionsMenu(Menu menu) {\n menu.add(0, 1, 0, \"Keluar\").setIcon(R.drawable.ic_menu_exit);\n\n return super.onCreateOptionsMenu(menu);\n }\n\n @Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Handle item selection\n switch (item.getItemId()) {\n case 1:\n finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }\n\n @Override\n public void onBackPressed() {\n\n return;\n }\n\n public void click_login(View view) {\n EditText user_txt = (EditText) findViewById(R.id.main_user_txt);\n EditText pass_txt = (EditText) findViewById(R.id.main_pass_txt);\n\n if ( user_txt.getText().toString().equals(AppInfo.adminName)\n \u0026amp;\u0026amp; pass_txt.getText().toString().equals(AppInfo.adminPass)\n )\n {\n Intent intent = new Intent(ctx, StoreAddGeoActivity.class);\n startActivity(intent);\n finish();\n } else {\n new AuthenticateTask().execute(targetUrl, userUsername, userPassword);\n }\n\n }\n\n public void goToMainActivity() {\n Intent intent = new Intent(this.getApplicationContext(),\n MainActivity.class);\n this.startActivity(intent);\n finish();\n }\n\n public void saveLoginState() {\n SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);\n SharedPreferences.Editor editor = settings.edit();\n editor.putString(\"user_name\", userName);\n editor.putString(\"user_username\", userUsername);\n editor.putString(\"user_password\", userPassword);\n editor.putBoolean(\"loginState\", true);\n\n CheckBox cbSavePassword = (CheckBox) findViewById(R.id.main_save_cb);\n if (cbSavePassword.isChecked()) {\n editor.putBoolean(\"isSavePassword\", true);\n } else {\n editor.putBoolean(\"isSavePassword\", false);\n }\n\n UserInfo.username = userUsername;\n UserInfo.name = userName;\n UserInfo.loginstatus = true;\n\n editor.commit();\n }\n\n public boolean isSavePassword() {\n SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);\n boolean stat = settings.getBoolean(\"isSavePassword\", false);\n\n return stat;\n }\n\n public String getSavedUsername() {\n SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);\n\n return settings.getString(\"user_username\", \"\");\n }\n\n public String getSavedPassword() {\n SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);\n\n return settings.getString(\"user_password\", \"\");\n }\n\n public boolean getLoginState() {\n SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);\n\n UserInfo.username = settings.getString(\"user_username\", \"\");\n UserInfo.name = settings.getString(\"user_name\", \"\");\n\n boolean stat = settings.getBoolean(\"loginState\", false);\n UserInfo.loginstatus = stat;\n\n return stat;\n }\n\n private class AuthenticateTask extends AsyncTask\u0026lt;String, String, String\u0026gt; {\n ProgressDialog dialog;\n\n @Override\n protected void onPreExecute() {\n dialog = ProgressDialog.show(LoginActivity.this, \"\", \"Loading...\",\n true);\n }\n\n\n @Override\n protected String doInBackground(String... params) {\n\n RestClient client = new RestClient(params[0]);\n\n// EditText user_txt = (EditText) findViewById(R.id.main_user_txt);\n// EditText pass_txt = (EditText) findViewById(R.id.main_pass_txt);\n// userUsername = user_txt.getText().toString();\n// userPassword = pass_txt.getText().toString();\n// client.AddParam(\"username\", user_txt.getText().toString());\n// client.AddParam(\"password\", pass_txt.getText().toString());\n\n client.AddParam(\"username\", params[1]);\n client.AddParam(\"password\", params[2]);\n\n try {\n client.Execute(RequestMethod.GET);\n return client.getResponse();\n } catch (ClientProtocolException e) {\n // e.printStackTrace();\n Toast.makeText(LoginActivity.ctx, e.getMessage(),\n Toast.LENGTH_SHORT).show();\n } catch (IOException e) {\n // e.printStackTrace();\n Toast.makeText(LoginActivity.ctx, e.getMessage(),\n Toast.LENGTH_SHORT).show();\n } catch (Exception e) {\n // e.printStackTrace();\n Toast.makeText(LoginActivity.ctx, e.getMessage(),\n Toast.LENGTH_SHORT).show();\n }\n\n return null;\n }\n\n @Override\n protected void onPostExecute(String Result) {\n dialog.dismiss();\n if (Result != null) {\n parseJson(Result);\n } else {\n Toast.makeText(LoginActivity.ctx,\n \"Login Failed, Connection Error\", Toast.LENGTH_SHORT)\n .show();\n }\n System.out.println(\"Ini dia\");\n }\n\n public void parseJson(String s) {\n try {\n JSONObject jobj = new JSONObject(s);\n String stat = jobj.getString(\"stat\");\n\n if (stat.equals(\"failed\")) {\n String msg = jobj.getString(\"msg\");\n Toast.makeText(LoginActivity.ctx, msg, Toast.LENGTH_SHORT)\n .show();\n } else {\n userName = jobj.getString(\"name\");\n\n saveLoginState();\n\n goToMainActivity();\n }\n\n } catch (JSONException e) {\n e.printStackTrace();\n Toast.makeText(LoginActivity.ctx, e.getMessage(),\n Toast.LENGTH_SHORT).show();\n }\n }\n\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy Config.Java here for the URL\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class Config {\n public static String getEndPointUrl() {\n String endpointUrl = \"http://mobilemerch.in2digital.net/rest\";\n\n return endpointUrl;\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf you need anything else to solve the problem just ask below, thanks :)\u003c/p\u003e","accepted_answer_id":"39120020","answer_count":"1","comment_count":"0","creation_date":"2016-08-24 09:46:10.07 UTC","last_activity_date":"2016-08-24 09:55:17.507 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6238733","post_type_id":"1","score":"-2","tags":"java|android","view_count":"51"} +{"id":"1035812","title":"When is it appropriate to use stored procs vs table valued functions","body":"\u003cp\u003eWe are currently using Stored procs for most of our reporting, but I would like to have the flexibility of being able to join results sets with further criteria.\u003c/p\u003e\n\n\u003cp\u003eTo do this with stored procs, I need to store the resultset from the storedproc in a temp tables as illustrated below:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCREATE TABLE #Top_1000_Customers (\n CustomerCode BIGINT, \n Firstname VARCHAR(100),\n Surname VARCHAR(100),\n State VARCHAR(),\n MonthlySpend FLOAT)\n\nINSERT INTO #Top_1000_Customers\nEXEC FindTop1000Customers() \n\nSELECT CustomerCode, Firstname, Surname, State, MonthlySpend float\nFROM #Top_1000_Customers\nWHERE State = 'VIC' \n\nDROP TABLE #Top_1000_Customers \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf I do this using a table valued function this code looks like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT FindTop1000Customers()\nWHERE State='VIC'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf I want to I can even join the table valued function with another table.\u003c/p\u003e\n\n\u003cp\u003eThis seems to be a bit more elegant than using stored procs and also looks like it would perform better - as it does not have to spool results to a temp table.\u003c/p\u003e\n\n\u003cp\u003eAre there any significant reasons why I would be better off using stored procs to accomplish these types of tasks instead of using table valued functions?\u003c/p\u003e","accepted_answer_id":"1036112","answer_count":"3","comment_count":"0","creation_date":"2009-06-23 23:36:50.657 UTC","last_activity_date":"2009-06-24 02:02:08.693 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"116271","post_type_id":"1","score":"0","tags":"sql-server","view_count":"572"} +{"id":"32130698","title":"how do I run a java program from a c program?","body":"\u003cp\u003eI have googled for this, but the results are either 10+ years old and do not explain what JNI is or if it is the only approach, or the results are for C++ or C#. So here is my question: \u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eHow do I run a Java program from a C program, using the following code as an example?\u003c/strong\u003e What specific changes to I make to the following code to get the C program to successfully call the java program with parameters? \u003c/p\u003e\n\n\u003cp\u003eIn the CentOS terminal, I am able to successfully run a java program when I type the following in the command line: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ejava -cp . my.package.SomeClass 1 2 3\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSimilarly, from the same folder in the terminal, I am able to successfully run a C program when I type the following in the command line: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e./hello \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe code for \u003ccode\u003ehello.c\u003c/code\u003e is: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;stdio.h\u0026gt;\n\nmain() {\n printf(\"Hello World from C!\\n\");\n} \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eHow do I modify the code for \u003ccode\u003ehello.c\u003c/code\u003e so that it also runs \u003ccode\u003emy.package.SomeClass\u003c/code\u003e with the parameters \u003ccode\u003e1 2 3\u003c/code\u003e ?\u003c/strong\u003e \u003c/p\u003e\n\n\u003cp\u003eFor example, how do I accomplish the following, but without throwing errors: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;stdio.h\u0026gt;\n\nmain() {\n printf(\"Hello World from C!\\n\");\n java -cp . my.package.SomeClass 1 2 3 //What is the right syntax here?\n} \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003chr\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT\u003c/strong\u003e \u003c/p\u003e\n\n\u003cp\u003eFor the sake of future readers of this, and to avoid redundant postings, please also state in your answer how to call a method, such as \u003ccode\u003eSomeClass.someMethod(1,2,3);\u003c/code\u003e\u003c/p\u003e","accepted_answer_id":"32130773","answer_count":"3","comment_count":"7","creation_date":"2015-08-21 00:48:16.41 UTC","favorite_count":"1","last_activity_date":"2015-08-21 03:00:08.823 UTC","last_edit_date":"2015-08-21 03:00:08.823 UTC","last_editor_display_name":"","last_editor_user_id":"807797","owner_display_name":"","owner_user_id":"807797","post_type_id":"1","score":"-1","tags":"java|c|linux|terminal","view_count":"797"} +{"id":"21632311","title":"Normalizing an integer to pass to another value","body":"\u003cp\u003eI have an integer that updates itself from 0 - 599 which I'm trying to normalize and pass to another variable. My first integer value is just a single int. It isn't in a list or anything.\u003c/p\u003e\n\n\u003cp\u003eWhat I'm trying to do is tie in a color lerp time length based on the length of integer value. This integer value is iterating through a list of meshes to be displayed. It looks like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eint meshNum;\npublic void AnimateMesh()\n{\n if(playAnim)\n {\n meshToChange.GetComponent\u0026lt;MeshFilter\u0026gt;().mesh = fluidMesh[meshNum];\n\n if(meshNum \u0026lt; 599)\n meshNum++;\n else\n meshNum = 0;\n }\n else\n {\n meshNum = 0;\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd my lerp code for the color is this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ediffuse_Material.color = Color.Lerp(Color.blue, Color.red, speedCount);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat I'm wanting to change speedCount in my lerp method to a variable that is matched with the length of the animation. My lerp isn't always on screen, but the animation is, when I want the lerp to appear, I want to it be the same each time it appears no matter where the animation currently is.\u003c/p\u003e","accepted_answer_id":"21632489","answer_count":"2","comment_count":"3","creation_date":"2014-02-07 16:00:11.5 UTC","last_activity_date":"2014-02-07 16:17:38.607 UTC","last_edit_date":"2014-02-07 16:06:20.323 UTC","last_editor_display_name":"","last_editor_user_id":"1170993","owner_display_name":"","owner_user_id":"1170993","post_type_id":"1","score":"0","tags":"c#|math|normalize","view_count":"194"} +{"id":"14276546","title":"Windows 8 custom imagining for multiple clients -help please?","body":"\u003cp\u003eIf anyone can help us I would be very grateful!\u003c/p\u003e\n\n\u003cp\u003eEvery week we have multiple pc's to distribute to new clients. The machines have to be heavily customised with quite a few specifics:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eRemoval of most extra \"spam\" apps - Dell, Asus, Acer add icons we don't want.\u003c/li\u003e\n\u003cli\u003eChange desktop background\u003c/li\u003e\n\u003cli\u003eAdd 2 specific user accounts, one of which is named according to machine name.\u003c/li\u003e\n\u003cli\u003eSet 2 specific passwords on the new accounts - site specific\u003c/li\u003e\n\u003cli\u003eSet Custom icons for each login\u003c/li\u003e\n\u003cli\u003eThe machines are never setup for a domain, so Active Directory technologies can't be easily applied.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eThe volume and budget is such that the machines are not usually business class devices and we are not setup for any of the technologies used by much larger IT companies like group policy driven MSI updates etc. \u003c/p\u003e\n\n\u003cp\u003eOur current process is Donkey powered. On windows 7, deploying a new machine, fully installed with our software will take up to an hour if SQL Server is put on it or 55 mins if not. This is a totally manual endeavour that I'm itching to reform. As the machine make/model changes month on month, I can't rely on what will be installed.\u003c/p\u003e\n\n\u003cp\u003eI've looked at Ghost, but it won't work as each machine has it's own specific license key-rather than volumne license.\u003c/p\u003e\n\n\u003cp\u003eThis process has been bugging me for a long time but it's not been my own department to sort out; however, having worked in schools where I could deploy software packages en masse, I can't believe my colleagues when they say this is the only way to do this job.\u003c/p\u003e\n\n\u003cp\u003eCan anyone help? We've done the google dance quite a lot with Windows 7 to solve this and now with Windows 8 but nothing quite fits what we do.\u003c/p\u003e\n\n\u003cp\u003eIf this is NOT the place for this question, apologies-I did look for a Stack site thats more OS specific but didn't see one! :).\u003c/p\u003e\n\n\u003cp\u003eThanks for any advice offered!\u003c/p\u003e","accepted_answer_id":"15118641","answer_count":"1","comment_count":"1","creation_date":"2013-01-11 10:49:56.237 UTC","favorite_count":"1","last_activity_date":"2013-03-04 11:57:52.51 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1864489","post_type_id":"1","score":"1","tags":"windows|imaging|group-policy","view_count":"274"} +{"id":"13621754","title":"Is it a good idea to use plain HTML instead of ASPX","body":"\u003cp\u003eI'm developing an ASP.NET website. Sometimes some modules contain so few content that I present them inside a jQUeryUI dialog and communicate with the server via AJAX. I keep those contents inside a separate file and load them to a jQueryUI dialog according to the appropriate module.I was wondering if it's a good idea to have that content as a plain HTML elements instead of asp ones. Somehow I thought maybe this would reduce the overhead the conversion from asp elements to html elements can cause.\u003c/p\u003e","accepted_answer_id":"13621805","answer_count":"3","comment_count":"0","creation_date":"2012-11-29 08:38:46.37 UTC","last_activity_date":"2013-03-16 22:01:09.853 UTC","last_edit_date":"2013-03-16 22:01:09.853 UTC","last_editor_display_name":"","last_editor_user_id":"918414","owner_display_name":"","owner_user_id":"751796","post_type_id":"1","score":"0","tags":"asp.net|html","view_count":"195"} +{"id":"38499253","title":"UWP cannot connect to local Socket.IO server","body":"\u003cp\u003eI have an UWP application which is connecting to a Socket.IO server. When debugging I like it to be a local server, but I can't get it to connect it. I use the \u003ca href=\"https://github.com/Quobject/SocketIoClientDotNet/\" rel=\"nofollow\"\u003eSocketIoClientDotNet\u003c/a\u003e library, and it works well if I have to connect to an external server, but I can't connect to the local one.\u003c/p\u003e\n\n\u003cp\u003eI'm aware that on default UWP apps forbids connecting to local servers, I think it's called loopback, but I'm also tried to go around that by using this tool:\n\u003ca href=\"http://loopback.codeplex.com/\" rel=\"nofollow\"\u003ehttp://loopback.codeplex.com/\u003c/a\u003e\nHowever, It didn't helped.\u003c/p\u003e\n\n\u003cp\u003eAny help is much appreciated, and thanks in advance! : )\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-07-21 08:42:37.837 UTC","last_activity_date":"2016-07-22 10:38:36.053 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2286435","post_type_id":"1","score":"0","tags":"c#|.net|socket.io|uwp","view_count":"393"} +{"id":"32411051","title":"How to disable basic http auth in grails 3.x?","body":"\u003cp\u003eI have started with grails 3 and working with spring boot starter security.\nHere is my security config.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@Configuration\n@EnableWebSecurity\n@EnableWebMvcSecurity\n@EnableGlobalMethodSecurity(jsr250Enabled = true)\nclass CustomSecurityConfig extends WebSecurityConfigurerAdapter{\n\n CustomUserDetailsService userDetailsService\n\n @Autowired\n public void configureGlobal(AuthenticationManagerBuilder auth)\n throws Exception {\n auth.userDetailsService(userDetailsService).passwordEncoder(passwordEncoder())\n }\n\n @Bean\n CustomAuthenticationProvider authenticationProvider() {\n CustomAuthenticationProvider provider = new CustomAuthenticationProvider();\n return provider;\n }\n\n @Override\n public void configure(WebSecurity web) throws Exception {\n // This is here to ensure that the static content (JavaScript, CSS, etc)\n // is accessible from the login page without authentication\n\n web.ignoring().antMatchers(\"/assets/**\");\n web.ignoring().antMatchers(\"/views/**\");\n }\n\n @Override\n protected void configure(HttpSecurity http) throws Exception {\n println \"configuring security\"\n http.httpBasic().disable()\n http.authorizeRequests().expressionHandler()\n http.formLogin().loginPage(\"/login\").permitAll().and().logout().logoutRequestMatcher(new AntPathRequestMatcher(\"/logout\"))\n .logoutSuccessUrl(\"/\").deleteCookies(\"JSESSIONID\")\n .invalidateHttpSession(true);\n http.authorizeRequests().antMatchers(\"/\").permitAll();\n http.csrf().disable();\n\n }\n\n @Bean\n public BCryptPasswordEncoder passwordEncoder() {\n return new BCryptPasswordEncoder();\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eDo you guys see any errors ? With this configuration whenever I open my root url, which should redirect to login page, keeps asking for popup authentication! Any ideas how can it be fixed ?\nCheers!\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2015-09-05 08:30:46.197 UTC","last_activity_date":"2015-09-05 13:56:33.947 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"994984","post_type_id":"1","score":"0","tags":"spring-security|spring-boot|grails-3.0","view_count":"256"} +{"id":"7128056","title":"SharePoint 2010 WebPart Personalize Layout","body":"\u003cp\u003eI have a homepage on an Intranet. It has at 15+ webparts (news, weather, etc.) I want to allow the users to customize the page by moving the webparts around or deleting them. At present I don't let them see the ribbon at the top so they don't have access to the \"Edit page\" button. I have pulled it out from the Ribbon\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;a unselectable=\"on\" href=\"javascript:;\" onclick=\"return false;\" class=\"ms-cui-ctl-large\" aria-describedby=\"Ribbon.WebPartPage.Edit.Edit.Menu.Actions.Edit_ToolTip\" mscui:controltype=\"Button\" role=\"button\" style=\"height: auto;\" id=\"Ribbon.WebPartPage.Edit.Edit-SelectedItem\"\u0026gt;\n\u0026lt;span unselectable=\"on\" class=\"ms-cui-ctl-largeIconContainer\"\u0026gt;\n \u0026lt;span unselectable=\"on\" class=\" ms-cui-img-32by32 ms-cui-img-cont-float\"\u0026gt;\n \u0026lt;img unselectable=\"on\" alt=\"\" src=\"/_layouts/1033/images/formatmap32x32.png\" style=\"top: -160px; left: -96px;\"\u0026gt;\n \u0026lt;/span\u0026gt;\n\u0026lt;/span\u0026gt;\n\u0026lt;span unselectable=\"on\" class=\"ms-cui-ctl-largelabel\" style=\"height: auto;\"\u0026gt;Edit\u0026lt;span unselectable=\"on\"\u0026gt; \n\u0026lt;/span\u0026gt;Page\u0026lt;/span\u0026gt;\n\u0026lt;/a\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eUnfortunately it is not working. Any thoughts?\u003c/p\u003e\n\n\u003cp\u003eI will be doing the same with the \"Stop Editing\" button as well.\u003c/p\u003e","accepted_answer_id":"7164067","answer_count":"2","comment_count":"0","creation_date":"2011-08-19 22:27:16.247 UTC","last_activity_date":"2013-09-15 18:21:26.74 UTC","last_edit_date":"2013-09-15 18:21:26.74 UTC","last_editor_display_name":"","last_editor_user_id":"2131717","owner_display_name":"","owner_user_id":"892792","post_type_id":"1","score":"1","tags":"sharepoint|sharepoint-2010|web-parts|ribbon|webpartpage","view_count":"2285"} +{"id":"40833881","title":"filter a datagridview using linq to entities","body":"\u003cp\u003eI just found linq to entities. I decided to use it in my program.\u003c/p\u003e\n\n\u003cp\u003eI have a database with Sql server 2014. I imported my database with the help of \"Ado.net entity data model\". \u003c/p\u003e\n\n\u003cp\u003eUntil then everything is fine, I created a context and I binded it on a bindingsource and the bindingsource is binded to my datagridview.\u003c/p\u003e\n\n\u003cp\u003eThe problem is that when I come to filter my datagridview with the help of bindingsource.filter, nothing happens.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e bindingsource.DataSource = entitiesCOOP.completeInventory.ToList()\ndgv.DataSource = bindingsource\n\nbindingsource.Filter = String.Format(\"description LIKE '\" \u0026amp; txt_description.Text \u0026amp; \"%'\")\n dgv.Refresh()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eDid I make a mistake somewhere? Or is it the fact that it is a list that does not allow to filter?\u003c/p\u003e\n\n\u003cp\u003eOtherwise, would there be another way I could use with the help of entity framework to filter a datagridview?\u003c/p\u003e","accepted_answer_id":"40834860","answer_count":"1","comment_count":"0","creation_date":"2016-11-27 21:04:25.877 UTC","last_activity_date":"2016-11-28 13:59:01.313 UTC","last_edit_date":"2016-11-28 13:59:01.313 UTC","last_editor_display_name":"","last_editor_user_id":"6861233","owner_display_name":"","owner_user_id":"6861233","post_type_id":"1","score":"0","tags":"vb.net|entity-framework|datagridview|filter|linq-to-entities","view_count":"74"} +{"id":"10783770","title":"gnuplot to group multiple bars","body":"\u003cp\u003eI am using gnuplot to generate graphs for multiple benchmarks.\u003cbr/\u003e \nFor each benchmark I have many configurations to plot. \nI want to plot a graph hit-rate(my y-axis) vs benchmark(x-axis). \nThere will be multiple columns for each benchmark differentiated by their color. \u003c/p\u003e\n\n\u003cp\u003eI generated the same type of graphs some time back using some python script, but I don't know how to do this in gnuplot.\u003c/p\u003e","accepted_answer_id":"10786085","answer_count":"1","comment_count":"1","creation_date":"2012-05-28 11:15:49.613 UTC","favorite_count":"5","last_activity_date":"2015-10-24 20:20:24.213 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"950238","post_type_id":"1","score":"5","tags":"graph|plot|gnuplot","view_count":"18283"} +{"id":"39929222","title":"SDL2 Window not displaying","body":"\u003cp\u003eI'm trying to open a window with SDL2 in visual studio 2015. I've set a .bmp image in my code to display to the screen in a window, but when I run my code the program returns 0 and closes without a window. The .bmp image is in the project folder. How do you display the window?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;SDL.h\u0026gt;\n#include \u0026lt;iostream\u0026gt;\n\nint main(int argc, char* args[])\n{\n SDL_Window *window = nullptr;\n SDL_Surface *windowSurface = nullptr;\n SDL_Surface *imageSurface = nullptr;\n\n if (SDL_Init(SDL_INIT_VIDEO) \u0026lt; 0)\n std::cout \u0026lt;\u0026lt; \"Game Initialization error: \" \u0026lt;\u0026lt; SDL_GetError() \u0026lt;\u0026lt; std::endl;\n {\n window = SDL_CreateWindow(\"Contrast Beta 0.0.1\", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 1280, 920, SDL_WINDOW_HIDDEN | SDL_WINDOW_FULLSCREEN);\n if (window == NULL)\n std::cout \u0026lt;\u0026lt; \"Window Creation Failed, Error: \" \u0026lt;\u0026lt; SDL_GetError() \u0026lt;\u0026lt; std::endl;\n else\n {\n //Window Created\n windowSurface = SDL_GetWindowSurface(window);\n imageSurface = SDL_LoadBMP(\"Background.bmp\");\n\n if (imageSurface == NULL)\n std::cout \u0026lt;\u0026lt; \"Error loading background: \" \u0026lt;\u0026lt; SDL_GetError() \u0026lt;\u0026lt; std::endl;\n else\n {\n SDL_BlitSurface(imageSurface, NULL, windowSurface, NULL);\n SDL_UpdateWindowSurface(window);\n SDL_Delay(2000);\n }\n }\n }\n SDL_DestroyWindow(window);\n SDL_Quit();\n return 0;\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"39931597","answer_count":"1","comment_count":"0","creation_date":"2016-10-08 06:02:44.977 UTC","last_activity_date":"2016-10-08 11:02:54.497 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6940355","post_type_id":"1","score":"-1","tags":"c++|visual-studio|sdl-2","view_count":"73"} +{"id":"20726617","title":"Why the following Java makeBricks solution fails?","body":"\u003cp\u003eCan anyone help me to correct the solution for the following codingbat question? Thanks in advance.\u003c/p\u003e\n\n\u003cp\u003eI am getting \u003ccode\u003eOK\u003c/code\u003e for all the test cases except for the unknown \u003ccode\u003e\"Other Tests\"\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eSpecification:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eWe want to make a row of bricks that is goal inches long. We have a number of small bricks (1 inch each) and big bricks (5 inches each). Return true if it is possible to make the goal by choosing from the given bricks. \u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eCode Snippet:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic boolean makeBricks(int small, int big, int goal) {\n if (goal == 0) return true;\n\n if (goal \u0026lt; big * 5) {\n goal = goal - small; //Use all the small bricks each of inch 1\n while (goal \u0026gt; 0) {\n goal = goal - 5;\n --big;\n if (big == 0) {\n break;\n }\n }\n return (goal == 0);\n }\n else {\n goal = goal - (big * 5); //Use all the big bricks each of inch 5\n while (goal \u0026gt; 0) {\n goal = goal - 1;\n --small;\n if (small == 0) {\n break;\n }\n }\n return (goal == 0);\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/Wptpx.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eAfter working hard I found the solution which works for all the test cases. It is \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e return ((goal \u0026lt;= small + big * 5) \u0026amp;\u0026amp; goal % 5 \u0026lt;= small);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut, just for the sake of curiosity I want to know why the above code snippet doesn't work for every case. Any help would be greatly appreciated.\u003c/p\u003e","accepted_answer_id":"20735247","answer_count":"2","comment_count":"5","creation_date":"2013-12-22 05:42:05.817 UTC","favorite_count":"0","last_activity_date":"2016-01-15 07:16:00.55 UTC","last_edit_date":"2015-10-29 14:33:49.347 UTC","last_editor_display_name":"user3034861","last_editor_user_id":"543538","owner_display_name":"user3034861","post_type_id":"1","score":"0","tags":"java","view_count":"836"} +{"id":"32588589","title":"c++ multiple smart pointers allocation cause crash","body":"\u003cp\u003eThe \u003cem\u003emaxPointers\u003c/em\u003e value may need to be different for your system, but allocating many \u003cem\u003eunique_ptr\u003c/em\u003es causes this application to crash and burn. Removing the definition of \u003cem\u003es\u003c/em\u003e and the \u003cem\u003ecin\u003c/em\u003e operation gives some more room for pointer allocation.\u003c/p\u003e\n\n\u003cp\u003eUsing MSVC 2015.\u003c/p\u003e\n\n\u003cp\u003eSo, why does it crash and how to avoid it?\u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;iostream\u0026gt;\n#include \u0026lt;vector\u0026gt;\n#include \u0026lt;string\u0026gt;\n#include \u0026lt;memory\u0026gt;\nusing namespace std;\n\nint main(int argn, const char*argv[])\n{\n int maxPointers = 37900;\n vector\u0026lt;unique_ptr\u0026lt;string\u0026gt;\u0026gt; pointerHolder;\n for (int i = 0; i \u0026lt; maxPointers; i++)\n {\n pointerHolder.push_back(make_unique\u0026lt;string\u0026gt;(\"pointer \" + i));\n }\n cout \u0026lt;\u0026lt; \"done creating \"\u0026lt;\u0026lt; maxPointers \u0026lt;\u0026lt; \" pointers\" \u0026lt;\u0026lt; endl;\n string s;\n cin \u0026gt;\u0026gt; s;\n for (int i = 0; i \u0026lt; maxPointers; i++)\n {\n pointerHolder.at(i).release();\n }\n pointerHolder.clear();\n cout \u0026lt;\u0026lt; \"done releasing \" \u0026lt;\u0026lt; maxPointers \u0026lt;\u0026lt; \" pointers\" \u0026lt;\u0026lt; endl;\n return EXIT_SUCCESS;\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"32588834","answer_count":"1","comment_count":"6","creation_date":"2015-09-15 14:24:38.65 UTC","last_activity_date":"2015-09-15 14:34:54.127 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5338281","post_type_id":"1","score":"0","tags":"c++|visual-c++|smart-pointers","view_count":"78"} +{"id":"29508089","title":"Http request failed: java.net.UnknownHostException: http:\\/\\/staging.xxxxxxx.com\"","body":"\u003cp\u003eI can get result from already implemented worklight examples like rss, google map api, etc... But I don't understand how to assess my own API. I am getting the following error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n \"errors\": [\n \"Runtime: Http request failed: java.net.UnknownHostException: http:\\/\\/staging.mycompany.com\"\n ],\n \"info\": [\n ],\n \"isSuccessful\": false,\n \"warnings\": [\n ]\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003emyRestAdapter.xml\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;?xml version=\"1.0\" encoding=\"UTF-8\"?\u0026gt;\n\n \u0026lt;wl:adapter name=\"myRESTAdapter\"\nxmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" \nxmlns:wl=\"http://www.ibm.com/mfp/integration\"\nxmlns:http=\"http://www.ibm.com/mfp/integration/http\"\u0026gt;\n\n\u0026lt;displayName\u0026gt;myRESTAdapter\u0026lt;/displayName\u0026gt;\n\u0026lt;description\u0026gt;myRESTAdapter\u0026lt;/description\u0026gt;\n\u0026lt;connectivity\u0026gt;\n \u0026lt;connectionPolicy xsi:type=\"http:HTTPConnectionPolicyType\"\u0026gt;\n \u0026lt;protocol\u0026gt;http\u0026lt;/protocol\u0026gt;\n \u0026lt;domain\u0026gt;http://staging.mycompany.com\u0026lt;/domain\u0026gt;\n \u0026lt;port\u0026gt;80\u0026lt;/port\u0026gt; \n \u0026lt;connectionTimeoutInMilliseconds\u0026gt;30000\u0026lt;/connectionTimeoutInMilliseconds\u0026gt;\n \u0026lt;socketTimeoutInMilliseconds\u0026gt;30000\u0026lt;/socketTimeoutInMilliseconds\u0026gt;\n \u0026lt;maxConcurrentConnectionsPerNode\u0026gt;50\u0026lt;/maxConcurrentConnectionsPerNode\u0026gt;\n \u0026lt;!-- Following properties used by adapter's key manager for choosing specific certificate from key store \n \u0026lt;sslCertificateAlias\u0026gt;\u0026lt;/sslCertificateAlias\u0026gt; \n \u0026lt;sslCertificatePassword\u0026gt;\u0026lt;/sslCertificatePassword\u0026gt;\n --\u0026gt; \n \u0026lt;/connectionPolicy\u0026gt;\n\u0026lt;/connectivity\u0026gt;\n\n\u0026lt;procedure name=\"getGmapLatLng\"/\u0026gt;\n\n \u0026lt;/wl:adapter\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003emyRESTAdapter-impl.js\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e function getGmapLatLng(UserName) {\n\nvar input = {\n method : 'post',\n returnedContentType : 'application/json',\n path : '/RESTapi/Rest_LoginValidate.php', // the method which i want to access, actual url is this \"http://mycompany.com/RESTapi/LoginValidate.php\"\n parameters : {\n 'UserName' : UserName,\n\n }\n};\n\nreturn WL.Server.invokeHttp(input);\n }\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-04-08 07:06:29.573 UTC","last_activity_date":"2015-04-08 08:58:00.44 UTC","last_edit_date":"2015-04-08 07:26:20.733 UTC","last_editor_display_name":"","last_editor_user_id":"1530814","owner_display_name":"","owner_user_id":"3106851","post_type_id":"1","score":"0","tags":"ibm-mobilefirst|worklight-adapters","view_count":"828"} +{"id":"39263792","title":"Why datatable do not append one zero in left of the day in date whhen fetched from the database(sql)","body":"\u003cp\u003eI have date saved in sql DB and it is in the format \u003ccode\u003e01-12-2016\u003c/code\u003e (I mean it appends zero when single digit of day and month) but the same date when i fetch from database and store it in data table I get this \nformat \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e1/12/2016 \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eHow to append zero to it ?\u003c/strong\u003e And why it eliminates zero at start ?\u003c/p\u003e","accepted_answer_id":"39263993","answer_count":"1","comment_count":"4","creation_date":"2016-09-01 06:06:31.567 UTC","last_activity_date":"2016-09-01 06:19:45.553 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6769286","post_type_id":"1","score":"0","tags":"c#|sql|.net|datetime|datatable","view_count":"35"} +{"id":"38587520","title":"Convert images with folder","body":"\u003cp\u003eI have problem with converting folders with images.\nI only got work that its converting images but its not taking folders.\u003c/p\u003e\n\n\u003cp\u003eI dont figure out what I must change to get folders with images.\u003c/p\u003e\n\n\u003cp\u003eExample:\u003c/p\u003e\n\n\u003cp\u003eIf I choose folder where is alot folders and converting with folders to converted Folder (C:\\test) and if folder already exists then not converting.\u003c/p\u003e","accepted_answer_id":"38587645","answer_count":"1","comment_count":"3","creation_date":"2016-07-26 10:35:36.21 UTC","last_activity_date":"2016-07-27 10:46:50.297 UTC","last_edit_date":"2016-07-26 12:12:52.52 UTC","last_editor_display_name":"","last_editor_user_id":"6626397","owner_display_name":"","owner_user_id":"6626397","post_type_id":"1","score":"-1","tags":"c#","view_count":"54"} +{"id":"14319920","title":"JSON.NET deserialize results in list with default values","body":"\u003cp\u003eAm I missing something obvious here? JSON:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e{\"p\":[{},{\"clientId\":102102059663,\"checkbox1Ticked\":false,\"checkbox2Ticked\":false},{\"clientId\":23841,\"checkbox1Ticked\":false,\"checkbox2Ticked\":false},{\"clientId\":102102111426,\"checkbox1Ticked\":false,\"checkbox2Ticked\":false}]}\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eC#: (checkboxData is the string above)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public JsonResult SubmitSelectedChanges(string checkboxData)\n {\n var deserializedClients = JsonConvert.DeserializeObject\u0026lt;ChangeList\u0026gt;(checkboxData);\n return null;\n }\n\n public class ChangeList\n {\n public List\u0026lt;Change\u0026gt; p { get; set; }\n }\n\n\n public class Change\n {\n string clientId { get; set; }\n bool checkbox1Ticked { get; set; }\n bool checkbox2Ticked { get; set; }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAfter deserializing the clientId is always null and the checbox1Ticked and checkbox2Ticked is false.\u003c/p\u003e","accepted_answer_id":"14319957","answer_count":"1","comment_count":"1","creation_date":"2013-01-14 14:03:52.843 UTC","last_activity_date":"2013-01-14 14:05:05.307 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"589089","post_type_id":"1","score":"0","tags":"c#|json.net","view_count":"310"} +{"id":"790270","title":"I need help with the $(this) context in jQuery","body":"\u003cp\u003eI need some help in this code block:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eoptions.imgs.click(function() {\n var allImgs = $(\"#big img\");\n $(\"#big img\").each(function(n) {\n this.index = n;\n })\n animateImage(allImgs);\n })\n\n };\n\n function animateImage(images) {\n for(var i = 0; i \u0026lt; images.length; i++) {\n if (images[i].index == 0) {\n alert($(this).index)\n }\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy problem is: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(this).effect('scale', { percent: 200 }, 1000)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIsn't working. I want that statement to refer to the image with the index of 0, and scale it 200%. But \u003ccode\u003e$(this)\u003c/code\u003e isn't referring to the first image at all.\u003c/p\u003e","answer_count":"3","comment_count":"2","creation_date":"2009-04-26 05:06:13.977 UTC","favorite_count":"1","last_activity_date":"2009-04-26 06:26:22.677 UTC","last_edit_date":"2009-04-26 05:22:59.597 UTC","last_editor_display_name":"","last_editor_user_id":"44084","owner_display_name":"","owner_user_id":"95663","post_type_id":"1","score":"1","tags":"jquery","view_count":"152"} +{"id":"31601782","title":"Nginx Proxy/ Apache - cache static file or duplicate to nginx server","body":"\u003cp\u003eIt setup wordpress on apache server and config it runs smooth.\u003c/p\u003e\n\n\u003cp\u003eNow i want to setup a nginx proxy to server static files. \u003c/p\u003e\n\n\u003cp\u003eSo i have some questions: \u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003e\u003cp\u003eDo i need to duplicate uploads folder of wordpress and put in nginx server ?\nOr try to cache all static file in nginx server ?\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eOn apache server i use module deflate, expires, pagespeed, opcache. So if i add nginx proxy to server static files, should i remove the deflate, expires, pagespee module ? Because we can do this work on nginx server.\u003c/p\u003e\u003c/li\u003e\n\u003c/ol\u003e","answer_count":"1","comment_count":"2","creation_date":"2015-07-24 03:38:06.563 UTC","favorite_count":"1","last_activity_date":"2015-07-24 09:16:32.107 UTC","last_edit_date":"2015-07-24 07:49:01.63 UTC","last_editor_display_name":"","last_editor_user_id":"304828","owner_display_name":"","owner_user_id":"304828","post_type_id":"1","score":"0","tags":"apache|nginx","view_count":"264"} +{"id":"27236123","title":"GuessGame can't get program to output messages","body":"\u003cp\u003eI got the widow and the buttons into the GUI but for the life of me I can't get anything to output. I am suppose to enter a guess, and from a random number the game generates. It is suppose to tell me if I'm too high, too low or correct. Also, if it is not correct it's supposed to tell me if I am warm or cold. If any one could point me in the right direction on this I would be grateful. I don't know what I'm doing wrong on this. I have researched different topics but with the different ways to solve this problem none match what I was looking for.\u003c/p\u003e\n\n\u003cp\u003eHere's the code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e//all necessary imports\n\npublic class GuessGame extends JFrame \n{\n private static final long serialVersionUID = 1L;\n private JFrame mainFrame;\n private JTextField guessField;\n private JLabel message1;\n private JLabel message2;\n private JLabel message3;\n private JLabel message4;\n private JLabel guessLabel;\n private JLabel tooHigh;\n private JLabel tooLow;\n private JButton guessButton;\n private JButton newGame;\n private JButton exitButton;\n private int randomNum = 0;\n private final int MAX_NUM = 1000;\n private final int MIN_NUM = 1;\n private int guessCount;\n private int lastDistance;\n\n public GuessGame()\n {\n mainFrame = new JFrame();\n guessField = new JTextField(4);\n message4 = new JLabel(\"I have a number between 1 and 1000 -- can you guess my number?\") ;\n guessLabel = new JLabel(\"Please Enter Your Guess:\");\n\n\n guessButton = new JButton(\"Guess\");\n newGame = new JButton(\"New Game\");\n exitButton = new JButton(\"Exit\");\n\n Container c = mainFrame.getContentPane();\n c.setLayout(new FlowLayout());\n c.setBackground(Color.CYAN);\n\n c.add(message4);\n c.add(guessLabel);\n c.add(guessField);\n c.add(guessButton);\n c.add(newGame);\n c.add(exitButton);\n\n newGame.setMnemonic('N');\n exitButton.setMnemonic('E');\n guessButton.setMnemonic('G');\n\n mainFrame.setSize(420, 300);//Sets width and height of Window\n mainFrame.setVisible(true);//Allows GUI to be visible\n mainFrame.addWindowListener(new WindowAdapter()\n\n {\n public void windowClosing(WindowEvent e)\n {\n System.exit(0);\n }\n });\n\n GuessButtonsHandler gHandler = new GuessButtonsHandler();\n guessField.addActionListener(gHandler);\n\n ExitButtonsHandler eHandler = new ExitButtonsHandler();\n exitButton.addActionListener(eHandler);\n\n NewGameButtonsHandler nHandler = new NewGameButtonsHandler();\n newGame.addActionListener(nHandler);\n }\n\n class GuessButtonsHandler implements ActionListener\n {\n @Override\n public void actionPerformed(ActionEvent e)\n {\n\n Random rand = new Random();\n\n int guess = 0;\n int currDistance = 0;\n boolean correct = false;\n guess = Integer.parseInt(guessField.getText());//Converts String to Integer\n\n if(guessCount == 0)\n {\n lastDistance = MAX_NUM;\n }\n\n if(guess \u0026gt;= MIN_NUM \u0026amp;\u0026amp; guess \u0026lt;= MAX_NUM)\n {\n guessCount += 1;\n }\n\n if(guess \u0026gt; randomNum)\n {\n tooHigh.setText(\"Number To High!!!\");\n guessCount += 1;\n }\n\n else if(guess \u0026gt; randomNum)\n {\n tooLow.setText(\"Number To Low!!!\");\n guessCount += 1;\n }\n\n else \n {\n correct = true;\n message2.setText(\"Correct!!!\");\n message2.setBackground(Color.GREEN);\n guessField.setEditable(false);\n }\n\n if(!correct)\n {\n currDistance = Math.abs(guess - randomNum);\n }\n\n if(currDistance \u0026lt;= lastDistance)\n {\n message3.setText(\"You are getting warmer!!!\");\n mainFrame.add(message3).setBackground(Color.RED);\n\n }\n\n else\n {\n message4.setText(\"You are getting colder!!!\");\n mainFrame.add(message4).setBackground(Color.BLUE);\n }\n\n lastDistance = currDistance;\n randomNum = rand.nextInt(1000) + 1;\n }\n\n }\n\n class NewGameButtonsHandler implements ActionListener\n {\n public void actionPerformed(ActionEvent e)\n {\n Random rand = new Random();\n randomNum = rand.nextInt(1000) + 1;\n guessCount = 0;\n }\n }\n\n class ExitButtonsHandler implements ActionListener\n {\n public void actionPerformed(ActionEvent e)\n {\n System.exit(0);\n }\n }\n}\n\npublic class GuessGameTest {\n\n public static void main(String[] args) \n {\n new GuessGame();\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"27237100","answer_count":"1","comment_count":"1","creation_date":"2014-12-01 19:51:04.463 UTC","last_activity_date":"2014-12-01 21:50:35.797 UTC","last_edit_date":"2014-12-01 21:50:35.797 UTC","last_editor_display_name":"","last_editor_user_id":"4204026","owner_display_name":"","owner_user_id":"3543714","post_type_id":"1","score":"1","tags":"java|swing","view_count":"52"} +{"id":"42602524","title":"How can I print a Word document in C# without showing the print dialog","body":"\u003cp\u003eI'm using C# and Word Interop to automate a mail merge. I want to print each merged document to the default printer with the default options but don't want the print options dialog to show each time. How can I do this? When I try this code on my client machine, a print options dialog displays when the PrintOut method is called. Here's my code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eWord.Application oWord = new Word.Application();\noWord.Visible = false;\nWord.Document oWordDoc = new Word.Document();\nobject oTemplatePath = Path.Combine(baseDir, fileName);\noWordDoc = oWord.Documents.Add((ref oTemplatePath, ref oMissing, ref oMissing, ref oMissing);\nobject copies = \"1\";\nobject pages = \"\";\nobject range = Word.WdPrintOutRange.wdPrintAllDocument;\nobject items = Word.WdPrintOutItem.wdPrintDocumentContent;\nobject pageType = Word.WdPrintOutPages.wdPrintAllPages;\nobject oTrue = true;\nobject oFalse = false;\noWordDoc.PrintOut(ref oTrue, ref oFalse, ref range, ref oMissing, ref oMissing, ref oMissing, ref items, ref copies, ref pages, ref pageType, ref oFalse, ref oTrue, ref oMissing, ref oFalse, ref oMissing, ref oMissing, ref oMissing, ref oMissing);\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"2","creation_date":"2017-03-04 23:19:44.147 UTC","last_activity_date":"2017-03-05 18:39:48.63 UTC","last_edit_date":"2017-03-05 18:39:48.63 UTC","last_editor_display_name":"","last_editor_user_id":"1373196","owner_display_name":"","owner_user_id":"1373196","post_type_id":"1","score":"1","tags":"c#|printing|ms-word","view_count":"266"} +{"id":"40953022","title":"How to use contents of text file as input to shell script?","body":"\u003cp\u003eI'm tasked with writing a shell script that takes in a string of 6 letters and numbers and checks if they meet a certain criteria.\u003c/p\u003e\n\n\u003cp\u003eThis is that script\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eFILE=$1\nvar=${#FILE}\nif [ $var -gt 6 ] || [ $var -lt 6 ]\nthen\n #echo $FILE \"is not a valid NSID\"\n exit 1\nelse if ( echo $1 | egrep -q '^[A-Za-z]{3}\\d{3}$' )\n then\n #echo $1 \"is a valid NSID\"\n exit 0\n else\n #echo $1 \"is not a valid NSID\"\n exit 1\n fi\nfi\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt works. so that isn't where the problem is.\u003c/p\u003e\n\n\u003cp\u003eWhat I am trying to do is use a \"wrapper\" script to gather potential valid NSID's from a text file and call that script on the list of inputs. so that if I call that script within my wrapper script it will step through the text file I have given my wrapper and check if each line is valid.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eFILE=$1\nYES= more $FILE\n\nif ( exec /path/to/file/is_nsid.sh $YES -eq 0 )\nthen\n echo $FILE \"is a valid NSID\"\nelse\n echo $FILE \"is not a valid NSID\"\nfi\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eso if I called it with a text file called file1.txt which contained\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eyes123\nyess12\nye1243\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eit would output whether each was valid or not.\u003c/p\u003e","accepted_answer_id":"40953854","answer_count":"1","comment_count":"0","creation_date":"2016-12-03 22:08:25.363 UTC","last_activity_date":"2016-12-04 02:50:31.853 UTC","last_edit_date":"2016-12-03 23:53:45.67 UTC","last_editor_display_name":"","last_editor_user_id":"1566221","owner_display_name":"","owner_user_id":"5786983","post_type_id":"1","score":"1","tags":"bash|shell|wrapper","view_count":"164"} +{"id":"25815498","title":"Getting back hidden language templates in \"New Project...\" dialog?","body":"\u003cp\u003eWhen I first started Visual Studio 2010 I selected the Business Intelligence Environment but now I also want to see the Visual Basic environment. How can I get back access to the VB.net template for new projects?\u003c/p\u003e\n\n\u003cp\u003eWhen I click on New project It shows me Business Intelligence, SQL Server, and Other Project Types, which only has 'blank Solution' in it. I am hoping to being able to create bew BI projects and new VB.net projects.\u003c/p\u003e\n\n\u003cp\u003eThank You!\u003c/p\u003e","accepted_answer_id":"25815882","answer_count":"1","comment_count":"1","creation_date":"2014-09-12 19:30:04.047 UTC","last_activity_date":"2014-09-12 19:56:04.23 UTC","last_edit_date":"2014-09-12 19:43:18.133 UTC","last_editor_display_name":"","last_editor_user_id":"608639","owner_display_name":"","owner_user_id":"1653002","post_type_id":"1","score":"1","tags":"vb.net|visual-studio-2010|visual-studio","view_count":"34"} +{"id":"5279322","title":"Can I specify an Entity as a Datastore property to achieve join-like functionality?","body":"\u003cp\u003eFor example, I have the entity Parent and the entity Child. Since the Datastore does not allow joins, I cannot specify parentKey as a property in Child. I mean, I can but that won't do me any good. \u003c/p\u003e\n\n\u003cp\u003eBut if I want to retrieve Parent properties in queries to the Child, do I solve the problem by specifying the entire Parent entity as a property in Child? Is it proper to do so? \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eEntity parentEntity = new Entity(\"Parent\");\n// ... process parentEntity\n\nEntity childEntity = new Entity(\"Child\");\nchildEntity.setProperty(\"parentEntity\", parentEntity);\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"5279469","answer_count":"2","comment_count":"0","creation_date":"2011-03-11 23:03:57.967 UTC","last_activity_date":"2011-03-16 21:00:34.11 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"607241","post_type_id":"1","score":"1","tags":"java|google-app-engine|datastore","view_count":"117"} +{"id":"20402808","title":"Error while running two builds at the same time","body":"\u003cp\u003eDoes anybody knows why there's an issue while running two builds at the\nsame time on the same build server? \u003c/p\u003e\n\n\u003cp\u003eI have the following error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecp: cannot create regular file\n`/tmp/tmpdir_ap/ck/up/config/launcher.11': Permission denied\nPKG ERROR [package-prebuild.c/genfiles()] : Error 0 on system\n(cp -d /vobs/tito/fdd/app/files/m2/launcher.11\n/tmp/tmpdir_ap/ck/up/config/launcher.11)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOn another build, I have the following error. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emake[3]: Leaving directory\n`/vobs/...............'\nFailure in communication with signing server...........\nfailure getting the chain key file, aborting.\n---\nUnexpected error!\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-12-05 14:38:08.023 UTC","last_activity_date":"2013-12-05 17:14:49.647 UTC","last_edit_date":"2013-12-05 14:44:10.083 UTC","last_editor_display_name":"","last_editor_user_id":"6309","owner_display_name":"","owner_user_id":"2370590","post_type_id":"1","score":"0","tags":"linux|makefile|cmake|clearcase-ucm","view_count":"51"} +{"id":"8949566","title":"When I dismiss a UIImagePicker in a full-scren app, the status bar shows and moves everything down 20px","body":"\u003cp\u003eI have set-up a \u003ccode\u003eUIImagePickerViewController\u003c/code\u003e in a full screen app (Status bar initially hidden). But when it comes to testing it on the simulator, the status bar shows when the \u003ccode\u003emodalViewController\u003c/code\u003e is dismissed. What's the problem?\u003c/p\u003e\n\n\u003cp\u003eAny help appreciated!\u003c/p\u003e\n\n\u003cp\u003eSeb\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2012-01-21 00:17:39.213 UTC","favorite_count":"1","last_activity_date":"2012-05-28 06:18:17.993 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1161696","post_type_id":"1","score":"0","tags":"xcode4.2|statusbar|ios5","view_count":"302"} +{"id":"15639858","title":"Javascript \"this\" through different scope","body":"\u003cp\u003ePlease, read and try the code below. Click on \"foo\" paragraph. Looking at the browser console, I don't see the expected results, while if I click on \"bar\", I do.\u003c/p\u003e\n\n\u003cp\u003eWhy is that happening?\u003c/p\u003e\n\n\u003cpre class=\"lang-html prettyprint-override\"\u003e\u003ccode\u003e\u0026lt;!DOCTYPE HTML PUBLIC\n \"-//W3C//DTD HTML 4.01//EN\"\n \"http://www.w3.org/TR/html4/strict.dtd\"\u0026gt;\n\u0026lt;html\u0026gt;\n \u0026lt;head\u0026gt;\n \u0026lt;meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\"\u0026gt;\n \u0026lt;/head\u0026gt;\n \u0026lt;body\u0026gt;\n \u0026lt;div class=\"root\"\u0026gt;\n \u0026lt;div\u0026gt;\n \u0026lt;p id=\"foo\"\u0026gt;foo\u0026lt;/p\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;p id=\"bar\"\u0026gt;bar\u0026lt;/p\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;script type=\"text/javascript\"\u0026gt;\n var p_list = document.getElementsByTagName('P');\n for (var n=0; n\u0026lt;p_list.length; n++) {\n p_list[n].onclick = function() {\n console.log('ONCLICK - id: ' + this.id + ' - ' + getC( this ) + '\\n');\n };\n }\n function getC( P ) {\n if (P.parentNode.className === 'root') {\n console.log('INSIDE FUNCTION - id: ' + P.id + ' - ' + P.parentNode);\n return P.parentNode;\n } else {\n getC( P.parentNode );\n }\n }\n \u0026lt;/script\u0026gt;\n \u0026lt;/body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eLive code: \u003ca href=\"http://jsbin.com/izuleg/1/edit\" rel=\"nofollow\"\u003ehttp://jsbin.com/izuleg/1/edit\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"15639933","answer_count":"3","comment_count":"6","creation_date":"2013-03-26 14:40:51.86 UTC","favorite_count":"0","last_activity_date":"2013-03-26 14:53:45.91 UTC","last_edit_date":"2013-03-26 14:45:57.997 UTC","last_editor_display_name":"","last_editor_user_id":"825789","owner_display_name":"","owner_user_id":"2211418","post_type_id":"1","score":"0","tags":"javascript|events|this|anonymous-function|parent-node","view_count":"75"} +{"id":"25516852","title":"Doing math in a bash script","body":"\u003cp\u003eThe following is a snippet from a script that Generates random passwords with a length of the users choice. I have got the script functioning perfectly as a GUI.\u003c/p\u003e\n\n\u003cp\u003eI would like to add some extra functionality, at the bottom of the script is some info for the user \u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eThe passwords generated by this application are very strong, here is an example of the strength you can achieve by using this application;\u003c/code\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eLength of Password:\n$newnumber\n\nCharacter Combinations:\n${#matrix}\n\nCalculations Per Second: \n4 billion\n\nPossible Combinations: 2 vigintillion\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003ccode\u003eBased on an average Desktop PC making about 4 Billion calculations per second it would take about\n 21 quattuordecillion years to crack your password.\u003c/code\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eAs a number that's 21,454,815,022,336,020,000,000,000,000,000,000,000,000,000,000 years!\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow would I get bash to calculate the answer of \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e`21 quattuordecillion years` \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003efrom \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eLength of Password:\n$newnumber\n\nCharacter Combinations:\n${#matrix}\n\nCalculations Per Second: \n4 billion\n\nPossible Combinations: 2 vigintillion\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"4","creation_date":"2014-08-26 23:44:28.593 UTC","last_activity_date":"2017-05-16 11:34:50.21 UTC","last_edit_date":"2014-08-28 19:31:36.743 UTC","last_editor_display_name":"","last_editor_user_id":"3978993","owner_display_name":"","owner_user_id":"3978993","post_type_id":"1","score":"0","tags":"linux|bash|shell|math","view_count":"190"} +{"id":"43498658","title":"Excel Ribbon Dropdown","body":"\u003cp\u003eI have an Excel add-in that adds a tab to my ribbon with XML. \u003c/p\u003e\n\n\u003cp\u003eThe tab has a dropdown with three options. When I choose an option different to the current value, then the macro runs fine, but when I click on the dropdown and the value stays the same, the macro doesn't run. \u003c/p\u003e\n\n\u003cp\u003eThe macro updates the format of the selected cells. How can I run a macro when I click on the dropwdown, even if the value stays the same. Here is my xml and vb code:\u003c/p\u003e\n\n\u003cp\u003eXML:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;group id=\"pvt\" label=\"Formatting\"\u0026gt; \n \u0026lt;dropDown id=\"ddItem\" label=\"Date Format\" onAction=\"dtFormat\"\u0026gt;\n \u0026lt;item id=\"Item1\" label=\"dd-mmm-yyyy\"/\u0026gt;\n \u0026lt;item id=\"Item2\" label=\"dd-mmm-yy\"/\u0026gt;\n \u0026lt;item id=\"Item3\" label=\"dd/mmm/yyyy\"/\u0026gt;\n \u0026lt;/dropDown\u0026gt;\n\u0026lt;/group \u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eVB.NET:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ePublic Sub dtFormat(control As IRibbonControl, ID As String, index As Integer)\n If index = 0 Then\n Selection.NumberFormat = \"dd-mmm-yyyy\"\n ElseIf index = 1 Then\n Selection.NumberFormat = \"dd-mmm-yy\"\n ElseIf index = 2 Then\n Selection.NumberFormat = \"dd\\/mmm\\/yyyy\"\n End If\n\nEnd Sub\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"5","creation_date":"2017-04-19 14:29:48.887 UTC","last_activity_date":"2017-04-19 20:48:20.783 UTC","last_edit_date":"2017-04-19 20:48:20.783 UTC","last_editor_display_name":"","last_editor_user_id":"201303","owner_display_name":"","owner_user_id":"2672634","post_type_id":"1","score":"0","tags":"xml|excel|vba|ribbon","view_count":"141"} +{"id":"22054301","title":"How to properly index MongoDB queries with multiple $and and $or statements","body":"\u003cp\u003eI have a collection in MongoDB (app_logins) that hold documents with the following structure:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n \"_id\" : \"c8535f1bd2404589be419d0123a569de\"\n \"app\" : \"MyAppName\",\n \"start\" : ISODate(\"2014-02-26T14:00:03.754Z\"),\n \"end\" : ISODate(\"2014-02-26T15:11:45.558Z\")\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSince the documentation says that the queries in an $or can be executed in parallel and can use separate indices, and I assume the same holds true for $and, I added the following indices:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edb.app_logins.ensureIndex({app:1})\ndb.app_logins.ensureIndex({start:1})\ndb.app_logins.ensureIndex({end:1})\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut when I do a query like this, way too many documents are scanned:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edb.app_logins.find(\n{\n $and:[\n { app : \"MyAppName\" },\n {\n $or:[\n {\n $and:[\n { start : { $gte:new Date(1393425621000) }},\n { start : { $lte:new Date(1393425639875) }}\n ]\n },\n {\n $and:[\n { end : { $gte:new Date(1393425621000) }},\n { end : { $lte:new Date(1393425639875) }}\n ]\n },\n {\n $and:[\n { start : { $lte:new Date(1393425639875) }},\n { end : { $gte:new Date(1393425621000) }}\n ]\n }\n ]\n }\n ]\n}\n).explain()\n\n{\n \"cursor\" : \"BtreeCursor app_1\",\n \"isMultiKey\" : true,\n \"n\" : 138,\n \"nscannedObjects\" : 10716598,\n \"nscanned\" : 10716598,\n \"nscannedObjectsAllPlans\" : 10716598,\n \"nscannedAllPlans\" : 10716598,\n \"scanAndOrder\" : false,\n \"indexOnly\" : false,\n \"nYields\" : 30658,\n \"nChunkSkips\" : 0,\n \"millis\" : 38330,\n \"indexBounds\" : {\n \"app\" : [\n [\n \"MyAppName\",\n \"MyAppName\"\n ]\n ]\n },\n \"server\" : \"127.0.0.1:27017\"\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI know that this can be caused because 10716598 match the 'app' field, but the other query can return a much smaller subset.\u003c/p\u003e\n\n\u003cp\u003eIs there any way I can optimize this? The aggregation framework comes to mind, but I was thinking that there may be a better way to optimize this, possibly using indexes.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdit:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eLooks like if I add an index on app-start-end, as Josh suggested, I am getting better results. I am not sure if I can optimize this further this way, but the results are much better:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n \"cursor\" : \"BtreeCursor app_1_start_1_end_1\",\n \"isMultiKey\" : false,\n \"n\" : 138,\n \"nscannedObjects\" : 138,\n \"nscanned\" : 8279154,\n \"nscannedObjectsAllPlans\" : 138,\n \"nscannedAllPlans\" : 8279154,\n \"scanAndOrder\" : false,\n \"indexOnly\" : false,\n \"nYields\" : 2934,\n \"nChunkSkips\" : 0,\n \"millis\" : 13539,\n \"indexBounds\" : {\n \"app\" : [\n [\n \"MyAppName\",\n \"MyAppName\"\n ]\n ],\n \"start\" : [\n [\n {\n \"$minElement\" : 1\n },\n {\n \"$maxElement\" : 1\n }\n ]\n ],\n \"end\" : [\n [\n {\n \"$minElement\" : 1\n },\n {\n \"$maxElement\" : 1\n }\n ]\n ]\n },\n \"server\" : \"127.0.0.1:27017\"\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"22054871","answer_count":"2","comment_count":"3","creation_date":"2014-02-26 21:59:35.957 UTC","last_activity_date":"2014-02-27 03:47:40.007 UTC","last_edit_date":"2014-02-26 22:17:31.547 UTC","last_editor_display_name":"","last_editor_user_id":"333918","owner_display_name":"","owner_user_id":"333918","post_type_id":"1","score":"0","tags":"mongodb","view_count":"105"} +{"id":"45313360","title":"getDisplayName() and getPhotoUrl() without signing in user to android firebase","body":"\u003cp\u003eI am creating a login page in android using Firebase Email Password Authentication and I want when a user enters its Email address and shift to password the system automatically get the PhotoUrl and DisplayName and display on the Login page Before a user enters His Full Password.\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2017-07-25 20:58:38.357 UTC","last_activity_date":"2017-07-25 22:02:32.61 UTC","last_edit_date":"2017-07-25 21:56:59.87 UTC","last_editor_display_name":"","last_editor_user_id":"5246885","owner_display_name":"","owner_user_id":"8366127","post_type_id":"1","score":"0","tags":"android|firebase|firebase-authentication|firebase-storage","view_count":"119"} +{"id":"44604596","title":"Need to open permission to 766 to let PHP to edit files","body":"\u003cp\u003eAs the title described, I have tried making the file which I need to edit permission to 764 and it didn't work.\u003cbr\u003e\nI don't have permission to the php config and other main configuration, do I have any options other than using 766?\nAdditionally, will 766 let other to edit my file over HTTP?\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2017-06-17 12:22:37.48 UTC","last_activity_date":"2017-06-17 13:47:27.22 UTC","last_edit_date":"2017-06-17 13:47:27.22 UTC","last_editor_display_name":"","last_editor_user_id":"7901773","owner_display_name":"","owner_user_id":"7901773","post_type_id":"1","score":"1","tags":"php|apache|file-permissions","view_count":"43"} +{"id":"34293411","title":"Elasticsearch parent - child mapping: Search in both and highlight","body":"\u003cp\u003eI have the following elasticsearch 1.6.2 index mappings: parent \u003cstrong\u003eitem\u003c/strong\u003e and child \u003cstrong\u003edocument\u003c/strong\u003e. One item can have several documents. Documents are \u003cstrong\u003enot\u003c/strong\u003e nested because they contain base64 data (mapper-attachments-plugin) and cannot be updated with an item.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\"mappings\" : {\n \"document\" : {\n \"_parent\" : {\n \"type\" : \"item\"\n }, \n \"_routing\" : {\n \"required\" : true\n },\n \"properties\" : {\n \"extension\" : {\n \"type\" : \"string\",\n \"term_vector\" : \"with_positions_offsets\", \n \"include_in_all\" : true\n }, ...\n },\n }\n \"item\" : { \n \"properties\" : {\n \"prop1\" : {\n \"type\" : \"string\",\n \"include_in_all\" : true\n }, ...\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI like to search in \u003cstrong\u003eboth\u003c/strong\u003e indices but always return \u003cstrong\u003eitems\u003c/strong\u003e. If there is a match in an document, return the corresponding item. If there is a match in an item, return the item. If both is true, return the item. \u003c/p\u003e\n\n\u003cp\u003eIs it possible to combine \u003cstrong\u003ehas_child\u003c/strong\u003e and \u003cstrong\u003ehas_parent\u003c/strong\u003e searches?\u003c/p\u003e\n\n\u003cp\u003eThis search only searches in documents and returns items:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n \"query\": {\n \"has_child\": {\n \"type\": \"document\",\n \"query\": {\n \"query_string\":{\"query\":\"her*}\n },\n \"inner_hits\" : {\n \"highlight\" : {\n \"fields\" : {\n \"*\" : {} \n }\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eEXAMPLE\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eGET index/item/174\n{\n \"_type\" : \"item\",\n \"_id\" : \"174\",\n \"_source\":{\"prop1\":\"Perjeta construction\"}\n}\n\nGET index/document/116\n{\n \"_type\" : \"document\",\n \"_id\" : \"116\", \n \"_source\":{\"extension\":\"pdf\",\"item\": {\"id\":174},\"fileName\":\"construction plan\"}\n} \n\n__POSSIBLE SEARCH RESULT searching for \"constr*\"__\n\n{\n\"hits\": {\n \"total\": 1,\n \"hits\": [\n {\n \"_type\": \"item\",\n \"_id\": \"174\",\n \"_source\": {\n \"prop1\": \"Perjeta construction\"\n },\n \"highlight\": {\n \"prop1\": [\n \"Perjeta \u0026lt;em\u0026gt;construction\u0026lt;\\/em\u0026gt;\"\n ]\n },\n \"inner_hits\": {\n \"document\": {\n \"hits\": {\n \"hits\": [\n {\n \"_type\": \"document\",\n \"_id\": \"116\",\n \"_source\": {\n \"extension\": \"pdf\",\n \"item\": {\n \"id\": 174\n }, \n \"fileName\": \"construction plan\"\n },\n \"highlight\": {\n \"fileName\": [\n \"\u0026lt;em\u0026gt;construction\u0026lt;\\/em\u0026gt; plan\"\n ]\n }\n }\n ]\n }\n }\n }\n }\n ]\n}\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"35230048","answer_count":"1","comment_count":"1","creation_date":"2015-12-15 15:44:25.833 UTC","last_activity_date":"2016-02-05 17:28:08.867 UTC","last_edit_date":"2015-12-15 16:12:35.24 UTC","last_editor_display_name":"","last_editor_user_id":"1056504","owner_display_name":"","owner_user_id":"1056504","post_type_id":"1","score":"0","tags":"elasticsearch","view_count":"181"} +{"id":"12093896","title":"Taking a picture and then emailing it","body":"\u003cp\u003eI am trying to create an application where you can take a picture and then email it to someone. At the moment I can take a picture and set my background as this picture:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class Camera extends Activity implements View.OnClickListener{\n\n\nImageButton ib;\nButton b;\nImageView iv;\nIntent i;\nfinal static int cameraData = 0;\nBitmap bmp;\n\n@Override\nprotected void onCreate(Bundle savedInstanceState) {\n // TODO Auto-generated method stub\n super.onCreate(savedInstanceState);\n setContentView(R.layout.photo);\n initialize();\n InputStream is = getResources().openRawResource(R.drawable.ic_launcher);\n bmp = BitmapFactory.decodeStream(is);\n}\n\nprivate void initialize(){\n ib = (ImageButton) findViewById(R.id.ibTakePic);\n b = (Button) findViewById(R.id.bSetWall);\n iv = (ImageView) findViewById(R.id.ivReturnedPic);\n b.setOnClickListener(this);\n ib.setOnClickListener(this);\n\n\n\n}\n\n@Override\npublic void onClick(View v) {\n File mImageFile;\n // TODO Auto-generated method stub\n switch(v.getId()){\n case R.id.bSetWall:\n try {\n getApplicationContext().setWallpaper(bmp);\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n\n break;\n case R.id.ibTakePic:\n i = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);\n startActivityForResult(i, cameraData);\n break;\n }\n\n}\n\n@Override\nprotected void onActivityResult(int requestCode, int resultCode, Intent data) {\n // TODO Auto-generated method stub\n super.onActivityResult(requestCode, resultCode, data);\n if(resultCode == RESULT_OK){\n Bundle extras = data.getExtras();\n bmp = (Bitmap)extras.get(\"data\");\n iv.setImageBitmap(bmp);\n }\n}\n\n\n\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have a separate application where I can take in user input and email it to a predefined address:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public void onClick(View v) {\n // TODO Auto-generated method stub\n convertEditTextVarsIntoStringsAndYesThisIsAMethodWeCreated();\n String emailaddress[] = { \"info@sklep.com\", \"\", };\n String message = emailAdd + name + beginning;\n\n Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);\n emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, emailaddress);\n\n emailIntent.setType(\"plain/text\");\n emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, message);\n startActivity(emailIntent);\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow do I go about emailing the picture that I have taken? Where is it saved and how do I access it so that I can email it?\u003c/p\u003e\n\n\u003cp\u003eMany Thanks\u003c/p\u003e","accepted_answer_id":"12094137","answer_count":"2","comment_count":"0","creation_date":"2012-08-23 14:25:13.293 UTC","last_activity_date":"2013-11-08 05:45:17.12 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"876343","post_type_id":"1","score":"0","tags":"android|android-intent|android-camera","view_count":"143"} +{"id":"29457499","title":"In open cv, how can i convert gray scale image back in to RGB image(color)","body":"\u003cp\u003eIn open cv to remove background, using current frame and former frame, i applied absdiff function and created a difference image in gray scale. However, i would like to covert the gray scale image back in to RGB with actual color of the image, but i have no idea how to operate this back in.\nI'm using C++.\nCould any one knowledgeable of open cv help me?\u003c/p\u003e","answer_count":"1","comment_count":"5","creation_date":"2015-04-05 12:55:45.5 UTC","last_activity_date":"2015-04-05 15:25:41.797 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3455085","post_type_id":"1","score":"0","tags":"c++|image|opencv","view_count":"242"} +{"id":"10008551","title":"How to write test cases for assignment","body":"\u003cp\u003eThe part of my assignment is to create tests for each function. This ones kinda long but I am so confused. I put a link below this function so you can see how it looks like\u003cbr\u003e\nfirst code is extremely long because.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef load_profiles(profiles_file, person_to_friends, person_to_networks):\n '''(file, dict of {str : list of strs}, dict of {str : list of strs}) -\u0026gt; NoneType\n Update person to friends and person to networks dictionaries to include\n the data in open file.'''\n\n # for updating person_to_friends dict\n update_p_to_f(profiles_file, person_to_friends)\n update_p_to_n(profiles_file, person_to_networks)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eheres the whole code: \u003ca href=\"http://shrib.com/8EF4E8Z3\" rel=\"nofollow\"\u003ehttp://shrib.com/8EF4E8Z3\u003c/a\u003e, I tested it through mainblock and it works. \nThis is the text file(profiles_file) we were provided that we are using to convert them :\n\u003ca href=\"http://shrib.com/zI61fmNP\" rel=\"nofollow\"\u003ehttp://shrib.com/zI61fmNP\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eHow do I run test cases for this through nose, what kinda of test outcomes are there? Or am I not being specific enough? \u003c/p\u003e\n\n\u003cp\u003eimport nose\nimport a3_functions\u003c/p\u003e\n\n\u003cp\u003edef test_load_profiles_\u003c/p\u003e\n\n\u003cp\u003eif \u003cstrong\u003ename\u003c/strong\u003e == '\u003cstrong\u003emain\u003c/strong\u003e':\n nose.runmodule()\nI went that far then I didn't know what I can test for the function. \u003c/p\u003e","answer_count":"2","comment_count":"8","creation_date":"2012-04-04 09:36:30.373 UTC","last_activity_date":"2012-10-03 05:32:10.363 UTC","last_edit_date":"2012-10-03 05:32:10.363 UTC","last_editor_display_name":"","last_editor_user_id":"1118932","owner_display_name":"","owner_user_id":"1172182","post_type_id":"1","score":"-2","tags":"python|testing","view_count":"544"} +{"id":"44480289","title":"Why do MRU cache replacement and LRU policy perform same on Sniper Multicore simulator when its cache_size =8192KB of L3 ?","body":"\u003cp\u003eIn \u003cem\u003eSniper Multicore Simulator\u003c/em\u003e for these benchmarks \u003cstrong\u003egcc, bzip, lbm\u003c/strong\u003e etc i ran \u003cem\u003esimulation\u003c/em\u003e for \u003cem\u003ecache_size\u003c/em\u003e=8192kB \u003cstrong\u003eMRU\u003c/strong\u003e and \u003cstrong\u003eLRU\u003c/strong\u003e performs same i.e. Same identical output file but it shouldn't be equal as MRU and LRU are different policies but when i reduces \u003cem\u003ecache_size\u003c/em\u003e =512KB then these performs different. So I think its because of size MRU and LRU perform same on these benchmarks. But why does it happen?? Anyone can explain.. Thanks \u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2017-06-11 04:11:39.483 UTC","last_activity_date":"2017-06-11 04:11:39.483 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6710153","post_type_id":"1","score":"0","tags":"simulation","view_count":"12"} +{"id":"27459141","title":"Autolayout Xcode 6.1.1","body":"\u003cp\u003ei have a big Problem with Autolayout....\u003c/p\u003e\n\n\u003cp\u003ehave a View Controller , in this i have on top a View, then under the View a Table View, \ninside the Table View is a View ... and in this View are views...... \u003c/p\u003e\n\n\u003cp\u003eauto layout ar not working... it works on iphone... but on the Preview from the ipad.... ist not ok... \u003c/p\u003e\n\n\u003cp\u003eon the Screenshot you see what i mean ..\u003c/p\u003e\n\n\u003cp\u003eThanks for help... \u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://dl.dropboxusercontent.com/u/3798714/autolayout.zip\" rel=\"nofollow noreferrer\"\u003eMy Test Projekt\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/wJNfK.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2014-12-13 13:09:07.57 UTC","favorite_count":"2","last_activity_date":"2014-12-13 13:09:07.57 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2071788","post_type_id":"1","score":"1","tags":"ios|objective-c|iphone|xcode","view_count":"111"} +{"id":"19973225","title":"How to get the data usage details of map?","body":"\u003cp\u003eI know that \u003ca href=\"http://developer.android.com/reference/android/net/TrafficStats.html\" rel=\"nofollow\"\u003eTrafficStats\u003c/a\u003e API provides the details of data usage while sending or receiving data from android application. I want to know the data usage detail from map. How can I get it ? Suppose I open an application, load the map and perform some activity like zoom in, zoom, out, drag map. During this activities google map is going to consume some data usage. How can I find out that how much data usage is done by the my application's map ?\u003c/p\u003e","accepted_answer_id":"19976581","answer_count":"1","comment_count":"0","creation_date":"2013-11-14 08:51:39.907 UTC","last_activity_date":"2013-11-14 11:33:37.573 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2567598","post_type_id":"1","score":"2","tags":"android|google-maps","view_count":"95"} +{"id":"46805128","title":"How to prevent script injection that was pasted to input","body":"\u003cp\u003eRecently I've met the XSS problem. I've searched and read a lot of related questions and articles. I've noticed that all answers are focused on how to prevent untrusted data to be passed to server. And in front-end, escape special codes seems the only way to prevent scripts execute. \u003c/p\u003e\n\n\u003cp\u003eBut what if a user just input a piece of code(such as \u003ccode\u003e\u0026lt;script\u0026gt;alert(\"hi\");\u0026lt;/script\u0026gt;\u003c/code\u003e) to an input, when will this code executes? And is there a way to prevent it? \u003c/p\u003e\n\n\u003cp\u003eI've listened the \u003ccode\u003ekeydown\u003c/code\u003e \u003ccode\u003ekeyup\u003c/code\u003e event, but this can only prevent normal input, it has no effort when user copy and paste directly into input, it'll show my warning message when user input a piece of script, but the script still executed! \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(\"input\").on(\"keyup\", function (e) {\n var value = $(this).val() || \"\";\n var regex = /\u0026lt;(\\/?\\w+[^\\n\u0026gt;]*\\/?)\u0026gt;/ig;\n if(regex.test(value)){\n layer.msg(\"Invalid characters!\");\n $(this).val(value.replace(regex, \"\u0026amp;lt;$1\u0026amp;gt;\"));\n e.preventDefault();\n return false;\n }\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI don't understand why the script in an input's value is executed by browser, and when it is executed ? Is there any articles that can explain this mechanism or is related ? Did I have something unnoticed ?\nIf there any articles that you think will help, please let me know.\nThanks.\u003c/p\u003e\n\n\u003cp\u003eThanks for all the answers and comments. Maybe I didn't describe it clear. I've test that \u003cstrong\u003ewhen I copied \u003ccode\u003e\u0026lt;script\u0026gt;alert(\"hi\");\u0026lt;/script\u0026gt;\u003c/code\u003e and paste it into an input, the browser did prompt an alert window and showed the \"hi\".\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI've also just use \u003ccode\u003e$(\"input\").val('\u0026lt;script\u0026gt;alert(\"hi\");\u0026lt;/script\u0026gt;')\u003c/code\u003e, it won't prompt alert window, but if I trigger the input's \u003ccode\u003efocus\u003c/code\u003e and \u003ccode\u003eblur\u003c/code\u003e event, it will prompt the alert window too.\u003c/p\u003e\n\n\u003cp\u003eSo, why the codes are executed ?\u003c/p\u003e","answer_count":"2","comment_count":"3","creation_date":"2017-10-18 07:45:37.357 UTC","last_activity_date":"2017-10-18 08:18:33.783 UTC","last_edit_date":"2017-10-18 08:07:03.137 UTC","last_editor_display_name":"","last_editor_user_id":"5804153","owner_display_name":"","owner_user_id":"5804153","post_type_id":"1","score":"2","tags":"javascript|jquery|xss","view_count":"54"} +{"id":"34433356","title":"Camel Csv read store data to sql","body":"\u003cp\u003eI need to read CSV file and than i need to store all data in one table.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic static DataSource setupDataSource(String connectURI) {\n String url = \"jdbc:mysql://127.0.0.1:3306/ams\";\n BasicDataSource ds = new BasicDataSource();\n ds.setDriverClassName(\"com.mysql.jdbc.Driver\");\n ds.setUsername(\"root\");\n ds.setPassword(\"root\");\n ds.setUrl(connectURI);\n return ds;\n}\n\npublic static void main(String[] args) throws Exception {\n String url = \"jdbc:mysql://127.0.0.1:3306/ams\";\n DataSource dataSource = setupDataSource(url);\n\n SimpleRegistry reg = new SimpleRegistry();\n\n reg.put(\"dataSource\", dataSource);\n\n CamelContext context = new DefaultCamelContext(reg);\n\n String myString = \" \u0026lt;route id=\\\"UserCSVToMYSQL\\\" xmlns=\\\"http://camel.apache.org/schema/spring\\\"\u0026gt;\"\n + \" \u0026lt;from uri=\\\"file:/home/viral/Projects/camel/cxfJavaTest/src/csvfiles?noop=true\\\" /\u0026gt;\"\n + \" \u0026lt;log loggingLevel=\\\"DEBUG\\\" message=\\\"${body}\\\"/\u0026gt;\"\n + \" \u0026lt;split streaming=\\\"true\\\"\u0026gt;\"\n + \" \u0026lt;tokenize token=\\\"\\n\\\" /\u0026gt;\"\n + \" \u0026lt;unmarshal\u0026gt;\"\n + \" \u0026lt;csv/\u0026gt;\"\n + \" \u0026lt;/unmarshal\u0026gt;\"\n + \" \u0026lt;transform\u0026gt; \"\n + \" \u0026lt;simple\u0026gt;${body[0]}\u0026lt;/simple\u0026gt; \"\n + \" \u0026lt;/transform\u0026gt; \"\n + \" \u0026lt;log loggingLevel=\\\"DEBUG\\\" message=\\\"${body}\\\"/\u0026gt;\"\n + \" \u0026lt;to uri=\\\"sql:INSERT INTO user(`external_user_id`,`first_name`,`last_name`,`email`,`active`) VALUES (#,#,#,#,#)?dataSourceRef=dataSource\\\"/\u0026gt; \"\n + \" \u0026lt;/split\u0026gt; \" + \" \u0026lt;/route\u0026gt; \";\n\n InputStream is = new ByteArrayInputStream(myString.getBytes());\n RoutesDefinition routes = context.loadRoutesDefinition(is);\n context.addRouteDefinitions(routes.getRoutes());\n context.setTracing(true);\n\n context.start();\n\n Thread.sleep(16000);\n System.out.println(\"Done\");\n context.stop();\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eyou are able to see the code in which i have used\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e + \" \u0026lt;transform\u0026gt; \"\n + \" \u0026lt;simple\u0026gt;${body[0]}\u0026lt;/simple\u0026gt; \"\n + \" \u0026lt;/transform\u0026gt; \"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAfter executing this code it will store only 0 index row from csv. I need to store all raws from csv to sql table.\u003c/p\u003e\n\n\u003cp\u003eIf any one know please provide me solution for same.\u003c/p\u003e","accepted_answer_id":"34445092","answer_count":"1","comment_count":"1","creation_date":"2015-12-23 10:16:54.613 UTC","last_activity_date":"2015-12-23 23:58:08.923 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1893769","post_type_id":"1","score":"0","tags":"sql|csv|jdbc|apache-camel","view_count":"511"} +{"id":"11928944","title":"How to show previous data in same row using MySQL?","body":"\u003cp\u003eI'm having problem with showing data in my database. I have \u003ccode\u003ejos_stock\u003c/code\u003e table with field \u003ccode\u003erem_balance\u003c/code\u003e. \u003ccode\u003erem_balance\u003c/code\u003e have value \u003ccode\u003e0, 126, 12, 9\u003c/code\u003e. In my website. \u003ccode\u003erem_balance\u003c/code\u003e show it depends on the week i.e. year 2012 week 26 the value of the remaining balance is 0. It means 2012 week 25 = 126, 2012 week 24 = 12 and 2012 week 23 = 9.\u003c/p\u003e\n\n\u003cp\u003eAll I want to do is if the value of the current week is which is 26 is equal to 0. It will show the previous balance which is 126. How do I do this? Any Suggestion? I'm using Ruby on Rails.\u003c/p\u003e\n\n\u003cp\u003e\u003cb\u003eHere is my query in model:\u003c/b\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT(\"jos_product.id, jos_product.product_code AS code, jos_product.name, \npc.id AS category_id, pc.name AS category_name, thumbnail, location, \noriginal_image,CONCAT(sm.year, '/', sm.week) as week_start, \nCONCAT(sm2.year, '/', sm2.week) AS reprint_week, pr.quantity AS reprint_qty,\njos_stock.rem_balance AS balance\")\n.joins(\"INNER JOIN jos_product_category AS pc ON pc.id = jos_product.product_category\")\n.joins(\"INNER JOIN jos_stock_movement AS sm ON sm.id = jos_product.start_week\")\n.joins(\"LEFT OUTER JOIN jos_stock ON jos_stock.product_id = jos_product.id\")\n.joins(\"LEFT OUTER JOIN (select product, max(stock_movement) AS reprint, quantity from \njos_product_reprint group by product) AS pr ON pr.product IN (jos_product.id)\")\n.joins(\"LEFT OUTER JOIN jos_stock_movement AS sm2 ON sm2.id = pr.reprint\")\n.where(\"jos_product.published = 1 #{ search_query }\")\n.order(\"jos_product.product_code ASC\")\n.group(\"jos_product.product_code\")\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"11930945","answer_count":"1","comment_count":"0","creation_date":"2012-08-13 06:08:26.303 UTC","last_activity_date":"2012-08-13 09:36:46.363 UTC","last_edit_date":"2012-08-13 09:30:07.163 UTC","last_editor_display_name":"","last_editor_user_id":"1522983","owner_display_name":"","owner_user_id":"1522983","post_type_id":"1","score":"1","tags":"mysql|sql|ruby-on-rails|ruby|ruby-on-rails-3.1","view_count":"168"} +{"id":"22955143","title":"When to register Google Cloud Messaging?","body":"\u003cp\u003eMy question is when exactly do I need to Register the broadcast receiver?\u003c/p\u003e\n\n\u003cp\u003eDo I do it (or attempt to do it) every time the application starts up?\u003cbr\u003e\nDo I keep the registration id somewhere (persistent of course) and check if that is null only register then?\u003c/p\u003e\n\n\u003cp\u003eCurrently I register when the application starts up (if/when they have been authenticated), however I am not sure if this is good/bad.\u003c/p\u003e\n\n\u003cp\u003ePlease advise.\u003c/p\u003e","accepted_answer_id":"22955284","answer_count":"1","comment_count":"3","creation_date":"2014-04-09 07:02:31.13 UTC","last_activity_date":"2014-04-09 07:09:44.9 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1471542","post_type_id":"1","score":"0","tags":"android|broadcastreceiver|google-cloud-messaging","view_count":"61"} +{"id":"15656154","title":"Scalatest sharing service instance across multiple test suites","body":"\u003cp\u003eI have FlatSpec test classes which need to make use of a REST service for some fixture data. When running all the tests in one go I only really want to instantiate the REST client once as it may be quite expensive. How can I go about this and can I also get it to work for running just one test class when I am running in my IDE?\u003c/p\u003e","answer_count":"2","comment_count":"1","creation_date":"2013-03-27 10:04:46.883 UTC","last_activity_date":"2015-06-25 09:12:33.377 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1058732","post_type_id":"1","score":"3","tags":"dependency-injection|fixtures|scalatest","view_count":"765"} +{"id":"13920607","title":"Bash script copy *.log files into a new directory","body":"\u003cp\u003ei got some files like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e2012-12-17_083213_1.log\n2012-12-17_083213_1.log_stats\n2012-12-17_083213_1.logaccount_ptr\n2012-12-17_083213_1.loginitial_ptr\n2012-12-17_083213_1.logptr\n2012-12-17_093049_2.log\n2012-12-17_093049_2.log_stats\n2012-12-17_093049_2.logaccount_ptr\n2012-12-17_093049_2.loginitial_ptr\n2012-12-17_093049_2.logptr\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ein here every 1G of data filled a new file is created with the name in Year-Month-Day_HourMinuteSecond_number.log format (as you can see above).\nI want to\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eCopy all *.log to a new folder named with the format Year-Month-Day like for these it would be named 2012-12-17\u003c/li\u003e\n\u003cli\u003eTgz that folder \u003c/li\u003e\n\u003cli\u003eSend it to a server IP.\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eI don't know how exactly. I want it as a bash script so that I can run it every day for the newly added files. Thanks for helping.\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2012-12-17 19:15:10.473 UTC","last_activity_date":"2012-12-18 09:05:25.143 UTC","last_edit_date":"2012-12-17 19:16:53.493 UTC","last_editor_display_name":"","last_editor_user_id":"1258041","owner_display_name":"","owner_user_id":"1910909","post_type_id":"1","score":"0","tags":"unix","view_count":"679"} +{"id":"20111820","title":"Output each word in string to a new line","body":"\u003cp\u003eI'm designing a function which has 1 input parameter : string. The function takes the contents of this string, and outputs each word to a new line. Currently, this function does everything except output the last word in the string. Here's the functions code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evoid outputPhrase(string newPhrase)\n{\n string ok;\n for (int i = 0; i \u0026lt; newPhrase.length(); i++)\n {\n ok += newPhrase[i];\n if (isspace(newPhrase.at(i)))\n {\n cout \u0026lt;\u0026lt; ok \u0026lt;\u0026lt; endl;\n ok.clear();\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"20111837","answer_count":"2","comment_count":"0","creation_date":"2013-11-21 03:23:53.213 UTC","last_activity_date":"2013-11-21 03:50:56.537 UTC","last_edit_date":"2013-11-21 03:37:50.933 UTC","last_editor_display_name":"","last_editor_user_id":"3671015","owner_display_name":"","owner_user_id":"3015834","post_type_id":"1","score":"0","tags":"c++|string","view_count":"263"} +{"id":"9926612","title":"Trying to create a delete link_to for nested_attributes object in its parents view","body":"\u003cp\u003eSo I have a situation were users are owned by accounts.\u003c/p\u003e\n\n\u003cp\u003eI am listing users for each account as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efor @user in @account.users.where(['email \u0026lt;\u0026gt; ?', 'null']).sort! {|b, a| a.id \u0026lt;=\u0026gt; b.id}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFor each user I want to be able to offer the functionality to delete via a link. I have the following:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;p\u0026gt;Are you sure you want to delete \u0026lt;%=h @user.firstname %\u0026gt;?:\n\u0026lt;%= link_to \"Yes\", account_users_path(@user), :remote =\u0026gt; true, :method =\u0026gt; :delete, :class =\u0026gt; \"button\" %\u0026gt;\n\u0026lt;span class=\"button canceldeleteobject\"\u0026gt; No \u0026lt;/span\u0026gt;\u0026lt;/p\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, when I run this I get:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eStarted DELETE \"/accounts/28/users\" for ::1 at 2012-03-29 09:42:39 -0400\n\nAbstractController::ActionNotFound (The action '28' could not be found for AccountsController):\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe user id is '28' where as the account id is '15', therefore I sense it has something to do with the account_users_path element, but any light you could shed on the best way to do this type of nested_attribute delete would be greatly appreciated.\u003c/p\u003e\n\n\u003cp\u003eEDIT:\u003c/p\u003e\n\n\u003cp\u003eRoutes look like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e devise_for :users, :controllers =\u0026gt; { :sessions =\u0026gt; \"sessions\" }, :skip =\u0026gt; :registrations do\n get 'users/edit' =\u0026gt; 'registrations#edit', :as =\u0026gt; 'edit_user_registration'\n put 'users' =\u0026gt; 'registrations#update', :as =\u0026gt; 'user_registration'\n delete 'users' =\u0026gt; 'registrations#destroy', :as =\u0026gt; 'destroy_user_registration' \n end\n\n resources :accounts do\n resources :assessments, :areas, :risks, :controls, :persons, :roles, :mitigations, :comments, :users\n collection do\n put :update_attribute_on_the_spot\n get :get_attribute_on_the_spot\n end\n end\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"9928113","answer_count":"1","comment_count":"1","creation_date":"2012-03-29 13:44:10.473 UTC","last_activity_date":"2012-03-29 15:04:37.8 UTC","last_edit_date":"2012-03-29 14:18:02.143 UTC","last_editor_display_name":"","last_editor_user_id":"1291865","owner_display_name":"","owner_user_id":"1291865","post_type_id":"1","score":"0","tags":"ruby-on-rails|ruby-on-rails-3|ruby-on-rails-3.1|nested-attributes","view_count":"333"} +{"id":"39250387","title":"Sync code changes in electron app while developing","body":"\u003cp\u003eAre there any tools to live reload electron app when code is changed similar to browser-sync for web?\u003c/p\u003e\n\n\u003cp\u003eWhenever we change code for electron app, I am terminating existing running process and relaunching with \n\u003cem\u003eelectron .\u003c/em\u003e\nAre they any tools to reload electron app automatically when code is changed.\u003c/p\u003e","accepted_answer_id":"41725899","answer_count":"2","comment_count":"1","creation_date":"2016-08-31 13:00:28.223 UTC","last_activity_date":"2017-07-04 19:06:31.667 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2175896","post_type_id":"1","score":"0","tags":"javascript|electron|electron-builder","view_count":"502"} +{"id":"1878811","title":"How are Data Access Objects usually designed?","body":"\u003cp\u003eHow are DAOs usually designed for the typical business application ? Does one class or pattern dialogue with the data source or do you simply have a separate DAO for each Entity ?\u003c/p\u003e","accepted_answer_id":"1878861","answer_count":"2","comment_count":"0","creation_date":"2009-12-10 05:32:42.397 UTC","favorite_count":"0","last_activity_date":"2009-12-10 06:30:22.777 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"225899","post_type_id":"1","score":"0","tags":"java|dao|data-access-layer","view_count":"259"} +{"id":"15409230","title":"Relative Layout Textview text Overlapping","body":"\u003cp\u003eHi i have a problem with my Textview in a Relative layout. How you can see they are overlapping each other. I would like it if you can help me.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://www.dropbox.com/s/7qfikzlgpys5mqf/Screenshot_2013-03-14-13-09-28.png\" rel=\"nofollow\"\u003ePicture\u003c/a\u003e: \u003cimg src=\"https://www.dropbox.com/s/7qfikzlgpys5mqf/Screenshot_2013-03-14-13-09-28.png\" alt=\"\"\u003e\u003cbr\u003e\nthanks in advance\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" encoding=\"utf-8\"?\u0026gt;\n\u0026lt;RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\nandroid:layout_width=\"fill_parent\"\nandroid:layout_height=\"wrap_content\"\nandroid:paddingBottom=\"2dp\"\nandroid:paddingTop=\"2dp\" \u0026gt;\n\n\u0026lt;ImageView\n android:id=\"@+id/row_image\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_alignParentBottom=\"true\"\n android:layout_alignParentTop=\"true\"\n android:layout_marginBottom=\"1dp\"\n android:layout_marginRight=\"2dp\"\n android:contentDescription=\"@string/desc\" /\u0026gt;\n\n\u0026lt;ImageView\n android:id=\"@+id/multiselect_icon\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_alignParentBottom=\"true\"\n android:layout_alignParentTop=\"true\"\n android:layout_toRightOf=\"@id/row_image\"\n android:contentDescription=\"@string/desc\"\n android:src=\"@drawable/singlecheck\"\n android:visibility=\"gone\" /\u0026gt;\n\n\u0026lt;TextView\n android:id=\"@+id/top_view\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_alignParentTop=\"true\"\n android:layout_toRightOf=\"@id/multiselect_icon\"\n android:dividerHeight=\"2sp\"\n android:ellipsize=\"end\"\n android:lineSpacingExtra=\"1sp\"\n android:paddingBottom=\"13dp\"\n android:paddingLeft=\"1dp\"\n android:paddingTop=\"13dp\"\n android:singleLine=\"true\"\n android:textColor=\"?android:attr/textColorPrimaryDisableOnly\"\n android:textIsSelectable=\"false\"\n android:textSize=\"16sp\" /\u0026gt;\n\n\u0026lt;TextView\n android:id=\"@+id/bottom_view\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_alignParentRight=\"true\"\n android:layout_alignParentTop=\"true\"\n android:layout_below=\"@id/top_view\"\n android:dividerHeight=\"2sp\"\n android:ellipsize=\"end\"\n android:gravity=\"right\"\n android:maxLength=\"50\"\n android:paddingBottom=\"13dp\"\n android:paddingLeft=\"1dp\"\n android:paddingTop=\"13dp\"\n android:singleLine=\"true\"\n android:textColor=\"?android:attr/textColorPrimaryDisableOnly\"\n android:textIsSelectable=\"false\"\n android:textSize=\"16sp\"\n android:textStyle=\"bold\" /\u0026gt;\n\n \u0026lt;/RelativeLayout\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"15409319","answer_count":"1","comment_count":"0","creation_date":"2013-03-14 12:24:08.643 UTC","last_activity_date":"2014-09-05 02:37:56.977 UTC","last_edit_date":"2014-09-05 02:37:56.977 UTC","last_editor_display_name":"","last_editor_user_id":"482717","owner_display_name":"","owner_user_id":"2169712","post_type_id":"1","score":"0","tags":"layout|textview|relative|overlapping","view_count":"2520"} +{"id":"44538442","title":"How to make scoreborad in tkinter","body":"\u003cp\u003eI would like to implement a scoreboard using a tkinter.\nand i want make if the distance between the object bullet and the object enemy is less than 10, I want to increase the score by 10.\nHow do I add code?\nThank you in advance.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efrom tkinter import *\nimport time\nimport random\n\nWIDTH = 800\nHEIGHT = 800\n\nclass Ball:\n def __init__(self, canvas, color, size, x, y, xspeed, yspeed):\n self.canvas = canvas\n self.color = color\n self.size = size\n self.x = x\n self.y = y\n self.xspeed = xspeed\n self.yspeed = yspeed\n self.id = canvas.create_oval(x, y, x+size, y+size, fill=color)\n\n def move(self):\n self.canvas.move(self.id, self.xspeed, self.yspeed)\n (x1, y1, x2, y2) = self.canvas.coords(self.id)\n (self.x, self.y) = (x1, y1)\n if x1 \u0026lt;= 0 or x2 \u0026gt;= WIDTH: \n self.xspeed = - self.xspeed\n if y1 \u0026lt;= 0 or y2 \u0026gt;= HEIGHT: \n self.yspeed = - self.yspeed\n\n\nbullets = []\n\ndef fire(event):\n bullets.append(Ball(canvas, \"red\", 10, 150, 250, 10, 0))\n\ndef up(event):\n spaceship.yspeed-=1\ndef down(event):\n spaceship.yspeed+=1\n\n\nwindow = Tk()\ncanvas = Canvas(window, width=WIDTH, height=HEIGHT)\ncanvas.pack()\ncanvas.bind(\"\u0026lt;Button-1\u0026gt;\", fire)\nwindow.bind(\"\u0026lt;Up\u0026gt;\",up)\nwindow.bind(\"\u0026lt;Down\u0026gt;\",down) \n\n\nspaceship = Ball(canvas, \"green\", 100, 100, 200, 0, 0)\nenemy = Ball(canvas, \"red\", 100, 500, 200, 5, 0)\n\n\nwhile True:\n for bullet in bullets:\n bullet.move()\n if (bullet.x+bullet.size) \u0026gt;= WIDTH: \n canvas.delete(bullet.id)\n bullets.remove(bullet)\n enemy.move()\n spaceship.move()\n window.update()\n time.sleep(0.03)\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"1","creation_date":"2017-06-14 07:39:07.503 UTC","last_activity_date":"2017-06-14 16:51:34.503 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"8157620","post_type_id":"1","score":"0","tags":"class|tkinter|pygame|tkinter-canvas","view_count":"38"} +{"id":"12909668","title":"Is it possible to set an attribute's default value to a other attribute's value in XSD?","body":"\u003cp\u003eSuppose I have an XML like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;foo ...\u0026gt;\n \u0026lt;bar a=\"s1\" b=\"s2\" /\u0026gt;\n \u0026lt;bar a=\"s3\" /\u0026gt;\n\u0026lt;/foo\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat I'd like is to define in the XSD is that the default value of attribute \u003ccode\u003eb\u003c/code\u003e should be the value of attribute \u003ccode\u003ea\u003c/code\u003e. Is that possible?\u003c/p\u003e\n\n\u003cp\u003eThanks in advance!\u003c/p\u003e","accepted_answer_id":"12912001","answer_count":"1","comment_count":"0","creation_date":"2012-10-16 07:36:13.113 UTC","last_activity_date":"2012-10-16 09:55:22.007 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"981284","post_type_id":"1","score":"0","tags":"xml|xsd|xml-attribute","view_count":"88"} +{"id":"11556633","title":"Parse application/smil MMS MIME type on android","body":"\u003cp\u003eSo I have come across three categories of MMS message types:\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003ePlain Text - \"text/plain\"\u003c/code\u003e \u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eImage - \"image/jpeg\", \"image/bmp\", \"image/gif\", \"image/jpg\", \"image/png\"\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eSMIL (Synchronized Multimedia Integration Language) - \"application/smil\"\u003c/code\u003e \u003c/p\u003e\n\n\u003cp\u003eSo I don't have an issue grabbing the data in an MMS that falls into the first two categories. However I am having trouble grabbing the data from MMS of message type \u003ccode\u003eapplication/smil\u003c/code\u003e \u003c/p\u003e\n\n\u003cp\u003eBelow I have included 5 different examples of \u003ccode\u003eapplication/smil\u003c/code\u003e MMS messages that I have pulled from my phone. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[31, 22, -1, application/smil, 123_1.smil, 106, null, null, \u0026lt;0000\u0026gt;, 0.smil, null, null, null, \u0026lt;smil\u0026gt;\n \u0026lt;head\u0026gt;\n \u0026lt;layout\u0026gt;\n \u0026lt;root-layout height=\"160\" width=\"240\"/\u0026gt;\n \u0026lt;region fit=\"meet\" height=\"67%\" id=\"Image\" left=\"0%\" top=\"0%\" width=\"100%\"/\u0026gt;\n \u0026lt;region fit=\"meet\" height=\"33%\" id=\"Text\" left=\"0%\" top=\"67%\" width=\"100%\"/\u0026gt;\n \u0026lt;/layout\u0026gt;\n \u0026lt;/head\u0026gt;\n \u0026lt;body\u0026gt;\n \u0026lt;par dur=\"8000ms\"\u0026gt;\n \u0026lt;img region=\"Image\" src=\"cid:992\"/\u0026gt;\n \u0026lt;/par\u0026gt;\n \u0026lt;par dur=\"8000ms\"\u0026gt;\n \u0026lt;img region=\"Image\" src=\"cid:993\"/\u0026gt;\n \u0026lt;/par\u0026gt;\n \u0026lt;/body\u0026gt;\n\u0026lt;/smil\u0026gt;]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[22, 14, -1, application/smil, null, null, null, null, \u0026lt;smil\u0026gt;, smil.xml, null, null, null, \u0026lt;smil\u0026gt;\n \u0026lt;head\u0026gt;\n \u0026lt;layout\u0026gt;\n \u0026lt;root-layout width=\"320px\" height=\"480px\"/\u0026gt;\n \u0026lt;region id=\"Image\" left=\"0\" top=\"0\" width=\"320px\" height=\"320px\" fit=\"meet\"/\u0026gt;\n \u0026lt;region id=\"Text\" left=\"0\" top=\"320\" width=\"320px\" height=\"160px\" fit=\"meet\"/\u0026gt;\n \u0026lt;/layout\u0026gt;\n \u0026lt;/head\u0026gt;\n \u0026lt;body\u0026gt;\n \u0026lt;par dur=\"5000ms\"\u0026gt;\n \u0026lt;img src=\"8555\" region=\"Image\"/\u0026gt;\n \u0026lt;text src=\"text_0.txt\" region=\"Text\"/\u0026gt;\n \u0026lt;/par\u0026gt;\n \u0026lt;/body\u0026gt;\n\u0026lt;/smil\u0026gt;]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[13, 11, -1, application/smil, 123_1.smil, null, null, null, \u0026lt;0000\u0026gt;, null, null, null, null, \u0026lt;smil\u0026gt; \n \u0026lt;head\u0026gt; \n \u0026lt;layout\u0026gt; \n \u0026lt;root-layout/\u0026gt; \n \u0026lt;region fit=\"scroll\" height=\"30%\" id=\"Text\" left=\"0%\" top=\"70%\" width=\"100%\"/\u0026gt; \n \u0026lt;region fit=\"meet\" height=\"70%\" id=\"Image\" left=\"0%\" top=\"0%\" width=\"100%\"/\u0026gt; \n \u0026lt;/layout\u0026gt; \n \u0026lt;/head\u0026gt; \n \u0026lt;body\u0026gt; \n \u0026lt;par dur=\"10000ms\"\u0026gt; \n \u0026lt;text region=\"Text\" src=\"cid:928\"/\u0026gt; \n \u0026lt;/par\u0026gt; \n \u0026lt;/body\u0026gt; \n\u0026lt;/smil\u0026gt;]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[16, 13, -1, application/smil, mms.smil, null, null, null, \u0026lt;AAAA\u0026gt;, AAAA, null, null, null, \u0026lt;smil\u0026gt;\n \u0026lt;head\u0026gt;\n \u0026lt;layout\u0026gt;\n \u0026lt;root-layout width=\"240\" height=\"160\"/\u0026gt;\n \u0026lt;region id=\"Image\" width=\"100%\" height=\"67%\" left=\"0%\" top=\"0%\" fit=\"meet\"/\u0026gt;\n \u0026lt;region id=\"Text\" width=\"100%\" height=\"33%\" left=\"0%\" top=\"67%\" fit=\"meet\"/\u0026gt;\n \u0026lt;/layout\u0026gt;\n \u0026lt;/head\u0026gt;\n \u0026lt;body\u0026gt;\n \u0026lt;par dur=\"8000ms\"\u0026gt;\u0026lt;text src=\"text__01.txt\" region=\"Text\"/\u0026gt;\u0026lt;/par\u0026gt;\u0026lt;/body\u0026gt;\n\u0026lt;/smil\u0026gt;]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[5, 5, -1, application/smil, smil.smil, 106, null, null, \u0026lt;0000\u0026gt;, smil, null, null, null, \u0026lt;smil\u0026gt;\n \u0026lt;head\u0026gt;\n \u0026lt;layout\u0026gt;\n \u0026lt;root-layout height=\"160\" width=\"240\"/\u0026gt;\n \u0026lt;region fit=\"meet\" height=\"67%\" id=\"Image\" left=\"0%\" top=\"0%\" width=\"100%\"/\u0026gt;\n \u0026lt;region fit=\"meet\" height=\"33%\" id=\"Text\" left=\"0%\" top=\"67%\" width=\"100%\"/\u0026gt;\n \u0026lt;/layout\u0026gt;\n \u0026lt;/head\u0026gt;\n \u0026lt;body\u0026gt;\n \u0026lt;par dur=\"8000ms\"\u0026gt;\n \u0026lt;img region=\"Image\" src=\"cid:351\"/\u0026gt;\n \u0026lt;text region=\"Text\" src=\"cid:352\"/\u0026gt;\n \u0026lt;/par\u0026gt;\n \u0026lt;/body\u0026gt;\n\u0026lt;/smil\u0026gt;]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow exactly do you go about parsing this type of MMS? How do other texting apps deal with different kinds of MMS's? Any help would be greatly appreciated.\u003c/p\u003e","accepted_answer_id":"13023251","answer_count":"3","comment_count":"0","creation_date":"2012-07-19 08:15:45.697 UTC","favorite_count":"6","last_activity_date":"2012-11-06 19:47:46.783 UTC","last_edit_date":"2012-11-06 19:47:46.783 UTC","last_editor_display_name":"","last_editor_user_id":"502671","owner_display_name":"","owner_user_id":"502671","post_type_id":"1","score":"0","tags":"android|sms|mime-types|mms","view_count":"24823"} +{"id":"42883973","title":"iron-router: How to load a route completely just as when hitting refresh after loading a route?","body":"\u003cp\u003eI have a sign-in method in my Meteor application that redirects users to different routes after login in to the system. Here is my method:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eMeteor.loginWithPassword(emailVar, passwordVar, function (err) {\n if (err !== undefined) {\n // error handling code\n } else {\n if (!Roles.userIsInRole(Meteor.userId(), 'active')) {\n return Router.go('account-deactivated');\n }\n if (Roles.userIsInRole(Meteor.userId(), 'pharmacist')) {\n return Router.go('pharmacist-dashboard');\n }\n if (Roles.userIsInRole(Meteor.userId(), 'admin')) {\n return Router.go('admin-dashboard');\n }\n }\n });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhile this method works as expected, it produces some issues with my theme (AdminLTE) due to JavaScript loading problems (ex: app.min.js etc.). For example the sliding effects doesn't work on redirected page. But when I reload the page from the browser it starts to work as expected.\u003c/p\u003e\n\n\u003cp\u003eI know this is a separate issue that needs to be addressed. But if there is a way to completely reload a link in Meteor using iron-router it would be helpful. Specially when a page is transfered to a completely different user environment where a new set of JavaScript and CSS are used.\u003c/p\u003e\n\n\u003cp\u003eI went through the user documentations of \u003ca href=\"http://iron-meteor.github.io/iron-router/\" rel=\"nofollow noreferrer\"\u003eiron-router\u003c/a\u003e but the fixes do not provide a solution.\u003c/p\u003e","accepted_answer_id":"42885495","answer_count":"1","comment_count":"0","creation_date":"2017-03-19 07:18:29.037 UTC","last_activity_date":"2017-03-19 10:27:01.27 UTC","last_edit_date":"2017-03-19 07:28:46.387 UTC","last_editor_display_name":"","last_editor_user_id":"5326611","owner_display_name":"","owner_user_id":"5326611","post_type_id":"1","score":"0","tags":"javascript|iron-router|meter","view_count":"28"} +{"id":"39532694","title":"AngularJs unable to check cacheId already exists","body":"\u003cp\u003eI have a requirement where I need to store local settings of user into some cache object. I tried to implement this using \u003ccode\u003e$cacheFactory\u003c/code\u003e e.g.\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003evar userCache = $cacheFactory('users');\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eHowever, when my code hit this line again, it gives me following error:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e\u003cstrong\u003eError\u003c/strong\u003e : cacheId 'users' is already taken !\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI am not sure, how to check if this ID is already exists, because I need to fetch settings from this cache object on each time component loads.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-09-16 13:27:00.317 UTC","last_activity_date":"2016-09-16 13:44:10.253 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"659538","post_type_id":"1","score":"1","tags":"angularjs","view_count":"183"} +{"id":"28768128","title":"VBA Debug.Print semi colon","body":"\u003cp\u003eWhat is the actual value/meaning of a semi colon ( \u003cstrong\u003e;\u003c/strong\u003e ) with the \u003ccode\u003eDebug.Print\u003c/code\u003e statement in VBA?\u003c/p\u003e\n\n\u003cp\u003eI use this often but have no real understanding of it, all I know is that it isn't equal to the \u003ccode\u003evbTab\u003c/code\u003e constant as the spacing isn't the same.\u003c/p\u003e\n\n\u003cp\u003ei.e.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eDebug.Print 123;456;789\nDebug.Print 123 \u0026amp; vbTab \u0026amp; 456 \u0026amp; vbTab \u0026amp; 789\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eproduce different outputs.\u003c/p\u003e","accepted_answer_id":"28768147","answer_count":"2","comment_count":"3","creation_date":"2015-02-27 15:05:00.347 UTC","favorite_count":"0","last_activity_date":"2015-02-28 09:33:29.06 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4240221","post_type_id":"1","score":"4","tags":"vba","view_count":"343"} +{"id":"6267503","title":"HTTP Remember me authentication","body":"\u003cp\u003eI'm trying to write a simple HTTP remember me authentication system for users.\u003c/p\u003e\n\n\u003cp\u003eMy users could be represented as such\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n\"email\" : \"foo@bar.com\",\n\"password\" : \"8EC41F4334C1B9615F930270A4F8BBC2F5A2FCD3\" // sha1 hash of password\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo my idea is that I need to create a cookie, with indefinite (really long) expiration time, that will hold some type of information to enable me to fetch the user from the database, therefore logging the user in.\u003c/p\u003e\n\n\u003cp\u003eMy first idea was to just simply store the \u003ccode\u003eemail:password\u003c/code\u003e string as a cookie. I thought this would be good since nobody else can really generate that type of information other than the user itself, and I could retrieve the user quite easily by simply comparing the \u003ccode\u003eusername\u003c/code\u003e and \u003ccode\u003epassword\u003c/code\u003e based on what's in the database.\u003c/p\u003e\n\n\u003cp\u003eHowever then I thought this wasn't really good. It turns the password digest into, effectively, a second password that's stored in the clear and passed over the wire in every request.\u003c/p\u003e\n\n\u003cp\u003eSo then I thought maybe I could generate a \u003ccode\u003esignature\u003c/code\u003e each time the user logs in, which would basically be a random hash that is stored directly in the user object in the database.\u003c/p\u003e\n\n\u003cp\u003eThe user logs in, it generates this signature that is stored, and the cookie holds this signature. Whenever you access the website, the site checks which user has that particular signature and logs the user in. Logging out will effectively erase the cookie, and new logins will generate a new random signature.\u003c/p\u003e\n\n\u003cp\u003eDoes this approach take into account any other vulnerabilities?\u003c/p\u003e\n\n\u003cp\u003eI know, I should probably use a library already made for this, but this is just simply an exercise in web-security.\u003c/p\u003e","accepted_answer_id":"6267606","answer_count":"2","comment_count":"1","creation_date":"2011-06-07 15:19:48.333 UTC","last_activity_date":"2011-06-07 15:27:26.2 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"50394","post_type_id":"1","score":"2","tags":"security|http|remember-me","view_count":"477"} +{"id":"2912520","title":"Read file-contents into a string in C++","body":"\u003cblockquote\u003e\n \u003cp\u003e\u003cstrong\u003ePossible Duplicate:\u003c/strong\u003e\u003cbr\u003e\n \u003ca href=\"https://stackoverflow.com/questions/116038/what-is-the-best-way-to-slurp-a-file-into-a-stdstring-in-c\"\u003eWhat is the best way to slurp a file into a std::string in c++?\u003c/a\u003e \u003c/p\u003e\n\u003c/blockquote\u003e\n\n\n\n\u003cp\u003eIn scripting languages like Perl, it is possible to read a file into a variable in one shot.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e open(FILEHANDLE,$file);\n $content=\u0026lt;FILEHANDLE\u0026gt;;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat would be the most efficient way to do this in C++? \u003c/p\u003e","accepted_answer_id":"2912614","answer_count":"7","comment_count":"3","creation_date":"2010-05-26 11:36:39.347 UTC","favorite_count":"28","last_activity_date":"2015-07-18 22:19:11.333 UTC","last_edit_date":"2017-05-23 12:26:23.92 UTC","last_editor_display_name":"anon","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"293407","post_type_id":"1","score":"58","tags":"c++|string|file-io","view_count":"114607"} +{"id":"46376068","title":"what is difference between datalines and cards statement","body":"\u003cp\u003eI am seeking job on SAS tool. interviewer asked me this question I said no difference, both are used to read internal data but he told there is a difference between cards and datalines statement . \u003c/p\u003e\n\n\u003cp\u003ekindly help me to crack this question.\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2017-09-23 04:32:32.48 UTC","last_activity_date":"2017-09-23 06:43:00.85 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"8657465","post_type_id":"1","score":"2","tags":"sas","view_count":"70"} +{"id":"1963937","title":"include module in ruby","body":"\u003cp\u003eI am a starter with ruby, I searched that if someone else has asked similar question but was not able to find any. so I am asking it here.\u003c/p\u003e\n\n\u003cp\u003eI am trying my hand at modules in ruby.\u003c/p\u003e\n\n\u003cp\u003eI created a folder Project \u003c/p\u003e\n\n\u003cp\u003einside Project folder, created a class One\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass Project::One\n\n include Project::Rest\n\nend \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003einside Project folder, created a module Rest\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emodule Project::Rest\n\n def display\n puts \"in display\"\n end\n\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut when I try to run the program(ruby one.rb) I get the \u003c/p\u003e\n\n\u003cp\u003euninitialized constant Project (NameError)\u003c/p\u003e\n\n\u003cp\u003ePlease help me \u003c/p\u003e","answer_count":"3","comment_count":"1","creation_date":"2009-12-26 18:05:16.4 UTC","last_activity_date":"2009-12-26 18:31:59.747 UTC","last_edit_date":"2009-12-26 18:16:29.183 UTC","last_editor_display_name":"","last_editor_user_id":"46642","owner_display_name":"","owner_user_id":"238907","post_type_id":"1","score":"1","tags":"ruby","view_count":"1011"} +{"id":"13564360","title":"How to use global userdefined class object","body":"\u003cp\u003eIn Friend.h\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#ifndef FRIEND\n#define FRIEND \nclass Friend\n{\n\npublic:\n static int i ;\n int j;\n Friend(void);\n ~Friend(void);\n}frnd1;\n#endif\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn Friend.cpp\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \"Friend.h\"\nint Friend::i = 9;\nextern Friend frnd1;\nFriend::Friend(void)\n{\n}\n\nFriend::~Friend(void)\n{\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn main.cpp\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;iostream\u0026gt;\nusing namespace std;\n#include\"Friend.h\"\n\nint main()\n{\nfrnd1.j = 9;\ncout\u0026lt;\u0026lt;\"hello\";\ngetchar();\nreturn 0;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I run the above code, its gives the following linker error: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eerror LNK2005: \"class Friend frnd1\" (?frnd1@@3VFriend@@A) already defined in main.obj\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am unable to understand how to use the global object in main function.\u003c/p\u003e","accepted_answer_id":"13564422","answer_count":"3","comment_count":"0","creation_date":"2012-11-26 11:55:10.68 UTC","last_activity_date":"2012-11-26 12:11:14.4 UTC","last_edit_date":"2012-11-26 12:11:14.4 UTC","last_editor_display_name":"","last_editor_user_id":"988858","owner_display_name":"","owner_user_id":"1334073","post_type_id":"1","score":"2","tags":"c++","view_count":"165"} +{"id":"22147369","title":"Convert Long to DateTime in Windows Phone C#","body":"\u003cp\u003eI am getting requests from API for my app. In that the date/time is claimed to be in the format of Long. I am trying to convert it using the following lines.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eDateTime? dt = new DateTime(long.Parse(detail.CREATEDTIME));\nMessageBox.Show(detail.CREATEDTIME + \"=\u0026gt;\" + dt.Value.ToString(\"yyyy-MM-dd\"));\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe actual output is as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e1393559958788=\u0026gt;0001-01-02\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut the expected output is as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e1393559958788=\u0026gt;2014-02-28\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe expected output is from java. How do i do this with \u003ccode\u003eC#\u003c/code\u003e?\u003c/p\u003e","accepted_answer_id":"22147421","answer_count":"2","comment_count":"0","creation_date":"2014-03-03 12:54:31.353 UTC","last_activity_date":"2014-03-03 13:03:17.76 UTC","last_edit_date":"2014-03-03 12:59:11.373 UTC","last_editor_display_name":"","last_editor_user_id":"2027232","owner_display_name":"","owner_user_id":"1675970","post_type_id":"1","score":"1","tags":"c#|datetime|windows-phone-8","view_count":"149"} +{"id":"22804760","title":"Android bubble sort not working","body":"\u003cp\u003eI am new to android programming and I tried to do bubble sort by inputting numbers in one EditText and the sorted numbers will be outputted on the second EditText. The program has stopped unexpectedly once I click the Sort button. Please tell me what's wrong.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epackage com.example.sorting;\n\nimport android.os.Bundle;\nimport android.app.Activity;\nimport android.text.Spannable;\nimport android.view.View; \nimport android.widget.Button;\nimport android.widget.EditText;\n\n\npublic class MainActivity extends Activity{\n\nEditText enterNum;\nEditText sortedNum;\nButton sortNow;\n\nint num[] = new int[5];\nint i, n, j;\nint temp;\n\n@Override\nprotected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n\n enterNum = (EditText)findViewById(R.id.enterNum);\n sortedNum = (EditText)findViewById(R.id.sortedNum);\n sortNow = (Button)findViewById(R.id.sortNow);\n sortNow.setOnClickListener(new Button.OnClickListener(){\n public void onClick(View v){ \n BubbleSort();}});\n\n}\n\n\npublic void BubbleSort(){\n\n Spannable spn=enterNum.getText();\n num[5]=Integer.valueOf(spn.toString());\n\n for (i=0;i\u0026lt;5;i++){\n for(j=i+1;j\u0026lt;5;j++){\n if(num[i]\u0026gt;num[j]){\n temp = num[i];\n num[i] = num[j];\n num[j] = temp;\n }\n }\n }\n\n\n sortedNum.setText(String.valueOf(num[0])+String.valueOf(num[1])+String.valueOf(num[2])+String.valueOf(num[3])+String.valueOf(num[4]));\n\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e}\u003c/p\u003e","accepted_answer_id":"22804841","answer_count":"1","comment_count":"5","creation_date":"2014-04-02 07:47:39.447 UTC","last_activity_date":"2014-04-02 11:58:15.33 UTC","last_edit_date":"2014-04-02 11:58:15.33 UTC","last_editor_display_name":"","last_editor_user_id":"2982225","owner_display_name":"","owner_user_id":"3488282","post_type_id":"1","score":"0","tags":"java|android|bubble-sort","view_count":"815"} +{"id":"20446599","title":"what is the use of ... in c++","body":"\u003cp\u003eI tried googling \u003ccode\u003e...\u003c/code\u003e but as expected, google ignored it.\u003c/p\u003e\n\n\u003cp\u003eI have this code : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etry {\n\n// some code\n}\n\ncatch( ... ) {\n// catch logic\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm guessing that \u003ccode\u003e...\u003c/code\u003e means any kind of exceptions, am I right ? \u003cbr\u003e\nany other usages for this ? \u003cbr\u003e\u003c/p\u003e","accepted_answer_id":"20446765","answer_count":"2","comment_count":"5","creation_date":"2013-12-07 21:02:01.217 UTC","favorite_count":"1","last_activity_date":"2013-12-07 23:20:26.323 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1182207","post_type_id":"1","score":"5","tags":"c++|operators","view_count":"215"} +{"id":"42916084","title":"How can I check if a thread is NULL","body":"\u003cp\u003eI'm running a simple operation with a few instances of a class and I want to run this operation in a separate thread for each class.\nIf that same instance of that class wants to run that operation again, it has to wait for the previous operation within that instance to finish. \nHowever, another instance of the class should be able to start it's operation while the first instance is performing the same operation.\u003c/p\u003e\n\n\u003cp\u003eWhat I want to do is something like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;thread\u0026gt;\nclass MyClass\n{\n void Operation(){Sleep(10000);}\n void LaunchOperation()\n {\n if(opThread != NULL) //Pseudo Code line\n opThread.join();\n opThread = std::thread(\u0026amp;MyClass::Operation, this);\n }\n\n std::thread opThread;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut the \u003ccode\u003eif(opThread != NULL)\u003c/code\u003e line is obviously not correct.\u003c/p\u003e\n\n\u003cp\u003eIs there a correct substitution for this, or am I taking the wrong approach?\u003c/p\u003e\n\n\u003cp\u003eThanks\n-D\u003c/p\u003e","accepted_answer_id":"42916152","answer_count":"1","comment_count":"8","creation_date":"2017-03-20 23:54:07.66 UTC","last_activity_date":"2017-03-21 00:03:00.063 UTC","last_edit_date":"2017-03-20 23:57:13.287 UTC","last_editor_display_name":"","last_editor_user_id":"2056201","owner_display_name":"","owner_user_id":"2056201","post_type_id":"1","score":"0","tags":"c++|multithreading|c++11|winapi|visual-studio-2015","view_count":"354"} +{"id":"1562796","title":"How to burn an Audio CD programmatically in Mac OS X","body":"\u003cp\u003eAll the info I can find about burning cd's is for Windows, or about full programs to burn cd's.\nI would however like to be able to burn an Audio CD directly from within my program.\u003c/p\u003e\n\n\u003cp\u003eI don't mind using Cocoa or Carbon, or if there are no API's available to do this directly, using a command-line program that can use a wav/aiff file as input would be a possibility too if it can be distributed with my application.\u003c/p\u003e\n\n\u003cp\u003eBecause it will be used to burn dj mixes to cd, it would also be great if it is possible to create different tracks without a gap between them.\u003c/p\u003e","accepted_answer_id":"1562822","answer_count":"2","comment_count":"2","creation_date":"2009-10-13 20:41:40.767 UTC","last_activity_date":"2014-12-13 23:46:05.073 UTC","last_edit_date":"2013-07-31 09:11:46.363 UTC","last_editor_display_name":"","last_editor_user_id":"821057","owner_display_name":"","owner_user_id":"111561","post_type_id":"1","score":"0","tags":"osx|cd-burning","view_count":"1712"} +{"id":"10526527","title":"Why am I getting, \"Invalid assignment on left-hand side\"?","body":"\u003cp\u003eI am trying to set a cookie to track visits.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eif (getCookie(pageCount) == \"\") {\n var pageCount = 1;\n} else {\n parseInt (pageCount)++;\n}\nsetCookie(pageCount, pageCount, expire);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe above code gives me the error \"Invalid assignment on left-hand side\" around \u003ccode\u003eparseInt\u003c/code\u003e though. Any suggestions on how I can fix this?\u003c/p\u003e","answer_count":"4","comment_count":"4","creation_date":"2012-05-10 01:52:13.293 UTC","last_activity_date":"2012-05-10 02:34:37.677 UTC","last_edit_date":"2012-05-10 02:21:40.097 UTC","last_editor_display_name":"user672118","owner_display_name":"","owner_user_id":"1258125","post_type_id":"1","score":"0","tags":"javascript|cookies","view_count":"359"} +{"id":"8641753","title":"Read config with Apache Commons Configuration","body":"\u003cp\u003eI have xml file with config for converter.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;converter\u0026gt;\n \u0026lt;replace\u0026gt;\n \u0026lt;mask from=\"171, 187, 147, 148\" to=\"34\"/\u0026gt;\n \u0026lt;mask from=\"150, 151\" to=\"45\"/\u0026gt;\n \u0026lt;/replace\u0026gt;\n\u0026lt;/converter\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eTo read this config i'm using Apache Commons Configuration.\nHow i can read tags \"mask\" to iterate it and process attributes in code?\u003c/p\u003e","accepted_answer_id":"8652303","answer_count":"1","comment_count":"0","creation_date":"2011-12-27 06:19:29.323 UTC","favorite_count":"1","last_activity_date":"2011-12-28 05:43:34.7 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"667282","post_type_id":"1","score":"1","tags":"java|apache|configuration","view_count":"570"} +{"id":"13986758","title":"C# EF Code first - create database and add data","body":"\u003cp\u003eI want to create database and add some data. I added EF and I want to use code first. I have these classes:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class Question\n{\n public bool Sort { get; set; }\n public int QuestionID { get; set; }\n public int Level { get; set; }\n public string Description { get; set; }\n public string Answer1 { get; set; }\n public string Answer2 { get; set; }\n public string Answer3 { get; set; }\n public string Answer4 { get; set; }\n public string RightAnswer { get; set; }\n public bool Show { get; set; }\n}\n\npublic class QuestionDb : DbContext\n{\n public DbSet\u0026lt;Question\u0026gt; Questions { get; set; }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is my connection string:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;add name=\"ConvertCSVtoSQL.QuestionDb\" connectionString=\"Data Source=|DataDirectory|ConvertCSVtoSQL.QuestionDb.sdf\"\n providerName=\"System.Data.SqlServerCe.4.0\" /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow I am creating database like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eusing (var db = new QuestionDb())\n {\n\n foreach (var question in questions)\n {\n db.Questions.Add(question);\n }\n db.SaveChanges();\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt creates database but if I have some data in questions which I want to add I get error: \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eThe Entity Framework provider type\n 'System.Data.Entity.SqlServerCompact.SqlCeProviderServices,\n EntityFramework.SqlServerCompact, Version=6.0.0.0, Culture=neutral,\n PublicKeyToken=b77a5c561934e089' for the 'System.Data.SqlServerCe.4.0'\n ADO.NET provider could not be loaded. Make sure the provider assembly\n is available to the running application. See\n \u003ca href=\"http://go.microsoft.com/fwlink/?LinkId=260882\" rel=\"nofollow\"\u003ehttp://go.microsoft.com/fwlink/?LinkId=260882\u003c/a\u003e for more information.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI tried to add some initializers but it didn't help:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eDatabase.DefaultConnectionFactory = new SqlCeConnectionFactory(\"System.Data.SqlServerCe.4.0\",@\"C:\\Path\\To\\\",@\"Data Source=C:\\Path\\To\\DbFile.sdf\");\nDatabase.SetInitializer(new CreateDatabaseIfNotExists\u0026lt;QuestionDb\u0026gt;());\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo where is problem?\u003c/p\u003e","accepted_answer_id":"14005040","answer_count":"3","comment_count":"3","creation_date":"2012-12-21 08:38:28.793 UTC","favorite_count":"0","last_activity_date":"2013-02-19 22:04:19.233 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"367593","post_type_id":"1","score":"3","tags":"c#|wpf|entity-framework","view_count":"3800"} +{"id":"26388071","title":"Using the keywords: CONTAINS, BEGINSWITH, ENDSWITH on multi-level keypaths in Realm.io","body":"\u003cp\u003eI am using, the 0.86.3 version of the realm.io framework.\u003c/p\u003e\n\n\u003cp\u003eHere is what my object looks like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eRLMArray \u0026lt;0x7fd1f3642a50\u0026gt; (\n[0] Product {\n identifier = 4;\n overview = test;\n desc = test;\n reference = AB-123;\n category = Category {\n identifier = 2;\n name = Telescopic Arm;\n level = 1-1;\n parent = Category {\n identifier = 1;\n name = Arm;\n level = 1;\n parent = (null);\n };\n };\n}\n)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eEverything looks fine so far, but when I'm trying to request:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eRLMArray *products = [GEProduct objectsWhere:@\"category.name contains 'telescopic'\"];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am getting an:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003euncaught exception 'Invalid type', reason: 'Predicate 'CONTAINS' is not supported'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat am I missing ?\u003c/p\u003e\n\n\u003cp\u003eThanks in advance for your time.\u003c/p\u003e","accepted_answer_id":"26388619","answer_count":"1","comment_count":"0","creation_date":"2014-10-15 17:03:04.39 UTC","last_activity_date":"2014-11-27 20:11:21.073 UTC","last_edit_date":"2014-10-16 13:36:40.447 UTC","last_editor_display_name":"","last_editor_user_id":"3459040","owner_display_name":"","owner_user_id":"3459040","post_type_id":"1","score":"0","tags":"ios|objective-c|realm","view_count":"431"} +{"id":"2572728","title":"Grails efficient hasMany-Relationship in View","body":"\u003cp\u003eI'm saving contacts (email, mobile phone, ICQ, AIM etc.) for people like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass Person {\n static hasMany = {\n contacts: Contact\n }\n}\nclass Contact {\n String code\n ContactType type\n}\nclass ContactType {\n String name\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn my view, I've written some Templates for displaying each contact with a select-box for the contact-type and a textfield for the code, spiced up with some JavaScript for adding and deleting.\u003c/p\u003e\n\n\u003cp\u003eMy question is: Is there an easy and elegant way to update the data similar to \u003ccode\u003epersonInstance.properties = params\u003c/code\u003e or do I have to read out all the fields, deleting removed, updating changed and adding new ones?\u003c/p\u003e","accepted_answer_id":"2572796","answer_count":"1","comment_count":"0","creation_date":"2010-04-03 21:26:53.057 UTC","favorite_count":"1","last_activity_date":"2010-04-03 22:00:25.787 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"256269","post_type_id":"1","score":"0","tags":"grails|view|relationship","view_count":"883"} +{"id":"3905896","title":"distanceFromLocation - Calculate distance between two points","body":"\u003cp\u003eJust a quick question on Core Location, I'm trying to calculate the distance between two points, code is below:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e -(void)locationChange:(CLLocation *)newLocation:(CLLocation *)oldLocation\n { \n\n // Configure the new event with information from the location.\n CLLocationCoordinate2D newCoordinate = [newLocation coordinate];\n CLLocationCoordinate2D oldCoordinate = [oldLocation coordinate];\n\n CLLocationDistance kilometers = [newCoordinate distanceFromLocation:oldCoordinate] / 1000; // Error ocurring here.\n CLLocationDistance meters = [newCoordinate distanceFromLocation:oldCoordinate]; // Error ocurring here.\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm getting the following error on the last two lines:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eerror: cannot convert to a pointer type\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI've been searching Google, but I cannot find anything.\u003c/p\u003e","accepted_answer_id":"3905923","answer_count":"7","comment_count":"0","creation_date":"2010-10-11 11:50:10.983 UTC","favorite_count":"20","last_activity_date":"2016-09-29 05:09:13.737 UTC","last_edit_date":"2016-05-24 23:22:05.89 UTC","last_editor_display_name":"","last_editor_user_id":"4577897","owner_display_name":"","owner_user_id":"387552","post_type_id":"1","score":"46","tags":"ios|objective-c|core-location","view_count":"76468"} +{"id":"42618901","title":"How to make auto scroll to top of the div?","body":"\u003cp\u003ethis is my screen shot :\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/H9fsF.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/H9fsF.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eMy question is how to make it auto scrolling back to top in javascript or any other way ?\u003c/p\u003e","accepted_answer_id":"42619020","answer_count":"4","comment_count":"5","creation_date":"2017-03-06 06:29:18.273 UTC","favorite_count":"1","last_activity_date":"2017-03-06 06:36:51.98 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7026952","post_type_id":"1","score":"0","tags":"javascript|jquery|html","view_count":"1348"} +{"id":"948225","title":"LinqToSql and Stored Procedure question","body":"\u003cp\u003eI have a stored procedure that returns a number of fields, pew row. Is there anyway i can define the class which the stored procedure 'goes into', instead of it using the auto-generated class?\u003c/p\u003e\n\n\u003cp\u003eThe class i want the results to populate is a POCO, not another LinqToSql table.\u003c/p\u003e\n\n\u003cp\u003eIs this possible? i'm assuming that the poco class public properties are the same names as the fields in the returned recordset.\u003c/p\u003e","accepted_answer_id":"21058332","answer_count":"1","comment_count":"0","creation_date":"2009-06-04 01:46:40.753 UTC","last_activity_date":"2014-01-11 03:51:40.587 UTC","last_edit_date":"2009-06-04 06:41:41.723 UTC","last_editor_display_name":"","last_editor_user_id":"30674","owner_display_name":"","owner_user_id":"30674","post_type_id":"1","score":"1","tags":"linq-to-sql|stored-procedures|poco","view_count":"141"} +{"id":"16345607","title":"Ruby on Rails call to perl script timing out","body":"\u003cp\u003eI'm am writing a Ruby on Rails application that is calling a perl script using Open3. However, when calling the perl script my app keeps raising a Timeout::Error sooner than I want. The code where I call the script looks like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Timeout::timeout(120){\n @stdout, @stderr, @exit_code = Open3.capture3(@command)\n [@exit_code.to_i, @stdout, @stderr]\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI realize calling a potentially \"long\" running script (maybe 20-30 seconds tops) isn't ideal for a ruby on rails application, but I don't have much of an option.\u003c/p\u003e\n\n\u003cp\u003eI am using unicorn to get concurrency and I have the unicorn timeout set to 60s. Despite the 60second timeout in my unicorn file and the 120second timeout wrapped around the Open3 call, my request keeps timing out at around 18 seconds. I know the script is finishing successfully because I see the results on the other side but I need my app to wait for the return of the script.\u003c/p\u003e\n\n\u003cp\u003eIs there any other way I can force my rails app to wait and not timeout?\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e\n\n\u003cp\u003eBacktrace from caught error:\u003c/p\u003e\n\n\u003cpre\u003e\nexecution expired\n/opt/sen/ruby/lib/ruby/1.9.1/open3.rb:280:in `value'\n/opt/sen/ruby/lib/ruby/1.9.1/open3.rb:280:in `block in capture3'\n/opt/sen/ruby/lib/ruby/1.9.1/open3.rb:208:in `popen_run'\n/opt/sen/ruby/lib/ruby/1.9.1/open3.rb:90:in `popen3'\n/opt/sen/ruby/lib/ruby/1.9.1/open3.rb:270:in `capture3'\n/opt/sen/bpt/releases/aa47354a897077a6600349fd6c473704bb17f929/app/models/perl_exec.rb:23:in `block in execute'\n/opt/sen/ruby/lib/ruby/1.9.1/timeout.rb:68:in `timeout'\n/opt/sen/bpt/releases/aa47354a897077a6600349fd6c473704bb17f929/app/models/perl_exec.rb:22:in `execute'\n/opt/sen/bpt/releases/aa47354a897077a6600349fd6c473704bb17f929/app/models/reservoir.rb:47:in `execute!'\n/opt/sen/bpt/releases/aa47354a897077a6600349fd6c473704bb17f929/app/models/reservation.rb:93:in `commit!'\n/opt/sen/bpt/releases/aa47354a897077a6600349fd6c473704bb17f929/app/controllers/reservations_controller.rb:106:in `block in commit'\n/opt/sen/ruby/lib/ruby/1.9.1/timeout.rb:68:in `timeout'\n/opt/sen/bpt/releases/aa47354a897077a6600349fd6c473704bb17f929/app/controllers/reservations_controller.rb:105:in `commit'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.2.9/lib/action_controller/metal/implicit_render.rb:4:in `send_action'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.2.9/lib/abstract_controller/base.rb:167:in `process_action'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.2.9/lib/action_controller/metal/rendering.rb:10:in `process_action'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.2.9/lib/abstract_controller/callbacks.rb:18:in `block in process_action'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/activesupport-3.2.9/lib/active_support/callbacks.rb:469:in `_run__3753465240598785610__process_action__3320622668841691210__callbacks'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/activesupport-3.2.9/lib/active_support/callbacks.rb:405:in `__run_callback'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/activesupport-3.2.9/lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/activesupport-3.2.9/lib/active_support/callbacks.rb:81:in `run_callbacks'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.2.9/lib/abstract_controller/callbacks.rb:17:in `process_action'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.2.9/lib/action_controller/metal/rescue.rb:29:in `process_action'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.2.9/lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/activesupport-3.2.9/lib/active_support/notifications.rb:123:in `block in instrument'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/activesupport-3.2.9/lib/active_support/notifications/instrumenter.rb:20:in `instrument'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/activesupport-3.2.9/lib/active_support/notifications.rb:123:in `instrument'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.2.9/lib/action_controller/metal/instrumentation.rb:29:in `process_action'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.2.9/lib/action_controller/metal/params_wrapper.rb:207:in `process_action'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/activerecord-3.2.9/lib/active_record/railties/controller_runtime.rb:18:in `process_action'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.2.9/lib/abstract_controller/base.rb:121:in `process'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.2.9/lib/abstract_controller/rendering.rb:45:in `process'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.2.9/lib/action_controller/metal.rb:203:in `dispatch'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.2.9/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.2.9/lib/action_controller/metal.rb:246:in `block in action'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.2.9/lib/action_dispatch/routing/route_set.rb:73:in `call'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.2.9/lib/action_dispatch/routing/route_set.rb:73:in `dispatch'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.2.9/lib/action_dispatch/routing/route_set.rb:36:in `call'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/journey-1.0.4/lib/journey/router.rb:68:in `block in call'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/journey-1.0.4/lib/journey/router.rb:56:in `each'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/journey-1.0.4/lib/journey/router.rb:56:in `call'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.2.9/lib/action_dispatch/routing/route_set.rb:601:in `call'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/rack-timeout-0.0.3/lib/rack/timeout.rb:16:in `block in call'\n/opt/sen/ruby/lib/ruby/1.9.1/timeout.rb:68:in `timeout'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/rack-timeout-0.0.3/lib/rack/timeout.rb:16:in `call'\n/opt/sen/bpt/releases/aa47354a897077a6600349fd6c473704bb17f929/app/middleware/nestful.rb:18:in `call'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.2.9/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/etag.rb:23:in `call'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/conditionalget.rb:35:in `call'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.2.9/lib/action_dispatch/middleware/head.rb:14:in `call'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.2.9/lib/action_dispatch/middleware/params_parser.rb:21:in `call'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.2.9/lib/action_dispatch/middleware/flash.rb:242:in `call'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:205:in `context'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:200:in `call'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.2.9/lib/action_dispatch/middleware/cookies.rb:341:in `call'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/activerecord-3.2.9/lib/active_record/query_cache.rb:64:in `call'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/activerecord-3.2.9/lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.2.9/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/activesupport-3.2.9/lib/active_support/callbacks.rb:405:in `_run__4121137639594084607__call__1985817909290506524__callbacks'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/activesupport-3.2.9/lib/active_support/callbacks.rb:405:in `__run_callback'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/activesupport-3.2.9/lib/active_support/callbacks.rb:385:in `_run_call_callbacks'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/activesupport-3.2.9/lib/active_support/callbacks.rb:81:in `run_callbacks'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.2.9/lib/action_dispatch/middleware/callbacks.rb:27:in `call'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.2.9/lib/action_dispatch/middleware/remote_ip.rb:31:in `call'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.2.9/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.2.9/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/railties-3.2.9/lib/rails/rack/logger.rb:32:in `call_app'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/railties-3.2.9/lib/rails/rack/logger.rb:16:in `block in call'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/activesupport-3.2.9/lib/active_support/tagged_logging.rb:22:in `tagged'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/railties-3.2.9/lib/rails/rack/logger.rb:16:in `call'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.2.9/lib/action_dispatch/middleware/request_id.rb:22:in `call'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/methodoverride.rb:21:in `call'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/runtime.rb:17:in `call'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/activesupport-3.2.9/lib/active_support/cache/strategy/local_cache.rb:72:in `call'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/lock.rb:15:in `call'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/actionpack-3.2.9/lib/action_dispatch/middleware/static.rb:62:in `call'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in `forward'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:143:in `pass'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:155:in `invalidate'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:71:in `call!'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in `call'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/railties-3.2.9/lib/rails/engine.rb:479:in `call'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/railties-3.2.9/lib/rails/application.rb:223:in `call'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/railties-3.2.9/lib/rails/railtie/configurable.rb:30:in `method_missing'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/unicorn-4.6.2/lib/unicorn/http_server.rb:552:in `process_client'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/unicorn-4.6.2/lib/unicorn/http_server.rb:632:in `worker_loop'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/unicorn-4.6.2/lib/unicorn/http_server.rb:500:in `spawn_missing_workers'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/unicorn-4.6.2/lib/unicorn/http_server.rb:142:in `start'\n/opt/sen/ruby/lib/ruby/gems/1.9.1/gems/unicorn-4.6.2/bin/unicorn_rails:209:in `'\n/opt/sen/ruby/bin/unicorn_rails:23:in `load'\n/opt/sen/ruby/bin/unicorn_rails:23:in `'\n\u003c/pre\u003e","accepted_answer_id":"16450179","answer_count":"1","comment_count":"4","creation_date":"2013-05-02 18:52:50.237 UTC","last_activity_date":"2013-05-08 21:05:37.217 UTC","last_edit_date":"2013-05-08 21:04:11.693 UTC","last_editor_display_name":"","last_editor_user_id":"20816","owner_display_name":"","owner_user_id":"681298","post_type_id":"1","score":"0","tags":"ruby-on-rails|ruby|ruby-on-rails-3|timeout|popen3","view_count":"190"} +{"id":"3058723","title":"Programmatically getting an access token for using the Facebook Graph API","body":"\u003cp\u003eI am trying to put together a bash or python script to play with the facebook graph API. Using the API looks simple, but I'm having trouble setting up curl in my bash script to call authorize and access_token. Does anyone have a working example?\u003c/p\u003e","accepted_answer_id":"5426804","answer_count":"7","comment_count":"0","creation_date":"2010-06-17 03:41:24.773 UTC","favorite_count":"24","last_activity_date":"2016-09-14 19:40:42.657 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"53120","post_type_id":"1","score":"35","tags":"python|bash|facebook","view_count":"51335"} +{"id":"20555033","title":"How to add -Ifreetype2 to compiler arguments with CMake?","body":"\u003cp\u003eI want to add the compiler flag \u003ccode\u003e-Ifreetype2\u003c/code\u003e. So i did:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003einclude_directories( freetype2 )\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut after running cmake and checking with \u003ccode\u003emingw32-make VERBOSE=1\u003c/code\u003e nothing is added. What did I wrong?\u003c/p\u003e","accepted_answer_id":"33002481","answer_count":"1","comment_count":"5","creation_date":"2013-12-12 21:52:03.62 UTC","last_activity_date":"2015-10-07 21:11:02.737 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"647898","post_type_id":"1","score":"0","tags":"include|cmake|mingw","view_count":"36"} +{"id":"11636903","title":"What is the difference between Socket.Send and Stream.Write? (in relation to tcp ip connections)","body":"\u003cp\u003eIn dealing with server/client connections, I have seen both of these used effectively without any apparent advantages to either, yet I doubt they would both exist if there weren't any known advantages to one or the other. Does anyone know any clear differences between the two? Help would be much appreciated, thanks.\u003c/p\u003e","accepted_answer_id":"11637098","answer_count":"1","comment_count":"0","creation_date":"2012-07-24 18:17:30.13 UTC","last_activity_date":"2014-10-08 13:03:38.823 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1459449","post_type_id":"1","score":"2","tags":"c#|sockets|stream|send","view_count":"1256"} +{"id":"7402818","title":"Spinner with on Click Listener","body":"\u003cp\u003eI am using spinner that shows error when i am trying to extract the item id of the selected spinner item.\nMy Code goes here:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic void dispspi()\n {\n spinner = (Spinner) findViewById(R.id.spinner1);\n ArrayAdapter \u0026lt;String\u0026gt; adap= new ArrayAdapter(this, android.R.layout.simple_spinner_item, level);\n\n spinner.setAdapter(adap);\n spinner.setOnItemClickListener(new OnItemClickListener() {\n\n public void onItemSelected(AdapterView\u0026lt;?\u0026gt; arg0, View arg1,int arg2, long arg3) \n {\n int item = spinner.getSelectedItemPosition();\n\n p=item;\n }\n\n\n @Override\n public void onItemClick(AdapterView\u0026lt;?\u0026gt; arg0, View arg1, int arg2,\n long arg3) {\n // TODO Auto-generated method stub\n\n }\n\n\n\n });\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow to get the item id of the spinner? Any help is appreciated..Thanks in advance\u003c/p\u003e","accepted_answer_id":"7402940","answer_count":"4","comment_count":"0","creation_date":"2011-09-13 13:37:35.39 UTC","favorite_count":"1","last_activity_date":"2013-06-05 06:14:21.087 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"905230","post_type_id":"1","score":"7","tags":"java|android","view_count":"15311"} +{"id":"33992494","title":"How to create style in style.xml for Roboto assets","body":"\u003cp\u003eI have included the Roboto fonts in my project as assets. So now to define a TextView I can do\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;me.android.fonts.widget.RobotoTextView\n android:id=\"@+id/day\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n app:typeface=\"roboto_bold\"\n android:textColor=\"@color/green_text\"\n android:textSize=\"@dimen/day_size\"\n tools:text=\"Tues\"/\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow image I have a number of TextView that need to be style. Typically, I can simply define a style and reuse it. But I am not able to do that in the present situation because of \u003ccode\u003eapp:typeface\u003c/code\u003e. How do Include that in my 'style.xml' file? I already tried\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;resources xmlns:app=\"http://schemas.android.com/apk/res-auto\"\u0026gt;\n...\n\u0026lt;style...\u0026gt;\n...\n\u0026lt;/style\u0026gt;\n\u0026lt;/resources\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut that does not work\u003c/p\u003e","accepted_answer_id":"33992586","answer_count":"1","comment_count":"0","creation_date":"2015-11-30 06:17:18.037 UTC","last_activity_date":"2015-11-30 06:36:38.73 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1612593","post_type_id":"1","score":"0","tags":"android|android-layout|styles","view_count":"73"} +{"id":"20720011","title":"How to save data into database using jquery and json in asp.net","body":"\u003cp\u003eI am working on an application to store data into database using jquery \u0026amp; json.\u003c/p\u003e\n\n\u003cp\u003eMy Script function:\u003c/p\u003e\n\n\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;script type=\"text/javascript\"\u0026gt;\n function test() {\n $(document).ready(function () {\n var Email = document.getElementById('\u0026lt;%= txtEmail.ClientID %\u0026gt;').value;\n var Message = document.getElementById('\u0026lt;%= txtMessage.ClientID %\u0026gt;').value;\n var Name = document.getElementById('\u0026lt;%= txtMessage.ClientID %\u0026gt;').value;\n var ID=32;\n $.ajax({\n type: \"POST\",\n url: \"Detail.aspx/InsertMethod\",\n data: \"{'Name':'\" + Name + \"'Email:'\" + Email + \"'Message:'\" + Message + \"'ID:'\"+ID+\"'}\",\n dataType: \"json\",\n contentType: \"application/json; charset=utf-8\",\n success: function (data) {\n var returnedstring = data.d;\n\n }\n });\n\n });\n }\n\u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy design is:-\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;table\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;\n \u0026lt;label\u0026gt;Name\u0026lt;/label\u0026gt;\n \u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;input type=\"text\" id=\"txtName\" runat=\"server\" class=\"form-control\"\u0026gt;\n \u0026lt;asp:RequiredFieldValidator ID=\"RequiredFieldValidator5\" runat=\"server\" ControlToValidate=\"txtName\"\n Display=\"Dynamic\" SetFocusOnError=\"true\" ErrorMessage=\"Enter Name.\" ValidationGroup=\"Comment\"\u0026gt;\n \u0026lt;/asp:RequiredFieldValidator\u0026gt;\n \u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;\n \u0026lt;label\u0026gt;Email\u0026lt;/label\u0026gt;\n \u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;asp:TextBox ID=\"txtEmail\" runat=\"server\" CssClass=\"form-control\"\u0026gt;\u0026lt;/asp:TextBox\u0026gt;\n \u0026lt;asp:RequiredFieldValidator ID=\"RequiredFieldValidator3\" runat=\"server\" ControlToValidate=\"txtEmail\"\n Display=\"Dynamic\" SetFocusOnError=\"true\" ErrorMessage=\"Enter Email.\" ValidationGroup=\"Comment\"\u0026gt;\n \u0026lt;/asp:RequiredFieldValidator\u0026gt;\n \u0026lt;asp:RegularExpressionValidator ID=\"RegularExpressionValidator1\" runat=\"server\" ControlToValidate=\"txtEmail\"\n SetFocusOnError=\"true\" ValidationExpression=\"^[a-z0-9_\\+-]+(\\.[a-z0-9_\\+-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*\\.([a-z]{2,4})$\"\n ErrorMessage=\"Invalid Email-Id\"\u0026gt;\u0026lt;/asp:RegularExpressionValidator\u0026gt;\n \u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;\n \u0026lt;label\u0026gt;Message\u0026lt;/label\u0026gt;\n \u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\n \u0026lt;textarea class=\"form-control\" rows=\"8\" id=\"Textarea1\" runat=\"server\"\u0026gt;\u0026lt;/textarea\u0026gt;\n \u0026lt;asp:RequiredFieldValidator ID=\"RequiredFieldValidator4\" runat=\"server\" ControlToValidate=\"txtMessage\"\n Display=\"Dynamic\" SetFocusOnError=\"true\" ErrorMessage=\"Enter Message.\" ValidationGroup=\"Comment\"\u0026gt;\n \u0026lt;/asp:RequiredFieldValidator\u0026gt;\n \u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\n \u0026lt;button class=\"btn-ps\" type=\"submit\" id=\"btnSave\" validationgroup=\"Comment\" onclick=\"test()\"\u0026gt;Send Message\u0026lt;/button\u0026gt;\n \u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;/table\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy Web Method is:-\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e [System.Web.Script.Services.ScriptMethod()]\n [System.Web.Services.WebMethod(enableSession: true)]\n public static string InsertMethod(string Name, string Email,string Message,sting ID)\n {\n int retval = 0;\n try\n {\n Entity_NewsComments objComment = new Entity_NewsComments();\n\n objComment.ID= ID; \n objComment.Comment = Message;\n objComment.Email = Email;\n objComment.Name = Name;\n\n if ((!string.IsNullOrEmpty(objComment.Email)) \u0026amp;\u0026amp; (!string.IsNullOrEmpty(objComment.Name)) \u0026amp;\u0026amp; (!string.IsNullOrEmpty(objComment.Comment)))\n {\n objComment.QFlag = \"I\";\n objComment.Date = Convert.ToDateTime(DateTime.Now.ToString());\n objComment.Status = 0;\n //retval = new Process_NewsComments().insert(objComment);\n if (retval \u0026gt; 0)\n { \n\n }\n\n }\n\n return \"true\";\n }\n catch (Exception ex)\n {\n throw (ex);\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut it is not working.I have put a debugger on web-method, But it is not going there.It is not showing any error also.Please help me\u003c/p\u003e","accepted_answer_id":"20720296","answer_count":"2","comment_count":"2","creation_date":"2013-12-21 14:29:34.72 UTC","last_activity_date":"2016-05-05 11:49:11.837 UTC","last_edit_date":"2013-12-21 14:36:31.993 UTC","last_editor_display_name":"","last_editor_user_id":"2735742","owner_display_name":"","owner_user_id":"2735742","post_type_id":"1","score":"0","tags":"jquery|asp.net|ajax|json","view_count":"9525"} +{"id":"4368228","title":"Check whether advice is applied","body":"\u003cp\u003eConsider I wrote AOP pointcut and made a misprint in it:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@Pointcut(\"within(com.example.servic..*)\")\npublic void serviceMethod() {}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThere is \"servic\" instead of \"service\".\u003c/p\u003e\n\n\u003cp\u003eI am going to use this pointcut to apply security check before service method invocation.\nDue to the misprint the security check won't be applied but there will be no error message also.\u003c/p\u003e\n\n\u003cp\u003eIt seems to be very easy to make such mistakes during refactoring for example.\u003c/p\u003e\n\n\u003cp\u003eThe question is: how do you check that advices are really applied in your projects?\u003c/p\u003e\n\n\u003cp\u003eThanks in advance!\u003c/p\u003e","accepted_answer_id":"4368268","answer_count":"2","comment_count":"0","creation_date":"2010-12-06 15:55:24.223 UTC","last_activity_date":"2010-12-07 16:11:39.61 UTC","last_edit_date":"2010-12-06 15:56:58.397 UTC","last_editor_display_name":"","last_editor_user_id":"21234","owner_display_name":"","owner_user_id":"220804","post_type_id":"1","score":"1","tags":"java|aop|aspectj","view_count":"109"} +{"id":"17431070","title":"How to return cost, grad as tuple for scipy's fmin_cg function","body":"\u003cp\u003eHow can I make scipy's \u003ccode\u003efmin_cg\u003c/code\u003e use one function that returns \u003ccode\u003ecost\u003c/code\u003e and \u003ccode\u003egradient\u003c/code\u003e as a tuple? The problem with having \u003ccode\u003ef\u003c/code\u003e for cost and \u003ccode\u003efprime\u003c/code\u003e for gradient, is that I might have to perform an operation twice (very costly) by which the \u003ccode\u003egrad\u003c/code\u003e and \u003ccode\u003ecost\u003c/code\u003e is calculated. Also, sharing the variables between them could be troublesome.\u003c/p\u003e\n\n\u003cp\u003eIn Matlab however, \u003ccode\u003efmin_cg\u003c/code\u003e works with one function that returns cost and gradient as tuple. I don't see why scipy's \u003ccode\u003efmin_cg\u003c/code\u003e cannot provide such convenience.\u003c/p\u003e\n\n\u003cp\u003eThanks in advance...\u003c/p\u003e","accepted_answer_id":"17431749","answer_count":"1","comment_count":"0","creation_date":"2013-07-02 16:38:27.317 UTC","favorite_count":"2","last_activity_date":"2014-01-27 23:13:57.157 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1248073","post_type_id":"1","score":"7","tags":"python|scipy|fminsearch","view_count":"1477"} +{"id":"3640175","title":"Limit drag area of scriptaculous draggable","body":"\u003cp\u003eIm usign this to create a bunch on draggable elements:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$$('.box').each( function(item){ new Draggable(item) });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow can I limit the draggable area? This way, the boxes can be droped anywhere on the page, and I would like to limit the drag area to their current parent element (I dont think I need to create a droppable). Or, at least, i would like to revert the box to its initial position if its dropped outside it parent.\nHow can I do this?\nthanks.\u003c/p\u003e","accepted_answer_id":"5970817","answer_count":"2","comment_count":"0","creation_date":"2010-09-03 23:11:31.803 UTC","favorite_count":"1","last_activity_date":"2014-04-09 15:00:16.42 UTC","last_edit_date":"2010-09-04 23:03:07.243 UTC","last_editor_display_name":"","last_editor_user_id":"245630","owner_display_name":"","owner_user_id":"245630","post_type_id":"1","score":"0","tags":"javascript|draggable|scriptaculous","view_count":"989"} +{"id":"40254546","title":"Working with Multiple Targets in XCode","body":"\u003cp\u003eI am having a single project file. Then I created another target for a \u003ccode\u003e\"Lite\"\u003c/code\u003e version. I changed the bundle ID and product name for each target and am able to continue working this way.\u003c/p\u003e\n\n\u003cp\u003eBut when I added a new custom class to the project, I try to use the class in existing VC by \u003ccode\u003e#import \"NewClass.h\"\u003c/code\u003e but it only works on one target, on the Lite target, it says \u003ccode\u003e\"File not found\"\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eWhy is this and how to solve it?\u003c/p\u003e","accepted_answer_id":"40254922","answer_count":"2","comment_count":"3","creation_date":"2016-10-26 05:42:26.1 UTC","last_activity_date":"2016-10-26 06:48:56.437 UTC","last_edit_date":"2016-10-26 06:48:56.437 UTC","last_editor_display_name":"","last_editor_user_id":"7013756","owner_display_name":"","owner_user_id":"501439","post_type_id":"1","score":"0","tags":"ios|xcode|header|target|ios-targets","view_count":"1233"} +{"id":"43191630","title":"PrimeNG treetable. Conditionally change style of row","body":"\u003cp\u003eI would like to conditionally change the style of a row in the PrimeNG TreeTable.\nI have tried various options such as:\u003ccode\u003e[rowStyleClass]=\"rowStyle()\"\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eBut I get this error:\n\u003ccode\u003eCan't bind to 'rowStyleClass' since it isn't a known property of 'p-treeTable'\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eAny ideas on how to change the row style conditionally?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-04-03 18:17:01.28 UTC","last_activity_date":"2017-05-18 15:36:32.047 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4223026","post_type_id":"1","score":"0","tags":"styles|row|primeng|treetable","view_count":"325"} +{"id":"20526804","title":"Fastest, least tedious way to amend a commit that is not on the tip of branch?","body":"\u003cp\u003eI sometimes encounter a situation where I need to fix one line of code in a commit that is not on the tip of branch any more. (it is second or third from the top).\nI can of course put that last commit or two away somewhere, amend the problematic commit and then put those two back on top if it, but I was wondering if there is some one click solution \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e1) SourceTree\n2) git command line\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eas I consider that whole hoopla-doopla described above a bit tedious. \u003c/p\u003e\n\n\u003cp\u003eIt goes without saying I am talking about private code, feature branches, nothing pushed to the holy corporate repository, so changing history is not an issue here at all. \u003c/p\u003e\n\n\u003cp\u003eAny help, ideas?\u003c/p\u003e","accepted_answer_id":"20527074","answer_count":"3","comment_count":"0","creation_date":"2013-12-11 18:12:01.533 UTC","favorite_count":"1","last_activity_date":"2013-12-12 16:07:02.903 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"788100","post_type_id":"1","score":"1","tags":"git|atlassian-sourcetree","view_count":"186"} +{"id":"148078","title":"How to make a method exclusive in a multithreaded context?","body":"\u003cp\u003eI have a method which should be executed in an exclusive fashion. Basically, it's a multi threaded application where the method is invoked periodically by a timer, but which could also be manually triggered by a user action.\u003c/p\u003e\n\n\u003cp\u003eLet's take an example :\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003e\u003cp\u003eThe timer elapses, so the method is\ncalled. The task could take a few\nseconds.\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eRight after, the user clicks on some\nbutton, which should trigger the\nsame task : BAM. It does nothing\nsince the method is already running.\u003c/p\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eI used the following solution :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic void DoRecurentJob()\n{\n if(!Monitor.TryEnter(this.lockObject))\n {\n return;\n }\n\n try\n {\n // Do work\n }\n finally \n {\n Monitor.Exit(this.lockObject);\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhere \u003ccode\u003elockObject\u003c/code\u003e is declared like that:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate readonly object lockObject = new object();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdit\u003c/strong\u003e : There will be only one instance of the object which holds this method, so I updated the lock object to be non-static.\u003c/p\u003e\n\n\u003cp\u003eIs there a better way to do that ? Or maybe this one is just wrong for any reason ?\u003c/p\u003e","accepted_answer_id":"148104","answer_count":"8","comment_count":"0","creation_date":"2008-09-29 09:23:37.527 UTC","last_activity_date":"2017-06-02 14:45:05.663 UTC","last_edit_date":"2008-09-29 10:10:11.643 UTC","last_editor_display_name":"Romain Verdier","last_editor_user_id":"4687","owner_display_name":"Romain Verdier","owner_user_id":"4687","post_type_id":"1","score":"3","tags":"c#|.net|multithreading|locking","view_count":"825"} +{"id":"34210628","title":"Update multiple columns of table using jpa","body":"\u003cp\u003eI have a customer table with 40 columns. There is a screen where i can update atleast 20 columns. Please tell me which is the better to call the jpa update. I m new to jpa. I cant call find by id and then one by one set all these 20 update column values. What if i pass the object with updated 20 values.. I m\nWorrried it might override other 20 columns.\u003c/p\u003e","answer_count":"0","comment_count":"4","creation_date":"2015-12-10 19:57:18.523 UTC","last_activity_date":"2015-12-10 20:05:56.023 UTC","last_edit_date":"2015-12-10 20:05:56.023 UTC","last_editor_display_name":"","last_editor_user_id":"1940318","owner_display_name":"","owner_user_id":"1940318","post_type_id":"1","score":"0","tags":"jpa","view_count":"157"} +{"id":"25174503","title":"getting video player scrubber","body":"\u003cp\u003eI need to get the duration of video being played. Is this possible? I seen this Jsfiddle code to get the time, but not succeeded.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /\u0026gt;\n\u0026lt;title\u0026gt;TEST\u0026lt;/title\u0026gt;\n\u0026lt;script\u0026gt;\n function jsCallbackReady(pid){\n alert(pid);\n }\n function freePreviewEndHandler() {\n kdp.sendNotification('doPause');\n var time = this.kdp.evaluate('{video.player.currentTime}');\n }\n\u0026lt;/script\u0026gt;\n\u0026lt;/head\u0026gt;\n\u0026lt;body\u0026gt;\n \u0026lt;button id=\"seaButton\" class=\"searchButtonClass\" type=\"button\" onclick=\"freePreviewEndHandler()\"\u0026gt;Get Time\u0026lt;/button\u0026gt;\n\n \u0026lt;object id=\"My-player_1406035922\" name=\"My-player_1406035922\" type=\"application/x-shockwave-flash\" allowFullScreen=\"true\" allowNetworking=\"all\" allowScriptAccess=\"always\" height=\"333\" width=\"400\" bgcolor=\"#000000\" style=\"width: 400px; height: 333px;\" xmlns:dc=\"http://purl.org/dc/terms/\" xmlns:media=\"http://search.yahoo.com/searchmonkey/media/\" rel=\"media:video\" resource=\"https://video.konnectcorp.com/index.php/kwidget/cache_st/1406035922/wid/_103/uiconf_id/14969193/entry_id/0_57arhuzr\" data=\"https://video.konnectcorp.com/index.php/kwidget/cache_st/1406035922/wid/_103/uiconf_id/14969193/entry_id/0_57arhuzr\"\u0026gt;\n \u0026lt;param name=\"allowFullScreen\" value=\"true\" /\u0026gt;\n \u0026lt;param name=\"allowNetworking\" value=\"all\" /\u0026gt;\n \u0026lt;param name=\"allowScriptAccess\" value=\"always\" /\u0026gt;\n \u0026lt;param name=\"bgcolor\" value=\"#000000\" /\u0026gt;\n \u0026lt;param name=\"flashVars\" value=\"emptyF=onKdpReady\u0026amp;readyF=onKdpReady\u0026amp;streamerType=rtmp\u0026amp;mediaProtocol=rtmpe\" /\u0026gt;\n \u0026lt;param name=\"movie\" value=\"https://video.konnectcorp.com/index.php/kwidget/cache_st/1406035922/wid/_103/uiconf_id/14969193/entry_id/0_57arhuzr\" /\u0026gt;\n\n \u0026lt;a rel=\"media:thumbnail\" href=\"\"\u0026gt;\u0026lt;/a\u0026gt;\n \u0026lt;span property=\"dc:description\" content=\"\"\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;span property=\"media:title\" content=\"Wildlife\"\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;span property=\"media:width\" content=\"400\"\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;span property=\"media:height\" content=\"333\"\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;span property=\"media:type\" content=\"application/x-shockwave-flash\"\u0026gt;\u0026lt;/span\u0026gt; \n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"25182954","answer_count":"1","comment_count":"0","creation_date":"2014-08-07 05:02:26.603 UTC","last_activity_date":"2014-08-08 15:35:45.92 UTC","last_edit_date":"2014-08-08 15:35:45.92 UTC","last_editor_display_name":"","last_editor_user_id":"1989722","owner_display_name":"","owner_user_id":"1989722","post_type_id":"1","score":"0","tags":"javascript|video-player","view_count":"163"} +{"id":"38656842","title":"I Need Makefile for FDK-AAC","body":"\u003cp\u003eI want to compile AAC library (fdk-aac) on Ubuntu, but there is no makefile for it. \nI compiled the source code of fdk-aac in Visual Studio before, but now I want to use it on Ubuntu.\nHow I can find a makefile for it?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-07-29 10:44:47.73 UTC","last_activity_date":"2016-07-29 13:10:50.223 UTC","last_edit_date":"2016-07-29 13:10:50.223 UTC","last_editor_display_name":"","last_editor_user_id":"3617426","owner_display_name":"","owner_user_id":"5230640","post_type_id":"1","score":"0","tags":"ubuntu|makefile|aac","view_count":"68"} +{"id":"19571702","title":"Printing subjects and sender from email in python","body":"\u003cp\u003eI'm trying to get a python script which looks through my gmail inbox using imap and prints out the subject and sender of any emails which are unseen. I've started but at the moment I don't think it can \u003cstrong\u003esort the unseen emails\u003c/strong\u003e or \u003cstrong\u003eextract\u003c/strong\u003e from these the \u003cstrong\u003esubject and sender\u003c/strong\u003e.\u003c/p\u003e\n\n\u003cp\u003eDoes anyone know how to finish this code?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport imaplib\nimport email\nuser = \"x\"\npassword = \"y\"\n\nmail = imaplib.IMAP4_SSL('imap.gmail.com')\nmail.login(user, password)\nmail.list()\nmail.select('inbox')\n\nunseen_emails = mail.search(None, 'UnSeen')\nprint unseen_emails\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"2","creation_date":"2013-10-24 16:38:18.473 UTC","favorite_count":"0","last_activity_date":"2017-08-14 13:39:30.987 UTC","last_edit_date":"2013-10-24 16:39:22.753 UTC","last_editor_display_name":"","last_editor_user_id":"2797476","owner_display_name":"","owner_user_id":"2916407","post_type_id":"1","score":"2","tags":"python|email|imap|imaplib","view_count":"995"} +{"id":"32754851","title":"Java array.length method","body":"\u003cp\u003eI am getting error: Undefined symbol:length.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport java.util.*;\n\nclass ssss\n\n{\n\n public static void main(String args[])\n\n {\n\n int a[]={1,2,3,4};\n System.out.println(a[1]);\n int x = a.length(); \n System.out.println(x);\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"4","comment_count":"4","creation_date":"2015-09-24 06:36:00.7 UTC","last_activity_date":"2015-09-24 06:58:55.103 UTC","last_edit_date":"2015-09-24 06:58:55.103 UTC","last_editor_display_name":"","last_editor_user_id":"4411","owner_display_name":"","owner_user_id":"5148848","post_type_id":"1","score":"-2","tags":"java|arrays","view_count":"103"} +{"id":"31317274","title":"Displaying data in gridview using jQuery ajax call is very slow","body":"\u003cp\u003eI have a gridview with id \u003ccode\u003egvRemarksHistory\u003c/code\u003e and a button with id \u003ccode\u003ebtnLoadRemarks\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eI am using below code to bind data to gridview when clicked on button using jQuery ajax call\u003c/p\u003e\n\n\u003cp\u003eCode behind and jQuery code is as shown in image \u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/bX72X.jpg\" alt=\"enter image description here\"\u003e\n\u003cimg src=\"https://i.stack.imgur.com/ShxDg.jpg\" alt=\"enter image description here\"\u003e\n\u003cimg src=\"https://i.stack.imgur.com/R9dI3.jpg\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eMy requirement is to display remarks in gridview. Above code working fine and fast when remarks data is too less.\u003c/p\u003e\n\n\u003cp\u003eI am having problem when the data is large. Suppose there are 10000 records, and I have implemented paging logic also. While page load I am displaying first 500 remarks and on next click I am displaying another 500 remarks ans so on... But each and every next/prev click data fetching is very very slow and in each click my page gets hanged till the process is completed.\u003c/p\u003e\n\n\u003cp\u003ePlease suggest me the best way(s) to fetch and display the data in the grid.\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2015-07-09 12:18:01.357 UTC","last_activity_date":"2016-06-07 20:38:15.98 UTC","last_edit_date":"2016-06-07 20:38:15.98 UTC","last_editor_display_name":"","last_editor_user_id":"13302","owner_display_name":"","owner_user_id":"1463065","post_type_id":"1","score":"0","tags":"jquery|asp.net","view_count":"128"} +{"id":"36980834","title":"How to get page no in tesseract while ocring multi tiff file","body":"\u003cp\u003eHow can we get the page no in command line while ocring a multi tiff file. For eg -\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etesseract myfile.tif output-page_no.txt\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere the output file should have the corresponding page no from the tiff file. \u003c/p\u003e","accepted_answer_id":"36993055","answer_count":"1","comment_count":"0","creation_date":"2016-05-02 10:59:57.36 UTC","last_activity_date":"2016-05-02 23:13:43.34 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2636802","post_type_id":"1","score":"0","tags":"image-processing|ocr|tesseract","view_count":"225"} +{"id":"35122542","title":"How to Using Powerbuilder in Mdb","body":"\u003cp\u003eWindows os : WIndows XP\u003c/p\u003e\n\n\u003cp\u003ePb ver : 6.5\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://i.stack.imgur.com/yyjnw.jpg\" rel=\"nofollow\"\u003eenter image description here\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eDataWindow\u003c/p\u003e\n\n\u003cp\u003eSQLSTATE = S1003\u003c/p\u003e\n\n\u003cp\u003e[Microsoft][ODBC Driver Manager] The program type out of range.\u003c/p\u003e\n\n\u003cp\u003eThe error is as follows When the output.\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eDataWindow Profiles\n\n\u003cblockquote\u003e\n \u003cp\u003eODBC \u003e Config ODBC \u003e Microsoft Access Driver(*.mdb, *.accdb) \u003e Create\u003c/p\u003e\n \n \u003cp\u003eoriginal Data Name : mdb\u003c/p\u003e\n \n \u003cp\u003eSelect DataBase : C:\\Program Files\\test\\test.mdb\u003c/p\u003e\n \n \u003cp\u003eCreate\u003c/p\u003e\n \n \u003cp\u003eConnect is ok\u003c/p\u003e\n\u003c/blockquote\u003e\u003c/li\u003e\n\u003cli\u003eDataWindow\n\n\u003cblockquote\u003e\n \u003cp\u003eDataWindow painter \u003e New(Create New DataWindow)\u003c/p\u003e\n \n \u003cp\u003eDataSource : SQL Select\u003c/p\u003e\n \n \u003cp\u003ePresentation style : All Style : SQLSTATE = S1003\u003c/p\u003e\n\u003c/blockquote\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003chr\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eDataWindow painter \u003e New(Create New DataWindow)\u003c/p\u003e\n \n \u003cp\u003eDataSource : With the exception of the 'SQL Select'\u003c/p\u003e\n \n \u003cp\u003ePresentation style : All Style : Not Print SQLSTATE = S1003 \u003c/p\u003e\n \n \u003cp\u003eBut The contents of this mdb does not come out anything.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003e\u003ca href=\"http://i.stack.imgur.com/014vz.jpg\" rel=\"nofollow\"\u003eenter image description here\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eHow to Using PowerBuilder in Mdb File?\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2016-02-01 03:19:37.933 UTC","last_activity_date":"2016-02-01 11:19:10.773 UTC","last_edit_date":"2016-02-01 03:52:56.347 UTC","last_editor_display_name":"","last_editor_user_id":"4570198","owner_display_name":"","owner_user_id":"4570198","post_type_id":"1","score":"0","tags":"ms-access|powerbuilder","view_count":"165"} +{"id":"27962009","title":"is google appengine datastore.get(key) consistent?","body":"\u003cp\u003eI've read the consistency page on \u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://cloud.google.com/appengine/docs/java/datastore/structuring_for_strong_consistency\" rel=\"nofollow\"\u003ehttps://cloud.google.com/appengine/docs/java/datastore/structuring_for_strong_consistency\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003enow i know that for queries to be consistent you need to use ancestor queries.\u003c/p\u003e\n\n\u003cp\u003eWhat about single key? query for example:\u003c/p\u003e\n\n\u003cp\u003eEntity e = datastore.get(Key)\u003c/p\u003e\n\n\u003cp\u003eare they eventually consistent or strongly consistent?\nplease do cite references or links\u003c/p\u003e","accepted_answer_id":"27962286","answer_count":"1","comment_count":"0","creation_date":"2015-01-15 11:06:13.297 UTC","last_activity_date":"2016-11-16 16:17:28.99 UTC","last_edit_date":"2016-11-16 16:17:28.99 UTC","last_editor_display_name":"","last_editor_user_id":"153407","owner_display_name":"","owner_user_id":"1717817","post_type_id":"1","score":"1","tags":"java|google-app-engine|google-cloud-datastore","view_count":"122"} +{"id":"17975154","title":"JQuery: Bind multiple triggers from multiple elements to one event","body":"\u003cp\u003eI've been trawling through the internet trying to find a solution to this, but all I've found are slight variations on multiple elements/events/triggers and not this specific problem.\u003c/p\u003e\n\n\u003cp\u003eThe situation is I have a search button which, when clicked toggled the visibility of the search input. I want to be able to toggle the search closed again by clicking the button but also when the search input focus blurs.\u003c/p\u003e\n\n\u003cp\u003eMy current code is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction toggleSearch() {\n$(\"#search\").animate({\n width: \"toggle\",\n opacity: \"toggle\"\n }, \"slow\",function() { $(this).focus(); });\n$(\"#searchButton\").parent('li').siblings().animate({\n width: \"toggle\",\n opacity: \"toggle\"\n }, \"slow\");\n}\n\n$(\"#searchButton\").click(toggleSearch);\n$(\"#search\").blur(toggleSearch);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe problem here is that if you click the button to toggle the search closed again, it also counts as the input blurring so fires the function twice and the search closes and reopens. So basically I need something that would do this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(\"#searchButton\").click() or $(\"#search\").blur() {\n toggleSearch();\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'd also like to change the function of the button from toggling it open/closed to submitting the search depending on whether there is a value in the search input. But from what I've experienced with this I'm not sure of the syntax to use that will work.\u003c/p\u003e\n\n\u003cp\u003eHere is a fiddle: \u003ca href=\"http://jsfiddle.net/hGgc9/\" rel=\"nofollow\"\u003ehttp://jsfiddle.net/hGgc9/\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"17980749","answer_count":"1","comment_count":"2","creation_date":"2013-07-31 15:55:33.587 UTC","last_activity_date":"2013-07-31 20:51:30.777 UTC","last_edit_date":"2013-07-31 16:08:00.68 UTC","last_editor_display_name":"","last_editor_user_id":"1948936","owner_display_name":"","owner_user_id":"1948936","post_type_id":"1","score":"1","tags":"jquery|function|triggers|toggle","view_count":"503"} +{"id":"12973296","title":"How can I detect how long a key has been held down?","body":"\u003cp\u003eI'm looking for a way to detect how long a key has been held down in a Delphi project and warn user.\u003c/p\u003e\n\n\u003cp\u003eI'm working on a chat program and need to see if the person is holding down a letter, like the W key, to spam that chat box. I'll give sample what trying to do in Delphi 7:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e//Looking up if key in use and held for lets say 20 seconds\nif (GetAsyncKeyState(Byte(VkKeyScan('W'))) shl 20) \u0026lt;\u0026gt; 0 then\nbegin\n ShowMessage('W Key Held down too long!');\nend;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm not sure whether GetAsyncKeyState will give me that information, though. If it doesn't, what will?\u003c/p\u003e","answer_count":"2","comment_count":"6","creation_date":"2012-10-19 11:28:13.503 UTC","favorite_count":"1","last_activity_date":"2012-10-19 20:25:40.6 UTC","last_edit_date":"2012-10-19 13:28:44.387 UTC","last_editor_display_name":"","last_editor_user_id":"33732","owner_display_name":"","owner_user_id":"1624498","post_type_id":"1","score":"2","tags":"delphi|winapi|keyboard|delphi-7","view_count":"567"} +{"id":"18457090","title":"Backbonejs - Avoid parse after save","body":"\u003cp\u003e\u003ca href=\"http://backbonejs.org/#Model-parse\" rel=\"noreferrer\"\u003eBackbone documentation\u003c/a\u003e says,\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eparse is called whenever a model's data is returned by the server, in\n fetch, and save. The function is passed the raw response object, and\n should return the attributes hash to be set on the model.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eBut i have customized parse function for my model. I want to execute it only when i fetch data not when i save data.\u003c/p\u003e\n\n\u003cp\u003eIs there a way to do it? I can check my response inside parse function. But is there any built-in option to do it?\u003c/p\u003e","accepted_answer_id":"18457172","answer_count":"2","comment_count":"1","creation_date":"2013-08-27 04:42:32.29 UTC","last_activity_date":"2015-09-15 18:59:39.87 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1280221","post_type_id":"1","score":"5","tags":"backbone.js","view_count":"2448"} +{"id":"41766946","title":"Is it allowed to use JsonProperty attributes in the application layer when using DDD architecture?","body":"\u003cp\u003eI followed a few courses on Pluralsight about Clean Architecture and Domain Driven Design. While I'm waiting for Eric Evan's book about DDD to arrive, I got the following situation and question:\u003c/p\u003e\n\n\u003cp\u003eI'm setting up a new project. I've added the following projects:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eMyProject.Application \u003c/li\u003e\n\u003cli\u003eMyProject.Common \u003c/li\u003e\n\u003cli\u003eMyProject.Domain\u003c/li\u003e\n\u003cli\u003eMyProject.Infrastructure \u003c/li\u003e\n\u003cli\u003eMyProject.Persistance \u003c/li\u003e\n\u003cli\u003eMyProject.WebApi\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eA business requirement is to let the WebApi return a model with some properties that:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eDon't match my naming convention;\u003c/li\u003e\n\u003cli\u003eare ugly.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eThis model lives inside the MyProject.Application project. For example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enamespace MyProject.Application\n{\n public class MyModel\n {\n public string _communityname { set; get; }\n public List\u0026lt;string\u0026gt; photolist { set; get; }\n public string postedby { set; get; }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eUsually I would apply the JsonPropery attibute on these kind of models to keep it nice:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enamespace MyProject.Application\n{\n public class MyModel\n {\n [JsonProperty(\"_communityname\")]\n public string CommunityName { set; get; }\n\n [JsonProperty(\"photolist\")]\n public List\u0026lt;string\u0026gt; PhotoUrls { set; get; }\n\n [JsonProperty(\"postedby\")]\n public string PostedBy { set; get; }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut, then I think about it... and say to myself: the application layer should not concern about how 'things' are presented. This is a task for the presentation layer, in this case WebApi.\u003c/p\u003e\n\n\u003cp\u003eIs this correct? Should the Application layer return a normal model and let the WebApi cast/convert this to any (ugly) form of presentation, required by the business.\u003c/p\u003e\n\n\u003cp\u003eMany thanks in advance.\u003c/p\u003e","answer_count":"2","comment_count":"6","creation_date":"2017-01-20 15:19:38.853 UTC","last_activity_date":"2017-01-20 19:09:04.353 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"167196","post_type_id":"1","score":"0","tags":"c#|asp.net-web-api|domain-driven-design|clean-architecture","view_count":"60"} +{"id":"44638201","title":"How do I stop people from entering numbers in a popup on Netbeans v8","body":"\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/KA0iB.png\" rel=\"nofollow noreferrer\"\u003eThis picture is all my code for the pop-ups I currently have.\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI want to make it so that when a user goes to enter their name (If they want, if not it defaults to Player 1/ Player 2) and they enter a number instead, it will give another pop-up saying they can't put in a number. \u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-06-19 19:12:03.723 UTC","last_activity_date":"2017-06-20 14:51:32.25 UTC","last_edit_date":"2017-06-20 02:41:36.29 UTC","last_editor_display_name":"","last_editor_user_id":"8173380","owner_display_name":"","owner_user_id":"8184777","post_type_id":"1","score":"0","tags":"java|swing|netbeans|popup","view_count":"26"} +{"id":"46119779","title":"deploy symfony server vps in cloud - Ubuntu 16","body":"\u003cp\u003eI use Apache2, Symfony 2 and PHP 7.1.\u003c/p\u003e\n\n\u003cp\u003eDeploy Symfony in VPS with a static IP (example 46.101.130.241:8000), no domain.\u003c/p\u003e\n\n\u003cp\u003eHere my config of the virtual directory:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/wuT1q.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/wuT1q.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e.htaccess the project root:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/1ErpQ.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/1ErpQ.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eRun project:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$ sudo php app/console server:start 46.101.130.241\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eResult:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eNo se puede acceder a este sitio\n\n46.101.130.241 tardó demasiado en responder.\nBuscar 101 130 241 8000 en Google\nERR_CONNECTION_TIMED_OUT\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2017-09-08 15:22:30.197 UTC","last_activity_date":"2017-09-08 16:09:09.9 UTC","last_edit_date":"2017-09-08 16:09:09.9 UTC","last_editor_display_name":"","last_editor_user_id":"633864","owner_display_name":"","owner_user_id":"8580697","post_type_id":"1","score":"-1","tags":".htaccess|symfony|ubuntu|apache2","view_count":"28"} +{"id":"36619717","title":"Modifying image height from context menu in XAML","body":"\u003cp\u003eIn my XAML page I define an image with a context menu:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;Image Height=\"{Binding Image.Height, Mode=TwoWay}\" MaxHeight=\"2000\" HorizontalAlignment=\"Left\" StretchDirection=\"Both\" Stretch=\"Uniform\"\nSource=\"{Binding Image.ImageData, Converter={StaticResource ImageByteConverter}}\"\nx:Name=\"Image1\"\u0026gt;\n\n\u0026lt;Image.ContextMenu\u0026gt;\n\u0026lt;ContextMenu\u0026gt;\n \u0026lt;MenuItem Header=\"200\" Click=\"ImageHeight200_Click\" /\u0026gt;\n \u0026lt;MenuItem Header=\"400\" Click=\"ImageHeight400_Click\" /\u0026gt;\n \u0026lt;MenuItem Header=\"600\" Click=\"ImageHeight600_Click\" /\u0026gt;\n \u0026lt;MenuItem Header=\"800\" Click=\"ImageHeight800_Click\" /\u0026gt;\n \u0026lt;MenuItem Header=\"1000\" Click=\"ImageHeight1000_Click\" /\u0026gt;\n\u0026lt;/ContextMenu\u0026gt;\n\u0026lt;/Image.ContextMenu\u0026gt;\n\u0026lt;/Image\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow I want to add code to resize the image.\u003c/p\u003e\n\n\u003cp\u003eWhen I write something like this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate void ImageHeight200_Click(object sender, RoutedEventArgs e)\n{\n var img = (Image)e.Source;\n img.Height = 200;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt accesses the MenuItem but not the image and I get an error message: \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eThe object of type \"System.Windows.Controls.MenuItem\" cannot be converted to type \"System.Windows.Controls.Image\".\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003e\u003cstrong\u003eMy Question is:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eHow can I access the image object? \u003c/p\u003e","answer_count":"2","comment_count":"3","creation_date":"2016-04-14 10:00:09.133 UTC","last_activity_date":"2016-04-19 09:55:55.33 UTC","last_edit_date":"2016-04-19 09:55:55.33 UTC","last_editor_display_name":"","last_editor_user_id":"3288649","owner_display_name":"","owner_user_id":"6028673","post_type_id":"1","score":"0","tags":"c#|wpf|xaml","view_count":"36"} +{"id":"14745193","title":"SVG and VML path fill difference","body":"\u003cp\u003eI migrate from VML to SVG. There is a problem with the way path is filled. Here is an example:\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/w6FJF.png\" alt=\"star drawn with VML and SVG\"\u003e\u003c/p\u003e\n\n\u003cp\u003eOn the left side is star drawn with VML, and on the right with SVG.\nSource code for VML (works only in IE):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\u0026gt;\n\u0026lt;html xmlns:v=\"urn:schemas-microsoft-com:vml\"\u0026gt;\n\u0026lt;head\u0026gt;\n \u0026lt;style\u0026gt; v\\:* { behavior: url(#default#VML); }\u0026lt;/style \u0026gt;\n\u0026lt;/head\u0026gt;\n\u0026lt;body\u0026gt;\n \u0026lt;div style=\"width:300; height:270;\"\u0026gt;\n \u0026lt;v:shape fillcolor=\"blue\" strokecolor=\"red\" coordorigin=\"0 0\" coordsize=\"300 270\"\n strokeweight=\"2\" style=\"position:relative; top:20; left:20; width:300; height:270\" \n path=\"m150,20 l240,240 l30,90 l270,90 l60,240 x e\"\u0026gt;\n \u0026lt;/v:shape\u0026gt;\n \u0026lt;/div\u0026gt;\n\u0026lt;/body\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003c/p\u003e\n\n\u003cp\u003eSource code for SVG:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;!DOCTYPE html\u0026gt;\n\u0026lt;html\u0026gt;\n \u0026lt;head\u0026gt;\n \u0026lt;/head\u0026gt;\n \u0026lt;body\u0026gt;\n \u0026lt;svg width=\"300\" height=\"270\"\u0026gt;\n \u0026lt;path d=\"M150,20 L240,240 L30,90 L270,90 L60,240 Z\" fill=\"blue\" stroke=\"red\" stroke-width=\"3\"/\u0026gt;\n \u0026lt;/svg\u0026gt;\n \u0026lt;/body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThere is obvious difference in filling in the middle of the star. I prefer VML style. Is there a ways to do it with SVG?\u003c/p\u003e","accepted_answer_id":"14745795","answer_count":"1","comment_count":"0","creation_date":"2013-02-07 06:44:23.013 UTC","last_activity_date":"2013-02-07 07:25:21.65 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1909118","post_type_id":"1","score":"0","tags":"html5|svg|vml","view_count":"1193"} +{"id":"7824178","title":"FDT: Could not resolve variable (may be an XML element name)","body":"\u003cp\u003eI'm getting some warning signs in FDT in a couple of lines of code that access values in the app descriptor, like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar appDescriptor:XML = NativeApplication.nativeApplication.applicationDescriptor;\nvar ns:Namespace = appDescriptor.namespace();\nvar appId:String = appDescriptor.ns::id[0];\nvar appVersion:String = appDescriptor.ns::versionNumber[0];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThose lines work fine, but FDT underlines \"id\" and \"versionNumber\", and issues the warning \"Could not resolve variable (may be an XML element name)\".\u003c/p\u003e\n\n\u003cp\u003eIs there a way to get rid of that warning?\u003c/p\u003e","accepted_answer_id":"7841569","answer_count":"1","comment_count":"0","creation_date":"2011-10-19 15:52:18.647 UTC","last_activity_date":"2011-10-20 20:03:13.387 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"732669","post_type_id":"1","score":"1","tags":"actionscript-3|fdt","view_count":"563"} +{"id":"31256695","title":"jQM buttons with custom background colors have pixelated corners","body":"\u003cp\u003eSo I'd like to use some custom colors for my jQuery Mobile buttons, but when I do so it seems to do something funky to the (rounded) corners. The more \"border-radius\" I use, the more pixelated the corners get. Here's an example...\u003c/p\u003e\n\n\u003cp\u003ejsfiddle:\n\u003ca href=\"https://jsfiddle.net/pxws02au/\" rel=\"nofollow\"\u003ehttps://jsfiddle.net/pxws02au/\u003c/a\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;!doctype html\u0026gt;\n\u0026lt;html\u0026gt;\n\u0026lt;head\u0026gt;\n\u0026lt;style\u0026gt;\n #buttons .ui-btn {\n background: rgb(0,0,255);\n border-radius: 1em;\n }\n\u0026lt;/style\u0026gt;\n\u0026lt;/head\u0026gt;\n\n\u0026lt;body\u0026gt;\n\u0026lt;div data-role=\"page\"\u0026gt; \n \u0026lt;div data-role=\"header\" data-position=\"inline\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;div data-role=\"content\"\u0026gt;\n \u0026lt;div id=\"buttons\"\u0026gt;\n \u0026lt;a href=\"#\" data-role=\"button\"\u0026gt;1\u0026lt;/a\u0026gt;\n \u0026lt;a href=\"#\" data-role=\"button\"\u0026gt;2\u0026lt;/a\u0026gt;\n \u0026lt;a href=\"#\" data-role=\"button\"\u0026gt;3\u0026lt;/a\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u0026lt;/body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf I remove the borders altogether (border: none), that solves the pixelation issue. But I would prefer a solution that allows me to keep (and style) the borders.\u003c/p\u003e\n\n\u003cp\u003eI tested the above link with my laptop (Chrome \u0026amp; FF), my Android phone, and my Android tablet... and the button corners are pixelated across all devices.\u003c/p\u003e\n\n\u003cp\u003eAny ideas?\u003c/p\u003e","accepted_answer_id":"31256914","answer_count":"1","comment_count":"0","creation_date":"2015-07-06 22:23:17.847 UTC","last_activity_date":"2015-07-06 23:23:04.45 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4907102","post_type_id":"1","score":"0","tags":"jquery|css|jquery-mobile","view_count":"33"} +{"id":"43701572","title":"I keep getting list index out of range when there is more elements left, how can I fix this?","body":"\u003cp\u003eI am using this to delete the non alphabetical characters from a list\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ealphabet = -1\nint(alphabet)\nwhile alphabet != howlong:\n alphabet = alphabet + 1\n print alphabet\n if ldata[alphabet] == \"a\":\n print \"a\" \n elif ldata[alphabet] == \"b\":\n print \"b\"\n elif ldata[alphabet] == \"c\":\n print \"c\"\n elif ldata[alphabet] == \"d\":\n print \"d\"\n elif ldata[alphabet] == \"e\":\n print \"e\"\n elif ldata[alphabet] == \"f\":\n print \"f\"\n elif ldata[alphabet] == \"g\":\n print \"g\"\n elif ldata[alphabet] == \"h\":\n print \"h\"\n elif ldata[alphabet] == \"i\":\n print \"i\"\n elif ldata[alphabet] == \"j\":\n print \"j\"\n elif ldata[alphabet] == \"k\":\n print \"k\"\n elif ldata[alphabet] == \"l\":\n print \"l\"\n elif ldata[alphabet] == \"m\":\n print \"m\"\n elif ldata[alphabet] == \"n\":\n print \"n\"\n elif ldata[alphabet] == \"o\":\n print \"o\"\n elif ldata[alphabet] == \"p\":\n print \"p\"\n elif ldata[alphabet] == \"q\":\n print \"q\"\n elif ldata[alphabet] == \"r\":\n print \"r\"\n elif ldata[alphabet] == \"s\":\n print \"s\"\n elif ldata[alphabet] == \"t\":\n print \"t\"\n elif ldata[alphabet] == \"u\":\n print \"u\"\n elif ldata[alphabet] == \"v\":\n print \"v\"\n elif ldata[alphabet] == \"w\":\n print \"w\"\n elif ldata[alphabet] == \"x\":\n print \"x\"\n elif ldata[alphabet] == \"y\":\n print \"y\"\n elif ldata[alphabet] == \"z\":\n print \"z\"\n else:\n #deletes non letter and all of the same things from the list\n z = ldata[alphabet]\n ldata = [x for x in ldata if x != z]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt gets up to the 57742 element then says list index out of range. I counted the list and it gets above that. Also that is not pythons maximum possible number of elements in the list. I am very confused and was wondering if there was anything I could have missed. Please help this is due on monday :(. If there is a more simple way to do this also I would greatly appreciate that. \u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2017-04-29 23:53:47.103 UTC","favorite_count":"1","last_activity_date":"2017-04-30 01:07:01.69 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7926473","post_type_id":"1","score":"0","tags":"python|list|sorting","view_count":"28"} +{"id":"36458232","title":"Android Audience Network Ad doesn't show next Ad","body":"\u003cp\u003eI have \u003ccode\u003eRecyclerView\u003c/code\u003e, where every 14-th item is a Facebook \u003ccode\u003eAudience Network Ad\u003c/code\u003e. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@Override\npublic int getItemViewType(int position) {\n int viewType = 0;\n if (position % 14 == 0 \u0026amp;\u0026amp; position != 0) viewType = 2;\n return viewType;\n}\n\n@Override\npublic RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {\n switch (viewType) {\n case 0:\n return new MainViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.recycler_item, parent, false));\n case 2:\n return new AdHolder((LayoutInflater.from(parent.getContext()).inflate(R.layout.ad_test3, parent, false)));\n }\n return null;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe is as follows: every 14th element is the same. Here's \u003ccode\u003eonBindViewHolder\u003c/code\u003e method. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@Override\npublic void onBindViewHolder(final RecyclerView.ViewHolder holder, final int position) {\n final FoodData foodData = foodDataList.get(position);\n\n switch (holder.getItemViewType()) {\n case 0:\n MainViewHolder mainViewHolder = (MainViewHolder) holder;\n ...\n break;\n case 2:\n AdHolder adHolder = (AdHolder) holder;\n //System.out.println(\"ad hasH\" + position);\n if (manager.isLoaded()) {\n NativeAd nativeAd;\n if (map.containsKey(position)) {\n nativeAd = map.get(position);\n } else {\n nativeAd = manager.nextNativeAd();\n map.put(position, nativeAd);\n }\n\n System.out.println(\" Native Ad\" + nativeAd.hashCode());\n System.out.println(\" Native Ad.Title\" + nativeAd.getAdTitle());\n\n adHolder.templateContainer.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, Config.AD_HEIGHT_DP));\n adHolder.nativeAdSocialContext.setText(nativeAd.getAdSocialContext());\n adHolder.nativeAdCallToAction.setText(nativeAd.getAdCallToAction());\n adHolder.nativeAdTitle.setText(nativeAd.getAdTitle());\n adHolder.nativeAdBody.setText(nativeAd.getAdBody());\n\n Picasso.with(context)\n .load(nativeAd.getAdIcon().getUrl())\n .tag(\"resume_tag\")\n .into(adHolder.nativeAdIcon);\n\n Picasso.with(context)\n .load(nativeAd.getAdCoverImage().getUrl())\n .resize(width, ad_height)\n .tag(\"resume_tag\")\n .placeholder(R.drawable.adholder2)\n .into(adHolder.nativeAdMedia);\n\n System.out.println(\"url =\" + nativeAd.getAdCoverImage().getUrl());\n\n if (adHolder.adChoicesView == null) {\n adHolder.adChoicesView = new AdChoicesView(context, nativeAd, true);\n adHolder.adChoiceContainer.addView(adHolder.adChoicesView, 0);\n }\n nativeAd.registerViewForInteraction(holder.itemView);\n } else {\n adHolder.params = adHolder.templateContainer.getLayoutParams();\n adHolder.templateContainer.setLayoutParams(new ViewGroup.LayoutParams(0, 0));\n }\n break;\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat I can't understand is when I check where I the same NativeAd \u003ccode\u003eobject\u003c/code\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e System.out.println(\" Native Ad\" + nativeAd.hashCode());\n System.out.println(\" Native Ad.Title\" + nativeAd.getAdTitle());\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI find, that \u003ccode\u003ehashCode\u003c/code\u003e of the NativeAd changes, but \u003ccode\u003etitle\u003c/code\u003e (and other elements) doesn't!\u003c/p\u003e\n\n\u003cp\u003eHope somebody we'll help me. Here's full code of \u003ccode\u003eAdapter\u003c/code\u003e \u003ca href=\"https://gist.github.com/burnix/c1dd34dd896f5c6ddc6b2b8971908e28\" rel=\"nofollow\"\u003ehttps://gist.github.com/burnix/c1dd34dd896f5c6ddc6b2b8971908e28\u003c/a\u003e\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-04-06 17:28:39.737 UTC","last_activity_date":"2016-04-15 00:11:09.27 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5198110","post_type_id":"1","score":"0","tags":"android|android-recyclerview|facebook-audience-network","view_count":"352"} +{"id":"17459197","title":"Visual Studio 2010 - Post-build event - cd \"$(ProjectDir)\" exits with code 1 when project is loaded from a network drive","body":"\u003cp\u003eI have a solution running in Visual Studio 2010 SP1.\u003c/p\u003e\n\n\u003cp\u003eAs part of the solution I have a post-build event where the first line is:\n cd \"$(ProjectDir)\"\n ...\u003c/p\u003e\n\n\u003cp\u003eThe post build event works fine when the project is loaded locally.\u003c/p\u003e\n\n\u003cp\u003eI have setup my laptop with the TFS workspace mapped to a network drive. The solution builds and the website runs just fine - except for the features relying on the post-build event. I have removed all of the Post-build event except the change directory line. \u003c/p\u003e\n\n\u003cp\u003eThis is the error I get when I build: The command \"cd \"\\\\[ComputerName]\\b$[ProjectPath]\\\"\" exited with code 1.\u003c/p\u003e\n\n\u003cp\u003eThe solution is residing solely on the network drive, and it build and runs. I can navigate to the directory in an explorer window without any problems (I saved the network credentials).\u003c/p\u003e\n\n\u003cp\u003eThe only thing I can find through searching is that exit code 1 means that the path is incorrect, but I can copy and paste the path from the error into an explorer window and browse the directory on the network drive.\u003c/p\u003e\n\n\u003cp\u003eAny ideas why the change directory command wont work?\u003c/p\u003e","accepted_answer_id":"17459380","answer_count":"1","comment_count":"6","creation_date":"2013-07-03 22:36:20.1 UTC","last_activity_date":"2013-07-03 22:56:50.937 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1706802","post_type_id":"1","score":"0","tags":"visual-studio-2010|post-build-event|cd|network-drive","view_count":"2143"} +{"id":"13389926","title":"WPF Combobox SelectedIndex Property Binding Not working","body":"\u003cp\u003eI am trying to bind the SelectedIndex property of combobox to my ViewModel. Here is the code.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eXaml:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;ComboBox x:Name=\"BloodGroupFilter\" SelectedIndex=\"{Binding Path=SelectedBloodGroupIndex, Mode=TwoWay}\"\u0026gt;\n \u0026lt;ComboBox.ItemsSource\u0026gt;\n \u0026lt;CompositeCollection\u0026gt;\n \u0026lt;ComboBoxItem Foreground=\"red\" FontStyle=\"Italic\"\u0026gt;No Filter\u0026lt;/ComboBoxItem\u0026gt;\n \u0026lt;CollectionContainer Collection=\"{Binding Source={StaticResource BloodGroupEnum}}\"/\u0026gt;\n \u0026lt;/CompositeCollection\u0026gt;\n \u0026lt;/ComboBox.ItemsSource\u0026gt;\n\u0026lt;/ComboBox\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eViewModel\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate int _selectedBloodGroupIndex = 4;\npublic int SelectedBloodGroupIndex {\n get { return _selectedBloodGroupIndex; }\n set { \n _selectedBloodGroupIndex = value; \n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAs you can see I am trying to set the SelectedIndex of combobox to \"4\". This doesn't happen and SelectedIndex is set to 0. Also, when user selects a particular item of the combobox, I was expecting that the ViewModel's SelectedBloodGroupIndex property will update itself to the currently selected item of combobox, but this doesn't happen either. The ViewModel property is never invoked(both set and get). Any reasons why binding is failing for the above code.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eUpdate\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;UserControl.Resources\u0026gt;\n \u0026lt;ObjectDataProvider x:Key=\"BloodGroupEnum\" MethodName=\"GetValues\" ObjectType=\"{x:Type sys:Enum}\"\u0026gt;\n \u0026lt;ObjectDataProvider.MethodParameters\u0026gt;\n \u0026lt;x:Type TypeName=\"enums:BloodGroup\" /\u0026gt;\n \u0026lt;/ObjectDataProvider.MethodParameters\u0026gt;\n \u0026lt;/ObjectDataProvider\u0026gt;\n\u0026lt;/UserControl.Resources\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"7","creation_date":"2012-11-15 00:44:56.417 UTC","last_activity_date":"2012-11-15 07:54:46.737 UTC","last_edit_date":"2012-11-15 02:14:31.41 UTC","last_editor_display_name":"","last_editor_user_id":"861902","owner_display_name":"","owner_user_id":"861902","post_type_id":"1","score":"1","tags":"wpf|wpf-4.0","view_count":"7945"} +{"id":"8752367","title":"Control speed of TextToSpeech (TTS)","body":"\u003cp\u003eIs there any way I can have greater control over \"how\" the TTS is saying instead of \"what\" it is saying?\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003epitch\u003c/li\u003e\n\u003cli\u003espeed of pronunciation \u003c/li\u003e\n\u003cli\u003emale/female\u003c/li\u003e\n\u003cli\u003eany other options?\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003e\u003ca href=\"http://developer.android.com/reference/android/speech/tts/TextToSpeech.html\" rel=\"noreferrer\"\u003eThe API comes up short\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"13384426","answer_count":"2","comment_count":"0","creation_date":"2012-01-06 01:34:38.173 UTC","favorite_count":"2","last_activity_date":"2015-12-18 09:50:19.787 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"855984","post_type_id":"1","score":"7","tags":"android","view_count":"7663"} +{"id":"7704881","title":"Filter DirectoryInfo files by date in asp.net","body":"\u003cp\u003eI am populating a datagrid control using files in a specified path (DirectoryInfo).\u003cbr\u003e\nI would like to filter the files based on a user specified date range (start date \u0026amp; end date). \u003c/p\u003e\n\n\u003cp\u003eWhile search S/O, I found \u003ca href=\"https://stackoverflow.com/questions/52842/sorting-directory-getfiles\"\u003ethis\u003c/a\u003e post, but I am getting an error on DateComparer (\u003cstrong\u003e\"'DateComparer' is a type and cannot be used as an expression.\"\u003c/strong\u003e) \u003c/p\u003e\n\n\u003cp\u003eAny other suggestions on how to filter by date?\u003c/p\u003e\n\n\u003cp\u003eHere is my code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Dim dirInfo As New DirectoryInfo(strDirectoryPath)\n Dim dStartDate As DateTime = \"03/01/2011\"\n Dim dEndDate As DateTime = \"6/30/2011\"\n Dim Files As FileInfo = dirInfo.GetFiles().Where(Function(Files) Files.CreationTime \u0026gt;= (dStartDate) AndAlso Files.CreationTime \u0026lt;= dEndDate)\n\n datagrid.DataSource = Files\n datagrid.DataBind()\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"7704905","answer_count":"1","comment_count":"0","creation_date":"2011-10-09 16:31:09.073 UTC","favorite_count":"2","last_activity_date":"2011-10-09 17:12:58.867 UTC","last_edit_date":"2017-05-23 09:59:41.137 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"371267","post_type_id":"1","score":"3","tags":"asp.net|vb.net|date|datagrid|directoryinfo","view_count":"3766"} +{"id":"8592053","title":"Using fetchrow_hashref to store data","body":"\u003cp\u003eI am trying to take information out of a MySQL database, which I will then manipulate in perl:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003euse strict;\nuse DBI;\n\nmy $dbh_m= DBI-\u0026gt;connect(\"dbi:mysql:Populationdb\",\"root\",\"LisaUni\") \nor die(\"Error: $DBI::errstr\");\n\nmy $Genotype = 'Genotype'.1;\n#The idea here is eventually I will ask the database how many Genotypes there are, and then loop it round to complete the following for each Genotype:\n\nmy $sql =qq(SELECT TransNo, gene.Gene FROM gene JOIN genotypegene ON gene.Gene = genotypegene.Gene WHERE Genotype like '$Genotype');\nmy $sth = $dbh_m-\u0026gt; prepare($sql);\n$sth-\u0026gt;execute;\n\nmy %hash;\n\nmy $transvalues = $sth-\u0026gt;fetchrow_hashref;\nmy %hash= %$transvalues;\n\n$sth -\u0026gt;finish();\n$dbh_m-\u0026gt;disconnect(); \n\nmy $key;\nmy $value;\n\nwhile (($key, $value) = each(%hash)){\n print $key.\", \".$value\\n; }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis code doesn't produce any errors, but the %hash only stores the last row taken from the database (I got the idea of writing it this way from \u003ca href=\"http://www.perlmonks.org/?node_id=194072\" rel=\"nofollow\"\u003ethis website\u003c/a\u003e). If I type:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ewhile(my $transvalues = $sth-\u0026gt;fetchrow_hashref){\nprint \"Gene: $transvalues-\u0026gt;{Gene}\\n\";\nprint \"Trans: $transvalues-\u0026gt;{TransNo}\\n\";\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThen it does print off all the rows, but I need all this information to be available once I've closed the connection to the database. \u003c/p\u003e\n\n\u003cp\u003eI also have a related question: in my MySQL database the row consists of e.g 'Gene1'(Gene) '4'(TransNo). Once I have taken this data out of the database as I am doing above, will the TransNo still know which Gene it is associated with? Or do I need to create some kind of hash of hash structure for that?\u003c/p\u003e","accepted_answer_id":"8592211","answer_count":"1","comment_count":"1","creation_date":"2011-12-21 15:15:42.3 UTC","favorite_count":"1","last_activity_date":"2011-12-21 15:26:46.577 UTC","last_edit_date":"2011-12-21 15:17:51.31 UTC","last_editor_display_name":"","last_editor_user_id":"110707","owner_display_name":"","owner_user_id":"1029943","post_type_id":"1","score":"4","tags":"mysql|perl|hash","view_count":"5558"} +{"id":"12587010","title":"HTML lists : \"embedding\" the bullet in the LI blocks","body":"\u003cp\u003eCan UL/OL list bullets be embedded in the text of the LI so that instead of having two columns (left column with bullets and right column with text) there would be one single column with the text of the first line of each LI starting a few characters after the bullet ?\u003c/p\u003e","accepted_answer_id":"12587103","answer_count":"1","comment_count":"0","creation_date":"2012-09-25 16:16:44.907 UTC","last_activity_date":"2013-10-30 10:01:05.543 UTC","last_edit_date":"2013-10-30 10:01:05.543 UTC","last_editor_display_name":"","last_editor_user_id":"352672","owner_display_name":"","owner_user_id":"871404","post_type_id":"1","score":"1","tags":"html|css|html-lists","view_count":"117"} +{"id":"35781306","title":"Floating point number precision or algorithmic error in JavaScript","body":"\u003cp\u003eI tried to implement in JavaScript rotation around point, using rotation matrix, but for some reason I got some unexpected results - instead of moving around a point, my figure was moving along a line. Here I provide completely reproducible example, which demonstrates that after rotation distance between a rotating point and the center changes. Here it is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar alpha = 0.10146071845187077;\nvar cos_ = Math.cos(alpha);\nvar sin_ = Math.sin(alpha);\nvar center = [4861165.687852355,7606554.432771027];\nvar pointBefore = [4847712.770874163, 7610682.032298427];\nvar dist1, dist2, x1, y1, x2, y2, pointAfter = [];\n// 1. substract + 2. rotate + 3. get back\n// 1.\nx1 = pointBefore[0] - center[0];\ny1 = pointBefore[1] - center[1];\n// 2.\nx2 = cos_ * x1 - sin_ * y1;\ny2 = sin_ * x1 + cos_ * y1;\n// 3.\npointAfter[0] = x2 + center[0];\npointAfter[1] = y2 + center[1];\n// Check distances\ndist1 = Math.sqrt(Math.pow(x1, 2) + Math.pow(y1, 2));\ndist2 = Math.sqrt(Math.pow(pointAfter[0] - center[0], 2) + \n Math.pow(pointAfter[1] - center[1], 2));\nconsole.log(JSON.stringify({dist1: dist1, dist2: dist2}));\n// -\u0026gt; {\"dist1\":14071.888753138577,\"dist2\":14071.88875313881}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI hope, I made some errors in math, but I cannot see them. \u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2016-03-03 19:29:53.3 UTC","last_activity_date":"2016-03-03 20:51:27.097 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2544036","post_type_id":"1","score":"0","tags":"javascript","view_count":"34"} +{"id":"34006963","title":"Cardinality of a relationship","body":"\u003cp\u003eI've created an Entity Relationship Diagram for a Database of an hospital where there is a relationship 'Work' between 'Doctor' and 'Department'. This relationship has the key attribute 'Date' in addition to the identifiers of the relations 'Doctor' and 'Department'. \u003c/p\u003e\n\n\u003cp\u003eThe problem is that in general a doctor can work in more departments (for example cardiology, surgery, pediatrics...) but only in one a day (for example if the doctor in the date X works in cardiology, he can't work in other departments in the same date). \u003c/p\u003e\n\n\u003cp\u003eWhat is the cardinality of this relationship? \u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eDOCTOR ---(1,1)--WORK--(1,N)--- DEPARTMENT\nOR\u003c/li\u003e\n\u003cli\u003eDOCTOR ---(1,N)--WORK--(1,N)--- DEPARTMENT \u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003escilicet, the attribute 'Date' affects cardinality?\u003c/p\u003e","accepted_answer_id":"34010926","answer_count":"1","comment_count":"0","creation_date":"2015-11-30 20:02:52.997 UTC","last_activity_date":"2015-12-01 01:09:22.263 UTC","last_edit_date":"2015-12-01 00:58:31.513 UTC","last_editor_display_name":"","last_editor_user_id":"2686013","owner_display_name":"","owner_user_id":"5601930","post_type_id":"1","score":"0","tags":"sql|database|entity-relationship|cardinality","view_count":"57"} +{"id":"13186235","title":"Ruby on Rails: wrong number of arguments (3 for 2)","body":"\u003cp\u003eFor some reason I am getting an error on this method when I am trying to add a record.\nThe specific error is \nwrong number of arguments (3 for 2)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e def addrecord\n res=MultiGeocoder.geocode(params[:street], params[:city], params[:state])\n lat, lng = res.ll.split(\",\") \n Bathroom.create(:name =\u0026gt;params[:name],\n :bathroomtype =\u0026gt;params[:bathroomtype],\n :street =\u0026gt;params[:street],\n :city =\u0026gt;params[:city],\n :state =\u0026gt;params[:state],\n :country =\u0026gt;params[:country],\n :postal =\u0026gt;params[:postal],\n :lat =\u0026gt; lat,\n :lon =\u0026gt; lng,\n :access =\u0026gt;params[:access], \n :directions =\u0026gt;params[:directions],\n :comment =\u0026gt;params[:comment],\n :created =\u0026gt; Time.now,\n :source =\u0026gt; 'Squat',\n :avail =\u0026gt;params[:avail] )\n respond_to do |format|\n format.json { render :nothing =\u0026gt; true } \n\n end\n\n end\n\n This is an example call...\n\n\u0026gt; http:..../bathrooms/addrecord?name=Apple%20Store\u0026amp;bathroomtype=1\u0026amp;street=One%20Stockton%20St.\u0026amp;city=San%20Francisco\u0026amp;state=CA\u0026amp;country=United%20States\u0026amp;postal=94108\u0026amp;access=0\u0026amp;directions=\u0026amp;comment=\u0026amp;avail=0\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is the request parms:\u003c/p\u003e\n\n\u003cp\u003eRequest\u003c/p\u003e\n\n\u003cp\u003eParameters:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\"city\"=\u0026gt;\"San Francisco\",\n \"avail\"=\u0026gt;\"0\",\n \"access\"=\u0026gt;\"0\",\n \"bathroomtype\"=\u0026gt;\"1\",\n \"comment\"=\u0026gt;\"\",\n \"country\"=\u0026gt;\"United States\",\n \"directions\"=\u0026gt;\"\",\n \"name\"=\u0026gt;\"Apple Store\",\n \"street\"=\u0026gt;\"One Stockton St.\",\n \"postal\"=\u0026gt;\"94108\",\n \"state\"=\u0026gt;\"CA\"}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat am I missing?\u003c/p\u003e\n\n\u003cp\u003eAny help appreciated.\u003c/p\u003e","accepted_answer_id":"13186331","answer_count":"2","comment_count":"0","creation_date":"2012-11-01 22:05:14.157 UTC","last_activity_date":"2012-11-01 22:13:27.35 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1337145","post_type_id":"1","score":"0","tags":"ruby-on-rails","view_count":"548"} +{"id":"39137982","title":"flex / bison : how can I switch two lexers on same input file","body":"\u003cp\u003eHow can I handover an open file e.g. read by another scanner to the next scanner - and give it to the parser ?\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2016-08-25 06:17:42.82 UTC","last_activity_date":"2016-08-27 22:39:19.213 UTC","last_edit_date":"2016-08-26 09:31:59.613 UTC","last_editor_display_name":"","last_editor_user_id":"4370109","owner_display_name":"","owner_user_id":"5159681","post_type_id":"1","score":"0","tags":"bison|flex-lexer|yacc|lex","view_count":"171"} +{"id":"47124935","title":"VHDL signal assignment within a process not behaving correctly?","body":"\u003cp\u003eHere's the code I'm running\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003earchitecture arch of func\nsignal sig_s1: std_logic;\nbegin\nprocess(d1,d2,d3)\n begin\n sig_s1 \u0026lt;= d1 and d2;\n res2 \u0026lt;= sig_s1 xor d3;\n end process;\nend arch;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eYou would expect that \u003cstrong\u003eres2\u003c/strong\u003e would always use the previous value of \u003cstrong\u003esig_s1\u003c/strong\u003e, but in simulation it's working with the updated ones, as if this was a sequential code. What gives?\u003c/p\u003e\n\n\u003cp\u003eHere's the waveform \u003ca href=\"https://i.imgur.com/SezncCS.jpg\" rel=\"nofollow noreferrer\"\u003ehttps://i.imgur.com/SezncCS.jpg\u003c/a\u003e (res1 is the result if I used variable instead of the signal for sig_s1). I don't know how benchmarks work.\u003c/p\u003e","answer_count":"1","comment_count":"8","creation_date":"2017-11-05 18:14:13.343 UTC","last_activity_date":"2017-11-06 09:18:58.583 UTC","last_edit_date":"2017-11-05 20:07:00.313 UTC","last_editor_display_name":"","last_editor_user_id":"4644286","owner_display_name":"","owner_user_id":"4644286","post_type_id":"1","score":"0","tags":"vhdl","view_count":"52"} +{"id":"38343350","title":"How to merge UIView from \"snapshotViewAfterScreenUpdates\" and create Video","body":"\u003cp\u003eIs there any way to merge all UIView returned from function \"snapshotViewAfterScreenUpdates\" and create a video from them?\u003c/p\u003e\n\n\u003cp\u003eCurrently i am taking screenshot of screen in Timer event using below code\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etimer = NSTimer.scheduledTimerWithTimeInterval(0.10, target: self, selector: NSSelectorFromString(\"screenshotTimerEvent\"), userInfo: nil, repeats: true)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e// Timer event function to capture screenshot and add in Array\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunc screenshotTimerEvent()\n{\n self.arrImagesScreenShots.addObject(self.view.snapshotViewAfterScreenUpdates(true))\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThen after that when the recording is stopped i use below code to show all those screenshots as a video.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etimer = NSTimer.scheduledTimerWithTimeInterval(0.10, target: self, selector: NSSelectorFromString(\"showImages\"), userInfo: nil, repeats: true)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e// In this function i am adding uiview from start to end so it shows like a video is playing\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunc showImages()\n{\n oldView.removeFromSuperview()\n if(arrImagesScreenShots.count \u0026gt; count)\n {\n oldView = arrImagesScreenShots.objectAtIndex(count) as! UIView\n self.view.addSubview(oldView)\n count += 1\n }\n else\n {\n timer.invalidate()\n count = 0\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am not sure if this is the best way to do it but for now its working.\nNext thing i want is to merge these UIView into a video and upload to server.\u003c/p\u003e\n\n\u003cp\u003eIs there any way?\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2016-07-13 05:32:51.417 UTC","last_activity_date":"2016-07-13 05:32:51.417 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6578092","post_type_id":"1","score":"1","tags":"ios|swift|screenshot","view_count":"83"} +{"id":"44152964","title":"Does all of three: Presto, hive and impala support Avro data format?","body":"\u003cp\u003eI am clear about the Serde available in Hive to support Avro schema for data formats. Comfortable in using avro with hive.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://cwiki.apache.org/confluence/display/Hive/AvroSerDe\" rel=\"nofollow noreferrer\"\u003eAvroSerDe\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003efor say, I have found this issue against presto.\n\u003ca href=\"https://github.com/prestodb/presto/issues/5009\" rel=\"nofollow noreferrer\"\u003ehttps://github.com/prestodb/presto/issues/5009\u003c/a\u003e \u003c/p\u003e\n\n\u003cp\u003eI need to choose components for fast execution cycle. Presto and impala provide much smaller execution cycle.\nSo, Anyone please let me clarify that which would be better in different data formats.\nPrimarily, I am looking for avro support with Presto now.\u003c/p\u003e\n\n\u003cp\u003eHowever, lets consider following data formats stored on HDFS:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eAvro format\u003c/li\u003e\n\u003cli\u003eParquet format\u003c/li\u003e\n\u003cli\u003eOrc format\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eWhich is the best to use with high performance on different data formats.\n?? please suggest.\u003c/p\u003e","answer_count":"1","comment_count":"7","creation_date":"2017-05-24 08:26:43.283 UTC","last_activity_date":"2017-06-04 10:29:42.957 UTC","last_edit_date":"2017-06-01 05:36:11.21 UTC","last_editor_display_name":"","last_editor_user_id":"3581507","owner_display_name":"","owner_user_id":"3581507","post_type_id":"1","score":"0","tags":"hadoop|hive|impala|presto","view_count":"128"} +{"id":"16768745","title":"Jquery donut chart customisation","body":"\u003cp\u003eHi I am trying to replicate the below image:\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/6rn80.jpg\" alt=\"Donut Chart\"\u003e\u003c/p\u003e\n\n\u003cp\u003eI have found a plugin which will almost replicate and I have tried to customise it to style and add the inner text. I cannot seem to style it as below. I have tried to apply the color property to the series but this is not working. I am not sure if the colorScheme property is overriding but I am stuck at the moment.\u003c/p\u003e\n\n\u003cp\u003eHere is what I have tried: \u003ca href=\"http://jsfiddle.net/ux68H/261/\" rel=\"nofollow noreferrer\"\u003ejsFiddle\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eand the code is below:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar data = [\n {Responses: \"Accepted\", Share: 33.3},\n {Responses: \"Unresponded\", Share: 26.5},\n {Responses: \"Rejected\", Share: 25.4}\n]\n\n// prepare chart data as an array\nvar source =\n{\n datatype: \"array\",\n datafields: [\n { name: 'Responses' },\n { name: 'Share' }\n ],\n localdata: data\n};\n\nvar dataAdapter = new $.jqx.dataAdapter(source, { async: false, autoBind: true, loadError: function (xhr, status, error) { alert('Error loading \"' + source.url + '\" : ' + error); } });\n\n// prepare jqxChart settings\nvar settings = {\n title: \"Geoff's Birthday Party\",\n description: \"\",\n enableAnimations: true,\n showLegend: false,\n legendPosition: { left: 520, top: 140, width: 100, height: 100 },\n padding: { left: 5, top: 5, right: 5, bottom: 5 },\n titlePadding: { left: 0, top: 0, right: 0, bottom: 10 },\n source: dataAdapter,\n colorScheme: 'scheme13',\n seriesGroups:\n [\n {\n type: 'donut',\n showLabels: false,\n series:\n [\n {\n dataField: 'Share',\n displayText: 'Responses',\n labelRadius: 100,\n initialAngle: 15,\n radius: 130,\n innerRadius: 90,\n centerOffset: 0,\n formatSettings: {decimalPlaces:1 },\n color:'#00000'\n }\n ]\n }\n ]\n};\n\n// setup the chart\n$('#jqxChart').jqxChart(settings);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks in advance\u003c/p\u003e","accepted_answer_id":"17375458","answer_count":"1","comment_count":"1","creation_date":"2013-05-27 07:59:02.953 UTC","last_activity_date":"2015-03-30 08:49:08.3 UTC","last_edit_date":"2013-06-28 23:55:52.227 UTC","last_editor_display_name":"","last_editor_user_id":"1645769","owner_display_name":"","owner_user_id":"1401320","post_type_id":"1","score":"1","tags":"jquery|html|css|jquery-widgets","view_count":"2336"} +{"id":"33996993","title":"Store variable from input box and display value in p tag","body":"\u003cp\u003eI am trying to take a value from a text input box then then display it on the screen. \u003c/p\u003e\n\n\u003cp\u003eI have this block of JS acting on the following HTML\u003c/p\u003e\n\n\u003cp\u003e\u003cdiv class=\"snippet\" data-lang=\"js\" data-hide=\"false\"\u003e\r\n\u003cdiv class=\"snippet-code\"\u003e\r\n\u003cpre class=\"snippet-code-js lang-js prettyprint-override\"\u003e\u003ccode\u003e$(\".button\").click(function(){\r\n var userName = $('#userNameInput').val();\r\n $('.userDisplay').html(userName);\r\n});\u003c/code\u003e\u003c/pre\u003e\r\n\u003cpre class=\"snippet-code-html lang-html prettyprint-override\"\u003e\u003ccode\u003e\u0026lt;input type=\"text\" id=\"userNameInput\"\u0026gt;\r\n\u0026lt;input value=\"submit\" class=\"button closepopup\" type=\"button\"\u0026gt;\r\n\u0026lt;p id=\"userDisplay\"\u0026gt;default\u0026lt;/p\u0026gt;\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003c/p\u003e\n\n\u003cp\u003eCurrently the program doesn't print the value, but it does store it, as I can print the value to console.\u003c/p\u003e","accepted_answer_id":"33997032","answer_count":"3","comment_count":"0","creation_date":"2015-11-30 10:57:10.833 UTC","last_activity_date":"2015-11-30 13:05:53.28 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5599746","post_type_id":"1","score":"3","tags":"javascript|jquery|html","view_count":"728"} +{"id":"39828260","title":"I need to create a list containing all the sums of a list taken three at a time, ie, add first 3 elements then the next 3","body":"\u003cp\u003eI need to add the first three elements of a list then add the next three elements of a list and so forth. This is the code I have got so far:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef get_triple_sums_list(a_list):\n new_list = []\n for numbers in range(0,len(a_list)):\n numbers = sum(a_list[:3])\n new_list.append(numbers)\n return new_list\n if a_list == []:\n return []\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFor the list:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e [1, 5, 3, 4, 5, 2]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis in turn gives me the result:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[9]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI need to get\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[9, 11]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf the remaining numbers is less than 3, it gives me the remainder of the sum ie,\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[1, 6, 2, 4, 3]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eGives me\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[9, 7]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[1, 6, 2, 4]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eGive me\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[9, 4]\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"39828367","answer_count":"6","comment_count":"0","creation_date":"2016-10-03 09:21:47.73 UTC","last_activity_date":"2016-10-03 10:06:48.05 UTC","last_edit_date":"2016-10-03 09:33:47.957 UTC","last_editor_display_name":"","last_editor_user_id":"4099593","owner_display_name":"","owner_user_id":"6052855","post_type_id":"1","score":"2","tags":"python|list|python-3.x","view_count":"59"} +{"id":"41062260","title":"rvest - scraping links from a webpage","body":"\u003cp\u003eI have created this dataframe through rvest:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e## 00. Pick the webpage\nFAO_Countries \u0026lt;- read_html(\"http://www.fao.org/countryprofiles/en/\")\n\n\n## 01. Get the urls I am interested in\nFAO_Countries_urls \u0026lt;- FAO_Countries %\u0026gt;% \nhtml_nodes(\".linkcountry\") %\u0026gt;% \nhtml_attr(\"href\")\n\n\n## 02. Get the links I am interested in\nFAO_Countries_links \u0026lt;- FAO_Countries %\u0026gt;%\nhtml_nodes(\".linkcountry\") %\u0026gt;% \nhtml_text()\n\n\n## 03. Prepare the complete urls\nurl \u0026lt;- \"http://www.fao.org\"\n\n\n## 04. Create a dataframe\nFAO_Countries_data \u0026lt;- data.frame(FAO_Countries_links =FAO_Countries_links,\n FAO_Countries_urls = paste0(url,FAO_Countries_urls), \n stringsAsFactors = FALSE)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOk. Ath this point, the result I get is this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026gt; head(FAO_Countries_data, n=4) \n FAO_Countries_links FAO_Countries_urls\n\n 1 Afghanistan http://www.fao.org/countryprofiles/en/?iso3=AFG\n 2 Albania http://www.fao.org/countryprofiles/en/?iso3=ALB\n 3 Algeria http://www.fao.org/countryprofiles/en/?iso3=DZA\n 4 Andorra http://www.fao.org/countryprofiles/en/?iso3=AND\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd so on. \nAny of the urls leads to a page in which there is a common element with the other ones. As a matter of fact, any Country is analysed the same way. \nI would be interested in \"Food security\".\nIn order to collect info, I would create some new variable. \nThe most urgent one would be, indeed, \"Food security caught from any urls.\nFinally, the dataframe should appear as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026gt; head(FAO_Countries_data, n=4) \n FAO_Countries_links FAO_Countries_urls Food_Sec \n 1 Afghanistan http://www.fao.org/countryprofiles... BLABLA\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn fact, I should be able - I suppose - to get those urls from the dataframe's variable \"FAO_Countries_urls\" as real urls and then scrape them. Or maybe there is another way out. \nThanks in advance for any suggestion.\u003c/p\u003e\n\n\u003cp\u003eP.S: Yes, I am using 'Selectorgadget'\u003c/p\u003e","answer_count":"0","comment_count":"7","creation_date":"2016-12-09 14:06:52.507 UTC","last_activity_date":"2016-12-09 15:18:24.13 UTC","last_edit_date":"2016-12-09 15:18:24.13 UTC","last_editor_display_name":"","last_editor_user_id":"5644086","owner_display_name":"","owner_user_id":"5644086","post_type_id":"1","score":"0","tags":"r|url|web-scraping","view_count":"76"} +{"id":"41905868","title":"`std::any_cast` returns a copy","body":"\u003cp\u003eI was reading the \u003ca href=\"http://en.cppreference.com/w/cpp/utility/any/any_cast\" rel=\"nofollow noreferrer\"\u003edocumentation for \u003ccode\u003estd::any_cast\u003c/code\u003e\u003c/a\u003e and I find it strange that the API has the cast either return a value to the held object or a pointer to it. Why not return a reference? A copy needs to be made every time the function is called with a non pointer type argument.\u003c/p\u003e\n\n\u003cp\u003eI can see that the pointer version of the cast might signal intentions a bit more and might be a bit more clear but why not have the value returned be a reference like this? \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etemplate\u0026lt;typename ValueType\u0026gt;\nValueType\u0026amp; any_cast(any* operand);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003einstead of \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etemplate \u0026lt;typename ValueType\u0026gt;\nValueType* any_cast(any* operand);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFurther it seems like even if you ask for a reference the cast removes the reference and returns a copy to the stored object see the explanations for the return values for function overloads 1-3 here \u003ca href=\"http://en.cppreference.com/w/cpp/utility/any/any_cast\" rel=\"nofollow noreferrer\"\u003ehttp://en.cppreference.com/w/cpp/utility/any/any_cast\u003c/a\u003e \u003c/p\u003e","accepted_answer_id":"41905929","answer_count":"1","comment_count":"8","creation_date":"2017-01-28 02:50:49.213 UTC","favorite_count":"1","last_activity_date":"2017-01-28 03:10:55.727 UTC","last_edit_date":"2017-01-28 03:10:55.727 UTC","last_editor_display_name":"","last_editor_user_id":"5501675","owner_display_name":"","owner_user_id":"5501675","post_type_id":"1","score":"2","tags":"c++|c++1z|stdany","view_count":"152"} +{"id":"4287112","title":"How to get http response code from browser activity?","body":"\u003cp\u003eIs there a way to get HTTP response code from Browser activity launched from another Android application?\u003c/p\u003e\n\n\u003cp\u003eSince I haven't found any occurrences of \"setResult\" string in BrowserActivity source code, I assume startActivityForResult won't do much.\u003c/p\u003e\n\n\u003cp\u003eIf not I'll probably stick with HEAD request from my activity.\u003c/p\u003e","accepted_answer_id":"4288245","answer_count":"1","comment_count":"0","creation_date":"2010-11-26 16:46:22.703 UTC","last_activity_date":"2010-11-26 20:03:29.16 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"521590","post_type_id":"1","score":"1","tags":"android|http|browser|networking","view_count":"771"} +{"id":"36921433","title":"SQL Server: Selecting rows based on multiple conditions within the same unique ID","body":"\u003cp\u003eI am trying to select rows in an SQL table based on multiple conditions within the same unique ID.\u003c/p\u003e\n\n\u003cp\u003eI have the following table:\u003c/p\u003e\n\n\u003cp\u003eID\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;Status\u003cbr\u003e\n1\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;AS\u003cbr\u003e\n2\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;Rec\u003cbr\u003e\n2\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;AS\u003cbr\u003e\u003c/p\u003e\n\n\u003cp\u003eThe rules are as follows:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003cp\u003eIf an [ID] has both 'Rec' and 'AS', select only the row with 'Rec'. In other words, 'Rec' has precedence over 'AS'.\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eIf the [ID] does not have 'Rec', select the row with 'AS'.\u003c/p\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eI want the query to output only the rows \u003ccode\u003eID=1,Status=AS\u003c/code\u003e and \u003ccode\u003eID=2,Status=Rec\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eWhat is the query to select \u003cstrong\u003eonly\u003c/strong\u003e these two rows?\u003c/p\u003e","answer_count":"3","comment_count":"0","creation_date":"2016-04-28 17:19:52.127 UTC","last_activity_date":"2016-04-28 21:46:10.723 UTC","last_edit_date":"2016-04-28 17:23:25.787 UTC","last_editor_display_name":"","last_editor_user_id":"6267635","owner_display_name":"","owner_user_id":"6267635","post_type_id":"1","score":"0","tags":"sql|sql-server|reporting-services","view_count":"125"} +{"id":"7757816","title":"Taking App data backup from Windows Phone","body":"\u003cp\u003eMy Windows Phone app doesn't have a service hosted but I would like to give the user an option to download/backup all the information(Just say note taking app) to another device or PC. How can we do that? Email attachment is an option but is there any other way?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2011-10-13 17:11:17.023 UTC","favorite_count":"1","last_activity_date":"2011-10-13 17:47:38.36 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"8091","post_type_id":"1","score":"1","tags":"windows-phone-7","view_count":"353"} +{"id":"29299987","title":"Visual Studio 2013 Update 4: Floating windows focus / Close all documents","body":"\u003cp\u003eVisual Studio 2013 Update 4 - I have two monitors attached to my system.\u003c/p\u003e\n\n\u003cp\u003eLet's say you drag a couple of windows out to the second monitor so you have a few tabs open there. So something like this:\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/DtuLX.png\" alt=\"Visual Studio Two Monitors\"\u003e\u003c/p\u003e\n\n\u003cp\u003eLet's say I then get a Chrome browser window instance open and drag that to my second monitor, so that I see Visual Studio on my left screen and Chrome on my right.\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/XfrZ5.png\" alt=\"Visual Studio on the Left. Chrome on the Right\"\u003e\u003c/p\u003e\n\n\u003cp\u003eWhen I then click back into Visual Studio on my left monitor, it hides Chrome and displays the other open tabs on the left Monitor. So I'm back at this, and can't see Chrome any more:\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/DtuLX.png\" alt=\"Visual Studio Two Monitors\"\u003e\u003c/p\u003e\n\n\u003cp\u003eIt's very frustrating if I want to have a browser open because I'm looking at a solution to a problem and want a reference (or say MSDN open and coding on my main screen). The only solution that I have is to close all my tabs or bring them back to my main window to be working in Visual Studio and have something else on the other monitor.\u003c/p\u003e\n\n\u003cp\u003eI've been using Visual Studio 2013 at a previous employment several months ago, and I started my current job about 8 weeks ago. I don't remember this frustrating me at my old job and had the same setup there, so I'm wondering if there's some setting or something different - is there something I can tweak, so that when I have code in the second window, and click code in the primary window?\u003c/p\u003e\n\n\u003cp\u003eOn an aside, I'm also 99.99% sure that I used to be able to \"Close all Windows\" by right clicking a tab, and it closed only the code windows in the active set / monitor I was looking at. At the moment, it just goes ahead and closes \u003cem\u003eeverything\u003c/em\u003e on both monitors. As the command says I suppose, but I'm just \u003cem\u003epositive\u003c/em\u003e I remember different behaviour in the past...\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2015-03-27 11:47:48.1 UTC","last_activity_date":"2015-03-27 12:00:04.817 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"270392","post_type_id":"1","score":"0","tags":"visual-studio-2013","view_count":"157"} +{"id":"14307878","title":"Bit field manipulation","body":"\u003cp\u003eIn the following code\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;iostream\u0026gt;\n\nusing namespace std;\nstruct field\n{\n unsigned first : 5;\n unsigned second : 9;\n};\nint main()\n{\n union\n {\n field word;\n int i;\n };\n i = 0;\n cout\u0026lt;\u0026lt;\"First is : \"\u0026lt;\u0026lt;word.first\u0026lt;\u0026lt;\" Second is : \"\u0026lt;\u0026lt;word.second\u0026lt;\u0026lt;\" I is \"\u0026lt;\u0026lt;i\u0026lt;\u0026lt;\"\\n\";\n word.first = 2;\n cout\u0026lt;\u0026lt;\"First is : \"\u0026lt;\u0026lt;word.first\u0026lt;\u0026lt;\" Second is : \"\u0026lt;\u0026lt;word.second\u0026lt;\u0026lt;\" I is \"\u0026lt;\u0026lt;i\u0026lt;\u0026lt;\"\\n\";\n return 0;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhen I initialize word.first = 2, as expected it updates 5-bits of the word, and gives the desired output. It is the output of 'i' that is a bit confusing. With word.first = 2, i gives output as 2, and when I do word.second = 2, output for i is 64. Since, they share the same memory block, shouldnt the output (for i) in the latter case be 2?\u003c/p\u003e","accepted_answer_id":"14307895","answer_count":"2","comment_count":"0","creation_date":"2013-01-13 20:35:44.217 UTC","favorite_count":"1","last_activity_date":"2013-01-13 20:47:58.593 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1319819","post_type_id":"1","score":"2","tags":"c++|bit-fields","view_count":"166"} +{"id":"38371460","title":"Amcharts add Euro symbol to value in balloon","body":"\u003cp\u003eThis is my Json response, I can't figure out how I can add Euro symbol to my values. Ofcourse this is an idea of response and not the actual array that is being sent.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\"graphAxis\":[{\"valueAxis\":\"v0\",\"lineColor\":\"#00969e\",\"bullet\":\"round\",\"bulletBorderAlpha\":1,\"bulletSize\":\"8\",\"bulletBorderThickness\":1,\"bulletColor\":\"#FFFFFF\",\"lineThickness\":\"2\",\"hideBulletsCount\":\"50\",\"title\":\"Prolongatie brandstoftermijn\",\"valueField\":\"Prolongatie brandstoftermijn\",\"costTypeId\":15,\"useLineColorForBulletBorder\":true}],\"dataProvider\":[{\"Prolongatie brandstoftermijn\":4163.82,\"date\":\"2016-01-01\"},{\"Prolongatie brandstoftermijn\":7297.77,\"date\":\"2016-02-01\"},{\"Prolongatie brandstoftermijn\":7297.77,\"date\":\"2016-03-01\"},{\"Prolongatie brandstoftermijn\":162.43,\"date\":\"2016-04-01\"}]}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCan anyone provide any inputs on how to add Eur symbol to balloon text\u003c/p\u003e\n\n\u003cp\u003eThis is my code in js file\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e//ajax request to show graph\n $(\"#diaplayGraph\").click(function(event) { \n\n event.preventDefault(); \n $.ajax\n ({ \n url: $(\"#frmCostViewGraph\").attr('action'),\n data: $(\"#frmCostViewGraph\").serialize(),\n type: 'post',\n beforeSend: function( xhr ) {\n var message = '';\n var selectedCostAllocations = $(\"#costAllocations\").val();\n var selectedCostTypes = $(\"#costTypes\").val(); \n\n if(selectedCostAllocations == null) {\n\n errorMessage($(\"#costAllocationError\").html()); \n return false;\n }\n\n if(selectedCostTypes == null) {\n\n errorMessage($(\"#costTypeError\").html());\n return false;\n }\n\n if($('input[name=reportType]:checked').length\u0026lt;=0)\n {\n errorMessage($(\"#reportTypeError\").html()); \n return false\n }\n\n showLoading();\n }, \n\n dataType:\"JSON\",\n success: function(result)\n {\n\n hideMessage();\n chartData = result.dataProvider;\n graphAxis = result.graphAxis;\n\n if(chartData == '') {\n\n $(\"#chartdiv\").html($(\"#noRecordFound\").html());\n hideLoading();\n return false;\n }\n\n\n var chart = AmCharts.makeChart(\"chartdiv\", {\n \"fontFamily\": \"Helvetica Neue,Helvetica,Arial,Open Sans,sans-serif\", \n \"fontSize\":12,\n \"type\": \"serial\",\n \"theme\": \"default\", \n \"mouseWheelZoomEnabled\":true,\n \"dataDateFormat\": \"YYYY-MM-DD\",\n \"valueAxes\": [{\n \"id\": \"v1\",\n \"axisAlpha\": 0,\n \"position\": \"left\",\n \"ignoreAxisWidth\":true\n }],\n \"balloon\": {\n \"borderThickness\": 1,\n \"shadowAlpha\": 0\n },\n \"legend\": {\n \"useGraphSettings\": false,\n },\n \"dataProvider\": chartData,\n \"graphs\":graphAxis,\n \"chartScrollbar\": {\n \"graph\": \"g1\",\n \"oppositeAxis\":false,\n \"offset\":30,\n \"scrollbarHeight\": 20,\n \"backgroundAlpha\": 0,\n \"selectedBackgroundAlpha\": 0.1,\n \"selectedBackgroundColor\": \"#888888\",\n \"graphFillAlpha\": 0,\n \"graphLineAlpha\": 0.5,\n \"selectedGraphFillAlpha\": 0,\n \"selectedGraphLineAlpha\": 1,\n \"autoGridCount\":true,\n \"color\":\"#AAAAAA\",\n \"autoGridCount\": true,\n \"resizeEnabled\":true\n },\n \"chartCursor\": { \n \"valueLineEnabled\": true,\n \"valueLineBalloonEnabled\": true,\n \"cursorAlpha\":1,\n \"cursorColor\":\"#258cbb\",\n \"limitToGraph\":\"g1\",\n \"valueLineAlpha\":0.2,\n \"valueZoomable\":true,\n \"cursorPosition\": \"mouse\",\n \"oneBalloonOnly\": true,\n \"categoryBalloonDateFormat\": \"DD-MMM-YYYY\"\n },\n \"valueScrollbar\":{\n \"oppositeAxis\":false,\n \"offset\":75,\n \"scrollbarHeight\":10,\n \"backgroundAlpha\":1, \n },\n \"valueAxes\": [{ \n \"axisColor\": \"#23272D\", \n \"axisAlpha\": 1,\n \"position\": \"left\",\n \"unit\": \"$\",\n \"unitPosition\": \"left\"\n }], \n \"categoryField\": \"date\",\n \"categoryAxis\": {\n \"parseDates\": true,\n \"dashLength\": 1,\n \"minorGridEnabled\": true,\n \"minPeriod\":\"MM\", \n \"axisColor\": \"#23272D\"\n },\n \"export\": {\n \"enabled\": true,\n },\n \"numberFormatter\": {\n \"precision\": -1,\n \"decimalSeparator\": \",\",\n \"thousandsSeparator\": \".\"\n },\n });\n\n\n chart.addListener(\"clickGraphItem\", handleClick);\n\n zoomChart();\n\n function zoomChart() {\n chart.zoomToIndexes(chart.dataProvider.length - 40, chart.dataProvider.length - 1);\n } \n\n hideLoading(); \n }\n });\n })\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"38371619","answer_count":"1","comment_count":"0","creation_date":"2016-07-14 10:13:28.873 UTC","favorite_count":"1","last_activity_date":"2016-07-14 11:34:16.197 UTC","last_edit_date":"2016-07-14 10:30:55.937 UTC","last_editor_display_name":"","last_editor_user_id":"2600068","owner_display_name":"","owner_user_id":"2600068","post_type_id":"1","score":"0","tags":"amcharts","view_count":"75"} +{"id":"6092243","title":"C# Check if a decimal has more than 3 decimal places?","body":"\u003cp\u003eI have a situation that I cannot change: one database table (table A) accepts 6 decimal places, while a related column in a different table (table B) only has 3 decimal places. \u003c/p\u003e\n\n\u003cp\u003eI need to copy from A to B, but if A has more than 3 decimal places the extra data will be lost. I cant change the table definition but I can add a workaround. So I'm trying to find out how to check if a decimal has more than 3 decimal places or not? \u003c/p\u003e\n\n\u003cp\u003eeg\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eTable A\nId, Qty, Unit(=6dp)\n1, 1, 0.00025\n2, 4000, 0.00025\n\nTable B\nId, TotalQty(=3dp)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to be able to find out if Qty * Unit from Table A has more than 3 decimals (row 1 would fail, row 2 would pass):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eif (CountDecimalPlaces(tableA.Qty * tableA.Unit) \u0026gt; 3)\n{\n return false;\n}\ntableB.TotalQty = tableA.Qty * tableA.Unit;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow would I implement the \u003ccode\u003eCountDecimalPlaces(decimal value) {}\u003c/code\u003e function?\u003c/p\u003e","accepted_answer_id":"6092298","answer_count":"12","comment_count":"0","creation_date":"2011-05-23 02:21:40.277 UTC","favorite_count":"1","last_activity_date":"2015-12-17 12:32:30.183 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"325727","post_type_id":"1","score":"10","tags":"c#|decimal","view_count":"25929"} +{"id":"20072977","title":"Not show any record in DataTable select method?","body":"\u003cp\u003eMy code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e DataTable dt = new DataTable();\n dt.Columns.Add(\"id\", typeof(int));\n dt.Columns.Add(\"name\", typeof(string));\n\n dt.Rows.Add(1, \"ali\");\n dt.Rows.Add(2, \"reza\");\n dt.Rows.Add(3, \"mehdi\");\n dt.Rows.Add(4, \"alireza\");\n dt.Rows.Add(4, \"amirali\");\n\n var result = dt.Select(\"name like '%ali%'\");\n GridView1.DataSource = result;\n GridView1.DataBind();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eProblem:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e not show any record in GridView\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"20073053","answer_count":"3","comment_count":"1","creation_date":"2013-11-19 13:35:21.67 UTC","last_activity_date":"2013-11-19 14:44:10.88 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"259554","post_type_id":"1","score":"-1","tags":"c#|asp.net|datatable","view_count":"133"} +{"id":"12570394","title":"How to use GLFW to poll for events in a libdispatch block?","body":"\u003cp\u003eFollowing up on the answer to \u003ca href=\"https://stackoverflow.com/q/12553563/64860\"\u003eHow to use GLUT with libdispatch?\u003c/a\u003e, I'm now using GLFW instead —\u003c/p\u003e\n\n\u003cp\u003eThe following code sets up a window, sets up a timer to poll for events, and, over time, enqueues render updates:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;dispatch/dispatch.h\u0026gt;\n#include \u0026lt;GL/glfw.h\u0026gt;\n\nfloat t=0;\n\nint main(void)\n{\n dispatch_async(dispatch_get_main_queue(), ^{\n glfwInit();\n glfwDisable(GLFW_AUTO_POLL_EVENTS);\n glfwOpenWindow(320,200,8,8,8,8,8,0,GLFW_WINDOW);\n });\n\n // Periodically process window events --- this isn't working.\n dispatch_source_t windowEventTimer;\n windowEventTimer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, dispatch_get_main_queue());\n uint64_t nanoseconds = 100 * NSEC_PER_MSEC;\n dispatch_source_set_timer(windowEventTimer, dispatch_time(DISPATCH_TIME_NOW, nanoseconds), nanoseconds, 0);\n dispatch_source_set_event_handler(windowEventTimer, ^{\n glfwPollEvents();\n });\n dispatch_resume(windowEventTimer);\n\n dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{\n for(int i=0;i\u0026lt;200;++i)\n {\n // Enqueue a rendering update.\n dispatch_async(dispatch_get_main_queue(), ^{\n glClearColor (0.2f, 0.2f, 0.4f, 1.0f);\n glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);\n\n glColor3f (1.0, 0.7, 0.7); \n glBegin( GL_LINES );\n glVertex3f(0,0,0);\n glVertex3f(t+=0.02,.1,0);\n glEnd();\n\n glfwSwapBuffers();\n });\n // Wait a bit, to simulate complex calculations.\n sleep(1);\n }\n });\n\n dispatch_main();\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe animation updates as expected, but the window frame does not draw, and the window does not respond to events.\u003c/p\u003e","accepted_answer_id":"12574050","answer_count":"1","comment_count":"4","creation_date":"2012-09-24 18:03:47.857 UTC","last_activity_date":"2012-09-25 02:33:57.503 UTC","last_edit_date":"2017-05-23 12:06:05.053 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"64860","post_type_id":"1","score":"2","tags":"osx|opengl|glfw|libdispatch","view_count":"651"} +{"id":"38383044","title":"Recoding percentiles: function instead of for-loop","body":"\u003cp\u003eI have not been able to find the answer to my question anywhere, so here goes:\u003c/p\u003e\n\n\u003cp\u003eI would like to know how to do a for loop with the variable names in a dataframe.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efor ( EACH VARIABLE in DATAFRAME){\n operation\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have tried different varieties of \u003ccode\u003ei in names(df)\u003c/code\u003e etc, no success.\u003c/p\u003e\n\n\u003cp\u003eWhat I want to do is simple. I want to recode variables: the upper Xth percentile = 1, rest = 0. I have been able to do this as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e j \u0026lt;- ntile (df$variable, 100)\n newdf$variable_percentile \u0026lt;-j\n newdf$variable_binomial \u0026lt;- 0\n newdf$variable_binomial[j\u0026gt;x] \u0026lt;-1 \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI would appreciate help with the loop for this, or a way to do this easier. Perhaps with a function and apply?\u003c/p\u003e\n\n\u003cp\u003eYours sincerely,\nLian\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-07-14 19:48:26.683 UTC","last_activity_date":"2016-07-22 22:08:30.06 UTC","last_edit_date":"2016-07-22 22:08:30.06 UTC","last_editor_display_name":"","last_editor_user_id":"6591214","owner_display_name":"","owner_user_id":"6591214","post_type_id":"1","score":"-1","tags":"r|for-loop|dataframe|percentile","view_count":"45"} +{"id":"33170972","title":"How can I determine which redirect to make in Rails?","body":"\u003cp\u003eI have two paths that my application can take.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003ePath 1: Is editing a valid record.\u003c/strong\u003e\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eUser goes to \u003ccode\u003epersons#show\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003eUser clicks edit to go to \u003ccode\u003epersons#edit\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003eAfter update leads back to \u003ccode\u003epersons#show\u003c/code\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003e\u003cstrong\u003ePath 2: Is editing an invalid record.\u003c/strong\u003e\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eUser goes to \u003ccode\u003epersons#invalid_records\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003eUser clicks edit to go to \u003ccode\u003epersons#edit\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003eAfter update (if it succeeds) leads back to \u003ccode\u003epersons#show\u003c/code\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eHow can I have \u003cem\u003ePath 2\u003c/em\u003e end up back at \u003ccode\u003epersons#invalid_records\u003c/code\u003e instead of \u003ccode\u003epersons#show\u003c/code\u003e?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eedit posting routes as requested:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eresources :persons do\n scope module: :persons do\n resources :notes\n resources :reports\n end\n collection do\n match 'invalid_records' =\u0026gt; 'persons#invalid_records', via [:get], as :invalid_records\n end\n member do\n get 'transactions'\n end\nend\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"6","creation_date":"2015-10-16 12:51:30.7 UTC","last_activity_date":"2015-10-16 16:14:21.393 UTC","last_edit_date":"2015-10-16 13:00:37.503 UTC","last_editor_display_name":"","last_editor_user_id":"394241","owner_display_name":"","owner_user_id":"394241","post_type_id":"1","score":"0","tags":"ruby-on-rails|ruby-on-rails-4|callback|controller","view_count":"31"} +{"id":"39155999","title":"Sending multiple pings with Python","body":"\u003cp\u003eHow can I ping \u003ccode\u003e192.168.0.1\u003c/code\u003e - \u003ccode\u003e192.168.0.254\u003c/code\u003e all at once? Trying to make the script run faster as it takes several minutes to finish. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport os\nimport subprocess\n\n\nip = raw_input(\"IP Address? \")\nprint \"Scanning IP Address: \" + ip\n\nsubnet = ip.split(\".\")\n\nFNULL = open(os.devnull, 'w')\n\nfor x in range(1, 255):\n ip2 = subnet[0]+\".\"+ subnet[1] +\".\"+ subnet[2] +\".\"+ str(x)\n response=subprocess.Popen([\"ping\", \"-c\", \"1\", \"-n\", \"-W\", \"2\", ip2], stdout=FNULL, stderr=subprocess.STDOUT).wait()\nif response == 0:\n print ip2, 'is up!'\nelse:\n print ip2, 'is down!'\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"39156126","answer_count":"3","comment_count":"4","creation_date":"2016-08-25 22:59:33.167 UTC","last_activity_date":"2016-08-26 00:23:02.747 UTC","last_edit_date":"2016-08-25 23:01:32.323 UTC","last_editor_display_name":"","last_editor_user_id":"1165509","owner_display_name":"","owner_user_id":"6754143","post_type_id":"1","score":"2","tags":"python","view_count":"79"} +{"id":"40110273","title":"Using Pyston to LLVM and then Emiscripten to Javascript","body":"\u003cp\u003eI am beginner to Pyston. I even dont know what I am saying is possible or not. Kindly enlighten me if someone knows can we use Pyston (by Dropbox) to convert python code to LLVM bitcode and then covert that bitcode to Javascript using Emiscripten. Also if I want to create JQuery file. How is that possible to use $ in the Python Code.\u003c/p\u003e","accepted_answer_id":"40442178","answer_count":"2","comment_count":"0","creation_date":"2016-10-18 13:57:39.997 UTC","last_activity_date":"2016-11-11 15:20:32.507 UTC","last_edit_date":"2016-11-05 19:13:55.793 UTC","last_editor_display_name":"","last_editor_user_id":"1577341","owner_display_name":"","owner_user_id":"1343533","post_type_id":"1","score":"2","tags":"javascript|llvm|emscripten|transcrypt","view_count":"108"} +{"id":"13535232","title":"MBProgressHUD won't display the label","body":"\u003cp\u003eI'm using MBProgressBar in my app to display feedback whenever there is a call to a certain webService.\u003c/p\u003e\n\n\u003cp\u003eTo do so, in the method \"requestStarted\" of ASIHTTPRequest, I call:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[NSThread detachNewThreadSelector:@selector(startLoader) toTarget:self];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhere \u003ccode\u003estartLoader\u003c/code\u003e is the method that pops the HUD.\u003c/p\u003e\n\n\u003cp\u003eNow, the thing is that whenever I call \u003ccode\u003estartLoader\u003c/code\u003e directly, the HUD gets displayed with no problem, but when I call the method using the \u003ccode\u003edetachNewThreadSelector\u003c/code\u003e thing (which is needed), the HUD is displayed but with no text label.\u003c/p\u003e\n\n\u003cp\u003eIf I had to guess, I would say I need to force-refresh the component, but I don't know how to do that.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2012-11-23 20:15:11.377 UTC","favorite_count":"0","last_activity_date":"2012-12-20 16:50:37.777 UTC","last_edit_date":"2012-12-20 16:49:07.687 UTC","last_editor_display_name":"","last_editor_user_id":"630784","owner_display_name":"","owner_user_id":"1710777","post_type_id":"1","score":"0","tags":"ios|components|refresh|mbprogresshud","view_count":"170"} +{"id":"31362488","title":"R: How to use turn the output of a function into a constant","body":"\u003cp\u003eLet's say I have some lines of code which produce a constant \u003ccode\u003ez\u003c/code\u003e , which I then use in the creation of a function \u003ccode\u003emyFunc\u003c/code\u003e.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ey \u0026lt;- 1.5\nz \u0026lt;- y * 3\n\nmyFunc \u0026lt;- function(x){x * z + 5}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI then save \u003ccode\u003emyFunc\u003c/code\u003e for some later use.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esave(myFunc, file = \"C:\\\\Functions\\\\myfunc\")\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I load this function, however, it is still referencing the output of \u003ccode\u003ez\u003c/code\u003e, which I may no longer have in my environment (unless I save \u003ccode\u003ez\u003c/code\u003e along with \u003ccode\u003emyFunc\u003c/code\u003e).\u003c/p\u003e\n\n\u003cp\u003eMy question is, when creating \u003ccode\u003emyFunc\u003c/code\u003e, is there some way to incorporate the \u003cem\u003evalue\u003c/em\u003e of \u003ccode\u003ez\u003c/code\u003e instead of a reference to the variable?\u003c/p\u003e\n\n\u003cp\u003eThank you very much!\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2015-07-11 22:32:13.063 UTC","last_activity_date":"2015-07-11 23:01:47.11 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5106834","post_type_id":"1","score":"2","tags":"r","view_count":"38"} +{"id":"26566242","title":"'HTTP Error 400: Bad Request' with Python Bottlenose","body":"\u003cp\u003eI have the following file (associate.py)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport bottlenose\nfrom bs4 import BeautifulSoup\nfrom urllib2 import HTTPError\n\n;; My real keys are here in reality, I just replaced them \n;; with the following because they are private.\ncredentials = {'access-key' : 'MY_ACCESS_KEY_GOES_HERE',\n 'secret-key' : 'MY_SECRET_KEY_GOES_HERE',\n 'associate-tag' : 'MY_ASSOCIATE_TAG'}\n\ndef error_handler(err):\n ex = err['exception']\n if isinstance(ex, HTTPError) and ex.code == 503:\n time.sleep(random.expovariate(0.1))\n return True\n\napi = bottlenose.Amazon(credentials['access-key'],\n credentials['secret-key'],\n credentials['associate-tag'],\n Parser=BeautifulSoup,\n ErrorHandler=error_handler,\n MaxQPS=0.9)\n\ndef get_item(asin):\n return api.ItemLookup(ItemId=asin,\n ResponseGroup=\"Large,Images,ItemAttributes\")\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is the result of my Ipython session using the above:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eIn [1]: import associate\n\nIn [2]: associate.get_item(\"B003K1IJWC\")\n---------------------------------------------------------------------------\nHTTPError Traceback (most recent call last)\n\u0026lt;ipython-input-2-31ffe6a959e1\u0026gt; in \u0026lt;module\u0026gt;()\n----\u0026gt; 1 associate.get_item(\"B003K1IJWC\")\n\n/home/stephen/work/pantry/associate.pyc in get_item(asin)\n 22 def get_item(asin):\n 23 return api.ItemLookup(ItemId=asin,\n---\u0026gt; 24 ResponseGroup=\"Large,Images,ItemAttributes\")\n\n/home/stephen/work/pantry/bottlenose/api.pyc in __call__(self, **kwargs)\n 240 # make the actual API call\n 241 response = self._call_api(api_url,\n--\u0026gt; 242 {'api_url': api_url, 'cache_url': cache_url})\n 243 \n 244 # decompress the response if need be\n\n/home/stephen/work/pantry/bottlenose/api.pyc in _call_api(self, api_url, err_env)\n 201 else:\n 202 # the simple way\n--\u0026gt; 203 return urllib2.urlopen(api_request, timeout=self.Timeout)\n 204 except:\n 205 if not self.ErrorHandler:\n\n/usr/lib/python2.7/urllib2.pyc in urlopen(url, data, timeout)\n 125 if _opener is None:\n 126 _opener = build_opener()\n--\u0026gt; 127 return _opener.open(url, data, timeout)\n 128 \n 129 def install_opener(opener):\n\n/usr/lib/python2.7/urllib2.pyc in open(self, fullurl, data, timeout)\n 408 for processor in self.process_response.get(protocol, []):\n 409 meth = getattr(processor, meth_name)\n--\u0026gt; 410 response = meth(req, response)\n 411 \n 412 return response\n\n/usr/lib/python2.7/urllib2.pyc in http_response(self, request, response)\n 521 if not (200 \u0026lt;= code \u0026lt; 300):\n 522 response = self.parent.error(\n--\u0026gt; 523 'http', request, response, code, msg, hdrs)\n 524 \n 525 return response\n\n/usr/lib/python2.7/urllib2.pyc in error(self, proto, *args)\n 446 if http_err:\n 447 args = (dict, 'default', 'http_error_default') + orig_args\n--\u0026gt; 448 return self._call_chain(*args)\n 449 \n 450 # XXX probably also want an abstract factory that knows when it makes\n\n/usr/lib/python2.7/urllib2.pyc in _call_chain(self, chain, kind, meth_name, *args)\n 380 func = getattr(handler, meth_name)\n 381 \n--\u0026gt; 382 result = func(*args)\n 383 if result is not None:\n 384 return result\n\n/usr/lib/python2.7/urllib2.pyc in http_error_default(self, req, fp, code, msg, hdrs)\n 529 class HTTPDefaultErrorHandler(BaseHandler):\n 530 def http_error_default(self, req, fp, code, msg, hdrs):\n--\u0026gt; 531 raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)\n 532 \n 533 class HTTPRedirectHandler(BaseHandler):\n\nHTTPError: HTTP Error 400: Bad Request\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe odd thing is that the above request \u003ccode\u003eassociate.get_item(\"B003K1IJWC\")\u003c/code\u003e works just fine on my laptop, but fails as seen on my desktop.\u003c/p\u003e\n\n\u003cp\u003eMy laptop is Crouton Ubuntu 12.04 with python 2.7.5, my Desktop is Ubuntu 14.04 with Python 2.7.6 . I am at quite a loss to explain why this works on one and not the other. If you have any guesses as to why the previous code does not work on the desktop, I would appreciate it. Is it a crypto problem with the signed request? I am just stumped and don't know how to proceed. Thank you.\u003c/p\u003e","accepted_answer_id":"26566811","answer_count":"1","comment_count":"1","creation_date":"2014-10-25 19:15:32.917 UTC","last_activity_date":"2017-02-09 20:01:47.773 UTC","last_edit_date":"2017-02-09 20:01:47.773 UTC","last_editor_display_name":"","last_editor_user_id":"39155","owner_display_name":"","owner_user_id":"21317","post_type_id":"1","score":"1","tags":"python|ubuntu-14.04|amazon|ubuntu-12.04|bottlenose","view_count":"748"} +{"id":"29705306","title":"How remove margin and the application icon in the custom ActionBar?","body":"\u003cp\u003eI create an app with custom ActioBar. It works, but not on all devices. On Lenovo \u003cstrong\u003e\u003cem\u003ek990\u003c/em\u003e\u003c/strong\u003e it is not correct. - I am sorry - Lenovo \u003cstrong\u003e\u003cem\u003ek900\u003c/em\u003e\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://monosnap.com/file/jd60ZG7uEPWEqau5f4oCnJIOQUcCrC.png\" /\u003e\u003c/p\u003e\n\n\u003cp\u003eIt should look like this\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://monosnap.com/file/8qpd2y4Xg4xIo5BuWEgLKCUENLKexo.png\" /\u003e\u003c/p\u003e\n\n\u003cp\u003eFirst variant\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e ViewGroup actionBarLayout = (ViewGroup) getLayoutInflater().inflate(R.layout.action_bar_category, null);\n ActionBar actionBar = getActionBar();\n if (actionBar != null) {\n actionBar.setDisplayShowHomeEnabled(false);\n actionBar.setDisplayUseLogoEnabled(false);\n actionBar.setDisplayShowTitleEnabled(false);\n actionBar.setDisplayShowCustomEnabled(true);\n actionBar.setCustomView(actionBarLayout);\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSecond variant\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e ActionBar actionBar = getActionBar();\n if (actionBar != null) {\n actionBar.setDisplayShowHomeEnabled(false);\n actionBar.setDisplayShowTitleEnabled(false);\n actionBar.setDisplayShowCustomEnabled(true);\n actionBar.setCustomView(R.layout.action_bar_category);\n }\n View actionBarLayout = actionBar.getCustomView();\n ViewGroup.LayoutParams lp = actionBarLayout.getLayoutParams();\n lp.width = ViewGroup.LayoutParams.MATCH_PARENT;\n actionBarLayout.setLayoutParams(lp);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThird variant\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e ViewGroup actionBarLayout = (ViewGroup) getLayoutInflater().inflate(R.layout.action_bar_main_menu, null);\n ActionBar actionBar = getActionBar();\n if(actionBar!= null){\n actionBar.setDisplayShowHomeEnabled(false);\n actionBar.setDisplayHomeAsUpEnabled(false);\n actionBar.setDisplayUseLogoEnabled(false);\n actionBar.setDisplayShowTitleEnabled(false);\n actionBar.setDisplayShowCustomEnabled(true);\n actionBar.setHomeButtonEnabled(false);\n actionBar.setLogo(null);\n actionBar.setCustomView(actionBarLayout);\n\n View v = actionBar.getCustomView();\n ViewGroup.LayoutParams lp = v.getLayoutParams(); \n lp.width = ViewGroup.LayoutParams.MATCH_PARENT;\n v.setLayoutParams(lp);\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCan you help me?\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2015-04-17 17:00:30.923 UTC","favorite_count":"1","last_activity_date":"2015-04-23 14:54:14.54 UTC","last_edit_date":"2015-04-23 14:54:14.54 UTC","last_editor_display_name":"","last_editor_user_id":"4742625","owner_display_name":"","owner_user_id":"4742625","post_type_id":"1","score":"3","tags":"android|android-actionbar|relativelayout|margin|fill-parent","view_count":"217"} +{"id":"9422843","title":"Lucene's incrementToken() last term ignored","body":"\u003cp\u003eI have been trying to implement a custom analyzer in Lucene. I think I am really close to finishing but I face two strange issues. \u003c/p\u003e\n\n\u003cp\u003eFirst, my filter works as expected for every term in the tokenstream except the last one. (Though I am trying to handle it). \u003c/p\u003e\n\n\u003cp\u003eSecond, I wouldn't have a problem using that TokenFilter (even missing the last term). But although the indexing is working perfectly (checked the resulting index with Luke), when I try to use my analyzer to parse user queries = the resulting Query is blank(!) Could this be due to the missing term?\u003c/p\u003e\n\n\u003cp\u003eI have posted the incrementToken() method of filter below. Any help would be really welcome. Thank you in advance. \u003c/p\u003e\n\n\u003cp\u003eP.S. I now that in terms of contribution this question is not good, but i could not find something specific elsewhere. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic boolean incrementToken() throws IOException {\n if (!input.incrementToken()) {\n if (previousTokenFlag) {\n tempPreviousToken.attSource.copyTo(this);\n previousTokenFlag = false;\n this.incrementToken();\n return false;\n } else {\n return false;\n }\n }\n if (previousTokenFlag) {\n if (CheckIfMainName(this.termAtt.term())) {\n if (CheckIfMainName(tempPreviousToken.termAtt.term())) {\n termAtt.setTermBuffer(tempPreviousToken.termAtt.term() + \n TOKEN_SEPARATOR + this.termAtt.term());\n this.setPreviousTokenFlag(false);\n return true;\n } else {\n tempHelpingToken = new TempToken(this.input.cloneAttributes());\n }\n tempPreviousToken.attSource.copyTo(this);\n tempHelpingToken.attSource.copyTo(tempPreviousToken.attSource);\n return true;\n } else {\n if (CheckIfMainName(tempPreviousToken.termAtt.term())) {\n tempHelpingToken = new TempToken(this.input.cloneAttributes());\n tempPreviousToken.attSource.copyTo(this);\n tempHelpingToken.attSource.copyTo(tempPreviousToken.attSource);\n tempHelpingToken.attSource.clearAttributes();\n return true;\n } else {\n tempHelpingToken = new TempToken(this.input.cloneAttributes());\n tempPreviousToken.attSource.copyTo(this);\n tempHelpingToken.attSource.copyTo(tempPreviousToken.attSource);\n tempHelpingToken.attSource.clearAttributes();\n return true;\n }\n }\n } else {\n tempPreviousToken = new TempToken(this.input.cloneAttributes());\n tempPreviousToken.termAtt.setTermBuffer(this.termAtt.term());\n this.setPreviousTokenFlag(true);\n this.incrementToken();\n return true;\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"9428081","answer_count":"1","comment_count":"1","creation_date":"2012-02-23 23:03:43.147 UTC","last_activity_date":"2012-02-24 09:08:56.333 UTC","last_edit_date":"2012-02-24 01:19:17.107 UTC","last_editor_display_name":"","last_editor_user_id":"664577","owner_display_name":"","owner_user_id":"1063888","post_type_id":"1","score":"0","tags":"java|lucene","view_count":"269"} +{"id":"23324525","title":"Android why can't I see ic_launcher-web.png","body":"\u003cp\u003eI'd like a splashscreen simply but I can't see ic_launcher-web.png (which contains my own picture) when launching the App why ?\u003c/p\u003e\n\n\u003cp\u003eDoes it mean I can't use this to create a splashscreen and I have to code a splashscreen myself ?\u003c/p\u003e","accepted_answer_id":"23324605","answer_count":"1","comment_count":"2","creation_date":"2014-04-27 14:19:17.953 UTC","last_activity_date":"2014-04-27 14:32:12.823 UTC","last_edit_date":"2014-04-27 14:24:42.74 UTC","last_editor_display_name":"","last_editor_user_id":"310291","owner_display_name":"","owner_user_id":"310291","post_type_id":"1","score":"0","tags":"android","view_count":"715"} +{"id":"47194195","title":"when i use google's AutoValue to define a class named xxx ,eclipse give me an error \"AutoValue_xxx cannot be resolved to a type\"","body":"\u003cp\u003eWhen I compile my \u003ccode\u003exxx.java\u003c/code\u003e file,there is a \u003ccode\u003e.java\u003c/code\u003e file named \u003ccode\u003eAutoValue_xxx.java\u003c/code\u003e will be created, but no \u003ccode\u003eAutoValue_xxx.class\u003c/code\u003e is created. And eclipse gives me an error \u003ccode\u003eAutoValue_xxx cannot be resolved to a type\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eSo what should i do to solve this problem.\nThanks \u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-11-09 04:58:49.677 UTC","last_activity_date":"2017-11-09 05:10:57.933 UTC","last_edit_date":"2017-11-09 05:10:57.933 UTC","last_editor_display_name":"","last_editor_user_id":"1327585","owner_display_name":"","owner_user_id":"8911060","post_type_id":"1","score":"-1","tags":"java|eclipse","view_count":"80"} +{"id":"22522846","title":"Get all the values from the \"for loop\" run","body":"\u003cp\u003eI have some *.dat files in a folder, I would like to extract a particular column (8th column) from all of the files and put into a excel file. I have run a for loop, but it only gives me the results of final run (i.e. if there are 10 number of files, it only returns me 8th column of the 10th files).\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edata = cell(numel(files),1);\nfor i = 1:numel(files)\n fid = fopen(fullfile(pathToFolder,files(i).name), 'rt');\n H = textscan(fid, '%s', 4, 'Delimiter','\\n'); \n C = textscan(fid, repmat('%f ',1,48), 'Delimiter',' ', ... \n 'MultipleDelimsAsOne',true, 'CollectOutput',true); \n fclose(fid);\n H = H = H{1}; C = C{1};\n data{i} = C;\n B = C(:,8);\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eLooking for your help on this.\u003c/p\u003e\n\n\u003cp\u003eIt would be greatly appreciated.\u003c/p\u003e","accepted_answer_id":"22523033","answer_count":"1","comment_count":"0","creation_date":"2014-03-20 03:24:09.417 UTC","last_activity_date":"2014-03-20 03:43:20.15 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1263844","post_type_id":"1","score":"0","tags":"matlab","view_count":"33"} +{"id":"30167123","title":"Is it possible to extend a view from within another view in Laravel 5","body":"\u003cp\u003eI have a main template that yields content into the middle of the page. So far ive been creating views that extend the main template and then define the content.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@extends('app')\n\n@section('content')\n\n@stop\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIm in a place now where i have about 20 views that are kinda similar, but a little different. Rather than create 20 different views that i have to maintain i would like to extend another view from within a view. I dont want to do this for every view so i dont want to make a change to the app template since not all views require this template.\u003c/p\u003e\n\n\u003cp\u003eSo something like this.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@extends('app')\n\n@section('content')\n\n@extends('posttemplate')\n @section('postimage')\n \u0026lt;img.....\n @stop\n\n @section('customdata')\n\n @stop\n@stop\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf i was to use raw php without laravel i might do something where i declare variables and then include the template that will just output the variables that i have defined.\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2015-05-11 12:00:11.797 UTC","last_activity_date":"2015-05-11 12:00:11.797 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2102705","post_type_id":"1","score":"2","tags":"php|laravel","view_count":"200"} +{"id":"6145489","title":"Is the Facebook \"Share\" button being deprecated?","body":"\u003cp\u003eI have a business requirement to add a Share on Facebook button to a site. There are a lot of links on the web that point to \u003ca href=\"http://www.facebook.com/facebook-widgets/share.php\" rel=\"nofollow noreferrer\"\u003ethis page\u003c/a\u003e but that just points to \u003ca href=\"http://developers.facebook.com/docs/reference/plugins/like/\" rel=\"nofollow noreferrer\"\u003ethe page about the like button\u003c/a\u003e. Considering there really isn't any talk of a Share button on that page, makes me think it's going away. \u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://developers.facebook.com/blog/post/323\" rel=\"nofollow noreferrer\"\u003eThis blog post from 2009\u003c/a\u003e talks about the Share button. I didn't see, when I searched, any mention about the Share button being phased out. \u003c/p\u003e\n\n\u003cp\u003eI'm unclear on whether I should implement this with sharer.php or whether I should tell the business that \"Share\" is on the way out and we should just implement \"Like\". \u003c/p\u003e\n\n\u003cp\u003eI have seen \u003ca href=\"http://www.barbariangroup.com/posts/7544-the_facebook_share_button_has_been_deprecated_called_it\" rel=\"nofollow noreferrer\"\u003esome\u003c/a\u003e \u003ca href=\"http://mashable.com/2011/02/27/facebook-like-button-takes-over-share-button-functionality/\" rel=\"nofollow noreferrer\"\u003eblog\u003c/a\u003e posts that suggest Share is deprecated, but nothing official from Facebook. \u003c/p\u003e","accepted_answer_id":"7224409","answer_count":"6","comment_count":"1","creation_date":"2011-05-26 21:45:28.68 UTC","favorite_count":"2","last_activity_date":"2015-08-25 09:49:16.417 UTC","last_edit_date":"2015-08-25 09:49:16.417 UTC","last_editor_display_name":"","last_editor_user_id":"1779477","owner_display_name":"","owner_user_id":"30946","post_type_id":"1","score":"17","tags":"facebook","view_count":"11705"} +{"id":"44312728","title":"Average Difference between Orders dates of a product in R","body":"\u003cp\u003eI have a data set of this format\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eOrder_Name Frequency Order_Dt\nA 2 2016-01-20\nA 2 2016-05-01\nB 1 2016-02-12\nC 3 2016-03-04\nC 3 2016-07-01\nC 3 2016-08-09\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI need to find the average difference between the dates of those order which have been placed for more than 1 times, i.e., frequency \u003e 1. \u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-06-01 16:26:01.123 UTC","last_activity_date":"2017-06-01 17:29:22.633 UTC","last_edit_date":"2017-06-01 17:29:22.633 UTC","last_editor_display_name":"","last_editor_user_id":"4970610","owner_display_name":"","owner_user_id":"8098937","post_type_id":"1","score":"1","tags":"r","view_count":"19"} +{"id":"47500732","title":"Excel: Formula to fill dates in a Weekly Calendar","body":"\u003cp\u003eI found a template for an Excel monthly calendar and it works great for me. Each month is in its own sheet (Tab) and there is a formula that pre-populates the days of the month.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e=DaysAndWeeks+DATE(CalendarYear,1,1)-WEEKDAY(DATE(CalendarYear,1,1),(WeekStart=\"Monday\")+1)+1\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd it looks like this: (I guess I can't post images yet, but there is a link..)\n\u003ca href=\"https://i.stack.imgur.com/OZ3rG.png\" rel=\"nofollow noreferrer\"\u003eMonthly Calendar Image\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThe formula is used on the day of the month. In the image example for the month of January, the formula is displaying: 31, 1, 2, 3, 4, 5, 6, etc....\u003c/p\u003e\n\n\u003cp\u003eWhat I am trying to do is make a new Excel workbook with the Weeks of the Year.\nIt would follow the same format, one week per sheet (tab), so there would be 52 sheets + 1 in the beginning I will call template, that I can make changes to and copy to the week tabs. So I don't have to Change each one individually.\u003c/p\u003e\n\n\u003cp\u003eSo I am looking for a formula that will fill in the DayOfWeek month/Day at the top of my week \"table\".\nThis is what I am using at the moment for my weekly calendar: (again, I can't post images, but its in the link)\n\u003ca href=\"https://i.stack.imgur.com/LfkbP.png\" rel=\"nofollow noreferrer\"\u003eWeekly Calendar Image\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThe formula I am looking for will span the whole workbook (same as it does in my monthly calendar) and pre-populate the dates in each sheet. \u003c/p\u003e\n\n\u003cp\u003eAny Excel Wizards out there that can wave their wands?? =) \u003c/p\u003e\n\n\u003cp\u003eThanks for any help. And if you guys want any of the workbooks to use, just let me know, I can share them. (btw, I use Excel 2016)\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-11-26 20:31:10.46 UTC","favorite_count":"1","last_activity_date":"2017-11-27 01:44:01.017 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"8854270","post_type_id":"1","score":"0","tags":"excel|date|excel-formula|calendar|organization","view_count":"23"} +{"id":"5794865","title":"SELECT biggest row from a LEFT JOIN","body":"\u003cp\u003eI have a SQL query that LEFT JOINs a table into it. This causes rows from the main table to be duplicated but with different rows from the JOINed table. How do I only select the rows with the highest date from the JOINed table.\u003c/p\u003e\n\n\u003cp\u003eHere's an example (this is the result from my query):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eID Message Date\n---------------------------\n0 Hi 2011-01-01\n0 Bye 2011-02-05\n0 Hello 2011-04-20\n1 Test 2010-12-31\n1 Testing 2010-11-15\n2 Something 2010-12-12\n2 Nothing 2011-01-01\n2 Yes 2010-02-05\n3 Cool NULL\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want one row per ID, the row with the highest ID.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eID Message Date\n---------------------------\n0 Hello 2011-04-20\n1 Test 2010-12-31\n2 Nothing 2011-01-01\n3 Cool NULL\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy current query is something like this (I just kinda made this up, but it's similar to the real one):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT t1.ID, t2.Message, t2.Date\nFROM t1\nLEFT JOIN (\n SELECT t3.ID, t3.message, t3.Date\n FROM t3\n LEFT JOIN t4 ON t4.userID = 12 AND t3.ID = t4.ID\n WHERE t4.color = 'blue'\n) AS t2\nON t1.ID = t2.ID\nWHERE t1.userID = 12\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI guess I could use PHP and loop through the results and pick out the ones I want, but can I have MySQL do that for me?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT\u003c/strong\u003e: Sorry, my 1st example was \u003cem\u003eway\u003c/em\u003e wrong, this is more like what I want.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT 2\u003c/strong\u003e: I tried using GROUP BY and MAX, but I think I'm doing something wrong.\u003c/p\u003e\n\n\u003cp\u003eI tried:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT t1.ID, t2.Message, MAX(t2.Date)\nFROM t1\nLEFT JOIN (\n SELECT t3.ID, t3.message, t3.Date\n FROM t3\n LEFT JOIN t4 ON t4.userID = 12 AND t3.ID = t4.ID\n WHERE t4.color = 'blue'\n) AS t2\nON t1.ID = t2.ID\nWHERE t1.userID = 12\nGROUP BY t1.ID\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut, that gave me:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eID Message Date\n---------------------------\n0 Hi 2011-04-20\n1 Test 2010-12-31\n2 Something 2011-01-01\n3 Cool NULL\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow do I get the Message associated with the highest date.\u003c/p\u003e","accepted_answer_id":"5794896","answer_count":"2","comment_count":"10","creation_date":"2011-04-26 18:36:10.8 UTC","last_activity_date":"2011-04-26 19:13:32.287 UTC","last_edit_date":"2011-04-26 19:13:32.287 UTC","last_editor_display_name":"","last_editor_user_id":"206403","owner_display_name":"","owner_user_id":"206403","post_type_id":"1","score":"1","tags":"php|mysql|join|left-join","view_count":"904"} +{"id":"46655632","title":"How to get docker registry working on windows server 2016","body":"\u003cp\u003eI have windows server 2016 version 1607.\nIt is running Docker EE version 17.06.2-ee-3 (both client and server)\u003c/p\u003e\n\n\u003cp\u003eI want to get a registry running so I ran\n\u003ccode\u003e\ndocker run -d -p 5000:5000 --restart=always --name registry registry:2\n\u003c/code\u003e\nIt responds:\n\u003ccode\u003e\nUnable to find image 'registry:2' locally\n2: Pulling from library/registry\nC:\\Program Files\\Docker\\docker.exe: no matching manifest for windows/amd64 in the manifest list entries\n\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eThis worked fine on my Windows 10 machine. Is there something special with Server 2016? \u003c/p\u003e\n\n\u003cp\u003eI found this \u003ca href=\"https://forums.docker.com/t/installing-a-private-registry-on-windows-server-2016/22279/4\" rel=\"nofollow noreferrer\"\u003eentry\u003c/a\u003e but it's almost a year old. Is this still the only way to do it?\u003c/p\u003e\n\n\u003cp\u003eAlso, I found the \u003ca href=\"https://docs.docker.com/datacenter/dtr/2.1/guides/\" rel=\"nofollow noreferrer\"\u003eDocker Trusted Registry\u003c/a\u003e. Is that something that should be considered for windows server 2016 as an alternative?\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-10-09 22:02:02.92 UTC","last_activity_date":"2017-10-10 21:45:51.103 UTC","last_edit_date":"2017-10-10 21:45:51.103 UTC","last_editor_display_name":"","last_editor_user_id":"4372142","owner_display_name":"","owner_user_id":"4372142","post_type_id":"1","score":"1","tags":"docker|docker-registry|windows-server-2016","view_count":"61"} +{"id":"12175618","title":"How to read a method that's an array? in java","body":"\u003cp\u003ethis is partly homework I've been given some code to use and I am trying to figure out one part of it...\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public PhoneAccount[] getAllAccounts() {\n return tm.values().toArray(new PhoneAccount[tm.size()]);\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am trying to find out how to read this in my main method, I've created the instance of the class this is. Which I named \"am\"\u003c/p\u003e\n\n\u003cp\u003eWhat exactly do I need to do to make it list the contents of the array? \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eam.getAllAccounts() \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eis what it is, just not sure how do I make it print its contents?\u003c/p\u003e","accepted_answer_id":"12175657","answer_count":"4","comment_count":"0","creation_date":"2012-08-29 10:13:44.123 UTC","last_activity_date":"2012-08-29 10:22:52.3 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1438958","post_type_id":"1","score":"0","tags":"java|arrays|instance-variables","view_count":"49"} +{"id":"42419523","title":"keystone v3 API \"401- Unauthorized\" error to list users of a tenant with default-admin credentials","body":"\u003cp\u003eI am trying to list all those users under the specified project/tenant.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ehttp://\u0026lt;keystone_IP\u0026gt;:5000/v3/users?project_id=\u0026lt;XXXX\u0026gt; \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eis giving \"\u003ccode\u003e401- Unauthorized\u003c/code\u003e\" error for admin user with the default domain.\nIs there another way to achieve the same?\u003c/p\u003e\n\n\u003cp\u003eI tried in Horizon dashboard and we need to set the \"domain context\" to get the list of users of a particular project. How to make that happen in REST API?\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-02-23 15:11:09.713 UTC","last_activity_date":"2017-02-23 15:48:00.097 UTC","last_edit_date":"2017-02-23 15:48:00.097 UTC","last_editor_display_name":"","last_editor_user_id":"387454","owner_display_name":"","owner_user_id":"7606996","post_type_id":"1","score":"0","tags":"openstack|keystone","view_count":"108"} +{"id":"18007148","title":"MongoDB C# query performance much worse than mongotop reports","body":"\u003cp\u003eI have quite a bit of experience with Mongo, but am on the verge of tears of frustration about this problem (that of course popped up from nowhere a day before release).\u003c/p\u003e\n\n\u003cp\u003eBasically I am querying a database to retrieve a document but it will often be an order of magnitude (or even two) worse than it should be, particularly since the query is returning nothing.\u003c/p\u003e\n\n\u003cp\u003eQuery:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e//searchQuery ex: { \"atomic.Basic^SessionId\" : \"a8297898-7fc9-435c-96be-9c5e60901e40\" }\nvar doc = FindOne(searchQuery); \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eExplain:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n \"cursor\":\"BtreeCursor atomic.Basic^SessionId\",\n \"isMultiKey\" : false, \n \" n\":0,\n \"nscannedObjects\":0,\n \"nscanned\":0,\n \"nscannedObjectsAllPlans\":0,\n \"nscannedAllPlans\":0,\n \"scanAndOrder\":false,\n \"indexOnly\":false,\n \"nYields\":0,\n \"nChunkSkips\":0,\n \"millis\":0,\n \"indexBounds\":{\n \"atomic.Basic^SessionId\":[\n [\n \"a8297898-7fc9-435c-96be-9c5e60901e40\",\n \"a8297898-7fc9-435c-96be-9c5e60901e40\"\n ]\n ]\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt is often taking 50-150 ms, even though mongotop reports at most 15 ms of read time (and that should be over several queries). There are only 6k documents in the database (only 2k or so are in the index, and the explain says it's using the index) and since the document being searched for isn't there, it can't be a deserialization issue.\u003c/p\u003e\n\n\u003cp\u003eIt's not this bad on every query (sub ms most of the time) and surely the B-tree isn't large enough to have that much variance.\u003c/p\u003e\n\n\u003cp\u003eAny ideas will have my eternal gratitude. \u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2013-08-02 01:06:50.217 UTC","last_activity_date":"2013-11-13 00:01:46.633 UTC","last_edit_date":"2013-08-02 05:35:43.52 UTC","last_editor_display_name":"","last_editor_user_id":"508601","owner_display_name":"","owner_user_id":"1167895","post_type_id":"1","score":"1","tags":"mongodb|mongodb-.net-driver","view_count":"207"} +{"id":"28282546","title":"iOS 8 UITextViewDelegate and Updating UI","body":"\u003cp\u003eI am using a UITextView and have the UITextViewDelegate attached to the View Controller. When the user clicks on the TextView I have a \"placeholder\" label over the text view that I want to hide/un-hide depending on whether the user has any text in the text view. However, there seems to be an issue with executing UI operations in the UITextViewDelegate textViewDidBeginEditing and textViewDidEndEditing methods. In unit tests everything runs fine, but when running the app the UI doesn't update. I even tried wrapping the UI in a dispatch_async block to force the UI thread, but it seems slow and fickle (sometimes it works and sometimes it doesn't). Had anyone else seen this? Am I missing something that is blatantly right in front of me?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic func textViewDidBeginEditing(textView: UITextView) {\n switch(textView) {\n case self.descriptionTextView:\n self.activeTextView = self.descriptionTextView\n break\n case self.detailTextView:\n self.activeTextView = self.detailTextView\n dispatch_async(dispatch_get_main_queue(), { () -\u0026gt; Void in\n self.detailsRequiredButton!.hidden = true\n })\n\n break\n default:\n break\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"2","creation_date":"2015-02-02 16:46:02.267 UTC","last_activity_date":"2015-02-02 18:05:02.81 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1048507","post_type_id":"1","score":"0","tags":"ios|swift|uikit|uitextview","view_count":"370"} +{"id":"25690636","title":"Is it valid to construct an `std::ostream` from a null buffer?","body":"\u003cp\u003eConsider the following:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003estd::ostream out(nullptr);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs this legal and well-defined?\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003eHow about if I now do:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eout \u0026lt;\u0026lt; \"hello world\\n\";\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs this legal and well-defined? If so, presumably it's a no-op of sorts?\u003c/p\u003e","accepted_answer_id":"25690637","answer_count":"1","comment_count":"13","creation_date":"2014-09-05 16:57:08.063 UTC","favorite_count":"4","last_activity_date":"2014-09-05 17:06:30.827 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"560648","post_type_id":"1","score":"18","tags":"c++|c++11|std|iostream","view_count":"754"} +{"id":"43093219","title":"Why does my oracle date field does not fall within the queried range?","body":"\u003cp\u003eI have this sql query :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eselect email_id, to_char(last_update_date, 'YYYY-MM-DD hh:mi:ss') \nfrom profile_table\nwhere last_update_date \u0026lt; sysdate and\n last_update_date \u0026gt; sysdate -1;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhich returns result\u003c/p\u003e\n\n\u003cblockquote\u003e\n\u003cpre\u003e\u003ccode\u003e EMAIL_ID TO_CHAR(last_update_date, 'YYYY-MM-DD hh:mi:ss')\n------------------------ ------------------------------------------------\n email_007@abc.com 2017-03-28 12:00:04\n nachppx@gmail.com 2017-03-28 03:45:26\n QM_SFGD@yahoo.com 2017-03-29 08:24:12\nj.w.booth@rocketmail.com 2017-03-29 11:16:00\n\u003c/code\u003e\u003c/pre\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eHowever, I am pretty sure that that query is missing record that should be within that 'where' range, because when I issue this :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eselect email_id, to_char(last_update_date, 'YYYY-MM-DD hh:mi:ss')\nfrom profile_table\nwhere email_id = 'kgunash@gmail.com'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eit returns\u003c/p\u003e\n\n\u003cblockquote\u003e\n\u003cpre\u003e\u003ccode\u003e EMAIL_ID TO_CHAR(last_update_date, 'YYYY-MM-DD hh:mi:ss')\n------------------------ ------------------------------------------------\n kgunash@gmail.com 2017-03-29 05:53:33\n\u003c/code\u003e\u003c/pre\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eMy sysdate during execution is as below :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eselect to_char(sysdate,'YYYY-MM-DD hh:mm:ss'), to_char(sysdate-1,'YYYY-MM-DD hh:mm:ss')\nfrom dual\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cblockquote\u003e\n\u003cpre\u003e\u003ccode\u003eTO_CHAR(SYSDATE,'YYYY-MM-DD HH:MI:SS') TO_CHAR(SYSDATE-1,'YYYY-MM-DD HH:MI:SS')\n------------------------------------- ---------------------------------------\n 2017-03-29 11:12:19 2017-03-28 11:12:19\n\u003c/code\u003e\u003c/pre\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eObviously \u003cstrong\u003e2017-03-29 05:53:33\u003c/strong\u003e should fall between \u003cstrong\u003e2017-03-29 11:12:19\u003c/strong\u003e and \u003cstrong\u003e2017-03-28 11:12:19\u003c/strong\u003e. Anyone got any idea what's going on?\u003c/p\u003e","accepted_answer_id":"43093733","answer_count":"1","comment_count":"2","creation_date":"2017-03-29 12:13:57.453 UTC","last_activity_date":"2017-03-29 12:37:02.953 UTC","last_edit_date":"2017-03-29 12:21:51.433 UTC","last_editor_display_name":"","last_editor_user_id":"1144035","owner_display_name":"","owner_user_id":"6186896","post_type_id":"1","score":"1","tags":"sql|oracle","view_count":"40"} +{"id":"36929453","title":"python dict is unhashable","body":"\u003cp\u003eNew python learner here and i encountered a problem where it says my dict is unhashable. I searched up this on stack overflow for other answers but i couldn't understand them well. Does any one have a explanation for what is unhashable that is easy to understand? Also here is the part of my code where things went wrong\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efor name1, itemdescription1 in thisitem.items():\n if rooms[currentroom-1][currentroom][\"items\"][name1][itemdescription1] == \"yes\": # if player already got this item\n print (\"You didn't find anything\")\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eon the middle line of the code above it says TypeError: unhashable type: 'dict' \nAnd here is my code for the \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003erooms = [\n\n {1 : {\n \"name\" : \"hall\",\n \"east\" : 2,\n \"south\" : 3,\n \"description\" : \"An empty hallway, nothing of use here. \",\n \"items\" : {\"torch\" : {\"a dim torch \" : \"no\"}}\n }}, \n {2 : {\n \"name\" : \"kitchen\",\n \"west\" : 1,\n \"east\" : 4,\n \"south\" : 6,\n \"description\" : \"An odd smell reeks from the kitchen. What could it be? \",\n \"items\" : {\"meat\" : {\"a piece of vile meat \" : \"no\"}}\n }},\n {3 : {\n \"name\" : \"bedroom\",\n \"north\" : 1,\n \"east\" : 6,\n \"description\" : \"A overwelmingly big room containing two gigantic beds, hmmm... \",\n \"items\" : {\"key\" : {\"a silver key \" : \"no\"}}\n }},\n {4 : {\n \"name\" : \"diningroom\",\n \"west\" : 2,\n \"south\" : 5,\n \"description\" : \"A large room with tables and chairs, nothing special. \",\n \"items\" : {\"plate\" : {\"a white plate \" : \"no\"}}\n }},\n\n {5 : {\n \"name\" : \"bathroom\",\n \"north\" : 4,\n \"west\" : 6,\n \"description\" : \"A creepy shadow lays in the bathtub, better go somewhere else. \",\n \"items\" : {\"shampoo\" : {\"a bottle of shampoo \" : \"no\"}}\n }},\n {6 : {\n \"name\" : \"garage\",\n \"north\" : 2,\n \"west\" : 3,\n \"east\" : 5,\n \"description\" : \"It reeks of blood here. You wonder why. \",\n \"items\" : {\"bolts\" : {\"some rusted iron bolts \" : \"no\"}} \n}}\n]\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"36930089","answer_count":"1","comment_count":"4","creation_date":"2016-04-29 04:18:02.17 UTC","last_activity_date":"2016-04-29 05:16:53.383 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6037092","post_type_id":"1","score":"-1","tags":"python|dictionary","view_count":"399"} +{"id":"6131356","title":"Javascript errors after upgrading to .NET 4.0","body":"\u003cp\u003eI have inherited a working VB.NET 2.0 web app that has several User Controls with GridViews inside Update Panels. After running the VS 2010 Upgrade Wizard, the app runs fine in the debugger except for a couple of these Gridviews. In these, update and delete work but adding a new item causes the following javascript error when Save is clicked (calling DoPostBackWithOptions):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eMicrosoft jscript runtime error \nSys.WebForms.PageRequestManagerServerErrorException: Index was out of range. Must be non-negative and less than the size of the collection.\nParameter name: index\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy theory is that the code is fine (I haven't touched it) and that there is some sort of configuration issue causing this. I have looked through SO and elsewhere and have tweaked my web config and updated the Ajax toolkit assembly. I got nowhere stepping thru the ScriptResource.axd javascript throwing the error. Any suggestions?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eUpdate\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eThe app works fine if I upgrade it to .NET 3.5 using the VS 2008 wizard. However, if I then upgrade that to 4.0 with VS 2010 the problem resurfaces.\u003c/p\u003e","accepted_answer_id":"6153322","answer_count":"2","comment_count":"0","creation_date":"2011-05-25 21:45:52.743 UTC","last_activity_date":"2011-05-27 14:02:00.277 UTC","last_edit_date":"2011-05-26 17:53:50.667 UTC","last_editor_display_name":"","last_editor_user_id":"12281","owner_display_name":"","owner_user_id":"12281","post_type_id":"1","score":"0","tags":"asp.net|gridview|webforms|updatepanel","view_count":"1753"} +{"id":"18253678","title":"Percentage calculation between two values","body":"\u003cp\u003eI want to obtain a result between 0.0 and -0.5. I have the values: MIN = x, MAX = y and IN = x. The value MIN should result in a percent of -0.5% and MAX 0.0%. For example, if the value of MIN is 240px, the MAX is 600px and the IN is 360px the IN should result a percent of -0.33%. But I don't know how to do this calculation.\u003c/p\u003e\n\n\u003cp\u003eP.S.: the IN can't be higher than 0.0 or lower than -0.5.\nP.S.2: sorry about my english.\u003c/p\u003e\n\n\u003cp\u003eThe code I tried, but didn't work:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efloat percent = (((currentX / max) * min) / (max - min) * (-1)); Animation openNavigationDrawer = new TranslateAnimation( Animation.RELATIVE_TO_PARENT, percent, Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f); openNavigationDrawer.setDuration(200); navigationDrawer.setAnimation(openNavigationDrawer);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd the second one (worked, but was not good):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efloat percent = -0.0f;\n float posDividerDefault = max / 12, \n posDividerOne = min + posDividerDefault, posDividerTwo = posDividerOne + posDividerDefault, \n posDividerThree = posDividerTwo + posDividerDefault, posDividerFour = posDividerThree + posDividerDefault, \n posDividerFive = posDividerFour + posDividerDefault, posDividerSix = posDividerFive + posDividerDefault;\n\n if (currentX \u0026lt; posDividerOne) {\n percent = -0.5f;\n\n } else if (currentX \u0026gt; posDividerOne \u0026amp;\u0026amp; currentX \u0026lt; posDividerTwo) {\n percent = -0.45f;\n\n } else if (currentX \u0026gt; posDividerTwo \u0026amp;\u0026amp; currentX \u0026lt; posDividerThree) {\n percent = -0.4f;\n\n } else if (currentX \u0026gt; posDividerThree \u0026amp;\u0026amp; currentX \u0026lt; posDividerFour) {\n percent = -0.3f;\n\n } else if (currentX \u0026gt; posDividerFour \u0026amp;\u0026amp; currentX \u0026lt; posDividerFive) {\n percent = -0.2f;\n\n } else if (currentX \u0026gt; posDividerFive \u0026amp;\u0026amp; currentX \u0026lt; posDividerSix) {\n percent = -0.1f;\n\n } else if (currentX \u0026gt; posDividerSix) {\n percent = -0.0f;\n\n }\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"18253800","answer_count":"2","comment_count":"12","creation_date":"2013-08-15 13:27:32.733 UTC","last_activity_date":"2013-08-15 13:58:12.82 UTC","last_edit_date":"2013-08-15 13:43:09.693 UTC","last_editor_display_name":"","last_editor_user_id":"2363774","owner_display_name":"","owner_user_id":"2363774","post_type_id":"1","score":"-4","tags":"java|android|math","view_count":"1126"} +{"id":"11960602","title":"How to add something to PYTHONPATH?","body":"\u003cp\u003eI downloaded a package (called pysolr 2.0.15) to my computer to be used with Haystack. The instructions asks me to add pysolr to my PYTHONPATH.\u003c/p\u003e\n\n\u003cp\u003eWhat exactly does that mean? After extracting the pysolr files, I ran the command python setup.py install and that's about it. What did that do and do I need to do anything else?\u003c/p\u003e\n\n\u003cp\u003eThanks for the help!\u003c/p\u003e","accepted_answer_id":"11960723","answer_count":"2","comment_count":"3","creation_date":"2012-08-14 20:56:09.89 UTC","favorite_count":"4","last_activity_date":"2016-07-26 08:17:31.44 UTC","last_edit_date":"2013-05-03 10:35:26.993 UTC","last_editor_display_name":"","last_editor_user_id":"1563422","owner_display_name":"","owner_user_id":"1532755","post_type_id":"1","score":"15","tags":"python|django|django-haystack|pythonpath|pysolr","view_count":"25241"} +{"id":"27603118","title":"jquery this.attr(value) returns blank","body":"\u003cp\u003eQuick scenario: Got a series of input fields, on focus if default value it clears the field ready for input. On blur it tests for empty and sets the default value. First part (focus) works like a charm second part doesn't and I have stared at the code to long and have clearly become blind to my error.\u003c/p\u003e\n\n\u003cp\u003eHTML:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;label for=\"name\"\u0026gt;Navn: *\u0026lt;/label\u0026gt;\n\u0026lt;input type=\"text\" name=\"name\" id=\"name\" value=\"Dit Navn\"\u0026gt;\u0026lt;br\u0026gt;\n\u0026lt;label for=\"email\"\u0026gt;E-mail: *\u0026lt;/label\u0026gt;\n\u0026lt;input type=\"text\" name=\"email\" id=\"email\" value=\"eksempel@mail.dk\"\u0026gt;\u0026lt;br\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe jQuery that works:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ejQuery(\"#dfwylf_Overlay input:text\").focus(function(){\n if ( jQuery(this).attr(\"value\") == jQuery(this).val() ){\n jQuery(this).val(\"\");\n }\n})\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethe code that doesn't work:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ejQuery(\"#dfwylf_Overlay input:text\").blur(function(){\n console.log(jQuery(this).attr(\"value\"));\n //the above outputs empty\n if ( jQuery(this).val() == \"\" ){\n jQuery(this).val(jQuery(this).attr(\"value\"));\n }\n})\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"11","creation_date":"2014-12-22 12:51:28.123 UTC","last_activity_date":"2014-12-22 13:06:38.097 UTC","last_edit_date":"2014-12-22 12:56:51.91 UTC","last_editor_display_name":"","last_editor_user_id":"1200463","owner_display_name":"","owner_user_id":"1200463","post_type_id":"1","score":"0","tags":"jquery","view_count":"203"} +{"id":"12905551","title":"ADF: panel splitter and command tool bar button","body":"\u003cp\u003eI have create ADF application which has page that using panel splitter and command tool bar button.\n 1.How to make panel splitter width fixed and and cannot be moved in the ADF pages?\n Since currently, i can move the splitter using mouse and adjust the size.\u003c/p\u003e\n\n\u003cp\u003e2.How to disable command toolbar button or change the colour after click? Reason I do \n like this is to let user know which page that currently view right now.\n For example: I have navigation bar(using command Toolbar button) \n -HOME\n -REGISTRATION\n -VIEW PROJECT\n If I choose REGISTRATION button,it will display registration page.REGISTRATION button \n will disable or change colour until other button has been choose.\u003c/p\u003e\n\n\u003cp\u003eCan anyone help?Need this thing urgently.\nThanks in advance.\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2012-10-15 23:41:38.097 UTC","last_activity_date":"2012-10-18 06:59:32.757 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1394991","post_type_id":"1","score":"0","tags":"panel|toolbar|oracle-adf|splitter","view_count":"2927"} +{"id":"14278041","title":"replace underscore with dash using url rewrite module of iis","body":"\u003cp\u003eI have issue regarding Url rewrite module.\u003c/p\u003e\n\n\u003cp\u003eI want to implement permanent redirect (301) into my site. and url is, I want to permanently redirect\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://demo.datadiary.com/search/product/ahmedabad/ac_dealers\" rel=\"nofollow\"\u003ehttp://demo.datadiary.com/search/product/ahmedabad/ac_dealers\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eurl to\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://demo.datadiary.com/search/product/ahmedabad/ac-dealers\" rel=\"nofollow\"\u003ehttp://demo.datadiary.com/search/product/ahmedabad/ac-dealers\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThanks in advance.\u003c/p\u003e","accepted_answer_id":"14296474","answer_count":"1","comment_count":"2","creation_date":"2013-01-11 12:17:10.49 UTC","last_activity_date":"2013-01-12 18:19:38.177 UTC","last_edit_date":"2013-01-11 15:40:17.33 UTC","last_editor_display_name":"","last_editor_user_id":"1777213","owner_display_name":"","owner_user_id":"1777213","post_type_id":"1","score":"1","tags":"asp.net|url|web-config|rewrite","view_count":"1524"} +{"id":"2453846","title":"count date difference in hours using php and mysql","body":"\u003cp\u003eHow can i find the date difference in hours using php and mysql both.\u003c/p\u003e","accepted_answer_id":"2453861","answer_count":"2","comment_count":"0","creation_date":"2010-03-16 11:19:27.587 UTC","last_activity_date":"2012-04-15 11:37:22.41 UTC","last_edit_date":"2012-04-15 11:37:22.41 UTC","last_editor_display_name":"","last_editor_user_id":"367456","owner_display_name":"","owner_user_id":"148478","post_type_id":"1","score":"1","tags":"php|mysql|datetime|date","view_count":"2197"} +{"id":"6779836","title":"How to write something in binary and assign it to a variable?","body":"\u003cblockquote\u003e\n \u003cp\u003e\u003cstrong\u003ePossible Duplicate:\u003c/strong\u003e\u003cbr\u003e\n \u003ca href=\"https://stackoverflow.com/questions/867365/in-java-can-i-define-an-integer-constant-in-binary-format\"\u003eIn Java, can I define an integer constant in binary format?\u003c/a\u003e \u003c/p\u003e\n\u003c/blockquote\u003e\n\n\n\n\u003cp\u003eIn python, you can do something like:\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003ea = 0b00000010\u003c/code\u003e which would set a to 2.\u003c/p\u003e\n\n\u003cp\u003eIs it possible to do something like that in Java? I know I could just go through and assign my varibles by the number instead of binary, but I like the visual.\u003c/p\u003e\n\n\u003cp\u003eThanks ~Aedon\u003c/p\u003e","accepted_answer_id":"6779884","answer_count":"1","comment_count":"9","creation_date":"2011-07-21 16:57:49.58 UTC","favorite_count":"1","last_activity_date":"2011-07-21 17:03:06.46 UTC","last_edit_date":"2017-05-23 12:14:31.68 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"480691","post_type_id":"1","score":"3","tags":"java","view_count":"5631"} +{"id":"1991144","title":"Annotation-based and xml-based transaction definitions precedence","body":"\u003cp\u003eI couldn't find a definitive answer to this in the docs, and although there seems to be a logical answer, one can't be sure. The scenario is this - you have a xml-based transaction definition, like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;tx:advice id=\"txAdvice\" transaction-manager=\"jpaTransactionManager\"\u0026gt;\n \u0026lt;tx:attributes\u0026gt;\n \u0026lt;tx:method name=\"*\" propagation=\"REQUIRED\" /\u0026gt;\n \u0026lt;/tx:attributes\u0026gt;\n\u0026lt;/tx:advice\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhich advises all service methods. But then you have \u003ccode\u003e@Transactional\u003c/code\u003e on a concrete class/method, where you want to override the \u003ccode\u003epropagation\u003c/code\u003e attribute.\u003c/p\u003e\n\n\u003cp\u003eIt is clear that \u003ccode\u003e@Transactional\u003c/code\u003e at method-level overrides the same one at class-level, but does it override the \u003ccode\u003e\u0026lt;tx:advice\u0026gt;\u003c/code\u003e (and actually, the \u003ccode\u003e\u0026lt;aop:pointcut\u0026gt;\u003c/code\u003e)? \u003c/p\u003e\n\n\u003cp\u003eI hope two interceptors won't be created on the same class, (and whichever happens to be first will start the transaction)\u003c/p\u003e","accepted_answer_id":"1991806","answer_count":"2","comment_count":"0","creation_date":"2010-01-02 09:58:25.227 UTC","favorite_count":"2","last_activity_date":"2010-08-13 12:06:58.153 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"203907","post_type_id":"1","score":"4","tags":"java|spring","view_count":"2331"} +{"id":"30134333","title":"Multiple HttpWebRequests on single connection","body":"\u003cp\u003eSo I'm trying to write a client for a specific Server, imitating the behavior of what I see in the dev tools of browsers like Chrome and Firefox. I'm using HttpWebRequest and it seems to work great for me for an INDIVIDUAL exchange, but as soon as I need to make use of another it never works. I figured that I would just need to store my ConnectionToken so that the Server could recognize me as the same client across multiple requests, but that clearly is not the case. Here is an example.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Collections;\nusing System.Net;\nusing System.IO;\nusing System.Diagnostics;\nusing System.Web.Script.Serialization;\n\n\nnamespace WebClient\n{\n class WebClientProgram\n {\n\n static void Main(string[] args)\n {\n //FIRST REQUEST, NEGOTIATE\n DateTime unixStart = DateTime.SpecifyKind(new DateTime(1970, 1, 1), DateTimeKind.Utc);\n long epoch = (long)Math.Floor((DateTime.Now.ToUniversalTime() - unixStart).TotalSeconds);\n String timestamp = Convert.ToString(epoch);\n String uri = \"http://domain/signalr/negotiate?_=\" + timestamp;\n HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);\n //Set REQUEST values\n request.Credentials = new NetworkCredential(\"username\", \"password\");\n request.Method = \"GET\";\n request.KeepAlive = true;\n\n HttpWebResponse response = (HttpWebResponse)request.GetResponse();\n StreamReader reader = new StreamReader(response.GetResponseStream());\n JavaScriptSerializer jSerialize = new JavaScriptSerializer();\n Dictionary\u0026lt;string, string\u0026gt; responseDictionary = jSerialize.Deserialize\u0026lt;Dictionary\u0026lt;string, string\u0026gt;\u0026gt;(reader.ReadToEnd());\n reader.Close();\n response.Close();\n String connectionToken = responseDictionary[\"ConnectionToken\"];//Save my unique connection token\n String connectionID = responseDictionary[\"ConnectionId\"];\n String protocolVersion = responseDictionary[\"ProtocolVersion\"];\n\n //SECOND REQUEST, START\n epoch = (long)Math.Floor((DateTime.Now.ToUniversalTime() - unixStart).TotalSeconds);\n timestamp = Convert.ToString(epoch);\n uri = \"http://domain/signalr/start?clientProtocol=\" + protocolVersion + \"\u0026amp;connectionToken=\" + connectionToken + \"\u0026amp;_=\" + timestamp;\n request = (HttpWebRequest)WebRequest.Create(uri);\n //Set REQUEST values\n request.Credentials = new NetworkCredential(\"username\", \"password\");\n request.Method = \"GET\";\n request.KeepAlive = true;\n\n response = (HttpWebResponse)request.GetResponse();//On this line I receive a 400 error from the server\n reader = new StreamReader(response.GetResponseStream());\n File.WriteAllText(@\"start.txt\", reader.ReadToEnd());\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo this is me trying to do a basic exchange for a SignalR server, which is what I'm trying to attach to. I first NEGOTIATE and get back a distinct ConnectionToken that I use for the following request. That following request, however, always runs into a response \"400: The connection-id is in the incorrect format\".\nAny thoughts? Thanks guys.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-05-08 23:35:56.87 UTC","last_activity_date":"2015-05-09 14:51:09.473 UTC","last_edit_date":"2015-05-09 14:51:09.473 UTC","last_editor_display_name":"","last_editor_user_id":"1693804","owner_display_name":"","owner_user_id":"1693804","post_type_id":"1","score":"1","tags":"c#|connection|client|httpwebrequest","view_count":"482"} +{"id":"40789574","title":"intersection of search (in diff. fields) - Lucene","body":"\u003cp\u003eI tried following in Lucene 6.2.1:\u003c/p\u003e\n\n\u003cp\u003eI have different fields \u003ccode\u003eA\u003c/code\u003e,\u003ccode\u003eB\u003c/code\u003e,\u003ccode\u003eC\u003c/code\u003e,\u003ccode\u003eD\u003c/code\u003e,\u003ccode\u003eE\u003c/code\u003e and I make for every field a different \u003ccode\u003esearchquery\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eThen I want to make a intersection. Show it, when the result is everywhere true.\u003c/p\u003e\n\n\u003cp\u003eSomeone told me to try this with \u003ccode\u003eBooleanquery\u003c/code\u003e. So this is my approach:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eIndexReader reader = DirectoryReader.open(FSDirectory.open(Paths.get(index)));\nIndexSearcher searcher = new IndexSearcher(reader);\nAnalyzer analyzer = new StandardAnalyzer();\n\nBufferedReader in = null;\nin = new BufferedReader(new InputStreamReader(System.in, StandardCharsets.UTF_8));\n\nQueryParser parser1 = new QueryParser(\"A\", analyzer);// i have 5 different QueryParser\nQuery qPersonen = parser1.parse(\"searchstring\"); // i have also 5 Queries\nbooleanQuery.add(qPersonen, BooleanClause.Occur.MUST);\n\nTotalHitCountCollector collector = new TotalHitCountCollector();\nTopDocs results = searcher.search(booleanQuery.build(), 100);\n\nScoreDoc[] hits = results.scoreDocs;\nint numTotalHits = results.totalHits;\nSystem.out.println(\"Results: \" + numTotalHits);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhy isn't it working? What could be the fault? It always returns no results :(\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2016-11-24 15:03:29.69 UTC","last_activity_date":"2016-11-28 21:34:24.683 UTC","last_edit_date":"2016-11-28 21:34:24.683 UTC","last_editor_display_name":"","last_editor_user_id":"5112804","owner_display_name":"","owner_user_id":"7205862","post_type_id":"1","score":"0","tags":"search|lucene|field|intersection","view_count":"66"} +{"id":"15080285","title":"db-driven / programmatic validation asp.net mvc?","body":"\u003cp\u003eI want to create a system where users can create forms through a UI, and the list of fields gets stored in in the database. The user can then choose validations for the form, and those get stored in the datbase too. When a user visits the form, the correct fields are displayed, and when they submit the form the correct validations are pulled from the db and run against the submitted data. Is there already any kind of system that does this (ideally open source). \u003c/p\u003e\n\n\u003cp\u003eI know there are form and survey services out there but I don't want a SaaS solution because I need to be able to customize most aspects (front end, server side, and db). \u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-02-26 02:25:11.087 UTC","favorite_count":"1","last_activity_date":"2013-02-26 02:50:23.743 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2109535","post_type_id":"1","score":"0","tags":"asp.net-mvc|forms|asp.net-mvc-4|validation","view_count":"72"} +{"id":"36496778","title":"Can't set current day on DatePickerDialog","body":"\u003cp\u003eThis is my code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eDatePickerDialog dialog = new DatePickerDialog(OtherEventActivity.this, R.style.DatePickerDialogTheme,\n new DateSetListener(), mYear, (mMonth), mDay);\ntry {\n dialog.getDatePicker().setMaxDate(System.currentTimeMillis());\n} catch (Exception e) {}\n\ndialog.show();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I start app I can't press on the current day on Android 5 (higher or below works good).\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eUPD\u003c/strong\u003e - I tried this too: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edialog.getDatePicker().setMaxDate(new Date().getTime());\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"36496887","answer_count":"1","comment_count":"0","creation_date":"2016-04-08 10:01:19.11 UTC","favorite_count":"2","last_activity_date":"2016-04-08 11:25:48.47 UTC","last_edit_date":"2016-04-08 11:25:48.47 UTC","last_editor_display_name":"","last_editor_user_id":"2834553","owner_display_name":"","owner_user_id":"3871859","post_type_id":"1","score":"0","tags":"android|datepicker","view_count":"49"} +{"id":"36391040","title":"Sails can't distinguish GET from POST in routes.js?","body":"\u003cp\u003eI was looking at sails and building some simple user auth app with it. Routes were written in config/routes.js:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e 'GET /signup': {view:'signup'},\n 'POST /signup':'UserController.signup'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut when I make a POST request \u003cem\u003elocalhost:1337/signup\u003c/em\u003e, I getting view in response (Chrome - \u003e Network shows that). Have no idea what I did wrong there. \u003c/p\u003e\n\n\u003cp\u003eCan you help me?\u003c/p\u003e\n\n\u003cp\u003eCode from api/controllers/UserController.js:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emodule.exports = { \n signup: function(req, res){\n console.log('Please, be in console');\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAngular code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eangular.module('SignupMod').controller('SignupCtrl',['$scope', '$http', function($scope, $http){\n console.log('Signup Controller Started');\n\n $scope.runSignup = function(){\n console.log('Signing Up ' + $scope.name);\n\n //Submit to Sails Server\n $http.post('/signup', {\n name: $scope.name,\n email: $scope.email,\n password: $scope.password\n })\n .then(function onSuccess(response){\n console.log('Success!');\n })\n .catch(function onError(err){\n console.log('Error: ', err);\n })\n }\n}])\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"36499892","answer_count":"1","comment_count":"9","creation_date":"2016-04-03 20:53:00.24 UTC","last_activity_date":"2016-04-08 12:44:55.123 UTC","last_edit_date":"2016-04-08 07:30:07.143 UTC","last_editor_display_name":"","last_editor_user_id":"2628218","owner_display_name":"","owner_user_id":"2628218","post_type_id":"1","score":"0","tags":"sails.js","view_count":"54"} +{"id":"4245684","title":"Emacs aspect ratio definition when maximizing or fullscreen","body":"\u003cp\u003ewhen emacs starts up in fullscreen(even if that is triggered from .emacs) on the bottom of the screen i have a \"dead\" area which shows nothing.\nif I de-maximize and remaximize everithing works fine though,\nIs there a way to explicitly define the aspect ratio of emacs(or some other solution)?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2010-11-22 13:06:38.883 UTC","last_activity_date":"2011-09-04 12:30:20.787 UTC","last_edit_date":"2011-09-04 12:30:20.787 UTC","last_editor_display_name":"","last_editor_user_id":"133","owner_display_name":"","owner_user_id":"325809","post_type_id":"1","score":"2","tags":"emacs|window|fullscreen|ratio","view_count":"175"} +{"id":"39538658","title":"R GGplot2 Stacked Columns Chart","body":"\u003cp\u003eI am trying to do a Stacked Columns Chart in R. Sorry but I am learning thats why i need help\u003c/p\u003e\n\n\u003cp\u003eThis is how i have the data\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003estructure(list(Category = structure(c(2L, 3L, 4L, 1L), .Label = c(\"MLC1000\", \n \"MLC1051\", \"MLC1648\", \"MLC5726\"), class = \"factor\"), Minutes = c(2751698L, \n 2478850L, 556802L, 2892097L), Items = c(684L, 607L, 135L, 711L\n ), Visits = c(130293L, 65282L, 25484L, 81216L), Sold = c(2625L, \n 1093L, 681L, 1802L)), .Names = c(\"Category\", \"Minutes\", \"Items\", \n \"Visits\", \"Sold\"), class = \"data.frame\", row.names = c(NA, -4L)\n)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd i want to create this graphic\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://oi68.tinypic.com/j79fer.jpg\" rel=\"nofollow noreferrer\"\u003ehttp://oi68.tinypic.com/j79fer.jpg\u003c/a\u003e\u003c/p\u003e","answer_count":"1","comment_count":"7","creation_date":"2016-09-16 19:13:24.45 UTC","last_activity_date":"2016-09-16 20:40:13.347 UTC","last_edit_date":"2016-09-16 19:56:33.263 UTC","last_editor_display_name":"","last_editor_user_id":"2461552","owner_display_name":"","owner_user_id":"3788172","post_type_id":"1","score":"-5","tags":"r|ggplot2","view_count":"67"} +{"id":"18524246","title":"How to do Delete/Define with using IDCAMS using batch JCL (z/VSE)","body":"\u003cp\u003eI have a sample code of delete/define using IDCAMS in z/OS, but I dont think it will work on z/VSE. Can someone help me convert this? The file created should be VSAM-kSDS.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e//VDFNDEL JOB 1,SAMPLE,MSGCLASS=X\n//STEP1 EXEC PGM=IDCAMS\n//SYSPRINT DD SYSOUT=* \n//SYSIN DD * \n\n DELETE SAMPLE.DATA.VSAM CLUSTER\n\n/* \n//STEP2 EXEC PGM=IDCAMS\n//SYSPRINT DD *\n//DATAIN DD DISP=OLD,DSN=SAMPLE.SORTOUT \n//SYSIN DD *\n\n DEFINE CLUSTER (NAME (SAMPLE.DATA.VSAM) -\n VOLUMES(WORK02) CYLINDERS(1 1) -\n RECORDSIZE (72 100) KEYS(9 8) INDEXED)\n\n REPRO INFILE(DATAIN) OUTDATASET(SAMPLE.DATA.VSAM) ELIMIT(200)\n\n/*\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"18526557","answer_count":"1","comment_count":"2","creation_date":"2013-08-30 03:05:36.837 UTC","last_activity_date":"2014-10-31 01:08:33.96 UTC","last_edit_date":"2013-08-30 13:34:33.537 UTC","last_editor_display_name":"","last_editor_user_id":"1927206","owner_display_name":"","owner_user_id":"2155147","post_type_id":"1","score":"0","tags":"jcl|vsam","view_count":"18795"} +{"id":"21231968","title":"read multiple netcdf files - matlab","body":"\u003cp\u003eI have 40 netcdf files named 'lffd1961_V10M_Iberia.nc', 'lffd1962_V10M_Iberia' ... 'lffd2000_V10M_Iberia'.\u003c/p\u003e\n\n\u003cp\u003eI want open all of them in same program, get the same variable in all of them, apply some equation in that variable and create 40 new netcdf files with that variable modified.\u003c/p\u003e\n\n\u003cp\u003eTo open the 40 files I've developed this code and it works.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efor yr=1961:2000\ninFile=strcat('lffd',num2str(yr),'_V10M_Iberia.nc'); disp(inFile)\nnc=netcdf.open(inFile,'NC_NOWRITE');\nnetcdf.close(nc)\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow I want get the variable number 4 in all of them. This variable is a 3D matrix (70x51x(8760 or 8784))\nSomething like this next line but with a 40 years loop:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ews_1961(1962, etc, etc) = netcdf.getVar(nc,4);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand it's supposed to have 40 new variables in my workspace.\nAfter this I want to apply this equation in all of that 40 variables:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ews_80 = ws.*(log(z/alpha)/log(exp(1))/(log(10/alpha)/log(exp(1))));\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand finally create 40 new netcdf files with my new variable in each file.\u003c/p\u003e\n\n\u003cp\u003esomething like that:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eoutFile=strcat('year',num2str(yr),'_80m.nc')\nncid = netcdf.create(outFile,'CLOBBER');\n\ndimid0 = netcdf.defDim(ncid,'longitude',nlon); % getvar number 1\ndimid1 = netcdf.defDim(ncid,'latitude',nlat); %getvar number 2\ndimid2 = netcdf.defDim(ncid,'time',nt); %getvar number 3\n\nvarid0 = netcdf.defVar(ncid,'longitude','double', dimid0);\nvarid1 = netcdf.defVar(ncid,'latitude','double', dimid1);\nvarid2 = netcdf.defVar(ncid,'time','double', dimid2);\nvarid3 = netcdf.defVar(ncid,'ws_80','double', [dimid0 dimid1 dimid2]);\n\nnetcdf.putAtt(ncid,varid0,'units','degrees_east');\nnetcdf.putAtt(ncid,varid0,'long_name','longitude');\n\nnetcdf.putAtt(ncid,varid1,'units','degrees_north');\nnetcdf.putAtt(ncid,varid1,'degrees_north','latitude');\n\nnetcdf.endDef(ncid);\n\nnetcdf.putVar(ncid,varid0,longitude);\nnetcdf.putVar(ncid,varid1,latitude);\nnetcdf.putVar(ncid,varid2,time);\nnetcdf.putVar(ncid,varid3,ws80);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt's hard for me to explain this in a way that all of you understand so please be confortable to ask whatever you want.\u003c/p\u003e","accepted_answer_id":"21239268","answer_count":"1","comment_count":"4","creation_date":"2014-01-20 10:49:45.137 UTC","last_activity_date":"2016-06-28 09:08:09.17 UTC","last_edit_date":"2014-01-29 11:58:35.84 UTC","last_editor_display_name":"","last_editor_user_id":"321731","owner_display_name":"","owner_user_id":"2999503","post_type_id":"1","score":"0","tags":"matlab|file-io|netcdf","view_count":"1957"} +{"id":"25997375","title":"iOS app hanging on splash screen - compatibility issues?","body":"\u003cp\u003eiOS 8, xcode 6.0.1, unity 4.54f1\u003c/p\u003e\n\n\u003cp\u003eLast night I updated my iPhone5 to iOS 8. It requested \u003ccode\u003excode 6.0.1\u003c/code\u003e which in turn requested to update Unity. I did everything that was asked and now after I build to my iPhone, the app gets stuck on the splash screen. I tried building to an iPad with iOS 7 and that did not work either.\u003c/p\u003e\n\n\u003cp\u003eThey both get stuck after the log says \u003ccode\u003eapplicationDidBecomeActive()\u003c/code\u003e and then \u003ccode\u003eapplicationWillResignActive()\u003c/code\u003e. Exiting the app will say that \u003ccode\u003eThread0\u003c/code\u003e has crashed and it will show me a method call that worked fine 2 days ago. Android still works perfectly fine.\u003c/p\u003e\n\n\u003cp\u003eMy question is: are there compatibility issues between xcode/unity/ios8/all 3 at this point? What can I do about it?\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2014-09-23 14:13:42.59 UTC","last_activity_date":"2014-09-24 13:37:54.083 UTC","last_edit_date":"2014-09-23 14:40:45.423 UTC","last_editor_display_name":"","last_editor_user_id":"1167012","owner_display_name":"","owner_user_id":"4070811","post_type_id":"1","score":"2","tags":"xcode|unity3d|ios8","view_count":"491"} +{"id":"42812546","title":"HttpWebRequest.RequestURI.Scheme Always Returning 'https'","body":"\u003cpre\u003e\u003ccode\u003e static void Main()\n {\n Console.WriteLine(\"10504: \" + TestURL(\"business.lynchburgchamber.org\"));\n Console.WriteLine(\"Google: \" + TestURL(\"google.com\"));\n\n Console.ReadKey();\n }\n\n static string TestURL(string baseURL)\n {\n try\n {\n string httpsURL = \"https://\" + baseURL;\n HttpWebRequest request = (HttpWebRequest)WebRequest.Create(httpsURL);\n return request.RequestUri.Scheme;\n }\n catch\n {\n string httpURL = \"http://\" + baseURL;\n HttpWebRequest request = (HttpWebRequest)WebRequest.Create(httpURL);\n return request.RequestUri.Scheme;\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am testing urls to see if they are either http or https. My idea was to use an HttpWebRequest to check if the https request goes through, and if it fails go for the http. My problem is that if I go to \u003ccode\u003ehttps://business.lynchburgchamber.org\u003c/code\u003e in my browser if fails to connect, but my web request in my program returns https. Anyone have a better way to do this?\u003c/p\u003e","accepted_answer_id":"42812688","answer_count":"2","comment_count":"0","creation_date":"2017-03-15 14:25:01.147 UTC","last_activity_date":"2017-03-15 14:31:05.333 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4656713","post_type_id":"1","score":"0","tags":"c#|httpwebrequest","view_count":"140"} +{"id":"38400717","title":"Foreign Keys on two different schemas mysql","body":"\u003cp\u003eI have two tables on distinct schemas\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003edb1.invoice\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cblockquote\u003e\n\u003cpre\u003e\u003ccode\u003eCREATE TABLE IF NOT EXISTS db1.`invoice` (\n `invoice_id` int(11) NOT NULL AUTO_INCREMENT,\n `qsales_sale_id` int(11) DEFAULT NULL,\n `invoice_id_from_dosage_id` int(11) NOT NULL,\n `number` int(11) DEFAULT NULL,\n `enterprise_name` varchar(100) DEFAULT NULL,\n `subsidiary_name` varchar(100) DEFAULT NULL,\n `subsidiary_address` varchar(200) DEFAULT NULL,\n `subsidiary_phone` varchar(40) DEFAULT NULL,\n `client_name` varchar(200) DEFAULT NULL,\n `nit` bigint(20) DEFAULT NULL,\n `was_paid` tinyint(1) DEFAULT NULL,\n PRIMARY KEY (`invoice_id`),\n KEY `fk_invoice_qsales_sale1_idx` (`qsales_sale_id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=457 ;\n\u003c/code\u003e\u003c/pre\u003e\n\u003c/blockquote\u003e\n\n\u003col start=\"2\"\u003e\n\u003cli\u003ebd2.qsale_sale\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cblockquote\u003e\n\u003cpre\u003e\u003ccode\u003eCREATE TABLE IF NOT EXISTS db2.qsales_sale (\n `qsales_sale_id` int(11) NOT NULL AUTO_INCREMENT,\n `qsales_order_type_id` int(11) NOT NULL,\n `client_id` int(11) NOT NULL,\n `total_cost` decimal(10,2) DEFAULT NULL,\n `currency` varchar(45) DEFAULT NULL,\n `created_at` datetime DEFAULT NULL,\n `has_discount` tinyint(1) DEFAULT NULL,\n `created_by` int(11) NOT NULL,\n `is_wholesaler` tinyint(1) NOT NULL DEFAULT '0',\n `payment_type` varchar(65) DEFAULT NULL,\n PRIMARY KEY (`qsales_sale_id`),\n KEY `fk_qsales_sale_qsales_order_type1_idx` (`qsales_order_type_id`),\n KEY `fk_qsales_sale_client1_idx` (`client_id`),\n KEY `fk_qsales_sale_employee1_idx` (`created_by`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=51 ;\n\u003c/code\u003e\u003c/pre\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003ethen i want to add a foreign key\nI try:\n1.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ealter table bd1.invoice\n add foreign key fk_invoice_qsales_sale1(qsales_sale_id) \n references db2.qsales_sale (qsales_sale_id)\n on delete cascade\n on update cascade;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003col start=\"2\"\u003e\n\u003cli\u003e\u003cp\u003eALTER TABLE db1.invoice\n ADD CONSTRAINT \u003ccode\u003efk_invoice_qsales_sale1\u003c/code\u003e FOREIGN KEY (\u003ccode\u003eqsales_sale_id\u003c/code\u003e) \nREFERENCES \u003ccode\u003edb2\u003c/code\u003e.\u003ccode\u003eqsales_sale\u003c/code\u003e (\u003ccode\u003eqsales_sale_id\u003c/code\u003e) ON DELETE NO ACTION ON UPDATE NO ACTION;\u003c/p\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eBut i have this error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eError Code: 1452. Cannot add or update a child row: a foreign key constraint fails (`qfix`.`#sql-a28_5`, CONSTRAINT `#sql-a28_5_ibfk_1` FOREIGN KEY (`qsales_sale_id`) REFERENCES `qsales`.`qsales_sale` (`qsales_sale_id`) ON DELETE CASCADE ON UPDATE CASCADE)\n\n0.625 sec\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"4","creation_date":"2016-07-15 16:11:30.77 UTC","favorite_count":"1","last_activity_date":"2017-03-26 02:19:44.947 UTC","last_edit_date":"2017-03-26 02:19:44.947 UTC","last_editor_display_name":"","last_editor_user_id":"1033581","owner_display_name":"","owner_user_id":"6595072","post_type_id":"1","score":"1","tags":"mysql|database|foreign-keys","view_count":"33"} +{"id":"17610551","title":"Retrieving a QStandardItem through QStandardItemModel by searching or key","body":"\u003cp\u003eIs there any way to assign a unique key to an entry in a QStandardItemModel so that we can check for the presence of that key. If it is present we get the relevant QstandardItem ?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eUpdate:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eHere is what I am trying to do. I have 3 column in my table so so i have 3 QStandardItem.\nThis is the code I am using\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eQStandardItem* item0 = new QStandardItem(\"Column1\");\nQStandardItem* item1 = new QStandardItem(\"Column2\");\nQStandardItem* item2 = new QStandardItem(\"Column3\");\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow my model is called moddel and I am attaching these to my model as such\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emoddel-\u0026gt;setItem(0,0,item0);\nmoddel-\u0026gt;setItem(0,1,item1);\nmoddel-\u0026gt;setItem(0,2,item2);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI need to assign a row some unique key so that I could check the model for that key and the model would return the row number. Any suggetsions.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-07-12 08:20:42.65 UTC","last_activity_date":"2013-07-12 22:02:50.483 UTC","last_edit_date":"2013-07-12 22:02:50.483 UTC","last_editor_display_name":"","last_editor_user_id":"1305891","owner_display_name":"","owner_user_id":"1305891","post_type_id":"1","score":"0","tags":"c++|qt|qstandarditemmodel","view_count":"468"} +{"id":"8407253","title":"wxWidgets right to left Direction","body":"\u003cp\u003eI have a wxWidgets form and I have a wxTextCtrl on it, it has left-to-right direction by default. I want to change it to right-to-left Direction.\nhow can I do this on C++.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2011-12-06 21:41:33.1 UTC","last_activity_date":"2013-03-22 15:28:10.407 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1084419","post_type_id":"1","score":"1","tags":"wxwidgets|direction","view_count":"324"} +{"id":"1769557","title":"ASP.NET RenderControl or RenderChildren fail","body":"\u003cp\u003eI need to use objChildControl.RenderControl or objControl.RenderChildren to manually render my child controls. But it looks like these methods are incomplete.\u003c/p\u003e\n\n\u003cp\u003eAll my child controls use the OnPreRender event to register clientscript and client stylesheets (since these can only be created in the prerender event).\u003c/p\u003e\n\n\u003cp\u003eI have 2 main issues, passing the current System.Web.UI.Page object to a child control and making sure the OnPreRender event is fired on these child controls.\u003c/p\u003e\n\n\u003cp\u003eIt seems that I can't use the RenderControl method on my child controls since the OnPreRender event will not be called.\nI can however pass the Page object by objChildControl.Page = Me.Page\u003c/p\u003e\n\n\u003cp\u003eWhen I use RenderChildren I cannot pass the Page object, or can I?\nAnd i'm not sure if the OnPreRender event is even called when I use RenderChildren.\u003c/p\u003e\n\n\u003cp\u003eSome help would be appreciated, since i'm stuck ;)\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eUpdate\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI found a way to get the result I need, but it is not the solution I want.\nExample:\u003c/p\u003e\n\n\u003cp\u003eCode I want:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;wc:ParentControl id=\"objParent\" runat=\"server\" bla=\"etc\"\u0026gt;\n\u0026lt;Content\u0026gt; \u0026lt;!-- This is an InnerProperty of the ParentControl --\u0026gt;\u0026lt;DIV\u0026gt;bla bla bla bla.....\u0026lt;wc:SomeControl id=\"objSomeControl\" runat=\"server\" /\u0026gt;\u0026lt;wc:3rdPartyControl id=\"obj3rdPartyControl\" runat=\"server\" /\u0026gt;\u0026lt;/DIV\u0026gt;\u0026lt;/Content\u0026gt;\n\u0026lt;/wc:ParentControl\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCodeBehind: objParentControl.Content.RenderControl(Writer)\u003c/p\u003e\n\n\u003cp\u003eAnd then the issues mentioned above will begin. How to make sure that for all the children within Content the OnPreRender will be called?\u003c/p\u003e\n\n\u003cp\u003eCode which does work (but then the RenderControl method is just useless):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;wc:ParentControl id=\"objParentControl\" runat=\"server\"\u0026gt;\u0026lt;/wc:ParentControl\u0026gt;\n\u0026lt;wc:Content id=\"objContent\" runat=\"server\"\u0026gt;\u0026lt;DIV\u0026gt;bla bla bla bla.....\u0026lt;wc:SomeControl id=\"objSomeControl\" runat=\"server\" /\u0026gt;\u0026lt;wc:3rdPartyControl id=\"obj3rdPartyControl\" runat=\"server\" /\u0026gt;\u0026lt;/DIV\u0026gt;\u0026lt;/wc:Content\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThen just use the RenderBeginTag and RenderEndTag of the wc:Content control.\nThen the OnPreRender event is called.\nBut I wan't to embed the content into the parentcontrol by using an InnerProperty.\nAnd then manually rendering the childcontrols by RenderControl or RenderChildren.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2009-11-20 10:18:57.807 UTC","last_activity_date":"2010-02-25 23:00:03.96 UTC","last_edit_date":"2009-11-20 11:20:59.6 UTC","last_editor_display_name":"","last_editor_user_id":"215326","owner_display_name":"","owner_user_id":"215326","post_type_id":"1","score":"3","tags":"asp.net|rendercontrol","view_count":"2619"} +{"id":"23067518","title":"quicky getting out of the catch block","body":"\u003cp\u003eI have a try-catch block as defined below and a for-each loop inside it.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etry\n{\n\n // Doing some JDBC Connections here\n\n Map\u0026lt;String,Connection\u0026gt; connections = new HashMap\u0026lt;\u0026gt;();\n\n while(DeviceRS.next()){\n final String ip_address = DeviceRS.getString(\"Connection_vch\");\n System.out.println(\"Value of the IP Address Field:\"+ip_address);\n connections.put(ip_address,DriverManager.getConnection(\"jdbc:mysql://\" + ip_address + \":3306/test\",RemoteUser,RemotePass));\n } \n\n for(final String ip : connections.keySet())\n {\n\n // Selecting and inserting into database here ...\n\n }// ENd of for loop\n\n}// ENd of try block\ncatch(SQLException ex){\n\nex.printStackTrace();\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo, if something goes wrong with the connection, my program will get stuck in the catch block,printing the stack trace. I want to move onto other connections. \u003c/p\u003e\n\n\u003cp\u003eIs there a way can exit the catch block quickly just after printing the stack trace?\u003c/p\u003e\n\n\u003cp\u003eNote: I haven't mentioned full code here as I think my question is not concerned with my code.\u003c/p\u003e","accepted_answer_id":"23067677","answer_count":"3","comment_count":"4","creation_date":"2014-04-14 18:29:10.103 UTC","last_activity_date":"2014-04-17 13:53:41.65 UTC","last_edit_date":"2014-04-17 05:21:07.207 UTC","last_editor_display_name":"user3525926","owner_display_name":"user3525926","post_type_id":"1","score":"0","tags":"java|jdbc","view_count":"85"} +{"id":"21111332","title":"How to Fix my social sharing buttons on wordpress where plugin messes up code","body":"\u003cp\u003eMy social share buttons on a post of my wordpress site point to the wrong page. If I click on Like or Share for Facebook, or tweet or google+ the wrong post rather than the current post gets shared.\u003c/p\u003e\n\n\u003cp\u003eAll normal posts are fine. This only happens on pages with the slider (created by a customized plugin). For eg. check out \u003ca href=\"http://mag.bollyholly.net/10-things-about-sholay/\" rel=\"nofollow\"\u003ehttp://mag.bollyholly.net/10-things-about-sholay/\u003c/a\u003e \u003c/p\u003e\n\n\u003cp\u003eThe social buttons below the slider share the wrong post on the site. I guess this is probably because the code in the slider is messing up the variables and the function \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003ethe_permalink()\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eIs there a way or a code snippet I can add to the slider code or on the social share button php page for the permalink to point to the current page only, so that the share buttons work properly.\u003c/p\u003e\n\n\u003cp\u003eThe code snippet for my google+ button is like this,\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;?php endif; ?\u0026gt;\n\u0026lt;?php if( tie_get_option( 'share_google' ) ): ?\u0026gt;\n \u0026lt;li style=\"width:80px;\"\u0026gt;\u0026lt;div class=\"g-plusone\" data-size=\"medium\" data-href=\"\u0026lt;?php the_permalink(); ?\u0026gt;\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;script type='text/javascript'\u0026gt;\n (function() {\n var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;\n po.src = 'https://apis.google.com/js/plusone.js';\n var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);\n })();\n \u0026lt;/script\u0026gt;\n \u0026lt;/li\u0026gt;\n\u0026lt;?php endif; ?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"3","creation_date":"2014-01-14 10:34:35.253 UTC","last_activity_date":"2014-01-14 10:34:35.253 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3148795","post_type_id":"1","score":"0","tags":"wordpress|plugins|facebook-like|social","view_count":"402"} +{"id":"9648733","title":"C++/CLI Attributes","body":"\u003cp\u003eI am trying to create a custom attribute that will allow a method in each of my Custom Control libraries to initialise at runtime. I have managed to get this to work using reflection as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eInitOnload::initialise()\n{\n // get a list of types which are marked with the InitOnLoad attribute\n array\u0026lt;System::Reflection::Assembly^\u0026gt;^ assemblies = System::AppDomain::CurrentDomain-\u0026gt;GetAssemblies();\n\n for each(System::Reflection::Assembly^ assembly in assemblies)\n {\n try\n {\n System::Type^ type = System::Type::GetType(\"INITONLOAD.InitOnload\");\n\n array\u0026lt;Object^\u0026gt;^ attributes = assembly-\u0026gt;GetCustomAttributes(type, false);\n\n if(attributes-\u0026gt;Length \u0026gt; 0)\n {\n auto field =\n type-\u0026gt;GetFields(\n System::Reflection::BindingFlags::Static | \n System::Reflection::BindingFlags::Public | \n System::Reflection::BindingFlags::NonPublic);\n }\n }\n catch (...)\n {\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFoo2 gets initialised at startup, but only if it is defined in the same namespace as InitOnload above. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[assembly: InitOnload()];\npublic ref class foo2 : public System::Attribute \n{\npublic:\n foo2()\n {\n };\n\n};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf I try to initilaise a method in a different Custom Control Library it doesn't initilaise foo2 below doesn't initilalise:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[assembly: INITONLOAD::InitOnload()];\npublic ref class foo : public System::Attribute \n{\npublic:\n foo()\n {\n };\n\n};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny ideas?\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2012-03-10 17:49:48.88 UTC","last_activity_date":"2012-03-11 20:37:46.25 UTC","last_edit_date":"2012-03-10 18:10:04.643 UTC","last_editor_display_name":"","last_editor_user_id":"734069","owner_display_name":"","owner_user_id":"1145533","post_type_id":"1","score":"0","tags":"attributes|c++-cli|command-line-interface","view_count":"1816"} +{"id":"12876484","title":"jQuery to perform regexp multiple options","body":"\u003cp\u003eI'm trying to set a kind of captcha based on three stacked buttons which display visual different icons. The script renders three of these buttons (as below) and I need to verify that the user clicks the right icons based on the instruction given.\u003c/p\u003e\n\n\u003cp\u003eBut to give the instruction, I need to know the which icons have been rendered, so I need jQuery to go on these three buttons, select the i id attribute and then select two (randomly) from what was loaded. For instance, in the below buttons, I would give the instruction to \"Click a 'file' and a 'home'\", so that the form can be submitted.\u003c/p\u003e\n\n\u003cp\u003eMy greatest challenge now is to get jQuery to know what has been rendered and get the attribute name of each so that I can then check that the buttons have been clicked which means has now the class \"active\" set. I presume this can be made with a regex but not sure how. I've tried some different approaches unsuccessfully. A note to say that the \"active\" class is set by jQuery addClass on click, so initially the class is just \"btn\".\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;button id=\"cb-8\" type=\"button\" class=\"btn active\"\u0026gt;\n \u0026lt;i id=\"icon-eye-open\" class=\"icon-eye-open\"\u0026gt;\u0026lt;/i\u0026gt;\n\u0026lt;/button\u0026gt;\n\u0026lt;button id=\"cb-5\" type=\"button\" class=\"btn active\"\u0026gt;\n \u0026lt;i id=\"icon-home\" class=\"icon-home\"\u0026gt;\u0026lt;/i\u0026gt;\n\u0026lt;/button\u0026gt;\n\u0026lt;button id=\"cb-2\" type=\"button\" class=\"btn active\"\u0026gt;\n \u0026lt;i id=\"icon-file\" class=\"icon-file\"\u0026gt;\u0026lt;/i\u0026gt;\n\u0026lt;/button\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks in advance for any help on this.\u003c/p\u003e","accepted_answer_id":"12879090","answer_count":"1","comment_count":"2","creation_date":"2012-10-13 19:59:50.943 UTC","last_activity_date":"2012-10-14 03:37:37.92 UTC","last_edit_date":"2012-10-13 20:12:01.58 UTC","last_editor_display_name":"","last_editor_user_id":"479863","owner_display_name":"","owner_user_id":"1644625","post_type_id":"1","score":"1","tags":"jquery|regex","view_count":"187"} +{"id":"8148441","title":"Calling Parent Function with the Same Signature/Name","body":"\u003cp\u003eA and B have function with the same signature -- let's assume : \u003ccode\u003efoo($arg)\u003c/code\u003e -- and that \u003ccode\u003eclass A extends B\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eNow I have an instance:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$a = new A();\n\n$a.foo($data);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCan I also run the parent's (B's) \u003ccode\u003efoo()\u003c/code\u003e function through \u003ccode\u003e$a\u003c/code\u003e or was it overridden?\u003c/p\u003e\n\n\u003cp\u003eThanks!\nNimi\u003c/p\u003e","accepted_answer_id":"8148463","answer_count":"6","comment_count":"0","creation_date":"2011-11-16 08:06:08.39 UTC","last_activity_date":"2014-07-10 19:57:00.393 UTC","last_edit_date":"2011-11-16 15:22:01.597 UTC","last_editor_display_name":"","last_editor_user_id":"533497","owner_display_name":"","owner_user_id":"941137","post_type_id":"1","score":"2","tags":"php|oop|inheritance|extends","view_count":"3959"} +{"id":"25369849","title":"How I use Bing Maps API for WPF with another localization/culture?","body":"\u003cp\u003eWhen I try to set the culture of the map like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;WPF:Map Culture=\"pt-BR\" /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAll the labels remain in English and the culture doesn't change.\u003c/p\u003e\n\n\u003cp\u003eMy Windows language is English, but I want to force pt-BR in the map.\u003c/p\u003e\n\n\u003cp\u003eI already changed my application culture setting the main Thread culture, UICulture and putting pt-BR in the csproject file, but the map remains in English.\u003c/p\u003e\n\n\u003cp\u003eI really need to change this because in English the name of São Paulo city is \"Sao Paolo\".\u003c/p\u003e\n\n\u003cp\u003eHow I do that?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-08-18 18:33:41.993 UTC","last_activity_date":"2014-09-12 12:07:36.043 UTC","last_edit_date":"2014-08-18 18:37:39.8 UTC","last_editor_display_name":"","last_editor_user_id":"1714556","owner_display_name":"","owner_user_id":"1838507","post_type_id":"1","score":"2","tags":"c#|wpf|localization|cultureinfo|bing-maps","view_count":"245"} +{"id":"419517","title":"launch a xcodeproj from terminal","body":"\u003cp\u003eI trying to build and compile my \u003ccode\u003excodeproj\u003c/code\u003e in command line and it is working now. \u003c/p\u003e\n\n\u003cp\u003eSo it is also possible to launch the \u003ccode\u003excodeproject\u003c/code\u003e from terminal instead from the Xcode?\u003c/p\u003e","accepted_answer_id":"419755","answer_count":"4","comment_count":"0","creation_date":"2009-01-07 07:59:28.257 UTC","favorite_count":"4","last_activity_date":"2012-09-04 21:10:24.89 UTC","last_edit_date":"2011-11-05 15:56:21.873 UTC","last_editor_display_name":"","last_editor_user_id":"345188","owner_display_name":"ron","post_type_id":"1","score":"5","tags":"iphone|xcode","view_count":"5718"} +{"id":"8202549","title":"HABTM Additional Fields in Join Table","body":"\u003cp\u003eI'm having some trouble with a HABTM association.\u003c/p\u003e\n\n\u003cp\u003eWhat I'm trying to do is the following:\u003c/p\u003e\n\n\u003cp\u003eTemplate HABTM Medium\nPages HABTM Medium\u003c/p\u003e\n\n\u003cp\u003eTo do this I created the join table \u003ccode\u003eobject_media\u003c/code\u003e and wanted it to have \u003ccode\u003eobject_id\u003c/code\u003e, \u003ccode\u003emedium_id\u003c/code\u003e and \u003ccode\u003emodel\u003c/code\u003e fields. the page id or template id would go into the \u003ccode\u003eobject_id\u003c/code\u003e field and the model would have either 'Page' or 'Template'. By doing this I would be able to connect any model with my Medium model. (Medium = media, all images, videos, documents, etc get saved there). Then I can just pass conditions into the HABTM relation to get only media for that specific model. eg: \u003ccode\u003eObjectMedium.model =\u0026gt; 'Template'\u003c/code\u003e would return all media connected to template.\u003c/p\u003e\n\n\u003cp\u003eIn short: I want 1 table that links any model to any medium.\u003c/p\u003e\n\n\u003cp\u003eTemplate.php\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass Template extends AppModel{\n public $name = 'Template';\n\n public $hasMany = array(\n 'TemplateColumn'\n );\n\n public $hasAndBelongsToMany = array(\n 'Medium' =\u0026gt; array(\n 'className' =\u0026gt; 'Medium',\n 'joinTable' =\u0026gt; 'object_media',\n 'foreignKey' =\u0026gt; 'object_id',\n 'associationForeignKey' =\u0026gt; 'medium_id'\n )\n );\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMedium.php\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass Medium extends AppModel{\n public $name = 'Medium';\n public $useTable = 'media';\n\n public $hasAndBelongsToMany = array(\n 'Template' =\u0026gt; array(\n 'className' =\u0026gt; 'Template',\n 'joinTable' =\u0026gt; 'object_media',\n 'foreignKey' =\u0026gt; 'medium_id',\n 'associationForeignKey' =\u0026gt; 'object_id'\n )\n );\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, feeding it the following data wouldn't even save the medium:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Array\n (\n[Template] =\u0026gt; Array\n (\n [name] =\u0026gt; \n )\n\n[TemplateColumn] =\u0026gt; Array\n (\n [0] =\u0026gt; Array\n (\n [block] =\u0026gt; 0\n [column] =\u0026gt; 0\n [grid] =\u0026gt; 7\n )\n\n [1] =\u0026gt; Array\n (\n [block] =\u0026gt; 0\n [column] =\u0026gt; 1\n [grid] =\u0026gt; 5\n )\n\n [2] =\u0026gt; Array\n (\n [block] =\u0026gt; 1\n [column] =\u0026gt; 0\n [grid] =\u0026gt; 6\n )\n\n [3] =\u0026gt; Array\n (\n [block] =\u0026gt; 1\n [column] =\u0026gt; 1\n [grid] =\u0026gt; 6\n )\n\n )\n\n[Medium] =\u0026gt; Array\n (\n [0] =\u0026gt; Array\n (\n [name] =\u0026gt; 7917196b42c3626c10ab024bbafb8171\n [src] =\u0026gt; 134a16c2202ff2b0c9b1c51dddb1bcfc.jpg\n [type] =\u0026gt; Image\n )\n\n )\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis gives me the following queries:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eINSERT INTO `templates` (`name`, `modified`, `created`) VALUES ('', '2011-11-20 15:18:46', '2011-11-20 15:18:46')\nSELECT `ObjectMedium`.`medium_id` FROM `object_media` AS `ObjectMedium` WHERE `ObjectMedium`.`object_id` = 30\nINSERT INTO `template_columns` (`block`, `column`, `grid`, `template_id`, `modified`, `created`) VALUES (0, 0, 7, 30, '2011-11-20 15:18:46', '2011-11-20 15:18:46')\nINSERT INTO `template_columns` (`block`, `column`, `grid`, `template_id`, `modified`, `created`) VALUES (0, 1, 5, 30, '2011-11-20 15:18:46', '2011-11-20 15:18:46')\nINSERT INTO `template_columns` (`block`, `column`, `grid`, `template_id`, `modified`, `created`) VALUES (1, 0, 6, 30, '2011-11-20 15:18:46', '2011-11-20 15:18:46')\nINSERT INTO `template_columns` (`block`, `column`, `grid`, `template_id`, `modified`, `created`) VALUES (1, 1, 6, 30, '2011-11-20 15:18:46', '2011-11-20 15:18:46')\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny Ideas of what is going wrong? And how to add the model name in the join table?\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2011-11-20 15:30:10.323 UTC","last_activity_date":"2011-11-20 17:27:41.223 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"705529","post_type_id":"1","score":"0","tags":"php|cakephp|cakephp-2.0","view_count":"429"} +{"id":"8409160","title":"Jquery Checkbox Input Validation","body":"\u003cp\u003eI have the following checkbox\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;input type=\"checkbox\" name=\"compare[]\" value=\"\u0026lt;?php echo $product_id ?\u0026gt;\" /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow, I want to let my users select minimum three and maximum three options from the above check box. Breaking of any of the rules would give a message.\u003c/p\u003e\n\n\u003cp\u003eWould you please kindly help me how to do that with Jquery?\u003c/p\u003e\n\n\u003cp\u003eThanks in Advance\u003c/p\u003e","answer_count":"3","comment_count":"2","creation_date":"2011-12-07 01:02:57.827 UTC","last_activity_date":"2011-12-14 02:36:51.323 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1209690","post_type_id":"1","score":"0","tags":"jquery|jquery-validate","view_count":"462"} +{"id":"45176483","title":"How to upload the picture to AWS s3 bucket?","body":"\u003cpre\u003e\u003ccode\u003e//getting access to the photo gallery\n@Override\nprotected void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n if (requestCode == RESULT_LOAD_IMAGE \u0026amp;\u0026amp; resultCode == RESULT_OK \u0026amp;\u0026amp; data != null) {\n Uri selectedImage = data.getData();\n uploadImage.setImageURI(selectedImage);\n }\n Toast.makeText(this, \"Test\", Toast.LENGTH_LONG).show();\n\n}\n\n\n //Toast.makeText(this, \"Test\", Toast.LENGTH_LONG).show();\n//Trying to upload image to the AWS S3bucket-\npublic void uploadImageToAWS(View v) {\n//String sdcard = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM).getAbsolutePath() + \"Camera/\";\n Toast.makeText(this, \"Test\", Toast.LENGTH_LONG).show();\n File MY_FILE = new File(\"myPhoto.png\");\n String YOUR_IDENTITY_POOL_ID =\"POOL_ID\";\n CognitoCachingCredentialsProvider credentialsProvider =\n new CognitoCachingCredentialsProvider(getApplicationContext(),\n YOUR_IDENTITY_POOL_ID,\n Regions.US_EAST_1);\n\n\n AmazonS3Client s3Client = new AmazonS3Client(credentialsProvider);\n s3Client.setRegion(Region.getRegion(Regions.US_EAST_1));\n\n TransferUtility transferUtility = new TransferUtility(s3Client,\n getApplicationContext());\n\n TransferObserver observer = transferUtility.upload(\n \"apptestingbucket\", // The S3 bucket to upload to\n FILE_NAME, // The key for the uploaded object\n MY_FILE);// The location of the file to\n observer.setTransferListener(new TransferListener() {\n\n @Override\n public void onStateChanged(int id, TransferState state) {\n if(state == TransferState.COMPLETED){\n Toast.makeText(Social.this, \"transfer Succeded!\", Toast.LENGTH_LONG).show();\n }\n\n }\n\n @Override\n public void onProgressChanged(int id, long bytesCurrent, long bytesTotal) {\n int percentage = (int) (bytesCurrent/bytesTotal * 100);\n Log.e(\"Status\", \"Percentage\" + percentage);\n\n }\n\n @Override\n public void onError(int id, Exception ex) {\n Log.e(\"MY_BUCKET\", \"Error: \" + ex.getMessage() );\n\n }\n });\n\n\n\n\n }\n\n\n\nprivate void retrieveImageFromAWS(){\n File sdcard = Environment.getExternalStorageDirectory();\n File MY_FILE = new File(sdcard, \"social.png\");\n String YOUR_IDENTITY_POOL_ID =\"POOL_ID\";\n CognitoCachingCredentialsProvider credentialsProvider = new CognitoCachingCredentialsProvider(getApplicationContext(),\n YOUR_IDENTITY_POOL_ID\n , Regions.US_EAST_1);\n AmazonS3Client s3Client = new AmazonS3Client(credentialsProvider);\n TransferUtility transferUtility = new TransferUtility(s3Client,\n getApplicationContext());\n TransferObserver observer = transferUtility.download(\"BUCKET_NAME\",\n \"FILENAME_TO_BE_DOWNLOADED\", MY_FILE);\n\n observer.setTransferListener(new TransferListener() {\n @Override\n public void onStateChanged(int id, TransferState state) {\n if(state == TransferState.COMPLETED){\n Toast.makeText(Social.this, \"Retrieve completed\", Toast.LENGTH_LONG).show();\n }\n\n }\n\n @Override\n public void onProgressChanged(int id, long bytesCurrent, long bytesTotal) {\n int percentage = (int) (bytesCurrent/bytesTotal * 100);\n Log.e(\"status\", \"percentage\" +percentage);\n\n }\n\n @Override\n public void onError(int id, Exception ex) {\n Log.e(\"MY_BUCKET\", \"Error Downloading: \" + ex.getMessage());\n\n\n }\n });\n\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is what i have based on the Android s3 documentation, I'm trying to pick the picture from photo gallery or take picture from the phone and upload it to S3 bucket and retrieve it back to the app interface. but evry time i run the programm my app crashed. and i called \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e uploadImageToAWS(v)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003einsede the\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e BtnUpload.onClicklistener\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eany example or little help would be appreciated. thank you! \u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2017-07-18 20:28:55.973 UTC","last_activity_date":"2017-07-18 20:39:27.18 UTC","last_edit_date":"2017-07-18 20:29:42.983 UTC","last_editor_display_name":"","last_editor_user_id":"2308683","owner_display_name":"","owner_user_id":"7902393","post_type_id":"1","score":"0","tags":"android|amazon-s3|aws-sdk","view_count":"74"} +{"id":"30703180","title":"Laravel forward to 404 error page","body":"\u003cp\u003eI am using Laravel 5.0. Is there any way to forward to default 404 page error if the user wrong url. I want to forward all the time if the user entered wrong url in my project.\u003c/p\u003e","accepted_answer_id":"30703317","answer_count":"1","comment_count":"1","creation_date":"2015-06-08 07:16:43.773 UTC","last_activity_date":"2017-07-07 11:41:29.517 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3432786","post_type_id":"1","score":"0","tags":"laravel|laravel-5","view_count":"365"} +{"id":"705649","title":"php select function generates weird where clause","body":"\u003cp\u003eHello I try to create a function to generate select functions.\u003c/p\u003e\n\n\u003cp\u003eBut the following code \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic function select($psTableName, $paFields =\"\",$paWhere=array())\n{\n //initial return value\n $lbReturn = false;\n try\n {\n $lsQuery = \"SELECT * FROM `\";\n $lsQuery .= $psTableName;\n $lsQuery .= \"` \";\n if (!empty($paWhere)){\n $lsQuery .= \"WHERE \";\n print_r($paWhere);\n foreach($paWhere as $lsKey =\u0026gt; $lsValue)\n {\n echo $lsKey.\"\u0026lt;br\u0026gt;\";\n $paWhere[] = $lsKey.\" = '\".mysql_real_escape_string($lsValue).\"'\";\n }\n $lsQuery .= implode(\" AND \", $paWhere);\n //$lsQuery = substr($lsQuery,0,(strlen($lsQuery)-5));\n }\n\n //echo $lsQuery;\n //execute $lsQuery\n $this-\u0026gt;msLastQuery = $lsQuery;\n if(!$this-\u0026gt;execute())\n {\n throw new DBException(\"Select failed, unable to execute query: \".$lsQuery);\n }\n else\n {\n $lbReturn = true;\n }\n }\n catch(DBException $errorMsg)\n {\n ErrorHandler::handleException($errorMsg);\n }\n return $lbReturn;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003egenerates this sql statement:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT * FROM `persons` WHERE email@gmail.com AND 2d1cf648ca2f0b2499e62ad7386eccc2 AND 1 AND per_email = 'email@gmail.com' AND per_password = '2d1cf648ca2f0b2499e62ad7386eccc2' AND per_active = '1'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI don't know why it first shows only the values after the where clause and then goes back and shows the key =\u003e values.\u003c/p\u003e\n\n\u003cp\u003eAny idea's?\u003c/p\u003e","accepted_answer_id":"705671","answer_count":"1","comment_count":"0","creation_date":"2009-04-01 14:03:01.697 UTC","last_activity_date":"2009-04-01 14:40:59.31 UTC","last_editor_display_name":"","owner_display_name":"sanders","owner_user_id":"80040","post_type_id":"1","score":"0","tags":"php|select|associative-array","view_count":"630"} +{"id":"32247135","title":"How to unbind click and click submit button in and using JQuery?","body":"\u003cp\u003eI want to submit form in JQuery but \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;input type=\"submit\" id=\"yesBank\" /\u0026gt;\n\n $('#yesBank , #worldBank').on(\"click\", function (e) {\n e.preventDefault();\n $.blockUI({\n message: 'Getting List'\n });\n\n //Want to unbind this click JS\n //Want to click on submit button from here $(#yesBank).click(\"\");\n //Unbinding is done so that it does not execute this \n //I am bound to click this button as server is handling a condition on click of it. but i have to display block ui too\n });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy purpose is to block UI. actually when i block UI like this then control does not go to server and page does not reload. Even if i remove preventDefault. Can someone show me the snippet?\u003c/p\u003e","answer_count":"2","comment_count":"5","creation_date":"2015-08-27 10:37:38.277 UTC","favorite_count":"0","last_activity_date":"2015-08-27 11:34:56.597 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1382647","post_type_id":"1","score":"1","tags":"javascript|jquery|html","view_count":"123"} +{"id":"41833080","title":"SwaggerUI auth redirect swaggerUiAuth of null","body":"\u003cp\u003eI'm trying to redirect a user if token doesn't exists in the cookie/localstorage.\u003c/p\u003e\n\n\u003cp\u003eI'm doing a check whether a token exist if not then redirect to \u003ca href=\"http://authserver.webazure.net\" rel=\"nofollow noreferrer\"\u003ehttp://authserver.webazure.net\u003c/a\u003e (e.g url).\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eif (cookieCheck == null) {\n window.location.href = 'http://authserver.webazure.net '; // redirect url\n } else {\n console.log('Cookie exist');\n // Omni auth\n window.swaggerUi.load();\n var apiKeyAuth = new SwaggerClient.ApiKeyAuthorization(\"Authorization\", \"Bearer \" + $.cookie('access_token'), \"header\");\n window.swaggerUi.api.clientAuthorizations.add(\"oauth2\", apiKeyAuth);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSetting the cookie in o2c.html\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eif (window.opener.swaggerUiAuth.tokenUrl) // error is here\n window.opener.processOAuthCode(qp);\n else \n window.opener.onOAuthComplete(qp);\n var accessToken = getUrlVars('access_token');\n setCookie('access_token', accessToken)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe redirect works okay however once Iogged in and and trying to redirect me back to my SwaggerUI I get an error 'Cannot read property 'swaggerUiAuth' of null'\u003c/p\u003e\n\n\u003cp\u003eDoes anyone know about this?\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-01-24 16:16:25.83 UTC","last_activity_date":"2017-01-24 16:16:25.83 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4945017","post_type_id":"1","score":"1","tags":"javascript|swagger|swagger-ui","view_count":"71"} +{"id":"21705834","title":"SSRS value display #error for ssrs conditional expression","body":"\u003cp\u003eThis is the expression used for calculating the value:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e=iif((Sum(CDbl(Fields!RxCount.Value))=0),\"0.00\",(Sum(Fields!Margin.Value)/Sum(CDec(Fields!RxCount.Value))))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eie: \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eif Sum(CDbl(Fields!RxCount.Value = 0, result shoul be 0.00 otherwise\n it should be the divide of two values.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003ebut it display \u003ccode\u003e#error\u003c/code\u003e when \u003ccode\u003eSum(CDbl(Fields!RxCount.Value = 0\u003c/code\u003e not \u003ccode\u003e0.00\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eAny help.\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2014-02-11 15:19:55.653 UTC","last_activity_date":"2016-01-10 06:02:16.837 UTC","last_edit_date":"2016-01-10 06:02:16.837 UTC","last_editor_display_name":"","last_editor_user_id":"2635532","owner_display_name":"","owner_user_id":"1957639","post_type_id":"1","score":"0","tags":"reporting-services|ssrs-2008|ssrs-tablix|ssrs-2008-r2","view_count":"1430"} +{"id":"40711116","title":"Accessing and changing a class instance from a function outside of main()","body":"\u003cp\u003eI am currently learning C++ and I've encountered a problem with classes that I cannot seem to be able to find a solution to. If ever there is a specific topic I should cover that will teach me how to do it let me know but if it's a mistake I made I would like help solving it please.\u003c/p\u003e\n\n\u003cp\u003eI have a console application that when run asks you to input the name of a movie, the year it was released and it's rating. The code asks you the same questions for 3 movies and then prints the results. It's just a code I made while following tutorials so it has no real purpose.\u003c/p\u003e\n\n\u003cp\u003eI made a class called \"Movie\" which hold the user's answers and a function to create the instance but it doesn't seem to work. I will paste the code with examples to make it easier to explain.\u003c/p\u003e\n\n\u003cp\u003eMovie.h\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#ifndef MOVIE_H\n#define MOVIE_H\n#include \u0026lt;iostream\u0026gt;\n#include \u0026lt;string\u0026gt;\n\nusing namespace std;\n\nclass Movie\n{\n private:\n string movieName, movieRating;\n int movieYear;\n\n public:\n Movie();\n Movie(string, int, string);\n virtual ~Movie();\n\n string getName();\n string getRating();\n int getYear();\n\n void setName(string);\n void setRating(string);\n void setYear(int);\n\n protected:\n};\n\n#endif // MOVIE_H\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMovie.cpp\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \"Movie.h\"\n#include \u0026lt;iostream\u0026gt;\n#include \u0026lt;string\u0026gt;\n#include \u0026lt;ctime\u0026gt;\n\nusing namespace std;\n\nMovie::Movie()\n{\n movieName = \"NA\";\n movieYear = 1999;\n movieRating = \"NA\";\n}\n\nMovie::Movie(string name, int year, string rating)\n{\n movieName = name;\n\n time_t t = time(0); // get time now\n struct tm * now = localtime( \u0026amp; t );\n int x = (now-\u0026gt;tm_year + 1900);\n while(year \u0026gt; x || year \u0026lt; 1889)\n {\n cout\u0026lt;\u0026lt;\"Please enter a valid year: \";\n cin\u0026gt;\u0026gt;year;\n }\n movieYear = year;\n\n movieRating = rating;\n}\n\nMovie::~Movie()\n{\n\n}\n\n\nstring Movie::getName()\n{\n return movieName;\n}\n\nstring Movie::getRating()\n{\n return movieRating;\n}\n\nint Movie::getYear()\n{\n return movieYear;\n}\n\nvoid Movie::setName(string n)\n{\n movieName = n;\n}\n\nvoid Movie::setRating(string r)\n{\n movieRating = r;\n}\n\nvoid Movie::setYear(int y)\n{\n time_t t = time(0); // get time now\n struct tm * now = localtime( \u0026amp; t );\n int x = (now-\u0026gt;tm_year + 1900);\n while(y \u0026gt; x || y \u0026lt; 1889)\n {\n cout\u0026lt;\u0026lt;\"Please enter a valid year: \";\n cin\u0026gt;\u0026gt;y;\n }\n movieYear = y;\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003emain.cpp\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;iostream\u0026gt;\n#include \u0026lt;string\u0026gt;\n#include \"Movie.h\"\n\nusing namespace std;\n\nvoid newMovie(Movie);\nvoid printMovies(Movie);\n\nint main()\n{\n Movie movie1(\"a\", 1900, \"a\");\n Movie movie2(\"a\", 1900, \"a\");\n Movie movie3(\"a\", 1900, \"a\");\n\n newMovie(movie1);\n //newMovie(movie2);\n //newMovie(movie3);\n printMovies(movie1);\n //printMovies(movie2);\n //printMovies(movie3);\n return 0;\n}\n\nvoid newMovie(Movie movie)\n{\n\n string inName, inRating;\n int inYear;\n cout\u0026lt;\u0026lt;\"Enter a movie name: \";\n cin\u0026gt;\u0026gt;inName;\n movie.setName(inName);\n cout\u0026lt;\u0026lt;\"Enter the year it was released: \";\n cin\u0026gt;\u0026gt;inYear;\n movie.setYear(inYear);\n cout\u0026lt;\u0026lt;\"Enter the suggested rating: \";\n cin\u0026gt;\u0026gt;inRating;\n movie.setRating(inRating);\n cout\u0026lt;\u0026lt;endl\u0026lt;\u0026lt;endl;\n\n}\n\nvoid printMovies(Movie movie)\n{\n cout\u0026lt;\u0026lt;\"Name: \"\u0026lt;\u0026lt;movie.getName()\n \u0026lt;\u0026lt;\"\\nYear: \"\u0026lt;\u0026lt;movie.getYear()\n \u0026lt;\u0026lt;\"\\nRating: \"\u0026lt;\u0026lt;movie.getRating()\n \u0026lt;\u0026lt;endl\u0026lt;\u0026lt;endl;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow what happens when i run this is that the movie gets printed like this:\u003c/p\u003e\n\n\u003cp\u003eEnter a movie name: test\nEnter the year it was released: 2001\nEnter the suggested rating: PG\nName: a\nYear: 1900\nRating: a\nProcess returned 0 (0x0) execution time : 6.912 s\nPress any key to continue.\u003c/p\u003e\n\n\u003cp\u003eIt seems like the change made in newMovie(Movie movie) does not stay. If i do a print in the middle of it by doing something like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evoid newMovie(Movie movie)\n{\n\n string inName, inRating;\n int inYear;\n cout\u0026lt;\u0026lt;\"Enter a movie name: \";\n cin\u0026gt;\u0026gt;inName;\n movie.setName(inName);\n cout\u0026lt;\u0026lt;\"Enter the year it was released: \";\n cin\u0026gt;\u0026gt;inYear;\n movie.setYear(inYear);\n cout\u0026lt;\u0026lt;\"Enter the suggested rating: \";\n cin\u0026gt;\u0026gt;inRating;\n movie.setRating(inRating);\n cout\u0026lt;\u0026lt;endl\u0026lt;\u0026lt;endl;\n\n cout\u0026lt;\u0026lt;movie.getName();\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI do obtain the right name when printing which means that the class works fine. The only works inside the function as if it was private and I can't figure out why.\u003c/p\u003e","answer_count":"0","comment_count":"4","creation_date":"2016-11-21 00:29:29.03 UTC","last_activity_date":"2016-11-21 00:29:29.03 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7187034","post_type_id":"1","score":"0","tags":"c++|class|instance","view_count":"14"} +{"id":"45924372","title":"How to print the current time in the format Day, Date Month Year HH:MM:SS?","body":"\u003cp\u003eHow to print the current time in the format \u003ccode\u003eDay, Date Month Year HH:MM:SS\u003c/code\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eMon, 28 Aug 2017 15:37:01 .\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd then, convert this timestamp to epoch seconds \u0026amp; vice-versa.\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2017-08-28 17:24:24.487 UTC","last_activity_date":"2017-08-29 12:05:52.947 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"8454216","post_type_id":"1","score":"-1","tags":"python-2.7|datetime|epoch","view_count":"142"} +{"id":"24983873","title":"Pausing QThread's event dispatch loop","body":"\u003cp\u003eI have a multithreaded application written in C++ with Qt. Currently, my application works by having a \u003ccode\u003eQThread\u003c/code\u003e instance (I have NOT subclassed \u003ccode\u003eQThread\u003c/code\u003e) which uses the default \u003ccode\u003erun()\u003c/code\u003e implementation that just calls \u003ccode\u003eQThread\u003c/code\u003e's \u003ccode\u003eexec()\u003c/code\u003e method, which provides an event dispatch loop.\u003c/p\u003e\n\n\u003cp\u003eI call \u003ccode\u003emoveToThread\u003c/code\u003e on certain \u003ccode\u003eQObject\u003c/code\u003e subclasses which actually perform the work I want done in a separate thread. I tell these objects to do work using Qt's signals/slots mechanism. I stop the thread gracefully by informing my worker objects to stop their work, and then calling \u003ccode\u003equit()\u003c/code\u003e and \u003ccode\u003ewait()\u003c/code\u003e on my thread. This all works very nicely.\u003c/p\u003e\n\n\u003cp\u003eHowever, I now want to implement the following scenario:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eThe user clicks e.g. the \"X\" button on my application, because they want to close it.\u003c/li\u003e\n\u003cli\u003eI don't want any new work to be started, so I pause the event dispatch thread. If the current event being dispatched continues running, that's fine.\u003c/li\u003e\n\u003cli\u003eI prompt the user, allowing them to either a) discard all remaining jobs and exit (using \u003ccode\u003equit() and\u003c/code\u003ewait()` - this already works), or b) don't exit the application, but instead continue working (resume the thread).\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eMy problem is that \u003ccode\u003eQThread\u003c/code\u003e doesn't seem to have a \u003ccode\u003epause()\u003c/code\u003e method. I've seen various examples online which add one (like the answers to \u003ca href=\"https://stackoverflow.com/questions/9075837/pause-and-resume-a-qthread\"\u003ethis question\u003c/a\u003e). The problem is that these examples depend on having a custom \u003ccode\u003erun()\u003c/code\u003e implementation, and implementing pause there. Since I'm relying on \u003ccode\u003eQThread\u003c/code\u003e's event dispatch loop, these solutions won't work. I've considered doing something like reimplementing \u003ccode\u003eexec()\u003c/code\u003e or creating my own subclass of \u003ccode\u003eQAbstractEventDispatcher\u003c/code\u003e, but these solutions seem like a whole lot of work to get simple pause / resume functionality.\u003c/p\u003e\n\n\u003cp\u003eWhat's the easiest way to pause QThread's event dispatch loop (preventing it from dispatching any new events, but letting the current event continue)?\u003c/p\u003e","accepted_answer_id":"25008766","answer_count":"1","comment_count":"2","creation_date":"2014-07-27 17:58:26.13 UTC","favorite_count":"1","last_activity_date":"2014-07-29 05:29:11.073 UTC","last_edit_date":"2017-05-23 12:29:24.27 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"1858369","post_type_id":"1","score":"1","tags":"c++|multithreading|qt","view_count":"349"} +{"id":"1791050","title":"Hibernate queries slow down drastically after an entity is loaded in the session","body":"\u003cp\u003eI'm using Hibernate EntityManager, and am experiencing a weird slowdown in my Hibernate queries. Take a look at this code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic void testQuerySpeed() {\n for(int i = 0; i \u0026lt; 1000; i++) {\n em.createNativeQuery(\"SELECT 1\").getResultList();\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis runs in about 750ms on my machine. Not blazing fast considering it's just selecting a constant integer, but acceptable. My problem arises the moment ANY entities are loaded in my EntityManager session before I launch my query:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic void testQuerySpeed() {\n CommercialContact contact = em.find(CommercialContact.class, 1890871l);\n\n for(int i = 0; i \u0026lt; 1000; i++) {\n em.createNativeQuery(\"SELECT 1\").getSingleResult();\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe em.find() is fast, but the runtime 1000 queries increased more than ten-fold, to about 10 seconds. If I put an \u003ccode\u003eem.clear()\u003c/code\u003e after the \u003ccode\u003eem.find()\u003c/code\u003e, the problem goes away again and runtime goes back to 750ms. \u003c/p\u003e\n\n\u003cp\u003eI've used a native query here, but the problem exists with HQL queries as well. It seems ALL queries take at least 70ms whenever an entity is in the EntityManager session.\u003c/p\u003e\n\n\u003cp\u003eThis performance drop is really hurting us when generating lists where n+1 queries are needed.\u003c/p\u003e\n\n\u003cp\u003eI've tested the latest Hibernate 3.5 beta, and have the exact same problem. Has anyone seen this problem, or any ideas on how to fix it?\u003c/p\u003e\n\n\u003cp\u003eI'm using PostgreSQL 8.3, using resource local transactions (running in Tomcat). Using the built-in connection pool, but using C3P0 made no difference.\u003c/p\u003e","accepted_answer_id":"1793553","answer_count":"3","comment_count":"1","creation_date":"2009-11-24 16:03:59.233 UTC","favorite_count":"5","last_activity_date":"2010-01-27 13:45:31.293 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"27449","post_type_id":"1","score":"9","tags":"hibernate|hql","view_count":"10033"} +{"id":"9485075","title":"Invoke routine in class from other class (not activity) in JAVA for Android","body":"\u003cp\u003eI have ;\n- MainGamePanel (Extends SurfaceView)\n- Button (class)\n- Fruitmanager (class)\n- Apple (class)\u003c/p\u003e\n\n\u003cp\u003eIn MainGamePanel, I check for \u003ccode\u003eMotionEvent.ACTION_DOWN\u003c/code\u003e I hand it over to the button. Button checks coordinates and sets Touched boolean to true.\u003c/p\u003e\n\n\u003cp\u003eIn MainGamePanel, I check for \u003ccode\u003eMotionEvent.ACTION_UP\u003c/code\u003e If button Touched = true, I hand it over to the button. Button checks coordinates and.. executes a routine in Fruitmanager. There I go wrong :\u003c/p\u003e\n\n\u003cp\u003eThis is what the addMoreFruit routine from Fruitmanager looks like :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic static void addFruit(MainGamePanel context){\n\nfruitInventory();\n//add 10 apples with random coordinates\n\nfor (int i = 0; i \u0026lt; 10; i++) {\nRandom Rnd = new Random();\napple nextApple = new apple(BitmapFactory.decodeResource(context.getResources(),\n fruitResources.get(Rnd.nextInt(fruitResources.size()))));\n//add them to the arraylist\nMainGamePanel.AppleList.add(nextApple);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e}\u003c/p\u003e\n\n\u003cp\u003eIt works fine if I call it from MainGamePanel by using \u003ccode\u003efruitmanager.addfruit(this);\u003c/code\u003e But it doesn't work when I call it from the button class.\u003c/p\u003e\n\n\u003cp\u003eI suspect it has something to do with the context. I'm not sure how to fix. I've read up about context and understand it's the 'application situation' where the class was called from. I didn't find a n00b-proof instruction (sorry;) on how to handle something like this, though. Or maybe it has to do with \"static\" and \"non-static\"? in the dark here..\u003c/p\u003e\n\n\u003cp\u003eHelp is appreciated.\u003c/p\u003e","accepted_answer_id":"9485490","answer_count":"1","comment_count":"0","creation_date":"2012-02-28 15:47:20.033 UTC","last_activity_date":"2015-06-06 14:43:33.24 UTC","last_edit_date":"2015-06-06 14:43:33.24 UTC","last_editor_display_name":"","last_editor_user_id":"4370109","owner_display_name":"","owner_user_id":"989430","post_type_id":"1","score":"0","tags":"android|class|android-context","view_count":"184"} +{"id":"13812795","title":"\"Access violation reading\" on exit(0) in machine instructions?","body":"\u003cp\u003eThere are \u003ca href=\"https://stackoverflow.com/questions/8932200/c-access-violation-reading-why\"\u003eother\u003c/a\u003e questions about the same message, but I specifically seem to run into this when I try to execute a string of machine code that invokes certain functions. In my case I make a call to exit(0) which works fine when called as typical in C in the same program. If, however, as an exercise I set the EIP to the address of some machine code (you might call it \"shellcode\"), e.g.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003econst char code[] = \n\"\\x6A\\x00\" // push 0\"\n\"\\xFF\\x15\\x00\\x00\\x00\\x00\" //system call, 'read access violation': call dword ptr [__imp__exit]\n\"\\x5D\" //pop ebp \n\"\\xC3\"; //ret\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI will get the message \"Access violation reading location 0x00000000.\". The \"\\x6A\\x00\" instruction will run, but the call to exit(0) will throw this exception. \u003c/p\u003e\n\n\u003cp\u003eThis is C compiled in VS2010 with /GS-, and also running the \"shellcode\" with execute rights, but is there still some sort of nonexecutable memory or stack protection going on? Why is this instruction causing an error?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e int main() \n{ \n\n void *exec = VirtualAlloc(0, sizeof(code), MEM_COMMIT, PAGE_EXECUTE_READWRITE);\n memcpy(exec, code, sizeof(code));\n//EIP = exec in debug-\u0026gt;immediate\n exit(0);\n\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"13812857","answer_count":"1","comment_count":"1","creation_date":"2012-12-11 02:39:49.56 UTC","last_activity_date":"2012-12-11 02:58:17.407 UTC","last_edit_date":"2017-05-23 12:29:20.86 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"266457","post_type_id":"1","score":"0","tags":"c|visual-c++|assembly","view_count":"165"} +{"id":"13498417","title":"Build URLS from JSON","body":"\u003cp\u003eI've created a function that can build nested urls like so. I was wondering if there existed a more mainstream library to build urls / uris like this. I'd rather use a standard.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eutility.urlConstruct({\n \"scheme\": \"https://\",\n \"domain\": \"domain.com\",\n \"path\": \"/login\",\n \"query\":{\n \"user\":\"thomasreggi\",\n \"from\":utility.urlConstruct({\n \"scheme\": \"https://\",\n \"domain\": \"redirect.com\",\n \"path\": \"/funstuff\",\n }),\n }\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSpits out \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e\u003ca href=\"https://domain.com/login?user=thomasreggi\u0026amp;from=https%3A%2F%2Fredirect.com%2Ffunstuff\" rel=\"nofollow\"\u003ehttps://domain.com/login?user=thomasreggi\u0026amp;from=https%3A%2F%2Fredirect.com%2Ffunstuff\u003c/a\u003e\u003c/p\u003e\n\u003c/blockquote\u003e","accepted_answer_id":"14610523","answer_count":"4","comment_count":"4","creation_date":"2012-11-21 17:08:27.227 UTC","last_activity_date":"2013-01-30 17:53:05.637 UTC","last_edit_date":"2012-11-21 17:25:38.05 UTC","last_editor_display_name":"","last_editor_user_id":"206403","owner_display_name":"","owner_user_id":"340688","post_type_id":"1","score":"2","tags":"javascript|url|uri","view_count":"1075"} +{"id":"3374433","title":"I want to call a C# delegate from C++ unmanaged code. A parameterless delegate works fine , but a delegate with parameters crashed my program","body":"\u003cp\u003eThe Following is code of a function from a unmanged dll. It takes in a function pointer as argument and simply returns value returned by the called function.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eextern __declspec(dllexport) int _stdcall callDelegate(int (*pt2Func)());\nextern __declspec(dllexport) int _stdcall callDelegate(int (*pt2Func)())\n{\n int r = pt2Func();\n return r;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn managed C# code I call the umanged function above with a delegate.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e unsafe public delegate int mydelegate( );\n\n unsafe public int delFunc()\n {\n return 12;\n }\n\n mydelegate d = new mydelegate(delFunc);\n int re = callDelegate(d);\n [DllImport(\"cmxConnect.dll\")]\n private unsafe static extern int callDelegate([MarshalAs(UnmanagedType.FunctionPtr)] mydelegate d);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis all works great !! but if I want my function pointer/delegate to take arguments it crashed the program.\nSo if I modify the code as follows my program crashes.\u003c/p\u003e\n\n\u003cp\u003eModified unmanaged c++ -\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eextern __declspec(dllexport) int _stdcall callDelegate(int (*pt2Func)(int));\nextern __declspec(dllexport) int _stdcall callDelegate(int (*pt2Func)(int))\n{\n int r = pt2Func(7);\n return r;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eModified C# code -\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eunsafe public delegate int mydelegate( int t);\n\n unsafe public int delFunc(int t)\n {\n return 12;\n }\n\n mydelegate d = new mydelegate(delFunc);\n int re = callDelegate(d);\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"3374620","answer_count":"2","comment_count":"0","creation_date":"2010-07-30 18:39:39.42 UTC","favorite_count":"2","last_activity_date":"2016-02-01 11:40:56.863 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"382096","post_type_id":"1","score":"4","tags":"c#|c++|pinvoke|marshalling|unmanaged","view_count":"3164"} +{"id":"8419635","title":"Linking core data with specific database","body":"\u003cp\u003eI am very new to the iPhone development and although I spent hours in searching for the right answer I only got more confused at the end.\nHere is my question - I'm making a simple iPhone application which has its own database/consisting of only one simple table and being stored in my projects folder along with all the .m and .h files/ and which uses the managed object model presented by core data.\nI think I did everything the way it should be done but my program ends with the following \u003cstrong\u003e\"Unresolved error Error Domain=NSCocoaErrorDomain Code=256 \"The operation couldn’t be completed. (Cocoa error 256.)\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eActually here is the whole output: \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e2011-12-07 18:50:50.009 weatherForecast[5368:207] CoreData: error: (1) I/O error for \n database at /Users/eln/Library/Application Support/iPhone\n Simulator/5.0/Applications/4991C3EB-BDC2-4507-B1FB-720F6DC30245/Documents/weatherForecast.sqlite.\n \u003cstrong\u003eSQLite error code:1, 'no such table: Z_METADATA'\u003c/strong\u003e\u003c/p\u003e\n \n \u003cp\u003e2011-12-07 18:50:50.012 weatherForecast[5368:207] Unresolved error\n Error Domain=NSCocoaErrorDomain Code=256 \"The operation couldn’t be\n completed. (Cocoa error 256.)\" UserInfo=0x6a33e40\n {NSUnderlyingException=I/O error for database at\n /Users/toma.popov/Library/Application Support/iPhone\n Simulator/5.0/Applications/4991C3EB-BDC2-4507-B1FB-720F6DC30245/Documents/weatherForecast.sqlite.\n \u003cstrong\u003eSQLite error code:1, 'no such table: Z_METADATA',\n NSSQLiteErrorDomain=1}, \n {\n NSSQLiteErrorDomain = 1;\n NSUnderlyingException = \"I/O error for database at /Users/eln/Library/Application Support/iPhone\n Simulator/5.0/Applications/4991C3EB-BDC2-4507-B1FB-720F6DC30245/Documents/weatherForecast.sqlite.\n **SQLite error code:1, 'no such table: Z_METADATA'\";\u003c/strong\u003e\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003emy program stops right in this get method:\n**\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e- (NSPersistentStoreCoordinator *)persistentStoreCoordinator\n{\n if (__persistentStoreCoordinator != nil)\n {\n return __persistentStoreCoordinator;\n }\n NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@\"weatherForecast.sqlite\"];\n NSLog(@\"DATABASE IS LOCATED AT: %@\",(NSString *)[self applicationDocumentsDirectory]);\n NSError *error = nil;\n __persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedObjectModel]];\n\n if (![__persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:nil error:\u0026amp;error])\n {\n //right here my program aborts\n NSLog(@\"Unresolved error %@, %@\", error, [error userInfo]);\n abort();\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e** \u003c/p\u003e\n\n\u003cp\u003eI will be much grateful if someone gives me advise or at least suggestion on what might the problem be.Thank you in advance!\u003c/p\u003e","accepted_answer_id":"8420241","answer_count":"1","comment_count":"0","creation_date":"2011-12-07 17:21:37.303 UTC","last_activity_date":"2011-12-07 18:06:04.94 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1065460","post_type_id":"1","score":"0","tags":"cocoa-touch|core-data","view_count":"468"} +{"id":"2718420","title":"candidate keys from functional dependencies","body":"\u003cp\u003eGiven the Relation R with attributes ABCDE. You are given the following dependencies: A -\u003e B, BC -\u003e E, and ED -\u003e A. I already have the answer which is CDE, ACD, and BCD. I just need to know how to do it. Thanks. \u003c/p\u003e","answer_count":"3","comment_count":"0","creation_date":"2010-04-27 02:54:39.673 UTC","favorite_count":"6","last_activity_date":"2016-05-06 03:33:50.783 UTC","last_edit_date":"2011-04-05 23:55:11.92 UTC","last_editor_display_name":"","last_editor_user_id":"387076","owner_display_name":"","owner_user_id":"303668","post_type_id":"1","score":"22","tags":"functional-dependencies|database-theory","view_count":"33692"} +{"id":"38047236","title":"Not able to access views in laravel 5 from url","body":"\u003cp\u003eI have followed these steps to remove index.php from url. I am working on laravel 5 and i have followed the insrtuection to remove index.php and public from url..but after i am not able to access my views folder and pages using url.Only main link like www.art.local is working www.art.local/index/register this is not working.\n Please Help\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Renaming the server.php to index.php (no modifications)\n Copy the .htaccess from public \n Changing .htaccess it a bit as follows for statics:\n\n RewriteEngine On\n\n RewriteCond %{REQUEST_FILENAME} !-d\n RewriteRule ^(.*)/$ /$1 [L,R=301]\n\n RewriteCond %{REQUEST_URI} ! (\\.css|\\.js|\\.png|\\.jpg|\\.gif|robots\\.txt)$ [NC]\n RewriteCond %{REQUEST_FILENAME} !-d\n RewriteCond %{REQUEST_FILENAME} !-f\n RewriteRule ^ index.php [L]\n\n RewriteCond %{REQUEST_FILENAME} !-d\n RewriteCond %{REQUEST_FILENAME} !-f\n RewriteCond %{REQUEST_URI} !^/public/\n RewriteRule ^(css|js|images)/(.*)$ public/$1/$2 [L,NC]\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"2","creation_date":"2016-06-27 06:31:34.547 UTC","last_activity_date":"2016-07-23 13:35:25.487 UTC","last_edit_date":"2016-06-27 06:37:02.76 UTC","last_editor_display_name":"","last_editor_user_id":"5515831","owner_display_name":"","owner_user_id":"5515831","post_type_id":"1","score":"0","tags":"laravel-5","view_count":"150"} +{"id":"46919766","title":"apache ignite .net sheduled tasks","body":"\u003cp\u003eBased on the project \u003ca href=\"https://apacheignite.readme.io/docs/cron-based-scheduling\" rel=\"nofollow noreferrer\"\u003edocumentation\u003c/a\u003e, there is in java version exists some cron-based scheduling. But i don't find any similar in .net implementation. \u003c/p\u003e\n\n\u003cp\u003eMy task is to once per day update my cache with long running job. In this case (no build in scheduling features for .net version) i think of creating app, which will run ignite in client mode and update cache with data. And run this app with windows task scheduler.\u003c/p\u003e\n\n\u003cp\u003eIs there are a better solutions? Or maybe a good examples?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eSolution implemented after answer was recieved:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eUsed \u003ca href=\"https://www.nuget.org/packages/FluentScheduler/\" rel=\"nofollow noreferrer\"\u003eFluentScheduler\u003c/a\u003e for scheduling periodicaly jobs. Unfortunately the \u003ca href=\"https://www.nuget.org/packages/Hangfire/\" rel=\"nofollow noreferrer\"\u003eHangFire\u003c/a\u003e I intended to use did not work. If node, which contain current executing scheduler fails or gone ofline for some reasons, then service starts on one of the rest nodes, and no scheduling jobs will be lost.\u003c/p\u003e\n\n\u003cp\u003e\u003cem\u003eScheduler job code\u003c/em\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class CacheUpdateRegistry : Registry\n{\n private readonly IIgnite _ignite;\n\n public CacheUpdateRegistry(IIgnite ignite)\n {\n _ignite = ignite;\n\n // output to console current node id as example each 2 seconds\n Schedule(() =\u0026gt; Console.WriteLine(\"Recurring on node: + \" + _ignite.GetCluster().GetLocalNode().Id)).ToRunNow().AndEvery(2).Seconds();\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cem\u003eService code:\u003c/em\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class CacheUpdateSchedulerService : IService\n{\n [InstanceResource]\n private readonly IIgnite _ignite;\n\n public void Init(IServiceContext context)\n {\n Console.WriteLine(\"CacheUpdateSchedulerService initialized\");\n obManager.Initialize(new CacheUpdateRegistry(_ignite));\n }\n\n // other code removed for brevity\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cem\u003eIgnite node code:\u003c/em\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar services = _ignite.GetServices();\nservices.DeployClusterSingleton(\"cacheUpdateScheduler\", new CacheUpdateSchedulerService());\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"46925809","answer_count":"1","comment_count":"0","creation_date":"2017-10-24 20:50:08.17 UTC","last_activity_date":"2017-10-26 08:21:01.927 UTC","last_edit_date":"2017-10-26 08:21:01.927 UTC","last_editor_display_name":"","last_editor_user_id":"1235390","owner_display_name":"","owner_user_id":"1235390","post_type_id":"1","score":"2","tags":".net|ignite","view_count":"30"} +{"id":"16766960","title":"jquery pan zoom not working inside colorbox","body":"\u003cp\u003eI have used jquery panzoom extracted from this site \u003ccode\u003ehttps://github.com/timmywil/jquery.panzoom\u003c/code\u003e inside the color box. The zoom option doesn't work inside the color box. If i placed it outside the popup it works fine. How to fix this?\u003c/p\u003e\n\n\u003cp\u003eInternal Script:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;script\u0026gt;\n $(\"#panzoom\").panzoom({\n $zoomIn: $(\".zoom-in\"),\n $zoomOut: $(\".zoom-out\"),\n $zoomRange: $(\".zoom-range\"),\n $reset: $(\".reset\")\n });\n \u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHtml:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;section\u0026gt;\n \u0026lt;div id=\"panzoom\" style=\"text-align: center\"\u0026gt;\n \u0026lt;img src=\"http://blog.millermedeiros.com/wp-content/uploads/2010/04/awesome_tiger.svg\" width=\"300\" height=\"300\"\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/section\u0026gt;\n \u0026lt;button class=\"zoom-in\"\u0026gt;Zoom In\u0026lt;/button\u0026gt;\n \u0026lt;button class=\"zoom-out\"\u0026gt;Zoom Out\u0026lt;/button\u0026gt;\n \u0026lt;input type=\"range\" class=\"zoom-range\"\u0026gt;\n \u0026lt;button class=\"reset\"\u0026gt;Reset\u0026lt;/button\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-05-27 05:43:51.713 UTC","last_activity_date":"2013-08-02 05:47:27.61 UTC","last_edit_date":"2013-05-27 05:45:41.477 UTC","last_editor_display_name":"","last_editor_user_id":"1846192","owner_display_name":"","owner_user_id":"1986080","post_type_id":"1","score":"2","tags":"javascript|jquery","view_count":"638"} +{"id":"30011006","title":"Execute linux shell command using PHP script and display in browser?","body":"\u003cp\u003e\u003ca href=\"https://stackoverflow.com/questions/5631600/executing-unix-shell-commands-using-php\"\u003eExecuting unix shell commands using PHP\u003c/a\u003e\n\u003ca href=\"https://stackoverflow.com/questions/16240411/running-shell-commands-using-php-script\"\u003eRunning shell commands using PHP script\u003c/a\u003e\n\u003ca href=\"https://stackoverflow.com/questions/12744058/execute-a-shell-command-through-php-and-display-it-in-browser\"\u003eExecute a shell command through php and display it in browser?\u003c/a\u003e\nI have already referred to the above links. But, I'm experiencing an issue in displaying the linux shell command process in the browser.\nMy linux command: top -n 1 and wanted to display them using php in the browser..\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emyscript.php\n\u0026lt;?php\n$var = shell_exec('top -n 1');\necho \"\u0026lt;pre\u0026gt;$var\u0026lt;/pre\u0026gt;\";\n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow, when I refresh my browser, I'm unable to see the output in the browser.\u003c/p\u003e","accepted_answer_id":"30015648","answer_count":"3","comment_count":"0","creation_date":"2015-05-03 06:41:23.393 UTC","favorite_count":"2","last_activity_date":"2017-08-08 12:11:30.067 UTC","last_edit_date":"2017-05-23 10:27:32.523 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"4822915","post_type_id":"1","score":"2","tags":"php|linux|shell|browser|command","view_count":"3655"} +{"id":"43083925","title":"Calling a ptototype function","body":"\u003cp\u003eI am working with a piece of code that I found in another project on the net and I am trying to adapt it to my needs. I wasn't able to find out how this function was originally being called so I am hoping to find some assistance here. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar gatewayIP = '192.168.10.21',\nsock = new WebSocket('ws://' + gatewayIP + ':8000');\nsock.binaryType = \"arraybuffer\";\n\n// Constructor, expects a socket/stream to write device commands \nfunction HTDLync(sock, log) {\n this.sock = sock;\n this.log = log;\n}\n\n// Change zone power state ('On', 'Off', '1', or '0')\nHTDLync.prototype.setPower = function(zone, power) {\n\n powerStr = power.toString().toLowerCase();\n\n var packet = Buffer.from([0x02, 0x00, 0x00, 0x04, 0x58]);\n packet.writeUInt8(this.cleanZone(zone), 2);\n\n if (powerStr == 'on' || powerStr == '1'){\n packet.writeUInt8(0x57, 4);\n }\n else if (powerStr == 'off' || powerStr == '0'){\n packet.writeUInt8(0x58, 4);\n }\n else {\n this.log.warn('Unknown setPower argument:', powerStr);\n return;\n }\n\n var dataOut = addChecksum(packet);\n this.log.debug('Sending setPower command:', dataOut.toString('hex'));\n msg.payload = dataOut;\n};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have tried calling the following:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esetPower('1', 'On');\nthis.setPower('1', 'On');\nHTDLync.setPower('1', 'On');\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAll of the above hit the console with function not defined errors.\u003c/p\u003e\n\n\u003cp\u003eI feel like I am either missing some other code or calling this function incorrectly. \u003c/p\u003e\n\n\u003cp\u003eHow would I go about calling this \u003ccode\u003esetPower\u003c/code\u003e prototype function ? \u003c/p\u003e","answer_count":"3","comment_count":"1","creation_date":"2017-03-29 03:47:29.827 UTC","last_activity_date":"2017-03-29 04:57:56.357 UTC","last_edit_date":"2017-03-29 03:49:19.193 UTC","last_editor_display_name":"","last_editor_user_id":"1048572","owner_display_name":"","owner_user_id":"2628921","post_type_id":"1","score":"0","tags":"javascript|methods|prototype","view_count":"25"} +{"id":"44058826","title":"Count using dplyr","body":"\u003cp\u003eWith this data frame:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edf = data.frame(mes = c(1,1,2,2,3,3), ano = c(1981, 1982,1983), x1 = c(95,8,10,NA,NA,98), x2 = c(NA, NA, 89, 48, NA, 10))\n \u0026gt; df\n mes ano x1 x2\n 1 1 1981 95 NA\n 2 1 1982 8 NA\n 3 2 1983 10 89\n 4 2 1981 NA 48\n 5 3 1982 NA NA\n 6 3 1983 98 10\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to get this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e mes x1_n x2_n\n1 1 2 0\n2 2 1 2\n3 3 1 1\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI mean, for each \u003ccode\u003emes\u003c/code\u003e unique value I want to know how many non \u003ccode\u003eNA\u003c/code\u003e values there are. I was trying to work with \u003ccode\u003edplyr::count()\u003c/code\u003e but I get this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026gt; count(df,mes)\n# A tibble: 3 × 2\n mes n\n \u0026lt;dbl\u0026gt; \u0026lt;int\u0026gt;\n1 1 2\n2 2 2\n3 3 2\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny thoughts? Thanks.\u003c/p\u003e","accepted_answer_id":"44058896","answer_count":"1","comment_count":"1","creation_date":"2017-05-18 22:35:31.647 UTC","favorite_count":"2","last_activity_date":"2017-05-18 22:50:10.63 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7097072","post_type_id":"1","score":"1","tags":"r|dplyr","view_count":"2931"} +{"id":"42358250","title":"Could anyone give suggestion on where to start learning Python?","body":"\u003cp\u003eI'm a beginner, and looking to learn the python language. If you have any suggestions on where I should start it would be nice if you would leave a comment.\u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2017-02-21 03:42:39.357 UTC","last_activity_date":"2017-02-21 03:45:53.377 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7596301","post_type_id":"1","score":"-2","tags":"python","view_count":"28"} +{"id":"32285649","title":"how basic instructions run in parallel","body":"\u003cp\u003eMaybe this is a stupid question but I am trying to gain a better understanding of hardware inner workings...\u003c/p\u003e\n\n\u003cp\u003eif a cpu has multi threads and we have a group of instruction set to assign it. as i read how it work from \u003ca href=\"http://www.lighterra.com/papers/basicinstructionscheduling/\" rel=\"nofollow\"\u003ehttp://www.lighterra.com/papers/basicinstructionscheduling/\u003c/a\u003e link. it says compiler will create a dependency tree of instructions and than instructions will run in parallel.how cpu will know dependent instruction has been finished or not. will it increase complexity.\u003c/p\u003e\n\n\u003cp\u003ei write a c code to see this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eint main()\n{\ngetchar();\nputchar('a'); \nreturn 0; \n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ei think that instructions of getchar() and putchar() are independent and when i am not giving input from keyboard than on other thread instructions of putchar('a') should be executed and it should show output before asking for input. but it wait fist for input all time.\u003c/p\u003e\n\n\u003cp\u003ethanks in advance.\u003c/p\u003e","accepted_answer_id":"32287674","answer_count":"1","comment_count":"5","creation_date":"2015-08-29 11:40:54.7 UTC","last_activity_date":"2015-08-29 15:42:42.743 UTC","last_edit_date":"2015-08-29 12:15:13.2 UTC","last_editor_display_name":"","last_editor_user_id":"5279683","owner_display_name":"","owner_user_id":"5279683","post_type_id":"1","score":"0","tags":"c|multithreading|hyperthreading|pipelining","view_count":"117"} +{"id":"41158002","title":"Rewriting wildcard domain with HTTPS","body":"\u003cp\u003eIs it possible to rewrite HTTPS wildcard Domains in nginx or should we create multiple structure /file for each domain?\u003c/p\u003e\n\n\u003cp\u003eLets say i have follwing:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e1. subdomain1.domain.com\n2. subdomain2.domain.com\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf i do not have HTTPS i used the following which works great:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eserver {\n listen 443;\nserver_name *.domain.com;\ncharset utf-8;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNo if i use HTTPS, i would have to write a new block like the following ( using letsencryt) \u003c/p\u003e\n\n\u003cp\u003eThe following is just a test domain (only 1 domain )\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e server {\n server_name test.me;\n rewrite ^ https://test.me$request_uri? permanent;\n}\n\nserver {\n listen 443;\n server_name test.me;\n charset utf-8;\n ...\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs it possible to do the same for multiple domains?\n server {\n server_name \u003cem\u003e.domain.com;\n rewrite ^ https://\u003c/em\u003e.domain.com$request_uri? permanent;\n }\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eserver {\n listen 443;\n server_name *.domain.com;\n charset utf-8;\n ...\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI tried the above config but it doesnot work, it redirects me to\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ehttps://%2A.domain.com.domain.com/ (just for test)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs it possible to do something like this ? or Should i have different block for every subdomain ?\u003c/p\u003e","accepted_answer_id":"41160317","answer_count":"1","comment_count":"0","creation_date":"2016-12-15 06:45:31.137 UTC","last_activity_date":"2016-12-15 09:13:45.757 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4796134","post_type_id":"1","score":"1","tags":"nginx|https","view_count":"306"} +{"id":"44407419","title":"Eclipse Maven MVC program CSS and JS files are not linking","body":"\u003cp\u003eI have inserted all the CSS files and JS files required for my project in a sequential manner and I have given the image link for that file structure. After insertion of the CSS files it just work for some time and when I did coding for database connection my resource file link is not working.\u003c/p\u003e\n\n\u003cp\u003eHere is my login.jsp:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;!DOCTYPE html\u0026gt;\n\u0026lt;%@ page isELIgnored=\"false\" %\u0026gt;\n\u0026lt;html lang=\"en\"\u0026gt;\n\u0026lt;head\u0026gt;\n \u0026lt;meta charset=\"utf-8\"\u0026gt;\n \u0026lt;meta name=\"resources/viewport\" content=\"width=device-width, initial-scale=1\"\u0026gt;\n \u0026lt;link href=\"resources/css/bootstrap.min.css\" rel=\"stylesheet\"\u0026gt;\n \u0026lt;script src=\"resources/js/jquery-3.2.1.min.js\" rel=\"stylesheet\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;script src=\"resources/js/bootstrap.min.js\" rel=\"stylesheet\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;link href=\"resources/css/animate.css\" rel=\"stylesheet\"\u0026gt;\n\n\u0026lt;/head\u0026gt;\n\u0026lt;body\u0026gt;\n\u0026lt;style\u0026gt;\n body {\n background-image: url(\"NGIlEC.jpg\");\n background-size: 100% 120%;\n /* background-color:#E6FFE6;*/ \n }\n hr{display:block;border:1px solid blue;margin-top:5px;}\n .well{background-color:lightblue;}\n\u0026lt;/style\u0026gt;\n\u0026lt;div class=\"container\"\u0026gt;\n \u0026lt;div class=\"container col-lg-4 col-lg-offset-4 col-md-6 col-md-offset-3 col-xs-12 col-sm-6 col-sm-offset-3 well animated swing\"style=\"margin-top:150px;border-radius:7%;\"\u0026gt;\n\n \u0026lt;div class=\"panel-heading\"\u0026gt;\n \u0026lt;div class=\"panel-title\"\u0026gt;\u0026lt;h2\u0026gt;Login\u0026lt;/h2\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;hr/\u0026gt;\n \u0026lt;p style=\"color:red;\"\u0026gt;${error }\u0026lt;/p\u0026gt;\n \u0026lt;form action=\"login\"\u0026gt;\n \u0026lt;div class=\"input-group col-sm-12 col-sm-12 col-md-12 col-xs-12 col-lg-12\"\u0026gt;\n \u0026lt;span class=\"input-group-addon\"\u0026gt;\u0026lt;img src=\"user.ico\" alt=\"user\" style=\"height:15px; width:px;\" /\u0026gt;\u0026lt;/span\u0026gt; \n \u0026lt;select class=\"selectpicker col-sm-12 col-sm-12 col-md-12 col-xs-12 col-lg-12\" style=\"height:35px;\"\u0026gt;\n \u0026lt;optgroup\u0026gt;\n \u0026lt;option\u0026gt;Usertype\u0026lt;/option\u0026gt;\n \u0026lt;option\u0026gt;Option-1\u0026lt;/option\u0026gt;\n \u0026lt;option\u0026gt;Option-2\u0026lt;/option\u0026gt;\n \u0026lt;option\u0026gt;Option-3\u0026lt;/option\u0026gt;\n \u0026lt;/optgroup\u0026gt;\n\u0026lt;/select\u0026gt;\n \u0026lt;/div\u0026gt;\u0026lt;br\u0026gt;\n \u0026lt;div class=\"input-group col-sm-12 col-sm-12 col-sm-12 col-md-12 col-xs-12 col-lg-12\"\u0026gt;\n \u0026lt;span class=\"input-group-addon\"\u0026gt;\u0026lt;i class=\"glyphicon glyphicon-user\"\u0026gt;\u0026lt;/i\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;input type=\"Username\" class=\"form-control\" name=\"uname\" id=\"Username\" placeholder=\"Username\"\u0026gt;\n \u0026lt;/div\u0026gt;\u0026lt;br\u0026gt;\n \u0026lt;div class=\"input-group col-sm-12 col-sm-12 col-sm-12 col-md-12 col-xs-12 col-lg-12\"\u0026gt;\n \u0026lt;span class=\"input-group-addon\"\u0026gt;\u0026lt;i class=\"glyphicon glyphicon-lock\"\u0026gt;\u0026lt;/i\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;input type=\"password\" class=\"form-control\" name=\"pwd\" id=\"pwd\" placeholder=\"password\" \u0026gt;\n \u0026lt;/div\u0026gt;\u0026lt;br\u0026gt;\n \u0026lt;div class=\"checkbox\"\u0026gt;\n \u0026lt;label\u0026gt;\u0026lt;input type=\"checkbox\"\u0026gt;Remember me\u0026lt;/label\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;label style=\"color:black;\"\u0026gt;\u0026lt;a href=\"#\"\u0026gt;Forgotten account?\u0026lt;/a\u0026gt;\u0026lt;/label\u0026gt;\n \u0026lt;button type=\"submit\" class=\"btn btn-primary pull-right\"\u0026gt;Login\u0026lt;/button\u0026gt;\n \u0026lt;/form\u0026gt;\n\n\u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u0026lt;script src=\"https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.1.1.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\n\u0026lt;script\u0026gt;\n $('#una').blur(function()\n {\n var p=$(\"#una\").val();\n var reg=/[a-zA-Z]{8,12}/;\n if(reg.test(p))\n {\n $(\"#uname\").html(\"valid\");\n }\n else{\n $(\"#uname\").html(\"invalid\");\n }\n });\n\n submitHandler: function(form) {\n form.submit();\n }\n })\n});\n\u0026lt;/script\u0026gt;\n\n\u0026lt;/body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/KaAK8.png\" alt=\"my program file structure\"\u003e\u003c/p\u003e\n\n\u003cp\u003eHere is my pom.xml:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\"\u0026gt;\n \u0026lt;modelVersion\u0026gt;4.0.0\u0026lt;/modelVersion\u0026gt;\n \u0026lt;groupId\u0026gt;student\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;student\u0026lt;/artifactId\u0026gt;\n \u0026lt;packaging\u0026gt;war\u0026lt;/packaging\u0026gt;\n \u0026lt;version\u0026gt;0.0.1-SNAPSHOT\u0026lt;/version\u0026gt;\n \u0026lt;name\u0026gt;student Maven Webapp\u0026lt;/name\u0026gt;\n \u0026lt;url\u0026gt;http://maven.apache.org\u0026lt;/url\u0026gt;\n \u0026lt;dependencies\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;junit\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;junit\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;3.8.1\u0026lt;/version\u0026gt;\n \u0026lt;scope\u0026gt;test\u0026lt;/scope\u0026gt;\n \u0026lt;/dependency\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;org.springframework\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;spring-webmvc\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;4.3.3.RELEASE\u0026lt;/version\u0026gt;\n \u0026lt;/dependency\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;log4j\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;log4j\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;1.2.17\u0026lt;/version\u0026gt;\n \u0026lt;/dependency\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;org.springframework\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;spring-jdbc\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;4.1.4.RELEASE\u0026lt;/version\u0026gt;\n \u0026lt;/dependency\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;mysql\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;mysql-connector-java\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;5.1.6\u0026lt;/version\u0026gt;\n \u0026lt;/dependency\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;javax.servlet\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;jstl\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;1.2\u0026lt;/version\u0026gt;\n\u0026lt;/dependency\u0026gt;\n\n \u0026lt;!-- https://mvnrepository.com/artifact/org.webjars/bootstrap --\u0026gt;\n\u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;org.webjars\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;bootstrap\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;3.2.0\u0026lt;/version\u0026gt;\n\u0026lt;/dependency\u0026gt;\n \u0026lt;!-- https://mvnrepository.com/artifact/org.webjars/jquery --\u0026gt;\n\u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;org.webjars\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;jquery\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;2.1.4\u0026lt;/version\u0026gt;\n\u0026lt;/dependency\u0026gt;\n\n \u0026lt;/dependencies\u0026gt;\n \u0026lt;build\u0026gt;\n \u0026lt;finalName\u0026gt;student\u0026lt;/finalName\u0026gt;\n \u0026lt;plugins\u0026gt;\n \u0026lt;plugin\u0026gt;\n \u0026lt;groupId\u0026gt;org.apache.tomcat.maven\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;tomcat7-maven-plugin\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;2.2\u0026lt;/version\u0026gt;\n \u0026lt;configuration\u0026gt;\n \u0026lt;port\u0026gt;8099\u0026lt;/port\u0026gt;\n \u0026lt;/configuration\u0026gt;\n \u0026lt;/plugin\u0026gt;\n \u0026lt;/plugins\u0026gt;\n \u0026lt;/build\u0026gt;\n\u0026lt;/project\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is my web.xml:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;!DOCTYPE web-app PUBLIC\n \"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN\"\n \"http://java.sun.com/dtd/web-app_2_3.dtd\" \u0026gt;\n\n\u0026lt;web-app\u0026gt;\n \u0026lt;display-name\u0026gt;Archetype Created Web Application\u0026lt;/display-name\u0026gt;\n \u0026lt;servlet\u0026gt;\n \u0026lt;servlet-name\u0026gt;first\u0026lt;/servlet-name\u0026gt;\n \u0026lt;servlet-class\u0026gt;org.springframework.web.servlet.DispatcherServlet\u0026lt;/servlet-class\u0026gt;\n \u0026lt;init-param\u0026gt;\n \u0026lt;param-name\u0026gt;contextConfigLocation\u0026lt;/param-name\u0026gt;\n \u0026lt;param-value\u0026gt;/WEB-INF/info-servlet.xml\u0026lt;/param-value\u0026gt;\n \u0026lt;/init-param\u0026gt;\n \u0026lt;/servlet\u0026gt;\n\u0026lt;servlet-mapping\u0026gt;\n \u0026lt;servlet-name\u0026gt;first\u0026lt;/servlet-name\u0026gt;\n \u0026lt;url-pattern\u0026gt;/\u0026lt;/url-pattern\u0026gt;\n \u0026lt;/servlet-mapping\u0026gt;\n\u0026lt;/web-app\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is my info-servlet.xml:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" encoding=\"UTF-8\"?\u0026gt;\n\u0026lt;beans:beans \n xmlns=\"http://www.springframework.org/schema/mvc\"\n xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" \n xmlns:beans=\"http://www.springframework.org/schema/beans\"\n xmlns:context=\"http://www.springframework.org/schema/context\"\n xmlns:p=\"http://www.springframework.org/schema/p\"\n xmlns:tx=\"http://www.springframework.org/schema/tx\"\n xmlns:util=\"http://www.springframework.org/schema/util\"\n xsi:schemaLocation=\"http://www.springframework.org/schema/mvc \n http://www.springframework.org/schema/mvc/spring-mvc.xsd\n http://www.springframework.org/schema/beans \n http://www.springframework.org/schema/beans/spring-beans.xsd\n http://www.springframework.org/schema/context \n http://www.springframework.org/schema/context/spring-context.xsd\n http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd\n http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd\"\u0026gt;\n\n\n \u0026lt;context:component-scan base-package=\"handler\"/\u0026gt;\n\n \u0026lt;annotation-driven /\u0026gt;\n\n \u0026lt;beans:bean class=\"org.springframework.web.servlet.view.InternalResourceViewResolver\"\u0026gt;\n \u0026lt;beans:property name=\"prefix\"\u0026gt;\n \u0026lt;beans:value\u0026gt;\u0026lt;/beans:value\u0026gt;\n \u0026lt;/beans:property\u0026gt;\n \u0026lt;beans:property name=\"suffix\"\u0026gt;\n \u0026lt;beans:value\u0026gt;.jsp\u0026lt;/beans:value\u0026gt;\n \u0026lt;/beans:property\u0026gt;\n \u0026lt;/beans:bean\u0026gt;\n\n \u0026lt;beans:bean id=\"dataSource\" class=\"org.springframework.jdbc.datasource.DriverManagerDataSource\"\u0026gt;\n \u0026lt;beans:property name=\"driverClassName\" value=\"com.mysql.jdbc.Driver\"\u0026gt;\u0026lt;/beans:property\u0026gt;\n \u0026lt;beans:property name=\"url\" value=\"jdbc:mysql://localhost:3306/schoolerp\"\u0026gt;\u0026lt;/beans:property\u0026gt;\n \u0026lt;beans:property name=\"username\" value=\"root\"\u0026gt;\u0026lt;/beans:property\u0026gt;\n \u0026lt;beans:property name=\"password\" value=\"\"\u0026gt;\u0026lt;/beans:property\u0026gt;\n \u0026lt;/beans:bean\u0026gt;\n\n \u0026lt;beans:bean id=\"jdbcTemp\" class=\"org.springframework.jdbc.core.JdbcTemplate\"\u0026gt;\n \u0026lt;beans:property name=\"dataSource\" ref=\"dataSource\"\u0026gt;\u0026lt;/beans:property\u0026gt;\n \u0026lt;/beans:bean\u0026gt;\n\n\n \u0026lt;beans:bean id=\"userDao\" class=\"dao.UserDaoImpl\"\u0026gt;\n \u0026lt;beans:property name=\"jdbcTemp\" ref=\"jdbcTemp\"\u0026gt;\u0026lt;/beans:property\u0026gt;\n \u0026lt;/beans:bean\u0026gt;\n\n\u0026lt;/beans:beans\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-06-07 08:28:37.2 UTC","last_activity_date":"2017-06-07 14:58:02.403 UTC","last_edit_date":"2017-06-07 14:58:02.403 UTC","last_editor_display_name":"","last_editor_user_id":"3270037","owner_display_name":"","owner_user_id":"8077947","post_type_id":"1","score":"0","tags":"eclipse","view_count":"14"} +{"id":"10672245","title":"MySQL Update with a fulltext search","body":"\u003cpre\u003e\u003ccode\u003eUPDATE mytable SET this = 'this' AND that = 'that'\nWHERE MATCH (items) AGAINST ('item5')\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe problem is this query will perform an \u003ccode\u003eUPDATE\u003c/code\u003e on every match found, instead of the desired result which is to update the first row matched. \u003c/p\u003e\n\n\u003cp\u003eAdding \u003ccode\u003eLIMIT 0, 1\u003c/code\u003e to the query results in a MySQL Syntax Error. Is there a way to do this update on the first record found using a fulltext query?\u003c/p\u003e","accepted_answer_id":"10672258","answer_count":"1","comment_count":"0","creation_date":"2012-05-20 09:22:33.53 UTC","favorite_count":"1","last_activity_date":"2012-05-20 09:25:00.347 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1093634","post_type_id":"1","score":"1","tags":"mysql|full-text-search","view_count":"159"} +{"id":"18065100","title":"iOS Facebook Login Fast-App Switch Stays on Facebook App","body":"\u003cp\u003eI'll preface this by saying that this bug is difficult to reproduce and I have not been able to find a pattern for when it occurs.\u003c/p\u003e\n\n\u003cp\u003eWhen a user selects the Facebook login option in my iOS app, the app fast-switches to the Facebook app, and will stay in the Facebook app on the News Feed. Then when a user returns to my iOS app, and attempt to Facebook login again, it will fast-app switch and the login will continue as intended. When this bug occurs, it always fails, and then works reliably on the following attempt.\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2013-08-05 18:25:57.613 UTC","last_activity_date":"2015-09-22 16:26:34.533 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1236969","post_type_id":"1","score":"2","tags":"iphone|ios|facebook|facebook-ios-sdk","view_count":"773"} +{"id":"25583864","title":"converting raster data to factor in R","body":"\u003cp\u003eI have imported a raster file into R - it is categorical, with two values, 0 and 1. \nI need to have it stored as a factor. \u003c/p\u003e\n\n\u003cp\u003eI have tried the following: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#as.factor when importing \nmydata.factor \u0026lt;- as.factor(raster(\"mydata.tif\"))\n\n#or import first then try converting\nmydata \u0026lt;- raster(mydata.tif)\nmydata.factor \u0026lt;- as.factor(mydata)\n\n#or call just values \nmydata \u0026lt;- raster(mydata.tif)\nmydata$values \u0026lt;- as.factor(mydata$values)\n\n#or based on the example in the Raster package, something like this\nmydata \u0026lt;- raster(mydata.tif)\nmydata.factor \u0026lt;- as.factor(mydata)\nmydata.factorlevels \u0026lt;- levels(mydata.factors)[[1]]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI can't quite get what I want, which is a layer that when called into another function (the joincount.multi function in package spdedp) is recognized as a factor. Any tips would be greatly appreciated! \u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2014-08-30 15:18:19.09 UTC","favorite_count":"1","last_activity_date":"2016-08-02 22:27:31.007 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3251223","post_type_id":"1","score":"1","tags":"r|r-raster","view_count":"886"} +{"id":"44953327","title":"Running psexec from powershell shows a Syntax error","body":"\u003cp\u003eI am running a psexec command on a remote system successfully, although it is reporting a Syntax error. I have tried removing the .\\ but still have the same error.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e.\\psexec.exe \\\\$Server cmd /c 'echo . | powershell.exe -command \"c:\\programdata\\payloads\\sepprep\\sepprep64.exe\"'\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-07-06 15:34:40.173 UTC","last_activity_date":"2017-07-06 15:34:40.173 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7044931","post_type_id":"1","score":"0","tags":"psexec","view_count":"18"} +{"id":"37392733","title":"Difference between @JsonIgnore and @JsonBackReference, @JsonManagedReference","body":"\u003cp\u003eI know both \u003ccode\u003e@JsonIgnore\u003c/code\u003e and \u003ccode\u003e@JsonManagedReference\u003c/code\u003e, \u003ccode\u003e@JsonBackReference\u003c/code\u003e are used to solve the \u003ccode\u003eInfinite recursion (StackOverflowError)\u003c/code\u003e, what is the difference between these two?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eNote :\u003c/strong\u003e\nThese are Jackson annotations.\u003c/p\u003e","accepted_answer_id":"37394318","answer_count":"2","comment_count":"2","creation_date":"2016-05-23 13:45:58.747 UTC","favorite_count":"10","last_activity_date":"2017-06-15 05:54:40.493 UTC","last_edit_date":"2016-05-23 18:09:04.16 UTC","last_editor_display_name":"","last_editor_user_id":"6321991","owner_display_name":"","owner_user_id":"6321991","post_type_id":"1","score":"16","tags":"java|json|jackson","view_count":"11025"} +{"id":"44213252","title":"Create Refile attachment from HTTpary on a Ruby model with mongo db","body":"\u003cp\u003eBuilding a mobile app with Rails backend, I would like to import the facebook profile picture from facebook to my own system using rails. The profile image is located at some url, and the pictures in my backend are being saved using Refile.\u003c/p\u003e\n\n\u003cp\u003eThe ProfilePicture model:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass ProfilePicture\n include Mongoid::Document\n extend Refile::Mongoid::Attachment\n attachment :file, type: :image\n belongs_to :user\n\n field :created_at, type: String\n field :updated_at, type: String\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe User model:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass User\n include Mongoid::Document\n\n field :created_at, type: String\n field :updated_at, type: String\n\n has_one :profile_picture\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe code to set the Picture, using HTTParty:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@user = User.find_by(id: 1)\n@picture_data = HTTParty.get(\"https://graph.facebook.com/me/picture\", query: {\n access_token: access_token,\n type: \"large\"\n})\npic = ProfilePicture.new(file: @picture_data.body)\n@user.update(profile_picture: pic)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe profile picture is GETed, as I can see the data in the HTTP result. The DB result of the \"Update\" action above would be a new ProfilePicture record in the mongodb, with a reference to the user data, so that's OK too. So the only problem is, that the attachment is not being saved.\u003c/p\u003e\n\n\u003cp\u003eHow do I save the attachement? \u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-05-27 05:23:53.77 UTC","last_activity_date":"2017-05-30 16:28:28.937 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1743693","post_type_id":"1","score":"0","tags":"ruby-on-rails|mongodb|facebook|httparty|refile","view_count":"37"} +{"id":"17945170","title":"cassandra nodetool status tokens varies","body":"\u003cp\u003eI am using cassandra 1.2.5 and have 4 nodes in a cluster. Initially i have configured num_tokens to 4 in all 4 nodes and later changed to 256. But whenever i run nodetool status it shows tokens only 4. We did nodetool decommission in all 4 nodes and restarted, then it shows tokens 256 for node3 and node4. for node1 and node2 it shows the tokens as 4 only. node1 and node2 are seeds. What should i do to get the tokens as 256?\u003c/p\u003e\n\n\u003cp\u003eBecause of this the owns for node3 and node4 are 46.9% and 50.7%. and for node1 and node2 it is 1.6 and 0.9%\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2013-07-30 10:58:33.423 UTC","last_activity_date":"2013-07-30 10:58:33.423 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2527312","post_type_id":"1","score":"0","tags":"cassandra","view_count":"416"} +{"id":"1037500","title":"What memcached for Win32 .net api do you use and recommend?","body":"\u003cp\u003eWhat memcached for Win32 .net api do you use and recommend?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2009-06-24 10:13:20.08 UTC","favorite_count":"2","last_activity_date":"2017-08-19 05:27:38.807 UTC","last_edit_date":"2017-08-19 05:27:38.807 UTC","last_editor_display_name":"","last_editor_user_id":"1033581","owner_display_name":"","owner_user_id":"98070","post_type_id":"1","score":"1","tags":".net|memcached","view_count":"180"} +{"id":"26989903","title":"ConEmu with Git Bash delete key won't work","body":"\u003cp\u003eI am using ConEMU with Git Bash and all is working well except the delete key. When I press the delete key I get a ~ instead of the character being removed. The only way to delete is get in front of the character and press backspace.\u003c/p\u003e\n\n\u003cp\u003eI do no exhibit this problem using Powershell so I presume something else must be upsetting it.\u003c/p\u003e\n\n\u003cp\u003eI have searched the settings under Keys and Macros but cannot find anything to fix my problem.\u003c/p\u003e","accepted_answer_id":"29814057","answer_count":"3","comment_count":"1","creation_date":"2014-11-18 08:38:54.22 UTC","favorite_count":"1","last_activity_date":"2017-08-01 15:23:43.667 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2064713","post_type_id":"1","score":"3","tags":"git|bash|git-bash|conemu","view_count":"662"} +{"id":"5892523","title":"How can I get a well Structure CSS styled html profile?","body":"\u003cp\u003eI am looking to have a picture, name of the person, links to photos, biography, life, tell about you! a map tag where the location will be shown, also at the right, there will be details like like, Born: Nationality: Ocupation, Trakcs:\u003c/p\u003e\n\n\u003cp\u003eCan any body help me with a semantic html structure style with CSS Please use \u003ca href=\"http://jsfiddle.net/\" rel=\"nofollow\"\u003ehttp://jsfiddle.net/\u003c/a\u003e to build it online Thanks.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"\u0026gt;\n\u0026lt;html xmlns=\"http://www.w3.org/1999/xhtml\"\u0026gt;\n\u0026lt;head\u0026gt;\n\u0026lt;meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /\u0026gt;\n\u0026lt;title\u0026gt;Your Yard Sales onproducts.line\u0026lt;/title\u0026gt;\n\u0026lt;link rel=\"stylesheet\" href=\"\" type=\"text/css\" media=\"screen\" /\u0026gt;\n\n\u0026lt;/head\u0026gt;\n\u0026lt;style type=\"text/css\" \u0026gt;\n#space {\n\n margin-bottom:1.2em;\n\n }\nul {\n width: 100%;\n float: left;\n margin: 0 0 3em 0;\n padding: 0;\n list-style: none;\n background-color: #f2f2f2;\n border-bottom: 1px solid #ccc; \n border-top: 1px solid #ccc; }\n li {\n float: left; }\n li a {\n display: block;\n padding: 8px 15px;\n text-decoration: none;\n font-weight: bold;\n color: #069;\n border-right: 1px solid #ccc; }\n \u0026lt;/style\u0026gt;\n\u0026lt;body\u0026gt; \n\u0026lt;ul\u0026gt;\n\n\u0026lt;li\u0026gt;\u0026lt;a href=\"#\"\u0026gt;Home\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n\n\u0026lt;li\u0026gt;\u0026lt;a href=\"#\"\u0026gt;Members\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n\n\u0026lt;li\u0026gt;\u0026lt;a href=\"#\"\u0026gt;Rollers\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n\n\u0026lt;li\u0026gt;\u0026lt;a href=\"#\"\u0026gt;Info\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n\u0026lt;/ul\u0026gt;\n \u0026lt;br/\u0026gt;\n \u0026lt;br/\u0026gt;\n \u0026lt;br/\u0026gt;\n \u0026lt;br/\u0026gt;\n\u0026lt;div id=\"space\"\u0026gt;\n\u0026lt;a href=\"#\"\u0026gt;Roberto Kirt\u0026lt;/a\u0026gt;\n\n\n\n\u0026lt;/div\u0026gt;\n\u0026lt;!--\u0026lt;ul\u0026gt;\u0026lt;li\u0026gt;\u0026lt;a href=\"#\"\u0026gt;'.$name2.'\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n\u0026lt;li\u0026gt;\u0026lt;a href=\"#\"\u0026gt;'.$name2.'\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n\u0026lt;li\u0026gt;\u0026lt;a href=\"#\"\u0026gt;'.$name2.'\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\u0026lt;/ul\u0026gt;--\u0026gt;\n\n\u0026lt;table width=\"1768\" cellpadding=\"0\" cellspacing=\"0\" border=\"0.5\"\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td width=\"493\" height=\"149\"\u0026gt;\u0026lt;img style=\"border:#666 1px solid;\" src=\"images/profileimages/8.jpg\" alt=\"Angel Pilier \"align=\"left\" width=\"100\" height=\"130\" border=\"1\" /\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;td width=\"1275\"\u0026gt;\u0026lt;table width=\"880\" border=\"0.5\" cellpadding=\"0\" cellspacing=\"0\"\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td width=\"145\" height=\"31\"\u0026gt; \u0026lt;/td\u0026gt;\u0026lt;td\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n\n \u0026lt;tr\u0026gt;\n \u0026lt;td height=\"44\" align=\"right\"\u0026gt;Born:\u0026lt;/td\u0026gt;\u0026lt;td width=\"735\"\u0026gt;1975-11-23\u0026lt;/td\u0026gt;\n\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr align=\"right\"\u0026gt;\n \u0026lt;td height=\"38\"\u0026gt;\u0026lt;/td\u0026gt;\n \u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td height=\"36\" align=\"right\"\u0026gt;Died:\u0026lt;/td\u0026gt;\u0026lt;td width=\"735\"\u0026gt;0000-00-00\u0026lt;/td\u0026gt;\n\n \u0026lt;/tr\u0026gt;\n \u0026lt;/table\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\u0026lt;td height=\"31\" colspan=\"2\"\u0026gt;\u0026amp;nbsp;\u0026lt;/td\u0026gt;\u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td height=\"31\"\u0026gt;\u0026lt;a href=\"#\"\u0026gt;Photos\u0026lt;/a\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;td rowspan=\"7\"\u0026gt;\u0026lt;table width=\"885\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td width=\"145\" height=\"31\" align=\"right\"\u0026gt; Nationality:\u0026lt;/td\u0026gt;\u0026lt;td width=\"740\"\u0026gt;\u0026lt;/td\u0026gt;\n\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr align=\"right\"\u0026gt;\n \u0026lt;td height=\"25\"\u0026gt;\u0026amp;nbsp;\u0026lt;/td\u0026gt;\n\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td height=\"24\" align=\"right\"\u0026gt;Spouse:\u0026lt;/td\u0026gt;\u0026lt;td width=\"740\"\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr align=\"right\"\u0026gt;\n \u0026lt;td height=\"28\"\u0026gt;\u0026amp;nbsp;\u0026lt;/td\u0026gt;\n\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td height=\"27\" align=\"right\"\u0026gt;Ocupation:\u0026lt;/td\u0026gt;\u0026lt;td width=\"740\"\u0026gt;Pianist\u0026lt;/td\u0026gt;\n\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr align=\"right\"\u0026gt;\n \u0026lt;td height=\"27\"\u0026gt;\u0026amp;nbsp;\u0026lt;/td\u0026gt;\n\n \u0026lt;/tr\u0026gt;\n \u0026lt;td height=\"27\" align=\"right\"\u0026gt;Childhood:\u0026lt;/td\u0026gt;\u0026lt;td width=\"740\"\u0026gt;\u0026lt;/td\u0026gt;\n\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr align=\"right\"\u0026gt;\u0026lt;td height=\"27\"\u0026gt;\u0026amp;nbsp;\u0026lt;/td\u0026gt;\n\n \u0026lt;/tr\u0026gt;\n \u0026lt;td height=\"27\" align=\"right\"\u0026gt;Tracks:\u0026lt;/td\u0026gt;\u0026lt;td width=\"740\"\u0026gt;\u0026lt;/td\u0026gt;\n\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr align=\"right\"\u0026gt;\n \u0026lt;td height=\"119\"\u0026gt;\u0026amp;nbsp;\u0026lt;/td\u0026gt;\n\n \u0026lt;/tr\u0026gt;\n\u0026lt;/table\u0026gt;\n\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td height=\"25\"\u0026gt; \u0026lt;a href=\"#\"\u0026gt;Biography\u0026lt;/a\u0026gt;\u0026lt;/td\u0026gt;\n\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td height=\"25\"\u0026gt; \u0026lt;a href=\"#\"\u0026gt;Life\u0026lt;/a\u0026gt;\u0026lt;/td\u0026gt;\n\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td height=\"26\"\u0026gt;\u0026lt;a href=\"#\"\u0026gt;Tell an Anecdote\u0026lt;/a\u0026gt;\u0026lt;/td\u0026gt;\n\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n\n\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n\n\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;iframe width=\"700\" height=\"350\" frameborder=\"0\" scrolling=\"no\" marginheight=\"0\" marginwidth=\"0\" src=\"http://maps.google.com/maps?f=q\u0026amp;amp;source=s_q\u0026amp;amp;hl=en\u0026amp;amp;geocode=\u0026amp;amp;q=Rochester,+New York,+United States\u0026amp;amp;sspn=0.119541,0.110378\u0026amp;amp;ie=UTF8\u0026amp;amp;hq=\u0026amp;amp;hnear=Rochester,+New York,+United States\u0026amp;amp;z=14\u0026amp;amp;output=embed\"\u0026gt;\u0026lt;/iframe\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;!--\u0026lt;img src=\"images/foto.jpg\" alt=\"nada\" width=\"422\" height=\"165\" /\u0026gt;--\u0026gt;\n \u0026lt;/tr\u0026gt;\n\u0026lt;/table\u0026gt;\n\n\u0026lt;/body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"5892745","answer_count":"3","comment_count":"7","creation_date":"2011-05-05 03:58:51.193 UTC","last_activity_date":"2014-01-26 05:04:39.663 UTC","last_edit_date":"2011-05-05 04:14:22.293 UTC","last_editor_display_name":"","last_editor_user_id":"666159","owner_display_name":"","owner_user_id":"666159","post_type_id":"1","score":"1","tags":"html|css","view_count":"160"} +{"id":"43417565","title":"How to position menu in center and remove lines between text?","body":"\u003cp\u003eI started to work on personal forum, and wanted to integrate menu into header. i inserted links into template, but for some reason, menu is right alligned and have some lines between links. How to center the entire menu, and remove that lines between each link? Problem can be seen \u003ca href=\"http://mythicalservers.net/forum/\" rel=\"nofollow noreferrer\"\u003ehere\u003c/a\u003e.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/wM4EK.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/wM4EK.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"43417642","answer_count":"1","comment_count":"3","creation_date":"2017-04-14 18:56:37.62 UTC","last_activity_date":"2017-04-14 19:18:16.177 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7297924","post_type_id":"1","score":"-1","tags":"html|css|styles|mybb","view_count":"20"} +{"id":"34753178","title":"oauth scopes google classroom API","body":"\u003cp\u003eI am trying to get round a problem with my code which states\u003c/p\u003e\n\n\u003cp\u003e\"403 when requesting \u003ca href=\"https://classroom.googleapis.com/v1/courses/582805726/students?alt=json\" rel=\"nofollow\"\u003ehttps://classroom.googleapis.com/v1/courses/582805726/students?alt=json\u003c/a\u003e returned \"Request had insufficient authentication scopes.\"\u003c/p\u003e\n\n\u003cp\u003eSo I have been looking into adding the right scopes for my python project.\u003c/p\u003e\n\n\u003cp\u003eI did this for GAM and I thought I would do it in this screen:\u003c/p\u003e\n\n\u003cp\u003eManage API client access (thats in the admin panel).\u003c/p\u003e\n\n\u003cp\u003eSo I have created a project, enabled the google classroom API, created an OAuth 2.0 client ID and copied this along with the following scopes:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ehttps://www.googleapis.com/auth/classroom.rosters,\nhttps://www.googleapis.com/auth/classroom.profile.emails,\nhttps://www.googleapis.com/auth/classroom.profile.photos,\nhttps://www.googleapis.com/auth/classroom.courses\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut still no joy.\u003c/p\u003e\n\n\u003cp\u003eCould anyone point me in the right direction?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-01-12 20:28:50.89 UTC","last_activity_date":"2016-01-12 20:40:43.873 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5780929","post_type_id":"1","score":"0","tags":"google-classroom","view_count":"263"} +{"id":"21018657","title":"How to make arduino pin high and low for specific time from android","body":"\u003cp\u003eI am making android application which sends signal from android app to arduino.\nBut i want to make arduino pin high and low for specific time period say one hour.\ni.e user will specify the time period and length of time period..\nHow i can approach in android for this..\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2014-01-09 11:16:24.95 UTC","last_activity_date":"2014-01-11 06:06:55.587 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3033463","post_type_id":"1","score":"0","tags":"android|arduino","view_count":"266"} +{"id":"25554440","title":"Markdown that incorporates standard header","body":"\u003cp\u003eI would like to standardize my technical documents. To simplify it, I'd like to use markdown but I also want it to incorporate a standard header and footer and versioning.\u003c/p\u003e\n\n\u003cp\u003eHow can I include the header and footer in to each new document?\u003c/p\u003e\n\n\u003cp\u003eI would like something like this:\u003c/p\u003e\n\n\u003cp\u003eHeader:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e####My Company\n![](http://image/file.jpg)\n---\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFooter:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e---\n\u0026lt;sup\u0026gt;File version:[version]\u0026lt;/sup\u0026gt;\n\u0026lt;sup\u0026gt;Compiled [date]\u0026lt;/sup\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd then each tech document would be as such:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{include header.md}\n\n- technical\n- stuff\n- and \n- other stuff\n\n{included footer.md}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThen when converted to html or pdf it would just combine them all into one pretty document.\u003c/p\u003e\n\n\u003cp\u003eAlternatively if you can compile multiple documents into one out put like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emarddown2pdf header.md body.md footer.md -o output.pdf\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThat would work too (syntax for that command was made up for example)\u003c/p\u003e\n\n\u003cp\u003eIs there a way to achieve this already using python or ruby, before I reinvent the wheel?\u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2014-08-28 17:15:20.233 UTC","last_activity_date":"2014-08-28 17:32:01.887 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1658796","post_type_id":"1","score":"0","tags":"python|ruby|markdown","view_count":"90"} +{"id":"30065495","title":"How to create choropleth map in R studio from a data frame extracted from XML","body":"\u003cp\u003e(totally new to R) I have downloaded an XML file to use in R to create a choropleth map from the data. I am using US flu data. From my research I understand that I needed to make that XML file a data frame for R to read. So I have done that. When I view my data frame I get all the XML formatting with it. The question I have is how do I take the information that I need and extract it to create a map? At this point I am getting errors on even plotting the data. I have looked high and low for this information and I haven't found it as of yet. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e setwd(\"C:/Users/Steven/Downloads/Map_Final\")\n\u0026gt; library (XML)\n\u0026gt; library(ggplot2)\n\u0026gt; library(maps)\n\u0026gt; library(plyr)\n\u0026gt; library(mapproj)\n\u0026gt; map('state')\n\u0026gt; \n\u0026gt; xmlfile=xmlParse(\"flu.xml\")\n\u0026gt; \n\u0026gt; class(xmlfile)\n[1] \"XMLInternalDocument\" \"XMLAbstractDocument\"\n\u0026gt; ggplot(xmlfile)\nError: ggplot2 doesn't know how to deal with data of class XMLInternalDocumentXMLAbstractDocument\n\u0026gt; xmltop = xmlRoot(xmlfile) #gives content of root\n\u0026gt; \n\u0026gt; class(xmltop)#\"XMLInternalElementNode\" \"XMLInternalNode\" \"XMLAbstractNode\"\n[1] \"XMLInternalElementNode\" \"XMLInternalNode\" \"XMLAbstractNode\" \n\u0026gt; \n\u0026gt; xmlName(xmltop) #give name of node, PubmedArticleSet\n[1] \"timeperiod\"\n\u0026gt; \n\u0026gt; xmlSize(xmltop) #how many children in node, 19\n[1] 54\n\u0026gt; \n\u0026gt; xmlName(xmltop[[1]]) #name of root's children\n[1] \"state\"\n\u0026gt; \n\u0026gt; xmltop[[1]]\n\u0026lt;state\u0026gt;\n \u0026lt;abbrev\u0026gt;ME\u0026lt;/abbrev\u0026gt;\n \u0026lt;color\u0026gt;No Activity\u0026lt;/color\u0026gt;\n \u0026lt;label\u0026gt;No Activity\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt; \n\u0026gt; \n\u0026gt; xmltop[[2]]\n\u0026lt;state\u0026gt;\n \u0026lt;abbrev\u0026gt;NH\u0026lt;/abbrev\u0026gt;\n \u0026lt;color\u0026gt;Local Activity\u0026lt;/color\u0026gt;\n \u0026lt;label\u0026gt;Local Activity\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt; \n\u0026gt; \n\u0026gt; ggplot(xmltop)\nError: ggplot2 doesn't know how to deal with data of class XMLInternalElementNodeXMLInternalNodeXMLAbstractNode\n\u0026gt; xmltop[[2]]\n\u0026lt;state\u0026gt;\n \u0026lt;abbrev\u0026gt;NH\u0026lt;/abbrev\u0026gt;\n \u0026lt;color\u0026gt;Local Activity\u0026lt;/color\u0026gt;\n \u0026lt;label\u0026gt;Local Activity\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt; \n\u0026gt; \n\u0026gt; xmltop[[2]]\n\u0026lt;state\u0026gt;\n \u0026lt;abbrev\u0026gt;NH\u0026lt;/abbrev\u0026gt;\n \u0026lt;color\u0026gt;Local Activity\u0026lt;/color\u0026gt;\n \u0026lt;label\u0026gt;Local Activity\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt; \n\u0026gt; \n\u0026gt; birdflu=ldply(xmlToList(\"flu.xml\"), data.frame)\n\u0026gt; ggplot(birdflu)\nError: No layers in plot\n\u0026gt; View(birdflu)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eXML File: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;timeperiod number=\"40\" year=\"2014\" subtitle=\"Week Ending October 11, 2014- Week 40\"\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;ME\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;No Activity\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;No Activity\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;NH\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;Local Activity\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;Local Activity\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;VT\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;Sporadic\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;Sporadic\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;MA\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;Sporadic\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;Sporadic\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;RI\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;No Activity\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;No Activity\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;CT\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;Sporadic\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;Sporadic\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;NY\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;Sporadic\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;Sporadic\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;NJ\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;Sporadic\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;Sporadic\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;PR\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;Regional\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;Regional\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;VI\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;Sporadic\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;Sporadic\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;PA\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;Sporadic\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;Sporadic\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;DE\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;No Activity\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;No Activity\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;MD\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;No Activity\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;No Activity\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;DC\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;Sporadic\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;Sporadic\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;VA\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;Sporadic\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;Sporadic\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;WV\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;No Activity\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;No Activity\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;NC\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;Sporadic\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;Sporadic\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;SC\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;Sporadic\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;Sporadic\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;GA\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;Sporadic\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;Sporadic\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;FL\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;Sporadic\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;Sporadic\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;KY\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;No Activity\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;No Activity\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;TN\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;No Activity\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;No Activity\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;AL\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;Local Activity\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;Local Activity\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;MS\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;No Activity\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;No Activity\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;OH\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;Sporadic\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;Sporadic\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;IN\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;No Activity\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;No Activity\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;IL\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;No Activity\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;No Activity\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;MI\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;Sporadic\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;Sporadic\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;WI\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;Sporadic\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;Sporadic\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;MN\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;Sporadic\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;Sporadic\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;AR\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;Sporadic\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;Sporadic\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;LA\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;Sporadic\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;Sporadic\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;OK\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;No Activity\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;No Activity\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;TX\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;Sporadic\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;Sporadic\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;NM\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;Sporadic\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;Sporadic\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;IA\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;No Activity\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;No Activity\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;MO\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;No Activity\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;No Activity\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;NE\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;No Activity\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;No Activity\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;KS\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;No Activity\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;No Activity\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;ND\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;Local Activity\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;Local Activity\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;SD\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;Sporadic\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;Sporadic\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;MT\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;No Activity\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;No Activity\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;WY\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;Sporadic\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;Sporadic\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;CO\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;Sporadic\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;Sporadic\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;UT\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;Sporadic\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;Sporadic\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;AZ\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;No Activity\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;No Activity\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;NV\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;No Activity\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;No Activity\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;CA\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;Sporadic\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;Sporadic\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;HI\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;Sporadic\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;Sporadic\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;GU\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;Widespread\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;Widespread\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;ID\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;No Activity\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;No Activity\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;WA\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;Sporadic\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;Sporadic\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;OR\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;Sporadic\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;Sporadic\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;state\u0026gt;\n\u0026lt;abbrev\u0026gt;AK\u0026lt;/abbrev\u0026gt;\n\u0026lt;color\u0026gt;Sporadic\u0026lt;/color\u0026gt;\n\u0026lt;label\u0026gt;Sporadic\u0026lt;/label\u0026gt;\n\u0026lt;/state\u0026gt;\n\u0026lt;/timeperiod\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"30065972","answer_count":"1","comment_count":"4","creation_date":"2015-05-06 00:30:22.623 UTC","last_activity_date":"2015-05-06 07:00:42.697 UTC","last_edit_date":"2015-05-06 07:00:42.697 UTC","last_editor_display_name":"","last_editor_user_id":"419994","owner_display_name":"","owner_user_id":"2053184","post_type_id":"1","score":"0","tags":"xml|r|ggplot2|choropleth","view_count":"340"} +{"id":"20203080","title":"floating point value not working if the value is not manually assigned","body":"\u003cp\u003eI need to check if the percentage change is \u003e 0, ==0, \u0026lt; 0, and NULL.\nSo I got get_count() that returns result of SELECT statement...:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eget_count () {\n sqlplus -s un/pass \u0026lt;\u0026lt;!\n set heading off\n set feedback off\n set pages 0\n select trunc(PRNCT_CHANGE, 3) \n FROM SEMANTIC.COUNT_STATISTICS;\n exit;\n!\n}\n\ncount=$(get_count $1) #possible values: -0.789, -10.999, 11.897, 20, 1, 0...\n\nif [ -z \"$count\" ]; then\n echo \"The count percentage change returns null value\"\nelif [[ \"$count\" -gt 0 ]]; then\n echo \"The count percentage change ($count) is greater than zero\"\nelif [[ \"$count\" == 0 ]]; then\n echo \"The count percentage change stays unchanged (is zero)\"\nelif [[ \"$count\" =~ ^[\\-0-9] ]]; then\n echo \"The count percentage change is $count\" \nelse\n echo \"$count ... Something else is wrong here\"\nfi\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf I manually assign value for \u003ccode\u003e$count\u003c/code\u003e ie:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecount=-0.987\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is working great.\u003c/p\u003e\n\n\u003cp\u003eotherwise if I let get_count() method return the value, it is always jumping to \u003ccode\u003eelse\u003c/code\u003e statement...\u003c/p\u003e\n\n\u003cp\u003eShould I convert the value that gets passed to \u003ccode\u003e$count\u003c/code\u003e variable somehow..?\u003c/p\u003e","accepted_answer_id":"20203418","answer_count":"1","comment_count":"5","creation_date":"2013-11-25 20:53:26.01 UTC","last_activity_date":"2013-11-25 21:12:03.947 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2084209","post_type_id":"1","score":"0","tags":"shell|if-statement|floating-point","view_count":"33"} +{"id":"18363037","title":"C - SizeOf Pointers","body":"\u003cpre\u003e\u003ccode\u003echar c[] = {'a','b','c'};\nint* p = \u0026amp;c[0];\nprintf(\"%i\\n\", sizeof(*p)); //Prints out 4\nprintf(\"%i\\n\", sizeof(*c)); //Prints out 1\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am extremely confused about this section of code. Both p and c represent the address of the array c at the 0th index. But why does sizeof(*p) print out 4? Shouldn't it be 1?\u003c/p\u003e","accepted_answer_id":"18363084","answer_count":"4","comment_count":"0","creation_date":"2013-08-21 16:35:27.803 UTC","last_activity_date":"2014-02-03 23:42:17.153 UTC","last_edit_date":"2014-02-03 23:42:17.153 UTC","last_editor_display_name":"","last_editor_user_id":"9530","owner_display_name":"","owner_user_id":"2697172","post_type_id":"1","score":"0","tags":"c|arrays|pointers|character|sizeof","view_count":"1914"} +{"id":"36952804","title":"MySQL - Selecting rows where fields not equal","body":"\u003cp\u003eI have a little problem with an SQL query: I have 'TableA' with a field 'TableA.b' that contains an ID for 'TableB'. I want to select all rows from 'TableB' that don't have an ID that equals any field 'TableA.b'. With other words, I need every row from TableB that's not referred to by any row from TableA in field .\nI tried a Query like this :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT DISTINCT TableB.* FROM TableA, TableB Where TableA.b != TableB.ID\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut the result contains a row that is also returned by the negation, i.e. where both fields have the same value. \nAny ideas? \u003c/p\u003e","answer_count":"5","comment_count":"1","creation_date":"2016-04-30 08:50:18.657 UTC","last_activity_date":"2016-04-30 09:14:55.603 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1563232","post_type_id":"1","score":"0","tags":"mysql|select","view_count":"134"} +{"id":"31574488","title":"How to allow users select a different Initial View Controller","body":"\u003cp\u003eI have an app that when the user launches the app for the first time, it will show an array of buttons. Once the user selects a button, it will push to a new view controller. \u003c/p\u003e\n\n\u003cp\u003eHow can I make the app remember to go straight to the selected viewcontroller the next time the user launches the app? \u003c/p\u003e","accepted_answer_id":"31575241","answer_count":"2","comment_count":"5","creation_date":"2015-07-22 21:41:24.433 UTC","last_activity_date":"2015-07-22 23:07:28.573 UTC","last_edit_date":"2015-07-22 22:42:43.677 UTC","last_editor_display_name":"","last_editor_user_id":"1836115","owner_display_name":"","owner_user_id":"4015879","post_type_id":"1","score":"0","tags":"ios|objective-c|uistoryboard","view_count":"28"} +{"id":"41381661","title":"Laravel5.1 can you passed an incremental variable in to a sub-view","body":"\u003cp\u003eI am trying to pass an incremental variable to a blade template subview to add a number to a class name. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@for($x=1; $x \u0026lt; 4; $x++)\n \u0026lt;div class=\"col-md-3\"\u0026gt;\n {!! Form::label('amenIcon'.$x,'Amenity Icon '.$x) !!}\n {!! Form::select('amenIcon'.$x,\n [null =\u0026gt;'Choose Icon'] + $iconDirectory)\n !!}\n \u0026lt;/div\u0026gt;\n @include('portal._iconModals')\n@endfor\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe sub-view portal._iconModals\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"modal-content\"\u0026gt;\n \u0026lt;div class=\"modal-header\"\u0026gt;\n \u0026lt;button type=\"button\" class=\"close\" data-dismiss=\"modal\"\u0026gt;\u0026amp;times;\u0026lt;/button\u0026gt;\n \u0026lt;h4 class=\"modal-title\"\u0026gt;Choose Icons\u0026lt;/h4\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"modal-body\"\u0026gt;\n \u0026lt;div class=\"row\"\u0026gt;\n \u0026lt;div class=\"col-md-12\" id=\"bsnImage\"\u0026gt;\n @foreach($brandSocialIcons as $bIcons)\n \u0026lt;a href=\"javascript:void(0);\" class=\"iconChoice{{$x}}\"\u0026gt;\u0026lt;img src=\"../../../../storage/icons/{{$bIcons}}\"\u0026gt;\u0026lt;/a\u0026gt;\n @endforeach\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"modal-footer\"\u0026gt;\n \u0026lt;button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\"\u0026gt;Close\u0026lt;/button\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003c/p\u003e\n\n\u003cp\u003eI would like to increment the class name iconChoice because the I have 3 select fields with options that use the same subview but because of the class name when I choose one of the images with the class of iconChoice it chooses it for all 3 select list instead.\u003c/p\u003e\n\n\u003cp\u003eHere is the js code\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$( \"#amenIcon1\" ).click(function() {\n\n $('.iconChoice').click(function() {\n var $thumb = $(this);\n console.log($thumb);\n\n var icon1 = $thumb.find('img').attr('src');\n displayIcon1(icon1)\n });\n function displayIcon1(icon1) {\n $(\"#icon1Thumb\").attr(\"src\",icon1);\n }\n });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMight not be the best explanation but I will to elaborate more if need be. Thanks\u003c/p\u003e","accepted_answer_id":"41427799","answer_count":"1","comment_count":"0","creation_date":"2016-12-29 14:29:36.633 UTC","last_activity_date":"2017-01-02 13:29:33.087 UTC","last_edit_date":"2017-01-02 13:26:44.487 UTC","last_editor_display_name":"","last_editor_user_id":"1033654","owner_display_name":"","owner_user_id":"6574397","post_type_id":"1","score":"0","tags":"laravel-5.1|laravel-blade","view_count":"15"} +{"id":"15612279","title":"Print first N words of a file","body":"\u003cp\u003eIs there any way to print the first N words of a file? I've tried cut but it reads a document line-by-line. The only solution I came up with is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esed ':a;N;$!ba;s/\\n/δ/g' file | cut -d \" \" -f -20 | sed 's/δ/\\n/g'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eEssentially, replacing newlines with a character that doesn't not exist in the file, applying \"cut\" with space as delimiter and then restoring the newlines.\u003c/p\u003e\n\n\u003cp\u003eIs there any better solution?\u003c/p\u003e","answer_count":"5","comment_count":"1","creation_date":"2013-03-25 10:08:24.8 UTC","favorite_count":"1","last_activity_date":"2013-03-25 16:26:38.507 UTC","last_edit_date":"2013-03-25 13:57:11.407 UTC","last_editor_display_name":"","last_editor_user_id":"1066031","owner_display_name":"","owner_user_id":"1651270","post_type_id":"1","score":"6","tags":"linux|unix|scripting|awk","view_count":"3018"} +{"id":"34736987","title":"if else statement does't work correctly","body":"\u003cpre\u003e\u003ccode\u003egrade=['A good','B ok','C bad']\nfor item in grade:\n if item[0] == 'A':\n print('Excellent')\n if item[0] == 'B':\n print('Nice')\n else:\n print('Work harder')\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want A to just print 'Excellent' while B just print 'Nice', and c (else) print 'Work harder'. But both A and B print 'Work Harder', and C (else) doesn't print anything. What would be a way to fix this?\u003c/p\u003e\n\n\u003cp\u003eresult \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eExcellent\nWork harder\nNice\nWork harder\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"34737062","answer_count":"3","comment_count":"1","creation_date":"2016-01-12 06:32:48.593 UTC","last_activity_date":"2016-01-12 06:38:52.273 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5777189","post_type_id":"1","score":"1","tags":"python","view_count":"53"} +{"id":"24370199","title":"python to add string after specific word","body":"\u003cp\u003eIf I have this string :\n\"there are \\many things we should change in our life of of these things is how you waste your time\"\u003c/p\u003e\n\n\u003cp\u003ehow could I search for \"\\many things\" and add after it a string I want \u003c/p\u003e\n\n\u003cp\u003ehow could I do it in python ??\u003c/p\u003e","accepted_answer_id":"24370371","answer_count":"1","comment_count":"7","creation_date":"2014-06-23 15:53:12.377 UTC","last_activity_date":"2014-06-23 16:01:57.937 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3765338","post_type_id":"1","score":"-1","tags":"python|search","view_count":"1268"} +{"id":"20196084","title":"Windows Forms Aplication File Load Exception","body":"\u003cp\u003eMy code:\u003c/p\u003e\n\n\u003cp\u003eListener.cs:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enamespace ListenerNameSpace\n{\n\n class Listener\n {\n Device [] gamepad;\n\n public Listener() { }\n\n public void initializeGamePad()\n {\n int i = 0;\n gamepad = new Device[10];//max 10 gamepads possible due to limited USB ports\n\n foreach (DeviceInstance di in Manager.GetDevices(DeviceClass.GameControl, EnumDevicesFlags.AttachedOnly))\n {\n gamepad[i++] = new Device(di.InstanceGuid);//save all gamepads conected\n }\n\n if (i == 0)//no gamepads detected\n MessageBox.Show(\"No gamepad detected, please connect gamepad!\");\n else\n {\n //do something is a gamepad is detected\n }\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eProgram.cs:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eusing ListenerNameSpace;\n\nnamespace Windows_8_gamepad_UI\n{\n static class Program\n { \n [STAThread]\n static void Main()\n {\n Application.EnableVisualStyles();\n Application.SetCompatibleTextRenderingDefault(false);\n Application.Run(new Form1());\n new Listener().initializeGamePad();//I get the exception here\n } \n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eException details:\u003c/p\u003e\n\n\u003cp\u003eMixed mode assembly is built against version 'v1.1.4322' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.\u003c/p\u003e\n\n\u003cp\u003eSo how can I get this code to work?\u003c/p\u003e","accepted_answer_id":"20196966","answer_count":"1","comment_count":"0","creation_date":"2013-11-25 14:53:44.87 UTC","last_activity_date":"2013-11-25 15:35:29.88 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2390894","post_type_id":"1","score":"1","tags":"c#|winforms","view_count":"148"} +{"id":"10769194","title":"What ORMs Support SQL Server 2012","body":"\u003cp\u003eGetting ready to start work on my next project and decided to use SQL Server 2012. The reason I am using sql 2012 is because it now supports sequences which is what I really need. In my research I found that \u003ca href=\"http://www.llblgen.com/defaultgeneric.aspx\" rel=\"nofollow\"\u003ellblgen\u003c/a\u003e supports sql server 2012. Is there anymore out there that support it?\u003c/p\u003e","answer_count":"1","comment_count":"4","creation_date":"2012-05-26 19:36:30.78 UTC","last_activity_date":"2012-12-05 01:52:03.217 UTC","last_edit_date":"2012-05-26 19:41:42.493 UTC","last_editor_display_name":"","last_editor_user_id":"184773","owner_display_name":"","owner_user_id":"184773","post_type_id":"1","score":"2","tags":"c#|orm|sql-server-2012","view_count":"360"} +{"id":"25468452","title":"Encoding 32bit hex numbers using OneHotEncoding in sklearn","body":"\u003cp\u003eI have some categorical features hashed into 32bit hex numbers, for example, in one category ,the three different classes are hashed into:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e'05db9164' '68fd1e64' '8cf07265'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003ca href=\"http://en.wikipedia.org/wiki/One-hot\" rel=\"nofollow\"\u003eOne Hot Encoding\u003c/a\u003e map these into a binary array, and only one bit is 1, the other is 0. So if I want to encoding the above features. Only need three bits. \u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003e001 correspond to 05db9164, 010 correspond to 68fd1e64, 100 correspond to 8cf07265\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eBut when I use OneHotEncoder in sklearn, which tell me that the number is too large. this confused me. because we don't care the numerical property of the number. we only care about they are the same or not. \u003c/p\u003e\n\n\u003cp\u003eOn the other hand, if i encoding 0,1,2:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eenc = OneHotEncoder()\nenc.fit([[0],[1],[2]])\n\nprint enc.transform([[0]]).toarray()\nprint enc.transform([[1]]).toarray()\nprint enc.transform([[2]]).toarray()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have got the expected answer. And I think these 32bit hex number is used to indicate the class in the category. so it it the same as 0 , 1 ,2. and [0,0,1], [0,1,0],[1,0,0] is enough to encoding it. Could you please help me .thanks very much.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-08-24 04:08:17.92 UTC","last_activity_date":"2014-08-25 20:01:21.153 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1904666","post_type_id":"1","score":"1","tags":"python|machine-learning|scikit-learn|data-mining|one-hot","view_count":"152"} +{"id":"15826182","title":"QML text rendering issue with custom OpenGL item active","body":"\u003cp\u003eI've been working with the \u003cem\u003eQmlOgre\u003c/em\u003e Qt example to make it work with Qt5 final. The original example itself looks fine now and behaves as intended. My code is here: \u003ca href=\"https://github.com/advancingu/QmlOgre\" rel=\"nofollow\"\u003ehttps://github.com/advancingu/QmlOgre\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eHowever I found that there is an issue when a QML text item is modified either through \u003cem\u003echanged\u003c/em\u003e signals emitted from C++ or from a simple timer in the sample QML scene. For example, I added a 10ms QML timer that simply increments a counter and assigns it to a text item. The corresponding code is here: \u003ca href=\"https://github.com/advancingu/QmlOgre/tree/issue\" rel=\"nofollow\"\u003ehttps://github.com/advancingu/QmlOgre/tree/issue\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eWhat happens now is that on each frame, most characters (except one or two) of the text item randomly disappear. Which of them disappear changes with each frame, so there is a lot of flickering. The characters that do show are the correct ones and at the correct location.\u003c/p\u003e\n\n\u003cp\u003eMy observation has been that this issue only appears on some application executions, so it very much looks like a threading issue (QmlEngine runs one thread dealing with QML object bindings, QML painting has its own thread in which Ogre lives / must live).\u003c/p\u003e\n\n\u003cp\u003eAnyone have ideas on why exactly this is happening or how this can be resolved?\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eOgre version: 1.8.1\u003c/li\u003e\n\u003cli\u003eQt version: 5.0.1 (5.1-dev from today has same issue)\u003c/li\u003e\n\u003cli\u003eOS/Distro: Ubuntu 12.04 64bit\u003c/li\u003e\n\u003cli\u003eGraphics driver: tried with Mesa 9.0 and FGLRX (both show it)\u003c/li\u003e\n\u003c/ul\u003e","answer_count":"2","comment_count":"0","creation_date":"2013-04-05 04:56:36.527 UTC","last_activity_date":"2017-04-05 12:41:14.917 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2247553","post_type_id":"1","score":"1","tags":"qml|qt5|ogre","view_count":"544"} +{"id":"47119018","title":"TextView.setText on null object reference","body":"\u003cp\u003eI've created a custom navigation drawer but when I try to set \u003ccode\u003eTextView\u003c/code\u003e value in \u003ccode\u003eMainActivity.class\u003c/code\u003e, android gives me a run time exception. I think it's because I'm trying to access a \u003ccode\u003eTextView\u003c/code\u003e that isn't directly placed in \u003ccode\u003eactivity_main.xml\u003c/code\u003e. The code is working fine when I place a \u003ccode\u003eTextView\u003c/code\u003e directly into activity_main. \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eI'm trying to access \u003cstrong\u003eheader_profile_name\u003c/strong\u003e placed in \u003ccode\u003enav_header\u003c/code\u003e from \u003ccode\u003eMainActivity.class\u003c/code\u003e\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eHere is the code:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eMainActivity.class\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cpre\u003e\u003ccode\u003e textView1=(TextView) findViewById(R.id.header_profile_name);\n textView2=(TextView) findViewById(R.id.header_profile_id);\n iv=(CircleImageView) findViewById(R.id.profile_pic);\n if(facebook_login.isLoggedIn()) {\n profile=Profile.getCurrentProfile();\n textView1.setText(profile.getName());\n textView2.setText(profile.getId());\n Picasso.with(MainActivity.this).load(\"http://graph.facebook.com/\" + profile.getId() + \"/picture?\").into(iv);\n }\n else\n {\n textView1.setText(\"Null\");\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eactivity_main.xml\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" encoding=\"utf-8\"?\u0026gt;\n\u0026lt;android.support.v4.widget.DrawerLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\nxmlns:app=\"http://schemas.android.com/apk/res-auto\"\nxmlns:tools=\"http://schemas.android.com/tools\"\nandroid:layout_width=\"match_parent\"\nandroid:layout_height=\"match_parent\"\nandroid:id=\"@+id/drawer_layout\"\ntools:context=\"com.pibuka.www.learnc.MainActivity\"\n\u0026gt;\n\u0026lt;RelativeLayout\n android:layout_height=\"match_parent\"\n android:layout_width=\"match_parent\"\n android:orientation=\"vertical\"\n android:background=\"@color/primaryLightColor\"\u0026gt;\n \u0026lt;android.support.v7.widget.Toolbar\n android:id=\"@+id/toolbar_action\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"?android:attr/actionBarSize\"\n android:background=\"@color/primaryColor\"\u0026gt;\n \u0026lt;TextView\n android:id=\"@+id/_nav_bar_text_view\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\"\n android:padding=\"5dp\"\n android:text=\"XD Downloader\"\n android:textAlignment=\"center\"\n android:textColor=\"@color/primaryTextColor\"\n android:layout_marginEnd=\"50dp\"\n android:textSize=\"24sp\" /\u0026gt;\n \u0026lt;/android.support.v7.widget.Toolbar\u0026gt;\n \u0026lt;FrameLayout\n android:id=\"@+id/frame_to_replace\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"match_parent\"\n android:layout_alignParentBottom=\"true\"\n android:layout_alignParentStart=\"true\"\u0026gt;\n \u0026lt;/FrameLayout\u0026gt;\n\u0026lt;/RelativeLayout\u0026gt;\n\u0026lt;android.support.design.widget.NavigationView\n android:background=\"@color/primaryLightColor\"\n android:layout_height=\"match_parent\"\n android:layout_width=\"wrap_content\"\n android:id=\"@+id/nav_view\"\n android:layout_gravity=\"start\"\n app:headerLayout=\"@layout/nav_header\"\n app:menu=\"@menu/navigation_menu\"\n \u0026gt;\n\u0026lt;/android.support.design.widget.NavigationView\u0026gt;\n\u0026lt;/android.support.v4.widget.DrawerLayout\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003enav_header.xml\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" encoding=\"utf-8\"?\u0026gt;\n\u0026lt;RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\nandroid:layout_width=\"match_parent\"\nandroid:layout_height=\"140sp\"\nxmlns:tools=\"http://schemas.android.com/tools\"\nandroid:background=\"@color/primaryColor\"\u0026gt;\n\u0026lt;LinearLayout\n android:layout_height=\"match_parent\"\n android:layout_width=\"match_parent\"\n android:orientation=\"horizontal\"\u0026gt;\n \u0026lt;de.hdodenhof.circleimageview.CircleImageView\n xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n\n android:id=\"@+id/profile_pic\"\n android:padding=\"5dp\"\n android:layout_width=\"70dp\"\n android:layout_height=\"70dp\"\n app:civ_border_width=\"1dp\"\n app:civ_border_color=\"@color/primaryTextColor\"\n android:layout_marginTop=\"17dp\"\n android:layout_marginLeft=\"10dp\"/\u0026gt;\n \u0026lt;TextView\n android:id=\"@+id/header_profile_name\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n\n android:text=\"XDD\"\n android:padding=\"10dp\"\n android:textSize=\"24sp\"\n android:textColor=\"@color/primaryTextColor\"\n android:layout_marginTop=\"25dp\"\n android:layout_marginLeft=\"15dp\"\n /\u0026gt;\n\u0026lt;/LinearLayout\u0026gt;\n\u0026lt;TextView\n android:id=\"@+id/header_profile_id\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_alignParentBottom=\"true\"\n android:layout_alignParentStart=\"true\"\n android:padding=\"15dp\"\n android:text=\"XD Downloader\"\n android:textColor=\"@color/primaryTextColor\"\n android:layout_marginLeft=\"20dp\"\n android:textSize=\"18sp\"/\u0026gt;\n \u0026lt;/RelativeLayout\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003enavigation_menu.xml\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" encoding=\"utf-8\"?\u0026gt;\n\u0026lt;menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\u0026gt;\n\u0026lt;group android:checkableBehavior=\"single\"\u0026gt;\n \u0026lt;item\n android:id=\"@+id/main_home\"\n android:title=\"Home\" /\u0026gt;\n\u0026lt;/group\u0026gt;\n\u0026lt;item android:title=\"Media Source\"\u0026gt;\n\n \u0026lt;menu\u0026gt;\n \u0026lt;group android:checkableBehavior=\"single\"\u0026gt;\n \u0026lt;item\n android:id=\"@+id/youtube\"\n android:title=\"Youtube\" /\u0026gt;\n \u0026lt;item\n android:id=\"@+id/facebook\"\n android:title=\"Facebook\" /\u0026gt;\n \u0026lt;item\n android:id=\"@+id/vimeo\"\n android:title=\"Vimeo\" /\u0026gt;\n \u0026lt;item\n android:id=\"@+id/soundcloud\"\n android:title=\"Sound Cloud\" /\u0026gt;\n \u0026lt;item\n android:id=\"@+id/twitter\"\n android:title=\"Twitter\" /\u0026gt;\n \u0026lt;/group\u0026gt;\n \u0026lt;/menu\u0026gt;\n\u0026lt;/item\u0026gt;\n\u0026lt;item android:title=\"Downloaders\"\u0026gt;\n \u0026lt;menu\u0026gt;\n \u0026lt;group android:checkableBehavior=\"single\"\u0026gt;\n \u0026lt;item\n android:id=\"@+id/ovc\"\n android:title=\"Online Video Converter\" /\u0026gt;\n \u0026lt;item\n android:id=\"@+id/keepvid\"\n android:title=\"KEEPVID\" /\u0026gt;\n\n \u0026lt;item\n android:id=\"@+id/nxbuddy\"\n android:title=\"9xbuddy\" /\u0026gt;\n \u0026lt;/group\u0026gt;\n \u0026lt;/menu\u0026gt;\n\u0026lt;/item\u0026gt;\n\u0026lt;item android:title=\"About\"\u0026gt;\n \u0026lt;menu\u0026gt;\n \u0026lt;group android:checkableBehavior=\"single\"\u0026gt;\n \u0026lt;item\n android:id=\"@+id/dev_blog\"\n android:title=\"Developer's Blog\" /\u0026gt;\n \u0026lt;/group\u0026gt;\n \u0026lt;/menu\u0026gt;\n\u0026lt;/item\u0026gt;\n\u0026lt;/menu\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"3","creation_date":"2017-11-05 06:55:28.273 UTC","favorite_count":"1","last_activity_date":"2017-11-05 06:55:28.273 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5800773","post_type_id":"1","score":"-1","tags":"java|android|xml|navigation-drawer","view_count":"28"} +{"id":"46728647","title":"How to implement the template method design pattern in Kotlin?","body":"\u003cp\u003eConsider the problem:\u003c/p\u003e\n\n\u003cp\u003eWe have a \u003ccode\u003eBase\u003c/code\u003e class with an abstract method. Now, we would like to enforce that every override of this method will perform some argument checking or some other drudgery. We want this argument checking to be identical across all overrides. One solution would be to wrap this behavior in a non-abstract method which calls an abstract one:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eabstract class Base\n{\n fun computeSomething(argument: Int): Int\n {\n require(argument \u0026gt; 0) // Some intricate checking\n return execute(argument)\n }\n\n // Pure functionality, assuming correct arguments\n // Ideally, this would be private. \n protected abstract fun execute(validArgument: Int): Int\n}\n\nclass Derived1: Base()\n{\n override fun execute(validArgument: Int): Int =\n validArgument * validArgument\n}\n\nclass Derived2: Base()\n{\n override fun execute(validArgument: Int): Int =\n validArgument * validArgument * validArgument\n}\n\n\nfun main(args: Array\u0026lt;String\u0026gt;)\n{\n val d = Derived1()\n println(d.computeSomething(23))\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI would like to have \u003ccode\u003eBase::execute\u003c/code\u003e private, such that no subclass of \u003ccode\u003eBase\u003c/code\u003e can call it by accident without checking its arguments. Unfortunately, this is not possible:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eError:(9, 5) Kotlin: Modifier 'private' is incompatible with\n 'abstract'\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eKotlin's \u003ccode\u003eprotected\u003c/code\u003e is better than Java's \u003ccode\u003eprotected\u003c/code\u003e, since it makes the function accessible only to subclasses but still, the ideal case would be \u003ccode\u003eprivate\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eSo is there some right way to implement this pattern? Also, just out of curiosity, is the incompatibility of \u003ccode\u003eprivate\u003c/code\u003e and \u003ccode\u003eabstract\u003c/code\u003e a deliberate choice of language design?\u003c/p\u003e","accepted_answer_id":"46729963","answer_count":"2","comment_count":"3","creation_date":"2017-10-13 11:15:31.917 UTC","last_activity_date":"2017-10-13 13:51:50.397 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1097451","post_type_id":"1","score":"4","tags":"java|design-patterns|kotlin","view_count":"67"} +{"id":"9939802","title":"Display checkbox after select combo box","body":"\u003cp\u003eI need some idea here.. i wanted to make search function using combo box. after user has selected certain value from the combo box...based on selected value checkbox will appears...\u003c/p\u003e\n\n\u003cp\u003eexample ... \u003c/p\u003e\n\n\u003cp\u003e[combo box] -\u003e select 1.user\n 2.item\n 3.tag\u003c/p\u003e\n\n\u003cp\u003ewhen user select \"user\"\u003c/p\u003e\n\n\u003cp\u003echeckbox as follow will appears\u003c/p\u003e\n\n\u003cp\u003echeckbox- update user checkbox-delete user \u003c/p\u003e\n\n\u003cp\u003eand so forth... this to filter more.. and make user easy to find/view what they want from their search... \u003c/p\u003e\n\n\u003cp\u003eif you have other idea..instead of using combo box and check box.. please let me know.. \u003c/p\u003e\n\n\u003cp\u003ethankssssssss :) \u003c/p\u003e","accepted_answer_id":"9950750","answer_count":"2","comment_count":"8","creation_date":"2012-03-30 08:53:56.623 UTC","last_activity_date":"2012-04-02 21:45:53.387 UTC","last_edit_date":"2012-03-30 08:56:27.607 UTC","last_editor_display_name":"","last_editor_user_id":"624884","owner_display_name":"","owner_user_id":"1251804","post_type_id":"1","score":"-3","tags":"php|javascript|jquery|html","view_count":"1737"} +{"id":"4635493","title":"Resources for learning Spring.NET","body":"\u003cp\u003eAre there any good online resources (including commercial) or books for learning Spring.NET? The only resources I found are examples and documentation on \u003ca href=\"http://www.springframework.net/examples.html\" rel=\"nofollow\"\u003eSpring.NET web\u003c/a\u003e. Is it enough?\u003c/p\u003e","accepted_answer_id":"5297119","answer_count":"2","comment_count":"0","creation_date":"2011-01-08 18:38:40.77 UTC","last_activity_date":"2011-03-14 10:02:11.527 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"413501","post_type_id":"1","score":"2","tags":".net|spring.net","view_count":"919"} +{"id":"10313382","title":"How to get elements(findViewById) for a layout which is dynamically loaded(setView) in a dialog?","body":"\u003cp\u003eI need to get the EditText that's defined in an xml layout which is dynamically loaded as a view in a preference dialog i.e. :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class ReportBugPreference extends EditTextPreference {\n\n @Override\n protected void onPrepareDialogBuilder(AlertDialog.Builder builder) {\n super.onPrepareDialogBuilder(builder); \n builder.setView(LayoutInflater.from(ctx).inflate(R.layout.preference_report_bug_layout,null));\n EditText edttxtBugDesc = (EditText) findViewById(R.id.bug_description_edittext); // NOT WORKING\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT : SOLUTION\u003c/strong\u003e by jjnFord\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@Override\nprotected void onPrepareDialogBuilder(AlertDialog.Builder builder) {\n super.onPrepareDialogBuilder(builder); \n\n View viewBugReport = LayoutInflater.from(ctx).inflate(R.layout.preference_report_bug,null);\n EditText edttxtBugDesc = (EditText) viewBugReport.findViewById(R.id.bug_description_edittext);\n\n builder.setView(viewBugReport);\n\n\n\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"10313520","answer_count":"2","comment_count":"0","creation_date":"2012-04-25 10:01:01.607 UTC","favorite_count":"1","last_activity_date":"2017-08-09 14:35:05.727 UTC","last_edit_date":"2012-04-25 10:13:05.14 UTC","last_editor_display_name":"","last_editor_user_id":"1263452","owner_display_name":"","owner_user_id":"1263452","post_type_id":"1","score":"12","tags":"android|android-layout|android-edittext|preferenceactivity","view_count":"24099"} +{"id":"2763184","title":"Trouble with a sequential search algorithm","body":"\u003cp\u003eAlso why does this give me an error because I used bool?\u003c/p\u003e\n\n\u003cp\u003eI need to use this sequential search algorithm, but I am not really sure how. I need to use it with an array. Can someone point me in the correct direction or something on how to use this.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ebool seqSearch (int list[], int last, int target, int* locn){\n int looker;\n\n looker = 0;\n while(looker \u0026lt; last \u0026amp;\u0026amp; target != list[looker]){\n looker++;\n }\n\n *locn = looker;\n return(target == list[looker]);\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"2763248","answer_count":"4","comment_count":"1","creation_date":"2010-05-04 06:16:44.123 UTC","last_activity_date":"2010-05-04 06:45:11.05 UTC","last_edit_date":"2010-05-04 06:41:24.563 UTC","last_editor_display_name":"","last_editor_user_id":"271534","owner_display_name":"","owner_user_id":"271534","post_type_id":"1","score":"2","tags":"c|sequential","view_count":"444"} +{"id":"4704304","title":"Old Source Code into New Repository","body":"\u003cp\u003eQuick question:\u003c/p\u003e\n\n\u003cp\u003eI've run into a little issue, where I just need some insight into what I should do with some code I have.\u003c/p\u003e\n\n\u003cp\u003eI have one repository, in two locations. The \"older\" code is located in \u003ccode\u003e/originalcode\u003c/code\u003e and the new \u003cstrong\u003echecked-out\u003c/strong\u003e code is in \u003ccode\u003e/just-checked-out\u003c/code\u003e. \u003c/p\u003e\n\n\u003cp\u003eHere's the problem:\u003c/p\u003e\n\n\u003cp\u003eOver the past few months, I've been updating code in \u003ccode\u003e/originalcode\u003c/code\u003e and there have been several new updated to the code (I kinda got lazy with my repository and never commited new changes).\u003c/p\u003e\n\n\u003cp\u003eI'm wanting to merge all my changes into the code repository using the new protocol (I changed from git+ssh to smart http). \u003c/p\u003e\n\n\u003cp\u003eIs this as easy as changing the \"remote\" url in the git config file. I just want to make sure that I'm following proper guidelines and don't overlook something.\u003c/p\u003e","accepted_answer_id":"4704470","answer_count":"2","comment_count":"0","creation_date":"2011-01-16 07:31:25.083 UTC","last_activity_date":"2015-07-19 19:37:44.237 UTC","last_edit_date":"2015-07-19 19:37:44.237 UTC","last_editor_display_name":"","last_editor_user_id":"64046","owner_display_name":"","owner_user_id":"259717","post_type_id":"1","score":"4","tags":"git|revision","view_count":"195"} +{"id":"29223639","title":"jquery map return json object from mutiple sources","body":"\u003cpre\u003e\u003ccode\u003evar idk = $('#menu li').map(function (i, n) {\n\n var placeholder = $(n).attr('id')\n var content = $(n).find('.li2').attr('id');\n\n return //..\n\n}).get().join(',');\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e}\u003c/p\u003e\n\n\u003cp\u003eI want to get something like this\n{'a':1,'b':2,'c',3} where abc is come from placeholder, 123 is the content. What should I return using \u003ccode\u003emap()\u003c/code\u003e?\u003c/p\u003e","accepted_answer_id":"29223726","answer_count":"2","comment_count":"0","creation_date":"2015-03-24 01:48:57.107 UTC","last_activity_date":"2015-03-24 02:02:17.16 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4553423","post_type_id":"1","score":"0","tags":"javascript|jquery|json","view_count":"32"} +{"id":"20685714","title":"How to handle status codes with .NET web API?","body":"\u003cp\u003eI'm new to the .NET web api. But I can't figure out what the best practice should be when returning status codes. I've followed the tutorial on \u003ca href=\"http://www.asp.net/web-api/overview/creating-web-apis/creating-a-web-api-that-supports-crud-operations\" rel=\"nofollow\"\u003ecreating a web api that supports crud operations\u003c/a\u003e to get a good idea on how it all works.\u003c/p\u003e\n\n\u003cp\u003eI have a spec where the response to every request returns a status code along with other data, I can change the spec if need be but I can't work out if it's good to return a status code and also return all the data requested or to just return the data on it's own. \u003c/p\u003e\n\n\u003cp\u003eFor example if I made a request to \u003ccode\u003eGetAllCarManufacturers\u003c/code\u003e without being authenticated I'd return a custom \u003ccode\u003estatusCode\u003c/code\u003e of \u003ccode\u003e1\u003c/code\u003e (Indicating not authenticated), and \u003ccode\u003emessage\u003c/code\u003e \u003ccode\u003e\"User is not authenticated.\"\u003c/code\u003e. But if I was authenticated I'd like to send back a \u003ccode\u003estatusCode\u003c/code\u003e of \u003ccode\u003e0\u003c/code\u003e (indicating success) and all the car manufacturers. This seems to go against the way the tutorial is organised as only the car manufacturers are sent back without any additional data. Which leads me to believe passing around a statusCode isn't the correct thing to do.\u003c/p\u003e\n\n\u003cp\u003eI've seen in the example crud demo that HttpResponseExceptions are thrown which sets the HttpStatusCode to a certain value (see code below). Should I be using that instead of returning my own status code? But then my concern is it doesn't have enough different status codes that will match my custom scenarios.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e// Setting the HTTPStatusCode example.\nthrow new HttpResponseException(HttpStatusCode.NotFound);\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"20685925","answer_count":"1","comment_count":"1","creation_date":"2013-12-19 15:38:11.057 UTC","last_activity_date":"2013-12-19 15:48:21.073 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"837649","post_type_id":"1","score":"0","tags":"asp.net-web-api","view_count":"365"} +{"id":"32980624","title":"Too much screen updates over remote desktop connection","body":"\u003cp\u003eI ran into a very weird problem. I have a VB.NET program which calls another program which runs in the background. We're using a special software here to deliver this software over web. What this software basically does is, that i creates a new remote desktop connection, grabs the screen and opens up a web server.\u003c/p\u003e\n\n\u003cp\u003eWhile running the sub programm / sub process the screen does not react smooth anymore, it gets very low and then freezes. We figured out, that we're triggering too many screen updates at once so that we simply flood our connection which causes the crash in the browser.\u003c/p\u003e\n\n\u003cp\u003eIs there any simple way to determine how many screen updates were sent and which causes these updates? Best would be that we can identify the process so that we can investigate further.\u003c/p\u003e\n\n\u003cp\u003eThe whole process is ran as a \u003ccode\u003ebackgroundWorker\u003c/code\u003e which then creates another process.\u003c/p\u003e\n\n\u003cp\u003eEdit:\u003c/p\u003e\n\n\u003cp\u003eCould it have something to do with the CPU load (which is very high)? Although the subprocess is executed in the background - and is visible in the process list - is there any chance that this causes the UI Update?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-10-06 22:07:44.437 UTC","last_activity_date":"2015-10-08 00:00:07.65 UTC","last_edit_date":"2015-10-07 16:52:11.097 UTC","last_editor_display_name":"","last_editor_user_id":"636676","owner_display_name":"","owner_user_id":"636676","post_type_id":"1","score":"0","tags":"vb.net|user-interface|remote-desktop","view_count":"32"} +{"id":"44167526","title":"Count the Number of Unique Character Types based on Date in R","body":"\u003cp\u003eI have a dataframe titled \u003ccode\u003eFilteredData\u003c/code\u003e with \u003cem\u003emany\u003c/em\u003e columns. Specifically, there are two columns I am interested in: \u003ccode\u003eDate\u003c/code\u003e and \u003ccode\u003eSale number.\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eI want to group all \u003ccode\u003eSale number\u003c/code\u003e entries by dates. \u003ccode\u003eDate\u003c/code\u003e is a date-type field, and \u003ccode\u003eSale number\u003c/code\u003e is a character-type field. If I'm not mistaken, I think these types are the reason why other Q\u0026amp;As on S.O. haven't been much help to me. \u003c/p\u003e\n\n\u003cp\u003eHow can I do this?\u003c/p\u003e\n\n\u003cp\u003eI've tried the following:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eaggregate(FilteredData$`Sale number`, by FilteredData$Date, FUN = count)\ngroup_by(FilteredData$`Sale number`, FilteredData$Date)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNeither worked, and neither did the solution found \u003ca href=\"https://stackoverflow.com/q/1660124/3856609\"\u003ehere\u003c/a\u003e when I tried it. \u003c/p\u003e\n\n\u003cp\u003eI tried the following:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elibrary(sqldf)\nFreq = sqldf('SELECT Date, COUNT('Sale Number') FROM FilteredData GROUP BY Date')\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand it surprisingly worked. However, is there a way to obtain this result without having to use SQL syntax, i.e. something \"purely\" in R?\u003c/p\u003e","answer_count":"2","comment_count":"6","creation_date":"2017-05-24 20:03:53.39 UTC","last_activity_date":"2017-05-24 20:13:47.313 UTC","last_edit_date":"2017-05-24 20:13:47.313 UTC","last_editor_display_name":"","last_editor_user_id":"3856609","owner_display_name":"","owner_user_id":"3856609","post_type_id":"1","score":"0","tags":"r","view_count":"38"} +{"id":"9214352","title":"Android appwidget onUpdate()","body":"\u003cp\u003eI have a question with the onUpdate function of an android appwidget: I am updating the appwidget once a day with that function. Before this I used a TimerTask class to update the widget but Android sometime closes that TimerTask and my widget stops updating. If I use the onUpdate function the oS will do the same as before or it will work good?\u003c/p\u003e\n\n\u003cp\u003ethis is the xml that provides the updates:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" encoding=\"utf-8\" ?\u0026gt;\n\u0026lt;appwidget-provider\nxmlns:android=\"http://schemas.android.com/apk/res/android\"\nandroid:minWidth=\"262dp\"\nandroid:minHeight=\"244dp\"\nandroid:updatePeriodMillis=\"86400000\"\nandroid:initialLayout=\"@layout/main\"/\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"9214785","answer_count":"2","comment_count":"0","creation_date":"2012-02-09 16:04:22.847 UTC","last_activity_date":"2012-02-09 16:30:42.467 UTC","last_edit_date":"2012-02-09 16:25:13.613 UTC","last_editor_display_name":"","last_editor_user_id":"1108213","owner_display_name":"","owner_user_id":"1145301","post_type_id":"1","score":"1","tags":"java|android|android-widget","view_count":"441"} +{"id":"44187402","title":"ASP.Net Core MVC - Correct Way to Edit Users?","body":"\u003cp\u003eWhat's the correct way to manage IdentityUsers within ASP.Net Core - using the scaffolded DbContext code or using UserManager? Right now I have the below boilerplate/scaffolded controller code, but I'm wondering if I should change to use UserManager instead, especially when updating the password. This section will be used in an Admin section of the app to manage users.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e try\n {\n _context.Update(applicationUser);\n await _context.SaveChangesAsync();\n }\n catch (DbUpdateConcurrencyException)\n {\n if (!ApplicationUserExists(applicationUser.Id))\n {\n return NotFound();\n }\n else\n {\n throw;\n }\n }\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-05-25 18:24:46.543 UTC","last_activity_date":"2017-05-25 20:23:48.83 UTC","last_edit_date":"2017-05-25 20:23:48.83 UTC","last_editor_display_name":"","last_editor_user_id":"2966445","owner_display_name":"","owner_user_id":"2966445","post_type_id":"1","score":"0","tags":"c#|asp.net|.net|asp.net-mvc|entity-framework","view_count":"68"} +{"id":"36205496","title":"Azure SDK: the product cannot be installed because a product that it depends on did not install successfully","body":"\u003cp\u003eI'm trying to install Microsoft Azure SDK for .NET (VS 2015) - 2.8.2.1 through Web Platform Installer.\u003c/p\u003e\n\n\u003cp\u003eFull error:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eThe product cannot be installed because a product that it depends on did not install successfully\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003e\u003ca href=\"http://pastebin.com/xdAvTjvr\" rel=\"nofollow\"\u003eLogs\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eHow can I fix this issue?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-03-24 16:41:44.767 UTC","last_activity_date":"2016-03-27 09:52:40.14 UTC","last_edit_date":"2016-03-24 23:46:12.317 UTC","last_editor_display_name":"","last_editor_user_id":"3203213","owner_display_name":"","owner_user_id":"1804027","post_type_id":"1","score":"0","tags":"azure|visual-studio-2015|azure-sdk-.net|web-platform-installer","view_count":"208"} +{"id":"13788363","title":"Reading values from a graph in Python","body":"\u003cp\u003eI'm currently trying to plot data from a SPICE simulation in python. I have succeed in plotting the information but now I require to extract values from specific points, say for example I would like to find the \u003ccode\u003ex\u003c/code\u003e value for a given \u003ccode\u003ey\u003c/code\u003e or vice versa.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epylab.figure(1)\npylab.title('NMOS')\npylab.semilogy(row.ngm_id[81*0:81*1],row.nidw[81*0:81*1],label='L = 0.35u')\npylab.xlabel('gm/ID [S/A]',fontsize=20)\npylab.ylabel('ID/W [A/m]',fontsize=20)\npylab.legend()\npylab.grid()\npylab.show()\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"13788536","answer_count":"1","comment_count":"0","creation_date":"2012-12-09 14:34:44.593 UTC","last_activity_date":"2015-12-01 21:25:16.223 UTC","last_edit_date":"2015-12-01 21:25:16.223 UTC","last_editor_display_name":"","last_editor_user_id":"4370109","owner_display_name":"","owner_user_id":"1889532","post_type_id":"1","score":"1","tags":"python|plot","view_count":"146"} +{"id":"44324310","title":"How to enable and disable button when click checkbox button using JQuery","body":"\u003cp\u003eI want When single checkbox is selected that time Edit and Delete Button are Enable, Add Button Disable\u003c/p\u003e\n\n\u003cp\u003eWhen Two or more checkbox are selected that time Delete Button is Enable and Add and Edit Button are Disable\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eMy Html Code :\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;div\u0026gt;\n \u0026lt;button type=\"button\" id=\"btnAddID\" name=\"btnAdd\"\u0026gt; Add \u0026lt;/button\u0026gt;\n \u0026lt;button type=\"button\" id=\"btnEditID\" name=\"btnEdit\"\u0026gt; Edit \u0026lt;/button\u0026gt;\n \u0026lt;button type=\"button\" id=\"btnDeleteID\" name=\"btnDelete\"\u0026gt; Delete \u0026lt;/button\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;br/\u0026gt;\n \u0026lt;div\u0026gt;\n \u0026lt;table\u0026gt;\n \u0026lt;thead\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;th\u0026gt;\u0026lt;/th\u0026gt;\n \u0026lt;th\u0026gt;ID\u0026lt;/th\u0026gt;\n \u0026lt;th\u0026gt;Name\u0026lt;/th\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;/thead\u0026gt;\n\n \u0026lt;tbody\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;input type=\"checkbox\" /\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;1\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;ABC\u0026lt;/td\u0026gt; \n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;input type=\"checkbox\" /\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;2\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;XYZ\u0026lt;/td\u0026gt; \n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;input type=\"checkbox\" /\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;3\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;PQR\u0026lt;/td\u0026gt; \n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;input type=\"checkbox\" /\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;4\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;MLN\u0026lt;/td\u0026gt; \n \u0026lt;/tr\u0026gt;\n \u0026lt;/tbody\u0026gt;\n \u0026lt;/table\u0026gt; \n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"44324659","answer_count":"2","comment_count":"4","creation_date":"2017-06-02 08:31:16.03 UTC","last_activity_date":"2017-06-02 08:51:27.2 UTC","last_edit_date":"2017-06-02 08:38:43.23 UTC","last_editor_display_name":"","last_editor_user_id":"283143","owner_display_name":"","owner_user_id":"7219777","post_type_id":"1","score":"-1","tags":"javascript|jquery","view_count":"72"} +{"id":"27536672","title":"A dict-like class that uses transformed keys","body":"\u003cp\u003eI'd like a dict-like class that transparently uses transformed keys on lookup, so that I can write\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ek in d # instead of f(k) in d\nd[k] # instead of d[f(k)]\nd.get(k, v) # instead of d.get(f(k), v)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eetc. (Imagine for example that \u003ccode\u003ef\u003c/code\u003e does some kind of canonicalization, e.g. \u003ccode\u003ef(k)\u003c/code\u003e returns \u003ccode\u003ek.lower()\u003c/code\u003e.)\u003c/p\u003e\n\n\u003cp\u003eIt seems that I can inherit from \u003ccode\u003edict\u003c/code\u003e and override individual operations, but not that there is a centralized spot for such transformation that all keys go through. That means I have to override all of \u003ccode\u003e__contains__\u003c/code\u003e, \u003ccode\u003e__getitem__\u003c/code\u003e, \u003ccode\u003eget\u003c/code\u003e, and possibly \u003ccode\u003e__missing__\u003c/code\u003e, etc. This gets too tedious and error-prone, and not very attractive unless this overhead outweighs that of manually substituting \u003ccode\u003ef(k)\u003c/code\u003e for every call on a plain \u003ccode\u003edict\u003c/code\u003e.\u003c/p\u003e","answer_count":"3","comment_count":"4","creation_date":"2014-12-17 23:21:57.953 UTC","last_activity_date":"2015-06-10 05:06:08.037 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"424632","post_type_id":"1","score":"4","tags":"python|dictionary","view_count":"124"} +{"id":"36782328","title":"Powershell: unexpected return value from function, use of $args to access parameters","body":"\u003cp\u003eOk, I have coded for quite a while in different, but I am not getting Powershells concept of a function return?....\u003c/p\u003e\n\n\u003cp\u003eI am very new to Powershell, so I am sure I am missing something very basic. \u003c/p\u003e\n\n\u003cp\u003eI have the function below:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction plGetKeyValue ([string] $FileName, [string] $SectionName, [string] $Key) \n{\n if ($PSBoundParameters.Count -lt 2 -or $PSBoundParameters.Count -gt 3 )\n {\n \"Invalid call to {0} in {1}\" -f $MyInvocation.MyCommand.Name, \n $MyInvocation.MyCommand.ModuleName\n return \n }\n\n # Declaration\n $lFileContents = \"\"\n $lSections = \"\"\n $lDataStart = \"\"\n $lStart = -1\n $lEnd = -1\n $lFoundSection = \"\"\n $lNextSection = \"\"\n $lResults = \"\"\n $lRetValue = \"\"\n\n # Handle the optional parameter.\n if ( $PSBoundParameters.Count -eq 2 ) {\n $PSBoundParameters.Add('Key', $SectionName)\n $PSBoundParameters.Remove('SectionName') \n $Key = $SectionName\n $SectionName = $null\n }\n\n\n # Read the file in \n $lFileContents = Get-Content $FileName | Select-String -Pattern .* \n\n # Get the sections.\n $lSections = $lFileContents -match '\\[' \n $lSections = $lSections -notmatch '#' \n\n # Start of the data.\n $lDataStart = $lFileContents | Select-String -Pattern \"^#\", \"^$\" -NotMatch `\n | select-object -First 1\n\n # We have a section.\n if ( $PSBoundParameters.ContainsKey( 'SectionName' ) ) {\n\n # Find the section.\n $lFoundSection = $lSections | Select-String -Pattern \"$lSectionName\\b\"\n\n # If none found we are out.\n if ( -Not $lFoundSection) { return $lRetValue }\n\n # Starting point for the key search is the line following \n # the found section.\n $lStart = $lFoundSection[0].LineNumber\n\n # Loop through the sections and find the one after the found one.\n $lNextSection = $lSections | ForEach-Object { \n # If we hit it, break.\n if ($_.LineNumber -gt $lStart) {\n break;\n }\n } \n\n # Set the ending line for the search to the end of the section\n # or end of file. Which ever we have.\n if ($lNextSection) {\n $lEnd = $lNextSection[0].LineNumber\n } else {\n $lEnd = $lFileContents[-1]\n }\n } else {\n # No section.\n $lStart = $lDataStart.LineNumber\n\n # Set the ending line for the search to the end of the section\n # or end of file. Which ever we have.\n if ($lSections) {\n $lEnd = $lSections[0].LineNumber\n } else {\n $lEnd = $lFileContents[-1]\n }\n }\n\n # Extract the lines starting with the key.\n $lResults = $lFileContents[$lStart..$lEnd] -match \"$Key\\b\" \n # We got results.\n\n # Split the value off.\n return $lRetValue = $lResults[0] | Select -ExpandProperty \"Line\" \n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe process of creating this function has sparked several questions that I have researched and become confused with\u003c/p\u003e\n\n\u003cp\u003e1) The documentation indicates that $args should be used to determine arguments. It never seems to populate for me? I am using version 4? As a alternative I used $PSBoundParameters. Is this advisable?\u003c/p\u003e\n\n\u003cp\u003e2) Based on a lot of reading and head scratching, I have found that return values from functions rturn all uncaptured output to the pipeline. Can someone, please clarify uncaptured? \u003c/p\u003e\n\n\u003cp\u003eAs an example, I would like the function below to return a string in the variable $lRetValue. Currently, it is returning True. Based on that I believe I have something uncaptured? But everything I am executing is captured in a variable. What am I missing?\u003c/p\u003e\n\n\u003cp\u003eThe calling routine is calling the code in the following form:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$FileName = \"S:\\PS\\Home\\GlobalConfig\\jobs.cfg\"\n$key = \"Help\"\n$section = \"Section\"\n\n$r = plGetKeyValue $FileName $Key\nwrite-host \"r is: $r\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe output shows as follows:\u003c/p\u003e\n\n\u003cp\u003ePS C:\u003e S:\\PS\\Home\\Job\\Test.ps1\nr is: True\u003c/p\u003e\n\n\u003cp\u003eAny assistance would be very much appreciated.\u003c/p\u003e","accepted_answer_id":"36784292","answer_count":"1","comment_count":"3","creation_date":"2016-04-21 23:46:19.62 UTC","favorite_count":"1","last_activity_date":"2016-04-22 05:32:18.183 UTC","last_edit_date":"2016-04-22 05:10:05.55 UTC","last_editor_display_name":"","last_editor_user_id":"45375","owner_display_name":"","owner_user_id":"6238085","post_type_id":"1","score":"2","tags":"powershell|parameters|return-value","view_count":"317"} +{"id":"24926253","title":"PHP self server not working","body":"\u003cp\u003eI am using easyPHP. I don't really understand (despite doing plenty of research) why I continue to get a ERROR 404 when I hit the \"Make the change button\". Below is an example of what I am trying to do. The goal is to have a submit button that refers to a php function in the current document. I have several working (but complicated) examples from my teacher but I cannot seam to recreate the concept of having a document refer to itself for a function. Any help would be greatly appreciated! EDIT:The file is saved as a PHP file. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;!DOCTYPE html\u0026gt;\n\u0026lt;html\u0026gt;\n\u0026lt;head\u0026gt;\n\u0026lt;meta charset = \"utf-8\"\u0026gt;\n\u0026lt;title\u0026gt;test\u0026lt;/title\u0026gt;\n\u0026lt;/head\u0026gt;\n\u0026lt;body\u0026gt;\n\u0026lt;form action = \"$_SERVER[PHP_SELF]\" method = \"POST\"\u0026gt;\n\u0026lt;input type = \"submit\" name = \"modify\" value = \"Make the change\" /\u0026gt;\n\u0026lt;/form\u0026gt;\n\u0026lt;?php\nsession_start();\nif (isset($_POST['modify'])) // if the modify button is clicked.\n{\necho \"IT WORKED\";\n}\n?\u0026gt;\n\u0026lt;/body\u0026gt;\n\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"24926293","answer_count":"3","comment_count":"3","creation_date":"2014-07-24 06:07:39.217 UTC","last_activity_date":"2014-07-24 06:24:26.99 UTC","last_edit_date":"2014-07-24 06:13:54.83 UTC","last_editor_display_name":"","last_editor_user_id":"3600424","owner_display_name":"","owner_user_id":"3600424","post_type_id":"1","score":"2","tags":"php|html","view_count":"201"} +{"id":"36288195","title":"Want to store output in an array","body":"\u003cp\u003eI have a list of servers. I want to check what all automatic services are not running. I want to store it in array and later display in grid view format.\nI tried below, but it didn't work.\u003c/p\u003e\n\n\u003cpre class=\"lang-bsh prettyprint-override\"\u003e\u003ccode\u003eforeach ($i in $list) {\n $Res = @(Get-WmiObject Win32_Service -ComputerName $i | Where-Object {\n $_.StartMode -eq 'Auto' -and $_.State -ne 'Running'\n } | Select PSComputerName, Name, DisplayName, State, StartMode)\n}\n\n$Res | Out-GridView\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"36288582","answer_count":"1","comment_count":"0","creation_date":"2016-03-29 15:09:52.483 UTC","last_activity_date":"2016-03-29 15:25:58.167 UTC","last_edit_date":"2016-03-29 15:25:58.167 UTC","last_editor_display_name":"","last_editor_user_id":"1630171","owner_display_name":"","owner_user_id":"5553314","post_type_id":"1","score":"0","tags":"powershell-v2.0","view_count":"184"} +{"id":"32098022","title":"pull data from the database with the aspx div","body":"\u003cp\u003eI want to get data from the database to the div structure in the below code. For example, when there are 5 records in the database will be composed of 5 pieces of panel. I am using SQL and ASPX.\u003c/p\u003e\n\n\u003cp\u003ePanel structure;\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"panel panel-default text-center\"\u0026gt;\n \u0026lt;div class=\"panel-heading\"\u0026gt; \n \u0026lt;span class=\"fa-stack fa-5x\"\u0026gt;\n \u0026lt;a href=\"#\"\u0026gt;\u0026lt;img src=\"/images/aa.png\" width=\"100\" height=\"125\" /\u0026gt;\u0026lt;/a\u0026gt;\n \u0026lt;/span\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"panel-body\"\u0026gt;\n \u0026lt;h4\u0026gt;\u0026lt;a href=\"#\"\u0026gt;Yayın Adı\u0026lt;/a\u0026gt;\u0026lt;/h4\u0026gt;\n \u0026lt;p\u0026gt;0. Sayı\u0026lt;/p\u0026gt;\n \u0026lt;p\u0026gt;0 Görüntülenme\u0026lt;/p\u0026gt;\n \u0026lt;a href=\"#\" class=\"btn btn-primary\"\u0026gt;OKU\u0026lt;/a\u0026gt;\n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"1","creation_date":"2015-08-19 14:15:08.5 UTC","favorite_count":"0","last_activity_date":"2015-08-19 14:32:46.74 UTC","last_edit_date":"2015-08-19 14:23:20.76 UTC","last_editor_display_name":"","last_editor_user_id":"3398302","owner_display_name":"","owner_user_id":"5243716","post_type_id":"1","score":"1","tags":"c#|css|asp.net","view_count":"32"} +{"id":"19152186","title":"how to redirect all links from old domain to same links but in domain?","body":"\u003cp\u003ehow to redirect all links from old domain to same links but in domain ?\nit's my website , how can I redirect (htaccess ) all my old links to new links , \nfor example :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ehttp://stroi-rf.ru/index.php?route=product/category\u0026amp;path=18_110\nhttp://snab-rf.ru/index.php?route=product/category\u0026amp;path=18_110 \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to change just stroi-rf.ru by snab-rf.ru in all my link's .\nthanks\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2013-10-03 06:25:07.303 UTC","last_activity_date":"2013-10-03 06:29:46.49 UTC","last_edit_date":"2013-10-03 06:28:59.16 UTC","last_editor_display_name":"","last_editor_user_id":"851273","owner_display_name":"","owner_user_id":"2841405","post_type_id":"1","score":"0","tags":".htaccess","view_count":"57"} +{"id":"28023571","title":"Sorting a queue - C/C++","body":"\u003cp\u003eI have crated a queue that in each node there are three information. I want to create a member function in class that sorts the queue when called. I wish to have the queue sorted by time? (it is an int and a member of q_node). This queue needs to be sorted in such a way that the lowest value of 'time' is in the front and it is sorted in increasing order.\nMy code for my Queue is found below:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etypedef struct Qnode{\n int time;\n char name[10];\n char value;\n\n struct Qnode *q_next;\n struct Qnode *q_prev;\n} q_node;\n\nclass Queue{\nprivate:\n q_node *q_rear;\n q_node *q_front;\n int number;\npublic:\n Queue();\n void enqueue(int time, char *s, char value);\n q_node *q_top(){\n return q_front;\n }\n void dequeue();\n void display();\n void queueSort();\n bool isEmpty();\n};\n\nQueue::Queue(){\n q_rear = NULL;\n q_front = NULL;\n number = 0;\n}\n\nbool Queue::isEmpty(){\n if (q_front == NULL)\n return true;\n else\n return false;\n}\n\nvoid Queue::enqueue(int t, char *n, char v){\n q_node *q_temp = new q_node;\n\n q_temp-\u0026gt;time = t;\n strcpy(q_temp-\u0026gt;name , n);\n q_temp-\u0026gt;value = v;\n q_temp-\u0026gt;q_next = NULL;\n\n if(q_front == NULL){\n q_front = q_temp;\n }\n else{\n q_rear-\u0026gt;q_next = q_temp;\n }\n q_rear = q_temp;\n number++;\n}\n\nvoid Queue::dequeue(){\n q_node *q_temp = new q_node;\n q_temp = q_front;\n q_front = q_front -\u0026gt; q_next;\n number--;\n delete q_temp;\n}\n\n\nvoid Queue::display(){\n q_node *p = new q_node;\n p = q_front;\n while(p!=NULL){\n cout\u0026lt;\u0026lt; \"\\ntime: \" \u0026lt;\u0026lt; p-\u0026gt;time;\n cout\u0026lt;\u0026lt; \"\\nname: \" \u0026lt;\u0026lt; p-\u0026gt;name;\n cout\u0026lt;\u0026lt; \"\\nvalue: \" \u0026lt;\u0026lt; p-\u0026gt;value;\n cout \u0026lt;\u0026lt; endl;\n p = p-\u0026gt;q_next;\n }\n}\n\nvoid Queue::queueSort(){\n //Code for sorting\n\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"28023662","answer_count":"2","comment_count":"7","creation_date":"2015-01-19 11:26:44.17 UTC","favorite_count":"2","last_activity_date":"2015-01-19 11:41:12.47 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4469730","post_type_id":"1","score":"-1","tags":"c++|c|sorting|queue","view_count":"4762"} +{"id":"43338959","title":"Why height is not apply when we use zxing for line barcode types in c#?","body":"\u003cp\u003eBelow is the code which we used for integration:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e IBarcodeWriterGeneric\u0026lt;Bitmap\u0026gt; writer = new BarcodeWriterGeneric\u0026lt;Bitmap\u0026gt;()\n {\n Format = GetBarcodeType(barCodeRequest.BarcodeType),\n Options = new EncodingOptions() { Height = barCodeRequest.Height, Width = barCodeRequest.Width, PureBarcode = !barCodeRequest.DisplayValue },\n Renderer = new BitmapRenderer()\n };\n BitMatrix bitmatrix = writer.Encode(barCodeRequest.Value);\n Bitmap bitmap = writer.Write(bitmatrix);\n //Bitmap bitmap = writer.Write(barCodeRequest.Value);\n return bitmap;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWe are passing height parameter in encoding option but it is not reflecting.Please help me on this? Thanks\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-04-11 07:05:44.917 UTC","last_activity_date":"2017-04-11 07:05:44.917 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4528408","post_type_id":"1","score":"0","tags":"c#|barcode|zxing","view_count":"33"} +{"id":"41617581","title":"SharePoint 2010 - Change XML Code with Two Lists combined as a Linked Data Source to prevent child from displaying all of the records in child","body":"\u003cp\u003eUsed SharePoint Designer 2010, to create a basic outline for a Web Part that comprises two SharePoint Lists linked together (Linked Data Source) to display some customized information.\u003c/p\u003e\n\n\u003cp\u003ebasically an information web part where the first list is roughly \u003cstrong\u003e\"Problem\"\u003c/strong\u003e and \u003cstrong\u003e\"Answer\"\u003c/strong\u003e and the second list contains user \u003cstrong\u003e\"Comments\"\u003c/strong\u003e on those \u003cstrong\u003e\"Problems\"\u003c/strong\u003e and \u003cstrong\u003e\"Answers\"\u003c/strong\u003e. I have been able to format overall structure of the Web Part the way in which I need, but currently have a problem with the manner in which the comments are being displayed. \u003c/p\u003e\n\n\u003cp\u003e(All of the comments in the list are being displayed, not just the comments related to the specific problem/answer.) I believe the problem is that the XSLT Template is set to display all of the rows for each \u003cstrong\u003eproblem/answer\u003c/strong\u003e and I would like to have the \u003cstrong\u003ecomment\u003c/strong\u003e results be only for the \u003cstrong\u003ecomments\u003c/strong\u003e that have been associated to the \u003cstrong\u003eproblem/answer\u003c/strong\u003e based on the linking parent ID.\u003c/p\u003e\n\n\u003cp\u003eHere's the Template code for the Comment section:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;xsl:variable name=\"dvt_2_automode\"\u0026gt;0\u0026lt;/xsl:variable\u0026gt;\n\u0026lt;xsl:template name=\"dvt_2\"\u0026gt;\n \u0026lt;xsl:variable name=\"dvt_StyleName\"\u0026gt;Table\u0026lt;/xsl:variable\u0026gt;\n \u0026lt;xsl:variable name=\"dvt_ParentRow\" select=\"current()\" /\u0026gt;\n \u0026lt;xsl:variable name=\"Rows\" select=\"../../../Problem_Comments/Rows/Row\" /\u0026gt;\n \u0026lt;xsl:variable name=\"dvt_RowCount\" select=\"count($Rows)\" /\u0026gt;\n \u0026lt;xsl:variable name=\"dvt_IsEmpty\" select=\"$dvt_RowCount = 0\" /\u0026gt;\n \u0026lt;xsl:choose\u0026gt;\n \u0026lt;xsl:when test=\"$dvt_IsEmpty\"\u0026gt;\n \u0026lt;xsl:call-template name=\"dvt_2.empty\" /\u0026gt;\n \u0026lt;/xsl:when\u0026gt;\n \u0026lt;xsl:otherwise\u0026gt;\n \u0026lt;table border=\"0\" width=\"100%\" cellpadding=\"2\" cellspacing=\"0\"\u0026gt;\n \u0026lt;tr valign=\"top\"\u0026gt;\n \u0026lt;xsl:if test=\"$dvt_2_automode = '1'\" ddwrt:cf_ignore=\"1\"\u0026gt;\n \u0026lt;th class=\"ms-vh\" width=\"1%\" nowrap=\"nowrap\"\u0026gt;\u0026lt;/th\u0026gt;\n \u0026lt;/xsl:if\u0026gt;\n \u0026lt;th class=\"ms-vh\" nowrap=\"nowrap\"\u0026gt;Comments\u0026lt;/th\u0026gt;\n \u0026lt;th class=\"ms-vh\" nowrap=\"nowrap\"\u0026gt;Modified\u0026lt;/th\u0026gt;\n \u0026lt;th class=\"ms-vh\" nowrap=\"nowrap\"\u0026gt;Modified By\u0026lt;/th\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;xsl:call-template name=\"dvt_2.body\"\u0026gt;\n \u0026lt;xsl:with-param name=\"Rows\" select=\"$Rows\" /\u0026gt;\n \u0026lt;xsl:with-param name=\"dvt_ParentRow\" select=\"$dvt_ParentRow\" /\u0026gt;\n \u0026lt;/xsl:call-template\u0026gt;\n \u0026lt;/table\u0026gt;\n \u0026lt;/xsl:otherwise\u0026gt;\n \u0026lt;/xsl:choose\u0026gt;\n\u0026lt;/xsl:template\u0026gt;\n\u0026lt;xsl:template name=\"dvt_2.body\"\u0026gt;\n \u0026lt;xsl:param name=\"Rows\" /\u0026gt;\n \u0026lt;xsl:param name=\"dvt_ParentRow\" /\u0026gt;\n \u0026lt;xsl:for-each select=\"$Rows\" \u0026gt;\n \u0026lt;xsl:call-template name=\"dvt_2.rowview\" /\u0026gt;\n \u0026lt;/xsl:for-each\"\u0026gt;\n\u0026lt;/xsl:template\u0026gt;\n\u0026lt;xsl:template name=\"dvt_2.rowview\"\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;xsl:if test=\"position() mod 2 = 1\"\u0026gt;\n \u0026lt;xsl:attribute name=\"class\"\u0026gt;ms-alternating\u0026lt;/xsl:attribute\u0026gt;\n \u0026lt;/xsl:if\u0026gt;\n \u0026lt;xsl:if test=\"$dvt_2_automode = '1'\" ddwrt:cf_ignore=\"1\"\u0026gt;\n \u0026lt;td class=\"ms-vb\" width=\"1%\" nowrap=\"nowrap\"\u0026gt;\n \u0026lt;span ddwrt:amkeyfield=\"\" ddwrt:amkeyvalue=\"string($XPath)\" ddwrt:ammode=\"view\"\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;/td\u0026gt;\n \u0026lt;td class=\"ms-vb\"\u0026gt;\n \u0026lt;xsl:value-of select=\"@Comments\" disable-output-escaping=\"yes\" /\u0026gt;\n \u0026lt;/td\u0026gt;\n \u0026lt;td class=\"ms-vb\"\u0026gt;\n \u0026lt;xsl:value-of select=\"ddwrt:FormatDate(string(@Modified), 1033, 5)\" /\u0026gt;\n \u0026lt;/td\u0026gt;\n \u0026lt;td class=\"ms-vb\"\u0026gt;\n \u0026lt;xsl:value-of select=\"@Editor\" disable-output-escaping=\"yes\" /\u0026gt;\n \u0026lt;/td\u0026gt;\n \u0026lt;/xsl:if\u0026gt;\n \u0026lt;/tr\u0026gt;\n\u0026lt;/xsl:template\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ePlease assist me.\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-01-12 15:54:38.74 UTC","last_activity_date":"2017-01-13 12:13:12.487 UTC","last_edit_date":"2017-01-13 12:13:12.487 UTC","last_editor_display_name":"","last_editor_user_id":"5387637","owner_display_name":"","owner_user_id":"7042339","post_type_id":"1","score":"0","tags":"xml|xslt|sharepoint|xslt-1.0","view_count":"26"} +{"id":"34789162","title":"Install locust in Anaconda","body":"\u003cp\u003eI´m was trying to install locustio following this steps (\u003ca href=\"http://docs.locust.io/en/latest/installation.html\" rel=\"nofollow\"\u003ehttp://docs.locust.io/en/latest/installation.html\u003c/a\u003e), in my terminal: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epip install locustio\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI get this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eld: library not found for -lgcc_s.10.5\n\nclang: error: linker command failed with exit code 1 (use -v to see invocation)\n\nerror: command 'gcc' failed with exit status 1\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI also have tried with easy_install: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esudo easy_install locustio\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI get the same error. After that, yesterday I was looking for information about this, and some people says that you may to need install gcc. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ebrew install gcc\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI get this message: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eWarning: gcc-5.3.0 already installed\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAfter a couple of hours looking for information, I read about Anaconda, I install Anaconda and I create my new environment... and in my new environment I get this again:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e ld: library not found for -lgcc_s.10.5\n clang: error: linker command failed with exit code 1 (use -v to see invocation)\n error: command 'gcc' failed with exit status 1\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI´m getting crazy. I would like to work in environments but I need some of help to do this because I lost a lot time trying to resolve this problem to use locustio. \u003c/p\u003e\n\n\u003cp\u003eI´m using Mac Yosemite 10.10.3\u003c/p\u003e\n\n\u003cp\u003eMy Anaconda version is 3.19.0\u003c/p\u003e\n\n\u003cp\u003eMy Python version is 2.7.11\u003c/p\u003e\n\n\u003cp\u003eMy gcc is gcc-5.3.0\u003c/p\u003e\n\n\u003cp\u003eSomeone can help me? \u003c/p\u003e\n\n\u003cp\u003eI just wanna launch locustio in my pc =(\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2016-01-14 12:02:18.223 UTC","last_activity_date":"2016-01-14 12:02:18.223 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4694090","post_type_id":"1","score":"0","tags":"python|locust","view_count":"205"} +{"id":"44468101","title":"In django1.8, how can I send Email and see the result?","body":"\u003cp\u003eI would like to implement sending Email functionality in Django1.8.\nI have posted this question a few hours ago, but there is no answer. \nThis is my snippet code in settings.py file.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eEMAIL_HOST = 'smtp.gmail.com'\nEMAIL_HOST_USER = 'mygmail@gmail.com'\nEMAIL_HOST_PASSWORD = 'mypassword'\nEMAIL_PORT = 587\nEMAIL_USE_TLS = True\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is the code in views.py file.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efrom django.conf import settings\nfrom django.core.mail import send_mail\nfrom django.shortcuts import render\nfrom .forms import SignUpForm, ContactForm\ndef contact(request):\n form = ContactForm(request.POST or None)\n if form.is_valid():\n form_email = form.cleaned_data.get('email')\n form_message = form.cleaned_data.get('message')\n form_full_name = form.cleaned_data.get('full_name')\n\n subject = 'Site contact form'\n from_email = settings.EMAIL_HOST_USER\n to_email = [from_email]\n contact_message = \"%s: %s via %s\"%(\n form_full_name, \n form_message, \n form_email)\n\n send_mail(subject,\n contact_message, \n from_email,\n to_email, \n fail_silently = False)\n context = {\n \"form\" : form\n }\n return render(request, \"forms.html\", context)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is forms.py file.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass ContactForm(forms.Form):\n full_name = forms.CharField(required = False)\n email = forms.CharField()\n message = forms.CharField()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have filled the input box with my another yandex mail and Full name, Message.\u003c/p\u003e\n\n\u003cp\u003eWhen I click send button, the browser seems to send email to yandex mail. But when I go to the yandex mail box, there is nothing to receive email from gmail.\u003c/p\u003e\n\n\u003cp\u003eWhat's the error and how can I handle it?\u003c/p\u003e","answer_count":"0","comment_count":"11","creation_date":"2017-06-09 23:52:40.85 UTC","last_activity_date":"2017-06-09 23:52:40.85 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7971015","post_type_id":"1","score":"0","tags":"django","view_count":"25"} +{"id":"22924535","title":"PYTHON Invalid Syntax Error?","body":"\u003cp\u003eI keep getting an \"invalid syntax\" message when I try to run this program. It highlights \"age\" in red after the \"else\" statement. I'm not sure what I did wrong.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eage = float(input('How old are you? '))\ncitizen = float(input('How long have you been an American citizen? '))\nif age \u0026gt;= 30 and citizen \u0026gt;= 9:\n print('You are eligible to become a US Senator and a House Representative!')\nelse age \u0026lt; 30 \u0026gt;= 25 and citizen \u0026lt; 9 \u0026gt;= 7:\n print('You are only eligible to become a House Representative.')\nif age \u0026lt; 25 or citizen \u0026lt; 7:\n print('You are not eligible to become a US Senator or a House Represenatative.')\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"22924574","answer_count":"2","comment_count":"4","creation_date":"2014-04-07 22:48:08.533 UTC","last_activity_date":"2014-04-07 22:53:44.91 UTC","last_edit_date":"2014-04-07 22:53:44.91 UTC","last_editor_display_name":"","last_editor_user_id":"47453","owner_display_name":"","owner_user_id":"3508821","post_type_id":"1","score":"0","tags":"python|python-3.x|syntax-error","view_count":"147"} +{"id":"9217556","title":"JavaScript Prototypal Inheritance - Is this the right way to do things?","body":"\u003cp\u003eIf I declare the base prototype object outside the constructor for an object, all created objects are based on that single base object which is not suitable for my needs because I need more than one instance of the base object.\u003c/p\u003e\n\n\u003cp\u003eIn short: Is this code correct? It works but I'm picky about having correct code.\u003c/p\u003e\n\n\u003cp\u003eExample:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction BaseObject()\n{\n BaseObject.prototype.insertObject = function()…\n …\n … // Some other functions.\n}\n\nfunction Object1()\n{\n Object1.prototype = new BaseObject();\n\n Object1.prototype.coolFunction = function()…\n …\n … // Same kind of pattern.\n}\n\nfunction Object2()\n{\n Object2.prototype = new Object1();\n\n Object2.prototype.incredibleFunction = function()…\n …\n … // You get the idea.\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"0","creation_date":"2012-02-09 19:39:38.303 UTC","last_activity_date":"2012-02-09 19:55:25.517 UTC","last_edit_date":"2012-02-09 19:50:59.963 UTC","last_editor_display_name":"","last_editor_user_id":"1092719","owner_display_name":"","owner_user_id":"1092719","post_type_id":"1","score":"0","tags":"javascript|class|inheritance|prototype|instantiation","view_count":"141"} +{"id":"41157855","title":"AngularJS: How to get index value in ng-repeat?","body":"\u003cp\u003eI am new is angularjs and i am trying to get the index value in \u003ccode\u003eng-repeat\u003c/code\u003e means i want to set \u003ccode\u003emd-option\u003c/code\u003e value as index value my code is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;md-input-container class=\"md-block\" flex-gt-sm\u0026gt;\n \u0026lt;label\u0026gt;Filterable Columns\u0026lt;/label\u0026gt;\n \u0026lt;md-select ng-model=\"visualization.filterable_columns\" ng-change=\"drawFilters()\" multiple=\"true\" ng-init=\"index = 1\"\u0026gt;\n \u0026lt;md-option ng-repeat=\"filterable_column in vm.filterable_columns\" value=\"{{index++}}\"\u0026gt;\n {{filterable_column.label}\n \u0026lt;/md-option\u0026gt;\n \u0026lt;/md-select\u0026gt;\n\u0026lt;/md-input-container\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ecan anyone help me about this?\u003c/p\u003e","accepted_answer_id":"41157890","answer_count":"3","comment_count":"2","creation_date":"2016-12-15 06:34:46.34 UTC","favorite_count":"0","last_activity_date":"2017-10-12 08:53:54.74 UTC","last_edit_date":"2017-10-12 08:40:47.573 UTC","last_editor_display_name":"","last_editor_user_id":"7528205","owner_display_name":"","owner_user_id":"6878840","post_type_id":"1","score":"2","tags":"angularjs","view_count":"10417"} +{"id":"22093223","title":"Matlabs runs wrong script after figure copying","body":"\u003cp\u003eI have the following problem. Let us say, we have some GUI written in Matlab. Let it be \n\u003ccode\u003emygui.fig\u003c/code\u003e and \u003ccode\u003emygui.m\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eOK, now I want to rewrite this gui and keep prev version of it. So, I copy these two files to \u003ccode\u003emygui_new.fig\u003c/code\u003e and \u003ccode\u003emygui_new.m\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eWe all know, that when we run \u003ccode\u003esomething.fig\u003c/code\u003e, Matlab tries to find \u003ccode\u003esomething.m\u003c/code\u003e in order to perform responses on our actions. However, when I'm trying to run my mygui_new.m, Matlab tries to read scripts from mygui.m giving me warnings like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eWarning: Name is nonexistent or not a directory: ..\\..\\matlab\\PostProcess\\ \n\n In path at 110\n In addpath at 87\n In mygui at 22\n In @(hObject,eventdata)SemiSuperviseTool_main('video_name_popupmenu_CreateFcn',hObject,eventdata,guidata(hObject))\n In graphics/private/hgloadStructDbl at 95\n In /usr/local/MATLAB/R2013a/toolbox/matlab/graphics/hgload.p\u0026gt;hgload at 70\n In openfig at 72\n In gui_mainfcn\u0026gt;local_openfig at 286\n In gui_mainfcn at 159\n In mygui_new at 46\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo, we see that Matlab is really starting from my new version of script, but then for some reason tries to load an old one. If I delete old files at all, GUI will not run.\u003c/p\u003e\n\n\u003cp\u003eHere is another my post:\n\u003ca href=\"https://stackoverflow.com/questions/21849773/no-breakpoints-after-gui-figure-copying\"\u003eNo breakpoints after gui figure copying?\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThe solutions I've described there doest not work here.\u003c/p\u003e\n\n\u003cp\u003eAny ideas?\nThanks!\u003c/p\u003e","accepted_answer_id":"22096755","answer_count":"1","comment_count":"0","creation_date":"2014-02-28 10:59:06.213 UTC","last_activity_date":"2014-02-28 14:04:46.213 UTC","last_edit_date":"2017-05-23 12:03:41.317 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"1946300","post_type_id":"1","score":"0","tags":"matlab|user-interface","view_count":"127"} +{"id":"20524428","title":"How to Best Intercept Parsing of all Elements in the Sub-tree of an ASP.NET User Control","body":"\u003cp\u003eI'd like to intercept parsing of each control in the entire sub-tree of my own User Control. \u003c/p\u003e\n\n\u003cp\u003eCurrently I've overridden the protected method \u003ca href=\"http://msdn.microsoft.com/en-us/library/system.web.ui.control.addparsedsubobject%28v=vs.110%29.aspx\"\u003eControl.AddParsedSubObject\u003c/a\u003e in my user control. It's limited to interception of parsing on the immediate child controls in the declarative syntax because each of those controls has its own \u003ccode\u003eAddParsedSubObject\u003c/code\u003e method to further parse its own child controls. \u003c/p\u003e\n\n\u003cp\u003eFrom the User Control I can't get into the childrens' children to intercept those parsing calls. \u003c/p\u003e\n\n\u003cp\u003eIn the following declarative example of my user control I can access the tv object from inside the User Control's AddParsedSubObject override.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;asp:TreeView runat=\"server\" id=\"tv\" /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever I cannot access the tv object in the following example (or the other children of the first Panel) because that parsing is handled by the Panel instead or its children. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;asp:Panel runat=\"server\"\u0026gt;\n \u0026lt;asp:TreeView runat=\"server\" id=\"tv\" /\u0026gt;\n \u0026lt;asp:Panel runat=\"server\"\u0026gt;\n \u0026lt;asp:TextBox runat=\"server\" /\u0026gt;\n \u0026lt;/asp:Panel\u0026gt;\n\u0026lt;/asp:Panel\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy code-behind in the user control looks like this \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e // User control interception of its parsed children \n protected override void AddParsedSubObject(object obj) {\n\n // Do some custom work with the control object. \n if (obj is Control \u0026amp;\u0026amp; ((Control)obj).ID == \"tv\") {\n TreeView tv = (TreeView)obj;\n DoSomethingWithParsedObject(tv);\n }\n\n // Let ASP.NET continue and put the control in the page hierarchy\n base.AddParsedSubObject(obj);\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eLooking for ideas about how I can intercept parsing of each control in the entire sub-tree of my user control. For example, I want to write out custom information at each parse step. \u003c/p\u003e","accepted_answer_id":"20656138","answer_count":"1","comment_count":"5","creation_date":"2013-12-11 16:21:08.433 UTC","favorite_count":"1","last_activity_date":"2013-12-18 10:52:36.177 UTC","last_edit_date":"2013-12-11 23:27:44.94 UTC","last_editor_display_name":"","last_editor_user_id":"179972","owner_display_name":"","owner_user_id":"179972","post_type_id":"1","score":"7","tags":"asp.net|user-controls|webforms","view_count":"339"} +{"id":"1670511","title":"can zend_form be used with pagination?","body":"\u003cp\u003eI am not sure if this is the most sensible way of doing this but I thought I would ask anyway.\u003c/p\u003e\n\n\u003cp\u003eI have a 'wizard' that I am developing for users to review data that is stored in the database. Each part of the wizard is a simple Zend_Form allowing the users to review and edit the data. However one element of the wizard needs to be a bit more dynamic. \u003c/p\u003e\n\n\u003cp\u003eThe dynamic bit needs to be able to allow the users to 'scroll' through multiple instances of the same for with different data in it, as you would scroll through the records of a database. However with the user being able to update the data displayed. They must also be able to add and remove TextBox elements to the form (I was planning on adding these elements with javascript/dojo) but each TextBox element needs to be saved before moving on to the next form.\u003c/p\u003e\n\n\u003cp\u003eI am thinking of using Zend_paginator to accomplish this but as each click though is a _GET request, is it possible to make it _POST so that I can handle the form request before moving the user to the next record?\u003c/p\u003e\n\n\u003cp\u003eI hope this makes sense, it is quite difficult to describe, however if there is a better way of achieving this functionality I would be interested in hearing how, (esp if it makes my life a little easier)\u003c/p\u003e\n\n\u003cp\u003eThanks...\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2009-11-03 22:20:01.09 UTC","last_activity_date":"2009-11-04 10:22:40.38 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"77451","post_type_id":"1","score":"0","tags":"php|zend-framework|zend-form|zend-paginator","view_count":"638"} +{"id":"27241101","title":"Oracle : specify a larger or smaller in date data type","body":"\u003cp\u003eI have a table with:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003etwo columns : \u003ccode\u003edate_1\u003c/code\u003e and \u003ccode\u003edate_2\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003edata type is \u003ccode\u003edate\u003c/code\u003e (dd-mm-yyyy)\u003c/li\u003e\n\u003cli\u003edatabase is \u003ccode\u003eoracle\u003c/code\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eI want to know whether \u003ccode\u003edate_1\u003c/code\u003e is \u003ccode\u003egreater\u003c/code\u003e or \u003ccode\u003esmaller\u003c/code\u003e then \u003ccode\u003edate_2\u003c/code\u003e. \u003c/p\u003e\n\n\u003cp\u003eMy script:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eDecode (to_char(date_1,'yyyyddmm') \u0026gt; to_char(date_2,'yyyyddmm'), 'Greater','Smaller') as Status\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCMIIW\u003c/p\u003e","accepted_answer_id":"27241283","answer_count":"2","comment_count":"1","creation_date":"2014-12-02 02:51:08.82 UTC","last_activity_date":"2014-12-02 03:18:48.497 UTC","last_edit_date":"2014-12-02 03:05:04.42 UTC","last_editor_display_name":"","last_editor_user_id":"726422","owner_display_name":"","owner_user_id":"2380168","post_type_id":"1","score":"0","tags":"sql|oracle|date","view_count":"32"} +{"id":"41247223","title":"can't make paypal ipn working","body":"\u003cp\u003eI am trying to make a donation in my website with paypal. As the result, I want the donators to be displayed. For that I use ipn. I figured and made it working, but it seems to be working fine only with paypal sandbox only.\u003c/p\u003e\n\n\u003cp\u003eHere's my code:\npage.php\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;form action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\" name=\"frmPayPal1\"\u0026gt;\n \u0026lt;input type=\"hidden\" name=\"business\" value=\"\u0026lt;?php echo $merchant_id; ?\u0026gt;\"\u0026gt;\n \u0026lt;input type=\"hidden\" name=\"cmd\" value=\"_donations\"\u0026gt;\n \u0026lt;input type=\"hidden\" name=\"item_name\" value=\"Donation\"\u0026gt;\n \u0026lt;input type=\"hidden\" name=\"item_number\" value=\"1\"\u0026gt;\n \u0026lt;input type=\"hidden\" name=\"credits\" value=\"510\"\u0026gt;\n \u0026lt;input type=\"hidden\" name=\"userid\" value=\"1\"\u0026gt;\n \u0026lt;input type=\"hidden\" name=\"no_shipping\" value=\"1\"\u0026gt;\n \u0026lt;input type=\"hidden\" name=\"currency_code\" value=\"EUR\"\u0026gt;\n \u0026lt;input type=\"hidden\" name=\"handling\" value=\"0\"\u0026gt;\n \u0026lt;input type=\"hidden\" name=\"cancel_return\" value=\"http://domain.com/donation\"\u0026gt;\n \u0026lt;input type=\"hidden\" name=\"return\" value=\"http://domain.com/donation\"\u0026gt;\n \u0026lt;div class = \"donator_name_choice\"\u0026gt;\n Enter the name you want to be displayed as: \u0026lt;input type=\"text\" class = \"donate_amount\" name=\"custom\" maxlength=\"14\"\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class = \"donator_donation\"\u0026gt;\n Enter the value You want to donate(EUR): \u0026lt;input type=\"number\" class = \"donate_amount\" name=\"amount\" step = \"0.01\"\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class = \"donation_submit\"\u0026gt;\n \u0026lt;input type=\"submit\" name=\"submit\" value = \"DOTANE\" class = \"donate_here\"\u0026gt;\n\u0026lt;/div\u0026gt;\n\u0026lt;/form\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eipnlistener.php:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\n// STEP 1: Read POST data\n\n// reading posted data from directly from $_POST causes serialization \n// issues with array data in POST\n// reading raw POST data from input stream instead. \n$raw_post_data = file_get_contents('php://input');\n$raw_post_array = explode('\u0026amp;', $raw_post_data);\n$myPost = array();\nforeach ($raw_post_array as $keyval) {\n $keyval = explode ('=', $keyval);\n if (count($keyval) == 2)\n $myPost[$keyval[0]] = urldecode($keyval[1]);\n}\n// read the post from PayPal system and add 'cmd'\n$req = 'cmd=_notify-validate';\nif(function_exists('get_magic_quotes_gpc')) {\n $get_magic_quotes_exists = true;\n} \nforeach ($myPost as $key =\u0026gt; $value) { \n if($get_magic_quotes_exists == true \u0026amp;\u0026amp; get_magic_quotes_gpc() == 1) { \n $value = urlencode(stripslashes($value)); \n } else {\n $value = urlencode($value);\n }\n $req .= \"\u0026amp;$key=$value\";\n}\n\n\n// STEP 2: Post IPN data back to paypal to validate\n\n$ch = curl_init('https://www.paypal.com/cgi-bin/webscr');\ncurl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);\ncurl_setopt($ch, CURLOPT_POST, 1);\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $req);\ncurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);\ncurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\ncurl_setopt($ch, CURLOPT_FORBID_REUSE, 1);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: Close'));\n\n// In wamp like environments that do not come bundled with root authority certificates,\n// please download 'cacert.pem' from \"http://curl.haxx.se/docs/caextract.html\" and set the directory path \n// of the certificate as shown below.\n// curl_setopt($ch, CURLOPT_CAINFO, dirname(__FILE__) . '/cacert.pem');\nif( !($res = curl_exec($ch)) ) {\n // error_log(\"Got \" . curl_error($ch) . \" when processing IPN data\");\n curl_close($ch);\n exit;\n}\ncurl_close($ch);\n\n\n// STEP 3: Inspect IPN validation result and act accordingly\n\nif (strcmp ($res, \"VERIFIED\") == 0) {\n // check whether the payment_status is Completed\n // check that txn_id has not been previously processed\n // check that receiver_email is your Primary PayPal email\n // check that payment_amount/payment_currency are correct\n // process payment\n\n // assign posted variables to local variables\n $user_name = $_POST['custom'];\n $item_name = $_POST['item_name'];\n $item_number = $_POST['item_number'];\n $payment_status = $_POST['payment_status'];\n\n\n $payment_amount = $_POST['mc_gross'];\n\n\n $payment_currency = $_POST['mc_currency'];\n $txn_id = $_POST['txn_id'];\n $receiver_email = $_POST['receiver_email'];\n $payer_email = $_POST['payer_email'];\n $payment_date = $_POST['payment_date'];\n $item_name = $_POST['item_name'];\n\n $sql162 = \"INSERT INTO donators (user_name, receiver_email, payer_email, txn_id, payment_gross, currency_code, payment_status, payment_date) VALUES ('\" . $user_name . \"', '\". $receiver_email .\"', '\" . $payer_email . \"', '\" . $txn_id . \"', '\" . $payment_amount . \"', '\" . $payment_currency . \"', '\" . $payment_status . \"', '\" . $payment_date . \"')\";\n\n if ($MySQLi_CON-\u0026gt;query($sql162) === TRUE) {\n echo \"New record created successfully\";\n } else {\n echo \"Error: \" . $sql162 . \"\u0026lt;br\u0026gt;\" . $MySQLi_CON-\u0026gt;error;\n }\n\n} else if (strcmp ($res, \"INVALID\") == 0) {\n // log for manual investigation\n}\n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCould anyone explain me what am I missing? Thanks !\u003c/p\u003e","answer_count":"0","comment_count":"6","creation_date":"2016-12-20 16:42:18.767 UTC","last_activity_date":"2016-12-20 16:42:18.767 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6563047","post_type_id":"1","score":"1","tags":"php|paypal|paypal-ipn","view_count":"34"} +{"id":"18188627","title":"Custom email recipient list in Hudson","body":"\u003cp\u003eI am using Hudson v2.1.2. to build our code. The build is configured by a shell script (which is clever enough to find the faulty commit that broke the code and the committer's address). \nIs it possible to send email notifications to this address only (rather the spamming the whole development team) ?\nI have tried to set an environment variable with this adress and call it from the email list but it does not work...\u003c/p\u003e\n\n\u003cp\u003eAny idea ?\u003c/p\u003e","answer_count":"0","comment_count":"4","creation_date":"2013-08-12 13:46:06.693 UTC","last_activity_date":"2013-08-12 13:46:06.693 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1785470","post_type_id":"1","score":"0","tags":"hudson","view_count":"44"} +{"id":"4080087","title":"Error when communicate with WCF-Service via https in Silverlight 4","body":"\u003cp\u003ein my Silverlight 4 application, I want to consume a WCF-Service via https and User Authentication. I have created and published a test service, which is running at \u003ca href=\"https://pcai043.informatik.uni-leipzig.de/ServiceConfiguratorDataSource/Service.svc\" rel=\"nofollow\"\u003ehttps://pcai043.informatik.uni-leipzig.de/ServiceConfiguratorDataSource/Service.svc\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThen I added the service reference to my silverlight project in VS2010 and VS created the appropriate classes. Then I tried to call the Service:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate void ButtonTest_Click(object sender, System.Windows.RoutedEventArgs e)\n{\n WCFDataProvider.ServiceClient proxy = new WCFDataProvider.ServiceClient();\n proxy.GetDataCompleted += new EventHandler\u0026lt;WCFDataProvider.GetDataCompletedEventArgs\u0026gt;(proxy_GetDataCompleted);\n proxy.ClientCredentials.UserName.UserName = \"theName\";\n proxy.ClientCredentials.UserName.Password = \"thePwd\";\n proxy.GetDataAsync(10);\n}\n\nvoid proxy_GetDataCompleted(object sender, WCFDataProvider.GetDataCompletedEventArgs e)\n{\n MessageBox.Show(e.Result, \"WCF Service Call\", MessageBoxButton.OK);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I call the service, I get the following exception: \"Unhandled Error in Silverlight Application\"\u003c/p\u003e\n\n\u003cp\u003eLaufzeitfehler in Microsoft JScript: Unhandled Error in Silverlight Application Während des Vorgangs ist eine Ausnahme aufgetreten, sodass das Ergebnis ungültig ist. \nWeitere Ausnahmedetails finden Sie in InnerException.\u003cbr\u003e\nbei System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()\n bei ServiceConfiguratorWebPrototyp.WCFDataProvider.GetDataCompletedEventArgs.get_Result()\n bei ServiceConfiguratorWebPrototyp.MainPage.proxy_GetDataCompleted(Object sender, GetDataCompletedEventArgs e)\n bei ServiceConfiguratorWebPrototyp.WCFDataProvider.ServiceClient.OnGetDataCompleted(Object state)\u003c/p\u003e\n\n\u003cp\u003eThis error is thrown by the aspx-page which contains my silverlight app. VS opens a new tab labeled \"eval code [dynamical]\" which contains nothing but a line that throws the above error. \u003c/p\u003e\n\n\u003cp\u003eAny idea, what might cause this error and/or how to find out more details about it? I set breakpoints at proxy_GetDataCompleted, private void OnGetDataCompleted(object state) and string ServiceConfiguratorWebPrototyp.WCFDataProvider.IService.EndGetData(System.IAsyncResult result) in the Reference.cs file, but it doesn't stop at any of those lines.\u003c/p\u003e\n\n\u003cp\u003eThanks in advance,\u003cbr\u003e\nFrank\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2010-11-02 16:56:28.157 UTC","last_activity_date":"2011-06-01 10:16:49.51 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"132765","post_type_id":"1","score":"0","tags":"wcf|silverlight-4.0|https","view_count":"451"} +{"id":"43451266","title":"Divi Theme: Portfolio Module: Project title display in overlay","body":"\u003cp\u003eI'm using the Divi Wordpress theme for my portfolio site. \u003c/p\u003e\n\n\u003cp\u003eI plan on using the filterable portfolio module to display my work. Current state of my website: \u003ca href=\"http://anti-mogul.com\" rel=\"nofollow noreferrer\"\u003ehttp://anti-mogul.com\u003c/a\u003e.\u003c/p\u003e\n\n\u003cp\u003eI saw this example (below), I really like how the titles of each project display over the thumbnail when hovering. I'd like to add this functionality to the portfolio section on my site.\u003c/p\u003e\n\n\u003cp\u003eExample:\u003cbr\u003e\n\u003ca href=\"http://doers.sg/work/\" rel=\"nofollow noreferrer\"\u003ehttp://doers.sg/work/\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI've been able to change a lot of the other features through CSS overrides - but this seems to be more of a structural thing. \u003c/p\u003e\n\n\u003cp\u003eFrom looking at the differences between the example site and my own - the builder of the example site has managed to move the h2 containing the title into the span class \"et_overlay\" above it. \u003c/p\u003e\n\n\u003cp\u003eIf anybody could suggest a solution for this, it would be much appreciated. \u003c/p\u003e","accepted_answer_id":"43452539","answer_count":"1","comment_count":"0","creation_date":"2017-04-17 12:12:35.417 UTC","favorite_count":"0","last_activity_date":"2017-09-14 11:43:18.157 UTC","last_edit_date":"2017-09-14 11:43:18.157 UTC","last_editor_display_name":"","last_editor_user_id":"1000551","owner_display_name":"","owner_user_id":"7878487","post_type_id":"1","score":"-2","tags":"css|wordpress|hover","view_count":"1329"} +{"id":"44777868","title":"C#,Spec flow, Scenario Outline with example showing same test case name when i am executing bunch of test cases","body":"\u003cp\u003eIssue:\nI have C# with Spec Flow BDD Scenario as below\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@00001\n @0\n @AddANewColor\n#00001\nScenario Outline: Add a new Color\nGiven User logged in successfully\nWhen generate new ColorType \u0026lt;Color-Type\u0026gt;\nThen respective color should be displayed\n\nExamples: \n| Example Description | color-Type | \n| 'Yellow' | 'Client' | \n| 'Pink' | 'Prospect' | \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow for above scenario outline there are two test cases which are generated with name as-\n1. AddANewColor_Yellow\n2. AddANewColor_Pink\u003c/p\u003e\n\n\u003cp\u003eWhen i execute seperate test case then correct test case name is displayed but when i execute above two test case then it is displaying test case name as -AddANewColor_Yellow \nfor both the test cases after execution\u003c/p\u003e\n\n\u003cp\u003eIn below code i am getting test case name from testcontext.testName but in bulk execution it is displayed same for all scenario\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[BeforeScenario]\n public static void BeforeScenario()\n {\n TestContext testContext = SpecFlowTestContext.TestContext;\n string currentTCName = testContext.TestName;\n string testCaseId = ScenarioContext.Current.ScenarioInfo.Tags[0];\n Log.Start(ScenarioContext.Current.ScenarioInfo.Tags[0], testContext.TestName);\n\n }\n\n\n [AfterScenario]\npublic static void AfterScenario()\n{\n TestContext testContext = SpecFlowTestContext.TestContext;\n try\n {\n //Get Test Case details (Test Case Result, Test Case Title) from Scenario Context\n Assert.IsTrue(bool TestCaseResult);\n }\n catch (Exception ex)\n {\n Log.LogException(ex);\n Assert.Fail(ex.Message.ToString());\n }\n finally\n {\n //Log.AddDataResult();\n Log.LogResult(bool TestCaseResult, testContext.TestName);\n Log.EndLog();\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNote: This issue specific to scenario Outline with multiple rows with example in C#.\nAny Help regarding this is appreciated and helpful , thanks in advance\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-06-27 10:23:06.06 UTC","last_activity_date":"2017-06-27 10:23:06.06 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3421383","post_type_id":"1","score":"0","tags":"c#|bdd|specflow|scenarios|outliner","view_count":"114"} +{"id":"40969999","title":"How to combine EF and ADO?","body":"\u003cp\u003eAfter reading forums and articles, I found that using the \u003ccode\u003eEntity Framework\u003c/code\u003e\nyou can quickly create a database, and ADO can be used to conventional SQL queries and get accurate results. Also there are many questions all over the internet: what is better, ADO or EF? And in responses saying that need to combine these two technologies, each in its own good. But here's the question of how combine these two technologies and use them in the same project?\u003c/p\u003e\n\n\u003cp\u003eFor example, i have several tables that mapped to entites, like \u003ccode\u003eemployee\u003c/code\u003e and \u003ccode\u003etasks\u003c/code\u003e. With EF i can create new \u003ccode\u003eemployees\u003c/code\u003e and add them to database. But what if i want to create a report, that can be easely created with complex \u003ccode\u003eSQL\u003c/code\u003e query from many tables. The result of this \u003ccode\u003eSQL\u003c/code\u003e query can't match existing entities, so what to do? Create new entity-model to match this report and create this \u003ccode\u003eLINQ\u003c/code\u003e query to build it, or use ADO and \u003ccode\u003eSQL\u003c/code\u003e query?\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2016-12-05 08:29:53.783 UTC","last_activity_date":"2016-12-05 08:32:48.743 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5615674","post_type_id":"1","score":"0","tags":"c#|wpf|entity-framework|ado","view_count":"64"} +{"id":"23288321","title":"Multi-client architecture advice for RavenDB","body":"\u003cp\u003eWhen catering for multiple .NET Client Applications - say - Web, Desktop and then throw in an Android app (Java), placing the business logic behind some WCF REST API services can make it easier and quicker to build applications, as there is no business logic to implement client side for each technology.\u003c/p\u003e\n\n\u003cp\u003e(I know that there will be a point of changing the UI to cater for new business logic, but the idea is the core of the system sits behind an API, not in the client application.)\u003c/p\u003e\n\n\u003cp\u003eAlthough RavenDB serves as the Storage Mechanism...\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eWhat is the general architectural advice of using RavenDB behind SOA services? Is it just your standard \u003ccode\u003eIDocumentStore\u003c/code\u003e/\u003ccode\u003eIDocumentSession\u003c/code\u003e behind the WCF instance and go from there?\u003c/p\u003e\n\u003c/blockquote\u003e","accepted_answer_id":"23291084","answer_count":"1","comment_count":"0","creation_date":"2014-04-25 08:46:06 UTC","favorite_count":"1","last_activity_date":"2014-04-25 12:36:32.937 UTC","last_edit_date":"2014-04-25 12:36:32.937 UTC","last_editor_display_name":"","last_editor_user_id":"128444","owner_display_name":"","owner_user_id":"128444","post_type_id":"1","score":"1","tags":"wcf|ravendb|soa","view_count":"73"} +{"id":"12964526","title":"Check In: Operation not performed Could not find file *.csproj.vspscc","body":"\u003cp\u003eI am having issues with check in my code files because of some changes I have made to the project and solution. I have renamed project files, added different project files in the solution and added many files in the existing project.\nNow I am getting an error while checking in the code.\nThe error details are:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eCheck In: Operation not performed Could not find file\n '....Console.csproj.vspscc'.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eHow do I create a vspscc file if it does not get created on its own?\u003c/p\u003e\n\n\u003cp\u003eAny help would be great and thanks in advance.\u003c/p\u003e","accepted_answer_id":"13039484","answer_count":"5","comment_count":"0","creation_date":"2012-10-18 22:09:15.667 UTC","favorite_count":"1","last_activity_date":"2016-07-28 17:59:32.227 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"615587","post_type_id":"1","score":"12","tags":"c#|visual-studio-2010|tfs2010","view_count":"11108"} +{"id":"19413297","title":"Output Stream NullPointerException","body":"\u003cp\u003eI'm trying to get the string input from the user and store it in a file but an error comes out saying:\nI don't know what the issue is, it doesn't pop up as an error until I actually run the code. I just want the input from the user stored in a file that is made\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eException in thread \"main\" java.lang.NullPointerException\n at BingoHelper.\u0026lt;init\u0026gt;(BingoHelper.java:53)\n at BINGO.main(BINGO.java:8)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMain Class Code: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport javax.swing.*;\nimport java.io.*;\n\n public class BINGO {\n public static void main(String[] args) throws IOException{\n JLabel bg = new JLabel();\n //JButton b = new JButton(\"Click to enter name\");\n BingoHelper EnterFaze = new BingoHelper();\n EnterFaze.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n EnterFaze.setSize(500,500);\n EnterFaze.setVisible(true);\n EnterFaze.setLocationRelativeTo(null);\n EnterFaze.setLayout(null);\n EnterFaze.add(bg);\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSecond Class\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport javax.swing.*;\nimport java.awt.*;\nimport java.awt.event.*;\nimport java.io.*;\n\npublic class BingoHelper extends JFrame implements WindowListener, ActionListener{\n JTextField text = new JTextField();\n\nJLabel bg = new JLabel();\n\nprivate JButton b; {\n b = new JButton(\"Click to enter name\");\n }\n\nJPanel pnlButton = new JPanel();\n\n\npublic static String fn;\npublic static String sn;\n\npublic void actionPerformed (ActionEvent e) {\n //BingoHelper.fn;\n //BingoHelper.sn;\n fn = JOptionPane.showInputDialog(\"What is your first name?\");\n sn = JOptionPane.showInputDialog(\"What is your second name(Optional)\");\n //JOptionPane.showMessageDialog(null, \"Welcome \" + fn + \" \" + sn + \".\", \"\", JOptionPane.INFORMATION_MESSAGE);\n text.setText(\"Welcome \" + fn + \" \" + sn + \".\");\n b.setVisible(false);\n text.setVisible(true);\n text.setBounds(140,0,220,20);\n text.setHorizontalAlignment(JLabel.CENTER);\n text.setEditable(false);\n text.setBackground(Color.YELLOW);\n} \n\npublic BingoHelper() throws IOException{\n super(\"BINGO\");\n add(text);\n text.setVisible(false);\n add(b);\n this.add(pnlButton);\n pnlButton.setBackground(Color.BLUE);\n //pnlButton.add(b);+\n b.setVisible(true);\n b.setBounds(145,145,145,20);\n //b.setPreferredSize(new Dimension(150,40));\n b.addActionListener(this);\n b.setBackground(Color.GREEN);\n rootPane.setDefaultButton(b);\n File f = new File(\"test.txt\");\n\n String nameToWrite = fn;\n OutputStream outStream = new FileOutputStream(f);\n outStream.write(nameToWrite.getBytes());\n outStream.close();\n}\n\npublic void windowClosing(WindowEvent e) {\n dispose();\n System.exit(0);\n\n}\npublic void windowOpened(WindowEvent e) {}\npublic void windowActivated(WindowEvent e) {}\npublic void windowIconified(WindowEvent e) {}\npublic void windowDeiconified(WindowEvent e) {}\npublic void windowDeactivated(WindowEvent e) {}\npublic void windowClosed(WindowEvent e) {}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e}\u003c/p\u003e","accepted_answer_id":"19414057","answer_count":"3","comment_count":"3","creation_date":"2013-10-16 20:34:00.563 UTC","favorite_count":"0","last_activity_date":"2013-10-16 21:16:21.36 UTC","last_edit_date":"2013-10-16 20:34:45.16 UTC","last_editor_display_name":"","last_editor_user_id":"438154","owner_display_name":"","owner_user_id":"2859639","post_type_id":"1","score":"-1","tags":"java|file-io|stream|output","view_count":"3824"} +{"id":"47237414","title":"What is the best Environment.SpecialFolder for store application data in Xamarin.Forms?","body":"\u003cp\u003eI'm new in Xamarin.Forms and mobile development. I want to store user and encrypted password of my application user in file on mobile device. I'm using xamarin forms technology. I kwnow that there are many differenet folders. In example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSystem.Environment.SpecialFolder.Personal\nSystem.Environment.SpecialFolder.LocalApplicationData\nSystem.Environment.SpecialFolder.MyDocuments\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFull list you can find here: \u003ca href=\"https://msdn.microsoft.com/en-gb/en-enl/library/system.environment.specialfolder(v=vs.110).aspx\" rel=\"nofollow noreferrer\"\u003ehttps://msdn.microsoft.com/en-gb/en-enl/library/system.environment.specialfolder(v=vs.110).aspx\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eWhat is the best folder / catalog for store:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003euser and password data \u003c/li\u003e\n\u003cli\u003eother application specyfic data\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003e??\u003c/p\u003e\n\n\u003cp\u003eEdit: I have found that \"Personal\" is good for me, but if you have other answers post it as well. \u003ca href=\"https://stackoverflow.com/questions/26396105/specialfolder-personal-location\"\u003eSpecialFolder.Personal location\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"47241426","answer_count":"1","comment_count":"0","creation_date":"2017-11-11 11:30:25.9 UTC","last_activity_date":"2017-11-19 14:02:46.867 UTC","last_edit_date":"2017-11-11 11:48:13.32 UTC","last_editor_display_name":"","last_editor_user_id":"1615452","owner_display_name":"","owner_user_id":"1615452","post_type_id":"1","score":"2","tags":"c#|xamarin|mobile|xamarin.forms|file-storage","view_count":"58"} +{"id":"47004286","title":"How to control spacing between words using CSS","body":"\u003cp\u003eI'm formatting a webpage that contains a bio. The word spacing is off as can be seen in the image below:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/ZyCe6.jpg\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/ZyCe6.jpg\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003ePlease advise on how I can alter my CSS to get proper word spacing:\u003c/p\u003e\n\n\u003cp\u003e\u003cdiv class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\"\u003e\r\n\u003cdiv class=\"snippet-code\"\u003e\r\n\u003cpre class=\"snippet-code-css lang-css prettyprint-override\"\u003e\u003ccode\u003e.column1 {\r\n float: left;\r\n margin-right: 40px;\r\n}\r\n\r\n.column2 {\r\n \r\n}\r\n \r\np { \r\n color: #000000; \r\n letter-spacing: normal;\r\n font-family: 'Helvetica Neue', sans-serif; \r\n font-size: 14px; \r\n line-height: 24px; \r\n margin: 0 0 24px; \r\n text-align: justify; \r\n text-justify: inter-word; \r\n}\u003c/code\u003e\u003c/pre\u003e\r\n\u003cpre class=\"snippet-code-html lang-html prettyprint-override\"\u003e\u003ccode\u003e\u0026lt;div class=\"column1\"\u0026gt; \r\n\u0026lt;img alt=\"\" src=\"/portals/2/Martin%20Profile.jpg\" style=\"width: 100px; height: 100px;\" title=\"\" /\u0026gt;\r\n\u0026lt;br\u0026gt; Apptiv Solutions\r\n\u0026lt;br\u0026gt; Founded 2015 \r\n\u0026lt;br\u0026gt; Martin Muldoon\r\n\u0026lt;br\u0026gt; Founder \r\n\u0026lt;/div\u0026gt; \r\n\r\n\u0026lt;div class=\"column2\"\u0026gt;\r\n\u0026lt;p\u0026gt;Martins introduction to the Brewing Industry first took place in 1995. While working as a Development Engineer at Trigen Energy Corporation, he was called upon to assist in the acquisition of the power plant assets of the Coors Brewery in Golden Colorado. To this day, the Coors plant is the largest single site brewery on earth providing 30% of all beer in the U.S.\u0026lt;/p\u0026gt;\r\n\u0026lt;/div\u0026gt;\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2017-10-29 19:20:15.527 UTC","last_activity_date":"2017-10-29 20:40:38.32 UTC","last_edit_date":"2017-10-29 20:40:38.32 UTC","last_editor_display_name":"","last_editor_user_id":"8815185","owner_display_name":"","owner_user_id":"5270307","post_type_id":"1","score":"0","tags":"css|html5","view_count":"26"} +{"id":"8086860","title":"PHP Prepared statements issue","body":"\u003cp\u003eI'm getting error message \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eColumn 'fname' cannot be null \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn fact it is not null. I think that there is something wrong with binding. Do I need to bind NOW() too?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$stmt = $db-\u0026gt;prepare(\"INSERT INTO `users` (`fname`, `mname`, `lname`, `email`, `pass`, `reg_dt`) VALUES (?, ?, ?, ?, ?, NOW())\") or die(htmlspecialchars($db-\u0026gt;error));\n\n$rc = $stmt-\u0026gt;bind_param(\"sssss\", $fname, $mname, $lname, $email, $pass) or die(htmlspecialchars($stmt-\u0026gt;error));\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e??\u003c/p\u003e","accepted_answer_id":"8088175","answer_count":"1","comment_count":"4","creation_date":"2011-11-10 21:52:10.087 UTC","last_activity_date":"2011-11-11 00:59:57.513 UTC","last_edit_date":"2011-11-10 23:47:55.137 UTC","last_editor_display_name":"","last_editor_user_id":"905093","owner_display_name":"","owner_user_id":"978733","post_type_id":"1","score":"0","tags":"php|mysql|mysqli|prepared-statement","view_count":"746"} +{"id":"15545383","title":"Howto pass a function to a function in Python?","body":"\u003cp\u003eI am a beginner/intermediate in Python. I have coded a \u003ca href=\"http://en.wikipedia.org/wiki/Runge%E2%80%93Kutta_methods\" rel=\"nofollow\"\u003e4th-order Runge-Kutta method (RK4)\u003c/a\u003e into Python. It is basically solving a pendulum, but that is not the point here. \u003c/p\u003e\n\n\u003cp\u003eI want to improve the RK4 method in the following way: I want to be able to pass the function f directly to the RK4 function, i.e. RK4(y_0, n, h) should become RK4(f,y_0,n,h). This would have the great advantage that I could use RK4 for other f functions that describe other systems, not just this one pendulum.\u003c/p\u003e\n\n\u003cp\u003eI have played around with just passing simple functions to RK4, but I am doing something wrong. How do I do this in Python? \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport numpy as np\n\ndef RK4(y_0, n, h):\n #4th order Runge-Kutta solver, takes as input\n #initial value y_0, the number of steps n and stepsize h\n #returns solution vector y and time vector t\n #right now function f is defined below\n\n t = np.linspace(0,n*h,n,endpoint = False) #create time vector t\n y = np.zeros((n,len(y_0))) #create solution vector y\n y[0] = y_0 #assign initial value to first position in y\n for i in range(0,n-1):\n #compute Runge-Kutta weights k_1 till k_4\n k_1 = f(t[i],y[i])\n k_2 = f(t[i] + 0.5*h, y[i] + 0.5*h*k_1)\n k_3 = f(t[i] + 0.5*h, y[i] + 0.5*h*k_2)\n k_4 = f(t[i] + 0.5*h, y[i] + h*k_3)\n #compute next y \n y[i+1] = y[i] + h / 6. * (k_1 + 2.*k_2 + 2.*k_3 + k_4)\n return t,y\n\ndef f(t,vec):\n theta=vec[0]\n omega = vec[1]\n omegaDot = -np.sin(theta) - omega + np.cos(t)\n result = np.array([omega,omegaDot]) \n return result\n\ntest = np.array([0,0.5])\nt,y = RK4(test,10,0.1)\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"15545449","answer_count":"3","comment_count":"0","creation_date":"2013-03-21 10:49:54.657 UTC","last_activity_date":"2013-03-21 10:59:17.253 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2068584","post_type_id":"1","score":"2","tags":"python|function-call|runge-kutta","view_count":"271"} +{"id":"41106448","title":"Google Analytics PHP API : get reporting","body":"\u003cp\u003eI have a professional website using Google Analytics for metrics and I try to automatize one task I used to do manually but.. not able to understand if it's possible ?!\u003c/p\u003e\n\n\u003cp\u003eI just began to using the Google PHP client library to access the Google Analytics API on my website \u003ca href=\"https://developers.google.com/analytics/devguides/reporting/core/v3/quickstart/service-php\" rel=\"nofollow noreferrer\"\u003eTest with the HelloAnalytics.php file\u003c/a\u003e is OK, I manage to connect and retrieve my data.\u003c/p\u003e\n\n\u003cp\u003eWhat i'm trying to do is :\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eGet all URLs viewed in the past 24H (what you can see when you navigate in the GA dashboard -\u003e Behavior -\u003e Site content -\u003e All pages)\u003c/li\u003e\n\u003cli\u003eCombine those datas with my custom Definition which is in fact a special token i generate for every users on my website via PHP, then send it thought with Javascript and ga('set', 'mycustomdefinition', 'my token'); \u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eIs it possible ? \nMany thanks in advance for your support !\u003c/p\u003e","accepted_answer_id":"41116442","answer_count":"1","comment_count":"1","creation_date":"2016-12-12 17:40:55.197 UTC","last_activity_date":"2016-12-13 08:20:30.883 UTC","last_edit_date":"2016-12-13 08:16:23.227 UTC","last_editor_display_name":"","last_editor_user_id":"1841839","owner_display_name":"","owner_user_id":"7286331","post_type_id":"1","score":"0","tags":"php|google-analytics|google-analytics-api|google-api-php-client","view_count":"369"} +{"id":"35815547","title":"How to center a bootstrap well?","body":"\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/b3g46.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/b3g46.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003ca href=\"https://i.stack.imgur.com/osPzb.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/osPzb.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\nI can't seem to get this well to align with the center of the page. It seems like it should be easy but I can't figure it out.\u003c/p\u003e","accepted_answer_id":"35815611","answer_count":"2","comment_count":"3","creation_date":"2016-03-05 14:54:42.22 UTC","favorite_count":"1","last_activity_date":"2016-03-05 15:01:57.3 UTC","last_edit_date":"2016-03-05 14:57:12.92 UTC","last_editor_display_name":"","last_editor_user_id":"5650878","owner_display_name":"","owner_user_id":"5650878","post_type_id":"1","score":"0","tags":"css|twitter-bootstrap","view_count":"3818"} +{"id":"46654104","title":"How to display \"arrow\" emoji in android","body":"\u003cp\u003eI was using \u003ccode\u003eTextView\u003c/code\u003e to display strings contain emoji characters. This worked for most emojis. However, for the \"Right Arrow Curving Left\" emoji (\u003ccode\u003eU+21A9\u003c/code\u003e), android seems to have two styles of this character:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/B0YhV.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/B0YhV.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e and\n\u003ca href=\"https://i.stack.imgur.com/9Vm7l.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/9Vm7l.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eIf I directly render this in a \u003ccode\u003eTextView\u003c/code\u003e using the following code,\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e View.setText(new String(Character.toChars(0x21A9)));\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe second style is displayed. Any idea how to let it display the first one?\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2017-10-09 19:59:48.353 UTC","favorite_count":"1","last_activity_date":"2017-10-09 21:54:57.913 UTC","last_edit_date":"2017-10-09 21:54:57.913 UTC","last_editor_display_name":"","last_editor_user_id":"3974530","owner_display_name":"","owner_user_id":"8539384","post_type_id":"1","score":"0","tags":"android|android-textview|emoji","view_count":"34"} +{"id":"46128711","title":"Reputation points deducted 'Serial Voting Revese'","body":"\u003cp\u003eWhy is it happening that my reputation point were reversed saying 'Serial Voting Reversed'.\u003c/p\u003e\n\n\u003cp\u003eI don't think this is a fair play with a member who is helping community and spending his time and effort. At the end he is getting this treatment.\u003c/p\u003e\n\n\u003cp\u003eAny idea how to avoid this?\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-09-09 08:30:50.947 UTC","last_activity_date":"2017-09-09 08:30:50.947 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1752595","post_type_id":"1","score":"0","tags":"points|voting","view_count":"6"} +{"id":"20600438","title":"Adobe Edge Animate and d3.js: d3.scale.range([value]) not working properly in Chrome and Safari","body":"\u003cp\u003eI'm trying to create a bar chart using Adobe Edge Animate and d3.js. \u003c/p\u003e\n\n\u003cp\u003eI'm having some difficulties with how the different browsers displays the axes. Here is a link to a d3 chart only containing axes and no data (the code is in \u003cstrong\u003ed3example2_edgeActions.js\u003c/strong\u003e):\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://www.nyhetsgrafikk.no/demo/d3example2/d3example2.html\" rel=\"nofollow\"\u003ehttp://www.nyhetsgrafikk.no/demo/d3example2/d3example2.html\u003c/a\u003e\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eMozilla Firefox and Opera: everything works\u003c/li\u003e\n\u003cli\u003eChrome and Safari: ticks are stacked on top of each other to the left \u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eI believe this has to do with d3.scale.range([value]) not working properly - all though it does set the range of the chart (when I change the range and run the code my chart is changed), the ticks are stacked on top of each other. Chrome is not returning any errors. Any ideas to how I can fix this?\u003c/p\u003e","accepted_answer_id":"21218815","answer_count":"1","comment_count":"13","creation_date":"2013-12-15 22:06:14.723 UTC","favorite_count":"1","last_activity_date":"2014-01-19 15:41:37.23 UTC","last_edit_date":"2014-01-19 15:41:37.23 UTC","last_editor_display_name":"","last_editor_user_id":"2130992","owner_display_name":"","owner_user_id":"2130992","post_type_id":"1","score":"1","tags":"javascript|d3.js|cross-browser|transform|adobe-edge","view_count":"660"} +{"id":"35582760","title":"Dagger 2 Inject Child Class","body":"\u003cp\u003eI understand that with Dagger 2 I cannot inject in a base class and expect it to carry over to the child class. But why can I not call inject inside of a child class unless I explicitly have an \u003ccode\u003einject\u003c/code\u003e method for that class?\u003c/p\u003e\n\n\u003cp\u003eI tried following the example in this article: \u003ca href=\"https://blog.gouline.net/2015/05/04/dagger-2-even-sharper-less-square/\" rel=\"nofollow noreferrer\"\u003eDagger 2: Even Sharper, Less Square\u003c/a\u003e. This solution should allow me to call inject in a subclass, but when I test it I get a \u003ccode\u003eNullPointerException\u003c/code\u003e for all of my \u003ccode\u003e@Inject\u003c/code\u003e targets.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic abstract class BaseFragment extends Fragment {\n\n @Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n injectComponent(MyApplication.getComponent());\n }\n\n protected abstract void injectComponent(AppComponent component);\n}\n\npublic class MyFragment extends BaseFragment {\n\n @Inject MyDependency mDependency;\n\n @Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n mDependency.doSomething(); // NullPointerException\n ...\n }\n\n ...\n\n @Override\n public void injectComponent(AppComponent component) {\n component.inject(this);\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs there another way to inject into each subclass without creating an inject method for each an every class? Or is that the only way Dagger 2 will work? If that is the case, I will end up with an absurdly long \u003ccode\u003eComponent\u003c/code\u003e class. With an inject method for every \u003ccode\u003eActivity\u003c/code\u003e, \u003ccode\u003eFragment\u003c/code\u003e or various other helper classes:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@Singleton @Component(modules = {AppModule.class})\npublic interface AppComponent {\n\n void inject(MyClass clazz);\n\n void inject(MyClass2 clazz);\n\n ...\n\n void inject(MyClassN clazz);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI would much rather have to call \u003ccode\u003ecomponent.inject()\u003c/code\u003e in every class, than have to do that along with another \u003ccode\u003einject\u003c/code\u003e method.\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003eAlthough similar, I do not believe my question is a duplicate \u003ca href=\"https://stackoverflow.com/questions/29367921/dagger-2-activity-injection-not-working\"\u003eDagger 2 Activity Injection Not Working\u003c/a\u003e. That question asks why the injection was not working, to which the answer would be: because Dagger 2 has a strong type-association and you must declare an \u003ccode\u003einject\u003c/code\u003e method for each and every class. This question focuses more on a way around the boilerplate, while hopefully maintaining strong type-association.\u003c/p\u003e","answer_count":"1","comment_count":"5","creation_date":"2016-02-23 16:24:03.827 UTC","last_activity_date":"2016-02-23 19:57:49.313 UTC","last_edit_date":"2017-05-23 12:34:15.037 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"5115932","post_type_id":"1","score":"3","tags":"java|android|dependency-injection|subclass|dagger-2","view_count":"1536"} +{"id":"37382828","title":"How to add JSF Implementation Libraries?","body":"\u003cp\u003eI'm using TomEE. I was under impression that TomEE already has the \u003ccode\u003eJSF IMplementation Libraries\u003c/code\u003e. \u003c/p\u003e\n\n\u003cp\u003eSo when create an Eclipse project, I follow the documentation and choose \u003ca href=\"http://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.jst.jsf.doc.user%2Fhtml%2Freference%2Fjsf_library_management.html\" rel=\"nofollow noreferrer\"\u003eLibrary Provided By Target Runtime\u003c/a\u003e \u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/NUU9Y.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/NUU9Y.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eIt reads \u003ccode\u003ethis facet requires jsf implementation library to be present on project classpath. By disabling library configuration, user takes on responsibility of configuring classpath appropriately via alternate means\u003c/code\u003e \u003c/p\u003e\n\n\u003cp\u003eSo I go ahead and add all the bundled jars that come with TomEE \u003ccode\u003e...\\apache-tomee-webprofile-1.7.4\\lib\u003c/code\u003e (this includes \u003ccode\u003emyfaces-api-2.1.17.jar\u003c/code\u003e and \u003ccode\u003emyfaces-impl-2.1.17.jar\u003c/code\u003e) \u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003eThen I \u003ccode\u003eRun on Server\u003c/code\u003e the following test \u003ccode\u003exhtml\u003c/code\u003e . \u003cstrong\u003eBut it renders a blank page.\u003c/strong\u003e Obviously, the \u003ccode\u003exhtml\u003c/code\u003e was not compiled. So the bundled TomEE jars did NOT kick in. How can I make those bundled TomEE jars compile my test \u003ccode\u003exhtml\u003c/code\u003e ? \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;!DOCTYPE html\u0026gt;\n\u0026lt;html lang=\"en\"\n xmlns=\"http://www.w3.org/1999/xhtml\"\n xmlns:h=\"http://xmlns.jcp.org/jsf/html\"\n xmlns:a=\"http://xmlns.jcp.org/jsf/passthrough\"\u0026gt;\n\n \u0026lt;h:head\u0026gt;\n \u0026lt;title\u0026gt;Hello World - Input Form\u0026lt;/title\u0026gt;\n \u0026lt;/h:head\u0026gt;\n \u0026lt;h:body\u0026gt;\n\n \u0026lt;h:form\u0026gt;\n \u0026lt;h:inputText id=\"name\" value=\"#{theUserName}\" \n a:placeholder=\"What's your name?\" /\u0026gt;\n\n \u0026lt;h:commandButton value=\"Submit\" action=\"myresponse\" /\u0026gt;\n \u0026lt;/h:form\u0026gt;\n\n \u0026lt;/h:body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"7","creation_date":"2016-05-23 04:49:37.327 UTC","last_activity_date":"2016-05-23 13:49:01.193 UTC","last_edit_date":"2016-05-23 13:49:01.193 UTC","last_editor_display_name":"","last_editor_user_id":"5437138","owner_display_name":"","owner_user_id":"5437138","post_type_id":"1","score":"0","tags":"eclipse|jsf|tomee","view_count":"296"} +{"id":"31968261","title":"How to validate 17 digits in array of VIN numbers from form in php?","body":"\u003cp\u003eI have the following validation code that runs after my form is submitted:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eforeach ($_POST['vin']) as $vin_value ) {\nif(strlen($vin_value) != 17) {\necho \"VIN is not 17 digits\"; \necho \"VIN is \" . strlen($vin_value) . \" digits\";\necho \"VIN value is: \" . $vin_value;\n} else {\nmail($admin_email, \"Auto Quote Request\", $email_body);\necho \"Thank you for contacting us!\";\n}\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am trying to make sure the individual vin's ($vin_value) of my vin[] array are exactly 17 digits. Right now when I submit the form no message is displayed at all. What's going on here?? And I realize this code just checks for characters, not digits. Thanks.\u003c/p\u003e\n\n\u003cp\u003ehtml form input:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"form-group\"\u0026gt;\n \u0026lt;label for=\"inputVIN\" class=\"col-lg-2 control-label\"\u0026gt;Vehicle Identification Number\u0026lt;/label\u0026gt;\n \u0026lt;div class=\"col-lg-10\"\u0026gt;\n \u0026lt;input class=\"form-control\" id=\"inputVIN\" placeholder=\"Must be 17 digits.\" type=\"text\" name=\"vin[]\"\u0026gt;\n\n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe input is an array. This is to accommodate the possibility of multiple vin numbers. There is an option to add another form field with the name of vin[]. All the inputs relevant to this question have name=\"vin[]\" . To reiterate, at first there is one form group with name=vin[], but the user can click a button to add more. This is why I am using an array in the first place. So I want each element in the array (the $vin_value)to contain exactly 17 characters. That is why I am using a foreach. I hope that provides enough context.\u003c/p\u003e","accepted_answer_id":"31968390","answer_count":"1","comment_count":"22","creation_date":"2015-08-12 14:34:41.727 UTC","last_activity_date":"2015-08-12 16:50:18.927 UTC","last_edit_date":"2015-08-12 16:50:18.927 UTC","last_editor_display_name":"","last_editor_user_id":"5198569","owner_display_name":"","owner_user_id":"5198569","post_type_id":"1","score":"-4","tags":"php","view_count":"119"} +{"id":"28751030","title":"Cannot retrieve django serialized json using javascript","body":"\u003cp\u003eHi I am parsing serialzed json -\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef wall_copy(request):\n posts = user_post.objects.order_by('id')[:20].reverse()\n posts_serialized = serializers.serialize('json', posts)\n return JsonResponse(posts_serialized, safe=False)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand trying to get data as-\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(document).ready(function()\n {\n setInterval(function() \n {\n var xhr = new XMLHttpRequest();\n xhr.open(\"GET\",\"http://10.8.21.17:8000/wall/wall_copy/\",false);\n xhr.send(null);\n var data = JSON.parse(xhr.responseText);\n //alert(xhr.status+' '+xhr.statusText);\n for(i=0; i\u0026lt;20; i++)\n {\n alert(data[i].post_content);\n }\n }, 3000);\n });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut the problem is that every time it alerts as 'Undefined'. I checked the url and the server is sending json data but I am unable to fetch it.\u003c/p\u003e\n\n\u003cp\u003eJson data-\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\"[{\\\"fields\\\": {\\\"post_id\\\": \\\"rahularyan06:16PM on February 26, 2015\\\", \\\"posted_by\\\": \\\"rahularyan\\\", \\\"post_content\\\": \\\"koi nhi re\\\", \\\"time_of_post\\\": \\\"2015-02-26T18:16:00Z\\\"}, \\\"model\\\": \\\"wall.user_post\\\", \\\"pk\\\": 77}, {\\\"fields\\\": {\\\"post_id\\\": \\\"aquaman06:00PM on February 26, 2015\\\", \\\"posted_by\\\": \\\"aquaman\\\", \\\"post_content\\\": \\\"kuch nhi\\\", \\\"time_of_post\\\": \\\"2015-02-26T18:00:44Z\\\"}, \\\"model\\\": \\\"wall.user_post\\\", \\\"pk\\\": 76}, {\\\"fields\\\": {\\\"post_id\\\": \\\"rahularyan06:00PM on February 26, 2015\\\", \\\"posted_by\\\": \\\"rahularyan\\\", \\\"post_content\\\": \\\"kya hua??\\\", \\\"time_of_post\\\": \\\"2015-02-26T18:00:04Z\\\"}, \\\"model\\\": \\\"wall.user_post\\\", \\\"pk\\\": 75}, {\\\"fields\\\": {\\\"post_id\\\": \\\"aquaman12:01AM on February 26, 2015\\\", \\\"posted_by\\\": \\\"aquaman\\\", \\\"post_content\\\": \\\"lelo\\\", \\\"time_of_post\\\": \\\"2015-02-26T00:01:14Z\\\"}, \\\"model\\\": \\\"wall.user_post\\\", \\\"pk\\\": 74}, {\\\"fields\\\": {\\\"post_id\\\": \\\"aquaman10:41AM on February 25, 2015\\\", \\\"posted_by\\\": \\\"aquaman\\\", \\\"post_content\\\": \\\"sahi me lega??\\\", \\\"time_of_post\\\": \\\"2015-02-25T10:41:43Z\\\"}, \\\"model\\\": \\\"wall.user_post\\\", \\\"pk\\\": 73}, {\\\"fields\\\": {\\\"post_id\\\": \\\"aquaman10:41AM on February 25, 2015\\\", \\\"posted_by\\\": \\\"aquaman\\\", \\\"post_content\\\": \\\"sahi me lega??\\\", \\\"time_of_post\\\": \\\"2015-02-25T10:41:34Z\\\"}, \\\"model\\\": \\\"wall.user_post\\\", \\\"pk\\\": 72}, {\\\"fields\\\": {\\\"post_id\\\": \\\"shreyansh10:41AM on February 25, 2015\\\", \\\"posted_by\\\": \\\"shreyansh\\\", \\\"post_content\\\": \\\"yo\\\", \\\"time_of_post\\\": \\\"2015-02-25T10:41:17Z\\\"}, \\\"model\\\": \\\"wall.user_post\\\", \\\"pk\\\": 71}, {\\\"fields\\\": {\\\"post_id\\\": \\\"aquaman10:40AM on February 25, 2015\\\", \\\"posted_by\\\": \\\"aquaman\\\", \\\"post_content\\\": \\\"muh me lega??\\\", \\\"time_of_post\\\": \\\"2015-02-25T10:40:53Z\\\"}, \\\"model\\\": \\\"wall.user_post\\\", \\\"pk\\\": 70}, {\\\"fields\\\": {\\\"post_id\\\": \\\"aquaman10:40AM on February 25, 2015\\\", \\\"posted_by\\\": \\\"aquaman\\\", \\\"post_content\\\": \\\"bc\\\", \\\"time_of_post\\\": \\\"2015-02-25T10:40:42Z\\\"}, \\\"model\\\": \\\"wall.user_post\\\", \\\"pk\\\": 69}, {\\\"fields\\\": {\\\"post_id\\\": \\\"shreyansh10:40AM on February 25, 2015\\\", \\\"posted_by\\\": \\\"shreyansh\\\", \\\"post_content\\\": \\\"lele\\\", \\\"time_of_post\\\": \\\"2015-02-25T10:40:28Z\\\"}, \\\"model\\\": \\\"wall.user_post\\\", \\\"pk\\\": 68}, {\\\"fields\\\": {\\\"post_id\\\": \\\"aquaman10:39AM on February 25, 2015\\\", \\\"posted_by\\\": \\\"aquaman\\\", \\\"post_content\\\": \\\"kya bhai??\\\", \\\"time_of_post\\\": \\\"2015-02-25T10:39:39Z\\\"}, \\\"model\\\": \\\"wall.user_post\\\", \\\"pk\\\": 67}, {\\\"fields\\\": {\\\"post_id\\\": \\\"aquaman10:38AM on February 25, 2015\\\", \\\"posted_by\\\": \\\"aquaman\\\", \\\"post_content\\\": \\\"sb mast\\\", \\\"time_of_post\\\": \\\"2015-02-25T10:38:22Z\\\"}, \\\"model\\\": \\\"wall.user_post\\\", \\\"pk\\\": 66}, {\\\"fields\\\": {\\\"post_id\\\": \\\"shreyansh10:38AM on February 25, 2015\\\", \\\"posted_by\\\": \\\"shreyansh\\\", \\\"post_content\\\": \\\"or baaki??\\\", \\\"time_of_post\\\": \\\"2015-02-25T10:38:05Z\\\"}, \\\"model\\\": \\\"wall.user_post\\\", \\\"pk\\\": 65}, {\\\"fields\\\": {\\\"post_id\\\": \\\"aquaman10:03AM on February 25, 2015\\\", \\\"posted_by\\\": \\\"aquaman\\\", \\\"post_content\\\": \\\"badiya\\\", \\\"time_of_post\\\": \\\"2015-02-25T10:03:39Z\\\"}, \\\"model\\\": \\\"wall.user_post\\\", \\\"pk\\\": 64}, {\\\"fields\\\": {\\\"post_id\\\": \\\"shreyansh10:03AM on February 25, 2015\\\", \\\"posted_by\\\": \\\"shreyansh\\\", \\\"post_content\\\": \\\"thik ba\\\", \\\"time_of_post\\\": \\\"2015-02-25T10:03:23Z\\\"}, \\\"model\\\": \\\"wall.user_post\\\", \\\"pk\\\": 63}, {\\\"fields\\\": {\\\"post_id\\\": \\\"aquaman10:00AM on February 25, 2015\\\", \\\"posted_by\\\": \\\"aquaman\\\", \\\"post_content\\\": \\\"kaisan??\\\", \\\"time_of_post\\\": \\\"2015-02-25T10:00:30Z\\\"}, \\\"model\\\": \\\"wall.user_post\\\", \\\"pk\\\": 62}, {\\\"fields\\\": {\\\"post_id\\\": \\\"aquaman10:00AM on February 25, 2015\\\", \\\"posted_by\\\": \\\"aquaman\\\", \\\"post_content\\\": \\\"hi\\\", \\\"time_of_post\\\": \\\"2015-02-25T10:00:04Z\\\"}, \\\"model\\\": \\\"wall.user_post\\\", \\\"pk\\\": 61}, {\\\"fields\\\": {\\\"post_id\\\": \\\"aquaman09:58AM on February 25, 2015\\\", \\\"posted_by\\\": \\\"aquaman\\\", \\\"post_content\\\": \\\"abe jldi likh\\\", \\\"time_of_post\\\": \\\"2015-02-25T09:58:43Z\\\"}, \\\"model\\\": \\\"wall.user_post\\\", \\\"pk\\\": 60}, {\\\"fields\\\": {\\\"post_id\\\": \\\"aquaman09:57AM on February 25, 2015\\\", \\\"posted_by\\\": \\\"aquaman\\\", \\\"post_content\\\": \\\"hello\\\", \\\"time_of_post\\\": \\\"2015-02-25T09:57:49Z\\\"}, \\\"model\\\": \\\"wall.user_post\\\", \\\"pk\\\": 59}, {\\\"fields\\\": {\\\"post_id\\\": \\\"shreyansh09:39AM on February 25, 2015\\\", \\\"posted_by\\\": \\\"shreyansh\\\", \\\"post_content\\\": \\\"lele\\\", \\\"time_of_post\\\": \\\"2015-02-25T09:39:39Z\\\"}, \\\"model\\\": \\\"wall.user_post\\\", \\\"pk\\\": 58}]\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHelp me how can I get this data through javascript.\u003c/p\u003e\n\n\u003cp\u003eThanks in advance.\u003c/p\u003e","accepted_answer_id":"28751159","answer_count":"2","comment_count":"2","creation_date":"2015-02-26 19:23:39.833 UTC","last_activity_date":"2015-02-26 21:10:13.503 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4428377","post_type_id":"1","score":"1","tags":"javascript|json|django","view_count":"254"} +{"id":"5584533","title":"sorl-thumbnail: resize original image before saving?","body":"\u003cp\u003eUsing sorl-thumbnail v11.01 and an ImageField on my model is there a simple way to have an uploaded file resized before saving it (to avoid saving a massive image, in case one has been uploaded)? Thanks in advance.\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2011-04-07 16:40:19.483 UTC","last_activity_date":"2012-09-12 05:35:52.213 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"313472","post_type_id":"1","score":"3","tags":"django|image-processing|django-models|sorl-thumbnail","view_count":"1205"} +{"id":"44239788","title":"MySQL Failover error \"Missing gtid_executed system variable\"","body":"\u003cp\u003eI have done a GTID replication in MySQL 5.7.18, I have setup the fail over both master and slave health is good. When I am trying to down master I am getting this error. \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eFailover starting in 'auto' mode...\n 2017-05-29 14:53:56 PM CRITICAL The server IP :3306 does not comply to the latest GTID feature support. Errors:\n Missing gtid_executed system variable.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eSo I googled, they were telling to check global variable and variable which I don't understand. This is my master status of \u003ccode\u003egtid_exe\u003c/code\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emysql\u0026gt; show variables like '%**gtid_exe%'**;\n\n+----------------------------------+-------+\n| Variable_name | Value |\n+----------------------------------+-------+\n| gtid_executed_compression_period | 1000 |\n+----------------------------------+-------+\n1 row in set (0.00 sec)\n\n\nmysql\u0026gt; show global variables like '%**gtid_exe%**';\n\n+----------------------------------+-------------------------------------------------+\n| Variable_name | Value |\n+----------------------------------+-------------------------------------------------+\n| **gtid_executed** | c6b90b56-4084-11e7-8af7-00163e4da2ba:1-26006378 |\n| gtid_executed_compression_period | 1000 |\n+----------------------------------+-------------------------------------------------+\n2 rows in set (0.01 sec)\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-05-29 10:06:01.243 UTC","favorite_count":"1","last_activity_date":"2017-05-29 12:31:33.18 UTC","last_edit_date":"2017-05-29 12:31:33.18 UTC","last_editor_display_name":"","last_editor_user_id":"13317","owner_display_name":"","owner_user_id":"8059939","post_type_id":"1","score":"1","tags":"mysql","view_count":"13"} +{"id":"36010062","title":"Inserting a line of text at the beginning of an Access export","body":"\u003cp\u003eI would like to export Access query results to a text file with some added string in the first line of exported file. \u003c/p\u003e\n\n\u003cp\u003eSpecifically, I would like to combine a text string:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e *Abc def\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewith the Access query results (tab delimited): \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eDoCmd.TransferText acExportDelim, \"Export_spec\", \"Export\", \"C:\\export.txt\", True, \"\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand then save it as a text file.\u003c/p\u003e\n\n\u003cp\u003eThe text string have to be in the first line of the text file, followed by access query results. \u003c/p\u003e\n\n\u003cp\u003eThe results should looks like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e*Abc def\nHeader1 Header2 Header3 Header4 ...\nValue1 Value2 Value3 Value4 ...\n... ... ... ... ...\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-03-15 11:29:21.363 UTC","favorite_count":"0","last_activity_date":"2016-03-15 13:38:09.443 UTC","last_edit_date":"2016-03-15 13:38:09.443 UTC","last_editor_display_name":"","last_editor_user_id":"2144390","owner_display_name":"","owner_user_id":"6066007","post_type_id":"1","score":"1","tags":"vba|ms-access|access-vba","view_count":"84"} +{"id":"3126162","title":"Is this a good architecture / design concept for handling/manipulating file uploads?","body":"\u003cp\u003eI'm looking at adding multi-file uploading to our \u003ccode\u003eASP.NET MVC\u003c/code\u003e web application. I am going to use the \u003ca href=\"http://www.aurigma.com/\" rel=\"nofollow noreferrer\"\u003e3rd Party Multi-File uploader Aurigma\u003c/a\u003e to handle the actual uploading. \u003c/p\u003e\n\n\u003cp\u003eOnce each file is 100% received by the web server, it needs to be checked for the following\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eis it an image or video.\u003c/li\u003e\n\u003cli\u003eif it's an image, does it need to be resized? if so, resize.\u003c/li\u003e\n\u003cli\u003eif it's a video, we need to re-encode it to flash (unfortunately.. bring on html5 :) )\u003c/li\u003e\n\u003cli\u003efinally, store on S3 amazon.\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eSo i know how to do most of steps 1 to 4 - that's not the question.\u003c/p\u003e\n\n\u003cp\u003eMy question is: \u003cstrong\u003ehow should I really be handling this workflow\u003c/strong\u003e? Especially if i get a bulk of media at once -\u003e after all, this is a \u003cem\u003emulti-file\u003c/em\u003e uploader :) I don't want to have lots of media getting processed at once (eg. 5 video's getting encoded to flash..).\u003c/p\u003e\n\n\u003cp\u003eSo I thought i might have \u003ccode\u003eMSMQ\u003c/code\u003e installed and when each file gets 100% recieved, then pop it into \u003ccode\u003eMSMQ\u003c/code\u003e. That way, only one item is getting \u003cem\u003eprocessed\u003c/em\u003e at once. The cost of this, is that if there's a lot of \u003cem\u003eexpensive\u003c/em\u003e processing, the queue might actually start to get a few items in there ... and there will be some waiting period from the time an item is uploaded to the site, until it's actually 100% processed. We can easily handle this in the UI to tell them it's not finished yet.\u003c/p\u003e\n\n\u003cp\u003eSo - does this sound like an OK way to handle this problem?\u003c/p\u003e\n\n\u003cp\u003eSecondly, this is in a web farm scenario .. so installation / deployment / maintenance needs to be considered.\u003c/p\u003e\n\n\u003cp\u003eWould love to see what other people are thinking. \u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2010-06-27 02:23:24.31 UTC","last_activity_date":"2010-06-27 03:39:47.223 UTC","last_edit_date":"2010-06-27 03:39:47.223 UTC","last_editor_display_name":"","last_editor_user_id":"30674","owner_display_name":"","owner_user_id":"30674","post_type_id":"1","score":"0","tags":"design|architecture|file-upload|queue|msmq","view_count":"671"} +{"id":"24212122","title":"Curl header request returning 404 but body returning 200","body":"\u003cp\u003eI'm sending a header request with curl using the following code \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction getContentType($u)\n{\n $ch = curl_init();\n $url = $u;\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HEADER, 1);\n curl_setopt($ch, CURLOPT_NOBODY, 1);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_AUTOREFERER, true);\n curl_setopt($ch, CURLOPT_USERAGENT, \"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20100101 Firefox/7.0.12011-10-16 20:23:00\");\n\n $results = split(\"\\n\", trim(curl_exec($ch)));\n print_r($results);\n foreach($results as $line) {\n if (strtok($line, ':') == 'Content-Type') {\n $parts = explode(\":\", $line);\n return trim($parts[1]);\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFor most websites it is returning correctly, although for some servers it is returning a 404 error when the page is actually available. I'm assuming this is because the servers have been configured to reject the header request. \u003c/p\u003e\n\n\u003cp\u003eI'm looking for a way to bypass this server header request rejection, or a way to tell if the header request has been rejected and is not in fact 404. \u003c/p\u003e","accepted_answer_id":"24212203","answer_count":"1","comment_count":"0","creation_date":"2014-06-13 18:52:35.603 UTC","last_activity_date":"2014-06-13 18:57:42.843 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"290957","post_type_id":"1","score":"1","tags":"php|curl|http-headers|content-type","view_count":"789"} +{"id":"6986948","title":"Efficient approach to load XML and read it when needed using c#/.net 3.5","body":"\u003cp\u003eI want to know the efficient way to store the configuration xml to be used in the program. I want to load the following config xml into memory as soon as I start the program and then use the properties where needed.\nXML:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;ViewModelConfiguration\u0026gt;\n \u0026lt;FICallSchedule\u0026gt;\n \u0026lt;Model\u0026gt;\n \u0026lt;Details\u0026gt;\n \u0026lt;DataSource\u0026gt;\n \u0026lt;Dataset se-datafilter=\"callschedule\" dv-datamanipulationrequired=\"false\" dv-filtercondition=\"\" dv-sortcolumn=\"\" dv-gettopNrows=\"\" /\u0026gt;\n \u0026lt;XmlData\u0026gt;\u0026lt;/XmlData\u0026gt;\n \u0026lt;/DataSource\u0026gt;\n \u0026lt;ComputePercentage isactive=\"true\" dataorientation=\"horizontal\"\u0026gt;\n \u0026lt;column source=\"value1\" destination=\"value3\" datafilter=\"\" /\u0026gt;\n \u0026lt;column source=\"value2\" destination=\"value4\" datafilter=\"\" /\u0026gt;\n \u0026lt;/ComputePercentage\u0026gt;\n \u0026lt;/Details\u0026gt;\n \u0026lt;/Model\u0026gt;\n \u0026lt;/FICallSchedule\u0026gt;\n\u0026lt;/ViewModelConfiguration\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCurrently I am reading the main tags like \u003ccode\u003e\u0026lt;Dataset\u0026gt;\u003c/code\u003e and load all the attributes of it in dictionary object. And then use that dictionary with key in my code. Similarly I do it for ComputePercentage and so on and so forth.\u003c/p\u003e\n\n\u003cp\u003eI was wondering if I can load the complete XML into some object and access each node or attribute something like: \u003ccode\u003eModel.Details.Dataset.DataSource.se-datafilter\u003c/code\u003e or \u003ccode\u003eModel.Details.ComputePercentage\u003c/code\u003e which will return a collection of columns. I am not sure if this makes any sense otherwise I would stick to dictionary objects only.\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2011-08-08 18:43:20.267 UTC","last_activity_date":"2011-08-08 19:16:27.067 UTC","last_edit_date":"2011-08-08 19:16:27.067 UTC","last_editor_display_name":"","last_editor_user_id":"465876","owner_display_name":"","owner_user_id":"465876","post_type_id":"1","score":"1","tags":"c#|xml|.net-3.5","view_count":"131"} +{"id":"35908532","title":"jQuery UI Datepicker hiding previous months","body":"\u003cp\u003eI'm trying to create 12 months jquery UI Datepicker with date range selection.\nI'm using \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enumberOfMonths: [12,1],\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhich is working fine\nProblem is when i try to select two dates between two months (March,15,2016 to April,15,2016) calendar wills start from April i cant edit previous month dates, i want to keep 12 months in every condition in short i need 12 months jquery datepicker which can select two dates. my code is\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div id=\"jrange\" class=\"dates\"\u0026gt;\n \u0026lt;input type=\"text\" id=\"startDate\" size=\"10\" placeholder=\"9 Mar\" readonly\u0026gt;\n \u0026lt;span id=\"spaceDash\"\u0026gt;\u0026amp;#8211;\u0026lt;/span\u0026gt;\n \u0026lt;input type=\"text\" id=\"endDate\" size=\"10\" placeholder=\"10 Mar\" readonly\u0026gt;\n \u0026lt;div\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n$(document).ready(function(){\n$(\"#jrange div\").datepicker({\n minDate: 0,\n numberOfMonths: [12,1],\n dateFormat: \"MM dd\",\n showMonthAfterYear: true,\n beforeShowDay: function(date) {\n var date1 = $.datepicker.parseDate($(this).datepicker(\"option\", \"dateFormat\"), $(\"#startDate\").val());\n var date2 = $.datepicker.parseDate($(this).datepicker(\"option\", \"dateFormat\"), $(\"#endDate\").val());\n return [true, date1 \u0026amp;\u0026amp; ((date.getTime() == date1.getTime()) || (date2 \u0026amp;\u0026amp; date \u0026gt;= date1 \u0026amp;\u0026amp; date \u0026lt;= date2)) ? \"dp-highlight\" : \"\"];\n\n },\n onSelect: function(dateText, inst) {\n var date1 = $.datepicker.parseDate($(this).datepicker(\"option\", \"dateFormat\"), $(\"#startDate\").val());\n\n var date2 = $.datepicker.parseDate($(this).datepicker(\"option\", \"dateFormat\"), $(\"#endDate\").val());\n if (!date1 || date2) {\n $(\"#input1\").val(dateText);\n $(\"#input2\").val(\"\");\n $(this).datepicker(\"option\", \"minDate\", dateText);\n } else {\n $(\"#input2\").val(dateText);\n $(this).datepicker(\"option\", \"minDate\", null);\n }\n }\n});\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"2","creation_date":"2016-03-10 05:45:15.04 UTC","last_activity_date":"2016-03-10 05:45:15.04 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2025404","post_type_id":"1","score":"0","tags":"javascript|jquery|jquery-ui-datepicker","view_count":"240"} +{"id":"2116073","title":"Change color of an anchor when clicked","body":"\u003cp\u003ei want that when i click this link its color changes to the given color\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;li id=\"press\"\u0026gt;\u0026lt;a href=\"\u0026lt;?=base_url()?\u0026gt;index.php/page/press\"\u0026gt;Press\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"4","comment_count":"2","creation_date":"2010-01-22 08:58:47.09 UTC","last_activity_date":"2013-05-27 14:47:38.763 UTC","last_edit_date":"2010-01-22 10:29:17.27 UTC","last_editor_display_name":"","last_editor_user_id":"167735","owner_display_name":"","owner_user_id":"256565","post_type_id":"1","score":"6","tags":"javascript|html|css","view_count":"11509"} +{"id":"31655255","title":"Storing and querying location (coords) in PostgreSQL","body":"\u003cp\u003eIn my user schema I have a location column which will hold the last updated coordinates of the user. Is there a PostgreSQL data type I could use to allow me to run SQL queries to search, for example something like: \u003ccode\u003eSELECT username FROM Users WHERE currentLocation=\"20 Miles Away From $1\"\u003c/code\u003e\u003c/p\u003e","accepted_answer_id":"31656341","answer_count":"1","comment_count":"0","creation_date":"2015-07-27 14:02:33.007 UTC","last_activity_date":"2015-07-27 14:50:57.697 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4305280","post_type_id":"1","score":"0","tags":"sql|postgresql|location","view_count":"27"} +{"id":"3903598","title":"What's a good shuffle percentage?","body":"\u003cp\u003eI'm basically new to coding for random results, but did some reading and tested out the javascript version of the Fisher-Yates algorithm (as seen on wikipedia), with an ordered list.\u003c/p\u003e\n\n\u003cp\u003eI ended up adding code to make sure the array was shuffled differently than its initial order, and also calculated the percentage of how many objects were shuffled to a different position by the algorithm.\u003c/p\u003e\n\n\u003cp\u003eSo I'm wondering what might be considered a good result. Kind of a generic question. If I shuffled a deck of cards, what would be the least acceptable amount of shuffle? Right now I have mine coded to repeat the algorithm if it comes out less than 25 percent shuffled.\u003c/p\u003e\n\n\u003cp\u003eWhat do you think?\u003c/p\u003e","answer_count":"3","comment_count":"1","creation_date":"2010-10-11 04:52:08.89 UTC","favorite_count":"0","last_activity_date":"2010-10-14 01:14:26.17 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"471935","post_type_id":"1","score":"4","tags":"arrays|algorithm","view_count":"168"} +{"id":"13384124","title":"How to migrate database from SAP DB to PostGres?","body":"\u003cp\u003eAny idea how to go about doing that through a tool(preferred). Any alternate ways to do that.\u003c/p\u003e","answer_count":"2","comment_count":"1","creation_date":"2012-11-14 17:35:18.15 UTC","last_activity_date":"2012-11-19 22:28:21.503 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"731433","post_type_id":"1","score":"0","tags":"postgresql|migration|sap","view_count":"820"} +{"id":"18988561","title":"how to integrate Paypal Express checkout using new method?","body":"\u003cp\u003eI want to integrate PAYPAL EXPRESS CHECKOUT in my project. I think PAYPAL has upgraded the APIs and its methods. I downloaded REST API from Github but I am not able to figure out how to integrate it. All i get is confused. Because in that REST zip I downloaded there are so many files and I was not able to understand how can i integrate express checkout with the new API and method. Also I have gone through many of the sites with the examples but as soon as I execute them I get an error 10001. Please help.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-09-24 17:48:11.013 UTC","last_activity_date":"2013-12-17 15:29:02.25 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1960411","post_type_id":"1","score":"0","tags":"paypal","view_count":"756"} +{"id":"26341233","title":"ng-flow - no destination directory option","body":"\u003cp\u003eI am using ng-flow in my application and it works pretty well. Currently, the destination directory for the files being uploaded is set in my web.config and used within my webapi controller method.\u003c/p\u003e\n\n\u003cp\u003eWhat I want to do is allow the user to specify the destination, rather than it come from config. However, looking at the \u003ca href=\"https://github.com/flowjs/flow.js/blob/master/README.md\" rel=\"nofollow\"\u003edocs\u003c/a\u003e, I don't see an option that I can add to the below appconfig for this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction appConfig(flowFactoryProvider) {\nflowFactoryProvider.defaults = {\n target: 'api/upload',\n permanentErrors: [404, 500, 501],\n maxChunkRetries: 1,\n chunkRetryInterval: 5000,\n simultaneousUploads: 4\n};\nflowFactoryProvider.on('catchAll', function (event) {\n console.log('catchAll', arguments);\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e}\u003c/p\u003e\n\n\u003cp\u003eAm i missing something or do I need to handle this myself?\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2014-10-13 13:31:27.403 UTC","last_activity_date":"2015-04-13 08:43:15.543 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1005609","post_type_id":"1","score":"1","tags":"angularjs|angularjs-directive|flow-js","view_count":"361"} +{"id":"40931444","title":"spark embedded (same JVM) for \u003c400k text file process","body":"\u003cp\u003eCan we do a mini spark job embedded in our app? Any example? Reason : want to process part of a file and give results quicker than submitting a regular job. File is only 500 lines. But do not want to keep 2 code bases - just the one that is used for the large files too. File size is less than an MB.\u003c/p\u003e\n\n\u003cp\u003eI want to process the file in the same JVM that my client code is running. Want a single executor kicked off from within same JVM, via a flag in the config. (so a few jobs will have this flag set and others wont. Those that do not will run as usual on the cluster.)\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2016-12-02 11:43:51.687 UTC","favorite_count":"1","last_activity_date":"2016-12-02 18:59:07.85 UTC","last_edit_date":"2016-12-02 18:59:07.85 UTC","last_editor_display_name":"","last_editor_user_id":"1643558","owner_display_name":"","owner_user_id":"1643558","post_type_id":"1","score":"1","tags":"apache-spark","view_count":"23"} +{"id":"38223491","title":"Can I configure settings in UWP app desktop scanner?","body":"\u003cp\u003eI have had good success in getting input from a flatbed scanner in my UWP app \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eusing Windows.Devices.Enumeration;\nusing Windows.Devices.Scanners;\n\nImageScanner myScanner = await ImageScanner.FromIdAsync(deviceId);\nvar result = await myScanner.ScanFilesToFolderAsync(ImageScannerScanSource.Default, folder);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand even make use of the auto configured scan profile\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eif (myScanner.IsScanSourceSupported(ImageScannerScanSource.AutoConfigured))\n{\n ...\n // Scan API call to start scanning with Auto-Configured settings. \n var result = await myScanner.ScanFilesToFolderAsync(\n ImageScannerScanSource.AutoConfigured, folder).AsTask(cancellationToken.Token, progress);\n ...\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut is there any way that I can control the configuration, get a lower resolution or just B\u0026amp;W? All of the format options appear to be read only properties. I have tried to make an external scanner profile in Win10 but it isn't picked up (even when it is the default). The API appears to be aware of the scanner supported settings because the ScanToStream equivalent call reads in lowest possible resolution as a preview.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-07-06 12:00:56.09 UTC","last_activity_date":"2016-07-11 04:58:25.88 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6555901","post_type_id":"1","score":"0","tags":".net|uwp|resolution|scanning","view_count":"110"} +{"id":"31867819","title":"MySQL - Delete a selection","body":"\u003cp\u003eI am trying to delete all the accounts associated with IPs that are used more than two times in my MyBB database. The following code works to \"select\" these users.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT * FROM `mybb_forumusers` WHERE `regip` IN (\n SELECT `regip` FROM `mybb_forumusers`\n GROUP BY `regip`\n HAVING COUNT( `regip` ) \u0026gt; 2\n)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, I cannot successfully delete all of these users without getting errors. I have tried the following (and variations):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eDELETE FROM `mybb_forumusers` WHERE `uid` IN (\n SELECT `uid` FROM `mybb_forumusers` WHERE `regip`IN (\n SELECT `regip` FROM `mybb_forumusers`\n GROUP BY `regip`\n HAVING COUNT( `regip` ) \u0026gt; 2\n )\n)\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"31867845","answer_count":"1","comment_count":"1","creation_date":"2015-08-07 00:23:34.04 UTC","last_activity_date":"2015-08-07 00:26:32.227 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4506174","post_type_id":"1","score":"2","tags":"mysql|sql|database|mybb","view_count":"32"} +{"id":"24985153","title":"Autolayout ambiguity with inequalities","body":"\u003cp\u003eI'm confused about how Cocoa's Autolayout determines whether a layout is ambiguous. Here's a simple example:\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/2oDN2.png\" alt=\"Layout\"\u003e\u003c/p\u003e\n\n\u003cp\u003eThe observed behavior is as follows. The spacers to the left and right of the green rectangle are always the same width. When you stretch the superview horizontally outwards, the spacers stick to 80 while the rectangle expands. When you shrink the superview horizontally, the rectangle sticks to 398 while the spacers shrink to 10, after which the rectangle continues to shrink. At no point is the layout labeled ambiguous by IB.\u003c/p\u003e\n\n\u003cp\u003eHowever, you'll notice that the horizontal layout is defined almost entirely by inequalities! From what I can see, when the rectangle has a width of \u003e 398, there's no reason for the spacers to have a width of 80. They could have a width of anywhere from 10 to 80 and still satisfy each horizontal inequality. That sounds ambiguous to me, but IB clearly does not agree.\u003c/p\u003e\n\n\u003cp\u003eThere must be some implicit rule I'm missing. Please help me out!\u003c/p\u003e","answer_count":"1","comment_count":"19","creation_date":"2014-07-27 20:07:53.58 UTC","last_activity_date":"2014-12-22 19:35:45.75 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"89812","post_type_id":"1","score":"0","tags":"ios|cocoa|user-interface|interface-builder|autolayout","view_count":"1126"} +{"id":"46566115","title":"Javasript onclick not working","body":"\u003cp\u003eI tried a whole bunch of things from:\u003c/p\u003e\n\n\u003cp\u003eIt works in normal browser. Does not work on mobile.\u003c/p\u003e\n\n\u003cp\u003eHowever nothing seems to work.\u003c/p\u003e\n\n\u003cp\u003eI tried to do it in different ways but I could not make it. I am waiting for help from friends who have knowledge about the subject.\u003c/p\u003e\n\n\u003cp\u003eHere's what I have:\u003c/p\u003e\n\n\u003cp\u003e\u003cdiv class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\"\u003e\r\n\u003cdiv class=\"snippet-code\"\u003e\r\n\u003cpre class=\"snippet-code-js lang-js prettyprint-override\"\u003e\u003ccode\u003e function processAjax(kat,div)\r\n {\r\nif(div==1)\r\n{\r\n$('#DivCat1').hide('slow', function() {});\r\n$('#DivCat2').hide('slow', function() {});\r\n$('#DivCat3').hide('slow', function() {});\r\n$('#DivCat4').hide('slow', function() {});\r\n$('#DivCat5').hide('slow', function() {});\r\n$('#DivCat6').hide('slow', function() {});\r\n$('#DivCat7').hide('slow', function() {});\r\n}\r\nif(div==2)\r\n{\r\n$('#DivCat3').hide('slow', function() {});\r\n$('#DivCat4').hide('slow', function() {});\r\n$('#DivCat5').hide('slow', function() {});\r\n$('#DivCat6').hide('slow', function() {});\r\n$('#DivCat7').hide('slow', function() {});\r\n}\r\nif(div==3)\r\n{\r\n$('#DivCat4').hide('slow', function() {});\r\n$('#DivCat5').hide('slow', function() {});\r\n$('#DivCat6').hide('slow', function() {});\r\n$('#DivCat7').hide('slow', function() {});\r\n}\r\nif(div==4)\r\n{\r\n$('#DivCat5').hide('slow', function() {});\r\n$('#DivCat6').hide('slow', function() {});\r\n$('#DivCat7').hide('slow', function() {});\r\n}\r\nif(div==5)\r\n{\r\n$('#DivCat6').hide('slow', function() {});\r\n$('#DivCat7').hide('slow', function() {});\r\n}\r\nif(div==6)\r\n{\r\n$('#DivCat7').hide('slow', function() {});\r\n}\r\nif(div==7)\r\n{\r\n$('#DivCat8').hide('slow', function() {});\r\n}\r\n$('#DivCat'+div).show('slow', function() {});\r\n$('#DivCat'+div).load('katgetir.php?kat='+kat+'\u0026amp;div='+div);\r\n\r\n$('#change').animate({scrollLeft : 500},'slow');\r\n}\u003c/code\u003e\u003c/pre\u003e\r\n\u003cpre class=\"snippet-code-html lang-html prettyprint-override\"\u003e\u003ccode\u003e\u0026lt;select multiple class=\"form-control\"\u0026gt; \r\n\r\n\r\n \u0026lt;option id=\"45\" onclick=\"processAjax(45,1)\"\u0026gt;Kat\u0026lt;/option\u0026gt;\r\n\r\n\r\n\r\n\u0026lt;/select\u0026gt;\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003c/p\u003e\n\n\u003cp\u003eWhat might I be doing wrong?\u003c/p\u003e\n\n\u003cp\u003eHow do I get this code to work on mobile too?\u003c/p\u003e","accepted_answer_id":"46567004","answer_count":"1","comment_count":"4","creation_date":"2017-10-04 13:25:54.97 UTC","last_activity_date":"2017-10-04 14:07:45.613 UTC","last_edit_date":"2017-10-04 13:30:40.813 UTC","last_editor_display_name":"","last_editor_user_id":"1835379","owner_display_name":"","owner_user_id":"8720219","post_type_id":"1","score":"0","tags":"javascript|jquery|html|android-layout|mobile","view_count":"62"} +{"id":"16610502","title":"jenkins - error while deploying tomcat war - curl: (56) Recv failure","body":"\u003cp\u003eI setup jenkins on one ec2 machine \u0026amp; deploying war file on second ec2 machine. from jenkins when I am sending following command.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ehttp://username:password@ec-machine-address:8080/manager/text/undeploy?path=/\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ejenkins running in infinite loop. When I try same command on terminal I receive following error.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecurl: (56) Recv failure: Connection reset by peer\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt was working fine some time back \u0026amp; I deployed war 6-7 times. But suddenly I am receiving this error. I dont think, I change in jenkins setup. So maybe this is something to do with server blocking request from jenkins ec2. Not sure though whats problem.\u003c/p\u003e","accepted_answer_id":"16634796","answer_count":"1","comment_count":"0","creation_date":"2013-05-17 13:37:50.533 UTC","last_activity_date":"2013-05-19 12:46:51.723 UTC","last_edit_date":"2013-05-17 22:14:34.14 UTC","last_editor_display_name":"","last_editor_user_id":"638052","owner_display_name":"","owner_user_id":"638052","post_type_id":"1","score":"0","tags":"ubuntu|curl|jenkins|ubuntu-12.04","view_count":"574"} +{"id":"5962836","title":"how to fix the precision for lat/lng?","body":"\u003cp\u003ewith the v2 version we can fix the precision with toFixed\nexample: point.y.toFixed(4)\nhow can we do with the v3 version ?\u003c/p\u003e","accepted_answer_id":"5962908","answer_count":"1","comment_count":"0","creation_date":"2011-05-11 10:34:24.993 UTC","last_activity_date":"2011-05-11 10:40:24.463 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"525406","post_type_id":"1","score":"2","tags":"google-maps-api-3","view_count":"2212"} +{"id":"47407642","title":"Docker image for TFS Xamarin Android build agent?","body":"\u003cp\u003eWe are building \u003ccode\u003eXamarin.Android\u003c/code\u003e projects on \u003ccode\u003eTFS\u003c/code\u003e (on-premise).\u003c/p\u003e\n\n\u003cp\u003eWith every \u003ccode\u003eVisual Studio\u003c/code\u003e / \u003ccode\u003eAndroid SDK\u003c/code\u003e update we have to update all our build agents.\nIs there a way to simplify this process? \u003c/p\u003e\n\n\u003cp\u003eThere are some \u003ca href=\"https://hub.docker.com/r/microsoft/vsts-agent/\" rel=\"nofollow noreferrer\"\u003evsts-agent images\u003c/a\u003e available, but none of them are for xamarin. There are some \u003ca href=\"https://hub.docker.com/r/nathansamson/xamarin-android-docker/\" rel=\"nofollow noreferrer\"\u003examarin\u003c/a\u003e-\u003ca href=\"https://hub.docker.com/r/tstivers/xamarin-android-build/\" rel=\"nofollow noreferrer\"\u003erelated\u003c/a\u003e images, but they are a bit out of date (and not related to TFS).\u003c/p\u003e\n\n\u003cp\u003eIs there anything I'm missing? Any other solutions to the problem?\u003c/p\u003e","accepted_answer_id":"47425943","answer_count":"1","comment_count":"2","creation_date":"2017-11-21 07:36:49.247 UTC","last_activity_date":"2017-11-22 02:40:18.297 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"291695","post_type_id":"1","score":"0","tags":"c#|xamarin|tfs","view_count":"35"} +{"id":"44087897","title":"YouTube Embed feature for looping single videos isn't working","body":"\u003cp\u003eLoop feature is not working.\u003ca href=\"https://www.youtube.com/embed/X03jlFijeQ0?autoplay=1\u0026amp;controls=0\u0026amp;disablekb=1\u0026amp;fs=0\u0026amp;modestbranding=1\u0026amp;showinfo=0\u0026amp;loop=1\" rel=\"nofollow noreferrer\"\u003eExample\u003c/a\u003e\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-05-20 15:50:19.53 UTC","last_activity_date":"2017-06-12 00:19:41.197 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"8041234","post_type_id":"1","score":"-2","tags":"youtube-iframe-api","view_count":"60"} +{"id":"9063556","title":"How to stop the UIScrollView get touch events from its parent view?","body":"\u003cp\u003eI have a \u003ccode\u003eUIView\u003c/code\u003e containing a \u003ccode\u003eUIScrollView\u003c/code\u003e.\nThis \u003ccode\u003eUIView\u003c/code\u003e is supposed to respond to some touch events but it is not responding because of the scrollView it contains.\u003c/p\u003e\n\n\u003cp\u003eThis scrollView's \u003ccode\u003econtentView\u003c/code\u003e is set to a MoviePlayer inside the OuterView.\nNow whenever I click in the area where the MoviePlayer is, touch events of my OuterView are not responding.\u003c/p\u003e\n\n\u003cp\u003eI have even set the movie player's \u003ccode\u003euserInteraction\u003c/code\u003e to \u003ccode\u003eNO\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003ebut now scrollView is interfering it seems. \u003c/p\u003e\n\n\u003cp\u003eI have referred to this post on SO itself.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://stackoverflow.com/questions/1673903/how-can-a-superview-interecept-a-touch-sequence-before-any-of-its-subviews\"\u003eHow can a superview interecept a touch sequence before any of its subviews?\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eBut the solution there, asks me to set the \u003ccode\u003euserInteractionEnabled\u003c/code\u003e to \u003ccode\u003eNO\u003c/code\u003e for the scrollView\nBut if I do so, my pinch zoom doesn't take place either!\u003c/p\u003e\n\n\u003cp\u003eWhat to do?\u003c/p\u003e","accepted_answer_id":"9063862","answer_count":"1","comment_count":"0","creation_date":"2012-01-30 12:01:39.943 UTC","last_activity_date":"2012-01-30 12:28:15.703 UTC","last_edit_date":"2017-05-23 11:45:20.137 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"961021","post_type_id":"1","score":"3","tags":"objective-c|ios|cocoa-touch","view_count":"1658"} +{"id":"19966171","title":"Get value in a post request, Django","body":"\u003cp\u003eam getting the following post data in my django app\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ePOST\n Variable Value\n csrfmiddlewaretoken u'LHM3nkrrrrrrrrrrrrrrrrrrrrrrrrrdd'\n id u'{\"docs\":[],\"dr\":1, \"id\":4, \"name\":\"Group\", \"proj\":\"/al/p1/proj/2/\", \"resource\":\"/al/p1/dgroup/4/\",\"route\":\"group\", \"parent\":null'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eam trying to get the \u003ccode\u003eid\u003c/code\u003e value in variable \u003ccode\u003eid\u003c/code\u003e i.e \u003ccode\u003e\"id\":4\u003c/code\u003e (the value \u003ccode\u003e4\u003c/code\u003e). When I do \u003ccode\u003erequest.POST.get('id')\u003c/code\u003eI get the whole json string. \u003ccode\u003eu'{\"docs\":[],\"dr\":1, \"id\":4, \"name\":\"Group\", \"proj\":\"/al/p1/proj/2/\", \"resource\":\"/al/p1/dgroup/4/\",\"route\":\"group\", \"parent\":null'\u003c/code\u003e How can I get the \u003ccode\u003e\"id\"\u003c/code\u003e in the string? \u003c/p\u003e","accepted_answer_id":"19966271","answer_count":"2","comment_count":"0","creation_date":"2013-11-13 22:53:34.383 UTC","favorite_count":"1","last_activity_date":"2013-11-13 23:16:39.237 UTC","last_edit_date":"2013-11-13 23:16:39.237 UTC","last_editor_display_name":"","last_editor_user_id":"1860261","owner_display_name":"","owner_user_id":"1860261","post_type_id":"1","score":"0","tags":"django|string|unicode|django-forms|django-views","view_count":"537"} +{"id":"25426899","title":"Outlook interop difference between Email1address and IMAddress","body":"\u003cp\u003eI'm currently using interop to get all local contacts out of outlook. When I first programmed the programm I used the following code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Microsoft.Office.Interop.Outlook.Application outlookHandler = new Microsoft.Office.Interop.Outlook.Application();\n Microsoft.Office.Interop.Outlook.Items outlookItemsCollection;\n MAPIFolder folderContacts = (MAPIFolder)outlookHandler.Session.GetDefaultFolder(OlDefaultFolders.olFolderContacts);\n outlookItemsCollection = folderContacts.Items;\n\n foreach (var outlookItem in outlookItemsCollection)\n {\n ContactItem contactItem = outlookItem as ContactItem;\n //...do something \n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eTo get all contacts. now I've had some troubles with the emailaddress where I usedEMail1Address. I got some strange notation back from there that had not much to do with the mail address I'm looking for: \"/o=Companyname/ou=City/cn=Department/cn=x.xyz\" with the last part being the first part of the mail address. But when I then instead used contactItem.IMAddress I got the mail address as I had originally expected for Email1Address.\u003c/p\u003e\n\n\u003cp\u003eSo my question is: Why is there this differnce and should IMAddress be used instead of Email1Address or am I overlooking here something?\u003c/p\u003e","accepted_answer_id":"25428157","answer_count":"1","comment_count":"0","creation_date":"2014-08-21 12:55:28.767 UTC","last_activity_date":"2014-08-21 14:15:57.137 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1381478","post_type_id":"1","score":"0","tags":"c#|outlook|office-interop","view_count":"207"} +{"id":"46849638","title":"Can't Find Cordova Plugin Documentations","body":"\u003cp\u003eI have been facing this issue for some time and it started to drive me crazy. Plugin references on the official page doesn't show all capabilites, function and constant definitions and enough examples. I collect information about these functions from other websites. But where do they get those definitions? For example description for cordova-plugin-file on the official website is simply useless. Can anyone enlighten me about this?\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2017-10-20 13:01:48.16 UTC","last_activity_date":"2017-10-20 13:01:48.16 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7553822","post_type_id":"1","score":"0","tags":"cordova|hybrid-mobile-app","view_count":"15"} +{"id":"15099676","title":"jQuery: add css to parent","body":"\u003cp\u003eI have the following HTML:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"control-group\"\u0026gt;\n \u0026lt;input value=\"\" id=\"email\" name=\"email\" type=\"text\" placeholder=\"E-mail\"/\u0026gt; \u0026lt;span class=\"help-inline\"\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd the follow jQuery:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar input = $(this);\n\n$.getJSON(\"/email\", { email: data }, function(json){\n if(json.valid == true){\n input.parent().addClass(\"success\");\n }\n });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow can I add the class 'success' to the div control-group? Also, how can I add content to the help-inline span?\u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","accepted_answer_id":"15099820","answer_count":"1","comment_count":"0","creation_date":"2013-02-26 21:31:24.513 UTC","last_activity_date":"2013-02-26 21:38:04.753 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1893187","post_type_id":"1","score":"0","tags":"jquery","view_count":"54"} +{"id":"39433161","title":"Facebook graph's safe average request time not to get rate limited","body":"\u003cp\u003eI was running some queries using Facebook graph php sdk and noticed in my dashboard showing little bit high average requests time of \u003cstrong\u003e3,206ms\u003c/strong\u003e for some queries with respect to other queries.Is that high? What is the safe request time that we should maintain not to get rate limited ?\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2016-09-11 05:26:52.933 UTC","last_activity_date":"2016-09-11 05:26:52.933 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6613764","post_type_id":"1","score":"0","tags":"facebook|facebook-graph-api|facebook-php-sdk","view_count":"36"} +{"id":"41487519","title":"Palette de-selected in Android Studio","body":"\u003cp\u003eI have already tried out maximising the window but it doesn't work unfortunately (Based on the discussions from the previous posts). Is there any way to get back the palette?\u003c/p\u003e\n\n\u003cp\u003eThe previous question that is being asked is linked here\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://stackoverflow.com/questions/19550594/how-re-enable-design-palette-in-android-studio\"\u003eHow re-enable design palette in Android Studio\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eIn the View-\u003eTool Windows, the Palette is inactivated here and is not clickable for some unknown reason.\u003c/p\u003e\n\n\u003cp\u003eI attach a screenshot herewith\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/E2d7n.png\" rel=\"nofollow noreferrer\"\u003eScreenshot\u003c/a\u003e\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2017-01-05 14:27:49.657 UTC","favorite_count":"1","last_activity_date":"2017-01-06 13:53:20.317 UTC","last_edit_date":"2017-05-23 12:08:59.223 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"7379638","post_type_id":"1","score":"1","tags":"android|android-studio","view_count":"49"} +{"id":"39644145","title":"what are the different ways of dictionary declaration in swift","body":"\u003cp\u003ewhat is the difference between\n1. \u003ccode\u003evar dict : [Int:String] = [:]\u003c/code\u003e , \n2. \u003ccode\u003evar dict2 : [Int:String]\u003c/code\u003e and\u003cbr\u003e\n3. \u003ccode\u003evar dict3 = Dictionary\u0026lt;Int,String\u0026gt;()\u003c/code\u003e . \u003c/p\u003e\n\n\u003cp\u003eAnyone help me to understand what is the difference?\u003c/p\u003e","accepted_answer_id":"39644441","answer_count":"1","comment_count":"0","creation_date":"2016-09-22 16:19:33.937 UTC","last_activity_date":"2016-11-19 18:34:25.51 UTC","last_edit_date":"2016-11-19 18:34:25.51 UTC","last_editor_display_name":"","last_editor_user_id":"5716829","owner_display_name":"user6847532","post_type_id":"1","score":"0","tags":"ios|swift|dictionary","view_count":"48"} +{"id":"11006649","title":"Why is NuGet forcing an upgrade of a dependency that's already met?","body":"\u003cp\u003eI'm trying to install Spring.Testing.NUnit with NuGet, and it's forcing me to update a dependency, even though I already have an acceptable version. It's not even updating it to the latest version, which is 2.6.0.\u003c/p\u003e\n\n\u003cp\u003eI can install with \u003ccode\u003e-IgnoreDependencies\u003c/code\u003e, but when I do, I error out running tests with the error \u003ccode\u003eCould not load file or assembly 'nunit.framework, Version=2.6.0.12051\u003c/code\u003e\nIs the Spring.Testing.NUnit package wrong about what version of NUnit it requires?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ePM\u0026gt; Install-Package NUnit -Version 2.5.7.10213\n'NUnit 2.5.7.10213' already installed.\nSuccessfully added 'NUnit 2.5.7.10213' to Services.Tests.Unit.\n\nPM\u0026gt; Install-Package Spring.Testing.NUnit\nAttempting to resolve dependency 'Common.Logging (= 1.2.0)'.\nAttempting to resolve dependency 'NUnit (= 2.5.7)'.\nAttempting to resolve dependency 'Spring.Core (= 1.3.2)'.\nAttempting to resolve dependency 'Spring.Data (= 1.3.2)'.\nAttempting to resolve dependency 'Spring.Aop (= 1.3.2)'.\nSuccessfully installed 'NUnit 2.5.10.11092'.\nSuccessfully installed 'Spring.Testing.NUnit 1.3.2'.\nSuccessfully removed 'NUnit 2.5.7.10213' from Services.Tests.Unit.\nSuccessfully added 'NUnit 2.5.10.11092' to Services.Tests.Unit.\nSuccessfully added 'Spring.Testing.NUnit 1.3.2' to Services.Tests.Unit.\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"11010064","answer_count":"1","comment_count":"0","creation_date":"2012-06-13 00:21:18.99 UTC","last_activity_date":"2012-06-13 07:27:52.037 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1431252","post_type_id":"1","score":"1","tags":"spring|nunit|nuget","view_count":"159"} +{"id":"30906726","title":"implement search function to listview in fragments","body":"\u003cp\u003eI'm setting some values taken from a database i created into a listview. The listview is populated correctly.Now i want to implement a search function to my listview. How can i do this? I've already created search bar layout.I've referred to many tutorials but could not get it done.\u003c/p\u003e\n\n\u003cp\u003eMy class\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class StockWatchView extends Fragment {\n\n private ListView mListView;\n private LazyListViewAdapter mAdapter;\n private EditText search;\n\n\n @Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n\n\n View view = inflater.inflate(R.layout.stock_watchlist_view, container, false);\n\n mListView = (ListView) view.findViewById(R.id.listview);\n search = (EditText) view.findViewById(R.id.search);\n\n\n Toast.makeText(StockWatchView.this.getActivity(), \"Do Background Service\", Toast.LENGTH_LONG).show();\n\n DBHandler dbHandler = new DBHandler(StockWatchView.this.getActivity(), null, null, 0);\n\n ArrayList\u0026lt;BaseElement\u0026gt; items = dbHandler.getAllPric();\n\n if (items.size() != 0) {\n mAdapter = new LazyListViewAdapter(items, StockWatchView.this.getActivity(), ListElement.PRICE_LIST.getPosition());\n\n mListView.setAdapter(mAdapter);\n\n Toast.makeText(this.getActivity(), \"Toast \" + dbHandler.getLastUpdateTime(), Toast.LENGTH_LONG).show();\n\n } else {\n\n\n //new BackgroundService().execute();\n\n\n }\n\n search.addTextChangedListener(new TextWatcher() {\n\n @Override\n public void afterTextChanged(Editable arg0) {\n // TODO Auto-generated method stub\n\n }\n\n @Override\n public void beforeTextChanged(CharSequence arg0, int arg1,\n int arg2, int arg3) {\n // TODO Auto-generated method stub\n }\n\n @Override\n public void onTextChanged(CharSequence arg0, int arg1, int arg2,\n int arg3) {\n\n\n }\n // TODO Auto-generated method stub\n\n });\n return view;\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"1","creation_date":"2015-06-18 04:56:12.177 UTC","last_activity_date":"2015-06-18 10:08:54.49 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3899126","post_type_id":"1","score":"1","tags":"android|search|android-fragments|android-listview","view_count":"704"} +{"id":"28073567","title":"Reduce the gray scale bit representation of a pixel in C#","body":"\u003cp\u003eI am sorry if the question in the header is not descriptive enough. But, basically what my problem is the following. \nI am taking Bitmap and making it gray scale. It works nice if i do not reduce the number of bits and I still use 8 bits. However, the point of the hw I have is to show how the image changes when I reduce the number of bits holding the information. In the example bellow I am reducing the binary string to 4 bits and then rebuilding the image again. The problem is that the image becomes black. I think is because the image has mostly gray values (in the 80's range) and when I am reducing the binary string I am left with black image only. It seems to me that i heave to check for lower and high gray scale values and then make the more light-gray go to white and dark gray go to black. In the end with 1 bit representation I should only have black and white image.Any idea how can i do that separation?\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Bitmap bmpIn = (Bitmap)Bitmap.FromFile(\"c:\\\\test.jpg\");\n var grayscaleBmp = MakeGrayscale(bmpIn);\n\n public Bitmap MakeGrayscale(Bitmap original)\n {\n //make an empty bitmap the same size as original\n Bitmap newBitmap = new Bitmap(original.Width, original.Height);\n for (int i = 0; i \u0026lt; original.Width; i++)\n {\n for (int j = 0; j \u0026lt; original.Height; j++)\n {\n //get the pixel from the original image\n Color originalColor = original.GetPixel(i, j);\n //create the grayscale version of the pixel\n int grayScale = (int)((originalColor.R * .3) + (originalColor.G * .59)\n + (originalColor.B * .11));\n\n //now turn it into binary and reduce the number of bits that hold information \n byte test = (byte) grayScale;\n string binary = Convert.ToString(test, 2).PadLeft(8, '0');\n string cuted = binary.Remove(4);\n var converted = Convert.ToInt32(cuted, 2);\n\n //create the color object\n Color newColor = Color.FromArgb(converted, converted, converted);\n\n //set the new image's pixel to the grayscale version\n newBitmap.SetPixel(i, j, newColor);\n }\n }\n return newBitmap;\n }\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"5","creation_date":"2015-01-21 17:43:52.63 UTC","last_activity_date":"2015-01-22 05:16:54.273 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1564341","post_type_id":"1","score":"-1","tags":"c#|image|image-processing|bitmap","view_count":"325"} +{"id":"33550125","title":"Python - CSV module to write certain rows to new file","body":"\u003cp\u003eI've got a small issue. I'm trying to create a script that takes large (~2gb) csv files (id, integer, integer), sorts them by the first integer and then writes, to a new file, the top x rows (as defined by the user).\u003c/p\u003e\n\n\u003cp\u003eI'm able to get the sort function to work as required and extracting the top X rows works also but I can't work out how to get this output to write to a csv.\nTo check it has been working, I have included a print function and it all seems to work out fine.\u003c/p\u003e\n\n\u003cp\u003eI feel like I'm missing a really basic concept in the csv module but I can't work out what it is!\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport csv\nimport operator\n\ndef csv_to_list(csv_file, delimiter=','):\n\n with open(csv_file, 'r') as csv_con:\n reader = csv.reader(csv_con, delimiter=delimiter)\n return list(reader)\n\ndef sort_by_column(csv_cont, col, reverse=True):\n\n header = csv_cont[1]\n body = csv_cont[1:]\n if isinstance(col, str): \n col_index = header.index(col)\n else:\n col_index = col\n body = sorted(body, \n key=operator.itemgetter(col_index), \n reverse=reverse)\n #body.insert(0, header)\n return body\n\ndef print_csv(csv_content):\n for row in csv_content:\n row = [str(e) for e in row]\n print('\\t'.join(row))\n\ndef write_csv(dest, csv_cont):\n with open(dest, 'w') as out_file:\n writer = csv.writer(out_file, delimiter=',')\n for row in csv_cont:\n writer.writerow(row)\n\ncsv_cont = csv_to_list(input_hep.csv)\nrow_count = sum(1 for row in csv_cont)\nnum_rows = int(input(\"Skim size?: \"))\noutput_file = input(\"Output: \")\n\ncsv_sorted = sort_by_column(csv_cont, 1)\nfor row in range(num_rows):\n print(csv_sorted[row])\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy main idea was to try:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ewith open(output_file+'.csv','w') as f:\n writer = csv.writer(f, delimiter =',')\n for row in range(num_rows):\n writer.writerow(row)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut then I get a \"_csv.Error: iterable expected, not int\" error. I get why but I'm struggling to understand how I can get the output (as it is printed) to write within a csv.\nAny tips or pointers would be appreciated.\u003c/p\u003e","accepted_answer_id":"33551730","answer_count":"3","comment_count":"0","creation_date":"2015-11-05 16:42:17.24 UTC","last_activity_date":"2015-11-05 18:06:56.96 UTC","last_edit_date":"2015-11-05 16:55:59.737 UTC","last_editor_display_name":"","last_editor_user_id":"5433043","owner_display_name":"","owner_user_id":"5433043","post_type_id":"1","score":"1","tags":"python|csv|python-3.x","view_count":"3177"} +{"id":"31911467","title":"Does AppCode implement all the functionality of CLion","body":"\u003cp\u003eThe AppCode IDE home page states that:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eAppCode natively supports Objective-C, Swift,\n \u003cstrong\u003eC and C++,\u003c/strong\u003e including C++11, libc++ and Boost, as well as JavaScript,\n XML, HTML, CSS and XPath. Use your preferred language to create your\n iOS/OS X application.\u003c/p\u003e\n \n \u003cp\u003e\u003ca href=\"https://www.jetbrains.com/objc/\" rel=\"nofollow\"\u003ehttps://www.jetbrains.com/objc/\u003c/a\u003e\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eThe CLion IDE is also meant for C and C++ but AppCode handles more languages.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eDoes AppCode implement all the functionality of CLion?\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eA yes answer I would think means it is better to go with AppCode. An explanation against this is appreciated if you disagree.\u003c/p\u003e\n\n\u003cp\u003eNote: I have not yet used AppCode.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-08-10 04:05:35.483 UTC","last_activity_date":"2015-08-18 10:48:34.27 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"417896","post_type_id":"1","score":"4","tags":"ide|clion|jetbrains|appcode","view_count":"1041"} +{"id":"11255543","title":"Using Spine.Model.Ajax, how to handle extra properties in the responsed JSON when model updated","body":"\u003cp\u003eFor example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass User extends Spine.Controller\n @configure 'User', 'name'\n @extend Spine.Model.Ajax\n @url: '/save'\n\nuser = new User(name: 'test')\nuser.save()\n\nUser.bind 'update', (item) -\u0026gt;\n console.log(item.flag) # undefined\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003esay '/save' response \u003ccode\u003e{flag: 0}\u003c/code\u003e because of some database error, when Ajax finished, Spine trigger the update event and update the \u003ccode\u003euser\u003c/code\u003e model, but there is no \u003ccode\u003eflag\u003c/code\u003e property extended to \u003ccode\u003euser\u003c/code\u003e when updated. So, how can I handle this situation when I need to response some extra data that is a little different from model?\u003c/p\u003e","accepted_answer_id":"12172067","answer_count":"1","comment_count":"0","creation_date":"2012-06-29 03:06:44.927 UTC","last_activity_date":"2012-08-29 06:31:37.19 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"581094","post_type_id":"1","score":"0","tags":"javascript|spine.js","view_count":"288"} +{"id":"16975443","title":"SQL Storage logic between two dates","body":"\u003cp\u003eI would really like to have your help. I'm getting the following problem.\u003c/p\u003e\n\n\u003cp\u003eI have a products store app, that a I input two dates (\u003ccode\u003eDATETIME\u003c/code\u003e), the initial and the final date.\u003c/p\u003e\n\n\u003cp\u003eAnd a I need to validate all the exceptions, for example:\u003c/p\u003e\n\n\u003cp\u003eI reserved an item from \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e15:00 to 17:00.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eThen I CAN'T reserve this item during this time.\u003c/p\u003e\n\n\u003cp\u003eHere go some examples: \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eFrom 14:00 to 16:00 [ no ]\u003cbr\u003e\n From 15:00 to 16:00 [ no ]\u003cbr\u003e\n From 16:00 to 18:00 [ no ]\u003cbr\u003e\n From 12:00 to 14:00 [ yes ]\u003cbr\u003e\n From 17:00 to 19:00 [ yes ]\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eLook this code, that's what I already could do. (noob).\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSET @START = DATE('2013-06-06 15:30:00');\nSET @FINAL = DATE('2013-06-06 16:00:00');\n\nINSERT INTO `store` (`start_date`, `final_date`) VALUES ('2013-06-06 15:00:00', '2013-06-06 17:00:00');\nSELECT IF(COUNT(*) \u0026gt; 0, 'NO', 'YES') FROM `Store` WHERE\n (`start_date` BETWEEN @START AND @FINAL); -- OUTPUT 'NO'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWith this code I resolve the problem that I can validate what's BETWEEN the two dates, but if one of the dates informed are out of those ranges it fails.\u003c/p\u003e\n\n\u003cp\u003eRemembering that I can use a backend language to help too.\u003c/p\u003e\n\n\u003cp\u003eThank you \u003c/p\u003e","answer_count":"1","comment_count":"5","creation_date":"2013-06-07 02:44:15.233 UTC","last_activity_date":"2013-06-07 03:13:03.147 UTC","last_edit_date":"2013-06-07 03:07:23.517 UTC","last_editor_display_name":"","last_editor_user_id":"2461924","owner_display_name":"","owner_user_id":"2461924","post_type_id":"1","score":"1","tags":"php|mysql|sql|algorithm|logic","view_count":"93"} +{"id":"44939556","title":"NameError: name 'hasattr' is not defined - Python3.6, Django1.11, Ubuntu16-17, Apache2.4, mod_wsgi","body":"\u003cp\u003eI've set up my Python/Django virtual environment, and mod_wsgi in daemon mode, and am pretty sure (done this before) it's \"\u003cem\u003emostly correct\u003c/em\u003e\" except I get the following error... \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[Thu Jul 06 00:35:26.986363 2017] [mpm_event:notice] [pid 11442:tid 140557758930432] AH00493: SIGUSR1 received. Doing graceful restart\nException ignored in: \u0026lt;object repr() failed\u0026gt;\nTraceback (most recent call last):\n File \"/home/jamin/www/dev.tir.com/py361ve/lib/python3.6/site-packages/PIL/Image.py\", line 572, in __del__\nNameError: name 'hasattr' is not defined\n[Thu Jul 06 00:35:27.194483 2017] [mpm_event:notice] [pid 11442:tid 140557758930432] AH00489: Apache/2.4.25 (Ubuntu) mod_wsgi/4.5.15 Python/3.6 configured -- resuming normal operations\n[Thu Jul 06 00:35:27.194561 2017] [core:notice] [pid 11442:tid 140557758930432] AH00094: Command line: '/usr/sbin/apache2'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy django app itself is loading fine through wsgi.py but it seems something to do with core python (error with my setup likely) is going wrong as per: \u003ccode\u003eNameError: name 'hasattr' is not defined\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eIn the browser - I get a plain \"Server Error (500)\" page and not the standard Apache \"Internal Server Error\" page.\u003c/p\u003e\n\n\u003cp\u003eLeaving out my VirtualHost and steps beyond here are the basic steps I put together for myself if you can spot anything... (I've tried all the different python packages as well not just -venv)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eInstall Python 3.6 and virtualenv\n sudo apt-get update\n sudo apt-get install python3.6-venv\n sudo apt-get install virtualenv\n(or find the latest and greatest python package that includes pip https://packages.ubuntu.com/ )\n\n\nInstall Apache2\n sudo apt-get install apache2 apache2-dev\n\n\nMake and enter a folder for your project - then build a Virtual Environment in it\n mkdir ~/example.com\n cd ~/example.com\n virtualenv --python=/usr/bin/python3.6 py361ve\n\nEnter your new Virtual Environment to install packages to it\n source py361ve/bin/activate\n\nInstall Django, mod_wsgi, and any other needed packages\n pip install django\n pip install mod_wsgi\n pip install ...\n(no need for pip3 in virtual environment - django should be the latest release)\n\n\nRun following command and place output in apache config file ( in /etc/apache2/ )\n mod_wsgi-express module-config\n\n\nExit your virtual environment\n deactivate\n(You can re-enter your virtual environment any time using the source method in step 8)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere's what happens when I stop/start/restart apache2...\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eapache2 stop...\n\n[Thu Jul 06 06:01:34.190940 2017] [mpm_event:notice] [pid 2015:tid 140157449797120] AH00491: caught SIGTERM, shutting down\n_______________________________________________________________\napache2 start...\n\n[Thu Jul 06 06:02:39.076741 2017] [mpm_event:notice] [pid 2181:tid 140553545080320] AH00489: Apache/2.4.25 (Ubuntu) mod_wsgi/4.5.15 Python/3.6 configured -- resuming $\n[Thu Jul 06 06:02:39.076890 2017] [core:notice] [pid 2181:tid 140553545080320] AH00094: Command line: '/usr/sbin/apache2'\n_______________________________________________________________\napache2 restart...\n\nException ignored in: \u0026lt;object repr() failed\u0026gt;\nTraceback (most recent call last):\n File \"/home/jamin/www/dev.tir.com/py361ve/lib/python3.6/site-packages/PIL/Image.py\", line 572, in __del__\nNameError: name 'hasattr' is not defined\n[Thu Jul 06 06:05:43.307877 2017] [mpm_event:notice] [pid 2181:tid 140553545080320] AH00491: caught SIGTERM, shutting down\n[Thu Jul 06 06:05:43.492499 2017] [mpm_event:notice] [pid 2301:tid 140353155558912] AH00489: Apache/2.4.25 (Ubuntu) mod_wsgi/4.5.15 Python/3.6 configured -- resuming $\n[Thu Jul 06 06:05:43.492705 2017] [core:notice] [pid 2301:tid 140353155558912] AH00094: Command line: '/usr/sbin/apache2'\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"0","creation_date":"2017-07-06 03:57:38.497 UTC","last_activity_date":"2017-07-06 06:08:51.87 UTC","last_edit_date":"2017-07-06 06:08:51.87 UTC","last_editor_display_name":"","last_editor_user_id":"1840601","owner_display_name":"","owner_user_id":"1840601","post_type_id":"1","score":"0","tags":"python|django|python-3.x|ubuntu|mod-wsgi","view_count":"336"} +{"id":"13567809","title":"String XML to JSON conversion in .NET without using XmlDocument","body":"\u003cp\u003eI'm trying to find a more memory efficient solution for converting XML string to JSON string (and vice versa)\nwithout using \u003cstrong\u003eXmlDocument\u003c/strong\u003e.\u003c/p\u003e\n\n\u003cp\u003eCurrently, all 3rd party libraries i tried, expects XmlDocument as input.\u003c/p\u003e\n\n\u003cp\u003eBefore I'm writing my own parser using \u003cstrong\u003eXmlReader\u003c/strong\u003e, i was wondering if anyone know of a out of the box solution?\u003c/p\u003e","accepted_answer_id":"13719179","answer_count":"2","comment_count":"2","creation_date":"2012-11-26 15:22:04.037 UTC","last_activity_date":"2013-04-30 06:52:52.563 UTC","last_edit_date":"2013-04-30 06:52:52.563 UTC","last_editor_display_name":"","last_editor_user_id":"1191905","owner_display_name":"","owner_user_id":"1191905","post_type_id":"1","score":"0","tags":"json|multithreading|performance|xmldocument|domparser","view_count":"329"} +{"id":"9502943","title":"Android: how to get a faster onDraw()","body":"\u003cp\u003eI've created an activity that calls a DrawView extends View, I draw on a Canvas something like a binary tree. The canvas size is greater than the screen size, and the onDraw function draws all the canvas, not only the visible part of it. I've added an horizontal and a vertical scrollView, and obviously onDraw is called again and again to refresh the view. \nI was wondering if I can draw the canvas on an image (a bitmap or something like that) using that image to show the tree, without the need to recall the onDraw function.\nIf I can't do this, what can I do in order to get a faster view?\u003c/p\u003e","accepted_answer_id":"9503236","answer_count":"2","comment_count":"0","creation_date":"2012-02-29 16:31:55.043 UTC","last_activity_date":"2012-02-29 16:52:12.617 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1049263","post_type_id":"1","score":"1","tags":"android|view|canvas|bitmap|ondraw","view_count":"2453"} +{"id":"41555070","title":"Different predictive models giving identical results? Python 2.x to 3.x issue?","body":"\u003cp\u003eI'm working on an online course and used the provided code to create two different predictive models. I played around with them a bit to see if I can get different results, which went fine.\u003c/p\u003e\n\n\u003cp\u003eMy concern is why they are giving me identical accuracy and cross validation scores.\u003c/p\u003e\n\n\u003cp\u003eLogit Regression:\n\u003ca href=\"https://i.stack.imgur.com/CAOjf.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/CAOjf.png\" alt=\"Logit Regression\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eDecision Tree:\n\u003ca href=\"https://i.stack.imgur.com/TnZQc.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/TnZQc.png\" alt=\"Decision Tree\"\u003e\u003c/a\u003e\nI've provided a snippet of code below, as well as the function for classification that I took from python 2.x code. Currently, I am working with python 3.x and 0.17.1 of scikit-learn.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e# import models from scikit-learn \nfrom sklearn.linear_model import LogisticRegression\nfrom sklearn.cross_validation import KFold # for K-fold cross validation\nfrom sklearn.ensemble import RandomForestClassifier\nfrom sklearn.tree import DecisionTreeClassifier, export_graphviz\nfrom sklearn import metrics\n\n# generic fxn for making classification model and processing accessing performance\ndef classification_model(model, data, predictors, outcome):\n model.fit(data[predictors], data[outcome]) # fit model\n predictions = model.predict(data[predictors]) # make predictions on training set\n\n # print accuracy\n accuracy = metrics.accuracy_score(predictions, data[outcome])\n print(\"Accuracy: %s\" % \"{0:.3%}\".format(accuracy))\n\n # k-fold cross validatiom, 5 folds\n kf = KFold(data.shape[0], n_folds = 5)\n error = []\n for train, test in kf:\n train_predictors = (data[predictors].iloc[train,:]) # filter training data\n train_target = data[outcome].iloc[train]\n model.fit(train_predictors, train_target)\n\n # record error from each run\n error.append(model.score(data[predictors].iloc[test,:], data[outcome].iloc[test]))\n\n print(\"Cross-Validation Score: %s\" % \"{0:.3%}\".format(np.mean(error)))\n\n # fit model (again) so it can be referred to outside fxn\n model.fit(data[predictors], data[outcome])\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAm I using outdated parameter names? Or is there something wrong with the classifier function?\u003c/p\u003e\n\n\u003cp\u003eI currently am not getting any errors from the code that I'm running but getting the exact same accuracy and cross validation scores is concerning.\u003c/p\u003e","answer_count":"0","comment_count":"5","creation_date":"2017-01-09 19:01:20 UTC","last_activity_date":"2017-01-09 19:27:03.103 UTC","last_edit_date":"2017-01-09 19:27:03.103 UTC","last_editor_display_name":"","last_editor_user_id":"7143036","owner_display_name":"","owner_user_id":"7143036","post_type_id":"1","score":"0","tags":"python|python-3.x|pandas|scikit-learn","view_count":"113"} +{"id":"8795934","title":"How can I stop loading a web page if it is equiped with frame-buster buster?","body":"\u003cp\u003eHow can I stop loading a web page if it uses a frame-buster buster as mentioned in \u003ca href=\"https://stackoverflow.com/questions/958997\"\u003ethis question\u003c/a\u003e, or an even stronger \u003ccode\u003eX-Frame-Options: deny\u003c/code\u003e like stackoverflow.com? I am creating a web application that has the functionality of loading external web pages into an \u003ccode\u003e\u0026lt;iframe\u0026gt;\u003c/code\u003e via javascript, but if the user accidentally steps on to websites like google.com or stackoverflow.com, which have a function to bust a frame-buster, I just want to quit loading. In stackoverflow.com, it shows a pop up message asking to disable the frame and proceed, but I would rather stop loading the page. In google, it removes the frame without asking. I have absolutely no intent of click jacking, and at the moment, I only use this application by myself. It is inconvinient that every time I step on to such sites, the frames are broken. I just do not need to continue loading these pages.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdit\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eSeeing the answers so far, it seems that I can't detect this before loading. Then, is it possible to load the page in a different tab, and then see if it does not have the frame-buster buster, and then if it doesn't, then load that into the \u003ccode\u003e\u0026lt;iframe\u0026gt;\u003c/code\u003e within the original tab?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdit 2\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI can also acheive the header or the webpage as an html string through the script language (Ruby) that I am using. So I think I indeed do have access to the information before loading it into an \u003ccode\u003e\u0026lt;iframe\u0026gt;\u003c/code\u003e.\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2012-01-09 22:17:45.277 UTC","favorite_count":"1","last_activity_date":"2012-01-09 22:51:44.857 UTC","last_edit_date":"2017-05-23 11:52:15.55 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"314166","post_type_id":"1","score":"1","tags":"javascript|iframe|frame|x-frame-options","view_count":"766"} +{"id":"10427765","title":"XSLT Transformation based on predefined output string","body":"\u003cp\u003eI need xslt to transform, My Xml is as below\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;OrderReferences\u0026gt;\n \u0026lt;OrderRef\u0026gt;\n \u0026lt;OrderRef\u0026gt;OrderRef1\u0026lt;/OrderRef\u0026gt;\n \u0026lt;Type\u0026gt;ERP\u0026lt;/Type\u0026gt;\n \u0026lt;/OrderRef\u0026gt;\n \u0026lt;OrderRef\u0026gt;\n \u0026lt;OrderRef\u0026gt;OrderRef2\u0026lt;/OrderRef\u0026gt;\n \u0026lt;Type\u0026gt;CUSTOMER\u0026lt;/Type\u0026gt;\n \u0026lt;/OrderRef\u0026gt;\n \u0026lt;OrderRef\u0026gt;\n \u0026lt;OrderRef\u0026gt;OrderRef3\u0026lt;/OrderRef\u0026gt;\n \u0026lt;Type\u0026gt;EXT\u0026lt;/Type\u0026gt;\n \u0026lt;/OrderRef\u0026gt;\n \u0026lt;/OrderReferences\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy Output from this should be \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;OrderReference\u0026gt; (OrderReference for ERP should appear here) \u0026lt;/OrderReference\u0026gt;\n\u0026lt;OrderReferenceCustomer\u0026gt; (CustomerReference for Customer should appear here) \u0026lt;/OrderReferenceCustomer\u0026gt;\n\u0026lt;OrderReferenceExternal\u0026gt; (ExtReference for EXT should appear here) \u0026lt;/OrderReferenceExternal\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eLet me know if this is achievable. XSLT 1.0 version preferrable as i want this for .Net. Thanks. \u003c/p\u003e","accepted_answer_id":"10430902","answer_count":"2","comment_count":"3","creation_date":"2012-05-03 08:32:45.907 UTC","favorite_count":"1","last_activity_date":"2012-05-03 11:57:26.947 UTC","last_edit_date":"2012-05-03 09:21:36.633 UTC","last_editor_display_name":"","last_editor_user_id":"7585","owner_display_name":"","owner_user_id":"1228190","post_type_id":"1","score":"2","tags":"xml|xslt-1.0|xslt-grouping|xslt","view_count":"101"} +{"id":"10603357","title":"Access and modify property(ies) of an Application-Scoped Managed Bean from Session Listener","body":"\u003cp\u003eI need to access an application-scoped managed bean to modify certain properties from within an HttpSessionListener.\u003c/p\u003e\n\n\u003cp\u003eI already used something like the following:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@Override\npublic void sessionDestroyed(HttpSessionEvent se) {\n HttpSession session = se.getSession();\n User user = userService.findBySessionId(session.getId()); \n\n ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();\n\n ApplicationScopedBean appBean = (ApplicationScopedBean) externalContext.getApplicationMap().get(\"appBean\");\n\n appBean.getConnectedUsers().remove(user);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eexternalContext = FacesContext.getCurrentInstance().getExternalContext() causes a null pointer exception here already, and even if it didn't I'm not sure appBean could be accessible the above way.\u003c/p\u003e\n\n\u003cp\u003eAny ideas?\u003c/p\u003e","accepted_answer_id":"10605191","answer_count":"1","comment_count":"2","creation_date":"2012-05-15 14:52:11.097 UTC","favorite_count":"1","last_activity_date":"2012-05-15 17:43:11.38 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"499543","post_type_id":"1","score":"0","tags":"java|jsf|java-ee|jsf-2","view_count":"3448"} +{"id":"14680395","title":"Facebook auto reload after login","body":"\u003cp\u003eI want my facebook login to get refreshed after I login. In my case it gets logged in but only after I refresh my page manually it goes to my facebook home page. How do I resolve this ? I am using php. \u003c/p\u003e","accepted_answer_id":"14680917","answer_count":"1","comment_count":"0","creation_date":"2013-02-04 04:32:01.333 UTC","last_activity_date":"2013-02-04 05:32:02.47 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1619588","post_type_id":"1","score":"0","tags":"php|facebook|facebook-graph-api","view_count":"173"} +{"id":"3538869","title":"how to automate multi user login for browser scenarios","body":"\u003cp\u003eCurrently when i try to login with mutli users only one login is allowed in the browser. my requirement is to be able to login with multi logins. I'm using IE if it helps.\u003c/p\u003e\n\n\u003cp\u003eyou response will be very appreciated.\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2010-08-21 20:34:06.227 UTC","last_activity_date":"2010-08-21 20:36:55.87 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"427285","post_type_id":"1","score":"2","tags":"session","view_count":"218"} +{"id":"47012560","title":"Crash on Painting DropDown in FarPoint Spread","body":"\u003cp\u003eOur clients are encountering an \"InvalidOperationException\" when they click on the DropDown control in Farpoint Spread for WinForms 7v2. The clients access the applications through the citrix boxes. It's not a sporadic crash but is consistent in nature. The stack trace looks like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Description: The process was terminated due to an unhandled exception. Exception Info: System.InvalidOperationException \n at System.Windows.Forms.VisualStyles.VisualStyleRenderer.IsCombinationDefined(System.String, Int32)\n at FarPoint.Win.DropDownButtonElement.OnPaintBackground(System.Drawing.Graphics, System.Drawing.Rectangle)\n at FarPoint.Win.ElementWindowless.PaintElements(System.Drawing.Graphics, System.Drawing.Rectangle)\n at FarPoint.Win.ElementWindowless.OnPaint(System.Drawing.Graphics, System.Drawing.Rectangle)\n at FarPoint.Win.SuperEditBase.OnPaint(System.Windows.Forms.PaintEventArgs)\n at System.Windows.Forms.Control.PaintWithErrorHandling(System.Windows.Forms.PaintEventArgs, Int16)\n at System.Windows.Forms.Control.WmPaint(System.Windows.Forms.Message ByRef)\n at System.Windows.Forms.Control.WndProc(System.Windows.Forms.Message ByRef)\n at FarPoint.Win.SuperEditBase.WndProc(System.Windows.Forms.Message ByRef)\n at FarPoint.Win.FpCombo.WndProc(System.Windows.Forms.Message ByRef)\n at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr, Int32, IntPtr, IntPtr)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWe investigate to check if any changes were made to the client workstations like, change in themes or any other setting around it. Then we tried by setting the themes to Windows Classic, Windows 7 Basic but it doesn't seem to work. Stopped the Themes service on the citrix box and then tried. It didn't work either. How do we get around this exception?\nFollowing values are set for the VisualStyles property of the spread:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ethis.sshResult.VisualStyles = FarPoint.Win.VisualStyles.On;\nthis.sshResult_Sheet1.ColumnFooter.Columns.Default.VisualStyles = FarPoint.Win.VisualStyles.Auto;\nthis.sshResult_Sheet1.ColumnFooter.Rows.Default.VisualStyles = FarPoint.Win.VisualStyles.Auto;\nthis.sshResult_Sheet1.ColumnHeader.Columns.Default.VisualStyles = FarPoint.Win.VisualStyles.Off;\nthis.sshResult_Sheet1.ColumnHeader.DefaultStyle.VisualStyles = FarPoint.Win.VisualStyles.Off;\nthis.sshResult_Sheet1.ColumnHeader.Rows.Default.VisualStyles = FarPoint.Win.VisualStyles.Off;\nthis.sshResult_Sheet1.RowHeader.Columns.Default.VisualStyles = FarPoint.Win.VisualStyles.Auto;\nthis.sshResult_Sheet1.RowHeader.Rows.Default.VisualStyles = FarPoint.Win.VisualStyles.Auto;\nthis.sshResult_Sheet1.VisualStyles = FarPoint.Win.VisualStyles.On;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"1","creation_date":"2017-10-30 10:04:35.577 UTC","last_activity_date":"2017-10-31 04:54:49.74 UTC","last_edit_date":"2017-10-31 04:54:49.74 UTC","last_editor_display_name":"","last_editor_user_id":"2991609","owner_display_name":"","owner_user_id":"2991609","post_type_id":"1","score":"0","tags":"c#|winforms|farpoint-spread|farpoint","view_count":"27"} +{"id":"31960599","title":"Unable to like using Facebook iOS SDK","body":"\u003cp\u003eI am trying to implement like in my Objective C application. If I am not logged into Facebook, then after tapping Like button, application opens login screen. I will log into my account. Then screen goes light gray with gray logo of Facebook for a while (with 2 shortly showed grey facebook screens before that) and then I am redirected back into my app. If I am logged into Facebook when running application, everything is the same except not showing login screen.\u003c/p\u003e\n\n\u003cp\u003eSo my problem is, that I am not getting correct confirmation dialog that should appear after logging into FB account and I am redirected back into my app. Like is not placed.\u003c/p\u003e\n\n\u003cp\u003eWhat can be cause of this behaviour?\u003c/p\u003e\n\n\u003cp\u003eI have placed all 3 needed rows into .plist and this is how I am creating like button (p_webView is my subclass of UIWebView):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eif (p_webView.fbLikeButton == nil) {\n p_webView.fbLikeButton = [[FBSDKLikeControl alloc] init];\n}\np_webView.fbLikeButton.objectID = p_webView.article.url;\n[p_webView.fbLikeButton setFrame:CGRectMake(p_webView.fbLikeButton.frame.origin.x, height + 5, p_webView.fbLikeButton.frame.size.width, p_webView.fbLikeButton.frame.size.height)];\n[p_webView.fbLikeButton setCenter:CGPointMake(p_webView.frame.size.width / 2, p_webView.fbLikeButton.center.y)];\n[p_webView.scrollView addSubview:p_webView.fbLikeButton];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMore information - I have tried this on simulator (there I do not have FB app, so it was using Safari only). After loggin in, I have got error: \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e\"The page you requested cannot be displayed at the moment. It may be temporarily unavailable, the link you clicked on may be broken or expired, or you may not have permission to view this page.\"\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eAs it might be difficult to find solution - one needs to be in FB app as administrator, developer or tester for like button to work when testing app that has not been approved by Apple for using native like button yet.\u003c/p\u003e","accepted_answer_id":"32044854","answer_count":"1","comment_count":"2","creation_date":"2015-08-12 09:03:30.073 UTC","last_activity_date":"2015-08-20 06:26:46.467 UTC","last_edit_date":"2015-08-20 06:26:46.467 UTC","last_editor_display_name":"","last_editor_user_id":"1358949","owner_display_name":"","owner_user_id":"1358949","post_type_id":"1","score":"0","tags":"ios|objective-c|facebook|facebook-like","view_count":"896"} +{"id":"15271522","title":"an xpath that return a pair of values (using php)","body":"\u003cp\u003eI have lots and lots \u003ccode\u003eparagraph\u003c/code\u003e elements in XML and inside those paragraphs there are often child elements such as \u003ccode\u003ename\u003c/code\u003e. I want to run an xpath that will return the value of the child elements and the \u003ccode\u003exml:id\u003c/code\u003e of the parent paragraph. The ideal result would be some kind of array where the key is the \u003ccode\u003eparagraph\u003c/code\u003e element's \u003ccode\u003exml:id\u003c/code\u003e and the value is the text-node of the child \u003ccode\u003ename\u003c/code\u003e element. Any ideas how I could accomplish this with a single xpath?\u003c/p\u003e\n\n\u003cp\u003eCurrently, I was trying something like that involved two xpaths and an attempt to put the two together, but this was getting pretty messy and not working.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e $result_array = array();\n $xmldoc = simplexml_load_file(\"$fullfilename\");\n $xmldoc-\u0026gt;registerXPathNamespace(\"tei\", \"http://www.tei-c.org/ns/1.0\");\n $names = $xmldoc-\u0026gt;xpath(\"//name\");\nforeach ($names as $name) \n{\n $pids = $xmldoc-\u0026gt;xpath(\"//tei:p[tei:name='$name']/@xml:id\")\n $result_array[$name] = $pids[0]\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI get an error here that says \u003ccode\u003e[$name]\u003c/code\u003e is an illegal offset. I also just don't think this will give what I want, because I believe its always going to return the \u003ccode\u003exml:id\u003c/code\u003e for the first paragraph that has the child \u003ccode\u003ename\u003c/code\u003e element whose value matches the input. But what I want is paragraph xml:id value for the paragraph in which that instance was found.\u003c/p\u003e\n\n\u003cp\u003eThanks for your help.\u003c/p\u003e","answer_count":"1","comment_count":"5","creation_date":"2013-03-07 12:41:12.027 UTC","last_activity_date":"2013-04-26 18:42:37.857 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"731085","post_type_id":"1","score":"0","tags":"php|xpath","view_count":"104"} +{"id":"42056701","title":"UICollectionView cells not displaying while UICollectionView background is","body":"\u003cp\u003ethis is my class for ImageController (a ViewController)\nOnly the background of the collection view is displaying while the cells in it are not. Any help? Is there something I didn't initialize correctly?\u003c/p\u003e\n\n\u003cp\u003eHere is the class:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass ImageController: UIViewController, UICollectionViewDataSource, UICollectionViewDelegate {\n\n let reuseIdentifier = \"imageCell\"\n\n @IBOutlet weak var collectionView: UICollectionView!\n\n override func viewDidLoad() {\n super.viewDidLoad()\n }\n\n required init?(coder aDecoder: NSCoder) {\n super.init(coder: aDecoder)\n }\n\n func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -\u0026gt; Int {\n return 10\n }\n\n func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -\u0026gt; UICollectionViewCell {\n\n let cell = collectionView.dequeueReusableCell(withReuseIdentifier: reuseIdentifier, for: indexPath as IndexPath) as! ImageCell\n\n cell.myImage.image = unknown //name of image, isn't the cause of error\n\n return cell\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"42056794","answer_count":"2","comment_count":"1","creation_date":"2017-02-05 20:07:23.13 UTC","last_activity_date":"2017-02-05 20:25:24.147 UTC","last_edit_date":"2017-02-05 20:25:24.147 UTC","last_editor_display_name":"","last_editor_user_id":"5378116","owner_display_name":"","owner_user_id":"7487952","post_type_id":"1","score":"0","tags":"ios|swift|uicollectionview","view_count":"30"} +{"id":"14739680","title":"Creating a global dynamically-allocted array","body":"\u003cp\u003eI am new to C/C++ and I had a question about dynamically allocating arrays. Can you not make a global dynamically allocated array? What if I wanted arr to be used by multiple functions? Would I have to pass arr to every function? Basically I guess I am still confused on the concept of dynamically allocated arrays and how I could create an array that can be used by a few functions. \u003c/p\u003e\n\n\u003cp\u003eThe following produces : error: ‘arr’ does not name a type, but I am not sure exactly why.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;iostream\u0026gt; \n\nusing namespace std;\n\nint * arr = NULL;\narr = new int [10];\n\nint main() {\n arr[0] = 1;\n return 0;\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"14739753","answer_count":"4","comment_count":"10","creation_date":"2013-02-06 22:01:20.187 UTC","last_activity_date":"2013-02-06 22:24:29.56 UTC","last_edit_date":"2013-02-06 22:24:29.56 UTC","last_editor_display_name":"","last_editor_user_id":"1366871","owner_display_name":"","owner_user_id":"2048651","post_type_id":"1","score":"1","tags":"c++","view_count":"3109"} +{"id":"41762012","title":"Scala: why is there no sortBy on set?","body":"\u003cp\u003eI'm wondering why there is no \u003ccode\u003esortBy\u003c/code\u003e method on Scala \u003ccode\u003eSet\u003c/code\u003e as there is for \u003ccode\u003eSeq\u003c/code\u003e or \u003ccode\u003eList\u003c/code\u003e since it extends \u003ccode\u003eIterable\u003c/code\u003e as well...\u003c/p\u003e","accepted_answer_id":"41762249","answer_count":"1","comment_count":"3","creation_date":"2017-01-20 10:59:04.113 UTC","last_activity_date":"2017-01-20 11:46:03.37 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3581976","post_type_id":"1","score":"3","tags":"scala","view_count":"82"} +{"id":"12464613","title":"Can't save something written in the Serial Monitor for Arudino as a String/char","body":"\u003cp\u003eWhen I type the word in for the first line, the first letter is saved for the second line and nothing is saved for the first line. How do I fix this problem?\u003c/p\u003e\n\n\u003cp\u003eHere's the code: \u003ca href=\"http://pastebin.com/sXLjAvns\" rel=\"nofollow\"\u003ehttp://pastebin.com/sXLjAvns\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"12487755","answer_count":"2","comment_count":"0","creation_date":"2012-09-17 17:50:30.28 UTC","last_activity_date":"2012-09-21 19:46:31.603 UTC","last_edit_date":"2012-09-21 19:45:08.547 UTC","last_editor_display_name":"","last_editor_user_id":"63550","owner_display_name":"","owner_user_id":"1168052","post_type_id":"1","score":"0","tags":"c++|string|char|arduino","view_count":"73"} +{"id":"44122440","title":"Java Button Placement using BorderLayout","body":"\u003cp\u003eThis code displays nothing, I have exhausted many avenues but it does not display anything on the GUI (I have a main class that calls this as well already). Please help. I am trying to put the two JButtons horizontally at the bottom of the page and the JTextField and JLabel at the center of the screen.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epackage test;\n\nimport javax.swing.*;\nimport java.awt.*;\n\npublic class Gui extends JFrame {\n private JLabel label;\n private JButton clear;\n private JButton copy;\n private JTextField textfield;\n\n public Gui(){\n\n super(\"test\");\n\n clear = new JButton(\"Clear\");\n copy = new JButton(\"Copy\");\n label = new JLabel(\"\");\n textfield = new JTextField(\"enter text here\");\n\n JPanel bottom = new JPanel(new BorderLayout());\n\n JPanel subBottom = new JPanel();\n subBottom.add(copy);\n subBottom.add(clear);\n\n\n JPanel centre = new JPanel (new BorderLayout());\n\n JPanel subCentre = new JPanel();\n subCentre.add(label);\n subCentre.add(textfield);\n\n\n\n\n\n bottom.add(subBottom, BorderLayout.PAGE_END);\n centre.add(subCentre, BorderLayout.CENTER);\n\n }\n\n\n }\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"5","creation_date":"2017-05-22 21:30:53.52 UTC","last_activity_date":"2017-05-23 22:41:32.05 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"8050343","post_type_id":"1","score":"1","tags":"java|swing|user-interface|jpanel|jbutton","view_count":"66"} +{"id":"15924229","title":"Turn off zooming when in portrait mode","body":"\u003cp\u003eHello i am using this zoom javascript code to zoom my div depending on the screen size it works perfectly but i would like it so when I set an ipad to portrait mode it stops the zoom script from working. here is the script.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;script type=\"text/javascript\" src=\"http://code.jquery.com/jquery-latest.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;script type=\"text/javascript\" language=\"javascript\"\u0026gt;\n\nvar minW = 1800;\n\n$(function () {\nCheckSizeZoom()\n$('#divWrap').css('visibility', 'visible');\n});\n$(window).resize(CheckSizeZoom)\n\nfunction CheckSizeZoom() {\nif ($(window).width() \u0026lt; minW) {\nvar zoomLev = $(window).width() / minW;\n\nif (typeof (document.body.style.zoom) != \"undefined\") {\n$(document.body).css('zoom', zoomLev);\n}\nelse {\n// Mozilla doesn't support zoom, use -moz-transform to scale and compensate for lost width\n$('#divWrap').css('-moz-transform', \"scale(\" + zoomLev + \")\");\n$('#divWrap').width($(window).width() / zoomLev + 10);\n$('#divWrap').css('position', 'relative');\n$('#divWrap').css('left', (($(window).width() - minW - 16) / 2) + \"px\");\n$('#divWrap').css('top', \"-19px\");\n$('#divWrap').css('position', 'relative');\n}\n}\nelse {\n$(document.body).css('zoom', '');\n$('#divWrap').css('position', '');\n$('#divWrap').css('left', \"\");\n$('#divWrap').css('top', \"\");\n$('#divWrap').css('-moz-transform', \"\");\n$('#divWrap').width(\"\");\n}\n}\n\u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003echeers\u003c/p\u003e","answer_count":"2","comment_count":"4","creation_date":"2013-04-10 11:11:34.847 UTC","last_activity_date":"2013-04-10 12:39:59.363 UTC","last_edit_date":"2013-04-10 12:39:59.363 UTC","last_editor_display_name":"","last_editor_user_id":"2244835","owner_display_name":"","owner_user_id":"2244835","post_type_id":"1","score":"0","tags":"javascript|ipad","view_count":"128"} +{"id":"19755833","title":"caretPositionChanged() method not reacting","body":"\u003cp\u003eHi take a look on this fragment of code. My aim is to make my app reacting when i will type in a textarea one of words listed in \u003ccode\u003eslowa[]\u003c/code\u003e. As u can see i created \u003ccode\u003einputMethodListner\u003c/code\u003e however when i type whatever word it is working at all. i tryied to put a debug prints to see what is going on and i see that neither method \u003ccode\u003einputMethodTextChanged()\u003c/code\u003e nor \u003ccode\u003einputMethodTextChanged()\u003c/code\u003e is called even once:( what im doing wrong? \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport java.awt.*; \nimport java.awt.event.InputMethodEvent;\nimport java.awt.event.InputMethodListener;\n\nimport javax.swing.*; \n\npublic class BrzydkieSlowa extends JFrame { \nstatic String[] slowa = {\"shit\", \"fuck\"};\n\n private BrzydkieSlowa(){\n\n //Create and set up the window. \n JFrame frame = new JFrame(\"Brzydkie slowa\");\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); \n\n final JTextArea textArea1 = new JTextArea(10,10);\n textArea1.addInputMethodListener(new InputMethodListener() {\n @Override\n public void caretPositionChanged(InputMethodEvent arg0) {\n int brzydkie = 0;\n int i = 0;\n while(brzydkie == 1 || i \u0026gt; 1){\n if(textArea1.getText().compareTo(slowa[i])== 0)\n brzydkie = 0;\n i++;\n }\n if(brzydkie == 1)\n JOptionPane.showMessageDialog(null, \"brzydkie slowo\");\n }\n @Override\n public void inputMethodTextChanged(InputMethodEvent event) {\n // TODO Auto-generated method stub\n\n }\n });\n frame.getContentPane().add(textArea1, BorderLayout.CENTER); \n\n //Display the window. \n frame.setLocationRelativeTo(null); \n frame.pack();\n frame.setVisible(true); \n }\npublic static void main(String[] args) {\n new BrzydkieSlowa();\n\n}\n\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-11-03 17:35:21.657 UTC","last_activity_date":"2013-12-13 17:25:57.897 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2410128","post_type_id":"1","score":"0","tags":"java|text|input|textarea|listener","view_count":"1342"} +{"id":"36552269","title":"Conditional wrapper on ul in ng-repeat","body":"\u003cp\u003eI have a \u003ccode\u003eng-repeat\u003c/code\u003e with \u003ccode\u003eul\u003c/code\u003e list inside and i want to create a \u003ccode\u003eul\u003c/code\u003e every 8 elements but i can't find the way.\nI have to use \u003ccode\u003e$index % 8 == 0\u003c/code\u003e to show the \u003ccode\u003eul\u003c/code\u003e conditionally but i don't know how.\nThis is my code so far:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div ng-repeat-start=\"v in values\" ng-show=\"false\"/\u0026gt;\n \u0026lt;ul\u0026gt;\n \u0026lt;li ng-class=\"{'active': filterContent.isSelectedValue(key, v) }\" ng-click=\"filterContent.addFilter(key, v)\"\u0026gt;\n \u0026lt;a class=\"issue-btn btn-default\"\u0026gt;{{v}}\u0026lt;/a\u0026gt;\n \u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n\u0026lt;div ng-repeat-end ng-show=\"false\"/\u0026gt; \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe output result would be something like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;ul\u0026gt;\n \u0026lt;li\u0026gt;... content... \u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;.... content... \u0026lt;/li\u0026gt;\n \u0026lt;!-- 8 times --\u0026gt;\n\u0026lt;/ul\u0026gt;\n\u0026lt;ul\u0026gt;\n \u0026lt;li\u0026gt;.... more content ... \u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;.... more content ... \u0026lt;/li\u0026gt;\n \u0026lt;!-- 8 times --\u0026gt;\n\u0026lt;/ul\u0026gt;\n\u0026lt;!-- and so on until repeat ends --\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"36552826","answer_count":"2","comment_count":"0","creation_date":"2016-04-11 14:58:26.087 UTC","last_activity_date":"2016-04-11 15:22:01.227 UTC","last_edit_date":"2016-04-11 15:21:35.017 UTC","last_editor_display_name":"","last_editor_user_id":"696783","owner_display_name":"","owner_user_id":"696783","post_type_id":"1","score":"1","tags":"javascript|html|css|angularjs","view_count":"39"} +{"id":"38571229","title":"Compare 2 values on 2 different webpages using RFT","body":"\u003cp\u003eHow can I compare values based on another page, either using data pool values or get values from another page, in \u003ccode\u003eRational Functional Tester\u003c/code\u003e using java?\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2016-07-25 15:02:28.75 UTC","last_activity_date":"2016-07-27 16:57:07.147 UTC","last_edit_date":"2016-07-27 16:57:07.147 UTC","last_editor_display_name":"","last_editor_user_id":"1507566","owner_display_name":"","owner_user_id":"6635698","post_type_id":"1","score":"0","tags":"rft","view_count":"21"} +{"id":"8154489","title":"Inno Setup not updating registry using regtlibv12","body":"\u003cp\u003eI'm testing our inno setup changes to address a new fix from Microsoft to register a backwards compatible type library for our VB6 application. Here's a link outlining all the details from Microsoft,\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://support.microsoft.com/kb/556009\" rel=\"nofollow\"\u003ehttp://support.microsoft.com/kb/2517589\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eWhen registering this new type library, you have to use the .NET utility regtlibv12.exe which is located in the C:\\Windows\\Microsoft.NET\\Framework(version of your choice) directory.\u003c/p\u003e\n\n\u003cp\u003eI'm testing both a 32 \u0026amp; 64 bit inno setups on Win XP SP3 (32) and Win 7 SP1 (64).\u003c/p\u003e\n\n\u003cp\u003eWhen I run the setup on Win XP, I get a process exit code of 3 (fatal error) from the inno setup log.\u003c/p\u003e\n\n\u003cp\u003eWhen I run the setup on Win 7, I get a process exit code of 5 (aborted) from the inno setup log.\u003c/p\u003e\n\n\u003cp\u003eIn both cases, the registry is never updated with the new type library. I can run an equivalent command at a command prompt or through a batch file using regtlibv12 with no issues and the correct registry entries are added. These setups are run under administrative accounts.\u003c/p\u003e\n\n\u003cp\u003eHere are the 2 entries in our inno setup (64) that does the work required to register the type library,\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[Files]\nSource: msado60_Backcompat_x64.tlb; DestDir: \"{cf64}\\System\\ado\"; DestName: msado60_Backcompat.tlb; Flags: ignoreversion onlyifdoesntexist; Check: IsWin64\n\n[Run]\nFilename: {dotnet40}\\regtlibv12.exe; Parameters: \"{cf64}\\System\\ado\\msado60_Backcompat.tlb\"; WorkingDir: {dotnet40}; StatusMsg: \"Registering 64-bit type library...\"; Check: IsWin64\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNo messages are returned by the inno setup and completes normally with no apparent issues on both Win 7 and Win XP. The process exit codes appear in the inno log file.\u003c/p\u003e\n\n\u003cp\u003eOn a side note, strictly for testing purposes, I am able to register the type library by having the inno setups execute a batch file to register the type library using regtlibv12. This is the only way I am able to get the type library to register correctly in the registry on both Win 7 and Win XP.\u003c/p\u003e\n\n\u003cp\u003eIs the batch file my only option?\u003c/p\u003e\n\n\u003cp\u003eAny thoughts on how I can get inno to register the type library directly?\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2011-11-16 15:49:52.847 UTC","last_activity_date":"2011-11-18 15:10:37.327 UTC","last_edit_date":"2011-11-18 15:10:37.327 UTC","last_editor_display_name":"","last_editor_user_id":"491382","owner_display_name":"","owner_user_id":"491382","post_type_id":"1","score":"0","tags":"inno-setup|typelib","view_count":"1124"} +{"id":"23777518","title":"Subst drive letter fails to create DB in EF framework","body":"\u003cp\u003eI am using VS2013 and EF5 to build some sample applications. The development code is available in one of my directories, and as a habit I susbt that code directory to a drive.\u003c/p\u003e\n\n\u003cp\u003eIf I open the solution, a subdirectory, under the subst drive letter; the DB Context (DropCreateDatabaseIfModelChanges) fails to create the DB.\u003c/p\u003e\n\n\u003cp\u003eAfter a lot of looking around and checking permissions (ensuring I had 'Full Control' on the directory), I re-opened the solution from the original directory path. This time it worked.\u003c/p\u003e\n\n\u003cp\u003eAnyone facing similar issues with subst drives? Any alternate or workarounds??\u003c/p\u003e\n\n\u003cp\u003eThanks in advance\u003c/p\u003e\n\n\u003cp\u003ePrakash\u003c/p\u003e","accepted_answer_id":"23777736","answer_count":"1","comment_count":"0","creation_date":"2014-05-21 08:07:47.3 UTC","last_activity_date":"2014-05-21 08:21:36.78 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3659755","post_type_id":"1","score":"0","tags":"c#|entity-framework|visual-studio-2013|entity-framework-5","view_count":"33"} +{"id":"35913309","title":"TypeError: e.handler.apply is not a function","body":"\u003cp\u003eI have a little jQuery error. I have searched and read the others topics about it, and tried the solutions, but it didn't work. \u003c/p\u003e\n\n\u003cp\u003eHere is my code :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction paf() {\n // My function - It is working, so I guess the problem is not there. \n}\n\njQuery(document).ready(paf)\njQuery(window).load(jQuery('input').bind('keyup', paf())) // The problem is here\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe last line has to update the price when the user type on a input box, but it gives the error :\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eTypeError: e.handler.apply is not a function\u003c/p\u003e\n\u003c/blockquote\u003e","accepted_answer_id":"35913343","answer_count":"2","comment_count":"0","creation_date":"2016-03-10 10:05:36.367 UTC","last_activity_date":"2016-03-10 10:09:02.527 UTC","last_edit_date":"2016-03-10 10:08:29.807 UTC","last_editor_display_name":"","last_editor_user_id":"519413","owner_display_name":"","owner_user_id":"6044101","post_type_id":"1","score":"-1","tags":"javascript|jquery","view_count":"2269"} +{"id":"12807778","title":"ftp Put *.ext only transfers the first file","body":"\u003cp\u003eSo I have a batch file which pipes some ftp commands into a host and I want to copy every file from my local directory with a certain extension to the host machine.\u003c/p\u003e\n\n\u003cp\u003eAll that happens after i ftp is a directory change then\u003c/p\u003e\n\n\u003cp\u003eput *.ext\nquit\u003c/p\u003e\n\n\u003cp\u003eIt will put the first instance of any given file that it finds on the host but ignore all subsequent instances. Anyone know why?\u003c/p\u003e","accepted_answer_id":"12808012","answer_count":"1","comment_count":"1","creation_date":"2012-10-09 20:17:42.337 UTC","last_activity_date":"2012-10-09 20:36:44.077 UTC","last_edit_date":"2012-10-09 20:35:16.883 UTC","last_editor_display_name":"","last_editor_user_id":"1732909","owner_display_name":"","owner_user_id":"1732909","post_type_id":"1","score":"4","tags":"ftp|wildcard|put","view_count":"2461"} +{"id":"41251892","title":"SAP Crystal Reports v13 runtime not installing on local computer","body":"\u003cp\u003eI am running VS professional 2015 on my Windows 10 professional, and I needed to install the Crystal Reports runtime on my computer so I can build projects with CrystalDecisions.CrystalReports.Engine and CrystalDecisions.Shared, version 13.0.2000.0.\u003c/p\u003e\n\n\u003cp\u003eI also currently have Crystal Reports 2008, version 12.0.0.683 installed on my computer to create reports outside VS 2015.\u003c/p\u003e\n\n\u003cp\u003eOn our company server, there was a .msi file and a .exe file. \u003cem\u003eLike an idiot\u003c/em\u003e, I ran the .msi file without knowing:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eTo integrate \"SAP Crystal Reports, developer version for Microsoft Visual Studio\" into VS 2010 or 2012 (SP 7 and higher) or VS 2013 (SP 9 or higher) or VS 2015 RC (SP14) - VS 2015 (fully - SP 15), you must run the Install Executable. Running the MSI will not fully integrate Crystal Reports into VS. MSI files by definition are for runtime distribution only.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eSo after running the .msi file and realizing my mistake, I ran the \"Uninstall\" option from the .msi file and checked my GAC. The CrystalDecisions has been uninstalled from my \"GAC_32\" and \"GAC_64\" folders. However, the strange part is that in my \"GAC_MSIL\" folder, it has the CrystalDecisions version 12.0.2000.0.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/t1fD3.png\" rel=\"nofollow noreferrer\"\u003eGAC_MSIL folder - but no CrystalDecisions folders in GAC_32 or GAC_64\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI checked my Control Panel -\u003e Programs -\u003e Programs and Features and nowhere can I find \"SAP Crystal Reports runtime engine for .NET Framework (64-bit)\" and \"SAP Crystal Reports, version for Microsoft Visual Studio\", so I figured the uninstall was successful.\u003c/p\u003e\n\n\u003cp\u003eWhen I try to run the .exe file this time, I get an error saying that it cannot run the installation due to the following error:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/3jWxz.png\" rel=\"nofollow noreferrer\"\u003eSAP Crystal Reports runtime installation error window\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eSo I checked EventViewer -\u003e Windows Logs -\u003e Application, and the error log said it was an error at installation 1603 and \"Product: SAP Crystal Reports, version for Microsoft Visual Studio -- You must already have Visual Studio 2010 or Visual Studio 2012 installed to proceed with this installation.\"\u003c/p\u003e\n\n\u003cp\u003eI talked with my boss and he said he doubts I need VS 2012 and it does not make sense to have both VS 2012 and 2015 on my computer. Unfortunately, I cannot build projects using CrystalDecisions v.13 like our production server, and building the project using the CrystalDecisions v.12 on my computer will cause the project to fail if I release it to production.\u003c/p\u003e\n\n\u003cp\u003eI checked other questions on StackOverflow, and I saw some solutions:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003e\u003cem\u003eInstall VS 2012\u003c/em\u003e - not an option unless a last resort; we have VS 2015 only - unless if installing a \"community\" version of VS 2012 would do the trick.\u003c/li\u003e\n\u003cli\u003e\u003cem\u003eDo a system restore\u003c/em\u003e - one person suggested because I ran the .msi file instead of the .exe, it messed up my assembly, so doing a system restore \u003cstrong\u003e\u003cem\u003ebefore\u003c/em\u003e\u003c/strong\u003e I ran the .msi file could fix it and allow me to install CR runtime correctly, but again, my boss says he wouldn't recommend it\u003c/li\u003e\n\u003cli\u003e\u003cem\u003eTry running the CR runtime setup from the SAP website with a \u003cstrong\u003enewer\u003c/strong\u003e version other than v.13 for my x64 bit machine that will integrate with VS 2015 without needing VS 2012\u003c/em\u003e - then the newer version of my CR runtime when I build my projects will be different from the CR runtime on the production server and there will be conflicts when I release my project on the production server.\u003c/li\u003e\n\u003cli\u003e\u003cem\u003eAlter/delete my assembly files because running the .msi file screwed up my assembly cache\u003c/em\u003e - Really risky; I don't know the first thing about assembly files and I could mess up my computer. And would deleting manually the \"CrystalDecisions\" folders from my \"GAC_MSIL\" folder even work if the GAC_32 and GAC_64 folders do not have \"CrystalDecisions\"?\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eNone of these solutions are preferable, so does anyone have any other solutions I cannot see that work?\u003c/p\u003e\n\n\u003cp\u003eThank you for your patience. I could just bash my head against the desk because I ran the .msi file instead of reading the directions carefully. I feel like an idiot...\u003c/p\u003e","accepted_answer_id":"41685349","answer_count":"1","comment_count":"1","creation_date":"2016-12-20 21:56:20.05 UTC","last_activity_date":"2017-01-16 21:35:00.74 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7318756","post_type_id":"1","score":"0","tags":"c#|visual-studio-2015|crystal-reports|crystal-reports-2008|gac-msil","view_count":"1249"} +{"id":"34638489","title":"How openui5/SAP Web IDE works and why the text doesn't appear when I open the project in my PC?","body":"\u003cp\u003eWhen i open the openui5 project in SAP Web IDE, the project appears with css style and with text \"Title\" from i18n,but when i download the project and open in my PC, the project doesn't have css style and no text ( blank page).\nHow openui5/SAP Web IDE works and why the text doesn't appear when I open the project in my PC?\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://i.stack.imgur.com/6m4ta.jpg\" rel=\"nofollow\"\u003eproject open in SAP Web IDE\u003c/a\u003e\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2016-01-06 16:56:41.773 UTC","last_activity_date":"2017-02-20 08:39:38.3 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1675850","post_type_id":"1","score":"0","tags":"web|ide|sap|sapui5","view_count":"115"} +{"id":"2846946","title":"Generating a second context menu dynamically in Winforms","body":"\u003cp\u003eI have a context menu with a few selections. If the user picks a particular choice, I want a list of choices in a second menu to come up. These choices would be coming from a data store and be unique to that user.\u003c/p\u003e\n\n\u003cp\u003eI see how in designer you can add a set of choices statically that show upon the user making a selection. However, what do you do when you need that to come from data and not design it in the designer?\u003c/p\u003e","accepted_answer_id":"2847052","answer_count":"2","comment_count":"0","creation_date":"2010-05-17 06:03:26.8 UTC","last_activity_date":"2010-11-19 22:48:12.9 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"314761","post_type_id":"1","score":"2","tags":".net|winforms","view_count":"302"} +{"id":"8540685","title":"Access: impose referential integrity on a linked table","body":"\u003cp\u003eI have two Access databases: \u003ccode\u003eMain\u003c/code\u003e stores most of my data and \u003ccode\u003eMemos\u003c/code\u003e stores data of datatype Memo. I am storing the memos in a separate db because everything I read about Memo fields said they were prone to corruption and that the only safe way to protect your database is to have the memos in a separate linked db.\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eMemos\u003c/code\u003e has a table \u003ccode\u003eInfo\u003c/code\u003e with fields:\n\u003ccode\u003eID\u003c/code\u003e (type Autonumber primary key)\n\u003ccode\u003eInfo\u003c/code\u003e (type Memo)\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eMain\u003c/code\u003e has a table \u003ccode\u003eContent\u003c/code\u003e with fields:\n\u003ccode\u003eID\u003c/code\u003e (type Autonumber primary key)\n\u003ccode\u003einfoID\u003c/code\u003e (type Number)\n\u003ccode\u003eentryDate\u003c/code\u003e (type Date/Time)\u003c/p\u003e\n\n\u003cp\u003eI want to enforce referential integrity on \u003ccode\u003eContent\u003c/code\u003e so that it can only accept values that are valid IDs from table \u003ccode\u003eInfo\u003c/code\u003e. But I can't, because \u003ccode\u003eMemos\u003c/code\u003e is a linked database. I can establish controls at another point in the data entry process to ensure that only values from \u003ccode\u003eInfo\u003c/code\u003e can be inserted into \u003ccode\u003eContent\u003c/code\u003e, but I'd rather not code the validation if there's a way to enforce it through database constraints.\u003c/p\u003e\n\n\u003cp\u003eIs there another way to enforce integrity between linked tables that I'm not aware of, or a different way to handle the Memo storage problem so that I can keep the Memos in the same DB?\u003c/p\u003e","accepted_answer_id":"10609141","answer_count":"1","comment_count":"5","creation_date":"2011-12-16 22:01:53.277 UTC","favorite_count":"1","last_activity_date":"2012-05-15 21:32:31.657 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"619177","post_type_id":"1","score":"1","tags":"ms-access|referential-integrity","view_count":"1899"} +{"id":"20801501","title":"How to clearly identify voice codec used in a VOIP application?","body":"\u003cp\u003eI was going through some sample VOIP SDK for Android. The SDK providers say that they are using the G729 voice codec in the SDK. But those codecs are hidden. Is there any way to clearly identify the voice codec used in the application?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-12-27 13:21:47.6 UTC","last_activity_date":"2014-03-23 07:35:48.737 UTC","last_edit_date":"2013-12-27 17:11:33.84 UTC","last_editor_display_name":"","last_editor_user_id":"387076","owner_display_name":"","owner_user_id":"3128518","post_type_id":"1","score":"2","tags":"android|voip|codec","view_count":"318"} +{"id":"1972412","title":"tsql- to find when was the database taken offline","body":"\u003cp\u003eIs there a way how we can know when was a database taken offline?\nPlatform: SQL server 2005\u003c/p\u003e","accepted_answer_id":"1972618","answer_count":"4","comment_count":"1","creation_date":"2009-12-29 01:04:14.66 UTC","last_activity_date":"2015-02-26 05:01:44.713 UTC","last_edit_date":"2009-12-29 01:26:53.07 UTC","last_editor_display_name":"","last_editor_user_id":"135152","owner_display_name":"","owner_user_id":"125512","post_type_id":"1","score":"1","tags":"sql|sql-server|sql-server-2005|tsql","view_count":"5470"} +{"id":"5275920","title":"Can you capture end user's Java version when they run an applet?","body":"\u003cp\u003eAn applet developed outside our company just started failing for some users this week. Apparently it was because of the latest version of java (1.6u24) that auto updated. Is there a way to capture what version of java the user opened the applet with? \u003c/p\u003e","accepted_answer_id":"5422840","answer_count":"4","comment_count":"0","creation_date":"2011-03-11 17:00:30.077 UTC","last_activity_date":"2011-03-24 17:06:20.94 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"636182","post_type_id":"1","score":"1","tags":"java","view_count":"177"} +{"id":"12955216","title":"problems while implementing android GCM demo","body":"\u003cp\u003eI put in reference this:\n\u003ca href=\"http://developer.android.com/guide/google/gcm/demo.html\" rel=\"nofollow\"\u003ehttp://developer.android.com/guide/google/gcm/demo.html\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003ein Using App Engine for Java number 4\nI am supposed to run this on a cmd inside the samples/gcm-demo-appengine directory :ant -Dsdk.dir=/opt/google/appengine-java-sdk runserver -Dserver.host=192.168.1.10\u003c/p\u003e\n\n\u003cp\u003eI replace the \"192.168.1.10\" with \"127.0.0.1\" which is my locolhost.\u003c/p\u003e\n\n\u003cp\u003eafter executing this command I got:\u003c/p\u003e\n\n\u003cp\u003eBUILD FAILED\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eC:\\Program Files (x86)\\Android\\android-sdk\\extras\\google\\gcm\\samples\\gcm-demo-ap\npengine\\build.xml:27: Cannot find C:\\opt\\google\\appengine-java-sdk\\config\\user\\a\nnt-macros.xml imported from C:\\Program Files (x86)\\Android\\android-sdk\\extras\\go\nogle\\gcm\\samples\\gcm-demo-appengine\\build.xml\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ecan you tell me what the problem?\u003c/p\u003e","answer_count":"1","comment_count":"4","creation_date":"2012-10-18 12:54:32.69 UTC","favorite_count":"0","last_activity_date":"2014-04-25 08:35:51.45 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"817028","post_type_id":"1","score":"1","tags":"android|ant|google-cloud-messaging","view_count":"630"} +{"id":"39923421","title":"Lock the first dropdown after the choice is made and insert values in a table depending on the second dropdown choice","body":"\u003cp\u003eI was looking through Stack Overflow on how to create dynamic dropdowns when I saw this question: \u003ca href=\"https://stackoverflow.com/questions/6954556/show-a-second-dropdown-based-on-previous-dropdown-selection\"\u003eShow a second dropdown based on previous dropdown selection\u003c/a\u003e.\u003c/p\u003e\n\n\u003cp\u003eIt is an easier although longer code that uses the least amount of JavaScript in all my researches on dynamic dropdowns. I tried replicating the code seen here:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://jsfiddle.net/3UWk2/3/\" rel=\"nofollow noreferrer\"\u003ehttp://jsfiddle.net/3UWk2/3/\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eMy code: first dropdown in html:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;select id=\"Service\" title=\"\" name=\"Service\"\u0026gt;\n \u0026lt;option value=\"\" \u0026gt;Choose Service ...\u0026lt;/option\u0026gt;\n \u0026lt;option value=\"wedding\"\u0026gt;Wedding\u0026lt;/option\u0026gt;\n \u0026lt;option value=\"debut\"\u0026gt;Debut\u0026lt;/option\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy code: second dropdown in html:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"first-level-container\"\u0026gt;\n \u0026lt;div class=\"wedding\"\u0026gt;\n \u0026lt;select class=\"second-level-select\"\u0026gt;\n \u0026lt;option value=\"\" selected hidden\u0026gt;Choose package ...\u0026lt;/option\u0026gt;\n \u0026lt;option value=\"wedding-package-1\"\u0026gt;Package 1\u0026lt;/option\u0026gt;\n \u0026lt;option value=\"wedding-package-2\"\u0026gt;Package 2\u0026lt;/option\u0026gt;\n \u0026lt;/select\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"debut\"\u0026gt;\n \u0026lt;select class=\"second-level-select\"\u0026gt;\n \u0026lt;option value=\"\" selected hidden\u0026gt;Choose package ...\u0026lt;/option\u0026gt;\n \u0026lt;option value=\"debut-package-1\"\u0026gt;Package 1\u0026lt;/option\u0026gt;\n \u0026lt;option value=\"debut-package-2\"\u0026gt;Package 2\u0026lt;/option\u0026gt;\n \u0026lt;/select\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy code: line of text\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;div class=\"second-level-container\"\u0026gt;\n \u0026lt;div class=\"wedding-package-1\"\u0026gt;\n Line of text for wedding package 1\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"wedding-package-2\"\u0026gt;\n Line of text for wedding package 2\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"debut-package-1\"\u0026gt;\n Line of text for debut package 1\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"debut-package-2\"\u0026gt;\n Line of text for debut package 2\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe process is simple, the second dropdown depends on the first dropdown choice, and the text to be shown depends on the second dropdown choice. I also used the jquery code provided.\u003c/p\u003e\n\n\u003cp\u003eMy code: dropdown conditions in jquery\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(document).ready(function() {\n$('#Service').bind('change', function() {\n var elements = $('div.first-level-container').children().hide(); // hide all the elements\n var value = $(this).val();\n\nif (value.length) { // if somethings' selected\n elements.filter('.' + value).show(); // show the ones we want\n }\n}).trigger('change');\n\n$('.second-level-select').bind('change', function() {\n var elements = $('div.second-level-container').children().hide(); // hide all the elements\n var value = $(this).val();\n\nif (value.length) { // if somethings' selected\n elements.filter('.' + value).show(); // show the ones we want\n }\n}).trigger('change');\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThere is a little bug that I found on the code. It can also be seen in the jfiddle link. You see, if you try changing the first dropdown after a trial, the line of text does not disappear. (Using the jfiddle link, try choosing 'Airman' then 'Basic Ore Miner Level 2'. When the line of text appears, immediately change the 'Airman' to 'Senior Airman'. Notice that the second dropdown resets but the line of text for Basic Ore Miner level 2 is still there.)\u003c/p\u003e\n\n\u003cp\u003eTo avoid this, I want to lock the first dropdown immediately after choosing. Then create a button that will reset everything. But I'm having trouble with it.\u003c/p\u003e\n\n\u003cp\u003eAlso, I need to insert values to an SQL table depending on the choices of the dropdown (please refer to my code for this example: if I chose a wedding and it's specific package, I need to insert it among other variables like the price of the package to a specific table)\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2016-10-07 18:07:52.58 UTC","last_activity_date":"2016-10-07 21:24:28.397 UTC","last_edit_date":"2017-05-23 12:19:23.403 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"3720004","post_type_id":"1","score":"1","tags":"javascript|jquery|html|sql|drop-down-menu","view_count":"70"} +{"id":"11361611","title":"htaccess is not working good","body":"\u003cp\u003eI used following to redirect the page.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eRedirectMatch 301 /mytake/huts(.*) /mytake/surveys/$1\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand that worked, actually changing URL in address bar which I don't want.\u003c/p\u003e\n\n\u003cp\u003eI tried following which is NOT working at all.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eRewriteRule ^mytake/huts$ mytake/surveys/ [L,R=301]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy question is why second line is not working ???\u003c/p\u003e\n\n\u003cp\u003eMy testing URL is: \u003ca href=\"http://www.mydomain.com/mytake/huts\" rel=\"nofollow\"\u003ehttp://www.mydomain.com/mytake/huts\u003c/a\u003e (don't click, take it as test URL :) )\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2012-07-06 11:48:12.97 UTC","last_activity_date":"2012-07-06 13:08:00.623 UTC","last_edit_date":"2012-07-06 12:01:07.99 UTC","last_editor_display_name":"","last_editor_user_id":"485003","owner_display_name":"","owner_user_id":"485003","post_type_id":"1","score":"2","tags":"apache|.htaccess|redirect","view_count":"53"} +{"id":"25338313","title":"upload images into database","body":"\u003cp\u003eI made a simple form to upload images but I receive the error message \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eUnknown column 'images/16-08-2014-1408177181.jpg' in 'field list'\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI read that the problem from quotes but I tried many and received the same error.\u003cbr\u003e\nThat's the project:\u003c/p\u003e\n\n\u003cp\u003eimage.php\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;form action=\"saveimage.php\" enctype=\"multipart/form-data\" method=\"post\"\u0026gt;\n\n\u0026lt;table style=\"border-collapse: collapse; font: 12px Tahoma;\" border=\"1\" cellspacing=\"5\" cellpadding=\"5\"\u0026gt;\n\u0026lt;tbody\u0026gt;\u0026lt;tr\u0026gt;\n\u0026lt;td\u0026gt;\n\u0026lt;input name=\"uploadedimage\" type=\"file\"\u0026gt;\n\u0026lt;/td\u0026gt;\n\n\u0026lt;/tr\u0026gt;\n\n\u0026lt;tr\u0026gt;\n\u0026lt;td\u0026gt;\n\u0026lt;input name=\"Upload Now\" type=\"submit\" value=\"Upload Image\"\u0026gt;\n\u0026lt;/td\u0026gt;\n\u0026lt;/tr\u0026gt;\n\n\n\u0026lt;/tbody\u0026gt;\u0026lt;/table\u0026gt;\n\n\u0026lt;/form\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003esaveimage.php\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\ninclude(\"config2.php\");\n?\u0026gt;\n\n\u0026lt;?php\n\n function GetImageExtension($imagetype)\n {\n if(empty($imagetype)) return false;\n switch($imagetype)\n {\n case 'image/bmp': return '.bmp';\n case 'image/gif': return '.gif';\n case 'image/jpeg': return '.jpg';\n case 'image/png': return '.png';\n default: return false;\n }\n }\n\n\n\nif (!empty($_FILES[\"uploadedimage\"][\"name\"])) {\n\n $file_name=$_FILES[\"uploadedimage\"][\"name\"];\n $temp_name=$_FILES[\"uploadedimage\"][\"tmp_name\"];\n $imgtype=$_FILES[\"uploadedimage\"][\"type\"];\n $ext= GetImageExtension($imgtype);\n $imagename=date(\"d-m-Y\").\"-\".time().$ext;\n $target_path = \"images/\".$imagename;\n\n\nif(move_uploaded_file($temp_name, $target_path)) {\n\n $query_upload=mysql_query(\"insert into images_store(images_path,submission_date) Values(`\".$target_path.\"`,`\".date(\"Y-m-d\").\"`)\")or die(mysql_error());\n }\n\n}\n\n?\u0026gt;;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003econfig2.php\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\n/**********MYSQL Settings****************/\n$host=\"localhost\";\n$databasename=\"db\";\n$user=\"root\";\n$pass=\"123456\";\n/**********MYSQL Settings****************/\n\n\n$conn=mysql_connect($host,$user,$pass);\n\nif($conn)\n{\n$db_selected = mysql_select_db($databasename, $conn);\nif (!$db_selected) {\n die ('Can\\'t use foo : ' . mysql_error());\n}\n}\nelse\n{\n die('Not connected : ' . mysql_error());\n}\n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003edisplay_messag.php\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;?php\ninclude(\"config2.php\");\n\n$select_query = \"SELECT 'images_path' FROM 'images_store' ORDER by 'images_id' DESC\";\n$sql = mysql_query($select_query) or die(mysql_error()); \nwhile($row = mysql_fetch_array($sql,MYSQL_BOTH)){\n\n?\u0026gt;\n\n\u0026lt;table style=\"border-collapse: collapse; font: 12px Tahoma;\" border=\"1\" cellspacing=\"5\" cellpadding=\"5\"\u0026gt;\n\u0026lt;tbody\u0026gt;\u0026lt;tr\u0026gt;\n\u0026lt;td\u0026gt;\n\n\u0026lt;img src=\"\u0026lt;?php echo $row[\"images_path\"];=\"\" ?=\"\"\u0026gt;\" alt=\"\" /\u0026gt;\"\u0026gt;\n\n\u0026lt;/td\u0026gt;\n\u0026lt;/tr\u0026gt;\n\u0026lt;/tbody\u0026gt;\u0026lt;/table\u0026gt;\n\n\u0026lt;?php\n}\n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"2","creation_date":"2014-08-16 08:24:15.22 UTC","last_activity_date":"2014-08-16 10:01:39.127 UTC","last_edit_date":"2014-08-16 09:57:51.407 UTC","last_editor_display_name":"","last_editor_user_id":"3944169","owner_display_name":"","owner_user_id":"3944169","post_type_id":"1","score":"0","tags":"php|mysql","view_count":"218"} +{"id":"45325557","title":"Aurelia Get Child Routes","body":"\u003cp\u003eI have a big navigation that I want to render all the links in the Application into it but what i have currently that I only renders the App routes only, so how can I get the child routes from specific route using whatever method from Aurelia ?\u003c/p\u003e\n\n\u003cp\u003eex :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;li repeat.for=\"route of router.navigation\"\u0026gt;\n \u0026lt;a href.bind=\"route.href\"\u0026gt;\n ${route.title}\n \u0026lt;/a\u0026gt;\n \u0026lt;ul if.bind=\"route.childs\"\u0026gt;\n \u0026lt;li repeat.for=\"child of route.childs\"\u0026gt;\n \u0026lt;a href.bind=\"child.href\"\u0026gt;${child.title}\u0026lt;/a\u0026gt;\n \u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n\u0026lt;/li\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"0","creation_date":"2017-07-26 11:24:59.6 UTC","last_activity_date":"2017-07-27 09:37:10.39 UTC","last_edit_date":"2017-07-26 12:22:00.873 UTC","last_editor_display_name":"","last_editor_user_id":"1016356","owner_display_name":"","owner_user_id":"1016356","post_type_id":"1","score":"0","tags":"routes|aurelia","view_count":"102"} +{"id":"34102507","title":"How do I know content type in C#.NET for an URL?","body":"\u003cp\u003eI want to check content type in C#.NET. \u003c/p\u003e\n\n\u003cp\u003eI am accessing third party URL and based on that, I want to check its type. Just note down that, I am not getting any extension you can see in below example of PDF.\u003c/p\u003e\n\n\u003cp\u003eAs an example below is the PDF file, URL is: \"\u003ca href=\"http://www.scoop.it/doc/download/aJpTLe5i6l38knVqb_gYeUR\" rel=\"nofollow\"\u003ehttp://www.scoop.it/doc/download/aJpTLe5i6l38knVqb_gYeUR\u003c/a\u003e\"\u003c/p\u003e\n\n\u003cp\u003eHow do I know that above URL has a content type PDF\nand another e.g. is simple webpage, Even I want to know its content type.\u003c/p\u003e\n\n\u003cp\u003e\"\u003ca href=\"http://askfsis.custhelp.com/app/answers/detail/a_id/1380\" rel=\"nofollow\"\u003ehttp://askfsis.custhelp.com/app/answers/detail/a_id/1380\u003c/a\u003e\"\u003c/p\u003e\n\n\u003cp\u003eSo I want to check something based on URL,\u003c/p\u003e\n\n\u003cp\u003eIf it is an PDF, do this else if it is an webpage, do that etc. Your quickly response is much appreciated. \u003c/p\u003e\n\n\u003cp\u003eThanks again,\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2015-12-05 07:38:40.637 UTC","last_activity_date":"2015-12-05 10:53:10.533 UTC","last_edit_date":"2015-12-05 10:53:10.533 UTC","last_editor_display_name":"","last_editor_user_id":"1479335","owner_display_name":"","owner_user_id":"5126210","post_type_id":"1","score":"1","tags":"c#|mime-types|content-type|webrequest","view_count":"67"} +{"id":"23704884","title":"Cannot call method 'create' of undefined","body":"\u003cp\u003eHere is what I'm getting from the console server side. \u003c/p\u003e\n\n\u003cp\u003eI20140516-21:27:12.142(0)? There was an error on this page. Cannot call method 'create' of undefined\u003c/p\u003e\n\n\u003cp\u003eI am not finding a good reason why this method isn't defined. I have the balanced-payments-production package from Atmosphere loaded and this includes the balanced.js file and the api export to the server. Any help here is appreciated. \u003c/p\u003e\n\n\u003cp\u003eHere is my events.js file\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eTemplate.CheckFormSubmit.events({\n 'submit form': function (e, tmpl) {\n e.preventDefault();\n var recurringStatus = $(e.target).find('[name=is_recurring]').is(':checked');\n var checkForm = {\n name: $(e.target).find('[name=name]').val(),\n account_number: $(e.target).find('[name=account_number]').val(),\n routing_number: $(e.target).find('[name=routing_number]').val(),\n recurring: { is_recurring: recurringStatus },\n created_at: new Date\n }\n checkForm._id = Donations.insert(checkForm);\n\n Meteor.call(\"addCustomer\", checkForm, function(error, result) {\n console.log(error);\n console.log(result);\n // Successful tokenization\n if(result.status_code === 201 \u0026amp;\u0026amp; result.href) {\n // Send to your backend\n jQuery.post(responseTarget, {\n uri: result.href\n }, function(r) {\n // Check your backend result\n if(r.status === 201) {\n // Your successful logic here from backend\n } else {\n // Your failure logic here from backend\n }\n });\n } else {\n // Failed to tokenize, your error logic here\n }\n\n // Debuging, just displays the tokenization result in a pretty div\n $('#response .panel-body pre').html(JSON.stringify(result, false, 4));\n $('#response').slideDown(300);\n });\n\n var form = tmpl.find('form');\n //form.reset();\n //Will need to add route to receipt page here.\n //Something like this maybe - Router.go('receiptPage', checkForm);\n },\n 'click [name=is_recurring]': function (e, tmpl) {\n var id = this._id;\n console.log($id);\n var isRecuring = tmpl.find('input').checked;\n\n Donations.update({_id: id}, {\n $set: { 'recurring.is_recurring': true }\n });\n }\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is my Methods.js file\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction getCustomer(req, callback) {\n try {\n balanced.marketplace.customers.create(req, callback);\n console.log(req.links.customers.bank_accounts);\n }\n catch (error){\n var error = \"There was an error on this page. \" + error.message;\n console.log(error);\n }\n}\n\nvar wrappedGetCustomer = Meteor._wrapAsync(getCustomer);\n\nMeteor.methods({\n addCustomer: function(formData) {\n try {\n console.log(formData);\n return wrappedGetCustomer(formData);\n }\n catch (error) {\n var error = \"There was an error on this page.\" + error.message;\n console.log(error);\n }\n }\n});\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"23773092","answer_count":"1","comment_count":"5","creation_date":"2014-05-16 21:32:23.613 UTC","last_activity_date":"2014-05-21 02:37:59.937 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"582309","post_type_id":"1","score":"0","tags":"meteor|balanced-payments","view_count":"567"} +{"id":"30730079","title":"How to find strings between two specified texts","body":"\u003cp\u003eI have a html code like this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;html\u0026gt;\n\u0026lt;body\u0026gt;\n\u0026lt;a href=\"one\"\u0026gt;frist\u0026lt;/a\u0026gt;\n\u0026lt;a href=\"two\"\u0026gt;second\u0026lt;/a\u0026gt;\n\u0026lt;a href=\"three\"\u0026gt;third\u0026lt;/a\u0026gt;\n\u0026lt;a href=\"four\"\u0026gt;fourth\u0026lt;/a\u0026gt;\n\u0026lt;/body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to make a perl script that get this code and print the string between\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;a href=\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\"\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFor this code it will be this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eone\ntwo\nthree\nfour\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow can i do that?\nSorry for my bad english\u003c/p\u003e","answer_count":"2","comment_count":"2","creation_date":"2015-06-09 10:57:58.127 UTC","last_activity_date":"2015-06-09 14:35:52.393 UTC","last_edit_date":"2015-06-09 11:56:50.01 UTC","last_editor_display_name":"","last_editor_user_id":"1691146","owner_display_name":"","owner_user_id":"4990047","post_type_id":"1","score":"-3","tags":"perl|find","view_count":"50"} +{"id":"7184377","title":"Obsolete items in pivot table list","body":"\u003cp\u003eIn a pivot table of mine, when I go to filter the data using the Row Label, where it shows the checkbox list where you can select one or many or all items to be included, this list includes items that no longer exist. Or alternatively, if you go to the PivotTable Field List and select the field and try to filter there, the same thing shows up.\u003c/p\u003e\n\n\u003cp\u003eThat is, I used to have a certain item in that column in my Excel spreadsheet (the source for the pivot table) and a month ago I stopped using that certain item, so it no longer appears at all in the data source. But, it still shows up in the checkbox list for the Row Label in the pivot table. How can I remove these? Refreshing the pivot table does not fix this. There are already a lot of different boxes and this just makes it harder to read.\u003c/p\u003e\n\n\u003cp\u003eThanks for any help\u003c/p\u003e","accepted_answer_id":"11744015","answer_count":"2","comment_count":"0","creation_date":"2011-08-25 02:10:12.527 UTC","favorite_count":"2","last_activity_date":"2016-10-24 12:18:05.907 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"908100","post_type_id":"1","score":"15","tags":"excel|pivot-table","view_count":"34167"} +{"id":"29826404","title":"how to insert value in dropdown dynamically using json ajax?","body":"\u003cp\u003e\u003ccode\u003eJSON\u003c/code\u003e Object:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[\n { \n \"C_CO\": 0,\n \"C_NAME1\": \"All- (BSPL)\"\n },{\n \"C_CO\": 2,\n \"C_NAME1\": \"Solutions Pvt Ltd\"\n }\n]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ehow to populate dropdown in below coding?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$.ajax({\n success: function (data) {\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ehereafter I don't know how to populate a \u003ccode\u003eselect\u003c/code\u003e? I want to set the \u003ccode\u003ec_co\u003c/code\u003e value as dropdown value and set the \u003ccode\u003eC_NAME1\u003c/code\u003e value as dropdown text.\u003c/p\u003e","answer_count":"4","comment_count":"1","creation_date":"2015-04-23 14:25:41.93 UTC","last_activity_date":"2015-05-12 12:56:58.977 UTC","last_edit_date":"2015-04-23 14:53:31.923 UTC","last_editor_display_name":"","last_editor_user_id":"2025923","owner_display_name":"","owner_user_id":"4298593","post_type_id":"1","score":"0","tags":"jquery|json|html-select","view_count":"2864"} +{"id":"37056613","title":"Calculate Rolling Mean Without Using pd.rolling_mean()","body":"\u003cp\u003eI know rolling_mean() exists, but this is for a school project so I'm trying to avoid using rolling_mean()\u003c/p\u003e\n\n\u003cp\u003eI'm trying to use the following function on a dataframe series\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef run_mean(array, period):\n ret = np.cumsum(array, dtype=float)\n ret[period:] = ret[period:] - ret[:-period]\n return ret[period - 1:] / period\n\ndata['run_mean'] = run_mean(data['ratio'], 150)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut I'm getting the error 'ValueError: cannot set using a slice indexer with a different length than the value'. \u003c/p\u003e\n\n\u003cp\u003eUsing \u003ccode\u003edata['run_mean'] = pd.rolling_mean(raw_data['ratio'],150)\u003c/code\u003e works exactly fine, what am I missing? \u003c/p\u003e","accepted_answer_id":"37057336","answer_count":"3","comment_count":"0","creation_date":"2016-05-05 17:23:45.95 UTC","last_activity_date":"2016-05-05 18:57:26.56 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3863003","post_type_id":"1","score":"2","tags":"python|pandas","view_count":"144"} +{"id":"34333932","title":"Import contacts from phone to list in my app in android","body":"\u003cp\u003eIn my app, I wanted to enable user to display contacts from their phone. I used this \u003ca href=\"http://examples.javacodegeeks.com/android/core/provider/android-contacts-example/\" rel=\"nofollow\"\u003eexample\u003c/a\u003e to open my phone contacts from the app. But now I want to make a list of contacts in my app, by copying all the contacts from the phone. What would be the best way to do this?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI already know how to display the contacts, but i do not know how to save them to sqlite db. I am a beginner so any help is appreciated. \u003c/p\u003e","accepted_answer_id":"34334337","answer_count":"3","comment_count":"0","creation_date":"2015-12-17 11:52:10.113 UTC","favorite_count":"1","last_activity_date":"2016-03-06 21:35:11.427 UTC","last_edit_date":"2016-03-06 21:35:11.427 UTC","last_editor_display_name":"","last_editor_user_id":"5643914","owner_display_name":"","owner_user_id":"5643914","post_type_id":"1","score":"2","tags":"java|android|android-contacts","view_count":"1405"} +{"id":"9060558","title":"Are these two code equivalent?","body":"\u003cblockquote\u003e\n \u003cp\u003e\u003cstrong\u003ePossible Duplicate:\u003c/strong\u003e\u003cbr\u003e\n \u003ca href=\"https://stackoverflow.com/questions/1013385/what-is-the-difference-between-a-function-expression-vs-declaration-in-javascrip\"\u003eWhat is the difference between a function expression vs declaration in Javascript?\u003c/a\u003e \u003c/p\u003e\n\u003c/blockquote\u003e\n\n\n\n\u003cp\u003eI am a web developer with prime experience in HTML, ASP.NET. I know very little javascript, enough to do simple tasks in web programming. Lately, while reading Jquery and other complex javascript files, I have been observing lot of javascript code as below:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar increment = function(x){\n return x + 1;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to know if this is conceptually same as below, which I have been more used to :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction increment(x){\n return x + 1;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd, if its same, why am I seeing lot of use of first notation rather than second ?\u003c/p\u003e","accepted_answer_id":"9060601","answer_count":"3","comment_count":"0","creation_date":"2012-01-30 07:16:57.987 UTC","favorite_count":"1","last_activity_date":"2014-03-08 23:42:30.593 UTC","last_edit_date":"2017-05-23 11:48:46.947 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"507256","post_type_id":"1","score":"1","tags":"javascript","view_count":"113"} +{"id":"22435335","title":"How to generate valid filename with unicode characters for download?","body":"\u003cp\u003eI add \u003ccode\u003eContent-Disposition\u003c/code\u003e header to generate filename for download. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eself.response.headers['Content-Type'] = 'text/xml'\nself.response.headers['Content-Disposition'] = 'attachment; filename=' + os.path.splitext(filename)[0] + '.nfo'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt works well with English characters, but when the filename contains Russian characters (for ex., \u003ccode\u003efilename = u'Some video file (2014).avi'\u003c/code\u003e) it fails. I tried different combinations of \u003ccode\u003eencode('utf-8')\u003c/code\u003e and \u003ccode\u003eurllib.quote\u003c/code\u003e, but it doesn't help. \u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2014-03-16 09:48:18.747 UTC","last_activity_date":"2014-03-16 09:48:18.747 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"604388","post_type_id":"1","score":"0","tags":"python|google-app-engine|python-2.7|http-headers|filenames","view_count":"36"} +{"id":"15034131","title":"Centos 6 startup script","body":"\u003cp\u003eI need to put a startup script to my CentOS6 server.\u003c/p\u003e\n\n\u003cp\u003eI see that I need a script that contains start-stop cases.\nBut I have a problem to make it and neither how to put this script to startup.\u003c/p\u003e\n\n\u003cp\u003eAnyone can say me how can I add it?\u003c/p\u003e\n\n\u003cp\u003eThe script must run a simply command that run a jar file:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ejava -jar FileName.jar\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"15034298","answer_count":"1","comment_count":"0","creation_date":"2013-02-22 22:18:14.983 UTC","last_activity_date":"2013-03-28 16:51:41.73 UTC","last_edit_date":"2013-03-28 16:51:41.73 UTC","last_editor_display_name":"","last_editor_user_id":"1563422","owner_display_name":"","owner_user_id":"1521502","post_type_id":"1","score":"2","tags":"linux|centos|startup|centos6","view_count":"12435"} +{"id":"34168749","title":"Pan Segue Calls viewDidLoad Loop","body":"\u003cp\u003eMy pan gesture programmatically fakes a button press. If you press the actual button, the VC's viewDidLoad runs again once, stops, and is fine. \u003cstrong\u003eBut\u003c/strong\u003e when I use the pan-gesture to programmatically fake the button press, the viewDidLoad runs about seven times, then stops.\u003c/p\u003e\n\n\u003cp\u003eThe right-edge gesture triggers the \"tomorrow\" state which loads a handful of times. At that point, a left-edge gesture triggers the \"today\" state. That also loads 4-5 times.\u003c/p\u003e\n\n\u003cp\u003eAny ideas? Some code below, if needed.\u003c/p\u003e\n\n\u003cp\u003ePan gesture added in viewDidLoad:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e //Adds edge gesture depending on VC state\n if curMainList == \"Today\" {\n let panLeftEdgeGesture_MainVC = UIScreenEdgePanGestureRecognizer(target: self, action: \"panLeftEdge_toLifeList:\")\n panLeftEdgeGesture_MainVC.edges = .Left\n view.addGestureRecognizer(panLeftEdgeGesture_MainVC)\n\n let panRightEdgeGesture_MainVC = UIScreenEdgePanGestureRecognizer(target: self, action: \"panFromRightEdgeAction:\")\n panRightEdgeGesture_MainVC.edges = .Right\n view.addGestureRecognizer(panRightEdgeGesture_MainVC)\n\n self.footer_LeftBtn.addTarget(self, action: \"LeftFooterBtnPress\", forControlEvents: UIControlEvents.TouchUpInside)\n }\n else {\n let panLeftEdgeGesture = UIScreenEdgePanGestureRecognizer(target: self, action: \"panFromLeftEdgeAction:\")\n panLeftEdgeGesture.edges = .Left\n view.addGestureRecognizer(panLeftEdgeGesture)\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eGesture's triggered:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e//Gestures visible when view is 'Today'\nfunc panLeftEdge_toLifeList(sender: UIScreenEdgePanGestureRecognizer) {\n dispatch_async(dispatch_get_main_queue()) { () -\u0026gt; Void in\n self.performSegueWithIdentifier(\"segueToLifeLists\", sender: nil)\n }\n}\n\nfunc panFromRightEdgeAction(sender: UIScreenEdgePanGestureRecognizer) {\n //self.tomHdrBtnPress(tomorrowHdr)\n tomorrowHdr.sendActionsForControlEvents(UIControlEvents.TouchUpInside)\n}\n\n//Gesture added when viewing 'Tomorrow' list\nfunc panFromLeftEdgeAction(sender: UIScreenEdgePanGestureRecognizer) {\n //self.todayHdrBtnPress(todayHdr)\n todayHdr.sendActionsForControlEvents(UIControlEvents.TouchUpInside)\n}\n\n@IBAction func todayHdrBtnPress(sender: AnyObject) {\n UIView.animateWithDuration(0.75, animations: {\n //Header changes\n self.hdrBox.backgroundColor = UIColor(red: 46/255.0, green: 173/255.0, blue: 11/255.0, alpha: 1.0)\n self.footer_RightArrow.hidden = false\n self.footer_RightBtn.hidden = false\n }\n , completion: nil\n )\n curMainList = \"TodayTask\"\n currentListEntity = curMainList\n viewDidLoad()\n}\n\n@IBAction func tomHdrBtnPress(sender: AnyObject) {\n UIView.animateWithDuration(0.75, animations: {\n //Header changes\n self.hdrBox.backgroundColor = UIColor(red: 49/255.0, green: 82/255.0, blue: 171/255.0, alpha: 1.0)\n self.footer_LeftBtn.addTarget(self, action: \"LeftFooterBtnPress\", forControlEvents: UIControlEvents.TouchUpInside)\n }\n , completion: nil\n )\n curMainList = \"TomTask\"\n currentListEntity = curMainList\n viewDidLoad()\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"34169139","answer_count":"1","comment_count":"5","creation_date":"2015-12-09 00:33:22.267 UTC","last_activity_date":"2015-12-09 02:02:34.957 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3754003","post_type_id":"1","score":"0","tags":"ios|swift|uibutton|uipangesturerecognizer","view_count":"61"} +{"id":"565867","title":"Setup tips for installing a new SQL Server Database","body":"\u003cp\u003eFor cost savings, we're moving from an managed SQL Server DB to a dedicated db on our own server.\u003c/p\u003e\n\n\u003cp\u003eWhat configuration checklist would you perform to ensure maximum security and reliability?\u003c/p\u003e","accepted_answer_id":"566128","answer_count":"5","comment_count":"0","creation_date":"2009-02-19 15:33:36.763 UTC","favorite_count":"1","last_activity_date":"2009-12-08 00:12:36.717 UTC","last_edit_date":"2009-12-08 00:12:36.717 UTC","last_editor_display_name":"Cade Roux","last_editor_user_id":"76337","owner_display_name":"Niels Bosma","owner_user_id":"40939","post_type_id":"1","score":"2","tags":"sql-server|configuration|installation","view_count":"171"} +{"id":"23037389","title":"strange collision detection behavior in javascript 'game engine.'","body":"\u003cp\u003eIf you play with the 'game' I've set up for a moment, you'll observe that the avatar falls right through the second platform when jumping onto it. I simply cannot fathom why this is. I understand that this is probably more code than should be posted, but I'm at my wits end, and maybe someone could quickly see what I'm doing wrong.\nThe 'game' in question. Just use the arrow keys for run and jump. \u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://jsfiddle.net/QGB69/\" rel=\"nofollow\"\u003ehttp://jsfiddle.net/QGB69/\u003c/a\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e//RequestAnimationFrame shim. \n\nwindow.requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame;\n\n\n//Initializing canvas and world\n\nvar canvas = document.getElementById('viewport');\nvar ctx = canvas.getContext('2d');\nvar keysDown = [];\nvar currentPlatform = 0;\n\n//some helpful variables\n\nvar canvasHeight = $('#viewport').height();\nvar canvasWidth = $('#viewport').width();\n\n\n//Add keycodes to 'keysDown' array\n\n$(document).keydown(function (e) {\n if ($.inArray(e.which, keysDown) === -1) {\n keysDown.push(e.keyCode);\n }\n});\n\n\n//Remove keycodes from 'keysDown' array\n\n$(document).keyup(function (e) {\n if ($.inArray(e.which, keysDown) \u0026gt; -1) {\n keysDown = $.grep(keysDown, function (n, i) {\n return n !== e.which;\n });\n }\n});\n\n\n//Avatar object, lots of attributes, great import!\n\nvar avatar = {};\n\navatar.xPos = 50;\navatar.yPos = 50;\navatar.accl = 0.55;\navatar.decel = 0.85;\navatar.jReduction = 1.25;\navatar.direction = null;\navatar.stopping = false;\navatar.avatarHeight = 50;\navatar.avatarWidth = 25;\navatar.fallTime = 0;\navatar.isGrounded = false;\navatar.isJumping = false;\navatar.endJump = false;\navatar.jump = 18;\navatar.j = avatar.jump;\navatar.jStrength = 0.55;\navatar.speed = 13;\navatar.prevXPos = 0;\navatar.xDelta = 0;\navatar.xVelocity = 0;\navatar.yVelocity = 0;\navatar.yBottom = 0;\navatar.xAlignment = 0;\n\n\navatar.collDetect = function (args) {\n\n avatar.yBottom = avatar.yPos + avatar.avatarHeight;\n avatar.xPosRight = avatar.xPos + avatar.avatarWidth;\n\n\n for (i = 0; i \u0026lt; arguments.length; i++) {\n if (avatar.yBottom \u0026gt; arguments[i].boxTop) {\n if (avatar.xPos \u0026gt; arguments[i].xPos) {\n if (avatar.direction === 'left' \u0026amp;\u0026amp; avatar.xDelta \u0026gt; avatar.xPos - arguments[i].xPosRight) {\n avatar.xPos = arguments[i].xPosRight;\n avatar.xStop();\n } else if (avatar.direction === 'left' \u0026amp;\u0026amp; avatar.xPos \u0026lt;= arguments[i].xPosRight) {\n avatar.xPos = arguments[i].xPosRight;\n avatar.xStop();\n }\n } else if (avatar.xPos \u0026lt; arguments[i].xPos) {\n if (avatar.direction === 'right' \u0026amp;\u0026amp; avatar.xDelta \u0026gt; arguments[i].xPos - avatar.xPosRight) {\n avatar.xPos = arguments[i].xPos - avatar.avatarWidth;\n avatar.xStop();\n } else if (avatar.direction === 'right' \u0026amp;\u0026amp; avatar.xPos \u0026gt;= arguments[i].xPos) {\n avatar.xPos = arguments[i].xPos - avatar.avatarWidth;\n avatar.xStop();\n }\n }\n }\n\n if (avatar.xPos \u0026gt; arguments[i].xPos - avatar.avatarWidth \u0026amp;\u0026amp; avatar.xPos \u0026lt; arguments[i].xPos + arguments[i].boxWidth) {\n currentPlatform = arguments[i].boxHeight;\n } else {\n currentPlatform = 0;\n }\n }\n};\n\navatar.xStop = function () {\n avatar.xVelocity = 0;\n avatar.xDelta = 0;\n avatar.stopping = false;\n avatar.direction = null;\n};\n\n//First obstacle. Good luck gettin' over this one, avatar! \n\nfunction Box(xPos, boxWidth, boxHeight, boxColor) {\n this.xPos = xPos;\n this.boxWidth = boxWidth;\n this.boxHeight = boxHeight;\n this.boxColor = boxColor;\n this.xPosRight = xPos + boxWidth;\n this.boxTop = canvasHeight - boxHeight;\n}\n\nfunction renderBoxes(n) {\n for (i = 0; i \u0026lt; arguments.length; i++) {\n ctx.fillStyle = arguments[i].boxColor;\n ctx.fillRect(arguments[i].xPos,\n canvasHeight - arguments[i].boxHeight,\n arguments[i].boxWidth,\n arguments[i].boxHeight);\n }\n}\n\nvar box1 = new Box(100, 50, 100, 'gray');\nvar box2 = new Box(300, 50, 125, 'green');\n\n\n//physics object. Properties of the world \n\nvar physx = {};\nphysx.gravity = 1;\nphysx.colliding = false;\nphysx.fallTimeModifier = 0.5;\n\n\n//Big movement function. The action's in here!\n\nfunction moveIt() {\n\n //Jump!\n\n if ($.inArray(38, keysDown) \u0026gt; -1) {\n\n if (avatar.j \u0026gt; 0) {\n avatar.isGrounded = false;\n avatar.isJumping = true;\n avatar.yPos -= avatar.j;\n avatar.yVelocity = avatar.j;\n avatar.j -= avatar.jStrength;\n } else if (avatar.j \u0026lt;= 0) {\n avatar.isJumping = false;\n }\n }\n\n //End Jump, initiated when the user lets off the jump key mid-jump.\n\n if (avatar.endJump === true) {\n\n if (avatar.j \u0026gt; 0) {\n avatar.j -= avatar.jReduction;\n avatar.yPos -= avatar.j;\n } else if (avatar.j \u0026lt;= 0) {\n avatar.isJumping = false;\n avatar.endJump = false;\n }\n\n }\n\n $(document).keyup(function (e) {\n if (e.which === 38 \u0026amp;\u0026amp; avatar.isJumping === true) {\n avatar.endJump = true;\n }\n });\n\n //Accounting for deceleration when avatar stops.\n\n if (avatar.stopping === true) {\n\n if ((avatar.xVelocity - avatar.decel) \u0026lt;= 0) {\n avatar.xStop();\n return;\n }\n\n if (avatar.direction === 'right') {\n avatar.xPos += avatar.xVelocity;\n avatar.xVelocity -= avatar.decel;\n avatar.xDelta = avatar.xVelocity;\n }\n\n if (avatar.direction === 'left') {\n avatar.xPos -= avatar.xVelocity;\n avatar.xVelocity -= avatar.decel;\n avatar.xDelta = avatar.xVelocity\n }\n }\n\n\n //Correcting glitchy stopping behavior when conflicting left/right keycodes present in 'keysDown' array\n\n if ($.inArray(37, keysDown) \u0026gt; -1 \u0026amp;\u0026amp; $.inArray(39, keysDown) \u0026gt; -1) {\n avatar.stopping = true;\n }\n\n //right\n\n if ($.inArray(39, keysDown) \u0026gt; -1) {\n\n if (avatar.stopping === false) {\n avatar.direction = 'right';\n if (avatar.xVelocity \u0026gt;= avatar.speed) {\n avatar.xPos += avatar.speed;\n avatar.xDelta = avatar.speed;\n } else {\n avatar.xPos += avatar.xVelocity;\n avatar.xVelocity += avatar.accl;\n avatar.xDelta = avatar.xVelocity;\n }\n }\n }\n\n\n //left\n\n if ($.inArray(37, keysDown) \u0026gt; -1) {\n\n if (avatar.stopping === false) {\n avatar.direction = 'left';\n if (avatar.xVelocity \u0026gt;= avatar.speed) {\n avatar.xPos -= avatar.speed;\n avatar.xDelta = avatar.speed;\n } else {\n avatar.xPos -= avatar.xVelocity;\n avatar.xVelocity += avatar.accl;\n avatar.xDeta = avatar.xVelocity;\n }\n }\n }\n\n\n //Set avatar.isStopping to true when \n\n $(document).keyup(function (e) {\n if (e.which === 39 || e.which === 37) {\n avatar.stopping = true;\n }\n });\n}\n\n//Gravity function. Keep him on the dang ground!\n\nfunction grav() {\n\n if (avatar.isJumping) {\n return;\n }\n\n if (avatar.yPos \u0026gt;= (canvasHeight - currentPlatform) - avatar.avatarHeight) {\n avatar.isGrounded = true;\n avatar.fallTime = 0;\n } else {\n if ((avatar.fallTime * physx.gravity) \u0026gt; (((canvasHeight - currentPlatform) - avatar.avatarHeight) - avatar.yPos)) {\n avatar.yPos = (canvasHeight - currentPlatform) - avatar.avatarHeight;\n avatar.isGrounded = true;\n avatar.j = avatar.jump;\n avatar.fallTime = 0;\n } else {\n avatar.yPos += avatar.fallTime * physx.gravity;\n avatar.fallTime += physx.fallTimeModifier;\n }\n }\n}\n\n\n//Render the dang thing, ya dingus!\n\nfunction render() {\n\n ctx.clearRect(0, 0, canvasWidth, canvasHeight);\n renderBoxes(box1, box2);\n avatar.collDetect(box2, box1);\n grav();\n ctx.fillStyle = 'red';\n ctx.fillRect(avatar.xPos,\n avatar.yPos,\n avatar.avatarWidth,\n avatar.avatarHeight);\n moveIt();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThank you!\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-04-12 23:32:24.377 UTC","last_activity_date":"2014-04-12 23:50:01.327 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1847774","post_type_id":"1","score":"0","tags":"javascript|html5|html5-canvas|collision-detection|game-engine","view_count":"77"} +{"id":"21294","title":"Dynamically load a JavaScript file","body":"\u003cp\u003eHow can you reliably and dynamically load a JavaScript file? This will can be used to implement a module or component that when 'initialized' the component will dynamically load all needed JavaScript library scripts on demand.\u003c/p\u003e\n\n\u003cp\u003eThe client that uses the component isn't required to load all the library script files (and manually insert \u003ccode\u003e\u0026lt;script\u0026gt;\u003c/code\u003e tags into their web page) that implement this component - just the 'main' component script file.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eHow do mainstream JavaScript libraries accomplish this (Prototype, jQuery, etc)?\u003c/strong\u003e Do these tools merge multiple JavaScript files into a single redistributable 'build' version of a script file? Or do they do any dynamic loading of ancillary 'library' scripts?\u003c/p\u003e\n\n\u003cp\u003eAn addition to this question: \u003cstrong\u003eis there a way to handle the event after a dynamically included JavaScript file is loaded?\u003c/strong\u003e Prototype has \u003ccode\u003edocument.observe\u003c/code\u003e for document-wide events. Example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edocument.observe(\"dom:loaded\", function() {\n // initially hide all containers for tab content\n $$('div.tabcontent').invoke('hide');\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eWhat are the available events for a script element?\u003c/strong\u003e\u003c/p\u003e","accepted_answer_id":"242607","answer_count":"20","comment_count":"1","creation_date":"2008-08-21 21:59:31.08 UTC","favorite_count":"68","last_activity_date":"2017-08-03 15:42:40.717 UTC","last_edit_date":"2014-04-11 22:01:42.697 UTC","last_editor_display_name":"Adam","last_editor_user_id":"1350209","owner_display_name":"Adam","owner_user_id":"1341","post_type_id":"1","score":"125","tags":"javascript|file|import|include","view_count":"93009"} +{"id":"12595370","title":"Rounded corners are not working in IE9","body":"\u003cblockquote\u003e\n \u003cp\u003e\u003cstrong\u003ePossible Duplicate:\u003c/strong\u003e\u003cbr\u003e\n \u003ca href=\"https://stackoverflow.com/questions/5381446/ie9-border-radius\"\u003eie9 border radius\u003c/a\u003e \u003c/p\u003e\n\u003c/blockquote\u003e\n\n\n\n\u003cp\u003eRounded corners are not working for me in IE9.\u003c/p\u003e\n\n\u003cp\u003eHere is my CSS:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e-moz-border-radius: 5px;\n-webkit-border-radius: 5px;\nborder-radius: 5px;\n-khtml-border-radius: 5px;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhy are they not working?\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2012-09-26 05:57:42.2 UTC","favorite_count":"1","last_activity_date":"2012-09-26 05:59:36.923 UTC","last_edit_date":"2017-05-23 12:12:23.937 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"1613586","post_type_id":"1","score":"1","tags":"css3|internet-explorer-9","view_count":"37"} +{"id":"14227084","title":"Web API Post with Class Inheritence Not Working","body":"\u003cp\u003eI've been trying to get this to work for a long time, and haven't figured it out.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eWeb API Post Method\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic BaseLowerItem Post([FromBody] BaseLowerItem value)\n{\n return value;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eWhat I'm Doing...\u003c/strong\u003e\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eWP7 app posts a Json-serialized \u003cstrong\u003eYearSending\u003c/strong\u003e to the web api.\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003e\u003cstrong\u003eProblem:\u003c/strong\u003e\nWeb API's Post gets a NULL value! It doesn't get the YearSending. If I changed the Post to Post(YearSending value), then it works like normal.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eClasses\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[DataContract, KnownType(typeof(YearSending))]\npublic class BaseLowerItem\n{\n [DataMember]\n public long Id { get; set; }\n}\n\n[DataContract]\npublic class YearSending : BaseLowerItem\n{\n [DataMember]\n public string Name { get; set; }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow do I tell it to get the right value? I already have the KnownType in the BaseLowerItem class as you can see.\u003c/p\u003e","answer_count":"0","comment_count":"4","creation_date":"2013-01-09 01:47:16.25 UTC","last_activity_date":"2013-01-09 01:47:16.25 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1454643","post_type_id":"1","score":"-1","tags":"asp.net-web-api","view_count":"749"} +{"id":"14242549","title":"bind() error : Cannot assign requested address","body":"\u003cp\u003ebind () error : Cannot assign requested address. \u003c/p\u003e\n\n\u003cp\u003enew_socket= socket(AF_INET, SOCK_DGRAM, 0);\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elocalIP = \"128.1.1.64\";\n\nmemset(\u0026amp;socket_data, 0, sizeof(socket_data));\n\n// Fill the socket structure\nsocket_data.sin_family = AF_INET;\nsocket_data.sin_addr.s_addr = inet_addr(localIP);\nsocket_data.sin_port = htons(PortNumber);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebind( new_socket, (struct sockaddr*) \u0026amp;socket_data, sizeof(socket_data))\u003c/p\u003e\n\n\u003cp\u003eDoes any one know why the bind() is failing?\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2013-01-09 17:06:50.707 UTC","last_activity_date":"2013-07-24 09:02:39.797 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1501078","post_type_id":"1","score":"1","tags":"api|bind","view_count":"953"} +{"id":"18524425","title":"Java - How to make a variable that can be used anywhere?","body":"\u003cp\u003eI want to make a variable that I can use inside my method to change that variable outside my method. As a visual: (I imported the scanner class by the way)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic static void main(String[] args) {\n\n int quitVar = 1;\n Scanner scan = new Scanner(System.in);\n\n class IWantToQuit {\n public void quit() {\n quitVar++; //This is the problem area.\n }\n }\n IWantToQuit quiter = new IWantToQuit();\n while (quitVar == 1) {\n System.out.println(\"HELLO\");\n System.out.println(\"Type QUIT to quit.\");\n choice = scan.next();\n if (choice.equals(\"QUIT\")) {\n quiter.quit();\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFor some reason, it says that the local variable quitVar is accessed by the inner class but it needs to be declared and I have declared it. Any help is appreciated.\u003c/p\u003e","answer_count":"3","comment_count":"1","creation_date":"2013-08-30 03:25:21.657 UTC","favorite_count":"1","last_activity_date":"2013-08-30 03:48:01.957 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2731376","post_type_id":"1","score":"1","tags":"java|variables|loops","view_count":"1112"} +{"id":"22083266","title":"Link to Page Anchor pad top","body":"\u003cp\u003eI have a sticky navigation on the top of my page and i also have one as the right column.\u003c/p\u003e\n\n\u003cp\u003eMy problem is that when i link the side navigation to an anchor it scrolls the page to that anchor and puts it behind the top navigation.\u003c/p\u003e\n\n\u003cp\u003eIs there anyway that i can have it so it scrolls the page to \u003ccode\u003e100px\u003c/code\u003e above the actual anchor so it isn't behind the top sticky navigation?\u003c/p\u003e\n\n\u003cp\u003eI am using bootstrap with \u003ccode\u003eaffix-top\u003c/code\u003e on the top navigation and \u003ccode\u003edata-spy=\"scroll\" and also\u003c/code\u003eaffix` on the right column navigation\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003ebold\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eSince i am using the \u003ccode\u003edata-spy=\"scroll\"\u003c/code\u003e this affects the way that the \u003ccode\u003escrollspy\u003c/code\u003e works since the anchor goes behind the top navigation before it changes the spy on the side navigation.\u003c/p\u003e\n\n\u003cp\u003eThis is why i ant to have an offset on my anchor. \u003c/p\u003e","accepted_answer_id":"22083480","answer_count":"2","comment_count":"0","creation_date":"2014-02-27 23:50:08.023 UTC","last_activity_date":"2014-02-28 00:23:50.807 UTC","last_edit_date":"2014-02-28 00:07:59.06 UTC","last_editor_display_name":"","last_editor_user_id":"2387756","owner_display_name":"","owner_user_id":"2387756","post_type_id":"1","score":"1","tags":"html|css|nav","view_count":"137"} +{"id":"11322931","title":"Alternate to iisreset","body":"\u003cp\u003eI have multiple sites on production server, some time one of site go down when heavy utility ended, which need iisreset, but iisreset cause all site down in resetting the iis. I want to reset the one site only, not all application pool. How i can reset my particular site of application pool.\u003c/p\u003e","answer_count":"3","comment_count":"0","creation_date":"2012-07-04 05:32:51.953 UTC","last_activity_date":"2012-07-04 07:32:53.183 UTC","last_edit_date":"2012-07-04 05:34:48.07 UTC","last_editor_display_name":"","last_editor_user_id":"968261","owner_display_name":"","owner_user_id":"1465579","post_type_id":"1","score":"1","tags":"asp.net|iis|web-config","view_count":"1413"} +{"id":"35925470","title":"Print regression tables with multiple standard errors","body":"\u003cp\u003eI would like to print two types of standard errors for each coefficient (e.g., robust and not) in the same regression table. For example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e# Simulate some data \ndat \u0026lt;- data.frame(y=runif(100), matrix(rnorm(200), 100, 2))\nfit \u0026lt;- lm(y ~ X1 + X2, data=dat)\n\n# Compute robust SE\nlibrary(sandwich)\ncov1 \u0026lt;- vcovHC(fit, type=\"HC\")\nrobust.se \u0026lt;- sqrt(diag(cov1))\n\n# print regression table in latex\nlibrary(stargazer)\nstargazer(fit)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow to add the robust SE as an additional row below each coefficient in the square brackets?\u003c/p\u003e\n\n\u003cp\u003eSomething like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Model 1 \n\nX1 0.012\n (0.14) \n [0.21]\n\nX2 0.72\n (0.64) \n [0.88]\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"35943586","answer_count":"2","comment_count":"3","creation_date":"2016-03-10 19:26:15.613 UTC","last_activity_date":"2017-11-20 16:15:48.413 UTC","last_edit_date":"2016-03-10 21:30:26.493 UTC","last_editor_display_name":"","last_editor_user_id":"3760619","owner_display_name":"","owner_user_id":"3760619","post_type_id":"1","score":"1","tags":"r|stargazer","view_count":"183"} +{"id":"46347987","title":"RestSharp - Passing Token into GET call","body":"\u003cp\u003eI'm using OAuth2.0 to obtain a token which must be passed alongside the GET call.\u003c/p\u003e\n\n\u003cp\u003eI've built the POST method to obtain a token.\u003c/p\u003e\n\n\u003cp\u003eHow can I use this token in a GET method to pass it alongside the call that I'm making?\u003c/p\u003e\n\n\u003cp\u003eWould the following work or is there another attribute that I should be using?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003erequest.Method = \"GET\";\nrequest.AddParameter= (\"token\", TokenVariableStoringValueFromPOST);\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"1","creation_date":"2017-09-21 15:37:01.55 UTC","last_activity_date":"2017-10-06 16:37:26.353 UTC","last_edit_date":"2017-10-06 16:37:26.353 UTC","last_editor_display_name":"","last_editor_user_id":"5358695","owner_display_name":"","owner_user_id":"5358695","post_type_id":"1","score":"0","tags":"c#|rest|oauth-2.0|restsharp","view_count":"104"} +{"id":"11646627","title":"ADF Security disable RichCommandButton for Application Role","body":"\u003cp\u003eI am using Oracle ADF with JDeveloper 11g release 1, I'm crazy to configure application roles for the various groups. Let me explain, I have the following situation and I'm looking for some ideas: I want to enable the commit (RichCommandButton) Enterprise only certain role, what should I do? I decided to do an if statement in BackingBean get method in the page, correct? What is the proper way to proceed?\u003c/p\u003e","answer_count":"3","comment_count":"1","creation_date":"2012-07-25 09:25:27.417 UTC","last_activity_date":"2012-07-26 05:43:00.563 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"810724","post_type_id":"1","score":"0","tags":"oracle-adf","view_count":"904"} +{"id":"29213249","title":"Display the saved data in my dropdown list","body":"\u003cp\u003eHello I have a dropdown list which I display all the data that I have in my database in a specific table.\nNow I want to display first a data from another table of my database, to be more specific I want to display first in my dropdown list the column specialty from the table doctor.\nHow can I do that?\u003c/p\u003e\n\n\u003cp\u003eBelow is the code in order to display the data from another table in my database:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;label id=\"Specialty\"\u0026gt;Specialty:\u0026lt;/label\u0026gt;\n \u0026lt;select id=\"SelectSpecialty\" name=\"specialty\"\u0026gt;\n \u0026lt;?php\n $sql = mysql_query(\"SELECT name FROM specialties\");\n while ($row = mysql_fetch_array($sql)){\n echo \"\u0026lt;option value='\".$row['name'].\"'\u0026gt;\".$row['name'].\"\u0026lt;/option\u0026gt;\";\n }\n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ePS: I want to display both datas from the two tables in the dropdown list\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2015-03-23 14:47:45.99 UTC","last_activity_date":"2015-03-23 14:52:37.963 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4406311","post_type_id":"1","score":"0","tags":"mysql","view_count":"33"} +{"id":"32840035","title":"pandas groupby not working for 3 columns","body":"\u003cp\u003eI am trying to calculate Sum of column d in group by result of column a,b,c.\u003c/p\u003e\n\n\u003cp\u003eAlthough I have 2 different values in column c but still it is not coming as part of same group resulting sum is not calculated properly.\u003c/p\u003e\n\n\u003cp\u003ePlease suggest.\nCode I am using is :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003es = df.groupby(['a','b','c'])['d'].sum()\n\na b c d\n\n1 ab 123 1\n\n1 ab 123 2\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOutput should be :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e1 ab 123 3\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut output is coming as\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e1 ab 123 1\n\n 123 2\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003edf.dtypes\u003c/p\u003e\n\n\u003cp\u003ea int64\u003c/p\u003e\n\n\u003cp\u003eb object\u003c/p\u003e\n\n\u003cp\u003ec object\u003c/p\u003e\n\n\u003cp\u003ed float64\u003c/p\u003e","accepted_answer_id":"32880292","answer_count":"1","comment_count":"7","creation_date":"2015-09-29 09:06:39.413 UTC","last_activity_date":"2015-10-01 05:51:29.14 UTC","last_edit_date":"2015-10-01 05:49:12.67 UTC","last_editor_display_name":"","last_editor_user_id":"2922515","owner_display_name":"","owner_user_id":"2922515","post_type_id":"1","score":"0","tags":"python|pandas","view_count":"57"} +{"id":"20671614","title":"Error with multiple self-invoking functions in one script: a case for a semicolon","body":"\u003cp\u003eIn certain circumstances, having more than one self-invoking function in a single JavaScript file provokes an error. Getting the second function to return a value averts the error.\u003c/p\u003e\n\n\u003cp\u003eI have a barebones HTML file...\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;script src=\"two.js\"\u0026gt;\u0026lt;/script\u0026gt;\n\u0026lt;script src=\"one.js\"\u0026gt;\u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e... using these scripts:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e// two.js\n(function () {\n console.log('1/2')\n})()\n\n(function () {\n console.log('2/2')\n})()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e    \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e// one.js\n(function () {\n console.log('1/1')\n})()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I open the file in Chrome, I get this output:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e1/2 two.js:2\nUncaught TypeError: undefined is not a function two.js:6\n1/1\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOther browsers complain in their own way. In other words, having two self-invoking functions in the same script causes a problem. Having one self-invoking function per script works fine. If I comment out the second function script two.js, there is no problem.\u003c/p\u003e\n\n\u003cp\u003eHowever, if I get the second function to return a value, then there is no problem either. Everything works fine if I change two.js to this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e(function () {\n console.log('1/2')\n})()\n\nfoo = (function () {\n console.log('2/2')\n return 'bar'\n})()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhy does the first version fail and the second succeed?\u003c/p\u003e","accepted_answer_id":"20671629","answer_count":"2","comment_count":"1","creation_date":"2013-12-19 00:57:03.457 UTC","last_activity_date":"2013-12-19 01:07:31.28 UTC","last_edit_date":"2013-12-19 01:07:31.28 UTC","last_editor_display_name":"","last_editor_user_id":"1927589","owner_display_name":"","owner_user_id":"1927589","post_type_id":"1","score":"3","tags":"javascript|runtime-error|anonymous-function|semicolon|self-invoking-function","view_count":"511"} +{"id":"39038048","title":"send get or post php data to server on button click android","body":"\u003cp\u003e\u003cstrong\u003eI want pass post or get data from android on button click to php server, without using browser.\u003c/strong\u003e\nfor eg \n\u003cem\u003e\u003ca href=\"http://localhost:81/anis/car.php?name=xyz\" rel=\"nofollow\"\u003ehttp://localhost:81/anis/car.php?name=xyz\u003c/a\u003e\u003c/em\u003e\nis data i want to pass on button click. without using browser.\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2016-08-19 11:34:19.76 UTC","last_activity_date":"2016-08-19 12:40:23.17 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6734694","post_type_id":"1","score":"-5","tags":"php|android|post|get","view_count":"195"} +{"id":"38579919","title":"Visual Studio emulator failed to Start due to Server execution failure","body":"\u003cp\u003eI have tried the following for the past four days\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eRepaired Microsoft Visual Studio Emulator for Android\u003c/li\u003e\n\u003cli\u003eRepaired Windows Phone 8.1 Emulators\u003c/li\u003e\n\u003cli\u003eRemoved of all existing virtual Switches\u003c/li\u003e\n\u003cli\u003eRan XdeClenup.exe\u003c/li\u003e\n\u003cli\u003eDisabled Network Sharing on Ethernet\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eNo luck yet. i still get error that; \u003c/p\u003e\n\n\u003cp\u003eThe emulator was unable to verify that Virtual machine is running.(checked my vmms service and its on and running)\u003c/p\u003e\n\n\u003cp\u003eSomething happened while starting a virtual machine 'VS Emulator 5\" Inch Kit Kat(4.4) XXHDPI Phone' virtual Machine ID(.......)\u003c/p\u003e\n\n\u003cp\u003e'VS Emulator 5\" Inch Kit Kat(4.4) XXHDPI Phone' failed to start worker process: Server Execution failed (0x80080005). Virtual Machine ID (........) \u003ca href=\"http://i.stack.imgur.com/LIuyo.png\" rel=\"nofollow\"\u003eError message Image\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eMy Ram size is 4gb, OS is Windows 8.1 Pro\u003c/p\u003e\n\n\u003cp\u003eThanks for any help.\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2016-07-26 01:52:03.893 UTC","favorite_count":"1","last_activity_date":"2016-07-27 17:15:00.333 UTC","last_edit_date":"2016-07-27 17:11:17.953 UTC","last_editor_display_name":"","last_editor_user_id":"6435732","owner_display_name":"","owner_user_id":"6435732","post_type_id":"1","score":"0","tags":"c#|android|visual-studio|xamarin|android-emulator","view_count":"153"} +{"id":"28432349","title":"python:replace characters in file under condition","body":"\u003cp\u003eI am trying to handle a file \u003ccode\u003eoutput.dat\u003c/code\u003e by substituting values that exceed \u003ccode\u003e1\u003c/code\u003e with \u003ccode\u003e1\u003c/code\u003e.\nE.g if the file contains numbers like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e1\n2\n3\n4\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want it the output to be:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e1\n1\n1\n1\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"2","creation_date":"2015-02-10 13:01:40.583 UTC","last_activity_date":"2015-02-16 16:20:57.35 UTC","last_edit_date":"2015-02-10 13:11:50.83 UTC","last_editor_display_name":"","last_editor_user_id":"4099593","owner_display_name":"","owner_user_id":"4550484","post_type_id":"1","score":"0","tags":"python|file-io","view_count":"74"} +{"id":"21189773","title":"jQuery (with Django): Appending URL to List with click event","body":"\u003cp\u003eWhen I add something to the 'patient_medications' list from the medicines list, I want to be able to delete it with the class click event for 'medication-on'. The click event works for medications that are generated from the original code, but my additions do not delete when clicked. What am I doing wrong? Is something wrong with this line?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$('#patient_medications').append('\u0026lt;li\u0026gt;\u0026lt;a href=\"#\" class=\"medication-on\" data-cost='+cost+'\u0026gt;'+med_name+'\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;');\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe link is added but clicking does not cause the event.\u003c/p\u003e\n\n\u003cp\u003eI would also appreciate any guidance on the best way to do something like this with a very large amount of medications, say, generate the urls for all medicines from a search box or have a cool widget to select some based on user input.\u003c/p\u003e\n\n\u003cp\u003eThank you.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;ul id='patient_medications'\u0026gt;\n{% for med in patient.medications.all %}\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#\" class=\"medication-on\" data-cost=\"{{med.m_cost}}\"\u0026gt;{{med.name}}\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n{% endfor %}\n\u0026lt;/ul\u0026gt;\n\u0026lt;/div\u0026gt;\n\u0026lt;h4\u0026gt;Total Cost (30-day supply):\u0026lt;/h4\u0026gt;\n\u0026lt;div id=\"costs\"\u0026gt;\n{{sum.m_cost__sum}}\n\u0026lt;/div\u0026gt;\n\u0026lt;h3\u0026gt;Available Medications:\u0026lt;/h3\u0026gt;\n{% for m in medications %}\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#\" class=\"medication-link\" data-cost=\"{{m.m_cost}}\"\u0026gt;{{m.name}}\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n{% endfor %}\n\u0026lt;/div\u0026gt;\n\u0026lt;script type=\"text/javascript\"\u0026gt;\n$('.medication-on').click(function() {\n var link = $(this);\n var cost = link.data(\"cost\");\n var costs = $('#costs');\n var cur_cost = parseFloat(costs.html());\n var result = cur_cost - cost;\n costs.html(result);\n $(this).parent().remove();\n $(this).remove();\n});\n$('.medication-link').click(function() {\n event.preventDefault();\n var link = $(this);\n var med_name = link.html();\n var cost = link.data(\"cost\");\n $('#patient_medications').append('\u0026lt;li\u0026gt;\u0026lt;a href=\"#\" class=\"medication-on\" data-cost='+cost+'\u0026gt;'+med_name+'\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;');\n var costs = $('#costs');\n var cur_cost = parseFloat(costs.html());\n var result = cur_cost + cost;\n costs.html(result);\n});\n\n\u0026lt;/script\u0026gt;\n{% endblock %}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"2","creation_date":"2014-01-17 15:35:35.43 UTC","last_activity_date":"2014-01-17 15:35:35.43 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2584372","post_type_id":"1","score":"0","tags":"jquery|html|url|click|append","view_count":"159"} +{"id":"6186386","title":"XSLT last position within attribute","body":"\u003cp\u003eI need to check whether a node with certain attribute is the last in the loop, and accordingly insert and ampersand before the last node. I tried using the \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;xsl:if test=\"position() = last()\"\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003edoesn't seem to take into consideration the attribute value. \u003c/p\u003e\n\n\u003cp\u003eHere's the XML\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;creators and-others=\"no\"\u0026gt;\n \u0026lt;creator type=\"personal\"\u0026gt;Roche, R.L.\u0026lt;/creator\u0026gt; \n \u0026lt;creator type=\"personal\"\u0026gt;Moulin, D.\u0026lt;/creator\u0026gt; \n \u0026lt;creator type=\"personal\"\u0026gt;James, K.\u0026lt;/creator\u0026gt; \n \u0026lt;creator type=\"affiliation\"\u0026gt;CEA Centre d'Etudes Nucleaires de Saclay, 91 - Gif-sur- zYvette (France). Dept. d'Etudes Mecaniques et Thermiques\u0026lt;/creator\u0026gt; \n\u0026lt;/creators\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI need the output as, \u003ccode\u003eRoche, R.L., Moulin, D., \u0026amp; James, K.\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eAlso, is there a way, to get the count of values for the \"creator\" node, with attribute \"personal\" ?\u003c/p\u003e","accepted_answer_id":"6186708","answer_count":"5","comment_count":"3","creation_date":"2011-05-31 10:45:06.063 UTC","last_activity_date":"2011-05-31 13:39:04.57 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"549772","post_type_id":"1","score":"2","tags":"xslt|string-formatting","view_count":"882"} +{"id":"35236283","title":"sql: updating comma separator values","body":"\u003cp\u003eI am looking for answer where i can directly update the comma separated values without splitting the comma values.\u003c/p\u003e\n\n\u003cp\u003eFor Example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eold value new value\n123 111\n234 222\n345 333\n456 444\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCurrent\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eid value\n1 123,345\n2 123\n3 345,456,234\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eExpected\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eid value\n1 111,333\n2 111\n3 333,444,222\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have already used logic of splitting the comma values then updating the new values and then at last using coalesce to club all the new values with comma separator.\nSince my count is too big this logic is taking lots of time for execution.\u003c/p\u003e\n\n\u003cp\u003eCan anyone please suggest me better solution for this?\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2016-02-06 01:32:54.947 UTC","last_activity_date":"2016-02-06 02:31:36.207 UTC","last_edit_date":"2016-02-06 02:31:36.207 UTC","last_editor_display_name":"","last_editor_user_id":"1144035","owner_display_name":"","owner_user_id":"5889860","post_type_id":"1","score":"0","tags":"sql","view_count":"25"} +{"id":"18314140","title":"Maximize efficiency of SQL SELECT statement","body":"\u003cp\u003eAssum that we have a vary large table. for example - 3000 rows of data.\nAnd we need to select all the rows that thire field \u003ccode\u003estatus \u0026lt; 4\u003c/code\u003e.\nWe know that the relevance rows will be maximum from 2 months ago (of curse that each row has a date column).\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003edoes this query is the most efficient ??\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT * FROM database.tableName WHERE status\u0026lt;4 \n\nAND DATE\u0026lt; '\".date()-5259486.\"' ;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cem\u003e(date() - php , 5259486 - two months.)...\u003c/em\u003e\u003c/p\u003e","accepted_answer_id":"18314255","answer_count":"2","comment_count":"3","creation_date":"2013-08-19 12:46:24.243 UTC","last_activity_date":"2013-08-19 13:58:32.59 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2216190","post_type_id":"1","score":"0","tags":"mysql|sql|performance","view_count":"126"} +{"id":"38110413","title":"postgres multiple on conflicts in one upsert statement","body":"\u003cp\u003eI have two unique constraints on the same table, and I want to do an upsert statement on that table. \u003c/p\u003e\n\n\u003cp\u003eIs it possible to specify the two conflicts in the upsert? I saw this: \u003ca href=\"https://stackoverflow.com/questions/35031934/how-to-upsert-in-postgres-on-conflict-on-one-of-2-columns\"\u003eHow to upsert in Postgres on conflict on one of 2 columns?\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003ebut my issue is slightly more involved because one of the unique constraints is a subset of the other unique constraint. I.e. \u003c/p\u003e\n\n\u003cp\u003eunique_constraint_1 = (col_1)\nunqiue_constraint_2 = (col_1, col_2)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eINSERT INTO table (col_1, col_2, col_3) VALUES (val_1, val_2, val_3) ON CONFLICT (what do I put here to account for both constraints?) DO NOTHING; \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethanks!\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2016-06-29 21:33:26.587 UTC","last_activity_date":"2016-06-29 21:33:26.587 UTC","last_edit_date":"2017-05-23 12:22:40.47 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"3950550","post_type_id":"1","score":"3","tags":"postgresql","view_count":"341"} +{"id":"15284323","title":"Android Drawables: outofmemoryerror VERSUS \"cannot draw recycled bitmaps\" error","body":"\u003cp\u003eI've read a ton of posts about both these errors and can't seem to find a solution that works for me. \nI have a basic listview activity of animals. When you click on an item in the list, it opens the AnimalViewActivity and displays a simple png image inside an ImageView.\u003c/p\u003e\n\n\u003cp\u003eHere's where I set the image for the ImageView:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic void getImage() {\n\n String imageName = myService.yourAnimals.get(key).getType();\n System.out.println(imageName);\n\n Resources res = getResources();\n int resourceId = res.getIdentifier(imageName, \"drawable\", getPackageName() );\n Drawable drawable = res.getDrawable( resourceId );\n image.setImageDrawable( drawable );\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThen when I leave AnimalViewActivity to return to the listview activity, I do this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@Override\nprotected void onDestroy() {\n super.onDestroy();\n //((BitmapDrawable)image.getDrawable()).getBitmap().recycle();\n image.getDrawable().setCallback(null);\n //System.gc();\n System.out.println(\"Destroy image!\");\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf I uncomment the recycle() line, I get the \"cannot draw recycled bitmaps\" error.\nIf I leave it how it is, I get the outofmemoryerror for bitmapfactory.\u003c/p\u003e\n\n\u003cp\u003ejava.lang.IllegalArgumentException: Cannot draw recycled bitmap\nOR\njava.lang.OutOfMemoryError\nandroid.graphics.BitmapFactory.nativeDecodeAsset(Native Method)\u003c/p\u003e\n\n\u003cp\u003eEither one of these errors occur after I've opened the ViewAnimalActivity about 20 times and the app crashes. \nThe only thing that seems to work forever is System.gc() , but I know that is not a good solution.\u003c/p\u003e\n\n\u003cp\u003eI'm testing it in android4.1, but the minSDK is set to android3.0 \u003c/p\u003e\n\n\u003cp\u003eI read that the javaVM error for bitmap recycling was fixed in 3.0?\u003c/p\u003e\n\n\u003cp\u003eFor some reason, garbage collection is not happening fast enough without explicitly calling the gc. These images are small, mostly between 100-300kB.\u003c/p\u003e\n\n\u003cp\u003eAny ideas?\u003c/p\u003e\n\n\u003cp\u003eEDIT:\nIt seems happier with\u003cbr\u003e\nimage.setImageDrawable( null );\u003c/p\u003e\n\n\u003cp\u003eI think I tried this before when I still had it set on Android2.2, but Android3.0 is happy with it so far.\u003c/p\u003e","answer_count":"2","comment_count":"3","creation_date":"2013-03-08 00:02:27.747 UTC","last_activity_date":"2013-03-08 00:45:36.147 UTC","last_edit_date":"2013-03-08 00:38:47.937 UTC","last_editor_display_name":"","last_editor_user_id":"1774676","owner_display_name":"","owner_user_id":"1774676","post_type_id":"1","score":"2","tags":"java|android|android-layout","view_count":"2463"} +{"id":"6255802","title":"Why does this error occur?","body":"\u003cp\u003eI am getting this error\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eArgument \"\\\\x{61}\" isn't numeric in numeric comparison (\u0026lt;=\u0026gt;)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003efrom\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#!/usr/bin/perl\n\nuse JSON::PP;\nuse utf8;\nuse strict;\nuse warnings;\nuse Data::Dumper;\n\nmy $json = JSON::PP-\u0026gt;new-\u0026gt;allow_nonref;\n$json = $json-\u0026gt;utf8;\n\nmy $data = {\n 12 =\u0026gt; {\n a =\u0026gt; 1,\n b =\u0026gt; 2,\n },\n 1 =\u0026gt; {\n x =\u0026gt; 3,\n },\n 2 =\u0026gt; {\n z =\u0026gt; 4,\n }\n};\n\nmy $json_string = $json-\u0026gt;sort_by(sub { $JSON::PP::a \u0026lt;=\u0026gt; $JSON::PP::b })-\u0026gt;encode($data);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt is suppose to encode the hash to a json string, and then numeric sort the keys \u003ccode\u003e12\u003c/code\u003e \u003ccode\u003e1\u003c/code\u003e \u003ccode\u003e2\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eIf the problem can be solved with another JSON parser, then that would be perfectly fine =)\u003c/p\u003e\n\n\u003cp\u003eWhat's wrong?\u003c/p\u003e","accepted_answer_id":"6256136","answer_count":"2","comment_count":"0","creation_date":"2011-06-06 17:33:49.833 UTC","last_activity_date":"2011-06-06 18:22:08.683 UTC","last_edit_date":"2011-06-06 17:59:14.4 UTC","last_editor_display_name":"","last_editor_user_id":"256439","owner_display_name":"","owner_user_id":"256439","post_type_id":"1","score":"1","tags":"perl|json","view_count":"289"} +{"id":"5549611","title":"How to use \"this\" in a thread!","body":"\u003cp\u003eI am trying to call my static function using a separate thread, I have in my function something like \u003ccode\u003ethis-\u0026gt;listBox1-\u0026gt;Items-\u0026gt;Add(s);\u003c/code\u003e. The compiler shows that I can't use \u003ccode\u003ethis\u003c/code\u003e inside a static function. I tried to make my function non-static (i.e remove \u003ccode\u003estatic\u003c/code\u003e keyword) but when I did that, again the compiler shows two errors which are:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eError 2 error C3350: 'System::Threading::ThreadStart' : a delegate constructor expects 2 argument(s) c:\\users\\ahmed\\documents\\visual studio 2010\\projects\\testscan\\testscan\\Form1.h 116\u003c/p\u003e\n \n \u003cp\u003eError 1 error C2276: '\u0026amp;' : illegal operation on bound member function expression c:\\users\\ahmed\\documents\\visual studio 2010\\projects\\testscan\\testscan\\Form1.h 116\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003chr\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdit\u003c/strong\u003e:\u003c/p\u003e\n\n\u003cp\u003eThe function:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evoid ScanMyDir(String^ SourceDir)\n{\n array \u0026lt;String^\u0026gt; ^fileEntries = Directory::GetFiles(SourceDir);\n for each (String^ fileName in fileEntries)\n this-\u0026gt;Form1-\u0026gt;listBox1-\u0026gt;Items-\u0026gt;Add(fileName);\n\n array\u0026lt;String^\u0026gt; ^SubDirEntries = Directory::GetDirectories(SourceDir);\n for each (String^ subdir in SubDirEntries)\n if ((File::GetAttributes(subdir) \u0026amp; FileAttributes::ReparsePoint)!= FileAttributes::ReparsePoint)\n ScanMyDir(subdir);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWay to call it:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evoid button1_Click(System::Object^ sender, System::EventArgs^ e) {\n Thread ^thr1 = gcnew Thread(gcnew ParameterizedThreadStart(this,\u0026amp;Form1::ScanMyDir));\n thr1-\u0026gt;Start(\"c:\\\\\"); \n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eModification on Form load:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evoid Form1_Load(System::Object^ sender, System::EventArgs^ e) {\n System::Windows::Forms::Control::CheckForIllegalCrossThreadCalls = false;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe new errors :( :\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eError 5 error C3352: 'void testScan::Form1::ScanMyDir(System::String ^)' : the specified function does not match the delegate type 'void (System::Object ^)' c:\\users\\ahmed\\documents\\visual studio 2010\\projects\\testscan\\testscan\\Form1.h 117\u003c/p\u003e\n \n \u003cp\u003eError 1 error C2273: 'function-style cast' : illegal as right side of '-\u003e' operator c:\\users\\ahmed\\documents\\visual studio 2010\\projects\\testscan\\testscan\\Form1.h 105\u003c/p\u003e\n \n \u003cp\u003eError 2 error C2227: left of '-\u003elistBox1' must point to class/struct/union/generic type c:\\users\\ahmed\\documents\\visual studio 2010\\projects\\testscan\\testscan\\Form1.h 105\u003c/p\u003e\n \n \u003cp\u003eError 3 error C2227: left of '-\u003eItems' must point to class/struct/union/generic type c:\\users\\ahmed\\documents\\visual studio 2010\\projects\\testscan\\testscan\\Form1.h 105\u003c/p\u003e\n \n \u003cp\u003eError 4 error C2227: left of '-\u003eAdd' must point to class/struct/union/generic type c:\\users\\ahmed\\documents\\visual studio 2010\\projects\\testscan\\testscan\\Form1.h 105\u003c/p\u003e\n\u003c/blockquote\u003e","accepted_answer_id":"5551970","answer_count":"3","comment_count":"3","creation_date":"2011-04-05 09:10:28.517 UTC","last_activity_date":"2011-05-19 10:37:39.89 UTC","last_edit_date":"2011-04-05 17:04:56.73 UTC","last_editor_display_name":"","last_editor_user_id":"636019","owner_display_name":"","owner_user_id":"630908","post_type_id":"1","score":"0","tags":"multithreading|visual-studio-2010|visual-c++|c++-cli","view_count":"1703"} +{"id":"45950993","title":"Limiting the number of trials in combination Ruby","body":"\u003cp\u003eThe following code calculates all the results of \u003ccode\u003e5C4\u003c/code\u003e (5 combination 4) as a string:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ea = ['1', '2', '3', '4', '5']\nresult_array = a.combination(4).map(\u0026amp;:join).to_a\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs there a method I can use to limit the number of combination trials, similarly to the \u003ccode\u003eitertools\u003c/code\u003e module in Python?\u003c/p\u003e","accepted_answer_id":"45951045","answer_count":"1","comment_count":"3","creation_date":"2017-08-30 02:31:30.943 UTC","last_activity_date":"2017-08-30 04:25:34.053 UTC","last_edit_date":"2017-08-30 03:11:33.753 UTC","last_editor_display_name":"","last_editor_user_id":"3496038","owner_display_name":"","owner_user_id":"8230428","post_type_id":"1","score":"0","tags":"ruby-on-rails|ruby|combinations","view_count":"39"} +{"id":"41386961","title":"How to separate last three numbers and a string from the rest of the text in excel","body":"\u003cp\u003eI have:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eColumn 1\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cpre\u003e\u003ccode\u003eHere is line one abc 1 3 100\nHere is another line jkmr 5-20 230 3\nOther line three rjleer 44 10 22\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand want to turn it into:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/5XWUv.jpg\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/5XWUv.jpg\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eSo far I have this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e=RIGHT(A1,LEN(C1)-FIND(\"*\",SUBSTITUTE(A1,\" \",\"*\",LEN(A1)-LEN(SUBSTITUTE(A1,\" \",\"\"))-3)))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethat separates the last four strings. Then I can separate them on spaces. But how can I remove these last four strings from from the text?\u003c/p\u003e","accepted_answer_id":"41387500","answer_count":"1","comment_count":"7","creation_date":"2016-12-29 20:48:18.203 UTC","last_activity_date":"2016-12-29 21:33:44.81 UTC","last_edit_date":"2016-12-29 21:32:12.903 UTC","last_editor_display_name":"","last_editor_user_id":"5401830","owner_display_name":"","owner_user_id":"5401830","post_type_id":"1","score":"0","tags":"excel|split","view_count":"28"} +{"id":"30777714","title":"UIPopoverController arrow not the same white as my UINavigationBar","body":"\u003cp\u003eSo the problem that I have is my \u003ccode\u003eUIPopoverController\u003c/code\u003e's arrow is a different color to my \u003ccode\u003eUINavigationBar\u003c/code\u003e color. If you look at the image there is a slight shadow on the white and you can see it is not the same white:\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/lOxvf.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eThis only happens on iOS 8 and not on 7, on 7 it's working as expected.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e- (UIPopoverController *)showPopoverController:(UIViewController *)controller fromBarButtonItem:(UIBarButtonItem *)view\n{\n UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:controller];\n UIPopoverController *popoverController = [[UIPopoverController alloc] initWithContentViewController:navController];\n\n // controller.view.frame = CGRectMake(0, 0, 320, 400);\n\n AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];\n\n appDelegate.popoverController = popoverController;\n CGSize size = CGSizeMake(controller.view.frame.size.width, controller.view.frame.size.height + 44.0);\n [navController setPreferredContentSize:size];\n [popoverController setPopoverContentSize:size];\n [popoverController presentPopoverFromBarButtonItem:view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];\n [navController.navigationBar setBarTintColor:[UIColor whiteColor]];\n [popoverController setBackgroundColor:[UIColor whiteColor]];\n\n return popoverController;\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"30780637","answer_count":"2","comment_count":"0","creation_date":"2015-06-11 10:04:59.4 UTC","last_activity_date":"2015-06-11 12:20:52.99 UTC","last_edit_date":"2015-06-11 10:10:18.42 UTC","last_editor_display_name":"","last_editor_user_id":"874941","owner_display_name":"","owner_user_id":"2678261","post_type_id":"1","score":"0","tags":"ios|objective-c|xcode6|uipopovercontroller","view_count":"160"} +{"id":"43782271","title":"How add domain from iPage to Web app hosted on iis in server 2008?","body":"\u003cp\u003eI want to connect my web app hosted on IIS in server 2008 with domain from iPage \nI do not know how I can connect with domain and open my web app from browser using my domain.\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-05-04 11:57:19.88 UTC","last_activity_date":"2017-05-04 19:41:21.36 UTC","last_edit_date":"2017-05-04 19:41:21.36 UTC","last_editor_display_name":"","last_editor_user_id":"5251960","owner_display_name":"","owner_user_id":"6747549","post_type_id":"1","score":"0","tags":"iis|dns","view_count":"21"} +{"id":"6383779","title":"Making Text field empty when clicking on it (Prototype Framework of javascript)","body":"\u003cp\u003eThats my input field. I want to make value of it empty when I click it. How can I do this by using prototype framework of javascript ? \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;input name=\"ctl0$txtSearch\" type=\"text\" value=\"Quick Search\" id=\"ctl0_txtSearch\" class=\"MainSearchBar\" /\u0026gt; \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks in advance,\u003c/p\u003e\n\n\u003cp\u003eActually I am using PRADO. So the html tag to create input is \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;com:TTextBox Id=\"txtSearch\" Text=\"Quick Search\" CssClass=\"MainSearchBar\" /\u0026gt; \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd it has no onclick attr to handle javascript. \u003c/p\u003e","accepted_answer_id":"6384830","answer_count":"4","comment_count":"1","creation_date":"2011-06-17 09:23:06.97 UTC","last_activity_date":"2011-06-17 11:05:18.04 UTC","last_edit_date":"2011-06-17 09:43:09.247 UTC","last_editor_display_name":"","last_editor_user_id":"735259","owner_display_name":"","owner_user_id":"735259","post_type_id":"1","score":"0","tags":"javascript|html|javascript-events|javascript-framework|prototypejs","view_count":"1385"} +{"id":"24741403","title":"How can I retrieve information for only a specific type of activity from the Pivotal Tracker API?","body":"\u003cp\u003eI am getting JSON information from the Pivotal Tracker API, and I need to get certain info, instead of all the raw data. To do this, I used \u003ccode\u003eJSON.parse()\u003c/code\u003e to convert the JSON to a Ruby array of hashes.\u003c/p\u003e\n\n\u003cp\u003eNow, I need to iterate through this array and only return the relevant hashes. \u003c/p\u003e\n\n\u003cp\u003eFor example, I just want to return the \u003ccode\u003eprimary_resources\u003c/code\u003e hash that has a nested hash of:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\"story_type\" =\u0026gt; \"feature\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eTo do this, I wrote this code (\u003ccode\u003eresponse.body\u003c/code\u003e is the data returned from the GET request):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@data = response.body\nparsed = JSON.parse(@data)\nputs parsed['primary_resources']['story_type']['feature']\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I run the script, I get this error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eno implicit conversion of String into Integer (TypeError)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt seems that it is iterating through an array of hashes and looking for an integer number of the array (like \u003ccode\u003earray[3]\u003c/code\u003e or \u003ccode\u003earray[0]\u003c/code\u003e), but that doesn't help me. I need to return all the hashes that have a nested hash \u003ccode\u003e:kind =\u0026gt; story\u003c/code\u003e in the primary resources hash.\u003c/p\u003e\n\n\u003cp\u003eI also tried to do this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eparsed.each do |entry|\n puts entry['primary_resources']['story_Type']['feature']\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand I got the same error.\u003c/p\u003e\n\n\u003cp\u003eHere is my full code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003erequire 'json'\nrequire 'net/http'\nrequire 'open-uri'\nrequire 'openssl'\nrequire 'active_support'\n\nprompt = '\u0026gt; '\nputs \"What is the id of the Project you want to get data from?\"\nprint prompt\nproject_id = STDIN.gets.chomp()\nputs \"What is the beginning date you want to return from? ex: 2014-07-02\"\nprint prompt\ndate1 = STDIN.gets.chomp()\nputs \"What is the end date you want to return from? ex: 2014-07-16\"\nprint prompt\ndate2 = STDIN.gets.chomp()\n\n\n\ndef scope(project_id, date1, date2)\n uri = URI.parse(\"https://www.pivotaltracker.com/services/v5/projects/#{project_id}/activity?occurred_after=#{date1}T01:00:15Z\u0026amp;occurred_before=#{date2}T01:00:15Z\u0026amp;fields=primary_resources\")\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n request = Net::HTTP::Get.new(uri.request_uri)\n request.add_field(\"X-TrackerToken\", \"*****************\")\n response = http.request(request)\n @data = response.body\n parsed = JSON.parse(@data)\n puts parsed['primary_resources']['story_type']['feature']\n # parsed.each do |entry|\n # puts entry['primary_resources']['kind']['story']\n # end\n\n # puts parsed['primary_resources'].select { |r| r['story_type'].eql? 'feature' }\nend\n\nscope(project_id, date1, date2)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is some of the JSON response, without parsing (full response is too long, and really just the same response for like 15 other user stories):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eWhat is the id of the Project you want to get data from?\n\u0026gt; 961142\nWhat is the beginning date you want to return from? ex: 2014-07-02\n\u0026gt; 2014-07-02\nWhat is the end date you want to return from? ex: 2014-07-16\n\u0026gt; 2014-07-03\n[\n {\n \"primary_resources\": [\n {\n \"kind\": \"story\",\n \"id\": 74313670,\n \"name\": \"User can make an image fit inside the grid when viewing image detail and save it to case template. BUILD 146\",\n \"story_type\": \"bug\",\n \"url\": \"https://www.pivotaltracker.com/story/show/74313670\"\n }\n ],\n \"guid\": \"961142_3419\",\n \"project_version\": 3419\n },\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is some of the JSON response, after parsing (only showing first story for same reason as above):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eWhat is the id of the Project you want to get data from?\n\u0026gt; 961142\nWhat is the beginning date you want to return from? ex: 2014-07-02\n\u0026gt; 2014-07-02\nWhat is the end date you want to return from? ex: 2014-07-16\n\u0026gt; 2014-07-03\n{\"primary_resources\"=\u0026gt;[{\"kind\"=\u0026gt;\"story\", \"id\"=\u0026gt;74313670, \"name\"=\u0026gt;\"User can make an image fit inside the grid when viewing image detail and save it to case template. BUILD 146\", \"story_type\"=\u0026gt;\"bug\", \"url\"=\u0026gt;\"https://www.pivotaltracker.com/story/show/74313670\"}], \"guid\"=\u0026gt;\"961142_3419\", \"project_version\"=\u0026gt;3419}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow can I iterate through this array of hashes and return only the ones of \"story_type\"=\u003e\"feature\" ? \u003c/p\u003e","accepted_answer_id":"24745481","answer_count":"1","comment_count":"5","creation_date":"2014-07-14 16:35:00.563 UTC","last_activity_date":"2015-05-20 17:40:52.79 UTC","last_edit_date":"2015-05-20 17:40:52.79 UTC","last_editor_display_name":"","last_editor_user_id":"473305","owner_display_name":"","owner_user_id":"3784445","post_type_id":"1","score":"-1","tags":"ruby|json|parsing|iteration|pivotaltracker","view_count":"189"} +{"id":"21392946","title":"How to auto-format javascript to align multiple lines with require() statements","body":"\u003cp\u003eI am using js-beautify from \u003ca href=\"https://github.com/einars/js-beautify\" rel=\"nofollow\"\u003eeinars\u003c/a\u003e, and I am trying to\nconfigure the options to achieve the following format:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar a = require(\"lib-a\"),\n alongvariable = require(\"another-lib-a\");\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eor \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar a = require(\"lib-a\");\nvar alongvariable = require(\"another-lib-a\");\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eDoes a combination of option would allow to produce this layout ?\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2014-01-27 22:23:03.783 UTC","last_activity_date":"2014-01-30 03:24:55.437 UTC","last_edit_date":"2014-01-30 03:24:55.437 UTC","last_editor_display_name":"","last_editor_user_id":"1104000","owner_display_name":"","owner_user_id":"1104000","post_type_id":"1","score":"0","tags":"javascript|emacs|code-formatting|js-beautify","view_count":"95"} +{"id":"43369477","title":"instanceID return nil in real device but wasn't nil in simulator in ios","body":"\u003cp\u003eI using fcm for push notification.\nI develop completely FCM on my project and i follow step by step of tutorial of firebase \n(my language is objective - c)\nmy device token is generated, but instanceID not generated !! in other words refreshToken Method not called ever !.\nnow when i run my project in simulator instanceID was generated. but when i run my project in real Device instanceID return null !! \nmy time \u0026amp; date in real device is up to date but still not working !! it's log of my console when run project in simulator : \u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/40d5K.jpg\" rel=\"nofollow noreferrer\"\u003elog for simulator.\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eand this log when run my project in a real device : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e2017-04-12 16:53:44.504 pin-Go[1031] \u0026lt;Notice\u0026gt; [Firebase/Analytics][I-ACS023012] Firebase Analytics enabled\n2017-04-12 16:53:44.546831+0430 pin-Go[1031:175957] APNs token retrieved: \u0026lt;f73de751 b71d59b8 f1e3b83a 826646ba d6338e7c a1a062be 4adda159 83cb5fa5\u0026gt;\n2017-04-12 16:53:44.804239+0430 pin-Go[1031:175957] animating is complited ..\n2017-04-12 16:53:44.804639+0430 pin-Go[1031:175957] animating is complited.\n2017-04-12 16:53:45.124628+0430 pin-Go[1031:175957] animating1 ...\n2017-04-12 16:53:45.751638+0430 pin-Go[1031:175957] Connected to FCM.\n2017-04-12 16:53:45.755046+0430 pin-Go[1031:175957] InstanceID token: (null)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand my code is Exactly like this code : \u003ca href=\"https://github.com/firebase/quickstart-ios/blob/master/messaging/MessagingExample/AppDelegate.m\" rel=\"nofollow noreferrer\"\u003ehttps://github.com/firebase/quickstart-ios/blob/master/messaging/MessagingExample/AppDelegate.m\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eand my log don't show any error for that ...\nanyone can help me pls ??\u003c/p\u003e\n\n\u003cp\u003eEdit : That is my code : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e #if defined(__IPHONE_10_0) \u0026amp;\u0026amp; __IPHONE_OS_VERSION_MAX_ALLOWED \u0026gt;= __IPHONE_10_0\n @import UserNotifications;\n #endif\n @import GoogleMaps;\n @import GooglePlaces;\n #import \"AfzayeshMojodiViewController.h\"\n #import \"ChangeInfoViewController.h\"\n #import \"MasirMontakhaViewController.h\"\n @import Firebase;\n\n\n // Implement UNUserNotificationCenterDelegate to receive display notification via APNS for devices\n // running iOS 10 and above. Implement FIRMessagingDelegate to receive data message via FCM for\n // devices running iOS 10 and above.\n #if defined(__IPHONE_10_0) \u0026amp;\u0026amp; __IPHONE_OS_VERSION_MAX_ALLOWED \u0026gt;= __IPHONE_10_0\n @interface AppDelegate () \u0026lt;UNUserNotificationCenterDelegate, FIRMessagingDelegate\u0026gt;\n @end\n #endif\n // Copied from Apple's header in case it is missing in some cases (e.g. pre-Xcode 8 builds).\n #ifndef NSFoundationVersionNumber_iOS_9_x_Max\n #define NSFoundationVersionNumber_iOS_9_x_Max 1299\n #endif\n\n @implementation AppDelegate\n NSString *const kGCMMessageIDKey = @\"gcm.message_id\";\n\n - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {\n self.urlStrWebService = [[NSString alloc] init];\n\n\n //Start of GCM\n // [START configure_firebase]\n [FIRApp configure];\n\n if (floor(NSFoundationVersionNumber) \u0026lt;= NSFoundationVersionNumber_iOS_9_x_Max) {\n UIUserNotificationType allNotificationTypes =\n (UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge);\n UIUserNotificationSettings *settings =\n [UIUserNotificationSettings settingsForTypes:allNotificationTypes categories:nil];\n [[UIApplication sharedApplication] registerUserNotificationSettings:settings];\n } else {\n // iOS 10 or later\n #if defined(__IPHONE_10_0) \u0026amp;\u0026amp; __IPHONE_OS_VERSION_MAX_ALLOWED \u0026gt;= __IPHONE_10_0\n // For iOS 10 display notification (sent via APNS)\n [UNUserNotificationCenter currentNotificationCenter].delegate = self;\n UNAuthorizationOptions authOptions =\n UNAuthorizationOptionAlert\n | UNAuthorizationOptionSound\n | UNAuthorizationOptionBadge;\n [[UNUserNotificationCenter currentNotificationCenter] requestAuthorizationWithOptions:authOptions completionHandler:^(BOOL granted, NSError * _Nullable error) {\n }];\n\n // For iOS 10 data message (sent via FCM)\n [FIRMessaging messaging].remoteMessageDelegate = self;\n #endif\n }\n\n [[UIApplication sharedApplication] registerForRemoteNotifications];\n return YES;\n} \n\n//start implementing notification reciver :\n\n\n//// [START receive_message]\n- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {\n // If you are receiving a notification message while your app is in the background,\n // this callback will not be fired till the user taps on the notification launching the application.\n // TODO: Handle data of notification\n\n // Print message ID.\n if (userInfo[kGCMMessageIDKey]) {\n NSLog(@\"Message ID: %@\", userInfo[kGCMMessageIDKey]);\n }\n\n // Print full message.\n NSLog(@\"%@\", userInfo);\n}\n\n- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo\nfetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {\n // If you are receiving a notification message while your app is in the background,\n // this callback will not be fired till the user taps on the notification launching the application.\n // TODO: Handle data of notification\n\n // Print message ID.\n if (userInfo[kGCMMessageIDKey]) {\n NSLog(@\"Message ID: %@\", userInfo[kGCMMessageIDKey]);\n }\n\n\n // Print full message.\n NSLog(@\"%@\", userInfo);\n\n completionHandler(UIBackgroundFetchResultNewData);\n}\n// [END receive_message]\n\n// [START ios_10_message_handling]\n// Receive displayed notifications for iOS 10 devices.\n#if defined(__IPHONE_10_0) \u0026amp;\u0026amp; __IPHONE_OS_VERSION_MAX_ALLOWED \u0026gt;= __IPHONE_10_0\n// Handle incoming notification messages while app is in the foreground.\n- (void)userNotificationCenter:(UNUserNotificationCenter *)center\n willPresentNotification:(UNNotification *)notification\n withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler {\n // Print message ID.\n NSDictionary *userInfo = notification.request.content.userInfo;\n if (userInfo[kGCMMessageIDKey]) {\n NSLog(@\"Message ID: %@\", userInfo[kGCMMessageIDKey]);\n }\n\n // Print full message.\n NSLog(@\"%@\", userInfo);\n\n // Change this to your preferred presentation option\n completionHandler(UNNotificationPresentationOptionNone);\n}\n\n// Handle notification messages after display notification is tapped by the user.\n- (void)userNotificationCenter:(UNUserNotificationCenter *)center\ndidReceiveNotificationResponse:(UNNotificationResponse *)response\n withCompletionHandler:(void (^)())completionHandler {\n NSDictionary *userInfo = response.notification.request.content.userInfo;\n if (userInfo[kGCMMessageIDKey]) {\n NSLog(@\"Message ID: %@\", userInfo[kGCMMessageIDKey]);\n }\n\n // Print full message.\n NSLog(@\"%@\", userInfo);\n\n completionHandler();\n}\n#endif\n// [END ios_10_message_handling]\n\n// [START ios_10_data_message_handling]\n#if defined(__IPHONE_10_0) \u0026amp;\u0026amp; __IPHONE_OS_VERSION_MAX_ALLOWED \u0026gt;= __IPHONE_10_0\n// Receive data message on iOS 10 devices while app is in the foreground.\n- (void)applicationReceivedRemoteMessage:(FIRMessagingRemoteMessage *)remoteMessage {\n // Print full message\n NSLog(@\"%@\", remoteMessage.appData);\n}\n#endif\n// [END ios_10_data_message_handling]\n\n// [START refresh_token]\n- (void)tokenRefreshNotification:(NSNotification *)notification {\n // Note that this callback will be fired everytime a new token is generated, including the first\n // time. So if you need to retrieve the token as soon as it is available this is where that\n // should be done.\n NSString *refreshedToken = [[FIRInstanceID instanceID] token];\n NSLog(@\"InstanceID token: %@\", refreshedToken);\n\n // Connect to FCM since connection may have failed when attempted before having a token.\n [self connectToFcm];\n\n // TODO: If necessary send token to application server.\n}\n// [END refresh_token]\n\n// [START connect_to_fcm]\n- (void)connectToFcm {\n// // Won't connect since there is no token\n// if (![[FIRInstanceID instanceID] token]) {\n// return;\n// }\n\n // Disconnect previous FCM connection if it exists.\n [[FIRMessaging messaging] disconnect];\n\n [[FIRMessaging messaging] connectWithCompletion:^(NSError * _Nullable error) {\n if (error != nil) {\n NSLog(@\"Unable to connect to FCM. %@\", error);\n } else {\n NSLog(@\"Connected to FCM.\");\n NSString *refreshedToken = [[FIRInstanceID instanceID] token];\n NSLog(@\"InstanceID token: %@\", refreshedToken);\n }\n }];\n}\n// [END connect_to_fcm]\n\n- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error {\n NSLog(@\"Unable to register for remote notifications: %@\", error);\n}\n\n// This function is added here only for debugging purposes, and can be removed if swizzling is enabled.\n// If swizzling is disabled then this function must be implemented so that the APNs token can be paired to\n// the InstanceID token.\n- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {\n NSLog(@\"APNs token retrieved: %@\", deviceToken);\n\n // With swizzling disabled you must set the APNs token here.\n [[FIRInstanceID instanceID] setAPNSToken:deviceToken type:FIRInstanceIDAPNSTokenTypeSandbox];\n [self connectToFcm];\n}\n\n// [START connect_on_active]\n- (void)applicationDidBecomeActive:(UIApplication *)application {\n [self connectToFcm];\n}\n// [END connect_on_active]\n\n// [START disconnect_from_fcm]\n- (void)applicationDidEnterBackground:(UIApplication *)application {\n [[FIRMessaging messaging] disconnect];\n NSLog(@\"Disconnected from FCM\");\n}\n// [END disconnect_from_fcm]\n\n\n//end of implement notification.\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"2","creation_date":"2017-04-12 12:25:12.407 UTC","last_activity_date":"2017-04-12 13:17:36.36 UTC","last_edit_date":"2017-04-12 13:17:36.36 UTC","last_editor_display_name":"","last_editor_user_id":"5720725","owner_display_name":"","owner_user_id":"5720725","post_type_id":"1","score":"0","tags":"ios|objective-c|null","view_count":"172"} +{"id":"10425814","title":"Error in .Net Web Service running on IIS 6","body":"\u003cp\u003eI am trying to run a web service build in .Net on IIS 6 server.\nBut it is giving an Error while starting Web Service\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e\u003cstrong\u003eERROR\u003c/strong\u003e\u003c/p\u003e\n \n \u003cp\u003e\u003cstrong\u003eServer Error in ' /9448' Application\u003c/strong\u003e\u003c/p\u003e\n \n \u003cp\u003e\u003cem\u003e\u003cstrong\u003eConfiguration Error\u003c/em\u003e\u003c/strong\u003e\u003c/p\u003e\n \n \u003cp\u003e\u003cstrong\u003eDescription\u003c/strong\u003e : \"An error occurred during the processing of configuration file required to service this request.Please review the\n specific details below and modify your configuration file\n appropriately.\u003c/p\u003e\n \n \u003cp\u003e\u003cstrong\u003eParse Error Message\u003c/strong\u003e :An error occurred loading the configuration file: Access to the path\n \"C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\\Config\\machine.config\"\n is denied.\u003c/p\u003e\n \n \u003cp\u003e\u003cstrong\u003eSource Error\u003c/strong\u003e:\u003c/p\u003e\n \n \u003cp\u003e[No relevant source lines]\u003c/p\u003e\n \n \u003cp\u003e\u003cstrong\u003eSource File\u003c/strong\u003e : C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\\Config\\machine.config\n \u003cstrong\u003eLine: 0\u003c/strong\u003e\u003c/p\u003e\n \n \u003cp\u003e\u003cstrong\u003eVersion Information\u003c/strong\u003e : Microsoft.NET Framework Version v2.0.50727.3625; ASP.Net Version : v2.0.50727.3625\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eThe user under which it is running have full Administrator Rights\u003c/p\u003e\n\n\u003cp\u003eWhile it was working fine previously\u003c/p\u003e\n\n\u003cp\u003eWhat could be the problem?\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2012-05-03 05:51:03.713 UTC","last_activity_date":"2012-05-03 05:55:12.607 UTC","last_edit_date":"2012-05-03 05:55:12.607 UTC","last_editor_display_name":"","last_editor_user_id":"107625","owner_display_name":"","owner_user_id":"1049382","post_type_id":"1","score":"1","tags":"asp.net|web-services|iis-6","view_count":"432"} +{"id":"18615342","title":"Google DirectoryAPI adding wrong email","body":"\u003cp\u003eGoogle's Directory API incorrectly adding the personal gmail address to a google group when I use the api to insert a non-gmail address. This only happens for a subset of addresses for several domains @indiana.edu, @arizona.edu... (I assume it is connected to the organizations own use of GoogleApps). \u003c/p\u003e\n\n\u003cp\u003eI can reproduce the issue using the \u003ca href=\"https://developers.google.com/apis-explorer/#p/admin/directory_v1/\" rel=\"nofollow\"\u003eGoogle-Api-Explorer\u003c/a\u003e, without any code, but I noticed the issue using google-api-php-client.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$gData = $this-\u0026gt;service-\u0026gt;members-\u0026gt;insert($groupEmail,$gMember);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have filed a ticket with Google. Has anyone encountered this issue, or can you shed light into how a personal gmail account is linked to an @organizatio.edu account in GoogleApps.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-09-04 13:34:10.057 UTC","favorite_count":"0","last_activity_date":"2013-10-11 14:44:31.507 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"486494","post_type_id":"1","score":"0","tags":"php|google-api|google-api-php-client","view_count":"57"} +{"id":"9747767","title":"Mapping any OS's global input events to another input events with Java","body":"\u003cp\u003eI couldn't come up with a better title, so allow me to elaborate:\u003c/p\u003e\n\n\u003cp\u003eThere are programs such as \u003ca href=\"http://www-en.jtksoft.net/overview\" rel=\"nofollow\"\u003eJoyToKey\u003c/a\u003e, that allowed the user to map button inputs on any joystick to any key event and mouse event. To be frank, I do not know the real underlying implementation here, but it is like either JoyToKey \"ubiquitously\" sends these mapped inputs to whatever application the user is focusing, or it simply invokes global input events.\u003c/p\u003e\n\n\u003cp\u003eSo the thing is this, in Java application, if we want to listen to any keyboard or mouse input, we can easily to do that with the \u003ccode\u003eKeyListener\u003c/code\u003e and \u003ccode\u003eMouseListener\u003c/code\u003e classes, but what I am talking here is if I want to create a Java application that listens to all of the user's specified inputs, (be it from joystick, touch screen, or whatever) regardless of which application has focus at the time and map these inputs to other inputs and macro. For instance, if I want to perform Hadoken in Street Fighter, I tell the program \"hey, if I press 'P' or 'Joystick 1 Button 10', invoke the following keyboard events respectively 'down arrow' in the first (1/60) millisecond, 'down+right arrow' in the next (1/60) millisecond, 'right arrow' in the next (1/60) millisecond and finally 'Z' in the next (1/60) millisecond\".\u003c/p\u003e\n\n\u003cp\u003eSo what I am looking for here is different from JoyToKey in the following aspect:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eI am looking for how to write a JoyToKey-like program in \u003cstrong\u003eJava\u003c/strong\u003e.\u003c/li\u003e\n\u003cli\u003enot limited to Joystick only. Allows user to map all sort of hardware inputs to any other hardware input as well.\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eDue to the nature of Java and we are invoking the OS directly, I am concern about the cross-platform capability. The underlying mechanism of each OS might be a little different, but anyway, is this possible in Java? If so, which Java's API should I be looking for? Are there some hardware-specific problems to be aware of?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2012-03-17 06:15:46.997 UTC","last_activity_date":"2012-03-17 16:17:00.247 UTC","last_edit_date":"2012-03-17 16:16:45.88 UTC","last_editor_display_name":"","last_editor_user_id":"20394","owner_display_name":"","owner_user_id":"144201","post_type_id":"1","score":"2","tags":"java|input|operating-system|mapping|hardware","view_count":"160"} +{"id":"36207638","title":"Jackson JsonNode and Java Streams to return Optional Empty","body":"\u003cp\u003eSo I have a json input, something like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n \"a\":\"something\",\n \"b\":\"something2\"\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis input can come in 2 other forms:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n \"a\":\"something\",\n \"b\":\"\"\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n \"a\":\"something\"\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have a input class like this that I store it in:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class Foo {\n private String a;\n private Optional\u0026lt;String\u0026gt; b;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn the latter 2 cases I want to store b as Optional.empty(). I have figured out how to do that in the 3rd case with this line of code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eOptional.ofNullable(inputNode.get(\"b\")).map(node -\u0026gt; node.asText())\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis works well for the 3rd case. It returns Optional.empty. But not so much for the 2nd case because \u003ccode\u003eb\u003c/code\u003e ends up just being an empty string. I tried to use \u003ccode\u003e.reduce\u003c/code\u003e before and after the \u003ccode\u003e.map\u003c/code\u003e but for some reason it won't let me use that anywhere. \u003c/p\u003e\n\n\u003cp\u003eAnd idea how to achieve what I want?\u003c/p\u003e","accepted_answer_id":"36207805","answer_count":"1","comment_count":"0","creation_date":"2016-03-24 18:37:01.35 UTC","last_activity_date":"2016-03-24 18:46:45.447 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"222676","post_type_id":"1","score":"1","tags":"java|json|jackson|java-stream|optional","view_count":"515"} +{"id":"27420370","title":"CSS - How to insure that a input will be in the middle of a specific area","body":"\u003cp\u003eI'm having a simple row with three utf-8 arrows\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div id=\"container\"\u0026gt;\n \u0026lt;div id=\"one\"\u0026gt;\u0026amp;#9660;\u0026lt;/div\u0026gt;\n \u0026lt;div id=\"two\"\u0026gt;\u0026amp;#9650;\u0026lt;/div\u0026gt;\n \u0026lt;div id=\"three\"\u0026gt;\u0026amp;#9660;\u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt; \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo what I am trying to do is to have the arrows in the same row, but I want them to be in the middle of their height and their width - no matter what text size value they will get.\u003c/p\u003e\n\n\u003cp\u003eI've tried the next CSS code -\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#container{\ndisplay: inline-block;\nheight: 80px;\nwidth: 100%;\n}\n\n\n#one{\nfloat:left;\nwidth: 20%;\nfont-size: 90px;\n}\n\n#two{\nfloat:left;\nwidth: 20%;\nfont-size: 50px;\n}\n\n#three{\nfloat:left;\nwidth: 20%;\nfont-size: 60px;\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAs you can understand it sure don't work, any ideas what can I do?\nThanks for any kind of help\u003c/p\u003e","accepted_answer_id":"27420491","answer_count":"2","comment_count":"1","creation_date":"2014-12-11 10:18:32.427 UTC","last_activity_date":"2014-12-11 10:24:13.61 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4273709","post_type_id":"1","score":"1","tags":"html|css","view_count":"40"} +{"id":"17716001","title":"one to one result in mysql Query","body":"\u003cp\u003eI have two table:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003cstrong\u003ecareer\u003c/strong\u003e\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003ecareer_details\u003c/strong\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eTable \"\u003cstrong\u003ecareer\u003c/strong\u003e\" contain fields (careerID,job_code)\u003cbr\u003e\nTable \"career_details\" contain fields (id, careerID, name) \u003c/p\u003e\n\n\u003cp\u003eLet the values be \u003ccode\u003e[(1,code1),(2,code2)]\u003c/code\u003e--- career(table)\u003cbr\u003e\nLet the values be \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[\n\n ('1','1','codename1'), \n ('2','1','codename11'), \n ('3','2','codename22'), \n ('4','2','codename222')\n\n\n]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e-- career_details(table)\u003c/p\u003e\n\n\u003cp\u003eNow if I write the query(\"\u003ccode\u003eSELECT * FROM career c LEFT JOIN career_details cd ON c.career_id=cd.career_id WHERE 1\u003c/code\u003e\"), then it will give the result 4 rows but I need the result 2 rows only i.e \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[(1,code1,1,1,codename1),(2,code2,3,2,codename22)]\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"17719077","answer_count":"2","comment_count":"4","creation_date":"2013-07-18 06:23:29.8 UTC","last_activity_date":"2013-07-19 09:38:46.803 UTC","last_edit_date":"2013-07-18 09:30:46.227 UTC","last_editor_display_name":"","last_editor_user_id":"297408","owner_display_name":"","owner_user_id":"1626938","post_type_id":"1","score":"0","tags":"mysql|greatest-n-per-group","view_count":"76"} +{"id":"28209138","title":"Remove white space between two divs","body":"\u003cp\u003eHow to remove the white space between the \u003ccode\u003eheader\u003c/code\u003e and \u003ccode\u003ewrapper\u003c/code\u003e divs.\u003c/p\u003e\n\n\u003cp\u003eHere is a \u003ca href=\"http://jsfiddle.net/ygvwL724/\" rel=\"nofollow\"\u003eDEMO fiddle\u003c/a\u003e.\nHere is the HTML code :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;div id=\"container\"\u0026gt;\n \u0026lt;div id=\"header\"\u0026gt;\n \u0026lt;div id=\"logo\"\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div id=\"login\"\u0026gt;\n \u0026lt;h3\u0026gt;\n CLIENT LOGIN\u0026lt;/h3\u0026gt;\n Username\n \u0026lt;input type='text' name='username' id='username'\u0026gt;\n \u0026lt;input type='button' name='login' value='Login' id='btnLogin'\u0026gt;\n \u0026lt;br /\u0026gt;\n Password:\n \u0026lt;input type='password' name='password' id='password'\u0026gt;\n \u0026lt;input type='button' name='register' value='Register' id='btnRegister'\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div id=\"navigation\"\u0026gt;\n \u0026lt;ul\u0026gt;\n \u0026lt;li class=\"active\"\u0026gt;\u0026lt;a href=\"#\"\u0026gt;Home\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#\"\u0026gt;Profile\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#\"\u0026gt;Contact\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#\"\u0026gt;Group\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#\"\u0026gt;Seminar\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div id=\"wrapper\"\u0026gt;\n \u0026lt;div id=\"contents\"\u0026gt;\n \u0026lt;div id=\"welcome\"\u0026gt;\n \u0026lt;h3\u0026gt;\n Welcome to Somara\u0026lt;/h3\u0026gt;\n \u0026lt;p\u0026gt;\n It is a long established fact that a reader will be distracted by the readable content\n of a page when looking at its layout.\u0026lt;/p\u0026gt;\n \u0026lt;p\u0026gt;\n There are many variations of passages of Lorem Ipsum available.\u0026lt;/p\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div id=\"footer\"\u0026gt;\n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is the CSS code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e body\n{\n width:100%;\n margin:0px;\n}\n\n#header\n{\n width: 100%;\n background-color: #2c2520;\n min-height: 200px;\n}\n#login\n{\n float: right;\n color: white;\n}\n#logo\n{\n background-image: url('../img/logo.png');\n min-height: 191px;\n min-width: 230px;\n float: left;\n background-repeat: no-repeat;\n}\n#navigation\n{\n padding-top: 158px;\n margin-right: -200px;\n float: right;\n}\n#navigation li\n{\n display: inline;\n min-width: 100px;\n padding: 5px 5px 5px 5px;\n}\n\n#navigation a\n{\n text-decoration: none;\n font-family: Tahoma, calibri;\n font-size: 15px;\n color: #f8f8f8;\n}\n.active\n{\n background-color: #afaba5;\n color: black;\n}\n\n.inactive\n{\n color: white;\n background-color: #392f2b;\n}\n\n#contents\n{\n width: 950px;\n margin: 0px;\n min-height: 700px;\n\n\n}\n\n#wrapper\n{\n width: 100%;\n margin: 0 auto;\n background-color: #39302b;\n}\n\n\n#intro1\n{\n min-width: 30%;\n max-width: 35%;\n min-height: 250px;\n float: left;\n padding: 10px;\n padding-right: 50px;\n padding-left: 50px;\n color: #cdcdcd;\n}\n\n#welcome\n{\n\n}\n\n#welcome h3, p\n{\n font-family: Myriad Pro;\n color: white;\n text-align: center;\n font-weight: normal;\n}\n\n#welcome p\n{\n color: #cdcdcd;\n font-size: 20px;\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"28209249","answer_count":"2","comment_count":"6","creation_date":"2015-01-29 07:28:04.187 UTC","last_activity_date":"2015-01-29 07:49:48.357 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1426157","post_type_id":"1","score":"0","tags":"html|css","view_count":"1213"} +{"id":"41901878","title":"From which api should i ask permissions?","body":"\u003cp\u003eHey I am trying to ask for storage access permission and I notice that in my other phone which has android 5.0 the permission ask crashes the app. what should I do to ask permission without crashing the app in this android version and from which android version should I do it?\u003c/p\u003e\n\n\u003cp\u003ethis is the code for asking permission:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e int MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE = 0;\n if (checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE)\n != PackageManager.PERMISSION_GRANTED) {\n\n // Should we show an explanation?\n if (shouldShowRequestPermissionRationale(\n Manifest.permission.READ_EXTERNAL_STORAGE)) {\n // Explain to the user why we need to read the contacts\n }\n\n requestPermissions(new String[]{Manifest.permission.READ_EXTERNAL_STORAGE},\n MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE);\n\n // MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE is an\n // app-defined int constant that should be quite unique\n\n return;\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"2","creation_date":"2017-01-27 19:46:49.193 UTC","last_activity_date":"2017-01-27 19:56:55.73 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7415791","post_type_id":"1","score":"-2","tags":"java|android|api|permissions|android-permissions","view_count":"38"} +{"id":"25708004","title":"Looping over descending values in Stata using forvalues","body":"\u003cp\u003eSo this works as expected:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e. forvalues i = 1(1)3 {\n 2. di `i'\n 3. }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e1\u003cbr\u003e\n 2\u003cbr\u003e\n 3\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eAnd this doesn't:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e. forvalues i = 3(1)1 {\n 2. di `i'\n 3. }\n \u0026lt;--- that's an empty line that returns from the above loop.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf I want to produce \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e3\n2\n1\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003edo I really need to get this belabored?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e. forvalues i = 1(1)3 {\n 2. di 3+1-`i'\n 3. }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhy?\u003c/p\u003e","accepted_answer_id":"25708275","answer_count":"1","comment_count":"4","creation_date":"2014-09-07 07:21:08.937 UTC","favorite_count":"1","last_activity_date":"2014-09-07 08:13:05.737 UTC","last_edit_date":"2014-09-07 08:13:05.737 UTC","last_editor_display_name":"","last_editor_user_id":"1820446","owner_display_name":"","owner_user_id":"3133336","post_type_id":"1","score":"3","tags":"stata","view_count":"1742"} +{"id":"34081370","title":"GitHub API: finding number of stars,commits and releases","body":"\u003cp\u003eI'm making Android app that use GitHud API. The target -- make list with repositories info of githubuser. I use GET /users/:username/repos. But there no all info I need. Maybe someone know how can I get this info for the list of repositories.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-12-04 05:17:19.56 UTC","last_activity_date":"2015-12-04 08:58:36.8 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5637732","post_type_id":"1","score":"0","tags":"android|json|github-api","view_count":"107"} +{"id":"21790023","title":"Navigation Timing API. What's going on between domContentLoadedEventStart and domContentLoadedEventEnd?","body":"\u003cp\u003eW3C specifies a list of event and their corresponding timings that user agents must return if they want to support the \u003ca href=\"https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/NavigationTiming/Overview.html\"\u003eNavigation Timing API\u003c/a\u003e. \u003c/p\u003e\n\n\u003cp\u003eA list you can see here: \u003ca href=\"http://www.w3.org/TR/navigation-timing/#process\"\u003ehttp://www.w3.org/TR/navigation-timing/#process\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eUnderstanding which process relates to which events is pretty straight forward in most cases. But one thing that eludes me is what is going on between \u003ccode\u003edomContentLoadedEventStart\u003c/code\u003e and \u003ccode\u003edomContentLoadedEventEnd\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eHere is what I have understood so far and base my reflections on:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003e\u003ccode\u003edomLoading\u003c/code\u003e // The UA starts parsing the document.\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003edomInteractive\u003c/code\u003e // The UA has finished parsing the document. Users\ncan interact with the page.\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003edomContentLoaded\u003c/code\u003e // The document has been completely loaded and\nparsed and deferred scripts, if any, have executed. (Async scripts,\nif any, might or might not have executed???)\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003edomComplete\u003c/code\u003e // The DOM Tree is completely built. Async scripts, if\nany, have executed.\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eloadEventEnd\u003c/code\u003e // The UA has a fully completed page. All resources,\nlike images, swf, etc, have loaded.\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eOne should be able to deduce what happens after phase #3 (\u003ccode\u003edomContentLoaded\u003c/code\u003e) by understanding what triggered event #4 (\u003ccode\u003edomComplete\u003c/code\u003e) but did not trigger previous events. \u003c/p\u003e\n\n\u003cp\u003eSo one would think that “Async scripts, if any, have executed” means that asynchronous scripts get executed after phase #3 but before event #4. But according to my tests, this is not what happens, unless my test is wrong. (I tried to replicate my test on \u003ccode\u003eJSFiddle\u003c/code\u003e, but I can’t make the defered/async script work since there is no way to add attribute on external scripts.)\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eSo my question is: What process(es) takes place between \u003ccode\u003edomContentLoadedEventStart\u003c/code\u003e and \u003ccode\u003edomContentLoadedEventEnd\u003c/code\u003e?\u003c/strong\u003e\u003c/p\u003e","accepted_answer_id":"22026449","answer_count":"1","comment_count":"1","creation_date":"2014-02-14 21:42:41.077 UTC","favorite_count":"3","last_activity_date":"2014-02-25 21:19:35.497 UTC","last_edit_date":"2014-02-21 22:37:16.687 UTC","last_editor_display_name":"","last_editor_user_id":"369759","owner_display_name":"","owner_user_id":"2533008","post_type_id":"1","score":"11","tags":"javascript|dom","view_count":"754"} +{"id":"7784144","title":"Depth-first search algorithm implementation","body":"\u003cp\u003eThe following C++ Depth-first search program won't compile.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;iostream\u0026gt;\nusing namespace std;\n\nclass Stack\n{\n\nprivate:\n const int size=20;\n int *st;\n int top;\npublic :\n Stack(){\n st =new int[size];\n top=-1;\n\n }\n ~Stack(){\n delete[] st;\n top=-1;\n }\n void push(int j){\n st[++top]=j;\n }\n int pop(){\n return st[top--];\n }\n int peek(){\n\n return st[top];\n\n }\n bool empthy(){\n return (top==-1);\n\n }\n};\nclass Vertex{\npublic:\n char label;\n bool visited;\npublic:\n Vertex(){\n\n\n }\n Vertex(char lab){\n label=lab;\n visited=false;\n\n }\n };\nclass Graph{\nprivate:\n const int maxvertex=20;\n Vertex* vertexlist;\n int **adj;\n int nverts;\n Stack *stack;\npublic:\n Graph(){\n vertexlist=new Vertex[maxvertex]; \n adj=new int*[maxvertex];\n for (int i=0;i\u0026lt;20;i++)\n adj[i]=new int[maxvertex];\n nverts=0;\n for (int i=0;i\u0026lt;maxvertex;i++){\n for (int j=0;j\u0026lt;maxvertex;j++){\n adj[i][j]=0;\n }\n }\n\n stack=new Stack();\n }\n void add(char lab){\n\n vertexlist[nverts++]=new Vertex(lab);\n }1\n\n\n\n\n};\nint main(){\n\n\n\n\n\n\n\n\n return 0;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere are the compilation errors I am getting:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026gt; 6 IntelliSense: no operator \"=\" matches these\n\u0026gt; operands c:\\users\\datuashvili\\documents\\visual studio\n\u0026gt; 2010\\projects\\dfs\\dfs\\dfs.cpp 76 23 DFS 7 IntelliSense: expected a\n\u0026gt; declaration c:\\users\\datuashvili\\documents\\visual studio\n\u0026gt; 2010\\projects\\dfs\\dfs\\dfs.cpp 77 3 DFS Error 1 error C2864:\n\u0026gt; 'Stack::size' : only static const integral data members can be\n\u0026gt; initialized within a class c:\\users\\datuashvili\\documents\\visual\n\u0026gt; studio 2010\\projects\\dfs\\dfs\\dfs.cpp 8 1 DFS Error 3 error C2864:\n\u0026gt; 'Graph::maxvertex' : only static const integral data members can be\n\u0026gt; initialized within a class c:\\users\\datuashvili\\documents\\visual\n\u0026gt; studio 2010\\projects\\dfs\\dfs\\dfs.cpp 54 1 DFS Error 2 error C2758:\n\u0026gt; 'Stack::size' : must be initialized in constructor base/member\n\u0026gt; initializer list c:\\users\\datuashvili\\documents\\visual studio\n\u0026gt; 2010\\projects\\dfs\\dfs\\dfs.cpp 12 1 DFS Error 4 error C2758:\n\u0026gt; 'Graph::maxvertex' : must be initialized in constructor base/member\n\u0026gt; initializer list c:\\users\\datuashvili\\documents\\visual studio\n\u0026gt; 2010\\projects\\dfs\\dfs\\dfs.cpp 60 1 DFS Error 5 error C2679: binary '='\n\u0026gt; : no operator found which takes a right-hand operand of type 'Vertex\n\u0026gt; *' (or there is no acceptable conversion) c:\\users\\datuashvili\\documents\\visual studio\n\u0026gt; 2010\\projects\\dfs\\dfs\\dfs.cpp 76 1 DFS\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"1","creation_date":"2011-10-16 10:45:37.78 UTC","last_activity_date":"2011-10-16 12:07:03.68 UTC","last_editor_display_name":"","owner_display_name":"user466441","owner_user_id":"466534","post_type_id":"1","score":"-1","tags":"c++","view_count":"1535"} +{"id":"8031761","title":"Adobe air 3.0 ANE for Android, null ExtensionContext?","body":"\u003cp\u003eI've been working with the vibration example from Adobe for Air 3.0's native extensions on Android. \u003c/p\u003e\n\n\u003cp\u003eI have the ANE compiled and the .apk packaged.\u003c/p\u003e\n\n\u003cp\u003eThe problem I'm having is the actionscript library is getting a null ExtensionContext.\u003c/p\u003e\n\n\u003cp\u003eI tried creating the .apk with adt -package -target apk-debug so that I can see the actionscript traces in logcat and that's where I'm finding the null error.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eextContext = ExtensionContext.createExtensionContext(\"com.adobe.Vibration\", null);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eextContext is null and crashes on the following .call() method.\u003c/p\u003e\n\n\u003cp\u003eAll of the source is stock from the examples, I haven't changed anything.\u003c/p\u003e\n\n\u003cp\u003eDoes anyone have any experience with getting one of Adobe's ANE examples working on a windows machine? Most of the examples are for Mac.\u003c/p\u003e","accepted_answer_id":"8100138","answer_count":"3","comment_count":"3","creation_date":"2011-11-07 01:08:48.823 UTC","last_activity_date":"2013-10-07 15:30:31.38 UTC","last_edit_date":"2012-01-23 16:31:43.183 UTC","last_editor_display_name":"","last_editor_user_id":"757154","owner_display_name":"","owner_user_id":"751231","post_type_id":"1","score":"2","tags":"android|actionscript-3|flex|air|air-native-extension","view_count":"2553"} +{"id":"47450597","title":"How to multiply 4 number in assembly language","body":"\u003cp\u003eHow to multiply 4 number in assembly language using 8bit and Shift.\nI am able to multiply 2 but how to multiply 4 number \nEg 2 4 5 6 \u003c/p\u003e\n\n\u003cp\u003ethis is code of two digit multiplication :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[org 0x100]\nmultiplicand: db 13\nmultiplier: db 5\nresult: db 0\nmov cl, 4\nmov bl, [multiplicand]\nmov dl, [multiplier]\ncheckbit: shr dl, 1\njnc skip\nadd [result], bl\nskip: shl bl, 1 \ndec cl \njnz checkbit\nmov ax, 0x4c00\nint 0x21\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"8","creation_date":"2017-11-23 08:19:04.697 UTC","favorite_count":"1","last_activity_date":"2017-11-24 11:34:09.48 UTC","last_edit_date":"2017-11-23 09:00:52.863 UTC","last_editor_display_name":"","last_editor_user_id":"8852829","owner_display_name":"","owner_user_id":"8852829","post_type_id":"1","score":"0","tags":"assembly|bit-manipulation|nasm|multiplication","view_count":"44"} +{"id":"11773390","title":"ASP.NET Webapplication avoid page reload for culture language change","body":"\u003cp\u003eI'm trying to make a multilanguage ASP.NET web Application. At the beginning of the Application I'm setting up cookies and after that I'm calling InitializeCulture() to initiate the culture. The data for the page is stored in global resources and gets written in the aspx file like this: \u003ccode\u003e\u0026lt;%$ Resources:Main,lang %\u0026gt;\u003c/code\u003e \u003c/p\u003e\n\n\u003cp\u003eIt is actually working but there is still a problem: After a click on a languagechange button the coockie and the culture changes but not the content of the page. I always have to reload the whole page to get the content of the right \u003ccode\u003eglobal.resx\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eIn PageLoad im calling this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e setLanguageCookie(); //\u0026lt;- TO SET A COOKIE IF NULL\n InitializeCulture();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eInitializeCulture() looks like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e string sprache = \"en-US\";\n\n if (Request.Cookies[\"sprache\"] != null)\n { \n sprache = Request.Cookies[\"sprache\"].Value;\n }\n\n Thread.CurrentThread.CurrentCulture =\n CultureInfo.GetCultureInfo(sprache);\n\n Thread.CurrentThread.CurrentUICulture =\n CultureInfo.GetCultureInfo(sprache);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThere are 3 Language buttons. Their code behind look like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprotected void lang_en_Click(object sender, EventArgs e)\n {\n Request.Cookies[\"sprache\"] = \"en-US\";\n Session[\"Language\"] = \"en\";\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCan someone give me a hint where I am mistaking? O is there even a better way to do that??\u003c/p\u003e","answer_count":"3","comment_count":"2","creation_date":"2012-08-02 08:06:02.76 UTC","last_activity_date":"2013-01-14 21:26:24.167 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"982112","post_type_id":"1","score":"0","tags":"c#|asp.net|.net|resources","view_count":"1210"} +{"id":"17225","title":"How can Perl's system() print the command that it's running?","body":"\u003cp\u003eIn Perl, you can execute system commands using system() or `` (backticks). You can even capture the output of the command into a variable. However, this hides the program execution in the background so that the person executing your script can't see it. \u003c/p\u003e\n\n\u003cp\u003eNormally this is useful but sometimes I want to see what is going on behind the scenes. How do you make it so the commands executed are printed to the terminal, and those programs' output printed to the terminal? This would be the \u003ccode\u003e.bat\u003c/code\u003e equivalent of \"@echo on\".\u003c/p\u003e","accepted_answer_id":"17293","answer_count":"6","comment_count":"0","creation_date":"2008-08-19 23:47:00.947 UTC","favorite_count":"1","last_activity_date":"2009-10-21 10:36:44.927 UTC","last_edit_date":"2009-10-21 10:36:44.927 UTC","last_editor_display_name":"superjoe30","last_editor_user_id":"2766176","owner_display_name":"superjoe30","owner_user_id":"432","post_type_id":"1","score":"9","tags":"perl|system","view_count":"30507"} +{"id":"17268362","title":"AutoMapper for a list scenario only seems to repeat mapping the first object in the list","body":"\u003cp\u003eI am developing an MVC 3 application and am using AutoMapper to move data between my ViewModels and my entities. I have a scenario where I need to move data between two lists. For some strange reason, AutoMapper seems to only copy the first object from the source object and then seems to copy the same object n times over to the destination list. For example, say you have 2 lists, source contains six entity items and destination contains 0 items as it was just instantiated. The item at position source[0] get copied over to the destination and then source[0] is copied repeatedly for the same number of items there are in the source List, in this case 6. I don't understand what could be the cause of this.\u003c/p\u003e\n\n\u003cp\u003eHere is the AutoMapper configuration file:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic static class AutoMapperConfigurator\n{\n public static void Configure()\n {\n Mapper.CreateMap\u0026lt;User, UserModel\u0026gt;();\n Mapper.CreateMap\u0026lt;Posting, PostingModel\u0026gt;();\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is the Global.asax file setting\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprotected void Application_Start()\n{\n AutoMapperConfigurator.Configure();\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is the location where I am calling the Map method\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003euserSearchModel.UserList = Mapper.Map\u0026lt;IList\u0026lt;User\u0026gt;, IList\u0026lt;UserModel\u0026gt;\u0026gt;(userEntities);\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"17294544","answer_count":"2","comment_count":"0","creation_date":"2013-06-24 05:06:21.463 UTC","favorite_count":"1","last_activity_date":"2015-02-04 17:43:18.15 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1790300","post_type_id":"1","score":"2","tags":"c#|asp.net-mvc|automapper","view_count":"881"} +{"id":"29651433","title":"json.net limit maxdepth when serializing","body":"\u003cp\u003eWe're using Asp.Net WebAPI with Entity Framework (with lazy loading) and using Json.net for serializing the data to json before returning the data to the client.\u003c/p\u003e\n\n\u003cp\u003eWe are experiencing intermittent sudden spikes in memory usage which we suspect might originate with json.net not recognizing reference loops when serializing data (since Entity Framework might be doing some lazy loading voodoo with proxy classes which goes under the radar of json.net)\u003c/p\u003e\n\n\u003cp\u003eI thought I'd limit how deep Json.net was allowed to go to serialize data (at least then we'd get a sensible exception when this happens so we could fix it in the data model), but I soon discovered that the MaxDepth property of JsonSerializerSettings only kicks in when DEserializing objects.\u003c/p\u003e\n\n\u003cp\u003eIs there any known way of imposing a limit on json.net when serializing? \u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2015-04-15 13:21:28.723 UTC","last_activity_date":"2015-04-22 08:38:23.29 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"36465","post_type_id":"1","score":"4","tags":"json.net|lazy-loading|asp.net-web-api","view_count":"2023"} +{"id":"23927510","title":"Unable to locate an element with the xpath expression","body":"\u003cp\u003eUnable to locate the below \u003ccode\u003expath\u003c/code\u003e in \u003ccode\u003eselenium webdriver\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eit doesn't contain id and also tried with css selector but no change \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eXpathe:- /html/body/div/div/ng:view/div/div/div[2]/div/div[3]/div/nav/div[2]/div/ul/li[2]/a\n\ncss selector:-html body.ng-scope\n div div.container ng:view.row div.ng-scope \ndiv.container \ndiv.tabbable \ndiv.tab-content \ndiv.tab-pane \ndiv.ng-scope nav.navbar \ndiv.collapse \ndiv.nav ul.dropdown-menu li a.ng-binding.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ePlease let me know if any one faced this type of issue.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-05-29 06:55:10.23 UTC","last_activity_date":"2014-05-29 08:28:52.523 UTC","last_edit_date":"2014-05-29 07:01:40.423 UTC","last_editor_display_name":"","last_editor_user_id":"3156758","owner_display_name":"","owner_user_id":"3651675","post_type_id":"1","score":"0","tags":"java|selenium-webdriver","view_count":"493"} +{"id":"29671231","title":"How to get different languages for current location?","body":"\u003cp\u003eHow to get current location in different language.Do we need to add some libraries?I need to find the current address in arabic language? I think there is google maps in arabic format.Similarily is there any way to get current address in arabic lamguage?? \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic static final String GOOGLE_GEOCODER = \"http://maps.googleapis.com/maps/api/geocode/json?latlng=\";\n\npublic static String getAddressFromGPSData(double lat, double longi) {\n HttpRetriever agent = new HttpRetriever();\n String request = GOOGLE_GEOCODER + lat + \",\"\n + longi + \"\u0026amp;sensor=true\";\n // Log.d(\"GeoCoder\", request);\n String response = agent.retrieve(request);\n String formattedAddress = \"\";\n if (response != null) {\n Log.d(\"GeoCoder\", response);\n try {\n JSONObject parentObject = new JSONObject(response);\n JSONArray arrayOfAddressResults = parentObject\n .getJSONArray(\"results\");\n JSONObject addressItem = arrayOfAddressResults.getJSONObject(0);\n formattedAddress = addressItem.getString(\"formatted_address\");\n } catch (JSONException e) {\n\n e.printStackTrace();\n }\n\n }\n\n // Log.d(\"GeoCoder\", response);\n return formattedAddress;\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-04-16 09:54:56.607 UTC","last_activity_date":"2015-04-17 04:55:32.097 UTC","last_edit_date":"2015-04-17 04:55:32.097 UTC","last_editor_display_name":"","last_editor_user_id":"4729321","owner_display_name":"","owner_user_id":"4729321","post_type_id":"1","score":"-1","tags":"android|google-maps|reverse-geocoding|street-address","view_count":"813"} +{"id":"16258127","title":"Adding Adobe Edge Scripts into Rails Asset Pipeline","body":"\u003cp\u003eThis is likely a simple case of bringing external scripts with dependencies into Rails.\u003c/p\u003e\n\n\u003cp\u003eI'm trying to get my Adobe Edge generated Animations to work within my Rails app and the first step is to include all of Adobe Edge's generated js files, but so far I'm just getting a bunch of \u003cstrong\u003e404 Not Found Errors\u003c/strong\u003e for all of the Edge files I've included in the \u003ccode\u003eApplication.js\u003c/code\u003e file.\u003c/p\u003e\n\n\u003cp\u003eHere's my Application.js file\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e//= require jquery\n//= require jquery_ujs\n//= require underscore\n//= require backbone\n//= require california_internet\n//= require hero_edgePreload\n//= require edge_includes/edge.1.5.0.min\n//= require hero_edge\n//= require hero_edgeActions\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is how Edge's Preloader.js is trying to find some of the files...\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eaLoader=[{load:\"edge_includes/jquery-1.7.1.min.js\"},{load:\"edge_includes/edge.1.5.0.min.js\"},{load:\"hero_edge.js\"},{load:\"hero_edgeActions.js\"}]\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"0","creation_date":"2013-04-27 23:56:44.573 UTC","last_activity_date":"2013-11-27 09:30:25.55 UTC","last_edit_date":"2013-09-10 20:18:56.07 UTC","last_editor_display_name":"","last_editor_user_id":"125981","owner_display_name":"","owner_user_id":"1686562","post_type_id":"1","score":"3","tags":"javascript|jquery|ruby-on-rails|asset-pipeline|adobe-edge","view_count":"639"} +{"id":"43464173","title":"can't get css style's working on input type tel/number only","body":"\u003cp\u003eI'm having some real problems getting input type=tel or input type=number to work on every mobile device. It looks fine on Samsgung s7, iphone 6, hell even an LG K500K. But won't work on my HTC M9 or a Samsung Note. I've checked versions of androids and it seems fine one is using 6.0.1 and the other is on 6.0. I've tried using both a class and also input[type=tel/number] and even just input on it's own :( i looked around online for hours and couldn't find one person who's experiencing this same incosistency. Does anybody have any advice\u003c/p\u003e","answer_count":"0","comment_count":"4","creation_date":"2017-04-18 05:20:16.337 UTC","last_activity_date":"2017-04-18 05:20:16.337 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4123298","post_type_id":"1","score":"0","tags":"android|html|css|numbers|tel","view_count":"77"} +{"id":"34155653","title":"MySQL is not working after resizing EC2 instance","body":"\u003cp\u003eI have configured separate MySQL Production server as EC2- \u003ca href=\"/questions/tagged/m2.xlarge\" class=\"post-tag\" title=\"show questions tagged \u0026#39;m2.xlarge\u0026#39;\" rel=\"tag\"\u003em2.xlarge\u003c/a\u003e. This is ubuntu server.MySQL is working perfectly from 3 years on this instance. \u003cbr/\u003e\u003cbr/\u003e\nBut now I thought of downgrading a server because of less usage. When I stepped ahead to downgrade the server as \u003ca href=\"/questions/tagged/m1.medium\" class=\"post-tag\" title=\"show questions tagged \u0026#39;m1.medium\u0026#39;\" rel=\"tag\"\u003em1.medium\u003c/a\u003e or \u003ca href=\"/questions/tagged/m1.small\" class=\"post-tag\" title=\"show questions tagged \u0026#39;m1.small\u0026#39;\" rel=\"tag\"\u003em1.small\u003c/a\u003e using \u003ca href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-resize.html\" rel=\"nofollow\"\u003esteps given by AWS\u003c/a\u003e , I was able to resize it and started it with reassigning my original elastic IP, I found MySQL is now connecting from anywhere. \u003cbr/\u003e\u003cbr/\u003e\nI troubleshooted to connect MYSQL after resize as follows.\u003cbr/\u003e\n1. connected with ssh login on same instance and used command-line to connect.\u003cbr/\u003e\n2. Tried from outside(workbench) with same configuration..\u003cbr/\u003e\n3. Checked security groups assigned to instance. those are also in place..\u003cbr/\u003e\n4. \u003cstrong\u003eBut when I again resize instance with original (m2.xlarge), It works\u003c/strong\u003e .\u003cbr/\u003e\u003c/p\u003e\n\n\u003cp\u003eStill no success. any thing I missed after resizing process?\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2015-12-08 12:16:05.147 UTC","last_activity_date":"2015-12-08 12:16:05.147 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"584122","post_type_id":"1","score":"0","tags":"mysql|amazon-web-services|ssh|amazon-ec2|aws-ec2","view_count":"66"} +{"id":"38158224","title":"Initializer for conditional binding must have Optional type, not 'String' Variable Error","body":"\u003cp\u003eHello i have array and i want to explode 1 item into it and i want to check if variable not null or null and gives me that error\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eInitializer for conditional binding must have Optional type, not 'String' Variable Error\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eMy codes here.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e var myStringArrctakesf = itemListcomming.components(separatedBy: \",\")\n\n if let commingtel = myStringArrctakesf[11] { \n\n //notnull \n } else {\n\n//null\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want if myStringArrctakesf[11] is null dont crash app and if not null show variable.\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","accepted_answer_id":"38159708","answer_count":"1","comment_count":"1","creation_date":"2016-07-02 08:42:27.147 UTC","last_activity_date":"2016-07-02 12:25:02.56 UTC","last_edit_date":"2016-07-02 12:25:02.56 UTC","last_editor_display_name":"","last_editor_user_id":"2442804","owner_display_name":"","owner_user_id":"5393528","post_type_id":"1","score":"0","tags":"string|variables|swift2|swift3","view_count":"457"} +{"id":"17728444","title":"How can I call functions in different orders in PHP?","body":"\u003cp\u003eI am making a way to organize user into groups and need a way to check them. For example I have a method to check gender, which return true if there is no gender imbalance and false if there is. I also have similar methods to check age distribution and to check genders. For each of these methods I have a method which makes an optimized array of groups. \u003c/p\u003e\n\n\u003cp\u003eI.e. i have a method which optimizes groups based on gender. I would only call one of these methods if the respective check returns false. The problem I am running into is that when I optimize the groups based on a specific criterion i.e. gender, there is a chance that the new optimized groups have messed up another check criterion. \u003c/p\u003e\n\n\u003cp\u003eFor example, if I check age, gender and skill level (my third check) and I find that there is an imbalance in age, proceed to optimize the groups with respect to age, then I could potentially mess up gender or skill level distributions. My solution to this problem was that If I could find a way call all variations of the check methods and break if a check all method returned true (all checks return true, all groups have good balances of age, gender and skill level). \u003c/p\u003e\n\n\u003cp\u003eEx: \nLet A, B and C be check methods and optimize_A, optimize_B, optimize_C be the make optimized group methods. I need some way loop through the check methods 3! times (because there are 3 check methods and I need to run ABC, ACB, BAC, BCA, CAB, CBA). OR I could do a while loop and break if the method check all () returns true (all checks return true, all have good distributions) and break once I have run the all the combinations of the check methods. \u003c/p\u003e\n\n\u003cp\u003eCould anyone help me with this problem? Please bear in mind I am a novice programmer and have never done anything like this before. Thanks\u003c/p\u003e\n\n\u003cp\u003e\u003cb\u003eEdit\u003c/b\u003e: \u003c/p\u003e\n\n\u003cp\u003eHow could I do something like this JavaScript code snippet in php?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar arr = [check1, check2, check3],\n rand = Math.floor(Math.random() * arr.length),\n func = arr[rand];\nfunc();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is my attempt:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\n\n$checks_to_run = array('check_gender','check_age','check_skill_level');\n$rand = floor(rand(0, count($checks_to_run) - 1));\n$func = $checks_to_run[$rand];\necho $this-\u0026gt;.$func.($tmp); // $tmp is an array of groups \n\n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"17730808","answer_count":"1","comment_count":"4","creation_date":"2013-07-18 15:58:06.237 UTC","favorite_count":"1","last_activity_date":"2013-07-18 18:02:22.663 UTC","last_edit_date":"2013-07-18 17:49:14.993 UTC","last_editor_display_name":"","last_editor_user_id":"2554416","owner_display_name":"","owner_user_id":"2554416","post_type_id":"1","score":"4","tags":"php","view_count":"113"} +{"id":"16013146","title":"Javascript Prompt inside loop","body":"\u003cpre\u003e\u003ccode\u003efor (var j=0; j\u0026lt;2; j++){\nlistno=prompt(\"Enter Item Code\",\"0\");\nlistno = parseInt(listno);\n\nif (listno \u0026gt; 0) {\n PRODUCT_WANT.push(PRODUCT_LIST[listno]);\n WANT_PRICE.push(PRICE_LIST[listno]);\n}\n\nelse {\nalert('Invalid Product Code');\n}\nif (quantno \u0026gt; 0) {\n quantno=prompt(\"Enter Quantity\",\"0\");\n quantno = parseInt(quantno);\n quantity.push(quantno);\n}\n\nelse {\nalert('Invalid Quantity');\n}\n} \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe loop works but I don't want to have to set the loop count I want to be able to put it to eg 999 then be able to press cancel on the prompt and have the loop finish \u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2013-04-15 10:40:08.113 UTC","last_activity_date":"2013-04-15 12:00:55.987 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2181271","post_type_id":"1","score":"0","tags":"javascript|loops|prompt","view_count":"4163"} +{"id":"43585503","title":"Image is not displaying in the view ASP.NET MVC","body":"\u003cp\u003eI am trying to upload and retrieve image from SQL server database. I created model, Controller and view as below. \u003c/p\u003e\n\n\u003cp\u003eViewmodel is very similiar to actual modal\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eCheckoutModel.cs\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class CheckOutViewModel\n{\n public int ID { get; set; }\n public ApplicationUser CandidateId { get; set; }\n [Required]\n public byte[] Image { get; set; }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAlso i created a controller to upload and display images with action methods namely index, create and retreive\u003c/p\u003e\n\n\u003cp\u003eIndex method is used to display images , create method is used to upload and save image in database and retrieve method is used to query the image according to its id.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eCheckOutController.cs\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eusing Microsoft.AspNet.Identity;\nusing shanuMVCUserRoles.Repositories;\nusing shanuMVCUserRoles.ViewModels;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Web;\nusing System.Web.Mvc;\n\nnamespace shanuMVCUserRoles.Models\n{\n public class CheckOutController : Controller\n {\n private readonly ApplicationDbContext db;\n public CheckOutController()\n {\n db = new ApplicationDbContext();\n }\n\n [Route(\"Index\")]\n [HttpGet]\n public ActionResult Index()\n {\n var content = db.Checkouts.Select(s =\u0026gt; new\n {\n s.ID,\n s.CandidateId,\n s.Image,\n });\n\n List\u0026lt;CheckOutViewModel\u0026gt; contentModel = content.Select(item =\u0026gt; new CheckOutViewModel()\n {\n ID = item.ID,\n CandidateId = item.CandidateId,\n Image = item.Image,\n }).ToList();\n return View(contentModel);\n }\n\n\n public ActionResult RetrieveImage(int id)\n {\n byte[] cover = GetImageFromDataBase(id);\n if (cover != null)\n {\n return File(cover, \"image/jpg\");\n }\n else\n {\n return null;\n }\n }\n\n public byte[] GetImageFromDataBase(int Id)\n {\n var q = from temp in db.Checkouts where temp.ID == Id select temp.Image;\n byte[] cover = q.First();\n return cover;\n }\n\n // GET: CheckOut\n [Authorize]\n public ActionResult Create()\n {\n return View();\n }\n\n [Route(\"Create\")]\n [HttpPost]\n public ActionResult Create(CheckOutViewModel model)\n {\n HttpPostedFileBase file = Request.Files[\"ImageData\"];\n CheckOutRepository service = new CheckOutRepository();\n int i = service.UploadImageInDataBase(file, model);\n if (i == 1)\n {\n return RedirectToAction(\"Index\");\n }\n return View(model);\n }\n\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThen i created a repository folder to save images and fields in database and also a method for converted image to bytes.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eCheckoutRepostiory.cs\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class CheckOutRepository\n{\n private readonly ApplicationDbContext db;\n public CheckOutRepository()\n {\n db = new ApplicationDbContext();\n }\n public int UploadImageInDataBase(HttpPostedFileBase file, CheckOutViewModel contentViewModel)\n {\n contentViewModel.Image = ConvertToBytes(file);\n var userId = HttpContext.Current.User.Identity.GetUserId();\n var member = db.Users.Single(u =\u0026gt; u.Id == userId);\n var Content = new CheckOut\n {\n CandidateId = member,\n Image = contentViewModel.Image\n };\n db.Checkouts.Add(Content);\n int i = db.SaveChanges();\n if (i == 1)\n {\n return 1;\n }\n else\n {\n return 0;\n }\n }\n public byte[] ConvertToBytes(HttpPostedFileBase image)\n {\n byte[] imageBytes = null;\n BinaryReader reader = new BinaryReader(image.InputStream);\n imageBytes = reader.ReadBytes((int)image.ContentLength);\n return imageBytes;\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAlso i created the index view and then i placed the image in image tag using the for each loop.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eIndex.cshtml\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@foreach (var item in Model)\n{\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;\n \u0026lt;img src=\"/Content/RetrieveImage/@item.ID\" alt=\"\" height=100 width=200 /\u0026gt;\n \u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"43585659","answer_count":"2","comment_count":"4","creation_date":"2017-04-24 10:19:28.707 UTC","last_activity_date":"2017-04-24 10:37:20.177 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7755805","post_type_id":"1","score":"1","tags":"c#|sql-server|asp.net-mvc","view_count":"69"} +{"id":"25000110","title":"Kindle Silk Browser: Set focus on a textbox","body":"\u003cp\u003eThis is my first post, so I hope it finds it's way to the correct forum.\u003c/p\u003e\n\n\u003cp\u003eI created a web page with a SQL backend to capture the start time for a production job. There is only one textbox on the page. After the timestamp is saved, the focus is directed back to the textbox so that the next timestamp can be entered. It works fine for the browsers on my PC..I've tested it in IE and Chrome both.\u003c/p\u003e\n\n\u003cp\u003eHowever, the end user will be using a Kindle Fire HD tablet to input data. The form displays properly on Kindle's Silk Browser, but the focus doesn't set on my textbox. I have to use my finger to press inside the textbox in order for the cursor to appear.\u003c/p\u003e\n\n\u003cp\u003eI wrote code in both C# and JS to set the focus on my textbox, but neither approach worked on the Silk Browser. Again, it works fine on my PC for IE and Chrome.\u003c/p\u003e\n\n\u003cp\u003eI mostly work with SQL and I'm just starting to branch out into .net and C#. If someone could point me in the right direction, I would certainly appreciate it. Thanks!\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evoid btnSave_Click(object sender, EventArgs e) {\ncmd = new SqlCommand(\"UpdateEndTime_sp\", con); \ncmd.CommandType = CommandType.StoredProcedure; \ncmd.Parameters.Add(\"@WorkOrderNum\", SqlDbType.Int).Value = tbWorkOrderNum.Text; con.Open(); \ncmd.ExecuteNonQuery(); \ncon.Close(); \ntbWorkOrderNum.Text = \"\"; \nLabel1.Visible = true; \ntbWorkOrderNum.Focus(); \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eJavascript:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eif (document.getElementById(\"Textbox1\").value == \"\") { \n document.getElementById(\"Textbox1\").focus(); \n} \n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"6","creation_date":"2014-07-28 16:45:30.977 UTC","last_activity_date":"2014-07-28 17:08:28.797 UTC","last_edit_date":"2014-07-28 17:08:28.797 UTC","last_editor_display_name":"","last_editor_user_id":"33264","owner_display_name":"","owner_user_id":"1738172","post_type_id":"1","score":"0","tags":"c#|asp.net|amazon-silk","view_count":"97"} +{"id":"21831990","title":"Google Map is not getting displayed in xcode5","body":"\u003cp\u003eI am using xcode 5, I am creating a map view using google map api, using the link \u003ca href=\"https://developers.google.com/maps/documentation/ios/start#getting_the_google_maps_sdk_for_ios\" rel=\"nofollow\"\u003ehttps://developers.google.com/maps/documentation/ios/start#getting_the_google_maps_sdk_for_ios\u003c/a\u003e\ni am using google maps SDK 1.7.0.\u003cbr\u003e\nWhen I move to the mapView, in my log, it is getting printed as \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCannot find executable for CFBundle 0xc540670 \u0026lt;/Users/wifin/Library/Application Support/iPhone Simulator/7.0.3/Applications/5C049949-8859-4542-A434-F35A3A193356/MaaramaWines.app/GoogleMaps.bundle/GMSCoreResources.bundle\u0026gt; (not loaded)\n\nGoogle Maps SDK for iOS version: 1.7.0.7198\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut, the map is not getting displayed in the view, can anyone help me\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-02-17 14:44:41.57 UTC","last_activity_date":"2014-02-17 14:50:04.82 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3209332","post_type_id":"1","score":"0","tags":"ios|google-maps|xcode5","view_count":"129"} +{"id":"17174281","title":"Upgrading a code signed Mono app causes KeyChain to stop access without reboot","body":"\u003cp\u003eWe've a \u003cstrong\u003emono app\u003c/strong\u003e that we sign and bundle into an app on \u003cstrong\u003eOSX\u003c/strong\u003e.\nOur app accesses the keychain for stored passwords, stored using the app name\u003c/p\u003e\n\n\u003cp\u003eThis works fine, until we perform an \u003cstrong\u003eupgrade\u003c/strong\u003e.\nOn upgrade we replace the .app contents with the (also signed) contents of the upgrade zip file. \u003c/p\u003e\n\n\u003cp\u003eHowever, when the app attempts to access the keychain before, we have NULLs returned in place of our stored passwords. We have found:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eRunning codesign -vvv against the upgraded app shows the signature is valid.\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eIf we reboot the box, the app can access the keychain fine\u003c/strong\u003e. \u003c/li\u003e\n\u003cli\u003eIf the app is unsigned the upgrade and keychain access works fine.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eSo if there a step I'm missing in the signing / upgrade? Is there a service I can restart that would solve it?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eUpdate\u003c/strong\u003e:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eafter the update, the keychain call to retrieve credentials returns 'AuthFailed' after reboot we get 'Success'\u003c/li\u003e\n\u003c/ul\u003e","accepted_answer_id":"17827396","answer_count":"1","comment_count":"0","creation_date":"2013-06-18 16:35:06.02 UTC","last_activity_date":"2013-07-24 07:10:09.6 UTC","last_edit_date":"2013-06-19 07:59:12.707 UTC","last_editor_display_name":"","last_editor_user_id":"32027","owner_display_name":"","owner_user_id":"32027","post_type_id":"1","score":"0","tags":"osx|mono|keychain|codesign|xamarin.mac","view_count":"107"} +{"id":"40616953","title":"Divide a std::string without copying","body":"\u003cp\u003eIs it possible to divide a \u003ccode\u003estd::string\u003c/code\u003e into two or more substrings without copying, much like we can use a move constructor to create a new \u003ccode\u003estd::string\u003c/code\u003e without copying?\u003c/p\u003e","accepted_answer_id":"40617037","answer_count":"2","comment_count":"3","creation_date":"2016-11-15 18:17:52.403 UTC","last_activity_date":"2016-11-15 18:56:42.953 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4089452","post_type_id":"1","score":"3","tags":"c++|string","view_count":"97"} +{"id":"28886726","title":"Is it possible to protect a database from being deleted in Azure?","body":"\u003cp\u003eI have one production database and a test database. Now and then I delete the test database, and make a fresh duplicate from the production db.\u003c/p\u003e\n\n\u003cp\u003eI am pretty scared that at a brainless moment I will by accident delete the production database.\u003c/p\u003e\n\n\u003cp\u003eI know that you can restore a deleted database, but even the downtime can be quite catastrophic at certain moments in time.\u003c/p\u003e\n\n\u003cp\u003eIs it possible to give it an extra lock or some other way to prevent me from deleting this database by accident?\u003c/p\u003e","answer_count":"2","comment_count":"2","creation_date":"2015-03-05 20:05:46.77 UTC","last_activity_date":"2015-03-06 07:12:23.017 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"647845","post_type_id":"1","score":"0","tags":"database|azure","view_count":"125"} +{"id":"7279063","title":"CLEAR DATA when a home screen widget is active?","body":"\u003cp\u003eI have a Home Screen widget that stores both some cached data and some shared preferences in the package's private data directory.\u003c/p\u003e\n\n\u003cp\u003eI can handle the loss of the data cleanly when the user \"CLEAR DATA\" option is selected, but I have important shared preferences that get trashed also. (There can be multiple instances of the widget, etc.) The point is that a normal App won't be running when the CLEAR DATA is performed and so the App can recover next time it is launched, but the widget has no way to recover or even know that the preferences have been trashed.\u003c/p\u003e\n\n\u003cp\u003eDoes any one have any suggestions how to make my preferences truly persistent for the lifetime of the widget on the Home Screen?\u003c/p\u003e\n\n\u003cp\u003eIt is irritating that this behaviour of the CLEAR DATA button was added some time after the developer documentation was written and it directly contradicts the documentation. Who updates the documentation? Why has this been left as a lie to confuse developers for so long?\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2011-09-02 03:54:25.127 UTC","last_activity_date":"2012-02-22 15:09:39.073 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"873897","post_type_id":"1","score":"1","tags":"android|android-widget","view_count":"631"} +{"id":"43069288","title":"Javascript, saving values from onclick and saving previous values in arrays","body":"\u003cp\u003ei'm trying to save values retrieved from \"onclick\" and also save the values previously retrieved from \"onclick\" in different arrays when buttons are clicked.\u003c/p\u003e\n\n\u003cp\u003ebut it seems like when \"for loop\" is used, newly retrieved values overwrite previously retrieved data even though those values are saved separately in different arrays.\u003c/p\u003e\n\n\u003cp\u003ei'm really confused right now, does anybody know why?\u003c/p\u003e\n\n\u003cp\u003e(if you hit the button \"refresh\", you can see the current values that are saved.)\u003c/p\u003e\n\n\u003cp\u003e\u003cdiv class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\"\u003e\r\n\u003cdiv class=\"snippet-code\"\u003e\r\n\u003cpre class=\"snippet-code-js lang-js prettyprint-override\"\u003e\u003ccode\u003evar firstValue = [];\r\nvar preValue = [];\r\n\r\n\r\n\r\nfunction returneD(a){\r\n\r\n preValue = firstValue;\r\n console.log(\"returned! preValue: \"+preValue);\r\n\r\n for (var i = 0; i \u0026lt; 1; i++) {\r\n firstValue[i] = a;\r\n console.log(\"returned! firstValue: \"+firstValue);\r\n }\r\n}\r\n\r\n\r\nfunction refresh1(){\r\n console.log(\"preValue: \"+preValue);\r\n console.log(\"firstValue: \"+firstValue);\r\n}\u003c/code\u003e\u003c/pre\u003e\r\n\u003cpre class=\"snippet-code-html lang-html prettyprint-override\"\u003e\u003ccode\u003e\u0026lt;!DOCTYPE html\u0026gt;\r\n\u0026lt;html\u0026gt;\r\n\u0026lt;head\u0026gt;\r\n \u0026lt;script src=\"jstest.js\"\u0026gt;\u0026lt;/script\u0026gt;\r\n\u0026lt;/head\u0026gt;\r\n\u0026lt;body id=\"thebody\"\u0026gt;\r\n\r\n\u0026lt;button id=\"1\" onclick=\"returneD(this.id)\"\u0026gt;O N E\u0026lt;/button\u0026gt;\r\n\u0026lt;button id=\"2\" onclick=\"returneD(this.id)\"\u0026gt;T W O\u0026lt;/button\u0026gt;\r\n\u0026lt;button id=\"3\" onclick=\"returneD(this.id)\"\u0026gt;T H R E E\u0026lt;/button\u0026gt;\r\n\u0026lt;button id=\"4\" onclick=\"returneD(this.id)\"\u0026gt;F O U R\u0026lt;/button\u0026gt;\r\n\u0026lt;br\u0026gt;\r\n\u0026lt;button onclick=\"refresh1()\"\u0026gt;refresh\u0026lt;/button\u0026gt;\r\n\r\n\u0026lt;/body\u0026gt;\r\n\u0026lt;/html\u0026gt;\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003c/p\u003e","accepted_answer_id":"43069639","answer_count":"2","comment_count":"1","creation_date":"2017-03-28 12:14:06.27 UTC","last_activity_date":"2017-03-28 12:32:52.677 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7779646","post_type_id":"1","score":"0","tags":"javascript|arrays|for-loop|onclick","view_count":"81"} +{"id":"19711043","title":"Plotting function on sphere","body":"\u003cp\u003eI have a problem with plotting a function on the unit sphere. \u003c/p\u003e\n\n\u003cp\u003eThe function is given analytically:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ef = 0.75*exp(-(9*x-2)^2/4 - (9*y-2)^2/4 - (9*z-2)^2/4) + 0.75*exp(-(9*x+1)^2/49-(9*y+1)/10-(9*z+1)/10) + 0.5*exp(-(9*x-7)^2/4 - (9*y-3)^2/4 - (9*z-5)^2/4)-0.2*exp(-(9*x-4)^2 - (9*y-7)^2 - (9*z-5)^2);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewith x,y,z - points on the sphere. I want to plot it on the sphere, namely stretch it somehow on the unit sphere instead of \u003ccode\u003esurf(x,y,f)\u003c/code\u003e\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2013-10-31 15:48:08.093 UTC","last_activity_date":"2015-03-08 23:41:49.333 UTC","last_edit_date":"2015-03-08 23:41:49.333 UTC","last_editor_display_name":"","last_editor_user_id":"1118321","owner_display_name":"","owner_user_id":"2942072","post_type_id":"1","score":"0","tags":"matlab|function|plot|geometry","view_count":"434"} +{"id":"39966376","title":"Laravel search results Not Displaying Properly","body":"\u003cp\u003eI have a Form (Laravel 5.2) for a search. I only have one table and my data displays. If I search by a lastName I would like it to display everyone who has the last name. If I search by manufacturer I would like it to display all PCs made by that manufacturer. I am basically trying to make each column on the database searchable. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;!DOCTYPE html\u0026gt;\n\u0026lt;html\u0026gt;\n \u0026lt;head\u0026gt;\n \u0026lt;meta charset=\"utf-8\"\u0026gt;\n \u0026lt;title\u0026gt;Inventory\u0026lt;/title\u0026gt;\n \u0026lt;link rel=\"stylesheet\" href=\"/css/libs.css\"\u0026gt;\n \u0026lt;link rel=\"stylesheet\" href=\"/css/app.css\"\u0026gt;\n \u0026lt;script src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;/head\u0026gt;\n \u0026lt;body\u0026gt;\n\n \u0026lt;nav class=\"navbar navbar-inverse navbar-fixed-top\"\u0026gt;\n\u0026lt;div class=\"container-fluid\"\u0026gt;\n \u0026lt;div class=\"navbar-header\"\u0026gt;\n \u0026lt;button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\" aria-controls=\"navbar\"\u0026gt;\n \u0026lt;span class=\"sr-only\"\u0026gt;Toggle navigation\u0026lt;/span\u0026gt;\n \u0026lt;span class=\"icon-bar\"\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;span class=\"icon-bar\"\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;span class=\"icon-bar\"\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;/button\u0026gt;\n \u0026lt;a class=\"navbar-brand\" href=\"http://inventory.app:8000/computers/create\" Inventory\u0026lt;/a\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div id=\"navbar\" class=\"navbar-collapse collapse\"\u0026gt;\n \u0026lt;ul class=\"nav navbar-nav navbar-right\"\u0026gt;\n \u0026lt;li\u0026gt;\n {{ Form::open(['method' =\u0026gt; 'GET', 'url'=\u0026gt;'computers/search']) }}\n {{ Form::input('search', 'q', null, ['placeholder' =\u0026gt; 'Search...']) }}\n {{ Form::close() }}\n \u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"http://inventory.app:8000/computers/create\"\u0026gt;Update Inventory\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#\"\u0026gt;Logout\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n\n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u0026lt;/nav\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am using Route Resource for my Routing. My route for my search is \u003c/p\u003e\n\n\u003cp\u003eRoute::get('computers/search', 'InventoriesController@search');\u003c/p\u003e\n\n\u003cp\u003eMy Search Controller is as follows\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic function search()\n\n {\n $search = \\Request::get('search'); //\u0026lt;-- we use global request to get the param of URI\n\n// $search = Input::get('search');\n\n $inventories = Inventory::where('lastName','LIKE','%'.$search.'%')\n -\u0026gt; orwhere('firstName', 'LIKE','%'.$search.'%' )\n -\u0026gt; orwhere('department', 'LIKE','%'.$search.'%' )\n -\u0026gt; orwhere('building', 'LIKE','%'.$search.'%' )\n -\u0026gt; orwhere('room', 'LIKE','%'.$search.'%' )\n -\u0026gt; orwhere('manufacturer', 'LIKE','%'.$search.'%' )\n -\u0026gt; orwhere('device', 'LIKE','%'.$search.'%' )\n -\u0026gt; orwhere('model', 'LIKE','%'.$search.'%' )\n -\u0026gt; orwhere('tag', 'LIKE','%'.$search.'%' )\n -\u0026gt; orwhere('macAddress', 'LIKE','%'.$search.'%' )\n -\u0026gt; orwhere('status', 'LIKE','%'.$search.'%' )\n -\u0026gt; orwhere('comments', 'LIKE','%'.$search.'%' )\n -\u0026gt;get($search);\n\n\n\n\n return view('computers.search',compact('inventories'));\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have tried doing an orderBy('search') but that did not do anything. My table just displays but it does redirect to the search route because the URL changes \nFor example \u003ca href=\"http://inventory.app:8000/computers/search?q=Dell\" rel=\"nofollow\"\u003ehttp://inventory.app:8000/computers/search?q=Dell\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"39966457","answer_count":"1","comment_count":"0","creation_date":"2016-10-10 20:37:51.977 UTC","last_activity_date":"2016-10-10 20:44:24.373 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3808598","post_type_id":"1","score":"0","tags":"php|forms|laravel|search|laravel-5.2","view_count":"54"} +{"id":"15846294","title":"how to read a specific region in android emmc","body":"\u003cp\u003eI want to read the emmc of my device as the recovery seems to be on it.\ncat /proc/mtd doesn't give any output and the deice can't be read by sp flash tool :(\u003c/p\u003e\n\n\u003cp\u003eWhat I want to do is to replace some files from CWM recovery with the stock ones (its an MTK device).\u003c/p\u003e\n\n\u003cp\u003ecat /proc/dumchar_info gives a table like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ePart_Name Size StartAddr Type MapTo\npreloader 0x0000000000040000 0x0000000000000000 2 /dev/misc-sd\ndsp_bl 0x00000000005c0000 0x0000000000040000 2 /dev/misc-sd\nmbr 0x0000000000004000 0x0000000000000000 2 /dev/block/mmcblk0\nebr1 0x000000000005c000 0x0000000000004000 2 /dev/block/mmcblk0p1\npmt 0x0000000000400000 0x0000000000060000 2 /dev/block/mmcblk0\nnvram 0x0000000000300000 0x0000000000460000 2 /dev/block/mmcblk0\nseccfg 0x0000000000020000 0x0000000000760000 2 /dev/block/mmcblk0\nuboot 0x0000000000060000 0x0000000000780000 2 /dev/block/mmcblk0\nbootimg 0x0000000000600000 0x00000000007e0000 2 /dev/block/mmcblk0\nrecovery 0x0000000000600000 0x0000000000de0000 2 /dev/block/mmcblk0\nsec_ro 0x0000000000600000 0x00000000013e0000 2 /dev/block/mmcblk0p5\nmisc 0x0000000000060000 0x00000000019e0000 2 /dev/block/mmcblk0\nlogo 0x0000000000300000 0x0000000001a40000 2 /dev/block/mmcblk0\nexpdb 0x00000000000a0000 0x0000000001d40000 2 /dev/block/mmcblk0\nebr2 0x0000000000004000 0x0000000001de0000 2 /dev/block/mmcblk0\nandroid 0x0000000020100000 0x0000000001de4000 2 /dev/block/mmcblk0p6\ncache 0x0000000020100000 0x0000000021ee4000 2 /dev/block/mmcblk0p2\nusrdata 0x0000000020100000 0x0000000041fe4000 2 /dev/block/mmcblk0p3\nfat 0x0000000083f1c000 0x00000000620e4000 2 /dev/block/mmcblk0p4\nbmtpool 0x0000000000a00000 0x00000000ff9f0050 2 /dev/block/mmcblk0\nPart_Name:Partition name you should open;\nSize:size of partition\nStartAddr:Start Address of partition;\nType:Type of partition(MTD=1,EMMC=2)\nMapTo:actual device you operate\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny help?\u003c/p\u003e","answer_count":"3","comment_count":"0","creation_date":"2013-04-06 02:18:17.75 UTC","last_activity_date":"2016-06-29 08:56:11.55 UTC","last_edit_date":"2013-06-02 08:13:47.513 UTC","last_editor_display_name":"","last_editor_user_id":"332960","owner_display_name":"","owner_user_id":"2251198","post_type_id":"1","score":"0","tags":"android","view_count":"6853"} +{"id":"17247767","title":"Virtual property in Entity Framework or SQL Server join using view","body":"\u003cp\u003eI have a model that has many navigation properties to other poco models. I was wondering that replacing it with a SQL view that join all these tables by foreign keys into one respecting model to get all data that I need in one trip will boost performance. Any tips will be appreciated.\u003c/p\u003e","accepted_answer_id":"18469509","answer_count":"1","comment_count":"0","creation_date":"2013-06-22 05:52:11.267 UTC","last_activity_date":"2013-08-27 15:19:31.163 UTC","last_edit_date":"2013-06-22 06:27:07.557 UTC","last_editor_display_name":"","last_editor_user_id":"13302","owner_display_name":"","owner_user_id":"1508274","post_type_id":"1","score":"0","tags":"sql-server|entity-framework","view_count":"136"} +{"id":"44233807","title":"Jasmine Error: Expected undefined to equal","body":"\u003cp\u003eI'm trying to figure out why I'm getting this error. I have a $scope.message in my angular application in my controller but when I put expect(scope.message)toEqual(\"It Works\"); I get this Error can anyone point me in the right direction as to what I'm doing wrong. It works when I render the application with index file, I'm using Jasmine and Karma for unit testing. Here is my code.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar app = angular.module(\"MyApp\", []);\n\napp.controller(\"MyController\",['$scope', function($scope) {\nconsole.log(\"Reaching Controller\");\n\n $scope.message=\"Its Good\";\n\n $scope.customer = {\n name: 'Naomi',\n address: '1600 Amphitheatre'\n };\n\n\n}])\n\n\n//normilized name factory function and should return an object\n app.directive('myCustomer', function(){\n return function(scope, elem){ //this for strictly testing \n directives\n\n elem.append('\u0026lt;span\u0026gt;This span is appended from directive.\u0026lt;/span\u0026gt;');\n };\n});\n\n /*Here is my unit test\n describe(\"Hello PageCtrl working\", function() {\n beforeEach(module('MyApp'));\n\n describe('Reaching Controller', function(){\n var scope,appCtrl, message;\n\n\n beforeEach(inject(function($rootScope, $controller) {\n scope = $rootScope.$new();\n appCtrl = $controller(\"MyController\", {$scope:scope}); \n\n })); \n\n it(\"should have a message of Its Good\", function () {\n expect(scope.message).toEqual(\"Its Good\");\n });\n });\n}); \n\n\nThanks In Advance,\nHP\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"3","creation_date":"2017-05-29 02:15:22.317 UTC","last_activity_date":"2017-05-29 02:15:22.317 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2280852","post_type_id":"1","score":"0","tags":"angularjs|html5|jasmine","view_count":"271"} +{"id":"28331418","title":"How to write shell script which handles interactive inputs?","body":"\u003cp\u003eI have a command which takes 2 arguments.\u003c/p\u003e\n\n\u003cp\u003eWhen I run the command manually, I do this way:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecmd -i xyz.dat \nhit enter \nenter password in the prompt \nhit enter\nconfirm password\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy script needs to do the above operations without expecting user to enter password. I can hardcode the passwords in the file, but need a way to run this command successfully when I execute the shell script.\u003c/p\u003e\n\n\u003cp\u003eAs on Feb 7th,\nI have expect installed on my AIX. When I type expect at the command prompt, the prompt changes to expect 1.1\u003e OS is 64 bit AIX\u003c/p\u003e\n\n\u003cp\u003eI have followed the instructions mentioned in the below comment, but I keep getting error - could not execute the command; no such file or directory\"? I am able to manually run this command from same directory I am running the script. Besides that I have given the complete path of the command and the \nfile.\u003c/p\u003e\n\n\u003cp\u003eI am pasting another program I tried to su with root password as below: i get the same error message when I run the test program. I doubt if this is something related to quotes.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#!/bin/bash\nset timeout 20\nspawn \"su\"\nexpect \"Password:\" { send:\"temp123\\r\" }\ninteract\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCan someone please help me fix this error?\u003c/p\u003e","answer_count":"1","comment_count":"8","creation_date":"2015-02-04 21:05:10.683 UTC","last_activity_date":"2015-02-08 04:01:53.463 UTC","last_edit_date":"2015-02-08 04:01:53.463 UTC","last_editor_display_name":"","last_editor_user_id":"1394668","owner_display_name":"","owner_user_id":"1394668","post_type_id":"1","score":"0","tags":"shell|unix|expect","view_count":"651"} +{"id":"24546783","title":"Finding min and max time in a set of arrays","body":"\u003cp\u003eI have a array of time as,\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e var arr= [\"17:30:48\",\"19:30:48\",\"18:30:48\",\"19:30:48\",\"17:40:48\",\"19:10:48\",\"17:10:48\",\"19:30:45\",\"17:13:48\",\"19:13:48\",\"17:30:48\",\"19:28:48\"];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to get the min and max time out of these. tried if else but its becoming to lengthy by it.is there any easy way to do it.\u003c/p\u003e","accepted_answer_id":"24546962","answer_count":"3","comment_count":"6","creation_date":"2014-07-03 06:49:04.737 UTC","last_activity_date":"2014-07-03 07:17:47.837 UTC","last_edit_date":"2014-07-03 07:17:47.837 UTC","last_editor_display_name":"","last_editor_user_id":"2705974","owner_display_name":"","owner_user_id":"2705974","post_type_id":"1","score":"2","tags":"javascript|arrays|if-statement","view_count":"463"} +{"id":"6105565","title":"Activity streams / feeds, to denormalize or not?","body":"\u003cp\u003eI know variations of this question have been asked many times before \u003cem\u003e(and I've read them, 2 of them being: \u003ca href=\"https://stackoverflow.com/questions/202198/whats-the-best-manner-of-implementing-a-social-activity-stream\"\u003e1\u003c/a\u003e, \u003ca href=\"https://stackoverflow.com/questions/1443960/how-to-implement-the-activity-stream-in-a-social-network\"\u003e2\u003c/a\u003e)\u003c/em\u003e, but I just can't wrap my head around anything that just feels like the right solution.\u003c/p\u003e\n\n\u003cp\u003eEverything has been suggested from many to many relations, to fanout, to polymorphic associations, to NoSQL solutions, to message queues, to denormalization and combinations of them all.\u003c/p\u003e\n\n\u003cp\u003eI know this question is very situational, so I'll briefly explain mine:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eMany activities that trigger many events.\n\n\u003cul\u003e\n\u003cli\u003eFollowing, creating, liking, commenting, editing, deleting, etc.\u003c/li\u003e\n\u003c/ul\u003e\u003c/li\u003e\n\u003cli\u003eA user can follow another user's activity \u003cem\u003e(the events they trigger)\u003c/em\u003e.\u003c/li\u003e\n\u003cli\u003eThe most requested events will be the most recent events.\n\n\u003cul\u003e\n\u003cli\u003eThe ability to view past events is desired.\u003c/li\u003e\n\u003c/ul\u003e\u003c/li\u003e\n\u003cli\u003eNo sorting or searching of the feed is desired past ordering by date desc.\u003c/li\u003e\n\u003cli\u003eScalability is a concern \u003cem\u003e(performance and expandability)\u003c/em\u003e.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eFor the mean time, I ended up going with a denormalized setup basically being made up of an events table consisting of: \u003ccode\u003eid\u003c/code\u003e, \u003ccode\u003edate\u003c/code\u003e, \u003ccode\u003euser_id\u003c/code\u003e, \u003ccode\u003eaction\u003c/code\u003e, \u003ccode\u003eroot_id\u003c/code\u003e, \u003ccode\u003eobject_id\u003c/code\u003e, \u003ccode\u003eobject\u003c/code\u003e, \u003ccode\u003edata\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003euser_id\u003c/code\u003e being the person that triggered the event.\u003cbr\u003e\n\u003ccode\u003eaction\u003c/code\u003e being the action.\u003cbr\u003e\n\u003ccode\u003eroot_id\u003c/code\u003e being the user the \u003ccode\u003eobject\u003c/code\u003e belongs to.\u003cbr\u003e\n\u003ccode\u003eobject\u003c/code\u003e being the object type.\u003cbr\u003e\n\u003ccode\u003edata\u003c/code\u003e containing the minimum amount of information needed to render the event in a user's stream.\u003c/p\u003e\n\n\u003cp\u003eThen to get the desired events, I just grab all rows in which the \u003ccode\u003euser_id\u003c/code\u003e is the id of a user being followed by whose stream we're grabbing.\u003c/p\u003e\n\n\u003cp\u003eIt \u003cem\u003eworks\u003c/em\u003e, but the denormalization just \u003cem\u003efeels\u003c/em\u003e wrong. Polymorphic associations seem similarly so. Fanout seems to be somewhere in between, but feels very messy.\u003c/p\u003e\n\n\u003cp\u003eWith all my searching on the issue, and reading the numerous questions here on SO, I just can't get anything to click and feel like the right solution.\u003c/p\u003e\n\n\u003cp\u003eAny experience, insight, or help anyone can offer is \u003cstrong\u003egreatly\u003c/strong\u003e appreciated. Thanks.\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2011-05-24 04:04:25.507 UTC","favorite_count":"10","last_activity_date":"2013-10-30 13:11:39.897 UTC","last_edit_date":"2017-05-23 12:30:29.013 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"235002","post_type_id":"1","score":"16","tags":"database-design|social-networking","view_count":"3536"} +{"id":"15086186","title":"How to change the URL in browser due to the navigation at iframe?","body":"\u003cp\u003eI want to change the URL in browser based on the iframe navigation like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e**[URL at navigator: http://localhost/]**\n\n\u0026lt;html\u0026gt;\n\u0026lt;body\u0026gt;\n\u0026lt;iframe src=\"http://localhost/?loadiframe=true\"\u0026gt;\n \u0026lt;!-- this is at the code retrieved by the iframe --\u0026gt;\n \u0026lt;a id=\"mypage\" href=\"http://localhost/mypage/?loadiframe=true\"\u0026gt;Navi\u0026lt;/a\u0026gt;\n\u0026lt;/iframe\u0026gt;\n\u0026lt;/body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen the user clicks the #mypage link the URL in the browser will be:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ehttp://localhost/mypage/\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNot matters that the src of the iframe be the same always.\u003c/p\u003e\n\n\u003cp\u003e¿Is that possible?\u003c/p\u003e\n\n\u003cp\u003eMaybe using ajax.........??\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2013-02-26 10:03:35.31 UTC","favorite_count":"1","last_activity_date":"2013-02-26 10:17:41.227 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"439866","post_type_id":"1","score":"1","tags":"javascript|jquery|html|url|iframe","view_count":"624"} +{"id":"16528948","title":"Does IdIMAP4.UIDRetrieveEnvelope get the entire message body?","body":"\u003cp\u003eDoes IdIMAP4.UIDRetrieveEnvelope method retrieve the entire message body or only the headers?\u003c/p\u003e","accepted_answer_id":"16533775","answer_count":"1","comment_count":"6","creation_date":"2013-05-13 18:43:00.69 UTC","last_activity_date":"2013-05-14 01:33:50.03 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1992767","post_type_id":"1","score":"1","tags":"delphi|indy","view_count":"335"} +{"id":"3337401","title":"ASP.NET 4.0 - Calling a server-side method from a client side method - PageMethods","body":"\u003cp\u003eI'm trying to access a server side method from a client side one (that is just calling a server method from javascript). I'm using .NET 4.0 Visual Studio 2010 Ultimate. I'm building a web control (ascx).\nI have an ascx page (the control's html) and an ascx.cs page:\nThe ascx is the following:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;%@ Control Language=\"C#\" AutoEventWireup=\"true\" CodeFile=\"BoxButton.ascx.cs\" Inherits=\"ATB.Controls._BoxButton\" %\u0026gt;\n\n\u0026lt;asp:ScriptManager ID=\"SM_ScriptManager\" runat=\"server\" EnablePageMethods=\"true\" /\u0026gt;\n\u0026lt;script type=\"text/javascript\"\u0026gt;\n function handle() {\n PageMethods.manageHandler();\n }\n\u0026lt;/script\u0026gt;\n\u0026lt;span id=\"BoxButton_HtmlSpan\" runat=\"server\" onclick=\"handle();\" style=\"background-color:#efefef;border-style:solid;border-width:1px;border-color:#cccccc;height:25px;text-align:center;padding:3px 3px 3px 3px;font-family:Arial, Helvetica, sans-serif;font-size:12px;font-style:normal;color:#333333;line-height:15px\"\u0026gt;\n \u0026lt;asp:Label runat=\"server\" Text=\"Button\" id=\"Text_Label\"\u0026gt;\u0026lt;/asp:Label\u0026gt;\n\u0026lt;/span\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd the ascx.cs file is this one (just printing the function):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[System.Web.Services.WebMethod]\n public static string manageHandler() {\n int i = 0;\n System.Console.WriteLine(\"Ciao\");\n return \"Hello\";\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWell, as you can see I'm trying to solve my problem through pagemethods, well it does not work and I always getPageMethods is undefined b y the JScript runtime manager.\nWell, is it possible that PageMethods are not available in .net 4.0?\u003c/p\u003e\n\n\u003cp\u003eAnyway, is there another approach for solving the problem regarding server side method calling from client side scripts? I understood that pagemethods are nothing more than a web service, and this bothers me a little when thinking about security in my web app.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eWell, it seems that jQuery is a valid solution... but is it able to allow me to call a server side method? I expect to be because we're talking about ajax right?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT 2:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eAh... Another question... I tried to use a webmethod but it does not work getting me errors not finding PageMethods in javascript while I set scriptmanager and method's attribute WebMethod as specified....\u003c/p\u003e\n\n\u003cp\u003eIs it because I'm working inside an ascx?????? possible????? Then, even jQuery will not help....\u003c/p\u003e","answer_count":"3","comment_count":"1","creation_date":"2010-07-26 17:40:22.48 UTC","last_activity_date":"2016-02-02 07:29:18.85 UTC","last_edit_date":"2011-12-17 19:43:13.76 UTC","last_editor_display_name":"","last_editor_user_id":"507519","owner_display_name":"","owner_user_id":"402574","post_type_id":"1","score":"1","tags":"c#|asp.net|asmx|pagemethods","view_count":"2971"} +{"id":"37763587","title":"Ethereum - does not exist/is not available error with web3","body":"\u003cp\u003eI'm trying to get a simple whisper example running with web3 on geth console:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar f = web3.shh.filter({topics: [\"qwerty\"]})\nf.get()\nweb3.shh.getMessages(\"qwerty\")\nweb3.shh.post({topics: [\"qwerty\"], payload: \"0x847a786376\", ttl: \"0x1E\", workToProve: \"0x9\" })\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut I'm getting these errors:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026gt; f.get()\nFilter ID Error: filter().get() can't be chained synchronous, please provide a callback for the get() method.\n at web3.js:3602:23\n at \u0026lt;anonymous\u0026gt;:1:1\n\n\u0026gt; web3.shh.getMessages(\"qwerty\")\nTypeError: 'getMessages' is not a function\n at \u0026lt;anonymous\u0026gt;:1:1\n\n\u0026gt; web3.shh.post({topics: [\"qwerty\"], payload: \"0x847a786376\", ttl: \"0x1E\", workToProve: \"0x9\" })\nThe method shh_post does not exist/is not available\n at web3.js:3119:20\n at web3.js:6023:15\n at web3.js:4995:36\n at \u0026lt;anonymous\u0026gt;:1:1\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs the documentation not up to date or does it not run with my geth version (tried 1.4.5 and 1.5)?\nAlso get a \"does not exist/is not available\" error for \u003ccode\u003eweb3.shh.newIdentity()\u003c/code\u003e\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2016-06-11 12:14:03.27 UTC","favorite_count":"1","last_activity_date":"2016-12-14 07:26:11.577 UTC","last_edit_date":"2016-12-14 07:26:11.577 UTC","last_editor_display_name":"","last_editor_user_id":"12860","owner_display_name":"","owner_user_id":"1476137","post_type_id":"1","score":"1","tags":"ethereum|whisper","view_count":"517"} +{"id":"18143010","title":"beyond compare script for folder sync","body":"\u003cp\u003eI am writing a Beyond Compare script which will sync two folders. Consider these folder structures:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eFolder1\n-------\nSubfolderA\n --FileA(modified)\n --FileB(new)\nSubfolderB\n --FileC\nFileD(modified)\n\n\nFolder2\n-------\nSubfolderA\n --FileA\nFileD\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow what I am trying to achieve is that after syncing them, only the files and folders pertaining to Folder2 should be copied to it. \u003c/p\u003e\n\n\u003cp\u003eSo in this case \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e-the modified ones and the new ones in the SubfolderA should be copied on its counterpart\n\n-SubfolderB should not becopied or created as there is no such subfolder in Folder2. \n\n-Whereas the modified FileD should be copied.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat should go along with the \u003ccode\u003eselect\u003c/code\u003e and \u003ccode\u003eupdate\u003c/code\u003e or \u003ccode\u003esync\u003c/code\u003e \u003c/p\u003e\n\n\u003cp\u003eThanks in advance\u003c/p\u003e","accepted_answer_id":"18337906","answer_count":"1","comment_count":"0","creation_date":"2013-08-09 08:40:18.25 UTC","last_activity_date":"2013-08-20 14:39:01.467 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1383744","post_type_id":"1","score":"0","tags":"beyondcompare","view_count":"1308"} +{"id":"10068809","title":"How to upgrade cakephp from 1.3 to 2.1?","body":"\u003cp\u003eI'm a newbie in cakephp, I'm trying to upgrade cakephp to the latest version.\nI install the fresh cakephp 1.3 on my computer and the upgrade it to cakephp 2.1.\u003c/p\u003e\n\n\u003cp\u003eI use shell to upgrade, but after I run 'upgrade all' command, I saw two error:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e\u003ccode\u003eWarning Error: chmod(): Operation not permitted in [/var/www/cakephp-1.3/lib/Cake/Utility/Folder.php, line 639]\u003c/code\u003e\u003c/p\u003e\n \n \u003cp\u003e\u003ccode\u003eWarning Error: touch(): Utime failed: Operation not permitted in [/var/www/cakephp-1.3/lib/Cake/Utility/Folder.php, line 640]\u003c/code\u003e\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI think it has upgraded complete. Because I see the message from terminal like this:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eDone updating /var/www/cakephp-1.3/app/Console/cake.php\u003c/p\u003e\n \n \u003cp\u003eDone updating /var/www/cakephp-1.3/app/Console/Command/AppShell.php\u003c/p\u003e\n \n \u003cp\u003eRunning components\u003c/p\u003e\n \n \u003cp\u003eRunning exceptions\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eThen I refresh my app and I got some errors:\n\u003ca href=\"http://flic.kr/p/bwUpwY\" rel=\"nofollow\"\u003ehttp://flic.kr/p/bwUpwY\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThen I delete 'cake' directory, and the error message has changed:\n\u003ca href=\"http://flic.kr/p/bKP7Te\" rel=\"nofollow\"\u003ehttp://flic.kr/p/bKP7Te\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eSo now I don't know what to do next, because I did many ways but still not make it work.\nSo anybody please tell me what I did wrong and how can I upgrade cakephp successful.\nThanks in advance.\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2012-04-09 04:12:03.53 UTC","last_activity_date":"2012-12-17 11:22:15.283 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1265456","post_type_id":"1","score":"0","tags":"cakephp|cakephp-1.3|cakephp-2.0","view_count":"390"} +{"id":"31039238","title":"Not able to set value of a dictionary inside a array [Swift]","body":"\u003cp\u003eI am trying to set the value of a dictionary inside a array in swift but I get an error. \n\u003cbr\u003eIt says \u003ccode\u003eCannot pass immutable value of type '[Dictionary]' to mutating binary operator '+='\u003c/code\u003e\n\u003cbr\u003e\u003cbr\u003e\nMy code is the following:\n\u003cbr\u003e\n\u003ccode\u003e// Declare the array\n var numbersArray:[Dictionary] = [Dictionary\u0026lt;String, Any\u0026gt;]()\u003c/code\u003e\n\u003cbr\u003e\n\u003cbr\u003e... more code ...\u003cbr\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunc createArray() {\n for var iteration = 0; iteration \u0026lt; 75; iteration++ {\n //Add numbers to the array\n // May be used to set column\n var column:String\n switch iteration {\n case 0...14:\n column = \"B\"\n numbersArray += [[\"Randomized\" : false, \"Column\" : \"B\", \"Origin\" : 0]]\n case 15...29:\n column = \"I\"\n numbersArray += [[\"Randomized\" : false, \"Column\" : \"I\", \"Origin\" : 0]]\n case 30...44:\n column = \"N\"\n numbersArray += [[\"Randomized\" : false, \"Column\" : \"N\", \"Origin\" : 0]]\n case 45...59:\n column = \"G\"\n numbersArray += [[\"Randomized\" : false, \"Column\" : \"G\", \"Origin\" : 0]]\n case 60...74:\n column = \"O\"\n numbersArray += [[\"Randomized\" : false, \"Column\" : \"O\", \"Origin\" : 0]]\n default:\n column = \"Out Of Bounds\"\n numbersArray += [[\"Randomized\" : false, \"Column\" : \"Out Of Bounds\", \"Origin\" : 0]]\n }\n // numbersArray1 += [[\"Randomized\" : false, \"Column\" : String(column), \"Origin\" : 0]]\n\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny Idea? \u003cbr\u003e\n\u003cstrong\u003eNote:\u003c/strong\u003e This worked perfectly in the playground.\u003c/p\u003e","accepted_answer_id":"31039509","answer_count":"2","comment_count":"0","creation_date":"2015-06-25 00:15:01.407 UTC","favorite_count":"0","last_activity_date":"2015-06-25 00:54:28.673 UTC","last_edit_date":"2015-06-25 00:48:51.63 UTC","last_editor_display_name":"","last_editor_user_id":"2792531","owner_display_name":"","owner_user_id":"4852543","post_type_id":"1","score":"0","tags":"arrays|swift","view_count":"108"} +{"id":"21088111","title":"javascript delete a selected element in a select list","body":"\u003cp\u003eThe HTML of the select list is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"textf_rechts\"\u0026gt;\n\u0026lt;select style=\"height: 14em; width: 300px\" size=\"10\" name=\"hersteller\"\u0026gt;\n\u0026lt;option\u0026gt;1\u0026lt;/option\u0026gt;\n\u0026lt;option\u0026gt;2\u0026lt;/option\u0026gt;\n\u0026lt;option\u0026gt;3\u0026lt;/option\u0026gt;\n\u0026lt;option\u0026gt;4\u0026lt;/option\u0026gt;\n\u0026lt;option\u0026gt;5\u0026lt;/option\u0026gt;\n\u0026lt;/select\u0026gt; \u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to delete the sected element so I tried:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar select = document.getElementsByTagName('select').selectedIndex;\nselect.removeChild(select[select.selectedIndex]);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut it returns that select variable is undefined\u003c/p\u003e","accepted_answer_id":"21088172","answer_count":"2","comment_count":"0","creation_date":"2014-01-13 09:49:06.82 UTC","last_activity_date":"2014-01-13 09:58:38.453 UTC","last_editor_display_name":"","owner_display_name":"user2747249","post_type_id":"1","score":"0","tags":"javascript","view_count":"88"} +{"id":"26161830","title":"Java 8 stream filtering: IN clause","body":"\u003cpre\u003e\u003ccode\u003eList\u0026lt;Y\u0026gt; tmp= new DATA\u0026lt;Y\u0026gt;().findEntities();\nList\u0026lt;X\u0026gt; tmp1 = new DATA\u0026lt;X\u0026gt;().findEntities().stream().filter(\n IN (tmp) ???\n ).collect(Collectors.toList());\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow to simulate a tipical IN clause (like in mysql or JPA) using a Predicate ?\u003c/p\u003e","accepted_answer_id":"26162085","answer_count":"1","comment_count":"3","creation_date":"2014-10-02 13:22:02.273 UTC","last_activity_date":"2014-10-02 13:37:19.8 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3404216","post_type_id":"1","score":"2","tags":"java|lambda","view_count":"647"} +{"id":"6832862","title":"What's the best control to use to design a outlook like calendar in WPF","body":"\u003cp\u003eIn one of our project, we would like to have a calendar control that would look like Outlook calender in week mode, meaning one line per day for 7 days at a time. In this calendar we would add resources(i.e. objects) for half-hour or more and those would appear on the calendar.\u003c/p\u003e\n\n\u003cp\u003eWhat would be the best control to use in WPF to design such a control and why ? I was thinking about a simple listview with a rather elaborated item template, but I was wondering if something simplier could also be used.\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e\n\n\u003cp\u003eEdit : I forgot to mention that I will most likely implement some kind of drag and drop to drag resources into the calendar and maybe, if time allow, to move within the calendar itself. However, I don't believe this will make much of a difference in the choice of control since I believe every control can be made droppable.\u003c/p\u003e\n\n\u003cp\u003eEdit : Here is what I have so far :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;ItemsControl x:Name=\"ICPlanification\" Grid.Column=\"1\"\u0026gt;\n \u0026lt;ItemsControl.ItemsPanel\u0026gt;\n \u0026lt;ItemsPanelTemplate\u0026gt;\n \u0026lt;Grid\u0026gt;\n \u0026lt;Grid.ColumnDefinitions\u0026gt;\n \u0026lt;ColumnDefinition Width=\"*\" /\u0026gt;\n \u0026lt;ColumnDefinition Width=\"*\" /\u0026gt;\n \u0026lt;ColumnDefinition Width=\"*\" /\u0026gt;\n \u0026lt;ColumnDefinition Width=\"*\" /\u0026gt;\n \u0026lt;/Grid.ColumnDefinitions\u0026gt;\n\n \u0026lt;Grid.RowDefinitions\u0026gt;\n \u0026lt;RowDefinition Height=\"20\" /\u0026gt;\n \u0026lt;RowDefinition Height=\"20\" /\u0026gt;\n \u0026lt;RowDefinition Height=\"20\" /\u0026gt;\n \u0026lt;RowDefinition Height=\"20\" /\u0026gt;\n \u0026lt;/Grid.RowDefinitions\u0026gt;\n\n \u0026lt;/Grid\u0026gt;\n\n \u0026lt;/ItemsPanelTemplate\u0026gt;\n \u0026lt;/ItemsControl.ItemsPanel\u0026gt;\n\n \u0026lt;ItemsControl.ItemTemplate\u0026gt;\n \u0026lt;DataTemplate\u0026gt;\n \u0026lt;Border Grid.Row=\"{Binding GridRow}\" Grid.RowSpan=\"{Binding ColSpan}\" Grid.Column=\"{Binding GridCol}\" Grid.ColumnSpan=\"{Binding ColSpan}\" CornerRadius=\"0\" BorderBrush=\"White\" BorderThickness=\"1\" Background=\"{Binding ColorBackground}\" Panel.ZIndex=\"{Binding ZIndex}\"\u0026gt;\n \u0026lt;TextBlock TextWrapping=\"Wrap\" Text=\"{Binding Description}\" \u0026gt;\u0026lt;/TextBlock\u0026gt;\n \u0026lt;/Border\u0026gt;\n\n \u0026lt;/DataTemplate\u0026gt;\n \u0026lt;/ItemsControl.ItemTemplate\u0026gt;\n\n \u0026lt;/ItemsControl\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI though this would work, but all items are put into the first row and column, making me thing it's impossible to put a grid into the ItemPanal. \u003c/p\u003e\n\n\u003cp\u003eAnd before anyone ask, yes, the GridRol and GridCol variable have the right values in my list.\u003c/p\u003e\n\n\u003cp\u003eWhile looking at some forums, I found something out and it worked!\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;ItemsControl.Resources\u0026gt;\n \u0026lt;Style TargetType=\"{x:Type ContentPresenter}\"\u0026gt;\n \u0026lt;Setter Property=\"Grid.Column\" Value=\"{Binding Path=Column}\" /\u0026gt;\n \u0026lt;Setter Property=\"Grid.Row\" Value=\"{Binding Path=Row}\" /\u0026gt;\n \u0026lt;/Style\u0026gt;\n\u0026lt;/ItemsControl.Resources\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is the explanation that he gave :\u003c/p\u003e\n\n\u003cp\u003e\"The problem that everyone is running into the the Grid and the dynamic binding of Row and Column is that the ItemsControl wraps each item in a ContentPresenter so the Grid.Row and Grid.Column binding in the DataTemplate are ignored and since the Grid.Row and Grid.Column properties on the generated ContentPresenter are not set then each item is positioned ontop of each other at column 0, row 0. You can get around this by setting the below style on the ItemsControl.\"\u003c/p\u003e","accepted_answer_id":"6833340","answer_count":"2","comment_count":"0","creation_date":"2011-07-26 15:50:41.78 UTC","last_activity_date":"2011-07-26 21:03:35.367 UTC","last_edit_date":"2011-07-26 21:03:35.367 UTC","last_editor_display_name":"","last_editor_user_id":"164377","owner_display_name":"","owner_user_id":"164377","post_type_id":"1","score":"0","tags":".net|wpf|calendar","view_count":"1328"} +{"id":"26874501","title":"iCalendar: Recurring events are not correctly displayed in IOS","body":"\u003cp\u003e\u003cstrong\u003eBrief introduction\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eRecurring events in my PHP-generated iCalendar file does not recur correctly with IOS applications.\nThey do recur correctly in Outlook 2010 and Google Calendar, but not in IOS 8.1 (iPhone 5S and iPad 2).\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eDetails\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eThe following file generates a calendar file fit for subscription from applications like MS Outlook and Google Calendar. The file contains a VTIMEZONE and a single VEVENT, meant to recur every friday from 7 - 28. nov 2014, four recurrences in total.\u003c/p\u003e\n\n\u003cp\u003eiCalendar file: \u003ca href=\"http://www.elitesystemer.no/mycal_stack_example.php\" rel=\"nofollow\"\u003ehttp://www.elitesystemer.no/mycal_stack_example.php\u003c/a\u003e (full code below)\u003c/p\u003e\n\n\u003cp\u003eOn both my iDevices (IOS 8.1) this event occurs only once; 7. nov 2014. This odd behaviour goes for the native calendar app as well as the Week Calendar app (site: \u003ca href=\"http://weekcal.com\" rel=\"nofollow\"\u003ehttp://weekcal.com\u003c/a\u003e).\u003c/p\u003e\n\n\u003cp\u003eThe file works perfectly with MS Outlook 2010 and Google Calendar, but not with IOS. Unfortunately, I have not been able to find any equivalent issue at the Apple forums. Neither am I able to test with an iDevice with a former OS version, nor with another smart phone at the time.\u003c/p\u003e\n\n\u003cp\u003eI have tested the file at online iCalendar validators like \u003ca href=\"http://icalvalid.cloudapp.net/\" rel=\"nofollow\"\u003ehttp://icalvalid.cloudapp.net/\u003c/a\u003e and \u003ca href=\"http://severinghaus.org/projects/icv/\" rel=\"nofollow\"\u003ehttp://severinghaus.org/projects/icv/\u003c/a\u003e - perfect results without warnings / errors.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eCalendar code generated from PHP\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\n//set correct content-type-header\nheader('Content-type: text/calendar; charset=utf-8');\nheader('Content-Disposition: inline; filename=mycal_stack_example.ics');\n?\u0026gt;\nBEGIN:VCALENDAR\u0026lt;?echo \"\\r\\n\";?\u0026gt;\nVERSION:2.0\u0026lt;?echo \"\\r\\n\";?\u0026gt;\nMETHOD:PUBLISH\u0026lt;?echo \"\\r\\n\";?\u0026gt;\nCALSCALE:GREGORIAN\u0026lt;?echo \"\\r\\n\";?\u0026gt;\nPRODID:-//Elite Systemer//Ver 1.6//NO\u0026lt;?echo \"\\r\\n\";?\u0026gt;\nBEGIN:VTIMEZONE\u0026lt;?echo \"\\r\\n\";?\u0026gt;\nTZID:Europe/Oslo\u0026lt;?echo \"\\r\\n\";?\u0026gt;\nBEGIN:DAYLIGHT\u0026lt;?echo \"\\r\\n\";?\u0026gt;\nDTSTART:19810329T020000\u0026lt;?echo \"\\r\\n\";?\u0026gt;\nRRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU\u0026lt;?echo \"\\r\\n\";?\u0026gt;\nTZNAME:CEST\u0026lt;?echo \"\\r\\n\";?\u0026gt;\nTZOFFSETFROM:+0100\u0026lt;?echo \"\\r\\n\";?\u0026gt;\nTZOFFSETTO:+0200\u0026lt;?echo \"\\r\\n\";?\u0026gt;\nEND:DAYLIGHT\u0026lt;?echo \"\\r\\n\";?\u0026gt;\nBEGIN:STANDARD\u0026lt;?echo \"\\r\\n\";?\u0026gt;\nDTSTART:19961027T030000\u0026lt;?echo \"\\r\\n\";?\u0026gt;\nRRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU\u0026lt;?echo \"\\r\\n\";?\u0026gt;\nTZNAME:CET\u0026lt;?echo \"\\r\\n\";?\u0026gt;\nTZOFFSETFROM:+0200\u0026lt;?echo \"\\r\\n\";?\u0026gt;\nTZOFFSETTO:+0100\u0026lt;?echo \"\\r\\n\";?\u0026gt;\nEND:STANDARD\u0026lt;?echo \"\\r\\n\";?\u0026gt;\nEND:VTIMEZONE\u0026lt;?echo \"\\r\\n\";?\u0026gt;\nBEGIN:VEVENT\u0026lt;?echo \"\\r\\n\";?\u0026gt;\nUID:f8a81b8613113296503aa6fca2b61ce5@elitesystemer.no\u0026lt;?echo \"\\r\\n\";?\u0026gt;\nDTSTART;TZID=Europe/Oslo:20141107T140000\u0026lt;?echo \"\\r\\n\";?\u0026gt;\nDURATION:PT60M\u0026lt;?echo \"\\r\\n\";?\u0026gt;\nRRULE:WKST=MO;FREQ=WEEKLY;INTERVAL=1;BYDAY=FR;UNTIL=20141128T150000\u0026lt;?echo \"\\r\\n\";?\u0026gt;\nSUMMARY;LANGUAGE=no:Friday\u0026lt;?echo \"\\r\\n\";?\u0026gt;\nDESCRIPTION;LANGUAGE=no:Oppgave: Friday\\n\u0026lt;?echo \"\\r\\n\";?\u0026gt;\nLOCATION;LANGUAGE=no:Timenesveien 33\u0026lt;?echo \"\\r\\n\";?\u0026gt;\nBEGIN:VALARM\u0026lt;?echo \"\\r\\n\";?\u0026gt;\nTRIGGER:-PT15M\u0026lt;?echo \"\\r\\n\";?\u0026gt;\nACTION:DISPLAY\u0026lt;?echo \"\\r\\n\";?\u0026gt;\nDESCRIPTION:Reminder\u0026lt;?echo \"\\r\\n\";?\u0026gt;\nEND:VALARM\u0026lt;?echo \"\\r\\n\";?\u0026gt;\nEND:VEVENT\u0026lt;?echo \"\\r\\n\";?\u0026gt;\nEND:VCALENDAR\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"26885958","answer_count":"2","comment_count":"0","creation_date":"2014-11-11 21:01:38.737 UTC","last_activity_date":"2014-11-12 11:33:23.563 UTC","last_edit_date":"2014-11-12 07:35:01.35 UTC","last_editor_display_name":"","last_editor_user_id":"1167333","owner_display_name":"","owner_user_id":"2335441","post_type_id":"1","score":"0","tags":"ios|ios8|icalendar|rfc5545","view_count":"600"} +{"id":"21300008","title":"How to do unit testing for void functions CPPUNIT","body":"\u003cp\u003eI am using CPPUNIT to do unit testing for my C++ program \u003c/p\u003e\n\n\u003cp\u003eFor non-void functions , assuming the function add() exist\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eint add(int num1 , int num2)\n{\n return num1+num2;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI could do unit testing like this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evoid newtestclass::add()\n{\n int result = add(2,3);\n CPP_ASSERT(result == 5 ); \n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI encounter problem when i try to do unit testing for non-void functions\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evoid printmenu()\n{\n cout\u0026lt;\u0026lt;\"1) Option A\"\n \u0026lt;\u0026lt;endl\n \u0026lt;\u0026lt;\"2) Option B\";\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow do i do unit testing for such functions to ensure 100% code coverage\u003c/p\u003e\n\n\u003cp\u003eI also encounter problems doing unit testing for functions nested in other functions \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evoid menu_select(char x)\n{\n if ( x == 'a')\n {\n add();\n }\n else if ( x == 'b' )\n {\n subtract();\n }\n\n}\n\nvoid menu()\n{\n char choice;\n cout\u0026lt;\u0026lt;\"a) Add \"\n \u0026lt;\u0026lt;endl\n \u0026lt;\u0026lt;\"b) Subtract\";\n cin\u0026gt;\u0026gt;choice;\n\n menu_select(choice);\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow do i do unit testing for such functions to ensure 100% code coverage\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-01-23 05:22:17.437 UTC","last_activity_date":"2014-01-23 16:31:34.4 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1832057","post_type_id":"1","score":"2","tags":"c++|unit-testing|cppunit","view_count":"1867"} +{"id":"9958704","title":"Simple sound (.wav) playing application in QT (C++)","body":"\u003cp\u003eI am new to Qt and was trying to write a simple qt class that can plan a wav file.\nAfter some reading and looking around I wrote the class and the code is as below. Questions follow after code\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;QtGui/QApplication\u0026gt;\n#include \"playsound.h\"\n#include \u0026lt;iostream\u0026gt;\n\nusing namespace std;\n\nint main(int argc, char *argv[])\n{\n QApplication a(argc, argv);\n playSound w;\n int ch = 2;\n int ready = 1;\n cout\u0026lt;\u0026lt;\"ready\"\u0026lt;\u0026lt;ready\u0026lt;\u0026lt;endl;\n // w.show();\n w.playwav(ch);\n return a.exec(); \n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSource code for playsound.cpp\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \"playsound.h\"\n\nplaySound::playSound(QWidget *parent): QWidget(parent) {}\n\nplaySound::~playSound() {}\n\nvoid playSound::playwav(int ch)\n{\n\n switch (ch)\n {\n case 1: {QSound::play(\"/home/alok/qtworkspace/sounds/abc.wav\"); break;}\n case 2: {QSound::play(\"/home/alok/qtworkspace/sounds/xyz.wav\"); break;}\n case 3: {QSound::play(\"/home/alok/qtworkspace/sounds/abc.wav\"); break;}\n case 4: {QSound::play(\"/home/alok/qtworkspace/sounds/aaa.wav\"); break;}\n case 5: {QSound::play(\"/home/alok/qtworkspace/sounds/nnn.wav\"); break;}\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eProblems and questions:\u003c/p\u003e\n\n\u003cp\u003e1) I want to close the application once the sound is played.As of now it says program running and I have to forcefully close it using the red button in the \"Application Output\" area in Qt creator. I tried using close() from Qwidget and quit() from QApplication but probably I am doing it wrong. How to go abt this?\u003c/p\u003e\n\n\u003cp\u003e2) Can there be a simpler implementation for this functionality? You know something that does not involve event loops. I was trying to do it in old school C++ style where I call a function when I need to play a sound and be done with it but could not get it done. Suggestions most welcome on this one.\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2012-03-31 18:52:11.087 UTC","last_activity_date":"2012-04-02 12:51:29.297 UTC","last_edit_date":"2012-03-31 19:12:26.633 UTC","last_editor_display_name":"","last_editor_user_id":"496445","owner_display_name":"","owner_user_id":"1305377","post_type_id":"1","score":"1","tags":"c++|qt|audio|wav","view_count":"8170"} +{"id":"32603597","title":"Spring Boot Throws No plugin for the attached pom.xml","body":"\u003cp\u003eSpring Boot throws the exception - No plugin found for prefix 'springboot' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local ....\"\u003c/p\u003e\n\n\u003cp\u003eBelow is the pom.xml file for your reference.\u003c/p\u003e\n\n\u003cp\u003eCould you please let me know what is missing here?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;?xml version=\"1.0\" encoding=\"UTF-8\"?\u0026gt;\n \u0026lt;project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 \n http://maven.apache.org/xsd/maven-4.0.0.xsd\"\u0026gt;\n \u0026lt;modelVersion\u0026gt;4.0.0\u0026lt;/modelVersion\u0026gt;\n\n\u0026lt;parent\u0026gt;\n \u0026lt;groupId\u0026gt;org.springframework.boot\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;spring-boot-starter-parent\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;1.3.0.BUILD-SNAPSHOT\u0026lt;/version\u0026gt;\n\u0026lt;/parent\u0026gt;\n\n\u0026lt;groupId\u0026gt;com.mobilesystem\u0026lt;/groupId\u0026gt;\n\u0026lt;artifactId\u0026gt;mobile\u0026lt;/artifactId\u0026gt;\n\u0026lt;version\u0026gt;0.0.1-SNAPSHOT\u0026lt;/version\u0026gt;\n\u0026lt;packaging\u0026gt;war\u0026lt;/packaging\u0026gt;\n\u0026lt;name\u0026gt;mobile\u0026lt;/name\u0026gt;\n\n\u0026lt;properties\u0026gt;\n \u0026lt;org.springframework-version\u0026gt;4.1.1.RELEASE\u0026lt;/org.springframework-version\u0026gt;\n \u0026lt;hibernate.version\u0026gt;4.3.8.Final\u0026lt;/hibernate.version\u0026gt;\n \u0026lt;spring.security.version\u0026gt;3.2.3.RELEASE\u0026lt;/spring.security.version\u0026gt;\n \u0026lt;org.slf4j-version\u0026gt;1.6.1\u0026lt;/org.slf4j-version\u0026gt;\n \u0026lt;bootstrap.version\u0026gt;3.3.0\u0026lt;/bootstrap.version\u0026gt;\n \u0026lt;jquery.version\u0026gt;2.1.1\u0026lt;/jquery.version\u0026gt;\n\u0026lt;/properties\u0026gt;\n\n\u0026lt;!-- Additional lines to be added here... --\u0026gt;\n\n\u0026lt;dependencies\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;org.springframework.boot\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;spring-boot-starter-web\u0026lt;/artifactId\u0026gt;\n\u0026lt;/dependency\u0026gt;\n\u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;org.springframework\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;spring-context\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;${org.springframework-version}\u0026lt;/version\u0026gt;\n \u0026lt;/dependency\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;org.springframework\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;spring-webmvc\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;${org.springframework-version}\u0026lt;/version\u0026gt;\n \u0026lt;/dependency\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;org.springframework\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;spring-web\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;${org.springframework-version}\u0026lt;/version\u0026gt;\n \u0026lt;/dependency\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;org.springframework.security\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;spring-security-web\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;${spring.security.version}\u0026lt;/version\u0026gt;\n \u0026lt;/dependency\u0026gt;\n\u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;org.springframework.security\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;spring-security-config\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;${spring.security.version}\u0026lt;/version\u0026gt;\n \u0026lt;/dependency\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;org.springframework\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;spring-orm\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;${org.springframework-version}\u0026lt;/version\u0026gt;\n \u0026lt;/dependency\u0026gt;\n\u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;org.springframework.data\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;spring-data-jpa\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;1.7.1.RELEASE\u0026lt;/version\u0026gt;\n \u0026lt;/dependency\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;org.hibernate\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;hibernate-core\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;${hibernate.version}\u0026lt;/version\u0026gt;\n \u0026lt;/dependency\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;org.hibernate\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;hibernate-c3p0\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;${hibernate.version}\u0026lt;/version\u0026gt;\n \u0026lt;/dependency\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;org.hibernate\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;hibernate-jpamodelgen\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;${hibernate.version}\u0026lt;/version\u0026gt;\n \u0026lt;optional\u0026gt;true\u0026lt;/optional\u0026gt;\n \u0026lt;/dependency\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;net.sf.dozer\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;dozer\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;5.5.1\u0026lt;/version\u0026gt;\n \u0026lt;/dependency\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;org.hibernate\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;hibernate-entitymanager\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;${hibernate.version}\u0026lt;/version\u0026gt;\n \u0026lt;/dependency\u0026gt;\n\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;org.hibernate\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;hibernate-envers\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;${hibernate.version}\u0026lt;/version\u0026gt;\n \u0026lt;/dependency\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;com.github.dandelion\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;dandelion-core\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;0.10.1\u0026lt;/version\u0026gt;\n \u0026lt;/dependency\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;com.github.dandelion\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;datatables-spring3\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;0.10.1\u0026lt;/version\u0026gt;\n \u0026lt;/dependency\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;com.github.dandelion\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;datatables-thymeleaf\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;0.10.1\u0026lt;/version\u0026gt;\n \u0026lt;/dependency\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;org.thymeleaf\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;thymeleaf-spring4\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;2.1.4.RELEASE\u0026lt;/version\u0026gt;\n \u0026lt;/dependency\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;nz.net.ultraq.thymeleaf\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;thymeleaf-layout-dialect\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;1.2.7\u0026lt;/version\u0026gt;\n \u0026lt;/dependency\u0026gt;\n\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;org.thymeleaf.extras\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;thymeleaf-extras-springsecurity3\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;2.1.1.RELEASE\u0026lt;/version\u0026gt;\n \u0026lt;/dependency\u0026gt; \n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;org.imgscalr\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;imgscalr-lib\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;4.2\u0026lt;/version\u0026gt;\n \u0026lt;/dependency\u0026gt;\n\u0026lt;/dependencies\u0026gt;\n\n\u0026lt;build\u0026gt;\n \u0026lt;plugins\u0026gt;\n \u0026lt;plugin\u0026gt;\n \u0026lt;groupId\u0026gt;org.springframework.boot\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;spring-boot-maven-plugin\u0026lt;/artifactId\u0026gt;\n\n \u0026lt;configuration\u0026gt;\n \u0026lt;arguments\u0026gt;\n \u0026lt;jvmArguments\u0026gt;-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005\u0026lt;/jvmArguments\u0026gt;\n \u0026lt;!-- \u0026lt;argument\u0026gt;spring.profiles.active=prod\u0026lt;/argument\u0026gt; --\u0026gt;\n \u0026lt;argument\u0026gt;--spring.profiles.active=dev\u0026lt;/argument\u0026gt; \n \u0026lt;/arguments\u0026gt; \n \u0026lt;/configuration\u0026gt; \n \u0026lt;/plugin\u0026gt;\n \u0026lt;/plugins\u0026gt;\n\u0026lt;/build\u0026gt;\n\n \u0026lt;profiles\u0026gt;\n \u0026lt;profile\u0026gt;\n \u0026lt;id\u0026gt;dev\u0026lt;/id\u0026gt;\n \u0026lt;dependencies\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;org.springframework.boot\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;spring-boot-starter-tomcat\u0026lt;/artifactId\u0026gt;\n \u0026lt;/dependency\u0026gt;\n \u0026lt;/dependencies\u0026gt;\n \u0026lt;/profile\u0026gt;\n \u0026lt;profile\u0026gt;\n \u0026lt;id\u0026gt;prod\u0026lt;/id\u0026gt;\n \u0026lt;dependencies\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;org.springframework.boot\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;spring-boot-starter-tomcat\u0026lt;/artifactId\u0026gt;\n \u0026lt;/dependency\u0026gt;\n \u0026lt;/dependencies\u0026gt;\n \u0026lt;build\u0026gt;\n \u0026lt;plugins\u0026gt;\n \u0026lt;plugin\u0026gt;\n \u0026lt;groupId\u0026gt;org.springframework.boot\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;spring-boot-maven-plugin\u0026lt;/artifactId\u0026gt;\n \u0026lt;configuration\u0026gt;\n \u0026lt;arguments\u0026gt;\n \u0026lt;argument\u0026gt;--spring.profiles.active=prod\u0026lt;/argument\u0026gt;\n \u0026lt;/arguments\u0026gt;\n \u0026lt;/configuration\u0026gt;\n \u0026lt;/plugin\u0026gt;\n \u0026lt;/plugins\u0026gt;\n \u0026lt;/build\u0026gt;\n \u0026lt;/profile\u0026gt;\n\u0026lt;/profiles\u0026gt;\n\n\u0026lt;!-- (you don't need this if you are using a .RELEASE version) --\u0026gt;\n\u0026lt;repositories\u0026gt;\n \u0026lt;repository\u0026gt;\n \u0026lt;id\u0026gt;spring-snapshots\u0026lt;/id\u0026gt;\n \u0026lt;url\u0026gt;http://repo.spring.io/snapshot\u0026lt;/url\u0026gt;\n \u0026lt;snapshots\u0026gt;\u0026lt;enabled\u0026gt;true\u0026lt;/enabled\u0026gt;\u0026lt;/snapshots\u0026gt;\n \u0026lt;/repository\u0026gt; \n \u0026lt;repository\u0026gt;\n \u0026lt;id\u0026gt;spring-milestones\u0026lt;/id\u0026gt;\n \u0026lt;url\u0026gt;http://repo.spring.io/milestone\u0026lt;/url\u0026gt;\n \u0026lt;/repository\u0026gt;\n \u0026lt;!-- \u0026lt;repository\u0026gt;\n \u0026lt;id\u0026gt;spring-snapshots\u0026lt;/id\u0026gt;\n \u0026lt;url\u0026gt;http://repo.spring.io/libs-snapshot\u0026lt;/url\u0026gt;\n \u0026lt;snapshots\u0026gt;\n \u0026lt;enabled\u0026gt;true\u0026lt;/enabled\u0026gt;\n \u0026lt;/snapshots\u0026gt;\n \u0026lt;/repository\u0026gt; --\u0026gt;\n\u0026lt;/repositories\u0026gt;\n\u0026lt;pluginRepositories\u0026gt;\n \u0026lt;pluginRepository\u0026gt;\n \u0026lt;id\u0026gt;spring-snapshots\u0026lt;/id\u0026gt;\n \u0026lt;url\u0026gt;http://repo.spring.io/snapshot\u0026lt;/url\u0026gt;\n \u0026lt;/pluginRepository\u0026gt;\n \u0026lt;pluginRepository\u0026gt;\n \u0026lt;id\u0026gt;spring-milestones\u0026lt;/id\u0026gt;\n \u0026lt;url\u0026gt;http://repo.spring.io/milestone\u0026lt;/url\u0026gt;\n \u0026lt;/pluginRepository\u0026gt;\n \u0026lt;!-- \u0026lt;pluginRepository\u0026gt;\n \u0026lt;id\u0026gt;spring-snapshots\u0026lt;/id\u0026gt;\n \u0026lt;url\u0026gt;http://repo.spring.io/libs-snapshot\u0026lt;/url\u0026gt;\n \u0026lt;snapshots\u0026gt;\n \u0026lt;enabled\u0026gt;true\u0026lt;/enabled\u0026gt;\n \u0026lt;/snapshots\u0026gt;\n \u0026lt;/pluginRepository\u0026gt; --\u0026gt;\n\u0026lt;/pluginRepositories\u0026gt;\n\u0026lt;/project\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"2","creation_date":"2015-09-16 08:40:51.057 UTC","last_activity_date":"2015-09-16 08:40:51.057 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5300368","post_type_id":"1","score":"0","tags":"spring-boot","view_count":"380"} +{"id":"3224117","title":"How to P/Invoke CryptUIWizExport Function using .NET","body":"\u003cp\u003eCan anyone translate these two cryptui.dll functions/structures into C#.NET [dllimport] wrappers? I would like to P/Invoke the CryptUIWizExport function to display the Windows Certificate Export Wizard. In particular, I need to pass a .NET X509Certificate as a parameter into the CryptUIWizExport function. You help is much appreciated!!!\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://msdn.microsoft.com/en-us/library/aa380395.aspx\" rel=\"nofollow noreferrer\"\u003eCryptUIWizExport function\u003c/a\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eBOOL WINAPI CryptUIWizExport(\n __in DWORD dwFlags,\n __in HWND hwndParent,\n __in LPCWSTR pwszWizardTitle,\n __in PCCRYPTUI_WIZ_EXPORT_INFO pExportInfo,\n __in void *pvoid\n);\n\ntypedef struct _CRYPTUI_WIZ_EXPORT_INFO {\n DWORD dwSize;\n LPCWSTR pwszExportFileName;\n DWORD dwSubjectChoice;\n union {\n PCCERT_CONTEXT pCertContext;\n PCCTL_CONTEXT pCTLContext;\n PCCRL_CONTEXT pCRLContext;\n HCERTSTORE hCertStore;\n } ;\n DWORD cStores;\n HCERTSTORE *rghStores;\n} CRYPTUI_WIZ_EXPORT_INFO, *PCRYPTUI_WIZ_EXPORT_INFO;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"3230654","answer_count":"2","comment_count":"1","creation_date":"2010-07-11 18:08:48.83 UTC","favorite_count":"1","last_activity_date":"2010-07-12 17:28:00.76 UTC","last_edit_date":"2010-07-11 19:20:19.013 UTC","last_editor_display_name":"","last_editor_user_id":"76337","owner_display_name":"","owner_user_id":"388955","post_type_id":"1","score":"2","tags":"c#|.net|security|pinvoke|x509certificate","view_count":"910"} +{"id":"46829627","title":"HTTP Status 404 – Not Found for AbstractAnnotationConfigDispatcherServletInitializer","body":"\u003cp\u003eI'm trying to initialise my web application using \u003ccode\u003eAbstractAnnotationConfigDispatcherServletInitializer\u003c/code\u003e as opposed to a web.xml file. I've extended this class in my own \u003ccode\u003eMySocialNetworkWebAppInitializer\u003c/code\u003e class:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class MySocialNetworkWebAppInitializer\n extends AbstractAnnotationConfigDispatcherServletInitializer\n{\n @Override\n protected String[] getServletMappings() {\n return new String[] { \"/\" };\n }\n\n @Override\n protected Class\u0026lt;?\u0026gt;[] getRootConfigClasses() {\n return new Class\u0026lt;?\u0026gt;[] { RootConfig.class };\n }\n\n @Override\n protected Class\u0026lt;?\u0026gt;[] getServletConfigClasses() {\n return new Class\u0026lt;?\u0026gt;[] { WebConfig.class };\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI've implemented a controller \u003ccode\u003eHomeController\u003c/code\u003e to listen for requests at \"/\". When I run the application I get the following:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eHTTP Status 404 – Not Found ... The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eWhen I created the project there was a web.xml file by default, which I've removed as I want to use \u003ccode\u003eMySocialNetworkWebAppInitializer\u003c/code\u003e. What am I missing in order to run the application using this new initializer?\u003c/p\u003e\n\n\u003cp\u003eMy project set up is shown below:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/noL3C.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/noL3C.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eMy \u003ccode\u003eHomeController.java\u003c/code\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epackage com.petehallw.mysocialnetwork.web;\n\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestMethod;\n\n@Controller\npublic class HomeController {\n @RequestMapping(value = \"/\", method = RequestMethod.GET)\n public String home() {\n return \"home\";\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy \u003ccode\u003eWebConfig.java\u003c/code\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@Configuration\n@EnableWebMvc\n@ComponentScan(\"com.petehallw.mysocialnetwork.web\")\npublic class WebConfig extends WebMvcConfigurerAdapter {\n @Bean\n public ViewResolver viewResolver() {\n InternalResourceViewResolver resolver = new InternalResourceViewResolver();\n resolver.setPrefix(\"/WEB-INF/views/\");\n resolver.setSuffix(\".jsp\");\n resolver.setExposeContextBeansAsAttributes(true);\n return resolver;\n }\n\n @Override\n public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {\n configurer.enable();\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs there something wrong with my project structure? How do I make it aware of my initializer?\u003c/p\u003e\n\n\u003cp\u003eI have noticed references to 'web.xml' in my server. How do I point it to my initialiser instead?\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/EZmrz.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/EZmrz.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e","answer_count":"0","comment_count":"4","creation_date":"2017-10-19 12:15:06.697 UTC","last_activity_date":"2017-10-25 06:42:42.317 UTC","last_edit_date":"2017-10-25 06:42:42.317 UTC","last_editor_display_name":"","last_editor_user_id":"2565581","owner_display_name":"","owner_user_id":"2565581","post_type_id":"1","score":"0","tags":"spring|spring-mvc|http-status-code-404","view_count":"72"} +{"id":"42248995","title":"matplotlib quiver: how to change the origin position, or invert the y-axis orientation?","body":"\u003cp\u003eIs there a way to change the orientation of the y axis in the quiver plot by matplotlib? As the equivalent of origin='upper' in plt.imshow.\u003c/p\u003e\n\n\u003cp\u003eI could not find the equivalent in the documentation, but maybe someone knows a trick to do it!\u003c/p\u003e","accepted_answer_id":"42249336","answer_count":"1","comment_count":"0","creation_date":"2017-02-15 12:08:33.717 UTC","last_activity_date":"2017-02-15 12:24:12.337 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4247599","post_type_id":"1","score":"0","tags":"matplotlib","view_count":"96"} +{"id":"23711875","title":"Is it possible to define an unnamed trait and use it as a mixin in Scala?","body":"\u003cp\u003eI’ve implemented the cake pattern using structural types instead of wrapper traits. I am now wiring up my dependencies like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etrait GreeterDependency { def greeter = HelloGreeter }\nval printer = new Printer with GreeterDependency\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt would be nice if I could do something like this instead:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eval printer = new Printer with trait { def greeter = HelloGreeter }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, I get a syntax error. Is there a way to define an unnamed trait and use it as a mixin like this?\u003c/p\u003e\n\n\u003cp\u003e(For clarity, here is all my code: \u003ca href=\"http://ideone.com/vMDFYD\" rel=\"nofollow\"\u003ehttp://ideone.com/vMDFYD\u003c/a\u003e)\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-05-17 13:26:08.763 UTC","last_activity_date":"2014-06-05 12:34:47.707 UTC","last_edit_date":"2014-06-05 12:34:47.707 UTC","last_editor_display_name":"","last_editor_user_id":"1804599","owner_display_name":"","owner_user_id":"1804599","post_type_id":"1","score":"3","tags":"scala|mixins|traits","view_count":"76"} +{"id":"43614170","title":"How to extract members with regex","body":"\u003cp\u003eI have this string to parse and extract all elements between \u0026lt;\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eString text = \"test user #myhashtag \u0026lt;@C5712|user_name_toto\u0026gt; \u0026lt;@U433|user_hola\u0026gt;\";\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI tried with this pattern, but it doesn't work (no result):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eString pattern = \"\u0026lt;@[C,U][0-9]+\\\\|[.]+\u0026gt;\";\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo in this example I want to extract:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003ccode\u003e\u0026lt;@C5712|user_name_toto\u0026gt;\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003e\u0026lt;@U433|user_hola\u0026gt;\u003c/code\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eThen for each, I want to extract:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003ccode\u003eC\u003c/code\u003e or \u003ccode\u003eU\u003c/code\u003e element\u003c/li\u003e\n\u003cli\u003eID (ie: \u003ccode\u003e5712\u003c/code\u003e or \u003ccode\u003e433\u003c/code\u003e)\u003c/li\u003e\n\u003cli\u003euser name (ie: \u003ccode\u003euser_name_toto\u003c/code\u003e)\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eThank you very much guys\u003c/p\u003e","accepted_answer_id":"43614281","answer_count":"2","comment_count":"1","creation_date":"2017-04-25 14:54:40.583 UTC","last_activity_date":"2017-04-26 08:14:03.093 UTC","last_edit_date":"2017-04-25 15:12:14.917 UTC","last_editor_display_name":"","last_editor_user_id":"466862","owner_display_name":"","owner_user_id":"3409503","post_type_id":"1","score":"1","tags":"java|regex","view_count":"46"} +{"id":"12139691","title":"Get the Attributes filter by using its display name?","body":"\u003cp\u003eI am trying to desgin a MDX query with Date filter which is an hierarchy attribute.. Now, I need to place the attribute filter value in the \"where\" clause.. When I drag and drop the attribute say - '2012', it gets converted to someother format like '[Date].[Fiscal Hierarchy].[Year].\u0026amp;[2.012E9]' whereas in leftpane display it shows as 'YR 2012'..\u003c/p\u003e\n\n\u003cp\u003eHow do I control this conversion ? I am not sure on what basis it converts this attribute like that ?.. \u003c/p\u003e\n\n\u003cp\u003eI need to build the MDX query dynamically in program based on the user selection.. How do I determine it is '2.012E9' when the user selectes '2012'? Or is there any way to alter the filter condition in MDX so that I can acheive this without using [2.012E9] string ?\u003c/p\u003e\n\n\u003cp\u003eThanks in advance.. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e SELECT \n[Subjects].[Name] on Rows,\n\n[Student].Name ON COLUMNS \nFROM Cube \nwhere \n [Date].[Fiscal Hierarchy].[Season].\u0026amp;[**2.0121E9**]\n\n-- But the left side pane(Cube browser) shows the attribute as 'YEAR 2012'\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"12140397","answer_count":"2","comment_count":"0","creation_date":"2012-08-27 09:50:22.883 UTC","last_activity_date":"2012-09-03 14:32:30.35 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1418178","post_type_id":"1","score":"0","tags":"ssas|mdx|analysis|cubes","view_count":"965"} +{"id":"42007240","title":"Accelerometer in CoreMotion Not Working In Swift 3","body":"\u003cp\u003eMy app uses CoreMotion to allow the player to move when the device is tilted. It worked perfectly in Swift 2 but when I updated it to Swift 3 it has stopped working. I am not receiving any accelerometer updates.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eoverride func didMove(to view: SKView) {\n manager.startAccelerometerUpdates()\n manager.accelerometerUpdateInterval = 0.1\n manager.startAccelerometerUpdates(to: OperationQueue.main){ (data, Error) in\n if let accelerometerData = self.manager.accelerometerData {\n self.physicsWorld.gravity = CGVector(dx: accelerometerData.acceleration.y * 10, dy: accelerometerData.acceleration.x * 10)\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"42007473","answer_count":"1","comment_count":"1","creation_date":"2017-02-02 16:21:28.84 UTC","last_activity_date":"2017-02-04 13:06:45.307 UTC","last_edit_date":"2017-02-02 17:30:28.2 UTC","last_editor_display_name":"","last_editor_user_id":"2215126","owner_display_name":"","owner_user_id":"7506870","post_type_id":"1","score":"3","tags":"swift|swift3","view_count":"533"} +{"id":"20519417","title":"Tfs - Report on work items with history comments","body":"\u003cp\u003eI am working with Tfs2012 trying to create a tabular report (either excel or reporting services) that contains amongst other things (id,lifecycle,title,assigned to,..), the comments users manually entered in the History field.\u003c/p\u003e\n\n\u003cp\u003eI did find references on how to do this using the Tfs API but that is just too cumbersome to deploy and also would require extra coding to format a report in some form, things that are easily done using SSRS.\u003c/p\u003e\n\n\u003cp\u003eAny pointers to how this can be done?\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2013-12-11 12:41:17.82 UTC","last_activity_date":"2013-12-11 14:58:48.01 UTC","last_edit_date":"2013-12-11 13:12:41.877 UTC","last_editor_display_name":"","last_editor_user_id":"736079","owner_display_name":"","owner_user_id":"770348","post_type_id":"1","score":"1","tags":"reporting-services|tfs2012","view_count":"1403"} +{"id":"14994036","title":"Given 2 of 3 vertices that define a tetrahedron and all 3 angles between them, find 3rd vertex","body":"\u003cp\u003eSuppose one of a tetrahedron's four vertices is at the origin and the other three are at the end of vectors \u003cstrong\u003eu\u003c/strong\u003e, \u003cstrong\u003ev\u003c/strong\u003e, and \u003cstrong\u003ew\u003c/strong\u003e. If vectors \u003cstrong\u003eu\u003c/strong\u003e and \u003cstrong\u003ev\u003c/strong\u003e are known, and the angles between \u003cstrong\u003eu\u003c/strong\u003e and \u003cstrong\u003ev\u003c/strong\u003e, \u003cstrong\u003ev\u003c/strong\u003e and \u003cstrong\u003ew\u003c/strong\u003e, and \u003cstrong\u003ew\u003c/strong\u003e and \u003cstrong\u003eu\u003c/strong\u003e are also known, it seems there is a closed form solution for \u003cstrong\u003ew\u003c/strong\u003e: the intersection of the two cones formed by rotating a vector at the \u003cstrong\u003eu\u003c/strong\u003e and \u003cstrong\u003ew\u003c/strong\u003e angle about the \u003cstrong\u003eu\u003c/strong\u003e axis, and by rotating a vector at the \u003cstrong\u003ev\u003c/strong\u003e and \u003cstrong\u003ew\u003c/strong\u003e angle about the \u003cstrong\u003ev\u003c/strong\u003e axis.\u003c/p\u003e\n\n\u003cp\u003eAlthough I haven't been able to come up with a closed form solution in a couple days, I'm hoping it is due to my lack of experience with 3d geometry and that someone with more experience might have a helpful suggestion.\u003c/p\u003e","accepted_answer_id":"14994160","answer_count":"2","comment_count":"1","creation_date":"2013-02-21 03:24:09.693 UTC","last_activity_date":"2014-08-21 08:53:19.483 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"411972","post_type_id":"1","score":"1","tags":"algorithm|3d|geometry","view_count":"254"} +{"id":"39428242","title":"Foreground service gets killed on performing internet related operations","body":"\u003cp\u003e\u003cstrong\u003eUPDATE: Previously I couldn't find a well defined pattern as to when my foreground service was being killed. After more debugging with the devices (doesn't happen on all) on which this was happening I found.\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003e1.) A lot of times when I open chrome to load a website the foreground service gets killed. Sometimes even when I am using whatsapp this happens.\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003e2.) There are no exceptions and the stacktrace doesn't show anything useful.\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eOriginal Question below:\u003c/p\u003e\n\n\u003cp\u003eThere are many such questions on StackOverflow but the answers so far that I have read mostly say that it is upto Android and we don't have 100% guarantee that a foreground service will not be killed. Some answers suggest START_STICKY but that is not much helpful in my case.\u003c/p\u003e\n\n\u003cp\u003eIn my case I have a music player app which has a foreground service. This service gets killed on certain devices, mostly some versions of Xiomi (Android version was 5.1.1). \u003cstrong\u003eNow I understand that android might be short on memory and so my foreground service is being killed, but then why do other music player apps never go through such termination. What is it that they are doing right that I am not?\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI made my service foreground service by using \u003ccode\u003estartForeground\u003c/code\u003e. Also I return \u003ccode\u003eSTART_STICKY\u003c/code\u003e in onStartCommand although that doesn't help because the service is restarted after a period of 4-5 sec if killed. To bind my service with my activity I use\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ebindService(playIntent, musicConnection, Context.BIND_AUTO_CREATE | Context.BIND_IMPORTANT );\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo what exactly can I improve/change in my app to prevent this from happening, if other apps are working right there must be something that is wrong in my case. Can someone please help. Thanks in advance !!\u003c/p\u003e\n\n\u003cp\u003eEdit:\u003c/p\u003e\n\n\u003cp\u003eThis is how I call startForeground()\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic void sendNotification() {\n\n Intent notIntent = new Intent(this, MainActivity.class);\n notIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n PendingIntent pendInt = PendingIntent.getActivity(this, 0,\n notIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n Bitmap bitmap = null;\n if (!notificationShowing || !forwarded) {\n Log.i(TAG, \"present\");\n String title = CommonUtils.getSongFromID(songIndex, this);\n\n bigView.setTextViewText(R.id.title, title);\n bigView.setImageViewBitmap(R.id.img, bitmap);\n\n smallView.setTextViewText(R.id.title1, title);\n smallView.setImageViewBitmap(R.id.img1, bitmap);\n\n if (pauseButton == 1) {\n bigView.setImageViewResource(R.id.pause, R.drawable.pause_noti);\n smallView.setImageViewResource(R.id.pause1, R.drawable.pause_noti);\n } else {\n bigView.setImageViewResource(R.id.pause, R.drawable.play_noti);\n smallView.setImageViewResource(R.id.pause1, R.drawable.play_noti);\n }\n\n musicNotification = builder.setContentIntent(pendInt)\n .setSmallIcon(R.drawable.logo1)\n .setTicker(songTitle)\n .setOngoing(true)\n .setContentTitle(\"Playing\")\n .setStyle(new Notification.BigTextStyle().bigText(\"Song App\"))\n .setContentText(songTitle)\n .setPriority(Notification.PRIORITY_MAX)\n .build();\n\n musicNotification.contentView = smallView;\n musicNotification.bigContentView = bigView;\n\n musicNotification.contentIntent = pendInt;\n\n Intent switchIntent = new Intent(\"pause\");\n switchIntent.putExtra(\"button\", \"pause\");\n PendingIntent pendingSwitchIntent = PendingIntent.getBroadcast(this, 100, switchIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n bigView.setOnClickPendingIntent(R.id.pause, pendingSwitchIntent);\n smallView.setOnClickPendingIntent(R.id.pause1, pendingSwitchIntent);\n\n Intent switchIntent1 = new Intent(\"forward\");\n switchIntent1.putExtra(\"button\", \"forward\");\n PendingIntent pendingSwitchIntent2 = PendingIntent.getBroadcast(this, 100, switchIntent1, PendingIntent.FLAG_UPDATE_CURRENT);\n bigView.setOnClickPendingIntent(R.id.forward, pendingSwitchIntent2);\n smallView.setOnClickPendingIntent(R.id.forward1, pendingSwitchIntent2);\n\n Intent switchIntent2 = new Intent(\"previous\");\n switchIntent2.putExtra(\"button\", \"previous\");\n PendingIntent pendingSwitchIntent3 = PendingIntent.getBroadcast(this, 100, switchIntent2, PendingIntent.FLAG_UPDATE_CURRENT);\n bigView.setOnClickPendingIntent(R.id.previous, pendingSwitchIntent3);\n smallView.setOnClickPendingIntent(R.id.previous1, pendingSwitchIntent3);\n\n Intent switchIntent3 = new Intent(\"end\");\n switchIntent3.putExtra(\"button\", \"end\");\n PendingIntent pendingSwitchIntent4 = PendingIntent.getBroadcast(this, 100, switchIntent3, PendingIntent.FLAG_UPDATE_CURRENT);\n bigView.setOnClickPendingIntent(R.id.end, pendingSwitchIntent4);\n smallView.setOnClickPendingIntent(R.id.end1, pendingSwitchIntent4);\n\n startForeground(NOTIFY_ID, musicNotification);\n notificationShowing = true;\n }\n forwarded = false;\n\n }\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"16","creation_date":"2016-09-10 16:35:42.54 UTC","favorite_count":"2","last_activity_date":"2016-09-19 14:22:22.677 UTC","last_edit_date":"2016-09-15 10:57:21.047 UTC","last_editor_display_name":"","last_editor_user_id":"3825975","owner_display_name":"","owner_user_id":"3825975","post_type_id":"1","score":"9","tags":"android|android-service","view_count":"1052"} +{"id":"22080305","title":"Is resharper right about this code being unreachable?","body":"\u003cp\u003eReshaper said the left hand side of \u003ccode\u003e??\u003c/code\u003e was never null even though its type is \u003ccode\u003eint?\u003c/code\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e _savedMediaFileId = mediaFile.MediaFileId ?? _savedMediaFileId;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe auto refactor \"remove unreachable code\" turned it into this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e _savedMediaFileId = (int) mediaFile.MediaFileId;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs that right or is Resharper making a mistake here? \u003c/p\u003e\n\n\u003cp\u003eMy idea was that since int? is nullable, then then I could use ?? to keep the existing value in the case it is null.\u003c/p\u003e\n\n\u003cp\u003eHere's my unit test (in progress)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[TestClass]\npublic class MediaRepositoryTest\n{\n private const string SiteId = \"3\";\n\n private const string ConnectionString =\n @\"Data Source=dvmind\\mssqlsites;Database=***********;User Name=sa;Password=**************\";\n\n private string _mediaSourceName = \"TestMediaSourceName\";\n private string _mediaTypeName = \"TestMediaTypeName\";\n private string _mediaSourceAddress = \"TestMediaSourceAddress\";\n private string _mediaFileAddress = \"TestMediaFileAddress\";\n\n private int _savedMediaFileId = 0;\n\n private string GetGuidString()\n {\n return Convert.ToBase64String(Guid.NewGuid().ToByteArray());\n }\n\n [TestInitialize]\n public void TestInitialize()\n {\n _mediaSourceName = _mediaSourceName + GetGuidString();\n _mediaTypeName = _mediaTypeName + GetGuidString();\n _mediaSourceAddress = _mediaSourceAddress + GetGuidString();\n _mediaFileAddress = _mediaFileAddress + GetGuidString();\n }\n\n [TestCleanup]\n public void TestCleanup()\n {\n using (var db = new SiteContext(ConnectionString))\n {\n if (_savedMediaFileId != 0)\n {\n (from c in db.MediaFiles where c.MediaFileId == _savedMediaFileId select c).ToList()\n .ForEach(c =\u0026gt; db.MediaFiles.Remove(c));\n }\n\n (from c in db.MediaSources where c.MediaSourceName == _mediaSourceName select c).ToList()\n .ForEach(c =\u0026gt; db.MediaSources.Remove(c));\n\n (from c in db.MediaTypes where c.MediaTypeName == _mediaTypeName select c).ToList()\n .ForEach(c =\u0026gt; db.MediaTypes.Remove(c));\n }\n }\n\n [TestMethod]\n public void SaveMediaTest()\n {\n var mediaSource = new MediaSource\n {\n MediaSourceName = _mediaSourceName,\n MediaSourceAddress = _mediaSourceAddress\n };\n\n var mediaType = new MediaType\n {\n MediaTypeName = _mediaTypeName\n };\n\n var mediaFile = new MediaFile\n {\n SiteId = SiteId,\n MediaFileAddress = _mediaFileAddress,\n MediaSource = mediaSource,\n MediaType = mediaType\n };\n\n var connectionStringProvider =\n Mock.Of\u0026lt;IConnectionStringProvider\u0026gt;(c =\u0026gt; c.GetConnectionString() == ConnectionString);\n\n var repository = new MediaRepository(connectionStringProvider);\n\n Assert.IsTrue(mediaFile.MediaFileId == 0);\n\n repository.SaveMedia(mediaFile);\n\n Assert.IsTrue(mediaFile.MediaFileId != 0);\n\n _savedMediaFileId = mediaFile.MediaFileId ?? _savedMediaFileId;\n\n //using (var db = new SiteContext(ConnectionString))\n //{ \n //}\n }\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"3","comment_count":"7","creation_date":"2014-02-27 21:02:46.523 UTC","last_activity_date":"2014-02-27 21:44:21.053 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"398546","post_type_id":"1","score":"0","tags":"c#|resharper|nullable","view_count":"889"} +{"id":"29391010","title":"Select result from multi tables with joins","body":"\u003cp\u003eI have this query. I want to select the \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003esurgery Type\u003cbr\u003e\n surgery Details\u003cbr\u003e\n Modality ID\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eAm I on the right path atleast?\u003c/p\u003e\n\n\u003cp\u003eThe \u003ccode\u003eLINK\u003c/code\u003e table is the middle of everything\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e\u003ccode\u003eAddmission\u003c/code\u003e 1toM on \u003ccode\u003eLINK\u003c/code\u003e\u003cbr\u003e\n \u003ccode\u003eSurgery\u003c/code\u003e Mto1 on \u003ccode\u003eLINK\u003c/code\u003e\u003cbr\u003e\n \u003ccode\u003eModality\u003c/code\u003e Mto1 on \u003ccode\u003eLINK\u003c/code\u003e\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eMy problem is just add in \u003ccode\u003eModality.ID\u003c/code\u003e to the result.\u003cbr\u003e\nskip modality, and the query works 100%\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eupdated\u003c/strong\u003e (dropped multi alias) \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT surg.srg_Details, surg.Type, modd.ID\nFROM Surgery surg\nJOIN LINK lnk on lnk.lnk_ID = surg.srg_lnkID\nJOIN Modality modd ON modd.mod_lnkID = lnk.lnk_ID\nJOIN Admission adm ON adm.adm_ID = lnk.lnk_admID\nWHERE adm.adm_ID = 192100042\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"29391108","answer_count":"2","comment_count":"5","creation_date":"2015-04-01 12:36:02.283 UTC","last_activity_date":"2015-04-01 13:23:36.943 UTC","last_edit_date":"2015-04-01 13:23:36.943 UTC","last_editor_display_name":"","last_editor_user_id":"1007019","owner_display_name":"","owner_user_id":"2240163","post_type_id":"1","score":"1","tags":"sql|4d-database","view_count":"65"} +{"id":"41239674","title":"how to fix: \"out of line definition of 'graph' does not match any declaration in 'graph'\"","body":"\u003cpre\u003e\u003ccode\u003e#include \u0026lt;iostream\u0026gt;\n\nusing namespace std;\n\ntypedef int vertex;\n\nenum vertexstate { white, gray, black };\n\nclass graph\n{\nprivate: \n bool**adjacencymatrix;\n int vertexcount;\npublic: \n graph(int vertexcount);\n ~graph();\n\n void addedge(int i, int j);\n void removeedge(int i, int j);\n bool isedge(int i, int j);\n\n void display();\n void Dfs();\n void runDfs(int u, vertexstate state[]);\n};\n\ngraph::graph(char filename[], int vertexcount) //error is here\n{\n this-\u0026gt;vertexcount = vertexcount;\n adjacencymatrix = new bool*[vertexcount];\n\n for (int i = 0; i\u0026lt;vertexcount; i++)\n {\n adjacencymatrix[i] = new bool[vertexcount];\n for (int j = 0; j\u0026lt;vertexcount; j++)\n adjacencymatrix[i][j] = false;\n }\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"1","creation_date":"2016-12-20 10:06:39.153 UTC","last_activity_date":"2016-12-20 10:58:02.683 UTC","last_edit_date":"2016-12-20 10:53:36.273 UTC","last_editor_display_name":"","last_editor_user_id":"4181011","owner_display_name":"","owner_user_id":"6354900","post_type_id":"1","score":"-4","tags":"c++|xcode|class|declaration","view_count":"436"} +{"id":"8123536","title":"Programmatically Filter Excel Data Using Java","body":"\u003cp\u003eI am working on a web application, where the user uploads a Excel file with a lot of data, the sheet in workbook is like a table in a DB, where each column corresponds to a data column, based on some input from the user in the UI I need to filter the data obtained form the excel.\u003c/p\u003e\n\n\u003cp\u003eHow can i do this? \u003c/p\u003e\n\n\u003cp\u003eI looked up on 'Reading Excel as Datasource using JDBC', but i am unable to setup an ODBC driver that points to the Excel spreadsheet using the code shown\n\u003ca href=\"http://www.java2s.com/Tutorial/Java/0340__Database/UseJDBCODBCbridgetoreadfromExcel.htm\" rel=\"nofollow\"\u003ehere\u003c/a\u003e. can someone please guide me? \u003c/p\u003e\n\n\u003cp\u003eThanks in advance\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2011-11-14 15:05:17.08 UTC","last_activity_date":"2013-05-29 21:15:16.873 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"833111","post_type_id":"1","score":"0","tags":"java|excel|jdbc","view_count":"1946"} +{"id":"18942306","title":"PHP Make Directory with Leading ZERO's","body":"\u003cp\u003eCurrently, This is the code I have in place to make a directory in my \"members\" folder dynamically every-time a user registers on my site.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e $directory = \"../members/\".$id;\n mkdir($directory, 0755);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe above code works fine but it doesn't name the folder with \"0\".\nExample:\u003c/p\u003e\n\n\u003cp\u003eWhen the folder is created in the members directory, It is named 15\" in fact is should be named \"000000000015\".\u003c/p\u003e\n\n\u003cp\u003eGuys any idea how to achieve this in php.\u003c/p\u003e","accepted_answer_id":"18942364","answer_count":"1","comment_count":"0","creation_date":"2013-09-22 09:29:06.343 UTC","last_activity_date":"2013-09-22 09:34:22.173 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1772571","post_type_id":"1","score":"0","tags":"mkdir","view_count":"71"} +{"id":"5816925","title":"JavaScript SubClass and SuperClass","body":"\u003cp\u003eI'm been working in javascript on use of SubClass and SuperClass, but i cant make this work. I've been looking to a lot of examples, but nothing work so far.\u003c/p\u003e\n\n\u003cp\u003eThe basic code i need is this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e// SubClass\nList1 = function(htmlId) \n{\n var _htmlId = htmlId;\n console.log('LIST1');\n this.init();\n\n};\n\nList1.prototype.init = function()\n{\n console.log('LIST1: init');\n this.load();\n}\n\nList1.prototype.render = function(dados)\n{\n console.log('LIST1: render');\n alert('HTML ID: ' + this._htmlId);\n alert('HTML ID: ' + this.dados);\n}\n\n// SuperClass\nComponent1 = function() \n{\n console.log('COMPONENT1');\n};\n\nComponent1.prototype.load = function()\n{\n console.log('COMPONENT1: load');\n alert('LOAD: ' + this._htmlId);\n this.render('data');\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm not very expert in JavaScript, but someone told me to make the classes in JavaScrip this way.\u003c/p\u003e\n\n\u003cp\u003eI'm trying to extend the List1 to use the SuperClass Component but i cant get this work:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eList1.prototype = new Component1();\nList1.constructor = List1;\n\nvar component = new List1(componentHtmlId);\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"3","creation_date":"2011-04-28 10:07:13.317 UTC","last_activity_date":"2011-04-28 10:07:13.317 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"641611","post_type_id":"1","score":"0","tags":"javascript|inheritance|subclass|superclass","view_count":"391"} +{"id":"35553780","title":"Why am I getting a \"Value of optional type UIFont not unwrapped\", but unwrapping gives \"unexpectedly found nil while unwrapping an optional\"?","body":"\u003cpre\u003e\u003ccode\u003efunc initializePickerViewProperties() {\n let font = UIFont (name: \"SanFranciscoDisplay-Regular\", size: 30.0)\n let highlightedFont = UIFont (name: \"SanFranciscoDisplay-Bold\", size: 35.0)\n pickerView.font = font!\n pickerView.highlightedFont = highlightedFont!\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003efairly simple, the pickerView in question is an \u003ca href=\"https://github.com/Akkyie/AKPickerView-Swift\" rel=\"nofollow\"\u003eAKPickerView\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eIf I remove the forced unwrapping I get a compiler error. \"Value of optional type UIFont not unwrapped, did you mean to use \"!\" or \"?\"?\"\u003c/p\u003e\n\n\u003cp\u003eHowever, when I force unwrap it, I get a runtime error. \"fatal error: unexpectedly found nil while unwrapping an Optional value\"\u003c/p\u003e","accepted_answer_id":"35553851","answer_count":"2","comment_count":"1","creation_date":"2016-02-22 12:32:09.327 UTC","last_activity_date":"2016-02-22 12:51:24.647 UTC","last_edit_date":"2016-02-22 12:51:24.647 UTC","last_editor_display_name":"","last_editor_user_id":"2227743","owner_display_name":"","owner_user_id":"1652166","post_type_id":"1","score":"1","tags":"ios|swift|optional|uifont|forced-unwrapping","view_count":"707"} +{"id":"29773320","title":"Should I weakify self every time using block","body":"\u003cp\u003eWill this block cause a memory leak issue, because I am not using weakified sell:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[KNApi getCouponsWithSearchString:self.searchString withCouponsCount:self.coupons.count withSuccess:^(id object) {\n\n [self.coupons addObjectsFromArray:object[@\"items\"]];\n\n [self.hud hide:YES];\n [self.theTableView setHidden:NO];\n [self.theTableView reloadData];\n\n} withFailure:^(id object) {\n [self hideLoadingIndicatorWithError:object];\n}];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI know for example if we have \u003ccode\u003e[KNApi getCouponsWithSearchString...\u003c/code\u003e as a block property in self class, then it causes an issue.\u003c/p\u003e\n\n\u003cp\u003eSo suppose that our stack will be destroyed and I will get a success invocation before that. Will it cause an issue with requesting itself?\u003c/p\u003e","accepted_answer_id":"29780343","answer_count":"2","comment_count":"2","creation_date":"2015-04-21 13:16:05.787 UTC","favorite_count":"0","last_activity_date":"2015-04-21 19:59:31.61 UTC","last_edit_date":"2015-04-21 14:09:03.71 UTC","last_editor_display_name":"","last_editor_user_id":"4185106","owner_display_name":"","owner_user_id":"587415","post_type_id":"1","score":"1","tags":"ios|ios7|ios5|objective-c-blocks","view_count":"657"} +{"id":"38028910","title":"gif spinner doesn't appear when submitting form using ajax","body":"\u003cp\u003eI am trying to add a loading gif to my form when the user clicks the submit button using ajax and I want to also disable the submit button. I have tried it this way but it doesn't work. My button does have an ID of 'submit'\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;script type=\"text/javascript\"\u0026gt; \n// we will add our javascript code here\njQuery(document).ready(function($) {\n\n $(\"#ajax-contact-form\").submit(function() {\n var str = $(this).serialize();\n\n $.ajax({\n type: \"POST\",\n url: \"contactfinal.php\",\n data: str,\n success: function(response) {\n $('submit').html('\u0026lt;img src=\"img/ajax-loader.gif\" /\u0026gt; \u0026amp;nbsp; sending...').attr('disabled', 'disabled');\n $('#error').html(response);\n\n }\n });\n return false;\n });\n});\n\u0026lt;/script\u0026gt; \n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"1","creation_date":"2016-06-25 13:15:10.32 UTC","last_activity_date":"2016-06-25 18:30:54.7 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3892314","post_type_id":"1","score":"0","tags":"jquery|ajax","view_count":"131"} +{"id":"41515828","title":"Mysql multiple LIKE with \"AND\"","body":"\u003cp\u003eI have problems about \u003ccode\u003eLIKE\u003c/code\u003e operator. I create query whose is searching with like something for example, I search Street 34:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eWHERE address LIKE '%Street%' AND address LIKE '%34%' \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eProblem is that if I'm writing too long address MySQL query slows freaking down. Is there possible any faster solution? I know there is operators \u003ccode\u003eREGEXP\u003c/code\u003e or \u003ccode\u003eIN\u003c/code\u003e but they search using \u003ccode\u003eOR\u003c/code\u003e but I need search BY \u003ccode\u003eAND\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eps: Why I'm writing multiple \u003ccode\u003eLIKE\u003c/code\u003e? Its because Some may message not \"Street 34\" but \"34 Street\".\u003c/p\u003e","answer_count":"2","comment_count":"8","creation_date":"2017-01-06 23:09:03.953 UTC","last_activity_date":"2017-01-07 00:48:05.007 UTC","last_edit_date":"2017-01-07 00:48:05.007 UTC","last_editor_display_name":"user5915243","owner_display_name":"","owner_user_id":"2708538","post_type_id":"1","score":"0","tags":"php|mysql","view_count":"71"} +{"id":"29728086","title":"Tidy data: create row for each individual, based on 'count' variable","body":"\u003cp\u003eI have a dataframe which is formatted very much like an example dataframe \u003cstrong\u003edf1\u003c/strong\u003e given below. There are three columns: two categorical variables and a 'Count' column specifying the amount of objects with that specific combination. \u003c/p\u003e\n\n\u003cp\u003eI want to move this data frame towards the format shown in example dataframe \u003cstrong\u003edf2\u003c/strong\u003e. Instead of a 'Count' column, each object is simply given on a seperate line. \u003c/p\u003e\n\n\u003cp\u003eI have tried things with the \u003cstrong\u003edplyr\u003c/strong\u003e and \u003cstrong\u003etidyr\u003c/strong\u003e packages but I am not yet very well-versed in \u003cstrong\u003eR\u003c/strong\u003e. What would be a good way to perform the function I want?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eset.seed(1)\nx1 \u0026lt;- c(\"Pants\", \"Shoes\", \"Scarf\")\nx2 \u0026lt;- c(\"Ugly\", \"Beautiful\")\nx3 \u0026lt;- sample(1:10, size=6, replace=T)\n\ndf1 \u0026lt;- data.frame(Object=rep(x1, 2),\n Quality=rep(x2, each=3),\n Count=x3);\ndf1; sum(df1[,3])\n\ndf2 \u0026lt;- data.frame(Object=c(rep(\"Pants\", 3), rep(\"Shoes\", 4), rep(\"Scarf\", 6), \n rep(\"Pants\", 10), rep(\"Shoes\", 3), rep(\"Scarf\", 9)),\n Quality=c(rep(\"Ugly\", 3), rep(\"Ugly\", 4), rep(\"Ugly\", 6), \n rep(\"Beautiful\", 10), rep(\"Beautiful\", 3), \n rep(\"Beautiful\", 9))\n )\nhead(df2); tail(df2)\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"29728117","answer_count":"1","comment_count":"3","creation_date":"2015-04-19 09:29:40.363 UTC","favorite_count":"1","last_activity_date":"2015-04-19 09:35:25.727 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4806459","post_type_id":"1","score":"2","tags":"r|count|dplyr|tidyr","view_count":"117"} +{"id":"25144957","title":"ASP.Net MVC - MapRoute - RegEx","body":"\u003cp\u003eI would like to use a RegEx to create a new route in ASP.Net MVC 4.\nI want to redirect to a specific controller and action when the url contains one letter between slashes and a word: \u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://www.myurl.com/a/something/anotherthing/?mykeyword=\" rel=\"nofollow\"\u003ehttp://www.myurl.com/a/something/anotherthing/?mykeyword=\u003c/a\u003e.....\u003c/p\u003e\n\n\u003cp\u003eMy current route is: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eroutes.MapRoute(\n \"MyRoute\",\n \"{*something}\",\n new { controller = \"mycontroller\", action = \"myaction\" },\n new { theregex = @\".*/a/.*?mykeyword=.*\" });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut I never go into mycontroller/myaction. I'm always redirect to the default route.\u003c/p\u003e\n\n\u003cp\u003eCan someone tell me what is wrong in the regex?\u003c/p\u003e\n\n\u003cp\u003eThank you!\u003c/p\u003e","answer_count":"1","comment_count":"4","creation_date":"2014-08-05 17:35:10.863 UTC","last_activity_date":"2014-08-05 18:52:58.023 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"645582","post_type_id":"1","score":"0","tags":"regex|asp.net-mvc|asp.net-mvc-4","view_count":"883"} +{"id":"14880015","title":"android word translator app basic functionality code error","body":"\u003cp\u003eat the moment I cannot fin out what is wrong. I keep getting the same error message for the following code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epackage com.example.test1;\n\nimport android.app.Activity;\nimport android.os.Bundle;\nimport android.view.View;\nimport android.widget.Button;\nimport android.widget.EditText;\nimport android.widget.Toast;\nimport android.util.Log;\nimport com.memetix.mst.language.Language;\nimport com.memetix.mst.translate.Translate;\n\npublic class MainActivity extends Activity {\n private EditText text;\n private EditText text1;\n //private String translatedText;\n\n\n @Override\n public void onCreate(Bundle savedInstanceState) {\nsuper.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n Translate.setClientId(\"myId\");\nTranslate.setClientSecret(\"mySecret\");\n text = (EditText) findViewById(R.id.editText1);\n text1 = (EditText) findViewById(R.id.editText2);\n\n Button Trans1 = (Button)findViewById(R.id.button1);\n Trans1.setOnClickListener(new View.OnClickListener(){\n public void onClick(View view) {\n String word = text.getText().toString();\n try {\n String translatedText = Translate.execute(word, Language.ENGLISH, Language.GERMAN);\n text1.setText(translatedText);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n });\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eerror:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e02-14 16:36:26.355: W/System.err(1146): java.lang.Exception: [microsoft-translator-api] Error retrieving translation : null\n02-14 16:36:26.361: W/System.err(1146): at com.memetix.mst.MicrosoftTranslatorAPI.retrieveString(MicrosoftTranslatorAPI.java:202)\n02-14 16:36:26.361: W/System.err(1146): at com.memetix.mst.translate.Translate.execute(Translate.java:61)\n02-14 16:36:26.361: W/System.err(1146): at com.example.test1.MainActivity$1.onClick(MainActivity.java:35)\n02-14 16:36:26.361: W/System.err(1146): at android.view.View.performClick(View.java:4202)\n02-14 16:36:26.361: W/System.err(1146): at android.view.View$PerformClick.run(View.java:17340)\n02-14 16:36:26.361: W/System.err(1146): at android.os.Handler.handleCallback(Handler.java:725)\n02-14 16:36:26.361: W/System.err(1146): at android.os.Handler.dispatchMessage(Handler.java:92)\n02-14 16:36:26.361: W/System.err(1146): at android.os.Looper.loop(Looper.java:137)\n02-14 16:36:26.361: W/System.err(1146): at android.app.ActivityThread.main(ActivityThread.java:5039)\n02-14 16:36:26.372: W/System.err(1146): at java.lang.reflect.Method.invokeNative(Native Method)\n02-14 16:36:26.372: W/System.err(1146): at java.lang.reflect.Method.invoke(Method.java:511)\n02-14 16:36:26.372: W/System.err(1146): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)\n02-14 16:36:26.372: W/System.err(1146): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)\n02-14 16:36:26.372: W/System.err(1146): at dalvik.system.NativeStart.main(Native Method)\n02-14 16:36:26.372: W/System.err(1146): Caused by: android.os.NetworkOnMainThreadException\n02-14 16:36:26.381: W/System.err(1146): at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1117)\n02-14 16:36:26.381: W/System.err(1146): at java.net.InetAddress.lookupHostByName(InetAddress.java:385)\n02-14 16:36:26.381: W/System.err(1146): at java.net.InetAddress.getAllByNameImpl(InetAddress.java:236)\n02-14 16:36:26.381: W/System.err(1146): at java.net.InetAddress.getAllByName(InetAddress.java:214)\n02-14 16:36:26.381: W/System.err(1146): at libcore.net.http.HttpConnection.\u0026lt;init\u0026gt;(HttpConnection.java:70)\n02-14 16:36:26.381: W/System.err(1146): at libcore.net.http.HttpConnection.\u0026lt;init\u0026gt;(HttpConnection.java:50)\n02-14 16:36:26.381: W/System.err(1146): at libcore.net.http.HttpConnection$Address.connect(HttpConnection.java:340)\n02-14 16:36:26.391: W/System.err(1146): at libcore.net.http.HttpConnectionPool.get(HttpConnectionPool.java:87)\n02-14 16:36:26.391: W/System.err(1146): at libcore.net.http.HttpConnection.connect(HttpConnection.java:128)\n02-14 16:36:26.391: W/System.err(1146): at libcore.net.http.HttpEngine.openSocketConnection(HttpEngine.java:316)\n02-14 16:36:26.391: W/System.err(1146): at libcore.net.http.HttpsURLConnectionImpl$HttpsEngine.makeSslConnection(HttpsURLConnectionImpl.java:461)\n02-14 16:36:26.391: W/System.err(1146): at libcore.net.http.HttpsURLConnectionImpl$HttpsEngine.connect(HttpsURLConnectionImpl.java:433)\n02-14 16:36:26.391: W/System.err(1146): at libcore.net.http.HttpEngine.sendSocketRequest(HttpEngine.java:290)\n02-14 16:36:26.391: W/System.err(1146): at libcore.net.http.HttpEngine.sendRequest(HttpEngine.java:240)\n02-14 16:36:26.391: W/System.err(1146): at libcore.net.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:81)\n02-14 16:36:26.391: W/System.err(1146): at libcore.net.http.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:197)\n02-14 16:36:26.391: W/System.err(1146): at libcore.net.http.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:281)\n02-14 16:36:26.401: W/System.err(1146): at com.memetix.mst.MicrosoftTranslatorAPI.getToken(MicrosoftTranslatorAPI.java:133)\n02-14 16:36:26.401: W/System.err(1146): at com.memetix.mst.MicrosoftTranslatorAPI.retrieveResponse(MicrosoftTranslatorAPI.java:160)\n02-14 16:36:26.401: W/System.err(1146): at com.memetix.mst.MicrosoftTranslatorAPI.retrieveString(MicrosoftTranslatorAPI.java:199)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eor alternatively i have tried it another way:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epackage com.example.test1;\n\nimport android.app.Activity;\nimport android.os.Bundle;\nimport android.view.View;\nimport android.widget.Button;\nimport android.widget.EditText;\nimport android.widget.Toast;\nimport android.util.Log;\nimport com.memetix.mst.language.Language;\nimport com.memetix.mst.translate.Translate;\n\npublic class MainActivity extends Activity {\n private EditText text;\n private EditText text1;\n //private String translatedText;\n\n\n @Override\n public void onCreate(Bundle savedInstanceState) {\nsuper.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n Translate.setClientId(\"myId\");\nTranslate.setClientSecret(\"mySecret\");\n text = (EditText) findViewById(R.id.editText1);\n text1 = (EditText) findViewById(R.id.editText2);\n }\n\n public void onClick(View view) {\n switch (view.getId()) {\n case R.id.button1:\n if (text.getText().length() == 0) {\n Toast.makeText(this, \"Please enter a word or phrase to translate...\",\n Toast.LENGTH_LONG).show();\n return;\n }\n else {\n String word = text.getText().toString();\n try {\n String translatedText = Translate.execute(word, Language.ENGLISH, Language.GERMAN);\n text1.setText(translatedText);\n } catch (Exception e) {\n Toast.makeText(this, \"flop...\",\n Toast.LENGTH_LONG).show();\n e.printStackTrace();\n }\n }\n }\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewith this one it always catches and exception.\u003c/p\u003e\n\n\u003cp\u003enone of them return a reult.\u003c/p\u003e\n\n\u003cp\u003emain problem (exception caught): \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e02-14 16:50:17.281: W/System.err(1249): java.lang.Exception: [microsoft-translator-api] Error retrieving translation : null\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"14880048","answer_count":"1","comment_count":"1","creation_date":"2013-02-14 16:55:35.417 UTC","favorite_count":"1","last_activity_date":"2014-03-21 14:05:12.243 UTC","last_edit_date":"2014-03-21 13:59:26.503 UTC","last_editor_display_name":"","last_editor_user_id":"578411","owner_display_name":"","owner_user_id":"2057343","post_type_id":"1","score":"0","tags":"android|translate","view_count":"1994"} +{"id":"17695778","title":"response data to $_SESSION?","body":"\u003cp\u003eI am pushing some data in to my javascript array every 30 seconds.This data comes comes via ajax response.I want to use this array on the next page I visit without its content being lost.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esetInterval(function () {\n $.ajax({\n url: \"../controller/controller_session.php\",\n type: 'POST',\n data: {data to send},\n dataType: \"json\",\n success: function(data) {\n\n ARRAY.push(JSON.stringify(data))\n },30000)\n } \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow do I transport this data using $_SESSION to some other page on website and how do I retrieve it back and reuse it my javascript.\u003c/p\u003e","accepted_answer_id":"17695831","answer_count":"2","comment_count":"2","creation_date":"2013-07-17 09:13:54.75 UTC","last_activity_date":"2013-07-17 09:26:27.053 UTC","last_edit_date":"2013-07-17 09:16:01.357 UTC","last_editor_display_name":"","last_editor_user_id":"159319","owner_display_name":"","owner_user_id":"2463734","post_type_id":"1","score":"1","tags":"php|javascript|session","view_count":"48"} +{"id":"30994553","title":"Issue with file transfer using Java sockets and DataStreams","body":"\u003cp\u003eI've been working on a chat client for myself and some friends, and decided to attempt to add functionality to allow file transfers between clients. I am able to send a file, but it arrives in a different state than the file sent. As an example, here is a link comparing the before and after of an image sent:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://i.imgur.com/qbMo0gy.png\" rel=\"nofollow\"\u003ehttp://i.imgur.com/qbMo0gy.png\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eDon't ask why I used that picture, it's just the first one I found in my pictures folder...\nAnd here are the send and receive methods:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic static Runnable sendFile(String target, File file, Client client) {\n Runnable run = () -\u0026gt; {\n FileOutputStream fileOut = null;\n try {\n int total = 0;\n int count;\n byte[] fileBuffer = new byte[8192];\n BufferedInputStream fileStream = new BufferedInputStream(new FileInputStream(file));\n client.getTextOutData().writeUTF(\"*!sendfile: \" + client.getClientName() + \" \" + target + \" \" + file.getName() + \" \" + (int) file.length());\n fileOut = new FileOutputStream(new File(downloadsPath + \"/\" + file.getName()));\n System.out.println(\"Send length: \" + file.length());\n while ((count = fileStream.read(fileBuffer, 0, (int) Math.min(8192, file.length() - total))) == 8192) {\n total += count;\n System.out.println(\"Sender count: \" + count);\n client.getDLOutData().write(fileBuffer, 0, count);\n client.getDLOutData().flush();\n fileOut.write(fileBuffer, 0, count);\n }\n total += count;\n System.out.println(\"Sender count: \" + count);\n System.out.println(\"Sender total: \" + total);\n //client.getDLOutData().write(fileBuffer, 0, count);\n fileOut.write(fileBuffer, 0, count);\n\n System.out.println(\"Sending done, eh?\");\n fileStream.close();\n Thread.currentThread().interrupt();\n } catch (Exception e) {\n Platform.runLater(() -\u0026gt;Popups.startInfoDlg(\"Download Error\", \"Failed to send file!\"));\n e.printStackTrace();\n }\n };\n\n return run;\n\n }\n\npublic static Runnable dlFile(MainScreenController sc, File file, long length) {\n Runnable run = () -\u0026gt; {\n FileOutputStream fileOut = null;\n try {\n int total = 0;\n int count;\n byte[] fileBuffer = new byte[8192];\n fileOut = new FileOutputStream(file);\n System.out.println(\"DL length: \" + length);\n while ((count = sc.getClient().getDLInData().read(fileBuffer, 0, (int) Math.min(8192, length - total))) == 8192){\n total += count;\n System.out.println(\"DL count: \" + count);\n fileOut.write(fileBuffer, 0, count);\n }\n total += count;\n System.out.println(\"DL count: \" + count);\n System.out.println(\"DL total: \" + total);\n //fileOut.write(fileBuffer, 0, count);\n } catch (IOException e) {\n System.out.println(\"Failed to download file.\");\n e.printStackTrace();\n } finally {\n try {\n fileOut.flush();\n fileOut.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n System.out.println(\"Download complete.\");\n Thread.currentThread().interrupt();\n }\n };\n\n return run;\n\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf you have any ideas as to what the problem is, I'd love to hear them. I can also try and set up a Git for the entire project if you need to see more to help. Any help is appreciated, I'm still just beginning to learn java.\u003c/p\u003e","answer_count":"3","comment_count":"3","creation_date":"2015-06-23 05:31:45.383 UTC","last_activity_date":"2015-06-23 06:12:21.287 UTC","last_edit_date":"2015-06-23 05:59:29.43 UTC","last_editor_display_name":"","last_editor_user_id":"5009401","owner_display_name":"","owner_user_id":"5009401","post_type_id":"1","score":"0","tags":"java|sockets","view_count":"52"} +{"id":"29069656","title":"Better way to get div to extend across the page?","body":"\u003cp\u003eI have an html page with a header across the top here is the sum total of the html:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;html\u0026gt;\n\u0026lt;head\u0026gt;\n\u0026lt;script src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\n\u0026lt;css link here\u0026gt;\n\u0026lt;/head\u0026gt;\n\n\n\u0026lt;body onload=\"prettyPrint()\"\u0026gt;\n\u0026lt;div class=\"header\"\u0026gt;\n\u0026lt;/div\u0026gt;\n\u0026lt;/body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand css:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ebody\n{\n background-color: rgb(200, 200, 200);\n z-index: 0;\n margin-top: 50px; \n}\n/* */\n.header\n{\n width: 100%;\n background-color: rgb(8, 36, 86); \n color: white;\n height: 2em; \n padding: .5em; \n z-index: 1000; \n top: 0px;\n position: fixed;\n font-family: times, serif; \n display: inline-block;\n /*margin-left: -9999px;*/\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut whenever I run this, the header doesn't extend across the page and there's a small patch that doesn't appear in either chrome or firefox like so:\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/kGjhX.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eI've modified the css so that the header tag has a width of 1000% and a left margin of -9999px, but it feels like a hack - is there a better way to do this?\u003c/p\u003e","accepted_answer_id":"29069677","answer_count":"5","comment_count":"1","creation_date":"2015-03-16 04:28:43.54 UTC","last_activity_date":"2015-03-16 05:44:47.33 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3262190","post_type_id":"1","score":"0","tags":"html|css","view_count":"88"} +{"id":"25385630","title":"Chrome DevTools extension can't access storage","body":"\u003cp\u003eI'm writing a Chrome extension where I would like to access the Chrome Storage API from the Devtools page. The chrome.storage.local variable (with the get/set functions) are available, but when I call them the callback never get's called. When I use my background page to access the storage API it works as expected.\u003c/p\u003e\n\n\u003cp\u003eI could, of course, send the request via the background page and pass it to the Devtools page through messages but I'm looking for a more cleaner approach. Am I doing something wrong?\nI hope that you understand my question, to illustrate my problem I have created a little sample of what I'm coping with, ready for download here; \u003ca href=\"http://g2f.nl/0w2kko9\" rel=\"nofollow\"\u003ehttp://g2f.nl/0w2kko9\u003c/a\u003e.\u003c/p\u003e\n\n\u003cp\u003eIt includes the following test which verifies that the API is available but does not work as expected;\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edocument.getElementById(\"p\").innerHTML += \"chrome.storage.local.set = \" + !!chrome.storage.local.set\n+ \"\u0026lt;br\u0026gt;chrome.storage.local.get = \" + !!chrome.storage.local.get;\n\nchrome.storage.local.set( {'foo' : 'bar'} , function () {\n document.getElementById(\"p\").innerHTML += '\u0026lt;br\u0026gt;foo = bar';\n});\n\nsetTimeout(function () {\n document.getElementById(\"p\").innerHTML += '\u0026lt;br\u0026gt;That was one second';\n chrome.storage.local.get('foo', function (result) {\n document.getElementById(\"p\").innerHTML += '\u0026lt;br\u0026gt;foo = ' + result;\n });\n}, 1000);\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"7","creation_date":"2014-08-19 14:10:53.88 UTC","last_activity_date":"2014-08-19 15:17:33.55 UTC","last_edit_date":"2014-08-19 15:17:33.55 UTC","last_editor_display_name":"","last_editor_user_id":"616592","owner_display_name":"","owner_user_id":"616592","post_type_id":"1","score":"0","tags":"google-chrome-extension|google-chrome-devtools|google-chrome-storage","view_count":"160"} +{"id":"46887800","title":"Call abstract java class from jruby with a generic","body":"\u003cp\u003eCurrently facing an issue while writing a similar java class in Jruby.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eExample:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eIn Java:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public class Client extends ClientConnection\u0026lt;ChannelType\u0026gt; {\n\n //do some stuff\n\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eIn Jruby:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass Client \u0026lt; Java::'package_name'::ClientConnection\n\n//do some stuff\n\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eDon't know how to pass ChannelType class in Jruby code while rewriting the Client class\u003c/strong\u003e\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-10-23 11:03:43.723 UTC","last_activity_date":"2017-10-23 11:07:33.823 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7688154","post_type_id":"1","score":"1","tags":"jruby","view_count":"10"} +{"id":"37362709","title":"How to edit loaded geoJson with Leaflet","body":"\u003cp\u003eI'm new to stackoverflow, and indeed to coding, so please forgive any missteps on my part regarding forum etiquette, or any other errors on my part. I am working on a project that should allow users to retrieve polygon data from a database and edit them. at this stage I can retrieve the polygons (stored as geojson) upon a click button on a table, but cannot make them editable. I have scoured stackoverflow and various other sites, but cannot seem to work out where I am going wrong. Any help would be very much appreciated. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e var drawnItems = new L.FeatureGroup();\n map.addLayer(drawnItems);\n\n var drawControl = new L.Control.Draw({\n edit: {\n featureGroup: drawnItems\n }\n });\n map.addControl(drawControl);\n\n map.on('draw:created',function(e) {\n e.layer.addTo(drawnItems);\n });\n\n L.control.layers(baseLayers).addTo(map); \n\n var oldPolygon = null;\n function showOnMap(rowid){\n if(oldPolygon != null){\n map.removeLayer(oldPolygon);\n }\n\n $.get(\"testdbextract.php?show=\"+rowid,function(data){\n var newPolygon = L.geoJson(data);\n newPolygon.addTo(drawnItems); // or drawnItems.addLayer(newPolygon);\n oldPolygon = newPolygon;\n }); \n }\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"37364354","answer_count":"1","comment_count":"0","creation_date":"2016-05-21 12:07:03.173 UTC","favorite_count":"1","last_activity_date":"2016-05-23 06:35:22.92 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6364514","post_type_id":"1","score":"1","tags":"javascript|leaflet|leaflet.draw","view_count":"408"} +{"id":"26090209","title":"My two dimensional array does not want to accept all my data","body":"\u003cp\u003eI am giving an array a size by what is contained in the text file. So when I look at my array it shows \u003ccode\u003e[4,7]\u003c/code\u003e. But when I read data into the array it only goes up until \u003ccode\u003e[1,6]\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eTake note that the last name is a position of the data in the array, the other entries then shows a \u003ccode\u003e?\u003c/code\u003e sign and a no-entry sign on the right. \u003c/p\u003e\n\n\u003cp\u003eWhat is wrong with the below code?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003estatic void buildArray() \n{\n int rowCount = 0;\n int colCount = 0;\n int placeHolder = 0;\n double devideNumber = 0;\n int tempNumber = 0;\n string typeOptimum;\n string[] objValue;\n string[] constraintValues;\n List\u0026lt;string\u0026gt; testNumbers;\n List\u0026lt;double\u0026gt; ratioList;\n List\u0026lt;double\u0026gt; rhs;\n\n\n foreach (string item in constraintsList)\n {\n if (rowCount \u0026gt; 0)\n {\n colCount++;\n }\n rowCount++;\n }\n\n rowCount = colCount + 1;\n colCount = colCount + 4;\n string[,] arrayConstraints = new string[8, 9];\n\n //Console.WriteLine(\"row {0} col {1}\", colCount+1, colCount+4);\n\n for (int i = 0; i \u0026lt; rowCount; i++)\n {\n for (int j = 0; j \u0026lt; colCount; j++)\n {\n arrayConstraints[i, j] = \"0\";\n }\n }\n\n arrayConstraints[0, 0] = \"1\";\n\n objValue = constraintsList[0].Split(' ');\n typeOptimum = objValue[0].ToUpper();\n arrayConstraints[0, 1] = (int.Parse(objValue[1]) * -1).ToString();\n arrayConstraints[0, 2] = (int.Parse(objValue[2]) * -1).ToString();\n\n for (int i = 1; i \u0026lt; rowCount; i++)\n {\n constraintValues = constraintsList[i].Split(' ');\n arrayConstraints[i, 1] = constraintValues[0];\n arrayConstraints[i, 2] = constraintValues[1];\n arrayConstraints[i, i + 2] = \"1\";\n arrayConstraints[i, colCount - 1] = constraintValues[3];\n }\n\n //for (int i = 0; i \u0026lt; rowCount; i++)\n //{\n // Console.WriteLine(\" \");\n // for (int j = 0; j \u0026lt; colCount; j++)\n // {\n // Console.Write(arrayConstraints[i, j] + \" \");\n // }\n //}\n\n\n do\n {\n //Console.WriteLine(testNumbers[entryPosition]);\n //Console.WriteLine(arrayConstraints[0,entryPosition+1]);\n //Console.WriteLine(entryPosition+1);\n\n testNumbers = new List\u0026lt;string\u0026gt;();\n for (int i = 1; i \u0026lt; colCount - 1; i++)\n {\n testNumbers.Add(arrayConstraints[0, i]);\n }\n\n ratioList = new List\u0026lt;double\u0026gt;();\n rhs = new List\u0026lt;double\u0026gt;();\n\n for (int i = 1; i \u0026lt; rowCount; i++)\n {\n ratioList.Add(double.Parse(arrayConstraints[i, entryPosition + 1]));\n rhs.Add(double.Parse(arrayConstraints[i, colCount - 1]));\n }\n\n placeHolder = findRatioTest(ratioList, rhs);\n\n\n #region multiplyArray\n\n for (int i = 0; i \u0026lt; rowCount; i++)\n {\n if (i == placeHolder)\n {\n devideNumber = double.Parse(arrayConstraints[entryPosition + 1, placeHolder]);\n for (int j = 0; j \u0026lt; colCount; j++)\n {\n tempNumber = int.Parse(arrayConstraints[placeHolder, j]);\n arrayConstraints[placeHolder, j] = (tempNumber / devideNumber).ToString();\n }\n }\n else\n {\n for (int k = 0; k \u0026lt; colCount; k++)\n {\n arrayConstraints[i, k] = (double.Parse(arrayConstraints[i, k]) - (double.Parse(arrayConstraints[i, entryPosition + 1])) * double.Parse(arrayConstraints[placeHolder, k])).ToString();\n }\n }\n }\n #endregion\n\n foreach (string item in arrayConstraints)\n {\n Console.WriteLine(item);\n }\n\n } while (findNumber(typeOptimum, testNumbers) == true);\n //while (findNumber(typeOptimum, testNumbers) == true)\n //{\n\n // testNumbers.Clear();\n // for (int i = 1; i \u0026lt; colCount - 1; i++)\n // {\n // testNumbers.Add(arrayConstraints[0, i]);\n // }\n //} \n\n\n\n}\n\nstatic Boolean findNumber(string type, List\u0026lt;string\u0026gt; listNumbers) \n{\n Boolean found = false;\n int tempInt, count = 0;\n\n tempInt = int.Parse(listNumbers[0]);\n\n if (type == \"MIN\")\n {\n #region MIN\n foreach (string item in listNumbers)\n {\n count++;\n if (int.Parse(item) \u0026gt; 0 || int.Parse(item)\u0026gt; tempInt)\n {\n entryPosition = count - 1;\n tempInt = int.Parse(item);\n found = true;\n }\n }\n #endregion\n }\n else\n {\n #region MAX\n foreach (string item in listNumbers)\n {\n count++;\n if (int.Parse(item) \u0026lt; 0 || int.Parse(item) \u0026lt; tempInt)\n {\n entryPosition = count - 1;\n tempInt = int.Parse(item);\n found = true;\n }\n }\n #endregion\n }\n\n\n\n return (found);\n\n}\n\nstatic int findRatioTest(List\u0026lt;double\u0026gt; listRatio, List\u0026lt;double\u0026gt; rhs) \n{\n int placeHolder = 0;\n List\u0026lt;double\u0026gt; ratioTest = new List\u0026lt;double\u0026gt;();\n int count = 0;\n double tempSmall;\n int tempPlace = 0;\n\n\n foreach (double item in listRatio)\n {\n try\n {\n ratioTest.Add(rhs[count]/ item);\n }\n catch (Exception)\n {\n ratioTest.Add(double.Parse(\"-1\"));\n throw;\n }\n count++;\n }\n\n count = 0;\n tempSmall = ratioTest[0];\n foreach (double item in ratioTest)\n {\n if (item != 0 \u0026amp;\u0026amp; item \u0026gt; 0)\n {\n if (item \u0026lt; tempSmall)\n {\n tempSmall = item;\n tempPlace = count;\n }\n }\n count++;\n }\n\n placeHolder = tempPlace + 1;\n ratioTest.Clear();\n return (placeHolder);\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"9","creation_date":"2014-09-28 22:17:18.52 UTC","last_activity_date":"2014-09-28 22:47:20.383 UTC","last_edit_date":"2014-09-28 22:47:20.383 UTC","last_editor_display_name":"","last_editor_user_id":"342740","owner_display_name":"","owner_user_id":"4089307","post_type_id":"1","score":"0","tags":"c#|arrays","view_count":"61"} +{"id":"43145264","title":"Fabric error `got multiple values for keyword arg` when trying to use *args to pass in list","body":"\u003cp\u003eLike the title says, I'm using \u003ccode\u003efabric\u003c/code\u003e for something and want to pass in a list while doing so. It seems to me that using \u003ccode\u003e*args\u003c/code\u003e should work but it doesn't.\u003c/p\u003e\n\n\u003cp\u003eHere's an example\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@task\ndef test(msg, *args):\n print msg\n if args:\n print ' '.join(args)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eRunning \u003ccode\u003efab test:msg='hiya',who,is,there\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eresults in an error: \u003ccode\u003eTypeError: test() got multiple values for keyword argument 'msg'\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eAny suggestions?\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2017-03-31 16:14:14.283 UTC","last_activity_date":"2017-03-31 20:14:08.67 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4829166","post_type_id":"1","score":"0","tags":"python|list|fabric","view_count":"48"} +{"id":"25545821","title":"Should I set Math.PI in a variable","body":"\u003cp\u003eIf I have multiple uses of \u003ccode\u003eMath.PI\u003c/code\u003e in a JavaScript function, is it better (performance-wise) to declare a new local variable for it or to just keep accessing it through the \u003ccode\u003eMath\u003c/code\u003e object?\u003c/p\u003e","accepted_answer_id":"25545883","answer_count":"1","comment_count":"1","creation_date":"2014-08-28 09:52:17.86 UTC","last_activity_date":"2014-08-28 10:07:04.25 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3711255","post_type_id":"1","score":"1","tags":"javascript|performance","view_count":"140"} +{"id":"46570755","title":"jQuery call function in script","body":"\u003cp\u003eI have written a simple jQuery function and try to call it. It just won't start. I'm new to jQuery and I can't find the mistake which I make.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eHere my Code:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;!DOCTYPE html\u0026gt;\n\u0026lt;html\u0026gt;\n\u0026lt;head\u0026gt;\n \u0026lt;script src=\"jquery-3.2.1.js\"\u0026gt;\u0026lt;/script\u0026gt;\n\u0026lt;/head\u0026gt;\n\u0026lt;body\u0026gt;\n \u0026lt;script\u0026gt;\n // Function goes here\n function myFunction(inputArray)\n {\n for (int i = 0; i \u0026lt; inputArray.length; i++)\n {\n alert(inputArray[i]);\n }\n }\n\n // Start of the function goes here\n var array = new Array(\"This\", \"Is\", \"JQuery\");\n\n $(function(){\n myFunction(array);\n });\n \u0026lt;/script\u0026gt;\n\u0026lt;/body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"1","creation_date":"2017-10-04 17:26:22.193 UTC","last_activity_date":"2017-10-04 19:26:15.373 UTC","last_edit_date":"2017-10-04 19:26:15.373 UTC","last_editor_display_name":"","last_editor_user_id":"8048497","owner_display_name":"","owner_user_id":"8719464","post_type_id":"1","score":"-1","tags":"jquery","view_count":"16"} +{"id":"34707194","title":"How do I determine which column has been updated?","body":"\u003cp\u003eMy table has 90 columns.\u003c/p\u003e\n\n\u003cp\u003eHow do I determine which column(s) has/have been updated?\u003c/p\u003e\n\n\u003cp\u003eBy \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eUPDATE(@COLUMN_NAME) \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e[@COLUMN_NAME in CURSOR]\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2016-01-10 15:30:15.12 UTC","last_activity_date":"2016-01-11 12:20:23.18 UTC","last_edit_date":"2016-01-10 17:01:42.197 UTC","last_editor_display_name":"","last_editor_user_id":"13302","owner_display_name":"","owner_user_id":"5188246","post_type_id":"1","score":"-2","tags":"sql-server","view_count":"61"} +{"id":"46350455","title":"Instead of storing the images directly, can i store only the paths in hbase?","body":"\u003cp\u003eI want to store image \u0026amp; video (separate cf) in my hbase table. Can I store only path of that media file so that I can retrive image/video it instead of converting image/video into byte[]?\u003c/p\u003e\n\n\u003cp\u003eI am new at Hadoop/hbase. So a detail example will really help me.\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2017-09-21 18:01:56.533 UTC","last_activity_date":"2017-09-28 15:57:06.097 UTC","last_edit_date":"2017-09-28 15:57:06.097 UTC","last_editor_display_name":"","last_editor_user_id":"5313937","owner_display_name":"","owner_user_id":"5313937","post_type_id":"1","score":"1","tags":"java|hadoop|hbase","view_count":"21"} +{"id":"2175394","title":"How to check security role of a user in crm 4.0?","body":"\u003cp\u003eHow can I check user's role in workflow? I have a workflow it will send a mail to users if owner of created entity does not have sales manager role.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2010-02-01 08:17:35.787 UTC","last_activity_date":"2011-02-25 17:19:13.227 UTC","last_edit_date":"2011-02-25 17:19:13.227 UTC","last_editor_display_name":"","last_editor_user_id":"73785","owner_display_name":"","owner_user_id":"255162","post_type_id":"1","score":"0","tags":"dynamics-crm|dynamics-crm-4","view_count":"1291"} +{"id":"42461555","title":"Can't display content in between span tag","body":"\u003cp\u003eHere is my code so far: \u003ca href=\"http://pastebin.com/CdUiXpdf\" rel=\"nofollow noreferrer\"\u003ehttp://pastebin.com/CdUiXpdf\u003c/a\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport requests\nfrom bs4 import BeautifulSoup\n\n\ndef web_crawler(max_pages):\n page = 1\n while page \u0026lt;= max_pages:\n url = \"https://www.kupindo.com/Knjige/artikli/1_strana_\" + str(page)\n source_code = requests.get(url)\n plain_text = source_code.text\n soup = BeautifulSoup(plain_text, \"html.parser\")\n print(\"PAGE: \" + str(page))\n for link in soup.find_all(\"a\", class_=\"item_link\"):\n href = link.get(\"href\")\n # title = link.string\n print(href)\n # print(title)\n extended_crawler(href)\n page += 1\n\n\ndef extended_crawler(item_url):\n source_code = requests.get(item_url)\n plain_text = source_code.text\n soup = BeautifulSoup(plain_text, \"html.parser\")\n for view_counter in soup.find_all(\"span\", id=\"BrojPregleda\"):\n print(\"View Count: \", view_counter.text)\n\n\nweb_crawler(1)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe output is for example\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ePAGE: 1\nhttps://www.kupindo.com/showcontent/2143/Beletristika/37875219_VUK-DRASKOVIC-Izabrana-dela-1-7-Srpska-rec\nView Count: \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo the View Count is empty, even tho there is the expanded_crawler function which looks for span with id of BrojPregleda, nothing displays.\u003c/p\u003e","accepted_answer_id":"42461762","answer_count":"1","comment_count":"1","creation_date":"2017-02-25 21:04:00.403 UTC","last_activity_date":"2017-02-25 21:22:45.073 UTC","last_edit_date":"2017-02-25 21:11:38.757 UTC","last_editor_display_name":"","last_editor_user_id":"5940791","owner_display_name":"","owner_user_id":"5940791","post_type_id":"1","score":"0","tags":"python|beautifulsoup","view_count":"28"} +{"id":"29901354","title":"rails many to many and one to many ownership","body":"\u003cp\u003eI have two models \u003ccode\u003eItem\u003c/code\u003e and \u003ccode\u003eUser\u003c/code\u003e. An \u003ccode\u003eItem\u003c/code\u003e is created and owned by a \u003ccode\u003eUser\u003c/code\u003e. But an \u003ccode\u003eItem\u003c/code\u003e also has users other than its owner.\u003c/p\u003e\n\n\u003cp\u003eIt seems like I need a many to many relationship between items and users. But in addition, I also need a one to many ownership relation of a user who owns many items.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass User \u0026lt; ActiveRecord::Base\n has_many :items, dependent: :destroy\n has_and_belongs_to_many :items\nend\n\nclass Item \u0026lt; ActiveRecord::Base\n belongs_to :user\n has_and_belongs_to_many :users\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI've set up my migrations like so.\u003c/p\u003e\n\n\u003cp\u003eA table to hold the many connections between users and items.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecreate_table :items_users, :id =\u0026gt; false do |t|\n t.column :item_id, :integer\n t.column :user_id, :integer\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAs well as the ownership of an \u003ccode\u003eItem\u003c/code\u003e by a \u003ccode\u003eUser\u003c/code\u003e.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eadd_reference :items, :user, index: true\nadd_foreign_key :items, :users\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis means I can access the owner of an \u003ccode\u003eItem\u003c/code\u003e with \u003ccode\u003eitem.user_id\u003c/code\u003e. I can also access the many to many relationship of users and items with \u003ccode\u003eitem.users\u003c/code\u003e and \u003ccode\u003euser.items\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eI do not know how to access the items that a \u003ccode\u003eUser\u003c/code\u003e owns through a \u003ccode\u003eUser\u003c/code\u003e object. The items that a \u003ccode\u003eUser\u003c/code\u003e owns should be different from the ones in the many to many relationship of \u003ccode\u003euser.items\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eI feel like I'm structuring everything wrong. I'm extremely new to rails and I'm quite confused. What is the proper way to accomplish this in rails?\u003c/p\u003e","accepted_answer_id":"29905478","answer_count":"2","comment_count":"1","creation_date":"2015-04-27 16:35:48.34 UTC","last_activity_date":"2015-04-28 01:15:55.807 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4086912","post_type_id":"1","score":"1","tags":"ruby-on-rails|ruby-on-rails-4","view_count":"76"} +{"id":"20712958","title":"easy durandal please wait while loading spinner","body":"\u003cp\u003eIs there an easy durandal way to clear the view and put a loading or please wait... on the screen so the user gets some feedback to know that it is working until the ajax content loads?\u003c/p\u003e\n\n\u003cp\u003eRight now when I click on a something that navigates to a child route and that child route loads a module that has to do a lot of stuff in activate(), it does not switch the nav or clear the screen or give any feedback to the user that it is working and I see them clicking many times over and over and getting frustrated, then just about when they want to give up, the page loads in fine.\u003c/p\u003e\n\n\u003cp\u003eI would like to make this default functionality for my app and not have to do something special in every module or on every page, is that possible?\u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","accepted_answer_id":"20752905","answer_count":"2","comment_count":"0","creation_date":"2013-12-20 22:31:39.837 UTC","favorite_count":"1","last_activity_date":"2013-12-26 15:59:54.677 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"397048","post_type_id":"1","score":"0","tags":"durandal","view_count":"1386"} +{"id":"1178402","title":"Why no \"what's my ip\" well-known port/service?","body":"\u003cp\u003eI know there are some web sites that provide this service but given that pretty much everyone lives behind NAT these days, why isn't this standardized on a port and provided as a service to whomever wants to run it? It's at least as useful as an echo, daytime or \"quote of the day\" server and as easy to implement.\u003c/p\u003e\n\n\u003cp\u003eOr does one exist that I am aware of? Any proposals/RFCs in progress?\u003c/p\u003e\n\n\u003cp\u003eEDIT: Thanks to everyone for a lively and thoughtful discussion.\u003c/p\u003e","accepted_answer_id":"1178700","answer_count":"4","comment_count":"1","creation_date":"2009-07-24 15:25:10.957 UTC","last_activity_date":"2009-07-28 01:28:49.337 UTC","last_edit_date":"2009-07-28 01:28:49.337 UTC","last_editor_display_name":"","last_editor_user_id":"110850","owner_display_name":"","owner_user_id":"110850","post_type_id":"1","score":"2","tags":"sockets|network-programming|network-protocols","view_count":"516"} +{"id":"11528061","title":"I want to define a Spring Bean CLASS with NO Interface","body":"\u003cp\u003eI have a spring bean that extends \u003ccode\u003eHibernateDaoSupport\u003c/code\u003e. I want this bean injected into my Controllers, but I do NOT want it to implement any interface. I just want to refer to the concrete class from within the rest of my code (not use the AopProxy perhaps?) Does anyone have a way of doing this?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;bean id=\"mySampleService\" class=\"com.sample.MySampleService\"\u0026gt;\n \u0026lt;property name=\"sessionFactory\" ref=\"sessionFactory\" /\u0026gt;\n\u0026lt;/bean\u0026gt;\n\n@Autowired\nprivate MySampleService mySampleService;\n\n... getters and setters ....\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI know it's a good idea to use the interface and that's the whole point of IoC, but PLEASE DON'T suggest I use the interface.\u003c/p\u003e","accepted_answer_id":"11528805","answer_count":"3","comment_count":"6","creation_date":"2012-07-17 17:51:14.967 UTC","favorite_count":"2","last_activity_date":"2017-01-10 12:38:01.08 UTC","last_edit_date":"2017-01-10 12:38:01.08 UTC","last_editor_display_name":"","last_editor_user_id":"3885376","owner_display_name":"","owner_user_id":"1015102","post_type_id":"1","score":"7","tags":"java|spring|ioc-container","view_count":"5486"} +{"id":"9540082","title":"Single waypoint working, Multiple waypoints not, any ideas?","body":"\u003cp\u003eThis code was written for me and used to work, but now the multiple waypoints are not working.\nThe waypoints are stored as \u003cstrong\u003e\u003cem\u003e|51.105166,-1.695971|51.105166,-1.695971|\u003c/em\u003e\u003c/strong\u003e in the database.\nWith only 1 waypoint the maps work, but with more than one they do not show up at all.\u003c/p\u003e\n\n\u003cp\u003eDoes anybody have any suggestions?\u003c/p\u003e\n\n\u003cp\u003eIt can be viewed at the link here. \n\u003ca href=\"http://www.ridersguide.co.uk/2012/Ride_234\" rel=\"nofollow\"\u003ehttp://www.ridersguide.co.uk/2012/Ride_234\u003c/a\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar directionDisplay;\nvar geocoder;\nvar directionsService = new google.maps.DirectionsService();\nvar latlng = new google.maps.LatLng(54.559322587438636, -4.1748046875);\nfunction load() {\n geocoder = new google.maps.Geocoder();\n directionsDisplay = new google.maps.DirectionsRenderer();\n var myOptions = {\n zoom: 6,\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n center: latlng,\n mapTypeControl: true,\n mapTypeControlOptions: {\n style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR,\n position: google.maps.ControlPosition.TOP_RIGHT\n }, \n\nnavigationControl: true,\nnavigationControlOptions: {\nstyle: google.maps.NavigationControlStyle.ZOOM_PAN,\nposition: google.maps.ControlPosition.TOP_LEFT}\n };\n var map = new google.maps.Map(document.getElementById('map'), myOptions);\n directionsDisplay.setMap(map);\n directionsDisplay.setPanel(document.getElementById(\"directionsPanel\"));\n\nvar directionRendererOptions ={\n suppressMarkers: true,\n polylineOptions:{\n strokeColor: \"#FF0000\",\n strokeOpacity: 1,\n strokeWeight: 3\n }\n };\n\ndirectionsDisplay.setOptions(directionRendererOptions);\n\n\n var start = '\u0026lt;?php echo $start; ?\u0026gt;';\n var end = '\u0026lt;?php echo $end; ?\u0026gt;';\n \u0026lt;?php\n if($via != null){\n echo \"var points = [\";\n foreach($via as $point){\n if($point != \"\"){\n echo \"{location:\";\n echo \" '\".$point.\"'\";\n echo \"}\";\n } \n }\n echo \"];\\n\";\n }\n ?\u0026gt;\n\n var request = {\n origin:start,\n waypoints: points,\n destination:end,\n travelMode: google.maps.DirectionsTravelMode.DRIVING\n };\n directionsService.route(request, function(response, status) {\n if (status == google.maps.DirectionsStatus.OK) {\n directionsDisplay.setDirections(response);\n\n }\n\n });\n\n geocoder.geocode( { 'address': start}, function(results, status) {\n var routeStart = new google.maps.Marker({\n map: map, \n position: results[0].geometry.location,\n icon: './images/motorcycling.png',\n shadow: './images/motorcycling.shadow.png'\n });\n\n});\n geocoder.geocode( { 'address': end}, function(results, status) {\n var routeEnd = new google.maps.Marker({\n map: map, \n position: results[0].geometry.location,\n icon: './images/motorcyclingend.png',\n shadow: './images/motorcycling.shadow.png'\n });\n\n}); \n\u0026lt;?php`\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"9546290","answer_count":"1","comment_count":"0","creation_date":"2012-03-02 20:43:17.977 UTC","last_activity_date":"2012-03-03 16:41:17.707 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1245917","post_type_id":"1","score":"0","tags":"google-maps|google-maps-api-3","view_count":"632"} +{"id":"42197829","title":"OAuth access token could not be extracted from Mule Message","body":"\u003cp\u003eI am trying to implement Oauth2 in Mule Connector, for which i am using default methods of Mule Devkit connector platform. But After authenticating i can not user Token due to following error. \nPlease help. Included stack trace will help.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Root Exception stack trace:\njava.lang.IllegalArgumentException: OAuth access token could not be extracted from: {\n \"access_token\" : \"ya29.GlzxA5CJ8FcIay3YXE7sG2spkYYfkcTei6NW_gunsIPW2kSYJToKh1oOyUwkRoy-p-iuGIwLsi5gKvzhZQPMY9wjPkdxR6YJYVswtR3K3iGXlidqbp1_LAQoEHoX0w\",\n \"expires_in\" : 3599,\n \"token_type\" : \"Bearer\"\n}\n at org.mule.security.oauth.util.DefaultOAuthResponseParser.extractAccessCode(DefaultOAuthResponseParser.java:36)\n at org.mule.security.oauth.BaseOAuth2Manager.fetchAndExtract(BaseOAuth2Manager.java:586)\n at org.mule.security.oauth.BaseOAuth2Manager.fetchAccessToken(BaseOAuth2Manager.java:432)\n at org.mule.modules.drivecon2.adapters.DriveCon2ConnectorOAuth2Adapter.fetchAccessToken(DriveCon2ConnectorOAuth2Adapter.java:207)\n at org.mule.security.oauth.processor.OAuth2FetchAccessTokenMessageProcessor.doProcess(OAuth2FetchAccessTokenMessageProcessor.java:68)\n at org.mule.devkit.processor.DevkitBasedMessageProcessor.process(DevkitBasedMessageProcessor.java:89)\n at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27)\n at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:108)\n at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)\n at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:88)\n at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)\n at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27)\n at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:108)\n at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)\n at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27)\n at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:108)\n at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)\n at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:88)\n at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)\n at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27)\n at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:108)\n at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)\n at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27)\n at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)\n at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:98)\n at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)\n at org.mule.interceptor.AbstractEnvelopeInterceptor.processBlocking(AbstractEnvelopeInterceptor.java:58)\n at org.mule.processor.AbstractRequestResponseMessageProcessor.process(AbstractRequestResponseMessageProcessor.java:47)\n at org.mule.processor.AsyncInterceptingMessageProcessor.processNextTimed(AsyncInterceptingMessageProcessor.java:129)\n at org.mule.processor.AsyncInterceptingMessageProcessor$AsyncMessageProcessorWorker$1.process(AsyncInterceptingMessageProcessor.java:213)\n at org.mule.processor.AsyncInterceptingMessageProcessor$AsyncMessageProcessorWorker$1.process(AsyncInterceptingMessageProcessor.java:206)\n at org.mule.execution.ExecuteCallbackInterceptor.execute(ExecuteCallbackInterceptor.java:16)\n at org.mule.execution.CommitTransactionInterceptor.execute(CommitTransactionInterceptor.java:35)\n at org.mule.execution.CommitTransactionInterceptor.execute(CommitTransactionInterceptor.java:22)\n at org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:30)\n at org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:14)\n at org.mule.execution.BeginAndResolveTransactionInterceptor.execute(BeginAndResolveTransactionInterceptor.java:67)\n at org.mule.execution.ResolvePreviousTransactionInterceptor.execute(ResolvePreviousTransactionInterceptor.java:44)\n at org.mule.execution.SuspendXaTransactionInterceptor.execute(SuspendXaTransactionInterceptor.java:50)\n at org.mule.execution.ValidateTransactionalStateInterceptor.execute(ValidateTransactionalStateInterceptor.java:40)\n at org.mule.execution.IsolateCurrentTransactionInterceptor.execute(IsolateCurrentTransactionInterceptor.java:41)\n at org.mule.execution.ExternalTransactionInterceptor.execute(ExternalTransactionInterceptor.java:48)\n at org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:28)\n at org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:13)\n at org.mule.execution.TransactionalErrorHandlingExecutionTemplate.execute(TransactionalErrorHandlingExecutionTemplate.java:110)\n at org.mule.execution.TransactionalErrorHandlingExecutionTemplate.execute(TransactionalErrorHandlingExecutionTemplate.java:30)\n at org.mule.processor.AsyncInterceptingMessageProcessor$AsyncMessageProcessorWorker.doRun(AsyncInterceptingMessageProcessor.java:205)\n at org.mule.work.AbstractMuleEventWork.run(AbstractMuleEventWork.java:53)\n at org.mule.work.WorkerContext.run(WorkerContext.java:301)\n at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\n at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\n at java.lang.Thread.run(Thread.java:745)\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"42361211","answer_count":"2","comment_count":"0","creation_date":"2017-02-13 06:25:17.38 UTC","favorite_count":"2","last_activity_date":"2017-02-21 23:29:06.297 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5901831","post_type_id":"1","score":"0","tags":"oauth|oauth-2.0|mule|mule-component","view_count":"131"} +{"id":"25657186","title":"Bootstrap v3 form does not work in 768 size mobile when using col-sm-#","body":"\u003cp\u003eI created a form in Bootstrap v3. Here's a sample code;\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;form role=\"form\"\u0026gt;\n \u0026lt;div class=\"form-group col-md-4 col-sm-3\"\u0026gt;\n \u0026lt;label\u0026gt;Hotel Name\u0026lt;/label\u0026gt;\n \u0026lt;input type=\"text\" class=\"form-control\"/\u0026gt;\n \u0026lt;/div\u0026gt;\n\u0026lt;/form\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn large or default sized screen, its size is that of \u003ccode\u003ecol-md-4\u003c/code\u003e, but since in 768 screen if you would not assign a size it will automatically adjust to full width size as that of \u003ccode\u003ecol-md-12\u003c/code\u003e. Now, I wanted to assign a width for my form that's why I add \u003ccode\u003ecol-sm-3\u003c/code\u003e to my class. The output of it in a 768 screen is that of width \u003ccode\u003ecol-sm-3\u003c/code\u003e but the problem is I can't seem to input a text in the input text attribute. It seems like it has been disabled or something. What could be the problem to this?\u003c/p\u003e\n\n\u003cp\u003eYour help is much appreciated.\u003c/p\u003e\n\n\u003cp\u003eThank you\u003c/p\u003e","accepted_answer_id":"25657753","answer_count":"1","comment_count":"0","creation_date":"2014-09-04 04:14:02.573 UTC","last_activity_date":"2015-03-16 00:52:20.863 UTC","last_edit_date":"2015-03-16 00:52:20.863 UTC","last_editor_display_name":"","last_editor_user_id":"1476885","owner_display_name":"","owner_user_id":"1698324","post_type_id":"1","score":"1","tags":"forms|twitter-bootstrap|grid","view_count":"77"} +{"id":"32299731","title":"Switch from back camera to front camera while recording","body":"\u003cp\u003eSo I have a custom camera that completely works. You can record the video and get the file etc. You can choose which camera you would like to use; front or back. However, I would like it when I press record that I can switch between the front camera and the back camera and it still records to the file until I hit stop recording. Hope that makes sense.\u003c/p\u003e\n\n\u003cp\u003eMy code for switching cameras:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@IBAction func changeCamera(sender: AnyObject) {\n\n println(\"change camera\")\n\n self.recordButton.enabled = false\n\n dispatch_async(self.sessionQueue!, {\n\n var currentVideoDevice:AVCaptureDevice = self.videoDeviceInput!.device\n var currentPosition: AVCaptureDevicePosition = currentVideoDevice.position\n var preferredPosition: AVCaptureDevicePosition = AVCaptureDevicePosition.Unspecified\n\n switch currentPosition{\n case AVCaptureDevicePosition.Front:\n preferredPosition = AVCaptureDevicePosition.Back\n case AVCaptureDevicePosition.Back:\n preferredPosition = AVCaptureDevicePosition.Front\n case AVCaptureDevicePosition.Unspecified:\n preferredPosition = AVCaptureDevicePosition.Back\n\n }\n\n\n\n var device:AVCaptureDevice = ViewController.deviceWithMediaType(AVMediaTypeVideo, preferringPosition: preferredPosition)\n\n var videoDeviceInput: AVCaptureDeviceInput = AVCaptureDeviceInput(device: device, error: nil)\n\n self.session!.beginConfiguration()\n\n self.session!.removeInput(self.videoDeviceInput)\n\n if self.session!.canAddInput(videoDeviceInput){\n\n NSNotificationCenter.defaultCenter().removeObserver(self, name:AVCaptureDeviceSubjectAreaDidChangeNotification, object:currentVideoDevice)\n\n ViewController.setFlashMode(AVCaptureFlashMode.Auto, device: device)\n\n NSNotificationCenter.defaultCenter().addObserver(self, selector: \"subjectAreaDidChange:\", name: AVCaptureDeviceSubjectAreaDidChangeNotification, object: device)\n\n self.session!.addInput(videoDeviceInput)\n self.videoDeviceInput = videoDeviceInput\n\n }else{\n self.session!.addInput(self.videoDeviceInput)\n }\n\n self.session!.commitConfiguration()\n\n\n\n dispatch_async(dispatch_get_main_queue(), {\n self.recordButton.enabled = true\n self.stopRecording.enabled = true\n })\n\n })\n\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"4","creation_date":"2015-08-30 18:21:56.027 UTC","favorite_count":"3","last_activity_date":"2016-01-21 16:19:02.45 UTC","last_edit_date":"2015-08-30 18:25:31.467 UTC","last_editor_display_name":"","last_editor_user_id":"2274694","owner_display_name":"","owner_user_id":"5274914","post_type_id":"1","score":"4","tags":"ios|iphone|swift|camera","view_count":"904"} +{"id":"40502226","title":"Organizing methods of one class into packages","body":"\u003cp\u003eI' d like to know if there is a way of putting some NOT STATIC methods into separate packages without passing variables? I mean if for example my method is using 7 class variables - if there is a way of putting the method separately from the class? My problem is only organization of the methods within the class code and not the functionality.\u003c/p\u003e","answer_count":"2","comment_count":"7","creation_date":"2016-11-09 07:57:29.37 UTC","last_activity_date":"2016-11-09 08:36:14.377 UTC","last_edit_date":"2016-11-09 08:07:23.273 UTC","last_editor_display_name":"","last_editor_user_id":"2308683","owner_display_name":"","owner_user_id":"6499491","post_type_id":"1","score":"0","tags":"java|methods|code-organization","view_count":"50"} +{"id":"441532","title":"Loading Business Object Hierarchy with One Database Call","body":"\u003cp\u003eI would like to know what the best practice for populating a business object hierarchy (parent/child/grandchild) structure is from a single database call.\u003c/p\u003e\n\n\u003cp\u003eI can think of a couple ways to accomplish it off the top of my head such as:\u003c/p\u003e\n\n\u003cp\u003eleft-joining all the relations in my sql statement then use looping and logic to fill the business objects\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eor\u003c/strong\u003e \u003c/p\u003e\n\n\u003cp\u003euse several select statements and 1 datareader and use its NextResult() method to iterate through each result set and fill the corresponding BO's\u003c/p\u003e\n\n\u003cp\u003eJust wondering what the best practice for this is\u003c/p\u003e\n\n\u003cp\u003eI am using DAAB and c# for my DAL\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","accepted_answer_id":"441638","answer_count":"5","comment_count":"1","creation_date":"2009-01-14 01:05:52.963 UTC","favorite_count":"1","last_activity_date":"2009-01-14 04:45:34.127 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"50970","post_type_id":"1","score":"4","tags":"c#|database|data-access-layer|business-objects","view_count":"1877"} +{"id":"37186414","title":"orderBy and limitTo in ng-repeat child","body":"\u003cp\u003ei would like to use orderBy and limitTo in array which is contain in other array so i need to use ng-repeat two times: i tried this but not working\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;ul ng-repeat=\"item in customarray | orderBy: 'first.date' | limitTo :10 track by $index\"\u0026gt;\n \u0026lt;div ng-repeat=\"first in item[1]\"\u0026gt;\n {{first.date | date}}\n \u0026lt;/div\u0026gt;\n \u0026lt;/ul\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ehere are my arrays\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[\n {\n \"date\":\"2015-09-29T07:12:14Z\",\n \"titre\":\"Changement date de clôture dossier Barbe Alain\",\n \"status\":\"closed\",\n \"tag\":\"maintenance\",\n \"id\":660302971,\n \"name\":\"Eugenie Martin\"\n },\n {\n \"date\":\"2015-09-04T09:45:20Z\",\n \"titre\":\"43325- NH DISTRIBUTION\",\n \"status\":\"closed\",\n \"tag\":\"assistance\",\n \"id\":660302971,\n \"name\":\"Eugenie Martin\"\n },\n {\n \"date\":\"2015-08-20T06:18:04Z\",\n \"titre\":\"TR: EURL NH DISTRIBUTION vous a envoyé un message depuis sa plateforme\",\n \"status\":\"closed\",\n \"tag\":\"assistance\",\n \"id\":660302971,\n \"name\":\"Eugenie Martin\"\n },\n {\n \"date\":\"2015-02-25T16:00:46Z\",\n \"titre\":\"Votre demande au support sans suite\",\n \"status\":\"closed\",\n \"tag\":\"assistance\",\n \"id\":660302971,\n \"name\":\"Eugenie Martin\"\n },\n {\n \"date\":\"2015-01-12T06:48:35Z\",\n \"titre\":\"Bonjour,\\n\\nle cabinet AUFICOM aura un stand lors du...\",\n \"status\":\"closed\",\n \"tag\":\"assistance\",\n \"id\":660302971,\n \"name\":\"Eugenie Martin\"\n },\n {\n \"date\":\"2014-12-18T09:48:38Z\",\n \"titre\":\"ISACOMPTA\",\n \"status\":\"closed\",\n \"tag\":\"maintenance\",\n \"id\":660302971,\n \"name\":\"Eugenie Martin\"\n },\n {\n \"date\":\"2014-12-15T14:08:08Z\",\n \"titre\":\"changement date de clôture\",\n \"status\":\"closed\",\n \"tag\":\"maintenance\",\n \"id\":660302971,\n \"name\":\"Eugenie Martin\"\n }\n]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003chr\u003e\n\n\u003cpre\u003e\u003ccode\u003e[\n {\n \"date\":\"2016-03-15T10:56:28Z\",\n \"titre\":\"ferme de la blonde\",\n \"status\":\"closed\",\n \"tag\":\"assistance\",\n \"id\":661671741,\n \"name\":\"Tanguy Jacob\"\n },\n {\n \"date\":\"2016-03-08T13:51:57Z\",\n \"titre\":\"SCAN DOCUMENTS\",\n \"status\":\"open\",\n \"tag\":\"evolution\",\n \"id\":661671741,\n \"name\":\"Tanguy Jacob\"\n },\n {\n \"date\":\"2016-01-05T13:59:31Z\",\n \"titre\":\"EARL DU TROU DE L'ENFER\",\n \"status\":\"closed\",\n \"tag\":\"maintenance\",\n \"id\":661671741,\n \"name\":\"Tanguy Jacob\"\n },\n {\n \"date\":\"2015-12-28T06:50:04Z\",\n \"titre\":\"15377- TR: SNC DE LA FERME DE LA BLONDE vous a envoyé un message depuis sa plateforme\",\n \"status\":\"closed\",\n \"tag\":\"assistance\",\n \"id\":661671741,\n \"name\":\"Tanguy Jacob\"\n },\n {\n \"date\":\"2015-11-06T09:40:03Z\",\n \"titre\":\"GAEC DE LA VILLE (N°573)\",\n \"status\":\"closed\",\n \"tag\":\"maintenance\",\n \"id\":661671741,\n \"name\":\"Tanguy Jacob\"\n },\n {\n \"date\":\"2015-11-02T16:28:05Z\",\n \"titre\":\"43325- NH DISTRIBUTION\",\n \"status\":\"closed\",\n \"tag\":\"maintenance\",\n \"id\":661671741,\n \"name\":\"Tanguy Jacob\"\n },\n {\n \"date\":\"2015-06-26T11:41:57Z\",\n \"titre\":\"Dossier 411 : MUNIER Valérie\",\n \"status\":\"closed\",\n \"tag\":\"maintenance\",\n \"id\":661671741,\n \"name\":\"Tanguy Jacob\"\n },\n {\n \"date\":\"2015-06-26T11:40:54Z\",\n \"titre\":\"Dossier 6072 : ROBERT Grégory\",\n \"status\":\"closed\",\n \"tag\":\"assistance\",\n \"id\":661671741,\n \"name\":\"Tanguy Jacob\"\n },\n {\n \"date\":\"2015-01-15T08:58:07Z\",\n \"titre\":\"Demande De TJ\",\n \"status\":\"closed\",\n \"tag\":\"maintenance\",\n \"id\":661671741,\n \"name\":\"Tanguy Jacob\"\n },\n {\n \"date\":\"2014-12-17T10:26:37Z\",\n \"titre\":\"ECOLE DES CAVALIERS\",\n \"status\":\"closed\",\n \"tag\":\"maintenance\",\n \"id\":661671741,\n \"name\":\"Tanguy Jacob\"\n }\n]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAn other solution would be to put all arrays together then i will be able to use only 1 time ng-repeat: but i don't know how can i do that i begin with this:\u003c/p\u003e\n\n\u003cp\u003econtroller.js\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e var interarray = []\n for(s=0;s\u0026lt;data.length;s++){\n\n interarray.push(data[s]);\n\n }\n console.log(interarray);\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"2","creation_date":"2016-05-12 12:07:11.853 UTC","last_activity_date":"2016-05-12 14:40:51.027 UTC","last_edit_date":"2016-05-12 14:40:51.027 UTC","last_editor_display_name":"","last_editor_user_id":"4115245","owner_display_name":"","owner_user_id":"6270988","post_type_id":"1","score":"0","tags":"javascript|arrays|angularjs|angularjs-orderby|angularjs-limitto","view_count":"410"} +{"id":"44047637","title":"Django filter objects from many to many relationship","body":"\u003cp\u003eI'm having a problem when trying to filter over a many-to-many relationship.\u003c/p\u003e\n\n\u003cp\u003eThis is my models.py:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass Member(models.Model):\n name = models.CharField(max_length=255)\n\nclass Talk(models.Model):\n members = models.ManyToManyField(Member)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to get the conversations in which two members are participating.\u003c/p\u003e\n\n\u003cp\u003eHere are the data I have:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n \"pk\": 2,\n \"members\": [\n 36384,\n 12626,\n 48397\n ],\n},\n{\n \"pk\": 3,\n \"members\": [\n 36384,\n 12626,\n -89813,\n 48397\n ],\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to get conversations where the two specified members participate. My query was as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eTalk.objects.filter(members__in=[12626, -89813])\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe result I get is the following:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;QuerySet [\u0026lt;Talk: 2\u0026gt;, \u0026lt;Talk: 3\u0026gt;, \u0026lt;Talk: 3\u0026gt;]\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow can I make the result to be this?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;Talk: 3\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNote: It is in the only conversation in which the specified members are participating\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2017-05-18 12:21:28.973 UTC","last_activity_date":"2017-05-18 12:41:20.583 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7057737","post_type_id":"1","score":"0","tags":"python|django|orm","view_count":"208"} +{"id":"16604145","title":"how to track the user timings( start time and end time) for Silverlight application using google analytics...?","body":"\u003cp\u003eI have recently signed-up at Google Analytics and also new to same.\u003c/p\u003e\n\n\u003cp\u003eI want to track the button click and user start time and end time using google analytics.\u003c/p\u003e\n\n\u003cp\u003eI have also received following javascript from Google analytics:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;script type=\"text/javascript\"\u0026gt;\n (\nfunction (i, s, o, g, r, a, m) {\n i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () {\n (i[r].q = i[r].q || []).push(arguments)\n }, i[r].l = 1 * new Date(); a = s.createElement(o),\n m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m)\n })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');\n ga('create', 'UA-########-1', 'blahblah.com');\n ga('send', 'pageview');\n\u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI know how to call javascript function from .net application, but how to deal with user timings, I have also refered the link\n\u003ca href=\"https://developers.google.com/analytics/devguides/collection/analyticsjs/user-timings\" rel=\"nofollow\"\u003ehttps://developers.google.com/analytics/devguides/collection/analyticsjs/user-timings\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003ebut didn't found helpful/fruitful.\u003c/p\u003e\n\n\u003cp\u003ePlease help soon, your early response is highly appreciated.\u003c/p\u003e\n\n\u003cp\u003eThanks,\nVijay.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-05-17 07:55:41.523 UTC","last_activity_date":"2013-05-18 00:03:58.16 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2392956","post_type_id":"1","score":"0","tags":"silverlight|google-analytics","view_count":"188"} +{"id":"11883914","title":"View inside toast","body":"\u003cp\u003eI want to make a toast in which I have put EditText and a button ..but I can't type anything inside EditText neither I can click the button how to write inside EditText that viewed by the toast..\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class MainActivity extends Activity \n{\n @Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n Button New=(Button)findViewById(R.id.button1);\n Button save=(Button)findViewById(R.id.button3);\n EditText ed1=(EditText)findViewById(R.id.editText1);\n\n final Toast t=new Toast(getApplicationContext());\n New.setOnClickListener(new View.OnClickListener() {\n\n public void onClick(View v) {\n // TODO Auto-generated method stub\n\n\n ListView l=new ListView(getApplication());\n l.setAdapter(new badp(getApplicationContext()));\n\n t.setGravity(Gravity.CENTER_VERTICAL, 0, 0);\n\n t.setView(l);\n t.setDuration(Toast.LENGTH_LONG);\n t.show();\n }\n });\n\n\n }\n public class badp extends BaseAdapter\n {\n\n Context context;\n private badp(Context context) {\n // TODO Auto-generated constructor stub\n this.context=context;\n }\n\n public int getCount() {\n // TODO Auto-generated method stub\n return 1;\n }\n\n public Object getItem(int position) {\n // TODO Auto-generated method stub\n return null;\n }\n\n public long getItemId(int position) {\n // TODO Auto-generated method stub\n return 0;\n }\n\n public View getView(int position, View convertView, ViewGroup parent) {\n // TODO Auto-generated method stub\n LinearLayout l=new LinearLayout(context);\n Button b1=new Button(context);\n b1.setText(\"Save\");\n EditText ed=new EditText(context);\n ed.setGravity(Gravity.CENTER);\n // LayoutParams lparams = new LayoutParams();\n // ed.setLayoutParams(lparams);\n ed.setWidth(5);\n ed.setEms(10);\n\n\n l.addView(ed);\n l.addView(b1);\n\n return l;\n }\n\n }\n\n @Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.activity_main, menu);\n return true;\n }\n\n\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"11883989","answer_count":"2","comment_count":"0","creation_date":"2012-08-09 12:54:19.083 UTC","last_activity_date":"2012-08-10 10:57:07.183 UTC","last_edit_date":"2012-08-10 10:57:07.183 UTC","last_editor_display_name":"","last_editor_user_id":"1525300","owner_display_name":"","owner_user_id":"1586394","post_type_id":"1","score":"0","tags":"android|toast","view_count":"159"} +{"id":"47441702","title":"Source tree .gitignore to ignore everything but specific directories/files","body":"\u003cp\u003eI've seen many \u003ca href=\"https://stackoverflow.com/questions/5241644/using-gitignore-to-ignore-everything-but-specific-directories\"\u003eexamples\u003c/a\u003e and they pretty much say the same but for some reason I cannot get it to work using SourceTree.\nMy folder structure shown below, i want to ignore everything except for folder3 and all it's content, folder2_3_2_1, all it's content and the .ignore file.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efolder1\nfolder2\n folder2_1\n folder2_2\n folder2_3\n folder2_3_1\n folder2_3_2\n folder2_3_2_1\n someOtherFile1.php\n someOtherFile12php\n someNewFolder\n folder2_3_3\n folder2_4\nfolder3\n.ignore\nsomefile.php\nsomefile2.php\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ein my .ignore I have the following\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e# Ignore everything\n/*\n\n#except for\n!.gitignore\n!folder3/\n!folder2/folder2_3/folder2_3_2/\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eStrange thing is, if I don't ignore anything and I'm able to see all my files in my unstaged files panel, if I right click and ignore someOtherFile.php and select the option to ignore everything beneath, it does the opposite, sourceTree ignores it's folder (i.e. folder2_3_2_1) and everything within!\u003c/p\u003e\n\n\u003cp\u003eSourceTree V 2.3.1.0\u003c/p\u003e\n\n\u003cp\u003eThank you in advance\u003c/p\u003e","accepted_answer_id":"47444657","answer_count":"1","comment_count":"0","creation_date":"2017-11-22 18:33:49.333 UTC","last_activity_date":"2017-11-22 22:16:20.5 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"632195","post_type_id":"1","score":"0","tags":"git|gitignore|atlassian-sourcetree","view_count":"28"} +{"id":"15891079","title":"Change variable type mysql with existing data","body":"\u003cp\u003eHi I've got a variable 'text' within my MYSQL database that gathers something like a status update. I believe this variable has a limit of 200? \u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003cp\u003eIs this something that is already set? \u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eIf so what variable would be\nsuitable for both a quick 150 character updates as well as something\nas long as a 1500 word article if a user wanted to elaborate? \u003c/p\u003e\u003c/li\u003e\n\u003cli\u003eHow do\ni change it within phpmyadmin to the desired new variable if data is\ncurrently present within the present form?\u003c/li\u003e\n\u003c/ul\u003e","answer_count":"2","comment_count":"2","creation_date":"2013-04-08 23:58:55.297 UTC","last_activity_date":"2014-12-30 19:30:54.89 UTC","last_edit_date":"2013-04-13 07:44:29.583 UTC","last_editor_display_name":"","last_editor_user_id":"1060292","owner_display_name":"","owner_user_id":"2251674","post_type_id":"1","score":"2","tags":"mysql|variables","view_count":"1220"} +{"id":"15948690","title":"Printing a dynamic array after increasing its size","body":"\u003cp\u003eI'm currently making a code on the MU game using dynamic arrays, and I've got a problem with printing a sequence.\u003c/p\u003e\n\n\u003cp\u003eRule: If the first character is denoted by the character M, and the rest of the sequence is denoted by R, then the new sequence is MRR.\u003c/p\u003e\n\n\u003cp\u003eExamples include:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eCurrent sequence: MIUI\u003c/p\u003e\n \n \u003cp\u003eNew sequence: MIUIIUI\u003c/p\u003e\n \n \u003cp\u003eCurrent sequence: MUM\u003c/p\u003e\n \n \u003cp\u003eNew sequence: MUMUM\u003c/p\u003e\n \n \u003cp\u003eCurrent sequence: MU\u003c/p\u003e\n \n \u003cp\u003eNew sequence: MUU\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eHere are snippets of my code:\u003c/p\u003e\n\n\u003cp\u003eIN MAIN:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eif (userchoice == 2)\n{\n if (rule2valid == false)\n {\n cout \u0026lt;\u0026lt; \"This rule may not be applied to your input.\" \u0026lt;\u0026lt; endl;\n return 0;\n } \n int newsize = size + size - 1;\n char *resultant = new char[newsize];\n resultant = applyRule2(userinput, size);\n printarray (resultant, newsize);\n} \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn the function which applies the rule:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003echar *applyRule2(char* sequence, int size)\n{\nint newsize = size + size - 1;\nint j = 1;\n\nchar* applyRule = new char[newsize];\nfor (int i = 0; i \u0026lt; size; i++)\n applyRule[i] = sequence[i];\nfor (int i = size; i \u0026lt; newsize; i++)\n{\n applyRule[i] == sequence[j];\n} \nreturn applyRule;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand the function for printing:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evoid printarray(char* sequence, int size)\n{\nfor (int i = 0; i \u0026lt; size; i++){\ncout \u0026lt;\u0026lt; sequence[i] \u0026lt;\u0026lt; \"\\t\"; \n}\ncout \u0026lt;\u0026lt; \"The length of this array is : \" \u0026lt;\u0026lt; size;\ncout \u0026lt;\u0026lt; endl;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe problem is that when I run the program, my output is as such: \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eInput: M U M\u003c/p\u003e\n \n \u003cp\u003eOutput: M U M, The length of this string is 5. (supposed to be M U M U M)\u003c/p\u003e\n \n \u003cp\u003eInput: M I U I\u003c/p\u003e\n \n \u003cp\u003eOutput: M I U I, the length of this string is 7. (supposed to be M I U I I U I)\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eWhat I have done so far is that I allocated a new dynamic array with the new size, and added values into the array accordingly. I am, however, at a loss as to whether the problem lies in the applyRule2 function or in the printarray function.\u003c/p\u003e\n\n\u003cp\u003eIt would be greatly appreciated if someone could point me out in the right direction.\u003c/p\u003e","accepted_answer_id":"15948912","answer_count":"2","comment_count":"0","creation_date":"2013-04-11 12:23:04.82 UTC","last_activity_date":"2013-04-11 12:34:19.317 UTC","last_edit_date":"2013-04-11 12:28:00.867 UTC","last_editor_display_name":"","last_editor_user_id":"1773177","owner_display_name":"","owner_user_id":"2270175","post_type_id":"1","score":"0","tags":"c++|dynamic-arrays","view_count":"123"} +{"id":"3659914","title":"Priority of learning programming craft and other suggestions","body":"\u003cp\u003eAs I am in my starting career year in software development (C++ \u0026amp; C#) I now see my flaws and what I miss in this sphere. Because of that I came into some conclusions and made myself a plan to fill those gaps and increase my knowledge in software development. But the question I stumbled upon after making a tasks which I need to do has not quite obvious answer to me. What is the priority of those tasks? Here are these tasks and my priority by numbering:\u003c/p\u003e\n\n\u003cp\u003eLearning: \u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eFunctional programming (Scala)\u003c/li\u003e\n\u003cli\u003eData structures \u0026amp; Algorithms (Cormen book to the rescue + TopCoder/ProjectEuler/etc)\u003c/li\u003e\n\u003cli\u003eDesign patterns (GOF or Head First)\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eDo you agree with this tasks and priorities? Or do I miss something here? Any suggestions are welcome!\u003c/p\u003e","accepted_answer_id":"3660890","answer_count":"8","comment_count":"3","community_owned_date":"2010-09-07 15:10:29.777 UTC","creation_date":"2010-09-07 15:10:29.777 UTC","favorite_count":"13","last_activity_date":"2010-09-08 09:15:56.6 UTC","last_edit_date":"2010-09-07 15:57:59.943 UTC","last_editor_display_name":"","last_editor_user_id":"146325","owner_display_name":"","owner_user_id":"147953","post_type_id":"1","score":"11","tags":"algorithm|design-patterns|data-structures|scala","view_count":"1647"} +{"id":"19152471","title":"What is the technique of presenting again form which contains error?","body":"\u003cp\u003eUsing Flask + Flask-Classy + WTForms, I am trying to implement a route, such that, when user having error in their input form, application will presented again that form to the user, complete with what user already filled. This way, user didn't have to worried of typing again all the form input : (s)he can correct the errors. \u003c/p\u003e\n\n\u003cp\u003eThese are code from my class UserView(FlaskView) which is a flask-classy class :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef post(self): \n form = forms.UserForm(request.form) \n if form.validate(): \n if form.id.data=='': \n user = models.Users() \n form.populate_obj(user) \n user.id = None \n db.session.add(user) \n else: \n user = models.Users.query.get(form.id.data) \n form.populate_obj(user) \n\n db.session.commit() \n return redirect(url_for('UserView:index')) \n else: \n return redirect(url_for('UserView:validation_error', error_form=form)) \n\ndef validation_error(self, error_form): \n return render_template('users/form.html', form=error_form) \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eYou can see that in this attempt, I try to create another method : \u003ccode\u003evalidation_error\u003c/code\u003e, with argument --that in my expectation-- should contain all the form data. But, turns out I got Jinja2 exception, \u003ccode\u003eUndefinedError: 'unicode object' has no attribute 'hidden_tag'\u003c/code\u003e. As I inspect it, after having been in \u003ccode\u003evalidation_error\u003c/code\u003e, that \u003ccode\u003eform\u003c/code\u003e object is somewhat changed from \u003ccode\u003eUserForm\u003c/code\u003e into somekind of \u003ccode\u003eunicode\u003c/code\u003e object. \u003c/p\u003e\n\n\u003cp\u003eAny suggestion? Or, is it that I try to solve this problem in a wrong direction?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT 1 : Elaborate more on how to display the error\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eAs @Rawrgulmuffins added an answer on how to display the error \u003ca href=\"https://gist.github.com/maximebf/3986659\" rel=\"nofollow noreferrer\"\u003einline\u003c/a\u003e (which I think is the best way, as the page will not get jumpy), here I pasted the code in my \u003ccode\u003elayout.html\u003c/code\u003e that list all the errors. It may not as good as an inline error display, but I think it's the easiest way there is. First I do an if for the form object, as this code is also exist for all page (I maybe refactored it even more) \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e {% if form %}\n {% for error in form.errors %}\n \u0026lt;div class=\"alert alert-error\"\u0026gt;\n \u0026lt;a class=\"close\" data-dismiss=\"alert\"\u0026gt;×\u0026lt;/a\u0026gt;\n \u0026lt;strong\u0026gt;{{ form[error].label }} {{form.errors[error][0] }}\u0026lt;/strong\u0026gt;\n \u0026lt;/div\u0026gt;\n {% endfor %}\n {% endif %}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eScreenshot given : \u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/Zebqy.png\" alt=\"Validation error display\"\u003e\u003c/p\u003e","accepted_answer_id":"19165763","answer_count":"2","comment_count":"0","creation_date":"2013-10-03 06:43:01.593 UTC","last_activity_date":"2013-10-04 03:47:12.567 UTC","last_edit_date":"2013-10-04 03:47:12.567 UTC","last_editor_display_name":"","last_editor_user_id":"427793","owner_display_name":"","owner_user_id":"427793","post_type_id":"1","score":"2","tags":"python|flask","view_count":"693"} +{"id":"2263103","title":"Can 1330316 AJAX requests crash my server?","body":"\u003cp\u003eI'm building a small PHP/Javascript app which will do some processing for all cities in all US states. This rounds up to a total of (52 x 25583) = 1330316 or less items that will need to be processed.\u003c/p\u003e\n\n\u003cp\u003eThe processing of each item will take about 2-3 seconds, so its possible that the user could have to stare at this page for 1-2 hours (or at least keep it minimized while he did other stuff).\u003c/p\u003e\n\n\u003cp\u003eIn order to give the user the maximum feedback, I was thinking of controlling the processing of the page via javascript, basically something like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar current = 1;\nvar max = userItems.length; // 1330316 or less\n\nprocess();\n\nfunction process()\n{\n if (current \u0026gt;= max)\n {\n alert('done');\n return;\n }\n\n $.post(\"http://example.com/process\", {id: current}, function()\n {\n $(\"#current\").html(current);\n current ++;\n process();\n }\n );\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn the html i will have the following status message which will be updated whenever the \u003ccode\u003eprocess()\u003c/code\u003e function is called:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div id=\"progress\"\u0026gt;\n Please wait while items are processed.\n \u0026lt;span id=\"current\"\u0026gt;0\u0026lt;/span\u0026gt; / \u0026lt;span id=\"max\"\u0026gt;1330316\u0026lt;/span\u0026gt; items have been processed.\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHopefully you can all see how I want this to work.\u003c/p\u003e\n\n\u003cp\u003eMy only concern is that, if those 1330316 requests are made simultaneously to the server, is there a possibility that this crashes/brings down the server? If so, if I put in an extra wait of 2 seconds per request using \u003ccode\u003esleep(3);\u003c/code\u003e in the server-side PHP code, will that make things better?\u003c/p\u003e\n\n\u003cp\u003eOr is there a different mechanism for showing the user the rapid feedback such as polling which doesn't require me to mess with apache or the server?\u003c/p\u003e","accepted_answer_id":"2263142","answer_count":"2","comment_count":"5","creation_date":"2010-02-14 22:36:33.237 UTC","last_activity_date":"2010-02-14 22:51:18.053 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"49153","post_type_id":"1","score":"0","tags":"php|javascript|jquery|ajax|codeigniter","view_count":"728"} +{"id":"43890690","title":"What is the better way for update table 2 with table 1 php mysqli?","body":"\u003cp\u003eWhat is the better way for update table 2 with table 1 php mysqli ?\u003c/p\u003e\n\n\u003cp\u003efor me, use while loop and update row\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?PHP\nsession_start();\ninclude(\"connect.php\");\n$query = \"SELECT * FROM table_1\";\n$result = mysqli_query($db_mysqli, $query);\nwhile($row = mysqli_fetch_assoc($result))\n{\n $id = $row['id'];\n $money = $row['money']; \n $db_mysqli-\u0026gt;query(\"Update table_2 Set money = '$money' WHERE id = '$id'\"); \n}\n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to know php have code that process in 1 step for update table 2 with table 1 ?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-05-10 11:06:44.37 UTC","favorite_count":"1","last_activity_date":"2017-05-10 11:09:54.38 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7991291","post_type_id":"1","score":"0","tags":"php|mysqli","view_count":"25"} +{"id":"3541825","title":"Textarea in chrome only shows one line","body":"\u003cp\u003eHi I have a form with a text area for comments. The problem is my code below should produce a textbox 3 rows high but when it is displayed in Chrome it only ever appears as one line , Can anyone suggest what I am doing wrong please? \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;tr\u0026gt; \n \u0026lt;td \u0026gt;\u0026amp;nbsp;\u0026lt;/td\u0026gt;\n \u0026lt;td \u0026gt;\u0026lt;strong\u0026gt;Approver Comments\u0026lt;/strong\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;td colspan=\"3\" \u0026gt;\n \u0026lt;textarea name=\"approvecom\" cols=\"100\" rows=\"5\" autocomplete=\"OFF\"\u0026gt;\u0026lt;/textarea\u0026gt;\n \u0026lt;/td\u0026gt;\n \u0026lt;td \u0026gt;\u0026amp;nbsp;\u0026lt;/td\u0026gt;\n\u0026lt;/tr\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"3541841","answer_count":"2","comment_count":"1","creation_date":"2010-08-22 14:32:14.57 UTC","last_activity_date":"2015-11-09 02:28:58.913 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"195866","post_type_id":"1","score":"0","tags":"html","view_count":"2182"} +{"id":"32179153","title":"Comparison operators not working?","body":"\u003cp\u003eI have never stumbled upon this issue before. What is wrown with the following comparison:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$longest_side = 2.9;\nif ($longest_side \u0026gt; 2.9) echo 'Too long'; // Returns true, incorrect\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSome debugging:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar_dump($longest_side, 2.9) // Displays float(2.9) float(2.9)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe only way to make it work was to stringify the values\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eif ((string)$longest_side \u0026gt; (string)2.9) echo 'Too long'; // Returns false, OK\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs this a PHP bug or as constructed?\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2015-08-24 09:45:04.657 UTC","last_activity_date":"2015-08-24 09:45:04.657 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1135440","post_type_id":"1","score":"0","tags":"php|comparison-operators","view_count":"27"} +{"id":"33096408","title":"Expand the grouping automatically in begin in ui-grid","body":"\u003cp\u003eI have followed the steps in th \u003ca href=\"http://ui-grid.info/docs/#/tutorial/209_grouping\" rel=\"nofollow\"\u003etutorial\u003c/a\u003e to construct my grouping. \u003c/p\u003e\n\n\u003cp\u003eWhat i want to have is expanding certain (or all) rows in begin automatically. In tutorial they used: \u003ccode\u003e$scope.gridApi.treeBase.toggleRowTreeState($scope.gridApi.grid.renderContainers.body.visibleRowCache[rowNum]);\u003c/code\u003e\nand: $scope.gridApi.treeBase.expandAllRows();\u003c/p\u003e\n\n\u003cp\u003eThey are working after my grid is ready but; my grid is not initialized in begin in my app and just after some required actions the grid will be shown and initialized. Therefore, i don't know how to use them to expand the rows automatically. \u003c/p\u003e\n\n\u003cp\u003eThus i believe i need some callback like onReady. Any idea?\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2015-10-13 07:17:04.733 UTC","last_activity_date":"2015-11-05 08:29:33.783 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1259865","post_type_id":"1","score":"0","tags":"javascript|angularjs|callback|angular-ui-grid","view_count":"239"} +{"id":"15458361","title":"how to get facebook albumName","body":"\u003cp\u003ei have problem with get facebook album name.i use this code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate void LoadAlbumName()\n {\n\n dynamic albums = new FacebookMediaObject();\n albums = _fb.Get(\"me/albums/\");\n foreach (dynamic albumInfo in albums.data)\n {\n Dispatcher.BeginInvoke(new MethodInvoker(\n () =\u0026gt;\n {\n dynamic albumsPhotos = _fb.Get(albumInfo.id + \"/photos\");\n }));\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhen i run i get null\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-03-17 07:00:24.97 UTC","last_activity_date":"2013-03-17 09:33:25.673 UTC","last_edit_date":"2013-03-17 07:07:44.73 UTC","last_editor_display_name":"","last_editor_user_id":"470005","owner_display_name":"","owner_user_id":"2060098","post_type_id":"1","score":"0","tags":"c#|facebook","view_count":"52"} +{"id":"20284451","title":"http to https redirection based on subdomain name","body":"\u003cp\u003eWe have 3 sub domains pointed to a apache webserver,all the subdomains are for different web applications, we have got ssl against the sub domains,ssl certificates were installed, but we are not able to redirect the http requests to https.. we have to write manually \u003ca href=\"https://subdomain.domain-name.com\" rel=\"nofollow\"\u003ehttps://subdomain.domain-name.com\u003c/a\u003e to access our applications... \u003c/p\u003e\n\n\u003cp\u003eWe are using zend server 6 . please help us to know so that all the http request can be redirected to https. \u003c/p\u003e\n\n\u003cp\u003ewe have written this on our httpd.conf file \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e RewriteEngine On\n RewriteCond %{HTTP_HOST} ^(.*?)\\.domain-name.com$\n RewriteCond %{HTTPS} !=on\n RewriteRule ^(.*?)$ https://%{HTTP_HOST} [nc]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewe are really new to this.we will be highly grateful.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-11-29 11:14:14.36 UTC","last_activity_date":"2013-11-29 12:03:31.167 UTC","last_edit_date":"2013-11-29 11:59:23.5 UTC","last_editor_display_name":"","last_editor_user_id":"3049140","owner_display_name":"","owner_user_id":"3049140","post_type_id":"1","score":"0","tags":"apache|http|ssl|https","view_count":"162"} +{"id":"14733021","title":"How to batch update Box enterpise users","body":"\u003cp\u003eI have successfully pulled back a list of enterprise users using the Box API:\n\u003ca href=\"http://developers.box.com/docs/\" rel=\"nofollow\"\u003ehttp://developers.box.com/docs/\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI now want to batch update a group of users, setting the group to Inactive.\u003c/p\u003e\n\n\u003cp\u003eIn the API, I see that you can update a single user like this: \u003ccode\u003ePUT /users/{id}\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eI believe I can just loop through a list of users from a .csv file and individually set each of them to \"inactive\" via the method above. The problem is that I don't know the ID of each user to include in the .csv file. If I export the users via the Box Admin Console's \"Bulk Edit\" feature, I get a .csv file of the users, but it only contains the following columns: Name, Email, Groups, and Storage.\u003c/p\u003e\n\n\u003cp\u003eSo, my first thought is that there may be some way to update the user through the API using the email address.\nAs in, first search for the user via the email address, then get the ID from the results, and finally use the returned ID to update the user account. Is this possible or can you suggest another way to solve this problem?\u003c/p\u003e","accepted_answer_id":"14738539","answer_count":"2","comment_count":"0","creation_date":"2013-02-06 15:46:40.06 UTC","last_activity_date":"2013-02-06 20:54:15.76 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"861337","post_type_id":"1","score":"0","tags":"box-api","view_count":"343"} +{"id":"11785311","title":"Server side validation with custom DataAnnotationsModelValidatorProvider","body":"\u003cp\u003eI have setup a custom provider to allow setting validation attributes from a data store instead of in static code. Works great with the client side validation in my .NET MVC 4 project, but I am unable to get the server side validation to work.\u003c/p\u003e\n\n\u003cp\u003eCustomModelValidatorProvider .cs:\u003c/p\u003e\n\n\u003cpre\u003e\n\n public class CustomModelValidatorProvider : DataAnnotationsModelValidatorProvider\n {\n protected override IEnumerable GetValidators(ModelMetadata metadata, ControllerContext context, IEnumerable attributes)\n {\n // set attributes from datastore here\n\n return base.GetValidators(metadata, context, attributes);\n }\n }\n\n\u003c/pre\u003e\n\n\u003cp\u003eIn my Global.asax.cs I have:\u003c/p\u003e\n\n\u003cpre\u003e\n\n protected void Application_Start()\n {\n ModelValidatorProviders.Providers.Clear();\n ModelValidatorProviders.Providers.Add(new CustomModelValidatorProvider());\n }\n\n\u003c/pre\u003e\n\n\u003cp\u003eAnd in a Web API method I have:\u003c/p\u003e\n\n\u003cpre\u003e\n\n var validationResultList = new List();\n bool valid = Validator.TryValidateObject(myModelObject, new ValidationContext(myModelObject, null, null), validationResultList, true);\n\n\u003c/pre\u003e\n\n\u003cp\u003eHere, valid is always true. Even when the Jquery client side validation displays an error. On the server side my custom provider is not being used to apply the data annotations. When I set a breakpoint in GetValidators() it's called when the View is created and correctly displays the client side validators, but does not get called again when the model is bound to the controller.\u003c/p\u003e\n\n\u003cp\u003eHave I missed a step? Any help is greatly appreciated!\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eUPDATE\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eThe custom validator works correctly when the object is posted to a Controller, but does not get fired when posted to an ApiController.\u003c/p\u003e","accepted_answer_id":"12207801","answer_count":"1","comment_count":"7","creation_date":"2012-08-02 20:33:58.463 UTC","favorite_count":"3","last_activity_date":"2013-08-31 09:00:41.21 UTC","last_edit_date":"2013-08-31 09:00:41.21 UTC","last_editor_display_name":"","last_editor_user_id":"41956","owner_display_name":"","owner_user_id":"817697","post_type_id":"1","score":"5","tags":"c#|asp.net-mvc|asp.net-web-api|data-annotations|model-validation","view_count":"3253"} +{"id":"22402241","title":"NHibernate mapping without keys","body":"\u003cp\u003eI have these two classes\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[DataServiceKey(\"Id\")]\npublic class EmailMessage\n{\n [DataMember]\n public virtual long Id { get; set; }\n\n [DataMember]\n public virtual string Scope { get; set; }\n\n [DataMember]\n public virtual long ScopeId { get; set; }\n\n ...\n\n [DataMember]\n public virtual IList\u0026lt;BinaryDataView\u0026gt; Attachments { get; set; }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class BinaryDataView\n{\n [DataMember]\n public virtual long BinaryId { get; set; }\n\n [DataMember]\n public virtual string ExternalLink { get; set; }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am trying to create a propher nhibernate mapping for them but, data base are old enough and I can't use forenkeys. Both data bases (tEmail and tBinaryData) contains fields Scope and ScopeId and I need to use them to get BinaryData.\u003c/p\u003e\n\n\u003cp\u003eSo this is how my classes in hbm.xml looks like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;class name=\"EmailMessage\" table=\"tEmail\"\u0026gt;\n \u0026lt;id name=\"Id\"\u0026gt;\n \u0026lt;column name=\"EmailId\" sql-type=\"bigint\"/\u0026gt;\n \u0026lt;generator class=\"native\" /\u0026gt;\n \u0026lt;/id\u0026gt;\n \u0026lt;property name=\"DataOwnerId\" /\u0026gt;\n \u0026lt;property name=\"Scope\"/\u0026gt;\n \u0026lt;property name=\"ScopeId\"/\u0026gt;\n \u0026lt;property name=\"From\" column=\"[From]\"/\u0026gt;\n \u0026lt;property name=\"To\" column=\"[To]\"/\u0026gt;\n \u0026lt;property name=\"Subject\"/\u0026gt;\n \u0026lt;property name=\"Body\"/\u0026gt;\n \u0026lt;bag name=\"Attachments\" lazy=\"false\" fetch=\"join\" generic=\"true\"\u0026gt;\n \u0026lt;key\u0026gt;\n \u0026lt;column name=\"Scope\" /\u0026gt;\n \u0026lt;column name=\"ScopeId\" /\u0026gt;\n \u0026lt;/key\u0026gt;\n \u0026lt;one-to-many class=\"Entities.BinaryDataView,Entities\" not-found=\"ignore\"/\u0026gt;\n \u0026lt;/bag\u0026gt;\n \u0026lt;/class\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;class name=\"BinaryDataView\" table=\"tBinaryData\" \u0026gt;\n \u0026lt;id name=\"BinaryId\"\u0026gt;\n \u0026lt;column name=\"BinaryId\" sql-type=\"bigint\"/\u0026gt;\n \u0026lt;generator class=\"native\" /\u0026gt;\n \u0026lt;/id\u0026gt;\n \u0026lt;property name=\"ExternalLink\"/\u0026gt;\n \u0026lt;/class\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eRight now I'm getting the: Foreign key (FK66731BD76FED2100:tBinaryData [Scope, ScopeId])) must have same number of columns as the referenced primary key (tEmail [EmailId]) error.\nSo, there is my question: Where am I wrong and what I'm doing wrong? How can I create this mapping without using forenkeys for Scope and ScopeId?\u003c/p\u003e\n\n\u003cp\u003eAnd sorry for my bad English.\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003e\u003cstrong\u003eUpdate:\u003c/strong\u003e\nManaged to create mapping. At least right now its working:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;class name=\"EmailMessage\" table=\"tEmail\"\u0026gt;\n \u0026lt;id name=\"Id\"\u0026gt;\n \u0026lt;column name=\"EmailId\" sql-type=\"bigint\"/\u0026gt;\n \u0026lt;generator class=\"native\" /\u0026gt;\n \u0026lt;/id\u0026gt;\n \u0026lt;property name=\"DataOwnerId\" /\u0026gt;\n \u0026lt;property name=\"Scope\" /\u0026gt;\n \u0026lt;property name=\"ScopeId\" /\u0026gt;\n \u0026lt;properties name=\"ScopeInfo\"\u0026gt;\n \u0026lt;property name=\"Scope\" column=\"Scope\"/\u0026gt;\n \u0026lt;property name=\"ScopeId\" column=\"ScopeId\"/\u0026gt;\n \u0026lt;/properties\u0026gt;\n \u0026lt;property name=\"From\" column=\"[From]\"/\u0026gt;\n \u0026lt;property name=\"To\" column=\"[To]\"/\u0026gt;\n \u0026lt;property name=\"Subject\"/\u0026gt;\n \u0026lt;property name=\"Body\"/\u0026gt;\n \u0026lt;bag name=\"Attachments\" lazy=\"false\" fetch=\"join\" generic=\"true\"\u0026gt;\n \u0026lt;key property-ref=\"ScopeInfo\" foreign-key=\"none\"\u0026gt;\n \u0026lt;column name=\"Scope\" /\u0026gt;\n \u0026lt;column name=\"ScopeId\" /\u0026gt;\n \u0026lt;/key\u0026gt;\n \u0026lt;one-to-many class=\"Entities.BinaryDataView,Entities\" not-found=\"ignore\"/\u0026gt;\n \u0026lt;/bag\u0026gt;\n \u0026lt;/class\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-03-14 10:21:53.673 UTC","last_activity_date":"2014-03-14 13:00:06.817 UTC","last_edit_date":"2014-03-14 13:00:06.817 UTC","last_editor_display_name":"","last_editor_user_id":"3418949","owner_display_name":"","owner_user_id":"3418949","post_type_id":"1","score":"0","tags":"c#|nhibernate|mapping|nhibernate-mapping","view_count":"262"} +{"id":"9364028","title":"Caption uncentering its image","body":"\u003cp\u003eI have a problem that might be a simple one, but can't find a solution.\u003c/p\u003e\n\n\u003cp\u003eI am managing my self-hosted wordpress, and am often adding pictures to articles I post, and like to have them centered. However, I noticed that when adding a caption to the centered pictures, they ended up aligned left. You can see an example \u003ca href=\"http://themikal.com/?p=1948\" rel=\"nofollow noreferrer\"\u003ehere\u003c/a\u003e (first and second pictures).\u003c/p\u003e\n\n\u003cp\u003eThe \"no caption \u0026amp; aligned\" picture code is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;p style=\"text-align: center;\"\u0026gt;\n \u0026lt;a rel=\"attachment wp-att-1949\" href=\"http://themikal.com/?attachment_id=1949\"\u0026gt;\n \u0026lt;img class=\" size-large wp-image-1949 aligncenter\" title=\"hildolfr1\" src=\"http://themikal.com/wp-content/uploads/2011/05/hildolfr1-566x400.jpg\"alt=\"\" width=\"391\" height=\"276\" /\u0026gt;\n \u0026lt;/a\u0026gt;\n\u0026lt;/p\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhereas the \"caption and disaligned\" picture code would be:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[caption id=\"attachment_1949\" align=\"aligncenter\" width=\"391\" caption=\"Hildolfr\"]\n \u0026lt;a rel=\"attachment wp-att-1949\" href=\"http://themikal.com/?attachment_id=1949\"\u0026gt;\n \u0026lt;img class=\" size-large wp-image-1949 aligncenter \" title=\"hildolfr1\" src=\"http://themikal.com/wp-content/uploads/2011/05/hildolfr1-566x400.jpg\" alt=\"\" width=\"391\" height=\"276\" /\u0026gt;\n \u0026lt;/a\u0026gt;\n[/caption]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI tried adding \u003ccode\u003e\u0026lt;p style=\"text-align: center;\"\u0026gt;\u0026lt;/p\u0026gt;\u003c/code\u003e to the captioned picture code, either outside the caption brackets or inside, but without results.\u003c/p\u003e\n\n\u003cp\u003eWould someone have an idea about why it reacts like that? \u003ca href=\"https://wordpress.stackexchange.com/questions/42886/caption-uncentering-its-image\"\u003ewordpress.stackexchange\u003c/a\u003e decided it was a css-related issue, and so was more relevant here.\u003c/p\u003e\n\n\u003cp\u003eI am a total beginner regarding CSS, and am using a predesigned code that I then heavily modified. But I can give more info about some info in the CSS if someone points where it is located.\u003c/p\u003e\n\n\u003cp\u003eThanks a lot!\u003c/p\u003e","accepted_answer_id":"9364365","answer_count":"1","comment_count":"9","creation_date":"2012-02-20 15:51:37.16 UTC","last_activity_date":"2012-02-20 16:11:54.73 UTC","last_edit_date":"2017-04-13 12:37:28.547 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"1032982","post_type_id":"1","score":"1","tags":"css|wordpress|caption","view_count":"150"} +{"id":"8393777","title":"Current state of drd and helgrind support for std::thread","body":"\u003cp\u003eAs I transition my code to C++11, I would very much like to convert my pthread code to std::thread. However, I seem to be getting false race conditions on very simple programs in drd and in helgrind.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;thread\u0026gt;\n\nint main(int argc, char** argv)\n{\n std::thread t( []() { } );\n t.join();\n return 0;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHelgrind output snippet - I also get similar errors in drd, using gcc 4.6.1, valgrind 3.7.0 on Ubuntu 11.11 amd64.\u003c/p\u003e\n\n\u003cp\u003eMy questions are:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003esanity check: Am I doing anything wrong? Are others getting similar false reports on simple std::thread programs?\u003c/li\u003e\n\u003cli\u003eWhat are current users of std::thread using to detect race-conditions?\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eI am reluctant to port a ton of code from pthread to \u003ccode\u003estd::thread\u003c/code\u003e until some crucial tools like helgrind/drd have caught up.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e==19347== ---Thread-Announcement------------------------------------------\n==19347== \n==19347== Thread #1 is the program's root thread\n==19347== \n==19347== ---Thread-Announcement------------------------------------------\n==19347== \n==19347== Thread #2 was created\n==19347== at 0x564C85E: clone (clone.S:77)\n==19347== by 0x4E37E7F: do_clone.constprop.3 (createthread.c:75)\n==19347== by 0x4E39604: pthread_create@@GLIBC_2.2.5 (createthread.c:256)\n==19347== by 0x4C2B3DA: pthread_create_WRK (hg_intercepts.c:255)\n==19347== by 0x4C2B55E: pthread_create@* (hg_intercepts.c:286)\n==19347== by 0x50BED02: std::thread::_M_start_thread(std::shared_ptr\u0026lt;std::thread::_Impl_base\u0026gt;) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16)\n==19347== by 0x400D51: _ZNSt6threadC1IZ4mainEUlvE_IEEEOT_DpOT0_ (in /mnt/home/kfeng/dev/robolab/cpp/sbx/sandbox)\n==19347== by 0x400C60: main (in /mnt/home/kfeng/dev/robolab/cpp/sbx/sandbox)\n==19347== \n==19347== ----------------------------------------------------------------\n==19347== \n==19347== Possible data race during write of size 8 at 0x5B8E060 by thread #1\n==19347== Locks held: none\n==19347== at 0x40165E: _ZNSt6thread5_ImplISt12_Bind_resultIvFZ4mainEUlvE_vEEED1Ev (in /mnt/home/kfeng/dev/robolab/cpp/sbx/sandbox)\n==19347== by 0x401895: _ZNKSt19_Sp_destroy_inplaceINSt6thread5_ImplISt12_Bind_resultIvFZ4mainEUlvE_vEEEEEclEPS6_ (in /mnt/home/kfeng/dev/robolab/cpp/sbx/sandbox)\n==19347== by 0x4016D8: _ZNSt19_Sp_counted_deleterIPNSt6thread5_ImplISt12_Bind_resultIvFZ4mainEUlvE_vEEEESt19_Sp_destroy_inplaceIS6_ESaIS6_ELN9__gnu_cxx12_Lock_policyE2EE10_M_disposeEv (in /mnt/home/kfeng/dev/robolab/cpp/sbx/sandbox)\n==19347== by 0x401B83: std::_Sp_counted_base\u0026lt;(__gnu_cxx::_Lock_policy)2\u0026gt;::_M_release() (in /mnt/home/kfeng/dev/robolab/cpp/sbx/sandbox)\n==19347== by 0x401B3E: std::__shared_count\u0026lt;(__gnu_cxx::_Lock_policy)2\u0026gt;::~__shared_count() (in /mnt/home/kfeng/dev/robolab/cpp/sbx/sandbox)\n==19347== by 0x401A93: std::__shared_ptr\u0026lt;std::thread::_Impl_base, (__gnu_cxx::_Lock_policy)2\u0026gt;::~__shared_ptr() (in /mnt/home/kfeng/dev/robolab/cpp/sbx/sandbox)\n==19347== by 0x401AAD: std::shared_ptr\u0026lt;std::thread::_Impl_base\u0026gt;::~shared_ptr() (in /mnt/home/kfeng/dev/robolab/cpp/sbx/sandbox)\n==19347== by 0x400D5D: _ZNSt6threadC1IZ4mainEUlvE_IEEEOT_DpOT0_ (in /mnt/home/kfeng/dev/robolab/cpp/sbx/sandbox)\n==19347== by 0x400C60: main (in /mnt/home/kfeng/dev/robolab/cpp/sbx/sandbox)\n==19347== \n==19347== This conflicts with a previous read of size 8 by thread #2\n==19347== Locks held: none\n==19347== at 0x50BEABE: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16)\n==19347== by 0x4C2B547: mythread_wrapper (hg_intercepts.c:219)\n==19347== by 0x4E38EFB: start_thread (pthread_create.c:304)\n==19347== by 0x564C89C: clone (clone.S:112)\n==19347== \n==19347== Address 0x5B8E060 is 32 bytes inside a block of size 64 alloc'd\n==19347== at 0x4C29059: operator new(unsigned long) (vg_replace_malloc.c:287)\n==19347== by 0x4012E9: _ZN9__gnu_cxx13new_allocatorISt23_Sp_counted_ptr_inplaceINSt6thread5_ImplISt12_Bind_resultIvFZ4mainEUlvE_vEEEESaIS8_ELNS_12_Lock_policyE2EEE8allocateEmPKv (in /mnt/home/kfeng/dev/robolab/cpp/sbx/sandbox)\n==19347== by 0x40117C: _ZNSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EEC1INSt6thread5_ImplISt12_Bind_resultIvFZ4mainEUlvE_vEEEESaISA_EIS9_EEESt19_Sp_make_shared_tagPT_RKT0_DpOT1_ (in /mnt/home/kfeng/dev/robolab/cpp/sbx/sandbox)\n==19347== by 0x4010B9: _ZNSt12__shared_ptrINSt6thread5_ImplISt12_Bind_resultIvFZ4mainEUlvE_vEEEELN9__gnu_cxx12_Lock_policyE2EEC1ISaIS6_EIS5_EEESt19_Sp_make_shared_tagRKT_DpOT0_ (in /mnt/home/kfeng/dev/robolab/cpp/sbx/sandbox)\n==19347== by 0x401063: _ZNSt10shared_ptrINSt6thread5_ImplISt12_Bind_resultIvFZ4mainEUlvE_vEEEEEC1ISaIS6_EIS5_EEESt19_Sp_make_shared_tagRKT_DpOT0_ (in /mnt/home/kfeng/dev/robolab/cpp/sbx/sandbox)\n==19347== by 0x401009: _ZSt15allocate_sharedINSt6thread5_ImplISt12_Bind_resultIvFZ4mainEUlvE_vEEEESaIS6_EIS5_EESt10shared_ptrIT_ERKT0_DpOT1_ (in /mnt/home/kfeng/dev/robolab/cpp/sbx/sandbox)\n==19347== by 0x400EF7: _ZSt11make_sharedINSt6thread5_ImplISt12_Bind_resultIvFZ4mainEUlvE_vEEEEIS5_EESt10shared_ptrIT_EDpOT0_ (in /mnt/home/kfeng/dev/robolab/cpp/sbx/sandbox)\n==19347== by 0x400E17: _ZNSt6thread15_M_make_routineISt12_Bind_resultIvFZ4mainEUlvE_vEEEESt10shared_ptrINS_5_ImplIT_EEEOS7_ (in /mnt/home/kfeng/dev/robolab/cpp/sbx/sandbox)\n==19347== by 0x400D2B: _ZNSt6threadC1IZ4mainEUlvE_IEEEOT_DpOT0_ (in /mnt/home/kfeng/dev/robolab/cpp/sbx/sandbox)\n==19347== by 0x400C60: main (in /mnt/home/kfeng/dev/robolab/cpp/sbx/sandbox)\n==19347== \n==19347== ----------------------------------------------------------------\n==19347==\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"8458482","answer_count":"3","comment_count":"0","creation_date":"2011-12-06 00:19:17.22 UTC","favorite_count":"2","last_activity_date":"2013-08-09 11:05:53.947 UTC","last_edit_date":"2012-08-30 21:30:31.643 UTC","last_editor_display_name":"","last_editor_user_id":"47453","owner_display_name":"","owner_user_id":"975129","post_type_id":"1","score":"11","tags":"c++|multithreading|c++11|race-condition","view_count":"1845"} +{"id":"26696169","title":"How to return a specific view based on user input in ASP.NET MVC","body":"\u003cp\u003eI am fairly new to MVC, but not web programming and I am having an issue with passing data values from a View to a Controller where the data values are not associated with a Model.\u003c/p\u003e\n\n\u003cp\u003eScenario: I have two types of users: Student and Faculty; Basically I am trying to determine which view to return when users register on the site.\u003c/p\u003e\n\n\u003cp\u003eEX:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public ActionResult Preregister(bool fac, bool stud)\n {\n\n if (stud == true)\n {\n return StudentRegister();\n }\n else if(fac == true)\n {\n return FacultyRegister();\n }\n else\n {\n return Index();\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo, I want this ActionMethod called from this form:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@{\nViewBag.Title = \"Preregister\";\n}\n\n\u0026lt;h2\u0026gt;Registration\u0026lt;/h2\u0026gt;\n\u0026lt;p\u0026gt;Please indicate whether you are a student or faculty.\u0026lt;/p\u0026gt;\n@{\n bool chkValFac = false;\n bool chkValStud = false;\n}\n@using (Html.BeginForm(\"Preregister, Account\"))\n{\n \u0026lt;div class=\"pre-reg-container\"\u0026gt;\n \u0026lt;div class=\"checkbox-container\"\u0026gt;\n \u0026lt;div class=\"item\"\u0026gt;\n \u0026lt;label for=\"Student\" style=\"width:70px;\"\u0026gt;Student\u0026lt;/label\u0026gt;\n @Html.CheckBox(\"Student\", chkValStud)\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"item\"\u0026gt;\n \u0026lt;label for=\"Faculty\" style=\"width:70px;\"\u0026gt;Faculty\u0026lt;/label\u0026gt;\n @Html.CheckBox(\"Faculty\", chkValFac)\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;input name=\"continue\" type=\"submit\" id=\"continue\" value=\"Continue\" /\u0026gt;\n\u0026lt;/div\u0026gt;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn debugging, I get this error:\u003c/p\u003e\n\n\u003cp\u003eThe parameters dictionary contains a null entry for parameter 'stud' of non-nullable type 'System.Boolean' for method 'System.Web.Mvc.ActionResult Preregister(Boolean)' in 'Room_Booking_System.Controllers.AccountController'. An optional parameter must be a reference type, a nullable type, or be declared as an optional parameter.\nParameter name: parameters\u003c/p\u003e\n\n\u003cp\u003eI don't understand how I can get the data from this view into the controller without posting back. I want a simple redirect based on the response. Please Help.\u003c/p\u003e\n\n\u003cp\u003eThank you all!\u003c/p\u003e","accepted_answer_id":"26697158","answer_count":"2","comment_count":"3","creation_date":"2014-11-02 04:48:28.453 UTC","last_activity_date":"2014-11-02 11:50:29.36 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4204701","post_type_id":"1","score":"0","tags":"c#|asp.net-mvc","view_count":"623"} +{"id":"27067162","title":"Backbone Route parameter not working without hash","body":"\u003cp\u003eI have problem routing my app to a route like : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\"list/:id\": 'list'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy webpage goes to, eg list/subpage and I have a blank page.\nIt is well redirected when I use an hash, like #list/subpage\u003c/p\u003e\n\n\u003cp\u003eMy Backbone start : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eBackbone.history.start({ pushState: true });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy .htaccess : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;ifModule mod_rewrite.c\u0026gt;\n RewriteEngine On\n RewriteCond %{REQUEST_FILENAME} !-f\n RewriteCond %{REQUEST_FILENAME} !-d\n RewriteRule !\\.(js|ico|gif|jpg|png|css)$ index.php [L]\n\u0026lt;/ifModule\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat could be wrong ? Tell me if you need more code\u003c/p\u003e","accepted_answer_id":"27067196","answer_count":"1","comment_count":"0","creation_date":"2014-11-21 17:38:46.52 UTC","last_activity_date":"2014-11-21 17:40:28.733 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1147429","post_type_id":"1","score":"0","tags":"javascript|.htaccess|backbone.js","view_count":"65"} +{"id":"23248422","title":"OpenGL project with Codeblocks compilation issue","body":"\u003cp\u003eI'm using Codeblocks (in Ubuntu with GCC) and have apt-gotten the necessary files for OpenGL and am now going through a tutorial on the basics of OpenGL:\u003c/p\u003e\n\n\u003cp\u003eMy (tutorial based) code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;GL/glu.h\u0026gt;\n#include \u0026lt;GL/freeglut.h\u0026gt;\n\n//#include \u0026lt;GL/gl.h\u0026gt;\n#include \u0026lt;GL/glut.h\u0026gt;\n\nvoid display(void)\n{\n /* clear window */\n\n glClear(GL_COLOR_BUFFER_BIT);\n\n\n /* draw unit square polygon */\n\n glBegin(GL_POLYGON);\n glVertex2f(-0.5, -0.5);\n glVertex2f(-0.5, 0.5);\n glVertex2f(0.5, 0.5);\n glVertex2f(0.5, -0.5);\n glEnd();\n\n /* flush GL buffers */\n\n glFlush();\n\n}\n\n\nvoid init()\n{\n\n /* set clear color to black */\n\n /* glClearColor (0.0, 0.0, 0.0, 0.0); */\n /* set fill color to white */\n\n /* glColor3f(1.0, 1.0, 1.0); */\n\n /* set up standard orthogonal view with clipping */\n /* box as cube of side 2 centered at origin */\n /* This is default view and these statement could be removed */\n\n /* glMatrixMode (GL_PROJECTION);\n glLoadIdentity ();\n glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0); */\n}\n\nint main(int argc, char** argv)\n{\n\n /* Initialize mode and open a window in upper left corner of screen */\n /* Window title is name of program (arg[0]) */\n\n /* You must call glutInit before any other OpenGL/GLUT calls */\n glutInit(\u0026amp;argc,argv);\n glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);\n glutInitWindowSize(500,500);\n glutInitWindowPosition(0,0);\n glutCreateWindow(\"simple\");\n glutDisplayFunc(display);\n init();\n glutMainLoop();\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I try to run this in Codeblocks (with GCC set in the build settings) I get the following error:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eerror: undefined reference to glClear error: \u003c/p\u003e\n \n \u003cp\u003eundefined reference to glBegin ...\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eAfter trying for hours to change build settings, I decided to just call GCC from the command line:\ngcc -o main main.c -lGL -lGLU -lglut\u003c/p\u003e\n\n\u003cp\u003eThis compiles without problem and I can even run it. So I'm not sure what the problem is.\n(Also, in Codeblocks I did add \"-lGL -lGLU -lglut\" to the build options.)\u003c/p\u003e\n\n\u003cp\u003eWhy can command line GCC compile this but codeblocks can't?\u003c/p\u003e\n\n\u003cp\u003eNote: In Codeblocks I turned off all compiler flags in build settings.\nLinker Settings is empty. The only thing I have added are the above-mentioned compiler options.\u003c/p\u003e","accepted_answer_id":"23249119","answer_count":"1","comment_count":"1","creation_date":"2014-04-23 15:10:32.3 UTC","last_activity_date":"2014-04-23 18:47:59.613 UTC","last_edit_date":"2014-04-23 15:21:14.277 UTC","last_editor_display_name":"","last_editor_user_id":"44729","owner_display_name":"user485498","post_type_id":"1","score":"0","tags":"c|opengl|gcc|codeblocks","view_count":"406"} +{"id":"123002","title":"Does the size of the constructor matter if you're using Inversion of Control?","body":"\u003cp\u003eSo I've got maybe 10 objects each of which has 1-3 dependencies (which I think is ok as far as loose coupling is concerned) but also some settings that can be used to define behavior (timeout, window size, etc).\u003c/p\u003e\n\n\u003cp\u003eNow before I started using an Inversion of Control container I would have created a factory and maybe even a simple ObjectSettings object for each of the objects that requires more than 1 setting to keep the size of the constructor to the recommended \"less than 4\" parameter size. I am now using an inversion of control container and I just don't see all that much of a point to it. Sure I might get a constructor with 7 parameters, but who cares? It's all being filled out by the IoC anyways.\u003c/p\u003e\n\n\u003cp\u003eAm I missing something here or is this basically correct?\u003c/p\u003e","accepted_answer_id":"142182","answer_count":"5","comment_count":"2","creation_date":"2008-09-23 18:53:13.27 UTC","last_activity_date":"2008-12-31 21:16:46.837 UTC","last_edit_date":"2008-09-23 18:59:37.187 UTC","last_editor_display_name":"George Mauer","last_editor_user_id":"5056","owner_display_name":"George Mauer","owner_user_id":"5056","post_type_id":"1","score":"4","tags":"inversion-of-control","view_count":"339"} +{"id":"44777892","title":"Blank page after login of user created by Prestashop Webservice","body":"\u003cp\u003eI face strange problem after I create remotely customer via Prestashop 1.6 Webservice and try to login (to Prestashop frontend) with his email and password.\u003c/p\u003e\n\n\u003cp\u003eCustomer is logged in correctly but page is displayed without content, just empty layout divs. No menu, footer, hooks... Only the logo:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/zh3aD.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/zh3aD.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eWhen I replace URL to get into \"My account\", it works, but no header/footer is displayed.\u003c/p\u003e\n\n\u003cp\u003eOther users that were created in standard way can log in correctly and all the content is displayed.\u003c/p\u003e\n\n\u003cp\u003eWhat could be the problem? Did I forget to fill some of the madatory fields for customer when using webservice?\u003c/p\u003e\n\n\u003cp\u003eI created customer with these fields filled:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elastname\nfirstname\nemail\npasswd\nactive\nnote\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ePS: I also found out, that last visit of this user in Prestashop admin remains blank after login...\u003c/p\u003e\n\n\u003cp\u003eThank you :)\u003c/p\u003e","accepted_answer_id":"44796903","answer_count":"1","comment_count":"2","creation_date":"2017-06-27 10:24:15.683 UTC","last_activity_date":"2017-06-28 08:05:53.657 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1213524","post_type_id":"1","score":"0","tags":"prestashop","view_count":"43"} +{"id":"46339436","title":"SQL order by 0 first and then descend number/values","body":"\u003cp\u003eI have a weird situation where i need to order 0 first and then descends a column.\u003c/p\u003e\n\n\u003cp\u003eLet's say i have column that looks like this \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eStatus\n------\n3\n4\n0\n5\n1\n2\n4\n0\n2\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd Now i need to order it by\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eStatus\n------\n0\n0\n5\n4\n4\n3\n2\n2\n1\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs this possible for SQL? I've been trying to test for 2 days now but i am stuck.\u003c/p\u003e","accepted_answer_id":"46339453","answer_count":"1","comment_count":"1","creation_date":"2017-09-21 08:51:09.867 UTC","last_activity_date":"2017-09-28 06:43:06.96 UTC","last_edit_date":"2017-09-28 06:43:06.96 UTC","last_editor_display_name":"","last_editor_user_id":"6707605","owner_display_name":"","owner_user_id":"6707605","post_type_id":"1","score":"2","tags":"sql|sql-server","view_count":"107"} +{"id":"35965780","title":"How do I to get a ul list od divs to display inline?","body":"\u003cp\u003eI've got a \u003ccode\u003eul\u003c/code\u003e that I want to be inline horizontally. See what it currently looks like \u003ca href=\"http://i.stack.imgur.com/e8ukK.png\" rel=\"nofollow\"\u003ehere\u003c/a\u003e. I need the pink, orange \u0026amp; blue boxes to display inline. Can anybody help?\u003c/p\u003e\n\n\u003cp\u003eHere's the HTML:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div id=\"header-li\"\u0026gt;\n \u0026lt;ul class=\"header-i\"\u0026gt;\n \u0026lt;li\u0026gt;\n \u0026lt;div class=\"quick-i1\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\n \u0026lt;div class=\"quick-i2\"\u0026gt;\u0026lt;/div\n \u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\n \u0026lt;div class=\"quick-i3\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd here's the CSS code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#header-li {\n display: inline-block;\n height: 60px;\n width: 500px;\n border: 1px solid #000000;\n margin: 10px;\n padding: 0;\n position: relative;\n vertical-align: middle;\n}\n.quick-i {\n height:70px;\n width: 166px;\n border: 1px solid #000000;\n display: inline-block;\n vertical-align: middle;\n position: relative;\n margin: 0 0 0 0;\n padding: 0px;\n}\nul.header-i {\n display: inline-block;\n list-style-type: none !important;\n padding: 0;\n list-style-type: none;\n}\n.quick-i1 {\n height: 50px;\n width: 100px;\n border: 2px solid orange;\n position: relative;\n margin-top: 4px;\n display: inline-block;\n}\n.quick-i2 {\n height: 50px;\n width: 100px;\n border: 2px solid yellow;\n position: relative;\n margin-top: 4px;\n display: inline-block;\n}\n.quick-i3 {\n height: 50px;\n width: 231px;\n border: 2px solid blue;\n position: relative;\n margin-top: 4px;\n display: inline-block;\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"35965809","answer_count":"1","comment_count":"0","creation_date":"2016-03-13 02:30:26.83 UTC","favorite_count":"0","last_activity_date":"2016-03-13 03:07:20.08 UTC","last_edit_date":"2016-03-13 03:07:20.08 UTC","last_editor_display_name":"","last_editor_user_id":"2773837","owner_display_name":"","owner_user_id":"5875219","post_type_id":"1","score":"-1","tags":"css|wordpress|inline","view_count":"31"} +{"id":"39935486","title":"python3 exception invalid syntax error","body":"\u003cp\u003eI recently started learning python3, and I am trying to write an exception. \nI have this line, which is a list of words. \nI want to match the word create to the list, sometimes it's there sometimes its not. When it's not there I get this error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eTraceback (most recent call last):\nFile \"sub_process.py\", line 17, in \u0026lt;module\u0026gt;\nif (line.index(\"create\")):\nValueError: 'create' is not in list\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand I am fine with that. This is expected. So I thought if I wrote an exception to it the script could just continue on and keep doing stuff. So I an exception below and all its suppose to do is nothing. Catch the error and continue on.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eline = line.split()\n\nif line.index(\"create\"):\n print(\"basd\");\nexcept ValueError:\n print(\"123\");\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut everytime i try to compile this I get syntax error at \"except\" and I am not sure why. It looks perfectly normal compared against all the tutorials that I could find.\u003c/p\u003e","answer_count":"4","comment_count":"6","creation_date":"2016-10-08 17:49:48.003 UTC","last_activity_date":"2016-10-09 06:39:53.263 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"943222","post_type_id":"1","score":"-2","tags":"python|exception","view_count":"411"} +{"id":"34138014","title":"INNER JOIN from the same table","body":"\u003cp\u003eI need to make a inner join of two queries in a mysql same table \"ride\":\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eid| appointment_address|arrival_city| arrival_country|departure_city|departure_country|end_date|nb_places|price|start_date|travel_id|rank \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe first query :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT DISTINCT travel_id FROM ride WHERE departure_city LIKE \u0026lt;value\u0026gt; AND start_date \u0026gt; \u0026lt;value\u0026gt; OR departure_country LIKE \u0026lt;value\u0026gt; AND start_date \u0026gt; \u0026lt;value\u0026gt;;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe second one\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT DISTINCT travel_id FROM ride WHERE arrival_city LIKE \u0026lt;value2\u0026gt; AND start_date \u0026gt; \u0026lt;value\u0026gt; OR departure_country LIKE \u0026lt;value2\u0026gt; AND start_date \u0026gt; \u0026lt;value\u0026gt;;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks for any help.\u003c/p\u003e","accepted_answer_id":"34138158","answer_count":"1","comment_count":"0","creation_date":"2015-12-07 16:07:26.8 UTC","last_activity_date":"2015-12-07 17:45:10.373 UTC","last_edit_date":"2015-12-07 17:45:10.373 UTC","last_editor_display_name":"","last_editor_user_id":"3673843","owner_display_name":"","owner_user_id":"3673843","post_type_id":"1","score":"1","tags":"sql|select|inner-join","view_count":"1177"} +{"id":"11102449","title":"How to find the correct OpenSSL EVP key length for DES3 encryption","body":"\u003cp\u003eI'm trying to implement a \u003ca href=\"http://en.wikipedia.org/wiki/Hybrid_cryptosystem\" rel=\"nofollow\"\u003ehybrid cryptosystem\u003c/a\u003e (\u003cstrong\u003eRSA\u003c/strong\u003e for key envelope, and \u003cstrong\u003eDES3 (with two-key option\u003c/strong\u003e) for data envelope). Thus, I'm trying first to implement DES3 with Openssl's \u003ccode\u003eEVP\u003c/code\u003e functions. Because it seems I can easily use EVP to combine RSA and DES3 encryption. \u003c/p\u003e\n\n\u003cp\u003eI've got this example code (changed data types to fix gcc warnings and put snippets in one file) from the Openssl book:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;stdio.h\u0026gt;\n#include \u0026lt;openssl/ssl.h\u0026gt;\n#include \u0026lt;openssl/evp.h\u0026gt;\n#include \u0026lt;openssl/rand.h\u0026gt;\n\nunsigned char *encrypt_example(EVP_CIPHER_CTX *ctx, unsigned char *data, int inl, int *rb);\nunsigned char *decrypt_example(EVP_CIPHER_CTX *ctx, unsigned char *ct, int inl);\nvoid select_random_key(unsigned char *key, int b);\nvoid select_random_iv(unsigned char *iv, int b);\nint seed_prng(int bytes);\n\n\nint main(int argc, char *argv[])\n{\n EVP_CIPHER_CTX ctx;\n EVP_CIPHER_CTX_init(\u0026amp;ctx);\n\n unsigned char key[EVP_MAX_KEY_LENGTH];\n unsigned char iv[EVP_MAX_IV_LENGTH];\n unsigned char *ct, *out;\n unsigned char final[EVP_MAX_BLOCK_LENGTH];\n unsigned char str[] = \"123456789abcdef\";\n int i = 0;\n\n if (!seed_prng(16))\n {\n printf(\"Fatal Error! Unable to seed the PRNG!\\n\");\n abort();\n }\n\n select_random_key(key, EVP_MAX_KEY_LENGTH);\n select_random_iv(iv, EVP_MAX_IV_LENGTH);\n\n\n /* EVP_des_ede3() :three-key DES3 with ECB\n * EVP_des_ede() :two-key DES3 with ECB\n * EVP_des_ede_cbc() :two-key DES3 with CBC \n * EVP_des_ede3_cbc() :three-key DES3 with CBC */\n\n EVP_EncryptInit(\u0026amp;ctx, EVP_des_ede_cbc(), key, NULL);\n ct = encrypt_example(\u0026amp;ctx, str, strlen((const char*)str), \u0026amp;i);\n printf(\"Ciphertext is %d bytes.\\n\", i);\n\n EVP_DecryptInit(\u0026amp;ctx, EVP_des_ede_cbc(), key, NULL);\n out = decrypt_example(\u0026amp;ctx, ct, 8);\n printf(\"Decrypted: \u0026gt;\u0026gt;%s\u0026lt;\u0026lt;\\n\", out);\n out = decrypt_example(\u0026amp;ctx, ct + 8, 8);\n printf(\"Decrypted: \u0026gt;\u0026gt;%s\u0026lt;\u0026lt;\\n\", out);\n\n if (!EVP_DecryptFinal(\u0026amp;ctx, final, \u0026amp;i))\n {\n printf(\"Padding incorrect.\\n\");\n abort();\n }\n\n final[i] = 0;\n printf(\"Decrypted: \u0026gt;\u0026gt;%s\u0026lt;\u0026lt;\\n\", final);\n return 0;\n}\n\nint seed_prng(int bytes)\n{\n if (!RAND_load_file(\"/dev/random\", bytes))\n return 0;\n return 1;\n}\n\nvoid select_random_key(unsigned char *key, int b)\n{\n int i;\n\n RAND_bytes(key, b);\n for (i = 0; i \u0026lt; b - 1; i++)\n printf(\"%02X:\",key[i]);\n printf(\"%02X\\n\\n\", key[b - 1]);\n}\n\nvoid select_random_iv (unsigned char *iv, int b)\n{\n RAND_pseudo_bytes (iv, b);\n}\n\nunsigned char *encrypt_example(EVP_CIPHER_CTX *ctx, unsigned char *data, int inl, int *rb)\n{\n unsigned char *ret = (unsigned char *)malloc(inl + EVP_CIPHER_CTX_block_size(ctx));\n int i, tmp, ol;\n\n ol = 0;\n for (i = 0; i \u0026lt; inl /100; i++)\n {\n EVP_EncryptUpdate(ctx, \u0026amp;ret[ol], \u0026amp;tmp, \u0026amp;data[ol], 100);\n ol += tmp;\n }\n\n if (inl % 100)\n {\n EVP_EncryptUpdate(ctx, \u0026amp;ret[ol], \u0026amp;tmp, \u0026amp;data[ol], inl%100);\n ol += tmp;\n }\n\n EVP_EncryptFinal(ctx, \u0026amp;ret[ol], \u0026amp;tmp);\n *rb = ol + tmp;\n return ret;\n}\n\nunsigned char *decrypt_example(EVP_CIPHER_CTX *ctx, unsigned char *ct, int inl)\n{\n\n /* We're going to null-terminate the plaintext under the assumption it's\n * non-null terminated ASCII text. The null can be ignored otherwise.\n */\n unsigned char *pt = (unsigned char *)malloc(inl + EVP_CIPHER_CTX_block_size(ctx) + 1);\n int ol;\n\n EVP_DecryptUpdate(ctx, pt, \u0026amp;ol, ct, inl);\n if (!ol) /* there's no block to decrypt */\n {\n free(pt);\n return NULL;\n }\n\n pt[ol] = 0;\n return pt;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm compiling it with this \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003egcc -g -O0 -Wall evp_encrypt_decrypt.c -o evp_encrypt_decrypt -lssl -lcrypto\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow if I execute this i get this output:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e13:98:EB:64:D5:8B:1E:0A:70:1D:28:9D:25:3A:13:40:FE:C1:81:3C:C5:8F:4B:F6:66:1A:07:F8:17:D6:10:B6:4E:BC:45:96:00:A1:9F:59:44:A0:43:D9:9D:DD:C8:A9:0B:22:EC:7B:F2:5F:78:01:D1:58:6D:0B:B4:CB:5F:CD \n\nCiphertext is 16 bytes.\nDecrypted: \u0026gt;\u0026gt;(null)\u0026lt;\u0026lt;\nDecrypted: \u0026gt;\u0026gt;12345678\u0026lt;\u0026lt;\nDecrypted: \u0026gt;\u0026gt;9abcdef\u0026lt;\u0026lt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere it says that the the chipertext is 16 bytes (which is ok). But the key itself(hex code printed above) is \u003cstrong\u003e64 bytes long!\u003c/strong\u003e \u003c/p\u003e\n\n\u003cp\u003eHowever, DES3 with two-key options should have key length with 128 bits (including parity bits). However the \u003cstrong\u003eEVP_MAX_KEY_LENGTH\u003c/strong\u003e definition is by default \u003cstrong\u003e64\u003c/strong\u003e. Also I've tried to print the chiper key length, the size of variable \u003ccode\u003ekey\u003c/code\u003e and the ctx key size as seen below:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprintf(\"Key length DES3: %d\\n\", EVP_CIPHER_key_length(EVP_des_ede3_cbc()));\nprintf(\"Key size: %d\\n\", sizeof(key));\nprintf(\"Cipher CTX key length: %d\\n\\n\", EVP_CIPHER_CTX_key_length(\u0026amp;ctx));\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis will output:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eKey length DES3: 24\nKey size: 64\nCipher CTX key length: 16\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm a little bit confused here. Shouldn't be the DES3(two-key) key size 128 bits? Why is the length of DES3 key printed as 24(is this bit,byte,etc..)? Why are all these key lengths and sizes different?\u003c/p\u003e","answer_count":"1","comment_count":"8","creation_date":"2012-06-19 13:51:01.99 UTC","last_activity_date":"2014-04-20 12:12:50.11 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"462233","post_type_id":"1","score":"1","tags":"encryption|openssl|rsa|des","view_count":"3309"} +{"id":"32313310","title":"Node hierarchy and inheritance","body":"\u003cp\u003eI made a scene graph hierarchy where each node has a parent and possibly children. I created this BaseNode class\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass BaseNode\n{\npublic:\n BaseNode(const char *nodeName, BaseNode *parent);\n ~BaseNode();\n\n BaseNode* addChildSceneNode(const char *name);\n void deleteChildSceneNode(const char *name);\n void deleteAllChildSceneNodes();\n\n BaseNode* findFirstSceneNode(const char *name);\n BaseNode* getChildSceneNode(const char *name);\n BaseNode* getChildSceneNode(unsigned int index);\n\n void setName(const char *name);\n void setTranformation(const glm::mat4 \u0026amp;transformation);\n\n unsigned int getNumChildren() const { return _children.size(); }\n const char *name() const { return _name.c_str(); }\n BaseNode* parent() const { return _parent; }\n const glm::mat4\u0026amp; transformation() const { return _transformation; }\n const glm::mat4\u0026amp; toRootTransformation() const { return _toRoot; }\n\nprotected:\n std::string _name;\n\n glm::mat4 _transformation;\n glm::mat4 _toRoot;\n\n BaseNode *_parent;\n std::vector\u0026lt;BaseNode*\u0026gt; _children;\n};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand I have this SceneNode class that inherits from BaseNode\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass SceneNode : public BaseNode\n{\npublic:\n SceneNode(const char *nodeName, SceneNode *parent);\n ~SceneNode();\n\n void attachRenderMeshData(RenderMeshData *renderMeshData);\n\n const std::vector\u0026lt;RenderMeshData*\u0026gt;* renderMeshDatas() { return \u0026amp;_meshDatas; }\n\nprivate:\n std::vector\u0026lt;RenderMeshData*\u0026gt; _meshDatas;\n};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow my question is about all the member functions that include a BaseNode* parameter.\u003c/p\u003e\n\n\u003cp\u003eAt the moment, when working with SceneNode objects, I have to explicitly cast BaseNode* to SceneNode* as follows\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSceneNode *mySceneNode = new SceneNode(\"root\", nullptr);\nmySceneNode-\u0026gt;addChildSceneNode(\"my child\");\nSceneNode *child = reinterpret_cast\u0026lt;SceneNode*\u0026gt;(mySceneNode-\u0026gt;getChildSceneNode(\"my child\")); //i thought this should be dynamic_cast but the compiler throws an error.. weird\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy goal is to have \"many types\" of BaseNode, so I won't have to rewrite its parent/children functionality every time.\u003c/p\u003e\n\n\u003cp\u003eAny idea how I can do this better?\u003c/p\u003e","answer_count":"1","comment_count":"22","creation_date":"2015-08-31 14:10:44.473 UTC","last_activity_date":"2015-08-31 15:47:12.367 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4266765","post_type_id":"1","score":"0","tags":"c++|oop|inheritance|polymorphism","view_count":"223"} +{"id":"33461429","title":"Cloning Git repository into existing Xcode project","body":"\u003cp\u003eI am a complete newbie in using GitHub and I want to use the SWXMLHash library found here: \u003ca href=\"https://github.com/drmohundro/swxmlhash\" rel=\"nofollow\"\u003ehttps://github.com/drmohundro/swxmlhash\u003c/a\u003e . There is a part where author talks about \"manual\" installation which I don't understand. I have already made my project with some code. I would be very greatful if someone would make a step-by-step list of what to do to use this library in my project. Thank you!\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2015-11-01 10:56:36.14 UTC","favorite_count":"0","last_activity_date":"2015-11-01 10:56:36.14 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4420197","post_type_id":"1","score":"0","tags":"xml|xcode|git|github","view_count":"42"} +{"id":"44068074","title":"How to Call this Method from OnCreate - Android C# Xamarin","body":"\u003cp\u003eI am wondering how I am meant to Call \u003ccode\u003epublic static async Task CopyAssetAsync(Activity activity)\u003c/code\u003e from the OnCreate method.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public static async Task CopyAssetAsync(Activity activity)\n {\n {\n var notesPath = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), \"NotesData.txt\");\n\n if (!File.Exists(notesPath))\n {\n try\n {\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eUPDATE 1:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprotected override void OnCreate(Bundle bundle)\n {\n base.OnCreate(bundle);\n\n // Set our view from the \"main\" layout resource\n SetContentView(Resource.Layout.Main);\n ActionBar.Hide();\n\n btnAdd = FindViewById\u0026lt;Button\u0026gt;(Resource.Id.btnAdd);\n //Notes\n notesList = FindViewById\u0026lt;ListView\u0026gt;(Resource.Id.lvNotes);\n\n\n //Where I am trying to call the method...\n CopyAssetAsync();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eUPDATE 2:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/PPslF.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/PPslF.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"44068860","answer_count":"1","comment_count":"3","creation_date":"2017-05-19 10:46:38.973 UTC","last_activity_date":"2017-05-19 16:09:14.233 UTC","last_edit_date":"2017-05-19 16:09:14.233 UTC","last_editor_display_name":"","last_editor_user_id":"3421104","owner_display_name":"","owner_user_id":"5225526","post_type_id":"1","score":"0","tags":"c#|xamarin.android","view_count":"146"} +{"id":"32372394","title":"WordPress Timing Out","body":"\u003cp\u003eCurrently I am receiving the following error whenever I attempt to bulk update posts. This is even happening with just 5 posts at once and with little or no ouside server requests. Any ideas on how to resolve?\u003c/p\u003e\n\n\u003cp\u003e\"The server is temporarily unable to service your request due to maintenance downtime or capacity problems.\"\u003c/p\u003e\n\n\u003cp\u003eServer: Digital Ocean\u003c/p\u003e\n\n\u003cp\u003e2GB Ram 40GB SSD Disk CentOS 7 x64\u003c/p\u003e\n\n\u003cp\u003ePHP 5.4.16 / Memory Limit is 128M.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-09-03 09:52:58.483 UTC","last_activity_date":"2015-09-03 09:56:11.263 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"916008","post_type_id":"1","score":"0","tags":"php|wordpress|centos","view_count":"41"} +{"id":"42670166","title":"For the Image element, the transformation is not happening","body":"\u003cp\u003eMy Input xml is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;Body\u0026gt;\n\u0026lt;p\u0026gt;\u0026lt;img src=\"https://tneb.com\"/\u0026gt;\u0026lt;/p\u0026gt;\n\u0026lt;h1\u0026gt;Taking\u0026lt;/h1\u0026gt;\n\u0026lt;p\u0026gt;Your records.\u0026lt;/p\u0026gt;\n\u0026lt;h2\u0026gt;Blood Pressure?\u0026lt;/h2\u0026gt;\n\u0026lt;p\u0026gt;second.\u0026lt;/p\u0026gt;\n\u0026lt;/Body\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eXSL I used as:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;xsl:template match=\"Body\"\u0026gt;\n \u0026lt;xsl:for-each-group select=\"*\" group-starting-with=\"h1\"\u0026gt;\n \u0026lt;topic\u0026gt;\n \u0026lt;xsl:attribute name=\"id\"\u0026gt;topic_\u0026lt;xsl:number count=\"h1 | h2\"/\u0026gt;\u0026lt;/xsl:attribute\u0026gt;\n \u0026lt;title\u0026gt;\n \u0026lt;xsl:apply-templates select=\"node()\"/\u0026gt;\n \u0026lt;/title\u0026gt;\n\n \u0026lt;xsl:for-each-group select=\"current-group() except .\" group-starting-with=\"h2\"\u0026gt;\n \u0026lt;xsl:choose\u0026gt;\n \u0026lt;xsl:when test=\"self::h2\"\u0026gt;\n \u0026lt;topic\u0026gt;\n \u0026lt;xsl:attribute name=\"id\"\u0026gt;topic_\u0026lt;xsl:number count=\"h1 | h2\"/\u0026gt;\u0026lt;/xsl:attribute\u0026gt;\n \u0026lt;title\u0026gt;\n \u0026lt;xsl:apply-templates select=\"node()\"/\u0026gt;\n \u0026lt;/title\u0026gt;\n \u0026lt;body\u0026gt;\u0026lt;xsl:apply-templates select=\"current-group() except .\"/\u0026gt;\u0026lt;/body\u0026gt;\n \u0026lt;/topic\u0026gt;\n \u0026lt;/xsl:when\u0026gt;\n \u0026lt;xsl:otherwise\u0026gt;\n \u0026lt;body\u0026gt;\u0026lt;xsl:apply-templates select=\"current-group()\"/\u0026gt;\u0026lt;/body\u0026gt;\n \u0026lt;/xsl:otherwise\u0026gt;\n \u0026lt;/xsl:choose\u0026gt;\n \u0026lt;/xsl:for-each-group\u0026gt;\n \u0026lt;/topic\u0026gt;\n \u0026lt;/xsl:for-each-group\u0026gt;\n \u0026lt;/xsl:template\u0026gt;\n\n \u0026lt;xsl:template match=\"p\"\u0026gt;\n \u0026lt;p\u0026gt;\u0026lt;xsl:apply-templates/\u0026gt;\u0026lt;/p\u0026gt;\n \u0026lt;/xsl:template\u0026gt;\n\n \u0026lt;xsl:template match=\"img\"\u0026gt;\n \u0026lt;xsl:element name=\"image\"\u0026gt;\n \u0026lt;xsl:if test=\"@src\"\u0026gt;\n \u0026lt;xsl:attribute name=\"href\"\u0026gt;\u0026lt;xsl:apply-templates select=\"@src\"/\u0026gt;\u0026lt;/xsl:attribute\u0026gt;\n \u0026lt;/xsl:if\u0026gt;\n \u0026lt;/xsl:element\u0026gt;\n \u0026lt;/xsl:template\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm getting output as:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;topic id=\"topic_\"\u0026gt;\n \u0026lt;title\u0026gt;\n \u0026lt;image href=\"https://tneb.com\"/\u0026gt;\n \u0026lt;/title\u0026gt;\n\u0026lt;/topic\u0026gt;\n\u0026lt;topic id=\"topic_1\"\u0026gt;\n \u0026lt;title\u0026gt;Taking\u0026lt;/title\u0026gt;\n \u0026lt;body\u0026gt;\n \u0026lt;p\u0026gt;Your records.\u0026lt;/p\u0026gt;\n \u0026lt;/body\u0026gt;\n \u0026lt;topic id=\"topic_2\"\u0026gt;\n \u0026lt;title\u0026gt;Blood Pressure?\u0026lt;/title\u0026gt;\n \u0026lt;body\u0026gt;\n \u0026lt;p\u0026gt;second.\u0026lt;/p\u0026gt;\n \u0026lt;/body\u0026gt;\n \u0026lt;/topic\u0026gt;\n\u0026lt;/topic\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eExpected output would be:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;topic id=\"topic_1\"\u0026gt;\n \u0026lt;title\u0026gt;Taking\u0026lt;/title\u0026gt;\n \u0026lt;body\u0026gt;\n \u0026lt;p\u0026gt;\u0026lt;image href=\"https://tneb.com\"/\u0026gt;\u0026lt;/p\u0026gt;\n \u0026lt;p\u0026gt;Your records.\u0026lt;/p\u0026gt;\n \u0026lt;/body\u0026gt;\n \u0026lt;topic id=\"topic_2\"\u0026gt;\n \u0026lt;title\u0026gt;Blood Pressure?\u0026lt;/title\u0026gt;\n \u0026lt;body\u0026gt;\n \u0026lt;p\u0026gt;second.\u0026lt;/p\u0026gt;\n \u0026lt;/body\u0026gt;\n \u0026lt;/topic\u0026gt;\n\u0026lt;/topic\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhile using the image, its coming as seperate topic. But i need to come by para tag inside the h1 topic. Please provide the suggestion codes. Thanks in advance\u003c/p\u003e","accepted_answer_id":"42671675","answer_count":"1","comment_count":"0","creation_date":"2017-03-08 11:31:17.703 UTC","last_activity_date":"2017-03-08 12:41:09.48 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7124772","post_type_id":"1","score":"0","tags":"xml|xslt|xslt-2.0","view_count":"27"} +{"id":"27066343","title":"How to have angular controller respond to a variable's value change event","body":"\u003cp\u003eI am building an application where I have several controllers controlling various parts of the page. I would like for them to respond to specific model change events. For example when $scope.Variable has a change of value, I would like for controller A to run a certain method etc.\u003c/p\u003e\n\n\u003cp\u003eHow do I respond to model change events with controllers in angular?\u003c/p\u003e","accepted_answer_id":"27066581","answer_count":"1","comment_count":"1","creation_date":"2014-11-21 16:49:49.47 UTC","last_activity_date":"2014-11-21 17:03:03.127 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4162681","post_type_id":"1","score":"0","tags":"javascript|angularjs","view_count":"41"} +{"id":"42579157","title":"SQL calculated column based on other calculated column","body":"\u003cp\u003eI have a table with a list of invoices, In one query I calculate the invoice due date based on the terms of the invoice (7days/30 days etc)\u003c/p\u003e\n\n\u003cp\u003eI have following layout:\u003c/p\u003e\n\n\u003cp\u003eInvoiceNr | InvoiceDate | InvoiceDueDate\u003c/p\u003e\n\n\u003cp\u003eI want to add now an extra column to put the invoice in an ageing bucket based on the current date. for example:\u003c/p\u003e\n\n\u003cp\u003eInvoiceNr | InvoiceDate | InvoiceDueDate | ageing\u003c/p\u003e\n\n\u003cp\u003eBut it seems that I cannot create that extra column based on the InvoiceDueDate column because thats already a combined column. So question how can I create a query which can and calculate the duedate, and calculate the ageing of that invoice.\u003c/p\u003e\n\n\u003cp\u003eThe base invoice table looks likes this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCustomer Name InvoiceTerms Description Invoice InvoiceDate Value InvoiceBal1\n 0000 CASH A/C 00 CASH ONLY ACCOUNT 000000000050033 2015-11-06 0.00 0.00\n 0000 CASH A/C 00 CASH ONLY ACCOUNT 000000000050034 2015-11-06 550.00 0.00\n 0000 CASH A/C 00 CASH ONLY ACCOUNT 000000000050037 2015-11-09 362.18 0.00\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWith following query, I add the invoice due dates\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e SELECT dbo.ArInvoice.Customer, dbo.ArCustomer.Name, dbo.ArCustomer.CustomerOnHold, dbo.ArCustomer.CreditStatus, dbo.ArCustomer.TermsCode AS CustomerTerms, \n dbo.ArInvoice.TermsCode AS InvoiceTerms, dbo.TblArTerms.Description, dbo.ArInvoice.Invoice, CAST(dbo.ArInvoice.InvoiceDate AS date) AS InvoiceDate, \n CAST(CASE ArInvoice.TermsCode WHEN '00' THEN CAST(dbo.ArInvoice.InvoiceDate AS date) WHEN '22' THEN dateadd(month, datediff(month, 0, DateAdd(month, MONTH(InvoiceDate), DateAdd(Year,\n YEAR(InvoiceDate) - 1900, 0) + 1)), 0) - 1 WHEN '24' THEN dateadd(month, datediff(month, 0, DateAdd(month, MONTH(InvoiceDate) + 1, DateAdd(Year, YEAR(InvoiceDate) - 1900, 0) + 1)), 0) \n - 1 WHEN '28' THEN dateadd(month, datediff(month, 0, DateAdd(month, MONTH(InvoiceDate) + 2, DateAdd(Year, YEAR(InvoiceDate) - 1900, 0) + 1)), 0) \n - 1 ELSE InvoiceDate + TblArTerms.DueDays + TblArTerms.InvDayOfMonth END AS date) AS InvoiceDueDate, dbo.ArInvoice.CurrencyValue, dbo.ArInvoice.InvoiceBal1\nFROM dbo.ArCustomer INNER JOIN\n dbo.ArInvoice ON dbo.ArCustomer.Customer = dbo.ArInvoice.Customer INNER JOIN\n dbo.TblArTerms ON dbo.ArInvoice.TermsCode = dbo.TblArTerms.TermsCode\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhich gives me\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCustomer Name InvoiceTerms Description Invoice InvoiceDate DueDate Value InvoiceBal1\n 0000 CASH A/C 00 CASH ONLY ACCOUNT 000000000050033 2015-11-06 2015-11-06 0.00 0.00\n 0000 CASH A/C 00 CASH ONLY ACCOUNT 000000000050034 2015-11-06 2015-11-06 550.00 0.00\n 0000 CASH A/C 00 CASH ONLY ACCOUNT 000000000050037 2015-11-09 2015-11-09 362.18 0.00\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo what I now need is an extra column which takes the invoiceDueDate,\nchecks if the difference between getdate() and the invoice days is bigger then 30 then it should say overdue.\u003c/p\u003e\n\n\u003cp\u003eFor example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCustomer Name InvoiceTerms Description Invoice InvoiceDate DueDate Value InvoiceBal1 Ageing\n 0000 CASH A/C 00 CASH ONLY ACCOUNT 000000000050033 2015-11-06 2015-11-06 0.00 0.00 OVERDUE\n 0000 CASH A/C 00 CASH ONLY ACCOUNT 000000000050034 2015-11-06 2015-11-06 550.00 0.00 OVERDUE\n 0000 CASH A/C 00 CASH ONLY ACCOUNT 000000000050037 2015-11-09 2015-11-09 362.18 0.00 OVERDUE\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCurrently the only way I can find is creating two views.\nFirst one with the invoiceduedate and then a second one with the ageing.\nbut that feels a bit overkill? So trying to find a way to do it all in one query?\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2017-03-03 12:41:00.87 UTC","last_activity_date":"2017-03-03 12:41:00.87 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2416016","post_type_id":"1","score":"0","tags":"sql|sql-server-2008-r2","view_count":"30"} +{"id":"43509220","title":"QtWidgets.QFileDialog.getOpenFileName returns a Tuple","body":"\u003cp\u003eI've recently updated to the new version of Qt5 for Python. In doing so, I've been having to alter my code in accordance to some of the notable changes that have occurred. I wanted to get some insight into this line of code that I've created. It feels like a dirty way of solving the problem of getting a \u003ccode\u003estring\u003c/code\u003e instead of a \u003ccode\u003etuple\u003c/code\u003e from the function. (Note the \u003ccode\u003e[0]\u003c/code\u003e at the end of the line)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efilename = QtWidgets.QFileDialog.getOpenFileName(None, \"Open \" + key + \" Data File\", '.', \"(*.csv)\")[0]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want \u003ccode\u003efilename = {str}'C:/.././.../format.csv'\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003enot \u003ccode\u003efilename = \u0026lt;class 'tuple'\u0026gt;: ('C:/.././.../format.csv', '(*.csv)')\u003c/code\u003e\u003c/p\u003e","accepted_answer_id":"43509281","answer_count":"1","comment_count":"4","creation_date":"2017-04-20 02:34:41.187 UTC","last_activity_date":"2017-04-20 03:46:12.853 UTC","last_edit_date":"2017-04-20 03:46:12.853 UTC","last_editor_display_name":"","last_editor_user_id":"6622587","owner_display_name":"","owner_user_id":"3612634","post_type_id":"1","score":"1","tags":"python|pyqt|qt5|pyqt5|qtwidgets","view_count":"425"} +{"id":"37730929","title":"Uniqueness Validation on has_many association records via accepts_nested_attributes_for","body":"\u003cp\u003eHere are my \u003cstrong\u003eModels\u003c/strong\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass User \u0026lt; ApplicationRecord\n has_many :cities_users, inverse_of: :user\n has_many :cities, through: :cities_users\n\n accepts_nested_attributes_for :cities_users\nend\n\n\nclass CitiesUser \u0026lt; ApplicationRecord\n belongs_to :user\n belongs_to :city\n\n validates :user_id, uniqueness: { scope: :city_id, message: \"already specified that they have lived in this city\"}\nend\n\n\nclass City \u0026lt; ApplicationRecord\n has_many :cities_users\n has_many :users, through: :cities_users\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhile creating a new \u003ccode\u003euser\u003c/code\u003e record: The user can dynamically add cities that they have lived in (via the \u003ca href=\"https://rubygems.org/gems/nested_form_fields\" rel=\"nofollow noreferrer\"\u003enested_form_fields\u003c/a\u003e gem ). This ultimately creates records on the join table of \u003ccode\u003ecities_users\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/zuChC.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/zuChC.png\" alt=\"clicking button\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eAfter clicking the 'Add a city you have lived in' button:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/dYiMy.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/dYiMy.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eUser then goes and clicks the button again to add another city:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/7dMBc.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/7dMBc.png\" alt=\"click button again\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThat situation above is where I want a validation error to trigger when the user clicks the \u003ccode\u003eCreate User\u003c/code\u003e button. When creating a new user record: a user should NOT specify that they lived in the same city more than one time. \u003c/p\u003e\n\n\u003cp\u003eSo above: without a validation: \u003cstrong\u003etwo\u003c/strong\u003e \u003ccode\u003ecities_users\u003c/code\u003e records would be created with the same \u003ccode\u003euser_id\u003c/code\u003e and \u003ccode\u003ecity_id\u003c/code\u003e. This is no good, so I want to re-render the form, highlight the two offending \u003ccode\u003ecities_users\u003c/code\u003e nested_fields and have an error message say something like \"You cannot specify that the user has lived in the same city more than once\". \u003c/p\u003e\n\n\u003cp\u003eClearly this requires a validation either on the \u003ccode\u003euser\u003c/code\u003e model or the \u003ccode\u003ecities_user\u003c/code\u003e model. I do not know where the validation should go, and I do not know how to code the validation so that it catches this error. The current \u003ccode\u003euniqueness\u003c/code\u003e validation I have on the \u003ccode\u003eCitiesUser\u003c/code\u003e model does not catch this situation.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eExtra setup information just in case someone wants to recreate the scenario\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eThis was how I set up the nested_fields within the user \u003ccode\u003e_form.html.erb\u003c/code\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;%= f.nested_fields_for :cities_users do |ff| %\u0026gt;\n\n\u0026lt;div\u0026gt;\n \u0026lt;%= ff.label :city_id %\u0026gt;\n \u0026lt;%= ff.collection_select(:city_id, City.all, :id, :name) %\u0026gt;\n\u0026lt;/div\u0026gt;\n\n\u0026lt;% end %\u0026gt;\n\n\u0026lt;br\u0026gt;\n\n\u0026lt;div\u0026gt;\u0026lt;%= f.add_nested_fields_link :cities_users, \"Add a City You have lived in\" %\u0026gt;\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe \u003ccode\u003eusers_controller#create\u003c/code\u003e action is standard, generated from the \u003ccode\u003escaffold\u003c/code\u003e command. I did add to the strong params in order to allow for the nested attributes: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef user_params\n params.require(:user).permit(:name, cities_users_attributes: [:id, :city_id, :user_id])\nend\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"37802418","answer_count":"3","comment_count":"0","creation_date":"2016-06-09 15:57:31.113 UTC","last_activity_date":"2016-06-14 03:24:06.947 UTC","last_edit_date":"2016-06-14 03:24:06.947 UTC","last_editor_display_name":"","last_editor_user_id":"4044009","owner_display_name":"","owner_user_id":"4044009","post_type_id":"1","score":"1","tags":"ruby-on-rails|ruby","view_count":"156"} +{"id":"25123716","title":"Uncaught TypeError: Cannot use 'in' operator to search for '0' in (jQuery)","body":"\u003cp\u003eI feel like this has to do with the AJAX call. Not really sure what is going on. The error is technically being thrown within the jQuery file at line 584 which defines the \u003ccode\u003eisArraylike(obj)\u003c/code\u003e function. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ejQuery(document).ready(function(){\n var width_of_grams = $(window).width();\n var new_pic_height = (width_of_grams /7);\n $(\"img.gram_photo\").css('height', (width_of_grams) / 7);\n $(\"#instafeed\").css('height', 2*new_pic_height);\n\n $(window).resize(function() { \n var width_of_grams = $(window).width();\n var new_pic_height = (width_of_grams /7);\n $(\"img.gram_photo\").css('height', (width_of_grams) / 7);\n $(\"#instafeed\").css('height', 2*new_pic_height);\n });\n\n\n $(\"#school_application_fls_center_name\").change(function(){\n var center_name = document.getElementById(\"school_application_fls_center_name\").value;\n var formdata = {center: center_name}; \n $.ajax({\n url: \"/application/get_programs_for_center\",\n type: \"POST\",\n data: formdata,\n success: function(response){\n var options = $(\"#school_application_program_name\"); \n console.log(response);\n $.each(response, function(i,item) {\n options.append($(\"\u0026lt;option /\u0026gt;\").val(response[i].id).text(response[i].name)); \n });\n }\n });\n });\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is the jQuery library code that throws the error: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction isArraylike( obj ) {\n var length = obj.length,\n type = jQuery.type( obj );\n\n if ( type === \"function\" || jQuery.isWindow( obj ) ) {\n return false;\n } \n\n if ( obj.nodeType === 1 \u0026amp;\u0026amp; length ) {\n return true;\n }\n\n return type === \"array\" || length === 0 ||\n typeof length === \"number\" \u0026amp;\u0026amp; length \u0026gt; 0 \u0026amp;\u0026amp; ( length - 1 ) in obj; //THIS LINE THROWS ERROR\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eN.B. When I remove all of the callback function in the success part of the AJAX request,\n and just put a \u003ccode\u003econsole.log\u003c/code\u003e to confirm I am making it to the callback successfully it prints\n my log message and does not throw the error. \u003c/p\u003e","answer_count":"2","comment_count":"8","creation_date":"2014-08-04 16:53:19.09 UTC","favorite_count":"1","last_activity_date":"2014-08-04 21:53:34.76 UTC","last_edit_date":"2014-08-04 17:32:10.577 UTC","last_editor_display_name":"","last_editor_user_id":"2276081","owner_display_name":"","owner_user_id":"2276081","post_type_id":"1","score":"5","tags":"javascript|jquery","view_count":"17839"} +{"id":"28986911","title":"Outlook auto replacing links with anchor","body":"\u003cp\u003eIn my email template I have an import to use a web font:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@import url(\"http://fonts.googleapis.com/css?family=Open+Sans+Condensed:300\");\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOutlook is replacing the url content with a anchor:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@import url(\"\u0026lt;a href=\"http: //fonts.googleapis.com/css?family=Open+Sans+Condensed:300\" class=\"\"\u0026gt;http://fonts.googleapis.com/css?family=Open+Sans+Condensed:300\u0026lt;/a\u0026gt;\");\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI tried instead but same result, what is missing?\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","accepted_answer_id":"29012636","answer_count":"2","comment_count":"0","creation_date":"2015-03-11 12:42:30.967 UTC","last_activity_date":"2015-03-12 14:36:07.353 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2750721","post_type_id":"1","score":"0","tags":"outlook|html-email","view_count":"117"} +{"id":"6377219","title":"How to rewrite my url?","body":"\u003cp\u003eHy!\u003c/p\u003e\n\n\u003cp\u003eI'm developing a web site and have a small problem with \u003ccode\u003e.htaccess\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eProblem:\nhow to rewrite urls?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eFrom: http://www.mysite.com/index.php?page=about \nTo: http://www.mysite.com/about/\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eFrom: http://www.mysite.com/index.php?page=stuff\u0026amp;catId=1\nTo: http://www.mysite.com/stuff/1/\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eFrom: http://www.mysite.com/index.php?page=stuff\u0026amp;catId=1#someAnchor\nTo: http://www.mysite.com/stuff/1/#someAnchor\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCurrently I'm doing this but it doesn't work! :(\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;IfModule mod_rewrite.c\u0026gt;\nOptions +FollowSymlinks\nRewriteEngine on\nRewriteRule ^page/([^/\\.]+)/?$ index.php?page=$1 [L]\nRewriteRule ^page/([^/.]+)/([^/.]+)/?$ index.php?page=$1\u0026amp;catId=$2 [L]\n\u0026lt;/IfModule\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ePlease help.\nThanks in advance, Silvano.\u003c/p\u003e","accepted_answer_id":"6383573","answer_count":"3","comment_count":"2","creation_date":"2011-06-16 19:08:45.107 UTC","favorite_count":"1","last_activity_date":"2011-06-17 14:16:38.247 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"776604","post_type_id":"1","score":"1","tags":"apache|.htaccess|url-rewriting","view_count":"131"} +{"id":"19687551","title":"WPF Itemscontrol datatemplate property changing","body":"\u003cp\u003eI'm currently using the following itemscontrol and datatemplate:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;UserControl.Resources\u0026gt;\n \u0026lt;DataTemplate x:Key=\"OrdersTemplate\"\u0026gt;\n \u0026lt;dxlc:LayoutItem Label=\"CustomerReference\" LabelPosition=\"Top\" MaxWidth=\"300\" HorizontalAlignment=\"Left\" Width=\"300\"\u0026gt;\n \u0026lt;dxe:TextEdit IsEnabled=\"True\" Text=\"{Binding Path=CustomerReference}\" /\u0026gt;\n \u0026lt;/dxlc:LayoutItem\u0026gt;\n \u0026lt;/DataTemplate\u0026gt;\n\u0026lt;/UserControl.Resources\u0026gt;\n\n\u0026lt;HeaderedContentControl Header=\"Steps\"\u0026gt;\n \u0026lt;ItemsControl ItemsSource=\"{Binding Orders}\" ItemTemplate=\"{StaticResource OrdersTemplate}\"/\u0026gt;\n\u0026lt;/HeaderedContentControl\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe source is just a list with entities.\u003c/p\u003e\n\n\u003cp\u003eThe problem is that the \"CustomerReference\" of every object from my source changes when I change it in the textbox. Whats missing here?\u003c/p\u003e\n\n\u003cp\u003eGreets\u003c/p\u003e","accepted_answer_id":"19687988","answer_count":"1","comment_count":"2","creation_date":"2013-10-30 15:48:24.527 UTC","last_activity_date":"2013-10-30 16:07:12.7 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2675175","post_type_id":"1","score":"1","tags":"wpf|datatemplate|itemscontrol","view_count":"110"} +{"id":"28628131","title":"Too many cartesian products, making query to run slower","body":"\u003cp\u003eConsider I have two tables DETAILS AND RATE with following columns:\u003c/p\u003e\n\n\u003cp\u003eDETAILS table:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCREATE TABLE DETAILS(\nLONG ID PRIMARY KEY AUTO_INCREMENT,\nDOUBLE PRICE1,\nDOUBLE PRICE2,\nDOUBLE PRICE3,\nVARCHAR(25) CURRENCY,\nDATE CREATED_DATE,\nVARCHAT(50) COMPLETED\n..................\nFew more columns\n);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eRATE TABLE:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCREATE TABLE RATE(\nLONG ID PRIMARY KEY AUTO_INCREMENT,\nDOUBLE RATE,\nVARCHAR(25) CURRENCY,\nDATE CREATED_DATE\n..................\nFew more columns\n);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd I have a update query for DETAILS table as shown bellow.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eUPDATE DETAILS D, RATE R \nSET D.PRICE1=D.PRICE1*R.RATE,\nD.PRICE2=D.PRICE2*R.RATE,\nD.PRICE3=D.PRICE3*R.RATE\nWHERE\nD.CURRENCY=R.CURRENCY AND \nDATE(D.CREATED_DATE) = DATE(R.CREATED_DATE) AND\nD.COMPLETED IS NULL OR DO.COMPLETED='ABC' AND\nD.CURRENCY!='RUPEE';\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBefore the query was working fine but as table grown this query is started taking more time and it is giving cartesion product in terms of \u003cstrong\u003ebillions\u003c/strong\u003e.\u003c/p\u003e\n\n\u003cp\u003eIs there any way I can optimise this query?\nAny help will be greatly appriciated.\u003c/p\u003e","answer_count":"2","comment_count":"4","creation_date":"2015-02-20 11:41:17.637 UTC","last_activity_date":"2015-03-05 04:39:32.44 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2823355","post_type_id":"1","score":"0","tags":"mysql|query-optimization|cartesian-product","view_count":"63"} +{"id":"20891887","title":"Haskell: Algebraic types error (Suffix trees: recursion)","body":"\u003cp\u003eWorking on a function that given a SuffixTree as input, outputs the list of integers in that suffix tree. For example. getIndices tree1 = [2,4,1,3,5,0] . The order of the list of integers does not matter. I am getting the error, on the second last line of the function: \"\u003ccode\u003eCouldn't match expected type 'SuffixTree' with actual type '[SuffixTree]'\u003c/code\u003e\". I have thought about this for a long time now and have had no luck. Any help would be greatly appreciated.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edata SuffixTree = Leaf Int | Node [ ( String, SuffixTree ) ] \n deriving (Eq,Ord,Show)\n\ntext1 :: String\ntext1 = \"banana\"\n\ntree1 :: SuffixTree\ntree1 = Node [(\"banana\",Leaf 0),\n (\"a\",Node [(\"\",Leaf 5),\n (\"na\",Node [(\"\",Leaf 3),\n (\"na\",Leaf 1)])]),\n (\"na\",Node [(\"\",Leaf 4),\n (\"na\",Leaf 2)])]\n\n------------------------------------------------------------------\n\ngetIndices :: SuffixTree -\u0026gt; [ Int ]\ngetIndices sufTree = getIndices' sufTree [] \n where getIndices' :: SuffixTree -\u0026gt; [Int] -\u0026gt; [Int]\n getIndices' (Node ((_, Node xs):ys)) c \n | Node xs == Node [] = c\n | otherwise = getIndices' ((Node xs):([Node ys])) c\n getIndices' (Node ((_,Leaf i):xs)) c = getIndices' (Node xs) (i:c)\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-01-02 21:07:17.337 UTC","last_activity_date":"2014-01-02 22:02:25.473 UTC","last_edit_date":"2014-01-02 21:35:51.59 UTC","last_editor_display_name":"","last_editor_user_id":"3155096","owner_display_name":"","owner_user_id":"3155096","post_type_id":"1","score":"1","tags":"haskell|recursion|types|string-matching|suffix-tree","view_count":"186"} +{"id":"40142168","title":"Left Associativity vs Left Recursion","body":"\u003cp\u003eI'm trying to write a compiler for C (simpler grammar though). \u003c/p\u003e\n\n\u003cp\u003eThere is something that I've been stuck on for a while. If I understated correctly, all binary operations are left associative. So if we have we \"x+y+z\", x+y occurs first and then followed by plus z. \u003c/p\u003e\n\n\u003cp\u003eHowever, doesn't enforcing left associativity causes infinite left recursion?\u003c/p\u003e\n\n\u003cp\u003eSo far all solutions that I've checked are either left associative or don't have left recursion, but not \u003cstrong\u003eboth\u003c/strong\u003e. Is it possible to have a grammar that have both of these properties. Is it even possible?\u003c/p\u003e\n\n\u003cp\u003eExample: \u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eLeft Associative:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eExpr = Term | Expr + Term\nTerm = Element | Term ∗ Element\nElement = x|y|z|(Expr)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eLeft Recursion Eliminated:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eExpr = Term ExprTail\nExprTail = epsilon | + Term ExprTail\n\nTerm = Element TermTail\nTermTail = epsilon | * Element TermTail\n\nElement = x|y|z|(Expr)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny ideas?\u003c/p\u003e","accepted_answer_id":"40144216","answer_count":"1","comment_count":"3","creation_date":"2016-10-19 21:56:44.97 UTC","last_activity_date":"2016-10-20 01:54:45.483 UTC","last_edit_date":"2016-10-19 23:06:01.097 UTC","last_editor_display_name":"","last_editor_user_id":"5734818","owner_display_name":"","owner_user_id":"5734818","post_type_id":"1","score":"3","tags":"parsing|compiler-construction|grammar|left-recursion","view_count":"464"} +{"id":"9791847","title":"LDAP how to modify attribute _name_","body":"\u003cp\u003eI need to update for some thousand entries the name of an LDAP attribute, eg. \n\u003ccode\u003ecn=myentry,ou=people,o=mycompany\u003c/code\u003e has an attribute like \u003ccode\u003esurname\u003c/code\u003e and it shall be renamed to \u003ccode\u003elastname\u003c/code\u003e and preserve the value.\u003c/p\u003e\n\n\u003cp\u003eAny clue how to achieve this with ldiff-commands?\nJust to be clear I don't want to rename the rdn but the attribute name.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2012-03-20 17:25:21.15 UTC","last_activity_date":"2015-11-24 15:30:45.933 UTC","last_edit_date":"2015-11-24 15:30:45.933 UTC","last_editor_display_name":"","last_editor_user_id":"3885376","owner_display_name":"","owner_user_id":"1281561","post_type_id":"1","score":"1","tags":"ldap|ldif","view_count":"600"} +{"id":"8279803","title":"Adding an array of UIButtons to navigationItem.rightBarButtonItem results in NSInvalidArgumentException","body":"\u003cp\u003eI am trying to add an array of 2 buttons to the right of a navigation bar, but I get a exception when I run the code.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003e'NSInvalidArgumentException', reason: '-[UIButton isSystemItem]: unrecognized selector sent to instance\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eMy code is pretty simple really:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e UILabel * label = [[UILabel alloc] initWithFrame:CGRectMake(0,0,100,45)];\n label.backgroundColor=[UIColor clearColor];\n label.text = @\"Test 2 Buttons\";\n\n UIButton *button1 = [UIButton buttonWithType:UIButtonTypeCustom];\n button1.frame = CGRectMake(00.0f, 0.0f, 32.0f, 32.0f);\n\n UIButton *button2 = [UIButton buttonWithType:UIButtonTypeCustom];\n button2.frame = CGRectMake(00.0f, 0.0f, 32.0f, 32.0f);\n\n NSArray *rightBarButtons = [[NSArray alloc] initWithObjects:button2, button1, nil];\n\n\n UINavigationItem* navItem = self.navigationItem;\n navItem.titleView = label;\n navItem.rightBarButtonItems = rightBarButtons;\n [rightBarButtons release];\n [label release];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am running it on the iPhone 5.0 simulator.\nAny idea??\nThanks in advance.\nAl\u003c/p\u003e","accepted_answer_id":"8279862","answer_count":"3","comment_count":"0","creation_date":"2011-11-26 16:23:36.657 UTC","favorite_count":"1","last_activity_date":"2014-01-24 16:17:53.75 UTC","last_edit_date":"2014-01-24 16:17:53.75 UTC","last_editor_display_name":"","last_editor_user_id":"338382","owner_display_name":"","owner_user_id":"201191","post_type_id":"1","score":"12","tags":"iphone|xcode|cocoa-touch","view_count":"6157"} +{"id":"1359931","title":"Telerik RadControls + JetBrains Resharper = VERY SLOW, Can anyone help?","body":"\u003cp\u003eAnyone know of a way to speed up the Visual Studio IDE when you have Telerik RadControls (either windows or web) and JetBrains ReSharper installed? If I disable ReSharper it runs rocking fast, but I love ReSharper a bit too much to drop it. I know it would perform better without the RadControls. Anyone know a way to speed it up?\u003c/p\u003e","accepted_answer_id":"1374110","answer_count":"4","comment_count":"1","creation_date":"2009-08-31 23:50:52.273 UTC","favorite_count":"0","last_activity_date":"2013-05-14 20:07:56.483 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"131268","post_type_id":"1","score":"2","tags":"ide|resharper|telerik","view_count":"1400"} +{"id":"14379103","title":"double for loops in python","body":"\u003cp\u003eI am trying to get a list of file names in order. Something like \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efiles-1-loop-21\nfiles-1-loop-22\nfiles-1-loop-23\nfiles-1-loop-24\nfiles-2-loop-21\nfiles-2-loop-22\nfiles-2-loop-23\n.\n.\n.\nand so on\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAs for testing I have written python code as below:\u003c/p\u003e\n\n\u003cp\u003ecode sample_1:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efor md in range(1,5):\n for pico in range(21,25):\n print md, pico\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt gives me pair of number such as:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e `1 21\n 1 22\n 1 23\n 1 24\n 2 21\n 2 22\n 2 23\n 2 24\n 3 21\n 3 22\n 3 23\n 3 24\n 4 21\n 4 22\n 4 23\n 4 24\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e`\u003c/p\u003e\n\n\u003cp\u003eif I use:\u003c/p\u003e\n\n\u003cp\u003ecode sample_2:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e for md in range(1,5):\n for pico in range(21,25):\n print \"file-md-loop-pico\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI get\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e files-md-loop-pico\n files-md-loop-pico\n files-md-loop-pico\n files-md-loop-pico\n files-md-loop-pico\n files-md-loop-pico\n files-md-loop-pico\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow (code sample_2) should be altered to get the file lists as I wanted (as shown in the beginning of this post) in python?\u003c/p\u003e\n\n\u003cp\u003eThanks in advance.\u003c/p\u003e\n\n\u003cp\u003eRegards\u003c/p\u003e","accepted_answer_id":"14379157","answer_count":"6","comment_count":"0","creation_date":"2013-01-17 12:27:00.65 UTC","favorite_count":"1","last_activity_date":"2014-11-19 11:09:56.88 UTC","last_edit_date":"2013-01-17 13:34:59 UTC","last_editor_display_name":"","last_editor_user_id":"782590","owner_display_name":"","owner_user_id":"782590","post_type_id":"1","score":"5","tags":"python","view_count":"27786"} +{"id":"13134715","title":"inmobi landscape interstitial ads for android","body":"\u003cp\u003eDoes anybody know how to make inmobi interstitial ads only landscape orientation for Android?\nI tried to send post request with parameter \"d-orientation\", but nothing happened.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eMap\u0026lt;String, String\u0026gt; map = new HashMap\u0026lt;String, String\u0026gt;();\nmap.put(\"d-orientation\", \"3\");\nrequest.setRequestParams(map);\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"13152146","answer_count":"2","comment_count":"1","creation_date":"2012-10-30 07:50:41.107 UTC","last_activity_date":"2013-09-27 10:17:19.283 UTC","last_edit_date":"2013-09-27 10:17:19.283 UTC","last_editor_display_name":"","last_editor_user_id":"572480","owner_display_name":"","owner_user_id":"1723343","post_type_id":"1","score":"0","tags":"android|landscape|ads|interstitial|inmobi","view_count":"662"} +{"id":"43813462","title":"Creating Wifi links between APs and the server on ns-3","body":"\u003cp\u003eSay I want to have 3 APs serving 60 users, and these APs are in turn wirelessly (Using Wifi) connected to the server. How would I create such a topology? \u003c/p\u003e\n\n\u003cp\u003eAt this moment, I was thinking that 'wifiStaNodes' can represent the users, 'wifiApNodes' can represent the APs. How do I make these APs relay information to the server through Wifi? This is my attempt: I have created 'wifiServer', which is the server node.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e//Topology\n// ------\u0026gt; denotes a Wifi Link\n\nu0 u1 u2 ..... ------\u0026gt; AP1\n..............\n.............. ------\u0026gt; AP2 -----\u0026gt; Server\n..............\n...u58 u59 u60 ------\u0026gt; AP3 \n\nint nWifi = 60;\nint nAP = 3; \n\nNodeContainer allNodes;\n\nNodeContainer wifiStaNodes; //User Nodes\nwifiStaNodes.Create (nWifi);\nallNodes.Add (wifiStaNodes);\n\nNodeContainer wifiApNodes ; //Access Points\nwifiApNodes.Create (nAP);\nallNodes.Add (wifiApNodes);\n\nNodeContainer wifiServer; //Server\nwifiServer.Create (1);\nallNodes.Add(wifiServer.Get(0)); \n\nYansWifiChannelHelper channel = YansWifiChannelHelper::Default ();\nYansWifiPhyHelper phy = YansWifiPhyHelper::Default ();\nWifiHelper wifi;\nwifi.SetRemoteStationManager (\"ns3::ConstantRateWifiManager\",\"DataMode\", StringValue(\"VhtMcs9\"), \"ControlMode\", StringValue(\"VhtMcs9\"));\nwifi.SetStandard (WIFI_PHY_STANDARD_80211af);\nchannel.AddPropagationLoss(\"ns3::TwoRayGroundPropagationLossModel\",\"Frequency\",DoubleValue(300e+06));\n\n//Setting Physical layer parameters for the User Nodes\nphy.Set(\"TxPowerStart\",DoubleValue(20)); // 40mW = 16.02dBm\nphy.Set(\"TxPowerEnd\",DoubleValue(20));\nphy.Set(\"TxPowerLevels\", UintegerValue(1));\nphy.Set(\"TxGain\",DoubleValue(0));\nphy.Set(\"RxGain\",DoubleValue(-3));\nphy.Set(\"EnergyDetectionThreshold\",DoubleValue(-88));\nphy.SetChannel (channel.Create ());\n\nWifiMacHelper mac;\nSsid ssid = Ssid (\"ns-3-ssid\");\n\nNetDeviceContainer staDevices;\nmac.SetType (\"ns3::StaWifiMac\",\"Ssid\", SsidValue (ssid),\"ActiveProbing\", BooleanValue (false));\nstaDevices = wifi.Install (phy, mac, wifiStaNodes);\n\n//Setting Physical Layer parameters for Access Points and Server\nphy.Set(\"TxPowerStart\",DoubleValue(20)); // 40mW = 16.02dBm\nphy.Set(\"TxPowerEnd\",DoubleValue(20));\nphy.Set(\"TxPowerLevels\", UintegerValue(1));\nphy.Set(\"TxGain\",DoubleValue(30));\nphy.Set(\"RxGain\",DoubleValue(0));\nphy.Set(\"EnergyDetectionThreshold\",DoubleValue(-78));\n\nNetDeviceContainer apDevices,serverDevice;\nmac.SetType (\"ns3::ApWifiMac\",\"Ssid\", SsidValue (ssid));\napDevices = wifi.Install (phy, mac, wifiApNodes);\nserverDevice = wifi.Install (phy, mac, wifiServer);\n\nPtr\u0026lt;BasicEnergySource\u0026gt; energySource = CreateObject\u0026lt;BasicEnergySource\u0026gt;();\nPtr\u0026lt;SimpleDeviceEnergyModel\u0026gt; energyModel = CreateObject\u0026lt;SimpleDeviceEnergyModel\u0026gt;();\n\nenergySource-\u0026gt;SetInitialEnergy (100);\nenergyModel-\u0026gt;SetEnergySource (energySource);\nenergySource-\u0026gt;AppendDeviceEnergyModel (energyModel);\nenergyModel-\u0026gt;SetCurrentA (20);\n\n// aggregate energy source to node\nwifiServer.Get(0)-\u0026gt;AggregateObject (energySource);\n\n// Install internet stack\nInternetStackHelper stack;\nstack.Install (allNodes);\n\n// Install Ipv4 addresses\nIpv4AddressHelper address;\naddress.SetBase (\"10.1.0.0\", \"255.255.192.0\");\naddress.Assign (staDevices);\naddress.Assign (apDevices);\naddress.SetBase (\"10.2.0.0\", \"255.255.192.0\");\nIpv4InterfaceContainer serverInterface;\nserverInterface = address.Assign (serverDevice);\naddress.Assign (apDevices);\n\n// Install applications\n\nUdpEchoServerHelper echoServer (9);\nApplicationContainer serverApps = echoServer.Install (wifiServer.Get(0));\nserverApps.Start (Seconds (1.0));\nserverApps.Stop (Seconds (5.0));\nUdpEchoClientHelper echoClient (serverInterface.GetAddress(0), 9);\nechoClient.SetAttribute (\"MaxPackets\", UintegerValue (10));\nechoClient.SetAttribute (\"Interval\", TimeValue (Seconds (3)));\nechoClient.SetAttribute (\"PacketSize\", UintegerValue (1024));\nApplicationContainer clientApps = echoClient.Install (wifiStaNodes);\nclientApps.Start (Seconds (2.0));\nclientApps.Stop (Seconds (5.0));\n\nIpv4GlobalRoutingHelper::PopulateRoutingTables ();\nSimulator::Stop (Seconds (4.0));\n\nMobilityHelper mobility;\nmobility.SetMobilityModel (\"ns3::ConstantPositionMobilityModel\");\nmobility.Install (wifiStaNodes);\nmobility.SetMobilityModel (\"ns3::ConstantPositionMobilityModel\");\nmobility.Install (wifiApNodes);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI receive the following error: \u003c/p\u003e\n\n\u003cp\u003eaborted. cond=\"!(networkHere == networkThere)\", msg=\"GlobalRouter::ProcessSingleBroadcastLink(): Network number confusion\", file=../src/internet/model/global-router-interface.cc, line=852\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-05-05 20:42:16.343 UTC","last_activity_date":"2017-05-05 20:51:40.96 UTC","last_edit_date":"2017-05-05 20:51:40.96 UTC","last_editor_display_name":"","last_editor_user_id":"7802280","owner_display_name":"","owner_user_id":"7802280","post_type_id":"1","score":"0","tags":"wifi|ns-3","view_count":"52"} +{"id":"44752252","title":"Python: MemoryError in generating a array","body":"\u003cp\u003eI am using anaconda2 with python 2.7 in 64-bit wind10 with RAM of 4G. My codes are as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enumber_of_documents = 21578\ndocument_max_num_words = 100\nnum_features = 500\nX = np.zeros(shape=(number_of_documents, document_max_num_words, num_features)).astype('float32')\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn generating x, the memory error occurs. \u003c/p\u003e","answer_count":"1","comment_count":"11","creation_date":"2017-06-26 01:58:44.28 UTC","last_activity_date":"2017-06-26 02:47:06.953 UTC","last_edit_date":"2017-06-26 02:18:18.38 UTC","last_editor_display_name":"","last_editor_user_id":"6807211","owner_display_name":"","owner_user_id":"6807211","post_type_id":"1","score":"-1","tags":"python|numpy","view_count":"78"} +{"id":"32175415","title":"iOS - push notifications not determined","body":"\u003cp\u003eis there any workaround to find out if user has been ever asked for push notifications permissions?\nCalling \u003ccode\u003eisRegisteredForRemoteNotifications\u003c/code\u003e directly is not sufficient for me. \nI have a screen that changes based on whether it is a first launch of app or not.\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003e\u003cp\u003eIf it is it says that app can send push notifications and when prompted please tap Allow. Then user click Got it button and and VC with push notifications prompt is displayed. \u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eHowever if user signup up again on another account (push notifications are remembered) I want to display info that he needs to go Settings to allow push notifications (if they are disabled) or just simply skip notifications prompt screen (if user allowed them).\u003c/p\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eSo in other words i need to know not if user has allowed push notification but if he was ever asked for them.\u003c/p\u003e\n\n\u003cp\u003eI've tried to save some data in keychain after user was asked but when app is deleted and installed again (after one day or more so push notifications settings are reseted) user is not asked (I only check if there is my flag in keychain).\u003c/p\u003e\n\n\u003cp\u003eThanks for help\u003c/p\u003e\n\n\u003cp\u003eEdit #1 I added image that presents my problem\u003ca href=\"https://i.stack.imgur.com/AKPbH.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/AKPbH.png\" alt=\"Push notifications\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eActually screens with OK and Go to settings buttons are not seperate View Controllers but it really doesn't matter.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-08-24 06:05:50.34 UTC","last_activity_date":"2015-08-24 09:56:37.257 UTC","last_edit_date":"2015-08-24 09:56:37.257 UTC","last_editor_display_name":"","last_editor_user_id":"4617967","owner_display_name":"","owner_user_id":"4617967","post_type_id":"1","score":"2","tags":"ios|push-notification","view_count":"260"} +{"id":"6179737","title":"SQL server user session time out?","body":"\u003cp\u003ei use window application and i want to fire trigger after user session time out So , \u003c/p\u003e\n\n\u003cp\u003eHow to detect if user abort or his session timeout using SQ L server 2008 ?\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2011-05-30 18:46:07.77 UTC","favorite_count":"1","last_activity_date":"2011-05-30 20:32:40.06 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"342511","post_type_id":"1","score":"0","tags":"sql|sql-server|tsql|sql-server-2008","view_count":"10065"} +{"id":"15398275","title":"restric access json data with grape and rails 3","body":"\u003cp\u003eI have a json data in this address:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ehttp://localhost:3000/api/v1/apisearch\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThese json data are generated with grape gem \u003ca href=\"https://github.com/intridea/grape\" rel=\"nofollow\"\u003ehttps://github.com/intridea/grape\u003c/a\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass API_v1 \u0026lt; Grape::API\n version 'v1', :using =\u0026gt; :path, :vendor =\u0026gt; 'myapp', :format =\u0026gt; :json\n get :apisearch do\n Object.search({query: \"*#{params[:q]}*\"}).map{ |object| {id: object.title, text: object.description } }\n end\n end\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have a search engine that get data from this address with \u003ca href=\"http://ivaynberg.github.com/select2/\" rel=\"nofollow\"\u003eselect2\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThis is my coffescript file:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ejQuery -\u0026gt;\n $('#query_txt').select2\n width: 'resolve'\n allowClear: true\n minimumInputLength: 2\n ajax:\n url: \"api/v1/apisearch\"\n dataType: 'json'\n data: (term, page) -\u0026gt; {q: term}\n results: (data, page) -\u0026gt;\n results: data\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe script is working very fine, but I would like protect this address of external requests.\u003c/p\u003e\n\n\u003cp\u003eI don't want to allow a user if type \u003ccode\u003ehttp://localhost:3000/api/v1/apisearch\u003c/code\u003e can access to these data. Only can access to these data my internal search engine from my own application.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eHow can I restric access data only to my own application from grape?\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eThank you\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-03-13 23:10:16.373 UTC","last_activity_date":"2013-03-16 18:59:32.94 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"778094","post_type_id":"1","score":"1","tags":"ruby-on-rails|ruby|json|api|grape","view_count":"215"} +{"id":"19231545","title":"Combining 2 queries into 1 query","body":"\u003cp\u003eHow would I combine the results of the first query with the second query where the \u003ccode\u003eEMPLID\u003c/code\u003e column for both the \u003ccode\u003eZ_EMP_YAN\u003c/code\u003e table and the \u003ccode\u003eZ_OPRDEFN\u003c/code\u003e table match up?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eselect b.OPRID\nfrom Z_EMP_BENFT a, PSOPRDEFN b\nWHERE a.EMPLID = b.EMPLID\nAND A.Z_PEND_COVER = 'Y'\nAND OPRID LIKE 'ZZ%'\n\nselect EMPLID from z_emp_yan where z_yan_action_id = 1\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"19231595","answer_count":"2","comment_count":"0","creation_date":"2013-10-07 18:01:53.393 UTC","last_activity_date":"2013-10-07 18:13:33.343 UTC","last_edit_date":"2013-10-07 18:07:14.67 UTC","last_editor_display_name":"","last_editor_user_id":"2426148","owner_display_name":"","owner_user_id":"2426148","post_type_id":"1","score":"0","tags":"sql","view_count":"78"} +{"id":"8318561","title":"What am I doing wrong: Structure cannot be indexed because it has no default property (WITH CLAUSE)","body":"\u003cp\u003eAm getting: \"Structure cannot be indexed because it has no default property\". What am I doing wrong? \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eWith grid.Rows(10).Cells\n Dim note As New Note With {.ID = \"Blah\", _\n .Date = \"1/1/2011\", _\n .Message = \"AAA\", _\n .Type = \"ABC\", _\n .SubType = \"DEF\", _\n .ReferenceKey = !SetRefNum.Value}\nEnd With\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd Note looks like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ePublic Structure Note\n Public Property ID As String\n Public Property [Date] As Date\n Public Property Message As String\n\n Public Property Type As String\n Public Property SubType As String\n Public Property ReferenceKey As String\n End Structure\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"8318784","answer_count":"2","comment_count":"0","creation_date":"2011-11-29 22:20:20.273 UTC","last_activity_date":"2011-11-29 23:51:40.5 UTC","last_edit_date":"2011-11-29 23:06:47.643 UTC","last_editor_display_name":"","last_editor_user_id":"400589","owner_display_name":"","owner_user_id":"400589","post_type_id":"1","score":"1","tags":"vb.net","view_count":"4823"} +{"id":"40874912","title":"overloading class operator new with dependency","body":"\u003cp\u003eHow does one provide a dependency to a class for use in operator new, without using a global?\u003c/p\u003e\n\n\u003cp\u003eIf I understand correctly, if I want to customize the behavior every time someone creates an instance of my type, then I have to overload operator new as a class method. That class method is static, whether I declare it static or not.\u003c/p\u003e\n\n\u003cp\u003eIf I have a class:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass ComplexNumber\n{\npublic:\n\n ComplexNumber(double realPart, double complexPart);\n ComplexNumber(const ComplexNumber \u0026amp; rhs);\n virtual ~ComplexNumber();\n\n void * operator new (std::size_t count);\n void * operator new[](std::size_t count);\n\nprotected:\n\n double m_realPart;\n double m_complexPart;\n};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand I want to use an custom memory manager that I created to do the allocation:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evoid * ComplexNumber::operator new (std::size_t count)\n{\n // I want to use an call IMemoryManager::allocate(size, align);\n}\n\nvoid * ComplexNumber::operator new[](std::size_t count)\n{\n // I want to use an call IMemoryManager::allocate(size, align);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow do I make an instance of IMemoryManager available to the class without using a global?\u003c/p\u003e\n\n\u003cp\u003eIt does not seem possible to me, and therefore forces bad design where the class is tightly coupled to a particular global instance.\u003c/p\u003e","accepted_answer_id":"40875751","answer_count":"1","comment_count":"0","creation_date":"2016-11-29 20:09:10.687 UTC","last_activity_date":"2016-11-29 21:06:17.943 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5191073","post_type_id":"1","score":"0","tags":"c++|new-operator","view_count":"49"} +{"id":"39106918","title":"how can I remove multiple new line and space(white char) from a string?","body":"\u003cp\u003eA String looks like this : \u003ccode\u003e\" I am seal \\n\\n \\t where are we? \"\u003c/code\u003e. and the printed version \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e I am seal \n\n where are we? \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to make the string like : \u003ccode\u003e\"I am seal\\nwhere are we?\"\u003c/code\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eI am seal\nwhere are we?\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am removing the new line with \u003ccode\u003e\"[\\r\\n]+\", \"\\n\"\u003c/code\u003e this regex but the problem is when I am trying to remove the white space it also remove the newline. I have used \u003ccode\u003eStringUtils\u003c/code\u003e from \u003ccode\u003eApache-common\u003c/code\u003e. \u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eupdate\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eAlso white space from the beginning of a line also be removed. It should not be consecutive. \u003c/p\u003e\n\n\u003cp\u003eHow can I achieve this in \u003cstrong\u003eJava\u003c/strong\u003e ?\u003c/p\u003e\n\n\u003cp\u003eThank you. \u003c/p\u003e","accepted_answer_id":"39107122","answer_count":"3","comment_count":"0","creation_date":"2016-08-23 17:00:19.327 UTC","last_activity_date":"2016-08-23 18:54:54.733 UTC","last_edit_date":"2016-08-23 18:44:54.69 UTC","last_editor_display_name":"","last_editor_user_id":"3763576","owner_display_name":"","owner_user_id":"3763576","post_type_id":"1","score":"-1","tags":"java|regex|string|replace","view_count":"367"} +{"id":"20361886","title":"Bootstrap 3 - Different grid sizes with different alignments","body":"\u003cp\u003eI use bootstrap 3 and my site has 2 cols. The left content is left align and the right content is right align. On smaller display I will work with 1 col. So the right col is under the left col. That works fine.\u003c/p\u003e\n\n\u003cp\u003eBut I want that on smaller displays both cols have left alignment. Is this possible?\u003c/p\u003e\n\n\u003cp\u003eHere my current code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"row\"\u0026gt;\n \u0026lt;div class=\"col-lg-6 col-md-6 col-xm-12 col-xs-12 text-left\"\u0026gt;\n content a\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"col-lg-6 col-md-6 col-xm-12 col-xs-12 text-right\"\u0026gt;\n content b\n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-12-03 21:19:00.43 UTC","last_activity_date":"2013-12-03 23:12:29.92 UTC","last_edit_date":"2013-12-03 23:12:29.92 UTC","last_editor_display_name":"","last_editor_user_id":"2262149","owner_display_name":"","owner_user_id":"2935929","post_type_id":"1","score":"0","tags":"twitter-bootstrap","view_count":"3311"} +{"id":"7610664","title":"should autoboxing be avoided in Java","body":"\u003cp\u003eI want to ask if autoboxing should be avoided in Java. As there are instances where a method expects a primitive type 'double' and you pass a 'Double' object as a parameter, should this be avoided as compiler unboxes your passed object and could be heavy?\u003c/p\u003e","answer_count":"5","comment_count":"0","creation_date":"2011-09-30 12:54:29.387 UTC","last_activity_date":"2014-10-30 21:39:24.477 UTC","last_edit_date":"2011-09-30 12:57:42.707 UTC","last_editor_display_name":"","last_editor_user_id":"812149","owner_display_name":"","owner_user_id":"1630846","post_type_id":"1","score":"9","tags":"java","view_count":"3253"} +{"id":"27038162","title":"How bad is it to launch many small kernels in CUDA?","body":"\u003cp\u003eI have a grid of rectangles. Each of these rectangles consists of a rectangular grid of points. All points inside the rectangle can be treated by exactly the same instruction sequence in a kernel. I will be able to launch a kernel with 10000s of points to handle, where each thread would handle about 10-50 points. The points on the edges and on the corners of the rectangles however will lead to a large set of different instruction sequences.\u003c/p\u003e\n\n\u003cp\u003eFrom a design point of view, it would be easier to launch a kernel for each set of points with the same instruction sequence. This would mean that some kernel launches would only treat very few points, probably less than 10.\u003c/p\u003e\n\n\u003cp\u003eSo I would have maybe 4 kernel launches with 10000s of points to handle (10-50 points for each thread), and maybe 30-100 kernel launches with only a few points each (1 point per thread normally).\u003c/p\u003e\n\n\u003cp\u003eI have absolutely no idea whether this is acceptable or whether it will completely destroy my performance. I would be glad if you could give me a rough estimate or at least some hints, what to consider to get an estimate.\u003c/p\u003e","accepted_answer_id":"27038751","answer_count":"2","comment_count":"0","creation_date":"2014-11-20 11:13:17.303 UTC","favorite_count":"1","last_activity_date":"2014-11-20 11:57:03.167 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2109064","post_type_id":"1","score":"1","tags":"cuda","view_count":"2191"} +{"id":"21796353","title":"Are there predefined functions in scipy/numpy to shift/rotate an image that use sinc-interpolation instead of spline interpolation?","body":"\u003cp\u003eThe question title summarizes it well I hope. I have a large batch of images which I want to register. For this purpose I need to shift/rotate the images. So far I have used scipy.ndimage.rotate and scipy.ndimage.shift for this task. However, some of the images have sharp intensity features for which the higher order spline interpolation fails (i.e. produces ringing artefacts). Lower order (0 or 1) splines are not preserving the image data well enough.\u003c/p\u003e\n\n\u003cp\u003eIs there a build in task in scipy/numpy (or any other package in principle) that uses sinc interpolation (\u003ca href=\"http://en.wikipedia.org/wiki/Whittaker%E2%80%93Shannon_interpolation_formula\" rel=\"nofollow\"\u003ehttp://en.wikipedia.org/wiki/Whittaker%E2%80%93Shannon_interpolation_formula\u003c/a\u003e)?\u003c/p\u003e\n\n\u003cp\u003eI have searched around for quiet a while myself but have not come up with any easy solutions, if I have missed something obvious please point me in the right direction.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-02-15 10:36:41.733 UTC","favorite_count":"1","last_activity_date":"2014-02-15 12:07:37.417 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1041705","post_type_id":"1","score":"1","tags":"python|image-processing|numpy|scipy|image-rotation","view_count":"618"} +{"id":"16589306","title":"Get data from iframe","body":"\u003cp\u003eI am doing this first time. I have created an \u003ccode\u003eiframe\u003c/code\u003e on my page and I want the text from the \u003ccode\u003eiframe\u003c/code\u003e through \u003ccode\u003ejquery\u003c/code\u003e.\nHere is my code :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;html\u0026gt;\n \u0026lt;head\u0026gt;\u0026lt;script src=\"http://code.jquery.com/jquery-1.9.1.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\n\n \u0026lt;script type=\"text/javascript\"\u0026gt;\n function copyIframeContent(iframe){ \n var iframeContent = $(iframe).contents(); //alert(iframeContent);\n //$(\"#result\").text(\"Hello World\");\n $(\"#result\").html(iframeContent.find('body').html);alert(iframeContent.find('body').html());\n }\n \u0026lt;/script\u0026gt;\n \u0026lt;/head\u0026gt;\n \u0026lt;body\u0026gt;\n \u0026lt;iframe id=\"myIframe\" onload=\"copyIframeContent(this);\" name=\"myIframe\" src=\"text.php\"\u0026gt;\u0026lt;/iframe\u0026gt;\u0026lt;br /\u0026gt;\n Result:\u0026lt;br /\u0026gt;\n \u0026lt;textarea id='result'\u0026gt;\u0026lt;/textarea\u0026gt;\n \u0026lt;input type=\"button\" value=\"click\" id=\"btn\" onclick=\"aa()\"\u0026gt;\n \u0026lt;script type=\"text/javascript\"\u0026gt;\n function aa(){ alert(\"Fdf\");\n alert(document.getElementById('myIframe').contentWindow.document.body.innerHTML);\n }\n \u0026lt;/script\u0026gt;\n \u0026lt;/body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003etext.php:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etext to change\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI tried a lot in all browsers but still this is not working.\nCan anyone help me to get this content?\u003c/p\u003e","answer_count":"4","comment_count":"8","creation_date":"2013-05-16 13:51:58.807 UTC","last_activity_date":"2017-07-15 05:59:02.95 UTC","last_edit_date":"2013-05-17 13:40:09.073 UTC","last_editor_display_name":"","last_editor_user_id":"1723626","owner_display_name":"","owner_user_id":"1089665","post_type_id":"1","score":"5","tags":"javascript|jquery|html|html5","view_count":"23510"} +{"id":"14929788","title":"Selecting nodes with different classes in XPath in PHP","body":"\u003cp\u003eI'm attempting to use XPath to select nodes that have different classes. Only two, in this case. One is \"msg_head\" and the other is \"msg_sub_head\".\u003c/p\u003e\n\n\u003cp\u003eThe following is currently the string I'm running with after many hours of Googling and searching here on Stack Overflow. I feel I'm close, but not quite there.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e//*[contains(concat(' ',@class,' '),' msg_head') and (contains(concat(' ',@class,' '),' msg_sub_head'))]\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"2","creation_date":"2013-02-18 05:03:04.627 UTC","last_activity_date":"2013-02-18 05:12:25.407 UTC","last_editor_display_name":"","owner_display_name":"user1881190","post_type_id":"1","score":"1","tags":"php|xpath","view_count":"32"} +{"id":"26903085","title":"Taking specific order of differences of elements in a vector, MATLAB","body":"\u003cp\u003eI have the following vector:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eA = [1 2 3 4 5 6]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to take the the difference between the \u003ccode\u003ethird\u003c/code\u003e element and the \u003ccode\u003efirst\u003c/code\u003e (\u003ccode\u003eA(3)-A(1)\u003c/code\u003e) \u003c/p\u003e\n\n\u003cp\u003eand then \u003ccode\u003efourth\u003c/code\u003e and \u003ccode\u003esecond\u003c/code\u003e element (\u003ccode\u003eA(4)-A(2)\u003c/code\u003e) and so on. \u003c/p\u003e\n\n\u003cp\u003eHow do I do this?\u003c/p\u003e\n\n\u003cp\u003eThank you!\u003c/p\u003e","accepted_answer_id":"26903656","answer_count":"1","comment_count":"0","creation_date":"2014-11-13 07:00:45.533 UTC","favorite_count":"1","last_activity_date":"2014-11-13 07:44:48.757 UTC","last_edit_date":"2014-11-13 07:37:42.457 UTC","last_editor_display_name":"","last_editor_user_id":"3891431","owner_display_name":"","owner_user_id":"3934760","post_type_id":"1","score":"0","tags":"arrays|matlab|matrix","view_count":"27"} +{"id":"43752088","title":"set dropdown box and display last selected item in php","body":"\u003cp\u003ei need to populate a select box with values and \ni need to select box to display last selected item(from db).The goal is to let the user update the details.\nAnd i have more than 30 items in the select box.i am new to php ..help me\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2017-05-03 05:55:38.84 UTC","last_activity_date":"2017-05-03 06:00:43.717 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7005678","post_type_id":"1","score":"-3","tags":"php|drop-down-menu","view_count":"141"} +{"id":"8350820","title":"django login popup","body":"\u003cp\u003eI've been trying to figure out how to do a modal login in django and have been having some trouble. Is this possible? It seems like it should be. I imagine the solution involves writing a view that takes a POST request and returns some JSON.\u003c/p\u003e\n\n\u003cp\u003eAre there any examples out there of how to do this in a clean way? \u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2011-12-02 01:51:25.243 UTC","last_activity_date":"2011-12-02 03:07:12.867 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"801820","post_type_id":"1","score":"2","tags":"django|django-authentication|django-login","view_count":"1422"} +{"id":"15311252","title":"jQuery based Splitter plugin","body":"\u003cp\u003eI need to create a layout as below;\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/ROhDW.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eNow as you can see, I want resizable cells around Cell-center i.e for cell-left and cell-right\u003c/p\u003e\n\n\u003cp\u003eI was using the jQuery plugin at \u003ca href=\"http://methvin.com/splitter/3csplitter.html\" rel=\"nofollow noreferrer\"\u003ehttp://methvin.com/splitter/3csplitter.html\u003c/a\u003e\nto achieve the same.\u003c/p\u003e\n\n\u003cp\u003eBut I also needed to create 4 portlets (as you can see for cell-center) . I used jQuery UI for the same and for some reasons, the 2 are not going very well (3cSplitter and jQuery UI Portlets)...the layout gets broken completely...not sure if it has to do with absolute positioning...\u003c/p\u003e\n\n\u003cp\u003eBut my question is, can I use jQuery UI to acheive similar kind of splitter. The one that I saw under \u003ca href=\"http://jqueryui.com/resizable/\" rel=\"nofollow noreferrer\"\u003ehttp://jqueryui.com/resizable/\u003c/a\u003e\ndoes not seem to be very good for what I want as \u003ca href=\"http://methvin.com/splitter/3csplitter.html\" rel=\"nofollow noreferrer\"\u003ehttp://methvin.com/splitter/3csplitter.html\u003c/a\u003e\nIf both are jQuery UI based, I guess the integration issues would not be much...\u003c/p\u003e","accepted_answer_id":"15311334","answer_count":"2","comment_count":"0","creation_date":"2013-03-09 13:32:49.183 UTC","favorite_count":"4","last_activity_date":"2013-03-09 14:29:58.383 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"485743","post_type_id":"1","score":"4","tags":"javascript|jquery|jquery-ui","view_count":"5950"} +{"id":"23718275","title":"node.js monitoring for when a file is created","body":"\u003cp\u003eI am writing a node.js program that needs to do something as soon as a file with a certain name is created in a specific directory. I could do this by doing repeated calls to fs.readdir until I see the name of the file, but I'd rather do something more efficient. Does anyone know of a way to do this?\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2014-05-18 03:28:57.513 UTC","last_activity_date":"2014-05-18 13:04:28.497 UTC","last_edit_date":"2014-05-18 03:56:56.193 UTC","last_editor_display_name":"","last_editor_user_id":"1900483","owner_display_name":"","owner_user_id":"2351192","post_type_id":"1","score":"2","tags":"javascript|node.js|file-io|fs","view_count":"936"} +{"id":"43674436","title":"Angular 2 submodule routing with AOT and Rollup","body":"\u003cp\u003eWhat is the correct way to configure a submodule in Angular 2 so that it will work after AOT and rollup? I'm not concerned about lazy loading and will be happy for all submodules to be bundled together, but \u003ccode\u003eloadChildren\u003c/code\u003e is the cleanest way of referencing a submodule and having it use the correct \u003ccode\u003e\u0026lt;router-outlet\u0026gt;\u003c/code\u003e, and although I've tried various methods, none will work in both development and production.\u003c/p\u003e\n\n\u003cp\u003eI followed the instructions in the \u003ca href=\"https://angular.io/docs/ts/latest/cookbook/aot-compiler.html\" rel=\"nofollow noreferrer\"\u003eAOT cookbook\u003c/a\u003e to prepare my app for deployment. My module structure is root \u003e account \u003e admin, and I want the admin routes to load in the outlet defined by the account component.\u003c/p\u003e\n\n\u003cp\u003eHere's the router config for the account module:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport { NgModule } from '@angular/core';\nimport { AdminModule } from './admin/admin.module';\n\nconst accountRoutes: Routes = [{\n path: 'account',\n component: AccountComponent,\n children: [\n { path: 'setup', component: SetupComponent },\n { path: 'admin', loadChildren: () =\u0026gt; AdminModule }\n ]\n}];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis works in development, but NGC compilation fails with \u003ccode\u003eError: Error encountered resolving symbol values statically. Reference to a local (non-exported) symbol 'accountRoutes'.\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eI added an export to \u003ccode\u003eaccountRoutes\u003c/code\u003e but this also fails to compile with \u003ccode\u003eError: Error encountered resolving symbol values statically. Function calls are not supported.\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eOne suggestion was to use a string instead of a function so that NGC can compile the code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eloadChildren: 'app/account/admin/admin.module#AdminModule'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis works in development and compiles successfully but the compiled app will not run, because SystemJS is unavailable. The error is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eERROR Error: Uncaught (in promise): TypeError: System.import is not a function\nTypeError: System.import is not a function\nat t.loadFactory (build.js:6)\nat t.load (build.js:6)\nat t.loadModuleFactory (build.js:12)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI tried including SystemJS in the production build but it could not find the separate module file \u003ccode\u003eapp/account/admin/admin.module.ngfactory\u003c/code\u003e - after rollup everything is in one build.js. There may be a way to have separate rollups build each submodule, but that's a lot of work.\u003c/p\u003e\n\n\u003cp\u003eI found the suggestion of referring to an exported function:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eexport function loadAdminModule() {\n return AdminModule;\n}\n\nloadChildren: loadAdminModule\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis works in development, but in production the runtime compiler is unavailable so it logs \u003ccode\u003ebuild.js:1 ERROR Error: Uncaught (in promise): Error: Runtime compiler is not loaded\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eThe helper function can be modified so it works in production by referencing the NgFactory instead, but this won't work in development.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport { AdminModuleNgFactory } from '../../../aot/src/app/account/admin/admin.module.ngfactory';\n\nexport function loadAdminModule() {\n return AdminModuleNgFactory;\n}\n\nloadChildren: loadAdminModule\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs there a supported way of using \u003ccode\u003eloadChildren\u003c/code\u003e so that it will work with the instructions in the AOT cookbook? Is it better to use webpack instead?\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2017-04-28 07:27:05.063 UTC","favorite_count":"1","last_activity_date":"2017-10-26 15:43:58.31 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2719186","post_type_id":"1","score":"3","tags":"angular2-routing|angular2-aot|rollupjs","view_count":"276"} +{"id":"17599343","title":"Avoiding parallel arrays with Objective-C and C++","body":"\u003cp\u003eSome context: I am writing a 2D Destructible terrain library for Cocos2D/Box2D which involves a hybrid of C++ and Objective-C. I recently encountered a situation that has stumped me where I can't think of a solution that doesn't involve parallel arrays.\u003c/p\u003e\n\n\u003cp\u003eIn order for the physics boundaries to be defined around the terrain, an initial trace must be made of the terrain border. I make a function call to trace all isolated bodies of pixels within a texture and cache them. This creates the following data structures\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eAn NSMutableDictionary \"borderPixels\" with the key being equal to an CGPoint wrapped in an NSValue which is equal to the pixel's unique location. This holds all traced pixels.\u003c/li\u003e\n\u003cli\u003eA circular linked lists with TerPixels pointing to their next neighbor pixel\u003c/li\u003e\n\u003cli\u003eAn NSMutableArray \"traceBodyPoints\" which holds a single TerPixel representing a 'start' point of a terrain body. I only store TerPixel *'s here where I need to trace a physics body. So, if a terrain body has been modified, I insert any individual TerPixel * from the modified body into this array. I can then reference each of these and traverse the linked list to trace the physics body.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eHere is some code to help paint a better picture of the situation:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e-(void)traverseBoundaryPoints:(CGPoint)startPt {\n\nif (!borderPixels) borderPixels = [[NSMutableDictionary alloc] init]; // Temp\nif (!traceBodyPoints) traceBodyPoints = [[NSMutableArray alloc] init]; // Temp\n\nTerPixel * start = [[TerPixel alloc] initWithCoords:startPt.x ypt:startPt.y prevx:-1 prevy:0];\nTerPixel * next = start;\n//CCLOG(@\"Start of traverseBoundary next.x and next.y %d, %d\", next.x, next.y);\nTerPixel * old;\n\n\nwhile (true) {\n\n old = next;\n next = [self findNextBoundaryPixel:next];\n [next setNSP:[old subTerPixel:next]];\n old.nextBorderPixel = next;\n\n if (next.x == start.x \u0026amp;\u0026amp; next.y == start.y) {\n CCLOG(@\"SUCCESS :: start = next\");\n next.nextBorderPixel = start; // Make the linked list circular\n NSValue * pixLocVal = [next getAsValueWithPoint];\n [borderPixels setObject:next forKey:pixLocVal];\n // Add the pixel to the tracePoints array to be traversed/traced later\n [traceBodyPoints addObject:start];\n break;\n } // end if\n\n // Connect the linked list components\n\n NSValue * pixLocVal = [next getAsValueWithPoint];\n [borderPixels setObject:next forKey:pixLocVal];\n\n} // end while\n} // end traverse function\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is where I can't find a solution. I need to relate each TerPixel * in the traceBodyPoints array to a Box2D b2Body which will be created and added to the physics world. In my library, each isolated body of pixels within a texture corresponds to a Box2D body. So, when an event happens that destroys a chunk of the terrain, I need to destroy the body associated the the destroyed pixels and retrace ONLY the altered bodies. This means I need a way to associate any given TerPixel * to a Box2D body *.\u003c/p\u003e\n\n\u003cp\u003eIn Objective-C with ARC, to my knowledge, I cannot include C++ objects/pointers in Objective-C containers without bridge casting to void *'s. Problem is these operations need to be incredibly performant and engaging in bridge casting is very costly. Also, I don't want to include a pointer to a Box2D body in every single TerPixel. This would be a nightmare to ensure there are no dangling pointers and require pointless iteration to nil pointers out.\u003c/p\u003e\n\n\u003cp\u003eHere is my logic for creating physics boundaries\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e-(void)createPhysicsBoundaries {\n\nif ([self-\u0026gt;traceBodyPoints count] == 0) {\n CCLOG(@\"createPhysicsBoundaries-\u0026gt; No bodies to trace\");\n return;\n}\n\n// NEED LOGIC HERE TO DELETE ALTERED BODIES\n// NEED TO DELETE EXISTING BOX2D BODY AND RE-TRACE A NEW ONE\n\n// For each body that has been altered, traverse linked list to trace the body\nfor (TerPixel * startPixel in self-\u0026gt;traceBodyPoints) {\n TerPixel * tracePixel = startPixel.nextBorderPixel;\n\n b2BodyDef tDef;\n tDef.position.Set(0, 0);\n b2Body * b = self-\u0026gt;world-\u0026gt;CreateBody(\u0026amp;tDef);\n self-\u0026gt;groundBodies-\u0026gt;push_back(b);\n b-\u0026gt;SetUserData((__bridge void*) self);\n b2EdgeShape edgeShape;\n\n CCLOG(@\"StartPixel %d, %d\", startPixel.x, startPixel.y);\n while (tracePixel != startPixel) {\n b2Vec2 start = b2Vec2(tracePixel.x/PTM_RATIO, tracePixel.y/PTM_RATIO);\n //CCLOG(@\"TracePixel BEFORE %d, %d\", tracePixel.x, tracePixel.y);\n tracePixel = tracePixel.nextBorderPixel;\n //CCLOG(@\"TracePixel AFTER %d, %d\", tracePixel.x, tracePixel.y);\n b2Vec2 end = b2Vec2(tracePixel.x/PTM_RATIO, tracePixel.y/PTM_RATIO);\n edgeShape.Set(start,end);\n b-\u0026gt;CreateFixture(\u0026amp;edgeShape, 0);\n } // end while\n\n} // end for\n} // end createPhysicsBoundaries\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHopefully this makes sense. If you need a visual of what is happening, here is a video. \u003ca href=\"http://www.youtube.com/watch?v=IUsgjYLr6e0\u0026amp;feature=youtu.be\" rel=\"nofollow\"\u003ehttp://www.youtube.com/watch?v=IUsgjYLr6e0\u0026amp;feature=youtu.be\u003c/a\u003e where the green boundaries are physics boundaries.\u003c/p\u003e","accepted_answer_id":"17600407","answer_count":"1","comment_count":"2","creation_date":"2013-07-11 17:02:58.443 UTC","favorite_count":"1","last_activity_date":"2013-07-11 18:07:20.007 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2433695","post_type_id":"1","score":"0","tags":"c++|objective-c|data-structures|cocos2d-iphone|box2d","view_count":"344"} +{"id":"5069242","title":"Asp.Net MVC RequireHttpsAttribute or Response Redirect doesn't work in IIS6","body":"\u003cp\u003eI am using RequireHttps attribute to redirect Http to Https. It works fine in my dev machine which has IIS7.5 installed. However, it doesn't work in IIS 6 in Windows Server 2003. Thus, I have got Http error 403.4.\nI have tried to use Response.Redirect(), it doesn't work either. So it seems that redirection doesn't work properly in II6.\nI am using .Net 4, MVC 3, and QA machine is Windows server 2003 with IIS6. \nDoes anyone know how to solve this problem?\u003c/p\u003e\n\n\u003cp\u003eThanks!\nhuang \u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2011-02-21 17:35:44.637 UTC","favorite_count":"1","last_activity_date":"2011-02-28 19:06:07.893 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"627057","post_type_id":"1","score":"0","tags":"asp.net-mvc|redirect|iis-6|requirehttps","view_count":"658"} +{"id":"16711106","title":"How to maintain both debug and appstore release version in test device?","body":"\u003cp\u003eI have an iPhone application released at App Store. In development of next version, I want to maintain these two versions on test device(iPhone).\u003c/p\u003e\n\n\u003cp\u003eBut when I tried to run the next version for debug on the test device, it overwrites the release version downloaded from the App Store. At the first, I guessed it can be done by changing the version number in xcode target setting \u003e summary \u003e iOS Application Target, but it's not. I have changed the both 'Version' and 'Build' number in iOS Application Target.\u003c/p\u003e\n\n\u003cp\u003eApp Store version number is 1.1 and debug version number is 1.2\u003cbr\u003e\nSo, how can I get this work?\u003c/p\u003e","accepted_answer_id":"16713723","answer_count":"4","comment_count":"0","creation_date":"2013-05-23 10:08:06.82 UTC","last_activity_date":"2015-06-01 07:31:53.383 UTC","last_edit_date":"2014-04-20 10:14:10.323 UTC","last_editor_display_name":"","last_editor_user_id":"321731","owner_display_name":"","owner_user_id":"1472348","post_type_id":"1","score":"2","tags":"iphone|xcode","view_count":"752"} +{"id":"23818544","title":"iOS 1 point view showing up blurred","body":"\u003cp\u003ei have a view that is supposed to emulate the separator in a table view. it is one point in height, calculated by \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#define kViewHeight 1.0\nCGFloat height = kViewHeight / [[UIScreen mainScreen] scale];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut the view comes across with something like an etched look depending on where it is displayed on the screen. for example, the same view will be a clear one pixel in height, but when the view is scrolled it changes. a few examples below of the same 3 separator views before and after scrolling. the views are the same, just had to move to the right to avoid text, so the chevrons are now in the picture. in the first, the top view is blurry, the bottom two are fine, in the second it's the opposite.\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/Ti0qU.png\" alt=\"before scrolling...\"\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/IxYNn.png\" alt=\"after scrolling...\"\u003e\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2014-05-22 23:11:28.073 UTC","last_activity_date":"2014-05-22 23:54:04.86 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1000177","post_type_id":"1","score":"0","tags":"ios|uiview","view_count":"49"} +{"id":"36345800","title":"Why is my print function printing the () and the \"\" along with the statement?","body":"\u003cp\u003e\u003cem\u003eThis is my code for a challenge in Python Programming for the Absolute Beginner\u003c/em\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e food = input(\"What is your favorite entree? \")\n\n dessert = input(\"What is your favorite dessert? \")\n\n print(\"\\nI am going to assume that your favorite meal is\" , food + dessert)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cem\u003eInstead of printing\u003c/em\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eI am going to assume that your favorite meal is\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cem\u003eIt is printing\u003c/em\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e('\\nI am going to assume that your favorite meal is', 'steakcookies')\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cem\u003eWhat do I need to change?\u003c/em\u003e\u003c/p\u003e","accepted_answer_id":"36345831","answer_count":"2","comment_count":"5","creation_date":"2016-03-31 23:56:03.397 UTC","last_activity_date":"2016-03-31 23:58:58.803 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5970482","post_type_id":"1","score":"0","tags":"python|python-2.7|function|printing","view_count":"203"} +{"id":"6628290","title":"C++ header include conflict","body":"\u003cp\u003eI am working on a traffic simulation program for school. My \u003ccode\u003eSimulation\u003c/code\u003e class reads in a list of vehicles from an XML file, so I have included \u003ccode\u003eVehicle.h\u003c/code\u003e in my \u003ccode\u003eSimulation\u003c/code\u003e class. I want my vehicle to be able to hold a pointer to the simulation object so that it can use the simulation's \u003ccode\u003esearchRoads\u003c/code\u003e function. So I included \u003ccode\u003eSimulation.h\u003c/code\u003e in my \u003ccode\u003eVehicle\u003c/code\u003e class.\u003c/p\u003e\n\n\u003cp\u003eWhen I did this, I got over 100 errors when I tried to compile. I'm pretty iffy on my C++ so if I committed some sort of cardinal sin, please let me know how to rectify this.\u003c/p\u003e","accepted_answer_id":"6628315","answer_count":"3","comment_count":"1","creation_date":"2011-07-08 17:44:36.647 UTC","last_activity_date":"2015-11-05 20:11:07.593 UTC","last_edit_date":"2015-11-05 20:11:07.593 UTC","last_editor_display_name":"","last_editor_user_id":"4027465","owner_display_name":"","owner_user_id":"835827","post_type_id":"1","score":"0","tags":"c++|header|include","view_count":"2422"} +{"id":"12690169","title":"mciSendString randomly stops working","body":"\u003cp\u003eMy code\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e char MusicLoc [50][200];\n char Music [50][50];\n int MusicBox(int IndexMusic)\n {\n std::string rawloc = ((std::string)\"open \\\"\"+MusicLoc[IndexMusic]+Music[IndexMusic]+\"\\\"type mpegvideo alias \"+Music[IndexMusic]);`\n mciSendString(rawloc.c_str(), NULL, 0, 0); \n mciSendString(((std::string)\"play \"+Music[IndexMusic]).c_str(), NULL, 0, 0);\n return 0;\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMusicLoc contains the path and Music contains the filename, so MusicLoc[1]+Music[1] would be C:\\etc\\etc\\etc\\audio.mp3 , it worked fine at first but then it randomly stopped working , I have tried everything and it doesn't work so I am gonna guess using mciSendString isn't recomended, so does anyone knows about a good and lightweight audio library?\u003c/p\u003e\n\n\u003cp\u003eEdit:\nThe first mciSendString returns 266, and the second one return 275, if its of any use, but I really haven't found good documentation about them.\u003c/p\u003e\n\n\u003cp\u003eAlso GetLastError says there is no error...\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2012-10-02 12:23:17.087 UTC","last_activity_date":"2012-10-02 16:07:50.09 UTC","last_edit_date":"2012-10-02 12:34:54.463 UTC","last_editor_display_name":"","last_editor_user_id":"1621086","owner_display_name":"","owner_user_id":"1621086","post_type_id":"1","score":"0","tags":"c++|audio|mcisendstring","view_count":"331"} +{"id":"20593907","title":"[Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid object name","body":"\u003cp\u003eI want to access the MS SQL Server and have the select query. I have installed the dll files and am using the \u003ccode\u003esqlsrv_query\u003c/code\u003e. The connection has been successful but I get:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e[Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid object\n name as error\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI am using PHP version 5.3.1\u003c/p\u003e\n\n\u003cp\u003eAfter the connection I have this code\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$sql = \"SELECT id, latitude, longitude from job \";\n$stmt = sqlsrv_query( $conn, $sql );\nif( $stmt === false) {\n die( print_r( sqlsrv_errors(), true) );\n}\n\nwhile( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC) ) {\n echo $row['latitude'].\", \".$row['longitude'].\"\u0026lt;br /\u0026gt;\";\n}\nsqlsrv_free_stmt( $stmt);\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"0","creation_date":"2013-12-15 11:20:43.897 UTC","favorite_count":"1","last_activity_date":"2016-03-18 12:15:27.29 UTC","last_edit_date":"2016-03-18 12:15:27.29 UTC","last_editor_display_name":"","last_editor_user_id":"2893376","owner_display_name":"","owner_user_id":"2709622","post_type_id":"1","score":"5","tags":"php|sql-server|sqlsrv","view_count":"983"} +{"id":"25580975","title":"How to programmatically post like and comment an URL on facebook?","body":"\u003cp\u003eThis is confusing. So just to clarify:\u003c/p\u003e\n\n\u003cp\u003eREQ #1: To fetch basic stats for a URL, you send GET request to:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ehttp://graph.facebook.com/?ids=http://some.com\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e(alternatively, FQL can be used to fetch stats for a URL, but that doesn't return the OpenGraph Object)\u003c/p\u003e\n\n\u003cp\u003eREQ #2: To fetch comments for a URL, you do a GET:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ehttp://graph.facebook.com/comments/?ids=http://some.com\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eREQ #3: To fetch likes for a URL, you GET:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ehttp://graph.facebook.com/likes/?ids=http://some.com\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut how do you comment on / like a URL programmatically?\u003c/p\u003e\n\n\u003cp\u003eI guess, likes can be created using Open Graph API, right? \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ehttps://graph.facebook.com/me/og.likes?object=1234\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhere 1234 is the OpenGraph Object ID of an article (as returned by REQ #1).\nBut this requires an approval process, the like action has to be approved by Facebook.\u003c/p\u003e\n\n\u003cp\u003eIs there a better way to do this? Can I use for example the Graph API for all these things?\u003c/p\u003e\n\n\u003cp\u003eMy goal:\u003c/p\u003e\n\n\u003cp\u003eCurrently I'm using the Facebook like button and comments plugin to create likes and comments. But these use the JS SDK, which is huge, and they generate a lot of external requests. I wanna get rid of them and just send an AJAX request to my server, which would then asynchronously talk to Facebook, and it would post the Like / Comment.\u003c/p\u003e\n\n\u003cp\u003eIs this possible?\u003c/p\u003e\n\n\u003cp\u003eThanks in advance!\u003c/p\u003e","answer_count":"3","comment_count":"0","creation_date":"2014-08-30 09:35:10.287 UTC","last_activity_date":"2014-08-30 11:35:02.96 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2297996","post_type_id":"1","score":"0","tags":"facebook-graph-api|facebook-like|facebook-comments","view_count":"1077"} +{"id":"41690120","title":"I am getting below error while using ui-grid in angular js","body":"\u003cp\u003e\u003cdiv class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\"\u003e\r\n\u003cdiv class=\"snippet-code\"\u003e\r\n\u003cpre class=\"snippet-code-js lang-js prettyprint-override\"\u003e\u003ccode\u003evar app = angular.module(\"finApp\", [\"ui.grid\"]);\r\napp.controller(\r\n \"finController\",\r\n function($scope, $http) {\r\n $http.get(\"url\", \"data\")\r\n .then(function(response) {\r\n $scope.gridOptions.data = response.data;\r\n\r\n }, function(errorResponse) {});\r\n });\u003c/code\u003e\u003c/pre\u003e\r\n\u003cpre class=\"snippet-code-html lang-html prettyprint-override\"\u003e\u003ccode\u003e\u0026lt;link href=\"https://cdn.rawgit.com/angular-ui/bower-ui-grid/master/ui-grid.min.css\" rel=\"stylesheet\"/\u0026gt;\r\n\u0026lt;script src=\"https://cdn.rawgit.com/angular-ui/bower-ui-grid/master/ui-grid.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\r\n\u0026lt;script src=\"https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\r\n\u0026lt;div ui-grid=\"gridOptions\" class=\"grid\"\u0026gt;\u0026lt;/div\u0026gt;\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003c/p\u003e\n\n\u003cp\u003eWhile executing above code I am getting below error:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eangular.min.js:122 TypeError: Cannot read property 'data' of undefined\u003cbr\u003e\n at new (ui-grid.js:3330)\u003cbr\u003e\n at Object.invoke (angular.min.js:43)\u003cbr\u003e\n at Q.instance (angular.min.js:93) \u003c/p\u003e\n\u003c/blockquote\u003e","accepted_answer_id":"41690175","answer_count":"3","comment_count":"2","creation_date":"2017-01-17 06:11:05.577 UTC","last_activity_date":"2017-01-19 20:30:36.76 UTC","last_edit_date":"2017-01-19 20:30:36.76 UTC","last_editor_display_name":"","last_editor_user_id":"383819","owner_display_name":"","owner_user_id":"7414015","post_type_id":"1","score":"0","tags":"angularjs","view_count":"43"} +{"id":"27028184","title":"How to close JOptionPane","body":"\u003cp\u003eI have a JoptionPane like below. However, when I select a value and hit 'OK' it does return the value, but the frame still remains as is. Only after 'cancel' or 'X' mark on the top, it closes. How to fix this.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e JOptionPane.showInputDialog(\n null,\n \"Select the user\",\n \"Users\",\n JOptionPane.INFORMATION_MESSAGE,\n null,\n userNames,\n userNames[0]);\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"2","creation_date":"2014-11-19 22:21:39.387 UTC","last_activity_date":"2014-11-20 15:24:12.303 UTC","last_edit_date":"2014-11-20 15:24:12.303 UTC","last_editor_display_name":"","last_editor_user_id":"2894369","owner_display_name":"","owner_user_id":"2945142","post_type_id":"1","score":"0","tags":"java|swing|joptionpane","view_count":"111"} +{"id":"29624524","title":"How can I print/log the checksum calculated by rsync?","body":"\u003cp\u003eI have to transfer millons of files of very different size summing up almost 100 TB between two Linux servers. It's easy to do it the first time with rsync, and quite safe, because data can be checksum'ed.\u003c/p\u003e\n\n\u003cp\u003eHowever, I need to keep a list of files and their checksum to do some checks regularly in the future.\u003c/p\u003e\n\n\u003cp\u003eIs there a way to tell rsync to print/log the checksum of the file?\nAnd in case this is not feasible: Which tool/command would you recommend considering that performance is very important?\u003c/p\u003e\n\n\u003cp\u003eThanks in advance!\u003c/p\u003e","accepted_answer_id":"45053057","answer_count":"1","comment_count":"2","creation_date":"2015-04-14 10:05:06.833 UTC","last_activity_date":"2017-07-12 08:59:20.057 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2705572","post_type_id":"1","score":"1","tags":"linux|md5|rsync|checksum","view_count":"404"} +{"id":"29612289","title":"C program crashes. My guess incorrect usage of arrays","body":"\u003cp\u003eTrying to make a program in C that solves N sized triangular board with M queens problem. Can't even get it to work. My guess it crashes because I use arrays incorrectly. Could you please explain to me what I am doing wrong here? \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;stdlib.h\u0026gt;\n#include \u0026lt;stdio.h\u0026gt;\n\nint checkPlaceability(int n, int (*board)[n], int row, int col);\nint placeQueens(int n, int m, int (*board)[n], int col);\n\nvoid main()\n{\n int n;\n int board[n][n];\n int m;\n\n printf(\"Enter board size: \\n\");\n scanf(\"%d\", \u0026amp;n);\n printf(\"Enter queen count: \\n\");\n scanf(\"%d\", \u0026amp;m);\n\n if(placeQueens(n, m, board, 0) == 0)\n {\n printf(\"Solution doesn't exist\");\n }\n else\n {\n printf(\"Solution exists\");\n }\n}\n\ncheckPlaceability(int n, int (*board)[n], int row, int col)\n{\n int i;\n int j;\n for(i = col; i \u0026lt; i++)\n {\n if(board[i][col] == 1)\n {\n return 0;\n }\n }\n for(i = 0; i \u0026lt; n; i++)\n {\n if(board[row][i] == 1)\n {\n return 0;\n }\n }\n for(i = abs(row - col)+1, j = 0; i \u0026lt; j \u0026amp;\u0026amp; j \u0026lt; n; i++, j++)\n {\n if(board[i][j] == 1)\n {\n return 0;\n }\n }\n return 1;\n}\n\nint placeQueens(int n, int m, int (*board)[n], int col)\n{\n int i;\n int queenCount = m;\n if(col \u0026gt;= n)\n {\n return 1;\n }\n for(i = 0; i \u0026lt; m; i++)\n {\n if(checkPlaceability(n, board, i, col) == 1)\n {\n board[i][col] = 1;\n queenCount--;\n if(queenCount == 0)\n {\n return 1;\n }\n if(placeQueens(n, queenCount, board, col+1) == 1)\n {\n return 1;\n }\n board[i][col] = 0;\n }\n }\n return 0;\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"29612337","answer_count":"1","comment_count":"3","creation_date":"2015-04-13 18:18:07.207 UTC","last_activity_date":"2015-04-13 18:20:45.173 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4324949","post_type_id":"1","score":"1","tags":"c|arrays|pointers","view_count":"74"} +{"id":"9779563","title":"How to resize images in a directory?","body":"\u003cp\u003eThis code attempts to resize images in a directory called \"imgs\". Unfortunately for some reason when I uncomment the listFiles(..) loop \u003ccode\u003eImageIO.read(sourceImageFile)\u003c/code\u003e will return null. Yet processing the same file straightaway outside the loop (\u003ccode\u003eres(\"imgs/foto_3.jpg\")\u003c/code\u003e) works. So apparently, this loop is preventing the files from being read. Solutions?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport java.awt.image.*;\nimport java.io.*;\nimport javax.imageio.*;\nimport static org.imgscalr.Scalr.*;\n\npublic class App {\n\n public static void main(String[] args) throws IOException {\n// for (File sourceImageFile : new File(\"imgs\").listFiles()) {\n// res(\"imgs/\"+sourceImageFile.getName());\n// }\n res(\"imgs/foto_3.jpg\");\n\n }\n\n public static void res(String arg) throws IOException {\n\n File sourceImageFile = new File(arg);\n BufferedImage img = ImageIO.read(sourceImageFile);\n\n BufferedImage thumbnail = resize(img, 500);\n\n thumbnail.createGraphics().drawImage(thumbnail, 0, 0, null);\n ImageIO.write(thumbnail, \"jpg\", new File(\"resized/\" + sourceImageFile.getName()));\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/lLWtA.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eTo reproduce the problem you can \u003ca href=\"http://dl.dropbox.com/u/23278095/ImgResizer.zip\" rel=\"nofollow noreferrer\"\u003edownload the Maven project\u003c/a\u003e.\u003c/p\u003e","accepted_answer_id":"9789947","answer_count":"5","comment_count":"0","creation_date":"2012-03-19 23:42:04.51 UTC","last_activity_date":"2012-03-21 10:30:30.527 UTC","last_edit_date":"2012-03-20 15:53:12.203 UTC","last_editor_display_name":"","last_editor_user_id":"553524","owner_display_name":"","owner_user_id":"300248","post_type_id":"1","score":"2","tags":"java|image-processing|foreach|javax.imageio|imgscalr","view_count":"2542"} +{"id":"22431301","title":"How to let users register using their social networking account?","body":"\u003cp\u003eI have a register page in my mobile app that I am building using (PhoneGap Api) HTML5, CSS3 and Javascript. I am planning to let users register using their facebook or gmail account. I am not sure how does that work any help/tips/tutorial links to accomplish that task on my webpage would be great ? \u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2014-03-16 00:00:03.22 UTC","favorite_count":"1","last_activity_date":"2014-03-16 00:21:40.9 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3157309","post_type_id":"1","score":"1","tags":"javascript|html5|cordova","view_count":"44"} +{"id":"20892875","title":"Using Python to communicate with a minecraft server","body":"\u003cp\u003eThis question was deleted when I was just about to answer it with some relevant information. I thought that, although it was phrased in a way which made people dislike it, and no code was posted, it \u003cem\u003ewas\u003c/em\u003e a useful question. As such, I decided to post it here, along with my partial answer. The current code I have has a problem with it, if anyone knows a solution I would be glad to hear it. Also, if anyone knows a cleaner solution (e.g. using the \u003ccode\u003ecommunicate\u003c/code\u003e method of \u003ccode\u003ePopen\u003c/code\u003e objects), that would be good too.\u003c/p\u003e\n\n\u003cp\u003eAs I remember it, the relevant part of the question was this:\u003c/p\u003e\n\n\u003cp\u003eHow can I use Python to communicate with a Minecraft server? I have a user interface set up, but I am unsure how I can connect to the server and send commands through to it.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-01-02 22:11:09.617 UTC","last_activity_date":"2014-01-02 22:11:09.617 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2387370","post_type_id":"1","score":"0","tags":"python|subprocess|ipc|minecraft","view_count":"1011"} +{"id":"43301897","title":"Web Crawler for extracting data out of blouinartinfo.com","body":"\u003cp\u003eI've been trying to extract data from \"blouinartinfo.com\", as we need certain labels of a particular artist in the website. \nI've tried using different online web crawlers but none seem to work. This is the URL of one particular painting in the website. (\u003ca href=\"http://artsalesindex.artinfo.com/auctions/Kenny-Scharf-6649611/El-Roi-est-Arriv%C3%A9-2011\" rel=\"nofollow noreferrer\"\u003ehttp://artsalesindex.artinfo.com/auctions/Kenny-Scharf-6649611/El-Roi-est-Arriv%C3%A9-2011\u003c/a\u003e). Does anyone know how to go about extracting data into a CSV file from this website?\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-04-09 00:49:12.22 UTC","last_activity_date":"2017-04-09 00:49:12.22 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7838923","post_type_id":"1","score":"0","tags":"web-crawler","view_count":"11"} +{"id":"22958168","title":"Cakephp 2.x Authentication Login not working","body":"\u003cp\u003eI started off creating a single form to create users/password records in my database. I realize that passwords being created were not being encrypted automatically so i grabbed some sample code from the internet to encrypt my passwords when user records are created.\u003c/p\u003e\n\n\u003cp\u003eThe problem is my users still cannot log in.\u003c/p\u003e\n\n\u003cp\u003eHere is the User model, the code is supposed to sha256 the password (when creating the user record)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic function beforeSave($options = array()) {\n if (!empty($this-\u0026gt;data['User']['password'])) {\n $passwordHasher = new SimplePasswordHasher(array('hashType' =\u0026gt; 'sha256'));\n $this-\u0026gt;data['User']['password'] = $passwordHasher-\u0026gt;hash(\n $this-\u0026gt;data['User']['password']\n );\n }\n return true;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis seems to result in the password being saved in the database as a string of encrypted looking gibberish. Hence i assume the encryption is working!\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eAnd now we move on to the login form.\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eHere is the LoginsController login code that displays login.ctp and processes the login.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic function login() {\n if ($this-\u0026gt;request-\u0026gt;is('post')) {\n if ($this-\u0026gt;Auth-\u0026gt;login()) {\n $this-\u0026gt;redirect($this-\u0026gt;Auth-\u0026gt;redirect());\n } else {\n $this-\u0026gt;Session-\u0026gt;setFlash('Your username/password combination was incorrect');\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is my login.ctp\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;h2\u0026gt;Login\u0026lt;/h2\u0026gt;\n\n\u0026lt;?php\n\necho $this-\u0026gt;Form-\u0026gt;create();\necho $this-\u0026gt;Form-\u0026gt;input('username');\necho $this-\u0026gt;Form-\u0026gt;input('password');\necho $this-\u0026gt;Form-\u0026gt;end('Login');\n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSince I have sha256 hashtype specified in my earlier User Model in the beforeSave function, I also then added into my AppController an Auth component 'authenticate' array to specify 'hashType' =\u003e 'sha256'. I assume this instructs Cakephp which hashtype to use when a user tries to log in.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic $components = array(\n 'DebugKit.Toolbar',\n 'Session',\n 'Auth'=\u0026gt;array(\n 'loginRedirect'=\u0026gt;array('controller'=\u0026gt;'logins', 'action'=\u0026gt;'login'), \n 'logoutRedirect'=\u0026gt;array('controller'=\u0026gt;'logins', 'action'=\u0026gt;'logout'), \n 'authError'=\u0026gt;'You cannot access that page', //Error message whenever someone access a page without auth\n 'authorize'=\u0026gt;array('Controller') //Where in our application that authorization will occur\n\n ),\n 'authenticate' =\u0026gt; array(\n 'Form' =\u0026gt; array(\n 'passwordHasher' =\u0026gt; array(\n 'className' =\u0026gt; 'Simple',\n 'hashType' =\u0026gt; 'sha256'\n )\n )\n )\n);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI realize whether or not I have this 'hashType' =\u003e 'sha256' in my AppController or not, the login does not work. When attempting to login, it always results in message \u003cstrong\u003e\"Your username/password combination was incorrect\"\u003c/strong\u003e which is from LoginsController login action.\u003c/p\u003e\n\n\u003cp\u003eQuestions\u003c/p\u003e\n\n\u003cp\u003e1) How can I troubleshoot the user not being able to log in? \u003c/p\u003e\n\n\u003cp\u003e2) Why are there so many ways (i found on various sites) to encrypt password (e.g using alias, using Security::hash, and using SimplePasswordHasher, etc)\u003c/p\u003e\n\n\u003cp\u003e3) What is the default encryption expected by Auth component?\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","answer_count":"3","comment_count":"1","creation_date":"2014-04-09 09:25:07 UTC","last_activity_date":"2014-04-09 15:10:27.83 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3189873","post_type_id":"1","score":"0","tags":"cakephp|authentication|encryption|login","view_count":"1045"} +{"id":"7162134","title":"In JSF 1.2 how do I changing Logging level of RenderResponsePhase?","body":"\u003cp\u003eI am getting the following messsage in System out: \"\u003cstrong\u003eFacesMessage(s) have been enqueued....\u003c/strong\u003e\".\u003c/p\u003e\n\n\u003cp\u003eThe solution with Sun's JavaServer Faces implementation (1.2_07-b03-FCS) was to add this to web.xml:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;context-param\u0026gt;\n \u0026lt;description\u0026gt;\n Set to true to disable the following warning message:\n FacesMessage(s) have been enqueued, but may not have been displayed\n \u0026lt;/description\u0026gt;\n \u0026lt;param-name\u0026gt;com.ibm.ws.jsf.disableEnqueuedMessagesWarning\u0026lt;/param-name\u0026gt;\n \u0026lt;param-value\u0026gt;true\u0026lt;/param-value\u0026gt;\n\u0026lt;/context-param\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut for some reason that solution does not work with this Implemenation that I am using\n\u003cstrong\u003eMojarra (1.2_15-b01-FCS).\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eThis document says I need to simply change the logger of RenderResponsePhase.\u003cbr\u003e\n\u003ca href=\"http://community.jbox.org/thread/151692\" rel=\"nofollow\" title=\"FacesMessage\u0026#40;s\u0026#41; have been encoded..\"\u003eFaces Message(s) habe been encoded...\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eEssentially, I think I am asking is what is the logger class I need to configure for the RenderResponsePhase.\u003c/p\u003e","accepted_answer_id":"7163040","answer_count":"1","comment_count":"0","creation_date":"2011-08-23 13:56:41.693 UTC","favorite_count":"1","last_activity_date":"2011-08-23 15:02:01.333 UTC","last_edit_date":"2011-08-23 15:02:01.333 UTC","last_editor_display_name":"","last_editor_user_id":"157882","owner_display_name":"","owner_user_id":"149923","post_type_id":"1","score":"1","tags":"java|jsf|logging|jsf-1.2","view_count":"2473"} +{"id":"30089117","title":"Kou's algorithm to find Steiner Tree using igraph","body":"\u003cp\u003eI am trying to implement the Kou's algorithm to identify Steiner Tree(s) in R using igraph.\u003c/p\u003e\n\n\u003cp\u003eThe Kou's algorithm can be described like this:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eFind the complete distance graph G' (G' has V' = S (steiner nodes) , and for each pair of nodes (u,v) in VxV there is an edge with weight equal to the weight of the min-cost path between these nodes p_(u,v) in G) \u003c/li\u003e\n\u003cli\u003eFind a minimum spanning tree T' in G' \u003c/li\u003e\n\u003cli\u003eConstruct the subgraph Gs, of G by substituting every edge of T', which is an edge of G' with the corresponding shortest path of G (it there are several shortest paths, pick an arbitrary one). \u003c/li\u003e\n\u003cli\u003eFind the minimal spanning tree, Ts, of Gs (If there are several minimal spanning trees, pick an arbitrary one)\u003c/li\u003e\n\u003cli\u003eConstruct a Steiner tree, Th, from Ts by deleting edges in Ts, if necessary, to that all the leaves in Th are Steiner nodes.\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eThe first 2 steps are easy:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eg \u0026lt;- erdos.renyi.game(100, 1/10) # graph\nV(g)$name \u0026lt;- 1:100\n\n# Some steiner nodes\nsteiner.points \u0026lt;- sample(1:100, 5)\n\n# Complete distance graph G'\nGi \u0026lt;- graph.full(5)\nV(Gi)$name \u0026lt;- steiner.points\n\n# Find a minimum spanning tree T' in G'\nmst \u0026lt;- minimum.spanning.tree(Gi)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, I don't know how to replace the edges in T' for the shortest path in G. I know that with \u003ccode\u003eget.shortest.paths\u003c/code\u003e I can get the \u003ccode\u003evpath\u003c/code\u003e from a pair of nodes, but how I replace and edge in T' with the \u003ccode\u003eshortest.path\u003c/code\u003e in G?\u003c/p\u003e\n\n\u003cp\u003eMany thanks in advance \u003c/p\u003e","accepted_answer_id":"30197321","answer_count":"1","comment_count":"0","creation_date":"2015-05-06 23:00:36.13 UTC","favorite_count":"1","last_activity_date":"2015-11-11 19:20:59.08 UTC","last_edit_date":"2015-11-11 19:20:59.08 UTC","last_editor_display_name":"","last_editor_user_id":"126273","owner_display_name":"","owner_user_id":"2380782","post_type_id":"1","score":"12","tags":"r|igraph","view_count":"669"} +{"id":"7240374","title":"Is mx.containers.HDividedBox deprecated in Flex 4.5?","body":"\u003cp\u003eIs mx.containers.HDividedBox deprecated by some spark container in Flex 4.5?\u003c/p\u003e\n\n\u003cp\u003eI'm new to Flex programming and can't find any spark replacement for it.\u003c/p\u003e\n\n\u003cp\u003eI want to have 2 Lists separated by movable vertical bar.\u003c/p\u003e","accepted_answer_id":"7240406","answer_count":"1","comment_count":"0","creation_date":"2011-08-30 08:10:46.26 UTC","last_activity_date":"2015-08-13 12:13:01.593 UTC","last_edit_date":"2015-08-13 12:13:01.593 UTC","last_editor_display_name":"","last_editor_user_id":"1560062","owner_display_name":"","owner_user_id":"165071","post_type_id":"1","score":"2","tags":"flex|flex4|flex4.5|mxml|flex-spark","view_count":"709"} +{"id":"44698766","title":"Why does Gson's toJson return null when using one-liner map","body":"\u003cp\u003eSomehow \u003ccode\u003enew Gson().toJson()\u003c/code\u003e returns null when I give it an one-liner map:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eMap map = new HashMap() {{ put(\"hei\", \"sann\"); }};\nnew Gson().toJson(map); // returns null!\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAll other implementations I can find works as expected:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enew JSONObject(map).toString(); // returns {\"hei\":\"sann\"}\nJsonOutput.toJson(map); // returns {\"hei\":\"sann\"}\nnew ObjectMapper().writeValueAsString(map); // returns {\"hei\":\"sann\"}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt works if I wrap the map:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enew Gson().toJson(new HashMap(map)); // returns {\"hei\":\"sann\"}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eA regular map works too:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emap = new HashMap();\nmap.put(\"hei\", \"sann\");\nnew Gson().toJson(map); // returns {\"hei\":\"sann\"}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs it a bug or a feature?\u003c/p\u003e\n\n\u003cp\u003eI've created a test project at \u003ca href=\"https://github.com/henrik242/map2json\" rel=\"nofollow noreferrer\"\u003ehttps://github.com/henrik242/map2json\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eRelevant Gson issue: \u003ca href=\"https://github.com/google/gson/issues/1080\" rel=\"nofollow noreferrer\"\u003ehttps://github.com/google/gson/issues/1080\u003c/a\u003e\u003c/p\u003e","answer_count":"0","comment_count":"4","creation_date":"2017-06-22 11:56:27.017 UTC","last_activity_date":"2017-06-22 12:03:01.037 UTC","last_edit_date":"2017-06-22 12:03:01.037 UTC","last_editor_display_name":"","last_editor_user_id":"13365","owner_display_name":"","owner_user_id":"13365","post_type_id":"1","score":"0","tags":"java|json|serialization|gson","view_count":"68"} +{"id":"43515598","title":"Linq to XElement, multiple parameters","body":"\u003cp\u003eI am creating an \u003ccode\u003eXElement\u003c/code\u003e object and have problems adding multiple elements to a node using Linq.\u003c/p\u003e\n\n\u003cp\u003eThere's a list of objects with multiple properties:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass Point { int x; int y; ... }\n\nList\u0026lt;Point\u0026gt; Points = new List\u0026lt;Point\u0026gt;()\n{ \n new Point(1,2), \n new Point(3,4) \n};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI would like to convert this list to a flat \u003ccode\u003eXElement\u003c/code\u003e using single constructor (in one go).\u003c/p\u003e\n\n\u003cp\u003eWhat I want to see:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;Points\u0026gt;\n \u0026lt;x\u0026gt;1\u0026lt;/x\u0026gt;\n \u0026lt;y\u0026gt;2\u0026lt;/y\u0026gt;\n \u0026lt;x\u0026gt;3\u0026lt;/x\u0026gt;\n \u0026lt;y\u0026gt;4\u0026lt;/y\u0026gt;\n\u0026lt;/Points\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe furthest I got so far:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enew XElement(\"Points\",\n Points.Select(a =\u0026gt; new {\n X = new XElement(\"x\", a.x),\n Y = new XElement(\"y\", a.y)\n });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhich produces a nested list, parsed as a single \u003ccode\u003eXElement\u003c/code\u003e.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;Points\u0026gt;{ X = \u0026lt;x\u0026gt;1\u0026lt;/x\u0026gt;, Y = \u0026lt;y\u0026gt;2\u0026lt;/y\u0026gt; }{ X = \u0026lt;x\u0026gt;3\u0026lt;/x\u0026gt;, Y = \u0026lt;y\u0026gt;4\u0026lt;/y\u0026gt; }\u0026lt;/Points\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e(I need to preserve the order so union wouldn't work)\u003c/p\u003e\n\n\u003cp\u003eI want to do everything in the constructor, like above, and \u003cstrong\u003edon't want\u003c/strong\u003e to manually add points like so:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eXElement PointsXml = new XElement(\"Points\");\nforeach (var item in Points)\n{\n PointsXml.Add(item.x);\n PointsXml.Add(item.y);\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"43515836","answer_count":"1","comment_count":"0","creation_date":"2017-04-20 09:30:50.067 UTC","last_activity_date":"2017-04-20 14:58:01.837 UTC","last_edit_date":"2017-04-20 14:58:01.837 UTC","last_editor_display_name":"","last_editor_user_id":"5226582","owner_display_name":"","owner_user_id":"5226582","post_type_id":"1","score":"1","tags":"c#|linq|linq-to-xml|xelement","view_count":"53"} +{"id":"21738763","title":"document.getElementById returns null when working with iFrame","body":"\u003cp\u003eMy html page has the following 2 scripts:\u003c/p\u003e\n\n\u003cp\u003e1.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;script language=\"javascript\" type=\"text/javascript\"\u0026gt;\n document.write(\"\u0026lt;iframe id=\\\"frame\\\" src=\\\"http://mywebsite.com/\" + \"\\\"scrolling=\\\"yes\\\" width=\\\"850\\\" height=\\\"575\\\" frameborder=0\u0026gt;\u0026lt;/iframe\u0026gt;\");\n \u0026lt;/script\u0026gt; \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e2.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;script type=\"text/javascript\"\u0026gt;\n\n var myframe = document.getElementById(\"frame\");\n if (myframe) {\n\n var myframe_window = document.getElementById('frame').contentWindow;\n if (myframe_window) {\n myframe_window.confirm = window.confirm;\n }\n }\n\n\u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm trying to override a methiod in iFrame, but cannot get its id.\nWhat am I doing wrong?\u003c/p\u003e","answer_count":"0","comment_count":"7","creation_date":"2014-02-12 20:20:33.407 UTC","last_activity_date":"2014-02-12 20:20:33.407 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2918237","post_type_id":"1","score":"2","tags":"javascript|iframe|getelementbyid","view_count":"1676"} +{"id":"18854722","title":"Cropping an image taken from AVCaptureStillImageOutput","body":"\u003cp\u003eI am trying to crop an image taken from AVCaptureStillImageOutput but unable to properly crop at the correct rectangles.\u003c/p\u003e\n\n\u003cp\u003eMy preview of camera video is 320x458 frame and the cropping rectangle is present inside this preview frame which has the co-ordinates and size as CGRectMake(60, 20, 200, 420).\u003c/p\u003e\n\n\u003cp\u003eAfter taking the picture, I receive the image from \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eNSData *imageData = [AVCaptureStillImageOutput jpegStillImageNSDataRepresentation:imageDataSampleBuffer];\nUIImage *image = [[UIImage alloc] initWithData:imageData];\nUIImage *finalImage = [self cropImage:image];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAfterwards I am trying to crop this actual image of size 1080x1920 with the below function. I am getting a wayward clipping and the resultant image is way out of the actual rectangle! ;(\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e- (UIImage *)cropImage:(UIImage *)oldImage {\n CGRect rect = CGRectMake(60, 20, 200, 420);\n CGSize boundSize = CGSizeMake(320, 458);\n\n float widthFactor = rect.size.width * (oldImage.size.width/boundSize.width);\n float heightFactor = rect.size.height * (oldImage.size.height/boundSize.height);\n float factorX = rect.origin.x * (oldImage.size.width/boundSize.width);\n float factorY = rect.origin.y * (oldImage.size.height/boundSize.height);\n\n CGRect factoredRect = CGRectMake(factorX,factorY,widthFactor,heightFactor);\n UIImage *croppedImage = [UIImage imageWithCGImage:CGImageCreateWithImageInRect([oldImage CGImage], factoredRect) scale:oldImage.scale orientation:oldImage.imageOrientation];\n return croppedImage;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn the attached picture, I am trying to crop the coffee mug, but what I get is not the correct cropped image!\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/7WJig.jpg\" alt=\"Image to be cropped\"\u003e\n\u003cimg src=\"https://i.stack.imgur.com/WsYtM.jpg\" alt=\"Cropped image - wrong\"\u003e\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2013-09-17 16:09:17.31 UTC","last_activity_date":"2013-09-18 06:55:10.763 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"402637","post_type_id":"1","score":"0","tags":"iphone|ios|objective-c|image|ios7","view_count":"1139"} +{"id":"31261279","title":"Mousehover does not work - Selenium, Java, Chrome","body":"\u003cp\u003eI am trying to automate the hover on a specified element, in my case is an specified office name. \nWhen I hover on an office the information of it should appear.\nMy problem is that when I run his code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eString officeId = findElement(designOfficesPosition, num).getAttribute(ConstantsFramework.ID);\nWebElement office = getSupport().getDriver().findElement(By.id(officeId));\n\n\naction.moveToElement(office).build().perform();\ngetSupport().pause(ConstantsFramework.TIME_OUT_10_SECONDS);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI don't get any errors but I don't see the information of the office. Am I missing something? Any ideas? Thanks\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eUPDATE\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eHere you can see a piece of the html:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div id=\"officesListPreview\"\u0026gt;\n\u0026lt;div class=\"roundBox previewOffice officesRotator\"\u0026gt;\n\u0026lt;h3\u0026gt;Office information\u0026lt;/h3\u0026gt;\n\u0026lt;p class=\"numbers\"\u0026gt;\n\u0026lt;div id=\"OPA-AT\" class=\"officeContainer\" style=\"display: none;\"\u0026gt;\n\u0026lt;div id=\"BPO-BG\" class=\"officeContainer\" style=\"display: block;\"\u0026gt;\n\u0026lt;a class=\"officeLink\" href=\"http://www.bpo.bg/\" target=\"_blank\" style=\"\"\u0026gt;\n\u0026lt;div class=\"detailsOffice\"\u0026gt;\n\u0026lt;/div\u0026gt;\n\u0026lt;div id=\"BOIP-BX\" class=\"officeContainer\" style=\"display: none;\"\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"31338508","answer_count":"2","comment_count":"5","creation_date":"2015-07-07 06:27:43.87 UTC","last_activity_date":"2017-09-27 13:40:13.727 UTC","last_edit_date":"2015-07-07 07:37:53.927 UTC","last_editor_display_name":"","last_editor_user_id":"4525016","owner_display_name":"","owner_user_id":"4525016","post_type_id":"1","score":"1","tags":"java|selenium|mousehover","view_count":"1059"} +{"id":"47600892","title":"Can't stop autocomplete from showing up in Safair","body":"\u003cp\u003eI'm trying to stop the autocomplete pop window from showing in Safari. All other browser work correctly and don't show it, but Safari does.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;input autofill=\"none\" autocorrect=\"off\" type=\"text\" name=\"client[name]\" id=\"client_name\" class=\"ui-autocomplete-input\" autocomplete=\"off\" data-com.agilebits.onepassword.user-edited=\"yes\"\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"2","creation_date":"2017-12-01 20:17:19.307 UTC","last_activity_date":"2017-12-01 20:17:19.307 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6504996","post_type_id":"1","score":"0","tags":"input|autocomplete|safari","view_count":"9"} +{"id":"30549090","title":"The type java.util.Map$Entry cannot be resolved. It is indirectly referenced from required .class files in property.put","body":"\u003cp\u003eI am getting this error in Properties.put\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eThe type java.util.Map$Entry cannot be resolved. It is indirectly referenced from required .class files\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"2","creation_date":"2015-05-30 17:17:08.42 UTC","last_activity_date":"2015-06-02 05:02:35.813 UTC","last_edit_date":"2015-06-02 05:02:35.813 UTC","last_editor_display_name":"","last_editor_user_id":"3202193","owner_display_name":"","owner_user_id":"4448694","post_type_id":"1","score":"0","tags":"java|eclipse|tomcat|servlets|helios","view_count":"1959"} +{"id":"38814816","title":"Missing base content types in Choose content Type settings wizard","body":"\u003cp\u003eIm trying to get going with add-ins for sharepoint online and have followed the steps defined in the following walk through.\n\u003ca href=\"https://msdn.microsoft.com/en-us/library/office/mt148587.aspx\" rel=\"nofollow\"\u003ehttps://msdn.microsoft.com/en-us/library/office/mt148587.aspx\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eWhen I get to step 3 however the base content drop down is blank and I can't create the custom content type. \nWhat am I missing?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-08-07 13:55:27.783 UTC","favorite_count":"1","last_activity_date":"2017-01-04 23:56:14.74 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5203030","post_type_id":"1","score":"0","tags":"c#|sharepoint|visual-studio-2015","view_count":"101"} +{"id":"28897169","title":"onchange of textbox will add corresponding textbox jquery","body":"\u003cpre\u003e\u003ccode\u003e$('.floor').change(function() {\n var floor1 = parseInt($('#firstfloor').val(), 10);\n var floor2 = parseInt($('#secondfloor').val(), 10);\n var floor3 = parseInt($('#thirdfloor').val(), 10);\n var floor4 = parseInt($('#fourthfloor').val(), 10);\n\n var storey = $('#nostorey').val();\n alert(storey);\n if(storey === 1){\n var total = floor1;\n }else if(storey === 2){\n var total = floor1 + floor2;\n }else if(storey === 3){\n var total = floor1 + floor2 + floor3;\n }else{\n var total = floor1 + floor2 + floor3 + floor4;\n }\n\n\n\n console.log(total);\n $('#area_total').val(total);\n });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have here 5 input \u003ccode\u003eon for determining the number of floors\u003c/code\u003e and \u003ccode\u003e1 for each floor\u003c/code\u003e i want to get the total area of the building by adding the area of each floor depending on the number of floors. What i did is to get the value or number of storey of the building then depeding on the value i have \u003ccode\u003eif\u003c/code\u003e statement to add what floor to add. Except for giving all 4 input value the rest will give \u003ccode\u003eNaN\u003c/code\u003e as result. Any idea is appreciated.\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eUPDATE\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://jsfiddle.net/guradio/av52163y/\" rel=\"nofollow\"\u003eFIDDLE\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"28897322","answer_count":"2","comment_count":"1","creation_date":"2015-03-06 10:48:46.553 UTC","last_activity_date":"2015-03-06 12:10:00.967 UTC","last_edit_date":"2015-03-06 11:05:28.85 UTC","last_editor_display_name":"","last_editor_user_id":"4018130","owner_display_name":"","owner_user_id":"4018130","post_type_id":"1","score":"0","tags":"javascript|jquery","view_count":"38"} +{"id":"18898121","title":"Java remove duplicates from List\u003cList\u003cfloat[]\u003e\u003e","body":"\u003cp\u003eI am attempting to remove duplicate records found in a \u003ccode\u003eList\u0026lt;List\u0026lt;float[]\u0026gt;\u0026gt;\u003c/code\u003e. I attempted to use a collection which does not allow duplicates(HashList) but I was unable to figure out how to cast this properly. To loop through all of my elements I would perform. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eList\u0026lt;List\u0026lt;float[]\u0026gt;\u0026gt; tmp; \n\nfor(int i=0; i\u0026lt;tmp.get(0).size();i++){\n System.out.println(java.util.Arrays.toString(tmp.get(0).get(i)));\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to remove them from the list inside. So all elements found at tmp.get(0).get(Here to remove) \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etmp.get(0).get(1) =[-70.89,42.12]\n\ntmp.get(0).get(2) =[-70.89,42.12]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI would like to remove tmp.get(0).get(2)\u003c/p\u003e\n\n\u003cp\u003eCurrent implementation, which works when there is only 1 duplicate but not multiple duplicates. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efor(int i=0; i\u0026lt;old.get(0).size();i++){\n if(i == old.get(0).size()-1){\n System.out.println(\"max size\");\n return old;\n }\n else if(Arrays.toString(old.get(0).get(i)).equalsIgnoreCase(Arrays.toString(old.get(0).get(i+1)))){\n old.get(0).remove(i);\n i++;\n } else {\n i++;\n }\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"18898681","answer_count":"3","comment_count":"8","creation_date":"2013-09-19 14:56:41.773 UTC","last_activity_date":"2013-09-19 17:04:25.44 UTC","last_edit_date":"2013-09-19 15:01:45.727 UTC","last_editor_display_name":"","last_editor_user_id":"2524908","owner_display_name":"","owner_user_id":"2524908","post_type_id":"1","score":"3","tags":"java|list","view_count":"614"} +{"id":"28336134","title":"Cloning a task to Multiple Accounts in Dynamics CRM 2013","body":"\u003cp\u003eI have a problem that I have been trying to solve and have been hitting Google most of the day with no joy.\u003c/p\u003e\n\n\u003cp\u003eI have a Microsoft Dynamics CRM 2013 system and the business is looking to allocate tasks to the sales reps by Account.\u003c/p\u003e\n\n\u003cp\u003eSo for example we may create a task for \"Check product XYZ pricing is correct for Feb promotion\" This task would then be assigned to the Accounts that it applied to, via say an Advanced Find.\u003c/p\u003e\n\n\u003cp\u003eI can do this with a workflow but that requires a workflow per task when I will have a number of these tasks, each with a separate list of target Accounts. I thought maybe use a dialog but those are limited to single account usage. Set up a Marketing Campaign for a single task looked like too much overhead to be the right way.\u003c/p\u003e\n\n\u003cp\u003eSo in the ideal world I would select a group of Accounts that meet a specific set of requirements, then create a task (Activity), which would be cloned across the selected Accounts.\u003c/p\u003e\n\n\u003cp\u003eAny ideas here? Or have I missed some basic functionality in the system.\u003c/p\u003e\n\n\u003cp\u003eThanks\nDave\u003c/p\u003e","answer_count":"0","comment_count":"5","creation_date":"2015-02-05 04:17:24.457 UTC","last_activity_date":"2015-02-06 01:31:49.7 UTC","last_edit_date":"2015-02-06 01:31:49.7 UTC","last_editor_display_name":"","last_editor_user_id":"4531298","owner_display_name":"","owner_user_id":"4531298","post_type_id":"1","score":"0","tags":"dynamics-crm|dynamics-crm-2013","view_count":"385"} +{"id":"10304398","title":"Passing two parameters to a function","body":"\u003cp\u003eI try to send a javascript function 2 parameters like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar par1;\nvar par2;\n\n$('#somediv').append('\u0026lt;div onclick=\"somefunction('+par1+','+par2+');\"\u0026gt;\u0026lt;/div\u0026gt;');\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ei'm creating a lot of divs like this one and all dynamicaly, i just need to find the correct way to pass the par1 and par2 to the operate them later.\u003c/p\u003e\n\n\u003cp\u003eright now only par1 is ok, par2 is undefined (they both has string value).\u003c/p\u003e\n\n\u003cp\u003eAny suggestions?\u003c/p\u003e","answer_count":"5","comment_count":"5","creation_date":"2012-04-24 19:04:43.147 UTC","last_activity_date":"2014-05-19 12:27:41.143 UTC","last_edit_date":"2012-04-24 19:24:53.293 UTC","last_editor_display_name":"","last_editor_user_id":"1282712","owner_display_name":"","owner_user_id":"1282712","post_type_id":"1","score":"0","tags":"javascript|jquery","view_count":"3584"} +{"id":"45897921","title":"how we use update hibernate query language for particular value data enter at runtime","body":"\u003cp\u003eI want to update add paid amount where new amount enter by enter by html on a particular id,id also enter in html \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ePrintWriter out = rs.getWriter();\n\n int id = Integer.parseInt(rq.getParameter(\"id\"));\n int pay = Integer.parseInt(rq.getParameter(\"pay\"));\n\n Configuration con = new Configuration();\n con.configure(\"hibernate.cfg.xml\");\n SessionFactory sf = con.buildSessionFactory();\n Session s = sf.openSession();\n Transaction t = s.beginTransaction();\n\n\n String query = \"update NewStdntpj c set c.paid = :paid+\"+pay+\" where c.sid = :\"+id+\" \";\n int result = s.createQuery( query )\n .setString( \"paid\", \"paid+pay\")\n .setString( \"sid\", \"id\" )\n .executeUpdate();\n\n\n s.save(query);\n t.commit();\n s.close();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ei use this code but getting error and error is \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eorg.hibernate.HibernateException: hibernate.cfg.xml not found\n org.hibernate.util.ConfigHelper.getResourceAsStream(ConfigHelper.java:147)\n org.hibernate.cfg.Configuration.getConfigurationInputStream(Configuration.java:1287)\n org.hibernate.cfg.Configuration.configure(Configuration.java:1309)\n sample.PaymentDue.service(PaymentDue.java:26)\n javax.servlet.http.HttpServlet.service(HttpServlet.java:725)\n org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) @Hovercraft Full Of Eels again getting same error\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-08-26 17:20:27.147 UTC","last_activity_date":"2017-08-26 18:36:26.077 UTC","last_edit_date":"2017-08-26 18:36:26.077 UTC","last_editor_display_name":"","last_editor_user_id":"6569115","owner_display_name":"","owner_user_id":"6569115","post_type_id":"1","score":"0","tags":"java|html|hibernate","view_count":"18"} +{"id":"37456065","title":"Understanding ClientContext.Load's Parameters","body":"\u003cp\u003eI have some code which makes calls to a SharePoint Managed Metadata Service that starts off like this : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar clientContext = new ClientContext(\"http://mysharepointsite/\")\n { AuthenticationMode = ClientAuthenticationMode.Default};\n\nvar taxonomySession = TaxonomySession.GetTaxonomySession(clientContext);\nvar termStore = taxonomySession.GetDefaultSiteCollectionTermStore();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhich I have no problem with. However, after this we have : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclientContext.Load(termStore,\n store =\u0026gt; store.Name,\n store =\u0026gt; store.Groups.Include(\n group =\u0026gt; group.Name,\n group =\u0026gt; group.TermSets.Include(\n termSet =\u0026gt; termSet.Name,\n termSet =\u0026gt; termSet.Terms.Include(\n term =\u0026gt; term.Name)\n )\n )\n);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCan anyone please help me understand what is going on here? \u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003cp\u003eAt first I thought this was some kind of LINQ query, but then I would expect the class to have the line \u003ccode\u003eusing System.Linq;\u003c/code\u003e, which it does not. \u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eI just noticed that in Visual Studio there is some IntelliSense which says the call is structured like this : \u003ccode\u003evoid ClientruntimeContext.Load\u0026lt;T\u0026gt;(T clientObject, params System.Linq.Expressions.Expression\u0026lt;Func\u0026lt;T, object\u0026gt;\u0026gt;[] retrievals)\u003c/code\u003e - which makes it seem like it is using Linq in some way\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eI understand that the code is in some way \"loading\" the termstore data in the managed metadata service from the given sharepoint site, but I don't quite understand what exactly that syntax is doing.\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eI got the code sample from \u003ca href=\"https://msdn.microsoft.com/en-us/library/office/dn904534.aspx\" rel=\"nofollow\"\u003ehere\u003c/a\u003e, and it does exactly what I want it to do but I would feel a lot more comfortable if I actually understood that syntax! \u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003e\u003ca href=\"https://msdn.microsoft.com/en-us/library/ee536388.aspx\" rel=\"nofollow\"\u003eThe documentation\u003c/a\u003e was also not particularly helpful, as it just defines \u003ccode\u003eLoad()\u003c/code\u003es parameters as \u003ccode\u003e\u0026lt;T\u0026gt;\u003c/code\u003e, which could be anything!\u003c/p\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eAny advice or recommended reading is much appreciated, thank you!\u003c/p\u003e","accepted_answer_id":"37652860","answer_count":"1","comment_count":"0","creation_date":"2016-05-26 08:55:39.4 UTC","favorite_count":"0","last_activity_date":"2016-06-06 08:34:07.487 UTC","last_edit_date":"2016-05-26 09:01:08.87 UTC","last_editor_display_name":"","last_editor_user_id":"4671754","owner_display_name":"","owner_user_id":"4671754","post_type_id":"1","score":"1","tags":"c#|linq|sharepoint|lambda","view_count":"1393"} +{"id":"47353286","title":"Akka: First message going to dead letters, from second message it is all fine","body":"\u003cp\u003eI have supervisor actor which selects child actor based on command received, whenever it creates a new child actor and sends message(ask pattern) it timesout as child actor tries to send back response but it goes to dead letters.\u003c/p\u003e\n\n\u003cp\u003eHere is the child actor code\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass IdActor(id: String, injector: Injector) extends Actor {\n override def receive: Receive = {\n case cmd: GenerateIdCmd =\u0026gt;\n val parent = sender()\n ...\n Future(idEvent) pipeTo sender //Issue is here going to dead letters\n //Future(idEvent) pipeTo parent //This also leads to same problem\n //parent ! idEvent // Same issue\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is supervisor code\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass IdSupervisor(injector: Injector) extends Actor {\n override def receive: Receive = {\n case cmd: GenerateIdCmd =\u0026gt;\n ...\n val ref = context.child(cmd.id).getOrElse {\n context.actorOf(Props(classOf[IdActor], cmd.id, injector), cmd.id)\n }\n ask(ref, cmd) pipeTo sender\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSecond message is flowing back to originator, first response from all new child actors going to dead letters from there afterwards going good.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eWorking Solution\u003c/strong\u003e\nIssue is with Supervisor, fixed code\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass IdSupervisor(injector: Injector) extends Actor {\n override def receive: Receive = {\n case cmd: GenerateIdCmd =\u0026gt;\n val originator = sender\n ...\n val ref = context.child(cmd.id).getOrElse {\n context.actorOf(Props(classOf[IdActor], cmd.id, injector), cmd.id)\n }\n ask(ref, cmd) pipeTo originator\n }\n }\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"47357137","answer_count":"2","comment_count":"0","creation_date":"2017-11-17 14:45:36.787 UTC","last_activity_date":"2017-11-18 06:13:12.23 UTC","last_edit_date":"2017-11-18 06:13:12.23 UTC","last_editor_display_name":"","last_editor_user_id":"862847","owner_display_name":"","owner_user_id":"862847","post_type_id":"1","score":"0","tags":"scala|akka","view_count":"45"} +{"id":"11244942","title":"How to upload docx, xlsx \u0026 txt files to Marklogic Server?","body":"\u003cp\u003eI have a folder which contains doc, docx, xlsx, pdf and txt files. I am uploading all these files into Marklogic with this XQuery:-\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efor $d in xdmp:filesystem-directory(\"C:\\uploads\")//dir:entry\nreturn \n xdmp:document-load($d//dir:pathname,\n \u0026lt;options xmlns=\"xdmp:document-load\"\u0026gt;\n \u0026lt;uri\u0026gt;{concat(\"/documents/\", string($d//dir:filename))}\u0026lt;/uri\u0026gt;\n \u0026lt;permissions\u0026gt;{xdmp:default-permissions()}\u0026lt;/permissions\u0026gt;\n \u0026lt;collections\u0026gt;{xdmp:default-collections()}\u0026lt;/collections\u0026gt;\n \u0026lt;format\u0026gt;binary\u0026lt;/format\u0026gt;\n \u0026lt;/options\u0026gt;)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have also installed content processing for my database. Now when I upload doc and pdf files they get converted to xml \u0026amp; xhtml files. But docx, xlsx, \u0026amp; txt do not get converted. Can somebody tell me why these files are not getting converted?\u003c/p\u003e","accepted_answer_id":"11248525","answer_count":"1","comment_count":"2","creation_date":"2012-06-28 12:43:56.657 UTC","last_activity_date":"2015-01-06 18:22:24.753 UTC","last_edit_date":"2015-01-06 18:22:24.753 UTC","last_editor_display_name":"","last_editor_user_id":"237867","owner_display_name":"","owner_user_id":"1326229","post_type_id":"1","score":"0","tags":"xquery|marklogic","view_count":"889"} +{"id":"31017692","title":"Is it possible to use Selenium as a library to interact with a web page?","body":"\u003cp\u003eSearching around the internet, it looks like in most cases Selenium is used as a tool for testing automation. I am wondering if it is the right choice if I want to write an application which will interact with a web page and do things for me automatically? \u003c/p\u003e\n\n\u003cp\u003eOr if there are better choices for this purpose?\u003c/p\u003e\n\n\u003cp\u003eThanks a lot!\u003c/p\u003e","accepted_answer_id":"31095191","answer_count":"1","comment_count":"0","creation_date":"2015-06-24 04:34:35.837 UTC","last_activity_date":"2015-06-28 01:09:55.133 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1982524","post_type_id":"1","score":"-1","tags":"selenium|selenium-webdriver|selenium-ide","view_count":"44"} +{"id":"45596172","title":"Ternary Function - Can't use function return value in write context","body":"\u003cp\u003eI am using a ternary function just to check if a value is empty or not.But its returning a fatal error \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eFatal error: Can't use function return value in write context in\n /home/sommelie/food.toogoodtogo.hu/wp-content/themes/...../woocommerce/config.woocommerce.php\n on line 551\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cpre\u003e\u003ccode\u003e $shipping = !empty(get_post_meta( $restaurant_id, 'delivery_charge', true )) ? get_post_meta( $restaurant_id, 'delivery_charge', true ) : '0.00';\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat could be a possible error?is there any error, i don't think so because it works on my server but not this current one.\u003c/p\u003e\n\n\u003cp\u003eI am not understanding why it's happening.This is a part of a wordpress theme.\u003c/p\u003e","answer_count":"1","comment_count":"6","creation_date":"2017-08-09 16:32:24.59 UTC","last_activity_date":"2017-08-09 17:04:02.67 UTC","last_edit_date":"2017-08-09 16:36:59.9 UTC","last_editor_display_name":"","last_editor_user_id":"5827005","owner_display_name":"","owner_user_id":"8057445","post_type_id":"1","score":"0","tags":"php|wordpress","view_count":"36"} +{"id":"37469725","title":"$cacheFactory deletes my cache when page reloads","body":"\u003cp\u003eSo I have a simple factory that creates cache object\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e.factory('jsonCache',function($cacheFactory){\n console.log(\"Creating cache\");\n return $cacheFactory('weatherCache');\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm then calling that cache object inside my controller like so by passing it in like so. But for some reason the data is not persistent. Every time I reload the page, the cache is empty again.\u003c/p\u003e\n\n\u003cp\u003eAny ideas? Did I miss something?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e.controller('citiesListCtrl',function($scope,$http,$filter,jsonCache){\n\n jsonCache.get('weatherCache');\n console.log(jsonCache); \u0026lt;----- EMPTY\n\n $http.get(url)\n .then(function(response) {\n\n jsonCache.put('weatherCache', response.data.records);\n console.log(jsonCache); \u0026lt;--- HAS DATA\n });\n)}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-05-26 19:45:23.963 UTC","last_activity_date":"2016-05-26 20:28:50.197 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1491565","post_type_id":"1","score":"2","tags":"angularjs|caching|cachefactory","view_count":"579"} +{"id":"22375421","title":"How to Merge rows with same value in rdlc?","body":"\u003cp\u003eI tried to create report using rdlc in Visual Studio 2010, but it gives this report:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e+-----------------+-----------+----------+----------+----------+----------+------------+\n| EmpName | Date | Und Vale | BROM-001 | BROM-002 | BROM-003 | Total Vale |\n+-----------------+-----------+----------+----------+----------+----------+------------+\n| Abelligos ,Alex | 3/13/2014 | 0.00 | 100.00 | 0.00 | 0.00 | 400.00 |\n| Abelligos ,Alex | 3/13/2014 | 0.00 | 0.00 | 0.00 | 200.00 | 400.00 |\n| Abelligos ,Alex | 3/13/2014 | 0.00 | 0.00 | 100.00 | 0.00 | 400.00 |\n+-----------------+-----------+----------+----------+----------+----------+------------+\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAll I want is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e+-----------------+-----------+----------+----------+----------+----------+------------+\n| EmpName | Date | Und Vale | BROM-001 | BROM-002 | BROM-003 | Total Vale |\n+-----------------+-----------+----------+----------+----------+----------+------------+\n| Abelligos ,Alex | 3/13/2014 | 0.00 | 100.00 | 100.00 | 200.00 | 400.00 |\n+-----------------+-----------+----------+----------+----------+----------+------------+\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny help?\u003c/p\u003e","answer_count":"1","comment_count":"8","creation_date":"2014-03-13 10:18:41.983 UTC","last_activity_date":"2017-07-30 10:13:05.477 UTC","last_edit_date":"2017-07-30 10:13:05.477 UTC","last_editor_display_name":"","last_editor_user_id":"4370109","owner_display_name":"","owner_user_id":"3409144","post_type_id":"1","score":"0","tags":"visual-studio-2010|reporting-services|rdlc","view_count":"1830"} +{"id":"5570275","title":"allow end-user to move a control","body":"\u003cp\u003eI found a good sample \u003ca href=\"https://stackoverflow.com/questions/3781245/how-to-allow-user-to-move-a-control-on-the-form/3781344#3781344\"\u003eHere\u003c/a\u003e, but I have a few problems with it.\n 1. It is not placing the control to the correct position where the mouse left off becase the control is a big one.\u003c/p\u003e\n\n\u003col start=\"2\"\u003e\n\u003cli\u003eIt could be pushed out of the screen.. I want it should stay within the screen boundaries. \u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eThis is my code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Public Sub Form1_MouseMove(ByVal sender As Object, ByVal e As MouseEventArgs) Handles MyControl.MouseMove\n If Not _capturingMoves Then\n Return\n End If\n X = e.X\n Y = e.Y\nEnd Sub\n\nPublic Sub Form1_MouseUp(ByVal sender As Object, ByVal e As MouseEventArgs) Handles MyControl.MouseUp\n If _capturingMoves Then\n ' Do any final placement\n MyControl.Location = New Point(X, Y)\n _capturingMoves = False\n End If\nEnd Sub\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"5572218","answer_count":"1","comment_count":"0","creation_date":"2011-04-06 17:09:42.163 UTC","favorite_count":"4","last_activity_date":"2017-04-03 20:45:38.85 UTC","last_edit_date":"2017-05-23 12:09:44.9 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"675516","post_type_id":"1","score":"2","tags":"vb.net|user-interface|end-user","view_count":"8284"} +{"id":"45544686","title":"EXCEL VBA: Dynamic range in custom sorting","body":"\u003cp\u003eI'm currently learning the art of VBA programming in Excel, but I've struck my head against a wall trying to figure out how to make my macro dynamic.\u003c/p\u003e\n\n\u003cp\u003eI'm trying to create a macro which is supposed to sort two columns (V \u0026amp; W). The V column is a list of names, and the W column is the number of stock-deals made, and I want to sort the names according to the number of deals made (Largest to smallest). The number of names(rows) will change every time I run the macro, which is why I need the range to be dynamic. \u003c/p\u003e\n\n\u003cp\u003eHere is my static code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Range(\"V5\").Select\nRange(Selection, Selection.End(xlDown)).Select\nRange(Selection, Selection.End(xlToRight)).Select\nActiveWorkbook.Worksheets(\"Partner attribution\").Sort.SortFields.Clear\nActiveWorkbook.Worksheets(\"Partner attribution\").Sort.SortFields.Add Key:= _\n Range(\"W5:W7\"), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:= _\n xlSortNormal\nWith ActiveWorkbook.Worksheets(\"Partner attribution\").Sort\n .SetRange Range(\"V5:W7\")\n .Header = xlGuess\n .MatchCase = False\n .Orientation = xlTopToBottom\n .SortMethod = xlPinYin\n .Apply\nEnd With\nRange(\"V5\").Select\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI've tried solutions like referring to the row count function, but as the entire W column has formulas, the \"blank\" cells will end on top, and the names and number of deals end in the bottom. \u003c/p\u003e\n\n\u003cp\u003eI hope some of you has the skills to make my range dynamic!\u003c/p\u003e\n\n\u003cp\u003eThanks :-) \u003c/p\u003e","answer_count":"3","comment_count":"1","creation_date":"2017-08-07 10:24:32.48 UTC","last_activity_date":"2017-08-07 18:27:57.68 UTC","last_edit_date":"2017-08-07 18:27:57.68 UTC","last_editor_display_name":"","last_editor_user_id":"6535336","owner_display_name":"","owner_user_id":"8428089","post_type_id":"1","score":"1","tags":"excel|vba|excel-vba|sorting","view_count":"130"} +{"id":"25450212","title":"Zend2 class loading in huge application","body":"\u003cp\u003eI started work on a huge project build on Zend2 with Sceleton and Modular structure.\u003c/p\u003e\n\n\u003cp\u003eThe project seems build professionally but with big performance issue (pages load for 15-30 sec).\u003cbr\u003e\nTiming from \u003ccode\u003eindex.php\u003c/code\u003e to Model.Controller.IndexAction is around 2 sec ... \u003c/p\u003e\n\n\u003cp\u003eI put a lot of research but couldn't find problem in the business logic.\u003cbr\u003e\nIt seems like \u003ccode\u003einclude $file\u003c/code\u003e and \u003ccode\u003enew $class\u003c/code\u003e (repeated thousands of times ) create the overall slowness.\u003c/p\u003e\n\n\u003cp\u003eAny suggestion where to look at will be appreciated.\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2014-08-22 15:08:01.91 UTC","favorite_count":"1","last_activity_date":"2014-08-22 15:08:01.91 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1621821","post_type_id":"1","score":"1","tags":"optimization|zend-framework2","view_count":"73"} +{"id":"6210309","title":"filenotfound issues in eclipse on Mac OSX","body":"\u003cp\u003eHi \nI have a java class which is working fine in windows but not in Mac OSX snow leopard. I am using Eclipse on both operating systems. On Mac OSX its throwing file not found exception. \u003c/p\u003e\n\n\u003cp\u003eBasically I am trying to read a file using BufferedReader and FileReader and I put my file in \\resources\\\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport java.io.BufferedReader;\nimport java.io.FileNotFoundException;\nimport java.io.FileReader;\nimport java.io.IOException;\n\npublic class ReadFileContents {\n\n /**\n * @param args\n */\n public static void main(String[] args) {\n\n BufferedReader br = null;\n String line = \"\";\n try {\n br = new BufferedReader(new FileReader(\"resources\\\\abc\"));\n while((line = br.readLine())!= null)\n {\n System.out.println(\"Read ::: \"+line+\" From File.\");\n }\n } catch (FileNotFoundException fne) {\n fne.printStackTrace();\n }catch (IOException ioe) {\n ioe.printStackTrace();\n }\n\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOn Mac it is giving\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ejava.io.FileNotFoundException: resources\\abc (No such file or directory)\n at java.io.FileInputStream.open(Native Method)\n at java.io.FileInputStream.\u0026lt;init\u0026gt;(FileInputStream.java:106)\n at java.io.FileInputStream.\u0026lt;init\u0026gt;(FileInputStream.java:66)\n at java.io.FileReader.\u0026lt;init\u0026gt;(FileReader.java:41)\n at ReadFileContents.main(ReadFileContents.java:18)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eDo I need any special configuration in my eclipse to get this working...\u003c/p\u003e","accepted_answer_id":"6210374","answer_count":"1","comment_count":"0","creation_date":"2011-06-02 04:19:28.38 UTC","last_activity_date":"2011-06-02 04:28:52.293 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"373625","post_type_id":"1","score":"0","tags":"eclipse|osx|filenotfoundexception","view_count":"2094"} +{"id":"37989676","title":"ERROR: missing FROM-clause entry for table when running function","body":"\u003cp\u003eI want to create a trigger and a function that do the following: Each time a new row is inserted in table SalesOrderDetail the function finds the corresponding CustomerID from table SalesOrderHeader and then it adds +1 to the corresponding number_of_sales in the Customer table.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSalesOrderDetail\n+---------+-------------------------+\n| SalesOrderID | SalesOrderDetailID |\n+---------+-------------------------+\n| value1 | value4 |\n| value1 | value5 |\n| value2 | value6 |\n| value3 | value7 |\n| value3 | value8 |\n| value4 | value9 |\n+---------+-------------------------+\n\n\nSalesOrderHeader\n+---------+-----------------+\n| SalesOrderID | CustomerID |\n+---------+-----------------+\n| value1 | value10 |\n| value2 | value11 |\n| value3 | value12 |\n| value4 | value13 |\n+---------+-----------------+\n\n\n\nCustomer\n+---------+--------------------+\n| CustomerID | Number_of_sales |\n+---------+--------------------+\n| value10 | value14 |\n| value11 | value15 |\n| value12 | value16 |\n| value13 | value17 |\n+---------+--------------------+\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCode is as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCREATE OR REPLACE FUNCTION new_order_detail()\nRETURNS trigger AS\n$BODY$\nBEGIN\n DROP TABLE IF EXISTS CustomerInfo;\n CREATE TEMP TABLE CustomerInfo AS\n SELECT* FROM(SELECT CustomerID FROM(\n SELECT * from SalesOrderHeader\n WHERE SalesOrderHeader.SalesOrderID = (SELECT SalesOrderID FROM SalesOrderDetail ORDER BY SalesOrderID DESC limit 1))AS Last_Entry) AS Common_Element;\n\n\n\n\n IF CustomerInfo.CustomerID = Customer.CustomerID THEN\n UPDATE Customer\n SET number_of_items = number_of_items + 1;\n END IF;\n\n\n\nEND;\n$BODY$ LANGUAGE plpgsql;\n\n\nDROP TRIGGER IF EXISTS new_order ON SalesOrderDetail;\n\nCREATE TRIGGER new_order\n AFTER INSERT OR UPDATE ON SalesOrderDetail\n FOR EACH ROW EXECUTE PROCEDURE new_order_detail();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I insert something into the SalesOrderDetail table I get the following error:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003ePL/pgSQL function new_order_detail() line 3 at SQL statement ERROR: \n missing FROM-clause entry for table \"customerinfo\" LINE 1: SELECT\n CustomerInfo.CustomerID = Customer.CustomerID\n ^ QUERY: SELECT CustomerInfo.CustomerID = Customer.CustomerID CONTEXT: PL/pgSQL function new_order_detail()\n line 12 at IF\n ********** Error **********\u003c/p\u003e\n \n \u003cp\u003eERROR: missing FROM-clause entry for table \"customerinfo\" SQL state:\n 42P01 Context: PL/pgSQL function new_order_detail() line 12 at IF\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eWhat I am doing wrong? Sorry for the poor explanation English is not my native language.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-06-23 10:59:10.877 UTC","last_activity_date":"2016-06-23 11:15:13.297 UTC","last_edit_date":"2016-06-23 11:07:16.82 UTC","last_editor_display_name":"","last_editor_user_id":"267540","owner_display_name":"","owner_user_id":"6498633","post_type_id":"1","score":"1","tags":"postgresql|plpgsql","view_count":"860"} +{"id":"4996347","title":"How to detect click on an object in OpenGL ES in Android application?","body":"\u003cp\u003eIn my Android application, I have a bunch of meshes in a collection that are moving around in 3D space. I want something to happen to the mesh when any one of the moving mesh (objects) are touched. How can I detect which object has been tapped / clicked?\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2011-02-14 19:24:42.547 UTC","favorite_count":"3","last_activity_date":"2016-02-22 22:26:47.253 UTC","last_edit_date":"2016-02-22 22:26:47.253 UTC","last_editor_display_name":"","last_editor_user_id":"4518455","owner_display_name":"","owner_user_id":"574122","post_type_id":"1","score":"6","tags":"android|opengl-es","view_count":"5705"} +{"id":"38483967","title":"jQuery replace with variable not working","body":"\u003cp\u003eI am trying to replace string with data.replace, its working fine if using hard code or static value. But now i want to replace multiple values with loop but its not working.\u003c/p\u003e\n\n\u003cp\u003eMy Code: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efor(var i = 0; i\u0026lt;words.length; i++){\n var r = words[i];\n data = data.replace(/\\[(\\[qid:{r})\\]]/g, words[i]);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWords contains: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eArray [ \"hid_1\", \"hid_2\", \"hid_6\", \"hid_7\" ]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand my data is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSite: [[qid:hid_1]]\u0026lt;br\u0026gt;\n\nBlock: [[qid:hid_2]]\u0026lt;br\u0026gt;\n\nNimewo kay la: [[qid:hid_6]]\u0026lt;br\u0026gt;\n\nLatitude: [[qid:hid_7]]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eits an HTML content.\u003c/p\u003e\n\n\u003cp\u003ei just need variable here:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efor(var i = 0; i\u0026lt;words.length; i++){\n\n var r = words[i];\n data = data.replace(/\\[(\\[qid:hid_1)\\]]/g, 'test');\n //data.replace(/\\[(\\[qid:{r})\\]]/g, 'test');\n\n }\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"38484577","answer_count":"3","comment_count":"9","creation_date":"2016-07-20 14:24:37.95 UTC","last_activity_date":"2016-07-20 17:39:19.397 UTC","last_edit_date":"2016-07-20 16:51:21.6 UTC","last_editor_display_name":"","last_editor_user_id":"3100816","owner_display_name":"","owner_user_id":"3100816","post_type_id":"1","score":"0","tags":"javascript|jquery","view_count":"70"} +{"id":"33864088","title":"MySQL case insensitive search in UTF8 processing latin uppercase/lowercase","body":"\u003cp\u003efolks.\nI'm new at MySQL programming and I've tried all things to manage this.\u003c/p\u003e\n\n\u003cp\u003eI would like to do a insensitive search with/without accents, lowercases or uppercases and all return the same results.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT * FROM table WHERE campo_pesquisado LIKE '%termo_pesquisado%' ORDER BY campo_pesquisado ASC\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo, in my DB (MyISAM - collation utf8_general_ci) I have this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e+---------+--------+\n| campo_pesquisado |\n+---------+--------+\n| São Paulo |\n|  SÃO JOÃO |\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI would like to type termo_pesquisado (keywords) = São Paulo, Sao Paulo, SÃO PAULO or any combination of 'São Paulo' to get the return of \u003cstrong\u003eSão Paulo\u003c/strong\u003e (that in browser shows correctly - São Paulo) from the database.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eTHE PROBLEM\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eIf I type \"são paulo, SãO PAULO or any combination with the \"\u003cstrong\u003eã\u003c/strong\u003e\" lowercase works. It's because the UTF-8 respective code for \u003cstrong\u003eã\u003c/strong\u003e is \u003cstrong\u003eã\u003c/strong\u003e. If I search for SÃO PAULO, the à letter become \u003cstrong\u003eÃ\u003c/strong\u003e the full word will be \u003cstrong\u003eSÃO PAULO\u003c/strong\u003e that is clearly not equal to \u003cstrong\u003eSão Paulo\u003c/strong\u003e.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eTRYING\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eTo solve this I tried this code bellow, but is not working for me.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e SELECT *, CONVERT(CAST( campo_pesquisado AS BINARY) USING utf8) FROM table WHERE CONVERT(CAST( campo_pesquisado AS BINARY) USING utf8) LIKE '%termo_pesquisado%' ORDER BY campo_pesquisado ASC\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eIMPORTANT\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI can't change my collation. We have to use utf8 as char encode for the tables. Its better for multilanguage purposes.\u003c/p\u003e\n\n\u003cp\u003eI'm using PHP (5.5) and the last version of MySQL.\u003c/p\u003e","answer_count":"0","comment_count":"10","creation_date":"2015-11-23 05:11:00.95 UTC","last_activity_date":"2015-11-23 05:11:00.95 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4188476","post_type_id":"1","score":"0","tags":"php|mysql|utf-8|latin1","view_count":"28"} +{"id":"3908368","title":"Cannot find any coverage data (ASP.NET MVC2)","body":"\u003cp\u003eI am having some issues with getting Code Coverage working with an out-of-the-box ASP.NET MVC2 Web App\u003c/p\u003e\n\n\u003cp\u003eVS2010 Ultimate, File \u003e New Project \u003e ASP.NET MVC 2 Web Application \u003e Yes, Create unit test project with Visual Studio Unit Test. I then Rebuild All, Run All Unit Tests, Go to Code Coverage and get the following message:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eCannot find any coverage data (.coverage or .coveragexml) files. Check test run details for possible errors.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eAll the unit tests passed. (And I haven't touched a line of code yet)\u003c/p\u003e\n\n\u003cp\u003eI did find the following on the web:\u003cbr\u003e\n\u003ca href=\"http://www.vbforums.com/showthread.php?t=615377\" rel=\"nofollow noreferrer\"\u003ehttp://www.vbforums.com/showthread.php?t=615377\u003c/a\u003e\u003cbr\u003e\nwhich says to do the following:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eTest -\u003e Edit Test Settings -\u003e Local\u003cbr\u003e\n In the test settings dialog, click\n \"Data and Diagnostics\" Ensure \"Code\n Coverage\" are checked, and\n double-click on it Check of the dll's\n you want code coverage enabled for.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eBut, when I go to Test \u003e Edit Test Seetings, all I see is the grayed out menu item stating \"No Test Settings Available\".\u003c/p\u003e\n\n\u003cp\u003eAny ideas?\u003c/p\u003e\n\n\u003cp\u003eEdit: slowly gaining traction. See: \u003ca href=\"https://stackoverflow.com/questions/1155743/how-to-create-the-vsmdi-testrunconfig-file-when-importing-a-visual-studio-test-pr\"\u003eHow to create the vsmdi/testrunconfig file when importing a Visual Studio test project?\u003c/a\u003e\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2010-10-11 17:06:43.437 UTC","last_activity_date":"2016-12-29 18:44:21.55 UTC","last_edit_date":"2017-05-23 12:24:55.603 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"156611","post_type_id":"1","score":"1","tags":"visual-studio-2010|unit-testing|asp.net-mvc-2","view_count":"2301"} +{"id":"43250637","title":"border with circle dots and border radius","body":"\u003cp\u003ewant to create div with border of 100% radius and also which would have circle dots not squere...\u003c/p\u003e\n\n\u003cp\u003eand everything what I found to was in the code snipped, but in this case don't have any radius.. :/ \u003c/p\u003e\n\n\u003cp\u003e\u003cdiv class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\"\u003e\r\n\u003cdiv class=\"snippet-code\"\u003e\r\n\u003cpre class=\"snippet-code-css lang-css prettyprint-override\"\u003e\u003ccode\u003e.image-container {\r\n position: relative;\r\n text-align: center;\r\n border-radius: 100%;\r\n border-width: 8px;\r\n border-color: #dfbc82;\r\n border-style: solid;\r\n border-image: url('https://d3uepj124s5rcx.cloudfront.net/items/0V28170w0f0k3t3S2p0g/dots.svg');\r\n border-image-slice: 33%;\r\n border-image-repeat: round;\r\n width: 150px;\r\n height: 150px;\r\n}\u003c/code\u003e\u003c/pre\u003e\r\n\u003cpre class=\"snippet-code-html lang-html prettyprint-override\"\u003e\u003ccode\u003e\u0026lt;div class=\"image-container\"\u0026gt;\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003c/p\u003e\n\n\u003cp\u003eis it possible? if yes, how? \u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2017-04-06 09:08:28.907 UTC","last_activity_date":"2017-04-06 09:21:01.053 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2932183","post_type_id":"1","score":"0","tags":"html|css|css3","view_count":"36"} +{"id":"19123298","title":"Use CURL to make a GET request with query parameters","body":"\u003cp\u003eI am making the following curl request from the console to test one of my REST API\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecurl -X GET \"http://localhost/api/v1/user/search.json?search_model[first_name]=abc\u0026amp;auth_token=xyzf\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut it is failing with the following error\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecurl: (3) [globbing] error: bad range specification after pos 58\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI wrapped the endpoint with \u003ccode\u003e\"\u003c/code\u003e because \u003ccode\u003e\u0026amp;\u003c/code\u003e is used to execute the precious command in console. What else am i missing? Why am i getting this error?\u003c/p\u003e","accepted_answer_id":"19123344","answer_count":"1","comment_count":"0","creation_date":"2013-10-01 18:27:49.073 UTC","favorite_count":"1","last_activity_date":"2013-10-01 18:30:16.607 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2112633","post_type_id":"1","score":"5","tags":"ruby-on-rails|rest|curl|console|query-parameters","view_count":"5484"} +{"id":"39977564","title":"How to compare one value in a table with a list of other values in another table","body":"\u003cp\u003eI have two tables:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ea = {customer1:1234, customer2:3456, customer3:4567, customer4:3456}\nb = {2345, 1234, 3456, 6789}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI would like to know if there is a way to compare the tables for a match. If no, then that value gets deleted. I am unable to find a way to do one to many compare against the values.\u003c/p\u003e\n\n\u003cp\u003ePlease can you advise on how I can achieve that?\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2016-10-11 12:45:11.18 UTC","last_activity_date":"2016-10-11 21:44:30.013 UTC","last_edit_date":"2016-10-11 21:44:30.013 UTC","last_editor_display_name":"","last_editor_user_id":"2505965","owner_display_name":"","owner_user_id":"1675307","post_type_id":"1","score":"0","tags":"lua|lua-table","view_count":"66"} +{"id":"29922734","title":"Searching function using PHP \u0026 mysql","body":"\u003cp\u003eIf I enter one value, the system will function properly. The problem is, when I enter more than one value, the system does not display any output. I need the user can enter the data in bulk and separated by a space. Is there any problem with my code? \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$studid = clean($_POST['studid']);\n$studid2 = $studid; \n$studid3 =explode(' ',$studid2);\nrequire(\"php/conn.php\");\n\n$sql=mysql_query(\"SELECT id,studid,name from student where studid in('\". implode(',', $studid3).\"') group by studid,name\");\n\necho\"\n\u0026lt;table\u0026gt;\n\u0026lt;thead\u0026gt;\u0026lt;tr\u0026gt;\u0026lt;th\u0026gt;NAME\u0026lt;/th\u0026gt;\u0026lt;th\u0026gt;IC NUMBER\u0026lt;/th\u0026gt;\u0026lt;th\u0026gt;ADDRESS\u0026lt;/th\u0026gt;\u0026lt;th\u0026gt;PHONE NUMBER\u0026lt;/th\u0026gt;\u0026lt;th\u0026gt;SOURCE\u0026lt;/th\u0026gt;\u0026lt;/tr\u0026gt;\u0026lt;/thead\u0026gt;\u0026lt;tbody\u0026gt;\";\n\nif(mysql_num_rows($q) \u0026gt; 0) \n{\n\n while($row=mysql_fetch_array($q))\n { \n echo\"\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;\".$row['nama'].\"\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\".$row['nokp'].\"\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\".$row['alamat2'].\"\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\".$row['notel2'].\"\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\".$row['info'].\"\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\";\n }\n\n echo \"\u0026lt;/tbody\u0026gt;\u0026lt;/table\u0026gt;\u0026lt;/div\u0026gt;\"; \n} \n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"9","creation_date":"2015-04-28 14:56:10.74 UTC","last_activity_date":"2015-04-28 17:16:00.937 UTC","last_edit_date":"2015-04-28 17:11:23.73 UTC","last_editor_display_name":"","last_editor_user_id":"4842602","owner_display_name":"","owner_user_id":"4842602","post_type_id":"1","score":"-2","tags":"php|mysql","view_count":"48"} +{"id":"46349021","title":"How can I control volume on external device (or know it's connected)?","body":"\u003cp\u003eI want to make an app to control volume on an external device (like Spotify Connect) as well as apps on my phone itself. I can control the volume using KEYCODE_VOLUME_UP, but the lag is terrible. If I use AudioManger, it's perfect but it doesn't work for the external device. I want to use AudioManager for the phone apps and KeyEvents for the external device. However, I'm not sure how to know when to use which. How can I tell if the phone is currently controlling an external device or not?\u003c/p\u003e\n\n\u003cp\u003eRight now I'm using \u003ccode\u003eAudioManager.getDevices()\u003c/code\u003e to find out what devices are connected, but there are several problems with this:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eIt only works on api 23+\u003c/li\u003e\n\u003cli\u003eThe only way to see if it is a phone is to compare against Build.MODEL which could (potentially) not work if there's variation\u003c/li\u003e\n\u003cli\u003eIt doesn't identify cases where you're connected to an external device but are controlling an app on the phone (like youtube) rather than something that's playing from that external device\u003c/li\u003e\n\u003c/ol\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-09-21 16:35:43.237 UTC","last_activity_date":"2017-09-21 17:04:31.603 UTC","last_edit_date":"2017-09-21 17:04:31.603 UTC","last_editor_display_name":"","last_editor_user_id":"5026136","owner_display_name":"","owner_user_id":"5026136","post_type_id":"1","score":"0","tags":"android|audio|external|keyevent|android-audiomanager","view_count":"9"} +{"id":"29306346","title":"Best place for UI-related initialization code UITableViewCell with Storyboard","body":"\u003cp\u003eWhat is the best place for UI-related code that should be run on initialization for a \u003ccode\u003eUITableViewCell\u003c/code\u003e subclass? i.e. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eself.someLabel.backgroundColor = [UIColor DISBadgeRed];\nself.anotherLabel.layer.cornerRadius = self.unseenMatchesLabel.frameHeight / 2;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003ebackground\u003c/strong\u003e\nIm using a storyboard so the designated initializer \u003ccode\u003e- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier\u003c/code\u003e isn't called and in \u003ccode\u003einitWithCoder:\u003c/code\u003e which es called, UI isn't ready for these calls.\u003c/p\u003e\n\n\u003cp\u003eI could call this code from a method that is called within \u003ccode\u003ecellForRow...\u003c/code\u003e but then it would end up being called every time.\u003c/p\u003e","accepted_answer_id":"29306494","answer_count":"1","comment_count":"2","creation_date":"2015-03-27 17:11:02.767 UTC","last_activity_date":"2015-03-27 17:18:11.467 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"922571","post_type_id":"1","score":"1","tags":"ios|objective-c|uitableview","view_count":"107"} +{"id":"5065727","title":"Reverse engineering tools for Java web applications","body":"\u003cp\u003eI have been searching in the Internet looking for an application which could take a Netbeans Web project and create an UML diagram resulting from these classes. Also, but not essential, I would like a similar tool for the JavaScript code I have in the Java web project I mentioned before. It's such an inferno trying to understand the structure and inner relations of this web project I was given.\u003c/p\u003e","answer_count":"7","comment_count":"0","creation_date":"2011-02-21 12:08:01.257 UTC","last_activity_date":"2014-09-10 13:12:31.52 UTC","last_edit_date":"2014-09-10 13:12:31.52 UTC","last_editor_display_name":"","last_editor_user_id":"467874","owner_display_name":"","owner_user_id":"626527","post_type_id":"1","score":"5","tags":"java|javascript|netbeans|uml|reverse-engineering","view_count":"4285"} +{"id":"23872314","title":"Defining Data Model in BusinessObjects 4.0","body":"\u003cp\u003e(I am working with BusinessObjects Information Design Tool, version 4.0)\u003c/p\u003e\n\n\u003cp\u003eI have two fact tables - FACT_MAN and FACT_TOTAL. They are defined as follows:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003cstrong\u003eFACT_Man\u003c/strong\u003e:\u003c/li\u003e\n\u003cli\u003e...\u003c/li\u003e\n\u003cli\u003eMP_Key\u003c/li\u003e\n\u003cli\u003ePC_Key\u003c/li\u003e\n\u003cli\u003e\u003cp\u003e...\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003e\u003cstrong\u003eFACT_TOTAL\u003c/strong\u003e:\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e...\u003c/li\u003e\n\u003cli\u003eMP_Key\u003c/li\u003e\n\u003cli\u003ePC_Key\u003c/li\u003e\n\u003cli\u003e...\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eThere is also \u003cstrong\u003eFLAT\u003c/strong\u003e dimension in the database, defined as follows:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003cstrong\u003eFLAT\u003c/strong\u003e\u003c/li\u003e\n\u003cli\u003e...\u003c/li\u003e\n\u003cli\u003eLeaf\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eBoth attributes \u003cstrong\u003eMP_Key\u003c/strong\u003e and \u003cstrong\u003ePC_Key\u003c/strong\u003e from both fact tables are connected to \u003cstrong\u003eLeaf\u003c/strong\u003e key (table \u003cstrong\u003eFLAT\u003c/strong\u003e) as follows:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003cstrong\u003eMP_Key\u003c/strong\u003e n:1 \u003cstrong\u003eLeaf\u003c/strong\u003e\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003ePC_Key\u003c/strong\u003e n:1 \u003cstrong\u003eLeaf\u003c/strong\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eThe question is: \u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eshould I model the universe so that I connect BOTH fact tables only to ONE FLAT dimension, \u003cstrong\u003eOR\u003c/strong\u003e \u003c/li\u003e\n\u003cli\u003eshould I use aliases, \u003cstrong\u003eOR\u003c/strong\u003e\u003c/li\u003e\n\u003cli\u003emaybe solve the problem with contexts, \u003cstrong\u003eOR\u003c/strong\u003e\u003c/li\u003e\n\u003cli\u003emy initial intention was to create only ONE universe with mentioned tables (there are additionaly 3 more FACT tables in the data warehouse). Would that be good approach, or should I maybe create MULTIPLE universes? If yes, what would be a valid reason for that? ... \u003cstrong\u003eOR\u003c/strong\u003e\u003c/li\u003e\n\u003cli\u003eis there some other better approach? \u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eSince I don't know which approach to take, could you please elaborate on your answer. Thanks.\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2014-05-26 14:24:19.15 UTC","last_activity_date":"2014-05-28 19:15:05.667 UTC","last_edit_date":"2014-05-26 14:37:40.763 UTC","last_editor_display_name":"","last_editor_user_id":"1956088","owner_display_name":"","owner_user_id":"1956088","post_type_id":"1","score":"0","tags":"business-objects","view_count":"63"} +{"id":"28739189","title":"loading data in datatable on onchange event","body":"\u003cp\u003eI want to implement function in which data will be loaded into datatable after onChange event. So for that I am trying to implement code as below.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar viewdatatab = $('#dataTablesFeedback').dataTable({ \n\n \"columns\": [\n\n { \"data\": \"resourceId\" },\n { \"data\": \"feedbackRecommendation\" },\n { \"data\": \"technicalSkillGaps\" },\n { \"data\": \"technicalAvgSkills\" },\n { \"data\": \"feedbackType\" },\n { \"data\": \"feedbackId\" },\n { \"data\": \"isNew\" },\n\n ]\n }); \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhich is creating my datatable layout and I am calling below function on dropdown change event is :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction loadFeedback(){\n\nviewdatatabJS = $('#dataTablesFeedback').dataTable({ \n \"processing\" : true,\n \"retrieve\" : true,\n \"ajax\" : \"/nhp/rest/feedback/viewFeedback\",\n \"fnServerParams\": function ( aoData ) {\n aoData.push( { \"name\": \"userName\", \"value\":employeeId } ,\n { \"name\": \"resourceId\", \"value\":mentorDataJson[$('#dropDownId').val()].resourceId });\n }, \n});\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhere I am passing some parameter in aoData.push but my URL is not getting called.\u003c/p\u003e","accepted_answer_id":"28827132","answer_count":"1","comment_count":"2","creation_date":"2015-02-26 09:54:12.393 UTC","last_activity_date":"2016-11-03 07:17:03.323 UTC","last_edit_date":"2015-02-28 02:34:43.987 UTC","last_editor_display_name":"","last_editor_user_id":"1407478","owner_display_name":"","owner_user_id":"2852218","post_type_id":"1","score":"0","tags":"javascript|jquery|twitter-bootstrap|jquery-datatables","view_count":"1612"} +{"id":"3578614","title":"WCF Ajax Call not working with Jquery $.ajax","body":"\u003cp\u003eI have the following jQuery (service name altered):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar url = \"http://localhost/services/MyService.svc/addentrant\";\nvar stuff = $(\"#signup-form\").serializeArray();\n\n$.ajax({\n type: \"POST\",\n url: url,\n contentType: \"application/json; charset=utf-8\",\n data: stuff,\n timeout: 10000,\n success: function (obj) { alert('yay!'); }\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe above makes a request to a WCF service hosted in Sitefinity on my local IIS7.5 server. Below is the relevant web.config:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;endpointBehaviors\u0026gt;\n\u0026lt;behavior name=\"jsonBehavior\"\u0026gt;\n \u0026lt;webHttp/\u0026gt;\n\u0026lt;/behavior\u0026gt;\n...\n\u0026lt;serviceBehaviors\u0026gt;\n \u0026lt;behavior name=\"DefaultBehavior\"\u0026gt;\n \u0026lt;serviceMetadata httpGetEnabled=\"true\"/\u0026gt;\n \u0026lt;/behavior\u0026gt;\n...\n\u0026lt;services\u0026gt;\n \u0026lt;service behaviorConfiguration=\"DefaultBehavior\" name=\"Services.MyService\" \u0026gt;\n \u0026lt;endpoint address=\"\" behaviorConfiguration=\"jsonBehavior\" binding=\"webHttpBinding\" contract=\"Services.IMyService\" bindingConfiguration=\"\"/\u0026gt;\n \u0026lt;endpoint address=\"mex\" binding=\"mexHttpBinding\" contract=\"IMetadataExchange\"/\u0026gt;\n \u0026lt;/service\u0026gt;\n...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFinally, the interface and implementation of MyService:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[ServiceContract(Name = \"MyService\", Namespace = \"http://myservice.com/services/2010/\")]\npublic interface IMyService\n{\n [OperationContract,\n WebInvoke(Method = \"POST\",\n ResponseFormat = WebMessageFormat.Json,\n BodyStyle = WebMessageBodyStyle.WrappedRequest,\n UriTemplate = \"addentrant\")]\n void AddEntrant(string firstName);\n}\n...\n[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]\npublic class MyService : IMyervice\n{\n...\n public void AddEntrant(string firstName)\n {\n Entrant entrant = new Entrant()\n {\n FirstName = firstName,\n };\n context.Entrants.InsertOnSubmit(entrant);\n context.SubmitChanges();\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI think that's everything. Anyway, the $.ajax call returns a success, but the web service method was not being called (I had a breakpoint set). \u003cstrong\u003eI opened up Fiddler and found I was being given a 405: Method Not Allowed\u003c/strong\u003e. I've seen that before, but only when I had forgotten to set up the method to allow POST requests. I'm very confused as to why it is doing this now.\u003c/p\u003e\n\n\u003cp\u003eAlso, oddly enough, if I clone the ajax request captured in Fiddler, I get the following:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eOPTIONS /services/MyService.svc/addentrant HTTP/1.1\nHost: localhost\nUser-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\nAccept-Language: en-us,en;q=0.5\nAccept-Encoding: gzip,deflate\nAccept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\nKeep-Alive: 115\nConnection: keep-alive\nOrigin: http://localhost:6339\nAccess-Control-Request-Method: POST\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eJust the header, no request body to speak of.\u003c/p\u003e","answer_count":"3","comment_count":"10","creation_date":"2010-08-26 19:11:15.063 UTC","favorite_count":"1","last_activity_date":"2017-02-04 12:49:08.79 UTC","last_edit_date":"2010-08-26 19:17:37.06 UTC","last_editor_display_name":"","last_editor_user_id":"36411","owner_display_name":"","owner_user_id":"36411","post_type_id":"1","score":"4","tags":"jquery|ajax|wcf|json|post","view_count":"7350"} +{"id":"25678112","title":"Insert item into a sorted list with Julia (with and without duplicates)","body":"\u003cp\u003e\u003cstrong\u003eMain Question\u003c/strong\u003e: What is the fastest way to insert an item into a list that is already sorted using Julia?\u003c/p\u003e\n\n\u003cp\u003eCurrently, I do this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ev = [1, 2, 3, 5] #example list\nx = 4 #value to insert\nindex = searchsortedfirst(v, x) #find index at which to insert x\ninsert!(v, index, x) #insert x at index\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eBonus Question\u003c/strong\u003e: What if I want to simultaneously ensure no duplicates?\u003c/p\u003e","accepted_answer_id":"25688266","answer_count":"1","comment_count":"0","creation_date":"2014-09-05 03:10:34.743 UTC","favorite_count":"0","last_activity_date":"2014-09-05 14:39:18.897 UTC","last_edit_date":"2014-09-05 14:36:25.03 UTC","last_editor_display_name":"","last_editor_user_id":"659248","owner_display_name":"","owner_user_id":"1667895","post_type_id":"1","score":"6","tags":"sorting|insert|julia-lang","view_count":"543"} +{"id":"25330784","title":"White Separator Above Table Section Headers","body":"\u003cp\u003eI'm having a really weird issue with table view separators. I have set the separator color to a dark gray which works great below the cells, but for some reason, there is a white separator before my section header (see the screenshot, above November). When I set the separator style to none, the line disappears which indicates that it is a separator. How can I remove this white separator line?\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/6TNiF.png\" alt=\"screenshots\"\u003e\u003c/p\u003e","accepted_answer_id":"25330871","answer_count":"2","comment_count":"0","creation_date":"2014-08-15 16:58:56.607 UTC","last_activity_date":"2017-01-27 10:22:11.093 UTC","last_edit_date":"2017-01-27 10:22:11.093 UTC","last_editor_display_name":"","last_editor_user_id":"865175","owner_display_name":"","owner_user_id":"1066424","post_type_id":"1","score":"3","tags":"ios|objective-c|uitableview|separator","view_count":"1545"} +{"id":"34371124","title":"How to vectorize sub2ind?","body":"\u003cp\u003eI have a 2 dimensional array \u003ccode\u003eL\u003c/code\u003e, and I am trying to create a vector of linear indices \u003ccode\u003eind\u003c/code\u003e for each row of this array.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eL=\n1 5 25 4 0 0 \n2 3 3 45 5 6\n45 5 6 0 0 0\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am using \u003ccode\u003elenr\u003c/code\u003e to store the number of non zero elements in each row (starting from column 1).\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elenr=\n4\n6\n3\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThen I have 1x45 array \u003ccode\u003eRULES\u003c/code\u003e. Indices stored in \u003ccode\u003eL\u003c/code\u003e refer to elements in \u003ccode\u003eRULES\u003c/code\u003e. Since I want to vectorize the code, I decided to create linear indices and then run \u003ccode\u003eRULES(ind)\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eThis works perfectly:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eind=sub2ind(size(L),1,lenr(1));\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhile this doesn't work:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eind=sub2ind(size(L),1:3,1:lenr(1:3));\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny ideas?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eUPDATE:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eThis is what I initially tried to vectorize the code, but it did not works and that's why I checked linear indices:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003erul=repmat(RULES,3);\nresult = rul((L(1:J,1:lenr(1:J))));\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"9","creation_date":"2015-12-19 13:05:51.403 UTC","last_activity_date":"2015-12-20 15:19:21.42 UTC","last_edit_date":"2015-12-19 13:19:13.727 UTC","last_editor_display_name":"","last_editor_user_id":"1089623","owner_display_name":"","owner_user_id":"1089623","post_type_id":"1","score":"2","tags":"matlab|vectorization","view_count":"56"} +{"id":"20832262","title":"'httpd-vhost.conf' breaks Wamp?","body":"\u003cp\u003eThis is my first post...\u003c/p\u003e\n\n\u003cp\u003eI am attempting to host a development website from my laptop using Wamp; my goal is to install Wordpress and have users log in from there homes...\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eI've successfully installed Wamp 2.2. \u003c/li\u003e\n\u003cli\u003eI've included \u003ccode\u003e27.0.0.1 localhost\u003c/code\u003e in my 'host' file.\u003c/li\u003e\n\u003cli\u003eI've removed the \u003ccode\u003e#\u003c/code\u003e from the front of \u003ccode\u003eInclude conf/extra/httpd-vhosts.conf\u003c/code\u003e.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003e\u003ccode\u003elocalhost\u003c/code\u003e works perfectly until I edit my 'httpd-vhost.conf' file to include the following...\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;VirtualHost *:80\u0026gt;\n SeverAdmin webmaster@localhost\n ServerName localhost\n DocumentRoot C:/Program Files/WampServer2/www\n ErrorLog \"C:/Program Files/WampServer2/www/logs/error.log\"\n CustomLog \"C:/Program Files/WampServer2/www/logs/access.log\" common\n\u0026lt;/VirtualHost\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOnce I restart Wamp the icon stays orange. If I attempt to put Wamp online, an alert titled 'Aestan Tray Menu' stating \"Could not execute menu item (internal error). [Exception] Could not preform service action: the service has not been started\".\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003ePort 80 tested as \"not actually used\".\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eWhen I run 'httpd.exe' a command window opens then immediately closes before I can read it. I've tried various formats to \u003ccode\u003e\u0026lt;VirtualHost *:80\u0026gt;\u003c/code\u003e with no avail, however once I comment out my changes I am able to successfully restart Wamp and access \u003ccode\u003elocalhost\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eI haven't been able to find post about this problem anywhere! \u003cstrong\u003eThanks!\u003c/strong\u003e\u003c/p\u003e","answer_count":"2","comment_count":"8","creation_date":"2013-12-30 01:51:01.133 UTC","favorite_count":"1","last_activity_date":"2016-04-17 11:27:28.107 UTC","last_edit_date":"2013-12-30 02:48:17.54 UTC","last_editor_display_name":"","last_editor_user_id":"3143054","owner_display_name":"","owner_user_id":"3143054","post_type_id":"1","score":"0","tags":"apache|wamp|virtualhost","view_count":"431"} +{"id":"7292564","title":"what is the difference between android service and web service","body":"\u003cp\u003eIs there any difference between Android's Service and a web service? Or both are similar concepts? If I want to connect to an online database from my Android phone then should I use an Android Service or a Web Service? \u003c/p\u003e","accepted_answer_id":"7292585","answer_count":"1","comment_count":"1","creation_date":"2011-09-03 10:27:51.507 UTC","last_activity_date":"2013-04-30 15:20:42.147 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"785544","post_type_id":"1","score":"1","tags":"android|service|web","view_count":"771"} +{"id":"27899096","title":"how to use env-var in parameters of custom tool","body":"\u003cp\u003ehow can I use an env. var (e.g. \u003ccode\u003eAPP_HOME_DIR\u003c/code\u003e) in the \u003ccode\u003eParameters\u003c/code\u003e field dialogue of \u003ccode\u003eTool Properties\u003c/code\u003e dialogue?\u003cbr\u003e\ni.e. I've tried to use \u003ccode\u003e$(APP_HOME_DIR)\u003c/code\u003e, but then I cannot close the dialogue: \u003cem\u003e\"Error: Unknown Macro command\"\u003c/em\u003e\u003c/p\u003e\n\n\u003cp\u003eto clarify - I'm talking about this dialogue: \u003ccode\u003eTools\u003c/code\u003e -\u003ccode\u003eConfigure Tools...\u003c/code\u003e - \u003ccode\u003eAdd...\u003c/code\u003e (or \u003ccode\u003eEdit\u003c/code\u003e)\n\u003cimg src=\"https://i.stack.imgur.com/QT72L.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e","accepted_answer_id":"27899219","answer_count":"1","comment_count":"0","creation_date":"2015-01-12 09:46:49.087 UTC","last_activity_date":"2016-02-27 06:41:29.197 UTC","last_edit_date":"2016-02-27 06:41:29.197 UTC","last_editor_display_name":"","last_editor_user_id":"650492","owner_display_name":"","owner_user_id":"1041641","post_type_id":"1","score":"0","tags":"delphi|delphi-xe3","view_count":"55"} +{"id":"28594985","title":"how to get Qt 5.4.0 source that works for BOTH Windows and OS X","body":"\u003cp\u003eI need to get Qt 5.4.0 source, make a few changes, then build it on both Windows and Mac OS X (including qtwebkit).\u003c/p\u003e\n\n\u003cp\u003eIf I download the .zip file, I can build on Windows, but configure won't run on Mac - it doesn't like the line endings, apparently. If I copy configure and qtbase/configure (which are missing from the .zip) from a .tar.gz Qt5 download, configure gives me a \"You don't seem to have 'make' or 'gmake' in your PATH\" error.\u003c/p\u003e\n\n\u003cp\u003eIf I download the .tar.gz file, I can build on Mac, but it's missing configure.bat (and who knows what else), so I can't build on Windows.\u003c/p\u003e\n\n\u003cp\u003eIf I use git to get the source, I end up with the source of the latest dev branch I think. I need the source of the actual 5.4.0 release. I'm no git expert, so even if I could live with the source on the dev branch, I've never successfully managed to build it.\u003c/p\u003e\n\n\u003cp\u003eEDIT: I did manage to get Qt 5.4.0 via git and successfully run \u003ccode\u003eperl init-repository\u003c/code\u003e. However, when I copy that source to Windows and try to run \u003ccode\u003econfigure\u003c/code\u003e, it complains about missing qtbase\\configure.exe. If I copy configure.exe from the .zip version of Qt 5.4.0, \u003ccode\u003econfigure\u003c/code\u003e fails with \u003ccode\u003eC:\\qt\\qt5_git\\qtbase\\src\\corelib\\global\\qglobal.h(68) : fatal error C1083: Cannot open include file: 'QtCore/qsystemdetection.h': No such file or directory\u003c/code\u003e. Of course, the qsystemdetection.h does exist in the same folder as qglobal.h.\u003c/p\u003e\n\n\u003cp\u003eIf I use git to get Qt 5.4.0 on Windows and run \u003ccode\u003eperl init-repository\u003c/code\u003e, that works fine on Windows. But copying to OS X yields the same problem as using the .zip file, described above.\u003c/p\u003e\n\n\u003cp\u003eThere must be some way to do this! When Qt's whole reason for existence is for cross-platform development, it's just too ironic that Qt5 requires me to maintain 2 separate code bases (one for Windows, one for OS X) just to be able to build it.\u003c/p\u003e\n\n\u003cp\u003eSo what am I missing? How do I get a copy of Qt 5.4.0 that I can modify slightly, then build on both Windows and OS X?\u003c/p\u003e","accepted_answer_id":"28815244","answer_count":"1","comment_count":"0","creation_date":"2015-02-18 22:14:25.157 UTC","last_activity_date":"2015-03-02 16:53:55.08 UTC","last_edit_date":"2015-02-24 21:44:12.433 UTC","last_editor_display_name":"","last_editor_user_id":"385655","owner_display_name":"","owner_user_id":"385655","post_type_id":"1","score":"0","tags":"windows|osx|build|qt5|configure","view_count":"631"} +{"id":"39960779","title":"Google Maps Marker To Change OnClick","body":"\u003cp\u003eI currently have a google map integrated into my website. I have 2 google map markers inside the map.\u003c/p\u003e\n\n\u003cp\u003eOn mouseover and mouseout, both these marker images change as I desire. That is all working.\u003c/p\u003e\n\n\u003cp\u003eI have it setup that once a marker is clicked, the page url changes and reloads. This is all working fine.\u003c/p\u003e\n\n\u003cp\u003eMy problem is that I want my google marker icon to change also when the marker is clicked.\u003c/p\u003e\n\n\u003cp\u003eSo to make it simple.\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003cp\u003eMarker A = Clicked.\u003c/p\u003e\n\n\u003cp\u003eNew Page Loads From Marker A Being Clicked.\u003c/p\u003e\n\n\u003cp\u003eMarker A should change Icon on new page.\u003c/p\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eI hope I have explained this is a straight forward way. Here is my current code.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e var iconBase = window.location.origin + '/assets/images/map_red_small_full_icon.png';\n\nvar marker = new google.maps.Marker({\n position: {lat: 54.339549, lng: -5.266286},\n map: map,\n icon: iconBase\n}); \n\nmarker.addListener('click', function() {\n window.history.pushState('obj', 'newtitle', '/locations#marker1');\n marker.setIcon(iconBasetitle);\n location.reload();\n $('body').scrollTop(0);\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo the url is changed based on when the marker is clicked. The New page loads but the marker does not change.\u003c/p\u003e\n\n\u003cp\u003eCan anyone explain what I'm missing? \u003c/p\u003e\n\n\u003cp\u003eThank you\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2016-10-10 14:37:32.6 UTC","last_activity_date":"2016-10-10 15:53:12.457 UTC","last_edit_date":"2016-10-10 15:53:12.457 UTC","last_editor_display_name":"","last_editor_user_id":"2159528","owner_display_name":"","owner_user_id":"3066322","post_type_id":"1","score":"-1","tags":"jquery|google-maps|google-maps-api-3","view_count":"72"} +{"id":"30051563","title":"Ms Access does not recognize as a Valid field name","body":"\u003cpre\u003e\u003ccode\u003eTRANSFORM IIF(IsNull(First(wrhCode)),'' ,First(wrhCode) \u0026amp; ', ' ) AS FirstOfwrhCode \n SELECT whiitemID AS ItemID, \n whiItemName AS Name, \n Sum(Qty) AS Quantity\n FROM (SELECT wrhID, \n wrhCode, \n whiitemID,\n whiItemName,\n Sum(whiQty) AS QTY \n FROM tblWarehouseItem AS WI \n INNER JOIN tblWarehouse AS W ON WI.whiwrhID = W.wrhID\n WHERE whiActive = True \n AND whiwrhID IN (Forms.frmStockControl.Form.txtwrhIDs) \n GROUP BY wrhID, wrhCode, whiItemName, whiitemID) AS [%$##@_Alias]\n GROUP BY whiitemID, whiItemName\n PIVOT 'wrhID' \u0026amp; wrhID;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have this query to my form but it does not work:\nBut if i edit :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e AND whiwrhID IN (Forms.frmStockControl.Form.txtwrhIDs)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eto:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e AND whiwrhID IN (26,27,29)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs working any ideas how to fix the error\u003c/p\u003e","answer_count":"3","comment_count":"2","creation_date":"2015-05-05 11:19:42.753 UTC","last_activity_date":"2015-05-05 16:42:21.687 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"823584","post_type_id":"1","score":"0","tags":"sql|vba|ms-access|access-vba","view_count":"214"} +{"id":"26530958","title":"How to make word length limit in php","body":"\u003cp\u003eI'm trying to make a forum and I have a problem. How can I make a word length limit?So you can't post a word with 32+ characters.\u003c/p\u003e","accepted_answer_id":"26531539","answer_count":"4","comment_count":"1","creation_date":"2014-10-23 14:55:11.67 UTC","last_activity_date":"2014-10-23 15:31:30.99 UTC","last_edit_date":"2014-10-23 15:31:30.99 UTC","last_editor_display_name":"","last_editor_user_id":"3987423","owner_display_name":"","owner_user_id":"4171266","post_type_id":"1","score":"-2","tags":"css","view_count":"78"} +{"id":"39539319","title":"Selectize onChange in Shiny","body":"\u003cp\u003eI would like to trigger some function when selecting an option in aselectize widget in shiny. However, I do not want to trigger the function server side but rather on the client side. Observe and observeEvent is what works on the server side (server.R) but that is not what I want. \u003c/p\u003e\n\n\u003cp\u003eI tried the below but it did not work in ui.R\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e tags$script('\n $( document ).ready(function() {\n $(\"#fTICKER4\").selectize({\n onChange: function () {\n alert(\"Selectize event: Change\");\n }\n });\n '),\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ePlease suggest a way forward in shiny\u003c/p\u003e","accepted_answer_id":"39540690","answer_count":"1","comment_count":"0","creation_date":"2016-09-16 20:04:32.857 UTC","favorite_count":"1","last_activity_date":"2016-09-16 22:01:08.607 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4777318","post_type_id":"1","score":"2","tags":"r|shiny|selectize.js","view_count":"481"} +{"id":"36662854","title":"Is it possible to specify physical name for database?","body":"\u003cp\u003eIs it possible to specify the physical file name for creating a database with a different database name in EF Code First WPF application??\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-04-16 10:20:42.197 UTC","last_activity_date":"2016-04-18 12:53:20.32 UTC","last_edit_date":"2016-04-18 12:53:20.32 UTC","last_editor_display_name":"","last_editor_user_id":"1228","owner_display_name":"","owner_user_id":"3809880","post_type_id":"1","score":"1","tags":"entity-framework|ef-code-first","view_count":"33"} +{"id":"41372266","title":"How to invoke method from another Java project","body":"\u003cp\u003eThe task is to invoke a method from another Java compiled .class file.\nFile is located in different location (e.g. C:\\Downloads\\Task.class) and already compiled.\nMethod, which should be invoked is static and consumes FileOutputStream OR returns String:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic static void task(FileOutputStream out, String[] args) {...}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eor\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic static String task(String[] args) {... return result;}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs there any possible way to do this? Can I do a classload of class, located in different folder, should I just save classfile to a location, where class with main method is, or there is another way to do it?\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2016-12-29 02:14:53.8 UTC","last_activity_date":"2017-01-05 10:58:20.483 UTC","last_edit_date":"2017-01-05 10:58:20.483 UTC","last_editor_display_name":"","last_editor_user_id":"294657","owner_display_name":"","owner_user_id":"4605754","post_type_id":"1","score":"0","tags":"java","view_count":"43"} +{"id":"12545954","title":"Custom order for Views 3 output","body":"\u003cp\u003eI have a related field in a view that contains either a ranking 1 - 4, or NULL if the related record doesn't exist. I need the results to return in this order: 1,2,3,NULL,4 whereas now, it returns the data set in this order: NULL, 1,2,3,4.\u003c/p\u003e\n\n\u003cp\u003eIt seems like this would be a simple thing to do, using \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eORDER BY FIELD(field, 1,2,3,NULL,4) in hook_views_alter_query.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI looked at the SQL output from the view and extracted:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eORDER BY \n field_partner_name_users__field_data_field_partner_ranking.field_partner_ranking_value, \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethen put this in the hook:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$query-\u0026gt;orderby[0]['field'] = \n \"field_partner_name_users__field_data_field_partner_ranking.field_partner_ranking_value\"; \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut when I try to use this field in the \u003ccode\u003eORDER BY\u003c/code\u003e, I get this error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSQLSTATE[42S22]: Column not found: 1054 Unknown column 'field_partner_name_users__field_data_field_partner_ranking.field_partner_ranking_value' in 'order clause'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny help would be greatly appreciated. Also, is there a comprehensive guide to Views 3 out there somewhere?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2012-09-22 17:12:29.53 UTC","favorite_count":"1","last_activity_date":"2013-04-10 05:11:36.643 UTC","last_edit_date":"2012-09-23 03:16:44.147 UTC","last_editor_display_name":"","last_editor_user_id":"758485","owner_display_name":"","owner_user_id":"468511","post_type_id":"1","score":"2","tags":"drupal|views|sql-order-by","view_count":"118"} +{"id":"47565815","title":"Connecting to Mysql from Mvc application using Entityframework","body":"\u003cp\u003eI am using visual studio 2015 and created a Mvc application which I will like to connect to MySql database. I am able to connect to Mysql and my test connection turns out to be a success. However once I try to use entityframework I get the error message below.\u003c/p\u003e\n\n\u003cp\u003eI have tried a lot of things I found online but no luck for me. What am I doing wrong? Any documentation will be helpful\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/t2a5P.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/t2a5P.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-11-30 04:19:35.73 UTC","last_activity_date":"2017-11-30 05:45:47.05 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2320476","post_type_id":"1","score":"0","tags":"mysql|asp.net-mvc|entity-framework","view_count":"11"} +{"id":"43738411","title":"Play! Framework Scala Form Submitbutton","body":"\u003cp\u003eI used the \u003ca href=\"https://www.playframework.com/documentation/2.5.x/ScalaForms\" rel=\"nofollow noreferrer\" title=\"ScalaForms\"\u003ePlay! ScalaForm\u003c/a\u003e Tutorial to learn how to use Forms. \u003c/p\u003e\n\n\u003cp\u003eI got it working. It now shows 2 Inputboxes there I can write UserName and Password into. But the Tutorial doesn't tell me how to submit the Form. \u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eSo how to Submit the Form?\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eOverall I'm trying to implement en Loginscreen.\u003c/p\u003e\n\n\u003cp\u003eProject on \u003ca href=\"https://github.com/Bersacker/ChatSystem\" rel=\"nofollow noreferrer\"\u003eGitHub\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eAnd a follow up Question I want to redirect to the Home.html.\nTryed it with Action and with Redirect but can't get it working. \u003c/p\u003e","accepted_answer_id":"43770636","answer_count":"1","comment_count":"1","creation_date":"2017-05-02 12:52:58.93 UTC","last_activity_date":"2017-05-03 21:55:27.037 UTC","last_edit_date":"2017-05-03 21:55:27.037 UTC","last_editor_display_name":"","last_editor_user_id":"472495","owner_display_name":"","owner_user_id":"7684200","post_type_id":"1","score":"0","tags":"forms|scala|playframework-2.0","view_count":"69"} +{"id":"31472190","title":"How to read a string matrix from text file in C?","body":"\u003cp\u003eI have a text file whose name is \u003ccode\u003ematrix.txt\u003c/code\u003e. I try to read and assign this values to \u003ccode\u003ematrix[M][N]\u003c/code\u003e. I have a problem about reading. I know i have to use string but reading values' count is not stable. I want to assign values like \u003ccode\u003ehope.txt\u003c/code\u003e. How can this problem solve? What can i use instead of \u003ccode\u003efscanf\u003c/code\u003e command?\u003c/p\u003e\n\n\u003ch1\u003ematrix.txt\u003c/h1\u003e\n\n\u003cpre\u003e\u003ccode\u003e1 X 3.37582 -1.01229 -0.00022\n2 X 2.26583 -0.14632 0.00005\n3 X 0.76713 -1.96181 0.00014\n4 X 1.8336 -2.88677 -0.00015\n5 X 3.1528 -2.40381 -0.00035\n6 Y 4.38666 -0.61970 -0.00036\n7 Y -0.27476 -2.26966 0.00033\n8 Y 1.62133 -3.95092 -0.00017\n9 Y 3.99265 -3.09253 -0.00057\n10 X 2.39233 1.35970 0.00026\n11 Z 1.36086 2.07407 0.00012\n12 X 3.77095 1.98739 0.00069\n13 Y 4.34126 1.68147 0.88735\n14 Y 4.34154 1.68204 -0.88601\n15 Y 3.66765 3.07442 0.00099\n16 T 0.99103 -0.62838 0.00021\n17 L -0.85577 0.79435 -0.00032\n18 T -3.41216 -0.53167 0.00027\n19 Z -3.08467 0.78325 -0.00030\n20 Z -4.63453 -0.87635 0.00045\n21 Z -2.42389 -1.39794 0.00066\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eThis code is running but it is not after my own heart.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003ch1\u003estrread.c\u003c/h1\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;stdio.h\u0026gt;\n#include \u0026lt;stdlib.h\u0026gt;\n#include \u0026lt;string.h\u0026gt;\n\n#define M 20\n#define N 5\nint main(int argc, char *argv[])\n{\n int i=0; int j=0;\n char matrix[M][N];\n FILE *fp;\n\n fp=fopen(\"matrix.txt\",\"r\");\n if(fp==NULL)\n exit(1);\n\n for(i=1;i\u0026lt;=M;i++){\n for(j=1;j\u0026lt;=N;j++){\n if(matrix[i][j]!=' '){\n fscanf(fp,\"%c\",\u0026amp;matrix[i][j]);\n printf(\"M[%d,%d]=%c\\t\",i,j,matrix[i][j]);\n }\n }\n printf(\"\\n\");\n }\n\n fclose(fp);\n return 0;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eI compiled my code in cygwin(2.4.0) with gcc (4.9.2)\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003ch1\u003eoutput\u003c/h1\u003e\n\n\u003cpre\u003e\u003ccode\u003eM[1,1]=1 M[1,2]= M[1,3]=X M[1,4]= M[1,5]=3 \nM[2,1]=. M[2,2]=3 M[2,3]=7 M[2,4]=5 M[2,5]=8 \nM[3,1]=2 M[3,2]= M[3,3]=- M[3,4]=1 M[3,5]=. \nM[4,1]=0 M[4,2]=1 M[4,3]=2 M[4,4]=2 M[4,5]=9 \nM[5,1]= M[5,2]=- M[5,3]=0 M[5,4]=. M[5,5]=0 \nM[6,1]=0 M[6,2]=0 M[6,3]=2 M[6,4]=2 M[6,5]=\n\nM[7,1]=\n M[7,2]=2 M[7,3]= M[7,4]=X M[7,5]= \nM[8,1]=2 M[8,2]=. M[8,3]=2 M[8,4]=6 M[8,5]=5 \nM[9,1]=8 M[9,2]=3 M[9,3]= M[9,4]=- M[9,5]=0 \nM[10,1]=. M[10,2]=1 M[10,3]=4 M[10,4]=6 M[10,5]=3 \nM[11,1]=2 M[11,2]= M[11,3]= M[11,4]=0 M[11,5]=. \nM[12,1]=0 M[12,2]=0 M[12,3]=0 M[12,4]=0 M[12,5]=5 \nM[13,1]=\n M[13,2]=\n M[13,3]=3 M[13,4]= M[13,5]=X \nM[14,1]= M[14,2]=0 M[14,3]=. M[14,4]=7 M[14,5]=6 \nM[15,1]=7 M[15,2]=1 M[15,3]=3 M[15,4]= M[15,5]=- \nM[16,1]=1 M[16,2]=. M[16,3]=9 M[16,4]=6 M[16,5]=1 \nM[17,1]=8 M[17,2]=1 M[17,3]= M[17,4]= M[17,5]=0 \nM[18,1]=. M[18,2]=0 M[18,3]=0 M[18,4]=0 M[18,5]=1 \nM[19,1]=4 M[19,2]=\n M[19,3]=\n M[19,4]=4 M[19,5]= \nM[20,1]=X M[20,2]= M[20,3]=1 M[20,4]=. M[20,5]=8 \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eWhat I'm trying to do\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003ch1\u003eHope.txt\u003c/h1\u003e\n\n\u003cpre\u003e\u003ccode\u003eM[1,1]=1 M[1,2]=X M[1,3]=3.37582 M[1,4]=-1.01229 M[1,5]=-0.00022\nM[2,1]=2 M[2,2]=X M[2,3]=2.26583 M[2,4]=-0.14632 M[2,5]=0.00005\n.\n.\n.\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"31473152","answer_count":"4","comment_count":"0","creation_date":"2015-07-17 09:10:52.777 UTC","last_activity_date":"2017-12-01 13:06:45.93 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2809382","post_type_id":"1","score":"0","tags":"c|string|file|matrix|scanf","view_count":"863"} +{"id":"34317932","title":"How to Pass selected items from a joined list to the view?","body":"\u003cp\u003eSo I'm not sure what I'm doing wrong but I'm pulling data successfully and sending it to the ViewModel, but i can't seem to display the results in the view.\u003c/p\u003e\n\n\u003cp\u003ein my controller:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar verbiage = HttpUtility.HtmlEncode(\"Hello World\");\n\nvar productToDetail = _contentService\n .Products\n .Where(q =\u0026gt; q.Id == 112)\n .Select(x =\u0026gt; new { x.TypeId, x.Id, x.FullName, x.Length, x.Sku, x.Isbn, x.Price });\n\nvar model = new DetailPageViewModel\n {\n ProgramTables = GetUpComingCourses(),\n Verbiage = verbiage,\n CurrentProduct = productToDetail.ToList()\n };\nreturn View(model);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ein my viewmodel:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic string Verbiage { set; get; }\npublic IList CurrentProduct { get; set; }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ein my view:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@Model.CurrentProduct.FullName;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe view sees that CurrentProduct is there, but gives me this error\u003c/p\u003e\n\n\u003cp\u003e'System.Collections.IList' does not contain a definition for 'FullName' and no extension method 'FullName' accepting a first argument of type 'System.Collections.IList' could be found (are you missing a using directive or an assembly reference?)\u003c/p\u003e\n\n\u003cp\u003efor FullName, even though im clearly pullig it in the controller. I even quick viewed productToDetail and saw that the correct info was pulled.\u003c/p\u003e\n\n\u003cp\u003eI am at wits end! please help!\u003c/p\u003e\n\n\u003cp\u003eok, so still i have NO IDEA why my data is not being pulled to the view....\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eUPDATE\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003ein my controller:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public static List GetCurrentApp(int item)\n {\n\n\n var productToDetail = _contentService\n .Products\n .Where(q =\u0026gt; q.Id == item)\n .Select(x =\u0026gt; new {x.TypeId, x.Id, x.FullName, x.Length, x.Sku, x.Isbn, x.Price});\n\n\n return productToDetail;\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cem\u003eon return productToDetail; - Error: Cannot convert expression type 'System.Linq.IQueryable\u0026lt;{TypeId:int,Id:int, FullName:string,Lenth:string,Sku:string,Isbn:string, Price:string}\u003e' to return type 'NHibernate.Mapping.List'\u003c/em\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public ActionResult Details(int item)\n {\n\n var verbiage = HttpUtility.HtmlEncode(\"Hello World\");\n\n var model = new DetailPageViewModel()\n {\n Verbiage = verbiage,\n CurrentProduct = GetCurrentApp(item)\n };\n\n return View(\"../Shared/DetailView\", model);\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn my Model:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class DetailPageViewModel\n{\n public string Verbiage { set; get; }\n public List CurrentProduct { get; set; }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn my View:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@model Project.Models.ViewModels.DetailPageViewModel\n\u0026lt;h2\u0026gt;@Model.CurrentProduct.FullName\u0026lt;/h2\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cem\u003eError on FullName\u003c/em\u003e\u003c/p\u003e\n\n\u003cp\u003e:(\u003c/p\u003e","accepted_answer_id":"34320913","answer_count":"2","comment_count":"4","creation_date":"2015-12-16 17:05:52.067 UTC","last_activity_date":"2016-03-21 23:37:01.757 UTC","last_edit_date":"2016-03-21 23:37:01.757 UTC","last_editor_display_name":"","last_editor_user_id":"727208","owner_display_name":"","owner_user_id":"4274774","post_type_id":"1","score":"1","tags":"c#|asp.net-mvc|nhibernate","view_count":"36"} +{"id":"33232346","title":"how to randomly filter and select a CGPoint from arrays","body":"\u003cp\u003eI have a number of arrays of CGPoints as shown in the method below. I am trying to filter a position for my sprite that moves down, left, up and right cyclically in the said order. How can randomly select an array from a array group (down, left etc) then randomly select a point from the selected array, also taking note of the array group so that when the method is called again the following group will be used for the generation (following the cyclical order). For example, since down is the first in the cycle, a \"down array\" is randomly selected and if say, down2 is chosen then a point should be randomly selected from down2, say p5. The next time that this method is called the same procedure should be followed for the \"left array\" and so on. It seems to be quite complex. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunc nextPosition ()-\u0026gt;CGPoint {\n let down1 = [p1, p2]\n let down2 = [p3, p4, p5]\n let left1 = [p6, p7]\n let left2 = [p8, p9, p10]\n let left3 = [p11, p12, p13]\n let up1 = [p14, p15]\n let up2 = [p16, p17]\n let up3 = [p18, p19]\n let right1 = [p20, p21]\n let right2 = [p22, p23]\n let right3 = [p24, p25]\n let right4 = [p26, p27, p28, p29, p30]\n\n //return point \n }\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"0","creation_date":"2015-10-20 09:02:23.733 UTC","last_activity_date":"2015-10-20 10:02:57.703 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4006443","post_type_id":"1","score":"2","tags":"arrays|swift|sorting|filter|swift2","view_count":"76"} +{"id":"8907543","title":"N-Layer Architecture","body":"\u003cp\u003eI'm in the situation that I have to design and implement a system from the scratch. I have some questions about the architecture that I would like your comments and thoughts on.\u003c/p\u003e\n\n\u003cp\u003eQuick Info about the project: It's a data centric web application.\u003c/p\u003e\n\n\u003cp\u003eThe application will be built on Microsoft .NET Framework 4.0 with MS SQL SERVER 2008 database.\u003c/p\u003e\n\n\u003cp\u003eRequirement:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eRich UI and robust\u003c/li\u003e\n\u003cli\u003eMulti-device support (every browser and on every device)\u003c/li\u003e\n\u003cli\u003eLoosely coupled \u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eBelow is the architectural diagram I have built:\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/dT1Y8.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eBriefing of the architecture\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003ePresentation layer : HTML5/ASP.NET MVC + JQuery (Web application for multi-device support in first version)\u003c/li\u003e\n\u003cli\u003eDistributed Services : WCF (XML/JSON/JSONP)\u003c/li\u003e\n\u003cli\u003eDomain Layer(Business Layer) : All business logic\u003c/li\u003e\n\u003cli\u003eData persistence (DAL Layer) : Entity Framework 4.0 with database first approach. POCO entities are generated and separated out using T4 template\u003c/li\u003e\n\u003cli\u003eInfrastructural Layer: Contains common libraries like POCO entities, Exception Handling, logging etc\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eMy Concerns :\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eAs application is to be built \u003cstrong\u003eloosely coupled\u003c/strong\u003e so in future if business requirement grows new modules can be easily plugged in without affecting the architecture.\nSo I thought of using the Repository pattern along with IoC and DI (can be Unity/Ninject/Sprint.NET or any other)\u003c/li\u003e\n\u003cli\u003eWCF with both XML and JSON support\u003c/li\u003e\n\u003cli\u003eDistributed Service Layer to place IoC \u0026amp; DI\u003c/li\u003e\n\u003cli\u003eException Handling \u0026amp; Logging using Enterprise Library 5.0\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eLooking for valuable comments and suggestions.\nIf I am doing anything wrong please put me in right direction.\u003c/p\u003e","answer_count":"4","comment_count":"3","creation_date":"2012-01-18 09:04:26.877 UTC","favorite_count":"2","last_activity_date":"2017-03-04 09:28:08 UTC","last_edit_date":"2013-10-29 20:27:05.763 UTC","last_editor_display_name":"","last_editor_user_id":"132599","owner_display_name":"","owner_user_id":"330475","post_type_id":"1","score":"6","tags":"wcf|entity-framework|inversion-of-control|n-layer","view_count":"3484"} +{"id":"20230445","title":"SVN code review without branches for SVN","body":"\u003cp\u003eI'm currently working on a couple projects with some experienced programmers and some amateur programmers. We used to work in a network directory, but we decided to switch to SVN to manage our code.\u003c/p\u003e\n\n\u003cp\u003eWe would also like to review the code that is committed to the repository before it gets added to production server.\nWe tried things like Trac, but those either didn't block the code from being added before getting a pass or it wouldn't work without branches. And we can't learn our amateur developers to start using branches.\u003c/p\u003e\n\n\u003cp\u003eDoes anybody know a system that would work for us?\u003c/p\u003e\n\n\u003cp\u003eMany thanks\u003c/p\u003e","answer_count":"1","comment_count":"5","creation_date":"2013-11-26 23:53:37.113 UTC","last_activity_date":"2013-12-17 01:25:22.23 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1325167","post_type_id":"1","score":"0","tags":"svn|trac","view_count":"212"} +{"id":"6342916","title":"Feather edge corners in a table how?","body":"\u003cp\u003eI used to use this kind of \"documenting**\" format, just an example: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;html\u0026gt;\u0026lt;head\u0026gt;\u0026lt;link rel=\"stylesheet\" href=\"style.css\" type=\"text/css\"\u0026gt;\u0026lt;base target=\"_blank\"\u0026gt;\u0026lt;/head\u0026gt;\u0026lt;body\u0026gt; \n\u0026lt;table class=\"tablet\"\u0026gt;\u0026lt;tr\u0026gt;\u0026lt;td\u0026gt;\u0026lt;pre style=\"margin-bottom:0;\"\u0026gt; \nfind . -type f -size 0\n\u0026lt;/pre\u0026gt;\u0026lt;/td\u0026gt;\u0026lt;/tr\u0026gt;\u0026lt;/table\u0026gt; \n\u0026lt;/body\u0026gt;\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ePicture: \u003ca href=\"http://i.stack.imgur.com/1lTG5.png\" rel=\"nofollow\"\u003ehttp://i.stack.imgur.com/1lTG5.png\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e** to e.g. document Linux/etc. howtos.\u003c/p\u003e\n\n\u003cp\u003estyle.css\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etable.tablet\n {\n width: 98%;\n background: #ffffff;\n color: #000000;\n border-width: 1px;\n border-style: solid;\n border-color: #000000;\n padding-top: 5;\n padding-bottom: 5;\n padding-right: 10;\n padding-left: 10;\n font-size: 110%;\n font-family: \"times\";\n font-weight: normal;\n border-left: 5px solid #000000;\n margin-left:10px;\n word-wrap: break-word;\n }\n\nbody\n {\n background-color: #ffffff;\n color: #000000;\n padding-top: 0;\n padding-bottom: 0;\n padding-right: 0;\n padding-left: 0;\n font-size: 80%;\n font-family: \"times\";\n background-repeat:repeat;\n word-wrap: break-word;\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eQ: I need to make \"feather edges\" from these \"sharp corners\". How?\u003c/p\u003e\n\n\u003cp\u003eExample for the \"feather/rounded edges\": \u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://forum.ubuntu-fr.org/viewtopic.php?id=175880\" rel=\"nofollow\"\u003ehttp://forum.ubuntu-fr.org/viewtopic.php?id=175880\u003c/a\u003e\u003cbr\u003e\nPicture: \u003ca href=\"http://i.stack.imgur.com/vRm3t.png\" rel=\"nofollow\"\u003ehttp://i.stack.imgur.com/vRm3t.png\u003c/a\u003e\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2011-06-14 06:05:19.833 UTC","last_activity_date":"2017-11-22 22:58:33.237 UTC","last_edit_date":"2017-11-22 22:58:33.237 UTC","last_editor_display_name":"","last_editor_user_id":"4370109","owner_display_name":"LanceBaynes","owner_user_id":"752665","post_type_id":"1","score":"0","tags":"css|css-tables","view_count":"1483"} +{"id":"39573206","title":"image is getting resized before adding c#","body":"\u003cp\u003eAm working in windows form.I have an image. Its size is 960*1280.\n\u003ca href=\"https://i.stack.imgur.com/W7PTD.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/W7PTD.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eWhen i tried to add this image to my picture box at run time. the image is getting rotated and its size of the image is 1280*960.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/v4v3w.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/v4v3w.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003emy aim is to resize the image to 100*100 and then add to picture box. i don't want that image to get rotated. Can you suggest me some ideas?\u003c/p\u003e","answer_count":"2","comment_count":"8","creation_date":"2016-09-19 12:28:59.753 UTC","last_activity_date":"2016-09-20 12:06:18.08 UTC","last_edit_date":"2016-09-19 12:41:14.053 UTC","last_editor_display_name":"","last_editor_user_id":"2115618","owner_display_name":"","owner_user_id":"2115618","post_type_id":"1","score":"0","tags":"c#","view_count":"76"} +{"id":"9230793","title":"C# Tabify/Indent HTML","body":"\u003cp\u003eIs there a tool/library/function in C# which tabifies or indents generated html code without validating or tidying the input?\u003c/p\u003e\n\n\u003cp\u003eEdit:\u003c/p\u003e\n\n\u003cp\u003eIndent generated HTML code from JavaScript TextEditors, including but not limited to TinyMCE. No HtmlTextWriter. Must not expect a valid XML/XHTML/HTML code.\u003c/p\u003e\n\n\u003cp\u003eRequirement:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eAdd a new line before and after opening and closing tags.\u003c/li\u003e\n\u003cli\u003eIndent content inside tags (Tab or 4 Spaces).\u003c/li\u003e\n\u003cli\u003eSplit a long line (having N number of words) into multiple indented lines.\u003c/li\u003e\n\u003cli\u003eDo not change the input even though it is not a valid HTML. Only tabify/indent and split long lines.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eUpto this point, I have:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate string FormatHtml(string input)\n{\n //Opening tags\n Regex r = new Regex(\"\u0026lt;([a-z]+) *[^/]*?\u0026gt;\");\n string retVal = string.Empty;\n retVal = r.Replace(input, string.Format(\"$\u0026amp;{0}\\t\", Environment.NewLine));\n\n //Closing tags\n r = new Regex(\"\u0026lt;/[^\u0026gt;]*\u0026gt;\");\n retVal = r.Replace(retVal, string.Format(\"{0}$\u0026amp;{0}\", Environment.NewLine));\n\n //Self closing tags\n r = new Regex(\"\u0026lt;[^\u0026gt;/]*/\u0026gt;\");\n retVal = r.Replace(retVal, string.Format(\"$\u0026amp;{0}\", Environment.NewLine));\n\n return retVal;\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"7","creation_date":"2012-02-10 16:06:25.76 UTC","favorite_count":"1","last_activity_date":"2012-02-29 10:56:57.223 UTC","last_edit_date":"2012-02-10 20:32:56.607 UTC","last_editor_display_name":"","last_editor_user_id":"427576","owner_display_name":"","owner_user_id":"427576","post_type_id":"1","score":"2","tags":"c#|html|regex|indentation","view_count":"2006"} +{"id":"35783791","title":"vb.net Square Brackets Cause Error When Upgraded to Visual Studio 2015","body":"\u003cp\u003eIn the process of upgrading vb.net code from Visual Studio 2008 to Visual Studio 2015, I am getting an \u003cstrong\u003e'Integer' is not declared. It may be inaccessible due to its protection level.\u003c/strong\u003e error on the following code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[Integer].TryParse(...)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe error also occurs on similar code with [Date].TryParse. The target framework for both the original and upgraded code is .NET Framework 3.5. Upgrading the target framework doesn't matter. If I remove the square brackets, the code compiles. Does anyone know why this syntax works in Visual Studio 2008 but not Visual Studio 2015?\u003c/p\u003e","accepted_answer_id":"38392699","answer_count":"1","comment_count":"3","creation_date":"2016-03-03 21:53:23.967 UTC","last_activity_date":"2016-07-15 09:33:43.293 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5264741","post_type_id":"1","score":"0","tags":"vb.net|visual-studio-2015|visual-studio-2008-sp1","view_count":"71"} +{"id":"28642554","title":"jQuery drag and drop issue for remove link","body":"\u003cp\u003eI'm having three div's in my page for drag and drop, \nIn first div (drag 1) contain \"Remove\" link. \nafter drag the first div(drag 1) to first droppable div. \ni can able to remove the first div(drag 1). \nafter remove the (drag 1), i can't able to drag the \nsecond div (drag 1) same first droppable div\u003c/p\u003e\n\n\u003cp\u003eMy Code:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://jsfiddle.net/NXDhE/91/\" rel=\"nofollow\"\u003eFiddle\u003c/a\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e.\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"4","creation_date":"2015-02-21 05:41:24.543 UTC","last_activity_date":"2015-02-21 06:25:49.127 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3905426","post_type_id":"1","score":"0","tags":"javascript|jquery|html|css|drag-and-drop","view_count":"123"} +{"id":"3136721","title":"Why does git see whole files as changed when copying files overtop of other files?","body":"\u003cp\u003eWhen I copy a file over top of another file in a git controlled directory... I'm seeing git think that the whole file has changed instead of one small hunk... why?\u003c/p\u003e\n\n\u003cp\u003eHere is an example of what I mean... \u003ca href=\"http://github.com/cmodien/fileupdatetest/commit/90309ed099e257cd98218b4504cd2cd3a3a47a27\" rel=\"noreferrer\"\u003ehttp://github.com/cmodien/fileupdatetest/commit/90309ed099e257cd98218b4504cd2cd3a3a47a27\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eOK... I checked the line endings on the file... The original file has crlf line endings. The file that I pasted over the original has lf line endings. Which makes sense I guess... I got the original file from a windows user and I received the new file from a mac user.\u003c/p\u003e\n\n\u003cp\u003eHow do I fix this?\u003c/p\u003e","accepted_answer_id":"3173973","answer_count":"3","comment_count":"3","creation_date":"2010-06-28 22:50:45.057 UTC","favorite_count":"2","last_activity_date":"2013-09-01 02:09:54.96 UTC","last_edit_date":"2010-06-30 20:40:17.537 UTC","last_editor_display_name":"","last_editor_user_id":"3384609","owner_display_name":"","owner_user_id":"3384609","post_type_id":"1","score":"6","tags":"git","view_count":"3749"} +{"id":"24951894","title":"Clojure - how to let the library users choose which printing function to use, to display data structures?","body":"\u003cp\u003eI'm writing a small debugging library and I would like to let users choose how to display data structures. I was imagining that users could require it in this kind of way:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e(ns some-user-namespace\n (:require\n [clojure.pprint]\n [my.library :with-args {print-fn clojure.pprint/pprint}]))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs something like this possible, and if not, how can I solve this problem?\u003c/p\u003e","accepted_answer_id":"24955447","answer_count":"1","comment_count":"0","creation_date":"2014-07-25 09:00:19.897 UTC","last_activity_date":"2014-07-26 08:01:07.213 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1553128","post_type_id":"1","score":"0","tags":"clojure|namespaces","view_count":"84"} +{"id":"34058219","title":"Finding which region's app store iOS app is downloaded from","body":"\u003cp\u003eI need to show legal information based on which app store user used to download the app.\nI understand i can't access user's iTunes account information from my app.\u003c/p\u003e\n\n\u003cp\u003eAre there any alternate ways to get to know about the store info.\u003c/p\u003e","accepted_answer_id":"34326586","answer_count":"1","comment_count":"2","creation_date":"2015-12-03 05:01:46.587 UTC","last_activity_date":"2015-12-17 04:23:14.883 UTC","last_edit_date":"2015-12-03 05:20:09.63 UTC","last_editor_display_name":"","last_editor_user_id":"846303","owner_display_name":"","owner_user_id":"846303","post_type_id":"1","score":"0","tags":"ios|itunes-store|itunes-sdk","view_count":"104"} +{"id":"8003726","title":"Android: dynamically Creating a list of objects each with their own buttons and EditTexts","body":"\u003cp\u003eI want to dynamically add rows to a linear layout where each row would have 2 buttons and 2 edittexts. I am not sure the best way to organize this. I had the idea to creating a class for each row with the buttons and edittexts in them but FindViewByID doesn't work that way. The other thought was to include an instance of a layout for each object but I am not sure the best way to efficiently access the buttons in the layout without creating action listeners for, if I had 10 objects, 20 buttons and 20 edittexts. Is it possible to use an array of included layouts and add them as I need them If I do it that way?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2011-11-04 00:40:01.457 UTC","favorite_count":"1","last_activity_date":"2011-11-04 04:13:02.973 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1028843","post_type_id":"1","score":"2","tags":"android","view_count":"1039"} +{"id":"25104814","title":"Visual Studio - cannot add to toolbox AnyCPU DLL with reference to 32bit dll","body":"\u003cp\u003eWe have existing API that includes UI controls (both WinForms and WPF) dll that shipped with our product. it is in use by our clients for a while for 32bit.\u003c/p\u003e\n\n\u003cp\u003eRecentaly, our customers moved to 64bit versions and we're trying to provide support for developers with 64bit version, as Visual studio is 32bit process, and our controls dll has depenencies with native 64bit dlls. our controls cannot be loaded/displayed in toolbox/designer. \u003c/p\u003e\n\n\u003cp\u003eIn order to solve this problem. I changed the output type of the controls dll to be AnyCPU, also wrapped any references to a lower native dlls in order to prevent exceptions when dragging controls to designer, or when loading existing forms/windows.\nand indeed, its solves the problem of dragging controls to designer/loading existing forms/windows. but that's because I have already loaded controls in the toolbox, from previous 32 bit version.\u003c/p\u003e\n\n\u003cp\u003eWe still have a problem loading the controls to the toolbox (Toolbox-\u003eChoose Items)\nin VS2010 - cannot add at all, the failure is due to lower native dll that cannot be load.\nin VS2012 - Winforms controls are able to be loaded (sometimes only after the second time),\n WPF controls NOT being able to be load at all.\u003c/p\u003e\n\n\u003cp\u003eDoes anyone understand the loading dll mechanism of Visual Studio?\nAny other suggestion/workaround?\u003c/p\u003e","accepted_answer_id":"26624576","answer_count":"1","comment_count":"0","creation_date":"2014-08-03 12:50:49.373 UTC","last_activity_date":"2014-10-29 07:12:07.173 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3903847","post_type_id":"1","score":"0","tags":"visual-studio-2010|visual-studio-2012|dll|64bit","view_count":"175"} +{"id":"47168329","title":"await operator not stopping continuation of other method calls","body":"\u003cp\u003eI have three methods that look like below\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate async Task checkPhotoLibraryAccess()\n{\n PHPhotoLibrary.RequestAuthorization(status =\u0026gt;\n {\n switch (status)\n {\n //stuff here\n }\n }\n\n}\n\nprivate async Task checkDeviceAuthorizationStatus()\n{\n var status = AVCaptureDevice.GetAuthorizationStatus(AVMediaType.Video);\n switch (status)\n {\n //stuff here\n }\n}\n\nprivate void displayAppBar()\n{\n AppBar.IsVisible = true;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI would like the execution of the first two methods to complete before calling the third. I have researched the issue and have found ways of doing so using the await operator and Wait() method. However my implementations has not worked. Here is my code below.\u003c/p\u003e\n\n\u003cp\u003eAttempt 1\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate async void MyMethod() \n{\n await checkPhotoLibraryAccess();\n await checkDeviceAuthorizationStatus();\n displayAppBar(); //THIS IS CALLED BEFORE COMPLETION OF TWO ABOVE\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAttempt 2\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate async void MyMethod()\n{\n checkPhotoLibraryAccess().Wait();\n checkDeviceAuthorizationStatus().Wait();\n displayAppBar(); //SAME ISSUE\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny suggestions on how to get this to work?\u003c/p\u003e","accepted_answer_id":"47168830","answer_count":"2","comment_count":"5","creation_date":"2017-11-07 22:16:07.407 UTC","last_activity_date":"2017-11-07 23:22:22.987 UTC","last_edit_date":"2017-11-07 23:02:09.607 UTC","last_editor_display_name":"","last_editor_user_id":"209259","owner_display_name":"","owner_user_id":"4901556","post_type_id":"1","score":"0","tags":"c#|multithreading|async-await|wait","view_count":"74"} +{"id":"19023218","title":"Maven not adding jars to classpath","body":"\u003cp\u003eI'm using eclipse indigo and maven 3.1\u003c/p\u003e\n\n\u003cp\u003eWhen I add a new dependency in pom.xml and run maven clean by right-clicking on pom.xml, maven is downloading missing jars to my local repository but not adding them to my list of referenced libraries. \u003c/p\u003e\n\n\u003cp\u003eAfter many hours of struggling I found out that I can solve this by running \u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003emvn eclipse:eclipse -Dwtpversion=2.0\u003c/code\u003e \u003c/p\u003e\n\n\u003cp\u003efrom command line each time after adding a new dependency. When I run maven clean from eclipse after doing this then the jars are added to referenced libraries. \u003c/p\u003e\n\n\u003cp\u003eAnybody know why this is happening like this?\u003c/p\u003e","accepted_answer_id":"19047493","answer_count":"1","comment_count":"1","creation_date":"2013-09-26 08:34:42.227 UTC","favorite_count":"1","last_activity_date":"2013-09-27 09:37:07.24 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1521049","post_type_id":"1","score":"2","tags":"eclipse|maven|maven-3|m2eclipse","view_count":"4690"} +{"id":"11762287","title":"what is debug mode and how do i turn it on using jboss in windows command console?","body":"\u003cp\u003eI would like to know what is debug mode in jboss. I've used django before and when I turned on debug mode, any change I make while the localhost is running will be detected and refreshing the page will show the changes. Is that the same in jboss debug?\u003c/p\u003e\n\n\u003cp\u003eI use maven to install the project then start jboss in windows command console. How do I turn on debug mode for jboss 5.1.1?\u003c/p\u003e\n\n\u003cp\u003eMaven clean install takes about 8 minutes, then restarting the server is another 5-7 minutes. I am wasting a lot of time for many small changes.\u003c/p\u003e","accepted_answer_id":"11762665","answer_count":"1","comment_count":"0","creation_date":"2012-08-01 15:15:08.747 UTC","last_activity_date":"2013-08-10 13:09:09.347 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"802281","post_type_id":"1","score":"0","tags":"debugging|command-line|jboss","view_count":"566"} +{"id":"42430460","title":"Can I style the results of a PHP query?","body":"\u003cp\u003eSay I have this code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$sql=\"SELECT * FROM $tbl_name ORDER BY id\";\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCan I also include instructions in this sequence as to how to style the results of the the query (the 'array?). Could I say 'make the first result bold, and the rest of them regular font,' for example?\u003c/p\u003e","answer_count":"1","comment_count":"5","creation_date":"2017-02-24 03:52:58.847 UTC","last_activity_date":"2017-02-24 04:35:30.603 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5739232","post_type_id":"1","score":"-5","tags":"php|mysql|arrays","view_count":"73"} +{"id":"24794463","title":"BULK INSERT large CSV file and attach an additional column","body":"\u003cp\u003eI was able to use BULK INSERT on an SQL Server 2008 R2 database to import a CSV file (Tab delimited) with more than 2 million rows. This command is planned to run every week.\u003c/p\u003e\n\n\u003cp\u003eI added an additional column named \"lastupdateddate\" to the generated table to store the datestamp a row is updated via a INSERT trigger. But when I ran the BULK INSERT again, it failed due to mismatch in columns as there is no such a field in a raw CSV file.\u003c/p\u003e\n\n\u003cp\u003eIs there any possibility to configure BULK INSERT to ignore the \"lastupdateddate\" column when it runs?\u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e\n\n\u003cp\u003e-- EDIT:\u003c/p\u003e\n\n\u003cp\u003eI tried using a format file but still unable to solve the problem.\u003c/p\u003e\n\n\u003cp\u003eThe table looks as below.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eUSE AdventureWorks2008R2;\nGO\nCREATE TABLE AAA_Test_Table \n (\n Col1 smallint,\n Col2 nvarchar(50) ,\n Col3 nvarchar(50) , \n LastUpdatedDate datetime \n );\nGO\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe csv \"data.txt\" file is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e1,DataField2,DataField3\n2,DataField2,DataField3\n3,DataField2,DataField3\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe format file is like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e10.0\n3\n1 SQLCHAR 0 7 \",\" 1 Col1 \"\"\n2 SQLCHAR 0 100 \",\" 2 Col2 SQL_Latin1_General_CP1_CI_AS\n3 SQLCHAR 0 100 \",\" 3 Col3 SQL_Latin1_General_CP1_CI_AS\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe SQL command I ran is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eDELETE AAA_Test_Table\nBULK INSERT AAA_Test_Table\nFROM 'C:\\Windows\\Temp\\TestFormatFile\\data.txt' \nWITH (formatfile='C:\\Windows\\Temp\\TestFormatFile\\formatfile.fmt');\nGO\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe error received is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eMsg 4864, Level 16, State 1, Line 2\nBulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 2, column 1 (Col1).\nMsg 4832, Level 16, State 1, Line 2\nBulk load: An unexpected end of file was encountered in the data file.\nMsg 7399, Level 16, State 1, Line 2\nThe OLE DB provider \"BULK\" for linked server \"(null)\" reported an error. The provider did not give any information about the error.\nMsg 7330, Level 16, State 2, Line 2\nCannot fetch a row from OLE DB provider \"BULK\" for linked server \"(null)\".\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"24794660","answer_count":"1","comment_count":"0","creation_date":"2014-07-17 03:31:50.807 UTC","last_activity_date":"2014-07-17 04:56:38.733 UTC","last_edit_date":"2014-07-17 04:56:38.733 UTC","last_editor_display_name":"","last_editor_user_id":"1021306","owner_display_name":"","owner_user_id":"1021306","post_type_id":"1","score":"0","tags":"sql-server-2008|sql-server-2008-r2|bulkinsert","view_count":"576"} +{"id":"842498","title":"Logging in to meetup.com with Curl","body":"\u003cp\u003eI'm trying to automatically log in to www.meetup.com without much success:-\u003c/p\u003e\n\n\u003cp\u003eThis is my code:-\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;?\n$username=\"my@email.com\";\n$password=\"123abc\";\n$url=\"http://meetup.com\";\n$cookie=\"cookie.txt\";\n\n$postdata = \"email=\". $username .\"\u0026amp;password=\". $password . \"\u0026amp;submitButton=Login\";\n$ch = curl_init();\ncurl_setopt ($ch, CURLOPT_URL, $url . \"/login\");\n\ncurl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\ncurl_setopt ($ch, CURLOPT_USERAGENT, \"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6\");\ncurl_setopt ($ch, CURLOPT_TIMEOUT, 60);\ncurl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);\ncurl_setopt ($ch, CURLOPT_RETURNTRANSFER, 0);\ncurl_setopt ($ch, CURLOPT_COOKIEJAR, $cookie);\ncurl_setopt ($ch, CURLOPT_REFERER, \"http://www.meetup.com/\");\n\ncurl_setopt ($ch, CURLOPT_POSTFIELDS, $postdata);\ncurl_setopt ($ch, CURLOPT_POST, 1);\n$result = curl_exec ($ch);\ncurl_close($ch);\necho $result;\n\nexit;\n?\u0026gt; \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNo joy - any ideas?\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e\n\n\u003cp\u003eJonathan\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2009-05-09 01:59:59.11 UTC","favorite_count":"5","last_activity_date":"2011-10-19 23:25:48.35 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"100238","post_type_id":"1","score":"3","tags":"php|curl","view_count":"1156"} +{"id":"11986034","title":"Hide standard background when using AlphaImageLoader filter in IE","body":"\u003cp\u003eplease how to hide standard background image from IE when \u003ccode\u003efilter: progid:DXImageTransform.Microsoft.AlphaImageLoader()\u003c/code\u003e is applied? I am using it for bacground-size support in IE..CSS looks like this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e background: url('../img/visit_ok.png') no-repeat center center;\n .background-size(contain); //LESS mixin \n filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(\n src='img/visit_ok.png',\n enabled=true,\n sizingMethod='scale');\n -ms-filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(\n src='img/visit_ok.png',\n enabled=true,\n sizingMethod='scale');\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe problem is in IE both images are displayed..On top is correctly scaled background form the filter, but underneath is the standard non-scaled png..\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2012-08-16 11:20:43.237 UTC","last_activity_date":"2012-08-16 11:42:46.22 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"419449","post_type_id":"1","score":"1","tags":"css|internet-explorer|css3","view_count":"595"} +{"id":"41431408","title":"numpy images - replace color based on other image","body":"\u003cp\u003eI'm trying to create image that shows the difference between 2 images. I have several functions that can compare 2 colors (array of 3 numbers) and returns how they differ 0.0 - 1.0.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecompare_colors(color1, color2)\n # do some calculation\n return difference\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow I want to replace the pixels in the first image with constant color (let's say \u003ccode\u003e[255, 0, 255]\u003c/code\u003e) where the color difference is higher than defined \u003ccode\u003etolerance\u003c/code\u003e using selected \u003ccode\u003ecompare_colors\u003c/code\u003e function.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edifferent = some selector where compare_colors(image1, image2) \u0026gt; tolerance\noriginal_image[different] = [255, 0, 255]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, I don't know how to create the selector with the \u003ccode\u003ecompare_colors\u003c/code\u003e function. I also need to access individual color channels in \u003ccode\u003ecompare_colors\u003c/code\u003e function.\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2017-01-02 18:08:03.587 UTC","last_activity_date":"2017-01-02 18:08:03.587 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2492795","post_type_id":"1","score":"1","tags":"python|image|numpy","view_count":"68"} +{"id":"45464311","title":"Distinct count to include blank values","body":"\u003cp\u003eIn the \u003ccode\u003eRunning Total Fields\u003c/code\u003e, how do you set up a \u003ccode\u003eDistinct Count\u003c/code\u003e that includes blank values as one of your conditions?\u003c/p\u003e","accepted_answer_id":"45467158","answer_count":"2","comment_count":"0","creation_date":"2017-08-02 14:57:10.053 UTC","last_activity_date":"2017-08-02 17:15:56.013 UTC","last_edit_date":"2017-08-02 17:14:13.473 UTC","last_editor_display_name":"","last_editor_user_id":"8346348","owner_display_name":"","owner_user_id":"8346348","post_type_id":"1","score":"1","tags":"crystal-reports","view_count":"34"} +{"id":"24873256","title":"Ember update property on the changes in array","body":"\u003cp\u003eI have following in my controller, and facing issue while updating property with array change..\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport Ember from 'ember';\n\nexport default Ember.Controller.extend({\n imageIds: Object.keys(JSON.parse(localStorage.image_ids || \"{}\")),\n // imageIds = ['gnffffffffjdf', 'hzfyfsidfulknm', 'euriekjhfkejh']\n\n previewImageId: function() {\n return this.imageIds.get('firstObject');\n }.property('imageIds.[]'),\n\n actions: {\n addDetails: function() {\n this.transitionToRoute('items.add_item');\n },\n\n removeImage: function(image_id) {\n var uploaded = JSON.parse(localStorage.image_ids || \"{}\");\n delete uploaded[image_id]\n localStorage.image_ids = JSON.stringify(uploaded);\n this.get(\"imageIds\").removeObject(image_id);\n // this.set(\"imageIds\", Object.keys(JSON.parse(localStorage.image_ids || \"{}\")));\n },\n\n updatePreview: function(image_id){\n this.set(\"previewImageId\", image_id);\n var uploaded = JSON.parse(localStorage.image_ids || \"{}\");\n uploaded[image_id] = image_id;\n localStorage.image_ids = JSON.stringify(uploaded);\n // this.set(\"imageIds\", Object.keys(JSON.parse(localStorage.image_ids)));\n this.get(\"imageIds\").pushObject(image_id);\n }\n },\n\ninit: function(){\n var controller = this;\n\n Ember.$('body').on('click', \".current_image\", function() {\n var public_id = Ember.$(this).attr('id');\n controller.set(\"previewImageId\", public_id);\n });\n }\n\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhenever there is any change in the \u003ccode\u003eimageIds\u003c/code\u003e array, \u003ccode\u003epreviewImageId\u003c/code\u003e should be updated.\ntried using \u003ccode\u003epushObject, removeObject, .get and .set\u003c/code\u003e options.\nBut still no luck\u003c/p\u003e\n\n\u003cp\u003eCan anyone pls help me?\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003eANSWER:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport Ember from 'ember';\n\nexport default Ember.Controller.extend({\n\n imageIds: function() {\n return Object.keys(JSON.parse(localStorage.image_ids || \"{}\"));\n }.property(),\n\n previewImageId: function() {\n return this.get(\"imageIds.firstObject\");\n }.property('imageIds.[]'),\n\n actions: {\n addDetails: function() {\n this.transitionToRoute('items.add_item');\n },\n\n removeImage: function(image_id) {\n var uploaded = JSON.parse(localStorage.image_ids || \"{}\");\n delete uploaded[image_id]\n localStorage.image_ids = JSON.stringify(uploaded);\n this.get(\"imageIds\").removeObject(image_id);\n },\n\n updatePreview: function(image_id){\n var uploaded = JSON.parse(localStorage.image_ids || \"{}\");\n uploaded[image_id] = image_id;\n localStorage.image_ids = JSON.stringify(uploaded);\n this.get(\"imageIds\").unshiftObject(image_id);\n }\n },\n\n init: function(){\n var controller = this;\n\n Ember.$('body').on('click', \".current_image\", function() {\n var public_id = Ember.$(this).attr('id');\n controller.get(\"imageIds\").removeObject(public_id);\n controller.get(\"imageIds\").unshiftObject(public_id);\n });\n }\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere previously I tried with setting value to previewImageId.. which was wrong way, as it overrides my computed property.\u003c/p\u003e","accepted_answer_id":"24882852","answer_count":"2","comment_count":"4","creation_date":"2014-07-21 19:36:21.51 UTC","last_activity_date":"2014-07-22 11:03:58.993 UTC","last_edit_date":"2014-07-22 11:03:58.993 UTC","last_editor_display_name":"","last_editor_user_id":"2923156","owner_display_name":"","owner_user_id":"2923156","post_type_id":"1","score":"1","tags":"ember.js|ember-data","view_count":"720"} +{"id":"29129196","title":"RAML API Designer File Save Location","body":"\u003cp\u003eI have just started to play around with RAML. I ran \u003ca href=\"https://github.com/mulesoft/api-designer\" rel=\"nofollow\"\u003eAPI designer\u003c/a\u003e locally using \u003ccode\u003egrunt server\u003c/code\u003e and used that to design a simple api doc in RAML. \u003c/p\u003e\n\n\u003cp\u003eDoes that \u003ccode\u003eraml\u003c/code\u003e file get saved in the local file system? I coudn't find the location where that file get saved in the local file system. I need that file since I've to commit it GIT repository.\u003c/p\u003e","answer_count":"4","comment_count":"1","creation_date":"2015-03-18 17:49:20.053 UTC","last_activity_date":"2016-12-20 20:04:33.63 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"898347","post_type_id":"1","score":"1","tags":"raml","view_count":"1110"} +{"id":"3393862","title":"I want good reference books or video links that may help me in learning Webobjects using Eclipse","body":"\u003cp\u003eCan any one post some links that help me in learning WebObjects with eclipse?\u003c/p\u003e","accepted_answer_id":"3395030","answer_count":"4","comment_count":"0","creation_date":"2010-08-03 05:42:05.807 UTC","favorite_count":"1","last_activity_date":"2013-09-25 17:06:10.467 UTC","last_edit_date":"2011-12-28 15:12:45.413 UTC","last_editor_display_name":"","last_editor_user_id":"714965","owner_display_name":"","owner_user_id":"380931","post_type_id":"1","score":"2","tags":"eclipse|webobjects","view_count":"207"} +{"id":"47016990","title":"Interfaces and classes vs Simple Factory design pattern","body":"\u003cp\u003eOne of my friend told me if I want to be a good programmer then I need to learn Design Patterns. And I started on that site : \n\u003ca href=\"https://github.com/kamranahmedse/design-patterns-for-humans\" rel=\"nofollow noreferrer\"\u003ehttps://github.com/kamranahmedse/design-patterns-for-humans\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI started from Simple Factory.\nAnd as you can see on that page you need to implement :\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003einterface Door\u003c/li\u003e\n\u003cli\u003eclass WoodenDoor\u003c/li\u003e\n\u003cli\u003eclass DoorFactory\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eAnd you can use it like this (PHP) : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$door = DoorFactory::makeDoor(100, 200);\necho 'Width: ' . $door-\u0026gt;getWidth();\necho 'Height: ' . $door-\u0026gt;getHeight();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut I was wondering why I need the layer of class DoorFactory which gives me new instance of WoodenDoor with given parameter when I can simply do :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eDoor door = new WoodenDoor(100, 200);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat is the big deal in making that factory when I can simple create instance by passing given constructor parameter by using new ClassName statement?\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003ch2\u003eEDITED\u003c/h2\u003e\n\n\u003cp\u003eArgument that tells that I can easy manage changes in many occurences of given element repeal by this solution :\u003c/p\u003e\n\n\u003cp\u003eCreating a given class (as an given factory type in factory solution) like : \u003c/p\u003e\n\n\u003cp\u003eclass LongWoodenDoor which extends WoodenDoor class and use WoodenDoor constructor with given parameters. e.g by using super(\"100\", \"200\");\u003c/p\u003e","answer_count":"2","comment_count":"4","creation_date":"2017-10-30 13:53:34.097 UTC","favorite_count":"1","last_activity_date":"2017-10-31 11:40:13.173 UTC","last_edit_date":"2017-10-31 11:40:13.173 UTC","last_editor_display_name":"","last_editor_user_id":"8330405","owner_display_name":"","owner_user_id":"8330405","post_type_id":"1","score":"1","tags":"php|design-patterns|factory-pattern","view_count":"70"} +{"id":"40693287","title":"navigationController popToViewController not working in swift 3","body":"\u003cp\u003eI want use \u003ccode\u003epopToViewController\u003c/code\u003e of \u003ccode\u003enavigationController\u003c/code\u003e in swift 3.0.\n\u003cbr/\u003eFor that I written below code but nothing working as expected.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elet controllers = self.navigationController?.viewControllers\nfor vc in controllers! {\n if vc is HomeViewController {\n self.navigationController?.popToViewController(vc, animated: true)\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI also wrote below code, but that is also working.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efor vc in controllers! {\n if vc.isKind(of:HomeViewController.self) {\n self.navigationController?.popToViewController(vc, animated: true)\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ePlease help me to solve this problem.\u003c/p\u003e","answer_count":"2","comment_count":"2","creation_date":"2016-11-19 13:10:39.323 UTC","last_activity_date":"2017-04-17 02:47:50.07 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3110026","post_type_id":"1","score":"1","tags":"ios|uinavigationcontroller|swift3","view_count":"2005"} +{"id":"35954038","title":"White screen while running on specific devices | possible cause?","body":"\u003cp\u003eI am testing my app , it works fine on a Nexus 5 , but when the app(debug apk) is tried on a Samsung galaxy s3 (API 18) it shows nothing but a black screen!\nCan this be due to any bugs in the Application class?\u003c/p\u003e\n\n\u003cp\u003eHere is the code to Application class:\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eAppController.class\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public class AppController extends Application\n{\n public static final String TAG = AppController.class.getSimpleName();\n\n private RequestQueue mRequestQueue;\n private ImageLoader mImageLoader;\n\n\n\n private static AppController mInstance;\n\n @Override\n public void onCreate() {\n super.onCreate();\n\n mInstance = this;\n //ACRA.init(this);\n //ACRA.getErrorReporter().setReportSender(new CrashSender());\n Fabric fabric = new Fabric.Builder(this).debuggable(true).kits(new Crashlytics()).build();\n Fabric.with(fabric);\n\n\n }\n\n public static synchronized AppController getInstance() {\n return mInstance;\n }\n\n public RequestQueue getRequestQueue() {\n if (mRequestQueue == null) {\n mRequestQueue = Volley.newRequestQueue(getApplicationContext());\n }\n\n return mRequestQueue;\n }\n\n public ImageLoader getImageLoader() {\n getRequestQueue();\n if (mImageLoader == null) {\n mImageLoader = new ImageLoader(this.mRequestQueue,\n new LruBitmapCache());\n }\n return this.mImageLoader;\n }\n\n public \u0026lt;T\u0026gt; void addToRequestQueue(Request\u0026lt;T\u0026gt; req, String tag) {\n // set the default tag if tag is empty\n req.setTag(TextUtils.isEmpty(tag) ? TAG : tag);\n getRequestQueue().add(req);\n }\n\n public \u0026lt;T\u0026gt; void addToRequestQueue(Request\u0026lt;T\u0026gt; req) {\n req.setTag(TAG);\n getRequestQueue().add(req);\n }\n\n public void cancelPendingRequests(Object tag) {\n if (mRequestQueue != null) {\n mRequestQueue.cancelAll(tag);\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAlso here is the manifest file:\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eAndroidManifest.xml\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;?xml version=\"1.0\" encoding=\"utf-8\"?\u0026gt;\n\u0026lt;manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n package=\"com.mobloo.eduknow\"\u0026gt;\n\n \u0026lt;uses-permission android:name=\"android.permission.INTERNET\" /\u0026gt;\n \u0026lt;uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\" /\u0026gt;\n \u0026lt;uses-permission android:name=\"android.permission.WAKE_LOCK\" /\u0026gt;\n \u0026lt;uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" /\u0026gt;\n \u0026lt;uses-permission android:name=\"android.permission.READ_PHONE_STATE\" /\u0026gt;\n \u0026lt;uses-permission android:name=\"android.permission.READ_SMS\" /\u0026gt;\n \u0026lt;uses-permission android:name=\"com.google.android.c2dm.permission.RECEIVE\" /\u0026gt;\n\n \u0026lt;application\n android:name=\".AppController\"\n android:allowBackup=\"true\"\n android:icon=\"@drawable/logo\"\n android:label=\"@string/app_name\"\n android:supportsRtl=\"true\"\n android:theme=\"@style/AppTheme\"\u0026gt;\n \u0026lt;receiver\n android:name=\"com.google.android.gms.gcm.GcmReceiver\"\n android:exported=\"true\"\n android:permission=\"com.google.android.c2dm.permission.SEND\"\u0026gt;\n \u0026lt;intent-filter\u0026gt;\n \u0026lt;action android:name=\"com.google.android.c2dm.intent.RECEIVE\" /\u0026gt;\n\n \u0026lt;category android:name=\"com.mobloo.eduknow\" /\u0026gt;\n \u0026lt;/intent-filter\u0026gt;\n \u0026lt;/receiver\u0026gt;\n\n \u0026lt;service\n android:name=\".MyGcmListenerService\"\n android:exported=\"false\"\u0026gt;\n \u0026lt;intent-filter\u0026gt;\n \u0026lt;action android:name=\"com.google.android.c2dm.intent.RECEIVE\" /\u0026gt;\n \u0026lt;/intent-filter\u0026gt;\n \u0026lt;/service\u0026gt;\n \u0026lt;service\n android:name=\".MyInstanceIDListenerService\"\n android:exported=\"false\"\u0026gt;\n \u0026lt;intent-filter\u0026gt;\n \u0026lt;action android:name=\"com.google.android.gms.iid.InstanceID\" /\u0026gt;\n \u0026lt;/intent-filter\u0026gt;\n \u0026lt;/service\u0026gt;\n \u0026lt;service\n android:name=\".RegistrationIntentService\"\n android:exported=\"false\" /\u0026gt;\n\n \u0026lt;activity android:name=\".MainActivity\" /\u0026gt;\n \u0026lt;activity android:name=\".Splash\"\u0026gt;\n \u0026lt;intent-filter\u0026gt;\n \u0026lt;action android:name=\"android.intent.action.MAIN\" /\u0026gt;\n\n \u0026lt;category android:name=\"android.intent.category.LAUNCHER\" /\u0026gt;\n \u0026lt;/intent-filter\u0026gt;\n \u0026lt;/activity\u0026gt;\n \u0026lt;activity android:name=\".OTP_Check\" /\u0026gt;\n \u0026lt;activity android:name=\".FeedActivity\" /\u0026gt;\n \u0026lt;activity\n android:name=\".VideoPlayer\"\n android:theme=\"@style/FullO\" /\u0026gt;\n \u0026lt;activity android:name=\".WebViewFee\" /\u0026gt;\n \u0026lt;activity android:name=\".ImageLoadFullX\" /\u0026gt;\n \u0026lt;activity android:name=\".YouTubePlayer\"\u0026gt;\u0026lt;/activity\u0026gt;\n \u0026lt;meta-data\n android:name=\"io.fabric.ApiKey\"\n android:value=\"XXXXXXXXX\" /\u0026gt;\n \u0026lt;/application\u0026gt;\n\n\u0026lt;/manifest\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAm I missing something? Let me know, thanks!\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2016-03-12 05:10:18.37 UTC","last_activity_date":"2016-03-12 05:10:18.37 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4738175","post_type_id":"1","score":"0","tags":"android","view_count":"44"} +{"id":"22189862","title":"Form not displaying error messages for nested resource","body":"\u003cp\u003eI am having trouble getting error messages to display when a user tries to submit a blank comment. Upon create failure it \u003ccode\u003erender 'posts/show'\u003c/code\u003e properly but it doesnt appear to be sending the \u003ccode\u003e@comment\u003c/code\u003e object that my error_messages partial expects. Any thoughts? \u003c/p\u003e\n\n\u003cp\u003ecomments_controller.rb:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e def create\n @post = Post.find(params[:post_id])\n @comment = @post.comments.build(comment_params)\n @comment.user = current_user\n if @comment.save\n flash[:success] = \"Comment created!\"\n redirect_to post_path(@post)\n else\n @comments = @post.comments.paginate(page: params[:page], :per_page =\u0026gt; 5)\n render 'posts/show' # =\u0026gt; Renders but does not display errors???\n end\n end\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eposts_controller.rb:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e def show\n @post = Post.find(params[:id])\n @comments = @post.comments.paginate(page: params[:page], :per_page =\u0026gt; 5)\n @comment = @post.comments.build if signed_in?\n end\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e_comment_form.html.erb\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;%= form_for([@post, @post.comments.build], :html =\u0026gt; { :role =\u0026gt; \"form\" }) do |f| %\u0026gt;\n \u0026lt;%= render 'shared/error_messages', object: f.object %\u0026gt;\n \u0026lt;div class=\"form-group\"\u0026gt;\n \u0026lt;%= f.label :content %\u0026gt;\n \u0026lt;%= f.text_area :content, class: \"form-control\", placeholder: \"Enter new comment...\" %\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"btn-group\"\u0026gt;\n \u0026lt;%= f.submit \"Post\", class: \"btn btn-large btn-primary\" %\u0026gt;\n \u0026lt;/div\u0026gt;\n\u0026lt;% end %\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"22190082","answer_count":"1","comment_count":"3","creation_date":"2014-03-05 06:04:38.607 UTC","last_activity_date":"2014-03-05 06:18:19.97 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3238258","post_type_id":"1","score":"1","tags":"ruby-on-rails|ruby-on-rails-4","view_count":"630"} +{"id":"38505010","title":"Dynamic menu in MVC","body":"\u003cp\u003eI am creating dynamic menu in MVC razor which is role based, I am getting list of menu items from database then saving it in session, then I have created a partial view for menu and passing this session in it. \nIts working fine, however I am not sure where to create this menu session?\nThis is my partial view\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;ul class=\"nav navbar-nav\"\u0026gt;\n @foreach (var item in Model)\n {\n \u0026lt;li class=\"dropdown\"\u0026gt;\n \u0026lt;a class=\"dropdown-toggle\" data-toggle=\"dropdown\" href=\"#\"\u0026gt;@item.GroupName\u0026lt;span class=\"caret\"\u0026gt;\u0026lt;/span\u0026gt;\u0026lt;/a\u0026gt;\n \u0026lt;ul class=\"dropdown-menu dropdown-submenu\"\u0026gt;\n @foreach (var sub_item in item.ChildPages)\n {\n \u0026lt;li\u0026gt;\u0026lt;a href=\"@sub_item.Url\"\u0026gt;@sub_item.DisplayName \u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n }\n\n \u0026lt;/ul\u0026gt;\n \u0026lt;/li\u0026gt;\n }\n \u0026lt;/ul\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis how I am getting menu\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar lst = MenuHelper.GetMenu(\"logged_in_user_Id\");\nSession[\"Menu\"]=lst;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand on my Layout Page, I am having this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e @Html.Partial(\"_Menu\" , Session[\"Menu\"] as List\u0026lt;Menu\u0026gt;);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have tried adding the menu getting code in Global.asax Session_Start event but I am getting Session[\"Menu\"] null on my layout page.\nWhere should I create the menu session after user get login?\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2016-07-21 13:01:55.067 UTC","last_activity_date":"2016-07-21 15:58:42.71 UTC","last_edit_date":"2016-07-21 15:58:42.71 UTC","last_editor_display_name":"","last_editor_user_id":"3814721","owner_display_name":"user2696183","post_type_id":"1","score":"0","tags":"asp.net-mvc|asp.net-mvc-4|razor","view_count":"318"} +{"id":"4624384","title":"How do you query using an \"IN\" WHERE clause with Zend_Db_Adapter_Mysqli::fetchAll()?","body":"\u003cp\u003eI'm having a strange problem with \u003ccode\u003eZend_Db_Adapter_Mysqli\u003c/code\u003e. I need to query multiple items by ID from my database, so I have the following SQL,\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT * FROM mytable WHERE id IN (1,2,3)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis query works fine.\u003c/p\u003e\n\n\u003cp\u003eI then try and do this programatically with \u003ccode\u003eZend_Db_Adapter_Mysqli\u003c/code\u003e,\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$sql = 'SELECT * FROM mytable WHERE id IN (?)';\n$ids = array(1,2,3);\n$result = $adapter-\u0026gt;fetchAll($sql, implode(',', $ids));\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe problem is for the above PHP I only get back 1 result instead of the expected 3. I've tried just passing the \u003ccode\u003e$ids\u003c/code\u003e instead of using \u003ccode\u003eimplode()\u003c/code\u003e, but I just get an error.\u003c/p\u003e\n\n\u003cp\u003eWhat am I doing wrong?\u003c/p\u003e","accepted_answer_id":"4624447","answer_count":"4","comment_count":"2","creation_date":"2011-01-07 10:06:21.113 UTC","last_activity_date":"2011-01-07 10:30:09.843 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"189230","post_type_id":"1","score":"1","tags":"php|zend-framework|mysqli","view_count":"587"} +{"id":"36336117","title":"jQuery - Don't hide div if I click inside it","body":"\u003cp\u003eI'm trying to keep the current div visible if I click inside it. I want to hide the div only if I click anywhere on the page but the current div.\u003c/p\u003e\n\n\u003cp\u003eI already tried \u003ccode\u003ee.stopPropagation();\u003c/code\u003e but that breaks other click handlers I have inside the function.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003e\u003ca href=\"https://jsfiddle.net/2pr3xtxf/23/\" rel=\"nofollow\"\u003ejsFiddle\u003c/a\u003e\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar filterContainer = $(\".js-filter-container\");\nvar pageDocument = $(document);\n\n$(document).on('click', '.js-show-filter', function(e) {\n e.preventDefault();\n\n var currentFilter = $(this).next(filterContainer);\n currentFilter.toggle().css(\"z-index\", 99);\n filterContainer.not(currentFilter).hide();\n\n pageDocument.click(function(){\n filterContainer.hide();\n });\n\n return false;\n});\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"36337842","answer_count":"4","comment_count":"3","creation_date":"2016-03-31 14:21:11.037 UTC","last_activity_date":"2016-03-31 15:37:43.553 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3734870","post_type_id":"1","score":"2","tags":"javascript|jquery","view_count":"481"} +{"id":"44312628","title":"Combining messages from multiple devices","body":"\u003cp\u003eIs there a recommended way in the Azure ecosystem to join the JSON messages sent by two or more separate devices at approximately the same time in order to run them through, for example, an Azure ML webservice.\u003c/p\u003e\n\n\u003cp\u003eThe goal of this would be running a real time analysis with data coming from multiple devices.\u003c/p\u003e\n\n\u003cp\u003eThank you\u003c/p\u003e\n\n\u003cp\u003eEdit : \nPerhaps I should have phrased my question better, but I am currently using Azure Stream Analytics in order to capture the data sent from a device to Azure ML, which works fine (from docs.microsoft.com/en-us/azure/iot-hub/…). Now I want to do the same thing but with multiple devices that each send part of the information that Azure ML needs. \u003c/p\u003e","accepted_answer_id":"44313685","answer_count":"1","comment_count":"0","creation_date":"2017-06-01 16:19:58.167 UTC","last_activity_date":"2017-06-01 17:46:29.497 UTC","last_edit_date":"2017-06-01 17:46:29.497 UTC","last_editor_display_name":"","last_editor_user_id":"2643725","owner_display_name":"","owner_user_id":"2643725","post_type_id":"1","score":"0","tags":"azure-stream-analytics|azure-iot-hub","view_count":"54"} +{"id":"18636852","title":"Error with Weblogic 10.x while deploying","body":"\u003cp\u003eI am receiving an error while I try to connect my local environment to a Test DB. Deployment of the ear file fails.\u003c/p\u003e\n\n\u003ch1\u003eHere's the exception stack trace.\u003c/h1\u003e\n\n\u003cpre\u003e\u003ccode\u003e####\u0026lt;Sep 5, 2013 5:22:22 PM IST\u0026gt; \u0026lt;Info\u0026gt; \u0026lt;Deployer\u0026gt; \u0026lt;H1-DDM67BS\u0026gt; \u0026lt;AdminServer\u0026gt; \u0026lt;[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'\u0026gt; \u0026lt;\u0026lt;WLS Kernel\u0026gt;\u0026gt; \u0026lt;\u0026gt; \u0026lt;\u0026gt; \u0026lt;1378381942855\u0026gt; \u0026lt;BEA-149060\u0026gt; \u0026lt;Module nemo of application NeMo successfully transitioned from STATE_PREPARED to STATE_ADMIN on server AdminServer.\u0026gt; \n####\u0026lt;Sep 5, 2013 5:22:24 PM IST\u0026gt; \u0026lt;Warning\u0026gt; \u0026lt;JMSPool\u0026gt; \u0026lt;H1-DDM67BS\u0026gt; \u0026lt;AdminServer\u0026gt; \u0026lt;[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'\u0026gt; \u0026lt;\u0026lt;anonymous\u0026gt;\u0026gt; \u0026lt;\u0026gt; \u0026lt;\u0026gt; \u0026lt;1378381944212\u0026gt; \u0026lt;BEA-169808\u0026gt; \u0026lt;There was an error while making the initial connection to the JMS resource named jms/statisticsFactory from the EJB \"JMSWriter\" inside application \"NeMo\". The server will attempt the connection again later. The error was javax.jms.JMSException: [JMSPool:169803]JNDI lookup of the JMS connection factory jms/statisticsFactory failed: javax.naming.NameNotFoundException: While trying to lookup 'jms.statisticsFactory' didn't find subcontext 'jms'. Resolved ''; remaining name 'jms/statisticsFactory'\u0026gt; \n####\u0026lt;Sep 5, 2013 5:22:26 PM IST\u0026gt; \u0026lt;Info\u0026gt; \u0026lt;Kodo\u0026gt; \u0026lt;H1-DDM67BS\u0026gt; \u0026lt;AdminServer\u0026gt; \u0026lt;[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'\u0026gt; \u0026lt;\u0026lt;anonymous\u0026gt;\u0026gt; \u0026lt;BEA1-00003CA049AA50DAD185\u0026gt; \u0026lt;\u0026gt; \u0026lt;1378381946428\u0026gt; \u0026lt;BEA-2004002\u0026gt; \u0026lt;Starting BEA Kodo 4.1.3.1\u0026gt; \n####\u0026lt;Sep 5, 2013 5:22:26 PM IST\u0026gt; \u0026lt;Info\u0026gt; \u0026lt;Kodo JDBC\u0026gt; \u0026lt;H1-DDM67BS\u0026gt; \u0026lt;AdminServer\u0026gt; \u0026lt;[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'\u0026gt; \u0026lt;\u0026lt;anonymous\u0026gt;\u0026gt; \u0026lt;BEA1-00003CA049AA50DAD185\u0026gt; \u0026lt;\u0026gt; \u0026lt;1378381946474\u0026gt; \u0026lt;BEA-2002382\u0026gt; \u0026lt;[JDBC] Using dictionary class \"com.bmw.nemo.business.util.MyOracleDictionary\".\u0026gt; \n####\u0026lt;Sep 5, 2013 5:22:26 PM IST\u0026gt; \u0026lt;Info\u0026gt; \u0026lt;Kodo JDBC\u0026gt; \u0026lt;H1-DDM67BS\u0026gt; \u0026lt;AdminServer\u0026gt; \u0026lt;[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'\u0026gt; \u0026lt;\u0026lt;anonymous\u0026gt;\u0026gt; \u0026lt;BEA1-00003CA049AA50DAD185\u0026gt; \u0026lt;\u0026gt; \u0026lt;1378381946584\u0026gt; \u0026lt;BEA-2002360\u0026gt; \u0026lt;[JDBC] OpenJPA is now connecting to the database in order to figure out what JDBC driver you are using, as OpenJPA must alter its behavior for this database depending on the driver vendor. To avoid this connection, set the DriverVendor value in your org.apache.openjpa.jdbc.DBDictionary configuration property to one of the following values: oracle, oracle92 (for the 9.2 driver), datadirect, datadirect61 (for driver versions \u0026lt;= 3.1), other For example: org.apache.openjpa.jdbc.DBDictionary: oracle(DriverVendor=oracle92)\u0026gt; \n####\u0026lt;Sep 5, 2013 5:22:28 PM IST\u0026gt; \u0026lt;Warning\u0026gt; \u0026lt;Kodo\u0026gt; \u0026lt;H1-DDM67BS\u0026gt; \u0026lt;AdminServer\u0026gt; \u0026lt;[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'\u0026gt; \u0026lt;\u0026lt;anonymous\u0026gt;\u0026gt; \u0026lt;BEA1-00003CA049AA50DAD185\u0026gt; \u0026lt;\u0026gt; \u0026lt;1378381948783\u0026gt; \u0026lt;BEA-2000012\u0026gt; \u0026lt;[MetaData] Found duplicate query \"XXXX.ProjektByWerkJoin\" in \"class XXXX.ProjektBE\". Ignoring.\u0026gt; \n####\u0026lt;Sep 5, 2013 5:22:59 PM IST\u0026gt; \u0026lt;Info\u0026gt; \u0026lt;EJB\u0026gt; \u0026lt;H1-DDM67BS\u0026gt; \u0026lt;AdminServer\u0026gt; \u0026lt;[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'\u0026gt; \u0026lt;\u0026lt;anonymous\u0026gt;\u0026gt; \u0026lt;BEA1-00003CA049AA50DAD185\u0026gt; \u0026lt;\u0026gt; \u0026lt;1378381979251\u0026gt; \u0026lt;BEA-010051\u0026gt; \u0026lt;EJB Exception occurred during invocation from home: weblogic.ejb.container.internal.StatelessEJBHomeImpl@239c1e7 threw exception: \u0026lt;1.0.0.1.1 nonfatal general error\u0026gt; org.apache.openjpa.persistence.PersistenceException: The transaction is no longer active - status: 'Marked rollback. [Reason=weblogic.transaction.internal.TimedOutException: Transaction timed out after 32 seconds \nBEA1-00003CA049AA50DAD185]'. No further JDBC access is allowed within this transaction.\n\u0026lt;1.0.0.1.1 nonfatal general error\u0026gt; org.apache.openjpa.persistence.PersistenceException: The transaction is no longer active - status: 'Marked rollback. [Reason=weblogic.transaction.internal.TimedOutException: Transaction timed out after 32 seconds \nBEA1-00003CA049AA50DAD185]'. No further JDBC access is allowed within this transaction.\n at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:3849)\n at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:3813)\n at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:102)\n at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:88)\n at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:64)\n at org.apache.openjpa.jdbc.kernel.SelectResultObjectProvider.handleCheckedException(SelectResultObjectProvider.java:155)\n at org.apache.openjpa.lib.rop.EagerResultList.\u0026lt;init\u0026gt;(EagerResultList.java:40)\n at org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1219)\n at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:987)\n at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:796)\n at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:766)\n at kodo.kernel.KodoQuery.execute(KodoQuery.java:43)\n at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:762)\n at kodo.kernel.KodoQuery.execute(KodoQuery.java:39)\n at org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:517)\n at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:230)\n at org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:269)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e===============\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003cp\u003eI have tried all sorts of setting on JTA by increasing the timeouts etc on weblogic console, didn't work.\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eI have dumped the whole data on my local oracle DB and then connected it works perfectly but it's a tedious job again and again to take the dump from remote DB and dump it on my local DB.\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eI am not sure why it's not working when I connect to remote DB but locally it works with the same weblogic settings.\u003c/p\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003ePlease share your opinions.\u003c/p\u003e\n\n\u003cp\u003e-Vishal Nadikudi \u003c/p\u003e","answer_count":"0","comment_count":"4","creation_date":"2013-09-05 12:51:01.637 UTC","favorite_count":"1","last_activity_date":"2013-09-05 13:10:53.643 UTC","last_edit_date":"2013-09-05 13:10:53.643 UTC","last_editor_display_name":"","last_editor_user_id":"599528","owner_display_name":"","owner_user_id":"1894366","post_type_id":"1","score":"0","tags":"weblogic|weblogic-10.x","view_count":"829"} +{"id":"47140224","title":"Generate C# from H2O Model","body":"\u003cp\u003eI know you can generate Java POJOs from H2O models built in Python or R, but is there a way to build C# dlls or something similar that can run in a .NET environment? I have seen references to this but nothing concrete.\u003c/p\u003e","accepted_answer_id":"47248224","answer_count":"2","comment_count":"3","creation_date":"2017-11-06 15:22:06.067 UTC","last_activity_date":"2017-11-12 11:25:15.58 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7710042","post_type_id":"1","score":"2","tags":"c#|r|h2o","view_count":"43"} +{"id":"34215288","title":"Add a parameter to all ajax calls with method POST made with jQuery","body":"\u003cp\u003eAnswer is simular to \u003ca href=\"https://stackoverflow.com/questions/7270751/adding-a-general-parameter-to-all-ajax-calls-made-with-jquery\"\u003eAdding a general parameter to all ajax calls made with jQuery\u003c/a\u003e, but I need to add additional param only for ajax calls with method post:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$.ajax({\n url: url,\n type: \"POST\",\n data: data,\n success: success,\n dataType: dataType\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMay I achieve this without adding param into all ajax calls directly (editing inplace), i.e. via setup param via some sort of common config? \u003c/p\u003e","accepted_answer_id":"34215403","answer_count":"1","comment_count":"3","creation_date":"2015-12-11 02:42:49.387 UTC","last_activity_date":"2015-12-11 04:56:13.87 UTC","last_edit_date":"2017-05-23 11:52:22.837 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"1203805","post_type_id":"1","score":"1","tags":"javascript|jquery|ajax","view_count":"576"} +{"id":"22559686","title":"Get keyboard's superview in ios","body":"\u003cp\u003eI am trying to move keyboard with the uiviewcontroller when the user is trying to go back using edge swipe and keyboard is there on the controller. \nSo one solution I found is to animate keyboard's superview along with edge swipe using this function:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eanimateAlongsideTransitionInView:animation:completion\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut for this I need to get superview of the keyboard. So I was adding one dummy inputAccesoryView to it and then using it to get superview. But I do not want to use this method as this seems very brittle. Is there anyway to get reference to directly keyboard or its superview without using inputAccesoryView.\nAny help will be appreciated as I am stuck badly on this. Have searched a lot but everywhere it is written to use this inputAccessory method.\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2014-03-21 13:07:58.01 UTC","last_activity_date":"2014-03-21 13:07:58.01 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1541873","post_type_id":"1","score":"1","tags":"ios|iphone|uiviewcontroller|keyboard","view_count":"162"} +{"id":"8288037","title":"JQuery ajax call returns json data - good. How do we grab each piece of data so query can act on it?","body":"\u003cp\u003eDoing an ajax call to a page to grab 5 pieces of data. 3 images as filenames, 2 statuses as numbers 1/0. End game is to use this data to instruct jquery to change out 3 divs with the images as a result of the ajax call. So am trying to get a grip on these items to hand them off to a function that will swap out these divs. Issue thus far is grabbing the data pieces into a format whereby I can manipulate them. Values to vars....\u003c/p\u003e\n\n\u003cp\u003eReturn data seems fine. Formatted correctly. Actual return example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[\n{\"optiontext\" : \"spin1\", \"optionvalue\" : \"brown_anna.jpg\"},\n{\"optiontext\" : \"spin2\", \"optionvalue\" : \"crada_amberly.jpg\"},\n{\"optiontext\" : \"spin3\", \"optionvalue\" : \"ginda_marlins.jpg\"},\n{\"optiontext\" : \"SID\", \"optionvalue\" : \"1\"},\n{\"optiontext\" : \"HOT\", \"optionvalue\" : \"1\"}\n]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCalled by - and just outputting them as a list - How does one obtain this data in distinct pieces as vars for a future query image swap?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edataType:\"json\",\n success: function (data) {\n var winns=\"\u0026lt;ul\u0026gt;\";\n $.each(data, function(i,n){\n winns+=\"\u0026lt;li\u0026gt;\"+n[\"optionvalue\"]+\"\u0026lt;/li\u0026gt;\";\n });\n winns+=\"\u0026lt;/ul\u0026gt;\";\n $('#message').append(winns);\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny help greatly appreciated - its been days...... Does not have to be JSON data either. At this point will try anything to get this charity project done.\u003c/p\u003e","accepted_answer_id":"8289257","answer_count":"1","comment_count":"0","creation_date":"2011-11-27 18:42:27.15 UTC","last_activity_date":"2011-11-27 21:35:08.883 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"888357","post_type_id":"1","score":"1","tags":"php|javascript|ajax|jquery","view_count":"195"} +{"id":"18969423","title":"Can system notes be accessed via web services?","body":"\u003cp\u003eI am developing a Net Suite application based on web services (SuiteTalk). I have learned about the concept of System Notes, which are a journal of changes on all types of objects. Yet, I see no way to access the list of system notes (say last N notes) via web services. Are you aware if this is possible and how? If not, what would be an alternative solution?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-09-23 21:43:56.857 UTC","last_activity_date":"2013-10-10 08:13:24.347 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"89604","post_type_id":"1","score":"0","tags":"netsuite","view_count":"554"} +{"id":"33800501","title":"Thrift serialization for kafka messages - single topic per struct","body":"\u003cp\u003eI'm planning of using kafka as a \u003ca href=\"https://stackoverflow.com/a/22597637/1033422\"\u003epersistent log for event sourcing\u003c/a\u003e and I'm currently investigating different serialization options. My focus is currently on using thrift for the serialization and deserialization of messages that I will be storing in kafka. \u003c/p\u003e\n\n\u003cp\u003eWhen using thrift so serialize messages for kafka, the simplest approach appears to be to have a single thrift struct per kafka topic.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eQuestion:\u003c/strong\u003e Is this a good pattern to follow in practice? If not, can you please list the disadvantages of following this approach?\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003e\u003cem\u003eNote: If you think this question doesn't meet stackoverflow standards, please help me improve it!\u003c/em\u003e\u003c/p\u003e","accepted_answer_id":"44057600","answer_count":"1","comment_count":"0","creation_date":"2015-11-19 09:56:19.483 UTC","last_activity_date":"2017-05-18 20:54:21.06 UTC","last_edit_date":"2017-05-23 11:47:27.847 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"1033422","post_type_id":"1","score":"4","tags":"apache-kafka|thrift","view_count":"182"} +{"id":"43981417","title":"Canvas.captureStream() causes update layer tree to consume a lot of time","body":"\u003cp\u003eThe moment we use canvas.captureStream() the performance of the system is reduced with low fps. In the performance tab I can see majority of the time being consumed by update layer tree. Can someone explain the link between captureStream and update layer tree?\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2017-05-15 13:56:12.267 UTC","last_activity_date":"2017-05-15 13:56:12.267 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1630253","post_type_id":"1","score":"0","tags":"javascript|performance|google-chrome","view_count":"33"} +{"id":"20907633","title":"Internet Explorer 7,8 Font Face with Turkish Chars","body":"\u003cp\u003eI am trying to use \u003ca href=\"http://www.fontsquirrel.com/fonts/open-sans\" rel=\"nofollow noreferrer\"\u003eOpen Sans (Turkish version)\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI am pretty sure i applied correct syntax. however Turkish character looks different in IE 7,8\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eIE 9\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/8m08c.png\" alt=\"Ie 9 semibold font\"\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/9XCtP.png\" alt=\"Ie 9 regular font\"\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eIE8 and IE7\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/s1t6b.png\" alt=\"Ie 8 semibold font\"\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/h8nJE.png\" alt=\"Ie 8 regular font\"\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@font-face {\nfont-family: 'open_sansregular';\nsrc: url('Fonts/OpenSans-Regular-webfont.eot');\nsrc: url('Fonts/OpenSans-Regular-webfont.eot?#iefix') format('embedded-opentype'),\n url('Fonts/OpenSans-Regular-webfont.woff') format('woff'),\n url('Fonts/OpenSans-Regular-webfont.ttf') format('truetype'),\n url('Fonts/OpenSans-Regular-webfont.svg#open_sansregular') format('svg');\nfont-weight: normal;\nfont-style: normal;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e}\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@font-face {\n font-family: 'open_sanssemibold';\n src: url('Fonts/OpenSans-Semibold-webfont.eot');\n src: url('Fonts/OpenSans-Semibold-webfont.eot?#iefix') format('embedded-opentype'),\n url('Fonts/OpenSans-Semibold-webfont.woff') format('woff'),\n url('Fonts/OpenSans-Semibold-webfont.ttf') format('truetype'),\n url('Fonts/OpenSans-Semibold-webfont.svg#open_sanssemibold') format('svg');\n font-weight: normal;\n font-style: normal;\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT\u003c/strong\u003e\nThis is strange I uploaded example \u003ca href=\"http://test.ardaterekeci.com\" rel=\"nofollow noreferrer\"\u003ehere\u003c/a\u003e and it works perfectly. Problem still exist on localhost\u003c/p\u003e\n\n\u003cp\u003eI am using VS 2013 and IIS Express 8.0\u003c/p\u003e","accepted_answer_id":"21063646","answer_count":"1","comment_count":"8","creation_date":"2014-01-03 15:56:37.44 UTC","last_activity_date":"2014-01-11 14:48:10.083 UTC","last_edit_date":"2014-01-03 19:45:37.26 UTC","last_editor_display_name":"","last_editor_user_id":"2580211","owner_display_name":"","owner_user_id":"2580211","post_type_id":"1","score":"0","tags":"css|internet-explorer|font-face|visual-studio-2013|iis-8","view_count":"292"} +{"id":"4074767","title":"Is a DBMS (MySQL, SQL Server….) interpreted or compiled?","body":"\u003cp\u003eI mean, in the terms of the SQL queries, Are they compiled or interpreted in a low level?. How it works internally, It is a SQL statement interpreted or compiled?.\u003c/p\u003e","accepted_answer_id":"4075401","answer_count":"2","comment_count":"1","creation_date":"2010-11-02 03:39:19.983 UTC","last_activity_date":"2017-10-28 09:48:15.253 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"114747","post_type_id":"1","score":"6","tags":"mysql|database","view_count":"2112"} +{"id":"35470429","title":"Uncaught ReferenceError: height is not defined - Backbone.js","body":"\u003cp\u003eFirst of all, I am completely new to Backbone.js and I am using \u003ca href=\"http://jsfiddle.net/joeartsea/KjYqf/\" rel=\"nofollow\"\u003ethis example\u003c/a\u003e to learn. \u003c/p\u003e\n\n\u003cp\u003eI am trying to get values from a text input and create models from the input. The template should be loaded and the attribute \u003ccode\u003eheight\u003c/code\u003e from each model should be displayed on the same HTML. \u003c/p\u003e\n\n\u003cp\u003eI am able to create models and add them to a collection since I see \u003ccode\u003en {length: 105, models: Array[105], _byId: Object}\u003c/code\u003e in console.log(Sections). However, (I'm guessing) when I try to load the template, it is giving me the error: 'Uncaught ReferenceError: height is not defined'. I am thinking if I am getting the attributes incorrectly.\u003c/p\u003e\n\n\u003cp\u003eAny help would be appreciated! Thank you in advance.\u003c/p\u003e\n\n\u003cp\u003eHere is the template:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;script type=\"text/template\" id=\"section-template\"\u0026gt;\n \u0026lt;div class=\"view\"\u0026gt;\n \u0026lt;label\u0026gt;\u0026lt;%- height %\u0026gt;\u0026lt;/label\u0026gt;\n \u0026lt;label\u0026gt;\u0026lt;%- color %\u0026gt;\u0026lt;/label\u0026gt;\n \u0026lt;a class=\"destroy\"\u0026gt;\u0026lt;/a\u0026gt;\n \u0026lt;/div\u0026gt;\n\u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eModel:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar Section = Backbone.Model.extend({\n defaults: function(){\n return {\n height: 200,\n color: ''\n };\n }\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eModel Collection:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar SectionList = Backbone.Collection.extend({\n model: Section,\n localStorage: new Backbone.LocalStorage(\"sections-backbone\")\n});\nvar Sections = new SectionList;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eModel View \u0026amp; event action:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar SectionView = Backbone.View.extend({\n tagName: \"li\",\n template: _.template($(\"#section-template\").html()),\n initialize: function() {\n },\n render: function() {\n this.$el.html(this.template(this.model.toJSON()));\n return this;\n }\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMake Application:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar AppView = Backbone.View.extend({\n el: $(\"#sectionboard\"),\n events: {\n \"keypress #new-height\": \"createOnEnter\"\n },\n initialize: function() {\n this.input = this.$(\"#new-height\");\n this.main = $(\"#main\");\n Sections.fetch();\n },\n createOnEnter: function(e) {\n if (e.keyCode != 13) return;\n if (!this.input.val()) return;\n Sections.create({height: this.input.val(), color: '#FFFFFF'});\n this.input.val(\"\");\n\n console.log(Sections);\n\n var view = new SectionView({model: Sections});\n this.$(\"#section-list\").append(view.render().el);\n\n }\n});\nvar App = new AppView;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"35470619","answer_count":"1","comment_count":"1","creation_date":"2016-02-18 00:18:59.14 UTC","last_activity_date":"2016-02-18 04:06:21.833 UTC","last_edit_date":"2016-02-18 04:06:21.833 UTC","last_editor_display_name":"","last_editor_user_id":"2333214","owner_display_name":"","owner_user_id":"5919983","post_type_id":"1","score":"1","tags":"javascript|jquery|html|backbone.js","view_count":"371"} +{"id":"43551974","title":"Java How to access JSON inner child array","body":"\u003cp\u003eI have a JSON that has a similar structure to the one below (end of post). I'm trying to read it from a file and then extract some information. I'd like to get the \"times\" child and do something with it. I've tried using json.simple and some of the jackson stuff but I keep getting casting/type errors. I'm pretty stuck :/\u003c/p\u003e\n\n\u003cp\u003eFirst I read in the file and it seems to be correctly captured:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eJSONParser parser = new JSONParser();\nJSONObject data = (JSONObject) parser.parse(new FileReader(\"test.json\"));\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI then tried following this: \u003ca href=\"https://stackoverflow.com/questions/24116275/java-jsonobject-get-children\"\u003eJava JSONObject get children\u003c/a\u003e\nbut get errors \u003ccode\u003eorg.json.simple.JSONArray cannot be cast to org.json.simple.JSONObject\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eWhat I want (think is what I want?) to do is something along the lines create a JSON of the times, and then from there I can make a list of the times/do various operations with them. Or maybe the best approach is to use an ObjectMapper and map it to a matching object?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n \"id\": \"ca1b57be-6c38-4976-9050-f9a95a05a38d\",\n \"name\": \"some name\",\n \"results\": [\n {\n \"name\": \"https://st-dev.aexp.com/smart-test/v1/test/test\",\n \"tests\": {\n \"name\": \"Body matches string\",\n \"status\": \"pass\",\n \"Response time is less than 200ms\": true\n },\n \"testPassFailCounts\": {\n \"Body matches string\": {\n \"pass\": 100,\n \"fail\": 0\n },\n \"Response time is less than 200ms\": {\n \"pass\": 100,\n \"fail\": 0\n }\n },\n \"times\": [\n \"48\",\n \"25\",\n \"25\",\n \"28\",\n \"24\",\n \"24\",\n \"35\",\n \"29\",\n \"41\",\n \"28\",\n \"28\",\n \"24\",\n \"31\",\n \"28\",\n \"25\",\n \"27\",\n \"23\",\n \"28\",\n \"44\",\n \"29\",\n \"25\",\n \"23\",\n \"44\",\n \"28\",\n \"22\"\n ]\n }\n ] \n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks much for any help!\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2017-04-21 21:03:03.053 UTC","last_activity_date":"2017-04-22 00:54:17.407 UTC","last_edit_date":"2017-05-23 12:02:27.713 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"3448228","post_type_id":"1","score":"2","tags":"java|json|jackson","view_count":"468"} +{"id":"4833080","title":"Trying to compile simple c++ program in make","body":"\u003cp\u003eI am having trouble with make. I installed all of the features that come with cygwin. When I type in \u003ccode\u003emake\u003c/code\u003e command it says: \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003emake:***No targets specified and no\n makefile found. Stop.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eThis is really annoying as it's a very simple program. \nMy make file (Makefile):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e# This is a sample file.\n\nall: lab1\n\nlab1: lab1.o\n g++ -Wall lab1.o -o lab1\n\nlab1.o: lab1.cpp\n g++ -Wall -c lab1.cpp -o lab1.o\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003emy program (lab1.cpp):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e// This is a sample file written.\n\n#include \u0026lt;iostream\u0026gt;\n\nusing namespace std;\n\nint main() {\n cout \u0026lt;\u0026lt; \"Welcome to CS-240!\" \u0026lt;\u0026lt; endl;\n return 0;\n }\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"4833160","answer_count":"1","comment_count":"16","creation_date":"2011-01-28 21:09:00.437 UTC","last_activity_date":"2016-06-01 14:58:32.15 UTC","last_edit_date":"2016-06-01 14:58:32.15 UTC","last_editor_display_name":"","last_editor_user_id":"3865653","owner_display_name":"","owner_user_id":"593301","post_type_id":"1","score":"0","tags":"c++|windows|makefile|cygwin","view_count":"719"} +{"id":"46734898","title":"iOS: in Swift3, in my collectionView, when I scroll downstair, the collectionView comes automatically at the top. How to stop it?","body":"\u003cp\u003eI would like my collectionView to stop in the cell. The problem is that when I scroll downstair, if I release it, it comes automatically at the first position...\u003c/p\u003e\n\n\u003cp\u003eI tried with \u003cstrong\u003ecollection.alwaysBounceVertical = true\u003c/strong\u003e without success... \u003c/p\u003e\n\n\u003cp\u003eHere is my code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eoverride func viewDidLoad() {\n super.viewDidLoad()\n\n let layout = OrganiserLayout()\n let frameCollection = CGRect(x: self.view.frame.origin.x, y: self.view.frame.origin.y, width: self.view.frame.width, height: self.view.frame.height + 1000)\n\n let collection = UICollectionView(frame: frameCollection, collectionViewLayout: layout)\n collection.delegate = self\n collection.dataSource = self\n collection.backgroundColor = UIColor.white\n collection.register(OrganiserCollectionViewCell.self, forCellWithReuseIdentifier: \"cell\")\n self.view.addSubview(collection)\n collection.alwaysBounceVertical = true\n collection.alwaysBounceHorizontal = true\n collection.bounces = true\n collection.isPagingEnabled = false\n collection.isScrollEnabled = true\n}\n func numberOfSections(in collectionView: UICollectionView) -\u0026gt; Int {\n return 15\n }\n\n func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -\u0026gt; Int {\n switch section {\n case 0:\n return 40\n }\n }\n\nclass OrganiserLayout:UICollectionViewLayout {\n\n let cellWidth:CGFloat = 100\n var attrDict = Dictionary\u0026lt;IndexPath,UICollectionViewLayoutAttributes\u0026gt;()\n var contentSize = CGSize.zero\n\n override var collectionViewContentSize : CGSize {\n return self.contentSize\n }\n\n override func prepare() {\n // Generate the attributes for each cell based on the size of the collection view and our chosen cell width\n if let cv = collectionView {\n let collectionViewHeight = cv.frame.height\n let numberOfSections = cv.numberOfSections\n self.contentSize = cv.frame.size\n self.contentSize.width = cellWidth*CGFloat(numberOfSections)\n for section in 0...numberOfSections-1 {\n let numberOfItemsInSection = cv.numberOfItems(inSection: section)\n let itemHeight = collectionViewHeight/CGFloat(numberOfItemsInSection)\n let itemXPos = cellWidth*CGFloat(section)\n for item in 0...numberOfItemsInSection-1 {\n let indexPath = IndexPath(item: item, section: section)\n let itemYPos = itemHeight*CGFloat(item)\n let attr = UICollectionViewLayoutAttributes(forCellWith: indexPath)\n attr.frame = CGRect(x: itemXPos, y: itemYPos, width: cellWidth, height: itemHeight)\n attrDict[indexPath] = attr\n }\n }\n }\n }\n\n override func layoutAttributesForElements(in rect: CGRect) -\u0026gt; [UICollectionViewLayoutAttributes]? {\n // Here we return the layout attributes for cells in the current rectangle\n var attributesInRect = [UICollectionViewLayoutAttributes]()\n for cellAttributes in attrDict.values {\n if rect.intersects(cellAttributes.frame) {\n attributesInRect.append(cellAttributes)\n }\n }\n return attributesInRect\n }\n\n override func layoutAttributesForItem(at indexPath: IndexPath) -\u0026gt; UICollectionViewLayoutAttributes? {\n // Here we return one attribute object for the specified indexPath\n return attrDict[indexPath]!\n }\n\n\n}\n\nclass OrganiserCollectionViewCell:UICollectionViewCell {\n\n var label:UILabel!\n var seperator:UIView!\n\n override init(frame: CGRect) {\n super.init(frame: frame)\n\n label = UILabel()\n label.translatesAutoresizingMaskIntoConstraints = false\n self.addSubview(label)\n\n seperator = UIView()\n seperator.backgroundColor = UIColor.black\n seperator.translatesAutoresizingMaskIntoConstraints = false\n self.addSubview(seperator)\n\n let views:[String:UIView] = [\n \"label\":label,\n \"sep\":seperator\n ]\n\n let cons = [\n \"V:|-20-[label]\",\n \"V:[sep(1)]|\",\n \"H:|[label]|\",\n \"H:|[sep]|\"\n ]\n\n for con in cons {\n self.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: con, options: [], metrics: nil, views: views))\n } \n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI need that because I need the user stops on the cell, and click on it. With that problem, he cannot click on the cells that are downstairs.\u003c/p\u003e\n\n\u003cp\u003eThanks in advance.\u003c/p\u003e","accepted_answer_id":"46737743","answer_count":"1","comment_count":"0","creation_date":"2017-10-13 17:12:27.99 UTC","last_activity_date":"2017-10-13 20:44:15.397 UTC","last_edit_date":"2017-10-13 18:14:54.62 UTC","last_editor_display_name":"","last_editor_user_id":"1226963","owner_display_name":"","owner_user_id":"3581620","post_type_id":"1","score":"0","tags":"ios|swift|uicollectionview","view_count":"29"} +{"id":"497389","title":"What's the best way to show multiple checkboxes for multiple records in ASP.NET","body":"\u003cp\u003eThe situation is as follows:\u003c/p\u003e\n\n\u003cp\u003eI have a database with many RSS Categories, that in turn have many RSS Feeds. I want to display them in the following fashion:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eRSS Category 1\n [ ] Rss Feed 1\n [ ] Rss Feed 2\n [ ] Rss Feed 3\n\nRSS Category 2\n [ ] Rss Feed 1\n [ ] Rss Feed 2\n [ ] Rss Feed 3\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhere [ ] represents a checkbox. \u003c/p\u003e\n\n\u003cp\u003eSo each RSS Feed is pulled out of the database depending on the id of the parent RSS category. I cannot use CheckBoxList as each checkbox must be contained inside an unordered list list item. I need the markup to be semantically correct and cant use the Control Adapters.\u003c/p\u003e\n\n\u003cp\u003eI initially imagined two nested repeaters, the outside one databound to a list of RSS Categories from the database which displays the Category header and contains a hidden control with the Category ID, then an inner Repeater with the RSS Feeds for that category.\u003c/p\u003e\n\n\u003cp\u003eHow do I access the Category id from the hidden field control in the parent repeater so I can look up the correct RSS Feeds?\u003c/p\u003e","answer_count":"4","comment_count":"0","creation_date":"2009-01-30 21:48:51.453 UTC","last_activity_date":"2009-02-01 03:42:34.907 UTC","last_editor_display_name":"","owner_display_name":"Jay","post_type_id":"1","score":"1","tags":"asp.net|checkbox|repeater","view_count":"2442"} +{"id":"27820790","title":"Is it possible to specify a database and schema within a linqtosql query?","body":"\u003cp\u003eI am using linqtosql to query a database directly (not as am ORM).\u003c/p\u003e\n\n\u003cp\u003eI have the following code which works:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar events = \n from e in Events\n select e.EventID;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat I would like to do is expand it to join to a second table within a different database / schema on the same SQL instance. For example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar events = \n from e in Events\n join p in database2.dbo.People on p.PersonID equals e.PersonID \n select e.EventID;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow would I go about specifying the database / schema within the linq query?\u003c/p\u003e","accepted_answer_id":"27828109","answer_count":"1","comment_count":"0","creation_date":"2015-01-07 13:40:19.637 UTC","last_activity_date":"2015-01-07 20:31:16.163 UTC","last_edit_date":"2015-01-07 13:47:43.693 UTC","last_editor_display_name":"","last_editor_user_id":"1105627","owner_display_name":"","owner_user_id":"1105627","post_type_id":"1","score":"3","tags":"c#|linq-to-sql","view_count":"23"} +{"id":"10083788","title":"Play sound file when image is clicked","body":"\u003cp\u003eI am not a native \u003ccode\u003eHTML\u003c/code\u003e programmer, so please don't jump all over me about this simple question.\u003c/p\u003e\n\n\u003cp\u003eI have an image that, I am displaying using the following code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;img name=\"track1\" src=\"images/track1.png\" width=\"180\" height=\"180\" border=\"0\" id=\"track1\" alt=\"\" /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want a sound file to be played when that image is clicked. I can make the image a button, but that is messing up the layout of the page for some reason.\u003c/p\u003e\n\n\u003cp\u003eI am okay with using any player, but the only thing is that I do not want to display an intrusive player. I just want the user to press the image and hear the music. If he presses another image, the current music needs to stop playing, and a different sound must be played. \u003c/p\u003e\n\n\u003cp\u003ePlease help! Thanks!\u003c/p\u003e","accepted_answer_id":"10084547","answer_count":"3","comment_count":"2","creation_date":"2012-04-10 05:56:56.27 UTC","favorite_count":"2","last_activity_date":"2016-12-06 16:53:58.35 UTC","last_edit_date":"2012-04-10 06:37:35.983 UTC","last_editor_display_name":"","last_editor_user_id":"744680","owner_display_name":"","owner_user_id":"901421","post_type_id":"1","score":"7","tags":"javascript|html|music|background-music","view_count":"26962"} +{"id":"495776","title":"Should I use java.text.MessageFormat for localised messages without placeholders?","body":"\u003cp\u003eWe are localising the user-interface text for a web application that runs on Java 5, and have a dilemma about how we output messages that are defined in properties files - the kind used by \u003ca href=\"http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html\" rel=\"noreferrer\"\u003ejava.util.Properties\u003c/a\u003e.\u003c/p\u003e\n\n\u003cp\u003eSome messages include a placeholder that will be filled using \u003ca href=\"http://java.sun.com/j2se/1.5.0/docs/api/java/text/MessageFormat.html\" rel=\"noreferrer\"\u003ejava.text.MessageFormat\u003c/a\u003e. For example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esearch.summary = Your search for {0} found {1} items.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMessageFormat is annoying, because a single quote is a special character, despite being common in English text. You have to type two for a literal single quote:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ewarning.item = This item''s {0} is not valid.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, three-quarters of the application's 1000 or so messages do not include a placeholder. This means that we can output them directly, avoiding MessageFormat, and leave the single quotes alone:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ehelp.url = The web page's URL\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eQuestion:\u003c/strong\u003e should we use MessageFormat for all messages, for consistent syntax, or avoid MessageFormat where we can, so most messages do not need escaping?\u003c/p\u003e\n\n\u003cp\u003eThere are clearly pros and cons either way.\u003c/p\u003e\n\n\u003cp\u003eNote that the API documentation for MessageFormat acknowledges the problem and suggests a non-solution:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eThe rules for using quotes within\n message format patterns unfortunately\n have shown to be somewhat confusing.\n In particular, it isn't always obvious\n to localizers whether single quotes\n need to be doubled or not. Make sure\n to inform localizers about the rules,\n and tell them (for example, by using\n comments in resource bundle source\n files) which strings will be processed\n by MessageFormat.\u003c/p\u003e\n\u003c/blockquote\u003e","accepted_answer_id":"495829","answer_count":"5","comment_count":"0","creation_date":"2009-01-30 14:56:41.49 UTC","favorite_count":"2","last_activity_date":"2009-04-03 10:11:04.85 UTC","last_editor_display_name":"","owner_display_name":"Peter Hilton","owner_user_id":"2670","post_type_id":"1","score":"11","tags":"java|localization|messageformat","view_count":"5591"} +{"id":"40088585","title":"Turn off error bars in Seaborn Bar Plot","body":"\u003cp\u003eI'm using GridSpec in matplotlib to create a page that has 9 subplots. One of the subplots is a Seaborn bar plot created with the following code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport seaborn as sns\nsns.barplot(x=df['Time'], y=df['Volume_Count'], ax=ax7)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs there a way to turn off the vertical error bars of the bar plot? If not, is it possible to reduce the horizontal width of the bars?\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","accepted_answer_id":"40090469","answer_count":"1","comment_count":"0","creation_date":"2016-10-17 14:06:28.973 UTC","favorite_count":"1","last_activity_date":"2017-06-14 07:39:55.93 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5179643","post_type_id":"1","score":"4","tags":"python|matplotlib|seaborn","view_count":"1370"} +{"id":"19401201","title":"Designing URIs for RESTful Web Services","body":"\u003cp\u003e\u003ca href=\"http://www.filesspecialtours.com/ER.png\" rel=\"nofollow\"\u003ehttp://www.filesspecialtours.com/ER.png\u003c/a\u003e\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003eTo get \"agrupaciones\" I do:\u003c/p\u003e\n\n\u003cp\u003eGET /agrupaciones/\u003c/p\u003e\n\n\u003cp\u003eTo get \"asociados\" I do:\u003c/p\u003e\n\n\u003cp\u003eGET /agrupaciones/asociados/\u003c/p\u003e\n\n\u003cp\u003eHow to do to obtains the result of cross two resources?\u003c/p\u003e\n\n\u003cp\u003eagrupaciones.\u003cem\u003e, asociados.\u003c/em\u003e\u003c/p\u003e\n\n\u003cp\u003eAny common method for to do it?\u003c/p\u003e","accepted_answer_id":"19404505","answer_count":"1","comment_count":"2","creation_date":"2013-10-16 10:35:18.513 UTC","last_activity_date":"2013-10-16 13:16:25.867 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1762270","post_type_id":"1","score":"0","tags":"api|rest|restful-url","view_count":"56"} +{"id":"38807485","title":"Swift push notification received but not popped up","body":"\u003cp\u003eI've added to my app the remote notification feature, I can receive push notifications, but when I receive it, there is no automatic popup displayed.\u003c/p\u003e\n\n\u003cp\u003ehere it my AppDelegate code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunc application( application: UIApplication,\n didReceiveRemoteNotification userInfo: [NSObject : AnyObject]) {\n print(\"Notification received: \\(userInfo)\")\n GCMService.sharedInstance().appDidReceiveMessage(userInfo);\n // Handle the received message\n NSNotificationCenter.defaultCenter().postNotificationName(messageKey, object: nil,userInfo: userInfo)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003emy app is correctly connected to GCM Server, and I receive the following logs while receiving a notification:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eNotification received: [collapse_key: do_not_collapse, from: 22334444232]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eon the server side, I'm sending a basic Payload such as:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{{\"aps\":{\"alert\":\"Hello world!\",\"badge\":0, \"sound\": \"default\"}, \"to\":\"MY_TOKEN_KEY\", }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eany idea why my app is not treating automatically the notification received ?\u003c/p\u003e\n\n\u003cp\u003eEDIT1:\u003c/p\u003e\n\n\u003cp\u003eI also tried to change the message payload to match Google's GCM tutorial for IOS:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ehttps://gcm-http.googleapis.com/gcm/send\nContent-Type:application/json\nAuthorization:key=AIzaSyZ-1u...0GBYzPu7Udno5aA\n\n{\n \"to\" : \"bk3RNwTe3H0:CI2k_HHwgIpoDKCIZvvDMExUdFQ3P1...\",\n \"notification\" : {\n \"body\" : \"Hello world\",\n\"title\" : \"alert data\"\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e}\u003c/p\u003e\n\n\u003cp\u003ebut still just getting didReceiveRemoteNotification function called with the following logs:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eNotification received : [aps: {\nalert = {\n body = \"Hello world\";\n title = \"alert data\";\n};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e}, gcm.message_id: 0:1470516999022408%f1xxxxxx....]\u003c/p\u003e","answer_count":"0","comment_count":"6","creation_date":"2016-08-06 18:26:44.027 UTC","last_activity_date":"2016-08-06 21:16:21.64 UTC","last_edit_date":"2016-08-06 21:16:21.64 UTC","last_editor_display_name":"","last_editor_user_id":"3529526","owner_display_name":"","owner_user_id":"3529526","post_type_id":"1","score":"1","tags":"ios|notifications|google-cloud-messaging","view_count":"425"} +{"id":"43025925","title":"datatable fnfilterclear return cannot read property","body":"\u003cp\u003eI'm right now working with jquery datatable + fnfilter by toggle button .\u003c/p\u003e\n\n\u003cp\u003emy datatable :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;table class=\"table table-bordered table-dataTable display nowrap\" id=\"mytable\" cellspacing=\"0\" width=\"100%\"\u0026gt;\n \u0026lt;thead\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;th\u0026gt;First Name\u0026lt;/th\u0026gt;\n \u0026lt;th\u0026gt;Last Name\u0026lt;/th\u0026gt;\n \u0026lt;th\u0026gt;Employee Id\u0026lt;/th\u0026gt;\n \u0026lt;th\u0026gt;Contact Number\u0026lt;/th\u0026gt;\n \u0026lt;th\u0026gt;Status\u0026lt;/th\u0026gt;\n \u0026lt;th\u0026gt;Action\u0026lt;/th\u0026gt;\n\n \u0026lt;/tr\u0026gt;\n \u0026lt;/thead\u0026gt;\n \u0026lt;tfoot\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;th\u0026gt;First Name\u0026lt;/th\u0026gt;\n \u0026lt;th\u0026gt;Last Name\u0026lt;/th\u0026gt;\n \u0026lt;th\u0026gt;Employee Id\u0026lt;/th\u0026gt;\n \u0026lt;th\u0026gt;Contact Number\u0026lt;/th\u0026gt;\n \u0026lt;th class=\"status\"\u0026gt;Status\u0026lt;/th\u0026gt;\n \u0026lt;th\u0026gt;Action\u0026lt;/th\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;/tfoot\u0026gt;\n \u0026lt;/table\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003emy toggle button :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;div class=\"btn-group\" data-toggle=\"buttons\"\u0026gt;\n \u0026lt;label class=\"btn btn-primary custom-button-width active btn-filter\" data-id=\"all\"\u0026gt;\n\n \u0026lt;input type=\"radio\" id=\"option1\" autocomplete=\"off\" checked \u0026gt;ALL\n \u0026lt;/label\u0026gt;\n \u0026lt;label class=\"btn btn-primary custom-button-width btn-filter\" data-id=\"new\"\u0026gt;\n \u0026lt;input type=\"radio\" id=\"option2\" autocomplete=\"off\" \u0026gt;NEW\n \u0026lt;/label\u0026gt;\n \u0026lt;label class=\"btn btn-primary custom-button-width btn-filter\" data-id=\"rejected\"\u0026gt;\n \u0026lt;input type=\"radio\" id=\"option3\" autocomplete=\"off\" \u0026gt;REJECTED\n \u0026lt;/label\u0026gt;\n \u0026lt;label class=\"btn btn-primary custom-button-width btn-filter\" data-id=\"approved\"\u0026gt;\n \u0026lt;input type=\"radio\" id=\"option4\" autocomplete=\"off\" \u0026gt;APPROVED\n \u0026lt;/label\u0026gt;\n \u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003emy init file :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e $(document).ready(function ()\n{\nvar oTable = $('#mytable').dataTable({\n\n \"bProcessing\": true,\n \"serverSide\": false,\n \"sAjaxSource\": base_url ,\n \"bJQueryUI\": false,\n \"pageLength\": 2,\n \"bLengthChange\": false,\n \"bFilter\": true,\n \"bInfo\": false,\n \"bAutoWidth\": false,\n \"sPaginationType\": \"full_numbers\",\n \"iDisplayStart \": 20,\n \"fnInitComplete\": function () {\n //oTable.fnAdjustColumnSizing();\n },\n 'fnServerData': function (sSource, aoData, fnCallback) {\n $.ajax\n ({\n 'dataType': 'json',\n 'type': 'GET',\n 'url': sSource,\n 'data': aoData,\n 'success': fnCallback\n });\n },\n \"columns\": [\n { \"data\": \"fname\", 'bSearchable': true },\n { \"data\": \"lname\",'bSearchable': true },\n { \"data\": \"employee_id\" , 'bSearchable': false },\n { \"data\": \"contactno\", \"bSearchable\": true},\n { \"data\": \"status\" , 'bSearchable': true },\n { \"data\": \"action\", 'bSearchable': false },\n ]\n});\n\n\n$('.btn-filter').on('click',function () {\n var mydata = $(this).attr(\"data-id\");\n var oTable = $('#mytable').dataTable();\n\n var tfoot = $('tfoot .status');\n\n oTable.fnFilter(mydata,tfoot.index());\n\n if(mydata == \"rejected\" \u0026amp;\u0026amp; \"new\") {\n $('.approved').hide();\n }\n\n if(mydata == \"all\" ) {\n oTable.fnFilterClear();\n $('.approved').hide();\n }\n\n if(mydata == \"approved\") {\n $('.approved').show();\n }\n\n\n} )});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eit will return an error when i select \"ALL\"\u003c/p\u003e\n\n\u003cp\u003eUncaught TypeError: Cannot read property 'oPreviousSearch' of null\n at n.fn.init.jQuery.fn.dataTableExt.oApi.fnFilterClear (fnFilterClear.js:41)\u003c/p\u003e\n\n\u003cp\u003eHow to fix it?\u003c/p\u003e\n\n\u003cp\u003ethank you \u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-03-26 06:48:15.25 UTC","last_activity_date":"2017-03-26 06:48:15.25 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5301297","post_type_id":"1","score":"0","tags":"jquery|laravel|datatables","view_count":"56"} +{"id":"21638618","title":"How should I configure the Oracle HTTP server to handle PL/SQL page requests?","body":"\u003cp\u003eI am wanting to build an Oracle OFM development environment on Windows 7 (64-bit) to migrate over an existing java/struts and PL/SQL application from OAS10G. So far I have installed the Oracle Database product (), Java 7, and WebLogic Server (10.3.6 = wls1036_generic).\u003c/p\u003e\n\n\u003cp\u003eHave I installed everything I need as far as OFM is concerned? I can't see how to configure the oracle http server to handle PL/SQL page requests. I spotted on post that said this can be done through the Oracle Fusion Middleware Control - which should be found at my-domain:7001/em, but that tool doesn't seem to be found. I only seem to have the WebLogic Server Console (my-domain:7001/console) which has lots of tabs and options but I don't see anything that lets me configure the ohs (Oracle Http Server). Does the Oracle Http Server (ohs) even get installed as part of the WebLogic installation?\u003c/p\u003e\n\n\u003cp\u003eThanks for any help. Oracle product installations confuse me.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-02-07 22:04:00.627 UTC","last_activity_date":"2014-02-08 15:47:51.937 UTC","last_edit_date":"2014-02-08 00:20:35.573 UTC","last_editor_display_name":"","last_editor_user_id":"811","owner_display_name":"","owner_user_id":"3285653","post_type_id":"1","score":"1","tags":"oracle|plsql|weblogic","view_count":"991"} +{"id":"30959124","title":"Cannot exclude pk and model from serializer in django 1.8","body":"\u003cp\u003eI'm trying to get rid of \u003ccode\u003epk\u003c/code\u003e and \u003ccode\u003emodel\u003c/code\u003e from the output json object as part of Django serialization. I tried the below code in views.py, but it threw the below error\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eTypeError: serialize() takes 2 positional arguments but 3 were given.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eTo solve this, I used \u003ccode\u003e@staticmethod\u003c/code\u003e as well, but no much use.\u003c/p\u003e\n\n\u003cp\u003eHere is the \u003cstrong\u003eviews.py\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef get_stats(request):\n if request.method == \"POST\":\n srch_dropV = request.POST['srch_dropAJ']\n else:\n srch_dropV = ''\n if(srch_dropV == 'Lock'):\n stud = LockBased.objects.all()\n response_data = {}\n response_data['result'] = 'Success'\n serializer = NewSerializer()\n response_data['message'] = serializer.serialize('json', stud)\n return HttpResponse(JsonResponse(response_data), content_type=\"application/json\")\n\n\nfrom django.core.serializers.json import Serializer, DjangoJSONEncoder\nimport json\n\nclass NewSerializer(Serializer):\n def end_serialization(self):\n cleaned_objects = []\n\n for obj in self.objects:\n del obj['pk']\n del obj['model'] \n cleaned_objects.append(obj)\n\n json.dump(cleaned_objects, self.stream, cls=DjangoJSONEncoder, **self.options)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ePlease help me to identify the issue and fix it.\u003cbr\u003e\nI'm using Django 1.8 and Python 3.4.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-06-20 21:33:53.053 UTC","last_activity_date":"2015-06-20 22:04:47.93 UTC","last_edit_date":"2015-06-20 21:52:14.49 UTC","last_editor_display_name":"","last_editor_user_id":"779412","owner_display_name":"","owner_user_id":"5031965","post_type_id":"1","score":"0","tags":"python|django|python-3.x|django-views","view_count":"144"} +{"id":"5972274","title":"Namespace problem in Struts2 when using Apache Tiles","body":"\u003cp\u003eI have a simple problem when I come to Struts2. I use tiles plugin in my Struts2 project. As all of us know, tiles are used for making templates. We can give namespace for our package in struts.xml, the configuration file :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;package name=\"demo\" namespace=\"/menu\" extends=\"default\"\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand I gave namespace attribute to one of my link\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;s:url action=\"hello\" namespace=\"menu\" /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAll of these worked out well, still I could see my pages, but this time, when I add the above namespace to package definition in \u003ccode\u003estruts.xml\u003c/code\u003e and \u003ccode\u003es:url\u003c/code\u003e, I lost my tiles definition. I lost my tiles template, styles(css) and settings. But without using this namespace, I can access my pages with tiles.\u003c/p\u003e\n\n\u003cp\u003ePlease help me, where did i go wrong? Thanks in advance.\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2011-05-12 01:04:02.007 UTC","last_activity_date":"2012-01-02 12:33:49.933 UTC","last_edit_date":"2011-06-20 09:31:31.157 UTC","last_editor_display_name":"","last_editor_user_id":"715437","owner_display_name":"","owner_user_id":"735339","post_type_id":"1","score":"2","tags":"java|namespaces|struts2|tiles2|apache-tiles","view_count":"1050"} +{"id":"599863","title":"How can I create 1 route with 2 differents user's access in ASP.NET MVC?","body":"\u003cp\u003eHow can I do this: I have on page named \"Schedule\" and it can be accessed through 2 differente ways:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eURL 1- www.bla.com/Admin/Schedule\nURL 2- www.bla.com/Schedule\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\"URL 1\" will be accessed by users with Admin previlegies and this View will show some Admin stuff, and users must be LoggedOn.\u003c/p\u003e\n\n\u003cp\u003eIn the otherhand, \"URL 2\" will be accessed by users NOT LoggedOn and it will NOT show the admin stuff.\u003c/p\u003e\n\n\u003cp\u003eBut, they are the same page, just with some differences depending on user's access. \u003c/p\u003e\n\n\u003cp\u003eI already have AdminController and I intend to put this \"Schedule\" View as part of this controller. As result, I know if I type \"URL 1\" it will work. But, if I type \"URL 2\"? Will I have to create a \"ScheduleController\" just to handle this?\u003c/p\u003e\n\n\u003cp\u003eI wonder if there is a way to resolve this by Global.asax, configuring the routing... I don't know...\u003c/p\u003e\n\n\u003cp\u003eThanks!!!\u003c/p\u003e","accepted_answer_id":"599905","answer_count":"3","comment_count":"0","creation_date":"2009-03-01 14:01:12.813 UTC","favorite_count":"2","last_activity_date":"2009-03-01 14:30:41.573 UTC","last_editor_display_name":"","owner_display_name":"AndreMiranda","owner_user_id":"60286","post_type_id":"1","score":"1","tags":"asp.net-mvc|routing","view_count":"160"} +{"id":"16707364","title":"fwrite and hiding symbols","body":"\u003cp\u003eI have an application that is used to edit .txt files. It opens the selected file, writes to a file and closes the file. Each file that has to be edited has special characters \ne.g. [, ', =, _, ;.`\n that do not have to be edited so they will not be displayed on the web page when file is opened. Between those special characters text exists thats the part that will be edited.What i want to achieve is when the file is opened the special charterer will be hidden and the letters in the file only be displayed and here is the twist what i am trying to achieve is when the file is saved the special charterers will be still in the file with the edited text in there original place. Everything in the file looks like this \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e['text'] = ['some_,more_text']\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCurrently i am playing around with \u003ccode\u003eexplode();\u003c/code\u003e function and \u003ccode\u003estr_replace()\u003c/code\u003e function\nbut so far i am only able to remove the special charterers and when the file is saved the characters do not save with the text they are removed.\u003c/p\u003e\n\n\u003cp\u003eIs there some function or a method that i massed that can achieve the results i am aiming for any replays are greatly appreciated\u003c/p\u003e\n\n\u003cp\u003eI am still going over the php manual but cant find anything close to what i need appart from \u003ccode\u003eexplode()\u003c/code\u003e and \u003ccode\u003estr_replace().\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003ehere is my code i use this to open my file:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$fileHandle = fopen($relPath, 'r') or die(\"Failed to open file $relPath go and make me a sandwich! \");\n\necho '\u0026lt;form action=\"updatefile.php\" method=\"post\"\u0026gt;';\n\nwhile(!feof($fileHandle))\n {\n $line = fgets($fileHandle);\n $lineArr = explode('=', $line);\n\n if (count($lineArr) !=2){\n\n continue;\n }\n $part1 = trim($lineArr[0]);\n $part2 = trim($lineArr[1]);\n\n //$simbols = array(\"$\", \"[\", \"]\", \"'\", \";\");\n\n //echo \"\u0026lt;pre\u0026gt;$part1 $part2\u0026lt;/pre\u0026gt;\";\n\n echo '\u0026lt;pre\u0026gt;\u0026lt;input type=\"text\" name=\"content_prt1[]\" size=\"50\" value=\"' .str_replace($simbols, \"\",$part1).'\"\u0026gt; \u0026lt;input type=\"text\" name=\"content_prt2[]\" size=\"50\" value=\"' .str_replace($simbols, \"\",$part2).'\"\u0026gt;\u0026lt;/pre\u0026gt;';\n }\n echo '\u0026lt;input type=\"submit\" value=\"Submit\" name=\"submit1\"\u0026gt;';\n echo '\u0026lt;form /\u0026gt;';\n\n fclose($fileHandle) or die (\"Error closing file!\");\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethis is the one that writes to file :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eif(isset($_POST['submit1'])){\n ini_set('auto_detect_line_endings', TRUE);\n\n $file = \"test_file_1.php\";\n\n if(is_file($file))\n {\n $handle = fopen($file, \"w\") or die (\"Error opening file! {$file}\");\n }\n else\n {\n die($file . ' Dose Not Exist!');\n }\n\n $content_prt1 = $_POST['content_prt1'];\n $content_prt2 = $_POST['content_prt2'];\n\n $data = '';\n\n foreach ($content_prt1 as $key =\u0026gt; $value) {\n $data .= $value . \" = \". $content_prt2[$key]. PHP_EOL;\n }\n\n //$file_contents = $_POST[\"content_prt1\" . \"content_prt1\"];\n\n fwrite($handle, $data) or die (\"Error writing to file {$file}!\");\n fclose($handle) or die(\"Error closing file!\");\n\n header( 'Location:../index.php' ) ;\n\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"16707790","answer_count":"1","comment_count":"8","creation_date":"2013-05-23 06:50:46.02 UTC","last_activity_date":"2013-05-23 07:15:03.05 UTC","last_edit_date":"2013-05-23 07:13:58.213 UTC","last_editor_display_name":"","last_editor_user_id":"2362103","owner_display_name":"","owner_user_id":"2362103","post_type_id":"1","score":"1","tags":"php|fwrite|comma|brackets","view_count":"107"} +{"id":"42275029","title":"data mining: subset based on maximum criteria of several observations","body":"\u003cp\u003eConsider the example data\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eZip_Code \u0026lt;- c(1,1,1,2,2,2,3,3,3,3,4,4)\nPolitical_pref \u0026lt;- c('A','A','B','A','B','B','A','A','B','B','A','A')\nincome \u0026lt;- c(60,120,100,90,80,60,100,90,200,200,90,110)\ndf1 \u0026lt;- data.frame(Zip_Code, Political_pref, income)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to \u003ccode\u003egroup_by\u003c/code\u003e each \u003ccode\u003e$Zip_code\u003c/code\u003e and obtain the maximum \u003ccode\u003e$income\u003c/code\u003e based on each \u003ccode\u003e$Political_pref\u003c/code\u003e factor.\u003c/p\u003e\n\n\u003cp\u003eThe desired output is a df which has 8obs of 3 variables. That contains, 2 obs for each \u003ccode\u003e$Zip_code\u003c/code\u003e (an A and B for each) which had the greatest income\u003c/p\u003e\n\n\u003cp\u003eI am playing with \u003ccode\u003edplyr\u003c/code\u003e, but happy for a solution using any package (possibly with \u003ccode\u003edata.table\u003c/code\u003e)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elibrary(dplyr) \ndf2 \u0026lt;- df1 %\u0026gt;%\n group_by(Zip_Code) %\u0026gt;% \n filter(....)\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"42275078","answer_count":"1","comment_count":"3","creation_date":"2017-02-16 13:14:22.863 UTC","last_activity_date":"2017-02-16 15:42:21.79 UTC","last_edit_date":"2017-02-16 15:33:21.763 UTC","last_editor_display_name":"","last_editor_user_id":"1191259","owner_display_name":"","owner_user_id":"5386253","post_type_id":"1","score":"0","tags":"r|subset","view_count":"49"} +{"id":"29361264","title":"hadoop log4j not working","body":"\u003cp\u003eMy jobs are running successfully with Hadoop 2.6.0 but the logger is not working at all\u003c/p\u003e\n\n\u003cp\u003eI always see\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elog4j:WARN No appenders could be found for logger (org.apache.hadoop.mapreduce.v2.app.MRAppMaster).\nlog4j:WARN Please initialize the log4j system properly.\nlog4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eyarn-site.xml has the directory with the log4j.properties file listed. I also tried passing it manually via \u003ccode\u003e-Dlog4j.configuration\u003c/code\u003e option. \u003c/p\u003e\n\n\u003cp\u003ethe file is here: \u003ca href=\"http://www.pastebin.ca/2966941\" rel=\"nofollow noreferrer\"\u003ehttp://www.pastebin.ca/2966941\u003c/a\u003e\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2015-03-31 05:35:09.487 UTC","favorite_count":"1","last_activity_date":"2017-11-08 22:34:37.573 UTC","last_edit_date":"2017-11-08 22:34:37.573 UTC","last_editor_display_name":"","last_editor_user_id":"2308683","owner_display_name":"","owner_user_id":"233484","post_type_id":"1","score":"0","tags":"hadoop|log4j|yarn","view_count":"1250"} +{"id":"34559033","title":"JAX-RS Struts2 REST API","body":"\u003cp\u003eWhy would one like to integrate JAX-RS(Jersey) using Rest API to Struts2? Struts2 is itself a mvc framework, so why would anyone want to integrate these both? If combined, how will the resulting framework be(I wanted to know if REST API just control the controller part of MVC). \u003c/p\u003e","accepted_answer_id":"34561468","answer_count":"2","comment_count":"0","creation_date":"2016-01-01 18:56:09.663 UTC","last_activity_date":"2016-01-04 09:19:19.817 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5405907","post_type_id":"1","score":"1","tags":"rest|struts2|jersey|jax-rs|struts","view_count":"520"} +{"id":"11846144","title":"hibernate not able to reconnect to the mysql DB","body":"\u003cp\u003eIn my spring-hibernate application, we are using \u003ccode\u003eorg.apache.tomcat.jdbc.pool.DataSource\u003c/code\u003e for connection pooling. When we start the server, we are able to see the connection to the DB is established and after the mysql service is stopped the server starts throwing error saying that the connection is lost. When the mysql service is started again, should we have to restart the server to reestablish the connections to the DB? Cuz even after providing autoReconnect=true parameter, the application is not able to establish connection to the DB.\u003c/p\u003e","accepted_answer_id":"12884474","answer_count":"2","comment_count":"1","creation_date":"2012-08-07 12:35:54.44 UTC","last_activity_date":"2012-10-28 19:31:02.58 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"934913","post_type_id":"1","score":"2","tags":"java|mysql|spring|hibernate|java-ee","view_count":"754"} +{"id":"16872866","title":"Rest api for yii","body":"\u003cp\u003eI am trying implement REST api in yii by official example, and now I got lot of errors instead of response \u003ca href=\"http://www.taxitaxi.kz/dispatcher/index.php/api/drivers\" rel=\"nofollow\"\u003ehttp://www.taxitaxi.kz/dispatcher/index.php/api/drivers\u003c/a\u003e.\u003c/p\u003e\n\n\u003cp\u003eCan someone clearify me what is the issue?\u003c/p\u003e","accepted_answer_id":"16877145","answer_count":"1","comment_count":"4","creation_date":"2013-06-01 12:46:34.543 UTC","last_activity_date":"2013-08-22 01:05:29.6 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2440685","post_type_id":"1","score":"1","tags":"rest|yii","view_count":"3581"} +{"id":"35856290","title":"Do I need to make any special flask-sslify settings for HTTP Strict Transport?","body":"\u003cp\u003eI am using Flask as my web/app server. I am attempting to SSLify my Flask app to have the best security for HSTS. From some other Stackoverflow comments, I see it is probably best to set SSLify(app, permanent=True) to give 301 response. Do I need to set an age limit, or make any other non-default setting? I am assuming my response header is set with SSLify, or do I need to add the Strict-Transport-Security: max-age, etc to the response header, or does SSLify do this for my Flask App. \u003c/p\u003e\n\n\u003cp\u003eRef:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://github.com/kennethreitz/flask-sslify/blob/master/README.rst\" rel=\"nofollow\"\u003ehttps://github.com/kennethreitz/flask-sslify/blob/master/README.rst\u003c/a\u003e\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2016-03-07 23:36:54.107 UTC","last_activity_date":"2016-03-08 19:45:09.74 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1480918","post_type_id":"1","score":"0","tags":"python-2.7|heroku|flask|hsts","view_count":"240"} +{"id":"41017590","title":"tkinter frame display basics","body":"\u003cp\u003eI am trying to create an application (well my very first) in Python/tkinter which ultimatively should run on a Raspberry Pi with a a small touchscreen display (480x320px) attached to it. The screen is divided into a mainframe and a frame which (later on) will contain 6 function keys (buttons)\u003c/p\u003e\n\n\u003cp\u003eSo I started with below code, hoping/expecting that somehow I will get the main application window divided into two frames, one being grey, one being black ... but all I see (on my PC) is the MainApp window in correct size, not resizeable, with correct title (so far so good!) and a yellow background ... it seems the frames I defined inside MainApp are not displayed, even thoough there are Labels inside, they are sticky, they have a weight (and I can't remember what else I tried and where else I searched)\u003c/p\u003e\n\n\u003cp\u003eWhat am I overlooking here please?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#!/usr/bin/python3\nimport tkinter as tk\n#\n# main application\n#\nclass MainApp(tk.Frame):\n def __init__(self, parent):\n tk.Frame.__init__(self, parent)\n self.parent = parent\n self.parent.title(\"My first GUI\")\n self.parent.geometry(\"480x320\")\n self.parent.resizable(width=False, height=False)\n self.parent.config(bg=\"yellow\")\n\n mainframe = tk.Frame(self, bg=\"grey\", width=480, height=280 )\n mainframe.grid(column=0, row=0, sticky=\"WENS\")\n tk.Label(mainframe, text=\"co-cooo\").grid(column=0, row=0, sticky=\"WENS\")\n\n fkeyframe = tk.Frame(self, bg=\"black\", width=480, height=40)\n fkeyframe.grid(column=0, row=1, sticky=\"WENS\")\n tk.Label(fkeyframe, text=\"fo-fooo\").grid(column=0, row=0, sticky=\"WENS\")\n\n self.rowconfigure(0, weight=1, minsize=280)\n self.rowconfigure(1, weight=1, minsize=40)\n#\n# define root element and start application\n#\ndef main():\n root = tk.Tk()\n app = MainApp(root)\n root.mainloop() \n\n#\n# start if called from command line\n#\nif __name__ == '__main__':\n main()\n\n# 0,0 MainApp (yellow) 480,0\n# +---------------------------------+\n# | mainframe (grey, h=280) |\n# |+-------------------------------+|\n# || ||\n# || ||\n# || ||\n# |+-------------------------------+|\n# | fkeyframe (black, h=40) |\n# |+-------------------------------+|\n# ||+----+----+----+----+----+----+||\n# ||| Bt | Bt | Bt | Bt | Bt | Bt |||\n# ||+----+----+----+----+----+----+||\n# |+-------------------------------+|\n# +---------------------------------+\n# 320,0 320,480\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"41017682","answer_count":"2","comment_count":"0","creation_date":"2016-12-07 12:32:43.75 UTC","favorite_count":"1","last_activity_date":"2016-12-07 13:39:48.903 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"185547","post_type_id":"1","score":"1","tags":"python|tkinter","view_count":"183"} +{"id":"38089178","title":"Is it possible to attach to a remote gdb target with vscode?","body":"\u003cp\u003eI'm trying to setup the configuration to attach to a remote C/C++ gdb target running gdbserver with visual studio code. Is this currently supported? If so, how do I get around these limitations:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003e\u003cp\u003eThe address and port options indicate that they aren't supported for C/C++.\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eI can force code to use the special remote enabled version of gdb, but its trying to run the target application locally and not connecting to the target gdbserver platform.\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eWill PowerPC remote targets be supported assuming I can solve #1 and #2?\u003c/p\u003e\u003c/li\u003e\n\u003c/ol\u003e","answer_count":"0","comment_count":"0","creation_date":"2016-06-29 02:08:04.6 UTC","last_activity_date":"2016-06-29 02:08:04.6 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6526126","post_type_id":"1","score":"2","tags":"gdb|visual-studio-code","view_count":"366"} +{"id":"15601598","title":"how to insert and replace a list of words in another list or a string in python","body":"\u003cp\u003eI am trying to replace a string with the word \u003ccode\u003e[NOUN]\u003c/code\u003e on it. I'm clueless!\u003c/p\u003e\n\n\u003cp\u003eHere's my code below - which returns lots of errors - the variable story is a string and listOfNouns is a list - so I try and convert the string into a list by splitting it.:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef replacement(story, listOfNouns): \n length = len(story1)\n story1 = story.split()\n for c in range(0,len(story1)):\n if c in listOfNouns:\n story1[c]= 'NOUN'\n story = ''.join(story) \n return story\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere's the error message that I get below when I call the above function with\u003cbr\u003e\n\u003ccode\u003ereplacement(\"Let's play marbles\", ['marbles'])\u003c/code\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eTraceback (most recent call last):\n File \"\u0026lt;pyshell#189\u0026gt;\", line 1, in \u0026lt;module\u0026gt;\n replacement(\"Let's play marbels\", ['marbels'])\n File \"C:/ProblemSet4/exam.py\", line 3, in replacement\n length = len(story1)\nUnboundLocalError: local variable 'story1' referenced before assignment\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow can I replace the new story1 list with another element from another list?\u003c/p\u003e\n\n\u003cp\u003eHow do I modify the tuples and return the new string - which is supposed to say:\u003cbr\u003e\n\u003ccode\u003eLet's play [NOUN]\u003c/code\u003e???\u003c/p\u003e\n\n\u003cp\u003eCan anyone please help out? I'm lost and i've been trying this for hours using all the knowledge I have in Python/Java to figure this crap out!\u003c/p\u003e","answer_count":"3","comment_count":"0","creation_date":"2013-03-24 17:23:27.777 UTC","last_activity_date":"2013-03-24 21:05:26.493 UTC","last_edit_date":"2013-03-24 17:43:45.747 UTC","last_editor_display_name":"","last_editor_user_id":"235698","owner_display_name":"","owner_user_id":"2150603","post_type_id":"1","score":"0","tags":"python|string|list|split|replace","view_count":"487"} +{"id":"28932078","title":"Ruby Sinatra app not storing session variable correctly","body":"\u003cp\u003eI am following a guide on learning Ruby and Sinatra which had me write the following code for a card game (based off of \u003ca href=\"https://www.youtube.com/watch?v=9V6mCxl7Up4\" rel=\"nofollow\"\u003ePlay Your Cards Right\u003c/a\u003e).\u003c/p\u003e\n\n\u003cp\u003eHere is the code\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eenable :sessions\n\nget '/' do\n session[:deck] = []\n suits = %w[ Hearts Diamonds Clubs Spades ]\n values = %w[ Ace 2 3 4 5 6 7 8 9 10 Jack Queen King ]\n suits.each do |suit|\n values.each do |value|\n session[:deck] \u0026lt;\u0026lt; \"#{value} of #{suit}\"\n end\n end\n session[:deck].shuffle!\n session[:guesses] = -1\n redirect to('/play')\nend\n\nget '/:guess' do\n\n card = session[:deck].pop\n value = case card[0]\n when \"J\" then 11\n when \"Q\" then 12\n when \"K\" then 13\n else card.to_i\n end\n\n if (params[:guess] == 'higher' and value \u0026lt; session[:value]) or (params[:guess] == 'lower' and value \u0026gt; session[:value])\n \"Game Over! The card was the #{card} (value #{value}), and you had #{session[:value]}. You managed to make #{session[:guesses]} correct guess#{'es' unless session[:guesses] == 1}. \u0026lt;a href='/'\u0026gt;Play Again\u0026lt;/a\u0026gt;\"\n else\n session[:guesses] += 1\n session[:value] = value\n \"The card is the #{card} (value of #{value}). Do you think the next card will be \u0026lt;a href='/higher'\u0026gt;Higher\u0026lt;/a\u0026gt; or \u0026lt;a href='/lower'\u0026gt;Lower\u0026lt;/a\u0026gt;?\"\n end\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe game seems to play ok some of the time, however, for some reason, the session variable \u003ccode\u003evalue\u003c/code\u003e seems to be overwritten with a new value before the IF statement executes.\u003c/p\u003e\n\n\u003cp\u003eI have no clue what could be wrong with the above code and why the \u003ccode\u003evalue\u003c/code\u003e session variable is changing to a new value randomly when it shouldn't.\u003c/p\u003e\n\n\u003cp\u003ePlease take a look at my code (or try to run it yourself) and tell me what could be wrong.\u003c/p\u003e\n\n\u003cp\u003eMy \u003ccode\u003econfig.ru\u003c/code\u003e file:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003erequire 'rubygems'\nrequire 'sinatra'\n\nset :environment, ENV['RACK_ENV'].to_sym\ndisable :run, :reload\n\nrequire './play_your_cards_right.rb'\n\nrun Sinatra::Application\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"7","creation_date":"2015-03-08 21:25:25.833 UTC","last_activity_date":"2015-03-10 04:05:02.093 UTC","last_edit_date":"2015-03-10 04:05:02.093 UTC","last_editor_display_name":"","last_editor_user_id":"2047843","owner_display_name":"","owner_user_id":"2047843","post_type_id":"1","score":"0","tags":"ruby|sinatra","view_count":"55"} +{"id":"1135734","title":"It's possible to share a cookie between 'some' subdomains?","body":"\u003cp\u003eI've been reading some posts about web performance, one of the points is to\u003cbr\u003e\nserve static content from a cookie-free domain, my question is:\u003c/p\u003e\n\n\u003cp\u003eCan I share cookies between, let's say example.com and www.example.com, while excluding static1.example.com, static2.example.com, etc?\u003c/p\u003e\n\n\u003cp\u003eOr do I need to set a different top level domain?\u003c/p\u003e\n\n\u003cp\u003eI know (or I think) that I could set the domain of the cookie to '.example.com', but\u003cbr\u003e\ncorrect me if I'm wrong this shares the cookies across \u003cem\u003eall\u003c/em\u003e sub-domains.\u003c/p\u003e","accepted_answer_id":"1135777","answer_count":"3","comment_count":"0","creation_date":"2009-07-16 06:23:51.95 UTC","favorite_count":"6","last_activity_date":"2011-02-23 23:33:38.17 UTC","last_edit_date":"2009-07-16 06:57:45.563 UTC","last_editor_display_name":"","last_editor_user_id":"28169","owner_display_name":"","owner_user_id":"61327","post_type_id":"1","score":"22","tags":"http|cookies","view_count":"14579"} +{"id":"34306941","title":"Set font face and size in Scala TextArea","body":"\u003cp\u003eAn old thread (2009) mentioned the following:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eval area = new TextArea {\n font = new Font(\"Arial\", 0, 8)\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever that code has no effect on current version of \u003ccode\u003escala.swing\u003c/code\u003e . I also tried\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003earea.peer.setFont(new Font(\"Arial\", 0,8).\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThat also had no effect. So what is the correct way?\u003c/p\u003e","accepted_answer_id":"34307048","answer_count":"1","comment_count":"0","creation_date":"2015-12-16 08:17:18.75 UTC","last_activity_date":"2015-12-16 08:24:03.85 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1056563","post_type_id":"1","score":"1","tags":"swing|scala","view_count":"157"} +{"id":"12377119","title":"android tcp client file receive","body":"\u003cp\u003eI am trying to send a file (png to be specific) over sockets from python server to android client. I know that my python server is sending the data, I just can't figure out how to receive the data on the android side. Here is what the code looks like to receive the file.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e String path = Environment.getExternalStorageDirectory().toString() +\"/tmp/test.png\"; \n try {\n socket = new Socket(\"192.168.1.129\", 29877);\n\n is = socket.getInputStream();\n out = new FileOutputStream(path);\n byte[] temp = new byte[1024];\n for(int c = is.read(temp,0,1024); c \u0026gt; 0; c = is.read(temp,0,1024)){\n out.write(temp,0,c);\n Log.d(\"debug tag\", out.toString());\n }\n Log.d(\"debug tag\", temp.toString());\n\n Bitmap myBitmap = BitmapFactory.decodeByteArray(temp, 0, temp.length);\n imageView.setImageBitmap(myBitmap);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks for any advice.\u003c/p\u003e","accepted_answer_id":"12377248","answer_count":"1","comment_count":"0","creation_date":"2012-09-11 20:07:44.913 UTC","favorite_count":"1","last_activity_date":"2012-09-11 20:16:16.523 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1661396","post_type_id":"1","score":"1","tags":"java|android|sockets","view_count":"715"} +{"id":"19634066","title":"Duplicate commit on GitHub - Using SmartGit","body":"\u003cp\u003eI use SmartGit o control my repo. When I commited and pushed my project, I had a problem and closed the SmartGit, after that I realized that the operation didn´t finish, then, I did it again, but the first commit was sent. Now I have a duplicate commit on GitHub and cannot do the pull request.\u003c/p\u003e\n\n\u003cp\u003eCould you pls help me with this issue.\u003c/p\u003e\n\n\u003cp\u003ePls, keep in mind that I using SmartGi, so, no command line here! =)\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e\n\n\u003cp\u003ePls, don´t care about the portuguese. I´m from Brazil! =)\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/OW5aK.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e","answer_count":"0","comment_count":"4","creation_date":"2013-10-28 11:49:30.723 UTC","last_activity_date":"2013-10-28 18:33:40.877 UTC","last_edit_date":"2013-10-28 18:33:40.877 UTC","last_editor_display_name":"","last_editor_user_id":"1669797","owner_display_name":"","owner_user_id":"1669797","post_type_id":"1","score":"0","tags":"git|github|commit|git-commit|smartgit","view_count":"286"} +{"id":"46451410","title":"How to automate open office online apps","body":"\u003cp\u003eI need to automate excel online functionality that is being used by a web app. How can I automate excel online (open office app integrated with my web app)? I'm using selenium for my web app..\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2017-09-27 15:10:33.983 UTC","favorite_count":"1","last_activity_date":"2017-09-27 15:10:33.983 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5294234","post_type_id":"1","score":"0","tags":"c#|selenium-webdriver|ui-automation|openoffice-api","view_count":"7"} +{"id":"1906123","title":"Tomcat 6.0 does not allow generic ArrayList to be used for useBean","body":"\u003cp\u003eIn a jsp file I have this declaration:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;jsp:useBean scope=\"request\" id=\"products\" class=\"java.util.ArrayList\u0026lt;sgt.supermarket.entity.Product\u0026gt;\"/\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis declaration works fine with GlassFish 2.1, however, when I switch to Tomcat 6.0, exceptions is thrown:\u003c/p\u003e\n\n\u003cp\u003eThe value for the useBean class attribute java.util.ArrayList is invalid.\u003c/p\u003e\n\n\u003cp\u003eIs there any library missed for Tomcat that makes it behave different from Glass Fish 2.1?\u003c/p\u003e","accepted_answer_id":"1908571","answer_count":"2","comment_count":"3","creation_date":"2009-12-15 09:05:52.603 UTC","last_activity_date":"2013-02-12 12:25:21.987 UTC","last_edit_date":"2009-12-15 10:13:28.243 UTC","last_editor_display_name":"","last_editor_user_id":"82804","owner_display_name":"","owner_user_id":"169209","post_type_id":"1","score":"3","tags":"jsp|tomcat|generic-list|usebean","view_count":"3375"} +{"id":"32116266","title":"R: aggregate several colums at once","body":"\u003cp\u003eI am new to R and this is the first time I use stackoverflow so excuse me if I ask for something obvious or my question is not clear enough.\u003c/p\u003e\n\n\u003cp\u003eI am working with the following data set\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edim(storm)\n[1] 883602 39\n\n\n names(storm)\n [1] \"STATE__\" \"BGN_DATE\" \"BGN_TIME\" \"TIME_ZONE\" \"COUNTY\"\n [6] \"COUNTYNAME\" \"STATE\" \"EVTYPE\" \"BGN_RANGE\" \"BGN_AZI\"\n [11] \"BGN_LOCATI\" \"END_DATE\" \"END_TIME\" \"COUNTY_END\" \"COUNTYENDN\"\n [16] \"END_RANGE\" \"END_AZI\" \"END_LOCATI\" \"LENGTH\" \"WIDTH\"\n [21] \"F\" \"MAG\" \"FATALITIES\" \"INJURIES\" \"PROPDMG\"\n [26] \"PROPDMGEXP\" \"CROPDMG\" \"CROPDMGEXP\" \"WFO\" \"STATEOFFIC\"\n [31] \"ZONENAMES\" \"LATITUDE\" \"LONGITUDE\" \"LATITUDE_E\" \"LONGITUDE_\"\n [36] \"REMARKS\" \"REFNUM\" \"PROPTOTAL\" \"CROPTOTAL\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am interested to use \u003ccode\u003eEVTYPE\u003c/code\u003e (a factor variable) to aggregate 4 other numerical variables (\u003ccode\u003ePROPTOTAL, CROPTOTAL, FATALITIES, INJURIES\u003c/code\u003e)\u003c/p\u003e\n\n\u003cp\u003eThe factor variable as 950 levels:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elength(unique(storm$EVTYPE))\n[1] 950\n\n\nclass(storm$EVTYPE)\n[1] \"factor\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo I would expect an aggregated data frame with 950 observations and 5 variables when I run the following command:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e storm_tidy\u0026lt;-\naggregate(cbind(PROPTOTAL,CROPTOTAL,FATALITIES,INJURIES)~EVTYPE,FUN=sum,data=storm)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever I get only \u003ccode\u003e155\u003c/code\u003e rows\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edim(storm_tidy)\n[1] 155 5\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am using the aggregate with several columns following the help page of the function (use cbind): \u003c/p\u003e\n\n\u003cp\u003eFormulas, one ~ one, one ~ many, \u003cstrong\u003emany ~ one\u003c/strong\u003e, and many ~ many:\u003cbr\u003e\n\u003ccode\u003eaggregate(weight ~ feed, data = chickwts, mean)\naggregate(breaks ~ wool + tension, data = warpbreaks, mean)\n**aggregate(cbind(Ozone, Temp) ~ Month, data = airquality, mean)**\naggregate(cbind(ncases, ncontrols) ~ alcgp + tobgp, data = esoph, sum)\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eI am loosing information at some point:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esum(storm$PROPTOTAL)\n[1] 424769204805\n\nsum(storm_tidy$PROPTOTAL)\n[1] 228366211339\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, if I aggregate column by column it seems to work fine:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003estorm_tidy \u0026lt;- aggregate(PROPTOTAL~EVTYPE,FUN = sum, data = storm)\ndim(storm_tidy)\n[1] 950 2\n\n\n\n\n\nsum(storm_tidy$PROPTOTAL)\n[1] 424769204805\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat am I missing? What am I doing wrong?\u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","accepted_answer_id":"32116458","answer_count":"1","comment_count":"0","creation_date":"2015-08-20 10:50:40.28 UTC","last_activity_date":"2015-08-20 11:00:21.507 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5230862","post_type_id":"1","score":"1","tags":"r|aggregate|many-to-one|cbind","view_count":"134"} +{"id":"18795860","title":"how do i import postgresql database from a local folder or host directory","body":"\u003cp\u003eI have a .sql file on both my local computer and another one FTP to my host..\nThere is not tool in phppgdmin to import the file.\nWhat is the easiest to import the data?\u003c/p\u003e\n\n\u003cp\u003ei have dedicated hosting, and puTTy terminal.\u003c/p\u003e","accepted_answer_id":"18796045","answer_count":"1","comment_count":"0","creation_date":"2013-09-13 21:53:11.573 UTC","favorite_count":"1","last_activity_date":"2013-09-13 22:19:24.023 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"723787","post_type_id":"1","score":"0","tags":"postgresql|dump|phppgadmin","view_count":"1511"} +{"id":"7115630","title":"Which String Converter and When And Why?","body":"\u003cp\u003eI know the title might look little vague but I couldn't come up with something better. So my question is that in my company they are paying close attention to String conversion functions.\nAnd so far I've been dealing with \u003ccode\u003eCStr()\u003c/code\u003e, \u003ccode\u003eConvert.ToString()\u003c/code\u003e and \u003ccode\u003eToString()\u003c/code\u003e and I need to understand what the difference is between these functions.\u003c/p\u003e\n\n\u003cp\u003eThey said they were preferring the \u003ccode\u003eCStr()\u003c/code\u003e and \u003ccode\u003eConvert.ToString()\u003c/code\u003e and I would like to know why they decided to go with these two?\u003c/p\u003e\n\n\u003cp\u003eIs it because \u003ccode\u003eToString()\u003c/code\u003e depends on the object?\u003c/p\u003e","accepted_answer_id":"7115673","answer_count":"2","comment_count":"1","creation_date":"2011-08-19 00:10:04.42 UTC","last_activity_date":"2011-08-19 00:43:05.55 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"44852","post_type_id":"1","score":"3","tags":".net|vb.net","view_count":"56"} +{"id":"38544235","title":"Getting unknown property: frontend\\modules\\printinvoice\\models\\Prodfin::productcode","body":"\u003cp\u003eI'm trying to print an invoice in yii2. There are two tables which I'm touching two tables. One is prodfin - where the totalamount is stored and prodsummary where the products and quantities are stored. Now I want to pass these to my view and print to pdf using mpdf. I am using prodfin as primary model and get prodsummary data attached to it. My main obstacle now is to pass prodsummary details i.e. - productcode, productname, quantity,rate, amount in place row by row. I'm attaching a sample with this.\u003c/p\u003e\n\n\u003cp\u003eWhat I'm trying to achieve -\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/7ync9.jpg\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/7ync9.jpg\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eMy Controller Action\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic function actionPrintinvoice($id) {\n $model = $this-\u0026gt;findModel($id);\n $searchModel = new ProdfinSearch();\n $dataProvider = $searchModel-\u0026gt;search(Yii::$app-\u0026gt;request-\u0026gt;queryParams);\n $data = Prodfin::findOne($id);\n $dataProvider = new ActiveDataProvider([\n 'query' =\u0026gt; Prodsummary::find()-\u0026gt;select(['productcode','productname','qty','rate','amount'])-\u0026gt;where(['prfinid' =\u0026gt; $id]),\n 'pagination' =\u0026gt; [\n 'pageSize' =\u0026gt; 20,\n ],\n ]);\n $posts = $dataProvider-\u0026gt;getModels();\n $content = $this-\u0026gt;renderPartial('_printInvoice', [\n 'model' =\u0026gt; $model,\n 'dataProvider' =\u0026gt; $dataProvider,\n 'searchModel' =\u0026gt; $searchModel,\n 'data'=\u0026gt; $data,\n\n ]);\n $pdf = new Pdf([\n 'mode'=\u0026gt; Pdf::MODE_UTF8,\n 'format'=\u0026gt; Pdf::FORMAT_A4,\n 'destination'=\u0026gt; Pdf::DEST_BROWSER,\n //'destination' =\u0026gt; Pdf::DEST_DOWNLOAD,\n 'cssFile' =\u0026gt; '@vendor/kartik-v/yii2-mpdf/assets/kv-mpdf-bootstrap.min.css',\n // any css to be embedded if required\n 'cssInline' =\u0026gt; '.kv-heading-1{font-size:18px}', \n // set mPDF properties on the fly\n 'options' =\u0026gt; ['title' =\u0026gt; 'Print Invoice'],\n // call mPDF methods on the fly\n 'methods' =\u0026gt; [\n 'SetHeader'=\u0026gt;['Private and Confidential'], \n 'SetFooter'=\u0026gt;['This Payslip is computer generated.'],\n ],\n 'content' =\u0026gt; $content,\n\n ]);\n return $pdf-\u0026gt;render();\n //return $this-\u0026gt;render('_printSalarystatement', ['s_period' =\u0026gt; $s_period]);\n\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy view.php (partialview)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\n\nuse yii\\helpers\\Html;\nuse yii\\widgets\\DetailView;\n\n/* @var $this yii\\web\\View */\n/* @var $model frontend\\modules\\printinvoice\\models\\Prodfin */\n\n$this-\u0026gt;title = $model-\u0026gt;prfinslno;\n$this-\u0026gt;params['breadcrumbs'][] = ['label' =\u0026gt; 'Prodfins', 'url' =\u0026gt; ['index']];\n$this-\u0026gt;params['breadcrumbs'][] = $this-\u0026gt;title;\n?\u0026gt;\n\u0026lt;div class=\"ps-details\"\u0026gt;\n \u0026lt;div style=\"width:38%; float:left;border:1px solid black;\"\u0026gt;\n \u0026lt;h3 style=\"margin-bottom:0;margin-bottom:0;margin-top:2;margin-left:2;\"\u0026gt;\u0026lt;strong\u0026gt;\u0026lt;p class=\"text-left\"\u0026gt;M/S. My Company\u0026lt;/p\u0026gt;\u0026lt;/strong\u0026gt;\u0026lt;/h3\u0026gt;\n \u0026lt;h5 style=\"margin-bottom:0;margin-top:0;margin-left:2;\"\u0026gt;\u0026lt;p class=\"text-left\"\u0026gt;My details\u0026lt;/p\u0026gt;\u0026lt;/h5\u0026gt;\n \u0026lt;h5 style=\"margin-bottom:0;margin-top:0;margin-left:2;\"\u0026gt;\u0026lt;p class=\"text-left\"\u0026gt;My Address\u0026lt;/p\u0026gt;\u0026lt;/h5\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div style=\"width:61.25%; float:right;border:1px solid black;\"\u0026gt;\n \u0026lt;table style=\"width:100%\"\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;PAN No.\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;AGZPD/2365A\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\u0026amp;nbsp;\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\u0026amp;nbsp;\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;Invoice No.\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;?php echo $model['invoiceno'];?\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;Date : \u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;?php echo $model['date'];?\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;Challan No.\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;?php echo $model['challanno'];?\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;Date : \u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;?php echo $model['date'];?\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;Order No.\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;?php echo $model['orderno'];?\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;Date : \u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;?php echo $model['date'];?\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;/table\u0026gt;\n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u0026lt;div class=\"orient-details\"\u0026gt;\n \u0026lt;div style=\"width:100%; float:center;border:1px solid black;\"\u0026gt;\n \u0026lt;h3 style=\"margin-bottom:0;margin-top:2;margin-left:2;\"\u0026gt;\u0026lt;strong\u0026gt;\u0026lt;p class=\"text-center\"\u0026gt;My Company\u0026lt;/p\u0026gt;\u0026lt;/strong\u0026gt;\u0026lt;/h3\u0026gt;\n \u0026lt;h5 style=\"margin-bottom:0;margin-top:0;margin-left:2;\"\u0026gt;\u0026lt;p class=\"text-center\"\u0026gt;A Division of My Company\u0026lt;/p\u0026gt;\u0026lt;/h5\u0026gt;\n \u0026lt;h5 style=\"margin-bottom:0;margin-top:0;margin-left:2;\"\u0026gt;\u0026lt;p class=\"text-center\"\u0026gt;My Address\u0026lt;/p\u0026gt;\u0026lt;/h5\u0026gt;\n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u0026lt;div class=\"product-details\"\u0026gt;\n \u0026lt;?= DetailView::widget([\n 'model' =\u0026gt; $model,\n 'attributes' =\u0026gt; [\n //'id',\n 'productcode',\n 'productname',\n 'qty',\n 'rate',\n 'amount:ntext'\n //'ativo',\n ],\n]) ?\u0026gt;\n\u0026lt;/div\u0026gt;\n\u0026lt;div class=\"prodfin-view\"\u0026gt;\n\n \u0026lt;!-- \u0026lt;h1\u0026gt;\u0026lt;?= Html::encode($this-\u0026gt;title) ?\u0026gt;\u0026lt;/h1\u0026gt; --\u0026gt;\n\n\n\u0026lt;!-- \u0026lt;strong\u0026gt;Using display: inline-block; \u0026lt;/strong\u0026gt;\u0026lt;br\u0026gt;\n \u0026lt;table style=\"border:1px solid black;border-collapse:collapse;width:100%\" class=\"inlineTable\"\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td style=\"border-right: 1px solid\";\u0026gt;\u0026lt;font face=\"Calibri\";size=\"72\"\u0026gt;M/S P.S. Enterprise\u0026lt;/font\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;This One will contain the Invoice details\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;/table\u0026gt; --\u0026gt;\n \u0026lt;?= DetailView::widget([\n 'model' =\u0026gt; $model,\n 'attributes' =\u0026gt; [\n 'prfinslno',\n 'invoiceno',\n 'challanno',\n 'orderno',\n 'amount',\n 'date',\n ],\n ]) ?\u0026gt;\n\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ePlease let me know how to set the gridview with the details in the middle in picture.\u003c/p\u003e\n\n\u003cp\u003eModel Prodfin -\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\n\nnamespace frontend\\modules\\printinvoice\\models;\n\nuse Yii;\n\n/**\n * This is the model class for table \"prodfin\".\n *\n * @property string $prfinslno\n * @property string $invoiceno\n * @property string $challanno\n * @property string $orderno\n * @property string $amount\n * @property string $date\n */\nclass Prodfin extends \\yii\\db\\ActiveRecord\n{\n /**\n * @inheritdoc\n */\n public static function tableName()\n {\n return 'prodfin';\n }\n\n /**\n * @inheritdoc\n */\n public function rules()\n {\n return [\n [['date'], 'safe'],\n [['invoiceno', 'challanno', 'orderno', 'amount'], 'string', 'max' =\u0026gt; 40],\n ];\n }\n\n /**\n * @inheritdoc\n */\n public function attributeLabels()\n {\n return [\n 'prfinslno' =\u0026gt; 'Prfinslno',\n 'invoiceno' =\u0026gt; 'Invoiceno',\n 'challanno' =\u0026gt; 'Challanno',\n 'orderno' =\u0026gt; 'Orderno',\n 'amount' =\u0026gt; 'Amount',\n 'date' =\u0026gt; 'Date',\n ];\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eModel Prodsummary\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\n\nnamespace frontend\\modules\\printinvoice\\models;\n\nuse Yii;\n\n/**\n * This is the model class for table \"prodsummary\".\n *\n * @property string $prid\n * @property string $productiondate\n * @property string $invoiceno\n * @property string $challanno\n * @property string $orderno\n * @property string $productcode\n * @property string $productname\n * @property string $unit\n * @property string $qty\n * @property string $rate\n * @property string $amount\n */\nclass Prodsummary extends \\yii\\db\\ActiveRecord\n{\n /**\n * @inheritdoc\n */\n public static function tableName()\n {\n return 'prodsummary';\n }\n\n /**\n * @inheritdoc\n */\n public function rules()\n {\n return [\n [['productiondate'], 'safe'],\n [['invoiceno', 'challanno', 'orderno'], 'string', 'max' =\u0026gt; 40],\n [['productcode', 'amount'], 'string', 'max' =\u0026gt; 15],\n [['productname'], 'string', 'max' =\u0026gt; 80],\n [['unit', 'qty', 'rate'], 'string', 'max' =\u0026gt; 10],\n ];\n }\n\n /**\n * @inheritdoc\n */\n public function attributeLabels()\n {\n return [\n 'prid' =\u0026gt; 'Prid',\n 'productiondate' =\u0026gt; 'Productiondate',\n 'invoiceno' =\u0026gt; 'Invoiceno',\n 'challanno' =\u0026gt; 'Challanno',\n 'orderno' =\u0026gt; 'Orderno',\n 'productcode' =\u0026gt; 'Productcode',\n 'productname' =\u0026gt; 'Productname',\n 'unit' =\u0026gt; 'Unit',\n 'qty' =\u0026gt; 'Qty',\n 'rate' =\u0026gt; 'Rate',\n 'amount' =\u0026gt; 'Amount',\n ];\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-07-23 16:52:30.38 UTC","last_activity_date":"2016-07-23 17:51:11.807 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4761969","post_type_id":"1","score":"0","tags":"yii2","view_count":"258"} +{"id":"28467710","title":"ImageMap polygon coordinates shifting to the right in Google Chrome","body":"\u003cp\u003eI have the image below on my website. For the colored states, the image map coordinates are working as expected. I need to add IL state to my map. I've been trying all sorts of poly coordinates but it seems not to be working. I took a screenshot of what the outline looks like when I click it. I've tried in Chrome and FF. Any ideas would be greatly appreciated. Thanks!!\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;p\u0026gt;\u0026lt;img src=\"/assets/map.jpg\" alt=\"\" border=\"0\" usemap=\"#StateMap\" /\u0026gt;\u0026lt;/p\u0026gt;\n\u0026lt;map name=\"StateMap\"\u0026gt; \n \u0026lt;area shape=\"poly\" coords=\"98,116,124,120,123,132,142,135,136,186,88,178\" href=\"/utah\" alt=\"\" /\u0026gt; \n \u0026lt;area shape=\"poly\" coords=\"88,179,79,188,71,232,106,252,127,254,135,186\" href=\"/arizona\" alt=\"\" /\u0026gt; \n \u0026lt;area shape=\"poly\" coords=\"347,131,368,129,372,140,376,181,369,205,358,205,333,166\" href=\"/illinois\" alt=\"\" /\u0026gt;\n\u0026lt;/map\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eEDIT: Here's the CSS. I took it from Chrome's developer window\u003c/p\u003e\n\n\u003cp\u003eCSS inline style (I took it out above without realizing that it might matter):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003estyle=\"padding: 5px; border: 1px solid rgb(221, 221, 221); float: none; margin: 0px;\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCSS:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimg{\n height: auto;\n max-width: 100%;\n vertical-align: middle;\n}\n.span8{\n font-size: 16px;\n}\nbody{\n font-family: 'lato';\n line-height: 1.5;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/JIUap.jpg\" alt=\"US Map\"\u003e\n\u003cimg src=\"https://i.stack.imgur.com/u4Rxu.png\" alt=\"Screenshot\"\u003e\u003c/p\u003e","answer_count":"0","comment_count":"5","creation_date":"2015-02-12 01:24:37.037 UTC","last_activity_date":"2015-02-12 02:11:55.42 UTC","last_edit_date":"2015-02-12 02:11:55.42 UTC","last_editor_display_name":"","last_editor_user_id":"1422348","owner_display_name":"","owner_user_id":"1422348","post_type_id":"1","score":"0","tags":"html|coordinates|imagemap","view_count":"291"} +{"id":"33980335","title":"how to use blade Html:: class inside Html:: class in laravel 5.1","body":"\u003cp\u003eI am trying to display an image instead of word \"back\" to go to previous page how do i do that ?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e {!! Html::linkRoute('authors', Html::image(images/back.png)) !!}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"8","creation_date":"2015-11-29 07:07:55.143 UTC","favorite_count":"1","last_activity_date":"2015-11-29 12:54:12.01 UTC","last_edit_date":"2015-11-29 07:22:09.58 UTC","last_editor_display_name":"","last_editor_user_id":"4746677","owner_display_name":"","owner_user_id":"4746677","post_type_id":"1","score":"0","tags":"laravel|laravel-blade","view_count":"99"} +{"id":"27554451","title":"EER diagram in mysql workbench","body":"\u003cp\u003eI'm sorry about my 'nuewbie' question!\u003c/p\u003e\n\n\u003cp\u003eI must make EER diagram of my database but I have an question about it because it is not so clear for me. When I connect my database to MySQL Workbench it puts lines only on tables between two tables.. those with FK on them. Now do I need manualy to put the other lines where I don't have FK's because I connect two tables with third middle one?\u003c/p\u003e\n\n\u003cp\u003eAlso is this EER diagram is logical (conceptual) database or this is physical database? What exactly is logical database? I mean I think I know what is logical database. This is blueprint of the database. But how to describe tables?\u003c/p\u003e","accepted_answer_id":"28059963","answer_count":"2","comment_count":"0","creation_date":"2014-12-18 19:43:33.763 UTC","favorite_count":"1","last_activity_date":"2016-12-01 08:34:41.597 UTC","last_edit_date":"2015-02-20 16:48:31.81 UTC","last_editor_display_name":"","last_editor_user_id":"488195","owner_display_name":"","owner_user_id":"1158599","post_type_id":"1","score":"-1","tags":"mysql|database|workbench|eer-model","view_count":"288"} +{"id":"43762644","title":"C# How Do I Load an image into a code-behind generated table?","body":"\u003cp\u003eI'm using asp.net/c# to create a PDF file that will be downloaded. It's all done in the code behind by creating a series of HTMLTables that load into a div-created HTMLGenericControl. This div is then converted into a string and passed into the function that generates the PDF file. Below is a code sample:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e//This dataset contains the student's name, age and grade, want it for all sections\nList\u0026lt;studentExportPersonal\u0026gt; lsep = sp.getExportPersonal(exportStudents);\n\n//Page Header containg Grade, Student Name, and Age\nHtmlGenericControl div = new HtmlGenericControl(\"div\");\n\nforeach (studentExportPersonal sep in lsep)\n{\n foreach (string sec in secs)\n {\n HtmlTable identityTable = new HtmlTable();\n div.Controls.Add(identityTable);\n\n identityTable.Width = \"100%\";\n identityTable.Border = 0;\n identityTable.Style.Add(\"margin-bottom\", \"20px\");\n\n HtmlTableRow identityTR = new HtmlTableRow();\n identityTable.Rows.Add(identityTR);\n\n HtmlTableCell tdGrade = new HtmlTableCell();\n identityTR.Cells.Add(tdGrade);\n tdGrade.Style.Add(\"font-size\", \"30px\");\n tdGrade.Align = \"center\";\n tdGrade.RowSpan = 2;\n tdGrade.InnerText = sep.si.studentGrade;\n\n HtmlTableCell tdStudentName = new HtmlTableCell();\n identityTR.Cells.Add(tdStudentName);\n tdStudentName.Style.Add(\"font-size\", \"30px\");\n tdStudentName.Align = \"center\";\n tdStudentName.InnerText = sep.si.studentName;\n\n HtmlTableCell tdStudentAge = new HtmlTableCell();\n identityTR.Cells.Add(tdStudentAge);\n tdStudentAge.Style.Add(\"font-size\", \"30px\");\n tdStudentAge.Align = \"center\";\n tdStudentAge.RowSpan = 2;\n tdStudentAge.InnerText = sep.si.studentAge + \" Years Old\";\n\n HtmlTableRow identityTR1 = new HtmlTableRow();\n identityTable.Rows.Add(identityTR1);\n\n HtmlTableCell tdPic = new HtmlTableCell();\n identityTR1.Cells.Add(tdPic);\n\n Bitmap studPic;\n\n if (HttpContext.Current.Request.IsLocal)\n studPic = (Bitmap)System.Drawing.Image.FromFile(@\"C:\\studentPics\\\" + sep.si.studentPicID, true);\n else\n studPic = (Bitmap)System.Drawing.Image.FromFile(@\"E:\\Website\\Cascade\\studentPics\\\" + sep.si.studentPicID, true);\n }\n}\n\nexport dmc = new export();\n\nvar sb = new StringBuilder();\ndiv.RenderControl(new HtmlTextWriter(new StringWriter(sb)));\nstring s = sb.ToString();\n\ndmc.exportPDF(\"Student Profiles\", \"Portrait\", s);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAt the bottom of the foreach loop you can see that I'm creating a bitmap variable, my question is, how do I load it into the HTMLTableCell variable?\u003c/p\u003e","accepted_answer_id":"43763300","answer_count":"1","comment_count":"3","creation_date":"2017-05-03 14:17:45.8 UTC","last_activity_date":"2017-05-03 14:44:17.96 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2410605","post_type_id":"1","score":"0","tags":"c#|asp.net|image","view_count":"35"} +{"id":"31918666","title":"Number of contiguous subarrays in which element of array is max","body":"\u003cp\u003eGiven an array of 'n' integers, i need to find for each element of the array, the number of continuous subarrays that have that element as its max element.\u003c/p\u003e\n\n\u003cp\u003eElements can repeat.\u003c/p\u003e\n\n\u003cp\u003eIs there a way to do it in less than O(n^2).\u003c/p\u003e\n\n\u003cp\u003eO(nlogn) or O(n)?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eExample-\nIf array is {1,2,3}. Then-\nFor '1': 1 Such subarray {1}.\nFor '2': 2 Such subarrays {2},{1,2}\nFor '3': 3 Such subarrays {3},{2,3},{1,2,3}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"6","comment_count":"4","creation_date":"2015-08-10 11:44:31.46 UTC","favorite_count":"1","last_activity_date":"2015-08-13 11:41:46.367 UTC","last_edit_date":"2015-08-13 11:11:57.17 UTC","last_editor_display_name":"","last_editor_user_id":"1586924","owner_display_name":"","owner_user_id":"4884793","post_type_id":"1","score":"4","tags":"algorithm","view_count":"1832"} +{"id":"13823105","title":"Is there a way of adding exclusions to Eclipse's \"Sort all members\"?","body":"\u003cp\u003eIn general I like the \"Sort all members\" feature in Eclipse and have it turned on for the Save Actions.\u003c/p\u003e\n\n\u003cp\u003eHowever, occasionally I'd like to stop it for individual sections, e.g. enumerations. Is there a way of doing this?\u003c/p\u003e\n\n\u003cp\u003e\u003cem\u003eAm aware of the \"Ignore fields and enum constants\" option but not keen on using this as in generally like my fields in alphabetical order. Also know I can undo the change after the first save and then save it again - but don't want to have to remember to do this every time.\u003c/em\u003e\u003c/p\u003e","accepted_answer_id":"13914593","answer_count":"1","comment_count":"0","creation_date":"2012-12-11 15:31:34.63 UTC","last_activity_date":"2016-10-31 12:20:06.18 UTC","last_edit_date":"2016-10-31 12:20:06.18 UTC","last_editor_display_name":"","last_editor_user_id":"1063716","owner_display_name":"","owner_user_id":"1063716","post_type_id":"1","score":"1","tags":"java|eclipse|sorting|save|members","view_count":"460"} +{"id":"6805744","title":"stagewebview calling local javascript","body":"\u003cp\u003efriends.\u003c/p\u003e\n\n\u003cp\u003eI'm currently developing a flex mobile project. I currently need to load local javascript using stagewebview. Like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar str:String = '\u0026lt;head\u0026gt;'+\n '\u0026lt;script src=\"myLocalJs.js\"/\u0026gt;'+\n '\u0026lt;/head\u0026gt;\u0026lt;body\u0026gt;...\u0026lt;/body\u0026gt;';\nwebView:StageWebView = new StageWebView();\nwebView.loadString(str);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs there any way to load local javascript using StageWebView? I'm not expecting an answer like 'There is a project called StageWebViewBridge' since it does't have all the features I need.\nTHX!!\u003c/p\u003e","answer_count":"2","comment_count":"2","creation_date":"2011-07-24 08:28:00.793 UTC","last_activity_date":"2012-07-23 06:05:17.493 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"822222","post_type_id":"1","score":"0","tags":"flex|actionscript-3|air|flex4.5","view_count":"1843"} +{"id":"14513369","title":"Type juggling in function declarations","body":"\u003cp\u003eI'm just playing around here, my code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\n\nfunction test(string $str, array $arr = array()) {\n echo $str;\n}\ntest('something');\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhich results in:\u003c/p\u003e\n\n\u003cp\u003eCatchable fatal error: Argument 1 passed to test() must be an instance of string, string given\u003c/p\u003e\n\n\u003cp\u003eI'm curious why I can precede \u003ccode\u003e$arr\u003c/code\u003e with \u003ccode\u003earray\u003c/code\u003e without any problems, but I cannot precede \u003ccode\u003e$str\u003c/code\u003e with \u003ccode\u003estring\u003c/code\u003e?\u003c/p\u003e","accepted_answer_id":"14513385","answer_count":"1","comment_count":"1","creation_date":"2013-01-25 00:28:15.2 UTC","last_activity_date":"2013-01-25 00:36:09.62 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1689290","post_type_id":"1","score":"1","tags":"php","view_count":"59"} +{"id":"32950615","title":"Deployd comparison and swift with alamofire","body":"\u003cp\u003eI am trying to query data from my Deployd API with alamofire. How is it possible to do a comparison in a request. I have something like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elet parameters = [\"number\": [\"gt\": 3]]\n Manager.sharedInstance.request(.GET, \"http://localhost:2403/collections\", parameters: parameters).responseJSON { (request, response, result) -\u0026gt; Void in\n print(result.isSuccess)\n print(result.data)\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut the result is empty. In my dashboard i have a number column with the values: 1,2,3 and 4. So the response should return me the rows with the number 4.\u003c/p\u003e\n\n\u003cp\u003eAny ideas?\nThank\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-10-05 14:06:54.14 UTC","last_activity_date":"2015-10-05 15:26:36.89 UTC","last_edit_date":"2015-10-05 14:35:35.37 UTC","last_editor_display_name":"","last_editor_user_id":"5163575","owner_display_name":"","owner_user_id":"2538180","post_type_id":"1","score":"0","tags":"swift|mongodb|rest|alamofire|deployd","view_count":"141"} +{"id":"4681509","title":"Using Jquery, toggle a replaceWith command to switch between an input","body":"\u003cp\u003eI have a problem I cannot seem to solve.\u003c/p\u003e\n\n\u003cp\u003eI have a php and sql function that creates and populates a select drop-down. I need to be able to toggle this with a simple text input. I can use replaceWith() to get from the select drop-down to the text input but I cannot work out how to switch back to the original select drop-down.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e $('.plus').click(function() {\n var id = $(this).closest('li').find('select').attr('id');\n $(this).closest('li').find('select').replaceWith('\u0026lt;input class=\"new_input\" type=\"text\" id=\"' + id + '\" /\u0026gt;'); \n\n });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo when .plus is clicked I need it to toggle between the select and input items. I am creating the new input in jquery as I need to dynamically assign the input's id. Any help is greatly appreciated!\u003c/p\u003e","accepted_answer_id":"4681536","answer_count":"1","comment_count":"0","creation_date":"2011-01-13 15:06:16.027 UTC","last_activity_date":"2011-01-13 15:08:18.937 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"504291","post_type_id":"1","score":"0","tags":"php|jquery|html","view_count":"690"} +{"id":"23739878","title":"Phonegap fixed header and footer","body":"\u003cp\u003eWe are developing \u003ccode\u003ePhonegap\u003c/code\u003e mobile app having fixed header and footer. But if any form elements focus the whole page become scrollable and header and footer losses its position fixed. In Android it is working fine but in iOS we face this problems.\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003e\u003cstrong\u003eUpdate :-\u003c/strong\u003e \u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eViewport Meta\u003c/strong\u003e \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;meta name=\"viewport\" content=\"user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, height=device-height, width=device-width ,target-densityDpi=device-dpi\"/\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eApplication Header\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div data-role=\"header\" id =\"Top_content\" data-position=\"fixed\" data-tap-toggle=\"false\" data-hide-during-focus=\"\"\u0026gt; \n \u0026lt;div id=\"jqm-homeheader\" class=\"jqm-homeheader\" align=\"center\"\u0026gt; \n \u0026lt;img src=\"images/logo.png\" align=\"center\"\u0026gt; \n \u0026lt;/div\u0026gt;\u0026lt;!-- Logo closes--\u0026gt;\n \u0026lt;div data-theme=\"c\" data-add-back-btn=\"true\" \u0026gt; \n \u0026lt;div id=\"search-box1\"\u0026gt;\n \u0026lt;form action=\"\" onsubmit=\"custom_search();\"\u0026gt; \n \u0026lt;input type=\"search\" name=\"search-product\" id=\"search-product\" value=\"\" placeholder=\"Search\" style=\"width:90%;\" data-theme=\"s\" /\u0026gt;\n \u0026lt;/form\u0026gt; \n \u0026lt;/div\u0026gt; \u0026lt;!-- Search Box--\u0026gt; \n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"5","creation_date":"2014-05-19 14:04:08.077 UTC","favorite_count":"2","last_activity_date":"2014-05-21 09:49:05.95 UTC","last_edit_date":"2014-05-21 09:49:05.95 UTC","last_editor_display_name":"","last_editor_user_id":"3297536","owner_display_name":"","owner_user_id":"3297536","post_type_id":"1","score":"4","tags":"javascript|jquery-mobile|cordova","view_count":"1100"} +{"id":"5085850","title":"Make a widget show up has a normal App","body":"\u003cp\u003eHow to make a widget show up has a normal App?\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2011-02-23 00:44:12.88 UTC","last_activity_date":"2011-06-20 20:27:35.62 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"620335","post_type_id":"1","score":"1","tags":"android","view_count":"121"} +{"id":"28423763","title":"r - merge and melt list to data frame","body":"\u003cp\u003e\u003cstrong\u003eSituation \u0026amp; data\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI have a data frame of employees \u003ccode\u003edf_employees\u003c/code\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edf_employees \u0026lt;- structure(list(empNo = c(1001, 1002, 1003)), .Names = \"empNo\", row.names = c(NA, \n -3L), class = \"data.frame\")\n\n\u0026gt; df_employees\n empNo\n1 1001\n2 1002\n3 1003\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand a list of skills \u003ccode\u003el_skills\u003c/code\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003el_skills \u0026lt;- list(c(\"skill1\", \"skill2\", \"skill3\"), c(\"skill1\", \"skill2\"), \n \"skill1\")\n\n\n\u0026gt; l_skills\n[[1]]\n[1] \"skill1\" \"skill2\" \"skill3\"\n\n[[2]]\n[1] \"skill1\" \"skill2\"\n\n[[3]]\n[1] \"skill1\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eQuestion\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eHow do I merge and melt the data to give me a resulting dataframe \u003ccode\u003edf_result\u003c/code\u003e \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026gt; df_result\n empNo skills\n1 1001 skill1\n2 1001 skill2\n3 1001 skill3\n4 1002 skill1\n5 1002 skill2\n6 1003 skill1\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eAttempts\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI thought I could use a similar approach to \u003ca href=\"https://stackoverflow.com/a/24562914/4002530\"\u003ethis cSplit function\u003c/a\u003e, but I get an error when trying to install \u003ccode\u003ecSplit\u003c/code\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026gt; install.packages(\"cSplit\")\nInstalling package into ‘C:/Users/\u0026lt;username\u0026gt;/Documents/R/win-library/3.1’\n(as ‘lib’ is unspecified)\nWarning in install.packages :\n package ‘cSplit’ is not available (for R version 3.1.2)\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"28423842","answer_count":"2","comment_count":"5","creation_date":"2015-02-10 03:48:46.11 UTC","favorite_count":"1","last_activity_date":"2015-02-10 04:13:33.867 UTC","last_edit_date":"2017-05-23 10:25:18.45 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"4002530","post_type_id":"1","score":"3","tags":"r","view_count":"1743"} +{"id":"43979717","title":"compare columns from multiple files with bash command","body":"\u003cp\u003eI have several files, namely a.txt, b.txt, c.txt, d.txt, in the same format (3 columns, separated with tab). Let's take the first 3 lines of a.txt and b.txt for example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$head -3 a.txt\nid_1 59 4\nid_4 89 43\nid_5 8 90\n\n$head -3 b.txt\nid_1 9 4\nid_4 39 43\nid_5 81 9\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ec.txt and d.txt are similar to that.\u003c/p\u003e\n\n\u003cp\u003eI want to check if the first columns from them are all the same. Is there any easy way in shell to do this?\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2017-05-15 12:33:50.4 UTC","last_activity_date":"2017-05-15 13:58:09.72 UTC","last_edit_date":"2017-05-15 12:36:24.357 UTC","last_editor_display_name":"","last_editor_user_id":"828193","owner_display_name":"","owner_user_id":"6255138","post_type_id":"1","score":"-1","tags":"bash|shell|awk|cut|cmp","view_count":"79"} +{"id":"41311547","title":"Python3+Django1.10+mysqlclient1.3.9: cannot save emoji characters","body":"\u003cp\u003eI got the error below in django when saving a field with emoji character in the admin panel.\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eOperationalError at /admin/core/message/add/\n (1366, \"Incorrect string value: '\\xF0\\x9F\\x98\\x9E \\xF0...' for column 'name' at row 1\")\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI'm sure the database is ready for \u003ccode\u003eutf8mb4\u003c/code\u003e, because I can write/read these emoji character in \u003ccode\u003ephpmyadmin\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eMore, the saved emoji character displayed correctly in \u003ccode\u003ephpmyadmin\u003c/code\u003e but displays \u003ccode\u003e???\u003c/code\u003e in django output. \u003c/p\u003e\n\n\u003cp\u003eAnd in my another django project, the emoji plays well, till I just cannot find the difference between the two environment.\u003c/p\u003e\n\n\u003cp\u003eSo what can be the problem when I save the same thing using python?\u003c/p\u003e\n\n\u003cp\u003eThe problem is under django framework, so I want a solution that make django work.\u003c/p\u003e","accepted_answer_id":"41311631","answer_count":"1","comment_count":"1","creation_date":"2016-12-24 08:09:48.37 UTC","favorite_count":"0","last_activity_date":"2016-12-25 10:28:59.2 UTC","last_edit_date":"2016-12-25 10:28:59.2 UTC","last_editor_display_name":"","last_editor_user_id":"2544762","owner_display_name":"","owner_user_id":"2544762","post_type_id":"1","score":"2","tags":"python|mysql|django|mysql-python|emoji","view_count":"76"} +{"id":"44628466","title":"How render calendar events side by side","body":"\u003cp\u003eI don't want to use jQuery, and I'm familiar with fullCalendar but want something that can be used directly in an Angular 2 environment. FullCalendar is great but still depends on jQuery. Obviously it can be done but I can't wrap my head around how to achieve it.\u003c/p\u003e\n\n\u003cp\u003eWhat I want is that, given an array of events with start and end time values, if two or more events overlap in time the rendering of these events in the day view should squeeze them side-ways so that they don't overlap or hide each other.\u003c/p\u003e\n\n\u003cp\u003eThe content of an event is created server side and controlled by me, thus I can set it up in whatever way is most useful. But say I have starttime, endtime and title params.\u003c/p\u003e\n\n\u003cp\u003eGoogle, Apple and FullCalendar all handle it in their calendar solutions for week and day views but how?\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-06-19 10:44:55.613 UTC","last_activity_date":"2017-06-19 10:44:55.613 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2786709","post_type_id":"1","score":"0","tags":"javascript|angular|calendar","view_count":"55"} +{"id":"39156145","title":"Swift / CloudKit: After record changed, upload triggers \"Service Record Changed\"","body":"\u003cp\u003e\u003cstrong\u003eI'm trying to add a CKReference to a record in cloud kit, but the attempt keeps triggering \"Service Record Changed\".\u003c/strong\u003e From the console messages my println's have shown (console messages and code below), I'm uploading said record with 0 references, then when I attach the reference I'm seeing an attempt to upload the record with 1 reference. Then I'm getting the error.\u003c/p\u003e\n\n\u003cp\u003eAs I understand it, \u003cstrong\u003e\"Service Record Changed\" shouldn't be triggered because the values in the Reference List have changed (the record has an entire extra field).\u003c/strong\u003e Even though I'm in development mode, I manually created key-value field for the Reference List, because the first record upload doesn't include the field when the reference list is empty (uploading an empty array causes another error). \u003c/p\u003e\n\n\u003cp\u003eI'll include code in order of relevance (you'll be able to see most of the println's) after the console messages. The whole project is on github and I can link to it or include more code if needed.\u003c/p\u003e\n\n\u003cp\u003eRelevant Console:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ename was set\nuploading TestCrewParticipant\nwith 0 references\nif let projects\nupload succeeded: TestCrewParticipant\nattaching reference\nadding TestVoyage:_d147aa657fbf2adda0c82bf30d0e29a9 from guard\nreferences #: Optional(1)\nuploading TestCrewParticipant\nwith 1 references\nif let projects\nsuccess: 1\nuploading TestCrewParticipant\nwith 1 references\nif let projects\nsuccess: 1\nlocal storage tested: TestCrewParticipant\nu!error for TestCrewParticipant\nCKError: \u0026lt;CKError 0x7fcbd05fa960: \"Server Record Changed\" (14/2004); server message = \"record to insert already exists\"; uuid = 96377029-341E-487C-85C3-E18ADE1119DF; container ID = \"iCloud.com.lingotech.cloudVoyageDataModel\"\u0026gt;\nu!error for TestCrewParticipant\nCKError: \u0026lt;CKError 0x7fcbd05afb80: \"Server Record Changed\" (14/2004); server message = \"record to insert already exists\"; uuid = 3EEDE4EC-4BC1-4F18-9612-4E2C8A36C68F; container ID = \"iCloud.com.lingotech.cloudVoyageDataModel\"\u0026gt;\npassing the guard \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCode from CrewParticipant:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e/**\n * This array stores a conforming instance's CKReferences used as database\n * relationships. Instance is owned by each record that is referenced in the\n * array (supports multiple ownership)\n */\nvar references: [CKReference] { return associatedProjects ?? [CKReference]() }\n\n// MARK: - Functions\n\n/**\n * This method is used to store new ownership relationship in references array,\n * and to ensure that cloud data model reflects such changes. If necessary, ensures\n * that owned instance has only a single reference in its list of references.\n */\nmutating func attachReference(reference: CKReference, database: CKDatabase) {\nprint(\"attaching reference\")\n guard associatedProjects != nil else {\nprint(\"adding \\(reference.recordID.recordName) from guard\")\n associatedProjects = [reference]\n uploadToCloud(database)\n return\n }\nprint(\"associatedProjects: \\(associatedProjects?.count)\")\n if !associatedProjects!.contains(reference) {\nprint(\"adding \\(reference.recordID.recordName) regularly\")\n associatedProjects!.append(reference)\n uploadToCloud(database)\n }\n}\n\n/**\n * An identifier used to store and recover conforming instances record.\n */\nvar recordID: CKRecordID { return CKRecordID(recordName: identifier) }\n\n/**\n * This computed property generates a conforming instance's CKRecord (a key-value\n * cloud database entry). Any values that conforming instance needs stored should be\n * added to the record before returning from getter, and conversely should recover\n * in the setter.\n */\nvar record: CKRecord {\n get {\n let record = CKRecord(recordType: CrewParticipant.REC_TYPE, recordID: recordID)\n\n if let id = cloudIdentity { record[CrewParticipant.TOKEN] = id }\n\n// There are several other records that are dealt with successfully here.\n\nprint(\"if let projects\")\n // Referable properties\n if let projects = associatedProjects {\nprint(\"success: \\(projects.count)\")\n record[CrewParticipant.REFERENCES] = projects\n }\n\n return record\n }\n\n set { matchFromRecord(newValue) }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003egeneric code (which works for several other classes) where upload occurs:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e/**\n * This method uploads any instance that conforms to recordable up to the cloud. Does not check any \n * redundancies or for any constraints before (over)writing.\n */\nfunc uploadRecordable\u0026lt;T: Recordable\u0026gt;\n (instanceConformingToRecordable: T, database: CKDatabase, completionHandler: (() -\u0026gt; ())? = nil) {\nprint(\"uploading \\(instanceConformingToRecordable.recordID.recordName)\")\nif let referable = instanceConformingToRecordable as? Referable { print(\"with \\(referable.references.count) references\") }\n database.saveRecord(instanceConformingToRecordable.record) { record, error in\n guard error == nil else {\nprint(\"u!error for \\(instanceConformingToRecordable.recordID.recordName)\")\n self.tempHandler = { self.uploadRecordable(instanceConformingToRecordable,\n database: database,\n completionHandler: completionHandler) }\n CloudErrorHandling.handleError(error!, errorMethodSelector: #selector(self.runTempHandler))\n return\n }\nprint(\"upload succeeded: \\(record!.recordID.recordName)\")\n if let handler = completionHandler { handler() }\n }\n}\n\n/**\n * This method comprehensiviley handles any cloud errors that could occur while in operation.\n *\n * error: NSError, not optional to force check for nil / check for success before calling method.\n *\n * errorMethodSelector: Selector that points to the func calling method in case a retry attempt is\n * warranted. If left nil, no retries will be attempted, regardless of error type.\n */\nstatic func handleError(error: NSError, errorMethodSelector: Selector? = nil) {\n\n if let code: CKErrorCode = CKErrorCode(rawValue: error.code) {\n switch code {\n\n // This case requires a message to USER (with USER action to resolve), and retry attempt.\n case .NotAuthenticated:\n dealWithAuthenticationError(error, errorMethodSelector: errorMethodSelector)\n\n // These cases require retry attempts, but without error messages or USER actions.\n case .NetworkUnavailable, .NetworkFailure, .ServiceUnavailable, .RequestRateLimited, .ZoneBusy, .ResultsTruncated:\n guard errorMethodSelector != nil else { print(\"Error Retry CANCELED: no selector\"); return }\n retryAfterError(error, selector: errorMethodSelector!)\n\n // These cases require no message to USER or retry attempts.\n default:\n print(\"CKError: \\(error)\")\n } \n }\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"39183377","answer_count":"1","comment_count":"0","creation_date":"2016-08-25 23:18:03.157 UTC","last_activity_date":"2016-08-27 16:34:11.633 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4522329","post_type_id":"1","score":"0","tags":"swift|cloudkit|ckerror","view_count":"366"} +{"id":"46263559","title":"AWS ECS get placement constraint after task creation","body":"\u003cp\u003eI am trying to create a CI build step that will stop and re-run my tasks when my docker containers changed.\u003c/p\u003e\n\n\u003cp\u003eThe definition itself would be pointing at \u003ccode\u003elatest\u003c/code\u003e tag in ECR, and so all i need is to \u003ccode\u003estop-task\u003c/code\u003e and then \u003ccode\u003erun-task\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eTwo of the parameters in the API as well as the UI are \u003ccode\u003ePlacementConstraints\u003c/code\u003e and \u003ccode\u003ePlacementStrategy\u003c/code\u003e. \u003c/p\u003e\n\n\u003cp\u003eIs there any way to get these from the API AFTER the task has been started? e.g. get them for a running task. \u003ccode\u003edescribe-tasks\u003c/code\u003e doesn't seem to return this information. \u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2017-09-17 11:28:01.347 UTC","favorite_count":"0","last_activity_date":"2017-09-17 11:28:01.347 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2057955","post_type_id":"1","score":"0","tags":"amazon-ecs","view_count":"29"} +{"id":"37234018","title":"Using ClassLoader when loading .jar resources","body":"\u003cp\u003eI just don't understand why using the ClassLoader causes these two cases to act differently. Can someone explain how/why the ClassLoader changes the search such that it requires a full path into the jar?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epackage com.example;\nimport java.io.InputStream;\n\npublic class SomeClass {\n private static InputStream stm;\n static {\n for (final String s : new String[] { \"file.png\", \"com/example/file.png\", \"/com/example/file.png\" }) {\n // case 1 - w/o classLoader\n stm = SomeClass.class.getResourceAsStream(s);\n System.out.println(\"w/o : \" + (stm == null ? \"FAILED to load\" : \"loaded\") + \" \" + s);\n\n // case 2 - w/ classLoader\n stm = SomeClass.class.getClassLoader().getResourceAsStream(s);\n System.out.println(\"w/classloader: \" + (stm == null ? \"FAILED to load\" : \"loaded\") + \" \" + s);\n }\n }\n\n public static void main(final String args[]) {}\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eProduces:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ew/o : loaded file.png\nw/classloader: FAILED to load file.png\nw/o : FAILED to load com/example/file.png\nw/classloader: loaded com/example/file.png\nw/o : loaded /com/example/file.png\nw/classloader: FAILED to load /com/example/file.png\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"37234046","answer_count":"1","comment_count":"5","creation_date":"2016-05-15 02:44:25.583 UTC","favorite_count":"1","last_activity_date":"2016-05-15 10:03:27.333 UTC","last_edit_date":"2016-05-15 03:26:51.267 UTC","last_editor_display_name":"","last_editor_user_id":"1663987","owner_display_name":"","owner_user_id":"1663987","post_type_id":"1","score":"2","tags":"java|java-8|classloader","view_count":"280"} +{"id":"20421303","title":"Redirect System.in on JTextField and make it wait for user's input","body":"\u003cp\u003eI need to create a GUI for an application. \nI redirected the \u003ccode\u003eSystem.out\u003c/code\u003e stream on a \u003ccode\u003eJTextArea\u003c/code\u003e, but I can't redirect the \u003ccode\u003eSystem.in\u003c/code\u003e stream on a separate \u003ccode\u003eJTextField\u003c/code\u003e. \u003c/p\u003e\n\n\u003cp\u003eThis throws an exception or stop the execution. \nIn the original app, I asked user's input with:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eString reading = new Scanner(System.in).nextLine();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI need to use \u003ccode\u003eSystem.setIn(InputStream)\u003c/code\u003e. \u003c/p\u003e\n\n\u003cp\u003eIf I run normally my GUI version, the input was taken from Eclipse console. \nI need to recreate that thing in a new \"Console\" rappresented by a \u003ccode\u003eJTextField\u003c/code\u003e. \u003c/p\u003e\n\n\u003cp\u003eHow I can do this without changing the original code? (Sorry for my english!)\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2013-12-06 10:14:28.273 UTC","last_activity_date":"2013-12-06 10:31:32.25 UTC","last_edit_date":"2013-12-06 10:31:32.25 UTC","last_editor_display_name":"","last_editor_user_id":"702048","owner_display_name":"","owner_user_id":"3073956","post_type_id":"1","score":"0","tags":"java|jtextfield|system.in","view_count":"398"} +{"id":"33814633","title":"DataTables problems PHP","body":"\u003cp\u003eI'm trying to use DataTables server side with the following codes:\u003c/p\u003e\n\n\u003cp\u003eHere is the Javascript:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;script\u0026gt;\n\n $(document).ready( function () {\n\n $('#table').DataTable({\n \"serverSide\": true,\n \"processing\": true,\n \"ajax\": \"{{ $url }}\",\n\n \"aoColumns\": [\n { \"data\": null },\n { \"data\": \"name\" },\n { \"data\": \"playercount\" },\n { \"data\": \"warswon\" },\n { \"data\": \"warslost\" },\n { \"data\": \"warstied\" },\n { \"data\": \"level\"},\n { \"data\": \"exp\"},\n { \"data\": \"location\"},\n { \"data\": \"warwinpercent\"}\n ],\n\n \"fnRowCallback\": function( nRow, aData, iDisplayIndex ) {\n $('td:eq(1)', nRow).html('\u0026lt;a href=\"/clans/' + aData[1] + '\"\u0026gt;' +\n aData[3] + '\u0026lt;/a\u0026gt;');\n return nRow;\n },\n\n \"fnRowCallback\": function( nRow, aData, iDisplayIndex ) {\n var index = iDisplayIndex + 1;\n $('td:eq(0)', nRow).html(index);\n return nRow;\n }\n });\n\n $('#table').dataTable().columnFilter({\n sPlaceHolder: \"head:before\",\n aoColumns: [null, { type: \"text\" }, null, null, null, null, null, null, { type: \"text\" }, null]\n });\n\n } );\n \u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd my PHP code for server processing is available here: \u003ca href=\"http://pastebin.com/Wpn9u64U\" rel=\"nofollow\"\u003ehttp://pastebin.com/Wpn9u64U\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eYou can see my live example at: \u003ca href=\"http://clashdata.tk/clans/\" rel=\"nofollow\"\u003ehttp://clashdata.tk/clans/\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThe problems are:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eIt is only showing me 10 records.\u003c/li\u003e\n\u003cli\u003ePagination doesn't working.\u003c/li\u003e\n\u003cli\u003eSearch filtering doesn't working.\u003c/li\u003e\n\u003cli\u003eOrder by doesn't work.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eWhat is going on and how come these aren't working as they should?\u003c/p\u003e\n\n\u003cp\u003eI've been searching around but can't find anything. Someone said to set serverSide to false but the whole point of this is to use serverSide so I don't have to mass load data on page load.\u003c/p\u003e\n\n\u003cp\u003eHere is the serverCode in the post:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\n\nnamespace App\\Helpers\\DataTables;\n\nuse PDO;\nuse PDOException;\n\nini_set('display_startup_errors',1);\nini_set('display_errors',1);\nerror_reporting(-1);\n\n\nclass DataTables {\n\n private $_db;\n\n public function __construct() {\n\n try {\n $host = 'localhost';\n $database = 'zzzzzzzzzzzz';\n $user = 'xxxxxxxxxxxx';\n $passwd = 'yyyyyyyyyyyyy';\n\n $this-\u0026gt;_db = new PDO('mysql:host='.$host.';dbname='.$database, $user, $passwd, array(PDO::ATTR_PERSISTENT =\u0026gt; true, PDO::MYSQL_ATTR_INIT_COMMAND =\u0026gt; \"SET NAMES 'utf8'\"));\n } catch (PDOException $e) {\n error_log(\"Failed to connect to database: \".$e-\u0026gt;getMessage());\n }\n\n }\n\n public function utf8ize($d) {\n if (is_array($d)) {\n foreach ($d as $k =\u0026gt; $v) {\n $d[$k] = $this-\u0026gt;utf8ize($v);\n }\n } else if (is_string ($d)) {\n return utf8_encode($d);\n }\n return $d;\n }\n\n public function get($table, $index_column, $columns) {\n\n // Paging\n $sLimit = \"\";\n if ( isset( $_GET['iDisplayStart'] ) \u0026amp;\u0026amp; $_GET['iDisplayLength'] != '-1' ) {\n $sLimit = \"LIMIT \".intval( $_GET['iDisplayStart'] ).\", \".intval( $_GET['iDisplayLength'] );\n }\n\n // Ordering\n $sOrder = \"\";\n if ( isset( $_GET['iSortCol_0'] ) ) {\n $sOrder = \"ORDER BY \";\n for ( $i=0 ; $i\u0026lt;intval( $_GET['iSortingCols'] ) ; $i++ ) {\n if ( $_GET[ 'bSortable_'.intval($_GET['iSortCol_'.$i]) ] == \"true\" ) {\n $sortDir = (strcasecmp($_GET['sSortDir_'.$i], 'ASC') == 0) ? 'ASC' : 'DESC';\n $sOrder .= \"`\".$columns[ intval( $_GET['iSortCol_'.$i] ) ].\"` \". $sortDir .\", \";\n }\n }\n\n $sOrder = substr_replace( $sOrder, \"\", -2 );\n if ( $sOrder == \"ORDER BY\" ) {\n $sOrder = \"\";\n }\n }\n\n /*\n * Filtering\n * NOTE this does not match the built-in DataTables filtering which does it\n * word by word on any field. It's possible to do here, but concerned about efficiency\n * on very large tables, and MySQL's regex functionality is very limited\n */\n $sWhere = \"\";\n if ( isset($_GET['sSearch']) \u0026amp;\u0026amp; $_GET['sSearch'] != \"\" ) {\n $sWhere = \"WHERE (\";\n for ( $i=0 ; $i\u0026lt;count($columns) ; $i++ ) {\n if ( isset($_GET['bSearchable_'.$i]) \u0026amp;\u0026amp; $_GET['bSearchable_'.$i] == \"true\" ) {\n $sWhere .= \"`\".$columns[$i].\"` LIKE :search OR \";\n }\n }\n $sWhere = substr_replace( $sWhere, \"\", -3 );\n $sWhere .= ')';\n }\n\n // Individual column filtering\n for ( $i=0 ; $i\u0026lt;count($columns) ; $i++ ) {\n if ( isset($_GET['bSearchable_'.$i]) \u0026amp;\u0026amp; $_GET['bSearchable_'.$i] == \"true\" \u0026amp;\u0026amp; $_GET['sSearch_'.$i] != '' ) {\n if ( $sWhere == \"\" ) {\n $sWhere = \"WHERE \";\n }\n else {\n $sWhere .= \" AND \";\n }\n $sWhere .= \"`\".$columns[$i].\"` LIKE :search\".$i.\" \";\n }\n }\n\n // SQL queries get data to display\n\n $stmt = $this-\u0026gt;_db-\u0026gt;prepare('SET @rownum = 0');\n $stmt-\u0026gt;execute();\n\n $sQuery = \"SELECT SQL_CALC_FOUND_ROWS `\".str_replace(\" , \", \" \", implode(\"`, `\", $columns)).\"`, @rownum := @rownum+1 AS rank FROM `\".$table.\"` \".$sWhere.\" \".$sOrder.\" \".$sLimit;\n $statement = $this-\u0026gt;_db-\u0026gt;prepare($sQuery);\n\n // Bind parameters\n if ( isset($_GET['sSearch']) \u0026amp;\u0026amp; $_GET['sSearch'] != \"\" ) {\n $statement-\u0026gt;bindValue(':search', '%'.$_GET['sSearch'].'%', PDO::PARAM_STR);\n }\n for ( $i=0 ; $i\u0026lt;count($columns) ; $i++ ) {\n if ( isset($_GET['bSearchable_'.$i]) \u0026amp;\u0026amp; $_GET['bSearchable_'.$i] == \"true\" \u0026amp;\u0026amp; $_GET['sSearch_'.$i] != '' ) {\n $statement-\u0026gt;bindValue(':search'.$i, '%'.$_GET['sSearch_'.$i].'%', PDO::PARAM_STR);\n }\n }\n\n $statement-\u0026gt;execute();\n $rResult = $statement-\u0026gt;fetchAll();\n\n $iFilteredTotal = current($this-\u0026gt;_db-\u0026gt;query('SELECT FOUND_ROWS()')-\u0026gt;fetch());\n\n // Get total number of rows in table\n $sQuery = \"SELECT COUNT(`\".$index_column.\"`) FROM `\".$table.\"`\";\n $iTotal = current($this-\u0026gt;_db-\u0026gt;query($sQuery)-\u0026gt;fetch());\n\n // Output\n $output = array(\n \"draw\" =\u0026gt; 1,\n \"recordsTotal\" =\u0026gt; $iTotal,\n \"recordsFiltered\" =\u0026gt; $iFilteredTotal,\n \"data\" =\u0026gt; array()\n );\n\n // Return array of values\n foreach($rResult as $aRow) {\n $row = array();\n for ( $i = 0; $i \u0026lt; count($columns); $i++ ) {\n if ( $columns[$i] == \"version\" ) {\n // Special output formatting for 'version' column\n $row[] = ($aRow[ $columns[$i] ]==\"0\") ? '-' : $aRow[ $columns[$i] ];\n }\n else if ( $columns[$i] != ' ' ) {\n $row[] = $aRow[ $columns[$i] ];\n }\n }\n $output['data'][] = $row;\n }\n\n echo json_encode($this-\u0026gt;utf8ize($output));\n }\n\n}\n\nheader('Pragma: no-cache');\nheader('Cache-Control: no-store, no-cache, must-revalidate');\n\n// Create instance of TableData class\n$tableData = new DataTables();\n$tableData-\u0026gt;get('clans', 'id', array('id', 'clanid', 'name'));\n\n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003e\u003cem\u003eUPDATE\u003c/em\u003e\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI've just noticed that the link the console is fetching new data on when paginating displays the correct data but that data isn't getting put onto the table.\u003c/p\u003e","answer_count":"1","comment_count":"14","creation_date":"2015-11-19 21:24:26.51 UTC","last_activity_date":"2015-11-19 23:58:14.527 UTC","last_edit_date":"2015-11-19 23:58:14.527 UTC","last_editor_display_name":"user4942382","owner_display_name":"user4942382","post_type_id":"1","score":"0","tags":"javascript|php|jquery|datatables","view_count":"156"} +{"id":"36257770","title":"how do i plot time on x-axis in canvas js chart?","body":"\u003cp\u003ei have a values in date time format. I want to show the time on x-axis instead of date.\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e{\"dateTime\":\"2016-03-16\n 07:09:41\",\"value\":\"41.0\"},{\"dateTime\":\"2016-03-16\n 07:09:43\",\"value\":\"43.0\"},{\"dateTime\":\"2016-03-16\n 07:09:45\",\"value\":\"45.0\"},{\"dateTime\":\"2016-03-16\n 07:09:47\",\"value\":\"47.0\"},{\"dateTime\":\"2016-03-16\n 07:09:49\",\"value\":\"49.0\"},{\"dateTime\":\"2016-03-16\n 07:09:51\",\"value\":\"51.0\"},{\"dateTime\":\"2016-03-16\n 07:09:53\",\"value\":\"53.0\"},{\"dateTime\":\"2016-03-16\n 07:09:55\",\"value\":\"55.0\"},{\"dateTime\":\"2016-03-16\n 07:09:57\",\"value\":\"57.0\"},{\"dateTime\":\"2016-03-16\n 07:09:59\",\"value\":\"59.0\"},{\"dateTime\":\"2016-03-16\n 07:10:01\",\"value\":\"1.0\"},{\"dateTime\":\"2016-03-16\n 07:10:03\",\"value\":\"3.0\"},{\"dateTime\":\"2016-03-16\n 07:10:05\",\"value\":\"5.0\"},{\"dateTime\":\"2016-03-16\n 07:10:07\",\"value\":\"7.0\"},{\"dateTime\":\"2016-03-16\n 07:10:09\",\"value\":\"9.0\"},{\"dateTime\":\"2016-03-16\n 07:10:11\",\"value\":\"11.0\"},{\"dateTime\":\"2016-03-16\n 07:10:13\",\"value\":\"13.0\"},{\"dateTime\":\"2016-03-16\n 07:10:15\",\"value\":\"15.0\"},{\"dateTime\":\"2016-03-16\n 07:10:17\",\"value\":\"17.0\"},{\"dateTime\":\"2016-03-16\n 07:10:19\",\"value\":\"19.0\"},{\"dateTime\":\"2016-03-16\n 07:10:21\",\"value\":\"21.0\"},{\"dateTime\":\"2016-03-16\n 07:10:23\",\"value\":\"23.0\"},{\"dateTime\":\"2016-03-16\n 07:10:25\",\"value\":\"25.0\"},{\"dateTime\":\"2016-03-16\n 07:10:27\",\"value\":\"27.0\"},{\"dateTime\":\"2016-03-16\n 07:10:29\",\"value\":\"29.0\"},{\"dateTime\":\"2016-03-16\n 07:10:31\",\"value\":\"31.0\"},{\"dateTime\":\"2016-03-16\n 07:10:33\",\"value\":\"33.0\"},{\"dateTime\":\"2016-03-16\n 07:10:35\",\"value\":\"35.0\"},{\"dateTime\":\"2016-03-16\n 07:10:37\",\"value\":\"37.0\"},{\"dateTime\":\"2016-03-16\n 07:10:39\",\"value\":\"39.0\"},{\"dateTime\":\"2016-03-16\n 07:10:41\",\"value\":\"41.0\"},{\"dateTime\":\"2016-03-16\n 07:10:43\",\"value\":\"43.0\"},{\"dateTime\":\"2016-03-16\n 07:10:45\",\"value\":\"45.0\"},{\"dateTime\":\"2016-03-16\n 07:10:47\",\"value\":\"47.0\"},{\"dateTime\":\"2016-03-16\n 07:10:49\",\"value\":\"49.0\"},{\"dateTime\":\"2016-03-16\n 07:10:51\",\"value\":\"51.0\"},{\"dateTime\":\"2016-03-16\n 07:10:53\",\"value\":\"53.0\"},{\"dateTime\":\"2016-03-16\n 07:10:55\",\"value\":\"55.0\"},{\"dateTime\":\"2016-03-16\n 07:10:57\",\"value\":\"57.0\"},{\"dateTime\":\"2016-03-16\n 07:10:59\",\"value\":\"59.0\"},{\"dateTime\":\"2016-03-16\n 07:11:01\",\"value\":\"1.0\"},{\"dateTime\":\"2016-03-16\n 07:11:03\",\"value\":\"3.0\"},{\"dateTime\":\"2016-03-16\n 07:11:05\",\"value\":\"5.0\"},{\"dateTime\":\"2016-03-16\n 07:11:07\",\"value\":\"7.0\"},{\"dateTime\":\"2016-03-16\n 07:11:09\",\"value\":\"9.0\"},{\"dateTime\":\"2016-03-16\n 07:11:11\",\"value\":\"11.0\"},{\"dateTime\":\"2016-03-16\n 07:11:13\",\"value\":\"13.0\"},{\"dateTime\":\"2016-03-16\n 07:11:15\",\"value\":\"15.0\"},{\"dateTime\":\"2016-03-16\n 07:11:17\",\"value\":\"17.0\"},{\"dateTime\":\"2016-03-16\n 07:11:19\",\"value\":\"19.0\"},{\"dateTime\":\"2016-03-16\n 07:11:21\",\"value\":\"21.0\"},{\"dateTime\":\"2016-03-16\n 07:11:23\",\"value\":\"23.0\"},{\"dateTime\":\"2016-03-16\n 07:11:25\",\"value\":\"25.0\"},{\"dateTime\":\"2016-03-16\n 07:11:27\",\"value\":\"27.0\"},{\"dateTime\":\"2016-03-16\n 07:11:29\",\"value\":\"29.0\"},{\"dateTime\":\"2016-03-16\n 07:11:31\",\"value\":\"31.0\"},{\"dateTime\":\"2016-03-16\n 07:11:33\",\"value\":\"33.0\"},{\"dateTime\":\"2016-03-16\n 07:11:35\",\"value\":\"35.0\"},{\"dateTime\":\"2016-03-16\n 07:11:37\",\"value\":\"37.0\"},{\"dateTime\":\"2016-03-16\n 07:11:39\",\"value\":\"39.0\"}\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eCurrently i am using canvas js chart.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;script src=\"/public/javascript/canvasjs.min.js\" type=\"text/javascript\"\u0026gt;\u0026lt;/script\u0026gt;\n\n\u0026lt;script type=\"text/javascript\"\u0026gt;\nwindow.onload = function () {\n var chart = new CanvasJS.Chart(\"chartContainer\",\n {\n title: {\n text: \"Date Time Formatting\" \n },\n axisX:{ \n valueFormatString: \"hh:mm:ss\" ,\n labelAngle: -50\n },\n axisY: {\n valueFormatString: \"#,###\"\n },\n\n data: [\n { \n type: \"area\",\n color: \"rgba(0,75,141,0.7)\",\n dataPoints: [\n\n { x: new Date(07,11,35), y: 0}, \n { x: new Date(07,11,29), y: 20 }, \n { x: new Date(07,10,53), y: 30 }, \n { x: new Date(07,10,31), y: 10}\n\n ]\n }\n\n ]\n});\n\nchart.render();\n}\n\u0026lt;/script\u0026gt;\n\n\u0026lt;div id=\"chartContainer\" style=\"height: 300px; width: 100%;\"\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eits shows only 12.00:00. Please help how can i show the time on x-axis\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2016-03-28 07:18:15.983 UTC","last_activity_date":"2016-03-28 07:21:14.373 UTC","last_edit_date":"2016-03-28 07:21:14.373 UTC","last_editor_display_name":"","last_editor_user_id":"3967525","owner_display_name":"","owner_user_id":"5821013","post_type_id":"1","score":"0","tags":"javascript|datetime|charts","view_count":"495"} +{"id":"16893749","title":"Is there a way to support HTML5 video tag on non HTML5 compliant browsers?","body":"\u003cp\u003eI am working on HTML5 these days and facing problem in HTML5 video tag. Please help me with suitable answers. Thanks in advance. \u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2013-06-03 09:34:05.997 UTC","last_activity_date":"2013-06-03 18:25:42.547 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2223269","post_type_id":"1","score":"0","tags":"android|html5","view_count":"48"} +{"id":"12660101","title":"Processing and examine user URLs in django","body":"\u003cp\u003eI'm building a website where users are posting content and URLs, very much alike the facebook wall/news feed.\u003c/p\u003e\n\n\u003cp\u003eI was thinking that I could take the URL from the user and open it from the server in the django backend and examine the content (just like facebook does).\u003c/p\u003e\n\n\u003cp\u003eI thought that there should be a django-opengraph app which helps me to open a URL and check the meta-tags to determine what kind of content etc. But it seems that Open Graph is an invention of Facebook?\u003c/p\u003e\n\n\u003cp\u003eMy question is how I can open a URL using django and fetch content (video, audio, images, texts) and by determine what kind of content i can embed it properly into my site? Any apps?\u003c/p\u003e\n\n\u003cp\u003eAnd also, I'm intersted in the security aspect of open URLs from the server sent by a user.\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","accepted_answer_id":"12660629","answer_count":"5","comment_count":"1","creation_date":"2012-09-30 09:14:57.313 UTC","last_activity_date":"2012-11-20 17:14:14.357 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"577421","post_type_id":"1","score":"0","tags":"django|url|opengraph|fetch","view_count":"164"} +{"id":"6534601","title":"My Delphi 7 with Firebird 1.5.6 application is freezing itself after some time of inactivity on Windows 7","body":"\u003cp\u003eI have developed a Delphi 7 application that is using Firebird 1.5.6 database in client \nserver environment.\u003c/p\u003e\n\n\u003cp\u003eThe application is running on Windows 7 32 bit on notebook computer an the database is running\non Windows XP 32-bit machine that is used as a server. \nThe problem is the application is freezing itself when it is left idle for some time.\nThis problem never occured on Windows XP only when we installed it on Windows 7.\u003c/p\u003e\n\n\u003cp\u003eEverything was working fine for 5 years but now on Windows 7 the application is totaly unstable.\u003c/p\u003e\n\n\u003cp\u003eSometimes the wake up time is 10-30 sec with success but sometimes never with messages \"application not responding\" or \"application crashes\".\u003c/p\u003e\n\n\u003cp\u003eI have no idea where to search or what to try to find a solution.\nI tried to make a timer with 10 secconds resolution to make it constantly active\nbut with no success.\u003c/p\u003e\n\n\u003cp\u003eBTW I am running in Administrator mode with XP Compatibility mode active.\nI have not tried the virtual XP Mode yet but I think it will not solve the problem.\u003c/p\u003e","answer_count":"3","comment_count":"7","creation_date":"2011-06-30 12:19:17.627 UTC","favorite_count":"1","last_activity_date":"2015-07-31 05:00:23.913 UTC","last_edit_date":"2011-06-30 23:46:28.293 UTC","last_editor_display_name":"","last_editor_user_id":"207391","owner_display_name":"","owner_user_id":"634311","post_type_id":"1","score":"5","tags":"delphi|windows-7|delphi-7|firebird|firebird1.5","view_count":"1363"} +{"id":"39318400","title":"TypeError: 'module' object is not callable in Spacy Python","body":"\u003cp\u003eI want to print \u003ccode\u003eParse Tree\u003c/code\u003e using \u003ccode\u003eSpacy\u003c/code\u003e. But the code below is giving the error \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003een_nlp = spacy.language('English')\n TypeError: 'module' object is not callable\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eThe error is on this \u003ccode\u003een_nlp = spacy.loads('en')\u003c/code\u003e line. I tried to shake off as \u003ccode\u003een_nlp = spacy.language(English)\u003c/code\u003e by importing \u003ccode\u003efrom spacy.en import English\u003c/code\u003e But still it is not working. Can someone help?\u003c/p\u003e\n\n\u003cp\u003eCode: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport spacy\nfrom nltk import Tree\n\nen_nlp = spacy.loads('en')\n\ndoc = en_nlp(\"The quick brown fox jumps over the lazy dog.\")\n\ndef to_nltk_tree(node):\n if node.n_lefts + node.n_rights \u0026gt; 0:\n return Tree(node.orth_, [to_nltk_tree(child) for child in node.children])\n else:\n return node.orth_\n\n\n[to_nltk_tree(sent.root).pretty_print() for sent in doc.sents]\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"39318532","answer_count":"1","comment_count":"3","creation_date":"2016-09-04 15:14:25.117 UTC","last_activity_date":"2017-11-22 19:11:42.817 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6750923","post_type_id":"1","score":"0","tags":"python|nlp|spacy","view_count":"182"} +{"id":"23206183","title":"How to update data on server via AJAX when ng-model input value is changed","body":"\u003cp\u003eI'm new to Angular and I have one problem I cannot find a solution for. Any help is appreciated.\u003c/p\u003e\n\n\u003cp\u003eI'm fetching all the data from a server to a controller using \u003ccode\u003e$http.get(\"/admin/getGraphData\")\u003c/code\u003e. When user edits \u003ccode\u003e\u0026lt;input\u0026gt;\u003c/code\u003e element, a data in controller is updated by Angular. When that occurs, I would want the data on the server (MySQL) to be updated instantly. Is there an easy way to achieve this? If I could do something like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$scope.onDayValueChange(month, year, day, newValue){\n $http.post(\"/admin/updateDayValue\", {...})\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut how to intercept Controllers data change and how to know exact index of object being changed or something like this? Thanks a lot!\u003c/p\u003e\n\n\u003cp\u003eData model is fairly simple. Months (jan, feb, mar...) containing some value for each of a day in a month:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{month: 1, year: 2013, data:[{day:1, val:11}, {day:2, val:14}, ..., {day:31, val:80}]}\n{month: 2, year: 2013, data:[{day:1, val:22}, {day:2, val:124}, ..., {day:30, val:2}]}\n...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn HTML it looks something like this:\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/j2TGC.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eThe code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div ng-app=\"graph\" ng-controller=\"GraphCtrl\"\u0026gt;\n \u0026lt;ul\u0026gt;\n \u0026lt;li class=\"monthItem\" ng-repeat=\"monthItem in months\"\u0026gt;\n \u0026lt;span\u0026gt;\n {{monthNames[monthItem.month-1]}} \n ({{monthItem.month}}. \n {{monthItem.year}}.)\u0026lt;/span\u0026gt;\n\n \u0026lt;ul class=\"monthDays\"\u0026gt;\n \u0026lt;li ng-repeat=\"dayItem in monthItem.data\"\u0026gt;\n \u0026lt;label\u0026gt;{{dayItem.day}}.\n \u0026lt;input type=\"number\" \n ng-model=\"dayItem.val\"\n value=\"{{dayItem.val}}\"\n min=\"0\" required\u0026gt;\n \u0026lt;/label\u0026gt;\n \u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n\n \u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n\u0026lt;/div\u0026gt;\n\n\n\n\n\u0026lt;script src=\"https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.5/angular.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\n\u0026lt;script\u0026gt;\n var app = angular.module('graph');\n app.controller('GraphCtrl', function($scope, $http) {\n\n getData(); // load all data to the model\n\n function getData(){\n $http.get(\"/admin/getGraphData\").success(function(data){\n $scope.months = data;\n })\n };\n\n $scope.monthNames = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];\n});\n\u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"23209569","answer_count":"1","comment_count":"1","creation_date":"2014-04-21 21:17:08.733 UTC","favorite_count":"0","last_activity_date":"2014-04-22 02:56:32.02 UTC","last_edit_date":"2014-04-21 21:19:11.937 UTC","last_editor_display_name":"","last_editor_user_id":"996010","owner_display_name":"","owner_user_id":"996010","post_type_id":"1","score":"3","tags":"ajax|angularjs","view_count":"1448"} +{"id":"13963637","title":"if mysql query is null or doesn't exist?","body":"\u003cp\u003eI have a mysql query which gets 5 stars if a user rating is set to 5, like a star rating system. Another 4 of the same script which get 1, 2, 3 or 4 stars according to the rating 1-5.\u003c/p\u003e\n\n\u003cp\u003eWhat i want is for an image to be echoed if their are no results in the mysql table. I have tried the below but nothing is echoed. can someone show me what i would need to do please?\u003c/p\u003e\n\n\u003cp\u003eI've tried adding this bit of code but i just get an array error.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\nif (is_null($get_star_rating_set)) \n{\n echo \"HELLO\";\n} \n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere's the code normally:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\n$get_star_rating_set = get_star_rating();\nwhile ($rating = mysql_fetch_array($get_star_rating_set))\n if ($rating['rating'] == '0') { echo '\n \u0026lt;div class=\"star-rate\"\u0026gt;\n \u0026lt;table width=\"40%\" border=\"0\" cellspacing=\"5\" cellpadding=\"0\"\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td width=\"17%\" align=\"left\" valign=\"middle\" scope=\"col\"\u0026gt;\u0026lt;img src=\"../PTB1/assets/img/icons/favorites.png\" id=\"R1\" alt=\"0\" style=\"cursor:pointer\" title=\"Not at All\" width=\"27\" height=\"25\" /\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;td width=\"17%\" align=\"left\" valign=\"middle\" scope=\"col\"\u0026gt;\u0026lt;img src=\"../PTB1/assets/img/icons/favorites.png\" id=\"R2\" alt=\"1\" style=\"cursor:pointer\" title=\"Somewhat\" width=\"27\" height=\"25\" /\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;td width=\"17%\" align=\"left\" valign=\"middle\" scope=\"col\"\u0026gt;\u0026lt;img src=\"../PTB1/assets/img/icons/favorites.png\" id=\"R3\" alt=\"2\" style=\"cursor:pointer\" title=\"Average\" width=\"27\" height=\"25\" /\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;td width=\"17%\" align=\"left\" valign=\"middle\" scope=\"col\"\u0026gt;\u0026lt;img src=\"../PTB1/assets/img/icons/favorites.png\" id=\"R4\" alt=\"3\" style=\"cursor:pointer\" title=\"Good\" width=\"27\" height=\"25\" /\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;td width=\"24%\" align=\"left\" valign=\"middle\" scope=\"col\"\u0026gt;\u0026lt;img src=\"../PTB1/assets/img/icons/favorites.png\" id=\"R5\" alt=\"4\" style=\"cursor:pointer\" title=\"Very Good\" width=\"27\" height=\"25\" /\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;/table\u0026gt;\n \u0026lt;/div\u0026gt;';\n }\n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"1","creation_date":"2012-12-20 00:46:06.84 UTC","last_activity_date":"2012-12-20 01:08:32.173 UTC","last_edit_date":"2012-12-20 00:55:24.733 UTC","last_editor_display_name":"","last_editor_user_id":"367456","owner_display_name":"","owner_user_id":"1917356","post_type_id":"1","score":"0","tags":"php|mysql|if-statement","view_count":"295"} +{"id":"23338577","title":"Is there any advantage of joining on an indexed and non-indexed columns at the same time?","body":"\u003cp\u003eIf i have a join on a non-indexed column, will adding another criteria in the join on an indexed column help?\u003c/p\u003e\n\n\u003cp\u003eFor eg - Two tables Table1 and Table2 exist. the column tran_date is indexed, but tran_id is not. Will the second code run faster than the first? If so, how does SQL exactly operate on such joins? Table1 is unique on tran_id, while table2 is unique at tran_id - sku level.\nAlso, tran_id is a varchar(50) type of column\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT a.tran_id, a.tran_date, b.sku\nfrom table1 a\ninner join table2 b\non a.tran_id = b.tran_id;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003evs\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT a.tran_id, a.tran_date, b.sku\nfrom table1 a\ninner join table2 b\non a.tran_id = b.tran_id and a.tran_date = b.tran_date;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm using Oracle environment\u003c/p\u003e","answer_count":"2","comment_count":"1","creation_date":"2014-04-28 10:24:49.33 UTC","last_activity_date":"2014-04-28 12:26:00.51 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3580848","post_type_id":"1","score":"0","tags":"sql|oracle|join|indexing","view_count":"510"} +{"id":"2775755","title":"php script randomly hangs up","body":"\u003cp\u003eI install php 5 (more precisely 5.3.1) as apache module.\u003c/p\u003e\n\n\u003cp\u003eAfter this one of my application becomes randomly hang up on \u003ccode\u003emysql_connect\u003c/code\u003e - sometimes works, sometimes no, sometimes reload of page helps.\u003c/p\u003e\n\n\u003cp\u003eHow can this be fixed?\u003c/p\u003e\n\n\u003cp\u003eI use Windows Vista, Apache/2.2.14 (Win32) PHP/5.3.1 with php module, MySql 5.0.67-community-nt.\u003c/p\u003e\n\n\u003cp\u003eAfter a minute I obtain the error message:\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eFatal error: Maximum execution time of 60 seconds exceeded in path\\to\\mysqlcon.php on line 9\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eI run MySql locally and heavy load could not be a reason:\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eSHOW PROCESSLIST\u003c/code\u003e shows about 3 process\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eSHOW VARIABLES LIKE 'MAX_CONNECTIONS'\u003c/code\u003e is 100.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eUPDATE:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eAt first I thought that this is connected with mysql_connect.\nBut now I can't say for certain.\u003c/p\u003e\n\n\u003cp\u003eMore difficult thing is when I insert the line to debug:\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003e$fh = fopen(\"E://_debugLog\", 'a'); fwrite($fh, __FILE__ . \" : \" . __LINE__ . \"\\n\"); fclose($fh);\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003escript start working near that location as a rule.\u003c/p\u003e\n\n\u003cp\u003eRestart of apache resolve the issue.\u003c/p\u003e","accepted_answer_id":"2842125","answer_count":"3","comment_count":"5","creation_date":"2010-05-05 18:24:22.973 UTC","favorite_count":"0","last_activity_date":"2010-05-15 23:49:55.897 UTC","last_edit_date":"2010-05-08 17:28:46.913 UTC","last_editor_display_name":"","last_editor_user_id":"13441","owner_display_name":"","owner_user_id":"13441","post_type_id":"1","score":"1","tags":"php|apache","view_count":"2424"} +{"id":"41812531","title":"How to override component default property values","body":"\u003cp\u003eI am using the Kendo UI NumericTextBox component for Angular 2 throughout my app. There are a number of properties that I keep setting to the same value. Is there a way to change the default property values at either the app and/or component level?\u003c/p\u003e\n\n\u003cp\u003eHere is a simplified example of my current code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@Component({\n selector: 'my-app',\n template: `\n \u0026lt;kendo-numerictextbox\n [autoCorrect]=\"ns.autoCorrect\"\n [min]=\"ns.min\"\n [max]=\"ns.max\"\n [value]=\"value1\"\n \u0026gt;\u0026lt;/kendo-numerictextbox\u0026gt;\n \u0026lt;kendo-numerictextbox\n [autoCorrect]=\"ns.autoCorrect\"\n [min]=\"ns.min\"\n [max]=\"ns.max\"\n [value]=\"value2\"\n \u0026gt;\u0026lt;/kendo-numerictextbox\u0026gt;\n `\n})\n\nclass AppComponent {\n public ns: {\n autoCorrect: true,\n min: 0,\n max: 99\n };\n\n public value1 = 5;\n public value2 = 10;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm hoping to have something like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@Component({\n selector: 'my-app',\n template: `\n \u0026lt;kendo-numerictextbox\n [value]=\"value1\"\n \u0026gt;\u0026lt;/kendo-numerictextbox\u0026gt;\n \u0026lt;kendo-numerictextbox\n [value]=\"value2\"\n \u0026gt;\u0026lt;/kendo-numerictextbox\u0026gt;\n `\n})\n\nclass AppComponent {\n // Override existing NumericTextBoxComponent default values\n NumericTextBoxComponent.autoCorrect = true;\n NumericTextBoxComponent.min = 0;\n NumericTextBoxComponent.max = 99;\n\n public value1 = 5;\n public value2 = 10;\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-01-23 17:49:49.447 UTC","last_activity_date":"2017-01-23 21:18:08.38 UTC","last_edit_date":"2017-01-23 21:18:08.38 UTC","last_editor_display_name":"","last_editor_user_id":"2716356","owner_display_name":"","owner_user_id":"1264541","post_type_id":"1","score":"0","tags":"angular|kendo-ui-angular2","view_count":"197"} +{"id":"23516764","title":"Providing multiple formats (ogg,mp3) while creating Audio dynamically","body":"\u003cp\u003eWhen using html5 audio you can provide multiple formats/codecs with:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;audio controls\u0026gt;\n \u0026lt;source src=\"horse.ogg\" type=\"audio/ogg\"\u0026gt;\n \u0026lt;source src=\"horse.mp3\" type=\"audio/mpeg\"\u0026gt; \u0026lt;-- secondary format here\n Your browser does not support the audio element.\n\u0026lt;/audio\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI create Audio with\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar audio = new Audio('pathtomyaudio/myaudio.mp3');\naudio.load();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs there a way to dynamically provide another extension such as ogg? \u003c/p\u003e\n\n\u003cp\u003eAny help appreciated :)\u003c/p\u003e","answer_count":"0","comment_count":"6","creation_date":"2014-05-07 11:38:09.19 UTC","last_activity_date":"2014-05-07 11:38:09.19 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1524316","post_type_id":"1","score":"0","tags":"javascript|html5|audio|html5-audio|dynamically-generated","view_count":"24"} +{"id":"16815286","title":"Can't open a .jar file on my mac","body":"\u003cp\u003eI'm trying to download jsoup on my mac (Mountain Lion). I've downloaded the \u003ccode\u003ejsoup.jar\u003c/code\u003e file and installed the last java 7 from the site. But here is the problem, when I double click the \u003ccode\u003e.jar\u003c/code\u003e file it tells to me:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eThe Java JAR file “jsoup-1.7.2.jar” could not be launched. Check the\n console.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI can't find even the console! Someone can help me? I read a lot of answers about this topic, but they all talk about Java 6 and it has different settings that can't find.\u003c/p\u003e\n\n\u003cp\u003eEDIT\u003c/p\u003e\n\n\u003cp\u003ei also tried from the terminal with this command:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003ejava -jar /Users/Ben/Downloads/jsoup-1.7.2.jar\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003ebut it tells me:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eFailed to load Main-Class manifest attribute from\n /Users/Ben/Downloads/jsoup-1.7.2.jar\u003c/p\u003e\n\u003c/blockquote\u003e","accepted_answer_id":"16815511","answer_count":"2","comment_count":"6","creation_date":"2013-05-29 13:30:53.357 UTC","last_activity_date":"2013-05-29 13:40:16.75 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2351909","post_type_id":"1","score":"0","tags":"java|osx|jar|jsoup","view_count":"6585"} +{"id":"3159536","title":"Is there an operation Step Back in NetBeans during debug process?","body":"\u003cp\u003eIn NetBeans when you insert \u003cem\u003eBreakpoint\u003c/em\u003e and \u003cem\u003eDebug project\u003c/em\u003e, it runs code until the \u003cem\u003eBreakpoint\u003c/em\u003e and stop right in a line where we put \u003cem\u003eBreakpoint\u003c/em\u003e. And afterwards we can execute our code step by step. If we Press \u003ckbd\u003eF8\u003c/kbd\u003e which is \u003cem\u003eStep Over\u003c/em\u003e operation, NetBeans executes next line. Sometimes we want to go back to the previous executed line because we want to change that line and see how it will work. \u003cbr\u003e\nSo, the question is how can I say NetBeans to \u003cstrong\u003eStep Back\u003c/strong\u003e (if we can call this like this), so instead of executing next line code it executes previous line code? I remember in Visual Basic 6.0 (now I don't know because don' t use it anymore) we could manage current execution line, i.e. we could just drag and drop debug pointer to the line we want during the debugging and it would start to execute code right from the place we put it. Is it possible in NetBeans?\u003cbr\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eUpdate 1\u003c/strong\u003e\u003cbr\u003e\nI use NetBeans for debugging PHP application. PHP uses \u003ccode\u003ephp_xdebug-2.1.0RC1-5.3-vc9-nts.dll\u003c/code\u003e to to debug PHP code.\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2010-07-01 15:59:32.69 UTC","favorite_count":"0","last_activity_date":"2011-04-15 01:07:20.373 UTC","last_edit_date":"2010-07-01 16:08:10.657 UTC","last_editor_display_name":"","last_editor_user_id":"282887","owner_display_name":"","owner_user_id":"282887","post_type_id":"1","score":"4","tags":"debugging|netbeans","view_count":"3272"} +{"id":"33396138","title":"How to redirect a domain to a web page?","body":"\u003cp\u003eI have a Wordpress website =\u003e www.mywebsite.com\nwhere I can create pages such as : www.mywebsite.com/page-hello.html\u003c/p\u003e\n\n\u003cp\u003eI also have a domain : hello.com\u003c/p\u003e\n\n\u003cp\u003eI would like to redirect the website hello.com to the page www.mywebsite.com/page-hello.html while keeping hello.com in the URL.\u003c/p\u003e\n\n\u003cp\u003eBasically hello.com stays in the UTL but users will see this page \u003e www.mywebsite.com/page-hello.html\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2015-10-28 16:11:37.527 UTC","last_activity_date":"2015-10-28 16:38:53.977 UTC","last_edit_date":"2015-10-28 16:35:01.993 UTC","last_editor_display_name":"","last_editor_user_id":"3968703","owner_display_name":"","owner_user_id":"3511945","post_type_id":"1","score":"0","tags":"wordpress|.htaccess|url-redirection","view_count":"43"} +{"id":"43984892","title":"Android error cannot acess AbstractSafeParcelable","body":"\u003cp\u003eI'm tryind add firebase remote config to my project, but it is conflicting with the version of my gms, the error code:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eError:(674, 25) error: cannot access AbstractSafeParcelable\n class file for com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable not found\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eAnd when i click its send me for this method of my project:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e protected void RequestLocation() {\n locationRequest = new LocationRequest();\n locationRequest.setInterval(10000); // for this line\n locationRequest.setFastestInterval(5000);\n locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI tried some suggestions that I found in the stackoverflow itself, like changing the version of gms to 10.0.1 but ends up generating another error: \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eError:Execution failed for task ':app:processDebugGoogleServices'.\n Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at \u003ca href=\"https://bintray.com/android/android-tools/com.google.gms.google-services/\" rel=\"nofollow noreferrer\"\u003ehttps://bintray.com/android/android-tools/com.google.gms.google-services/\u003c/a\u003e) or updating the version of com.google.android.gms to 9.0.2.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eMy original build.gradle can be checked here:`apply plugin: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e'com.android.application'\n\nandroid {\n compileSdkVersion 23\n buildToolsVersion '25.0.0'\n defaultConfig {\n applicationId \"my.editable.project\"\n minSdkVersion 15\n targetSdkVersion 23\n versionCode 28\n versionName \"1.4.4\"\n multiDexEnabled true\n }\n buildTypes {\n release {\n minifyEnabled false\n proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\n }\n }\n productFlavors {\n }\n lintOptions {\n disable 'MissingTranslation'\n checkReleaseBuilds false\n }\n\n dexOptions {\n javaMaxHeapSize \"4g\"\n }\n}\n\n\n\n\ndependencies {\n compile fileTree(dir: 'libs', include: ['*.jar'])\n compile files('libs/ksoap2-android-assembly-3.5.0-jar-with-dependencies.jar')\n //compile files('libs/gcm.jar')\n //compile files('libs/gcm-src.jar')\n compile project(':firebase_plugin')\n compile 'com.android.support:appcompat-v7:23.1.1'\n compile 'com.android.support:design:23.1.1'\n compile 'com.android.support:support-v4:23.1.1'\n compile 'com.google.android.gms:play-services:9.0.2'\n compile 'com.google.android.gms:play-services-ads:9.0.2'\n compile 'com.google.android.gms:play-services-auth:9.0.2'\n compile 'com.google.android.gms:play-services-gcm:9.0.2'\n compile 'com.android.support:multidex:1.0.1'\n compile 'com.android.support.constraint:constraint-layout:1.0.2'\n compile 'com.google.firebase:firebase-config:10.0.1'\n}\n\n\n\n\napply plugin: 'com.google.gms.google-services'`\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"4","creation_date":"2017-05-15 16:49:50.03 UTC","last_activity_date":"2017-05-15 19:00:18.597 UTC","last_edit_date":"2017-05-15 19:00:18.597 UTC","last_editor_display_name":"","last_editor_user_id":"5310874","owner_display_name":"","owner_user_id":"5310874","post_type_id":"1","score":"0","tags":"android|firebase|firebase-remote-config","view_count":"105"} +{"id":"29717040","title":"Gulp cwd to project root","body":"\u003cp\u003eMy current code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003egulp.task('_sass', function() {\n var files = [\n './vendor/bower_components/bootstrap-sass/assets/stylesheets/_bootstrap.scss',\n './resources/assets/sass/main.scss',\n './vendor/bower_components/bootstrap-rating/bootstrap-rating.css',\n './vendor/bower_components/select2/select2.css'\n ];\n return gulp.src(files)\n //return gulp.src(files)\n .pipe(concat('all.css'))\n .pipe(sass())\n .on('error', notify.onError(function (error) {\n return \"Error: \" + error.message;\n }))\n .pipe(gulp.dest('./public/css/'))\n .pipe(reload({stream: true}));\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAs you can see, I have a files array where I store all the paths to the .scss files I want to concat into all.css. But I get this error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eError: file to import not found or unreadable: base/normalize\nCurrent dir: /Users/**/Code/Laravel/vendor/bower_components/bootstrap-sass/assets/stylesheets/\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhich is obvious, because gulp uses the first path of the array as it's base directory. So I tried settings the \u003ccode\u003ebase\u003c/code\u003e or the \u003ccode\u003ecwd\u003c/code\u003e to \u003ccode\u003e'./'\u003c/code\u003e, so I could specify my Laravel root directory. But that doesn't work. How can I solve this problem, so I can use all these .scss files without copying files to other directories?\u003c/p\u003e","accepted_answer_id":"29733323","answer_count":"1","comment_count":"0","creation_date":"2015-04-18 12:01:19.317 UTC","last_activity_date":"2015-04-19 17:28:13.93 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1631615","post_type_id":"1","score":"1","tags":"javascript|laravel|gulp","view_count":"388"} +{"id":"21228652","title":"background color not changing on hover css","body":"\u003cp\u003eI used this for styling navigation bar of my webpage but the color is not changing on hover\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e.nav {\n list-style-type:none;\n margin:0;\n padding:0;\n overflow:hidden;\n}\n\n.nav li {\n float: left;\n}\n\n.nav li a:hover,.nav li a:active {\n background-color:#7A991A;\n}\n\n.nav li a:link,.nav li a:visited {\n display:block;\n width:9em;\n font-weight:bold;\n color:#FFFFFF;\n background-color:#98bf21;\n text-align:center;\n padding:4px;\n text-decoration:none;\n text-transform:uppercase;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHTML code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;ul class = \"nav\"\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"index.html\"\u0026gt;Home\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"products.html\"\u0026gt;Our Products\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"aboutus.html\"\u0026gt;Contact us\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n\u0026lt;/ul\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ecan someone suggest what I did wrong?\u003c/p\u003e","accepted_answer_id":"21228719","answer_count":"6","comment_count":"4","creation_date":"2014-01-20 07:47:27.883 UTC","last_activity_date":"2014-01-20 08:17:30.093 UTC","last_edit_date":"2014-01-20 07:53:38.187 UTC","last_editor_display_name":"","last_editor_user_id":"3131961","owner_display_name":"","owner_user_id":"3131961","post_type_id":"1","score":"2","tags":"html|css","view_count":"147"} +{"id":"5644798","title":"emacs like fill-paragraph option in textmate?","body":"\u003cp\u003eIs there an option to reformat lines/paragraphs/selected text to 80 cols in TextMate like in emacs (fill-paragraph bound to M-q)? If not, do you know of any option to add this to TextMate - a known plugin/macro? any help in writing such a macro is most welcome too. :)\u003c/p\u003e","accepted_answer_id":"5645899","answer_count":"2","comment_count":"0","creation_date":"2011-04-13 05:28:07.877 UTC","last_activity_date":"2011-04-23 10:07:29.807 UTC","last_edit_date":"2011-04-14 00:24:08.48 UTC","last_editor_display_name":"","last_editor_user_id":"625560","owner_display_name":"","owner_user_id":"625560","post_type_id":"1","score":"2","tags":"osx|textmate","view_count":"268"} +{"id":"19015514","title":"multiple conditions inside click function not working","body":"\u003cp\u003eWith this code and chk1 and chk2 as 0, is impossible to me to guess what is wrong with this simple code function.\u003c/p\u003e\n\n\u003cp\u003eAs i know, there are many js ways to use click, like \".click()\", \".on('click')\" or \".onClick\" but none of them works at all. Take a look of this example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e regbtn.click(function() {\n if(chk1 == 0){\n if(chk2 == 1){\n box2.reverse();\n chk2 = 0;\n }\n box1.restart();\n chk1 = 1;\n }\n });\n\n logbtn.click(function() {\n if(chk2 == 0){\n if(chk1 == 1){\n box1.reverse();\n chk1 = 0;\n }\n box2.restart();\n chk2 = 1;\n }\n });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs there any reason why this doesnt work properly? and which way is the newest and best to use of this 3 ways of click js functions.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eregbtn and logbtn are 2 buttons that open 2 diferent boxes, box1 and box2 respectively, chk1 and chk2 is to check if the other box is open and reverse it first if so.\u003c/p\u003e\n\n\u003cp\u003eAlert doesnt work at all in any place.\u003c/p\u003e\n\n\u003cp\u003eThis is the initial code variables to work with:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e var regbox = document.getElementById(\"regbox\"),\n logbox = document.getElementById(\"logbox\"),\n regbtn = document.getElementById(\"regbtn\"),\n logbtn = document.getElementById(\"logbtn\");\n var chk1 = 0,\n chk2 = 0;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"19015819","answer_count":"1","comment_count":"2","creation_date":"2013-09-25 21:28:52.747 UTC","last_activity_date":"2013-12-08 22:51:35.04 UTC","last_edit_date":"2013-12-08 22:51:35.04 UTC","last_editor_display_name":"","last_editor_user_id":"2680216","owner_display_name":"","owner_user_id":"1240074","post_type_id":"1","score":"0","tags":"javascript|jquery|conditional","view_count":"86"} +{"id":"42055888","title":"Work with a global variable initialized via BehaviorSubject / Angular2","body":"\u003cp\u003eI've got \u003cem\u003eCatalog Component\u003c/em\u003e and \u003cem\u003eCart Service\u003c/em\u003e in my app. And I want to add products from my \u003cem\u003eCatalog\u003c/em\u003e (array of objects stored in JSON) to the \u003cem\u003eCart\u003c/em\u003e.\u003c/p\u003e\n\n\u003cp\u003eSo, I need my Cart to be changed dynamically when I add / remove a product.\nFor that reason I am trying to use \u003cstrong\u003e{ BehaviorSubject }\u003c/strong\u003e.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eCart Service:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport { Injectable } from '@angular/core';\nimport { BehaviorSubject } from 'rxjs/BehaviorSubject';\n\n\n@Injectable()\nexport class CartService {\n public cart = new BehaviorSubject(null);//my globally available Cart\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eCatalog Component:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport { Component, OnInit } from '@angular/core';\nimport { CatalogService } from './catalog.service';\nimport { CartService } from '../cart/cart.service';//my globally available Cart imported to the current component\n\n@Component({\n selector: 'catalog',\n templateUrl: './catalog.component.html',\n styleUrls: ['./catalog.component.scss']\n})\n\nexport class CatalogComponent implements OnInit { \n catalog: any;\n image: any;\n title: string;\n description: string;\n prod: any;\n visible: boolean;\n\nconstructor(public catalogService: CatalogService, public cartService: CartService){ } \n\nngOnInit(){\n\n this.catalogService.getCatalogItems().subscribe(\n (data) =\u0026gt; this.catalog = data\n );\n}\n\n toCart(prod){\n this.cartService.cart.subscribe((val) =\u0026gt; {\n console.log(val); \n });\n\n this.cartService.cart.push(prod);//I want to add new product to the Cart by this\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut Console throws the following error: \u003ca href=\"https://i.stack.imgur.com/TtRVE.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/TtRVE.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eSo, what should I do to use my \u003cem\u003eCart\u003c/em\u003e globally via \u003cstrong\u003eBehaviorSubject\u003c/strong\u003e?\u003c/p\u003e","accepted_answer_id":"42056646","answer_count":"2","comment_count":"0","creation_date":"2017-02-05 18:51:15.063 UTC","last_activity_date":"2017-02-05 20:02:41.03 UTC","last_edit_date":"2017-02-05 19:06:30.03 UTC","last_editor_display_name":"","last_editor_user_id":"4440968","owner_display_name":"","owner_user_id":"4440968","post_type_id":"1","score":"0","tags":"angular|typescript|behaviorsubject","view_count":"131"} +{"id":"27495156","title":"PHP: Extracting numbers from a page","body":"\u003cp\u003eIm extracting data from a page with multiple userinput ratings, which means the syntax is a bit sloppy.\nThe text goes something like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;span date=\"12/10/2014\"\u0026gt;4.957/10\u0026lt;/span\u0026gt;\n\u0026lt;span date=\"12/10/2014\"\u0026gt;11/10\u0026lt;/span\u0026gt;\n\u0026lt;span date=\"12/10/2014\"\u0026gt;5 / 10\u0026lt;/span\u0026gt;\n\u0026lt;span date=\"12/10/2014\"\u0026gt;i say: 9 /10\u0026lt;/span\u0026gt;\n\u0026lt;span date=\"12/10/2014\"\u0026gt;10/ 10\u0026lt;/span\u0026gt;\n\u0026lt;span date=\"12/10/2014\"\u0026gt;0.1/10, no more\u0026lt;/span\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ehow would you go about fetching these ratings?\nthe ratings will go from 0 to 1000000, and have a maximum of 3 decimals.\u003c/p\u003e\n\n\u003cp\u003eThe resulting array of the above should be:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e4.957\n11\n5\n9\n10\n0.1\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo basically the rules should go like this:\u003cbr\u003e\n* Match any number with \"/10\" behind it.\u003cbr\u003e\n* The number can be followed by a dot and up to 3 additional numbers.\u003cbr\u003e\n* There might be a space between the / and the rating, also between the / and 10.\u003cbr\u003e\n* There should not be another / after the /10.\u003c/p\u003e","accepted_answer_id":"27495305","answer_count":"3","comment_count":"5","creation_date":"2014-12-15 23:38:09.78 UTC","favorite_count":"0","last_activity_date":"2014-12-16 00:21:55.097 UTC","last_edit_date":"2014-12-15 23:45:34.233 UTC","last_editor_display_name":"","last_editor_user_id":"768384","owner_display_name":"","owner_user_id":"768384","post_type_id":"1","score":"-3","tags":"php|regex|matching","view_count":"38"} +{"id":"33185564","title":"How to take Database backup without using phpmyadmin in Mysql Xampp","body":"\u003cp\u003eI am trying to take database backup from my phpmyadmin. Because of some issue, I am not able to start my Xampp control panel. That's why I am not able to open phpmyadmin panel.\u003c/p\u003e\n\n\u003cp\u003ePlease give me an idea to take backup.\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2015-10-17 10:33:44.783 UTC","last_activity_date":"2016-12-14 17:03:08.69 UTC","last_edit_date":"2016-12-14 17:02:04.897 UTC","last_editor_display_name":"","last_editor_user_id":"236247","owner_display_name":"","owner_user_id":"5349052","post_type_id":"1","score":"0","tags":"php|mysql|xampp","view_count":"2586"} +{"id":"28810453","title":"How to change line spacing in ggplot xlab?","body":"\u003cp\u003eMy X axis label is too long, so I used \u003ccode\u003exlab(expression(atop(paste(\"Hello world\"^\"TM \", \":Hi\"),paste(\"hello again\"^\"TM\",\": Hi\"))))\u003c/code\u003e to split it into two lines. The line spacing is too big, and I applied the method \u003ccode\u003eaxis.title.x=element_text(lineheight=0.2)\u003c/code\u003e to change line spacing, but it did not change anything. The method was adapted from \u003ca href=\"https://stackoverflow.com/questions/13510971/change-interlinear-space-in-ggplot-title\"\u003ehere\u003c/a\u003e. My question is how to change line spacing for xlab. Thank you in advance!\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2015-03-02 13:01:23.56 UTC","favorite_count":"0","last_activity_date":"2015-03-02 13:33:02.683 UTC","last_edit_date":"2017-05-23 12:04:05.36 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"3211736","post_type_id":"1","score":"1","tags":"r|ggplot2|axis-labels","view_count":"340"} +{"id":"33699330","title":"Convert timestamp ISO to datetime in Python?","body":"\u003cp\u003eI am trying to convert an ISO timestamp column in my dataset to datetime. I'm able to successfully convert certain rows but others fail without a noticeable pattern.\u003c/p\u003e\n\n\u003cp\u003eHere is what my raw data looks like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e911 2015-10-15T12:39:36\n2520 2015-10-02T14:54:58\n2545 2015-09-18T21:07:40\n805 2015-10-28T17:17:22\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI try to run this code on it:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edatetime.strptime(orders['Timestamp'][58], \"%Y-%m-%dT%H:%M:%S\")\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSometimes it works and turns into datetime:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e2015-05-16 08:46:10\n2015-05-15 17:02:04\n2015-05-15 16:43:42\n2015-05-15 16:40:16\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eEvery 50 rows or so it throws up an error: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eKeyError Traceback (most recent call last)\n\u0026lt;ipython-input-130-2db5a7ab5914\u0026gt; in \u0026lt;module\u0026gt;()\n 1 for i in range(116, len(orders['Timestamp'])):\n----\u0026gt; 2 df_dt=datetime.strptime(orders['Timestamp'][i],\"%Y-%m-%dT%H:%M:%S\")\n 3 print df_dt\n\nc:\\python27\\lib\\site-packages\\pandas\\core\\series.pyc in __getitem__(self, key)\n 549 def __getitem__(self, key):\n 550 try:\n--\u0026gt; 551 result = self.index.get_value(self, key)\n 552 \n 553 if not np.isscalar(result):\n\nc:\\python27\\lib\\site-packages\\pandas\\core\\index.pyc in get_value(self, series, key)\n 1721 \n 1722 try:\n-\u0026gt; 1723 return self._engine.get_value(s, k)\n 1724 except KeyError as e1:\n 1725 if len(self) \u0026gt; 0 and self.inferred_type in ['integer','boolean']:\n\npandas\\index.pyx in pandas.index.IndexEngine.get_value (pandas\\index.c:3204)()\n\npandas\\index.pyx in pandas.index.IndexEngine.get_value (pandas\\index.c:2903)()\n\npandas\\index.pyx in pandas.index.IndexEngine.get_loc (pandas\\index.c:3843)()\n\npandas\\hashtable.pyx in pandas.hashtable.Int64HashTable.get_item (pandas\\hashtable.c:6525)()\n\npandas\\hashtable.pyx in pandas.hashtable.Int64HashTable.get_item (pandas\\hashtable.c:6463)()\n\nKeyError: 268L\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCan't tell why the other dates are successfully converted but not these (can't see a pattern):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e2015-05-30T22:25:52\n2015-03-04T03:57:51\n2013-11-22T22:28:23\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","accepted_answer_id":"33699420","answer_count":"2","comment_count":"3","creation_date":"2015-11-13 18:17:32.433 UTC","last_activity_date":"2015-11-13 19:05:18.58 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5559609","post_type_id":"1","score":"1","tags":"python|datetime|pandas","view_count":"193"} +{"id":"21025820","title":"Google Drive API / SDK, change owner using service account fails","body":"\u003cp\u003eI try to update the owner permission of some files in google drive using google drive api v2 programmatically.(like Google Admin Console does on \"Drive / Transfer Ownership\" form)\nI created a service account and use its ID combined with a super-admin account to create credentials and \"DriveService\" object.\nI able to list all files shared with me and enumerate the \"Owners\" collection of \"File\". Adding a new permission to a file (role=\"writer\") works fine. If I try to change the new permission to role =\"owner\" I get an INTERNAL ERROR 500.\u003c/p\u003e\n\n\u003cp\u003eHad anyone seen that error before and how can I work around?\u003c/p\u003e\n\n\u003cp\u003eThis is my code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e// ---------------------- BUILD CREDENTIALS -------------------------------\nGoogle.Apis.Auth.OAuth2.ServiceAccountCredential m_Creds = new ServiceAccountCredential(\n new ServiceAccountCredential.Initializer(\u0026lt;MY_SERVICE_ACCOUNT\u0026gt;)\n {\n Scopes = new[]\n {\n DriveService.Scope.Drive,\n DriveService.Scope.DriveFile,\n DriveService.Scope.DriveAppdata\n }\n ,\n User = \u0026lt;MY_ADMIN_ACCOUNT\u0026gt;\n }.FromCertificate(certificate));\n\n// ---------------------- BUILD CLIENTINIT -------------------------------\nvar myCInit = new BaseClientService.Initializer\n {\n ApplicationName = \"Testapplication\",\n HttpClientInitializer = m_Creds\n };\n\nstring myAccountname = \"Test User1\"; // accountname to look for\nstring myNewAccountEmail = \"Test.User2@mydomain.com\"; // email of new owner account\n\n// ---------------------- DRIVE SERVIVE CREATION -------------------------------\nvar myDService = new DriveService(myCInit);\n\n// ----------------------- GET THE FILE LIST------------------------------------ \nvar myFList = myDService.Files.List().Execute();\n\n foreach (Google.Apis.Drive.v2.Data.File currF in myFList.Items)\n {\n\n foreach (Google.Apis.Drive.v2.Data.User currUser in currF.Owners)\n {\n if (currUser.DisplayName.StartsWith(myAccountname))\n {\n // create new permission for new owner\n Permission p = new Permission();\n p.Role = \"writer\";\n p.Type = \"user\";\n p.Value = myNewAccountEmail;\n myDService.Permissions.Insert(p, currF.Id).Execute(); // works fine, creates new permission\n\n // get permission id \n var myNewID = myDService.Permissions.GetIdForEmail(myNewAccountEmail).Execute();\n\n // get my newly created permission\n p = myDService.Permissions.Get(currF.Id, myNewID.Id).Execute();\n p.Role = \"owner\";\n\n // create update request \n var myUpdR = myDService.Permissions.Update(p, currF.Id,myNewID.Id);\n myUpdR.TransferOwnership = true; // yes, we want to be an owner\n\n myUpdR.Execute(); // this call gets an \"internal error 500\"\n }\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny help is appreciated.\u003c/p\u003e\n\n\u003cp\u003eThx. TL\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2014-01-09 16:29:21.613 UTC","last_activity_date":"2014-02-23 18:34:38.103 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3178234","post_type_id":"1","score":"2","tags":"c#|android|google-drive-sdk","view_count":"885"} +{"id":"28747821","title":"How to change password reset messages in laravel 5?","body":"\u003cp\u003eHow to change laravel's \"The email field is required.\" on password reset page to my custom message? Cant find rules and messages for it\u003c/p\u003e","accepted_answer_id":"28747960","answer_count":"1","comment_count":"0","creation_date":"2015-02-26 16:36:52.263 UTC","last_activity_date":"2015-02-26 16:56:03.95 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1506183","post_type_id":"1","score":"0","tags":"laravel|laravel-routing|laravel-5","view_count":"790"} +{"id":"28425481","title":"Controller action not found","body":"\u003cp\u003eI am using web api in my application. Web api 2 routing is working fine but the controller action routing is not found.\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/0LPob.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003ethis is my global cs \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class MvcApplication : System.Web.HttpApplication\n{\n protected void Application_Start()\n {\n AreaRegistration.RegisterAllAreas();\n GlobalConfiguration.Configure(WebApiConfig.Register);\n FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);\n RouteConfig.RegisterRoutes(RouteTable.Routes);\n BundleConfig.RegisterBundles(BundleTable.Bundles);\n FluentValidationModelValidatorProvider.Configure();\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eRoute Config\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class RouteConfig\n{\n public static void RegisterRoutes(RouteCollection routes)\n {\n routes.IgnoreRoute(\"{resource}.axd/{*pathInfo}\");\n routes.MapRoute(\n name: \"Default\",\n url: \"{controller}\",\n defaults: new { controller = \"Default\", action = \"Index\", id = UrlParameter.Optional }\n );\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWeb api config\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic static class WebApiConfig\n{\n public static void Register(HttpConfiguration config)\n {\n config.MapHttpAttributeRoutes();\n\n config.Routes.MapHttpRoute(\n name: \"DefaultDataApi\",\n routeTemplate: \"Api/{controller}/{id}\",\n defaults: new { id = RouteParameter.Optional }\n );\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eController\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class LoginController : Controller\n{\n public ActionResult Index()\n {\n return View(\"~/Views/Default/Login.cshtml\");\n }\n\n public ActionResult LogOut()\n {\n var ctx = Request.GetOwinContext();\n var authManager = ctx.Authentication;\n\n authManager.SignOut(\"ApplicationCookie\");\n return RedirectToAction(\"index\", \"home\");\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"3","comment_count":"4","creation_date":"2015-02-10 06:29:48.133 UTC","last_activity_date":"2016-08-27 16:43:00.85 UTC","last_edit_date":"2016-08-27 16:43:00.85 UTC","last_editor_display_name":"","last_editor_user_id":"1905949","owner_display_name":"","owner_user_id":"1077346","post_type_id":"1","score":"0","tags":"asp.net-mvc|asp.net-web-api|routing|asp.net-mvc-routing","view_count":"6212"} +{"id":"665239","title":"What does the \"J\" in JApplet mean?","body":"\u003cp\u003eWhat does the \"J\" in JApplet mean?\u003c/p\u003e","answer_count":"4","comment_count":"0","creation_date":"2009-03-20 07:27:50.243 UTC","last_activity_date":"2017-02-15 17:51:41.37 UTC","last_edit_date":"2009-03-20 16:38:44.057 UTC","last_editor_display_name":"Alex Fort","last_editor_user_id":"12624","owner_display_name":"jaffar","owner_user_id":"80359","post_type_id":"1","score":"3","tags":"java|applet","view_count":"1965"} +{"id":"18257213","title":"Attaching listener to dialog","body":"\u003cp\u003eI need to be notified when there are changes on the screen. Currently I am using\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ethis.getWindow().getDecorView().getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener()\n {\n @Override\n public void onGlobalLayout()\n {\n Log.d(\"TAG\", \"GLOBAL LAYOUT\");\n }\n });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut it doesn't work when dialog(custom, alert, progress, etc.) is shown or dismissed. I understand that dialogs are shown on another overlay so listener isn't attached to them. How can I get my desired functionality? \u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-08-15 16:31:19.233 UTC","last_activity_date":"2013-08-15 16:40:19.8 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2394377","post_type_id":"1","score":"0","tags":"android","view_count":"57"} +{"id":"1545930","title":"Counting rows by the different date","body":"\u003cp\u003eI have a column of dates and a column of items.\u003c/p\u003e\n\n\u003cp\u003eHi Everyone\nI want to count the number of items for a certain date, how many of them are per day.\nColumn 1 Date - Column 2 - Items\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e01.09.2009 IT004  \n01.09.2009 IT004\n01.09.2009 IT005\n01.09.2009 IT006\n01.09.2009 IT006\n01.09.2009 IT006\n06.09.2009 IT004\n06.09.2009 IT004\n06.09.2009 IT005\n07.09.2009 IT004\n07.09.2009 IT005\n07.09.2009 IT005\n07.09.2009 IT006\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003chr\u003e\n\n\u003cpre\u003e\u003ccode\u003e 01.09.2009 06.09.2009 07.09.2009\nFor It004 2 2 1\nFor It005 1 1 2\nFor It006 3 0 1\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny help would be greatly appreciated and many thanks in advance.\u003c/p\u003e\n\n\u003cp\u003eAtanas\u003c/p\u003e","answer_count":"3","comment_count":"0","creation_date":"2009-10-09 20:35:20.057 UTC","last_activity_date":"2016-02-18 12:39:29.537 UTC","last_edit_date":"2016-02-18 12:39:29.537 UTC","last_editor_display_name":"","last_editor_user_id":"5514765","owner_display_name":"","owner_user_id":"187432","post_type_id":"1","score":"0","tags":"excel|vba|excel-vba","view_count":"296"} +{"id":"45116587","title":"Create 2D array with the same size as another array and initialize with zero in python","body":"\u003cp\u003eI have a 2D array in python, like the following:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e2d_array_1 =[[0,1],[1,0]]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd want to create a second array of the same size, with all values initialized to zero.\u003c/p\u003e\n\n\u003cp\u003eHow can I do that in python, if the size of the initial array can vary?\u003c/p\u003e","accepted_answer_id":"45116669","answer_count":"1","comment_count":"2","creation_date":"2017-07-15 09:21:43.227 UTC","last_activity_date":"2017-07-15 09:31:44.563 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1934212","post_type_id":"1","score":"-1","tags":"python|arrays","view_count":"51"} +{"id":"4850909","title":"Qt designer - how to create QDialog?","body":"\u003cp\u003eIt is possibility to create QDialog in Qt-creator like for example QForm (by clicking)? I've found several samples, but QDialog is created programmatically.\nI want to drag and drop buttons, listview and others components on QDialog.\nNow I can add new components only by modifying code.\u003c/p\u003e\n\n\u003cp\u003eThanks \u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2011-01-31 12:34:48.817 UTC","favorite_count":"1","last_activity_date":"2011-02-04 16:08:13.043 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"569987","post_type_id":"1","score":"7","tags":"qt-creator|qdialog","view_count":"3518"} +{"id":"14557558","title":"ios objective -c variables","body":"\u003cp\u003eThe following sample program, when using the variable working. When using more variables, the program mixed. Can you solve it without a variable?\nThe sample code ;\u003c/p\u003e\n\n\u003cp\u003etableView - didSelectRowAtIndexPath\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eint indexpath_row = 0;\nUITableView *table1;\n\n- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{\n\n if (tableView == self.searchDisplayController.searchResultsTableView) {\n indexpath_row = indexPath.row + 5;\n table1 = self.searchDisplayController.searchResultsTableView;\n }else{\n if (indexPath.section == 1) {\n indexpath_row = indexPath.row +1;\n table1 = self.tableView;\n }\n }\n\n\n myActionSheet.tag = tableView == self.tableView ? 10 : 11;\n [myActionSheet showFromTabBar:self.tabBarController.tabBar];\n\n // this example. normally you have more variables\n // ActionSheet or Alertview\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eActionSheet or Alertview\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e- (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex; {\n\n switch (buttonIndex) {\n case 1:{\n if (actionSheet.tag == 10)\n [self tableView:self.tableView accessoryButtonTappedForRowWithIndexPath:[NSIndexPath indexPathForRow:indexpath_row inSection:1]];\n else \n [self tableView:self.searchDisplayController.searchResultsTableView accessoryButtonTappedForRowWithIndexPath:[NSIndexPath indexPathForRow:indexpath_row inSection:1]];\n break;\n }\n case 2:{\n if (actionSheet.tag == 10)\n [self Run_Sub:table1 Satir_No:indexpath_row];\n else\n [self Run_Sub_Search:table1 Satir_No:indexpath_row];\n break;\n }\n //etc.\n\n default:\n break;\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCan we do without them? int indexpath_row and UITableView *table1.\nnsnotification as well as, Defining whether a location to another location would like to run. Is this possible?\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2013-01-28 07:43:51.873 UTC","last_activity_date":"2013-01-28 23:55:31.677 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1669335","post_type_id":"1","score":"-4","tags":"ios|objective-c|uitableview|uialertview|uiactionsheet","view_count":"90"} +{"id":"13105798","title":"ASP.NET: I'm having trouble getting file path's to work on my Master Page","body":"\u003cp\u003eI have a master page I made with a navigational menu. I use this master page on my file \u003ccode\u003edefault.aspx\u003c/code\u003e and also \u003ccode\u003epro/page.aspx\u003c/code\u003e. The image and link references don't match up depending on which page I'm on. I attempted something like \u003ccode\u003e~/page.aspx?function=a\u003c/code\u003e \u0026amp;\u0026amp; \u003ccode\u003e~/Images/menu/a.gif\u003c/code\u003e. However these don't work. I can get the paths to work in certain cases, but then they never work on the other page. Can anyone point me in the direction of a fix for this? Thanks!\u003c/p\u003e","answer_count":"1","comment_count":"5","creation_date":"2012-10-28 02:06:44.83 UTC","last_activity_date":"2012-10-28 02:26:38.317 UTC","last_edit_date":"2012-10-28 02:08:36.28 UTC","last_editor_display_name":"","last_editor_user_id":"142822","owner_display_name":"","owner_user_id":"394241","post_type_id":"1","score":"1","tags":"asp.net|vb.net|master-pages","view_count":"175"} +{"id":"43758423","title":"Service detection for .NET Core","body":"\u003cp\u003eCould you please suggest a method for \u003ccode\u003e.NET Core\u003c/code\u003e which is able to detect in runtime whether the code is executed within a service or not?\u003c/p\u003e\n\n\u003cp\u003eI have the working code for \u003ccode\u003e.NET Framework\u003c/code\u003e but I think it is impossible to port it because it is based on properties unavailable in \u003ccode\u003e.NET Core 1.1\u003c/code\u003e. \u003c/p\u003e","answer_count":"1","comment_count":"12","creation_date":"2017-05-03 11:13:09.133 UTC","last_activity_date":"2017-05-03 12:19:19.927 UTC","last_edit_date":"2017-05-03 11:18:56.76 UTC","last_editor_display_name":"","last_editor_user_id":"462639","owner_display_name":"","owner_user_id":"462639","post_type_id":"1","score":"0","tags":".net|service|.net-core","view_count":"153"} +{"id":"14036232","title":"Getting the offset to .text section code PE file format? VirtualAddress, PointerToRawData?","body":"\u003cp\u003eI've been trying to do this for about two days, with no success. I have been reading over many PE file format tutorials to no avail.\u003c/p\u003e\n\n\u003cp\u003eI map a 32 bit executable into memory via CreateFileMapping which works perfectly. My program then loops through the section headers, and checks the characteristics against my default characteristics (to make sure the section is executable and is code). If it is true the program returns the (PIMAGE_SECTION_HEADER) pointer to that section header (program works perfectly so far).\u003c/p\u003e\n\n\u003cp\u003eNow that I have the pointer, there are two specific entries to the structure that have baffled me, and that is PointerToRawData and VirtualAddress, when I cout the entries;\nVirtualSize = 4096, PointerToRawData = 1536.\u003c/p\u003e\n\n\u003cp\u003eFrom what I have read in PE documentation, is that PointerToRawData is a supposed offset (RVA???) to the first byte of data in the section on disk (am I correct?), and is a multiple of a alignment value (512). The question is what do I set this value to, to obtain a pointer which I can use to access the section's data. On a memory-mapped file would it be better to use (VirtualAddress value + the imagebase value) to find the first byte of the section?\u003c/p\u003e\n\n\u003cp\u003eAnother point of confusion is VirtualSize vs SizeOfRawData. This has confused me because in this article - \u003ca href=\"http://msdn.microsoft.com/en-us/library/ms809762.aspx\" rel=\"nofollow\"\u003ehttp://msdn.microsoft.com/en-us/library/ms809762.aspx\u003c/a\u003e, it says \"The SizeOfRawData field (seems a bit of a misnomer) later on in the structure holds the rounded up value\" yet my VirtualSize is greater than my SizeOfRawData value which has led to confusion on which one I should use.\u003c/p\u003e\n\n\u003cp\u003eThe object of this program is to find the executable section (.text section) and perform a bitwise operation on all the bits in the section, and end the operation before the next section.\u003c/p\u003e\n\n\u003cp\u003eI don't want it to seem like I expect a spoonfeed, I just want some clarifications.\u003c/p\u003e\n\n\u003cp\u003eThank you for your time/help, it is appreciated.\u003c/p\u003e","accepted_answer_id":"14036278","answer_count":"1","comment_count":"0","creation_date":"2012-12-26 05:12:38.843 UTC","last_activity_date":"2012-12-26 05:49:05.327 UTC","last_edit_date":"2012-12-26 05:18:24.53 UTC","last_editor_display_name":"","last_editor_user_id":"1850910","owner_display_name":"","owner_user_id":"1850910","post_type_id":"1","score":"0","tags":"c++|c|portable-executable","view_count":"1646"} +{"id":"31416051","title":"When to use deleteOnExit and not delete?","body":"\u003cp\u003eFirst of all I am not asking for difference between the two. I am wondering what will be a scenario where one will choose to use \u003ccode\u003edeleteOnExit()\u003c/code\u003e over \u003ccode\u003edelete()\u003c/code\u003e.\u003c/p\u003e","accepted_answer_id":"31416172","answer_count":"2","comment_count":"0","creation_date":"2015-07-14 19:52:23.593 UTC","last_activity_date":"2015-07-14 19:59:57.643 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3254669","post_type_id":"1","score":"1","tags":"java|io","view_count":"80"} +{"id":"17042930","title":"Android Supporting Multiple Screens","body":"\u003cp\u003eHi I created my own Android App. It worked well but when I tested it in multiple devices I noticed that it is not supporting Multiple Screens although my app call HTML files from assets directory .\u003c/p\u003e\n\n\u003cp\u003eActivity XML\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;TextView\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_centerHorizontal=\"true\"\n android:layout_centerVertical=\"true\"\n tools:context=\".ElarabyGroup\" /\u0026gt;\n\n \u0026lt;LinearLayout \n android:layout_width=\"match_parent\"\n android:layout_height=\"match_parent\"\u0026gt;\n\n \u0026lt;WebView android:id=\"@+id/web_engine\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"match_parent\"\u0026gt;\n \u0026lt;/WebView\u0026gt;\n \u0026lt;/LinearLayout\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eManifest\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;uses-sdk\n android:minSdkVersion=\"8\"\n android:targetSdkVersion=\"15\" /\u0026gt;\n\n\u0026lt;application\n android:icon=\"@drawable/ic_launcher\"\n android:label=\"@string/app_name\"\n android:theme=\"@style/AppTheme\" \u0026gt;\n \u0026lt;activity\n android:name=\".ElarabyGroup\"\n android:label=\"@string/title_activity_elaraby_group\" \u0026gt;\n \u0026lt;intent-filter\u0026gt;\n \u0026lt;action android:name=\"android.intent.action.MAIN\" /\u0026gt;\n\n \u0026lt;category android:name=\"android.intent.category.LAUNCHER\" /\u0026gt;\n \u0026lt;/intent-filter\u0026gt;\n \u0026lt;/activity\u0026gt;\n\u0026lt;/application\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"4","creation_date":"2013-06-11 11:25:42.723 UTC","last_activity_date":"2017-04-06 17:55:11.23 UTC","last_edit_date":"2013-06-11 11:31:11.643 UTC","last_editor_display_name":"","last_editor_user_id":"1522562","owner_display_name":"","owner_user_id":"1644081","post_type_id":"1","score":"1","tags":"android|android-layout","view_count":"106"} +{"id":"16766658","title":"counting the number of items in an array","body":"\u003cp\u003eI have a string as shown bellow:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSIM types:Azadi|Validity:2 Nights|Expirable:yes\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have the following code to seperate them by \u003ccode\u003e|\u003c/code\u003e and then show them line by line\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$other = \"SIM types:Azadi|Validity:2 Nights|Expirable:yes\";\n\n$others['items'][] = explode(\"|\",$other);\nfor($i = 0; $i \u0026lt; count($others['items']); $i++){\n echo $others['items'][$i];\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut the \u003ccode\u003efor\u003c/code\u003e loop is iterated only once and prints only the first value. This is what i am getting now:\u003c/p\u003e\n\n\u003cp\u003eSIM types:Azadi\u003c/p\u003e","accepted_answer_id":"16766660","answer_count":"3","comment_count":"0","creation_date":"2013-05-27 05:13:02.42 UTC","last_activity_date":"2013-05-27 05:52:32.857 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1764442","post_type_id":"1","score":"0","tags":"php|arrays","view_count":"80"} +{"id":"29319869","title":"C++ : Using void to create variables","body":"\u003cp\u003eI am learning C++ on my own from the internet. I was wondering if you can create a variable of the \u003ccode\u003evoid\u003c/code\u003e type. If so , how can you? Also what will be these variables used for? \u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eThis does not work:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evoid b;\ncout\u0026lt;\u0026lt;b;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eError:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eSize of b is unknown or zero\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eThanks :)\u003c/p\u003e","answer_count":"6","comment_count":"12","creation_date":"2015-03-28 16:52:25.403 UTC","favorite_count":"1","last_activity_date":"2015-03-28 19:21:44.343 UTC","last_editor_display_name":"","owner_display_name":"user4682149","post_type_id":"1","score":"3","tags":"c++","view_count":"195"} +{"id":"35816847","title":"rails updating a user's record by their email","body":"\u003cp\u003eI have an app with an account model and an account manager (user). \u003c/p\u003e\n\n\u003cp\u003eI would like the account manager to be able to add other users to the account by typing in their email. \u003c/p\u003e\n\n\u003cp\u003eThe account id of the account manager should be added to the new user's record. \u003c/p\u003e\n\n\u003cp\u003eMy model looks like \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass Account \u0026lt; ActiveRecord::Base\n has_many users\n ...\nend\n\nclass User \u0026lt; ActiveRecord::Base\n belongs_to account\n ...\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn the console it's fairly simple. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eu = User.find(2) \nu.update_attributes(account_id: 1)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut I'm not sure how to do this on the site. \u003c/p\u003e\n\n\u003cp\u003eI have the below partial which renders fine but when I put an email in the box nothing happens. \u003c/p\u003e\n\n\u003cp\u003eI get the message, user not added.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;h4\u0026gt;Add User\u0026lt;/h4\u0026gt;\n\u0026lt;div class = \"row\"\u0026gt;\n \u0026lt;div class=\"col-md-6 col-md-offset-3\"\u0026gt;\n \u0026lt;%= form_for(:add_user, url: add_users_path) do |f| %\u0026gt;\n \u0026lt;%= f.hidden_field @account = Account.find(params[:id]) %\u0026gt;\n \u0026lt;%= f.label :email %\u0026gt;\n \u0026lt;%= f.email_field :email, class:'form-control' %\u0026gt;\n \u0026lt;%= f.submit \"Submit\", class: \"btn btn-primary\" %\u0026gt;\n \u0026lt;% end %\u0026gt;\n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI don't necessarily want/need to route to another page for example \"url: add_users_path\" but without that line the code breaks and won't render.\u003c/p\u003e\n\n\u003cp\u003eI added this to user.rb\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef add_user_to_account\n update_attribute(:account_id)\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI also created this controller \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass AddUsersController \u0026lt; ApplicationController\n before_action :get_user, only: [:edit, :update]\n\n def new\n end\n\n def edit\n end\n\n def create\n @user = User.find_by(email: params[:email])\n if @user\n @user.add_user_to_account\n flash[:info] = \"Added User to Account\"\n redirect_to accounts_url\n else \n flash[:danger] = \"User NOT Added\"\n redirect_to accounts_url\n end \n end\n\n def update\n if params[:user][:account_id].empty?\n @user.errors.add(:account_id, \"can't be empty\")\n render 'edit'\n elsif @user.update_attributes(user_params)\n log_in @user\n flash[:success] = \"Account Updated\"\n redirect_to @user\n else\n render 'edit'\n end\n end \n\n\n private\n\n def user_params\n params.require(:user).permit(:account_id, :user_id)\n end\n\n def get_user\n @user = User.find_by(email: params[:email])\n end\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAm I on the right track? Is there a better way to do this? \u003c/p\u003e\n\n\u003cp\u003eUPDATE: Added schema\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecreate_table \"accounts\", force: :cascade do |t|\n t.string \"name\"\n t.integer \"account_manager_id\"\n t.integer \"subscription_id\"\n t.datetime \"created_at\", null: false\n t.datetime \"updated_at\", null: false\n end\n\ncreate_table \"users\", force: :cascade do |t|\n t.string \"name\"\n t.string \"password_digest\", null: false\n t.string \"remember_digest\"\n t.string \"email\", null: false\n t.string \"activation_digest\"\n t.boolean \"activated\"\n t.datetime \"activated_at\"\n t.string \"reset_digest\"\n t.datetime \"reset_sent_at\"\n t.datetime \"created_at\", null: false\n t.datetime \"updated_at\", null: false\n t.boolean \"access_granted\"\n t.boolean \"requested_access\"\n t.string \"slug\"\n t.integer \"account_id\"\n end\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"35817769","answer_count":"1","comment_count":"2","creation_date":"2016-03-05 16:47:22.28 UTC","last_activity_date":"2016-03-05 18:49:36.6 UTC","last_edit_date":"2016-03-05 18:08:03.977 UTC","last_editor_display_name":"","last_editor_user_id":"1380867","owner_display_name":"","owner_user_id":"5807685","post_type_id":"1","score":"1","tags":"ruby-on-rails|associations","view_count":"25"} +{"id":"35017936","title":"http access to a specific folder in a full https enabled directory through .htaccess","body":"\u003cp\u003eI have enforced https access to the www directory and all subdirectories by rewrite rule in .htaccess - \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eRewriteEngine On\nRewriteCond %{HTTPS} off\nRewriteRule (.*) https://%{SERVER_NAME}/%$1 [R,L]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, I need http access to one specific folder /specific/folder/ which is under www directory. How can I do that with rewriting rule in .htaccess? \u003c/p\u003e","accepted_answer_id":"35018258","answer_count":"1","comment_count":"0","creation_date":"2016-01-26 15:47:38.073 UTC","last_activity_date":"2016-01-26 16:02:33.87 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"94106","post_type_id":"1","score":"1","tags":"apache|.htaccess","view_count":"35"} +{"id":"29566129","title":"c# WPF Tree View Item conditional styling","body":"\u003cp\u003eHow do you conditionally style \u003ccode\u003etreeviewitems\u003c/code\u003eon binded properties\u003c/p\u003e\n\n\u003cp\u003eI'm running into an issue where I want to style items in a Tree View, those that are valid selections vs hierarchy items.\u003c/p\u003e\n\n\u003cp\u003eI've tried to move my \u003ccode\u003estyle\u003c/code\u003e tag into a \u003ccode\u003eTreeView.Resources\u003c/code\u003e and a \u003ccode\u003eTreeView.ItemContainerStyle\u003c/code\u003e tag but it still doesn't cause any formatting.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;TabItem Name=\"Queries\" Header=\"Queries\" \n d:DataContext=\"{d:DesignInstance views:QuerySettingsView}\"\u0026gt;\n \u0026lt;Grid\u0026gt;\n \u0026lt;TreeView ItemsSource=\"{Binding QueryTreeModels}\" \n Width=\"500\" Height=\"200\" VerticalAlignment=\"Top\" \n HorizontalAlignment=\"Center\" Margin=\"0,0,175,0\"\u0026gt;\n \u0026lt;TreeView.ItemTemplate\u0026gt;\n \u0026lt;HierarchicalDataTemplate ItemsSource=\"{Binding Children}\"\u0026gt;\n \u0026lt;HierarchicalDataTemplate.ItemContainerStyle\u0026gt;\n \u0026lt;Style \u0026gt;\n \u0026lt;Setter Property=\"TreeViewItem.IsExpanded\" \n Value=\"{Binding IsExpanded, Mode=TwoWay}\" /\u0026gt;\n \u0026lt;Setter Property=\"TreeViewItem.IsSelected\" \n Value=\"{Binding IsSelected, Mode=TwoWay}\" /\u0026gt;\n \u0026lt;Style.Triggers\u0026gt;\n \u0026lt;DataTrigger Binding=\"{Binding IsQuery}\"\u0026gt;\n \u0026lt;Setter Property=\"TextBlock.Foreground\" Value=\"Chartreuse\" /\u0026gt;\n \u0026lt;/DataTrigger\u0026gt;\n \u0026lt;DataTrigger Binding=\"{Binding IsFolder}\"\u0026gt;\n \u0026lt;Setter Property=\"TextBlock.Foreground\" Value=\"Crimson\" /\u0026gt;\n \u0026lt;/DataTrigger\u0026gt;\n \u0026lt;/Style.Triggers\u0026gt;\n \u0026lt;/Style\u0026gt;\n \u0026lt;/HierarchicalDataTemplate.ItemContainerStyle\u0026gt;\n \u0026lt;TextBlock Text=\"{Binding Name}\"/\u0026gt;\n \u0026lt;/HierarchicalDataTemplate\u0026gt;\n \u0026lt;/TreeView.ItemTemplate\u0026gt;\n \u0026lt;/TreeView\u0026gt;\n \u0026lt;/Grid\u0026gt;\n\u0026lt;/TabItem\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"29566712","answer_count":"1","comment_count":"4","creation_date":"2015-04-10 16:16:10.403 UTC","last_activity_date":"2015-04-16 16:41:20.203 UTC","last_edit_date":"2015-04-16 16:41:20.203 UTC","last_editor_display_name":"","last_editor_user_id":"3846633","owner_display_name":"","owner_user_id":"3846633","post_type_id":"1","score":"1","tags":"c#|wpf|treeview|styles|conditional","view_count":"1293"} +{"id":"42087120","title":"Efficient way to get email name","body":"\u003cp\u003eI had a task of extracting the email name from fullname as below ( and my code to deal with it)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elist_=['peter mary','peter mary david ','pop david','peter pop ronaldo bulma']\nsr=pd.Series(list_,range(4))\nsr_split=sr.str.split()\nfirst_name=sr_split.str[-1]\nother_name=sr_split.str[0:-1]\nother_name=other_name.str.join(' ')\nother_=other_name.str.split(expand=True)\nother_.fillna(' ',inplace=True)\nadd_name=other_[0].str[0]+other_[1].str[0]+other_[2].str[0]\nemail_name=pd.concat([first_name,add_name],axis=1)\nemail_name[2]=email_name[0]+email_name[1]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy code returned:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emaryp, davidpm,davidp,bulmappr \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt worked as my expectation.However,there are 2 problems with my code:\n 1) Use a lot of split and join\n 2) Can not work with long name, say : name with 10 words\u003c/p\u003e\n\n\u003cp\u003eIs it a way to make it better?\u003c/p\u003e","answer_count":"2","comment_count":"1","creation_date":"2017-02-07 10:14:25.793 UTC","last_activity_date":"2017-02-07 11:38:50.837 UTC","last_edit_date":"2017-02-07 10:27:43.443 UTC","last_editor_display_name":"","last_editor_user_id":"7305975","owner_display_name":"","owner_user_id":"7305975","post_type_id":"1","score":"0","tags":"string|pandas","view_count":"38"} +{"id":"47134182","title":"Copy changed SVN Files in Jenkins to another Directory","body":"\u003cp\u003eI've asked two questions before, but none of them were answered. Thats why I try another approach of my problem.\u003c/p\u003e\n\n\u003cp\u003eHow can I copy only the changed source files to another directory after updating my Workspace with the SVN-Plugin?\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-11-06 09:58:03.457 UTC","last_activity_date":"2017-11-06 09:58:03.457 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6769220","post_type_id":"1","score":"0","tags":"jenkins|svn|version-control|copy","view_count":"13"} +{"id":"46634357","title":"How to write data to a specific shard in Kinesis","body":"\u003cp\u003eHow do I write data to a specific shard in Kinesis?\u003c/p\u003e\n\n\u003cp\u003eThe Boto docs say\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003ePartition keys are Unicode strings, with a maximum length limit of 256 characters for each key. An MD5 hash function is used to map partition keys to 128-bit integer values and to map associated data records to shards using the hash key ranges of the shards. You can override hashing the partition key to determine the shard by explicitly specifying a hash value using the ExplicitHashKey parameter. \u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eHowever how do I actually do this?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-10-08 18:05:51.78 UTC","last_activity_date":"2017-10-08 20:42:36.737 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3176550","post_type_id":"1","score":"0","tags":"python|amazon-kinesis","view_count":"15"} +{"id":"3261264","title":"Create a custom file extenstion in VB 2008","body":"\u003cp\u003eI have been doing a lot of searching on the web and cant seem to find a clear way of creating a custom file extentsion. I know to associate the file extension to a certain program, but how do create a format for the custom file extension?\u003c/p\u003e","accepted_answer_id":"3261350","answer_count":"1","comment_count":"0","creation_date":"2010-07-16 01:15:25.27 UTC","last_activity_date":"2010-07-16 01:37:48.213 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"393385","post_type_id":"1","score":"0","tags":"vb.net|file-extension","view_count":"974"} +{"id":"42013619","title":"Heroku/angular2 deploy pathlocation issue","body":"\u003cp\u003eI am trying to deploy an angular app to heroku. In angular I am using pathLocationStrategy.\nAfter pushing the app satisfactorily, I receive 404 response at \"/\".\nI tried \u003cpre\u003e__dirname + '/../dist'\u003c/pre\u003e as well as \u003cpre\u003e__dirname + '/dist'\u003c/pre\u003e without any success. I would be very grateful to anyone could help me unstuck.\nThe path is app-folder/dist/index.html\u003c/p\u003e\n\n\u003cp\u003eLogs from heroku: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e2017-02-02T22:29:43.050820+00:00 heroku[router]: at=info method=GET \npath=\"/\" host=pure-cliffs-63499.herokuapp.com \nrequest_id=4c1a1eb8-3cc0-45e7-8ce1-c283478811ca fwd=\"94.254.144.97\" \ndyno=web.1 connect=0ms service=20ms status=404 bytes=240\n\n2017-02-02T22:29:43.051351+00:00 app[web.1]: Error: ENOENT: no such file \nor directory, stat '/app/dist/index.html'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy server/express:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003econst forceSSL = function() {\n return function (req, res, next) {\nif (req.headers['x-forwarded-proto'] !== 'https') {\n return res.redirect(['https://', req.get('Host'), req.url].join(''));\n}\n next();\n }\n}\n\napp.use(forceSSL());\napp.use(express.static(__dirname + '/dist'));\napp.get('/*', function(req, res) {\n res.sendFile(path.join(__dirname + '/dist/index.html'));\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eApp-tree:\n\u003ca href=\"https://i.stack.imgur.com/spdSw.png\" rel=\"nofollow noreferrer\"\u003eApp-tree\u003c/a\u003e\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2017-02-02 22:35:51.36 UTC","last_activity_date":"2017-02-02 22:35:51.36 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7508380","post_type_id":"1","score":"0","tags":"angular|heroku","view_count":"47"} +{"id":"21249620","title":"Django same name multiple input insert to DB","body":"\u003cp\u003eI have multiple same name inputs. html created with jquery and json. \u003c/p\u003e\n\n\u003cp\u003eHTML\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;input type=\"text\" name=\"product_id\" value=\"xyz\" /\u0026gt;\n\u0026lt;p class=\"left\"\u0026gt;\n \u0026lt;label class=\"name\"\u0026gt;General\u0026lt;/label\u0026gt; \n \u0026lt;input type=\"hidden\" value=\"2\" name=\"location_id\"\u0026gt;\n \u0026lt;input type=\"text\" name=\"location_stock\" placeholder=\"Quantity\" class=\"text small right\" value=\"5\"\u0026gt;\n\u0026lt;/p\u0026gt;\n\u0026lt;p class=\"left\"\u0026gt;\n \u0026lt;label class=\"name\"\u0026gt;warehouse 1\u0026lt;/label\u0026gt;\n \u0026lt;input type=\"hidden\" value=\"5\" name=\"location_id\"\u0026gt;\n \u0026lt;input class=\"text small right\" type=\"text\" name=\"location_stock\" placeholder=\"Quantity\" value=\"7\"\u0026gt;\n\u0026lt;/p\u0026gt;\n\u0026lt;p class=\"left\"\u0026gt;\n \u0026lt;label class=\"name\"\u0026gt;warehouse 2\u0026lt;/label\u0026gt;\n \u0026lt;input type=\"hidden\" value=\"6\" name=\"location_id\"\u0026gt;\n \u0026lt;input class=\"text small right\" type=\"text\" name=\"location_stock\" placeholder=\"Quantity\" value=\"8\"\u0026gt;\n\u0026lt;/p\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eJson\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$.getJSON(url, function(models) {\n var options = '';\n for (var i = 0; i \u0026lt; models.length; i++) {\n options += '\u0026lt;p class=\"left\"\u0026gt;\u0026lt;label class=\"name\"\u0026gt;' + models[i].fields['name'] + '\u0026lt;/label\u0026gt;\u0026lt;/span\u0026gt; \u0026lt;input type=\"hidden\" name=\"location_id\" value=\"' + models[i].pk + '\" /\u0026gt;\u0026lt;input type=\"text\" class=\"text small right\" placeholder=\"Quantity\" name=\"location_stock\" /\u0026gt;\u0026lt;/p\u0026gt;' \n }\n $(\".widget.stock_details\").append(options);\n $(\"#stock_locations option:first\").attr('selected', 'selected');\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want insert this to mysql table like this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eproduct_id = xyz , location_id=2, stock=5\nproduct_id = xyz , location_id=5, stock=7\nproduct_id = xyz , location_id=6, stock=8\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat is the method?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef add_new(request): \n product_id = request.POST.get('product_id')\n location_id = request.POST.get('location_id')\n stock = request.POST.get('location_stock')\n p = Products_stock(product_id=product_id,location_id=location_id,stock=stock)\n p.save()\n response_data = {}\n response_data['status'] = 'true'\n response_data['message'] = 'success'\n return HttpResponse(json.dumps(response_data), mimetype='application/javascript')\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"21251675","answer_count":"1","comment_count":"0","creation_date":"2014-01-21 05:08:19.907 UTC","last_activity_date":"2014-01-21 08:52:04.41 UTC","last_edit_date":"2014-01-21 05:15:58.697 UTC","last_editor_display_name":"","last_editor_user_id":"1686265","owner_display_name":"","owner_user_id":"1686265","post_type_id":"1","score":"0","tags":"python|mysql|django","view_count":"466"} +{"id":"30381710","title":"How to Compare two DataTables and Return another DataTable3 with the rows that only exist in the second DataTable?","body":"\u003cp\u003eI have two DataTables DT1 y DT2. DT1 has two rows and DT2 has three rows. In both DataTables row1 and row 2 have the same columns and values. But row3 not exist in the DT1, it will be my result.\u003c/p\u003e\n\n\u003cp\u003eDT1: row1, row2\u003c/p\u003e\n\n\u003cp\u003eDT2: row1, row2, row3 \u003c/p\u003e\n\n\u003cp\u003eRes: DT3: row3\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2015-05-21 18:32:37.913 UTC","last_activity_date":"2015-05-21 19:23:32.863 UTC","last_edit_date":"2015-05-21 19:07:37.767 UTC","last_editor_display_name":"","last_editor_user_id":"4438571","owner_display_name":"","owner_user_id":"4438571","post_type_id":"1","score":"-3","tags":"vb.net|linq|datatables|rows|not-exists","view_count":"849"} +{"id":"27857485","title":"Spring: Error with Bean Aliasing","body":"\u003cp\u003eI got the following exception while Running my Spring Application:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eJan 09, 2015 2:47:33 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions\nINFO: Loading XML bean definitions from class path resource [com/amscoder/ba/common/application-context.xml]\nException in thread \"main\" org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'agent' is defined\n at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:570)\n at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1114)\n at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:279)\n at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198)\n at com.amscoder.ba.test.RobotTest.main(RobotTest.java:15)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cb\u003eMy Spring Bean Configuration File is \u003c/b\u003e:\"application-context.xml\"\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" encoding=\"utf-8\"?\u0026gt;\n\u0026lt;beans xmlns=\"http://www.springframework.org/schema/beans\"\nxmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\nxsi:schemaLocation=\"\nhttp://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd\"\u0026gt;\n\u0026lt;bean id=\"robot\" class=\"com.amscoder.ba.beans.Robot\"\u0026gt;\n \u0026lt;property name=\"id\" value=\"101\" /\u0026gt;\n \u0026lt;property name=\"name\" value=\"Robot-1\" /\u0026gt;\n\u0026lt;/bean\u0026gt;\n\n\u0026lt;alias name=\"agent\" alias=\"robot\" /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eActually i want to give multiple names to my bean.\u003cbr\u003e\nCan anyone help me in resolve the error.\u003c/p\u003e","accepted_answer_id":"27857576","answer_count":"1","comment_count":"0","creation_date":"2015-01-09 09:31:39.087 UTC","last_activity_date":"2015-01-09 09:36:08.257 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3950458","post_type_id":"1","score":"0","tags":"java|spring","view_count":"137"} +{"id":"12152401","title":"iOS 5 return to initial nib view resembling a sign out button","body":"\u003cp\u003ethis if my first post so please be gentle.\u003c/p\u003e\n\n\u003cp\u003eI have an \u003ccode\u003eiOS 5\u003c/code\u003e app (using storyboards) where I want the user to have the ability to sign out, and with that reset all settings in the app, and also return the user to the very first nib view.\u003c/p\u003e\n\n\u003cp\u003eI have already used this code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[self.navigationController popViewControllerAnimated:YES];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand the problem with this is that it only sends the user back 1 view and not several.\nThe issue with this is that I have multiple table views that derive from each other and I want the Sign Out button to remain visible in every single one of these detailed views.\nAlso, this has to work on both \u003ccode\u003eiPhone\u003c/code\u003e and \u003ccode\u003eiPad\u003c/code\u003e (Universal)\u003c/p\u003e\n\n\u003cp\u003eAny suggestions?\nThanx.\u003c/p\u003e","accepted_answer_id":"12201650","answer_count":"2","comment_count":"0","creation_date":"2012-08-28 03:32:23.13 UTC","last_activity_date":"2013-12-18 04:30:16.173 UTC","last_edit_date":"2013-12-18 04:30:16.173 UTC","last_editor_display_name":"","last_editor_user_id":"1289595","owner_display_name":"","owner_user_id":"1564652","post_type_id":"1","score":"0","tags":"ios5","view_count":"77"} +{"id":"39756335","title":"How to configure SSL Certificates in Postman App for Windows 7 64 bit?","body":"\u003cp\u003eHow to configure SSL Certificates in Postman App for Windows. I have installed Postman App for Windows 7 64bit. I have certificate format of P12 and PEM. If i supply that in Postman Settings --\u003e Certificates tab in CRT file. But, did not get the certificate by postman. what is wrong ?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-09-28 19:42:16.747 UTC","last_activity_date":"2017-06-21 14:54:47.25 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5870086","post_type_id":"1","score":"1","tags":"postman","view_count":"1305"} +{"id":"9277270","title":"Using a dash in a xpath does not work in py-dom-xpath","body":"\u003cp\u003eI'm curreny using \u003ca href=\"http://code.google.com/p/py-dom-xpath/downloads/list\" rel=\"nofollow\"\u003epy-dom-xpath\u003c/a\u003e with python 2.7.2 under Debian 4.1.1-21.\u003cbr\u003e\nEverything works pretty well, instead of one XML element.\u003c/p\u003e\n\n\u003cp\u003eWhenever I try to check a XML document for a xpath like \u003ccode\u003e//AAA/BBB/CCC-DDD\u003c/code\u003e the path is not found. It's the only node with a dash \u003ccode\u003e-\u003c/code\u003e in it. I already tried to escape the dash, but that didn't work.\u003c/p\u003e\n\n\u003cp\u003eI also tried \u003ccode\u003e//*[name()='CCC-DDD']\u003c/code\u003e and the \u003ccode\u003estarts-with\u003c/code\u003e and \u003ccode\u003econtains\u003c/code\u003e statement. The element is definately in the XML and the spelling is also correct.\u003c/p\u003e\n\n\u003cp\u003eI tried an \u003ca href=\"http://chris.photobooks.com/xml/default.htm\" rel=\"nofollow\"\u003eonline xpath validation site\u003c/a\u003e, and it works flawless there, even with the dash.\u003c/p\u003e\n\n\u003cp\u003eAny help is appreciated.\u003c/p\u003e","answer_count":"2","comment_count":"4","creation_date":"2012-02-14 12:59:48.477 UTC","favorite_count":"1","last_activity_date":"2014-02-22 12:13:19.207 UTC","last_edit_date":"2012-02-14 13:11:47.26 UTC","last_editor_display_name":"","last_editor_user_id":"190597","owner_display_name":"","owner_user_id":"1209099","post_type_id":"1","score":"3","tags":"python|xml|xpath","view_count":"865"} +{"id":"40440645","title":"Angular2 - How to bind radio buttons to boolean object properties","body":"\u003cp\u003eI have a pretty simple model that looks like this: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eexport class Answer {\n\n constructor(public text: string, public isCorrect: boolean = false) {\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand I want to bind it to a radio button in such a way that if the radio button is selected, the \u003ccode\u003eisCorrect\u003c/code\u003e property is \u003ccode\u003etrue\u003c/code\u003e, otherwise it is \u003ccode\u003efalse\u003c/code\u003e. What is the proper way to go about this?\u003c/p\u003e\n\n\u003cp\u003eTo be clear, I would have an array of \u003ccode\u003eAnswer\u003c/code\u003es, and each \u003ccode\u003eAnswer\u003c/code\u003e would have a single radio button.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://plnkr.co/edit/euuOC2Ir6qMViSvcbsYA?p=preview\" rel=\"nofollow noreferrer\"\u003ePlnkr Example\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eMy template so far looks like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;label *ngFor=\"let answer of answers\"\u0026gt;\n \u0026lt;input #rad type=\"radio\" name=\"answer-{{questionIndex}}\" [(ngModel)]=\"answer.isCorrect\" [value]=\"rad.checked\"\u0026gt;\n {{answer.text}}\n\u0026lt;/label\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"7","creation_date":"2016-11-05 16:37:14.91 UTC","last_activity_date":"2016-11-06 00:23:43.873 UTC","last_edit_date":"2016-11-06 00:23:43.873 UTC","last_editor_display_name":"","last_editor_user_id":"3180489","owner_display_name":"","owner_user_id":"5146243","post_type_id":"1","score":"1","tags":"angular","view_count":"496"} +{"id":"31617070","title":"How do I force-delete a file on my computer?","body":"\u003cp\u003eI am using Mac OS X El Capitan Public Beta 2.\u003c/p\u003e\n\n\u003cp\u003eThere is somehow a permission problem with my Desktop (and only this directory) because I can not delete any file. \u003c/p\u003e\n\n\u003cp\u003eThe classic delete to bin does not work, even though I am prompted a window asking for my password and permission. (I am the administrator).\u003c/p\u003e\n\n\u003cp\u003eI also tried a few command lines like \u003ccode\u003esudo rm - R *file*\u003c/code\u003e and it tells me that the operation is not permitted even after I enter my password.\u003c/p\u003e\n\n\u003cp\u003eGoing without the rootless feature of El Capitan did not help either :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esudo nvram boot-args=\"rootless=0\" \nsudo reboot\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eShould I change the permissions of the Desktop directory? If so what are the original ones? \u003c/p\u003e\n\n\u003cp\u003eThank you!\u003c/p\u003e","accepted_answer_id":"31794106","answer_count":"2","comment_count":"0","creation_date":"2015-07-24 18:07:29.87 UTC","last_activity_date":"2015-08-03 18:18:31.187 UTC","last_edit_date":"2015-07-24 19:23:29.113 UTC","last_editor_display_name":"","last_editor_user_id":"3867406","owner_display_name":"","owner_user_id":"3867406","post_type_id":"1","score":"-1","tags":"osx|unix|permissions|delete-file","view_count":"1043"} +{"id":"8316452","title":"Javascript loading an image on hover over a link","body":"\u003cp\u003ei am new to java script and i am designing my web site but i want to load a new image on a particular place of my web page when a user hover over the home,here is the code.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;html\u0026gt;\n \u0026lt;head\u0026gt;\n \u0026lt;/head\u0026gt;\n \u0026lt;body\u0026gt;\n \u0026lt;img src=\"yourImage.jpg\" alt=\"Home\" id=\"image1\" onmouseover=\"image1.src='home.jpg';\" onmouseout=\"image1.src='myImage.jpg';\" /\u0026gt; \u0026lt;br /\u0026gt;\n \u0026lt;a href=\"#\" onmouseover=image1.src='home.jpg';\" onmouseout=\"image1.src='yourImage.jpg';\"\u0026gt;Hoover Me!\u0026lt;/a\u0026gt;\n \u0026lt;/body\u0026gt;\n \u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis code is not working.Please Help me to find out the error in code.\u003c/p\u003e","accepted_answer_id":"8316590","answer_count":"5","comment_count":"0","creation_date":"2011-11-29 19:20:59.16 UTC","favorite_count":"7","last_activity_date":"2011-11-29 19:32:00.773 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1067051","post_type_id":"1","score":"0","tags":"javascript","view_count":"4605"} +{"id":"31615121","title":"Factory returning same value","body":"\u003cp\u003eI am trying to get songs from soundcloud, I am using some input to set value and send it to my factory to get all the related list of songs and display it.\nThe issue is the the first time all works correctly, but when I am trying to input new values I am getting same results as first time.\u003c/p\u003e\n\n\u003cp\u003eMy code looks like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e.controller('DashCtrl', function ($scope, SongsService) {\n $scope.formData = {};\n $scope.searchSong = function () {\n SongsService.setData($scope.formData.songName);\n };\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eUPDATE\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003ethe factory :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e.factory('SongsService', function ($rootScope) {\n var List = {};\n List.setData = function (tracks) {\n\n var page_size = 6;\n SC.get('/tracks', {limit: page_size, linked_partitioning: 1}, function (tracks) {\n // page through results, 100 at a time\n List = tracks;\n $rootScope.$broadcast('event:ItemsReceived');\n });\n };\n List.getItems = function () {\n return List;\n };\n return List;\n }).value('version', '0.1');\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks for help!\u003c/p\u003e","accepted_answer_id":"31635625","answer_count":"3","comment_count":"2","creation_date":"2015-07-24 16:07:36.29 UTC","last_activity_date":"2015-07-26 09:49:40.543 UTC","last_edit_date":"2015-07-24 17:33:31.743 UTC","last_editor_display_name":"","last_editor_user_id":"844039","owner_display_name":"","owner_user_id":"844039","post_type_id":"1","score":"2","tags":"javascript|angularjs|ionic","view_count":"66"} +{"id":"12257690","title":"Sort by group in a table that join with another","body":"\u003cp\u003eI have 2 tables, where one is lookup table while the other is a transaction log.\u003cbr\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eLookup table User: UserId, Name and Department.\nTransaction log table EntryLog: LogID, UserId, TimeIn, TimeOut\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am trying to retrieve a report to view the last seen time (TimeIn or TimeOut) of ALL the User (which is unique) in the User table.\u003c/p\u003e\n\n\u003cp\u003eI tried the follow query but doesn't seen to work:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT DISTINCT (A.UserID), TimeIn, TimeOut, B.Name, B.Department FROM EntryLog A\n INNER JOIN User B ON B.UserId = A.UserId\n ORDER BY TimeOut DESC, TimeIn DESC\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSomehow the result seem to retrieve all the records from the transaction Log (including repeated UserId). I am not good in SQL statement and being searching for similar issue without avail.\nAny advise is much appreciated. Thank You in advance.\u003c/p\u003e","answer_count":"5","comment_count":"2","creation_date":"2012-09-04 06:09:19.327 UTC","last_activity_date":"2012-09-04 06:20:03.503 UTC","last_edit_date":"2012-09-04 06:12:43.31 UTC","last_editor_display_name":"","last_editor_user_id":"1369235","owner_display_name":"","owner_user_id":"1645171","post_type_id":"1","score":"0","tags":"asp.net|sql|vb.net","view_count":"94"} +{"id":"2719673","title":"API Key Error in Facebook Connect (javascript sdk)","body":"\u003cp\u003eI am trying to implement Facebook Connect on a website. I am trying to work with Javascript SDK of Facebok. I am new to it and unfortunately most of links provided in Facebook WIKI are out of date... Returning 404 not found. Anyway I added this code before the ending \u003ccode\u003e\u0026lt;/body\u0026gt;\u003c/code\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;script src=\"http://static.ak.fbcdn.net/connect.php/js/FB.Share\" type=\"text/javascript\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;div id=\"fb-root\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;script src=\"http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php\" type=\"text/javascript\"\u0026gt; \u0026lt;/script\u0026gt;\n \u0026lt;script src=\"http://connect.facebook.net/en_US/all.js\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;script\u0026gt;\n FB.init({\n appId : '12344', // my real app id is here\n status : true, // check login status\n cookie : true, // enable cookies to allow the server to access the session\n xfbml : false // parse XFBML\n });\n\n FB.login(function(response) {\n if (response.session) {\n if (response.perms) {\n alert('user is logged in and granted some permissions');\n // user is logged in and granted some permissions.\n // perms is a comma separated list of granted permissions\n } else {\n alert('user is logged in, but did not grant any permissions');\n // user is logged in, but did not grant any permissions\n }\n } else {\n alert('user is not logged in');\n // user is not logged in\n }\n}, {perms:'email'});\n \u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd I have a login button at some other place (much before the above scripts) in the same page rendered with:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;fb:login-button v=\"2\"\u0026gt;Connect with Facebook\u0026lt;/fb:login-button\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis button renders as a normal fb connect button and clicking it opens a new popup window as it normally should. Problem is that it shows 'invalid api key specified' error. On inspecting address bar of popup, I see that api_key=undefined is passed to it :(\u003c/p\u003e\n\n\u003cp\u003eAny idea about this? I am trying to fix this for last 5 hours now... Please help me found out why correct API key is not being passed to popup window.\u003c/p\u003e\n\n\u003cp\u003eThanks in advance.\u003c/p\u003e","accepted_answer_id":"2723800","answer_count":"3","comment_count":"0","creation_date":"2010-04-27 08:17:08.783 UTC","favorite_count":"3","last_activity_date":"2010-07-25 16:46:24.57 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"322161","post_type_id":"1","score":"7","tags":"javascript|facebook|login|sdk|connect","view_count":"14768"} +{"id":"17252366","title":"Strange way of printing Binary Search Tree C++ with pointers","body":"\u003cp\u003eI was going through a lecture and it showed some code that prints out a binary search tree recursively like this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evoid printTree(node *t){\n if(t!=NULL){\n printTree(t-\u0026gt;left);\n cout\u0026lt;\u0026lt;t-\u0026gt;key\u0026lt;\u0026lt;endl;\n printTree(t-\u0026gt;right);\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI understand what it is doing but I don't understand the pointers. The function is passing a pointer to a node yet in the 'cout' line, it is trying to access the key value in the node struct without dereferencing it first. What I mean is, shouldn't it be something like\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecout\u0026lt;\u0026lt;(*t)-\u0026gt;key\u0026lt;\u0026lt;endl;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003einstead? \u003c/p\u003e","accepted_answer_id":"17252405","answer_count":"2","comment_count":"2","creation_date":"2013-06-22 15:32:55.33 UTC","last_activity_date":"2016-11-15 11:23:31.213 UTC","last_edit_date":"2013-06-22 15:59:39.01 UTC","last_editor_display_name":"","last_editor_user_id":"2229438","owner_display_name":"","owner_user_id":"1893354","post_type_id":"1","score":"0","tags":"c++|pointers|dereference","view_count":"171"} +{"id":"18213033","title":"DATETIME plus Minutes from table","body":"\u003cp\u003eHow do you add minutes to a DATETIME field?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e08/12/2013 11:00:00 PM + 120 minutes\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"18213229","answer_count":"1","comment_count":"0","creation_date":"2013-08-13 15:20:41.287 UTC","favorite_count":"1","last_activity_date":"2013-08-14 08:12:19.77 UTC","last_edit_date":"2013-08-13 19:25:10.04 UTC","last_editor_display_name":"","last_editor_user_id":"2562472","owner_display_name":"","owner_user_id":"2562472","post_type_id":"1","score":"1","tags":"datetime|foxpro|visual-foxpro","view_count":"839"} +{"id":"9873951","title":"EF getting the current ObjectContext","body":"\u003cp\u003eI need to get the current context given an entity\u003c/p\u003e\n\n\u003cp\u003eI found this old article from 2009\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://blogs.msdn.com/b/alexj/archive/2009/06/08/tip-24-how-to-get-the-objectcontext-from-an-entity.aspx\" rel=\"nofollow\"\u003ehttp://blogs.msdn.com/b/alexj/archive/2009/06/08/tip-24-how-to-get-the-objectcontext-from-an-entity.aspx\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003egiven that we're now firmly in 2012, is there another way ?\u003c/p\u003e\n\n\u003cp\u003eUPDATE - here are some details on where this is reqd \u003c/p\u003e\n\n\u003cp\u003eTable1 - at the heart of the star shaped schema\n Tags nvarchar(300) \n Idx identity int\u003c/p\u003e\n\n\u003cp\u003eTable2 - Tags reference\n TagID identity int\n TagText nvarchar(50)\u003c/p\u003e\n\n\u003cp\u003eTable3 - Rel between Table1 \u0026amp; Table2\n IDX FK \n TagID FK\u003c/p\u003e\n\n\u003cp\u003eIn the Context.SavingChanges() event for Table1\n the tags are parsed and saved to Table2 with the relationships added to Table3 using context from Table1\u003c/p\u003e\n\n\u003cp\u003eAny guidance on how to improve this are welcome \u003c/p\u003e","accepted_answer_id":"9883125","answer_count":"2","comment_count":"9","creation_date":"2012-03-26 14:23:41.093 UTC","last_activity_date":"2012-03-27 03:46:26.627 UTC","last_edit_date":"2012-03-27 01:55:46.587 UTC","last_editor_display_name":"","last_editor_user_id":"135852","owner_display_name":"","owner_user_id":"135852","post_type_id":"1","score":"1","tags":"c#|.net|entity-framework","view_count":"459"} +{"id":"29555789","title":"Prevent UIs interaction in Sparkle","body":"\u003cp\u003eI am trying to use Sparkle to update an app (not the current app). I start with something simple which is creating the updater object:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar updater = SUUpdater(forBundle: appBundle)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe problem I'm having is that that line of code can open UI dialogs if something go wrong. For example:\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/gzlTz.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eI can solve that problem, but my concern is that this code is running on a screensaver and popping a dialog like that blocks it to the point where a hard reboot is the only way to move forward.\u003c/p\u003e\n\n\u003cp\u003eIs there a way to prevent Sparkle from ever opening any kind of UI?\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2015-04-10 07:33:19.13 UTC","last_activity_date":"2015-04-10 07:33:19.13 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6068","post_type_id":"1","score":"2","tags":"osx|cocoa|sparkle","view_count":"29"} +{"id":"37994778","title":"Newbe: ajax form not working","body":"\u003cp\u003eI'm new in ajax/js/php. \nI have a small contact form\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;form id=\"contact-form\" method=\"post\" action=\"process.php\" role=\"form\"\u0026gt;\n \u0026lt;div class=\"messages\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;div class=\"form-group\"\u0026gt;\n \u0026lt;label for=\"form_name\"\u0026gt;First name *\u0026lt;/label\u0026gt;\n \u0026lt;input id=\"form_firstname\" type=\"text\" name=\"name\" class=\"form-control\" placeholder=\"Please enter your first name *\" required=\"required\" data-error=\"Firstname is required.\"\u0026gt;\n \u0026lt;div class=\"help-block with-errors\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"form-group\"\u0026gt;\n \u0026lt;label for=\"form_lastname\"\u0026gt;Last name *\u0026lt;/label\u0026gt;\n \u0026lt;input id=\"form_lastname\" type=\"text\" name=\"surname\" class=\"form-control\" placeholder=\"Please enter your last name *\" required=\"required\" data-error=\"Lastname is required.\"\u0026gt;\n \u0026lt;div class=\"help-block with-errors\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"form-group\"\u0026gt;\n \u0026lt;label for=\"form_email\"\u0026gt;Email *\u0026lt;/label\u0026gt;\n \u0026lt;input id=\"form_email\" type=\"email\" name=\"email\" class=\"form-control\" placeholder=\"Please enter your email *\" required=\"required\" data-error=\"Valid email is required.\"\u0026gt;\n \u0026lt;div class=\"help-block with-errors\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"form-group\"\u0026gt;\n \u0026lt;label for=\"form_phone\"\u0026gt;Phone\u0026lt;/label\u0026gt;\n \u0026lt;input id=\"form_phone\" type=\"tel\" name=\"phone\" class=\"form-control\" placeholder=\"Please enter your phone\"\u0026gt;\n \u0026lt;div class=\"help-block with-errors\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;p\u0026gt;\u0026lt;strong\u0026gt;*\u0026lt;/strong\u0026gt; These fields are required.\u0026lt;/p\u0026gt;\n\u0026lt;/form\u0026gt;\n\u0026lt;button type=\"submit\" class=\"btn btn-info\" value=\"Create Account\"\u0026gt;Create Account\u0026lt;/button\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewith small js and php\u003c/p\u003e\n\n\u003cp\u003escript.js\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(\"#contact-form\").submit(function(event) {\n // cancels the form submission\n \"use strict\";\n event.preventDefault();\n submitForm();\n});\n\nfunction submitForm() {\n // Initiate Variables With Form Content\n \"use strict\";\n var firstname = $(\"#form_firstname\").val();\n var lastname = $(\"#form_lastname\").val();\n var email = $(\"#email\").val();\n var phone = $(\"#phone\").val();\n\n $.ajax({\n type: \"POST\",\n url: \"process.php\",\n data: \"name=\" + firstname + lastname + \"\u0026amp;email=\" + email + \"\u0026amp;phone=\" + phone,\n });\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eprocess.php\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\n $name = $_POST[\"name\"];\n $email = $_POST[\"email\"];\n $phone = $_POST[\"phone\"];\n\n $EmailTo = \"name@email.com\";\n $Subject = \"New Message Received\";\n\n // prepare email body text\n $Body .= \"Name: \";\n $Body .= $name;\n $Body .= \"\\n\";\n\n $Body .= \"Email: \";\n $Body .= $email;\n $Body .= \"\\n\";\n\n $Body .= \"Phone: \";\n $Body .= $phone;\n $Body .= \"\\n\";\n\n // send email\n $success = mail($EmailTo, $Subject, $Body, \"From:\".$email);\n\n // redirect to success page\n if ($success){\n echo \"success\";\n } else {\n echo \"invalid\";\n } \n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003efor some reason it's not working on way I would like to, not sending me emails (i know to put my email in $Emailto).\nOften I was using only php form but I would like to avoid reloading page. I try to understand where I'm making error.\u003c/p\u003e","accepted_answer_id":"37996739","answer_count":"2","comment_count":"4","creation_date":"2016-06-23 14:38:27.47 UTC","last_activity_date":"2016-06-23 16:08:46.08 UTC","last_edit_date":"2016-06-23 15:28:13.42 UTC","last_editor_display_name":"","last_editor_user_id":"4400016","owner_display_name":"","owner_user_id":"5594938","post_type_id":"1","score":"1","tags":"javascript|php|jquery|ajax","view_count":"60"} +{"id":"47517186","title":"Write Opus Data to playable Opus File (Java)","body":"\u003cp\u003eI'm trying to write opus audio packets from a stream to a file using Java so that the file can be successfuly played (via VLC or what have you). I'm currently using the VorbisJava library to no available. Currently, I buffer all the received audio packets and then write the file once I know I am not going to receive any more audio. Here is my sample code so far:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public static void writeWithLibrary(List\u0026lt;OpusAudioData\u0026gt; opusAudioData, OutputStream outputStream)\n{\n OpusInfo opusInfo = new OpusInfo();\n opusInfo.setNumChannels(1);\n opusInfo.setOutputGain(0);\n opusInfo.setPreSkip(0);\n opusInfo.setSampleRate(48000);\n\n OpusTags opusTags = new OpusTags();\n\n OpusFile opusFile = new OpusFile(outputStream,opusInfo,opusTags);\n\n for (OpusAudioData o : opusAudioData)\n {\n opusFile.writeAudioData(o);\n }\n\n try\n {\n opusFile.close();\n }\n catch (IOException e)\n {\n logger.error(\"OpusFileWriter -- Could not write data to OpusFile, aborting\");\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny help would be appreciated. Am I overlooking something here?\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-11-27 18:05:41.863 UTC","last_activity_date":"2017-11-27 18:05:41.863 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"8599687","post_type_id":"1","score":"0","tags":"java|audio|ogg|opus","view_count":"18"} +{"id":"46400913","title":"cron jobs dow and mon exception","body":"\u003cp\u003eToday 2017-25-09 and monday and I have seen a entry cron job in syslog. My crontab:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e# m h dom mon dow user command\n 30 05 18 9 1 root /bin/bash [--job route--]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf today is 25th, why cron start job with \u003ccode\u003edom\u003c/code\u003e to 18 ?\u003c/p\u003e","accepted_answer_id":"46400994","answer_count":"1","comment_count":"0","creation_date":"2017-09-25 08:39:05.163 UTC","last_activity_date":"2017-09-25 10:25:22.093 UTC","last_edit_date":"2017-09-25 10:25:22.093 UTC","last_editor_display_name":"","last_editor_user_id":"5114204","owner_display_name":"","owner_user_id":"5114204","post_type_id":"1","score":"0","tags":"cron","view_count":"13"} +{"id":"10342600","title":"Can a SHOW FIELDS query use ORDER BY?","body":"\u003cp\u003eThe \u003ca href=\"http://dev.mysql.com/doc/refman/5.0/en/extended-show.html\" rel=\"nofollow\"\u003edocs\u003c/a\u003e don't mention ORDER BY and I have had no luck phrasing this query:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSHOW FIELDS FROM `TB_Main` WHERE Type = 'mediumtext' OR Type = 'bit(1)' ORDER BY Field;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eDo I have to do my ordering in my scripting?\u003c/p\u003e","accepted_answer_id":"10342616","answer_count":"1","comment_count":"0","creation_date":"2012-04-26 23:01:55.26 UTC","last_activity_date":"2012-04-26 23:15:04.817 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"97767","post_type_id":"1","score":"1","tags":"mysql","view_count":"472"} +{"id":"11823435","title":"How to use custom UserProvider or maybe it must be AuthenticatedProvider?","body":"\u003cp\u003eI need to request user info from URFAClient (NetUP UTM5 billing system), but custom UserProvider's docs says that i need load user bu username without password.\u003c/p\u003e\n\n\u003cp\u003eI can't do this, because all request to URFAClient must contain both username and password, i can't load userinfo without password.\u003c/p\u003e\n\n\u003cp\u003eI totally confiused about how to add my very custom UserProvider, and docs says nothing about what i need.\u003c/p\u003e\n\n\u003cp\u003eAny suggestion?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2012-08-06 06:28:07.963 UTC","last_activity_date":"2012-08-08 07:27:14.457 UTC","last_edit_date":"2012-08-08 07:27:14.457 UTC","last_editor_display_name":"","last_editor_user_id":"569101","owner_display_name":"","owner_user_id":"1088930","post_type_id":"1","score":"0","tags":"symfony","view_count":"35"} +{"id":"2109056","title":"How to find duplicate files with same name but in different case that exist in same directory in Linux?","body":"\u003cp\u003eHow can I return a list of files that are named duplicates i.e. have same name but in different case that exist in the \u003cem\u003esame directory\u003c/em\u003e?\u003c/p\u003e\n\n\u003cp\u003eI don't care about the contents of the files. I just need to know the location and name of any files that have a duplicate of the same name.\u003c/p\u003e\n\n\u003cp\u003eExample duplicates:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e/www/images/taxi.jpg\n/www/images/Taxi.jpg\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIdeally I need to search all files recursively from a base directory. In above example it was \u003ccode\u003e/www/\u003c/code\u003e\u003c/p\u003e","accepted_answer_id":"2109430","answer_count":"11","comment_count":"6","creation_date":"2010-01-21 12:14:47.08 UTC","favorite_count":"13","last_activity_date":"2017-02-01 18:05:41.677 UTC","last_edit_date":"2017-01-24 09:56:44.673 UTC","last_editor_display_name":"","last_editor_user_id":"1983854","owner_display_name":"","owner_user_id":"248848","post_type_id":"1","score":"27","tags":"linux|bash|command-line|find|filesystems","view_count":"31804"} +{"id":"29384757","title":"Difference between $window.location.reload() and $route.reload() in angularjs","body":"\u003cp\u003eWhat is the difference between $window.location.reload() and $route.reload() in Angular.js?\u003c/p\u003e\n\n\u003cp\u003eI have used these two things, but both are working same progress.\u003c/p\u003e\n\n\u003cp\u003eCan anyone explain the differences?\u003c/p\u003e","accepted_answer_id":"29384827","answer_count":"1","comment_count":"1","creation_date":"2015-04-01 07:02:02.527 UTC","last_activity_date":"2015-04-01 07:06:26.287 UTC","last_editor_display_name":"","owner_display_name":"user4201923","post_type_id":"1","score":"5","tags":"javascript|jquery|angularjs|performance","view_count":"1360"} +{"id":"15500399","title":"SqlCommand ExecuteNonQuery throws OutOfMemoryException","body":"\u003cp\u003eI have problem with executing Sql that in fact is simple call of stored procedure on SqlServer. \u003c/p\u003e\n\n\u003cp\u003eConsider below Sql Stored Procedure:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e CREATE PROCEDURE InfiniteLoop\n AS\n BEGIN\n DECLARE @ixi NUMERIC(38) = 0\n DECLARE @i NUMERIC(38) = 0\n WHILE 1 = 1\n BEGIN\n SET @i = @i + 1\n SET @ixi = @ixi * @i\n PRINT N'some text'\n END\n END;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow I'am calling this procedure from C# in this manner:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic void CallProcedure()\n{\n SqlCommand cmd = this._connection.CreateCommand();\n cmd.CommandType = CommandType.StoredProcedure;\n command.CommandText = 'InfiniteLoop';\n\n //Line below throws OutOfMemoryException\n cmd.ExecuteNonQuery();\n\n cmd.Dispose();\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMemory starts growing realy fast. After few seconds exception is thrown. \nNormaly all this code is using 'try/catch' and 'using' sections, but I have simplified this snippet to show that problem comes from SqlClient library not from my code directly.\u003c/p\u003e","accepted_answer_id":"15517456","answer_count":"1","comment_count":"1","creation_date":"2013-03-19 13:07:29.56 UTC","favorite_count":"1","last_activity_date":"2013-03-20 07:14:20.09 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2186553","post_type_id":"1","score":"1","tags":"out-of-memory|sqlcommand|executenonquery","view_count":"1179"} +{"id":"20987061","title":"How to search a column in sqlite by a string","body":"\u003cp\u003eI would like to return a true / false value when the string match with the column of sqlite. How can I implement the search function?\u003c/p\u003e\n\n\u003cp\u003eHow to use cursor to do searching? \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic boolean searchLuggage(String code) {\n\n ArrayList\u0026lt;String\u0026gt; luggageCheck = new ArrayList\u0026lt;String\u0026gt;();\n SQLiteDatabase db = this.getReadableDatabase();\n\n try {\n Cursor cursor = db.query(true, TABLE_LUGGAGES, new String[] { your field list }, SearchColumnname + \"='\" + code + \"'\", null, null, null, null, null);\n\n if (cursor != null) {\n cursor.moveToFirst();\n for (int i = 0; i \u0026lt; cursor.getCount(); i++) {\n luggageCheck.add(cursor.getString(0));\n cursor.moveToNext();\n }\n cursor.close();\n return true;\n }\n return false;\n} catch (Exception e) {\n e.printStackTrace();\n}\n return true;\n}\n\n\n\n\n// Creating Tables\n@Override\npublic void onCreate(SQLiteDatabase db) {\n String CREATE_LUGGAGE_TABLE = \"CREATE TABLE \" + TABLE_LUGGAGES + \"(\" + KEY_NAME + \" TEXT NOT NULL,\" + KEY_CODE + \" TEXT NOT NULL,\" + KEY_NUMBER + \" TEXT NOT NULL );\";\n db.execSQL(CREATE_LUGGAGE_TABLE);\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-01-08 04:28:39.73 UTC","last_activity_date":"2014-01-08 04:32:40.123 UTC","last_edit_date":"2014-01-08 04:29:33.223 UTC","last_editor_display_name":"","last_editor_user_id":"2664200","owner_display_name":"","owner_user_id":"3168467","post_type_id":"1","score":"1","tags":"java|android|sqlite","view_count":"295"} +{"id":"36660213","title":"Delete engine for deeply nested linked structure","body":"\u003cp\u003eThe background is the question at \u003ca href=\"https://stackoverflow.com/questions/36634394/nested-shared-ptr-destruction-causes-stack-overflow\"\u003eNested shared_ptr destruction causes stack overflow\u003c/a\u003e. To summarize, for a data structure that looks like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e// A node in a singly linked list.\nstruct Node {\n int head;\n std::shared_ptr\u0026lt;Node\u0026gt; tail;\n};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf the list grows too long, a stack overflow might occur in the destructor of \u003ccode\u003eNode\u003c/code\u003e due to recursive destructions of the \u003ccode\u003eshared_ptr\u003c/code\u003es. I'm implementing a thread-safe version of the delete engine proposed in \u003ca href=\"https://stackoverflow.com/a/36635668/3234803\"\u003ehttps://stackoverflow.com/a/36635668/3234803\u003c/a\u003e.\u003c/p\u003e\n\n\u003cp\u003eThere are three simple classes involved: \u003ccode\u003eSpinLock\u003c/code\u003e, \u003ccode\u003eConcurrentQueue\u003c/code\u003e, and \u003ccode\u003eDeleteEngine\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eThe \u003ccode\u003eSpinLock\u003c/code\u003e class implements the C++ Lockable interface with a \u003ccode\u003estd::atomic_flag\u003c/code\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass SpinLock {\npublic:\n void lock()\n { while (lock_.test_and_set(std::memory_order_acquire) {} }\n\n bool try_lock() // Not camel-case to be compatible with C++ Lockable interface\n { return !lock_.test_and_set(std::memory_order_acquire); }\n\n void unlock()\n { lock_.clear(std::memory_order_release); }\n\nprivate:\n std::atomic_flag lock_ = ATOMIC_FLAG_INIT;\n};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe \u003ccode\u003eConcurrentQueue\u003c/code\u003e class implements a multiple-producer-single-consumer queue that supports thread-safe \u003ccode\u003eenqueue\u003c/code\u003e and \u003ccode\u003etryDequeue\u003c/code\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etemplate\u0026lt;typename T\u0026gt;\nclass ConcurrentQueue {\npublic:\n void enqueue(T item)\n {\n std::lock_guard\u0026lt;SpinLock\u0026gt; lk(lock_);\n queue_.emplace_back(std::move(item));\n }\n\n bool tryDequeue(T \u0026amp;item)\n {\n std::lock_guard\u0026lt;SpinLock\u0026gt; lk(lock_);\n if (queue_.empty()) {\n return false;\n }\n item = std::move(queue_.front());\n queue_.pop_front();\n return true;\n }\n\nprivate:\n std::deque\u0026lt;T\u0026gt; queue_;\n SpinLock lock_;\n};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe \u003ccode\u003eDeleteEngine\u003c/code\u003e class implements the delete engine proposed in the answer aforementioned:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etemplate\u0026lt;typename T\u0026gt;\nclass DeleteEngine {\npublic:\n ~DeleteEngine()\n {\n std::lock_guard\u0026lt;SpinLock\u0026gt; lk(deleting_);\n deleteAll();\n }\n\n void enqueue(T *p)\n {\n queue_.enqueue(p);\n if (deleting_.try_lock()) {\n std::lock_guard\u0026lt;SpinLock\u0026gt; lk(deleting_, std::adopt_lock);\n deleteAll();\n }\n }\n\nprivate:\n void deleteAll()\n {\n T *p = nullptr;\n while (queue_.tryDequeue(p)) {\n delete p;\n }\n }\n\n ConcurrentQueue\u0026lt;T *\u0026gt; queue_;\n SpinLock deleting_;\n};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow in the deleter of a \u003ccode\u003eshared_ptr\u0026lt;Node\u0026gt;\u003c/code\u003e, we will hand the raw pointer to a \u003ccode\u003eDeleteEngine\u0026lt;Node\u0026gt;\u003c/code\u003e instead of directly \u003ccode\u003edelete\u003c/code\u003eing it. A recursive \u003ccode\u003edelete\u003c/code\u003e can handle up to about 10000 nodes, while this method can handle an arbitrarily large number of nodes.\u003c/p\u003e\n\n\u003cp\u003eThe above code is only a prototype, but I'm particularly concerned about the performance of this implementation: (1) Most of the time the \u003ccode\u003eNode\u003c/code\u003e class would be used in a single-threaded environment; (2) Occasionally it might be used in highly concurrent applications, e.g. a web server that constantly creates and destroys objects.\u003c/p\u003e\n\n\u003cp\u003eThis implementation is significantly slower than a naive recursive destruction (micro-benchmark with 64 threads and 10000 nodes per thread shows about 10 times slowdown). What can I do to improve it?\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2016-04-16 04:46:57.13 UTC","last_activity_date":"2016-04-16 04:46:57.13 UTC","last_edit_date":"2017-05-23 10:28:15.093 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"3234803","post_type_id":"1","score":"1","tags":"c++|multithreading|performance|c++11","view_count":"54"} +{"id":"9731928","title":"Moving two div elements at once","body":"\u003cp\u003eNot sure if I'm being too clear with the title. Sorry, it's late and I don't think I have a cleared mind.\u003c/p\u003e\n\n\u003cp\u003eAnyway what I want this to do is..\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eWhen the div(manager) is clicked, the div(managerp) appears.\u003c/li\u003e\n\u003cli\u003eThe div(manager) moves to the area the same time managerp moves there. Almost as though they move as one div element.\u003c/li\u003e\n\u003cli\u003eOn the next click managerp Fades out, and manager moves back to its original position.\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eI'm able to do all of that, but it won't return to it's original position. I am a novice when it comes to jQuery, so this is where I ask for your help. \u003c/p\u003e\n\n\u003cp\u003eEDIT: The div manager doesn't seem to return to the old position. I've tried editing the css through jQuery to get it to, but it doesn't seem to work. \u003c/p\u003e\n\n\u003cp\u003eHTML : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;div id=\"manager\"\u0026gt;\n \u0026lt;span\u0026gt;\u0026amp;raquo;\u0026lt;/span\u0026gt;\n\u0026lt;/div\u0026gt;\n\u0026lt;div id=\"managerp\" style=\"\"\u0026gt;\n\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNo, I can't put managerp within manager, it doesn't seem to position itself as good as it should. \u003c/p\u003e\n\n\u003cp\u003ejQuery : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e $(document).ready(function() {\n $(\"#manager\").click(function() {\n $(\"#manager\").css({'margin-left' : '270px', 'border-left' : '0'});\n $(\"#managerp\").toggle(\"slow\", function() {\n if ($(\"#managerp\").is(':visible'))\n $(\"span\").html(\"\u0026amp;laquo;\");\n else \n $(\"span\").html(\"\u0026amp;raquo;\");\n });\n });\n });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis should help you get the picture of what it's supposed to look like. (Sorry if I am giving way too much information)\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/TZeEh.png\" alt=\"One\"\u003e\n\u003cimg src=\"https://i.stack.imgur.com/1WVyA.png\" alt=\"Two\"\u003e\u003c/p\u003e\n\n\u003cp\u003eThank you for your help. If you need me to be more specific as to what it should be doing, just ask. \u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/8gOlP.png\" alt=\"This is how it looks when it doesn\u0026#39;t return correctly.\"\u003e\u003c/p\u003e","accepted_answer_id":"9731978","answer_count":"6","comment_count":"5","creation_date":"2012-03-16 04:32:23.06 UTC","last_activity_date":"2015-02-01 16:37:15.397 UTC","last_edit_date":"2015-02-01 16:37:15.397 UTC","last_editor_display_name":"","last_editor_user_id":"3204551","owner_display_name":"","owner_user_id":"1267786","post_type_id":"1","score":"1","tags":"javascript|jquery|html","view_count":"1151"} +{"id":"25797317","title":"GORM not bootstrapping from JAR","body":"\u003cp\u003eReplacing a persistence layer in legacy app with a JAR file using Spring, Hibernate and GORM. Methods like \u003ccode\u003eperson.save()\u003c/code\u003e work fine when running agains project with Gradle etc. in project. However, after I build the fat jar and reference it with \u003ccode\u003e-cp my-big-fat-gorm.jar\u003c/code\u003e I get:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003ejava.lang.IllegalStateException: Method on class [blah.Person] was\n used outside of a Grails application. If running in the context of a\n test using the mocking API or bootstrap Grails correctly.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eUsing Spring boot for Spring, Hibernate4 and GORM and build.gradle file show below...\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eapply plugin: 'java'\napply plugin: 'groovy'\napply plugin: 'application'\n\nmainClassName = \"blah.App\"\n\njar {\n baseName = 'blah-gorm'\n version = '1.0-SNAPSHOT'\n from {\n configurations.compile.collect {\n it.isDirectory() ? it : zipTree(it)\n }\n configurations.runtime.collect {\n it.isDirectory() ? it : zipTree(it)\n }\n }\n}\n\nrepositories {\n mavenLocal()\n mavenCentral()\n}\n\ndependencies {\n testCompile group: 'junit', name: 'junit', version: '4.8.2'\n compile 'org.grails:gorm-hibernate4-spring-boot:1.1.0.RELEASE'\n compile 'org.slf4j:slf4j-simple:1.7.7'\n runtime 'com.h2database:h2:1.4.181'\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAm I missing something in the JAR file creation that causes Spring boot to honor \u003ccode\u003e@Entity\u003c/code\u003e etc.?\u003c/p\u003e\n\n\u003cp\u003eHere is a GitHub project that illustrates this and should allow you to execute and see the same stuff I'm seeing.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://github.com/twcrone/spring-gorm-jar\" rel=\"nofollow\"\u003ehttps://github.com/twcrone/spring-gorm-jar\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"25812451","answer_count":"1","comment_count":"2","creation_date":"2014-09-11 21:34:47.453 UTC","favorite_count":"1","last_activity_date":"2014-09-12 16:59:27.85 UTC","last_edit_date":"2014-09-12 16:59:27.85 UTC","last_editor_display_name":"","last_editor_user_id":"242925","owner_display_name":"","owner_user_id":"242925","post_type_id":"1","score":"1","tags":"spring|hibernate|grails|groovy|gorm","view_count":"278"} +{"id":"26803679","title":"TypeError: 'AffineScalarFunc' object is not iterable","body":"\u003cp\u003eI defined a function such as:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef ucos(a):\n temp=[umath.cos(i) for i in a]\n return unumpy.uarray([unumpy.nominal_values(i) for i in temp], [unumpy.std_devs(i) for i in temp])\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut when I try to iterate over it with a for loop:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efor j in range(len(Beta)):\n if Beta[j]\u0026lt;pi/2.:\n Radius.append((Diam_meas[j]/2.)*(ucos((pi/2)-Beta[j]))**(-1)*10**(-9))\n else:\n Radius.append((Diam_meas[j]/2.)*10**(-9))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eit gives me the error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eTypeError: 'AffineScalarFunc' object is not iterable\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eDo you have any idea on why ucos function is not iterable? How to make it iterable?\nthx!\u003c/p\u003e","answer_count":"0","comment_count":"7","creation_date":"2014-11-07 14:41:58.86 UTC","last_activity_date":"2014-11-07 14:41:58.86 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2906997","post_type_id":"1","score":"0","tags":"python|loops|object|iterable","view_count":"63"} +{"id":"14137372","title":"What framework of Android can be used to connect PC to Android and Android to other PC?","body":"\u003cp\u003eI have this scenario. Where i am writing one apps in Android usging bash/python. So that via PC i can connect to the Android and from Android using USB i can connect the destination PC/Server. \u003c/p\u003e\n\n\u003cp\u003eBut what API is available to send all my Android requests to USB, so that i can remotely have assistance for the Server PC via Android? Is there any other available open-source framework for doing such?\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/0cOQv.jpg\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eor\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/DzKvX.jpg\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eFollow up:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eThere is already \"Tethering and portable hotspot\" option in my mobile. Without installing any third party apps.\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/1nyGr.jpg\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eSo once i enabled it, i have new interface called usb0 with ip address in the same subnet of Android + Laptop. \u003c/p\u003e\n\n\u003cp\u003eThen i installed simply SSHDroid server in Android, now from 3G i can connect to the Android. Now PC and Android both has usb0 interface with same subnet for sharing data that solves all the remote access problem.\u003c/p\u003e\n\n\u003cp\u003eOn my laptop:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$ ip addr\n\n 2: eth0: \u0026lt;BROADCAST,MULTICAST,UP,LOWER_UP\u0026gt; mtu 1500 qdisc pfifo_fast state UP qlen 1000\n link/ether d4:be:d9:55:91:4a brd ff:ff:ff:ff:ff:ff\n inet 192.168.0.219/24 brd 192.168.0.255 scope global eth0\n inet6 fe80::d6be:d9ff:fe55:914a/64 scope link \n valid_lft forever preferred_lft forever\n\n 7: usb0: \u0026lt;BROADCAST,MULTICAST,UP,LOWER_UP\u0026gt; mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000\n link/ether c6:8a:95:bf:fa:2b brd ff:ff:ff:ff:ff:ff\n inet 192.168.42.202/24 brd 192.168.42.255 scope global usb0\n inet6 fe80::c48a:95ff:febf:fa2b/64 scope link \n valid_lft forever preferred_lft forever\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOn my Android mobile:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e/data/data/berserker.android.apps.sshdroid/home # ip addr\n\n11: usb0: \u0026lt;BROADCAST,MULTICAST,UP,LOWER_UP\u0026gt; mtu 1500 qdisc pfifo_fast state UP qlen 1000\n link/ether 6e:54:53:29:68:8c brd ff:ff:ff:ff:ff:ff\n inet 192.168.42.129/24 brd 192.168.42.255 scope global usb0\n inet6 fe80::6c54:53ff:fe29:688c/64 scope link \n valid_lft forever preferred_lft forever\n\n15: wlan0: \u0026lt;BROADCAST,UP,LOWER_UP\u0026gt; mtu 1500 qdisc pfifo_fast state UP qlen 1000\n link/ether 50:01:bb:e3:fb:d7 brd ff:ff:ff:ff:ff:ff\n inet 192.168.0.163/24 brd 192.168.0.255 scope global wlan0\n inet6 fe80::5201:bbff:fee3:fbd7/64 scope link \n valid_lft forever preferred_lft forever\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"14193041","answer_count":"1","comment_count":"1","creation_date":"2013-01-03 10:49:30.12 UTC","last_activity_date":"2013-01-08 13:32:22.143 UTC","last_edit_date":"2013-01-08 13:32:22.143 UTC","last_editor_display_name":"","last_editor_user_id":"285594","owner_display_name":"","owner_user_id":"285594","post_type_id":"1","score":"5","tags":"android|python|linux|bash|android-intent","view_count":"492"} +{"id":"41008163","title":"PHP RIGHT JOIN query not considering null?","body":"\u003cp\u003eWhen I run the query it returns all the correct values except it doesn't return any values where a.Correct = null (i.e a quiz question hasn't been answered at all), but it does return values for a.Correct = 0.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e /***Configure the retest***/\n public function CreateRetest($topicID) {\n $retestData = array();\n $count = 0;\n\n $createSQL = \"SELECT q.QuestionID,q.Question,q.Answer,q.TopicID From quizanswered a RIGHT JOIN question q ON a.QuestionID = q.QuestionID where (a.Correct=null OR a.Correct = 0) AND q.TopicID = '$topicID'\";\n $create = mysqli_query($this-\u0026gt;db,$createSQL) or die(mysqli_connect_errno().\"Cannot create tables\");\n while($row = mysqli_fetch_array($create)){\n $rQuestionID = $row['QuestionID'];\n $rQuestion = $row['Question'];\n $rAnswer = $row['Answer'];\n $retestData[$count] = array($rQuestionID,$rQuestion,$rAnswer);\n $count +=1;\n }\n return $retestData;\n\n }\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"41008385","answer_count":"1","comment_count":"1","creation_date":"2016-12-07 01:57:06.647 UTC","last_activity_date":"2016-12-07 02:24:03.497 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7102640","post_type_id":"1","score":"0","tags":"php|mysql|right-join","view_count":"31"} +{"id":"4288039","title":"Using malloc and free in C/C++ and getting error HEAP CORRUPTION DETECTED","body":"\u003cp\u003eI am having a problem when free(position) is run. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evoid printTree(nodeT node, int hieght)\n{\n int *position;\n position = (int*)malloc(hieght * sizeof(int*));\n for (int i = 0; i \u0026lt;= hieght; i++)\n {\n position[i] = 0;\n }\n BOOLEAN DONE = FALSE;\n while (DONE == FALSE)\n {\n printMoveDown(\u0026amp;node, position);\n printLEAFNode(\u0026amp;node, position);\n DONE = printMoveUp(\u0026amp;node, position);\n printSingleKey(\u0026amp;node, position);\n } \n free(position);\n position = NULL;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe full error message I get from VS2010 is HEAP CORRUPTION DETECTED: after normal block (#64) at 0x00031390. CRT detected that the application wrote to memory after end of heap.\u003c/p\u003e\n\n\u003cp\u003eThe debugger says the problem occurs while at in: dbgheap.c\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eextern \"C\" void __cdecl _free_dbg_nolock\nline 1376: if (!CheckBytes(pbData(pHead) + pHead-\u0026gt;nDataSize, _bNoMansLandFill, nNoMansLandSize))\n if (pHead-\u0026gt;szFileName) {..}\n else { this is where the program stops }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI tried setting up the same situation with less stuff going on to see if I could narrow the problem down. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evoid function (int y)\n{\n int *x;\n x = (int*)malloc(y * sizeof(int*));\n free(x);\n x = NULL;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is the same thing as above without the for loop and while loop. This works. Removing the for loop is what made it work. I don't know why. I looked up what the CRT was but it was all pretty new concepts to me and I assume that I can solve this problem without knowing about these CRTs. \u003c/p\u003e\n\n\u003cp\u003eThe for loop assigns values to the memory allocated for position, beyond that I can't think of why this causes a problem.... actually now that I think about it. I changed the loop to be height + 1 which fixed the problem.\u003c/p\u003e","accepted_answer_id":"4288076","answer_count":"2","comment_count":"0","creation_date":"2010-11-26 19:26:04.793 UTC","last_activity_date":"2014-08-06 13:06:18.377 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"454462","post_type_id":"1","score":"2","tags":"c|loops|malloc|free|heap-memory","view_count":"6651"} +{"id":"15536901","title":"Deque Implementation","body":"\u003cp\u003eI have question regarding the code I found on Internet which uses a deque for finding the max of the element --\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e #include \u0026lt;iostream\u0026gt;\n #include \u0026lt;deque\u0026gt;\n\n using namespace std;\n\n\n void test(int arr[], int n)\n { \n std::deque\u0026lt;int\u0026gt; Qi(n); \n int i;\n for (i = 0; i \u0026lt; n; ++i)\n {\n while ( (!Qi.empty()) \u0026amp;\u0026amp; arr[i] \u0026gt;= arr[Qi.back()])\n Qi.pop_back(); // Remove from rear\n\n Qi.push_back(i);\n }\n cout \u0026lt;\u0026lt; arr[Qi.front()]; \n}\n\n// Driver program to test above functions\nint main()\n{\n int arr[] = {12, 1, 78, 90, 57, 89, 56};\n int n = sizeof(arr)/sizeof(arr[0]); \n test(arr, n);\n return 0;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy Question is how is Qi.front() giving the right index when I have not done any Qi.push_front() ?\u003c/p\u003e\n\n\u003cp\u003eBut the following code gives me a 0\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e void test(int arr[], int n)\n { \n std::deque\u0026lt;int\u0026gt; Qi(n); \n int i;\n for (i = 0; i \u0026lt; n; ++i)\n { \n Qi.push_back(i);\n }\n cout \u0026lt;\u0026lt; arr[Qi.front()]; \n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSorry If I am sounding stupid .. New to deques ...\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","accepted_answer_id":"15536938","answer_count":"1","comment_count":"1","creation_date":"2013-03-20 23:44:27.54 UTC","last_activity_date":"2013-03-20 23:46:57.387 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1205914","post_type_id":"1","score":"1","tags":"c++|data-structures|stl|deque","view_count":"623"} +{"id":"36780010","title":"Regex to remove p tags within li tags and td tags","body":"\u003cp\u003eI have this html content:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;p\u0026gt;This is a paragraph:\u0026lt;/p\u0026gt;\n\u0026lt;ul\u0026gt;\n\u0026lt;li\u0026gt;\n\u0026lt;p\u0026gt;point 1\u0026lt;/p\u0026gt;\n\u0026lt;/li\u0026gt;\n\u0026lt;li\u0026gt;\n\u0026lt;p\u0026gt;point 2\u0026lt;/p\u0026gt;\n\u0026lt;ul\u0026gt;\n\u0026lt;li\u0026gt;\n\u0026lt;p\u0026gt;point 3\u0026lt;/p\u0026gt;\n\u0026lt;/li\u0026gt;\n\u0026lt;li\u0026gt;\n\u0026lt;p\u0026gt;point 4\u0026lt;/p\u0026gt;\n\u0026lt;/li\u0026gt;\n\u0026lt;/ul\u0026gt;\n\u0026lt;/li\u0026gt;\n\u0026lt;li\u0026gt;\n\u0026lt;p\u0026gt;point 5\u0026lt;/p\u0026gt;\n\u0026lt;/li\u0026gt;\n\u0026lt;/ul\u0026gt;\n\u0026lt;ul\u0026gt;\n\u0026lt;li\u0026gt;\n\u0026lt;p\u0026gt;\u0026lt;strong\u0026gt;sub-head : \u0026lt;/strong\u0026gt;This is a para followed by heading, This is a para followed by heading, This is a para followed by heading, This is a para followed by heading\u0026lt;/p\u0026gt;\n\u0026lt;/li\u0026gt;\n\u0026lt;li\u0026gt;\n\u0026lt;p\u0026gt;\u0026lt;strong\u0026gt;sub-head 2: \u0026lt;/strong\u0026gt;\u0026lt;/p\u0026gt;\n\u0026lt;p\u0026gt;This is a para followed by heading, This is a para followed by heading, This is a para followed by heading, This is a para followed by heading\u0026lt;/p\u0026gt;\n\u0026lt;/li\u0026gt;\n\u0026lt;/ul\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to remove all the \u0026lt;p\u0026gt;\u0026amp;\u0026lt;/p\u0026gt; tags between \u0026lt;li\u0026gt;\u0026amp;\u0026lt;/li\u0026gt; irrespective of its position between \u0026lt;li\u0026gt;\u0026amp;\u0026lt;/li\u0026gt;. similarly i need to remove p tags between td tags inside a table.\u003c/p\u003e\n\n\u003cp\u003eThis is my controller code so far:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enogo={\"\u0026lt;li\u0026gt;\\n\u0026lt;p\u0026gt;\" =\u0026gt;'\u0026lt;li\u0026gt;', \"\u0026lt;/p\u0026gt;\\n\u0026lt;/li\u0026gt;\" =\u0026gt; '\u0026lt;/li\u0026gt;', \"\u0026lt;td\u0026gt;\\n\u0026lt;p\u0026gt;\" =\u0026gt; '\u0026lt;td\u0026gt;', \"\u0026lt;/p\u0026gt;\\n\u0026lt;/td\u0026gt;\" =\u0026gt; '\u0026lt;/td\u0026gt;', \n '\u0026lt;p\u0026gt; \u0026lt;/p\u0026gt;' =\u0026gt; '','\u0026lt;ul\u0026gt;' =\u0026gt; \"\\n\u0026lt;ul\u0026gt;\",'\u0026lt;/ul\u0026gt;' =\u0026gt; \"\u0026lt;/ul\u0026gt;\\n\", '\u0026lt;/ol\u0026gt;' =\u0026gt; \"\u0026lt;/ol\u0026gt;\\n\" , \n '\u0026lt;table\u0026gt;' =\u0026gt; \"\\n\u0026lt;table width='100%' border='0' cellspacing='0' cellpadding='0' class='table table-curved'\u0026gt;\", \n '\u0026amp;lt;' =\u0026gt; '\u0026lt;', '\u0026amp;gt;'=\u0026gt;'\u0026gt;','\u0026lt;br\u0026gt;' =\u0026gt; '','\u0026lt;p\u0026gt;\u0026lt;/p\u0026gt;' =\u0026gt; '', ' rel=\"nofollow\"' =\u0026gt; ''\n\nc=params[:content]\n bundle_out=Sanitize.fragment(c,Sanitize::Config.merge(Sanitize::Config::BASIC,\n :elements=\u0026gt; Sanitize::Config::BASIC[:elements]+['table', 'tbody', 'tr', 'td', 'h1', 'h2', 'h3'],\n :attributes=\u0026gt;{'a' =\u0026gt; ['href']}) )#.split(\" \").join(\" \")\n\n re = Regexp.new(nogo.keys.map { |x| Regexp.escape(x) }.join('|'))\n\n @bundle_out=bundle_out.gsub(re, nogo)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eim passing the above html content to this code through params[:content] which ive assigned to a variable c. \u003c/p\u003e\n\n\u003cp\u003eFollowing is the o/p which is not as expected. Some close p tags and open p tags are still between li and close li tags\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;p\u0026gt;This is a paragraph:\u0026lt;/p\u0026gt;\n\n\u0026lt;ul\u0026gt;\n\u0026lt;li\u0026gt;point 1\u0026lt;/li\u0026gt;\n\u0026lt;li\u0026gt;point 2\u0026lt;/p\u0026gt;\n\u0026lt;ul\u0026gt;\n\u0026lt;li\u0026gt;point 3\u0026lt;/li\u0026gt;\n\u0026lt;li\u0026gt;point 4\u0026lt;/li\u0026gt;\n\u0026lt;/ul\u0026gt;\n\u0026lt;/li\u0026gt;\n\u0026lt;li\u0026gt;point 5\u0026lt;/li\u0026gt;\n\u0026lt;/ul\u0026gt;\n\n\u0026lt;ul\u0026gt;\n\u0026lt;li\u0026gt;\u0026lt;strong\u0026gt;sub-head : \u0026lt;/strong\u0026gt;This is a para followed by heading, This is a para followed by heading, This is a para followed by heading, This is a para followed by heading\u0026lt;/li\u0026gt;\n\u0026lt;li\u0026gt;\u0026lt;strong\u0026gt;sub-head 2: \u0026lt;/strong\u0026gt;\u0026lt;/p\u0026gt;\n\u0026lt;p\u0026gt;This is a para followed by heading, This is a para followed by heading, This is a para followed by heading, This is a para followed by heading\u0026lt;/li\u0026gt;\n\u0026lt;/ul\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy aim is simple i just want to remove all the p tags inside li and td tags, which im not able to do correctly. Any help is appreciated.\u003c/p\u003e\n\n\u003cp\u003eI would like to use regex to do this. and i know using regex is not the correct way to parse html content.\u003c/p\u003e","answer_count":"1","comment_count":"5","creation_date":"2016-04-21 20:39:33.77 UTC","last_activity_date":"2016-04-21 22:15:22.497 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5251665","post_type_id":"1","score":"-3","tags":"ruby|regex|ruby-on-rails-4","view_count":"134"} +{"id":"28460751","title":"Forcing a PI scan for teradata table","body":"\u003cp\u003eI have a table (say T1) which has a PI defined on column c1, c2 and c3.\u003c/p\u003e\n\n\u003cp\u003eIn one query, the need is to have filter only on c1, and for a given unknown reason, I cant create a secondary index on the column c1. \u003c/p\u003e\n\n\u003cp\u003eI tried writing a query like this - \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eselect *\nfrom T1\nwhere C1 = \u0026lt;some Value\u0026gt;\nand c2 = c2\nand c3 = c3\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003egiven that conditions for c2 and c3 are tautologies, the result set will not be impacted. However, I am \"expecting\" to fool Teradata into invoking the PI for this query, which does not happen.\u003c/p\u003e\n\n\u003cp\u003eany explanation ?\u003c/p\u003e","answer_count":"2","comment_count":"3","creation_date":"2015-02-11 17:34:22.947 UTC","last_activity_date":"2015-02-12 15:16:32.783 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"459222","post_type_id":"1","score":"0","tags":"teradata","view_count":"63"} +{"id":"45857556","title":"How can I set a severity level per log source with Boost log?","body":"\u003cp\u003eI am new to Boost Log, and having troubles doing some pretty simple stuff.\nI'm trying to create a logger and assign a level to it (such as Warning, Info, Trace, etc.), and filter out(for performance reasons) any logs sent to this logger with a lower level of that assigned to the logger, \u003cstrong\u003eat the Logging core level, rather than at the sink level\u003c/strong\u003e. \nFor example (pseudo code):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elogger lg;\nlg.setLevel(Warn);\nBOOST_LOG_TRIVIAL(trace) \u0026lt;\u0026lt; \"A trace severity message\"; // Will be filtered\nBOOST_LOG_TRIVIAL(warn) \u0026lt;\u0026lt; \"A warning severity message\"; // Won't be filtered\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm pretty sure this can be achieved with Boost Log, but for some reason I was not able to do this.\u003c/p\u003e\n\n\u003cp\u003eThanks,\u003c/p\u003e\n\n\u003cp\u003eOmer.\u003c/p\u003e","accepted_answer_id":"45875705","answer_count":"2","comment_count":"0","creation_date":"2017-08-24 09:12:59.643 UTC","last_activity_date":"2017-08-25 06:40:50.457 UTC","last_edit_date":"2017-08-24 14:24:23.553 UTC","last_editor_display_name":"","last_editor_user_id":"1833563","owner_display_name":"","owner_user_id":"1833563","post_type_id":"1","score":"0","tags":"c++|logging|boost|boost-log","view_count":"84"} +{"id":"29763206","title":"Creating an array with an unknown size?","body":"\u003cp\u003eIf I have\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass example {\nint x;\nint data[] = new int[x]\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf I wanted to create a new method that creates a new array whose size is one greater than data's length how would I proceed? I don't understand how I can create a new array when I don't know the initial length and adding one to that?\u003c/p\u003e","accepted_answer_id":"29763440","answer_count":"3","comment_count":"5","creation_date":"2015-04-21 04:53:37.88 UTC","last_activity_date":"2015-04-21 05:21:05.473 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4813170","post_type_id":"1","score":"0","tags":"java|arrays","view_count":"212"} +{"id":"18245367","title":"Is there a URI scheme for opening a QR code app?","body":"\u003cp\u003eI have a project that requires the browser to open a qr code reader app from a link. Is that possible? I know URI schemes are useful for this kind of situation, but I don't know where to look.\u003c/p\u003e","accepted_answer_id":"18249674","answer_count":"2","comment_count":"0","creation_date":"2013-08-15 02:22:49.803 UTC","last_activity_date":"2013-12-23 13:33:15.267 UTC","last_edit_date":"2013-12-23 13:33:15.267 UTC","last_editor_display_name":"","last_editor_user_id":"64174","owner_display_name":"","owner_user_id":"2658993","post_type_id":"1","score":"0","tags":"mobile|qr-code","view_count":"1161"} +{"id":"47327557","title":"How to install Android SDK with offline files on macOS?","body":"\u003cp\u003eIn China I cannot access \u003ca href=\"https://dl.google.com\" rel=\"nofollow noreferrer\"\u003ehttps://dl.google.com\u003c/a\u003e with speedy connection so I use mirror site to download a bunch of installation files including \u003ccode\u003e3534162-studio.sdk-patcher.zip.bak\u003c/code\u003e which is patch v4. You can't simply unzip this file and place it under \u003ccode\u003e~/Library/Android/sdk/patcher/v4\u003c/code\u003e to install (\u003ccode\u003epatcher.jar\u003c/code\u003e and \u003ccode\u003esource.properties\u003c/code\u003e). So is Intel HAXM (\u003ccode\u003ehaxm-macosx_r6_2_1\u003c/code\u003e), installing the pkg file inside will not actually trigger the process to complete. Unlike linux, there is no temp file under sdk, so I wonder where the temp folder go (that I can put these downloaded files to it to complete the installation process).\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-11-16 10:43:37.633 UTC","last_activity_date":"2017-11-16 12:01:13.567 UTC","last_edit_date":"2017-11-16 12:01:13.567 UTC","last_editor_display_name":"","last_editor_user_id":"1000551","owner_display_name":"","owner_user_id":"1613047","post_type_id":"1","score":"0","tags":"android|android-studio|android-sdk-tools","view_count":"23"} +{"id":"25130292","title":"Automate first time password reset using powershell","body":"\u003cp\u003eI am creating a VM on the fly with powershell (on ESX with Windows Server 2012 R2). I have most of the automation pieces in place, but when it comes to resetting the Administrator password the first time we login to the VM after provisioning (as a part of windows security policy), I am having a hard time.\u003c/p\u003e\n\n\u003cp\u003eI have tried stuff like the following (which didn't work):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[ADSI]$vmAccount=\"WinNT://$vmName/$vmUserName\"\n$vmAccount.ChangePassword($current, $new)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt fails by saying:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eException calling \"ChangePassword\" with \"2\" argument(s): \n\"The specified network password is not correct.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny help in pointing me in the right direction is much appreciated.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-08-05 02:25:35.677 UTC","last_activity_date":"2014-08-05 03:09:06.65 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"175421","post_type_id":"1","score":"0","tags":"powershell|virtual-machine|windows-server-2012|powercli","view_count":"119"} +{"id":"22404572","title":"How to Insert long html, images and long String in Oracle (long data) as a Single Column?","body":"\u003cp\u003eI want to insert a long data into one column, that data containing html, images binary data and string. What data type need to use to insert the data into column [ big data].\nI am written a query to insert into oracle database but at the time of insertion Oracle says\nORA-01704: string literal too long. I am inserting more than 1mb data into DB ( combination of text,html and binarydata). Any suggestions with example please.\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2014-03-14 12:08:06.873 UTC","last_activity_date":"2014-03-18 05:34:25.567 UTC","last_edit_date":"2014-03-18 05:34:25.567 UTC","last_editor_display_name":"","last_editor_user_id":"2056856","owner_display_name":"","owner_user_id":"2056856","post_type_id":"1","score":"0","tags":"java|sql|oracle","view_count":"790"} +{"id":"35081145","title":"cant add ImageView in a subclass","body":"\u003cp\u003eI can add an ImageView programatically from the main class. But I can't do it from a subclass.\nWhen I try \u003ccode\u003eImageView iv = new ImageView(this)\u003c/code\u003e I am getting an error\n\u003cstrong\u003eImageView (android.content.Contex) in ImageView can not be applied to \u003cem\u003e(...MainActivity.MySubclass)\u003c/em\u003e\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eCode:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class MainActivity extends Activity { \n...\nclass MySubclass\n{\n ImageView iv;\n MySubclass(View v) // create an object from onClick method\n {\n iv = new ImageView(this);\n }\n} // end of subclass\n\n} // end of main\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"35081196","answer_count":"1","comment_count":"4","creation_date":"2016-01-29 09:36:19.063 UTC","last_activity_date":"2016-01-29 09:42:36.643 UTC","last_edit_date":"2016-01-29 09:42:36.643 UTC","last_editor_display_name":"","last_editor_user_id":"5813003","owner_display_name":"","owner_user_id":"5813003","post_type_id":"1","score":"-7","tags":"java|android","view_count":"51"} +{"id":"23781772","title":"Eclipse C++ Warnings","body":"\u003cp\u003eI've recently formatted my computer and re-installed Ubuntu and Eclipse.\nAfterwards, when I opened a C++ project that was both warning and error free, Eclipse now shows me some warnings I've never seen before, such as:\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eMacro definition can be replaced with constexpr expression\u003c/code\u003e \u003c/p\u003e\n\n\u003cp\u003eand\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eUn- or ill-initialized variable found\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eScreenshot:\n\u003cimg src=\"https://i.stack.imgur.com/cCiQb.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eWhat do these warnings mean and why are they listed? They weren't there before I re-installed Ubuntu and Eclipse...\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","accepted_answer_id":"23782307","answer_count":"1","comment_count":"1","creation_date":"2014-05-21 11:21:46.307 UTC","last_activity_date":"2014-05-21 16:40:07.873 UTC","last_edit_date":"2014-05-21 16:40:07.873 UTC","last_editor_display_name":"","last_editor_user_id":"2047110","owner_display_name":"","owner_user_id":"2047110","post_type_id":"1","score":"1","tags":"c++|eclipse|ubuntu|ubuntu-14.04","view_count":"1216"} +{"id":"46427767","title":"Python Tornado file upload gives KeyError","body":"\u003cp\u003eI'm trying to write a very simple python script based on tornado web server to upload a file. But I'm getting 'KeyError' though the key is in the html form is OK.\u003c/p\u003e\n\n\u003cp\u003eHere is the python code just to see the uploaded file name.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport tornado.ioloop\nimport tornado.web\n\nclass IndexHandler(tornado.web.RequestHandler):\n def get(self):\n self.write(\"Bismillahir Rahmanir Raheem\")\n self.render('form.html')\n\nclass UploadHandler(tornado.web.RequestHandler):\n def post(self):\n self.write(\"Alhamdulillah, here\")\n if self.request.files is not None:\n self.write(\"Inside the if\")\n uploadFile = self.request.files['my_file'][0]\n self.write(uploadFile['filename'])\n\ndef make_app():\n return tornado.web.Application([\n (r\"/\", IndexHandler),\n (r\"/upload\", UploadHandler)\n ])\n\nif __name__ == \"__main__\":\n app = make_app()\n app.listen(8888)\n tornado.ioloop.IOLoop.current().start()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd the html form is as below:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;html\u0026gt;\n \u0026lt;head\u0026gt;\n \u0026lt;title\u0026gt;Testing file upload\u0026lt;/title\u0026gt;\n \u0026lt;/head\u0026gt;\n \u0026lt;body\u0026gt;\n \u0026lt;h1\u0026gt;Testing file upload\u0026lt;/h1\u0026gt;\n \u0026lt;form enctype=\"multipart/formdata\" method=\"post\" action=\"/upload\"\u0026gt;\n \u0026lt;input type=\"file\" name=\"my_file\"/\u0026gt;\n \u0026lt;input type=\"Submit\" name=\"upload\" value=\"Upload\"/\u0026gt;\n \u0026lt;/form\u0026gt;\n \u0026lt;/body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut each time I select a file and press Upload button I get the \u003c/p\u003e\n\n\u003cp\u003e500: Internal Server Error\u003c/p\u003e\n\n\u003cp\u003eAnd at the PyCharm editor I get the following error:\n File \"C:/Users/Mushfique/Desktop/file-upload/upload.py\", line 14, in post\n uploadFile = self.request.files['my_file'][0]\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eKeyError: 'my_file' ERROR:tornado.access:500 POST /upload (::1) 1.00ms\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eThough in the html form I've used 'my_file' as the file input field name.\u003c/p\u003e","accepted_answer_id":"46434588","answer_count":"1","comment_count":"0","creation_date":"2017-09-26 13:22:34.44 UTC","last_activity_date":"2017-09-26 19:43:55.687 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1134778","post_type_id":"1","score":"0","tags":"python-3.x|tornado","view_count":"40"} +{"id":"35078437","title":"Is my implementation of multi-threading okay?","body":"\u003cp\u003eI built an application class that should be runnable as a \u003ccode\u003eThread\u003c/code\u003e and it would be nice to hear opinions of Java developers to improve my coding style.\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eMain\u003c/code\u003e class.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epackage com.ozankurt;\n\npublic class Main {\n\n public static void main(String[] args) {\n\n Application application = new Application();\n\n application.start();\n\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eApplication class:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epackage com.ozankurt;\n\nimport com.ozankurt.utilities.Input;\n\npublic class Application implements Runnable {\n\n private CommandHandler commandHandler;\n\n private boolean running;\n\n private volatile Thread thread;\n private String threadName = \"ApplicationThread\";\n\n public Application() {\n\n Handler handler = new Handler(this);\n\n this.commandHandler = new CommandHandler(handler);\n\n this.running = true;\n }\n\n public void start() {\n\n if (thread != null) {\n System.out.println(threadName + \"is already running.\");\n\n if (!isRunning())\n {\n System.out.println(\"Resuming \" + threadName + \"...\");\n setRunning(true);\n }\n } else {\n System.out.println(\"Starting \" + threadName + \"...\");\n\n thread = new Thread(this, threadName);\n thread.start();\n\n System.out.println(\"Started \" + threadName + \".\");\n }\n }\n\n public void stop() {\n System.out.println(\"Halting \" + threadName + \"...\");\n\n setRunning(false);\n\n System.out.println(\"Halted \" + threadName + \".\");\n }\n\n @Override\n public void run() {\n\n while (isRunning()) {\n String userInput = Input.readLine();\n\n commandHandler.handle(userInput);\n }\n }\n\n public boolean isRunning() {\n\n return running;\n }\n\n public void setRunning(boolean running) {\n\n this.running = running;\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI read this \u003ca href=\"http://docs.oracle.com/javase/1.5.0/docs/guide/misc/threadPrimitiveDeprecation.html\" rel=\"nofollow\"\u003eJava documentation\u003c/a\u003e about how to stop threads in Java without using \u003ccode\u003estop\u003c/code\u003e method that has become deprecated because it might throw some exceptions.\u003c/p\u003e\n\n\u003cp\u003eAs far as I understand we shouldn't try to stop a thread and instead we should define a property corresponding to the state of the thread.\u003c/p\u003e\n\n\u003cp\u003eIn my case I defined a \u003ccode\u003eboolean running\u003c/code\u003e in my \u003ccode\u003eApplication\u003c/code\u003e class and as you can read from my code in the \u003ccode\u003erun\u003c/code\u003e method I basicly check if the application is \u003ccode\u003erunning\u003c/code\u003e. Which mean that I actually never stop the thread, I only remove its functionality by using a \u003ccode\u003ewhile\u003c/code\u003e statement. Is this the correct approach explained in the \u003ca href=\"http://docs.oracle.com/javase/1.5.0/docs/guide/misc/threadPrimitiveDeprecation.html\" rel=\"nofollow\"\u003eJava documentation\u003c/a\u003e?\u003c/p\u003e","answer_count":"1","comment_count":"5","creation_date":"2016-01-29 06:44:33.033 UTC","favorite_count":"1","last_activity_date":"2016-02-07 14:51:25.467 UTC","last_edit_date":"2016-01-29 06:50:41.17 UTC","last_editor_display_name":"","last_editor_user_id":"5855701","owner_display_name":"","owner_user_id":"5855701","post_type_id":"1","score":"2","tags":"java|multithreading","view_count":"92"} +{"id":"31659566","title":"User Identity in ASP.Net modelling","body":"\u003cp\u003eI have a table with Listings and I want users to be able to mark their favourite listings. To do that I would have a new table with User ID and Listing Id data. Users should be only able to see their favourite listings. \u003c/p\u003e\n\n\u003cp\u003eI am using ASP.NET default authentication. The way to get the User Id would be\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eUser.Identity.Name;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e??\u003c/p\u003e\n\n\u003cp\u003eIs that the userId I should store? Is that the common approach?\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2015-07-27 17:31:37.873 UTC","last_activity_date":"2015-07-28 14:17:07.587 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1869307","post_type_id":"1","score":"0","tags":"asp.net|sql-server|database|asp.net-web-api|user-identification","view_count":"40"} +{"id":"32653842","title":"Display strongly typed binded data dataSource in webForm Grid","body":"\u003cp\u003eI am working in ASP.NET 3.5 and I am trying to display data in a grid. I have a model class and data is stored as a strongly typed list. I have a Repeater control to show all the data but for reason is not working in the grid \u003c/p\u003e\n\n\u003ch2\u003eModel class\u003c/h2\u003e\n\n\u003cpre\u003e\u003ccode\u003e public class RolesModel\n{\n public RolesModel() { }\n\n public long RoleID { get; set; }\n\n public string Title { get; set; }\n\n public string Description { get; set; }\n\n public DateTime CreatedDate { get; set; }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003ch2\u003easpx.cs class\u003c/h2\u003e\n\n\u003cpre\u003e\u003ccode\u003eprotected void Page_Load(object sender, EventArgs e)\n {\n\n if(!Page.IsPostBack)\n {\n List\u0026lt;RolesModel\u0026gt; roleList = new List\u0026lt;RolesModel\u0026gt;();\n\n roleList = RoleDefinationRelay.GetAllRoles(null);\n\n rptRoles.DataSource = roleList;\n rptRoles.DataBind();\n }\n\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003ch2\u003eASP:Repeater (is working!)\u003c/h2\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;asp:Repeater ID=\"rptRoles\" runat=\"server\"\u0026gt;\n \u0026lt;HeaderTemplate\u0026gt;\n \u0026lt;table class=\"tableStyle1\"\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;Role ID\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;Title\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;Description\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;Created Date\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n\n \u0026lt;/HeaderTemplate\u0026gt;\n \u0026lt;ItemTemplate\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;%#Eval(\"RoleID\")%\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;%#Eval(\"Title\")%\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;%#Eval(\"Description\")%\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;%#Eval(\"CreatedDate\")%\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;/ItemTemplate\u0026gt;\n \u0026lt;FooterTemplate\u0026gt;\n \u0026lt;/table\u0026gt;\n \u0026lt;/FooterTemplate\u0026gt;\n \u0026lt;/asp:Repeater\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003ch2\u003eNeed to make Grid work here but is not working\u003c/h2\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;cc0:Grid ID=\"ItemList\" runat=\"server\" FolderStyle=\"~/Styles/Grid\" AutoGenerateColumns=\"true\"\n Width=\"100%\" PageSizeOptions=\"5,10,20,50,100,-1\" AllowFiltering=\"true\" FilterType=\"ProgrammaticOnly\"\n AllowAddingRecords=\"false\" DataSourceID=\"rptRoles\"\u0026gt;\n \u0026lt;Columns\u0026gt;\n \u0026lt;cc0:Column DataField=\"RoleID\" HeaderText=\"Role ID\" Visible=\"true\" /\u0026gt;\n \u0026lt;cc0:Column DataField=\"Title\" HeaderText=\"Title\" Width=\"150\" /\u0026gt;\n \u0026lt;cc0:Column DataField=\"Description\" HeaderText=\"Description\" /\u0026gt;\n \u0026lt;cc0:Column DataField=\"CreatedDate\" HeaderText=\"Created Date\" Width=\"150\" /\u0026gt;\n \u0026lt;/Columns\u0026gt; \n \u0026lt;/cc0:Grid\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-09-18 13:55:11.58 UTC","last_activity_date":"2015-09-18 14:15:40.68 UTC","last_edit_date":"2015-09-18 14:00:54.997 UTC","last_editor_display_name":"","last_editor_user_id":"1124565","owner_display_name":"","owner_user_id":"2460100","post_type_id":"1","score":"0","tags":"c#|data-binding|webforms|datasource|asp.net-3.5","view_count":"50"} +{"id":"26723818","title":"Get rows data from base with php","body":"\u003cp\u003eHere I have an \u003ccode\u003edataRange\u003c/code\u003e loop, but for this case its not important, more important than \u003ccode\u003edateRange\u003c/code\u003e is \u003ccode\u003e$i\u003c/code\u003e:\u003c/p\u003e\n\n\u003cp\u003eSo I have:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e $dateString = '09.03.2014';\n$startDate = new DateTime($dateString);\n\n$period = new DateInterval('P1M');\n$endDate = clone $startDate;\n$endDate-\u0026gt;add($period);\n\n$interval = new DateInterval('P1D');\n$daterange = new DatePeriod($startDate, $interval ,$endDate);\n$i=1;\nforeach($daterange as $date){\n $temp = array();\n // the following line will be used to slice the Pie chart\n $temp['ID'] = $i;\n $temp['datum'] = $date-\u0026gt;format(\"d/m\") . PHP_EOL;\n\n $rs1 = $db-\u0026gt;prepare('SELECT naziv FROM aktivnosti WHERE user_id=:idd');\n $rs1-\u0026gt;bindParam(':idd', $i); \n\n $rs1-\u0026gt;execute();\n $naz = $rs1-\u0026gt;fetchColumn();\n if ($naz != false) {\n $temp['vrsta'] = $naz;\n } else {\n $temp['vrsta'] = '';\n }\n\n\n $output['data'][] = $temp;\n $i++;\n }\n $jsonTable = json_encode($output);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAs you can see I have for loop and with $temp['vrsta'] I want to get data from table aktivnosti .\u003c/p\u003e\n\n\u003cp\u003eI also have JS UI layer on frontend which make a html from data:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e $('#example').dataTable( {\n \"ajax\": \"table1.php\",\n \"columns\": [\n { \"data\": \"ID\" },\n { \"data\": \"datum\" },\n { \"data\": \"naziv\" },\n { \"data\": \"vrsta\" },\n\n ],\n \"lengthMenu\": [ 31 ],\n \"columnDefs\": [ {\n \"targets\": 3,\n \"data\": \"download_link\",\n \"render\": function ( data, type, full, meta ) {\n if (data != '') {\n return '\u0026lt;button class=\"btn btn-success\"\u0026gt;'+data+'\u0026lt;/button\u0026gt;';\n }else {\n return data;\n }\n }\n } , etc...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eNow my code fetch only first row data so problem is becouse I have many rows on table aktivnosti\u003c/strong\u003e with the same user_id so when I have many the same user_id on aktivnosti I also need to create ''+data+''; for every row from table aktivnosti but I have NO idea how to do that?\u003c/p\u003e\n\n\u003cp\u003eSome ideas? How I can do that?\u003c/p\u003e","accepted_answer_id":"26724817","answer_count":"2","comment_count":"20","creation_date":"2014-11-03 21:46:09.207 UTC","last_activity_date":"2014-11-03 22:57:22.92 UTC","last_edit_date":"2014-11-03 22:19:44.477 UTC","last_editor_display_name":"","last_editor_user_id":"4197127","owner_display_name":"","owner_user_id":"4197127","post_type_id":"1","score":"0","tags":"javascript|php|mysql|pdo","view_count":"76"} +{"id":"14162731","title":"SQL / MySQL - how to get a unique week number (independent of the year)?","body":"\u003cp\u003eI'd like to get the number of a week from a DATE starting with Monday as the first day of the week. While WEEK() can partially accomplish this, I would like each week to be uniquely identified. I.e., rather than rolling over at 52 or 53 to 0 or 1, to continue counting to week 54, 55, etc.\u003c/p\u003e\n\n\u003cp\u003eWhat is the best way to accomplish this in SQL?\u003c/p\u003e","accepted_answer_id":"14162781","answer_count":"1","comment_count":"1","creation_date":"2013-01-04 18:26:54.843 UTC","favorite_count":"2","last_activity_date":"2013-01-04 18:41:20.187 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"862098","post_type_id":"1","score":"3","tags":"mysql|sql","view_count":"1002"} +{"id":"20610820","title":"Why doesn't html/template show all html conditional comments?","body":"\u003cp\u003eI have a simple Go HTML template which contains HTML conditional comments:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epackage main\n\nimport (\n \"html/template\"\n \"os\"\n)\n\nvar body = `\u0026lt;!doctype html\u0026gt;\n\u0026lt;html\u0026gt;\n \u0026lt;head\u0026gt;\n \u0026lt;!--[if !IE]\u0026gt;\u0026lt;!--\u0026gt;\u0026lt;script src=\"http://code.jquery.com/jquery-2.0.3.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\u0026lt;!--\u0026lt;![endif]--\u0026gt;\n \u0026lt;!--[if gte IE 9]\u0026gt;\u0026lt;script src=\"http://code.jquery.com/jquery-2.0.3.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\u0026lt;![endif]--\u0026gt;\n \u0026lt;!--[if lt IE 9]\u0026gt;\u0026lt;script src=\"http://code.jquery.com/jquery-1.10.2.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\u0026lt;![endif]--\u0026gt;\n\n \u0026lt;/head\u0026gt;\n\u0026lt;/html\u0026gt;`\n\nfunc main() {\n tmp := template.Must(template.New(\"tmp\").Parse(body))\n tmp.Execute(os.Stdout, nil)\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003ca href=\"http://play.golang.org/p/iSnfpdfc0L\" rel=\"nofollow\"\u003eThis produces:\u003c/a\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;!doctype html\u0026gt;\n\u0026lt;html\u0026gt;\n \u0026lt;head\u0026gt;\n \u0026lt;script src=\"http://code.jquery.com/jquery-2.0.3.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\n\n\n\n \u0026lt;/head\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhy does \u003ca href=\"http://golang.org/pkg/html/template/#Template.Execute\" rel=\"nofollow\"\u003e\u003ccode\u003ehtml/template\u003c/code\u003e\u003c/a\u003e remove those conditional comments after compiling?\u003c/p\u003e","accepted_answer_id":"20631569","answer_count":"5","comment_count":"1","creation_date":"2013-12-16 12:19:12.647 UTC","favorite_count":"1","last_activity_date":"2015-07-07 14:03:48.83 UTC","last_edit_date":"2015-07-07 14:03:48.83 UTC","last_editor_display_name":"","last_editor_user_id":"55504","owner_display_name":"","owner_user_id":"297094","post_type_id":"1","score":"4","tags":"html|templates|go","view_count":"1100"} +{"id":"17120061","title":"Google 414 Error with Youtube API requests","body":"\u003cp\u003emy company has been developing a TV Guide web app for Youtube for the past 3 months and we launched our beta yesterday, \u003ca href=\"http://martelltv.com/\" rel=\"nofollow\"\u003ehttp://martelltv.com/\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eIt works fairly well as intended, but with one problem: we're getting a Google 414 error under certain circumstances.\u003c/p\u003e\n\n\u003cp\u003eTo create the effect of broadcast television using Youtube, the episode containers “play back to back” feature currently works with a playlist that is consumed in the Youtube servers. We store the YT video ids and when someone ask to watch an episode we send the ids to the YT API and YT get back to us with the videos. However, we've noticed that if we schedule more than (I think the number was?) 50 videos to play in a 'day', we get a Google 414 error. \u003c/p\u003e\n\n\u003cp\u003eWe believe the 414 error is mostly happening because of the YT restrictions, and would like to know if that restriction could be increased for our app so a full 24 hour worth of videos could be scheduled in a Station for playing?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-06-15 04:02:11.023 UTC","last_activity_date":"2013-06-17 20:06:14.37 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2488111","post_type_id":"1","score":"0","tags":"youtube-api","view_count":"323"} +{"id":"37216294","title":"Encrypting HTTP PUT in C# to JS on the Server","body":"\u003cp\u003ei have a C# program which makes HTTP PUTs from one server, to another Server which runs (XS)JS. The content type which i am sending is JSON. This is already working fine. \u003c/p\u003e\n\n\u003cp\u003eNow i need to work on the security, but i have no idea where to start here. Can someone point in the right direction?\u003c/p\u003e\n\n\u003cp\u003eWhat do i need to use sending over the internet? AES256, Rijndael, i dont even know in which direction to look. Also the JS needs to be able to decrypt it afterwards.\u003c/p\u003e\n\n\u003cp\u003eThanks in advance!\u003c/p\u003e","accepted_answer_id":"37240611","answer_count":"2","comment_count":"8","creation_date":"2016-05-13 17:45:23.077 UTC","last_activity_date":"2016-05-15 16:26:43.9 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6197854","post_type_id":"1","score":"2","tags":"javascript|c#|http|encryption","view_count":"110"} +{"id":"36068426","title":"Client-server applications and certificates","body":"\u003cp\u003eIf in order to obtain a certificate from a trusted authority you need a valid URL address, then how do client-server applications (that are just 2 applications running onto different machines) can establish an SSL communication?\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2016-03-17 18:05:51.15 UTC","last_activity_date":"2016-03-17 23:32:16.837 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2917666","post_type_id":"1","score":"0","tags":"ssl|certificate","view_count":"34"} +{"id":"43086259","title":"How to group a column(Travel Fare) in ranges (0-100),(100-200) like wise","body":"\u003cp\u003eI have a SQL Table where there are Bookings records kept. I have to group the no. of bookings based on Fare ranges (0-100),(100-200) like wise. Fares are up to 3 decimal points. Please help\u003c/p\u003e","answer_count":"1","comment_count":"5","creation_date":"2017-03-29 06:47:23.513 UTC","last_activity_date":"2017-03-30 10:53:53.207 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7059463","post_type_id":"1","score":"0","tags":"sql-server-2008","view_count":"17"} +{"id":"15392490","title":"Hashchange html submit","body":"\u003cp\u003eThere's a problem with my script. If I was to type something in with a spacebar, ie: \u003cstrong\u003egoogle map\u003c/strong\u003e it would change in input box: \u003cstrong\u003egoogle+map\u003c/strong\u003e what I don't like.\nAlso... When I submit again, it messes up more badly\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;form name=\"input\" action=\"\" method=\"get\"\u0026gt;\nSearch: \u0026lt;input type=\"text\" name=\"search\"\u0026gt;\n\u0026lt;input type=\"submit\" value=\"Submit\"\u0026gt;\n \u0026lt;div id=\"result\"\u0026gt;\u0026lt;/div\u0026gt;\n\u0026lt;/form\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e--\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$('form').submit(function() {\n var form_data = ($(this).serialize());\n window.location.hash = form_data.replace('=','/');\n return false;\n});\n\n$(window).on('hashchange', function () {\n var values = window.location.hash.slice(1).split('/');\n $(\"[name=\" + values[0] + \"]\").val(values[1]);\n});\n\nvar values = window.location.hash.slice(1).split('/');\n$(\"[name=\" + values[0] + \"]\").val(values[1]);\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"15392555","answer_count":"2","comment_count":"0","creation_date":"2013-03-13 17:37:30.74 UTC","last_activity_date":"2013-03-13 17:51:04.677 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2128056","post_type_id":"1","score":"0","tags":"javascript|jquery|html","view_count":"143"} +{"id":"40828644","title":"How to parse an image url in React?","body":"\u003cp\u003eI am new here, so apologies if I am asking trivial question, but could not find answer anywhere. I need to parse my link to display image. Image is in format e.g. p8983.png\u003c/p\u003e\n\n\u003cp\u003eSo I build this link which is correct, not sure how to render/parse it with ---\u003e see line 8\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003econst targetImage = `public/assets/p${playerData.player.id}.png`;\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eThis don't work - see line 19\n\u003ccode\u003e\u0026lt;div\u0026gt;\u0026lt;img src=\"{targetImage}\"\u0026gt;\u0026lt;/img\u0026gt;\u0026lt;/div\u0026gt;\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eSecond issue I have is I do not know how to do math calculations on values pulled from JSON - see lines 17, 18 (all is displayed as a string) e.g.\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003e\u0026lt;div\u0026gt;Passes per minute: {playerData.stats[4].value} + {playerData.stats[8].value} / {playerData.stats[7].value}\u0026lt;/div\u0026gt;\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eRendering and image and values after math calculations \u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/4wZxf.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/4wZxf.png\" alt=\"my code sample\"\u003e\u003c/a\u003e\u003c/p\u003e","answer_count":"1","comment_count":"6","creation_date":"2016-11-27 11:54:06.387 UTC","last_activity_date":"2016-11-27 20:41:21.303 UTC","last_edit_date":"2016-11-27 12:24:08.013 UTC","last_editor_display_name":"","last_editor_user_id":"471955","owner_display_name":"","owner_user_id":"4623225","post_type_id":"1","score":"3","tags":"javascript|reactjs","view_count":"73"} +{"id":"27274873","title":"why this code doent run and have the error:","body":"\u003cpre\u003e\u003ccode\u003eclass cal2:\n def __init__(self, a, b):\n self.f = a\n self.s = b\n dict = {\"add\": self.add, \"sub\": self.sub, \"mul\": self.mul, \"div\": self.div}\n\n def add(self, w, q):\n return w + q\n\n def sub(self, w, q):\n return w - q\n\n def mul(self, w, q):\n return w * q\n\n def div(self, w, q):\n return w / q\n\n def calculator(self, fun):\n\n return dict[fun](self.f, self.s)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003chr\u003e\n\n\u003cpre\u003e\u003ccode\u003efrom cal2 import cal2\n\nif __name__ == \"__main__\":\n\n request = raw_input(\"Type the Function and numbers :\")\n method = request[0:3]\n l = [0, 0]\n k = 0\n\n for word in request.split():\n if word.isdigit():\n l[k] = word\n k = k + 1\n c = cal2(l[0],l[1])\n\n print c.calculator(method)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003chr\u003e\n\n\u003cp\u003eerror: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eType the Function and numbers :add 8 7\nTraceback (most recent call last):\n File \"C:/Users/user/PycharmProjects/test/work_example/main.py\", line 16, in \u0026lt;module\u0026gt;\n print c.calculator(method)\n File \"C:\\Users\\user\\PycharmProjects\\test\\work_example\\cal2.py\", line 24, in calculator\n return dict[fun](self.f, self.s)\nTypeError: 'type' object has no attribute '__getitem__'\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"27274930","answer_count":"1","comment_count":"1","creation_date":"2014-12-03 14:59:22.19 UTC","favorite_count":"1","last_activity_date":"2014-12-03 15:01:44.113 UTC","last_edit_date":"2014-12-03 15:01:20.033 UTC","last_editor_display_name":"","last_editor_user_id":"104349","owner_display_name":"","owner_user_id":"4320545","post_type_id":"1","score":"-3","tags":"python|calculator","view_count":"45"} +{"id":"13148505","title":"Strange Zend Framework Behavior - not finding index controller actions","body":"\u003cp\u003eI recently started a new zend framework project. I created all the db-table models, models, controllers, actions, forms and enabled layouts via the ZF Tool. All of the items I created show up in .zf-project.xml.\u003c/p\u003e\n\n\u003cp\u003eI then set about setting up the first header and footer for the default layout. At the bottom of this layout is a footer nav section with several links for example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;a href=\"/howitworks\"\u0026gt;How it Works\u0026lt;/a\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen this is clicked it should navigate to the index controller / howitworksAction however it doesnt. Instead I get an error stating: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eMessage: Invalid controller specified (howitworks)\n\nStack trace:\n\n#0 /usr/share/php/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard-\u0026gt;dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))\n#1 /usr/share/php/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front-\u0026gt;dispatch()\n#2 /usr/share/php/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap-\u0026gt;run()\n#3 /var/www/vhosts/lokals.mediagiantdesign.com/httpdocs/public/index.php(26): Zend_Application-\u0026gt;run()\n#4 {main} \nRequest Parameters:\n\narray (\n 'controller' =\u0026gt; 'howitworks',\n 'action' =\u0026gt; 'index',\n 'module' =\u0026gt; 'default',\n) \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf I force the URL to /index/howitworks it works fine. I am totally thrown off by this as this is the first Zend application that I have built where this has ever happened. In previous applications this linking worked right out of the box. I havent setup a custom router, the bootstrap is barebones. So I have no idea why this isnt working.\u003c/p\u003e\n\n\u003cp\u003eI thought zend first looked for a controller matching the controller, if not found it looked in index looking for an action that matched, and if that wasnt found, it would assume it was a file in /public. If thats the case, then what am I missing here?\u003c/p\u003e\n\n\u003cp\u003eThanks in advance.\nRick\u003c/p\u003e","accepted_answer_id":"13149023","answer_count":"2","comment_count":"0","creation_date":"2012-10-30 22:29:35.813 UTC","last_activity_date":"2012-10-31 00:30:06.72 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1787008","post_type_id":"1","score":"0","tags":"zend-framework","view_count":"532"} +{"id":"45997534","title":"Oauth Authentication in Logic Apps","body":"\u003cp\u003eHow can you authenticate an HTTP Request to Logic Apps using Oauth Authentication mechanism? Any Ideas and pointers are much appreciated.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-09-01 09:50:19.44 UTC","last_activity_date":"2017-09-01 21:54:20.163 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3212639","post_type_id":"1","score":"0","tags":"oauth|oauth-2.0|azure-logic-apps","view_count":"43"} +{"id":"15687776","title":"How to send a message to Azure service bus queue from a Azure mobile services script","body":"\u003cp\u003eI am trying to make a hybrid application on Azure which uses both mobile services and a worker role. In a script (Node.js) which runs on mobile services DB, I want to send a message through service bus queue. Then my worker role will receive that message and perform some actions. But I can't find how I should sent the message to service bus queue.\nBTW, this is not mentioned in \"\u003ca href=\"http://msdn.microsoft.com/en-us/library/windowsazure/jj554226.aspx\" rel=\"nofollow\"\u003eMobile Services server script reference\u003c/a\u003e\". Is it possible at all or not?\nThanks.\u003c/p\u003e","accepted_answer_id":"15688282","answer_count":"1","comment_count":"0","creation_date":"2013-03-28 16:57:53.573 UTC","last_activity_date":"2013-03-28 17:24:56.47 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"791150","post_type_id":"1","score":"2","tags":"node.js|azure|windows-phone-8|azureservicebus|azure-mobile-services","view_count":"1065"} +{"id":"43948298","title":"Find the content in the first open brace regex Notepad++","body":"\u003cp\u003eAssuming that we have the following content which has three lines:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecnt1 {\\abc asd{} sd {{d}} def.}\ncnt2 {\\abc hgj{} sd {sd} {{d}} def.}\ncnt3 {\\def asd{} sd {{d}} def.}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAs we can see, many open and close braces here, can I filter both the content in the first line and the second line, it has similar content \"{\\abc\" and the beginning of each line, but each one has difference number of braces and content inside. I just think about this problem is how to detect the content of the first opening brace (parent braces) of each line which its starting content is \"\\abc\". \u003c/p\u003e\n\n\u003cp\u003eAssuming that the content \"{\\abc asd{} sd {{d}} def.}\" = $1, and \"{\\abc hgj{} sd {sd} {{d}} def.}\" = $2. How I can make the desired result as\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecnt1 x$1y\ncnt2 g$2h\ncnt3 {\\def asd{} sd {{d}} def.}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e(x,y and g,h is added to two sides of the given content)\nThank you so much!\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2017-05-13 01:13:16.483 UTC","last_activity_date":"2017-05-13 02:19:19.53 UTC","last_edit_date":"2017-05-13 02:19:19.53 UTC","last_editor_display_name":"","last_editor_user_id":"7574729","owner_display_name":"","owner_user_id":"7574729","post_type_id":"1","score":"0","tags":"regex|notepad++","view_count":"24"} +{"id":"31334730","title":"Store is not defined in an Actions","body":"\u003cp\u003eSo, I want to use stored data from another store called \u003ccode\u003eUserStore\u003c/code\u003e. The Actions is \u003ccode\u003eFavoriteActions\u003c/code\u003e with \u003ccode\u003eFavoriteStore\u003c/code\u003e. Where I call \u003ccode\u003eUserStore.getState()\u003c/code\u003e inside one of the method on \u003ccode\u003eFavoriteActions\u003c/code\u003e, it says \u003ccode\u003eUserStore.getState is not a function\u003c/code\u003e. Strange, I have a similar code using \u003ccode\u003eUserStore\u003c/code\u003e and it works. I already require it on top of the file.\u003c/p\u003e\n\n\u003cp\u003eHere is the file.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar alt = require('../utils/alt');\n\nvar UserStore = require('../stores/UserStore');\n\nvar FavoriteActions = alt.createActions({\n\n favorite: function(variant_id, list_id) {\n this.dispatch();\n # THIS IS THE PROBLEM\n var token = UserStore.getState().current_user.token;\n var headers = { 'X-Spree-Token': token };\n var params = {\n variant_id: variant_id\n };\n\n axios.get(base_url + '/shopping_lists/' + list_id + '/items', {\n headers: headers,\n params: params\n })\n .then(FavoriteActions.updateFavorite)\n .catch(FavoriteActions.favoritesFailed);\n },\n\n updateFavorite: function(result) {\n this.dispatch(result);\n },\n\n updateFavoriteId: function(list_id) {\n this.dispatch(list_id);\n },\n\n updateFavorites: function(result) {\n this.dispatch(result);\n },\n\n favoritesFailed: function(error_message) {\n this.dispatch(error_message);\n },\n});\n\nmodule.exports = FavoriteActions;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm using \u003ca href=\"https://github.com/goatslacker/alt\" rel=\"nofollow\"\u003ealt\u003c/a\u003e. This is the \u003ccode\u003eUserStore\u003c/code\u003e file.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar alt = require('../utils/alt');\nvar UserActions = require('../actions/UserActions');\n\nvar UserStore = alt.createStore({\n displayName: 'UserStore',\n\n bindListeners: {\n login: UserActions.LOGIN,\n logout: UserActions.LOGOUT,\n updateUser: UserActions.UPDATE_USER,\n clearUser: UserActions.CLEAR_USER,\n loginFailed: UserActions.LOGIN_FAILED\n },\n\n state: {\n current_user: null,\n errorMessage: null,\n loading: false\n },\n\n login: function() {\n this.setState({\n loading: true\n });\n },\n\n updateUser: function(user) {\n this.setState({\n current_user: user,\n loading: false\n });\n },\n\n logout: function() {\n this.setState({\n loading: true\n });\n },\n\n clearUser: function() {\n this.setState({\n current_user: null,\n loading: false\n });\n\n // FIXME: Unset user session\n },\n\n loginFailed: function(errorMessage) {\n this.setState({\n errorMessage: errorMessage,\n loading: false\n });\n }\n});\n\nmodule.exports = UserStore;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"7","creation_date":"2015-07-10 07:16:11.227 UTC","last_activity_date":"2015-07-10 07:54:37.97 UTC","last_edit_date":"2015-07-10 07:54:37.97 UTC","last_editor_display_name":"","last_editor_user_id":"1063114","owner_display_name":"","owner_user_id":"1063114","post_type_id":"1","score":"0","tags":"reactjs","view_count":"1610"} +{"id":"19034109","title":"getting value form textbox in htmlflow of smartgwt","body":"\u003cp\u003eI added a dynamic text box to my code using htmlflow of GWT. Now I wanted the retrieve the value from the text box. Below is the code any help will be appreciable. By using the Rootpanel.get(elementID). Am able to get the element value as \u003c/p\u003e\n\n\u003cp\u003eO/p :\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003e\u0026lt;input id=\"value1\" 80px;=\"\" border:=\"\" 0px;=\"\" border-bottom:=\"\" 4px=\"\" solid=\"\" #3366ff;'=\"\" type=\"textstyle='width:\"\u0026gt;\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eFrom this how do i get hold of the value that i entered in the textbox ?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e String alertText = \"If pressure \u0026gt; ? and glucoselevel \u0026gt; ? \";\n String newAlertText = alertText.replace(\"?\", \"\");\n\n numberOfPlaceHolder = alertText.length() - newAlertText.length();\n System.out.println(\"Num of Place holder :\"+numberOfPlaceHolder);\n\n String[] alertblock = alertText.split(\"\\\\?\"); \n\n\n\n StringBuffer alertHtml = new StringBuffer();\n\n\n for(int i=1; i\u0026lt;=numberOfPlaceHolder;i++){ \n\n\n String textbox = \"\u0026lt;input id='value\"+i+\"' type=textstyle='width: 80px; border: 0px; border-bottom: 4px solid #3366FF;' /\u0026gt;\";\n String textblock = alertblock[i-1];\n alertHtml.append(textblock);\n alertHtml.append(textbox); \n\n\n }\n\n\n\n String alertTextHtml = \"\u0026lt;div\u0026gt;\"+alertHtml.toString()+\"\u0026lt;/div\u0026gt;\"; \n\n htmlFlow = new HTMLFlow(alertTextHtml);\n\n alertTextLay.addMember(htmlFlow);\n\n IButton saveAlertBtn = new IButton();\n saveAlertBtn.setTitle(\"Save Alert\");\n saveAlertBtn.addClickHandler(new ClickHandler() {\n\n @Override\n public void onClick(ClickEvent event) {\n // TODO Auto-generated method stub\n LinkedHashMap\u0026lt;String, String\u0026gt; alertValueMap = new LinkedHashMap\u0026lt;String, String\u0026gt;();\n for(int i=1; i\u0026lt;=numberOfPlaceHolder;i++){ \n\n System.out.println(**RootPanel.get(\"value\"+i));**\n //System.out.println(DOM.getElementById(\"value\"+i).getInnerText().toString());\n\n }\n }\n });\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-09-26 16:53:42.253 UTC","favorite_count":"1","last_activity_date":"2013-09-27 09:22:08.44 UTC","last_edit_date":"2013-09-26 16:56:16.227 UTC","last_editor_display_name":"","last_editor_user_id":"1427460","owner_display_name":"","owner_user_id":"2555199","post_type_id":"1","score":"1","tags":"java|html|gwt|smartgwt","view_count":"675"} +{"id":"46249094","title":"Sqoop export failed : pig generated file to mysql","body":"\u003cp\u003eI'm trying to export file from an azure datalake to a mysql database.\u003c/p\u003e\n\n\u003cp\u003eHere is a sample of my source file :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e2008-10-03,TCPL - St. Clair,NGX Phys, FP (US/MM),2008-10-02,1CF,D,,7.4,-0.22,2008-10-02,931\n2008-10-03,TCPL - St. Clair,NGX Phys, FP (US/MM),2008-10-03,1CF,D,,7.4,-0.22,2008-10-03,931\n2008-10-03,TCPL - St. Clair,NGX Phys, FP (US/MM),2008-10-04,1CF,D,,7.4,-0.22,2008-10-04,931\n2008-10-03,TCPL - St. Clair,NGX Phys, FP (US/MM),2008-10-05,1CF,D,,7.4,-0.22,2008-10-05,931\n2008-10-03,TCPL - St. Clair,NGX Phys, FP (US/MM),2008-10-06,1CF,D,,7.4,-0.22,2008-10-06,931\n2008-10-03,TCPL - St. Clair,NGX Phys, FP (US/MM),2008-10-07,1CF,D,,7.4,-0.22,2008-10-07,931\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003emy sqoop command :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esqoop export \\\n--connect jdbc:mysql://mydb.mysql.database.azure.com:3306/table_name \\\n--connection-manager org.apache.sqoop.manager.MySQLManager \\\n--password pass \\\n--username user \\\n--export-dir 'adl://datalake.azuredatalakestore.net/path/to/the/pig/generated/files/' \\\n--table my_destination_table \\\n--input-fields-terminated-by ',' \\\n--input-lines-terminated-by '\\n' \\\n--batch\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I execute sqoop, here is the error :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e2017-09-16 00:19:05,998 ERROR [main] org.apache.sqoop.mapreduce.TextExportMapper: Exception: java.lang.RuntimeException: Can't parse input data: ' FP'\n at gas.__loadFromFields(gas.java:708)\n at gas.parse(gas.java:606)\n at org.apache.sqoop.mapreduce.TextExportMapper.map(TextExportMapper.java:89)\n at org.apache.sqoop.mapreduce.TextExportMapper.map(TextExportMapper.java:39)\n at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:146)\n at org.apache.sqoop.mapreduce.AutoProgressMapper.run(AutoProgressMapper.java:64)\n at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:787)\n at org.apache.hadoop.mapred.MapTask.run(MapTask.java:341)\n at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:170)\n at java.security.AccessController.doPrivileged(Native Method)\n at javax.security.auth.Subject.doAs(Subject.java:422)\n at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1866)\n at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:164) Caused by: java.lang.IllegalArgumentException\n at java.sql.Date.valueOf(Date.java:143)\n at gas.__loadFromFields(gas.java:670)\n ... 12 more\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-09-16 00:58:07.907 UTC","last_activity_date":"2017-09-24 06:48:04.88 UTC","last_edit_date":"2017-09-24 06:48:04.88 UTC","last_editor_display_name":"","last_editor_user_id":"7294900","owner_display_name":"","owner_user_id":"5960833","post_type_id":"1","score":"0","tags":"mysql|export|database-connection|sqoop","view_count":"17"} +{"id":"36140805","title":"What do I need to use to save changed rows, back to .json file?","body":"\u003cp\u003ePlease help. \u003cbr\u003e\nShort scenario: \u003cbr\u003e\nI select 5 records/rows in a grid, set the value, in 1 of their column, to 'Not Steuart'.\u003cbr\u003e\nSo 5 rows got changed in grid. \u003cbr\u003e\u003c/p\u003e\n\n\u003cp\u003eWhen I use button on the toolbar, \u003cstrong\u003e\u003cem\u003etoolbarSave: true\u003c/em\u003e\u003c/strong\u003e, nothing happens,\n \u003cbr\u003e\u003c/p\u003e\n\n\u003cp\u003eWhat do I need to use to save changed rows, back to .json file ? \u003cbr\u003e\nDo I need to code it in 'onSubmit' ?\n\u003cbr\u003e\u003c/p\u003e\n\n\u003cp\u003eData is read from file: 'url: 'data/DataFromCsv11.json'. \u003cbr\u003e\nMy code below.\u003cbr\u003e\u003c/p\u003e\n\n\u003cp\u003eThank you very much, \u003cbr\u003e\nWaldemar\u003c/p\u003e\n\n\u003cp\u003e==========================================================\u003c/p\u003e\n\n\u003cp\u003e\u003cdiv class=\"snippet\" data-lang=\"js\" data-hide=\"false\"\u003e\r\n\u003cdiv class=\"snippet-code\"\u003e\r\n\u003cpre class=\"snippet-code-js lang-js prettyprint-override\"\u003e\u003ccode\u003evar mySelection;\r\n\r\nfunction setSelectedRecords() {\r\n mySelection = w2ui.grid.getSelection();\r\n //w2alert(mySelection.length);\r\n for (var i = 0; i \u0026lt; mySelection.length; i++) {\r\n w2ui['grid'].set(mySelection[i], {changes:{REVIEWER:'Not Steuart'}\r\n });\r\n }\r\n};\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003c/p\u003e","accepted_answer_id":"36163882","answer_count":"1","comment_count":"0","creation_date":"2016-03-21 20:21:01.847 UTC","favorite_count":"0","last_activity_date":"2016-03-22 19:51:15.337 UTC","last_edit_date":"2016-03-21 20:26:24.683 UTC","last_editor_display_name":"","last_editor_user_id":"6095416","owner_display_name":"","owner_user_id":"6095416","post_type_id":"1","score":"0","tags":"javascript|jquery|w2ui","view_count":"173"} +{"id":"43639952","title":"How to \"return this\" in inner method with Chaining Pattern in java","body":"\u003cp\u003eI want to make inner method with Fluent Programming (a.k.a. Chaining method)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass OuterSay {\n String sentence = \"\";\n public OuterSay sayHello() {\n class OtherLanguage {\n public OuterSay inEnglish() {\n sentence = \"Hello!\";\n return this; // Error :: \"this\" is not OtherLanguage.\n }\n // and there are lots of other language method like inGermany(), inJapanese() and so forth..\n }\n return this;\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eRecently, I used chaining pattern to code easier than before. Please look at above example.\u003c/p\u003e\n\n\u003cp\u003eI want to make inner method (inEnglish() in sayHello() ) because, IDE will help me what can I select (in Eclipse Autocomplete). In that example, IDE recommend me what language can I choose.\u003c/p\u003e\n\n\u003cp\u003eBut \u003cstrong\u003ethe problem is that I cannot return 'OuterSay' class\u003c/strong\u003e from inEnglish() method by using \"return this\" as I learn Chaining method. Of course I know it doesn't work because 'this' object is not OuterSay class but OtherLanguage class. But I don't know how to solve it.\u003c/p\u003e\n\n\u003cp\u003eWhat should I do to use inner method with Fluent Programming? I want to return 'this', which is OuterSay class, in inner method. Please help me.\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2017-04-26 16:37:31.07 UTC","last_activity_date":"2017-04-26 16:39:34.09 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7105963","post_type_id":"1","score":"1","tags":"java|inner-classes|fluent|method-chaining","view_count":"32"} +{"id":"40083241","title":"C string allocation","body":"\u003cp\u003eHey I would like to make some review of my old knowledge of C language usage. I would like to allocate memory for C string and then write to this buffer or read from this buffer C string. What I remember there is something like '\\0' at the end of each character array to denote C-string. \u003c/p\u003e\n\n\u003cp\u003eSo is it correct to always allocate string as (STRLEN + 1) and do the same while reading or writing (to file, socket, etc.). \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003echar *myCString = malloc(sizeof(char)*(STRLEN+1)) \nread(fd, buff, STRLEN+1); \nwrite(fd, buff, STRLEN+1); \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks for clarification this issue. \u003c/p\u003e","answer_count":"1","comment_count":"4","creation_date":"2016-10-17 09:50:28.313 UTC","last_activity_date":"2016-10-17 12:16:38.083 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4415642","post_type_id":"1","score":"-1","tags":"c","view_count":"89"} +{"id":"6241388","title":"HTML5 Audio in JavaScript: What am I doing wrong?","body":"\u003cp\u003eI'm trying to create an HTML 5 audio tag in Javascript. I'm having trouble getting it to work and to preload:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar audioElement = document.createElement('audio');\n\nvar source1 = document.createElement('source');\nsource1.type= 'audio/ogg';\nsource1.src= 'assets/audio/ost.ogg';\nsource1.setAttribute(\"preload\",\"auto\");\naudioElement.appendChild(source1);\n\nvar source2 = document.createElement('source');\nsource2.type= 'audio/mpeg';\nsource2.src= 'assets/audio/ost.mp3';\nsource2.setAttribute(\"preload\",\"auto\");\naudioElement.appendChild(source2);\n\naudioElement.preload = auto;\naudioElement.load();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny ideas?\u003c/p\u003e\n\n\u003cp\u003eThank you.\u003c/p\u003e\n\n\u003cp\u003eEDIT:\u003c/p\u003e\n\n\u003cp\u003eHere's what I ended up doing for anyone wondering. Works in FF3.6, ff4, safari 5, ie9, chrome 11, opera 11.11 (pc)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar audioElement = document.createElement('audio');\naudioElement.setAttribute(\"preload\", \"auto\");\naudioElement.autobuffer = true;\n\nvar source1 = document.createElement('source');\nsource1.type= 'audio/ogg';\nsource1.src= 'assets/audio/ost.ogg';\naudioElement.appendChild(source1);\n\nvar source2 = document.createElement('source');\nsource2.type= 'audio/mpeg';\nsource2.src= 'assets/audio/ost.mp3';\naudioElement.appendChild(source2);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd then:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eaudioElement.load();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks for your help, Kevin.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2011-06-05 06:36:33.703 UTC","last_activity_date":"2011-06-05 07:50:36.007 UTC","last_edit_date":"2011-06-05 07:50:36.007 UTC","last_editor_display_name":"","last_editor_user_id":"749857","owner_display_name":"","owner_user_id":"749857","post_type_id":"1","score":"1","tags":"javascript|html5|audio","view_count":"6432"} +{"id":"19576369","title":"Obtain and keep a selected value in a dropdownlist serving as option","body":"\u003cp\u003eI am trying to display in my application a dropdownlist which will be used as an \"option\" list. The user may select an option that will be applicable elsewhere. This data would be persistent as long as the user stays on the page.\u003c/p\u003e\n\n\u003cp\u003eHere's the dropdownlist:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class ResultsOptions\n{\n public string mStartOption { get; set; }\n\n public List\u0026lt;SelectListItem\u0026gt; mListOptions { get; set; }\n\n public ResultsOptions()\n {\n mListOptions = new List\u0026lt;SelectListItem\u0026gt;();\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis object is then used this way:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[HttpGet]\npublic ActionResult SetResults(string _submitButton, string _option)\n{\n mOptions.mListOptions = new List\u0026lt;SelectListItem\u0026gt;();\n\n foreach (var option in mListOptions)\n {\n if (!String.IsNullOrWhiteSpace(mResultOption))\n {\n if (option == mResultOption)\n {\n SelectListItem item = new SelectListItem\n {\n Selected = true,\n Text = option,\n Value = option\n };\n\n mOptions.mStartOption = option;\n\n mOptions.mListOptions.Add(item);\n }\n else\n {\n SelectListItem item = new SelectListItem\n {\n Text = option,\n Value = option\n };\n\n mOptions.mListOptions.Add(item);\n }\n }\n else\n {\n mOptions.mStartOption = \"\";\n\n SelectListItem item = new SelectListItem\n {\n Text = option,\n Value = option\n };\n mOptions.mListOptions.Add(item);\n }\n }\n\n return PartialView(mOptions);\n}\n\n[HttpPost]\npublic JsonResult SetResults(ResultsOptions _options)\n{\n if (!String.IsNullOrWhiteSpace(_options.mStartOption))\n {\n mResultOption = _options.mStartOption;\n\n mOptions.mStartOption = _options.mStartOption;\n\n var selected = mOptions.mListOptions.First(_x =\u0026gt; _x.Value == _options.mStartOption);\n\n selected.Selected = true;\n }\n\n return Json(new { Message = \"Option saved\" } );\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe \u003ccode\u003emListOptions\u003c/code\u003e is a static list of string containing \u003ccode\u003eStandard\u003c/code\u003e and \u003ccode\u003eSimple\u003c/code\u003e. As you may have guessed, I'm doing a partial view that I render in my layout like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div\u0026gt;\n \u0026lt;div class=\"float-left\"\u0026gt;\n @Html.ActionLink(\"Advanced Search\", \"AdvancedSearch\", \"Store\")\n @Html.ActionLink(\"Browse Promo Packs\", \"PackSearch\", \"Store\")\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"float-right\"\u0026gt;\n @{\n Html.RenderAction(\"SetResults\", \"Store\");\n }\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"clear\"\u0026gt;\u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd finally here's the partial view:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@model MyApp.ViewModels.ResultsOptions\n\n\u0026lt;script type=\"text/javascript\"\u0026gt;\n $.post(\"/Store/SetResults/\", $('#options').serialize(),\n function(data) {\n $('#divMessage').html(data.Message);\n });\n \u0026lt;/script\u0026gt;\n\n@using (Html.BeginForm(null, null, FormMethod.Post, new { @id = \"options\"} ))\n{\n @Html.DropDownListFor(_model =\u0026gt; _model.mStartOption, Model.mListOptions, new { @class = \"nullify\" })\n \u0026lt;input type=\"submit\" name=\"_submitButton\" value=\"Set\"/\u0026gt;\n \u0026lt;div id=\"divMessage\"\u0026gt;\n\n \u0026lt;/div\u0026gt;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo, basically, I want that dropdownlist to be always displayed as an optional list. The value selected will be used later on and will have little to no impact on the display right now.\u003c/p\u003e\n\n\u003cp\u003eHowever I have a problem, when I click on the \"Set\" button, my view \u003cstrong\u003eONLY\u003c/strong\u003e renders the partial view and the rest is flushed. Not what I wanted to do. Can anyone help me out?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI have been working on some Json results as suggested, but I have the same problem: the result message obtained is the \u003cstrong\u003eONLY\u003c/strong\u003e thing that gets displayed afterward.\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2013-10-24 20:49:36.3 UTC","last_activity_date":"2013-10-30 15:38:34.413 UTC","last_edit_date":"2013-10-30 13:43:24.36 UTC","last_editor_display_name":"","last_editor_user_id":"2021863","owner_display_name":"","owner_user_id":"2021863","post_type_id":"1","score":"0","tags":"c#|asp.net-mvc|razor|partial-views|html-select","view_count":"644"} +{"id":"30620558","title":"Zend Engine Outdated (how do i update it?)","body":"\u003cp\u003eAfter installing opcache (after reading it would increase performance), i get the message that Zend Engine API is outdated. But i don't know how to update it?\nI've looked everywhere, with no success.\nIt's a Centos 6 server, with PHP 5.4.41.\nCan someone help?\nThanks\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2015-06-03 12:47:25.873 UTC","last_activity_date":"2015-06-03 22:06:23.09 UTC","last_edit_date":"2015-06-03 22:06:23.09 UTC","last_editor_display_name":"","last_editor_user_id":"105019","owner_display_name":"","owner_user_id":"2413114","post_type_id":"1","score":"3","tags":"php|opcache","view_count":"297"} +{"id":"29377534","title":"Get notification when tabs focus changes in MultiPageEditorPart","body":"\u003cp\u003eHow can I get notified when one of the tabs is clicked in the multi page editor? IPartListener/IPartListener2 seems to react when the whole editor changes state.\u003c/p\u003e","accepted_answer_id":"29378382","answer_count":"1","comment_count":"1","creation_date":"2015-03-31 20:02:37.537 UTC","last_activity_date":"2015-03-31 20:54:50.313 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4735542","post_type_id":"1","score":"0","tags":"eclipse|eclipse-plugin","view_count":"83"} +{"id":"7737753","title":"could not find class, No class definition found","body":"\u003cp\u003eI'm getting \u003ccode\u003eCould not find class\u003c/code\u003e and \u003ccode\u003eNo class definition found\u003c/code\u003e error in Android\u003c/p\u003e\n\n\u003cp\u003eThose classes is inside the jar files. I've added the jar files in a separate folder, but it is not recognized at runtime.\u003c/p\u003e","answer_count":"2","comment_count":"1","creation_date":"2011-10-12 09:14:13.563 UTC","last_activity_date":"2011-10-12 09:28:02.933 UTC","last_edit_date":"2011-10-12 09:25:00.417 UTC","last_editor_display_name":"","last_editor_user_id":"466646","owner_display_name":"","owner_user_id":"910403","post_type_id":"1","score":"0","tags":"java|android","view_count":"1261"} +{"id":"43996265","title":"Plot separate learning curves with tensorboard","body":"\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/58qA1.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/58qA1.png\" alt=\"myplot: accuracy\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eRunning a NN model with tensorflow, I want to plot the accuracy score on both training set and test set. However, the plot tensorboard showed me looked weird: there was only one 'accuracy' tab there, and it plotted the two scores on that same figure. So basically, every step on the x axis has two points connected together. How can I plot two lines (training accuracy and test accuracy) separately on that figure?\u003c/p\u003e\n\n\u003cp\u003eHere's a snippet of my code:\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eloss_summary = tf.summary.scalar('loss', loss)\nacc_summary = tf.summary.scalar('accuracy', accuracy)\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003esummary_loss, summary_acc_train = sess.run([loss_summary, acc_summary], feed_dict={X: X_train, y: y_train})\nsummary_acc_test = sess.run([acc_summary], feed_dict={X: X_test, y: y_test})\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003esummary_writer.add_summary(summary_loss, epoch)\nsummary_writer.add_summary(summary_acc_train, epoch)\nsummary_writer.add_summary(summary_acc_test, epoch)\u003c/code\u003e\u003c/p\u003e","accepted_answer_id":"43997484","answer_count":"1","comment_count":"2","creation_date":"2017-05-16 08:32:12.223 UTC","favorite_count":"1","last_activity_date":"2017-05-16 09:26:42.937 UTC","last_edit_date":"2017-05-16 08:35:51.39 UTC","last_editor_display_name":"","last_editor_user_id":"5729303","owner_display_name":"","owner_user_id":"5729303","post_type_id":"1","score":"2","tags":"tensorflow|tensorboard","view_count":"457"} +{"id":"796027","title":"Threaded implementation of observer pattern - C++","body":"\u003cp\u003eI'm developing a C++ program which has a \"scan\" method which will trigger a relatively long running scanning procedure. When the procedure is completed, the scan method will notify observers of results using the observer pattern. \u003c/p\u003e\n\n\u003cp\u003eI would like to create a separate thread for each scan. This way I can run multiple scans simultaneously. When each scanning process completes, I would like the scan method to notify the listeners.\u003c/p\u003e\n\n\u003cp\u003eAccording the boost thread library, it looks like I can maybe do something like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;boost/thread/thread.hpp\u0026gt;\n#include \u0026lt;boost/thread/mutex.hpp\u0026gt;\n#include \u0026lt;boost/bind.hpp\u0026gt;\n#include \u0026lt;iostream\u0026gt;\n\nboost::mutex io_mutex;\n\nvoid scan(int scan_target, vector\u0026lt;Listener\u0026gt; listeners) \n{\n //...run scan \n {\n boost::mutex::scoped_lock \n lock(io_mutex);\n std::cout \u0026lt;\u0026lt; \"finished scan\" \u0026lt;\u0026lt; endl;\n // notify listeners by iterating through the vector\n // and calling \"notify()\n\n }\n}\n\nint main(int argc, char* argv[])\n{\n\n vector\u0026lt;Listener\u0026gt; listeners\n // create \n boost::thread thrd1(\n boost::bind(\u0026amp;scan, 1, listeners));\n boost::thread thrd2(\n boost::bind(\u0026amp;scan, 2, listeners));\n //thrd1.join();\n //thrd2.join();\n return 0;\n} \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eDoes this look roughly correct? Do I need to mutex the call to listenrs? Is it ok to get rid of the joins? \u003c/p\u003e","answer_count":"3","comment_count":"1","creation_date":"2009-04-28 02:37:33.94 UTC","favorite_count":"2","last_activity_date":"2009-04-28 04:18:32.763 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"64895","post_type_id":"1","score":"0","tags":"c++|multithreading|boost|observer-pattern","view_count":"3182"} +{"id":"33040854","title":"pycuda fail; Theano with Anaconda","body":"\u003cp\u003eI'm using Anaconda to install Theano on MacOSX (Mavericks 10.9 ), just like this post explains: \"\u003ca href=\"https://stackoverflow.com/questions/30398000/how-to-make-theano-operate-on-mac-lion\"\u003eHow to make Theano operate on Mac Lion?\u003c/a\u003e\"\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003etheano.test() \u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eThis command gives the same error as in the post above. It gives that error on an Ubuntu 14.1, System 76 as well. \u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eI am able to import commands from Theano; but I still would like to understand why theano.test() fails. The packages CUDA and Boost were already installed before running...\u003c/strong\u003e \u003c/p\u003e\n\n\u003cp\u003e(Reference: See section: \"\u003cem\u003eTesting your Installation\u003c/em\u003e\" \u003ca href=\"http://deeplearning.net/software/theano/install.html\" rel=\"nofollow noreferrer\"\u003ehttp://deeplearning.net/software/theano/install.html\u003c/a\u003e)\u003c/p\u003e\n\n\u003cp\u003eAs the post suggests, I assumed the fix would come from installing the XCode command line, homebrew, and pycuda. The first two were installed just fine. But pycuda fails:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003epip install pycuda\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003e....gives the following error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026gt; src/cpp/cuda.cpp -o build/temp.macosx-10.5-x86_64-3.4/src/cpp/cuda.o\n \u0026gt; In file included from src/cpp/cuda.cpp:1:\n\n\u0026gt; \n\u0026gt; src/cpp/cuda.hpp:14:10: fatal error: 'cuda.h' file not found\n\u0026gt; #include \u0026lt;cuda.h\u0026gt;\n\n\u0026gt; ^\n\u0026gt; 1 error generated.\n\u0026gt; error: command 'gcc' failed with exit status 1\n\u0026gt; \n\n\n \u0026gt; Command \"//anaconda/bin/python3 -c \"import setuptools,\n\n \u0026gt;tokenize;__file__='/private/var/folders/5b/5g1stsns34x_7mgynxhhvf1h0000gn/T/pip-build-4raihcb4/pycuda/setup.py';exec(compile(getattr(tokenize,\n \u0026gt; 'open', open)(__file__).read().replace('\\r\\n', '\\n'), __file__,\n \u0026gt; 'exec'))\" install --record\n \u0026gt; /var/folders/5b/5g1stsns34x_7mgynxhhvf1h0000gn/T/pip-kr_3ws22-record/install-record.txt\n\n\n\n \u0026gt;\u0026gt; --single-version-externally-managed --compile\" failed with error code 1 in\n\n \u0026gt; /private/var/folders/5b/5g1stsns34x_7mgynxhhvf1h0000gn/T/pip-build-4raihcb4/pycuda\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt seems like the first error (gcc failed) is that the complier is not finding gcc. (Note again: I installed the MacOSX command line tools) \u003c/p\u003e\n\n\u003cp\u003eI run \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ewhich gcc \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethis gives usr/bin/gcc \u003c/p\u003e\n\n\u003cp\u003eI also tried : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epython configure.py --cuda-root=/usr/local/cuda\n--cuda-inc-dir=/Developer/NVIDIA/CUDA-5.5/include --cudart-lib-dir=/Developer/NVIDIA/CUDA-5.5/lib\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThat didn't work as well. \u003c/p\u003e\n\n\u003cp\u003eHas anyone else had this difficulty installing pycuda and can make a recommendation here? Thanks.\u003c/p\u003e","answer_count":"2","comment_count":"1","creation_date":"2015-10-09 14:30:13.973 UTC","favorite_count":"1","last_activity_date":"2016-06-23 09:49:53.523 UTC","last_edit_date":"2017-05-23 10:27:31.467 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"1374969","post_type_id":"1","score":"2","tags":"python|xcode|theano|pycuda","view_count":"1952"} +{"id":"32202570","title":"How to differentiate value of array with two object with same key in java","body":"\u003cp\u003eI am implementing an Android app. I have a google spreadsheet with 100 rows and 2 columns. I am fetching record of google spreadsheet in my app. I got the JSON response like that : \u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eJSON Response\u003c/code\u003e \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n \"version\": \"0.6\",\n \"reqId\": \"0\",\n \"status\": \"ok\",\n \"sig\": \"862971983\",\n \"table\": {\n \"cols\": [\n {\n \"id\": \"A\",\n \"label\": \"Name\",\n \"type\": \"string\"\n },\n {\n \"id\": \"B\",\n \"label\": \"PhoneNo\",\n \"type\": \"number\",\n \"pattern\": \"General\"\n }\n ],\n \"rows\": [\n {\n \"c\": [\n {\n \"v\": \"A Anil C Agrawal\"\n },\n {\n \"v\": 7926605853,\n \"f\": \"7926605853\"\n }\n ]\n },\n {\n \"c\": [\n {\n \"v\": \"A Balaji Agarwal\"\n },\n {\n \"v\": 8463225752,\n \"f\": \"8463225752\"\n }\n ]\n },.................\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere I have \u003cstrong\u003eC\u003c/strong\u003e is array type with two object with same key but I want this same keys in different variable for Ex. String Name, String PhoneNo. \u003c/p\u003e\n\n\u003cp\u003eHere is my method which is fetching google spreadsheet response and print it. If I print the value of Name so its showing both Name and phone number but I want like that Name= Abc and PhoneNo = 8574968521. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic void getSpreadSheetData() {\n String result = getSpreadSheetResponce();\n List\u0026lt;String\u0026gt; arrayList = new ArrayList\u0026lt;String\u0026gt;();\n if (result == null) {\n Log.e(\"net not present:\", \"\");\n } else {\n int start = result.indexOf(\"{\", result.indexOf(\"{\") + 1);\n int end = result.lastIndexOf(\"}\");\n String jsonResponse = result.substring(start, end);\n\n try {\n JSONObject mainObj = new JSONObject(jsonResponse);\n String Name = null;\n\n if (mainObj != null) {\n JSONArray list = mainObj.getJSONArray(\"rows\");\n if (list != null) {\n for (int i = 0; i \u0026lt; list.length(); i++) {\n JSONObject innerJsonObject = list.getJSONObject(i);\n if (innerJsonObject != null) {\n //\n JSONArray valuesJsonArray = innerJsonObject\n .getJSONArray(\"c\");\n if (valuesJsonArray != null) {\n for (int j = 0; j \u0026lt; valuesJsonArray\n .length(); j++) {\n JSONObject innerElem = valuesJsonArray\n .getJSONObject(j);\n if (innerElem != null) {\n Name = innerElem.getString(\"v\");\n arrayList.add(Name);\n Log.i(\"arrayList\", \"\" + arrayList);\n\n }\n }\n }\n }\n }\n }\n }\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }\n\n }\n\n private String getSpreadSheetResponce() {\n\n String responce = \" \";\n String urlString = \"\";\n try {\n String FETCH_ROW_WITH_WHERE_CLAUSE_URL = \"https://spreadsheets.google.com/tq?tq\u0026amp;key=1n_VjwHm8qIU5YRMM-wMkJIap2KZa5vOfxWI5dpYT1PE\u0026amp;gid=1262286779\";\n URL urlspreadsheet = new URL(FETCH_ROW_WITH_WHERE_CLAUSE_URL);\n URLConnection urlConnection = urlspreadsheet.openConnection();\n HttpURLConnection connection = null;\n if (urlConnection instanceof HttpURLConnection) {\n connection = (HttpURLConnection) urlConnection;\n } else {\n System.out.println(\"Please enter an HTTP URL.\");\n }\n BufferedReader in = new BufferedReader(new InputStreamReader(\n connection.getInputStream()));\n String current;\n\n while ((responce = in.readLine()) != null) {\n urlString += responce;\n System.out.println(urlString);\n Log.e(\"Response::\", \"in loop:\" + urlString);\n }\n Log.e(\"Response::\", \"final response:\" + urlString);\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n\n return urlString;\n\n } \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs it to possible please help me.\u003c/p\u003e","answer_count":"3","comment_count":"2","creation_date":"2015-08-25 11:15:01.007 UTC","favorite_count":"1","last_activity_date":"2015-08-25 12:34:56.27 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5092295","post_type_id":"1","score":"0","tags":"android|json|arraylist|google-spreadsheet","view_count":"288"} +{"id":"13887790","title":"Backbone JS, Marionette and Require JS","body":"\u003cp\u003eI am trying to get to grips with Backbone and Require JS using marionette for some of its excellent features. However I am finding a few issues with the app being available to views:\u003c/p\u003e\n\n\u003cp\u003emain.js\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003erequire(['application'], function(app){\napp.start();\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eapplication.js\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edefine([\n'marionette',\n'router'\n], function(marionette, Router){\n\n\"use strict\";\n\nvar app = new marionette.Application();\n\napp.addRegions({\n header : 'header',\n main : '#main'\n});\n\napp.addInitializer(function(){\n this.router = new Router();\n});\n\nreturn app;\n\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003edashboard.js\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edefine([\n'application',\n'underscore',\n'backbone', \n], function(app, _, Backbone) {\nvar DashboardView = Backbone.View.extend({\n\ninitialize: function() {\n console.log(app);\n $('a').click(function(e){\n e.preventDefault();\n app.router.navigate(\"claims\", {\n trigger: true \n });\n });\n},\n\n});\nreturn DashboardView;\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am receiving undefined in the console log? Should the application be using requirejs modules instead?\u003c/p\u003e\n\n\u003cp\u003eEDIT: Update with require\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003erequire.config({\n\npaths: {\n 'jquery' : '../vendors/jquery-1.8.2',\n 'underscore' : '../vendors/underscore',\n 'text' : '../vendors/text',\n 'json2' : '../vendors/json2',\n 'backbone' : '../vendors/backbone',\n 'marionette' : '../vendors/plugins/backbone.marionette',\n 'paginator' : '../vendors/plugins/backbone.paginator',\n 'relational' : '../vendors/plugins/backbone.relational',\n 'moment' : '../vendors/moment',\n 'bootstrap' : '../vendors/bootstrap',\n 'datepicker' : '../vendors/plugins/bootstrap.datepicker',\n 'templates' : 'templates/'\n},\n\nshim: {\n\n backbone: {\n deps: ['underscore', 'jquery'],\n exports: 'Backbone'\n },\n marionette : {\n exports : 'Backbone.Marionette',\n deps : ['backbone']\n },\n paginator: {\n deps: [\n 'backbone',\n 'underscore',\n 'jquery'\n ],\n exports: 'Backbone.Paginator'\n },\n relational: ['backbone'],\n underscore: {\n 'exports': '_'\n },\n bootstrap: {\n deps: ['jquery'],\n exports: \"bootstrap\"\n },\n datepicker: {\n deps: ['jquery','bootstrap'],\n exports: \"datepicker\"\n },\n moment: {\n exports: 'moment'\n }\n}\n\n});\n\nrequire(['application'], function(app){\n app.start();\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003erouter\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edefine([\n 'views/claims/PaginatedList',\n 'views/dashboard/Dashboard'\n ], function(PaginatedClaimListView, DashboardView){\n\nvar Router = Backbone.Router.extend({\n\n routes: {\n\n \"\": \"index\",\n \"claims\": \"claims\"\n\n },\n\n initialize: function(){\n Backbone.history.start({\n pushState: true,\n root: '/app_dev.php/hera'\n });\n },\n\n index: function(){\n var dashboard = new DashboardView();\n },\n\n claims: function(){\n var claimListView = new PaginatedClaimListView();\n }\n\n});\n\nreturn Router;\n\n});\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"13901461","answer_count":"3","comment_count":"4","creation_date":"2012-12-14 23:40:25.683 UTC","favorite_count":"2","last_activity_date":"2013-07-05 17:21:10.293 UTC","last_edit_date":"2012-12-15 17:40:06.597 UTC","last_editor_display_name":"","last_editor_user_id":"538431","owner_display_name":"","owner_user_id":"538431","post_type_id":"1","score":"2","tags":"backbone.js|requirejs|marionette","view_count":"2619"} +{"id":"17055729","title":"Google Maps API v.3 multiple markers infowindows","body":"\u003cp\u003eI've looked through a lot of the similar questions on here, but have not found anything that will answer my question. I am new to JS and GoogleMaps API v3, and have successfully followed their tutorials to get this far. However, I'd like to have an infowindow with custom content appear based on which marker is clicked, and I cannot figure out how to do this. I'd also like to have this be possible with around 100 markers, so I'd like to know the best way to do this as well without things getting too messy. To be clear, there are 3 types of icons, but there will eventually be many markers associated with each icon, so I will need content linked to each \"feature\". Hopefully I've got a good start here and am not way off base. I've included the code for the page. Thank you so much in advance for any help anyone can provide. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;!DOCTYPE html\u0026gt;\n\u0026lt;html\u0026gt;\n \u0026lt;head\u0026gt;\n \u0026lt;style\u0026gt;\n #map_canvas {\n width: 800px;\n height: 500px;\n background-color:#CCC;\n }\n #legend {\n font-family: Arial, sans-serif;\n background: #fff;\n padding: 10px;\n margin: 10px;\n border: 3px solid #000;\n }\n #legend img {\n vertical-align: middle;\n }\n \u0026lt;/style\u0026gt;\n \u0026lt;script src=\"http://maps.googleapis.com/maps/api/js?sensor=false\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;script\u0026gt;\n function initialize() {\n var map_canvas = document.getElementById('map_canvas');\n var map_options = {\n center: new google.maps.LatLng(33.137551,-0.703125),\n zoom: 2,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n };\n var map = new google.maps.Map(map_canvas, map_options);\n map.set('styles', [\n {\n featureType: 'road',\n elementType: 'geometry',\n stylers: [\n { color: '#888888' },\n { weight: 1.0 }\n ]\n }, {\n featureType: 'landscape',\n elementType: 'geometry.fill',\n stylers: [\n { hue: '#008f11' },\n { gamma: 1.0 },\n { saturation: 0 },\n { lightness: -10 }\n ] \n }, {\n featureType: 'water',\n elementType: 'geometry.fill',\n stylers: [\n { hue: '#054d8fd' },\n { gamma: 1.0 },\n { saturation: 0 },\n { lightness: -10 }\n ] \n }, {\n featureType: 'poi',\n elementType: 'geometry',\n stylers: [\n { visibility: 'off' }\n ]\n }\n ]);\n var iconBase = 'http://i1318.photobucket.com/albums/t658/greatergoodorg/';\n var icons = {\n people: {\n name: 'People',\n icon: iconBase + 'people_zps26d13009.png',\n shadow: iconBase + 'shadow-people_zps4b39eced.png'\n },\n pets: {\n name: 'Pets',\n icon: iconBase + 'pets_zps15f549f2.png',\n shadow: iconBase + 'shadow-pets_zps361068aa.png'\n },\n planet: {\n name: 'Planet',\n icon: iconBase + 'planet_zps2a8572ce.png',\n shadow: iconBase + 'shadow-planet_zps9912e26b.png',\n }\n };\n var data = [\"This is the first one\", \"This is the second one\", \"This is the third one\"];\n function addMarker(feature) {\n var marker = new google.maps.Marker({\n position: feature.position,\n icon: icons[feature.type].icon, \n shadow: {\n url: icons[feature.type].shadow,\n anchor: new google.maps.Point(21, 32)\n },\n animation: google.maps.Animation.DROP,\n map: map\n });\n /*...\n google.maps.event.addListener(marker, \"click\", function () {\n infowindow.open(map,marker);\n });\n ...*/\n /*...\n google.maps.event.addListener(marker, 'click', function() {\n map.setZoom(8);\n map.setCenter(marker.getPosition());\n });\n ...*/\n }\n var features = [\n {\n position: new google.maps.LatLng(33.137551,-0.703125),\n type: 'planet'\n },\n {\n position: new google.maps.LatLng(44.234234,-0.232233),\n type: 'pets'\n },\n {\n position: new google.maps.LatLng(54.234234,-0.032233),\n type: 'people'\n }\n ];\n for (var i = 0, feature; feature = features[i]; i++) {\n addMarker(feature);\n } \n var legend = document.getElementById('legend');\n for (var key in icons) {\n var type = icons[key];\n var name = type.name;\n var icon = type.icon;\n var div = document.createElement('div');\n div.innerHTML = '\u0026lt;img src=\"' + icon + '\"\u0026gt; ' + name;\n legend.appendChild(div);\n }\n map.controls[google.maps.ControlPosition.LEFT_BOTTOM].push(\n document.getElementById('legend'));\n }\n google.maps.event.addDomListener(window, 'load', initialize);\n \u0026lt;/script\u0026gt; \n \u0026lt;/head\u0026gt;\n \u0026lt;body\u0026gt; \n \u0026lt;div id=\"map_canvas\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;div id=\"legend\"\u0026gt;\u0026lt;strong\u0026gt;Project Types\u0026lt;/strong\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;/body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"17057006","answer_count":"1","comment_count":"1","creation_date":"2013-06-12 00:00:37.743 UTC","last_activity_date":"2013-06-12 02:56:30.37 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2476456","post_type_id":"1","score":"-1","tags":"google-maps-api-3|marker|infowindow","view_count":"853"} +{"id":"12801443","title":"How to get call relations of an open solution by using a plugin","body":"\u003cp\u003eI try to develop a VSPackage for VS 2010 that investigates all the available methods in the current solution and to reconstruct the call relations of each single method just like the built in Call Hierarchy feature of VS does.\u003c/p\u003e\n\n\u003cp\u003eI managed to get all the available names of the types and its members in the solution by using the DTE automation object by going down from the solution to its projects, the projects classes/types and the classes members (most importantly its methods), however I’m not able to reconstruct the call relations. I did not find any service of VS/VS SDK that could provide me some help. Any hints?\u003c/p\u003e\n\n\u003cp\u003eThanks in advance!\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2012-10-09 13:41:48.267 UTC","favorite_count":"2","last_activity_date":"2012-10-09 13:41:48.267 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1098221","post_type_id":"1","score":"4","tags":"visual-studio-2010|vsx|vspackage|visual-studio-sdk|call-hierarchy","view_count":"80"} +{"id":"25299816","title":"Vagrant docker provisioner command","body":"\u003cp\u003eI have a Vagrantfile that installs mysql via docker, and then I would like to run an additional command to create my database. Right now my Vagrantfile has\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003econfig.vm.provision \"docker\" do |d|\n d.pull_images \"tutum/mysql\"\n d.run \"tutum/mysql\",\n args: ' -e MYSQL_PASS=\"password\" --name mysql -p 3306:3306',\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI know I could create a shell provisioner to run the bootstrap script, but I'm wondering if there's a way to do it through docker.\u003c/p\u003e","accepted_answer_id":"25302994","answer_count":"1","comment_count":"0","creation_date":"2014-08-14 03:57:51.177 UTC","last_activity_date":"2015-03-25 13:38:32.683 UTC","last_edit_date":"2015-03-25 13:38:32.683 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"121993","post_type_id":"1","score":"0","tags":"mysql|vagrant|docker","view_count":"744"} +{"id":"23581242","title":"Unwanted backslash added to file saved by java method","body":"\u003cp\u003eIn my spring project, one of my service classes has this method to save a file named database.properties in disk:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic void create_properties(String maquina, String usuario, String senha) {\n System.out.println(\"create_properties\");\n Properties props = new Properties();\n\n props.setProperty(\"jdbc.Classname\", \"org.postgresql.Driver\");\n props.setProperty(\"jdbc.url\", \"jdbc:postgresql://\"+maquina+\"/horario\" );\n props.setProperty(\"jdbc.user\", usuario );\n props.setProperty(\"jdbc.pass\", senha );\n\n props.setProperty(\"hibernate.dialect\", \"org.hibernate.dialect.PostgreSQLDialect\");\n props.setProperty(\"hibernate.show_sql\", \"false\");\n props.setProperty(\"hibernate.hbm2ddl.auto\", \"validate\");\n\n FileOutputStream fos;\n try {\n fos = new FileOutputStream( \"database.properties\" );\n props.store( fos, \"propriedades\" );\n fos.close();\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy problem is that the property jdbc:url should be something like that:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ejdbc:postgresql://localhost:5432/horario\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut what is being saved is this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ejdbc\\:postgresql\\://localhost\\:5432/horario\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnyone can tell me how to avoid this backslashes to be included?\u003c/p\u003e","accepted_answer_id":"23581266","answer_count":"1","comment_count":"0","creation_date":"2014-05-10 12:48:59.87 UTC","last_activity_date":"2014-05-10 12:51:21.91 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2692962","post_type_id":"1","score":"0","tags":"java|properties|fileoutputstream","view_count":"535"} +{"id":"23432244","title":"Why does 'abc'.toString() give a different result than toString.call('abc')?","body":"\u003cp\u003eSomtehing that's bugging me this morning:\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003e'abc'.toString()\u003c/code\u003e returns \u003ccode\u003e'abc'\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003etoString.call('abc')\u003c/code\u003e returns \u003ccode\u003e'[object String]'\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eWhy the difference? \u003c/p\u003e","accepted_answer_id":"23432285","answer_count":"2","comment_count":"1","creation_date":"2014-05-02 15:57:02.217 UTC","last_activity_date":"2014-05-02 16:23:46.223 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"346219","post_type_id":"1","score":"1","tags":"javascript","view_count":"70"} +{"id":"1140029","title":"How to submit form via jQuery and refresh PartialView","body":"\u003cp\u003eStackoverflow does it so well, submit a comment and it gets refreshed on the screen using jQuery. \u003cstrong\u003eHow is it done?\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI was dissecting the code to learn.\u003c/p\u003e\n\n\u003cp\u003eLooks like it is happening here: in the html below, the link click event is bound by jQuery to load a textarea to a dynamic form. \u003cstrong\u003eHow is the submit button wired and how is the data sent to the server?\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"post-comments\"\u0026gt;\n \u0026lt;div id=\"comments-1122543\" class=\"display-none comments-container\"\u0026gt;\n \u0026lt;div class=\"comments\"\u0026gt; \n \u0026lt;/div\u0026gt; \n \u0026lt;form id=\"form-comments-1122543\" class=\"post-comments\"\u0026gt;\u0026lt;/form\u0026gt; \n \u0026lt;/div\u0026gt; \n \u0026lt;a id=\"comments-link-1122543\" class=\"comments-link\" title=\"add a comment to this post\"\u0026gt;add comment\u0026lt;/a\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand the javascript:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar j = function (s, v) {\n var r = $(\"#form-comments-\" + s);\n if (r.length \u0026gt; 0) {\n var u = '\u0026lt;table\u0026gt;\u0026lt;tr\u0026gt;\u0026lt;td\u0026gt;\u0026lt;textarea name=\"comment\" cols=\"68\" rows=\"3\" maxlength=\"' + q;\n u += '\" onblur=\"comments.updateTextCounter(this)\" ';\n u += 'onfocus=\"comments.updateTextCounter(this)\" onkeyup=\"comments.updateTextCounter(this)\"\u0026gt;\u0026lt;/textarea\u0026gt;';\n u += '\u0026lt;input type=\"submit\" value=\"Add Comment\" /\u0026gt;\u0026lt;/td\u0026gt;\u0026lt;/tr\u0026gt;\u0026lt;tr\u0026gt;\u0026lt;td\u0026gt;\u0026lt;span class=\"text-counter\"\u0026gt;\u0026lt;/span\u0026gt;';\n u += '\u0026lt;span class=\"form-error\"\u0026gt;\u0026lt;/span\u0026gt;\u0026lt;/td\u0026gt;\u0026lt;/tr\u0026gt;\u0026lt;/table\u0026gt;';\n r.append(u);\n r.validate({\n rules: {\n comment: {\n required: true,\n minlength: 15\n }\n },\n errorElement: \"span\",\n errorClass: \"form-error\",\n errorPlacement: function (y, z) {\n var A = z.parents(\"form\").find(\"span.form-error\");\n A.replaceWith(y)\n },\n submitHandler: function (y) {\n disableSubmitButton($(y));\n g(s, $(y))\n }\n });\n var t = $(\"#comments-\" + s + \" tr.comment:first td.comment-actions\").width() || -1;\n t += 9;\n r.children(\"table\").css(\"margin-left\", t + \"px\")\n } else {\n var w = \"no-posting-msg-\" + s;\n if ($(\"#\" + w).length == 0) {\n var x = $(\"#can-post-comments-msg-\" + s).val();\n v.append('\u0026lt;div id=\"' + w + '\" style=\"color:maroon\"\u0026gt;' + x + \"\u0026lt;/span\u0026gt;\")\n }\n }\n};\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"1223648","answer_count":"2","comment_count":"0","creation_date":"2009-07-16 20:16:22.327 UTC","favorite_count":"2","last_activity_date":"2009-08-03 17:45:14.64 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"59941","post_type_id":"1","score":"3","tags":"jquery|forms","view_count":"4926"} +{"id":"8474909","title":"c# templating integer methods?","body":"\u003cp\u003eIs it possible to template methods for any kind of integer size ?\u003c/p\u003e\n\n\u003cp\u003eTo illustrate, imagine this very trivial example (the body of the method is not important in my question):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic int Mul(int a, int b) {\n return a*b;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow, I want the same method that supports any kind of integer (excluding BigInteger of course). I have to write all variants :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic long Mul(long a, long b) {\n return a*b;\n}\npublic ulong Mul(ulong a, ulong b) {\n return a*b;\n}\npublic short Mul(short a, short b) {\n return a*b;\n}\npublic ushort Mul(ushort a, ushort b) {\n return a*b;\n}\npublic byte Mul(byte a, byte b) {\n return a*b;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhile this example is very trivial and it's not actually a problem to duplicate, if I have more complex algorithms like this (replicate for all integer kinds):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public static IEnumerable\u0026lt;long\u0026gt; GetPrimesFactors(this long number)\n {\n for (long i = 2; i \u0026lt;= number / 2; i++)\n {\n while (number % i == 0)\n {\n yield return i;\n number /= i;\n }\n }\n yield return number;\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eit introduces a maintenance risk as there is duplicated code and logic (coding integrists would say this is the evil to have same logic at multiple place).\u003c/p\u003e\n\n\u003cp\u003eSome of you may suggest to implements the long version and cast the result, but having to ask consumer code to cast can be confusing and reduce readability :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evoid SomeMethod(IEnumerable\u0026lt;int\u0026gt; valuesToProcess)\n{\n foreach(int value in valuesToProcess) { Console.WriteLine(value); }\n}\n\nvoid Main()\n{\n int i = 42;\n SomeMethod(((long)i).GetPrimesFactors().Select(l=\u0026gt;(int)l)); \n SomeMethod(GetPrimesFactors(i));\n\n long l = 42L;\n SomeMethod(l.GetPrimesFactors().Select(l=\u0026gt;(int)l));\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I see the definition of the interface \u003ccode\u003eIEnumerable\u0026lt;T\u0026gt;\u003c/code\u003e, and especially the definitions of \u003ccode\u003eSum\u003c/code\u003e method overloads :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public static decimal? Sum(this IEnumerable\u0026lt;decimal?\u0026gt; source);\n public static decimal Sum(this IEnumerable\u0026lt;decimal\u0026gt; source);\n public static double? Sum(this IEnumerable\u0026lt;double?\u0026gt; source);\n public static double Sum(this IEnumerable\u0026lt;double\u0026gt; source);\n public static float? Sum(this IEnumerable\u0026lt;float?\u0026gt; source); \n public static float Sum(this IEnumerable\u0026lt;float\u0026gt; source);\n public static int? Sum(this IEnumerable\u0026lt;int?\u0026gt; source);\n public static int Sum(this IEnumerable\u0026lt;int\u0026gt; source);\n public static long? Sum(this IEnumerable\u0026lt;long?\u0026gt; source);\n public static long Sum(this IEnumerable\u0026lt;long\u0026gt; source);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI conclude that it's not possible... that's why MS has to implement all overloads.\u003c/p\u003e\n\n\u003cp\u003eDoes anyone have any tips for designing general purpose integer methods without having to duplicate logic ?\u003c/p\u003e","accepted_answer_id":"8475007","answer_count":"5","comment_count":"9","creation_date":"2011-12-12 13:15:08.13 UTC","last_activity_date":"2011-12-12 13:57:05.747 UTC","last_edit_date":"2011-12-12 13:23:23.193 UTC","last_editor_display_name":"","last_editor_user_id":"588868","owner_display_name":"","owner_user_id":"588868","post_type_id":"1","score":"3","tags":"c#","view_count":"130"} +{"id":"22096324","title":"Cache data locally waiting for an internet connection in Android","body":"\u003cp\u003eI am working on an app where I need to POST data(a JSON string) to a web server. I am doing this using the Apache HTTP Client(attached code below). When there is an internet connection everything works fine, but the project spec needs me to cache data locally if there is no internet connection and wait till I have a connection to the server. \u003c/p\u003e\n\n\u003cp\u003eHere are my questions:\n1. What would be the best way to cache the JSON strings locally and send them on their way when I get an internet connection. The only way I can think of is to store them in a database till I find a connection to the server.\u003c/p\u003e\n\n\u003col start=\"2\"\u003e\n\u003cli\u003eHow do I check if I have an Internet connection?\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eThe code from the POST is here, If I have to catch the data I am assuming I will have to do it in place of the \"no connection\" error dialogue in the exception handle.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eThread t = new Thread() \n { \n\n public void run() \n {\n Looper.prepare(); //For Preparing Message Pool for the child Thread\n HttpClient client = new DefaultHttpClient();\n HttpConnectionParams.setConnectionTimeout(client.getParams(), 10000); //Timeout Limit\n HttpResponse response;\n try {\n HttpPost post = new HttpPost(\"http:xxxxx\");\n\n StringEntity se = new StringEntity( flat.toString()); \n se.setContentType(new BasicHeader(HTTP.CONTENT_TYPE, \"application/json\"));\n post.setEntity(se);\n response = client.execute(post);\n\n\n // /*Checking response */\n if(response!=null){\n InputStream in = response.getEntity().getContent(); //Get the data in the entity\n }\n\n } catch(Exception e) \n {\n e.printStackTrace();\n //createDialog(\"Error\", \"Cannot Estabilish Connection\");\n Toast.makeText(getApplicationContext(), \"cannot establish concetion\",Toast.LENGTH_SHORT).show();\n }\n\n Looper.loop(); //Loop in the message queue\n }\n };\n\n t.start(); \n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"22096436","answer_count":"3","comment_count":"0","creation_date":"2014-02-28 13:19:54.65 UTC","last_activity_date":"2015-01-02 10:13:50.23 UTC","last_edit_date":"2015-01-02 10:01:56.79 UTC","last_editor_display_name":"","last_editor_user_id":"1254536","owner_display_name":"","owner_user_id":"2544048","post_type_id":"1","score":"2","tags":"java|android|caching|androidhttpclient","view_count":"2604"} +{"id":"44936743","title":"Using the sh Python module, avoid exception logging when killing a background process","body":"\u003cp\u003eThe following Python:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ep=sh.sleep(100, _bg=True)\n\ntry:\n p.kill()\nexcept sh.SignalException_SIGKILL:\n print('foo')\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eGives me:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026gt;\u0026gt;\u0026gt; Exception in thread background thread for pid 14892:\nTraceback (most recent call last):\n\n\u0026lt;blah blah blag, long stack trace elided\u0026gt; \n\nsh.SignalException_SIGKILL: \n\nRAN: /usr/bin/sleep 100\n\nSTDOUT:\n\nSTDERR:\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow can I avoid the background thread logging an error for something I expect to happen?\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2017-07-05 22:06:01.813 UTC","last_activity_date":"2017-07-05 22:06:01.813 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"139781","post_type_id":"1","score":"0","tags":"python","view_count":"28"} +{"id":"24281222","title":"Haskell extension for function indentation syntax","body":"\u003cp\u003eApologies for the vague question title; I could't figure out the right one.\u003c/p\u003e\n\n\u003cp\u003eA few years ago I ran into a page (on the Haskell Prime wiki, I guess) of a language extension proposal. Suppose a Haskell code like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ef1 (f2 v1 v2 v3) (f3 v4 v5 v6)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand let's say the \u003ccode\u003ef2 v1 ...\u003c/code\u003e part has long function names and value names, making the whole line a lot longer than desirable and harder to read. We would want to change it into\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ef1\n (f2 v1 v2 v3)\n (f3 v4 v5 v6)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhich is more readable and would represent the structure a lot more clearly, i.e. what is argument for what. But then, if we have a more complex relation like\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ef1\n (f2 (f3 v1) (f4 v2) v3)\n (f5 v4)\n (f7 v5)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethen it gets untidy very quickly and parentheses get out of control.\u003c/p\u003e\n\n\u003cp\u003eIdeally we could\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ef1\n f2\n f3 v1\n f4 v2\n v3\n f5 v4\n f7 v5\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo the structure is clear for both human and machine. But since it was impossible with the Haskell standard, a bunch of smart guys came up with the idea of a language extension to allow a new operator. The operator looked like \u003ccode\u003e$\u003c/code\u003e but had a different associativity. Let's say it's called \u003ccode\u003e$$\u003c/code\u003e, then:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ef1 $$\n f2 v1 v2 v3\n f3 v4 v5 v6\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewould be equivalent to \u003ccode\u003ef1 (f2 v1 v2 v3) (f3 v4 v5 v6)\u003c/code\u003e and\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ef1 $$\n f2 $$\n f3 v1\n f4 v2\n v3\n f5 v4\n f7 v5\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewould translate to \u003ccode\u003ef1 (f2 (f3 v1) (f4 v2) v3) (f5 v4) (f7 v5)\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eI'd love to use a GHC extension for this feature because implementing a DSL with a tree-like structure would be a breeze with it, but I couldn't locate any resource at all.\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eWhat is this concept (and the operator I called \u003ccode\u003e$$\u003c/code\u003e) called?\u003c/li\u003e\n\u003cli\u003eIs there already a GHC extension for this?\n\u003cul\u003e\n\u003cli\u003eIf there isn't, I'd really appreciate links to any other related extension. I am willing to learn how to write a GHC extension to implement this.\u003c/li\u003e\n\u003c/ul\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdit\u003c/strong\u003e: I know there are many workarounds, including Template Haskell QQ and parentheses, but I remember seeing a language extension proposal and my question is about that extension, not about the other ways of addressing the problem.\u003c/p\u003e\n\n\u003cp\u003eBy the way, I feel very reluctant to consider parentheses an option, because parenthesizing a complex nested structure will make it look very cluttered and defeat the whole point of indent-based code layout. The benefit of \"off-side rule\" syntax over \"curly brackets\" syntax is compromised if you have to parenthesize just about everything and manually style it to look structured. I am pretty sure there are many Haskellers who consider it unclean, as observed in monoid-based libraries having a meaningless instance of monad (and an empty value to pass around) to exploit the \u003ccode\u003edo\u003c/code\u003e syntax. While they can write\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eexample = mappend\n [ lorem ipsum\n , dolor amet\n ]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethey prefer to declare a monad instance and write\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eexample = do\n lorem ipsum\n dolor amet\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003enot because it makes more sense type-wise but because it just looks clean and concise. (In fact the issue is worse with parentheses than with brackets because you need to insert almost twice as many special characters to represent the structure of function application.) It would also drastically reduce the chance of missing symbols by mistake, which is exactly the advantage of off-side rule languages over curly bracket languages. In the best scenario, missing or misplacing parentheses, brackets, or commas will result in a compile-time error and worst, a faulty program that does something wild and unintended.\u003c/p\u003e","accepted_answer_id":"24297313","answer_count":"2","comment_count":"3","creation_date":"2014-06-18 08:55:51.793 UTC","last_activity_date":"2014-06-19 01:27:22.153 UTC","last_edit_date":"2014-06-19 01:27:22.153 UTC","last_editor_display_name":"","last_editor_user_id":"2079797","owner_display_name":"","owner_user_id":"2079797","post_type_id":"1","score":"0","tags":"haskell|syntax","view_count":"132"} +{"id":"30479959","title":"Sending string having quote in it as post method without backslash","body":"\u003cp\u003eWe all know that sending quote as parameters will be replaced by a backslash quote.\u003c/p\u003e\n\n\u003cp\u003eI have 2 pages: \u003cem\u003elogin.html\u003c/em\u003e and \u003cem\u003eindex.php\u003c/em\u003e\u003c/p\u003e\n\n\u003cp\u003eThe login page must send parameters to the index page using the POST method.\u003c/p\u003e\n\n\u003cp\u003eLet's say I'm sending\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eusername --\u0026gt; X'D\npassword --\u0026gt; xxx\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe username automatically transfers to \u003ccode\u003eX\\'D\u003c/code\u003e .. but I want it to remain \u003ccode\u003eX'D\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eHow is it possible to receive the data without the backslash?\u003c/p\u003e\n\n\u003cp\u003eI want the backslash to be removed before arriving to the index page not using the htmlspecialchar in the index page or something.\u003c/p\u003e","answer_count":"2","comment_count":"5","creation_date":"2015-05-27 10:33:23.497 UTC","last_activity_date":"2015-07-01 08:40:06.937 UTC","last_edit_date":"2015-05-27 10:47:16.073 UTC","last_editor_display_name":"","last_editor_user_id":"711206","owner_display_name":"","owner_user_id":"4944184","post_type_id":"1","score":"2","tags":"php|html|post|backslash|quote","view_count":"557"} +{"id":"12387446","title":"query rpm from apache+php with selinux","body":"\u003cp\u003eI have a php script that runs in an apache serveron a RHEL5 installation. This script runs an exec on \"rpm -q --info packagename\".\u003c/p\u003e\n\n\u003cp\u003eThe thing is that it works properly with selinux in permissive mode, but not when it's fully enabled. So I assume it's a selinux issue.\u003c/p\u003e\n\n\u003cp\u003eI've started out with the audit2allow to create rules based on the denied entries i've found, but now there is no more denied in the audit logs, but it still doesn't run with the selinux enabled.\u003c/p\u003e\n\n\u003cp\u003eIn my world it seems it queries the system if it would be allowed to run, and when selinux say \"if you try this, I will stop you\". So the system does not run the exec. If it would, i assume i would get a \"denied\" that i could create a new selinux rule based upon. With selinux in permissive, i don't get any denied either, but it works..\u003c/p\u003e\n\n\u003cp\u003eSo it seems I will have to deal with this the hard way and create a custom rule for selinux. Said and done I made one:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emodule php_rpm 1.0;\n\nrequire {\n type httpd_t;\n type bin_t;\n type rpm_exec_t;\n type rpm_var_lib_t;\n class file { execute execute_no_trans getattr read execmod };\n class dir { getattr search };\n}\n\n#============= httpd_t ==============\nallow httpd_t rpm_exec_t:file { execute execute_no_trans getattr read execmod };\nallow httpd_t rpm_var_lib_t:dir { getattr search };\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eUnfortunally this did nothing to my problem but assumingly messing up my selinux rules a bit :P\u003c/p\u003e\n\n\u003cp\u003eHave anyone out there attempted to execute rpm from php with selinux enabled and got away with it?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2012-09-12 11:45:35.63 UTC","favorite_count":"1","last_activity_date":"2012-09-13 07:51:50.087 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1665563","post_type_id":"1","score":"2","tags":"php|exec|rpm|rhel5|selinux","view_count":"326"} +{"id":"18159754","title":"How can I override an inline CSS rule using an external file?","body":"\u003cp\u003eHow can I override an inline CSS rule with using an external stylesheet file?\u003c/p\u003e\n\n\u003cp\u003eThis is my HTML code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"mydiv\" style=\"background:#000\"\u0026gt; lorem ipsom\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to change the background color using CSS. This is my CSS code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e.mydiv {background:#f00; color: #000;}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut this is not working, but I this is possible.\u003c/p\u003e\n\n\u003cp\u003eIs there a way to change the background color in Internet\u0026nbsp;Explorer?\u003c/p\u003e","accepted_answer_id":"18159777","answer_count":"5","comment_count":"0","creation_date":"2013-08-10 07:38:37.907 UTC","favorite_count":"2","last_activity_date":"2015-10-25 18:20:16.467 UTC","last_edit_date":"2015-10-25 18:13:33.48 UTC","last_editor_display_name":"","last_editor_user_id":"63550","owner_display_name":"","owner_user_id":"2669944","post_type_id":"1","score":"3","tags":"html|css","view_count":"9922"} +{"id":"2174267","title":"Simple Win32 Trackbar","body":"\u003cp\u003eI have created a simple game using Win32 and gdi. I would like to have a track bar at the bottom that tracks a global variable. I'm just not sure how to add controls. How could I add a trackbar? I can imagine it would get created in the wm_create event.\u003c/p\u003e","accepted_answer_id":"2174317","answer_count":"2","comment_count":"0","creation_date":"2010-02-01 01:59:05.21 UTC","last_activity_date":"2016-01-30 12:40:34.627 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"146780","post_type_id":"1","score":"2","tags":"c++|winapi","view_count":"4543"} +{"id":"12615267","title":"Automatic update JTable","body":"\u003cp\u003eI am creating a Jtable from .txt file. The .txt file keeps on updating over a certain period of time. I need to know if there are any ways to reflect those changes in .txt file in my Jtable AT RUN-TIME!!! I know on restarting, the table reads .txt file but is there any way to do it on run time?? \u003c/p\u003e","answer_count":"5","comment_count":"2","creation_date":"2012-09-27 06:21:34.497 UTC","last_activity_date":"2013-10-24 08:54:02.593 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1333480","post_type_id":"1","score":"0","tags":"java|eclipse|swing|java-ee|jtable","view_count":"1553"} +{"id":"33287344","title":"Memory growing in UITableViewCell","body":"\u003cp\u003eMy code for custom cell: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{\n UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@\"ImageView\"];\n NSURL *nsurl = [NSURL URLWithString:_imageUrls[indexPath.row]];\n NSData *data = [NSData dataWithContentsOfURL: nsurl];\n\n cell.imageView.image = [UIImage imageWithData:data];\n if (cell == nil) {\n cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@\"ImageView\"];\n }\n\n return cell;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd I have custom class VKTableViewCell:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e @interface VKTableViewCell : UITableViewCell\n @property (weak, nonatomic) IBOutlet UIImageView *image;\n\n @end\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eImage is about 800x800 (parsed from site).\nWhen I scroll my table, memory is growing (from 20 to 30mb with 100 images load). Why this happening? What I must do in this case? I am using ARC.\u003c/p\u003e","accepted_answer_id":"33287537","answer_count":"1","comment_count":"10","creation_date":"2015-10-22 17:46:43.677 UTC","last_activity_date":"2015-10-22 18:51:55.49 UTC","last_edit_date":"2015-10-22 17:57:11.877 UTC","last_editor_display_name":"","last_editor_user_id":"4538696","owner_display_name":"","owner_user_id":"4538696","post_type_id":"1","score":"0","tags":"ios|uitableview|custom-cell","view_count":"48"} +{"id":"32936159","title":"Hash of (Array of Tuples) causing compile/runtime error \"index out of bounds for tuple {(String, String -\u003e Void)}\"","body":"\u003cp\u003eI am trying to make a Hash of Arrays with tuples in them. This is causing a weird issue which I suspect is a compiler bug, but I am not 100% sure.\u003c/p\u003e\n\n\u003cp\u003eThe syntax I am using:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass SomeClass\n @@weird_object = Hash(String, Array(Tuple(String, String -\u0026gt; ))).new {|h, k| h[k] = [] of Tuple(String, String -\u0026gt; ) }\n\n #...\n def self.some_method\n @@weird_object.each do |tuple|\n pp tuple[0]\n pp tuple[1] #=\u0026gt; This causes compile error \"index out of bounds for tuple {(String, String -\u0026gt; Void)}\"\n end\n\n @@weird_object.each do |the_sting, callback|\n #this causes a \"Nil trace:\" for the callback parameter\n end\n#...\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt looks like this has become a tuple of a \u003ccode\u003e(String, String -\u0026gt; void)\u003c/code\u003e object, and not \u003ccode\u003eString, String -\u0026gt; void\u003c/code\u003e. This error shows up when I run \u003ccode\u003ecrystal spec\u003c/code\u003e but not when I run \u003ccode\u003ecrystal build ./src/main.cr\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eIs this a compiler/runtime error, or have I messed up the syntax?\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003eCrystal 0.8.0 [e363b63] (Sat Sep 19 12:00:17 UTC 2015)\u003c/p\u003e","accepted_answer_id":"32947899","answer_count":"1","comment_count":"10","creation_date":"2015-10-04 17:17:54.96 UTC","last_activity_date":"2015-10-05 11:48:33.827 UTC","last_edit_date":"2015-10-04 22:34:41.383 UTC","last_editor_display_name":"","last_editor_user_id":"741850","owner_display_name":"","owner_user_id":"741850","post_type_id":"1","score":"1","tags":"crystal-lang","view_count":"287"} +{"id":"22572470","title":"JS drawing Images on Canvas","body":"\u003cp\u003eI'm trying to past multiple images on separate Canvas layers that are stacked upon each other yet the images aren't drawing on the canvas. Can someone help me out with what I am missing?\nThanks\u003c/p\u003e\n\n\u003cp\u003eCSS\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e .positionCanvas{\n position: absolute;\n left:0;\n right:0;\n margin-left:auto;\n margin-right:auto;\n background: rgba(255,255,255,0);\n }\n\n #logoCanvas{\n position: relative;\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHTML\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div id=\"logoCanvas\"\u0026gt;\n \u0026lt;canvas class=\"positionCanvas\" width=\"300\" height=\"300\" id=\"outerRingCanvas\"\u0026gt;\n\n \u0026lt;/canvas\u0026gt;\n \u0026lt;canvas class=\"positionCanvas\" width=\"300\" height=\"300\" id=\"crossCanvas\"\u0026gt;\n\n \u0026lt;/canvas\u0026gt;\n \u0026lt;canvas class=\"positionCanvas\" width=\"300\" height=\"300\" id=\"innerRingsCanvas\"\u0026gt;\n\n \u0026lt;/canvas\u0026gt;\n \u0026lt;canvas class=\"positionCanvas\" width=\"300\" height=\"300\" id=\"centreCanvas\"\u0026gt;\n\n \u0026lt;/canvas\u0026gt;\n\n \u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eJAVASCRIPT\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar outerRing = document.getElementById('outerRingCanvas'),\n cross = document.getElementById('crossCanvas'),\n innerRings = document.getElementById('innerRingsCanvas'),\n centre = document.getElementById('centreCanvas');\n\n\n\nvar outerCtx = outerRing.getContext('2d'),\n crossCtx = cross.getContext('2d'),\n innerRingsCtx = innerRings.getContext('2d'),\n centreCtx = centre.getContext('2d');\n\nvar ctxArray = [outerCtx, crossCtx, innerRingsCtx, centreCtx];\n\nvar outerImg = new Image(),\n crossImg = new Image(),\n innerRingsImg = new Image(),\n centreImg = new Image();\n\nvar imgArray = [outerImg, crossImg, innerRingsImg, centreImg];\n\n outerImg.src = \"logo_ring.png\";\n crossImg.src = \"logo_cross.png\";\n innerRingsImg.src = \"logo_centre_rings.png\";\n centreImg.src = \"logo_centre.png\";\nplaceLogos(ctxArray);\ncrossCtx.drawImage(crossImg, 0, 0, 300, 300);\n\n\n\nfunction placeLogos(array){\n for(var i = 0; i \u0026lt; array.length; i++){\n array[i].drawImage(imgArray[i], 100, 100, 100, 100);\n array[i].fillStyle = \"rgba(233,100,10,0.2)\"\n array[i].fillRect(0, 0, 300, 300);\n\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"22572793","answer_count":"1","comment_count":"3","creation_date":"2014-03-22 01:55:53.207 UTC","last_activity_date":"2014-03-22 02:43:19.047 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2884416","post_type_id":"1","score":"0","tags":"javascript|css|html5|canvas","view_count":"59"} +{"id":"13754578","title":"git clone over ssh error 'fatal: The remote end hung up unexpectedly'","body":"\u003cp\u003eI'm pretty new to using git and have been struggling to get it work for the last 2 days and now I feel so stupid that I still haven't got it working yet.\u003c/p\u003e\n\n\u003cp\u003eI've seen many posts talking about the similar error but none of the answers solved my problem.\u003c/p\u003e\n\n\u003cp\u003emy situation here is\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003e\u003cp\u003eproject git called \u003ccode\u003eitko-ext.git\u003c/code\u003e is stored in a server and I have an access via ssh\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eSo I create a repositary directory on my local storage and used \u003ccode\u003egit init\u003c/code\u003e\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eTo copy the \u003ccode\u003eitko-ext.git\u003c/code\u003e into my repositary, I used \u003ccode\u003egit clone ssh://username@host/home/shared/g_quoll/repos/itko-ext.git\u003c/code\u003e\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eand this gives me an error \u003ccode\u003efatal: The remote end hung up unexpectedly\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003eI have access to the resource.\u003c/li\u003e\n\u003c/ul\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eI will appreciate any solution. \u003c/p\u003e\n\n\u003cp\u003eRegards\u003c/p\u003e","accepted_answer_id":"13755068","answer_count":"2","comment_count":"1","creation_date":"2012-12-06 23:35:33.907 UTC","last_activity_date":"2012-12-07 00:25:59.7 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1703649","post_type_id":"1","score":"3","tags":"git|ssh","view_count":"11654"} +{"id":"45594124","title":"Cannot set ProductBiddingCategory in google adwords api","body":"\u003cp\u003eI use google adwords api(v 201705) in my application and when I want to set \u003ccode\u003eProductBiddingCategory\u003c/code\u003e in inventory filter it does not work as it should. I have a config with the ids. I use Laravel 5.4 and php 5.6. This is for first level:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e'category1stLevel' =\u0026gt; array(\n '-7183678771116356049' =\u0026gt; 'Animals \u0026amp; Pet Supplies',\n '-8901225909846585574' =\u0026gt; 'Arts \u0026amp; Entertainment ',\n '-135859741832737125' =\u0026gt; 'Baby \u0026amp; Toddler',\n '1630781044279653237' =\u0026gt; 'Business \u0026amp; Industrial',\n '-4047358871470385303' =\u0026gt; 'Cameras \u0026amp; Optics',\n '-3692872870547437690' =\u0026gt; 'Clothing \u0026amp; Accessories',\n '-8991081036712453473' =\u0026gt; 'Electronics',\n '-4844290245982195030' =\u0026gt; 'Food, Beverages \u0026amp; Tobacco',\n '5791209622805759532' =\u0026gt; 'Furniture',\n '1689639310991627077' =\u0026gt; 'Hardware',\n '-1319082945867661876' =\u0026gt; 'Health \u0026amp; Beauty',\n '-730821788104646261' =\u0026gt; 'Home \u0026amp; Garden',\n '-5914235892932915235' =\u0026gt; 'Luggage \u0026amp; Bags',\n '513743549703189181' =\u0026gt; 'Mature',\n '-823909673284230433' =\u0026gt; 'Media',\n '7477391641924216366' =\u0026gt; 'Office Supplies',\n '225849170806580462' =\u0026gt; 'Religious \u0026amp; Ceremonial ',\n '-7974890371279108093' =\u0026gt; 'Software',\n '6085370270382652056' =\u0026gt; 'Sporting Goods',\n '-136928849880388598' =\u0026gt; 'Toys \u0026amp; Games',\n '-7701278134223972650' =\u0026gt; 'Vehicles \u0026amp; Parts'\n )\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand I set like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$value = new ProductBiddingCategory();\n$value-\u0026gt;setType('BIDDING_CATEGORY_L1');\n$value-\u0026gt;setValue(-7183678771116356049);\n$productScope-\u0026gt;setDimensions([$value]);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt seems that php is converting it to exponential number(for eg -7.18367877111636E+18) and when it sets I receive the error 'Invalid bidding category -7183678771116355789....', meaning that it is not the number from beginning. If I set like this \u003ccode\u003e$value-\u0026gt;setValue(-7.18367877111636E+18)\u003c/code\u003e it also does not work.\u003c/p\u003e\n\n\u003cp\u003eHow should I set it to work? Please help.\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-08-09 14:54:34.293 UTC","last_activity_date":"2017-08-09 16:28:38.393 UTC","last_edit_date":"2017-08-09 16:28:38.393 UTC","last_editor_display_name":"","last_editor_user_id":"3625036","owner_display_name":"","owner_user_id":"6565935","post_type_id":"1","score":"1","tags":"php|google-api|google-adwords","view_count":"15"} +{"id":"16325004","title":"Best Practices Concerning Method Locking","body":"\u003cp\u003eI have a method whom access myst be synchronized allowing only one thread at once to go though it. Here is my current implementation:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate Boolean m_NoNeedToProceed;\nprivate Object m_SynchronizationObject = new Object();\n\npublic void MyMethod()\n{\n lock (m_SynchronizationObject)\n {\n if (m_NoNeedToProceed)\n return;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow I was thinking about changing it a little bit like so:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate Boolean m_NoNeedToProceed;\nprivate Object m_SynchronizationObject = new Object();\n\npublic void MyMethod()\n{\n if (m_NoNeedToProceed)\n return;\n\n lock (m_SynchronizationObject)\n {\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eShouldn't it be better to do a quick return before locking it so that calling threads can proceed without waiting for the previous one to complete the method call?\u003c/p\u003e","accepted_answer_id":"16325351","answer_count":"3","comment_count":"4","creation_date":"2013-05-01 19:29:09.813 UTC","last_activity_date":"2013-05-01 23:09:14.31 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"796085","post_type_id":"1","score":"3","tags":"c#|.net|locking|synchronized","view_count":"845"} +{"id":"18394336","title":"onClick input text readonly form use inline","body":"\u003cp\u003eI have problem with onclick input form is readonly but use it inline. \nI can do only onclick is disable Example: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;input type=\"text\" onClick=this.disabled=true /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethis one is work but what I need is when onClick event is readonly I try this : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;input type=\"text\" onClick=this.readonly=true /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut it still not work.\u003c/p\u003e","accepted_answer_id":"18394359","answer_count":"3","comment_count":"2","creation_date":"2013-08-23 03:41:51.897 UTC","favorite_count":"1","last_activity_date":"2013-08-23 21:58:01.023 UTC","last_edit_date":"2013-08-23 03:48:51.833 UTC","last_editor_display_name":"","last_editor_user_id":"616443","owner_display_name":"","owner_user_id":"2605515","post_type_id":"1","score":"0","tags":"html|events|dom","view_count":"2877"} +{"id":"39849447","title":"Existing GIT repo with vagrant file","body":"\u003cp\u003eI just started using Vagrant. Now, One of my clients shared a GIT repo with the following files \u0026amp; directories :\u003c/p\u003e\n\n\u003cp\u003eVagrantfile (file)\u003c/p\u003e\n\n\u003cp\u003eVagrant (directory) \u003c/p\u003e\n\n\u003cp\u003eNow, I don't understand what will be my next step ? Every resource in the internet assumes that I am creating a new box from scratch (vagrant init hashicorp/precise64). But, here I need to match the box environment that is shared with me.\u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","accepted_answer_id":"39851171","answer_count":"2","comment_count":"1","creation_date":"2016-10-04 10:02:05.757 UTC","last_activity_date":"2016-10-04 11:40:37.157 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"452213","post_type_id":"1","score":"0","tags":"vagrant|vagrantfile|vagrant-windows","view_count":"67"} +{"id":"40656016","title":"Display array element ReactJS","body":"\u003cp\u003eUPD: How can I display elment of the array in my component (WeatherCityName - h2)? It can be seen that the array is loaded, but when I point out the property - an error occurs, it may be a problem in the syntax?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e var WeatherBox = React.createClass({\n handleWeatherSubmit: function(text) {\n $.ajax({\n url: this.props.url,\n dataType: 'json',\n type: 'POST',\n data: 'cityName=' + text,\n success: function(data) {\n this.setState({data: data});\n }.bind(this),\n error: function(xhr, status, err) {\n console.error(this.props.url, status, err.toString());\n }.bind(this)\n });\n },\n getInitialState: function() {\n return {data: []};\n },\n render: function() {\n return (\n \u0026lt;div className=\"wetherBox\"\u0026gt;\n \u0026lt;h1\u0026gt; Weather\u0026lt;/h1\u0026gt;\n \u0026lt;WeatherForm onWeatherSubmit={this.handleWeatherSubmit} /\u0026gt;\n \u0026lt;WeatherCityName data={this.state.data[0]} /\u0026gt;\n \u0026lt;WeatherList data={this.state.data} /\u0026gt;\n \u0026lt;/div\u0026gt;\n );\n }\n});\n\nvar WeatherCityName = React.createClass({\n render: function(){\n return(\n \u0026lt;h2\u0026gt;{this.state.data[0].cityName}\u0026lt;/h2\u0026gt;\n );\n }\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/UptIx.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/UptIx.png\" alt=\"Error\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/zyD4N.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/zyD4N.png\" alt=\"React\"\u003e\u003c/a\u003e\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2016-11-17 13:19:24.52 UTC","favorite_count":"0","last_activity_date":"2016-11-17 19:13:51.33 UTC","last_edit_date":"2016-11-17 19:13:51.33 UTC","last_editor_display_name":"","last_editor_user_id":"6520142","owner_display_name":"","owner_user_id":"6520142","post_type_id":"1","score":"-1","tags":"javascript|reactjs|syntax","view_count":"51"} +{"id":"44119955","title":"fast array operation for creating an array from an object?","body":"\u003cp\u003eSay I have an Array of rows. Each row has an entity object. I want an Array of the entities. Is there a built-in or jquery array op that does this, but faster?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar nodes = [];\nfor( var inx = 0; inx \u0026lt; rows.length; inx++ ) {\n nodes.push( rows[ inx ].entity );\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"4","creation_date":"2017-05-22 18:41:09.887 UTC","last_activity_date":"2017-05-22 18:43:19.243 UTC","last_edit_date":"2017-05-22 18:43:19.243 UTC","last_editor_display_name":"","last_editor_user_id":"215552","owner_display_name":"","owner_user_id":"144022","post_type_id":"1","score":"0","tags":"javascript|arrays","view_count":"30"} +{"id":"28015653","title":"How to write an infinite loop that an exception can't break?","body":"\u003cp\u003eIs it possible to write an infinite loop that exceptions can't break out of even when the exceptions happen between executions of the loop body? If so, how? (These are the sort of silly things I think about when I ponder robustness.)\u003c/p\u003e\n\n\u003cp\u003eFor example, consider the following code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport time\n\ndef slow_true():\n print 'waiting to return True...'\n time.sleep(1.0)\n return True\n\nwhile slow_true():\n try:\n print 'in loop body'\n raise RuntimeError('testing')\n except:\n print 'caught exception, continuing...'\n continue\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI can easily break out of the loop with Ctrl-C while Python is executing \u003ccode\u003eslow_true()\u003c/code\u003e. Even if I replace \u003ccode\u003ewhile slow_true():\u003c/code\u003e with \u003ccode\u003ewhile True:\u003c/code\u003e there is theoretically a small window of time (between executions of the body) where a \u003ccode\u003eSIGINT\u003c/code\u003e can cause the script to exit.\u003c/p\u003e\n\n\u003cp\u003eI realize I can implement a \u003ccode\u003eSIGINT\u003c/code\u003e handler to effectively disable Ctrl-C, but that's not the point of this question.\u003c/p\u003e\n\n\u003cp\u003eI could wrap the loop with another infinite loop and move the \u003ccode\u003etry\u003c/code\u003e/\u003ccode\u003eexcept\u003c/code\u003e out a level like so:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport time\n\ndef slow_true():\n print 'waiting to return True...'\n time.sleep(1.0)\n return True\n\nwhile True:\n try:\n while slow_true():\n print 'in loop body'\n raise RuntimeError('testing')\n except:\n print 'caught exception, restarting...'\n continue\n break\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis would make it much harder to break out of the loop (two exceptions would have to be raised back-to-back at just the right times), but I think it's still theoretically possible.\u003c/p\u003e","answer_count":"1","comment_count":"7","creation_date":"2015-01-18 22:39:28.053 UTC","favorite_count":"1","last_activity_date":"2015-01-18 22:54:28.72 UTC","last_edit_date":"2015-01-18 22:50:00.263 UTC","last_editor_display_name":"","last_editor_user_id":"712605","owner_display_name":"","owner_user_id":"712605","post_type_id":"1","score":"3","tags":"python|python-2.7|loops|exception-handling|infinite-loop","view_count":"520"} +{"id":"46109884","title":"joining row with most recent date in mysql","body":"\u003cp\u003ei'm new to mysql and have been tryn to make this work without any luck.\ni am joining 3 tables and i am tryn to join third table with the row with most recent record as per date.\nhere is my mysql query\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT mg.region_name, mu.contact_person, \n mu.contact_number, mu.status, mu.company_name, mu.user_type, MAX(mf.follow_up_date), mf.date, mu.user_id\nFROM p1006_marketing_group as mg \nJOIN p1006_marketing_users as mu ON mg.id = mu.region_id \nJOIN ( SELECT user_id_fk,MAX(follow_up_date) \n FROM p1006_marketing_follow_up ) as mf \n ON mu.user_id = mf.user_id_fk \n WHERE mu.user_id_done = \"\" AND ( mg.id = 3 OR mg.id = 7 OR mg.id = 6 ) \nGROUP BY mf.user_id_fk\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ei get the following error\u003c/p\u003e\n\n\u003cp\u003eUnknown column 'mf.follow_up_date' in 'field list'\u003c/p\u003e\n\n\u003cp\u003ei am really confused because i do have to column follow_up_date.\u003c/p\u003e\n\n\u003cp\u003ei would be really greateful for any help possible\u003c/p\u003e","answer_count":"2","comment_count":"3","creation_date":"2017-09-08 06:19:55.647 UTC","last_activity_date":"2017-09-08 06:24:26.81 UTC","last_edit_date":"2017-09-08 06:23:39.507 UTC","last_editor_display_name":"","last_editor_user_id":"1491895","owner_display_name":"","owner_user_id":"5769698","post_type_id":"1","score":"0","tags":"php|mysql|sql","view_count":"26"} +{"id":"42736290","title":"Choose type of ggplot2 histogram (frequency or density) within a function","body":"\u003cp\u003elong-time reader, first-time question-writer...I have a function that puts takes in data and spits out a ggplot2 histogram with some specific formatting. I'm trying to edit this function so that one of the function parameters can specify whether I want the histogram to show the frequency or the density of the data. I know I can specify this manually inside the \u003ccode\u003egeom_histogram()\u003c/code\u003e function with \u003ccode\u003eaes(y=..count..)\u003c/code\u003e or \u003ccode\u003eaes(y=..density..)\u003c/code\u003e, respectively. But I'm having issues figuring out how to access these variables if they aren't inputted directly.\u003c/p\u003e\n\n\u003cp\u003eHere is a simplified version of what I'm trying to do:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elibrary(ggplot2)\n\nhistplot \u0026lt;- function(data,density=FALSE) {\n\n if (density) {\n type \u0026lt;- \"..density..\"\n } else {\n type \u0026lt;- \"..count..\"\n }\n\n theplot \u0026lt;- ggplot(data, aes(x=data[,1])) +\n geom_histogram(position=\"identity\",binwidth = 2, \n aes(y=eval(parse(text=type))))\n\n g \u0026lt;- ggplot_gtable(ggplot_build(theplot))\n grid.draw(g)\n\n}\n\nxy \u0026lt;- data.frame(X=rnorm(100,0,10),Y=rnorm(100))\nhistplot(xy)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I execute this function, the error I get is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eError in eval(expr, envir, enclos) : object '..count..' not found\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI can't figure out why this won't work, because if I do something like the following:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ex \u0026lt;- 1:5\ny \u0026lt;- \"x\"\neval(parse(text=y))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThen the output will be \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[1] 1 2 3 4 5\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy guess is it has something to do with the environments.\u003c/p\u003e","accepted_answer_id":"42736444","answer_count":"1","comment_count":"1","creation_date":"2017-03-11 14:17:29.33 UTC","last_activity_date":"2017-03-11 14:35:39.15 UTC","last_edit_date":"2017-03-11 14:23:48.643 UTC","last_editor_display_name":"","last_editor_user_id":"7694963","owner_display_name":"","owner_user_id":"7694963","post_type_id":"1","score":"2","tags":"r|ggplot2|histogram","view_count":"120"} +{"id":"918619","title":"Redirect batch stderr to file","body":"\u003cp\u003eI have a batch file that executes a java application. I'm trying to modify it so that whenever an exception occurs, it'll write the STDERR out to a file.\u003c/p\u003e\n\n\u003cp\u003eIt looks something like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003estart java something.jar method %1 %2 2\u0026gt;\u0026gt; log.txt\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs there a way I can write the arguments %1 and %2 to the log.txt file as well? I don't want to write it to the log file everytime this batch file gets called, only when an exception occurs.\u003c/p\u003e\n\n\u003cp\u003eI tried searching for a way to redirect STDERR into a variable, but I couldn't figure it out. Ideally I'd like the log file to look something like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eBatch file called with parameters:\n- \"first arg\"\n- \"second arg\"\nException: \njava.io.exception etc...\n\n------------------------------------\n\nBatch file called with parameters:\n- \"first arg\"\n- \"second arg\"\nException: \njava.io.exception etc...\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"6","comment_count":"0","creation_date":"2009-05-28 00:24:04.513 UTC","last_activity_date":"2012-08-22 19:59:51.813 UTC","last_edit_date":"2012-08-22 19:59:51.813 UTC","last_editor_display_name":"","last_editor_user_id":"77782","owner_display_name":"","owner_user_id":"103791","post_type_id":"1","score":"10","tags":"windows|batch-file|cmd|stderr","view_count":"18984"} +{"id":"3961278","title":"Word wrap a string in multiple lines","body":"\u003cp\u003eI am trying to word wrap a string into multiple lines. Every line will have defined width.\u003c/p\u003e\n\n\u003cp\u003eFor example I would get this result if I word wrap it to an area of 120 pixels in width.\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eLorem ipsum dolor sit amet,\u003cbr\u003e\n consectetur adipiscing elit. Sed augue\u003cbr\u003e\n velit, tempor non vulputate sit amet,\u003cbr\u003e\n dictum vitae lacus. In vitae ante\u003cbr\u003e\n justo, ut accumsan sem. Donec\u003cbr\u003e\n pulvinar, nisi nec sagittis consequat,\u003cbr\u003e\n sem orci luctus velit, sed elementum\u003cbr\u003e\n ligula ante nec neque. Pellentesque\u003cbr\u003e\n habitant morbi tristique senectus et\u003cbr\u003e\n netus et malesuada fames ac turpis\u003cbr\u003e\n egestas. Etiam erat est, pellentesque\u003cbr\u003e\n eget tincidunt ut, egestas in ante.\u003cbr\u003e\n Nulla vitae vulputate velit. Proin in\u003cbr\u003e\n congue neque. Cras rutrum sodales\u003cbr\u003e\n sapien, ut convallis erat auctor vel.\u003cbr\u003e\n Duis ultricies pharetra dui, sagittis\u003cbr\u003e\n varius mauris tristique a. Nam ut\u003cbr\u003e\n neque id risus tempor hendrerit.\u003cbr\u003e\n Maecenas ut lacus nunc. Nulla\u003cbr\u003e\n fermentum ornare rhoncus. Nulla\u003cbr\u003e\n gravida vestibulum odio, vel commodo\u003cbr\u003e\n magna condimentum quis. Quisque\u003cbr\u003e\n sollicitudin blandit mi, non varius\u003cbr\u003e\n libero lobortis eu. Vestibulum eu\u003cbr\u003e\n turpis massa, id tincidunt orci.\u003cbr\u003e\n Curabitur pellentesque urna non risus\u003cbr\u003e\n adipiscing facilisis. Mauris vel\u003cbr\u003e\n accumsan purus. Proin quis enim nec\u003cbr\u003e\n sem tempor vestibulum ac vitae augue. \u003c/p\u003e\n\u003c/blockquote\u003e","accepted_answer_id":"3961597","answer_count":"8","comment_count":"3","creation_date":"2010-10-18 16:43:18.39 UTC","favorite_count":"5","last_activity_date":"2017-05-22 11:34:48.113 UTC","last_edit_date":"2013-11-20 21:29:47.823 UTC","last_editor_display_name":"","last_editor_user_id":"1043380","owner_display_name":"","owner_user_id":"479531","post_type_id":"1","score":"30","tags":"c#|word-wrap|textwrapping","view_count":"41175"} +{"id":"23433921","title":"Submit form when press enter, not press button","body":"\u003cp\u003eI have this code\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;form name=\"frmDiagnosticos\" id=\"frmDiagnosticos\" method=\"post\" action=\"agregarDiagnosticoSesion.jsp\"\u0026gt;\n \u0026lt;label for=\"txtCodigoCIE10\" class=\"clase\"\u0026gt;Código CIE-10\u0026lt;/label\u0026gt;\u0026lt;input class=\"codigoCIE10\" type=\"text\" name=\"txtCodigoCIE10\" id=\"txtCodigoCIE10\" /\u0026gt;\n \u0026lt;label for=\"linkAbrirBuscador\" class=\"clase\"\u0026gt;Buscar código CIE-10\u0026lt;/label\u0026gt;\u0026lt;button id=\"linkAbrirBuscador\"\u0026gt;Buscar diagnósticos\u0026lt;/button\u0026gt;\n \u0026lt;label for=\"chkCronica\" class=\"clase\"\u0026gt;Enfermedad crónica\u0026lt;/label\u0026gt;\u0026lt;input type=\"checkbox\" name=\"chkCronica\" id=\"chkCronica\" /\u0026gt;\n \u0026lt;label for=\"chkHabito\" class=\"clase\"\u0026gt;Es un hábito\u0026lt;/label\u0026gt;\u0026lt;input type=\"checkbox\" name=\"chkHabito\" id=\"chkHabito\" /\u0026gt;\n \u0026lt;input type=\"submit\" name=\"btnConfirmarYContinuar\" value=\"Confirmar\" id=\"btnConfirmarYContinuar\" /\u0026gt;\n\u0026lt;/form\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I am focused on the first text input (ID: \u003ccode\u003etxtCodigoCIE10\u003c/code\u003e) and I press \u003ckbd\u003eEnter\u003c/kbd\u003e, I want to trigger the event of the submit, not the button (ID: \u003ccode\u003elinkAbrirBuscador\u003c/code\u003e). How can I do?\u003c/p\u003e\n\n\u003cp\u003eI am using jQuery 1.11.\u003c/p\u003e","accepted_answer_id":"23433976","answer_count":"1","comment_count":"2","creation_date":"2014-05-02 17:40:23.11 UTC","last_activity_date":"2015-03-17 05:07:57.74 UTC","last_edit_date":"2015-03-17 05:07:57.74 UTC","last_editor_display_name":"","last_editor_user_id":"2753241","owner_display_name":"","owner_user_id":"2836717","post_type_id":"1","score":"0","tags":"javascript|jquery|html","view_count":"154"} +{"id":"7522365","title":"yield between different processes","body":"\u003cp\u003eI have two C++ codes one called \u003cem\u003ea\u003c/em\u003e and one called \u003cem\u003eb\u003c/em\u003e. I am running in in a 64 bits Linux, using the Boost threading library.\u003c/p\u003e\n\n\u003cp\u003eThe \u003cem\u003ea\u003c/em\u003e code creates 5 threads which stay in a non-ending loop doing some operation.\nThe \u003cem\u003eb\u003c/em\u003e code creates 5 threads which stay in a non-ending loop invoking yield().\u003c/p\u003e\n\n\u003cp\u003eI am on a quadcore machine... When a invoke the \u003cem\u003ea\u003c/em\u003e code alone, it gets almost 400% of the CPU usage. When a invoke the \u003cem\u003eb\u003c/em\u003e code alone, it gets almost 400% of the CPU usage. I already expected it.\u003c/p\u003e\n\n\u003cp\u003eBut when running both together, I was expecting that the \u003cem\u003eb\u003c/em\u003e code used almost nothing of CPU and \u003cem\u003ea\u003c/em\u003e use the 400%. But actually both are using equals slice of the CPU, almost 200%.\u003c/p\u003e\n\n\u003cp\u003eMy question is, doesn't yield() works between different process? Is there a way to make it work the way I expected?\u003c/p\u003e","accepted_answer_id":"7662925","answer_count":"2","comment_count":"2","creation_date":"2011-09-22 22:48:24.233 UTC","favorite_count":"1","last_activity_date":"2011-10-05 14:28:33.94 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"809384","post_type_id":"1","score":"5","tags":"linux|multithreading|boost|g++|yield","view_count":"1235"} +{"id":"8974416","title":"Visual Studio Annotate changing line number in view","body":"\u003cp\u003eI'm using Visual Studio 2010 with VB.NET, in a 4.0 project, with Team Foundation Server. When I annotate, not only do I not see line numbers (which is apparently an unfixed bug with VS 2010 - \u003ca href=\"http://connect.microsoft.com/VisualStudio/feedback/details/553557/when-invoking-tfs-annotate-in-visual-studio-there-are-no-line-numbers-shown\"\u003ehttp://connect.microsoft.com/VisualStudio/feedback/details/553557/when-invoking-tfs-annotate-in-visual-studio-there-are-no-line-numbers-shown\u003c/a\u003e) but annotate also advances the screen 10-15 lines, which makes it difficult to find the code I was actually attempting to Annotate.\u003c/p\u003e\n\n\u003cp\u003eHas anyone run into this before? Any chance you've figured out a fix for it? Even knowing I'm not alone would be nice.\u003c/p\u003e","accepted_answer_id":"10386733","answer_count":"2","comment_count":"0","creation_date":"2012-01-23 15:51:52.147 UTC","favorite_count":"1","last_activity_date":"2015-05-19 20:41:36.477 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"459949","post_type_id":"1","score":"6","tags":"visual-studio|visual-studio-2010|tfs|annotate","view_count":"1477"} +{"id":"40316184","title":"c++ how to put a pointer to a pointer in dvc","body":"\u003cp\u003eI'm new to c++ (java programmer) and I am working on a homework assignment for an intro course. The purpose is \"Constructors, Dynamic Memory Allocation and\nOverloading Operators\" That being said, I'm really stuck on one of the specifics. \u003c/p\u003e\n\n\u003cp\u003eI'm creating 2 classes Color, and ColorBox. It was specified in the instruction that the member variables in ColorBox are int width, int height and Color** data. My understanding is that data holds reference to a 2D array of Color objects... \u003c/p\u003e\n\n\u003cp\u003eMy question is: \u003cstrong\u003eHow do I set some type of empty or basic value for data in the DVC?\u003c/strong\u003e And does anybody have a link for a decent write up on this kind of pointer? I've found generic write ups on arrays and pointers but I'm still having trouble wrapping my head around this.\u003c/p\u003e\n\n\u003cp\u003eThanks in advance!\u003c/p\u003e\n\n\u003cp\u003eEdit:\nI think I made it work with the code below, but I'll admit I still don't think I know what I'm doing.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eColorBlock::ColorBlock()\n{\n this-\u0026gt;width = 0;\n this-\u0026gt;height = 0;\n Color temp_data[1][1];\n this-\u0026gt;data = (Color**)temp_data;\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"5","creation_date":"2016-10-29 04:59:29.783 UTC","last_activity_date":"2016-10-30 00:19:00.54 UTC","last_edit_date":"2016-10-29 05:31:45.35 UTC","last_editor_display_name":"","last_editor_user_id":"7072116","owner_display_name":"","owner_user_id":"7072116","post_type_id":"1","score":"2","tags":"c++|c++11","view_count":"67"} +{"id":"45537930","title":"Applying direction into current transform position","body":"\u003cp\u003eI'm not quite sure whether I pick correct title for the question, feel free to edit it If you find it misleading.\u003c/p\u003e\n\n\u003cp\u003eI'm developing an action game which involving music as the core of its gameplay.\nIt contains a set of entities (game objects) that move into several directions; top, right, left, bottom and diagonal moves (e.g: top-left, top-right, bottom-left, etc etc).\u003c/p\u003e\n\n\u003cp\u003eTo determine the position of these entities, there is a value which need to be calculated that involving the music tempo and several properties of the entities itself, which I able produce it in Unity.\u003c/p\u003e\n\n\u003cp\u003eI use following function to determine the position of transform of the entities:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e private Vector3 _position;\n\n private void DeterminePosition(float offset)\n {\n // In actual code, the _position is initialized under Start() method\n // But for this simplification sake, I'll just put it here\n _position = _position == null ? new Vector3(0, 0, 1f) : _position;\n\n if (Direction == Direction.Up || Direction == Direction.RightUp || Direction == Direction.LeftUp)\n {\n _position.y = offset;\n }\n if (Direction == Direction.Down || Direction == Direction.RightDown || Direction == Direction.LeftDown)\n {\n _position.y = -offset;\n }\n if (Direction == Direction.Left || Direction == Direction.LeftDown || Direction == Direction.LeftUp)\n {\n _position.x = -offset;\n }\n if (Direction == Direction.Right || Direction == Direction.RightDown || Direction == Direction.RightUp)\n {\n _position.x = offset;\n }\n\n transform.position = _position;\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhere the \u003ccode\u003eoffset\u003c/code\u003e is the value that I was talking about before. \u003c/p\u003e\n\n\u003cp\u003eThe code works perfectly as intended, however the game need to be change.\nInstead of fixed direction (e.g: Up, Right, Left, Bottom, RightUp, DownLeft etc etc) we decide to use value of degree for the direction (0 to 360 degree).\u003c/p\u003e\n\n\u003cp\u003eAnd now I've no idea how to impement this. I've tried to use following codes, but it doesn't work:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e _position = new Vector3(offset, offset, transform.position.z);\n\n // Where the direction is between 0 .. 360\n transform.position = Quaternion.Euler(0, direction, 0) * _position;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCan anybody else come up with solution?\u003cbr\u003e\nThanks in advance!\u003c/p\u003e","accepted_answer_id":"45539551","answer_count":"1","comment_count":"0","creation_date":"2017-08-07 00:27:57.91 UTC","last_activity_date":"2017-08-08 04:38:18.733 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2209893","post_type_id":"1","score":"2","tags":"c#|unity3d|transform|unity2d","view_count":"75"} +{"id":"44812640","title":"Extract ZIP into QByteArray","body":"\u003cp\u003eHow to unzip ZIP-archive into \u003ccode\u003eQByteArray\u003c/code\u003e (C++ Qt)?\nI tried to unzip use \u003ccode\u003eQuaZip\u003c/code\u003e and \u003ccode\u003eQZipReader\u003c/code\u003e - all of this methods needs to extract ZIP data into some file destination (must be \u003ccode\u003eQString\u003c/code\u003e - destination path). \nThank`s to all, who read this question.\u003c/p\u003e","answer_count":"1","comment_count":"4","creation_date":"2017-06-28 21:13:49.58 UTC","last_activity_date":"2017-06-29 08:16:24.787 UTC","last_edit_date":"2017-06-29 07:28:57.327 UTC","last_editor_display_name":"","last_editor_user_id":"991484","owner_display_name":"","owner_user_id":"7343422","post_type_id":"1","score":"0","tags":"c++|qt|zip|qbytearray","view_count":"89"} +{"id":"38684863","title":"Git Bash in Windows doesn't remember aliases","body":"\u003cp\u003eI have created some aliases to simplify some commands in git bash. But when I restart the git bash, it actually forgets all the aliases.\u003c/p\u003e\n\n\u003cp\u003eI have tried the .bash_profile hack. But it's not working.\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2016-07-31 14:13:16.333 UTC","last_activity_date":"2016-07-31 14:33:26.633 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5068455","post_type_id":"1","score":"0","tags":"git|git-bash","view_count":"52"} +{"id":"29869581","title":"Python: Scrapy start_urls list able to handle .format()?","body":"\u003cp\u003eI want to parse a list of stocks so I am trying to format the end of my \u003ccode\u003estart_urls\u003c/code\u003e list so I can just add the symbol instead of the entire url.\u003c/p\u003e\n\n\u003cp\u003eSpider class with \u003ccode\u003estart_urls\u003c/code\u003e inside \u003ccode\u003estock_list\u003c/code\u003e method:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass MySpider(BaseSpider):\n symbols = [\"SCMP\"]\n name = \"dozen\"\n allowed_domains = [\"yahoo.com\"] \n\ndef stock_list(stock):\n start_urls = []\n for symb in symbols:\n start_urls.append(\"http://finance.yahoo.com/q/is?s={}\u0026amp;annual\".format(symb))\n return start_urls\n\ndef parse(self, response):\n hxs = HtmlXPathSelector(response)\n revenue = hxs.select('//td[@align=\"right\"]')\n items = []\n for rev in revenue:\n item = DozenItem()\n item[\"Revenue\"] = rev.xpath(\"./strong/text()\").extract()\n items.append(item)\n return items[0:3]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt all runs correctly if I get rid of the \u003ccode\u003estock_list\u003c/code\u003e and just do simple \u003ccode\u003estart_urls\u003c/code\u003e as normal, but as it currently is will not export more than an empty file.\u003c/p\u003e\n\n\u003cp\u003eAlso, should I possibly try a \u003ccode\u003esys.arv\u003c/code\u003e setup so that I would just type the stock symbol as an argument at the command line when I run \u003ccode\u003e$ scrapy crawl dozen -o items.csv\u003c/code\u003e???\u003c/p\u003e\n\n\u003cp\u003eTypically the shell prints out \u003ccode\u003e2015-04-25 14:50:57-0400 [dozen] DEBUG: Crawled (200) \u0026lt;GET http://finance.yahoo.com/q/is?s=SCMP+Income+Statement\u0026amp;annual\u0026gt;\u003c/code\u003e among the LOG/DEBUG printout, however does not currently include it, implying it isn't correctly formatting the \u003ccode\u003estart_urls\u003c/code\u003e\u003c/p\u003e","accepted_answer_id":"29869687","answer_count":"2","comment_count":"0","creation_date":"2015-04-25 19:16:38.093 UTC","favorite_count":"0","last_activity_date":"2015-04-25 22:19:26.11 UTC","last_edit_date":"2015-04-25 20:26:25.187 UTC","last_editor_display_name":"","last_editor_user_id":"4697384","owner_display_name":"","owner_user_id":"4697384","post_type_id":"1","score":"2","tags":"python|function|while-loop|web-crawler|scrapy","view_count":"187"} +{"id":"38571284","title":"Searching for the proper xampp/htdocs/index.php code","body":"\u003cp\u003eFirst of all I went through the already asked question related xampp/htdocs/index.php. (eg.: \u003ca href=\"https://stackoverflow.com/questions/32064142/cannot-access-to-localhost-xampp-index-php\"\u003ethis\u003c/a\u003e, \u003ca href=\"https://stackoverflow.com/questions/15004418/http-localhost-index-php-redirecting-to-http-localhost-xampp\"\u003ethis\u003c/a\u003e and \u003ca href=\"https://stackoverflow.com/questions/15055171/when-i-try-to-open-an-html-file-through-http-localhost-xampp-htdocs-index-htm\"\u003ethis\u003c/a\u003e and may more other) But still cant reach the proper xampp/index.php file (or other way xampp/index.html). I would like to ask ( those who can reach the the following screen(s), which is displayed at 6:30 in this \u003ca href=\"https://www.youtube.com/watch?v=U5ghHLRv6uc\" rel=\"nofollow noreferrer\"\u003eyoutube tutorial\u003c/a\u003e ).\nCause I can reach just the following schreen: which is displayed at 16:25 in this \u003ca href=\"https://www.youtube.com/watch?v=kw04VH9O5NQ\" rel=\"nofollow noreferrer\"\u003eyoutube tutorial\u003c/a\u003e.\u003c/p\u003e\n\n\u003cp\u003ethe code what I see in my DEFAULT \u003ccode\u003eindex.php\u003c/code\u003e is this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\n if (!empty($_SERVER['HTTPS']) \u0026amp;\u0026amp; ('on' == $_SERVER['HTTPS'])) {\n $uri = 'https://';\n } else {\n $uri = 'http://';\n }\n $uri .= $_SERVER['HTTP_HOST'];\n header('Location: '.$uri.'/dashboard/');\n exit;\n?\u0026gt;\n\nSomething is wrong with the XAMPP installation :-(\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand I tried to modify this line: \u003ccode\u003eheader('Location: '.$uri.'/dashboard/');\u003c/code\u003e to \u003ccode\u003eheader('Location: '.$uri.'/**xampp**/');\u003c/code\u003e. (in the htdocs/xampp folder I tried to search for the page that is displayed in the tutorial that I linked first).\u003c/p\u003e\n\n\u003cp\u003eSo ones again I want to reach somehow that screen that is displayed in the first tutorial, I went through all the folders in xampp folder but ther is no any that is redirecting to the proper searched site (most probably the newer versions does not consist this feature/ consist this features some other way).\u003c/p\u003e\n\n\u003cp\u003eAnyway I hope someone could help! \u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2016-07-25 15:04:30.69 UTC","last_activity_date":"2016-08-13 20:32:35.057 UTC","last_edit_date":"2017-05-23 12:14:50.32 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"6583418","post_type_id":"1","score":"0","tags":"php|apache|xampp|localhost","view_count":"504"} +{"id":"22689016","title":"utf8_encode of uppercase letter error","body":"\u003cp\u003eI'm trying to encode a string that contains accented uppercase letter like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$string = \"This is a test - À \";\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ei'm trying to encode using \u003ccode\u003eutf8_encode\u003c/code\u003e in this way:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$string = \"This is a test - À \";\n$encoded = utf8_encode($string);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd returned string is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\"This is a test - ã \";\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat function can i use instead \u003ccode\u003eutf8_encode\u003c/code\u003e ?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eThis string is stored into a table in mysql db.\u003c/p\u003e\n\n\u003cp\u003eThis is how i connect to database:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$host = \"xxxxxx:3306\";\n$uid = \"username\";\n$pwd = \"password\";\n$dv_database_name = \"db_name\";\n\n$db_dv = mysql_connect($host, $uid, $pwd);\n\nmysql_query(\"SET NAMES utf8\",$db_dv);\n$sql = \"...\";\n$res = mysql_query($sql, $db_dv);\n$row = mysql_fetch_array($res);\n$string = $row['myField']; // THIS IS THE STRING WITH ACCENTED VALUE\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"5","creation_date":"2014-03-27 13:24:00.13 UTC","last_activity_date":"2014-03-27 16:57:05.077 UTC","last_edit_date":"2014-03-27 16:56:22.097 UTC","last_editor_display_name":"","last_editor_user_id":"168868","owner_display_name":"","owner_user_id":"938350","post_type_id":"1","score":"0","tags":"php|utf-8","view_count":"281"} +{"id":"19530429","title":"Rename file by removing last n characters","body":"\u003cp\u003eI want to rename files by removing the last N characters\u003c/p\u003e\n\n\u003cp\u003eFor example I want to rename these files by removing the last 7 characters\u003c/p\u003e\n\n\u003cp\u003eFrom:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efile.txt.123456\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eTo:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efile.txt\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs this doable in a single command?\u003c/p\u003e","accepted_answer_id":"19531512","answer_count":"4","comment_count":"0","creation_date":"2013-10-23 00:01:33.893 UTC","last_activity_date":"2013-10-23 20:16:25.923 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2771455","post_type_id":"1","score":"4","tags":"shell|unix","view_count":"7348"} +{"id":"47493154","title":"Interpolating a line between two other lines in python","body":"\u003cp\u003eDoes anyone know of a python library that can interpolate between two lines. For example, given the two solid lines below, I would like to produce the dashed line in the middle. In other words, I'd like to get the centreline. The input is a just two \u003ccode\u003enumpy\u003c/code\u003e arrays of coordinates with size \u003ccode\u003eN x 2\u003c/code\u003e and \u003ccode\u003eM x 2\u003c/code\u003e respectively.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/yGZH9.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/yGZH9.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdit\u003c/strong\u003e: so the suggested duplicate seems to be a promising way to approach this. However, it assumes that there is an outer and inner curve with respect to a single origin (0,0). I believe this algorithm would fail in examples such as the one below: \u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/3MWTb.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/3MWTb.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eFurthermore, I'd like to know if someone has written a function for this in some optimized python library. Although optimization isn't exactly a necessary.\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2017-11-26 04:47:54.837 UTC","last_activity_date":"2017-11-26 20:57:34.933 UTC","last_edit_date":"2017-11-26 20:57:34.933 UTC","last_editor_display_name":"","last_editor_user_id":"2158231","owner_display_name":"","owner_user_id":"2158231","post_type_id":"1","score":"2","tags":"python|math|geometry|line|interpolation","view_count":"25"} +{"id":"11545971","title":"Making an absolutely positioned element fill the width of it's container","body":"\u003cp\u003eI have a sidebar that I have positioned absolutely to the right for several reasons. But the problem is that if I have a shorter main content area, the sidebar extends past the content.\u003c/p\u003e\n\n\u003cp\u003eIs there a way with CSS that we can get the container to wrap its height around the sidebar (if the sidebar is longer)?\u003c/p\u003e\n\n\u003cp\u003ePlease this jsFiddle: \u003ca href=\"http://jsfiddle.net/52jjp/\" rel=\"nofollow\"\u003ehttp://jsfiddle.net/52jjp/\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"11546044","answer_count":"3","comment_count":"0","creation_date":"2012-07-18 16:22:30.417 UTC","last_activity_date":"2015-04-16 01:32:23.497 UTC","last_edit_date":"2012-07-18 16:32:41.433 UTC","last_editor_display_name":"","last_editor_user_id":"1261316","owner_display_name":"","owner_user_id":"1261316","post_type_id":"1","score":"1","tags":"html|css|layout","view_count":"275"} +{"id":"42068803","title":"Save copies as .PDF \u0026 .xlsx","body":"\u003cp\u003eI'm trying to save copies of the workbook but don't know how to set the file type when saving, this code makes the files but they're corrupt and cannot be opened.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSub Saves1()\n\n'Store Answers\nDim SavePdfAnswer As String\nDim SaveXlsxAnswer As String\nSavePdfAnswer = VBA_CS.Range(\"C2\")\nSaveXlsxAnswer = VBA_CS.Range(\"C3\")\n\n'Store File Path And Names\nPdfFilePath = VBA_CS.Range(\"M2\") \u0026amp; \"\\\" \u0026amp; ActiveSheet.Range(\"F9\") \u0026amp; \".pdf\" 'File path for pdf file\nExcelFilePath = VBA_CS.Range(\"M2\") \u0026amp; \"\\\" \u0026amp; ActiveSheet.Range(\"F9\") \u0026amp; \".xlsx\" 'File path for excel xlsx file\n\n'Save as pdf\nIf SavePdfAnswer = \"Yes\" Then\n ActiveWorkbook.SaveCopyAs PdfFilePath\nEnd If\n\n'Save as excel xlsx\nIf SaveXlsxAnswer = \"Yes\" Then\n ActiveWorkbook.SaveCopyAs ExcelFilePath\nEnd If\n\nEnd Sub\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"42069320","answer_count":"3","comment_count":"1","creation_date":"2017-02-06 13:19:00.823 UTC","last_activity_date":"2017-02-06 13:45:43.82 UTC","last_edit_date":"2017-02-06 13:29:22.56 UTC","last_editor_display_name":"","last_editor_user_id":"4949483","owner_display_name":"","owner_user_id":"4105679","post_type_id":"1","score":"0","tags":"excel|vba|excel-vba","view_count":"549"} +{"id":"11192885","title":"get Mysql database creation date with java","body":"\u003cp\u003eUsing mysql 5.5.2 on windows (Wamp) I'm writing a Java application that use several databases. I want to list databases names and their creation dates. Databases have the same table's only data vary (Archives). Any trick with Java?\u003c/p\u003e\n\n\u003cp\u003eEDIT:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emysql\u0026gt; show databases;\n+-------------------------+\n| Database |\n+-------------------------+\n| information_schema |\n| formaction_archive_test |\n| mysql |\n| performance_schema |\n| sw_formaction |\n| test |\n+-------------------------+\n6 rows in set (0.00 sec)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\"formaction_archive_test\" and \"sw_formaction\" are both created by me \"root\" and they have the same tables. My problem is how to get their respective creation dates.\u003c/p\u003e\n\n\u003cp\u003eI found this solution:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emysql\u0026gt; use information_schema;\nDatabase changed\nmysql\u0026gt; SELECT table_name, create_time\n -\u0026gt; FROM tables\n -\u0026gt; WHERE table_schema NOT IN('mysql', 'information_schema') ;\n+----------------------------------------------+---------------------+\n| table_name | create_time |\n+----------------------------------------------+---------------------+\n| cond_instances | NULL |\n| events_waits_current | NULL |\n| events_waits_history | NULL |\n| events_waits_history_long | NULL |\n| events_waits_summary_by_instance | NULL |\n| events_waits_summary_by_thread_by_event_name | NULL |\n| events_waits_summary_global_by_event_name | NULL |\n| file_instances | NULL |\n| file_summary_by_event_name | NULL |\n| file_summary_by_instance | NULL |\n| mutex_instances | NULL |\n| performance_timers | NULL |\n| rwlock_instances | NULL |\n| setup_consumers | NULL |\n| setup_instruments | NULL |\n| setup_timers | NULL |\n| threads | NULL |\n| annee | 2012-06-06 16:19:04 |\n| categorie | 2012-06-06 16:19:04 |\n| certification | 2012-06-06 16:19:04 |\n| client | 2012-06-06 16:19:04 |\n| clientold | 2012-06-06 16:19:04 |\n| connaisance_ecole | 2012-06-06 16:19:04 |\n| duree | 2012-06-06 16:19:04 |\n| eleve | 2012-06-06 16:19:04 |\n| famille | 2012-06-06 16:19:04 |\n| formateur | 2012-06-06 16:19:04 |\n| formation | 2012-06-06 16:19:04 |\n| inscription | 2012-06-06 16:19:04 |\n| lieux | 2012-06-06 16:19:05 |\n| lst_formation | 2012-06-06 16:19:05 |\n| moyen_paiement | 2012-06-06 16:19:05 |\n| paiement | 2012-06-06 16:19:05 |\n| session | 2012-06-06 16:19:05 |\n| souhait | 2012-06-06 16:19:05 |\n| souhaits | 2012-06-06 16:19:05 |\n| type_certification | 2012-06-06 16:19:05 |\n+----------------------------------------------+---------------------+\n37 rows in set (0.01 sec)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut it shows me only the last created database informations. May be the solution is to see files creation date?\u003c/p\u003e","accepted_answer_id":"11193410","answer_count":"2","comment_count":"2","creation_date":"2012-06-25 16:00:25.52 UTC","favorite_count":"2","last_activity_date":"2012-06-25 17:33:18.58 UTC","last_edit_date":"2012-06-25 17:33:18.58 UTC","last_editor_display_name":"","last_editor_user_id":"1033733","owner_display_name":"","owner_user_id":"1033733","post_type_id":"1","score":"3","tags":"java|mysql|database","view_count":"4988"} +{"id":"12501701","title":"Use Fiddler with Basic Authentication to access RESTful WebAPI","body":"\u003cp\u003eI have a WebAPI that works without issue. I have tested locally and deployed to my server and configured this service in IIS to use Basic Authentication. I am able to browse to my service and I receive the Authentication challenge I expect and all works swimmingly! Now I want to use Fiddler to test this and I have constructed a POST to a specific url and I got a 401 (Unauthorized) error. So I decided to add a base64 string in my Request Header and I am now getting a 500 error.\u003c/p\u003e\n\n\u003cp\u003eWhat I would like to know is, does my Request Header look correct? I am obviously going to obfuscate my Host and base64 string which contains the format username:password for the Authentication challenge.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eUser-Agent: Fiddler\nHost: xxx.xxx.xxx.xxx:xxxx\nContent-Length: 185\nContent-Type: text/json\nAuthorization: Basic jskadjfhlksadjhdflkjhiu9813ryiu34\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"4","comment_count":"3","creation_date":"2012-09-19 19:39:19.563 UTC","favorite_count":"10","last_activity_date":"2017-09-08 15:06:46.64 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1456959","post_type_id":"1","score":"58","tags":"rest|asp.net-web-api|fiddler","view_count":"61401"} +{"id":"40123209","title":"Need to append divs back to original position","body":"\u003cp\u003eUPDATE: I solved the problem, but I am not sure why it is working. The problem was that I was creating the reset button in my onlick function for the \"attack\" button. However, my onlick function for the reset button was outside of the function it was made in. Why does the button not respond when it is outside of the function it was made in?\u003c/p\u003e\n\n\u003cp\u003eI have a game where the player chooses from 4 characters and they all have the class name \u003ccode\u003echarContainer\u003c/code\u003e. After the player chooses one character, I iterate over the list using \u003ccode\u003e.each\u003c/code\u003e to remove the class \u003ccode\u003echarContainer\u003c/code\u003e and add class \u003ccode\u003efoes\u003c/code\u003e to each of the characters that didn't get chosen. These characters that get the new \u003ccode\u003efoes\u003c/code\u003e class are appended to a div with id \u003ccode\u003eenemies\u003c/code\u003e. The player then chooses one enemy at a time to fight until either he/she loses all health value or defeats all enemies available. \u003c/p\u003e\n\n\u003cp\u003eThe problem is, upon one of these conditions being met, I create a button using jquery and give it an id \u003ccode\u003eresetButton\u003c/code\u003e. When that button shows up in the DOM and I click it, I am trying to select all divs with the class \u003ccode\u003efoes\u003c/code\u003e and add class \u003ccode\u003echarContainer\u003c/code\u003e again, and then append it to the original container. This is not working when I click the reset button. In the browser console, it is showing that the class \u003ccode\u003echarContainer\u003c/code\u003e did not get added after the button was clicked.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e $('.charContainer').on('click', function(){\n\n $('#your').append($(this));\n if(firstRound == true) \n {\n damage = $('#your .charContainer').data('attack');\n playerHP = $('#your .charContainer').data('hpp');\n }\n\n console.log('before', this);\n $('.characters\u0026gt;.charContainer').each(function(){\n $(this).removeClass('charContainer').addClass('foes');\n $('#enemies').append($(this));\n })\n if($(this).hasClass('foes'))\n {\n $('#fighter').append($(this));\n console.log('after', this)\n counter = $('#fighter .foes').data('cattack');\n enemyHP = $('#fighter .foes').data('hpp');\n }\n\n })\n\n $('#attack').on('click', function(){\n if($('#your .charContainer').length \u0026amp;\u0026amp; $('#fighter .foes').length)\n {\n\n playerHP -= counter;\n console.log(playerHP);\n console.log('damage', damage);\n enemyHP -= damage;\n $('.charContainer .health').html(playerHP);\n $('#fighter .foes .health').html(enemyHP); \n $('.oppName').remove();\n $('.oppName2').remove();\n var newH2 = $('\u0026lt;h2\u0026gt;').addClass('oppName');\n var newH22 = $('\u0026lt;h2\u0026gt;').addClass('oppName2');\n $('.FightProgress').append(newH2);\n $('.FightProgress').append(newH22);\n $('.oppName').html('You attacked ' + $('#fighter .foes').data('name') + ' for ' + damage + ' damage!');\n $('.oppName2').html($('#fighter .foes').data('name') + ' attacked you back for ' + counter + ' damage!');\n damage += 8;\n console.log(enemyHP);\n console.log('cdamage', counter);\n\n if(playerHP \u0026lt;= 0)\n {\n $('.lose').html(lose);\n var gameReset = $('\u0026lt;button\u0026gt;' + 'Play Again?' + '\u0026lt;/button\u0026gt;').attr('id', 'resetButton'); \n $('.lose').append(gameReset);\n }\n else if(playerHP \u0026gt; 0 \u0026amp;\u0026amp; enemyHP \u0026lt;= 0)\n {\n firstRound = false;\n $('#fighter\u0026gt;.foes').hide();\n $('.oppName2').remove();\n $('.oppName').html('You have defeated ' + $('#fighter .foes').data('name') + ' , select another opponent.')\n $('#fighter\u0026gt;.foes').remove();\n }\n }\n\n })\n\n $('#resetButton').on('click', function(){\n // $('.characters').append('.charContainer');\n // $('.foes').each(function(){\n $('.foes').addClass('charContainer');\n // $('.characters').append('.charContainer');\n // })\n // if($('#fighter .foes').length == true)\n // {\n // $('#fighter .foes').addClass('charContainer').removeClass('foes')\n // }\n // $('.characters').append('.charContainer');\n })\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"6","creation_date":"2016-10-19 05:50:46.267 UTC","last_activity_date":"2016-10-21 22:06:36.717 UTC","last_edit_date":"2016-10-21 22:06:36.717 UTC","last_editor_display_name":"","last_editor_user_id":"6820053","owner_display_name":"","owner_user_id":"6820053","post_type_id":"1","score":"3","tags":"javascript|jquery|html","view_count":"113"} +{"id":"45078960","title":"Swift - Updating Tableview after saving Core data","body":"\u003cp\u003eI have a mainVC where i perform a fetch request.\nI then pass the fetched data to a second view controller (HomeVc) and then to third (MyparamsVc)\nIn the third VC i have a tableView Which list all the parameters which have a relation one-to-may with the entity i fetched in the main VC\u003c/p\u003e\n\n\u003cp\u003eIn a fourth View controller i add the new parameters through a form (addParamVC). After saving i dismiss the controller and pop the previous one (MyparamsVc).\nMy problem is that the tableview is not updating with the new data unless i go back to my HomeVC and then again into the MyparamsVC\u003c/p\u003e\n\n\u003cp\u003eI have implemented the func controllerDidChange an Object but since i'm not performing the fetch in the same controller the function is never called... How can i Update the tableview with new data?\u003c/p\u003e\n\n\u003cp\u003eMainVc fetchRequest:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e var controller: NSFetchedResultsController\u0026lt;SwimminPool\u0026gt;!\n\noverride func viewDidLoad() {\n super.viewDidLoad()\n\n tableView.delegate = self\n tableView.dataSource = self\n\n attemptFetch()\n\n}\nfunc attemptFetch() {\n\n let fetchRequest: NSFetchRequest\u0026lt;SwimminPool\u0026gt; = SwimminPool.fetchRequest()\n let dataSort = NSSortDescriptor(key: \"poolCreatedAt\", ascending: false)\n fetchRequest.sortDescriptors = [dataSort]\n\n\n let controller = NSFetchedResultsController(fetchRequest: fetchRequest, managedObjectContext: context, sectionNameKeyPath: nil, cacheName: nil)\n\n controller.delegate = self\n self.controller = controller\n\n do {\n try controller.performFetch()\n } catch {\n let error = error as NSError\n print(\"\\(error.debugDescription)\")\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eaddParamVC saving func:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar swimmingPoolToConnect: SwimmingPool!\nvar parameterToEdit: Parameter?\n\n@IBAction func saveBtnPressed(_ sender: Any) {\n\n var parameter: Parameter\n\n if parameterToEdit == nil {\n parameter = Parameter(context:context)\n } else {\n parameter = parameterToEdit!\n }\n\n if let pH = phTextField.text?.characters.split(separator: \",\").joined(separator: \".\") {\n if let pHnoComma = Double(String(pH)) {\n parameter.paramPH = pHnoComma\n }\n }\n parameter.createdAt = Date()\n\n swimmingPoolToConnect.addToParameters(parameter)\n\n ad.saveContext()\n self.presentingViewController?.dismiss(animated: true, completion: nil)\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMyparamsVC:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e var parameters = [Parameter]()\nvar swimmingPool: SwimmingPool! {\n didSet {\n parameters = (swimmingPool.parameters?.allObjects as! [Parameter]).sorted(by: {$0.createdAt! \u0026gt; $1.createdAt!})\n }\n}\n\nvar controller: NSFetchedResultsController\u0026lt;Parameter\u0026gt;?\n\n func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -\u0026gt; UITableViewCell {\n let cell = tableView.dequeueReusableCell(withIdentifier: \"ParamCell\", for: indexPath) as! ParamCell\n configureCell(cell: cell, indexPath: indexPath)\n return cell\n}\n\n func configureCell(cell: ParamCell, indexPath: IndexPath) {\n\n let param = parameters[indexPath.row]\n cell.configureCell(parameter: param)\n}\n\nfunc tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {\n\n let parameterToPass = parameters[indexPath.row]\n DispatchQueue.main.async { () -\u0026gt; Void in\n self.performSegue(withIdentifier: \"MyParameterDetail\", sender: parameterToPass)\n }\n}\nfunc tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -\u0026gt; Int {\n return parameters.count\n }\nfunc numberOfSections(in tableView: UITableView) -\u0026gt; Int {\n return 1\n}\n\n //Never enter these func\n\nfunc controllerWillChangeContent(_ controller: NSFetchedResultsController\u0026lt;NSFetchRequestResult\u0026gt;) {\n tableView.beginUpdates()\n}\n\nfunc controllerDidChangeContent(_ controller: NSFetchedResultsController\u0026lt;NSFetchRequestResult\u0026gt;) {\n tableView.endUpdates()\n}\n\nfunc controller(_ controller: NSFetchedResultsController\u0026lt;NSFetchRequestResult\u0026gt;, didChange anObject: Any, at indexPath: IndexPath?, for type: NSFetchedResultsChangeType, newIndexPath: IndexPath?) {\n\n switch(type){\n case.insert:\n if let indexPath = newIndexPath{\n tableView.insertRows(at: [indexPath], with: .fade)\n\n }\n\n case.delete:\n if let indexPath = indexPath{\n tableView.deleteRows(at: [indexPath], with: .fade)\n }\n\n case.update:\n if let indexPath = indexPath{\n let cell = tableView.cellForRow(at: indexPath) as! ParamCell\n configureCell(cell: cell, indexPath: indexPath)\n }\n\n case.move:\n if let indexPath = indexPath{\n tableView.deleteRows(at: [indexPath], with: .fade)\n }\n if let indexPath = newIndexPath{\n tableView.insertRows(at: [indexPath], with: .fade)\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"45080057","answer_count":"2","comment_count":"0","creation_date":"2017-07-13 11:12:58.993 UTC","last_activity_date":"2017-07-13 12:08:40.193 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4465024","post_type_id":"1","score":"0","tags":"ios|uitableview|core-data|swift3","view_count":"414"} +{"id":"47536160","title":"cannot get string inside an element - object literal javascript","body":"\u003cp\u003eI'm trying to to get the strings of two divs \u003ccode\u003e.class-date\u003c/code\u003e and \u003ccode\u003e.class-time\u003c/code\u003e but i'm getting an Uncaught TypeError \"e.siblings is not a function\". This probably a rudimentary mistake but I can't work it out. Any pointers in the right direction would be greatly appreciated .\u003c/p\u003e\n\n\u003cp\u003e\u003cdiv class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\"\u003e\r\n\u003cdiv class=\"snippet-code\"\u003e\r\n\u003cpre class=\"snippet-code-js lang-js prettyprint-override\"\u003e\u003ccode\u003evar Cc = {\r\n init: function() {\r\n Cc.bindEvent();\r\n },\r\n bindEvent: function() {\r\n $('.book-class').on(\"click\", function() {\r\n let selectedclass = this;\r\n Cc.parseClass(selectedclass);\r\n });\r\n },\r\n parseClass: function(selectedclass) {\r\n let classdate = selectedclass.siblings('.class-date').text();\r\n let classtime = selectedclass.siblings('.class-time').text();\r\n console.log(classdate, classtime);\r\n }\r\n}\r\n\r\njQuery(document).ready(function($) {\r\n Cc.init();\r\n});\u003c/code\u003e\u003c/pre\u003e\r\n\u003cpre class=\"snippet-code-html lang-html prettyprint-override\"\u003e\u003ccode\u003e\u0026lt;script src=\"https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\r\n\u0026lt;div class=\"class\"\u0026gt;\r\n \u0026lt;div class=\"class-date\"\u0026gt;Thursday, 1 January\u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"class-time\"\u0026gt;18:00 — 20:00\u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"book-class\"\u0026gt;Book Class\u0026lt;/div\u0026gt;\r\n\u0026lt;/div\u0026gt;\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003c/p\u003e","accepted_answer_id":"47536239","answer_count":"3","comment_count":"0","creation_date":"2017-11-28 16:15:19.28 UTC","last_activity_date":"2017-11-28 16:28:40.897 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4438877","post_type_id":"1","score":"0","tags":"javascript|jquery","view_count":"29"} +{"id":"43182531","title":"Extract lines corresponding to the minimum value in the last column","body":"\u003cp\u003eI need help with extracting all the lines from the file that has minimum number in the last column, i.e 7 in in this case.\u003c/p\u003e\n\n\u003cp\u003eThe sample file is as below:\u003c/p\u003e\n\n\u003cp\u003eFile-1.txt\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eVALID_PATH : [102, 80, 112, 109, 23, 125, 111] 7\nVALID_PATH : [102, 81, 112, 109, 23, 125, 111] 7\nVALID_PATH : [102, 112, 37, 109, 23, 125, 111] 7\nVALID_PATH : [102, 112, 37, 56, 23, 125, 111] 7\nVALID_PATH : [102, 80, 112, 37, 109, 23, 125, 111] 8\nVALID_PATH : [102, 80, 112, 37, 56, 23, 125, 111] 8\nVALID_PATH : [102, 80, 112, 109, 23, 125, 110, 111] 8\nVALID_PATH : [102, 80, 127, 6, 112, 109, 23, 125, 111] 9\nVALID_PATH : [102, 80, 127, 88, 112, 109, 23, 125, 111] 9\nVALID_PATH : [102, 80, 112, 37, 109, 23, 125, 110, 111] 9\nVALID_PATH : [102, 80, 112, 37, 56, 23, 125, 110, 111] 9\nVALID_PATH : [102, 80, 127, 6, 112, 37, 109, 23, 125, 111] 10\nVALID_PATH : [102, 80, 127, 6, 112, 37, 56, 23, 125, 111] 10\nVALID_PATH : [102, 80, 127, 6, 112, 109, 23, 125, 110, 111] 10\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere, I want to extract all the lines that have 7, which is the least value (minimum value) in the last column and save the output into another file File-2.txt by only extracting the values enclosed in [], as shown below.\u003c/p\u003e\n\n\u003cp\u003eFile-2.txt\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e102, 80, 112, 109, 23, 125, 111\n102, 81, 112, 109, 23, 125, 111\n102, 112, 37, 109, 23, 125, 111\n102, 112, 37, 56, 23, 125, 111\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI could use awk to get the least value as \"7\" from the last column using the code as below:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eawk 'BEGIN{getline;min=max=$NF}\nNF{\n max=(max\u0026gt;$NF)?max:$NF\n min=(min\u0026gt;$NF)?$NF:min\n}\nEND{print min,max}' File-1.txt\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand to print only the values in square brackets [] buy using the awk code as below:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eawk 'NR \u0026gt; 1 {print $1}' RS='[' FS=']' File-1.txt\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut, I am stuck in assigning the least value obtained from first awk script, i.e. 7 in this case to extract the corresponding numbers enclosed in [], as shown in File-2.txt.\u003c/p\u003e\n\n\u003cp\u003eAny help in resolving this problem will be appreciated.\u003c/p\u003e","accepted_answer_id":"43182745","answer_count":"5","comment_count":"0","creation_date":"2017-04-03 10:44:46.253 UTC","last_activity_date":"2017-04-03 11:41:58.19 UTC","last_edit_date":"2017-04-03 11:00:48.457 UTC","last_editor_display_name":"","last_editor_user_id":"5291015","owner_display_name":"","owner_user_id":"3925751","post_type_id":"1","score":"2","tags":"awk","view_count":"47"} +{"id":"7174851","title":"Help with creating a scheduled task","body":"\u003cp\u003eI came across this code which should be able to compare my PC time with the time stored in theTime; however, I can't get it to work. Can anybody help?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edim theTime as datetime\n\ntheTime = CDate(txtTime.Text)\n\nif theTime.hour = now.hour and theTime.minute = now.minute then\n'shut down code\nSystem.Diagnostics.Process.Start(\"Shutdown.exe\", \"-s -t 0\")\nend if\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"1","creation_date":"2011-08-24 11:44:29.333 UTC","last_activity_date":"2014-08-03 18:49:49.553 UTC","last_edit_date":"2011-08-24 14:02:25.617 UTC","last_editor_display_name":"","last_editor_user_id":"675568","owner_display_name":"","owner_user_id":"909538","post_type_id":"1","score":"0","tags":"vb.net|time","view_count":"176"} +{"id":"46913309","title":"Linux Q: Cannot access to the file. No permission. Although [-rw-rw-rw]","body":"\u003cp\u003eI'm using CentOS 6.5\u003c/p\u003e\n\n\u003cp\u003eUser : Erik\u003c/p\u003e\n\n\u003cp\u003eI cannot access to the specific file although permission is \u003ccode\u003e[-rw-rw-rw]\u003c/code\u003e.\u003cbr\u003e\nWhy this happening.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eState:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e--- Parent Directory ---\u003cbr\u003e\n Dir Name : Source\u003cbr\u003e\n Permission : [dr-r-x-r--] Owner : Erik\u003c/p\u003e\n \n \u003cp\u003e--- Source File List ---\u003cbr\u003e\n header.php Erik [-rw-rw-rw-] : \u003cstrong\u003eCan read but cannot edit file.\u003c/strong\u003e\u003cbr\u003e\n footer.php Erik [-rw-rw-rw-] : \u003cstrong\u003eCan read but cannot edit file.\u003c/strong\u003e\u003cbr\u003e\n banner.php Erik [-rw-rw-rw-] : Can read and edit.\u003cbr\u003e\n customer.php Erik [-rw-rw-rw-] : Can read and edit.\u003cbr\u003e\n list.php Erik [-rw-rw-rw-] : Can read and edit. \u003c/p\u003e\n \n \u003cp\u003e--- Result of \u003ccode\u003els -alp\u003c/code\u003e\u003cbr\u003e\n drwxr-xr-x. 2 Erik Erik 4096 2017-03-15 11:33 ./\u003cbr\u003e\n drwxr-xr-x. 14 Erik Erik 4096 2017-03-15 11:30 ../\u003cbr\u003e\n -rw-rw-rw-. 1 Erik Erik 1102 2017-10-24 23:07 header.php\u003cbr\u003e\n -rw-rw-rw-. 1 Erik Erik 680 2015-01-19 13:01 footer.php\u003cbr\u003e\n -rw-rw-rw-. 1 Erik Erik 1449 2015-01-23 09:42 banner.php\u003cbr\u003e\n -rw-rw-rw-. 1 Erik Erik 953 2014-12-03 09:31 customer.php\u003cbr\u003e\n -rw-rw-rw-. 1 Erik Erik 810 2014-12-03 09:31 list.php \u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI can't understand why I can't edit the \u003ccode\u003eheader.php\u003c/code\u003e and \u003ccode\u003efooter.php\u003c/code\u003e althogh I'm Erik with permission \u003ccode\u003e-rw-rw-rw\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eIs there any way to edit \u003ccode\u003eheader.php\u003c/code\u003e \u0026amp; \u003ccode\u003efooter.php\u003c/code\u003e file avoid to change permission of \u003cstrong\u003eParent Directory\u003c/strong\u003e.\nSomeone please help me. This is very important to me.\u003c/p\u003e\n\n\u003cp\u003eThank you in advance.\u003c/p\u003e","accepted_answer_id":"46922076","answer_count":"1","comment_count":"14","creation_date":"2017-10-24 14:33:22.17 UTC","last_activity_date":"2017-10-25 00:35:14.43 UTC","last_edit_date":"2017-10-24 14:48:40.653 UTC","last_editor_display_name":"","last_editor_user_id":"8402500","owner_display_name":"","owner_user_id":"8402500","post_type_id":"1","score":"-3","tags":"php|linux|permissions","view_count":"39"} +{"id":"12810793","title":"how to allow only one vote for a rating system","body":"\u003cp\u003eguys i have made a jquery and css based star rating system. now i cant really think of way as how to save the user vote to database. and most importantly how to limit one user only to one vote.\u003cbr /\u003e\u003cbr /\u003e\nsince the number of visitors in the site is huge, i cant afford saving each user's ip to the database. and moreover i don't think it works good because even my ip address itself is dynamic. every time i disconnect and reconnect my internet my ip changes and i am able to vote again. so i don't think this will work.\u003cbr /\u003e\u003cbr /\u003e\nthis is what i have thought about saving the votes to the database:\nill just save the number of votes a page has received and ill save the total rating of the page.\u003cbr /\u003e\u003cbr /\u003e\nand ill divide the rating points with number of votes. so it will give me the average rating. right?\u003cbr /\u003e\u003cbr /\u003e\nbut i can think of no way to limit one user to one vote. please help.\u003c/p\u003e","accepted_answer_id":"12811029","answer_count":"2","comment_count":"10","creation_date":"2012-10-10 01:42:06.29 UTC","favorite_count":"1","last_activity_date":"2012-10-10 02:14:25.09 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"842266","post_type_id":"1","score":"0","tags":"php|rating-system","view_count":"1632"} +{"id":"34474957","title":"Failure when Simplesamlphp is behind load balancer","body":"\u003cp\u003eWe use \u003ca href=\"https://simplesamlphp.org/docs/stable/simplesamlphp-sp\" rel=\"nofollow noreferrer\"\u003esimplesamlphp\u003c/a\u003e as a service provider. We've integrated with a number of Idp's. Everything works fine.\u003c/p\u003e\n\n\u003cp\u003eNow we want to change our server architecture to \u003ccode\u003eload balancer -\u0026gt; webserver -\u0026gt; database server\u003c/code\u003e. The problem comes up when we put the \u003ccode\u003eload balancer\u003c/code\u003e in front of the \u003ccode\u003ewebserver\u003c/code\u003e. The idp's get an error. \u003c/p\u003e\n\n\u003cp\u003eThe \u003ccode\u003eload balancer\u003c/code\u003e terminates \u003ccode\u003ehttps\u003c/code\u003e, which I believe is where the problem is happening. So when the \u003ccode\u003eload balancer\u003c/code\u003e sends the request to the \u003ccode\u003ewebserver\u003c/code\u003e it is a regular \u003ccode\u003ehttp\u003c/code\u003e request. \u003c/p\u003e\n\n\u003cp\u003eWhen I log the initial happenings I get\u003c/p\u003e\n\n\u003cp\u003eI'm gonna simplify the \u003ccode\u003exml\u003c/code\u003e a bit and put the parts that were different\u003c/p\u003e\n\n\u003cp\u003ewith \u003ccode\u003eload balancer\u003c/code\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSession: 'idp-name' not valid because we are not authenticated.\nSaved state: '_somelongstringofnumbersandletters'\nSending SAML 2 AuthnRequest to '{{their info}}'\nSending message:\n \u0026lt;samlp:AuthnRequest ... AssertionConsumerServiceURL=\"http://{{our-info}}\"\u0026gt;\n \u0026lt;saml:Issuer\u0026gt;http://{{our-info}}\u0026lt;/saml:Issuer\u0026gt;\n \u0026lt;samlp:NameIDPolicy Format=\"urn:oasis:names:tc:SAML:2.0:nameid-format:transient\" AllowCreate=\"true\"/\u0026gt;\n \u0026lt;/samlp:AuthnRequest\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo above the only parts that are different between pointing to \u003ccode\u003eload balancer\u003c/code\u003e and \u003ccode\u003ewebserver\u003c/code\u003e is the \u003ccode\u003ehttp\u003c/code\u003e and \u003ccode\u003ehttps\u003c/code\u003e, respectively.\u003c/p\u003e\n\n\u003cp\u003eWasn't sure if there was a way to have \u003ccode\u003esimplesamlphp\u003c/code\u003e just return \u003ccode\u003ehttps\u003c/code\u003e. Or will it always check the current state of the request and assume \u003ccode\u003ehttp\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eJust to make sure I'm giving all the data. The process is initialized by the SP. So they just go to a url like \u003ca href=\"https://oursite.com/idp-name\" rel=\"nofollow noreferrer\"\u003ehttps://oursite.com/idp-name\u003c/a\u003e. And we are always using \u003ccode\u003ehttps\u003c/code\u003e. \u003c/p\u003e\n\n\u003cp\u003eLet me know if I need to clarify something. \u003c/p\u003e\n\n\u003ch1\u003eUPDATE\u003c/h1\u003e\n\n\u003cp\u003eWe solved the problem by \u003cstrong\u003eNOT\u003c/strong\u003e terminating the HTTPS request at the load balancer, and allowing the request to pass through to the servers. So our SSL certificates are directly on our Web servers and not the load balancer. \u003c/p\u003e\n\n\u003cp\u003eI couldn't get the solution given to work, but that could just be my own fault. We needed a solution quick, and not decrypting SSL on the load balancer was the easiest way.\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2015-12-26 20:24:53.923 UTC","last_activity_date":"2017-05-26 17:41:31.62 UTC","last_edit_date":"2017-05-26 17:41:31.62 UTC","last_editor_display_name":"","last_editor_user_id":"2241552","owner_display_name":"","owner_user_id":"2241552","post_type_id":"1","score":"1","tags":"php|https|load-balancing|saml-2.0|simplesamlphp","view_count":"655"} +{"id":"27807083","title":"Warning message: In curlOptions: Duplicated curl options","body":"\u003cp\u003eI am working on an R script that will fetch posts from twitter. I've noticed that everytime I run below statements:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003el_get \u0026lt;- GET( l_twitterQuery, config(httpheader = c(\"Authorization\" = l_token)))\n\nl_post \u0026lt;- POST( url = l_oAuthUrl\n , config( httpheader = c( \"Authorization\" = paste(\"Basic\", l_encodCons)\n , \"Content-Type\" = l_postContentType ))\n , body = l_postBody\n , encode = l_encode\n );\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBelow warning message is displayed:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eWarning message:\nIn curlOptions(..., .opts = .opts) :\n Duplicated curl options: proxyport, proxyuserpwd, proxy\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI haven't found any good information on the web to solve this? Do I need to modify the httpheader only once in the set_config statement? Please find my script below:\u003c/p\u003e\n\n\u003cp\u003eCode:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e###########################################################\n#\n# Libraries\n#\n###########################################################\n\nlibrary(httr)\nlibrary(jsonlite)\nlibrary(RCurl)\nlibrary(RJSONIO)\n\n###########################################################\n#\n# Variables\n#\n###########################################################\n\n\n# Proxy Variables for VPN\n#l_proxyUrl \u0026lt;- \"XXXXXXXXXXXXXXX\n#l_proxyPort \u0026lt;- 80;\n\n# Access Key , Tokens, POST, GETt variables\nl_consKey \u0026lt;- \"YVY6KPUyNIhKLpz0Y66CJKssr\";\nl_consSecret \u0026lt;- \"noVJNzneZMuWq4uJSnX70Y20FAF2eu0gL42yhz9uq6xNEGlAiB\";\nl_cons \u0026lt;- paste(l_consKey, l_consSecret, sep = \":\");\nl_encodCons \u0026lt;- c()\nl_token \u0026lt;- c()\nl_post \u0026lt;- c()\nl_get \u0026lt;- c()\n\nl_oAuthUrl \u0026lt;- \"https://api.twitter.com/oauth2/token\";\nl_postBody \u0026lt;- \"grant_type=client_credentials\";\nl_encode \u0026lt;- \"multipart\";\n\nl_postContentType \u0026lt;- \"application/x-www-form-urlencoded;charset=UTF-8\";\n\n# Twitter Variables\nl_twitterUrl \u0026lt;- \"https://api.twitter.com/1.1/search/tweets.json\"\nl_queryParams \u0026lt;- \"?q=%23Oracle\u0026amp;result_type=recent\u0026amp;count=100\"\nl_twitterQuery \u0026lt;- c()\n\n###########################################################\n#\n# Body\n#\n###########################################################\n\n#Configure Proxy\n#set_config( use_proxy( url = l_proxyUrl, port = l_proxyPort ))\n\n#Encode the consumer key and secret.\nl_encodCons \u0026lt;- base64( txt = l_cons );\n\n#Request\nl_post \u0026lt;- POST( url = l_oAuthUrl\n , config( httpheader = c( \"Authorization\" = paste(\"Basic\", l_encodCons)\n , \"Content-Type\" = l_postContentType ))\n , body = l_postBody\n , encode = l_encode\n );\n\nl_token \u0026lt;- paste(\"Bearer\", content(l_post)$access_token)\n\ni \u0026lt;- 0\n\nwhile ( TRUE )\n{\n\n l_twitterQuery \u0026lt;- paste(l_twitterUrl, l_queryParams, sep =\"\")\n l_get \u0026lt;- GET( l_twitterQuery, config(httpheader = c(\"Authorization\" = l_token)))\n l_results \u0026lt;- content( l_get, as = \"text\")\n l_tweets \u0026lt;- fromJSON(l_results)\n\n i \u0026lt;- i + 1 \n x \u0026lt;- names( l_tweets )[1]\n\n cat( sprintf( \"System Time %s \\t Iteration %s \\t Names: %s \\t Time Taken: %s \\t Query: %s \\n\", Sys.time(), i, x, l_tweets$search_metadata$completed_in, l_twitterQuery ))\n\n l_queryParams \u0026lt;- l_tweets$search_metadata$next_results\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSessionInfo:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026gt; sessionInfo()\nR version 3.1.0 (2014-04-10)\nPlatform: x86_64-w64-mingw32/x64 (64-bit)\n\nlocale:\n[1] LC_COLLATE=Spanish_Mexico.1252 LC_CTYPE=Spanish_Mexico.1252 LC_MONETARY=Spanish_Mexico.1252 LC_NUMERIC=C \n[5] LC_TIME=Spanish_Mexico.1252 \n\nattached base packages:\n[1] stats graphics grDevices utils datasets methods base \n\nother attached packages:\n[1] RJSONIO_1.3-0 jsonlite_0.9.14 httr_0.5 RCurl_1.95-4.4 bitops_1.0-6 \n\nloaded via a namespace (and not attached):\n[1] stringr_0.6.2 tools_3.1.0 \n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"3","creation_date":"2015-01-06 20:59:36.397 UTC","last_activity_date":"2015-01-07 01:38:22.217 UTC","last_edit_date":"2015-01-07 01:37:17.1 UTC","last_editor_display_name":"","last_editor_user_id":"2096642","owner_display_name":"","owner_user_id":"2096642","post_type_id":"1","score":"0","tags":"r|rcurl|httr|rjsonio|jsonlite","view_count":"92"} +{"id":"23762372","title":"In mongoDB can I efficiently group documents into groups of a set size?","body":"\u003cp\u003eI need to group data into subgroups of a set size. Like if there are 6 records, ordered by date.\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003e[1,2,3,4,5,6]\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eand I have a subgroup size of 2. I would end up with an array(length of 3) of arrays(each length 2):\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003e[[1,2],[3,4],[5,6]]\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eNothing about the record factors into the grouping, just how they are ordered over all and the subgroup size. \u003c/p\u003e\n\n\u003cp\u003eDoes the aggregation framework have something that would help with this?\u003c/p\u003e","accepted_answer_id":"23764697","answer_count":"1","comment_count":"1","creation_date":"2014-05-20 14:20:18.36 UTC","last_activity_date":"2014-05-20 15:55:58.24 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"289740","post_type_id":"1","score":"0","tags":"mongodb|statistics|aggregation-framework","view_count":"39"} +{"id":"26250201","title":"How to add more button at the end of UILabel?","body":"\u003cp\u003eI have been working on this for a long time.\nI need to expand and collapse the \u003ccode\u003eUILabel\u003c/code\u003e text on click of a button located at the end of text of \u003ccode\u003eUILabel\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eThinks I have tried\nI have use VSWordDetector to detect which word of \u003ccode\u003eUILabel\u003c/code\u003e get tapped but it not gave correct word tapped.\u003c/p\u003e","answer_count":"1","comment_count":"4","creation_date":"2014-10-08 06:06:22.01 UTC","last_activity_date":"2014-10-08 10:37:07.457 UTC","last_edit_date":"2014-10-08 06:30:54.833 UTC","last_editor_display_name":"","last_editor_user_id":"3126646","owner_display_name":"","owner_user_id":"4070083","post_type_id":"1","score":"1","tags":"ios|objective-c|iphone","view_count":"2233"} +{"id":"45505195","title":"Set layout background color using SMYK Seekbars","body":"\u003cp\u003eBasically, I made 3 Seekbars with max value of 255 (RGB values) and with this method: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate void updateBackground() {\n\n seekR = redSeekBar.getProgress();\n seekG = greenSeekBar.getProgress();\n seekB = blueSeekBar.getProgress();\n myLayout.setBackgroundColor(0xff000000\n + seekR * 0x10000\n + seekG * 0x100\n + seekB\n );\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethen used in \u003cstrong\u003eSeekBar.OnSeekBarChangeListener\u003c/strong\u003e I was able to change my background dynamically using Red, Green and Blue values and it works perfectly fine.\u003c/p\u003e\n\n\u003cp\u003eAnyone having any idea how can I change this to 4 Seekbars, but using a CMYK method, instead of RGB..?\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2017-08-04 11:04:34.85 UTC","last_activity_date":"2017-08-04 11:04:34.85 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"8393371","post_type_id":"1","score":"0","tags":"java|android|cmyk","view_count":"23"} +{"id":"34258410","title":"How do I make and if else statement for individual radio buttons?","body":"\u003cp\u003eI have this code that creates radio buttons, can someone show me the code to select each button separately when a radio button is check on an If Else statement when I click a button please?. How can I make the text of each radio button different?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate void createButtons()\n {\n flowLayoutPanel1.Controls.Clear();\n for(int i = 0;i \u0026lt;10;i++)\n {\n RadioButton b = new RadioButton();\n b.Name = i.ToString();\n b.Text = \"radiobutton\" + i.ToString();\n b.AutoSize = true;\n flowLayoutPanel1.Controls.Add(b);\n\n }\n }\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"0","creation_date":"2015-12-14 01:13:37.433 UTC","last_activity_date":"2015-12-14 16:57:19.933 UTC","last_edit_date":"2015-12-14 02:33:43.42 UTC","last_editor_display_name":"","last_editor_user_id":"5597259","owner_display_name":"","owner_user_id":"5597259","post_type_id":"1","score":"1","tags":"c#|winforms|dynamic|radio-button","view_count":"66"} +{"id":"16544102","title":"How to change style of HTML element depending on another elements style?","body":"\u003cp\u003eIn my Web application i am changing style of HTML Element using javascript.\u003c/p\u003e\n\n\u003cp\u003eSee be below code,\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction layout() {\n if(document.getElementById('sh1').getAttribute('src') == \"abc.png\") {\n document.getElementById(\"sh1\").style.display=\"none\";\n } else {\n document.getElementById(\"sh1\").style.display=\"block\";\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand HTML is :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;img id=\"sh1\" src=\"abc.png\" /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow i want that if img elements style is display:none; then below Elements \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;p id=\"Text1\"\u0026gt;Name\u0026lt;br /\u0026gt;description\u0026lt;/p\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003estyle should also get changed to display:none; and if img elements style is display:block; then above Elements style should also get changed to display:block; automatically.\u003c/p\u003e\n\n\u003cp\u003ehow this can get achieved?\u003c/p\u003e","answer_count":"3","comment_count":"3","creation_date":"2013-05-14 13:09:26.64 UTC","last_activity_date":"2013-05-14 13:30:50.413 UTC","last_edit_date":"2013-05-14 13:14:10.11 UTC","last_editor_display_name":"","last_editor_user_id":"2113185","owner_display_name":"","owner_user_id":"2139497","post_type_id":"1","score":"0","tags":"javascript|html|css","view_count":"226"} +{"id":"10616213","title":"Grid inside a scrollviewer with multiple user controls inside","body":"\u003cp\u003eI am new to WPF and xaml and I have a problem with my apps UI.\u003cbr\u003e\nI am using this xaml code: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;ScrollViewer HorizontalAlignment=\"Left\" Margin=\"252,12,0,0\" Name=\"captchaControlsScrollableContainer\" VerticalAlignment=\"Top\"\u0026gt;\n \u0026lt;Grid Name=\"captchaControls\" Width=\"339\" Height=\"286\"\u0026gt;\n \u0026lt;/Grid\u0026gt;\n\u0026lt;/ScrollViewer\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd this code behind code that populates the grid: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecaptchaControls.Children.Add(new Captcha(data));\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhich is called more than one time\u003cbr\u003e\nMy problem is that only the first user control app apperas in the grid although in the debugger captchaControls.Children.Count is the right size and the scrollviewer's scrollbar is disabled.\u003c/p\u003e\n\n\u003cp\u003eDoes anyone have any idea what I am doing wrong? Thank you in advance.\u003c/p\u003e","accepted_answer_id":"10616379","answer_count":"1","comment_count":"1","creation_date":"2012-05-16 09:59:27.36 UTC","last_activity_date":"2012-05-16 20:27:35.573 UTC","last_edit_date":"2012-05-16 20:27:35.573 UTC","last_editor_display_name":"","last_editor_user_id":"546730","owner_display_name":"","owner_user_id":"242721","post_type_id":"1","score":"0","tags":"c#|wpf|xaml","view_count":"1342"} +{"id":"46232734","title":"How to retrieve history of pubnub chat in xamarin.forms","body":"\u003cp\u003eI am trying for chat application in xamarin.forms using pubnub,i successfully did sending and retrieving messages,but the problem is when i closes the app and reopen is iam not getting previous messages.\u003c/p\u003e\n\n\u003cpre class=\"lang-c# prettyprint-override\"\u003e\u003ccode\u003e {\n PNConfiguration config = new PNConfiguration();\n // never share your keys in public, especially pub-key\n config.PublishKey = \"pub-c-6de-redacted\";\n config.SubscribeKey = \"sub-c-85f-redacted\";\n config.Uuid = username;\n\n config.LogVerbosity = PNLogVerbosity.BODY;\n config.PubnubLog = new Logger();\n _pubnub = new Pubnub(config);\n\n _pubnub.AddListener(this);\n\n _pubnub.Subscribe\u0026lt;string\u0026gt;()\n .Channels(new string[] { \"my_channel1\" })\n .WithPresence()\n .Execute();\n _pubnub.HereNow()\n .Channels(new string[]\n {\n \"my_channel1\"\n })\n .IncludeUUIDs(true)\n .Async(new HereNowResult());\n\n _pubnub.History()\n .Channel(\"my_channel1\")\n .IncludeTimetoken(true)\n .Count(100)\n .Async(new DemoHistoryResult());\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand my publish method is:\u003c/p\u003e\n\n\u003cpre class=\"lang-c# prettyprint-override\"\u003e\u003ccode\u003epublic void PublishMessage(string text,string selectednametoChat)\n {\n _pubnub.Publish()\n .Channel(\"my_channel1\")\n .ShouldStore(true)\n .Message(text)\n .UsePOST(true)\n .Async(new PubnubResult());\n\n }`\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is method to store previous messages\n[I think you mean \u003cstrong\u003eretrieve previous messages\u003c/strong\u003e]\u003c/p\u003e\n\n\u003cpre class=\"lang-c# prettyprint-override\"\u003e\u003ccode\u003e public class DemoHistoryResult : PNCallback\u0026lt;PNHistoryResult\u0026gt;\n{\n public static ChatWindowViewModel ChatWindowViewModel { get; set; }\n\n public override void OnResponse(PNHistoryResult result, PNStatus status)\n {\n try\n {\n if (result.Messages != null \u0026amp;\u0026amp; result.Messages.Count \u0026gt; 0)\n {\n foreach (var message in result.Messages)\n {\n ChatWindowViewModel.MessagesList.Add(message.Entry.ToString());\n }\n }\n }\n catch (Exception ex)\n {\n\n }\n\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ehow to get the history to the \u003ccode\u003eMessagesList\u003c/code\u003e.\u003c/p\u003e","answer_count":"0","comment_count":"10","creation_date":"2017-09-15 06:04:13.807 UTC","last_activity_date":"2017-09-16 21:35:26.833 UTC","last_edit_date":"2017-09-16 21:35:26.833 UTC","last_editor_display_name":"","last_editor_user_id":"1342232","owner_display_name":"","owner_user_id":"8293619","post_type_id":"1","score":"0","tags":"xamarin|xamarin.forms|pubnub","view_count":"61"} +{"id":"20686274","title":"AreEqual comparing objects with ToString","body":"\u003cp\u003eI'm using Assert.AreEqual to compare two objects. The objects are two different instances of the same class and there is a ToString method in that class. When I call AreEqual I can see from the debugger that the ToString method gets called (once for each of the two variables).\u003c/p\u003e\n\n\u003cp\u003eThe ToString method returns \u003cem\u003eexactly\u003c/em\u003e the same string in each case but still for some reason the AreEqual method returns false.\u003c/p\u003e\n\n\u003cp\u003eWhy might this be?\u003c/p\u003e\n\n\u003cp\u003eThe error is\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eAdditional information: Expected: \u0026lt;DeliveryTag: 0, RoutingKey: , Body: test, Headers: test: test, ContentType: text/plain\u0026gt;\n\n But was: \u0026lt;DeliveryTag: 0, RoutingKey: , Body: test, Headers: test: test, ContentType: text/plain\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"20686349","answer_count":"1","comment_count":"0","creation_date":"2013-12-19 16:04:15.723 UTC","last_activity_date":"2013-12-19 16:07:50.74 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"991788","post_type_id":"1","score":"2","tags":"nunit|assertions","view_count":"253"} +{"id":"9770869","title":"WebMaping using Flex 3 (GeoServer, PostgreSQL, PostGIS, php)","body":"\u003cp\u003eAny idea of WebMaping (Displaying a GeoSpatial Map) using flex 3. \nI have few vector layers and also a raster layer, and i had already build a Geodatabase using PostGIS. I am using GeoServer as map engine.\n If any one have idea please reply me.\u003c/p\u003e\n\n\u003cp\u003eThans in advance..\u003e\u003e\u003e\u003c/p\u003e","accepted_answer_id":"9832580","answer_count":"1","comment_count":"0","creation_date":"2012-03-19 13:15:23.473 UTC","last_activity_date":"2012-03-23 00:32:16.217 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1278504","post_type_id":"1","score":"0","tags":"php|postgresql|flex3|postgis|geoserver","view_count":"921"} +{"id":"29542107","title":"Pass List of Checkboxes into View and Pull out IENumerable","body":"\u003cp\u003eI have a list of items that will be associated to a user. It's a one-to-many relationship. I want the entire list of items passed into the view so that they can choose from ones that are not associated to them yet (and also see those that are already associated). I want to create checkboxes from these. I then want to send the selected ones back into the controller to be associated. How can I pass in the list of all of them, including those that aren't yet associated, and reliably pass them back in to be associated?\u003c/p\u003e\n\n\u003cp\u003eHere's what I tried first, but it's clear this won't work as I'm basing the inputs off the items passed in via the \u003ccode\u003eAllItems\u003c/code\u003e collection, which has no connection to the Items on the user itself.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div id=\"item-list\"\u0026gt;\n @foreach (var item in Model.AllItems)\n {\n \u0026lt;div class=\"ui field\"\u0026gt;\n \u0026lt;div class=\"ui toggle checkbox\"\u0026gt;\n \u0026lt;input type=\"checkbox\" id=\"item-@item.ItemID\" name=\"Items\" value=\"@item.Active\" /\u0026gt;\n \u0026lt;label for=\"item-@item.ItemID\"\u0026gt;@item.ItemName\u0026lt;/label\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n }\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"29554416","answer_count":"2","comment_count":"0","creation_date":"2015-04-09 15:01:43.843 UTC","favorite_count":"3","last_activity_date":"2015-04-10 06:02:44.057 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"386869","post_type_id":"1","score":"5","tags":"c#|asp.net-mvc|razor|asp.net-mvc-5","view_count":"4261"} +{"id":"34139348","title":"Program to reverse an inputted chain of characters","body":"\u003cp\u003eI need to make a program that lets the user enter a string character by character and then print it in reverse. \u003ckbd\u003espace\u003c/kbd\u003e means end of input (\u003ckbd\u003espace\u003c/kbd\u003e should be entered by user.)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esection .bss\nc : resb 1\nsection .text\nglobal _start\n_start :\nmov ecx, 0\nmov edx, 0\nsaisie :\n push ecx \n push edx\n mov eax,3\n mov ebx,0\n mov ecx,c\n mov edx,1\n int 80h\n mov ecx,[c] ; put the entered value in ecx\n cmp ecx,32 ; compare ecx with space.\n je espace ;\n pop edx \n inc edx\n pop ecx\n jmp saisie\nespace :\n pop edx\n cmp edx,0 ; if counter is 0 we exit if not we print what's in stack.\n je fin\n mov eax,4\n mov ebx,1\n pop ecx\n int 80h \n dec edx\n jmp espace\nfin :\nmov eax, 1\nmov ebx, 0\nint 80h\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I enter characters and \u003ckbd\u003espace\u003c/kbd\u003e at the end, the program just exits without error like it has done its job.\u003c/p\u003e\n\n\u003cp\u003eCan anyone explain this behavior and how I can correct it?\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2015-12-07 17:15:48.727 UTC","last_activity_date":"2015-12-07 17:23:00.957 UTC","last_edit_date":"2015-12-07 17:23:00.957 UTC","last_editor_display_name":"","last_editor_user_id":"3857942","owner_display_name":"","owner_user_id":"5650995","post_type_id":"1","score":"0","tags":"linux|assembly|x86|nasm|reverse","view_count":"59"} +{"id":"27340205","title":"Static initializer in Python","body":"\u003cp\u003eMy question is similar to \u003ca href=\"https://stackoverflow.com/questions/7396092/is-there-a-static-constructor-or-static-initializer-in-python\"\u003eIs there a static constructor or static initializer in Python?\u003c/a\u003e. However I still don't quite follow how to implement a static constructor as I would in Java:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class TestBuilder {\n private String uid;\n private String name;\n private double speed;\n\n public static final TestBuilder SLEEPY;\n public static final TestBuilder SPEEDY;\n\n static {\n SLEEPY = new TestBuilder(\"1\", \"slow test\", 500.00);\n SPEEDY = new TestBuilder(\"2\", \"fast test\", 2000.00);\n }\n\n private TestBuilder(String uid, String name, double speed){\n this.uid = uid;\n this.name = name;\n this.speed = speed;\n }\n\n public double getSpeed(){\n return speed;\n }\n\n public String getUid() {\n return uid;\n }\n\n public String getName() {\n return name;\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn java from another class I could then call TestBuilder.SLEEPY to access a populated class.\u003c/p\u003e\n\n\u003cp\u003eIn python I have tried:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass TestBuilder:\n uid = str()\n name = str()\n speed = float()\n\n def __init__(self, uid, name, speed):\n self.uid = uid\n self.name = name\n self.speed = speed\n\n def lookupByName(self, name):\n result = None\n members = [attr for attr in dir(TestBuilder()) if not callable(attr) and not attr.startswith(\"__\")]\n for testbuilder in members:\n if testbuilder.name == name:\n result = testbuilder.uid\n break \n return result\n\nTestBuilder.SLEEPY = TestBuilder(\"1\",\"slow test\", 500.0)\nTestBuilder.SPEEDY = TestBuilder(\"2\",\"fast test\", 2000.0)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThen in another module I tried:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efrom examples.testbuilder import TestBuilder\nimport unittest\n\nclass Tester(unittest.TestCase):\n\n def test_builder(self):\n dummy = TestBuilder\n ref = dummy.SPEEDY\n sleepyid = dummy.lookupByName(\"slow test\")\n self.assertTrue(dummy.SPEEDY.__str__() == ref.__str__())\n self.assertEqual(1, sleepyid)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever I get a \"TypeError: lookupByName() missing 1 required positional argument: 'name'\" on the dummy.lookupByName(\"slow test\") call and am not sure why.\nDoes this look like a 'pythonic' way to generate similar functionality to a Java static initializer? Are there alternatives?\u003c/p\u003e","accepted_answer_id":"27340349","answer_count":"1","comment_count":"0","creation_date":"2014-12-07 06:17:33.98 UTC","last_activity_date":"2014-12-07 06:45:08.627 UTC","last_edit_date":"2017-05-23 12:09:15.117 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"2295516","post_type_id":"1","score":"0","tags":"java|python","view_count":"529"} +{"id":"5344365","title":"Php - XML Schema version","body":"\u003cp\u003eI'm searching for a while for what version xsd support php (5.3.0) has, but I haven't found anything. :S I'm trying to use xsd:assert in a schema with php, but I haven't managed it yet. Can anybody help me?\u003c/p\u003e","accepted_answer_id":"5345207","answer_count":"1","comment_count":"0","creation_date":"2011-03-17 19:46:45.56 UTC","last_activity_date":"2011-03-17 21:02:32.717 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"607033","post_type_id":"1","score":"1","tags":"php|xml|schema","view_count":"198"} +{"id":"7805501","title":"Selenium error: UnicodeEncodeError","body":"\u003cp\u003eI am getting the following error when i execute the following command:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etext = idobi Radio: New. Music. Unfiltered. idobi.com - a SHOUTcast.com member station \nself.se.is_element_present(\"css=a[href]:contains('idobi Radio: New. Music. Unfiltered. idobi.com - a SHOUTcast.com member station')\")\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe title I am searching for on the website, is as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eidobi Radio: New. Music. Unfiltered. idobi.com - a SHOUTcast.com member station\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe whole error i get is :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e UnicodeEncodeError: 'ascii' codec can't encode character u'\\u2026' in position 91: ordinal not in range(128)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ecould someone please help me with this issue?\u003c/p\u003e\n\n\u003cp\u003ethanks.\u003c/p\u003e","accepted_answer_id":"7808609","answer_count":"1","comment_count":"3","creation_date":"2011-10-18 10:04:28.31 UTC","last_activity_date":"2011-10-18 14:10:39.87 UTC","last_edit_date":"2011-10-18 10:05:52.023 UTC","last_editor_display_name":"","last_editor_user_id":"189179","owner_display_name":"","owner_user_id":"966739","post_type_id":"1","score":"0","tags":"python|css|selenium|selenium-rc","view_count":"327"} +{"id":"9203339","title":"Double Buffering in F#: what is the deal with the flicker?","body":"\u003cp\u003eI am trying to implement double buffering in F#. All of the examples I am running into are C#. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e let r = form.DisplayRectangle\n let buffer = new Bitmap(r.Width,r.Height)\n form.DrawToBitmap(buffer,r)\n form.BackgroundImage \u0026lt;-buffer\n form.Invalidate() \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAlthough the problem is an \"easy\" fix, the private variables are not exposed in F#. Instead, I have to initialize the form in C#. There must be a way though (it seems like this is a trivial thing) to expose the private variables for the form in F#. \u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2012-02-08 23:43:13.49 UTC","last_activity_date":"2013-04-17 15:03:48.31 UTC","last_edit_date":"2013-04-17 15:03:48.31 UTC","last_editor_display_name":"","last_editor_user_id":"1159263","owner_display_name":"","owner_user_id":"1159263","post_type_id":"1","score":"3","tags":"winforms|f#","view_count":"350"} +{"id":"32931357","title":"Parse request.object.existed() return false","body":"\u003cp\u003eI have problem with parse. I wrote cloud code \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eParse.Cloud.afterSave(Parse.User, function(request) {\n var user = request.object;\n if( !user.existed() ) {\n //all the times !user.existed() is true when I save user object\n //also in signup is true\n }\n\n})\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ehow can I make the inside if block run only if the user is new user?\u003c/p\u003e","accepted_answer_id":"33289806","answer_count":"1","comment_count":"3","creation_date":"2015-10-04 08:07:02.227 UTC","favorite_count":"1","last_activity_date":"2015-12-04 15:44:40.263 UTC","last_edit_date":"2015-12-04 15:44:40.263 UTC","last_editor_display_name":"","last_editor_user_id":"1875965","owner_display_name":"user5303752","post_type_id":"1","score":"5","tags":"javascript|parse.com","view_count":"751"} +{"id":"42280788","title":"C# (or any language) DDD - Where to sanitize user input data?","body":"\u003cp\u003eI'm building a DDD app in C# and I have some doubts about where I should sanitize user input.\u003c/p\u003e\n\n\u003cp\u003eI already learned that business rules should be validated in domain layer and ID identities should be generated at repository layer.\u003c/p\u003e\n\n\u003cp\u003eShould I put this user input sanitizer on the application layer?\u003c/p\u003e\n\n\u003cp\u003e(The app it's a ASP.NET MVC with DDD architecture model).\u003c/p\u003e","accepted_answer_id":"42281388","answer_count":"1","comment_count":"2","creation_date":"2017-02-16 17:24:26.66 UTC","last_activity_date":"2017-02-16 17:56:59.09 UTC","last_edit_date":"2017-02-16 17:53:40.647 UTC","last_editor_display_name":"","last_editor_user_id":"1981088","owner_display_name":"","owner_user_id":"7475657","post_type_id":"1","score":"1","tags":"c#|domain-driven-design","view_count":"65"} +{"id":"30061282","title":"100vh Doesn't seem to be working","body":"\u003cp\u003eI am trying to achieve a 100% height \u0026amp; width header image on my website, and I have been researching different ways to do this, and I came across the \"100vh\" method, however it only displays at 50% the width of my browser and 100% the height.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://gyazo.com/07e4861fa3300c22ce7bafc265b15421\" rel=\"nofollow\"\u003ehttp://gyazo.com/07e4861fa3300c22ce7bafc265b15421\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cdiv class=\"snippet\" data-lang=\"js\" data-hide=\"false\"\u003e\r\n\u003cdiv class=\"snippet-code\"\u003e\r\n\u003cpre class=\"snippet-code-css lang-css prettyprint-override\"\u003e\u003ccode\u003e.headercontainer{\r\n background: #000;\r\n width: 100vh;\r\n height: 100vh;\r\n}\u003c/code\u003e\u003c/pre\u003e\r\n\u003cpre class=\"snippet-code-html lang-html prettyprint-override\"\u003e\u003ccode\u003e\u0026lt;div class=\"headercontainer\"\u0026gt;\r\n\u0026lt;/div\u0026gt;\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003c/p\u003e\n\n\u003cp\u003eI've also tried 200vh and that is too wide.\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2015-05-05 19:09:10.88 UTC","favorite_count":"0","last_activity_date":"2015-05-05 22:37:34.147 UTC","last_edit_date":"2015-05-05 19:10:22.813 UTC","last_editor_display_name":"","last_editor_user_id":"4847927","owner_display_name":"","owner_user_id":"4847927","post_type_id":"1","score":"0","tags":"html|css","view_count":"1439"} +{"id":"28772765","title":"What's the best way to authorize a back-end sever to use the google drive api?","body":"\u003cp\u003eI'm working on a an application where my back-end server will push and pull data over the google drive sdk. So, the back-end will only ever need a authorization via a single admin user's set of credentials.\u003c/p\u003e\n\n\u003cp\u003eIs the best way to do the authorization for this use-case to do what's described here?\n\u003ca href=\"https://developers.google.com/drive/web/auth/web-server\" rel=\"nofollow\"\u003ehttps://developers.google.com/drive/web/auth/web-server\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eIt looks like I would manually authorize my back-end's user once and store the refresh token for later offline access, thereby not needing manual/human interaction ever again. \u003c/p\u003e\n\n\u003cp\u003eBut is that actually the best way for this use case? Is there another authorization workflow that I've overlooked?\u003c/p\u003e","accepted_answer_id":"28777965","answer_count":"2","comment_count":"0","creation_date":"2015-02-27 19:25:32.143 UTC","last_activity_date":"2015-03-11 23:13:27.597 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1572313","post_type_id":"1","score":"1","tags":"google-drive-sdk","view_count":"77"} +{"id":"24283341","title":"jquery form validation in popup window","body":"\u003cp\u003eI am developing one application which is in codeigniter with smarty template and in that html pages are ready I have to just develop that pages. In that application there is one page which is open in like lightbox as a form and I want to put jquery validation in that I have trying with \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;script\u0026gt;\n $(document).ready(function(){\n $(\"#frm_email\").validate({ \n rules: {\n email: {\n required: true,\n email : true\n }\n },\n messages: {\n email: {\n required: \"Email is required.\",\n email : \"Enter valid email.\"\n }\n },\n // the errorPlacement has to take the table layout into account\n errorPlacement: function(error, element) {\n if ( $(element).is(\":radio\") ){\n $(error).insertAfter( $(element).parent() );\n } else if ( $(element).is(\":checkbox\") ){ \n $(error).insertAfter( $(element).next() );\n } else{\n if($(element).is(\"textarea\")){\n $(error).insertAfter($(element).next());\n } else {\n $(error).insertAfter( $(element) );\n }\n } \n },\n success: function(label ) {\n $(label).remove(); \n },\n onkeyup: function(element) { $(element).valid(); },\n onfocusout: function(element) { $(element).valid(); }\n });\n });\n });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003c/p\u003e\n\n\u003cp\u003ethis code but its not working and I want form validation before form submit.\u003c/p\u003e\n\n\u003cp\u003eSo please help me.\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2014-06-18 10:34:48.897 UTC","last_activity_date":"2014-06-19 04:19:41.797 UTC","last_edit_date":"2014-06-19 04:19:41.797 UTC","last_editor_display_name":"","last_editor_user_id":"3414506","owner_display_name":"","owner_user_id":"3414506","post_type_id":"1","score":"0","tags":"php|jquery|codeigniter","view_count":"321"} +{"id":"39098464","title":"How to login as super user and execute the script","body":"\u003cp\u003eI have a script something like below:\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eName of script : create_and_set_quota_alternative.sh\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#!/bin/bash\n\n\n\nwhile IFS=$'\\t' read -r -a myOptions\n\ndo\n\n echo \"directory: ${myOptions[0]}\"\n\n echo \"ownership: ${myOptions[1]}\"\n\n echo \"permissions: ${myOptions[2]}\"\n\n echo \"quota: ${myOptions[3]}\"\n\n\n hdfs dfs -mkdir ${myOptions[0]}\n\n hdfs dfs -chown ${myOptions[1]} ${myOptions[0]}\n\n hdfs dfs -chmod ${myOptions[2]} ${myOptions[0]}\n\n hdfs dfsadmin -setSpaceQuota ${myOptions[3]} ${myOptions[0]}\n\ndone \u0026lt; myFile.txt\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003emyFile.txt\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e/usr/t1 hive:hive 776 1T\n\n/usr/t2 hdfs:hdfs 775 100G\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow I want login as super user and execute the script.\nIn my case super user is hdfs.\nI want whenever I run the command \u003ccode\u003esh create_and_set_quota_alternative.sh\u003c/code\u003e then it will login as super user that is hdfs and execute the script.\nPlease suggest how to implement it.\u003c/p\u003e","answer_count":"3","comment_count":"1","creation_date":"2016-08-23 10:20:13.737 UTC","last_activity_date":"2016-08-24 04:42:15.377 UTC","last_edit_date":"2016-08-23 10:54:44.147 UTC","last_editor_display_name":"","last_editor_user_id":"5306152","owner_display_name":"","owner_user_id":"6730609","post_type_id":"1","score":"0","tags":"linux|bash|shell|hadoop|hdfs","view_count":"77"} +{"id":"43261589","title":"gtk+ without msys2 mingw","body":"\u003cp\u003eOn Windows, trying something with gtk+. I have downloaded Msys2, along with gtk+3.0.\u003c/p\u003e\n\n\u003cp\u003eSuccessfully compiled all the gtk+3.0 examples in the msys2 mingw-w64 terminal.\u003c/p\u003e\n\n\u003cp\u003eNow I want to move a bit further to try work without the msys environment.\u003c/p\u003e\n\n\u003cp\u003eI opened up cmd and navigated to where the example executables are compiled. Then I fired them up by typing \"example.exe\".\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003elibgio-2.0-0.dll missing\u003c/code\u003e, not surprised. I go back to check the PATH environment of the msys environment, \u003ccode\u003ePATH=/mingw64/bin/:/usr/local/bin:/usr/bin/:/bin:/c/Windows/System32:..blablabla\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eSo in the cmd environment I did \u003ccode\u003eset PATH=%PATH%;pathto/mingw64/bin;\u003c/code\u003e and run example.exe again.\u003c/p\u003e\n\n\u003cp\u003eThis time it gave a very strange error \u003ccode\u003ecannot find entrypoint inflateValidate (in dll libpng16-16.dll)\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eSo I checked, indeed there was no inflateValidate function in the dll. it seemed to me that something thought the function is in the dll and tried to call it but because it doesn't exist so it failed. What I don't understand is that why did it not fail in the msys environment but failed in the windows environment. And does that bring any impact to me if I am going to ship any gtk application? I thought simply distributing the relevant dll would be enough.\u003c/p\u003e\n\n\u003cp\u003eI have tried instead of adding the \u003ccode\u003emingw64/bin\u003c/code\u003e path to the PATH variable, but copying the required dll the the execute location 1 by 1, but at the end it still gave the same error.\u003c/p\u003e\n\n\u003cp\u003eI have also tried to search for other libpng*.dll in my computer, none of them contained the \u003ccode\u003einflateValidate\u003c/code\u003e function.\u003c/p\u003e\n\n\u003cp\u003eIf anyone know whats going on please shed some light to the question.\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2017-04-06 17:05:25.78 UTC","last_activity_date":"2017-04-06 17:05:25.78 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5416725","post_type_id":"1","score":"0","tags":"gtk|libpng","view_count":"225"} +{"id":"43505625","title":"How can I duplicate Sass color functions in Sketch.app?","body":"\u003cp\u003eIs there a way to use the equivalent of Sass color functions, like lighten and darken, to create color swatches in Sketch.app?\u003c/p\u003e\n\n\u003cp\u003eFor example, original color #02284B\u003c/p\u003e\n\n\u003cp\u003ewith Sass, I can use \u003ccode\u003edarken(#02284B, 2%);\u003c/code\u003e which will render as #022341\u003c/p\u003e\n\n\u003cp\u003eIs there an extension or technique for translating Sass color functions to the Sketch color settings?\u003c/p\u003e","accepted_answer_id":"43528448","answer_count":"1","comment_count":"0","creation_date":"2017-04-19 20:38:34.277 UTC","last_activity_date":"2017-04-20 19:38:54.413 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1949578","post_type_id":"1","score":"0","tags":"sass|hsl|sketch-3|hsb","view_count":"160"} +{"id":"31420154","title":"Runtime error: load of value 127, which is not a valid value for type 'bool'","body":"\u003cp\u003eI'm using g++ 4.9.2 on Debian 8, x86_64. I'm catching a Undefined Behavior sanitizer (UBsan) (\u003ccode\u003e-fsanitize=undefined\u003c/code\u003e) error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ealgebra.cpp:206:8: runtime error: load of value 127,\n which is not a valid value for type 'bool'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe code is from the Crypto++ library. Here is the code at \u003ccode\u003ealgebra.cpp:206\u003c/code\u003e (and some related code):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e206 struct WindowSlider\n207 {\n208 WindowSlider(const Integer \u0026amp;expIn, bool fastNegate, unsigned int windowSizeIn=0)\n209 : m_exp(expIn), m_windowModulus(Integer::One()), m_windowSize(windowSizeIn), m_windowBegin(0), m_fastNegate(fastNegate), m_firstTime(true), m_finished(false)\n210 {\n ...\n249 Integer m_exp, m_windowModulus;\n250 unsigned int m_windowSize, m_windowBegin;\n251 word32 m_expWindow;\n252 bool m_fastNegate, m_negateNext, m_firstTime, m_finished;\n253 };\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIts called in a couple of places, like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$ grep -I WindowSlider *\n...\nalgebra.cpp: std::vector\u0026lt;WindowSlider\u0026gt; exponents;\nalgebra.cpp: exponents.push_back(WindowSlider(*expBegin++, InversionIsFast(), 0));\necp.cpp: std::vector\u0026lt;WindowSlider\u0026gt; exponents;\necp.cpp: exponents.push_back(WindowSlider(*expBegin++, InversionIsFast(), 5));\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003ccode\u003eInversionIsFast\u003c/code\u003e is a \u003ccode\u003ebool\u003c/code\u003e, so that should not be a problem. But I added \u003ccode\u003e!!InversionIsFast()\u003c/code\u003e just in case and the issue persists.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT\u003c/strong\u003e: Here is a grep for \u003ccode\u003eInversionIsFast\u003c/code\u003e. It appears it is initialized.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$ grep -I InversionIsFast *\nalgebra.cpp: exponents.push_back(WindowSlider(*expBegin++, !!InversionIsFast(), 0));\nalgebra.h: virtual bool InversionIsFast() const {return false;}\nec2n.h: bool InversionIsFast() const {return true;}\necp.cpp: exponents.push_back(WindowSlider(*expBegin++, !!InversionIsFast(), 5));\necp.h: bool InversionIsFast() const {return true;}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI also initialized \u003ccode\u003em_negateNext\u003c/code\u003e in the ctor.\u003c/p\u003e\n\n\u003cp\u003eWhat is the issue, and how do I clear it?\u003c/p\u003e","accepted_answer_id":"31442722","answer_count":"1","comment_count":"6","creation_date":"2015-07-15 01:46:07.117 UTC","last_activity_date":"2015-07-16 12:52:59.293 UTC","last_edit_date":"2015-07-15 03:50:04.63 UTC","last_editor_display_name":"","last_editor_user_id":"608639","owner_display_name":"","owner_user_id":"608639","post_type_id":"1","score":"2","tags":"c++|g++|ubsan","view_count":"800"} +{"id":"21069164","title":"OSX Vim :set laststatus=2 shows only the filename -- but I want to see everything that Ctrl-g provides","body":"\u003cp\u003eLike the title says -- and my google fu fails me as \u003ccode\u003e:set laststatus=2\u003c/code\u003e shows only the filename, I'd like to see everything cntrl-g provides.\u003c/p\u003e\n\n\u003cp\u003eexample:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;relative filename\u0026gt; line 28 of 285 --9%-- col 5\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ePretty sure I remember pulling this off with a basic :set command a decade ago, any idea what's going on? Again, all I'm seeing with \u003ccode\u003e:set laststatus=2\u003c/code\u003e is the filename.\u003c/p\u003e\n\n\u003cp\u003ebar@baz:~/foo$ vim --version\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eVIM - Vi IMproved 7.3 (2010 Aug 15, compiled Oct 23 2012 13:50:52)\nCompiled by root@apple.com\nNormal version without GUI. Features included (+) or not (-):\n-arabic +autocmd -balloon_eval -browse +builtin_terms +byte_offset +cindent \n-clientserver -clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments \n-conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con +diff +digraphs \n-dnd -ebcdic -emacs_tags +eval +ex_extra +extra_search -farsi +file_in_path \n+find_in_path +float +folding -footer +fork() -gettext -hangul_input +iconv \n+insert_expand +jumplist -keymap -langmap +libcall +linebreak +lispindent \n+listcmds +localmap -lua +menu +mksession +modify_fname +mouse -mouseshape \n-mouse_dec -mouse_gpm -mouse_jsbterm -mouse_netterm -mouse_sysmouse \n+mouse_xterm +multi_byte +multi_lang -mzscheme +netbeans_intg -osfiletype \n+path_extra -perl +persistent_undo +postscript +printer -profile +python/dyn \n-python3 +quickfix +reltime -rightleft +ruby/dyn +scrollbind +signs \n+smartindent -sniff +startuptime +statusline -sun_workshop +syntax +tag_binary \n+tag_old_static -tag_any_white -tcl +terminfo +termresponse +textobjects +title\n -toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo \n+vreplace +wildignore +wildmenu +windows +writebackup -X11 -xfontset -xim -xsmp\n -xterm_clipboard -xterm_save \n system vimrc file: \"$VIM/vimrc\"\n user vimrc file: \"$HOME/.vimrc\"\n user exrc file: \"$HOME/.exrc\"\n fall-back for $VIM: \"/usr/share/vim\"\nCompilation: gcc -c -I. -D_FORTIFY_SOURCE=0 -Iproto -DHAVE_CONFIG_H -arch i386 -arch x86_64 -g -Os -pipe\nLinking: gcc -arch i386 -arch x86_64 -o vim -lncurses\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"21072521","answer_count":"2","comment_count":"1","creation_date":"2014-01-11 23:18:34.133 UTC","last_activity_date":"2014-01-12 07:55:32.687 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3102967","post_type_id":"1","score":"0","tags":"osx|vim","view_count":"2122"} +{"id":"35914118","title":"Trigger an event when scroll to specific element and then stop it with jquery","body":"\u003cblockquote\u003e\n \u003cp\u003e\u003cstrong\u003eFirst Step\u003c/strong\u003e\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI want to make a counter that when user load my page the counter starts from 0 and end on its end value (e.g. 75). So I search from net and found a \u003ccode\u003ejQuery\u003c/code\u003e code and i copy that code and paste it in my js file \u003ccode\u003ecustom.js\u003c/code\u003e and made some changes as per required. Its working perfectly.\u003c/p\u003e\n\n\u003cp\u003eHere is my code:\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eHTML\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"top_div\"\u0026gt;\n Top Div\n\u0026lt;/div\u0026gt;\n\u0026lt;div class=\"love_count\"\u0026gt;75%\u0026lt;/div\u0026gt;\n\u0026lt;div class=\"love_count\"\u0026gt;30%\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eJS\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ejQuery(document).ready(function ($) {\nfunction count($this){\n var current = parseInt($this.html(), 10);\n $this.html(++current + '%');\n if(current !== $this.data('count')){\n setTimeout(function(){count($this)}, 15);\n }\n}\n\n$(\".love_count\").each(function() {\n $(this).data('count', parseInt($(this).html(), 10));\n $(this).html('0');\n count($(this));\n});\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003ca href=\"https://jsfiddle.net/deemi/qox6u9sn/\" rel=\"nofollow\"\u003e\u003cstrong\u003eDemo\u003c/strong\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e\u003cstrong\u003eSecond Step\u003c/strong\u003e\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eNow my clients want that when user scroll down to this specific div then the counter starts. So I again Search from net and found some other codes. But its not working.\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003e\u003cstrong\u003eFirst\u003c/strong\u003e When I scroll down to that specific div the counter first show me my end value (e.g. 75)\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eSecond\u003c/strong\u003e Then its starts from 0 and the counter never stops. Its goes to thousands, millions but never stops.\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eHere is my code:\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eHTML\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"top_div\"\u0026gt;\n Top Div\n\u0026lt;/div\u0026gt;\n\u0026lt;div class=\"love_counter\"\u0026gt;\n \u0026lt;div class=\"love_count\"\u0026gt;75%\u0026lt;/div\u0026gt;\n \u0026lt;div class=\"love_count\"\u0026gt;30%\u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eJS\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(window).scroll(function() {\n var hT = $('.love_counter').offset().top,\n hH = $('.love_counter').outerHeight(),\n wH = $(window).height(),\n wS = $(this).scrollTop();\n if (wS \u0026gt; (hT+hH-wH)){\n function count($this){\n var current = parseInt($this.html(), 10);\n $this.html(++current + '%');\n if(current !== $this.data('count')){\n setTimeout(function(){count($this)}, 15);\n }\n }\n\n $(\".love_count\").each(function() {\n $(this).data('count', parseInt($(this).html(), 10));\n $(this).html('0');\n count($(this));\n });\n }\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003e\u003ca href=\"https://jsfiddle.net/deemi/5gxw16kd/\" rel=\"nofollow\"\u003eDemo\u003c/a\u003e\u003c/strong\u003e\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e\u003cstrong\u003eWhat I want\u003c/strong\u003e\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eSo I want that When site scrolls down to that specific div, the counter starts from 0 and stop on its end value. \u003cstrong\u003eBut\u003c/strong\u003e when I scroll up or down the counter should not be start again and still stop there end value.\u003c/p\u003e\n\n\u003cp\u003eBut when user refresh the page and scroll down to that specific div the counter starts as usual and stop to there end value and not starts again when I scroll up or down.\u003c/p\u003e\n\n\u003cp\u003eI am very weak in jQuery so please help me out and guide me. I hope you understand my question.\u003c/p\u003e","accepted_answer_id":"35915692","answer_count":"3","comment_count":"0","creation_date":"2016-03-10 10:41:08.917 UTC","favorite_count":"1","last_activity_date":"2016-03-10 12:46:41.853 UTC","last_edit_date":"2016-03-10 10:47:57.7 UTC","last_editor_display_name":"","last_editor_user_id":"1181435","owner_display_name":"","owner_user_id":"2575541","post_type_id":"1","score":"3","tags":"javascript|jquery|html|css","view_count":"1472"} +{"id":"33890023","title":"Invalid WatchKit Support - The WatchKitSupport folder is missing","body":"\u003cp\u003eWe are trying to update an existing app which supports WatchKit for iOS 9.1.\nAfter archiving the build in Xcode 7.1.1 and sending it through Application Loader, we get the e-mail stating:\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eInvalid WatchKit Support - The WatchKitSupport folder is missing. Rebuild your app using the current public (GM) version of Xcode and resubmit it.\u003c/strong\u003e \u003c/p\u003e\n\n\u003cp\u003eNow we are already using the latest GM version of Xcode. Is there some build setting that needs to be done to sort this issue? Or is there some other solution?\u003c/p\u003e\n\n\u003cp\u003eAny help will be greatly appreciated...thanks!\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2015-11-24 09:36:58.957 UTC","last_activity_date":"2015-11-24 09:36:58.957 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2442902","post_type_id":"1","score":"1","tags":"ios|xcode|build|watchkit","view_count":"369"} +{"id":"12915135","title":"How to read the Output Type in code","body":"\u003cp\u003eA common nuisance we have is having to switch this code below depending on whether we are testing locally or committing code for the build server.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e /// \u0026lt;summary\u0026gt;\n /// Main entry point to the application.\n /// \u0026lt;/summary\u0026gt;\n public static void Main()\n {\n // Don't forget to uncomment this if committing (!)\n //var servicesToRun = new ServiceBase[] {new myservice()};\n //ServiceBase.Run(servicesToRun);\n\n // and re-comment this\n RunAsConsoleApp();\n\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt would be really useful if there was a way to test in the code to tell the output type i.e, and avoid all the 'oh-no I committed and broke the build' time wasting.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e if (IsConsoleApp)\n {\n Using(var host= new ServiceHost(typeof(myservice))\n {\n host.Open();\n etc....\n }\n }\n else\n {\n var servicesToRun = new ServiceBase[] {new myservice()};\n ServiceBase.Run(servicesToRun);\n }\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"12915198","answer_count":"4","comment_count":"1","creation_date":"2012-10-16 12:50:48.173 UTC","last_activity_date":"2017-02-17 12:48:31.23 UTC","last_edit_date":"2012-10-16 14:35:54.297 UTC","last_editor_display_name":"","last_editor_user_id":"831108","owner_display_name":"","owner_user_id":"831108","post_type_id":"1","score":"2","tags":"c#|continuous-integration","view_count":"453"} +{"id":"34722247","title":"Responding to concurrent requests with Flask and eventlet","body":"\u003cp\u003eI try to set up a minimal Flask application that uses \u003ca href=\"http://eventlet.net/\" rel=\"noreferrer\"\u003eeventlet\u003c/a\u003e to respond to concurrent requests instantly instead of blocking and responding to one request after the other (as the standard Flask debugging webserver does).\u003c/p\u003e\n\n\u003cp\u003ePrerequisites:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epip install Flask\npip install eventlet\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFrom my understanding by what I found so far on the internet, it should work like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e# activate eventlet\nimport eventlet\neventlet.monkey_patch()\n\nfrom flask import Flask\n\nimport datetime\nfrom time import sleep\n\n# create a new Flask application\napp = Flask(__name__)\n\n# a short running task that returns immediately\n@app.route('/shortTask')\ndef short_running_task():\n start = datetime.datetime.now()\n return 'Started at {0}, returned at {1}'.format(start, datetime.datetime.now())\n\n# a long running tasks that returns after 30s\n@app.route('/longTask')\ndef long_running_task():\n start = datetime.datetime.now()\n sleep(30)\n return 'Started at {0}, returned at {1}'.format(start, datetime.datetime.now())\n\n# run the webserver\nif __name__ == '__main__':\n app.run(debug=True)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen running this file, then opening \u003ccode\u003ehttp://localhost:5000/longTask\u003c/code\u003e in a webbrowser tab and while it is still processing opening another tab with \u003ccode\u003ehttp://localhost:5000/shortTask\u003c/code\u003e, I would expect the second tab to return immediately while the first tab is still loading. However, similar to when running this on the standard Werkzeug server, the second tab only returns just after the first one is finished after 30s.\u003c/p\u003e\n\n\u003cp\u003eWhat is wrong here?\nBy the way, would this be what is commonly referred to as a \"production ready webserver\" for Flask, given that there are only few concurrent users to be expected (5 at most)?\u003c/p\u003e\n\n\u003cp\u003eBy the way, when I use \u003ca href=\"http://flask-socketio.readthedocs.org/en/latest/\" rel=\"noreferrer\"\u003ethe Flask-socketio library\u003c/a\u003e to run the webserver which, according to the documentation, automatically chooses eventlet if it is installed, then it works as expected.\u003c/p\u003e\n\n\u003cp\u003eComplete example with Flask-socketio:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e# activate eventlet\nimport eventlet\neventlet.monkey_patch()\n\nfrom flask import Flask\nfrom flask_socketio import SocketIO\n\nimport datetime\nfrom time import sleep\n\n# create a new Flask application\napp = Flask(__name__)\n\n# activate Flask-socketio\nsocketio = SocketIO(app)\n\n# a short running task that returns immediately\n@app.route('/shortTask')\ndef short_running_task():\n start = datetime.datetime.now()\n return 'Started at {0}, returned at {1}'.format(start, datetime.datetime.now())\n\n# a long running tasks that returns after 30s\n@app.route('/longTask')\ndef long_running_task():\n start = datetime.datetime.now()\n sleep(30)\n return 'Started at {0}, returned at {1}'.format(start, datetime.datetime.now())\n\n# run the webserver with socketio\nif __name__ == '__main__':\n socketio.run(app, debug=True)\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"34747676","answer_count":"2","comment_count":"0","creation_date":"2016-01-11 13:02:47.903 UTC","favorite_count":"5","last_activity_date":"2016-01-12 15:33:40.95 UTC","last_edit_date":"2016-01-11 16:31:52.147 UTC","last_editor_display_name":"","last_editor_user_id":"2545732","owner_display_name":"","owner_user_id":"2545732","post_type_id":"1","score":"8","tags":"python|flask|eventlet|flask-socketio","view_count":"3565"} +{"id":"43748096","title":"What to consider when looking at multiple methods to achieve the same result while coding?","body":"\u003cp\u003eI am currently coding in C++, creating an all rounded calculator that, when finished, will be capable of handling all major and common mathematical procedures.\u003c/p\u003e\n\n\u003cp\u003eThe current wall I am hitting is from the fact I am still learning about to profession we call being a programmer.\u003c/p\u003e\n\n\u003cp\u003eI have several ways of achieving a single result. I am curious as to whether I should pick the method that has a clear breakdown of how it got to that point in the code; or the method that is much shorter - while not sacrificing any of the redability.\u003c/p\u003e\n\n\u003cp\u003eBelow I have posted snippets from my class showing what I mean.\u003c/p\u003e\n\n\u003cp\u003eThis function uses if statements to determine whether or not a common denominator is even needed, but is several lines long.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eFraction Fraction::addFraction(Fraction \u0026amp;AddInput)\n{\n Fraction output;\n\n if (m_denominator != AddInput.m_denominator)\n {\n getCommonDenominator(AddInput);\n\n output.setWhole(m_whole + AddInput.m_whole);\n output.setNumerator((m_numerator * firstchange) + (AddInput.m_numerator * secondchange));\n output.setDenominator(commondenominator);\n }\n else\n {\n output.setWhole(m_whole + AddInput.m_whole);\n output.setNumerator(m_numerator + AddInput.m_numerator);\n output.setDenominator(m_denominator);\n }\n\n output.simplify();\n\n return output;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis function below, gets a common denominator; repeats the steps on the numerators; then simplifies to the lowest terms.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eFraction Fraction::addFraction(Fraction \u0026amp;AddInput)\n{\n getCommonDenominator(AddInput);\n\n Fraction output(m_whole + AddInput.m_whole, (m_numerator * firstchange) + (AddInput.m_numerator * secondchange), commondenominator);\n\n output.simplify();\n\n return output;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBoth functions have been tested and always return the accurate result. When it comes to coding standards... do we pick longer and asy to follow? or shorter and easy to understand?\u003c/p\u003e","accepted_answer_id":"43765765","answer_count":"1","comment_count":"1","creation_date":"2017-05-02 22:15:09.237 UTC","last_activity_date":"2017-05-03 16:46:18.35 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7359083","post_type_id":"1","score":"0","tags":"c++|standards","view_count":"47"} +{"id":"29235209","title":"How to provide braintree client token using python backend and web frontend?","body":"\u003cp\u003eI'm building a site with some simple backend functions, and are about to implement braintree using their python library and javascript frontend. Frontend is HTML bootstrap with some Javascript and Angular. I'm not using any Python/flask template engine/renderer. \u003c/p\u003e\n\n\u003cp\u003eHowever in their tutorial they are not very clear on how to obtain the client token, that needs to be generated for each session. \u003c/p\u003e\n\n\u003cp\u003eRight now I've done a regular GET-endpoint in flask for the python backend:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@app.route('/ctoken')\n def client:token():\n client_token = braintree.ClientToken.generate()\n return client_token\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn the frontend I get the token using a regular jQuery get:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$.get( \"ajax/test.html\", function( data ) {\n braintree.setup(\n data,\n 'dropin', {\n container: 'dropin'\n });\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI wonder if this is the best way ? I'm using heroku and will use their HTTPS service, but is this best practice or is there another way to do this?\u003c/p\u003e\n\n\u003cp\u003ePS. the site is not live yet, only sandbox and local testing, want to get everything as secure as it should be.\u003c/p\u003e","accepted_answer_id":"29236586","answer_count":"1","comment_count":"0","creation_date":"2015-03-24 14:27:57.023 UTC","last_activity_date":"2015-03-24 16:38:21.603 UTC","last_edit_date":"2015-03-24 16:38:21.603 UTC","last_editor_display_name":"","last_editor_user_id":"1829511","owner_display_name":"","owner_user_id":"1829511","post_type_id":"1","score":"1","tags":"javascript|python|braintree","view_count":"386"} +{"id":"36007527","title":"How to get a label value into a div","body":"\u003cp\u003eThis is my html code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div id=\"box\"\u0026gt;\n \u0026lt;div\u0026gt;\n \u0026lt;label for=\"text\"\u0026gt;Text 1\u0026lt;/label\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div\u0026gt;\n \u0026lt;label for=\"text\"\u0026gt;Text 2\u0026lt;/label\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div\u0026gt;\n \u0026lt;label for=\"text\"\u0026gt;Text 3\u0026lt;/label\u0026gt;\n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI need to get all label in a div with id=\"box\" so I use Jquery:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar container=$('div[id=\"box\"]');\ncontainer.find('label[for=\"text\"]').each(function(index){\n console.log(\"INDEX \"+index);\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe problem is that the jquery function print only one time \"INDEX\" 0. Anyone can help to print all label value?\u003c/p\u003e","accepted_answer_id":"36007978","answer_count":"3","comment_count":"2","creation_date":"2016-03-15 09:40:46.903 UTC","last_activity_date":"2016-03-15 09:59:42.567 UTC","last_edit_date":"2016-03-15 09:41:12.203 UTC","last_editor_display_name":"","last_editor_user_id":"1479535","owner_display_name":"","owner_user_id":"6045391","post_type_id":"1","score":"0","tags":"javascript|jquery|html","view_count":"666"} +{"id":"42477918","title":"Unity GUIText on Collision c#","body":"\u003cp\u003eI'm writing a 3D maze program in C# and I need to have UI Text display \"You Win!\" When the player reaches the end of the maze.\u003c/p\u003e\n\n\u003cp\u003eI have a trigger set up in Unity as a cube, named FinishLine, and I have the UI text named winText\u003c/p\u003e\n\n\u003cp\u003eI'm getting an error on this line..\u003c/p\u003e\n\n\u003cp\u003eGUI.Box(New rect (10,10,100,90), winText); \u003c/p\u003e\n\n\u003cp\u003ethe error is \"The best overloaded method matfch for unityengine.gui.box (unityEngine rect, string)' has some invalid arguments \u003c/p\u003e\n\n\u003cp\u003eI also have no idea what those numbers are (10,10,100,90), so maybe that's messing something up? What are those values indicating...?\u003c/p\u003e\n\n\u003cp\u003eHere is my code..\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class TextTrigger : MonoBehaviour {\n\n public GUIText winText;\n private bool FinishLine = false;\n\n void Start () {\n FinishLine = false;\n }\n\n void OnTriggerEnter(Collider col){\n if (col.tag == \"Player\") {\n FinishLine = true; \n }\n }\n\n void OnGui() {\n GUI.Box(new Rect(10,10,100,90), winText);\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eEDIT - Updated my code, and I have a new error. \nOn line 21 it says: \u003cem\u003e\"UnityEngine.Texture does not contain a definition for text and no extension method 'text' accepting a first argument of type 'UnityEngine.Texture' could be found. Are you missing a using directive or an assembly refrence?\u003c/em\u003e \u003c/p\u003e\n\n\u003cp\u003eNEW CODE: \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cblockquote\u003e\n \u003cp\u003eusing System.Collections; using System.Collections.Generic; using\n UnityEngine; using UnityEngine.UI;\u003c/p\u003e\n \n \u003cp\u003epublic class FinishLine : MonoBehaviour {\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic Texture winText; private bool FinishPlane = false;\n\n// Use this for initialization void Start () { FinishPlane =\n\u003c/code\u003e\u003c/pre\u003e\n \n \u003cp\u003efalse;\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e}\n\nvoid OnTriggerEnter(Collider col) { if (col.tag == \"Player\") {\n FinishPlane = true; winText.text = \"You Win!\"; } } }\n\u003c/code\u003e\u003c/pre\u003e\n \u003c/blockquote\u003e\n\u003c/blockquote\u003e","accepted_answer_id":"42478025","answer_count":"1","comment_count":"3","creation_date":"2017-02-27 04:37:02.15 UTC","last_activity_date":"2017-02-27 19:06:51.093 UTC","last_edit_date":"2017-02-27 19:06:51.093 UTC","last_editor_display_name":"","last_editor_user_id":"7466531","owner_display_name":"","owner_user_id":"7466531","post_type_id":"1","score":"1","tags":"c#|unity3d|triggers|collision|guitext","view_count":"157"} +{"id":"30485245","title":"SQL: Cannot delete or update parent row: a foreign key constraint fails","body":"\u003cp\u003eWhenever I try to delete a survey from table \"survey\" like this:\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eDELETE FROM surveys WHERE survey_id = 77\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eIt prompts me an error stated below:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e#1451 - Cannot delete or update a parent row: a foreign key constraint fails ('user_surveys_archive', CONSTRAINT\n 'user_surveys_archive_ibfk_6' FOREIGN KEY ('user_access_level_id')\n REFERENCES 'user_surveys' ('user_access_level_id') ON DELETE NO ACTION\n )\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eFirst thing: I do not have any such table with this name \"user_surveys_archive_ibfk_6\"\u003c/p\u003e\n\n\u003cp\u003e2nd thing: There is no record of this survey in other tables.\u003c/p\u003e\n\n\u003cp\u003eAny idea on how can I delete this record of fix this issue?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdit\u003c/strong\u003e \u003c/p\u003e\n\n\u003cp\u003eThis is the line I found when I export the table Constraints for table surveys\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eALTER TABLE `surveys`\nADD CONSTRAINT `surveys_ibfk_1` FOREIGN KEY (`survey_type_id`) REFERENCES `survey_types` (`survey_type_id`) ON DELETE CASCADE ON UPDATE NO ACTION;`\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"3","comment_count":"6","creation_date":"2015-05-27 14:19:46.46 UTC","last_activity_date":"2017-11-05 08:34:36.14 UTC","last_edit_date":"2017-11-05 08:34:36.14 UTC","last_editor_display_name":"","last_editor_user_id":"285587","owner_display_name":"","owner_user_id":"631651","post_type_id":"1","score":"1","tags":"mysql|sql","view_count":"21395"} +{"id":"18781656","title":"SSRS cannot deploy","body":"\u003cp\u003eI am an db admin on the server. I have granted the user with \"SYSTEM user\" on site setting, \"Content Manager\" on the Home folder, and also \"Content Manager\" on the her folder XXX. \u003c/p\u003e\n\n\u003cp\u003eHowever, she cannot deploys her report on BIDS and get this error instead:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eThe permissions granted to user 'WMSERVICE\\xxx' are insufficient for performing this operation\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI have gone through many site and most of the suggestion is to run it back as Administrator, or give her a SYSTEM Administrator privilege for the SSRS (this is the last resort that I should consider). \u003c/p\u003e\n\n\u003cp\u003eAny ideas?\u003c/p\u003e","accepted_answer_id":"18793110","answer_count":"1","comment_count":"1","creation_date":"2013-09-13 08:26:34.097 UTC","last_activity_date":"2014-06-23 11:47:35.89 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1320423","post_type_id":"1","score":"0","tags":"reporting-services|sql-server-2012|bids","view_count":"3807"} +{"id":"30217446","title":"Test Activity onCreate Exception","body":"\u003cp\u003eI have the following Activity that throws an exception if something is configured wrong.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class MyActivity extends AppCompatActivity {\n\n @Override\n protected void onCreate(final Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n throw new IllegalStateException(\"something went wrong\");\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI tried to write a test for this \u003ccode\u003eActivityInstrumentationTestCase2\u003c/code\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic void testException() throws Exception {\n try {\n getActivity().onCreate(null);\n fail();\n } catch (IllegalStateException e) {\n assertThat(e.getMessage()).contains(\"something went wrong\");\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhich throws the correct \u003ccode\u003eException\u003c/code\u003e but doesn't run in my \u003ccode\u003ecatch\u003c/code\u003e block due to some internal \u003ccode\u003eSandboxing\u003c/code\u003e of the \u003ccode\u003eActivityInstrumentationTestCase2\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eSo I tried it with plain Java\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic void testException() throws Exception {\n final MockNavigationDrawerActivity activity = Mockito.mock(MockNavigationDrawerActivity.class);\n Mockito.doCallRealMethod().when(activity).onCreate(null);\n try {\n activity.onCreate(null);\n fail();\n } catch (IllegalStateException e) {\n assertThat(e.getMessage()).contains(\"something went wrong\");\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhich does not work \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ejava.lang.AbstractMethodError: abstract method \"boolean org.mockito.internal.invocation.AbstractAwareMethod.isAbstract()\"\nat org.mockito.internal.invocation.InvocationImpl.callRealMethod(InvocationImpl.java:109)\nat org.mockito.internal.stubbing.answers.CallsRealMethods.answer(CallsRealMethods.java:41)\nat org.mockito.internal.stubbing.StubbedInvocationMatcher.answer(StubbedInvocationMatcher.java:34)\nat org.mockito.internal.handler.MockHandlerImpl.handle(MockHandlerImpl.java:91)\nat org.mockito.internal.handler.NullResultGuardian.handle(NullResultGuardian.java:29)\nat org.mockito.internal.handler.InvocationNotifierHandler.handle(InvocationNotifierHandler.java:38)\nat com.google.dexmaker.mockito.InvocationHandlerAdapter.invoke(InvocationHandlerAdapter.java:49)\nat MockNavigationDrawerActivity_Proxy.onCreate(MockNavigationDrawerActivity_Proxy.generated)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny idea how to test this \u003cstrong\u003esimple\u003c/strong\u003e case?\u003c/p\u003e\n\n\u003ch2\u003eUpdate #1\u003c/h2\u003e\n\n\u003cp\u003eI tried absolutely everything. I reduced it to the absolute minimum which doesn't work.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic void testUpdate1() throws Exception {\n try {\n getActivity();\n fail();\n } catch (Exception e) {\n assertThat(e.getMessage()).contains(\"something went wrong\");\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003estacktrace:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ejava.lang.RuntimeException: Unable to start activity ComponentInfo{com.example/com.example.MyActivity}: java.lang.IllegalStateException: something went wrong\n at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298)\n at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)\n at android.app.ActivityThread.access$800(ActivityThread.java:144)\n at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)\n at android.os.Handler.dispatchMessage(Handler.java:102)\n at android.os.Looper.loop(Looper.java:135)\n at android.app.ActivityThread.main(ActivityThread.java:5221)\n at java.lang.reflect.Method.invoke(Native Method)\n at java.lang.reflect.Method.invoke(Method.java:372)\n at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)\n at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)\n Caused by: java.lang.IllegalStateException: something went wrong\n at com.example.MyActivity.onCreate(MyActivity.java:28)\n at android.app.Activity.performCreate(Activity.java:5933)\n at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)\n at android.support.test.runner.MonitoringInstrumentation.callActivityOnCreate(MonitoringInstrumentation.java:346)\n at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)\n ... 10 more\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003ch2\u003eUpdate #2\u003c/h2\u003e\n\n\u003cp\u003eI started from the beginning. Generated a new project, threw the Exception\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@Override\nprotected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n throw new IllegalStateException(\"something\");\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ean tried to catch it with a \u003ccode\u003eThrowable\u003c/code\u003e.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class MainActivityTest extends ActivityInstrumentationTestCase2\u0026lt;MainActivity\u0026gt; {\n\n public MainActivityTest() {\n super(MainActivity.class);\n }\n\n public void testOnCreate() throws Exception {\n try {\n getActivity();\n fail();\n } catch (Throwable throwable) {\n assertTrue(throwable.getCause().getMessage().contains(\"something\"));\n }\n\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI got this (complete) stacktrace which does not lead to my test. The system seems to call \u003ccode\u003eonCreate\u003c/code\u003e, perhaps from a different process, not my test. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eProcess: com.pascalwelsch.onccreatetest, PID: 3915 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.pascalwelsch.onccreatetest/com.pascalwelsch.onccreatetest.MainActivity}: java.lang.IllegalStateException: something\n at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298)\n at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)\n at android.app.ActivityThread.access$800(ActivityThread.java:144)\n at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)\n at android.os.Handler.dispatchMessage(Handler.java:102)\n at android.os.Looper.loop(Looper.java:135)\n at android.app.ActivityThread.main(ActivityThread.java:5221)\n at java.lang.reflect.Method.invoke(Native Method)\n at java.lang.reflect.Method.invoke(Method.java:372)\n at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)\n at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)\n Caused by: java.lang.IllegalStateException: something\n at com.pascalwelsch.onccreatetest.MainActivity.onCreate(MainActivity.java:15)\n at android.app.Activity.performCreate(Activity.java:5933)\n at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)\n at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)\n            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)\n            at android.app.ActivityThread.access$800(ActivityThread.java:144)\n            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)\n            at android.os.Handler.dispatchMessage(Handler.java:102)\n            at android.os.Looper.loop(Looper.java:135)\n            at android.app.ActivityThread.main(ActivityThread.java:5221)\n            at java.lang.reflect.Method.invoke(Native Method)\n            at java.lang.reflect.Method.invoke(Method.java:372)\n            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"3","comment_count":"4","creation_date":"2015-05-13 14:12:10.977 UTC","favorite_count":"0","last_activity_date":"2015-05-25 09:39:07.97 UTC","last_edit_date":"2015-05-25 09:39:07.97 UTC","last_editor_display_name":"","last_editor_user_id":"669294","owner_display_name":"","owner_user_id":"669294","post_type_id":"1","score":"10","tags":"android|testing|junit|mockito","view_count":"1785"} +{"id":"40452616","title":"Scroll events stop working in Safari","body":"\u003cp\u003eI am developing a website that has scrolling transitions on the \"index\" page and then normal scrolling with a sticky navigation bar on other pages. The site also uses ajax to transition from one page to the next. I have an if statement based on if the user is on the index page use the scrolling transitions, else use normal scrolling with the sticky navigation.\u003c/p\u003e\n\n\u003cp\u003eThe problem I've found is that in safari when I click on a link from the index page, scroll on the new page and then go back to the index page, the scroll transitions are not activated again. In fact it seems that the scroll events I have set up stop working entirely.\u003c/p\u003e\n\n\u003cp\u003eHowever this problem does not occur in any other browser: Chrome, IE, Edge or Firefox.\u003c/p\u003e\n\n\u003cp\u003eI don't know if it's best for me to post the code for it on here because it is a bit long. But here is a link to the code: \u003ca href=\"http://www.dreshaddev.dreamhosters.com/layout/js/scripts.js\" rel=\"nofollow noreferrer\"\u003ehttp://www.dreshaddev.dreamhosters.com/layout/js/scripts.js\u003c/a\u003e \u003c/p\u003e\n\n\u003cp\u003eHere is a link to the development site: \u003ca href=\"http://www.dreshaddev.dreamhosters.com/layout/index.php\" rel=\"nofollow noreferrer\"\u003ehttp://www.dreshaddev.dreamhosters.com/layout/index.php\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI have tried multiple solutions like reinstating the same code after an ajax call and removing event listeners and re-adding them back in. I'm not sure what to do. I am testing this on Safari 9.1.3.\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2016-11-06 17:57:19.637 UTC","last_activity_date":"2016-11-06 17:57:19.637 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7123101","post_type_id":"1","score":"1","tags":"javascript|jquery|html|css|ajax","view_count":"26"} +{"id":"10548189","title":"Is it possible to detect if the selected item is the first in LINQ-to-SQL?","body":"\u003cp\u003eI wonder how I can build a query expression which understands the given item being selected is the first or not. Say I'm selecting 10 items from DB:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar query = db.Table.Take(10).Select(t =\u0026gt; IsFirst ? t.Value1 : t.Value2);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThere is an indexed variant of Select but that is not supported in LINQ-to-SQL. If it was supported my problems would be solved. Is there any other trick?\u003c/p\u003e\n\n\u003cp\u003eI could have used \u003ccode\u003eROW_NUMBER()\u003c/code\u003e on T-SQL for instance, which LINQ-to-SQL uses but does not give access to.\u003c/p\u003e\n\n\u003cp\u003eI know I can \u003ccode\u003eConcat\u003c/code\u003e two queries and use the first expression in the first and so forth but I don't want to manipulate the rest of the query, just the select statement itself because the query is built at multiple places and this is where I want to behave differently on first row. I'll consider other options if that is not possible.\u003c/p\u003e","accepted_answer_id":"10548245","answer_count":"2","comment_count":"0","creation_date":"2012-05-11 08:44:40.727 UTC","last_activity_date":"2012-05-11 08:54:46.2 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"54937","post_type_id":"1","score":"2","tags":"linq|linq-to-sql","view_count":"64"} +{"id":"46394239","title":"density curve plot in ggplot","body":"\u003cp\u003eI am new in ggplot and I am trying to draw a density curve.\nThis is a simplified version of the code that I am trying to use:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eggplot(data=ind1, aes(ind1$V1)) + \ngeom_density(fill = \"red\", colour = \"black\") + xlim(0, 30)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe density curve plot that I get looks like this:\n\u003ca href=\"https://i.stack.imgur.com/Yxted.jpg\" rel=\"nofollow noreferrer\"\u003eenter image description here\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI do not understand what is wrong here! does anyone have any idea what is wrong?\u003c/p\u003e","accepted_answer_id":"46395990","answer_count":"1","comment_count":"1","creation_date":"2017-09-24 19:53:10.477 UTC","last_activity_date":"2017-09-25 22:53:32.787 UTC","last_edit_date":"2017-09-25 22:53:32.787 UTC","last_editor_display_name":"","last_editor_user_id":"2461552","owner_display_name":"","owner_user_id":"7492045","post_type_id":"1","score":"0","tags":"r|ggplot2|density-plot","view_count":"39"} +{"id":"3315789","title":"Download a file stored in database","body":"\u003cp\u003eI have file content in sql database as binary format and also saved the file with its extension .\u003c/p\u003e\n\n\u003cp\u003eI want to have pop up for save as ,so that client can save the file on her system in the same document format.\u003c/p\u003e\n\n\u003cp\u003ei.e if it .doc then it should get save in .doc format only.\u003c/p\u003e\n\n\u003cp\u003ePlease provide the code for the same. \u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2010-07-23 06:29:48.497 UTC","last_activity_date":"2010-09-28 05:53:14.94 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"347755","post_type_id":"1","score":"0","tags":"asp.net","view_count":"592"} +{"id":"25932167","title":"Why Preprocessor 's role is diminishing in C++?","body":"\u003cp\u003eIn his book \"C++ From The Ground Up\" Herbert Schildt wrote that \"However, the role of the preprocessor in C++ is much smaller than it is in \u003cstrong\u003eC\u003c/strong\u003e. One reason for this is that many of the chores that are performed by the preprocessor in \u003cstrong\u003eC\u003c/strong\u003e are performed by language elements in C++. Stroustrup has stated his desire to render the preprocessor redundant, so that,ultimately, it could be removed from the language entirely.\"\u003c/p\u003e\n\n\u003cp\u003eBest examples can be :\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003e\u003cp\u003euse of \u003cstrong\u003econst\u003c/strong\u003e keyword instead of \u003ccode\u003e#define\u003c/code\u003e\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003euse of \u003cstrong\u003einline\u003c/strong\u003e function instead of macro.\u003c/p\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eWhy preprocessor isn't so important in C++?\u003c/p\u003e\n\n\u003cp\u003eI just want to know that is preprocessor is really evil? Because Marshall Cline said that preprocessor is evil in this link: \u003ca href=\"http://www.parashift.com/c++-faq/preprocessor-is-evil.html\" rel=\"nofollow\"\u003ehttp://www.parashift.com/c++-faq/preprocessor-is-evil.html\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"25932359","answer_count":"1","comment_count":"8","creation_date":"2014-09-19 10:46:53.943 UTC","last_activity_date":"2016-07-04 08:59:40.803 UTC","last_edit_date":"2016-07-04 08:59:40.803 UTC","last_editor_display_name":"","last_editor_user_id":"4370109","owner_display_name":"","owner_user_id":"3777958","post_type_id":"1","score":"-4","tags":"c++|c-preprocessor","view_count":"122"} +{"id":"43602347","title":"Uncaught TypeError: $(...).moveTo is not a function","body":"\u003cp\u003eI am new to programming. I am working on one my school assignment and I have two Jquery files that I am using. One was provided to us from the school. However I am keep getting an error \u003ccode\u003eUncaught TypeError: $(...).moveTo\u003c/code\u003e is not a function. I have spent few hours on google but still have not manage to resolve this. Not sure what I am missing. Any suggestion ?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;!doctype html\u0026gt;\n\n\u0026lt;html\u0026gt;\n\n\n \u0026lt;head\u0026gt;\n \u0026lt;meta charset=\"utf-8\"\u0026gt;\n \u0026lt;meta name='viewport'content='width=device-width, intial-scale=1.0 , user-scaleable=no'/\u0026gt;\n \u0026lt;script src=\"https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;script type=\"text/javascript\" scr=\"./jquery-2.2.4.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;script type=\"text/javascript\" scr=\"js/introtoapps.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\n\n\n \u0026lt;script\u0026gt; \n $(document).ready(function(){ \n $(\"#balloon\").moveTo(180);\n });\n \u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"3","creation_date":"2017-04-25 05:30:02.743 UTC","last_activity_date":"2017-04-25 06:15:24.903 UTC","last_edit_date":"2017-04-25 06:15:24.903 UTC","last_editor_display_name":"","last_editor_user_id":"3773799","owner_display_name":"","owner_user_id":"5405500","post_type_id":"1","score":"0","tags":"javascript|jquery","view_count":"106"} +{"id":"15574528","title":"Cross-compiling R for ARM (Raspberry Pi)","body":"\u003cp\u003eI need to build R (\u003ca href=\"http://www.r-project.org/\" rel=\"nofollow\"\u003ehttp://www.r-project.org/\u003c/a\u003e) for Arch Linux ARM running on Raspberry Pi. I am having trouble running ./configure. I have built my own toolchain using crosstool-ng and it does work, I've compiled other applications with it just fine.\u003c/p\u003e\n\n\u003cp\u003eThe issue appears to be that I cannot link the Fortran libraries to C code. Here is where configure fails:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003echecking for Fortran 77 libraries of gfortran... -L/home/njackson/bcm2708rpi-toolchain/lib -L/home/njackson/bcm2708rpi-toolchain/lib/gcc/arm-rpi-linux-gnueabi/4.7.3 -L/home/njackson/bcm2708rpi-toolchain/arm-rpi-linux-gnueabi/lib -L/usr/lib/gcc/x86_64-linux-gnu/4.6 -L/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.6/../../.. -lgfortran -lm /home/njackson/bcm2708rpi-toolchain/arm-rpi-linux-gnueabi/lib/libgfortran.a /home/njackson/bcm2708rpi-toolchain/lib/gcc/arm-rpi-linux-gnueabi/4.7.3/libgcc.a\nchecking for dummy main to link with Fortran 77 libraries... unknown\nconfigure: error: in `/home/njackson/R-2.15.3':\nconfigure: error: linking to Fortran libraries from C fails\nSee `config.log' for more details\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt fails here.\u003c/p\u003e\n\n\u003cp\u003eI used the following configure command:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e./configure --host=arm-linux-gnueabihf CC=/home/njackson/bcm2708rpi-toolchain/bin/arm-rpi-linux-gnueabi-gcc CXX=/home/njackson/bcm2708rpi-toolchain/bin/arm-rpi-linux-gnueabi-g++ FC=/home/njackson/bcm2708rpi-toolchain/bin/arm-rpi-linux-gnueabi-gfortran MAIN_LD=/home/njackson/bcm2708rpi-toolchain/bin/arm-rpi-linux-gnueabi-ld --with-readline=no\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'd appreciate help getting this compiled. Thanks.\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2013-03-22 15:49:55.44 UTC","last_activity_date":"2013-03-27 00:44:50.767 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1730271","post_type_id":"1","score":"0","tags":"c|r|arm|fortran|raspberry-pi","view_count":"704"} +{"id":"19160175","title":"How to hide multiple elements","body":"\u003cp\u003eI want to hide multiple elements when I press a button which get the value of checkboxs, and if the checkbox is checked it's hide.\u003c/p\u003e\n\n\u003cp\u003eI have the next code, but it just work with the first element\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar checkedInputs = $(\"input:checked\");\nvar test = \"\";\n$.each(checkedInputs, function(i, val) {\n test += val.value+\",\";\n});\ntest = test.substring(0,(test.length-1));\n$(\"#numRow\"+test).hide('slow'); // it should to hide multiple elements, but just work with the first value\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI also tried with array, but it doen't work too.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar numMsj =[1, 2, 4, 22, 44,90, 100]; \n$.each(numMsg, function (ind, elem) { \n $(\"#numRow\"+elem).hide('slow');\n});\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"19160250","answer_count":"1","comment_count":"0","creation_date":"2013-10-03 13:14:08.09 UTC","favorite_count":"1","last_activity_date":"2013-10-03 13:30:47.633 UTC","last_edit_date":"2013-10-03 13:30:47.633 UTC","last_editor_display_name":"","last_editor_user_id":"838807","owner_display_name":"","owner_user_id":"3736926","post_type_id":"1","score":"0","tags":"javascript|jquery|arrays|checkbox","view_count":"70"} +{"id":"17824786","title":"How can I edit an iframe with proxy?","body":"\u003cp\u003eI need to edit an iframe with jQuery but I'm unable to do it. \u003c/p\u003e\n\n\u003cp\u003eI tried with:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(document).ready(function(){\n $(\"#iframe\").on('load',function(){\n $(this).contents().find('body').html('a');\n });\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis code doesn't work.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eThe iframe is related to a different domain.\u003c/p\u003e","accepted_answer_id":"17824855","answer_count":"1","comment_count":"2","creation_date":"2013-07-24 03:36:47.287 UTC","favorite_count":"1","last_activity_date":"2015-06-07 13:41:28.57 UTC","last_edit_date":"2015-06-07 13:41:28.57 UTC","last_editor_display_name":"","last_editor_user_id":"4458531","owner_display_name":"","owner_user_id":"2528167","post_type_id":"1","score":"2","tags":"php|iframe|proxy","view_count":"3800"} +{"id":"26528395","title":"How to Install and configure Redis on ElasticBeanstalk","body":"\u003cp\u003eHow do I install and configure Redis on AWS ElasticBeanstalk? Does anyone know how to write an .ebextension script to accomplish that?\u003c/p\u003e","accepted_answer_id":"27577826","answer_count":"2","comment_count":"0","creation_date":"2014-10-23 12:43:48.053 UTC","favorite_count":"1","last_activity_date":"2017-04-18 18:46:49.853 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"839818","post_type_id":"1","score":"7","tags":"redis|elastic-beanstalk","view_count":"6754"} +{"id":"44657875","title":"Offsetting HTML anchors with a fixed header on page","body":"\u003cp\u003eI am currently working on a page that has a fixed header and multiple anchor tags to jump to different sections on the page. I have searched around and found one solution that seems to work the way I would like using CSS primarily, however despite having the the anchors relatively positioned it seems to keep going back to the same location on the page. I would like to have all the links scroll appropriately down to each respective section, and I tried making separate classes for each respective link, but that just took me back to the same location on the page. \u003c/p\u003e\n\n\u003cp\u003eHere is the page in question:\n\u003ca href=\"http://www.aticourses.com/scheduleNew.html\" rel=\"nofollow noreferrer\"\u003ehttp://www.aticourses.com/scheduleNew.html\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e...and the accompanying css\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e.anchor{\ndisplay: block;\nposition: relative;\ntop: -200px;\nvisibility: hidden;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e}\u003c/p\u003e\n\n\u003cp\u003eAm I going to have to create different anchors for each respective section?\u003c/p\u003e\n\n\u003cp\u003eThanks. \u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-06-20 15:59:44.293 UTC","last_activity_date":"2017-06-20 15:59:44.293 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7921641","post_type_id":"1","score":"0","tags":"javascript|html|css|scroll","view_count":"19"} +{"id":"253468","title":"What's the best way to get the directory from which an assembly is executing","body":"\u003cp\u003eFor my apps, I store some configuration file in xml along with the assembly(exe), and something other temporary files for proccessing purpose. \u003c/p\u003e\n\n\u003cp\u003eI found some quirk with \u003ccode\u003e\".\\\\\"\u003c/code\u003e and \u003ccode\u003eApplication.StartupPath\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eI've been using \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eString configPath = \".\\\\config.xml\";\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt works fine until I called \u003ccode\u003eOpenFIleDialog\u003c/code\u003e to open some files in other folders, the statement above failed. Apparently \".\\\" is referring to \"CurrentDirectory\", which changes every time when we browse to another folder.\u003c/p\u003e\n\n\u003cp\u003eAt some point, I was using \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eString configPath = Path.Combine(Application.StartupPath + \"config.xml\");\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAt some point, when I need to execute this assembly from another folder by using \u003ccode\u003eProcess.Start()\u003c/code\u003e, things start to fall apart. Apparently the working directory is not set properly, and \u003ccode\u003eApplication.StartupPath\u003c/code\u003e is actually referring to working directory instead of the directory of which the assembly is executing, as I've assumed. So I have to resort to using ProcessInfo to setup the working directory to the assembly's directory. I also had problem with this when I was writing VSTO.\u003c/p\u003e\n\n\u003cp\u003eSo, my question is, what's the best, simplest and most assured way to get the current directory that the assembly is executing, without those quirks(or misunderstanding) that I've just mentioned?\u003c/p\u003e\n\n\u003cp\u003eEDIT: I meant to get the directory which the assembly reside\u003c/p\u003e\n\n\u003cp\u003eEDIT: According to MSDN on \u003ca href=\"http://msdn.microsoft.com/en-us/library/system.appdomain.basedirectory.aspx\" rel=\"nofollow noreferrer\"\u003eAppDomain.BaseDirectory\u003c/a\u003e, it seems that it can be changes during runtime, which is what I don't want(Just to clarify, not that I don't want to allow changing BaseDirectory, but rather, when I retrieve it without knowing for sure whether it's been changed)\u003c/p\u003e\n\n\u003cp\u003eEDIT: I've notice that a related question was posted much earlier. \u003ca href=\"https://stackoverflow.com/questions/158219/what-would-cause-the-current-directory-of-an-executing-app-to-change\"\u003eWhat would cause the current directory of an executing app to change?\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThanks guys for the answer.\u003c/p\u003e","accepted_answer_id":"253504","answer_count":"7","comment_count":"0","creation_date":"2008-10-31 13:29:57.487 UTC","favorite_count":"6","last_activity_date":"2016-11-19 03:32:26.21 UTC","last_edit_date":"2017-05-23 12:34:09.103 UTC","last_editor_display_name":"faulty","last_editor_user_id":"-1","owner_display_name":"faulty","owner_user_id":"20007","post_type_id":"1","score":"16","tags":".net|directory","view_count":"21991"} +{"id":"11674622","title":"Converting a awk 2D array with counts into hashmap in java","body":"\u003cp\u003eI found this problem so interesting. I am using an awk 2D array that has a key,value,count of the same. and that is being printed to a file. This file is in the below format\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eA100|B100|3\nA100|C100|2\nA100|B100|5\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow I have a file like this .. My motive is to convert this file into a hash map so that the final output from the hash map is.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eA100|B100|8\nA100|C100|2\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eJust an aggregation\u003c/p\u003e\n\n\u003cp\u003eThe challenge is, this one has 3 dimensions and not two. I did have an another file in the below format which is \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eD100|4\nH100|5\nD100|6\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI easily aggregated the above as it is only 2D and I used the below code to do that \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eString[] fields= strLine.trim().split(\"\\\\|\");\nif(hashmap.containsKey(fields[0]))\n{\n//Update the value of the key here\nhashmap.put(fields[0],hashmap.get(fields[0]) + Integer.parseInt(fields[1]));\n}\nelse\n{\n//Inserting the key to the map\nhashmap.put(fields[0],Integer.parseInt(fields[1]));\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo this was quite simple for implementation.\u003c/p\u003e\n\n\u003cp\u003eBut when it comes to 3D I have to have an another check inside.. My idea for this is to maintain a [B100,5(beanObject[5])]\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Map\u0026lt;String,beanClassObject\u0026gt; hashmap=new Map\u0026lt;String,beanClassObject\u0026gt;();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003esecongField hash map which has been used in the code that has a mapping relation between the created ben Object subscript and the key as the second field \"For instance it is \"\u003c/p\u003e\n\n\u003cp\u003eThis bean class would have the getter and setter method for the 2nd and 3rd fields of the file. I hope I am clear with this point. So the implementation of this would be \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eif(hashmap.containsKey(fields[0]))\n{\n **//Have to check whether the the particular key value pair already exists ... I dint find any method for this ... Just a normal iteration is there .. Could you ppl guide me regarding this**\n\n //Update the value of the key here\n secondFieldHashMap.get(fields[1]).COunt= secondFieldHashMap.get(fields[1]).getCOunt+ Integer.parseInt(fields[2]));\n }\n else\n {\n //Inserting the key to the map\n hashmap.put(fields[0],Integer.parseInt(fields[1]));\n secondFieldHashMap.get(fields[1]).COunt= Integer.parseInt(fields[2]));\n }\nelse\n{\n\n // This meands there is no key field\n // Hence insert the key field and also update the count of seconfFieldHashMap as done previously.\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCOuld you ppl please throw some ideas regarding this. Thank you\u003c/p\u003e","accepted_answer_id":"11674798","answer_count":"1","comment_count":"0","creation_date":"2012-07-26 17:19:58.39 UTC","last_activity_date":"2012-07-26 19:17:50.883 UTC","last_edit_date":"2012-07-26 19:17:50.883 UTC","last_editor_display_name":"","last_editor_user_id":"620097","owner_display_name":"","owner_user_id":"1305675","post_type_id":"1","score":"0","tags":"java|awk|hashmap","view_count":"275"} +{"id":"45773120","title":"AspNetCore 2.0 MVC / 'model' must appear at the start line","body":"\u003cp\u003e\u003cstrong\u003e_Create.cshtml (snippet)\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@model MC.Models.AdminViewModels.NewUserViewModel\n\n@await Html.PartialAsync(\"_ModalHeader\", new ModalHeader() { Title= \"New User\"})\n\u0026lt;div class=\"modal-body\"\u0026gt;\n\u0026lt;form asp-action=\"Create\"\u0026gt;\n \u0026lt;div class=\"form-horizontal\"\u0026gt;\n \u0026lt;div asp-validation-summary=\"ModelOnly\" class=\"text-danger\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;div class=\"form-group\"\u0026gt;\n \u0026lt;label asp-for=\"NewUser.FirstName\" class=\"col-md-4 control-label\"\u0026gt;First Name\u0026lt;/label\u0026gt;\n \u0026lt;div class=\"col-md-8\"\u0026gt;\n \u0026lt;input asp-for=\"NewUser.FirstName\" class=\"form-control\" /\u0026gt;\n \u0026lt;span asp-validation-for=\"NewUser.FirstName\" class=\"text-danger\"\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eMicrosoft.AspNetCore.Mvc.Razor.Compilation.CompilationFailedException:\n One or more compilation failures occurred:\n C:\\Projects\\Webs\\MC\\Areas\\Admin\\Views\\Shared_ModalFooter.cshtml(1,3):\n Error RZ9999: The 'model` directive must appear at the start of the\n line. at\n Microsoft.AspNetCore.Mvc.Razor.Internal.RazorViewCompiler.CompileAndEmit(String\n relativePath) at\n Microsoft.AspNetCore.Mvc.Razor.Internal.RazorViewCompiler.CreateCacheEntry(String\n normalizedPath)\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003e\u003cstrong\u003e_ModalFooter.cshtml\u003c/strong\u003e (example of nearly exactly what is in _ModalHeader)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@model MC.Models.ModalFooter\n\n\u0026lt;div class=\"modal-footer\"\u0026gt;\n \u0026lt;button data-dismiss=\"modal\" id=\"@Model.CancelButtonID\" class=\"btn btn-default\" type=\"button\"\u0026gt;@Model.CancelButtonText\u0026lt;/button\u0026gt;\n@if (!Model.OnlyCancelButton)\n{\n \u0026lt;button class=\"btn btn-success\" id=\"@Model.SubmitButtonID\" type=\"submit\"\u0026gt;\n @Model.SubmitButtonText\n \u0026lt;/button\u0026gt;\n}\n\u0026lt;/div\u0026gt; \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis has thrown me for a loop. Asp.net Core 2.0, works just fine in 1.1.2 but this is thrown for each and ever partial within partial, that is setup for modal use. Error RZ9999 hasn't been documented anywhere apparently. Of course taking out the the partial for straight html doesn't throw the error, but as can imagine that is 1 line verse 3-4 lines of code. I figure I am missing something from Asp.net Core MVC 1.1 to 2.0 conversion somewhere. \u003cstrong\u003eAlso this is partial within a partial.\u003c/strong\u003e \u003c/p\u003e\n\n\u003cp\u003eNOTE: I am using the 'Microsoft.AspNetCore.All' package pull in the *.csproj, since release day NuGet didn't have the EF tools packages for v2.\u003c/p\u003e","accepted_answer_id":"45773866","answer_count":"1","comment_count":"0","creation_date":"2017-08-19 15:11:29.63 UTC","last_activity_date":"2017-08-19 16:30:58.023 UTC","last_edit_date":"2017-08-19 16:17:11.313 UTC","last_editor_display_name":"","last_editor_user_id":"5437671","owner_display_name":"","owner_user_id":"981141","post_type_id":"1","score":"2","tags":"asp.net-core-mvc|asp.net-core-mvc-2.0","view_count":"165"} +{"id":"40705087","title":"Nginx server on Google App Engine stopped working suddenly","body":"\u003cp\u003eStarting yesterday, my google app engine app stopped working.\u003c/p\u003e\n\n\u003cp\u003eI have started seeing hundreds of these in the \u003ccode\u003enginx.error\u003c/code\u003e log stream:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/ytpzJ.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/ytpzJ.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eOne of these, for example,\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e[error] 32#0: *506755 upstream prematurely closed connection while\n reading response header from upstream, client: 169.XXX.XXX.XXX, server:\n , request: \"PUT /parse/classes/_Installation/Vt22FpBXIm HTTP/1.1\",\n upstream:\n \"\u003ca href=\"http://172.XXX.XXX.XXX:8080/parse/classes/_Installation/Vt22FpBXIm\" rel=\"nofollow noreferrer\"\u003ehttp://172.XXX.XXX.XXX:8080/parse/classes/_Installation/Vt22FpBXIm\u003c/a\u003e\", host:\n “my-project-id.appspot.com\"\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI have used \u003ccode\u003eXXX\u003c/code\u003es to obfuscate ips. \nI have absolutely no clue what’s happening, I barely know what nginx is.\u003c/p\u003e\n\n\u003cp\u003eNo changes were made to clients nor server in the last week. These errors started yesterday. Requests fail with \u003ccode\u003e502 Bad gateway\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eDo you have any clue what might be happening, and why? Where should I look to debug this issue? I found no relevant information in logs whatsoever.\u003c/p\u003e","answer_count":"0","comment_count":"4","creation_date":"2016-11-20 14:18:13.167 UTC","last_activity_date":"2016-11-20 14:18:13.167 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4288782","post_type_id":"1","score":"1","tags":"http|google-app-engine|nginx|google-cloud-platform","view_count":"119"} +{"id":"17759667","title":"Warning in android xml file","body":"\u003cp\u003ewhen I add any element in android layout, compiler(eclipse) shows a warning on element's attribute \u003ccode\u003eandroid:text=\"Text\"\u003c/code\u003e\nWhat does mean of following warning.\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e\"[118N]Hardcoded string \"Text\", should use @string resource\"\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003ewhen we add @ with string like \"myString%\" it gives error.\u003c/p\u003e","answer_count":"5","comment_count":"0","creation_date":"2013-07-20 07:03:40.943 UTC","last_activity_date":"2013-07-20 08:40:20.797 UTC","last_edit_date":"2013-07-20 07:46:19.767 UTC","last_editor_display_name":"","last_editor_user_id":"2558706","owner_display_name":"","owner_user_id":"2558706","post_type_id":"1","score":"2","tags":"android|components|warnings","view_count":"257"} +{"id":"12701947","title":"Use limit in sub query","body":"\u003cp\u003eI have 4 tables\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eproduct\u003c/li\u003e\n\u003cli\u003estatus\u003c/li\u003e\n\u003cli\u003eorders\u003c/li\u003e\n\u003cli\u003eorders_products.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eUsing following query I get the proper result but it is not in correct order i.e. result gets by sub query.I want result order as sub query result.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT \n p.products_id, p.products_image, p.products_tax_class_id,\n pd.products_name, if(s.status, s.specials_new_products_price,\n p.products_price) as products_price \nFROM\n products p LEFT JOIN specials s\n ON p.products_id = s.products_id, products_description pd \nWHERE\n p.products_status = '1' \n AND p.products_id = pd.products_id \n AND pd.language_id = '2' \n AND p.products_id in (\n SELECT * from (\n SELECT\n distinct(op.products_id) \n FROM\n orders_products op,orders o \n WHERE\n op.orders_id=o.orders_id \n AND o.customers_id='27' \n ORDER BY\n o.date_purchased \n DESC LIMIT 0,10 \n ) AS temptable\n )\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"1","creation_date":"2012-10-03 04:33:48.723 UTC","last_activity_date":"2012-10-03 08:13:50.663 UTC","last_edit_date":"2012-10-03 06:43:17.123 UTC","last_editor_display_name":"","last_editor_user_id":"1672865","owner_display_name":"","owner_user_id":"1672865","post_type_id":"1","score":"0","tags":"mysql","view_count":"92"} +{"id":"28654313","title":"Django project on pythonanywhere","body":"\u003cp\u003eI uploaded my app that worked fine on my local machine to pythonanywhere. I got it to work but instead of showing the homepage of my blog it shows the \"It worked, welcome to Django\" page. Could someone please help me?\u003c/p\u003e","accepted_answer_id":"28668550","answer_count":"1","comment_count":"0","creation_date":"2015-02-22 03:51:22.62 UTC","last_activity_date":"2015-02-23 07:11:32.427 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4547801","post_type_id":"1","score":"2","tags":"django|python-3.x|pythonanywhere","view_count":"89"} +{"id":"28408985","title":"Error: 1408A0C1:ssl routines:ssl3_get_client_hello:no shared cipher","body":"\u003cp\u003eI create a DataSnap REST Server with the Wizard for a 3-Tier application having two connections: \u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eOne by TCP/IP Port: 211 and it works properly.\u003c/li\u003e\n\u003cli\u003eSecond connection by HTTP Port 8080 and this not works.When I launch a simple \u003ca href=\"https://localhost:8080/\" rel=\"nofollow noreferrer\"\u003ehttps://localhost:8080/\u003c/a\u003e from the Navigator, Launch a debugger error shown in the attached file.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eThe Wizard has created the Procedure:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprocedure TForm1.FormCreate(Sender: TObject);\nvar\n LIOHandleSSL: TIdServerIOHandlerSSLOpenSSL;\nbegin\n FServer := TIdHTTPWebBrokerBridge.Create(Self);\n LIOHandleSSL := TIdServerIOHandlerSSLOpenSSL.Create(FServer);\n LIOHandleSSL.SSLOptions.CertFile := '';\n LIOHandleSSL.SSLOptions.RootCertFile := '';\n LIOHandleSSL.SSLOptions.KeyFile := '';\n LIOHandleSSL.OnGetPassword := OnGetSSLPassword;\n FServer.IOHandler := LIOHandleSSL;\nend;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/vVxxV.png\" alt=\"Error Launching from Navigator\"\u003e\u003c/p\u003e","answer_count":"0","comment_count":"12","creation_date":"2015-02-09 11:44:06.087 UTC","last_activity_date":"2015-02-09 17:21:13.07 UTC","last_edit_date":"2015-02-09 17:21:13.07 UTC","last_editor_display_name":"","last_editor_user_id":"608639","owner_display_name":"","owner_user_id":"4545991","post_type_id":"1","score":"1","tags":"delphi|ssl|openssl|indy","view_count":"2978"} +{"id":"42464807","title":"In a popup, change text in a span","body":"\u003cp\u003eI was trying to add an external JavaScript file to my HTML for a practice Chrome extension. It has a slider whose value needs to be taken and sent back to a span tag on the \u003cem\u003epopup.html\u003c/em\u003e,\nAs I looked up I need to have a separate JavaScript file and create an \u003ccode\u003eonchange\u003c/code\u003e event listener to take the element and pass its value. But I cannot get the value to show on span tag. Please guide on what I am doing wrong.\u003c/p\u003e\n\n\u003cp\u003eThis is the HTML (popup.html)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;!doctype html\u0026gt;\n\n\u0026lt;html\u0026gt;\n \u0026lt;head\u0026gt;\n \u0026lt;title\u0026gt;Slide\u0026lt;/title\u0026gt;\n \u0026lt;/head\u0026gt;\n\n \u0026lt;body\u0026gt;\n \u0026lt;input type=\"range\" min=\"0\" max=\"50\" value=\"0\" step=\"5\" id=\"slider\" /\u0026gt;\n \u0026lt;span id=\"range\"\u0026gt;0\u0026lt;/span\u0026gt;\n \u0026lt;script type=\"text/javascript\" src=\"popup.js\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;/body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd This is the JavaScript file (popup.js)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e document.getElementById(\"slider\").onchange = function() {showValue()};\n\n\n function showValue()\n { \n var newValue = document.getElementById(\"slider\");\n var rng = document.getElementById(\"range\");\n rng.value = newValue.value;\n }\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"42464855","answer_count":"1","comment_count":"0","creation_date":"2017-02-26 04:37:59.39 UTC","last_activity_date":"2017-02-26 05:16:53.917 UTC","last_edit_date":"2017-02-26 05:10:33.173 UTC","last_editor_display_name":"","last_editor_user_id":"3773011","owner_display_name":"","owner_user_id":"7206260","post_type_id":"1","score":"0","tags":"javascript|html|google-chrome|google-chrome-extension|onchange","view_count":"187"} +{"id":"22809421","title":"Selecting Dropdown fields with Selenium IDE","body":"\u003cp\u003eI am using the record and play option to record test scripts in my web app. I want to know the command that will be appropriate to use to enable me to click on a dropdown and select and verify an element in the dropdown. Anyone knows how do it?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-04-02 11:04:21.627 UTC","last_activity_date":"2014-04-04 10:49:21.057 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3488998","post_type_id":"1","score":"1","tags":"selenium-ide","view_count":"175"} +{"id":"31198035","title":"Multipart file upload in Swift","body":"\u003cp\u003eI have a problem in uploading file in a server called jetty.\u003c/p\u003e\n\n\u003cp\u003eI have this code for multipart file upload\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e func post(url: String,ticketId: String, workLogDecs: String, status: String,img: UIImage){\n\n var request = NSMutableURLRequest(URL: NSURL(string: \"\\(baseURL)\\(url)\")!)\n\n\n let imageData = UIImageJPEGRepresentation(img, 1)\n\n\n let parameters = [\"workLogDesc\":\"\\(workLogDecs)\",\"requestId\":\"\\(ticketId)\",\"status\":\"\\(status)\"]\n\n let boundary = generateBoundaryString()\n\n request.setValue(\"multipart/form-data; boundary=\\(boundary)\", forHTTPHeaderField: \"Content-Type\")\n\n\n\n\n\n request.HTTPBody = createBodyWithParameters(parameters, filePathKey: \"files\", imageDataKey: imageData, boundary: boundary)\n\n let task = NSURLSession.sharedSession().dataTaskWithRequest(request) {\n data, response, error in\n\n if error != nil {\n println(\"error=\\(error)\")\n\n var userInfo = error.userInfo\n var errorString = userInfo?.description\n\n println(\"errorString \\(errorString)\")\n return\n\n }\n\n // You can print out response object\n println(\"******* response = \\(response)\")\n\n // Print out reponse body\n let responseString = NSString(data: data, encoding: NSUTF8StringEncoding)\n println(\"****** response data = \\(responseString!)\")\n }\n task.resume()\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd here is my code for creating body with params:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e func createBodyWithParameters(parameters: [String: String]?, filePathKey: String?, imageDataKey: NSData, boundary: String) -\u0026gt; NSData {\n\n var body = NSMutableData();\n\n if parameters != nil {\n for (key, value) in parameters! {\n body.appendString(\"–\\(boundary)\\r\\n\")\n body.appendString(\"Content-Disposition: form-data; name=\\\"\\(key)\\\"\\r\\n\\r\\n\")\n body.appendString(\"\\(value)\\r\\n\")\n }\n }\n\n let filename = \"test.jpg\"\n\n let mimetype = \"image/jpg\"\n\n body.appendString(\"–\\(boundary)\\r\\n\")\n body.appendString(\"Content-Disposition: form-data; name=\\\"\\(filePathKey!)\\\"; filename=\\\"\\(filename)\\\"\\r\\n\")\n body.appendString(\"Content-Type: \\(mimetype)\\r\\n\\r\\n\")\n body.appendData(imageDataKey)\n body.appendString(\"\\r\\n\")\n\n body.appendString(\"–\\(boundary)–\\r\\n\")\n\n return body\n}\n\nfunc generateBoundaryString() -\u0026gt; String {\n return \"Boundary-\\(NSUUID().UUIDString)\"\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand I use extension :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eextension NSMutableData {\nfunc appendString(string: String) {\n let data = string.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: true)\n appendData(data!)\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy problem is the I'm getting an error and saying \"Cannot parse Response\"\u003c/p\u003e\n\n\u003cp\u003ehere is my error log:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eError Domain=NSURLErrorDomain Code=-1017 \"cannot parse response\" UserInfo=0x7ff43a74c850 {NSUnderlyingError=0x7ff43a6b4660 \"The operation couldn’t be completed. (kCFErrorDomainCFNetwork error -1017.)\", NSErrorFailingURLStringKey=http://192.168.137.160:8082/ws/worklog/new, NSErrorFailingURLKey=http://192.168.137.160:8082/ws/worklog/new, _kCFStreamErrorDomainKey=4, _kCFStreamErrorCodeKey=-1, NSLocalizedDescription=cannot parse response}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs there wrong in my code. I am new with this multipart file upload. If there is another way to do this please do help me. Thanks.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-07-03 03:39:11.497 UTC","last_activity_date":"2015-07-03 13:01:55.43 UTC","last_edit_date":"2015-07-03 03:46:14.24 UTC","last_editor_display_name":"","last_editor_user_id":"1226963","owner_display_name":"","owner_user_id":"2822093","post_type_id":"1","score":"1","tags":"ios|swift|file-upload|multipartform-data","view_count":"1792"} +{"id":"37710979","title":"Nginx - failed to open stream: Permission denied in /var/www/example.com","body":"\u003cp\u003eMy website is running on nginx + php-fpm and running well but while uploading file it shows blank page.My log file shows \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e2016/06/08 14:44:40 [error] 22063#22063: *25 FastCGI sent in stderr: \"PHP message: PHP Warning: file_put_contents(up/propic/medium/5961465411480.jpg): failed to open stream: Permission denied in /var/www/example.com/saveimg.php on line 32\" while reading response header from upstream, client:...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI tried most of answers from stackoverflow , even I changed the /var/www folder permissions to 777 but the results are same.\u003c/p\u003e\n\n\u003cp\u003eFew details about my server\u003c/p\u003e\n\n\u003cp\u003e/etc/php-fpm.d\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e user=nginx\n group=nginx\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eownership and group of /var/www/sites\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edrwxrwxrwx. 29 ec2-user root 4096 Jun 8 14:39 site1.com\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"37712934","answer_count":"3","comment_count":"2","creation_date":"2016-06-08 19:12:26.92 UTC","favorite_count":"1","last_activity_date":"2016-06-08 21:06:18.943 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3193062","post_type_id":"1","score":"0","tags":"php|nginx|amazon-ec2","view_count":"1872"} +{"id":"41798223","title":"Return a response and file via servicestack","body":"\u003cp\u003eI am working on a project where we have a database and a separate file system both stored on the same server and are accessed through service stack requests and responses. \u003c/p\u003e\n\n\u003cp\u003eThe database contains the relevant metadata for a given file in the file system and as such we would like to be able to retrieve and store these files and documents simultaneously to prevent orphaned data.\u003c/p\u003e\n\n\u003cp\u003eIs is possible to return both a stream of data (file) and a response DTO in the same response? Similar to how \u003ccode\u003eJsonServiceClient.PostFileWithRequest\u003c/code\u003e allows for both a file and request DTO to be passed to the server. If it is possibly how would it be handled on both the server and client sides?\u003c/p\u003e\n\n\u003cp\u003eIn my research so far most applications appear to just return either a response document or a stream and mostly through the use of \u003ccode\u003eHttpResult\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eThanks in advance!\u003c/p\u003e","accepted_answer_id":"41805421","answer_count":"1","comment_count":"0","creation_date":"2017-01-23 01:52:42.387 UTC","last_activity_date":"2017-01-23 11:33:56.493 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1744556","post_type_id":"1","score":"1","tags":"file|servicestack|response","view_count":"64"} +{"id":"9513890","title":"Classic ASP - Regex - pattern is not replacing with string empty","body":"\u003cp\u003eAm trying to replace content with empty using this regular expression.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eobjRegExp.Pattern = \"\u0026lt;(?\u0026gt;/?)(?!(p|strong)(\u0026gt;|\\s))[^\u0026lt;]+?\u0026gt;\"\nsHtml = objRegExp.Replace(sHtml, \"\")\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf I test this \u003ccode\u003e\u0026lt;(?\u0026gt;/?)(?!(p|strong)(\u0026gt;|\\s))[^\u0026lt;]+?\u0026gt;\u003c/code\u003e regex on \u003ca href=\"http://www.gskinner.com/RegExr/\" rel=\"nofollow\"\u003egskinner\u003c/a\u003e, it is working fine. But when I place this on \u003cstrong\u003e\u003ccode\u003eClassic ASP\u003c/code\u003e\u003c/strong\u003e page, it is not working.\u003c/p\u003e\n\n\u003cp\u003eWhen I debug error is shown as \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eSyntax error in regular expression\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003e\u003cstrong\u003eINPUT:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;h2\u0026gt;Regex testing\u0026lt;/h2\u0026gt;\u0026lt;br/\u0026gt;\u0026lt;p\u0026gt;P Test\u0026lt;/p\u0026gt;\u0026lt;div\u0026gt;Div Test\u0026lt;/div\u0026gt;\u0026lt;strong\u0026gt;Strong Test\u0026lt;/strong\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eEXPECTED OUTPUT:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eRegex testing\u0026lt;p\u0026gt;P Test\u0026lt;/p\u0026gt;Div Test\u0026lt;strong\u0026gt;Strong Test\u0026lt;/strong\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ePlease suggest, What's gone wrong here? \u003c/p\u003e","accepted_answer_id":"9514292","answer_count":"1","comment_count":"2","creation_date":"2012-03-01 09:47:19.193 UTC","last_activity_date":"2012-03-01 11:50:27.173 UTC","last_edit_date":"2012-03-01 10:09:19.813 UTC","last_editor_display_name":"","last_editor_user_id":"500725","owner_display_name":"","owner_user_id":"500725","post_type_id":"1","score":"0","tags":"regex|asp-classic","view_count":"2353"} +{"id":"46415858","title":"MongoDB database connection issue after first insert?","body":"\u003cp\u003eSo I have a simple insert function for MongoDB which needs to insert data into the database.\u003c/p\u003e\n\n\u003cp\u003e(Multiple Inserts per Click) -\u003e (MongoDB Database) -\u003e (Return Value)\u003c/p\u003e\n\n\u003cp\u003eHere is the mongodb function:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emongo.connect(specificDatabaseURL, function(error, database){\n database.collection('user-data').insert({bob: 'bob'});\n database.close();\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe first click, the data {bob: 'bob'} gets inserted. But when I click a second time, I get this error on Google Chrome. \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e\"POST \u003ca href=\"http://123.456.789:8080/users/insert/\" rel=\"nofollow noreferrer\"\u003ehttp://123.456.789:8080/users/insert/\u003c/a\u003e net::ERR_CONNECTION_RESET\"\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eSomething with database.collection('user-data').insert({bob: 'bob'}); is causing the error but I dont know why it is refusing to connect after the first click?\u003c/p\u003e\n\n\u003cp\u003eAlso I tried replacing {bob: 'bob'} to a user-inputted variable but still gives the same error.\u003c/p\u003e\n\n\u003cp\u003eThe connection, \"mongo.connect()\" is not the one giving the error.\u003c/p\u003e\n\n\u003cp\u003ePlease help. Thank you.\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-09-25 23:59:49.757 UTC","last_activity_date":"2017-09-26 00:06:31.533 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"8673141","post_type_id":"1","score":"0","tags":"mongodb|database-connection","view_count":"12"} +{"id":"23007723","title":"Populate submodel dependent on model id","body":"\u003cp\u003efirst of all sorry if my title is incomprehensible. I'm still learning so please be forgiving. I searched StackOverflow but found nothing that I can clip into my problem. \nSo... I'm teaching myself MVC and C# and I decided to create small Blog App. I'm using N-Tier architecture which contains Blog.Back(admin panel front-end stuff and controllers that are using ModelProviders from Logic to manipulate data), Blog.DAL which contains EDMX, Blog.Logic which contains Models and ModelProviders. I've got this model:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\n\n public class CategoryModel\n {\n public int Id { get; set; }\n public string Name { get; set; }\n public List Posts { get; set; }\n\n public CategoryModel()\n {\n Posts = new List();\n }\n }\n\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhich contains constructor that inits empty Posts, but I can't figure out how to populate it with data and for now if I loop through my CategoryModel to list Categories and in my views if I count(@Model.Posts.Count()) it always returns 0. Any ideas? Please be detailed with answers.\u003c/p\u003e\n\n\u003cp\u003eSorry if it is duplicate. I tried searching but found nothing similar.\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2014-04-11 08:47:13.533 UTC","last_activity_date":"2014-04-12 18:13:41.473 UTC","last_edit_date":"2014-04-12 18:13:41.473 UTC","last_editor_display_name":"","last_editor_user_id":"727208","owner_display_name":"","owner_user_id":"3407772","post_type_id":"1","score":"0","tags":"c#|asp.net-mvc|asp.net-mvc-3","view_count":"97"} +{"id":"35295260","title":"ADFS + OpenID Connect email claim and external ADFS","body":"\u003cp\u003eI'm having difficulties setting up ADFS with OpenID Connect on Windows Server 2016.\u003c/p\u003e\n\n\u003cp\u003eI've setup AD for testing and I can successfully authenticate, however the email claim is not in the id token.\u003c/p\u003e\n\n\u003cp\u003eAdditionally I've setup an external ADFS in the Claims Provider trust. It is displayed as an option, however upon logging in I get the error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e MSIS9642: The request cannot be completed because an id token is required but the server was unable to construct an id token for the current user.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnybody have suggestions on how to fix this?\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2016-02-09 15:00:52.01 UTC","favorite_count":"1","last_activity_date":"2016-11-23 15:06:51.407 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3087916","post_type_id":"1","score":"4","tags":"active-directory|adfs|openid-connect|windows-server-2016","view_count":"1010"} +{"id":"717192","title":"Combining SQL results using LINQ","body":"\u003cp\u003eI have a database of company registrants (for a search/directory functionality). We've added a new table to hold \"enhanced\" information for registrants that pay for this feature (such as advertisements/additional images/logos etc). Right now the new table just holds the registrants unique identifier, and a few additional fields (paths to images etc). A user can search for users with specific criteria, and the enhanced listings should appear at the top of the list. The results should not show any registrant twice (so if a user has an enhanced listing they should only appear in the top \"enhanced listing\" area). How can I accomplish this?\u003c/p\u003e","accepted_answer_id":"717203","answer_count":"2","comment_count":"0","creation_date":"2009-04-04 14:36:23.673 UTC","last_activity_date":"2014-01-19 00:31:14.34 UTC","last_edit_date":"2014-01-19 00:31:14.34 UTC","last_editor_display_name":"","last_editor_user_id":"759866","owner_display_name":"Sam","post_type_id":"1","score":"0","tags":"sql-server","view_count":"75"} +{"id":"16654117","title":"HTML5 Canvas Drag and Drop with snap into position images","body":"\u003cp\u003e\u003ca href=\"http://www.html5canvastutorials.com/labs/html5-canvas-animals-on-the-beach-game-with-kineticjs\" rel=\"nofollow\"\u003ehttp://www.html5canvastutorials.com/labs/html5-canvas-animals-on-the-beach-game-with-kineticjs\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI am wanting to have this for my HTML5 IOS Application. This requires the widget work offline. When I change line 16, I change the source to \"../img/art/\" as this is where the images are located. Upon doing this, the entire application disappears. Why?\u003c/p\u003e\n\n\u003cp\u003eIf there is not a solution, is there a code that will allow me to do the same concept?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-05-20 16:36:56.317 UTC","last_activity_date":"2014-03-07 17:15:57.803 UTC","last_edit_date":"2014-03-07 17:15:57.803 UTC","last_editor_display_name":"","last_editor_user_id":"881229","owner_display_name":"","owner_user_id":"2402449","post_type_id":"1","score":"0","tags":"html5|drag-and-drop|html5-canvas","view_count":"1894"} +{"id":"9381463","title":"How to create a file in Linux from terminal window?","body":"\u003cp\u003eWhat's the easiest way to create a file in Linux?\u003c/p\u003e","accepted_answer_id":"9381492","answer_count":"15","comment_count":"2","creation_date":"2012-02-21 16:42:47.603 UTC","favorite_count":"70","last_activity_date":"2017-11-03 10:50:20.283 UTC","last_edit_date":"2014-01-29 09:33:28.497 UTC","last_editor_display_name":"","last_editor_user_id":"321731","owner_display_name":"","owner_user_id":"791406","post_type_id":"1","score":"261","tags":"linux|bash|file|command-line-interface","view_count":"928311"} +{"id":"30080891","title":"Unable to open a newly created Maven project in eclipse","body":"\u003cp\u003eI created a new maven project using the following maven command\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emvn archetype:generate -DgroupId=com.company.lib_name -DartifactId=lib_name -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I open this newly created project in eclipse it gives the following error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCould not calculate build plan: Plugin org.apache.maven.plugins:maven-jar- plugin:2.3.2 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-jar-plugin:jar:2.3.2\nPlugin org.apache.maven.plugins:maven-jar-plugin:2.3.2 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-jar-plugin:jar:2.3.2: Hostname cannot be null\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI tried th following:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eDeleted the .m2/repository and rebuilt the project\u003c/li\u003e\n\u003cli\u003eVerified that the artifact exists in the maven repo\u003c/li\u003e\n\u003cli\u003eMaven user settings point to the correct settings.xml\u003c/li\u003e\n\u003cli\u003eProject compiles on the command line\u003c/li\u003e\n\u003cli\u003eCleaned the project\u003c/li\u003e\n\u003cli\u003eForced updates n the project\u003c/li\u003e\n\u003cli\u003eChecked repo to see all the dependencies are downloaded\u003c/li\u003e\n\u003cli\u003eChange eclipse to use the external maven instead of embeded\nAlso I am using Kepler and Maven 3.\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eAny idea what 'hostname cannot be null' is pointing at?\u003c/p\u003e\n\n\u003cp\u003eTHis is the pom content\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\"\u0026gt;\n \u0026lt;modelVersion\u0026gt;4.0.0\u0026lt;/modelVersion\u0026gt;\n \u0026lt;groupId\u0026gt;com.company.lib\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;liby\u0026lt;/artifactId\u0026gt;\n \u0026lt;packaging\u0026gt;jar\u0026lt;/packaging\u0026gt;\n \u0026lt;version\u0026gt;1.0-SNAPSHOT\u0026lt;/version\u0026gt;\n \u0026lt;name\u0026gt;lib\u0026lt;/name\u0026gt;\n \u0026lt;url\u0026gt;http://maven.apache.org\u0026lt;/url\u0026gt;\n \u0026lt;dependencies\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;junit\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;junit\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;3.8.1\u0026lt;/version\u0026gt;\n \u0026lt;scope\u0026gt;test\u0026lt;/scope\u0026gt;\n \u0026lt;/dependency\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;org.slf4j\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;jcl-over-slf4j\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;1.7.0\u0026lt;/version\u0026gt;\n \u0026lt;scope\u0026gt;runtime\u0026lt;/scope\u0026gt;\n \u0026lt;/dependency\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;org.slf4j\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;slf4j-api\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;1.7.0\u0026lt;/version\u0026gt;\n \u0026lt;scope\u0026gt;runtime\u0026lt;/scope\u0026gt;\n \u0026lt;/dependency\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;org.slf4j\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;slf4j-log4j12\u0026lt;/artifactId\u0026gt;\n \u0026lt;scope\u0026gt;runtime\u0026lt;/scope\u0026gt;\n \u0026lt;/dependency\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;log4j\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;log4j\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;1.2.14\u0026lt;/version\u0026gt;\n \u0026lt;/dependency\u0026gt;\n \u0026lt;/dependencies\u0026gt;\n \u0026lt;/project\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd the settings.xml\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;settings\u0026gt;\n\u0026lt;profiles\u0026gt;\n \u0026lt;profile\u0026gt;\n \u0026lt;id\u0026gt;Blah\u0026lt;/id\u0026gt;\n \u0026lt;repositories\u0026gt;\n \u0026lt;repository\u0026gt;\n \u0026lt;id\u0026gt;inhouse\u0026lt;/id\u0026gt;\n \u0026lt;url\u0026gt;http://mavenrepo/maven2_repositories/inhouse\u0026lt;/url\u0026gt;\n \u0026lt;releases\u0026gt;\n \u0026lt;enabled\u0026gt;true\u0026lt;/enabled\u0026gt;\n \u0026lt;/releases\u0026gt;\n \u0026lt;snapshots\u0026gt;\n \u0026lt;enabled\u0026gt;true\u0026lt;/enabled\u0026gt;\n \u0026lt;/snapshots\u0026gt;\n \u0026lt;/repository\u0026gt;\n \u0026lt;repository\u0026gt;\n \u0026lt;id\u0026gt;inhouse_snapshot\u0026lt;/id\u0026gt;\n \u0026lt;url\u0026gt;http://mavenrepo/maven2_repositories/inhouse_snapshot\u0026lt;/url\u0026gt;\n \u0026lt;releases\u0026gt;\n \u0026lt;enabled\u0026gt;true\u0026lt;/enabled\u0026gt;\n \u0026lt;/releases\u0026gt;\n \u0026lt;snapshots\u0026gt;\n \u0026lt;enabled\u0026gt;true\u0026lt;/enabled\u0026gt;\n \u0026lt;/snapshots\u0026gt;\n \u0026lt;/repository\u0026gt;\n \u0026lt;/repositories\u0026gt;\n \u0026lt;pluginRepositories\u0026gt;\n \u0026lt;pluginRepository\u0026gt;\n \u0026lt;id\u0026gt;inhouse\u0026lt;/id\u0026gt;\n \u0026lt;url\u0026gt;http://mavenrepo/maven2_repositories/inhouse\u0026lt;/url\u0026gt;\n \u0026lt;releases\u0026gt;\n \u0026lt;enabled\u0026gt;true\u0026lt;/enabled\u0026gt;\n \u0026lt;/releases\u0026gt;\n \u0026lt;snapshots\u0026gt;\n \u0026lt;enabled\u0026gt;true\u0026lt;/enabled\u0026gt;\n \u0026lt;/snapshots\u0026gt;\n \u0026lt;/pluginRepository\u0026gt;\n \u0026lt;pluginRepository\u0026gt;\n \u0026lt;id\u0026gt;inhouse_snapshot\u0026lt;/id\u0026gt;\n \u0026lt;url\u0026gt;http://mavenrepo/maven2_repositories/inhouse_snapshot\u0026lt;/url\u0026gt;\n \u0026lt;releases\u0026gt;\n \u0026lt;enabled\u0026gt;true\u0026lt;/enabled\u0026gt;\n \u0026lt;/releases\u0026gt;\n \u0026lt;snapshots\u0026gt;\n \u0026lt;enabled\u0026gt;true\u0026lt;/enabled\u0026gt;\n \u0026lt;/snapshots\u0026gt;\n \u0026lt;/pluginRepository\u0026gt;\n \u0026lt;/pluginRepositories\u0026gt;\n \u0026lt;/profile\u0026gt; \n\u0026lt;/profiles\u0026gt;\n\u0026lt;activeProfiles\u0026gt;\n \u0026lt;activeProfile\u0026gt;company_name\u0026lt;/activeProfile\u0026gt;\n\u0026lt;/activeProfiles\u0026gt;\n\n\u0026lt;mirrors\u0026gt;\n \u0026lt;mirror\u0026gt;\n \u0026lt;id\u0026gt;central-to-nexus\u0026lt;/id\u0026gt; \n \u0026lt;mirrorOf\u0026gt;*\u0026lt;/mirrorOf\u0026gt;\n \u0026lt;url\u0026gt;http://mw_maven_repository_readonly/nexus/content/groups/cached\u0026lt;/url\u0026gt;\n \u0026lt;/mirror\u0026gt;\n\u0026lt;/mirrors\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003c/p\u003e","accepted_answer_id":"30101965","answer_count":"3","comment_count":"5","creation_date":"2015-05-06 15:17:06.283 UTC","last_activity_date":"2015-05-07 13:06:06.9 UTC","last_edit_date":"2015-05-07 00:12:11.973 UTC","last_editor_display_name":"","last_editor_user_id":"3987161","owner_display_name":"","owner_user_id":"3987161","post_type_id":"1","score":"2","tags":"java|eclipse|maven|build|workspace","view_count":"155"} +{"id":"30943876","title":"mysql syntax error 1064 (42000)","body":"\u003cp\u003eI have a standard LAMP configuration (apache2, mysql, php5), running on ubuntu, and I'm just typing mysql commands into my terminal. I'm logged into the mysql command line as root. So far I've created a new database, but now trouble started.\u003c/p\u003e\n\n\u003cp\u003eI'm trying to create a simple table but am getting a mysql syntax error and can't figure out what I'm doing wrong.\u003c/p\u003e\n\n\u003cp\u003eThis is the error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 10\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd this is my query:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCREATE TABLE IF NOT EXISTS `customers` (\n `uid` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,\n `name` varchar(50) NOT NULL,\n `email` varchar(50) NOT NULL,\n `phone` varchar(100) NOT NULL,\n `password` varchar(200) NOT NULL,\n `address` varchar(50) NOT NULL,\n `city` varchar(50) NOT NULL,\n `created` datetime NOT NULL DEFAULT TIMESTAMP\n);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNo idea what's wrong honestly.\u003c/p\u003e","accepted_answer_id":"30943935","answer_count":"3","comment_count":"0","creation_date":"2015-06-19 17:22:13.14 UTC","last_activity_date":"2015-06-23 15:52:08.717 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4341439","post_type_id":"1","score":"-1","tags":"mysql","view_count":"64"} +{"id":"4440908","title":"checking for URL validity in VB.net","body":"\u003cp\u003eI am working on a form in which users are asked to provide a file's URL. I need to check if that URL really points to something. I use a CustomValidator with server-side validation. Here is the code :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eProtected Sub documentUrlValide_ServerValidate\n(ByVal source As Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs)\nHandles documentUrlValide.ServerValidate\n\n Try\n Dim uri As New Uri(args.Value)\n Dim request As HttpWebRequest = HttpWebRequest.Create(uri)\n Dim response As HttpWebResponse = request.GetResponse()\n Dim stream As Stream = response.GetResponseStream()\n Dim reader As String = New StreamReader(stream).ReadToEnd()\n args.IsValid = True\n Catch ex As Exception\n args.IsValid = False\n End Try\n\nEnd Sub\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI tested it with several valid URLs, none passed the test, the request.GetResponse() always throws a WebException : \"can not resolve distant name\".\u003c/p\u003e\n\n\u003cp\u003eWhat is wrong with this code ?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eUpdate :\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI couldn't make this work server-side, despite my code apparently being fine, so I ran it client-side with a javascript synchronous HTTP request. Here is the code (note that my application is only requested to run on IE, this code won't work on other browsers dut to Http request calls being different)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction testURLValide(sender, args)\n{\n var xmlhttp = new ActiveXObject(\"Msxml2.XMLHTTP\");\n xmlhttp.open(\"HEAD\", args.Value, false);\n xmlhttp.send(null);\n\n if (! (xmlhttp.status == 400 || xmlhttp.status == 404))\n {\n args.IsValid = true;\n }\n else\n {\n args.IsValid = false;\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"4441064","answer_count":"4","comment_count":"0","creation_date":"2010-12-14 15:41:42.187 UTC","last_activity_date":"2010-12-15 14:52:11.937 UTC","last_edit_date":"2010-12-15 14:52:11.937 UTC","last_editor_display_name":"","last_editor_user_id":"542044","owner_display_name":"","owner_user_id":"542044","post_type_id":"1","score":"0","tags":"javascript|asp.net|vb.net","view_count":"1135"} +{"id":"11785144","title":"How to accept mustUnderstand and other attributes on SOAP header parts?","body":"\u003cp\u003eI have a WSDL for a soap-based web service that contains a custom header:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;message name=\"Request\"\u0026gt;\n \u0026lt;part element=\"common:Request\" name=\"Request\"\u0026gt;\u0026lt;/part\u0026gt;\n \u0026lt;part element=\"common:myHeader\" name=\"Header\"\u0026gt;\u0026lt;/part\u0026gt;\n\u0026lt;/message\u0026gt;\n\n\u0026lt;operation name=\"processRequest\"\u0026gt;\n \u0026lt;soap:operation soapAction=\"\"/\u0026gt;\n \u0026lt;input\u0026gt;\n \u0026lt;soap:body parts=\"Request\" use=\"literal\"/\u0026gt;\n \u0026lt;soap:header message=\"tns:Request\" part=\"Header\" use=\"literal\"\u0026gt;\u0026lt;/soap:header\u0026gt;\n \u0026lt;/input\u0026gt;\n \u0026lt;output\u0026gt;\n \u0026lt;soap:body use=\"literal\"/\u0026gt;\n \u0026lt;/output\u0026gt;\n\u0026lt;/operation\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe header type is defined in a separate schema file:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;xs:element name=\"myHeader\" nillable=\"false\" type=\"tns:myHeaderType\"/\u0026gt;\n\n\u0026lt;xs:complexType name=\"myHeaderType\"\u0026gt;\n \u0026lt;xs:sequence minOccurs=\"1\" maxOccurs=\"1\"\u0026gt;\n \u0026lt;xs:element name=\"JobID\" type=\"tns:JobIDType\" minOccurs=\"1\" maxOccurs=\"1\"/\u0026gt;\n \u0026lt;xs:element name=\"TransactionID\" type=\"xs:string\" minOccurs=\"1\" maxOccurs=\"1\"/\u0026gt;\n \u0026lt;/xs:sequence\u0026gt;\n\u0026lt;/xs:complexType\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFurthermore, I am validating against the definition of \u003ccode\u003emyHeaderType\u003c/code\u003e to make sure that the required elements are there, formatting constraints are met, etc. This all appears to be working correctly, in that well-formed requests are accepted and incorrectly formatted requests are rejected.\u003c/p\u003e\n\n\u003cp\u003eMy problem arises with a consumer who uses Apache Axis (hidden behind a proprietary tool) to generate their web-service client. As described in another StackOverflow question \u003ca href=\"https://stackoverflow.com/questions/9516053/custom-soap-1-1-header-and-mustunderstand-attribute\"\u003ehere\u003c/a\u003e, Axis inserts some optional attributes on myHeader that are allowed by the SOAP standard (\u003ca href=\"http://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383500\" rel=\"nofollow noreferrer\"\u003eas nearly as I can tell\u003c/a\u003e):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;soapenv:Header\u0026gt;\n \u0026lt;com:myHeader soapenv:mustUnderstand=\"0\" soapenv:actor=\"\"\u0026gt;\n ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^\n \u0026lt;JobID\u0026gt;myJobId\u0026lt;/JobID\u0026gt;\n \u0026lt;TransactionID\u0026gt;myTransactionId\u0026lt;/TransactionID\u0026gt;\n \u0026lt;/com:myHeader\u0026gt;\n\u0026lt;/soapenv:Header\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBecause of the tool that my consumer is using, it is not feasible to modify the Axis-generated stubs to omit these attributes, as has been suggested elsewhere. Furthermore, it seems these attributes \u003cem\u003eshould\u003c/em\u003e be allowed by my service, if I'm going to claim to be a soap service. My question is, how can I modify my header definition to accommodate these optional attributes, and ideally plan for attributes that I might not be anticipating. Is there a standard type that I can extend for my header type definition, or a general best practice for this situation?\u003c/p\u003e","accepted_answer_id":"11803403","answer_count":"2","comment_count":"0","creation_date":"2012-08-02 20:20:54.57 UTC","favorite_count":"1","last_activity_date":"2012-08-03 21:16:05.28 UTC","last_edit_date":"2017-05-23 12:06:53.357 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"809596","post_type_id":"1","score":"0","tags":"java|web-services|soap|wsdl","view_count":"1318"} +{"id":"43666921","title":"Deserialize jackson with abstract Type","body":"\u003cp\u003eI'm a beginner in java so i'm not really sure if the title is right but i've been trying to unmarshal a json string of which i won't know the type in advance. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public interface Dummy\u0026lt;T\u0026gt; {\n T unmarShall(String item);\n }\n\n abstract class DummyAbstract implements Dummy\u0026lt;T\u0026gt; {\n\n protected T unmarShall(String item){\n ObjectMapper mapper = new ObjectMapper();\n\n try {\n T objectx = mapper.readValue(item, T);\n return objectx;\n }\n }\n\n }\n\n\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAs this method is expecting a Class as the second parameter \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e T objectx = mapper.readValue(item, T);\n return objectx;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI've been reading about how to do this but can't really find a proper way to do this.\u003c/p\u003e\n\n\u003cp\u003eI would only call this method from an subclass like :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public class DummyImpl extends DummyAbstract\u0026lt;MyClass\u0026gt;{\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI've been doing it with the class hardcoded into the implementation for now but that not DRY at all..\u003c/p\u003e\n\n\u003cp\u003ecould that be done ?\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-04-27 19:59:25.533 UTC","last_activity_date":"2017-04-27 21:06:57.297 UTC","last_edit_date":"2017-04-27 21:06:57.297 UTC","last_editor_display_name":"","last_editor_user_id":"6803922","owner_display_name":"","owner_user_id":"6803922","post_type_id":"1","score":"1","tags":"java|json|jackson|abstract-type","view_count":"42"} +{"id":"2883837","title":"How to create reusable WPF grid layout","body":"\u003cp\u003eI have a window with tab control and number of pages - tab items. Each tab item has same grid layout - 6 rows and 4 columns. Now, each tab item contains grid with row and column definitions, so almost half of XAML is definition of grids. \u003c/p\u003e\n\n\u003cp\u003eHow can I define this grid in one place and reuse that definition in my application? Template? User control? \u003c/p\u003e\n\n\u003cp\u003eBesides 6x4, I have only two more grid dimensions that repeat: 8x4 and 6x6.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdit:\u003c/strong\u003e\u003cbr\u003e\nForgot to mention: controls in grid are different for each tab. I just want to have grid defined once in some resource so that I can reuse them on different tab pages. Now XAML looks like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;TabControl\u0026gt;\n \u0026lt;TabItem Header=\"Property\"\u0026gt;\n \u0026lt;Grid\u0026gt;\n \u0026lt;Grid.RowDefinitions\u0026gt;\n \u0026lt;RowDefinition /\u0026gt;\n \u0026lt;RowDefinition /\u0026gt;\n \u0026lt;RowDefinition /\u0026gt;\n \u0026lt;RowDefinition /\u0026gt;\n \u0026lt;RowDefinition /\u0026gt;\n \u0026lt;RowDefinition /\u0026gt; \n \u0026lt;/Grid.RowDefinitions\u0026gt;\n \u0026lt;Grid.ColumnDefinitions\u0026gt;\n \u0026lt;ColumnDefinition /\u0026gt;\n \u0026lt;ColumnDefinition /\u0026gt;\n \u0026lt;ColumnDefinition /\u0026gt;\n \u0026lt;ColumnDefinition /\u0026gt;\n \u0026lt;/Grid.ColumnDefinitions\u0026gt;\n \u0026lt;!-- some controls here --\u0026gt;\n \u0026lt;/Grid\u0026gt;\n \u0026lt;/TabItem\u0026gt;\n \u0026lt;TabItem Header=\"Style\"\u0026gt;\n \u0026lt;Grid \u0026gt;\n \u0026lt;Grid.RowDefinitions\u0026gt;\n \u0026lt;RowDefinition /\u0026gt;\n \u0026lt;RowDefinition /\u0026gt; \n \u0026lt;RowDefinition /\u0026gt;\n \u0026lt;RowDefinition /\u0026gt;\n \u0026lt;RowDefinition /\u0026gt;\n \u0026lt;RowDefinition /\u0026gt;\n \u0026lt;/Grid.RowDefinitions\u0026gt;\n \u0026lt;Grid.ColumnDefinitions\u0026gt;\n \u0026lt;ColumnDefinition /\u0026gt;\n \u0026lt;ColumnDefinition /\u0026gt; \n \u0026lt;ColumnDefinition /\u0026gt;\n \u0026lt;ColumnDefinition /\u0026gt;\n \u0026lt;/Grid.ColumnDefinitions\u0026gt;\n \u0026lt;!-- some controls here --\u0026gt;\n \u0026lt;/Grid\u0026gt;\n \u0026lt;/TabItem\u0026gt;\n\n ... and this repeats for several more tab items\n\n \u0026lt;/TabControl\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis grid definition repeats for each tab item on the form. It annoys me that half of XAML is grid definition. \u003c/p\u003e\n\n\u003cp\u003eIs there a way to define this grid at one place and then reuse that definition?\u003c/p\u003e","answer_count":"6","comment_count":"0","creation_date":"2010-05-21 16:33:45.85 UTC","favorite_count":"2","last_activity_date":"2016-07-03 17:47:17.873 UTC","last_edit_date":"2010-06-11 15:30:36.56 UTC","last_editor_display_name":"","last_editor_user_id":"25732","owner_display_name":"","owner_user_id":"25732","post_type_id":"1","score":"19","tags":"wpf|layout|grid","view_count":"8172"} +{"id":"43656528","title":"Redirect a form submit with ajax","body":"\u003cp\u003eI want to send form responses to a Google sheet and then redirect the user to a thank you page. The Google script redirects the user directly to a report page. I want to drop the google redirect and place mine. \u003c/p\u003e\n\n\u003cp\u003eForm:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;form method=\"post\" id=\"formID\" action=\"gscript\"\u0026gt;\n...\n\u0026lt;/form\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eScript:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;script\u0026gt;\n $(document).on('submit', '.formID', function(e) {\n $.ajax({\n url: $(this).attr('action'),\n type: $(this).attr('method'),\n data: $(this).serialize(),\n success: function(html) {\n alert('ok');\n window.location(\"Thanks page link\");\n }\n });\n e.preventDefault();\n\n});\n\u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"5","creation_date":"2017-04-27 11:29:49.803 UTC","last_activity_date":"2017-04-27 13:42:37.91 UTC","last_edit_date":"2017-04-27 11:54:46.367 UTC","last_editor_display_name":"","last_editor_user_id":"7930853","owner_display_name":"","owner_user_id":"7930853","post_type_id":"1","score":"0","tags":"html|ajax","view_count":"90"} +{"id":"3762737","title":"Sampling on Yahoo! Answers","body":"\u003cp\u003eI wonder what is the best way to sample,say, 1000 questions,completely randomly from Yahoo! Answer.\nI want to achieve this complete randomness in which I will totally ignore the categories or date of posting etc.\nDoing this manually may result in bias,so could anyone give some suggestions here,like using Yahoo! Answer API or sth.\nThanks a lot.\u003c/p\u003e","accepted_answer_id":"3762797","answer_count":"1","comment_count":"0","creation_date":"2010-09-21 17:17:31.887 UTC","last_activity_date":"2015-06-16 14:51:45.657 UTC","last_edit_date":"2015-06-16 14:51:45.657 UTC","last_editor_display_name":"","last_editor_user_id":"1118488","owner_display_name":"","owner_user_id":"203175","post_type_id":"1","score":"1","tags":"api|data-mining|sample|yahoo-api","view_count":"179"} +{"id":"18848447","title":"How does Unity3D set its icon on linux","body":"\u003cp\u003eWhen I start a Unity3D program on Linux (not via desktop launcher), the program has an icon. As far as I was told, a program entry would only get an icon, when launched via desktop launcher.\nSeems like Unity3D found a way to do it differently. Does anyone know how it works?\u003c/p\u003e","accepted_answer_id":"19267660","answer_count":"1","comment_count":"0","creation_date":"2013-09-17 11:18:47.01 UTC","last_activity_date":"2013-10-09 09:12:46.04 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"725937","post_type_id":"1","score":"0","tags":"linux|ubuntu|unity3d","view_count":"133"} +{"id":"19051622","title":"Set Calendar to next Thursday","body":"\u003cp\u003eI'm developing an app in Android which have a service that must be executed every Thursday and Sunday at 22:00\u003c/p\u003e\n\n\u003cp\u003eWhat I do need, is to set a Calendar to that day and time. However, I'm not sure about how to do it.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCalendar calendar = Calendar.getInstance();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is giving me a calendar with the current date and time.\u003c/p\u003e\n\n\u003cp\u003eI know I can \u003cstrong\u003eadd\u003c/strong\u003e days, minutes, hours, etc. But, is there any way to directly \u003ccode\u003esetNext(\"thursday\")\u003c/code\u003e?\u003c/p\u003e\n\n\u003cp\u003eI don't want to do many maths there. I mean I'm looking for an answer which doesn't need to calculate how many minutes/hours/days are left till next thursday.\u003c/p\u003e\n\n\u003cp\u003eThank you!!\u003c/p\u003e","accepted_answer_id":"19052941","answer_count":"3","comment_count":"4","creation_date":"2013-09-27 13:10:09.107 UTC","last_activity_date":"2017-10-17 11:45:02.61 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1943607","post_type_id":"1","score":"1","tags":"java|android|calendar","view_count":"492"} +{"id":"13305584","title":"How do I create a checkbox in iOS Titanium?","body":"\u003cp\u003eHow would I create a checkbox with Titanium for iOS? \u003c/p\u003e","accepted_answer_id":"13305991","answer_count":"2","comment_count":"2","creation_date":"2012-11-09 09:46:03.73 UTC","favorite_count":"1","last_activity_date":"2012-11-09 11:04:52.717 UTC","last_edit_date":"2012-11-09 09:52:02.353 UTC","last_editor_display_name":"","last_editor_user_id":"646382","owner_display_name":"","owner_user_id":"865863","post_type_id":"1","score":"0","tags":"javascript|titanium|titanium-mobile","view_count":"3125"} +{"id":"47037698","title":"Jquery windows.open","body":"\u003cp\u003eHello StackOverflow community,\u003c/p\u003e\n\n\u003cp\u003eI'm completely new to jQuery, so I'm learning as I go. I'm having some difficulty getting the \"window.open\" to display any information when clicked. \nCurrently, it will open a new tab, but only shows \"Blank\" in the URL. Within the database, there is an HTML tag:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;a id=\"1\" href=\"javascript://\"class=\"dsDetail\"\u0026gt;Test\u0026lt;/a\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethat calls dsDetail:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ejQuery(\"body\").on('click', '.dsDetail', function () {\n // alert('works');\n searchText = jQuery(this).attr(\"id\");\n // alert(searchText);\n window.open(displayDetails(searchText));\n });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf I remove the \"window.open()\" and just leave \"displayDetails(searchText)\" it will show the correct data, but only on the current page. How can I get the dsDetail function to display its content in a new tab?\u003c/p\u003e\n\n\u003cp\u003eAdditionally, the 'displayDetails' function is this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction displayDetails(searchText) {\n var jqxhr = jQuery.ajax(\"index.php?option=com_ppsearchusd\u0026amp;view=ppsearchusd\u0026amp;task=displayDetail\u0026amp;format=json\u0026amp;searchText=\" + searchText)\n .success(function (result) {\n // var obj = jQuery.parseJSON(result);\n // alert(result.data.HTML);\n jQuery('#searchResult-detail').html(result.data.HTML);\n jQuery('#searchResult-detail').css('display', 'block');\n jQuery('#alphaDiv').css('display', 'none');\n jQuery('#searchResults').css('display', 'none');\n })\n .fail(function (jqxhr) {\n alert('status:' + jqxhr.status);\n\n });\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-10-31 14:22:01.22 UTC","last_activity_date":"2017-10-31 14:22:01.22 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"8862759","post_type_id":"1","score":"0","tags":"window.open","view_count":"74"} +{"id":"19421072","title":"datagridview example for sale entry form","body":"\u003cp\u003ei want to make simple sale entry form,\nfirst i want to ask invoice number and customer name, then\nnext details of sale entry i want add using datagridview, like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esr.no---Product Name------Price---qty---total\n\n1 Item 1 150.00 2 300.00\n2 Item 2 80.00 3 240.00\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eabove details i want to add using datagridview in editable rows, but with proper validation.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate void dataGridView1_CellEndEdit(object sender, DataGridViewCellEventArgs e)\n{\n dataGridView1.CurrentRow.Cells[\"l_sr\"].Value = \"1\";\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ecan you help for this\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-10-17 07:51:56.73 UTC","last_activity_date":"2013-10-17 12:19:57.903 UTC","last_edit_date":"2013-10-17 07:54:30.047 UTC","last_editor_display_name":"","last_editor_user_id":"1041642","owner_display_name":"","owner_user_id":"2799492","post_type_id":"1","score":"1","tags":"c#|datagridview","view_count":"3572"} +{"id":"15691782","title":"How do I create a keybinding (Ctrl + O) in Kivy?","body":"\u003cp\u003eI'm wanting to create a keybinding in Kivy (Ctrl + O) that I can attach an event to. I see that the Kivy Inspector module is doing something similar but I'm not sure how to replicate the functionality.\u003c/p\u003e\n\n\u003cp\u003eI'd like to have the keybinding work on all of the Kivy application so I guess that it must bind to the window/root widget.\u003c/p\u003e\n\n\u003cp\u003eHas anyone done this before? Thanks!\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-03-28 20:44:08.603 UTC","last_activity_date":"2013-03-28 23:08:58.317 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2212065","post_type_id":"1","score":"0","tags":"python|kivy","view_count":"945"} +{"id":"33461447","title":"Classes.dex file size increased after ionic framework updated","body":"\u003cp\u003eI have created an app using Ionic framework and for the first time the apk file size was 2.5mb and to add the google analytics plugin I have update the ionic framework and after that the file size increased to 3.7mb I'm sure that nothing is changed or added other than GA plugin. I have extracted the apk and identified that the classes.dex file size is 3.4mb before it was 900kb.\u003c/p\u003e\n\n\u003cp\u003eDoes anyone have any clue on why the file size is increased?\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/GO4No.jpg\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/GO4No.jpg\" alt=\"Extracted Apk folder\"\u003e\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"33753168","answer_count":"2","comment_count":"0","creation_date":"2015-11-01 10:58:48.207 UTC","last_activity_date":"2015-11-17 09:21:24.547 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5126628","post_type_id":"1","score":"1","tags":"java|android|google-analytics|ionic-framework","view_count":"110"} +{"id":"41320700","title":"javax/servlet/ServletContext : Unsupported major.minor version 52.0","body":"\u003cp\u003eI am trying to run simple app engine guestbook app modified for Spring\nI am running od InteliJ IDEA\u003c/p\u003e\n\n\u003cp\u003eSince it is AppEngine, I need to run on JAVA 7\nWhen I am compiling with Java 8 compiler, I have no problem. However when compiling with Java 7, I get this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eorg.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.test.context.web.WebDelegatingSmartContextLoader]: Constructor threw exception; nested exception is java.lang.UnsupportedClassVersionError: javax/servlet/ServletContext : Unsupported major.minor version 52.0\nat org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:154)\nat org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:102)\nat org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:125)\nat org.springframework.test.context.support.AbstractTestContextBootstrapper.resolveContextLoader(AbstractTestContextBootstrapper.java:474)\nat org.springframework.test.context.support.AbstractTestContextBootstrapper.buildMergedContextConfiguration(AbstractTestContextBootstrapper.java:359)\nat org.springframework.test.context.support.AbstractTestContextBootstrapper.buildMergedContextConfiguration(AbstractTestContextBootstrapper.java:305)\nat org.springframework.test.context.support.AbstractTestContextBootstrapper.buildTestContext(AbstractTestContextBootstrapper.java:112)\nat org.springframework.test.context.TestContextManager.\u0026lt;init\u0026gt;(TestContextManager.java:120)\nat org.springframework.test.context.TestContextManager.\u0026lt;init\u0026gt;(TestContextManager.java:105)\nat org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTestContextManager(SpringJUnit4ClassRunner.java:152)\nat org.springframework.test.context.junit4.SpringJUnit4ClassRunner.\u0026lt;init\u0026gt;(SpringJUnit4ClassRunner.java:143)\nat sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\nat sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)\nat sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)\nat java.lang.reflect.Constructor.newInstance(Constructor.java:526)\nat org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104)\nat org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86)\nat org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)\nat org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)\nat org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)\nat org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:33)\nat org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:250)\nat org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)\nat org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)\nat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)\nat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\nat java.lang.reflect.Method.invoke(Method.java:606)\nat org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)\nat org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)\nat org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)\nat org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)\nat org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)\nCaused by: java.lang.UnsupportedClassVersionError: javax/servlet/ServletContext : Unsupported major.minor version 52.0\n at java.lang.ClassLoader.defineClass1(Native Method)\n at java.lang.ClassLoader.defineClass(ClassLoader.java:800)\n at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)\n at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)\n at java.net.URLClassLoader.access$100(URLClassLoader.java:71)\n at java.net.URLClassLoader$1.run(URLClassLoader.java:361)\n at java.net.URLClassLoader$1.run(URLClassLoader.java:355)\n at java.security.AccessController.doPrivileged(Native Method)\n at java.net.URLClassLoader.findClass(URLClassLoader.java:354)\n at java.lang.ClassLoader.loadClass(ClassLoader.java:425)\n at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)\n at java.lang.ClassLoader.loadClass(ClassLoader.java:358)\n at org.springframework.test.context.web.WebDelegatingSmartContextLoader.\u0026lt;init\u0026gt;(WebDelegatingSmartContextLoader.java:63)\n at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\n at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)\n at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)\n at java.lang.reflect.Constructor.newInstance(Constructor.java:526)\n at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:142)\n ... 32 more\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is my Pom\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" encoding=\"UTF-8\"?\u0026gt;\u0026lt;project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\"\u0026gt;\n\n\u0026lt;modelVersion\u0026gt;4.0.0\u0026lt;/modelVersion\u0026gt;\n\u0026lt;packaging\u0026gt;war\u0026lt;/packaging\u0026gt;\n\u0026lt;version\u0026gt;0.1-SNAPSHOT\u0026lt;/version\u0026gt;\n\n\u0026lt;groupId\u0026gt;XXXXX\u0026lt;/groupId\u0026gt;\n\u0026lt;artifactId\u0026gt;XXXXX\u0026lt;/artifactId\u0026gt;\n\n\u0026lt;properties\u0026gt;\n \u0026lt;app.id\u0026gt;XXXXX\u0026lt;/app.id\u0026gt;\n \u0026lt;app.version\u0026gt;1\u0026lt;/app.version\u0026gt;\n \u0026lt;appengine.version\u0026gt;1.9.46\u0026lt;/appengine.version\u0026gt;\n \u0026lt;gcloud.plugin.version\u0026gt;2.0.9.74.v20150814\u0026lt;/gcloud.plugin.version\u0026gt;\n\n \u0026lt;objectify.version\u0026gt;5.1.13\u0026lt;/objectify.version\u0026gt;\n \u0026lt;guava.version\u0026gt;20.0\u0026lt;/guava.version\u0026gt;\n\n \u0026lt;project.build.sourceEncoding\u0026gt;UTF-8\u0026lt;/project.build.sourceEncoding\u0026gt;\n \u0026lt;maven.compiler.showDeprecation\u0026gt;true\u0026lt;/maven.compiler.showDeprecation\u0026gt;\n \u0026lt;spring.framework.version\u0026gt; 4.3.4.RELEASE\u0026lt;/spring.framework.version\u0026gt;\n \u0026lt;jackson.version\u0026gt;2.8.5\u0026lt;/jackson.version\u0026gt;\n \u0026lt;javax.servlet.api.version\u0026gt;4.0.0-b01\u0026lt;/javax.servlet.api.version\u0026gt;\n\n \u0026lt;maven.compiler.source\u0026gt;1.7\u0026lt;/maven.compiler.source\u0026gt;\n \u0026lt;maven.compiler.target\u0026gt;1.7\u0026lt;/maven.compiler.target\u0026gt;\n\u0026lt;/properties\u0026gt;\n\n\u0026lt;prerequisites\u0026gt;\n \u0026lt;maven\u0026gt;3.1.0\u0026lt;/maven\u0026gt;\n\u0026lt;/prerequisites\u0026gt;\n\n\u0026lt;dependencies\u0026gt;\n \u0026lt;!-- Compile/runtime dependencies --\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;com.google.appengine\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;appengine-api-1.0-sdk\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;${appengine.version}\u0026lt;/version\u0026gt;\n \u0026lt;/dependency\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;javax.servlet\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;javax.servlet-api\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;${javax.servlet.api.version}\u0026lt;/version\u0026gt;\n \u0026lt;scope\u0026gt;provided\u0026lt;/scope\u0026gt;\n \u0026lt;/dependency\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;jstl\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;jstl\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;1.2\u0026lt;/version\u0026gt;\n \u0026lt;/dependency\u0026gt;\n\n \u0026lt;!-- [START Spring Dependencies] --\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;org.springframework\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;spring-core\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;${spring.framework.version}\u0026lt;/version\u0026gt;\n \u0026lt;/dependency\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;org.springframework\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;spring-web\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;${spring.framework.version}\u0026lt;/version\u0026gt;\n \u0026lt;/dependency\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;org.springframework\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;spring-webmvc\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;${spring.framework.version}\u0026lt;/version\u0026gt;\n \u0026lt;/dependency\u0026gt;\n \u0026lt;!-- [END Spring Dependencies] --\u0026gt;\n\n \u0026lt;!-- [START Objectify_Dependencies] --\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;com.google.guava\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;guava\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;${guava.version}\u0026lt;/version\u0026gt;\n \u0026lt;/dependency\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;com.googlecode.objectify\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;objectify\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;${objectify.version}\u0026lt;/version\u0026gt;\n \u0026lt;/dependency\u0026gt;\n \u0026lt;!-- [END Objectify_Dependencies] --\u0026gt;\n\n \u0026lt;!-- Test Dependencies --\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;junit\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;junit\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;4.12\u0026lt;/version\u0026gt;\n \u0026lt;scope\u0026gt;test\u0026lt;/scope\u0026gt;\n \u0026lt;/dependency\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;org.mockito\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;mockito-all\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;2.0.2-beta\u0026lt;/version\u0026gt;\n \u0026lt;scope\u0026gt;test\u0026lt;/scope\u0026gt;\n \u0026lt;/dependency\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;com.google.appengine\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;appengine-testing\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;${appengine.version}\u0026lt;/version\u0026gt;\n \u0026lt;scope\u0026gt;test\u0026lt;/scope\u0026gt;\n \u0026lt;/dependency\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;com.google.appengine\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;appengine-api-stubs\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;${appengine.version}\u0026lt;/version\u0026gt;\n \u0026lt;scope\u0026gt;test\u0026lt;/scope\u0026gt;\n \u0026lt;/dependency\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;org.springframework\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;spring-test\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;${spring.framework.version}\u0026lt;/version\u0026gt;\n \u0026lt;scope\u0026gt;test\u0026lt;/scope\u0026gt;\n \u0026lt;/dependency\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;com.fasterxml.jackson.core\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;jackson-core\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;${jackson.version}\u0026lt;/version\u0026gt;\n \u0026lt;/dependency\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;com.fasterxml.jackson.core\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;jackson-databind\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;${jackson.version}\u0026lt;/version\u0026gt;\n \u0026lt;/dependency\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;com.fasterxml.jackson.core\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;jackson-annotations\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;${jackson.version}\u0026lt;/version\u0026gt;\n \u0026lt;/dependency\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;org.hamcrest\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;hamcrest-all\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;1.3\u0026lt;/version\u0026gt;\n \u0026lt;scope\u0026gt;test\u0026lt;/scope\u0026gt;\n \u0026lt;/dependency\u0026gt;\n\n\u0026lt;/dependencies\u0026gt;\n\n\u0026lt;build\u0026gt;\n \u0026lt;!-- for hot reload of the web application--\u0026gt;\n \u0026lt;outputDirectory\u0026gt;${project.build.directory}/${project.build.finalName}/WEB-INF/classes\u0026lt;/outputDirectory\u0026gt;\n \u0026lt;plugins\u0026gt;\n \u0026lt;plugin\u0026gt;\n \u0026lt;groupId\u0026gt;org.codehaus.mojo\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;versions-maven-plugin\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;2.1\u0026lt;/version\u0026gt;\n \u0026lt;executions\u0026gt;\n \u0026lt;execution\u0026gt;\n \u0026lt;phase\u0026gt;compile\u0026lt;/phase\u0026gt;\n \u0026lt;goals\u0026gt;\n \u0026lt;goal\u0026gt;display-dependency-updates\u0026lt;/goal\u0026gt;\n \u0026lt;goal\u0026gt;display-plugin-updates\u0026lt;/goal\u0026gt;\n \u0026lt;/goals\u0026gt;\n \u0026lt;/execution\u0026gt;\n \u0026lt;/executions\u0026gt;\n \u0026lt;/plugin\u0026gt;\n \u0026lt;plugin\u0026gt;\n \u0026lt;groupId\u0026gt;org.apache.maven.plugins\u0026lt;/groupId\u0026gt;\n \u0026lt;version\u0026gt;3.6\u0026lt;/version\u0026gt;\n \u0026lt;artifactId\u0026gt;maven-compiler-plugin\u0026lt;/artifactId\u0026gt;\n \u0026lt;configuration\u0026gt;\n \u0026lt;source\u0026gt;1.7\u0026lt;/source\u0026gt;\n \u0026lt;target\u0026gt;1.7\u0026lt;/target\u0026gt;\n \u0026lt;compilerVersion\u0026gt;1.7\u0026lt;/compilerVersion\u0026gt;\n \u0026lt;/configuration\u0026gt;\n \u0026lt;/plugin\u0026gt;\n\n \u0026lt;plugin\u0026gt;\n \u0026lt;groupId\u0026gt;org.apache.maven.plugins\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;maven-war-plugin\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;3.0.0\u0026lt;/version\u0026gt;\n \u0026lt;configuration\u0026gt;\n \u0026lt;archiveClasses\u0026gt;true\u0026lt;/archiveClasses\u0026gt;\n \u0026lt;webResources\u0026gt;\n \u0026lt;!-- in order to interpolate version from pom into appengine-web.xml --\u0026gt;\n \u0026lt;resource\u0026gt;\n \u0026lt;directory\u0026gt;${basedir}/src/main/webapp/WEB-INF\u0026lt;/directory\u0026gt;\n \u0026lt;filtering\u0026gt;true\u0026lt;/filtering\u0026gt;\n \u0026lt;targetPath\u0026gt;WEB-INF\u0026lt;/targetPath\u0026gt;\n \u0026lt;/resource\u0026gt;\n \u0026lt;/webResources\u0026gt;\n \u0026lt;/configuration\u0026gt;\n \u0026lt;/plugin\u0026gt;\n\n \u0026lt;plugin\u0026gt;\n \u0026lt;groupId\u0026gt;com.google.appengine\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;appengine-maven-plugin\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;${appengine.version}\u0026lt;/version\u0026gt;\n \u0026lt;configuration\u0026gt;\n \u0026lt;enableJarClasses\u0026gt;false\u0026lt;/enableJarClasses\u0026gt;\n \u0026lt;version\u0026gt;${app.version}\u0026lt;/version\u0026gt;\n \u0026lt;!-- Comment in the below snippet to bind to all IPs instead of just localhost --\u0026gt;\n \u0026lt;!-- address\u0026gt;0.0.0.0\u0026lt;/address\u0026gt;\n \u0026lt;port\u0026gt;8080\u0026lt;/port --\u0026gt;\n \u0026lt;!-- Comment in the below snippet to enable local debugging with a remote debugger\n like those included with Eclipse or IntelliJ --\u0026gt;\n \u0026lt;!-- jvmFlags\u0026gt;\n \u0026lt;jvmFlag\u0026gt;-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n\u0026lt;/jvmFlag\u0026gt;\n \u0026lt;/jvmFlags --\u0026gt;\n \u0026lt;/configuration\u0026gt;\n \u0026lt;/plugin\u0026gt;\n \u0026lt;plugin\u0026gt;\n \u0026lt;groupId\u0026gt;com.google.appengine\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;gcloud-maven-plugin\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;${gcloud.plugin.version}\u0026lt;/version\u0026gt;\n \u0026lt;configuration\u0026gt;\n \u0026lt;set_default\u0026gt;true\u0026lt;/set_default\u0026gt;\n \u0026lt;/configuration\u0026gt;\n \u0026lt;/plugin\u0026gt;\n \u0026lt;/plugins\u0026gt;\n\n \u0026lt;testResources\u0026gt;\n \u0026lt;testResource\u0026gt;\n \u0026lt;directory\u0026gt;${basedir}/src/main/webapp\u0026lt;/directory\u0026gt;\n \u0026lt;/testResource\u0026gt;\n \u0026lt;/testResources\u0026gt;\n\u0026lt;/build\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003c/p\u003e\n\n\u003cp\u003eMy JAVA_HOME is iset to Java7, inside project structure Project SDK is defined for Java7.\nJDK for maven importer is Java77, JRE for maven runner is set to Project JDK\u003c/p\u003e\n\n\u003cp\u003eCan you please tell me how it is possible that I get this error, even if I have everything set to Java 7? And also how to fix it :)\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","accepted_answer_id":"41320803","answer_count":"1","comment_count":"1","creation_date":"2016-12-25 11:22:53.06 UTC","last_activity_date":"2016-12-25 11:38:10.007 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2028394","post_type_id":"1","score":"-1","tags":"spring|maven|google-app-engine|servlets|intellij-idea","view_count":"181"} +{"id":"10941388","title":"Can Short2 be used on WP7 for vertex positions?","body":"\u003cp\u003eI'm having trouble using Short2 for the (x,y) positions in my vertex data. This is my vertex structure:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003estruct VertexPositionShort : IVertexType\n{\n private static VertexElement[]\n vertexElements = new VertexElement[]\n {\n new VertexElement(0, VertexElementFormat.Short2, VertexElementUsage.Position, 0),\n };\n private static VertexDeclaration\n vertexDeclaration = new VertexDeclaration(vertexElements);\n\n public Short2\n Position;\n\n\n public static VertexDeclaration Declaration\n {\n get { return new VertexDeclaration(vertexElements); }\n }\n\n VertexDeclaration IVertexType.VertexDeclaration\n {\n get { return new VertexDeclaration(vertexElements); }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eUsing the WP7 emulator, nothing is drawn if I use this structure - no artifacts, nothing! However, if I use an identical structure where the Short2 structs are replaced by Vector2 then it all works perfectly.\u003c/p\u003e\n\n\u003cp\u003eI've found a reference to this being an emulator-specific issue: \"In the Windows Phone Emulator, the SkinnedEffect bone index channel must be specified as one of the integer vertex element formats - either Byte4, Short2, or Short4. This same set of integer data formats cannot be used for other shader input channels such as colors, positions, and texture coordinates on the emulator.\" (http://www.softpedia.com/progChangelog/Windows-Phone-Developer-Tools-Changelog-154611.html) However this is from July 2010 and I'd have assumed this limitation has been fixed by now...? Unfortunately I don't have a device to test on.\u003c/p\u003e\n\n\u003cp\u003eCan anyone confirm that this is still an issue in the emulator or point me at another reason why this is not working?\u003c/p\u003e","accepted_answer_id":"11156678","answer_count":"1","comment_count":"1","creation_date":"2012-06-07 23:48:36.68 UTC","last_activity_date":"2012-06-22 13:00:33.263 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"827029","post_type_id":"1","score":"0","tags":"c#|windows-phone-7|xna-4.0","view_count":"95"} +{"id":"19751621","title":"Windows Phone App 7.5 - 8.0 migration: Resuming... screen is infinitive","body":"\u003cp\u003eAfter migrating windows phone application from 7.5 to 8.0, it starts showing \"Resuming\" screen infinitely after hitting windows button first and after that back button on one of the page.\nCan anybody help please how to troubleshoot this problem?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-11-03 09:46:53.6 UTC","last_activity_date":"2014-06-17 23:21:28.887 UTC","last_edit_date":"2014-06-17 23:21:28.887 UTC","last_editor_display_name":"","last_editor_user_id":"881229","owner_display_name":"","owner_user_id":"2949518","post_type_id":"1","score":"1","tags":"windows-phone-7|windows-phone-8","view_count":"73"} +{"id":"32158616","title":"Get direct url of youtube video","body":"\u003cp\u003eI wonder how to get the direct url of youtube video. For example, when i analyzed the video code of \u003ca href=\"https://www.youtube.com/watch?v=OrTyD7rjBpw\" rel=\"nofollow\"\u003ehttps://www.youtube.com/watch?v=OrTyD7rjBpw\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003ei found some URLs inside the js code of the player, like \u003ca href=\"https://r6---sn-w511uxa-cjoe.googlevideo.com/videoplayback?mt=1440164084\u0026amp;mv=m\u0026amp;ms=au\u0026amp;mm=31\u0026amp;mn=sn-w511uxa-cjoe\u0026amp;upn=ELDhWOVFRzM\u0026amp;id=o-AM6zxCNJwi5l5gjbq_262NpEnieXQ2iQTkGLLDieVKs4\u0026amp;ip=188.77.186.165\u0026amp;sparams=dur%2Cgcr%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpcm2cms%2Cpl%2Cratebypass%2Crequiressl%2Csource%2Cupn%2Cexpire\u0026amp;fexp=3300113%2C3300134%2C3300137%2C3300164%2C3310699%2C3312381%2C3312531%2C9407535%2C9408710%2C9409069%2C9412877%2C9413010%2C9414935%2C9415365%2C9415417%2C9415485%2C9416023%2C9416105%2C9416126%2C9416522%2C9417353%2C9417707%2C9418060%2C9418153%2C9418203%2C9418449%2C9419675\u0026amp;dur=0.000\u0026amp;initcwndbps=1298750\u0026amp;pl=20\u0026amp;ratebypass=yes\u0026amp;source=youtube\u0026amp;gcr=es\u0026amp;pcm2cms=yes\u0026amp;requiressl=yes\u0026amp;expire=1440185744\u0026amp;mime=video%2Fwebm\u0026amp;key=yt5\u0026amp;ipbits=0\u0026amp;lmt=1365511426344921\u0026amp;sver=3\u0026amp;itag=43\" rel=\"nofollow\"\u003ehttps://r6---sn-w511uxa-cjoe.googlevideo.com/videoplayback?mt=1440164084\u0026amp;mv=m\u0026amp;ms=au\u0026amp;mm=31\u0026amp;mn=sn-w511uxa-cjoe\u0026amp;upn=ELDhWOVFRzM\u0026amp;id=o-AM6zxCNJwi5l5gjbq_262NpEnieXQ2iQTkGLLDieVKs4\u0026amp;ip=188.77.186.165\u0026amp;sparams=dur%2Cgcr%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpcm2cms%2Cpl%2Cratebypass%2Crequiressl%2Csource%2Cupn%2Cexpire\u0026amp;fexp=3300113%2C3300134%2C3300137%2C3300164%2C3310699%2C3312381%2C3312531%2C9407535%2C9408710%2C9409069%2C9412877%2C9413010%2C9414935%2C9415365%2C9415417%2C9415485%2C9416023%2C9416105%2C9416126%2C9416522%2C9417353%2C9417707%2C9418060%2C9418153%2C9418203%2C9418449%2C9419675\u0026amp;dur=0.000\u0026amp;initcwndbps=1298750\u0026amp;pl=20\u0026amp;ratebypass=yes\u0026amp;source=youtube\u0026amp;gcr=es\u0026amp;pcm2cms=yes\u0026amp;requiressl=yes\u0026amp;expire=1440185744\u0026amp;mime=video%2Fwebm\u0026amp;key=yt5\u0026amp;ipbits=0\u0026amp;lmt=1365511426344921\u0026amp;sver=3\u0026amp;itag=43\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eBut it doesn't redirect to the youtube video, so i'm thinking that code is more obfuscated\u003c/p\u003e","answer_count":"1","comment_count":"5","creation_date":"2015-08-22 16:59:40.413 UTC","last_activity_date":"2016-03-30 03:31:36.383 UTC","last_edit_date":"2015-08-22 17:00:28.587 UTC","last_editor_display_name":"","last_editor_user_id":"4433386","owner_display_name":"","owner_user_id":"2301283","post_type_id":"1","score":"0","tags":"youtube","view_count":"10573"} +{"id":"5377693","title":"Android app encoding problem - not display ÅÄÖ properly","body":"\u003cp\u003eWhen user enters a value 'Nedskräpning' in a EditTextbox, it is saved as 'Nedskräpning' in the database. So I am assuming this error is generated from the Android part of the application. UPDATE: \u0026lt;-- probably false assumption? \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;EditText android:id=\"@+id/commentTextBox\"\n android:layout_height=\"fill_parent\"\n android:layout_width=\"fill_parent\" \n android:layout_weight=\"1\"/\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe java code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecommentTextBox = (EditText) findViewById(R.id.commentTextBox);\ncrapport.setComment(commentTextBox.getText().toString());\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThen this crapport is saved in the database. \u003c/p\u003e\n\n\u003cp\u003eAny tips on how to solve this?\u003c/p\u003e\n\n\u003cp\u003eUPDATE: This is my Apache CXF webservice:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e @Path(\"/crapportService/\")\npublic class CrapportServiceImpl implements CrapportService {\n\n @Autowired\n private CrapportController crapportController;\n\n @Override\n @Path(\"image\")\n @POST\n @Produces(MediaType.TEXT_HTML)\n public String addReport(MultipartBody multipartBody) {\n\n List\u0026lt;Attachment\u0026gt; attachmentList = new ArrayList\u0026lt;Attachment\u0026gt;();\n attachmentList = multipartBody.getAllAttachments();\n\n if (attachmentList.size() == 0){\n return \"No attachments\";\n }\n\n try {\n crapportController.processReportFromClient(attachmentList);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n return \"Error: FileNotFoundException\";\n } catch (NullPointerException e) {\n return \"Error: NullPointerException\";\n } catch (IOException e) {\n return \"Error: IOException\";\n }\n\n return \"Success\";\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"0","creation_date":"2011-03-21 12:40:40.07 UTC","favorite_count":"1","last_activity_date":"2011-03-21 15:00:40.337 UTC","last_edit_date":"2011-03-21 13:35:25.27 UTC","last_editor_display_name":"","last_editor_user_id":"463833","owner_display_name":"","owner_user_id":"463833","post_type_id":"1","score":"0","tags":"android|mysql|utf-8|character-encoding","view_count":"1911"} +{"id":"30026736","title":"DataContractSerializer - serialize string as value and not reference","body":"\u003cp\u003eI use \u003ccode\u003eDataContract\u003c/code\u003e serializer to serialize my data. I use \u003ccode\u003ePreserveObjectReferences = true\u003c/code\u003e because I need it.\nI have two objects for example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[Datacontract]\nclass A\n{\n [DataMember] string _name;\n ...\n public A(string name)\n {\n _name = name;\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[Datacontract]\nclass B\n{\n [DataMember] string _name;\n ...\n public B(string name)\n {\n _name = name;\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBoth have \u003ccode\u003e_name\u003c/code\u003e field.\nThen I create instance of A and B where I use as a name of the second object the same name from object A:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar obj1 = new A(\"John\");\nvar obj2 = new B(obj1.Name);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThen I serialize it, and XML contains:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e...\n\u0026lt;d11p1:_name z:Id=\"505\"\u0026gt;John\u0026lt;/d11p1:_name\u0026gt;\n..\n\u0026lt;d11p1:_name z:Ref=\"505\" i:nil=\"true\" /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo the field \u003ccode\u003e_name\u003c/code\u003e of the second object is serialized as reference and not Value.\u003c/p\u003e\n\n\u003cp\u003eThen I don't need object A so I delete it. But I want to be abble to open an old saved file which contains data from class A, but in the new version of my program I don't need class A anymore.\u003c/p\u003e\n\n\u003cp\u003eThe problem is that \u003ccode\u003eDataContractSerializer\u003c/code\u003e cannot deserialize instance of B because its \u003ccode\u003e_name\u003c/code\u003e is a reference to \u003ccode\u003e_name\u003c/code\u003e of A which is not deserialized (class is deleted).\u003c/p\u003e\n\n\u003cp\u003eIs there any way to force \u003ccode\u003eDataContractSerializer\u003c/code\u003e to serialize a string as Value type instead of reference?\u003c/p\u003e\n\n\u003cp\u003eI know that one solution is not to delete class A but it contains a lot of data which isn't important in the new version of my program.\u003c/p\u003e","answer_count":"1","comment_count":"7","creation_date":"2015-05-04 09:27:57.357 UTC","last_activity_date":"2015-05-04 11:46:31.76 UTC","last_edit_date":"2015-05-04 11:46:31.76 UTC","last_editor_display_name":"","last_editor_user_id":"3599179","owner_display_name":"","owner_user_id":"4861575","post_type_id":"1","score":"2","tags":"c#|datacontractserializer","view_count":"388"} +{"id":"40107205","title":"Why is GPUImage slower than CPU calculation when calculating average color of image?","body":"\u003cp\u003eIn my project I am trying to get the average color of a series of \u003ccode\u003eUIImage\u003c/code\u003e objects. So I implemented a category \u003ccode\u003eUIImage(AverageColor)\u003c/code\u003e to calculate the average color.\u003c/p\u003e\n\n\u003cp\u003eHere's how I do it with the \u003ccode\u003eGPUImage\u003c/code\u003e library:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e- (void)averageColor:(void (^)(UIColor *))handler {\n dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{\n GPUImagePicture *picture = [[GPUImagePicture alloc] initWithImage:self];\n GPUImageAverageColor *averageColorFilter = [GPUImageAverageColor new];\n [averageColorFilter setColorAverageProcessingFinishedBlock:^(CGFloat r, CGFloat g, CGFloat b, CGFloat a, CMTime frameTime) {\n UIColor *color = [UIColor colorWithRed:r green:g blue:b alpha:a];\n dispatch_async(dispatch_get_main_queue(), ^{\n handler(color);\n });\n }];\n\n [picture addTarget:averageColorFilter];\n [picture useNextFrameForImageCapture];\n [picture processImage];\n });\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI've also tried the approach (pure CPU one I think?) in \u003ca href=\"https://stackoverflow.com/a/5562246/3719276\"\u003ethis answer\u003c/a\u003e. Then I test these two methods with the same \u003ccode\u003eUIImage\u003c/code\u003e and log out the time used in each methods. And here's the result:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003ecpu time: 0.102402\u003c/p\u003e\n \n \u003cp\u003egpu time: 0.414044\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI am surprised that the CPU one runs much faster. So what's the problem here? Am I using \u003ccode\u003eGPUImage\u003c/code\u003e in a wrong way?\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003ch3\u003eEdit:\u003c/h3\u003e\n\n\u003cp\u003eThe above result was got from iOS simulator. When testing on real device (iPhone6s) the difference is even greater:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003ecpu time: 0.019034\u003c/p\u003e\n \n \u003cp\u003egpu time: 0.137635\u003c/p\u003e\n\u003c/blockquote\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-10-18 11:36:49.35 UTC","last_activity_date":"2016-10-27 15:04:57.813 UTC","last_edit_date":"2017-05-23 10:27:32.523 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"3719276","post_type_id":"1","score":"0","tags":"ios|cocoa-touch|uiimage|core-graphics|gpuimage","view_count":"79"} +{"id":"5484985","title":"what value will have property of my object?","body":"\u003cp\u003eHi in my opinion property of my object shouold be 2, but after this code, is still 1, why?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003einternal class Program\n{\n private static void Main(string[] args)\n {\n MyClass value = new MyClass() { Property = 1 };\n\n value.Property = value.Property++;\n Console.WriteLine(value.Property);\n Console.ReadKey();\n }\n}\n\ninternal class MyClass\n{\n public int Property;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ein my opinion this should value.Property = value.Property++; first put to value what is in value and the increment property of this object, why id doesn't work?\u003c/p\u003e","accepted_answer_id":"5485019","answer_count":"4","comment_count":"0","creation_date":"2011-03-30 10:17:21.97 UTC","last_activity_date":"2011-03-30 10:25:48.803 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"428547","post_type_id":"1","score":"2","tags":"c#","view_count":"73"} +{"id":"8738992","title":"Not able to login while using Opera Mobile created using Jquery","body":"\u003cp\u003eWhile using Opera mobile browser my login page i can enter data in username and passwd fields but not able to fire any event so that i can direct the application to another page.\u003c/p\u003e\n\n\u003cp\u003eSame app is working fine with Android browser. A 'Go' key appears on it while entering the data, on pressing that key it fires ENTER event(i checked the key code : 13).\u003c/p\u003e\n\n\u003cp\u003eThanks in advance.\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2012-01-05 07:25:28.023 UTC","favorite_count":"1","last_activity_date":"2012-01-31 00:39:23.21 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1131520","post_type_id":"1","score":"1","tags":"jquery-mobile|opera","view_count":"166"} +{"id":"17567458","title":"Celery Pickiling error with dynamic models","body":"\u003cp\u003eI'm using celery with a function which writes data into a database table.\u003c/p\u003e\n\n\u003cp\u003eThis table doesn't have a related model inside models.py because I create it dynamically using \u003ca href=\"https://github.com/charettes/django-mutant\" rel=\"nofollow\"\u003edjango-mutant\u003c/a\u003e.\u003c/p\u003e\n\n\u003cp\u003eWhen I run my task, it correctly writes on my dynamic table, but at the very end of the task I get the following error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[2013-07-10 09:10:45,707: CRITICAL/MainProcess] Task topology_py.Functions.Functions.objectAggregate[aff70510-1e93-4610-b08c-c3675c92afe9] INTERNAL ERROR: PicklingError(\"Can't pickle \u0026lt;class 'mutant.apps.tss.models.1_tmp'\u0026gt;: import of module mutant.apps.tss.models failed\",)\nTraceback (most recent call last):\n File \"/usr/lib/python2.7/site-packages/celery/task/trace.py\", line 261, in trace_task\nfor callback in task_request.callbacks or []]\n File \"/usr/lib/python2.7/site-packages/celery/canvas.py\", line 197, in apply_async\nreturn self._apply_async(args, kwargs, **options)\n File \"/usr/lib/python2.7/site-packages/celery/app/task.py\", line 472, in apply_async\n**options)\n File \"/usr/lib/python2.7/site-packages/celery/app/amqp.py\", line 249, in publish_task\n**kwargs\n File \"/usr/lib/python2.7/site-packages/kombu/messaging.py\", line 157, in publish\ncompression, headers)\n File \"/usr/lib/python2.7/site-packages/kombu/messaging.py\", line 233, in _prepare\nbody) = encode(body, serializer=serializer)\n File \"/usr/lib/python2.7/site-packages/kombu/serialization.py\", line 170, in encode\npayload = encoder(data)\n File \"/usr/lib/python2.7/site-packages/kombu/serialization.py\", line 356, in dumps\nreturn dumper(obj, protocol=pickle_protocol)\nPicklingError: Can't pickle \u0026lt;class 'mutant.apps.tss.models.1_tmp'\u0026gt;: import of module mutant.apps.tss.models failed\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe model that celery is searching for, \u003ccode\u003e1_tmp\u003c/code\u003e is not stored in my app, named \u003cem\u003etss\u003c/em\u003e, but inside \u003cem\u003emutant\u003c/em\u003e app tables.\u003c/p\u003e\n\n\u003cp\u003eMy problem is that if I chain this function as a subtask to another subtask, celery terminates with this error at the end of the first one!\u003c/p\u003e\n\n\u003cp\u003eIs there a way to tell celery where to find this model or anyway to skip this error and go further to next subtasks?\u003c/p\u003e\n\n\u003cp\u003eThanks in advance.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT:\u003c/strong\u003e at the moment I can run even 5 functions in a chain using 5 immutable subtasks. They work correctly and fill correctly the dynamic table, but the first one, and only the first one, continue producing the error described...Can you give me and idea of why only the first one give me the error since that they access the dynamic model in the same identical way?\u003c/p\u003e","accepted_answer_id":"17595373","answer_count":"1","comment_count":"10","creation_date":"2013-07-10 09:47:26.343 UTC","last_activity_date":"2013-07-11 13:57:19.707 UTC","last_edit_date":"2013-07-10 15:02:41.243 UTC","last_editor_display_name":"","last_editor_user_id":"1065696","owner_display_name":"","owner_user_id":"1065696","post_type_id":"1","score":"0","tags":"celery|django-celery","view_count":"178"} +{"id":"1927091","title":"How to check for nulls using LINQ","body":"\u003cp\u003eI have this code. How can I check for null values with the SingleOrDefault method?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic static List\u0026lt;ETY.Rol\u0026gt; GetRolesByApplicationAndCompany(this UsuarioContext usuario, int company, int app)\n {\n List\u0026lt;ETY.Company\u0026gt; lCompanies= usuario.Companies;\n\n var roles = lCompanies.\n SingleOrDefault(e =\u0026gt; (e.Id == company)).Applications.\n SingleOrDefault(a =\u0026gt; a.Id == app).Roles;\n return roles;\n\n }\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"1927117","answer_count":"3","comment_count":"0","creation_date":"2009-12-18 08:53:24.753 UTC","last_activity_date":"2015-03-17 15:54:51.933 UTC","last_edit_date":"2015-03-17 15:54:51.933 UTC","last_editor_display_name":"","last_editor_user_id":"2460971","owner_display_name":"","owner_user_id":"94327","post_type_id":"1","score":"1","tags":"linq|null","view_count":"145"} +{"id":"6476541","title":"Should I use MongoDb module or morphia module or Casbah in play framework for MongoDb?","body":"\u003cp\u003eI am working on a play framework project with scala in which I want to have Scala domain classes (or even Java domain classes) using MongoDb as data store.\u003c/p\u003e\n\n\u003cp\u003eI want maximum performance while serving hundreds of thousands if not millions of requests per day.\u003c/p\u003e\n\n\u003cp\u003eSince both scala language and Play framework is adding new features by the month, what is the best answer in terms of latest production version of the modules mentioned in the question\nand play framework 1.2.2, scala 0.9.1+ and scala language 2.8+?\u003c/p\u003e","answer_count":"3","comment_count":"2","creation_date":"2011-06-25 07:35:52.847 UTC","favorite_count":"1","last_activity_date":"2013-08-02 22:11:46.47 UTC","last_edit_date":"2011-06-25 10:16:48.903 UTC","last_editor_display_name":"","last_editor_user_id":"574122","owner_display_name":"","owner_user_id":"574122","post_type_id":"1","score":"5","tags":"mongodb|playframework|casbah","view_count":"1163"} +{"id":"34026332","title":"String format using UWP and x:Bind","body":"\u003cp\u003eDoes anyone know how to format a date when using x:Bind in a UWP Windows 10 app?\u003c/p\u003e\n\n\u003cp\u003eI have a TextBlock that is bound (x:Bind) to a DateTime property on my ViewModel which is read from SQL. I want to format the output to \"dd/MM/yyy HH:mm (ddd)\". Is there a simple way of doing this?\u003c/p\u003e\n\n\u003cp\u003eThe default format is \"dd/MM/yyy HH:mm:ss\" which I presume is coming from a default. Could this be replaced maybe?\u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","accepted_answer_id":"34026544","answer_count":"2","comment_count":"0","creation_date":"2015-12-01 17:25:59.087 UTC","favorite_count":"1","last_activity_date":"2017-04-28 14:52:03.557 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5372257","post_type_id":"1","score":"5","tags":"c#|xaml|uwp","view_count":"5216"} +{"id":"4780868","title":"User auth problem when trying to access to the SQL Server Reporting service's webservice","body":"\u003cp\u003eI've a SSRS(2008 standard, not R2), so I'm using ReportExecution2005.asmx and ReportService2005.asmx to run them.\u003c/p\u003e\n\n\u003cp\u003eWe developed an application which can connect to the SSRS through a webservice. It worked well on our test server, but now I'm trying to configure a new server on a virtual machine, and no way, everytimes the application tries to connect to the SSRS webservice, I get a 401 unautorized.\u003c/p\u003e\n\n\u003cp\u003eit's very strange, because if I only put the .asmx url in firefox on the client workstation, it prompts me for username-password, I enter it and I get the wsdl definition, so I think that the access is correct.\u003c/p\u003e\n\n\u003cp\u003eHere is my code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public ReportGateway()\n {\n _rs = new ReportingService2005 { Credentials = new NetworkCredential(ConfigurationManager.AppSettings[\"ReportGatewayUser\"], ConfigurationManager.AppSettings[\"ReportGatewayPassword\"]) };\n _rs.Url = \"http://MyMachine:80/ReportServer/ReportService2005.asmx\";//?? I saw when I was debugging that it wasn't reading the value in the app.config, but keeping the url of the reference when I created it, so for my test of the moment, I hard-setted it\n _rsExec = new ReportExecution2005.ReportExecutionService { Credentials = new NetworkCredential(ConfigurationManager.AppSettings[\"ReportGatewayUser\"], ConfigurationManager.AppSettings[\"ReportGatewayPassword\"]) };\n _rsExec.Url = \"http://MyMachine:80/ReportServer/ReportExecution2005.asmx\";//Same\n GenerateReportList();\n }\n [MethodImpl(MethodImplOptions.Synchronized)]\n private void GenerateReportList()\n {\n try\n {\n Dictionary\u0026lt;String, SRSSReport\u0026gt; reports = new Dictionary\u0026lt;String, SRSSReport\u0026gt;();\n foreach (var children in _rs.ListChildren(\"/\", true))\n {\n if (children.Type == ItemTypeEnum.Report)\n {\n SRSSReport report = new SRSSReport {Name = children.Name, Path = children.Path};\n ReportParameter[] parameters = _rs.GetReportParameters(children.Path, null, false, null, null);\n foreach (ReportParameter parameter in parameters)\n report.Parameters.Add(new SRSSReportParameter {Name = parameter.Name, Type = _typeConverstion[parameter.Type]});\n reports.Add(report.Path, report);\n }\n }\n lock (_lockObject)\n {\n _reports = reports;\n }\n }catch(Exception ex)\n {\n _reports = new Dictionary\u0026lt;string, SRSSReport\u0026gt;();\n Logger.Instance.Error(\"Error when contacting the reporting server\", ex);\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm completly desperate for now, I've looked for a solution during days, and I don't know what I can have done wrong.\u003c/p\u003e\n\n\u003cp\u003eDo you have an idea/solution/... to help me?\u003c/p\u003e\n\n\u003cp\u003eThank you very much, any help would be really appreciated.\u003c/p\u003e","accepted_answer_id":"4797557","answer_count":"1","comment_count":"0","creation_date":"2011-01-24 10:19:39.02 UTC","last_activity_date":"2011-01-25 19:55:01.92 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"397830","post_type_id":"1","score":"0","tags":"c#|ssrs-2008|webservice-client|reporting-services","view_count":"3966"} +{"id":"4986844","title":"What does \"cdecl\" stand for?","body":"\u003cp\u003eYes, I know that \"cdecl\" is the name of a prominent calling convention, so please don't explain calling conventions to me. What I'm asking is what the abbreviation (?) \"cdecl\" actually stands for. I think it's a poor naming choice, because at first sight it reminds one of \"C declarator\" (a rather unique syntactic aspect of C). In fact, there is a program called \u003ca href=\"http://www.cdecl.org/\" rel=\"noreferrer\"\u003ecdecl\u003c/a\u003e whose sole purpose is to decipher C declarators. But the C declarator syntax has absolutely nothing to do with calling conventions as far as I can tell.\u003c/p\u003e\n\n\u003cp\u003eSimplified version: \"stdcall\" stands for \"standard calling convention\". What does \"cdecl\" stand for?\u003c/p\u003e","accepted_answer_id":"4987317","answer_count":"4","comment_count":"6","creation_date":"2011-02-13 21:00:13.817 UTC","favorite_count":"2","last_activity_date":"2011-02-15 07:37:22.643 UTC","last_edit_date":"2011-02-13 21:28:56.587 UTC","last_editor_display_name":"","last_editor_user_id":"505088","owner_display_name":"","owner_user_id":"252000","post_type_id":"1","score":"21","tags":"c++|c|calling-convention|nomenclature|cdecl","view_count":"8151"} +{"id":"26218174","title":"Making data accessible to fragments","body":"\u003cp\u003eI am having an app which is retrieving data in the main activity and sending an event to all fragments as soon as it is available. So for the first start it looks like this: \u003c/p\u003e\n\n\u003cp\u003eApp starts (fragments are initialising in the background) -\u003e feed download -\u003e notification sent to fragments -\u003e fragments initialise UI\u003c/p\u003e\n\n\u003cp\u003eEverything's fine so far. BUT, what if I am resuming the app. The data will be still cached, so i will send the event immediately on app resume, and therefore it can happen that my fragments are not even ready for receiving the event -\u003e no fragment UI update!\nOr the event is triggered and received in the fragment, but the fragment is not ready for the UI update, cause it still hasn't inflated the layout -\u003e NullpointerException\nOr the fragment receives the event, but is not attached to the activity anymore -\u003e another Exception.\nThere are ways to deal with single issues, but overall it is complicating the architecture a lot.\u003c/p\u003e\n\n\u003cp\u003eSomehow I tried a lot of things (playing around with Otto bus) but somehow I can't find any architecture which is working for making a central datasource available to all activities and fragments in the app. \u003c/p\u003e\n\n\u003cp\u003eHow do you supply your fragments with data if you don't want to use bundles?\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2014-10-06 14:13:04.04 UTC","favorite_count":"1","last_activity_date":"2014-10-06 14:52:15.09 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"457059","post_type_id":"1","score":"0","tags":"android|android-fragments|event-bus|otto","view_count":"212"} +{"id":"36574978","title":"C++ char arithmetic overflow","body":"\u003cpre\u003e\u003ccode\u003e#include \u0026lt;stdio.h\u0026gt;\n\nint main()\n{\n char a = 30;\n char b = 40;\n char c = 10;\n printf (\"%d \", char(a*b));\n char d = (a * b) / c;\n printf (\"%d \", d);\n return 0;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe above code yields normal int value if \u003ccode\u003e127 \u0026gt; x \u0026gt; -127\u003c/code\u003e\nand a overflow value if other. I can't understand how the overflow value is calculated. As -80 in this case.\nThanks\u003c/p\u003e","accepted_answer_id":"36575257","answer_count":"2","comment_count":"14","creation_date":"2016-04-12 13:35:46.06 UTC","favorite_count":"0","last_activity_date":"2016-04-12 15:01:31.62 UTC","last_edit_date":"2016-04-12 15:01:31.62 UTC","last_editor_display_name":"","last_editor_user_id":"2356414","owner_display_name":"","owner_user_id":"4465685","post_type_id":"1","score":"1","tags":"c++","view_count":"206"} +{"id":"44675169","title":"Finding points of a scrabble word","body":"\u003cp\u003eSo i recently started c language with no prior knowledge of coding or computer science. Wrote this piece of code to find value of a word using scrabble points as below:\n1:AEILNORSTU 2:DG 3:BCMP 4:FHVWY 5:K 8:JX 10:QZ.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e# include \u0026lt;stdio.h\u0026gt;\n# include \u0026lt;ctype.h\u0026gt;\n# include \u0026lt;conio.h\u0026gt;\nint main (void)\n{\n int n=0;\n char ch;\n clrscr();\n printf(\"Enter the SCRABBLE word\\n\");\n ch = getchar();\n while(ch!='\\n')\n {\n toupper(ch);\n if(ch =='A'||'E'||'I'||'L'||'N'||'O'||'R'||'S'||'T'||'U')\n n=n+1;\n else if (ch =='D'||'G')\n n=n+2;\n else if (ch =='B'||'C'||'M'||'P')\n n=n+3;\n else if (ch =='F'||'H'||'V'||'W'||'Y')\n n=n+4;\n else if (ch =='K')\n n=n+5;\n else if (ch =='J'||'X')\n n=n+8;\n else if (ch =='Q'||'Z')\n n=n+10;\n\n ch = getchar();\n }\n printf(\"The value is %d\",n);\n return 0;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo what happens when i run this code is that :\n \u003cstrong\u003eEnter the SCRABBLE word\u003c/strong\u003e\n eg: \u003cem\u003ebarrier\u003c/em\u003e\n \u003cstrong\u003eThe value is 7\u003c/strong\u003e\nthough it should be 9 as b carries 3 points as noted above the code,a carries 1,r carriers 1,again r 1 point,i carries 1 point and the last two alphabet are one point each so thats 3+1+1+1+1+1+1=9\u003c/p\u003e","answer_count":"2","comment_count":"7","creation_date":"2017-06-21 11:45:39.487 UTC","last_activity_date":"2017-06-22 02:34:40.07 UTC","last_edit_date":"2017-06-22 02:34:40.07 UTC","last_editor_display_name":"","last_editor_user_id":"8193823","owner_display_name":"","owner_user_id":"8193823","post_type_id":"1","score":"-3","tags":"c","view_count":"46"} +{"id":"23477411","title":"Using matrix column or rows to reference elements of a vector","body":"\u003cp\u003eI have a vector. I select groups of n=4 consecutive values using the matrix produced by \u003ccode\u003emapply(seq,starts,ends)\u003c/code\u003e. I use the matrix columns to reference elements in my vector \u003ccode\u003ey\u003c/code\u003e. Then I run the \u003ccode\u003emin\u003c/code\u003e function on the sub vectors to identify the minimum value in each group of elements.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eset.seed(30)\ny \u0026lt;- sample(100)\n # [1] 10 49 36 41 29 15 85 21 89 13 6 98 48 77 20 79 22 69\n # [19] 50 35 91 47 3 26 86 23 92 19 59 34 43 17 71 97 76 44\n # [37] 90 87 78 83 27 37 45 28 11 38 70 95 99 9 7 51 53 66\n # [55] 4 40 5 46 25 81 2 54 57 93 55 84 61 82 73 31 96 58\n # [73] 68 74 32 100 24 72 1 30 39 42 16 14 64 75 67 60 56 33\n # [91] 94 88 65 8 52 12 80 63 62 18\nx \u0026lt;- c(3,6,9,14,17,21,23)\nends \u0026lt;- x*4\nstarts \u0026lt;- ends - 3\nm \u0026lt;- mapply(seq,starts,ends)\n # [,1] [,2] [,3] [,4] [,5] [,6] [,7]\n# [1,] 9 21 33 53 65 81 89\n# [2,] 10 22 34 54 66 82 90\n# [3,] 11 23 35 55 67 83 91\n# [4,] 12 24 36 56 68 84 92\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFor example, the first column in m is 9,10,11,12. The goal is to reference the 9th through the 12th element of \u003ccode\u003ey\u003c/code\u003e and find out which of the 4 referenced element is the minimum. Then do the same thing with the rest of \u003ccode\u003em\u003c/code\u003e's columns, grouping \u003ccode\u003ey\u003c/code\u003e's elements based on \u003ccode\u003em\u003c/code\u003e columns. I attempted to use the following code, but it didn't produce the expected results. Instead it produced all ones, and it was very slow.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eoneU \u0026lt;- as.integer(sapply(m,function(i) which(y[i]==min(y[i]))))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe desired output is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e# [1] 3 3 4 3 1 4 2\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNote for the first group the minimum should be the 3rd element of the group, which is the 11th element of \u003ccode\u003ey\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eIs there an efficient way of employing matrix columns or rows to reference elements of a vector into groups, and then run a function on the resulting groups?\u003c/p\u003e","accepted_answer_id":"23481665","answer_count":"2","comment_count":"2","creation_date":"2014-05-05 16:33:18.47 UTC","last_activity_date":"2014-05-06 12:53:24.653 UTC","last_edit_date":"2014-05-05 17:29:04.057 UTC","last_editor_display_name":"","last_editor_user_id":"697568","owner_display_name":"","owner_user_id":"3507767","post_type_id":"1","score":"0","tags":"r","view_count":"515"} +{"id":"13905598","title":"in-app billing for subscriptions","body":"\u003cp\u003eI am planning to sell an android application on Google play with the subscription model as follows\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003e1.99/month (includes a 30 day free trial. The first billing date is set to today+30)\n-19.99/year (includes a 60 day free trial. the first billing date is set to today+60)\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eI have implemented the logic for this pricing and the application is working fine.\u003c/p\u003e\n\n\u003cp\u003eNow, I would like to offer an additional 30 days of free service to those customers that report an issue with using the application. In order to do this, I like to just update the next billing date. The question does google play allow such an update using google play server-side api? If yes, I may just develop a console app for and admin to add the 30 days to next billing date for the specific customer reporting the issue.\u003c/p\u003e\n\n\u003cp\u003eCan someone help me, if this approach works and point me with a link to server-side API and a sample showing how to consume? Alternatively, can someone suggest an alternative approach to meet this requirement\u003c/p\u003e\n\n\u003cp\u003eSrinivas \u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2012-12-16 21:22:53.59 UTC","last_activity_date":"2014-08-14 09:00:15.4 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1908474","post_type_id":"1","score":"2","tags":"in-app-billing|subscriptions","view_count":"478"} +{"id":"12377663","title":"jqGrid: Subgrid row displaying columns obtained in maingrid json","body":"\u003cp\u003eCan I have a subgrid that shows some of the columns from main grid without actually going and getting data again using URL?\nExample:Main Grid is getting data from server (10 columns) using jsonReader out of which I want to show 7 columns in the parent row and 3 columns in the subgrid row . Can I do this?\n(Or some other way to achieve this expand concept?)\u003c/p\u003e\n\n\u003cp\u003e(I tried the below with \"subGridRowExpanded\" function but it doesn't seem to be working...)\u003c/p\u003e\n\n\u003cp\u003eError: jQuery(\"#grid\").getRowData is not a function\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e-------------------------------------\nvar myGrid = jQuery(\"#grid\").jqGrid({\n\n...\nsubGrid: true,\n\nsubGridRowExpanded: function (subgridDivId, rowId) {\n var subgridTableId = subgridDivId + \"_t\";\n var rowData = $(\"#grid\").getRowData(rowId);\n var requestorFullName = rowData['requestorFullName'];\n var html =\"\u0026lt;table id='\" + subgridTableId + \"'\u0026gt; \u0026lt;tr\u0026gt;\u0026lt;td\u0026gt;'\" +requestorFullName+\"'\u0026lt;/td\u0026gt;\u0026lt;/tr\u0026gt; \u0026lt;/table\u0026gt;\";\n $(\"#\" + subgridDivId).append(html);\n\n}\n\n});\n\n-------------------------------------\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"2","creation_date":"2012-09-11 20:47:07.453 UTC","last_activity_date":"2013-01-07 13:28:18.967 UTC","last_edit_date":"2012-10-06 13:30:01.583 UTC","last_editor_display_name":"","last_editor_user_id":"366898","owner_display_name":"","owner_user_id":"1664012","post_type_id":"1","score":"0","tags":"jqgrid|subgrid","view_count":"880"} +{"id":"34028332","title":"C++ syntax to alias non-class overloaded function inside class","body":"\u003cp\u003eI know I can do \u003ccode\u003enamespace FILE { using boost::filesystem::rename };\u003c/code\u003e which I will do if there's no other solution, but wondering if I can get it inside the class so I can be DRY. I want to create a class called FILE and have no need for namespace FILE.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e// class-qualified name is required\nusing boost::filesystem::rename\n\n// definition not found\nvoid(*rename)(const path\u0026amp;, const path\u0026amp;) = boost::filesystem::rename;\n\n// cannot determine which overloaded instance\nfunction rename = std::mem_fn\u0026lt;void(const path\u0026amp;, const path\u0026amp;)\u0026gt;(boost::filesystem::rename);\n\n// not an alias, creates a new function\nfunction\u0026lt;void(const path\u0026amp;, const path\u0026amp;)\u0026gt; rename = [](const path\u0026amp; old_p, const path\u0026amp; new_p) { boost::filesystem::rename(old_p, new_p); };\n\n// all sorts of errors\nauto rename = std::mem_fn(static_cast\u0026lt;void()(const path\u0026amp;, const path\u0026amp;)\u0026gt;(\u0026amp;boost::filesystem::rename));\n\n// nope!\nvoid constexpr rename = boost::filesystem::rename\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am trying to do this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass FILE {\npublic:\n // Would like to alias boost::filesystem::rename as rename here\n};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat is the correct syntax?\u003c/p\u003e","accepted_answer_id":"34028516","answer_count":"2","comment_count":"11","creation_date":"2015-12-01 19:18:00.07 UTC","last_activity_date":"2015-12-01 19:58:22.553 UTC","last_edit_date":"2015-12-01 19:29:22.387 UTC","last_editor_display_name":"","last_editor_user_id":"2994459","owner_display_name":"","owner_user_id":"2994459","post_type_id":"1","score":"1","tags":"c++|function|class|alias","view_count":"141"} +{"id":"41541076","title":"Select all data different second between two date times","body":"\u003cp\u003eI have a mysql table with data connected to date and time. Each row has data and a date, like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edatetime name\n2009-06-25 10:00:00 jhon\n2009-06-25 10:00:05 jack\n2009-06-25 10:00:11 json\n2009-06-25 10:00:15 jack\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy problem is I need to get the rows different second date1 and date2 like this :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edatetime name second\n2009-06-25 10:00:00 jhon 0\n2009-06-25 10:00:05 jack 5\n2009-06-25 10:00:11 json 6\n2009-06-25 10:00:15 jack 4\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThank you\u003c/p\u003e","answer_count":"3","comment_count":"2","creation_date":"2017-01-09 04:32:50.513 UTC","favorite_count":"1","last_activity_date":"2017-01-09 05:08:49.913 UTC","last_edit_date":"2017-01-09 04:34:57.067 UTC","last_editor_display_name":"","last_editor_user_id":"3839187","owner_display_name":"","owner_user_id":"3839187","post_type_id":"1","score":"1","tags":"mysql|datetime|between","view_count":"51"} +{"id":"8008864","title":"CakePhp: Dont load some related tables","body":"\u003cp\u003eI've one model, which has several(6) linked tables.\u003c/p\u003e\n\n\u003cp\u003eMost of times, I use this model to display one data and I need all those data, but once, to provide data for an auto-complete field, I only need to have 2 tables linked to make my search. This request needs to be very fast because of the autocomplete and the very frequent usage of this request,\u003c/p\u003e\n\n\u003cp\u003eI know that I can disable the load of all items(with recursive =0), but not only disable(or enable) some relations.\u003c/p\u003e\n\n\u003cp\u003eSo how can I do this with cakePhp?\u003c/p\u003e\n\n\u003cp\u003eThank you!\u003c/p\u003e","accepted_answer_id":"8009197","answer_count":"1","comment_count":"0","creation_date":"2011-11-04 11:57:45.237 UTC","last_activity_date":"2011-11-04 12:30:03.353 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"397830","post_type_id":"1","score":"1","tags":"php|sql|cakephp|autocomplete","view_count":"98"} +{"id":"40773469","title":".NET Core on Mac for developing REST web service","body":"\u003cp\u003eI have a simple question:\nIs it possible to develop a REST web service on a Mac laptop, using the latest Core.NET and the new Mac Visual Studio tooling? The service is to be deployed in Window server/iis eventually, but I need productive environment.\u003c/p\u003e\n\n\u003cp\u003eAlso, as I will be interfacing with SharePoint 2013 server, will I be able to use the above environment for OAuth, claims, etc during Mac development cycles (e.g are the libraries/assemblies/whatever included in .NET Core for Mac)?\u003c/p\u003e\n\n\u003cp\u003eThank you.\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2016-11-23 20:19:02.743 UTC","last_activity_date":"2017-08-16 12:27:13.93 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3610608","post_type_id":"1","score":"0","tags":"asp.net|.net|osx|rest","view_count":"152"} +{"id":"23382430","title":"Rearranging div tags within one another","body":"\u003cp\u003eI want to rearrange the div tags (shown below) between one another. How can I do that?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"wrap\"\u0026gt;\n \u0026lt;div class=\"box\"\u0026gt;\n This has less height\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"box\"\u0026gt;\n This has more height\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"box\"\u0026gt;\n This has less height.\n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"3","creation_date":"2014-04-30 07:46:15.633 UTC","last_activity_date":"2014-04-30 08:48:07.147 UTC","last_edit_date":"2014-04-30 08:48:07.147 UTC","last_editor_display_name":"","last_editor_user_id":"3173290","owner_display_name":"","owner_user_id":"3588258","post_type_id":"1","score":"0","tags":"css","view_count":"37"} +{"id":"9817218","title":"How to integrate 3rd party merchant payment gateway in ubercart","body":"\u003cp\u003eI've been looking for 2 days on how to integrate my merchant payment gateway into ubercart with no lack. So I decided to ask it here.\u003c/p\u003e\n\n\u003cp\u003eI have the following code as an example from my merchant:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;form name=\"payFormCcard\" method=\"post\" action=\" https://test.MyMerchantGateway.com/ECN/eng/payment/payForm.jsp\"\u0026gt;\n\u0026lt;input type=\"hidden\" name=\"merchantId\" value=\"1\"\u0026gt; \n\u0026lt;input type=\"hidden\" name=\"amount\" value=\"3000.0\" \u0026gt;\n\u0026lt;input type=\"hidden\" name=\"orderRef\" value=\"000000000014\"\u0026gt;\n\u0026lt;input type=\"hidden\" name=\"currCode\" value=\"608\" \u0026gt;\n\u0026lt;input type=\"hidden\" name=\"successUrl\" value=\"http://www.yourdomain.com/Success.html\"\u0026gt;\n\u0026lt;input type=\"hidden\" name=\"failUrl\" value=\"http://www.yourdomain.com/Fail.html\"\u0026gt;\n\u0026lt;input type=\"hidden\" name=\"cancelUrl\" value=\"http://www.yourdomain.com/Cancel.html\"\u0026gt;\n\u0026lt;input type=\"hidden\" name=\"payType\" value=\"N\"\u0026gt;\n\u0026lt;input type=\"hidden\" name=\"lang\" value=\"E\"\u0026gt;\n\u0026lt;input type=\"submit\" name=\"submit\"\u0026gt;\n\u0026lt;/form\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ePlease note that I change the actual domain above for security reason.\u003c/p\u003e\n\n\u003cp\u003eWhat I want after checkout is redirect it to \u003ca href=\"https://test.MyMerchantGateway.com/ECN/eng/payment/payForm.jsp\" rel=\"nofollow\"\u003ehttps://test.MyMerchantGateway.com/ECN/eng/payment/payForm.jsp\u003c/a\u003e\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2012-03-22 06:03:11.717 UTC","favorite_count":"1","last_activity_date":"2012-07-16 23:52:15.047 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1034801","post_type_id":"1","score":"0","tags":"drupal|ubercart","view_count":"2279"} +{"id":"40112072","title":"Aggregate initialization of std::array of subobjects with nested initializer lists","body":"\u003cp\u003eWhat is the correct way to initialize an aggregate type (such as \u003ccode\u003estd::array\u003c/code\u003e) and its subobjects with nested braced initializer lists? I don't want to call the constructors of the sub-type(s) directly.\u003c/p\u003e\n\n\u003cp\u003eThis is a recurring issue and I'm always surprised that the code below doesn't work, since the type of the elements is specified, so the proper constructor can be deduced by the compiler.\u003c/p\u003e\n\n\u003cp\u003eNote that the example type \u003ccode\u003eA\u003c/code\u003e is not necessary to be an aggregate (but of course it must support braced initializer-lists).\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;array\u0026gt; \n\nstruct A\n{\n int values[4];\n};\n\nint main()\n{\n std::array\u0026lt;A, 2\u0026gt; arr{{ 0, 1, 2, 3 }, { 4, 5, 6, 7 }};\n\n // Works only if A is an aggregate, also looks confusing, I don't want to do this\n //std::array\u0026lt;A, 2\u0026gt; arr{ 0, 1, 2, 3, 4, 5, 6, 7 };\n\n // I don't want to do this neither\n //std::array\u0026lt;A, 2\u0026gt; arr{A{ 0, 1, 2, 3 }, A{ 4, 5, 6, 7 }};\n\n return 0;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut all I get is the error\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eerror: too many initializers for 'std::array\u0026lt;A, 2ul\u0026gt;'\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"40112151","answer_count":"1","comment_count":"0","creation_date":"2016-10-18 15:19:30.787 UTC","last_activity_date":"2016-10-18 16:05:26.377 UTC","last_edit_date":"2016-10-18 16:05:22.543 UTC","last_editor_display_name":"","last_editor_user_id":"3309790","owner_display_name":"","owner_user_id":"2430597","post_type_id":"1","score":"2","tags":"c++|initialization|initializer-list|initializer|stdarray","view_count":"92"} +{"id":"2520835","title":"How to implement a bidirectional \"mailbox service\" over tcp?","body":"\u003cp\u003eThe idea is to allow to peer processes to exchange messages (packets) over tcp as much asynchronously as possible.\u003c/p\u003e\n\n\u003cp\u003eThe way I'd like it to work is each process to have an outbox and an inbox. The send operation is just a push on the outbox. The receive operation is just a pop on the inbox. Underlying protocol would take care of the communication details.\u003c/p\u003e\n\n\u003cp\u003eIs there a way to implement such mechanism using a \u003cb\u003esingle TCP connection\u003c/b\u003e?\u003c/p\u003e\n\n\u003cp\u003eHow would that be implemented using BSD sockets and modern OO Socket APIs (like Java or C# socket API)?\u003c/p\u003e","accepted_answer_id":"2520866","answer_count":"1","comment_count":"0","creation_date":"2010-03-26 02:32:47.207 UTC","last_activity_date":"2010-03-26 02:41:40.88 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"298622","post_type_id":"1","score":"1","tags":"asynchronous|tcp|messages|bidirectional|packets","view_count":"274"} +{"id":"26736578","title":"javascript css3 change background color every 2 seconds","body":"\u003cp\u003eHow can I change the HTML background color automatically every 2 seconds? HTML5 with CSS3 fade in or fadeout?\u003c/p\u003e\n\n\u003cp\u003eI tried to use transition with timer and CSS target without any success\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003einput[type=checkbox] {\n position: absolute;\n top: -9999px;\n left: -9999px;\n}\n\nlabel {\n display: block;\n background: #08C;\n padding: 5px;\n border: 1px solid rgba(0,0,0,.1);\n border-radius: 2px;\n color: white;\n font-weight: bold;\n}\n\ninput[type=checkbox]:checked ~ .to-be-changed {\n color: red;\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"26737069","answer_count":"3","comment_count":"1","creation_date":"2014-11-04 13:40:39.367 UTC","favorite_count":"3","last_activity_date":"2017-02-09 23:15:52.147 UTC","last_edit_date":"2014-11-04 14:06:57.187 UTC","last_editor_display_name":"","last_editor_user_id":"1268716","owner_display_name":"","owner_user_id":"3934171","post_type_id":"1","score":"1","tags":"javascript|css|html5|transition|background-color","view_count":"3097"} +{"id":"864157","title":"Under what circumstances would [[NSScreen mainScreen] visibleFrame] return null?","body":"\u003cp\u003eI want to get the dimensions of the main screen, so I use this snippet:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eNSLog(@\"mainScreen frame = %@\", [[NSScreen mainScreen] visibleFrame]);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt's printing\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emainScreen frame = (null)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eEarlier it was printing the expected dimensions of my main monitor.\u003c/p\u003e\n\n\u003cp\u003eWhat are some possible causes of this?\u003c/p\u003e","accepted_answer_id":"864247","answer_count":"4","comment_count":"3","creation_date":"2009-05-14 15:51:38.69 UTC","favorite_count":"2","last_activity_date":"2015-03-20 13:10:10.523 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2959","post_type_id":"1","score":"2","tags":"objective-c|cocoa","view_count":"1523"} +{"id":"31427387","title":"how to create json from associate array","body":"\u003cp\u003eI am new to \u003ccode\u003ePHP\u003c/code\u003e. So bear with me. I have to fetch songs from db. I don't know how to \u003cstrong\u003einitialize associate array in a for loop\u003c/strong\u003e using \u003ccode\u003ekeyValuePair.\u003c/code\u003e and also add status attribute to it.\u003c/p\u003e\n\n\u003cp\u003eWhat i want is\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n \"status\" : \"true\" ,// It tells whether day available or not\n \"data\": [\n {\n \"name\": \"Joe Bloggs\",\n \"id\": \"203403465\"\n },\n {\n \"name\": \"Fred Bloggs\",\n \"id\": \"254706567\"\n },\n {\n \"name\": \"Barny Rubble\",\n \"id\": \"453363843\"\n },\n {\n \"name\": \"Homer Simpson\",\n \"id\": \"263508546\"\n }\n ]\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eMy Code\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$html = file_get_html('http://1stfold.com/taskbox/Farrukh/Zare/');\n\n$output = array();// how to initialze it in for loop with keyValue pair\n\n// Find all \"A\" tags and print their HREFs\nforeach($html-\u0026gt;find('.branded-page-v2-body a') as $e) \n{\n if (0 === strpos($e-\u0026gt;href, '/watch?v')) \n {\n $output[] = $e-\u0026gt;href . '\u0026lt;br\u0026gt;';\n\n echo $e-\u0026gt;href . '\u0026lt;br\u0026gt;';\n } \n}\necho json_encode($output);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks in Advance.\u003c/p\u003e","accepted_answer_id":"31427789","answer_count":"1","comment_count":"3","creation_date":"2015-07-15 10:05:27.23 UTC","last_activity_date":"2015-07-15 10:36:02.5 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4260932","post_type_id":"1","score":"0","tags":"php|json|associative-array","view_count":"54"} +{"id":"30492223","title":"How to display html, body and head tags in Sweet Alert?","body":"\u003cp\u003eI'm trying to do live preview of html code. It will be small code just for creating custom tickets template.\nI thought setting \u003ccode\u003ehtml: true\u003c/code\u003e will do the trick, but it removes \u003ccode\u003e\u0026lt;html\u0026gt;\u0026lt;head\u0026gt;\u0026lt;body\u0026gt;\u003c/code\u003e tags. If a have \u003ccode\u003e\u0026lt;style\u0026gt;\u003c/code\u003e in head Sweet Alert leave it there, which breaks my original css. I tried to wrap the code into \u003ccode\u003eiframe\u003c/code\u003e like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$('\u0026lt;iframe\u0026gt;').append($('textarea').val()).html()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut even iframe was removed.\u003c/p\u003e\n\n\u003cp\u003eSo again. I have a textarea -\u003e user types in the code which could look like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;html\u0026gt;\n\u0026lt;head\u0026gt;\n \u0026lt;style\u0026gt;\n h1 {color: white}\n ...\n \u0026lt;/style\u0026gt;\n\u0026lt;/head\u0026gt;\n\u0026lt;body\u0026gt;\n \u0026lt;h1\u0026gt;TICKET'S NAME\u0026lt;/h1\u0026gt;\n ...\n\u0026lt;/body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd after click on some button sweet alert appers with code preview.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eHow to force SA display html, head and body tags?\u003c/strong\u003e\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2015-05-27 20:10:07.417 UTC","last_activity_date":"2015-05-27 20:10:07.417 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3808179","post_type_id":"1","score":"1","tags":"jquery|html|sweetalert","view_count":"314"} +{"id":"35731681","title":"c# run an async task in background when parent returns","body":"\u003cp\u003eI am writing a MVC5 app that has a controller with a function say \u003ccode\u003eMethod1\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eI have a third party function that is \u003ccode\u003easync Task\u003c/code\u003e, let's call it \u003ccode\u003eDoMethodAsync\u003c/code\u003e (it essentially makes a POST call).\u003c/p\u003e\n\n\u003cp\u003eI want to call it right before returning from \u003ccode\u003eMethod1\u003c/code\u003e but I don't really care about the result of the async task, if it fails, it fails. How can I fire and forget and have it execute in the background so that it does not block the controller from responding to other requests? \u003c/p\u003e\n\n\u003cp\u003eHow can I ensure that \u003ccode\u003eDoMethodAsync\u003c/code\u003e is only executed after \u003ccode\u003eMethod1\u003c/code\u003e has returned? \u003c/p\u003e","answer_count":"3","comment_count":"3","creation_date":"2016-03-01 19:25:59.373 UTC","last_activity_date":"2016-03-01 21:00:07.823 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"643084","post_type_id":"1","score":"3","tags":"c#|asp.net-mvc|asynchronous","view_count":"2472"} +{"id":"18806176","title":"Placing buttons under the combo box","body":"\u003cp\u003eHow do i make the buttons appear under the combo box here? In other words have button 1 and button 2 right underneath the combo box?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class GUI extends JFrame implements ListSelectionListener, ActionListener {\n\n private JPanel myPanelA;\n private JSplitPane itemPane;\n\n public static void startWindowsGui ( ) { \n\n SwingUtilities.invokeLater ( new Runnable ( ) {\n public void run ( ) {\n\n GUI gui = new GUI ( );\n\n\n gui.setVisible ( true );\n }\n } );\n }\n\n public GUI() {\n\n // Set the layout to a grid\n setLayout ( new BorderLayout ( 5, 5 ) );\n\n\n setTitle ( \"UI \" );\n setSize ( 800, 600 );\n setDefaultCloseOperation ( EXIT_ON_CLOSE );\n setBackground ( new Color ( 15, 255, 10 ) );\n\n\n addComponents ( );\n }\n\n private void addComponents ( ) {\n\n JSplitPane mainPane = new JSplitPane ( JSplitPane.HORIZONTAL_SPLIT );\n itemPane = new JSplitPane ( JSplitPane.VERTICAL_SPLIT );\n\n mainPane.add ( PanelA ( ), JSplitPane.LEFT );\n mainPane.add ( itemPane, JSplitPane.RIGHT );\n mainPane.setOneTouchExpandable ( true );\n\n itemPane.setOpaque(true);\n itemPane.setBackground(new Color(0xffffffc0));\n BufferedImage myPicture = null;\n try {\n myPicture = ImageIO.read(new File(\"C:/Users/Desktop/image.jpg\"));\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n JLabel picLabel = new JLabel(new ImageIcon(myPicture));\n //add(picLabel);\n itemPane.add(picLabel);\n\n add ( mainPane, BorderLayout.CENTER );\n }\n\n\n private JPanel PanelA ( ) {\n\n myPanelA = new JPanel ( );\n\n\n myPanelA.setLayout ( new BorderLayout ( 0, 0 ) );\n\n\n myPanelA.add ( buttonPanel ( ), BorderLayout.NORTH );\n\n myPanelA.setBorder ( new EmptyBorder ( 0, 0, 0, 0 ) );\n myPanelA.setBackground(new Color(0,0,0));\n\n return myPanelA;\n }\n\n @Override\n public void actionPerformed(ActionEvent e) {\n\n\n }\n\n @Override\n public void valueChanged(ListSelectionEvent arg0) {\n\n\n }\n\n\n private JPanel buttonPanel ( ) {\n // Create the panel \n JPanel addButton = new JPanel ( );\n\n JPanel cards; //a panel that uses CardLayout\n String BUTTONPANEL = \"Card with JButtons\";\n String TEXTPANEL = \"Card with JTextField\";\n\n JPanel comboBoxPane = new JPanel(); //use FlowLayout\n String comboBoxItems[] = { BUTTONPANEL, TEXTPANEL };\n JComboBox cb = new JComboBox(comboBoxItems);\n cb.setEditable(false);\n //cb.addItemListener(this);\n comboBoxPane.add(cb);\n\n //Create the \"cards\".\n JPanel card1 = new JPanel();\n card1.add(new JButton(\"Button 1\"));\n card1.add(new JButton(\"Button 2\"));\n\n JPanel card2 = new JPanel();\n card2.add(new JTextField(\"TextField\", 10));\n\n //Create the panel that contains the \"cards\".\n cards = new JPanel(new CardLayout());\n cards.add(card1, BUTTONPANEL);\n cards.add(card2, TEXTPANEL);\n\n addButton.add(comboBoxPane, BorderLayout.PAGE_START);\n addButton.add(cards, BorderLayout.CENTER);\n\n return addButton;\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/MJ5XP.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e","accepted_answer_id":"18806229","answer_count":"2","comment_count":"0","creation_date":"2013-09-14 20:36:27.417 UTC","last_activity_date":"2013-09-14 20:49:22.84 UTC","last_edit_date":"2013-09-14 20:43:34.267 UTC","last_editor_display_name":"","last_editor_user_id":"418556","owner_display_name":"","owner_user_id":"1009669","post_type_id":"1","score":"0","tags":"java|swing|layout-manager","view_count":"95"} +{"id":"4843989","title":"Loop in SWI-PROLOG","body":"\u003cp\u003eI have to create a program, to simulate energy exchange between particles, \nlet me explaine: i have to create a list of 1000 particles each particle \nbegining with energy = 5 quanta, then I have to randomly select 2 particle \n(P1 and P2) to exchange one quanta of energy (E1-1 and E2+1) this would be 1 \nexchange, i have to do n exchange until reach the boltzmann distribuction. \u003c/p\u003e\n\n\u003cp\u003ekeeping in mind that a particle cannot exchange energy with itself, and a \nparticle cannot have energy \u0026lt; 1 quanta. \u003c/p\u003e\n\n\u003cp\u003e%Create a list (Particle/energ) [1/5,2/5,3/5...1000/5]. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efrom_to2(P1, P1000, List) :- \nbagof(N/5, between(P1,P1000,N), List),!. \nfrom_to2(_,_,[]).\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e%Exchange 1 quanta of energy between to particle: E1+1 , E2-1 \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eenergexchange(L1,L2):- \nchoose(L1,Px/Ex), \ndelete(Px/Ex,L1,Listsem1), \nchoose(Listsem1,Py/Ey), \ndelete(Py/Ey,Listsem1,Listsem2), \nEx \u0026gt; 1, Ex2 is Ex - 1, add(Px/Ex2,Listsem2,Listcom1), \nEy2 is Ey + 1, add(Py/Ey2,Listcom1,L2).\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eexample:\n?-from_to2(1,1000,L), energexchange(L,L2). \ngives L2= [3/4,1/6,2/5,4/5,5/5...1000/5]\u003c/p\u003e\n\n\u003cp\u003eL2 is the first exchange now I need to use L2 in the next exchange, energexchange(L2,L3). to do the second exchange and so on... \u003c/p\u003e\n\n\u003cp\u003eWhat should I do to repeat energexchange 1000 times without counting the fails (when Ex=1)?\u003c/p\u003e","answer_count":"2","comment_count":"1","creation_date":"2011-01-30 16:30:13.03 UTC","last_activity_date":"2011-01-31 14:49:02.503 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"595916","post_type_id":"1","score":"1","tags":"loops|prolog","view_count":"2172"} +{"id":"34833808","title":"How do i link my \"add to cart\" button to a specific on page tab and scroll to it when clicked?","body":"\u003cp\u003e\u003ca href=\"https://stackoverflow.com/questions/34742552/how-to-change-woocommerce-add-to-cart-button-based-on-availability\"\u003ePreviously\u003c/a\u003e I was trying to create and alternate \"add to cart\" button on the single-product-page of a Woocommerce website. Now, I would like that button to link to a tab on the same page, have the page scroll down and switch to that tab when the button is clicked. \u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://jsfiddle.net/Pr9hj/\" rel=\"nofollow noreferrer\"\u003eThis\u003c/a\u003e is exactly what I need to happen but I do no know how to implement it in the wordpress setting. \u003c/p\u003e\n\n\u003cp\u003eSo I settled for creating a js script by suggestion of this \u003ca href=\"https://wordpress.org/support/topic/how-to-link-to-a-product-tab?replies=18\" rel=\"nofollow noreferrer\"\u003eplace\u003c/a\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;script type=\"text/javascript\"\u0026gt;\n if ( location.href.match(/#tab-reviews/g) !== null ) {\n jQuery( '#tab-reviews' ).show();\n jQuery( 'li.reviews_tab a' ).trigger('click');\n }\n\u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThen I called it into word press through the funtion.php file with this, but its not working.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction tab_scroll() {\nwp_enqueue_script('custom-script', \n get_stylesheet_directory_uri() . '/tab_scroll.js', \n array( 'jquery' ));\n}\nadd_action( 'wp_enqueue_scripts', 'tab_scroll' );\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI dont know if its the way i called the script or just that the script is not written to suit my needs or even written properly\u003c/p\u003e\n\n\u003cp\u003eWhat I would like is some help/suggestions on making the \u003ca href=\"http://jsfiddle.net/Pr9hj/\" rel=\"nofollow noreferrer\"\u003efirst\u003c/a\u003e script work for me. And help on bringing into wordpress.\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2016-01-17 00:36:52.333 UTC","last_activity_date":"2016-01-17 00:36:52.333 UTC","last_edit_date":"2017-05-23 12:23:28.863 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"2014990","post_type_id":"1","score":"1","tags":"javascript|wordpress|woocommerce","view_count":"45"} +{"id":"17660892","title":"Android: How to make merge multiple bitmap images to a large jpeg image","body":"\u003cp\u003eI am going to merge multiple bitmap images to a jpeg image.\u003c/p\u003e\n\n\u003cp\u003eI can make large .bmp file from multiple bitmap images(tiled).\nAnd I can convert it to jpeg file with jpeg library.\u003c/p\u003e\n\n\u003cp\u003eBut the speed of this process is very slow.\nI tested this on my SamSung phone.\u003c/p\u003e\n\n\u003cp\u003eIt takes about 15 secs to make a large bitmap with tiled bmp images.\nIs there any way to solve this?\u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-07-15 18:08:46.51 UTC","last_activity_date":"2013-07-15 18:22:58.783 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2584558","post_type_id":"1","score":"0","tags":"android|bitmap","view_count":"1005"} +{"id":"20351648","title":"Convert URL to correct filename (Linux/Windows)","body":"\u003cp\u003eI have a script that works with different sites. As a result this script returns 1 csv file for 1 site with a unique filename, based on site URL. Site URL may be different, like\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ehttp://test1.com\nhttp://test2.com/testurl\nhttp://test3.com/test/path/\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to convert URLs to filenames - to remove all characters that can cause conflict in Linux/Windows, to replace them with '_', for example\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ehttp://test1.com will be test1com.csv\nhttp://test2.com/testurl will be test2comtesturl.csv\nhttp://test3.com/test/path/ will be test3comtestpath.csv\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI can try to use parse_url and concat host and path with replacing '/' and '.' to '_', but I'm not sure that this is the best solution, because URLs can be different and with different characters that can not be used as filename.\u003c/p\u003e","answer_count":"1","comment_count":"4","creation_date":"2013-12-03 12:47:50.617 UTC","last_activity_date":"2013-12-03 12:50:19.92 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1650332","post_type_id":"1","score":"1","tags":"php","view_count":"273"} +{"id":"31256606","title":"How to reverse a array of chars and then store the reversed array of char to another array?","body":"\u003cp\u003eI have been working on this very simple question. I am trying to reverse a array of chars and then store this reversed array of chars into another array using c language. Here is my code, I can not figure out what is the problem of my code. I really do not understand why when I try to print out my stcp which is the array with the reversed string, there is nothing show up on the screen. Please advice, any help would be really appreciate.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include\u0026lt;stdio.h\u0026gt;\n\nint main() {\n char st[100];\n scanf(\"%s\", st);\n int count = 0;\n while(st[count] != '\\0'){\n count++;\n }\n\n //printf(\"%s\", st);\n char stcp[100];\n int i, j = 0;\n for(i = count-1; i \u0026gt;= 0; i--){\n st[i] = stcp[j];\n j++;\n }\n\n puts(stcp);\n return 0;\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"3","creation_date":"2015-07-06 22:16:50.393 UTC","last_activity_date":"2015-07-06 22:32:39.357 UTC","last_edit_date":"2015-07-06 22:32:39.357 UTC","last_editor_display_name":"","last_editor_user_id":"2877241","owner_display_name":"","owner_user_id":"4557674","post_type_id":"1","score":"0","tags":"c|arrays|string|reverse","view_count":"1516"} +{"id":"2846151","title":"Column locking in innodb?","body":"\u003cp\u003eI know this sounds weird, but apparently one of my columns is locked.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eselect * from table where type_id = 1 and updated_at \u0026lt; '2010-03-14' limit 1;\n\nselect * from table where type_id = 3 and updated_at \u0026lt; '2010-03-14' limit 10;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethe first one would not finish running even in a few hours, while the second one completes smoothly. the only difference is the type_id between the 2 queries. \u003c/p\u003e\n\n\u003cp\u003ea bit of background, the first statement screwed up before which i had to kill manually. \u003c/p\u003e\n\n\u003cp\u003eThanks in advance for your help - i have an urgent data job to finish, and this problem is driving me crazy\u003c/p\u003e","accepted_answer_id":"2851232","answer_count":"3","comment_count":"0","creation_date":"2010-05-17 00:50:51.753 UTC","last_activity_date":"2010-05-17 17:24:23.027 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"180663","post_type_id":"1","score":"0","tags":"mysql|locking|innodb|database-administration","view_count":"1359"} +{"id":"12064811","title":"Setting a delay with clearTimeout for a drop down menu","body":"\u003cp\u003eI'm very new to Javascript, and I'm trying to set a delay on some drop down menus. I have jQuery loaded and am currently using the delay method. However, I did some looking around and it seems like there's no way to cancel the timer with delay, which means that I end up with a bunch of uncollapsed dropdowns. \u003c/p\u003e\n\n\u003cp\u003eHow do I set this up so that I can set a delay and have it cancel on mouseout?\u003c/p\u003e\n\n\u003cp\u003eHere's my code (note that the $$'s are for jQuery noconflict):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$$(function(){\n $$('#custommenu\u0026gt;div.menu').mouseover(function(){\n $$('#custommenu\u0026gt;div.menu').removeClass('active'); \n $$('#popup'+$$(this).attr('id').replace('menu','')).delay(500).slideDown(100);\n });\n\n $$('#custommenu\u0026gt;div.menu').mouseout(function(){\n $$('#custommenu .wp-custom-menu-popup').hide();\n\n });\n\n $$('#custommenu .wp-custom-menu-popup').mouseout(function(){\n $$('#custommenu\u0026gt;div.menu').removeClass('active');\n $$('#custommenu .wp-custom-menu-popup').hide();\n });\n\n $$('#custommenu .wp-custom-menu-popup').mouseover(function(){\n $$('#menu'+$$(this).attr('id').replace('popup','')).addClass('active');\n $$(this).show();\n });\n});\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"12064837","answer_count":"1","comment_count":"0","creation_date":"2012-08-22 00:17:32.08 UTC","last_activity_date":"2012-08-22 00:21:09.627 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1615575","post_type_id":"1","score":"0","tags":"jquery|drop-down-menu|delay","view_count":"293"} +{"id":"44633106","title":"Implement \"Catch Block\" like behavior in Spring using AOP","body":"\u003cp\u003eI'm working on Spring application and I want to implement exception handling in following way:\nImplement an Aspect class for specific exception type where that exception is diverted\nHave such aspect classes based on exception types hierarchy and implement catch block like behavior \nfor example,\nthere're two aspect classes: ExceptionHandler for Exception and SQLExceptionHandler for SQLException\nBoth of them are exactly same pointcut expression.\nNow, if SQLException is raised from any method which is covered in point expression, SQLExceptionHandler's method should be executed.\nIf FileNotFoundException or any other type of exception occurs then ExceptionHandler's method should be executed.\nAny help would be much appreciated.\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2017-06-19 14:21:20.443 UTC","last_activity_date":"2017-07-12 07:27:39.623 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4174478","post_type_id":"1","score":"0","tags":"spring|exception-handling|spring-aop","view_count":"38"} +{"id":"40475480","title":"ffmpeg - convert image sequence to video with reversed order","body":"\u003cp\u003eLooking at \u003ca href=\"https://trac.ffmpeg.org/wiki/Create%20a%20video%20slideshow%20from%20images\" rel=\"nofollow noreferrer\"\u003ethe docs\u003c/a\u003e, it is not apparent to me whether ffmpeg would allow me to convert an image sequence to a video in reverse order, for example using this sequence:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eframe-1000.jpg\nframe-999.jpg\nframe-998.jpg\n...\nframe-1.jpg\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs it possible to give a \"step direction\" for the frame indices?\u003c/p\u003e","accepted_answer_id":"40479257","answer_count":"2","comment_count":"0","creation_date":"2016-11-07 22:02:56.243 UTC","last_activity_date":"2017-04-08 23:35:47.023 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"515054","post_type_id":"1","score":"2","tags":"ffmpeg","view_count":"739"} +{"id":"19131037","title":"edit each row in html using javascript","body":"\u003cp\u003eHelp! I can't edit the other rows on my table\u003c/p\u003e\n\n\u003cp\u003ehere is my script.. and it's working. but only on the first row.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;script\u0026gt;\nfunction showInput(e)\n{\ndocument.getElementById(e.id).type = \"text\";\ndocument.getElementById(e.id).focus();\n}\n\u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand here is my table. coming from my database.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;table class=\"table table-bordered\"\u0026gt;\n\u0026lt;tr class=\"green\"\u0026gt;\n \u0026lt;th\u0026gt;Job Title\u0026lt;/th\u0026gt;\n \u0026lt;th\u0026gt;Job Description\u0026lt;/th\u0026gt;\n \u0026lt;th colspan=\"2\"\u0026gt;actions\u0026lt;/th\u0026gt;\n \u0026lt;/tr\u0026gt;\n\u0026lt;?php foreach ($fill_data as $row): ?\u0026gt;enter code here\n\n\n\u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;\n \u0026lt;?php echo $row['title'];?\u0026gt;\n \u0026lt;div style=\"position:absolute; margin-top:-20px; margin-left:4px;\"\u0026gt;\n \u0026lt;input type=\"hidden\" id=\"\u0026lt;?php echo $row['title'];?\u0026gt;\" name=\"\u0026lt;?php echo $row['title'];?\u0026gt;\" value=\"\u0026lt;?php echo $row['title'];?\u0026gt;\"\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;?php echo $row['description'];?\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;td width=\"40px\"\u0026gt;\u0026lt;img src=\"\u0026lt;?php echo base_url(); ?\u0026gt;images/edit1.png\" width=\"30\" height=\"30\" title=\"Edit\" onclick=\"showInput(\u0026lt;?php echo $row['title'];?\u0026gt;)\" style=\"cursor: pointer\"\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;img data-toggle=\"modal\" data-id=\"\u0026lt;?php echo $row['id']?\u0026gt;\" class=\"delete-data\" href=\"#delete\" style=\"margin-top: 5px; cursor:pointer\" height=\"15\" width=\"15\" src=\"\u0026lt;?php echo base_url(); ?\u0026gt;images/remove.gif\"\u0026gt;\u0026lt;/td\u0026gt;\n\u0026lt;/tr\u0026gt;\n\u0026lt;?php endforeach?\u0026gt;\n\u0026lt;/table\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethe $rows comes from my database.\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2013-10-02 06:22:07.09 UTC","last_activity_date":"2013-10-02 07:02:43.877 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2789695","post_type_id":"1","score":"0","tags":"javascript|php","view_count":"106"} +{"id":"17686998","title":"How to show recorded value in Edit Ruby on Rails","body":"\u003cp\u003eI have a master detail working, but when I go to the edit form the select field isn't shown as recorded in the database, it's showing the first \u003ccode\u003eoption_for_select\u003c/code\u003e: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class='fields'\u0026gt;\n \u0026lt;div class='span-24 last'\u0026gt;\n \u0026lt;div class='span-11'\u0026gt;\n \u0026lt;%= f.select :ordem, options_for_select([[\"0\", 0], [\"1\", 1], [\"2\", 2], [\"3\", 3], [\"4\", 4], [\"5\", 5]]) %\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class='span-8'\u0026gt;\u0026lt;%= f.text_field :opcao %\u0026gt;\u0026lt;/div\u0026gt;\n\n \u0026lt;div class='last'\u0026gt;\n \u0026lt;%= f.hidden_field :_destroy %\u0026gt; \n \u0026lt;%= link_to_function '(X)', \"remove_fields(this)\" %\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo what do I have to do to show the recorded content for this select?\u003c/p\u003e","accepted_answer_id":"17687341","answer_count":"1","comment_count":"0","creation_date":"2013-07-16 21:07:20.57 UTC","last_activity_date":"2013-07-18 18:31:45.193 UTC","last_edit_date":"2013-07-18 18:31:45.193 UTC","last_editor_display_name":"","last_editor_user_id":"359957","owner_display_name":"","owner_user_id":"2589059","post_type_id":"1","score":"1","tags":"ruby-on-rails|ruby-on-rails-3","view_count":"67"} +{"id":"25354805","title":"How do I use the command \"heroku pg:transfer\"?","body":"\u003cp\u003eI am very new to heroku/ruby on rails and git. I just went through Michael Hartl's Ruby on Rails tutorial and want to push my local database to heroku but am having trouble. \u003c/p\u003e\n\n\u003cp\u003eAfter doing some research I found this article:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://www.higherorderheroku.com/articles/pgtransfer-is-the-new-taps/\" rel=\"nofollow\"\u003epg transfer is the new taps\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eIt seems like it should work, but I do not understand how to set my env var \u003ccode\u003eDATABASE_URL\u003c/code\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$ env DATABASE_URL=postgres://localhost/someapp-dev heroku pg:transfer\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSpecifically I have no idea what I am supposed to directly copy and what to change. I believe I need to enter my own local host and my own database name. \u003c/p\u003e\n\n\u003cp\u003eIs this correct? If so how do I find my localhost and how do I find my database name? \u003c/p\u003e\n\n\u003cp\u003eMy database.yml file looks like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edevelopment:\n adapter: sqlite3\n database: db/development.sqlite3\n pool: 5\n timeout: 5000\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"3","creation_date":"2014-08-18 00:09:30.45 UTC","last_activity_date":"2014-08-18 01:16:13.927 UTC","last_edit_date":"2014-08-18 01:16:13.927 UTC","last_editor_display_name":"","last_editor_user_id":"585456","owner_display_name":"","owner_user_id":"3911994","post_type_id":"1","score":"1","tags":"ruby-on-rails|ruby|git|postgresql|heroku","view_count":"261"} +{"id":"5491389","title":"CakePHP - Html-\u003elink - why use controller=\u003e and action=\u003e instead of just controller/action","body":"\u003cp\u003e\u003cstrong\u003eWhy this:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eecho $this-\u0026gt;Html-\u0026gt;link('Add a User', array('controller'=\u0026gt;'users', 'action'=\u0026gt;'add'));\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eInstead of just this:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eecho $this-\u0026gt;Html-\u0026gt;link('Add a User', 'users/add');\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"5491498","answer_count":"2","comment_count":"0","creation_date":"2011-03-30 19:39:32.257 UTC","last_activity_date":"2015-04-07 04:53:13.97 UTC","last_edit_date":"2014-10-09 18:32:03.317 UTC","last_editor_display_name":"","last_editor_user_id":"759866","owner_display_name":"","owner_user_id":"673664","post_type_id":"1","score":"4","tags":"php|cakephp|cakephp-1.3","view_count":"7734"} +{"id":"44617797","title":"Google cloud compute engine high latency","body":"\u003cp\u003eI just started using google cloud, and I've been having issues with my instance. The connection is really unstable and has really high ping. Used speedtest to test it, and has over 150 ms. Is this normal? It shouldnt be. I'd appreciate anyones help.\u003c/p\u003e","answer_count":"0","comment_count":"4","creation_date":"2017-06-18 17:42:36.333 UTC","favorite_count":"1","last_activity_date":"2017-06-18 17:42:36.333 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"8179674","post_type_id":"1","score":"2","tags":"google-cloud-platform","view_count":"118"} +{"id":"14071320","title":"rotation along x and y axis","body":"\u003cp\u003eI'm using GLKit along with PowerVR library for my opengl-es 2.0 3D app. The 3D scene loads with several meshes, which simulate a garage environment. I have a car in the center of the garage. I am trying to add touch handling to the app, where the user can rotate the room around (e.g., to see all 4 walls surrounding the car). I also want to allow a rotation on the x axis, though limited to a small range. Basically they can see from a little bit of the top of the car to just above the floor level.\u003c/p\u003e\n\n\u003cp\u003eI am able to rotate on the Y OR on the X, but not both. As soon as I rotate on both axis, the car is thrown off-axis. The car isn't level with the camera anymore. I wish I could explain this better, but hopefully you guys will understand.\u003c/p\u003e\n\n\u003cp\u003eHere is my touches implementation:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {\n\n UITouch * touch = [touches anyObject];\n CGPoint location = [touch locationInView:self.view]; \n CGPoint lastLoc = [touch previousLocationInView:self.view];\n CGPoint diff = CGPointMake(lastLoc.x - location.x, lastLoc.y - location.y);\n\n float rotX = -1 * GLKMathDegreesToRadians(diff.x / 4.0);\n float rotY = GLKMathDegreesToRadians(diff.y / 5.0);\n\n PVRTVec3 xAxis = PVRTVec3(1, 0, 0);\n PVRTVec3 yAxis = PVRTVec3(0,1,0);\n\n PVRTMat4 yRotMatrix, xRotMatrix;\n\n // create rotation matrices with angle\n PVRTMatrixRotationXF(yRotMatrix, rotY);\n PVRTMatrixRotationYF(xRotMatrix, -rotX);\n\n _rotationY = _rotationY * yRotMatrix;\n _rotationX = _rotationX * xRotMatrix;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere's my update method:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e- (void)update {\n\n // Use the loaded effect\n m_pEffect-\u0026gt;Activate();\n\n\n PVRTVec3 vFrom, vTo, vUp;\n VERTTYPE fFOV;\n vUp.x = 0.0f;\n vUp.y = 1.0f;\n vUp.z = 0.0f;\n\n // We can get the camera position, target and field of view (fov) with GetCameraPos()\n fFOV = m_Scene.GetCameraPos(vFrom, vTo, 0);\n\n /*\n We can build the world view matrix from the camera position, target and an up vector.\n For this we use PVRTMat4LookAtRH().\n */\n m_mView = PVRTMat4::LookAtRH(vFrom, vTo, vUp);\n\n // rotate the camera based on the users swipe in the X direction (THIS WORKS)\n m_mView = m_mView * _rotationX;\n\n // Calculates the projection matrix\n bool bRotate = false;\n m_mProjection = PVRTMat4::PerspectiveFovRH(fFOV, (float)1024.0/768.0, CAM_NEAR, CAM_FAR, PVRTMat4::OGL, bRotate);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI've tried multiplying the new X rotation matrix to the current scene rotation first, and then multiplying the new Y rotation matrix second. I've tried the reverse of that, thinking the order of multiplication was my problem. That didn't help. Then I tried adding the new X and Y rotation matrices together before multiplying to the current rotation, but that didn't work either. I feel that I'm close, but at this point I'm just out of ideas.\u003c/p\u003e\n\n\u003cp\u003eCan you guys help? Thanks. -Valerie\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eUpdate:\u003c/strong\u003e In an effort to solve this, I'm trying to simplify it a little. I've updated the above code, removing any limit in the range of the Y rotation. Basically I calculate the X and Y rotation based on the user swipe on the screen. \u003c/p\u003e\n\n\u003cp\u003eIf I understand this correctly, I think I want to rotate the View matrix (camera/eye) with the calculation for the _rotationX. \u003c/p\u003e\n\n\u003cp\u003eI think I need to use the World matrix (origin 0,0,0) for the _rotationY calculation. I'll try and get some images of exactly what I'm talking about.\u003c/p\u003e","accepted_answer_id":"14084821","answer_count":"1","comment_count":"0","creation_date":"2012-12-28 14:52:53.007 UTC","last_activity_date":"2012-12-29 18:45:17.603 UTC","last_edit_date":"2012-12-29 03:59:45.12 UTC","last_editor_display_name":"","last_editor_user_id":"574623","owner_display_name":"","owner_user_id":"574623","post_type_id":"1","score":"1","tags":"ios|opengl-es-2.0|powervr-sgx","view_count":"375"} +{"id":"32443890","title":"How to make Google map fill available height between dynamic header and footer","body":"\u003cp\u003eI have a header and footer, each with dynamic content. This is actually an aspx page with a master page which contains header/footer content which may vary in size. I can not enforce a px height for header or footer as they may have images or just text, etc. I want to make the Google map fill the available page height (and width) between them. I'll give the map canvas a minimum height of say 200px, just in case, but otherwise it should force the footer to bottom of the page without scrolling (unless the screen is short enough for the 200px minimum to require scrolling).\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;body\u0026gt;\n\u0026lt;div id=\"wrapper\"\u0026gt;\n \u0026lt;div id=\"header\"\u0026gt;Title\u0026lt;br /\u0026gt;of\u0026lt;br /\u0026gt;variable\u0026lt;br/\u0026gt;height\u0026lt;/div\u0026gt;\n \u0026lt;div id=\"body\"\u0026gt;\n \u0026lt;div id=\"map-canvas\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div id=\"footer\"\u0026gt;\n Footer\u0026lt;br /\u0026gt;of\u0026lt;br /\u0026gt;variable\u0026lt;br /\u0026gt;height\n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003c/p\u003e\n\n\u003cp\u003eHere is a Fiddle showing it very close using flex approach... It seems to work in Chrome/FireFox but this does not work in IE11.\n\u003ca href=\"https://jsfiddle.net/randbrown/7dc8u6ja/4/\" rel=\"nofollow\"\u003ehttps://jsfiddle.net/randbrown/7dc8u6ja/4/\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eIs the flex-based approach best for this and if so what am I missing to get it working in IE? Or is there a better way to achieve this?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-09-07 17:53:41.91 UTC","last_activity_date":"2015-09-09 14:24:28.733 UTC","last_edit_date":"2015-09-08 03:20:14.767 UTC","last_editor_display_name":"","last_editor_user_id":"1213296","owner_display_name":"","owner_user_id":"438365","post_type_id":"1","score":"-1","tags":"html|css|google-maps|flexbox","view_count":"1187"} +{"id":"46786847","title":"How can I read single-channel 32-bit integer images with python?","body":"\u003cp\u003eI want to read single-channel 32-bit integer image saved as ssv file.\nI have tried so far(see the following code) but without much success. \u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/J1LEG.png\" rel=\"nofollow noreferrer\"\u003eHere is the code\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003ePlease let me know if you have any idea of what is missing?\u003c/p\u003e","accepted_answer_id":"46792308","answer_count":"1","comment_count":"2","creation_date":"2017-10-17 09:26:28.537 UTC","last_activity_date":"2017-10-17 14:14:08.91 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"8287770","post_type_id":"1","score":"-1","tags":"python|numpy|import|text-files","view_count":"27"} +{"id":"24650309","title":"Update cannot proceed due to validation errors.","body":"\u003cp\u003ebelow is my code \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCREATE TABLE [dbo].[tbl_company] (\n [Id] INT IDENTITY (1, 1) NOT NULL,\n [company_Id] INT NOT NULL,\n [typeOfCompany] VARCHAR (250) NULL,\n [ownership_Id] INT NULL, \n CONSTRAINT [PK_tbl_company] PRIMARY KEY ([Id])\n);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ei am getting below error:\nThe referenced table '[dbo].[tbl_company]' contains no primary or candidate keys that match the referencing column list in the foreign key. If the referenced column is a computed column, it should be persisted.\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2014-07-09 09:43:50.89 UTC","last_activity_date":"2014-07-09 09:50:35.91 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3819789","post_type_id":"1","score":"0","tags":"sql-server","view_count":"626"} +{"id":"15060218","title":"how to add bootstrap responsive features to my navigation without changing my styling","body":"\u003cp\u003eI'm working on a navigation and I want to add bootstrap responsive feature to it, but without changing my original styling, like color, height and etc. appreciate if any one can help me on this.\u003c/p\u003e\n\n\u003cp\u003ebelow is the navigation mark up.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;header id=\"pageHeader\"\u0026gt;\n \u0026lt;div class=\"container\"\u0026gt;\n \u0026lt;div id=\"logo\"\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div id=\"navMain\"\u0026gt;\n \u0026lt;ul id=\"navContainer\"\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a class=\"selected\" href=\"index.html\"\u0026gt;HOME\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"about.html\"\u0026gt;ABOUT\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"services.html\"\u0026gt;SERVICES\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"portfolio.html\"\u0026gt;PORTFOLIO\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"contact.html\"\u0026gt;CONTACT\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/header\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand this is the styling I have used.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#pageHeader{\n background-color: rgb(250,210,0);\n width: 100%;\n}\n/* 3.2. Logo Styling */\n#logoTop{\n float:left;\n}\n/* 3.3. Main Navigation Styling */ \n#navMain{\n float: right;\n position: relative;\n margin: 84px 10px 21px 10px;\n}\nul#navContainer{\n display: block;\n position: inherit;\n}\n#navMain ul li{\n float: left;\n display: block;\n margin: 0px auto;\n font-weight: bold;\n list-style-image: none;\n}\n#navMain ul li a{\n color: rgb(99,99,99);\n font-size: 18px;\n padding: 10px 3px 10px 12px;\n font-family: \"nexa_500\", Tahoma, Geneva, sans-serif;\n font-size: 16px;\n text-transform: uppercase;\n text-decoration: none;\n -webkit-transition: color ease 0.7s;\n -moz-transition: color ease 0.7s;\n -o-transition: color ease 0.7s;\n transition: color ease 0.7s;\n}\n#navMain li a:hover,\n#navMain li a:active {\n text-decoration: none;\n color: rgb(33,33,33);\n -webkit-transition: color ease 0.7s;\n -moz-transition: color ease 0.7s;\n -o-transition: color ease 0.7s;\n transition: color ease 0.7s;\n}\n#navMain ul li a.selected{\n color: rgb(33,33,33);\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"15060401","answer_count":"1","comment_count":"2","creation_date":"2013-02-25 04:39:02.817 UTC","last_activity_date":"2013-02-25 04:58:48.277 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1184185","post_type_id":"1","score":"0","tags":"html5|css3|twitter-bootstrap|navigation|responsive-design","view_count":"336"} +{"id":"16834588","title":"-Wsign-compare warning in g++","body":"\u003cp\u003eI have a code which uses comparison of 64-bit integers. It looks similar to the following:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;cstdio\u0026gt;\n\nlong long getResult()\n{\n return 123456LL;\n}\n\nint main()\n{\n long long result = getResult();\n\n if (result \u0026gt; 0x000FFFFFFFFFFFFFLL\n || result \u0026lt; 0xFFF0000000000000LL)\n {\n printf(\"Something is wrong.\\n\");\n\n if (result \u0026gt; 0x000FFFFFFFFFFFFFLL\n || result \u0026lt; -4503599627370496LL)\n {\n printf(\"Additional check failed too.\\n\");\n }\n else\n {\n printf(\"Additional check went fine.\\n\");\n }\n }\n else\n {\n printf(\"Everything is fine.\\n\");\n }\n\n return 0;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen this code is compiled in g++ (tried different versions on Ubuntu 12.04 x64: 4.6.3, 4.6.4, 4.7.3, 4.8.0) with flags -Wall -pedantic -std=c++0x test.cpp -o test I get -Wsign-compare warning for second line of the first if statement (output from g++-4.8):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etest.cpp:13:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]\n || result \u0026lt; 0xFFF0000000000000LL)\n ^\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd when the test program is run I get two lines of text:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSomething is wrong.\nAdditional check went fine.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen compiling same code on Windows using MS Visual Studio 11 Express Update 2 with default project options for either x86 or x64 architecture I don't get neither the warning nor this output, instead the output is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eEverything is fine.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs it a problem in the code? If yes, could you point it? Or is it a problem with the compiler used?\u003c/p\u003e\n\n\u003cp\u003eAdding additional type cast for the second constant in the first if statement removes the warning in g++.\u003c/p\u003e","accepted_answer_id":"16836918","answer_count":"1","comment_count":"3","creation_date":"2013-05-30 11:08:43.197 UTC","favorite_count":"2","last_activity_date":"2013-05-30 23:52:00.11 UTC","last_edit_date":"2013-05-30 14:00:33.91 UTC","last_editor_display_name":"","last_editor_user_id":"46642","owner_display_name":"","owner_user_id":"2436121","post_type_id":"1","score":"9","tags":"c++|c++11|g++","view_count":"1322"} +{"id":"34356324","title":"Setting \"On start\" fragment","body":"\u003cp\u003eI want to set a specific fragment to start when opening my app.\nThere's a built-in layout called \"content_home\" which I don't know how to delete and I think it's the one which opened at start.\u003c/p\u003e\n\n\u003cp\u003eNow when I open the app, I see a blank screen, then I open the drawer and click on \"Home\" which I want to be opened as default, without calling it.\u003c/p\u003e\n\n\u003ch1\u003eHomeActivity.java\u003c/h1\u003e\n\n\u003cp\u003e\u003cdiv class=\"snippet\" data-lang=\"js\" data-hide=\"false\"\u003e\r\n\u003cdiv class=\"snippet-code\"\u003e\r\n\u003cpre class=\"snippet-code-js lang-js prettyprint-override\"\u003e\u003ccode\u003eimport android.app.Fragment;\r\nimport android.app.FragmentManager;\r\nimport android.content.Intent;\r\nimport android.os.Bundle;\r\nimport android.support.design.widget.NavigationView;\r\nimport android.support.v4.view.GravityCompat;\r\nimport android.support.v4.widget.DrawerLayout;\r\nimport android.support.v7.app.ActionBarDrawerToggle;\r\nimport android.support.v7.app.AppCompatActivity;\r\nimport android.support.v7.widget.Toolbar;\r\nimport android.view.Menu;\r\nimport android.view.MenuItem;\r\nimport android.widget.TextView;\r\n\r\npublic class HomeActivity extends AppCompatActivity\r\n implements NavigationView.OnNavigationItemSelectedListener {\r\n\r\n private NavigationView navigationView;\r\n private DrawerLayout drawer;\r\n private TextView tvFullName, tvEmail;\r\n private Fragment fragment = null;\r\n FragmentManager fragmentManager;\r\n\r\n @Override\r\n protected void onCreate(Bundle savedInstanceState) {\r\n super.onCreate(savedInstanceState);\r\n setContentView(R.layout.activity_home);\r\n\r\n Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);\r\n setSupportActionBar(toolbar);\r\n\r\n drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\r\n ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(\r\n this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);\r\n // Drawer Toggle:\r\n drawer.setDrawerListener(toggle);\r\n toggle.syncState();\r\n\r\n navigationView = (NavigationView) findViewById(R.id.nav_view);\r\n navigationView.setNavigationItemSelectedListener(this);\r\n }\r\n\r\n @Override\r\n public void onBackPressed() {\r\n if (drawer.isDrawerOpen(GravityCompat.START)) {\r\n drawer.closeDrawer(GravityCompat.START);\r\n } else {\r\n super.onBackPressed();\r\n }\r\n }\r\n\r\n @Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\r\n getMenuInflater().inflate(R.menu.home, menu);\r\n return true;\r\n }\r\n\r\n @Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n\r\n int id = item.getItemId();\r\n if (id == R.id.action_search) {\r\n return true;\r\n }\r\n\r\n return super.onOptionsItemSelected(item);\r\n }\r\n\r\n @SuppressWarnings(\"StatementWithEmptyBody\")\r\n @Override\r\n public boolean onNavigationItemSelected(MenuItem item) {\r\n // Handle navigation view item clicks here.\r\n\r\n switch (item.getItemId()) {\r\n case R.id.nav_home:\r\n fragment = new HomeFragment();\r\n break;\r\n case R.id.nav_settings:\r\n fragment = new SettingsFragment();\r\n setNavUserDetails();\r\n break;\r\n }\r\n fragmentManager = getFragmentManager();\r\n if (fragment != null)\r\n fragmentManager.beginTransaction().replace(R.id.content_home, fragment).commit();\r\n drawer.closeDrawer(GravityCompat.START);\r\n return true;\r\n }\r\n\r\n}\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003c/p\u003e\n\n\u003ch1\u003eactivity_home.xml:\u003c/h1\u003e\n\n\u003cp\u003e\u003cdiv class=\"snippet\" data-lang=\"js\" data-hide=\"false\"\u003e\r\n\u003cdiv class=\"snippet-code\"\u003e\r\n\u003cpre class=\"snippet-code-js lang-js prettyprint-override\"\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" encoding=\"utf-8\"?\u0026gt;\r\n\u0026lt;android.support.v4.widget.DrawerLayout\r\n xmlns:android=\"http://schemas.android.com/apk/res/android\"\r\n xmlns:app=\"http://schemas.android.com/apk/res-auto\"\r\n xmlns:tools=\"http://schemas.android.com/tools\"\r\n android:id=\"@+id/drawer_layout\"\r\n android:layout_width=\"match_parent\"\r\n android:layout_height=\"match_parent\"\r\n android:fitsSystemWindows=\"true\"\r\n tools:openDrawer=\"start\"\u0026gt;\r\n\r\n \u0026lt;include\r\n layout=\"@layout/app_bar_home\"\r\n android:layout_width=\"match_parent\"\r\n android:layout_height=\"match_parent\" /\u0026gt;\r\n\r\n \u0026lt;android.support.design.widget.NavigationView\r\n android:id=\"@+id/nav_view\"\r\n android:layout_width=\"wrap_content\"\r\n android:layout_height=\"match_parent\"\r\n android:layout_gravity=\"start\"\r\n android:fitsSystemWindows=\"true\"\r\n app:headerLayout=\"@layout/nav_header_home\"\r\n app:menu=\"@menu/logged_out_drawer_menu\" /\u0026gt;\r\n\u0026lt;/android.support.v4.widget.DrawerLayout\u0026gt;\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003c/p\u003e\n\n\u003ch1\u003eapp_bar_home.xml:\u003c/h1\u003e\n\n\u003cp\u003e\u003cdiv class=\"snippet\" data-lang=\"js\" data-hide=\"false\"\u003e\r\n\u003cdiv class=\"snippet-code\"\u003e\r\n\u003cpre class=\"snippet-code-js lang-js prettyprint-override\"\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" encoding=\"utf-8\"?\u0026gt;\r\n\u0026lt;android.support.design.widget.CoordinatorLayout\r\n xmlns:android=\"http://schemas.android.com/apk/res/android\"\r\n xmlns:app=\"http://schemas.android.com/apk/res-auto\"\r\n xmlns:tools=\"http://schemas.android.com/tools\"\r\n android:layout_width=\"match_parent\"\r\n android:layout_height=\"match_parent\"\r\n android:fitsSystemWindows=\"true\"\r\n tools:context=\"com.example.amit.java5776_7546_8412.HomeActivity\"\u0026gt;\r\n\r\n \u0026lt;android.support.design.widget.AppBarLayout\r\n android:layout_height=\"wrap_content\"\r\n android:layout_width=\"match_parent\"\r\n android:theme=\"@style/AppTheme.AppBarOverlay\"\u0026gt;\r\n\r\n \u0026lt;android.support.v7.widget.Toolbar\r\n android:id=\"@+id/toolbar\"\r\n android:layout_width=\"match_parent\"\r\n android:layout_height=\"?attr/actionBarSize\"\r\n android:background=\"?attr/colorPrimary\"\r\n app:popupTheme=\"@style/AppTheme.PopupOverlay\" /\u0026gt;\r\n\r\n \u0026lt;/android.support.design.widget.AppBarLayout\u0026gt;\r\n \u0026lt;include layout=\"@layout/content_home\" /\u0026gt; // \u0026lt;!-- THIS ONE --\u0026gt;\r\n\r\n\u0026lt;/android.support.design.widget.CoordinatorLayout\u0026gt;\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003c/p\u003e\n\n\u003cp\u003econtent_home.xml it's almost an empty RelativeLayout... I didn't see a reason to paste it too...\u003c/p\u003e","accepted_answer_id":"34356531","answer_count":"2","comment_count":"0","creation_date":"2015-12-18 13:01:34.993 UTC","last_activity_date":"2015-12-18 13:16:32.15 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2519090","post_type_id":"1","score":"0","tags":"java|android|android-fragments","view_count":"151"} +{"id":"18825866","title":"Strange result of sort on Linux","body":"\u003cp\u003eI have got strange result of sort on Linux\u003c/p\u003e\n\n\u003cpre\u003e\n\n$ uname -a\nLinux ... 2.6.32-279.5.2.el6.x86_64 #1 SMP Tue Aug 14 11:36:39 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux\n\n$ sort --version\nsort (GNU coreutils) 8.4\n\u003c/pre\u003e\n\n\u003cp\u003eHere is file zzz2.\u003c/p\u003e\n\n\u003cpre\u003e\n pe/CCC \n pe_ext/CCC \n pe/MMM \n\u003c/pre\u003e\n\n\u003cp\u003e$ sort zzz2\u003c/p\u003e\n\n\u003cpre\u003e\n pe/CCC \n pe_ext/CCC \n pe/MMM \n\n\nExppected output:\n pe/CCC \n pe/MMM \n pe_ext/CCC \n\n\n\nAppendix.\n\n$ od -c zzz2\n0000000 p e / C C C \\r \\n p e _ e x t / C\n0000020 C C \\r \\n p e / M M M\n0000032\n\n\u003c/pre\u003e","answer_count":"1","comment_count":"3","creation_date":"2013-09-16 10:32:01.9 UTC","favorite_count":"1","last_activity_date":"2013-09-16 10:38:28.177 UTC","last_edit_date":"2013-09-16 10:38:28.177 UTC","last_editor_display_name":"","last_editor_user_id":"1989556","owner_display_name":"","owner_user_id":"1989556","post_type_id":"1","score":"0","tags":"linux|sorting","view_count":"175"} +{"id":"47443381","title":"Symfony 3.3 can't find Doctrine annotations","body":"\u003cp\u003eI use Symfony 3.3 it works great in local but online it shows me this error\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eWarning: class_exists() expects parameter 1 to be a valid callback, function 'ORM\\Entity' not found or invalid function name in /htdocs/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationRegistry.php on line 145\n\nWarning: class_exists() expects parameter 1 to be a valid callback, function 'ORM\\Table' not found or invalid function name in /htdocs/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationRegistry.php on line 145\n\nWarning: class_exists() expects parameter 1 to be a valid callback, function 'Doctrine\\ORM\\Mapping\\Entity' not found or invalid function name in /htdocs/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationRegistry.php on line 145\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNothing special with my code but it seem that there is a problem with annotations\nMy entity City start like that\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enamespace AppBundle\\Entity;\n\nuse Doctrine\\ORM\\Mapping as ORM;\n\n/**\n * City\n * \n * @ORM\\Entity(repositoryClass=\"AppBundle\\Repository\\CityRepository\")\n * @ORM\\Table(name=\"city\")\n */\nclass City\n{\n /**\n * @var int\n *\n * @ORM\\Column(name=\"id\", type=\"integer\")\n * @ORM\\Id\n * @ORM\\GeneratedValue(strategy=\"AUTO\")\n */\n private $id;\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAlso in dev mod, it can't show me the profiler and the issue it's also always linked to the annotations.\nPlease Help\u003c/p\u003e","answer_count":"1","comment_count":"5","creation_date":"2017-11-22 20:28:08.683 UTC","last_activity_date":"2017-11-23 22:23:40.263 UTC","last_edit_date":"2017-11-23 11:33:35.2 UTC","last_editor_display_name":"","last_editor_user_id":"2316220","owner_display_name":"","owner_user_id":"2316220","post_type_id":"1","score":"0","tags":"symfony|doctrine2","view_count":"32"} +{"id":"13998683","title":"Bootstrap / Dropdown Button","body":"\u003cp\u003eHi Im trying to create a dropdown button using bootstrap. But it just doesnt seem to come out correctly ?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"btn-group\"\u0026gt;\n \u0026lt;a class=\"btn dropdown-toggle\" data-toggle=\"dropdown\" href=\"#\"\u0026gt;\n Action\n \u0026lt;span class=\"caret\"\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;/a\u0026gt;\n \u0026lt;ul class=\"dropdown-menu\"\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#\"\u0026gt;Foo\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#\"\u0026gt;Bar\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eA jsfiddle is here \u003ca href=\"http://jsfiddle.net/UrgP8/\"\u003ehttp://jsfiddle.net/UrgP8/\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eAny ideas ?\u003c/p\u003e\n\n\u003cp\u003eThanks,\u003c/p\u003e","accepted_answer_id":"13998987","answer_count":"2","comment_count":"1","creation_date":"2012-12-21 23:51:00.033 UTC","favorite_count":"1","last_activity_date":"2013-07-27 16:03:29.903 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1325133","post_type_id":"1","score":"5","tags":"html|twitter-bootstrap","view_count":"20516"} +{"id":"12955999","title":"Cascading drop down list with ajax in php","body":"\u003cp\u003eI have a cascading dropdown list which is fetched from the database through ajax.\nThe list loads but its not posting to the database nor is the code seen behind.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction getXMLHTTP() { //function to return the xml http object\n var xmlhttp=false; \n try{\n xmlhttp=new XMLHttpRequest();\n }\n catch(e) { \n try{ \n xmlhttp= new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n catch(e){\n try{\n xmlhttp = new ActiveXObject(\"Msxml2.XMLHTTP\");\n }\n catch(e1){\n xmlhttp=false;\n }\n }\n }\n\n return xmlhttp;\n }\n\nfunction getCity(stateid)\n{\n //alert(stateid);\n var strURL=\"findCity.php?state=\"+stateid;\n var req = getXMLHTTP();\n if (req)\n {\n req.onreadystatechange = function()\n {\n if (req.readyState == 4) // only if \"OK\"\n {\n if (req.status == 200)\n {\n document.getElementById('citydiv').innerHTML=req.responseText;\n } else {\n alert(\"There was a problem while using XMLHTTP:\\n\" + req.statusText);\n }\n }\n }\n req.open(\"GET\", strURL, true);\n req.send(null);\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand the php file\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;? $state=$_GET['state'];\n $link = mysql_connect('localhost', '', ''); //change the configuration if required\n if (!$link) {\n die('Could not connect: ' . mysql_error());\n }\n mysql_select_db('a'); //change this if required\n $query=\"select FOR_CODE,FOR_DESC from maruti_city where FOR_STAT_CODE='{$state}' order by FOR_DESC\";\n $result=mysql_query($query);?\u0026gt;\n \u0026lt;select name=\"city\" onchange=\"getDealer(this.value)\" class=\"sel\" \u0026gt;\n \u0026lt;option value=\"0\"\u0026gt;Select City\u0026lt;/option\u0026gt;\n \u0026lt;? while($row=mysql_fetch_array($result)) { ?\u0026gt;\n \u0026lt;option value\u0026gt;\u0026lt;?=$row['FOR_DESC']?\u0026gt;\u0026lt;/option\u0026gt;\n \u0026lt;?} ?\u0026gt;\n \u0026lt;/select\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe DDL's Load but these values are not getting posted to the database.\nform\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"container\"\u0026gt;\n\u0026lt;table width=\"528\" border=\"0\" cellpadding=1 class=\"formTable\" style=\"width: 515px;font-family:arial;font-size:12px;\" \u0026gt;\n\u0026lt;form action=\"form_submit.php\" method=\"POST\" name=\"alto800\" id=\"alto800\" onsubmit=\"return validate();\"\u0026gt;\n \u0026lt;tbody\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td width=\"52%\"\u0026gt;Name\u0026lt;/td\u0026gt;\n \u0026lt;td width=\"48%\" \u0026gt;Mobile/Phone No.\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;\n \u0026lt;select name=\"title\" id=\"mr\" class=\"sel\"\u0026gt;\n \u0026lt;option value=\"mr\"\u0026gt;Mr.\u0026lt;/option\u0026gt;\n \u0026lt;option value=\"mrs\"\u0026gt;Mrs.\u0026lt;/option\u0026gt;\n \u0026lt;/select\u0026gt;\n \u0026lt;input type=\"text\" name=\"name\" id=\"name\" class=\"formName\" /\u0026gt;\n \u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\n \u0026lt;input type=\"text\" name=\"mobile\" id=\"mobile\"/\u0026gt;\n \u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td \u0026gt;State\u0026lt;/td\u0026gt;\n \u0026lt;td \u0026gt;City\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;\n \u0026lt;select name=\"state\" id=\"state\" class=\"sel\" onchange=\"getCity(this.value)\"\u0026gt;\n \u0026lt;option value=\"0\"\u0026gt;Select state\u0026lt;/option\u0026gt;\n \u0026lt;option value=\"AN\"\u0026gt;ANDAMAN\u0026lt;/option\u0026gt;\n\u0026lt;option value=\"AP\"\u0026gt;ANDHRA PRADESH\u0026lt;/option\u0026gt;\n\u0026lt;option value=\"AR\"\u0026gt;ARUNANCHAL PRADESH\u0026lt;/option\u0026gt;\n\u0026lt;option value=\"AS\"\u0026gt;ASSAM\u0026lt;/option\u0026gt;\n\u0026lt;option value=\"BH\"\u0026gt;BIHAR\u0026lt;/option\u0026gt;\n\u0026lt;option value=\"CG\"\u0026gt;CHATTISGARH\u0026lt;/option\u0026gt;\n\u0026lt;option value=\"CH\"\u0026gt;CHANDIGARH\u0026lt;/option\u0026gt;\n\u0026lt;option value=\"DL\"\u0026gt;DELHI\u0026lt;/option\u0026gt;\n\u0026lt;option value=\"DM\"\u0026gt;DAMAN\u0026lt;/option\u0026gt;\n\u0026lt;option value=\"DN\"\u0026gt;DADRA \u0026amp; NAGAR HAVELI\u0026lt;/option\u0026gt;\n\u0026lt;option value=\"GJ\"\u0026gt;GUJRAT\u0026lt;/option\u0026gt;\n\u0026lt;option value=\"GO\"\u0026gt;GOA\u0026lt;/option\u0026gt;\n\u0026lt;option value=\"HN\"\u0026gt;HARYANA\u0026lt;/option\u0026gt;\n\u0026lt;option value=\"HP\"\u0026gt;HIMACHAL PRADESH\u0026lt;/option\u0026gt;\n\u0026lt;option value=\"JH\"\u0026gt;JHARKHAND\u0026lt;/option\u0026gt;\n\u0026lt;option value=\"JK\"\u0026gt;JAMMU \u0026amp; KASHMIR\u0026lt;/option\u0026gt;\n\u0026lt;option value=\"KL\"\u0026gt;KERALA\u0026lt;/option\u0026gt;\n\u0026lt;option value=\"KT\"\u0026gt;KARNATAKA\u0026lt;/option\u0026gt;\n\u0026lt;option value=\"MH\"\u0026gt;MAHARASHTRA\u0026lt;/option\u0026gt;\n\u0026lt;option value=\"ML\"\u0026gt;MEGHALAYA\u0026lt;/option\u0026gt;\n\u0026lt;option value=\"MN\"\u0026gt;MANIPUR\u0026lt;/option\u0026gt;\n\u0026lt;option value=\"MP\"\u0026gt;MADHYA PRADESH\u0026lt;/option\u0026gt;\n\u0026lt;option value=\"MZ\"\u0026gt;MIZORAM\u0026lt;/option\u0026gt;\n\u0026lt;option value=\"NG\"\u0026gt;NAGALAND\u0026lt;/option\u0026gt;\n\u0026lt;option value=\"OS\"\u0026gt;ORISSA\u0026lt;/option\u0026gt;\n\u0026lt;option value=\"PJ\"\u0026gt;PUNJAB\u0026lt;/option\u0026gt;\n\u0026lt;option value=\"PY\"\u0026gt;PONDICHERRY\u0026lt;/option\u0026gt;\n\u0026lt;option value=\"RJ\"\u0026gt;RAJASTHAN\u0026lt;/option\u0026gt;\n\u0026lt;option value=\"SK\"\u0026gt;SIKKIM\u0026lt;/option\u0026gt;\n\u0026lt;option value=\"TN\"\u0026gt;TAMIL NADU\u0026lt;/option\u0026gt;\n\u0026lt;option value=\"TR\"\u0026gt;TRIPURA\u0026lt;/option\u0026gt;\n\u0026lt;option value=\"UP\"\u0026gt;UTTAR PRADESH\u0026lt;/option\u0026gt;\n\u0026lt;option value=\"UT\"\u0026gt;UTTARANCHAL\u0026lt;/option\u0026gt;\n\u0026lt;option value=\"WB\"\u0026gt;WEST BENGAL\u0026lt;/option\u0026gt;\n\n \u0026lt;/select\u0026gt;\n \u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;div id=\"citydiv\"\u0026gt;\n \u0026lt;select name=\"city\" id=\"city\" class=\"sel\" onChange=\"getDealer(this.value)\" \u0026gt;\n \u0026lt;option value=\"0\"\u0026gt;Select state first\u0026lt;/option\u0026gt;\n \u0026lt;/select\u0026gt;\n \u0026lt;/div\u0026gt;\n\n \u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td \u0026gt;Preffered Dealer\u0026lt;/td\u0026gt;\n \u0026lt;td \u0026gt;\u0026amp;nbsp;\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt; \n \u0026lt;td colspan=\"2\"\u0026gt;\u0026lt;div id=\"dealerdiv\"\u0026gt;\u0026lt;select name=\"dealer\" style=\"width:500px;height:25px;\" \u0026gt;\n \u0026lt;option value=\"0\"\u0026gt;Select city first\u0026lt;/option\u0026gt;\n \u0026lt;/select\u0026gt; \u0026lt;/div\u0026gt; \u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;Email Address\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\u0026amp;nbsp;\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;input type=\"text\" name=\"email\" id=\"email\" /\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\u0026amp;nbsp;\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td \u0026gt;Your Query\u0026lt;/td\u0026gt;\n \u0026lt;td rowspan=\"2\" \u0026gt;\u0026lt;br /\u0026gt;\n \u0026lt;br /\u0026gt; \u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;\n \u0026lt;textarea name=\"query\" id=\"query\"\u0026gt;\u0026lt;/textarea\u0026gt;\n\n \u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td \u0026gt;\n \u0026lt;div style=\"height:10px\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;input type=\"image\" name=\"submit\" value=\"submit\" src=\"images/submit.png\" /\u0026gt;\n \u0026lt;/td\u0026gt;\n \u0026lt;td \u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n\n \u0026lt;/tbody\u0026gt;\n \u0026lt;/form\u0026gt;\n\u0026lt;/table\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"6","creation_date":"2012-10-18 13:36:15.2 UTC","favorite_count":"0","last_activity_date":"2013-12-23 21:02:09.017 UTC","last_edit_date":"2013-12-23 21:02:09.017 UTC","last_editor_display_name":"","last_editor_user_id":"759866","owner_display_name":"","owner_user_id":"1450352","post_type_id":"1","score":"0","tags":"php|javascript|ajax|list|drop-down-menu","view_count":"1334"} +{"id":"14060927","title":"Post javascript module array as List object with ajax in asp .net mvc project","body":"\u003cp\u003eI want to send JavaScript object array as list object to server, the server side method(GetData) accepts list object with 3 elements, but all elements have null value. Any advice? Thanks in advance.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eAt Client:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cem\u003eUser.js\u003c/em\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edefine(function () { \n function User(name) {\n this.Name = name \n }\n return User;\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cem\u003emain.js\u003c/em\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar users = [new User('Barney'),\n new User('Cartman'),\n new User('Sheldon')];\n $.ajax({\n type: \"POST\",\n url: \"/Home/GetData\",\n data: {users: users},\n success: function (data) {\n //alert(data.Result);\n },\n dataType: \"json\"\n });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eAt Server:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cem\u003eGetData action\u003c/em\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic void GetData(List\u0026lt;User\u0026gt; users){\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cem\u003eUser Model\u003c/em\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class User {\n public string Name { get; set; }\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"14069344","answer_count":"1","comment_count":"3","creation_date":"2012-12-27 20:32:04.027 UTC","last_activity_date":"2012-12-28 12:13:50.533 UTC","last_edit_date":"2012-12-27 20:37:21.337 UTC","last_editor_display_name":"","last_editor_user_id":"137626","owner_display_name":"","owner_user_id":"658735","post_type_id":"1","score":"0","tags":"asp.net-mvc|list|jquery","view_count":"1820"} +{"id":"40465813","title":"return hits from one bucket when doing a geodistance search in elasticsearch .net","body":"\u003cp\u003eI want to do a geosearch where it should first search for all locations within a distance of 50 meters, if more than 5 hits are found, then return those. If less than 5 hits are found I want to expand and search all locations within a distance of 400 meters. Again, if less than 5 hits are found I want to expand to 1000 meters but if less than 5 hits are found there I want to return those and not expand further. I don't want to return the 5 closest results, I want to return all the hits from up to the distance used.\u003c/p\u003e\n\n\u003cp\u003eI'm aggregating like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eaggregations.GeoDistance(\"nearby_locations\", g =\u0026gt; g\n .Field(f =\u0026gt; f.GeoLocations)\n .DistanceType(GeoDistanceType.Arc)\n .Unit(DistanceUnit.Meters)\n .Origin((double)position.X, (double)position.Y)\n .Ranges(\n r =\u0026gt; r.To(50),\n r =\u0026gt; r.To(400),\n r =\u0026gt; r.To(1000)));\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut I don't know how to return the hits for the first bucket that has over 5 hits. At the moment I'm checking which bucket that had more than 5 hits and then do another search on that distance.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar maxDistance = 1000;\nresponse = Search(query, skip, size, position, maxDistance);\nvar distanceBucket = response.Aggs.GeoDistance(\"nearby_locations\").Buckets\n .FirstOrDefault(x =\u0026gt; x.DocCount \u0026gt; 5);\n\nif(distanceBucket != null) {\n distanceUsed = (int)distanceBucket.To.Value;\n response = Search(query, skip, size, position, distanceUsed);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis works, but I was wondering if there is a better way to achieve this?\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2016-11-07 12:58:45.693 UTC","last_activity_date":"2016-11-14 14:26:28.767 UTC","last_edit_date":"2016-11-14 14:26:28.767 UTC","last_editor_display_name":"","last_editor_user_id":"6344649","owner_display_name":"","owner_user_id":"6344649","post_type_id":"1","score":"5","tags":"elasticsearch|nest|elasticsearch-2.0|elasticsearch-net","view_count":"98"} +{"id":"30584070","title":"How can I make a symbol point at the mouse?","body":"\u003cp\u003eI want to make a symbol rotate to point at the mouse. I'm using this function, but it doesn't work below the symbol's pivot. The inverse tan function has a range of 180 degrees right? So how can i get 360 degrees of movement?\u003c/p\u003e\n\n\u003cp\u003eWould I need to add an if statement to check the mouse position or is there a more elegant solution?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction panelTrack(){\n angle = -180/Math.PI * Math.atan((mouseX - panel.x)/(mouseY - panel.y));\n panel.rotation = angle;\n trace(panel.rotation);\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"30588940","answer_count":"2","comment_count":"0","creation_date":"2015-06-01 22:02:26.943 UTC","last_activity_date":"2015-06-09 16:38:44.79 UTC","last_edit_date":"2015-06-01 22:16:49.52 UTC","last_editor_display_name":"","last_editor_user_id":"4347580","owner_display_name":"","owner_user_id":"4804026","post_type_id":"1","score":"1","tags":"actionscript-3|geometry|displayobject|angle","view_count":"57"} +{"id":"22107187","title":"smarty php anchor link not working","body":"\u003cp\u003eHi I was wondering if you could help me with an issue where with my smarty php code won't work. The problem is the anchor tag containing all of the code in this section won't actually surround it when it is outputted to the web page.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;a href=\"mylink\"\u0026gt; //the link that does not actually work/surround the code below when outputed\n \u0026lt;div class=\"row\" {if $smarty.section.pm_loop.last}style=\"border:none;\"{/if}\u0026gt;\n \u0026lt;div class=\"f-right\" style=\"padding-right: 35px\"\u0026gt;\n \u0026lt;a href='UserMessagesNew.php?pm_id={$pms[pm_loop].pm_id}'\u0026gt;{$Application659}\u0026lt;/a\u0026gt;\u0026lt;br/\u0026gt;\n \u0026lt;a href='UserMessagesView.php?pm_id={$pms[pm_loop].pm_id}\u0026amp;task=delete'\u0026gt;{$Application660}\u0026lt;/a\u0026gt;\u0026lt;br/\u0026gt;\n \u0026lt;input type='checkbox' name='message_{$pms[pm_loop].pm_id}' value='1' style=\"margin:0; height:15px; width:15px;\"/\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;a class=\"f-left\" href=\"UserMessagesView.php?pm_id={$pms[pm_loop].pm_id}\"\u0026gt;\u0026lt;img src=\"{$pms[pm_loop].pm_user-\u0026gt;user_photo('./images/nophoto.gif')}\" class='img' width=\"92px\" alt=\"{$pms[pm_loop].pm_user-\u0026gt;user_info.user_username} {$Application500}\"\u0026gt;\u0026lt;/a\u0026gt;\n \u0026lt;a href=\"#\" class=\"msg-info-c\"\u0026gt;\n \u0026lt;div class=\"msg-user-re\"\u0026gt;\u0026lt;b\u0026gt;\u0026lt;a href=\"UserMessagesView.php?pm_id={$pms[pm_loop].pm_id}\"\u0026gt;{$pms[pm_loop].pm_user-\u0026gt;user_info.user_username}\u0026lt;/a\u0026gt;\u0026lt;/b\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;a href=\"UserMessagesView.php?pm_id={$pms[pm_loop].pm_id}\"\u0026gt;\u0026lt;div class=\"msg-datet\"\u0026gt;{$datetime-\u0026gt;cdate(\"`$setting.setting_timeformat` `$setting.setting_dateformat`\", $datetime-\u0026gt;timezone($pms[pm_loop].pm_date, $global_timezone))}\u0026lt;/div\u0026gt;\u0026lt;/a\u0026gt;\n \u0026lt;a href=\"UserMessagesView.php?pm_id={$pms[pm_loop].pm_id}\"\u0026gt;\u0026lt;div class=\"user-msg-c\"\u0026gt;{$pms[pm_loop].pm_body|truncate:100|choptext:75:\"\u0026lt;br\u0026gt;\"}\u0026lt;/div\u0026gt;\u0026lt;/a\u0026gt;\n \u0026lt;/a\u0026gt;\n \u0026lt;/div\u0026gt;\n\u0026lt;/a\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe output looks like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;a href=\"mylink\"\u0026gt;\u0026lt;/a\u0026gt;\n\u0026lt;div class=\"row\"\u0026gt;\n\n rest of content inside here\n\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"22107576","answer_count":"1","comment_count":"9","creation_date":"2014-02-28 22:37:46.14 UTC","last_activity_date":"2014-02-28 23:12:47.39 UTC","last_edit_date":"2014-02-28 22:47:31.377 UTC","last_editor_display_name":"","last_editor_user_id":"3150271","owner_display_name":"","owner_user_id":"3329290","post_type_id":"1","score":"0","tags":"php|html|anchor|smarty","view_count":"858"} +{"id":"45397663","title":"Route inbound calls to different SIP Trunks in Asterisk Python","body":"\u003cp\u003eI recently started a project to route inbound calls to different softphones. \u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eWhat I Did\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI'm using Raspberry Pi to do this. So in raspberry pi I've installed asterisk and python and pyst package to connect asterisk and python. However I want to route incoming call to different softphones in the network based on caller ID. So though to use Zoiper application in several mobiles which have connected to the same Wi-Fi network. \u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eWhat I want\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI want to know how can I use python and pyst functions or AGI functions to route incoming call to specific softphone. I know I've to make an asterisk SIP server and add SIP client info to the softphone. But I can't get a proper idea how to do that when it comes to several softphones. \u003c/p\u003e\n\n\u003cp\u003eAlso I'm running asterisk on freePBX and I'm using Python IDLE IDE. So I wish I could only use codes to accomplish this than setting up by freePBX web GUI. Please help. \u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-07-30 07:59:08.36 UTC","last_activity_date":"2017-07-31 06:34:16.51 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"8107802","post_type_id":"1","score":"-1","tags":"python-2.7|asterisk|raspberry-pi3|freepbx","view_count":"32"} +{"id":"43948000","title":"Local Reference table overflow but using DeleteLocalRef","body":"\u003cp\u003eI am forking the breadwallet and get a \u003ccode\u003eLocalReferenceTableOverflow\u003c/code\u003e.\nIt is in the following code\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003estatic void saveBlocks(void *info, BRMerkleBlock *blocks[], size_t count){\n__android_log_print(ANDROID_LOG_DEBUG, \"Message from C: \", \"saveBlocks\");\nif (!_peerManager){\n return;\n}\n\nJNIEnv *env = getEnv();\njmethodID mid;\n\nif (!env) return;\n\nif (count != 1) {\n __android_log_print(ANDROID_LOG_ERROR, \"Message from C: \", \"deleting %zu blocks\", count);\n mid = (*env)-\u0026gt;GetStaticMethodID(env, _peerManagerClass, \"deleteBlocks\", \"()V\");\n (*env)-\u0026gt;CallStaticVoidMethod(env, _peerManagerClass, mid);\n}\n\n//call java methods\n\n//Find the class and populate the array of objects of this class\njobjectArray blockObjectArray = (*env)-\u0026gt;NewObjectArray(env, (jsize) count, _blockClass, 0);\n\nfor (size_t i = 0; i \u0026lt; count; i++) {\n if (!_peerManager) return;\n\n uint8_t buf[BRMerkleBlockSerialize(blocks[i], NULL, 0)];\n size_t len = BRMerkleBlockSerialize(blocks[i], buf, sizeof(buf));\n jbyteArray result = (*env)-\u0026gt;NewByteArray(env, (jsize) len);\n jobject blockObject;\n\n (*env)-\u0026gt;SetByteArrayRegion(env, result, 0, (jsize) len, (jbyte *) buf);\n mid = (*env)-\u0026gt;GetMethodID(env, _blockClass, \"\u0026lt;init\u0026gt;\", \"([BI)V\");\n\n __android_log_print(ANDROID_LOG_DEBUG, \"huhu\", \"hier bin ich gleich\");\n blockObject = (*env)-\u0026gt;NewObject(env, _blockClass, mid, result, blocks[i]-\u0026gt;height); // this line\n __android_log_print(ANDROID_LOG_DEBUG, \"huhu\", \"hier bin ich\");\n\n (*env)-\u0026gt;SetObjectArrayElement(env, blockObjectArray, i, blockObject);\n (*env)-\u0026gt;DeleteLocalRef(env, result);\n (*env)-\u0026gt;DeleteLocalRef(env, blockObject);\n}\n\nmid = (*env)-\u0026gt;GetStaticMethodID(env, _peerManagerClass, \"saveBlocks\",\n \"([Lcom/breadwallet/presenter/entities/BlockEntity;)V\");\n(*env)-\u0026gt;CallStaticVoidMethod(env, _peerManagerClass, mid, blockObjectArray);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eLogCat:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e05-13 01:52:11.644 28316-28449/com.eMarkwallet D/com.breadwallet.wallet.BRPeerManager: saveBlocks: 1\n05-13 01:52:11.644 28316-28449/com.eMarkwallet D/Message from C:: saveBlocks\n05-13 01:52:11.644 28316-28449/com.eMarkwallet D/Message from C:: getEnv peerManager\n05-13 01:52:11.644 28316-28449/com.eMarkwallet D/huhu: hier bin ich gleich\n05-13 01:52:11.646 28316-28449/com.eMarkwallet A/art: art/runtime/indirect_reference_table.cc:132] JNI ERROR (app bug): local reference table overflow (max=512)\n05-13 01:52:11.646 28316-28449/com.eMarkwallet A/art: art/runtime/indirect_reference_table.cc:132] local reference table dump:\n05-13 01:52:11.646 28316-28449/com.eMarkwallet A/art: art/runtime/indirect_reference_table.cc:132] Last 10 entries (of 512):\n05-13 01:52:11.646 28316-28449/com.eMarkwallet A/art: art/runtime/indirect_reference_table.cc:132] 511: 0x12e9c880 byte[] (80 elements)\n05-13 01:52:11.646 28316-28449/com.eMarkwallet A/art: art/runtime/indirect_reference_table.cc:132] 510: 0x12c51700 com.breadwallet.presenter.entities.BlockEntity[] (1 elements)\n05-13 01:52:11.646 28316-28449/com.eMarkwallet A/art: art/runtime/indirect_reference_table.cc:132] 509: 0x12c51140 com.breadwallet.presenter.entities.BlockEntity[] (1 elements)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2017-05-13 00:13:39.333 UTC","last_activity_date":"2017-05-13 00:52:08.27 UTC","last_edit_date":"2017-05-13 00:52:08.27 UTC","last_editor_display_name":"","last_editor_user_id":"2016735","owner_display_name":"","owner_user_id":"8005326","post_type_id":"1","score":"1","tags":"android|jnienv","view_count":"58"} +{"id":"46493181","title":"PowerShell - User Must Change Password at Next Logon","body":"\u003cp\u003eHere is what I have, everything works great thus far except the part where I need the user to change their password on sign in\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eImport-Csv C:\\Users\\amassey\\Desktop\\newuser.csv | New-ADUser -PassThru | Set-ADAccountPassword -Reset -NewPassword (ConvertTo-SecureString -AsPlainText '@To03PXaz4' -Force) -PassThru | Enable-ADAccount -PassThru | Set-Aduser -ChangePasswordAtNextLogon $true\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eany guidance would be greatly appreciated\u003c/p\u003e","accepted_answer_id":"46493277","answer_count":"1","comment_count":"0","creation_date":"2017-09-29 16:27:37.397 UTC","last_activity_date":"2017-09-29 16:34:39.683 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"8696767","post_type_id":"1","score":"0","tags":"powershell|active-directory|change-password","view_count":"34"} +{"id":"29798001","title":"JVectorMap: change map on button click","body":"\u003cp\u003eHere's what I'm trying to achieve:\u003c/p\u003e\n\n\u003cp\u003eI have three buttons in \u003ccode\u003eindex.html\u003c/code\u003e. When I click on them I need the jvectormap in a different file \u003ccode\u003emap.html\u003c/code\u003e to change. The js code is in another file, \u003ccode\u003emap.js\u003c/code\u003e. \u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eExample\u003c/strong\u003e\u003cbr\u003e\nIf I click on:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;button type=\"button\" id=\"world\"\u0026gt;World Map\u0026lt;/button\u0026gt;\n\u0026lt;button type=\"button\" id=\"Europe\"\u0026gt;Europe Map\u0026lt;/button\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eShould change the \u003ccode\u003emap\u003c/code\u003e property value to either \u003ccode\u003eworld_mill_en\u003c/code\u003e or \u003ccode\u003eeu_mill_en\u003c/code\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emap = new jvm.Map({\n map: 'world_mill_en',\n})\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs it possible to do this? I was not able to find an answer or figure it out. Thanks for your help\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-04-22 12:44:45.477 UTC","last_activity_date":"2015-04-22 13:08:20.95 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1205706","post_type_id":"1","score":"0","tags":"javascript|jquery|jvectormap","view_count":"228"} +{"id":"10314464","title":"Checking Keyboard or Mouse events are done in a Div","body":"\u003cp\u003eHow can I check if a keyboard or mouse event is done inside of a div?\u003c/p\u003e\n\n\u003cp\u003eOnce I check the onmousemove() event of a div it works but onkeyup, onkeypress etc are not working for the div.\u003c/p\u003e\n\n\u003cp\u003eWhat is the reason for that?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div onmousemove=\"alert(1);\" onkeypress=\"alert(2);\"\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere alert(1) will be displayed but alert(2) is not displayed.\u003c/p\u003e","accepted_answer_id":"10315516","answer_count":"2","comment_count":"2","creation_date":"2012-04-25 11:13:33.817 UTC","favorite_count":"1","last_activity_date":"2012-07-13 11:42:22.823 UTC","last_edit_date":"2012-07-13 11:42:22.823 UTC","last_editor_display_name":"","last_editor_user_id":"835251","owner_display_name":"","owner_user_id":"1066604","post_type_id":"1","score":"2","tags":"javascript","view_count":"205"} +{"id":"21431720","title":"Phonegap app - How to get images from Json Web Service Response?","body":"\u003cp\u003eI need to get images from server side in a Phonegap App. This app uses a Json Web Service to get data from the a .NET application (Server). I need to get images via web services and store in some location of device (temporally). Im asking the first thing. Im thinking what the way to do that is taking via ws the urls of the images, but I need then a way to use the url of image to\"download\" or get it via url and save to some object or something in Javascript (I guess) for in the case that the device lose the internet connection, the app remains the images getted.\u003c/p\u003e\n\n\u003cp\u003eWhat do you think about this approach and do you know how I can do this way?\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","accepted_answer_id":"21433132","answer_count":"1","comment_count":"0","creation_date":"2014-01-29 12:52:43.17 UTC","last_activity_date":"2014-01-29 13:54:00.7 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1978404","post_type_id":"1","score":"1","tags":"javascript|html5|web-services|cordova","view_count":"617"} +{"id":"30058502","title":"Rails fire model callback when attribute updates to a new value or is nil","body":"\u003cp\u003eI’m trying to get a \u003ccode\u003ebefore_update\u003c/code\u003e model callback working where \u003ccode\u003equote_file_date\u003c/code\u003e is automatically timestamped based off whether \u003ccode\u003equote_file\u003c/code\u003e is created, updated or removed. The purpose of this is so that I can track when the file is created and updated.\u003c/p\u003e\n\n\u003cp\u003eI’m unsure how to implement ActiveModel::Dirty to get this working properly, but the expected behaviour should be:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eWhen \u003ccode\u003equote_file\u003c/code\u003e is created, a \u003ccode\u003equote_file_date\u003c/code\u003e timestamp is created.\u003c/li\u003e\n\u003cli\u003eWhen \u003ccode\u003equote_file\u003c/code\u003e value changes, the \u003ccode\u003equote_file_date\u003c/code\u003e timestamp is updated.\u003c/li\u003e\n\u003cli\u003eIf \u003ccode\u003equote_file\u003c/code\u003e is removed, the \u003ccode\u003equote_file_date\u003c/code\u003e is set back to nil.\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eCurrently, I have:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass Job \u0026lt; ActiveRecord::Base\n\n before_update :quote_file_updated?, on: [:create, :update], if: quote_file.identifier.changed?\n\n private\n\n def quote_file_updated?\n self.quote_file_date = Time.now\n end\n\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd the error I get back from this is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eundefined method `quote_file' for #\u0026lt;Class:0x007fa3bbedfec0\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat is the most elegant way to achieve this using callbacks in the model?\u003c/p\u003e","accepted_answer_id":"30079880","answer_count":"1","comment_count":"0","creation_date":"2015-05-05 16:32:03.443 UTC","last_activity_date":"2015-05-06 14:37:04.903 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1837427","post_type_id":"1","score":"1","tags":"ruby-on-rails|ruby|ruby-on-rails-4|model|activemodel","view_count":"136"} +{"id":"38574580","title":"Update stored procedure in Code First DbMigration","body":"\u003cp\u003eI have solution for Stored Procedures creation exactly like in this answer \u003ca href=\"https://stackoverflow.com/a/15171900\"\u003ehttps://stackoverflow.com/a/15171900\u003c/a\u003e.\u003c/p\u003e\n\n\u003cp\u003eI am running\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSql(Properties.Resources.Create_sp_DoSomething);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ein my Initial DbMigration.\u003c/p\u003e\n\n\u003cp\u003eMy sql scripts have code to first drop existing SP and then create new updated SP. So whene I run \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSql(Properties.Resources.Create_sp_DoSomething);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ein new DbMigration, and logic inside SP is changed everything works fine.\u003c/p\u003e\n\n\u003cp\u003eThe problem arise when I want to update Stored Procedure with columns (lets say \u003cem\u003eIsActive\u003c/em\u003e) which were added to model in later commits, and I am updating without existing DB (so new DB is created).\nThen It fails with \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eInvalid column name 'IsActive'.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eAny good solution to that other than removing all existing calls to\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eSql(Properties.Resources.Create_sp_DoSomething);\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eand have it only in newest DbMigration.\u003c/p\u003e","accepted_answer_id":"38576052","answer_count":"1","comment_count":"0","creation_date":"2016-07-25 18:03:20.503 UTC","last_activity_date":"2016-07-25 19:36:42.157 UTC","last_edit_date":"2017-05-23 12:01:39.1 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"883793","post_type_id":"1","score":"0","tags":"entity-framework|stored-procedures|ef-code-first|ef-migrations","view_count":"1130"} +{"id":"12991274","title":"How to modify Android Bluetooth Chat to connect with A2DP device?","body":"\u003cp\u003eI'm trying to modify the Bluetooth Chat program to connect with a device over the A2DP profile. My tablet is already paired and connected to the device but when I launch the program it says it cannot connect. This is the only code that I have altered:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic BluetoothChatService(Context context, Handler handler) {\n mAdapter = BluetoothAdapter.getDefaultAdapter();\n mState = STATE_NONE;\n mHandler = handler;\n\n mAdapter.getProfileProxy(context, mProfileListener, BluetoothProfile.A2DP);\n}\n private BluetoothProfile.ServiceListener mProfileListener = new BluetoothProfile.ServiceListener() {\n public void onServiceConnected(int profile, BluetoothProfile proxy) {\n if (profile == BluetoothProfile.A2DP) {\n mBluetoothA2DP = (BluetoothA2dp) proxy;\n }\n }\n public void onServiceDisconnected(int profile) {\n if (profile == BluetoothProfile.A2DP) {\n mBluetoothA2DP = null;\n }\n }\n\n };\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is in the BluetoothChatService.java file. Above this code I have defined private BluetoothA2dp mBluetoothA2DP;\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2012-10-20 18:10:19.753 UTC","favorite_count":"2","last_activity_date":"2012-10-20 18:10:19.753 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1761922","post_type_id":"1","score":"2","tags":"android|bluetooth|a2dp","view_count":"602"} +{"id":"46764292","title":"Custom Label text in tableview when data found or not? objective c","body":"\u003cp\u003eI tried to find a solution but so far no luck, i can show a custom label in a tableview where the \u003ccode\u003enumberOfSections\u003c/code\u003e is returned zero if there is not data in an array else i am returning what is required.\u003c/p\u003e\n\n\u003cp\u003eNow I am sending a Json request in a \u003ccode\u003eviewDidLoad\u003c/code\u003e so I can populate data in a tableview. when the view loaded, initially I am getting No data found in a custom label which is fine as the initial array is empty and changing the text to \"fetching data please wait\" when I am sending a JSO request but that does not have any effect and I am constantly shown no data found. \u003c/p\u003e\n\n\u003cp\u003eCan you guys please advise what am I missing?\u003c/p\u003e\n\n\u003cp\u003ePlease don't post a solution with \u003ccode\u003enumberOfRows\u003c/code\u003e as \u003ccode\u003e1\u003c/code\u003e and section returned as \u003ccode\u003e1\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eThanks in advance.\u003c/p\u003e","answer_count":"2","comment_count":"3","creation_date":"2017-10-16 06:40:11.97 UTC","last_activity_date":"2017-10-17 06:43:27.213 UTC","last_edit_date":"2017-10-16 08:09:49.673 UTC","last_editor_display_name":"","last_editor_user_id":"227536","owner_display_name":"","owner_user_id":"7472988","post_type_id":"1","score":"0","tags":"ios|objective-c|uitableview|uilabel","view_count":"50"} +{"id":"2974375","title":"Iframe designmode in Firefox problem","body":"\u003cp\u003eThis works in IE, but in firefox it's very strange:\u003c/p\u003e\n\n\u003cp\u003eIf open it normally if firefox, the designmode doesn't work but if i put a breakpoint on \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003ethis.editor.contentWindow.document.designMode\n = \"On\";\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eline, and then release it (after it breaks on it), the designmode works!\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\"\u0026gt;\n\u0026lt;html\u0026gt;\n \u0026lt;head\u0026gt;\n \u0026lt;meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"\u0026gt;\n \u0026lt;title\u0026gt;Untitled Document\u0026lt;/title\u0026gt;\n \u0026lt;script type=\"text/javascript\"\u0026gt;\n\n\n\nTheEditor = function() { \n this.editor = null;\n this.mainDiv=document.getElementById(\"mainDiv\"); \n}\n\nTheEditor.prototype = {\n\n InitializeEditor: function() {\n\n\n this.editor=document.createElement('iframe');\n this.editor.frameBorder=1;\n this.editor.width = \"500px\";\n this.editor.height=\"250px\"; \n\n this.mainDiv.appendChild(this.editor);\n\n this.editor.contentWindow.document.designMode = \"On\"; \n } \n\n\n}\n window.onload = function(){\n obj = new TheEditor;\n obj. InitializeEditor();\n }\n \u0026lt;/script\u0026gt;\n \u0026lt;/head\u0026gt;\n \u0026lt;body\u0026gt;\n \u0026lt;div id=\"mainDiv\"\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"0","creation_date":"2010-06-04 13:06:17.287 UTC","last_activity_date":"2012-10-11 17:30:55.447 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"332590","post_type_id":"1","score":"2","tags":"javascript","view_count":"1607"} +{"id":"44288999","title":"IE vs Chrome - Image Width / Div Width","body":"\u003cp\u003eThis page has a content area where all the posts are held and a side bar. The content and side bar menu are sized properly and fit where they're supposed to in Chrome with the actual posts area taking up the left and the sidebar sitting on the right.\u003c/p\u003e\n\n\u003cp\u003eIn IE, the images are full-width and I'm not sure of a better way to fix this. \u003c/p\u003e\n\n\u003cp\u003eThe same issue was occurring where the images were full-width and adding the \u003ccode\u003ewidth:100%\u003c/code\u003e attribute to the \u003ccode\u003e.htheme_post_image img\u003c/code\u003e element seemed to fix the issue. If you view in IE, the two areas are side-by-side. However, if you click on a post.\u003c/p\u003e\n\n\u003cp\u003eThe side menu is underneath the post and the images/text are full width. \u003c/p\u003e\n\n\u003cp\u003eIf it helps, I'm in IE 11.0.9600\u003c/p\u003e","accepted_answer_id":"44289464","answer_count":"1","comment_count":"0","creation_date":"2017-05-31 15:34:58.617 UTC","last_activity_date":"2017-06-01 14:47:59.233 UTC","last_edit_date":"2017-06-01 14:47:59.233 UTC","last_editor_display_name":"","last_editor_user_id":"5037201","owner_display_name":"","owner_user_id":"5037201","post_type_id":"1","score":"0","tags":"html|css|internet-explorer|cross-browser","view_count":"53"} +{"id":"20472641","title":"iOS touch frame rate","body":"\u003cp\u003eI'm doing this iOS app, where a user drags his finger over the screen of his iPhone along a circular path. During this action, the app plots little dots every other millimeter, effective creating a dotted line along the path.\nThis works fine, as long as the user draws slowly. If he however drags his finger faster, the app is not able to draw a dot at every location on the path, leaving undesired gaps.\nWhat would be a good approach to compensate for this phenomenon?\nThanks ahead\u003c/p\u003e","accepted_answer_id":"20472844","answer_count":"2","comment_count":"1","creation_date":"2013-12-09 14:08:08.85 UTC","last_activity_date":"2013-12-09 14:19:09.43 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"544795","post_type_id":"1","score":"0","tags":"ios|iphone|touch|frame-rate","view_count":"184"} +{"id":"28523845","title":"Spring integration outbound channel for Gemfire to store payload","body":"\u003cp\u003eI am trying to send \u003ccode\u003epayload\u003c/code\u003e over to gemfire cache. I receive this \u003ccode\u003epayload\u003c/code\u003e as a MQ Message. It works fine if my \u003ccode\u003eoutbound adapter\u003c/code\u003e is another \u003ccode\u003eQueue\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eHowever when the outbound channel is outbound adapter for Gemfire it throws exception. Below is the code snippet.\u003c/p\u003e\n\n\u003cp\u003eHelp here is really appreciated. As i am new to Gemfire + Spring IO\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;jms:message-driven-channel-adapter id=\"wMQ_in_channelAdapter\" \n concurrent-consumers=\"5\"\n max-concurrent-consumers=\"10\"\n connection-factory=\"inCachingConnectionFactory\" \n destination=\"requestQueue-mq\"\n extract-payload=\"true\"\n channel=\"demoChannel\"/\u0026gt;\n\n\n\u0026lt;integration:channel id=\"demoChannel\"/\u0026gt;\n\n\u0026lt;integration:service-activator input-channel=\"demoChannel\" \n ref=\"demoBean\"\n method=\"upperCase\"\n output-channel=\"orchestrationChannel\" /\u0026gt; \n\n\u0026lt;integration:channel id=\"orchestrationChannel\"/\u0026gt;\n\n\u0026lt;gfe:cache id=\"PushProducer\" cache-xml-location=\"classpath:PushProducer.xml\"/\u0026gt;\n\n\u0026lt;gfe:lookup-region id=\"exampleRegion\" cache-ref=\"PushProducer\" name=\"exampleRegion\"/\u0026gt; \n\n\u0026lt;int-gfe:outbound-channel-adapter id=\"cacheChannel\" channel=\"orchestrationChannel\" region=\"exampleRegion\"\u0026gt;\n \u0026lt;int-gfe:cache-entries\u0026gt;\n \u0026lt;entry key=\"payload\" value=\"abcd\"/\u0026gt;\n \u0026lt;/int-gfe:cache-entries\u0026gt; \n\u0026lt;/int-gfe:outbound-channel-adapter\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBelow is the error i am seeing when the message is received in the application\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[org.springframework.jms.listener.DefaultMessageListenerContainer#0-3][org.springframework.integration.gemfire.outbound.CacheWritingMessageHandler] org.springframework.integration.gemfire.outbound.CacheWritingMessageHandler#0 received message: GenericMessage [payload=\u0026lt;?xml version=\"1.0\" encoding=\"UTF-8\"?\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe \u003ccode\u003epayload\u003c/code\u003e is printed here in above line.. and the below line is the error \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e12:20:00.196 WARN [org.springframework.jms.listener.DefaultMessageListenerContainer#0-3][org.springframework.jms.listener.DefaultMessageListenerContainer] Execution of JMS message listener failed, and no ErrorHandler has been set.\njava.lang.AbstractMethodError\n at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:78)\n at org.springframework.integration.dispatcher.AbstractDispatcher.tryOptimizedDispatch(AbstractDispatcher.java:116)\n at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:101)\n at org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:97)\n at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:77)\n at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:277)\n at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:239)\n at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:115)\n at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:45)\n at org.springframework.messaging.core.AbstractMessageSendingTemplate.send(AbstractMessageSendingTemplate.java:95)\n at org.springframework.integration.handler.AbstractMessageProducingHandler.sendOutput(AbstractMessageProducingHandler.java:248)\n at org.springframework.integration.handler.AbstractMessageProducingHandler.produceOutput(AbstractMessageProducingHandler.java:171)\n at org.springframework.integration.handler.AbstractMessageProducingHandler.sendOutputs(AbstractMessageProducingHandler.java:119)\n at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:105)\n at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:78)\n at org.springframework.integration.dispatcher.AbstractDispatcher.tryOptimizedDispatch(AbstractDispatcher.java:116)\n at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:101)\n at org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:97)\n at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:77)\n at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:277)\n at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:115)\n at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:45)\n at org.springframework.messaging.core.AbstractMessageSendingTemplate.send(AbstractMessageSendingTemplate.java:95)\n at org.springframework.messaging.core.AbstractMessageSendingTemplate.convertAndSend(AbstractMessageSendingTemplate.java:133)\n at org.springframework.messaging.core.AbstractMessageSendingTemplate.convertAndSend(AbstractMessageSendingTemplate.java:125)\n at org.springframework.integration.gateway.MessagingGatewaySupport.send(MessagingGatewaySupport.java:302)\n at org.springframework.integration.jms.ChannelPublishingJmsMessageListener$GatewayDelegate.send(ChannelPublishingJmsMessageListener.java:479)\n at org.springframework.integration.jms.ChannelPublishingJmsMessageListener.onMessage(ChannelPublishingJmsMessageListener.java:322)\n at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:660)\n at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:620)\n at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:591)\n at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:308)\n at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:246)\n at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1142)\n at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1134)\n at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1031)\n at java.lang.Thread.run(Thread.java:662)\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"28526971","answer_count":"2","comment_count":"0","creation_date":"2015-02-15 07:11:04.167 UTC","favorite_count":"0","last_activity_date":"2015-02-15 14:16:53.087 UTC","last_edit_date":"2015-02-15 09:44:19.743 UTC","last_editor_display_name":"","last_editor_user_id":"2756547","owner_display_name":"","owner_user_id":"2160677","post_type_id":"1","score":"1","tags":"spring-integration|gemfire|spring-data-gemfire","view_count":"223"} +{"id":"42726246","title":"How to make a pie chart for this data set?","body":"\u003cp\u003eI have data set in excel for which I need to show the value as a percentage of total.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCommunity | Number of Men | Total-Population\n A | 5 | 20\n B | 4 | 25\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI need to create a pie chart that shows community A as the title and two sections one depicting 5 men as total of 20.\u003c/p\u003e\n\n\u003cp\u003eI am new to pivot charts so please help!\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-03-10 19:25:28.51 UTC","last_activity_date":"2017-03-10 21:44:16.157 UTC","last_edit_date":"2017-03-10 21:44:16.157 UTC","last_editor_display_name":"","last_editor_user_id":"6110371","owner_display_name":"","owner_user_id":"2794362","post_type_id":"1","score":"-1","tags":"excel|pivot-table","view_count":"18"} +{"id":"22229778","title":"Ancestor/Preceding/Following condition to Xpath","body":"\u003cp\u003eI have the following xml\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;ROOT\u0026gt;\n\u0026lt;ITC\u0026gt;44\u0026lt;/ITC\u0026gt;\n\u0026lt;Description\u0026gt;\u0026lt;/Description\u0026gt;\n\u0026lt;Desc_ID\u0026gt;\u0026lt;/Desc_ID\u0026gt;\n\u0026lt;GenCommunity\u0026gt;\n \u0026lt;Community\u0026gt;\n \u0026lt;SubCommunity\u0026gt;\n \u0026lt;CID\u0026gt;6655779999\u0026lt;/ID\u0026gt;\n \u0026lt;/SubCommunity\u0026gt;\n \u0026lt;CommunityIdGroup\u0026gt;\n \u0026lt;Group\u0026gt;Charly\u0026lt;/Group\u0026gt;\n \u0026lt;/CommunityIdGroup\u0026gt;\n \u0026lt;CommunitySchool\u0026gt;\n \u0026lt;CID\u0026gt;1143211234\u0026lt;/CID\u0026gt;\n \u0026lt;SchoolScheme\u0026gt;\n \u0026lt;ID\u0026gt;DEY\u0026lt;/ID\u0026gt;\n \u0026lt;/SchoolScheme\u0026gt;\n \u0026lt;/CommunitySchool\u0026gt;\n \u0026lt;CommunitySchool\u0026gt;\n \u0026lt;CID\u0026gt;1143211234\u0026lt;/CID\u0026gt;\n \u0026lt;SchoolScheme\u0026gt;\n \u0026lt;ID\u0026gt;BSY\u0026lt;/ID\u0026gt;\n \u0026lt;/SchoolScheme\u0026gt;\n \u0026lt;/CommunitySchool\u0026gt;\n \u0026lt;/Community\u0026gt;\n\u0026lt;/GenCommmunity\u0026gt;\n\u0026lt;/ROOT\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCurrently I use this XPath that works perfect:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e//Community/CommunitySchool/CID[following-sibling::SchoolScheme/ID = 'DEY']\n[text()=\"1143211234\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut now I need to add a condition to this Xpath to not select if ITC =44 in the beginning of the file.\u003c/p\u003e\n\n\u003cp\u003eI tried:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e//Community/CommunitySchool/CID[following-sibling::SchoolScheme/ID = 'DEY' and \nancestor::ITC!='44'][text()=\"1143211234\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e//Community/CommunitySchool/CID[following-sibling::SchoolScheme/ID = 'DEY' and \nnot(ancestor::ITC='44')][text()=\"1143211234\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand many more with no luck.\u003c/p\u003e\n\n\u003cp\u003eAny suggestions?\u003c/p\u003e","accepted_answer_id":"22230046","answer_count":"1","comment_count":"0","creation_date":"2014-03-06 16:06:57.323 UTC","last_activity_date":"2014-03-06 16:24:01.797 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"641605","post_type_id":"1","score":"1","tags":"xml|xpath","view_count":"54"} +{"id":"29873496","title":"Generating a UIColor with arguments tilt value data in swift","body":"\u003cp\u003eI'm trying to make an app which will change the colour of the background based on the tilt angle of the device. I'm having no problem finding the tilt values of the device, I just can't seem to use the tilt values as parameters in a UIColor.\u003c/p\u003e\n\n\u003cp\u003eI have the following code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elet manager = CMMotionManager()\n\noverride func viewDidLoad() {\n super.viewDidLoad()\n // Do any additional setup after loading the view, typically from a nib.\n\n manager.gyroUpdateInterval = 0.1\n manager.startGyroUpdates()\n\n if manager.deviceMotionAvailable {\n manager.deviceMotionUpdateInterval = 0.01\n manager.startDeviceMotionUpdatesToQueue(NSOperationQueue.mainQueue()) {\n [weak self] (data: CMDeviceMotion!, error: NSError!) in\n\n let xColor = data.gravity.x\n\n\n self!.view.backgroundColor = UIColor(red: 155/255, green: xColor, blue: 219/255, alpha: 1)\n }\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eYou would think that it would generate a color that varied depending on the x-tilt of the device, but it doesn't. The type is not supported.\u003c/p\u003e\n\n\u003cp\u003eDoes anybody know how I could use the \"xColor\" variable to change the green level of the background color?\u003c/p\u003e","accepted_answer_id":"29873744","answer_count":"1","comment_count":"0","creation_date":"2015-04-26 03:48:50.937 UTC","favorite_count":"0","last_activity_date":"2015-04-26 04:36:59.873 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4803291","post_type_id":"1","score":"1","tags":"ios|iphone|swift|motion|tilt","view_count":"146"} +{"id":"10248030","title":"How to prevent accidental xaml control \"selection\"","body":"\u003cp\u003eI've noticed a strange bug when creating a desing with xaml:\u003c/p\u003e\n\n\u003cp\u003esometimes I'm able to \"select\" controls the way I'd select text.\u003c/p\u003e\n\n\u003cp\u003eNormally the controls would look like this:\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/WyXI5.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003ewhile if accidental selection happens, it looks like this:\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/YvlmN.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eWhy does this happen, and how do I prevent it? \u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eUPDATE\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eHere's the controls that I'm using:\nTreeView-\u003eExpander-\u003eStackPanel-\u003eDataGrid\u003c/p\u003e\n\n\u003cp\u003eBased on the answers, the problem probably originates from TreeView. \u003c/p\u003e\n\n\u003cp\u003eHow do I prevent TreeView items from being selected?\u003c/p\u003e","accepted_answer_id":"10248099","answer_count":"2","comment_count":"2","creation_date":"2012-04-20 14:18:06.53 UTC","last_activity_date":"2012-04-20 14:40:37.07 UTC","last_edit_date":"2012-04-20 14:25:52.733 UTC","last_editor_display_name":"","last_editor_user_id":"847200","owner_display_name":"","owner_user_id":"847200","post_type_id":"1","score":"0","tags":"c#|wpf|xaml|selection","view_count":"101"} +{"id":"33937269","title":"asyncio return \"Task was destroyed but it is pending!\"","body":"\u003cp\u003eI'm new in asynchronus programming. I'm triyng to write script that is used to check statuses of web pages.\nAnd ofcourse I'd like doint thath asynchronus.\nMy snippet:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport aiohttp\nimport asyncio\n\nurl_site = 'http://anysite.com'\nfuzz_file = 'fuzz.txt'\n\n\ndef generate_links(file):\n with open(file) as f:\n return [str(url_site) + str(line.strip()) for line in f]\n\nasync def fetch_page(client, url):\n async with client.get(url) as response:\n return response.status\n\nasync def run():\n links = generate_links(fuzz_file)\n for f,link in asyncio.as_completed([fetch_page(client,link) for link in links]):\n print(\"[INFO] [{}] {}\".format(f, link))\n\n\nloop = asyncio.get_event_loop()\nconn = aiohttp.ProxyConnector(proxy=\"http://10.7.0.35:8080\")\nclient = aiohttp.ClientSession(loop=loop, connector=conn)\nloop.run_until_complete(run())\nclient.close()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut I'm getting the next errors:\u003ccode\u003eTask was destroyed but it is pending!\u003c/code\u003e\nCould someone to point me where I made mistake?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-11-26 11:17:39.99 UTC","last_activity_date":"2015-11-26 21:26:08.033 UTC","last_edit_date":"2015-11-26 12:24:27.113 UTC","last_editor_display_name":"","last_editor_user_id":"4251615","owner_display_name":"","owner_user_id":"4251615","post_type_id":"1","score":"1","tags":"python|python-asyncio|aiohttp","view_count":"702"} +{"id":"7504617","title":"Why does this override of a generic method work with 1.6, but not 1.7?","body":"\u003cp\u003eGiven the following class, which overrides the getListeners method from AbstractListModel:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport java.util.EventListener;\nimport javax.swing.AbstractListModel;\n\npublic class GenericBug extends AbstractListModel {\n\n/**\n * This is the method of interest\n * This is the exact same method signature that is present in the base class\n */\n@Override\npublic \u0026lt;T extends EventListener\u0026gt; T[] getListeners(Class\u0026lt;T\u0026gt; listenerType) {\n // do something useful here...\n return super.getListeners(listenerType);\n}\n\n// Not important here\n@Override\npublic int getSize() {\n return 0;\n}\n@Override\npublic Object getElementAt(int index) {\n return null;\n}\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis class compiles fine using an Oracle 1.6 JDK. Trying the exact same class using an Oracle 1.7 JDK, I get compile errors saying there is a name clash, but the method isn't overridden (but it is!!)\u003c/p\u003e\n\n\u003cp\u003eHere is the error I get when I use JDK7:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e% /usr/java/jdk1.7.0/bin/javac GenericBug.java\nGenericBug.java:10: error: name clash: \u0026lt;T#1\u0026gt;getListeners(Class\u0026lt;T#1\u0026gt;) in GenericBug and \u0026lt;T#2\u0026gt;getListeners(Class\u0026lt;T#2\u0026gt;) in AbstractListModel have the same erasure, yet neither overrides the other\n public \u0026lt;T extends EventListener\u0026gt; T[] getListeners(Class\u0026lt;T\u0026gt; listenerType) {\n ^\n where T#1,T#2 are type-variables:\n T#1 extends EventListener declared in method \u0026lt;T#1\u0026gt;getListeners(Class\u0026lt;T#1\u0026gt;)\n T#2 extends EventListener declared in method \u0026lt;T#2\u0026gt;getListeners(Class\u0026lt;T#2\u0026gt;)\nGenericBug.java:12: error: incompatible types\n return super.getListeners(listenerType);\n ^\n required: T[]\n found: EventListener[]\n where T is a type-variable:\n T extends EventListener declared in method \u0026lt;T\u0026gt;getListeners(Class\u0026lt;T\u0026gt;)\nGenericBug.java:9: error: method does not override or implement a method from a supertype\n @Override\n ^\nNote: GenericBug.java uses unchecked or unsafe operations.\nNote: Recompile with -Xlint:unchecked for details.\n3 errors\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCan someone explain to me what is happening? Is this a compiler bug in JDK1.7, or am I missing something?\u003c/p\u003e","accepted_answer_id":"7505596","answer_count":"1","comment_count":"6","creation_date":"2011-09-21 18:14:55.333 UTC","favorite_count":"2","last_activity_date":"2011-09-21 19:40:59.647 UTC","last_edit_date":"2011-09-21 19:10:24.033 UTC","last_editor_display_name":"","last_editor_user_id":"212589","owner_display_name":"","owner_user_id":"212589","post_type_id":"1","score":"10","tags":"java|generics|java-7","view_count":"4907"} +{"id":"10526425","title":"Good hashing function for US phone numbers?","body":"\u003cp\u003eWhat would be a good hashing function for US phone numbers? Which is basically a 10 digit number? It seems to me that, a simplistic:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e(p1 * (areaCode + p2 * exchangeCode) + extensionCode) % r;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhere \u003ccode\u003ep1\u003c/code\u003e and \u003ccode\u003ep2\u003c/code\u003e are some prime numbers and 'r' is the reduced range, should be fast as well as have good hashing properties. \u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2012-05-10 01:34:32.857 UTC","last_activity_date":"2012-05-31 13:39:44.473 UTC","last_edit_date":"2012-05-10 02:25:52.243 UTC","last_editor_display_name":"","last_editor_user_id":"66455","owner_display_name":"","owner_user_id":"66455","post_type_id":"1","score":"-1","tags":"hash","view_count":"905"} +{"id":"8290609","title":"How to test web development for the Maple browser installed on Samsung TVs?","body":"\u003cp\u003eWe've got a job to develop a dynamic slideshow (featuring changing information) that will be displayed on a big screen Samsung TV.\u003c/p\u003e\n\n\u003cp\u003eThe Samsung TVs run \"Smart TV\" which uses the \"Maple\" browser. Here is the best information I've found: \u003ca href=\"http://webinos.org/deliverable-d026-target-platform-requirements-and-ipr/2-6-samsung-tv-tno/\" rel=\"nofollow\"\u003ehttp://webinos.org/deliverable-d026-target-platform-requirements-and-ipr/2-6-samsung-tv-tno/\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eWe mainly develop in HTML5/CSS3 but it appears that the Maple browser doesn't support these: \u003ca href=\"http://www.scribd.com/doc/51800086/139/Maple-browser\" rel=\"nofollow\"\u003ehttp://www.scribd.com/doc/51800086/139/Maple-browser\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI'd like to be able to properly test our work before giving it to the client. Does anyone have any suggestions on how to do this without buying a big screen TV?\u003c/p\u003e","accepted_answer_id":"8664882","answer_count":"1","comment_count":"1","creation_date":"2011-11-28 01:30:56.88 UTC","favorite_count":"3","last_activity_date":"2011-12-29 07:01:00.093 UTC","last_edit_date":"2011-12-29 07:01:00.093 UTC","last_editor_display_name":"","last_editor_user_id":"364483","owner_display_name":"","owner_user_id":"348485","post_type_id":"1","score":"6","tags":"html|css|testing|samsung-smart-tv","view_count":"4777"} +{"id":"39881674","title":"Tkinter animation without canvas.move()","body":"\u003cp\u003eI would like to animate a canvas item WITHOUT (!!!) the canvas.move() function.\u003c/p\u003e\n\n\u003cp\u003eFor example, I tried this:\u003c/p\u003e\n\n\u003cp\u003esee below:\n coords is known\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef getCoords(i):\n ....\n return coords #a list\n\nfor i in range(4):\n id=canvas.create_oval(getCoords(i))\n canvas.after(1000)\n canvas.delete(id)\n canvas.update()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt does NOT work this way.\nWhat is wrong? and/or\nWhere do I find an example?\u003c/p\u003e","answer_count":"1","comment_count":"6","creation_date":"2016-10-05 18:56:10.997 UTC","last_activity_date":"2016-10-06 11:32:39.563 UTC","last_edit_date":"2016-10-05 20:18:35.717 UTC","last_editor_display_name":"","last_editor_user_id":"7432","owner_display_name":"","owner_user_id":"3421954","post_type_id":"1","score":"0","tags":"animation|tkinter","view_count":"87"} +{"id":"10797930","title":"Python - How do i remove the window border? I have imported UI from Qt into Python and applied setWindowFlags","body":"\u003cp\u003eHow to make this window Border-less (remove minimize/maximize/close)? \u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/j68tz.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e 1 import sys\n 2 from PyQt4 import QtCore, QtGui\n 3 from qt import Ui_MainWindow\n 4 \n 5 class StartQT4(QtGui.QMainWindow):\n 6 def __init__(self, parent=None):\n 7 QtGui.QWidget.__init__(self, parent)\n 8 self.ui = Ui_MainWindow()\n 9 self.ui.setupUi(self))\n 10 \n 11 if __name__ == \"__main__\":\n 12 app = QtGui.QApplication(sys.argv)\n 13 myapp = StartQT4()\n 14 myapp.show()\n 15 app.setWindowFlags(app.FramelessWindowHint) \u0026lt;\u0026lt;\u0026lt; does not working\n 16 sys.exit(app.exec_())\n 17 \n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"10798065","answer_count":"2","comment_count":"0","creation_date":"2012-05-29 11:08:36.043 UTC","favorite_count":"1","last_activity_date":"2012-05-30 08:18:43.653 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"285594","post_type_id":"1","score":"3","tags":"python|linux|pyqt|pyqt4|fedora","view_count":"2247"} +{"id":"14171105","title":"Index inside an index , neo4j","body":"\u003cp\u003eAssume I have the following data:\u003c/p\u003e\n\n\u003cp\u003eI have an \u003cstrong\u003eindex - meal\u003c/strong\u003e\u003cbr/\u003e\nInside the index \u003cstrong\u003emeal\u003c/strong\u003e, I want another index named \u003cstrong\u003epizza\u003c/strong\u003e, and following \u003cstrong\u003eingredients\u003c/strong\u003e:\u003c/p\u003e\n\n\u003cp\u003eThe relationship is : meal-\u003epizza-\u003eingredients\u003c/p\u003e\n\n\u003cp\u003eFor example,\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e(meal index)\nHAWAIIAN pizza(pizza) using sugar,oil,pineapple,others(ingredients)\n Indian pizza(pizza) using curry powder,butter,others(ingredients)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003col\u003e\n\u003cli\u003eHow do I set the \u003cstrong\u003enested list\u003c/strong\u003e in neo4j?\u003c/li\u003e\n\u003cli\u003eHow do I set the key,value pair?\u003c/li\u003e\n\u003c/ol\u003e","answer_count":"0","comment_count":"5","creation_date":"2013-01-05 11:00:23.983 UTC","last_activity_date":"2013-01-06 12:06:49.873 UTC","last_edit_date":"2013-01-06 12:06:49.873 UTC","last_editor_display_name":"","last_editor_user_id":"645270","owner_display_name":"","owner_user_id":"1748884","post_type_id":"1","score":"0","tags":"indexing|neo4j|nested-lists","view_count":"74"} +{"id":"9361589","title":"How do you conditionally route to an action if the request originates from an AJAX call?","body":"\u003cp\u003eUsing APS.NET routing, how do you conditionally route to separate actions based on whether or not the request originated as an AJAX call?\u003c/p\u003e\n\n\u003cp\u003eFor instance on a controller I may have two actions:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic ActionResult List() { return View(); }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic ActionResult ListJSON() { return Content(...); }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'd like both actions to have the same URL, but ListJSON() should get called if the request originated as an AJAX call.\u003c/p\u003e","accepted_answer_id":"9362144","answer_count":"2","comment_count":"0","creation_date":"2012-02-20 13:03:46.637 UTC","last_activity_date":"2012-02-20 13:47:22.377 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"507","post_type_id":"1","score":"0","tags":"ajax|asp.net-mvc|url-routing","view_count":"601"} +{"id":"38317480","title":"Node.js open Chrome Ubuntu 16.04 LTS","body":"\u003cp\u003eThis is a similar question to \u003ca href=\"https://stackoverflow.com/questions/8085474/can-node-js-invoke-chrome\"\u003ehere\u003c/a\u003e. However I am using Ubuntu and the previous question's accepted answer does not seem relevant.\u003c/p\u003e\n\n\u003cp\u003eI am using node to call a shell script that in turn calls chrome. A terminal opens and echo's the url but chrome browser does not open. I have also tried /usr/bin/google-chrome after discovering it from \u003ccode\u003ewhich\u003c/code\u003e command as well as \u003ccode\u003egoogle-chrome-stable\u003c/code\u003e to no avail. Why doesn't chrome launch on Ubuntu with node.js child process? Im running desktop version 16.04 LTS. If I run this shell script on the terminal without node it runs great.\u003c/p\u003e\n\n\u003cp\u003eJS:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar exec = require('child_process').exec,\n child;\n\nchild = exec('gnome-terminal -x '+__dirname+'/ss.sh http://www.google.com',\n function (error, stdout, stderr) {\n console.log('stdout: ' + stdout);\n console.log('stderr: ' + stderr);\n if (error !== null) {\n console.log('exec error: ' + error);\n }\n });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSHELL (ss.sh)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#!/bin/bash\necho $1\ngoogle-chrome $1 --start-maximized\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOUTPUT:\n\u003ca href=\"https://i.stack.imgur.com/YxVAi.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/YxVAi.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eEdit: I just tried running this on another box running Ubuntu 14.04 and receive the error: failed to create /home/user/.pki/nssdb directory. The plot thickens.\u003c/p\u003e\n\n\u003cp\u003eJAVA: If I run this with almost the same code in Java it works perfectly:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic static void main(String[] args) {\n try {\n String url = args[0];\n ProcessBuilder pb = new ProcessBuilder(\"/home/user/ss.sh\", url);\n pb.start();\n } catch (Exception e) {\n e.printStackTrace();\n }\n}\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"5","creation_date":"2016-07-11 22:57:34.037 UTC","last_activity_date":"2016-07-12 00:59:55.33 UTC","last_edit_date":"2017-05-23 11:46:46.347 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"1255956","post_type_id":"1","score":"1","tags":"node.js","view_count":"102"} +{"id":"10963495","title":"Blackberry Thread Image from JSON","body":"\u003cp\u003eI am looking for a way to display images on my ListField from a background thread. First in my drawListRow i try this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epath = (String) imagePaths.elementAt(index);\nbit = connectServerForImage(path);\n\ng.drawBitmap(xText, y + yText, 80, 200, bit, 0, 0);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut can't scroll smoothly throughout the list, and \u003ca href=\"http://clusterlessons.blogspot.com/2011/10/parsing-twitter-json-feed-and.html\" rel=\"nofollow\"\u003ethey\u003c/a\u003e say do not do networking or other blocking operations on the UI. But i also try this \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate class imgConnection extends Thread\n{ \n public imgConnection() {\n super();\n }\n\n public void run() { \n\n try {\n for (int i = 0; i \u0026lt; imagePaths.size(); i++)\n {\n final int index = i; \n String path = imagePaths.elementAt(index).toString();\n bit = connectServerForImage(path);\n image.addElement(bit);\n\n }\n }\n catch (Exception e)\n {\n System.out.println(e.toString()); \n }\n\n UiApplication.getUiApplication().invokeLater(new Runnable() {\n public void run() { \n _list.setSize(image.size());\n subManager.add(_list); \n screen.invalidate();\n } \n });\n\n\n }\n}\n\npublic void drawListRow(ListField list, Graphics g, int index, int y, int w) {\n bit = (Bitmap) image.elementAt(index);\n g.drawBitmap(xText, y + yText, 80, 200, bit, 0, 0);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut nothing happens. Any idea, comments.\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003eYou are right, i just started java development 2 weeks ago particularly BB development and i try this \u003ca href=\"http://clusterlessons.blogspot.com/2011/10/parsing-twitter-json-feed-and.html\" rel=\"nofollow\"\u003elink\u003c/a\u003e. I want to add a background thread to download image after i got the path url from json return.\u003c/p\u003e\n\n\u003cp\u003efirst thread:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e_connectionthread = new Connection();\n_connectionthread.start();\n\nprivate class Connection extends Thread\n{\n public Connection()\n {\n super();\n }\n\n public void run() { \n try {}\n catch (Exception e) {}\n } \n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003esecond thread:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e_imgConnectionThread = new ImgConnection();\n_imgConnectionThread.start();\n\nprivate class ImgConnection extends Thread\n{ \n public ImgConnection() {\n super();\n }\n\n public void run() { \n try {\n }\n catch (Exception e)\n {\n }\n\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ehow to update images on ListField?\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2012-06-09 18:25:29.503 UTC","last_activity_date":"2012-06-10 14:35:14.403 UTC","last_edit_date":"2012-06-10 14:35:14.403 UTC","last_editor_display_name":"","last_editor_user_id":"419","owner_display_name":"","owner_user_id":"1446513","post_type_id":"1","score":"0","tags":"multithreading|image|blackberry|bitmap|listfield","view_count":"259"} +{"id":"19408756","title":"How to SetValue Of GetProperty in base class in csharp C#","body":"\u003cp\u003ei have the following code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic IEnumerable\u0026lt;T\u0026gt; PageData\u0026lt;T\u0026gt;(Expression\u0026lt;Func\u0026lt;T, bool\u0026gt;\u0026gt; predicate, int pageNumber, int pageSize, bool trace)\n {\n var skip = 0;\n if (pageNumber \u0026gt; 0)\n {\n skip = pageNumber - 1;\n }\n\n List\u0026lt;T\u0026gt; data;\n using (IDbConnection db = _dbFactory.OpenDbConnection())\n {\n var totalResults = db.Select\u0026lt;T\u0026gt;(predicate);\n data = totalResults.Skip(pageSize * skip).Take(pageSize).ToList();\n\n if (data.Any())\n {\n var firstRecord = data.FirstOrDefault();\n if (firstRecord != null)\n {\n data.FirstOrDefault().GetType().GetProperty(\"TotalCount\").SetValue(this, totalResults.Count(), null);\n data.FirstOrDefault().GetType().GetProperty(\"TotalPages\").SetValue(this, totalResults.Count() / pageSize, null);\n data.FirstOrDefault().GetType().GetProperty(\"PageNow\").SetValue(this, pageNumber, null);\n }\n }\n\n if (trace) { TraceOut(db.GetLastSql()); }\n }\n return data;\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever my properties are within inherited into T as a base class. How would I set the value when the getProperty is within base.property.\u003c/p\u003e\n\n\u003cp\u003eWhen i try, i get the following error:\u003c/p\u003e\n\n\u003cp\u003eObject does not match target type\u003c/p\u003e\n\n\u003cp\u003ethis is on line:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edata.FirstOrDefault().GetType().GetProperty(\"TotalCount\").SetValue(this, totalResults.Count(), null);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe properties do exist, there fine, just inside base.\u003c/p\u003e\n\n\u003cp\u003ethanks\u003c/p\u003e","accepted_answer_id":"19408997","answer_count":"4","comment_count":"1","creation_date":"2013-10-16 16:28:35.333 UTC","last_activity_date":"2013-10-16 16:41:36.297 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"109251","post_type_id":"1","score":"0","tags":"c#|c#-4.0|reflection","view_count":"312"} +{"id":"586759","title":"Instruments: checking for memory leaks inquiry","body":"\u003cp\u003eI was curious, when one goes ahead and executes their code for leaks checking with Instruments -- is it prudent to hit all of the parts of the app manually to ensure memory leaks are occurring in that respective area? For instance, I believe I have some memory leaks in my application, deep within a UINavigationController tree. Do I go ahead and run the app checking for leaks, while manually drilling down on the iPhone to get to that part of the app? Is Instruments smart enough to find it on its own? What's the proper way of going about it?\u003c/p\u003e\n\n\u003cp\u003eThanks for any insight!\u003c/p\u003e","accepted_answer_id":"586805","answer_count":"2","comment_count":"0","creation_date":"2009-02-25 16:31:05.827 UTC","last_activity_date":"2009-02-25 16:46:00.533 UTC","last_editor_display_name":"","owner_display_name":"anon","post_type_id":"1","score":"1","tags":"iphone|cocoa|cocoa-touch|memory-leaks","view_count":"603"} +{"id":"7034626","title":"How to size an image to be 100% width of the screen, but only if \u003c1024 px","body":"\u003cp\u003eI would like to put an image on a website. I would like it not to be a background image, but a normal image, what I can later use for hovers and \u003cem\u003e\"hover over some region, something changes on the screen\"\u003c/em\u003e kind of interactions.\u003c/p\u003e\n\n\u003cp\u003eWhat I would like to do is to make this image 100% width of the browsing area, but only if the screen is smaller than 1024px. If the screen is bigger, then I want the image to be exactly 1024px wide.\u003c/p\u003e\n\n\u003cp\u003eHow would you do this? Somewhere I've read that CSS3 can do automatic background-width to fit with the browser window, but I think by using background image I cannot do interactive trick on the image later. But I've never done interactive tricks, so maybe it's possible.\u003c/p\u003e\n\n\u003cp\u003e\u003cem\u003eBy interactive tricks I mean that if the mouse pointer is over a polygon region, then a div or an image changes or appears somewhere. Can you point me where to read about this technique, and how is it called?\u003c/em\u003e\u003c/p\u003e\n\n\u003cp\u003eI have no experience in JavaScript, I've only used premade JS plugins, but if you say that for this problem I really should use JS then I have no problem with that.\u003c/p\u003e","accepted_answer_id":"7034644","answer_count":"2","comment_count":"1","creation_date":"2011-08-12 01:00:12.983 UTC","favorite_count":"1","last_activity_date":"2011-08-12 19:21:37.633 UTC","last_edit_date":"2011-08-12 19:21:37.633 UTC","last_editor_display_name":"","last_editor_user_id":"271353","owner_display_name":"","owner_user_id":"518169","post_type_id":"1","score":"2","tags":"javascript|html|css|image","view_count":"304"} +{"id":"26142360","title":"Why is my PHP Google App cron job unsuccessfully accessing the page on successive requests?","body":"\u003cp\u003eI've created a PHP app using the Google App Engine which makes a request to a page outside of the app itself using 'file_get_contents' as a way to request the page's content. The PHP page it accesses then updates some rows of data in a MySQL table. When I access the external PHP page directly, the MySQL table updates properly every time, however the PHP Google App cron job appears to access the page every 2 minutes, but my MySQL table does not update. Is the page being cached? How do I make my PHP Google App cron task request a new version of the external page each time?\u003c/p\u003e","answer_count":"0","comment_count":"4","creation_date":"2014-10-01 13:18:15.04 UTC","last_activity_date":"2014-10-01 13:18:15.04 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4098915","post_type_id":"1","score":"0","tags":"php|google-app-engine|cron|file-get-contents","view_count":"56"} +{"id":"10426636","title":"Why a lot of binary-tree data structures in C do not have a parent node pointer?","body":"\u003cp\u003eI'm new to C programming, and I'm learning C algorithms with C.\u003c/p\u003e\n\n\u003cp\u003eHere is my problem about how to define the binary tree \u003ccode\u003enode\u003c/code\u003e data structure.\u003c/p\u003e\n\n\u003ch2\u003eUse or NOT use a parent node pointer\u003c/h2\u003e\n\n\u003cp\u003eHere are 2 typical sample code for defining a \u003ccode\u003eNode\u003c/code\u003e data structure.\u003c/p\u003e\n\n\u003ch3\u003eWithout parent node pointer\u003c/h3\u003e\n\n\u003cpre\u003e\u003ccode\u003etypedef struct binaryTreeNode_{\n int key;\n void *data;\n binaryTreeNode_ *leftNode;\n binaryTreeNode_ *rightNode;\n} binaryTreeNode;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003ch3\u003eWith parent node pointer\u003c/h3\u003e\n\n\u003cpre\u003e\u003ccode\u003etypedef struct binaryTreeNode_{\n int key;\n void *data;\n binaryTreeNode_ *leftNode;\n binaryTreeNode_ *rightNode;\n binaryTreeNode_ *parentNode;\n} binaryTreeNode;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003ch2\u003eMy question\u003c/h2\u003e\n\n\u003cp\u003eObviously, using a node structure with a parent node pointer will make a lot of work much more easier. Like traverse a node/a tree, DFS/BFS with binary tree. So my question is \u003cstrong\u003ewhy there are some solutions that are based on a structure without parent node?\u003c/strong\u003e.\u003c/p\u003e\n\n\u003cp\u003eAre there any historical reasons? If simply because the limitation of RAM/DISK capacity, I think we can drop the solution that does not have a parent node, can't we? \u003c/p\u003e\n\n\u003ch2\u003eMaybe not relavent\u003c/h2\u003e\n\n\u003cp\u003eJust like \u003cem\u003eLinked List\u003c/em\u003e and \u003cem\u003eDoubly Linked List\u003c/em\u003e, should we use \u003cem\u003eDoubly Linked List\u003c/em\u003e to implement \u003ccode\u003eStack\u003c/code\u003e and \u003ccode\u003eQueue\u003c/code\u003e?\u003c/p\u003e","accepted_answer_id":"10426763","answer_count":"7","comment_count":"0","creation_date":"2012-05-03 07:03:44.287 UTC","last_activity_date":"2017-05-16 06:30:20.027 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"206820","post_type_id":"1","score":"6","tags":"c|algorithm|binary-tree","view_count":"3320"} +{"id":"11928886","title":"How to create a folder in svn repository on fedora","body":"\u003cp\u003eHi i did't used any version control system until now so basically i am newbie in using it.\u003c/p\u003e\n\n\u003cp\u003ePresently the os i am using is Fedora and svn for version controlling, suppose i had given below link to access files\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ehttp://example-theory.com/svn-repos/files/ \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen i clicked on it, i had given username and password and able to access all the files in it. for example the format is as below\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esvn-repos - Revision 4: /files\n\n..\nExamplefolder_1/\nNewfolder_2/\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut i want to create a separate folder with name \u003ccode\u003elatest_files\u003c/code\u003e and need to copy some \u003ccode\u003epdf files\u003c/code\u003e and \u003ccode\u003e.py\u003c/code\u003e in to it.\u003c/p\u003e\n\n\u003cp\u003eHow can i create a folder in svn repository\u003cbr\u003e\nHow to copy the pdf and other files in to it.\u003c/p\u003e\n\n\u003cp\u003eThanks in advance.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdited Code:\u003c/strong\u003e\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eInstalled subversion \u003c/li\u003e\n\u003cli\u003eTried to creater a repository with this command \u003ccode\u003esvnadmin create svn\u003c/code\u003e \nCreated a folde svn\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eTried to make a directory inside the folder \u003ccode\u003esvn\u003c/code\u003e with name \u003ccode\u003efolder_example\u003c/code\u003e with the following command \u003c/p\u003e\n\n\u003cp\u003esvn mkdir folder_example\u003c/p\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eI recieved the following error\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esvn mkdir folder_example\nsvn: '.' is not a working copy\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy intension is to create a folder and import all the files from the link \u003ccode\u003ehttp://example-theory.com/svn-repos/files/\u003c/code\u003e and update and commit with changes in that.\u003c/p\u003e","accepted_answer_id":"11929194","answer_count":"1","comment_count":"5","creation_date":"2012-08-13 06:02:07.21 UTC","last_activity_date":"2012-08-13 07:12:13.553 UTC","last_edit_date":"2012-08-13 07:12:13.553 UTC","last_editor_display_name":"","last_editor_user_id":"1342109","owner_display_name":"","owner_user_id":"1342109","post_type_id":"1","score":"0","tags":"svn|fedora","view_count":"1355"} +{"id":"31215791","title":"Redirection to index in Django and Angular","body":"\u003cp\u003eI have a project with Django and Angular.\u003c/p\u003e\n\n\u003cp\u003eI have a page located at \u003ca href=\"http://localhost:8000/install/#/\" rel=\"nofollow\"\u003ehttp://localhost:8000/install/#/\u003c/a\u003e, that is part of the \u003cem\u003einstall\u003c/em\u003e app. There I have a button which POST a form, then I want the function in my controller to redirect to \u003ca href=\"http://localhost:8000/\" rel=\"nofollow\"\u003ehttp://localhost:8000/\u003c/a\u003e, my index page.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$http.post('install/send_install_form/', installation) //installation is a dictionary\n .then(function(data){\n alert('You will be redirected')\n setTimeout(function(){\n // REDIRECTION TO THE INDEX..?\n },\n 4000\n )\n },\n function(data){\n alert(\"Error\")\n })\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow do we link between and out of apps with Django-Angular?\u003c/p\u003e\n\n\u003cp\u003eThank you!\u003c/p\u003e","accepted_answer_id":"31216099","answer_count":"1","comment_count":"0","creation_date":"2015-07-04 00:48:54.593 UTC","last_activity_date":"2015-07-04 01:49:48.083 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5079316","post_type_id":"1","score":"1","tags":"angularjs|django|redirect|indexing","view_count":"316"} +{"id":"36737772","title":"Invalid JSON when attributesFormat=object is used in the tourguide","body":"\u003cp\u003eWe found an issue with \u003ccode\u003eattributesFormat=object\u003c/code\u003e while testing the tourguide application \u003ca href=\"https://github.com/Fiware/tutorials.TourGuide-App\" rel=\"nofollow\"\u003ehttps://github.com/Fiware/tutorials.TourGuide-App\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eIf we perform the following request:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecurl \u0026lt;cb_host\u0026gt;:\u0026lt;cb_port\u0026gt;/v1/contextEntities/type/Restaurant/id/Elizalde -s -S --header 'Content-Type: application/json' --header 'x-auth-token:\u0026lt;token\u0026gt;' --header 'Fiware-service: tourguide' --header 'Accept: application/json'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewe get this valid JSON:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n \"contextElement\" : {\n \"type\" : \"Restaurant\",\n \"isPattern\" : \"false\",\n \"id\" : \"Elizalde\",\n \"attributes\" : [\n {\n \"name\" : \"address\",\n \"type\" : \"\",\n \"value\" : {\n \"type\" : \"postalAddress\",\n \"streetAddress\" : \"Cuesta de las Cabras Aldapa 2\",\n \"addressRegion\" : \"Araba\",\n \"addressLocality\" : \"Alegría-Dulantzi\",\n \"postalCode\" : \"01240\"\n }\n },\n {\n \"name\" : \"aggregateRating\",\n \"type\" : \"\",\n \"value\" : {\n \"reviewCount\" : 1,\n \"ratingValue\" : 3\n }\n },\n {\n \"name\" : \"capacity\",\n \"type\" : \"PropertyValue\",\n \"value\" : 120,\n \"metadatas\" : [\n {\n \"name\" : \"name\",\n \"type\" : \"\",\n \"value\" : \"capacity\"\n }\n ]\n },\n {\n \"name\" : \"department\",\n \"type\" : \"\",\n \"value\" : \"Franchise3\"\n },\n {\n \"name\" : \"description\",\n \"type\" : \"\",\n \"value\" : \"Restaurante de estilo sidrería ubicado en Alegria-Dulantzi. Además de su menú del día y carta, también ofrece menú de sidrería. El menú del día cuesta 9 euros. Los fines de semana la especialidad de la casa son las alubias con sacramentos. En lo que a bebidas se refiere, hay una amplia selección además de la sidra. Cabe destacar que se puede hacer txotx. La capacidad del establecimiento es de 50 personas pero la sidrería no dispone de aparcamiento.%5cn%5cnHORARIO: %5cn%5cnLunes a domingo: 9:00-17:00 y 19:00-23:00.\"\n },\n {\n \"name\" : \"occupancyLevels\",\n \"type\" : \"PropertyValue\",\n \"value\" : 0,\n \"metadatas\" : [\n {\n \"name\" : \"timestamp\",\n \"type\" : \"\",\n \"value\" : \"\"\n },\n {\n \"name\" : \"name\",\n \"type\" : \"\",\n \"value\" : \"occupancyLevels\"\n }\n ]\n },\n {\n \"name\" : \"position\",\n \"type\" : \"coords\",\n \"value\" : \"42.8404625, -2.5123277\",\n \"metadatas\" : [\n {\n \"name\" : \"location\",\n \"type\" : \"string\",\n \"value\" : \"WGS84\"\n }\n ]\n },\n {\n \"name\" : \"priceRange\",\n \"type\" : \"\",\n \"value\" : 0\n },\n {\n \"name\" : \"telephone\",\n \"type\" : \"\",\n \"value\" : \"945 400 868\"\n }\n ]\n },\n \"statusCode\" : {\n \"code\" : \"200\",\n \"reasonPhrase\" : \"OK\"\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut if we use the attributesFormat=object:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecurl \u0026lt;cb_host\u0026gt;:\u0026lt;cb_port\u0026gt;/v1/contextEntities/type/Restaurant/id/Elizalde?attributesFormat=object -s -S --header 'Content-Type: application/json' --header 'x-auth-token:\u0026lt;token\u0026gt;' --header 'Fiware-service: tourguide' --header 'Accept: application/json'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewe get this invalid JSON:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n \"contextElement\": {\n \"type\": \"Restaurant\",\n \"isPattern\": \"false\",\n \"id\": \"Elizalde\",\n \"attributes\": {\n \"address\": {\n \"type\": \"\",\n \"value\": {\n \"type\": \"postalAddress\",\n \"streetAddress\": \"Cuesta de las Cabras Aldapa 2\",\n \"addressRegion\": \"Araba\",\n \"addressLocality\": \"Alegría-Dulantzi\",\n \"postalCode\": \"01240\"\n }\n },\n \"aggregateRating\": {\n \"type\": \"\",\n \"value\": {\n \"reviewCount\": 1,\n \"ratingValue\": 3\n }\n },\n \"capacity\": {\n \"type\": \"PropertyValue\",\n \"120\",\n \"metadatas\": [{\n \"name\": \"name\",\n \"type\": \"\",\n \"value\": \"capacity\"\n }]\n },\n \"department\": {\n \"type\": \"\",\n \"value\": \"Franchise3\"\n },\n \"description\": {\n \"type\": \"\",\n \"value\": \"Restaurante de estilo sidrería ubicado en Alegria-Dulantzi. Además de su menú del día y carta, también ofrece menú de sidrería. El menú del día cuesta 9 euros. Los fines de semana la especialidad de la casa son las alubias con sacramentos. En lo que a bebidas se refiere, hay una amplia selección además de la sidra. Cabe destacar que se puede hacer txotx. La capacidad del establecimiento es de 50 personas pero la sidrería no dispone de aparcamiento.%5cn%5cnHORARIO: %5cn%5cnLunes a domingo: 9:00-17:00 y 19:00-23:00.\"\n },\n \"occupancyLevels\": {\n \"type\": \"PropertyValue\",\n \"0\",\n \"metadatas\": [{\n \"name\": \"timestamp\",\n \"type\": \"\",\n \"value\": \"\"\n }, {\n \"name\": \"name\",\n \"type\": \"\",\n \"value\": \"occupancyLevels\"\n }]\n },\n \"position\": {\n \"type\": \"coords\",\n \"value\": \"42.8404625, -2.5123277\",\n \"metadatas\": [{\n \"name\": \"location\",\n \"type\": \"string\",\n \"value\": \"WGS84\"\n }]\n },\n \"priceRange\": {\n \"type\": \"\",\n \"0\"\n },\n \"telephone\": {\n \"type\": \"\",\n \"value\": \"945 400 868\"\n }\n }\n },\n \"statusCode\": {\n \"code\": \"200\",\n \"reasonPhrase\": \"OK\"\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSteps to replicate:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eClone the tourguide repository.\u003c/li\u003e\n\u003cli\u003eDeploy the docker containers: \u003ccode\u003ecd fiware-devguide-app/docker/compose\u003c/code\u003e and \u003ccode\u003edocker-compose -f docker-compose.yml up\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003eGet token as explained here : \u003ca href=\"https://github.com/Fiware/tutorials.TourGuide-App#how-to-retrieve-an-oauth-token-to-use-the-api\" rel=\"nofollow\"\u003ehttps://github.com/Fiware/tutorials.TourGuide-App#how-to-retrieve-an-oauth-token-to-use-the-api\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003ePerform the specified requests.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eInformation about orion version: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;orion\u0026gt;\n \u0026lt;version\u0026gt;0.28.0\u0026lt;/version\u0026gt;\n \u0026lt;uptime\u0026gt;0 d, 1 h, 12 m, 25 s\u0026lt;/uptime\u0026gt;\n \u0026lt;git_hash\u0026gt;aaf8020a5de680b6d7e0c00c70cf425bcc4f39c8\u0026lt;/git_hash\u0026gt;\n \u0026lt;compile_time\u0026gt;Mon Mar 21 13:20:37 UTC 2016\u0026lt;/compile_time\u0026gt;\n \u0026lt;compiled_by\u0026gt;root\u0026lt;/compiled_by\u0026gt;\n \u0026lt;compiled_in\u0026gt;838a42ae8431\u0026lt;/compiled_in\u0026gt;\n\u0026lt;/orion\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"36748793","answer_count":"1","comment_count":"1","creation_date":"2016-04-20 08:16:49.917 UTC","last_activity_date":"2016-04-20 15:40:11.823 UTC","last_edit_date":"2016-04-20 08:49:42.69 UTC","last_editor_display_name":"","last_editor_user_id":"6172121","owner_display_name":"","owner_user_id":"6172121","post_type_id":"1","score":"1","tags":"fiware-orion","view_count":"35"} +{"id":"45780087","title":"How to implement Processor API with Exactly-once mode","body":"\u003cp\u003eI'm studying Kafka Stream and using Processor API to implement my use case. The code below shows the Process method which forwards a message downstream and aborts before calling \u003ccode\u003ecommit\u003c/code\u003e. This causes the stream to be reprocessed and duplicates the message on the Sink.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic void process(String key, String value) {\n\n context.forward(key, value);\n\n .. \n ..\n //killed\n\n context.commit();\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eprocessing.guarantee parameter:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003estreamsConfiguration.put(StreamsConfig.PROCESSING_GUARANTEE_CONFIG, StreamsConfig.EXACTLY_ONCE);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs there a way to apply the forwarding only when invoking \u003ccode\u003ecommit\u003c/code\u003e statement. If not, what is the correct approach to implement Exactly-once mode.\u003c/p\u003e\n\n\u003cp\u003eThank you\u003c/p\u003e","accepted_answer_id":"45783581","answer_count":"2","comment_count":"0","creation_date":"2017-08-20 08:31:56.173 UTC","last_activity_date":"2017-08-20 15:07:08.43 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3812692","post_type_id":"1","score":"1","tags":"apache-kafka|apache-kafka-streams","view_count":"90"} +{"id":"8595199","title":"Batch script to prefix file names","body":"\u003cp\u003eI am trying to rename files in a batch script like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003erename %FOLDER%\\* 1-*\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut when I run the script It overwrites the first two characters of the original names with the prefix \"1-\" instead of adding it to the beginning of the file names. How can I work around this? \u003c/p\u003e","accepted_answer_id":"8595296","answer_count":"2","comment_count":"0","creation_date":"2011-12-21 19:26:20.763 UTC","favorite_count":"1","last_activity_date":"2015-03-03 10:39:20.033 UTC","last_edit_date":"2014-09-26 00:44:54.087 UTC","last_editor_display_name":"","last_editor_user_id":"321731","owner_display_name":"","owner_user_id":"1110477","post_type_id":"1","score":"4","tags":"batch-file|file-io|prefix","view_count":"9896"} +{"id":"45409518","title":"Null values ('\\0') are skipped while reading .dat file in AX 2012","body":"\u003cp\u003eI am trying to read a \u003ccode\u003e.dat\u003c/code\u003e file in \u003ccode\u003eAX 2012\u003c/code\u003e through \u003ccode\u003eSystem.IO.StreamReader\u003c/code\u003e. It has values separated by commas. Now, the problem is one of the values is an empty-space and any value after the empty space is not being read.\u003c/p\u003e\n\n\u003cp\u003eEg. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ethe following line : a,b,c, ,d,e,f\nthe values picked : a,b,c, \nI opened the file with notepad ++ and the empty space is actually '\\0' (NULL).\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny workarounds for this?\u003c/p\u003e\n\n\u003cp\u003eHelp would be much appreciated.\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-07-31 07:12:12.657 UTC","last_activity_date":"2017-07-31 09:30:58.807 UTC","last_edit_date":"2017-07-31 09:30:58.807 UTC","last_editor_display_name":"","last_editor_user_id":"3151675","owner_display_name":"","owner_user_id":"8392219","post_type_id":"1","score":"0","tags":"microsoft-dynamics","view_count":"10"} +{"id":"11278049","title":"Google URL Shortener API with python returning error","body":"\u003cp\u003eI'm trying to call the Google URL Shortener API in my python code: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef shorternUrl():\n API_KEY = \"AIzaSyCvhcU63u5OTnUsdYaCFtDkcutNm6lIEpw\"\n apiUrl = 'https://www.googleapis.com/urlshortener/v1/url'\n longUrl = \"http://www.cnn.com\"\n headers = {\"Content-type\": \"application/json\"}\n data = {\"longUrl\": longUrl}\n h = httplib2.Http('.cache')\n try:\n headers, response = h.request(apiUrl, \"POST\", urllib.urlencode(data), headers)\n print response\n\n except Exception, e:\n print \"unexpected error %s\" % e\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut I keep getting this error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n \"error\": {\n \"errors\": [\n {\n \"domain\": \"global\",\n \"reason\": \"parseError\",\n \"message\": \"Parse Error\"\n }\n ],\n \"code\": 400,\n \"message\": \"Parse Error\"\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm not using the Google API for Python. Where i'm I going wrong? \u003c/p\u003e","accepted_answer_id":"11278072","answer_count":"1","comment_count":"0","creation_date":"2012-06-30 22:08:45.113 UTC","last_activity_date":"2012-06-30 22:12:05.573 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"251840","post_type_id":"1","score":"1","tags":"python","view_count":"1553"} +{"id":"7681615","title":"Why does this happen in javascript?","body":"\u003cp\u003eToday I came across this problem in javascript and do not know why it happens.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar a = {\n prop: {\n bool: true\n }\n};\n\nconsole.log(a.prop.bool); // logs true\nvar b = a;\nb.prop.bool = false;\nconsole.log(a.prop.bool); // logs false ¿?\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"7681624","answer_count":"3","comment_count":"2","creation_date":"2011-10-06 23:25:58.753 UTC","last_activity_date":"2011-10-07 00:04:24.913 UTC","last_edit_date":"2011-10-06 23:40:16.35 UTC","last_editor_display_name":"","last_editor_user_id":"20394","owner_display_name":"","owner_user_id":"983152","post_type_id":"1","score":"3","tags":"javascript|reference","view_count":"94"} +{"id":"4761651","title":"Trying to make a onmouseover javascript drop down menu","body":"\u003cp\u003e\u003ca href=\"http://www.table2css.com/articles/how-create-horizontal-css-drop-down-menu-search-engine-friendly\" rel=\"nofollow\"\u003eEffect I want \u003c/a\u003e . Basically I want to popup a simple menu when the user mouseovers a link .\nI tried several ready made scripts , but had trouble integrating them with my site. SO decided to built my own.\nhere is what I am trying to do:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;li onmouseover=showlist1() onmouseout=hidelist1() \u0026gt;\u0026lt;a class=\"navigation\" href=\"show_delhi_items.php\"\u0026gt;Menu heading\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n\n function showlist1() //onmouseover\n {\n\n document.getElementById('list1').style.visibility='visible' ;\n\n }\n function hidelist1() //onmouseout\n {\n if (menu elements don't have focus)\n {\n document.getElementById('list1').style.visibility='hidden' ;\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003enow in this how do I implement the 'menu elements don't have focus' part ? I know its not possible to know which elemtn has focus. so I need an alternative. Basically the problem is that as soon as the mouse moves outside the main link(the link that popups the hidden menu), the menu hides. what i want is for the menu to remain visible if it gets focus. but currently it gets hidden as soon as the mouse outside our main link\u003c/p\u003e\n\n\u003cp\u003ehope I was clear enough.\u003c/p\u003e","accepted_answer_id":"4761758","answer_count":"2","comment_count":"1","creation_date":"2011-01-21 17:09:58.487 UTC","last_activity_date":"2011-01-21 17:19:44.137 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"161179","post_type_id":"1","score":"1","tags":"javascript","view_count":"3149"} +{"id":"38089730","title":"How to mod_rewrite so URL redirects other way around?","body":"\u003cp\u003eI have a .htaccess file where when a user signs up on my site, they'll be redirected to \u003ccode\u003eexample.com/profiles/[username]\u003c/code\u003e . The ugly URL is \u003ccode\u003eexample.com/profiles/?username=john\u003c/code\u003e where john can be any name. Whenever, the user searches for let's say \u003ccode\u003eexample.com/profiles/[username]\u003c/code\u003e a 404 gets displayed, so instead I want this friendly URL to redirect to an ugly one so their profile can be displayed. So I want \u003ccode\u003eexample.com/profiles/john\u003c/code\u003e to be redirected to \u003ccode\u003eexample.com/profiles/?username=john\u003c/code\u003e internally.\u003c/p\u003e\n\n\u003cp\u003eHere's my .htaccess conditions:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eRewriteCond %{THE_REQUEST} /profiles/\\?username=([^\u0026amp;\\s]+) [NC]\nRewriteRule ^ /profiles/%1? [L,R=302]\n\nRewriteRule ^profiles/([\\w-]+)/?$ /profiles/?username=$1 [L]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThese conditions successfully remove the \u003ccode\u003e?username=john\u003c/code\u003e part of the URL, how do I make it so it's the other way around? So when someone searches for \u003ccode\u003eexample.com/profiles/john\u003c/code\u003e it gets redirected to \u003ccode\u003eexample.com/profiles/?username=john\u003c/code\u003e internally so the page gets successfully displayed?\u003c/p\u003e","answer_count":"1","comment_count":"8","creation_date":"2016-06-29 03:12:21.657 UTC","last_activity_date":"2016-06-29 03:57:02.48 UTC","last_edit_date":"2016-06-29 03:57:02.48 UTC","last_editor_display_name":"","last_editor_user_id":"5209769","owner_display_name":"","owner_user_id":"5209769","post_type_id":"1","score":"0","tags":"php|apache|.htaccess|mod-rewrite","view_count":"23"} +{"id":"37398451","title":"Deserializing JSON with Child and Inner Childs","body":"\u003cp\u003eI am familiar with JSON.net a bit and can Deserialize the JSON with basic structure (upto one child). I am currently in process of Deserializing the JSON that is returned from Netatmo API. The structure of JSON is complicated for me. Following is the basic structure of the JSON,\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e_id\nplace\n location\n Dynamic Value 1\n Dynamic Value2\n altitude\n timezone\nmark\nmeasures\n Dynamic Value 1\n res\n Dynamic Value 1\n Dynamic Value 1\n Dynamic Value 2\n type\n Dynamic Value 1\n Dynamic Value 2\nmodules\n Dynamic Value 1\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eDynamic Value 1 and Dynamic Value 2 represents the values that is changed for each id. The complete JSON is given below,\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n \"body\": [{\n \"_id\": \"70:ee:50:02:b4:8c\",\n \"place\": {\n \"location\": [-35.174779762001, -5.8918476117544],\n \"altitude\": 52,\n \"timezone\": \"America\\/Fortaleza\"\n },\n \"mark\": 0,\n \"measures\": {\n \"02:00:00:02:ba:2c\": {\n \"res\": {\n \"1464014579\": [16.7, 77]\n },\n \"type\": [\"temperature\", \"humidity\"]\n },\n \"70:ee:50:02:b4:8c\": {\n \"res\": {\n \"1464014622\": [1018.1]\n },\n \"type\": [\"pressure\"]\n }\n },\n \"modules\": [\"02:00:00:02:ba:2c\"]\n }, {\n \"_id\": \"70:ee:50:12:40:cc\",\n \"place\": {\n \"location\": [-16.074257294385, 11.135715243973],\n \"altitude\": 14,\n \"timezone\": \"Africa\\/Bissau\"\n },\n \"mark\": 14,\n \"measures\": {\n \"02:00:00:06:7b:c8\": {\n \"res\": {\n \"1464015073\": [26.6, 78]\n },\n \"type\": [\"temperature\", \"humidity\"]\n },\n \"70:ee:50:12:40:cc\": {\n \"res\": {\n \"1464015117\": [997]\n },\n \"type\": [\"pressure\"]\n }\n },\n \"modules\": [\"02:00:00:06:7b:c8\"]\n }],\n \"status\": \"ok\",\n \"time_exec\": 0.010364055633545,\n \"time_server\": 1464015560\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am confused by looking at the complex structure of this JSON. For single level of JSON I have used this code in the past,\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eIList\u0026lt;lstJsonAttributes\u0026gt; lstSearchResults = new List\u0026lt;lstJsonAttributes\u0026gt;();\nforeach (JToken objResult in objResults) {\n lstJsonAttributes objSearchResult = JsonConvert.DeserializeObject\u0026lt;lstJsonAttributes\u0026gt;(objResult.ToString());\n lstSearchResults.Add(objSearchResult);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut for so many child I have yet to understand how the object class will be created. Any guidance will highly appreciated.\u003c/p\u003e\n\n\u003cp\u003eUpdate:\nThis is what I have achieved so far.\u003c/p\u003e\n\n\u003cp\u003eI have created a main class as below,\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class PublicDataClass\n{\n public string _id { get; set; }\n public PublicData_Place place { get; set; }\n public string mark { get; set; }\n public List\u0026lt;string\u0026gt; modules { get; set; }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand \"Place\" class is as follow,\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class PublicData_Place\n{\n public List\u0026lt;string\u0026gt; location { get; set; }\n public string altitude { get; set; }\n public string timezone { get; set; }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThen I have Deserialized the object in the following code line,\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar obj = JsonConvert.DeserializeObject\u0026lt;List\u0026lt;PublicDataClass\u0026gt;\u0026gt;(jsonString);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI can now successfully get all the data except the \"measures\" which is little bit more complicated.\u003c/p\u003e","accepted_answer_id":"37401506","answer_count":"2","comment_count":"0","creation_date":"2016-05-23 18:53:30.707 UTC","last_activity_date":"2016-05-23 23:53:29.49 UTC","last_edit_date":"2016-05-23 23:51:10.4 UTC","last_editor_display_name":"","last_editor_user_id":"3744182","owner_display_name":"","owner_user_id":"1361888","post_type_id":"1","score":"2","tags":"c#|json.net","view_count":"1765"} +{"id":"40405280","title":"Could not import 'edit_contact'. The path must be fully qualified","body":"\u003cp\u003eSo, I'm trying to create a table filled with contacts in Python/Django. When I attempt to run the program, I get the above error message (\"ImportError: Could not import 'edit_contact'. The path must be fully qualified.\")\u003c/p\u003e\n\n\u003cp\u003eHere is the views.py I'm using:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efrom contacts.models import Contact\n#, Address, Telephone\nfrom django.http import HttpResponse, HttpResponseRedirect\nfrom django.shortcuts import render_to_response, get_object_or_404, render\nfrom django.template import Context, loader\nfrom django.forms.models import inlineformset_factory\nfrom django.template import loader, Context, RequestContext\nfrom django.core.urlresolvers import reverse\nfrom django.contrib.auth.decorators import login_required\n# Create your views here.\n\ndef index(request):\n #return HttpResponse(\"Hey! You can see contacts here!\")\n contact_list = Contact.objects.all().order_by('last_name')\n return render_to_response('contacts/index.html', {'contact_list': contact_list},\n RequestContext(request))\n\ndef detail(request, contact_id):\n c = get_object_or_404(Contact, pk=contact_id);\n\ndef new_contact(request):\n print \"new_contact\"\n\n #AddressInlineFormSet = inlineformset_factory(Contact,\n\n if request.method == \"POST\":\n form = ContactForm(request.POST)\n if form.is_valid():\n contact = form.save()\n return HttpResponseRedirect(reverse('contacts.views.detail', args=(contact.pk,)))\n else:\n form = ContactForm()\n\n return render_to_response(\"contacts/form.html\",{\n \"form\": form,\n }, RequestContext(request))\n\ndef edit_contact(request, contact_id):\n contact = Contact.objects.get(pk=contact_id)\n if request.method == \"POST\":\n form = ContactForm(request.POST, instane=contact)\n if form.is_valid():\n form.save()\n return HttpResponseRedirect(reverse('contacts.views.detail', args=(contact.pk,)))\n else:\n form = ContactForm(instance = contact)\n return render_to_response(\"contacts/form.html\", {\n \"form\": form,\n }, RequestContext(request))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is the urls.py:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efrom django.conf.urls import url\n\nfrom . import views\n\nurlpatterns = [\n url(r'^$', views.index, name='index'),\n url(r'^(?P\u0026lt;contact_id\u0026gt;\\d+)/$', 'detail', name='contactdetailsurl'),\n url(r'^new/$', 'new_contact', name='newcontacturl'),\n url(r'^(?P\u0026lt;contact_id\u0026gt;\\d+)/edit/$','edit_contact', name='editcontacturl'),\n\n]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd the error is pointing to this line in my site_base.html file:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;li id=\"tab_first\"\u0026gt;\u0026lt;a href=\"\n {% url contacts.views.index %}\n \"\u0026gt;\u0026lt;i class=\"icon-book\"\u0026gt;\u0026lt;/i\u0026gt; Contacts\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eLet me know if you need any more info. Thanks! \u003c/p\u003e","accepted_answer_id":"40405495","answer_count":"1","comment_count":"0","creation_date":"2016-11-03 15:20:02.877 UTC","last_activity_date":"2016-11-03 15:30:08.183 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7095937","post_type_id":"1","score":"0","tags":"python|django","view_count":"193"} +{"id":"45381997","title":"Leave transition not being applied for ReactCSSTransitionGroup","body":"\u003cp\u003eI have the following component:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;ReactCSSTransitionGroup\n transitionName={transitionName}\n transitionAppear={true}\n transitionLeave={true}\n \u0026gt;\n {children}\n \u0026lt;/ReactCSSTransitionGroup\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd the following css classes:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e.slide-appear {\n max-height: 0;\n}\n\n.slide-appear.slide-appear-active {\n max-height: 100vh;\n overflow: visible;\n transition: max-height 500ms ease-in;\n}\n\n.slide-leave {\n max-height: 100vh;\n}\n\n.slide-leave.menu-leave-active {\n overflow: hidden;\n max-height: 0px;\n transition: max-height 500ms ease;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe transitions are working for appear but not for leave.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-07-28 20:34:39.863 UTC","last_activity_date":"2017-07-29 07:00:59.093 UTC","last_edit_date":"2017-07-29 07:00:59.093 UTC","last_editor_display_name":"","last_editor_user_id":"11755","owner_display_name":"","owner_user_id":"11755","post_type_id":"1","score":"0","tags":"reactjs","view_count":"16"} +{"id":"32211659","title":"I need to generate a group of random numbers between 97 and 122","body":"\u003cp\u003eI have to generate random numbers between 97 and 122 using a specific algorithm but I get numbers that are greater than 122. Here is the code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esrand( time (NULL));\n\nint num;\nunsigned i;\n\nfor (i = 0;i\u0026lt;100;i++){\n\n num = 97+(rand()%122);\n\n printf(\"%d\\n\",num );\n\n}\n\nreturn 0;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"1","creation_date":"2015-08-25 18:41:11.55 UTC","last_activity_date":"2015-08-25 19:27:30.547 UTC","last_edit_date":"2015-08-25 19:27:30.547 UTC","last_editor_display_name":"","last_editor_user_id":"2173917","owner_display_name":"","owner_user_id":"3447745","post_type_id":"1","score":"3","tags":"c|random","view_count":"191"} +{"id":"1008098","title":"j2me splash screen","body":"\u003cp\u003eHow to build an image-based splash screen for my j2me application?\u003c/p\u003e\n\n\u003cp\u003eI already have an application and I need an splash screen to attach with it.\u003c/p\u003e","accepted_answer_id":"1014614","answer_count":"2","comment_count":"0","creation_date":"2009-06-17 16:13:53.03 UTC","last_activity_date":"2009-06-18 19:14:00.1 UTC","last_editor_display_name":"","owner_display_name":"JMSA","owner_user_id":"159072","post_type_id":"1","score":"1","tags":"java-me","view_count":"4876"} +{"id":"43301178","title":"is facebook webhook available for ads (marketing api) data?","body":"\u003cp\u003eAm using facebook marketing api to monitor ads insights on campaigns and i want to be notified on the updates of the statistics on my campaigns but i can't find how to use webhook with the marketing api data : campaigns, adsets and ads \u003ca href=\"https://developers.facebook.com/docs/marketing-api\" rel=\"nofollow noreferrer\"\u003ehttps://developers.facebook.com/docs/marketing-api\u003c/a\u003e. \u003c/p\u003e","answer_count":"0","comment_count":"5","creation_date":"2017-04-08 22:54:34.743 UTC","last_activity_date":"2017-04-10 08:01:49.353 UTC","last_edit_date":"2017-04-10 08:01:49.353 UTC","last_editor_display_name":"","last_editor_user_id":"4670132","owner_display_name":"","owner_user_id":"4670132","post_type_id":"1","score":"2","tags":"facebook-marketing-api|facebook-webhooks","view_count":"91"} +{"id":"16384607","title":"Modulus of Power","body":"\u003cp\u003eI had a problem that of calculation of \u003ccode\u003ea^b mod m\u003c/code\u003e , is \npossible using modular exponentiation but the problem i am having is that the b I have is of very large value , \u003ccode\u003eb \u003e 2^63 - 1\u003c/code\u003e so could we modify the modular exponentiation code\u003c/p\u003e\n\n\u003cpre\u003e\nfunction modular_pow(base, exponent, modulus)\n result := 1\n while exponent \u003e 0\n if (exponent mod 2 == 1):\n result := (result * base) mod modulus\n exponent := exponent \u003e\u003e 1\n base = (base * base) mod modulus\n return result\n\u003c/pre\u003e\n\n\u003cp\u003eto accomodate for such a large \u003ccode\u003eb\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eor is it correct that \u003ccode\u003ea^b mod m\u003c/code\u003e is equal to \u003ccode\u003e(a^(b mod m)) mod m\u003c/code\u003e ?\u003c/p\u003e","accepted_answer_id":"16384627","answer_count":"1","comment_count":"2","creation_date":"2013-05-05 12:38:03.953 UTC","last_activity_date":"2013-05-05 12:40:01.167 UTC","last_edit_date":"2013-05-05 12:40:01.167 UTC","last_editor_display_name":"","last_editor_user_id":"768110","owner_display_name":"","owner_user_id":"1887875","post_type_id":"1","score":"-1","tags":"language-agnostic","view_count":"84"} +{"id":"42322612","title":"Catch exceptions in Python 3 like in C#","body":"\u003cp\u003eI'm better versed in C# than Python. \u003c/p\u003e\n\n\u003cp\u003eIn C# I can catch all exceptions as default and handle them like showing a error window or write them to a log file.\u003c/p\u003e\n\n\u003cp\u003eWhat about Python? I can't find a default statement, so that I could write all occurred exceptions to a log file and continue with the program. \u003c/p\u003e\n\n\u003cp\u003eFor example, I want to catch all types of exceptions. In C# it's like this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e try\n {\n do something.....\n }\n catch (Exception ex)\n {\n MessageBox.Show(ex.Message.ToString(),\n @\"Fehler\",\n MessageBoxButton.OK,\n MessageBoxImage.Error\n );\n return false;\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt's not necessary to know what kind of exception the program is throwing. How can I do this in Python?\u003c/p\u003e","accepted_answer_id":"42322688","answer_count":"2","comment_count":"1","creation_date":"2017-02-19 01:21:31.787 UTC","last_activity_date":"2017-02-19 17:23:05.867 UTC","last_edit_date":"2017-02-19 17:23:05.867 UTC","last_editor_display_name":"","last_editor_user_id":"472495","owner_display_name":"","owner_user_id":"2146381","post_type_id":"1","score":"0","tags":"c#|python-3.x","view_count":"99"} +{"id":"5240232","title":"calling initialization code on view which was created by loading nib from file","body":"\u003cp\u003eI loaded a view created by interface builder as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eNSArray *array = [[NSBundle mainBundle] loadNibNamed:@\"MyView\" owner:self options:nil];\nMyView *myView = [array objectAtIndex:0];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe view created in the nib also has a .h and .m UIView subclass associated with it. I have initialization code within my .m source file. What is the preferred method to call initialization code? \u003c/p\u003e","accepted_answer_id":"5240245","answer_count":"1","comment_count":"0","creation_date":"2011-03-09 00:58:32.467 UTC","last_activity_date":"2011-03-09 01:00:39.423 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"225128","post_type_id":"1","score":"0","tags":"iphone|objective-c","view_count":"128"} +{"id":"46852210","title":"Angular 4 animation on children: style jumps back","body":"\u003cp\u003eI want to fade out an element's child, by animating its opacity. It's working fine, but \u003cstrong\u003eat the end of the animation, the child's style is reverted back to it's original state\u003c/strong\u003e (opacity un-set). \u003c/p\u003e\n\n\u003cp\u003eHow can this be prevented / how can I tell Angular to leave the style in the target state once the animation has completed?\u003c/p\u003e\n\n\u003cp\u003eHere's my code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@Component({\n selector: 'app-playground',\n template: `\n \u0026lt;div [@simpleStateTransition]=\"simpleState\"\u0026gt;\n {{ simpleState }}\n \u0026lt;div class=\"fadeout\"\u0026gt;fade this child out!\u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n\n \u0026lt;button (click)=\"toggleSimpleState()\"\u0026gt;toggle simple state\u0026lt;/button\u0026gt;\n `,\n animations: [\n trigger('simpleStateTransition', [\n transition('initial =\u0026gt; extended', group([\n query('.fadeout', animate('300ms', style({'opacity': '0'})))\n ])),\n ])\n ]\n})\nexport class PlaygroundComponent {\n\n simpleState = 'initial'\n\n constructor() { }\n\n toggleSimpleState() {\n this.simpleState = this.simpleState === 'initial' ? 'extended' : 'initial'\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"46875327","answer_count":"1","comment_count":"1","creation_date":"2017-10-20 15:16:58.737 UTC","favorite_count":"1","last_activity_date":"2017-10-22 19:00:50.84 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"102181","post_type_id":"1","score":"2","tags":"angular|animation|angular-animations","view_count":"57"} +{"id":"26958643","title":"java stream parallel read/write","body":"\u003cp\u003ei want to stream an audio file from the internet and play it.\nI am using this code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eint readBytes = 0;\n byte[] audioBuffer = new byte[this.EXTERNAL_BUFFER_SIZE];\n\n readBytes = in.read(audioBuffer, 0, audioBuffer.length);\n while (readBytes != -1) {\n readBytes = in.read(audioBuffer, 0, audioBuffer.length);\n if (readBytes \u0026gt;= 0) {\n dataLine.write(audioBuffer, 0, readBytes);\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe problem with this is that when the Stream is reading, it is not writing. Therefore the music is not playing for a short time every few seconds. \nSo i was wondering if there is a way for the stream to simultaneously read from the inputstream and write to the dataline so the writing is never paused for reading.\u003c/p\u003e","accepted_answer_id":"26959061","answer_count":"2","comment_count":"0","creation_date":"2014-11-16 15:32:41.523 UTC","last_activity_date":"2014-12-12 08:28:40.203 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4258241","post_type_id":"1","score":"0","tags":"java|io|stream|copy","view_count":"623"} +{"id":"38614530","title":"ADO Recordset data not showing on form","body":"\u003cp\u003eI've got a frustrating issue on MS Access 2010 that I would at this stage qualify as a bug. And after having tried all possible workarounds, I am out of ideas and rely on you.\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003ch2\u003eContext\u003c/h2\u003e\n\n\u003cp\u003eHuge Ms Access 2010 application with 25k lines of VBA and \u003e50 forms. It has a client server architecture with a frontend compiled and an Access backend on the network. It makes connections to a twentish of different databases (Oracle/SQL Server/Sybase IQ).\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003ch2\u003eThe problem\u003c/h2\u003e\n\n\u003cp\u003eSometimes when I assign an ADODB recordset to a subform, its data isn't shown in bound fields. I've got \u003ccode\u003e#Name?\u003c/code\u003e everywhere\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eThe data is there.\u003c/strong\u003e I can \u003ccode\u003edebug.print\u003c/code\u003e it, I can see it in the Watches browser, I can read or manipulate it while looping on the recordset object with code. It just not appear in the subform.\u003c/p\u003e\n\n\u003cp\u003eIt can work flawlessly during months, and suddenly one form will start having this issue without any apparent reason (it might happen even on forms that I have not changed). When it happens, it does for all users, so this is really something wrong in the frontend accdb/accde.\u003c/p\u003e\n\n\u003cp\u003eThe issue is not related to a specific DBMS/Driver. It can happen with Oracle or Sybase data.\u003c/p\u003e\n\n\u003cp\u003eI have created my own class abstracting everything related to ADO connections and queries, and use the same technique everywhere. I've got several tenth of forms based on it and most of them works perfectly.\u003c/p\u003e\n\n\u003cp\u003eI have this issue in several parts of my application, and especially in a highly complicated form with lots of subforms and code.\nOn this Main form, a few subforms have the issue, while others don't. And they have the exact same parameters.\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003ch2\u003eThe Code\u003c/h2\u003e\n\n\u003cp\u003eThis is how I populate a form's recordset :\u003c/p\u003e\n\n\n\n\u003cpre class=\"lang-vb prettyprint-override\"\u003e\u003ccode\u003e Set RST = Nothing\n Set RST = New ADODB.Recordset\n Set RST = Oracle_CON.QueryRS(SQL)\n\n If Not RST Is Nothing Then\n Set RST.ActiveConnection = Nothing\n Set Form_the_form_name.Recordset = RST\n End If\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe code called with \u003ccode\u003eOracle_CON.QueryRS(SQL)\u003c/code\u003e is\u003c/p\u003e\n\n\u003cpre class=\"lang-vb prettyprint-override\"\u003e\u003ccode\u003ePublic Function QueryRS(ByVal SQL As String, Optional strTitle As String) As ADODB.Recordset\n\n Dim dbQuery As ADODB.Command\n Dim Output As ADODB.Recordset\n Dim dtTemp As Date\n Dim strErrNumber As Long\n Dim strErrDesc As String\n Dim intSeconds As Long\n\n Dim Param As Variant\n\n If DBcon.state \u0026lt;\u0026gt; adStateOpen Then\n Set QueryRS = Nothing\n Else\n DoCmd.Hourglass True\n\n pLastRows = 0\n pLastSQL = SQL\n pLastError = \"\"\n pLastSeconds = 0\n\n Set dbQuery = New ADODB.Command\n dbQuery.ActiveConnection = DBcon\n dbQuery.CommandText = SQL\n dbQuery.CommandTimeout = pTimeOut\n\n Set Output = New ADODB.Recordset\n\n LogIt SQL, strTitle\n\n dtTemp = Now\n\n On Error GoTo Query_Error\n\n With Output\n .LockType = adLockPessimistic\n .CursorType = adUseClient\n .CursorLocation = adUseClient\n .Open dbQuery\n End With\n\n intSeconds = DateDiff(\"s\", dtTemp, Now)\n\n If Output.EOF Then\n LogIt \"-- \" \u0026amp; Format(Now, \"hh:nn:ss\") \u0026amp; \" | Executed in \" \u0026amp; intSeconds \u0026amp; \" second\" \u0026amp; IIf(intSeconds = 1, \"\", \"s\") \u0026amp; \" | Now rows returned.\"\n Set QueryRS = Nothing\n Else\n Output.MoveLast\n pLastRows = Output.RecordCount\n LogIt \"-- \" \u0026amp; Format(Now, \"hh:nn:ss\") \u0026amp; \" | Executed in \" \u0026amp; intSeconds \u0026amp; \" second\" \u0026amp; IIf(intSeconds = 1, \"\", \"s\") \u0026amp; \" | \" \u0026amp; Output.RecordCount \u0026amp; \" row\" \u0026amp; IIf(Output.RecordCount = 1, \"\", \"s\") \u0026amp; \" returned.\"\n Output.MoveFirst\n Set QueryRS = Output\n End If\n\n End If\n\nExit_Sub:\n pLastSeconds = intSeconds\n Set Output = Nothing\n Set Parameter = Nothing\n Set dbQuery = Nothing\n\n DoCmd.Hourglass False\n\n Exit Function\n\nQuery_Error:\n\n intSeconds = DateDiff(\"s\", dtTemp, Now)\n\n strErrNumber = Err.Number\n strErrDesc = Err.DESCRIPTION\n pLastError = strErrDesc\n\n MsgBox strErrDesc, vbCritical, \"Error \" \u0026amp; pDSN\n\n LogIt strErrDesc, , \"ERROR\"\n\n Set QueryRS = Nothing\n Resume Exit_Sub\n Resume\nEnd Function\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003chr\u003e\n\n\u003ch2\u003eThings I tried so far\u003c/h2\u003e\n\n\u003cp\u003eFor the recordsets I tried every possible variation of \u003c/p\u003e\n\n\u003cpre class=\"lang-vb prettyprint-override\"\u003e\u003ccode\u003e .LockType = adLockPessimistic\n .CursorType = adUseClient\n .CursorLocation = adUseClient\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe subforms handling the recordsets have all a \u003ccode\u003eSnapshot\u003c/code\u003e recordsettype, problem remains if I try \u003ccode\u003edynaset\u003c/code\u003e. \nDataentry, Addition, deletion, edits are all disabled. It's pure read-only.\u003c/p\u003e\n\n\u003cp\u003eI have a habit of disconnecting the recordsets using \u003ccode\u003eRST.ActiveConnection = Nothing\u003c/code\u003e so I can manipulate them afterwards, but this doesn't impact the problem either.\u003c/p\u003e\n\n\u003cp\u003eIt can happens with very simple queries with only one field in the \u003ccode\u003eSELECT\u003c/code\u003e clause and only one field bound to it on a subform.\u003c/p\u003e\n\n\u003cp\u003eReimporting all objects in a fresh accdb doesn't solve the problem either.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eThe solution proposed by \u003cem\u003erandom_answer_guy\u003c/em\u003e worked at first glance, which accreditate the bug hypothesis. Unfortunately my problems reappeared after some (totaly unrelated) changes in the main form. I am back with 4 or 5 subforms not showing data and adding/removing a Load event on all or part of them doesn't make any difference anymore\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eIf you want more information about how weird is this issue, I advise you to read my comment on \u003cem\u003erandom_answer_guy\u003c/em\u003e's answer.\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003ch2\u003eTo conclude\u003c/h2\u003e\n\n\u003cp\u003eWhat is extremely frustrating is that I can have 2 different forms with exactly the same properties and same fields, same SQL instruction over the same DB, same recordset management code: One is showing the data and the other doesn't !\u003c/p\u003e\n\n\u003cp\u003eWhen the problem happens, I have no other choice than erasing all objects manipulated and reimporting them from an older version or recreate them from scratch.\u003c/p\u003e\n\n\u003cp\u003eIf this is not a bug, I am still looking for the proper word to qualify it. \u003c/p\u003e\n\n\u003cp\u003eDoes anyone ever experienced the issue and has an explanation and/or a workaround to propose ?\u003c/p\u003e","answer_count":"2","comment_count":"18","creation_date":"2016-07-27 13:35:12.493 UTC","favorite_count":"1","last_activity_date":"2016-08-31 13:31:44.52 UTC","last_edit_date":"2016-08-24 11:50:38.05 UTC","last_editor_display_name":"","last_editor_user_id":"4197505","owner_display_name":"","owner_user_id":"4197505","post_type_id":"1","score":"10","tags":"sql|vba|ms-access|ms-access-2010|ado","view_count":"416"} +{"id":"38526994","title":"XMLHttpRequest has a 200 status, but responseText is empty","body":"\u003cp\u003eI'm making an XMLHttpRequest to upload an image file. I can see that it's a 200 status and my image is uploading onto my service. However, when I use the code below to get the responseText (which should include information such as: URL for my image, filename, timestamps, image dimensions, etc.), it comes back as an empty string:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e //...\n\n const data = new FormData();\n data.append('file', props);\n data.append('upload_preset', uploadPreset);\n data.append('api_key', apiKey);\n\n const xhr = new XMLHttpRequest();\n xhr.open('POST', cloudinaryURL, true);\n const sendImage = xhr.send(data);\n const imageResponse = xhr.responseText;\n console.log('Response: ', imageResponse);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ePrints this to the console:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eResponse: \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny idea why this is happening / how to resolve this issue?\u003c/p\u003e\n\n\u003cp\u003eThanks!!\u003c/p\u003e","accepted_answer_id":"38527398","answer_count":"1","comment_count":"5","creation_date":"2016-07-22 12:53:36.903 UTC","last_activity_date":"2016-07-22 13:19:40.07 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2778483","post_type_id":"1","score":"0","tags":"javascript|xmlhttprequest","view_count":"155"} +{"id":"14757418","title":"Excel Do While cell text is true","body":"\u003cp\u003eI have a spreadsheet set up like so:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCol A\n-----\nTEXT 1\nMcCartney, Paul\nLennon, John\nHarrison, George\nStarr, Ringo\nTEXT 2\nLee, Geddy\nLifeson, Alex\nPeart, Neil\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn Column B I want to add text as long as you haven't reached 'TEXT 2' yet. For instance, my data might look like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCol A Col B\n----- -----\nTEXT 1 \nMcCartney, Paul Beatles\nLennon, John Beatles\nHarrison, George Beatles\nStarr, Ringo Beatles\nTEXT 2 \nLee, Geddy Rush\nLifeson, Alex Rush\nPeart, Neil Rush\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI tried several combinations of 'Do While' and 'If ... Then... End If', but nothing was working. How do I write the code?\u003c/p\u003e","accepted_answer_id":"14763268","answer_count":"2","comment_count":"0","creation_date":"2013-02-07 17:37:53.267 UTC","last_activity_date":"2013-02-07 23:42:59.567 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"720628","post_type_id":"1","score":"0","tags":"excel|excel-vba","view_count":"106"} +{"id":"712768","title":"What is the best way to handle (nested) record sets?","body":"\u003cp\u003eWhat are the best (cleaner, less resource expensive) ways to pass one-to-many relationships from a db server to a client?\u003c/p\u003e\n\n\u003cp\u003eImagine that I have a Author table and a Book table. I want to to retrieve all the authors whose name starts with \"a\" and all the books they've written. Then, client-side, generate an array of objects \"Author\" whose \"Books\" field is an array of objects \"Books\".\u003c/p\u003e\n\n\u003cp\u003eTwo poor man solutions that come to my mind are:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eRetrieve all the authors, cycle through them on the client and execute an additional query to get all the books\u003c/li\u003e\n\u003cli\u003e\"SELECT a.* FROM author a, book b WHERE a.name like 'A%' and b.author_id = a.id\"\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eThe first solution is really database-side intensive (if i have 1000 authors, i have to execute 1001 queries).\u003c/p\u003e\n\n\u003cp\u003eThe second requires some intensive work client-side, as the program would parse the result as it has the data common to Author repeated on each row.\u003c/p\u003e\n\n\u003cp\u003eAnother solution would be to return multiple record sets from a stored procedure. I've never handled multiple record sets and I'm not sure that all the languages / adaptor classes support them.\u003c/p\u003e\n\n\u003cp\u003eOf course the situation can get worse if any author can have books \u003cem\u003eand\u003c/em\u003e essays and every book can have sample pages and so on.\u003c/p\u003e\n\n\u003cp\u003eAny idea?\nThanks\u003c/p\u003e\n\n\u003cp\u003eEDIT:\nI'm using .net, so ado's datarelations are an option. Are they supported my oracle and mysql?\u003c/p\u003e","answer_count":"5","comment_count":"0","creation_date":"2009-04-03 06:45:04.893 UTC","favorite_count":"1","last_activity_date":"2009-04-06 14:44:50.253 UTC","last_edit_date":"2009-04-03 18:24:46.16 UTC","last_editor_display_name":"pistacchio","last_editor_user_id":"42636","owner_display_name":"pistacchio","owner_user_id":"42636","post_type_id":"1","score":"1","tags":".net|sql|ado.net","view_count":"623"} +{"id":"4927355","title":"HOW TO: Two different jQuery on the same page - The page to be included has the newest jQuery","body":"\u003cp\u003eI have a page to be PHP included anywhere at wish, and that page uses jQuery 1.4.4.\n(I'll make it use even 'newest' from the official jQuery librarys source but...)\nThe thing that I cannot control is the version of the user's-website jQuery library.\nOr even if the user have jQuery at all. \u003c/p\u003e\n\n\u003cp\u003eI've made some tests and including my page into sites that have OLDER jQuery - and there comes to a conflict.\u003c/p\u003e\n\n\u003cp\u003eThis is an example of the script to be included. I can't make this work:\u003c/p\u003e\n\n\u003cp\u003e....php codes....\u003c/p\u003e\n\n\u003cp\u003e....html head.....\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;script type=\"text/javascript\"\u0026gt; var jQ144 = jQuery.noConflict(true);\u0026lt;/script\u0026gt;\n\u0026lt;script type=\"text/javascript\" src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\n\u0026lt;script type=\"text/javascript\"\u0026gt;\njQ144(document).ready(function($){\n\n $(\".helpPlease\").hover(function(){ \n $(this).animate({height:'250px'}, { queue:false, duration:400 });\n },function(){ \n $(\".helpPlease\").animate({height:'17px'}, { queue:false, duration:400 });\n });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e...(the upper code is just for example)...more codes........\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e});\n\u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt just won't work.\u003c/p\u003e\n\n\u003cp\u003eIs there any way to check if the page have already jQuery? And if older - to activate the newer code - the my page's Jquery library ??\nOr... how to just make the newer 'overwrite' the older one??\u003c/p\u003e\n\n\u003cp\u003eOr am I doing something wrong? I tried many suggestions described all over the web but with no results.\u003c/p\u003e\n\n\u003cp\u003eThanks in advance! :)\u003c/p\u003e","accepted_answer_id":"4927443","answer_count":"1","comment_count":"0","creation_date":"2011-02-07 22:23:32.533 UTC","last_activity_date":"2011-02-07 23:13:05.243 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"383904","post_type_id":"1","score":"1","tags":"jquery","view_count":"7798"} +{"id":"34489109","title":"Stopping the ParticleSystem from running all the time","body":"\u003cp\u003eHow do you stop the ParticleSystem that you have inserted as a Game Object in your Scene from running all the time?\u003c/p\u003e\n\n\u003cp\u003eI have a little ideas only and they don't yet work.\u003c/p\u003e\n\n\u003cp\u003eSo let's say I have a \"ParticleSystem3\" named Game Object in my Hierarchy of objects - what is the correct way to reference the ParticleSystem3 and stop it from continuous emitting?\u003c/p\u003e\n\n\u003cp\u003eI don't understand the examples I found when they don't seem to give me a correct reference to the ParticleSystem.\u003c/p\u003e\n\n\u003cp\u003eI know there is a Play, a Pause and a Stop functions in the manual under the ParticleSystem headline. How to use them correctly? I would need only the Stop and so my question is the mechanism of Stop related to the ParticleSystem as I already mentioned.\u003c/p\u003e\n\n\u003cp\u003eI am coding this in either JS (JavaScript) or C#.\u003c/p\u003e\n\n\u003cp\u003eDo you have any tips other than \"Google it\"? I don't find the answer, it seems, and I am a newbie to the Unity3d 5.2. \u003c/p\u003e","answer_count":"2","comment_count":"2","creation_date":"2015-12-28 07:08:11.877 UTC","last_activity_date":"2015-12-29 19:07:45.66 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5722376","post_type_id":"1","score":"0","tags":"javascript|c#|unity3d","view_count":"111"} +{"id":"26093434","title":"SQLClient What error numbers are related to SQL Server Connection errors so I can retry","body":"\u003cp\u003eI get the following error with SQLClient, are there more error numbers than Error Number: -1, 53, 2?\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eError Number: -1, Level: 20, State: 0, Line: 0; Message: A\n network-related or instance-specific error occurred while establishing\n a connection to SQL Server. The server was not found or was not\n accessible. Verify that the instance name is correct and that SQL\n Server is configured to allow remote connections. (provider: SQL\n Network Interfaces, error: 26 - Error Locating Server/Instance\n Specified)\u003c/p\u003e\n \n \u003cp\u003eError Number: 53, Level: 20, State: 0, Line: 0; Message: A\n network-related or instance-specific error occurred while establishing\n a connection to SQL Server. The server was not found or was not\n accessible. Verify that the instance name is correct and that SQL\n Server is configured to allow remote connections. (provider: Named\n Pipes Provider, error: 40 - Could not open a connection to SQL Server)\u003c/p\u003e\n \n \u003cp\u003eError Number: 2, Level: 20, State: 0, Line: 0; Message: A\n network-related or instance-specific error occurred while establishing\n a connection to SQL Server. The server was not found or was not\n accessible. Verify that the instance name is correct and that SQL\n Server is configured to allow remote connections. (provider: Named\n Pipes Provider, error: 40 - Could not open a connection to SQL Server)\u003c/p\u003e\n\u003c/blockquote\u003e","accepted_answer_id":"26094000","answer_count":"2","comment_count":"3","creation_date":"2014-09-29 06:04:46.21 UTC","last_activity_date":"2017-09-15 17:13:14.867 UTC","last_edit_date":"2014-09-29 06:06:51.07 UTC","last_editor_display_name":"","last_editor_user_id":"447156","owner_display_name":"","owner_user_id":"2891111","post_type_id":"1","score":"3","tags":"c#|sql-server|sqlclient","view_count":"3560"} +{"id":"46952704","title":"postgresql - export select query result using command","body":"\u003cp\u003eAs we can take a backup file of database using pg_dump command, similarly can we take backup of a select query result.\u003c/p\u003e\n\n\u003cp\u003eFor example if i have a query \u003ccode\u003eselect * from tablename;\u003c/code\u003e then i want to take backup result of the query that can be restored somewhere.\u003c/p\u003e","accepted_answer_id":"46952767","answer_count":"1","comment_count":"0","creation_date":"2017-10-26 11:07:16.033 UTC","last_activity_date":"2017-11-28 17:59:52.893 UTC","last_edit_date":"2017-11-28 17:59:52.893 UTC","last_editor_display_name":"","last_editor_user_id":"5315974","owner_display_name":"","owner_user_id":"2583175","post_type_id":"1","score":"0","tags":"sql|postgresql","view_count":"15"} +{"id":"24740990","title":"loading data simultaneosuly","body":"\u003cp\u003eI have multiple dataTables and using ajax to load the dataTables data. I have mapped a managed bean with the dataTables and through ajax update can able to hit the database and get/retrieve the records from database. Issue is few tables may have few records to display and few have more.I want to show the records which ever are available first instead of all table to load.\nPlease suggest.Thanks in advance.\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2014-07-14 16:13:33.76 UTC","favorite_count":"2","last_activity_date":"2014-07-17 15:51:01.063 UTC","last_edit_date":"2014-07-17 15:51:01.063 UTC","last_editor_display_name":"","last_editor_user_id":"3684675","owner_display_name":"","owner_user_id":"3684675","post_type_id":"1","score":"2","tags":"javascript|jsf|primefaces|datatable","view_count":"246"} +{"id":"28599011","title":"Issue with routing in angularjs","body":"\u003cp\u003eI am writing a basic angular routing code ,in which if user clicks on show details the corresponding order id will be displayed.I am getting the error.Where am i going wrong ? I have added a sample HTML file.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;html ng-app=\"sample\"\u0026gt;\n\u0026lt;head\u0026gt;\n \u0026lt;script src=\"https://ajax.googleapis.com/ajax/libs/angularjs/1.3.13/angular.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;link rel=\"stylesheet\" href=\"http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css\"\u0026gt;\n \u0026lt;script src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;script src=\"http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\n\u0026lt;/head\u0026gt; \n\u0026lt;body ng-controller=\"test\"\u0026gt;\n \u0026lt;div class=\"container\"\u0026gt;\n \u0026lt;table class=\"table\"\u0026gt;\n \u0026lt;thead\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;th\u0026gt;#\u0026lt;/th\u0026gt;\n \u0026lt;th\u0026gt;Order\u0026lt;/th\u0026gt;\n \u0026lt;th\u0026gt;Details\u0026lt;/th\u0026gt; \n \u0026lt;th\u0026gt;\u0026lt;/th\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;/thead\u0026gt;\n \u0026lt;tbody\u0026gt;\n \u0026lt;tr ng-repeat=\"order in orders\"\u0026gt;\n \u0026lt;td\u0026gt;{{order.id}}\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;{{order.number}}\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;{{order.details}}\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;a href=\"#ShowOrder/{{order.number}}\"\u0026gt;show details\u0026lt;/a\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;/tbody\u0026gt;\n \u0026lt;/table\u0026gt;\n \u0026lt;/div\u0026gt;\n\u0026lt;/body\u0026gt;\n\u0026lt;script\u0026gt;\n var sample=angular.module(\"sample\",[]);\n sample.controller(\"test\",function($scope){\n var person1={id:\"1\",number:\"1234\",details:\"samsung mobile\"};\n var person2={id:\"2\",number:\"1235\",details:\"motorola mobile\"};\n var person3={id:\"1\",number:\"1236\",details:\"MI3 mobile\"};\n var person=[person1,person2,person3];\n $scope.orders=person;\n }); \n sample.config(function($routeProvider){\n $routeProvider.when(\"/ShowOrder/:id\",\n {controller:\"showOrderCtrl\",templateUrl:\"template/order.html\"}); \n })\n sample.controller(\"showOrderCtrl\",function($scope,$routeParams){\n $scope.order_id=$routeParams.id;\n }) \n\u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003c/p\u003e","answer_count":"1","comment_count":"4","creation_date":"2015-02-19 05:10:05.24 UTC","last_activity_date":"2015-02-19 05:16:16.963 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3833745","post_type_id":"1","score":"-3","tags":"angularjs|routing","view_count":"84"} +{"id":"4733869","title":"which is better \"for(int i = 0; i != 5; ++i)\" or \"for(int i = 0; i \u003c= 5; i++)\"?","body":"\u003cp\u003ewhich is better \u003ccode\u003efor(int i = 0; i != 5; ++i)\u003c/code\u003e or \u003ccode\u003efor(int i = 0; i \u0026lt;= 5; i++)\u003c/code\u003e?\u003c/p\u003e\n\n\u003cp\u003ePlease explain the rationale, if possible.\u003c/p\u003e\n\n\u003cp\u003eI read somewhere that != operator is better than comparison operators. also pre-increment operator is better than post-increment operator, since it doesn't require any temporary variable to store the intermediate value.\u003c/p\u003e\n\n\u003cp\u003eIs there any better form of for loop than these two?\u003c/p\u003e\n\n\u003cp\u003ep.s: I use the former one as suggested by one of the sources, which i don't remember now. \u003c/p\u003e","accepted_answer_id":"4733904","answer_count":"6","comment_count":"1","creation_date":"2011-01-19 09:58:56.733 UTC","favorite_count":"0","last_activity_date":"2011-01-19 21:24:06.883 UTC","last_edit_date":"2011-01-19 10:03:23.53 UTC","last_editor_display_name":"","last_editor_user_id":"300805","owner_display_name":"","owner_user_id":"248643","post_type_id":"1","score":"0","tags":"c++|c|performance|for-loop","view_count":"17742"} +{"id":"36070121","title":"Angular UI Router- insert param in url","body":"\u003cp\u003eWorking on a project where I am required to show url link and render data based on the param/id I pass in my url. In the following link AWS is the id. \u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003elink:\u003c/strong\u003e \u003ca href=\"http://link.com/Inventory/ListInventory/TID/AWS/JSON\" rel=\"nofollow noreferrer\"\u003ehttp://link.com/Inventory/ListInventory/TID/AWS/JSON\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003elink:\u003c/strong\u003e \u003ca href=\"http://link.com/Inventory/ListInventory/TID/param/JSON\" rel=\"nofollow noreferrer\"\u003ehttp://link.com/Inventory/ListInventory/TID/param/JSON\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/RJiaN.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/RJiaN.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eCurrently the data renders based on the id I select from the drop down but the url doesn't change. I have some code below but not sure what exactly I am doing wrong.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eApp:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edefine app\nroutes\n$stateProvider\n .state('table', \n {\n url: '/table',\n templateUrl: './js/views/tableTmpl.html',\n controller: 'tableCtrl'\n })\n .state('table.test', \n {\n url: '/test/:tid',\n templateUrl: './js/views/tableTmpl.html',\n controller: 'tableCtrl'\n });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eController\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e(function () {\nvar app = angular.module('inventory_app');\n\napp.controller('tableCtrl', function($scope, tableService, uiGridConstants, $stateParams, $state) {\n\n /************************************************\n GLOBAL TEAM ID VALUES\n ************************************************/\n $scope.tids = ['AWS', 'RET', 'DO', 'HELLO', 'HG', 'MIM', 'ALL'];\n var globalteamId = 'AWS';\n\n $scope.tidsIdFunc = function(tidId) {\n globalteamId = tidId;\n\n $scope.itemClick = function(tid){\n $state.location('table.test', {'ID': tid})\n }; \n\n /*Pass in argumnet for the functions below*/\n getCost(globalteamId);\n getAllData(globalteamId);\n pieGraph(globalteamId);\n histoGraph(globalteamId);\n lineGraph(globalteamId);\n };\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eView\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"dropdown\"\u0026gt;\n \u0026lt;button class=\"btn btn-primary dropdown-toggle\" type=\"button\" id=\"dropdownMenu1\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"true\"\u0026gt;\n TID ID\n \u0026lt;span class=\"caret\"\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;/button\u0026gt;\n \u0026lt;ul class=\"dropdown-menu\" aria-labelledby=\"dropdownMenu1\"\u0026gt;\n \u0026lt;li ng-repeat =\"tid in tids\"\u0026gt;\n \u0026lt;!-- \u0026lt;a ng-click=\"tidsIdFunc(tid)\"\u0026gt;{{tid}}\u0026lt;/a\u0026gt; --\u0026gt;\n \u0026lt;a ng-click=\"itemClick(tid)\"\u0026gt;{{tid}}\u0026lt;/a\u0026gt;\n \u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eService\u003c/strong\u003e\nMaking HTTP call to json\u003c/p\u003e","accepted_answer_id":"36070613","answer_count":"1","comment_count":"1","creation_date":"2016-03-17 19:35:56.443 UTC","last_activity_date":"2016-03-17 20:03:10.49 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4471028","post_type_id":"1","score":"1","tags":"javascript|angularjs|angularjs-scope|angular-ui-router|angularjs-ng-repeat","view_count":"78"} +{"id":"46188184","title":"Longest common subsequence (Why does this recursive solution not work?)","body":"\u003cp\u003eTrying to write a similar recursive solution to the one described on: http://www.geeksforgeeks.org/longest-common-subsequence/ but it does not work. It outputs one. Anyone have an idea of why?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eLCS_seq_req = (str1, str2) =\u0026gt; {\n\n m=str1.length;\n n=str2.length;\n\n str1_cut = str1.slice(0, m-1)\n str2_cut = str2.slice(0, n-1)\n\n if (m===0 || n===0) {\n return 0\n }\n else if (str1.slice(m-1, m) === str2.slice(n-1, n) ) {\n return LCS_seq_req(str1_cut, str2_cut) + 1\n } else {\n res_1 = LCS_seq_req(str1_cut, str2)\n res_2 = LCS_seq_req(str1,str2_cut)\n\n return Math.max(res_1, res_2)\n }\n\n}\nLCS_seq_req(\"AGGTAB\", \"GXTXAYB\")\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"46188326","answer_count":"2","comment_count":"1","creation_date":"2017-09-13 03:03:32.417 UTC","last_activity_date":"2017-09-13 04:34:21.103 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6118884","post_type_id":"1","score":"0","tags":"javascript|recursion","view_count":"40"} +{"id":"40189468","title":"Bootstrap logo isn't responsive","body":"\u003cp\u003eIf I shrink my screen size, the logo will either be very small and work on mobile phones or very large and work on desktops and looks BLURRY. How can I get the logo to be fluent on all screen sizes, including tablets? The logo size is 793 x 150 pixels, it is a wide logo. This size is just what is uploaded on the server, of course it is a lot smaller on the actual site so it fits in the navbar.\u003c/p\u003e\n\n\u003cp\u003eThe logo is added in HTML like this:\u003c/p\u003e\n\n\u003cp\u003e\u003cdiv class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\"\u003e\r\n\u003cdiv class=\"snippet-code\"\u003e\r\n\u003cpre class=\"snippet-code-html lang-html prettyprint-override\"\u003e\u003ccode\u003e\u0026lt;a class=navbar-brand href=http://example.com/\u0026gt;\u0026lt;img src=\"http://example.com/resources/imgs/logo.png\" alt=\"Example\"\u0026gt;\u0026lt;/a\u0026gt;\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003c/p\u003e\n\n\u003cp\u003eCSS:\u003c/p\u003e\n\n\u003cp\u003e\u003cdiv class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\"\u003e\r\n\u003cdiv class=\"snippet-code\"\u003e\r\n\u003cpre class=\"snippet-code-css lang-css prettyprint-override\"\u003e\u003ccode\u003eheader .navbar-brand {\r\n padding-top: 7px;\r\n padding-bottom: 7px\r\n}\r\nheader .navbar-brand\u0026gt;img {\r\n height: 46px\r\n}\r\nheader .navbar-brand\u0026gt;img {\r\n height: auto;\r\n width: 135px\r\n}\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003c/p\u003e","accepted_answer_id":"40189519","answer_count":"1","comment_count":"4","creation_date":"2016-10-22 07:23:13.997 UTC","last_activity_date":"2016-10-24 04:14:50.42 UTC","last_edit_date":"2016-10-22 07:34:06.36 UTC","last_editor_display_name":"user6765791","owner_display_name":"user6765791","post_type_id":"1","score":"0","tags":"html|css|twitter-bootstrap","view_count":"55"} +{"id":"11729642","title":"Is it a good practice to ignore script type?","body":"\u003cblockquote\u003e\n \u003cp\u003e\u003cstrong\u003ePossible Duplicate:\u003c/strong\u003e\u003cbr\u003e\n \u003ca href=\"https://stackoverflow.com/questions/5622091/html5-script-declarations\"\u003eHTML5 \u0026lt;script\u0026gt; declarations\u003c/a\u003e \u003c/p\u003e\n\u003c/blockquote\u003e\n\n\n\n\u003cp\u003eI've heard a few people say that you don't need to specify a \u003ccode\u003etype=\"text/javascript\"\u003c/code\u003e in a \u003ccode\u003e\u0026lt;script\u0026gt;\u003c/code\u003e tag, as this is the default type.\u003c/p\u003e\n\n\u003cp\u003eIs there any downside if I open my script tags as \u003ccode\u003e\u0026lt;script\u0026gt;\u003c/code\u003e instead of the more verbose \u003ccode\u003e\u0026lt;script type=\"text/javascript\"\u0026gt;\u003c/code\u003e?\u003c/p\u003e","accepted_answer_id":"11729712","answer_count":"4","comment_count":"4","creation_date":"2012-07-30 21:10:56.293 UTC","last_activity_date":"2012-07-30 21:51:18.347 UTC","last_edit_date":"2017-05-23 11:55:46.603 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"485406","post_type_id":"1","score":"5","tags":"html","view_count":"198"} +{"id":"14123792","title":"drop = TRUE doesn't drop factor levels in data.frame while in vector it does","body":"\u003cp\u003eThere is an interesting option \u003ccode\u003edrop = TRUE\u003c/code\u003e in data.frame filtering, see excerpt from \u003ccode\u003ehelp('[.data.frame')\u003c/code\u003e:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003ch3\u003eUsage\u003c/h3\u003e\n \n \u003cp\u003eS3 method for class 'data.frame'\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ex[i, j, drop = ]\n\u003c/code\u003e\u003c/pre\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eBut when I try it on data.frame, it doesn't work!\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026gt; df = data.frame(a = c(\"europe\", \"asia\", \"oceania\"), b = c(1, 2, 3))\n\u0026gt;\n\u0026gt; df[1:2,, drop = TRUE]$a\n[1] europe asia \nLevels: asia europe oceania \u0026lt;--- oceania shouldn't be here!!\n\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI know there are other ways like\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edf2 \u0026lt;- droplevels(df[1:2,])\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003ebut the documentation promised much more elegant way to do this, so why it doesn't work?\u003c/strong\u003e Is it a bug? Because I don't understand how this could be a feature...\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT\u003c/strong\u003e: I was confused by \u003ccode\u003edrop = TRUE\u003c/code\u003e dropping factor levels for vectors, as \u003ca href=\"http://quantitative-ecology.blogspot.cz/2008/02/drop-unused-factor-levels.html\" rel=\"nofollow\"\u003eyou can see here\u003c/a\u003e. It is not very intuitive that \u003ccode\u003e[i, drop = TRUE]\u003c/code\u003e drops factor levels and \u003ccode\u003e[i, j, drop = TRUE]\u003c/code\u003e does not!!\u003c/p\u003e","accepted_answer_id":"14123881","answer_count":"4","comment_count":"7","creation_date":"2013-01-02 14:28:28.053 UTC","last_activity_date":"2017-03-02 21:48:03.76 UTC","last_edit_date":"2014-06-25 11:31:35.55 UTC","last_editor_display_name":"","last_editor_user_id":"1900149","owner_display_name":"","owner_user_id":"684229","post_type_id":"1","score":"5","tags":"r|dataframe|r-factor","view_count":"3829"} +{"id":"8364487","title":"Accessing memory outside of array, binary heap tree","body":"\u003cp\u003eFor a class I was giving an assignment to take input from the command line and create a heap tree with the input. Numbers are read in from the command line.\u003c/p\u003e\n\n\u003cp\u003eFor example:\u003c/p\u003e\n\n\u003cp\u003eSample Input: \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e\u003cem\u003e./Heapify 2 9 7 6 5 8\u003c/em\u003e\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eSample Output: \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e\u003cem\u003e9 6 8 2 5 7\u003c/em\u003e\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI get that much to work, and it seems like every input with 6 numbers or less works fine. When an input is 7 or more numbers like this:\u003c/p\u003e\n\n\u003cp\u003eSample Input: \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e./Heapify 3 10 8 7 5 9 6\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eMy output: \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e32767 10 9 6 8 7 5\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003esomething goes wrong. Obviously I either use to much memory in my program and get a 'crap' number or I am accessing memory outside of my array which results in another 'crap' number. I have been thinking about what could be wrong but I am just not sure. Any help would be appreciated. \u003c/p\u003e\n\n\u003cp\u003eIf you have questions or need clarity on it don't hesitate to ask. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;iostream\u0026gt;\n#include \u0026lt;iomanip\u0026gt;\n#include \u0026lt;cstdlib\u0026gt;\n#include \u0026lt;fstream\u0026gt;\n#include \u0026lt;iterator\u0026gt;\n#include \u0026lt;algorithm\u0026gt;\n#include \u0026lt;functional\u0026gt;\n#include \u0026lt;vector\u0026gt;\n\nusing namespace std;\n\nvoid heap(int *array, int n);\n\nint main(int argc, char* argv[]){\n\n int array[argc+1];\n int length = argc+1;\n\n for(int i = 1; i \u0026lt; length-1; i++){\n array[i]=atoi(argv[i]);\n }\n\n array[0]= -1;\n cout \u0026lt;\u0026lt; \"unheapified array: \";\n for(int k = 1; k \u0026lt; length-1; k++){\n cout \u0026lt;\u0026lt; array[k] \u0026lt;\u0026lt; \" \";\n }\n cout \u0026lt;\u0026lt; endl;\n heap(array, length);\n\n cout \u0026lt;\u0026lt; \"heapified array: \";\n for(int k = 1; k \u0026lt; length-1; k++){\n cout \u0026lt;\u0026lt; array[k] \u0026lt;\u0026lt; \" \";\n }\n cout \u0026lt;\u0026lt; endl;\nreturn 0;\n}\n\nvoid heap(int *array, int n){\n int i, v, j,k;\n bool heap;\n\n for(int i=(n/2); i\u0026gt;0; --i){\n k = i;\n v = array[k];\n heap = false;\n\n while(heap == false \u0026amp;\u0026amp; (2*k) \u0026lt;= n-1){\n j = 2*k;\n if(j\u0026lt;n){\n if(array[j] \u0026lt; array[j+1])\n j += 1;\n }\n if (v \u0026gt;= array[j])\n heap = true;\n else{\n array[k] = array[j];\n k = j;\n }\n } \n array[k] = v; \n }\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"7","creation_date":"2011-12-03 00:40:52.68 UTC","last_activity_date":"2011-12-03 00:49:00.523 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"795033","post_type_id":"1","score":"0","tags":"c++|arrays|algorithm|heap|binary-tree","view_count":"293"} +{"id":"27521015","title":"Finding count of all elemets to the right of current element whose value is less than current element in an array in C","body":"\u003cp\u003eI am trying to find an efficient way to find count of all elemets to the right of current element whose value is less than current element in an array in C.\u003c/p\u003e\n\n\u003cp\u003eFor example:\u003c/p\u003e\n\n\u003cp\u003eMy array is, \u003ccode\u003eR = [2, 4 ,3 ,1]\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eThen for 2, elements on right of 2 are (4,3,1), among which less than 2 is 1. So the count is 1.\nThen for 4, elements on right of 4 are (3,1), among which less than 4 is 3 and 1. So the count is 2.\nThen for 3, elements on right of 3 are (1), among which less than 3 is 1. So the count is 1.\nThen for 1, Nothing on right of 1 , so nothing is less so count is 0.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eSo the output array (Containing all the counts) is [ 1,2,1].\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eHow to do it efficiently in C?\u003c/p\u003e\n\n\u003cp\u003eI wrote the following code snippet, which seems to be incorrect:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efor( i = 0 ; i \u0026lt; size; i++ ) {\n index = find_index(R,size,R[i]);\n\n for( j = index+1 ; j \u0026lt; size; j++ ) {\n values_to_right[j] = R[j]; \n\n }\n print_array(values_to_right, size); \n printf(\"\\n****************\\n\");\n } \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhere as my find_index() and print_array() functions are as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eint find_index(int a[], int num_elements, int value)\n{\n int i;\n for (i=0; i\u0026lt;num_elements; i++)\n {\n if (a[i] == value)\n {\n return(i); /* it was found */\n }\n }\n return(-1); /* if it was not found */\n}\n\n\n\n\nvoid print_array(int a[], int num_elements)\n{\n int i;\n for(i=0; i\u0026lt;num_elements; i++)\n {\n printf(\"%d \", a[i]);\n }\n printf(\"\\n\");\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny help will be much appreciated.\u003c/p\u003e","accepted_answer_id":"27521103","answer_count":"2","comment_count":"2","creation_date":"2014-12-17 08:15:27.42 UTC","last_activity_date":"2014-12-17 08:25:52.23 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3946565","post_type_id":"1","score":"0","tags":"c|arrays","view_count":"96"} +{"id":"12919597","title":"jquery validation events on submit","body":"\u003cp\u003eI have tried to use jquery url validation on this url \u003ca href=\"http://jquery.bassistance.de/validate/demo/ajaxSubmit-intergration-demo.html\" rel=\"nofollow\"\u003ehttp://jquery.bassistance.de/validate/demo/ajaxSubmit-intergration-demo.html\u003c/a\u003e, in this example first validation occur when I try to enter a username and password and the second validation occur when i submit. how does that validation occur only when I submit?\u003c/p\u003e\n\n\u003cp\u003eHope help,\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","answer_count":"2","comment_count":"2","creation_date":"2012-10-16 16:47:47.617 UTC","last_activity_date":"2012-10-16 17:56:18.413 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1657826","post_type_id":"1","score":"0","tags":"jquery|jquery-plugins","view_count":"184"} +{"id":"46743093","title":"Rails4: How can I get the number of idle connections in an ActiveRecord connection pool?","body":"\u003cp\u003eI can see a \u003ccode\u003estat\u003c/code\u003e method defined for Rails 5 (\u003ca href=\"http://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/ConnectionPool.html#method-i-stat\" rel=\"nofollow noreferrer\"\u003ehttp://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/ConnectionPool.html#method-i-stat\u003c/a\u003e). This reports connections in various states. This is not available in Rails 4 or earlier. Is there an alternative way to get the information in Rails 4?\u003c/p\u003e","accepted_answer_id":"46743387","answer_count":"1","comment_count":"0","creation_date":"2017-10-14 09:42:29.607 UTC","last_activity_date":"2017-10-14 10:18:34.923 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"422131","post_type_id":"1","score":"0","tags":"ruby-on-rails|ruby|ruby-on-rails-4|activerecord","view_count":"26"} +{"id":"42903961","title":"How to replace sequential for-loops in R","body":"\u003cp\u003eI'm still pretty new to R programming, and I've read a lot about replacing for-loops, particularly with the apply functions, which has been really useful in making my code more efficient. However, in some of the programs I'm trying to create, I have for-loops where each loop must be carried out in order, because the effects of one loop affect what happens in the next loop, and as far as I'm aware this cannot be achieved with, for example, lapply(). An example of this sort of for-loop:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ep \u0026lt;- 1\n\nfor (i in 1:x) {\n p \u0026lt;- p + sample(c(1, 0), prob = c(p, 1), size = 1)\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs there a way to replace this kind of loop?\u003c/p\u003e\n\n\u003cp\u003eThanks for your time, everyone!\u003c/p\u003e","accepted_answer_id":"42904581","answer_count":"2","comment_count":"4","creation_date":"2017-03-20 12:44:27.883 UTC","last_activity_date":"2017-03-20 13:32:22.84 UTC","last_edit_date":"2017-03-20 13:32:22.84 UTC","last_editor_display_name":"","last_editor_user_id":"7047746","owner_display_name":"","owner_user_id":"7047746","post_type_id":"1","score":"-1","tags":"r|for-loop|sequential","view_count":"46"} +{"id":"32508768","title":"How to resolve Application timeout issue due to SQL Query in 'Killed/ROLLBACK' Scenario","body":"\u003cp\u003eI've an application which has a database in SQL server 2012 and the application use entity framework to communicate with database. In the application, there is a functionality to update a record in a table based on a WHERE condition and the Primary Key field is the one used in the WHERE condition. So the update happens only to a single record (there is no loop or anything just an update to a single record). This is the background.\u003c/p\u003e\n\n\u003cp\u003eHere is the issue now I'm facing - I'm getting a timeout error message from the application when I invoke the functionality to update a record in the table (as mentioned above). I checked the query execution in the SQL server using 'Activity Monitor' and under the 'Processes' tab I could see that the Command of this query comes to 'KILLED/ROLLBACK' after some 'Wait Types' (like LOGBUFFER, pageiolatch_XX, etc...)\u003c/p\u003e\n\n\u003cp\u003eI tried to execute the update query directly in SQL server and that also not responding. So it's clear the issues is with the SQL server and it takes too much time to execute the update query. But the execution plan looks good and the PK field is used as the where condition. Is it something related with disk latency?\u003c/p\u003e\n\n\u003cp\u003eNote: This issues is not consistent, sometimes it works.\u003c/p\u003e\n\n\u003cp\u003eHere is the file stat. How can I interpret or reach a conclusion from these data...\u003c/p\u003e\n\n\u003cp\u003eMy DB\nDbId FileId TimeStamp NumberReads BytesRead IoStallReadMS NumberWrites BytesWritten IoStallWriteMS IoStallMS BytesOnDisk FileHandle\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003e2 1 -1152466625 21199845 1351872315392 2528572322 21869447 1424883785728 10201419039 12729991361 28266332160 0x0000000000000C64\n2 2 -1152466625 1063 45187072 87119 1013000 61628433920 178901888 178989007 6945505280 0x0000000000000CC4\u003c/p\u003e\n\n\u003cp\u003eTempDB\nDbId FileId TimeStamp NumberReads BytesRead IoStallReadMS NumberWrites BytesWritten IoStallWriteMS IoStallMS BytesOnDisk FileHandle\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003e18 1 -1152466625 390905 27728437248 52640514 196501 6927843328 817347538 869988052 58378551296 0x0000000000001F3C\n18 2 -1152466625 24840 1596173312 645024 56563 3335298048 2590871 3235895 938344448 0x00000000000012BC\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/4Dzwq.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/4Dzwq.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2015-09-10 18:02:36.95 UTC","last_activity_date":"2015-09-11 21:21:59.393 UTC","last_edit_date":"2015-09-11 21:21:59.393 UTC","last_editor_display_name":"","last_editor_user_id":"5322272","owner_display_name":"","owner_user_id":"5322272","post_type_id":"1","score":"1","tags":"sql-server|sql-server-2008|sql-server-2008-r2|sql-server-2012","view_count":"204"} +{"id":"14686313","title":".net Framework up-gradation \u0026 entlib, Windsor castle, nant, nhibernate","body":"\u003cp\u003eI am currently using 3.5 framework with VS 2008, that will be upgraded to 4.0. but there are other third-party libraries being used.\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eEnterprise Lib : Version 4.1.0 \u003c/li\u003e\n\u003cli\u003eWindsor Castle : 2.1 \u003c/li\u003e\n\u003cli\u003eNant : 0.85 \u003c/li\u003e\n\u003cli\u003enHibernate : 2.1.2.4\u003c/li\u003e\n\u003cli\u003erhino mocks - 3.6\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eIs it advisable to upgrade above libraries also to their latest versions? any performance improvement etc. I don't have any data points on it.\nPlease share you viewpoint/useful links so that i can take a decision on it.\u003c/p\u003e\n\n\u003cp\u003ethanks\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-02-04 11:59:53.077 UTC","last_activity_date":"2013-02-04 12:05:11.93 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"627969","post_type_id":"1","score":"-1","tags":"nhibernate|castle-windsor|upgrade|nant|enterprise-library-5","view_count":"62"} +{"id":"45028329","title":"And statements in a return C++","body":"\u003cp\u003eI am trying to figure out what is going on with the \"and\" statements in the return line from this sample of code, could someone please tell me what the purpose of putting these \"and\" statements in the return of a function is?\n if just one of them is false would it return false to the function that called it?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ereturn !UsedInRow(board, row, num) \u0026amp;\u0026amp; !UsedInCol(board, col, num) \u0026amp;\u0026amp;\n !UsedInBox(board, row - row % 3 , col - col % 3, num);\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"45028455","answer_count":"6","comment_count":"3","creation_date":"2017-07-11 07:42:22.77 UTC","last_activity_date":"2017-07-11 08:06:13.567 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"8287908","post_type_id":"1","score":"-2","tags":"c++","view_count":"82"} +{"id":"2478551","title":"Are there any good materials or examples on creating a custom Designer in the Delphi IDE","body":"\u003cp\u003eI am working on creating a custom form designer in the Delphi IDE. I'm trying to use the RegisterCustomModule, TBaseCustomModule, and ICustomModule functions, classes, and interfaces.\u003c/p\u003e\n\n\u003cp\u003eMy \u003ca href=\"https://stackoverflow.com/questions/2463346/update-custom-component-when-other-components-on-a-form-are-moved\"\u003efirst question on this\u003c/a\u003e pointed me to the \u003ca href=\"http://www.marcocantu.com/ddh/ddh15/ddh15e.htm\" rel=\"nofollow noreferrer\"\u003eDelphi Developer's Handbook\u003c/a\u003e and the idea that I could even create a custom form designer. However, that book seems to be all Delphi 3 information and things have really changed since then. I'm not finding any material in the Delphi Help file, and searches have not returned very much.\u003c/p\u003e\n\n\u003cp\u003eI did find the \u003ca href=\"http://www.accidentalprogrammer.com/opentools/\" rel=\"nofollow noreferrer\"\u003eAccidental Programmer's page on the Open Tools\u003c/a\u003e, but that looks like it was last updated in 1998? It does at least have the correct unit names and uses the new interfaces.\u003c/p\u003e\n\n\u003cp\u003eI'm willing to track down and buy an older book if that is the best reference.\u003c/p\u003e","accepted_answer_id":"2674974","answer_count":"1","comment_count":"0","creation_date":"2010-03-19 15:36:49.847 UTC","favorite_count":"1","last_activity_date":"2010-08-23 10:12:39.88 UTC","last_edit_date":"2017-05-23 12:01:12.863 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"6174","post_type_id":"1","score":"4","tags":"delphi","view_count":"264"} +{"id":"15109363","title":"How do I tell JsonConvert.SerializeObject to treat a string object as a JSON","body":"\u003cp\u003eHow do I tell \u003ccode\u003eJsonConvert.SerializeObject\u003c/code\u003e to treat the \u003ccode\u003eUserPreferences\u003c/code\u003e as a JSON-object (it is stored in a db as a string).\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public int UserId { get; private set; }\n\n [[JsonProperty something]]\n public string UserPreferences { get; private set; }\n\n public CFUser(Int32 userId, string userPreferences) {\n UserId = userId;\n UserPreferences = userPreferences;\n }\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"15111046","answer_count":"1","comment_count":"0","creation_date":"2013-02-27 10:11:17.487 UTC","last_activity_date":"2013-02-27 13:43:10.287 UTC","last_edit_date":"2013-02-27 10:16:40.117 UTC","last_editor_display_name":"","last_editor_user_id":"1087479","owner_display_name":"","owner_user_id":"1339087","post_type_id":"1","score":"1","tags":"c#|json","view_count":"2769"} +{"id":"13035649","title":"System.UnauthorizedAccessException when writing batch file on Windows 2008","body":"\u003cp\u003eMy C# program (built using VS2010) encounters frequent but intermittent exception \"System.UnauthorizedAccessException\" when writing batch file on Windows Server 2008. \nI am deleting the batch file before I am creating the new one using Text File.CreateText() as shown below:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eif (File.Exists(batchFilePath))\n File.Delete(batchFilePath);\n\ntry\n{\n using (TextWriter writer = File.CreateText(batchFilePath))\n {\n writer.WriteLine(pullCommands.ToString());\n }\n}\ncatch (Exception e) {...}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eUsing handle.exe, I am catching the process holding the file handle during the exception, and it is \"System\". Is this related to Windows 2008 configuration or process? What confuses me this issue does not happen all the time, it's only intermittent. \u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2012-10-23 17:03:59.327 UTC","last_activity_date":"2012-10-23 17:07:13.807 UTC","last_edit_date":"2012-10-23 17:07:13.807 UTC","last_editor_display_name":"","last_editor_user_id":"76337","owner_display_name":"","owner_user_id":"1198458","post_type_id":"1","score":"0","tags":"c#|batch-file|windows-server-2008|unauthorizedaccessexcepti","view_count":"527"} +{"id":"46988182","title":"Aspose: Generate Thumbnail for first page","body":"\u003cp\u003eI wanted to generate a thumbnail for first page. Tried to generate with the following page, cannot print image with good resolution, that should show the image with good resolution in when zoom. Even if we have option to print thumb nail for first few columns would be fine. Please suggest.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eWorkbook book = new Workbook(new ByteArrayInputStream(documentData));\n // Define ImageOrPrintOptions\n ImageOrPrintOptions imgOptions = new ImageOrPrintOptions();\n // Set the vertical and horizontal resolution\n imgOptions.setVerticalResolution(200);\n imgOptions.setHorizontalResolution(200);\n // Set the image's format\n imgOptions.setImageFormat(ImageFormat.getJpeg());\n // One page per sheet is enabled\n imgOptions.setOnePagePerSheet(true);\n // Get the first worksheet\n Worksheet sheet = book.getWorksheets().get(0);\n // Render the sheet with respect to specified image/print options\n SheetRender sr = new SheetRender(sheet, imgOptions);\n // Render the image for the sheet\n sr.toImage(0, \"mythumb.jpg\");\n // Creating Thumbnail \n java.awt.Image img = ImageIO.read(new File(\"mythumb.jpg\")).getScaledInstance(100, 100, BufferedImage.SCALE_SMOOTH);\n BufferedImage img1 = new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB);\n img1.createGraphics().drawImage(\n ImageIO.read(new File(\"mythumb.jpg\")).getScaledInstance(100, 100, img.SCALE_SMOOTH), 0, 0, null);\n return img1;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-10-28 09:25:19.32 UTC","last_activity_date":"2017-10-28 15:01:58.447 UTC","last_edit_date":"2017-10-28 09:28:54.66 UTC","last_editor_display_name":"","last_editor_user_id":"205233","owner_display_name":"","owner_user_id":"6104014","post_type_id":"1","score":"0","tags":"java|aspose|aspose-cells","view_count":"32"} +{"id":"5530870","title":"slider with ajax content - jquery","body":"\u003cp\u003ei need a slider plugin, that load externals html's. \u003c/p\u003e\n\n\u003cp\u003eFor example, four htmls correspond to 4 slides \u003c/p\u003e\n\n\u003cp\u003eSomething like this: \u003ca href=\"http://jqueryfordesigners.com/demo/coda-slider.html\" rel=\"nofollow\"\u003ehttp://jqueryfordesigners.com/demo/coda-slider.html\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003ethanks !\u003c/p\u003e","accepted_answer_id":"5531411","answer_count":"1","comment_count":"0","creation_date":"2011-04-03 16:30:38.19 UTC","last_activity_date":"2011-04-03 18:02:34.607 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"564979","post_type_id":"1","score":"0","tags":"javascript|jquery|plugins","view_count":"2052"} +{"id":"46538705","title":"Call action on button outside function","body":"\u003cp\u003eI wrote a script where I add items to individual sections on the page. I will show you this by the example of one particular section. The problem appears with the c-grid-box, which is responsible for the fadeOut of the parent div. The anonymous function responsible for this action must be called outside of the diva addition function (otherwise I would have to add a function to each call that misses the target). For this I wrote something like this, although it still does not work - what could be the reason here?\u003c/p\u003e\n\n\u003cp\u003e\u003cdiv class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\"\u003e\r\n\u003cdiv class=\"snippet-code\"\u003e\r\n\u003cpre class=\"snippet-code-js lang-js prettyprint-override\"\u003e\u003ccode\u003efunction showModal(type) {\r\n \r\n switch(type) {\r\n\r\n case \"title\":\r\n\r\n $(\".overlay\").fadeIn(\"slow\");\r\n $(\"#modal-inputs\").html('\u0026lt;input type=\"text\" placeholder=\"Title...\" class=\"param-title\" name=\"param-title\" /\u0026gt;\u0026lt;input type=\"text\" placeholder=\"Description...\" class=\"param-description\" name=\"param-description\" /\u0026gt;\u0026lt;input type=\"submit\" class=\"add-btn\" id=\"insert-title\" value=\"Insert\" /\u0026gt;');\r\n\r\n break;\r\n\r\n }\r\n \r\n}\r\n\r\n$(\"#add-text\").on(\"click\", function() {\r\n \r\n showModal(\"title\");\r\n\r\n $(\"#insert-title\").on(\"click\", function() {\r\n \r\n title = $(\".param-title\").val();\r\n description = $(\".param-description\").val();\r\n $('#section-title').append('\u0026lt;div class=\"grid-1-5\"\u0026gt;\u0026lt;div class=\"grid_box\"\u0026gt;\u0026lt;a href=\"#\" class=\"c-grid-box\"\u0026gt;Delete\u0026lt;/i\u0026gt;\u0026lt;/a\u0026gt;\u0026lt;p class=\"grid-box-title\"\u0026gt;'+title+'\u0026lt;/p\u0026gt;\u0026lt;p\u0026gt;'+description+'\u0026lt;/p\u0026gt;\u0026lt;/div\u0026gt;\u0026lt;/div\u0026gt;');\r\n $(\".overlay\").fadeOut(\"slow\");\r\n \r\n });\r\n \r\n});\r\n\r\n$(\".grid_box\").on(\"click\", \".c-grid-box\", function() {\r\n alert(\"foo bar\");\r\n});\u003c/code\u003e\u003c/pre\u003e\r\n\u003cpre class=\"snippet-code-css lang-css prettyprint-override\"\u003e\u003ccode\u003e.overlay {\r\n display: none;\r\n}\u003c/code\u003e\u003c/pre\u003e\r\n\u003cpre class=\"snippet-code-html lang-html prettyprint-override\"\u003e\u003ccode\u003e\u0026lt;script src=\"https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\r\n\r\n\u0026lt;button id=\"add-text\"\u0026gt;\r\n \u0026lt;i class=\"fa fa-align-justify\" aria-hidden=\"true\"\u0026gt;\u0026lt;/i\u0026gt; \r\n \u0026lt;p\u0026gt;Add \u0026lt;i class=\"fa fa-angle-right\" aria-hidden=\"true\"\u0026gt;\u0026lt;/i\u0026gt;\u0026lt;/p\u0026gt;\r\n\u0026lt;/button\u0026gt;\r\n \r\n\u0026lt;section class=\"add-box\" id=\"section-title\"\u0026gt;\r\n\u0026lt;/section\u0026gt;\r\n\r\n\u0026lt;div class=\"overlay\"\u0026gt;\r\n \u0026lt;div class=\"modal-box\"\u0026gt;\r\n \u0026lt;p class=\"modal-title\"\u0026gt;\u0026lt;i class=\"fa fa-cogs\" aria-hidden=\"true\"\u0026gt;\u0026lt;/i\u0026gt;Settings \r\n \u0026lt;a href=\"#\" class=\"c-modal\"\u0026gt;\u0026lt;i class=\"fa fa-times\" aria-hidden=\"true\"\u0026gt;\u0026lt;/i\u0026gt;\u0026lt;/a\u0026gt;\r\n \u0026lt;/p\u0026gt;\r\n \u0026lt;div id=\"modal-inputs\"\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n\u0026lt;/div\u0026gt;\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2017-10-03 06:52:43.883 UTC","last_activity_date":"2017-10-03 07:01:44.673 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"8369591","post_type_id":"1","score":"0","tags":"javascript|jquery","view_count":"33"} +{"id":"11196533","title":"getting text aligned by css or a php function to add space","body":"\u003cp\u003edoes anyone have a nice solution to get de price wich is a variable aligned vertically to the left side? no tables please!\u003c/p\u003e\n\n\u003cp\u003ethe way it is now lines are displayed like this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003einput button $15.00 button\n input button $5.00 button\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand it should look like this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003einput button $15.00 button\ninput button $5.00 button\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI try'd php's sprintf or str_pad but it does not really do anything.\u003c/p\u003e\n\n\u003cp\u003eAny solution is helpfull.\u003c/p\u003e\n\n\u003cp\u003eMy vision is getting blurry now from looking at the php pages\u003c/p\u003e\n\n\u003cp\u003ethis is the html\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"item-checkout\"\u0026gt;\n \u0026lt;!--checkout item--\u0026gt;\n \u0026lt;form class=\"fcheckoutform\" id=\"\u0026lt;?php echo $id_checkoutform;?\u0026gt;\" method=\"post\" action=\"\"\u0026gt;\n \u0026lt;div class=\"naam\"\u0026gt;\u0026lt;?php echo $naam;?\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;div class=\"fr al\"\u0026gt;\n \u0026lt;input name=\"qty\" rel=\"\u0026lt;?php echo $rel;?\u0026gt;\" type=\"text\" size=\"3\" class=\"aantal\"\n value=\"\u0026lt;?php echo $aantal;?\u0026gt;\" maxlength=\"4\" id=\"\u0026lt;?php echo $id_aantal;?\u0026gt;\"\u0026gt;\n \u0026lt;span class=\"btn\"\u0026gt;Toepassen\u0026lt;/span\u0026gt;\n \u0026lt;span class=\"price\"\u0026gt;\u0026lt;?php echo $price_lbl;?\u0026gt;\u0026lt;/span\u0026gt; \n \u0026lt;span class=\"verwijder\"\u0026gt;Remove\u0026lt;/span\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"cbt\"\u0026gt;\u0026lt;/div\u0026gt; \n \u0026lt;/form\u0026gt;\n \u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethanks, Richard\u003c/p\u003e","accepted_answer_id":"11196692","answer_count":"1","comment_count":"6","creation_date":"2012-06-25 20:05:24.44 UTC","last_activity_date":"2012-06-25 20:18:57.32 UTC","last_edit_date":"2012-06-25 20:18:57.32 UTC","last_editor_display_name":"","last_editor_user_id":"133418","owner_display_name":"","owner_user_id":"133418","post_type_id":"1","score":"1","tags":"php|jquery|css|html","view_count":"94"} +{"id":"17770627","title":"Get the value of indexed array?","body":"\u003cp\u003eThis is an easy answer, almost too easy that it makes searching for it kinda of hard...\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003ePHP Foreach:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php $position = get_post_meta(get_the_ID(), '_moon_draggable_values', false); \n if ($position){ \n foreach ($position as $key =\u0026gt; $value)\n echo \"{$key} =\u0026gt; {$value}\\n\"; \n } \n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis outputs \u003ccode\u003e0 =\u0026gt; 233px 1 =\u0026gt; 435px\u003c/code\u003e all Im trying to do is, select the index and echo it, I tried something like \u003ccode\u003eecho $value[1]\u003c/code\u003e hoping to echo the 435px, that didnt work, also trying with \u003ccode\u003e$key\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eConclusion:\u003c/strong\u003e Trying to get a specific array index value 0,1 are the only two indexes (only two arrays)\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eSolution:\u003c/strong\u003e \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php $position = get_post_meta(get_the_ID(), '_moon_draggable_values', false); \n\n $top = $position[0];\n $left = $position[1]; \n\n?\u0026gt; \n\u0026lt;div style=\"left:\u0026lt;?php echo $left ?\u0026gt;; top: \u0026lt;?php echo $top?\u0026gt;; position: absolute;\"\u0026gt;\n\n\u0026lt;?php echo htmlspecialchars_decode(get_post_meta ($post-\u0026gt;ID, '_moon_sortable_content', true));?\u0026gt; \n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"17770742","answer_count":"1","comment_count":"7","creation_date":"2013-07-21 08:52:37.76 UTC","last_activity_date":"2013-07-21 09:15:20.983 UTC","last_edit_date":"2013-07-21 09:15:20.983 UTC","last_editor_display_name":"","last_editor_user_id":"1971279","owner_display_name":"","owner_user_id":"1971279","post_type_id":"1","score":"0","tags":"php|arrays","view_count":"97"} +{"id":"35994335","title":"unswitch while loop optimization in c","body":"\u003cp\u003eI'm having a hard time optimizing the following while loop by means of \u003cstrong\u003eLoop Unswitching\u003c/strong\u003e. I have tried applying the example from \u003ca href=\"https://en.wikipedia.org/wiki/Loop_unswitching\" rel=\"nofollow\"\u003ewiki\u003c/a\u003e, however I am having a hard time applying it to a while loop. I have the following code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eint n = 5,\n m = 5,\n i = 0,\n val = 0;\n\nwhile (i \u0026lt; n ) {\n j = 0;\n\n while (j \u0026lt; m ) {\n if (i \u0026lt; j ) {\n val = val + i ;\n }\n else if ( j == i ) {\n val = val - 1;\n }\n else {\n val = val + j ;\n }\n\n j = j + 1;\n }\n\n i = i + 1;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd have tried unswitching it the following way:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ewhile (i \u0026lt; n ) {\n j = 0;\n\n if (i \u0026lt; j ) {\n while (j \u0026lt; m ) {\n val = val + i;\n j = j + 1;\n }\n }\n\n if ( j == i ) {\n while (j \u0026lt; m) {\n val = val - 1;\n j = j + 1;\n }\n }\n\n if (i \u0026gt; j) {\n while (j \u0026lt; m) {\n val = val + j;\n j = j + 1;\n }\n }\n\n i = i + 1;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat could I be doing wrong.\u003c/p\u003e","accepted_answer_id":"35995553","answer_count":"2","comment_count":"4","creation_date":"2016-03-14 17:37:25.413 UTC","last_activity_date":"2016-03-14 18:43:58.527 UTC","last_edit_date":"2016-03-14 17:51:35.223 UTC","last_editor_display_name":"","last_editor_user_id":"1213904","owner_display_name":"","owner_user_id":"1213904","post_type_id":"1","score":"-3","tags":"c|loops|optimization|compiler-optimization","view_count":"104"} +{"id":"37659285","title":"OrientDB embedding mobile","body":"\u003cp\u003eI am working on a pet project mobile app. I am planning to use OrientDB in embedded mode with the app. Here are the questions i have:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003e\u003cp\u003eAm i free to use OrientDB embedded in a mobile application? This application will be distributed for free to users on Android playstore. \u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eCan the embedded OrientDB synchronise with Baasbox. At this point in time, the synchronization is only one; from mobile to the api server. \u003c/p\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003ePlease let me know. I am a noob with Graph databases in general. \u003c/p\u003e\n\n\u003cp\u003eThanks\nS\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2016-06-06 13:52:26.503 UTC","last_activity_date":"2016-06-06 17:11:39.4 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1577171","post_type_id":"1","score":"0","tags":"licensing|data-modeling|orientdb|baasbox","view_count":"93"} +{"id":"2315826","title":"Help me to choose Socket or TCPListener","body":"\u003cp\u003eI read 2 C# chat source code \u0026amp; I see a problem:\nOne source uses Socket class:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate void StartToListen(object sender , DoWorkEventArgs e)\n{\n this.listenerSocket = new Socket(AddressFamily.InterNetwork , SocketType.Stream , ProtocolType.Tcp);\n this.listenerSocket.Bind(new IPEndPoint(this.serverIP , this.serverPort));\n this.listenerSocket.Listen(200);\n while ( true )\n this.CreateNewClientManager(this.listenerSocket.Accept());\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd other one uses TcpListener class:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e server = new TcpListener(portNumber);\n logger.Info(\"Server starts\");\n while (true)\n {\n server.Start();\n if (server.Pending())\n {\n TcpClient connection = server.AcceptTcpClient();\n logger.Info(\"Connection made\");\n BackForth BF = new BackForth(connection);\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ePlease help me to choose the one. I should use Socket class or TcpListener class. Socket connection is TCP or UDP? Thanks.\u003c/p\u003e","accepted_answer_id":"2315847","answer_count":"1","comment_count":"0","creation_date":"2010-02-23 02:51:07.243 UTC","favorite_count":"1","last_activity_date":"2010-02-23 03:06:01.8 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"253940","post_type_id":"1","score":"3","tags":"c#|networking","view_count":"3622"} +{"id":"10440792","title":"Why does \"[] == False\" evaluate to False when \"if not []\" succeeds?","body":"\u003cp\u003eI'm asking this because I know that the pythonic way to check whether a list is empty or not is the following: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emy_list = []\nif not my_list:\n print \"computer says no\"\nelse:\n # my_list isn't empty\n print \"computer says yes\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewill print \u003ccode\u003ecomputer says no\u003c/code\u003e, etc. So this leads me to identify \u003ccode\u003e[]\u003c/code\u003e with \u003ccode\u003eFalse\u003c/code\u003e truth-values; however, if I try to compare [] and False \"directly\", I obtain the following: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026gt;\u0026gt;\u0026gt; my_list == False\nFalse\n\u0026gt;\u0026gt;\u0026gt; my_list is False\nFalse\n\u0026gt;\u0026gt;\u0026gt; [] == False\nFalse\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eetc... \u003c/p\u003e\n\n\u003cp\u003eWhat's going on here? I feel like I'm missing something really obvious.\u003c/p\u003e","accepted_answer_id":"10440825","answer_count":"4","comment_count":"1","creation_date":"2012-05-03 23:33:35.477 UTC","favorite_count":"3","last_activity_date":"2014-01-03 17:19:23.833 UTC","last_edit_date":"2012-05-03 23:42:01.4 UTC","last_editor_display_name":"user166390","owner_display_name":"","owner_user_id":"913071","post_type_id":"1","score":"26","tags":"python","view_count":"2660"} +{"id":"31578226","title":"html to pdf generation using itext in java","body":"\u003cp\u003e\u003cstrong\u003eDescription\u003c/strong\u003e:\u003cbr\u003e\n\u003cstrong\u003e\u003cem\u003eouput\u003c/em\u003e\u003c/strong\u003e: \u003ccode\u003epdf file\u003c/code\u003e\u003cbr\u003e\n\u003cstrong\u003e\u003cem\u003einput\u003c/em\u003e\u003c/strong\u003e : \u003ccode\u003eindex.css\u003c/code\u003e, \u003ccode\u003ebootstrap.min.css\u003c/code\u003e, \u003ccode\u003eindex.html\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eProblem\u003c/strong\u003e: if i use index.css file without bootsrap its working fine, but when i use boot strap its throw exception.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eCODE is here:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epackage test.test1;\n\nimport java.io.ByteArrayInputStream;\nimport java.io.ByteArrayOutputStream;\nimport java.io.File;\nimport java.io.FileOutputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.InputStreamReader;\n\nimport org.apache.commons.codec.Charsets;\n\nimport com.google.common.io.CharStreams;\nimport com.itextpdf.text.Document;\nimport com.itextpdf.text.DocumentException;\nimport com.itextpdf.text.PageSize;\nimport com.itextpdf.text.pdf.PdfWriter;\nimport com.itextpdf.tool.xml.Pipeline;\nimport com.itextpdf.tool.xml.XMLWorker;\nimport com.itextpdf.tool.xml.XMLWorkerHelper;\nimport com.itextpdf.tool.xml.css.CssFile;\nimport com.itextpdf.tool.xml.css.StyleAttrCSSResolver;\nimport com.itextpdf.tool.xml.html.Tags;\nimport com.itextpdf.tool.xml.parser.XMLParser;\nimport com.itextpdf.tool.xml.pipeline.css.CSSResolver;\nimport com.itextpdf.tool.xml.pipeline.css.CssResolverPipeline;\nimport com.itextpdf.tool.xml.pipeline.end.PdfWriterPipeline;\nimport com.itextpdf.tool.xml.pipeline.html.HtmlPipeline;\nimport com.itextpdf.tool.xml.pipeline.html.HtmlPipelineContext;\n\npublic class Table {\n\n\n\n File oFile = new File(\"c:\\\\test\\\\1.pdf\");\n Document document = new Document(PageSize.A4, 0, 0, 0, 0);\n PdfWriter writer =null;\n\n public Table() throws IOException, DocumentException {\n oFile.createNewFile();\n writer=PdfWriter.getInstance(document,new FileOutputStream(oFile));\n\n\n InputStream htmlpathtest = Thread.currentThread()\n .getContextClassLoader()\n .getResourceAsStream(\"index.html\");\n String htmlstring = CharStreams.toString(new InputStreamReader(htmlpathtest, Charsets.UTF_8));\n\n InputStream is = new ByteArrayInputStream(htmlstring.getBytes());\n\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n\n PdfWriter writer = PdfWriter.getInstance(document, baos);\n\n writer.setInitialLeading(12.5f);\n\n document.open();\n\n HtmlPipelineContext htmlContext = new HtmlPipelineContext(null);\n\n htmlContext.setTagFactory(Tags.getHtmlTagProcessorFactory());\n\n // CSS\n CSSResolver cssResolver = new StyleAttrCSSResolver();\n InputStream csspathtest = Thread.currentThread()\n .getContextClassLoader()\n .getResourceAsStream(\"css\\\\index.css\");\n\n InputStream csspathtest1 = Thread.currentThread()\n .getContextClassLoader()\n .getResourceAsStream(\"css\\\\bootstrap.min.css\");\n\n CssFile cssfiletest = XMLWorkerHelper.getCSS(csspathtest);\n cssResolver.addCss(cssfiletest);\n cssResolver.addCss(XMLWorkerHelper.getCSS(csspathtest1));\n\n\n Pipeline\u0026lt;?\u0026gt; pipeline = new CssResolverPipeline(cssResolver,\n new HtmlPipeline(htmlContext, new PdfWriterPipeline(\n document, writer)));\n\n XMLWorker worker = new XMLWorker(pipeline, true);\n XMLParser p = new XMLParser(worker);\n p.parse(is);\n document.close();\n }\n public static void main(String[] args) throws IOException, DocumentException { new Table();}\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eException:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eException in thread \"main\" java.lang.NumberFormatException: For input\n string: \"100%\" at\n sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1222)\n at java.lang.Float.parseFloat(Float.java:422) at\n com.itextpdf.tool.xml.css.FontSizeTranslator.getFontSize(FontSizeTranslator.java:186)\n at\n com.itextpdf.tool.xml.css.FontSizeTranslator.translateFontSize(FontSizeTranslator.java:165)\n at\n com.itextpdf.tool.xml.html.AbstractTagProcessor.startElement(AbstractTagProcessor.java:120)\n at\n com.itextpdf.tool.xml.pipeline.html.HtmlPipeline.open(HtmlPipeline.java:105)\n at com.itextpdf.tool.xml.XMLWorker.startElement(XMLWorker.java:103)\n at\n com.itextpdf.tool.xml.parser.XMLParser.startElement(XMLParser.java:372)\n at\n com.itextpdf.tool.xml.parser.state.TagEncounteredState.process(TagEncounteredState.java:104)\n at\n com.itextpdf.tool.xml.parser.XMLParser.parseWithReader(XMLParser.java:237)\n at com.itextpdf.tool.xml.parser.XMLParser.parse(XMLParser.java:215)\n at com.itextpdf.tool.xml.parser.XMLParser.parse(XMLParser.java:188)\n at test.test1.Table.(Table.java:95) at\n test.test1.Table.main(Table.java:104)\u003c/p\u003e\n\u003c/blockquote\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-07-23 04:32:46.85 UTC","last_activity_date":"2015-07-23 05:11:45.837 UTC","last_edit_date":"2015-07-23 05:11:45.837 UTC","last_editor_display_name":"","last_editor_user_id":"718379","owner_display_name":"","owner_user_id":"2580437","post_type_id":"1","score":"0","tags":"java|css|pdf-generation|itext","view_count":"729"} +{"id":"10050044","title":"word counter for Textarea in Django Form","body":"\u003cp\u003eI am just starting out in django. I want to integrate a maximum word counter into Textarea of my django form. I have been looking into many sources, but I have become all the more confused.\u003c/p\u003e\n\n\u003cp\u003eI would really appreciate any suggestions. (I know how to write a javascript for a word counter for plain html forms). The main confusion for me is how to add something like the \"onClick\" attribute to fields in django forms.\u003c/p\u003e\n\n\u003cp\u003eThanks a bunch.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2012-04-06 22:38:25.837 UTC","last_activity_date":"2012-04-06 22:49:27.433 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1318344","post_type_id":"1","score":"0","tags":"django-forms","view_count":"395"} +{"id":"15384355","title":"CallendarExtender is not a known element","body":"\u003cp\u003eI have two pages with the same code for ´UpdatePanel, ScriptManager and CalendarExtender\u003ccode\u003e, in one of them, the\u003c/code\u003eCalendarExtender` is working fine, but in the other, it's giving me this error: \u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eCalendarExtender is not a known Element\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eHere's my code on \u003ccode\u003easpx\u003c/code\u003e \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;%@ Register Assembly=\"AjaxControlToolkit\" Namespace=\"AjaxControlToolKit\" TagPrefix=\"asp\" %\u0026gt;\n\n\u0026lt;asp:Content ID=\"Content2\" ContentPlaceHolderID=\"ContentPlaceHolder2\" runat=\"server\"\u0026gt;\n \u0026lt;div id=\"conteudo\" style=\"text-align: left\"\u0026gt; \n \u0026lt;fieldset id=\"fieldset\" style=\"width:730px; margin-left: -200px\"\u0026gt;\n \u0026lt;legend style=\"text-align:center;\"\u0026gt;\u0026lt;b\u0026gt;Detalhes do Chamado\u0026lt;/b\u0026gt;\u0026lt;/legend\u0026gt; \n \u0026lt;div id=\"DetalhesChamado\"\u0026gt;\n \u0026lt;asp:ScriptManager ID=\"ScriptManager1\" runat=\"server\" EnableScriptGlobalization=\"true\" EnableScriptLocalization=\"true\" EnablePartialRendering=\"true\"\u0026gt;\u0026lt;/asp:ScriptManager\u0026gt;\n \u0026lt;asp:UpdatePanel ID=\"UpdatePanel1\" runat=\"server\"\u0026gt;\n \u0026lt;ContentTemplate\u0026gt;\n //Here is a gridview \n \u0026lt;asp:CalendarExtender runat=\"server\"\u0026gt;\u0026lt;/asp:CalendarExtender\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut still giving the error... \u003c/p\u003e\n\n\u003cp\u003e--Update 2-- \u003c/p\u003e\n\n\u003cp\u003eNow i'm getting this error:\u003cbr\u003e\n \u003ccode\u003eThe TargetControlID of 'CalendarExtender1' is not valid. A control with ID 'TxtPrevisao' could not be found.\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eMy New code: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;asp:TemplateField\u0026gt;\n \u0026lt;ItemTemplate\u0026gt;\n \u0026lt;asp:TextBox ID=\"TxtPrevisao\" runat=\"server\" Width=\"115px\"\u0026gt;\u0026lt;/asp:TextBox\u0026gt;\n \u0026lt;asp:CalendarExtender ID=\"CalendarExtender1\" runat=\"server\" Format=\" dd ,MMMM ,yyyy\" TargetControlID=\"TxtPrevisao\" PopupButtonID=\"TxtPrevisao\" CssClass=\"MyCalendar\"\u0026gt;\n \u0026lt;/asp:CalendarExtender\u0026gt;\n \u0026lt;/ItemTemplate\u0026gt;\n\u0026lt;/asp:TemplateField\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"1","creation_date":"2013-03-13 11:44:06.91 UTC","last_activity_date":"2013-03-14 14:07:10.87 UTC","last_edit_date":"2013-03-13 14:26:46.393 UTC","last_editor_display_name":"","last_editor_user_id":"1919644","owner_display_name":"","owner_user_id":"1919644","post_type_id":"1","score":"1","tags":"asp.net|calendarextender","view_count":"4051"} +{"id":"14956648","title":"Spring Security @Postfilter not being triggered","body":"\u003cp\u003eThe @Postfilter is not being triggered. \u003c/p\u003e\n\n\u003cp\u003eThere are two methods in my controller. The listJson method makes a call to list1 method to get all projects and returns them in json format. I have a @Postfilter on list1 method to filter projects and the filter is not being triggered. \u003c/p\u003e\n\n\u003cp\u003eThe issue is not with configuration. Since for testing purposes, I tried placing the @Postfilter on listJson method and it does trigger. Can you kindly assist me in the matter? I would be very grateful.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e @RequestMapping(produces = \"application/json\")\n @ResponseBody\n public String listJson(HttpServletRequest request, HttpServletResponse response) {\n\n List\u0026lt;Project\u0026gt; items = list1(request, response, Project.class);\n return JsonHelper.toJsonArray(items, request.getContextPath());\n }\n\n @PostFilter(\"hasPermission(filterObject, 'read')\") \n private List\u0026lt;Project\u0026gt; list1(HttpServletRequest request, HttpServletResponse response, Class\u0026lt;Project\u0026gt; clazz) {\n Integer[] ia = WebHelper.getDojoGridPaginationInfo(request);\n Integer firstResult = ia[0];\n Integer lastResult = ia[1];\n\n Entry\u0026lt;String, String\u0026gt; orderBy = WebHelper.getDojoJsonRestStoreOrderBy(request.getP arameterNames());\n Where where = WebHelper.FromJsonToFilterClass(request.getParamet er(\"filter\"));\n List\u0026lt;Project\u0026gt; items = JpaHelper.findEntries(firstResult, lastResult - firstResult + 1, orderBy, where, clazz);\n Integer totalCount = JpaHelper.countEntries(where, clazz).intValue();\n\n WebHelper.setDojoGridPaginationInfo(firstResult, lastResult, totalCount, response);\n\n return items;\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewebmvc-config.xml\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;security:global-method-security pre-post-annotations=\"enabled\" proxy-target-class=\"true\"\u0026gt;\n \u0026lt;security:expression-handler ref=\"expressionHandler\"/\u0026gt;\n \u0026lt;/security:global-method-security\u0026gt; \n\n \u0026lt;bean id=\"myPermissionEvaluator\" class=\"org.springframework.security.acls.AclPermis sionEvaluator\"\u0026gt;\n \u0026lt;constructor-arg ref=\"aclService\" /\u0026gt;\n \u0026lt;/bean\u0026gt;\n\n \u0026lt;bean id=\"expressionHandler\" class=\"org.springframework.security.access.express ion.method.DefaultMethodSecurityExpressionHandler\" \u0026gt;\n \u0026lt;property name=\"permissionEvaluator\" ref=\"myPermissionEvaluator\"/\u0026gt;\n \u0026lt;/bean\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-02-19 11:43:07.217 UTC","last_activity_date":"2013-02-21 11:32:43.503 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2086870","post_type_id":"1","score":"1","tags":"java|spring|spring-security","view_count":"856"} +{"id":"46245638","title":"UITableView Content Size Smaller than Expected","body":"\u003cp\u003eI have a UIScrollView with a UITableView inside. I have disabled scrolling on the table view. I am using the following code to keep the UITableView's height to the height of it's content.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eoverride func updateViewConstraints() {\n self.editView!.editTblHeightCnst.constant = self.editView!.editTbl.contentSize.height + self.editView!.editTbl.contentInset.top + self.editView!.editTbl.contentInset.bottom + self.editView!.editTbl.contentOffset.y\n super.updateViewConstraints()\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, the content size I'm getting there is too small. If I add a couple hundered or less to the content size, it works. Why is my content size not what I'm expecting and how do I fix this?\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2017-09-15 18:35:56.387 UTC","last_activity_date":"2017-09-15 18:35:56.387 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1223595","post_type_id":"1","score":"1","tags":"ios|swift|uitableview|uiscrollview|contentsize","view_count":"71"} +{"id":"11368941","title":"Codeigniter 2 models","body":"\u003cp\u003eI've to fetch data from different web services + my own database and combining these data before displaying in the site. \u003c/p\u003e\n\n\u003cp\u003eWhat's the best method for doing this? I prefer writing separate models for web services and database. How can I organize the model classes of different data sources in different folders?\u003c/p\u003e\n\n\u003cp\u003eI may add more webservices later.\u003c/p\u003e","accepted_answer_id":"11369435","answer_count":"2","comment_count":"0","creation_date":"2012-07-06 20:03:23.22 UTC","last_activity_date":"2012-07-06 20:59:55.557 UTC","last_edit_date":"2012-07-06 20:28:01.78 UTC","last_editor_display_name":"","last_editor_user_id":"727208","owner_display_name":"","owner_user_id":"1449289","post_type_id":"1","score":"2","tags":"php|api|codeigniter|model","view_count":"358"} +{"id":"20843262","title":"Open a file in Google Drive programmatically not using Drive API","body":"\u003cp\u003eI have an application that receives a Google Drive File URL. Something like this:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://docs.google.com/a/spreadsheet/ccc?key=0AoDnOTP7MiABdF9VSEFNMktmeDY4MkNHS3NDdk5JMmc#gid=0\" rel=\"nofollow\"\u003ehttps://docs.google.com/a/spreadsheet/ccc?key=0AoDnOTP7MiABdF9VSEFNMktmeDY4MkNHS3NDdk5JMmc#gid=0\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI'm still not sure if will be the full https url or only the key value\u003c/p\u003e\n\n\u003cp\u003eI need to do 2 things:\u003c/p\u003e\n\n\u003cp\u003e1) Check if Google Drive Aplication for Android is intalled in the phone.\u003c/p\u003e\n\n\u003cp\u003e2) Call the Google Drive Android Aplication with that url to open the file. The ideal way is without opening any web browser. I want to use something like an Intent with extras, is this possible?\u003c/p\u003e\n\n\u003cp\u003eThanks for you help and sorry for my poor english\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2013-12-30 16:16:14.157 UTC","favorite_count":"1","last_activity_date":"2016-01-18 20:12:05.253 UTC","last_edit_date":"2013-12-31 05:10:59.933 UTC","last_editor_display_name":"","last_editor_user_id":"1166254","owner_display_name":"","owner_user_id":"215540","post_type_id":"1","score":"1","tags":"android|google-drive-sdk","view_count":"1824"} +{"id":"38691321","title":"Running 32 bit and 64 bit web projects side by side from VS 2015","body":"\u003cp\u003eI have got a setup where we need to integrate a third party dll into our ASP.Net MVC web project. Our application is a 64 bit one. But the third party just offers a 32-bit dll. To make things simpler for us, we have written a wrapper (basically a web api project) around this third party dll. We have added this as a service reference in our main app. We are using VS 2015, and have explicitly checked the box in \u003cem\u003eTools-\u003eOptions-\u003eProjects-\u003eWeb Projects-\u003eUse 64 bit IIS\u003c/em\u003e. This was done because we were facing frequent out of memory exceptions from the application. But, due to this, we are not able to either consume or debug the project containing 32 bit dll. To overcome this, we have hosted the wrapper project as 32 bit web api in our QA environment, and we directly consume it. Now, I have been asked to look into a few issues in it. Is there a way that I can debug by using 64 bit iis express for our main app and 32 bit iis express for the wrapper, from two different instances of VS 2015 on a single box?\u003c/p\u003e","accepted_answer_id":"38716210","answer_count":"1","comment_count":"0","creation_date":"2016-08-01 05:02:32.977 UTC","last_activity_date":"2016-08-02 09:08:02.443 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2566612","post_type_id":"1","score":"1","tags":".net|visual-studio|visual-studio-2015|iis-express","view_count":"86"} +{"id":"33475238","title":"Angular move directive from div to div","body":"\u003cp\u003eI have problem in my project I have something like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"ui-layout-center\"\u0026gt;\n \u0026lt;left\u0026gt;\u0026lt;/left\u0026gt;\n \u0026lt;right\u0026gt;\u0026lt;/right\u0026gt;\n \u0026lt;div class=\"container-to-max\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003ca href=\"http://plnkr.co/edit/deBMT5DAaoU47t4RxDhK?p=preview\" rel=\"nofollow\"\u003ehttp://plnkr.co/edit/deBMT5DAaoU47t4RxDhK?p=preview\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003ein right pane I have few nesting directive and last directive have option to maximalize I need maximalize this directive in central pane, probably I would like fill the empty div parent div hide. I need something like this because I have in directive I have data what I need display and jquery plugin and so on. but I no have idea how do it could someone help me?\u003c/p\u003e","answer_count":"1","comment_count":"4","creation_date":"2015-11-02 10:14:18.467 UTC","last_activity_date":"2015-11-02 10:51:43.527 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3556049","post_type_id":"1","score":"0","tags":"javascript|jquery|angularjs|angularjs-directive|jquery-layout","view_count":"94"} +{"id":"5917047","title":"Delete / Insert Data in mmap'ed File","body":"\u003cp\u003eI am working on a script in Python that maps a file for processing using mmap().\u003c/p\u003e\n\n\u003cp\u003eThe tasks requires me to change the file's contents by\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eReplacing data\u003c/li\u003e\n\u003cli\u003eAdding data into the file at an offset\u003c/li\u003e\n\u003cli\u003eRemoving data from within the file (not whiting it out)\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eReplacing data works great as long as the old data and the new data have the same number of bytes:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eVDATA = mmap.mmap(f.fileno(),0)\nstart = 10\nend = 20\nVDATA[start:end] = \"0123456789\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, when I try to remove data (replacing the range with \"\") or inserting data (replacing the range with contents longer than the range), I receive the error message:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eIndexError: mmap slice assignment is\n wrong size\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eThis makes sense.\u003c/p\u003e\n\n\u003cp\u003eThe question now is, how can I insert and delete data from the mmap'ed file?\nFrom reading the documentation, it seems I can move the file's entire contents back and forth using a chain of low-level actions but I'd rather avoid this if there is an easier solution.\u003c/p\u003e","accepted_answer_id":"5930045","answer_count":"2","comment_count":"0","creation_date":"2011-05-06 21:10:50.12 UTC","favorite_count":"5","last_activity_date":"2016-09-16 18:34:43.98 UTC","last_edit_date":"2015-12-02 09:24:45.137 UTC","last_editor_display_name":"","last_editor_user_id":"4370109","owner_display_name":"","owner_user_id":"142137","post_type_id":"1","score":"5","tags":"python|insert|mmap","view_count":"2754"} +{"id":"5439394","title":"Using .children() to get an \u003cimg\u003e element","body":"\u003cp\u003eHow do you use the \u003ccode\u003e.children()\u003c/code\u003e jQuery method to get an image element? Is it \u003ccode\u003e.children('img')\u003c/code\u003e?\u003c/p\u003e","accepted_answer_id":"5439402","answer_count":"3","comment_count":"0","creation_date":"2011-03-26 00:08:55.063 UTC","last_activity_date":"2011-03-26 00:12:17.8 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"421109","post_type_id":"1","score":"0","tags":"javascript|jquery|children","view_count":"4199"} +{"id":"43715884","title":"Iterate through multiple keys on map","body":"\u003cp\u003eI have this code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e {drop_off_lat, _ } = case student_model.drop_off_lat do\n nil -\u0026gt; {0.0, 0}\n value -\u0026gt; {Float.parse(value), 0}\n end\n\n {drop_off_lng, _ } = case student_model.drop_off_lng do\n nil -\u0026gt; {0.0, 0}\n value -\u0026gt; {Float.parse(value), 0}\n end\n\n {pick_up_lat, _ } = case student_model.pick_up_lat do\n nil -\u0026gt; {0.0, 0}\n value -\u0026gt; {Float.parse(value), 0}\n end\n\n {pick_up_lng, _ } = case student_model.pick_up_lng do\n nil -\u0026gt; {0.0, 0}\n value -\u0026gt; {Float.parse(value), 0}\n end\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003efor each key (drop_off_lat, drop_off_lng, pick_up_lat, pick_up_lng) I am checking if its nil to replace with 0, otherwise to replace with float parsing of its version.\u003c/p\u003e\n\n\u003cp\u003eAlthough its working, but I feel that the code can be more compact with fewer lines, right?\u003c/p\u003e","accepted_answer_id":"43715940","answer_count":"1","comment_count":"3","creation_date":"2017-05-01 07:43:29.78 UTC","last_activity_date":"2017-05-01 07:47:42.967 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"396681","post_type_id":"1","score":"0","tags":"elixir","view_count":"35"} +{"id":"38099833","title":"Make json easily readable (R)","body":"\u003cp\u003eSuppose I have a variable \u003ccode\u003eouput\u003c/code\u003e which contains a json of the form:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\"hello1\":[\"bla1\"],\"hello2\":[\"bla2\"],\"hello3\":{\"hello31\":{\"hello311\":[7078],\"hello312\":[3429]},\"hello32\":{\"hello321\":[10],\"hello322\":[6]},\"hello33\":{\"hello331\":[4.6317],\"hello332\":[2.6322]}}}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat can I do to transform \u003ccode\u003eouput\u003c/code\u003e such as it can be easily readable? I would like something like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ehello1 : bla1\nhello2 : bla2\nhello3 :\n hello31 : hello311 : 7078\n hello312 : 3429\n hello32 : hello321 : 10\n hello322 : 6\n hello33 : hello331 : 4.6317\n hello332 : 2.6322\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"2","creation_date":"2016-06-29 12:38:43.76 UTC","last_activity_date":"2016-06-29 13:37:19.73 UTC","last_edit_date":"2016-06-29 12:44:26.117 UTC","last_editor_display_name":"","last_editor_user_id":"6260206","owner_display_name":"","owner_user_id":"6260206","post_type_id":"1","score":"0","tags":"json|r","view_count":"36"} +{"id":"30926031","title":"How to programmatically create printable forms?","body":"\u003cp\u003eI wish to create high quality printable forms - think complex paper forms like a tax return or insurance form. Ultimately just a form, but good looking, clear, consistent.\u003c/p\u003e\n\n\u003cp\u003eCurrently this is largely a manual process in my organisation - desktop publishing (or whatever it's called now) type software is used.\u003c/p\u003e\n\n\u003cp\u003eI have a model of what should go on the form, and our electronic systems work from this.\u003c/p\u003e\n\n\u003cp\u003eI want to be able to translate our model into a paper form.\u003c/p\u003e\n\n\u003cp\u003eFurther more, I would like human editors to be able to perform minor adjustments/spacial improvements - and then for the system to verify the document is still valid i.e. all relevant elements/texts are still on the document.\u003c/p\u003e\n\n\u003cp\u003eTherefore the format, whatever it is, must be both writeable and readable.\u003c/p\u003e\n\n\u003cp\u003eI'm open to any/all suggestions on how to do this, here are some of the options I've looked at:\u003c/p\u003e\n\n\u003cp\u003e1) Creating HTML pages with print media CSS - downside seems to be I can't include instructions on skipping to a specific page, because only the print function in browser knows what physical page each element will be on. However, verifying the document is valid seems nice and easy.\u003c/p\u003e\n\n\u003cp\u003e2) Word/Open office - these both seem very clumsy and readying the doc, looking for items seems ambitious.\u003c/p\u003e\n\n\u003cp\u003e3) PDF - reading PDFs seems to be a nightmare.\u003c/p\u003e\n\n\u003cp\u003e4) Latex - while there is some support for forms, it seems niche within the latex world.\u003c/p\u003e\n\n\u003cp\u003eDoes anyone have experience doing this or suggestions on how to go about this? I am open to any technology suggestions, I don't care about platform.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-06-18 21:21:47.513 UTC","last_activity_date":"2017-07-11 01:29:16.877 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"365444","post_type_id":"1","score":"0","tags":"forms|layout|desktop-publishing","view_count":"88"} +{"id":"1327484","title":"Creating new html in JS or ajax loading a html layout?","body":"\u003cp\u003eI have a page where I need to create a large amount of HTML that's not already present in the page.\u003c/p\u003e\n\n\u003cp\u003eUsing jQuery I've been building the page with JS piece by piece, adding divs here and there, etc, until I get my layout.\u003c/p\u003e\n\n\u003cp\u003eRight now I'm thinking rather than do all that in JS, I can create the layout in a separate HTML file and then load it with ajax. My initial aversion to that idea is because of ajax, it requires an additional server request, and might end up slow(er?).\u003c/p\u003e\n\n\u003cp\u003eAnyone have any advice on whether or not this is a good idea, and if it is, if there are tutorials, set ways and patterns to doing this sort of thing.\u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","accepted_answer_id":"1335462","answer_count":"2","comment_count":"3","creation_date":"2009-08-25 10:52:10.96 UTC","favorite_count":"1","last_activity_date":"2013-12-07 20:46:20.393 UTC","last_edit_date":"2009-08-25 11:11:58.83 UTC","last_editor_display_name":"","last_editor_user_id":"118547","owner_display_name":"","owner_user_id":"118547","post_type_id":"1","score":"0","tags":"javascript|jquery|html|ajax","view_count":"209"} +{"id":"34784971","title":"Different type based on template type","body":"\u003cp\u003eI have \u003ccode\u003e::Class1\u003c/code\u003e and \u003ccode\u003e::Class2\u003c/code\u003e, I'd like to create template function that gets either first or second one and then based on selected class use other classes defined in different namespace i.e. \u003ccode\u003eNameSpace::Class1\u003c/code\u003e, \u003ccode\u003eNameSpace::Class2\u003c/code\u003e. Is there way to do it in C++?\u003c/p\u003e\n\n\u003cp\u003eFor example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enamespace NameSpace \n{ \n class Class1 {}; class Class2 {}; \n} \n\ntemplate \u0026lt;class T\u0026gt; // example Class1 or Class2 \nvoid f(T object) { \n NameSpace::T obj; // Something like this, but it doesn't work \n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"34785229","answer_count":"3","comment_count":"4","creation_date":"2016-01-14 08:41:01.327 UTC","last_activity_date":"2016-01-14 10:01:25.697 UTC","last_edit_date":"2016-01-14 10:01:25.697 UTC","last_editor_display_name":"","last_editor_user_id":"636019","owner_display_name":"","owner_user_id":"3760295","post_type_id":"1","score":"1","tags":"c++|templates|generic-programming","view_count":"94"} +{"id":"30665013","title":"How to use regex in matches() to look for letters, dots, and apostrophe?","body":"\u003cp\u003eIn the following code, I tried many expressions to check if the string \u003ccode\u003estr\u003c/code\u003e has only letters, dots, or apostrophe by using \u003ccode\u003ematches()\u003c/code\u003e method.\u003c/p\u003e\n\n\u003cp\u003eHowever, it's not returning \u003ccode\u003etrue\u003c/code\u003e for this string, for example, \u003ccode\u003eone o'clock.\u003c/code\u003e :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eString str = \"One o'clock.\";\nSystem.out.println(str.matches(\"[^a-zA-Z'. ]\"));\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"30665053","answer_count":"2","comment_count":"0","creation_date":"2015-06-05 11:07:49.957 UTC","favorite_count":"1","last_activity_date":"2015-06-09 20:42:13.103 UTC","last_edit_date":"2015-06-05 11:13:01.63 UTC","last_editor_display_name":"","last_editor_user_id":"4951573","owner_display_name":"","owner_user_id":"4951573","post_type_id":"1","score":"0","tags":"java|regex","view_count":"62"} +{"id":"5937742","title":"Javascript Query or ORM","body":"\u003cp\u003eis there a way to query a database without using php or with an ORM??\u003c/p\u003e","accepted_answer_id":"5937842","answer_count":"2","comment_count":"2","creation_date":"2011-05-09 13:46:26.177 UTC","last_activity_date":"2011-07-05 13:34:27.86 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"641321","post_type_id":"1","score":"1","tags":"javascript|sql|orm","view_count":"459"} +{"id":"18604049","title":"Clojure Enlive: A selector that uses regex","body":"\u003cp\u003eI'm trying to select the :li node that has, in is content, the word \"(SCIAN\": \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;li\u0026gt;...\u0026lt;/li\u0026gt;\n\u0026lt;li class=\"\"\u0026gt;\n Conception de systèmes informatiques et services connexes (SCIAN 541510)\n \u0026lt;/li\u0026gt;\n\n\u0026lt;li\u0026gt;...\u0026lt;/li\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI've fail trying this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e(html/select\n fetched\n [[:li (html/has [(html/re-pred #\"\\w*SCIAN\\b\")])]])))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThank you for your help!\u003c/p\u003e\n\n\u003cp\u003eNotice: I've tried use these patterns without success so I might do something wrong:\n\u003ca href=\"https://groups.google.com/forum/#!topic/enlive-clj/thlhc5zBRUw\" rel=\"nofollow\"\u003ehttps://groups.google.com/forum/#!topic/enlive-clj/thlhc5zBRUw\u003c/a\u003e\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2013-09-04 01:31:42.817 UTC","last_activity_date":"2013-09-04 14:04:04.683 UTC","last_edit_date":"2013-09-04 13:03:32.807 UTC","last_editor_display_name":"","last_editor_user_id":"1184248","owner_display_name":"","owner_user_id":"1184248","post_type_id":"1","score":"0","tags":"regex|clojure|enlive","view_count":"153"} +{"id":"5406758","title":"swfupload + paperclip + rails 3","body":"\u003cp\u003eHow can i easily entegrate swfupload to my application?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;%= form_for(@photo, :html =\u0026gt; { :multipart =\u0026gt; true }) do |f| %\u0026gt;\n\u0026lt;%= f.text_field :title %\u0026gt;\n\u0026lt;%= f.file_field :attachment %\u0026gt;\n\u0026lt;%= f.submit \"Upload\" %\u0026gt;\n\u0026lt;% end %\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ePhoto model\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ehas_attached_file :attachment, \n :styles =\u0026gt; { :small =\u0026gt; \"200x100\", :big =\u0026gt; \"500x300\u0026gt;\" }, \n :url =\u0026gt; \"/images/attachments/:id/:style/:basename.:extension\", \n :path =\u0026gt; \"#{::Rails.root.to_s}/public/images/attachments/:id/:style/:basename.:extension\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ephotos controller\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e def create\n @photo = current_user.photos.build(params[:photo])\n if @photo.save\n redirect_to(@photo)\n else\n render :action =\u0026gt; \"new\"\n end\n end\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"5409310","answer_count":"1","comment_count":"2","creation_date":"2011-03-23 14:28:00.81 UTC","last_activity_date":"2011-03-23 17:33:49.313 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"672793","post_type_id":"1","score":"0","tags":"ruby-on-rails|ruby-on-rails-3","view_count":"1256"} +{"id":"35557323","title":"Get function name that made a (illegal) memory access","body":"\u003cp\u003eFor debugging reasons I am trying to print the name of the function that made an illegal memory access (out of range for example).\u003c/p\u003e\n\n\u003cp\u003eI have written a SIGSEGV signal handler to print the Instruction Pointer (IP) and the faulted memory address, but I was not able to create a method such that I can get the function name and not the IP.\u003c/p\u003e\n\n\u003cp\u003eIs there a way to modify the signature of the signal handler to pass the __ \u003cstrong\u003eFUNCTION\u003c/strong\u003e __ variable as an argument or is there another method to do this?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eNote\u003c/strong\u003e: The program is written in C and I trying to do this in a Linux environment.\u003c/p\u003e","accepted_answer_id":"35557865","answer_count":"1","comment_count":"9","creation_date":"2016-02-22 15:18:56.13 UTC","favorite_count":"1","last_activity_date":"2016-02-22 15:52:15.583 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5763311","post_type_id":"1","score":"3","tags":"c|memory|signals","view_count":"168"} +{"id":"43867974","title":"i want to change language of app without restarting app","body":"\u003cp\u003eI need to have multiple languages facility in my app. I am able to change language with localization strings, but storyboard text are not changing without restarting app. I added Arabic language also for users that needs to change alignments of text as well which is also working fine if I restart app.\u003c/p\u003e\n\n\u003cp\u003eI am using AppleLanguages user default key to change language and localized strings for dynamic texts. \u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2017-05-09 10:57:15.83 UTC","favorite_count":"1","last_activity_date":"2017-05-10 06:18:52.007 UTC","last_edit_date":"2017-05-10 06:18:52.007 UTC","last_editor_display_name":"","last_editor_user_id":"3214843","owner_display_name":"","owner_user_id":"7980897","post_type_id":"1","score":"1","tags":"ios|swift","view_count":"851"} +{"id":"38090939","title":"Return result when using Deep Link to open another app","body":"\u003cp\u003eI have 2 Apps, A \u0026amp; B. In App A, i open an activity of App B using Deep Link and via \u003ccode\u003estartActivityForResult()\u003c/code\u003e, but when in set result code in App B and return, App A just received \u003ccode\u003eRESULT_CANCELED\u003c/code\u003e! My first question is \"Is it possible to return result when using Deep Link to open another app?\", and if yes, where is my mistake?!\u003c/p\u003e\n\n\u003cp\u003eMy manifest, in App B:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;activity android:name=\".activity.TargetActivity\"\u0026gt;\n \u0026lt;intent-filter\u0026gt;\n \u0026lt;action android:name=\"android.intent.action.VIEW\" /\u0026gt;\n\n \u0026lt;category android:name=\"android.intent.category.DEFAULT\" /\u0026gt;\n \u0026lt;category android:name=\"android.intent.category.BROWSABLE\" /\u0026gt;\n\n \u0026lt;!-- Accepts URIs that begin with \"http://www.example.com/gizmos” --\u0026gt;\n \u0026lt;!-- note that the leading \"/\" is required for pathPrefix--\u0026gt;\n \u0026lt;data\n android:host=\"www.example.com\"\n android:pathPrefix=\"/gizmos\"\n android:scheme=\"http\" /\u0026gt;\n \u0026lt;data\n android:host=\"www.example.com\"\n android:pathPrefix=\"/gizmos\"\n android:scheme=\"https\" /\u0026gt;\n \u0026lt;data\n android:host=\"example.com\"\n android:pathPrefix=\"/gizmos\"\n android:scheme=\"http\" /\u0026gt;\n \u0026lt;data\n android:host=\"example.com\"\n android:pathPrefix=\"/gizmos\"\n android:scheme=\"https\" /\u0026gt;\n \u0026lt;/intent-filter\u0026gt;\n\u0026lt;/activity\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn App A:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Uri webpage = Uri.parse(\"android-app://com.vancosys.payment/http/www.example.com/gizmos?name=FMarket\u0026amp;id=4231\");\n\n Intent webIntent = new Intent(Intent.ACTION_VIEW, webpage);\n\n // Verify it resolves\n PackageManager packageManager = getPackageManager();\n List\u0026lt;ResolveInfo\u0026gt; activities = packageManager.queryIntentActivities(webIntent, 0);\n boolean isIntentSafe = activities.size() \u0026gt; 0;\n\n // Start an activity if it's safe\n if (isIntentSafe)\n {\n // '4231' is my request code\n startActivityForResult(webIntent, 4231);\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAlso:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@Override\nprotected void onActivityResult(int requestCode, int resultCode, Intent data)\n{\n if(requestCode == 4231)\n {\n if (resultCode == RESULT_OK)\n {\n String id = data.getStringExtra(\"ID\");\n\n Intent i = new Intent(this, ResultActivity.class);\n i.putExtra(\"RESULT\", true);\n i.putExtra(\"ID\", id);\n startActivity(i);\n }\n else\n {\n // It JUST equals to RESULT_CANCELED!!!\n Intent i = new Intent(this, ResultActivity.class);\n i.putExtra(\"result\", false);\n startActivity(i);\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd finally, in App B:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e new Handler().postDelayed(new Runnable()\n {\n public void run()\n {\n Intent i = new Intent();\n TargetActivity.this.setResult(RESULT_OK, i);\n i.putExtra(\"ID\", \"45651232\");\n finish();\n }\n }, 3000);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eUPDATE:\n\u003ccode\u003eIntent data\u003c/code\u003e in \u003ccode\u003eonActivityResult()\u003c/code\u003e is \u003ccode\u003enull\u003c/code\u003e!!!\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2016-06-29 05:20:28.357 UTC","last_activity_date":"2017-03-23 12:17:13.263 UTC","last_edit_date":"2016-06-29 06:01:59.33 UTC","last_editor_display_name":"","last_editor_user_id":"5752443","owner_display_name":"","owner_user_id":"5752443","post_type_id":"1","score":"1","tags":"android","view_count":"258"} +{"id":"47421445","title":"Displaying a Cross-tabulation As a Plot on RStudio","body":"\u003cp\u003eI'm trying to visualize a cross-tabulation on RStudio using ggplot2. I've been able to create plots in the past, and have a cross-tabulation done as well, but can't crack this. Can anyone help?\u003c/p\u003e\n\n\u003cp\u003eHere's my code for an x-tab:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elibrary(dplyr)\ndata_dan %\u0026gt;%\n group_by(Sex, Segment) %\u0026gt;%\n count(variant) %\u0026gt;%\n mutate(prop = prop.table(n))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand here's what I've got for creating a plot:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#doing a plot\nvariance_art_new.plot = ggplot(data_dan, aes(Segment, fill=variant)) +\n geom_bar(position=\"fill\")+\n theme_classic()+\n scale_fill_manual(values = c(\"#fc8d59\", \"#ffffbf\", \"#99d594\"))\nvariance_art_new.plot\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere's a sample of the data I'm operating with:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Word Segment variant Position Sex\n1 LIKE K R End Female\n2 LITE T S End Male\n3 CRACK K R End Female\n4 LIKE K R End Male\n5 LIPE P G End Female\n6 WALK K G End Female\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy aim is to have the independent variables of 'Sex', 'Segment' plotted on a boxplot against the dependent variable 'variant'.\nI included the first code to show that I can create a table to show this cross-tabulation and the second bit is what I normally do for running a box plot for just one independent variable.\u003c/p\u003e","accepted_answer_id":"47422888","answer_count":"1","comment_count":"8","creation_date":"2017-11-21 19:45:04.5 UTC","favorite_count":"1","last_activity_date":"2017-11-21 21:17:21.38 UTC","last_edit_date":"2017-11-21 20:31:54.863 UTC","last_editor_display_name":"","last_editor_user_id":"8981716","owner_display_name":"","owner_user_id":"8981716","post_type_id":"1","score":"0","tags":"r|ggplot2|crosstab","view_count":"35"} +{"id":"460393","title":"JMF+JavaFx layout problem","body":"\u003cp\u003eI can creat a GUI in javafx and call the JMF component within JavaFx, just like this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class JMFComponent extends SwingComponent{\n\n var panel: JPanel;\n\n\n public var center: java.awt.Component on replace{\n println(\"[center] set component: {center}\");\n panel.add(center, BorderLayout.CENTER);\n }\n\n\n public override function createJComponent():javax.swing.JComponent{\n panel= new JPanel(new BorderLayout());\n\n var size:Dimension = new Dimension(width, height);\n panel.setPreferredSize(size);\n panel.setMinimumSize(size);\n panel.setMaximumSize(size);\n panel.setSize(size);\n return panel;\n }\n}\n\npublic class MyMedia extends CustomNode {\n\n var xpos: Number;\n var ypos: Number;\n var dx: Number;\n\n public var url: java.net.URL;\n public var autoPlay: Boolean;\n\n public override function create(): Node{\n\n var comp:java.awt.Component;\n var control:java.awt.Component;\n var w:Number;\n var h:Number;\n var cw:Number;\n var ch:Number;\n\n var jmfCom:JMFComponent;\n var player = Manager.createRealizedPlayer(url);\n\n comp=player.getVisualComponent();\n\n control=player.getControlPanelComponent();\n\n if (autoPlay) {\n player.start();\n }\n w=comp.getPreferredSize().getWidth();\n h=comp.getPreferredSize().getHeight();\n cw=control.getPreferredSize().getWidth();\n ch=control.getPreferredSize().getHeight();\n jmfCom=JMFComponent {\n width:w\n height:h+ch\n center: comp\n blocksMouse: true\n bottom: control\n };\n\n return Group{\n content: [\n\n jmfCom\n\n ] \n\n }\n }\n}\n\nStage {\n title: \"Media Example\"\n width: 500\n height: 500\n onClose: function(){ java.lang.System.exit(0);}\n scene: Scene {\n content: MyMedia{\n url: (\n new java.io.File(\"C://My//Videos//DELTA.MPG\")).toURI().toURL()\n autoPlay: true\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe video can be played within JavaFx gui, but when i move my mouse cursor into the control bar of the JMF player, the video window will move at the same time.\u003c/p\u003e\n\n\u003cp\u003eDoes anyone have an idea how I can get JMF working normally within JavaFx?\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2009-01-20 07:48:31.343 UTC","last_activity_date":"2010-01-08 23:09:32.78 UTC","last_edit_date":"2009-11-07 16:56:41.4 UTC","last_editor_display_name":"","last_editor_user_id":"56338","owner_display_name":"killsushi","post_type_id":"1","score":"1","tags":"javafx|jmf","view_count":"1803"} +{"id":"23536203","title":"POST data with Ajax application/json, read with ashx file","body":"\u003cpre\u003e\u003ccode\u003e $(document).ready(function () {\n $('#dropDownMenu1').change(function () {\n var customer = { contact_email: \"s.selcuk@hotmail.com\", company_password: \"123\" };\n $.ajax({\n type: \"POST\",\n data: JSON.stringify(customer),\n url: \"webServices/apiDeneme.ashx\",\n contentType: \"application/json\"\n });\n });\n });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am sending this customer variable like this way to the apiDeneme.ashx. I put debug poing, request comes to apiDeneme.ashx but this email string variable equals null. ? (below)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic void ProcessRequest(HttpContext context)\n{\n System.Text.StringBuilder sb = new System.Text.StringBuilder();\n\n string email = context.Request.Form[\"contact_email\"]; \n\n sb.Append(\"[\");\n sb.Append(\"{\");\n sb.Append(\"\\\"Sonuc\\\":\\\"\" + email + \"\\\"}]\");\n\n context.Response.ContentType = \"application/json\";\n context.Response.ContentEncoding = System.Text.Encoding.UTF8;\n context.Response.Write(sb.ToString());\n context.Response.End();\n}\n\npublic bool IsReusable\n{\n get\n {\n return false;\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBy the way, another question, is the login process like the one here reliable? Thanks!!\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-05-08 08:09:29.567 UTC","last_activity_date":"2014-05-08 08:18:00.07 UTC","last_edit_date":"2014-05-08 08:14:40.357 UTC","last_editor_display_name":"","last_editor_user_id":"718302","owner_display_name":"","owner_user_id":"3615345","post_type_id":"1","score":"0","tags":".net|json|stringify","view_count":"764"} +{"id":"40028859","title":"SetValue and bootstrap progress-bar width not matching in jquery setInterval function","body":"\u003cp\u003eThe values going into setting the progress-bar width are fine, but when I check on them within console or look at the results on the page, they're clearly incorrect. For some reason, this only happens when the check box choice is 1 and not 2.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar timeInterval;\n// For procedure parameter\nvar choice;\nif (document.getElementById('myonoffswitch').checked == false) {\n choice = 1;\n timeInterval = 300;\n} else {\n choice = 2;\n timeInterval = 13400;\n};\n\nvar $bar = $('.progress-bar');\nvar $barWidth = $('#pBar');\nvar barIntervalLength = 0;\nvar curBarWidth = 0;\nvar setWidth = 0;\n\nvar percentDisplay = 0;\n\n$bar.width(0);\n\nvar progress = setInterval(function () {\nbarIntervalLength = $barWidth.width() / 20;\ncurBarWidth = $bar.width();\nsetWidth = barIntervalLength + curBarWidth;\n\n percentDisplay = percentDisplay + 5;\nif (percentDisplay \u0026gt; 100) {\n clearInterval(progress);\n $('.progress').removeClass('active');\n} else {\n $bar.width(setWidth);\n $bar.text(percentDisplay + \"%\");\n\n console.log(\"set: \" + setWidth);\n console.log(\"barWidth: \" + $barWidth.width());\n console.log(\"barIntervalLength: \" + barIntervalLength);\n console.log(\"bar.width: \" + $bar.width());\n };\n\n}, timeInterval);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBelow are the results from console:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eset: 27.9\nbarWidth: 558\nbarIntervalLength: 27.9\nbar.width: 0\nset: 46.9\nbarWidth: 558\nbarIntervalLength: 27.9\nbar.width: 19\nset: 67.9\nbarWidth: 558\nbarIntervalLength: 27.9\nbar.width: 40\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe 2nd bar.width: should be 27.9, and 3rd should be 55.8 (or very close to those numbers).\u003c/p\u003e\n\n\u003cp\u003eThese are the results if the box is checked (option 2), these are correct:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eset: 27.9\nbarWidth: 558\nbarIntervalLength: 27.9\nbar.width: 0\nset: 55.9\nbarWidth: 558\nbarIntervalLength: 27.9\nbar.width: 28\nset: 83.9\nbarWidth: 558\nbarIntervalLength: 27.9\nbar.width: 56\nset: 111.9\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm just banging my head against my desk trying to figure this out.\u003c/p\u003e\n\n\u003cp\u003eHopefully someone can tell me what's going on.\u003c/p\u003e","accepted_answer_id":"40029673","answer_count":"1","comment_count":"0","creation_date":"2016-10-13 18:56:34.73 UTC","last_activity_date":"2016-10-13 20:05:26.14 UTC","last_edit_date":"2016-10-13 19:20:45.613 UTC","last_editor_display_name":"","last_editor_user_id":"4371946","owner_display_name":"","owner_user_id":"4371946","post_type_id":"1","score":"0","tags":"javascript|jquery|twitter-bootstrap","view_count":"49"} +{"id":"41472047","title":"Dotnet Antiforgery dll is missing in docker container in OSX","body":"\u003cp\u003eI have this idea of having a docker container mount a folder where there is an already compiled Aspnet core 1.1 application.\u003c/p\u003e\n\n\u003cp\u003eWhen I do that a file is missing. What is the best way to make it... not missing?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eHow to recreate problem:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eIn my OSX host I create a folder \u003ccode\u003e/myrootedpath/TheApp\u003c/code\u003e and \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edotnet new -t web\ndotnet restore\ndotnet run\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eto create and start my hello world web app.\u003cbr\u003e\n(I can \u003ccode\u003ecurl localhost\u003c/code\u003e so I know it works in the host.)\u003cbr\u003e\nI stop the server with ctrl-c.\u003c/p\u003e\n\n\u003cp\u003eI then create a container which mounts the folder mentioned, compiles and starts the web server through\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edocker run -p 80:80 -ti \\\n -v /myrootedpath/TheApp:/theapp microsoft/dotnet \\\n /bin/bash -c 'cd /theapp; dotnet run'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut it stops with a \u003c/p\u003e\n\n\u003cp\u003e\u003cem\u003eProject theapp (.NETCoreApp,Version=v1.1) was previously compiled. Skipping compilation.\u003c/em\u003e \u003c/p\u003e\n\n\u003cp\u003e\u003cem\u003eError: assembly specified in the dependencies manifest was not found — package: ‘Microsoft.AspNetCore.Antiforgery’, version: ‘1.0.1’, path: ‘lib/netstandard1.3/Microsoft.AspNetCore.Antiforgery.dll’\u003c/em\u003e\u003c/p\u003e\n\n\u003cp\u003eI see \u003ccode\u003eAntiforgery.dll\u003c/code\u003e is missing.\u003cbr\u003e\nI guess I can find it and copy it and create a new image.\u003cbr\u003e\nIs that a recommended solution?\u003c/p\u003e\n\n\u003cp\u003e\u003cem\u003eUPDATE\u003c/em\u003e\u003c/p\u003e\n\n\u003cp\u003eAs I start a bounty I want to clarify that the question boils down to what is is needed to execute dotnet core code compiled outside the container.\u003c/p\u003e","accepted_answer_id":"41550467","answer_count":"1","comment_count":"0","creation_date":"2017-01-04 19:44:35.803 UTC","favorite_count":"3","last_activity_date":"2017-01-09 15:01:18.877 UTC","last_edit_date":"2017-01-07 17:32:01.367 UTC","last_editor_display_name":"","last_editor_user_id":"521554","owner_display_name":"","owner_user_id":"521554","post_type_id":"1","score":"2","tags":"docker|asp.net-core|containers","view_count":"728"} +{"id":"34247129","title":"Trying to print an unordered_map","body":"\u003cp\u003eI am writing a simple program to find anagrams. I am using a hash table with sorted strings as the keys, and the unsorted strings as the values. When I try to print the unordered_map (hash map) it gives me this error. \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eError 1 error C2675: unary '++' : 'std::string' does not define this\n operator or a conversion to a type acceptable to the predefined\n operator c:\\program files (x86)\\microsoft visual studio\n 12.0\\vc\\include\\xhash 672 1\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;iostream\u0026gt;\n#include \u0026lt;list\u0026gt;\n#include \u0026lt;cstdlib\u0026gt;\n#include \u0026lt;map\u0026gt;\n#include \u0026lt;string\u0026gt;\n#include \u0026lt;vector\u0026gt;\n#include \u0026lt;unordered_map\u0026gt;\n#include \u0026lt;algorithm\u0026gt;\n#include \u0026lt;cstring\u0026gt;\n\n\n\nvoid Anagrams(std::vector\u0026lt;std::string\u0026gt; \u0026amp;v){\n\n std::unordered_map\u0026lt;std::string, std::string\u0026gt; wordTable;\n\n char sortedString[256];\n\n for (std::string tmp : v){\n\n strcpy(sortedString, tmp.c_str());\n\n std::sort(sortedString, sortedString + tmp.size());\n\n std::string backToString(sortedString);\n\n wordTable.insert(backToString, tmp);\n }\n\n std::cout \u0026lt;\u0026lt; \"Map contains\" \u0026lt;\u0026lt; std::endl;\n\n\n std::cout \u0026lt;\u0026lt; \"mymap's buckets contain:\\n\";\n for (unsigned i = 0; i \u0026lt; wordTable.bucket_count(); ++i) {\n std::cout \u0026lt;\u0026lt; \"bucket #\" \u0026lt;\u0026lt; i \u0026lt;\u0026lt; \" contains:\";\n for (auto local_it = wordTable.begin(i); local_it != wordTable.end(i); ++local_it)\n std::cout \u0026lt;\u0026lt; \" \" \u0026lt;\u0026lt; local_it-\u0026gt;first \u0026lt;\u0026lt; \":\" \u0026lt;\u0026lt; local_it-\u0026gt;second;\n std::cout \u0026lt;\u0026lt; std::endl;\n }\n\n\n\n\n}\n\n\n\n\nint main()\n{\n\n std::vector\u0026lt;std::string\u0026gt; words{ \"debitcard\", \"badcredit\", \"cat\", \"act\", \"evils\", \"elvis\" };\n\n Anagrams(words);\n\n\n\n return 0;\n\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFor some reason it thinks the iterator \"local_it\" is a string. Can anyone help?\u003c/p\u003e","accepted_answer_id":"34247207","answer_count":"1","comment_count":"2","creation_date":"2015-12-13 01:43:58.583 UTC","last_activity_date":"2015-12-13 01:58:53.953 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3236794","post_type_id":"1","score":"0","tags":"c++|iterator|hashmap|anagram","view_count":"469"} +{"id":"12404801","title":"How to prevent single touch inside 'canvas' - IOS Application","body":"\u003cp\u003eI need to prevent single touch inside the canvas. But double/multi touch shouch should perform without issue for IOS application\u003c/p\u003e\n\n\u003cp\u003ePlease find my JS code for touch event\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e onTouchStart: function(e, win, eventInfo) {\n if(!this.config.panning) return;\n if(this.config.panning == 'avoid nodes' \u0026amp;\u0026amp; (this.dom? this.isLabel(e, win) : eventInfo.getNode())) return;\n this.pressed = true;\n this.pos = eventInfo.getPos();\n var canvas = this.canvas,\n ox = canvas.translateOffsetX,\n oy = canvas.translateOffsetY,\n sx = canvas.scaleOffsetX,\n sy = canvas.scaleOffsetY;\n this.pos.x *= sx;\n this.pos.x += ox;\n this.pos.y *= sy;\n this.pos.y += oy;\n },\n\n onTouchMove: function(e, win, eventInfo) {\n if(!this.config.panning) return;\n if(!this.pressed) return;\n if(this.config.panning == 'avoid nodes' \u0026amp;\u0026amp; (this.dom? this.isLabel(e, win) : eventInfo.getNode())) return;\n var thispos = this.pos, \n currentPos = eventInfo.getPos(),\n canvas = this.canvas,\n ox = canvas.translateOffsetX,\n oy = canvas.translateOffsetY,\n sx = canvas.scaleOffsetX,\n sy = canvas.scaleOffsetY;\n currentPos.x *= sx;\n currentPos.y *= sy;\n currentPos.x += ox;\n currentPos.y += oy;\n var x = currentPos.x - thispos.x,\n y = currentPos.y - thispos.y;\n this.pos = currentPos;\n this.canvas.translate(x * 1/sx, y * 1/sy);\n },\n\n onTouchEnd: function(e, win, eventInfo) {\n if(!this.config.panning) return;\n this.pressed = false;\n },\n onTouchCancel: function(e, win, eventInfo) {\n if(!this.config.panning) return;\n this.pressed = false;\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFrom the above code both single touch and multi touch has been perform but I want to do only single touch inside my canvas for IOS app.\nPlease advice!\u003c/p\u003e","accepted_answer_id":"12483427","answer_count":"1","comment_count":"0","creation_date":"2012-09-13 11:03:17.123 UTC","last_activity_date":"2012-09-18 19:10:03.917 UTC","last_edit_date":"2012-09-14 15:28:49.687 UTC","last_editor_display_name":"","last_editor_user_id":"515774","owner_display_name":"","owner_user_id":"515774","post_type_id":"1","score":"2","tags":"jquery|ios|canvas|touch","view_count":"231"} +{"id":"43854743","title":"How is my Java code compiled if my CLASSPATH variable is empty?","body":"\u003cp\u003eI know that \u003ccode\u003e$CLASSPATH\u003c/code\u003e includes a list of paths where Java compiler looks for jar files to use their classes. \u003c/p\u003e\n\n\u003cp\u003eWhen I type: \u003ccode\u003eecho $CLASSPATH\u003c/code\u003e I get an empty line, meaning that \u003ccode\u003eCLASSPATH\u003c/code\u003e is empty. \u003c/p\u003e\n\n\u003cp\u003eNow, I wrote the following code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport java.util.ArrayList;\n\npublic class Main {\n\n public static void main(String[] args) {\n ArrayList\u0026lt;String\u0026gt; arrayList = new ArrayList\u0026lt;\u0026gt;();\n arrayList.add(\"Hello\");\n System.out.println(arrayList); \n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand compiled it with the command:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ejavac Main.java\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe file compiled successfully. If the \u003ccode\u003eCLASSPATH\u003c/code\u003e is empty, how did java compiler find the class \u003ccode\u003ejava.util.ArrayList\u003c/code\u003e? \u003c/p\u003e","accepted_answer_id":"43854879","answer_count":"1","comment_count":"0","creation_date":"2017-05-08 18:24:20.603 UTC","last_activity_date":"2017-05-08 21:09:44.637 UTC","last_edit_date":"2017-05-08 21:09:44.637 UTC","last_editor_display_name":"user7605325","owner_display_name":"","owner_user_id":"5402618","post_type_id":"1","score":"1","tags":"java|classpath","view_count":"59"} +{"id":"32871878","title":"Running PS1 as script; issues in Windows 8","body":"\u003cp\u003eI have a script that I commonly run via a shortcut, and in Windows 8 and above I have to right click Run as Administrator for everything to work right. This is true even when I am logged in as an Administrator. However, I also want to automate this a couple different ways, including Remoting, SCCM/ZenWorks/Case, Scheduled tasks etc. So far as I can tell, there is no way to \"Run as Administrator\" in those cases. So, is there some setting in Windows 8 that removes the need for Run as Administrator, or a way to RaA with non manual mechanisms, or...?\u003c/p\u003e","answer_count":"0","comment_count":"15","creation_date":"2015-09-30 17:04:41.647 UTC","last_activity_date":"2015-09-30 17:04:41.647 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4552490","post_type_id":"1","score":"0","tags":"powershell|runas","view_count":"70"} +{"id":"22910687","title":"What are the differences between MVC controllers (can I inject all controllers in one controller)?","body":"\u003cblockquote\u003e\n \u003cp\u003eWhat are the defferent between \u003cstrong\u003eController\u003c/strong\u003e(MVC) vs \u003cstrong\u003eApiController\u003c/strong\u003e and \u003cstrong\u003eBreezeController\u003c/strong\u003e and \u003cstrong\u003eIHttpController\u003c/strong\u003e and \u003cstrong\u003eODataController\u003c/strong\u003e? \u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003chr\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eWhy So many controllers in \u003ccode\u003eMVC\u003c/code\u003e? Which one is a main controller? Can i inject the all controllers in one controller? \u003c/p\u003e\n\u003c/blockquote\u003e","answer_count":"4","comment_count":"0","creation_date":"2014-04-07 11:10:18.73 UTC","last_activity_date":"2016-03-12 08:53:42.73 UTC","last_edit_date":"2014-04-07 11:14:35.883 UTC","last_editor_display_name":"","last_editor_user_id":"1901272","owner_display_name":"user3484362","post_type_id":"1","score":"2","tags":"c#|asp.net-mvc|api|controller|odata","view_count":"257"} +{"id":"32440416","title":"how to store and retrieve multiple decision trees in matlab","body":"\u003cp\u003eI have a for loop that generates a single decision tree each time and later on in the program I need to apply all the decision trees to the testing data (the decision trees are NOT combined in an ensemble). I tried to store them in an array of structures but when I am applying them to the test data I have the following error:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e(Undefined function 'predict' for input arguments of type 'struct'.).\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI know that the tree generated is an object but how you can store and retrieve multiple objects in MATLAB?\u003c/p\u003e","accepted_answer_id":"32440678","answer_count":"2","comment_count":"1","creation_date":"2015-09-07 13:56:36.52 UTC","last_activity_date":"2015-09-07 14:46:50.15 UTC","last_edit_date":"2015-09-07 14:28:46.153 UTC","last_editor_display_name":"","last_editor_user_id":"5211833","owner_display_name":"","owner_user_id":"5309354","post_type_id":"1","score":"0","tags":"matlab|object|struct|classification|decision-tree","view_count":"244"} +{"id":"40766921","title":"How to get Places.GeoDataApi.getAutocompletePredictions ONLY inside the bounds?","body":"\u003cp\u003eI am using Places.GeoDataApi for Android and I get different search results depending on the location of the device performing the request. I need the results to be consistently located inside the bounds. I don't see where that could be setup in the getAutocompletePredictions request. Is there anything I am missing?\u003c/p\u003e\n\n\u003cp\u003eI get address/place autocomplete suggestions using the GoogleApiClient and Places API through:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ePlaces.GeoDataApi.getAutocompletePredictions()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe method requires a GoogleApiClient object, a String to autocomplete, and a LatLngBounds object to limit the search range. This is what my usage looks like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eLatLngBounds bounds = new LatLngBounds(new LatLng(38.46572222050097, -107.75668023304138),new LatLng(39.913037779499035, -105.88929176695862));\n\n\nGoogleApiClient mGoogleApiClient = new GoogleApiClient.Builder(this)\n .addConnectionCallbacks(this)\n .addOnConnectionFailedListener(this)\n .addApi(LocationServices.API)\n .addApi(Places.GEO_DATA_API)\n .build();\n\n\nPendingResult\u0026lt;AutocompletePredictionBuffer\u0026gt; results =\nPlaces.GeoDataApi.getAutocompletePredictions(googleApiClient, \"Starbucks\", bounds, null);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eVersion in use: com.google.android.gms:play-services-location:8.3.0\u003c/p\u003e\n\n\u003cp\u003eDocumentation:\n\u003ca href=\"https://developers.google.com/places/android/autocomplete\" rel=\"nofollow noreferrer\"\u003ehttps://developers.google.com/places/android/autocomplete\u003c/a\u003e\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2016-11-23 14:18:54.053 UTC","favorite_count":"1","last_activity_date":"2016-12-12 23:13:02.207 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1794555","post_type_id":"1","score":"4","tags":"google-places-api|google-places|android-googleapiclient","view_count":"1518"} +{"id":"20693530","title":"How to get HTML contents including parent?","body":"\u003cp\u003eI'm trying to understand how to get the HTML contents including the parent selector. I know that the following will get me the HTML contents:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$obj.html();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e(where $obj is a reference to my DOM object)\u003c/p\u003e\n\n\u003cp\u003eBut what if I want the HTML contents including the parent selector? For example, let's say I have this code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div id=\"sample\" class=\"something\"\u0026gt;\n \u0026lt;div class=\"inner\"\u0026gt;\u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf I do:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$('#sample').html();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e...I will get:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"inner\"\u0026gt;\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut what I really want retuned is this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div id=\"sample\" class=\"something\"\u0026gt;\n \u0026lt;div class=\"inner\"\u0026gt;\u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny ideas?\u003c/p\u003e","accepted_answer_id":"20693556","answer_count":"2","comment_count":"1","creation_date":"2013-12-19 23:13:10.123 UTC","last_activity_date":"2013-12-19 23:22:13.957 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1809053","post_type_id":"1","score":"0","tags":"jquery","view_count":"80"} +{"id":"21404918","title":"wordpress htaccess overrides laravel","body":"\u003cp\u003eI have been installed wordpress (domain \u003ca href=\"http://example.com\" rel=\"nofollow\"\u003ehttp://example.com\u003c/a\u003e) in public_html and I installed laravel in public_html/laravel/ directory, when I try to access example.com/laravel I get laravel logo that means it works fine but when I try to access example.com/laravel/test I get wordpress 404, I noticed that when i remove .htaccess in root (public_html) folder laravel works fine and returns some view\u003c/p\u003e\n\n\u003cp\u003ethis is my wordpress htaccess ...\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e# BEGIN WordPress\n\u0026lt;IfModule mod_rewrite.c\u0026gt;\nRewriteEngine On\nRewriteBase /\nRewriteRule ^index\\.php$ - [L]\nRewriteCond %{REQUEST_FILENAME} !-f\nRewriteCond %{REQUEST_FILENAME} !-d\nRewriteRule . /index.php [L]\n\u0026lt;/IfModule\u0026gt;\n\n# END WordPress\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"0","creation_date":"2014-01-28 11:52:17.393 UTC","favorite_count":"1","last_activity_date":"2014-01-28 15:36:45.987 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2180584","post_type_id":"1","score":"2","tags":"wordpress|.htaccess|mod-rewrite|laravel|laravel-4","view_count":"706"} +{"id":"27332539","title":"App icon is not shown in android device","body":"\u003cp\u003eI have developed a game for android device using LibGDX. When I test the app in actual devices the app get installs properly and the app icon is shown in the apps.\u003c/p\u003e\n\n\u003cp\u003eWhen I tried in a device Redmi from xiaomi, a default green robot icon was shown instead of the app's icon. I have even removed the ic_launcher.png from the drawable* folders, the issue still existed. Could you please explain / assist me to resolve this ?\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/pwTGv.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/byai5.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e","answer_count":"0","comment_count":"6","creation_date":"2014-12-06 14:09:37.69 UTC","favorite_count":"2","last_activity_date":"2017-04-01 07:27:46.423 UTC","last_edit_date":"2014-12-06 18:09:00.61 UTC","last_editor_display_name":"","last_editor_user_id":"2155425","owner_display_name":"","owner_user_id":"2155425","post_type_id":"1","score":"2","tags":"android|libgdx","view_count":"246"} +{"id":"22622118","title":"What is the meaning of ${arg##/*/} and {} \\; in shell scripting","body":"\u003cp\u003ePlease find the code below for displaying the directories in the current folder.\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eWhat is the meaning of \u003ccode\u003e${arg##/*/}\u003c/code\u003e in shell scripting. (Both \u003ccode\u003earg#*\u003c/code\u003e and \u003ccode\u003earg##/*/\u003c/code\u003e gives the same output. )\u003c/li\u003e\n\u003cli\u003eWhat is the meaning of \u003ccode\u003e{} \\;\u003c/code\u003e in for loop statement.\u003c/li\u003e\n\u003c/ol\u003e\n\n\n\n\u003cpre\u003e\u003ccode\u003efor arg in `find . -type d -exec ls -d {} \\;`\ndo\n echo \"Output 1\" ${arg##/*/}\n echo \"Output 2\" ${arg#*}\ndone\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"22624786","answer_count":"2","comment_count":"3","creation_date":"2014-03-24 22:44:45.523 UTC","last_activity_date":"2014-04-01 19:03:12.94 UTC","last_edit_date":"2014-03-24 22:52:04.677 UTC","last_editor_display_name":"","last_editor_user_id":"3076724","owner_display_name":"","owner_user_id":"3395194","post_type_id":"1","score":"0","tags":"shell|sh","view_count":"438"} +{"id":"47213469","title":"How to implement Averaged Perceptron in Python (without Scikit-learn)","body":"\u003cp\u003eI am trying to fit the binary classification using Averaged Perceptron model.\u003c/p\u003e\n\n\u003cp\u003eI followed the instructions line by line of the book by Daume\u003cbr\u003e\n (\u003ca href=\"http://ciml.info/dl/v0_99/ciml-v0_99-ch04.pdf\" rel=\"nofollow noreferrer\"\u003ehttp://ciml.info/dl/v0_99/ciml-v0_99-ch04.pdf\u003c/a\u003e) (Page 53 for averaged perceptron).\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/bBtqJ.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/bBtqJ.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eHere is my implementation:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef aperceptron_sgd(X, Y,epochs): \n # initialize weights\n w = u = np.zeros(X.shape[1] )\n b = beta = 0\n\n # counters \n final_iter = epochs\n c = 1\n converged = False\n\n # main average perceptron algorithm\n for epoch in range(epochs):\n # initialize misclassified\n misclassified = 0\n\n # go through all training examples\n for x,y in zip(X,Y):\n h = np.dot(x, w)*y\n\n if h \u0026lt;= 0:\n w = w + y*x\n b = b + y\n\n u = u+ y*c*x\n beta = beta + y*c\n misclassified += 1\n\n # update counter regardless of good or bad classification \n c = c + 1\n\n # break loop if w converges\n if misclassified == 0:\n final_iter = epoch\n converged = True\n print(\"Averaged Perceptron converged after: {} iterations\".format(final_iter))\n break\n\n if converged == False:\n print(\"Averaged Perceptron DID NOT converged.\")\n\n # prints\n # print(\"final_iter = {}\".format(final_iter))\n # print(\"b, beta, c , (b-beta/c)= {} {} {} {}\".format(b, beta, c, (b-beta/c)))\n # print(\"w, u, (w-u/c) {} {} {}\".format(w, u, (w-u/c)) )\n\n\n # return w and final_iter\n w = w - u/c\n b = np.array([b- beta/c])\n w = np.append(b, w)\n\n return w, final_iter\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, When I test this with the data it gives inaccurate predictions.\u003c/p\u003e\n\n\u003cp\u003eThe data is given here:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e 1.36 3.57 1 \n 1.78 -0.79 -1 \n-0.88 0.96 1 \n 1.64 -0.63 -1 \n-0.98 1.34 1 \n 1.50 0.33 -1 \n 0.15 1.48 1 \n 1.39 -1.71 -1 \n 0.08 2.24 1 \n 1.87 -0.35 -1 \n 0.25 2.52 1 \n 1.68 -0.56 -1 \n 0.23 2.75 1 \n 2.05 -0.85 -1 \n-0.53 1.40 1 \n 1.92 -0.60 -1 \n 0.12 2.77 1 \n 1.70 -0.40 -1 \n 0.72 2.01 1 \n 0.44 -0.51 -1 \n-1.84 1.13 1 \n 1.46 1.65 -1 \n 0.48 1.94 1 \n 1.57 -0.22 -1 \n-0.45 2.14 1 \n 2.71 -0.19 -1 \n-1.04 1.82 1 \n 2.56 0.49 -1 \n 0.26 2.29 1 \n 1.51 -1.11 -1 \n 0.27 1.36 1 \n 2.99 0.84 -1 \n 0.37 2.89 1 \n 2.81 0.19 -1 \n-0.48 1.23 1 \n 2.12 -0.26 -1 \n-0.46 0.47 1 \n 0.77 -0.65 -1 \n 1.52 2.75 1 \n 4.01 1.79 -1 \n 0.67 2.24 1 \n 1.75 0.52 -1 \n 0.19 1.80 1 \n 2.61 0.44 -1 \n-0.54 0.36 1 \n 0.67 -0.59 -1 \n 0.71 2.94 1 \n 1.82 -0.99 -1 \n 0.88 3.82 1 \n 0.78 -1.33 -1 \n 1.17 2.82 1 \n 2.17 0.46 -1 \n 1.05 2.52 1 \n 0.71 -1.14 -1 \n-0.25 2.07 1 \n 1.77 0.29 -1 \n 0.33 3.12 1 \n 0.37 -2.22 -1 \n 0.35 1.79 1 \n 1.10 0.71 -1 \n 0.73 2.74 1 \n 2.26 -0.93 -1 \n-0.20 1.81 1 \n 1.07 -1.21 -1 \n 1.70 3.04 1 \n 2.86 1.26 -1 \n-0.75 1.72 1 \n 2.38 0.12 -1 \n-0.41 0.69 1 \n 2.19 0.71 -1 \n 1.42 3.66 1 \n 1.50 0.46 -1 \n 0.50 2.06 1 \n 1.84 -0.46 -1 \n-1.53 0.12 1 \n 0.78 -0.52 -1 \n-0.21 0.96 1 \n 3.54 2.02 -1 \n-0.14 1.16 1 \n 2.09 0.39 -1 \n-0.79 1.64 1 \n 0.75 0.47 -1 \n 1.02 3.60 1 \n 0.07 -1.45 -1 \n-0.79 1.48 1 \n 2.75 0.24 -1 \n-0.10 1.92 1 \n 1.99 0.31 -1 \n 0.86 2.10 1 \n 2.49 -0.05 -1 \n 1.31 3.54 1 \n 1.04 -1.65 -1 \n-1.45 0.31 1 \n 1.75 -1.01 -1 \n-1.53 0.47 1 \n 2.13 -0.42 -1 \n 0.06 2.06 1 \n 2.20 -0.40 -1 \n 0.94 1.37 1 \n 3.52 1.63 -1 \n 1.79 3.07 1 \n 2.48 0.44 -1 \n 2.48 4.50 1 \n-1.71 -1.60 -1 \n 0.35 2.07 1 \n 0.34 -1.02 -1 \n-0.12 1.90 1 \n 0.56 -1.65 -1 \n-0.03 1.50 1 \n 1.92 -0.76 -1 \n 1.05 3.11 1 \n 1.49 -0.46 -1 \n 0.73 1.98 1 \n 1.26 0.10 -1 \n 0.71 1.90 1 \n 0.70 -1.50 -1 \n-1.55 0.89 1 \n 1.41 0.39 -1 \n 1.68 3.60 1 \n 1.77 0.41 -1 \n 0.64 3.94 1 \n 1.23 -0.71 -1 \n 1.52 2.82 1 \n 3.03 1.18 -1 \n 0.65 1.75 1 \n 1.15 -1.15 -1 \n-0.79 1.20 1 \n 2.87 1.03 -1 \n-0.99 1.49 1 \n 1.75 -0.34 -1 \n 1.63 2.88 1 \n 2.62 0.25 -1 \n-1.39 1.22 1 \n 2.65 0.90 -1 \n 1.07 2.97 1 \n 3.68 0.59 -1 \n 1.23 3.30 1 \n 1.19 0.54 -1 \n-0.76 1.51 1 \n 0.35 -2.90 -1 \n 1.39 2.98 1 \n 1.38 -0.28 -1 \n-0.51 1.21 1 \n 0.80 -0.41 -1 \n-1.63 0.16 1 \n 2.26 0.10 -1 \n 0.27 2.76 1 \n 1.84 0.14 -1 \n-0.05 1.73 1 \n 3.82 1.46 -1 \n-1.87 0.02 1 \n 2.98 0.97 -1 \n-0.48 1.70 1 \n 1.84 -0.39 -1 \n 0.63 1.90 1 \n 1.36 -0.80 -1 \n-1.20 0.35 1 \n 0.88 -1.37 -1 \n-0.84 1.01 1 \n 1.93 -0.48 -1 \n 0.18 1.84 1 \n 1.70 0.33 -1 \n-0.12 0.86 1 \n 2.16 0.05 -1 \n-1.17 -0.08 1 \n 0.99 -0.32 -1 \n-0.41 2.19 1 \n 2.17 0.51 -1 \n 1.71 3.66 1 \n 3.70 1.87 -1 \n 0.28 1.22 1 \n 2.77 1.36 -1 \n 0.03 1.60 1 \n 3.61 1.62 -1 \n-0.52 2.73 1 \n 2.96 1.07 -1 \n-0.43 1.56 1 \n 1.61 1.35 -1 \n 0.78 1.92 1 \n 2.23 -0.44 -1 \n 0.50 2.36 1 \n 1.83 -0.84 -1 \n-0.01 1.30 1 \n 3.16 1.37 -1 \n-0.96 0.89 1 \n 3.61 1.71 -1 \n 0.78 2.40 1 \n 1.78 0.52 -1 \n-0.75 1.52 1 \n 2.14 0.60 -1 \n-1.65 0.68 1 \n 2.16 0.10 -1 \n-1.64 1.68 1 \n 2.32 0.24 -1 \n 0.18 2.59 1 \n 1.86 -0.02 -1 \n-0.18 2.47 1 \n 3.47 1.96 -1 \n 0.00 3.00 1 \n 2.57 -0.18 -1 \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is the code to produce the data:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef gen_lin_separable_data(data, data_tr, data_ts,data_size):\n mean1 = np.array([0, 2])\n mean2 = np.array([2, 0])\n cov = np.array([[0.8, 0.6], [0.6, 0.8]])\n X1 = np.random.multivariate_normal(mean1, cov, size=int(data_size/2))\n y1 = np.ones(len(X1))\n X2 = np.random.multivariate_normal(mean2, cov, size=int(data_size/2))\n y2 = np.ones(len(X2)) * -1\n\n\n with open(data,'w') as fo, \\\n open(data_tr,'w') as fo1, \\\n open(data_ts,'w') as fo2:\n for i in range( len(X1)):\n line = '{:5.2f} {:5.2f} {:5.0f} \\n'.format(X1[i][0], X1[i][1], y1[i])\n line2 = '{:5.2f} {:5.2f} {:5.0f} \\n'.format(X2[i][0], X2[i][1], y2[i])\n fo.write(line)\n fo.write(line2)\n\n for i in range( len(X1) - 20):\n line = '{:5.2f} {:5.2f} {:5.0f} \\n'.format(X1[i][0], X1[i][1], y1[i])\n line2 = '{:5.2f} {:5.2f} {:5.0f} \\n'.format(X2[i][0], X2[i][1], y2[i])\n fo1.write(line)\n fo1.write(line2)\n\n for i in range((len(X1) - 20), len(X1) ):\n line = '{:5.2f} {:5.2f} {:5.0f} \\n'.format(X1[i][0], X1[i][1], y1[i])\n line2 = '{:5.2f} {:5.2f} {:5.0f} \\n'.format(X2[i][0], X2[i][1], y2[i])\n fo2.write(line)\n fo2.write(line2)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe code to read data:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef read_data(infile):\n data = np.loadtxt(infile)\n X = data[:,:-1]\n Y = data[:,-1]\n\n # add bias to X's first column\n ones = np.ones(X.shape[0]).reshape(X.shape[0],1)\n X1 = np.append(ones, X, axis=1)\n\n # X is needed for plot \n return X, X1, Y\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe code to predict the label is this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef predict(X,w):\n return np.sign(np.dot(X, w))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eTesting method:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edata = 'data.txt'\ndata_tr = 'data_train.txt'\ndata_ts = 'data_test.txt'\ndata_size = 200\ngen_lin_separable_data(data, data_tr, data_ts,data_size)\nepochs = 200\nX_train, X1_train, Y_train = read_data(data_tr)\nX_test, X1_test, Y_test = read_data(data_ts)\n\nw, final_iter = aperceptrons(X_train, Y_train, epochs)\nscore = perceptron_test(w, X1_test)\n\ncorrect = np.sum(score == Y_test)\nprint(\"Total: {} Correct: {} Accuracy = {} %\".format(\n len(score), correct, correct/ len(score) * 100))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eQuestion\u003c/strong\u003e \u003c/p\u003e\n\n\u003cp\u003eI tried my best to fix the error, but could not find a way to do it in \npython. I am talking about implementation with numpy not with scikit, or any other advanced package.\u003c/p\u003e\n\n\u003cp\u003eSo the question remains:\n\u003cstrong\u003eHow can we implement averaged perception with numpy ?\u003c/strong\u003e\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-11-09 23:40:02.2 UTC","favorite_count":"1","last_activity_date":"2017-11-10 16:25:09.773 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5200329","post_type_id":"1","score":"1","tags":"python|numpy|machine-learning|svm|perceptron","view_count":"64"} +{"id":"42300815","title":"Java programs about generics","body":"\u003cp\u003eUsing Generics to count the occurrence of an element in an array of any \ntype.\u003c/p\u003e\n\n\u003cp\u003eThe signature of the count method is given below:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic static \u0026lt;T\u0026gt; int count(T[] array, T item)\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"12","creation_date":"2017-02-17 14:49:42.77 UTC","favorite_count":"2","last_activity_date":"2017-02-17 15:09:33.123 UTC","last_edit_date":"2017-02-17 15:09:33.123 UTC","last_editor_display_name":"","last_editor_user_id":"3695939","owner_display_name":"","owner_user_id":"7193937","post_type_id":"1","score":"-11","tags":"java|arrays|generics","view_count":"67"} +{"id":"24282353","title":"Grep-ing a list of filename against a csv list of names","body":"\u003cp\u003eI have a CSV files containing a list of ids, numbers, each on a row. Let's call that file ids.csv\nIn a directory i have a big number of files, name \"file_123456_smth.csv\", where 123456 is an id that could be found in the ids csv file\nNow, what I am trying to achieve: compare the names of the files with the ids stored in ids.csv. If 123456 is found in ids.csv then the filename should be displayed.\nWhat i've tried:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003els -a | xargs grep -L cat ../../ids.csv\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOf course, this does not work, but gives an idea of my direction.\u003c/p\u003e","accepted_answer_id":"24282654","answer_count":"1","comment_count":"2","creation_date":"2014-06-18 09:49:17.257 UTC","last_activity_date":"2014-06-18 10:58:26.483 UTC","last_edit_date":"2014-06-18 10:30:35.413 UTC","last_editor_display_name":"","last_editor_user_id":"1887900","owner_display_name":"","owner_user_id":"1887900","post_type_id":"1","score":"-1","tags":"shell|unix|csv|awk","view_count":"99"} +{"id":"41913472","title":"Extract string values before and after character","body":"\u003cp\u003eNeed to fetch string values before fullstop(.) and after fullstop(.) (i.e before fullstop upto T_Mas_Customer' and after fullstop upto 'Cu_Ccg_Code' and for remaining values in the below sentence. My below query is fetching only first values I need for remaining values also in the below mentioned sentence defined in variable.\u003c/p\u003e\n\n\u003cp\u003eDecode ( T_Mas_Customer.Cu_Ccg_Code,11,0,nvl ( ST_V_Trn_Premium_Report.Pol_Cover_Note_Min,12,8,nvl ( ST_V_Trn_test_Report.Pol_Cover_Note_Min,11,3\u003c/p\u003e\n\n\u003cp\u003eselect substring(@abc, charindex(@bdf, @abc)+1 , charindex(@bdc, @abc) - charindex(@bdf, @abc)-1 )\nselect substring(@abc, charindex(@bdc, @abc)+1 , charindex(@xyz, @abc)- charindex(@bdc, @abc)-1 )\u003c/p\u003e\n\n\u003cp\u003eactual output: T_Mas_Customer Cu_Ccg_Code\u003c/p\u003e\n\n\u003cp\u003eEstimated output: \nT_Mas_Customer Cu_Ccg_Code\nST_V_Trn_Premium_Report Pol_Cover_Note_Min\nST_V_Trn_test_Report Pol_Cover_Note_Min\u003c/p\u003e\n\n\u003cp\u003ePlease help\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-01-28 18:46:30.533 UTC","last_activity_date":"2017-01-28 18:46:30.533 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7479475","post_type_id":"1","score":"0","tags":"msbi","view_count":"11"} +{"id":"26546761","title":"¿How can I load a webView from here with a local html file?","body":"\u003cp\u003eI have this and I want, from that button, to load a webview with certain local html file that I have in the assets folder.\u003c/p\u003e\n\n\u003cpre class=\"lang-java prettyprint-override\"\u003e\u003ccode\u003e@Override\npublic void onResume() {\n super.onResume();\n\n mProductividadYDesarrolloPersonalButton = (Button)getView().findViewById(R.id.button);\n mProductividadYDesarrolloPersonalButton.setOnClickListener(new View.OnClickListener() {\n\n @Override\n public void onClick(View v) {\n\n // What should I add here?\n\n }\n });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat should I do?\u003c/p\u003e\n\n\u003cp\u003eThe activity of the web view is this:\u003c/p\u003e\n\n\u003cpre class=\"lang-java prettyprint-override\"\u003e\u003ccode\u003epublic class lectura_view extends Activity {\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_web_view);\n\n // Buscar AdView como recurso y cargar una solicitud.\n AdView adView = (AdView)this.findViewById(R.id.adView);\n AdRequest adRequest = new AdRequest.Builder().build();\n adView.loadAd(adRequest);\n\n Intent launchingIntent = getIntent();\n String content = launchingIntent.getData().toString();\n\n WebView mWebView;\n\n mWebView = (WebView) findViewById(R.id.lectura_webView);\n mWebView.loadUrl(content);\n\n mWebView.getSettings().setBuiltInZoomControls(true);\n mWebView.getSettings().setDisplayZoomControls(false);\n\n mWebView.setLongClickable(true);\n mWebView.setOnLongClickListener(new View.OnLongClickListener() {\n\n @Override\n public boolean onLongClick(View v) {\n return true;\n }\n });\n }\n\n @Override\n public boolean onCreateOptionsMenu(Menu menu) {\n // Inflate the menu; this adds items to the action bar if it is present.\n getMenuInflater().inflate(R.menu.web_view, menu);\n return true;\n }\n\n @Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Handle action bar item clicks here. The action bar will\n // automatically handle clicks on the Home/Up button, so long\n // as you specify a parent activity in AndroidManifest.xml.\n int id = item.getItemId();\n if (id == R.id.action_settings) {\n return true;\n }\n return super.onOptionsItemSelected(item);\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eEDIT 1: This is the error it gives when I try the first solution.\u003c/p\u003e\n\n\u003cpre class=\"lang-java prettyprint-override\"\u003e\u003ccode\u003e @Override\n public void onClick(View v) {\n\n WebView mWebView;\n\n mWebView = (WebView) getView().findViewById(R.id.lectura_webView);\n mWebView.loadUrl(\"\\\"file:///android_asset/productividad/GettingThingsDoneDavidAllen.html\");\n\n }\n });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd the Log\u003c/p\u003e\n\n\u003cpre class=\"lang-java prettyprint-override\"\u003e\u003ccode\u003eLog:10-24 13:47:46.740 22632-22632/com.estudiable.estudiable E/AndroidRuntime﹕ FATAL EXCEPTION: main\nProcess: com.estudiable.estudiable, PID: 22632\njava.lang.NullPointerException\n at com.estudiable.estudiable.Seccion4$1.onClick(Seccion4.java:56)\n at android.view.View.performClick(View.java:4456)\n at android.view.View$PerformClick.run(View.java:18465)\n at android.os.Handler.handleCallback(Handler.java:733)\n at android.os.Handler.dispatchMessage(Handler.java:95)\n at android.os.Looper.loop(Looper.java:136)\n at android.app.ActivityThread.main(ActivityThread.java:5086)\n at java.lang.reflect.Method.invokeNative(Native Method)\n at java.lang.reflect.Method.invoke(Method.java:515)\n at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)\n at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)\n at dalvik.system.NativeStart.main(Native Method)\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"26548132","answer_count":"2","comment_count":"5","creation_date":"2014-10-24 11:09:33.6 UTC","last_activity_date":"2014-10-24 12:43:27.533 UTC","last_edit_date":"2014-10-24 11:48:19.407 UTC","last_editor_display_name":"","last_editor_user_id":"4032430","owner_display_name":"","owner_user_id":"4032430","post_type_id":"1","score":"1","tags":"android|android-intent|android-fragments|webview","view_count":"111"} +{"id":"32063600","title":"PHP set dropdown list default value","body":"\u003cp\u003eI have a dropdown list in which options are generated by javascript like that: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;select class=\"form-control\" id=\"which-year\" name=\"which-year\"\u0026gt;\n \u0026lt;option value=\"2015\"\u0026gt;2015\u0026lt;/option\u0026gt;\n \u0026lt;option value=\"2016\"\u0026gt;2016\u0026lt;/option\u0026gt;\n \u0026lt;option value=\"2017\"\u0026gt;2017\u0026lt;/option\u0026gt;\n etc...\n \u0026lt;!-- options generated by scripts.js --\u0026gt;\n\u0026lt;/select\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAfter page loaded, I will retrieve \u003ccode\u003ewhich-year\u003c/code\u003e (an integer number) from database and set it as an option in dropdown list above. Problem is I don't know how to add the \u003ccode\u003eselected\u003c/code\u003e attribute using \u003ccode\u003ePHP\u003c/code\u003e to those options because they are totally generated by script.\u003cbr\u003e\nHow can I do that.\u003cbr\u003e\nThank you.\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2015-08-18 04:33:39.85 UTC","last_activity_date":"2015-08-18 04:41:35.237 UTC","last_edit_date":"2015-08-18 04:36:46.29 UTC","last_editor_display_name":"","last_editor_user_id":"3598009","owner_display_name":"","owner_user_id":"3598009","post_type_id":"1","score":"0","tags":"javascript|php|drop-down-menu","view_count":"92"} +{"id":"5660073","title":"What to use instead of \"var\" in Asp.Net 2.0","body":"\u003cp\u003eI'm craeting 2 dependent drop down menus. So I used the code in this link's solution:\n\u003ca href=\"https://stackoverflow.com/questions/1256086/dynamically-add-drop-down-lists-and-remember-them-through-postbacks\"\u003eDynamically add drop down lists and remember them through postbacks\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eBut I guess the problem is that var usage belongs to 3.5. So Visual Studio doesn't recognize it. So what can I use instead of var in this line?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar items = new List\u0026lt;ListItem\u0026gt;();\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"5660087","answer_count":"2","comment_count":"2","creation_date":"2011-04-14 07:43:48.1 UTC","last_activity_date":"2011-04-14 07:52:45.64 UTC","last_edit_date":"2017-05-23 09:58:46.983 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"705982","post_type_id":"1","score":"0","tags":"c#|asp.net|c#-2.0","view_count":"1323"} +{"id":"40232471","title":"Fast way to do lexicographical comparing 2 numbers","body":"\u003cp\u003eI'm trying to sort a vector of unsigned int in lexicographical order.\u003c/p\u003e\n\n\u003cp\u003eThe std::lexicographical_compare function only supports iterators so I'm not sure how to compare two numbers.\u003c/p\u003e\n\n\u003cp\u003eThis is the code I'm trying to use:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003estd::sort(myVector-\u0026gt;begin(),myVector-\u0026gt;end(), [](const unsigned int\u0026amp; x, const unsigned int\u0026amp; y){\n std::vector\u0026lt;unsigned int\u0026gt; tmp1(x);\n std::vector\u0026lt;unsigned int\u0026gt; tmp2(y);\n return lexicographical_compare(tmp1.begin(),tmp1.end(),tmp2.begin(),tmp2.end());\n} );\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"40232600","answer_count":"1","comment_count":"6","creation_date":"2016-10-25 06:03:40.203 UTC","last_activity_date":"2016-10-25 06:14:37.557 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6738072","post_type_id":"1","score":"2","tags":"c++|c++14|lexicographic","view_count":"85"} +{"id":"1437413","title":"MySQL statement: spliting rows values into new columns","body":"\u003cp\u003eUsing MySQL I need to return new first/last name columns for each user in table1.\u003c/p\u003e\n\n\u003cpre\u003e\n**Table1** \nuid \n1 \n2 \n\n**Table2** \nid fid uid field_value \n1 1 1 Joe \n2 2 1 Blow \n3 1 2 Joe \n4 2 2 Blogs\n\n**Result**\nuid first_name last_name\n1 Joe Blow\n2 Joe Blogs\n\u003c/pre\u003e","accepted_answer_id":"1437435","answer_count":"3","comment_count":"1","creation_date":"2009-09-17 08:14:32.19 UTC","last_activity_date":"2009-09-17 08:20:47.95 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"87921","post_type_id":"1","score":"0","tags":"mysql","view_count":"111"} +{"id":"43011651","title":"Trouble With Doubly Linked List Recursive","body":"\u003cp\u003eI'm having trouble doing recursive deletion, Currently I'm able to delete 1 node at a time when I'm supposed to delete all the matches. I'm not able to delete all instances in a loop.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evoid delete(struct node *ptr){\n struct node *tmp; \n while(ptr-\u0026gt;next != NULL \u0026amp;\u0026amp; (ptr-\u0026gt;next)-\u0026gt;critical = 'c'){\n ptr = ptr-\u0026gt;next; //Iterate until I find a node next to data\n }\n if(ptr-\u0026gt;next == NULL){\n printf(\"No Element\");\n }\n tmp = ptr-\u0026gt;next;\n if(tmp-\u0026gt;next == NULL){\n ptr-\u0026gt;next = NULL;\n } else {\n ptr-\u0026gt;next = tmp-\u0026gt;next;\n (ptr-\u0026gt;next)-\u0026gt;prev = tmp-\u0026gt;prev;\n }\n tmp-\u0026gt;prev = ptr;\n free(tmp);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eWorking Update\u003c/strong\u003e\nI just had to put all this inside another while(ptr != NULL){... ptr = ptr-\u003enext} loop for the recursive deletion.\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2017-03-25 01:51:54.44 UTC","last_activity_date":"2017-03-25 06:25:55.373 UTC","last_edit_date":"2017-03-25 06:21:34.307 UTC","last_editor_display_name":"user2714430","owner_display_name":"user2714430","post_type_id":"1","score":"0","tags":"c|recursion|data-structures","view_count":"39"} +{"id":"29383012","title":"How to implement tree structure type form filling dynamically in js","body":"\u003cp\u003eI want to create a dynamic tree structure, where I want to edit/delete nodes and its data. At each level of this tree structure we have different forms to add/edit/delete data.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-04-01 04:44:16.753 UTC","last_activity_date":"2015-04-03 04:32:37.657 UTC","last_edit_date":"2015-04-01 05:27:41.19 UTC","last_editor_display_name":"","last_editor_user_id":"2450507","owner_display_name":"","owner_user_id":"4213959","post_type_id":"1","score":"0","tags":"javascript|treeview","view_count":"648"} +{"id":"46226214","title":"how to send all the values in the trifilter on grid extjs on both checkchange and on hit of enter","body":"\u003cp\u003eI have a grid with filters types string, numeric, and date the problem with numeric and date filters is they have tri values if the user wants to send all the values like lt, gt, like values how to I send them on both by checking the filter and hitting enter. I am able to send them by hitting them enter but unable to send them by checkchange event. Here is the sample fiddle to the test case.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://fiddle.sencha.com/#fiddle/26hg\u0026amp;view/editor\" rel=\"nofollow noreferrer\"\u003eFiddle\u003c/a\u003e\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-09-14 18:41:29.67 UTC","last_activity_date":"2017-09-14 19:25:54.853 UTC","last_edit_date":"2017-09-14 19:25:54.853 UTC","last_editor_display_name":"","last_editor_user_id":"1954626","owner_display_name":"","owner_user_id":"1954626","post_type_id":"1","score":"0","tags":"extjs|filter|extjs5|extjs6|sencha-architect","view_count":"24"} +{"id":"21693932","title":"Automator/applescript to center desktop background (OSX 10.9 Mavericks)","body":"\u003cp\u003eI am using an automator workflow (Get specified URLs\u003eGet Image URLs from Webpage\u003eDownload URLs\u003eSet the Desktop Picture) to get a daily image from a website to set as my desktop background. \u003c/p\u003e\n\n\u003cp\u003eThe image is a fixed 720px wide. When the automator workflow runs it sets the background image with the fitting options of \"Fill Screen.\"\u003c/p\u003e\n\n\u003cp\u003eHow can I set the fitting options to \"Center\" and set background color to \"White\"?\u003c/p\u003e\n\n\u003cp\u003eSo far my best searching has lead me to something like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etell application \"System Events\"\n tell current desktop\n get properties\n end tell\nend tell\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut I'm pretty new to Applescripts and Automator in general.\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2014-02-11 05:33:23.81 UTC","last_activity_date":"2014-02-11 05:33:23.81 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3295626","post_type_id":"1","score":"1","tags":"image|osx|applescript|desktop|automator","view_count":"295"} +{"id":"30917865","title":"Jquery's KeyboardJs add event","body":"\u003cp\u003eHi I am trying to make a webapplication that attaches a keyboard to an input (let the input's ID be input1). I want to trigger a function when the input changes (or the keyboard is clicked). So far I have tried\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$('#input1').change(function(){\n doThis();\n });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$('#input1').on('change', function(){\n doThis();\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever both does not call the \u003cem\u003edoThis()\u003c/em\u003e function. Is there any way to create an event listener when a keyboard button is clicked? Thanks!\u003c/p\u003e","answer_count":"3","comment_count":"3","creation_date":"2015-06-18 14:15:00.927 UTC","last_activity_date":"2015-06-18 14:25:49.963 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4876251","post_type_id":"1","score":"0","tags":"javascript|jquery","view_count":"33"} +{"id":"3522717","title":"Problem using like button in application profile tab","body":"\u003cp\u003eI have an application profile for my application. I am trying to use a like button. But it is does not work.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;fb:like layout=\"button_count\" href=\"http://fbrell.com\"\u0026gt;\u0026lt;/fb:like\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut share button works fine. Like button works fine on canvas page.\u003c/p\u003e\n\n\u003cp\u003eAm i missing something.\u003c/p\u003e\n\n\u003cp\u003eI appreciate your help.\u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2010-08-19 14:20:27.293 UTC","last_activity_date":"2011-03-02 05:01:02.283 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"425351","post_type_id":"1","score":"0","tags":"facebook|facebook-like","view_count":"462"} +{"id":"35568456","title":"Long pages on Website Creates a Right Margin on Mobile Devices","body":"\u003cp\u003eWhen I view my website on a mobile device and if a page is longer than the height of the mobile device display, then it will automatically zoom out so that the whole length of the page is displayed on the screen, instead of displaying a scroll bar. This creates a margin at right side. It will do this until the page reaches a certain length, then it will display the scroll bar, but the right margin is still there.\u003c/p\u003e\n\n\u003cp\u003eHere is a sample page:\n\u003ca href=\"http://theprophecy.tv/testing/product1.php\" rel=\"nofollow\"\u003ehttp://theprophecy.tv/testing/product1.php\u003c/a\u003e \u003c/p\u003e\n\n\u003cp\u003eHow can I fix this issue?\u003c/p\u003e\n\n\u003cp\u003eMy site is not yet mobile friendly. It is showing full site on mobile.\u003c/p\u003e","answer_count":"1","comment_count":"9","creation_date":"2016-02-23 03:49:16.167 UTC","last_activity_date":"2016-02-27 04:57:20.983 UTC","last_edit_date":"2016-02-27 04:57:20.983 UTC","last_editor_display_name":"","last_editor_user_id":"1659677","owner_display_name":"","owner_user_id":"2268163","post_type_id":"1","score":"0","tags":"php|html|css|mobile|mobile-safari","view_count":"36"} +{"id":"16155933","title":"Java: Subclass class and its subclass (both out of my scope) at the same time","body":"\u003cp\u003eGiven two classes, one subclasses the other, both out of my scope, so I don't have any influence on them, eg.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class Bla {\n}\n\npublic class SubBla extends Bla {\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow can I create a customized subclass of Bla and SubBla without repeating code or limit SubBla's special functionalities?\u003c/p\u003e\n\n\u003cp\u003eEdit: So I don't have to:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class MyBla extends Bla {\n public void someOverriddenMethodOfBla()\n {\n super.someOverriddenMethodOfBla();\n // do something custom\n }\n}\n\npublic class MySubBla extends SubBla {\n\n // repeated code: this should do the same as MyBla's customized method\n public void someOverriddenMethodOfBla()\n {\n super.someOverriddenMethodOfBla();\n // do the same custom stuff as in MyBla's method\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eEdit 2, to clear things up a litte:\u003c/p\u003e\n\n\u003cp\u003eLet's say I need the android classes Activity and ListActivity, which is a subclass of Activity. Now I want to add the \u003cstrong\u003esame\u003c/strong\u003e customization in the onCreate method to \u003cstrong\u003eboth\u003c/strong\u003e. How do I acomplish this without repeating code?\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","answer_count":"3","comment_count":"5","creation_date":"2013-04-22 20:16:23.157 UTC","last_activity_date":"2013-04-22 21:59:32.45 UTC","last_edit_date":"2013-04-22 21:33:02.28 UTC","last_editor_display_name":"","last_editor_user_id":"973224","owner_display_name":"","owner_user_id":"973224","post_type_id":"1","score":"0","tags":"java|subclass|extends|repeating","view_count":"191"} +{"id":"3858992","title":"How to write this class for Django's data model (converting from Propel's YML format)","body":"\u003cp\u003eI am converting a web project that currently uses the \u003ca href=\"http://www.propelorm.org/\" rel=\"nofollow\"\u003ePropel ORM\u003c/a\u003e, to a django project.\u003c/p\u003e\n\n\u003cp\u003eMy first task is to 'port' the model schema to django's.\u003c/p\u003e\n\n\u003cp\u003eI have read the django docs, but they do not appear to be in enough detail. Case in point, how may I 'port' a (contrived) table defined in the Propel YML schema as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e demo_ref_country:\n code: { type: varchar(4), required: true, index: unique }\n name: { type: varchar(64), required: true, index: unique }\n geog_region_id: { type: integer, foreignTable: demo_ref_geographic_region, foreignReference: id, required: true, onUpdate: cascade, onDelete: restrict }\n ccy_id: { type: integer, foreignTable: demo_ref_currency_def, foreignReference: id, required: true, onUpdate: cascade, onDelete: restrict }\n flag_image_path: { type: varchar(64), required: true, default: ''}\n created_at: ~\n\n _indexes:\n\n idx_f1: [geog_region_id, ccy_id, created_at]\n\n _uniques:\n\n idxu_f1_key: [code, geog_region_id, ccy_id]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is my (feeble) attempt so far:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass Country(models.Model):\n code = models.CharField(max_length=4) # Erm, no index on this column .....\n name = models.CharField(max_length=64) # Erm, no index on this column .....\n geog_region_id = models.ForeignKey(GeogRegion) # Is this correct ? (how about ref integrity constraints ?\n ccy_id = models.ForeignKey(Currency) # Is this correct?\n flag_image_path = models.CharField(max_length=64) # How to set default on this col?\n created_at = models.DateTimeField() # Will this default to now() ?\n # Don't know how to specify indexes and unique indexes ....\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003e[Edit]\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eTo all those suggesting that I RTFM, I understand your frustration. Its just that the documentation is not very clear to me. It is probably a Pythonic way of documentation - but coming from a C++ background, I feel the documentation could be improved to make it more accesible for people coming from different languages.\u003c/p\u003e\n\n\u003cp\u003eCase in point: the documentation merely states the class name and an **options parameter in the ctor, but doesn't tell you what the possible options are. \u003c/p\u003e\n\n\u003cp\u003eFor example class CharField(max_length=None,[**options])\u003c/p\u003e\n\n\u003cp\u003eThere is a line further up in the documentation that gives a list of permissible options, which are applicable to all field types.\u003c/p\u003e\n\n\u003cp\u003eHowever, the options are provided in the form:\u003c/p\u003e\n\n\u003cp\u003eField.optionname\u003c/p\u003e\n\n\u003cp\u003eThe (apparently implicit) link between a class property and a constructor argument was not clear to me. It appears that if a class has a property foo, then it means that you can pass an argument named foo to its constructor. Does that observation hold true for all Python classes?\u003c/p\u003e","accepted_answer_id":"3861473","answer_count":"5","comment_count":"0","creation_date":"2010-10-04 20:47:58.477 UTC","last_activity_date":"2010-10-07 06:59:00.783 UTC","last_edit_date":"2010-10-06 11:55:28.577 UTC","last_editor_display_name":"","last_editor_user_id":"461722","owner_display_name":"","owner_user_id":"461722","post_type_id":"1","score":"1","tags":"django|orm|django-models|propel","view_count":"371"} +{"id":"23642728","title":"How to redirect my URLs using htaccess 301 conditional","body":"\u003cp\u003eI need help redirecting my old URL to a new URL.\u003c/p\u003e\n\n\u003cp\u003eThey URLS are structured as required.\u003c/p\u003e\n\n\u003cp\u003eMy OLD URL is something like \u003ccode\u003edomain.com/category/123-title-of-article.html\u003c/code\u003e, where \u003ccode\u003ecategory\u003c/code\u003e is the category name and \u003ccode\u003e123\u003c/code\u003e is the Post ID \u003c/p\u003e\n\n\u003cp\u003eThe NEW URLs are (and this is how I want them to redirect): \u003ccode\u003edomain.com/article/title-of-article-123/\u003c/code\u003e, where \u003ccode\u003earticle\u003c/code\u003e will remain as it is in all URLS, and the post ID will go to end of the URL\u003c/p\u003e\n\n\u003cp\u003eHow I can achieve this?\u003c/p\u003e","accepted_answer_id":"23642920","answer_count":"2","comment_count":"1","creation_date":"2014-05-13 22:34:40.383 UTC","last_activity_date":"2014-05-13 23:07:22.007 UTC","last_edit_date":"2014-05-13 23:04:43.657 UTC","last_editor_display_name":"","last_editor_user_id":"3525545","owner_display_name":"","owner_user_id":"3238029","post_type_id":"1","score":"0","tags":"apache|.htaccess|mod-rewrite|redirect","view_count":"59"} +{"id":"30884809","title":"CPU bound Java process stalls Windows 7","body":"\u003cp\u003eWhen I run GWT compiler, it causes other programs intermittently stall till the compilation ends.\u003c/p\u003e\n\n\u003cp\u003eA preemptive OS like Windows is not expected to starve other processes when one CPU intensive process starts running. And that's how it works for most other processes other than the GWT build.\u003c/p\u003e\n\n\u003cp\u003eThis was not the case with Java 7. So I suspect it's got something to do with the Java 8 JVM.\u003c/p\u003e\n\n\u003cp\u003eIn task manager, the CPU intensive Java process has normal priority. So I am wondering what's causing this.\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2015-06-17 07:20:41.07 UTC","last_activity_date":"2015-06-17 07:20:41.07 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"681671","post_type_id":"1","score":"1","tags":"java|windows|gwt|operating-system|kernel","view_count":"41"} +{"id":"47154294","title":"How to assign boolean value to appdelegate method from view controller","body":"\u003cp\u003eI am new to IOS and swift. Does anyone know how to assign value to boolean appdelegate method? I want to set shouldAllowExtensionPointIdentifier in \u003cstrong\u003eviewcontroller\u003c/strong\u003e but i didn't find any solution. Thank you\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e //\n// AppDelegate.swift\n// TestKeyboard\n//\n// Created by Mol Monyneath on 11/1/17.\n\nimport UIKit\n\n@UIApplicationMain\nclass AppDelegate: UIResponder, UIApplicationDelegate {\n\n var window: UIWindow?\n\n public var Alow : Bool?\n\n func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -\u0026gt; Bool {\n // Override point for customization after application launch \n return true\n }\n func application(_ application: UIApplication, shouldAllowExtensionPointIdentifier extensionPointIdentifier: UIApplicationExtensionPointIdentifier) -\u0026gt; Bool {\n\n print(\"\\(extensionPointIdentifier.rawValue) allow = \\(Alow)\")\n return Alow!\n\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is Main view controller:\nI couldn't block that app . please help\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport UIKit\n\nclass ViewController: UIViewController,UITextFieldDelegate {\n @IBOutlet weak var normaltextView: UITextField!\n @IBOutlet weak var txtView: UITextField!\n var appDelegate = UIApplication.shared.delegate as! AppDelegate\n override func viewDidLoad() {\n super.viewDidLoad()\n\n normaltextView.delegate = self\n txtView.delegate = self \n }\n\n func textFieldShouldBeginEditing(_ textField: UITextField) -\u0026gt; Bool { \n let appDelegate = UIApplication.shared.delegate as! AppDelegate\n if textField.keyboardType == UIKeyboardType.numberPad{\n // textField.inputView = nil\n txtView.inputView = nil\n appDelegate.Alow = false\n txtView.reloadInputViews()\n\n print(\"false\")\n\n }else{\n print(\"should Press\")\n print(\"True\")\n // textField.inputView = nil\n appDelegate.Alow = true\n txtView.reloadInputViews()\n normaltextView.reloadInputViews()\n } \n return true\n } \n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethank\u003c/p\u003e","answer_count":"0","comment_count":"12","creation_date":"2017-11-07 09:31:22.97 UTC","last_activity_date":"2017-11-08 06:01:31.253 UTC","last_edit_date":"2017-11-08 06:01:31.253 UTC","last_editor_display_name":"","last_editor_user_id":"8612340","owner_display_name":"","owner_user_id":"8612340","post_type_id":"1","score":"0","tags":"ios|swift","view_count":"49"} +{"id":"26217423","title":"Border-image in Safari cutting image?","body":"\u003cp\u003eI have a border-image and its working fine, but not in safari. \u003c/p\u003e\n\n\u003cp\u003eIn Google Chrome:\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/olA2o.png\" alt=\"Chrome:\"\u003e\u003c/p\u003e\n\n\u003cp\u003eIn Safari:\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/WeLpf.png\" alt=\"Screenshot from iPad\"\u003e\u003c/p\u003e\n\n\u003cp\u003eAs you can see, the border-image is cut in safari. Any suggestions? The Css code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eborder:40px solid transparent;\nborder-image:url(../images/charts/leistungsangebot/ruler.png) 150 0 round;\n-webkit-border-image:url(../images/charts/leistungsangebot/ruler.png) 150 0 round;\nborder-left:0;\nborder-right:0;\nborder-bottom:0;\nwidth:500px;\nheight:100px;\nmargin-top:100px;\nbackground-color:white;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"26220304","answer_count":"1","comment_count":"0","creation_date":"2014-10-06 13:35:34.773 UTC","last_activity_date":"2014-10-06 16:09:33.823 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3953197","post_type_id":"1","score":"0","tags":"css|safari","view_count":"248"} +{"id":"15985632","title":"How to include \"[\" and \"]\" in awk pattern search","body":"\u003cp\u003eI have following code in a bash script \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003estat_pattern=\"POSITION_UPDATE [ For INRecord ]\"\ncat my_file.txt | awk -v pattern=\"$stat_pattern\" '$0 ~ pattern' | tail -n 1 \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut it does not return any output. \nI tried \"\\\" also with \"[\". buy it did not help also.\u003c/p\u003e\n\n\u003cp\u003ePlease tell me how to treat \"[\" \"]\" characters as a part of search string...\u003c/p\u003e","accepted_answer_id":"15986126","answer_count":"3","comment_count":"3","creation_date":"2013-04-13 08:01:07.43 UTC","favorite_count":"1","last_activity_date":"2013-04-13 09:05:21.873 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1800437","post_type_id":"1","score":"2","tags":"linux|bash|awk","view_count":"90"} +{"id":"25866970","title":"how to add image into the jframe by coding in java swings in netbeans?","body":"\u003cp\u003eI have created the a frame Layout that implements action Listener . here i am \n creating the frames and menu items only by coding. and I am trying to put image \n this frame, so please help me how to add image to the frame in java swings in \n net beans \u003c/p\u003e","answer_count":"1","comment_count":"4","creation_date":"2014-09-16 10:58:03.32 UTC","last_activity_date":"2014-09-16 11:07:06.183 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3966712","post_type_id":"1","score":"0","tags":"java|netbeans","view_count":"565"} +{"id":"44188112","title":"Undefined symbols for architecture x86_64 in Xcode after Firebase update","body":"\u003cp\u003eI updated FirebaseUI to the newest version, and that updated TwitterCore 3.0.0 (was 2.8.0), ever since I get this compiler error in Xcode:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eUndefined symbols for architecture x86_64:\n \"_TWTRIdentifierForAdvertising\", referenced from:\n +[TWTRCardConfiguration deviceID] in TwitterKit(TWTRCardConfiguration.o)\nld: symbol(s) not found for architecture x86_64\nclang: error: linker command failed with exit code 1 (use -v to see invocation)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI currently reverted back to the previous version of TwitterCore even though it wasn't explicitly written in my Podfile. I wrote \u003ccode\u003epod 'TwitterCore', '~\u0026gt;2.8.0'\u003c/code\u003e\u003c/p\u003e","answer_count":"7","comment_count":"0","creation_date":"2017-05-25 19:09:56.823 UTC","last_activity_date":"2017-10-01 11:50:28.81 UTC","last_edit_date":"2017-05-26 02:22:42.467 UTC","last_editor_display_name":"","last_editor_user_id":"4625829","owner_display_name":"","owner_user_id":"4405420","post_type_id":"1","score":"13","tags":"ios|xcode|firebase|firebaseui","view_count":"1756"} +{"id":"21588932","title":"Using Backbone.iobind (socket.io) with a cluster of node.js servers","body":"\u003cp\u003eI'm using \u003ca href=\"https://github.com/logicalparadox/backbone.iobind\" rel=\"nofollow\"\u003eBackbone.iobind\u003c/a\u003e to bind my client \u003ca href=\"http://backbonejs.org/#Model\" rel=\"nofollow\"\u003eBackbone models\u003c/a\u003e over \u003ca href=\"http://socket.io/\" rel=\"nofollow\"\u003esocket.io\u003c/a\u003e to the back-end server which in turn store it all to MongoDB.\nI'm using socket.io so I can synchronize changes back to other clients Backbone models.\u003c/p\u003e\n\n\u003cp\u003eThe problems starts when I try to run the same thing over a cluster of node.js servers.\nSetting a session store was easy using \u003ca href=\"https://github.com/kcbanner/connect-mongo\" rel=\"nofollow\"\u003econnect-mongo\u003c/a\u003e which stores the session to \u003ca href=\"http://www.mongodb.org/\" rel=\"nofollow\"\u003eMongoDB\u003c/a\u003e.\nBut now I can't inform all the clients on every change, since the clients are distributed between the different node.js servers.\u003c/p\u003e\n\n\u003cp\u003eThe only solution I found is to set a pub/sub queue between the different node.js servers (e.g. \u003ca href=\"https://github.com/scttnlsn/mubsub\" rel=\"nofollow\"\u003emubsub\u003c/a\u003e), which seems like a very heavy weight solution that will trigger an event on all the servers for every change.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-02-05 21:29:55.777 UTC","last_activity_date":"2015-02-12 11:27:39.123 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"593425","post_type_id":"1","score":"1","tags":"node.js|mongodb|backbone.js|socket.io|publish-subscribe","view_count":"183"} +{"id":"35871173","title":"Threading does not work when deploying to another server","body":"\u003cp\u003eI have created a web page where users can upload a file which contains data that are inserted into the Lead table in Microsoft Dynamics CRM 2011. \u003c/p\u003e\n\n\u003cp\u003eThe weird thing now is that when I deploy to our test environment the application runs fine seemingly but absolutely no rows are imported. In my dev environment it works just fine.\u003c/p\u003e\n\n\u003cp\u003eAfter a while when trying to find the error I created a setting that runs the application without using threading (Thread.Run basically) and then it inserts all the Leads. If I switch back to using threads it inserts no leads at all although I get no application errors.\u003c/p\u003e\n\n\u003cp\u003eWhen using SQL Server Profiler I can see in dev (where it works with threading) that all of the insert statements run. When profiling in test environment no insert statements at all are run.\u003c/p\u003e\n\n\u003cp\u003eI sort of get the feeling that there is some server issue or setting that is causing this behaviour but when googling I don't really get any results that have helped me.\u003c/p\u003e\n\n\u003cp\u003eI was sort of hoping that someone recognizes this problem. I haven't got much experience in using threading so maybe this is some road bump that I need to go over.\u003c/p\u003e\n\n\u003cp\u003eI cannot show my code completely but this is basically how I start the threads:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e for (int i = 0; i \u0026lt; _numberOfThreads; i++)\n {\n MultipleRequestObject mpObject = new MultipleRequestObject() { insertType = insertType, listOfEntities = leadsForInsertionOrUpdate[i].ToList\u0026lt;Entity\u0026gt;() };\n Thread thread = new Thread(delegate()\n {\n insertErrors.AddRange(leadBusinessLogic.SaveToCRMMultipleRequest(mpObject)); \n });\n\n thread.Start();\n activeThreads.Add(thread);\n }\n\n // Wait for threads to complete\n foreach (Thread t in activeThreads)\n t.Join();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI initialize my crm connection like this (it reads the connectionstring from web.config -\u003e connectionstrings)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic CrmConnection connection { get; set; }\nprivate IOrganizationService service { get; set; }\npublic CrmContext crmContext { get; set; }\n\npublic CrmGateway()\n{\n connection = new CrmConnection(\"Crm\");\n service = (IOrganizationService)new OrganizationService(connection);\n crmContext = new CrmContext(service);\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"3","creation_date":"2016-03-08 15:17:09.393 UTC","last_activity_date":"2016-03-09 15:19:21.59 UTC","last_edit_date":"2016-03-09 15:19:21.59 UTC","last_editor_display_name":"","last_editor_user_id":"5758174","owner_display_name":"","owner_user_id":"5758174","post_type_id":"1","score":"1","tags":"multithreading|dynamics-crm-2011","view_count":"50"} +{"id":"25429300","title":"Does this submit function need to be in a document ready call? Jquery","body":"\u003cp\u003eI am working on a site which I don't have full access to so I can't do PHP.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e $( \"#contact_form\" ).submit(function() {\n $(\"#contact_form\").find('input[type=\"submit\"]').attr('disabled','disabled');\n });\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"2","creation_date":"2014-08-21 14:42:40.183 UTC","last_activity_date":"2014-08-21 14:48:04.54 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3562836","post_type_id":"1","score":"0","tags":"jquery","view_count":"50"} +{"id":"18446103","title":"Incorrect connections number","body":"\u003cp\u003eI wrote a very simple script just to retrieve list of connected users.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar app, io, server;\n\napp = require(\"express\")();\nserver = require(\"http\").createServer(app);\nio = require(\"socket.io\").listen(server);\n\nserver.listen(1339);\n\napp.get(\"/\", function(req, res) {\n res.sendfile(__dirname + \"/index.html\");\n});\n\nconsole.log('INIT', io.sockets.manager.server.connections);\n\nio.sockets.on(\"connection\", function(socket) {\n console.log('CONNECT: ', io.sockets.manager.server.connections);\n socket.on(\"disconnect\", function(data) {\n console.log('DISCONNECT: ', io.sockets.manager.server.connections);\n });\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd HTML:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;!DOCTYPE html\u0026gt;\n\u0026lt;html\u0026gt;\n\u0026lt;head\u0026gt;\n \u0026lt;meta charset=\"utf-8\"\u0026gt;\n \u0026lt;title\u0026gt;title\u0026lt;/title\u0026gt;\n\u0026lt;/head\u0026gt;\n\u0026lt;body\u0026gt;\n \u0026lt;script src=\"/socket.io/socket.io.js\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;script\u0026gt;\n var socket = io.connect('http://localhost:1339');\n \u0026lt;/script\u0026gt;\n\u0026lt;/body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I run app I get \u003ccode\u003e0\u003c/code\u003e on init, but as soon as I open the page in the browser it gives me \u003ccode\u003e4\u003c/code\u003e connections instead of just \u003ccode\u003e1\u003c/code\u003e. Also I get a \u003ccode\u003econnections property is deprecated. Use getConnections() method\u003c/code\u003e warning. I am using node in v0.10.15 and socket.io in v0.9.16.\u003c/p\u003e","accepted_answer_id":"18448029","answer_count":"1","comment_count":"0","creation_date":"2013-08-26 14:05:48.933 UTC","favorite_count":"0","last_activity_date":"2013-08-27 09:01:40.823 UTC","last_edit_date":"2013-08-27 09:01:40.823 UTC","last_editor_display_name":"","last_editor_user_id":"1017201","owner_display_name":"","owner_user_id":"1017201","post_type_id":"1","score":"3","tags":"node.js|socket.io","view_count":"2492"} +{"id":"37715025","title":"babel es6 wrong exception location with react","body":"\u003cp\u003ei think this is a babel problem (not completely sure). The errors my javascript console throws are always wrong... No matter where the error occurs in my code it points to my handleFailure(serviceName, error) block... for instance... Calling this.foo(); after hand success occurs or even in i move this.foo(); to my getItemById method.. it always throws an error in the same block... What am i doing wrong in my store....\u003c/p\u003e\n\n\u003cp\u003eif i remove the bogus code it works just fine... i would like the error shown to me to reference the bogus code..\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003ethis is the error:\u003c/strong\u003e\n AircraftLocationStore.js:40 Server call aircraftLocationRest failed with error: aircraftLocationRest!handleFailure @ AircraftLocationStore.js:40(anonymous function) @ RestServiceClient.js:20\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass AircraftLocationStore extends EventEmitter {\n constructor() {\n super();\n this._populateRestCallStatus = RestCallStatus.NOT_REQUESTED;\n this._dataStore = Map({});\n this.handleSuccess = this.handleSuccess.bind(this);\n this.handleFailure = this.handleFailure.bind(this);\n }\n populate(){\n RestService.fetchData(this.handleSuccess, this.handleFailure, 'aircraftLocationRest');\n this._populateRestCallStatus = RestCallStatus.STARTED\n }\n\n handleSuccess(serviceName, jsonData){\n UT.logMethod(TAG, `${serviceName} succeeded!`)\n jsonData.forEach((entity) =\u0026gt; {\n let tempEntity = AircraftLocationHelper.createFromJson(entity);\n this._dataStore = this._dataStore.merge(Map.of(tempEntity.id, tempEntity))\n });\n UT.log('isMap', Map.isMap(this._dataStore))\n this.foo();\n this._populateRestCallStatus = RestCallStatus.SUCCESS;\n this.emitChange();\n }\n\n handleFailure(serviceName, error){\n //Utils.logMethod(TAG, 'handleFailure');\n this._populateRestCallStatus = RestCallStatus.FAILED\n console.error(`Server call ${serviceName} failed with error: ${serviceName}!`)\n }\n\n ...\n\nexport default new AircraftLocationStore();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eif i try and change an immutablejs record on my display component in the onChange it tells me this...\u003c/p\u003e\n\n\u003cp\u003ejust in case i will include the code that handles the callback that ALWAYS throws the error\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass RestServiceClient{\n\n /**\n * @param successCB\n * @param failureCB\n * @param endPoint\n */\n fetchData(successCB, failureCB, endPoint) {\n const serverUrl = BASE_URL + endPoint;\n UT.log('serverUrl', serverUrl);\n fetch(serverUrl).then(r =\u0026gt; r.json())\n .then(data =\u0026gt; successCB(endPoint, data))\n .catch(e =\u0026gt; failureCB(endPoint, e.toString()))\n }\n}\nexport default new RestServiceClient();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ehere is my webpack.config\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar path = require('path');\nvar webpack = require('webpack');\n\nmodule.exports = {\n devtool: \"source-map\",\n entry: \"./src/index.js\",\n output: {\n path: __dirname + \"/build\",\n filename: \"bundle.js\"\n },\n\n module: {\n loaders: [{\n test: /\\.js$/,\n loaders: ['react-hot', 'babel'],\n include: path.join(__dirname, 'src'),\n exclude: /node_modules/\n }]\n }\n};\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"3","creation_date":"2016-06-09 00:21:21.07 UTC","last_activity_date":"2016-06-09 14:55:07.75 UTC","last_edit_date":"2016-06-09 13:48:59.837 UTC","last_editor_display_name":"","last_editor_user_id":"981511","owner_display_name":"","owner_user_id":"981511","post_type_id":"1","score":"-1","tags":"ecmascript-6|babeljs","view_count":"36"} +{"id":"28170075","title":"Azure Active Directory: assign user to an application from the gallery via Graph API","body":"\u003cp\u003eI'd need to automate the process of adding an application from the gallery (i.e. Trello), configuring it (i.e. password single sign on) and assign users to it.\u003c/p\u003e\n\n\u003cp\u003eCan this be done via Graph API?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-01-27 12:02:56.343 UTC","last_activity_date":"2016-07-31 17:46:29.24 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"833598","post_type_id":"1","score":"1","tags":"azure-active-directory","view_count":"1168"} +{"id":"45359642","title":"RxJava: create a self-dependent stream","body":"\u003cp\u003eSay, I want to make an \u003ccode\u003eObservable\u003c/code\u003e in RxJava, which has a feedback coupling like on the image below.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/r6sMJ.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/r6sMJ.png\" alt=\"Self-dependent stream\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI've managed to achieve that with the use of subjects, like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e// Observable\u0026lt;Integer\u0026gt; source = Observable.range(0, 6);\n\npublic Observable\u0026lt;Integer\u0026gt; getFeedbackSum(Observable\u0026lt;Integer\u0026gt; source) {\n UnicastSubject\u0026lt;Integer\u0026gt; feedback = UnicastSubject.create();\n Observable\u0026lt;Integer\u0026gt; feedbackSum = Observable.zip(source, feedback.startWith(0), Pair::create)\n .map(pair -\u0026gt; pair.first + pair.second);\n\n feedbackSum.subscribe(feedback);\n return feedbackSum;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt looks rather ugly. Is there a better way?\u003c/p\u003e","accepted_answer_id":"45379757","answer_count":"1","comment_count":"2","creation_date":"2017-07-27 19:39:55.923 UTC","last_activity_date":"2017-07-28 18:03:32.257 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1353292","post_type_id":"1","score":"1","tags":"rx-java|rx-java2","view_count":"55"} +{"id":"3940723","title":"How to control the msn messager's \"personal message\" displayed to others by python?","body":"\u003cp\u003eHow to control the msn messager's \"personal message\" displayed to others by python?\nWant to share some private infomation remotely with this area.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2010-10-15 08:44:22.82 UTC","last_activity_date":"2010-10-16 17:18:44.163 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"476668","post_type_id":"1","score":"0","tags":"python|msn","view_count":"152"} +{"id":"47095834","title":"How to access Google Cloud Storage bucket using aws-cli","body":"\u003cp\u003eI have an access with both aws and Google Cloud Platform.\u003c/p\u003e\n\n\u003cp\u003eIs this possible to do the following,\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eList Google Cloud Storage bucket using aws-cli\u003c/li\u003e\n\u003cli\u003ePUT a CSV file to Google Cloud Storage bucket using aws-cli\u003c/li\u003e\n\u003cli\u003eGET an object(s) from Google Cloud Storage bucket using aws-cli\u003c/li\u003e\n\u003c/ol\u003e","answer_count":"1","comment_count":"1","creation_date":"2017-11-03 12:28:18.74 UTC","favorite_count":"1","last_activity_date":"2017-11-06 04:03:00.813 UTC","last_edit_date":"2017-11-06 04:03:00.813 UTC","last_editor_display_name":"","last_editor_user_id":"2356880","owner_display_name":"","owner_user_id":"2356880","post_type_id":"1","score":"3","tags":"amazon-web-services|amazon-s3|google-cloud-platform|google-cloud-storage|aws-cli","view_count":"103"} +{"id":"21651876","title":"How to create sample of Mongoose Model all null values?","body":"\u003cp\u003eImage you have this schema:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar userSchema = new Schema({\n name: String,\n schools: [{\n level: String,\n name: String,\n timeInterval: { \n start: {type:Date,default:Date.now}, \n end: {type:Date,default:Date.now}\n },\n location: String\n }]\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs there a way to do something to get a poorly populated object. Kinda like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar sample = userSchema.getDefaultObject();\nconsole.log(JSON.stringify(sample,null,2));\n\nOUTPUT:\n{\n name: null,\n schools: [\n {\n level: null,\n name: null,\n timeInterval: {\n start: TIMENOW,\n end: TIMENOW\n },\n location: null\n }\n ]\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-02-08 21:11:02.96 UTC","last_activity_date":"2014-02-08 22:46:56.317 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1185578","post_type_id":"1","score":"0","tags":"javascript|node.js|mongodb|mongoose|odm","view_count":"39"} +{"id":"20517897","title":"Fiddler adds space after colon","body":"\u003cp\u003eI am making a request like so in Fiddler2\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eUser-Agent: Fiddler\nHost: asdf.example.com\nContent-Type: application/x-www-form-urlencoded \nContent-Length: 0\nKey=asdf:qwer\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I click \u003ckbd\u003eExecute\u003c/kbd\u003e, Fiddler edits the last line to read:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eKey=asdf: qwer\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNote the additional space.\u003c/p\u003e\n\n\u003cp\u003eWhy is this happening and could it cause problems with my request?\u003c/p\u003e","accepted_answer_id":"20518024","answer_count":"1","comment_count":"0","creation_date":"2013-12-11 11:28:27.75 UTC","last_activity_date":"2013-12-11 19:57:03.57 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1185053","post_type_id":"1","score":"1","tags":"http|fiddler","view_count":"1229"} +{"id":"38661647","title":"Websockets on a VPS with Tomcat","body":"\u003cp\u003eI deployed a Java webapp that uses websockets via the Spring framework on a Ubuntu VPS on a Tomcat7.\u003c/p\u003e\n\n\u003cp\u003eEverything is working besides websockets - during the initial handshake, I get : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e WebSocket connection to\n 'ws://x.x.x.x:8080/stomp/738/d4se5uwf/websocket' failed: Error\n during WebSocket handshake: Unexpected response code: 404\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAs you can see, I temporarily opened the 8080 port to eliminate the fact that my Tomcat7 is fronted by an Apache2 and I'm directly querying my home page with \u003ca href=\"http://x.x.x.x:8080\" rel=\"nofollow\"\u003ehttp://x.x.x.x:8080\u003c/a\u003e, where a script initiates the websocket connection.\u003c/p\u003e\n\n\u003cp\u003eHowever Tomcat still refuses to act as a websocket server for the connection upgrade.\u003c/p\u003e\n\n\u003cp\u003eLocally everything works fine with \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ews://localhost:8080/stomp/.....\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat could cause this difference ? \u003c/p\u003e\n\n\u003cp\u003eSome additional info : \u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003ewhen manually typed in the browser address bar, ws://localhost:8080/stomp/ and ws://x.x.x.x:8080/stomp both give 404\u003c/li\u003e\n\u003cli\u003ewhen manually typed in the browser address bar, \u003ca href=\"http://localhost:8080/stomp/\" rel=\"nofollow\"\u003ehttp://localhost:8080/stomp/\u003c/a\u003e and \u003ca href=\"http://x.x.x.x:8080/stomp\" rel=\"nofollow\"\u003ehttp://x.x.x.x:8080/stomp\u003c/a\u003e both print a \"welcome to SockJS !\" page\u003c/li\u003e\n\u003c/ul\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-07-29 14:45:12.46 UTC","last_activity_date":"2017-10-10 15:20:45.577 UTC","last_edit_date":"2016-07-30 11:04:06.953 UTC","last_editor_display_name":"","last_editor_user_id":"3642148","owner_display_name":"","owner_user_id":"3642148","post_type_id":"1","score":"0","tags":"tomcat|websocket","view_count":"46"} +{"id":"44950873","title":"confusion about git rev-list","body":"\u003cp\u003eI want to know the related commit-id with the 100 submit in branch \u003ccode\u003edev\u003c/code\u003e. (for example: \u003ccode\u003egit rev-list --reverse --branches=dev --date-order --count \u0026lt;commit-id\u0026gt; == 100\u003c/code\u003e):\u003c/p\u003e\n\n\u003cp\u003eAnd got the 100 commit is \u003ccode\u003e1f345e80fba518c72dec7f2e02da5da12be5810f\u003c/code\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$ git rev-list --reverse --branches=dev --date-order HEAD | head -100 | tail -1\n1f345e80fba518c72dec7f2e02da5da12be5810f\n\n$ git rev-list --reverse --branches=dev --date-order HEAD | nl | grep 100\n 100 1f345e80fba518c72dec7f2e02da5da12be5810f\n\n$ git rev-list --reverse --branches=dev --date-order HEAD | awk '{print NR\"\\t\"$0}' | grep -E ^100\n100 1f345e80fba518c72dec7f2e02da5da12be5810f\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, when I try to verify the rev-number about this commit-id (\u003ccode\u003e1f345e80fba518c72dec7f2e02da5da12be5810f\u003c/code\u003e), the result shows: rev number is \u003cstrong\u003e98\u003c/strong\u003e!!!\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$ git rev-list --reverse --branches=dev --date-order --count 1f345e80fba518c72dec7f2e02da5da12be5810f\n98\n\n$ git rev-list --reverse --branches=dev --date-order 1f345e80fba518c72dec7f2e02da5da12be5810f | nl | tail -1\n 98 1f345e80fba518c72dec7f2e02da5da12be5810f\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo I try to find out which 2 commit is missing:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$ git rev-list --reverse --branches=dev --date-order HEAD | head -100 | nl \u0026gt; commit-100.log\n$ git rev-list --reverse --branches=dev --date-order 1f345e80fba518c72dec7f2e02da5da12be5810f | head -100 | nl \u0026gt; commit-98.log\n$ diff -y commit-100.log commit-98.log\n 90 63546ce0207cdd6ade353ea05c466d0210af1d29 | 90 75a8fd85043908049e11595aaa2c988282fa1a0c\n 91 75a8fd85043908049e11595aaa2c988282fa1a0c | 91 c1bbb33cd0241c16dde2579696c08ed2eb146cdf\n 92 c1bbb33cd0241c16dde2579696c08ed2eb146cdf | 92 28e9bbc06cb3036bce4cce71f5acf4b27835e9a0\n 93 28e9bbc06cb3036bce4cce71f5acf4b27835e9a0 | 93 7b1d0caddc6218eb982d27c1df27c885bc84204c\n 94 7b1d0caddc6218eb982d27c1df27c885bc84204c | 94 945fd63a256391e72e55e8ac98c449c1473c1e5e\n 95 945fd63a256391e72e55e8ac98c449c1473c1e5e | 95 0ff3f47eb8dc40815ac7effdb2172e5d69dd0e10\n 96 0ff3f47eb8dc40815ac7effdb2172e5d69dd0e10 | 96 ac90a7b2a371ff7a0fad0475d94691663aceaa1b\n 97 ac90a7b2a371ff7a0fad0475d94691663aceaa1b | 97 1a0e26b517f88870fed0cf5f346495b67c29463a\n 98 937807239dd706f3bf124dd4d3266c71fd8071f4 | 98 1f345e80fba518c72dec7f2e02da5da12be5810f\n 99 1a0e26b517f88870fed0cf5f346495b67c29463a \u0026lt;\n100 1f345e80fba518c72dec7f2e02da5da12be5810f \u0026lt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eApparent, the 2 \u003cem\u003emissing\u003c/em\u003e commit-id is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e90 63546ce0207cdd6ade353ea05c466d0210af1d29\n98 937807239dd706f3bf124dd4d3266c71fd8071f4\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAccording to \u003ccode\u003egit show \u0026lt;commit-id\u0026gt;\u003c/code\u003e, and nothing strange. These two commits was submitted by the same guy. But this person committed 10 times in the first 100 commits.\u003c/p\u003e\n\n\u003cp\u003eDoes it a \u003ccode\u003egit rev-list\u003c/code\u003e issue?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-07-06 13:50:19.793 UTC","last_activity_date":"2017-07-06 15:42:07.723 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2940319","post_type_id":"1","score":"1","tags":"git|git-rev-list","view_count":"46"} +{"id":"13128002","title":"How to set up \"Next 10\" and \"Prev 10\" in Kaminari","body":"\u003cp\u003eI am trying to step through a large set of Clients using Kaminari.\nThus far I just do this in index.html.erb:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;%= paginate @clients, :outer_window =\u0026gt; 3 %\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhich results in:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e1 2 3 4 5 ... 588 589 590 Next Last\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhere \"Next\" just advances to the next one.\u003c/p\u003e\n\n\u003cp\u003eI would like to get something like this (roughly)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e1 2 3 4 5 ... 15 25 35 ...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eso that the user can step through faster than one at a time. I see \"Kaminari themes\" in the documentation, but couldn't work out how to use it. Thanks...\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2012-10-29 19:04:07.617 UTC","last_activity_date":"2012-10-29 19:04:07.617 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1379955","post_type_id":"1","score":"1","tags":"ruby-on-rails-3|ruby-on-rails-3.1|kaminari","view_count":"61"} +{"id":"7864077","title":"Handling multi-dimensional array lengths in C++","body":"\u003cp\u003eI would like to build a function that takes a multidimensional array and prints it like a grid. I'm having trouble with it because c++ doesn't allow a function to have a multidimensional array argument unless you specify its length. There is a question about it on here, that was answered using vectors. I haven't learned how to use vectors yet, so please don't use them in an answer, or at least provide a good tutorial on them if you do.\u003c/p\u003e\n\n\u003cp\u003eAnyway, I was wondering if it's possible to return an array in c++... I started programming with javascript, so the first solution I thought of was to do something like\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eint gen(int len){\n return int arr(int a[][len]){\n cout \u0026lt;\u0026lt; a[0][0];\n };\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI knew it wouldn't work, tried it, and wasn't surprised when it didn't. Is there a way to do something like this though?\u003c/p\u003e","accepted_answer_id":"7864092","answer_count":"2","comment_count":"3","creation_date":"2011-10-23 03:04:17.793 UTC","last_activity_date":"2011-10-23 03:15:30.463 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"828584","post_type_id":"1","score":"1","tags":"c++|arrays|multidimensional-array|return|return-value","view_count":"360"} +{"id":"35352497","title":"Linux installation on docker over windows host machine","body":"\u003cp\u003eI have installed docker on windows 7, and i want to build several components inside that virtual environment.So, after the basic set up of docker i have to install linux on that and add further components. I read some where that linux cannot be installed over windows, is that true ?\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2016-02-12 00:03:04.743 UTC","last_activity_date":"2016-02-12 03:02:46.397 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5901029","post_type_id":"1","score":"1","tags":"docker","view_count":"42"} +{"id":"31075132","title":"Java calender skipping first month","body":"\u003cp\u003eI am currently trying to make a Java program that simply prints out the dates for each day of the year. It work perfectly for every month in the year apart for January. Could anyone suggest what I might be doing wrong? Please find code below.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eString date;\n\n Calendar cal = Calendar.getInstance();\n cal.set(Calendar.MONTH, 0);\n cal.set(Calendar.DAY_OF_MONTH, 0);\n int maxDay = cal.getActualMaximum(Calendar.DAY_OF_MONTH);\n int maxMon = cal.getActualMaximum(Calendar.MONTH);\n SimpleDateFormat df = new SimpleDateFormat(\"dd_MM_yy\");\n for (int j = 0; j \u0026lt; maxMon; j++){\n for (int i = 0; i \u0026lt; maxDay; i++) {\n cal.set(Calendar.DAY_OF_MONTH , i);\n date = df.format(cal.getTime());\n System.out.println(date);\n }\n } \n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"31075421","answer_count":"3","comment_count":"3","creation_date":"2015-06-26 13:57:25.603 UTC","last_activity_date":"2016-10-21 20:50:52.99 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4920665","post_type_id":"1","score":"0","tags":"java|calendar","view_count":"168"} +{"id":"17797262","title":"Adapter notifyDataSetChanged only working when postDelayed","body":"\u003cp\u003eI have a custom base adapter for a ListActivty. I'm trying to update the list after any item is clicked, this is my onListItemClick code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@Override\nprotected void onListItemClick(ListView listView, View view, int position, long id) {\n String pkg = mAdapter.getItem(position).toString();\n boolean isProtected = ApplicationUtils.isPackageProtected(this, pkg) != null;\n PreferenceUtils.setPreference(mContext, null, pkg, !isProtected, false);\n mAdapter.notifyDataSetChanged();\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, notifyDataSetChanged doesn't updates the list views. As a workaround I fou\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@Override\nprotected void onListItemClick(ListView listView, View view, int position, long id) {\n String pkg = mAdapter.getItem(position).toString();\n boolean isProtected = ApplicationUtils.isPackageProtected(this, pkg) != null;\n PreferenceUtils.setPreference(mContext, null, pkg, !isProtected, false);\n Handler adapterHandler = new Handler();\n adapterHandler.postDelayed(new Runnable() {\n @Override\n public void run() {\n mAdapter.notifyDataSetChanged();\n }\n }, 500);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCan someone explain me why does this happens and tell me if is there any other solution?\u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","accepted_answer_id":"17811437","answer_count":"1","comment_count":"0","creation_date":"2013-07-22 20:56:06.62 UTC","last_activity_date":"2013-07-23 13:21:54.933 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"794857","post_type_id":"1","score":"1","tags":"android|listview|notifydatasetchanged","view_count":"554"} +{"id":"45730489","title":"RTSP streaming to video file using FFMPEG library","body":"\u003cp\u003eI want to save video taken with a network camera(IP camera) as a video file like .avi.\u003c/p\u003e\n\n\u003cp\u003eAt first I tried OpenCV but I have a codec problem and try to use FFMPEG.\nThis is the first time to use FFMPEG so I am looking for some sample code.\u003c/p\u003e\n\n\u003cp\u003eThe overall project structure is C# with a C++ DLL, so I want to save(or write or record) the camera stream as a video file in C++.\u003c/p\u003e\n\n\u003cp\u003eCamera stream is received using RTSP, and the RTSP URL is also known.\n\u003cstrong\u003eHow to save RTSP stream as video file using FFMPEG library?\u003c/strong\u003e The codec is H264.\u003c/p\u003e\n\n\u003cp\u003eI would appreciate it if you could show me some sample code.\u003c/p\u003e\n\n\u003cp\u003eMy development environment is 64-bit Windows 10 and Visual Studio 2015.\nI downloaded FFMPEG library version 20170817-92da230, 64-bit architecture and linking both Shared and Dev from here \u003ca href=\"https://ffmpeg.zeranoe.com/builds/\" rel=\"nofollow noreferrer\"\u003ehttps://ffmpeg.zeranoe.com/builds/\u003c/a\u003e\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2017-08-17 08:46:38.527 UTC","favorite_count":"1","last_activity_date":"2017-08-17 08:59:46.977 UTC","last_edit_date":"2017-08-17 08:59:46.977 UTC","last_editor_display_name":"","last_editor_user_id":"8476750","owner_display_name":"","owner_user_id":"8476750","post_type_id":"1","score":"0","tags":"c++|ffmpeg|h.264","view_count":"358"} +{"id":"16649507","title":"Editing an excel 2003 Macro, Deleting to Copying","body":"\u003cp\u003eI am currently using this code to find and delete all rows with a certain criteria... How can I edit it to just move the rows to another worksheet instead of deleting them?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Sub Delete_Rows()\n Dim selectedValue As Integer\n\n myNum = Application.InputBox(\"Input Value\")\n Dim rng As Range, cell As Range, del As Range\n Set rng = Intersect(Range(\"'potlife'!J2:J1500\"), ActiveSheet.UsedRange)\n For Each cell In rng\n If (cell.value) = myNum _\n Then\n If del Is Nothing Then\n Set del = cell\n Else: Set del = Union(del, cell)\n End If\n End If\n Next cell\n On Error Resume Next\n del.EntireRow.Delete\n End Sub\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"16651276","answer_count":"1","comment_count":"0","creation_date":"2013-05-20 12:25:48.013 UTC","last_activity_date":"2015-07-07 21:52:55.07 UTC","last_edit_date":"2015-07-07 21:52:55.07 UTC","last_editor_display_name":"","last_editor_user_id":"4370109","owner_display_name":"","owner_user_id":"2391036","post_type_id":"1","score":"0","tags":"excel|copy|worksheet","view_count":"89"} +{"id":"1942665","title":"xmlHttp string POST Headers issue","body":"\u003cp\u003ei am trying to pass a string through the XmlHttp method. Let me show you the code:\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eHTML\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div id=\"greetings\"\u0026gt;\n You are voting out \u0026lt;b style=\"color: #00b0de;\" id=roadiename\u0026gt;\u0026lt;/b\u0026gt;. Care to explain why?\u0026lt;br/\u0026gt;\u0026lt;br/\u0026gt;\n \u0026lt;textarea name=\"textarea\" id=\"comment\" cols=\"38\" rows=\"7\"\u0026gt;\u0026lt;/textarea\u0026gt;\u0026lt;br\u0026gt;\n \u0026lt;a href=\"#\" id=\"postmsg\" onclick='getMsg(\"#comment.val()\")' \u0026gt;\u0026lt;img src=\"images/submit.gif\" style=\"border: none; float:right; padding-top: 10px;padding-right: 10px;\"/\u0026gt;\u0026lt;/a\u0026gt;\n \u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eJavscript\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction getMsg(msg)\n{\n msgBox = msg;\n}\n\nCore.addEventListener(submit, \"click\", function(){Slide.send();});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003esend function\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esend: function()\n { \n xmlHttp=GetXmlHttpObject();\n if (xmlHttp==null)\n {\n alert (\"Browser does not support HTTP Request\");\n return;\n }\n\n var url=\"user_submit.php\",\n data=\"vote=\"+value+\"\u0026amp;sid=\"+Math.random();\n xmlHttp.setRequestHeader(\"Content-type\",\"application/x-www-form-urlencoded; charset=UTF-8\");\n xmlHttp.setRequestHeader(\"Content-length\", data.length);\n xmlHttp.open(\"POST\",url,true);\n xmlHttp.send( data );\n\n function stateChanged()\n {\n if (xmlhttp.readyState==4)\n {\n document.getElementById(\"greetings\").innerHTML=xmlhttp.responseText;\n }\n }\n\n function GetXmlHttpObject()\n {\n var objXMLHttp=null;\n if (window.XMLHttpRequest)\n {\n objXMLHttp=new XMLHttpRequest();\n }\n else if (window.ActiveXObject)\n {\n objXMLHttp=new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n return objXMLHttp;\n }\n },\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eafter everything is said and done, this is the error Firebug is showing:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003euncaught exception: [Exception... \"Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIXMLHttpRequest.setRequestHeader]\" nsresult: \"0x80004005 (NS_ERROR_FAILURE)\" location: \"JS frame :: http://localhost/roadies/JS/script.js :: anonymous :: line 96\" data: no]\n\nLine 0\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"1942735","answer_count":"2","comment_count":"4","creation_date":"2009-12-21 21:13:42.807 UTC","last_activity_date":"2009-12-21 21:48:43.347 UTC","last_edit_date":"2009-12-21 21:26:37.38 UTC","last_editor_display_name":"","last_editor_user_id":"166339","owner_display_name":"","owner_user_id":"107922","post_type_id":"1","score":"1","tags":"php|javascript|ajax|xmlhttprequest","view_count":"956"} +{"id":"2479721","title":"Java: Looking for hack to deal with Windows file paths in Linux","body":"\u003cp\u003eSay you have a large legacy ColdFusion on top of Java on top of Windows application. File access is done both via java.io.File and by CFFILE (which in turn also uses java.io.File), but not centralised in any way into a single file access library. Further, say you have file paths both hard-coded in the code, and also in a database.\u003c/p\u003e\n\n\u003cp\u003eIn other words, assume the file paths themselves cannot change. They could be either local or remote Windows file paths:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003ec:\\temp\\file.txt\u003c/li\u003e\n\u003cli\u003e\\\\server\\share\\file.txt \u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eIs there a way to run this application on Linux with minimal code changes? I'm looking for creative solutions that \u003cstrong\u003edo not involve touching the legacy code\u003c/strong\u003e.\u003c/p\u003e\n\n\u003cp\u003eSome ideas:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eRun it on WINE. This actually works, because WINE will translate the local paths, and has a samba client for the remote paths.\u003c/li\u003e\n\u003cli\u003eIs there a way to override java.io.File to perform the file path translation with custom code? In this case, I would translate the remote paths to a mount point.\u003c/li\u003e\n\u003c/ul\u003e","accepted_answer_id":"2480477","answer_count":"2","comment_count":"0","creation_date":"2010-03-19 18:33:57.59 UTC","last_activity_date":"2010-03-24 19:19:25.013 UTC","last_edit_date":"2010-03-24 19:19:25.013 UTC","last_editor_display_name":"","last_editor_user_id":"7679","owner_display_name":"","owner_user_id":"7679","post_type_id":"1","score":"5","tags":"java|coldfusion","view_count":"1395"} +{"id":"40835483","title":"Change root view controller and dismiss all view controllers","body":"\u003cp\u003eI have an application in which if I already have a user's \u003ccode\u003efacebookUID\u003c/code\u003e saved, I present them with the \u003ccode\u003eMainViewController\u003c/code\u003e and set it as the \u003ccode\u003erootViewController\u003c/code\u003e, and if not, I present them with the \u003ccode\u003eLoginViewController\u003c/code\u003e as the \u003ccode\u003erootViewController\u003c/code\u003e in my \u003ccode\u003eAppDelegate.swift\u003c/code\u003e file. \u003c/p\u003e\n\n\u003cp\u003eInside the \u003ccode\u003eMainViewController\u003c/code\u003e, there is a \u003ccode\u003eSettingsViewController\u003c/code\u003e screen that I present modally. Inside that settings screen I have a logout button. \u003c/p\u003e\n\n\u003cp\u003eMy question is, how can set the \u003ccode\u003erootViewController\u003c/code\u003e as the \u003ccode\u003eLoginViewController\u003c/code\u003e, and dismiss all the other controllers in the stack when they click the logout button?\u003c/p\u003e","accepted_answer_id":"40835703","answer_count":"2","comment_count":"0","creation_date":"2016-11-28 00:17:36.853 UTC","favorite_count":"1","last_activity_date":"2017-09-14 15:06:00.397 UTC","last_edit_date":"2017-09-14 15:06:00.397 UTC","last_editor_display_name":"","last_editor_user_id":"2227743","owner_display_name":"","owner_user_id":"939636","post_type_id":"1","score":"0","tags":"ios|swift|appdelegate","view_count":"1489"} +{"id":"41401121","title":"step by step procedure to connect to the thingspeak","body":"\u003cp\u003eI am new to Arduino and I am using Arduino Uno r3. I have to upload the temperature sensor data to ThingSpeak. For that I am using DHT11. For connectivity of WiFi I am using ESP8266. Could you please me how to upload the sensor value to ThingSpeak?\u003c/p\u003e","accepted_answer_id":"41442976","answer_count":"2","comment_count":"1","creation_date":"2016-12-30 18:42:47.75 UTC","last_activity_date":"2017-02-25 00:48:18.837 UTC","last_edit_date":"2016-12-31 05:20:10.677 UTC","last_editor_display_name":"","last_editor_user_id":"794749","owner_display_name":"","owner_user_id":"7215148","post_type_id":"1","score":"-1","tags":"arduino|arduino-uno|esp8266","view_count":"168"} +{"id":"23553061","title":"How to call a route by its name from inside a handler?","body":"\u003cp\u003eHow do I properly refer to route names from inside handlers?\u003cbr\u003e\nShould \u003ccode\u003emux.NewRouter()\u003c/code\u003e be assigned globally instead of standing inside a function?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunc AnotherHandler(writer http.ResponseWriter, req *http.Request) {\n url, _ := r.Get(\"home\") // I suppose this 'r' should refer to the router\n http.Redirect(writer, req, url, 302)\n}\n\nfunc main() {\n r := mux.NewRouter()\n r.HandleFunc(\"/\", HomeHandler).Name(\"home\")\n r.HandleFunc(\"/nothome/\", AnotherHandler).Name(\"another\")\n http.Handle(\"/\", r)\n http.ListenAndServe(\":8000\", nil)\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"23554021","answer_count":"1","comment_count":"0","creation_date":"2014-05-08 21:41:03.08 UTC","favorite_count":"1","last_activity_date":"2014-05-08 23:00:14.37 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1606248","post_type_id":"1","score":"2","tags":"go|mux|gorilla","view_count":"1434"} +{"id":"24844786","title":"How to use post from HttpPost in 4.4.2?","body":"\u003cp\u003eI'm working for hours on this problem but got totally stucked. The following code is running perfectly on my test device with Android 4.1.2, but I can't get it to work with the second device\nrunning 4.4.2. I read moving from \u003ccode\u003eApache httpClient\u003c/code\u003e to \u003ccode\u003eHttpURLConnection\u003c/code\u003e solves the problem for some people, but I am also using the \u003ccode\u003eGET\u003c/code\u003e-method wich works fine. I already tried to add headers, as mentioned on sites I found. That did not work. So can you please help me in getting this working on Android 4.4.2 or give me a hint to the right direction? Thanks.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e List\u0026lt;NameValuePair\u0026gt; params = new ArrayList\u0026lt;NameValuePair\u0026gt;();\n.\n.\n.\n DefaultHttpClient httpClient = new DefaultHttpClient();\n HttpPost httpPost = new HttpPost(url); \n httpPost.setEntity(new UrlEncodedFormEntity(params));\n HttpResponse httpResponse = httpClient.execute(httpPost);\n HttpEntity httpEntity = httpResponse.getEntity();\n is = httpEntity.getContent();\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"5","creation_date":"2014-07-19 20:40:39.657 UTC","last_activity_date":"2014-08-19 04:21:09.687 UTC","last_edit_date":"2014-07-19 20:52:39.177 UTC","last_editor_display_name":"","last_editor_user_id":"1567835","owner_display_name":"","owner_user_id":"3856650","post_type_id":"1","score":"0","tags":"json|apache|httpurlconnection|android-4.4-kitkat","view_count":"494"} +{"id":"9298909","title":"Exception thrown while logging in to project in windows 7 but fine with XP","body":"\u003cp\u003eI'm a final year student learning and trying to build a Java project and I've got a project in Java and MSAccess (jdbc). Th project is basically done but only executing fine under windows XP \u0026amp; jdk1.5. But I use windows7 64bit OS and installed jdk1.7. But I'm not able to login to the project. I've done those odbc - system dsn creation procedure both by *.mdb in Access02-03 \u0026amp; in \u003cem\u003e.mdb,\u003c/em\u003e.accdb. but having the same Exception \"unable to connect to the database\". The login gui is taking the value of UserName and password, but as I press the login button it's throwing the exception. It is created in netbeans, though I have the latest version of netbeans installed in my system.It is throwing the same Exception from the commandline as well from netbeans. I have checked all those codings, dsn name, tablenames, ield names, but we all know that Java is a completely platform independent language. So I think there won't be any issues with the version of OS or JDK installed on the system.\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2012-02-15 18:14:32.923 UTC","last_activity_date":"2012-02-16 10:52:02.097 UTC","last_edit_date":"2012-02-16 10:52:02.097 UTC","last_editor_display_name":"","last_editor_user_id":"21234","owner_display_name":"","owner_user_id":"1211998","post_type_id":"1","score":"0","tags":"java|windows|ms-access","view_count":"35"} +{"id":"29514583","title":"FInd a document several times","body":"\u003cp\u003eI have a list of events in a city, and I display for the city all incoming events, sorted by the start date of the event.\u003c/p\u003e\n\n\u003cp\u003eToday I need to add a new feature : some events can be repeated over time, for exemple a flea all wednesday and friday during 2 month. In this case, I'll need to display this event X times.\u003c/p\u003e\n\n\u003cp\u003eE.g. what should be displayed on the timeline :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eThe flea - today 2015-04-08 - id = 42\nJustin Bieber concert - today 2015-04-08 - id = 43\nAn other concert - thursday 2015-04-09 - id = 44\nThe flea - friday 2015-04-10 - id = 42\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe problem I have is that today, each document in Elasticsearch has the same \u003ccode\u003e_id\u003c/code\u003e than the one in MySQL.\u003c/p\u003e\n\n\u003cp\u003eI know i could stop using \u003ccode\u003e_id\u003c/code\u003e and add a \u003ccode\u003eidEvent\u003c/code\u003e field in the mapping, but this whould change a lot of things in the programm. Is there an elegant way to handle this problem ?\u003c/p\u003e\n\n\u003cp\u003eEdit :\nHere is a sample of my mapping :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\"event\": {\n \"properties\": {\n \"title\": {\n \"type\": \"string\"\n },\n \"dateStart\": {\n \"type\": \"date\",\n \"format\": \"yyyy-MM-dd\"\n },\n \"dateEnd\": {\n \"type\": \"date\",\n \"format\": \"yyyy-MM-dd\"\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd I wonder if with something like that I would be able to display several times the event in results, according to its \u003ccode\u003edateStart\u003c/code\u003e :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\"event\": {\n \"properties\": {\n \"title\": {\n \"type\": \"string\"\n },\n \"dates\": {\n \"type\": \"nested\",\n \"properties\": {\n \"dateStart\": {\n \"type\": \"date\",\n \"format\": \"yyyy-MM-dd\"\n },\n \"dateEnd\": {\n \"type\": \"date\",\n \"format\": \"yyyy-MM-dd\"\n }\n }\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eRegards,\u003c/p\u003e","answer_count":"0","comment_count":"5","creation_date":"2015-04-08 12:26:36.48 UTC","last_activity_date":"2015-04-08 13:04:57.743 UTC","last_edit_date":"2015-04-08 13:04:57.743 UTC","last_editor_display_name":"","last_editor_user_id":"1219184","owner_display_name":"","owner_user_id":"1219184","post_type_id":"1","score":"0","tags":"elasticsearch","view_count":"58"} +{"id":"20516073","title":"Sprintf of MAC address of available networks","body":"\u003cp\u003eI want to sprintf Mac address of some found networks in this area like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e `WiFi connection settings:\n MAC: 00 1E C0 10 3B 19\n SSID: css`\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003emy code is :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003echar buf[32];\nBYTE MAC[64];\nint i;\n\nfor(i=1;i\u0026lt;15;i++)\n{ \n MyScanResults = WFScanList(i);\n sprintf(buf,\"%s\", MyScanResults.ssid);\n sprintf(\u0026amp;MAC[i*2],\"%02x\", MyScanResults.bssid[i]);\n _dbgwrite(\"SSID: \");\n _dbgwrite(buf);\n _dbgwrite(\"\\n\");\n _dbgwrite(\"MAC: \");\n _dbgwrite(MAC);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand Errors are :\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eC:\\Users\\h\\Desktop\\WiFi test\\taskFlyport.c:22: warning: pointer targets in passing argument 1 of 'sprintf' differ in signedness \u0026lt;\u003c/p\u003e\n \n \u003cp\u003eC:\\Users\\h\\Desktop\\WiFi test\\taskFlyport.c:27: warning: pointer targets in passing argument 1 of '_dbgwrite' differ in signedness\u0026lt;\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eis there anyone to tell me where is my problem?\nthanks,regards\u003c/p\u003e","accepted_answer_id":"20516170","answer_count":"2","comment_count":"0","creation_date":"2013-12-11 10:02:51.133 UTC","last_activity_date":"2013-12-12 11:13:14.083 UTC","last_edit_date":"2013-12-11 10:19:09.09 UTC","last_editor_display_name":"","last_editor_user_id":"1859443","owner_display_name":"","owner_user_id":"2426420","post_type_id":"1","score":"1","tags":"c|printf|mac-address","view_count":"1586"} +{"id":"43958478","title":"Images not rendering in Phabricator","body":"\u003cp\u003eI have phabricator installed on an EC2 instance. I have configured the application to point our CloudFront domain name. I also set up the s3 region, bucket-name and endpoint. However, I am unable to see the images after uploading through phabricator. In the inspect console, I am seeing a 403 Forbidden error to the path of the file in cloudfront. I am unable to verify if the file was uploaded into my s3 due to the path not being the s3 path.\u003c/p\u003e\n\n\u003cp\u003ePlease advise.\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-05-13 22:14:57.337 UTC","last_activity_date":"2017-05-13 22:14:57.337 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4400697","post_type_id":"1","score":"0","tags":"amazon-s3|amazon-cloudfront|phabricator","view_count":"19"} +{"id":"35695775","title":"Dropzone, how to not process queue if errors exist","body":"\u003cp\u003eSo I have a form with Dropzone, plus another textarea, which I want to submit - if I insert an oversize file or too many I get the \"oversize\" error in the preview container, etc. BUT the form continues to process upon button clicking the form submit (due to my listener). How can I only submit if there file size is correct for both files and doesn't exceed max file limit? I can't see a Dropzone event for say \"no errors\" to add a click event listener - I think I'm close but semi stuck now, I have the below:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(function() {\n\nvar minImageWidth = 300, minImageHeight = 300;\n\nDropzone.options.jobApplicationUpload = {\n autoProcessQueue: false,\n addRemoveLinks: true,\n uploadMultiple: true,\n paramName: 'file',\n previewsContainer: '.dropzone-previews',\n acceptedFiles: '.pdf, .doc, .docx',\n maxFiles: 2,\n maxFilesize: 2, // MB \n dictDefaultMessage: '',\n clickable: '.fileinput-button',\n\n accept: function(file, done) { \n\n done();\n },\n\n // The setting up of the dropzone \n init: function() {\n var myDropzone = this; \n\n // First change the button to actually tell Dropzone to process the queue.\n this.element.querySelector(\"button[type=submit]\").addEventListener(\"click\", function(e) {\n\n // Make sure that the form isn't actually being sent.\n if(myDropzone.files.length \u0026gt; 0) {\n\n $('#job-application-container').hide();\n $('#spinner-modal').modal('show');\n $('#spinner-modal p').html('\u0026lt;b\u0026gt;Sending your application,\u0026lt;/b\u0026gt; please wait...\u0026lt;/p\u0026gt;'); \n\n e.preventDefault();\n e.stopPropagation();\n myDropzone.processQueue(); \n }\n\n });\n\n this.on(\"success\", function(files, response) {\n\n\n // Gets triggered when the files have successfully been sent.\n // Redirect user or notify of success.\n\n $('#job-application-container').hide();\n console.log('okay' + response);\n localStorage['success'] = 'test';\n location.reload();\n\n }); \n\n\n\n }\n\n};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e});\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-02-29 09:21:01.413 UTC","favorite_count":"1","last_activity_date":"2016-03-26 21:46:21.9 UTC","last_edit_date":"2016-02-29 11:39:05.273 UTC","last_editor_display_name":"","last_editor_user_id":"3820348","owner_display_name":"","owner_user_id":"3820348","post_type_id":"1","score":"2","tags":"javascript|jquery|dropzone.js","view_count":"673"} +{"id":"41776931","title":"MySQL SELECT is not returning values in correct way and google line graph is not showing in desired way","body":"\u003cp\u003eI am quite new here and asking question for first time, So I don't know how to ask question, But I need help of your's.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/8fMtj.png\" rel=\"nofollow noreferrer\"\u003eImage of google line graph\u003c/a\u003e\n\u003ca href=\"https://i.stack.imgur.com/8fMtj.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/8fMtj.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI have 2 problems in the above graph.\u003c/p\u003e\n\n\u003cp\u003e\u003cb\u003e1.\u003c/b\u003e I am getting repeated dates for views from my database and is display in the graph as above marked as \u003cb\u003e1\u003c/b\u003e and \u003cb\u003e2\u003c/b\u003e.\u003c/p\u003e\n\n\u003cp\u003e\u003cb\u003e2.\u003c/b\u003e The dates are not aligned properly with dates and is marked as \u003cb\u003e3\u003c/b\u003e in above image and also months are not shown some times as visible in the image.\u003c/p\u003e\n\n\u003cp\u003e\u003cb\u003eHelp me please. Thank's in Advance\u003c/b\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cb\u003ephp \u0026amp; MySQL Code\u003c/b\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction AdminViews()\n{\n if(!$this-\u0026gt;DBLogin())\n {\n $this-\u0026gt;HandleError(\"Database login failed!\");\n return false;\n }\n $out_query = \"SELECT count(ip_address) AS count, date(visit_date_time) as visit_date_time FROM db_views WHERE user_id = id GROUP BY visit_date_time ORDER BY visit_date_time LIMIT 30 \";\n $result = mysqli_query($this-\u0026gt;connection,$out_query);\n while($row = mysqli_fetch_array($result))\n {\n $resultset[] = $row;\n } \n if(!empty($resultset))\n return $resultset;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cb\u003eGoogle Graph Javascript Code\u003c/b\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;script type=\"text/javascript\"\u0026gt;\n google.load(\"visualization\", \"1\", {packages:[\"corechart\"]});\n google.setOnLoadCallback(drawChart);\n function drawChart() {\n var data = google.visualization.arrayToDataTable([ ['Date', 'Views']\n \u0026lt;?php\n $results = $ClassName-\u0026gt;AdminViews();\n if(!empty($results)){\n foreach($results as $row) {\n $vDate = str_replace(\"-\",\", \",$row['visit_date_time']);\n echo \",[new Date('\".$vDate.\"'),\".$row['count'].\"]\";\n }\n } ?\u0026gt; ]);\n\n var options = {\n pointSize: 5,\n legend: { position: 'top', alignment: 'end' },\n hAxis: { format: 'MMM dd, yyyy', gridlines: {count: -1, color: '#fff'} },\n vAxis: { minValue: 0 }\n };\n var chart = new google.visualization.LineChart(document.getElementById(\"barChart\"));\n chart.draw(data, options);\n } \u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cb\u003eAt Browser Js comes like this\u003c/b\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;script type=\"text/javascript\"\u0026gt;\n google.load(\"visualization\", \"1\", {packages:[\"corechart\"]});\n google.setOnLoadCallback(drawChart);\n function drawChart() {\n var data = google.visualization.arrayToDataTable([ ['Date', 'Views']\n ,[new Date('2017, 01, 01'),6],[new Date('2017, 01, 02'),6],[new Date('2017, 01, 03'),6],[new Date('2017, 01, 04'),6],[new Date('2017, 01, 05'),7],[new Date('2017, 01, 06'),5],[new Date('2017, 01, 07'),5],[new Date('2017, 01, 07'),3],[new Date('2017, 01, 08'),3],[new Date('2017, 01, 08'),4],[new Date('2017, 01, 09'),2],[new Date('2017, 01, 10'),2],[new Date('2017, 01, 10'),6],[new Date('2017, 01, 11'),6],[new Date('2017, 01, 12'),6],[new Date('2017, 01, 13'),6],[new Date('2017, 01, 14'),6],[new Date('2017, 01, 15'),6],[new Date('2017, 01, 16'),6],[new Date('2017, 01, 17'),10],[new Date('2017, 01, 18'),30],[new Date('2017, 01, 19'),3],[new Date('2017, 01, 20'),3] ]);\n\n var options = {\n pointSize: 5,\n legend: { position: 'top', alignment: 'end' },\n hAxis: { format: 'MMM dd, yyyy', gridlines: {count: -1, color: '#fff'} },\n vAxis: { minValue: 0 }\n };\n var chart = new google.visualization.LineChart(document.getElementById(\"barChart\"));\n chart.draw(data, options);\n }\n\u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"41777223","answer_count":"2","comment_count":"12","creation_date":"2017-01-21 07:42:18.387 UTC","last_activity_date":"2017-01-21 18:08:01.317 UTC","last_edit_date":"2017-01-21 09:42:18.573 UTC","last_editor_display_name":"","last_editor_user_id":"3736442","owner_display_name":"","owner_user_id":"7449436","post_type_id":"1","score":"1","tags":"javascript|php|mysql|google-visualization|linechart","view_count":"61"} +{"id":"40339472","title":"Laravel 5.2 ERROR HTTP 302","body":"\u003cp\u003eI'm use laravel 5.2 Now, In server alert \"Apache Web Server HTTP Error 302 - Moved temporarily\"\u003c/p\u003e\n\n\u003cp\u003eI try to use. this code below in Handler but this alert still happen. \nHow I can do with this problem? Thank you for your help.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public function render($request, Exception $e) {\n\n if($this-\u0026gt;isHttpException($e)) {\n switch ($e-\u0026gt;getStatusCode()) { \n // not found \n case 404: return \n redirect()-\u0026gt;guest('/'); break;\n\n // internal error\n case '500':\n return redirect()-\u0026gt;guest('/');\n break;\n\n case 302:\n return redirect()-\u0026gt;guest('/');\n break;\n\n default:\n return $this-\u0026gt;renderHttpException($e);\n break;\n }\n }\n else\n {\n return parent::render($request, $e);\n }\n\n }\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-10-31 09:28:02.613 UTC","last_activity_date":"2016-10-31 12:24:04.997 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5611309","post_type_id":"1","score":"0","tags":"laravel-5.2","view_count":"162"} +{"id":"3898902","title":"iAd works on simulator but not on device","body":"\u003cp\u003eI am updating an app with iAd. The current version has iAd, and everything works great. But the changes have been substantial enough that I want to test the ads again before I submit the update.\u003c/p\u003e\n\n\u003cp\u003eWhen I test iAd on the simulator, I get the test advertisement with no problem. When I try to test it on the device, all I get are calls to didFailToReceiveAdWithError. The descriptions of the error are either:\u003c/p\u003e\n\n\u003cp\u003e\"The operation couldn't be completed. Ad inventory unavailable.\"\u003c/p\u003e\n\n\u003cp\u003eor:\u003c/p\u003e\n\n\u003cp\u003e\"The operation couldn't be completed. Unknown error.\"\u003c/p\u003e\n\n\u003cp\u003eIn light of this, how can I make sure the ads will work in the updated app?\u003c/p\u003e","answer_count":"2","comment_count":"3","creation_date":"2010-10-10 03:33:58.097 UTC","last_activity_date":"2011-01-05 14:43:38.64 UTC","last_edit_date":"2010-10-10 03:40:01.25 UTC","last_editor_display_name":"","last_editor_user_id":"246568","owner_display_name":"","owner_user_id":"246568","post_type_id":"1","score":"3","tags":"iphone|iad","view_count":"1454"} +{"id":"33138879","title":"Manipulating the cloning function","body":"\u003cp\u003eThis lines of code displayes textbox and subject name for the category selected by user:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efor (i = 0; i \u0026lt; globalStore.data.length; i++) {\n //alert(globalStore.data[i].catname); \n $(\"#sub\").append(\"\u0026lt;div class='sub row clone_this' id='\"+globalStore.data[i].subid+\"' \u0026gt;\u0026lt;div class='small-5 medium-3 large-3 columns'\u0026gt;\u0026lt;input type='text' onfocusout='getText(\"+globalStore.data[i].subid+\")' class='text_\"+globalStore.data[i].subid+\"' placeholder='RM'\u0026gt;\u0026lt;/div\u0026gt;\u0026lt;div class='small-7 medium-9 large-9 columns'\u0026gt;\"+globalStore.data[i].subname+\"\u0026lt;/div\u0026gt;\u0026lt;/div\u0026gt;\");\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to allow user to specify price for each subject of their choice. Then 'onfocusout' that particular row should move to the top. I achived this by using the clone() function. \nHowever I want some modification done after clone to the cloned element as well as the original element that was cloned from.\u003c/p\u003e\n\n\u003cp\u003eCloned item: The textbox must be replaced with tag. Meaning, instead of a textbox showing the value keyed in by user, it outght to show a link of the value keyed in instead followed by a delete/remove icon beside each subject name.\u003c/p\u003e\n\n\u003cp\u003eAnd to the original element that was cloned from, should hide itself/remove.WHne the remove/delete link clicked in the above moved cloned item, then this would appear back.\u003c/p\u003e\n\n\u003cp\u003ecurrent problems are: \u003c/p\u003e\n\n\u003cp\u003e1) when clicked on remove link, it removes the item and refreshes the page.How to prevent it from reloading?\u003c/p\u003e\n\n\u003cp\u003e2) Top few rows of subjects are not cloning. Not sure why\u003c/p\u003e\n\n\u003cp\u003eClone function\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction getText(param)\n{\n $(\"div.clone_this#\"+param).clone(true, true).append(\"\u0026lt;a href='' onclick=removeThis('\"+param+\"')\u0026gt;remove\u0026lt;/a\u0026gt;\").insertBefore(\"#sub\");\n}\nfunction removeThis(param)\n{\n $(\"div.clone_this#\"+param).remove();\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"2","creation_date":"2015-10-15 02:37:27.587 UTC","last_activity_date":"2015-10-15 02:58:55.557 UTC","last_edit_date":"2015-10-15 02:58:55.557 UTC","last_editor_display_name":"user557846","owner_display_name":"","owner_user_id":"5425883","post_type_id":"1","score":"0","tags":"jquery","view_count":"21"} +{"id":"45345158","title":"JSF 1.2: Too many small session beans: Is it bad and what the alternatives","body":"\u003cp\u003eThere's a JSF 1.2 application with no way to switch to another version/technology in the observable future. It's often needed to show a small (modal) form that needs some state kept across several requests. After the work is done (confirmed or canceled) this state is not needed until the form opens again. There are a lot of such forms and session objects (separate per-form session beans or members of special huge session beans) are used for keeping their state. The sessions may last long enough, probably the whole working day. So a lot of objects unnecessarily load the session scope. \u003c/p\u003e\n\n\u003cp\u003eIs there a simple, standard way of cleaning a session object when it's no longer needed? What are your solutions regarding to that?\u003c/p\u003e","accepted_answer_id":"45349556","answer_count":"2","comment_count":"1","creation_date":"2017-07-27 08:22:09.133 UTC","last_activity_date":"2017-07-27 13:38:53.037 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3868454","post_type_id":"1","score":"0","tags":"performance|session|jsf|javabeans","view_count":"40"} +{"id":"19110237","title":"Export/Import data in MySQL using MySQL Workbench","body":"\u003cp\u003eI am trying to take the back-up of database using MySql workbench and restore it into an identical db on other server.I can see the following ways of doing it -\u003c/p\u003e\n\n\u003cp\u003e1.Export entire schema and import it in the identical destination database\u003c/p\u003e\n\n\u003cp\u003eIn this case while restoring it to the identical destination db...will it overwrite the existing tables data or will it be doing a truncate and insert in them?\nAlso, I observed that if the data export/import is interrupted by any chance it gets corrupted and few of the tables are restored.In this case it becomes difficult to identify which table(S) are restored exactly.\u003c/p\u003e\n\n\u003cp\u003e2.Table by table export and import\u003c/p\u003e\n\n\u003cp\u003eWhich option is best suitable option out of the above two?Do we have any other option of doing it?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-10-01 07:18:25.653 UTC","last_activity_date":"2015-09-23 11:35:43.91 UTC","last_edit_date":"2015-09-23 11:35:43.91 UTC","last_editor_display_name":"","last_editor_user_id":"784540","owner_display_name":"","owner_user_id":"2772065","post_type_id":"1","score":"0","tags":"mysql|import|export","view_count":"416"} +{"id":"8804769","title":"Checking wether a MySQL table exists in a Java program using SQLException","body":"\u003cp\u003eI have a Java Web Application where my clients connect to the Web Service to update a MySQL database (using JDBC) with their data. What i want to do is to check wether the requested table exists without using MetaData every time a client connects and uses an operation of the Web Service. I thought of just executing \u003ccode\u003eINSERT\u003c/code\u003e every time and the first client that connects to the web service will cause an \u003ccode\u003eSQLException\u003c/code\u003e that i will catch, look at its \u003ccode\u003eErrorCode\u003c/code\u003e to decide wether it is caused by nonexistant table and if that's the case it will (inside the catch clause) create the table, insert the data that couldn't be inserted earlier because of the Exception and then create a thread to handle that particular client (e.g. check that it will refresh its entry in the database every x seconds). Will this implementation do the job? Is the thread going to run properly and everything, even though it will be started inside the catch clause of an Exception?\u003c/p\u003e","accepted_answer_id":"8805097","answer_count":"2","comment_count":"0","creation_date":"2012-01-10 14:23:40.28 UTC","last_activity_date":"2012-01-10 15:14:25.973 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1067819","post_type_id":"1","score":"0","tags":"java|mysql|web-services|jdbc|sqlexception","view_count":"495"} +{"id":"1657646","title":"How can I check the validity of a code file?","body":"\u003cp\u003eI'm trying to check the validity of a particular 'stand-alone' code file from within my C#.Net app. Is there any way that I can check the file and get a visual studio's style errors list out?\u003c/p\u003e\n\n\u003cp\u003eI'm only interested in running a basic check to ensure that the basics would validate. I.e. all variables are declared and method names are valid.\u003c/p\u003e\n\n\u003cp\u003eIs this at all possible?\u003c/p\u003e","accepted_answer_id":"1657851","answer_count":"3","comment_count":"3","creation_date":"2009-11-01 16:50:27.877 UTC","favorite_count":"1","last_activity_date":"2009-11-01 18:08:46.893 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"44269","post_type_id":"1","score":"1","tags":"c#|.net|compilation","view_count":"81"} +{"id":"41478800","title":"*ngIf is not working when used inside a template tag","body":"\u003cp\u003eWe are using *ngIf inside the template tag of Angular 2, after that if we fire a click event from inside the template control then the HTML inside the template gets deleted or changes.\u003c/p\u003e\n\n\u003cp\u003eThis is the repeater control I am using,\u003c/p\u003e\n\n\u003cpre class=\"lang-ts prettyprint-override\"\u003e\u003ccode\u003e@Component({\nselector: \"repeater\",\ntemplate:\n\n`\n \u0026lt;div *ngIf='children'\u0026gt;\n \u0026lt;div *ngFor='let current of source'\u0026gt;\n \u0026lt;template [ngTemplateOutlet]=\"children._results[0]\" OutletContext]=\"{ item: current }\"\u0026gt;\n \u0026lt;/template\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;`\n})\n\nexport class Repeater {\n @ContentChildren(TemplateRef)\n children: QueryList\u0026lt;TemplateRef\u0026lt;any\u0026gt;\u0026gt;\n\n @Input()\n source: Array\u0026lt;any\u0026gt;;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is my app-component code\u003c/p\u003e\n\n\u003cpre class=\"lang-ts prettyprint-override\"\u003e\u003ccode\u003e@Component({\n selector: 'my-app',\n template: `\u0026lt;repeater [source]=\"dllApprovalStatus\"\u0026gt;\n \u0026lt;template let-data=\"item\"\u0026gt;\n {{data.name}}\n \u0026lt;p *ngIf='data.name==1' (click)='myclick(data.name)'\u0026gt; Array value {{data.name}}\u0026lt;/p\u0026gt;\n \u0026lt;/template\u0026gt;\n \u0026lt;repeater\u0026gt;`,\n})\nexport class App {\n name:string;\n dllApprovalStatus: any = [{ name: 1 }, { name: 1 }, { name: 0 }];\n constructor() {\n this.name = 'Angular2'\n }\n\n myclick(data: any) {\n\n alert(data);\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere I have also made a plunker repo \u003ca href=\"http://plnkr.co/edit/XHZz52?p=preview\" rel=\"nofollow noreferrer\"\u003ehttp://plnkr.co/edit/XHZz52?p=preview\u003c/a\u003e.\u003c/p\u003e\n\n\u003cp\u003eHere if you click on the array list of the output, the template will change.\nThis was working fine in Angular 2 rc4 but we have upgraded to Angular2 ~2.2\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2017-01-05 06:47:27.967 UTC","favorite_count":"2","last_activity_date":"2017-01-05 07:24:01.177 UTC","last_edit_date":"2017-01-05 07:24:01.177 UTC","last_editor_display_name":"","last_editor_user_id":"217408","owner_display_name":"","owner_user_id":"6128276","post_type_id":"1","score":"4","tags":"angular|angular2-template","view_count":"493"} +{"id":"10632853","title":"Adding class to show div has no effect on Android when event is jQuery keyup","body":"\u003cp\u003eThe following code is supposed to make a div visible as soon as a single character is entered into an input field. As soon as there are no characters entered the input should be hidden again. \u003c/p\u003e\n\n\u003cp\u003eThis works fine for every desktop browser ive tested on and also on iPhone. However on Android nothing happens. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e $(\"#filter\").keyup(function () {\n\n if ( !$('input#filter').val().length == 0 ){\n $('#filter-close').removeClass('hidden');\n //alert('remove hidden');\n } else {\n $('#filter-close').addClass('hidden');\n //alert('add hidden');\n } \n\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eInitially I assumed it was an issue with the event not firing. To test this I added alerts (commented out in the code above) and it turns out the event is firing fine. \u003c/p\u003e\n\n\u003cp\u003eIs there some bug with Android where classes added or removed while an input has focus are not applied, or are applied but the appropriate CSS isn't applied to the elements? Thanks \u003c/p\u003e","answer_count":"0","comment_count":"4","creation_date":"2012-05-17 09:17:43.923 UTC","last_activity_date":"2012-05-17 09:17:43.923 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"467875","post_type_id":"1","score":"0","tags":"jquery|android","view_count":"53"} +{"id":"25430329","title":"Passing config file to MSI as argument and need to use it by Custom action with Silent Installation","body":"\u003cp\u003eI have created Basic MSI Project for creating installer for my project in \u003cstrong\u003eInstallshield 2014\u003c/strong\u003e and it is working fine. I have also created a custom action to execute my exe file while installing the application. \u003c/p\u003e\n\n\u003cp\u003eThen i create a Silent Installer using (/s) command line argument. I want to pass the Config file to my MSI setup and one of my Custom Action exe file need this Config file to setup basic project setup. \u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003ee.g\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eInstaller.msi /s \"c:\\project\\config.txt\"\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eHow to pass this config file parameter to my exe as command line argument? \nI have searched in google and existing questions also. I didn't get way to do this.\nTill now i didn't get any way to do this. Please anyone help me to do this.\u003c/p\u003e\n\n\u003cp\u003eThanks in advance.\u003c/p\u003e","accepted_answer_id":"25433909","answer_count":"2","comment_count":"0","creation_date":"2014-08-21 15:33:30.563 UTC","favorite_count":"1","last_activity_date":"2014-08-22 22:09:34.55 UTC","last_edit_date":"2014-08-21 18:44:22.85 UTC","last_editor_display_name":"","last_editor_user_id":"129130","owner_display_name":"","owner_user_id":"3890902","post_type_id":"1","score":"2","tags":"installer|windows-installer|installshield|msiexec","view_count":"7008"} +{"id":"949175","title":"iPhone/iPod filesystem speed","body":"\u003cp\u003eDoes anyone out there have hard data from profiling the iPhone/iPod filesystem? I'm more interested in reading than writing.\u003c/p\u003e\n\n\u003cp\u003eI was thinking of running a few tests, but thought I'd check to see if someone smarter and/or more time-rich had already done so.\u003c/p\u003e\n\n\u003cp\u003eSpecifically I'm interested in speed difference between many small files versus fewer big files, and the differences between the various generations of iP* devices. \u003c/p\u003e\n\n\u003cp\u003eAnother question is whether or not ZIP compression of read files is worth the tradeoff of decompression, or at what data size there is a \"break-even\" point.\u003c/p\u003e","accepted_answer_id":"953375","answer_count":"1","comment_count":"0","creation_date":"2009-06-04 08:05:26.063 UTC","favorite_count":"3","last_activity_date":"2009-06-04 22:04:04.853 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"94239","post_type_id":"1","score":"3","tags":"iphone|filesystems|profiling","view_count":"740"} +{"id":"40890968","title":"Can not create folder using multipart","body":"\u003cp\u003eI always get:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eMissing end boundary in multipart body.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eAPI Sandbox doesn't help. It is possible to create folder there.\u003c/p\u003e\n\n\u003cp\u003eThe request is:\ncurl \u003ca href=\"https://www.googleapis.com/upload/drive/v3/files?uploadType=multipart\" rel=\"nofollow noreferrer\"\u003ehttps://www.googleapis.com/upload/drive/v3/files?uploadType=multipart\u003c/a\u003e -d @/home/payload -H 'Authorization: Bearer mytoken' -H 'Content-Type: multipart/boundary; boundary=RubyApiClientUpload'\u003c/p\u003e\n\n\u003cp\u003eThe payload is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e--RubyApiClientUpload \nContent-Type: application/json\n\n{ \"mimeType\":\"application/vnd.google-apps.folder\", \"name\":\"newfolder\", \"parents\":[\"0AMtAREF.....\"] }\n--RubyApiClientUpload\n\n--RubyApiClientUpload--\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"0","creation_date":"2016-11-30 14:31:50.77 UTC","last_activity_date":"2017-05-29 19:38:53.823 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7221502","post_type_id":"1","score":"1","tags":"google-drive-sdk","view_count":"47"} +{"id":"21862749","title":"System.BadImageFormatException was unhandled - simple fix","body":"\u003cp\u003e\u003ca href=\"http://www.youtube.com/watch?v=5H8mDH5_mQ4\" rel=\"nofollow\"\u003eHere\u003c/a\u003e is a short video of my error.\u003c/p\u003e\n\n\u003cp\u003eIt is obvious that I have something wrong between 32-bit and 64-bit. However I cant find anything that holds my hand enough to walk through the solution in Visual Studio 2012.\u003c/p\u003e\n\n\u003cp\u003eCan anyone give me a more detailed explanation of what and how to change in my settings?\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2014-02-18 18:49:43.35 UTC","last_activity_date":"2014-02-18 19:07:30.15 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"613483","post_type_id":"1","score":"1","tags":"c#|visual-studio-2012|screen-capture|badimageformatexception|microsoft-expression","view_count":"4460"} +{"id":"15115755","title":"ajax .keyup search function","body":"\u003cp\u003eI have a search function that uses the .keyup method on a rails application. I know that the call is working because the first letter I type is searching and showing results. If I continue to type it doesn't continue to search the method. Here is my jquery below and the part of my rails view it is calling.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eJQuery\u003c/strong\u003e \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e $(\"input#search\").keyup(function (){\n $.get($(\"#verified_search\").attr(\"action\"), $(\"#verified_search\").serialize(), null, \"script\");\n return false;\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eindex.js.erb\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(\".results\").html(\"\u0026lt;%= escape_javascript(render(\"search\")) %\u0026gt;\");\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eindex.html.erb view\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;%= form_tag admin_view_index_path, :method =\u0026gt; 'get', :id =\u0026gt; 'verified_search' do %\u0026gt;\n \u0026lt;%= text_field_tag :search, params[:search] %\u0026gt;\n \u0026lt;%= submit_tag \"Search\", :name =\u0026gt; :nil %\u0026gt;\n \u0026lt;% end %\u0026gt;\n\n \u0026lt;%= render 'search' %\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"6","creation_date":"2013-02-27 15:22:12.747 UTC","favorite_count":"0","last_activity_date":"2016-11-03 19:04:34.193 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1357070","post_type_id":"1","score":"0","tags":"ruby-on-rails-3|jquery","view_count":"1003"} +{"id":"11129727","title":"sqlite3_prepare_v2 statement is not SQLITE_OK and I don't know why","body":"\u003cp\u003eI have this code in my viewWillAppear method:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e sqlite3 *database;\nif (sqlite3_open([[self dataFilePath] UTF8String], \u0026amp;database)\n != SQLITE_OK) { \n\n sqlite3_close(database);\n NSAssert(0, @\"Failed to open database\");\n}\nsqlite3_stmt *statement;\n\n//why is this if statement failing?\nif (sqlite3_prepare_v2(database, [sqlStatement UTF8String],\n -1, \u0026amp;statement, nil) == SQLITE_OK) {\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt passes the first if statement without entering (which is good). The 2nd if statement is the problem. \u003c/p\u003e\n\n\u003cp\u003eThe sqlStatement is in the form of SELECT * FROM food WHERE foodType = 'fruit'\nI don't understand why it's not getting into the if statement. Any help would be appreciated. \u003c/p\u003e","accepted_answer_id":"11194645","answer_count":"3","comment_count":"7","creation_date":"2012-06-20 23:43:58.677 UTC","last_activity_date":"2012-06-25 17:55:28.233 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1250875","post_type_id":"1","score":"0","tags":"iphone|objective-c|sqlite|if-statement|sqlite3","view_count":"1290"} +{"id":"9417454","title":"Symfony 2, how to persist join table entities?","body":"\u003cp\u003eThis is such a trivial problem that I can't believe I couldn't find an answer.\u003c/p\u003e\n\n\u003cp\u003eSymfony 2, doctrine 2.1. I've got two entities and one intermediate entity (join table). User, Pref, and UsersPrefs. Pref table is dictionary table, so that I could change pref name in one place only. Ok, let's see the picture:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://dl.dropbox.com/u/22495762/infographic.png\" rel=\"nofollow noreferrer\"\u003einfographic http://dl.dropbox.com/u/22495762/infographic.png\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eAs You can see, I want to have a checkbox group, with all the possible choices (prefs) and preferred choices checked. So, if there are 3 prefs, and only 2 selected by the user, there should be 3 checkboxes, 2 selected.\u003c/p\u003e\n\n\u003cp\u003eIt's simple, if done plain PHP - query database twice to get list of all prefs and user prefs, render checkboxes depending on values, add some actions to handle form submit, done.\u003c/p\u003e\n\n\u003cp\u003eBut for the life of God I can't get this to work using symfony \u0026amp; doctrine. I was able to get to the point where I can update relationships in doctrine and further in database, but I'm using raw query values for that:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$data = $request-\u0026gt;request-\u0026gt;get('some_form');\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand this supposedly isn't the way it should be done?\u003c/p\u003e\n\n\u003cp\u003eMorevoer, I'm completely stuck as to how should I display checkbox list. I either get list of all options, none checked, or only user options, all checked. Or 'left joined' result set with checkboxes for all cases, useless anyway.\u003c/p\u003e\n\n\u003cp\u003eI've come to the point where I tried to overload twig checkbox template, but I couldn't pass variables to the form template, and that was the last straw...\u003c/p\u003e\n\n\u003cp\u003e\u003cem\u003eEDIT:\u003c/em\u003e\u003c/p\u003e\n\n\u003cp\u003eThis way I'm getting group of checkboxes, not connected to user choices:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e-\u0026gt;add('prefs', 'entity', array(\n 'class' =\u0026gt; 'Some\\TestBundle\\Entity\\Pref',\n 'expanded' =\u0026gt; 'true',\n 'multiple' =\u0026gt; 'true',\n 'property' =\u0026gt; 'name' \n ))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd this way I'm getting only user choices, all checked:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e-\u0026gt;add('prefs', 'entity', array(\n 'class' =\u0026gt; 'Some\\TestBundle\\Entity\\UserPrefs',\n 'multiple' =\u0026gt; 'false',\n 'expanded' =\u0026gt; 'false',\n 'property' =\u0026gt; 'pref.name',\n 'query_builder' =\u0026gt; function(EntityRepository $er) use ($id) {\n return $er-\u0026gt;createQueryBuilder('u')\n -\u0026gt;where(\"u.user = :id\")\n -\u0026gt;setParameter('id', $id)\n ;\n },\n\n ))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd I tried left joins and other options, but at best I could get list of all possible options for all possible users, checked accordingly.\u003c/p\u003e\n\n\u003ch2\u003eEDIT (POSSIBLE SOLUTION):\u003c/h2\u003e\n\n\u003cp\u003eI'm displaying checkbox group:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e-\u0026gt;add('pref_ids', 'choice', array(\n 'choices' =\u0026gt; array(\n '1' =\u0026gt; 'pref one',\n '2' =\u0026gt; 'pref two',\n '3' =\u0026gt; 'pref three',\n ),\n 'expanded' =\u0026gt; 'true',\n 'multiple' =\u0026gt; 'true' \n ))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI've added \u003ccode\u003e$pref_ids\u003c/code\u003e array in User entity. Now I just need to set values in array according to preferences chosen by user:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic function setPrefIds()\n {\n $prefs = $this-\u0026gt;getPrefs();\n $this-\u0026gt;pref_ids = array();\n foreach($prefs as $pref){\n array_push($this-\u0026gt;pref_ids, $pref-\u0026gt;getPref()-\u0026gt;getId());\n }\n return $this;\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis way I get appropriate checkboxes checked.\u003c/p\u003e\n\n\u003cp\u003eWriting values to database is reversal of the process. I'm getting input values from request:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$data = $request-\u0026gt;request-\u0026gt;get('edit_form');\nvar_dump($data['pref_ids']);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eRemoving all user prefs:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eforeach ($userPrefs as $pref){\n$em-\u0026gt;remove($pref);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd setting actual associations in doctrine from ids:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$entity-\u0026gt;setPrefsById($em, $data['pref_ids']);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere I'm passing entity manager to entity itself, but I need to refactor it, because it looks kinda messy this way.\u003c/p\u003e\n\n\u003cp\u003eThen \u003ccode\u003e$em-\u0026gt;flush();\u003c/code\u003e and that's it.\u003c/p\u003e\n\n\u003cp\u003eThat's the best I could come up with. Probably it's overcomplicated and should be done entirely different way. Unfortunately couldn't figure out this \"other way\".\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2012-02-23 16:53:11.09 UTC","favorite_count":"2","last_activity_date":"2016-06-10 12:59:30.15 UTC","last_edit_date":"2012-02-28 09:21:13.617 UTC","last_editor_display_name":"","last_editor_user_id":"1215742","owner_display_name":"","owner_user_id":"1215742","post_type_id":"1","score":"2","tags":"symfony|left-join|checkbox","view_count":"2348"} +{"id":"21427101","title":"App behaving differently over Mobile Data and Wifi","body":"\u003cp\u003eI have an app to play online music. I have added code in that to detect a call and pause the music while on call and as soon as the call ends, it should again start the song. The problem is that it is behaving properly when the phone is connected via Wifi but not doing the same when connected over mobile data. How to make the song play again after call in Mobile Data as well.?\u003c/p\u003e\n\n\u003cp\u003eHere is my code:\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eReachability.m\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eNSString *kReachabilityChangedNotification = @\"kNetworkReachabilityChangedNotification\";\n\n\n#pragma mark - Supporting functions\n\n#define kShouldPrintReachabilityFlags 1\n\nstatic void PrintReachabilityFlags(SCNetworkReachabilityFlags flags, const char* comment)\n{\n#if kShouldPrintReachabilityFlags\n\n NSLog(@\"Reachability Flag Status: %c%c %c%c%c%c%c%c%c %s\\n\",\n (flags \u0026amp; kSCNetworkReachabilityFlagsIsWWAN) ? 'W' : '-',\n (flags \u0026amp; kSCNetworkReachabilityFlagsReachable) ? 'R' : '-',\n\n (flags \u0026amp; kSCNetworkReachabilityFlagsTransientConnection) ? 't' : '-',\n (flags \u0026amp; kSCNetworkReachabilityFlagsConnectionRequired) ? 'c' : '-',\n (flags \u0026amp; kSCNetworkReachabilityFlagsConnectionOnTraffic) ? 'C' : '-',\n (flags \u0026amp; kSCNetworkReachabilityFlagsInterventionRequired) ? 'i' : '-',\n (flags \u0026amp; kSCNetworkReachabilityFlagsConnectionOnDemand) ? 'D' : '-',\n (flags \u0026amp; kSCNetworkReachabilityFlagsIsLocalAddress) ? 'l' : '-',\n (flags \u0026amp; kSCNetworkReachabilityFlagsIsDirect) ? 'd' : '-',\n comment\n );\n#endif\n}\n\n\nstatic void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void* info)\n{\n#pragma unused (target, flags)\n NSCAssert(info != NULL, @\"info was NULL in ReachabilityCallback\");\n NSCAssert([(__bridge NSObject*) info isKindOfClass: [Reachability class]], @\"info was wrong class in ReachabilityCallback\");\n\n Reachability* noteObject = (__bridge Reachability *)info;\n // Post a notification to notify the client that the network reachability changed.\n [[NSNotificationCenter defaultCenter] postNotificationName: kReachabilityChangedNotification object: noteObject];\n}\n\n\n#pragma mark - Reachability implementation\n\n@implementation Reachability\n{\n BOOL localWiFiRef;\n SCNetworkReachabilityRef reachabilityRef;\n}\n\n\n+ (instancetype)reachabilityWithHostName:(NSString *)hostName;\n{\n Reachability* returnValue = NULL;\n SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithName(NULL, [hostName UTF8String]);\n if (reachability != NULL)\n {\n returnValue= [[self alloc] init];\n if (returnValue != NULL)\n {\n returnValue-\u0026gt;reachabilityRef = reachability;\n returnValue-\u0026gt;localWiFiRef = NO;\n }\n }\n return returnValue;\n}\n\n\n+ (instancetype)reachabilityWithAddress:(const struct sockaddr_in *)hostAddress;\n{\n SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, (const struct sockaddr *)hostAddress);\n\n Reachability* returnValue = NULL;\n\n if (reachability != NULL)\n {\n returnValue = [[self alloc] init];\n if (returnValue != NULL)\n {\n returnValue-\u0026gt;reachabilityRef = reachability;\n returnValue-\u0026gt;localWiFiRef = NO;\n }\n }\n return returnValue;\n}\n\n\n\n+ (instancetype)reachabilityForInternetConnection;\n{\n struct sockaddr_in zeroAddress;\n bzero(\u0026amp;zeroAddress, sizeof(zeroAddress));\n zeroAddress.sin_len = sizeof(zeroAddress);\n zeroAddress.sin_family = AF_INET;\n\n return [self reachabilityWithAddress:\u0026amp;zeroAddress];\n}\n\n\n+ (instancetype)reachabilityForLocalWiFi;\n{\n struct sockaddr_in localWifiAddress;\n bzero(\u0026amp;localWifiAddress, sizeof(localWifiAddress));\n localWifiAddress.sin_len = sizeof(localWifiAddress);\n localWifiAddress.sin_family = AF_INET;\n\n // IN_LINKLOCALNETNUM is defined in \u0026lt;netinet/in.h\u0026gt; as 169.254.0.0.\n localWifiAddress.sin_addr.s_addr = htonl(IN_LINKLOCALNETNUM);\n\n Reachability* returnValue = [self reachabilityWithAddress: \u0026amp;localWifiAddress];\n if (returnValue != NULL)\n {\n returnValue-\u0026gt;localWiFiRef = YES;\n }\n\n return returnValue;\n}\n\n\n#pragma mark - Start and stop notifier\n\n- (BOOL)startNotifier\n{\n BOOL returnValue = NO;\n SCNetworkReachabilityContext context = {0, (__bridge void *)(self), NULL, NULL, NULL};\n\n if (SCNetworkReachabilitySetCallback(reachabilityRef, ReachabilityCallback, \u0026amp;context))\n {\n if (SCNetworkReachabilityScheduleWithRunLoop(reachabilityRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode))\n {\n returnValue = YES;\n }\n }\n\n return returnValue;\n}\n\n\n- (void)stopNotifier\n{\n if (reachabilityRef != NULL)\n {\n SCNetworkReachabilityUnscheduleFromRunLoop(reachabilityRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);\n }\n}\n\n\n- (void)dealloc\n{\n [self stopNotifier];\n if (reachabilityRef != NULL)\n {\n CFRelease(reachabilityRef);\n }\n}\n\n\n#pragma mark - Network Flag Handling\n\n- (NetworkStatus)localWiFiStatusForFlags:(SCNetworkReachabilityFlags)flags\n{\n PrintReachabilityFlags(flags, \"localWiFiStatusForFlags\");\n BOOL returnValue = NotReachable;\n\n if ((flags \u0026amp; kSCNetworkReachabilityFlagsReachable) \u0026amp;\u0026amp; (flags \u0026amp; kSCNetworkReachabilityFlagsIsDirect))\n {\n returnValue = ReachableViaWiFi;\n }\n\n return returnValue;\n}\n\n\n- (NetworkStatus)networkStatusForFlags:(SCNetworkReachabilityFlags)flags\n{\n PrintReachabilityFlags(flags, \"networkStatusForFlags\");\n if ((flags \u0026amp; kSCNetworkReachabilityFlagsReachable) == 0)\n {\n // The target host is not reachable.\n return NotReachable;\n }\n\n BOOL returnValue = NotReachable;\n\n if ((flags \u0026amp; kSCNetworkReachabilityFlagsConnectionRequired) == 0)\n {\n /*\n If the target host is reachable and no connection is required then we'll assume (for now) that you're on Wi-Fi...\n */\n returnValue = ReachableViaWiFi;\n }\n\n if ((((flags \u0026amp; kSCNetworkReachabilityFlagsConnectionOnDemand ) != 0) ||\n (flags \u0026amp; kSCNetworkReachabilityFlagsConnectionOnTraffic) != 0))\n {\n /*\n ... and the connection is on-demand (or on-traffic) if the calling application is using the CFSocketStream or higher APIs...\n */\n\n if ((flags \u0026amp; kSCNetworkReachabilityFlagsInterventionRequired) == 0)\n {\n /*\n ... and no [user] intervention is needed...\n */\n returnValue = ReachableViaWiFi;\n }\n }\n\n if ((flags \u0026amp; kSCNetworkReachabilityFlagsIsWWAN) == kSCNetworkReachabilityFlagsIsWWAN)\n {\n /*\n ... but WWAN connections are OK if the calling application is using the CFNetwork APIs.\n */\n returnValue = ReachableViaWWAN;\n }\n\n return returnValue;\n}\n\n\n- (BOOL)connectionRequired\n{\n NSAssert(reachabilityRef != NULL, @\"connectionRequired called with NULL reachabilityRef\");\n SCNetworkReachabilityFlags flags;\n\n if (SCNetworkReachabilityGetFlags(reachabilityRef, \u0026amp;flags))\n {\n return (flags \u0026amp; kSCNetworkReachabilityFlagsConnectionRequired);\n }\n\n return NO;\n}\n\n\n- (NetworkStatus)currentReachabilityStatus\n{\n NSAssert(reachabilityRef != NULL, @\"currentNetworkStatus called with NULL reachabilityRef\");\n NetworkStatus returnValue = NotReachable;\n SCNetworkReachabilityFlags flags;\n\n if (SCNetworkReachabilityGetFlags(reachabilityRef, \u0026amp;flags))\n {\n if (localWiFiRef)\n {\n returnValue = [self localWiFiStatusForFlags:flags];\n }\n else\n {\n returnValue = [self networkStatusForFlags:flags];\n }\n }\n\n return returnValue;\n}\n\n\n@end\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eViewController.m\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e- (void)viewDidLoad\n{\n\n toggleIsOn=TRUE;\n\n MPVolumeView *volumeView = [[MPVolumeView alloc] initWithFrame:self.viewVolume.bounds] ;\n\n [self.viewVolume addSubview:volumeView];\n\n [volumeView sizeToFit];\n [[UIApplication sharedApplication] beginReceivingRemoteControlEvents];\n\n}\n\n- (void)didReceiveMemoryWarning\n{\n [super didReceiveMemoryWarning];\n}\n\n-(IBAction)playButtonPressed:(id)sender\n{\n\n NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];\n [defaults setBool:TRUE forKey:@\"FirstPlay\"];\n [defaults setBool:YES forKey:@\"alertShown\"];\n\n if(toggleIsOn)\n {\n if(noNetwork)\n {\n [self showAlert];\n }\n else\n {\n toggleIsOn=!toggleIsOn;\n\n player = nil;\n NSString *stringurl = @\"\";\n stringurl = @\"http://something.pls\";\n NSURL *url = [NSURL URLWithString:stringurl];\n asset = [AVURLAsset URLAssetWithURL:url options:nil];\n playerItem = [AVPlayerItem playerItemWithAsset:asset];\n player = [AVPlayer playerWithPlayerItem:playerItem];\n player.actionAtItemEnd = AVPlayerActionAtItemEndNone;\n [playerItem addObserver:self forKeyPath:@\"timedMetadata\" options:NSKeyValueObservingOptionNew context:nil];\n [playerItem addObserver:self forKeyPath:@\"status\" options:NSKeyValueObservingOptionNew context:nil];\n [player play];\n isPlaying = TRUE;\n NSNotificationCenter *center = [NSNotificationCenter defaultCenter];\n [center addObserver:self selector:@selector(audioSessionInterrupted:) name:AVAudioSessionInterruptionNotification object:nil];\n\n [self.toggleButton setImage:[UIImage imageNamed:@\"reload.png\"] forState:UIControlStateNormal];\n [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];\n [[AVAudioSession sharedInstance] setActive: YES error: nil];\n [[UIApplication sharedApplication] beginReceivingRemoteControlEvents];\n }\n }\n else\n {\n\n [self.toggleButton setImage:[UIImage imageNamed:@\"playMusic.png\"] forState:UIControlStateNormal];\n self-\u0026gt;player.rate=0.0;\n toggleIsOn=!toggleIsOn;\n isPlaying = FALSE;\n }\n\n\n}\n- (void)audioSessionInterrupted:(NSNotification *)notification\n{\n\n NSNumber *interruptionType = [[notification userInfo] objectForKey:AVAudioSessionInterruptionTypeKey];\n NSNumber *interruptionOption = [[notification userInfo] objectForKey:AVAudioSessionInterruptionOptionKey];\n\n switch (interruptionType.unsignedIntegerValue) {\n case AVAudioSessionInterruptionTypeBegan:{\n // [self.toggleButton setImage:[UIImage imageNamed:@\"playMusic.png\"] forState:UIControlStateNormal];\n\n // • Audio has stopped, already inactive\n // • Change state of UI, etc., to reflect non-playing state\n } break;\n case AVAudioSessionInterruptionTypeEnded:{\n // • Make session active\n // • Update user interface\n // • AVAudioSessionInterruptionOptionShouldResume option\n if (interruptionOption.unsignedIntegerValue == AVAudioSessionInterruptionOptionShouldResume) {\n // Here you should continue playback.\n if(isPlaying)\n {\n [player play];\n }\n }\n } break;\n\n\n default:\n break;\n }\n\n}\n\n\n- (void)audioPlayerBeginInterruption:(AVAudioPlayer *)audioPlayer\n{\n if(isPlaying)\n {\n [player pause];\n }\n}\n-(void)audioRecorderEndInterruption:(AVAudioRecorder *)audioPlayer\n{\n if(isPlaying)\n {\n [player play];\n\n }\n}\n\n\n\n\n\n\n- (void)viewWillAppear:(BOOL)animated\n{\n [super viewWillAppear:animated];\n NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];\n [defaults setBool:TRUE forKey:@\"alertShown\"];\n [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(checkNetworkStatus:) name:kReachabilityChangedNotification object:nil];\n\n internetReachable = [Reachability reachabilityForInternetConnection];\n [internetReachable startNotifier];\n\n // check if a pathway to a random host exists\n hostReachable = [Reachability reachabilityWithHostName:@\"www.apple.com\"];\n [hostReachable startNotifier];\n\n\n}\n\n- (void)viewDidAppear:(BOOL)animated\n{\n [super viewDidAppear:animated];\n [[UIApplication sharedApplication] beginReceivingRemoteControlEvents];\n [self becomeFirstResponder];\n}\n\n\n- (void)viewWillDisappear:(BOOL)animated\n{\n [super viewWillDisappear:animated];\n [[UIApplication sharedApplication] endReceivingRemoteControlEvents];\n [self resignFirstResponder];\n}\n\n- (void)viewDidDisappear:(BOOL)animated\n{\n [super viewDidDisappear:animated];\n}\n\n- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation\n{\n return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);\n}\n\n\n- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object\n change:(NSDictionary *)change context:(void *)context {\n\n [playerItem removeObserver:self forKeyPath:keyPath];\n\n\n if ([keyPath isEqualToString:@\"status\"]) {\n AVPlayerItem *pItem = (AVPlayerItem *)object;\n if (pItem.status == AVPlayerItemStatusReadyToPlay)\n {\n metadatas.text = @\"\";\n }\n }\n if ([keyPath isEqualToString:@\"timedMetadata\"]) {\n for (AVAssetTrack *track in playerItem.tracks) {\n for (AVPlayerItemTrack *item in player.currentItem.tracks) {\n if ([item.assetTrack.mediaType isEqual:AVMediaTypeAudio]) {\n NSArray *meta = [playerItem timedMetadata];\n for (AVMetadataItem *metaItem in meta) {\n\n NSString *source = metaItem.stringValue;\n metadatas.text = source;\n }\n }\n }\n }\n }\n\n [self.toggleButton setImage:[UIImage imageNamed:toggleIsOn ? @\"playMusic.png\" :@\"stop.png\"] forState:UIControlStateNormal];\n\n}\n\n-(IBAction) sliderChanged:(id)sender\n{\n player.volume = slider.value;\n\n}\n-(void) checkNetworkStatus:(NSNotification *)notice\n{\n // called after network status changes\n NetworkStatus internetStatus = [internetReachable currentReachabilityStatus];\n NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];\n\n switch (internetStatus)\n {\n case NotReachable:\n {\n NSLog(@\"The internet is down.\");\n NSLog(@\"%d\",[defaults boolForKey:@\"alertShown\"]);\n BOOL isAlertShown = [defaults boolForKey:@\"alertShown\"];\n if(isAlertShown)\n {\n noNetwork = TRUE;\n isPlaying = false;\n [self showAlert];\n }\n\n break;\n }\n case ReachableViaWiFi:\n {\n NSLog(@\"The internet is working via WIFI.\");\n if(self.alert)\n {\n [self.alert dismissWithClickedButtonIndex:0 animated:YES];\n self.alert = nil;\n }\n noNetwork = FALSE;\n\n BOOL isFirstTimePlayed = [defaults boolForKey:@\"FirstPlay\"];\n if(!isPlaying)\n {\n if(isFirstTimePlayed)\n {\n [self playButtonPressed:nil];\n }\n }\n\n break;\n }\n case ReachableViaWWAN:\n {\n NSLog(@\"The internet is working via WWAN.\");\n if(self.alert)\n {\n [self.alert dismissWithClickedButtonIndex:0 animated:YES];\n self.alert = nil;\n }\n noNetwork = FALSE;\n\n BOOL isFirstTimePlayed = [defaults boolForKey:@\"FirstPlay\"];\n if(!isPlaying)\n {\n if(isFirstTimePlayed)\n {\n [self playButtonPressed:nil];\n }\n }\n\n break;\n }\n }\n\n }\n\n\n-(void)showAlert\n{\n //NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];\n //[defaults setBool:FALSE forKey:@\"alertShown\"];\n\n //alert = [[UIAlertView alloc] initWithTitle: @\"Alert\" message: @\"You have lost data connectivity. Please wait while we try to establish the connection again.\" delegate: nil cancelButtonTitle:@\"OK\" otherButtonTitles:nil];\n //[alert show];\n\n NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];\n [defaults setBool:FALSE forKey:@\"alertShown\"];\n\n self.alert = [[UIAlertView alloc] initWithTitle:@\"Alert\"\n message:@\"You have lost data connectivity. Please wait while we try to establish the connection again.\"\n delegate:self\n cancelButtonTitle:@\"OK\"\n otherButtonTitles:nil];\n [self.alert show];\n}\n\n- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex\n{\n if(!isPlaying)\n {\n [player pause];\n [self.toggleButton setImage:[UIImage imageNamed:@\"playMusic.png\"] forState:UIControlStateNormal];\n }\n}\n\n- (NSUInteger)supportedInterfaceOrientations{\n return UIInterfaceOrientationMaskPortrait;\n}\n\n\n\n\n@end\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-01-29 09:38:01.407 UTC","last_activity_date":"2014-01-29 11:47:09.057 UTC","last_edit_date":"2014-01-29 11:09:35.303 UTC","last_editor_display_name":"","last_editor_user_id":"1564216","owner_display_name":"","owner_user_id":"1969846","post_type_id":"1","score":"0","tags":"ios|ios7|reachability","view_count":"472"} +{"id":"26806337","title":"What happens if you call exit(0) while other threads are still running?","body":"\u003cp\u003eSuppose a program has several threads: t1, t2, etc. These are using pthreads. The t2 thread is sitting in a loop reading from a stream and accessing a variable with static storage duration. \u003c/p\u003e\n\n\u003cp\u003eNow suppose t1 calls \u003ccode\u003eexit(0)\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003e\u003cem\u003e(Further details: I have a program doing this on a unix-based system, and is compiled with g++. The program appears to occasionally be crashing on shutdown with a stack trace that indicates the static variable is not valid.)\u003c/em\u003e\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003cp\u003eDoes the thread get killed prior to the C++ object destruction? \u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eIs C++ is not aware of the threads, so these keep running until the C++ cleanup is complete?\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eShould the \u003ccode\u003eSIGTERM\u003c/code\u003e handler first shutdown or kill the threads before proceeding, or does this happen automatically?\u003c/p\u003e\u003c/li\u003e\n\u003c/ul\u003e","accepted_answer_id":"26807007","answer_count":"2","comment_count":"10","creation_date":"2014-11-07 17:03:37.787 UTC","favorite_count":"1","last_activity_date":"2014-11-07 18:14:32.1 UTC","last_edit_date":"2014-11-07 17:51:26.063 UTC","last_editor_display_name":"","last_editor_user_id":"211160","owner_display_name":"","owner_user_id":"736981","post_type_id":"1","score":"6","tags":"c++|pthreads","view_count":"4030"} +{"id":"47213758","title":"Combine different table with same column without ambigous","body":"\u003cp\u003eI have query problem. I have 3 table.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etable A \n ----------------------------\n NAME | CODE\n ----------------------------\n bob | PL\n david | AA\n susan | PL\n joe | AB\n\n\ntable B \n ----------------------------\n CODE | DESCRIPTION\n ----------------------------\n PL | code 1\n PB | code 2 \n PC | code 3\n\ntable C \n ----------------------------\n CODE | DESCRIPTION\n ----------------------------\n AA | code 4\n AB | code 5 \n AC | code 6\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eTable B and C have unique row.\nthe result I need :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e ----------------------------\n NAME | CODE | DESCRIPTION\n ----------------------------\n bob | PL | code 1\n david | AA | code 4\n susan | PL | code 1\n joe | AB | code 5\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat I have tried so far\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://sqlfiddle.com/#!9/ffb2eb/9\" rel=\"nofollow noreferrer\"\u003ehttp://sqlfiddle.com/#!9/ffb2eb/9\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"47213790","answer_count":"2","comment_count":"1","creation_date":"2017-11-10 00:11:54.897 UTC","last_activity_date":"2017-11-10 00:15:46.08 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2775611","post_type_id":"1","score":"2","tags":"sql|oracle","view_count":"29"} +{"id":"30302867","title":"Gamma correction formula","body":"\u003cp\u003eIn discussion of gamma correction, most people write formula\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ey = 255 (x/255)^gamma\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI guess this is applied for each channel: R, G and B. My quesion is following\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003e\u003cp\u003eshouldn't I rather analyze the image (I assume 8bit per color channel), find the maximum intensity pixel among all channels and then write\u003c/p\u003e\n\n\u003cp\u003ey = x_max (x/x_max)^gamma\u003c/p\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003e?\u003c/p\u003e\n\n\u003col start=\"2\"\u003e\n\u003cli\u003eif the answer for part 1. is \"yes\" then the second question follows: what should I use for x_max for each color channel? should I find a single value x_max for all colors or should I use individual x_max for each color channel, x_max_r, x_max_g and x_max_b?\u003c/li\u003e\n\u003c/ol\u003e","accepted_answer_id":"30303103","answer_count":"1","comment_count":"0","creation_date":"2015-05-18 12:10:01.18 UTC","favorite_count":"1","last_activity_date":"2015-05-19 05:26:22.977 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1191068","post_type_id":"1","score":"1","tags":"image-processing|rendering|gamma","view_count":"171"} +{"id":"30185364","title":"Core Audio - Write data to beginning or middle of audio file (somewhere other than the end)","body":"\u003cp\u003eSo, I have an audio recording iOS app I am working on. In my app I have the need to write audio at any point in the file (in the documents directory) the user chooses, which will overwrite whatever audio is there. \u003c/p\u003e\n\n\u003cp\u003eExample: I record 3 min of audio, scroll back to minute two, start recording again for 10 seconds. Now, 2:00 - 2:10 contains the new audio, and the old audio is gone (the audio file does not get longer in this example).\u003c/p\u003e\n\n\u003cp\u003eI am using EZAudio and I can record and pause as many times as I want and it will keep appending to the end. I was going to use \u003ccode\u003eExtAudioFileSeek\u003c/code\u003e to seek backward in the file and record from there, but you can only use that when the file is open as read-only. \u003c/p\u003e\n\n\u003cp\u003eWhat I don't want: I don't want to record to a different file, and append the two files together using this method: \u003ca href=\"https://stackoverflow.com/a/10562809/1391672\"\u003ehttps://stackoverflow.com/a/10562809/1391672\u003c/a\u003e\nThere is significant loading time associated with this. The iOS app Voice Memos appends files together instantaneously.\u003c/p\u003e\n\n\u003cp\u003eCan \u003ccode\u003eExtAudioFileWriteAsync\u003c/code\u003e be used to append audio at the beginning? Or at a specified sample location? Is there another method I should look at?\u003c/p\u003e","accepted_answer_id":"30196698","answer_count":"1","comment_count":"0","creation_date":"2015-05-12 08:17:54.157 UTC","favorite_count":"1","last_activity_date":"2015-05-12 16:34:04.477 UTC","last_edit_date":"2017-05-23 11:59:05.87 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"1391672","post_type_id":"1","score":"2","tags":"ios|objective-c|core-audio|extaudiofile","view_count":"257"} +{"id":"41949711","title":"io.realm.exceptions.RealmMigrationNeededException: Field count is less than expected - expected 5 but was 4 ERROR","body":"\u003cp\u003eERROR - Realm-Android - I started using Realm for my new project I am getting io.realm.exceptions.RealmMigrationNeededException: Field count is less than expected - expected 5 but was 4... I googled but not found correct solution. can anyone guide me to solve this issue.\u003c/p\u003e","answer_count":"0","comment_count":"4","creation_date":"2017-01-31 04:36:51.22 UTC","favorite_count":"1","last_activity_date":"2017-09-23 13:02:49.717 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6117499","post_type_id":"1","score":"3","tags":"android|realm","view_count":"1028"} +{"id":"39216694","title":"String variable as literal bytes","body":"\u003cp\u003eI'm reading in a config file. Say I end up with a configuration variable:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eheader = '\\x42\\x5a\\x68'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to match this against binary files using startswith.\u003c/p\u003e\n\n\u003cp\u003eUnsurprisingly, I get a \u003ccode\u003e\"TypeError startswith first arg must be bytes or a tuple of bytes, not str\"\u003c/code\u003e, if I try to use this directly. How do I use this string? I don't want it encoded.\u003c/p\u003e\n\n\u003cp\u003eI have to read the string from a file. If there's some other way to go about this, I'm all ears. Thanks for reading!\u003c/p\u003e","accepted_answer_id":"39216928","answer_count":"1","comment_count":"1","creation_date":"2016-08-29 23:32:09.85 UTC","last_activity_date":"2016-08-30 00:00:23.99 UTC","last_edit_date":"2016-08-30 00:00:23.99 UTC","last_editor_display_name":"","last_editor_user_id":"4952130","owner_display_name":"","owner_user_id":"6772165","post_type_id":"1","score":"0","tags":"python|string|python-3.x","view_count":"29"} +{"id":"20823566","title":"How can I properly execute this javascript within my php statement?","body":"\u003cp\u003eThe following code will only be called when a session has timed out. I basically want to display a confirm dialog with javascript to make the user pick if he wants to remain online or not. My problem is that the php that closes the session inside the javascript seems to be executed even if the confirm is true.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eif (isset($_SESSION['username']) \u0026amp;\u0026amp; isset($_SESSION['last_activity']) \u0026amp;\u0026amp; (time() - $_SESSION['last_activity'] \u0026gt; 5)) {\n ?\u0026gt;\n \u0026lt;script type=\"text/javascript\"\u0026gt;\n if (confirm(\"You were logged off due to inactivity, if you would like to remain logged in click OK.\")) {\n header(\"Location:/\");\n } else {\n \u0026lt;?php\n connect();\n if(!connect()) {\n die('Could not connect: ' . mysql_error());\n header( \"refresh:3; url=/index.php\" );\n }\n mysql_select_db('www');\n $user = $_SESSION['username'];\n mysql_query(\"UPDATE users SET online='0'\n WHERE username='$user'\");\n session_unset();\n session_destroy();\n ?\u0026gt;\n }\n \u0026lt;/script\u0026gt;\n\u0026lt;?php\n}\n$_SESSION['last_activity'] = time(); // update last activity time stamp\n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"20823574","answer_count":"1","comment_count":"1","creation_date":"2013-12-29 08:52:50.307 UTC","last_activity_date":"2013-12-29 09:14:24.233 UTC","last_edit_date":"2013-12-29 09:14:24.233 UTC","last_editor_display_name":"","last_editor_user_id":"3120967","owner_display_name":"","owner_user_id":"2023050","post_type_id":"1","score":"0","tags":"javascript|php|session","view_count":"47"} +{"id":"33933744","title":"@output which was not supplied in sql server","body":"\u003cp\u003eC# code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprotected void btnsearch_Click(object sender, EventArgs e)\n{\n SqlConnection con = Connection.DBconnection(); \n\n SqlCommand com = new SqlCommand(\"sp_studentresult\", con);\n com.CommandType = CommandType.StoredProcedure;\n\n com.Parameters.AddWithValue(\"@id\", textstudentid.Text);\n\n SqlDataAdapter adp = new SqlDataAdapter(com);\n DataSet ds = new DataSet();\n adp.Fill(ds);\n\n if (ds.Tables[0].Rows.Count \u0026gt; 0)\n { \n txtid.Text = ds.Tables[0].Rows[0][\"id\"].ToString();\n txttamil.Text = ds.Tables[0].Rows[0][\"Tamil\"].ToString();\n txtenglish.Text = ds.Tables[0].Rows[0][\"English\"].ToString();\n txtmaths.Text = ds.Tables[0].Rows[0][\"Maths\"].ToString();\n txtscience.Text = ds.Tables[0].Rows[0][\"Science\"].ToString();\n txtsocialscience.Text = ds.Tables[0].Rows[0][\"SocialScience\"].ToString(); \n }\n\n SqlParameter retval = new SqlParameter(\"@output\", SqlDbType.VarChar, 50);\n retval.Direction = ParameterDirection.Output;\n com.Parameters.Add(retval);\n\n com.ExecuteNonQuery();\n\n string Output = retval.Value.ToString(); \n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eStored procedure:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e ALTER PROCEDURE sp_studentresult\n(\n @id int,\n @output varchar(50) output,\n @id_student varchar(50)\n)\nAS\nbegin\nSELECT * from studentresult where id_student=@id\nEnd\nIF EXISTS (SELECT * FROM student WHERE id=@id_student)\nBEGIN\nSET @output='EXIST'\nEND\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm new to .net. When I enter student id and search I get\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eProcedure or function sp_studentresult has too many arguments specified.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eMay I know what my mistake in the above code?\u003c/p\u003e\n\n\u003cp\u003eAny help would be highly appreciated.\u003c/p\u003e\n\n\u003cp\u003eThanks,\u003c/p\u003e","answer_count":"4","comment_count":"5","creation_date":"2015-11-26 08:28:49.973 UTC","last_activity_date":"2015-11-26 12:16:24.59 UTC","last_edit_date":"2015-11-26 09:11:24.737 UTC","last_editor_display_name":"","last_editor_user_id":"4773326","owner_display_name":"","owner_user_id":"4773326","post_type_id":"1","score":"1","tags":"c#|sql-server|stored-procedures","view_count":"63"} +{"id":"46508081","title":"jarsigner error: java.time.DateTimeException: Invalid value for MonthOfYear (valid values 1 - 12): 0","body":"\u003cp\u003eI get this error when signing an Ionic android apk, I'm on Kubuntu 17.04, using Ionic 3, java 8 installed\u003c/p\u003e\n\n\u003cp\u003eThe error I get:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eEnter Passphrase for keystore: \nupdating: META-INF/MANIFEST.MF\nadding: META-INF/TEST2.SF\nadding: META-INF/TEST2.RSA\nsigning: AndroidManifest.xml\njarsigner error: java.time.DateTimeException: Invalid value for MonthOfYear (valid values 1 - 12): 0\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ejava version\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$ java -version\nopenjdk version \"1.8.0_131\"\nOpenJDK Runtime Environment (build 1.8.0_131-8u131-b11-2ubuntu1.17.04.3-b11)\nOpenJDK 64-Bit Server VM (build 25.131-b11, mixed mode)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ejavac\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$ javac -version\njavac 1.8.0_131\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have Android Studio installed and it's working fine, I tested the app source code and it ran on the emulator no problems.\u003c/p\u003e","accepted_answer_id":"47222621","answer_count":"1","comment_count":"1","creation_date":"2017-10-01 00:00:06.193 UTC","favorite_count":"2","last_activity_date":"2017-11-10 12:18:08.63 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"8702128","post_type_id":"1","score":"4","tags":"java|android|linux|ubuntu|ionic-framework","view_count":"426"} +{"id":"14076107","title":"How to handle same symbol used for two things lemon parser","body":"\u003cp\u003eI'm developing a domain specific language. Part of the language is exactly like C expression parsing semantics such as precidence and symbols.\u003c/p\u003e\n\n\u003cp\u003eI'm using the Lemon parser. I ran into an issue of the same token being used for two different things, and I can't tell the difference in the lexer. The ampersand (\u0026amp;) symbol is used for both 'bitwise and' and \"address of\".\u003c/p\u003e\n\n\u003cp\u003eAt first I thought it was a trivial issue, until I realized that they don't have the same associativity.\u003c/p\u003e\n\n\u003cp\u003eHow do I give the same token two different associativities? Should I just use AMP (as in ampersand) and make the addressof and bitwise and rules use AMP, or should I use different tokens (such as ADDRESSOF and BITWISE_AND). If I do use separate symbols, how am I supposed to know which one from the lexer (it can't know without being a parser itself!).\u003c/p\u003e","accepted_answer_id":"14077277","answer_count":"2","comment_count":"4","creation_date":"2012-12-28 21:35:32.95 UTC","favorite_count":"1","last_activity_date":"2012-12-29 14:34:59.87 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1127972","post_type_id":"1","score":"3","tags":"c|parsing|lemon","view_count":"691"} +{"id":"15410312","title":"Searching through contacts in android by name?","body":"\u003cp\u003eI want to implement dynamic search in android.\nI want to find contacts starting by the alphabet entered by the user.\nI am trying to implement it using SearchView.I have made a searchable activity and here is the code inside it\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eIntent intent = getIntent();\n if (Intent.ACTION_SEARCH.equals(intent.getAction())) {\n String query = intent.getStringExtra(SearchManager.QUERY);\n Cursor c = getContentResolver().query(Data.CONTENT_URI,\n new String[] {Data._ID, Phone.DISPLAY_NAME},\n Data.DISPLAY_NAME + \"=?\" + \" AND \"\n + Data.MIMETYPE + \"='\" + Phone.CONTENT_ITEM_TYPE + \"'\",\n new String[] {query}, null);\n SimpleCursorAdapter sca = new SimpleCursorAdapter(null, \n 0, c, new String[] {Phone.DISPLAY_NAME}, null);\n setListAdapter(sca);\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI dont know where am I going wrong..I just dont get any results \nAny help would be appreciated!..Thanks!!\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2013-03-14 13:14:10.433 UTC","last_activity_date":"2017-07-26 15:06:35.553 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2008055","post_type_id":"1","score":"0","tags":"android|search|contacts","view_count":"1149"} +{"id":"18720156","title":"Adding Background Image into View Controller","body":"\u003cp\u003eI tried to use this code under in my app delegate in order to add a PNG image as a view controller's background :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions\n{\n [[self window] setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@\"background.png\"]]];\n\n return YES;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut I have no luck with it... the view controller still has a white background. What's wrong with that code?\u003c/p\u003e","accepted_answer_id":"18720211","answer_count":"7","comment_count":"2","creation_date":"2013-09-10 13:22:50.717 UTC","favorite_count":"4","last_activity_date":"2017-02-08 09:26:56.443 UTC","last_edit_date":"2014-12-25 21:45:29.913 UTC","last_editor_display_name":"","last_editor_user_id":"603977","owner_display_name":"","owner_user_id":"1187009","post_type_id":"1","score":"12","tags":"ios|objective-c|cocoa-touch|uiviewcontroller","view_count":"31962"} +{"id":"23486723","title":"Getting a 405 response code with HttpURLConnection","body":"\u003cp\u003eI am getting a \u003ccode\u003eHTTP\u003c/code\u003e response code \u003ccode\u003e405\u003c/code\u003e when I use \u003ccode\u003eHttpURLConnection\u003c/code\u003e to make a \u003ccode\u003eDELETE\u003c/code\u003e request:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public void makeDeleteRequest(String objtype,String objkey)\n{\n URL url=null;\n String uri=\"http://localhost:8180/GoogleMapsLoadingTest/rest/GoogleMapsErp/\";\n HttpURLConnection conn=null;\n try {\n url=new URL(uri);\n } catch (MalformedURLException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n try {\n conn=(HttpURLConnection) url.openConnection();\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n conn.setDoInput(true);\n conn.setDoOutput(true);\n try {\n System.out.println(conn.getResponseCode());\n } catch (IOException e1) {\n // TODO Auto-generated catch block\n e1.printStackTrace();\n }\n\n try {\n conn.setRequestMethod(\"DELETE\");\n } catch (ProtocolException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow can I make this request?\u003c/p\u003e","accepted_answer_id":"23486779","answer_count":"2","comment_count":"0","creation_date":"2014-05-06 05:40:39.74 UTC","favorite_count":"1","last_activity_date":"2015-08-28 22:48:58.74 UTC","last_edit_date":"2015-08-28 22:48:58.74 UTC","last_editor_display_name":"","last_editor_user_id":"4370109","owner_display_name":"","owner_user_id":"2309862","post_type_id":"1","score":"0","tags":"java|http|httpurlconnection|http-delete","view_count":"1441"} +{"id":"7774806","title":"Illegal argument exception with Json","body":"\u003cp\u003eI get this error when running my code, and I don't receive anything back from json\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e10-15 00:29:22.396: WARN/System.err(562): java.lang.IllegalArgumentException: Illegal character in query at index 68: http://www.hotels-in-london-hotels.com/mytrolly/service.php?request={\"mode\":\"category\"}\n10-15 00:29:22.425: WARN/System.err(562): at java.net.URI.create(URI.java:970)\n10-15 00:29:22.425: WARN/System.err(562): at org.apache.http.client.methods.HttpGet.\u0026lt;init\u0026gt;(HttpGet.java:75)\n10-15 00:29:22.436: WARN/System.err(562): at com.sampleapp.MainActivity$iTab.readTwitterFeed(MainActivity.java:128)\n10-15 00:29:22.436: WARN/System.err(562): at com.sampleapp.MainActivity$iTab.\u0026lt;init\u0026gt;(MainActivity.java:65)\n10-15 00:29:22.436: WARN/System.err(562): at java.lang.reflect.Constructor.constructNative(Native Method)\n10-15 00:29:22.446: WARN/System.err(562): at java.lang.reflect.Constructor.newInstance(Constructor.java:446)\n10-15 00:29:22.446: WARN/System.err(562): at android.view.LayoutInflater.createView(LayoutInflater.java:500)\n10-15 00:29:22.456: WARN/System.err(562): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:565)\n10-15 00:29:22.456: WARN/System.err(562): at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)\n10-15 00:29:22.466: WARN/System.err(562): at android.view.LayoutInflater.inflate(LayoutInflater.java:407)\n10-15 00:29:22.466: WARN/System.err(562): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)\n10-15 00:29:22.466: WARN/System.err(562): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)\n10-15 00:29:22.476: WARN/System.err(562): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)\n10-15 00:29:22.476: WARN/System.err(562): at android.app.Activity.setContentView(Activity.java:1647)\n10-15 00:29:22.476: WARN/System.err(562): at com.sampleapp.MainActivity.onCreate(MainActivity.java:362)\n10-15 00:29:22.486: WARN/System.err(562): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)\n10-15 00:29:22.486: WARN/System.err(562): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)\n10-15 00:29:22.486: WARN/System.err(562): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)\n10-15 00:29:22.496: WARN/System.err(562): at android.app.ActivityThread.access$2300(ActivityThread.java:125)\n10-15 00:29:22.496: WARN/System.err(562): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)\n10-15 00:29:22.496: WARN/System.err(562): at android.os.Handler.dispatchMessage(Handler.java:99)\n10-15 00:29:22.506: WARN/System.err(562): at android.os.Looper.loop(Looper.java:123)\n10-15 00:29:22.506: WARN/System.err(562): at android.app.ActivityThread.main(ActivityThread.java:4627)\n10-15 00:29:22.506: WARN/System.err(562): at java.lang.reflect.Method.invokeNative(Native Method)\n10-15 00:29:22.506: WARN/System.err(562): at java.lang.reflect.Method.invoke(Method.java:521)\n10-15 00:29:22.506: WARN/System.err(562): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)\n10-15 00:29:22.506: WARN/System.err(562): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)\n10-15 00:29:22.506: WARN/System.err(562): at dalvik.system.NativeStart.main(Native Method)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBasically I'm trying to use json, and the problem I'm having is with this line\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eHttpGet httpGet = new HttpGet(\n \"http://www.hotels-in-london-hotels.com/mytrolly/service.php?request={\\\"mode\\\":\\\"category\\\"}\");\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI've encoded the string, and I still get the exception \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etry {\n url = \"http://www.hotels-in-london-hotels.com/mytrolly/service.php?request={\\\"mode\\\":\\\"category\\\"}\";\n String encodedurl = URLEncoder.encode(url,\"UTF-8\");\n Log.d(\"TEST\", encodedurl);\n } catch (UnsupportedEncodingException e) {\n e.printStackTrace();\n } \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny solutions?\u003c/p\u003e","accepted_answer_id":"7774876","answer_count":"3","comment_count":"0","creation_date":"2011-10-15 00:10:21.81 UTC","last_activity_date":"2014-04-21 10:21:07.92 UTC","last_edit_date":"2011-10-15 00:38:03.373 UTC","last_editor_display_name":"","last_editor_user_id":"932381","owner_display_name":"","owner_user_id":"932381","post_type_id":"1","score":"0","tags":"android|json","view_count":"2110"} +{"id":"37062319","title":"Love2d move an object on screen","body":"\u003cp\u003eI am attempting to use keyboard input to translate a label around the screen. Currently only down and left are functioning. My code is below. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edebug = true\ndown = 0\nup = 0\nleft = 0\nright = 0\ntext = 'non'\n\nx = 100\ny = 100\n\ndx = 0\ndy = 0\nfunction love.load(arg)\n\nend\n\nfunction love.update(dt)\n if love.keyboard.isDown('escape') then\n love.event.push('quit')\n end\n\n if up == 1 then\n dy = -1\n end\n if up == 0 then\n dy = 0\n end\n\n if down == 1 then\n dy = 1\n end\n if down == 0 then\n dy = 0\n end\n\n if right == 1 then\n dx = 1\n end\n if right == 0 then\n dx = 0\n end\n\n if left == 1 then\n dx = -1\n end\n if left == 0 then\n dx = 0\n end\nend\n\nfunction love.keypressed(key)\n if key == 'up' or key == 'w' then\n text = 'up'\n up = 1\n end\n if key == 'down' or key == 's' then\n text = 'down'\n down = 1\n end\n if key == 'right' or key == 'd' then\n text = 'right'\n right = 1\n end\n if key == 'left' or key == 'a' then\n text = 'left'\n left = 1\n end\nend\n\nfunction love.keyreleased(key)\n text = 'non'\n\n if key == 'up' or key == 'w' then\n up = 0\n end\n if key == 'down' or key == 's' then\n down = 0\n end\n if key == 'right' or key == 'd' then\n right = 0\n end\n if key == 'left' or key == 'a' then\n left = 0\n end\nend\n\nfunction love.draw(dt)\n x = x + dx\n y = y + dy\n love.graphics.print(text, x, y)\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eExperimentation has shown that the order of if statements in the love.update(dt) section effects which directions work but I cannot get all four to work at the same time.\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2016-05-06 00:21:26.117 UTC","last_activity_date":"2016-05-06 05:28:41.39 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3668936","post_type_id":"1","score":"2","tags":"lua|love2d","view_count":"331"} +{"id":"11398320","title":"How to group a List\u003cT\u003e that has a property of List\u003cstring\u003e by that nested List?","body":"\u003cp\u003eI have a custom data type that contains a \u003ccode\u003eList\u0026lt;string\u0026gt;\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eI wish to group a \u003ccode\u003eList\u003c/code\u003e of \u003ccode\u003eCustomDataType\u003c/code\u003e by that nested \u003ccode\u003eList\u0026lt;string\u0026gt;\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eI have tried the following\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e compoundSchedules.GroupBy(a =\u0026gt; a.Timepoints);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhere \u003ccode\u003eTimepoints\u003c/code\u003e is a list of dates represented as strings. Where any \u003ccode\u003eCustomDataType\u003c/code\u003es have identical timepoints, I wish them to be grouped together.\nUsing the code above, it does not group them and instead just repeats the \u003ccode\u003eList\u003c/code\u003e of \u003ccode\u003eCustomDataType\u003c/code\u003e with its timepoint list as the \u003ccode\u003eIGrouping\u003c/code\u003e \u003ccode\u003eKey\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","accepted_answer_id":"11398687","answer_count":"4","comment_count":"3","creation_date":"2012-07-09 15:32:45.677 UTC","last_activity_date":"2012-07-09 15:51:41.217 UTC","last_edit_date":"2012-07-09 15:42:14.74 UTC","last_editor_display_name":"","last_editor_user_id":"71059","owner_display_name":"","owner_user_id":"482138","post_type_id":"1","score":"4","tags":"c#|linq|group-by","view_count":"130"} +{"id":"42158672","title":"Wrong type error on an interface intended to test a method using Docker's client API","body":"\u003cp\u003eI'm refactoring a program I wrote so I can properly write tests for it. One of the first methods I'd like to test is a method that uses \u003ca href=\"https://github.com/docker/docker/tree/master/client\" rel=\"nofollow noreferrer\"\u003eDocker's client API\u003c/a\u003e to see if a certain image exists on a Docker host.\u003c/p\u003e\n\n\u003cp\u003eTo be able to test this method, I created an interface that matches \u003ccode\u003eclient.ImageList\u003c/code\u003e's \u003ca href=\"https://godoc.org/github.com/docker/docker/client#Client.ImageList\" rel=\"nofollow noreferrer\"\u003esignature\u003c/a\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etype ImageLister interface {\n ImageList(ctx context.Context, options types.ImageListOptions) ([]types.ImageSummary, error)\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI also changed the method to test to take an \u003ccode\u003eImageLister\u003c/code\u003e as argument, so I can pass in an \u003ccode\u003eImageLister\u003c/code\u003e implementation specific to my tests.\u003c/p\u003e\n\n\u003cp\u003eHowever, in my actual code, where I pass in the \"real\" Docker client to the method to test, the following compilation error occurs:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eImageExists:\n *client.Client does not implement ImageLister (wrong type for ImageList method)\n have ImageList(\"github.com/docker/docker/vendor/golang.org/x/net/context\".Context, types.ImageListOptions) ([]types.ImageSummary, error)\n want ImageList(\"context\".Context, types.ImageListOptions) ([]types.ImageSummary, error)\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eHow can I resolve this? Or is my approach bad anyway, and should I go a different route?\u003c/p\u003e\n\n\u003cp\u003eedit:\nThe following program reproduces the issue I'm encountering.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epackage main\n\nimport (\n \"context\"\n \"github.com/docker/docker/api/types\"\n \"github.com/docker/docker/client\"\n)\n\ntype ImageLister interface {\n ImageList(ctx context.Context, options types.ImageListOptions) ([]types.ImageSummary, error)\n}\n\nfunc main() {\n client, err := client.NewEnvClient()\n defer client.Close()\n\n ImageExists(context.TODO(), client, \"foo\")\n}\n\nfunc ImageExists(ctx context.Context, lister ImageLister, image string) (bool, error) {\n return true, nil\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"42165701","answer_count":"2","comment_count":"2","creation_date":"2017-02-10 11:48:44.95 UTC","last_activity_date":"2017-02-10 17:51:31.75 UTC","last_edit_date":"2017-02-10 13:12:54.46 UTC","last_editor_display_name":"","last_editor_user_id":"2160748","owner_display_name":"","owner_user_id":"2160748","post_type_id":"1","score":"1","tags":"testing|go|docker","view_count":"113"} +{"id":"30508313","title":"python subprocess sub thread does not exit?","body":"\u003cp\u003ethe following code is strange:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef exec_shell(args, pipe = True):\n pre_fun = None\n if pipe == True:\n pre_fun = lambda: signal.signal(signal.SIGPIPE, signal.SIG_DFL)\n\n process = subprocess.Popen(args, stdout=subprocess.PIPE,\n stderr=subprocess.PIPE,\n preexec_fn = pre_fun)\n (out, err) = process.communicate() \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhen i execute a complicate shell script,\nif i set the pipe is true:\n the err will be :\n A thread exited while 2 threads were running\nif i set pipe false the err will be : broken pipe\u003c/p\u003e\n\n\u003cp\u003ewho can help me ? thanks\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2015-05-28 13:41:52.96 UTC","last_activity_date":"2015-05-28 13:58:39.69 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1503918","post_type_id":"1","score":"0","tags":"python","view_count":"102"} +{"id":"34653034","title":"Repeating an entry on the result of a get request in angular","body":"\u003cp\u003eI am trying to populate a list in angular based on the returned result of a get request to my back end.\u003c/p\u003e\n\n\u003cp\u003eI have the following implementation but it is not populating. The call is being made to the back end, the view is however not being populated\u003c/p\u003e\n\n\u003cp\u003eView:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;div ng-controller=\"MyController as controller\"\u0026gt;\n \u0026lt;ul\u0026gt;\n \u0026lt;li ng-repeat=\"page in myPages\"\u0026gt;\n Test\n \u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n \u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMyController:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e(function() {\n 'use strict';\n\n function MyController($scope, $stateParams, MyService) {\n $scope.init = function() {\n $scope.myService = MyService;\n $scope.myPages = $scope.getPages();\n }\n $scope.getPages = function() {\n return $scope.myService.getPages(null);\n }\n\n $scope.init();\n }\n MyController.$inject = ['$scope', '$stateParams', '$MyService'];\n angular.module('MyModule').controller('MyController', MyController);\n})();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMyService:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e(function() {\n 'use strict';\n\n function $MyService($http, API_CONFIG) {\n function getPages(active) {\n return $http.get('my/url', {\n params: {\n activeOnly : active\n }\n });\n }\n return { getPages : getPages } \n }\n $MyService.$inject = ['$http', 'API_CONFIG'];\n angular.module('myServiceModule', []);\n angular.module('myServiceModule').factory('MyService', $MyService);\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"0","creation_date":"2016-01-07 10:39:33.95 UTC","last_activity_date":"2016-01-07 10:39:33.95 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1860517","post_type_id":"1","score":"1","tags":"angularjs","view_count":"17"} +{"id":"17769385","title":"How to adjust table size to correspond to the media screen size?","body":"\u003cp\u003eI'm having difficulties adjusting my tables to fit media screen sizes. The layout as it is now adjusts its content via media queries. In effect, there is no need for a scroll bar. \u003c/p\u003e\n\n\u003cp\u003eHere's some code...\u003c/p\u003e\n\n\u003cp\u003e(1) The HTML:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div id=\"results\"\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eYa, it's really simple. This tag actually resides in a few other divs that hold content. This particular div holds content that is sent from the server when a request is made. It responds properly when plain text is the content, but tables cause an issue.\u003c/p\u003e\n\n\u003cp\u003eHere's my CSS code...\u003c/p\u003e\n\n\u003cp\u003e(1) The CSS for \u003ccode\u003e#results\u003c/code\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ediv#results {\n width: 90%;\n margin: 0 auto;\n margin-top: 30px;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e(2) The CSS for tables:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etable {\n font-family: 'PT Sans', Arial, sans-serif; \n color: #666;\n font-size: 12px;\n text-shadow: 1px 1px 0px #fff;\n background: #eaebec;\n margin: 20px;\n border: #ccc 1px solid;\n width: 80%;\n margin: 0 auto;\n}\n\ntable th {\n padding: 21px 25px 22px 25px;\n border-top: 1px solid #fafafa;\n border-bottom: 1px solid #e0e0e0;\n background: #ededed;\n}\n\ntable th:first-child {\n text-align: left;\n padding-left:20px;\n}\n\ntable tr {\n text-align: center;\n padding-left: 20px;\n}\n\ntable td:first-child {\n text-align: left;\n padding-left: 20px;\n border-left: 0px;\n}\n\ntable td {\n padding:8px;\n border-top: 1px solid #ffffff;\n border-bottom:1px solid #e0e0e0;\n border-left: 1px solid #e0e0e0;\n background: #fafafa;\n}\n\ntable tr:hover td {\n background: #f2f2f2;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe table remains the same size regardless of media screen size. The CSS probably makes that obvious. However, what can be done in this case? If I \"squish\" the table, the content will be illegible. For instance, if I want to pull up a table on a smartphone, how can I modify the table so that it is usable? Right now I have 5 columns. Is there a way to possible start a new row, say after two or three columns, in order that the content doesn't have to be compressed?\u003c/p\u003e\n\n\u003cp\u003eThat's the basic idea; I hope that the crux of what I am saying is clear. Any input is appreciated.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-07-21 05:28:09.603 UTC","last_activity_date":"2013-07-21 07:47:21.507 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1599549","post_type_id":"1","score":"0","tags":"html|css|table","view_count":"1064"} +{"id":"23580250","title":"When using Entity Framework Code First Approach there is one additional table","body":"\u003cp\u003eI'm using Entity Framework code first approach to create mydatabase. I've got four simple classes: \u003c/p\u003e\n\n\u003cp\u003eMy first class is Category: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class Category\n{\n [Key]\n public int CategoryId { set; get; } \n public DateTime CreatedOn { set; get; } \n public int? ParentCategoryId { set; get; } \n public virtual ICollection\u0026lt;Product\u0026gt; Products { set; get; } \n public virtual ICollection\u0026lt;CategoryLanguage\u0026gt; CategoriesLanguages { set; get; } \n public Category()\n {\n this.Products = new HashSet\u0026lt;Product\u0026gt;();\n this.CategoriesLanguages = new HashSet\u0026lt;CategoryLanguage\u0026gt;();\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy Second class -CategoryLanguage.cs\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class CategoryLanguage\n{\n [Key]\n public int Id { set; get; } \n [Required]\n public string Title { set; get; } \n public int CategoryId { set; get; } \n public virtual Category Category { set; get; } \n public int LanguageId { set; get; }\n public virtual Language Language { set; get; }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy third class - Product.cs \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class Product\n{ \n [Key]\n public int ProductId { set; get; }\n public decimal Price { set; get; }\n public int Quantity { set; get; }\n public string Image { set; get; }\n public virtual ICollection\u0026lt;Category\u0026gt; Categories { set; get; }\n public virtual ICollection\u0026lt;ProductLanguage\u0026gt; ProductLanguages { set; get; }\n public Product()\n {\n this.Categories = new HashSet\u0026lt;Category\u0026gt;();\n this.ProductLanguages = new HashSet\u0026lt;ProductLanguage\u0026gt;();\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand my last class \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class ProductLanguage\n{\n [Key]\n public int Id { set; get; }\n public int ProductId { set; get; }\n public virtual Product Product { set; get; }\n public int LanguageId { set; get; }\n public virtual Language Language { get; get; }\n public string Name { set; get; }\n public string ShortDescription { set; get; }\n public string Description { set; get; }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is my DbContext\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class EcommerceDBContext:DbContext\n{\n public EcommerceDBContext() : base(\"DefaultConnection\"){}\n public DbSet\u0026lt;Category\u0026gt; Categories { set; get; }\n public DbSet\u0026lt;CategoryLanguage\u0026gt; CategoriesLanguages { set; get; }\n public DbSet\u0026lt;Product\u0026gt; Products { set; get; }\n public DbSet\u0026lt;ProductLanguage\u0026gt; ProductsLanguages { set; get; }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt's curious that in my database I see another table, \u003ccode\u003eProductCategories\u003c/code\u003e with two columns: \u003ccode\u003eProduct_ProductID\u003c/code\u003e and \u003ccode\u003eCategory_CategoryID\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eSo it's true that \u003ccode\u003eProduct\u003c/code\u003e table and \u003ccode\u003eCategories\u003c/code\u003e table have many-to-many relationship and it's also true that I'm using lazy loading to be able to load all the products for \u003ccode\u003eCategory\u003c/code\u003e; and all the categories for product. I'm just curious how code-first engine decides to make this table. (after all the collections are virtual and they should not exist in the database).\u003c/p\u003e","accepted_answer_id":"23580435","answer_count":"2","comment_count":"0","creation_date":"2014-05-10 11:06:04.483 UTC","last_activity_date":"2014-05-10 12:06:41.99 UTC","last_edit_date":"2014-05-10 11:37:34.18 UTC","last_editor_display_name":"","last_editor_user_id":"1945631","owner_display_name":"","owner_user_id":"2015480","post_type_id":"1","score":"0","tags":"entity-framework|ef-code-first","view_count":"699"} +{"id":"35376135","title":"How to use charAt to find the location of a char in a string","body":"\u003cp\u003eSo I didn't want to use the ascii table to do this. I want to make the user input an alphanumeric(eg A3) and then take the alphabet(A) and find it in the string ABC so itll give me a number between 1-9 instead of having the ascii values. This will make it easier for me to put in a 2d array later.\u003c/p\u003e\n\n\u003cp\u003eHowever when I use System.out.println(abc.charAt(row)); itll say its out of bound bexception because its using the ascii value. How can I make it so that it doesn't\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public static void main(String[]args){\n Scanner k = new Scanner(System.in);\n String abc = \"ABCDEFGHIJ\";\n String ab = \"abcdefghij\";\n abc.equals(ab);\n System.out.println(\"Please enter the attack location:\");\n\n while (!k.hasNext(\"[A-J a-j]+[0-9]\")) {\n System.out.println(\"Wrong\");\n k.next();\n }\n\n String location = k.next();\n char row = location.charAt(0);\n int num = (int) location.charAt(1);\n System.out.println(abc.charAt(row));\n}\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"35376163","answer_count":"1","comment_count":"1","creation_date":"2016-02-13 04:37:42.83 UTC","last_activity_date":"2016-02-13 04:55:47.423 UTC","last_edit_date":"2016-02-13 04:38:57.25 UTC","last_editor_display_name":"","last_editor_user_id":"992484","owner_display_name":"","owner_user_id":"5886011","post_type_id":"1","score":"0","tags":"java","view_count":"153"} +{"id":"33978831","title":"Matplotlib multi-colored title","body":"\u003cp\u003eI am looking for a simple way to create a title for a figure in which some words have distinct colors. \nSo far, I have been attempting to use:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efig.text(0.35,0.85,'Black text', color=\"black\")\nfig.text(0.45,0.85,'Red text', color=\"red\")\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe problem is that I have to establish the center character of the whole string and calculate the x-coordinates accordingly, which is time-consuming. \u003c/p\u003e\n\n\u003cp\u003eI wish I could write the whole string in one line of code; something like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efig.text(.5, .85, ['Black text', 'Red text'], color = ['black', 'red'])\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOr if I could create a variable for each color of code and string them together under fig.text or plt.title, that would be great. \u003c/p\u003e\n\n\u003cp\u003eAny ideas?\u003c/p\u003e\n\n\u003cp\u003eEven a way to display the pixel coordinates of each word in an existing title would help with the method I'm currently using.\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2015-11-29 02:40:49.64 UTC","favorite_count":"1","last_activity_date":"2015-11-30 07:56:36.343 UTC","last_edit_date":"2015-11-30 07:56:36.343 UTC","last_editor_display_name":"","last_editor_user_id":"4099593","owner_display_name":"","owner_user_id":"4392566","post_type_id":"1","score":"1","tags":"python|python-3.x|matplotlib","view_count":"51"} +{"id":"20831216","title":"WinRT StaticResource from ViewModel in referenced Assembly","body":"\u003cp\u003eI am in the process of porting one of our iOS applications to Windows 8/8.1. Using the MVVM design pattern I have created a ViewModel for one of the Pages to use. Similar to our WebApp the Windows application separates the layers by grouping relevant objects in Class Libraries. There is a Business/Model Layer (I will reference this as App.BLL) and a Data Access Layer (I will reference this as App.Data).\u003c/p\u003e\n\n\u003cp\u003eApp references App.BLL, and App.BLL references App.Data. App.BLL contains a namespace called Items, which contains a Class ItemsViewModel. ItemsViewModel contains a ObservableCollection Items. When ItemsViewModels' constructor is called, it sets Items by calling a method contained in App.Data (List LoadItems()).\u003c/p\u003e\n\n\u003cp\u003eThe issue I have been pulling my hair out over is, the designer is displaying an error on as seen below. \u003c/p\u003e\n\n\u003cp\u003e\"Error 3 Type universe cannot resolve assembly: App.Data, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.\"\u003c/p\u003e\n\n\u003cp\u003eI imagine this is due to App.BLL having a reference to App.Data, where App does not reference App.Data. I have also tried explicitly defining the assembly of xmlns:model (xmlns:model=\"using:App.BLL.Items;assembly=App.BLL\"). \u003c/p\u003e\n\n\u003cp\u003eThis only leads to a separate error while in the designer only.\u003c/p\u003e\n\n\u003cp\u003eError 7 Assembly 'App.BLL' was not found. Verify that you are not missing an assembly reference. Also, verify that your project and all referenced assemblies have been built.\u003c/p\u003e\n\n\u003cp\u003eIf the designer is closed the first error mentioned is gone (when defining the assembly), and is replaced by:\u003c/p\u003e\n\n\u003cp\u003eError 6 Unknown type 'ItemsViewModel' in XML namespace 'using:App.BLL.Products;assembly=App.BLL'\u003c/p\u003e\n\n\u003cp\u003eHowever, it does exist.\u003c/p\u003e\n\n\u003cpre class=\"lang-cs prettyprint-override\"\u003e\u003ccode\u003enamespace App.BLL.Items\n{\n public class ItemsViewModel : IItemInterface\n {\n public ObservableCollection\u0026lt;Item\u0026gt; Items\n {\n get;\n private set;\n }\n public ItemsViewModel()\n {\n Items = Item.GetItems();\n }\n\n private Item _selectedItem;\n public Item SelectedItem\n {\n get\n {\n return _selectedItem;\n }\n set\n {\n _selectedItem = value;\n OnItemSelected(_selectedItem);\n }\n }\n private RelayCommand\u0026lt;Item\u0026gt; _itemSelected;\n public RelayCommand\u0026lt;Item\u0026gt; ItemSelected\n {\n get\n {\n return _itemSelected ??\n (_itemSelected = new RelayCommand\u0026lt;Item\u0026gt;(item =\u0026gt;\n {\n SelectedItem = item;\n //Notify Item Selected\n }));\n }\n }\n public event ItemSelectedEventHandler ItemSelectedChanged;\n protected virtual void OnItemSelected(Item selectedItem)\n {\n ItemSelectedChanged(this, new ItemChangedEventArgs(selectedItem));\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAt this point I could not care less about the designer error's, as they go away while it is closed so it seems that at Runtime it would work. However with Error 6 above I can not compile.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;Page\n x:Class=\"App.ItemsPage\"\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n xmlns:local=\"using:App\"\n xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n xmlns:model=\"using:App.BLL.Items\"\n mc:Ignorable=\"d\"\u0026gt;\n \u0026lt;Page.Resources\u0026gt;\n \u0026lt;model:ItemsViewModel x:Key=\"ItemSource\" /\u0026gt;\n \u0026lt;/Page.Resources\u0026gt;\n\u0026lt;Grid DataContext=\"{Binding Source={StaticResource ItemSource}}\" /\u0026gt;\n\u0026lt;/Page\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have looked around the web all day before asking a question here, I hope I provided everything needed to help in finding a solution.\u003c/p\u003e\n\n\u003cp\u003eEdit: I can't for the life of me get this formatted correctly. I will keep working on it, but if someone could edit that would be ok also.\u003c/p\u003e","answer_count":"0","comment_count":"9","creation_date":"2013-12-29 23:25:12.223 UTC","favorite_count":"1","last_activity_date":"2013-12-30 00:06:11.27 UTC","last_edit_date":"2013-12-29 23:31:37.273 UTC","last_editor_display_name":"","last_editor_user_id":"1013983","owner_display_name":"","owner_user_id":"1013983","post_type_id":"1","score":"0","tags":"c#|xaml|mvvm|windows-runtime|windows-store-apps","view_count":"337"} +{"id":"18359383","title":"Cordova Android - Application has stopped unexpectedly, Please try again","body":"\u003cp\u003eI am trying to get contacts of the device using cordova 2.2 version. When i run application in the emulator , it shows application has stopped unexpectedly. The logcat shows following errors.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e08-21 19:04:27.999: E/AndroidRuntime(4650): FATAL EXCEPTION: main\n08-21 19:04:27.999: E/AndroidRuntime(4650): java.lang.SecurityException: \n ConnectivityService: Neither user 10035 nor current process has android.permission.ACCESS_NETWORK_STATE.\n08-21 19:04:27.999: E/AndroidRuntime(4650): at android.os.Parcel.readException(Parcel.java:1322)\n08-21 19:04:27.999: E/AndroidRuntime(4650): at android.os.Parcel.readException(Parcel.java:1276)\n\n08-21 19:04:27.999: E/AndroidRuntime(4650): at android.net.IConnectivityManager$Stub$Proxy.getActiveNetworkInfo(IConnectivityManager.java:345)\n\n08-21 19:04:27.999: E/AndroidRuntime(4650): at android.net.ConnectivityManager.getActiveNetworkInfo(ConnectivityManager.java:251)\n\n08-21 19:04:27.999: E/AndroidRuntime(4650): at org.apache.cordova.NetworkManager.execute(NetworkManager.java:127)\n\n08-21 19:04:27.999: E/AndroidRuntime(4650): at org.apache.cordova.api.CordovaPlugin.execute(CordovaPlugin.java:61)\n\n08-21 19:04:27.999: E/AndroidRuntime(4650): at org.apache.cordova.api.PluginManager.exec(PluginManager.java:224)\n08-21 19:04:27.999: E/AndroidRuntime(4650): at org.apache.cordova.ExposedJsApi.exec(ExposedJsApi.java:43)\n\n08-21 19:04:27.999: E/AndroidRuntime(4650): at org.apache.cordova.CordovaChromeClient.onJsPrompt(CordovaChromeClient.java:213)\n\n08-21 19:04:27.999: E/AndroidRuntime(4650): at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:566)\n08-21 19:04:27.999: E/AndroidRuntime(4650): at android.os.Handler.dispatchMessage(Handler.java:99)\n\n08-21 19:04:27.999: E/AndroidRuntime(4650): at android.os.Looper.loop(Looper.java:123)\n\n08-21 19:04:27.999: E/AndroidRuntime(4650): at android.app.ActivityThread.main(ActivityThread.java:3683)\n\n08-21 19:04:27.999: E/AndroidRuntime(4650): at java.lang.reflect.Method.invokeNative(Native Method)\n\n08-21 19:04:27.999: E/AndroidRuntime(4650): at java.lang.reflect.Method.invoke(Method.java:507)\n\n08-21 19:04:27.999: E/AndroidRuntime(4650): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)\n\n08-21 19:04:27.999: E/AndroidRuntime(4650): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)\n\n08-21 19:04:27.999: E/AndroidRuntime(4650): at dalvik.system.NativeStart.main(Native Method)\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"18360033","answer_count":"1","comment_count":"0","creation_date":"2013-08-21 13:55:41.053 UTC","last_activity_date":"2013-08-21 14:21:37.847 UTC","last_edit_date":"2013-08-21 14:17:04.717 UTC","last_editor_display_name":"","last_editor_user_id":"236247","owner_display_name":"","owner_user_id":"1685613","post_type_id":"1","score":"0","tags":"cordova","view_count":"594"} +{"id":"34553882","title":"Get values from ArrayList in DnnUsers","body":"\u003cp\u003eI have following \u003ccode\u003eArrayList\u003c/code\u003e ..\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eRoleController objRoleController = new RoleController();\n\nArrayList UserList = objRoleController.GetUsersByRoleName(PortalSettings.PortalId, \"Client\");\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI just want to fetch UserId and Display Name from UserList..What should i do???\u003c/p\u003e","accepted_answer_id":"34568104","answer_count":"3","comment_count":"1","creation_date":"2016-01-01 05:52:28.327 UTC","last_activity_date":"2017-03-24 21:17:51.973 UTC","last_edit_date":"2017-03-24 21:16:54.44 UTC","last_editor_display_name":"","last_editor_user_id":"5836671","owner_display_name":"","owner_user_id":"5576528","post_type_id":"1","score":"1","tags":"c#|dotnetnuke","view_count":"55"} +{"id":"18600668","title":"Overriding SilverStripe 3 CommentsInterface.ss","body":"\u003cp\u003eI've installed the comments module for my SS 3.0 blog and it's working.\u003c/p\u003e\n\n\u003cp\u003eBut I want to override the CommentsInterface.ss template and I can't figure out where to put the overriding file. I've tried in themes/mytheme/template and themes/mytheme/templates/Includes and neither seem to work.\u003c/p\u003e\n\n\u003cp\u003eThis should not be hard, so I must be missing something easy.\u003c/p\u003e\n\n\u003cp\u003eClues?\u003c/p\u003e\n\n\u003cp\u003eBob\u003c/p\u003e","accepted_answer_id":"18602502","answer_count":"2","comment_count":"0","creation_date":"2013-09-03 20:11:21.75 UTC","last_activity_date":"2013-09-04 18:15:08.183 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1938118","post_type_id":"1","score":"0","tags":"comments|blogs|silverstripe","view_count":"88"} +{"id":"11782766","title":"Trigonometric functions in R","body":"\u003cp\u003eI have a data.frame which contain a series of values, Xg, to which I am applying trigonometric functions to create a new column in the data.frame called \"angle\":\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edt$angle \u0026lt;- sin(asin(dt$Xg / 9.8))\ndt$angle \u0026lt;- asin(dt$angle)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever when I apply the second line of code here it's not giving me the correct values, which I can work out using a calculator that are wrong.\nIs this code applying the arcsine function to each data point individually or am I missing something?\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2012-08-02 17:31:44.697 UTC","last_activity_date":"2012-08-02 18:35:45.217 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1517860","post_type_id":"1","score":"0","tags":"r|dataframe|trigonometry","view_count":"313"} +{"id":"27333543","title":"Unity 3D - Too many errors","body":"\u003cp\u003eTwo scripts are generating these errors by the looks of it, they are listed below:\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003e-------------------------------\u003c/strong\u003e\n\u003cstrong\u003eGameInformation - Coding listed below:\u003c/strong\u003e\n\u003cstrong\u003e-------------------------------\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eusing UnityEngine;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eusing System.Collections;\u003c/p\u003e\n\n\u003cp\u003epublic class GameInformation : MonoBehaviour {\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evoid Awake(){\n DontDestroyOnLoad (transform.gameObject);\n}\n\npublic static string PlayerName{ get; set; }\npublic static int PlayerLevel{ get; set; }\npublic static BaseCharacterClass PlayerClass{ get; set; }\npublic static int Speed{ get; set; }\npublic static int Endurance{ get; set; }\npublic static int Strength{ get; set; }\npublic static int Health{ get; set; }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003e-------------------------------\u003c/strong\u003e\n \u003cstrong\u003eThe other script is SaveInformation:\u003c/strong\u003e\n\u003cstrong\u003e-------------------------------\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eusing UnityEngine;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eusing System.Collections;\u003c/p\u003e\n\n\u003cp\u003epublic class SaveInformation {\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic static void SaveAllInformation(){\n PlayerPrefs.SetInt(\"PLAYERLEVEL\", GameInformation.PlayerLevel);\n PlayerPrefs.SetString(\"PLAYERNAME\", GameInformation.PlayerName);\n PlayerPrefs.SetString(\"SPEED\", GameInformation.Speed);\n PlayerPrefs.SetString(\"ENDURANCE\", GameInformation.Endurance);\n PlayerPrefs.SetString(\"STRENGTH\", GameInformation.Strength);\n PlayerPrefs.SetString(\"HEALTH\", GameInformation.Health);\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e}\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003e-------------------------------\u003c/strong\u003e\n\u003cstrong\u003eErrors :\u003c/strong\u003e\n\u003cstrong\u003e-------------------------------\u003c/strong\u003e\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eAssets/Standard\n Assets/Scripts/SavingAndLoading/SaveInformation.cs(7,67): error\n CS0117: \u003ccode\u003eGameInformation' does not contain a definition for\n \u003c/code\u003ePlayerLevel'\u003c/p\u003e\n \n \u003cp\u003eAssets/Standard\n Assets/Scripts/SavingAndLoading/SaveInformation.cs(7,29): error\n CS1502: The best overloaded method match for\n `UnityEngine.PlayerPrefs.SetInt(string, int)' has some invalid\n arguments\u003c/p\u003e\n \n \u003cp\u003eAssets/Standard\n Assets/Scripts/SavingAndLoading/SaveInformation.cs(7,29): error\n CS1503: Argument \u003ccode\u003e#2' cannot convert\u003c/code\u003eobject' expression to type `int'\u003c/p\u003e\n \n \u003cp\u003eAssets/Standard\n Assets/Scripts/SavingAndLoading/SaveInformation.cs(8,69): error\n CS0117: \u003ccode\u003eGameInformation' does not contain a definition for\n \u003c/code\u003ePlayerName'\u003c/p\u003e\n \n \u003cp\u003eAssets/Standard\n Assets/Scripts/SavingAndLoading/SaveInformation.cs(8,29): error\n CS1503: Argument \u003ccode\u003e#2' cannot convert\u003c/code\u003eobject' expression to type\n `string'\u003c/p\u003e\n \n \u003cp\u003eAssets/Standard\n Assets/Scripts/SavingAndLoading/SaveInformation.cs(9,64): error\n CS0117: \u003ccode\u003eGameInformation' does not contain a definition for\u003c/code\u003eSpeed'\u003c/p\u003e\n \n \u003cp\u003eAssets/Standard\n Assets/Scripts/SavingAndLoading/SaveInformation.cs(9,29): error\n CS1502: The best overloaded method match for\n `UnityEngine.PlayerPrefs.SetString(string, string)' has some invalid\n arguments\u003c/p\u003e\n \n \u003cp\u003eAssets/Standard\n Assets/Scripts/SavingAndLoading/SaveInformation.cs(9,29): error\n CS1503: Argument \u003ccode\u003e#2' cannot convert\u003c/code\u003eobject' expression to type\n `string'\u003c/p\u003e\n \n \u003cp\u003eAssets/Standard\n Assets/Scripts/SavingAndLoading/SaveInformation.cs(10,68): error\n CS0117: \u003ccode\u003eGameInformation' does not contain a definition for\n \u003c/code\u003eEndurance'\u003c/p\u003e\n \n \u003cp\u003eAssets/Standard\n Assets/Scripts/SavingAndLoading/SaveInformation.cs(10,29): error\n CS1502: The best overloaded method match for\n `UnityEngine.PlayerPrefs.SetString(string, string)' has some invalid\n arguments\u003c/p\u003e\n \n \u003cp\u003eAssets/Standard\n Assets/Scripts/SavingAndLoading/SaveInformation.cs(10,29): error\n CS1503: Argument \u003ccode\u003e#2' cannot convert\u003c/code\u003eobject' expression to type\n `string'\u003c/p\u003e\n \n \u003cp\u003eAssets/Standard\n Assets/Scripts/SavingAndLoading/SaveInformation.cs(11,67): error\n CS0117: \u003ccode\u003eGameInformation' does not contain a definition for\u003c/code\u003eStrength'\u003c/p\u003e\n \n \u003cp\u003eAssets/Standard\n Assets/Scripts/SavingAndLoading/SaveInformation.cs(11,29): error\n CS1502: The best overloaded method match for\n `UnityEngine.PlayerPrefs.SetString(string, string)' has some invalid\n arguments\u003c/p\u003e\n \n \u003cp\u003eAssets/Standard\n Assets/Scripts/SavingAndLoading/SaveInformation.cs(11,29): error\n CS1503: Argument \u003ccode\u003e#2' cannot convert\u003c/code\u003eobject' expression to type\n `string'\u003c/p\u003e\n \n \u003cp\u003eAssets/Standard\n Assets/Scripts/SavingAndLoading/SaveInformation.cs(12,65): error\n CS0117: \u003ccode\u003eGameInformation' does not contain a definition for\u003c/code\u003eHealth'\u003c/p\u003e\n \n \u003cp\u003eAssets/Standard\n Assets/Scripts/SavingAndLoading/SaveInformation.cs(12,29): error\n CS1502: The best overloaded method match for\n `UnityEngine.PlayerPrefs.SetString(string, string)' has some invalid\n arguments\u003c/p\u003e\n \n \u003cp\u003eAssets/Standard\n Assets/Scripts/SavingAndLoading/SaveInformation.cs(12,29): error\n CS1503: Argument \u003ccode\u003e#2' cannot convert\u003c/code\u003eobject' expression to type\n `string'\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003e\u003cstrong\u003e-------------------------------\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003ePlease keep in mind when replying that I am rather new to coding. Thanks!\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003e-------------------------------\u003c/strong\u003e\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-12-06 16:07:25.37 UTC","favorite_count":"1","last_activity_date":"2014-12-06 19:13:44.377 UTC","last_edit_date":"2014-12-06 16:26:12.87 UTC","last_editor_display_name":"","last_editor_user_id":"4330830","owner_display_name":"","owner_user_id":"4330830","post_type_id":"1","score":"-5","tags":"c#|unity3d","view_count":"547"} +{"id":"33984095","title":"How to get validation correct according to Radio Button","body":"\u003cpre\u003e\u003ccode\u003e\u003cdiv class=\"snippet\" data-lang=\"js\" data-hide=\"false\"\u003e\r\n\u003cdiv class=\"snippet-code\"\u003e\r\n\u003cpre class=\"snippet-code-js lang-js prettyprint-override\"\u003e\u003ccode\u003e$(document).ready(function(){\r\n var form = $(\"#Form-3\");\r\n var FName = $(\"#fname\"); //Creates Variables for elements in form\r\n var Tele = $(\"#tele\"); \r\n var Address = $(\"#address\");\r\n var Email = $(\"#email\");\r\n var Credit = $(\"#Card\")\r\n var regexp = /^[a-zA-Z0-9]+[a-zA-Z0-9_.-]+[a-zA-Z0-9_.-]+@[a-zA-Z0-9]+[a-zA-Z0-9.-]+[a-zA-Z0-9.]+.[a-z]{2,4}$/; //ragex code- used to validate email \r\n \r\n\r\n \r\n FName.blur(validateFName); //blur is a method which attaches a functiom to run when an event occurs\r\n Email.blur(validateEmail); \r\n Tele.blur(validateTele);\r\n Address.blur(validateAddress);\r\n Credit.blur(validateCard);\r\n \r\n\r\n form.submit (function(){\r\n \r\n if (validateFName() \u0026amp; validateTele() \u0026amp; validateEmail() \u0026amp; validateAddress() \u0026amp; validateCard()){ //If it passes all of these then return true \r\n \r\n return true; \r\n }\r\n else {\r\n return false; \r\n }\r\n\r\n \r\n });\r\n function validateCard(){ //Validates Credit Card \r\n var Visa = /^(?:4[0-9]{12}(?:[0-9]{3})?)$/; //Ragex code for Credit Cards \r\n var MasterCard = /^(?:5[1-5][0-9]{14})$/; \r\n var CC = Credit.val();\r\n \r\n $(\"#Visa\").click(function() { //Tick Radio Button\r\n $(\"#Card\").show(); \r\n if (Visa.test(CC) ){ // If user input is equal to both Visa Or Mastercard Then Valid \r\n document.getElementById(\"CardError\").textContent =\"\";\r\n return true;\r\n }\r\n }); \r\n \r\n $(\"#Master\").click(function() { //Checks MasterCard button. \r\n $(\"#Card\").show();\r\n if(MasterCard.test(CC)){\r\n document.getElementById(\"CardError\").textContent =\"\"; //Display Error\r\n return true;\r\n } \r\n else {\r\n document.getElementById(\"CardError\").textContent =\"Please Ensure Card Detail Is Correct\"; //Display Error\r\n return false;\r\n }\r\n});\r\n}\r\n\r\n});\r\n \u003c/code\u003e\u003c/pre\u003e\r\n\u003cpre class=\"snippet-code-html lang-html prettyprint-override\"\u003e\u003ccode\u003e \u0026lt;label for=\"Card\"\u0026gt;Credit Card (16 Digit Number)\u0026lt;/label\u0026gt;\r\n \u0026lt;br/\u0026gt;\r\n \u0026lt;input type=\"radio\" id=\"Visa\" name=\"Type1\"\u0026gt;\r\n \u0026lt;label\u0026gt;Visa\u0026lt;/label\u0026gt;\r\n \u0026lt;br/\u0026gt;\r\n \u0026lt;input type=\"radio\" id=\"Master\" name=\"Type1\"\u0026gt;\r\n \u0026lt;label\u0026gt;MasterCard\u0026lt;/label\u0026gt;\r\n \u0026lt;input id=\"Card\" name=\"Card\" type=\"text\" hidden=\"true\" /\u0026gt;\r\n \u0026lt;label id=\"CardError\"\u0026gt;\u0026lt;/label\u0026gt;\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/div\u003e\r\n\u003c/div\u003e\r\n\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn here I have two radio Buttons one for Visa Card and the other for MasterCard I want it that when user clicks on visa radio button only visa validation works and not Mastercard number vice versa, right now nothing is happening, however I can it get it to when the user clicks on Visa or Mastercard both validation apply i.e. Visa validation works when Mastercard radio buton is chosen. How can I specifically set it to one form of validation?\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2015-11-29 14:51:12.13 UTC","last_activity_date":"2015-11-29 15:38:48.573 UTC","last_edit_date":"2015-11-29 15:38:48.573 UTC","last_editor_display_name":"","last_editor_user_id":"4381637","owner_display_name":"","owner_user_id":"4381637","post_type_id":"1","score":"0","tags":"javascript|jquery|html","view_count":"41"} +{"id":"43801199","title":"How can I integrate a Qt Virtual Keyboard with PyQt 5.8?","body":"\u003cp\u003eI am using PyQt5.8 on a raspberry Pi 3, my application had a login form. So how can i prompt a virtual keyboard when user touchs one of the form fields in the touchscreen?\u003c/p\u003e\n\n\u003cp\u003eI tried \u003ca href=\"http://code.activestate.com/recipes/579118-pyqt-touch-input/\" rel=\"nofollow noreferrer\"\u003ethis\u003c/a\u003e but it does not working with pyQt5 after porting it (it work fine with pyQt4), making the cursor in the field does not prompt the virtual keyboard.\u003c/p\u003e\n\n\u003cp\u003eBest regards!\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-05-05 09:22:32.467 UTC","last_activity_date":"2017-05-26 00:59:48.46 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4940053","post_type_id":"1","score":"1","tags":"qt|keyboard|pyqt5|raspberry-pi3","view_count":"272"} +{"id":"10814428","title":"OnActivityResult is not calling in TabGroupActivity","body":"\u003cp\u003eI have an tabactivity with four tabs \u003c/p\u003e\n\n\u003cp\u003eHome-\u003eTab1-\u003eActivity1-\u003eActivity2\u003cimg src=\"https://i.stack.imgur.com/Zvkn1.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eIn Activity2 I have a text box. When I click textbox I am showing CalenderActivity like below\n \u003cimg src=\"https://i.stack.imgur.com/RUoLc.png\" alt=\"activity2\"\u003e\u003c/p\u003e\n\n\u003cp\u003eWhen click date it has to display the date in text box; for that I write onActivityResult in Activity3 but that is not calling. What do I have to do to display date in textbox? I am using TabGroupActivity to navigate between activities in a single tab...\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2012-05-30 10:24:54.887 UTC","last_activity_date":"2013-12-06 11:16:23.963 UTC","last_edit_date":"2013-12-06 11:16:14.493 UTC","last_editor_display_name":"","last_editor_user_id":"759866","owner_display_name":"","owner_user_id":"1237073","post_type_id":"1","score":"0","tags":"android|tabs|activitygroup","view_count":"295"} +{"id":"44781199","title":"MobileFirst 7.1 javascript adapter - how to read clob data?","body":"\u003cpre\u003e\u003ccode\u003efunction getUser(userId) {\n\n var obj = {};\n\n var resultSet = WL.Server.invokeSQLStatement({\n preparedStatement: getUserSQL,\n parameters: [userId]\n });\n\n obj = {\n name: result.resultSet[0]['NAME'],\n image: result.resultSet[0]['IMAGE'] // ???\n }\n\n return obj;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis returns clob.toString. I need to get the string (32K) from CLOB, how can I do this?\u003c/p\u003e","accepted_answer_id":"44892019","answer_count":"1","comment_count":"0","creation_date":"2017-06-27 13:11:36.417 UTC","favorite_count":"1","last_activity_date":"2017-07-03 18:33:32.39 UTC","last_edit_date":"2017-06-27 13:16:47.22 UTC","last_editor_display_name":"","last_editor_user_id":"8220654","owner_display_name":"","owner_user_id":"8220654","post_type_id":"1","score":"1","tags":"javascript|ibm-mobilefirst|mobilefirst-adapters|mobilefirst-server","view_count":"69"} +{"id":"32759185","title":"Print only first and last line that contains a key word in C","body":"\u003cp\u003eI start learning C last week and even the simple tasks can be a challenge for me. Currently I am facing this problem: I have a txt file with many lines, each of them starting with a key word (NMEA format for those who know it):\n\u003c/p\u003e\n\n\u003cpre class=\"lang-none prettyprint-override\"\u003e\u003ccode\u003e$GPGGA,***001430.00***,.......\n\n$GPRMC,001430.00,.......\n\n$GPGSV,................ 1st time the message arrives\n\n$GPGSA,................\n\n\n----------\n\n\n$GPGGA,***005931.00***,...............\n\n$GPRMC,005931.00,............... last time \n\n$GPGSV,.........................\n\n$GPGSA,.........................\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to extract the time stamp for the last occurrance of $GPGGA line. Till now I was able just to extract the first and the very last line of the file (unfortunately the last line is not the GPGGA message). I tried to look in the file for the key word \u003cstrong\u003e\u003cem\u003e$GPGGA\u003c/em\u003e\u003c/strong\u003e and then to sscanf the string from a specific byte and store the value in some variables(hour,min,sec).\u003c/p\u003e\n\n\u003cp\u003eAny suggestion would be greatly appreciated. Thank you very much for your time and help.\u003c/p\u003e\n\n\u003cp\u003eHere is my code:\n\u003c/p\u003e\n\n\u003cpre class=\"lang-c prettyprint-override\"\u003e\u003ccode\u003eentint main(int argc, char **argv) { \n FILE *opnmea;\n char first[100], last[100]; //first and last time the message arrives\n int hour,min;\n float sec; // time of observation\n char year[4], month[2], day[2]; // date of obs campaign\n char time[7];\n\n opnmea = fopen(argv[1], \"r\"); \n if (opnmea != NULL ) {\n fgets(first, 100, opnmea); // read only first line of the file\n if (strstr(first, \"$GPGGA\") != NULL)\n {\n sscanf(first + 7, \"%2d%2d%f\", \u0026amp;hour, \u0026amp;min, \u0026amp;sec);\n printf(\"First arrival of stream: %d%d%f \\n\", hour, min, sec);\n }\n fseek(opnmea, 0, SEEK_SET);\n while (!feof(opnmea)) {\n if (strstr(first, \"$GPGGA\") != NULL) {\n memset(last, 0x00, 100); // clean buffer\n fscanf(opnmea, \"%s\\n\", last); \n }\n }\n printf(\"Last arrival of stream: %s\\n\", last);\n fclose(opnmea);\n }\n else\n {\n printf(\"\\nfile %s not found\", argv[1]);\n }\n return 0;\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"32762162","answer_count":"1","comment_count":"12","creation_date":"2015-09-24 10:35:42.323 UTC","last_activity_date":"2015-09-24 14:41:57.873 UTC","last_edit_date":"2015-09-24 10:46:39.82 UTC","last_editor_display_name":"","last_editor_user_id":"1983495","owner_display_name":"","owner_user_id":"5358474","post_type_id":"1","score":"1","tags":"c|pointers|extract|keyword","view_count":"108"} +{"id":"23923326","title":"Importing HTML Data into JavaScript","body":"\u003cp\u003eI have a table in an HTML file set up as follows (this is only one line of the table)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;tr\u0026gt;\n \u0026lt;td class = \"numeric\"\u0026gt;0\u0026lt;/td\u0026gt;\n \u0026lt;td class = \"numeric\"\u0026gt;2\u0026lt;/td\u0026gt;\n \u0026lt;td class = \"numeric\"\u0026gt;3\u0026lt;/td\u0026gt;\n \u0026lt;td class = \"numeric\"\u0026gt;1\u0026lt;/td\u0026gt;\n \u0026lt;td class = \"numeric\"\u0026gt;4\u0026lt;/td\u0026gt;\n \u0026lt;td class = \"numeric\" id=\"city3\"\u0026gt; \u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand I need to write a script that will retrieve the numbers in the table so that I can total them up. Suffice to say I am completely stuck with how to retrieve the information. Any help is appreciated.\u003c/p\u003e","accepted_answer_id":"23923370","answer_count":"5","comment_count":"7","creation_date":"2014-05-28 23:10:23.59 UTC","last_activity_date":"2014-05-29 22:02:05.423 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3612412","post_type_id":"1","score":"0","tags":"javascript|html","view_count":"73"} +{"id":"14720245","title":"Select device monodroid manager doesn't see already running emulator image","body":"\u003cp\u003eSometimes, when I start debugging of android application in \u003ccode\u003eVisual Studio 2012\u003c/code\u003e I can't see emulator image in select device window:\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/twjRV.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003ebut emulator is already running:\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/WaSmK.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eThe thing is that the problem is not in my application code or project settings because when i select \u003ccode\u003eStart emulator image\u003c/code\u003e, and new android virtual device is running, my application deploys successfully and is running correctly on \u003cstrong\u003eNEW\u003c/strong\u003e virtual device, \u003cstrong\u003eBUT\u003c/strong\u003e it takes a lot of time to load this new virtual device image and deploy application on it. Why doesn't Select device manages see already running virtual device image?\u003c/p\u003e\n\n\u003cp\u003eP.S. I deploy the simplest hello world activity, which is created by default when I start new Android Application project in \u003ccode\u003eVisual Studio 2012\u003c/code\u003e\u003c/p\u003e","accepted_answer_id":"14723800","answer_count":"1","comment_count":"1","creation_date":"2013-02-06 01:45:56.04 UTC","last_activity_date":"2013-02-06 07:50:03.84 UTC","last_edit_date":"2013-02-06 02:02:23.69 UTC","last_editor_display_name":"","last_editor_user_id":"1346161","owner_display_name":"","owner_user_id":"1346161","post_type_id":"1","score":"1","tags":"c#|visual-studio-2012|xamarin.android","view_count":"1109"} +{"id":"30006631","title":"My JS script only highlights the option doesn't change it to the one I want in the box","body":"\u003cp\u003eSo my script doesn't change the the option in the drop-menu to the one I want it to be.\nHere is a fiddle:\n\u003ca href=\"https://jsfiddle.net/kerandom12/yzn3h96L/22/\" rel=\"nofollow\"\u003ehttps://jsfiddle.net/kerandom12/yzn3h96L/22/\u003c/a\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction add(){\n var array = document.getElementsByTagName(\"option\");\n for(i=0;i\u0026lt;array.length;i++){\n var item = array[i].innerHTML;\n if (item == 6.5) {\n document.getElementsByTagName(\"select\")[0].selectedIndex = i;\n return item;\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I run the code and click on the drop menu it only shows a 6.5 highlighted instead of being chosen and changed to that value.\nAny Idea why?\u003c/p\u003e\n\n\u003cp\u003eNEW FIDDLE:\n\u003ca href=\"https://jsfiddle.net/kerandom12/yzn3h96L/57/\" rel=\"nofollow\"\u003ehttps://jsfiddle.net/kerandom12/yzn3h96L/57/\u003c/a\u003e\u003c/p\u003e","answer_count":"0","comment_count":"9","creation_date":"2015-05-02 19:36:36.48 UTC","last_activity_date":"2015-05-03 06:57:02.44 UTC","last_edit_date":"2015-05-03 06:57:02.44 UTC","last_editor_display_name":"","last_editor_user_id":"4844572","owner_display_name":"","owner_user_id":"4844572","post_type_id":"1","score":"1","tags":"javascript|html","view_count":"34"} +{"id":"7872941","title":"Open online help in one session of HH","body":"\u003cp\u003eI'm creating an online help in CHM for my application.\u003c/p\u003e\n\n\u003cp\u003eTo open the help from the application on the appropriate page, I'm starting this kind of command:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ehh path/to/help_file.chm::/the_page_i_want.htm#the_section\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe problem is that if the user opens a first help dialog, then a second (from the application) he will end up with two help windows. I'd like the second link to be opened in the first window.\u003c/p\u003e\n\n\u003cp\u003eHow can I do that (is there another way than the plain call to \u003ccode\u003ehh\u003c/code\u003e)?\u003c/p\u003e","accepted_answer_id":"7886002","answer_count":"1","comment_count":"0","creation_date":"2011-10-24 08:26:29.36 UTC","favorite_count":"1","last_activity_date":"2011-10-25 07:30:28.58 UTC","last_edit_date":"2011-10-24 18:02:07.103 UTC","last_editor_display_name":"","last_editor_user_id":"168868","owner_display_name":"","owner_user_id":"149237","post_type_id":"1","score":"2","tags":"windows|chm|html-help","view_count":"53"} +{"id":"6302070","title":"internet explorer 8 extra div inserted","body":"\u003cp\u003eI am working on this site: \u003ca href=\"http://gitastudents.com/~clarkb/group1/Students.html\" rel=\"nofollow\"\u003ehttp://gitastudents.com/~clarkb/group1/Students.html\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eFor some reason it does not display properly in ie8.\nI think it i just miss-aligned div's but i cannot figure it out.\u003c/p\u003e\n\n\u003cp\u003eIe8 is showing an extra empty div where the java section should be and bumping the java down.\u003c/p\u003e\n\n\u003cp\u003eWhat can i do to fix this issue?\u003c/p\u003e\n\n\u003cp\u003eThanks in advance,\nBryan\u003c/p\u003e","accepted_answer_id":"6302335","answer_count":"1","comment_count":"2","creation_date":"2011-06-10 04:47:09.107 UTC","last_activity_date":"2011-06-10 05:27:47.297 UTC","last_edit_date":"2011-06-10 04:54:29.887 UTC","last_editor_display_name":"","last_editor_user_id":"672520","owner_display_name":"","owner_user_id":"672520","post_type_id":"1","score":"0","tags":"html|internet-explorer|layout|internet-explorer-8","view_count":"330"} +{"id":"46963393","title":"Semi-global Rails partial","body":"\u003cp\u003eIs there a better way to achieve what I'm going for?\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eI have a partial in the \u003ccode\u003e/views/shared/\u003c/code\u003e folder that has all the fields that are in a form being used to send an email.\u003c/li\u003e\n\u003cli\u003eA helper method with default options to render said partial (\u003ccode\u003erender partial: 'shared/email_fields' locals: locals\u003c/code\u003e where \u003ccode\u003elocals\u003c/code\u003e is a hash of default variables).\u003c/li\u003e\n\u003cli\u003eA helper method for every form sending an email that calls the above helper method and passes in either a \u003ccode\u003eFormBuilder\u003c/code\u003e object or a string containing the beginning of the \u003ccode\u003ename\u003c/code\u003e html attribute.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eThe problem I'm having: Most of the email forms differ slightly which results in me having to add additional options to the \u003ccode\u003elocals\u003c/code\u003e hash and I feel like the global partial is becoming bloated. Is there some way of using a global partial in this way such that the partial doesn't become super bloated?\u003c/p\u003e\n\n\u003cp\u003eI've thought of having each form completely separate but that's bad for upkeep and DRY. I've thought of passing in the name of a partial to be rendered inside the global partial but some of these forms need the same options and are rendered from different controllers and I wouldn't want to put a bunch of partials that aren't global in the \u003ccode\u003e/views/shared/\u003c/code\u003e folder. Right now, I'm just sticking with the bloated global partial.\u003c/p\u003e\n\n\u003cp\u003eAny help would be appreciated!\u003c/p\u003e","accepted_answer_id":"46965001","answer_count":"2","comment_count":"0","creation_date":"2017-10-26 20:38:14.533 UTC","last_activity_date":"2017-10-26 23:05:17.467 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5909281","post_type_id":"1","score":"0","tags":"ruby-on-rails|ruby|ruby-on-rails-4|partials","view_count":"24"} +{"id":"20321838","title":"How to force Entity Framework to generate separate WHERE clauses?","body":"\u003cp\u003e\u003cbr/\u003eI have a partirtioned table and I use it via entity framework.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCREATE PARTITION FUNCTION PART_FN (NVARCHAR(10))\nAS RANGE LEFT FOR VALUES ('CASE0');\n\nCREATE PARTITION SCHEME PART_SCH\nAS \nPARTITION PART_FN\nALL TO ([PRIMARY]);\n\nCREATE TABLE TEST_PART(ID INT NOT NULL PRIMARY KEY NONCLUSTERED ON [PRIMARY] IDENTITY, COL2 NVARCHAR(10), COL3 NVARCHAR(10))\nON PART_SCH(COL2);\n\nDECLARE @C INT = 1000000;\n\nSET IDENTITY_INSERT TEST_PART ON;\n\nWITH\nA AS (SELECT 1 AS N\nUNION ALL\nSELECT N+1 FROM A WHERE N \u0026lt; @C)\nINSERT INTO TEST_PART(ID, COL2, COL3)\nSELECT ID, COL2, COL3 FROM(\nSELECT N AS ID,\n'CASE' + CONVERT(NVARCHAR(10), CASE WHEN N%20 = 0 THEN 0 ELSE 1 END) AS COL2,\n'D' + CONVERT(NVARCHAR(10), N, 0) AS COL3 FROM A) AS A\nOPTION (MAXRECURSION 0);\n\nSET IDENTITY_INSERT TEST_PART OFF;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI run two selects:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT * FROM TEST_PART WHERE COL2='CASE0' AND COL3='D240';\nSELECT * FROM (SELECT * FROM TEST_PART WHERE COL2='CASE0') AS A WHERE COL3='D240';\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThey look the same.\u003cbr/\u003e\nBut!\u003cbr/\u003e\nFIRST has execution plan with degree parallelism 4 and estimated subtree cost ~5\u003cbr/\u003e\nSECOND has execution plan with degree parallelism 1 and estimated subtree cost ~2.5\u003cbr/\u003e\u003c/p\u003e\n\n\u003cp\u003eIf I use IQueryable like\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003equery.Where(test=\u0026gt;test.COL2 == \"CASE0\")\n .Where(test=\u0026gt;test.COL3 == \"D240\")\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eEF concatenates where clauses and generates query like FIRST.\nIs it possible to force entity framework generate query like SECOND?\u003cbr/\u003e\u003c/p\u003e\n\n\u003cp\u003ePS: I use EF 4.4 and MSSQL 2008 R2\u003c/p\u003e\n\n\u003cp\u003eBest regards,\u003cbr/\u003e\nRoman\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-12-02 06:05:14.63 UTC","favorite_count":"1","last_activity_date":"2013-12-02 08:30:16.877 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2992428","post_type_id":"1","score":"2","tags":"sql-server|entity-framework|partitioning","view_count":"386"} +{"id":"32570973","title":"Gradle Groovy compilation cannot find javafx classes in tests","body":"\u003cp\u003eI have the following Groovy test (not the real one, mind you) in a Gradle project (under \u003ccode\u003esrc/test/groovy\u003c/code\u003e):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport javafx.scene.paint.Color\nimport org.junit.Test\n\nclass MyTest {\n @Test\n void test1() {\n assert Color.AQUAMARINE != Color.BLUE\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe build file is as simple as it gets and declares that I use Java 8 (so JavaFX is in the classpath, always):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eapply plugin: 'groovy'\n\ncompileJava {\n sourceCompatibility = 1.8\n targetCompatibility = 1.8\n}\n...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt also has a test dependency on Groovy:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e testCompile group: 'org.codehaus.groovy', name: 'groovy-all', version: '2.4.4'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eEverything works fine, except when I refer to some JavaFX class in the Groovy test.\u003c/p\u003e\n\n\u003cp\u003eIt fails with this error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eMyTest.groovy: 3: unable to resolve class javafx.scene.paint.Color\n @ line 3, column 1.\n import javafx.scene.paint.Color\n ^\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe Java code compiles fine and I can run my JavaFX application. Only the Groovy tests seem to not be able to see JavaFX.\u003c/p\u003e\n\n\u003cp\u003eI've already tried changing the \u003ccode\u003ecompileJava\u003c/code\u003e block to \u003ccode\u003ecompileGroovy\u003c/code\u003e, \u003ccode\u003ecompileTestGroovy\u003c/code\u003e, also together with the \u003ccode\u003ecompileJava\u003c/code\u003e block, so that the Groovy compiler sees JavaFX 8, but nothing helped.\u003c/p\u003e\n\n\u003cp\u003eHow can I fix this?\u003c/p\u003e\n\n\u003cp\u003eGradle version:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e------------------------------------------------------------\nGradle 2.2\n------------------------------------------------------------\n\nBuild time: 2014-11-10 13:31:44 UTC\nBuild number: none\nRevision: aab8521f1fd9a3484cac18123a72bcfdeb7006ec\n\nGroovy: 2.3.6\nAnt: Apache Ant(TM) version 1.9.3 compiled on December 23 2013\nJVM: 1.8.0_60 (Oracle Corporation 25.60-b23)\nOS: Linux 3.16.0-38-generic amd64\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"1","creation_date":"2015-09-14 17:57:50.3 UTC","last_activity_date":"2015-09-14 18:15:50.87 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1007991","post_type_id":"1","score":"0","tags":"groovy|gradle|javafx","view_count":"168"} +{"id":"22188407","title":"How to delete a particular thing from a list?","body":"\u003cp\u003eFor the implementation of an algorithm,I need to delete a particular value from the list.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEg:---\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eMy list:---\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Ist row-\u0026gt;4,7,3,4\n\n IInd row-\u0026gt;2,8,6,5\n\n IIIrd row-\u0026gt;3,5,1,7\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBefore delete some values,I need to sort it.That is,\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Collections.sort(list);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eSorted Result\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e 2,8,6,5\n\n 3,5,1,7\n\n 4,7,3,4\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eExpected OUTPUT\u003c/strong\u003e\nNow I need to delete 1st elements of all rows. The output is\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e 8,6,5\n\n 5,1,7\n\n 7,3,4\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow I do this???I tried it by using tokenizer method,but I don't get it.\u003c/p\u003e","accepted_answer_id":"22188435","answer_count":"2","comment_count":"4","creation_date":"2014-03-05 04:16:59.07 UTC","last_activity_date":"2014-03-05 12:06:20.4 UTC","last_edit_date":"2014-03-05 04:56:11.543 UTC","last_editor_display_name":"","last_editor_user_id":"1272318","owner_display_name":"","owner_user_id":"3342849","post_type_id":"1","score":"-2","tags":"java|list","view_count":"71"} +{"id":"36526246","title":"how to iterate the javabean values in jsp by using JSTL and EL","body":"\u003cp\u003eIn my jsp: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;jsp:useBean id = \"b\" class = \"pack1.userBean\" scope=\"application\" /\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt; \u0026lt;c:out value =\"firstName\"/\u0026gt; \u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt; \u0026lt;c:out value =\"${b.firstName}\"/\u0026gt; \u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt; \n\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt; \u0026lt;c:out value =\"lastName\"/\u0026gt; \u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt; \u0026lt;c:out value =\"${b.lastName}\"/\u0026gt; \u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt; \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is working fine, but how can i iterate each value from userBean in a loop instead of typing each value over and over ?\u003c/p\u003e\n\n\u003cp\u003eLook like: (doesn't work)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;c:forEach var=\"p\" items=\"${b}\"\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt; \u0026lt;c:out value =\"${p.key}\"/\u0026gt; \u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt; \u0026lt;c:out value =\"${p.value}\"/\u0026gt; \u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;/c:forEach\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eheader: (working fine)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;c:forEach var=\"h\" items=\"${header}\"\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt; \u0026lt;c:out value =\"${h.key}\"/\u0026gt; \u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt; \u0026lt;c:out value =\"${h.value}\"/\u0026gt; \u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;/c:forEach\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCan anyone help? \nThanks.\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2016-04-10 05:37:31.557 UTC","last_activity_date":"2016-04-10 05:37:31.557 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6183156","post_type_id":"1","score":"2","tags":"java|jsp|jstl","view_count":"35"} +{"id":"24042369","title":"How to make a static lib based on other static libs using GCC?","body":"\u003cp\u003eI want to make a static library called \u003ccode\u003elibXYZ.a\u003c/code\u003e using some existing static libraries: \u003ccode\u003elibX.a\u003c/code\u003e, \u003ccode\u003elibY.a\u003c/code\u003e, \u003ccode\u003elibZ.a\u003c/code\u003e and some object files. The command line I used to build the static library \u003ccode\u003elibXYZ.a\u003c/code\u003e is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eld -o libXYZ.a one.o two.o -L./ -L/cygdrive/c/cygwin/lib/gcc/i686-pc-cygwin/4.8.2 -lX -lY -lZ -lstdc++\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm using Cygwin GCC (g++) to compile \u003ccode\u003eone.cpp\u003c/code\u003e and \u003ccode\u003etwo.cpp\u003c/code\u003e to get \u003ccode\u003eone.o\u003c/code\u003e and \u003ccode\u003etwo.o\u003c/code\u003e before the \u003ccode\u003eld\u003c/code\u003e command like the following:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eg++ -o one.o one.cpp -c\ng++ -o one.o two.cpp -c\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003ccode\u003elibX.a\u003c/code\u003e, \u003ccode\u003elibY\u003c/code\u003e.a, \u003ccode\u003elibZ.a\u003c/code\u003e are all located in the current directory (that's why \u003ccode\u003e-L./\u003c/code\u003e). And I added the C++ standard library linker flag \u003ccode\u003e-lstdc++\u003c/code\u003e in the \u003ccode\u003eld\u003c/code\u003e line. But I got the following error when I make it:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eone.o: one.cpp:(.text+0x32): undefined reference to `_Unwind_Resume'\nld: one.o: bad reloc address 0xd in section `.text$_ZN10ConfigC1Ev[__ZN10ConfigC1Ev]'\nMakefile:22: recipe for target 'libXYZ.a' failed\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo my question is: Is the \u003ccode\u003eld\u003c/code\u003e command the right command to build the static lib from other static libs and .o files? What caused the error? I searched the forum and found that it is possible caused by some incompatible compiler. But I built all my source code using the same GCC compiler.\u003c/p\u003e\n\n\u003cp\u003eUPDATE:\u003c/p\u003e\n\n\u003cp\u003eI tried again using the following command:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eld -o libXYZ.a one.o two.o -L./ -lX -lY -lZ\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut I'm still getting the following errors:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eone.o:one.cpp:(.text+0x32): undefined reference to `_Unwind_Resume'\none.o:one.cpp:(.text+0x12a): undefined reference to `_Unwind_Resume'\n...\n./libX.a(wrapper.o):wrapper.cpp:(.text+0x7ba): undefined reference to `__chkstk_ms'\n./libX.a(wrapper.o):wrapper.cpp:(.text+0x7ba): undefined reference to `_Unwind_Resume'\n...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd I omitted numerous similar errors like the above \u003ccode\u003e_Unwind_Resume\u003c/code\u003e errors. Any ideas on what caused those errors?\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2014-06-04 16:06:12.383 UTC","last_activity_date":"2014-06-08 04:02:30.13 UTC","last_edit_date":"2014-06-05 19:22:06.27 UTC","last_editor_display_name":"","last_editor_user_id":"1649466","owner_display_name":"","owner_user_id":"1649466","post_type_id":"1","score":"1","tags":"c++|gcc|linker|static-libraries|ld","view_count":"211"} +{"id":"31490272","title":"TypeError: 'NoneType' object has no attribute '__getitem__' | total_number_messages += result[\"verify_counter\"]","body":"\u003cpre\u003e\u003ccode\u003eprint(\"* Parsing users email in parallel..\") \npool = Pool(processes=NUM_PROCESSES)\nfor result in pool.imap_unordered(worker, usernames, chunksize = 2): \n total_number_messages += result[\"verify_counter\"] \n total_number_messages_imported += result[\"num_imported\"] \n total_number_duplicates += result[\"duplicate_counter\"] \n address_book[result[\"current_user_email\"]] = result[\"username\"] \n combined_msg_senders.append({\n \"counter\": result[\"counter\"],\n \"address\": result[\"current_user_email\"],\n \"username\": result[\"username\"]\n })\npool.close()\npool.join()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eplease help me with this error getting for above, getting error below\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eTraceback (most recent call last):\n File \"metadata.py\", line 539, in \u0026lt;module\u0026gt;\n main()\n File \"metadata.py\", line 511, in main\n total_number_messages += result[\"verify_counter\"]\nTypeError: 'NoneType' object has no attribute '__getitem__'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethat code you can check at \n\u003ca href=\"http://brage.bibsys.no/xmlui/handle/11250/198551\" rel=\"nofollow\"\u003ehttp://brage.bibsys.no/xmlui/handle/11250/198551\u003c/a\u003e\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2015-07-18 10:35:55.063 UTC","last_activity_date":"2015-07-18 10:56:00.113 UTC","last_edit_date":"2015-07-18 10:56:00.113 UTC","last_editor_display_name":"","last_editor_user_id":"100297","owner_display_name":"","owner_user_id":"5128325","post_type_id":"1","score":"0","tags":"python|django","view_count":"200"} +{"id":"36848192","title":"AngularJS and WordPress API display data from single post","body":"\u003cp\u003eI'm using the WordPress API as a data service to an AngularJS/Ionic app. I have a post type called programmes and have a list of programmes (posts) and the JSON looks like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar programmes = [\n {\n id: 6,\n title: \"A post\",\n slug: \"a-post\"\n },\n {\n id: 7,\n title: \"Another post\",\n slug: \"another-post\"\n },\n {\n id: 8,\n title: \"Post 123\",\n slug: \"post-123\"\n }\n]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI've got the list of programmes displaying with ngRepeat. However I'm struggling to get the data for an individual post.\u003c/p\u003e\n\n\u003cp\u003eI was trying to do it like so to get data for the single programme: \u003ccode\u003evar programme = programmes[$stateParams.programmeId];\u003c/code\u003e however the issue is, for example, if I click on the first \"A post\" it returns \u003ccode\u003e6\u003c/code\u003e from the programme id but this does not match the index of the object which is \u003ccode\u003e0\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eHow can I get data from a single programme when the id and index do not match without having to manually reset the programme id's in the database?\u003c/p\u003e\n\n\u003cp\u003eHere are my files so far:\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eapp.js\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e.config(function($stateProvider, $urlRouterProvider) {\n $stateProvider\n\n .state('app', {\n url: \"/app\",\n abstract: true,\n templateUrl: \"templates/menu.html\",\n controller: 'AppCtrl'\n })\n\n .state('app.programmes', {\n url: \"/programmes\",\n views: {\n 'menuContent': {\n templateUrl: \"templates/programmes.html\",\n controller: 'ProgrammesCtrl'\n }\n }\n })\n\n .state('app.programme', {\n url: \"/programmes/:programmeSlug\",\n views: {\n 'menuContent': {\n templateUrl: \"templates/programme.html\",\n controller: 'ProgrammeCtrl'\n }\n }\n })\n $urlRouterProvider.otherwise('/app/programmes');\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003edata.js\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e.factory('DataFactory', function($http) {\n\n var urlBase = 'http://event-app.dev/wp-json/wp/v2';\n var APIdata = {};\n\n var currentProgramme = null;\n\n return {\n getProgrammes: function() {\n return $http.get(urlBase + '/programmes');\n }\n }\n})\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003econtrollers.js\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e.controller ('ProgrammesCtrl', function ($scope, DataFactory) {\n getProgrammes();\n function getProgrammes() {\n DataFactory.getProgrammes().then(function(response) { \n $scope.programmes = response.data;\n }, \n function(error) {\n $scope.status = 'Unable to load data';\n });\n }\n})\n\n.controller ('ProgrammeCtrl', function ($scope, $stateParams, DataFactory) {\n getProgrammes();\n function getProgrammes() {\n DataFactory.getProgrammes().then(function(response, id) { \n var programmes = response.data;\n $scope.programme = programmes[$stateParams.programmeId];\n\n }, \n function(error) {\n $scope.status = 'Unable to load data';\n });\n }\n})\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eprogramme.html (view to display a single programme)\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;ion-view view-title=\"{{programme.title}}\"\u0026gt;\n \u0026lt;ion-content\u0026gt;\n \u0026lt;ion-list\u0026gt;\n \u0026lt;ion-item\u0026gt;\n {{programme.title}}\n \u0026lt;/ion-item\u0026gt;\n \u0026lt;/ion-list\u0026gt;\n \u0026lt;/ion-content\u0026gt;\n\u0026lt;/ion-view\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"36935684","answer_count":"1","comment_count":"0","creation_date":"2016-04-25 18:18:54.85 UTC","last_activity_date":"2016-04-29 10:16:48.763 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2929830","post_type_id":"1","score":"0","tags":"javascript|angularjs|wordpress|api","view_count":"410"} +{"id":"44970331","title":"Is there a better way to get list of objects in JavaFX than iteration?","body":"\u003cp\u003eI have several fields with people names and their ages. Amount of those fields are random, depending on how many people are participating. I want to select in separate list all fields with names and in another all fields with ages. What way better to select all \u003ccode\u003eTextFields\u003c/code\u003e on page and separate them by name/age?\u003c/p\u003e","answer_count":"0","comment_count":"4","creation_date":"2017-07-07 12:04:22.383 UTC","last_activity_date":"2017-07-07 12:04:22.383 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3629015","post_type_id":"1","score":"0","tags":"javafx","view_count":"21"} +{"id":"13577664","title":"pass a bitmap image from one activity to another","body":"\u003cp\u003eIn my app i am displaying no.of images from gallery from where as soon as I select one image , the image should be sent to the new activity where the selected image will be set as background.However, I am able to get the images from gallery but as soon as I select one the application crashes.Thanks in advance\u003c/p\u003e\n\n\u003cp\u003eActivity-1(The images are shown in gallery and the selected image is sent to new activity)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class Gallery extends Activity {\n\nprivate static int RESULT_LOAD_IMAGE = 1;\n\n /** Called when the activity is first created. */\n @Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.gallery);\n\n Button buttonLoadImage = (Button) findViewById(R.id.buttonLoadPicture);\n\n\n buttonLoadImage.setOnClickListener(new View.OnClickListener() {\n\n public void onClick(View arg0) {\n\n Intent i = new Intent(Intent.ACTION_PICK,android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);\n\n startActivityForResult(i, RESULT_LOAD_IMAGE);\n }\n });\n }\n\n\n\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n\n if (requestCode == RESULT_LOAD_IMAGE \u0026amp;\u0026amp; resultCode == RESULT_OK \u0026amp;\u0026amp; null != data) {\n\n\n\n\n\n\n Uri contentUri = data.getData(); \n String[] proj = { MediaStore.Images.Media.DATA }; \n Cursor cursor = managedQuery(contentUri, proj, null, null, null); \n int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA); \n cursor.moveToFirst(); \n String tmppath = cursor.getString(column_index); \n Bitmap croppedImage = BitmapFactory.decodeFile(tmppath);\n\n\n // Bitmap croppedImage = BitmapFactory.decodeFile(croppedImage);\n Intent intent = new Intent(Gallery.this,GesturesActivity.class);\n intent.putExtra(\"bmp\",croppedImage);\n startActivity(intent);\n\n Log.v(\"sending image\",\"sending image\");\n\n\n }\n\n\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eActivity-1(XML)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" encoding=\"utf-8\"?\u0026gt;\n\u0026lt;LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:orientation=\"vertical\"\n android:layout_width=\"fill_parent\"\n android:layout_height=\"fill_parent\"\n android:background=\"@drawable/background\"\n \u0026gt;\n \u0026lt;ImageView\n android:id=\"@+id/imgView\"\n android:layout_width=\"fill_parent\"\n android:layout_weight=\"1\" android:layout_height=\"wrap_content\"\u0026gt;\u0026lt;/ImageView\u0026gt;\n \u0026lt;Button \n android:layout_height=\"wrap_content\" \n android:text=\"Load Picture\" \n android:layout_width=\"wrap_content\" \n android:id=\"@+id/buttonLoadPicture\" \n android:layout_weight=\"0\" \n android:layout_gravity=\"center\"\u0026gt;\u0026lt;/Button\u0026gt;\n\u0026lt;/LinearLayout\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eActivity-2(The activity where the selected image should be set as background image of the screen)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public class GesturesActivity extends Activity {\n\n\n private final int MENU_CAMERA = Menu.FIRST;\n\n\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n requestWindowFeature(Window.FEATURE_NO_TITLE);\n\n\n Bitmap bmp = (Bitmap)this.getIntent().getParcelableExtra(\"bmp\");\n BitmapDrawable background = new BitmapDrawable(bmp);\n getWindow().setBackgroundDrawable(background); //background image of the screen\n\n\n\n Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.advert);\n View view = new SandboxView(this, bitmap);\n\n setContentView(view);\n }\n\n\n\n public boolean onPrepareOptionsMenu(Menu menu) {\n menu.clear();\n\n menu.add(0, 11, 0, \"Take Snapshot\");\n\n return super.onPrepareOptionsMenu(menu);\n }\n\n\n public boolean onOptionsItemSelected(MenuItem item) {\n\n return super.onOptionsItemSelected(item);\n }\n\n\n\n }\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"8","comment_count":"2","creation_date":"2012-11-27 05:00:30.703 UTC","favorite_count":"5","last_activity_date":"2016-01-22 07:10:21.84 UTC","last_edit_date":"2012-11-27 05:09:43.43 UTC","last_editor_display_name":"","last_editor_user_id":"1442398","owner_display_name":"","owner_user_id":"1442398","post_type_id":"1","score":"6","tags":"android|android-intent|bitmap|bitmapimage","view_count":"18997"} +{"id":"126870","title":"Best design for lookup-and-possibly-change method","body":"\u003cp\u003eI am designing a class that stores (caches) a set of data. I want to lookup a value, if the class contains the value then use it and modify a property of the class. I am concerned about the design of the public interface.\u003cbr\u003e\nHere is how the class is going to be used:\u003c/p\u003e\n\n\u003cpre\u003e\nClassItem *pClassItem = myClass.Lookup(value);\nif (pClassItem)\n{ // item is found in class so modify and use it \n pClassItem-\u003eSetAttribute(something);\n ... // use myClass\n}\nelse\n{ // value doesn't exist in the class so add it\n myClass.Add(value, something); \n}\n\u003c/pre\u003e\n\n\u003cp\u003eHowever I don't want to have to expose ClassItem to this client (ClassItem is an implementation detail of MyClass).\nTo get round that the following could be considered:\u003c/p\u003e\n\n\u003cpre\u003e\nbool found = myClass.Lookup(value);\nif (found)\n{ // item is found in class so modify and use it \n myClass.ModifyAttribute(value, something);\n ... // use myClass\n}\nelse\n{ // value doesn't exist in the class so add it\n myClass.Add(value, something); \n}\n\u003c/pre\u003e\n\n\u003cp\u003eHowever this is inefficient as Modify will have to do the lookup again. This would suggest a lookupAndModify type of method:\u003c/p\u003e\n\n\u003cpre\u003e\nbool found = myClass.LookupAndModify(value, something);\nif (found)\n{ // item is found in class\n ... // use myClass\n}\nelse\n{ // value doesn't exist in the class so add it\n myClass.Add(value, something); \n}\n\u003c/pre\u003e\n\n\u003cp\u003eBut rolling LookupAndModify into one method seems like very poor design. It also only modifies if value is found and so the name is not only cumbersome but misleading as well.\u003c/p\u003e\n\n\u003cp\u003eIs there another better design that gets round this issue? Any design patterns for this (I couldn't find anything through google)?\u003c/p\u003e","accepted_answer_id":"127865","answer_count":"3","comment_count":"0","creation_date":"2008-09-24 12:35:37.977 UTC","favorite_count":"2","last_activity_date":"2008-09-26 05:45:46.603 UTC","last_editor_display_name":"","owner_display_name":"danio","owner_user_id":"12663","post_type_id":"1","score":"0","tags":"oop","view_count":"134"} +{"id":"19332040","title":"Tabbing to All Radio Buttons in a Group Box","body":"\u003cp\u003eI have radio buttons in a groupbox and I want to happen when each time I press TAB, the focus will be on the next radio button. How will I do that?\nWhat's happening is that the only one that is getting the focus is the first radio button. Their TabStop is set to True and their TabIndex is in order.\u003c/p\u003e","accepted_answer_id":"19332057","answer_count":"1","comment_count":"0","creation_date":"2013-10-12 08:11:24.97 UTC","last_activity_date":"2013-10-12 08:26:57.013 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2764842","post_type_id":"1","score":"0","tags":".net|vb.net|radio-button|groupbox","view_count":"516"} +{"id":"22456735","title":"Sort document collection by values total in xpages","body":"\u003cp\u003eI'm working on an xpages application in which I would like to display the top5 of the total volumes per client.\u003c/p\u003e\n\n\u003cp\u003eI have a list of customers who buy any number of products.I would like to classify customers according to the total volume of products purchased.\nI use the \"Top5\" View categorized by customer.\u003c/p\u003e\n\n\u003cp\u003eI used a document collection to calculate the total volume by customer.\u003c/p\u003e\n\n\u003cp\u003eI get to classify volumes in descending order and select the top 5.But this does not allow me to retrieve the name of the product and the client from the view.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar cls3 = @DbColumn(\"\",\"Top5\",1);\nsessionScope.put(\"clientsList3\",cls3);\nvar db=session.getCurrentDatabase();\nvar view7=db.getView(\"Top5\")\nvar dataa =[] ;\n var top =[];\n\n for(var r = 0; r \u0026lt; clientsList3.length; r++){\n\n var Cli = @Trim(@Text(clientsList3[r]));\n var VolumeTotal :NotesDocumentCollection = view7.getAllDocumentsByKey(Cli);\n\n var vola = 0;\n var array = new Array();\n var prod = \"\";\n\n if (VolumeTotal == 0) {array = 0;}\n else{\n var doca = VolumeTotal.getFirstDocument();\n while (doca != null)\n {vola = vola + doca.getItemValueInteger(\"TotalVolume_Intermediate\");\n doca = VolumeTotal.getNextDocument(doca);\n }\n array.push(vola);\n\n }\n dataa[r] = array;\n dataa.sort(function(a, b) {return b - a;}); \n\n\n\n top = dataa.slice(0,5);\n\n\n } \n\n return dataa;\n\n }\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"22467071","answer_count":"1","comment_count":"2","creation_date":"2014-03-17 14:17:45.023 UTC","last_activity_date":"2014-03-17 22:51:56.23 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2452344","post_type_id":"1","score":"2","tags":"javascript|sorting|xpages|lotus-notes|document","view_count":"211"} +{"id":"38386888","title":"Firefox WebExtention won't load","body":"\u003cp\u003eSo, I tried to load my add-on using the \u003ccode\u003eabout:debugging\u003c/code\u003e page in Firefox. But, it simply wouldn't load. Is there somewhere where an error would be logged that I could find it?\u003c/p\u003e\n\n\u003cp\u003eHere is my \u003cem\u003emanifest.JSON\u003c/em\u003e code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n \"description\": \"Adds a stickfigure\",\n \"manifest_version\": 2,\n \"name\": \"StickMan\",\n \"version\": \"1.0\",\n \"icons\": {\n \"48\": \"icons/StickMan-48.png\"\n },\n \"applications\": {\n \"gecko\": {\n \"id\": \"extention@stick.man\",\n \"strict_min_version\": \"45.0\"\n }\n },\n \"permissions\": [\n \"activeTab\"\n ],\n \"background\": {\n \"scripts\": [\"StickManUpdate.js\"]\n },\n \"browser_action\": {\n \"default_icon\": {\n \"48\": \"icons/StickManButton.png\"\n },\n \"default_title\": \"Call StickMan\",\n },\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI hope that this helps other frustrated add-on creators.\u003c/p\u003e\n\n\u003cp\u003eThanks in advance\u003c/p\u003e","answer_count":"1","comment_count":"5","creation_date":"2016-07-15 02:15:55.373 UTC","last_activity_date":"2016-07-17 21:35:09.3 UTC","last_edit_date":"2016-07-15 04:08:43.79 UTC","last_editor_display_name":"","last_editor_user_id":"3773011","owner_display_name":"","owner_user_id":"6592117","post_type_id":"1","score":"-1","tags":"firefox-addon|firefox-webextensions","view_count":"218"} +{"id":"21915354","title":"Git and multiple copies of file with difference in casing","body":"\u003cp\u003eI renamed one of the project file in Git from say My.Test to My.test. In the main repository, I am seeing both of copies of the project. Also, any changes that I am doing in My.test project are actually getting added in My.Test project in the main repository. \u003c/p\u003e\n\n\u003cp\u003eScenario\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e1) Originally started with : My.Test\n2) Renamed My.Test to My.test\n3) Made changes in My.test\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn main repo :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e1) Both My.Test \u0026amp; My.test are getting listed\n2) Changes done to My.test and getting listed in My.Test.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny help in resolving this issue will be much appreciated.\u003c/p\u003e\n\n\u003cp\u003eRegards\nPawan Mishra\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-02-20 17:34:12.627 UTC","last_activity_date":"2014-02-20 17:56:49.56 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"242172","post_type_id":"1","score":"0","tags":"git|file-rename","view_count":"18"} +{"id":"41123744","title":"Zip upload with curl post request","body":"\u003cp\u003eI try to upload a zip-File with Curl Post Request.\u003c/p\u003e\n\n\u003cp\u003eBut the Zip File is empty after Upload.\u003c/p\u003e\n\n\u003cp\u003eHere my Code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e// Add the Zip File \n\n $cfile = curl_file_create($dateipfad . '/bestand.zip', 'application/zip', $neuerdateiname); \n $filedata = array('file' =\u0026gt; $cfile, ';type' =\u0026gt; 'application/zip');\n\n // Set Curl Option\n curl_setopt($ch, CURLOPT_URL, $config-\u0026gt;MOBILE_API_SERVER . $neuerdateiname); //Set the Url (https://services.mobile.de/upload-api/upload/foobar-2016-02-09_11-11-11.zip)\n curl_setopt($ch, CURLOPT_POST, 1); \n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //Get the response from cURL\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);\n curl_setopt($ch, CURLOPT_HEADER, false);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('POST upload-api/upload/'.$neuerdateiname.' HTTP/1.0', 'Host: services.mobile.de', 'Authorization: '.base64_encode($config-\u0026gt;MOBILE_DE_USER . $config-\u0026gt;MOBILE_DE_PASS) ));\n curl_setopt($ch, CURLOPT_USERPWD, $config-\u0026gt;MOBILE_DE_USER . ':' . $config-\u0026gt;MOBILE_DE_PASS); // Username Password\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\n curl_setopt($ch, CURLOPT_BINARYTRANSFER, true); // --data-binary\n curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/zip']); // -H\n curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0); // -0\n curl_setopt($ch, CURLOPT_POSTFIELDS, $filedata); //Create a POST array with the file in it\n\n\n $response = curl_exec($ch);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e// Error / Success Messages\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e if($errno = curl_errno(ch)) {\n $error_message = curl_strerror($errno);\n echo \"cURL error ({$errno}):\\n {$error_message}\";\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e[Edit 14.12.]\nIf i try to use ssh - i get follow Message:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;T -X POST --data-binary @bestand.zip https://services.mobile.de/upload-api/upload/foobar-2016-02-09_11-11-11.zip\n* About to connect() to services.mobile.de port 443 (#0)\n* Trying 2a04:cb41:f016:1::2b...\n* Connected to services.mobile.de (2a04:cb41:f016:1::2b) port 443 (#0)\n* Initializing NSS with certpath: none\n* Unable to initialize NSS\n* Closing connection 0\ncurl: (77) Problem with the SSL CA cert (path? access rights?) \n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"0","creation_date":"2016-12-13 14:38:44.773 UTC","last_activity_date":"2016-12-14 10:55:17.23 UTC","last_edit_date":"2016-12-14 10:55:17.23 UTC","last_editor_display_name":"","last_editor_user_id":"2857368","owner_display_name":"","owner_user_id":"2857368","post_type_id":"1","score":"0","tags":"php|curl|post|request","view_count":"463"} +{"id":"33857973","title":"Linear search in c#","body":"\u003cp\u003eHey guys I am a beginner at coding and I'm doing a linear search in c# and can't figure out how to make it show in what array the number was found when doing the search. It just makes it say that it's on the last array. Here's my code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eRandom Generator = new Random();\nint[] array = new int[100];\nint count = 0;\nfor (int i = 0; i \u0026lt; array.Length; i++)\n{\n array[i] = Generator.Next(1, 100);\n count++;\n}\nConsole.WriteLine(\"Write a number between 1-100 and see if it's in a array and in what array.\");\nint guess = Convert.ToInt32(Console.ReadLine());\n\nbool exists = array.Contains(guess);\nif (exists)\n{\n Console.WriteLine(\"Your number {0} is in the {1}th Array.\", guess, count);\n}\nelse\n{\n Console.WriteLine(\"Your number {0} does not match any number in any of the Arrays.\", guess);\n}\n\nConsole.ReadKey();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThere's something wrong with my count int, but I don't know what to do. Thanks in advance.\u003c/p\u003e","accepted_answer_id":"33858052","answer_count":"1","comment_count":"5","creation_date":"2015-11-22 17:42:48.127 UTC","last_activity_date":"2015-11-22 18:31:23.6 UTC","last_edit_date":"2015-11-22 18:00:31.687 UTC","last_editor_display_name":"","last_editor_user_id":"60761","owner_display_name":"","owner_user_id":"5592333","post_type_id":"1","score":"-4","tags":"c#|linear-search","view_count":"1393"} +{"id":"29195493","title":"Unable to display out the remaining date","body":"\u003cp\u003eMy program will get data from database and show it in a \u003ccode\u003eListview\u003c/code\u003e. Now I get the date from database and compare it with my current date and count the remaining day. I successfully got the data and show it in a listview, but my remaining day code is not working. Any help will be appreciated!\u003c/p\u003e\n\n\u003cpre class=\"lang-java prettyprint-override\"\u003e\u003ccode\u003e List\u0026lt;HashMap\u0026lt;String,Object\u0026gt;\u0026gt; aList = newArrayList\u0026lt;HashMap\u0026lt;String,Object\u0026gt;\u0026gt;();\n for (int i = 0; i\u0026lt;records.size(); i++) {\n HashMap\u0026lt;String, Object\u0026gt; hm = new HashMap\u0026lt;String, Object\u0026gt;();\n hm.put(\"txt\", records.get(i).getAssname());\n hm.put(\"txt2\", records.get(i).getAssTime());\n\n String ez = records.get(i).getAssTime();\n Calendar today = Calendar.getInstance();\n\n //count the remain day\n try {\n SimpleDateFormat dd = new SimpleDateFormat(\"dd/M/yyyy\");\n Date date1= dd.parse(ez);\n Date date2 = today.getTime();\n long diff = Math.abs(date1.getTime() - date2.getTime());\n long diffDays = diff / (24 * 60 * 60 * 1000);\n\n hm.put(\"txt3\", String.valueOf(diffDays));\n\n } catch (Exception e1) {\n }\n aList.add(hm);\n }\n\n // Keys used in Hashmap\n String[] from = {\"txt\",\"txt2\",\"txt3\"};\n\n // Ids of views in listview_layout\n int[] to = { R.id.assigment_name,R.id.assigment_ATime, R.id.assigment_remain};\n\n // Instantiating an adapter to store each items\n // R.layout.listview_layout defines the layout of each item\n SimpleAdapter adapter = new SimpleAdapter(getBaseContext(), aList, R.layout.view_assignment_entry, from, to);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat's wrong with my code ?\u003c/p\u003e","answer_count":"2","comment_count":"3","creation_date":"2015-03-22 14:20:19.17 UTC","last_activity_date":"2015-05-15 12:58:40.927 UTC","last_edit_date":"2015-05-15 12:42:23.843 UTC","last_editor_display_name":"","last_editor_user_id":"1533054","owner_display_name":"","owner_user_id":"4606531","post_type_id":"1","score":"0","tags":"java|android|date","view_count":"39"} +{"id":"15754277","title":"iPhone App Ad-hoc testing","body":"\u003cp\u003eSo I am currently making an app for somebody else that lives in another state. Is there any way that I can somehow upload it (Ad-hoc?) to somewhere, and they can download it on their phone to test out themselves? I'm guessing I would have to know there ID's for their iPhone. \u003c/p\u003e\n\n\u003cp\u003eIf this is possible, how can I do this? I currently have the $99 developer license.\u003c/p\u003e","accepted_answer_id":"15757359","answer_count":"4","comment_count":"0","creation_date":"2013-04-02 00:42:28.903 UTC","favorite_count":"1","last_activity_date":"2013-12-20 19:52:19.75 UTC","last_edit_date":"2013-12-20 19:52:19.75 UTC","last_editor_display_name":"","last_editor_user_id":"335858","owner_display_name":"","owner_user_id":"2167209","post_type_id":"1","score":"0","tags":"xcode|testing","view_count":"1057"} +{"id":"35681112","title":"Adding text from mySQL query onto canvas","body":"\u003cp\u003eIn this code, I successfully get five random text strings from a mySQL database, and can echo them via PHP.\u003c/p\u003e\n\n\u003cp\u003eInstead of echoing them via PHP, I would rather like to display them as text in the canvas (in place of the \"Hello World\" text) of the attached code. \u003c/p\u003e\n\n\u003cp\u003eAny ideas of how I would have to go about doing this?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;HTML\u0026gt;\n\u0026lt;HEAD\u0026gt;\n \u0026lt;TITLE\u0026gt;\u0026lt;/TITLE\u0026gt;\n\u0026lt;/HEAD\u0026gt;\n\u0026lt;BODY\u0026gt;\n\n\u0026lt;canvas id=\"myCanvas\" width=\"200\" height=\"100\" style=\"border:1px solid #000000;\"\u0026gt;\n\u0026lt;/canvas\u0026gt;\n\n\u0026lt;script\u0026gt;\n var c = document.getElementById(\"myCanvas\");\n var ctx = c.getContext(\"2d\");\n ctx.font = \"30px Arial\";\n ctx.fillText(\"Hello World\",10,50);\n\u0026lt;/script\u0026gt;\n\n\u0026lt;?PHP\n //CREATE CONNECTION\n $con=mysqli_connect('localhost','','');\n //select database\n if(!mysqli_select_db($con,'test')) {\n echo \"database not selected\";\n }\n //select query\n //select random question\n $sql= \n \"select * from `general knowledge`\n order by rand()\n limit 5\";\n //execute sql query\n $records= (mysqli_query($con,$sql));\n while ($row=mysqli_fetch_array($records)) {\n echo \"\u0026lt;P\u0026gt;\";\n echo \"\".$row['Question Text'].\"\";\n }\n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"35681174","answer_count":"1","comment_count":"0","creation_date":"2016-02-28 10:03:17.35 UTC","last_activity_date":"2016-02-28 10:43:34.333 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5992833","post_type_id":"1","score":"3","tags":"php|mysql|canvas","view_count":"116"} +{"id":"39620186","title":"AngularJS How to initialize a select using ng-options with an object value","body":"\u003cp\u003eI would like to initialize a selection of a select field with \u003ccode\u003eng-options\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eLets assume we've got the following items:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$scope.items = [{\n id: 1,\n label: 'aLabel',\n subItem: { name: 'aSubItem' }\n}, {\n id: 2,\n label: 'bLabel',\n subItem: { name: 'bSubItem' }\n}];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe following html:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;select ng-options=\"item as item.label for item in items track by item.id\" ng-model=\"selected\"\u0026gt;\u0026lt;/select\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut now instead of selecting the option by the following command:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$scope.selected = $scope.items[0];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI do not have the object, I have only the information of the id so I like to initialize the select by something like that:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$scope.selected = $scope.otherRandomObject.id \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy thought was that using \u003ccode\u003etrack by item.id\u003c/code\u003e is somehow creating the relation between object and the id.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-09-21 15:03:35.093 UTC","last_activity_date":"2016-09-21 16:22:59.423 UTC","last_edit_date":"2016-09-21 16:22:59.423 UTC","last_editor_display_name":"","last_editor_user_id":"5598783","owner_display_name":"","owner_user_id":"2324256","post_type_id":"1","score":"0","tags":"javascript|angularjs","view_count":"187"} +{"id":"14921463","title":"How to install cross compiler (on ubuntu 12.04 LTS) for microprocessor SA1100?","body":"\u003cp\u003eCan someone please tell me how to install the cross compiler (programming language C) for the SA1100 microprocessor? I have ubuntu 12.04 LTS. I´m a complete noob to Linux, I just installed Ubuntu yesterday. I need a special variant of the GCC compiler that is named \"arm-unknown-linux-gnu-gcc\" but don know how to do it.\u003c/p\u003e\n\n\u003cp\u003eCan someone please help me?\u003c/p\u003e","accepted_answer_id":"14923232","answer_count":"2","comment_count":"9","creation_date":"2013-02-17 13:14:33.567 UTC","favorite_count":"9","last_activity_date":"2017-03-16 14:32:34.627 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1418052","post_type_id":"1","score":"8","tags":"linux|gcc|ubuntu|compiler-construction|arm","view_count":"58546"} +{"id":"45855752","title":"gethostbyname() sometimes could not dns forever","body":"\u003cp\u003eIn one of our product(embeded platform using RTL8196e chips), sometimes the program fails to DNS forever before the program is restarted.\u003c/p\u003e\n\n\u003cp\u003eMore investigation found that if the program starts before the network is ready(e.g.: before DHCPed by udhcpc), the following up calling for gethostbyname() would failed for ever, even at the time ping is working when network is OK.\u003c/p\u003e\n\n\u003cp\u003esome tests have done to illustrate:(in the simplest form, e.g.: omit print the result of gethostbyname)\u003c/p\u003e\n\n\u003cp\u003eThe programs are started before the network is ready(e.g.: before eth0 has get the IP by DHCP)\u003c/p\u003e\n\n\u003cp\u003eProgram 1: could not get IP for ever after network is OK(ping is ok)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ewhile (1) {\n res_init();\n gethostbyname(...); //not work\n sleep(5);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eProgram 2: the execution of gethostbyname() in the forked process works\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ewhile (1) {\n pid = fork();\n ...\n if (pid == 0)\n res_init();\n gethostbyname(...); //works\n else\n waitpid(pid1,...);\n sleep(5);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eProgram 3: the execution of gethostbyname() both failed in child/parent process\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ewhile (1) {\n pid = fork();\n ...\n if (pid == 0)\n res_init();\n gethostbyname(...); //not work\n else\n res_init();\n gethostbyname(...); //not work\n waitpid(pid1,...);\n sleep(5);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am totally blank what's the reason for this weird behavior... Is it something about glic or kernel?\u003c/p\u003e\n\n\u003cp\u003eAny explanation would be appreciated.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-08-24 07:44:15.52 UTC","last_activity_date":"2017-08-30 14:26:18.273 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5332358","post_type_id":"1","score":"0","tags":"linux|dns|embedded-linux|glibc","view_count":"24"} +{"id":"14898379","title":"Proper way to prevent SQLAlchemy from re-running queries on expired objects?","body":"\u003cp\u003eI'm having trouble wrapping my head around how to deal with expired sqlalchemy objects in a flask request. Let's say I do something like the following:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efrom models import Foo, Bar\n\n@app.route(\"/page\")\ndef page():\n foos = Foo.query.all()\n\n for foo in foos:\n b = Bar(foo.data)\n db.session.add(b)\n\n db.session.commit()\n\n return render_template('page.html', foos=foos)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand then in \u003ccode\u003epage.html\u003c/code\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{% for foo in foos %}\n {{ foo. name }}\n{% endfor %}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSQLAlchemy will then do a select query for each foo in the template loop, because the \u003ccode\u003esession.commit()\u003c/code\u003e marked the \u003ccode\u003efoos\u003c/code\u003e collection as expired. If I know that there is no way for \u003ccode\u003efoos\u003c/code\u003e to actually have changed, what is the right way to prevent \u003ccode\u003elen(foos)\u003c/code\u003e queries from being executed? Similarly, if \u003ccode\u003efoos\u003c/code\u003e \u003cem\u003ehas\u003c/em\u003e changed, what is the right way to refresh the data with a single query rather than many?\u003c/p\u003e","accepted_answer_id":"14899438","answer_count":"2","comment_count":"0","creation_date":"2013-02-15 15:52:36.677 UTC","last_activity_date":"2013-02-15 22:36:16.223 UTC","last_edit_date":"2013-02-15 17:11:25.183 UTC","last_editor_display_name":"","last_editor_user_id":"280630","owner_display_name":"","owner_user_id":"280630","post_type_id":"1","score":"1","tags":"python|sqlalchemy|flask|flask-sqlalchemy","view_count":"2691"} +{"id":"20267556","title":"cocoa circular progressbar only animated when key pressed or mouse moved?","body":"\u003cp\u003eI show the circular progressbar in NSPanel, when the panel first time opened, it works fine. When it is hidden, and opened again, the circular progressbar only animates when key pressed or mouse moved.\u003c/p\u003e","answer_count":"0","comment_count":"5","creation_date":"2013-11-28 13:32:21.857 UTC","last_activity_date":"2013-11-28 13:32:21.857 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1120405","post_type_id":"1","score":"0","tags":"osx|cocoa|progress-bar|animated","view_count":"268"} +{"id":"19926364","title":"VB script to open and close excel file without excel","body":"\u003cp\u003eI want to open and save an excel file in sharepoint, which has no excel installed. I tried to write an vbscript but I only can find which called excel application. Please help to advise. Thank you!\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSet objExcel = CreateObject(\"Excel.Application\")\n\nSet objWorkbook = objExcel.Workbooks.Open(\"D:\\Roambi\\Test excel\\Test.xlsx\")\n\nobjExcel.ActiveWorkbook.Save\n\nobjExcel.ActiveWorkbook.Close\n\nobjExcel.Application.Quit\n\nWScript.Quit\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"19972849","answer_count":"1","comment_count":"3","creation_date":"2013-11-12 10:13:06.287 UTC","last_activity_date":"2013-11-14 08:29:47.107 UTC","last_edit_date":"2013-11-12 10:56:45.79 UTC","last_editor_display_name":"","last_editor_user_id":"2764115","owner_display_name":"","owner_user_id":"2910270","post_type_id":"1","score":"0","tags":"excel|sharepoint|vbscript","view_count":"855"} +{"id":"14622986","title":"newline after heading while using \u003ch3\u003e tag in android","body":"\u003cp\u003eRecently I was trying out HTML tags in android. When I tried to use the \u003ccode\u003e\u0026lt;h3\u0026gt;\u003c/code\u003e tag, it automatically creates a line space after it and before the next line. In HTML one can remove it by making padding and margin set with 0px. Can anyone tell me how can I remove this space in an android app?\u003c/p\u003e","accepted_answer_id":"14623505","answer_count":"2","comment_count":"0","creation_date":"2013-01-31 09:59:24.17 UTC","last_activity_date":"2013-01-31 10:26:07.89 UTC","last_edit_date":"2013-01-31 10:06:33.687 UTC","last_editor_display_name":"","last_editor_user_id":"916705","owner_display_name":"","owner_user_id":"1611048","post_type_id":"1","score":"0","tags":"android|html","view_count":"428"} +{"id":"4366540","title":"How to debug the code in winform","body":"\u003cp\u003eI have a function like this in one of my classes\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eusing MFDBAnalyser;\n\nnamespace PrimaryKeyChecker\n{\n public class PrimaryKeyChecker : IMFDBAnalyserPlugin\n {\n public string RunAnalysis(string ConnectionString)\n {\n return \"Srivastava\";\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand when I call the \u003ccode\u003eRunAnalysis(string ConnectionString)\u003c/code\u003e method in another class like this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enamespace MFDBAnalyser\n{\n public interface IMFDBAnalyserPlugin\n {\n string RunAnalysis(string ConnectionString);\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThen how can I check that the RunAnalysis is whether returning Srivastava or not....\u003c/p\u003e","accepted_answer_id":"4366708","answer_count":"4","comment_count":"3","creation_date":"2010-12-06 12:49:01.687 UTC","last_activity_date":"2011-06-25 08:59:04.043 UTC","last_edit_date":"2010-12-06 12:55:05.913 UTC","last_editor_display_name":"","last_editor_user_id":"50447","owner_display_name":"","owner_user_id":"435571","post_type_id":"1","score":"0","tags":"c#|winforms","view_count":"296"} +{"id":"16700158","title":"tcl changing a global variable while in a child interpreter (interp)","body":"\u003cp\u003eI am trying to use a TCL program to read TCL modulefiles and translate them into another language. This has worked quite well until now. For reasons too complicated explain I have to treat \"puts stderr\" differently in different parts of the modulefile. I am asking for help in trying to figure out a way to do this.\u003c/p\u003e\n\n\u003cp\u003eBelow is an extremely abbreviated modulefile called \"modfile\". This \"modfile\" is translated or \"sourced\" by a second tcl program.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e proc ModulesHelp { } {\n  puts stderr \"(1) This is a help message\"\n }\n puts stderr \"(2) Here in modfile\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe puts statement inside ModulesHelp has to be treated differently from the second puts statement. Note that any solution CAN NOT CHANGE \"modfile\". That file is not under my control.\u003c/p\u003e\n\n\u003cp\u003eHere is my attempt at a solution:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e #!/usr/bin/env tclsh\n proc myPuts { stream msg } {\n global putMode\n puts stdout \"putMode: $putMode\" # \u0026lt;====== HERE 1\n puts stdout $msg\n }\n\n proc report { message } {\n puts stderr \"$message\"\n }\n\n proc execute-modulefile { m } {\n global MODFILE putMode\n\n set putMode \"normal\"\n set slave \"__mod\"\n\n interp create $slave\n interp alias $slave puts {} myPuts\n interp alias $slave report {} report\n interp eval $slave {global putMode }\n interp eval $slave [list \"set\" \"putMode\" $putMode]\n interp eval $slave [list \"set\" \"m\" $m]\n\n set errorVal [interp eval $slave {\n set sourceFailed [catch {source $m } errorMsg]\n if {[info procs \"ModulesHelp\"] == \"ModulesHelp\" } {\n set putMode \"InHelp\" # \u0026lt;======= HERE 2\n ModulesHelp\n }\n if {$sourceFailed} {\n report $errorMsg\n return 1\n }\n }]\n interp delete $slave\n return $errorVal\n }\n\n eval execute-modulefile $argv\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eTo run this I do: $ ./try.tcl modfile where obviously the above script is \"try.tcl\" and the modulefile is \"modfile\". I am running this on a linux system with tcl 8.4. \u003c/p\u003e\n\n\u003cp\u003eWhat I would like to have happen is that at the line labelled \"HERE 2\" I like to somehow change the global variable of \"putMode\" from \"normal\" to \"InHelp\" so that I can change the behavior at the line labelled \"HERE 1\". No matter what I have tried to do I can not change the value of putMode at \"HERE 1\" by doing something at \"HERE 2\". The puts statement at \"HERE1 always says \"normal\".\u003c/p\u003e\n\n\u003cp\u003eUsing a global variable seems like the easiest solution but if someone could show me how to use namespaces or some other technique, I'll be happy with that as well.\u003c/p\u003e\n\n\u003cp\u003eThanks for any insight.\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003eI greatly appreciate the time that others have looked at my question. I am trying to use the proposed solution and I'm not quite seeing it. Here is my new attempt at a solution (This doesn't work at all). Can someone suggest how I modify this code to change \"putMode\" to inHelp where \"HERE 2\" is? Also is there something special that needs to go where \"HERE 1\" is?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e #!/usr/bin/env tclsh\n proc myPuts { stream msg } {\n global putMode\n puts stdout \"putMode: $putMode\" # \u0026lt;=== HERE 1\n puts stdout $msg\n }\n\n proc report { message } {\n puts stderr \"$message\"\n }\n\n\n proc PutModeTrace {childInterp operation realPutMode} {\n # Alias the main array element for the purposes of this procedure\n upvar \\#0 PutMode($childInterp) realPutMode\n if {$operation eq \"read\"} {\n interp eval $childInterp [list set putMode $realPutMode]\n } elseif {$operation eq \"write\"} {\n set realPutMode [interp eval $childInterp {set putMode}]\n }\n }\n proc execute-modulefile { m } {\n global MODFILE putMode\n\n set putMode \"normal\"\n set slave [interp create]\n\n interp alias $slave puts {} myPuts\n interp alias $slave report {} report\n interp eval $slave {global putMode }\n interp eval $slave [list \"set\" \"putMode\" $putMode]\n interp eval $slave [list \"set\" \"m\" $m]\n interp eval $slave [list \"set\" \"slave\" $slave]\n interp eval $slave {trace add variable putMode {read write} PutModeTrace}\n interp alias $slave PutModeTrace {} PutModeTrace $slave\n set errorVal [interp eval $slave {\n set sourceFailed [catch {source $m } errorMsg]\n if {[info procs \"ModulesHelp\"] == \"ModulesHelp\" } {\n set start \"help(\\[\\[\"\n set end \"\\]\\])\"\n PutModeTrace $slave \"write\" \"inHelp\" # \u0026lt;=== HERE 2\n puts stdout $start\n ModulesHelp\n puts stdout $end\n }\n if {$sourceFailed} {\n report $errorMsg\n return 1\n }\n }]\n interp delete $slave\n return $errorVal\n }\n\n eval execute-modulefile $argv\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"3","comment_count":"1","creation_date":"2013-05-22 19:32:01.077 UTC","favorite_count":"1","last_activity_date":"2013-05-23 21:22:51.107 UTC","last_edit_date":"2013-05-23 20:59:31.877 UTC","last_editor_display_name":"","last_editor_user_id":"208809","owner_display_name":"","owner_user_id":"2410881","post_type_id":"1","score":"1","tags":"tcl|sandbox","view_count":"515"} +{"id":"42475303","title":"NAudio ASIO Playback wav","body":"\u003cp\u003eI'm using NAudio and ASIO to play a sequence of wav files. I need to use ASIO because the audio card supports only that. I was able to play each wav in this way:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e waveRead = new WaveFileReader(completeStreamMS); //completeStreamMS is a memorystream\n waveRead.Position = 0;\n pcm = new WaveChannel32(waveRead);\n reductionStream = new BlockAlignReductionStream(pcm);\n reductionStream.Position = 0;\n waveOutDevice.Init(reductionStream);\n waveOutDevice.Play();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow I need to insert 1 second of silent before the starting of the wav. The only way I found is to use an OffsetSampleProvider, but if I do like this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e ISampleProvider isp = WaveExtensionMethods.ToSampleProvider(waveRead);\n var offset = new SampleProviders.OffsetSampleProvider(isp);\n offset.DelayBy = TimeSpan.FromSeconds(1);\n var wp = new SampleProviders.SampleToWaveProvider(offset);\n waveOutDevice.Init(wp);`\n waveOutDevice.Play();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe first wav plays just fine, but as soon as I stop() the waveOutDevice or I try to reinstantiate a new one the execution of the program stops at that position with \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSystem.ExecutionEngineException\nCannot intercept exception. Debugged program can not be continued and properties can not be evaluated.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm not able to understand why. Please help.\nThanks\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-02-26 23:00:01.167 UTC","last_activity_date":"2017-03-04 11:33:25.893 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4878164","post_type_id":"1","score":"0","tags":"c#|naudio|sharpdevelop|asio","view_count":"83"} +{"id":"5630350","title":"How to make RichTextValue catalog full text search for Plone 4","body":"\u003cp\u003eI created dexterity content type with Rich Text Field - \"body text\". I'd like to make \"body text\" full text searchable for my Plone 4.0.2. \u003c/p\u003e\n\n\u003cp\u003eI added catalog.xml in my theme, code below\n\n \n \n \n \n \n \n \n \u003c/p\u003e\n\n\u003cp\u003eI got error message from ZMI/portal/portal_catalog \"body_text RichTextValue object. (Did you mean .raw or .output?) \"\u003c/p\u003e\n\n\u003cp\u003eHow can I change catalog.xml to use .output, I tried , but it doesn't work.\u003c/p\u003e\n\n\u003cp\u003eThanks. \u003c/p\u003e","answer_count":"3","comment_count":"1","creation_date":"2011-04-12 04:15:52.843 UTC","last_activity_date":"2012-04-06 21:09:08.037 UTC","last_edit_date":"2012-04-06 17:49:19.367 UTC","last_editor_display_name":"","last_editor_user_id":"246246","owner_display_name":"","owner_user_id":"703325","post_type_id":"1","score":"1","tags":"search|text|full-text-search|plone|catalog","view_count":"845"} +{"id":"42627254","title":"Why webRequest.onBeforeSendHeaders doesn't provide query string while browser.webNavigation.onBeforeNavigate does?","body":"\u003cp\u003eI am trying to implement a web extension which removes redirect intermediate from links. For example, when you click any link to foreign site from vk.com (a social network), you'll be navigated to \u003ccode\u003ehttps://vk.com/away.php?to=URL_GOES_HERE\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eWhen you listen to \u003ccode\u003eonBeforeNavigate\u003c/code\u003e events like that:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ebrowser.webNavigation.onBeforeNavigate.addListener(\n (details) =\u0026gt; {\n console.log('before navigate', details);\n }, {\n url: [\n {hostContains: \"vk.com\"}\n ]\n }\n);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eyou'll get full URL: \u003ccode\u003ebefore navigate Object { url: \"https://vk.com/away.php?to=URL_GOES_HERE\", timeStamp: 1488807415002, frameId: 0, parentFrameId: -1, tabId: 2 }\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eBut you have no option to replace that navigation action with another URL. You have that ability only for \u003ccode\u003ewebRequest\u003c/code\u003e API:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ebrowser.webRequest.onBeforeSendHeaders.addListener(\n (details) =\u0026gt; {\n console.log('before web request', details)\n },\n {urls: [\n '*://vk.com/away.php'\n ]},\n ['blocking', 'requestHeaders']\n);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut URL there doesn't contain query parameters: \u003ccode\u003ebefore web request Object { requestId: \"1\", url: \"http://vk.com/away.php\", originUrl: \"https://vk.com/feed\", method: \"GET\", type: \"main_frame\", timeStamp: 1488807415092, frameId: 0, parentFrameId: -1, tabId: 2, requestHeaders: Array[6] }\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eWhy is it working so? Is it a bug or what?\u003c/p\u003e","accepted_answer_id":"42629059","answer_count":"1","comment_count":"0","creation_date":"2017-03-06 13:45:42.503 UTC","last_activity_date":"2017-03-06 15:11:21.46 UTC","last_edit_date":"2017-03-06 13:57:34.173 UTC","last_editor_display_name":"","last_editor_user_id":"799887","owner_display_name":"","owner_user_id":"799887","post_type_id":"1","score":"1","tags":"firefox-webextensions","view_count":"69"} +{"id":"46014889","title":"Customize install.xml name in izpack","body":"\u003cp\u003eI have a problem where in my install.xml in izpack, I have few packs with conditions, and my multiple packs have common file source and targets, because of which, installer slows down and shows each file's copy and takes around 15 minutes, whereas, in reality, it should just take 3-4 minutes overall. It is pretty fast if I don't keep anything conditional in \u003ccode\u003einstall.xml\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eI want a solution for the slowdown problem. If izpack offers some customization on this XML name, then I can have two separate install XML's based on my needed packs in each install XML.\u003c/p\u003e\n\n\u003cp\u003eIs it possible? \u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-09-02 14:41:16.99 UTC","last_activity_date":"2017-09-02 17:14:21.433 UTC","last_edit_date":"2017-09-02 17:14:21.433 UTC","last_editor_display_name":"","last_editor_user_id":"615746","owner_display_name":"","owner_user_id":"8516431","post_type_id":"1","score":"0","tags":"installer|customization|izpack|slowdown","view_count":"24"} +{"id":"35560006","title":"(libgdx/java) ArrayList won't clear/delete instance of class?","body":"\u003cp\u003e\u003cstrong\u003eItem class:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public class Item {\n public float x, y, speedx, speedy;\n public Rectangle container;\n public Texture texture;\n static Timer timer = new Timer();\n static int amount;\n static int spawned;\n public int itemtype;\n // float delay = 1; // seconds\n\n public void move() {\n x += speedx;\n y += speedy;\n\n container.x = x;\n container.y = y;\n\n }\n public void setTexture(int itemtype){\n switch(itemtype){\n case 1:\n texture = new Texture(\"items/item1.png\");\n break;\n case 2:\n texture = new Texture(\"items/item2.png\");\n break;\n case 3:\n texture = new Texture(\"items/item3.png\");\n break;\n case 4:\n texture = new Texture(\"items/item4.png\");\n break;\n case 5:\n texture = new Texture(\"items/item5.png\");\n break;\n case 6:\n texture = new Texture(\"items/item6.png\");\n break;\n case 7:\n texture = new Texture(\"items/item7.png\");\n break;\n case 8:\n texture = new Texture(\"items/item8.png\");\n break;\n case 9:\n texture = new Texture(\"items/item9.png\");\n break;\n case 10:\n texture = new Texture(\"items/item10.png\");\n break;\n default:\n texture = new Texture(\"items/error.png\");\n break;\n }\n\n }\n public static void spawnItem(int amount){\n Item.amount = amount;\n mainscreen.items.clear();\n // for(int spawned = 0; spawned \u0026lt;= amount; spawned++){\n\n\n\n timer.schedule(new Timer.Task() {\n\n @Override\n public void run() {\n if (mainscreen.canclick == false) {\n Item item = new Item();\n item.x = 600;\n item.y = -42;\n item.speedx = -20;\n item.speedy = 0;\n Rectangle itemcontainer = new Rectangle();\n itemcontainer.x = item.x;\n itemcontainer.y = item.y;\n itemcontainer.width = mainscreen.container.getWidth() / 4f;\n itemcontainer.height = mainscreen.container.getHeight() - 15f;\n item.container = itemcontainer;\n item.itemtype = MathUtils.random(1, 10);\nitem.setTexture(item.itemtype);\n mainscreen.items.add(item);\n spawned++;\n }\n for (Item item : mainscreen.items) {\n if (item.x \u0026lt;= -4000) {\n if (spawned \u0026gt;= Item.amount) {\n mainscreen.canclick = true;\n\n\n timer.stop();\n spawned = 0;\n }\n\n } else {\n\n }\n }\n }\n }, 0, 0.325f);\n\n }\n public void dispose(){\n texture.dispose();\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eMainscreen class:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class mainscreen implements Screen, GestureDetector.GestureListener,InputProcessor {\n @Override\n public void render(float delta) {\n this.delta = delta;\n Gdx.gl.glClearColor(115 / 255F, 115 / 255F, 115 / 255F, 1 / 255F);\n Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);\n batch.setProjectionMatrix(camera.combined);\n\n if(Gdx.input.justTouched()) {\n\n Vector3 touch1 = new Vector3(Gdx.input.getX(), Gdx.input.getY(), 0);\n camera.unproject(touch1);\n\n\n if (debug.contains(touch1.x, touch1.y)) {\n items.clear();\n }\n\n if (start.contains(touch1.x, touch1.y)) {\n if (canclick == true) {\n\n canclick = false;\n\n Item.spawnItem(20);\n }\n\n }\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eLOG:\u003c/strong\u003e\nOn first click start:\n(After the Timer has finished)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecanclick: true\nitems list: [com.abc.luckyllama.Item@37237aa0, com.abc.luckyllama.Item@2de938e3, com.abc.luckyllama.Item@3cb912d5, com.abc.luckyllama.Item@2bae592c, com.abc.luckyllama.Item@774c083, com.abc.luckyllama.Item@633edeae, com.abc.luckyllama.Item@176557a6, com.abc.luckyllama.Item@4edb1b5f, com.abc.luckyllama.Item@6f8abadf, com.abc.luckyllama.Item@7a54d22e, com.abc.luckyllama.Item@473162a5, com.abc.luckyllama.Item@51a698ff, com.abc.luckyllama.Item@6bc08c56, com.abc.luckyllama.Item@37d9e6a2, com.abc.luckyllama.Item@7bb19eb6, com.abc.luckyllama.Item@1eb5805f, com.abc.luckyllama.Item@71780de3, com.abc.luckyllama.Item@9ec0998, com.abc.luckyllama.Item@7edf723d, com.abc.luckyllama.Item@4c5aa2c1]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAfter clicking the debug button(clears arraylist):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecanclick: true\nitems list: []\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAfter clicking the start button again:\n(After the Timer has finished)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e canclick: true\nitems list: [com.abc.luckyllama.Item@7d7cb9bc, com.abc.luckyllama.Item@1435cf42, com.abc.luckyllama.Item@117e1963, com.abc.luckyllama.Item@82bfd27, com.abc.luckyllama.Item@108214c7, com.abc.luckyllama.Item@2a77864a, com.abc.luckyllama.Item@4b232766, com.abc.luckyllama.Item@1cb629e0, com.abc.luckyllama.Item@1c92229d, com.abc.luckyllama.Item@ac1b293, com.abc.luckyllama.Item@588bbcba, com.abc.luckyllama.Item@75df6762, com.abc.luckyllama.Item@78d4358e, com.abc.luckyllama.Item@7f86452d, com.abc.luckyllama.Item@7aed480b, com.abc.luckyllama.Item@7407d443, com.abc.luckyllama.Item@2da6e708, com.abc.luckyllama.Item@604470bc, com.abc.luckyllama.Item@70f9d1af, com.abc.luckyllama.Item@3a16a63f, com.abc.luckyllama.Item@201288d2, com.abc.luckyllama.Item@6310ddfc, com.abc.luckyllama.Item@5d5a1c98, com.abc.luckyllama.Item@52727e52, com.abc.luckyllama.Item@669228d6]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eYou see that the Items inside the ArrayList didn't get cleared. It increased. I think that's because the instances of Item created in spawnItem() are still there. How do I fix this?\u003c/p\u003e\n\n\u003cp\u003eI noticed that every time I click the button there aren't more items. The items are spawned faster. But how to stop this?\u003c/p\u003e","accepted_answer_id":"35581018","answer_count":"1","comment_count":"4","creation_date":"2016-02-22 17:26:51.507 UTC","favorite_count":"1","last_activity_date":"2016-02-23 15:07:01.803 UTC","last_edit_date":"2016-02-23 11:30:53.047 UTC","last_editor_display_name":"","last_editor_user_id":"5847118","owner_display_name":"","owner_user_id":"5847118","post_type_id":"1","score":"0","tags":"arraylist|timer|libgdx|clear","view_count":"101"} +{"id":"26405714","title":"ExpressJS API router.get external function","body":"\u003cp\u003eI am trying to hack together two separate examples, I have them working separately but I can't wrap my head around how to combine them. I have now wasted multiple hours getting something so basic to work.\u003c/p\u003e\n\n\u003cp\u003eI have ExpressJS running an API. The test message works.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e// test route to make sure everything is working (accessed at GET http://localhost:8080/api)\nrouter.get('/', function(req, res) {\n res.json({ message: 'This is a test message' }); \n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to show the output of the the below, instead of the message: This is a test message\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eserverClient.call('version', {}, function (err, res) {\n console.log('Server Version: %j', res.version);\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCan anyone point me in the right direction with a clear how to option or show me the code?\u003c/p\u003e","answer_count":"2","comment_count":"3","creation_date":"2014-10-16 13:28:13.38 UTC","last_activity_date":"2014-10-16 13:45:17.56 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4149879","post_type_id":"1","score":"0","tags":"node.js|express","view_count":"168"} +{"id":"6584083","title":"problem with wpf command not executing when button clicked","body":"\u003cp\u003eI have the following xaml in a wpf application. I would like to bind the button to an ICommand in a view model. For some reason, I am not able to see the command from my view.\nthis is in a user control.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;Grid\u0026gt;\n\u0026lt;Grid.DataContext\u0026gt;\n \u0026lt;Binding \n x:Name=\"SettingsData\"\n Path=\"Data\" /\u0026gt;\n \u0026lt;/Grid.DataContext\u0026gt;\n.\n.\n.\n\u0026lt;DockPanel Grid.Column=\"1\"\u0026gt;\n \u0026lt;Button x:Name=\"SaveButton\" \n DockPanel.Dock=\"Top\" \n Height=\"25\" \n HorizontalAlignment=\"Left\" \n Margin=\"70 0 0 0\"\n Command=\"{Binding Path=SaveData}\"\n\n \u0026gt;Save Changes\u0026lt;/Button\u0026gt;\n \u0026lt;/DockPanel\u0026gt;\n\u0026lt;/Grid\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is my ICommand object - \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic ICommand SaveData\n {\n get\n {\n if (_saveData == null)\n {\n _saveData = new RelayCommand(\n param =\u0026gt; this.saveData(),\n param =\u0026gt; true\n );\n }\n return _saveData ;\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eDoes anyone have any idea why I cannot bind to this command?\u003c/p\u003e\n\n\u003cp\u003eThanks for any thoughts....\u003c/p\u003e","accepted_answer_id":"6584581","answer_count":"2","comment_count":"5","creation_date":"2011-07-05 14:12:49.417 UTC","favorite_count":"1","last_activity_date":"2011-07-05 15:16:40.203 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"306894","post_type_id":"1","score":"4","tags":"wpf|binding","view_count":"11473"} +{"id":"44161918","title":"jQuery slider navigation gets off sync on click","body":"\u003cp\u003eI have a basic jQuery slider. The slides automatically rotate. There is also a navigation that users can click to go to a different slide. For example, if there are three slides than three circles appear for the navigation. The user can click each individual circle to go to a different slide. If the circle's associated slide is active than the circle will be filled in.\u003c/p\u003e\n\n\u003cp\u003eRight now, the slides are working on a timer. Every three seconds a new slide appears. The navigation will also change with each new slide to show which slide is active. \u003c/p\u003e\n\n\u003cp\u003eThe problem is that when a user clicks any of the navigation items, the navigation gets off sync with the slides. \u003c/p\u003e\n\n\u003cp\u003eHTML:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;div class=\"home-hero\"\u0026gt;\n \u0026lt;div class=\"hero-slide-holder\"\u0026gt;\n \u0026lt;div class=\"slide1\"\u0026gt;\n \u0026lt;div class=\"text-slide\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;p\u0026gt;\u0026lt;/p\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"slide2\"\u0026gt;\n \u0026lt;div class=\"text-slide\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;p\u0026gt;\u0026lt;/p\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"slide3\"\u0026gt;\n \u0026lt;div class=\"text-slide\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;p\u0026gt;\u0026lt;/p\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"slide4\"\u0026gt;\n \u0026lt;div class=\"text-slide\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;p\u0026gt;\u0026lt;/p\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"hero-nav\"\u0026gt;\n \u0026lt;div class=\"active\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;div class=\"\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;div class=\"\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;div class=\"\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt; \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ejQuery:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$('.hero-nav div').click(function() {\n $('.hero-nav div').removeClass('active');\n $(this).addClass('active');\n $('.home-hero div[class^=\"slide\"], .portfolio-hero div[class^=\"slide\"]').hide();\n if ($(this).is(':nth-child(1)')) {\n $('.slide1').css('display', 'flex');\n } else if ($(this).is(':nth-child(2)')) {\n $('.slide2').css('display', 'flex');\n } else if ($(this).is(':nth-child(3)')) {\n $('.slide3').css('display', 'flex');\n } else if ($(this).is(':nth-child(4)')) {\n $('.slide4').css('display', 'flex');\n } else {\n $('.slide5').css('display', 'flex');\n }\n});\n\nvar toggleSlide = function(){\n $(\".hero-nav .active\").removeClass().next().add(\".hero-nav div:first\").last().addClass(\"active\");\n $('.hero-slide-holder \u0026gt; div:first').fadeOut(1000).next().css('display', 'flex').fadeIn(1000).end().appendTo('.hero-slide-holder');\n}\nsetInterval(toggleSlide, 3000);\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-05-24 14:52:10.973 UTC","last_activity_date":"2017-05-24 14:52:10.973 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"715564","post_type_id":"1","score":"0","tags":"javascript|jquery|html|css","view_count":"20"} +{"id":"14427607","title":"how to scale img by percentage of self and not percentage of its container","body":"\u003cp\u003ehow to scale img by percentage of self and not percentage of its container?\u003c/p\u003e\n\n\u003cp\u003eI can't believe I never ran into this problem before, so I'm guessing either the standard changed, or I am doing something wrong, because I am pretty sure that back in the day, before CSS even, it was possible to scale an image like this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;img src=\"something.jpg\" height=\"50%\" width=\"50%\"\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut now that scales it by the container objects size, which is totally irrelevant to me.\u003c/p\u003e\n\n\u003cp\u003eIS there no other way than for me to start calculating pixels and such in a javascript to achieve this very simple image styling?\u003c/p\u003e\n\n\u003cp\u003eIf I have an image 500px wide, and the user selects 50%, I want that image to show up 250px wide, I don't care one bit about the size of its container at this moment...\u003c/p\u003e","accepted_answer_id":"16230227","answer_count":"4","comment_count":"2","creation_date":"2013-01-20 18:14:00.873 UTC","last_activity_date":"2013-04-26 06:42:13 UTC","last_edit_date":"2013-01-20 18:36:15.403 UTC","last_editor_display_name":"","last_editor_user_id":"942230","owner_display_name":"","owner_user_id":"942230","post_type_id":"1","score":"2","tags":"css|image|scaling","view_count":"802"} +{"id":"38691139","title":"Android MediaRecorder stop() not being called","body":"\u003cp\u003eI have this really weird bug where some of my code is not being called, but doesn't look there is any reason why it wouldn't be called.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003e\u003ccode\u003eonFinishedRecording\u003c/code\u003e gets called and the tag \u003ccode\u003e\"Finished recording.\"\u003c/code\u003e gets logged out, but the code after that does not get called at all. All the code stops being called when \u003ccode\u003emMediaRecorder.stop();\u003c/code\u003e is called. It also does not go into the catch block either. Why is this happening?\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI thought it might have to do with different threads, but I checked all the thread names and they are all running on the same main thread.\u003c/p\u003e\n\n\u003cp\u003e\u003cem\u003eAlso, could there be something wrong with my camera preview setup? When I try to play the video back, it is corrupted and not able to playback.\u003c/em\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cem\u003eIn addition to the above problems, my back button doesn't do anything in the application. Not quite show why or how it is related to the code that I have implemented.\u003c/em\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eMyLibrary class (library module class)\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class MyLibrary implements PreciseCountdownTimer.PreciseCountdownTimerCallback {\n\n private static final String TAG = AngryOtter.class.getSimpleName();\n private static final long MAX_RECORD_TIME_MILLIS = 3000;\n private static final long INTERVAL_MILLIS = 1000;\n\n private static MyLibrary mInstance;\n\n private Activity mActivity;\n private CameraInitListener mCallback;\n\n private int mCameraId = -1;\n private Camera mCamera;\n private SurfaceView mCameraPreview;\n private MediaRecorder mMediaRecorder;\n private PreciseCountdownTimer mTimer;\n private File mTempVideoFile;\n\n public static MyLibrary getInstance() {\n if (mInstance == null) {\n mInstance = new MyLibrary();\n }\n return mInstance;\n }\n\n // Call this in onResume of the activity\n public void initialize(Activity activity) {\n mActivity = activity;\n\n try {\n mCallback = (CameraInitListener) mActivity;\n } catch (ClassCastException e) {\n throw new ClassCastException(activity.getClass().getSimpleName()\n + \" must implement CameraInitListener\");\n }\n\n if (ViewUtil.checkValidRootView(mActivity)) {\n PermissionUtil.requestPermissions(mActivity);\n prepareCamera();\n if (mCamera == null) {\n return;\n }\n addCameraPreview();\n }\n }\n\n // Call this in onPause of the activity\n public void release() {\n releaseMediaRecorder();\n releaseCamera();\n removeCameraPreview();\n releaseTimer();\n }\n\n public void startRecording() {\n if (checkPermissions()) {\n try {\n mMediaRecorder.start();\n mTimer.start();\n Log.d(TAG, \"Recording started.\");\n } catch (IllegalStateException e) {\n releaseMediaRecorder();\n releaseTimer();\n }\n } else {\n releaseMediaRecorder();\n }\n }\n\n public void stopRecording() {\n onFinishedRecording();\n }\n\n @Override\n public void onPreciseTimerTick(long remainingTime) {\n Log.d(TAG, \"TICK: \" + String.valueOf(remainingTime));\n }\n\n @Override\n public void onPreciseTimerFinished() {\n Log.d(TAG, \"Timer Finished.\");\n mActivity.runOnUiThread(new Runnable() {\n @Override\n public void run() {\n onFinishedRecording();\n }\n });\n }\n\n private boolean checkPermissions() {\n if (PermissionUtil.checkCameraPermission(mActivity)\n \u0026amp;\u0026amp; PermissionUtil.checkRecordAudioPermission(mActivity)\n \u0026amp;\u0026amp; PermissionUtil.checkWriteExternalStoragePermission(mActivity)) {\n return true;\n } else {\n return false;\n }\n }\n\n private void prepareCamera() {\n mCameraId = CameraUtil.getFrontCameraId();\n if (mCameraId != -1) {\n try {\n Log.d(TAG, \"Initializing front camera.\");\n mCamera = Camera.open(mCameraId);\n } catch (Exception e) {\n Log.e(TAG, \"Error initializing front camera: \" + e.getMessage());\n mCamera = null;\n }\n } else {\n mCamera = null;\n }\n }\n\n private void releaseCamera() {\n if (mCamera != null){\n Log.d(TAG, \"Releasing camera.\");\n mCamera.release();\n mCamera = null;\n }\n }\n\n private void addCameraPreview() {\n mCameraPreview = new SurfaceView(mActivity);\n mCameraPreview.getHolder().addCallback(new SurfaceHolder.Callback() {\n @Override\n public void surfaceCreated(SurfaceHolder holder) {\n Log.d(TAG, \"Preview surface created.\");\n try {\n Log.d(TAG, \"Setting preview display.\");\n mCamera.setPreviewDisplay(holder);\n mCamera.startPreview();\n onPreviewDisplaySet();\n } catch (IOException e) {\n Log.e(TAG, \"Error setting camera preview: \" + e.getMessage());\n }\n }\n\n @Override\n public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {\n Log.d(TAG, \"Preview surface changed.\");\n // If your preview can change or rotate, take care of those events here.\n // Make sure to stop the preview before resizing or reformatting it.\n\n if (mCameraPreview.getHolder().getSurface() == null) {\n // preview surface does not exist\n return;\n }\n\n // stop preview before making changes\n try {\n mCamera.stopPreview();\n } catch (Exception e){\n // ignore: tried to stop a non-existent preview\n }\n\n // Adjust orientation\n final int rotation = CameraUtil.getAdjustedDisplayOrientation(mActivity, mCameraId);\n mCamera.setDisplayOrientation(rotation);\n\n // set preview size and make any resize, rotate or\n // reformatting changes here\n\n // start preview with new settings\n try {\n mCamera.setPreviewDisplay(mCameraPreview.getHolder());\n mCamera.startPreview();\n } catch (Exception e){\n Log.d(TAG, \"Error starting camera preview: \" + e.getMessage());\n }\n }\n\n @Override\n public void surfaceDestroyed(SurfaceHolder holder) {\n Log.d(TAG, \"Preview surface destroyed.\");\n }\n });\n mCameraPreview.setLayoutParams(new FrameLayout.LayoutParams(100, 100, Gravity.TOP|Gravity.RIGHT));\n mCameraPreview.setBackgroundColor(ContextCompat.getColor(mActivity, android.R.color.holo_red_dark));\n\n final WindowManager windowManager =\n (WindowManager) mActivity.getSystemService(Context.WINDOW_SERVICE);\n final WindowManager.LayoutParams layoutParams = new WindowManager.LayoutParams(1, 1,\n WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY, 0, PixelFormat.UNKNOWN);\n windowManager.addView(mCameraPreview, layoutParams);\n }\n\n private void removeCameraPreview() {\n if (mCameraPreview != null) {\n final ViewGroup rootView = ViewUtil.getRootView(mActivity);\n rootView.removeView(mCameraPreview);\n }\n }\n\n private void onPreviewDisplaySet() {\n createTempVideoFile();\n\n prepareMediaRecorder();\n if (mMediaRecorder == null) {\n return;\n }\n\n prepareTimer();\n mCallback.onCameraInitialized();\n }\n\n private void createTempVideoFile() {\n mTempVideoFile = FileUtil.getTempVideoFile(mActivity);\n }\n\n private void prepareMediaRecorder() {\n if (mCamera != null) {\n mCamera.unlock();\n }\n\n mMediaRecorder = new MediaRecorder();\n mMediaRecorder.setCamera(mCamera);\n mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER);\n mMediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);\n mMediaRecorder.setProfile(CamcorderProfile.get(mCameraId, CamcorderProfile.QUALITY_HIGH));\n mMediaRecorder.setOutputFile(mTempVideoFile.getAbsolutePath());\n mMediaRecorder.setPreviewDisplay(mCameraPreview.getHolder().getSurface());\n// mMediaRecorder.setOrientationHint(90);\n\n try {\n Log.d(TAG, \"Preparing media recorder.\");\n mMediaRecorder.prepare();\n } catch (IllegalStateException|IOException e) {\n Log.e(TAG, \"Error preparing MediaRecorder: \" + e.getMessage());\n releaseMediaRecorder();\n }\n }\n\n private void releaseMediaRecorder() {\n if (mMediaRecorder != null) {\n Log.d(TAG, \"Releasing media recorder.\");\n mMediaRecorder.reset();\n mMediaRecorder.release();\n mMediaRecorder = null;\n }\n\n if (mCamera != null) {\n mCamera.lock();\n }\n }\n\n private void prepareTimer() {\n mTimer = new PreciseCountdownTimer(MAX_RECORD_TIME_MILLIS, INTERVAL_MILLIS, this);\n }\n\n private void releaseTimer() {\n if (mTimer != null) {\n Log.d(TAG, \"Stopping timer.\");\n mTimer.stop();\n }\n }\n\n private void onFinishedRecording() {\n Log.d(TAG, \"Finished recording.\");\n try {\n mMediaRecorder.stop();\n Log.d(TAG, \"Media recorder stopped.\");\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n releaseMediaRecorder();\n releaseTimer();\n getSignedUrl();\n }\n\n private void getSignedUrl() {\n new GcpSigningRequest(new NetworkCallback\u0026lt;String\u0026gt;() {\n @Override\n public void onSuccess(String response) {\n uploadVideo(response);\n }\n\n @Override\n public void onError() {\n Log.e(TAG, \"Error getting signing request.\");\n }\n }).addToQueue();\n }\n\n private void uploadVideo(String signedUrl) {\n new UploadToGoogleRequest(signedUrl, mTempVideoFile.getName(),\n Uri.parse(mTempVideoFile.getAbsolutePath()), new NetworkCallback\u0026lt;Boolean\u0026gt;() {\n @Override\n public void onSuccess(Boolean response) {\n\n }\n\n @Override\n public void onError() {\n\n }\n }).addToQueue();\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eRecordActivity\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class RecordActivity extends AppCompatActivity implements\n CameraInitListener {\n\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n }\n\n @Override\n protected void onResume() {\n super.onResume();\n MyLibrary.getInstance().initialize(this);\n }\n\n @Override\n protected void onPause() {\n MyLibrary.getInstance().release();\n super.onPause();\n }\n\n @Override\n public void onCameraInitialized() {\n MyLibrary.getInstance().startRecording();\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo everything works fine until this method is called:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e private void onFinishedRecording() {\n Log.d(TAG, \"Finished recording.\");\n try {\n mMediaRecorder.stop();\n Log.d(TAG, \"Media recorder stopped.\");\n } catch (IllegalStateException e) {\n e.printStackTrace();\n }\n\n releaseMediaRecorder();\n releaseTimer();\n getSignedUrl();\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eFull Phone Stacktrace\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e08-15 21:17:46.735 24660-24660/com.walintukai.heatmapdemo I/dalvikvm: Could not find method android.content.res.Resources.getDrawable, referenced from method android.support.v7.widget.ResourcesWrapper.getDrawable\n08-15 21:17:46.735 24660-24660/com.walintukai.heatmapdemo W/dalvikvm: VFY: unable to resolve virtual method 690: Landroid/content/res/Resources;.getDrawable (ILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;\n08-15 21:17:46.735 24660-24660/com.walintukai.heatmapdemo D/dalvikvm: VFY: replacing opcode 0x6e at 0x0002\n08-15 21:17:46.735 24660-24660/com.walintukai.heatmapdemo I/dalvikvm: Could not find method android.content.res.Resources.getDrawableForDensity, referenced from method android.support.v7.widget.ResourcesWrapper.getDrawableForDensity\n08-15 21:17:46.735 24660-24660/com.walintukai.heatmapdemo W/dalvikvm: VFY: unable to resolve virtual method 692: Landroid/content/res/Resources;.getDrawableForDensity (IILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;\n08-15 21:17:46.735 24660-24660/com.walintukai.heatmapdemo D/dalvikvm: VFY: replacing opcode 0x6e at 0x0002\n08-15 21:17:46.785 933-11266/? D/KeyguardUpdateMonitor: sendKeyguardVisibilityChanged(true)\n08-15 21:17:46.785 933-933/? D/KeyguardUpdateMonitor: handleKeyguardVisibilityChanged(1)\n08-15 21:17:46.785 731-2931/? E/EnterpriseContainerManager: ContainerPolicy Service is not yet ready!!!\n08-15 21:17:46.785 731-2931/? D/EnterpriseDeviceManager: ContainerId: 0\n08-15 21:17:46.785 731-2931/? W/LicenseLogService: log() failed\n08-15 21:17:46.805 170-170/? E/SMD: DCD ON\n08-15 21:17:46.865 933-11213/? D/KeyguardUpdateMonitor: sendKeyguardVisibilityChanged(true)\n08-15 21:17:46.865 933-933/? D/KeyguardUpdateMonitor: handleKeyguardVisibilityChanged(1)\n08-15 21:17:46.935 380-24718/? E/mm-camera: color_correct_apply_gain: cc_gain_adj 1.000, digital_gain_brightness 1.000 dig_gain = 1.000\n08-15 21:17:47.055 731-24783/? W/ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:1509 com.android.server.InputMethodManagerService$4.run:2683 java.lang.Thread.run:841 \u0026lt;bottom of call stack\u0026gt; \u0026lt;bottom of call stack\u0026gt; \n08-15 21:17:47.145 174-234/? E/qdmemalloc: heap_msk=3000000 flags=1\n\n08-15 21:17:47.165 174-234/? E/qdmemalloc: heap_msk=40000000 flags=1\n\n08-15 21:17:47.185 933-10839/? D/KeyguardUpdateMonitor: sendKeyguardVisibilityChanged(true)\n08-15 21:17:47.185 933-933/? D/KeyguardUpdateMonitor: handleKeyguardVisibilityChanged(1)\n08-15 21:17:47.225 933-947/? D/KeyguardUpdateMonitor: sendKeyguardVisibilityChanged(true)\n08-15 21:17:47.245 933-933/? D/KeyguardUpdateMonitor: handleKeyguardVisibilityChanged(1)\n08-15 21:17:47.265 933-10842/? D/KeyguardUpdateMonitor: sendKeyguardVisibilityChanged(true)\n08-15 21:17:47.275 174-940/? E/qdmemalloc: heap_msk=3000000 flags=1\n\n08-15 21:17:47.275 174-940/? E/qdmemalloc: heap_msk=40000000 flags=1\n\n08-15 21:17:47.285 24660-24660/com.walintukai.heatmapdemo D/RecordingService: Tick: 2000\n08-15 21:17:47.295 933-933/? D/KeyguardUpdateMonitor: handleKeyguardVisibilityChanged(1)\n08-15 21:17:47.305 179-24742/? W/CameraSource: Timed out waiting for incoming camera video frames: 0 us\n08-15 21:17:47.375 933-11213/? D/KeyguardUpdateMonitor: sendKeyguardVisibilityChanged(true)\n08-15 21:17:47.375 933-933/? D/KeyguardUpdateMonitor: handleKeyguardVisibilityChanged(1)\n08-15 21:17:47.506 933-953/? D/KeyguardUpdateMonitor: sendKeyguardVisibilityChanged(true)\n08-15 21:17:47.506 933-933/? D/KeyguardUpdateMonitor: handleKeyguardVisibilityChanged(1)\n08-15 21:17:47.666 731-838/? D/PackageManager: [MSG] CHECK_PENDING_VERIFICATION\n08-15 21:17:47.766 179-460/? D/AudioStreamOutALSA: standby\n08-15 21:17:47.766 179-460/? D/ALSAModule: s_standby: handle 0xb7c24650 h 0x0\n08-15 21:17:47.766 179-460/? E/ALSAModule: s_standby handle h 0xb7ceb678\n08-15 21:17:47.836 933-6432/? D/KeyguardUpdateMonitor: sendKeyguardVisibilityChanged(true)\n08-15 21:17:47.846 933-933/? D/KeyguardUpdateMonitor: handleKeyguardVisibilityChanged(1)\n08-15 21:17:47.846 174-234/? I/SurfaceFlinger: id=833 Removed ieatmapdemo (12/17)\n08-15 21:17:47.846 174-940/? I/SurfaceFlinger: id=833 Removed ieatmapdemo (-2/17)\n08-15 21:17:47.896 933-11464/? D/KeyguardUpdateMonitor: sendKeyguardVisibilityChanged(true)\n08-15 21:17:47.906 933-933/? D/KeyguardUpdateMonitor: handleKeyguardVisibilityChanged(1)\n08-15 21:17:47.956 179-460/? D/ALSAModule: checkRunningHandle return false\n08-15 21:17:47.956 179-460/? D/alsa_ucm: snd_use_case_set(): uc_mgr 0xb7bf62a0 identifier _verb value Inactive\n08-15 21:17:47.956 179-460/? D/alsa_ucm: Set mixer controls for HiFi enable 0\n08-15 21:17:47.956 179-460/? D/alsa_ucm: Setting mixer control: PRI_RX Audio Mixer MultiMedia1, value: 0\n08-15 21:17:47.956 179-460/? E/ALSAModule: Number of modifiers 1\n08-15 21:17:47.956 179-460/? E/ALSAModule: index 0 modifier Capture Music\n08-15 21:17:47.956 179-460/? E/ALSAModule: use case is Capture Music\n08-15 21:17:47.956 179-460/? E/ALSAModule: usecase_type is 2\n08-15 21:17:47.956 179-460/? D/alsa_ucm: snd_use_case_set(): uc_mgr 0xb7bf62a0 identifier _disdev value Speaker\n08-15 21:17:47.956 179-460/? D/alsa_ucm: Set mixer controls for Speaker enable 0\n08-15 21:17:47.956 179-460/? D/alsa_ucm: Setting mixer control: RX5 MIX1 INP1, value: ZERO\n08-15 21:17:47.966 179-460/? D/alsa_ucm: Setting mixer control: RX5 MIX1 INP2, value: ZERO\n08-15 21:17:47.966 179-460/? D/alsa_ucm: Setting mixer control: LINEOUT2 Volume, value: 0\n08-15 21:17:47.966 179-460/? D/alsa_ucm: Setting mixer control: LINEOUT4 Volume, value: 0\n08-15 21:17:47.966 179-460/? D/alsa_ucm: Setting mixer control: RX5 Digital Volume, value: 0\n08-15 21:17:48.286 24660-24660/com.walintukai.heatmapdemo D/RecordingService: Tick: 1000\n08-15 21:17:48.296 731-824/? D/SensorService: 0.2 -0.0 11.0\n08-15 21:17:48.647 731-824/? E/Sensors: accelHandler 0.162861 -0.044308 11.044633\n08-15 21:17:48.727 179-24722/? E/mm-camera: poll type 1 returns 0\n08-15 21:17:48.727 179-24723/? E/mm-camera: poll type 1 returns 0\n08-15 21:17:48.727 179-24721/? E/mm-camera: poll type 1 returns 0\n08-15 21:17:49.297 24660-24660/com.walintukai.heatmapdemo D/RecordingService: Tick: 0\n08-15 21:17:49.297 24660-24660/com.walintukai.heatmapdemo D/RecordingService: Timer Finished\n08-15 21:17:49.297 24660-24660/com.walintukai.heatmapdemo D/RecordingService: Finished recording\n08-15 21:17:49.297 179-20689/? D/MPEG4Writer: Stopping Video track\n08-15 21:17:49.808 170-170/? E/SMD: DCD ON\n08-15 21:17:50.309 179-24742/? W/CameraSource: Timed out waiting for incoming camera video frames: 0 us\n08-15 21:17:51.440 179-24720/? E/mm-camera: poll type 1 returns 0\n08-15 21:17:51.570 179-24724/? E/mm-camera: poll type 0 returns 0\n08-15 21:17:51.800 731-824/? D/SensorService: 0.2 -0.0 11.1\n08-15 21:17:52.111 731-856/? V/AlarmManager: waitForAlarm result :4\n08-15 21:17:52.121 731-856/? V/AlarmManager: trigger ELAPSED_REALTIME_WAKEUP or RTC_WAKEUP\n08-15 21:17:52.151 731-824/? E/Sensors: accelHandler 0.129331 -0.021555 11.078163\n08-15 21:17:52.151 19505-24874/? I/Finsky: [3562] com.google.android.finsky.receivers.FlushLogsReceiver$FlushLogsService.onHandleIntent(163): Flushing event logs for [wwRg65ZPhINg_7-olzSHzcWExtM]\n08-15 21:17:52.161 19505-19520/? I/PlayCommon: [3510] com.google.android.play.a.al.e(730): Preparing logs for uploading\n08-15 21:17:52.161 19505-20595/? I/PlayCommon: [3552] com.google.android.play.a.w.a(27553): Starting to flush logs\n08-15 21:17:52.161 19505-20595/? I/PlayCommon: [3552] com.google.android.play.a.w.a(27564): Log flushed by 0 successful uploads\n08-15 21:17:52.201 1184-1184/? I/Auth: [AuthDelegateWrapper] Service intent: Intent { cmp=com.google.android.gms/.auth.account.authenticator.DefaultAuthDelegateService }.\n08-15 21:17:52.201 1184-1184/? I/Auth: [AuthDelegateWrapper] Service intent: Intent { cmp=com.google.android.gms/.auth.account.authenticator.DefaultAuthDelegateService }.\n08-15 21:17:52.261 19505-19520/? I/PlayCommon: [3510] com.google.android.play.a.al.a(870): Connecting to server: https://play.googleapis.com/play/log?format=raw\u0026amp;proto_v2=true\n08-15 21:17:52.441 731-826/? W/ProcessCpuTracker: Skipping unknown process pid 24877\n08-15 21:17:52.451 731-826/? W/ProcessCpuTracker: Skipping unknown process pid 24879\n08-15 21:17:52.451 731-826/? W/ProcessCpuTracker: Skipping unknown process pid 24880\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"3","comment_count":"10","creation_date":"2016-08-01 04:40:49.877 UTC","last_activity_date":"2016-08-18 20:17:10.053 UTC","last_edit_date":"2016-08-16 04:39:20.503 UTC","last_editor_display_name":"","last_editor_user_id":"2917742","owner_display_name":"","owner_user_id":"2917742","post_type_id":"1","score":"11","tags":"java|android|mediarecorder|android-mediarecorder","view_count":"389"} +{"id":"27941867","title":"State transition not persisited in database in integration test using Capybara on a Ruby on Rails project","body":"\u003cp\u003eI am using \u003ccode\u003estate_machine\u003c/code\u003e gem -- \u003ca href=\"https://github.com/pluginaweek/state_machine\" rel=\"nofollow\"\u003ehttps://github.com/pluginaweek/state_machine\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eIn my TEST ENVIRONMENT WITH CAPYBARA I am executing\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eorder.good_data!\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003ccode\u003egood_data\u003c/code\u003e in an event defined in my state machine.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003estate_machine :initial =\u0026gt; :new, :use_transactions =\u0026gt; false do\n\n event :good_data do\n transition [:new] =\u0026gt; :sane\n end\n\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I check the order in my db it is still in \u003ccode\u003enew\u003c/code\u003e state.\u003c/p\u003e\n\n\u003cp\u003eIt is working properly in my production and development environments.\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2015-01-14 11:29:12.397 UTC","last_activity_date":"2015-01-16 14:28:44.203 UTC","last_edit_date":"2015-01-14 14:38:50.423 UTC","last_editor_display_name":"","last_editor_user_id":"658469","owner_display_name":"","owner_user_id":"1628353","post_type_id":"1","score":"0","tags":"ruby-on-rails|ruby-on-rails-3.2|capybara|integration-testing","view_count":"33"} +{"id":"3092033","title":"Program received signal: “EXC_BAD_ACCESS”","body":"\u003cp\u003eI am writing the code using cocos2d.\nI want to release all the memory I allocated. I have done it in dealloc method in the following way.\u003cbr\u003e\n All the objects I released are declared in interface file and property (assign) was set and are synthesized in implementation file.\u003cbr\u003e\nI used alloc method to create them like\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eself.PlayerA = [[CCSprite alloc] initWithFile:@\" PlayerImage_01.png\"];\n\n\n-(void)dealloc\n{\n int count , i ;\n\n count = [self.PlayerA retainCount];\n for(i = 0; i \u0026lt; count; i++)\n [self.PlayerA release];\n\n count = [self.targetLayer retainCount];\n for(i = 0; i \u0026lt; count; i++)\n [self.targetLayer release];\n\n count = [self.playerGunSlowDrawSheet retainCount];\n for(i = 0; i \u0026lt; count; i++)\n [self.playerGunSlowDrawSheet release];\n\n count = [self.playerGunSlowDrawAnimation retainCount];\n for(i = 0; i \u0026lt; count; i++)\n [self.playerGunSlowDrawAnimation release];\n\n count = [self.numberFinishedTime retainCount];\n for(i = 0; i \u0026lt; count; i++)\n [self.numberFinishedTime release];\n\n count = [self.backGroundImage retainCount];\n for(i = 0; i \u0026lt; count; i++)\n [self.backGroundImage release];\n\n [[CCTextureCache sharedTextureCache] removeAllTextures];\n [[CCSpriteFrameCache sharedSpriteFrameCache] removeSpriteFrames];\n\n [super dealloc];\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut I am getting: Program received signal: “EXC_BAD_ACCESS”.\nI debugger it is showing the error at [super dealloc];\u003c/p\u003e\n\n\u003cp\u003eAm I totally wrong in the memory management ? Or am I missing anything in this.\nThank you.\u003c/p\u003e","accepted_answer_id":"3092083","answer_count":"1","comment_count":"0","creation_date":"2010-06-22 09:58:18.823 UTC","favorite_count":"1","last_activity_date":"2010-06-22 10:06:46.617 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"176436","post_type_id":"1","score":"0","tags":"cocoa-touch|cocos2d-iphone|dealloc","view_count":"618"} +{"id":"16217326","title":"JQuery: Change URL param without reloading?","body":"\u003cp\u003eI have a question, is it possible to change the URL via JQuery under the following conditions:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eSame URL will load on browser back and on reloads\u003c/li\u003e\n\u003cli\u003ePage doesn't reload when you change the parameter\u003c/li\u003e\n\u003c/ul\u003e","accepted_answer_id":"16217711","answer_count":"2","comment_count":"1","creation_date":"2013-04-25 14:22:24.343 UTC","favorite_count":"3","last_activity_date":"2013-05-02 08:15:13.547 UTC","last_edit_date":"2013-05-02 08:15:13.547 UTC","last_editor_display_name":"","last_editor_user_id":"1999743","owner_display_name":"","owner_user_id":"2320163","post_type_id":"1","score":"6","tags":"jquery|url|url-rewriting","view_count":"32490"} +{"id":"24571748","title":"SyntaxError if executed with cron, OK if manually","body":"\u003cp\u003eI'm trying to schedule a script with cron in kubuntu. If I execute the script manually line by line, it goes just fine, but scheduled with cron it raises the following SyntaxError:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e File \"/opt/django/myproject/myapp/cron/test.sh\", line 4\n python manage.py mycustomcommand\n ^\nSyntaxError: invalid syntax\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe content of the script test.sh is as following:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#!/bin/bash\nsource /opt/virtualenvs/myvirtualenv/bin/activate\ncd /opt/django/myproject\npython manage.py mycustomcommand\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBasically the script activates a virtual enviroment where django is installed, then accesses to my project path, and then executes a custom django command. As said, this works fine if I do it manually.\u003c/p\u003e\n\n\u003cp\u003eI tried to schedule the script in cron with normal and root permissions also (\"crontab -e\" and \"sudo crontab -e\")\u003c/p\u003e\n\n\u003cp\u003eAny idea? Thanks!\u003c/p\u003e","accepted_answer_id":"24571982","answer_count":"1","comment_count":"0","creation_date":"2014-07-04 10:03:44.487 UTC","last_activity_date":"2014-07-04 10:14:37.163 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"315521","post_type_id":"1","score":"0","tags":"django|cron|kubuntu","view_count":"220"} +{"id":"43793641","title":"How to select string between two periods (SQL Server 2012)","body":"\u003cp\u003eLet's say I have a bunch of part numbers, and I want a column to return the string after the first period and before the second period. I looked at other similar questions but couldn't figure it out\u003c/p\u003e\n\n\u003cp\u003eSo let's say I have of list of part numbers such as:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e10416.1.1.4\n10416.1.1.7\n10416.1.1.1\n10416.2.3\n10416.2.2\n10416.3.1.2\n10416.3.1.3\n10416.4.1.1\n10416.10.1\n10416.10.2\n10416.11.1.1\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI should have my column return:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e1\n1\n1\n2\n2\n3\n3\n4\n10\n10\n11\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eUsing SQL Server 2012, thanks in advance\u003c/p\u003e\n\n\u003cp\u003eEdit: Here's my code, this returns a table but the sorting is all over the place, the PartNo column is what I'm trying to split\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT DISTINCT OrderDet.OrderNo, Scheduling.JobNo, OrderDet.PartNo, \nOrderDet.Priority\nFROM Scheduling LEFT JOIN OrderDet ON Scheduling.JobNo = OrderDet.JobNo\nWHERE Scheduling.WorkCntr = 'Glazing'\nORDER BY OrderDet.Priority DESC\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"43793749","answer_count":"1","comment_count":"3","creation_date":"2017-05-04 22:16:53.313 UTC","last_activity_date":"2017-05-05 17:02:29.77 UTC","last_edit_date":"2017-05-05 17:02:29.77 UTC","last_editor_display_name":"","last_editor_user_id":"1570000","owner_display_name":"","owner_user_id":"1452574","post_type_id":"1","score":"0","tags":"sql|sql-server|tsql","view_count":"82"} +{"id":"32092935","title":"html entities not displaying properly","body":"\u003cp\u003eI made a function for my website that converts special characters, in case someone will try to break out the system using colon, semicolons, single quotes or double quotes. I made an array of find which is the find variable in \u003ccode\u003estr_replace\u003c/code\u003e and change which will be exchanged.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$find = array('\"','\\'','\u0026lt;3');\n$change = array('\u0026amp;quot;','\u0026amp;apos;','\u0026amp;hearts;');\n$str = \"This is a test ' \" \u0026lt;3.\";\n\n$str = str_replace($find, $change, $str);\necho $str;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt literally prints the codes like \u0026amp;quot and supposedly it should be echoed as double quotes (\"). I refreshed the page. It is still echoing the actual code.\u003c/p\u003e\n\n\u003cp\u003eAny help?\u003c/p\u003e","accepted_answer_id":"32093239","answer_count":"1","comment_count":"9","creation_date":"2015-08-19 10:29:14.253 UTC","last_activity_date":"2015-08-19 10:42:57.6 UTC","last_edit_date":"2015-08-19 10:34:32.247 UTC","last_editor_display_name":"","last_editor_user_id":"4237346","owner_display_name":"","owner_user_id":"5182283","post_type_id":"1","score":"-1","tags":"php|html|entities","view_count":"74"} +{"id":"45320450","title":"React.createElement: type is invalid in simple empty app","body":"\u003cp\u003eStill struggle to just simple run simple react application (just client to play around with).\u003c/p\u003e\n\n\u003cp\u003eBuild is ok (you can see config \u003ca href=\"https://stackoverflow.com/questions/45303604/webpack-entry-module-not-found-by-tutorial\"\u003ehere, previous question\u003c/a\u003e )\u003c/p\u003e\n\n\u003cp\u003eWhen I run server - there is an error on client side:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eUncaught Error: Element type is invalid: expected a\n string (for built-in components) or a class/function (for composite\n components) but got: object. You likely forgot to export your\n component from the file it's defined in.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eat invariant (transformed.js:304)\nat ReactCompositeComponentWrapper.instantiateReactComponent [as _instantiateReactComponent] (transformed.js:11912)\nat ReactCompositeComponentWrapper.performInitialMount (transformed.js:27510)\nat ReactCompositeComponentWrapper.mountComponent (transformed.js:27401)\nat Object.mountComponent (transformed.js:4158)\nat mountComponentIntoNode (transformed.js:12676)\nat ReactReconcileTransaction.perform (transformed.js:5756)\nat batchedMountComponentIntoNode (transformed.js:12698)\nat ReactDefaultBatchingStrategyTransaction.perform (transformed.js:5756)\nat Object.batchedUpdates (transformed.js:29031)\n\u003c/code\u003e\u003c/pre\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eHere is the code:\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eindex.js\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar React = require('react');\nvar ReactDOM = require('react-dom');\nvar App = require('./components/App.js');\n\nReactDOM.render(\n \u0026lt;App /\u0026gt;,\n document.getElementById('app')\n);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eindex.html\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;html lang=\"en\"\u0026gt;\n \u0026lt;head\u0026gt;\n \u0026lt;meta charset=\"UTF-8\"\u0026gt;\n \u0026lt;title\u0026gt;test\u0026lt;/title\u0026gt;\n \u0026lt;/head\u0026gt;\n \u0026lt;body\u0026gt;\n \u0026lt;div id='app'\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;/body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eApp.js\u003c/strong\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport React from 'react';\nimport ReactDOM from 'react-dom';\n// import {render} from 'react-dom'; //didn't helped either\n\nclass App extends React.Component {\n render () {\n return (\n \u0026lt;div\u0026gt;\n \u0026lt;p\u0026gt; Hello React!\u0026lt;/p\u0026gt;\n \u0026lt;/div\u0026gt;\n );\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eFYI:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eAnswer is correct, but also one thing.\nDon't forget to change all \u003ccode\u003erequire\u003c/code\u003e on \u003ccode\u003eimport\u003c/code\u003e, like here (in \u003ccode\u003eindex.js\u003c/code\u003e):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport App from './components/App.js';\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"45320497","answer_count":"1","comment_count":"0","creation_date":"2017-07-26 07:39:42.67 UTC","last_activity_date":"2017-07-27 06:23:48.493 UTC","last_edit_date":"2017-07-27 06:23:48.493 UTC","last_editor_display_name":"","last_editor_user_id":"1678567","owner_display_name":"","owner_user_id":"1678567","post_type_id":"1","score":"0","tags":"javascript|reactjs|webpack-dev-server","view_count":"34"} +{"id":"671741","title":"Is there a Python library that allows to build user interfaces without writing much code?","body":"\u003cp\u003eI am writing editing front ends in Python since several years now, and I am fed up with micromanaging every UI detail of a window or dialog every single time.\u003c/p\u003e\n\n\u003cp\u003eIs there a technology that allows me to, say, specify the relations between a GTK+ Glade-designed interface and the tables and records of an SQLite database to do all the middle man work? It should spare me the work of manually writing event handlers, input evaluators and view updates.\u003c/p\u003e\n\n\u003cp\u003eThe technologies in question are just examples, but I want to stick with Python as far as possible.\u003c/p\u003e","accepted_answer_id":"672093","answer_count":"8","comment_count":"1","creation_date":"2009-03-22 22:49:11.387 UTC","favorite_count":"8","last_activity_date":"2009-04-19 09:39:09.88 UTC","last_editor_display_name":"","owner_display_name":"paniq","owner_user_id":"81145","post_type_id":"1","score":"7","tags":"python|user-interface|sqlite|gtk|glade","view_count":"1480"} +{"id":"32554016","title":"Where are the docs on how to add symbol support for a language to Visual Studio Code?","body":"\u003cp\u003eI would like to add symbol support for PowerShell to VS Code but I'm not finding any docs on the code.visualstudio.com/docs site. \u003c/p\u003e\n\n\u003cp\u003eAlso, is it possible to do this for a language like PowerShell that, for the moment, will only work on Windows? Is there a way to light up symbol support on Windows only?\u003c/p\u003e\n\n\u003cp\u003eBTW I've added a bunch of \u003ca href=\"https://gist.github.com/rkeithhill/60eaccf1676cf08dfb6f\" rel=\"nofollow\"\u003ePowerShell snippets\u003c/a\u003e that I'm in the process of trying to get integrated into VS Code. Any help on how to get these snippets into the product would be appreciated as well? I did submit an issue on the snippets, suggesting that the team put these into VS Code.\u003c/p\u003e","accepted_answer_id":"32564223","answer_count":"1","comment_count":"0","creation_date":"2015-09-13 20:03:54.407 UTC","favorite_count":"1","last_activity_date":"2015-09-14 11:57:20.123 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"153982","post_type_id":"1","score":"3","tags":"visual-studio-code","view_count":"301"} +{"id":"15510866","title":"iOS check if a UILocalNotification condition occurs","body":"\u003cp\u003eI read a lot of documentation and code about UILocalNotification. My alert occurs when the condition (a calculated value raise) a limit.\u003c/p\u003e\n\n\u003cp\u003eWith localNotification.repeatInterval = NSHoursCalendarUnit\u003c/p\u003e\n\n\u003cp\u003eMy Notification is resent every hours. How can I ask LocalNotificationCenter to make a calculation BEFORE sending (or not) the notification?\u003c/p\u003e\n\n\u003cp\u003eFor exemple:\u003c/p\u003e\n\n\u003cp\u003eValue == 1 -\u003e Notification, Value is one.\u003c/p\u003e\n\n\u003cp\u003eEvery hours recalculate Value if Value changed -\u003e Notification, value is changed\u003c/p\u003e\n\n\u003cp\u003eThanks in advance for your help,\nJacques\u003c/p\u003e","accepted_answer_id":"15511445","answer_count":"1","comment_count":"0","creation_date":"2013-03-19 21:33:25.133 UTC","favorite_count":"1","last_activity_date":"2013-03-19 22:12:42.33 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"130306","post_type_id":"1","score":"1","tags":"ios|uilocalnotification","view_count":"208"} +{"id":"39403425","title":"session value not updated within while loop in JOOMLA","body":"\u003cp\u003eI'm not very sure if this is Joomla or PHP issue in my code. Basically I've two functions, A and B that invoked on page load and \u003ccode\u003eonclick\u003c/code\u003e event respectively.\nOn page load, I set session value to loadA. Once click event triggered, I set session value to clickB. \u003c/p\u003e\n\n\u003cp\u003eMeanwhile the while loop inside function is running until the condition is met. Inside the loop, it's checking for session value. So if the value updated inside function B, it should also be updated in function A when the while loop check right? \u003c/p\u003e\n\n\u003cp\u003eBut it's not giving the updated value. Function A still gives loadA as session value inside while loop even after click event took place. How to fix this please?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass XXY(){\n\n public function A()\n {\n\n $session = JFactory::getSession();\n //set session value on page laod \n $this-\u0026gt;setSession('loadA');\n while (x == y)\n {\n usleep(10000);\n clearstatcache();\n $comet = $session-\u0026gt;get('runningComet');//giving the first set value, loadA\n if($comet !== 'loadA'){\n break;\n }\n }\n\n }\n\n public function B()\n {\n $session = JFactory::getSession();\n\n $this-\u0026gt;setSession('loadB');\n $comet = $session-\u0026gt;get( 'runningComet');//giving the updated value, loadB\n }\n\n public function setSession($currentComet){\n\n $session = JFactory::getSession();\n $session-\u0026gt;set('runningComet', $currentComet);\n }\n }\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"3","creation_date":"2016-09-09 03:32:48.79 UTC","last_activity_date":"2016-09-09 05:11:27.35 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4981077","post_type_id":"1","score":"0","tags":"php|session|joomla","view_count":"45"} +{"id":"47532989","title":"oAuth2 integration with codeigniter","body":"\u003cp\u003eI am new to codeigniter and i want to implement oAuth2 authentication in codeigniter. Please suggest me the steps to do this. Please guide me proper steps so that this would be helpful for me to implement.\nThanks. \u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-11-28 13:38:44.557 UTC","last_activity_date":"2017-11-28 13:38:44.557 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"9020383","post_type_id":"1","score":"-5","tags":"php|codeigniter|oauth-2.0","view_count":"14"} +{"id":"19683957","title":"Formatting timestamps to avoid R/TraMineR crash?","body":"\u003cp\u003eI have a sequence dataset where the timestamp is in seconds since the epoch:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eid event time end\n1 723 opened 1356963741 1356963741\n2 722 opened 1356931342 1356931342\n3 721 referenced 1356988206 1356988206\n4 721 referenced 1356988186 1356988186\n5 721 closed 1356988186 1356988186\n6 721 merged 1356988186 1356988186\n7 721 closed 1356988186 1356988186\n8 721 merged 1356988186 1356988186\n9 721 discussed 1356966433 1356966433\n10 721 discussed 1356963870 1356963870\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to create an \u003ccode\u003eSTS\u003c/code\u003e sequence object:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esequences.sts \u0026lt;- seqformat(data, from=\"SPELL\", to=\"STS\", \n begin=\"time\", end=\"end\", id=\"id\", status=\"event\", limit=slmax)\nsequences.sts \u0026lt;- seqdef(sequences.sts)\nsummary(sequences.sts)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, when I do this, RStudio crashes, and more or less freeze up my entire computer. Through comparing with other code, which runs fine, that uses single-digit numbers for the \"time\" column, I think I have identified the problem as being the timestamp. Could it be that R/RStudio/TraMineR simply gets overloaded from the long timestamp?\u003c/p\u003e","accepted_answer_id":"19688976","answer_count":"1","comment_count":"0","creation_date":"2013-10-30 13:43:11.52 UTC","last_activity_date":"2015-11-09 02:07:49.29 UTC","last_edit_date":"2015-11-09 02:07:49.29 UTC","last_editor_display_name":"","last_editor_user_id":"1505120","owner_display_name":"","owner_user_id":"1308031","post_type_id":"1","score":"3","tags":"r|traminer","view_count":"200"} +{"id":"39835288","title":"Custom nested cols in Bootstrap 3","body":"\u003cp\u003eI got a tough requirement to make a layout like this image with Bootstrap 3:\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/C2ivZ.png\" alt=\"expecting layout\"\u003e\u003c/p\u003e\n\n\u003cp\u003eCurrently I can make it like this:\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/eDDM3.png\" alt=\"this\"\u003e\u003c/p\u003e\n\n\u003cp\u003eHere is my sample html layout: \u003ca href=\"https://jsfiddle.net/isherwood/4etczrwx/\" rel=\"nofollow noreferrer\"\u003ehttps://jsfiddle.net/isherwood/4etczrwx/\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cdiv class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\"\u003e\r\n\u003cdiv class=\"snippet-code\"\u003e\r\n\u003cpre class=\"snippet-code-html lang-html prettyprint-override\"\u003e\u003ccode\u003e\u0026lt;link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css\"\u0026gt;\r\n\r\n\u0026lt;div class=\"container\"\u0026gt;\r\n\r\n \u0026lt;div class=\"row\"\u0026gt;\r\n\r\n \u0026lt;div class=\"col-sm-6\" style=\"height:500px;background-color:red;\"\u0026gt;\r\n images\r\n \u0026lt;/div\u0026gt;\r\n\r\n \u0026lt;div class=\"clearfix col-sm-6\" style=\"height:100px;background-color:yellow;\"\u0026gt;\r\n text dsgsg sdg sdgsdgtext dsgsg sdg sdgsdgtext dsgsg sdg sdgsdgtext dsgsg sdg sdgsdg\r\n text dsgsg sdg sdgsdgtext dsgsg sdg sdgsdgtext dsgsg sdg sdgsdgtext dsgsg sdg sdgsdg\r\n text dsgsg sdg sdgsdgtext dsgsg sdg sdgsdgtext dsgsg sdg sdgsdgtext dsgsg sdg sdgsdg\r\n \u0026lt;/div\u0026gt;\r\n\r\n \u0026lt;div class=\"col-sm-3\" style=\"height:200px;background-color:blue;\"\u0026gt;\r\n keyfeature\r\n \u0026lt;ul\u0026gt;\r\n \u0026lt;li\u0026gt;testest 1\u0026lt;/li\u0026gt;\r\n \u0026lt;li\u0026gt;testest 2\u0026lt;/li\u0026gt;\r\n \u0026lt;li\u0026gt;testest 3\u0026lt;/li\u0026gt;\r\n \u0026lt;li\u0026gt;testest 4\u0026lt;/li\u0026gt;\r\n \u0026lt;/ul\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n\r\n \u0026lt;div class=\"col-sm-3\" style=\"height:600px;background-color:gray;\"\u0026gt;\r\n Price tab here\r\n \u0026lt;/div\u0026gt;\r\n\r\n \u0026lt;div class=\"col-sm-9\" style=\"height:800px;background-color:green;\"\u0026gt;\r\n Configurator here\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n\u0026lt;/div\u0026gt;\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003c/p\u003e\n\n\u003cp\u003eI think I'am missing something to make the green col?\u003cbr\u003e\nor should I use push/pull to make it work as my expectation?\u003c/p\u003e","accepted_answer_id":"39845336","answer_count":"2","comment_count":"4","creation_date":"2016-10-03 15:34:56.543 UTC","last_activity_date":"2016-10-04 06:20:31.213 UTC","last_edit_date":"2016-10-04 06:20:31.213 UTC","last_editor_display_name":"","last_editor_user_id":"6263942","owner_display_name":"","owner_user_id":"5783080","post_type_id":"1","score":"2","tags":"html|css|twitter-bootstrap|twitter-bootstrap-3","view_count":"40"} +{"id":"8356907","title":"hmm, lists, tuples, arrays, sets or dicts for this data structure?","body":"\u003cp\u003eBeginner programmer here. after a bunch of reading about 'variables' which dont exist in python, (still dont get that) Ive come to the opinion that I think I should be using lists in my data structure, but im not entirely sure.\u003c/p\u003e\n\n\u003cp\u003eim analysing a string which contains commands and normal words to be printed out, if the word is a command, which in this case is preceded by an '@' i want it to be in a separate list to the actual words. i will then process all this to be printed out afterwards, but i want the list to be ordered, so i can go through each element and test if it has a word in it, and if not do some action on the command.\u003c/p\u003e\n\n\u003cp\u003eso what i want really is a list with two indices(thankyou!) (what do you call that ?)\nlike this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003earglist[x][y]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eso i can go through arglist and process whether or not it contains a command or a word to be printed out. i want \u003ccode\u003earglist[x]\u003c/code\u003e to contain words and \u003ccode\u003earglist[y]\u003c/code\u003e to contain commands.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003earglist = [] # not sure how to initialise this properly.\ndoh=\"my @command string is this bunch of words @blah with some commands contained in it\"\nfor listindex, word in enumerate(doh):\n if word.startswith('@'):\n # its a command \n arglist[listindex] = None\n arglist[listindex][listindex]=command\n else:\n # its a normal word\n arglist[listindex]=word\n rglist[listindex][listindex]=None\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethen i want to be able to go down the list and pick out commands,\ni guess that would be something like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e# get the number of items in the list and go through them...\nfor listindex, woo in enumerate(len(arglist)):\n if arglist[listindex] is None:\n # there is no word here, so print command\n print arglist[listindex][listindex] \n else:\n # just print out word\n print arglist[listindex] \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eso: my question is which data type/ structure should I be using and should I / how do I initialise it ? am I barking up the right tree here?\u003c/p\u003e\n\n\u003cp\u003eedit: i just found this gem and now im even more unsure - i want it to be the fastest lookup possible on my data but i still want it to be ordered.\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003edict and set are fundamentally different from lists and tuples`. They store the hash of their keys, allowing you to see if an item is in them very quickly, but requires the key be hashable. You don't get the same membership testing speed with linked lists or arrays.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003emany thanks as usual for any help.\u003c/p\u003e\n\n\u003cp\u003eedit: eg my string from above should look something like this.\ndoh=\"my @command string is this bunch of words @blah with some commands contained in it\"\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003earglist[1] = 'my'\narglist[1][1] = None\n\narglist[2] = None\narglist[2][1] = command\n\narglist[3] = 'string'\narglist[3][1] = None\n\netc etc\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethis whole thing has left me a bit baffled i shall try and update this later.\u003c/p\u003e\n\n\u003cp\u003eEDIT: if anyone wanted to know what this was all about look \u003ca href=\"http://pastebin.com/YfzMVj1i\" rel=\"nofollow\"\u003ehere\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"8357558","answer_count":"3","comment_count":"17","creation_date":"2011-12-02 13:19:22.857 UTC","last_activity_date":"2011-12-05 06:11:42.357 UTC","last_edit_date":"2011-12-05 06:11:42.357 UTC","last_editor_display_name":"user1064306","owner_display_name":"user1064306","post_type_id":"1","score":"0","tags":"python|list|variables","view_count":"168"} +{"id":"33532941","title":"Is it possible to set custom font \u0026 size for NSString?","body":"\u003cp\u003eI'm working with Swift in iOS 9. I want to customize the font for a \u003ccode\u003eUIAlertAction\u003c/code\u003e. I searched these questions for a Swift answer:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://stackoverflow.com/questions/31497218/change-the-font-of-uialertaction-in-swift\"\u003eChange the Font of UIAlertAction in Swift\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://stackoverflow.com/questions/26357066/is-it-possible-to-customize-the-font-and-appearance-of-a-uialertcontroller-in-th\"\u003eIs it possible to customize the font and appearance of a UIAlertController in the new XCode w/ iOS8?\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eAnd this question for an Objective-C answer:\n\u003ca href=\"https://stackoverflow.com/questions/26460706/uialertcontroller-custom-font-size-color\"\u003eUIAlertController custom font, size, color\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eBut there was no solution for customizing the font for a \u003ccode\u003eUIAlertAction\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eI believe the problem is that a \u003ccode\u003eUIAlertAction\u003c/code\u003e uses an \u003ccode\u003eNSString\u003c/code\u003e for its \u003ccode\u003etitle\u003c/code\u003e property. See here:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://github.com/nst/iOS-Runtime-Headers/blob/3dde29deb7000cfac59d3e5473a71557123f29ea/Frameworks/UIKit.framework/UIAlertAction.h\" rel=\"nofollow noreferrer\"\u003ehttps://github.com/nst/iOS-Runtime-Headers/blob/3dde29deb7000cfac59d3e5473a71557123f29ea/Frameworks/UIKit.framework/UIAlertAction.h\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI would like to create a string like so:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elet originalString: String = \"OK\"\nlet myString: NSString = originalString as NSString\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd then customize the string's font \u0026amp; size. Then after adding my actions to the alert controller, assign the string to my actions using key-value coding:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ealertController!.actions[0].setValue(myString, forKey: \"title\")\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut as far as I can tell, there is no way to set a custom font and size for an \u003ccode\u003eNSString\u003c/code\u003e. If it used a \u003ccode\u003eUILabel\u003c/code\u003e instead, then it would be easy to customize the font. But I seem to be stuck with the limitations of strings. Does anyone know a way to assign a custom font \u0026amp; size to a string, or am I correct in believing there is no way to do this?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-11-04 22:04:31.34 UTC","last_activity_date":"2015-11-04 22:57:54.71 UTC","last_edit_date":"2017-05-23 11:58:39.39 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"4376309","post_type_id":"1","score":"0","tags":"string|swift|nsstring|ios9|uialertaction","view_count":"635"} +{"id":"45741233","title":"Django Rest Framework URL Mapping for multiple apps","body":"\u003cp\u003eI have a django-rest project called \u003ccode\u003emain\u003c/code\u003e and under it I have created an app called \u003ccode\u003eusers\u003c/code\u003e. So, my project has the files :-\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003emain/main/urls.py\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eand \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003emain/users/urls.py\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eIn users/urls.py I have\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efrom django.conf.urls import url, include\nfrom rest_framework import routers\nfrom users import views\n\nrouter = routers.DefaultRouter()\nrouter.register(r'users', views.UserViewSet)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand in the main/main/urls.py I have\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efrom django.conf.urls import url\nfrom django.contrib import admin\n\nfrom users import urls\n\nurlpatterns = [\n url(r'^admin/', admin.site.urls),\n url(r'^users/', users.urls),\n]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, I keep getting the error \u003ccode\u003eNameError: name 'users' is not defined\u003c/code\u003e. What is the correct way to set up urls when I have multiple apps? I would like to have a urls.py file for each app that is independent of the project. And in the root urls.py would include routing to different apps.\u003c/p\u003e","accepted_answer_id":"45741341","answer_count":"1","comment_count":"0","creation_date":"2017-08-17 17:08:52.933 UTC","last_activity_date":"2017-08-17 23:05:43.393 UTC","last_edit_date":"2017-08-17 23:05:43.393 UTC","last_editor_display_name":"","last_editor_user_id":"3152549","owner_display_name":"","owner_user_id":"5387794","post_type_id":"1","score":"1","tags":"django|django-rest-framework","view_count":"88"} +{"id":"44679040","title":"Return xx characters before a certain string","body":"\u003cp\u003eSo I have this string:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eBest location using 168 cars + cleaning\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe '168' is the part i'd like to extract from this string.\u003c/p\u003e\n\n\u003cp\u003eI have approximately 80 occurences of this string, all alternating from 'xx' cars to 'xxx' cars (so, 2 or 3 numbers). However, in each string, 'cars' comes after the number i'd like to return.\u003c/p\u003e\n\n\u003cp\u003eWhat would be the best way using PHP to achieve this?\u003c/p\u003e","accepted_answer_id":"44679236","answer_count":"3","comment_count":"5","creation_date":"2017-06-21 14:32:38.193 UTC","last_activity_date":"2017-06-21 14:50:26.793 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4591220","post_type_id":"1","score":"-1","tags":"php","view_count":"48"} +{"id":"26477866","title":"I am attempting to print only a selected amount of Pi, it returns with an error of \"Decimal has no attribute: __getitem__","body":"\u003cpre\u003e\u003ccode\u003edef pi():\n prompt=\"\u0026gt;\u0026gt;\u0026gt; \"\n print \"\\nWARNING: Pi may take some time to be calculated and may not always be correct beyond 100 digits.\"\n print \"\\nShow Pi to what digit?\"\n n=raw_input(prompt)\n from decimal import Decimal, localcontext\n with localcontext() as ctx:\n ctx.prec = 10000\n pi = Decimal(0) \n for k in range(350): \n pi += (Decimal(4)/(Decimal(8)*k+1) - Decimal(2)/(Decimal(8)*k+4) - Decimal(1)/(Decimal(8)*k+5) - Decimal(1)/(Decimal(8)*k+6)) / Decimal(16)**k\n print pi[:int(n)]\npi()\n\n\n\n\nTraceback (most recent call last):\n File \"/Users/patrickcook/Documents/Pi\", line 13, in \u0026lt;module\u0026gt;\n pi()\n File \"/Users/patrickcook/Documents/Pi\", line 12, in pi\n print pi[:int(n)]\nTypeError: 'Decimal' object has no attribute '__getitem__'\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"26477889","answer_count":"4","comment_count":"1","creation_date":"2014-10-21 02:14:12.287 UTC","last_activity_date":"2015-05-27 12:51:29.683 UTC","last_edit_date":"2015-05-27 12:51:29.683 UTC","last_editor_display_name":"","last_editor_user_id":"2829009","owner_display_name":"","owner_user_id":"4164196","post_type_id":"1","score":"-3","tags":"python|python-2.7|python-2.x|magic-methods|pi","view_count":"164"} +{"id":"18725592","title":"Centering text in front of a horizontal rule","body":"\u003cp\u003eI'm looking to build a progress bar that I will generate programmatically. I'm a css novice, at best. \u003ca href=\"http://jsfiddle.net/QpWqd/31/\" rel=\"nofollow noreferrer\"\u003eHere\u003c/a\u003e is what I have so far; using tips from \u003ca href=\"https://stackoverflow.com/a/5214204/1392951\"\u003ethis question\u003c/a\u003e.\u003c/p\u003e\n\n\u003cp\u003eIdeally, I would style the following simple HTML, but I'm open to adding more tags:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div id=\"container\"\u0026gt;\n\u0026lt;h2\u0026gt;\u0026lt;span\u0026gt;Goal\u0026lt;/span\u0026gt;\u0026lt;/h2\u0026gt;\n\u0026lt;div id=\"bgblock\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;h2\u0026gt;\u0026lt;span\u0026gt;So Far\u0026lt;/span\u0026gt;\u0026lt;/h2\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eTwo, maybe 3 issues:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eRight now the \"text over line\" is accomplished by making the text white, on top of the line. This ends up cutting into the green background. To avoid this, I guess I need to have the text (without a background color) and lines on either side of it?\u003c/li\u003e\n\u003cli\u003eObviously my formatting / margins / offsets are a mess, and the top of the box borders / hr alignment is not quite right (seems like the top text needs to be shifted up a couple pixels or the container down a couple pixels, but I'm having trouble doing this).\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eThoughts on a cleaner solution that gets me where I want to be?\u003c/p\u003e","accepted_answer_id":"18727604","answer_count":"1","comment_count":"4","creation_date":"2013-09-10 17:45:33.383 UTC","last_activity_date":"2013-09-10 20:17:51.283 UTC","last_edit_date":"2017-05-23 12:05:11.927 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"1392951","post_type_id":"1","score":"0","tags":"html|css","view_count":"116"} +{"id":"4327427","title":"How to choose Build Configuration in Build Action in the Scheme dialog?","body":"\u003cp\u003eIn Xcode 4 preview 5 every time I hit 'build', Xcode now build my Project with the debug Configuration, how can I build, for example, with release configuration? My project is a dynamic library, so scheme actions like 'Run', 'Test', 'Profile' and 'Analyze' not really make sense to me.\u003c/p\u003e\n\n\u003cp\u003eAs of Xcode 4 preview 5 the 'Build' scheme action has changed.\u003c/p\u003e\n\n\u003cp\u003eSetting up a scheme with scheme actions that use particular build configurations allows me to set up a scheme that runs the product with the Debug configuration but profiles it with the Release configuration.\u003c/p\u003e\n\n\u003cp\u003eEvery scheme action has a drop-down menu to choose a build configuration, except the build action. Where did this option go?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2010-12-01 17:57:52.857 UTC","last_activity_date":"2011-03-10 13:59:36.757 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"526914","post_type_id":"1","score":"2","tags":"xcode|xcodebuild|xcode4","view_count":"1517"} +{"id":"32600475","title":"Java Errors Illegal Start of Expression","body":"\u003cp\u003eI'm getting errors that this has an illegal start of expression and it shows just about every line as being a problem. Any help with what I'm missing here?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic abstract class Shapes\n{\npublic static void main(String[] args)\n{\n protected final double pi=3.14;\n\n //varible pi is delcared as constant\n\n protected double radius;\n protected double height;\n\n public Shapes (double gRadius,double gHeight) \n {\n //sets radius, height variables to parameter values\n radius=gRadius;\n height=gHeight;\n }\n\n abstract public double getCircumference();\n abstract public double getTotalSurfaceArea();\n abstract public double getVolume();\n}\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"32600500","answer_count":"3","comment_count":"0","creation_date":"2015-09-16 05:33:12.36 UTC","last_activity_date":"2015-09-16 07:09:06.843 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5340616","post_type_id":"1","score":"2","tags":"java","view_count":"116"} +{"id":"30966074","title":"Android: how can I lock SQLite database accessible with ContentProvider (or other way of executing atomic conditional operations)","body":"\u003cp\u003eI got two tables in my SQLite DB: \u003ccode\u003eentities\u003c/code\u003e and \u003ccode\u003euser_actions\u003c/code\u003e. Their approximate schemes:\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/rYY0g.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eThe flow of the program is something like this (all DB accesses handled by ContentProvider):\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eThe user performs some action which modifies one of the entities\u003c/li\u003e\n\u003cli\u003eThe corresponding entity is updated in \u003ccode\u003eentities\u003c/code\u003e immediately. \u003ccode\u003elocally_modified\u003c/code\u003e value of this entity is set to \u003ccode\u003e1\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003eThe information about user's action is stored in \u003ccode\u003euser_actions\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003eAt some point in future a sync session with the server is being initiated (I use \u003ca href=\"https://developer.android.com/training/sync-adapters/index.html\" rel=\"nofollow noreferrer\"\u003eSyncAdapter\u003c/a\u003e framework)\u003c/li\u003e\n\u003cli\u003eUser's actions from \u003ccode\u003euser_actions\u003c/code\u003e are uploaded to the server one by one and removed from the DB in a background thread\u003c/li\u003e\n\u003cli\u003eWhen the uploading completed, I need to clear \u003ccode\u003elocally_modified\u003c/code\u003e flags in \u003ccode\u003eentities\u003c/code\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eAt this point I encounter my atomicity issue: the synchronization with the server happens in a background thread, therefore the user can use the app and perform additional actions. As a consequence, right before I clear \u003ccode\u003elocally_modified\u003c/code\u003e flag for an entity, I must check that there are no records in \u003ccode\u003euser_actions\u003c/code\u003e corresponding to this entity. These three steps must be executed atomically for each entity having \u003ccode\u003elocally_modified\u003c/code\u003e set to \u003ccode\u003e1\u003c/code\u003e:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eQuery \u003ccode\u003euser_actions\u003c/code\u003e for entries corresponding to entity's \u003ccode\u003e_id\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003eTest whether the query from #1 returned an empty set\u003c/li\u003e\n\u003cli\u003eClear \u003ccode\u003elocally_modified\u003c/code\u003e of that entity to \u003ccode\u003e0\u003c/code\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eGiven the above scenario, I have three questions:\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eQ1:\u003c/strong\u003e Is there a way to lock SQLite DB accessed over ContentProvider in Android such that it can be accessed only by the locking thread?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eQ2:\u003c/strong\u003e If the answer to Q1 is positive, what happens if some other thread tries to access a locked DB? What precautions should I take to ensure reliable operation?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eQ3:\u003c/strong\u003e It is possible to execute atomic transactions with conditional logic using \u003ca href=\"http://developer.android.com/reference/android/content/ContentProviderOperation.html\" rel=\"nofollow noreferrer\"\u003eContentProviderOperation\u003c/a\u003e? You can use \"back-references\" as described in \u003ca href=\"https://stackoverflow.com/a/6741039/2463035\"\u003ethis answer\u003c/a\u003e and \u003ca href=\"http://www.grokkingandroid.com/androids-contentprovideroperation-withbackreference-explained/\" rel=\"nofollow noreferrer\"\u003ethis blog post\u003c/a\u003e to reference the result of a previous operations, but is there a way to use that result in some kind of \u003ccode\u003eif-else\u003c/code\u003e statement?\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","accepted_answer_id":"31066989","answer_count":"2","comment_count":"0","creation_date":"2015-06-21 15:16:22.41 UTC","last_activity_date":"2015-06-26 07:05:38.697 UTC","last_edit_date":"2017-05-23 10:26:43.71 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"2463035","post_type_id":"1","score":"1","tags":"android|multithreading|sqlite|android-contentprovider|atomicity","view_count":"261"} +{"id":"42327891","title":"When I run 'tensorflow-mnist-tutorial' and I got this: Expected int32, got list containing Tensors of type '_Message' instead","body":"\u003cp\u003ewhen I running the Tensorflow's official sample code: '\u003ca href=\"https://github.com/martin-gorner/tensorflow-mnist-tutorial\" rel=\"nofollow noreferrer\"\u003etensorflow-mnist-tutorial\u003c/a\u003e':\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$python3 mnist_1.0_softmax.py\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand something wrong:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eTraceback (most recent call last):\n File \"/Users/holmes/Desktop/untitled/gitRepository/tensorflow-mnist-tutorial/mnist_1.0_softmax.py\", line 78, in \u0026lt;module\u0026gt;\n I = tensorflowvisu.tf_format_mnist_images(X, Y, Y_) # assembles 10x10 images by default\n File \"/Users/holmes/Desktop/untitled/gitRepository/tensorflow-mnist-tutorial/tensorflowvisu.py\", line 42, in tf_format_mnist_images\n everything_incorrect_first = tf.concat(0, [incorrectly_recognised_indices, correctly_recognised_indices]) # images reordered with indeces of unrecognised images first\n File \"/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/tensorflow/python/ops/array_ops.py\", line 1047, in concat\n dtype=dtypes.int32).get_shape(\n File \"/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/tensorflow/python/framework/ops.py\", line 651, in convert_to_tensor\n as_ref=False)\n File \"/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/tensorflow/python/framework/ops.py\", line 716, in internal_convert_to_tensor\n ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)\n File \"/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/tensorflow/python/framework/constant_op.py\", line 176, in _constant_tensor_conversion_function\n return constant(v, dtype=dtype, name=name)\n File \"/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/tensorflow/python/framework/constant_op.py\", line 165, in constant\n tensor_util.make_tensor_proto(value, dtype=dtype, shape=shape, verify_shape=verify_shape))\n File \"/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/tensorflow/python/framework/tensor_util.py\", line 367, in make_tensor_proto\n _AssertCompatible(values, dtype)\n File \"/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/tensorflow/python/framework/tensor_util.py\", line 302, in _AssertCompatible\n (dtype.name, repr(mismatch), type(mismatch).__name__))\nTypeError: Expected int32, got list containing Tensors of type '_Message' instead.\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"2","creation_date":"2017-02-19 13:38:12.803 UTC","last_activity_date":"2017-02-19 14:44:40.003 UTC","last_edit_date":"2017-02-19 14:44:40.003 UTC","last_editor_display_name":"","last_editor_user_id":"6467953","owner_display_name":"","owner_user_id":"6467953","post_type_id":"1","score":"0","tags":"python|tensorflow","view_count":"242"} +{"id":"28674763","title":"Extension Library in Domino: Server or Client? Or both?","body":"\u003cp\u003ethis may seem like a dumb question but im not that long into Notes/Domino.\nI want to run Extension Library by openNTF. Now the question is, if i develop an application with it, can the application itself be used by other clients eventough they dont have the Ext. Lib. installed?\nAnd when i say used i mean USED, not edited. And if not, do they need Ext.Lib.(client) too or can i just install it on the Server? Or do i have to install it on both?\u003c/p\u003e\n\n\u003cp\u003eSorry for the bad english.\nThanks if you can answer :)\u003c/p\u003e","accepted_answer_id":"28675766","answer_count":"1","comment_count":"0","creation_date":"2015-02-23 13:20:36.543 UTC","last_activity_date":"2015-02-23 14:14:34.96 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4597051","post_type_id":"1","score":"0","tags":"client|server|lotus-domino","view_count":"37"} +{"id":"24572518","title":"Issue calling swift completion handler closure","body":"\u003cp\u003eI have a function which takes a closure as a completion handler. It in turn calls a function that takes one as well. On completion, I want to take the return values from the first completion closure and call the second passing them in. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunc saveUserToCloud(user: MBUser, completionHandler: (CKRecord, NSError) -\u0026gt; Void) {\n let userRecord = CKRecord(recordType: kMBUser)\n userRecord.setObject(user.nickname, forKey: kMBUserNickname)\n self.publicDb.saveRecord(userRecord, completionHandler: {record, error in completionHandler(record, error)})\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis func throws an exception:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003efatal error: Can't unwrap Optional.None\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cpre\u003e\u003ccode\u003efunc saveUserToCloud(user: MBUser, completionHandler: (CKRecord, NSError) -\u0026gt; Void) {\n let userRecord = CKRecord(recordType: kMBUser)\n userRecord.setObject(user.nickname, forKey: kMBUserNickname)\n // this line throws the exception:\n self.publicDb.saveRecord(userRecord, completionHandler: {record, error in completionHandler(record, error)})\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat am I doing wrong? I have a record, and no error in this case. I suppose it's trying to unwrap the error?\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2014-07-04 10:42:47.717 UTC","last_activity_date":"2014-07-22 08:57:10.453 UTC","last_edit_date":"2014-07-05 03:57:50.93 UTC","last_editor_display_name":"","last_editor_user_id":"264802","owner_display_name":"","owner_user_id":"1178952","post_type_id":"1","score":"0","tags":"ios|swift","view_count":"809"} +{"id":"25024643","title":"Creating a hidden file in Common Lisp","body":"\u003cp\u003eSince hidden files on a Unix platform simply start with a period, it is trivial to create one using Common Lisp. Hidden files on Windows machines are defined differently. They have a \u003ca href=\"http://en.wikipedia.org/wiki/File_attribute\" rel=\"nofollow\"\u003efile attribute\u003c/a\u003e that indicates whether they are hidden. How can one create these type of files using Common Lisp? I'm using Allegro CL on Windows.\u003c/p\u003e","accepted_answer_id":"25024850","answer_count":"1","comment_count":"1","creation_date":"2014-07-29 20:44:06.983 UTC","last_activity_date":"2014-07-30 03:42:46.75 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2180936","post_type_id":"1","score":"2","tags":"windows|common-lisp|hidden-files|allegro-cl","view_count":"89"} +{"id":"13251399","title":"Use alt text for linked image","body":"\u003cp\u003eFor images for my website I always use 1 thumbnail and 1 full size image.\u003c/p\u003e\n\n\u003cp\u003eI'd very much like to apply alt text for my full size images, but I don't know how, since the full size image is linked with \u003ccode\u003e\u0026lt;a\u0026gt;\u003c/code\u003e and isn't an \u003ccode\u003e\u0026lt;img\u0026gt;\u003c/code\u003e object.\u003cbr\u003e\nIt's for SEO reasons, so that the full size images will be more easily searchable through Google image search.\u003c/p\u003e\n\n\u003cp\u003eHow can I apply alt text for my full size images? I'm using highslide for displaying images at the moment, but perhaps there's another alternative that can give me what I'm looking for.\u003c/p\u003e\n\n\u003cp\u003eThis is the site that I'm referring to:\n\u003ca href=\"http://www.easterislandtraveling.com/easter-island/gallery/\" rel=\"nofollow\"\u003ehttp://www.easterislandtraveling.com/easter-island/gallery/\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"32214858","answer_count":"2","comment_count":"5","creation_date":"2012-11-06 12:48:16.393 UTC","last_activity_date":"2015-08-25 22:04:15.813 UTC","last_edit_date":"2012-11-06 13:12:01.767 UTC","last_editor_display_name":"","last_editor_user_id":"887539","owner_display_name":"","owner_user_id":"809392","post_type_id":"1","score":"0","tags":"javascript|html|image|seo|alt","view_count":"198"} +{"id":"44872897","title":"My main method can't see all public methods in a different package in java","body":"\u003cp\u003eMy main method in a package by itself can only see some of the methods in the other package even though they are all public. This is an example of my code.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e package stuff.code;\n public class AObject\n {\n public AObject();\n public AObject(String str);\n public int getLength();\n public int getHeight();\n }\n\n package stuff.code;\n public class BObject extends AObject\n {\n public BObject();\n public BObject(String str);\n }\n\n package stuff.test;\n import stuff.code.AObject;\n import stuff.code.BObject;\n public class tester\n {\n AObject a = new AObject(); //no red underline\n AObject aa = new AObject(\"some string\"); //no red underline\n BObject b = new BObject(); //no red underline\n BObject bb = new BObject(\"some string\"); //tells me there is no such constructor\n b.getLength(); //tells me I need a getLine method in BObject too\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI've looked into setAccessible(boolean flag) method but I didn't understand most of it and it was still undefined after I imported java.lang.reflect.AccessibleObject.\u003c/p\u003e\n\n\u003cp\u003eThis is not my actual code. I wanted this to be vague so that an answer would be more useful to many other people that run into this problem. My methods are all concrete with a body but the body isn't the issue. It runs fine when everything is in the same package but the tester class must be in a different package.\u003c/p\u003e","answer_count":"1","comment_count":"5","creation_date":"2017-07-02 16:23:53.173 UTC","last_activity_date":"2017-07-02 18:29:18.783 UTC","last_edit_date":"2017-07-02 16:44:55.517 UTC","last_editor_display_name":"","last_editor_user_id":"7147792","owner_display_name":"","owner_user_id":"7147792","post_type_id":"1","score":"0","tags":"java|eclipse|object|packages|public-method","view_count":"65"} +{"id":"17082750","title":"ZF1 render a module view into common layout","body":"\u003cp\u003eI'm actually trying to create a module in ZF1 which I want to be really \"plugin\"-like. The main application use the default layout which is located under \u003ccode\u003edata/current/views/layouts\u003c/code\u003e. \u003c/p\u003e\n\n\u003cp\u003eFirst problem, my module, use by default the following layout \u003ccode\u003eapplication/views/layouts/default.phtml\u003c/code\u003e. What I want is to use the other one (see above). So I did this : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic function init() {\n parent::init();\n $layout = Zend_Layout::getMvcInstance();\n $layout-\u0026gt;setLayoutPath(DATA_PATH . '/view/layouts');\n $layout-\u0026gt;setLayout('common');\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe second problem is that, in this layout (\u003ccode\u003edata/current/views/layouts\u003c/code\u003e), I'm actually rendering some partial views. But when I try to set the layout from the module, I got an error because it can't find those partials (because of the context, it's now trying to load those partial from the module context). I don't want to copy those partials into my module in order to make it works (dirty and not scalable). So the question is : how to just render a module action (controller/action) into the common layout but without any partials errors?\u003c/p\u003e\n\n\u003cp\u003eThanks to all for your help\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2013-06-13 08:40:18.663 UTC","last_activity_date":"2013-06-13 08:54:16.74 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1965817","post_type_id":"1","score":"1","tags":"zend-framework|layout|view|render|partial","view_count":"464"} +{"id":"10949263","title":"\"Liferay.Language.get\" javascript call returns key instead of value","body":"\u003cp\u003eIn our portlet, we are trying to access the language properties in our javascript files using \u003ccode\u003eLiferay.Language.get(\"key\")\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eBut \u003ccode\u003eLiferay.Language.get(\"key\")\u003c/code\u003e returns the key instead of the associated value.\u003c/p\u003e\n\n\u003cp\u003eDid any one face similar issue?\u003c/p\u003e\n\n\u003cp\u003eWe are using Liferay 6.1 EE. And have already seen the \u003ca href=\"http://issues.liferay.com/browse/LPS-16513\" rel=\"nofollow\"\u003eLPS-16513\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThe strangest part is it works on our local boxes but fails on server.\u003c/p\u003e\n\n\u003cp\u003eAny pointers other than using ext?\u003c/p\u003e","answer_count":"4","comment_count":"0","creation_date":"2012-06-08 12:53:23.4 UTC","favorite_count":"1","last_activity_date":"2017-01-24 09:42:18.01 UTC","last_edit_date":"2012-07-16 12:08:11.693 UTC","last_editor_display_name":"","last_editor_user_id":"468763","owner_display_name":"","owner_user_id":"333203","post_type_id":"1","score":"1","tags":"javascript|liferay-6","view_count":"1762"} +{"id":"27270325","title":"Getting source code from url after loading JS","body":"\u003cp\u003eCurrently i am facing an issue. \u003c/p\u003e\n\n\u003cp\u003econsider the URL \u003ca href=\"http://projects.spring.io/spring-framework/\" rel=\"nofollow\"\u003ehttp://projects.spring.io/spring-framework/\u003c/a\u003e, here if you look at the source code from view-source in browser it is different from the inspect-element version\u003c/p\u003e\n\n\u003cp\u003eNow here is the issue the inspect element version contains HTML source which is fully loaded(via JS, ajax etc) and that is what i required\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport urllib2\npage = urllib2.urlopen(url)\npage_content = page.read()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eabove does not give fully loaded version, also using selenium will not be possible since the webdriver will be used and in my system it may or may not be present.\u003c/p\u003e\n\n\u003cp\u003eSo currently i am looking for a workaround, other library maybe.\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2014-12-03 11:15:32.233 UTC","favorite_count":"1","last_activity_date":"2014-12-03 11:15:32.233 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1471175","post_type_id":"1","score":"1","tags":"python|python-2.7|web-scraping|urllib2","view_count":"292"} +{"id":"33666685","title":"MongoDB project the documents with count greater than 2","body":"\u003cp\u003eI have a collection like \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n \"_id\": \"201503110040020021\",\n \"Line\": \"1\", // several documents may have this Line value\n \"LineStart\": ISODate(\"2015-03-11T06:49:35.000Z\"),\n \"SSCEXPEND\": [{\n \"Secuence\": 10,\n \"Title\": 1,\n },\n {\n \"Secuence\": 183,\n \"Title\": 613,\n },\n ...\n ],\n\n} {\n \"_id\": \"201503110040020022\",\n \"Line\": \"1\", // several documents may have this Line value\n \"LineStart\": ISODate(\"2015-03-11T06:49:35.000Z\"),\n \"SSCEXPEND\": [{\n \"Secuence\": 10,\n \"Title\": 1,\n },\n\n ],\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSSCEXPEND is an array. I am trying to count the size of SSC array and project if the count is greater than or equal to 2. My query is something like this \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edb.entity.aggregate(\n [\n {\n $project: {\n SSCEXPEND_count: {$size: \"$SSCEXPEND\"}\n }\n },\n {\n $match: {\n \"SSCEXPEND_count2\": {$gte: [\"$SSCEXPEND_count\",2]}\n }\n }\n ]\n)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am expecting the output to be only the the first document whose array size is greater than 2.\u003c/p\u003e\n\n\u003cp\u003eProject part is working fine and I am able to get the counts but I need to project only those which has count greater than or equal to two but my match part is not working. Can any one guide me as where am I going wrong?\u003c/p\u003e","accepted_answer_id":"33666874","answer_count":"2","comment_count":"0","creation_date":"2015-11-12 07:59:24.333 UTC","last_activity_date":"2017-05-31 20:55:08.157 UTC","last_edit_date":"2017-05-31 20:55:08.157 UTC","last_editor_display_name":"","last_editor_user_id":"2327544","owner_display_name":"","owner_user_id":"3671650","post_type_id":"1","score":"5","tags":"mongodb|mongodb-query","view_count":"3026"} +{"id":"18194648","title":"drupal: let users upload content type","body":"\u003cp\u003ewe want users to be able to upload an instance of a certain content type themselves using a form. Content type contains text, images and should be linked to the user uploading it. \nWe've got the Profile2, account profile and IMCE modules installed but we can't seem to find a module that lets users upload a content type. \nIs this even possible, if not what are possible alternatives?\nthanks.\u003c/p\u003e","accepted_answer_id":"18195165","answer_count":"1","comment_count":"0","creation_date":"2013-08-12 19:00:27.197 UTC","last_activity_date":"2013-08-12 19:29:43.473 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2398705","post_type_id":"1","score":"0","tags":"drupal|upload|module|user|drupal-content-types","view_count":"92"} +{"id":"43825431","title":"Swift3: local notifications when user is close to some place","body":"\u003cp\u003eI have a list of latitudes and longitudes inside a ViewController.\u003c/p\u003e\n\n\u003cp\u003eHow can I throw a notification (with the app in background) always the user passes close enough (eg 200 meters) to some of these places in the list?\u003c/p\u003e\n\n\u003cp\u003eI tried lots of things as permissions for background mode from location to fetch and a lot of things that aren't worth mentioning because none of them worked...\u003c/p\u003e\n\n\u003cp\u003eI'm using CoreLocation (only) to get current location\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2017-05-06 21:12:06.403 UTC","last_activity_date":"2017-05-06 21:12:06.403 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5162677","post_type_id":"1","score":"0","tags":"ios|notifications|core-location","view_count":"18"} +{"id":"21821442","title":"Newbie - Android coding issue of button","body":"\u003cp\u003eI placed a button and set its id to \u003ccode\u003e@+id/ourButton\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eThen on the \u003cstrong\u003eMainActivity.java\u003c/strong\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eButton myButton = (Button) findViewById(R.id.ourButton);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt looks \u003ccode\u003eR.id.ourButton\u003c/code\u003e is undeclared or not existing.\u003c/p\u003e","answer_count":"2","comment_count":"5","creation_date":"2014-02-17 05:30:24.167 UTC","last_activity_date":"2014-02-17 06:34:43.133 UTC","last_edit_date":"2014-02-17 05:33:18.287 UTC","last_editor_display_name":"","last_editor_user_id":"1965587","owner_display_name":"","owner_user_id":"3290913","post_type_id":"1","score":"2","tags":"android|button","view_count":"52"} +{"id":"36140237","title":"npm install Giving error when Moving Project to Another Directory","body":"\u003cp\u003eI have a node project running in a directory, and I simply want to move it to another directory, let's say. When I try that, of course without the node_modules folder, and try to run npm install; it gives this error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enpm ERR! addLocal Could not install /Users/me_here\nnpm ERR! Darwin 15.3.0\nnpm ERR! argv \"/usr/local/bin/node\" \"/usr/local/bin/npm\" \"install\"\nnpm ERR! node v5.8.0\nnpm ERR! npm v3.7.3\n\nnpm ERR! No version provided in package.json\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy package.json is as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n \"name\": \"my-amazing-title\",\n \"version\": \"1.0.0\",\n \"description\": \"an amazing description\",\n \"main\": \"app.js\",\n \"scripts\": {\n \"start\": \"node app.js\"\n },\n \"author\": \"My full name\",\n \"license\": \"MIT\",\n\n \"dependencies\": {\n \"express\": \"3.3.5\",\n \"express-react-views\": \"file:../../\",\n \"js-md5\": \"^0.4.0\",\n \"react\": \"^0.14.0\",\n \"react-dom\": \"^0.14.0\",\n \"request\": \"^2.69.0\",\n \"webpack\": \"^1.12.14\"\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"36140931","answer_count":"1","comment_count":"1","creation_date":"2016-03-21 19:47:38.987 UTC","last_activity_date":"2016-03-21 22:57:56.11 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4716347","post_type_id":"1","score":"-1","tags":"node.js|error-handling|npm|package.json|npm-install","view_count":"413"} +{"id":"7478731","title":"How do I detect the current page in a Jekyll tag plugin?","body":"\u003cp\u003eI have a Jekyll (Liquid) block plugin and I'd like to detect what the current page is. I see that a context is passed into render, and that I can retrieve the current site object as context.registers[:site]. However, attempts to get the current page as context.registers[:page] fail.\u003c/p\u003e\n\n\u003cp\u003eThe problem I'm trying to solve is to create a simple block plugin to detect if the current page is the page mentioned in the tag, and highlight it.\u003c/p\u003e\n\n\u003cp\u003eAny tips would be greatly appreciated.\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","accepted_answer_id":"7666714","answer_count":"3","comment_count":"0","creation_date":"2011-09-20 00:06:16.03 UTC","favorite_count":"4","last_activity_date":"2014-12-24 11:40:47.71 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"123471","post_type_id":"1","score":"6","tags":"jekyll|liquid","view_count":"2539"} +{"id":"44456146","title":"How to arrange my data in ruby","body":"\u003cp\u003eMy sincere apologies if my question is very obvious. I'm breaking my head over it and yet to get a viable solution or a logic.\u003c/p\u003e\n\n\u003cp\u003einput file below (input.txt)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eRecord: C:/my_files/00_Roll_Tom-values.txt\n\n#RakeBoss-Random as on 12/19/2016\n[groups]\nmet = chk\\rel_io_chk, chk\\dev_op_io,\ndiv = chk\\kzhr2x, chk\\zz52t0, chk\\czzjrt\nrakeonly = chk\\rzgnsd, chk\\cztw5h\n\n[/]\n@met = rw\n@div = rw\n@rakeonly = r\n*******************************************************************************************\nRecord: C:/my_files/Rander-values.txt\n\n#RakeBoss-Jan 21st QA\n[groups]\nmet = chk\\rel_io_chk, chk\\dev_op_io\ndiv = chk\\541kmj, chk\\zz52t0\napp_only = chk\\zz9ycd\ncheck_io = chk\\wder4, chk\\zz9ycd\ndiv_write = chk\\lo98j3\nyear_on = chk\\3w345f\n[/]\n@met = rw\n@div = rw\n@app_only= r\n@check_io = r\n@div_write = rw\n@year_on = r\n\n[/wedmin]\n@check_io = rw\ndiv_write= rw\n\n[/doc/prod]\n@div = rw\n@app_only = r\nyear_on = rw\n*******************************************************************************************\nRecord: C:/my_files/456_Milo_123-values.txt\n\n#RakeBoss-Jan 21st Prod\n[groups]\nmet = chk\\rel_io_chk, chk\\dev_op_io\ndiv = chk\\kzhr2x, chk\\zz52t0, chk\\czzjrt, chk\\pzjwr3\njee_only = chk\\zz9ycd, chk\\hz659l, chk\\zzktgj, \ncheck_io = chk\\8u7y01, chk\\zz9ycd\nunique_key = chk\\zz9ycd\nyear_on = chk\\dytg6\n[/]\n@met = rw\n@div = rw\n@rakeonly = r\n\n[/Release]\n@check_io = rw\n@unique_key = rw\n\n[/Redmine/Treehub]\n@div = r\n@jee_only = rw\n******************************************************************************************\nRecord: C:/my_files/Docker_red-values.txt\n\n#RakeBoss-Check it io.\n[groups]\nmet = chk\\rel_io_chk, chk\\dev_op_io, chk\\njk987\ndiv = chk\\gzlqvg, chk\\zzkgyp, chk\\lzg0rp, chk\\gzp2kv\nrakeonly = chk\\qzvjq0, chk\\kz6w6t, chk\\bzy4kj, chk\\dzfbhp\n\n[/]\n@met = rw\n@div = rw\n@rakeonly = r\n******************************************************************************************\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm trying to read the input file and write the formatted output to an Excel. Every module or a set is separated by series of '#'. For the 1st set as seen below output should be in the below format\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003e1st set\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eRecord: C:/my_files/00_Roll_Tom-values.txt\n\n#RakeBoss-Random as on 12/19/2016\n[groups]\nmet = chk\\rel_io_chk, chk\\dev_op_io,\ndiv = chk\\kzhr2x, chk\\zz52t0, chk\\czzjrt\nrakeonly = chk\\rzgnsd, chk\\cztw5h\n\n[/]\n@met = rw\n@div = rw\n@rakeonly = r\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOutput in excel should be\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efile_name cluster id case access_levels\n\n00_Roll_Tom met chk\\rel_io_chk / rw\n00_Roll_Tom met chk\\dev_op_io / rw\n00_Roll_Tom div chk\\kzhr2x / rw\n00_Roll_Tom div chk\\zz52t0 / rw\n00_Roll_Tom div chk\\czzjrt / rw\n00_Roll_Tom rakeonly chk\\rzgnsd / r \n00_Roll_Tom rakeonly chk\\cztw5h / r \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eFor the 2nd set\u003c/strong\u003e \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eRecord: C:/my_files/Rander-values.txt\n\n#RakeBoss-Jan 21st QA\n[groups]\nmet = chk\\rel_io_chk, chk\\dev_op_io\ndiv = chk\\541kmj, chk\\zz52t0\ncheck_io = chk\\wder4, chk\\zz9ycd\ndiv_write = chk\\lo98j3\n\n[/]\n@met = rw\n@div = rw\n@check_io = r\n@div_write = r\n\n[/wedmin]\n@check_io = rw\ndiv_write= rw\n\n[/doc/prod]\n@div = r\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOutput should be in the same format as the 1st set and so on for the remaining sets.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eRander-values met chk\\rel_io_chk / r\nRander-values met chk\\dev_op_io / r\nRander-values div chk\\541kmj / r\nRander-values div chk\\zz52t0 / r\nRander-values check_io chk\\wder4 / r\nRander-values check_io chk\\zz9ycd / r\nRander-values div_write lo98j3 / r\nRander-values check_io chk\\wder4 /wedmin rw\nRander-values check_io chk\\zz9ycd /wedmin rw\nRander-values div_write lo98j3 /wedmin rw\nRander-values div chk\\541kmj /doc/prod r\nRander-values div chk\\zz52t0 /doc/prod r\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm not sure how to process the data or what structure should I consider. I have wen thru multiple documentation and blogs but I couldn't fix one. Any help here is really appreciated. Thanks.\u003c/p\u003e\n\n\u003cp\u003eI'm just stuck with the only with the below piece of code and I'm lost how to move forward\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efile = File.open(\"C:/input.txt\", \"r\").read\ndata = file.split(/\\*+/)\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"7","creation_date":"2017-06-09 11:03:09.943 UTC","favorite_count":"1","last_activity_date":"2017-06-09 11:43:55.95 UTC","last_edit_date":"2017-06-09 11:43:55.95 UTC","last_editor_display_name":"","last_editor_user_id":"6760948","owner_display_name":"","owner_user_id":"6760948","post_type_id":"1","score":"1","tags":"ruby","view_count":"59"} +{"id":"22943864","title":"Jquery - split returned array(Json)","body":"\u003cp\u003eajax i have this snippet:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(\"input#search_field\").keyup(function(){\n var searchText = $(\"input#search_field\").val()\n if(searchText.length \u0026gt; 1){\n $.ajax({\n url: 'search.php',\n data: {data: JSON.stringify(searchText)},\n type: 'POST',\n dataType: \"json\",\n success: function (data) {\n if(data.result == 1) {\n console.log(data.error);\n }\n if(data.result == 0) {\n console.log(data.error)\n }\n }\n });\n } \n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen data.result is = 1, than the returned data.error is an array, in my console:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[\"string\"]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy question is how get every string in my array into a different variable so i can use it later?\u003c/p\u003e\n\n\u003cp\u003eBecause returned array could be also:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[\"string\",\"string2\",\"string3\"]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnyone knows?? Greetings!\u003c/p\u003e","answer_count":"1","comment_count":"7","creation_date":"2014-04-08 17:13:56.467 UTC","last_activity_date":"2017-03-27 21:21:59.227 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3297073","post_type_id":"1","score":"0","tags":"javascript|php|jquery|arrays|json","view_count":"73"} +{"id":"13756216","title":"running a set up file in a batch as an admin?","body":"\u003cp\u003eI created a batch to run specific commands, the code looks like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecd D:\\projects\\Project Stress Test\\signed one\\com0com\\x64\nsetupc\npause\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhat i want is to run the \u003ccode\u003esetupc\u003c/code\u003e file as an admin?\u003c/p\u003e\n\n\u003cp\u003ei tried \u003ccode\u003erunas /user:\u0026lt;Name\u0026gt;\\administrator\u003c/code\u003e commands but it didnt work.\u003c/p\u003e\n\n\u003cp\u003eis there any easy way to do that?\u003c/p\u003e","accepted_answer_id":"13869544","answer_count":"1","comment_count":"13","creation_date":"2012-12-07 02:48:31.66 UTC","favorite_count":"1","last_activity_date":"2012-12-14 03:23:52.687 UTC","last_edit_date":"2012-12-07 08:16:30.237 UTC","last_editor_display_name":"","last_editor_user_id":"305142","owner_display_name":"","owner_user_id":"1846479","post_type_id":"1","score":"0","tags":"batch-file|cmd","view_count":"2279"} +{"id":"11986893","title":"when does task_struct used?","body":"\u003cp\u003eI have wrote a simple LKM in linux kernel 2.6\nwhich traverses linked list of task_struct and\nmanipulates pointer. like this.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprintk(\"original p-\u0026gt;tasks.prev-\u0026gt;next : %p\\n\", p-\u0026gt;tasks.prev-\u0026gt;next);\np-\u0026gt;tasks.prev-\u0026gt;next = p-\u0026gt;tasks.next;\nprintk(\"manipulated p-\u0026gt;tasks.prev-\u0026gt;next : %p\\n\", p-\u0026gt;tasks.prev-\u0026gt;next);\n\nprintk(\"original p-\u0026gt;tasks.next-\u0026gt;prev : %p\\n\", p-\u0026gt;tasks.next-\u0026gt;prev);\np-\u0026gt;tasks.next-\u0026gt;prev = p-\u0026gt;tasks.prev;\nprintk(\"manipulated p-\u0026gt;tasks.next-\u0026gt;prev : %p\\n\", p-\u0026gt;tasks.next-\u0026gt;prev);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut this has no effect on system.\nI know that process listing(ps) uses /proc filesystem. so I know this has nothing to do with actual task_struct linked list inside kernel.\nbut I thought linux scheduler would use this list. but it seems wrong.\u003c/p\u003e\n\n\u003cp\u003ewhy is there no effect even if I change task_struct inside kernel??\nwhen is this linked list referenced by system??\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2012-08-16 12:14:02.05 UTC","last_activity_date":"2012-08-16 12:36:39.657 UTC","last_edit_date":"2012-08-16 12:18:06.91 UTC","last_editor_display_name":"","last_editor_user_id":"642148","owner_display_name":"","owner_user_id":"1528889","post_type_id":"1","score":"0","tags":"c|linux|kernel|task","view_count":"4967"} +{"id":"44995265","title":"My JTextPane doesn't get updated?","body":"\u003cp\u003eMy \u003ccode\u003eTextPane\u003c/code\u003e doesn't get updated, and I think it is because of my class structure.\u003c/p\u003e\n\n\u003cp\u003eMy main question is how can I update my \u003ccode\u003eTextPane\u003c/code\u003e without changing this structure, because I like it?\u003c/p\u003e\n\n\u003cp\u003eHave in mind that I just post the relevant code.\u003c/p\u003e\n\n\u003cp\u003eFirst of all we start at creating my \u003ccode\u003eJFrame\u003c/code\u003e.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class Frame extends JFrame {\n\n public Frame() throws HeadlessException {\n create Frame();\n }\n\n public void createFrame() {\n JSplitPane splitPane = content.determineJSplitpane();\n add(splitPane);\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe next one is my \u003ccode\u003edetermineSplitpane\u003c/code\u003e. I need this method to define 3 areas.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class KalenderFrameSplit {\n private FrameLeft left = new KalenderFrameLinks();\n private FrameMiddle middle = new KalenderFrameMitte();\n private FrameRight right = new KalenderFrameRechts();\n\n public JSplitPane determineJSplitpane() {\n JPanel leftPanel = this.left.leftArea();\n JScrollPane centerPanel = this.middle.middleArea();\n JPanel rightPanel = this.right.rightArea();\n\n JSplitPane splitPane1 = new JSplitPane();\n JSplitPane splitPane2 = new JSplitPane();\n splitPane1.setOrientation(JSplitPane.HORIZONTAL_SPLIT);\n splitPane1.setRightComponent(splitPane2);\n splitPane1.setLeftComponent(leftPanel);\n splitPane1.setEnabled(true);\n splitPane1.setDividerSize(3);\n\n splitPane2.setOrientation(JSplitPane.HORIZONTAL_SPLIT);\n splitPane2.setRightComponent(rightPanel);\n splitPane2.setLeftComponent(centerPanel);\n splitPane2.setDividerLocation(-2000);\n splitPane2.setEnabled(true);\n splitPane2.setMinimumSize(new Dimension(4000, 0));\n splitPane2.setDividerSize(3);\n\n return splitPane1;\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe last one is my middle section class. I set the output with a radio button but I have made it easy with a method that sets the value of the \u003ccode\u003eTextPane\u003c/code\u003e. Later I must add style into the text. My teacher told me that I should use \u003ccode\u003eDocument\u003c/code\u003e in a \u003ccode\u003eTextPane\u003c/code\u003e and that it gets updated automatically, but I have no idea how to do that.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class FrameMiddle {\n\n JTextPane textPane = new JTextPane();\n\n public JScrollPane middleArea() {\n JPanel panel = new JPanel(new BorderLayout());\n\n Document document;\n\n this.textPane.setText(\"\");\n //this.textPane.setDocument();\n\n this.textPane.setLayout(new BorderLayout(200, 200));\n this.textPane.setEditable(false);\n panel.add(textPane);\n panel.setBackground(Color.white);\n\n JScrollPane scrollPane = new JScrollPane();\n scrollPane.setViewportView(panel);\n scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);\n return scrollPane;\n }\n\n public void getContentOfTextPane() {\n this.textPane.setText(\"Hello World\");\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI hope you guys can help me. I know that \u003ccode\u003epublic void getContentOfTextPane\u003c/code\u003e isn't called but I want to ask the question as clean as possible. Because I ask this question but my question was not very clean and so I don't get any solution.\u003c/p\u003e","answer_count":"0","comment_count":"5","creation_date":"2017-07-09 10:09:45.56 UTC","last_activity_date":"2017-07-10 19:40:09.223 UTC","last_edit_date":"2017-07-10 19:40:09.223 UTC","last_editor_display_name":"","last_editor_user_id":"812786","owner_display_name":"","owner_user_id":"8231651","post_type_id":"1","score":"0","tags":"java|swing|polymorphism|jtextpane","view_count":"45"} +{"id":"22976236","title":"Find scale amount based on new dimensions","body":"\u003cp\u003eIf I have an image that has 100 x 100 size, then I resize it to 200 x 200, how can I calculate how much it was scaled?\u003c/p\u003e\n\n\u003cp\u003eIn this example the scale amount would be 2.0. How can I get that number from the known variables (original size, new size) ?\u003c/p\u003e","accepted_answer_id":"22976284","answer_count":"1","comment_count":"3","creation_date":"2014-04-10 00:07:21.74 UTC","last_activity_date":"2014-04-10 00:30:01.183 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3450454","post_type_id":"1","score":"0","tags":"javascript|math","view_count":"27"} +{"id":"41646793","title":"How to change the background color of the plot title in ggplot2?","body":"\u003cp\u003eI am going to change the background color of the title which is plot by gglot2, making it look like using facet. Actually, it seems I could plot just using one facet. But are there any other parameters that could change the background color of a title of a plot?\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2017-01-14 04:29:19.8 UTC","favorite_count":"2","last_activity_date":"2017-01-17 06:32:00.89 UTC","last_edit_date":"2017-01-17 06:32:00.89 UTC","last_editor_display_name":"","last_editor_user_id":"3817004","owner_display_name":"","owner_user_id":"7417597","post_type_id":"1","score":"1","tags":"r|ggplot2|background-color|title","view_count":"418"} +{"id":"11795538","title":"How to use cin for exit in C++","body":"\u003cp\u003eI have the following code from a book about Algorithms by Robert Sedwick.\u003c/p\u003e\n\n\u003cp\u003eHow do i break a for loop in the following statement \u003ccode\u003eif (!(cin \u0026gt;\u0026gt; a[N])) break;\u003c/code\u003e \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;iostream\u0026gt;\n#include \u0026lt;stdlib.h\u0026gt;\n#include \u0026lt;string\u0026gt;\n\nusing namespace std;\nint compare(const void *i, const void *j)\n { return strcmp(*(char **)i, *(char **)j); }\nint main()\n { const int Nmax = 1000;\n const int Mmax = 10000;\n char* a[Nmax]; int N;\n char buf[Mmax]; int M = 0;\n for (N = 0; N \u0026lt; Nmax; N++)\n {\n a[N] = \u0026amp;buf[M];\n if (!(cin \u0026gt;\u0026gt; a[N])) break; \n M += strlen(a[N])+1;\n }\n // std::cout \u0026lt;\u0026lt; \"Number of strings entered are \" \u0026lt;\u0026lt; N \u0026lt;\u0026lt; std::endl;\n qsort(a, N, sizeof(char*), compare);\n for (int i = 0; i \u0026lt; N; i++) \n cout \u0026lt;\u0026lt; a[i] \u0026lt;\u0026lt; endl;\n }\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"11795570","answer_count":"1","comment_count":"3","creation_date":"2012-08-03 12:14:06.657 UTC","last_activity_date":"2012-08-08 14:12:55.813 UTC","last_edit_date":"2012-08-08 14:12:55.813 UTC","last_editor_display_name":"","last_editor_user_id":"427763","owner_display_name":"","owner_user_id":"519882","post_type_id":"1","score":"0","tags":"c++","view_count":"130"} +{"id":"25575592","title":"Console shows \"List`1[System.String]\" when trying to read particular JSON field","body":"\u003cp\u003eWhen I called a Restful Web API, I received a JSON string as the response from the server. So, I deserialized the JSON string to a .NET object with the following codes: \u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eRootObject obj = JsonConvert.DeserializeObject\u0026lt;RootObject\u0026gt;(jsonString);\u003c/code\u003e \u003c/p\u003e\n\n\u003cp\u003eThe response (JSON string) of my API call is below:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\"Observation\":{\"FeelsLike\":{\"Text\":[\"23\"]},\"WindDirection\":{\"Value\":\"SE\",\"Text\":[\"SE\"],\"ImageKey\":\"windSE\"},\"WindSpeed\":{\"Text\":[\"14km/h\"]},\"Pressure\":{\"Text\":[\"102.4kPa\"]},\"Visibility\":{\"Text\":[\"16.0km\"]},\"Ceiling\":{\"Text\":[\"21900ft\"]},\"Humidity\":{\"Text\":[\"70%\"]},\"Sunrise\":{\"Text\":[\"06:38\"]},\"Sunset\":{\"Text\":[\"19:57\"]},\"ExpirationTime\":{\"Value\":8286},\"RefreshTime\":{\"Value\":1267},\"Timestamp\":{\"GMT\":\"2014-08-29T15:45\",\"Local\":\"2014-08-29T11:45\",\"Text\":[\"August 29 2014, 11:45 AM\"]},\"Icon\":{\"Value\":\"OVC\",\"TextKey\":\"obs24\",\"ImageKey\":\"wxicon8\"},\"Temperature\":{\"Text\":[\"19\",\"°C\"]}}} \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow, I want to access (store 23 to a variable) the value 23 in \"FeelsLike\":{\"Text\":[\"23\"]}, how do I do that?\u003c/p\u003e\n\n\u003cp\u003eI tried the following approach, but weren't successful:\u003c/p\u003e\n\n\u003cp\u003eStep 1). I converted JSON string to C# classes (link to classes code: \u003ca href=\"http://goo.gl/OTKL4l\" rel=\"nofollow\"\u003ehttp://goo.gl/OTKL4l\u003c/a\u003e) on \u003ca href=\"http://json2csharp.com/\" rel=\"nofollow\"\u003ehttp://json2csharp.com/\u003c/a\u003e, and I tried accessing the value 23 with this line of code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eConsole.WriteLine(obj.Observation.FeelsLike.Text);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut I got the following output:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSystem.Collections.Generic.List`1[System.String]\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"25575681","answer_count":"3","comment_count":"3","creation_date":"2014-08-29 20:16:32.023 UTC","last_activity_date":"2014-08-29 20:27:28.773 UTC","last_edit_date":"2014-08-29 20:21:14.027 UTC","last_editor_display_name":"","last_editor_user_id":"2864740","owner_display_name":"","owner_user_id":"2644318","post_type_id":"1","score":"-2","tags":"c#|json.net|json-deserialization","view_count":"60"} +{"id":"39643016","title":"angularfire not working with me , I don't know why?","body":"\u003cp\u003ethe html code - which call the required libraries\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;!DOCTYPE html\u0026gt;\n\u0026lt;html\u0026gt;\n \u0026lt;head\u0026gt;\n \u0026lt;script type=\"text/javascript\" src=\"https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;script type=\"text/javascript\" src=\"https://www.gstatic.com/firebasejs/3.0.0/firebase.js\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;script type=\"text/javascript\" src=\"https://cdn.firebase.com/libs/angularfire/1.2.0/angularfire.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\n\n \u0026lt;script type=\"text/javascript\" src=\"JS/app.js\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;/head\u0026gt;\n \u0026lt;body ng-app=\"seworko\"\u0026gt;\n \u0026lt;div ng-controller=\"users\"\u0026gt;\n {{ 4+4 }}\n \u0026lt;/div\u0026gt;\n \u0026lt;/body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethe Javascript code\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e var app = angular.module(\"seworko\", [\"firebase\"]);\n\n var config = {\n apiKey:\"myKey\",\n authDomain:\"myDomain.firebaseio.com\",\n databaseURL:\"https://myUrl.firebaseio.com\",\n storageBucket:\"myBucket.com\"};\n firebase.initializeApp(config);\n\napp.controller(\"users\", function($scope, $firebaseObject) {\n try\n {\n const rootRef = firebase.database().ref().child('system');\n const ref = rootRef.child('global');\n this.global = $firebaseObject(ref);\n }\n catch(e)\n {\n alert(e);//type error a.ref is not a function\n }\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am getting this error -\u003e \ntype error a.ref is not a function !!\u003c/p\u003e\n\n\u003cp\u003eI don't know the reason for the error\nI followed too many tutorials , and can't connect firebase with angularJS using angularfire\u003c/p\u003e","answer_count":"0","comment_count":"15","creation_date":"2016-09-22 15:23:33.397 UTC","last_activity_date":"2016-09-22 15:36:40.197 UTC","last_edit_date":"2016-09-22 15:36:40.197 UTC","last_editor_display_name":"","last_editor_user_id":"1987838","owner_display_name":"","owner_user_id":"5146437","post_type_id":"1","score":"0","tags":"javascript|angularjs|firebase|angularfire","view_count":"55"} +{"id":"14318653","title":"nHibernate mysteriously removing items from many-to-one relationship","body":"\u003cp\u003eI have a simple application where users can open orders, make changes to them, then save them back to the database. When an order is opened, I retrieve it from the database like this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eISession session = SessionFactory.OpenSession();\n\n...\n\nOrder order = session.Query\u0026lt;Order\u0026gt;()\n .Where(o =\u0026gt; o.Id == id)\n .FirstOrDefault();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eTo enable lazy loading of order.Comments, I keep the session open until the order is closed. Here are the mappings:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;class name=\"Order\"\u0026gt;\n \u0026lt;id name=\"Id\"\u0026gt;\n \u0026lt;generator class=\"identity\" /\u0026gt;\n \u0026lt;/id\u0026gt; \n\n...\n\n \u0026lt;set name=\"Comments\" access=\"field.camelcase-underscore\" cascade=\"all-delete-orphan\" lazy=\"true\" order-by=\"Created\"\u0026gt;\n \u0026lt;key column=\"OrderId\" /\u0026gt;\n \u0026lt;one-to-many class=\"Comment\" /\u0026gt;\n \u0026lt;/set\u0026gt; \n\u0026lt;/class\u0026gt;\n\n\u0026lt;class name=\"Comment\" table=\"OrderComment\" lazy=\"false\"\u0026gt;\n \u0026lt;id name=\"Id\"\u0026gt;\n \u0026lt;generator class=\"identity\" /\u0026gt;\n \u0026lt;/id\u0026gt;\n \u0026lt;many-to-one name=\"Author\" /\u0026gt;\n \u0026lt;property name=\"Created\" /\u0026gt;\n \u0026lt;property name=\"Text\" length=\"1000\" /\u0026gt;\n\u0026lt;/class\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe app is designed so that while an order is open, it can be saved several times before it is closed. I save like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eusing (ITransaction trans = session.BeginTransaction())\n{\n session.SaveOrUpdate(order)\n trans.Commit();\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFinally, when the user closes the order, I dispose of the session.\u003c/p\u003e\n\n\u003cp\u003eHere's there problem: If the user adds a comment, saves, and then before closing the order, adds another comment and saves again, the first comment is removed during the second save. Here's the sql that is outputted from the second save:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eNHibernate: INSERT INTO OrderComment (Id, Author, Created, Text) VALUES (hibernate_sequence.nextval, :p0, :p1, :p2) returning Id into :nhIdOutParam;:p0 = 1 [Type: Int32 (0)], :p1 = 14.01.2013 12:53:20 [Type: DateTime (0)], :p2 = '2' [Type: String (0)], :nhIdOutParam = NULL [Type: Int32 (0)]\n\n**NHibernate: UPDATE OrderComment SET OrderId = null WHERE OrderId = :p0 AND Id = :p1;:p0 = 465 [Type: Int32 (0)], :p1 = 591 [Type: Int32 (0)]**\n\nNHibernate: UPDATE OrderComment SET OrderId = :p0 WHERE Id = :p1;:p0 = 465 [Type: Int32 (0)], :p1 = 592 [Type: Int32 (0)]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo the problem is that line in bold - the OrderId for the first comment is being set to null. Can anybody tell my why?\u003c/p\u003e\n\n\u003cp\u003eIs there anything wrong with the way I'm using nHibernate here? To reiterate what I do:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eOpen a session\u003c/li\u003e\n\u003cli\u003eRetrieve an object\u003c/li\u003e\n\u003cli\u003eUser updates the object\u003c/li\u003e\n\u003cli\u003eSave the object by beginning a transaction, calling session.SaveOrUpdate(object), then committing the transaction.\u003c/li\u003e\n\u003cli\u003eRepeat steps 3 and 4 any number of times.\u003c/li\u003e\n\u003cli\u003eDispose of the session.\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eIs this an acceptable way to use \u003ccode\u003enHibernate\u003c/code\u003e? \u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdit\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eHere is the comments property in the Order class:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eICollection\u0026lt;Comment\u0026gt; _comments = new List\u0026lt;Comment\u0026gt;();\npublic virtual ReadOnlyCollection\u0026lt;Comment\u0026gt; Comments\n{\n get \n {\n return _comments.ToList().AsReadOnly(); \n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThen comments are added by calling the following method:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic virtual void AddComment(Comment comment)\n{\n _comments.Add(comment); \n}\n\n ...\n\nComment comment = new Comment()\n{\n Author = User.Current,\n Created = DateTime.Now,\n Text = text\n};\n\norder.AddComment(comment);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is the Comment class. Id is implemented in the base class \u003ccode\u003ePersistentObject\u0026lt;T\u0026gt;\u003c/code\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class Comment : PersistentObject\u0026lt;int\u0026gt;\n{ \n public User Author { get; private set; }\n public DateTime Created { get; private set; }\n public string Text { get; private set; } \n}\n\npublic abstract class PersistentObject\u0026lt;T\u0026gt;\n{ \n public virtual T Id { get; protected internal set; } \n\n public override bool Equals(object obj)\n {\n // If both objects have not been saved to database, then can't compare Id because this\n // will be 0 for both. In this case use reference equality.\n\n PersistentObject\u0026lt;T\u0026gt; other = obj as PersistentObject\u0026lt;T\u0026gt;;\n if (other == null)\n return false;\n\n bool thisIsDefault = object.Equals(Id, default(T));\n bool otherIsDefault = object.Equals(other.Id, default(T));\n\n if (thisIsDefault \u0026amp;\u0026amp; otherIsDefault)\n return object.ReferenceEquals(this, other);\n else if (thisIsDefault || otherIsDefault)\n return false;\n else\n return object.Equals(this.Id, other.Id);\n }\n\n public override int GetHashCode()\n {\n return Id.GetHashCode();\n } \n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"14322213","answer_count":"2","comment_count":"2","creation_date":"2013-01-14 12:45:10.307 UTC","last_activity_date":"2013-01-14 16:14:00.74 UTC","last_edit_date":"2013-01-14 16:10:14.39 UTC","last_editor_display_name":"","last_editor_user_id":"1388733","owner_display_name":"","owner_user_id":"1388733","post_type_id":"1","score":"1","tags":"c#|.net|nhibernate","view_count":"212"} +{"id":"34703763","title":"Why won't admob interstitial ads display?","body":"\u003cp\u003eSo I've added banner and interstitial ads both from admob in my unity android project.So I've tested it on my test device and my banner ad is showing fine but my interstitial ad won't display.\u003c/p\u003e\n\n\u003cp\u003eI've made it on every 11 games to show the interstitial ad:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic void OnCollisionEnter2D(Collision2D other)\n {\n\n if (other.gameObject.tag == \"Pipe\")\n {\n s.GameOver();\n targetVelocity.y = 0;\n targetVelocity.x = 0;\n cube.gameObject.SetActive(false);\n score.gameObject.SetActive(false);\n this.anime2.enabled = true;\n\n }\n\n\n PlayerPrefs.SetInt(\"Ad Counter\", PlayerPrefs.GetInt(\"Ad Counter\") + 1);\n\n if (PlayerPrefs.GetInt(\"Ad Counter\") \u0026gt; 10)\n {\n if (interstitial.IsLoaded())\n {\n interstitial.Show();\n }\n\n PlayerPrefs.SetInt(\"Ad Counter\", 0);\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd this is my request code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate void RequestInterstitial()\n\n {\n#if UNITY_ANDROID\n\n string adUnitId =\"ca-app -pub-3960055046097211/6145173288\";\n\n#elif UNITY_IPHONE\n\n string adUnitId = \"INSERT_IOS_INTERSTITIAL_AD_UNIT_ID_HERE\";\n\n#else\n\n string adUnitId = \"unexpected_platform\";\n\n#endif\n\n // Initialize an InterstitialAd.\n\n InterstitialAd interstitial = new InterstitialAd(adUnitId);\n\n // Create an empty ad request.\n\n AdRequest request = new AdRequest.Builder().Build();\n\n // Load the interstitial with the request.\n\n interstitial.LoadAd(request);\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOf course afterwards i called the method in the start().\u003c/p\u003e\n\n\u003cp\u003eSo where is the problem?Should i put this script on an empty object?\u003c/p\u003e","answer_count":"2","comment_count":"4","creation_date":"2016-01-10 09:06:53.603 UTC","last_activity_date":"2017-03-16 14:20:40.52 UTC","last_edit_date":"2016-01-19 19:25:03.843 UTC","last_editor_display_name":"","last_editor_user_id":"5562778","owner_display_name":"","owner_user_id":"5562778","post_type_id":"1","score":"1","tags":"unity3d|admob|ads","view_count":"720"} +{"id":"45016782","title":"JAVA:How to print my CreditCard object's contents, instead of address? (I am printing the reference address)","body":"\u003cp\u003eI'm working on an exercise in my Data Structures book, and it seems that I am printing the reference address instead of the actual contents? Can someone please take a look at my code and help me out? Thank you for your time.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class CreditCard {\n// instance variables\nprivate String customer;\nprivate String bank;\nprivate String account;\nprivate int limit;\nprotected double balance;\n\n// constructors - account for all cases, one with a bal, and one without\npublic CreditCard(String cust, String bk, String acnt, int lim, double bal){\n customer = cust;\n bank = bk;\n account = acnt;\n limit = lim;\n balance = bal;\n}\npublic CreditCard(String cust, String bk, String acnt, int lim){\n this(cust, bk, acnt, lim, - 0.0);\n}\n// accessors\npublic String getCustomer(){return customer;}\npublic String getBank(){return bank;}\npublic String getAccount(){return account;}\npublic double getLimit(){return limit;}\npublic double getBalance(){return balance;}\n\n// updaters\npublic boolean charge(double price){\n if(price + balance \u0026gt; limit){\n return false;\n }\n else balance += price;\n return true;\n}\npublic void makePayment(double amount){\n balance -= amount;\n}\n\n// utility (static)\npublic static void printSummary(CreditCard card){\n System.out.println(\"Customer = \" + card.customer);\n System.out.println(\"Bank = \" + card.bank);\n System.out.println(\"Account = \" + card.account);\n System.out.println(\"Limit = \" + card.limit);\n System.out.println(\"Balance = \" + card.balance);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e}// end class CreditCard\u003c/p\u003e","accepted_answer_id":"45017132","answer_count":"2","comment_count":"1","creation_date":"2017-07-10 16:04:05.167 UTC","last_activity_date":"2017-07-10 22:35:32.177 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3264496","post_type_id":"1","score":"0","tags":"java|object|printing|output","view_count":"48"} +{"id":"22814096","title":"Auto complete in webmatrix 3","body":"\u003cp\u003eWebmatrix 3 has the intelisense feature that enables it to autocomplete tags and stuffs . \nBut once in a tutorial i saw that it was able to even auto complete some style options which were from seperate files \u003c/p\u003e\n\n\u003cp\u003eex : \u003c/p\u003e\n\n\u003cp\u003ei have an index.html \nand i have bootstrap at css/bootstrap.css \u003c/p\u003e\n\n\u003cp\u003einside it\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;html\u0026gt; \n\n\n\n.\n.\n// when i type \n// \u0026lt;button type=\"button\" class=\"btn \n\n//i want it to have \n\n \u0026lt;button type=\"button\" class=\"btn btn-default // and much more options \n\u0026lt;/html\u0026gt; \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ehow do u enable this feature ? \nor doesn anyone know any other editor which can do this ? \nthanks in advance \u003c/p\u003e","accepted_answer_id":"22897369","answer_count":"2","comment_count":"0","creation_date":"2014-04-02 14:07:49.443 UTC","last_activity_date":"2014-04-06 17:23:37.143 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2796343","post_type_id":"1","score":"0","tags":"javascript|html|css3|autocomplete|webmatrix","view_count":"289"} +{"id":"11100589","title":"Bulk Insert from in from table to table","body":"\u003cp\u003eI am implementing an A/B/View scenario meaning that the View points to table A, while table B is updated, then a switch occurs and the view points to table B while table A is loaded and so on. The switch occurs daily. There are millions of rows and thousands of users. I am on SQL Server 2012.\u003c/p\u003e\n\n\u003cp\u003eMy question is how to insert data into a table from another table in the fastest possible way (within a stored proc). Is there any way to use BULK INSERT? Or, is using regular insert/select the fastest way to go?\u003c/p\u003e","answer_count":"7","comment_count":"0","creation_date":"2012-06-19 12:08:42.18 UTC","favorite_count":"1","last_activity_date":"2016-07-26 07:40:53.083 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1044169","post_type_id":"1","score":"2","tags":"sql|sql-server|insert|bulkinsert","view_count":"28638"} +{"id":"27685505","title":"how to get request of flask in decorator logger?","body":"\u003cp\u003eI want writing log about query strings and form data of request object in flask. \u003c/p\u003e\n\n\u003cp\u003eI use decorator function for logging. \u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003ecustomlog.py\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport logging\n\ndef webLog(func):\n @wraps(func)\n def newFunc(*args, **kwargs):\n logging.debug(request.url + \" : \" + str(request.remote_addr))\n return func(*args, **kwargs)\n return newFunc\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003emain.py\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@app.route('/')\n@customlog.webLog\ndef hello_world():\n return 'Hello World!'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut, request in main.py, another source file. \u003c/p\u003e\n\n\u003cp\u003eHow to get request object for logging?\u003cbr\u003e\nUsing parameters of decorator function?\u003c/p\u003e","accepted_answer_id":"27685579","answer_count":"1","comment_count":"0","creation_date":"2014-12-29 08:14:06.98 UTC","last_activity_date":"2014-12-29 08:27:10.887 UTC","last_edit_date":"2014-12-29 08:16:08.277 UTC","last_editor_display_name":"","last_editor_user_id":"3336968","owner_display_name":"","owner_user_id":"807540","post_type_id":"1","score":"2","tags":"python|flask|decorator","view_count":"773"} +{"id":"15934076","title":"inmobi javascript call ad twice","body":"\u003cp\u003eAccording to inmobi Developer Wiki\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://developer.inmobi.com/wiki/index.php?title=JavaScript\" rel=\"nofollow\"\u003ehttp://developer.inmobi.com/wiki/index.php?title=JavaScript\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eYou can call the Ads on Demand using manual: true parameter in the Var section:\u003c/p\u003e\n\n\u003cp\u003eE.g:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;script type=\"text/javascript\" src=\"http://cf.cdn.inmobi.com/ad/inmobi.js\"\u0026gt;\n \u0026lt;/script\u0026gt; \n\n\u0026lt;script type=\"text/javascript\"\u0026gt;\n var inmobi_conf = {\n siteid : \"your site id\",\n slot : \"slot number\",\n test: true,\n manual: true\n };\n\u0026lt;/script\u0026gt;\n\n\n\u0026lt;div id=\"adArea\"\u0026gt; \u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eTo generate the Ad you have to call it using:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e_inmobi.getNewAd(document.getElementById('adArea'));\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eit should populate the Ad.\u003c/p\u003e\n\n\u003cp\u003eI´ve created a simple test example to request an Ad on demand (using test siteid provided by inmobi).\u003c/p\u003e\n\n\u003cp\u003eThe problem is that I have to click twice to load the Ad\u003c/p\u003e\n\n\u003cp\u003eFull Source:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;html\u0026gt;\n \u0026lt;head\u0026gt;\n \u0026lt;script\u0026gt;\n var inmobi_conf = {\n siteid : \"4028cba631d63df10131e1d3191d00cb\",\n slot : \"15\",\n test: true,\n manual: true\n };\n\n function loadAdd(){\n _inmobi.getNewAd(document.getElementById('screen'));\n };\n \u0026lt;/script\u0026gt;\n \u0026lt;script src=\"http://cf.cdn.inmobi.com/ad/inmobi.js\"\u0026gt;\u0026lt;/script\u0026gt; \n \u0026lt;/head\u0026gt;\n \u0026lt;body\u0026gt;\n \u0026lt;div id=\"screen\"\u0026gt; \u0026lt;/div\u0026gt;\n \u0026lt;button id=\"btn1\" onClick=\"loadAdd()\"\u0026gt;Load Ad\u0026lt;/button\u0026gt;\n \u0026lt;/body\u0026gt;\n\u0026lt;/html\u0026gt; \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eYou can try it out on \u003ca href=\"http://jsfiddle.net/YYzqA/\" rel=\"nofollow\"\u003ehttp://jsfiddle.net/YYzqA/\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e1st click on \"Load Ad\" button (no Ad)\u003c/p\u003e\n\n\u003cp\u003e2nd click on \"Load Ab\" button (the Ad will be loaded)\u003c/p\u003e\n\n\u003cp\u003eBy chance do you know the reasons for this behavior? am I missing something?\u003c/p\u003e","accepted_answer_id":"15934242","answer_count":"1","comment_count":"0","creation_date":"2013-04-10 18:53:36.217 UTC","favorite_count":"0","last_activity_date":"2013-09-27 09:59:53.74 UTC","last_edit_date":"2013-09-27 09:59:53.74 UTC","last_editor_display_name":"","last_editor_user_id":"572480","owner_display_name":"","owner_user_id":"2267431","post_type_id":"1","score":"0","tags":"javascript|inmobi","view_count":"627"} +{"id":"26187987","title":"Delphi code to create TcxGrid GroupSummaries at runtime","body":"\u003cp\u003eI have code that creates summary footers at runtime for numeric columns, but I can't get the group summary results to show. I've looked at \u003ca href=\"https://www.devexpress.com/Support/Center/Question/Details/Q449686\" rel=\"nofollow noreferrer\"\u003eHow to create group summaries at runtime\u003c/a\u003e and \u003ca href=\"https://www.devexpress.com/Support/Center/Question/Details/Q99383\" rel=\"nofollow noreferrer\"\u003eHow to set group summary values\u003c/a\u003e and \u003ca href=\"https://stackoverflow.com/questions/2514190/how-can-create-summary-footer-on-runtime\"\u003eHow can create summary footer on runtime?\u003c/a\u003e but I'm hitting runtime error:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eEcxInvalidDataControllerOperation with message 'RecordIndex out of range' \u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003ewhen the grid is rendering.\u003c/p\u003e\n\n\u003cp\u003eThis code accepts any TcxGridDBTableView so it would be very easy to put into an existing Delphi form.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprocedure SummaryGroup(ASummary: TcxDataSummary; AColumn: TcxGridDBColumn;\n AKind: TcxSummaryKind; AFormat: string);\nvar\n sumGroup: TcxDataSummaryGroup;\n link: TcxGridTableSummaryGroupItemLink; //TcxDataSummaryGroupItemLink;\n item: TcxGridDBTableSummaryItem;\nbegin\n AColumn.Summary.FooterKind := AKind;\n AColumn.Summary.FooterFormat := AFormat;\n sumGroup := ASummary.SummaryGroups.Add;\n link := sumGroup.Links.Add as TcxGridTableSummaryGroupItemLink;\n link.Column := AColumn;\n item := sumGroup.SummaryItems.Add as TcxGridDBTableSummaryItem;\n item.Column := AColumn;\n item.Kind := AKind;\n item.Position := spGroup;\n item.Format := AColumn.Summary.FooterFormat;\nend;\n\nprocedure AutoAwesum(AView: TcxGridDBTableView);\nvar\n summary: TcxDataSummary;\n summing: Boolean;\n i: Integer;\n dc: TcxGridDBDataController;\n col: TcxGridDBColumn;\n\nbegin\n dc := AView.DataController;\n summing := False;\n summary := dc.Summary;\n summary.BeginUpdate;\n try\n summary.SummaryGroups.Clear;\n dc.BeginFullUpdate;\n try\n dc.GridView.ClearItems;\n dc.CreateAllItems;\n for i := 1 to AView.ColumnCount - 1 do\n begin\n col := AView.Columns[i];\n case col.DataBinding.Field.DataType of\n ftSmallint, ftInteger, ftWord, ftLargeint, ftAutoInc,\n ftLongWord, ftShortint:\n begin\n summing := true;\n SummaryGroup(summary, col, skSum, '#');\n end;\n ftFloat, ftBCD, ftFMTBcd, ftExtended, ftSingle:\n begin\n summing := true;\n SummaryGroup(summary, col, skSum, '#.##');\n end;\n ftCurrency:\n begin\n summing := true;\n SummaryGroup(summary, col, skSum, '$#.##');\n end;\n end;\n end;\n dc.DataModeController.GridMode := not summing;\n AView.OptionsView.Footer := summing;\n AView.OptionsView.GroupFooterMultiSummaries := summing;\n AView.OptionsView.GroupFooters := gfVisibleWhenExpanded;\n finally\n dc.EndFullUpdate;\n end;\n finally\n summary.EndUpdate;\n end;\nend;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat am I missing? Thanks.\u003c/p\u003e","accepted_answer_id":"26515157","answer_count":"1","comment_count":"8","creation_date":"2014-10-03 23:14:17.793 UTC","last_activity_date":"2014-10-22 19:04:53.893 UTC","last_edit_date":"2017-05-23 12:14:30.097 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"74137","post_type_id":"1","score":"1","tags":"delphi|tcxgrid","view_count":"3309"} +{"id":"12124929","title":"html5 video interactive video player","body":"\u003cp\u003eI have an idea to build an interactive HTML5 video player, I do not want to build something that has already been done but would like to expand on existing ideas. Are there any libraries for building user interactions in HTML5 video, I have looked at popcorn.js, but would like to see other proofs of concept or libraries. \u003c/p\u003e","accepted_answer_id":"22251859","answer_count":"2","comment_count":"1","creation_date":"2012-08-25 19:19:39.19 UTC","last_activity_date":"2016-05-05 05:38:42.717 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1088244","post_type_id":"1","score":"1","tags":"javascript|html5|video|html5-video","view_count":"2051"} +{"id":"11601885","title":"Check if the right versions of Flex and Bison are installed","body":"\u003cp\u003eI'm writing a BASH installer script for a program the requires Flex and Bison version 2.5 or higher.\u003c/p\u003e\n\n\u003cp\u003eI've already got the code to check that \u003ccode\u003eflex\u003c/code\u003e and \u003ccode\u003ebison\u003c/code\u003e are installed at all.\u003c/p\u003e\n\n\u003cp\u003eI'm not sure if this has stayed constant throughout the versions but here are the outputs of \u003ccode\u003eflex --version\u003c/code\u003e and \u003ccode\u003ebison --version\u003c/code\u003e respectively:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e➜ ~ flex --version\nflex 2.5.35\n➜ ~ bison --version\nbison (GNU Bison) 2.5\nWritten by Robert Corbett and Richard Stallman.\n\nCopyright (C) 2011 Free Software Foundation, Inc.\nThis is free software; see the source for copying conditions. There is NO\nwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs there a \"right\" way to check to make sure that the system has flex and bison 2.5 \u003cem\u003eor higher\u003c/em\u003e?\u003c/p\u003e","accepted_answer_id":"11602790","answer_count":"3","comment_count":"0","creation_date":"2012-07-22 16:13:58.467 UTC","favorite_count":"1","last_activity_date":"2013-05-06 18:36:37.223 UTC","last_edit_date":"2013-05-06 18:36:37.223 UTC","last_editor_display_name":"","last_editor_user_id":"15168","owner_display_name":"","owner_user_id":"251162","post_type_id":"1","score":"3","tags":"bash|unix|bison|flex-lexer","view_count":"5201"} +{"id":"41471130","title":"Javascript getting last element of array .pop() is not a function","body":"\u003cp\u003eI'm trying to use the .pop() function to get the last element of my array (it's a count which I then display on my webpage). I'm fairly new to Javascript / Jquery so I'm struggling a bit with this...\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar notif_count = data.pop();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI get the error \"Uncaught TypeError: data.pop is not a function\"\u003c/p\u003e\n\n\u003cp\u003eMy data in the console looks like a multidimensional array but I'm not sure? Here's a sample of the output:\u003c/p\u003e\n\n\u003cp\u003eEDIT 2 - The output is a string containing the characters shown here.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[\n [\n {\n \"_can_chaccess\": true,\n \"_can_chown\": true,\n \"_can_delete\": true,\n \"_can_modify\": true,\n \"_can_read\": true,\n \"created_at\": \"Wed Jan 04 17:33:13 UTC 2017\",\n \"created_by\": 25206,\n \"created_by_user[login_name]\": \"jamie.lowe@workbooks.com\",\n \"created_by_user[person_name]\": \"Jamie Lowe\",\n \"created_through\": \"Workbooks\",\n \"created_through_reference\": \"\",\n \"id\": 117662,\n \"imported\": false,\n \"key\": \"notifications\",\n \"key10\": \"\",\n \"key11\": \"\",\n \"key12\": \"\",\n \"key13\": \"\",\n \"key14\": \"\",\n \"key15\": \"\",\n \"key16\": \"\",\n \"key17\": \"\",\n \"key18\": \"\",\n \"key19\": \"\",\n \"key2\": \"292801\",\n \"key3\": \"47930\",\n \"key4\": \"CASE-32109\",\n \"key5\": \"\",\n \"key6\": \"\",\n \"key7\": \"\",\n \"key8\": \"\",\n \"key9\": \"\",\n \"lock_version\": 0,\n \"owner[login_name]\": \"jamie.lowe@workbooks.com\",\n \"owner[person_name]\": \"Jamie Lowe\",\n \"owner_id\": 25206,\n \"type\": \"Private::Automation::ApiData\",\n \"updated_at\": \"Wed Jan 04 17:33:13 UTC 2017\",\n \"updated_by\": 25206,\n \"updated_by_user[login_name]\": \"xxxx@workbooks.com\",\n \"updated_by_user[person_name]\": \"Jamie Lowe\",\n \"value\": \"\"\n },\n {\n \"_can_chaccess\": true,\n \"_can_chown\": true,\n \"_can_delete\": true,\n \"_can_modify\": true,\n \"_can_read\": true,\n \"created_at\": \"Wed Jan 04 17:23:21 UTC 2017\",\n \"created_by\": 25206,\n \"created_by_user[login_name]\": \"jamie.lowe@workbooks.com\",\n \"created_by_user[person_name]\": \"Jamie Lowe\",\n \"created_through\": \"Workbooks\",\n \"created_through_reference\": \"\",\n \"id\": 117660,\n \"imported\": false,\n \"key\": \"notifications\",\n \"key10\": \"\",\n \"key11\": \"\",\n \"key12\": \"\",\n \"key13\": \"\",\n \"key14\": \"\",\n \"key15\": \"\",\n \"key16\": \"\",\n \"key17\": \"\",\n \"key18\": \"\",\n \"key19\": \"\",\n \"key2\": \"292801\",\n \"key3\": \"47930\",\n \"key4\": \"CASE-32106\",\n \"key5\": \"\",\n \"key6\": \"\",\n \"key7\": \"\",\n \"key8\": \"\",\n \"key9\": \"\",\n \"lock_version\": 2,\n \"owner[login_name]\": \"jamie.lowe@workbooks.com\",\n \"owner[person_name]\": \"Jamie Lowe\",\n \"owner_id\": 25206,\n \"type\": \"Private::Automation::ApiData\",\n \"updated_at\": \"Wed Jan 04 17:30:39 UTC 2017\",\n \"updated_by\": 25206,\n \"updated_by_user[login_name]\": \"xxxx@workbooks.com\",\n \"updated_by_user[person_name]\": \"Jamie Lowe\",\n \"value\": \"\"\n }\n ],\n 2\n]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBasically I'm trying to get the number 2 on the end of the array right before the closing ] - How do I do that?\u003c/p\u003e\n\n\u003cp\u003eEDIT: FULL CODE EXAMPLE\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar notif_count = data[1]; \u0026lt;!-- Last element in the array which is the count of notifications calculated server side by PHP --\u0026gt; \n console.log(notif_count); \n $('#count').text(notif_count);\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"10","creation_date":"2017-01-04 18:46:44.397 UTC","last_activity_date":"2017-01-04 19:48:04.773 UTC","last_edit_date":"2017-01-04 19:48:04.773 UTC","last_editor_display_name":"","last_editor_user_id":"4520420","owner_display_name":"","owner_user_id":"4541849","post_type_id":"1","score":"-5","tags":"javascript|arrays|multidimensional-array|pop","view_count":"291"} +{"id":"44557140","title":"Running 32 bit XAMPP on 64 bit machine - Tomcat hangs up?","body":"\u003cp\u003eI get that I should be able to run the 32 bit XXAMP on my 64 bit machine; but I'm pretty sure that other Java stuff running with Windows 10 apps is causing Tomcat to hang up when trying to start. If I'm only running this to locally test website edits, is this an issue or can I simply leave Tomcat turned off? Will javascript fail then? Or will the browsers use the 64bit Win 10 stuff? I think I don't adequately understand this.\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-06-15 01:29:40.933 UTC","last_activity_date":"2017-06-15 01:29:40.933 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4179773","post_type_id":"1","score":"0","tags":"tomcat|xampp|windows-10|64bit","view_count":"17"} +{"id":"4637811","title":"How to use namespace across several files","body":"\u003cp\u003eI notice that C++'s \u003ccode\u003estd\u003c/code\u003e namespace is spread across several files (like in \u003ccode\u003evector\u003c/code\u003e, \u003ccode\u003estring\u003c/code\u003e, \u003ccode\u003eiostream\u003c/code\u003e, etc.). How can I accomplish the same thing in my programs? Do I simply declare the same namespace in each individual header file, so that it's something like:\u003c/p\u003e\n\n\u003cp\u003ea.h\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enamespace something\n{\nclass A {};\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003c/p\u003e\n\n\u003cp\u003eb.h\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \"a.h\"\n\nnamespace something\n{\nclass B : public A {};\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd then in, say, \u003ccode\u003emain.cpp\u003c/code\u003e, I would just include \"b.h\" and \"a.h\" and then \u003ccode\u003eusing namespace something;\u003c/code\u003e to use the two classes?\u003c/p\u003e","accepted_answer_id":"4637816","answer_count":"1","comment_count":"2","creation_date":"2011-01-09 05:15:29.033 UTC","favorite_count":"0","last_activity_date":"2016-02-05 20:51:56.183 UTC","last_edit_date":"2016-02-05 20:51:56.183 UTC","last_editor_display_name":"","last_editor_user_id":"65863","owner_display_name":"","owner_user_id":"257583","post_type_id":"1","score":"16","tags":"c++|namespaces|header-files","view_count":"7661"} +{"id":"24693276","title":"Calling an object of template class","body":"\u003cp\u003eI \u003ca href=\"http://shiftedbits.org/2011/01/30/cubic-spline-interpolation/\" rel=\"nofollow\"\u003efound this code online\u003c/a\u003e, it implements the Cubic Spline Interpolation:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;vector\u0026gt;\n#include \u0026lt;iostream\u0026gt;\n\nusing namespace std;\n\n/** Templated on type of X, Y. X and Y must have operator +, -, *, /. Y must have defined\n* a constructor that takes a scalar. */\ntemplate \u0026lt;typename X, typename Y\u0026gt;\nclass Spline \n{\npublic:\n /** An empty, invalid spline */\n Spline() {}\n\n /** A spline with x and y values */\n Spline(const vector\u0026lt;X\u0026gt;\u0026amp; x, const vector\u0026lt;Y\u0026gt;\u0026amp; y) \n {\n if (x.size() != y.size()) {cerr \u0026lt;\u0026lt; \"X and Y must be the same size \" \u0026lt;\u0026lt; endl; return;}\n if (x.size() \u0026lt; 3) { cerr \u0026lt;\u0026lt; \"Must have at least three points for interpolation\" \u0026lt;\u0026lt; endl; return;}\n\n typedef typename vector\u0026lt;X\u0026gt;::difference_type size_type;\n\n size_type n = y.size() - 1;\n\n vector\u0026lt;Y\u0026gt; b(n), d(n), a(n), c(n + 1), l(n + 1), u(n + 1), z(n + 1);\n vector\u0026lt;X\u0026gt; h(n + 1);\n\n l[0] = Y(1);\n u[0] = Y(0);\n z[0] = Y(0);\n h[0] = x[1] - x[0];\n\n for (size_type i = 1; i \u0026lt; n; i++)\n {\n h[i] = x[i + 1] - x[i];\n l[i] = Y(2 * (x[i + 1] - x[i - 1])) - Y(h[i - 1]) * u[i - 1];\n u[i] = Y(h[i]) / l[i];\n a[i] = (Y(3) / Y(h[i])) * (y[i + 1] - y[i]) - (Y(3) / Y(h[i - 1])) * (y[i] - y[i - 1]);\n z[i] = (a[i] - Y(h[i - 1]) * z[i - 1]) / l[i];\n }\n\n l[n] = Y(1);\n z[n] = c[n] = Y(0);\n\n for (size_type j = n - 1; j \u0026gt;= 0; j--) \n {\n c[j] = z[j] - u[j] * c[j + 1];\n b[j] = (y[j + 1] - y[j]) / Y(h[j]) - (Y(h[j]) * (c[j + 1] + Y(2) * c[j])) / Y(3);\n d[j] = (c[j + 1] - c[j]) / Y(3 * h[j]);\n }\n\n for (size_type i = 0; i \u0026lt; n; i++)\n {\n mElements.push_back(Element(x[i], y[i], b[i], c[i], d[i]));\n }\n }\n virtual ~Spline() {}\n\n Y operator[](const X\u0026amp; x) const {return interpolate(x);}\n\n Y interpolate(const X\u0026amp;x) const \n {\n if (mElements.size() == 0) return Y();\n\n typename std::vector\u0026lt;element_type\u0026gt;::const_iterator it;\n it = lower_bound(mElements.begin(), mElements.end(), element_type(x));\n if (it != mElements.begin()) {it--;}\n\n return it-\u0026gt;eval(x);\n }\n\n vector\u0026lt;Y\u0026gt; operator[](const vector\u0026lt;X\u0026gt;\u0026amp; xx) const {return interpolate(xx);}\n\n /* Evaluate at multiple locations, assuming xx is sorted ascending */\n vector\u0026lt;Y\u0026gt; interpolate(const vector\u0026lt;X\u0026gt;\u0026amp; xx) const {\n if (mElements.size() == 0) return vector\u0026lt;Y\u0026gt;(xx.size());\n\n typename vector\u0026lt;X\u0026gt;::const_iterator it;\n typename vector\u0026lt;element_type\u0026gt;::const_iterator it2;\n it2 = mElements.begin();\n vector\u0026lt;Y\u0026gt; ys;\n for (it = xx.begin(); it != xx.end(); it++) \n {\n it2 = lower_bound(it2, mElements.end(), element_type(*it));\n if (it2 != mElements.begin()) {it2--;}\n\n ys.push_back(it2-\u0026gt;eval(*it));\n }\n\n return ys;\n }\n\nprotected:\n\n class Element {\n public:\n Element(X _x) : x(_x) {}\n Element(X _x, Y _a, Y _b, Y _c, Y _d)\n : x(_x), a(_a), b(_b), c(_c), d(_d) {}\n\n Y eval(const X\u0026amp; xx) const \n {\n X xix(xx - x);\n return a + b * xix + c * (xix * xix) + d * (xix * xix * xix);\n }\n\n bool operator\u0026lt;(const Element\u0026amp; e) const {return x \u0026lt; e.x;}\n bool operator\u0026lt;(const X\u0026amp; xx) const {return x \u0026lt; xx;}\n\n X x;\n Y a, b, c, d;\n };\n\n typedef Element element_type;\n vector\u0026lt;element_type\u0026gt; mElements;\n};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am calling it like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSpline\u0026lt;VecDoub, VecDoub\u0026gt; MySpline(VecDoub(t), VecDoub(x));\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut although the program compiles without errors, the function isn't called at all. What's wrong? I am not an expert in OO C++... \u003c/p\u003e","answer_count":"3","comment_count":"4","creation_date":"2014-07-11 08:26:51.087 UTC","favorite_count":"1","last_activity_date":"2014-07-11 08:48:25.4 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2171835","post_type_id":"1","score":"-2","tags":"c++|templates","view_count":"116"} +{"id":"7036603","title":"Does tablesorter have a onsort event?","body":"\u003cp\u003eI've just downloaded tablesorter and got it up and running.\u003c/p\u003e\n\n\u003cp\u003eI need some code to run each time the user sorts the table, and I cant find anything in the documentation :-(\u003c/p\u003e\n\n\u003cp\u003eSo if anyone know that would be great, thanks!\u003c/p\u003e\n\n\u003cp\u003eIs there a event that is triggered each time i sort a column? I need to be the event AFTER the sorting is done\u003c/p\u003e","accepted_answer_id":"7036718","answer_count":"1","comment_count":"0","creation_date":"2011-08-12 06:56:35.737 UTC","favorite_count":"1","last_activity_date":"2014-11-18 17:53:08.617 UTC","last_edit_date":"2011-08-12 07:07:15.683 UTC","last_editor_display_name":"","last_editor_user_id":"286289","owner_display_name":"","owner_user_id":"286289","post_type_id":"1","score":"6","tags":"javascript|jquery|tablesorter","view_count":"4627"} +{"id":"11017901","title":"How can I reduce the size of Google closure library for deployment?","body":"\u003cp\u003eThe Google closure library is huge, how can I reduce size of it to deploy it with my project?\nIt contains lots JavaScript files and whole bunch of resources, in total 14mb, would be nice to know what can I do to optimize it.\u003c/p\u003e","accepted_answer_id":"11017968","answer_count":"2","comment_count":"0","creation_date":"2012-06-13 15:07:42.503 UTC","last_activity_date":"2012-06-14 04:45:33.697 UTC","last_edit_date":"2012-06-13 15:09:43.34 UTC","last_editor_display_name":"","last_editor_user_id":"811001","owner_display_name":"","owner_user_id":"257031","post_type_id":"1","score":"1","tags":"javascript|google-closure","view_count":"267"} +{"id":"41338549","title":"SDL2 Can't create window since it couldn't find matching GLX visual","body":"\u003cp\u003eI have a problem as i am currently running Ubuntu Terminal on Windows 10. I also have XMing installed as my X-server(I use XMing for qemu,etc...). And i am trying to run this SDL2 Program. So i have this for main.cpp:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;stdio.h\u0026gt; \n#include \u0026lt;stdlib.h\u0026gt; \n#include \u0026lt;unistd.h\u0026gt; \n\n#include \u0026lt;SDL2/SDL.h\u0026gt; \n#include \u0026lt;GL/gl.h\u0026gt; \n\nint main(int argc, char *argv[]) \n{ \n int final_status = 1; \n SDL_Window *window; \n SDL_GLContext openGL_context; \n\n if (SDL_Init(SDL_INIT_VIDEO)) { \n fprintf(stderr, \"Unable to initialize SDL: %s\\n\", \n SDL_GetError()); \n return 1; \n } \n window = SDL_CreateWindow(\"My Demo\", SDL_WINDOWPOS_CENTERED, \n SDL_WINDOWPOS_CENTERED, 640, 480, \n SDL_WINDOW_OPENGL); \n if (!window) { \n fprintf(stderr, \"Can't create window: %s\\n\", SDL_GetError()); \n goto finished; \n } \n\n openGL_context = SDL_GL_CreateContext(window); \n if (!openGL_context) { \n fprintf(stderr, \"Can't create openGL context: %s\\n\", \n SDL_GetError()); \n goto close_window; \n } \n\n /* drawing code removed */ \n\n final_status = 0; \n SDL_GL_DeleteContext(openGL_context); \nclose_window: \n SDL_DestroyWindow(window); \nfinished: \n SDL_Quit(); \n fprintf(stdout, \"done\\n\"); \n fflush(stdout); \n return final_status; \n} \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd then when i run \u003ccode\u003eg++ main.cpp -lSDL2\u003c/code\u003e , i get this output:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCan't create window: Couldn't find matching GLX visual\ndone\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have tried to search how to solve this GLX Problem but can't seem to find a solution for it. Help would be greatly appreciated!\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2016-12-27 03:09:45.287 UTC","last_activity_date":"2017-03-12 01:24:36.1 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5768335","post_type_id":"1","score":"4","tags":"c++|sdl-2|windows-subsystem-for-linux|glx","view_count":"1035"} +{"id":"34669363","title":"Div background image not showing in heroku. However, the logo shows","body":"\u003cp\u003eI tried changing the image tag, no luck with that. I reviewed other post here and tried those solutions none work. I also use amazon cloudfront. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div id=\"signup\" class=\"container-fluid\"\u0026gt;\n\u0026lt;/div\u0026gt;\n\n#signup{\ntext-align: center;\nbackground-image: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.4)),\nurl(\"zoom1028.jpg\");\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"4","comment_count":"0","creation_date":"2016-01-08 04:11:37.383 UTC","last_activity_date":"2016-01-08 20:15:42.09 UTC","last_edit_date":"2016-01-08 15:09:56.623 UTC","last_editor_display_name":"","last_editor_user_id":"3905353","owner_display_name":"","owner_user_id":"3905353","post_type_id":"1","score":"0","tags":"css","view_count":"75"} +{"id":"25521801","title":"How to change the font of a label in delphi xe5 Firemonkey","body":"\u003cp\u003ei have a procedure intended to prepare a form with a couple of labels and dropdowns. But i cannot change the font color of the label. Can anybody please assist?\u003c/p\u003e\n\n\u003cp\u003eI have found a link that says they found the answer, but i cannot make sense of it.\n\u003ca href=\"https://stackoverflow.com/questions/13884089/how-to-programmatically-alter-font-properties-in-firemonkey-controls\"\u003eHow to programmatically alter Font properties in Firemonkey controls\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eBelow is the code for the unit trying to execute the change.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eunit procedures;\n\ninterface\n\nUses\n System.SysUtils, System.Types, System.UITypes, System.Classes,\n System.Variants, fmx.controls;\n\nProcedure resetproductlists;\n\nimplementation\n\nuses main_unit, datalive_unit, AddUniqueItemToComboBox;\n\nProcedure resetproductlists;\nbegin\n With Datalive.products Do\n Begin\n Try\n active := False;\n params.clear;\n sql.text := 'select supplier,item,width,height from products';\n active := True;\n Main.Combobox1.clear;\n Main.Combobox2.clear;\n Main.Combobox3.clear;\n Main.Combobox4.clear;\n Main.Edit1.text := '';\n Main.Edit2.text := '';\n Main.SpinBox1.Value := 0;\n Main.label13.text := 'n/a';\n Main.label13.StyledSettings := Main.label13.StyledSettings -\n [TStyledSetting.ssFontColor];\n Main.label13.FontColor := TAlphaColors.Aqua;\n Main.label14.text := 'R 0.00';\n Main.label14.FontColor := clBlack;\n while not eof do\n Begin\n try\n addtocombo(Main.Combobox1, Fieldbyname('supplier').Asstring);\n addtocombo(Main.Combobox2, Fieldbyname('item').Asstring);\n addtocombo(Main.Combobox3, Fieldbyname('width').Asstring);\n addtocombo(Main.Combobox4, Fieldbyname('height').Asstring);\n finally\n next;\n end;\n End;\n Finally\n active := False;\n End;\n End;\nend;\n\nend.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethe \u003ccode\u003eaddtocombo\u003c/code\u003e procedure only inserts the text into the combobox (if it is not already found in it.).\u003c/p\u003e\n\n\u003cp\u003eAny assistance would be great. Thank you\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2014-08-27 07:57:09.617 UTC","last_activity_date":"2014-08-28 07:41:16.71 UTC","last_edit_date":"2017-05-23 12:14:06.363 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"3891575","post_type_id":"1","score":"0","tags":"android|delphi|firemonkey","view_count":"2635"} +{"id":"19913000","title":"Frustration with emberjs data transfering with its backend method as PHP","body":"\u003cp\u003eI tried to do these three simple things but I can not in a world to figure out in almost ONE MONTH already, one word---FRUSTRATION! Now I doubt if emberjs is really worth it...\u003c/p\u003e\n\n\u003cp\u003eI want to:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003e\u003cp\u003eGet data from database with just a .php file and data will be in json format \u003c/p\u003e\n\n\u003cp\u003eNOTE: I did this, \u003ca href=\"https://stackoverflow.com/questions/19791068/return-jason-data-from-php-for-emberjs-in-the-right-format-with-getjson\"\u003ein other SO question I asked\u003c/a\u003e, so I will not repeat.\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eNow, the problem, how can I save those data in a \"store\" without ember data?\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eIs there any available tutorial on how php can connect with emberjs? I tried to read about its REST adapter, but seem it needs some type of JSON API. Do I need to develop a JSON API if I use pure PHP code as back end?\u003c/p\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eIf anything part is not clear, please reply in comment! Thanks a lot.\u003c/p\u003e","accepted_answer_id":"19914056","answer_count":"2","comment_count":"3","creation_date":"2013-11-11 18:12:19.81 UTC","last_activity_date":"2014-03-05 15:09:29.033 UTC","last_edit_date":"2017-05-23 12:06:22.393 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"2646226","post_type_id":"1","score":"2","tags":"php|jquery|json|ember.js|ember-data","view_count":"1213"} +{"id":"39867393","title":"Where to put third party JavaScript in my html document?","body":"\u003cp\u003e\u003ca href=\"https://css-tricks.com/async-attribute-scripts-bottom/\" rel=\"nofollow\"\u003eUseful Article\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI read this article which suggest putting external javascript in the head section of html.\u003c/p\u003e\n\n\u003cp\u003eI am still confused if i have external async javascript, what is the best place to put it in my html? head, end of body or exactly where?\u003c/p\u003e\n\n\u003cp\u003eIt would be great if someone can suggest me best place along with the reason.\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2016-10-05 07:02:14.967 UTC","last_activity_date":"2016-10-05 07:48:46.22 UTC","last_edit_date":"2016-10-05 07:48:46.22 UTC","last_editor_display_name":"","last_editor_user_id":"6249864","owner_display_name":"","owner_user_id":"5285062","post_type_id":"1","score":"0","tags":"javascript|asynchronous","view_count":"28"} +{"id":"12821609","title":"Make ASP.Net (C#) Web App Available Offline","body":"\u003cp\u003eI have been tasked with making my company's Web App available offline. Before I move to the actual development phase, I want to be sure that my current strategy will not turn out to be a bust. \u003c/p\u003e\n\n\u003cp\u003eI first thought about using html5 app cache but after doing some tests I found that it seems to not cache the server side operations but the actual html that is rendered (Please correct me if I'm wrong). This will not work because the rendered html depends upon who is currently logged in. From my tests, it always rendered the html as if the last person that logged in (online) is logging in.\u003c/p\u003e\n\n\u003cp\u003eMy current strategy is this:\nI cache only the login page and an offline (.html) page to correspond to each aspx page that will need to be available offline. Every successful login (online) results in creating or updating Web SQL Database or IndexDB (depending on browser) with all data needed for that person to operate offline including a table that will be used for login credentials. In this way the only requirement for logging in offline is logging in with your login credentials at least one time.\u003c/p\u003e\n\n\u003cp\u003eMy concern is that I am overcomplicating it. In order to make this work, I will need to create an html page for each current page (a lot of pages) and I will have to rewrite everything that is currently being done on the server in JavaScript including validation, database calls, populating controls such as dropdown lists and data grids, etc. Also everything that I change in the future will require a subsequent offline change.\u003c/p\u003e\n\n\u003cp\u003eIs there an established best practice for what I am trying to do that I am overlooking or am I venturing into new ground?\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2012-10-10 14:19:05.043 UTC","favorite_count":"3","last_activity_date":"2012-10-15 09:25:56.613 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1569817","post_type_id":"1","score":"6","tags":"asp.net|html5|web-applications|html5-appcache|offline-web-app","view_count":"2835"} +{"id":"17163652","title":"MasterPages and relative url issue","body":"\u003cp\u003eI have a masterpage on which I have included a search bar. i retrieve the record with the ajax method. the problem now is that when I navigate accross the pages the context of the relative path changes. because some pages are in different folders. I have used this url\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e url: \"WebServiceSearchUsers.asmx/SearchUser\",\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut this is not suitable method. Now how to write this code to fix the relative path issue. I don't want to use absolute path.\u003c/p\u003e","accepted_answer_id":"17163788","answer_count":"1","comment_count":"0","creation_date":"2013-06-18 08:07:41.72 UTC","last_activity_date":"2013-06-18 08:15:58.26 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2277002","post_type_id":"1","score":"0","tags":"asp.net|url|navigation|master-pages","view_count":"40"} +{"id":"8251237","title":"How do I create a canvas element in Dart?","body":"\u003cp\u003eI want to create a canvas element that I can add to an html document. The Dart recommendations seem to be to use \u003ccode\u003edart:html\u003c/code\u003e rather then \u003ccode\u003edart:dom\u003c/code\u003e, but as far as I can see, \u003ccode\u003edart:html\u003c/code\u003e only contains an interface definition for a \u003ccode\u003eCanvasElement\u003c/code\u003e interface, not a class.\u003c/p\u003e\n\n\u003cp\u003eHow do I instantiate a canvas object?\u003c/p\u003e","accepted_answer_id":"8251570","answer_count":"2","comment_count":"0","creation_date":"2011-11-24 01:25:33.88 UTC","last_activity_date":"2011-12-10 04:05:23.877 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"41742","post_type_id":"1","score":"11","tags":"html|canvas|dart","view_count":"1904"} +{"id":"22033664","title":"how to dynamically add labels to my checklist in jquery","body":"\u003cp\u003eI want to populate my checklist from an array dynamically. How should I populate the values and labels for this checklist using jquery/javascript? \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"container\" id=\"check\"\u0026gt;\n \u0026lt;input type=\"checkbox\" value= array[0]/\u0026gt; \u0026lt;label\u0026gt;\u0026lt;/label\u0026gt;\n \u0026lt;input type=\"checkbox\" value= array[1]/\u0026gt; \u0026lt;label\u0026gt;\u0026lt;/label\u0026gt;\n \u0026lt;input type=\"checkbox\" value= array[2]/\u0026gt; \u0026lt;label\u0026gt;\u0026lt;/label\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow to populate the label tag with the elements of the array?\u003c/p\u003e","accepted_answer_id":"22033808","answer_count":"2","comment_count":"2","creation_date":"2014-02-26 06:37:05.11 UTC","last_activity_date":"2014-02-26 06:46:05.2 UTC","last_edit_date":"2014-02-26 06:42:14.913 UTC","last_editor_display_name":"","last_editor_user_id":"2307753","owner_display_name":"","owner_user_id":"1694364","post_type_id":"1","score":"0","tags":"javascript|jquery|html|dynamic|checkboxlist","view_count":"370"} +{"id":"27662542","title":"Instantiating various inherited classes through one method, without reflection","body":"\u003cp\u003eIn a project I'm working on, I have a set of blocks that make up a 3D voxel based environment (like Minecraft). These worlds are stored in an external data file.\u003c/p\u003e\n\n\u003cp\u003eThis file contains the data for:\nEach block,\nits location,\nand its type.\u003c/p\u003e\n\n\u003cp\u003eWhen the LoadLevel method is called, I want it to iterate over the data for every block in the file, creating a new instance of the Block object for every one. It's no problem to pass things like location. It's as simple as\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCreateBlock(Vector3 position)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe issue is with the type. All types are child classes (think Abstract Block, and then subtypes like GrassBlock or WaterBlock that inherit the abstract Block's properties.) Assuming there's a child class like \"GrassBlock\" that I want to be created, rather than a generic block, how do I make it do this through the method? The only way I know of is through reflection, which I've been advised to stay away from. Is it possible that I can do this through generic typing or something?\u003c/p\u003e\n\n\u003cp\u003eThis seems like such an important question in game design, but no one I've asked seems to have any idea. Any help?\u003c/p\u003e","accepted_answer_id":"27662594","answer_count":"4","comment_count":"3","creation_date":"2014-12-26 22:19:21.39 UTC","last_activity_date":"2014-12-26 23:29:53.62 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3097154","post_type_id":"1","score":"0","tags":"c#|reflection|polymorphism|abstract-class","view_count":"93"} +{"id":"44970316","title":"Wrap code to a usable method in Android","body":"\u003cp\u003eam trying to create a clickable text amidst so block of text, i was lucky to find out the code on stackoverflow that works for me, but the issue is that have many other text where i want to apply the clicking. my question now is that if it's possible to bundle the below code in a reuse-able method that i can call and pass the needed parameters and how\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSpannableString ss = new SpannableString(\"Android is a Software stack\");\n ClickableSpan clickableSpan = new ClickableSpan() {\n @Override\n public void onClick(View textView) {\n startActivity(new Intent(MainActivity.this, NextActivity.class));\n }\n @Override\n public void updateDrawState(TextPaint ds) {\n super.updateDrawState(ds);\n ds.setUnderlineText(false);\n }\n };\n ss.setSpan(clickableSpan, 10, 27, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);\n ss.setSpan(new StyleSpan(Typeface.ITALIC), 10, 27, 0);\n\n TextView textView = (TextView) findViewById(R.id.hello);\n textView.setText(ss);\n textView.setMovementMethod(LinkMovementMethod.getInstance());\n textView.setHighlightColor(Color.TRANSPARENT);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBelow is what i have resolve to use, any suggestion on how to make it better?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e TextView textView = (TextView) findViewById(R.id.one) ;\n String s=\"This link has many clickable text which are link one, link two \n and the last whick is link three\";\n SpannableString ss = new SpannableString(s);\n String one =\"link one\";\n String two =\"link two\";\n String three =\"link three\";\n int firstIndex = s.indexOf(one);\n int secondIndex = s.indexOf(two);\n int thirdIndex = s.indexOf(three);\n\n ClickableSpan firstClick = new ClickableSpan() {\n @Override\n public void onClick(View widget) {\n startActivity(new Intent(MainActivity.this, a.class));\n }\n @Override\n public void updateDrawState(TextPaint ds) {\n super.updateDrawState(ds);\n ds.setUnderlineText(false);\n }\n };\n ClickableSpan secondClick = new ClickableSpan() {\n @Override\n public void onClick(View widget) {\n startActivity(new Intent(MainActivity.this, b.class));\n }\n @Override\n public void updateDrawState(TextPaint ds) {\n super.updateDrawState(ds);\n ds.setUnderlineText(false);\n }\n };\n ClickableSpan thirdClick = new ClickableSpan() {\n @Override\n public void onClick(View widget) {\n startActivity(new Intent(MainActivity.this, c.class));\n }\n @Override\n public void updateDrawState(TextPaint ds) {\n super.updateDrawState(ds);\n ds.setUnderlineText(false);\n }\n };\n ss.setSpan(firstClick,firstIndex, firstIndex+one.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);\n ss.setSpan(secondClick,secondIndex, secondIndex+two.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);\n ss.setSpan(thirdClick,thirdIndex, thirdIndex+three.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);\n textView.setLinksClickable(true);\n textView.setMovementMethod(LinkMovementMethod.getInstance());\n textView.setText(ss, TextView.BufferType.SPANNABLE);\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"44970697","answer_count":"1","comment_count":"4","creation_date":"2017-07-07 12:03:19.763 UTC","last_activity_date":"2017-07-10 11:05:51.987 UTC","last_edit_date":"2017-07-10 11:05:51.987 UTC","last_editor_display_name":"","last_editor_user_id":"2778015","owner_display_name":"","owner_user_id":"2778015","post_type_id":"1","score":"-2","tags":"java|android","view_count":"63"} +{"id":"40364504","title":"How to make a Chrome Extension Sticky?","body":"\u003cp\u003eI have created a chrome extension which is an extension for a chat room. I need it to be sticked on the screen like this \u003ca href=\"https://chrome.google.com/webstore/detail/sticky-notes/nbjdhgkkhefpifbifjiflpaajchdkhpg\" rel=\"nofollow noreferrer\"\u003esticky note chrome extension\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eHere's how it looks:\n\u003ca href=\"https://i.stack.imgur.com/bfZVQ.png\" rel=\"nofollow noreferrer\"\u003eclick here for the image\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI am using the following code in the popup.html file:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;!doctype html\u0026gt;\n\u0026lt;html\u0026gt;\n \u0026lt;head\u0026gt;\n \u0026lt;meta charset=\"utf-8\"\u0026gt;\n \u0026lt;title\u0026gt;Chat Adda\u0026lt;/title\u0026gt;\n \u0026lt;style\u0026gt;\n body{}\n .resize{min-width:640px; min-height:480px; resize:both; overflow: auto;}\n .row{background-color:#5cbf2a;text-align:center;padding:5px 10px 5px 10px;}\n \u0026lt;/style\u0026gt;\n \u0026lt;/head\u0026gt;\n \u0026lt;body\u0026gt;\n \u0026lt;div class=\"resize\"\u0026gt;\n \u0026lt;iframe id=\"theFrame\" src=\"http://chatadda.com\" style=\"width:100%;height:100%;\" frameborder=\"0\"\u0026gt;\u0026lt;/iframe\u0026gt;\n \u0026lt;div class=\"row\"\u0026gt;\n \u0026lt;span\u0026gt;\u0026lt;a href=\"http://chatadda.com\" target=\"_blank\"\u0026gt;\u0026lt;img src=\"/open.png\" width=\"32px\" height=\"32px\"/\u0026gt;\u0026lt;/a\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;span\u0026gt;\u0026lt;a href=\"https://play.google.com/store/apps/details?id=com.chatadda.android\u0026amp;hl=en\" target=\"_blank\"\u0026gt;\u0026lt;img src=\"/android.png\" width=\"32px\" height=\"32px\"/\u0026gt;\u0026lt;/a\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;span\u0026gt;\u0026lt;a href=\"https://www.facebook.com/sharer/sharer.php?u=http%3A//chatadda.com/\" target=\"_blank\"\u0026gt;\u0026lt;img src=\"/facebook.png\" width=\"32px\" height=\"32px\"/\u0026gt;\u0026lt;/a\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;span\u0026gt;\u0026lt;a href=\"https://twitter.com/home?status=ChatAdda.com%20-%20Chat,%20flirt,%20date%20and%20make%20new%20friends.%20Chat%20with%20strangers%20in%20private%20chat%20rooms.%20It's%20fast,%20secure%20and%20free.\" target=\"_blank\"\u0026gt;\u0026lt;img src=\"/twitter.png\" width=\"32px\" height=\"32px\"/\u0026gt;\u0026lt;/a\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;span\u0026gt;\u0026lt;a href=\"https://plus.google.com/share?url=http%3A//chatadda.com/\" target=\"_blank\"\u0026gt;\u0026lt;img src=\"/google.png\" width=\"32px\" height=\"32px\"/\u0026gt;\u0026lt;/a\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow do I do it?\u003c/p\u003e","accepted_answer_id":"40365247","answer_count":"2","comment_count":"1","creation_date":"2016-11-01 16:39:03.413 UTC","favorite_count":"1","last_activity_date":"2016-11-01 17:25:46.123 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7100486","post_type_id":"1","score":"1","tags":"javascript|html|css|google-chrome|google-chrome-extension","view_count":"129"} +{"id":"2768232","title":"SQL Server union selects built dynamically from list of words","body":"\u003cp\u003eI need to count occurrence of a list of words across all records in a given table. If I only had 1 word, I could do this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eselect count(id) as NumRecs where essay like '%word%'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut my list could be hundreds or thousands of words, and I don't want to create hundreds or thousands of sql requests serially; that seems silly. I had a thought that I might be able to create a stored procedure that would accept a comma-delimited list of words, and for each word, it would run the above query, and then union them all together, and return one huge dataset. (Sounds reasonable, right? But I'm not sure where to start with that approach...)\u003c/p\u003e\n\n\u003cp\u003eShort of some weird thing with union, I might try to do something with a temp table -- inserting a row for each word and record count, and then returning \u003ccode\u003eselect *\u003c/code\u003e from that temp table.\u003c/p\u003e\n\n\u003cp\u003eIf it's possible with a union, how? And does one approach have advantages (performance or otherwise) over the other?\u003c/p\u003e","accepted_answer_id":"2768254","answer_count":"2","comment_count":"0","creation_date":"2010-05-04 19:08:27.903 UTC","last_activity_date":"2010-05-04 20:45:55.95 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"751","post_type_id":"1","score":"1","tags":"sql|sql-server|sql-server-2005","view_count":"340"} +{"id":"43997714","title":"SQL sum then find max","body":"\u003cp\u003eHere's \u003ca href=\"https://i.stack.imgur.com/ag2nY.png\" rel=\"nofollow noreferrer\"\u003ewhat I'm trying to achieve\u003c/a\u003e. Basically I have a relation in which I have a count for each ID and month. I'd like to sum the counts for each id by month (middle table in the picture) and then from that find the maximum value from all those sums by month, and show the month, id, and the maximum value in that order. Here's what I've got so far:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT month, MAX(summed_counts) AS maximum_result\nFROM\n (SELECT month, id, SUM(counts) AS summed_counts\n FROM info WHERE year=2017 GROUP BY month, id)\nAS final_result GROUP BY month ORDER BY month ASC;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever as soon as I add \u003ccode\u003eid\u003c/code\u003e it no longer works:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT month, id, MAX(summed_counts) AS maximum_result\nFROM\n (SELECT month, id, SUM(counts) AS summed_counts\n FROM info WHERE year=2017 GROUP BY month, id)\nAS final_result GROUP BY month, id ORDER BY month ASC;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny suggestions?\u003c/p\u003e","answer_count":"1","comment_count":"16","creation_date":"2017-05-16 09:37:11.113 UTC","last_activity_date":"2017-05-16 19:54:55.173 UTC","last_edit_date":"2017-05-16 11:06:14.857 UTC","last_editor_display_name":"","last_editor_user_id":"330315","owner_display_name":"","owner_user_id":"7847560","post_type_id":"1","score":"1","tags":"sql|derby","view_count":"49"} +{"id":"42406386","title":"Is it too much for react native? List Transition with Z dimension","body":"\u003cp\u003eI wanted to style my application with list transition like on this gif..\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/CKCc2.gif\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/CKCc2.gif\" alt=\"--\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI wrote the code on CSS but the thing is I cannot copy that to React Native because it doesn't support \"translateZ\". So my question is; is it possible to do this on react native? Or is it too much for it?\u003c/p\u003e\n\n\u003cp\u003eI also added example code on CSS/HTML.\u003c/p\u003e\n\n\u003cp\u003e\u003cdiv class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\"\u003e\r\n\u003cdiv class=\"snippet-code\"\u003e\r\n\u003cpre class=\"snippet-code-css lang-css prettyprint-override\"\u003e\u003ccode\u003e#viewport {\r\n background: darkblue;\r\n position:fixed;\r\n -webkit-perspective:100px;\r\n -webkit-perspective-origin:50% 50%;\r\n border: 2px solid black;\r\n height: 300px;\r\n width: 300px;\r\n left:50%;\r\n margin-left:-200px;\r\n }\r\n\r\n.div1, .div2, .div3 {\r\n position:absolute;\r\n width:80px;\r\n height:150px;\r\n left:50%;\r\n top:50%;\r\n margin-left:-40px;\r\n margin-top:-75px;\r\n background: white;\r\n border: 1px solid black;\r\n border-radius: 10px;\r\n}\r\n\r\n.div1 {\r\n transform: translateZ(-20px) translateY(-26px);\r\n opacity: 0.3;\r\n}\r\n\r\n.div2 {\r\n transform: translateZ(-10px) translateY(-13px);\r\n opacity: 0.7;\r\n}\r\n\r\n.div3 {\r\n transform: translateZ(0px) translateY(0);\r\n}\u003c/code\u003e\u003c/pre\u003e\r\n\u003cpre class=\"snippet-code-html lang-html prettyprint-override\"\u003e\u003ccode\u003e\u0026lt;div id=\"viewport\"\u0026gt;\r\n \u0026lt;div class=\"div1\"\u0026gt;.\u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"div2\"\u0026gt;.\u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"div3\"\u0026gt;.\u0026lt;/div\u0026gt;\r\n\u0026lt;/div\u0026gt;\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2017-02-23 03:21:01.407 UTC","favorite_count":"1","last_activity_date":"2017-02-23 03:21:01.407 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2093240","post_type_id":"1","score":"1","tags":"css|reactjs|react-native","view_count":"99"} +{"id":"24937327","title":"Align icons and images to right, textarea to left (twitter-Bootstrap)","body":"\u003cp\u003e\u003cstrong\u003eTL;DR\u003c/strong\u003e : Before you read anything, the desired end-result is illustrated in the image below, otherwise refer to the \u003ca href=\"http://jsfiddle.net/9SZhs/\" rel=\"nofollow noreferrer\"\u003e\u003cstrong\u003eJSFiddle\u003c/strong\u003e\u003c/a\u003e. \u003cstrong\u003ePreferably\u003c/strong\u003e, I would like to only use CSS and not modify the DOM structure.\u003c/p\u003e\n\n\u003cp\u003eThe icons must be aligned completely to the right (hence the \u003ccode\u003e.pull-right\u003c/code\u003e), but the icons must be \u003cstrong\u003estacked vertically\u003c/strong\u003e (Sometimes some icons must not appear, so they are \u003ccode\u003e.hidden\u003c/code\u003e, like the \u003ccode\u003e.fa-undo\u003c/code\u003e icon in the second row).\u003c/p\u003e\n\n\u003cp\u003e\u003cem\u003e(When I say 'the icons' i mean the \u003ccode\u003e\u0026lt;i\u0026gt;\u003c/code\u003e tags and the \u003ccode\u003e\u0026lt;img\u0026gt;\u003c/code\u003e tag)\u003c/em\u003e\u003c/p\u003e\n\n\u003cp\u003eThe icons must not make the textarea go down (no margin on top of the textarea).\u003c/p\u003e\n\n\u003cp\u003eHopefully, the WIDTH of the textarea would be dynamic and not statically put to \u003ccode\u003ewidth: 90%;\u003c/code\u003e for example. It should take as much width as possible, without interfering with the vertical icon stack.\u003c/p\u003e\n\n\u003cp\u003eHere is the end result that I want (in a perfect world this would be done using CSS and the same HTML DOM I provided)\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/ezbZo.png\" alt=\"The layout I want (made in paint)\"\u003e\u003c/p\u003e","accepted_answer_id":"24941700","answer_count":"3","comment_count":"1","creation_date":"2014-07-24 15:01:39.127 UTC","favorite_count":"2","last_activity_date":"2014-07-24 18:49:37.05 UTC","last_edit_date":"2014-07-24 15:34:53.283 UTC","last_editor_display_name":"","last_editor_user_id":"682263","owner_display_name":"","owner_user_id":"682263","post_type_id":"1","score":"1","tags":"html|css|html5|twitter-bootstrap|twitter-bootstrap-3","view_count":"1109"} +{"id":"40214131","title":"how to add autoreload to ptipython?","body":"\u003cp\u003eIn ipython, we could use the following code to enable auto reload feature.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e%load_ext autoreload\n%autoreload 2\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow I am using ptipython, I could just type them every time using ptipython, but is there anything that could be automatically executed? such as .bashrc for bash shell. \u003c/p\u003e\n\n\u003cp\u003eThere is a config.py which will be automatically run. But \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e%load_ext autoreload \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eis not python code, so looks like I can't put them here. Any other solutions to avoid type them manually?\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2016-10-24 08:44:31.347 UTC","last_activity_date":"2016-10-24 13:28:18.867 UTC","last_edit_date":"2016-10-24 13:28:18.867 UTC","last_editor_display_name":"","last_editor_user_id":"434217","owner_display_name":"","owner_user_id":"266185","post_type_id":"1","score":"0","tags":"ipython|prompt-toolkit","view_count":"65"} +{"id":"11883666","title":"Java's split method has leading blank records that I can't suppress","body":"\u003cp\u003eI'm parsing an input file that has multiple keywords preceded by a \u003ccode\u003e+\u003c/code\u003e. The \u003ccode\u003e+\u003c/code\u003e is my delimiter in a \u003ccode\u003esplit\u003c/code\u003e, with individual tokens being written to an array. The resulting array includes a blank record in the \u003ccode\u003e[0]\u003c/code\u003e position. \u003c/p\u003e\n\n\u003cp\u003eI suspect that \u003ccode\u003esplit\u003c/code\u003e is taking the \"nothing\" before the first token and populating \u003ccode\u003eproject[0]\u003c/code\u003e, then moving on to subsequent tokens which all show up as correct.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#split%28java.lang.String%29\" rel=\"nofollow noreferrer\"\u003eDocumentaion\u003c/a\u003e says that this method has a \u003ccode\u003elimit\u003c/code\u003e parameter:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eIf n is zero then the pattern will be applied as many times as\n possible, the array can have any length, and trailing empty strings\n will be discarded.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eand I found \u003ca href=\"https://stackoverflow.com/questions/9389503/how-to-prevent-java-lang-string-split-from-creating-a-leading-empty-string\"\u003ethis post on SO\u003c/a\u003e, but the solution proposed, editing out the leading delimiter (I used a \u003ccode\u003esubstring(1)\u003c/code\u003e to create a temp field) yielded the same blank record for me. \u003c/p\u003e\n\n\u003cp\u003eCode and output appers below. Any tips would be appreciated.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport java.util.regex.*;\nimport java.io.*;\nimport java.nio.file.*;\nimport java.lang.*;\n//\npublic class eadd\n{\n public static void main(String args[])\n {\n String projStrTemp = \"\";\n String projString = \"\";\n String[] project = new String[10];\n int contextSOF = 0;\n int projStringSOF = 0;\n int projStringEOF = 0;\n //\n String inputLine = \"foo foofoo foo foo @bar.com +foofoofoo +foo1 +foo2 +foo3\";\n contextSOF = inputLine.indexOf(\"@\");\n int tempCalc = (inputLine.indexOf(\"+\")) ;\n if (tempCalc == -1) {\n proj StrTemp = \"+Uncategorized\";\n } else {\n projStringSOF = inputLine.indexOf(\"+\",contextSOF);\n projStrTemp = inputLine.trim().substring(projStringSOF).trim();\n }\n project = projStrTemp.split(\"\\\\+\");\n //\n System.out.println(projStrTemp+\"\\n\"+projString);\n for(int j=0;j\u0026lt;project.length;j++) {\n System.out.println(\"Project[\"+j+\"] \"+project[j]);\n }\n }\n\nCONSOLE OUTPUT: \n+foofoofoo +foo1 +foo2 +foo3\n\nProject[0]\nProject[1] foofoofoo\nProject[2] foo1\nProject[3] foo2\nProject[4] foo3\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"11883851","answer_count":"3","comment_count":"0","creation_date":"2012-08-09 12:39:02.39 UTC","last_activity_date":"2012-08-09 12:56:29.55 UTC","last_edit_date":"2017-05-23 12:04:44.383 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"1267125","post_type_id":"1","score":"0","tags":"java|string|parsing|split","view_count":"731"} +{"id":"43884538","title":"C++: Supplying a templated compare function to std::sort","body":"\u003cp\u003eSuppose I want to get std::sort to sort a vector of pointers to int's, based on the value of the int's the pointers point to. Ignore the obvious performance issue there. Simple huh?\nMake a function:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ebool sort_helper(const int *a, const int *b) \n{ \n return *a \u0026lt; *b;\n} \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand supply to the std::sort.\u003c/p\u003e\n\n\u003cp\u003eNow, if we also want to do the same thing with a vector of pointers to large objects. The same thing applies:\nfirst we define a \u003ccode\u003e\u0026lt;\u003c/code\u003e operator in the object, then make a function along the following lines:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ebool sort_helper(const ob_type *a, const ob_type *b) \n{ \n return *a \u0026lt; *b;\n} \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eor whatever, supply that to std::sort.\u003c/p\u003e\n\n\u003cp\u003eNow, and this is where it gets tricky: what if we want to sort a vector of pointers to any type, with any arbitrary compare function (we make the assumption that whatever type we use that function with, will be able to work with it)- supplying a template version of the sort_helper function above is easy:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etemplate \u0026lt;class ob_type\u0026gt;\nbool sort_helper(const ob_type *a, const ob_type *b) \n{ \n return *a \u0026lt; *b;\n} \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, supplying an arbitrary compare function is harder: Something like this-\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etemplate \u0026lt;typename comparison_function, class ob_type\u0026gt;\nbool sort_template_helper(const ob_type *a, const ob_type *b)\n{\n return comparison_function(*a, *b);\n}\n\ntemplate \u0026lt;typename comparison_function, class iterator_type\u0026gt;\nvoid t_sort(const iterator_type \u0026amp;begin, const iterator_type \u0026amp;end, comparison_function compare)\n{\n std::sort(begin, end, sort_template_helper\u0026lt;compare\u0026gt;);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eis what I'd like to do, but doing this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ebool less_than(const int a, const int b) \n{ \n return a \u0026lt; b;\n} \n\nvoid do_stuff()\n{\n t_sort(ipoint_vector.begin(), ipoint_vector.end(), sort_template_helper\u0026lt;less_than\u0026gt;);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eDoesn't work.\nHow can I sort a vector of pointers to a known type, by the value of the objects pointed to, using an arbitrary comparison function, supplied to std::sort? Assume that the test case I am presenting here is an insanely simplified version of the actual scenario, and that there are valid reasons for wanting to do things this way, that would take too long to go into and distract from the problem.\u003c/p\u003e\n\n\u003cp\u003e[EDIT: for various reasons, am looking for a solution that also works in C++03 - Thanks to Nir for his C++14 answer tho']\u003c/p\u003e","accepted_answer_id":"43887075","answer_count":"3","comment_count":"0","creation_date":"2017-05-10 05:55:21.61 UTC","last_activity_date":"2017-05-10 11:25:04.16 UTC","last_edit_date":"2017-05-10 10:47:55.01 UTC","last_editor_display_name":"","last_editor_user_id":"3454889","owner_display_name":"","owner_user_id":"3454889","post_type_id":"1","score":"4","tags":"c++|sorting|pointers|c++03","view_count":"160"} +{"id":"39644208","title":"How can i convert jquery to java script?","body":"\u003cp\u003eI want to use jquery function as js function how can i convert it?\nmy function is:--\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(document).ready(function() {\n $('#Carousel').carousel({\n interval: 5000\n })\n});\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"2","creation_date":"2016-09-22 16:23:54.67 UTC","last_activity_date":"2016-09-22 17:50:51.403 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5942026","post_type_id":"1","score":"-2","tags":"javascript|jquery","view_count":"38"} +{"id":"15867091","title":"Can't pass mysqli object to class in PHP","body":"\u003cp\u003eSo I'm working on a simple user class in php, which has a class variable which contains the mysqli object, however I keep getting the error:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eFatal error: Call to a member function real_escape_string() on a non-object in \u003cem\u003e*\u003c/em\u003e/classes/user.php on line X\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI've checked everything, it should work, but it doesn't. Somehow. This is my code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enamespace bibliotheek;\n\nclass user\n{\n private $mysql;\n\n private $logged_in = false;\n private $user_data = null; //ARRAY: user_id, e-mail, password, bevoegdheid, naam, achternaam, adres, postcode, stad\n\n function __construct(\\mysqli $mysql, $salt)\n {\n $this-\u0026gt;mysql = $mysql;\n }\n\n public function login($email, $pass, $hash = false)\n {\n $email = $this-\u0026gt;mysql-\u0026gt;real_escape_string($email);\n if($hash == false)\n $pass = sha1($this-\u0026gt;salt.$pass);\n\n $query = \"SELECT *\n FROM gebruikers\n WHERE gebruikers.email = '$email' AND gebruikers.password = '$pass'\";\n\n $result = $this-\u0026gt;mysql-\u0026gt;query($query);\n $user_data = $result-\u0026gt;fetch_assoc();\n\n if($user_data == null)\n return;\n\n $this-\u0026gt;logged_in = true;\n $this-\u0026gt;user_data = $user_data;\n $this-\u0026gt;create_cookies($email, $pass);\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd this is how the mysqli object gets passed to the class:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$mysql = new mysqli($cfg['mysql_server'], $cfg['username'], $cfg['password'], $cfg['database']);\n$user = new bibliotheek\\user($mysql, $cfg['salt']);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethe mysql login data is correct, I've made sure of that.\u003c/p\u003e\n\n\u003cp\u003eI must be missing something really obvious here, but I just can't see it. Any help is greatly appreciated. Thanks!\u003c/p\u003e","answer_count":"2","comment_count":"3","creation_date":"2013-04-07 19:56:42.567 UTC","last_activity_date":"2013-04-07 21:05:39.623 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1870238","post_type_id":"1","score":"0","tags":"php|object|mysqli","view_count":"434"} +{"id":"38781403","title":"bootstrap panel-collapse show hide div","body":"\u003cp\u003ei have following div to show/hide data \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div id=\"show-form-bank\" class=\"panel-collapse collapse\" \u0026gt;\n ...data to show\n \u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhen page load, div is closed, here no problem, when i click on update button its showing/display div thats also no problem, problem is when i click again on another update button its going closed, i want something is, if div is open and when i click again in update button then it will not close. it will close only if it open.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;a href=\"#\" ng-click=\"editproduct(product_num)\"class=\"btn-update\" class=\"btn btn-info\" data-toggle=\"collapse\" data-target=\"#show-form-bank\"\u0026gt;Update\u0026lt;/a\u0026gt;\n\u0026lt;a href=\"#\" ng-click=\"editproduct(product_num)\"class=\"btn-update\" class=\"btn btn-info\" data-toggle=\"collapse\" data-target=\"#show-form-bank\"\u0026gt;Update\u0026lt;/a\u0026gt;\n\u0026lt;a href=\"#\" ng-click=\"editproduct(product_num)\"class=\"btn-update\" class=\"btn btn-info\" data-toggle=\"collapse\" data-target=\"#show-form-bank\"\u0026gt;Update\u0026lt;/a\u0026gt;\n.....\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"0","creation_date":"2016-08-05 04:57:29.26 UTC","last_activity_date":"2016-08-05 04:57:29.26 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6904338","post_type_id":"1","score":"1","tags":"twitter-bootstrap","view_count":"144"} +{"id":"28733802","title":"if statements in while loops","body":"\u003cp\u003eI am new to programming, and I am trying to practice various functions with a simple \"Pick a Number\" application. However I have ran into a problem.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eRandom rnd = new Random();\nint deNumero = rnd.Next(1,100001);\nwhile (true)\n{\n Console.WriteLine(\"Pick a number 1 - 100000\");\n string input = Console.ReadLine();\n int numero = Int32.Parse(input);\n if(numero \u0026lt; deNumero)\n {\n Console.WriteLine(\"Lower\");\n }\n else if(numero \u0026gt; deNumero)\n {\n Console.WriteLine(\"Higher\");\n }\n else if(numero == deNumero)\n {\n Console.WriteLine(\"Well done!\");\n Console.ReadKey();\n }\n else\n {\n Console.WriteLine(\"What?\");\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eLet's say I pick a number that is greater than \u003ccode\u003edeNumero\u003c/code\u003e and it prints \"Lower\". Where I am seeing a problem is when I pick the number 1, it will print \"Lower\" again. it keeps going to the same \u003ccode\u003eif\u003c/code\u003e statement even when it shouldn't. What am I doing wrong?\u003c/p\u003e","answer_count":"2","comment_count":"4","creation_date":"2015-02-26 03:10:27.347 UTC","last_activity_date":"2015-02-26 03:37:54.65 UTC","last_edit_date":"2015-02-26 03:37:54.65 UTC","last_editor_display_name":"","last_editor_user_id":"20146","owner_display_name":"","owner_user_id":"4608449","post_type_id":"1","score":"-2","tags":"c#|if-statement","view_count":"56"} +{"id":"42716507","title":"ioService.post(boost::bind(\u0026myFunction, this, attr1, attri2) does not post the work","body":"\u003cp\u003eI have a program which takes several input from the user and based on the input it posts the work to a thread pool like the following: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ewhile (getline (file, input)){\n if(input =='a'){\n ioService_.post(boost::bind(\u0026amp;myClass::myFunction, this, input, counter)); \n } //end if\n\n else if(input=='b'){\n ioService_.post(boost::bind(importedFunction, input));\n }\n\n else{\n break;\n }\n }//end while\n\n threadpool.join_all();\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe function importedFunction is imported from another class and the code works correctly with it but for the myFunction function it does not post work. \u003c/p\u003e\n\n\u003cp\u003eI was originally binding the function as this: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eioService_.post(boost::bind(myClass::myFunction, input, counter)); \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand it was giving me an error which is: \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e/usr/local/include/boost/bind/bind.hpp:75:22: Type 'void\n (multithreading::*)(std::__1::basic_string, int)' cannot be used\n prior to '::' because it has no members\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eand then I changed into this and solved the error: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eioService_.post(boost::bind(\u0026amp;myClass::myFunction, this, input, counter)); \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut now the work is not submitted and I don't know why. \u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-03-10 10:48:49.947 UTC","favorite_count":"1","last_activity_date":"2017-03-15 18:08:35.55 UTC","last_edit_date":"2017-03-15 18:08:35.55 UTC","last_editor_display_name":"","last_editor_user_id":"7631183","owner_display_name":"","owner_user_id":"7631183","post_type_id":"1","score":"1","tags":"c++|multithreading|boost|boost-asio|threadpool","view_count":"58"} +{"id":"8764148","title":"Tombstoning Canvas Visibility Property","body":"\u003cp\u003eI have small problem with retrieving the state of a canvas' visibility property. When I retrieve the page state, the canvas is always visible even if it was collapsed when it was tombstoned. I tried a bunch of if else and switch statements but with no luck. How do I fix this bug? Thanks in advance to anyone who wants to help!\u003c/p\u003e\n\n\u003cp\u003eHere's the code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e private const string coachPivotKey = \"CoachPivotKey\";\n private const string isVisibleKey = \"IsVisibleKey\";\n\n protected override void OnNavigatedFrom(System.Windows.Navigation.NavigationEventArgs e)\n {\n this.SaveState(coachPivotKey, coachPivot.SelectedIndex);\n this.SaveState(isVisibleKey, canvasNotes.Visibility);\n }\n\n protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)\n {\n coachPivot.SelectedItem = coachPivot.Items[this.LoadState\u0026lt;int\u0026gt;(coachPivotKey)];\n canvasNotes.Visibility = this.LoadState\u0026lt;Visibility\u0026gt;(isVisibleKey);\n\n base.OnNavigatedTo(e);\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe LoadState() and SaveState() methods are in a different class. These I got from a video I watched on tombstoning:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic static void SaveState(this PhoneApplicationPage phoneApplicationPage, string key, object value)\n {\n if (phoneApplicationPage.State.ContainsKey(key))\n {\n phoneApplicationPage.State.Remove(key);\n }\n\n phoneApplicationPage.State.Add(key, value);\n }\n\npublic static T LoadState\u0026lt;T\u0026gt;(this PhoneApplicationPage phoneApplicationPage, string key)\n {\n if (phoneApplicationPage.State.ContainsKey(key))\n {\n return (T)phoneApplicationPage.State[key];\n }\n\n return default(T);\n }\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"8765288","answer_count":"1","comment_count":"11","creation_date":"2012-01-06 20:36:46.157 UTC","last_activity_date":"2012-01-07 00:55:44.42 UTC","last_edit_date":"2012-01-06 22:13:01.893 UTC","last_editor_display_name":"","last_editor_user_id":"1098866","owner_display_name":"","owner_user_id":"1098866","post_type_id":"1","score":"1","tags":"c#|windows-phone-7.1|windows-phone-7","view_count":"259"} +{"id":"18773452","title":"Need to find IP address of network interface on Ubuntu with PHP","body":"\u003cp\u003eI need help finding the IP address of my computer when it is on a network. I am building a kiosk type system that will be put into different locations and I need to be able to use the web browser to find the IP address of that computer on the local network.\u003c/p\u003e\n\n\u003cp\u003eIf I use \u003ccode\u003e$_SERVER['SERVER_ADDR']\u003c/code\u003e I get the IP address I am connecting to through the local browser (127.0.0.1) on that machine. \u003c/p\u003e\n\n\u003cp\u003eI can't call out and get the public IP because the units may be behind a router and I don't want the public IP address of the router. \u003c/p\u003e\n\n\u003cp\u003eI need to find the IP address of that box on the server (ex: 192.168.0.xxx)\u003c/p\u003e\n\n\u003cp\u003eI do know that when I do a 'ip addr show' from the terminal I get \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e1: lo: \u0026lt;LOOPBACK,UP,LOWER_UP\u0026gt; mtu 65536 qdisc noqueue state UNKNOWN \n link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00\n inet 127.0.0.1/8 scope host lo\n inet6 ::1/128 scope host \n valid_lft forever preferred_lft forever\n2: em1: \u0026lt;BROADCAST,MULTICAST,UP,LOWER_UP\u0026gt; mtu 1500 qdisc pfifo_fast state UP qlen 1000\n link/ether 61:a6:4d:63:a2:80 brd ff:ff:ff:ff:ff:ff\n inet 192.168.0.211/24 brd 192.168.0.255 scope global em1\n inet6 fe80::62a4:4cff:fe64:a399/64 scope link \n valid_lft forever preferred_lft forever\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I try:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$command=\"ip addr show\";\n$localIP = exec ($command);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003ccode\u003e$localIP\u003c/code\u003e comes out with \"valid_lft forever preferred_lft forever\" but none of the other information. If I can get the whole thing into \u003ccode\u003e$localIP\u003c/code\u003e then I can filter out the inet IP address but it won't give me everything.\u003c/p\u003e\n\n\u003cp\u003eIs there an easier way to do this or something I am missing when trying to do the \"ip addr show\" command? Also, I am running under the user apache and can't run this as root for this application.\u003c/p\u003e","accepted_answer_id":"18774079","answer_count":"7","comment_count":"3","creation_date":"2013-09-12 20:08:01.427 UTC","last_activity_date":"2015-11-25 09:10:34.83 UTC","last_edit_date":"2013-09-12 20:10:36.197 UTC","last_editor_display_name":"","last_editor_user_id":"78845","owner_display_name":"","owner_user_id":"2774053","post_type_id":"1","score":"2","tags":"php|linux|networking","view_count":"7115"} +{"id":"25927582","title":"Duplicating the nodes and relationships in neo4j","body":"\u003cp\u003eI'm using neo4j 2.1.2 community edition.\u003c/p\u003e\n\n\u003cp\u003eI want to replicate the nodes and relationships to a new path from the existing old path. Consider i have one hierarchy.\u003c/p\u003e\n\n\u003cp\u003eCompany:Google\nStreet : 5760 W 96th Street\nCity:Marco\nState : FL\nCountry : US\u003c/p\u003e\n\n\u003cp\u003eFor the first time i will create a hierarchy with 4nodes with some relationships. The relationship looks like as below:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCreate (Google)-[:located_at]-\u0026gt;(Marco)-[:belongs_to]-\u0026gt;(FL)-[:present_in]-\u0026gt;(US)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd then I will create one more company node called as Yahoo and this company is having different street name and same city, state and country name as same as Google. \u003c/p\u003e\n\n\u003cp\u003eSo now i want to create a yahoo node and street node , and wanted to copy the city, state and country node along with their relationships to this node.So here I wanted to copy the existing nodes into my new path.\u003c/p\u003e\n\n\u003cp\u003eHow can i do it?\u003c/p\u003e\n\n\u003cp\u003eMy new node looks like this :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCompany: Yahoo\nStreet : 199 Grandview Road\nCity : Marco\nSate : FL\nCountry : US\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI do not want to attach the yahoo node with the Google node's city, state, country nodes.\n(These two paths present in a same database )\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2014-09-19 06:22:16.96 UTC","favorite_count":"1","last_activity_date":"2014-09-19 09:06:05.27 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2796181","post_type_id":"1","score":"0","tags":"neo4j|cypher","view_count":"339"} +{"id":"15996666","title":"How to remove local notification from notification center?","body":"\u003cp\u003eIs there any way to remove all local notification from notification center?\nI tried to cancellAllLocalNotification, But it cancel whole notification which wasn't \nnotified yet (still in schedule).\nBut I want to just clear notification center, and I don't want to unschedule rest notification.\u003c/p\u003e\n\n\u003cp\u003eI think I must save whole notification and, clear all notification with cancelAllLocalNotification, and re-schedule rest notification.\nBut I feel it ugly solution.. ;-(\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2013-04-14 07:12:52.753 UTC","last_activity_date":"2013-04-14 09:26:27.357 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1212886","post_type_id":"1","score":"1","tags":"iphone|ios","view_count":"304"} +{"id":"20180571","title":"can not retrieve static fields in solr","body":"\u003cp\u003eI read about templates in solr and add static field in solr index in topic below but when i add this to my data-config.xml cant retrieve that field\u003cbr /\u003e\n\u003ca href=\"http://wiki.apache.org/solr/DataImportHandlerFaq#How_would_I_insert_a_static_value_into_a_field_.3F\" rel=\"nofollow noreferrer\"\u003eHow would I insert a static value into a field ?\u003c/a\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;pre\u0026gt;\n \u0026lt;dataConfig\u0026gt; \n \u0026lt;dataSource type=\"JdbcDataSource\"\n driver=\"com.mysql.jdbc.Driver\"\n url=\"jdbc:mysql://localhost:3306/expina\" user=\"root\" password=\"root\"/\u0026gt;\n\n \u0026lt;document\u0026gt;\n \u0026lt;entity name=\"category\" query=\"SELECT * from category\"\u0026gt;\n \u0026lt;field column=\"section\" template=\"category\"/\u0026gt;\n \u0026lt;/entity\u0026gt;\n \u0026lt;entity name=\"mark\" query=\"SELECT * from mark\"\u0026gt;\n \u0026lt;field column=\"section\" template=\"mark\"/\u0026gt;\n \u0026lt;/entity\u0026gt;\n \u0026lt;entity name=\"stuffs\" query=\"CALL fetchAllStuffs();\" \u0026gt;\n \u0026lt;field column=\"section\" template=\"stuff\"/\u0026gt;\n \u0026lt;/entity\u0026gt;\n \u0026lt;/document\u0026gt;\n\n \u0026lt;/dataConfig\u0026gt;\n \u0026lt;/pre\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"2","creation_date":"2013-11-24 20:28:36.81 UTC","last_activity_date":"2016-12-25 04:22:35.167 UTC","last_edit_date":"2016-12-25 04:22:35.167 UTC","last_editor_display_name":"","last_editor_user_id":"1033581","owner_display_name":"","owner_user_id":"1586618","post_type_id":"1","score":"0","tags":"solr","view_count":"55"} +{"id":"20756563","title":"Circle around :before element","body":"\u003cp\u003eHello I'm trying to figure out the same question that what was asked in this thread \u003ca href=\"https://stackoverflow.com/questions/4861224/how-to-use-css-to-surround-a-number-with-a-circle\"\u003eHow to use CSS to surround a number with a circle?\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eHowever - everytime I do it, the shape becomes oval, regardless if I add width/height or not...\u003c/p\u003e\n\n\u003cp\u003eI created a jsfiddle here \u003ca href=\"http://jsfiddle.net/dDuFv/\" rel=\"nofollow noreferrer\"\u003ehttp://jsfiddle.net/dDuFv/\u003c/a\u003e \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;ul class=\"numberCircle\"\u0026gt;\n \u0026lt;li\u0026gt;testing\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;testing\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;testing\u0026lt;/li\u0026gt;\n\u0026lt;/ul\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eCSS\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e.numberCircle { list-style-type:none; font-size:18px; }\n.numberCircle li { margin:20px;}\n.numberCircle li:before {\n border-radius:100%;\n counter-increment: section;\n content:counter(section);\n background: #f1562c;\n color:#fff;\n padding:2px;\n border:none;\n text-align: center;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut it's just not working!\u003c/p\u003e\n\n\u003cp\u003eThanks for any help!\u003c/p\u003e","accepted_answer_id":"20756616","answer_count":"1","comment_count":"0","creation_date":"2013-12-24 07:15:02.857 UTC","last_activity_date":"2013-12-24 07:19:12.34 UTC","last_edit_date":"2017-05-23 11:46:54.433 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"676028","post_type_id":"1","score":"2","tags":"css|circle|css3","view_count":"2416"} +{"id":"46831689","title":"Snapsvg positioning and animating objects on Vuejs","body":"\u003cp\u003eFellows,\u003c/p\u003e\n\n\u003cp\u003eI am studying SVG to get an animation to done with Snapsvg, inside Vuejs.\nI have here an example that works already outside of Vuejs, with a simple HTML page.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;!DOCTYPE html\u0026gt;\n\u0026lt;html lang=\"pt-br\"\u0026gt;\n\u0026lt;head\u0026gt;\n\u0026lt;meta charset=\"utf-8\"\u0026gt;\n\u0026lt;title\u0026gt;SVG Anima\u0026lt;/title\u0026gt;\n\u0026lt;link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css\" integrity=\"sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u\" crossorigin=\"anonymous\"\u0026gt;\n\u0026lt;script src=\"https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\n\u0026lt;script src=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\n\u0026lt;script src=\"snap.svg-min.js\"\u0026gt;\u0026lt;/script\u0026gt;\n\u0026lt;style\u0026gt;\n html {\n height: 100%;\n box-sizing: border-box;\n }\n body {\n position: relative;\n margin: 0;\n padding-bottom: 6rem;\n min-height: 100%;\n font-family: \"Helvetica Neue\", Arial, sans-serif;\n }\n #app{\n margin: 0 auto;\n padding-top: 64px;\n max-width: 640px;\n width: 94%;\n }\n svg {\n background: #cccccc;\n }\n.flex{\n display: flex;\n flex-flow: row wrap;\n}\n.um{fill:none;stroke:#010101;stroke-width:4;stroke-miterlimit:10;}\n\n\u0026lt;/style\u0026gt;\n\u0026lt;script\u0026gt;\n var paper, map, um, umbox, um_path, um_path_length, last_point;\n window.onload = function () {\n paper = map;\n map = Snap('#numeros');\n um = map.select(\"#um\");\n umbox = um.getBBox();\n um_path = map.select('#pathUm');\n um_path_length = Snap.path.getTotalLength(um_path);\n last_point = um_path.getPointAtLength(um_path_length);\n var tempo = 1000;\n var parada = 0.8;\n\n Snap.animate(0, um_path_length, function( step ) {\n moveToPoint = Snap.path.getPointAtLength( um_path, step );\n proporcao = ((100*step)/um_path_length)/100;\n x = moveToPoint.x - 415; // - (umbox.width/2);\n y = moveToPoint.y - 675;\n um.transform('translate(' + x + ',' + y + '), scale('+proporcao+','+proporcao+','+umbox.cx+', '+umbox.cy+'),'+umbox.cx+', '+umbox.cy+')');\n },tempo, mina.easeout ,function(){\n });\n }\n\u0026lt;/script\u0026gt;\n\u0026lt;body\u0026gt;\n\u0026lt;div id=\"app\"\u0026gt;\n \u0026lt;div class=\"flex\"\u0026gt;\n \u0026lt;div\u0026gt;\n \u0026lt;svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" width=\"670\" height=\"670\" viewBox=\"0 0 670.00001 670.00001\" version=\"1.1\" \n id=\"numeros\" xml:space=\"preserve\"\u0026gt;\n\u0026lt;g\n style=\"display:inline\"\n transform=\"translate(0,-382.36216)\"\u0026gt;\n \u0026lt;circle\n\n class=\"um\"\n id=\"um\"\n cx=\"413.06943\"\n cy=\"674.49329\"\n r=\"124.15339\" /\u0026gt;\n\u0026lt;path\n style=\"display:inline;fill:none;stroke:none;stroke-width:0.41528043;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1\"\n d=\"m 458.00729,775.379 c -1.18278,1.49983 -0.9226,3.67696 0.58106,4.86277 2.93412,2.31388 7.18313,1.81692 9.49048,-1.10896 3.49918,-4.43714 2.73939,-10.87047 -1.69839,-14.37015 -7.34007,-5.78844 -18.00971,-4.498 -23.83029,2.88285 -9.28311,11.7715 -7.26593,28.83914 4.50555,38.12222 19.15296,15.10418 46.92386,11.82199 62.02804,-7.33093 24.40035,-30.94102 19.09804,-75.80461 -11.84363,-100.20547 -50.0933,-39.50401 -122.72553,-30.91976 -162.22953,19.17354\"\n id=\"pathUm\" /\u0026gt;\n\u0026lt;/g\u0026gt;\n\n\u0026lt;/svg\u0026gt;\n\n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\n\u0026lt;/div\u0026gt; \n\u0026lt;/body\u0026gt; \n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is working but only because I've made a few modifications. The svg I made on Inkscape. The path of the svg when used in the Snapsvg animation, is changing the position and I don't know why. So I made the modifications here:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ex = moveToPoint.x - 415;\ny = moveToPoint.y - 675;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e1) Does anyone knows why the path is not taking the right path?\n2) Does anyone knows this script can work (the best way) on Vuejs?\u003c/p\u003e\n\n\u003cp\u003eThank you very much!\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2017-10-19 13:58:13.98 UTC","last_activity_date":"2017-10-19 13:58:13.98 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3570546","post_type_id":"1","score":"0","tags":"svg|vuejs2|snap.svg","view_count":"31"} +{"id":"30972126","title":"Why am getting this error?: Unknown column 'firstname' in 'field list'","body":"\u003cpre\u003e\u003ccode\u003e if(isset($_POST[\"submit\"]))\n {\n\n // Details for inserting into the database\n\n $id = htmlentities($_POST[\"id\"]);\n $firstname = htmlspecialchars($_POST[\"firstname\"]);\n $lastname = htmlspecialchars($_POST[\"lastname\"]);\n $username = htmlspecialchars($_POST[\"username\"]);\n $password = htmlspecialchars($_POST[\"password\"]);\n\n // Dealing with inserting \n\n $query = \"INSERT INTO `myDatabaseForAll`.`users` (`id`, `firstname`, `lastname`, `username`, `password`)\n VALUES (NULL, $firstname, $lastname,$username,$password)\";\n $result = mysqli_query($connection,$query);\n\n\n if(!$result) {\n die('There were some errors '.mysqli_error($connection));\n } else {\n redirect_to('index.php');\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"30972142","answer_count":"2","comment_count":"2","creation_date":"2015-06-22 04:27:58.007 UTC","last_activity_date":"2015-06-24 06:46:08.857 UTC","last_edit_date":"2015-06-24 06:46:08.857 UTC","last_editor_display_name":"","last_editor_user_id":"912130","owner_display_name":"","owner_user_id":"5005974","post_type_id":"1","score":"0","tags":"php|database|mysqli","view_count":"188"} +{"id":"11004709","title":"Absolutely Positioned Images - No Overlap","body":"\u003cp\u003eI'm using JS masonry to absolutely position images on a page, and I'm using some JS to give each image a random margin-top and margin-left to give the effect of random spacing etc. However some of the images overlap. Is there a way to stop this from happening?\u003c/p\u003e\n\n\u003cp\u003eYou can see the current outcome here: \u003ca href=\"http://richgc.com/freelance/staton/exhibitions-installations/\" rel=\"nofollow\"\u003ehttp://richgc.com/freelance/staton/exhibitions-installations/\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThanks,\nR\u003c/p\u003e","accepted_answer_id":"11004954","answer_count":"1","comment_count":"4","creation_date":"2012-06-12 20:53:33.987 UTC","last_activity_date":"2012-06-12 21:13:22.447 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1043706","post_type_id":"1","score":"0","tags":"javascript|jquery|overlap","view_count":"221"} +{"id":"15447285","title":"Javascript is not working when including the php file in ajax","body":"\u003cp\u003ei have a drop down select list and a button in which i have inserted an onclick event so that whenever anyone is clicking on that button it will call a function which is basically includes an ajax and when on executing it will include a php file. In my php file it is taking the value from the selected drop down list and after that it will display an alert option but it is not displaying any alert.\u003c/p\u003e\n\n\u003cp\u003eBelow is my code:-\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;html\u0026gt;\n\u0026lt;head\u0026gt;\n\u0026lt;script\u0026gt;\nfunction showUser(str)\n{\nif (str==\"\")\n {\n document.getElementById(\"txtHint\").innerHTML=\"\";\n return;\n }\nif (window.XMLHttpRequest)\n {// code for IE7+, Firefox, Chrome, Opera, Safari\n xmlhttp=new XMLHttpRequest();\n }\nelse\n {// code for IE6, IE5\n xmlhttp=new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\nxmlhttp.onreadystatechange=function()\n {\n if (xmlhttp.readyState==4 \u0026amp;\u0026amp; xmlhttp.status==200)\n {\n document.getElementById(\"txtHint\").innerHTML=xmlhttp.responseText;\n }\n }\nxmlhttp.open(\"GET\",\"user.php?q=\"+str,true);\nxmlhttp.send();\n}\n\u0026lt;/script\u0026gt;\n\u0026lt;/head\u0026gt;\n\u0026lt;body\u0026gt;\n\n\u0026lt;form\u0026gt;\n\u0026lt;select name=\"users1\" onchange=\"showUser(this.value)\"\u0026gt;\n\u0026lt;option value=\"\"\u0026gt;Select a person:\u0026lt;/option\u0026gt;\n\u0026lt;option value=\"1\"\u0026gt;Peter Griffin\u0026lt;/option\u0026gt;\n\u0026lt;option value=\"2\"\u0026gt;Lois Griffin\u0026lt;/option\u0026gt;\n\u0026lt;option value=\"3\"\u0026gt;Glenn Quagmire\u0026lt;/option\u0026gt;\n\u0026lt;option value=\"4\"\u0026gt;Joseph Swanson\u0026lt;/option\u0026gt;\n\u0026lt;/select\u0026gt;\n\u0026lt;/form\u0026gt;\n\u0026lt;br\u0026gt;\n\u0026lt;div id=\"txtHint\"\u0026gt;\u0026lt;b\u0026gt;Person info will be listed here.\u0026lt;/b\u0026gt;\u0026lt;/div\u0026gt;\n\n\u0026lt;/body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003euser.php\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\n$q=$_GET[\"q\"];\nif($q ==1)\n{\n echo '\u0026lt;script type=\"text/javascript\"\u0026gt;\n alert(\"Hello\")\n \u0026lt;/script\u0026gt;';\n}\nelse {\n echo \"No\";\n}\n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny help would be appreciated much and thanks for your help in advance:)\u003c/p\u003e","answer_count":"9","comment_count":"6","creation_date":"2013-03-16 08:37:37.193 UTC","favorite_count":"2","last_activity_date":"2013-04-01 21:56:20.45 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1641270","post_type_id":"1","score":"5","tags":"php|javascript|ajax","view_count":"1822"} +{"id":"21585393","title":"WP8: Fast app resume + secondary tile + MainPage = 2 instances","body":"\u003cp\u003eI'm having the same problem posed here:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://social.msdn.microsoft.com/Forums/wpapps/en-us/af8615e7-8e90-4069-aa4d-3c4a84a6a3d0/windows-phone-8-fast-app-resume-with-deeplinks?forum=wpdevelop\" rel=\"nofollow\"\u003ehttp://social.msdn.microsoft.com/Forums/wpapps/en-us/af8615e7-8e90-4069-aa4d-3c4a84a6a3d0/windows-phone-8-fast-app-resume-with-deeplinks?forum=wpdevelop\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI'm no C# or WP expert, so please bear with me.\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eI have secondary tiles which link to \"/MainPage.xaml?id=XX\". \u003c/li\u003e\n\u003cli\u003eI have fast app resume enabled. (ActivationPolicy=\"Resume\" in the app manifest)\u003c/li\u003e\n\u003cli\u003eI only have one page in my app: MainPage.xaml.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003e\u003cstrong\u003eProblem\u003c/strong\u003e: When I resume the app using a secondary tile (\"/MainPage.xaml?id=XX\"), I get a brief view of the previous instance (that would have resumed) and then the MainPage initializes again, creating a new instance. In effect, the app is loading from scratch after giving me a peek of what was previously open.\u003c/p\u003e\n\n\u003cp\u003eThat is obviously undesired behavior. I want to use the existing instance to perform my task.\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003e\u003cem\u003e\u003cstrong\u003eAttempt 1\u003c/em\u003e\u003c/strong\u003e: \nUse \u003ccode\u003ee.Cancel = true;\u003c/code\u003e to cancel the navigation to the MainPage.xaml:\u003cbr\u003e\n\u003cem\u003e(using the App.xaml.cs code from the official \u003ca href=\"http://code.msdn.microsoft.com/wpapps/Fast-app-resume-backstack-f16baaa6\" rel=\"nofollow\"\u003eFast App Resume sample\u003c/a\u003e to identify how the app was launched)\u003c/em\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e...\nelse if (e.NavigationMode == NavigationMode.New \u0026amp;\u0026amp; wasRelaunched)\n{\n // This block will run if the previous navigation was a relaunch\n wasRelaunched = false;\n\n if (e.Uri.ToString().Contains(\"=\"))\n {\n // This block will run if the launch Uri contains \"=\" (ex: \"id=XX\") which\n // was specified when the secondary tile was created in MainPage.xaml.cs\n sessionType = SessionType.DeepLink;\n\n e.Cancel = true; // \u0026lt;======================== Here\n\n // The app was relaunched via a Deep Link.\n // The page stack will be cleared.\n }\n}\n...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cem\u003e\u003cstrong\u003eProblem\u003c/em\u003e\u003c/strong\u003e: In doing so, my OnNavigatedTo event handlers never fire, so my query string is never parsed.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprotected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)\n{\n String navId;\n if (e.NavigationMode != System.Windows.Navigation.NavigationMode.Back)\n {\n if (NavigationContext.QueryString.TryGetValue(\"id\", out navId))\n {\n MessageBox.Show(navId.ToString()); // Not reached\n }\n }\n ...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003chr\u003e\n\n\u003cp\u003e\u003cem\u003e\u003cstrong\u003eAttempt 2\u003c/em\u003e\u003c/strong\u003e: \nUse \u003ccode\u003ee.Cancel = true;\u003c/code\u003e to cancel the navigation to the MainPage.xaml, \u003cstrong\u003e\u003cem\u003eAND\u003c/em\u003e\u003c/strong\u003e pass the Uri to a method in MainPage: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e// App.xaml.cs\n...\nelse if (e.NavigationMode == NavigationMode.New \u0026amp;\u0026amp; wasRelaunched)\n{\n // This block will run if the previous navigation was a relaunch\n wasRelaunched = false;\n\n if (e.Uri.ToString().Contains(\"=\"))\n {\n // This block will run if the launch Uri contains \"=\" (ex: \"id=XX\") which\n // was specified when the secondary tile was created in MainPage.xaml.cs\n sessionType = SessionType.DeepLink;\n\n e.Cancel = true;\n\n MainPage.GoToDeepLink(e.Uri); // \u0026lt;======================== Here\n\n // The app was relaunched via a Deep Link.\n // The page stack will be cleared.\n }\n}\n...\n\n// MainPage.xaml.cs\npublic static void GoToDeepLink(Uri uri) // \u0026lt;======================== Here\n{\n // Convert the uri into a list and navigate to it.\n string path = uri.ToString();\n string id = path.Substring(path.LastIndexOf('=') + 1);\n\n MyList list = App.ViewModel.ListFromId(Convert.ToInt32(id));\n pivotLists.SelectedItem = list;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cem\u003e\u003cstrong\u003eProblem\u003c/em\u003e\u003c/strong\u003e: I get an error that \u003cem\u003epivotLists\u003c/em\u003e is non-static and thus requires an object reference. I think that in order to get this to work I'd need to create a new instance of MainPage (\u003ccode\u003eMainPage newMainPage = new MainPage();\u003c/code\u003e) and call \u003ccode\u003enewMainPage.pivotLists.SelectedItem = list;\u003c/code\u003e -- BUT I don't know how to use newMainPage instead of the existing one/replace it... or if that's something I want/won't cause further problems/complications.\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003eI don't know what the solution is to this problem, and I may be going in the completely wrong direction. Please keep all suggestions in simple terms with code examples if you can, I'm still learning.\u003c/p\u003e\n\n\u003cp\u003eThanks for any help.\u003c/p\u003e","accepted_answer_id":"21614706","answer_count":"1","comment_count":"0","creation_date":"2014-02-05 18:24:45.597 UTC","last_activity_date":"2014-02-09 19:51:37.517 UTC","last_edit_date":"2014-02-05 18:31:04.94 UTC","last_editor_display_name":"","last_editor_user_id":"2616836","owner_display_name":"","owner_user_id":"2616836","post_type_id":"1","score":"3","tags":"c#|windows-phone-8|windows-phone|secondary-live-tile","view_count":"1302"} +{"id":"24876659","title":"Javascript/JQuery - Option selected from Select Field - best practice","body":"\u003cp\u003eIn my form I've got a select field;\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;select id=\"setColor\"\u0026gt;\n \u0026lt;option value=\"black\"\u0026gt;black\u0026lt;/option\u0026gt;\n \u0026lt;option value=\"white\"\u0026gt;white\u0026lt;/option\u0026gt;\n \u0026lt;option value=\"both\"\u0026gt;both\u0026lt;/option\u0026gt;\n \u0026lt;/select\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd whenever each option is selected I want a different thing to happen;\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;script\u0026gt;\n var setColor = function(){\n\n var selectVal = $(\"#setColor\").val();\n\n if(selectVal === \"black\"){\n //do something when \"black\" is selected\n }\n else if(selectVal === \"white\"){\n //do something when \"white\" is selected\n }\n else {\n //do something when \"both\" is selected\n }\n };\n\n $(document).ready(setColor());\n\n \u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis has already been answered in \u003ca href=\"https://stackoverflow.com/questions/1071992/execute-script-based-on-which-option-is-selected-in-a-select-box\"\u003eExecute script based on which option is selected in a select box?\u003c/a\u003e, but the problem is, whenever more options get added (eg. colours), I'll have to add in more code in the JS. So the question is, is there a better way of writing the JS/Jquery to prevent me from having to add more code whenever an option gets added.\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2014-07-21 23:43:22.457 UTC","last_activity_date":"2014-07-21 23:43:22.457 UTC","last_edit_date":"2017-05-23 12:05:34.797 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"3540018","post_type_id":"1","score":"0","tags":"javascript|jquery","view_count":"60"} +{"id":"18692175","title":"Python stderr - fail to parse exception message","body":"\u003cp\u003eI want to parse the exception print so that not all the exception data will appear.\u003c/p\u003e\n\n\u003cp\u003efor example, I have the following exception message:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eTraceback (most recent call last):\n File \"C:\\flow_development\\console_debug_sample.py\", line 52, in \n raise Exception('Exception occur')\n Exception: Exception occur\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eand I want to parse this exception that only the exception message will appear:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eException occur\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003efor that I use to code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass Unbuffered:\n def __init__(self, stream):\n self.stream = stream\n def write(self, data):\n self.stream.write(data)\n self.stream.flush()\n def __getattr__(self, attr):\n return getattr(self.stream, attr)\n\nif __name__ == \"__main__\":\n sys.stdout = Unbuffered(sys.stdout)\n sys.stderr = Unbuffered(sys.stderr)\n\n raise Exception('Exception occur')\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut, every line at the exception is calling the 'write' function separately, so I can't flush all exception message and parse.\u003c/p\u003e\n\n\u003cp\u003eAny idea ?\u003c/p\u003e","accepted_answer_id":"18692587","answer_count":"2","comment_count":"1","creation_date":"2013-09-09 05:50:13.303 UTC","last_activity_date":"2013-09-09 07:07:05.433 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1156905","post_type_id":"1","score":"1","tags":"python|parsing|exception|flush","view_count":"516"} +{"id":"37156493","title":"One-to-Many Symfony Doctrine returns empty result","body":"\u003cp\u003eIn my code I have a table called Squares. A Square has many Assets. Squares has a column called msid, which is a squares id.\u003c/p\u003e\n\n\u003cp\u003eIn my Assets table I have a field called msid. This is the msid of the Square it belongs to.\u003c/p\u003e\n\n\u003cp\u003eI'm trying to set up a One-to-Many/Many-to-One relationship, and it's just not working. I have no idea what it is, and I'm very new to symfony and Doctrine, so if you think of a solution, please don't skip steps.\u003c/p\u003e\n\n\u003cp\u003eThanks in advance, this is turning me off from this migration so fast.\u003c/p\u003e\n\n\u003cp\u003eEDIT: I need to mention that I am not generating a new schema. I am migrating a schema currently in production to ORM.\u003c/p\u003e\n\n\u003cp\u003eAssets.php\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\n\nnamespace AppBundle\\Entity;\n\nuse Doctrine\\ORM\\Mapping as ORM;\n\n/**\n * Assets\n *\n * @ORM\\Table(name=\"assets\")\n * @ORM\\Entity\n */\nclass Assets\n{\n\n /**\n * @ORM\\ManyToOne(targetEntity=\"Squares\", inversedBy=\"assets\")\n */\n private $square;\n\n /**\n * @var integer\n *\n * @ORM\\Column(name=\"msid\", type=\"integer\", nullable=false)\n */\n private $msid;\n\n /**\n * @var string\n *\n * @ORM\\Column(name=\"name\", type=\"string\", length=64, nullable=false)\n */\n private $name;\n\n /**\n * @var string\n *\n * @ORM\\Column(name=\"type\", type=\"string\", length=32, nullable=false)\n */\n private $type;\n\n /**\n * @var string\n *\n * @ORM\\Column(name=\"data\", type=\"string\", length=4096, nullable=false)\n */\n private $data;\n\n /**\n * @var integer\n *\n * @ORM\\Column(name=\"assetid\", type=\"integer\")\n * @ORM\\Id\n * @ORM\\GeneratedValue(strategy=\"IDENTITY\")\n */\n private $assetid;\n\n /**\n * Set msid\n *\n * @param integer $msid\n *\n * @return Assets\n */\n public function setMsid($msid)\n {\n $this-\u0026gt;msid = $msid;\n\n return $this;\n }\n\n /**\n * Get msid\n *\n * @return integer\n */\n public function getMsid()\n {\n return $this-\u0026gt;msid;\n }\n\n /**\n * Set name\n *\n * @param string $name\n *\n * @return Assets\n */\n public function setName($name)\n {\n $this-\u0026gt;name = $name;\n\n return $this;\n }\n\n /**\n * Get name\n *\n * @return string\n */\n public function getName()\n {\n return $this-\u0026gt;name;\n }\n\n /**\n * Set type\n *\n * @param string $type\n *\n * @return Assets\n */\n public function setType($type)\n {\n $this-\u0026gt;type = $type;\n\n return $this;\n }\n\n /**\n * Get type\n *\n * @return string\n */\n public function getType()\n {\n return $this-\u0026gt;type;\n }\n\n /**\n * Set data\n *\n * @param string $data\n *\n * @return Assets\n */\n public function setData($data)\n {\n $this-\u0026gt;data = $data;\n\n return $this;\n }\n\n /**\n * Get data\n *\n * @return string\n */\n public function getData()\n {\n return $this-\u0026gt;data;\n }\n\n /**\n * Get assetid\n *\n * @return integer\n */\n public function getAssetid()\n {\n return $this-\u0026gt;assetid;\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAssets.SQL\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCREATE TABLE IF NOT EXISTS `assets` (\n `assetid` int(5) NOT NULL AUTO_INCREMENT,\n `msid` int(5) NOT NULL,\n `name` varchar(64) NOT NULL,\n `type` varchar(32) NOT NULL,\n `data` varchar(4096) NOT NULL,\n PRIMARY KEY (`assetid`)\n) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=8092 ;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSquares.php\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\n\nnamespace AppBundle\\Entity;\n\nuse Doctrine\\ORM\\Mapping as ORM;\nuse Doctrine\\Common\\Collections\\ArrayCollection;\n\n/**\n * Squares\n *\n * @ORM\\Table(name=\"squares\")\n * @ORM\\Entity(repositoryClass=\"AppBundle\\Repository\\SquaresRepository\")\n */\nclass Squares\n{\n /**\n * @var integer\n *\n * @ORM\\Column(name=\"userid\", type=\"integer\", nullable=false)\n */\n private $userid;\n\n /**\n * @var boolean\n *\n * @ORM\\Column(name=\"squaretype\", type=\"boolean\", nullable=false)\n */\n private $squaretype;\n\n /**\n * @var \\DateTime\n *\n * @ORM\\Column(name=\"published\", type=\"datetime\", nullable=false)\n */\n private $published = 'CURRENT_TIMESTAMP';\n\n /**\n * @var integer\n *\n * @ORM\\Column(name=\"msid\", type=\"integer\")\n * @ORM\\Id\n * @ORM\\GeneratedValue(strategy=\"IDENTITY\")\n */\n private $msid;\n\n /**\n * @ORM\\OneToMany(targetEntity=\"Assets\", mappedBy=\"square\")\n */\n private $assets;\n\n public function __construct()\n {\n $this-\u0026gt;assets = new ArrayCollection();\n }\n\n // other getters setters here ...\n\n /**\n * Get assets\n *\n * @return ArrayCollection\n */\n public function getAssets()\n {\n return $this-\u0026gt;assets;\n }\n\n /**\n * Set assets\n *\n * @param ArrayCollection $assets\n *\n * @return Squares\n */\n public function setAssets($assets)\n {\n $this-\u0026gt;assets = $assets;\n\n return $this;\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSquares SQL\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCREATE TABLE IF NOT EXISTS `squares` (\n `msid` int(11) NOT NULL AUTO_INCREMENT,\n `userid` int(5) NOT NULL,\n `squaretype` tinyint(4) NOT NULL,\n `published` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n `package` text NOT NULL,\n `counter` int(10) unsigned NOT NULL DEFAULT '0',\n `firstname` varchar(20) NOT NULL,\n `middlename` varchar(20) NOT NULL,\n `lastname` varchar(20) NOT NULL,\n `age` tinyint(1) DEFAULT NULL,\n `dob` text NOT NULL,\n `dod` text NOT NULL,\n `city` varchar(32) NOT NULL,\n `state` varchar(13) NOT NULL,\n `zip` int(5) NOT NULL,\n `sex` varchar(1) NOT NULL,\n `bio` text NOT NULL,\n `service` text NOT NULL,\n `picture` int(11) DEFAULT NULL,\n `video` text,\n `videoexp` date DEFAULT NULL,\n `videoReady` tinyint(1) NOT NULL,\n `videoCounter` int(10) unsigned NOT NULL DEFAULT '0',\n `vidIntro` text,\n `vidMusic` text,\n `vidBackground` text,\n `dualfirst` varchar(20) NOT NULL,\n `dualmiddle` varchar(20) NOT NULL,\n `duallast` varchar(20) NOT NULL,\n `dualdob` text NOT NULL,\n `dualdod` text NOT NULL,\n `dualpicture` int(11) DEFAULT NULL,\n `couplesname` varchar(50) NOT NULL,\n `birthday1` text,\n `birthday2` text,\n `visible` tinyint(4) NOT NULL DEFAULT '0',\n `verified` tinyint(1) NOT NULL,\n `fhName` varchar(256) NOT NULL,\n `fhPhone` varchar(20) NOT NULL,\n `fhLink` varchar(128) NOT NULL,\n `clientid` int(4) unsigned zerofill NOT NULL,\n PRIMARY KEY (`msid`)\n) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=10364 ;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"37159387","answer_count":"3","comment_count":"1","creation_date":"2016-05-11 08:02:12.723 UTC","last_activity_date":"2017-04-04 13:55:50.567 UTC","last_edit_date":"2016-05-11 09:24:22.803 UTC","last_editor_display_name":"","last_editor_user_id":"1181623","owner_display_name":"","owner_user_id":"1181623","post_type_id":"1","score":"0","tags":"php|symfony|doctrine2|doctrine","view_count":"306"} +{"id":"38234676","title":"Save button for SQL Server in vb.net","body":"\u003cp\u003eI have created a Save button for SQL Server in vb.net. I'm using Visual Studio 2012. I get this error:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eThis SqlTransaction has completed; it is no longer usable.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eas soon as I click on the button.\u003c/p\u003e\n\n\u003cp\u003eMy code Looks like this.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ePrivate Sub BtnSave_Click(sender As Object, e As EventArgs) Handles BtnSave.Click\n Me.Validate()\n Me.AnimalDetailsBindingSource.EndEdit()\n Me.TableAdapterManager.UpdateAll(Me.Animal_RecordsDataSet)\nEnd Sub\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt worked fine but not anymore.\u003c/p\u003e\n\n\u003cp\u003eThe error comes up at:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eMe.TableAdapterManager.UpdateAll(Me.Animal_RecordsDataSet)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am new to working with databases in software. Can anybody please let me know where I went wrong or what I should do different?\u003c/p\u003e","answer_count":"0","comment_count":"4","creation_date":"2016-07-06 22:14:10.673 UTC","last_activity_date":"2016-07-07 04:39:35.183 UTC","last_edit_date":"2016-07-07 04:39:35.183 UTC","last_editor_display_name":"","last_editor_user_id":"13302","owner_display_name":"","owner_user_id":"6451524","post_type_id":"1","score":"1","tags":"sql-server|vb.net","view_count":"110"} +{"id":"13863205","title":"DataGrid Row Details Visibility","body":"\u003cp\u003eI'm using a DataGrid control with the RowDetailsTemplate property defined. Obviously, clicking on a row will display the row details for that row. However, once the row details are displayed then I have a problem when scrolling downwards in the DataGrid. As soon as the row whose details are visible moves up and out of view, then the row details vanish instantly causing the following rows to \"jump\" up and fill the space. Scrolling upwards again causes the row details to appear instantly causing the following rows to \"jump\" back down to provide the space.\u003c/p\u003e\n\n\u003cp\u003eThis does not seem be a virtualization problem because the same behavior occurs no matter what the value of EnableRowVirtualization. Also, I understand that from the perspective of a visual tree this makes sense since the row details container is within the row container. However, the behavior just looks visually silly in practice.\u003c/p\u003e\n\n\u003cp\u003eIs there anyway to keep the row details always visible, even if the actual row is not visible, until the row is deselected?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2012-12-13 15:36:01.423 UTC","last_activity_date":"2012-12-24 12:46:44.533 UTC","last_edit_date":"2012-12-20 15:59:26.207 UTC","last_editor_display_name":"","last_editor_user_id":"1575237","owner_display_name":"","owner_user_id":"1575237","post_type_id":"1","score":"1","tags":"wpf|xaml|mvvm|mvvm-light","view_count":"785"} +{"id":"7641280","title":"UIView animation is delayed","body":"\u003cp\u003eAn app i am developing is pulling in custom ads. I'm retrieving ads fine, and the network side of things are working correctly. The problem I'm having is when the AdController receives an ad it parses the JSON object then requests the image.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e// Request the ad information\nNSDictionary* resp = [_server request:coords_dict isJSONObject:NO responseType:JSONResponse];\n// If there is a response...\nif (resp) {\n // Store the ad id into Instance Variable\n _ad_id = [resp objectForKey:@\"ad_id\"];\n // Get image data\n NSData* img = [NSData dataWithContentsOfURL:[NSURL URLWithString:[resp objectForKey:@\"ad_img_url\"]]];\n // Make UIImage\n UIImage* ad = [UIImage imageWithData:img];\n // Send ad to delegate method\n [[self delegate]adController:self returnedAd:ad];\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAll this works as expected, and AdController pulls in the image just fine...\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e-(void)adController:(id)controller returnedAd:(UIImage *)ad{\n adImage.image = ad;\n [UIView animateWithDuration:0.2 animations:^{\n adImage.frame = CGRectMake(0, 372, 320, 44);\n }];\n NSLog(@\"Returned Ad (delegate)\");\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe When the delegate method is called, it logs the message to the console, but it takes up to 5-6 seconds for the \u003ccode\u003eUIImageView* adImage\u003c/code\u003e to animate in. Because of the way the app is handling the request of the ads, the animation needs to be instant.\u003c/p\u003e\n\n\u003cp\u003eThe animation for hiding the ad is immediate.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e-(void)touchesBegan{\n [UIView animateWithDuration:0.2 animations:^{\n adImage.frame = CGRectMake(0, 417, 320, 44);\n }];\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"7642603","answer_count":"1","comment_count":"0","creation_date":"2011-10-03 22:13:50.377 UTC","last_activity_date":"2011-10-04 02:07:23.303 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"645682","post_type_id":"1","score":"2","tags":"ios|uiview|uiviewanimation","view_count":"809"} +{"id":"30974829","title":"how to draw a square in the centre of the screen in android","body":"\u003cp\u003eI am tring to draw a square in the center of the screen. I want there to be a slight margin to the left and right of the square so that is is away from the edge, the way I am trying to create it is below. The problem is that it will not display properly on all devices and that when the screen is tilted some of the square is cut off. I think this is because I use rectSide = 1000. does anybody know a better way to do this that will work on any screen size? \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eint rectside =1000;\ncanvas.drawRect(width/2 - rectSide/2,\n height/2 - rectSide/2,\n width/2 + rectSide/2,\n height/2 + rectSide/2, paint);\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"3","comment_count":"2","creation_date":"2015-06-22 08:05:15.917 UTC","last_activity_date":"2015-06-22 09:21:52.583 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4232109","post_type_id":"1","score":"0","tags":"java|android","view_count":"444"} +{"id":"42753148","title":"Exact same file path but different content","body":"\u003cp\u003eI have a REALLY strange thing happening! When I view a file (within the \"Program Files (x86)\" folder tree) in my file manager it has one content, but when I retrieve it through PHP CLI script using \u003ccode\u003efile_get_contents()\u003c/code\u003e it has different content (with some additional lines I added through the script earlier) - except if I run the CLI script in a prompt with admin rights, then I see the same content. How on earth is it possible that the same file can have different content based on the permissions of the user accessing the file? \u003cstrong\u003eIs that really possible, and if so where can I find more information on how it works?\u003c/strong\u003e I've never heard of such a thing in my 25+ years of computing and programming experience...\u003c/p\u003e\n\n\u003cp\u003eI have quatro-checked that the path is the same and checked in all kinds of ways that there isn't something else playing a trick on me - but I just can't find any possible explanations!\u003c/p\u003e\n\n\u003cp\u003eI'm running Windows 10.\u003c/p\u003e","accepted_answer_id":"42754997","answer_count":"1","comment_count":"5","creation_date":"2017-03-12 21:05:07.217 UTC","favorite_count":"1","last_activity_date":"2017-03-13 00:41:25.653 UTC","last_edit_date":"2017-03-12 21:39:09.22 UTC","last_editor_display_name":"","last_editor_user_id":"2404541","owner_display_name":"","owner_user_id":"2404541","post_type_id":"1","score":"0","tags":"php|windows|file","view_count":"34"} +{"id":"29738848","title":"DevExpress GridView Select \u0026 replace item in Cell?","body":"\u003cp\u003eIs there a way like in Windows Textbox control to replace the selected text with in a cell? I know that an entire cell can be done with \u003cem\u003eSetRowCellValue\u003c/em\u003e, but what about just a selection?\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","accepted_answer_id":"29810839","answer_count":"1","comment_count":"2","creation_date":"2015-04-20 03:25:34.07 UTC","last_activity_date":"2015-04-22 23:33:32.87 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4414701","post_type_id":"1","score":"0","tags":"vb.net|devexpress|devexpress-windows-ui","view_count":"288"} +{"id":"24309397","title":"\"Learn SQL The Hard Way\" - How to Setup Properly for Beginner?","body":"\u003cp\u003eI am a \u003cem\u003ebeginner\u003c/em\u003e attempting to learn SQL with \u003cstrong\u003eZed Shaw's\u003c/strong\u003e \u003ca href=\"http://sql.learncodethehardway.org/book/ex0.html\" rel=\"nofollow\"\u003e\"How to Learn SQL the Hard Way\"\u003c/a\u003e \u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003e\u003cem\u003eIn excercise 0: The Set up\u003c/em\u003e\u003c/strong\u003e, he states:\u003c/p\u003e\n\n\u003cp\u003e\u003cem\u003eThen, look to see that the test.db file is there. If that works then you're all set.\u003c/em\u003e\u003c/p\u003e\n\n\u003cp\u003eBut when I run the command,\u003c/p\u003e\n\n\u003cp\u003esqlite\u003e create table test (id);\n\u003cbr\u003e sqlite\u003e .quit\u003c/p\u003e\n\n\u003cp\u003ethe execution runs, but \u003cstrong\u003eit doesn't create a test.db file\u003c/strong\u003e. I looked in the \u003cstrong\u003esame folder as where the sqlite3.exe file\u003c/strong\u003e is and I see nothing.\u003c/p\u003e\n\n\u003cp\u003eI attempt to see if I can \u003cstrong\u003econtinue without this step\u003c/strong\u003e, then - In his next exercise, \"Excercise 1: Creating Tables\":\u003c/p\u003e\n\n\u003cp\u003eI input his commands, but when attempting to run \u003cstrong\u003esqlite3 ex1.db \u0026lt; ex1.sql\u003c/strong\u003e, it gives me an error.\u003c/p\u003e\n\n\u003cp\u003eI even tried putting the create table command and saving it as a '.sql' file into the same folder as sqlite3.exe.\u003c/p\u003e\n\n\u003cp\u003eHow can I set this environment up \u003cstrong\u003eproperly\u003c/strong\u003e? Can someone explain this on an \"easy to grasp\" level? Any response is appreciated**\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003ch2\u003eEdit 1\u003c/h2\u003e\n\n\u003cp\u003eI'm not exactly sure how Zed Shaw how he wants his learners to use SQLite 3, Maybe I can go into some research but I just don't understand why he leaves such a large gap of assumption that everyone knows what to do for the set up process...\u003c/p\u003e","answer_count":"1","comment_count":"10","creation_date":"2014-06-19 14:43:06.74 UTC","favorite_count":"1","last_activity_date":"2016-05-19 01:05:38.243 UTC","last_edit_date":"2014-06-24 14:20:32.773 UTC","last_editor_display_name":"","last_editor_user_id":"3756696","owner_display_name":"","owner_user_id":"3756696","post_type_id":"1","score":"-1","tags":"mysql|sql|database|sqlite|sqlite3","view_count":"1154"} +{"id":"47320316","title":"Creating a pandas column conditional to another columns values","body":"\u003cp\u003eI'm trying to create a class column in a pandas dataframe conditional another columns values. The value will be 1 if the other column's i+1 value is greater than the i value and 0 otherwise.\u003c/p\u003e\n\n\u003cp\u003eFor example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecolumn1 column2\n 5 1\n 6 0\n 3 0\n 2 1\n 4 0\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow do create column2 by iterating through column1?\u003c/p\u003e","accepted_answer_id":"47320377","answer_count":"2","comment_count":"0","creation_date":"2017-11-16 01:58:55.57 UTC","last_activity_date":"2017-11-16 04:40:01.95 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"8941092","post_type_id":"1","score":"0","tags":"python|pandas|numpy","view_count":"17"} +{"id":"20345617","title":"Position of array element","body":"\u003cp\u003eI'm working on program that should find the position of min and max element of array. The code I wrote finds the largest and smallest element but I can't figure out how to find the position it takes in array. Any tips would be greatly appreciated.\u003c/p\u003e\n\n\u003cp\u003eThat is what I have for now:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eint main ()\n{\n int i;\n float a[8] = {\n 1.90, 0.75, 3.30, 1.10, 2.00, 4.50, 0.80, 2.50\n }; /* array of ints */\n\n printf(\"\\nValues are: \\n\");\n for(i = 0; i \u0026lt; 8; i++)\n printf(\"%.2lf\\n\", a[i]);\n\n float max = a[0];\n float min = a[0];\n\n for (i = 0; i \u0026lt; 8; i++) {\n if (a[i] \u0026gt; max) {\n max = a[i];\n } else if (a[i] \u0026lt; min) {\n min = a[i];\n }\n }\n printf (\"Maximum element in an array : %.2f\\n\", max);\n printf (\"Minimum element in an array : %.2f\\n\", min);\n return 0;\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"20345651","answer_count":"2","comment_count":"6","creation_date":"2013-12-03 07:52:18.82 UTC","last_activity_date":"2013-12-03 08:13:05.563 UTC","last_edit_date":"2013-12-03 08:03:11.687 UTC","last_editor_display_name":"","last_editor_user_id":"1734130","owner_display_name":"","owner_user_id":"3055743","post_type_id":"1","score":"0","tags":"c","view_count":"90"} +{"id":"2826387","title":"delete all records except the id I have in a python list","body":"\u003cp\u003eI want to delete all records in a mysql db except the record id's I have in a list. The length of that list can vary and could easily contain 2000+ id's, ...\u003c/p\u003e\n\n\u003cp\u003eCurrently I convert my list to a string so it fits in something like this:\ncursor.execute(\"\"\"delete from table where id not in (%s)\"\"\",(list))\nWhich doesn't feel right and I have no idea how long list is allowed to be, ....\u003c/p\u003e\n\n\u003cp\u003eWhat's the most efficient way of doing this from python?\u003c/p\u003e\n\n\u003cp\u003eAltering the structure of table with an extra field to mark/unmark records for deletion would be great but not an option.\nHaving a dedicated table storing the id's would indeed be helpful then this can just be done through a sql query... but I would really like to avoid these options if possible.\u003c/p\u003e\n\n\u003cp\u003eThanks,\u003c/p\u003e","answer_count":"4","comment_count":"2","creation_date":"2010-05-13 11:37:05.613 UTC","favorite_count":"2","last_activity_date":"2010-05-13 15:06:02.4 UTC","last_edit_date":"2010-05-13 11:40:40.317 UTC","last_editor_display_name":"","last_editor_user_id":"97614","owner_display_name":"","owner_user_id":"340212","post_type_id":"1","score":"3","tags":"python|mysql","view_count":"1656"} +{"id":"12352527","title":"Can I set PHP's Interal Date and Time to months before?","body":"\u003cp\u003eI am wondering if I can \u003cstrong\u003echange PHP's overall date\u003c/strong\u003e, to think its really at about 2 months ago, or 2011 if I want. \u003c/p\u003e\n\n\u003cp\u003eIf it's \"\u003cem\u003eNo, you must use the DateTime class and set the system up to run through there\u003c/em\u003e\", that would be the chosen answer.\u003c/p\u003e\n\n\u003cp\u003eThe reason is because I have a massive project using an API thats based on many schedules. \u003c/p\u003e","accepted_answer_id":"12352591","answer_count":"2","comment_count":"0","creation_date":"2012-09-10 13:15:50.113 UTC","last_activity_date":"2012-09-10 13:30:20.443 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"216909","post_type_id":"1","score":"0","tags":"php|time","view_count":"34"} +{"id":"22234323","title":"Visual Studio 2012 Database Projects - File path configuration","body":"\u003cp\u003eI notice that when I am deploying a database from a VS2012 Database project that the physical file paths of my data files are bound to SQLCMD Variables ($(DefaultDataPath)$(DefaultFilePrefix) OR $(DefaultLogPath)$(DefaultFilePrefix)) depending on file type. \u003c/p\u003e\n\n\u003cp\u003eIf I had for example 4 files (primary, log, file1, file2) and I wanted to script this out to deploy each file on to a different drive (and possible folder schema) is there a way to configure this in Visual Studio? \u003c/p\u003e","accepted_answer_id":"22234870","answer_count":"1","comment_count":"0","creation_date":"2014-03-06 19:40:49.063 UTC","last_activity_date":"2014-03-06 20:10:28.19 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"798183","post_type_id":"1","score":"2","tags":"sql|sql-server|database|visual-studio-2012|database-project","view_count":"419"} +{"id":"30781992","title":"How to return a List from LinQ2Entity Query","body":"\u003cp\u003eI wish to return a list from the following LinQ query but I do not know how. Here is the query. What should the return type of the method be and how do I return it?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public IQueryable\u0026lt;object\u0026gt; getDNISData(int DNIS)\n {\n using (VPEntities VPCtx = new VPEntities())\n {\n var DD = \n from nm in VPCtx.NumberMaps\n join g in VPCtx.Greetings on nm.Greeting_ID equals g.Greeting_ID\n join p1 in VPCtx.Prompts on nm.Prompt1_ID equals p1.Prompt_ID\n join p2 in VPCtx.Prompts on nm.Prompt2_ID equals p2.Prompt_ID\n join p3 in VPCtx.Prompts on nm.Prompt3_ID equals p3.Prompt_ID\n join p4 in VPCtx.Prompts on nm.Prompt4_ID equals p4.Prompt_ID\n join p5 in VPCtx.Prompts on nm.Prompt5_ID equals p5.Prompt_ID\n join h1 in VPCtx.HoldMsgs on nm.HoldMsg1_ID equals h1.HoldMsg_ID\n join h2 in VPCtx.HoldMsgs on nm.HoldMsg2_ID equals h2.HoldMsg_ID\n join hm in VPCtx.HoldMusics on nm.HoldMusic_ID equals hm.HoldMusic_ID\n join d in VPCtx.Disclaimers on nm.Disclaimer_ID equals d.Disclaimer_ID\n where nm.DNIS == DNIS \u0026amp;\u0026amp; nm.Enabled \n select new {numberID = nm.Number_ID, portfolioID = nm.Portfolio_ID, propertyID = nm.Property_ID, adsource = nm.AdSource_ID\n planTypeID = nm.PlanType_ID, greetingFile = g.GreetingFile, \n PromptFile1 = p1.PromptFile, Accepts1 = p1.Accepts, PromptAction_ID1 = p1.PromptAction_ID, \n PromptFile2 = p2.PromptFile, Accepts2 = p2.Accepts, PromptAction_ID2 = p2.PromptAction_ID, \n PromptFile3 = p3.PromptFile, Accepts3 = p3.Accepts, PromptAction_ID3 = p3.PromptAction_ID,\n PromptFile4 = p4.PromptFile, Accepts4 = p4.Accepts, PromptAction_ID4 = p4.PromptAction_ID, \n PromptFile5 = p5.PromptFile, Accepts5 = p5.Accepts, PromptAction_ID5 = p5.PromptAction_ID,\n HoldMsgFile1 = h1.HoldMsgFile, HoldMsgFile2 = h2.HoldMsgFile,\n Destination1 = nm.Destination1, Destination2 = nm.Destination2, Destination3 = nm.Destination3,\n UIType_ID = nm.UIType_ID,\n RingCount = nm.RingCount,\n Enabled = nm.Enabled,\n Spanish = nm.Spanish,\n HoldMusicFile = hm.HoldMusicFile,\n Template_ID = nm.Template_ID,\n FrontLineForward = nm.FrontLineForward,\n DisclaimerFIle = d.DisclaimerFile};\n foreach (var item in DD){\n IQueryable\u0026lt;object\u0026gt;dd = new List\u0026lt;object\u0026gt;(DD);\n }\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"3","creation_date":"2015-06-11 13:20:16.47 UTC","last_activity_date":"2015-06-11 13:20:16.47 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2337023","post_type_id":"1","score":"0","tags":"c#|linq","view_count":"17"} +{"id":"43732576","title":"How to configure local hosts in Mac OS?","body":"\u003cp\u003eI have made changes in \u003ccode\u003e/etc/hosts\u003c/code\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e127.0.0.1 dev\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAfter uncommented line in http.conf:\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eInclude /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eAnd last I made changes in \u003ccode\u003eextra/httpd-vhosts.conf\u003c/code\u003e:\u003c/p\u003e\n\n\u003cp\u003eThis is full code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;VirtualHost *:80\u0026gt;\n DocumentRoot /Applications/MAMP/htdocs/\n ServerName localhost\n\u0026lt;/VirtualHost\u0026gt;\n\n\u0026lt;VirtualHost *:80\u0026gt;\n ServerAdmin someone@example.org\n DocumentRoot \"/Applications/MAMP/htdocs/dev\"\n ServerName dev\n ErrorLog \"logs/dev.loc-error_log\"\n CustomLog \"logs/dev.loc-access_log\" common\n\u0026lt;/VirtualHost\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAfter rebooting Apache and trying open URL \u003ccode\u003ehttp://dev\u003c/code\u003e I get nothing.\u003c/p\u003e\n\n\u003cp\u003eHow to solve this issue?\u003c/p\u003e","answer_count":"0","comment_count":"11","creation_date":"2017-05-02 07:37:55.713 UTC","favorite_count":"1","last_activity_date":"2017-05-02 07:45:45.883 UTC","last_edit_date":"2017-05-02 07:45:45.883 UTC","last_editor_display_name":"","last_editor_user_id":"7947165","owner_display_name":"","owner_user_id":"7947165","post_type_id":"1","score":"1","tags":"osx|apache|virtualhost|vhosts","view_count":"18"} +{"id":"10993628","title":"Mysql - Find field value that equals $variable echo another fields value for that row","body":"\u003cp\u003eany help/guidance would be greatly appreciated. Hope this makes sense.\u003c/p\u003e\n\n\u003cp\u003eI am trying to echo back from db a list of the users friends.\nThe current user comes form $userid.\u003c/p\u003e\n\n\u003cp\u003eDB structure:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCREATE TABLE IF NOT EXISTS `wallfriends` (\n `mem_id_from` int(11) NOT NULL,\n `mem_id_to` int(11) NOT NULL,\n `confirm` int(1) NOT NULL,\n `sender` int(11) NOT NULL DEFAULT '0'\n) ENGINE=MyISAM DEFAULT CHARSET=latin1;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe bit I am struggling with is to get the friends id from the db that is not the current $userid (Find field value that equals $userid echo another fields value for that row: so it could be mem_id_from OR mem_id_to).\u003c/p\u003e\n\n\u003cp\u003eBelow is my script, but i just cant get my head around the structure of what i need to code.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003e(modified from josnidhin's answer)\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;?php\n$my_friends = mysql_query('SELECT * from wallfriends WHERE (mem_id_from = '.$userid.') OR (mem_id_to = '.$userid.') AND confirm = 1');\n\n$available_friends = mysql_fetch_array($my_friends);\nforeach($available_friends as $friend)\n{\n if($friend['mem_id_from']=== $userid \u0026amp;\u0026amp; $friend['mem_id_to']!== $userid)\n {\n echo '\u0026lt;a href=\"'.$path.'profile.php?userid='.$friend['mem_id_to'].'\"\u0026gt;'\n echo '\u0026lt;img src=\"'.$post_avatar.'\" width=\"70px\" height=\"70px\" border=\"0\" alt=\"\" /\u0026gt;'\n echo '\u0026lt;/a\u0026gt;';\n } \n else if($friend['mem_id_from']!== $userid \u0026amp;\u0026amp; $friend['mem_id_to']=== $userid)\n {\n echo '\u0026lt;a href=\"'.$path.'profile.php?userid='.$friend['mem_id_from'].'\"\u0026gt;'\n echo '\u0026lt;img src=\"'.$post_avatar.'\" width=\"70px\" height=\"70px\" border=\"0\" alt=\"\" /\u0026gt;'\n echo '\u0026lt;/a\u0026gt;';\n }\n}\n\n\n ?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAfter josnidhin's answer, I tried:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$userid = '4276';\n\nprint_r($available_friends);\n\nArray ( [0] =\u0026gt; 3441 [mem_id_from] =\u0026gt; 3441 [1] =\u0026gt; 4276 [mem_id_to] =\u0026gt; 4276 [2] =\u0026gt; 1 [confirm] =\u0026gt; 1 [3] =\u0026gt; 3441 [sender] =\u0026gt; 3441 ) \n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"10993905","answer_count":"2","comment_count":"0","creation_date":"2012-06-12 09:13:20.073 UTC","last_activity_date":"2012-06-12 11:47:24.163 UTC","last_edit_date":"2012-06-12 09:49:16.203 UTC","last_editor_display_name":"","last_editor_user_id":"863643","owner_display_name":"","owner_user_id":"863643","post_type_id":"1","score":"0","tags":"php|mysql|arrays","view_count":"2636"} +{"id":"26425620","title":"Load environment settings from a string using Ruby's Dotenv?","body":"\u003cp\u003eI have a ruby system that relies heavily on having run-time settings in the system environment (it uses capistrano 2 a lot, but also for other things), but as I need it to be much more flexible that what loading some static \u003ccode\u003e.env\u003c/code\u003e files can do for me, I've set up some code that generates environment configurations on the fly.\u003c/p\u003e\n\n\u003cp\u003eCurrently the only way that I found to use those \"dynamic environments\" is to save them to a temporary file so that \u003ccode\u003eDotenv.load\u003c/code\u003e can read them - which sounds incredibly silly to me.\u003c/p\u003e\n\n\u003cp\u003eI've perused the (very limited) \u003ca href=\"http://www.rubydoc.info/gems/dotenv/Dotenv/Environment\" rel=\"nofollow\"\u003eDotenv documentation\u003c/a\u003e but there doesn't seem to be a call to get Dotenv to parse a string instead of a file. Any idea how to do that?\u003c/p\u003e","accepted_answer_id":"26425794","answer_count":"1","comment_count":"0","creation_date":"2014-10-17 13:01:36.807 UTC","last_activity_date":"2014-10-18 10:45:54.563 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"53538","post_type_id":"1","score":"0","tags":"ruby|environment","view_count":"408"} +{"id":"6748428","title":"Can OCR software read stencil markings on a box?","body":"\u003cp\u003eI work for the US Army and want to develop a device that will scan the stencil markings on a box. Then with software OCR the data captured on the scan. My engineers took a box with stencil markings and scanned it with an office scanner. They tried to use Adobe Acrobat but it didn't recognize the lettering since stencil markngs have gaps within each letter.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2011-07-19 14:03:24.943 UTC","last_activity_date":"2011-08-26 21:27:19.917 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"852137","post_type_id":"1","score":"0","tags":"ocr","view_count":"258"} +{"id":"24437265","title":"Search products using taxon_id in SpreeCommerce API","body":"\u003cp\u003eI am trying to search products from the SpreeCommerce API using \u003ccode\u003etaxon_ids\u003c/code\u003e as the filter. \u003ca href=\"http://guides.spreecommerce.com/api/products.html#search\" rel=\"nofollow\"\u003eThe search api\u003c/a\u003e uses the ransack gem \u003ca href=\"https://github.com/activerecord-hackery/ransack/wiki/Basic-Searching\" rel=\"nofollow\"\u003epredicates\u003c/a\u003e for searching. I have tried:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e/api/products?q[taxon_ids_cont]=x\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e(where x is an id of a taxon ). I have also tried: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e/api/products?q[taxon_ids_in]=x\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand both return a json of all products without filtering. What parameters should I use on the \u003ccode\u003eproducts\u003c/code\u003e endpoint to fetch products filtered by \u003ccode\u003etaxon_ids\u003c/code\u003e or How else can i solve this problem?\u003c/p\u003e","accepted_answer_id":"24476632","answer_count":"1","comment_count":"0","creation_date":"2014-06-26 18:03:21.693 UTC","last_activity_date":"2016-05-17 19:04:33.983 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2586680","post_type_id":"1","score":"1","tags":"ruby-on-rails|api|spree","view_count":"1223"} +{"id":"4032028","title":"Javascript: Building an array with a variable","body":"\u003cp\u003eIs it possible to take the contents of a variable and stick it into an array like so (I've tried to no avail):\u003c/p\u003e\n\n\u003cp\u003eFirst I get these values from a database and using php form into a hidden input:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{value: '1', name: 'name1'},{value: '2', name: 'name2'}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThen collect with javascript\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edocument.getElementById(\"myelement\").value\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThen put the value \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar meval = document.getElementById(\"myelement\").value;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd then I try to build the data like so:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar data = {items: [meval]};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf I do this \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar data = {items: [{value: '1', name: 'name1'},{value: '2', name: 'name2'}]};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eit works but not the initial way with the variable. And I have to build the original data like that.\u003c/p\u003e","accepted_answer_id":"4032088","answer_count":"5","comment_count":"1","creation_date":"2010-10-27 10:09:22.72 UTC","favorite_count":"0","last_activity_date":"2010-10-27 11:11:16.067 UTC","last_edit_date":"2010-10-27 10:16:06.08 UTC","last_editor_display_name":"","last_editor_user_id":"102441","owner_display_name":"","owner_user_id":"40376","post_type_id":"1","score":"1","tags":"javascript|arrays|variables|multidimensional-array","view_count":"818"} +{"id":"11919290","title":"Python Port Listener","body":"\u003cp\u003eI would like to code a Python program that listens on a range of ports for incoming sin requests (possibly ack and fin as well). I then want this program to log the time, ip, and port of these sent packets. \u003c/p\u003e\n\n\u003cp\u003eOnly thing is I really don't know where to start. I don't want anyone to hold my hand here, but I do need someone to point me in the right direction\u003c/p\u003e","answer_count":"2","comment_count":"1","creation_date":"2012-08-12 02:40:10.65 UTC","last_activity_date":"2012-08-12 03:53:13.753 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1577775","post_type_id":"1","score":"0","tags":"python","view_count":"1024"} +{"id":"5441220","title":"private global vs. public global","body":"\u003cp\u003eWhat's the difference between the export of a symbol by using \"public global\" instead of \"private global\"?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2011-03-26 08:36:44.637 UTC","last_activity_date":"2011-11-28 22:58:04.573 UTC","last_edit_date":"2011-03-26 20:22:27.37 UTC","last_editor_display_name":"","last_editor_user_id":"49246","owner_display_name":"","owner_user_id":"547231","post_type_id":"1","score":"0","tags":"nasm|assembly","view_count":"78"} +{"id":"20260809","title":"Convert flat list to objects","body":"\u003cp\u003eI am trying to convert a flat structure into a hierarchy.\u003c/p\u003e\n\n\u003cp\u003eThe list looks like this where personid, first and lastname occurs more than once:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class VisitType\n{\n public Guid Id { get; set; }\n public Guid PersonId { get; set; }\n public string FirstName { get; set; }\n public string LastName { get; set; }\n\n public string VisitName { get; set; }\n\n public DateTime TimeFrom { get; set; }\n public DateTime TimeTo { get; set; }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd I want to convert it to look like this instead where the client only occurs once and every visit is grouped under:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class Client {\n\n public String FirstName { get; set; }\n public string LastName { get; set; }\n public Guid PersonId { get; set; }\n\n public Visit[] Visits { get; set; }\n}\npublic class Visit {\n\n public string Name { get; set; }\n public DateTime StartBefore { get; set; }\n public DateTime StartAfter { get; set; }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat is the fastest way to do it? \u003c/p\u003e","accepted_answer_id":"20261038","answer_count":"2","comment_count":"3","creation_date":"2013-11-28 08:12:32.783 UTC","last_activity_date":"2013-11-28 09:44:39.523 UTC","last_edit_date":"2013-11-28 08:23:52.133 UTC","last_editor_display_name":"","last_editor_user_id":"2860193","owner_display_name":"","owner_user_id":"2878428","post_type_id":"1","score":"2","tags":"c#","view_count":"161"} +{"id":"5248567","title":"Creation of multiple rulers using wx python rulercntl","body":"\u003cp\u003eI need to write a gui that contains multiple rulers permitting users to select starting and ending values that will be passed to later code. The wx.lib.rulercntl seems to have everything I need. I'm new to wxpython and don't know how to go about doing this. Has anyone done something similar? I've found some documentation on rulercntl, but don't comprehend it.\u003c/p\u003e\n\n\u003cp\u003eThanks in advance for any help,\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2011-03-09 16:09:04.47 UTC","last_activity_date":"2011-03-10 21:51:58.537 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"524527","post_type_id":"1","score":"0","tags":"wxpython","view_count":"248"} +{"id":"33238913","title":"Fast vectorized indexing in numpy","body":"\u003cp\u003eSuppose we have an array of indices of another numpy array:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport numpy as np\na = np.array([0, 3, 1])\nb = np.array([0, 10, 20, 30, 40, 50, 60, 70])\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWe can use the array \u003ccode\u003ea\u003c/code\u003e as index directly:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eb[a] # np.array([0, 30, 10])\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut what if array a has more than one dimension? For example,\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ea = np.array([[0, 2], [1, 3], [2, 4]])\n# I want to get b[a] = np.array([[0, 20], [10, 30], [20, 40]])\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNumpy indexing doesn't work if the number of dimensions of a is greater than 1. We can achieve the desired result by using \u003ccode\u003emap\u003c/code\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emap(lambda x: b[x], a)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, it is quite slow. For 1-dimensional case, direct indexing is about 10-100 times faster than using \u003ccode\u003emap\u003c/code\u003e. \u003c/p\u003e\n\n\u003cp\u003eIs there a way to do it faster?\u003c/p\u003e","accepted_answer_id":"33238944","answer_count":"2","comment_count":"2","creation_date":"2015-10-20 14:05:50.833 UTC","last_activity_date":"2015-10-20 17:06:22.39 UTC","last_edit_date":"2015-10-20 14:22:34.47 UTC","last_editor_display_name":"","last_editor_user_id":"3293881","owner_display_name":"","owner_user_id":"3642151","post_type_id":"1","score":"1","tags":"arrays|performance|numpy|vectorization|python-2.x","view_count":"74"} +{"id":"39595052","title":"How to integrate css from node_moduels in anguler2 seed project?","body":"\u003cp\u003eI'm integrating \u003ca href=\"http://leafletjs.com/\" rel=\"nofollow\"\u003eleaflet\u003c/a\u003e into an \u003ca href=\"https://mgechev.github.io/angular2-seed/\" rel=\"nofollow\"\u003eanguler2-seed\u003c/a\u003e project.\u003c/p\u003e\n\n\u003cp\u003eBasically it was just npm intalling leaflet and using in a leaflet component:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport {Component, OnInit} from '@angular/core';\nimport 'leaflet/dist/leaflet.js';\n\ndeclare let L: any;\n\n/**\n * This class represents the leaflet integration.\n */\n@Component({\n selector: 'el-leaflet',\n template: '\u0026lt;div id=\"leaflet-map\"\u0026gt;\u0026lt;/div\u0026gt;',\n styles: [`\n #leaflet-map {\n width: 500px;\n height: 500px;\n }\n `]\n})\nexport class LeafletComponent {}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eTo include the leaflet css file I add it to my \u003ccode\u003eproject.config.ts\u003c/code\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ethis.NPM_DEPENDENCIES = [\n ...this.NPM_DEPENDENCIES,\n {src: 'leaflet/dist/leaflet.css', inject: true}\n];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis works fine. But feals wrong to me. Because this causes the \u003ccode\u003eleaflet.css\u003c/code\u003e to be loaded for the whole application, even if the map is never used. Is there a way to isolate the inclution of \u003ccode\u003eleaflet.css\u003c/code\u003e in the leaflet component.\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2016-09-20 13:10:42.337 UTC","last_activity_date":"2016-09-20 13:10:42.337 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"671639","post_type_id":"1","score":"1","tags":"css|angular|leaflet","view_count":"115"} +{"id":"43795510","title":"datatable not create correct value when using date to calculate","body":"\u003cp\u003eI have a \u003ccode\u003edata\u003c/code\u003e and want to create some new columns based on original \u003ccode\u003edata\u003c/code\u003e. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eTime1 Time2 value number\n2015-01-01 NA 1724 1\n2015-01-01 2015-01-03 2946 1\n2015-01-01 2015-01-03 -2946 -1\n2016-12-09 NA -2182 -1\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI explain what I want to do:\u003cbr\u003e\n1. I want to create 4 new columns(\u003ccode\u003eBegin\u003c/code\u003e, \u003ccode\u003eEnd\u003c/code\u003e, \u003ccode\u003eMonthEnd\u003c/code\u003e, \u003ccode\u003evalue2\u003c/code\u003e).\u003cbr\u003e\n2. \u003ccode\u003eTime1\u003c/code\u003e, \u003ccode\u003eTime2\u003c/code\u003e, \u003ccode\u003eBegin\u003c/code\u003e, \u003ccode\u003eEnd\u003c/code\u003e, \u003ccode\u003eMonthEnd\u003c/code\u003e are date format(\u003ccode\u003ePOSIXct format\u003c/code\u003e)\u003cbr\u003e\n3. \u003ccode\u003evalue\u003c/code\u003e and \u003ccode\u003evalue2\u003c/code\u003e are numeric.\u003cbr\u003e\n4. \u003ccode\u003enumber\u003c/code\u003e is character.\u003cbr\u003e\n5. IF \u003ccode\u003enumber\u003c/code\u003e=1 THEN \u003ccode\u003eBegin\u003c/code\u003e=\u003ccode\u003eTime1\u003c/code\u003e; IF \u003ccode\u003enumber\u003c/code\u003e=-1 and \u003ccode\u003eTime2\u003c/code\u003e not equal to NA THEN \u003ccode\u003eBegin\u003c/code\u003e=\u003ccode\u003eTime2\u003c/code\u003e; else \u003ccode\u003eBegin\u003c/code\u003e=\u003ccode\u003eTime1\u003c/code\u003e.\u003cbr\u003e\n6. \u003ccode\u003eEnd\u003c/code\u003e is next year of \u003ccode\u003eTime1\u003c/code\u003e. (ex. \u003ccode\u003eTime1\u003c/code\u003e=2015-01-01, \u003ccode\u003eEnd\u003c/code\u003e=2016-01-01)\u003cbr\u003e\n7. \u003ccode\u003eMonthEnd\u003c/code\u003e is the \u003cem\u003elast day of month\u003c/em\u003e of \u003ccode\u003eTime1\u003c/code\u003e. (ex. \u003ccode\u003eTime1\u003c/code\u003e=2015-01-01, \u003ccode\u003eMonthEnd\u003c/code\u003e=2015-01-31. Since last day of Jan is 31) \u003c/p\u003e\n\n\u003cp\u003eFirst, I create these new columns: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edata[,Begin:= Time2][number==1, Begin:= Time1][is.na(Begin), Begin:= Time1][]\ndata[,End:=Time1+months(12)]\ndata[,MonthEnd:=Time1]\nday(data$MonthEnd) \u0026lt;- days_in_month(data$Time1)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eTherefore, the result based on above code is: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eTime1 Time2 Begin End MonthEnd value number\n2015-01-01 NA 2015-01-01 2016-01-01 2015-01-31 1724 1\n2015-01-01 2015-01-03 2015-01-01 2016-01-01 2015-01-31 2946 1\n2015-01-01 2015-01-03 2015-01-03 2016-01-01 2015-01-31 -2946 -1\n2016-12-09 NA 2016-12-09 2017-12-09 2016-12-31 -2182 -1\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSecond, I create \u003ccode\u003evalue2\u003c/code\u003e based on above new \u003ccode\u003edata\u003c/code\u003e: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edata[, value2 := value*pmax(0,MonthEnd - Begin) / as.numeric(End - Time1)]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI get: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evalue2\n12242762\n20920636\n-19525926.58 \n-11363138.6\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, this is false.\u003cbr\u003e\nTake first obs. as an example. This is the true value. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eTime1 = as.Date(\"2015-01-01\")\nBegin = as.Date(\"2015-01-01\")\nEnd = as.Date(\"2016-01-01\")\nMonthEnd = as.Date(\"2015-01-31\")\nvalue2 = value * max(0,MonthEnd - Begin) / as.numeric(End - Time1)\nvalue2\n[1] 141.6986\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is the \u003ccode\u003estr(data)\u003c/code\u003e: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eClasses ‘data.table’ and 'data.frame': 105907 obs. of 7 variables:\n$ Time1 : POSIXct, format: \"2015-01-01\" \"2015-01-01\" \"2015-01-01\" \"2015-01-01\" ...\n$ Time2 : POSIXct, format: NA \"2015-01-03\" \"2015-01-03\" NA ...\n$ Begin : POSIXct, format: \"2015-01-01\" \"2015-01-01\" \"2015-01-01\" \"2015-01-01\" ...\n$ End : POSIXct, format: \"2016-01-01\" \"2016-01-01\" \"2016-01-01\" \"2016-01-01\" ...\n$ MonthEnd : POSIXct, format: \"2015-01-31\" \"2015-01-31\" \"2015-01-31\" \"2015-01-31\" ...\n$ value : num 1724 2946 -2946 -2182 ...\n$ number : chr \"1\" \"1\" \"-1\" \"-1\" ...\n- attr(*, \".internal.selfref\")=\u0026lt;externalptr\u0026gt; \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMoreover, I test whether date format(\u003ccode\u003ePOSIXct format\u003c/code\u003e) influences the result. So I try: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eTime1 \u0026lt;- as.POSIXct(\"2015-01-01\")\nBegin \u0026lt;- as.POSIXct(\"2015-01-01\")\nEnd \u0026lt;- as.POSIXct(\"2016-01-01\")\nMonthEnd \u0026lt;- as.POSIXct(\"2015-01-31\")\nvalue \u0026lt;- 1724\nvalue2 \u0026lt;- value * pmax(0, MonthEnd - Begin) / as.numeric(End - Time1)\nvalue2\n[1] 141.6986\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThus, I think this problem is due to \u003ccode\u003edata.table\u003c/code\u003e.\u003cbr\u003e\nIs \u003ccode\u003edatatable\u003c/code\u003e cannot create correct value with calculating date? Bug? Or my code is wrong?\u003cbr\u003e\nAny suggestion? Appreciate.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eUPDATE\u003c/strong\u003e \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esessionInfo()\nR version 3.3.3 (2017-03-06)\nPlatform: i386-w64-mingw32/i386 (32-bit)\nRunning under: Windows 7 (build 7601) Service Pack 1\n\nlocale:\n[1] LC_COLLATE=Chinese (Traditional)_Taiwan.950 LC_CTYPE=Chinese (Traditional)_Taiwan.950 \n[3] LC_MONETARY=Chinese (Traditional)_Taiwan.950 LC_NUMERIC=C \n[5] LC_TIME=Chinese (Traditional)_Taiwan.950 \n\nattached base packages:\n[1] stats graphics grDevices utils datasets methods base \n\nother attached packages:\n[1] dplyr_0.5.0 lubridate_1.6.0 readxl_1.0.0 data.table_1.10.4\n\nloaded via a namespace (and not attached):\n [1] lazyeval_0.2.0 magrittr_1.5 R6_2.2.0 assertthat_0.1 DBI_0.5-1 tools_3.3.3 tibble_1.2 \n [8] Rcpp_0.12.9 cellranger_1.1.0 stringi_1.1.2 stringr_1.1.0 \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eProblem Solved\u003c/strong\u003e\u003cbr\u003e\nThe problem is \u003ccode\u003ePOSIXct, format\u003c/code\u003e.\u003cbr\u003e\nR considers these date columns to calculate with \u003ccode\u003eseconds units\u003c/code\u003e.\u003cbr\u003e\nThus, using \u003ccode\u003edifftime()\u003c/code\u003e and set \u003ccode\u003eunits = 'day'\u003c/code\u003e will work.\u003cbr\u003e\nOr, \u003ccode\u003eas.Date()\u003c/code\u003e will work as well.\u003c/p\u003e","accepted_answer_id":"44185901","answer_count":"2","comment_count":"7","creation_date":"2017-05-05 02:24:54.267 UTC","favorite_count":"0","last_activity_date":"2017-05-26 07:03:00.517 UTC","last_edit_date":"2017-05-26 07:03:00.517 UTC","last_editor_display_name":"","last_editor_user_id":"7651845","owner_display_name":"","owner_user_id":"7651845","post_type_id":"1","score":"0","tags":"r|data.table|data-manipulation|lubridate","view_count":"80"} +{"id":"41097235","title":"C++ rle bmp compression skips last bytes","body":"\u003cp\u003eI'm writing a rle compression for bmp files. (it is a part of bigger project) The encode function takes a file containing only pixels (without headers). And everything works well except that it doesn't compress few last bytes (depending on file size I guess). De compression also works well. \nThanks in advance for any help! \u003c/p\u003e\n\n\u003cp\u003eHere's the code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e #include \u0026lt;string\u0026gt;\n#include \u0026lt;fstream\u0026gt;\n#include \u0026lt;iostream\u0026gt;\n\nusing namespace std;\n\ntypedef struct SPixel {\n uint8_t red; \n uint8_t green;\n uint8_t blue;\n}PIXEL;\n\nbool compare(SPixel pixel1, SPixel pixel2) {\n if (pixel1.red == pixel2.red \u0026amp;\u0026amp; pixel1.green == pixel2.green \u0026amp;\u0026amp; pixel1.blue == pixel2.blue)\n return true;\n else return false;\n}\n\nvoid encode(string \u0026amp;input, string \u0026amp;output){\n unsigned short repetition = 1;\n PIXEL current;\n PIXEL next;\n\n fstream file;\n fstream compressed;\n file.open(input, ios::in | ios::binary);\n if (!file.is_open()) {\n cout \u0026lt;\u0026lt; \"cannot open file to encode.\" \u0026lt;\u0026lt; endl;\n getchar();\n exit(1);\n }\n\n compressed.open(output, ios::out | ios::trunc | ios::binary);\n if (!compressed.is_open()) {\n cout \u0026lt;\u0026lt; \"cannot open file to save encoded file.\" \u0026lt;\u0026lt; endl;\n getchar();\n exit(1);\n }\n\n file.read((char*)\u0026amp;current, sizeof(PIXEL));\n file.read((char*)\u0026amp;next, sizeof(PIXEL));\n\n while (!file.eof())\n if (!compare(current, next)) {\n compressed.write((char*)\u0026amp;repetition, sizeof(repetition));\n compressed.write((char*)\u0026amp;current, sizeof(PIXEL));\n repetition = 0;\n }\n repetition++;\n current = next;\n file.read((char*)\u0026amp;next, sizeof(PIXEL));\n }\n\n file.close();\n compressed.close();\n}\n\nvoid decode(string \u0026amp;input, string \u0026amp;output) {\n fstream file;\n fstream ready;\n PIXEL current;\n unsigned short repetition = 0;\n\n file.open(input, ios::in | ios::binary);\n if (!file.is_open()) {\n cout \u0026lt;\u0026lt; \"cannot open file to decode.\" \u0026lt;\u0026lt; endl;\n getchar();\n exit(1);\n }\n ready.open(output, ios::trunc | ios::out | ios::binary);\n if (!ready.is_open()) {\n cout \u0026lt;\u0026lt; \"cannot open file to save decoded file.\" \u0026lt;\u0026lt; endl;\n getchar();\n exit(1);\n }\n\n while (!file.eof()){\n file.read((char*)\u0026amp;repetition, sizeof(repetition));\n file.read((char*)\u0026amp;current, sizeof(PIXEL));\n for (int j = 0; j \u0026lt; repetition; j++)\n ready.write((char*)\u0026amp;current, sizeof(PIXEL));\n }\n\n file.close();\n ready.close();\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"41098112","answer_count":"1","comment_count":"1","creation_date":"2016-12-12 08:59:35.417 UTC","last_activity_date":"2016-12-12 09:53:09.337 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7283949","post_type_id":"1","score":"0","tags":"c++|bmp","view_count":"166"} +{"id":"43629611","title":"Appending Unique Records into a Table","body":"\u003cp\u003eI'm trying to append LastLogin_Date table with only unique records based on LastLogin_Date field.\u003c/p\u003e\n\n\u003cp\u003eIf I run following query, it returns 'Record is deleted'.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eINSERT INTO LastLogIn_SnapShots ( Name, Surname, Forename, LastLogin_Date )\nSELECT dbo_Site.Name, dbo_AppUser.Surname, dbo_AppUser.Forename, dbo_AppUser.LastLogin_Date\n\nFROM dbo_AppUser LEFT JOIN dbo_Site ON dbo_AppUser.Employee_Site_ID = dbo_Site.ID\n\nWHERE ((dbo_AppUser.LastLogin_Date Not In (SELECT LastLogin_Date FROM LastLogIn_SnapShots WHERE LastLogin_Date is not null)) AND (dbo_AppUser.Employment_End) Is Null);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eObviously, problem lies in WHERE clause, but if I turn it in simple SELECT query it pulls correct data.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT LastLogin_Date\nFROM dbo_AppUser\n\nWHERE ((LastLogin_Date Not In (SELECT LastLogin_Date FROM LastLogIn_SnapShots WHERE LastLogin_Date is not null)) AND (dbo_AppUser.Employment_End) Is Null);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ePlease help to identify the problem.\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2017-04-26 09:03:09.697 UTC","last_activity_date":"2017-04-26 11:24:42.483 UTC","last_edit_date":"2017-04-26 11:24:42.483 UTC","last_editor_display_name":"","last_editor_user_id":"3449393","owner_display_name":"","owner_user_id":"7772927","post_type_id":"1","score":"0","tags":"sql|append|access","view_count":"40"} +{"id":"18036658","title":"android eclipse: switch activity briefly shows previous activity screen","body":"\u003cp\u003eI am sure this is a basic question, but I'm developing an Android app using ADK and Eclipse.\u003c/p\u003e\n\n\u003cp\u003eWhen I try to transition Activities, the screen goes black and then briefly shows the previous activity screen before \"flipping\" to the new screen.\u003c/p\u003e\n\n\u003cp\u003eI don't have any custom transitions; I'm using the default.\u003c/p\u003e\n\n\u003cp\u003eI don't have much going on in my onCreate event (EXCEPT: I load my background image during onCreate! Could it be this?)\u003c/p\u003e\n\n\u003cp\u003eI really am looking at a very snappy transition, like a game like Words with Friends, where it appears to switch \"instantly\".\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2013-08-03 19:47:57.58 UTC","last_activity_date":"2013-08-04 00:40:23.823 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"24126","post_type_id":"1","score":"0","tags":"java|android|adk","view_count":"138"} +{"id":"37777714","title":"Mysql query from 3 tables and where clause","body":"\u003cp\u003eI have 3 tables in my Database\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e# Items\nid - name \n----------\n1 - Item A \n2 - Item B \n3 - Item C \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e# Traits \nid - name \n----------\n1 - Color\n2 - Grade\n3 - Size\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e# Values \nid - item_id - trait_id - value \n----------\n1 - 1 - 1 - red \n1 - 2 - 1 - green \n1 - 3 - 1 - red \n1 - 1 - 2 - 90% \n1 - 2 - 2 - 45% \n1 - 3 - 2 - 80%\n1 - 1 - 3 - 4 inches\n1 - 2 - 3 - 5 inches\n1 - 3 - 3 - 9 inches\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn Laravel, I could get all items with their traits and values using \"belongsTo\" [$this-\u003ebelongsTo('App\\Traits','trait_id');] in Value model to get the results like so :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e--- Item A \nColor: red\nGrade: 90%\nSize: 4 inches\n\n--- Item B \nColor: green\nGrade: 45%\nSize: 5 inches\n\n.. etc \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003efrom code like this :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$items = Items::get();\nforeach ($items as $item) {\n echo '\u0026lt;h2\u0026gt;'.$item-\u0026gt;name.'\u0026lt;/h2\u0026gt;';\n foreach ($item-\u0026gt;values as $value) {\n echo '\u0026lt;b\u0026gt;'.$value-\u0026gt;trait-\u0026gt;name . '\u0026lt;/b\u0026gt;: ';\n echo $value-\u0026gt;value . '\u0026lt;br\u0026gt;';\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eHowever, what I couldn't do is that I need to filter these results, for examples, I only need Items that its color is \"red\" and its grade bigger than 70% ?\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eIf you don't use Larave, feel free to write it in pure mysql queries, I may find a way to do it in Laravel when I get the idea.. Thank you\u003c/p\u003e","accepted_answer_id":"37780286","answer_count":"1","comment_count":"2","creation_date":"2016-06-12 18:30:10.533 UTC","last_activity_date":"2016-06-13 07:31:15.31 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5762795","post_type_id":"1","score":"1","tags":"php|mysql|laravel","view_count":"47"} +{"id":"31664860","title":"Bottom layout on a navigation drawer Android","body":"\u003cp\u003eTrying to add a footer to a navigation drawer that consists of two lists. I am not doing this right, I understood that anything that i want in the navigation drawer should be encapsulated in the \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;LinearLayout\n android:id=\"@+id/left_drawer_layout\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI would like to add a bottom layout that does not depend on ListView scroll. I tried different versions of where to add the bottom layout code but nothing happens. I need an extra eye, please. Thank you.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;android.support.v4.widget.DrawerLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:id=\"@+id/drawer_layout\"\n android:layout_width=\"fill_parent\"\n android:layout_height=\"match_parent\"\n android:background=\"@android:color/white\"\u0026gt;\n\n \u0026lt;LinearLayout\n android:layout_width=\"match_parent\"\n android:layout_height=\"fill_parent\"\n android:orientation=\"vertical\"\u0026gt;\n\n \u0026lt;include\n android:id=\"@+id/toolbar\"\n layout=\"@layout/toolbar”/\u0026gt;\n\n\n\n \u0026lt;!-- Framelayout to display Fragments --\u0026gt;\n\n \u0026lt;FrameLayout\n android:id=\"@+id/frame_container\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"0dp\"\n android:layout_weight=\"1\" /\u0026gt;\n\n \u0026lt;/LinearLayout\u0026gt;\n\n\n \u0026lt;!-- Listview to display slider menu --\u0026gt;\n\n \u0026lt;LinearLayout\n android:id=\"@+id/left_drawer_layout\"\n android:layout_width=\"@dimen/navigation_drawer_max_width\"\n android:layout_height=\"match_parent\"\n android:layout_gravity=\"start\"\n android:orientation=\"vertical\"\u0026gt;\n\n\n \u0026lt;FrameLayout\n android:layout_width=\"match_parent\"\n android:layout_height=\"48dp\"\n android:background=\"@color/list_background\"\u0026gt;\n\n \u0026lt;Button\n android:id=\"@+id/refreshBtn\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"48dp\"\n android:text=\"@string/refresh\"\n android:visibility=\"gone\" /\u0026gt;\n\n \u0026lt;EditText\n android:id=\"@+id/searchMenuTxt\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"48dp\"\n android:background=\"@color/list_background_pressed\"\n android:drawableLeft=\"@drawable/search_web\"\n android:drawablePadding=\"@dimen/activity_horizontal_margin\"\n android:drawableStart=\"@drawable/search_web\"\n android:focusable=\"false\"\n android:focusableInTouchMode=\"true\"\n android:hint=\"@string/search\"\n android:paddingLeft=\"8dp\"\n android:singleLine=\"true\"\n android:textColorHint=\"@android:color/darker_gray\"\n android:textSize=\"@dimen/text_size_14\"\u0026gt;\u0026lt;/EditText\u0026gt;\n\n \u0026lt;Button\n android:id=\"@+id/clearBtn\"\n android:layout_width=\"24dp\"\n android:layout_height=\"24dp\"\n android:layout_gravity=\"right|center\"\n android:background=\"@drawable/mob_clear\"\n android:paddingRight=\"8dp\"\n android:visibility=\"invisible\" /\u0026gt;\n\n \u0026lt;/FrameLayout\u0026gt;\n\n \u0026lt;LinearLayout\n android:id=\"@+id/left_drawer\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"match_parent\"\n android:orientation=\"vertical\"\u0026gt;\n\n \u0026lt;ListView\n android:id=\"@+id/activeChatsList\"\n android:layout_width=\"@dimen/navigation_drawer_max_width\"\n android:layout_height=\"wrap_content\"\n android:layout_gravity=\"start\"\n android:background=\"@color/list_background_pressed\"\n android:choiceMode=\"singleChoice\"\n android:divider=\"@drawable/list_divider\"\n android:dividerHeight=\"1dp\"\n android:fadeScrollbars=\"false\"\n android:fastScrollEnabled=\"false\" /\u0026gt;\n\n \u0026lt;ListView\n android:id=\"@+id/drawerListView\"\n android:layout_width=\"@dimen/navigation_drawer_max_width\"\n android:layout_height=\"match_parent\"\n android:layout_gravity=\"start\"\n android:background=\"@drawable/list_selector\"\n android:choiceMode=\"singleChoice\"\n android:divider=\"@drawable/list_divider\"\n android:dividerHeight=\"1dp\"\n android:drawSelectorOnTop=\"true\"\n android:fastScrollEnabled=\"false\"\n android:minHeight=\"250dp\" /\u0026gt;\n \u0026lt;LinearLayout\n android:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n android:layout_weight=\"1\"\n android:layout_alignParentBottom=\"true\"\u0026gt;\n\n \u0026lt;Button android:id=\"@+id/CancelButton\" android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\" android:text=“Profile\" /\u0026gt;\n \u0026gt;\n\n \u0026lt;/LinearLayout\u0026gt;\n \u0026lt;/LinearLayout\u0026gt;\n\n\n \u0026lt;/LinearLayout\u0026gt;\n\n\u0026lt;/android.support.v4.widget.DrawerLayout\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"31889830","answer_count":"8","comment_count":"5","creation_date":"2015-07-27 23:12:17.683 UTC","favorite_count":"2","last_activity_date":"2015-08-08 05:22:01.443 UTC","last_edit_date":"2015-08-04 05:32:52.767 UTC","last_editor_display_name":"","last_editor_user_id":"3101777","owner_display_name":"","owner_user_id":"1140656","post_type_id":"1","score":"12","tags":"android|android-layout","view_count":"4037"} +{"id":"6411368","title":"Errors on whitespace?","body":"\u003cp\u003eSo I am trying to compile a set of C files written by someone else, and I am continually getting the following error:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eTBin.h:10: error: expected '=', ',',\n ';', 'asm' or '\u003cem\u003eattribute\u003c/em\u003e' before\n 'TBin'\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eThis is occurring in a .h file, which currently has a \u003ccode\u003e#ifndef\u003c/code\u003e and \u003ccode\u003e#define\u003c/code\u003e before the class definition. The line itself is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass TBin {\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThere is nothing else before that in the file, no includes, no comments, no random bits of anything. Even if I remove the guards and move the declaration right up to the top of the file, I get the same error. I thought this could only occur if there was an issue in the preceding code, but I have no preceding code! Ideas?\u003c/p\u003e","accepted_answer_id":"6411426","answer_count":"3","comment_count":"2","creation_date":"2011-06-20 12:47:40.91 UTC","last_activity_date":"2011-06-20 13:06:42.397 UTC","last_edit_date":"2011-06-20 12:55:33.033 UTC","last_editor_display_name":"","last_editor_user_id":"149530","owner_display_name":"","owner_user_id":"800100","post_type_id":"1","score":"0","tags":"c++|header-files","view_count":"1123"} +{"id":"8652766","title":"Returning Guid of newly created item in Sharepoint Library","body":"\u003cp\u003eI am using the method \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eFile.SaveBinaryDirect \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ein \u003cem\u003eMicrosoft.SharePoint.Client\u003c/em\u003e to insert new documents in a Sharepoint Library. just wondering what is the most effective way of getting the Guids of those new records.\u003c/p\u003e","accepted_answer_id":"8822450","answer_count":"1","comment_count":"3","creation_date":"2011-12-28 06:45:34.593 UTC","favorite_count":"1","last_activity_date":"2012-01-21 19:26:26.63 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"210462","post_type_id":"1","score":"2","tags":"c#|sharepoint|sharepoint-clientobject|client-object-model","view_count":"2403"} +{"id":"25238291","title":"Turn on/off foreign key check for ALL tables in DB2","body":"\u003cp\u003eI need a SQL statement which turns off/on foreign key checks in a DB2 database.\u003c/p\u003e\n\n\u003cp\u003eAll I found so far is this: \u003ccode\u003eSET INTEGRITY FOR \u0026lt;your_table\u0026gt; OFF\u003c/code\u003e but that turns off the constraints only for one specific table. I could iterate through all tables in schema and call that command but that's not very effective. Is this even posible in DB2?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-08-11 07:55:32.617 UTC","last_activity_date":"2014-08-11 08:07:40.99 UTC","last_edit_date":"2014-08-11 08:00:59.653 UTC","last_editor_display_name":"","last_editor_user_id":"2864740","owner_display_name":"","owner_user_id":"2468620","post_type_id":"1","score":"1","tags":"sql|foreign-keys|db2","view_count":"354"} +{"id":"22951220","title":"Why can't regular expressions match for @ sign?","body":"\u003cp\u003eFor the string \u003ccode\u003eBe there @ six.\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eWhy does this work:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003estr.gsub! /\\bsix\\b/i, \"seven\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut trying to replace the @ sign doesn't match:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003estr.gsub! /\\b@\\b/i, \"at\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eEscaping it doesn't seem to work either:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003estr.gsub! /\\b\\@\\b/i, \"at\"\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"22951267","answer_count":"2","comment_count":"3","creation_date":"2014-04-09 01:31:09.487 UTC","favorite_count":"1","last_activity_date":"2014-04-09 02:32:12.6 UTC","last_edit_date":"2014-04-09 01:37:36.447 UTC","last_editor_display_name":"","last_editor_user_id":"3188544","owner_display_name":"","owner_user_id":"3188544","post_type_id":"1","score":"2","tags":"ruby-on-rails|ruby|regex","view_count":"90"} +{"id":"27372457","title":"How to create multi dimensional javascript object in php?","body":"\u003cp\u003eHow to create multi-dimensional javascript object in php?\u003c/p\u003e\n\n\u003cp\u003eI want to create javascript object from below php array,\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$arrCat = array();\n$arrCat['vehicles']['id'][0] = 2;\n$arrCat['vehicles']['name'][0] = 'cars';\n$arrCat['vehicles']['id'][1] = 3;\n$arrCat['vehicles']['name'][1] = 'bikes';\n$arrCat['property']['id'][0] = 5;\n$arrCat['property']['name'][0] = 'house';\n$arrCat['property']['id'][1] = 6;\n$arrCat['property']['name'][1] = 'apartments';\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ePlease help!\u003c/p\u003e","answer_count":"1","comment_count":"4","creation_date":"2014-12-09 06:05:56.1 UTC","last_activity_date":"2014-12-09 08:40:44.277 UTC","last_edit_date":"2014-12-09 06:07:41.477 UTC","last_editor_display_name":"","last_editor_user_id":"402884","owner_display_name":"","owner_user_id":"3048860","post_type_id":"1","score":"-2","tags":"javascript|php|object","view_count":"106"} +{"id":"32904341","title":"Listview in dialog dynamic layout","body":"\u003cp\u003eI have a simple fragment dialog with a listview, EditText and two button (accept and cancel).\u003c/p\u003e\n\n\u003cp\u003eI want my layout to look like this:\nListview on top\nEditText right below\nand \nButtons side by side below edittext.\u003c/p\u003e\n\n\u003cp\u003eNow my problem is that listview can have 0 or a 100 elements.\nSo if I put everythis in a vertical LinearLayout and listview has a lot of elements the edittext and buttons get pushed out of view. And if I use relative layout and say that edit text is aligned parent bottom and below the listview that it looks ok for 100elements but when the listview is empty the dialog uses all of the screen space.\u003c/p\u003e\n\n\u003cp\u003eHere is an example of my code when using relativeLayout. Is there another way to make is so that linearLayout with id \"below\" is below the listview but will still be visible(if list view has a lot of items) without using alignParentBottom=\"true\" because that is the reason the layout stretches to full screen.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" encoding=\"utf-8\"?\u0026gt;\n\u0026lt;RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\"\n android:orientation=\"vertical\" \u0026gt;\n\n \u0026lt;ListView\n android:id=\"@+id/ListViewPreNotes\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\"\n android:layout_above=\"@+id/bottom\" /\u0026gt;\n\n\n \u0026lt;LinearLayout\n android:id=\"@+id/below\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\"\n android:orientation=\"vertical\"\n android:layout_alignParentBottom=\"true\"\u0026gt;\n\n \u0026lt;LinearLayout\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_gravity=\"left\"\n android:padding=\"3dp\"\u0026gt;\n\n \u0026lt;TextView\n android:layout_height=\"@dimen/label_height\"\n android:layout_width=\"130dip\"\n android:text=\"@string/note\"\n android:layout_marginLeft=\"10dip\"\n android:gravity=\"center_vertical\"\n android:textSize=\"@dimen/text_size_large\"/\u0026gt;\n\n \u0026lt;EditText\n android:id=\"@+id/OMnote\"\n android:layout_height=\"wrap_content\"\n android:layout_width=\"200dp\"\n android:textSize=\"@dimen/text_size_large\"\n android:inputType=\"textNoSuggestions|textCapSentences\"\n android:selectAllOnFocus=\"true\"\n android:hint=\"@string/note\"/\u0026gt;\n\n \u0026lt;/LinearLayout\u0026gt;\n\n \u0026lt;LinearLayout\n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\"\n android:layout_gravity=\"center_horizontal\"\n android:baselineAligned=\"false\"\u0026gt;\n\n \u0026lt;Button\n android:id=\"@+id/dialogButtonClose\"\n android:layout_width=\"0dp\"\n android:layout_weight=\"1\"\n android:layout_height=\"50dp\"\n android:text=\"@string/ok\"\n style=\"?android:attr/borderlessButtonStyle\"\n android:textStyle=\"bold\" /\u0026gt;\n \u0026lt;Button\n android:id=\"@+id/dialogButtonCancel\"\n android:layout_width=\"0dp\"\n android:layout_weight=\"1\"\n android:layout_height=\"50dp\"\n android:text=\"@string/cancel\"\n android:textStyle=\"bold\"\n style=\"?android:attr/borderlessButtonStyle\" /\u0026gt;\n\n \u0026lt;/LinearLayout\u0026gt;\n\n \u0026lt;/LinearLayout\u0026gt;\n\n\u0026lt;/RelativeLayout\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"33077599","answer_count":"4","comment_count":"0","creation_date":"2015-10-02 09:31:51.373 UTC","last_activity_date":"2015-10-12 09:26:42.153 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3924685","post_type_id":"1","score":"0","tags":"android|android-layout|android-listview|android-linearlayout|android-relativelayout","view_count":"240"} +{"id":"890320","title":"starting a struts2 project in eclipse","body":"\u003cp\u003eI am in the process of starting a struts2 project. While I was able to use struts2-blank as a quick out-of-the-box project, I have trouble creating my own struts2 project in Eclipse.\u003c/p\u003e\n\n\u003cp\u003eAll necessary jars are located in the web-inf/lib directory, but as soon as I add the following lines to my web.xml\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;filter\u0026gt;\n \u0026lt;filter-name\u0026gt;struts2\u0026lt;/filter-name\u0026gt;\n \u0026lt;filter-class\u0026gt;org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter\u0026lt;/filter-class\u0026gt;\n\u0026lt;/filter\u0026gt;\n\n\u0026lt;filter-mapping\u0026gt;\n \u0026lt;filter-name\u0026gt;struts2\u0026lt;/filter-name\u0026gt;\n \u0026lt;url-pattern\u0026gt;/*\u0026lt;/url-pattern\u0026gt;\n\u0026lt;/filter-mapping\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am getting an error \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eHTTP status 404 description The\n requested resource () is not available\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eAt the moment I only have a passthrough action with no implementation class which simply redirects to a jsp result page.\u003c/p\u003e\n\n\u003cp\u003eIf anybody has any ides, I would really appreciate it.\u003c/p\u003e\n\n\u003cp\u003eKind regards\nD\u003c/p\u003e","accepted_answer_id":"893380","answer_count":"3","comment_count":"0","creation_date":"2009-05-20 21:20:47.707 UTC","last_activity_date":"2016-07-01 11:43:48.907 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"106467","post_type_id":"1","score":"1","tags":"eclipse|struts2","view_count":"1768"} +{"id":"36770711","title":"How to limit gmap search autocomplete to limited country","body":"\u003cp\u003eI am developing a site where i am implementing Gmap with to and from facility. Everything is working good but right now i just wanted it's auto complete to limit to one specific country. Here is My code.. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(document).ready(function() {\ninitialize_direction_map();\nsetDestination();\n$(\"#start\").autocomplete({ \n source: function(request, response) {\n geocoder.geocode( {'address': request.term }, function(results, status) {\n response($.map(results, function(item) {\n return {\n label: item.formatted_address,\n value: item.formatted_address,\n latitude: item.geometry.location.lat(),\n longitude: item.geometry.location.lng()\n }\n }));\n })\n },\n //This bit is executed upon selection of an address\n select: function(event, ui) {\n $(\"#s_latitude\").val(ui.item.latitude);\n $(\"#s_longitude\").val(ui.item.longitude);\n var location = new google.maps.LatLng(ui.item.latitude, ui.item.longitude);\n map.setCenter(location);\n map.setZoom(12);\n var marker = new google.maps.Marker({\n position: location,\n map: map\n });\n document.getElementById('direction_box').style.display='block';\n calcRoute();\n }\n});\n\n$(\"#end\").autocomplete({\n //This bit uses the geocoder to fetch address values\n source: function(request, response) {\n\n geocoder.geocode( {'address': request.term }, function(results, status) {\n response($.map(results, function(item) {\n return {\n label: item.formatted_address,\n value: item.formatted_address,\n latitude: item.geometry.location.lat(),\n longitude: item.geometry.location.lng()\n }\n }));\n })\n },\n //This bit is executed upon selection of an address\n select: function(event, ui) {\n $(\"#e_latitude\").val(ui.item.latitude);\n $(\"#e_longitude\").val(ui.item.longitude);\n var location = new google.maps.LatLng(ui.item.latitude, ui.item.longitude);\n\n calcRoute();\n $(\"table.adp-directions\").css(\"width\",\"300px\");\n }\n });\n});\n\nfunction initialize_direction_map(){\n//MAP\ndirectionsDisplay = new google.maps.DirectionsRenderer();\nvar latlng = new google.maps.LatLng(20.5937,78.9629);\nvar options = {\n zoom: 5,\n center: latlng,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n};\n\nmap = new google.maps.Map(document.getElementById('map-canvas'), options);\ndirectionsDisplay.setMap(map);\n directionsDisplay.setPanel(document.getElementById('directions-panel'));\n\n//GEOCODER\ngeocoder = new google.maps.Geocoder();\n }\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"36789709","answer_count":"1","comment_count":"1","creation_date":"2016-04-21 13:12:50.503 UTC","last_activity_date":"2016-04-22 09:14:49.243 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4066550","post_type_id":"1","score":"0","tags":"javascript|jquery|google-maps|google-maps-api-3","view_count":"145"} +{"id":"42577708","title":"Mutilple controllers on one page","body":"\u003cp\u003eIn my ruby on rails app i have the standard view in each page which renders a navigation view on each page, but i have a notifications controller which i wish to use on every page so theoretically i need to load this controller and view on every page is this possible\u003c/p\u003e\n\n\u003cp\u003ethis \u003ccode\u003e\u0026lt;%= render 'shared/navigation' %\u0026gt;\u003c/code\u003e renders a view so no use\nwhat im attempting to do i run a controller inside another controller basically\u003c/p\u003e\n\n\u003cp\u003ethanks for any help\u003c/p\u003e\n\n\u003cp\u003eps. i have had a good look around and cannot find anything that suites what im trying to do\u003c/p\u003e\n\n\u003cp\u003eNotifications controller code\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e class NotificationsController \u0026lt; ApplicationController\n before_action :set_notification, only: [:show, :edit, :update, :destroy]\n\n # GET /notifications\n # GET /notifications.json\n def index\n @notificationlastid = Notification.last\n # if the id params is present\n if params[:id]\n # get all records with id less than 'our last id'\n # and limit the results to 5\n @notifications = Notification.where('id \u0026gt; ?', params[:id]).where(userid: current_user.id)\n else\n @notifications = Notification.where(userid: current_user.id)\n end\n respond_to do |format|\n format.html \n format.js \n end\n end\n\n # GET /notifications/1\n # GET /notifications/1.json\n def show\n end\n\n # GET /notifications/new\n def new\n @notification = Notification.new\n end\n\n # GET /notifications/1/edit\n def edit\n end\n\n # POST /notifications\n # POST /notifications.json\n def create\n @notification = Notification.new(notification_params)\n\n respond_to do |format|\n @notification.userid = current_user.id\n if @notification.save\n format.html { redirect_to @notification, notice: 'Notification was successfully created.' }\n format.json { render action: 'show', status: :created, location: @notification }\n else\n format.html { render action: 'new' }\n format.json { render json: @notification.errors, status: :unprocessable_entity }\n end\n end\n end\n\n # PATCH/PUT /notifications/1\n # PATCH/PUT /notifications/1.json\n def update\n respond_to do |format|\n if @notification.update(notification_params)\n format.html { redirect_to @notification, notice: 'Notification was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @notification.errors, status: :unprocessable_entity }\n end\n end\n end\n\n # DELETE /notifications/1\n # DELETE /notifications/1.json\n def destroy\n @notification.destroy\n respond_to do |format|\n format.html { redirect_to notifications_url }\n format.json { head :no_content }\n end\n end\n\n private\n # Use callbacks to share common setup or constraints between actions.\n def set_notification\n @notification = Notification.find(params[:id])\n end\n\n # Never trust parameters from the scary internet, only allow the white list through.\n def notification_params\n params.require(:notification).permit(:content, :description)\n end\nend\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"42578035","answer_count":"1","comment_count":"3","creation_date":"2017-03-03 11:28:34.193 UTC","last_activity_date":"2017-03-03 13:20:54.42 UTC","last_edit_date":"2017-03-03 13:20:54.42 UTC","last_editor_display_name":"","last_editor_user_id":"5879918","owner_display_name":"","owner_user_id":"5879918","post_type_id":"1","score":"0","tags":"ruby-on-rails|views|controllers","view_count":"51"} +{"id":"24550246","title":"Several problems with vb.net (made in Visual Studio 2013) and Access DB","body":"\u003cp\u003eI'm trying to a create a windows form application in vb.net using a access database (2010) with 2 tables (as the main idea, I'm trying to create a bank creditation application). One table I use it for login, and another one to insert elements into it from a windows form.\u003c/p\u003e\n\n\u003cp\u003eFor the login table, everything works fine, but when it comes for the second table (clients) I encounter some problems.\u003c/p\u003e\n\n\u003cp\u003eThe table details for the clients is: ID (autonumber), first name (text), last name (text), PID (number), adress (text), city (text), marital status (text), nochildren (number), date (date/time).\u003c/p\u003e\n\n\u003cp\u003eI've created an insert query for the clients table that goes like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eINSERT INTO `Clienti` (`nume`, `prenume`, `cnp`, `adresa`, `localitate`, `stare civila`) VALUES (?, ?, ?, ?, ?, ?, ?, ?).\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn the Windows form I've created I have the following elements: first name (textbox), last name (textbox), PID (textbox), adress (text), city (text), marital status (text) and a button that should save those into my clients table.\u003c/p\u003e\n\n\u003cp\u003eThe code for the save to DB button is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eConvert.ToInt32(cnptxt.Text)\nConvert.ToInt32(numarcopiitxt.Text)\n\nDim cnpp As Integer\ncnpp = Val(cnptxt.Text)\nDim nrcopii As Integer\nnrcopii = Val(numarcopiitxt.Text)\n\nDim nume As String\n\nDim prenume As String\nDim cnp As Integer\nDim varsta As Integer\nDim adresa As String\nDim localitate As String\nDim starecivila As String\nDim numarcopii As Integer\n\nnume = numetxt.Text\nprenume = prenumetxt.Text\ncnp = cnpp\nvarsta = varstatxt.Text\nadresa = adresatxt.Text\nlocalitate = localitatetxt.Text\nstarecivila = starecivilatxt.Text\nnumarcopii = numarcopiitxt.Text\nIf Me.ClientiTableAdapter.InsertQueryClienti(nume, prenume, cnp, varsta, adresa, localitate, starecivilatxt.Text) Then\n MsgBox(\"Client adaugat cu succes in baza de date\")\nElse\n MsgBox(\"O eroare a fost intalnita intr-unul din campurile completate. Reincercati!\")\nEnd If\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI know it's incomplete when compared with the rows from the clients table, it's due to the problems I've encountered with the save to DB. When I run the application and I tap on the save to DB button, I receive the following error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eAn unhandled exception of type 'System.InvalidCastException' occurred in Microsoft.VisualBasic.dll\n\nAdditional information: Conversion from string \"necasatorit\" to type 'Integer' is not valid.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe code for InsertQueryClienti is INSERT INTO \u003ccode\u003eClienti\u003c/code\u003e (\u003ccode\u003enume\u003c/code\u003e, \u003ccode\u003eprenume\u003c/code\u003e, \u003ccode\u003ecnp\u003c/code\u003e, \u003ccode\u003eadresa\u003c/code\u003e, \u003ccode\u003elocalitate\u003c/code\u003e, \u003ccode\u003estare civila\u003c/code\u003e) VALUES (?, ?, ?, ?, ?, ?, ?, ?) and the definition for it is Public Overloads Overridable Function InsertQueryClienti(ByVal nume As String, ByVal prenume As String, ByVal cnp As Global.System.Nullable(Of Integer), ByVal adresa As String, ByVal localitate As String, ByVal stare_civila As String, ByVal numarcopii As Global.System.Nullable(Of Integer)) As Integer\u003c/p\u003e\n\n\u003cp\u003enecasatorit is referring to the marital status textbox. I can't understand why it gives me that error since the textbox obviously is a string and in the table that row is set as text.\u003c/p\u003e","accepted_answer_id":"24552139","answer_count":"1","comment_count":"10","creation_date":"2014-07-03 09:42:39.667 UTC","last_activity_date":"2016-04-09 18:24:08.83 UTC","last_edit_date":"2016-04-09 18:24:08.83 UTC","last_editor_display_name":"","last_editor_user_id":"472495","owner_display_name":"","owner_user_id":"3801004","post_type_id":"1","score":"1","tags":"vb.net|error-handling|insert","view_count":"116"} +{"id":"35229592","title":"What DNS Name Label should I give my Azure Virtual Machine?","body":"\u003cp\u003eIn my ongoing effort to wrap my head around Azure's new Resource Group model (see previous questions \u003ca href=\"https://stackoverflow.com/questions/35163948/associate-a-public-ip-in-an-azure-resource-group-to-a-web-app\"\u003ehere\u003c/a\u003e and \u003ca href=\"https://stackoverflow.com/questions/35183153/point-ip-address-to-azure-resource-group-web-app/35183280?noredirect=1#comment58138836_35183280\"\u003ehere\u003c/a\u003e), I am now trying to create a new Virtual Machine that will be used as a web server.\u003c/p\u003e\n\n\u003cp\u003eI have thee questions:\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eQuestion One:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eAssuming I eventually want this VM to host the website woodswild.com, what DNS Name Label should I give this VM? Does it matter? All I know for sure is that it needs to be globally unique. Does it need to reflect the domain I want to host (woodswild.com)?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eQuestion Two:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eDo I even need to set the DNS name at all?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eQuestion Three:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eAnd, now that I've already created it, can I still change the DNS Name Label from \"none\" to something? And if so, how?\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/KX1gJ.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/KX1gJ.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"35230930","answer_count":"2","comment_count":"0","creation_date":"2016-02-05 17:01:26.067 UTC","favorite_count":"1","last_activity_date":"2016-02-05 18:21:49.677 UTC","last_edit_date":"2017-05-23 12:24:42.18 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"1840823","post_type_id":"1","score":"0","tags":"azure|dns|windows-server-2008|azure-resource-manager","view_count":"2752"} +{"id":"6568021","title":"using hibernate matchmode for Date","body":"\u003cp\u003eI have a Date \u003cstrong\u003edate\u003c/strong\u003e= \"26/12/2007\" which i want to compare with my date in sql: \"26/12/2007 12:00:00\"\u003c/p\u003e\n\n\u003cp\u003elike if i send date \"26/12/2007\" it should retrieve values against the date in mysql \n\"26/12/2007 12:00:00\"\u003c/p\u003e\n\n\u003cp\u003eIt works if i remove this 12:00:00 ,but if i add 12:00:00 it gives no results \u003c/p\u003e\n\n\u003cp\u003ei am using Hibernate Criteria like \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e criteria.add(Restrictions.like(\"dateinsql\", date));\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI tried using \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e criteria.add(Restrictions.like(\"dateinsql\", date,MatchMode.AnyWhere));\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut it only works for String not Date.\u003c/p\u003e\n\n\u003cp\u003eAny solutions for that\u003c/p\u003e","accepted_answer_id":"6568441","answer_count":"1","comment_count":"0","creation_date":"2011-07-04 06:26:32.197 UTC","last_activity_date":"2011-07-04 07:20:05.82 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"764446","post_type_id":"1","score":"0","tags":"hibernate","view_count":"1623"} +{"id":"6576206","title":"What is the difference between the override and new keywords in C#?","body":"\u003cp\u003eWhat is the difference between the \u003ccode\u003eoverride\u003c/code\u003e and \u003ccode\u003enew\u003c/code\u003e keywords in C# when defining methods in class hierarchies?\u003c/p\u003e","accepted_answer_id":"6576212","answer_count":"4","comment_count":"0","creation_date":"2011-07-04 21:27:19.523 UTC","favorite_count":"19","last_activity_date":"2017-07-21 23:03:40.047 UTC","last_edit_date":"2012-06-28 10:33:04.093 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"729082","post_type_id":"1","score":"48","tags":"c#|.net|oop","view_count":"21224"} +{"id":"15016017","title":"Working with Graphics in Actionscript","body":"\u003cp\u003ei haven't worked with graphics until now.. so I have not much ideas about using graphics objects in flash cs6.\nI want to move this character depending if the person has pressed a button and stop his movement once the button is released. I looked up on how to go about this process.. so far one thing that kept coming up was to turn my spritesheet into graphics.. but after that i couldn't really find anything on how to integrate this into actionscript. Plus when I convert an object into graphics it doesn't give me options to assign it a class name. so can somebody give me a good breakdown on what is the purpose of these graphics objects? and how should I go about making a sprite move?\u003c/p\u003e","accepted_answer_id":"15017046","answer_count":"1","comment_count":"1","creation_date":"2013-02-22 02:46:39.707 UTC","last_activity_date":"2013-02-22 04:49:01.043 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1932905","post_type_id":"1","score":"2","tags":"actionscript-3","view_count":"58"} +{"id":"12616518","title":"Why does this boolean method use the wrong return path?","body":"\u003cp\u003eThis is so stupid, I am certain I will be stabbing myself with a wet kipper in a few minutes..\u003c/p\u003e\n\n\u003cp\u003eI have this method, the purpose of which is to determine if a particular path in the assets folder is a subfolder. It's used in a recursive search to find files in assets.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e private static boolean isDirectory(AssetManager assetManager, String path) throws IOException\n {\n // AssetManager.list() returns a string array of assets located @ path\n // if path is a file, then the array will be empty and have zero length\n // if path does not exist, then an IOException is raised\n // (ignore the exception as in theory, this will never happen\n // since this is called by the searchAssets recursive find)\n\n // do nothing for uninitialised or empty paths\n if (path==null || path.equals(\"\")){return false;}\n\n try {\n if (DEBUG){Log.d(TApp.APP_TAG,path + \" lists \" + assetManager.list(path).length + \" assets\");}\n if (assetManager.list(path).length \u0026gt; 0){\n return true;\n }\n } catch (IOException e) {\n // do nothing - path should always exist but in any case, there is nothing we can\n // do so just throw it back up\n throw e;\n }\n return false;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe problem is that it is always returning false. \u003c/p\u003e\n\n\u003cp\u003eWhen I step through the code, I can see that .list() returns a non-zero value for a subfolder both from the logcat output and from evaluating .list() at a breakpoint. When I step through the method, the current execution point correctly hits \"return true;\" but when I hit F7 to continue (I'm using IDEA), the execution point jumps to the last statement, \"return false;\", which is the value returned.\u003c/p\u003e\n\n\u003cp\u003e(I'm embarrassed to be asking). Why?\u003c/p\u003e\n\n\u003cp\u003e[EDIT] Request to show how I'm calling it - this method is not finished as I can't get the above to work!\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic static String searchAssets(AssetManager asm, String path, String filename){\n\n // TODO uses hard coded path separator\n\n // search for the file, filename, starting at path path in the assets folder\n // asm must be initialised by the caller using an application context\n // returns an empty string for non existent files or for filename = \"\"\n\n if (asm==null){return \"\";}\n\n String foundFile; // return value\n\n try {\n // get a list of assets located at path\n String[] files = asm.list(path);\n\n // files may be null if an invalid path is passed\n if (files!=null \u0026amp;\u0026amp; files.length\u0026gt;0){\n\n // loop through each asset for either a subfolder to search \n // recursively or the file we are looking for\n for (String file:files){\n\n // \u0026lt;\u0026lt;\u0026lt;\u0026lt;\u0026lt;\u0026lt; HERE'S THE CALL \u0026gt;\u0026gt;\u0026gt;\u0026gt;\u0026gt;\u0026gt;\u0026gt;\n if (isDirectory(asm,path + \"/\" + file)){ \n\n foundFile = searchAssets(asm,file,filename); // recurse this subfolder\n\n // searchAssets returns either the name of our file, if found, or an empty string \n if (!foundFile.equals(\"\")){\n return foundFile;\n }\n } else {\n if (file.equals(filename)){\n return path + \"/\" + file;\n }\n }\n }\n }\n\n } catch (IOException e) {\n // eat the exception - the caller did not set us up properly \n }\n\n return \"\";\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e[MORE EDITS]\u003c/p\u003e\n\n\u003cp\u003eLogcat:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e09-27 09:21:12.047: DEBUG/GRENDLE(2811): harmonics_data/Harmonic Data SHC lists 2 assets\n09-27 09:21:12.137: DEBUG/GRENDLE(2811): harmonics_data/Harmonic Data SHC is a subfolder, returning true\n\n09-27 09:21:12.544: DEBUG/GRENDLE(2811): harmonics_data/Harmonic Data SHC is a not a subfolder, returning false\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere's a screenshot. The first breakpoint (return true;) is hit first. Continue stepping jumps straight to the last statement, return false, which is what is returned. This is NOT an exception. The exception breakpoint is never hit, and I don't expect it ever will, and as you can see from the logcat, the control flow seems wrong.\u003c/p\u003e\n\n\u003cp\u003eI don't know how it looks in Eclipse, but here the red lines are breakpoints and the blue line is the current execution point.\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/VJL9h.png\" alt=\" \"\u003e\u003c/p\u003e\n\n\u003cp\u003eI've cleared the caches, deleted the file index, deleted the output folders and done a complete rebuild.\u003c/p\u003e","accepted_answer_id":"12618340","answer_count":"3","comment_count":"8","creation_date":"2012-09-27 07:47:40.67 UTC","favorite_count":"2","last_activity_date":"2015-05-06 18:08:22.95 UTC","last_edit_date":"2012-09-27 08:32:43.007 UTC","last_editor_display_name":"","last_editor_user_id":"789657","owner_display_name":"","owner_user_id":"789657","post_type_id":"1","score":"5","tags":"java|android","view_count":"694"} +{"id":"2368032","title":"Using one variable to look up info in two tables","body":"\u003cp\u003eThe code below works nicely. Each \"title\" in the MySQL table \"submission\" is printed in reverse chronological order alongside its corresponding \"loginid.\" \u003c/p\u003e\n\n\u003cp\u003eI have another MySQL table (\"login\") with the fields \"loginid\" and \"username.\" So each row has a \"loginid\" and a \"username.\" The \"loginid\" in these two MySQL tables \"submission\" and \"login\" are equivalent to each other. \u003c/p\u003e\n\n\u003cp\u003eIn the HTML table printed below, how could I replace the \"loginid\" with the \"username\"?\u003c/p\u003e\n\n\u003cp\u003eThanks in advance,\u003c/p\u003e\n\n\u003cp\u003eJohn\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;?php\n $sqlStr = \"SELECT loginid, title, url, displayurl\n FROM submission ORDER BY datesubmitted DESC LIMIT 10\";\n $result = mysql_query($sqlStr);\n\n $arr = array(); \n echo \"\u0026lt;table class=\\\"samplesrec\\\"\u0026gt;\";\n while ($row = mysql_fetch_array($result)) { \n echo '\u0026lt;tr\u0026gt;';\n echo '\u0026lt;td class=\"sitename1\"\u0026gt;\u0026lt;a href=\"http://www.'.$row[\"url\"].'\"\u0026gt;'.$row[\"title\"].'\u0026lt;/a\u0026gt;\u0026lt;/td\u0026gt;';\n echo '\u0026lt;/tr\u0026gt;';\n echo '\u0026lt;tr\u0026gt;';\n echo '\u0026lt;td class=\"sitename2\"\u0026gt;\u0026lt;a href=\"http://www.'.$row[\"url\"].'\"\u0026gt;'.$row[\"loginid\"].'\u0026lt;/a\u0026gt;\u0026lt;/td\u0026gt;';\n echo '\u0026lt;/tr\u0026gt;';\n }\n echo \"\u0026lt;/table\u0026gt;\"; \n\n\n ?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"2368062","answer_count":"1","comment_count":"0","creation_date":"2010-03-03 00:40:48.557 UTC","last_activity_date":"2010-03-03 00:47:08.447 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"158865","post_type_id":"1","score":"0","tags":"php|mysql","view_count":"85"} +{"id":"3502297","title":"JPA - manytoone cascading","body":"\u003cp\u003eI've got two entities\u003c/p\u003e\n\n\u003cp\u003eServiceDownload.java\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@Entity\npublic class ServiceDownload implements Serializable {\n private static final long serialVersionUID = -5336424090042137820L;\n\n@Id\n@GeneratedValue\nprivate Long id;\n@Length(max = 255)\nprivate String description;\n\nprivate byte[] download;\n\nprivate String fileName;\n\n@ManyToOne\nprivate Service service;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eService.java\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@Entity\npublic class Service implements Serializable {\n private static final long serialVersionUID = 4520872456865907866L;\n\n\n@EmbeddedId\nprivate ServiceId id;\n\n@Length(max = 255)\nprivate String servicename;\n\n@Column(columnDefinition = \"text\")\nprivate String highlightsText;\n@Column(columnDefinition = \"text\")\nprivate String detailsText;\n@Column(columnDefinition = \"text\")\nprivate String productText;\n@Column(columnDefinition = \"text\")\nprivate String dataText;\n\n@ManyToMany(mappedBy = \"services\")\nprivate Set\u0026lt;Machine\u0026gt; machines;\n\n@OneToMany(targetEntity = ServiceDownload.class)\nprivate List\u0026lt;ServiceDownload\u0026gt; serviceDownloads;\n\n@OneToOne\nprivate ServicePicture servicePicture;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I create a new ServiceDownload Object and try to persists this I recieve a duplicate key exception. It seems that jpa tries to insert a new service object into the service table. How can I disable this behaviour?\u003c/p\u003e","accepted_answer_id":"3502401","answer_count":"1","comment_count":"0","creation_date":"2010-08-17 12:20:56.44 UTC","last_activity_date":"2010-08-17 12:33:14.517 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"196963","post_type_id":"1","score":"0","tags":"java|jpa|entity-relationship","view_count":"475"} +{"id":"15325409","title":"PHP Zend Framework Killing sessions amongst all browsers when logging off","body":"\u003cp\u003eI can login to my application using firefox and google chrome. When I click logout of google chrome, it goes back to the login screen. However, the user is still logged into firefox. How do I remove the sessions from both firefox and google chrome when I log a user out of one of the browsers.\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","accepted_answer_id":"15325520","answer_count":"1","comment_count":"2","creation_date":"2013-03-10 17:45:43.627 UTC","last_activity_date":"2013-03-10 17:55:38.02 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"135605","post_type_id":"1","score":"0","tags":"php|zend-framework|zend-session","view_count":"136"} +{"id":"16998992","title":"clojure lein jar clash resolution process","body":"\u003cp\u003eI have created a new project with\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elein new jar-clash-test\ncd jar-clash-test/\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have put the following in project.clj\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e(defproject jar-clash-test \"0.1.0-SNAPSHOT\"\n :dependencies [[org.clojure/clojure \"1.5.0\"]\n [io.pedestal/pedestal.service \"0.1.2\"]\n ...]\n :main ^{:skip-aot true} jar-clash-test.core\n)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have put the following in jar-clash-test/src/jar_clash_test/core.clj\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e(ns jar-clash-test.core\n (:require [io.pedestal.service.http :as bootstrap]))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I run this with \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elein repl\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI get the following error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCompilerException java.lang.RuntimeException: No such var: content-type/content-type-response, compiling:(io/pedestal/service/http/ring_middlewares.clj:46:3)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I look at:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e/.m2/repository/io/pedestal/pedestal/0.1.2/pedestal.service-0.1.2/io/ring_middlewares.clj\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOn line 46 I see:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e (leave-interceptor ::content-type-interceptor content-type/content-type-response opts))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhich is defined in the requirements as:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[ring.middleware.content-type :as content-type]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhich means it is trying to bring in the ring-middleware jar. \u003c/p\u003e\n\n\u003cp\u003eMy hypothesis is that there is a jar version clash for the ring middleware implementation. \u003c/p\u003e\n\n\u003cp\u003eThis is based on:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003e[compojure \"1.1.3\"] [has a dependency]\u003ca href=\"https://clojars.org/compojure/versions/1.1.3\" rel=\"nofollow\"\u003e2\u003c/a\u003e on [ring/ring-core \"1.1.5\"]\u003c/li\u003e\n\u003cli\u003e[io.pedestal/pedestal.service \"0.1.2\"] [has a dependency on]\u003ca href=\"https://clojars.org/io.pedestal/pedestal.service/versions/0.1.2\" rel=\"nofollow\"\u003e3\u003c/a\u003e [ring/ring-core \"1.2.0-beta1\"]\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eWhen I look at:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e/.m2/repository/ring/ring-core/1.2.0-beta1/ring-core-1.2.0-beta1/ring/middleware/content_type.clj\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe function \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e(defn content-type-response\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eexists. When I look at:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e/.m2/repository/ring/ring-core/1.1.5/ring-core-1.1.5/ring/middleware/content_type.clj\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe function doesn't exist. \u003c/p\u003e\n\n\u003cp\u003eMy question is - how do I know which version lein has picked up? I can 'assume' it has picked up the earlier one - but how I can know for certain?\u003c/p\u003e\n\n\u003cp\u003eMy second question is - how can I guarantee which one lein will pick?\u003c/p\u003e","accepted_answer_id":"17000104","answer_count":"1","comment_count":"0","creation_date":"2013-06-08 11:20:12.397 UTC","last_activity_date":"2016-06-14 05:38:16.003 UTC","last_edit_date":"2016-06-14 05:38:16.003 UTC","last_editor_display_name":"","last_editor_user_id":"477476","owner_display_name":"","owner_user_id":"15441","post_type_id":"1","score":"1","tags":"jar|clojure|version|leiningen|name-clash","view_count":"142"} +{"id":"27235122","title":"ASP.NET 5 - Starting an ASP.NET vNext project","body":"\u003cp\u003eI am trying to get my feet wet with ASP.NET vNext. I'm very interested in the cross-platform aspect of it. For that reason, I'm focused on using the K Runtime Environment.\u003c/p\u003e\n\n\u003cp\u003eI've looked at the sample provided on the \u003ca href=\"https://github.com/aspnet/home\" rel=\"nofollow\"\u003ehome page\u003c/a\u003e. Those samples do not help me though. I have a project that is structure like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e/\n /client\n /server\n /controllers\n HomeController.cs\n /views\n /home\n Index.cshtml\n project.json\n Startup.cs\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I navigate to the directory with project.json, I run the following from the command-line.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eC:\\MyProject\\server\u0026gt;k web\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI get the following error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSystem.IO.FileLoadException: Could not load file or assembly 'server' or one of its dependencies. General Exception (Exception from HRESULT: 0x80131500)\nFile name: 'server' ---\u0026gt; Microsoft.Framework.Runtime.Roslyn.RoslynCompilationException: C:\\MyProject\\server\\controllers\\HomeController.cs(5,18): error CS0234: The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI feel like \u003ccode\u003eStartup.cs\u003c/code\u003e is looking for something called \u003ccode\u003eserver\u003c/code\u003e. Yet it doesn't exist. I suspect something is missing from \u003ccode\u003eproject.json\u003c/code\u003e. However, I do not know what. My \u003ccode\u003eproject.json\u003c/code\u003e looks like the following:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n \"dependencies\": {\n \"Kestrel\": \"1.0.0-beta1\",\n \"Microsoft.AspNet.Diagnostics\": \"1.0.0-beta1\",\n \"Microsoft.AspNet.Hosting\": \"1.0.0-beta1\",\n \"Microsoft.AspNet.Mvc\": \"6.0.0-beta1\",\n \"Microsoft.AspNet.Server.WebListener\": \"1.0.0-beta1\"\n },\n \"commands\": {\n \"web\": \"Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5001\"\n },\n \"frameworks\": {\n \"aspnet50\": {},\n \"aspnetcore50\": {}\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat am I doing wrong? Thank you!\u003c/p\u003e","accepted_answer_id":"27235266","answer_count":"1","comment_count":"2","creation_date":"2014-12-01 18:49:13.417 UTC","last_activity_date":"2015-02-05 04:27:10.463 UTC","last_edit_date":"2015-02-05 04:27:10.463 UTC","last_editor_display_name":"","last_editor_user_id":"31668","owner_display_name":"","owner_user_id":"1185425","post_type_id":"1","score":"1","tags":"c#|asp.net|asp.net-core","view_count":"1109"} +{"id":"4308342","title":"Rails + Postgis with spatial_adapter or postgis_adapter gem?","body":"\u003cp\u003eI need to use Ruby-on-Rails together with a Postgis database.\nAnyone experience with both \u003ca href=\"http://github.com/fragility/spatial_adapter\" rel=\"nofollow\"\u003espatial_adapter\u003c/a\u003e and \u003ca href=\"http://github.com/nofxx/postgis_adapter\" rel=\"nofollow\"\u003epostgis_adapter\u003c/a\u003e gem?\nWhat are the differences? Which do you recommend? Are there any other gems you recommend?\u003c/p\u003e","accepted_answer_id":"4686131","answer_count":"1","comment_count":"2","creation_date":"2010-11-29 21:36:05.277 UTC","last_activity_date":"2011-09-14 16:56:30.177 UTC","last_edit_date":"2010-11-29 22:20:53.167 UTC","last_editor_display_name":"","last_editor_user_id":"205785","owner_display_name":"","owner_user_id":"205785","post_type_id":"1","score":"1","tags":"ruby-on-rails|postgresql|rubygems|gis|postgis","view_count":"620"} +{"id":"10589935","title":"Get process status by pid in Ruby","body":"\u003cp\u003eIs there a way to get a process's child process status based on its PID in Ruby?\u003c/p\u003e\n\n\u003cp\u003eFor example, in Python you can do psutil.Process(pid).status\u003c/p\u003e","answer_count":"3","comment_count":"3","creation_date":"2012-05-14 19:38:16.527 UTC","favorite_count":"2","last_activity_date":"2015-04-22 13:15:59.833 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"102958","post_type_id":"1","score":"5","tags":"ruby|process-management","view_count":"2784"} +{"id":"44786498","title":"occurred while synchronizing remote to local directory; failed to create SFTP Session","body":"\u003cp\u003eI have a Spring Integration application which reads a folder and sftp the files. It works fine with SFTP on the Linux server but it doesn't on Window Server. Below is the logs.\u003c/p\u003e\n\n\u003cp\u003ePlease help me. Thank You\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport org.springframework.boot.SpringApplication;\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\nimport org.springframework.cloud.stream.app.sftp.source.SftpSourceConfiguration;\nimport org.springframework.context.annotation.Import;\n\n@SpringBootApplication\n@Import(SftpSourceConfiguration.class)\n\npublic class FiletraverseApplication {\n public static void main(String[] args) {\n SpringApplication.run(FiletraverseApplication.class, args); \n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003chr\u003e\n\n\u003cpre\u003e\u003ccode\u003eFile.consumer.mode = contents\nsftp.remote-dir=/TEST/\nsftp.factory.host=xxx.xxxx.xxxxxx\nsftp.factory.password=zzzzzx\nsftp.factory.username=xxxx\nsftp.factory.port=22\nsftp.factory.allow-unknown-keys=true\nsftp.delete-remote-files=true\ntrigger.fixed-delay= 15\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003chr\u003e\n\n\u003cpre\u003e\u003ccode\u003e2017-06-27 09:55:58.457[0;39m [31mERROR[0;39m [35m11836[0;39m [2m---[0;39m [2m[ask-scheduler-5][0;39m [36mo.s.integration.handler.LoggingHandler [0;39m [2m:[0;39m org.springframework.messaging.MessagingException: Problem occurred while synchronizing remote to local directory; nested exception is org.springframework.messaging.MessagingException: Failed to execute on session; nested exception is java.lang.IllegalStateException: failed to create SFTP Session\nat org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer.synchronizeToLocalDirectory(AbstractInboundFileSynchronizer.java:275)\nat org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizingMessageSource.doReceive(AbstractInboundFileSynchronizingMessageSource.java:200)\nat org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizingMessageSource.doReceive(AbstractInboundFileSynchronizingMessageSource.java:62)\nat org.springframework.integration.endpoint.AbstractMessageSource.receive(AbstractMessageSource.java:134)\nat org.springframework.integration.endpoint.SourcePollingChannelAdapter.receiveMessage(SourcePollingChannelAdapter.java:224)\nat org.springframework.integration.endpoint.AbstractPollingEndpoint.doPoll(AbstractPollingEndpoint.java:245)\nat org.springframework.integration.endpoint.AbstractPollingEndpoint.access$000(AbstractPollingEndpoint.java:58)\nat org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:190)\nat org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:186)\nat org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller$1.run(AbstractPollingEndpoint.java:353)\nat org.springframework.integration.util.ErrorHandlingTaskExecutor$1.run(ErrorHandlingTaskExecutor.java:55)\nat org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:50)\nat org.springframework.integration.util.ErrorHandlingTaskExecutor.execute(ErrorHandlingTaskExecutor.java:51)\nat org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller.run(AbstractPollingEndpoint.java:344)\nat org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)\nat org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81)\nat java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)\nat java.util.concurrent.FutureTask.run(FutureTask.java:266)\nat java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)\nat java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)\nat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\nat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\nat java.lang.Thread.run(Thread.java:745)\nCaused by: org.springframework.messaging.MessagingException: Failed to execute on session; nested exception is java.lang.IllegalStateException: failed to create SFTP Session\nat org.springframework.integration.file.remote.RemoteFileTemplate.execute(RemoteFileTemplate.java:444)\nat org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer.synchronizeToLocalDirectory(AbstractInboundFileSynchronizer.java:233)\n... 22 more\nCaused by: java.lang.IllegalStateException: failed to create SFTP Session\nat org.springframework.integration.sftp.session.DefaultSftpSessionFactory.getSession(DefaultSftpSessionFactory.java:393)\nat org.springframework.integration.sftp.session.DefaultSftpSessionFactory.getSession(DefaultSftpSessionFactory.java:57)\nat org.springframework.integration.file.remote.RemoteFileTemplate.execute(RemoteFileTemplate.java:433)\n... 23 more\nCaused by: java.lang.IllegalStateException: failed to connect\nat org.springframework.integration.sftp.session.SftpSession.connect(SftpSession.java:273)\nat org.springframework.integration.sftp.session.DefaultSftpSessionFactory.getSession(DefaultSftpSessionFactory.java:388)\n... 25 more\nCaused by: com.jcraft.jsch.JSchException: Session.connect: java.net.SocketException: Connection reset\nat com.jcraft.jsch.Session.connect(Session.java:565)\nat com.jcraft.jsch.Session.connect(Session.java:183)\nat org.springframework.integration.sftp.session.SftpSession.connect(SftpSession.java:264)\n... 26 more\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"1","creation_date":"2017-06-27 17:33:27.167 UTC","last_activity_date":"2017-06-28 16:16:21.917 UTC","last_edit_date":"2017-06-28 16:16:21.917 UTC","last_editor_display_name":"","last_editor_user_id":"6375113","owner_display_name":"","owner_user_id":"8221481","post_type_id":"1","score":"0","tags":"spring-integration-sftp","view_count":"176"} +{"id":"13729427","title":"How can I modify this data extraction from two mySQL table result","body":"\u003cp\u003eI asked a question earlier about extracting data from two table and got a beautiful answer which worked perfectly by I asked a question earlier about extracting data from two table and got a beautiful answer which worked perfectly by Ollie Jones\u003c/p\u003e\n\n\u003cp\u003eHere is the new situation\nI want to get a certain data from the first table by adding a WHERE but now it fails and it seems as if it should not \u003c/p\u003e\n\n\u003cp\u003eThis query does just fine when performing this function\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etable 1 table 2\n\nproduct 1 product 4\nproduct 2 product 2\nproduct 3\nproduct 4\n\n\nSELECT ifnull( b.number \u0026gt;0, 0 ) purchased\nFROM 1androidProducts a\nLEFT JOIN (\n SELECT count( * ) number, product\n FROM 1androidSales \n WHERE udid = '' \n GROUP BY product\n) b \nON a.appTitle = b.product\nORDER BY a.appTitle\nLIMIT 0 , 30\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eyields this result\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eresult \n\n0\n1\n0\n1\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ein short \nfor every item in table 1 shows this\u003c/p\u003e\n\n\u003cp\u003ea 0 if the table-1-item does not appear in table two \n--OR--\na 1 if table-1-item does show in table 2\u003c/p\u003e\n\n\u003cp\u003eNow when I add this line\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT ifnull( b.number \u0026gt;0, 0 ) purchased\nFROM 1androidProducts a\nWHERE a.accountID = 2 \u0026lt;\u0026lt;---------- I added this line \nLEFT JOIN (\n SELECT count( * ) number, product\n FROM 1androidSales \n WHERE udid = ''\n AND accountID = 2 \u0026lt;\u0026lt;---------- I added this line\n GROUP BY product\n) b \nON a.appTitle = b.product\nORDER BY a.appTitle\nLIMIT 0 , 30\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt now gives an error \u003c/p\u003e\n\n\u003ch1\u003e1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LEFT JOIN ( SELECT count( * ) number, product FROM 1androidSales ' at line 4\u003c/h1\u003e\n\n\u003cp\u003eI simply want to get a subset of table 1 based on the accountID to compare against the second table.\u003c/p\u003e\n\n\u003cp\u003eso if I had this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e table 1 table 2\n\naccountid =1 product 1 accountid =2 product 4\naccountid =1 product 2 accountid =2 product 2\naccountid =1 product 3 accountid =2 product 5\naccountid =1 product 4\naccountid =2 product 1 \naccountid =2 product 2\naccountid =2 product 3\naccountid =2 product 4\naccountid =2 product 5\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewould yield this result\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eresult \n\n0\n1\n0\n1\n1\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eso the total number result records matches the amount of records in table one that meet the accountID value of 2 \u003c/p\u003e\n\n\u003cp\u003eI thought this would be an easy change but it is messing me up big time\u003c/p\u003e\n\n\u003cp\u003eThanks for your time\u003c/p\u003e","accepted_answer_id":"13729815","answer_count":"1","comment_count":"0","creation_date":"2012-12-05 17:55:02.563 UTC","last_activity_date":"2012-12-05 18:19:29.823 UTC","last_edit_date":"2012-12-05 18:13:53.523 UTC","last_editor_display_name":"","last_editor_user_id":"1167734","owner_display_name":"","owner_user_id":"1167734","post_type_id":"1","score":"1","tags":"android|mysql","view_count":"62"} +{"id":"30886389","title":"Bootstrap navbar toggle is not working with Laravel","body":"\u003cp\u003eI've following code\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"container\"\u0026gt;\n \u0026lt;div class=\"row\"\u0026gt;\n \u0026lt;nav class = \"navbar navbar-inverse navbar-fixed-top\"\u0026gt;\n \u0026lt;div class=\"navbar-header\"\u0026gt;\n \u0026lt;button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#topMenu\" aria-expanded=\"false\" aria-controls=\"navbar\"\u0026gt;\n \u0026lt;span class=\"sr-only\"\u0026gt;Toggle navigation\u0026lt;/span\u0026gt;\n \u0026lt;span class=\"icon-bar\"\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;span class=\"icon-bar\"\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;span class=\"icon-bar\"\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;/button\u0026gt;\n \u0026lt;a class=\"navbar-brand\" href=\"#\"\u0026gt;Brand\u0026lt;/a\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class = \"collapse navbar-collapse\" id = \"topMenu\"\u0026gt;\n \u0026lt;ul class=\"nav navbar-nav navbar-right\"\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#\" class = 'navAnchor'\u0026gt;Link\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#\" class = 'navAnchor'\u0026gt;Link\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#\" class = 'navAnchor'\u0026gt;Link\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#\" class = 'navAnchor'\u0026gt;Link\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n \u0026lt;/div\u0026gt;\u0026lt;!-- /.navbar-collapse --\u0026gt;\n \u0026lt;/nav\u0026gt;\n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI also have tried to change \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class = \"collapse navbar-collapse\" data-toggle=\"collapse\" id = \"topMenu\"\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut when I resize the screen to view on smaller screen, 3 bars appear, but clicking on them just do nothing.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT\u003c/strong\u003e\nat the top of page\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;link rel=\"stylesheet\" href=\"{{ URL::asset('assets/css/bootstrap.min.css') }}\" /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand at the bottom, inside \u003ccode\u003ebody\u003c/code\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;link rel=\"text/javascript\" href=\"{{ URL::asset('assets/js/jquery.js') }}\" /\u0026gt;\n\u0026lt;link rel=\"text/javascript\" href=\"{{ URL::asset('assets/js/bootstrap.min.js') }}\" /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand by viewing the console(inspect element, it shows no error), every thing is being loaded properly.\ncan someone guide me to right way.\u003c/p\u003e\n\n\u003cp\u003eThanks \u003c/p\u003e","accepted_answer_id":"30886690","answer_count":"2","comment_count":"2","creation_date":"2015-06-17 08:37:42.257 UTC","last_activity_date":"2015-06-17 09:17:58.237 UTC","last_edit_date":"2015-06-17 08:44:47.937 UTC","last_editor_display_name":"","last_editor_user_id":"2558525","owner_display_name":"","owner_user_id":"2558525","post_type_id":"1","score":"0","tags":"jquery|html|css|twitter-bootstrap|laravel","view_count":"2581"} +{"id":"42258656","title":"connection request failed using proxy in several occassion","body":"\u003cp\u003eto get a free connection from my mobile company . I have a proxy host that allow me to connect to the internet using proxifier \u003c/p\u003e\n\n\u003cp\u003ethe problem is if I made a request using proxifier sometimes that request cant pass through \u003c/p\u003e\n\n\u003cp\u003esee this picture for more illustration \u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/PAz8G.jpg\" rel=\"nofollow noreferrer\"\u003efailed requests are in red and successful requests are in black \u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eif I managed to send a successful request to website like youtube through that proxy \nmy session timeout to youtube wont be end until i stop using youtube for five minute or more . so as long as I'am active on youtube I dont have any trouble using it \u003c/p\u003e\n\n\u003cp\u003eand if my session with youtube end I will have to spend sometimes to open it again \u003c/p\u003e\n\n\u003cp\u003eto over come this problem . I'am tunneling my connections through vpn \nthat connect after a while but when I successfully managed to create the tunnel all my request pass through that tunnel \u003c/p\u003e\n\n\u003cp\u003esee this picture for more illustration \u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/C5K6B.jpg\" rel=\"nofollow noreferrer\"\u003ethe first connection is a vpn connection that wont timeout until i close it \u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eso is there any way to keep my connection alive as long as possible with every website I have sent a successful request to ??? so I wont struggle to open it again \u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-02-15 19:44:24.26 UTC","last_activity_date":"2017-02-15 19:44:24.26 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7562433","post_type_id":"1","score":"0","tags":"javascript|ajax|proxy|http-headers|xmlhttprequest","view_count":"27"} +{"id":"35169375","title":"How to check if two drawString() strings intersect?","body":"\u003cp\u003eLike the title says, I need to see if two string locations intersect before drawing them with graphics2d. This way I don't have strings over each other so you can't read them. \u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eSome details:\u003c/strong\u003e \u003c/p\u003e\n\n\u003cp\u003eScreen size is 1000x1000 px. I am randomly generating coordinate locations and fonts at a fixed interval of 10 miliseconds. Then (also every 10 miliseconds) I use g2d.drawString() to draw the word \"popup!\" to the screen in my paintComponent() method with the random fonts and random locations I store previously. However, since I am randomly generating coordinates, this means that ocasionally I have the messages overlap. How can I ensure that this wont happen by either not allowing it to generate the coordinates that overlap or by not printing messages that overlap? \u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eCode:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eFont[] popups = new Font[20];\nint[][] popupsLoc = new int[20][2];\nRandom rn = new Random();\npublic void addPopup() { //is being called every 10 miliseconds by timer \n boolean needPopup = false;\n int where = 0;\n for(int i = 0; i \u0026lt; popups.length; i++) {\n if(popups[i] == null) {\n needPopup = true;\n where = i;\n }\n }\n if(needPopup == true) {\n popups[where] = new Font(\"STENCIL\", Font.BOLD, rn.nextInt(100) + 10);\n popupsLoc[where][0] = rn.nextInt(800);\n popupsLoc[where][1] = rn.nextInt(800);\n }\n }\n} //in paintComponent() I iterate through the popups[] array and draw the element with the font\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003ePaint Code:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic void paintComponent(Graphics g) {\n super.paintComponent(g);\n\n setBackground(Color.BLACK);\n Graphics2D g2d = (Graphics2D) g;\n\n\n for(int i = 0; i \u0026lt; popups.length; i++) {\n if(popups[i] != null) {\n g2d.setColor(popupColor);\n g2d.setFont(popups[i]);\n g2d.drawString(\"Popup!\", popupsLoc[i][0], popupsLoc[i][1]);\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eExample\u003c/strong\u003e\n\u003ca href=\"https://i.stack.imgur.com/fUTer.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/fUTer.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eAs you can see, two of the messages are overlapping here in the bottom right of the screen. How can I prevent that?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdit:\u003c/strong\u003e I have found a very simple solution.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic void addPopup() {\n\n boolean needPopup = false;\n int where = 0;\n for (int i = 0; i \u0026lt; popups.length; i++) {\n\n if (popups[i] == null) {\n needPopup = true;\n where = i;\n }\n }\n if (needPopup == true) {\n boolean doesIntersect = false;\n popups[where] = new Font(\"STENCIL\", Font.BOLD, rn.nextInt(100) + 10);\n popupsLoc[where][0] = rn.nextInt(800);\n popupsLoc[where][1] = rn.nextInt(800);\n\n FontMetrics metrics = getFontMetrics(popups[where]);\n int hgt = metrics.getHeight();\n int wdh = metrics.stringWidth(\"Popup!\");\n popupsHitbox[where] = new Rectangle(popupsLoc[where][0], popupsLoc[where][1], wdh, hgt);\n //System.out.println(hgt);\n\n for (int i = where + 1; i \u0026lt; popups.length; i++) {\n if (popupsHitbox[i] != null) {\n if (popupsHitbox[where].intersects(popupsHitbox[i]))\n doesIntersect = true;\n\n }\n }\n if (doesIntersect == true) {\n popups[where] = null;\n popupsLoc[where][0] = 0;\n popupsLoc[where][1] = 0;\n popupsHitbox[where] = null;\n addPopup();\n }\n }\n\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThen when I draw:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efor (int i = 0; i \u0026lt; popups.length; i++) {\n if (popups[i] != null) {\n g2d.setColor(popupColor);\n g2d.setFont(popups[i]);\n FontMetrics metrics = getFontMetrics(popups[i]);\n g2d.drawString(\"Popup!\", popupsLoc[i][0], popupsLoc[i][1]+metrics.getHeight());\n //g2d.draw(popupsHitbox[i]);\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe explanation is this: When I create a popup font/coord location, I also create a rectangle \"hitbox\" using the coord location and FontMetrics to get the size the message will be in pixels, then I store this rectangle to an array. After that, I have a boolean flag called doesIntersect which is initalized to false. I loop through all the hitboxes and check if the current one intersects() with any others. If so, I set the flag to true. Then, after it checks, if the flag is true it resets that location in the array to null and recalls addPopup(). (There could be some recursion here) Finally, when I paint I just draw the string at the coordinate location, (with y+height since strings paint from bottom left). May not be very clean, but it works. \u003c/p\u003e","answer_count":"1","comment_count":"10","creation_date":"2016-02-03 05:45:16.993 UTC","last_activity_date":"2016-02-15 06:44:14.287 UTC","last_edit_date":"2016-02-04 00:38:19.443 UTC","last_editor_display_name":"","last_editor_user_id":"4484072","owner_display_name":"","owner_user_id":"4484072","post_type_id":"1","score":"1","tags":"java|swing|graphics|awt|java-2d","view_count":"125"} +{"id":"27548193","title":"ggplot2 continous values for discrete scale","body":"\u003cp\u003eI have a data.table formated like this (but bigger) and named data3 :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e V1 V2 V3 V4 V5\n1 6 1 50000000 100000000 0.000000e+00\n2 5 1 50000000 100000000 0.000000e+00\n3 4 1 50000000 100000000 0.000000e+00\n4 3 1 50000000 100000000 0.000000e+00\n5 2 1 50000000 100000000 7.407407e-01\n6 1 1 50000000 100000000 5.925926e+00\n7 -1 1 50000000 100000000 -4.370370e+01\n8 -2 1 50000000 100000000 -7.407407e-01\n9 6 1 150000000 100000000 0.000000e+00\n10 5 1 150000000 100000000 0.000000e+00\n11 4 1 150000000 100000000 0.000000e+00\n12 3 1 150000000 100000000 0.000000e+00\n13 2 1 150000000 100000000 3.703704e+00\n14 1 1 150000000 100000000 5.925926e+00\n15 -1 1 150000000 100000000 -1.481481e+01\n16 -2 1 150000000 100000000 0.000000e+00\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI separated positive and negative values with :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esubdat1=subset(data3, V1\u0026gt;0)\nsubdat2=subset(data3, V1\u0026lt;0)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI made an histogram using this code :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eggplot(data=data3) + \n facet_grid(~V2, space=\"free_x\", scales=\"free_x\", labeller=label_value)+ \n theme(axis.text.x=element_blank(), axis.ticks=element_blank(), axis.title.x=element_blank()) +\n geom_hline(yintercept=0, colour=\"red\", size=1) + \n geom_bar(data=subdat1,aes(x=V3, y=V5, fill=V1, width=V4), stat=\"identity\")+\n geom_bar(data=subdat2,aes(x=V3, y=V5, fill=V1, width=V4), stat=\"identity\") + \n guides(fill=guide_legend(title=\"CNV\"))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd I obtained something close to what I want :\n\u003cimg src=\"https://i.stack.imgur.com/AHYGR.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eBut legend is not discrete (one color per value of V1) and is not in good order.\nSo I tryed this :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eggplot(data=data3)+ \n facet_grid(~V2, space=\"free_x\", scales=\"free_x\", labeller=label_value)+\n theme(axis.text.x=element_blank(), axis.ticks=element_blank(), axis.title.x=element_blank()) +\n geom_hline(yintercept=0, colour=\"red\", size=1) + \n geom_bar(data=subdat1,aes(x=V3, y=V5, fill=V1, width=V4), stat=\"identity\")+\n geom_bar(data=subdat2,aes(x=V3, y=V5, fill=V1, width=V4), stat=\"identity\") + \n guides(fill=guide_legend(title=\"CNV\"))+\n scale_colour_gradient(trans=\"identity\")\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut had the following error :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eErreur : Continuous value supplied to discrete scale\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI thus tried this, to transform values and use discrete levels :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esubdat1$V1 \u0026lt;- factor(subdat1$V1, levels = rev(levels(factor(subdat1$V1))))\nsubdat2$V1 \u0026lt;- factor(subdat2$V1, levels = levels(factor(subdat2$V1)))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand tried again the ggplot but I had this error now :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eErreur dans unit(tic_pos.c, \"mm\") : 'x' and 'units' must have length \u0026gt; 0\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd I have no more idea....\u003cbr\u003e\nHelp would be greatly appreciated !\u003c/p\u003e\n\n\u003cp\u003eEDIT :\nI just tried again with :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eggplot(data=data3)+ \n facet_grid(~V2, space=\"free_x\", scales=\"free_x\", labeller=label_value)+ \n theme(axis.text.x=element_blank(), axis.ticks=element_blank(), axis.title.x=element_blank())+ \n geom_hline(yintercept=0, colour=\"red\", size=1)+ \n geom_bar(data=subdat1,aes(x=V3, y=V5, fill=V1, width=V4), stat=\"identity\")+ \n geom_bar(data=subdat2,aes(x=V3, y=V5, fill=V1, width=V4), stat=\"identity\")+ \n guides(fill=guide_legend(title=\"CNV\"))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand succeed to obtain :\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/dZ0vq.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eSo, I am getting closer.\nHow could I just inverse not only the legend, but also the order in the upper histogram ?\u003c/p\u003e","answer_count":"1","comment_count":"6","creation_date":"2014-12-18 13:53:22.64 UTC","last_activity_date":"2014-12-18 14:55:58.803 UTC","last_edit_date":"2014-12-18 14:55:58.803 UTC","last_editor_display_name":"","last_editor_user_id":"3573401","owner_display_name":"","owner_user_id":"3058063","post_type_id":"1","score":"0","tags":"r|ggplot2","view_count":"420"} +{"id":"12949358","title":"how to get latest 'n' updated row from a table","body":"\u003cblockquote\u003e\n \u003cp\u003e\u003cstrong\u003ePossible Duplicate:\u003c/strong\u003e\u003cbr\u003e\n \u003ca href=\"https://stackoverflow.com/questions/2306744/oracle-sql-how-to-retrieve-highest-5-values-of-a-column\"\u003eOracle SQL - How to Retrieve highest 5 values of a column\u003c/a\u003e \u003c/p\u003e\n\u003c/blockquote\u003e\n\n\n\n\u003cp\u003ei have a table abc, where i have following columns\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eact_id,cust_id,lastUpdatedDate,custActivity\u003c/code\u003e. Where \u003cstrong\u003eact_id is primary key\u003c/strong\u003e .\u003c/p\u003e\n\n\u003cp\u003elastUpdatedDate store last activity done for this customer.\u003c/p\u003e\n\n\u003cp\u003ei am trying to get latest 10 rows for given custid based on lastUpdatedDate.\u003c/p\u003e\n\n\u003cp\u003eHow can i achieve it.\u003c/p\u003e\n\n\u003cp\u003e-vivek\u003c/p\u003e","accepted_answer_id":"12949427","answer_count":"3","comment_count":"0","creation_date":"2012-10-18 07:30:35.7 UTC","last_activity_date":"2012-10-18 08:12:14.807 UTC","last_edit_date":"2017-05-23 12:18:51.213 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"517066","post_type_id":"1","score":"1","tags":"sql|oracle|oracle10g|top-n","view_count":"203"} +{"id":"38868666","title":"MySQL The table is full on query","body":"\u003cp\u003eI can't find the source of the issue on our Master/Slave replication .\u003c/p\u003e\n\n\u003cp\u003eToday i was updating the Master and suddenly got the following error from the slave\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eError 'The table 'caching_api' is full' on query.\n\nQuery: '\nALTER TABLE `caching_api`\nADD UNIQUE INDEX `id` (`id`) USING BTREE ,\nADD INDEX `search` (`component`, `method`) USING BTREE \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt's not a disk issue , the Slave is an exact replicate of the Master \u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/NaPil.jpg\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/NaPil.jpg\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/gaZ5Y.jpg\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/gaZ5Y.jpg\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/JyTmZ.jpg\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/JyTmZ.jpg\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eAnd my.cnf config :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[mysqld]\n#\n# * Basic Settings\n#\nuser = mysql\npid-file = /var/run/mysqld/mysqld.pid\nsocket = /var/run/mysqld/mysqld.sock\nport = 3306\nbasedir = /usr\ndatadir = /data/mysql\ntmpdir = /tmp\nlc-messages-dir = /usr/share/mysql\nskip-external-locking\n\nkey_buffer = 16M\nmax_allowed_packet = 128M\nthread_stack = 192K\nthread_cache_size = 64\n\ntable_open_cache = 3000\njoin_buffer_size = 128k\n\n# This replaces the startup script and checks MyISAM tables if needed\n# the first time they are touched\nmyisam-recover = BACKUP\nmax_connections = 4000\nwait_timeout = 150\ninteractive_timeout = 30\ninnodb_buffer_pool_size = 25G\ninnodb_log_file_size = 1G\n\ninnodb_buffer_pool_instances = 10\ntmp_table_size = 256M\nmax_heap_table_size = 256M\ninnodb_flush_log_at_trx_commit = 2\nquery_cache_limit = 64M\nquery_cache_size = 256M\nrelay_log_space_limit = 10G\nserver-id = 2\nrelay-log = /var/log/mysql/mysqld-relay-bin\nexpire_logs_days = 1\nmax_binlog_size = 100M\nslave-skip-errors = 1062,1054\n\n[mysqldump]\nquick\nquote-names\n\n\n[mysql]\n#no-auto-rehash # faster start of mysql but no tab completition\n\n[isamchk]\nkey_buffer = 16M\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eUpdate to questions from comments :\u003c/strong\u003e\n\u003ca href=\"https://i.stack.imgur.com/HHrro.jpg\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/HHrro.jpg\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/0smEC.jpg\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/0smEC.jpg\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/OfnQT.jpg\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/OfnQT.jpg\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eWhen i try to run the query directly on the SLAVE :\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/xf3E9.jpg\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/xf3E9.jpg\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003ecaching_api table status\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/CTHP2.jpg\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/CTHP2.jpg\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eSlave Disk Info\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/zUZLI.jpg\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/zUZLI.jpg\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eibdata1 about 36GB\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/BR3QV.jpg\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/BR3QV.jpg\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eulimit -a\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/BX9JF.jpg\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/BX9JF.jpg\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e","answer_count":"1","comment_count":"18","creation_date":"2016-08-10 08:59:39.72 UTC","last_activity_date":"2016-08-11 06:45:36.317 UTC","last_edit_date":"2016-08-11 06:45:36.317 UTC","last_editor_display_name":"","last_editor_user_id":"503412","owner_display_name":"","owner_user_id":"503412","post_type_id":"1","score":"0","tags":"mysql|database-replication","view_count":"272"} +{"id":"44537344","title":"How can I add/substract an integer to every value of an dictionary in Python?","body":"\u003cp\u003eAs the title indicates, i have a dictionary that looks like similar to this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edic = {0: 3.2, 1: 3.7, 2: 4.2, 3: 4.7, 4: 5.2, 5: 5.7}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI now want to add or substract an integer value to every value from the dic, but my simple attempt \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edic.values() = dic.values() + 1\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003edidn't work, since we use the .values() function here. Is there a fast and simple way to modify every value of an dictionary in Python?\u003c/p\u003e","accepted_answer_id":"44537368","answer_count":"3","comment_count":"0","creation_date":"2017-06-14 06:44:37.243 UTC","favorite_count":"0","last_activity_date":"2017-06-14 07:00:19.2 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5097398","post_type_id":"1","score":"0","tags":"python|dictionary","view_count":"38"} +{"id":"45884971","title":"Laravel: how to get nested models","body":"\u003cp\u003eCould not you to direct me in right way.\u003c/p\u003e\n\n\u003cp\u003eI have four models: \u003ccode\u003e\"Item\"\u003c/code\u003e belongs to several \u003ccode\u003e\"Category\"\u003c/code\u003e belongs to \u003ccode\u003e\"Shop\"\u003c/code\u003e belongs to \"City\"\u003c/p\u003e\n\n\u003cp\u003eHow can i select Item with all nested models (for json response, for example, it is not important).\u003c/p\u003e\n\n\u003cp\u003eIn other words, i want to get sctructure like that:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e item\n category_1\n shop_1\n shop_2\n city_1\n category_2\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI able to get categories by \u003ccode\u003e$item-\u0026gt;with('categories')\u003c/code\u003e statement, but how i can get nested items in \u003ccode\u003ecategory\u003c/code\u003e (\u003ccode\u003eshops\u003c/code\u003e, and then - \u003ccode\u003ecities\u003c/code\u003e).\u003c/p\u003e\n\n\u003cp\u003eThank you for your help!\u003c/p\u003e","accepted_answer_id":"45885103","answer_count":"1","comment_count":"0","creation_date":"2017-08-25 15:38:19.333 UTC","last_activity_date":"2017-08-25 15:46:41.95 UTC","last_edit_date":"2017-08-25 15:43:04.04 UTC","last_editor_display_name":"","last_editor_user_id":"5436458","owner_display_name":"","owner_user_id":"2822389","post_type_id":"1","score":"3","tags":"php|laravel|nested|models","view_count":"40"} +{"id":"27729499","title":"Not able to display text below icon on button","body":"\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/v82cx.png\" alt=\"enter image description here\"\u003eI want to display text below each image but i am not able to do this how i set this?\nthrough this coding i get my text side by side to my image but i want to display it below image.\u003c/p\u003e\n\n\u003cp\u003ehow i get text exact below of my icon.\u003c/p\u003e\n\n\u003cp\u003ethis is my xml.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:tools=\"http://schemas.android.com/tools\"\n android:id=\"@+id/rl\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"match_parent\"\n android:background=\"#FFFFFF\"\n android:paddingBottom=\"@dimen/activity_vertical_margin\"\n android:paddingTop=\"@dimen/activity_vertical_margin\"\n tools:context=\".MainActivity\" \u0026gt;\n\n \u0026lt;TextView\n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\"\n android:background=\"#2F4F4F\"\n android:gravity=\"center\"\n android:text=\"Select Drinks\"\n android:textColor=\"#FFFFFF\" /\u0026gt;\n\n \u0026lt;LinearLayout\n android:id=\"@+id/ll1\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\"\n android:layout_marginTop=\"@dimen/activity_button_margin_top\"\n android:background=\"#ffffff\"\n android:paddingLeft=\"@dimen/activity_horizontal_margin\"\n android:paddingRight=\"@dimen/activity_horizontal_margin\"\n android:weightSum=\"2\" \u0026gt;\n\n \u0026lt;LinearLayout\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_marginTop=\"@dimen/activity_button_margin_top\"\n android:background=\"@android:drawable/btn_default\"\n android:clickable=\"true\" \u0026gt;\n\n \u0026lt;ImageView\n android:id=\"@+id/imgfirst\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_gravity=\"center_vertical\"\n android:layout_marginLeft=\"15dp\"\n android:src=\"@drawable/beer_cider\" /\u0026gt;\n\n \u0026lt;TextView\n android:id=\"@+id/txt_beer\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_gravity=\"center_vertical\"\n android:text=\"Do stuff\" /\u0026gt;\n \u0026lt;/LinearLayout\u0026gt;\n\n \u0026lt;LinearLayout\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_marginLeft=\"10dp\"\n android:layout_marginTop=\"@dimen/activity_button_margin_top\"\n android:background=\"@android:drawable/btn_default\"\n android:clickable=\"true\" \u0026gt;\n\n \u0026lt;ImageView\n android:id=\"@+id/imgsecond\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_gravity=\"center_vertical\"\n android:layout_marginLeft=\"15dp\"\n android:src=\"@drawable/wine_champagne\" /\u0026gt;\n\n \u0026lt;TextView\n android:id=\"@+id/txtwine\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_gravity=\"center_vertical\"\n android:text=\"Do stuff\" /\u0026gt;\n \u0026lt;/LinearLayout\u0026gt;\n \u0026lt;/LinearLayout\u0026gt;\n\n \u0026lt;RelativeLayout\n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\"\n android:layout_below=\"@+id/ll1\" \u0026gt;\n\n \u0026lt;LinearLayout\n android:id=\"@+id/ll2\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\"\n android:layout_marginTop=\"@dimen/activity_button_margin_top\"\n android:background=\"#ffffff\"\n android:paddingLeft=\"@dimen/activity_horizontal_margin\"\n android:paddingRight=\"@dimen/activity_horizontal_margin\"\n android:weightSum=\"2\" \u0026gt;\n\n \u0026lt;LinearLayout\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_marginTop=\"@dimen/activity_button_margin_top\"\n android:background=\"@android:drawable/btn_default\"\n android:clickable=\"true\" \u0026gt;\n\n \u0026lt;ImageView\n android:id=\"@+id/imgthird\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_gravity=\"center_vertical\"\n android:layout_marginLeft=\"15dp\"\n android:src=\"@drawable/spirits_shots\" /\u0026gt;\n\n \u0026lt;TextView\n android:id=\"@+id/txt_spirits\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_gravity=\"center_vertical\"\n android:text=\"Do stuff\" /\u0026gt;\n \u0026lt;/LinearLayout\u0026gt;\n\n \u0026lt;LinearLayout\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_marginLeft=\"10dp\"\n android:layout_marginTop=\"@dimen/activity_button_margin_top\"\n android:background=\"@android:drawable/btn_default\"\n android:clickable=\"true\" \u0026gt;\n\n \u0026lt;ImageView\n android:id=\"@+id/imgforth\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_gravity=\"center_vertical\"\n android:layout_marginLeft=\"15dp\"\n android:src=\"@drawable/other\" /\u0026gt;\n\n \u0026lt;TextView\n android:id=\"@+id/txtother\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_gravity=\"center_vertical\"\n android:text=\"Do\" /\u0026gt;\n \u0026lt;/LinearLayout\u0026gt;\n \u0026lt;/LinearLayout\u0026gt;\n \u0026lt;/RelativeLayout\u0026gt;\n\n \u0026lt;RelativeLayout\n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\"\n android:layout_alignParentBottom=\"true\" \u0026gt;\n\n \u0026lt;LinearLayout\n android:id=\"@+id/ll3\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\"\n android:background=\"#cccccc\"\n android:weightSum=\"3\" \u0026gt;\n\n \u0026lt;LinearLayout\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_marginTop=\"@dimen/activity_button_margin_top\"\n android:layout_weight=\"1\" \u0026gt;\n\n \u0026lt;ImageView\n android:id=\"@+id/imgfifth\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_gravity=\"left\"\n android:layout_marginLeft=\"15dp\"\n android:src=\"@drawable/drink_icon\" /\u0026gt;\n \u0026lt;/LinearLayout\u0026gt;\n\n \u0026lt;LinearLayout\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_marginLeft=\"10dp\"\n android:layout_marginTop=\"@dimen/activity_button_margin_top\"\n android:layout_weight=\"1\" \u0026gt;\n\n \u0026lt;ImageView\n android:id=\"@+id/imgsixth\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_gravity=\"center_vertical\"\n android:layout_marginLeft=\"15dp\"\n android:src=\"@drawable/date_icon\" /\u0026gt;\n \u0026lt;/LinearLayout\u0026gt;\n\n \u0026lt;LinearLayout\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_marginLeft=\"10dp\"\n android:layout_marginTop=\"@dimen/activity_button_margin_top\"\n android:layout_weight=\"1\" \u0026gt;\n\n \u0026lt;ImageView\n android:id=\"@+id/imgseven\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_marginLeft=\"15dp\"\n android:src=\"@drawable/info_icon\" /\u0026gt;\n \u0026lt;/LinearLayout\u0026gt;\n \u0026lt;/LinearLayout\u0026gt;\n \u0026lt;/RelativeLayout\u0026gt;\n\n\u0026lt;/RelativeLayout\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"3","comment_count":"5","creation_date":"2015-01-01 09:01:55.393 UTC","last_activity_date":"2015-01-01 10:19:59.613 UTC","last_edit_date":"2015-01-01 09:50:13.847 UTC","last_editor_display_name":"","last_editor_user_id":"3354610","owner_display_name":"","owner_user_id":"3354610","post_type_id":"1","score":"-1","tags":"android","view_count":"383"} +{"id":"20097457","title":"jQuery - detect element top change","body":"\u003cp\u003eHow can I detect when an element's top has changed?\u003cbr\u003e\nFor instance, on a div element.\u003cbr\u003e\nmy code like this: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(selector).onchange(\"top\",function() \n{ \n // ...\n});\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"4","creation_date":"2013-11-20 13:36:43.923 UTC","last_activity_date":"2013-11-20 13:37:41.077 UTC","last_edit_date":"2013-11-20 13:37:41.077 UTC","last_editor_display_name":"","last_editor_user_id":"1229023","owner_display_name":"","owner_user_id":"3013198","post_type_id":"1","score":"0","tags":"jquery","view_count":"51"} +{"id":"21254656","title":"How to disable back and forward navigation in AngularJS","body":"\u003cp\u003eI'm using the built in router in Angular.JS to switch between control/template pairs. While switching the pages, the address bar is changed the accordingly. I checked the document, it says AngularJs has synchronized the $location service with the browser address bar.\u003c/p\u003e\n\n\u003cp\u003eMy issue is I really want to disable the back and forth in my pages. It's because by clicking back and forth, I'm not able to fetch the data to fill the page. Previously with JQuery mobile, I've disabled the URL changes in the address bar. By this way, I have basically disabled the back and forth. However, with AngularJS, is there a way to do that?\u003c/p\u003e","answer_count":"4","comment_count":"0","creation_date":"2014-01-21 09:54:32.283 UTC","last_activity_date":"2017-04-11 09:45:44.767 UTC","last_edit_date":"2014-01-21 09:56:40.437 UTC","last_editor_display_name":"","last_editor_user_id":"189756","owner_display_name":"","owner_user_id":"1647800","post_type_id":"1","score":"1","tags":"angularjs|browser-history","view_count":"5215"} +{"id":"17727026","title":"Dojo on (events) firing on declaration","body":"\u003cp\u003eWhile using the new Dojo Event (on) i'm getting a lot of loops.\u003c/p\u003e\n\n\u003cp\u003eI'm calling for the first time as doShowSomeDialog(null).\u003c/p\u003e\n\n\u003cp\u003eWhy does this function get into a loop?\n(dialog has been declared before as dijit/Dialog)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edoShowSomeDialog = function ( value ) {\n\nvar selectName = 'selector';\n\nif ( value ) {\n\n dialog.set(\"href\", \"/url/\"+ selectName +\"/\"+ value );\n\n} else {\n\n dialog.set(\"href\", \"/url\"); \n dialog.show();\n}\n\ndialog.set(\"onDownloadEnd\", function() {\n\n on( dijit.byId(selectName ), \"change\", doShowSomeDialog( dijit.byId( selectName ).get('value') ) );\n\n\n}); } \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt seems that \"on\" executes on the declaration of the event.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-07-18 14:58:12.397 UTC","last_activity_date":"2013-07-18 15:02:06.11 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1581849","post_type_id":"1","score":"0","tags":"events|dojo","view_count":"69"} +{"id":"22090521","title":"How can an element of a string array be used as a variable of another string array in java?","body":"\u003cp\u003efor example i have following code\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eString[] subject = new String[6];\nsubject[1] = JOptionPane.showInputDialog(null, \"Enter subject\");\nString[] subject[1]=new String[6];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eit will not work.There is any other way to do this?\u003c/p\u003e","answer_count":"3","comment_count":"0","creation_date":"2014-02-28 09:02:29.167 UTC","last_activity_date":"2014-02-28 09:51:53.537 UTC","last_edit_date":"2014-02-28 09:03:14.133 UTC","last_editor_display_name":"","last_editor_user_id":"515034","owner_display_name":"","owner_user_id":"3364012","post_type_id":"1","score":"0","tags":"java|arrays","view_count":"50"} +{"id":"47175642","title":"How to Decouple Inheritence in Objective-C","body":"\u003cp\u003eWe have legacy code base and trying to modularise it. Idea is to create frameworks out of individual modules. But these models have lot of dependencies. \u003c/p\u003e\n\n\u003cp\u003eWe have a Base Class A, and two derived classes B and C. We wanted to build separate framework for B and C but not A. In-order to build the framework we had to copy A to B and C which we don't want, because A also has dependency on other classes.\u003c/p\u003e\n\n\u003cp\u003eHow do we seperate the classes so that framework B and C can be built.\u003c/p\u003e\n\n\u003cp\u003eI tried \u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eMaking A as an instance of B, will solve half problem because when some other class refers B using A's Pointer it would not be able to access A's variables because B is not inherited from A.\u003c/li\u003e\n\u003cli\u003eTried using objective c runtime, but no luck there as well.\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eSuggestions are required. \u003c/p\u003e\n\n\u003cp\u003eThanks,\nK.Prabhakar\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2017-11-08 09:12:53.563 UTC","last_activity_date":"2017-11-09 13:35:05.507 UTC","last_edit_date":"2017-11-09 13:35:05.507 UTC","last_editor_display_name":"","last_editor_user_id":"5366426","owner_display_name":"","owner_user_id":"7105262","post_type_id":"1","score":"-2","tags":"objective-c|oop|design-patterns|objective-c-runtime","view_count":"24"} +{"id":"45968849","title":"How to make Kendo-ui tabs load content (iframes with source as java controllers) on demand","body":"\u003cp\u003eI am very new to Kendo-ui. I have been working on creating a page which will have kendo-ui tabs. Each tab has got atleast one iframe which loads the content from the source (which are java controllers). Here is the trimmed version of my jsp\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"demo-section k-content\"\u0026gt;\n \u0026lt;div id=\"tabstrip\"\u0026gt;\n \u0026lt;ul\u0026gt;\n \u0026lt;%} if(helpFlag.equals(\"true\") || helpFlag.equals(\"1\")) {%\u0026gt;\n \u0026lt;li\u0026gt;Help\u0026lt;/li\u0026gt;\n \u0026lt;%} if(materialsFlag.equals(\"true\") || materialsFlag.equals(\"1\")) {%\u0026gt;\n \u0026lt;li class=\"k-state-active\"\u0026gt;Materials\u0026lt;/li\u0026gt;\n \u0026lt;%}else{%\u0026gt;\n \u0026lt;script type=\"text/javascript\"\u0026gt;$(document).ready(function(){$(\"#tabstrip\").kendoTabStrip().data(\"kendoTabStrip\").select(0);});\u0026lt;/script\u0026gt;\n \u0026lt;%} if(jobsFlag.equals(\"true\") || jobsFlag.equals(\"1\")) {%\u0026gt;\n \u0026lt;li\u0026gt;Jobs\u0026lt;/li\u0026gt;\n \u0026lt;%} if(eProfileFlag.equals(\"true\") || eProfileFlag.equals(\"1\")) {%\u0026gt;\n \u0026lt;li\u0026gt;eProfile\u0026lt;/li\u0026gt;\n \u0026lt;%}%\u0026gt;\n \u0026lt;/ul\u0026gt;\n \u0026lt;%} if(helpFlag.equals(\"true\") || helpFlag.equals(\"1\")) {%\u0026gt;\n \u0026lt;div\u0026gt;\n \u0026lt;span class=\"\"\u0026gt;\u0026amp;nbsp;\u0026lt;/span\u0026gt;\n \u0026lt;table style=\"width: 100%;\"\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td style=\"\"\u0026gt;\n \u0026lt;div class=\"panelbar\"\u0026gt;\n \u0026lt;li class=\"k-state-active\" style=\"font-weight: bold;\"\u0026gt;Help\n \u0026lt;div class=\"tabBody\"\u0026gt;\n \u0026lt;iframe src=\"${pageContext.servletContext.contextPath}/help.do\"\n width=\"850px\" height=\"650px\"\u0026gt;\u0026lt;/iframe\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/li\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;/table\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;%} if(materialsFlag.equals(\"true\") || materialsFlag.equals(\"1\")) {%\u0026gt;\n \u0026lt;div\u0026gt;\n \u0026lt;span class=\"\"\u0026gt;\u0026amp;nbsp;\u0026lt;/span\u0026gt;\n \u0026lt;table style=\"width: 100%;\"\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td style=\"\"\u0026gt;\n \u0026lt;div class=\"panelbar\"\u0026gt;\n \u0026lt;li class=\"k-state-active\" style=\"font-weight: bold;\"\u0026gt;Materials\n \u0026lt;div class=\"panelBody\"\u0026gt;\n \u0026lt;img id=\"matloader\" src=\"../loading.gif\" width=\"36\" height=\"36\" alt=\"loading gif\"/\u0026gt;\n \u0026lt;iframe id=\"matFrame\" style=\"display:none;\" src=\"${pageContext.servletContext.contextPath}/materials.do\"\n width=\"100%\" height=\"500px\"\u0026gt;\u0026lt;/iframe\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;script\u0026gt;\n $(document).ready(function () {\n $('#matFrame').on('load', function () {\n $('#matFrame').show();\n $('#matloader').hide();\n });\n });\n \u0026lt;/script\u0026gt;\n \u0026lt;/li\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/td\u0026gt;\n \u0026lt;td style=\"\"\u0026gt;\n \u0026lt;div class=\"panelbar\"\u0026gt;\n \u0026lt;li class=\"k-state-active\" style=\"font-weight: bold;\"\u0026gt;PURCHASING\n \u0026lt;div class=\"panelBody\"\u0026gt;\n \u0026lt;img id=\"purchasingloader\" src=\"../loading.gif\" width=\"36\" height=\"36\" alt=\"loading gif\"/\u0026gt;\n \u0026lt;iframe id=\"purchasingFrame\" style=\"display:none;\" src=\"${pageContext.servletContext.contextPath}/purch.do\"\n width=\"100%\" height=\"500px\"\u0026gt;\u0026lt;/iframe\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;script\u0026gt;\n $(document).ready(function () {\n $('#purchasingFrame').on('load', function () {\n $('#purchasingFrame').show();\n $('#purchasingloader').hide();\n });\n });\n \u0026lt;/script\u0026gt;\n \u0026lt;/li\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;/table\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;%} if(jobsFlag.equals(\"true\") || jobsFlag.equals(\"1\")) {%\u0026gt;\n \u0026lt;div\u0026gt;\n \u0026lt;span class=\"\"\u0026gt;\u0026amp;nbsp;\u0026lt;/span\u0026gt;\n \u0026lt;div class=\"jobs\"\u0026gt;\n \u0026lt;div class=\"panelbar\"\u0026gt;\n \u0026lt;li class=\"k-state-active\" style=\"font-weight: bold;\"\u0026gt;Jobs\n \u0026lt;div class=\"panelBody\"\u0026gt;\n \u0026lt;img id=\"loader1\" src=\"../loading.gif\" width=\"36\" height=\"36\" alt=\"loading gif\"/\u0026gt;\n \u0026lt;iframe id=\"jobsFrame\" style=\"display:none;\" src=\"${pageContext.servletContext.contextPath}/jobs.do\"\n width=\"100%\" height=\"500px\"\u0026gt;\u0026lt;/iframe\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;script\u0026gt;\n $(document).ready(function () {\n $('#jobsFrame').on('load', function () {\n $('#jobsFrame').show();\n $('#loader1').hide();\n });\n });\n \u0026lt;/script\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;%} if(eProfileFlag.equals(\"true\") || eProfileFlag.equals(\"1\")) {%\u0026gt;\n \u0026lt;div\u0026gt;\n \u0026lt;span class=\"\"\u0026gt;\u0026amp;nbsp;\u0026lt;/span\u0026gt;\n \u0026lt;div class=\"eProfile\"\u0026gt;\n \u0026lt;div class=\"panelbar\"\u0026gt;\n \u0026lt;li class=\"k-state-active\" style=\"font-weight: bold;\"\u0026gt;eProfile \u0026lt;div class=\"panelBody\"\u0026gt;\n \u0026lt;img id=\"eProLoader\" src=\"../loading.gif\" width=\"36\" height=\"36\" alt=\"loading gif\"/\u0026gt;\n \u0026lt;iframe id=\"eProFrame\" style=\"display:none;\" src=\"${pageContext.servletContext.contextPath}/eProfile.do\"\n width=\"100%\" height=\"500px\"\u0026gt;\u0026lt;/iframe\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;script\u0026gt;\n $(document).ready(function () {\n $('#eProFrame').on('load', function () {\n $('#eProFrame').show();\n $('#eProLoader').hide();\n });\n });\n \u0026lt;/script\u0026gt;\n \u0026lt;/li\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;%} %\u0026gt;\n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe tabs are configurable, I am reading a properties file to see which tabs needs to be displayed. So the starting part of the jsp check which tabs needs to be displayed and accordingly I am making a list. Rest of the portion does not have much conditions except if the tab needs to be displayed. Now, what is happening is that all the tabs are loading the iFrame content which makes the spinner shown for quite sometime and page takes more time to get fully loaded. I am trying to load the content selectively i.e the default tab should be loaded first and the rest of the tabs should be loaded only when those are clicked. I looked at the kendo-ui API but I did not find any relevant solution.\u003c/p\u003e\n\n\u003cp\u003eI am looking for a solution which can be implemented in JSP using javascript or if there is a need I can call controllers as well.\u003c/p\u003e","accepted_answer_id":"46002862","answer_count":"1","comment_count":"5","creation_date":"2017-08-30 20:05:29.32 UTC","last_activity_date":"2017-09-01 14:50:11.003 UTC","last_edit_date":"2017-08-30 21:00:17.03 UTC","last_editor_display_name":"","last_editor_user_id":"1790283","owner_display_name":"","owner_user_id":"1790283","post_type_id":"1","score":"1","tags":"javascript|java|jsp|kendo-ui|kendo-tabstrip","view_count":"71"} +{"id":"42171836","title":"Can youtube-dl perform multiple downloads to different directories?","body":"\u003cp\u003e\u003ca href=\"https://github.com/rg3/youtube-dl/blob/master/README.md#readme\" rel=\"nofollow noreferrer\"\u003eYoutube-dl\u003c/a\u003e runs with python\u003c/p\u003e\n\n\u003cp\u003eI would like to download multiple YouTube playlists (using the archive feature), but I want those to be downloaded to different local directories.\u003c/p\u003e\n\n\u003cp\u003eI can get this to work for one playlist going to one directory: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e youtube-dl --download-archive \"F:\\Videos\\Online Videos\\Comics\n Explained\\Marvel Major Storylines (Constantly Updated)\\Marvel Major\n Storylines Archive.txt\"\n \"https://www.youtube.com/playlist?list=PL9sO35KZL50yZh5dXW-7l93VZp7Ct4vYA\"\n -o \"F:\\Videos\\Online Videos\\Comics Explained\\%(playlist_title)s\\%(title)s.%(ext)s\" -f\n \"bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best\"\n --ffmpeg-location \"H:\\Documents\\FFMpeg\\bin\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut I don't know if I can do this for multiple playlists going to a separate directory for each playlist. \u003c/p\u003e","accepted_answer_id":"42174549","answer_count":"2","comment_count":"0","creation_date":"2017-02-11 03:25:56.64 UTC","last_activity_date":"2017-02-11 09:58:42.703 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1947026","post_type_id":"1","score":"0","tags":"python|youtube-dl","view_count":"312"} +{"id":"32548236","title":"How to resume background audio in Swift 2 / AVPlayer?","body":"\u003cp\u003eI am learning Swift as my first programming language.\u003c/p\u003e\n\n\u003cp\u003eI've struggled for many hours to \u003cstrong\u003eresume background audio playback\u003c/strong\u003e after interruption (eg call)\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eWhat should happen:\u003c/strong\u003e\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eAudio keeps playing when app goes to background (works) \u003c/li\u003e\n\u003cli\u003eWhen interrupted by a call, get the notification for interruption began\n(works) \u003c/li\u003e\n\u003cli\u003eWhen call ends, get the notification for interruption\nends (works) \u003c/li\u003e\n\u003cli\u003eResume playing the audio (\u003cstrong\u003edoes NOT work - hear nothing\u003c/strong\u003e)\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eReally appreciate any help! Thanks\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eNotes:\u003c/strong\u003e\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eThe app is registered for background audio and plays fine before interruption \u003c/li\u003e\n\u003cli\u003eI have tried with and without the time delay to resume playing - neither work\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003e\u003cstrong\u003eCode:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport UIKit\nimport AVFoundation\n\nvar player: AVQueuePlayer!\n\nclass ViewController: UIViewController {\n\n override func viewDidLoad() {\n super.viewDidLoad()\n do {\n try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayback)\n try AVAudioSession.sharedInstance().setActive(true, withOptions: .NotifyOthersOnDeactivation)\n } catch { }\n let songNames = [\"music\"]\n let songs = songNames.map { AVPlayerItem(URL:\n NSBundle.mainBundle().URLForResource($0, withExtension: \"mp3\")!) }\n player = AVQueuePlayer(items: songs)\n\n let theSession = AVAudioSession.sharedInstance()\n NSNotificationCenter.defaultCenter().addObserver(self,\n selector:\"playInterrupt:\",\n name:AVAudioSessionInterruptionNotification,\n object: theSession)\n\n player.play()\n }\n\n func playInterrupt(notification: NSNotification) {\n\n if notification.name == AVAudioSessionInterruptionNotification\n \u0026amp;\u0026amp; notification.userInfo != nil {\n\n var info = notification.userInfo!\n var intValue: UInt = 0\n (info[AVAudioSessionInterruptionTypeKey] as! NSValue).getValue(\u0026amp;intValue)\n if let type = AVAudioSessionInterruptionType(rawValue: intValue) {\n switch type {\n case .Began:\n print(\"aaaaarrrrgggg you stole me\")\n player.pause()\n\n case .Ended:\n let timer = NSTimer.scheduledTimerWithTimeInterval(3, target: self, selector: \"resumeNow:\", userInfo: nil, repeats: false)\n }\n }\n }\n }\n func resumeNow(timer : NSTimer) {\n player.play()\n print(\"attempted restart\")\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"32635113","answer_count":"4","comment_count":"2","creation_date":"2015-09-13 09:29:14.72 UTC","favorite_count":"9","last_activity_date":"2017-04-19 18:43:26.383 UTC","last_edit_date":"2015-09-13 09:47:35.483 UTC","last_editor_display_name":"","last_editor_user_id":"5205191","owner_display_name":"","owner_user_id":"5205191","post_type_id":"1","score":"6","tags":"ios|swift|audio|avfoundation|avplayer","view_count":"4878"} +{"id":"9257813","title":"Are there standard naming conventions for a catalog override module in Magento?","body":"\u003cp\u003eIf writing a module to add and modify some catalog logic. Is there anything wrong or against any standards/best practices in creating a module named \"Catalog\" that lives in the app/code/local directory?\u003c/p\u003e\n\n\u003cp\u003eexample:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eapp/\n--code/\n----local/\n------Catalog/\n--------controllers/\n--------etc/\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e-or should it be prefixed, something like: Foo_Catalog\u003c/p\u003e\n\n\u003cp\u003eI'm specifically looking if best practices/standards for Magento exist for this. (not just opinion)\u003c/p\u003e","accepted_answer_id":"9258018","answer_count":"1","comment_count":"0","creation_date":"2012-02-13 09:02:21.977 UTC","last_activity_date":"2012-02-13 09:19:53.28 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"711852","post_type_id":"1","score":"0","tags":"magento","view_count":"301"} +{"id":"6824482","title":"Why Base Class Library in .NET?","body":"\u003cp\u003eI am bit confused about the way C# program get executed.\nWhat I learnt till now is,\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eC# program + Base Class library forms a Source code\u003c/li\u003e\n\u003cli\u003eThis source code is given to C# compiler to get converted into MSILIL code.\u003c/li\u003e\n\u003cli\u003eThis MSIL code is handed over to .NET Framework to converted into native code.\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eSo my question is why do we need Base Classes in .NET Framework, as the required Base Classes are already \nconverted to MSIL code?\u003c/p\u003e\n\n\u003cp\u003eAm I getting the above process wrong?\nPlease help!\nI googled it but not able to clear the dought.\nThanks for your kind Attention!\u003c/p\u003e","accepted_answer_id":"6824527","answer_count":"3","comment_count":"2","creation_date":"2011-07-26 02:08:00.823 UTC","favorite_count":"1","last_activity_date":"2015-05-13 15:24:29.523 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"827573","post_type_id":"1","score":"0","tags":"c#","view_count":"949"} +{"id":"13478372","title":"jQuery: append vs appendTo","body":"\u003cp\u003eI am testing Jquery's .append vs .appendTo methods using following code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$('div/\u0026gt;',{\n id : id,\n text : $(this).text()\n }).appendTo('div[type|=\"item\"]#'+id);\n$('div[type|=\"item\"]#'+id).append($(this).text());\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNote that the selectors are identical in .appendTo and .append, yet the latter works (within the same page), while the former does not. Why? How do I get .appendTo to work with this type of (complex) selector? Do the two methods interpolate differently? Is there some syntax I'm missing?\u003c/p\u003e\n\n\u003cp\u003eI don't want to clutter the post with impertinent code--suffice it to say that elements referenced by selectors exist, as is evidenced by the .append method producing desired result--let me know if more info is needed.\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","accepted_answer_id":"13478425","answer_count":"8","comment_count":"3","creation_date":"2012-11-20 17:08:45.197 UTC","favorite_count":"1","last_activity_date":"2017-05-12 10:40:41.823 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1189757","post_type_id":"1","score":"14","tags":"jquery|jquery-selectors","view_count":"26875"} +{"id":"22616126","title":"WebAPI POST, service always receiving null","body":"\u003cp\u003eI've been searching for hours about this problem but I can't seem to find any answer anywhere\u003c/p\u003e\n\n\u003cp\u003eI have built an ASP.NET WebAPI that accepts JSON GET/POST requests and it works A1 when I use fiddler or advanced rest client extension for google chrome.\u003c/p\u003e\n\n\u003cp\u003eNow I have to take an existing android application and modify it to work with my WebAPI. I've cleared all the junk I did not need to make it easier but I still can't POST.\nGET works fine, I receive my response string and everything is fine, but the POST returns a 400 Bad Request.\u003c/p\u003e\n\n\u003cp\u003eMy webApi controller expects a ProblemReports object. ProblemReports has been made by me and it goes like this :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public class ProblemReports\n{\n [Key]\n public int problem_id { get; set; }\n [Required]\n public Nullable\u0026lt;int\u0026gt; request_type { get; set; }\n [Required]\n public Nullable\u0026lt;int\u0026gt; problem_type_id { get; set; }\n public String picture_url { get; set; }\n public contact_information contact_information { get; set; }\n public problem_location problem_location { get; set; }\n public bool dog_on_property { get; set; }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewith subclasses\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public class problem_location\n{\n public String street { get; set; }\n public String city { get; set; }\n public int relative_position_id { get; set; }\n public double longitude { get; set; }\n public double latitude { get; set; }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public class contact_information\n{\n public String name { get; set; }\n public String phone { get; set; }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is the code for my android POST in my service handler class\nThe funny part of this is that I can put a breakpoint before sending my json string to the StringEntity, copy the raw json string, paste it in the BODY section advanced rest client, fill the headers, hit post and boom : Response is 200 OK\u003c/p\u003e\n\n\u003cp\u003eIf I breakpoint my WebAPI on the controller, I can see that when sending the request via Advanced rest client, I can access problemreports, but if I break it on my android app's request, problemreports is null\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic static String POST(String url, ProblemReports report) {\n InputStream inputStream = null;\n String result = \"\";\n\n if (report.picture_url == null)\n {\n report.picture_url = \"no picture\";\n }\n try {\n\n HttpClient httpclient = new DefaultHttpClient();\n HttpPost httpPost = new HttpPost(url);\n String json = \"\";\n JSONObject jsonObject = new JSONObject();\n jsonObject.accumulate(\"request_type\", report.request_type);\n jsonObject.accumulate(\"problem_type_id\", report.problem_type_id);\n jsonObject.accumulate(\"picture_url\", report.picture_url);\n\n JSONObject contact_informationObject = new JSONObject();\n contact_informationObject.accumulate(\"name\",\n report.contact_information.name);\n contact_informationObject.accumulate(\"phone\",\n report.contact_information.phone);\n jsonObject.accumulate(\"contact_information\",\n contact_informationObject);\n\n JSONObject problem_locationObject = new JSONObject();\n problem_locationObject.accumulate(\"street\",\n report.problem_location.street);\n problem_locationObject.accumulate(\"city\",\n report.problem_location.city);\n problem_locationObject.accumulate(\"latitude\",\n report.problem_location.latitude);\n problem_locationObject.accumulate(\"longitude\",\n report.problem_location.longitude);\n problem_locationObject.accumulate(\"relative_position_id\",\n report.problem_location.relative_position_id);\n jsonObject.accumulate(\"problem_location\", problem_locationObject);\n\n jsonObject.accumulate(\"dog_on_property\", report.dog_on_property);\n\n json = jsonObject.toString();\n //String otherJson = \"{ProblemReports: \" + json + \"}\";\n //I saw on the web to add ProblemReports: but it doensn't work\n\n StringEntity se = new StringEntity(json);\n httpPost.setEntity(se);\n httpPost.setHeader(\"Accept\", \"application/json\");\n httpPost.setHeader(\"Content-type\", \"application/json; charset=utf-8\");\n httpPost.setHeader(\n \"Authorization\",\n \"Bearer TokenRemovedBecauseUseless\");\n\n\n HttpResponse httpResponse = httpclient.execute(httpPost);\n inputStream = httpResponse.getEntity().getContent();\n\n if (inputStream != null)\n result = convertInputStreamToString(inputStream);\n else\n result = \"InputStream convert fail!!\";\n\n } catch (Exception e) {\n return e.getCause().toString();\n }\n\n return result;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is the raw JSON string made from my app. That actual string works fine on Fiddler or advanced rest client\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n\"contact_information\":\n{\n \"phone\":\"6666666666\",\n \"name\":\"fiber\"\n},\n\"dog_on_property\":false,\n\"problem_type_id\":3,\n\"request_type\":1,\n\"problem_location\":\n{\n \"longitude\":1234,\n \"latitude\":1234,\n \"relative_position_id\":0,\n \"city\":\"Montreal, QC A1A 1A1\",\n \"street\":\"0000 René-Lévesque Blvd\"\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e}\u003c/p\u003e\n\n\u003cp\u003eI have no idea about what is going on here, any help/tip/advice will do.\nI've set my controller to throw any errors and the only thing I get is 400 BAD REQUEST\u003c/p\u003e\n\n\u003cp\u003eHere the post portion of my controller for \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e // POST api/ProblemReports\n [ResponseType(typeof(ProblemReports))]\n public IHttpActionResult PostProblemReports([FromBody]ProblemReports problemreports)\n {\n var allErrors = ModelState.Values.SelectMany(v =\u0026gt; v.Errors);\n if (!ModelState.IsValid)\n {\n throw new HttpResponseException(Request.CreateErrorResponse(HttpStatusCode.BadRequest, this.ModelState));\n // return BadRequest(ModelState);\n }\n\n try\n {\n db.ProblemReports.Add(problemreports);\n db.SaveChanges();\n }\n catch (Exception ex)\n {\n return Ok(ex);\n }\n\n\n //return CreatedAtRoute(\"DefaultApi\", new { id = problemreports.problem_id }, problemreports);\n ReturnID ri = new ReturnID(problemreports.problem_id);\n return Ok(ri);\n }\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"22637514","answer_count":"1","comment_count":"3","creation_date":"2014-03-24 17:13:14.96 UTC","last_activity_date":"2014-03-25 14:26:34.847 UTC","last_edit_date":"2014-03-24 17:30:10.817 UTC","last_editor_display_name":"","last_editor_user_id":"3232345","owner_display_name":"","owner_user_id":"3232345","post_type_id":"1","score":"0","tags":"c#|android|asp.net|json|asp.net-web-api","view_count":"2621"} +{"id":"36965432","title":"Capturing arrow keys with F# and Eto.Forms","body":"\u003cp\u003eUsing F# and Eto.Forms on linux, with the Gtk3 backend.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT: Adding updates to \u003ca href=\"https://groups.google.com/forum/#!topic/eto-forms/8tivDpoC3Ic\" rel=\"nofollow noreferrer\"\u003ethis google groups thread\u003c/a\u003e\u003c/strong\u003e. My current best theory is that the way Eto adds keypress events to a widget in its Gtk backend does not let you capture events before a default handler both handles them and stops the signal from propagating further.\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003eI'm trying to capture KeyDown events in a form: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e let f = new Form(Topmost=true, ClientSize = new Size(600, 480))\n\n f.KeyDown.Add(fun e -\u0026gt;\n match e.Key with\n | Keys.Up -\u0026gt; cursor.Move(Move_Up)\n // ...\n )\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut I'm running into this issue:\n\u003ca href=\"https://stackoverflow.com/questions/1646998/up-down-left-and-right-arrow-keys-do-not-trigger-keydown-event\"\u003eUp, Down, Left and Right arrow keys do not trigger KeyDown event\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI cannot figure out how to follow the solution provided there (override \u003ccode\u003ePreviewKeyDown\u003c/code\u003e and set \u003ccode\u003ee.IsInputKey = true\u003c/code\u003e) - I tried adding\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ef.PreviewKeyDown.Add(fun e -\u0026gt; e.IsInputKey \u0026lt;- true)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut that just complained that \u003ccode\u003ef.PreviewKeyDown\u003c/code\u003e did not exist.\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003eEDIT: It might be \u003ca href=\"http://gtk-sharp.sourceforge.net/faq.html#3.3\" rel=\"nofollow noreferrer\"\u003ethis Gtk#-specific issue\u003c/a\u003e rather than the one above\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eAs of release 0.15, Gtk# started using the CONNECT_AFTER flag when\n connecting event handlers to signals. This means that the event\n handlers are not run until after the default signal handlers, which\n means that the widget will be updated when the event handlers run. A\n side effect of this change is that in the case where default handlers\n return true to stop signal propogation, Gtk# events will not be\n emitted.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003chr\u003e\n\n\u003cp\u003eFurther detail: If I hold down a modifier key as well (e.g. shift + uparrow), then \u003ccode\u003eKeyDown\u003c/code\u003e triggers and \u003ccode\u003ee.Key\u003c/code\u003e does match \u003ccode\u003eKeys.Up\u003c/code\u003e. Also \u003ccode\u003eKeyUp\u003c/code\u003e always triggers, even when \u003ccode\u003eKeyDown\u003c/code\u003e does not.\u003c/p\u003e","answer_count":"0","comment_count":"6","creation_date":"2016-05-01 10:09:14.673 UTC","last_activity_date":"2016-05-23 19:58:52.267 UTC","last_edit_date":"2017-05-23 12:02:49.873 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"64406","post_type_id":"1","score":"20","tags":".net|f#|eto","view_count":"419"} +{"id":"22866131","title":"background-attachment: fixed - Reverse scroll?","body":"\u003cp\u003eI would like to know how some of the websites use this for their background to scroll upward when you scroll downward.. how do they do it? Is there a jquery code to add to this?\u003c/p\u003e\n\n\u003cp\u003eI have this: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e.featured-container{ \n margin-left: 0px;\n margin-right: 0px; \n\n left:0px;\n\n width: 100%;\n z-index:-6;\n overflow: hidden;\n position: absolute; \n background-image: url(\"../images/subtle.png\");\n background-attachment: fixed;\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"22866952","answer_count":"1","comment_count":"5","creation_date":"2014-04-04 14:53:59.423 UTC","last_activity_date":"2014-04-04 15:29:51.67 UTC","last_edit_date":"2014-04-04 14:59:23.98 UTC","last_editor_display_name":"","last_editor_user_id":"1248177","owner_display_name":"","owner_user_id":"3451555","post_type_id":"1","score":"0","tags":"html|css","view_count":"1325"} +{"id":"45430983","title":"How to define database generated column values as readonly fields in JPA and Hibernate?","body":"\u003cp\u003eWith MariaDB 10.2 it's possible to define default value for Datetime e.g. created and lastModified.\u003c/p\u003e\n\n\u003cp\u003eHow I should access this columns as readonly field? Because this values should only be under control of the database and should not be modify from code, but I want read access to this property in code. \u003c/p\u003e","accepted_answer_id":"45431128","answer_count":"2","comment_count":"0","creation_date":"2017-08-01 06:58:17.77 UTC","last_activity_date":"2017-10-04 06:17:19.903 UTC","last_edit_date":"2017-08-01 07:07:06.937 UTC","last_editor_display_name":"","last_editor_user_id":"1025118","owner_display_name":"","owner_user_id":"1116758","post_type_id":"1","score":"2","tags":"java|hibernate|jpa|mariadb|readonly","view_count":"98"} +{"id":"41526769","title":"Text going over the \u003cdiv\u003e","body":"\u003cp\u003eA user inserts a message into the database, then I SELECT the message and do a echo to put the message in the div.\nFor some reason the text is going over the right border of the div\u003c/p\u003e\n\n\u003cp\u003eI tried using a blockquote and it worked with a random text that W3Schools had there and when I put the echo inside the blockquote it happens anyway. See on the prints: \u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/0Hjt2.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/0Hjt2.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThe parts from the code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\n$sql_post = \"SELECT `dataTopico`,`username`,`titulo`,`mensagem` FROM `\".$bd.\"` WHERE `idTopico`='$id_topico'\";\n$exePost = mysql_query($sql_post);\n$post=mysql_fetch_array($exePost);\n?\u0026gt;\n\n\u0026lt;blockquote\u0026gt;\n WWF has been protecting the future of nature. The world \n leading conservation organization, WWF works in 100 countries and is \n supported by 1.2 million members in the United States and close \n to 5 million globally.\n\u0026lt;/blockquote\u0026gt;\n\n\u0026lt;blockquote\u0026gt;\n \u0026lt;?php echo $post['mensagem'];?\u0026gt;\n\u0026lt;/blockquote\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe query is right; it gets the test message but the text goes over the borders. I want it to go down like the text above.\u003c/p\u003e","accepted_answer_id":"41526848","answer_count":"1","comment_count":"9","creation_date":"2017-01-07 21:29:10.337 UTC","favorite_count":"1","last_activity_date":"2017-01-07 22:50:03.717 UTC","last_edit_date":"2017-01-07 22:50:03.717 UTC","last_editor_display_name":"","last_editor_user_id":"483779","owner_display_name":"","owner_user_id":"6832877","post_type_id":"1","score":"-2","tags":"html|css","view_count":"57"} +{"id":"27084586","title":"Generic typealias in Swift","body":"\u003cp\u003eIn haskell you can do this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etype Parser a = String -\u0026gt; [(a, String)]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI tried to make something similar in Swift. So far I wrote these codes with no luck.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etypealias Parser\u0026lt;A\u0026gt; = String -\u0026gt; [(A, String)]\ntypealias Parser a = String -\u0026gt; [(a, String)]\ntypealias Parser = String -\u0026gt; [(A, String)]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo is this simply impossible in swift? And if it is is there another ways to implement this behavior?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eUPDATE:\u003c/strong\u003e It seems generic typealiases are now supported in swift 3\n\u003ca href=\"https://github.com/apple/swift/blob/master/CHANGELOG.md\"\u003ehttps://github.com/apple/swift/blob/master/CHANGELOG.md\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"27084702","answer_count":"3","comment_count":"0","creation_date":"2014-11-23 01:26:48.797 UTC","favorite_count":"11","last_activity_date":"2017-01-22 08:43:31.907 UTC","last_edit_date":"2016-03-24 10:04:49.303 UTC","last_editor_display_name":"","last_editor_user_id":"216129","owner_display_name":"","owner_user_id":"3068061","post_type_id":"1","score":"40","tags":"swift|generics","view_count":"8235"} +{"id":"28573536","title":"How to store points (coordinates x,y) from a text file in c++ then calculate/display the number of points in that file","body":"\u003cp\u003eThis is what i have done so far , but then I am stuck on how to display x,y or count the number of points in that file. So let's assume we have these points with test1.txt :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e0,1\n0,4\n6,3\n2,4\n5,4\n5,6\n6,4\n5,4\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThank you \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;iostream\u0026gt;\n#include \u0026lt;fstream\u0026gt;\n#include \u0026lt;vector\u0026gt;\n\nusing namespace std;\n\ntypedef struct\n{\n int x;\n int y; \n} point;\n\nint main()\n{\n ifstream input;\n string filename;\n cout \u0026lt;\u0026lt; \"Enter the file name :\" \u0026lt;\u0026lt; endl;\n cin \u0026gt;\u0026gt; filename;\n input.open(filename.c_str());\n\n while(input.fail())\n {\n input.clear();\n cout \u0026lt;\u0026lt;\"Incorrect filename, please enter again\" \u0026lt;\u0026lt; endl;\n cin \u0026gt;\u0026gt; filename ;\n input.open(filename.c_str()) ;\n }\n vector\u0026lt;point\u0026gt; points;\n point tmp;\n while (input \u0026gt;\u0026gt; tmp.x \u0026amp;\u0026amp; input \u0026gt;\u0026gt; tmp.y)\n {\n points.push_back(tmp);\n }; \n cout \u0026lt;\u0026lt; points.size() \u0026lt;\u0026lt; endl; \n return 0;\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"1","creation_date":"2015-02-17 23:57:48.597 UTC","last_activity_date":"2015-02-18 00:43:56.437 UTC","last_edit_date":"2015-02-18 00:00:25.883 UTC","last_editor_display_name":"","last_editor_user_id":"1870232","owner_display_name":"","owner_user_id":"4250969","post_type_id":"1","score":"-3","tags":"c++|vector","view_count":"2452"} +{"id":"46477678","title":"Interface Error: (0, \"\")","body":"\u003cp\u003eI have this error. When I go to a page the second time I get this error and I don't now how to resolve it. I use for connections \u003ccode\u003epymysql\u003c/code\u003e.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eInterfaceError: (0, '')\n127.0.0.1 - - [28/Sep/2017 13:17:46] \"GET /magazin HTTP/1.1\" 302 -\n[2017-09-28 13:17:46,433] ERROR in app: Exception on /magazin [GET]\nTraceback (most recent call last):\n File \"D:\\python2\\lib\\site-packages\\flask\\app.py\", line 1982, in wsgi_app\n response = self.full_dispatch_request()\n File \"D:\\python2\\lib\\site-packages\\flask\\app.py\", line 1614, in full_dispatch_request\n rv = self.handle_user_exception(e)\n File \"D:\\python2\\lib\\site-packages\\flask\\app.py\", line 1517, in handle_user_exception\n reraise(exc_type, exc_value, tb)\n File \"D:\\python2\\lib\\site-packages\\flask\\app.py\", line 1612, in full_dispatch_request\n rv = self.dispatch_request()\n File \"D:\\python2\\lib\\site-packages\\flask\\app.py\", line 1598, in dispatch_request\n return self.view_functions[rule.endpoint](**req.view_args)\n File \"C:\\Users\\Bogdanel\\Desktop\\python\\lifesaver\\index.py\", line 588, in magazin\n con.execute(sql_new_3)\n File \"D:\\python2\\lib\\site-packages\\pymysql\\cursors.py\", line 166, in execute\n result = self._query(query)\n File \"D:\\python2\\lib\\site-packages\\pymysql\\cursors.py\", line 322, in _query\n conn.query(q)\n File \"D:\\python2\\lib\\site-packages\\pymysql\\connections.py\", line 855, in query\n self._execute_command(COMMAND.COM_QUERY, sql)\n File \"D:\\python2\\lib\\site-packages\\pymysql\\connections.py\", line 1071, in _execute_command\n raise err.InterfaceError(\"(0, '')\")\nInterfaceError: (0, '')\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe cursor is never close and i think that it may be the problem but when i close i get another error .I should use multiple cursor and close it after i open ? Please give me an example how i should use ?\nI am a beginner in flask ,pymysql ,python and i need help. \u003c/p\u003e\n\n\u003cp\u003eExemple:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e connection=pymysql.connect(host='localhost',use_unicode=True,charset=\"utf8\",user='root',password='',db='savelives',autocommit=True) \n con=connection.cursor()\n\n @app.route('/magazin',methods=[\"POST\",\"GET\"])\n def magazin():\n sql_new_3=\"SELECT * FROM magazin \"\n con.execute(sql_new_3)\n\n products=con.fetchall()\n\n return render_template('magazin.html',products=products,j=0)\n\n@app.route('/likes',methods=[\"POST\",\"GET\"])\ndef likes():\n com_id=request.args['com_id']\n sle=\"SELECT * FROM likes WHERE user_id='\"+str(session['id'])+\"' AND friend_id='\"+str(session['id'])+\"' AND com_id='\"+str(com_id)+\"'\"\n lee2=con.execute(sle)\n if lee2==0:\n sqlmyqsl=\"INSERT INTO likes VALUES('','\"+str(session['id'])+\"','\"+str(session['user_friend_id'])+\"','\"+com_id+\"','\"+str(1)+\"')\"\n con.execute(sqlmyqsl) \n return \"liked \"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAbove are 2 of my functions that i used in my project and how i used pymysql to connect to database \u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2017-09-28 20:22:05.027 UTC","last_activity_date":"2017-09-29 07:05:35.35 UTC","last_edit_date":"2017-09-29 07:05:35.35 UTC","last_editor_display_name":"","last_editor_user_id":"3968623","owner_display_name":"","owner_user_id":"7906290","post_type_id":"1","score":"0","tags":"python|python-2.7|pymysql","view_count":"73"} +{"id":"23257293","title":"What does this line of Javascript Regex do?","body":"\u003cp\u003eThe line in question is this one:\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003evar extendedXmp = (data.match(/xmpNote:HasExtendedXMP=\"(.+?)\"/i) || [])[1];\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eIt is part of the bigger code chunk here:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ethis.parseCompoundImage = function(data) {\nvar extendedXmp = (data.match(/xmpNote:HasExtendedXMP=\"(.+?)\"/i) || [])[1];\nif (extendedXmp) {\n // we need to clear out JPEG's block headers. Let's be juvenile and don't care about checking this for now, shall we?\n // 2b + 2b + http://ns.adobe.com/xmp/extension/ + 1b + extendedXmp + 4b + 4b\n data = data.replace(new RegExp('[\\\\s\\\\S]{4}http:\\\\/\\\\/ns\\\\.adobe\\\\.com\\\\/xmp\\\\/extension\\\\/[\\\\s\\\\S]' + extendedXmp + '[\\\\s\\\\S]{8}', 'g'), '')\n}\n\nvar xmp = data.match(/\u0026lt;x:xmpmeta [\\s\\S]+?\u0026lt;\\/x:xmpmeta\u0026gt;/g),\n result = {}\nif (!xmp) throw \"No XMP metadata found!\";\nxmp = xmp.join(\"\\n\", xmp);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhich comes from \u003ca href=\"https://github.com/panrafal/depthy/blob/master/app/scripts/controllers/main.js#L77-87\" rel=\"nofollow\"\u003ethe source code of the depthy app\u003c/a\u003e. This chunk of code gets XMP metadata and cleans out the JPEG exif headers using regex. The second line of this code is what confuses me. From what I understand is it tries to match a certain pattern in the data, but I'm not familiar enough with javascript to understand it. Can someone explain to me what that line does?\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","accepted_answer_id":"23257436","answer_count":"1","comment_count":"3","creation_date":"2014-04-23 23:50:13.14 UTC","last_activity_date":"2014-04-24 00:15:34.35 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2079775","post_type_id":"1","score":"0","tags":"javascript|regex","view_count":"72"} +{"id":"33380593","title":"p5.js creating a new Vector error","body":"\u003cp\u003eSo i'm trying to rewrite some of main proccessing sketches to p5.js, but (there is always a but..) i have a problem with creating Vecotrs. I think i'm lacking some simple java script uderstanding here. \u003c/p\u003e\n\n\u003cp\u003eSo i use the example provided with p5.js, and my code looks like that:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar location ;\n\nfunction setup() {\n createCanvas(1000, 1000);\n background(0);\n location = new Vector(0, 0);\n //location = createVector(0, 0); \n //location = new p5.Vector(0, 0);\n}\n\nfunction draw() {\n ellipse(location.x, location.y, 80, 80);\n}\n\nfunction Vector (x,y) {\n this.x = x;\n this.y = x; \n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI tryied 3 ways of creating vectors, the one right now, with creating custom \"class\" Vector, and those 2 commented out. And if i try it out, i have page not found and address bar is changed to \"address to my index.html/p5.Vector%20Object%20:%20[0,%200,%200]\".\u003c/p\u003e\n\n\u003cp\u003eI really have now idea what is wrong.\u003c/p\u003e","accepted_answer_id":"33380768","answer_count":"1","comment_count":"3","creation_date":"2015-10-27 23:57:02.377 UTC","last_activity_date":"2015-10-28 00:15:22.427 UTC","last_edit_date":"2015-10-28 00:08:16.153 UTC","last_editor_display_name":"","last_editor_user_id":"229044","owner_display_name":"","owner_user_id":"3187553","post_type_id":"1","score":"2","tags":"javascript|processing|p5.js","view_count":"409"} +{"id":"27228964","title":"read csv-data with missing values into python using pandas","body":"\u003cp\u003eI have a CSV-file looking like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\"row ID\",\"label\",\"val\"\n\"Row0\",\"5\",6\n\"Row1\",\"\",6\n\"Row2\",\"\",6\n\"Row3\",\"5\",7\n\"Row4\",\"5\",8\n\"Row5\",,9\n\"Row6\",\"nan\",\n\"Row7\",\"nan\",\n\"Row8\",\"nan\",0\n\"Row9\",\"nan\",3\n\"Row10\",\"nan\",\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAll quoted entries are strings. Non-quoted entries are numerical. Empty fields are missing values (NaN), Quoted empty fields still should be considered as empty strings.\nI tried to read it in with pandas read_csv but I cannot get it working the way I would like to have it... It still consideres ,\"\", and ,, as NaN, while it's not true for the first one.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ed = pd.read_csv(csv_filename, sep=',', keep_default_na=False, na_values=[''], quoting = csv.QUOTE_NONNUMERIC)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCan anybody help? Is it possible at all?\u003c/p\u003e","accepted_answer_id":"27267969","answer_count":"3","comment_count":"0","creation_date":"2014-12-01 13:00:01.857 UTC","last_activity_date":"2014-12-03 09:29:17.46 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"815455","post_type_id":"1","score":"0","tags":"python|csv|pandas|missing-data","view_count":"2560"} +{"id":"5705580","title":"contentEditable - Firefox \u003cbr /\u003e tag","body":"\u003cp\u003eFirefox inserts a \u003ccode\u003e\u0026lt;br /\u0026gt;\u003c/code\u003e tag on press enter whereas the other browsers are adding either a \u003ccode\u003e\u0026lt;p\u0026gt;\u003c/code\u003e or \u003ccode\u003e\u0026lt;div\u0026gt;\u003c/code\u003e. I know that chrome and safari are inserting the same tag of the firstchild of the contentEditable div. So do Firefox, however, if the first tag's innerHTML is empty firefox is just ignoring the tag and creating a new line by pushing the default node in the second line and writes directly inside the editor instead of inside a child node. So basically, I want Firefox to write inside the given tag and continue to insert that kind of node on each press on enter. How can it be done? Any suggestions? \u003c/p\u003e","accepted_answer_id":"5721576","answer_count":"2","comment_count":"2","creation_date":"2011-04-18 15:55:44.913 UTC","favorite_count":"2","last_activity_date":"2011-04-20 00:49:12.713 UTC","last_edit_date":"2011-04-20 00:49:12.713 UTC","last_editor_display_name":"","last_editor_user_id":"697529","owner_display_name":"","owner_user_id":"697529","post_type_id":"1","score":"7","tags":"javascript|firefox|contenteditable|enter","view_count":"7061"} +{"id":"24573265","title":"SQL Group by time","body":"\u003cp\u003eI have following table in my SQL Database and need to group it by the max-value of an 5 minute period of time.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e+------+--------+------------------+\n| Path | Sample | DateTime |\n+------+--------+------------------+\n| Srv1 | 0.5 | 2014-07-04 10:48 |\n| Srv1 | 0.7 | 2014-07-04 10:50 |\n| Srv1 | 0.9 | 2014-07-04 10:52 |\n| Srv1 | 0.6 | 2014-07-04 10:54 |\n| Srv2 | 8.2 | 2014-07-04 10:48 |\n| Srv2 | 7.4 | 2014-07-04 10:50 |\n| Srv2 | 10.9 | 2014-07-04 10:52 |\n| Srv2 | 9.9 | 2014-07-04 10:54 |\n| Srv3 | 7.8 | 2014-07-04 10:48 |\n| Srv3 | 1.3 | 2014-07-04 10:50 |\n| Srv3 | 5.7 | 2014-07-04 10:52 |\n| Srv3 | 2.4 | 2014-07-04 10:54 |\n| Srv4 | 4.2 | 2014-07-04 10:47 |\n| Srv4 | 3.8 | 2014-07-04 10:49 |\n| Srv4 | 5.4 | 2014-07-04 10:51 |\n| Srv4 | 2.4 | 2014-07-04 10:53 |\n| Srv5 | 1.6 | 2014-07-04 10:48 |\n| Srv5 | 1.3 | 2014-07-04 10:50 |\n| Srv5 | 1.6 | 2014-07-04 10:52 |\n| Srv5 | 1.3 | 2014-07-04 10:54 |\n+------+--------+------------------+\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFollowing table would be my goal:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e+------+--------+------------------+\n| Path | Sample | DateTime |\n+------+--------+------------------+\n| Srv1 | 0.5 | 2014-07-04 10:45 |\n| Srv1 | 0.9 | 2014-07-04 10:50 |\n| Srv2 | 8.2 | 2014-07-04 10:45 |\n| Srv2 | 10.9 | 2014-07-04 10:50 |\n| Srv3 | 7.8 | 2014-07-04 10:45 |\n| Srv3 | 5.7 | 2014-07-04 10:50 |\n| Srv4 | 6.8 | 2014-07-04 10:45 |\n| Srv4 | 5.4 | 2014-07-04 10:50 |\n| Srv5 | 1.6 | 2014-07-04 10:45 |\n| Srv5 | 1.6 | 2014-07-04 10:50 |\n+------+--------+------------------+\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI tried following code but it didn't put out the expecting result. \u003ccode\u003eGROUP BY me.Path, pd.DateTime, DATEPART(mi, pd.DateTime) % 10\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eMy whole SQL is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT TOP (100) PERCENT me.Path, MAX(pd.SampleValue) AS Sample, pd.DateTime\n FROM Perf.vPerfRaw AS pd\n INNER JOIN dbo.vPerformanceRuleInstance AS pri ON pri.PerformanceRuleInstanceRowId = pd.PerformanceRuleInstanceRowId\n INNER JOIN dbo.vPerformanceRule AS pr ON pr.RuleRowId = pri.RuleRowId\n INNER JOIN dbo.vManagedEntity AS me ON me.ManagedEntityRowId = pd.ManagedEntityRowId\n INNER JOIN dbo.vRule AS vr ON vr.RuleRowId = pri.RuleRowId\n INNER JOIN OperationsManager.dbo.RelationshipGenericView AS rgv ON rgv.TargetObjectDisplayName = me.Path\n WHERE (pr.CounterName = '% Processor Time')\n AND (vr.RuleDefaultName = 'Processor % Processor Time Total 2003'\n OR vr.RuleDefaultName = 'Processor % Processor Time Total Windows Server 2008'\n OR vr.RuleDefaultName = 'Processor Information % Processor Time Total Windows Server 2008 R2'\n OR vr.RuleDefaultName = 'Processor Information % Processor Time Total Windows Server 2012'\n OR vr.RuleDefaultName = 'Processor Information % Processor Time Total Windows Server 2012 R2')\n AND (rgv.SourceObjectDisplayName = 'SVM')\nGROUP BY me.Path, pd.DateTime, DATEPART(mi, pd.DateTime) % 10\nORDER BY me.Path\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"24573663","answer_count":"4","comment_count":"1","creation_date":"2014-07-04 11:27:25.687 UTC","favorite_count":"1","last_activity_date":"2017-01-20 00:14:55.94 UTC","last_edit_date":"2017-01-20 00:14:55.94 UTC","last_editor_display_name":"","last_editor_user_id":"1905949","owner_display_name":"","owner_user_id":"3652595","post_type_id":"1","score":"1","tags":"sql|sql-server|group-by","view_count":"98"} +{"id":"46711294","title":"CloudFoundry UAA Multi instances","body":"\u003cp\u003eWhat’s the recommended setup across CloudFoundry foundations for UAA? When clients can get routed between the foundations how are clients ensured they don't get re-authenticate?\nMore specifically: If an access/id token is generated in one foundation can it be used in the other foundation?\u003c/p\u003e","accepted_answer_id":"47343011","answer_count":"1","comment_count":"0","creation_date":"2017-10-12 13:47:13.653 UTC","last_activity_date":"2017-11-17 03:53:01.63 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"8418407","post_type_id":"1","score":"0","tags":"cloudfoundry|federated-identity|cloudfoundry-uaa","view_count":"29"} +{"id":"41209928","title":"rename all files in folder with random name","body":"\u003cp\u003eI want to rename all files in a folder with random numbers or characters.\u003c/p\u003e\n\n\u003cp\u003eThis my code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$dir = opendir('2009111');\n$i = 1;\n// loop through all the files in the directory\nwhile ( false !== ( $file = readdir($dir) ) ) {\n // do the rename based on the current iteration\n $newName = rand() . (pathinfo($file, PATHINFO_EXTENSION));\n rename($file, $newName);\n // increase for the next loop\n $i++;\n}\n// close the directory handle\nclosedir($dir);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut I get this error:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eWarning: rename(4 (2).jpg,8243.jpg): The system cannot find the file specified\u003c/p\u003e\n\u003c/blockquote\u003e","answer_count":"1","comment_count":"4","creation_date":"2016-12-18 15:34:12.227 UTC","last_activity_date":"2016-12-20 18:48:04.857 UTC","last_edit_date":"2016-12-20 18:27:41.27 UTC","last_editor_display_name":"","last_editor_user_id":"616443","owner_display_name":"","owner_user_id":"6794842","post_type_id":"1","score":"-2","tags":"php","view_count":"56"} +{"id":"37459080","title":"HTML \u0026 REST (dynamic \"id\" in a link)","body":"\u003cp\u003eI am using an HTML as a REST client. I need to send form data to a server.\nOn a server side (implemented with java), a path to my POST(i`m using POST to update my table) method is something like : @Path(\"\u003ca href=\"http://www.something.com/\" rel=\"nofollow\"\u003ehttp://www.something.com/\u003c/a\u003e{id}\")\nThe path works fine, I have tested it with Postman and browser, but for my HTML client, I need the {id} part of \nmy link to be dynamic.\nFor example, I click on some product (lets assume, I have web page with some kind of products), the browser opens a new window, so I can update a information \nabout that product. To make an update, I need that product \"id\" to be in my link as follows : \u003ca href=\"http://www.something.com/\" rel=\"nofollow\"\u003ehttp://www.something.com/\u003c/a\u003e{id}\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;form action=\"http://www.something.com/2\" method=\"post\"\u0026gt;\n \u0026lt;input name=\"id\" type=\"hidden\"\u0026gt;\n \u0026lt;input name=\"product_name\"\u0026gt;\n \u0026lt;input name=\"product_size\"\u0026gt;\n \u0026lt;input name=\"product_number\"\u0026gt;\n \u0026lt;input type=\"submit\" value=\"Add\"\u0026gt;\n\u0026lt;/form\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn the example, I just 'hardcoded' {id} to be equal to 2, and it works!\u003cbr\u003e\nBut how can I make \u003ca href=\"http://www.something.com/\" rel=\"nofollow\"\u003ehttp://www.something.com/\u003c/a\u003e{id} \u0026lt;-- this {id} part to be dynamic(in my index.html file)?\u003c/p\u003e","accepted_answer_id":"37459327","answer_count":"2","comment_count":"1","creation_date":"2016-05-26 11:06:12.463 UTC","favorite_count":"3","last_activity_date":"2016-05-26 12:07:31.297 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5119159","post_type_id":"1","score":"0","tags":"html","view_count":"57"} +{"id":"3372668","title":"C++ class declaration in objective-c header","body":"\u003cp\u003eI want to declare a class c++ style in a objective-c header, but i get an error \"error: expected '=', ',', ';', 'asm' or '__ attribute __' before 'CPPClass'\"\u003c/p\u003e\n\n\u003cp\u003eHere is code from the .h file.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass CPPClass; \n@interface OBJCClass : NSObject \n{ \n CPPClass* m_pCPPObject; \n} \n@end\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eif i implement it objective-c style \u003ccode\u003e@class CPPClass\u003c/code\u003e i get an error when defining it, saying that it can't find the interface declaration. Is there anyway of doing this, otherwise, all the objective-c classes that import my header file with the imported c++ header must also be .mm files.\u003c/p\u003e\n\n\u003cp\u003eps. i've have renamed the m file to mm.\u003c/p\u003e","answer_count":"2","comment_count":"2","creation_date":"2010-07-30 14:56:13.66 UTC","last_activity_date":"2012-03-22 12:41:09.443 UTC","last_edit_date":"2012-03-22 12:41:09.443 UTC","last_editor_display_name":"","last_editor_user_id":"104790","owner_display_name":"","owner_user_id":"406842","post_type_id":"1","score":"0","tags":"c++|objective-c|objective-c++","view_count":"1827"} +{"id":"11573841","title":"how to show second page as starting page on load of simple pager in gwt","body":"\u003cp\u003eI selected 5 th record from the second page of datagrid. After some modifications in the selected row i saved it And reloaded the datagrid.I want previous selected row to be selected after reloading also.\u003c/p\u003e\n\n\u003cp\u003eAny help can be appreciated. \u003c/p\u003e","accepted_answer_id":"11575570","answer_count":"1","comment_count":"0","creation_date":"2012-07-20 06:18:22.897 UTC","last_activity_date":"2012-07-20 08:24:20.967 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1398293","post_type_id":"1","score":"0","tags":"java|gwt","view_count":"87"} +{"id":"45590116","title":"EntityFramework Core HiLo","body":"\u003cp\u003eI've read that in Entity Framework Core HiLo pattern \"Hi\" part is managed by database and \"Lo\" part is managed by Entity Framework in memory. \u003c/p\u003e\n\n\u003cp\u003eHow does Entity Framework generate \"Lo\" part without round-trip to database? \u003c/p\u003e\n\n\u003cp\u003eHow persist the \"Lo\" value between requests? \u003c/p\u003e\n\n\u003cp\u003eAnd most important, is this pattern thread safety?\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-08-09 12:01:09.423 UTC","last_activity_date":"2017-08-09 16:13:36.923 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"8293976","post_type_id":"1","score":"1","tags":"entity-framework-core","view_count":"37"} +{"id":"46282356","title":"ionic 2 REST API : Failed to load url","body":"\u003cp\u003eI have the error while running the command ionic serve. I am trying to call the api using post method.\u003c/p\u003e\n\n\u003cp\u003eI got the error:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eFailed to load \u003ca href=\"http://abc.localhost/api/auth/login\" rel=\"nofollow noreferrer\"\u003ehttp://abc.localhost/api/auth/login\u003c/a\u003e: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '\u003ca href=\"http://localhost:8101\" rel=\"nofollow noreferrer\"\u003ehttp://localhost:8101\u003c/a\u003e' is therefore not allowed access.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eHow can I overcome on this?\u003c/p\u003e\n\n\u003cp\u003eI have written the api's in YII2 framework in api module with below behaviour:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public function behaviors() {\n $behaviors = parent::behaviors();\n $behaviors['contentNegotiator'] = [\n 'class' =\u0026gt; 'yii\\filters\\ContentNegotiator',\n 'formats' =\u0026gt; [\n 'text/html' =\u0026gt; Response::FORMAT_JSON,\n 'application/json' =\u0026gt; Response::FORMAT_JSON,\n 'application/xml' =\u0026gt; Response::FORMAT_XML,\n ],\n ];\n $behaviors['corsFilter'] = [\n 'class' =\u0026gt; \\yii\\filters\\Cors::className(),\n 'cors' =\u0026gt; [\n 'Origin' =\u0026gt; ['*'],\n 'Access-Control-Request-Method' =\u0026gt; ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS'],\n 'Access-Control-Request-Headers' =\u0026gt; ['*'],\n 'Access-Control-Allow-Credentials' =\u0026gt; true,\n 'Access-Control-Max-Age' =\u0026gt; 86400,\n 'Access-Control-Allow-Origin' =\u0026gt; ['*', 'http://abc.localhost/*', 'http://localhost:8101/*']\n ],\n ];\n return $behaviors; }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd my ionic2 cordova api call script is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eloading.present();\nconsole.log(this.singleton.apiGuestToken);\nlet headers = new Headers();\nheaders.append(\"Accept\", 'application/json');\nheaders.append('Content-Type', 'application/json');\nheaders.append('Authorization', this.singleton.apiGuestToken);\nheaders.append('withCredentials', 'true');\nheaders.append('Access-Control-Allow-Origin', 'http://abc.localhost');\n\nlet options = new RequestOptions({ headers: headers });\nconsole.log(options);\nlet paramsData = { 'userType': userType, 'email': this.email, 'password': this.password };\nconsole.log(paramsData);\nthis.http.post('http://abc.localhost/api/auth/login', paramsData, options)\n .map(res =\u0026gt; res.json()) //this.singleton.apiUrl +\n .subscribe(data =\u0026gt; {\n let resultData = JSON.parse(data['_body']);\n console.log(resultData);\n }, error =\u0026gt; {\n console.log(error);// Error getting the data\n loading.dismiss();\n });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eEven, I can't see the post parameters and Authentication in the chrome inspect.\nThanks in advance!\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2017-09-18 14:53:39.873 UTC","last_activity_date":"2017-09-19 09:47:04.137 UTC","last_edit_date":"2017-09-18 17:11:57.397 UTC","last_editor_display_name":"","last_editor_user_id":"1034105","owner_display_name":"","owner_user_id":"5060629","post_type_id":"1","score":"2","tags":"angular|ionic-framework|ionic2|cordova-2.0.0","view_count":"178"} +{"id":"13860497","title":"npm: run scripts from package.json from anywhere inside the project folder","body":"\u003cp\u003eI'm using the \u003ccode\u003escripts\u003c/code\u003e section inside the package.json file to store some commands I have to run regularly.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \"scripts\": {\n \"test\": \"./test/phantomjs ./test/js/run_jasmine_test.coffee ./test/index.html\",\n \"rjs\": \"r.js -o ./js/app.build.js\",\n \"less\": \"lessc -x ./css/app.less \u0026gt; ./css/app.css\"\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ein every command I have got a \u003ccode\u003e./\u003c/code\u003e at the beginning of the path - this is why I can only call \u003ccode\u003enpm run-script rjs\u003c/code\u003e from the project's root directory.\nis there a way to reference the project's root directory inside the package.json so that I can run e.g. \u003ccode\u003enpm test\u003c/code\u003e from anywhere in my project?\u003c/p\u003e","answer_count":"3","comment_count":"0","creation_date":"2012-12-13 13:06:32.583 UTC","favorite_count":"2","last_activity_date":"2017-03-05 23:17:29.283 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"388026","post_type_id":"1","score":"10","tags":"node.js|path|npm","view_count":"7650"} +{"id":"47128386","title":"Java: On object created event","body":"\u003cp\u003eIs there something that I can do to simulate \"on created\" event?\u003c/p\u003e\n\n\u003cp\u003eI have a base class which other people can extend, and currently I have an \u003ccode\u003einit()\u003c/code\u003e that will initialize the instance, but it should be called only after the constructor stack completes.\u003c/p\u003e\n\n\u003cp\u003eIf I call \u003ccode\u003einit()\u003c/code\u003e in the base class' constructor, then I might potentially initialize wrongly, because the subclass' constructor has not finished executing. The subclass can initialize values of some of the protected fields, which would have an impact on how \u003ccode\u003einit()\u003c/code\u003e initializes the instance.\u003c/p\u003e\n\n\u003cp\u003eMy current approach is to make \u003ccode\u003einit()\u003c/code\u003e \u003ccode\u003eprotected final\u003c/code\u003e, and asks that subclasses must call it at the end of their constructor. This approach works, but only provided if subclasses really do follow the instruction.\u003c/p\u003e\n\n\u003ch2\u003eEdit\u003c/h2\u003e\n\n\u003cp\u003eI thought I would give some extra information. This is part of a JavaFX project/custom API. So I had tried using \u003ccode\u003ePlatform.runLater(() -\u0026gt; init())\u003c/code\u003e, which was a major mistake. \u003ccode\u003ePlatform.runLater()\u003c/code\u003e would only run after the whole execution stack completes, which causes the usage of uninitialized instance in this case:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eFoo instance = new Foo();\ninstance.doSomething();\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"3","creation_date":"2017-11-06 01:12:27.037 UTC","favorite_count":"1","last_activity_date":"2017-11-06 01:55:58.587 UTC","last_edit_date":"2017-11-06 01:30:35.76 UTC","last_editor_display_name":"","last_editor_user_id":"2970960","owner_display_name":"","owner_user_id":"2970960","post_type_id":"1","score":"2","tags":"java|constructor","view_count":"58"} +{"id":"33480198","title":"Sort files based on day of week","body":"\u003cp\u003eI have several files:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eFriday.log\nMonday.log\nTuesday.log\nSaturday.log\nSunday.log\nThursday.log\nTuesday.log\nWednesday.log\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to put their filename without .log and contents into one file but in order of day of week starting with Monday to Sunday. I have a command that will put them together without .log but not in order:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eawk 'FNR==1{sub(/[.][^.]*$/\"\", FILENAME); print FILENAME} 1' *.log \u0026gt; all.log \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThat gives me : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eFriday\n... Friday contents\nMonday\n... Monday contents\nTuesday\n... Tuesday contents\nSaturday\n... Saturday contents\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny idea?\u003c/p\u003e","answer_count":"3","comment_count":"0","creation_date":"2015-11-02 14:42:42.033 UTC","last_activity_date":"2015-11-04 02:06:22.38 UTC","last_edit_date":"2015-11-02 16:46:29.013 UTC","last_editor_display_name":"","last_editor_user_id":"5508364","owner_display_name":"","owner_user_id":"5508364","post_type_id":"1","score":"0","tags":"linux|sorting|awk|order","view_count":"234"} +{"id":"29276823","title":"How to make an Image Hyperlinked using Aspose.Words DOM approach?","body":"\u003cp\u003eI am trying to create a Word document using \u003cstrong\u003eAspose.Words for .NET\u003c/strong\u003e using the \u003cstrong\u003eDOM\u003c/strong\u003e approach. How would I make an image hyperlinked?\u003c/p\u003e\n\n\u003cp\u003eThanks,\nVijay\u003c/p\u003e","accepted_answer_id":"29293491","answer_count":"1","comment_count":"0","creation_date":"2015-03-26 11:04:45.603 UTC","last_activity_date":"2015-03-27 04:47:11.203 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2797350","post_type_id":"1","score":"1","tags":"aspose|aspose.words","view_count":"56"} +{"id":"12018806","title":"Seems to be a memory leak in this little piece of code","body":"\u003cp\u003eGetPlayerName gets the name of a player out of the memory. GetPlayerId finds the player's id in the database, and if he's not found, inserts him. It always returns an integer.\u003c/p\u003e\n\n\u003cp\u003eWhenever I pass the playerIDs line, sometimes my memory usage (as shown by taskmgr) jumps up by 4, or a multiple of that. It never seems to go back down, even when I go out of the scope of this function. The location of both playerIDs and playerName is always the same.\u003c/p\u003e\n\n\u003cp\u003eI'm clueless to why this is. If anyone could point me to some direction, that would be awesome.\u003c/p\u003e\n\n\u003cp\u003eThank you in advance,\u003c/p\u003e\n\n\u003cp\u003eCX\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eint playerIDs[MAXPLAYERS];\nfor (int i = 0; i \u0026lt; gd.GetPlayerAmount(); i++)\n{\n string playerName = gd.GetPlayerName(i);\n playerIDs[i] = GetPlayerId(playerName);\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"12018857","answer_count":"3","comment_count":"3","creation_date":"2012-08-18 13:02:07.86 UTC","last_activity_date":"2012-08-21 18:29:27.35 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1100859","post_type_id":"1","score":"0","tags":"c++|memory-leaks","view_count":"112"} +{"id":"45128292","title":"Borrowed value lifetime error","body":"\u003cp\u003eTrying to refactor and cleanup our code we ran into a lifetime compile error. Compiling the following code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efn create_ping_packet\u0026lt;'a\u0026gt;(sequence_number: u16) -\u0026gt; echo_request::MutableEchoRequestPacket\u0026lt;'a\u0026gt; {\n let mut packet_contents = [0; 48];\n let mut ping_packet = echo_request::MutableEchoRequestPacket::new(\u0026amp;mut packet_contents[20..]).unwrap();\n ping_packet.set_icmp_type(IcmpTypes::EchoRequest);\n ping_packet.set_icmp_code(echo_request::IcmpCodes::NoCode);\n ping_packet.set_identifier(902);\n ping_packet.set_sequence_number(sequence_number);\n ping_packet.set_payload(b\"Ring ring\");\n ping_packet\n}\n\nfn main() {\n // ...\n let mut sequence_number = 0;\n loop {\n let packet = create_ping_packet(sequence_number);\n // ...\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eGives us :\u003c/p\u003e\n\n\u003cpre class=\"lang-none prettyprint-override\"\u003e\u003ccode\u003eerror: `packet_contents` does not live long enough\n --\u0026gt; src/main.rs:15:76\n |\n15 | let mut ping_packet = echo_request::MutableEchoRequestPacket::new(\u0026amp;mut packet_contents[20..]).unwrap();\n | ^^^^^^^^^^^^^^^ does not live long enough\n...\n22 | }\n | - borrowed value only lives until here\n |\nnote: borrowed value must be valid for the lifetime 'a as defined on the body at 13:94...\n --\u0026gt; src/main.rs:13:95\n |\n13 | fn create_ping_packet\u0026lt;'a\u0026gt;(sequence_number: u16) -\u0026gt; echo_request::MutableEchoRequestPacket\u0026lt;'a\u0026gt; {\n | __________________________________________________________________________ _____________________^\n14 | | let mut packet_contents = [0; 48];\n15 | | let mut ping_packet = echo_request::MutableEchoRequestPacket::new(\u0026amp;mut packet_contents[20..]).unwrap();\n16 | | ping_packet.set_icmp_type(IcmpTypes::EchoRequest);\n... |\n21 | | ping_packet\n22 | | }\n | |_^\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWe understand the problem is that \u003ccode\u003epacket_contents\u003c/code\u003e is allocated on the stack and goes out of scope at the end of the function. Is there a way to allocate \u003ccode\u003epacket_contents\u003c/code\u003e inside and give it a lifetime of \u003ccode\u003e'a\u003c/code\u003e?\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2017-07-16 11:56:25.923 UTC","last_activity_date":"2017-07-16 11:59:42.36 UTC","last_edit_date":"2017-07-16 11:59:42.36 UTC","last_editor_display_name":"","last_editor_user_id":"2408867","owner_display_name":"","owner_user_id":"8314991","post_type_id":"1","score":"1","tags":"compiler-errors|rust|lifetime","view_count":"46"} +{"id":"42756117","title":"how to display another column not by id java spring mvc?","body":"\u003cp\u003ei have 2 table \n pegawai table and absensi table\ni have issue .. i cant display id from pegawai table when i select it by nip \u003c/p\u003e\n\n\u003cp\u003ethis is my table picture \u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/dmzCq.jpg\" alt=\"relation table\"\u003e\u003c/p\u003e\n\n\u003cp\u003emy view code :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;input type=\"text\" name=\"nip\" id=\"nip\"\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003emy implement code :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e @Override\npublic ResultSet getByNip(String nip) { \n ResultSet rs = (ResultSet) em.createQuery(\"select a.id from Pegawai a WHERE a.nip='\"+nip+\"'\");\n return rs;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003emy controller code :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@RequestMapping(value = \"ProsesAbsensi.htm\", method = RequestMethod.POST)\npublic String prosesAbsensi(ModelMap modelMap, HttpServletResponse response,\n @RequestMapping(value = \"ProsesAbsensi.htm\", method = RequestMethod.POST)\npublic String prosesAbsensi(ModelMap modelMap, HttpServletResponse response,\n @ModelAttribute(\"Absensi\") Absensi a,\n @RequestParam(value = \"nip\", required = false) String nip\n) throws SQLException, IOException {\n PegawaiImplement pi = new PegawaiImplement();\n ResultSet rs = pi.getByNip(nip);\n AbsensiImplement ai = new AbsensiImplement();\n ai.insert(a);\n return \"Depan\";\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ehow do i get id from pegawai table into my controller ? \u003c/p\u003e","accepted_answer_id":"42758442","answer_count":"1","comment_count":"1","creation_date":"2017-03-13 03:18:04.903 UTC","last_activity_date":"2017-03-13 07:33:26.72 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6671863","post_type_id":"1","score":"0","tags":"java|mysql|spring|spring-mvc|controller","view_count":"64"} +{"id":"27351783","title":"Clear Input Value with CSS Only","body":"\u003cp\u003eI have an input as so:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;input type='text' id='mytext' name='mytext' value='Chocolate' /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs it possible that on \u003ccode\u003e#mytext:focus\u003c/code\u003e it will clear the value with CSS only. I know I can use jQuery to do this with \u003ccode\u003e$(\"#mytext\").val(\"\")\u003c/code\u003e but I want to do this with CSS only. I don't mind if it is only supported in modern browsers as well.\u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","answer_count":"3","comment_count":"0","creation_date":"2014-12-08 05:12:59.397 UTC","last_activity_date":"2014-12-08 05:58:45.983 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4134359","post_type_id":"1","score":"0","tags":"html|css","view_count":"381"} +{"id":"21954475","title":"Maintain Java Resource properties file Externally","body":"\u003cp\u003eEarlier I put my properties file within my classpath \u003ccode\u003esrc/\u003c/code\u003e. Now I would like to put it within a folder called \u003ccode\u003econfig/\u003c/code\u003e. This way the end users can actually modify the file by themselves.\u003c/p\u003e\n\n\u003cp\u003eHowever now my code below does not work anymore\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eResourceBundle.getBundle(\"Messages\", Locale.getDefault());\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat I meant by the code doesn't work anymore is, after I deploy the application and I modify the \u003ccode\u003eMessages_en_US.properties\u003c/code\u003e the changes do not take place.\u003c/p\u003e\n\n\u003cp\u003eHow can I achieve what I want ? Should I use \u003ccode\u003egetBundle\u003c/code\u003e at all ?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI have added \u003ccode\u003econfig\u003c/code\u003e folder into the classpath as well, but I am not sure if this is relevant. This is a plain Java application where I am not using Maven or any building tools.\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/fPvZU.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e","answer_count":"1","comment_count":"10","creation_date":"2014-02-22 12:41:06.97 UTC","last_activity_date":"2014-02-22 13:53:10.423 UTC","last_edit_date":"2014-02-22 12:54:38.713 UTC","last_editor_display_name":"","last_editor_user_id":"1412803","owner_display_name":"","owner_user_id":"1412803","post_type_id":"1","score":"2","tags":"java|resourcebundle","view_count":"391"} +{"id":"25134904","title":"How can I install a specific dll from Nuget","body":"\u003cp\u003eNow I already create the nupkg where contain for 4 dll files like \na.dll, b.dll, c.ll and d.dll. \nOn my solution it contains a lot of projects some refer only a.dll and some refer to b.dll c.dll and when I install the pkg to my project all .dll files are referred that I don't need to, I try to delete but it become the same after update Nuget\u003c/p\u003e\n\n\u003cp\u003eSo,while installation of dll how can my project refer to needed dll not all dll from nupkg?\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2014-08-05 09:02:22.137 UTC","favorite_count":"1","last_activity_date":"2014-08-05 09:02:22.137 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2794863","post_type_id":"1","score":"0","tags":"nuget","view_count":"259"} +{"id":"42634736","title":"VSO Hosted Build fails with in dotnet restore step on 3rd part references","body":"\u003cp\u003eI have a .NET Core Web project in VSO that I'm trying to setup a Hosted Build for it. This project references a 3rd party (Syncfusion) and when the dotnet restore step happens It fails with the following error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eUnable to resolve 'Syncfusion.XlsIO.MVC (\u0026gt;= 14.2600.0.32-preview2-final)' for '.NETCoreApp,Version=v1.1'.\nUnable to resolve 'Syncfusion.Compression.MVC (\u0026gt;= 14.2600.0.32-preview2-final)' for '.NETCoreApp,Version=v1.1'.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe Build for this is a very basic build. All I did was take the default VS build definition and added the dotnet restore step after the NeGet restore step.\u003c/p\u003e\n\n\u003cp\u003eI did some reading and found 1 thing that said you needed to include the 3rd party stuff in the packages folder in git repository, so I modified and gitignore file to include the 2 Syncfusion nuget folder from the package directory.\u003c/p\u003e\n\n\u003cp\u003eThe Syncfusion nuget packages are obviously nuget packages, but they are not in the normal nuget. Locally I had to add a new nuget package source pointing to the Syncfusion URL.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdit\u003c/strong\u003e\nBased on other questions and reading. I have made the following changes. First I changed to the Build Steps to be based off of what is listed here (\u003ca href=\"https://www.visualstudio.com/en-us/docs/build/apps/aspnet/ci/build-aspnet-core\" rel=\"nofollow noreferrer\"\u003ehttps://www.visualstudio.com/en-us/docs/build/apps/aspnet/ci/build-aspnet-core\u003c/a\u003e). I then removed the Command Line steps and replaced them with the corresponding .NET Core steps. This makes no difference, just want to list out where I am currently.\u003c/p\u003e\n\n\u003cp\u003eI have added a nuget.config to the root of the project:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" encoding=\"utf-8\"?\u0026gt;\n\u0026lt;configuration\u0026gt;\n \u0026lt;packageSources\u0026gt;\n \u0026lt;!-- remove any machine-wide sources with \u0026lt;clear/\u0026gt; --\u0026gt;\n \u0026lt;clear /\u0026gt;\n \u0026lt;!-- also get packages from the NuGet Gallery --\u0026gt;\n \u0026lt;add key=\"nuget.org\" value=\"https://api.nuget.org/v3/index.json\" /\u0026gt;\n \u0026lt;!-- add a Team Services feed --\u0026gt;\n \u0026lt;add key=\"syncfusion\" value=\"./packages/Syncfusion.Compression.MVC/14.2600.0.32-preview2-final\" /\u0026gt;\n \u0026lt;add key=\"syncfusion\" value=\"./packages/Syncfusion.XlsIO.MVC/14.2600.0.32-preview2-final\" /\u0026gt;\n \u0026lt;/packageSources\u0026gt;\n \u0026lt;activePackageSource\u0026gt;\n \u0026lt;add key=\"All\" value=\"(Aggregate source)\" /\u0026gt;\n \u0026lt;/activePackageSource\u0026gt;\n\u0026lt;/configuration\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe 2 Syncfusion directories listed above are local nuget packages and are part of the git repo. I don't know if the path listed above is correct (it is the correct relative path from the nuget.config file (root of the project).\u003c/p\u003e\n\n\u003cp\u003eStill when the dotnet restore step runs I get the unable to resolve error. For some reason I only get 1 error now for XlsIO one. I do not see the Compression one anywhere in the log\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eFinal working answer\u003c/strong\u003e\nThe nuget.config file that I got to work is\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" encoding=\"utf-8\"?\u0026gt;\n\u0026lt;configuration\u0026gt;\n \u0026lt;packageSources\u0026gt;\n \u0026lt;!-- remove any machine-wide sources with \u0026lt;clear/\u0026gt; --\u0026gt;\n \u0026lt;clear /\u0026gt;\n \u0026lt;!-- also get packages from the NuGet Gallery --\u0026gt;\n \u0026lt;add key=\"nuget.org\" value=\"https://api.nuget.org/v3/index.json\" /\u0026gt;\n \u0026lt;!-- add a Team Services feed --\u0026gt;\n \u0026lt;add key=\"syncfusionCompression\" value=\"packages\\Syncfusion.Compression.MVC\\14.2600.0.32-preview2-final\" /\u0026gt;\n \u0026lt;add key=\"syncfusionXls\" value=\"packages\\Syncfusion.XlsIO.MVC\\14.2600.0.32-preview2-final\" /\u0026gt;\n \u0026lt;/packageSources\u0026gt;\n \u0026lt;activePackageSource\u0026gt;\n \u0026lt;add key=\"All\" value=\"(Aggregate source)\" /\u0026gt;\n \u0026lt;/activePackageSource\u0026gt;\n\u0026lt;/configuration\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"42640185","answer_count":"2","comment_count":"1","creation_date":"2017-03-06 20:15:33.37 UTC","last_activity_date":"2017-03-08 14:17:30.087 UTC","last_edit_date":"2017-03-07 18:35:07.8 UTC","last_editor_display_name":"","last_editor_user_id":"1236573","owner_display_name":"","owner_user_id":"1236573","post_type_id":"1","score":"1","tags":"git|build|vsts-build|syncfusion","view_count":"122"} +{"id":"33803146","title":"How to monitor socket without read data?","body":"\u003cp\u003eI have developed a C program that create a socket and check if we receive traffic on specified Linux interface:\u003c/p\u003e\n\n\u003cp\u003eprogram called like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esh # ./myprogram -t 10 -i eth0\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy program look like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e...\nint main(int argc, char **argv)\n{\n int s, rv;\n int opt;\n struct timeval timeout;\n fd_set fd;\n t_config c;\n\n while ((opt = getopt(argc, argv, \"i:t:\")) != -1) {\n switch (opt) {\n case 'i':\n if(optarg == NULL) {\n usage(argv[0]);\n return 1;\n }\n c.ifname = strdup(optarg);\n break;\n case 't':\n if(optarg == NULL) {\n usage(argv[0]);\n return 1;\n }\n timeout.tv_sec = atol(optarg);\n timeout.tv_usec = 0;\n printf(\"timeout %ld optarg=%s\\n\", timeout.tv_sec, optarg);\n break;\n case 'h':\n default:\n usage(argv[0]);\n return 1;\n }\n }\n s = CreateSocket(\u0026amp;c); // configure, create, bind socket\n FD_ZERO(\u0026amp;fd);\n FD_SET(s,\u0026amp;fd);\n while(1)\n { \n rv = select(s+1, \u0026amp;fd, NULL, NULL, \u0026amp;timeout); \n if(result == -1)\n printf(\"Error occured, err = %s\",strerror(errno));\n else if(rv == 0)\n {\n printf(\"No frame received within %ld\", timeout.tv_sec);\n somefunction();\n }\n else {/* there was data to read */}\n }\n return 0;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe program cannot detect traffic, despite I send traffic to pc my interface.\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2015-11-19 11:50:38.447 UTC","last_activity_date":"2015-11-19 12:06:39.857 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"781252","post_type_id":"1","score":"0","tags":"c|sockets","view_count":"60"} +{"id":"27761950","title":"Chaining CSS keyframe animations behaves differently across browsers","body":"\u003cp\u003eI am trying to animate an SVG logo on load using a simple couple of CSS keyframe animations.\u003c/p\u003e\n\n\u003cp\u003eHowever on Chrome the last two elements just disappear instead of animating out, and on Safari the last few elements ignore their delay differences and all animate out simulatenously.\u003c/p\u003e\n\n\u003cp\u003eOnly on Firefox does the entire animation behave properly.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://codepen.io/mattaningram/pen/OPbxgO\" rel=\"nofollow\"\u003eSee the Codepen here\u003c/a\u003e (open in each browser to see the differences)\u003c/p\u003e\n\n\u003cp\u003eI am using Autoprefixer, and from what I can see in the output CSS file it is simply creating some -webkit- prefixes and that's about it. The desired animations work on other individual elements, so the error isn't there.\u003c/p\u003e\n\n\u003cp\u003eHere is an example of one of the diagonal elements (the ones that have issues on Chrome) output CSS:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e.m-logo-stroke-blue.m-logo-stroke-diag {\n -webkit-animation: fadeInDownRight 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) both, fadeOutUpLeft 0.2s cubic-bezier(0.55, 0.085, 0.68, 0.53) 2.7s forwards;\n animation: fadeInDownRight 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) both, fadeOutUpLeft 0.2s cubic-bezier(0.55, 0.085, 0.68, 0.53) 2.7s forwards;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eReally confused as to why this isn't working properly except on Firefox.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdit:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eSo I discovered that if I make the duration of the animation out of the diagonals LONGER than the delay, it fixes them disappearing on Chrome, but of course it makes the animation very slow. Not sure why that happens.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdit 2:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eOk so my brother figured out a solution, although I really don't know why this works.\u003c/p\u003e\n\n\u003cp\u003eI had this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e.m-logo-stroke-blue {\n \u0026amp;.m-logo-stroke-up {\n animation: fadeInShrink .2s $easeOutQuad .6s both, fadeOutUp .2s $easeInQuad 2s forwards;\n }\n \u0026amp;.m-logo-stroke-across {\n animation: fadeInShrink .2s $easeOutQuad .4s both, fadeOutRight .2s $easeInQuad 2.3s forwards;\n }\n \u0026amp;.m-logo-stroke-diag {\n animation: fadeInDownRight .2s $easeOutQuad both, fadeOutUpLeft .2s $easeInQuad 2.7s forwards;\n }\n}\n\n.m-logo-stroke-red {\n \u0026amp;.m-logo-stroke-up {\n animation: fadeInShrink .2s $easeOutQuad .7s both, fadeOutUp .2s $easeInQuad 2.1s forwards;\n }\n \u0026amp;.m-logo-stroke-diag {\n animation: fadeInDownLeft .2s $easeOutQuad .21s both, fadeOutUpRight .2s $easeInQuad 2.8s forwards;\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand changed it to this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e.m-logo-stroke-blue {\n \u0026amp;.m-logo-stroke-up {\n animation: fadeInShrink .2s $easeOutQuad .6s both, fadeOutUp .2s $easeInQuad 2s forwards;\n }\n \u0026amp;.m-logo-stroke-across {\n animation: fadeInShrink .2s $easeOutQuad .4s both, fadeOutRight .2s $easeInQuad 2.3s forwards;\n }\n \u0026amp;.m-logo-stroke-diag {\n animation: fadeInDownRight .2s $easeOutQuad .21s both, fadeOutUpLeft .2s $easeInQuad 2.5s forwards;\n }\n}\n\n.m-logo-stroke-red {\n \u0026amp;.m-logo-stroke-up {\n animation: fadeInShrink .2s $easeOutQuad .7s both, fadeOutUp .2s $easeInQuad 2.1s forwards;\n }\n \u0026amp;.m-logo-stroke-diag {\n animation: fadeInDownLeft .2s $easeOutQuad .41s both, fadeOutUpRight .2s $easeInQuad 2.6s forwards;\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf you paste that in to the CodePen you will see it works on all browsers.\u003c/p\u003e\n\n\u003cp\u003eFor some reason they both need a delay, and the delay has to be slightly longer? Can someone explain what is going on here?\u003c/p\u003e\n\n\u003cp\u003eI will post as solution if no one can explain soon.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdit 3:\u003c/strong\u003e \u003c/p\u003e\n\n\u003cp\u003eWTF is going on? Now it has stopped working with no change in my code. Did Chrome change how it handles chained CSS animations for the worse.\u003c/p\u003e\n\n\u003cp\u003eIn Chrome the last animation simply doesn't run. In Safari the timing is off. In Firefox it works perfectly as before.\u003c/p\u003e\n\n\u003cp\u003eI am completely baffled here. Please halp.\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2015-01-04 03:03:45.343 UTC","last_activity_date":"2015-02-14 21:14:51.05 UTC","last_edit_date":"2015-02-14 21:14:51.05 UTC","last_editor_display_name":"","last_editor_user_id":"988337","owner_display_name":"","owner_user_id":"988337","post_type_id":"1","score":"2","tags":"css|animation|svg|cross-browser","view_count":"121"} +{"id":"41914254","title":"JavaFx Stop Moving Image Smudging Canvas","body":"\u003cp\u003eI'm trying to make a simple animated menu with images bouncing off around the screen but the images leave a trail where ever the move. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic void handle(long now) {\n // TODO Auto-generated method stub\n boolean intersectFlag = false;\n for(Letter l : letters){\n gameMenuGraphicsContext.drawImage(l.letterImage, l.letterRectangle.getX(), l.letterRectangle.getY());\n l.moveSimple();\n } \n }};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny idea on how to stop this happening?\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2017-01-28 20:02:55.497 UTC","favorite_count":"1","last_activity_date":"2017-01-28 22:33:14.737 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7484030","post_type_id":"1","score":"1","tags":"java|javafx","view_count":"50"} +{"id":"7416495","title":"Best way to measure Tomcat performance and Pool max connections","body":"\u003cp\u003eLet's say that I have one app that have 1000 concurrent users.\u003c/p\u003e\n\n\u003cp\u003eWhat's the best way to measure the Tomcat perfomance? How can I determinate the max number of database connections (pool)?\u003c/p\u003e\n\n\u003cp\u003eHow can I track down memory leak, cpu leak?\u003c/p\u003e","accepted_answer_id":"7416593","answer_count":"1","comment_count":"0","creation_date":"2011-09-14 12:41:24.223 UTC","favorite_count":"0","last_activity_date":"2011-09-14 12:56:35.577 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"800014","post_type_id":"1","score":"4","tags":"java|performance|tomcat","view_count":"2862"} +{"id":"7101077","title":"get_or_create() takes exactly 1 argument (2 given)","body":"\u003cp\u003eLast time I checked, (h) one argument:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efor entry in f['entries']:\n h = {'feed':self, 'link': entry['link'],'title':entry['title'],\n 'summary':entry['summary'],\n 'updated_at':datetime.fromtimestamp(mktime(entry['updated_parsed']))}\n\n en = Entry.objects.get_or_create(h)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis code is failing with the error in the title. What can I check for?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2011-08-18 00:23:59.683 UTC","favorite_count":"1","last_activity_date":"2011-12-10 10:38:47.777 UTC","last_edit_date":"2011-12-10 10:38:47.777 UTC","last_editor_display_name":"","last_editor_user_id":"308903","owner_display_name":"","owner_user_id":"899671","post_type_id":"1","score":"4","tags":"python|django|django-models","view_count":"2607"} +{"id":"7267657","title":"Android XML parsing","body":"\u003cp\u003eI have a problem with parsing xml by an android, a document that is parsed well with Java EE, do not want parsed into an android. Using SAX. Maybe someone encountered this problem.\u003c/p\u003e","accepted_answer_id":"7267897","answer_count":"1","comment_count":"6","creation_date":"2011-09-01 08:17:41.983 UTC","last_activity_date":"2011-09-01 09:04:02.293 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"923063","post_type_id":"1","score":"0","tags":"android|xml-parsing","view_count":"402"} +{"id":"4910133","title":"Using GIT or SVN in XCode 3/4 without server","body":"\u003cp\u003eOk, perhaps I'm trying to accomplish something not doable.\u003c/p\u003e\n\n\u003cp\u003eI am a single developer (not part of team).\u003c/p\u003e\n\n\u003cp\u003eI'm trying to get some kind of versioning system going. I had used CVS with XCode 3, but XCode 4 no longer has that as an option. I've heard that SVN and Git are better alternatives anyway.\u003c/p\u003e\n\n\u003cp\u003eBasically, I've wasted more than half a day trying to get XCode to work with SVN / Git out of the box. I do not have a server running, and would rather not expose my project on a server.\u003c/p\u003e\n\n\u003cp\u003eIt doesn't make sense for me to have a separate user just to run the Git/SVN Servers, either.\u003c/p\u003e\n\n\u003cp\u003eI'm just trying to have version control using either one, in the simplest possible way.\u003c/p\u003e\n\n\u003cp\u003eI've tried to add Repo, using local file path (/Volumes/AAA/BBB/Repo) where I manually created the \"Repo\" directory. I've set the type as Subversion (and also tried Git). XCode says \"Host is reachable\". But, the Commit functionality is not there (Disabled). I can't import my working directory.\u003c/p\u003e\n\n\u003cp\u003eI just don't get it - must I have a server running in order to have SVN/Git, or can XCode just do it through command line? I much more prefer it being done over command line, since the server is complete overkill. Or, am I missing something? Maybe I'm putting in the wrong settings into XCode?\u003c/p\u003e\n\n\u003cp\u003eThis isn't strictly an XCode 4 issue, I had the same issue with XCode3, but at least it had the CVS option - now it's gone.\u003c/p\u003e","accepted_answer_id":"4910364","answer_count":"2","comment_count":"0","creation_date":"2011-02-05 22:33:42.653 UTC","favorite_count":"1","last_activity_date":"2012-10-10 22:21:43.907 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"527525","post_type_id":"1","score":"3","tags":"objective-c|xcode|svn|git|version-control","view_count":"2059"} +{"id":"5138556","title":"Inline XSLT syntax used in Javascript","body":"\u003cp\u003eI'd like to parse a SOAPUI Project file and generate some documentation from the file. I've written an XSLT to parse the project (my plan being that I run a scheduled job using Msxsl to automatically generate the latest \"documentation\" for my smoke tests).\u003c/p\u003e\n\n\u003cp\u003eThe problem \u003e\u003e\n my xml files will contain multiple projects and within those projects there are lists of test cases. I'd ideally like to wrap those test cases in a collapsible div so that the overall document is more readable. Currently my div is being created and I'm trying to give it a unique name using the position of the Testsuite node.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" encoding=\"ISO-8859-1\"?\u0026gt;\n\n \u0026lt;xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" xmlns:con=\"http://eviware.com/soapui/config\"\u0026gt;\n \u0026lt;xsl:output method=\"html\" encoding =\"utf-8\"/\u0026gt;\n \u0026lt;xsl:template match=\"/\"\u0026gt;\n \u0026lt;html\u0026gt;\n \u0026lt;head\u0026gt;\n \u0026lt;script language=\"javascript\"\u0026gt;\n function toggleDiv(divid){\n if(document.getElementById(divid).style.display == 'none')\n {\n document.getElementById(divid).style.display = 'block';\n }\n else\n {\n document.getElementById(divid).style.display = 'none';\n }\n }\n \u0026lt;/script\u0026gt;\n\n \u0026lt;style type=\"text/css\"\u0026gt;\n body {font-family:Arial,Helvetica; }\n\n h1 {color:black;\n font-size:0.975em;\n\n }\n\n h2.ex {color:black;\n font-size:0.875em;\n\n\n }\n\n li.tc {\n font-size:0.875em;\n }\n\n p.desc {\n margin: 2%;\n border: 1px dotted black;\n font-size:0.775em;\n line-height:90%\n }\n\n\n \u0026lt;/style\u0026gt;\n \u0026lt;/head\u0026gt;\n \u0026lt;body\u0026gt;\n\n \u0026lt;xsl:apply-templates/\u0026gt;\n\n \u0026lt;/body\u0026gt;\n \u0026lt;/html\u0026gt;\n \u0026lt;/xsl:template\u0026gt;\n\n \u0026lt;xsl:template match=\"con:soapui-project\"\u0026gt;\n \u0026lt;h1\u0026gt;\n Project Name:\u0026lt;xsl:value-of select=\"@name\"/\u0026gt;\n \u0026lt;/h1\u0026gt;\n \u0026lt;br /\u0026gt;\n \u0026lt;xsl:apply-templates/\u0026gt;\n\n \u0026lt;/xsl:template\u0026gt;\n\n\n\n \u0026lt;xsl:template match=\"con:testSuite\"\u0026gt;\n \u0026lt;hr\u0026gt;\u0026lt;/hr\u0026gt;\n\n \u0026lt;a href=\"javascript:;\" onmousedown=\"toggleDiv('\u0026lt;xsl:value-of select=\"position()\"/\u0026gt;');\"\u0026gt;\n \u0026lt;xsl:attribute name=\"onmousedown\"\u0026gt;\u0026lt;xsl:value-of select=\"position()\"/\u0026gt;\u0026lt;/xsl:attribute\u0026gt; \n \u0026lt;h2 class=\"ex\"\u0026gt;\n TestSuite: \u0026lt;xsl:value-of select=\"@name\"/\u0026gt;\n \u0026lt;/h2\u0026gt;\n \u0026lt;/a\u0026gt;\n \u0026lt;br\u0026gt;\n \u0026lt;p class=\"desc\"\u0026gt;\n Description: \u0026lt;xsl:value-of select=\"con:description\"/\u0026gt;\n\n \u0026lt;/p\u0026gt;\n \u0026lt;/br\u0026gt;\n\n \u0026lt;br /\u0026gt;\n \u0026lt;div id=\"mydiv\" style=\"display:none\"\u0026gt;\n \u0026lt;xsl:apply-templates /\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/xsl:template\u0026gt;\n\n\n \u0026lt;xsl:template match=\"con:testCase\"\u0026gt;\n\n \u0026lt;ul\u0026gt;\n \u0026lt;li class=\"tc\"\u0026gt;\n (#\u0026lt;xsl:value-of select=\"position()-3\"/\u0026gt;) Testcase: \u0026lt;xsl:value-of select=\"@name\"/\u0026gt;\n \u0026lt;/li\u0026gt;\n\n \u0026lt;xsl:if test=\"con:description=''\"\u0026gt;\n (RICHARD - PLEASE PROVIDE A DESCRIPTION!!)\n \u0026lt;/xsl:if\u0026gt;\n\n \u0026lt;p class=\"desc\"\u0026gt;\n Description: \u0026lt;xsl:value-of select=\"con:description\"/\u0026gt;\n \u0026lt;/p\u0026gt;\n \u0026lt;/ul\u0026gt;\n \u0026lt;xsl:apply-templates /\u0026gt;\n\n \u0026lt;/xsl:template\u0026gt;\n\n\n \u0026lt;xsl:template match=\"*\"\u0026gt;\u0026lt;/xsl:template\u0026gt;\n\n\n \u0026lt;/xsl:stylesheet\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis currently fails because of a validation error when I try to put XSLT syntax into the Javascript. I feel like I'm close, but usual escape methods aren't working for me. \u003c/p\u003e\n\n\u003cp\u003eCan someone offer the final piece?\u003c/p\u003e\n\n\u003cp\u003eCheers,\n- Richard\u003c/p\u003e","accepted_answer_id":"5142844","answer_count":"3","comment_count":"4","creation_date":"2011-02-28 05:31:57.247 UTC","last_activity_date":"2011-02-28 13:53:49.197 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"480106","post_type_id":"1","score":"2","tags":"javascript|xml|xslt","view_count":"1586"} +{"id":"25041825","title":"Pyserial can't read 'large' data in multiple threads","body":"\u003cp\u003eI've been trying to port a script to Windows from Linux that records data from a mic array via the serial port. The Linux version uses the \u003ccode\u003etermios\u003c/code\u003e module which isn't supported on Windows so I'm using \u003ccode\u003ePyserial\u003c/code\u003e instead. \u003c/p\u003e\n\n\u003cp\u003eThe script starts three \u003ccode\u003ethreads\u003c/code\u003e which repeatedly put ~4MB of data per thread into a queue. My problem is that, with Pyserial, if each thread is reading more than the 4k receive \u003ccode\u003ebuffer\u003c/code\u003e only one or none of the threads actually receives data from \u003ccode\u003e.read()\u003c/code\u003e Below is a little test script to demonstrate my problem. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enumThreads = 3\nreadSize = 4128000\nq = Queue.Queue()\ncomPort = serial.Serial(port = 'COM5', baudrate = 115200)\n\ndef read_task(port, threadID, readSize):\n q.put((threadID, comPort.read(readSize)))\n\nthreads = [threading.Thread(target=read_task, args=(i,) for i in range(numThreads)]\nfor t in threads:\n t.daemon = True\n t.start()\n\nfor t in threads:\n t.join()\n\nwhile 1:\n try:\n _,item = q.get(False)\n print hex(ord(item[0]))\n print len(item)\n except Queue.Empty:\n break \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAt the end I print the hex value of the first byte of each queue element that I get. I do this because I know that if the thread was actually reading data, every byte would be a non-zero value.\u003cbr\u003e\nSo the output would look something like: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e0x94\n4128000\n0x00\n4128000\n0x00\n4128000 \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo the first thread to call read was able to read data and the other two weren't and just returned a string of 0x00's. Is there anything I can do to get multiple threads to read that much data at one time. \u003c/p\u003e\n\n\u003cp\u003eI took a look at the \u003ccode\u003ekernel32.dll\u003c/code\u003e functions that Pyserial uses in \u003ccode\u003eserialwin32.py\u003c/code\u003e to execute .read() but I have no experience working with win32 API and I'm still fairly new to python so I can't really figure where to go from here.\u003c/p\u003e\n\n\u003cp\u003eI was just told to try to edit the read function in serialwin32 so that it's \"non-overlapping\". I'm going to try it. \u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2014-07-30 16:13:46.783 UTC","last_activity_date":"2014-07-30 17:32:10.297 UTC","last_edit_date":"2014-07-30 17:32:10.297 UTC","last_editor_display_name":"","last_editor_user_id":"3889568","owner_display_name":"","owner_user_id":"3889568","post_type_id":"1","score":"0","tags":"python|windows|multithreading|buffer|pyserial","view_count":"278"} +{"id":"42086183","title":"How to modify xml subnodes with XQuery on SQL Server","body":"\u003cp\u003eFor an xml field (SQL Server) I need to add a node in every subnode, based on a source table and a condition.\nThis is my xml data:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edeclare @X table (XMLDATA xml)\ninsert @X values('\n\u0026lt;row\u0026gt;\n \u0026lt;node\u0026gt;\n \u0026lt;name\u0026gt;Francesco\u0026lt;/name\u0026gt;\n \u0026lt;/name\u0026gt;\n \u0026lt;node\u0026gt;\n \u0026lt;label\u0026gt;Alessandro\u0026lt;/name\u0026gt;\n \u0026lt;/node\u0026gt;\n \u0026lt;node\u0026gt;\n \u0026lt;name\u0026gt;Daniele\u0026lt;/name\u0026gt;\n \u0026lt;/node\u0026gt;\n\u0026lt;/row\u0026gt;')\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFor every \u003ccode\u003e\u0026lt;name\u0026gt;\u003c/code\u003e, I want to add a node \u003ccode\u003e\u0026lt;number\u0026gt;\u003c/code\u003e. The matches for numbers and names are written in a table \u003ccode\u003e@T\u003c/code\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edeclare @T table (name varchar(20), number int)\ninsert @T values\n('Alessandro', 24)\n,('Francesco', 10)\n,('Daniele', 16)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eTo update the nodes I use \u003ccode\u003eXMLDATA.modify\u003c/code\u003e, and I use xpath conditions to select the right node:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eupdate @X set XMLDATA.modify('insert element number {sql:column(\"number\")} as last into (row/node[name=sql:column(\"name\")])[1]')\nfrom @X\ncross join @T\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe query above works only for the first row of \u003ccode\u003e@T\u003c/code\u003e (in the example is Alessandro/24). The other 2 rows of \u003ccode\u003e@T\u003c/code\u003e are ignored. I need to add \u003ccode\u003enumber\u003c/code\u003e to every \u003ccode\u003enode\u003c/code\u003e. \nThis is the final XMLDATA:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;row\u0026gt;\n \u0026lt;node\u0026gt;\n \u0026lt;name\u0026gt;Francesco\u0026lt;/name\u0026gt;\n \u0026lt;/node\u0026gt;\n \u0026lt;node\u0026gt;\n \u0026lt;name\u0026gt;Alessandro\u0026lt;/name\u0026gt;\n \u0026lt;number\u0026gt;24\u0026lt;/number\u0026gt;\n \u0026lt;/node\u0026gt;\n \u0026lt;node\u0026gt;\n \u0026lt;name\u0026gt;Daniele\u0026lt;/name\u0026gt;\n \u0026lt;/node\u0026gt;\n\u0026lt;/row\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"42087244","answer_count":"2","comment_count":"4","creation_date":"2017-02-07 09:30:42.253 UTC","last_activity_date":"2017-04-14 14:27:50.42 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3641564","post_type_id":"1","score":"1","tags":"sql-server|xml|xpath|xquery|xquery-sql","view_count":"184"} +{"id":"32114713","title":"Why isn't the user authenticated?","body":"\u003cp\u003e\u003cstrong\u003eStartup.cs:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class Startup\n {\n public IConfiguration Configuration { get; set; }\n\n public Startup(IApplicationEnvironment env)\n {\n var builder = new ConfigurationBuilder(env.ApplicationBasePath)\n .AddJsonFile(\"Config.json\")\n .AddEnvironmentVariables();\n Configuration = builder.Build();\n }\n\n public void ConfigureServices(IServiceCollection services)\n {\n services.Configure\u0026lt;Constants\u0026gt;(constants =\u0026gt;\n {\n constants.DefaultAdminUsername = Configuration[\"DefaultAdminUsername\"];\n constants.DefaultAdminPassword = Configuration[\"DefaultAdminPassword\"];\n });\n\n //services.AddTransient\u0026lt;EF.DatabaseContext\u0026gt;(x =\u0026gt; EF.DAL.RepositoryIoCcontainer.GetContext(Configuration[\"Data:DefaultConnection:ConnectionString\"]));\n\n EF.DatabaseContext.ConnectionString = Configuration[\"Data:DefaultConnection:ConnectionString\"];\n\n services.AddAuthorization();\n services.AddAuthentication();\n services.AddMvc();\n services.AddSession();\n services.AddCaching();\n }\n\n public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)\n {\n loggerFactory.AddConsole(LogLevel.Warning);\n\n #region Configure the HTTP request pipeline.\n // Add the following to the request pipeline only in development environment.\n if (env.IsDevelopment())\n {\n app.UseBrowserLink();\n app.UseErrorPage(new ErrorPageOptions() { SourceCodeLineCount = 10 });\n app.UseDatabaseErrorPage(DatabaseErrorPageOptions.ShowAll);\n }\n else\n {\n // Add Error handling middleware which catches all application specific errors and\n // sends the request to the following path or controller action.\n app.UseErrorHandler(\"/Home/Error\");\n }\n\n // Add static files to the request pipeline.\n app.UseStaticFiles();\n\n app.UseSession();\n\n // Add cookie-based authentication to the request pipeline.\n app.UseCookieAuthentication(options =\u0026gt;\n {\n options.AutomaticAuthentication = true;\n options.AuthenticationScheme = CookieAuthenticationDefaults.AuthenticationScheme;\n options.AccessDeniedPath = new PathString(\"/Account/Denied\");\n options.CookieName = \"WNCT Coockie\";\n options.CookieSecure = CookieSecureOption.Always;\n options.ExpireTimeSpan = TimeSpan.FromMinutes(30); \n options.SlidingExpiration = true; \n options.LoginPath = new PathString(\"/Account/Login\");\n options.LogoutPath = new PathString(\"/Account/Logout\");\n });\n\n // Add MVC to the request pipeline.\n app.UseMvc(routes =\u0026gt;\n {\n routes.MapRoute(\n name: \"default\",\n template: \"{controller=Home}/{action=Index}/{id?}\");\n });\n #endregion\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eAccount controller:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[HttpPost]\n [AllowAnonymous]\n [ValidateAntiForgeryToken]\n public async System.Threading.Tasks.Task\u0026lt;IActionResult\u0026gt; Login(LoginModel model, string returnUrl)\n {\n LDAP.ALUHTTPAuthentication auth = new LDAP.ALUHTTPAuthentication(model.UserName, model.Password);\n\n if (ModelState.IsValid \u0026amp;\u0026amp; auth.IsAuthenticated)\n {\n IUserServices ius = RepositoryIoCcontainer.GetImplementation\u0026lt;IUserServices\u0026gt;();\n //check if user is registered in the tool\n User user = ius.Get(csl: model.UserName);\n\n if (false)//user == null)\n {\n\n }\n else\n {\n //set user claim\n var claims = new List\u0026lt;Claim\u0026gt;\n {\n //new Claim(ClaimTypes.IsPersistent, \"true\", \"bool\"),\n new Claim(ClaimTypes.Role, \"somerole\"),\n new Claim(ClaimTypes.Name, \"thename\")\n //new Claim(\"Monitoring\", user.UserFeatures.First(x =\u0026gt; x.Feature.Name == \"Monitoring\").Allowed.ToString(), \"bool\")\n }; \n\n var claimsPrincipal = new ClaimsPrincipal(new ClaimsIdentity(claims, CookieAuthenticationDefaults.AuthenticationScheme));\n\n await Context.Authentication.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme, claimsPrincipal);\n }\n\n return RedirectToLocal(returnUrl);\n }\n\n // If we got this far, something failed, redisplay form\n ModelState.AddModelError(\"\", \"You cannot log in with the provided credentials. Please check, and try again.\");\n\n return View(model);\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThat was my code, and from what I remember it used to work but now I don't know what's up. \u003c/p\u003e\n\n\u003cp\u003eCan anyone shed some light on why isn't the user authenticated?\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2015-08-20 09:36:46.65 UTC","last_activity_date":"2015-11-29 06:29:48.427 UTC","last_edit_date":"2015-11-29 06:29:48.427 UTC","last_editor_display_name":"","last_editor_user_id":"61164","owner_display_name":"","owner_user_id":"2390894","post_type_id":"1","score":"0","tags":"asp.net-core|asp.net-core-mvc|claims-based-identity","view_count":"972"} +{"id":"17414612","title":"IOS Set UIViews on top of each other in storyboard","body":"\u003cp\u003eHow can I place UIViews on top of each other in the storyboard without nesting the UIView within each other? I want them to be subviews of the parent UIView, not subviews of each other. The default functionality always forces UIViews to go within each other, not on top of one another.\u003c/p\u003e\n\n\u003cp\u003eI am doing this because there will be background methods that control the visibility of such UIViews, which are connected via IBOutlet.\u003c/p\u003e","accepted_answer_id":"17414690","answer_count":"1","comment_count":"0","creation_date":"2013-07-01 22:19:46.377 UTC","last_activity_date":"2013-07-01 22:26:53.96 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"859434","post_type_id":"1","score":"2","tags":"ios|uiview|storyboard","view_count":"1134"} +{"id":"45738221","title":"Make span clickable inside a clickable row","body":"\u003cp\u003eI have the following code:\u003c/p\u003e\n\n\u003cp\u003e\u003cdiv class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\"\u003e\r\n\u003cdiv class=\"snippet-code\"\u003e\r\n\u003cpre class=\"snippet-code-js lang-js prettyprint-override\"\u003e\u003ccode\u003e$(\".clickable\").click(function() {\r\n window.location = $(this).data(\"target\");\r\n});\r\n$(\".clickableB\").click(function() {\r\n alert('I got a click');\r\n});\u003c/code\u003e\u003c/pre\u003e\r\n\u003cpre class=\"snippet-code-html lang-html prettyprint-override\"\u003e\u003ccode\u003e\u0026lt;script src=\"https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\r\n\u0026lt;table class=\"table\"\u0026gt;\r\n \u0026lt;thead\u0026gt;\r\n \u0026lt;tr\u0026gt;\r\n \u0026lt;th\u0026gt;Employee\u0026lt;/th\u0026gt;\r\n \u0026lt;th\u0026gt;Total hours\u0026lt;/th\u0026gt;\r\n \u0026lt;th\u0026gt;Comments\u0026lt;/th\u0026gt;\r\n \u0026lt;th\u0026gt;Options\u0026lt;/th\u0026gt;\r\n \u0026lt;/tr\u0026gt;\r\n \u0026lt;/thead\u0026gt;\r\n \u0026lt;tbody\u0026gt;\r\n \u0026lt;tr data-toggle=\"modal\" data-target=\"#events-modal\" class=\"clickable success\"\u0026gt;\r\n \u0026lt;td\u0026gt;Pedro\u0026lt;/td\u0026gt;\r\n \u0026lt;td\u0026gt;1\u0026lt;/td\u0026gt;\r\n \u0026lt;td\u0026gt;This is a very loooooooooooooooooooong text\u0026lt;/td\u0026gt;\r\n \u0026lt;td\u0026gt;\r\n \u0026lt;span style=\"color:green\" class=\"clickableB fa fa-check-square\"\u0026gt;\u0026lt;/span\u0026gt;\r\n \u0026lt;span style=\"color:orange\" class=\"clickableB fa fa-warning\"\u0026gt;\u0026lt;/span\u0026gt;\r\n \u0026lt;span style=\"color:red\" class=\"clickableB fa fa-minus-square\"\u0026gt;\u0026lt;/span\u0026gt;\r\n \u0026lt;/td\u0026gt;\r\n \u0026lt;/tr\u0026gt;\r\n \u0026lt;/tbody\u0026gt;\r\n\u0026lt;/table\u0026gt;\r\n\r\n\u0026lt;div class=\"modal fade\" id=\"events-modal\"\u0026gt;\r\n \u0026lt;div class=\"modal-dialog\"\u0026gt;\r\n \u0026lt;div class=\"modal-content\"\u0026gt;\r\n \u0026lt;div class=\"modal-header\"\u0026gt;\r\n \u0026lt;button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-hidden=\"true\"\u0026gt;\u0026amp;times;\u0026lt;/button\u0026gt;\r\n \u0026lt;h4 class=\"modal-title\"\u0026gt;Modal title\u0026lt;/h4\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"modal-body\" style=\"height: 400px\"\u0026gt;\r\n \u0026lt;p\u0026gt;One fine body\u0026amp;hellip;\u0026lt;/p\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"modal-footer\"\u0026gt;\r\n \u0026lt;button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\"\u0026gt;Close\u0026lt;/button\u0026gt;\r\n \u0026lt;button type=\"button\" class=\"btn btn-primary\"\u0026gt;Save changes\u0026lt;/button\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;/div\u0026gt;\u0026lt;!-- /.modal-content --\u0026gt;\r\n \u0026lt;/div\u0026gt;\u0026lt;!-- /.modal-dialog --\u0026gt;\r\n\u0026lt;/div\u0026gt;\u0026lt;!-- /.modal --\u0026gt;\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003c/p\u003e\n\n\u003cp\u003eThen, what I want to get is to show a modal when a click in the row but get an alert when I click on the icons/spans. Everytime I click in the icons, the modal shows up.\u003c/p\u003e","accepted_answer_id":"45738556","answer_count":"5","comment_count":"0","creation_date":"2017-08-17 14:42:38.143 UTC","last_activity_date":"2017-08-17 14:57:04.673 UTC","last_edit_date":"2017-08-17 14:51:57.137 UTC","last_editor_display_name":"","last_editor_user_id":"3573336","owner_display_name":"","owner_user_id":"3573336","post_type_id":"1","score":"0","tags":"javascript|jquery|html|css","view_count":"83"} +{"id":"12262722","title":"Drupal Form Alter hook","body":"\u003cp\u003eI am using mymodule_form_alter hook \u003c/p\u003e\n\n\u003cp\u003eI want to change values of fields of form after submit.\u003c/p\u003e\n\n\u003cp\u003eAnybody have an idea how to do this. I am using drupal7.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eHere is the code\u003c/strong\u003e \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction check_domain_form_alter(\u0026amp;$form, \u0026amp;$form_state, $form_id) {\n switch ($form_id) {\n case \"user_register_form\":\n $form['#submit'][] = 'check_domain_user_register_form_submit';\n break;\n }\n}\n\nfunction check_domain_user_register_form_submit($form, \u0026amp;$form_state) {\n $form_state['input']['profile_main']['field_firm_company_name']['und'][0]['value']='test';\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"12263887","answer_count":"1","comment_count":"0","creation_date":"2012-09-04 11:39:06.6 UTC","last_activity_date":"2012-12-07 13:26:47.13 UTC","last_edit_date":"2012-12-07 13:26:47.13 UTC","last_editor_display_name":"","last_editor_user_id":"337103","owner_display_name":"","owner_user_id":"1618761","post_type_id":"1","score":"0","tags":"drupal|module|drupal-7|drupal-modules","view_count":"1462"} +{"id":"3933881","title":"Is there an elegant way to track the modification of all columns of one table in SQL Server 2008","body":"\u003cp\u003eThere is a table in my database containing 100 columns. I want to create a trigger to audit the modification for every update operation. \u003c/p\u003e\n\n\u003cp\u003eWhat I can think is to create the update clause for all columns but they are all similar scripts. So is there any elegant way to do that?\u003c/p\u003e","accepted_answer_id":"3934261","answer_count":"4","comment_count":"1","creation_date":"2010-10-14 13:53:02.683 UTC","favorite_count":"0","last_activity_date":"2013-05-30 09:46:59.013 UTC","last_edit_date":"2013-05-30 09:46:59.013 UTC","last_editor_display_name":"","last_editor_user_id":"1823225","owner_display_name":"","owner_user_id":"304319","post_type_id":"1","score":"6","tags":"sql-server|sql-server-2008|audit","view_count":"344"} +{"id":"8638962","title":"what is the best way to get the base URL from a controller","body":"\u003cp\u003eInside my controller how would i get the base URL.\u003c/p\u003e\n\n\u003cp\u003efor example, if my url is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ehttp://www.mysite.com/MyController/MyAction\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to have a function that returns :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ehttp://www.mysite.com\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"8639056","answer_count":"2","comment_count":"4","creation_date":"2011-12-26 20:39:09.74 UTC","favorite_count":"2","last_activity_date":"2014-11-28 10:24:51.367 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4653","post_type_id":"1","score":"5","tags":"asp.net-mvc","view_count":"7595"} +{"id":"5135198","title":"Why can't I call an function in an anonymous namespace from within another function?","body":"\u003cp\u003eI have written this piece of code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enamespace {\n\nvoid SkipWhiteSpace(const char *\u0026amp;s) {\n if (IsWhiteSpace(*s)) {\n s++;\n }\n}\n\nbool IsWhiteSpace(char c) {\n return c == ' ' || c == '\\t' || c == '\\n';\n}\n\n} // namespace\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe problem is that the compiler complains that \u003ccode\u003eIsWhiteSpace()\u003c/code\u003e \u003ccode\u003ewas not declared in this scope\u003c/code\u003e. But why? Sure, the namespace is anonymous but still the functions lie within the same namespace, aren't they?\u003c/p\u003e","accepted_answer_id":"5135215","answer_count":"1","comment_count":"0","creation_date":"2011-02-27 19:02:13.177 UTC","favorite_count":"0","last_activity_date":"2011-02-27 19:11:02.953 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1178669","post_type_id":"1","score":"1","tags":"c++|namespaces","view_count":"317"} +{"id":"33429044","title":"Loop within block appending to array in the wrong order - Swift 2.0","body":"\u003cp\u003eI have an array of PFFiles downloaded from Parse, and I am trying to convert them in to an array of NSData (imageDataArray) in order to save them to Core Data. The only problem I seem to be having now is that the elements of imageDataArray are being added in the wrong order, which means the wrong image is found when I search through Core Data.\u003c/p\u003e\n\n\u003cp\u003eI found this question (\u003ca href=\"https://stackoverflow.com/questions/32163480/how-to-make-loop-wait-until-block-has-finished\"\u003eStack Overflow Question\u003c/a\u003e) which seems to explain the reason for the problem as being that the block is completing the tasks at different times, therefore the order of the array is based on whichever is finished first. They then suggest using Grand Central Dispatch, but it is all in Obj C and, as a newbie to coding, I am struggling to convert it to Swift for my project. \u003c/p\u003e\n\n\u003cp\u003eCould you please explain to me how I would use GCD (or any other method) to create the imageDataArray in the same order as the original PFFile array?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e override func viewDidLoad() {\n super.viewDidLoad()\n\n\n let appDel: AppDelegate = UIApplication.sharedApplication().delegate as! AppDelegate\n\n let context: NSManagedObjectContext = appDel.managedObjectContext\n\n\n let dealsQuery = PFQuery(className: (\"Deals\"))\n dealsQuery.orderByAscending(\"TrailId\")\n\n dealsQuery.findObjectsInBackgroundWithBlock { (objects, error) -\u0026gt; Void in\n if let objects = objects {\n\n self.trailID.removeAll(keepCapacity: true)\n self.trailStep.removeAll(keepCapacity: true)\n self.dealNumber.removeAll(keepCapacity: true)\n self.imageFile.removeAll(keepCapacity: true)\n\n for object in objects {\n\n self.trailID.append(object[\"TrailID\"] as! Int)\n self.trailStep.append(object[\"TrailStep\"] as! Int)\n self.dealNumber.append(object[\"dealNumber\"] as! Int)\n self.imageFile.append(object[\"dealImage\"] as! PFFile!)\n\n }\n\n }\n\n\n var counter = 0\n\n for file in self.imageFile {\n\n let dealImage = file\n\n dealImage.getDataInBackgroundWithBlock({ (imageData: NSData?, error: NSError?) -\u0026gt; Void in\n\n if error == nil {\n\n weak var aBlockSelf = self\n\n let image = UIImage(data: imageData!)\n aBlockSelf!.imageDataArray.append(imageData!)\n self.imagesArray.append(image!)\n\n if counter == self.trailStep.count - 1{\n\n print(self.trailID.count)\n print(self.trailStep.count)\n print(self.dealNumber.count)\n print(self.imageDataArray.count)\n\n print(self.trailStep[0])\n print(self.dealNumber[0])\n let image = UIImage(data: self.imageDataArray[0])\n self.imageView.image = image\n\n } else {counter++}\n }\n\n })\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSorry for posting all of my code here. I guess the issue is at the bottom, but as a beginner I thought I might have made a mistake somewhere else so thought I would be best posting it all.\u003c/p\u003e\n\n\u003cp\u003eThanks a lot for your help.\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003e\u003cstrong\u003eUpdate 1\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI have tried adding a prefilled array (imageArray) and trying to put the data in to that, but it still comes out random when searching for trailStep and dealNumber. What am I missing? Thanks\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e var i = 0\n\n var imageArray = [NSData!](count: self.trailStep.count, repeatedValue: nil)\n\n for file in self.imageFile {\n\n let dealImage = file\n\n dealImage.getDataInBackgroundWithBlock({ (imageData: NSData?, error: NSError?) -\u0026gt; Void in\n\n if error == nil {\n\n //weak var aBlockSelf = self\n\n let image = UIImage(data: imageData!)\n imageArray[i] = imageData!\n\n if i == self.trailStep.count - 1{\n\n print(self.trailID.count)\n print(self.trailStep.count)\n print(self.dealNumber.count)\n print(self.imageDataArray.count)\n\n print(self.trailStep[3])\n print(self.dealNumber[3])\n let image = UIImage(data: imageArray[3])\n self.imageView.image = image\n\n } else {i++}\n }\n\n })\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003chr\u003e\n\n\u003cp\u003e\u003cstrong\u003eUpdate 2\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI have been researching and having a play around with GCD and serial dispatches, and here is where I am at the moment. I think I am taking a far too simplistic view of GCD but can't quite get my head around how it works and how it can get my block to add to imageDataArray in the right order.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar counter = 0\n\n var imageArray = [NSData!](count: self.trailStep.count, repeatedValue: nil)\n\n weak var aBlockSelf = self\n\n var serialQueue = dispatch_queue_create(\"serial\", nil)\n\n for file in self.imageFile {\n\n let dealImage = file\n\n var imageDataArray = [NSData!](count: self.imageFile.count, repeatedValue: nil)\n\n dispatch_async(serialQueue, { () -\u0026gt; Void in\n\n dealImage.getDataInBackgroundWithBlock({ (imageData: NSData?, error: NSError?) -\u0026gt; Void in\n\n\n\n if error == nil {\n\n let imageIndex = self.imageFile.indexOf(file)\n let image = UIImage(data: imageData!)\n imageDataArray.insert(imageData!, atIndex: imageIndex!)\n\n if counter == self.trailStep.count - 1{\n\n print(self.trailID.count)\n print(self.trailStep.count)\n print(self.dealNumber.count)\n print(imageDataArray.count)\n\n print(self.trailStep[0])\n print(self.dealNumber[0])\n let image = UIImage(data: imageDataArray[4])\n self.imageView.image = image\n\n } else {counter++}\n\n return\n }\n\n })\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis code is returning an error of \"unexpectedly found nil while unwrapping an Optional value\" on the line \" let image = UIImage(data: imageDataArray[4])\". This is the same error that I was getting before I tried to implement the GCD...\u003c/p\u003e","accepted_answer_id":"33433592","answer_count":"2","comment_count":"0","creation_date":"2015-10-30 05:09:25.7 UTC","last_activity_date":"2015-11-02 07:35:04.51 UTC","last_edit_date":"2017-05-23 11:52:49.807 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"5501226","post_type_id":"1","score":"3","tags":"arrays|xcode|swift|parse.com|grand-central-dispatch","view_count":"428"} +{"id":"33250718","title":"How do I create a function in Javascript that returns the sum of all items in an array added together?","body":"\u003cp\u003eI'm having a competition with my friend, he told me to-\nCreate a function called addThemAllTogether that takes in an array of numbers and returns the total of all of the items in the array added together.\u003c/p\u003e\n\n\u003cp\u003eWhat does that look like in Javascript?\u003c/p\u003e","answer_count":"2","comment_count":"4","creation_date":"2015-10-21 04:00:46.097 UTC","last_activity_date":"2015-10-21 04:27:59.31 UTC","last_edit_date":"2015-10-21 04:08:11.943 UTC","last_editor_display_name":"","last_editor_user_id":"5469804","owner_display_name":"","owner_user_id":"5469804","post_type_id":"1","score":"-4","tags":"javascript|arrays|sum","view_count":"341"} +{"id":"34669479","title":"Not able to upload large files in amazon s3","body":"\u003cp\u003eI am trying to upload large files like audio and video in amazon s3, django is throwing worker timeout. If so i use different credentials then its working fine. Just replacing the credentials of other account does the work. When I revert back the credentials to the other account it’s failing. But it works for small files less than 3mb. I hope I might have missed out some settings in my amazon s3 dashboard for this particular account. could anyone help me out?\u003c/p\u003e","answer_count":"0","comment_count":"6","creation_date":"2016-01-08 04:24:39.71 UTC","last_activity_date":"2016-01-08 04:24:39.71 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5760834","post_type_id":"1","score":"0","tags":"django|amazon-web-services|amazon-s3","view_count":"143"} +{"id":"7059638","title":"Is it possible to use jquery/javascript to load in a flash player?","body":"\u003cp\u003eI have a flash video player and I am just testing to see if I can use jquery/javascript to load that player in. I am trying to make it so that I can load different players in when I need to. Anyone have any ideas on this or know if it is possible? I know my code is wrong but I don't know how else to illustrate what I want to do.\u003c/p\u003e\n\n\u003cp\u003eIf I take the below code and simply paste it into the html of the page on startup (without trying to use javascript or jquery to load it) then my video will work fine.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$('#container').html('\u0026lt;div class=\"test\"\u0026gt;\u0026lt;/div\u0026gt;\u0026lt;script\u0026gt; \\\n/* \u0026lt;![CDATA[ */ \\\nflowplayer(\".test\", \"player/player.swf\", { \\\nclip: { \\\nbufferLength: \"0\", \\\nautoPlay: true, \\\nautoBuffering: true, \\\nscaling: \\'scale\\', \\\nurl:\\'video_handler.php?file=somefile\\' \\\n}, \\\n}); \\\n/* ]]\u0026gt; */ \\\n\u0026lt;\\/script\u0026gt;');\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"7059675","answer_count":"2","comment_count":"0","creation_date":"2011-08-14 20:51:16.543 UTC","last_activity_date":"2011-08-14 23:37:23.453 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"301121","post_type_id":"1","score":"1","tags":"javascript|jquery|flash","view_count":"818"} +{"id":"37235179","title":"How to read gvfs file by TStream","body":"\u003cp\u003eLinux feature is gvfs. I see TFileStream don't support gvfs files. So I need some other TStream object to read gvfs files. Do such streams exist?\u003c/p\u003e\n\n\u003cp\u003eLazarus 1.7, fpc 3.0\u003c/p\u003e\n\n\u003cp\u003egvfs exposed to system as files:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e/run/user/1000/gvfs/ftp:host=ftp.scene.org/ls-lR\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"2","creation_date":"2016-05-15 06:17:36.003 UTC","last_activity_date":"2016-05-15 11:24:27.813 UTC","last_edit_date":"2016-05-15 09:51:03.397 UTC","last_editor_display_name":"","last_editor_user_id":"1789574","owner_display_name":"","owner_user_id":"1789574","post_type_id":"1","score":"-1","tags":"freepascal","view_count":"46"} +{"id":"16101409","title":"Is there some elegant way to pause \u0026 resume any other goroutine in golang?","body":"\u003cp\u003eIn my case, I have thousands of goroutines working simultaneously as \u003ccode\u003ework()\u003c/code\u003e. I also had a \u003ccode\u003esync()\u003c/code\u003e goroutine. When \u003ccode\u003esync\u003c/code\u003e starts, I need any other goroutine to pause for a while after sync job is done. Here is my code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar channels []chan int\nvar channels_mutex sync.Mutex\n\nfunc work() {\n channel := make(chan int, 1)\n channels_mutex.Lock() \n channels = append(channels, channel)\n channels_mutex.Unlock()\n for {\n for {\n sync_stat := \u0026lt;- channel // blocked here\n if sync_stat == 0 { // if sync complete\n break \n }\n }\n // Do some jobs\n if (some condition) {\n return\n }\n }\n}\n\nfunc sync() {\n channels_mutex.Lock()\n // do some sync\n\n for int i := 0; i != len(channels); i++ {\n channels[i] \u0026lt;- 0\n }\n channels_mutex.Unlock()\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow the problem is, since \u003ccode\u003e\u0026lt;-\u003c/code\u003e is always blocking on read, every time goes to \u003ccode\u003esync_stat := \u0026lt;- channel\u003c/code\u003e is blocking. I know if the channel was closed it won't be blocked, but since I have to use this channel until \u003ccode\u003ework()\u003c/code\u003e exits, and I didn't find any way to reopen a closed channel.\u003c/p\u003e\n\n\u003cp\u003eI suspect myself on a wrong way, so any help is appreciated. Is there some \"elegant\" way to pause \u0026amp; resume any other goroutine in golang?\u003c/p\u003e","accepted_answer_id":"16102304","answer_count":"1","comment_count":"0","creation_date":"2013-04-19 09:26:05.76 UTC","favorite_count":"6","last_activity_date":"2013-04-20 19:15:30.677 UTC","last_edit_date":"2013-04-19 09:31:13.52 UTC","last_editor_display_name":"","last_editor_user_id":"1153066","owner_display_name":"","owner_user_id":"1153066","post_type_id":"1","score":"10","tags":"go|channel|goroutine","view_count":"4451"} +{"id":"30193275","title":"Comparator return type is not compatible with integer","body":"\u003cp\u003eI am trying to sort an object via the object attribute NodeID which is long type.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Collections.sort(PeerNodeInChord, new Comparator\u0026lt;PeerNode\u0026gt;() \n {\n @Override public long compare(PeerNode p1, PeerNode p2) \n {\n return p1.NodeID - p2.NodeID; // Ascending\n }\n\n });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am getting the following error : \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003ecompare(PeerNode,PeerNode) in cannot implement\n compare(T,T) in Comparator return type long is not compatible with\n int where T is a type-variable:\n T extends Object declared in interface Comparator\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eIt seems i cant have type \"long\" as return type and must have \"int\" as the return type. \u003c/p\u003e\n\n\u003cp\u003eI am not allowed to change NodeID type to int. \u003c/p\u003e\n\n\u003cp\u003eIs there any way to sort the ArrayList of PeerNode via the object attribute NodeID which is long type ??\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2015-05-12 14:04:05.143 UTC","favorite_count":"1","last_activity_date":"2015-05-12 14:27:16.833 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1832057","post_type_id":"1","score":"1","tags":"java|sorting|debugging|comparator","view_count":"525"} +{"id":"44785926","title":"I only want the first occurrence of a node in XML/XSLT document. XPath is returning all even with [1]","body":"\u003cp\u003eI need to select only the first occurrence of the \u003ccode\u003e\u0026lt;fo:table ...\u0026gt;\u003c/code\u003e node in the following XSL-FO templace, but xPath is returning all of them. Here is the XPath statement I'm using after creating a wrapper element with all the namespaces:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;fo:wrapper xmlns:fo=\"http://www.w3.org/1999/XSL/Format\"\n xmlns:j4luserext=\"xalan://com.java4less.xreport.fop.XLSTDummyExtension\"\n xmlns:j4lext=\"xalan://com.java4less.xreport.fop.XLSTExtension\"\n xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" xmlns:j4lif=\"http://java4less.com/fop/iform\"\u0026gt;\n\n {xsl:stylesheet/xsl:template/fo:root/fo:page-sequence/fo:flow/fo:table/\n fo:table-body/fo:table-row/fo:table-cell/fo:block/fo:table[1]}\n\u0026lt;/fo:wrapper\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd here is the XSL-FO input:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" encoding=\"UTF-8\"?\u0026gt;\n\u0026lt;xsl:stylesheet version=\"1.0\" xmlns:j4lif=\"http://java4less.com/fop/iform\"\nxmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" xmlns:j4lext=\"xalan://com.java4less.xreport.fop.XLSTExtension\"\nextension-element-prefixes=\"j4lext j4luserext\"\nxmlns:j4luserext=\"xalan://com.java4less.xreport.fop.XLSTDummyExtension\"\u0026gt;\n\u0026lt;xsl:template match=\"/\"\u0026gt;\n \u0026lt;fo:root xmlns:fo=\"http://www.w3.org/1999/XSL/Format\"\u0026gt;\n \u0026lt;fo:layout-master-set\u0026gt;\n \u0026lt;fo:simple-page-master master-name=\"master0\"\n page-width=\"21.0cm\" page-height=\"29.7cm\" margin-top=\"2.0cm\"\n margin-bottom=\"2.0cm\" margin-left=\"2.0cm\" margin-right=\"2.0cm\"\u0026gt;\n \u0026lt;fo:region-body region-name=\"body0\" margin-top=\"1.5cm\"\n margin-bottom=\"1.5cm\" /\u0026gt;\n \u0026lt;fo:region-before region-name=\"header0\" extent=\"1.5cm\" /\u0026gt;\n \u0026lt;fo:region-after region-name=\"footer0\" extent=\"1.5cm\" /\u0026gt;\n \u0026lt;/fo:simple-page-master\u0026gt;\n \u0026lt;/fo:layout-master-set\u0026gt;\n \u0026lt;fo:page-sequence master-reference=\"master0\"\u0026gt;\n \u0026lt;fo:static-content flow-name=\"header0\"\u0026gt;\n \u0026lt;!-- 846098b14a344ae29ebeb7d3c3ae73c0 --\u0026gt;\n \u0026lt;fo:table width=\"17.0cm\"\u0026gt;\n \u0026lt;fo:table-column column-width=\"17.0cm\" /\u0026gt;\n \u0026lt;fo:table-body\u0026gt;\n \u0026lt;fo:table-row background-color=\"#ffffff\" height=\"1.5cm\"\u0026gt;\n \u0026lt;fo:table-cell\u0026gt;\n \u0026lt;fo:table\u0026gt;\n \u0026lt;fo:table-column column-width=\"17.0cm\" /\u0026gt;\n \u0026lt;fo:table-body\u0026gt;\n \u0026lt;fo:table-row background-color=\"#ffffff\" height=\"1.5cm\"\u0026gt;\n \u0026lt;fo:table-cell number-columns-spanned=\"1\"\u0026gt;\n \u0026lt;fo:block\u0026gt;\u0026lt;/fo:block\u0026gt;\n \u0026lt;/fo:table-cell\u0026gt;\n \u0026lt;/fo:table-row\u0026gt;\n \u0026lt;/fo:table-body\u0026gt;\n \u0026lt;/fo:table\u0026gt;\n \u0026lt;/fo:table-cell\u0026gt;\n \u0026lt;/fo:table-row\u0026gt;\n \u0026lt;/fo:table-body\u0026gt;\n \u0026lt;/fo:table\u0026gt;\n \u0026lt;/fo:static-content\u0026gt;\n \u0026lt;fo:static-content flow-name=\"footer0\"\u0026gt;\n \u0026lt;!-- b468381816be4ef8bb31f448a8bf5b09 --\u0026gt;\n \u0026lt;fo:table width=\"17.0cm\"\u0026gt;\n \u0026lt;fo:table-column column-width=\"17.0cm\" /\u0026gt;\n \u0026lt;fo:table-body\u0026gt;\n \u0026lt;fo:table-row background-color=\"#ffffff\" height=\"1.5cm\"\u0026gt;\n \u0026lt;fo:table-cell\u0026gt;\n \u0026lt;fo:table\u0026gt;\n \u0026lt;fo:table-column column-width=\"17.0cm\" /\u0026gt;\n \u0026lt;fo:table-body\u0026gt;\n \u0026lt;fo:table-row background-color=\"#ffffff\" height=\"1.5cm\"\u0026gt;\n \u0026lt;fo:table-cell number-columns-spanned=\"1\"\u0026gt;\n \u0026lt;fo:block\u0026gt;\u0026lt;/fo:block\u0026gt;\n \u0026lt;/fo:table-cell\u0026gt;\n \u0026lt;/fo:table-row\u0026gt;\n \u0026lt;/fo:table-body\u0026gt;\n \u0026lt;/fo:table\u0026gt;\n \u0026lt;/fo:table-cell\u0026gt;\n \u0026lt;/fo:table-row\u0026gt;\n \u0026lt;/fo:table-body\u0026gt;\n \u0026lt;/fo:table\u0026gt;\n \u0026lt;/fo:static-content\u0026gt;\n \u0026lt;fo:flow flow-name=\"body0\"\u0026gt;\n\n \u0026lt;!-- START Area Header --\u0026gt;\n \u0026lt;!-- 4ce697eac861472391f5eac35a51db48 --\u0026gt;\n \u0026lt;fo:table width=\"17.0cm\"\u0026gt;\n \u0026lt;fo:table-column column-width=\"17.0cm\" /\u0026gt;\n \u0026lt;fo:table-body\u0026gt;\n \u0026lt;fo:table-row background-color=\"#ffffff\" height=\"1.5cm\"\u0026gt;\n \u0026lt;fo:table-cell\u0026gt;\n \u0026lt;fo:table\u0026gt;\n \u0026lt;fo:table-column column-width=\"17.0cm\" /\u0026gt;\n \u0026lt;fo:table-body\u0026gt;\n \u0026lt;fo:table-row background-color=\"#ffffff\" height=\"1.5cm\"\u0026gt;\n \u0026lt;fo:table-cell number-columns-spanned=\"1\"\u0026gt;\n \u0026lt;fo:block\u0026gt;\u0026lt;/fo:block\u0026gt;\n \u0026lt;/fo:table-cell\u0026gt;\n \u0026lt;/fo:table-row\u0026gt;\n \u0026lt;/fo:table-body\u0026gt;\n \u0026lt;/fo:table\u0026gt;\n \u0026lt;/fo:table-cell\u0026gt;\n \u0026lt;/fo:table-row\u0026gt;\n \u0026lt;fo:table-row\u0026gt;\n \u0026lt;fo:table-cell number-columns-spanned=\"1\"\u0026gt;\n \u0026lt;fo:block\u0026gt;\n\n \u0026lt;!-- START Area Detail --\u0026gt;\n \u0026lt;!-- 7f22844da7e94220b5877bf7593e1dcb --\u0026gt;\n \u0026lt;fo:table width=\"17.0cm\"\u0026gt;\n \u0026lt;fo:table-column column-width=\"17.0cm\" /\u0026gt;\n \u0026lt;!-- 63bbf10b61f44321913cffd695225a53 --\u0026gt;\n \u0026lt;fo:table-header\u0026gt;\n \u0026lt;fo:table-row background-color=\"#ffffff\"\n height=\"2.0cm\"\u0026gt;\n \u0026lt;fo:table-cell\u0026gt;\n \u0026lt;fo:table\u0026gt;\n \u0026lt;fo:table-column column-width=\"17.0cm\" /\u0026gt;\n \u0026lt;fo:table-body\u0026gt;\n \u0026lt;fo:table-row background-color=\"#ffffff\"\n height=\"2.0cm\"\u0026gt;\n \u0026lt;fo:table-cell number-columns-spanned=\"1\"\u0026gt;\n \u0026lt;fo:block\u0026gt;\u0026lt;/fo:block\u0026gt;\n \u0026lt;/fo:table-cell\u0026gt;\n \u0026lt;/fo:table-row\u0026gt;\n \u0026lt;/fo:table-body\u0026gt;\n \u0026lt;/fo:table\u0026gt;\n \u0026lt;/fo:table-cell\u0026gt;\n \u0026lt;/fo:table-row\u0026gt;\n \u0026lt;/fo:table-header\u0026gt;\n \u0026lt;fo:table-body\u0026gt;\n \u0026lt;fo:table-row background-color=\"#ffffff\"\n height=\"4.0cm\"\u0026gt;\n \u0026lt;fo:table-cell\u0026gt;\n \u0026lt;fo:table\u0026gt;\n \u0026lt;fo:table-column column-width=\"17.0cm\" /\u0026gt;\n \u0026lt;fo:table-body\u0026gt;\n \u0026lt;fo:table-row background-color=\"#ffffff\"\n height=\"4.0cm\"\u0026gt;\n \u0026lt;fo:table-cell number-columns-spanned=\"1\"\u0026gt;\n \u0026lt;fo:block\u0026gt;\u0026lt;/fo:block\u0026gt;\n \u0026lt;/fo:table-cell\u0026gt;\n \u0026lt;/fo:table-row\u0026gt;\n \u0026lt;/fo:table-body\u0026gt;\n \u0026lt;/fo:table\u0026gt;\n \u0026lt;/fo:table-cell\u0026gt;\n \u0026lt;/fo:table-row\u0026gt;\n \u0026lt;/fo:table-body\u0026gt;\n \u0026lt;/fo:table\u0026gt;\n\n \u0026lt;!-- END Area Detail --\u0026gt;\n \u0026lt;/fo:block\u0026gt;\n \u0026lt;/fo:table-cell\u0026gt;\n \u0026lt;/fo:table-row\u0026gt;\n \u0026lt;fo:table-row\u0026gt;\n \u0026lt;fo:table-cell number-columns-spanned=\"1\"\u0026gt;\n \u0026lt;fo:block\u0026gt;\n\n \u0026lt;!-- START Area Footer --\u0026gt;\n \u0026lt;!-- ae182bb24f5648da9653ed5b997121c4 --\u0026gt;\n \u0026lt;fo:table width=\"17.0cm\"\u0026gt;\n \u0026lt;fo:table-column column-width=\"17.0cm\" /\u0026gt;\n \u0026lt;fo:table-body\u0026gt;\n \u0026lt;fo:table-row background-color=\"#ffffff\"\n height=\"1.5cm\"\u0026gt;\n \u0026lt;fo:table-cell\u0026gt;\n \u0026lt;fo:table\u0026gt;\n \u0026lt;fo:table-column column-width=\"17.0cm\" /\u0026gt;\n \u0026lt;fo:table-body\u0026gt;\n \u0026lt;fo:table-row background-color=\"#ffffff\"\n height=\"1.5cm\"\u0026gt;\n \u0026lt;fo:table-cell number-columns-spanned=\"1\"\u0026gt;\n \u0026lt;fo:block\u0026gt;\u0026lt;/fo:block\u0026gt;\n \u0026lt;/fo:table-cell\u0026gt;\n \u0026lt;/fo:table-row\u0026gt;\n \u0026lt;/fo:table-body\u0026gt;\n \u0026lt;/fo:table\u0026gt;\n \u0026lt;/fo:table-cell\u0026gt;\n \u0026lt;/fo:table-row\u0026gt;\n \u0026lt;/fo:table-body\u0026gt;\n \u0026lt;/fo:table\u0026gt;\n\n \u0026lt;!-- END Area Footer --\u0026gt;\n \u0026lt;/fo:block\u0026gt;\n \u0026lt;/fo:table-cell\u0026gt;\n \u0026lt;/fo:table-row\u0026gt;\n \u0026lt;/fo:table-body\u0026gt;\n \u0026lt;/fo:table\u0026gt;\n\n \u0026lt;!-- END Area Header --\u0026gt;\n \u0026lt;fo:block id=\"last-page\" /\u0026gt;\n \u0026lt;/fo:flow\u0026gt;\n \u0026lt;/fo:page-sequence\u0026gt;\n \u0026lt;/fo:root\u0026gt;\n\u0026lt;/xsl:template\u0026gt;\n\u0026lt;/xsl:stylesheet\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is what I expect as output:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;fo:wrapper xmlns:j4lif=\"http://java4less.com/fop/iform\"\nxmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" xmlns:j4lext=\"xalan://com.java4less.xreport.fop.XLSTExtension\"\nxmlns:j4luserext=\"xalan://com.java4less.xreport.fop.XLSTDummyExtension\"\nxmlns:fo=\"http://www.w3.org/1999/XSL/Format\"\u0026gt;\n\u0026lt;fo:table width=\"17.0cm\"\u0026gt;\n \u0026lt;fo:table-column column-width=\"17.0cm\" /\u0026gt;\n \u0026lt;!-- 63bbf10b61f44321913cffd695225a53 --\u0026gt;\n \u0026lt;fo:table-header\u0026gt;\n \u0026lt;fo:table-row background-color=\"#ffffff\" height=\"2.0cm\"\u0026gt;\n \u0026lt;fo:table-cell\u0026gt;\n \u0026lt;fo:table\u0026gt;\n \u0026lt;fo:table-column column-width=\"17.0cm\" /\u0026gt;\n \u0026lt;fo:table-body\u0026gt;\n \u0026lt;fo:table-row background-color=\"#ffffff\" height=\"2.0cm\"\u0026gt;\n \u0026lt;fo:table-cell number-columns-spanned=\"1\"\u0026gt;\n \u0026lt;fo:block /\u0026gt;\n \u0026lt;/fo:table-cell\u0026gt;\n \u0026lt;/fo:table-row\u0026gt;\n \u0026lt;/fo:table-body\u0026gt;\n \u0026lt;/fo:table\u0026gt;\n \u0026lt;/fo:table-cell\u0026gt;\n \u0026lt;/fo:table-row\u0026gt;\n \u0026lt;/fo:table-header\u0026gt;\n\u0026lt;/fo:table\u0026gt; \n\u0026lt;/fo:wrapper\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is what BaseX and Camel xQuery component actually outputs:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;fo:wrapper xmlns:j4lif=\"http://java4less.com/fop/iform\"\nxmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" xmlns:j4lext=\"xalan://com.java4less.xreport.fop.XLSTExtension\"\nxmlns:j4luserext=\"xalan://com.java4less.xreport.fop.XLSTDummyExtension\"\nxmlns:fo=\"http://www.w3.org/1999/XSL/Format\"\u0026gt;\n\u0026lt;fo:table width=\"17.0cm\"\u0026gt;\n \u0026lt;fo:table-column column-width=\"17.0cm\" /\u0026gt;\n \u0026lt;!-- 63bbf10b61f44321913cffd695225a53 --\u0026gt;\n \u0026lt;fo:table-header\u0026gt;\n \u0026lt;fo:table-row background-color=\"#ffffff\" height=\"2.0cm\"\u0026gt;\n \u0026lt;fo:table-cell\u0026gt;\n \u0026lt;fo:table\u0026gt;\n \u0026lt;fo:table-column column-width=\"17.0cm\" /\u0026gt;\n \u0026lt;fo:table-body\u0026gt;\n \u0026lt;fo:table-row background-color=\"#ffffff\" height=\"2.0cm\"\u0026gt;\n \u0026lt;fo:table-cell number-columns-spanned=\"1\"\u0026gt;\n \u0026lt;fo:block /\u0026gt;\n \u0026lt;/fo:table-cell\u0026gt;\n \u0026lt;/fo:table-row\u0026gt;\n \u0026lt;/fo:table-body\u0026gt;\n \u0026lt;/fo:table\u0026gt;\n \u0026lt;/fo:table-cell\u0026gt;\n \u0026lt;/fo:table-row\u0026gt;\n \u0026lt;/fo:table-header\u0026gt;\n \u0026lt;fo:table-body\u0026gt;\n \u0026lt;fo:table-row background-color=\"#ffffff\" height=\"4.0cm\"\u0026gt;\n \u0026lt;fo:table-cell\u0026gt;\n \u0026lt;fo:table\u0026gt;\n \u0026lt;fo:table-column column-width=\"17.0cm\" /\u0026gt;\n \u0026lt;fo:table-body\u0026gt;\n \u0026lt;fo:table-row background-color=\"#ffffff\" height=\"4.0cm\"\u0026gt;\n \u0026lt;fo:table-cell number-columns-spanned=\"1\"\u0026gt;\n \u0026lt;fo:block /\u0026gt;\n \u0026lt;/fo:table-cell\u0026gt;\n \u0026lt;/fo:table-row\u0026gt;\n \u0026lt;/fo:table-body\u0026gt;\n \u0026lt;/fo:table\u0026gt;\n \u0026lt;/fo:table-cell\u0026gt;\n \u0026lt;/fo:table-row\u0026gt;\n \u0026lt;/fo:table-body\u0026gt;\n\u0026lt;/fo:table\u0026gt;\n\u0026lt;fo:table width=\"17.0cm\"\u0026gt;\n \u0026lt;fo:table-column column-width=\"17.0cm\" /\u0026gt;\n \u0026lt;fo:table-body\u0026gt;\n \u0026lt;fo:table-row background-color=\"#ffffff\" height=\"1.5cm\"\u0026gt;\n \u0026lt;fo:table-cell\u0026gt;\n \u0026lt;fo:table\u0026gt;\n \u0026lt;fo:table-column column-width=\"17.0cm\" /\u0026gt;\n \u0026lt;fo:table-body\u0026gt;\n \u0026lt;fo:table-row background-color=\"#ffffff\" height=\"1.5cm\"\u0026gt;\n \u0026lt;fo:table-cell number-columns-spanned=\"1\"\u0026gt;\n \u0026lt;fo:block /\u0026gt;\n \u0026lt;/fo:table-cell\u0026gt;\n \u0026lt;/fo:table-row\u0026gt;\n \u0026lt;/fo:table-body\u0026gt;\n \u0026lt;/fo:table\u0026gt;\n \u0026lt;/fo:table-cell\u0026gt;\n \u0026lt;/fo:table-row\u0026gt;\n \u0026lt;/fo:table-body\u0026gt;\n\u0026lt;/fo:table\u0026gt;\n\u0026lt;/fo:wrapper\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI don't want that second table node. Since \u003ccode\u003e/fo:table[1]\u003c/code\u003e doesn't work, I've tried putting predicates in there such as \u003ccode\u003e/fo:table[fo:table-column/fo:table-row[2]]\u003c/code\u003e and nothing is returned. Oddly, even \u003ccode\u003e/fo:table[fo:table-column/fo:table-row]\u003c/code\u003e returns nothing, but \u003ccode\u003e/fo:table[fo:table-column]\u003c/code\u003e returns the same unwanted 2nd table node. Anyone have any idea what's going on here?\u003c/p\u003e","accepted_answer_id":"44786230","answer_count":"1","comment_count":"0","creation_date":"2017-06-27 16:58:34.423 UTC","last_activity_date":"2017-06-27 17:17:29.977 UTC","last_edit_date":"2017-06-27 17:17:29.977 UTC","last_editor_display_name":"","last_editor_user_id":"695343","owner_display_name":"","owner_user_id":"7959661","post_type_id":"1","score":"0","tags":"xml|xslt|xpath|xquery|fop","view_count":"87"} +{"id":"16748320","title":"Error in importing a csv file in mongoDB2.4","body":"\u003cp\u003eI have installed mongoDB2.4 installed in my windows 7 os. I am new to mongoDB. I would like to import data from a csv file into the database. I have used the mongoimport command but it shows: \nJavascript execution failed: Syntax error: Unexpected identifier\u003c/p\u003e\n\n\u003cp\u003emy command in mongo shell was:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003emongoimport --db mentalhealth --collection bidyut --type csv --file \\Users\\Adrian\\Desktop\\Data_sorted.csv\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003ePLEASE kindly provide an answer.\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2013-05-25 09:47:29.707 UTC","last_activity_date":"2013-05-25 09:47:29.707 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2419948","post_type_id":"1","score":"0","tags":"mongodb","view_count":"433"} +{"id":"18898158","title":"Brew gettext on Mac OS X Terminal","body":"\u003cp\u003eI installed gettext with brew and the path to gettext is\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e/usr/local/Cellar/gettext/0.18.3.1/bin\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003emy PHP-Project is located under \u003ccode\u003e/Applications/XAMPP/xamppfiles/htdocs/projectMine\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eThe files I want to translate are in \u003ccode\u003e/Applications/XAMPP/xamppfiles/htdochs/projectMine/public_html\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eWhen I'm now in the \u003ccode\u003ebin\u003c/code\u003e folder I type\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e./gettext /Applications/XAMPP/xamppfiles/htdocs/projectMine/public_html\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI also tried this one here, but this didn't seem to work either.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e/usr/local/Cellar/gettext/0.18.3.1/bin/gettext -n /Applications/PATHTOFOLDER\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut this results in nothing. What is the exact command to achieve this. I'm new to Mac and Terminal, because I'm normally a Windows user. \u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-09-19 14:58:31.45 UTC","last_activity_date":"2013-09-24 13:54:00.407 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2271652","post_type_id":"1","score":"-1","tags":"php|osx|gettext","view_count":"795"} +{"id":"2536358","title":"Adding multile row in the girdview","body":"\u003cp\u003eAdding the row one by one in the button click..\n(i tried but its overwirting the same row)\u003c/p\u003e","accepted_answer_id":"2536960","answer_count":"3","comment_count":"2","creation_date":"2010-03-29 07:27:35.787 UTC","last_activity_date":"2010-03-30 08:17:19.813 UTC","last_edit_date":"2010-03-29 08:35:18.043 UTC","last_editor_display_name":"","last_editor_user_id":"304018","owner_display_name":"","owner_user_id":"304018","post_type_id":"1","score":"0","tags":"asp.net","view_count":"141"} +{"id":"25637281","title":"How to run sql scripts serially in bash script?","body":"\u003cp\u003eI have 2 DB2 sql scripts that I need to run. I have tried to put both of them in bash script and execute them.\u003c/p\u003e\n\n\u003cp\u003ehere is script.sh:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#!/bin/bash\ndb2 -tf firstscript.sql;\ndb2 -tf secondscript.sql;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I run this, I get the following error:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eDB21034E The command was processed as an SQL statement because it was\n not a valid Command Line Processor command. During SQL processing it\n returned: SQL1024N A database connection does not exist. \n SQLSTATE=08003\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eBut I have made sure that the database connection already exists. \u003c/p\u003e\n\n\u003cp\u003eI think that the commands inside the sql scripts are not executed sequentially.\nBecause when I run each command individually, there is no error.\nAlso, when I run both the commands inline i.e. \u003ccode\u003edb2 -tf firstscript.sql;db2 -tf firstscript.sql\u003c/code\u003e, even then the code works.\u003c/p\u003e\n\n\u003cp\u003eI thought that it could have something to do with \u003ccode\u003e#!/bin/bash\u003c/code\u003e, so I removed it from the script.sh file and then executed it. Even then, it returned the same error.\u003c/p\u003e\n\n\u003cp\u003eWhat would be the possible problem and its solution?\u003c/p\u003e","accepted_answer_id":"25646510","answer_count":"1","comment_count":"1","creation_date":"2014-09-03 06:03:40.783 UTC","last_activity_date":"2014-09-03 14:07:47.173 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"848377","post_type_id":"1","score":"0","tags":"linux|bash|shell|db2","view_count":"544"} +{"id":"33772007","title":"CIBIL api integration","body":"\u003cp\u003eI am facing a problem in CIBIL api integration, When we hit CIBIL api we get response in machine readable TUEF format and that is very difficult to parse, So is their a way to get response in XML format.\nCIBIL = Credit Information Bureau (INDIA) Limited.\u003c/p\u003e","answer_count":"1","comment_count":"4","creation_date":"2015-11-18 04:42:31.36 UTC","favorite_count":"1","last_activity_date":"2017-11-07 11:10:02.663 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4070402","post_type_id":"1","score":"2","tags":"java|c#|php|api","view_count":"2260"} +{"id":"7752110","title":"userControl repeated with Form tag disappearing","body":"\u003cp\u003eI have a Contact userControl that have \"save contact\" as submit button and fields inside form tag we repeat this userControl with Code 20 times in one page \u003c/p\u003e\n\n\u003cp\u003eMy problem is the Form Tag in the first userControl is hiding somehow --- i checked the userControl with developer Tool IE9 , firebug Firefox7 and the Form is not appearing in the first userControl and its appearing with the rest 19 Controls\u003c/p\u003e\n\n\u003cp\u003eI tried to \u003cstrong\u003eView Source\u003c/strong\u003e and take html copy in new html file in VS -- i found form is exist \u003c/p\u003e\n\n\u003cp\u003ei dont know if iam clear enough but please advice if you need more info \u003c/p\u003e","accepted_answer_id":"7752740","answer_count":"1","comment_count":"0","creation_date":"2011-10-13 09:31:51.91 UTC","last_activity_date":"2011-10-13 11:12:32.4 UTC","last_edit_date":"2011-10-13 09:58:00.997 UTC","last_editor_display_name":"","last_editor_user_id":"1164726","owner_display_name":"","owner_user_id":"637488","post_type_id":"1","score":"0","tags":"asp.net|html|webforms","view_count":"760"} +{"id":"28110452","title":"Nested Cell to string","body":"\u003cp\u003eI have the following problem: \u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eObjective\u003c/strong\u003e (high-level): \nI would like to convert ESRI Shapefiles into SQL spatial data. For that purpose, I need to adapt the synthax. \u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eCurrent status / problem:\u003c/strong\u003e\nI constructed a the following cell array:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e'MULTIPOLYGON(' {1x2332 cell} ',' {1x916 cell} ',' {1x391 cell} ',' {1x265 cell} ')'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewith in total 9 fields. This cell array contains the following 'nested' cell arrays: {1x2332 cell}, {1x916 cell}, {1x391 cell}, {1x265 cell}. As an example, 'nested' cell {1x2332 cell} has the following form:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e'((' [12.714606000000000] [42.155628000000000] ',' [12.702529999999999] [42.152873999999997] ',' ... ',' [12.714606000000000] [42.155628000000000] '))'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, I would like to have the entire cell array (including all 'nested cells') as one string without any spaces (except the space between the numbers (coordinates)). Would you have an idea how I could get to a solution?\u003c/p\u003e\n\n\u003cp\u003eThank you in advance.\u003c/p\u003e","accepted_answer_id":"28111204","answer_count":"1","comment_count":"2","creation_date":"2015-01-23 12:57:05.843 UTC","last_activity_date":"2015-01-23 15:17:09.897 UTC","last_edit_date":"2015-01-23 13:19:26.33 UTC","last_editor_display_name":"","last_editor_user_id":"3074708","owner_display_name":"","owner_user_id":"3074708","post_type_id":"1","score":"1","tags":"sql|matlab","view_count":"64"} +{"id":"47457012","title":"How to increase the space (Data Space Total) used by Docker ? That value is less than half on the disk size","body":"\u003cp\u003eMany times, I have this error when building Dockerfile :\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003edevmapper: Thin Pool has 157168 free data blocks which is less than minimum required 163840 free data blocks. Create more free space in thin pool or use dm.min_free_space option to change behavior\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eMy disk has at all 250Go and when I execute docker version, I can see in storage part : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eStorage Driver: devicemapper\n Pool Name: docker-253:0-19468577-pool\n Pool Blocksize: 65.54kB\n Base Device Size: 21.47GB\n Backing Filesystem: xfs\n Data file: /dev/loop0\n Metadata file: /dev/loop1\n Data Space Used: 97.03GB\n Data Space Total: 107.4GB\n Data Space Available: 10.35GB\n Metadata Space Used: 83.67MB\n Metadata Space Total: 2.147GB\n Metadata Space Available: 2.064GB\n Thin Pool Minimum Free Space: 10.74GB\n Udev Sync Supported: true\n Deferred Removal Enabled: false\n Deferred Deletion Enabled: false\n Deferred Deleted Device Count: 0\n Data loop file: /var/lib/docker/devicemapper/devicemapper/data\n Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata\n Library Version: 1.02.135-RHEL7 (2016-11-16)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI tried after stopping docker service : \nI tried : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edockerd --storage-opt dm.thinpooldev dm.min_free_space=3%\ndockerd --storage-opt dm.thinp_autoextend_percent\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut those command doesn't succed.\u003c/p\u003e\n\n\u003cp\u003eHow to increase the Data Space Total (the free space on the disk is more than 2 times 107.4GB) ? \nOr How to decrease the Thin Pool Minimum Free Space: 10.74GB ?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-11-23 13:44:58.31 UTC","last_activity_date":"2017-11-23 14:07:43.613 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6288254","post_type_id":"1","score":"0","tags":"docker","view_count":"25"} +{"id":"12705412","title":"PostgreSQL. Slow Prepare Transaction and Commit Prepared","body":"\u003cp\u003eI've just encountered a strange problem. I've made a report in pgfourine, and found out that my XA transactions started to work really slow. Prepare transaction and commit prepared combined took 12.55s out of 13.2s. But why?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e##### Overall statistics #####\n\nNumber of unique normalized queries: 175\nNumber of queries: 268,772\nTotal query duration: 13m2s\n\n\n##### Queries by type #####\n\nSELECT: 116493 43.3%\nINSERT: 15926 5.9%\nUPDATE: 7935 3.0%\nDELETE: 4923 1.8%\n\n\n##### Queries that took up the most time (N) #####\n\n1) 6m32s - 26,338 - COMMIT PREPARED ''\n--\n2) 6m23s - 25,972 - PREPARE TRANSACTION ''\n--\n3) 0.6s - 3,848 - update avatar set lfa_position=NULL where Id=0\n.....\n7) 0.3s - 21,514 - COMMIT\n.....\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have a theory but don't have a proof.. I have slow discs and I turned off synchronous_commit. Maybe PostgreSQL has to make an fsync during \"prepare transaction\" even if synchronous_commit is off? \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efsync = on \nsynchronous_commit = off\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny ideas?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eUPDATE\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eSame tests with \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efsync = off\nsynchronous_commit = off\n\n\n##### Overall statistics #####\n\nNumber of unique normalized queries: 155\nNumber of queries: 186,838\nTotal query duration: 6.6s\n\n\n##### Queries by type #####\n\nSELECT: 84367 45.2%\nINSERT: 9197 4.9%\nUPDATE: 5486 2.9%\nDELETE: 2996 1.6%\n\n\n##### Queries that took up the most time (N) #####\n\n1) 1.8s - 16,972 - PREPARE TRANSACTION ''\n--\n2) 1.1s - 16,965 - COMMIT PREPARED ''\n--\n3) 0.4s - 2,904 - update avatar set lfa_position=NULL where Id=0\n--\n4) 0.2s - 16,031 - COMMIT\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eLooks like fsync took vast amount of time, but not all the time. 16k commits - 0.2sec, 17k prepare+commit 2.9sec. \u003c/p\u003e\n\n\u003cp\u003eSad story. Looks like XA commit tooks 15 times more time than local commit and doesn't take in account synchronous_commit setting. fsync=off is not safe for production use. So if I want to use XA transactions I have to use it carefully and use a good SSD drive with high IOPS.\u003c/p\u003e","accepted_answer_id":"12708976","answer_count":"1","comment_count":"3","creation_date":"2012-10-03 09:20:10.847 UTC","last_activity_date":"2012-10-03 12:55:32.31 UTC","last_edit_date":"2012-10-03 10:09:07.773 UTC","last_editor_display_name":"","last_editor_user_id":"312704","owner_display_name":"","owner_user_id":"312704","post_type_id":"1","score":"0","tags":"performance|postgresql|database-performance|xa|pgfouine","view_count":"1262"} +{"id":"40592129","title":"why my javascript for loop will not work? for (var i=1; i\u003c5; i++;) { document.write (\"A statement has run \"); }","body":"\u003cp\u003eI have tried using alert and document.write. It is from the following \u003ca href=\"https://www.youtube.com/watch?v=rDzWA8yPnIY\u0026amp;list=PLr6-GrHUlVf96NLj3PQq-tmEB6woZjwEl\u0026amp;index=11#t=2.832339\" rel=\"nofollow noreferrer\"\u003eyoutube video\u003c/a\u003e. It works for him but not for me. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efor (var i=1; i\u0026lt;5; i++;) { \n document.write (\"A statement has run \");\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"1","creation_date":"2016-11-14 15:20:47.26 UTC","last_activity_date":"2016-11-14 16:56:17.95 UTC","last_edit_date":"2016-11-14 16:56:17.95 UTC","last_editor_display_name":"","last_editor_user_id":"2520530","owner_display_name":"","owner_user_id":"7157506","post_type_id":"1","score":"0","tags":"javascript","view_count":"30"} +{"id":"5087245","title":"Egit fetch \u0026 pull connection refused","body":"\u003cp\u003eI've installed Egit plugin for eclipse on two ubuntu systems and created two new project on two sytems and shared(team\u003eshare) it. What's the proper way to do fetch \u0026amp; pull projects with other users with Egit?\u003c/p\u003e\n\n\u003cp\u003eError \u003ccode\u003econnection refused\u003c/code\u003e\u003c/p\u003e","accepted_answer_id":"5088164","answer_count":"1","comment_count":"0","creation_date":"2011-02-23 05:08:50.31 UTC","last_activity_date":"2011-02-25 06:46:43.783 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"465465","post_type_id":"1","score":"2","tags":"eclipse|ubuntu|egit","view_count":"2450"} +{"id":"10125508","title":"How can I invoke default model binding within a custom binder in MVC4 Web API?","body":"\u003cp\u003eI recently posed a question \u003ca href=\"https://stackoverflow.com/questions/10096957/how-can-i-invoke-a-custom-model-binder-in-mvc4\"\u003ehere\u003c/a\u003e on Stack Overflow about finding the right extensibility point for model binding in the Web API beta. Using a custom provider / \u003ccode\u003eIModelBinder\u003c/code\u003e gives me full control of model binding and access to the value providers.\u003c/p\u003e\n\n\u003cp\u003eHowever, it's really too much control. I just want to control how a couple of values are mapped, and don't want to hand-code model binding that would've otherwise worked just fine.\u003c/p\u003e\n\n\u003cp\u003eUltimately, this is what I'd like to be able to do:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class MyCustomModelBinder : IModelBinder\n{\n public bool BindModel(HttpActionContext actionContext, ModelBindingContext bindingContext)\n {\n // Invoke default model binding\n\n // Pull out custom values\n var value1 = bindingContext.ValueProvider.GetValue(\"value1\");\n var value2 = bindingContext.ValueProvider.GetValue(\"value2\");\n\n bindingContext.Model.Value1 = DoCustomStuff(value1);\n bindingContext.Model.Value2 = DoCustomStuff(value2);\n\n return true;\n }\n\n ... // Define DoCustomStuff\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt looks like it's pretty hard to get ahold of a default provider for the WebAPI. \u003cstrong\u003eDoes anyone know if it's accessible and how it should be accessed here in a custom model binder?\u003c/strong\u003e\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2012-04-12 14:20:47.95 UTC","last_activity_date":"2014-07-16 21:39:39.823 UTC","last_edit_date":"2017-05-23 12:15:51.85 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"271250","post_type_id":"1","score":"8","tags":"asp.net-web-api","view_count":"854"} +{"id":"23982717","title":"SQL query with concat some fields . (MySql)","body":"\u003cp\u003eI using MySQL.\nI will explain my question by example.. I have those 2 records:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eId Name Role\n3004 Jason x\n3004 Jason y\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to make a query that make Group by the Id , and concat all the Roles of this Id to one field with ',' between them.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eId Name Roles\n3004 Jason x,y\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs it possible?\u003c/p\u003e","answer_count":"2","comment_count":"3","creation_date":"2014-06-01 17:51:56.837 UTC","last_activity_date":"2014-06-02 05:44:19.887 UTC","last_edit_date":"2014-06-01 18:16:12.427 UTC","last_editor_display_name":"","last_editor_user_id":"117259","owner_display_name":"","owner_user_id":"3697289","post_type_id":"1","score":"2","tags":"mysql|sql|string","view_count":"44"} +{"id":"739226","title":"How do I access the 'mx' or 'fl' namespaces in a Flex Builder Actionscript Project?","body":"\u003cp\u003eHow do I access the \u003ccode\u003emx\u003c/code\u003e or \u003ccode\u003efl\u003c/code\u003e namespaces in a Flex Builder Actionscript Project?\u003c/p\u003e\n\n\u003cp\u003eDo I need to include a certain .swc file?\u003c/p\u003e\n\n\u003cp\u003eI can't seem to find which one.\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2009-04-11 00:14:30.713 UTC","favorite_count":"1","last_activity_date":"2015-03-17 04:01:03.023 UTC","last_edit_date":"2015-03-17 04:01:03.023 UTC","last_editor_display_name":"","last_editor_user_id":"64046","owner_display_name":"","owner_user_id":"16940","post_type_id":"1","score":"1","tags":"actionscript|namespaces|flexbuilder|swc","view_count":"586"} +{"id":"38915402","title":"Copy EventHandler in inherited class","body":"\u003cp\u003eI'm developing an application in c# WPF.\u003c/p\u003e\n\n\u003cp\u003eI use a class \u003ccode\u003ePropertyChangedNotifier\u003c/code\u003e to manage INotifyPropertyChanged (see \u003ca href=\"https://stackoverflow.com/questions/38896344/best-way-to-notify-property-change-when-field-is-depending-on-another\"\u003ethat link\u003c/a\u003e).\u003c/p\u003e\n\n\u003cp\u003eI use a classical ViewModelBase :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class ViewModelBase : INotifyPropertyChanged, IRequestClose\n{\n public PropertyChangedEventHandler PropertyChanged;\n\n protected void OnPropertyChanged(string propertyName)\n {\n PropertyChangedEventHandler handler = _propertyChanged;\n\n if (handler != null)\n {\n handler(this, new PropertyChangedEventArgs(propertyName));\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn my \u003ccode\u003eMainViewModel : ViewModelBase\u003c/code\u003e I have a \u003ccode\u003ePropertyChangedNotifier\u0026lt;MainViewModel\u0026gt;\u003c/code\u003e working like this :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass MainViewModel : ViewModelBase\n{\n private PropertyChangedNotifier\u0026lt;MainViewModel\u0026gt; _notifier;\n public new event PropertyChangedEventHandler PropertyChanged\n {\n add { _notifier.PropertyChanged += value; }\n remove { _notifier.PropertyChanged -= value; }\n }\n\n public MainViewModel()\n {\n _notifier = new PropertyChangedNotifier\u0026lt;MainViewModel\u0026gt;(this);\n }\n\n protected new void OnPropertyChanged(string propertyName)\n {\n _notifier.OnPropertyChanged(propertyName);\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut changes are not detected, when a value changes, my MainWindows doesn't refresh (without using PropertyChangedNotifier it works). I saw that system initiates windows by using \u003ccode\u003eWindowsBase.dll!System.ComponentModel.PropertyChangedEventManager.StartListening(object source)\u003c/code\u003e and then I saw that my ViewModelBase.PropertyChanged is not null when the constructor for MainViewModel is called.\u003c/p\u003e\n\n\u003cp\u003eIs it possible to make something like this : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic MainViewModel()\n{\n _notifier = new PropertyChangedNotifier\u0026lt;MainViewModel\u0026gt;(this);\n _notifier.PropertyChanged = base.PropertyChanged;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd will that fix my bug ?\u003c/p\u003e\n\n\u003cp\u003eEdit:\u003c/p\u003e\n\n\u003cp\u003ePropertyChangeNotifier from link :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[AttributeUsage( AttributeTargets.Property )]\npublic class DepondsOnAttribute : Attribute\n{\n public DepondsOnAttribute( string name )\n {\n Name = name;\n }\n\n public string Name { get; }\n}\n\npublic class PropertyChangedNotifier\u0026lt;T\u0026gt; : INotifyPropertyChanged\n{\n public event PropertyChangedEventHandler PropertyChanged;\n\n public PropertyChangedNotifier( T owner )\n {\n mOwner = owner;\n }\n\n public void OnPropertyChanged( string propertyName )\n {\n var handler = PropertyChanged;\n if( handler != null ) handler( mOwner, new PropertyChangedEventArgs( propertyName ) );\n\n List\u0026lt;string\u0026gt; dependents;\n if( smPropertyDependencies.TryGetValue( propertyName, out dependents ) )\n {\n foreach( var dependent in dependents ) OnPropertyChanged( dependent );\n }\n }\n\n static PropertyChangedNotifier()\n {\n foreach( var property in typeof( T ).GetProperties() )\n {\n var dependsOn = property.GetCustomAttributes( true )\n .OfType\u0026lt;DepondsOnAttribute\u0026gt;()\n .Select( attribute =\u0026gt; attribute.Name );\n\n foreach( var dependency in dependsOn )\n {\n List\u0026lt;string\u0026gt; list;\n if( !smPropertyDependencies.TryGetValue( dependency, out list ) )\n {\n list = new List\u0026lt;string\u0026gt;();\n smPropertyDependencies.Add( dependency, list );\n }\n\n if (property.Name == dependency)\n throw new ApplicationException(String.Format(\"Property {0} of {1} cannot depends of itself\", dependency, typeof(T).ToString()));\n\n list.Add( property.Name );\n }\n }\n }\n\n private static readonly Dictionary\u0026lt;string, List\u0026lt;string\u0026gt;\u0026gt; smPropertyDependencies = new Dictionary\u0026lt;string, List\u0026lt;string\u0026gt;\u0026gt;();\n\n private readonly T mOwner;\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"38917620","answer_count":"2","comment_count":"6","creation_date":"2016-08-12 10:10:49.17 UTC","last_activity_date":"2016-08-12 12:11:12.213 UTC","last_edit_date":"2017-05-23 12:01:06.053 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"6479770","post_type_id":"1","score":"0","tags":"c#|wpf|inotifypropertychanged","view_count":"51"} +{"id":"33358141","title":"SpatialLines with determined distance","body":"\u003cp\u003eI have spatial point coordinates in a matrix, and I need create (n) spatial lines with 100km of distance from the point coordinate using intervals of 1°. \u003c/p\u003e\n\n\u003cp\u003eHow do I determine distance in kilometer using \u003ccode\u003eSpatialLines\u003c/code\u003e function from \u003ccode\u003esp\u003c/code\u003e package? How do I determine regular intervals with 1°?\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2015-10-27 00:48:20.373 UTC","last_activity_date":"2015-10-29 04:32:57.86 UTC","last_edit_date":"2015-10-27 00:54:34.37 UTC","last_editor_display_name":"user3710546","owner_display_name":"","owner_user_id":"5241461","post_type_id":"1","score":"0","tags":"r|geospatial","view_count":"43"} +{"id":"41730071","title":"Is there a way to test Chrome Custom Tabs with Espresso?","body":"\u003cp\u003eHere is the stub of the code.\u003c/p\u003e\n\n\u003cp\u003eClick data item on \u003ccode\u003eListView\u003c/code\u003e . Works as designed and opens \u003cem\u003eChrome Custom Tab\u003c/em\u003e :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eonData(anything()).inAdapterView(withId(R.id.listView))\n .atPosition(0).perform(click());\n\nPause(5000);\nEspresso.pressBack();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCannot seem to evaluate anything in the tab or even hit device back button. \nGetting this error\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eError : android.support.test.espresso.NoActivityResumedException: No \nactivities in stage RESUMED.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eDid you forget to launch the activity. (\u003ccode\u003etest.getActivity()\u003c/code\u003e or similar)? \u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2017-01-18 21:48:43.173 UTC","last_activity_date":"2017-08-02 18:03:17.86 UTC","last_edit_date":"2017-08-01 00:30:11.983 UTC","last_editor_display_name":"","last_editor_user_id":"4713905","owner_display_name":"","owner_user_id":"5683895","post_type_id":"1","score":"4","tags":"android|listview|espresso|chrome-custom-tabs","view_count":"232"} +{"id":"7012045","title":"Helptexts lost when referencing a COM DLL","body":"\u003cp\u003eI barely have any knowledge of COM, but I will try to make the question as clear as possible.\u003c/p\u003e\n\n\u003cp\u003eI have a .NET 4.0 project and am referencing an older COM DLL written in VBScript.\u003c/p\u003e\n\n\u003cp\u003eWhen I use this DLL in the code, I don't get any custom helptexts in VS2010 describing the methods and classes. They are also not available in the object browser.\u003c/p\u003e\n\n\u003cp\u003eI guess this has something to do with the automatic wrapper that is applied by .NET to the COM library. The help texts seem to get lost in the process.\u003c/p\u003e\n\n\u003cp\u003eWhen I view the dll directly in the object browser of VS, I can see the texts for methods etc.\u003c/p\u003e\n\n\u003cp\u003eIs there a way to keep the describing texts for coding with the referenced COM dll?\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2011-08-10 14:01:38.07 UTC","last_activity_date":"2011-09-13 11:06:08.84 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"554340","post_type_id":"1","score":"4","tags":"c#|.net|visual-studio-2010|com","view_count":"133"} +{"id":"39329410","title":"TagName in Kendo ListView in Asp.Net Core","body":"\u003cp\u003eI have simple kendo listview: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@(Html.Kendo().ListView\u0026lt;SomeViewModel\u0026gt;()\n //...\n .TagName(\"div\")\n //...\n)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe question is, what \u003ccode\u003eTagName\u003c/code\u003e method does? Documentation says: \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eThe TagName of Kendo ListView for ASP.NET MVC used to create an\n element which will contain all listivew items once the listview is\n bound.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eBut when I'm changing it, absolutely nothing happens in output html, for example, I've changed it to \u003ccode\u003eul\u003c/code\u003e and template was in \u003ccode\u003eli\u003c/code\u003e but it didn't create list of items. \u003c/p\u003e\n\n\u003cp\u003eSo, why do we need \u003ccode\u003eTagName\u003c/code\u003e method, if it didn't work?\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2016-09-05 11:15:30.503 UTC","last_activity_date":"2016-09-05 11:15:30.503 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5717094","post_type_id":"1","score":"1","tags":"c#|kendo-ui|asp.net-core|kendo-asp.net-mvc|kendo-listview","view_count":"81"} +{"id":"38419011","title":"How to calculate sum of path's weight in N allowable moves defined in graph but the destination node is not fixed using Python","body":"\u003cpre\u003e\u003ccode\u003egr = {'0': {'4': 4, '6': 6},\n '4': {'3': 7, '9': 13, '0':4},\n '6': {'1': 7, '7':13,'0':6},\n '3': {'4': 7, '8': 11},\n '9': {'4': 13, '2': 11},\n '1': {'6': 7, '8': 9},\n '7': {'2': 9, '6': 13},\n '8': {'1': 9, '3': 11},\n '2': {'9': 11, '7': 9}}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is the graph, I have made for the allowable moves and defined the weights in moves as I need to calculate sum of the weight of the path after certain number of moves(n) starting from '0'. The path can be random but from within those paths defined in graph, given the destination is not defined.\u003c/p\u003e\n\n\u003cp\u003eI have tried the functions like this where the parameters given are starting and ending point. This works to find the path and calculate the weight traveled. But I need to be able to have the parameters as starting point and the number of moves but not the destination and find the sum of path's weight. Also the nodes can be visited as many number of times. Please help me to edit this function or may be my approach should be different.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef paths(gr, frm, to, path_len = 0, visited = None):\n if frm == to:\n return [[to, path_len]]\n\n visited = visited or []\n result = []\n for point, length in gr[frm].items():\n if point in visited:\n continue\n visited.append(point)\n for sub_path in paths(gr, point, to, path_len + length, visited[:]):\n result.append([frm] + sub_path)\n\n return result\n\nprint (paths(gr, '0', '9'))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy Desired Output is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ePath: 0-\u0026gt;4-\u0026gt;3-\u0026gt;8\u0026gt;1-\u0026gt;6-\u0026gt;7-\u0026gt;2-\u0026gt;9-\u0026gt;4, Sum: 44\n\nPath: 0-\u0026gt;6-\u0026gt;7-\u0026gt;2-\u0026gt;9-\u0026gt;4-\u0026gt;3-\u0026gt;8-\u0026gt;1-\u0026gt;6, Sum: 46\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003chr\u003e\n\n\u003cp\u003eFrom the \u003ca href=\"https://stackoverflow.com/questions/38419011/how-to-calculate-sum-of-paths-weight-in-n-allowable-moves-defined-in-graph-but/38422175#comment64253343_38422175\"\u003ecomments\u003c/a\u003e:\u003c/p\u003e\n\n\u003cp\u003eThe problem statement is \"It chooses amongst the allowable moves uniformly at random and keeps track of the running sum S of nodes on which it lands.\" So my problem is to find the sum S of all the nodes on which it lands in K moves.\u003c/p\u003e","accepted_answer_id":"38422175","answer_count":"2","comment_count":"6","creation_date":"2016-07-17 07:45:29.273 UTC","last_activity_date":"2016-07-18 03:41:05.607 UTC","last_edit_date":"2017-05-23 10:28:49.417 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"2287486","post_type_id":"1","score":"3","tags":"python|algorithm|python-3.x|graph","view_count":"169"} +{"id":"43237849","title":"Handling lots of id's in HTML","body":"\u003cp\u003eI'm new to web design and have a problem I don't really know how to solve in the most eloquent way. I have 7 weekday elements, each 2 dropdowns. A dropdown has 24 options, 1 for each hour of the day. That means 336 possible options a user can click on in total.\u003c/p\u003e\n\n\u003cp\u003eI need to assign a function to each of those 336 elements that will update the text in the corresponding box the dropdown menu came from. \u003c/p\u003e\n\n\u003cp\u003eI know how to do what I'm trying to achieve, but I'm not sure how to do it 'properly'. I could write my function that updates the text based on what you clicked on. Then I could go through and manually assign a unique ID to each of my 336 elements, then write a function that loops through and assigns my first function to all of them. Although this would mean manually assigning 336 unique ID's in my HTML. Something feels wrong about this? is there any better way?\u003c/p\u003e\n\n\u003cp\u003eI feel like I'm missing something very obvious that would make this much easier - maybe I'm taking a completely wrong approach?\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://puu.sh/vagxC/ae12ce718e.png\" alt=\"availability\"\u003e\u003c/p\u003e","accepted_answer_id":"43238208","answer_count":"4","comment_count":"3","creation_date":"2017-04-05 17:27:46.883 UTC","favorite_count":"1","last_activity_date":"2017-04-05 17:48:15.157 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5344915","post_type_id":"1","score":"3","tags":"javascript|html","view_count":"58"} +{"id":"4792360","title":"separation betwen normal array and associative array","body":"\u003cp\u003ei have a tree processing function which returns, for example such data:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eArray\n(\n[0] =\u0026gt; Array\n (\n [efw] =\u0026gt; Array\n (\n [0] =\u0026gt; ewe\n [sdfe] =\u0026gt; Array\n (\n [dfe] =\u0026gt; Array\n (\n [fef] =\u0026gt; value\n )\n\n [wefwf] =\u0026gt; Array\n (\n [0] =\u0026gt; qefq\n [1] =\u0026gt; efew\n )\n\n )\n\n )\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ei wish that data would look like\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e [wefwf] =\u0026gt; Array\n (\n qefq\n efew\n )\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003einstead of \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e [wefwf] =\u0026gt; Array\n (\n [0] =\u0026gt; qefq\n [1] =\u0026gt; efew\n )\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eso i can suggest is values in array is a key=\u003evalue or only values, which appended with surrogate keys(keys may be 0,1... like surrogate keys too, it's the problem why i can't suggest after processing is this a predefined key or surrogate)\u003c/p\u003e\n\n\u003cp\u003eany suggestions? i just can think about objects. maybe objects from SPL can do this?\u003c/p\u003e\n\n\u003cp\u003eor maybe a simpler solution is to use this feature:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eA key may be either an integer or a\n string. If a key is the standard \n representation of an integer, it will\n be interpreted as such (i.e. \"8\" will\n be interpreted as 8, while \"08\" will\n be interpreted as \"08\")\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eand save numeric predefined keys as strings with lead zero, and surrogate keys will be integers?\u003c/p\u003e\n\n\u003cp\u003elol, i think i will use this solution, but answers appreciated\u003c/p\u003e","answer_count":"0","comment_count":"6","creation_date":"2011-01-25 10:28:41.2 UTC","last_activity_date":"2011-01-25 10:29:26.243 UTC","last_edit_date":"2011-01-25 10:29:26.243 UTC","last_editor_display_name":"","last_editor_user_id":"106224","owner_display_name":"","owner_user_id":"319375","post_type_id":"1","score":"0","tags":"php|arrays|key","view_count":"206"} +{"id":"36429016","title":"Show subtitle in HTML5 video player using json","body":"\u003cp\u003eWe need to create a video player the same as the reference site below:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://www.vagalume.com.br/selena-gomez/love-you-like-a-love-song.html\" rel=\"nofollow\"\u003ehttp://www.vagalume.com.br/selena-gomez/love-you-like-a-love-song.html\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eWhat we need to achieve is to create a \u003ccode\u003eHTML5\u003c/code\u003e player which plays youtube video with subtitle dynamically.\u003c/p\u003e\n\n\u003cp\u003eI have added one link above which is our reference link and we need to make the same functionality given in reference site.\u003c/p\u003e\n\n\u003cp\u003eHere is our HTML page code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;code\u0026gt;\n$(document).ready(function() {\n $('audio, video').mediaelementplayer({\n alwaysShowControls: true,\n videoVolume: 'horizontal',\n features: ['playpause','progress','volume','fullscreen'],\n startLanguage: 'en'\n });\n});\n\u0026lt;/code\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOur video player code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;code\u0026gt;\nvideo id=\"video\" preload=\"metadata\" controls=\"controls\"\u0026gt;\n source type=\"video/youtube\" src=\"https://www.youtube.com/watch?v=FV4cwmM79NY\"\u0026gt;\n /video\u0026gt;\n\u0026lt;/code\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is our JavaScript code for adding subtitles dynamically.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;code\u0026gt;\n(function() {\n var video = document.getElementById(\"video\"), i, track, loadcues = document.getElementById(\"loadcues\"), hideTracks = function() {\n for (i = 0; i \u0026lt; video.textTracks.length; i++) {\n video.textTracks[i].mode = \"hidden\";\n }\n };\n trackdisplay();\n function trackdisplay(){\n hideTracks();\n track = video.addTextTrack(\"captions\", \"English\", \"en\");\n track.mode = \"showing\";\n track.addCue(new VTTCue(0, 12, \"Loaded Cues\"));\n track.addCue(new VTTCue(18.7, 21.5, \"This blade has a dark past.\"));\n track.addCue(new VTTCue(22.8, 26.8, \"It has shed much innocent blood.\"));\n track.addCue(new VTTCue(29, 32.45, \"You're a fool for traveling alone, so completely unprepared.\"));\n track.addCue(new VTTCue(32.75, 35.8, \"You're lucky your blood's still flowing.\"));\n track.addCue(new VTTCue(36.25, 37.3, \"Thank you.\"));\n track.addCue(new VTTCue(38.5, 40, \"So...\"));\n track.addCue(new VTTCue(40.4, 44.8, \"What brings you to the land of the gatekeepers?\"));\n track.addCue(new VTTCue(46, 48.5, \"I'm searching for someone.\"));\n track.addCue(new VTTCue(49, 53.2, \"Someone very dear? A kindred spirit?\"));\n track.addCue(new VTTCue(54.4, 56, \"A dragon.\"));\n track.addCue(new VTTCue(58.85, 61.75, \"A dangerous quest for a lone hunter.\"));\n track.addCue(new VTTCue(62.95, 65.87, \"I've been alone for as long as I can remember.\"));\n track.addCue(new VTTCue(118.25, 119.5, \"We're almost done. Shhh...\"));\n}\n //loadcues.addEventListener(\"click\", function() {\n\n //});\n}());\n\u0026lt;/code\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks in advance\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2016-04-05 14:17:44.92 UTC","last_activity_date":"2016-04-09 11:05:50.993 UTC","last_edit_date":"2016-04-09 11:05:50.993 UTC","last_editor_display_name":"","last_editor_user_id":"683218","owner_display_name":"","owner_user_id":"3404657","post_type_id":"1","score":"1","tags":"json|html5|youtube-api","view_count":"419"} +{"id":"25801916","title":"PHP Website - Loading Stylesheets in Sub Directories","body":"\u003cp\u003eI'm building a PHP based site with this directory structure\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eindex.php\u003c/p\u003e\n \n \u003cblockquote\u003e\n \u003cp\u003e\u003cstrong\u003ecss\u003c/strong\u003e \u003c/p\u003e\n \n \u003cblockquote\u003e\n \u003cul\u003e\n \u003cli\u003estyle.css\u003cbr /\u003e\u003c/li\u003e\n \u003cli\u003ebootstrap.css\u003c/li\u003e\n \u003c/ul\u003e\n \u003c/blockquote\u003e\n \n \u003cp\u003e\u003cstrong\u003eincludes\u003c/strong\u003e\u003c/p\u003e\n \n \u003cblockquote\u003e\n \u003cul\u003e\n \u003cli\u003eheader.php\u003cbr /\u003e\u003c/li\u003e\n \u003cli\u003efooter.php\u003c/li\u003e\n \u003c/ul\u003e\n \u003c/blockquote\u003e\n \n \u003cp\u003e\u003cstrong\u003ebikes\u003c/strong\u003e\u003c/p\u003e\n \n \u003cblockquote\u003e\n \u003cul\u003e\n \u003cli\u003eroad.php\u003cbr /\u003e\u003c/li\u003e\n \u003cli\u003emountain.php\u003c/li\u003e\n \u003c/ul\u003e\n \u003c/blockquote\u003e\n \u003c/blockquote\u003e\n\u003c/blockquote\u003e\n\n\u003ch2\u003eThe Problem\u003c/h2\u003e\n\n\u003cp\u003eSo I'm working on \u003cstrong\u003eroad.php\u003c/strong\u003e and I obviously need to be able to link to both \u003cstrong\u003estyle.css\u003c/strong\u003e and \u003cstrong\u003ebootstrap.css\u003c/strong\u003e, but when I declare at the start of \u003cstrong\u003eroad.php\u003c/strong\u003e to include the \u003cstrong\u003eheader.php\u003c/strong\u003e and \u003cstrong\u003efooter.php\u003c/strong\u003e it is like as if it cannot find the stylesheets and the site reverts back to the default 1990s look.\u003c/p\u003e\n\n\u003cp\u003eI have also found that any form of link on the page loads a 404. I'm only just starting out with PHP because I need some more power in my sites, but I just can't seem to get my head around the super basic things.\u003c/p\u003e\n\n\u003cp\u003eI just don't know what to do and I'm finding myself turning my back on the whole PHP language.\u003c/p\u003e\n\n\u003cp\u003eThanking you in advance,\u003c/p\u003e\n\n\u003cp\u003eStu :)\u003c/p\u003e","accepted_answer_id":"25801993","answer_count":"1","comment_count":"1","creation_date":"2014-09-12 06:16:31.317 UTC","last_activity_date":"2014-09-12 06:22:29.963 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2228686","post_type_id":"1","score":"-1","tags":"php|html|css|html5","view_count":"74"} +{"id":"12636916","title":"Skip a line line in a tabWidget","body":"\u003cp\u003eIs it possible to skip a line in a tabWidget? So far I've tried \\r and \\n but nothing...Here is a sample code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ethis.tabSpec = tabHost.newTabSpec(\"deux\").setIndicator(\"Alarme\\n volontaire\",\ngetResources().getDrawable(R.drawable.ic_tab_alert)).setContent(alarme);\nthis.tabHost.addTab(this.tabSpec);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks in advance !\u003c/p\u003e","accepted_answer_id":"12636989","answer_count":"1","comment_count":"0","creation_date":"2012-09-28 09:06:59.4 UTC","last_activity_date":"2012-09-28 09:11:04.31 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1083872","post_type_id":"1","score":"0","tags":"java|android|android-widget","view_count":"71"} +{"id":"43086555","title":"Can We Calculate The DOM Length of Each Steps in jQuery UI Slider","body":"\u003cp\u003eUsing jquery UI Slider I just wonder if there is a way to calculate the CSS length(width) of between steps in UI Slider? For example at following code I need to calculate the actual width between step1 (\u003ccode\u003emin\u003c/code\u003e) and step2 and so on! \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e $( function() {\n $('#slider').slider({\n min: 1,\n max: 5,\n range: \"min\",\n animate:\"slow\",\n value: 0\n });\n } );\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"43099409","answer_count":"1","comment_count":"1","creation_date":"2017-03-29 07:03:17.237 UTC","last_activity_date":"2017-03-29 16:41:32.563 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1106951","post_type_id":"1","score":"0","tags":"jquery-ui|jquery-ui-slider","view_count":"24"} +{"id":"4285787","title":"Data from MySQL CHARSET problems, please look the image!","body":"\u003cp\u003eIf ISO-8859-1 then (HTML Text: GOOD, MySQL Data: BAD)\nif UTF-8 then (HTML Text: BAD, MySQL Data: GOOD)\u003c/p\u003e\n\n\u003cp\u003eWhat can I do to solve it?\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/Ux4Gw.jpg\" alt=\"alt text\"\u003e\u003c/p\u003e","accepted_answer_id":"4285795","answer_count":"1","comment_count":"0","creation_date":"2010-11-26 13:42:43.8 UTC","last_activity_date":"2010-11-26 13:44:21.913 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"439866","post_type_id":"1","score":"2","tags":"php|mysql|html|http|utf-8","view_count":"64"} +{"id":"17366063","title":"update only rows with max(id) with condition","body":"\u003cp\u003eI can't find a solution for my problem..\u003c/p\u003e\n\n\u003cp\u003eLet's say we have a simple table like this :\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eid\u003c/li\u003e\n\u003cli\u003egroup_id\u003c/li\u003e\n\u003cli\u003eflag\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eFor the moment, the \u003ccode\u003eflag\u003c/code\u003e column is set to 0.\u003c/p\u003e\n\n\u003cp\u003eI want to update this table and set the \u003ccode\u003eflag\u003c/code\u003e to 1 only for rows that have the \u003cem\u003egreatest\u003c/em\u003e (newest)\u003ccode\u003eid\u003c/code\u003e when grouped by \u003ccode\u003egroup_id\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eI have been testing a lot of things, without success.\u003c/p\u003e\n\n\u003cp\u003eExample: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eid: 1, group_id: 1, flag: 0\nid: 2, group_id: 1, flag: 0\nid: 3, group_id: 1, flag: 0\nid: 4, group_id: 2, flag: 0\nid: 5, group_id: 2, flag: 0\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWill become :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eid: 1, group_id: 1, flag: 0\nid: 2, group_id: 1, flag: 0\nid: 3, group_id: 1, flag: 1\nid: 4, group_id: 2, flag: 0\nid: 5, group_id: 2, flag: 1\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"17366085","answer_count":"2","comment_count":"0","creation_date":"2013-06-28 13:40:38.457 UTC","last_activity_date":"2013-06-28 15:16:56.733 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"894097","post_type_id":"1","score":"0","tags":"mysql|sql-update","view_count":"497"} +{"id":"26989136","title":"Put a shape on pictureBox, c#","body":"\u003cp\u003eI have a pictureBox, I need to put some ovalshapes on different places over the pictureBox..\u003c/p\u003e\n\n\u003cp\u003eIn some reason the shapes are behind the picture and they unseen..\u003c/p\u003e\n\n\u003cp\u003eCan I do something that the shapes will be over the picture and not behind it..?\u003c/p\u003e\n\n\u003cp\u003eWhat property change this?\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2014-11-18 07:50:08.533 UTC","last_activity_date":"2014-11-18 08:41:00.51 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2922456","post_type_id":"1","score":"0","tags":"c#|forms|picturebox","view_count":"490"} +{"id":"5126654","title":"Android image scaling","body":"\u003cp\u003eI'm making an app for 1.6 and I'm having a problem with android image scaling, I have a picture that's 480x295. \u003c/p\u003e\n\n\u003cp\u003eOn a medium screen this appears correctly, but on a large screen (480x800 or 480x854) it doesn't fill the screen, it android makes the image 1.5x bigger, which is only 720x442.\u003c/p\u003e\n\n\u003cp\u003eAs 800 is actually 1.67 and 854 is 1.78, I can obviously just include large images for the drawable-hdpi folder, but the image is already 1.5mb, which is larger than people seem to like, and I can't use app2sd as I want to support 1.6.\u003c/p\u003e\n\n\u003cp\u003eAny suggestions?\u003c/p\u003e\n\n\u003cp\u003eI can only think of three options:\n1) Include the larger images (but that limits sales probably, and obviously increases the apk size)\u003c/p\u003e\n\n\u003cp\u003e2) Make 2 versions, seems a good solution, just harder to implement.\u003c/p\u003e\n\n\u003cp\u003e3) Change to 1.5, and handle all my scaling myself.\u003c/p\u003e\n\n\u003cp\u003eEDIT:\nMore details:\nI'm drawing using canvas and surfaceview\nImage loading code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ebackgroundBMP = BitmapFactory.decodeResource(getResources(), R.drawable.background, null);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd the drawing code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecanvas.drawBitmap(backgroundBMP, 0, 0, null);\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"5126719","answer_count":"3","comment_count":"2","creation_date":"2011-02-26 11:36:13.61 UTC","favorite_count":"1","last_activity_date":"2013-07-01 10:39:08.843 UTC","last_edit_date":"2011-02-26 12:58:39.89 UTC","last_editor_display_name":"","last_editor_user_id":"433825","owner_display_name":"","owner_user_id":"433825","post_type_id":"1","score":"0","tags":"android|image-scaling","view_count":"13049"} +{"id":"15965734","title":"database atomic operations implementation","body":"\u003cp\u003eThe question is about queries that are not wrapped in 'begin-commit' block, but about plain inserts and updates that are atomic in postgres, mysql (innodb engine at least). So how is this implemented internally?\u003c/p\u003e","accepted_answer_id":"17789447","answer_count":"1","comment_count":"3","creation_date":"2013-04-12 07:43:12.513 UTC","last_activity_date":"2013-07-22 13:57:00.75 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"618020","post_type_id":"1","score":"1","tags":"database|database-design","view_count":"58"} +{"id":"14089455","title":"Is there any benifit in using DataContract and DataMember attributes while working with Asp.net Web API?","body":"\u003cp\u003eMany time i saw that developer are using DataContract and DataMember Attributes for their Asp.net Web API model?\u003c/p\u003e\n\n\u003cp\u003eWhat are the differences and best practices?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2012-12-30 08:44:32.693 UTC","favorite_count":"2","last_activity_date":"2016-01-18 07:01:29.67 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"230984","post_type_id":"1","score":"6","tags":"asp.net|asp.net-web-api|datacontract|data-members","view_count":"2245"} +{"id":"43631131","title":"Spring \u0026 neo4j: Previous relationships are deleted when adding new ones","body":"\u003cp\u003eHere is my User class:\u003c/p\u003e\n\n\u003cpre class=\"lang-java prettyprint-override\"\u003e\u003ccode\u003e@NodeEntity\npublic class User {\n\n @GraphId\n private Long id;\n\n @Property\n private String name;\n\n @Property\n private String email;\n\n @Property\n private String password;\n\n @Property\n private String photoLink;\n\n @Property\n private Integer age;\n\n @Property\n private Country country;\n\n @Property\n private Gender gender;\n\n @Property\n private String about;\n\n @Property\n private boolean online;\n\n private Collection\u0026lt;UserHasLanguage\u0026gt; hasLanguage;\n\n @Relationship(type=\"HAS_ROLE\", direction=Relationship.OUTGOING)\n private Collection\u0026lt;Role\u0026gt; roles;\n\n @Relationship(type=\"HAS_IN_FRIENDLIST\", direction=Relationship.OUTGOING)\n private Collection\u0026lt;User\u0026gt; friendList;\n\n @Relationship(type=\"HAS_IN_BLACKLIST\", direction=Relationship.OUTGOING)\n private Collection\u0026lt;User\u0026gt; blackList;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo I want users to have one-side relationships HAS_IN_FRIENDLIST to other users.\nAt the service level I have a method for adding friends to user:\u003c/p\u003e\n\n\u003cpre class=\"lang-java prettyprint-override\"\u003e\u003ccode\u003epublic void addToFriendList (User whoAdds, User whoIsAdded)\n throws UserNotFoundException{\n if (whoIsAdded == null)\n throw new UserNotFoundException(\"User not found\");\n Collection\u0026lt;User\u0026gt; friendList = whoAdds.getFriendList();\n if (friendList == null)\n friendList = new HashSet\u0026lt;\u0026gt;();\n friendList.add(whoIsAdded);\n whoAdds.setFriendList(friendList);\n userRepository.save(whoAdds);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, when I use this method, some previous relationships \"HAS_IN_FRIENDLIST\" of this user are removed. \nI have noticed, that whoAdds.getFriendList() method always returns only 1 User.\u003c/p\u003e\n\n\u003cp\u003eHow can I fix this? \u003c/p\u003e","accepted_answer_id":"43642653","answer_count":"1","comment_count":"6","creation_date":"2017-04-26 10:09:17.233 UTC","last_activity_date":"2017-04-26 19:11:09.8 UTC","last_edit_date":"2017-04-26 11:09:40.58 UTC","last_editor_display_name":"","last_editor_user_id":"7586323","owner_display_name":"","owner_user_id":"7586323","post_type_id":"1","score":"0","tags":"java|spring|neo4j|spring-data-neo4j","view_count":"45"} +{"id":"34111056","title":"Cant find PasswordValidator property in UserManager, AspNet.Identity 3","body":"\u003cp\u003eI want to change the password requirements for my registration form but I cant find the PasswordValidator property in the UserManager class.\u003c/p\u003e\n\n\u003cp\u003eI'm using AspNet.Identity.EntityFramework 3.0.0-beta5\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate readonly UserManager\u0026lt;AppUser\u0026gt; _userManager;\n private readonly SignInManager\u0026lt;AppUser\u0026gt; _signInManager;\n\n public AccountController(UserManager\u0026lt;AppUser\u0026gt; userManager, SignInManager\u0026lt;AppUser\u0026gt; signInManager)\n {\n\n _userManager = userManager;\n _signInManager = signInManager;\n\n // UserManager does not contain a definition for PasswordValidator\n //_userManager.PasswordValidator\n\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e(For comparison, in Microsoft ASP.NET Identity 2.0, documentation for \u003ccode\u003eUserManager\u0026lt;TUser, TKey\u0026gt;.PasswordValidator\u003c/code\u003e is \u003ca href=\"https://msdn.microsoft.com/en-us/library/mt151680%28v=vs.108%29.aspx#P:Microsoft.AspNet.Identity.UserManager%602.PasswordValidator\" rel=\"nofollow\"\u003ehere\u003c/a\u003e.)\u003c/p\u003e","accepted_answer_id":"34120470","answer_count":"1","comment_count":"0","creation_date":"2015-12-05 21:21:47.573 UTC","last_activity_date":"2015-12-06 17:34:31.923 UTC","last_edit_date":"2015-12-06 08:16:26.2 UTC","last_editor_display_name":"","last_editor_user_id":"3744182","owner_display_name":"","owner_user_id":"3621898","post_type_id":"1","score":"0","tags":"c#|asp.net-mvc|asp.net-identity|asp.net-identity-3","view_count":"395"} +{"id":"18965500","title":"How do I precisely specify the CRM Solution for CRMPackage Plugins deployment?","body":"\u003cp\u003eHaving trouble getting MSBuild/Visual Studio 2012 to deploy a CRM 2011 Plugin Assembly to a named CRM Solution.\u003c/p\u003e\n\n\u003cp\u003eI've 2 project/SLNs. In one, I can precisely control which CRM Solution the build deploys a Plugin Assembly into; my \u003ccode\u003emsbuild\u003c/code\u003e (call this build-1) creates a CRM Solution with my custom entities/forms and Plugins. In another, despite specifying the exact values via \u003ccode\u003emsbuild /p\u003c/code\u003e for \u003ccode\u003eCRMOrganization\u003c/code\u003e, \u003ccode\u003eCRMSolutionName\u003c/code\u003e, \u003ccode\u003eCRMDiscoveryServer\u003c/code\u003e, '\u003ccode\u003eCRMDiscoveryServerScheme\u003c/code\u003e, the resulting CRM Solution contains only the entities/forms. The Plugins are deployed but placed incorrectly into the Default Solution (call this build-2).\u003c/p\u003e\n\n\u003cp\u003eI've created build-2 from copy/pasting the values (except SLN and Project names) from build-1...and am at a loss to understand why build-1 deploys the plugins to my named CRM Solution, but build-2 deploys them to the Organization's Default CRM Solution.\u003c/p\u003e\n\n\u003cp\u003eAny ideas?\u003c/p\u003e","accepted_answer_id":"19160658","answer_count":"2","comment_count":"0","creation_date":"2013-09-23 17:39:00.273 UTC","last_activity_date":"2013-10-03 13:35:02.327 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"66780","post_type_id":"1","score":"0","tags":"plugins|msbuild|dynamics-crm-2011","view_count":"582"} +{"id":"37032290","title":"Javascript homework","body":"\u003cpre\u003e\u003ccode\u003e\u0026lt;!DOCTYPE html\u0026gt;\n\u0026lt;html\u0026gt;\n\n \u0026lt;body\u0026gt;\n \u0026lt;script type=\"text/javascript\"\u0026gt;\n var images1 = new Array(\"strawberry.jpg\", \"apple.jpg\", \"cherry.jpg\", \"orange.jpg\", \"pear.jpg\");\n var images2 = new Array(\"strawberry.jpg\", \"apple.jpg\", \"cherry.jpg\", \"orange.jpg\", \"pear.jpg\");\n var images3 = new Array(\"strawberry.jpg\", \"apple.jpg\", \"cherry.jpg\", \"orange.jpg\", \"pear.jpg\");\n var length = images1.length;\n var randImg = Math.round(Math.random() * (length - 1));\n document.write('\u0026lt;img src=\"' + images1[randImg] + '\" \u0026gt;');\n var length = images2.length;\n var randImg = Math.round(Math.random() * (length - 1));\n document.write('\u0026lt;img src=\"' + images2[randImg] + '\" \u0026gt;');\n var length = images3.length;\n var randImg = Math.round(Math.random() * (length - 1));\n document.write('\u0026lt;img src=\"' + images3[randImg] + '\" \u0026gt;');\n\n \u0026lt;/script\u0026gt;\n \u0026lt;/body\u0026gt;\n\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to compare the images of the arrays if 3 images are strawberry I want to create an alert message like 'congrats you won' but I couldn't do that, how can I do that ?\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2016-05-04 15:37:24.943 UTC","last_activity_date":"2016-05-04 18:12:43.527 UTC","last_edit_date":"2016-05-04 15:39:21.16 UTC","last_editor_display_name":"","last_editor_user_id":"1612146","owner_display_name":"","owner_user_id":"6248630","post_type_id":"1","score":"-4","tags":"javascript","view_count":"68"} +{"id":"31922018","title":"How to properly read a TCP stream without blocking","body":"\u003cp\u003eI have a TCP server (async) and TCP client (sync).\u003c/p\u003e\n\n\u003cp\u003eThe TCP server is sending data to the client like so:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate async Task Send(TcpClient client, CancellationToken ct, string message) {\n Console.WriteLine(\"Sending Message \" + message);\n message += \"\u0026lt;EOF\u0026gt;\";\n NetworkStream stream = client.GetStream();\n byte[] msg = Encoding.ASCII.GetBytes(message);\n await stream.WriteAsync(msg, 0, msg.Length, ct).ConfigureAwait(false);\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy client is calling this read every update\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate string ReadStream(){\n if(stream.DataAvailable) \n return reader.ReadLine();\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis results in my client blocking. In my code I do have some string building techniques to accumulate the read stream, so that I can search for \u003ccode\u003e\"\u0026lt;EOF\u0026gt;\"\u003c/code\u003e to know when this message is done. But it seems that if I do not disconnect the client \u003cem\u003efrom the server\u003c/em\u003e, the client will hang forever.\u003c/p\u003e\n\n\u003cp\u003eWhat is a better way to continually read a TCP socket from the client's perspective?\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2015-08-10 14:18:40.607 UTC","last_activity_date":"2015-08-10 14:28:19.773 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5094662","post_type_id":"1","score":"0","tags":"c#|sockets|tcp","view_count":"382"} +{"id":"38372202","title":"Kivy properties not automatically updating","body":"\u003cp\u003eI'm having trouble with binding properties across different rules using kivy language.\u003c/p\u003e\n\n\u003cp\u003eIn particular, I'm trying to use a color picker to change the background color a few labels; I'm using a \u003ccode\u003eScreenManager\u003c/code\u003e to handle two different \u003ccode\u003eScreen\u003c/code\u003es, a main screen with just a \u003ccode\u003eMyButton\u003c/code\u003e instance (a subclass of \u003ccode\u003eLabel\u003c/code\u003e, as can be seen in the code) and another screen with a \u003ccode\u003eColorPicker\u003c/code\u003e and another \u003ccode\u003eMyButton\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eHere's the code I'm working on:\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003epicker.py\u003c/code\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efrom kivy.app import App\nfrom kivy.properties import BoundedNumericProperty, ReferenceListProperty, \\\n ObjectProperty\nfrom kivy.uix.behaviors.button import ButtonBehavior\nfrom kivy.uix.label import Label\nfrom kivy.uix.screenmanager import Screen\n\n\nclass MyScreen(Screen):\n my_picker = ObjectProperty(None)\n\nclass MyButton(ButtonBehavior, Label):\n my_r = BoundedNumericProperty(1, min=0, max=1)\n my_g = BoundedNumericProperty(1, min=0, max=1)\n my_b = BoundedNumericProperty(1, min=0, max=1)\n my_a = BoundedNumericProperty(1, min=0, max=1)\n my_rgba = ReferenceListProperty(my_r, my_g, my_b, my_a)\n\nclass PickerApp(App):\n pass\n\n\ndef main():\n PickerApp().run()\n\nif __name__ == '__main__':\n main()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003ccode\u003epicker.kv\u003c/code\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;MyButton@Label\u0026gt;:\n color: 0, 0, 0, 1\n canvas.before:\n Color:\n rgba: self.my_rgba\n Rectangle:\n pos: self.pos\n size: self.size\n\n\u0026lt;PickerScreen@MyScreen\u0026gt;:\n my_picker: picker\n BoxLayout:\n orientation: 'vertical'\n MyButton:\n my_rgba: picker.color\n text: \"Back\"\n size_hint: 1, .2\n on_press:\n root.manager.current = 'main'\n ColorPicker:\n id: picker\n\n\u0026lt;MainScreen@MyScreen\u0026gt;:\n MyButton:\n my_rgba: root.my_picker.color if root.my_picker is not None else .5, .5, .5, 1\n text: \"Picker\"\n on_press:\n root.manager.current = 'picker'\n\nScreenManager:\n MainScreen:\n name: 'main'\n my_picker: picker_screen.my_picker\n PickerScreen:\n name: 'picker'\n id: picker_screen\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I select a color on the \u003ccode\u003eColorPicker\u003c/code\u003e, I want both buttons to change their background; but while the button in the \u003ccode\u003ePickerScreen\u003c/code\u003e changes on color selection, apparently the \u003ccode\u003emy_rgba\u003c/code\u003e of the button in the main screen isn't bound to \u003ccode\u003eroot.my_picker.color\u003c/code\u003e, as I expected.\u003c/p\u003e\n\n\u003cp\u003eI thought the issue could be because of the if-then-else expression; but I tried initializing the \u003ccode\u003eObjectProperty\u003c/code\u003e in \u003ccode\u003eMyScreen\u003c/code\u003e with a dummy value, removing the if-then-else expression, and the behaviour seems identical.\u003c/p\u003e\n\n\u003cp\u003eWhat am I doing wrong? I'm just starting with Kivy, but I thought that properties were automatically bound so that if \u003ccode\u003eroot.my_picker.color\u003c/code\u003e changed, so should both the buttons \u003ccode\u003emy_rgba\u003c/code\u003e properties.\u003c/p\u003e","accepted_answer_id":"38529978","answer_count":"1","comment_count":"4","creation_date":"2016-07-14 10:48:58.91 UTC","last_activity_date":"2016-07-22 15:15:09.55 UTC","last_edit_date":"2016-07-14 14:34:58.437 UTC","last_editor_display_name":"","last_editor_user_id":"1178243","owner_display_name":"","owner_user_id":"1178243","post_type_id":"1","score":"0","tags":"kivy|python-3.5","view_count":"82"} +{"id":"33290566","title":"Facebook SDK for iOS: FBSDKShareDialog is not shown","body":"\u003cp\u003eI am a newbie in iOS, and I would like to share a link using the Facebook SDK for iOS. My code's as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@IBAction func shareVoucherUsingFacebook(sender: UIButton) {\n print(\"Facebook\")\n let content : FBSDKShareLinkContent = FBSDKShareLinkContent()\n content.contentURL = NSURL(string: \"www.google.com\")\n content.contentTitle = \"Content Title\"\n content.contentDescription = \"This is the description\"\n\n let shareDialog: FBSDKShareDialog = FBSDKShareDialog()\n\n shareDialog.shareContent = content\n shareDialog.delegate = self\n shareDialog.fromViewController = self\n shareDialog.show()\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have also implemented the \u003ccode\u003eFBSDKSharingDelegate\u003c/code\u003e methods, but I am not able to receive the share dialog when I press this button, and the method \u003ccode\u003efunc sharer(sharer: FBSDKSharing!, didFailWithError error: NSError!)\u003c/code\u003e is being executed, which means something is going wrong, but I can't figure it out.\u003c/p\u003e\n\n\u003cp\u003eThanks in advance.\u003c/p\u003e","accepted_answer_id":"38368855","answer_count":"2","comment_count":"1","creation_date":"2015-10-22 20:54:16.88 UTC","last_activity_date":"2016-07-14 08:18:45.707 UTC","last_edit_date":"2015-10-22 21:40:56.287 UTC","last_editor_display_name":"","last_editor_user_id":"3705840","owner_display_name":"","owner_user_id":"3705840","post_type_id":"1","score":"2","tags":"ios|swift|swift2|facebook-sdk-4.0","view_count":"2556"} +{"id":"10736844","title":"Table Column Styling using CSS","body":"\u003cp\u003eI have the following HTML table. I need to give a background color to each column (first column = red, second column = yellow, third column = blue). How can I do this using CSS?\u003c/p\u003e\n\n\u003cp\u003eNote: This need to work in IE6 onwards.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://jsfiddle.net/Lijo/kw4yU/\" rel=\"nofollow noreferrer\"\u003ehttp://jsfiddle.net/Lijo/kw4yU/\u003c/a\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;table id = \"myTable\"\u0026gt;\n \u0026lt;thead\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;th\u0026gt;\n Name\n \u0026lt;/th\u0026gt;\n \u0026lt;th\u0026gt;\n Address\n \u0026lt;/th\u0026gt;\n \u0026lt;th\u0026gt;\n Age\n \u0026lt;/th\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;/thead\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;\n Lijo\n \u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\n India\n \u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\n 27\n \u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n\u0026lt;/table\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003chr\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI got it working by putting the js code inside document.ready. Thanks to @Jose Rui Santos \u003ca href=\"http://jsfiddle.net/Lijo/kw4yU/11/\" rel=\"nofollow noreferrer\"\u003ehttp://jsfiddle.net/Lijo/kw4yU/11/\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eAnother solution is \u003ca href=\"http://jsfiddle.net/Lijo/kw4yU/12/\" rel=\"nofollow noreferrer\"\u003ehttp://jsfiddle.net/Lijo/kw4yU/12/\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eYet another approach: \u003ca href=\"https://stackoverflow.com/questions/12006917/column-width-setting-html-table\"\u003eColumn width setting - HTML table\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"10736901","answer_count":"9","comment_count":"3","creation_date":"2012-05-24 11:44:40.673 UTC","favorite_count":"3","last_activity_date":"2012-08-17 14:13:20.063 UTC","last_edit_date":"2017-05-23 11:52:11.833 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"696627","post_type_id":"1","score":"3","tags":"javascript|jquery|html|css","view_count":"5517"} +{"id":"6650919","title":"Resharper 6.0 tab instead of spaces","body":"\u003cp\u003eHow to force resharper 6.0 to use tab instead of spaces during code clearup ?\u003c/p\u003e","accepted_answer_id":"6915580","answer_count":"3","comment_count":"0","creation_date":"2011-07-11 13:36:38.083 UTC","last_activity_date":"2017-08-14 16:26:52.163 UTC","last_edit_date":"2017-08-14 16:26:52.163 UTC","last_editor_display_name":"","last_editor_user_id":"1033581","owner_display_name":"","owner_user_id":"656822","post_type_id":"1","score":"16","tags":"visual-studio-2010|resharper","view_count":"4414"} +{"id":"8385389","title":"how to use .csv file in android?","body":"\u003cp\u003eI'm doing a sample Quiz application in Android. I used array to store the Questions and Answers, now I wish to store the questions and answers in a \u003ccode\u003e.csv\u003c/code\u003e file.\nit is possible to parse \u003ccode\u003e.csv\u003c/code\u003e file in Android?\u003c/p\u003e","answer_count":"4","comment_count":"2","creation_date":"2011-12-05 12:35:20.02 UTC","favorite_count":"2","last_activity_date":"2016-10-19 04:57:47.77 UTC","last_edit_date":"2016-10-19 04:57:47.77 UTC","last_editor_display_name":"user6613600","owner_display_name":"","owner_user_id":"1173341","post_type_id":"1","score":"0","tags":"android|csv","view_count":"11859"} +{"id":"40293657","title":"How to make child span collapse with parent","body":"\u003cp\u003eI am teaching myself about animations using simple rectangles and I have so far managed a bit of progress with this simple project:\u003c/p\u003e\n\n\u003cp\u003ehtml:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;!DOCTYPE html\u0026gt;\n\u0026lt;html\u0026gt;\n \u0026lt;head\u0026gt;\n \u0026lt;title\u0026gt;test slider\u0026lt;/title\u0026gt;\n\n \u0026lt;link rel=\"stylesheet\" type=\"text/css\" href=\"styles.css\"\u0026gt; \n \u0026lt;script type=\"text/javascript\" src=\"jquery.js\"\u0026gt;\u0026lt;/script\u0026gt; \n \u0026lt;script type=\"text/javascript\" src=\"script.js\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;/head\u0026gt;\n\n \u0026lt;body\u0026gt;\n \u0026lt;span class=\"rect\"\u0026gt;\n \u0026lt;span class=\"otherrect\"\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;/span\u0026gt; \n \u0026lt;p id=\"button\"\u0026gt; click here \u0026lt;/p\u0026gt;\n \u0026lt;/body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ecss\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e.rect{\n float: left;\n height: 400px;\n width: 550px;\n background-color: blue;\n\n transition-property: all;\n transition-duration: 2s;\n transition-timing-function: ease-in-out; \n}\n\n.otherrect {\n float: left;\n height: 200px;\n width: 250px;\n background-color: red;\n}\n\n.closed {\n height: 0;\n background-color: white; \n}\n\n#button {\n float: right;\n margin-top: 200px;\n margin-right: 500px;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ejs\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(document).ready(function(){\n\n $(\"#button\").click(function(){\n\n if ($( \".rect\" ).hasClass( \"closed\" )){\n\n $(\".rect\").removeClass(\"closed\");\n\n } else {\n\n $(\".rect\").addClass(\"closed\"); \n }\n\n });\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd it looks like this:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/0dKlZ.gif\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/0dKlZ.gif\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eSo, what I was aiming at, was that the red rectangle (class: otherrect) should also collapse and fade like its parent rectangle. How can I do this without using javascript and preferably not having to use the display property. Thanks for your time. P\u003c/p\u003e\n\n\u003cp\u003e---------------------------------EDIT AFTER RECEIVING ANSWERS-----------------------------------\u003c/p\u003e\n\n\u003cp\u003eThank you all for your answers. These are all good in one way or another, but I guess I sould have mentioned that the red rectangle is going to be a video in the finished project so I need it to be a child of the other element because if the class that collapses it is applied to it directly, it affects the way it looks. Please refer to this other question to see a gif of what I mean:\n\u003ca href=\"https://stackoverflow.com/questions/40267584/slidedown-function-behaving-oddly\"\u003eslideDown() function behaving oddly\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"40293693","answer_count":"3","comment_count":"5","creation_date":"2016-10-27 20:27:49.047 UTC","last_activity_date":"2016-10-27 21:20:51.423 UTC","last_edit_date":"2017-05-23 10:34:15.33 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"5684416","post_type_id":"1","score":"1","tags":"javascript|html|css|parent-child|transition","view_count":"56"} +{"id":"45513141","title":"Soot plugin and command line - windows - jdk1.7","body":"\u003cp\u003eI've created a simple plugin following the instructions found \u003ca href=\"https://github.com/Sable/soot/wiki/Creating-Soot-Plugins\" rel=\"nofollow noreferrer\"\u003ehere\u003c/a\u003e and \u003ca href=\"http://blog.security-comprehension.org/?page_id=154\" rel=\"nofollow noreferrer\"\u003ehere\u003c/a\u003e. \u003c/p\u003e\n\n\u003cp\u003eHowever, when I launch Soot from command line I get an error (I also get a similar error when using the full path of the jars)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eC:\\..\\folder\u0026gt;java -cp soot-2.5.0.jar;plugin.jar soot.Main --plugin plugin.xml -p jap.foo opt:true java.lang.Object\n\nInvalid option -plugin Exception in thread \"main\" soot.CompilationDeathException: Option parse error\n at soot.Main.processCmdLine(Main.java:85)\n at soot.Main.run(Main.java:161)\n at soot.Main.main(Main.java:141)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat am I missing? Any help is welcome\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-08-04 18:13:35.62 UTC","last_activity_date":"2017-08-05 08:25:54.23 UTC","last_edit_date":"2017-08-05 08:25:54.23 UTC","last_editor_display_name":"","last_editor_user_id":"3695939","owner_display_name":"","owner_user_id":"2314405","post_type_id":"1","score":"0","tags":"soot","view_count":"19"} +{"id":"22331051","title":"How to create a custom keyboard that looks like the standard one","body":"\u003cp\u003eI am experimenting with custom ime on android. The sample SoftKeyboard app seems to show everything I need except how to make the keyboard look like the standard one (colors, hover effects, sizes etc.). \nIt seems like reusing resources from the standard keyboard sources could work, but I receive errors when trying to compile them like:\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eerror: Error: No resource found that matches the given name: attr android:layout_alignParentStart'.\u003c/strong\u003e \u003c/p\u003e\n\n\u003cp\u003eCommenting these errors produce lots of other XML errors, like:\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eerror: No resource identifier found for attribute 'additionalMoreKeys' in package 'com.android.inputmethod.latin' key_f1.xml\u003c/strong\u003e \u003c/p\u003e\n\n\u003cp\u003eIs there some semi automatic a way to fix these errors and make them compile?\u003c/p\u003e\n\n\u003cp\u003eI have got the sources from here: \u003ca href=\"https://android.googlesource.com/platform/packages/inputmethods/LatinIME/+/android-4.4.2_r2\" rel=\"nofollow\"\u003ehttps://android.googlesource.com/platform/packages/inputmethods/LatinIME/+/android-4.4.2_r2\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThanks in advance.\u003c/p\u003e","accepted_answer_id":"22331467","answer_count":"3","comment_count":"0","creation_date":"2014-03-11 16:41:04.43 UTC","last_activity_date":"2014-03-13 13:22:06.233 UTC","last_edit_date":"2014-03-12 09:34:15.487 UTC","last_editor_display_name":"","last_editor_user_id":"763867","owner_display_name":"","owner_user_id":"763867","post_type_id":"1","score":"-1","tags":"java|android|eclipse|keyboard|ime","view_count":"1288"} +{"id":"46425065","title":"Understanding Failure Hits reports","body":"\u003cp\u003eI have a MonoGame based game up on the Store with gamers playing it. Under Failure Hits, I get a stack trace. I'm having trouble making sense of these stack traces. \u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/ydmjS.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/ydmjS.png\" alt=\"Stack trace from Developer Dashboard\"\u003e\u003c/a\u003e\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2017-09-26 11:20:04.85 UTC","last_activity_date":"2017-09-26 11:20:04.85 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6417418","post_type_id":"1","score":"0","tags":"uwp|windows-store-apps|windows-10-universal|windows-store","view_count":"26"} +{"id":"47193851","title":"Does memory address change after new declaration?","body":"\u003cp\u003eAfter executing \"0th sentence\" memory address of n1, n2 and *pn were ADDR:0061FF2C, 0061FF28, 0061FF24. Do they change after executing 1), 2) and 3)? I put printf for every code but they do not seem to change. theoretically, shouldn't they change because variables were assigned new values?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;stdio.h\u0026gt; \nint main(void) \n{\n int n1=3, * pn = \u0026amp;n1;\n int n2=0;\n\n printf(\"%p, %p, %p\\n\", \u0026amp;n1, \u0026amp;n2, \u0026amp;pn); // 0)\n n2 = *pn; // 1)\n *pn = n2 + 1; // 2)\n n1 = *pn + *(\u0026amp;n2); // 3)\n printf(\"%d, %d, %d\\n\",n1,n2,*pn); // 4)\n return 0;\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"1","creation_date":"2017-11-09 04:21:43.817 UTC","last_activity_date":"2017-11-09 04:48:47.74 UTC","last_edit_date":"2017-11-09 04:31:07.427 UTC","last_editor_display_name":"","last_editor_user_id":"995714","owner_display_name":"","owner_user_id":"7759870","post_type_id":"1","score":"1","tags":"c|pointers|declaration","view_count":"49"} +{"id":"23232639","title":"Passing an array of integers from JavaScript to a controller action of List\u003cint\u003e","body":"\u003cp\u003eI am using javascript code to postdata to a controller action coded in C#. I am getting a null value when attempting to pass an array of integers in javascript created as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar answers = [];\nanswers.push(1);\nanswers.push(2);\nanswers.push(3);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI can see from javascript alert that the values are going into array as when I try answers.tostring I am getting the value \"1,2,3\" as expected, I am then trying the following postdata \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar postData = {\n 'surveyID': surveyID,\n 'questionID': questionID,\n 'answers': answers,\n 'answerText': null,\n 'comment': comment,\n 'questionType': questionType\n };\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is targetting the following controller action but the array of integers does not seem to be carrying across to the controller action as my List is always null\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[HttpPost]\npublic PartialViewResult GoForward(int surveyID, int questionID, List\u0026lt;int\u0026gt; answers, string answerText, string comment, string questionType)\n{}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny know how I can get the postdata array to translate to a List that is not null?\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2014-04-23 00:21:40.32 UTC","last_activity_date":"2014-04-23 02:15:06.217 UTC","last_edit_date":"2014-04-23 00:25:03.8 UTC","last_editor_display_name":"","last_editor_user_id":"2864275","owner_display_name":"","owner_user_id":"1180519","post_type_id":"1","score":"0","tags":"c#|javascript|arrays|list|postdata","view_count":"916"} +{"id":"28245285","title":"Animating strings fading in/out in Swift","body":"\u003cp\u003eI'm new to programming - but I've made strides learning Swift for iOS in the last two months. I'm making a simple typing game - and the way I've structured my project is that I have a hidden UITextView that detects the character pressed by the player, and I match that character string with a visible UITextView's character string.\u003c/p\u003e\n\n\u003cp\u003eWhat I'm looking to do now is to add some sort of animation - I'd like the individual letters to fade in/out\u003c/p\u003e\n\n\u003cp\u003eI've created an attributed string, added it to a UITextView, and I just can't figure out a way to animate a specific range in the string. I've tried using something along the lines of this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e UIView.animateWithDuration(1, delay: 0.5, options: .CurveEaseOut, animations: {\n self.stringForPlayer.addAttribute(\n NSForegroundColorAttributeName,\n value: UIColor.greenColor(),\n range: NSRange(location: self.rangeOfText, length: 1))\n self.textViewForPlayer.attributedText = self.textForPlayer\n }, completion: { finished in\n println(\"FINISHED\")}\n )\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewith no luck. I figure maybe UIView animations are only on the view object itself and can't be used on the attributed string. Any ideas or even workarounds to make this happen? Any help is appreciated, thanks a lot!\u003c/p\u003e","accepted_answer_id":"28246242","answer_count":"1","comment_count":"8","creation_date":"2015-01-30 21:54:49.557 UTC","last_activity_date":"2015-01-30 23:46:48.107 UTC","last_edit_date":"2015-01-30 23:46:22.73 UTC","last_editor_display_name":"","last_editor_user_id":"4398669","owner_display_name":"","owner_user_id":"4398669","post_type_id":"1","score":"2","tags":"ios|string|animation|swift","view_count":"1382"} +{"id":"20559816","title":"Same plugin to be used twice in a page without error","body":"\u003cp\u003eI have a page that uses \"Mac style bouncing menus\" once on the left side panel and then again in the footer. Basically it's just the same plugin with different images.\u003c/p\u003e\n\n\u003cp\u003eEither one only works, even I tried \u003ccode\u003ejQuery.noConflict(true)\u003c/code\u003e , doesn't help.\u003c/p\u003e\n\n\u003cp\u003eMy question is if we were to repeat the same plugin in a page ,what need to be done to avoid the conflict? from my understanding if various plugin to be used,\u003ccode\u003ejQuery.noConflict\u003c/code\u003e can solve it but for the same type of \u003ccode\u003eplugin\u003c/code\u003e?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etest4.php\n\n\u0026lt;!DOCTYPE html\u0026gt;\n\u0026lt;!--\nTo change this license header, choose License Headers in Project Properties.\nTo change this template file, choose Tools | Templates\nand open the template in the editor.\n--\u0026gt;\n\u0026lt;html\u0026gt;\n \u0026lt;head\u0026gt;\n \u0026lt;meta charset=\"UTF-8\"\u0026gt;\n \u0026lt;title\u0026gt;Test4\u0026lt;/title\u0026gt;\n \u0026lt;link rel=\"stylesheet\" href=\"css/style1.css\" type=\"text/css\"\u0026gt;\n \u0026lt;link rel=\"stylesheet\" href=\"css/side_style.css\" type=\"text/css\"\u0026gt;\n \u0026lt;script src=\"js/menuv2.js\" type=\"text/javascript\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;!--\u0026lt;link href=\"http://getbootstrap.com/2.3.2/assets/css/bootstrap.css\" rel=\"stylesheet\" /\u0026gt;--\u0026gt;\n \u0026lt;link href=\"css/bootstrap.css\" rel=\"stylesheet\" /\u0026gt;\n \u0026lt;link href=\"http://getbootstrap.com/2.3.2/assets/js/google-code-prettify/prettify.css\" rel=\"stylesheet\" /\u0026gt;\n\n \u0026lt;link href=\"http://getbootstrap.com/2.3.2/assets/css/bootstrap-responsive.css\" rel=\"stylesheet\" /\u0026gt;\n\n\n \u0026lt;script src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;script type=\"text/javascript\" src=\"http://getbootstrap.com/2.3.2/assets/js/google-code-prettify/prettify.js\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;script src=\"http://getbootstrap.com/2.3.2/assets/js/bootstrap.js\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;script src=\"js/bootstrap-modalmanager.js\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;script src=\"js/bootstrap-modal.js\"\u0026gt;\u0026lt;/script\u0026gt;\n\n \u0026lt;script type=\"text/javascript\" src=\"js/jquery.js\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;script type=\"text/javascript\" src=\"js/interface.js\"\u0026gt;\u0026lt;/script\u0026gt;\n\n \u0026lt;/head\u0026gt;\n \u0026lt;body id='superstar'\u0026gt;\n \u0026lt;div class='left'\u0026gt;\n \u0026lt;aside\u0026gt;\n \u0026lt;img src=\"hooha_images/logo_small.png\" class=\"expand\"\u0026gt;\n \u0026lt;/aside\u0026gt;\n \u0026lt;aside class=\"ontop\"\u0026gt;\n \u0026lt;?php\n include ('sidebar.php');\n\n ?\u0026gt;\n\n\n\n \u0026lt;/aside\u0026gt;\n \u0026lt;aside\u0026gt;\n\n \u0026lt;aside\u0026gt;\n\n \u0026lt;?php include('bottom_left.php');?\u0026gt;//1st Mac styled menu\n \u0026lt;/aside\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"wrap\"\u0026gt;\n \u0026lt;div class='middle'\u0026gt;\n \u0026lt;font color='#fff'\u0026gt;\u0026lt;center\u0026gt;This is the Shop With Us Page of Indonesia\u0026lt;/center\u0026gt;\u0026lt;/font\u0026gt;\n\n \u0026lt;/div\u0026gt;\n\n\n \u0026lt;div class=\"footer\"\u0026gt;\n\n \u0026lt;?php\n include ('footer.php');//2nd Mac styled menu\n ?\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class='right'\u0026gt;\n\n \u0026lt;?php\n include 'top-right.php';\n include 'side-ad.php';\n ?\u0026gt;\n\n \u0026lt;/div\u0026gt; \n\n\n \u0026lt;/body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebottom-left.php\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"dock\" id=\"dock1\"\u0026gt;\n \u0026lt;div class=\"dock-container1\"\u0026gt;\n \u0026lt;a class=\"dock-item2\" href=\"index.php\"\u0026gt;\u0026lt;span\u0026gt;Home\u0026lt;/span\u0026gt;\u0026lt;img src=\"images/home.png\" alt=\"home\" /\u0026gt;\u0026lt;/a\u0026gt; \n \u0026lt;a class=\"dock-item2\" href=\"about-intro.php\"\u0026gt;\u0026lt;span\u0026gt;About Us\u0026lt;/span\u0026gt;\u0026lt;img src=\"images/portfolio.png\" alt=\"contact\" /\u0026gt;\u0026lt;/a\u0026gt; \n \u0026lt;a class=\"dock-item2\" href=\"contact-us.php\"\u0026gt;\u0026lt;span\u0026gt;Contact Us\u0026lt;/span\u0026gt;\u0026lt;img src=\"images/email.png\" alt=\"portfolio\" /\u0026gt;\u0026lt;/a\u0026gt; \n\n \u0026lt;/div\u0026gt;\n\n\u0026lt;/div\u0026gt;\n\n\u0026lt;!--dock menu JS options --\u0026gt;\n\u0026lt;script type=\"text/javascript\"\u0026gt;\n\n $(document).ready(\n function()\n {\n $('#dock2').Fisheye(\n {\n maxWidth: 60,\n items: 'a',\n itemsText: 'span',\n container: '.dock-container2',\n itemWidth: 40,\n proximity: 80,\n alignment : 'left',\n valign: 'bottom',\n halign : 'center'\n }\n )\n }\n );\n\n\u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003efooter.php\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"dock\" id=\"dock2\"\u0026gt;\n \u0026lt;div class=\"dock-container2\"\u0026gt;\n \u0026lt;a class=\"dock-item2\" href=\"index.php\"\u0026gt;\u0026lt;span\u0026gt;Home\u0026lt;/span\u0026gt;\u0026lt;img src=\"images/home.png\" alt=\"home\" /\u0026gt;\u0026lt;/a\u0026gt; \n \u0026lt;a class=\"dock-item2\" href=\"about-intro.php\"\u0026gt;\u0026lt;span\u0026gt;About Us\u0026lt;/span\u0026gt;\u0026lt;img src=\"images/portfolio.png\" alt=\"contact\" /\u0026gt;\u0026lt;/a\u0026gt; \n \u0026lt;a class=\"dock-item2\" href=\"contact-us.php\"\u0026gt;\u0026lt;span\u0026gt;Contact Us\u0026lt;/span\u0026gt;\u0026lt;img src=\"images/email.png\" alt=\"portfolio\" /\u0026gt;\u0026lt;/a\u0026gt; \n \u0026lt;a class=\"dock-item2\" href=\"index.php\"\u0026gt;\u0026lt;span\u0026gt;Home\u0026lt;/span\u0026gt;\u0026lt;img src=\"images/home.png\" alt=\"home\" /\u0026gt;\u0026lt;/a\u0026gt; \n \u0026lt;a class=\"dock-item2\" href=\"about-intro.php\"\u0026gt;\u0026lt;span\u0026gt;About Us\u0026lt;/span\u0026gt;\u0026lt;img src=\"images/portfolio.png\" alt=\"contact\" /\u0026gt;\u0026lt;/a\u0026gt; \n \u0026lt;a class=\"dock-item2\" href=\"contact-us.php\"\u0026gt;\u0026lt;span\u0026gt;Contact Us\u0026lt;/span\u0026gt;\u0026lt;img src=\"images/email.png\" alt=\"portfolio\" /\u0026gt;\u0026lt;/a\u0026gt; \n\n \u0026lt;/div\u0026gt;\n\n\u0026lt;/div\u0026gt;\n\n\u0026lt;!--dock menu JS options --\u0026gt;\n\u0026lt;script type=\"text/javascript\"\u0026gt;\n //var $=jQuery.noConflict(true);\n\n $(document).ready(\n function()\n {\n $('#dock2').Fisheye(\n {\n maxWidth: 60,\n items: 'a',\n itemsText: 'span',\n container: '.dock-container2',\n itemWidth: 40,\n proximity: 80,\n alignment : 'left',\n valign: 'bottom',\n halign : 'center'\n }\n );\n }\n );\n\n\u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"6","creation_date":"2013-12-13 05:38:26.217 UTC","favorite_count":"1","last_activity_date":"2013-12-13 06:09:13.663 UTC","last_edit_date":"2013-12-13 06:09:13.663 UTC","last_editor_display_name":"","last_editor_user_id":"3020300","owner_display_name":"","owner_user_id":"3020300","post_type_id":"1","score":"2","tags":"jquery","view_count":"275"} +{"id":"43775679","title":"System.NullReferenceException: Object reference not set to an instance of an object.. what should i do?","body":"\u003cp\u003ehere is my code \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprotected void Page_Load(object sender, EventArgs e)\n{\n if (!IsPostBack)\n {\n BindData();\n }\n}\n\nprivate void BindData()\n{\n DataTable dt = new DataTable();\n string connStr = @\"Data Source=DESKTOP-IP1FFN6\\MSSQLSERVER2;Initial Catalog=OCEP2;Integrated Security=True\";\n using (SqlConnection cn = new SqlConnection(connStr))\n {\n SqlDataAdapter adp = new SqlDataAdapter(\"select * from Question_Table where QuestionId = 1 \", cn);\n adp.Fill(dt);\n\n }\n if (dt.Rows.Count \u0026gt; 0)\n {\n DataList2.DataSource = dt;\n DataList2.DataBind();\n\n }\n foreach (DataListItem dli in DataList2.Items)\n {\n RadioButtonList RadioButtonList2 = (RadioButtonList)DataList2.FindControl(\"RadioButtonList2\");\n //RadioButtonList2.Items.Clear();\n\n RadioButtonList2.Items.Insert(0, new ListItem(\"QuestionOptions\".ToString(), \"QuestionOptions\".ToString()));\n\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethen i keep geting Object reference not set to an instance of an object on \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eRadioButtonList2.Items.Insert(0, new ListItem(\"QuestionOptions\".ToString(), \"QuestionOptions\".ToString()));\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethere is table Question_Table on my database can any one help me?\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2017-05-04 06:43:38.383 UTC","last_activity_date":"2017-05-04 06:43:38.383 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7672227","post_type_id":"1","score":"0","tags":"c#|sql","view_count":"39"} +{"id":"7623254","title":"Is it possible to bypass sorting of localdata when using grouping in jqgrid?","body":"\u003cp\u003eI have client-side data (local data) always sorted, and I don't want jqgrid to re-sort the data for grouping (like server-side sorted data behaviour-- groupDataSorted = true).\u003c/p\u003e\n\n\u003cp\u003eIs it possible to bypass/disable sorting of data before grouping in jqGrid? In other words, are there any way to use groupDataSorted = true, for editurl= \"clientArray\"?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edatatype: 'local',\ndata: mydata, \nrowNum: 10,\nrowList: [10, 20,30,40],\npager: '#pager',\ngridview: true,\nsortname: 'invdate',\nviewrecords: true,\ngrouping: true,\ngroupingView: {\n groupField: ['name'],\n groupSummary: [true],\n groupColumnShow: false,\n groupText: ['\u0026lt;b\u0026gt;{0}-{1} items\u0026lt;/b\u0026gt;'],\n},\nediturl: 'clientArray'\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"2","creation_date":"2011-10-01 22:03:59.58 UTC","favorite_count":"1","last_activity_date":"2011-10-02 07:23:34.787 UTC","last_edit_date":"2011-10-02 07:23:34.787 UTC","last_editor_display_name":"","last_editor_user_id":"971508","owner_display_name":"","owner_user_id":"971508","post_type_id":"1","score":"1","tags":"jquery|jqgrid","view_count":"337"} +{"id":"28558486","title":"jquery.kyco.googleplusfeed.min.js Unminified Source code","body":"\u003cp\u003eWhere is the unminified jquery.kyco.googleplusfeed.min.js source code?\u003c/p\u003e\n\n\u003cp\u003eAll source files are minified at the \u003ca href=\"https://github.com/kyco/jquery.kyco.googleplusfeed\" rel=\"nofollow\"\u003eGitHub repo\u003c/a\u003e.\u003c/p\u003e","answer_count":"2","comment_count":"2","creation_date":"2015-02-17 09:22:31.22 UTC","last_activity_date":"2015-02-17 16:40:29.903 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1077910","post_type_id":"1","score":"1","tags":"javascript|jquery|google-plus|unminify","view_count":"77"} +{"id":"11740233","title":"Styling/ Theming Google Maps using API V3","body":"\u003cp\u003eI'm trying to style Google Maps for my website like here: \u003ca href=\"http://www.sidewalkprophets.com/shows\" rel=\"nofollow\"\u003ehttp://www.sidewalkprophets.com/shows\u003c/a\u003e\nThey only show the USA and unfortunately the site uses API V2.\u003c/p\u003e\n\n\u003cp\u003eIs the same possible using Google Maps API V3? Can someone help me?\u003c/p\u003e","accepted_answer_id":"11743896","answer_count":"1","comment_count":"1","creation_date":"2012-07-31 12:37:47.19 UTC","last_activity_date":"2012-08-01 13:16:42.98 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"976777","post_type_id":"1","score":"0","tags":"javascript|google-maps|google-maps-api-3|google-maps-api-2","view_count":"1628"} +{"id":"13067183","title":"How to prevent horizontal scrolling of text in input field with blackberry5","body":"\u003cp\u003eI am creating a html form that needs to work for users of older mobile devices. \u003c/p\u003e\n\n\u003cp\u003eThe problem I have is when using an older Blackberry device, such as a 2 year old 9300, if you use the trackpad to move to the right of the text field, then the text scrolls off to the left and becomes hidden.\u003c/p\u003e\n\n\u003cp\u003eIs there any way to prevent this behaviour, or even to realign the text after the input has lost focus?\u003c/p\u003e\n\n\u003cp\u003eThe problem is apparent even with a form as simple as this.\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003e\u0026lt;form\u0026gt;\n\u0026lt;input type=\"text\" name=\"testit\" /\u0026gt;\n\u0026lt;/form\u0026gt;\u003c/code\u003e\u003c/p\u003e","accepted_answer_id":"13071381","answer_count":"1","comment_count":"0","creation_date":"2012-10-25 11:02:31.043 UTC","last_activity_date":"2012-10-25 14:56:21.877 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1600361","post_type_id":"1","score":"1","tags":"html|forms|blackberry|input","view_count":"651"} +{"id":"22545849","title":"Android bind service with intent filter","body":"\u003cp\u003eI have two separate applications and ideally I would like to use an IntentFilter to bind to the service on the second application. Is this possible?\u003c/p\u003e\n\n\u003cp\u003eIn app 1 Manifest:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;service\n android:name=\".ServiceName\"\n android:exported=\"true\"\n android:icon=\"@drawable/ic_launcher\"\n android:label=\"Bound Service\" \u0026gt;\n \u0026lt;intent-filter\u0026gt;\n \u0026lt;action android:name=\"IntentFilterName\" /\u0026gt;\n \u0026lt;/intent-filter\u0026gt;\n \u0026lt;/service\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn app 2 Activity:\u003c/p\u003e\n\n\u003cp\u003eIt is currently : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@Override\nprotected void onResume() {\n super.onResume();\n Intent i = new Intent();\n i.setComponent(new ComponentName(\"com.test.application1\", \"com.test.application1.ServiceName\")); \n bindService(i, mConnection, Context.BIND_AUTO_CREATE);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs it possible to work like this :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@Override\nprotected void onResume() {\n super.onResume();\n IntentFilter filter1 = new IntentFilter(\"IntentFilterName\"); \n bindService(filter1, mConnection, Context.BIND_AUTO_CREATE);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI get the following error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eThe method bindService(Intent, ServiceConnection, int) in the type ContextWrapper is not applicable for the arguments (IntentFilter, ServiceConnection, int)\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"22547066","answer_count":"1","comment_count":"0","creation_date":"2014-03-20 21:47:59.037 UTC","last_activity_date":"2014-03-20 23:10:20.313 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1618363","post_type_id":"1","score":"0","tags":"android|android-intent|android-service|intentfilter","view_count":"1238"} +{"id":"913745","title":"Interfacing zlib with ActiveTcl 8.5?","body":"\u003cp\u003eI'm trying to use the zlib extension in ActiveTcl 8.5 in order to save out a compressed blob to a file. Both ActiveTcl 8.5.5 and 8.5.6 on win32 have a zlibtcl 1.2.3 extension. I've tried both:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epackage require zlibtcl\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eload zlibtcl123.dll \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhich both seem to indicate that the extension is properly loaded. However, I can't seem to figure out what command is necessary to access the extension. I am aware that ActiveTcl 8.6b1 onwards has the zlib functionality built in (\u003ca href=\"http://wiki.tcl.tk/4610\" rel=\"nofollow noreferrer\"\u003ehttp://wiki.tcl.tk/4610\u003c/a\u003e), however I need to deploy to existing systems that must use 8.5.x.\u003c/p\u003e\n\n\u003cp\u003eAs far as I can tell, loading the extension does not add any new commands to the interpreter, which is quite confusing. Running a \u003cstrong\u003estrings\u003c/strong\u003e on the dll does not seem to reveal any additional information.\u003c/p\u003e\n\n\u003cp\u003eNote: my backup plan is to SWIG zlib, but I'd prefer to use the existing extension if possible.\u003c/p\u003e","answer_count":"3","comment_count":"0","creation_date":"2009-05-27 02:58:49.97 UTC","favorite_count":"1","last_activity_date":"2010-09-17 12:19:56.437 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6034","post_type_id":"1","score":"1","tags":"tcl|zlib|activetcl","view_count":"925"} +{"id":"33729303","title":"how to make images responsive in a bootstrap template","body":"\u003cp\u003eI know this had been asked a lot and I did research and try a lot before posting this question, but nothing seems to work. I have two images and a text which I want to display all in one line. However, when I decrease my window size the images are displayed below and above the text instead of next to it. \nI have the following code and here's a \u003ca href=\"http://jsfiddle.net/hbedhdxo/\" rel=\"nofollow\"\u003efiddle\u003c/a\u003e: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"row\"\u0026gt;\n \u0026lt;div class=\"col-md-4\"\u0026gt;\n \u0026lt;img src=\"image.jpg\" class=\"images\"\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"col-md-4\"\u0026gt;\n \u0026lt;div class=\"text\"\u0026gt;\n \u0026lt;h2 class=\"featurette-heading\"\u0026gt;What's Included with HTML?\u0026lt;/h2\u0026gt;\n \u0026lt;p class=\"lead\"\u0026gt;Tags to make words. And tons of CSS properties to style your page:\u0026lt;/p\u0026gt;\n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n \u0026lt;div class=\"col-md-4\"\u0026gt;\n \u0026lt;img src=\"image.jpg\" alt=\"Chrome Browser\" class=\"images\"\u0026gt;\u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt; \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e \u003c/p\u003e\n\n\u003cp\u003eHow do I make the images resize according to the window size so that images and text are all displayed in one line?\u003c/p\u003e\n\n\u003cp\u003eI tried \u003ccode\u003ewidth:100%;height auto;\u003c/code\u003e and \u003ccode\u003emax-width:100%;\u003c/code\u003e and all sorts of combinations in order to make them responsive but it nothing worked so far. \u003c/p\u003e\n\n\u003cp\u003eThanks in advance! \u003c/p\u003e","answer_count":"4","comment_count":"0","creation_date":"2015-11-16 05:58:16.977 UTC","last_activity_date":"2015-11-16 08:35:15.29 UTC","last_edit_date":"2015-11-16 06:15:00.427 UTC","last_editor_display_name":"","last_editor_user_id":"4930607","owner_display_name":"","owner_user_id":"4930607","post_type_id":"1","score":"1","tags":"html|css|image|twitter-bootstrap","view_count":"491"} +{"id":"18316494","title":"running a java project from command line using classpath issue?","body":"\u003cp\u003eI am trying to run a java project from the command line in linux, my project uses two external jar files. The command that i am givin is\u003c/p\u003e\n\n\u003cp\u003ejava -classpath -jar bin:common-cli-1.2.jar:BuildFrameworkLibrary.jar com.kpit.goa.common.tools.kivibuild.KIVIBuild \u003c/p\u003e\n\n\u003cp\u003ewhere KIVIBuild is the class that contains the main function. But the error that am getting is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ebaibhav@baibhav:~/git/KiviBuild/Infra/RepoManagement/BuildManagement/KIVIBuild$ java -classpath bin:common-cli-1.2.jar:BuildFrameworkLibrary.jar com.kpit.goa.common.tools.kivibuild.KIVIBuild\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eGives\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eException in thread \"main\" java.lang.NoClassDefFoundError: org/apache/commons/cli/ParseException\nCaused by: java.lang.ClassNotFoundException: org.apache.commons.cli.ParseException\n at java.net.URLClassLoader$1.run(URLClassLoader.java:217)\n at java.security.AccessController.doPrivileged(Native Method)\n at java.net.URLClassLoader.findClass(URLClassLoader.java:205)\n at java.lang.ClassLoader.loadClass(ClassLoader.java:321)\n at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)\n at java.lang.ClassLoader.loadClass(ClassLoader.java:266)\nCould not find the main class: com.kpit.goa.common.tools.kivibuild.KIVIBuild. Program will exit.\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"18316618","answer_count":"2","comment_count":"2","creation_date":"2013-08-19 14:36:43.633 UTC","last_activity_date":"2013-08-19 15:36:58.14 UTC","last_edit_date":"2013-08-19 14:38:18.277 UTC","last_editor_display_name":"","last_editor_user_id":"438154","owner_display_name":"","owner_user_id":"2377460","post_type_id":"1","score":"0","tags":"java","view_count":"3434"} +{"id":"37321326","title":"Unable to analyse dictionary validate expression for field Drawing?","body":"\u003cp\u003eI got \"Unable to analyse dictionary validate expression for field Drawing. \"this error when compling below program how to resolve this?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e/*Sample Item master Maintenance Program*/ \n/* DISPLAY TITLE */ \n{us/mf/mfdtitle.i \"3+ \"} \nform\n pt_part colon 25\n with frame a side-labels width 80.\n/* SET EXTERNAL LABELS */\nsetFrameLabels(frame a:handle).\n\nform\n \"Enter the Value of\" pt__qad13 colon 30 skip(1)\n \"Enter the Value of\" pt_draw colon 30 skip(1)\n \"Enter the Value of\" pt_group colon 30\n with frame b side-labels width 80.\nsetFrameLabels(frame b:handle).\nview frame a. \nrepeat with frame a: \n prompt-for pt_part \n editing: \n /* FIND NEXT/PREVIOUS RECORD */ \n {us/mf/mfnp.i pt_mstr pt_part \"pt_mstr.pt_domain = global_domain and pt_part\" pt_part pt_part pt_part } \n if recno \u0026lt;\u0026gt; ? then \n do: \n display pt_part. \n end.\n end.\n find pt_mstr exclusive-lock where pt_domain = global_domain and pt_part = input pt_part .\n disp pt__qad13 pt_draw pt_group with frame b.\n update pt__qad13 pt_draw pt_group with frame b.\n\nend.\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"2","creation_date":"2016-05-19 11:04:39.037 UTC","last_activity_date":"2016-11-10 05:39:30.147 UTC","last_edit_date":"2016-05-20 18:58:45.43 UTC","last_editor_display_name":"","last_editor_user_id":"123238","owner_display_name":"","owner_user_id":"6314225","post_type_id":"1","score":"0","tags":"progress-4gl|openedge","view_count":"115"} +{"id":"39882085","title":"How to make HTML buttons responsive","body":"\u003cp\u003eHere is the code for a basic website I'm making. I'm doing it for a school project.\u003c/p\u003e\n\n\u003cp\u003e\u003cdiv class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\"\u003e\r\n\u003cdiv class=\"snippet-code\"\u003e\r\n\u003cpre class=\"snippet-code-css lang-css prettyprint-override\"\u003e\u003ccode\u003e.html-button {\r\n font-family: 'Hammersmith One', sans-serif;\r\n font-size: 20px;\r\n color: white;\r\n position: absolute;\r\n top: 55%;\r\n left: 45%;\r\n text-align: center;\r\n -webkit-transform: translate3d(-50%, -50%, 0);\r\n -o-transform: translate3d(-50%, -50%, 0);\r\n -webkit-border-radius: 8;\r\n border-radius: 8px;\r\n font-size: 21px;\r\n background: #42A5F6;\r\n padding: 10px 20px 10px 20px;\r\n text-decoration: none;\r\n -webkit-transition-duration: 0.7s;\r\n /* Safari */\r\n transition-duration: 0.7s;\r\n border: none;\r\n cursor: pointer;\r\n}\r\n.html-button:hover {\r\n background: #0090FF;\r\n text-decoration: none;\r\n color: black;\r\n}\r\n.css-button {\r\n font-family: 'Hammersmith One', sans-serif;\r\n font-size: 20px;\r\n color: white;\r\n position: absolute;\r\n top: 55%;\r\n left: 55.3%;\r\n text-align: center;\r\n -webkit-transform: translate3d(-50%, -50%, 0);\r\n -o-transform: translate3d(-50%, -50%, 0);\r\n -webkit-border-radius: 8;\r\n border-radius: 8px;\r\n font-size: 21px;\r\n background: #42A5F6;\r\n padding: 10px 20px 10px 20px;\r\n text-decoration: none;\r\n -webkit-transition-duration: 0.7s;\r\n /* Safari */\r\n transition-duration: 0.7s;\r\n border: none;\r\n cursor: pointer;\r\n}\r\n.css-button:hover {\r\n background: #0090FF;\r\n text-decoration: none;\r\n color: black;\r\n}\u003c/code\u003e\u003c/pre\u003e\r\n\u003cpre class=\"snippet-code-html lang-html prettyprint-override\"\u003e\u003ccode\u003e\u0026lt;button class=\"html-button\" role=\"button\"\u0026gt;VIEW HTML\u0026lt;/button\u0026gt;\r\n\u0026lt;button class=\"css-button\" role=\"button\"\u0026gt;VIEW CSS\u0026lt;/button\u0026gt;\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003c/p\u003e\n\n\u003cp\u003eThat is not my entire code, but that's the main part that I'm focusing on here. This will display 2 separate buttons (decorated with CSS), on my screen, they are the perfect length apart, however currently, when I make my browser smaller, the buttons push closer together as it gets smaller, how might I prevent this?\u003c/p\u003e","accepted_answer_id":"39882235","answer_count":"2","comment_count":"8","creation_date":"2016-10-05 19:23:01.5 UTC","last_activity_date":"2016-10-05 19:41:00.07 UTC","last_edit_date":"2016-10-05 19:26:44.84 UTC","last_editor_display_name":"","last_editor_user_id":"6496010","owner_display_name":"user6566659","post_type_id":"1","score":"0","tags":"html|css","view_count":"102"} +{"id":"8994060","title":"google app engine get_serving_url() is not defined","body":"\u003cp\u003eIt seems like an easy problem yet I cant figure it out:\u003c/p\u003e\n\n\u003cp\u003eI call \u003ccode\u003eget_serving_url()\u003c/code\u003e function in my code and get en error:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eNameError: global name 'get_serving_url' is not defined\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003emy import statement currently looks like:\nfrom google.appengine.api import images\u003c/p\u003e\n\n\u003cp\u003ebefore i tried various \"from PIL import Image\" and got import errors.\ni recently installed the PIL library\u003c/p\u003e\n\n\u003cp\u003eI have site-packages and PIL folder on my python path\u003c/p\u003e\n\n\u003cp\u003ehow do I make \u003ccode\u003eget_serving_url()\u003c/code\u003e work?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2012-01-24 20:58:45.01 UTC","last_activity_date":"2012-01-24 21:09:25.59 UTC","last_edit_date":"2012-01-24 21:04:09.47 UTC","last_editor_display_name":"","last_editor_user_id":"1101070","owner_display_name":"","owner_user_id":"1167937","post_type_id":"1","score":"1","tags":"python|google-app-engine|import|python-imaging-library","view_count":"600"} +{"id":"40575322","title":"Which defaulted methods are needed in purely abstract base classes?","body":"\u003cp\u003eAs Scott Meyers points out in \"Effective Modern C++\", no move constructor is generated if a class defines a destructor.\u003c/p\u003e\n\n\u003cp\u003eIt is not clear to me what that means for abstract base classes, which need to define a (defaulted) virtual destructor.\u003c/p\u003e\n\n\u003cp\u003eI do not want the lack of auto-generated methods in my base class to prevent the auto-generation of methods in any derived class.\u003c/p\u003e\n\n\u003cp\u003eThe focus is only on derived classes, since the abstract base class does not have any data members, so there is no difference between moving and copying the base class. Yet what does it mean for a derived class if its base can only be copied, but not moved?\u003c/p\u003e\n\n\u003cp\u003eWhich lines in the following class definition are unnecessary?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003estruct AbstractBase {\n AbstractBase () = default;\n AbstractBase (AbstractBase const \u0026amp;) = default;\n AbstractBase (AbstractBase \u0026amp;\u0026amp;) = default;\n AbstractBase \u0026amp; operator = (AbstractBase const \u0026amp;) = default;\n AbstractBase \u0026amp; operator = (AbstractBase \u0026amp;\u0026amp;) = default;\n virtual ~AbstractBase () = default;\n\n virtual void f () = 0;\n};\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"2","creation_date":"2016-11-13 15:09:37.513 UTC","last_activity_date":"2016-11-13 15:09:37.513 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1419315","post_type_id":"1","score":"0","tags":"c++|abstract-class","view_count":"27"} +{"id":"39143682","title":"Google Analytics Reporting API (Python) - How can I obtain previous and next page path?","body":"\u003cp\u003eUsing the google analytics portal, i can check the previous and next page path for a given path (for an example, see below) [ Behavior \u003e Site Content \u003e All Pages \u003e Navigation Summary)\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/7Gxx4.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/7Gxx4.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eHow can I access path of all pages, and then for each of these pages the previous and next pages path via the API?\nThe API supports ga:previousPagePath, but nextPagePath is deprecated.\u003c/p\u003e\n\n\u003cp\u003eHere is a snippet of my source code (python).\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eDIMENSIONS =['ga:date','ga:hour', 'ga:minute', ??, ??]\nMETRICS =['ga:pageviews','ga:uniquePageviews', 'ga:sessions', 'ga:avgTimeOnPage']\n\ndef get_api_traffic_query(service):\n start ='2016-08-24'\n end = '2016-08-24'\n metrics =','.join(map(str, METRICS))\n dimensions =','.join(map(str, DIMENSIONS))\n start_index = '1'\nsegment='sessions::condition::ga:hostname!~mongo|app|help|docs|staging|googleweblight',\n return service.data().ga().get(ids=PROFILE_ID,start_date=start,end_date=end,metrics=metrics,dimensions=dimensions,\n start_index=start_index)\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"39151871","answer_count":"1","comment_count":"1","creation_date":"2016-08-25 11:09:28.153 UTC","last_activity_date":"2016-08-25 17:56:40.67 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3573626","post_type_id":"1","score":"0","tags":"python|navigation|google-analytics-api","view_count":"140"} +{"id":"13215438","title":"Issue with trigger delimiters","body":"\u003cp\u003eI'm running into a problem with creating a trigger on a table using MySQL and phpmyadmin v3.4.5. After some research, it seems like this is a common problem, but none of the fixes I've found are working for me. The error I'm getting is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'END' at line 8\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe query I'm trying to run is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e CREATE TRIGGER book_insert\n AFTER INSERT ON `books`\n FOR EACH ROW BEGIN\n INSERT INTO products\n (ProductID,Type,Title,Price) \n VALUES \n (books.ProductID,0,books.Title,0)\n END\n //\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI've set the delimiter to // in the text below the query input as I've read that PHPMyAdmin doesn't like you using the delimiter keyword in the query. I've also played around with the placement of the delimiter, having no spaces between END and '//', having one space, and trying it on a different line. I've also tried different delimiters like the default semicolon, 2 dollar signs, and 2 pound signs. This seems like its something really small and stupid, but I can't figure out what it doesn't like about that statement.\u003c/p\u003e","accepted_answer_id":"13216410","answer_count":"2","comment_count":"0","creation_date":"2012-11-04 02:17:54.373 UTC","last_activity_date":"2012-11-04 05:52:15.863 UTC","last_edit_date":"2012-11-04 02:22:34.687 UTC","last_editor_display_name":"","last_editor_user_id":"1090079","owner_display_name":"","owner_user_id":"549212","post_type_id":"1","score":"0","tags":"mysql|triggers","view_count":"345"} +{"id":"38625233","title":"what does 'key, ok := k.(*dns.A)' mean in Go?","body":"\u003cp\u003eI am pretty new to Go and trying to write a DNS server by using package \u003ca href=\"https://github.com/miekg/dns\" rel=\"nofollow\"\u003e miekg DNS\u003c/a\u003e. According its \u003ca href=\"https://godoc.org/github.com/miekg/dns#example-DS\" rel=\"nofollow\"\u003eexample\u003c/a\u003e, I copy \u0026amp; pasted a simple snippet to perform A record request:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epackage main\n\nimport \"fmt\"\nimport \"github.com/miekg/dns\"\n\nfunc main() {\n config, _ := dns.ClientConfigFromFile(\"/etc/resolv.conf\")\n c := new(dns.Client)\n m := new(dns.Msg)\n zone := \"miek.nl\"\n m.SetQuestion(dns.Fqdn(zone), dns.TypeA)\n m.SetEdns0(4096, true)\n r, _, err := c.Exchange(m, config.Servers[0]+\":\"+config.Port)\n if err != nil {\n return\n }\n if r.Rcode != dns.RcodeSuccess {\n return\n }\n _ = \"breakpoint\"\n for _, k := range r.Answer {\n if key, ok := k.(*dns.A); ok {\n fmt.Printf(\"%+v\\n\", key)\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eLoading by godebug, stopped at \u003ccode\u003e_ = \"breakpoint\"\u003c/code\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e./godebug run ~/aRequest.go -d /usr/local/go/\n-\u0026gt; _ = \"breakpoint\"\n(godebug) p r.Answer\n[]dns.RR{(*dns.A)(0xc8200120c0)}\n(godebug) n\n-\u0026gt; for _, k := range r.Answer {\n(godebug) n\n-\u0026gt; if key, ok := k.(*dns.A); ok {\n(godebug) p k\n\u0026amp;dns.A{Hdr:dns.RR_Header{Name:\"miek.nl.\", Rrtype:0x1, Class:0x1, Ttl:0x708, Rdlength:0x4}, A:net.IP{0x8b, 0xa2, 0xc4, 0x4e}}\n(godebug) n\n-\u0026gt; fmt.Printf(\"%+v\\n\", key)\n(godebug) p key \n\u0026amp;dns.A{Hdr:dns.RR_Header{Name:\"miek.nl.\", Rrtype:0x1, Class:0x1, Ttl:0x708, Rdlength:0x4}, A:net.IP{0x8b, 0xa2, 0xc4, 0x4e}}\n(godebug) p ok\ntrue\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAccording godebug, \u003ccode\u003eok == true\u003c/code\u003e and \u003ccode\u003ekey\u003c/code\u003e seemed same as \u003ccode\u003ek\u003c/code\u003e. How could \u003ccode\u003ek.(*dns.A)\u003c/code\u003e return two variables? \u003c/p\u003e","accepted_answer_id":"38625279","answer_count":"1","comment_count":"0","creation_date":"2016-07-28 00:23:04.453 UTC","last_activity_date":"2016-07-28 00:29:36.17 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1138781","post_type_id":"1","score":"0","tags":"go|syntax","view_count":"68"} +{"id":"38910067","title":"How can I set margin for div inside column div in bootstrap","body":"\u003cp\u003eHow can I set margin for div inside column div in bootstrap, like in the code I am trying to make margin 5px but it doesnt work!\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"container bg_red\"\u0026gt; \n \u0026lt;h1\u0026gt;Test DIV boxes\u0026lt;/h1\u0026gt;\n \u0026lt;div class=\"row\"\u0026gt;\n \u0026lt;div class=\"col-md-3 thin_border bg_green\"\u0026gt;\n \u0026lt;div class=\"bg_blue\"\u0026gt;\n Some content here for panel 1 \n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"col-md-9 thin_border\"\u0026gt;\n Some content here for panel 2\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt; \n \u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"38910116","answer_count":"1","comment_count":"0","creation_date":"2016-08-12 04:41:29.55 UTC","last_activity_date":"2016-08-12 05:29:40.06 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1479989","post_type_id":"1","score":"0","tags":"html|css|html5|twitter-bootstrap","view_count":"119"} +{"id":"9065141","title":"Pass authenticated user from sharepoint to asp mvc application","body":"\u003cp\u003eI have made asp.net mvc application that have custom forms authentication. \nBeside that it needs to authenticate user from sharepoint (in other words I need to pass user from sharepoint to asp mvc application). SP and asp mvc app are in the same domain and SP is using AD to authenticate user. I have searched google/so and so far I haven`t got any good solution.\u003c/p\u003e\n\n\u003cp\u003eNote: I need secure way of passing user from sp to asp mvc application ... I saw few examples that pass user thought URL parameter and I think that this is not secure thing to do.\u003c/p\u003e","answer_count":"2","comment_count":"4","creation_date":"2012-01-30 14:11:56.51 UTC","favorite_count":"1","last_activity_date":"2012-01-30 14:56:47.677 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"497177","post_type_id":"1","score":"0","tags":"asp.net-mvc|asp.net-mvc-3|sharepoint|asp.net-mvc-2|sharepoint-2010","view_count":"1118"} +{"id":"951856","title":"Is there an easy way to check the .NET Framework version?","body":"\u003cp\u003eThe problem is that I need to know if it's version 3.5 SP 1. \u003ccode\u003eEnvironment.Version()\u003c/code\u003e only returns \u003ccode\u003e2.0.50727.3053\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eI found \u003ca href=\"http://blogs.msdn.com/astebner/archive/2006/08/02/687233.aspx\" rel=\"noreferrer\"\u003ethis solution\u003c/a\u003e, but I think it will take much more time than it's worth, so I'm looking for a simpler one. Is it possible?\u003c/p\u003e","accepted_answer_id":"951915","answer_count":"17","comment_count":"9","creation_date":"2009-06-04 17:06:24.923 UTC","favorite_count":"15","last_activity_date":"2017-11-02 16:56:56.237 UTC","last_edit_date":"2014-11-20 10:02:12.683 UTC","last_editor_display_name":"","last_editor_user_id":"63550","owner_display_name":"","owner_user_id":"62642","post_type_id":"1","score":"62","tags":"c#|.net","view_count":"61118"} +{"id":"44388464","title":"Program throwing OperationCanceledException despite catching it","body":"\u003cp\u003eI'm trying to use Tokens to cancel Task started by Task.Run. I took pattern from microsoft site: \u003ca href=\"https://msdn.microsoft.com/pl-pl/library/hh160373(v=vs.110).aspx\" rel=\"nofollow noreferrer\"\u003ehttps://msdn.microsoft.com/pl-pl/library/hh160373(v=vs.110).aspx\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThis is my code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic static class Sender\n{\n\n public static async Task sendData(NetworkController nc) {\n await Task.Run(() =\u0026gt; {\n IPEndPoint endPoint = new IPEndPoint(nc.serverIp, nc.dataPort);\n byte[] end = Encoding.ASCII.GetBytes(\"end\");\n while (true) {\n if (Painting.pointsQueue.Count \u0026gt; 0 \u0026amp;\u0026amp; !nc.paintingSenderToken.IsCancellationRequested) {\n\n byte[] sendbuf = Encoding.ASCII.GetBytes(Painting.color.ToString());\n nc.socket.SendTo(sendbuf, endPoint);\n\n do {\n sendbuf = Painting.pointsQueue.Take();\n nc.socket.SendTo(sendbuf, endPoint);\n } while (sendbuf != end \u0026amp;\u0026amp; !nc.paintingSenderToken.IsCancellationRequested);\n\n }\n else if (nc.paintingSenderToken.IsCancellationRequested) {\n nc.paintingSenderToken.ThrowIfCancellationRequested();\n return;\n }\n }\n }, nc.paintingSenderToken);\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd here I start this task:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public void stopController() {\n try {\n paintingSenderTokenSource.Cancel();\n senderTask.Wait();\n } catch(AggregateException e) {\n string message = \"\";\n foreach (var ie in e.InnerExceptions)\n message += ie.GetType().Name + \": \" + ie.Message + \"\\n\";\n MessageBox.Show(message, \"Przerwano wysylanie\");\n }\n finally {\n paintingSenderTokenSource.Dispose();\n byte[] message = Encoding.ASCII.GetBytes(\"disconnect\");\n IPEndPoint endPoint = new IPEndPoint(serverIp, serverPort);\n socket.SendTo(message, endPoint);\n socket.Close();\n mw.setStatus(\"disconnected\");\n }\n\n }\n\n public async void initialize() {\n Task t = Reciver.waitForRespond(this);\n sendMessage(\"connect\");\n mw.setStatus(\"connecting\");\n if (await Task.WhenAny(t, Task.Delay(5000)) == t) {\n mw.setStatus(\"connected\");\n Painting.pointsQueue = new System.Collections.Concurrent.BlockingCollection\u0026lt;byte[]\u0026gt;();\n senderTask = Sender.sendData(this);\n }\n else {\n mw.setStatus(\"failed\");\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn \u003ccode\u003einitialize()\u003c/code\u003e method I'm waiting for the response from the server and if I get it I start new thread in this \u003ccode\u003esendData()\u003c/code\u003e method. It is in static class to make code cleaner. If I want to stop this thread I call \u003ccode\u003estopController()\u003c/code\u003e method. In microsoft site we can read:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eThe CancellationToken.ThrowIfCancellationRequested method throws an OperationCanceledException exception that is handled in a catch block when the calling thread calls the Task.Wait method.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eBut my program breaks on\u003ccode\u003enc.paintingSenderToken.ThrowIfCancellationRequested();\u003c/code\u003e which is in 'sendData()' method and the error says that OperationCanceledException was not handled. I started program from microsoft site and it works perfectly. I think I'm doing everything like they did but unfortunately it doesnt't work like it should.\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2017-06-06 11:11:34.053 UTC","last_activity_date":"2017-06-06 11:24:31.387 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7159213","post_type_id":"1","score":"0","tags":"c#|wpf|multithreading|exception-handling","view_count":"42"} +{"id":"44146084","title":"datatables json input multiple tables single page","body":"\u003cp\u003eI originally built this script for another use case - with CSVs. That project is no longer around and now I need to update it so datatables takes the input from multiple json files rather than CSVs. \u003c/p\u003e\n\n\u003cp\u003eThe goal is to have an html document when i click on a link in a particular menu it will then render a table based on the link clicked. \u003c/p\u003e\n\n\u003cp\u003ePart 1 - Original Use case - input from CSV. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(document).ready(function() {\nvar descriptions = {\n\"clusterconf.csv\": \n\"\u0026lt;h3\u0026gt; Description \u0026lt;/h3\u0026gt; \u0026lt;p\u0026gt;Some Information here that will be presented on the webpage on refresh.\u0026lt;/p\u0026gt;\"\n }\n $('.nav .dropdown-menu a').click(function(event) {\n event.preventDefault();\n location.hash = $(this).attr('href');\n var description = descriptions[$(this).attr('href')];\n $('#description').html(description);\n init_table({\n csv_path: '../output/' + $(this).attr('href'),\n element: 'table-container',\n allow_download: true,\n csv_options: {\n separator: ',',\n delimiter: '\"'\n },\n datatables_options: {\n \"paging\": true,\n \"deferRender\": true,\n \"searching\": true\n }\n });\n });\n if (window.location.hash) {\n $('a[href=\"' + window.location.hash.substring(1) + '\"]').click();\n }\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ePart 1.b - The HTML Menu I used originally- \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;li\u0026gt;\u0026lt;a href=\"clusterconf.csv\"\u0026gt;ClusterConf\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n\u0026lt;li\u0026gt;\u0026lt;a href=\"Other1.csv\"\u0026gt;Other1\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n\u0026lt;li\u0026gt;\u0026lt;a href=\"Other2.csv\"\u0026gt;Other2\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n\u0026lt;li\u0026gt;\u0026lt;a href=\"Other3.csv\"\u0026gt;Other3\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n\u0026lt;li\u0026gt;\u0026lt;a href=\"Other4.csv\"\u0026gt;Other4\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat this would do is present the datatables and then as the menu items were clicked it would load that CSV associated with it. \u003c/p\u003e\n\n\u003cp\u003eWhere I am struggling and trying to figure out how to do is modify this so it leverages AJAX input and json files instead of the CSVs. I was able to get the AJAX working on a very generic test. \u003c/p\u003e\n\n\u003cp\u003eAjax working properly: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(document).ready(function() {\n$('#example').DataTable( {\n responsive: true,\n select: {items: 'column'},\n \"ajax\": {\n \"url\": \"/output/current/clusterconf.json\",\n \"dataSrc\": \"\"\n },\n \"columns\": [\n { \"data\": \"SomeData\"},\n { \"data\": \"Cluster\"},\n { \"data\": \"Name\"},\n { \"data\": \"Version\"},\n { \"data\": \"Build\"},\n { \"data\": \"SomeData6\"},\n { \"data\": \"SomeData7\"},\n { \"data\": \"SomeData3\"},\n { \"data\": \"SomeData2\"},\n { \"data\": \"NumCapacity\"},\n { \"data\": \"SomeData4\"},\n { \"data\": \"SomeData5\"}\n ]\n} );\n} ); \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf it is relevant here are the js files i was leveraging before.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ejquery/1.11.2/jquery.min.js\nbootstrap.min.js\njquery.csv.min.js\njquery.dataTables.min.js\ndataTables.bootstrap.js\ncsv_to_html_table.js\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eany help would be greatly appreciated. \u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-05-23 22:30:59.483 UTC","last_activity_date":"2017-05-23 22:30:59.483 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5992247","post_type_id":"1","score":"0","tags":"javascript|jquery|json|ajax|datatables","view_count":"48"} +{"id":"47312234","title":"How to get full command from Eclipse external tool configuration","body":"\u003cp\u003eSo I've been hit \u003ca href=\"https://stackoverflow.com/a/46990633/546060\"\u003eby an Eclipse bug\u003c/a\u003e. \\o/\u003c/p\u003e\n\n\u003cp\u003eLong story short, either I've got to install an old Eclipse and set up a bunch of workspaces from scratch (a laborious process that'll take half a day at least) or I can run a few specific ant commands manually. However I can't seem to find a way to extract the full command from a specific external tool configuration.\u003c/p\u003e\n\n\u003cp\u003eAny ideas? Or will I have to build the commands manually (a few properties, a custom ANT_HOME and alternative JRE make them a bit lengthy).\u003c/p\u003e","accepted_answer_id":"47455355","answer_count":"1","comment_count":"4","creation_date":"2017-11-15 16:12:09.053 UTC","last_activity_date":"2017-11-23 12:14:03.44 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"546060","post_type_id":"1","score":"0","tags":"java|eclipse|ant","view_count":"20"} +{"id":"3946055","title":"Python to C++ function conversion using Boost.Python","body":"\u003cp\u003eI have a bunch of classes and APIs written in C++ and exposed to Python with help of Boost.Python\u003c/p\u003e\n\n\u003cp\u003eI am currently investigating the possibilities of creating the following architecture. \u003cbr/\u003e\nIn python:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efrom boostPythonModule import *\nAddFunction( boostPythonObject.Method1, args )\nAddFunction( boostPythonObject.Method2, args )\nAddFunction( boostPythonObject.Method2, args )\nRunAll( ) # running is done by C++\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn C++:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evoid AddFunction( boost::object method, boost::object args )\n{\n /// 1. Here i need to extract a real pointer to a function\n /// 2. Make argument and type checking for a function under method\n /// 3. Unpack all arguments to native types\n /// 4. Store the pointer to a function somewhere in local storage\n}\n\nvoid RunAll( )\n{\n /// 1. run all previously stored functions and arguments for them\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBasically I am trying to put all functions down to the native part of my program.\nThe thing is that I am not sure if it's possible to extract all required data from Boost metainfo to do this in generic way - at compile time I should not know what functions I'm gonna call and what arguments they accept.\u003c/p\u003e\n\n\u003cp\u003eFew questions:\u003cbr/\u003e\n1. Is there any shared Python info tables I can access to check for some of this stuff ?\u003cbr/\u003e\n2. Boost.Python does type arguments checking. Can it be reused separately ?\u003cbr/\u003e\u003c/p\u003e\n\n\u003cp\u003eLet me know your thoughts.\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","answer_count":"1","comment_count":"4","creation_date":"2010-10-15 20:54:53.24 UTC","favorite_count":"2","last_activity_date":"2011-04-07 13:12:49.887 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"477464","post_type_id":"1","score":"8","tags":"c++|python|boost-python","view_count":"948"} +{"id":"37707342","title":"Python- Most efficient way to return batches of numbers","body":"\u003cp\u003e\u003cstrong\u003eBackground\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI am working on some REST JSON calls via python to get a list of users. Unfortunately, the server can only return a maximum number of 50 users at a time.\ne.g.\u003c/p\u003e\n\n\u003cp\u003ecall \"[0:49]\" returns the first 50 users\u003c/p\u003e\n\n\u003cp\u003ecall \"[51:99]\" returns the next batch of 50 users\u003c/p\u003e\n\n\u003cp\u003eThe server does return the total number of users therefore, i am able to write some logic to get all users with multiple rest calls.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eProblem\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI have written a very messy function that prints the data in a dictionary format:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e def get_all_possible_items(max_no_users):\n dict={}\n base=0\n values=max_no_users//50\n if max_no_users\u0026gt;49:\n dict[base]=base+49\n base+=49\n else:\n base-=1\n for i in range(values-1):\n base+=1\n dict[base]=base+49\n base+=49\n dict[base+1]=max_no_users\n\n print dict\n\n get_all_possible_items(350)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe output looks like:\u003c/p\u003e\n\n\u003cp\u003eIf max_no_users is 350:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e{0: 49, 100: 149, 200: 249, 300: 349, 50: 99, 150: 199, 250: 299, 350: 350}\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eif max_no_users is 351:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e{0: 49, 100: 149, 200: 249, 300: 349, 50: 99, 150: 199, 250: 299, 350: 351}\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eIs there a better way of writing this (there must be!)?\u003c/p\u003e","accepted_answer_id":"37707587","answer_count":"2","comment_count":"1","creation_date":"2016-06-08 15:53:23.5 UTC","last_activity_date":"2016-06-09 13:09:10.6 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2141691","post_type_id":"1","score":"-1","tags":"python|dictionary|numbers|logic","view_count":"44"} +{"id":"43630741","title":"where to save the checkpoint while training the neural network","body":"\u003cp\u003eIn the example below I train the data x amount of times based on the value of \u003ccode\u003eiterations\u003c/code\u003e. At first I saved a checkpoint every iteration, but when I place it just below the iterations the training becomes much faster obviously. I'm not really sure if it makes a difference. Is one save in the session enough? And will the iterations use the values(weights) set in the previous iteration?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef train():\n\"\"\"Trains the neural network \n:returns: 0 for now. Why? 42\n\"\"\"\n\nunique_labels, labels = get_labels(training_data_file, savelabels=True) # get the labels from the training data\nrandomize_output(unique_labels) # create the correct amount of output neurons\n\nprediction = neural_network_model(p_inputdata)\n\ncost = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(logits=prediction, labels=p_known_labels)) # calculates the difference between the known labels and the results\noptimizer = tf.train.AdamOptimizer(learning_rate=learning_rate).minimize(cost)\nwith tf.Session() as sess:\n sess.run(tf.initialize_all_variables()) # initialize all variables **in** the session\n with open(training_data_file, \"r\") as file:\n inputdata = [re.split(csvseperatorRE, line.rstrip(\"\\n\"))[:-1] for line in file]\n if path.isfile(temp_dir + \"\\\\\" + label + \".ckpt.index\"):\n saver.restore(sess, temp_dir + \"\\\\\" + label + \".ckpt\")\n for i in range(iterations):\n _, cost_of_iteration = sess.run([optimizer,cost], feed_dict={\n p_inputdata: np.array(inputdata),\n p_known_labels: np.array(labels)\n })\n saver.save(sess, temp_dir + \"\\\\\" + label + \".ckpt\")\n correct = tf.equal(tf.argmax(prediction, 1), tf.argmax(tf.argmax(p_known_labels, 1)))\n\n accuracy = tf.reduce_mean(tf.cast(correct, 'float'))\n\n with open(verify_data_file, \"r\") as file:\n verifydata = [re.split(csvseperatorRE, line.rstrip(\"\\n\"))[:-1] for line in file]\n\n npverifydata = np.array(verifydata )\n nplabels = np.array(get_labels(verify_data_file)[1])\n print(\"Accuracy: \", accuracy.eval({p_inputdata: npverifydata , p_known_labels: nplabels}))\nreturn 0\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-04-26 09:52:14.917 UTC","last_activity_date":"2017-04-26 09:52:14.917 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1829401","post_type_id":"1","score":"1","tags":"python|tensorflow|neural-network","view_count":"57"} +{"id":"918553","title":"Speed and XML Parsing in .NET - Serialization vs XML DOM vs?","body":"\u003cp\u003eI have done XML parsing before but never on a massive scale.\nIf I'm working with many documents similar to this format:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" ?\u0026gt;\n\u0026lt;items comment=\"something...\"\u0026gt;\n \u0026lt;uid\u0026gt;6523453\u0026lt;/uid\u0026gt;\n \u0026lt;uid\u0026gt;94593453\u0026lt;/uid\u0026gt;\n\u0026lt;/items\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat is the fastest way to parse these documents?\u003cbr\u003e\n1) XML DOM\u003cbr\u003e\n2) XML Serialize - Rehydrate to a .NET Object\u003cbr\u003e\n3) Some other method \u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eUPDATE\u003c/strong\u003e\u003cbr\u003e\nI forgot to mention that there would be approx 8000 uid elements on average.\u003c/p\u003e","accepted_answer_id":"918569","answer_count":"3","comment_count":"0","creation_date":"2009-05-27 23:50:16.467 UTC","last_activity_date":"2009-08-30 00:20:54.86 UTC","last_edit_date":"2009-05-28 19:16:13.48 UTC","last_editor_display_name":"","last_editor_user_id":"36590","owner_display_name":"","owner_user_id":"36590","post_type_id":"1","score":"2","tags":".net|xml|dom|parsing|xml-parsing","view_count":"2117"} +{"id":"34061515","title":"How std::enable_shared_from_this::shared_from_this works","body":"\u003cp\u003eI just cannot understand how \u003ccode\u003estd::enable_shared_from_this::shared_from_this\u003c/code\u003e returns a shared pinter that shared ownership with existing pointer. In other words you do \u003ca href=\"http://en.cppreference.com/w/cpp/memory/enable_shared_from_this/shared_from_this\" rel=\"nofollow\"\u003ethis\u003c/a\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003estd::shared_ptr\u0026lt;Foo\u0026gt; getFoo() { return shared_from_this(); }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo when you call \u003ccode\u003egetFoo\u003c/code\u003e how does exactly it get what is the other \u003ccode\u003eshared_ptr\u003c/code\u003e to share the ownership with and not to create a separate \u003ccode\u003eshared_ptr\u003c/code\u003e that owns the same \u003ccode\u003ethis\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eI need to understand this to be able to understand how to create shared_ptr from some object that all increase the same ref count and not initialize separate \u003ccode\u003eshared_ptr\u003c/code\u003es.\u003c/p\u003e","accepted_answer_id":"34062114","answer_count":"1","comment_count":"3","creation_date":"2015-12-03 08:53:33.983 UTC","favorite_count":"2","last_activity_date":"2015-12-09 18:32:52.077 UTC","last_edit_date":"2015-12-09 18:32:52.077 UTC","last_editor_display_name":"","last_editor_user_id":"163394","owner_display_name":"","owner_user_id":"163394","post_type_id":"1","score":"8","tags":"c++|c++11|shared-ptr","view_count":"1093"} +{"id":"14869087","title":"Setting up dependency lib for android project","body":"\u003cp\u003eI'm very new to android and also to android. \u003c/p\u003e\n\n\u003cp\u003eI wish to do build my project if I do \u003ccode\u003eant release\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eI'm getting an error like due to the fact that my dependency lib aren't added to path.\u003c/p\u003e\n\n\u003cp\u003eBut when I add :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eandroid.library.reference.1=lib/android-support-v4.jar\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003elike this \u003ccode\u003elocal.properties\u003c/code\u003e I get an error like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e lib/android-support-v4.jar resolve to a path with no project.properties file for project /home/ubuntu/test\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhere I'm making the mistake. Thanks in advance.\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2013-02-14 06:36:43.86 UTC","last_activity_date":"2013-02-14 06:49:52.133 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1500898","post_type_id":"1","score":"1","tags":"android|ant|build|dependencies","view_count":"83"} +{"id":"9788392","title":"Build social graph of friends","body":"\u003cp\u003eI need in my application to build a social graph of friends for each user.\nLike it is doing the facebook app \"Social Graph\":\n\u003ca href=\"http://apps.facebook.com/126547340780835/\" rel=\"nofollow\"\u003eApp URL\u003c/a\u003e.\nAs I have seen there is no way to extract the friends of friends besides they are also using the application. So what I was thinking about is to extract the friends and for each pair of friends I can check with friends.areFriends whether they are friends and so build the social graph.\nBut for a user with 300 friends, I need 45.150 API calls. Which exceeds the API call limit per hour.\nSo is there a way to cast more queries in an API request. Or any suggestions how I can build this social graph in a better way??\u003c/p\u003e\n\n\u003cp\u003ebest regards\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2012-03-20 14:05:40.593 UTC","favorite_count":"0","last_activity_date":"2012-03-21 10:55:18.807 UTC","last_edit_date":"2012-03-21 10:55:18.807 UTC","last_editor_display_name":"","last_editor_user_id":"838912","owner_display_name":"","owner_user_id":"1281080","post_type_id":"1","score":"1","tags":"facebook|facebook-graph-api","view_count":"936"} +{"id":"4550077","title":"How to Load an Image on the iPhone","body":"\u003cp\u003eI am using a UIImagePickerController, and once an image is selected, I save it to a PNG. But for some reason, I can't load the saved image.\u003c/p\u003e\n\n\u003cp\u003eHere is my code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {\n //\n// Create a PNG representation of the edited image\n//\nUIImage *anImage = [info valueForKey:UIImagePickerControllerEditedImage];\nNSData *imageData = UIImagePNGRepresentation(anImage);\n\n//\n// Save the image to the documents directory\n//\nNSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);\nNSString *documentsDirectory = [paths objectAtIndex:0];\n\n// Get a unique filename for the file\nCFUUIDRef theUUID = CFUUIDCreate(NULL);\nCFStringRef string = CFUUIDCreateString(NULL, theUUID);\nCFRelease(theUUID);\nNSString *fileName = [(NSString *)string autorelease];\nfileName = [NSString stringWithFormat:@\"images/%@\", fileName];\nfileName = [fileName stringByAppendingString:@\".png\"];\n\nNSString *path = [documentsDirectory stringByAppendingPathComponent:[NSString stringWithString:fileName] ];\n[imageData writeToFile:path atomically:YES];\nNSLog(@\"Wrote the imageData to a file at path: %@\", path);\n\n// TEST TO SEE IF THE FILE WAS WRITTEN CORRECTLY\nUIImage *testImage = [UIImage imageWithContentsOfFile:path];\nNSLog(@\"testImage is %@\", testImage);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd here is my debugger output:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e2010-12-28 16:29:08.676 Appster[6656:207] The imagePath is defined as: images/7ADB104E-DA45-4EE9-88DA-FF71B8D730CA.png\n2010-12-28 16:29:08.712 Appster[6656:207] Wrote the imageData to a file at path: /Users/bschiff/Library/Application Support/iPhone Simulator/4.2/Applications/9F6FC2C7-9369-438C-AF8F-D5D25C72D8D7/Documents/images/FC94AA93-02EC-492A-A8FE-7D0C76E2C085.png\n2010-12-28 16:29:08.715 Appster[6656:207] testImage is (null)\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2010-12-28 22:34:25.413 UTC","last_activity_date":"2011-03-06 18:07:40.533 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"545352","post_type_id":"1","score":"0","tags":"iphone|cocoa-touch","view_count":"343"} +{"id":"35210132","title":"Python, True/False, integrate function into program","body":"\u003cp\u003eI'm relatively new to python. I want to make a program that checks if a date is valid or not. I wrote the function code to check for leap years so far. But I want to integrate into the bigger program that checks for the validity of the month and date as well. How can I say in the last line \"when C is true continue with a certain if else logic (...code that I will write later)\" and \"when C is false continue with this other if else logic\"\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef leap_year(c):\n\n if c % 4 == 0 and y % 100 != 0:\n print(\"True (Non-Centurial)\")\n else:\n if c % 400 == 0:\n print(\"True (Centurial)\")\n else:\n print(\"False\")\n pass\n\n\n\n for c == True:\n\n ...(my if else statements)\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"35210594","answer_count":"2","comment_count":"0","creation_date":"2016-02-04 19:41:47.757 UTC","last_activity_date":"2016-02-04 20:06:41.687 UTC","last_edit_date":"2016-02-04 19:43:11.607 UTC","last_editor_display_name":"","last_editor_user_id":"476496","owner_display_name":"","owner_user_id":"5884824","post_type_id":"1","score":"1","tags":"python|boolean","view_count":"69"} +{"id":"25750906","title":"Events in first week rendering close to the top in FulCalendar","body":"\u003cp\u003eI'm seeing a strange issue with a FullCalendar calendar I created on our Intranet. Events on the first week are rendering very close to the top of the day, while all subsequent weeks, the event displays below the day number. \u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/VUMiR.png\" alt=\"FullCalendar Screenshot\"\u003e\u003c/p\u003e\n\n\u003cp\u003eI don't know how to set up the CSS because the containing division is being positioned via tag attributes.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"fc-event fc-event-hori fc-event-start fc-event-end Veterans\"\n style=\"position: absolute; left: 407px; width: 96px; top: 19px;\"\u0026gt;\n\n \u0026lt;div class=\"fc-event-inner\"\u0026gt;\n \u0026lt;span class=\"fc-event-time\"\u0026gt;12a\u0026lt;/span\u0026gt;\n \u0026lt;span class=\"fc-event-title\"\u0026gt;Companywide Toiletry Drive for\n Homeless Veterans\u0026lt;/span\u0026gt;\n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have tried setting css to clear both\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ediv.fc-day-content {\n clear:both;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut that hasn't worked. I'm hesitant to put any margins on the fc-event div because that would affect all events, not just the top level ones. Does anyone have an idea how to align the events correctly?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-09-09 17:50:31.65 UTC","last_activity_date":"2014-09-10 16:51:42.307 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1072830","post_type_id":"1","score":"0","tags":"javascript|jquery|css|fullcalendar","view_count":"125"} +{"id":"43661466","title":"How to select multiple item from list with related condition","body":"\u003cp\u003eSo I have a class:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class Timing\n{\n public int Id { get; set; }\n public double Duration { get; set; }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd a list of the Timing class:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eList\u0026lt;Timing\u0026gt; times = GetTimings();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo I want to select \u003ccode\u003et1\u003c/code\u003e and \u003ccode\u003et2\u003c/code\u003e from \u003ccode\u003etimes\u003c/code\u003e where \u003ccode\u003et1.Duration + t2.Duration == 20;\u003c/code\u003e How could I select both items together with this condition? any idea?\u003c/p\u003e","accepted_answer_id":"43661576","answer_count":"2","comment_count":"6","creation_date":"2017-04-27 15:03:39.397 UTC","favorite_count":"1","last_activity_date":"2017-04-27 15:15:53.947 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1020476","post_type_id":"1","score":"1","tags":"c#|linq|select","view_count":"50"} +{"id":"46810056","title":"Transform assignments to dict","body":"\u003cp\u003eI have hard typed lots of assignments:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edefinition = ['basename', 'dirname', 'supports_unicode_filenames']\ncondition = ['isabs', 'isdir', 'isfile', 'islink', 'ismount']\n.\n.\n.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIntend to transform them to dict avoiding repeating typing:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{'definition': ['basename', 'dirname', 'supports_unicode_filenames'],\n 'condition': ['isabs', 'isdir', 'isfile', 'islink', 'ismount'] ...}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI tried to encapsulate them in class.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass OsPath:\n definition = ['basename', 'dirname', 'supports_unicode_filenames']\n condition = ['isabs', 'isdir', 'isfile', 'islink', 'ismount']\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWorking on console\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eIn [125]: dt = dict(vars(OsPath))\nIn [127]: {i:dt[i] for i in dt if not i.startswith('__')}\nOut[127]:\n{'condition': ['isabs', 'isdir', 'isfile', 'islink', 'ismount'],\n 'definition': ['basename', 'dirname', 'supports_unicode_filenames']}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow to do it in shortcut?\u003c/p\u003e","accepted_answer_id":"46810155","answer_count":"2","comment_count":"6","creation_date":"2017-10-18 12:20:09.677 UTC","last_activity_date":"2017-11-08 03:00:13.23 UTC","last_edit_date":"2017-11-08 03:00:13.23 UTC","last_editor_display_name":"","last_editor_user_id":"7301792","owner_display_name":"","owner_user_id":"7301792","post_type_id":"1","score":"-1","tags":"python","view_count":"49"} +{"id":"44278707","title":"How do you use a button click function to convert an [PHAsset] to PHAsset in Swift","body":"\u003cpre\u003e\u003ccode\u003epublic func nohanaImagePicker(_ picker: NohanaImagePickerController, didFinishPickingPhotoKitAssets pickedAssts: [PHAsset])\n{\n print(\"Completed\\n\\tpickedAssets = \\(pickedAssts)\")\n self.getAssetThumbnail(asset: pickedAssts)\n picker.dismiss(animated: true, completion: nil)\n self.ImageCollectionView.reloadData()\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnyone can u explain how to convert the [PHAsset] value to PHAsset \u003c/p\u003e","accepted_answer_id":"44278779","answer_count":"1","comment_count":"1","creation_date":"2017-05-31 07:46:45.37 UTC","last_activity_date":"2017-05-31 08:51:54.343 UTC","last_edit_date":"2017-05-31 08:51:54.343 UTC","last_editor_display_name":"","last_editor_user_id":"1825618","owner_display_name":"","owner_user_id":"5826484","post_type_id":"1","score":"0","tags":"ios|arrays|swift|uiimagepickercontroller|phasset","view_count":"53"} +{"id":"14443317","title":"ember.js and jQuery-UI multiselect widget","body":"\u003cp\u003eI need an advanced multiselect element (with search function) for my ember application.\u003c/p\u003e\n\n\u003cp\u003eI like \u003ca href=\"https://github.com/ehynds/jquery-ui-multiselect-widget\" rel=\"nofollow\"\u003ethis\u003c/a\u003e jQuery-UI Multiselect widget and started with this code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e// app.js\n...\nApp.MultiSelectView = Em.View.extend({\n didInsertElement: function() {\n this._super();\n console.log(\"Creating multiSelect element\");\n $(\"#mselect\").multiselect().multiselectfilter();\n },\n});\nApp.multiSelectView = App.MultiSelectView.create();\n...\n\n// index.html\n...\n\u0026lt;script type=\"text/x-handlebars\" data-template-name=\"mulselect\"\u0026gt;\n \u0026lt;select id=\"mselect\" multiple=\"multiple\"\u0026gt;\n \u0026lt;option value=\"1\"\u0026gt;Option 1\u0026lt;/option\u0026gt;\n \u0026lt;option value=\"2\"\u0026gt;Option 2\u0026lt;/option\u0026gt;\n \u0026lt;option value=\"3\"\u0026gt;Option 3\u0026lt;/option\u0026gt;\n \u0026lt;/select\u0026gt;\n {{view App.multiSelectView}}\n\u0026lt;/script\u0026gt;\n...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis code works and displays the widget. But I don't know how to bind the values/names to an ember controller/object.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://www.lukemelia.com/blog/archives/2012/03/10/using-ember-js-with-jquery-ui/\" rel=\"nofollow\"\u003eThis\u003c/a\u003e blog post seems to point into right direction, but as I said, I haven't found a solution yet because I'm new to ember (and javascript).\u003c/p\u003e\n\n\u003cp\u003eThank you.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-01-21 16:45:16.063 UTC","last_activity_date":"2013-01-31 13:11:12.477 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1984778","post_type_id":"1","score":"1","tags":"jquery-ui|ember.js","view_count":"1202"} +{"id":"42120330","title":"Visual Studio 2015 hangs when opening my website","body":"\u003cp\u003eAs title suggests, Visual Studio 2015 hangs whenever I try to open my remote website. It was working perfectly fine until yesterday then it suddenly stopped working for some reason. No changes to Visual Studio or any of the components or even the website itself have been made. To be clearer, no changes have been made to my computer at all, so I can't give more info at the moment, unfortunately. I run Win 10 x64 and Visual Studio 2015 with all the updates for both Windows and Visual Studio. I tried running Visual Studio in safe mode with no luck. No updates have been installed to Windows or Visual Studio in the past 3 days. Also the server has automatic updates disabled and no changes there as well. Any ideas?\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-02-08 17:56:48.047 UTC","last_activity_date":"2017-02-08 17:56:48.047 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6803369","post_type_id":"1","score":"0","tags":"visual-studio-2015|windows-10|remote-access","view_count":"12"} +{"id":"34609943","title":"Web service work but return error","body":"\u003cp\u003eMy web service work fine but return error after send email succesfuly.\u003c/p\u003e\n\n\u003cp\u003eExample:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction callJsonSync(toVal, subjectVal, bodyVal) {\n $.ajax({\n crossDomain: true,\n type: \"POST\",\n contentType: \"application/json; charset=utf-8\",\n url: \"service.asmx/SendEmailWebService?callback=?\",\n data: { to: toVal, subject: subjectVal,body: bodyVal},\n dataType: \"jsonp\",\n success: function (data) {\n alert(\"YES\");\n },\n error: function (data) {\n\n alert(\"NO\");\n }\n\n });\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAll work fine, after call web service in HTML page, but always go in error!\u003c/p\u003e\n\n\u003cp\u003eAny reason for that?\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2016-01-05 10:53:21.647 UTC","last_activity_date":"2016-01-05 10:58:55.353 UTC","last_edit_date":"2016-01-05 10:58:55.353 UTC","last_editor_display_name":"","last_editor_user_id":"5109824","owner_display_name":"","owner_user_id":"5109824","post_type_id":"1","score":"0","tags":"ajax|web-services","view_count":"35"} +{"id":"32642918","title":"Mathematical representation of ++a","body":"\u003cp\u003eWe can define \u003ccode\u003ea++\u003c/code\u003e as\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ea = a + 1;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhich is self-explaining that it makes a copy of \u003ccode\u003ea\u003c/code\u003e then adds 1 to it and puts the result in \u003ccode\u003ea\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eBut can we define \u003ccode\u003e++a\u003c/code\u003e the same way? Maybe the answer is very simple but I'm unaware of it.\u003c/p\u003e","answer_count":"2","comment_count":"3","creation_date":"2015-09-18 02:31:57.17 UTC","last_activity_date":"2015-09-18 02:42:43.38 UTC","last_edit_date":"2015-09-18 02:38:26.9 UTC","last_editor_display_name":"","last_editor_user_id":"1392132","owner_display_name":"","owner_user_id":"2710154","post_type_id":"1","score":"-3","tags":"c++|post-increment|pre-increment","view_count":"80"} +{"id":"14455372","title":"Eclipse java debugger: esclude some lines from Step Over","body":"\u003cp\u003eI'm debugging a java source and I want that a group of instructions must be executed at same press of Step Over.\u003c/p\u003e\n\n\u003cp\u003eSomething like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edebugcursor -\u0026gt; int a=10;\n int b=a+a;\n a=b*b;\n a++;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd, after pression of \"Step Over\":\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e int a=10;\n int b=a+a;\n a=b*b;\ndebugcursor -\u0026gt; a++;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs it possible to do it without any breakpoints and use of Step Run?\u003c/p\u003e","answer_count":"1","comment_count":"4","creation_date":"2013-01-22 09:35:17.267 UTC","last_activity_date":"2013-01-22 10:03:15.277 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1860198","post_type_id":"1","score":"-2","tags":"java|eclipse|debugging|custom-build-step","view_count":"90"} +{"id":"16661865","title":"HTML link with a php action","body":"\u003cp\u003eI am creating a website that stores information of homes like address, city etc. I got the upload to database part done and I got the search the database and display the information done. \u003c/p\u003e\n\n\u003cp\u003eBut now my plan with that is you get the search results and from there your suppose to get the option to view the full profile of that home via link. Displaying the full profile with the information gathered from the database is already done through a separate php file. Now when I link the php file it will only display the last column in the database. How can I link it so when I click on \"view full profile\" it will connect to the correct data/profile that corresponds to the different address or price. Or if i cant use an html link what can I use? Is that impossible?\u003c/p\u003e\n\n\u003cp\u003ehere is the code that displays the search results I have successfully been able to search the database and display it\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;?php\nif($sql-\u0026gt;num_rows){\n while ($row = $sql-\u0026gt;fetch_array(MYSQLI_ASSOC)){\n echo '\u0026lt;div id=\"listing\"\u0026gt;\n \u0026lt;div id=\"propertyImage\"\u0026gt; \n \u0026lt;img src=\"images/'.$row['imageName1'].'\" width=\"200\" height=\"150\" alt=\"\"/\u0026gt; \n \u0026lt;/div\u0026gt;\n\n \u0026lt;div id=\"basicInfo\"\u0026gt;\n \u0026lt;h2\u0026gt;$'.$row['Price'].'\u0026lt;/h2\u0026gt;\n \u0026lt;p style=\"font-size: 18px;\"\u0026gt;# '.$row['StreetAddress'].', '.$row['City'].', BC\u0026lt;/p\u0026gt;\n \u0026lt;p\u0026gt;'.$row['NumBed'].' Bedrooms | '.$row['NumBath'].' Bathrooms | '.$row['Property'].'\u0026lt;/p\u0026gt;\n \u0026lt;br\u0026gt;\n \u0026lt;p\u0026gt;\u0026lt;a href=\"outputtest.php\" class=\"link2\"\u0026gt;View Full Details\u0026lt;/a\u0026gt; | \u0026lt;a href=\"services/services.html\" class=\"link2\"\u0026gt;Get Directions\u0026lt;/a\u0026gt;\n\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;';\n\n height=\"150\" alt=\"\"/\u0026gt;';\n\n\n }\n}\nelse\n{\necho '\u0026lt;h2\u0026gt;0 Search Results\u0026lt;/h2\u0026gt;';\n}\n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is the php to display the information outputtest.php\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\nmysql_connect(\"localhost\",\"root\",\"31588patrick\");\n@mysql_select_db(\"test\") or die( \"Unable to select database\");\n$query=\"SELECT * FROM propertyinfo\";\n$result=mysql_query($query);\n\n$num=mysql_numrows($result);\n\nmysql_close();\n\n\n\n$i=0;\nwhile ($i \u0026lt; $num) {\n\n$varStreetAddress=mysql_result($result,$i,\"StreetAddress\");\n$varCity=mysql_result($result,$i,\"City\");\n$varProperty=mysql_result($result,$i,\"Property\");\n$varNumBed=mysql_result($result,$i,\"NumBed\");\n$varNumBath=mysql_result($result,$i,\"NumBath\");\n$varPrice=mysql_result($result,$i,\"Price\");\n$varEmail=mysql_result($result,$i,\"Email\");\n$varPhone=mysql_result($result,$i,\"Phone\");\n$varUtilities=mysql_result($result,$i,\"utilities\");\n$varTermLease=mysql_result($result,$i,\"TermLease\");\n$varNotes=mysql_result($result,$i,\"Notes\");\n$image1=mysql_result($result,$i,\"imageName1\");\n$image2=mysql_result($result,$i,\"imageName2\");\n$image3=mysql_result($result,$i,\"imageName3\");\n$image4=mysql_result($result,$i,\"imageName4\");\n\n\n\n$i++;\n}\n\n?\u0026gt; html code will go after this\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks \u003c/p\u003e\n\n\u003cp\u003eedit its working\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;?php\n\n////////////using mysqli to connect with database\n\n$mysqli = new mysqli(\"localhost\",\"root\",\"31588patrick\", \"test\");\n if ($mysqli-\u0026gt;connect_errno) {\n echo \"Failed to connect to MySQL: (\" . $mysqli-\u0026gt;connect_errno . \") \" . $mysqli-\u0026gt;connect_error;\n }\n///////////set variables\n$record_id = $_GET['record_id'];\n\n$sql = $mysqli-\u0026gt;query(\"select * from propertyinfo where StreetAddress like '%$record_id%'\");\n\nif($sql === FALSE) {\n die(mysql_error()); // TODO: better error handling\n\n}\n\n\nif($sql-\u0026gt;num_rows){\n while ($row = $sql-\u0026gt;fetch_array(MYSQLI_ASSOC)){\n $varStreetAddress=$row['StreetAddress'];\n $varCity=$row['City'];\n $varProperty=$row['Property'];\n $varNumBed=$row['NumBed'];\n $varNumBath=$row['NumBath'];\n $varPrice=$row['Price'];\n $varEmail=$row['Email'];\n $varPhone=$row['Phone'];\n $varUtilities=$row['utilities'];\n $varTermLease=$row['TermLease'];\n $varNotes=$row['Notes'];\n $image1=$row['imageName1'];\n $image2=$row['imageName2'];\n $image3=$row['imageName3'];\n $image4=$row['imageName4'];\n\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"3","creation_date":"2013-05-21 03:56:59.283 UTC","last_activity_date":"2013-05-21 22:56:19.55 UTC","last_edit_date":"2013-05-21 22:56:19.55 UTC","last_editor_display_name":"","last_editor_user_id":"2352594","owner_display_name":"","owner_user_id":"2352594","post_type_id":"1","score":"-2","tags":"php|html|mysql|hyperlink","view_count":"1932"} +{"id":"26045504","title":"How to request standard on screen keyboard on devices like Microsoft Surface?","body":"\u003cp\u003eWe're developing a cross-platform application that renders all its UI via OpenGL. I.e. there is no \"real\" controls in terms of Windows frameworks.\u003c/p\u003e\n\n\u003cp\u003eWhat we need is to pop-up Microsoft Surface keyboard each time user input is required and there is no physical keyboard connected.\u003c/p\u003e\n\n\u003cp\u003eThe only approach I \u003ca href=\"http://brianlagunas.com/showing-windows-8-touch-keyboard-wpf/\" rel=\"nofollow\"\u003efound\u003c/a\u003e requires admin privileges which is inappropriate.\u003c/p\u003e\n\n\u003cp\u003eIs there any standard call in WinAPI, .NET or whatever SDK that has C++ interface?\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2014-09-25 18:23:27.303 UTC","last_activity_date":"2014-09-25 18:23:27.303 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"188530","post_type_id":"1","score":"1","tags":"wpf|windows|winapi","view_count":"51"} +{"id":"40763578","title":"UIBarButtonItem depending on presentation. Swift3","body":"\u003cp\u003eI am facing a problem, because there are two ways how do I display my \u003ccode\u003eViewController\u003c/code\u003e.\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eFirst way is \u003ccode\u003eperformSegue(withIdentifier: \"segue\", sender: self)\u003c/code\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eIt works fine because then I have this back button in my \u003ccode\u003enavigationItem\u003c/code\u003e:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/EdpEi.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/EdpEi.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e \u003c/p\u003e\n\n\u003col start=\"2\"\u003e\n\u003cli\u003e\u003cp\u003eThen I use this code to present the same \u003ccode\u003eViewController\u003c/code\u003e (from another \u003ccode\u003eviewController\u003c/code\u003e than in the first case):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e let storyboard: UIStoryboard = UIStoryboard(name: \"Main\", bundle: nil)\n let navVC = storyboard.instantiateViewController(withIdentifier: \"navViewController\") as! UINavigationController\n let vc = navVC.topViewController as! ViewController \n self.present(navVC, animated: true, completion: nil)\n\u003c/code\u003e\u003c/pre\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003ebut then I do not have any back button in my \u003ccode\u003eViewController\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eMy question is:\u003c/strong\u003e How can I keep my \u003ccode\u003ebackButton (exactly how it is)\u003c/code\u003e when I use this function: \u003ccode\u003eperformSegue(withIdentifier: \"segue\", sender: self)\u003c/code\u003e , but add button (can look different) when I use this function: \u003ccode\u003eself.present(navVC, animated: true, completion: nil)\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eNote:\u003c/strong\u003e In my case 1 my segue is connected right to \u003ccode\u003eViewController\u003c/code\u003e , but in case 2 I present \u003ccode\u003eUINavigationController\u003c/code\u003e and \u003ccode\u003eViewController\u003c/code\u003e is \u003ccode\u003eembed in\u003c/code\u003e in this \u003ccode\u003eUINavigationController\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdit:\u003c/strong\u003e I tried this code, but it always prints: \u003ccode\u003e\"1.........\"\u003c/code\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eif self.presentingViewController != nil {\n print(\"1..........\")\n } else if self.navigationController?.presentingViewController?.presentedViewController == self.navigationController {\n return print(\"2.........\")\n } else if self.tabBarController?.presentingViewController is UITabBarController {\n return print(\"3........\")\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd also this code prints:\u003ccode\u003e\"Else..............\"\u003c/code\u003e :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elet isPresentingInAddMealMode = presentedViewController is UINavigationController\n\nif isPresentingInAddMealMode {\n print(\"FirstOption......................\")\n\n} else {\n print(\"Else......................\")\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf you need more info just let me know.\nThank you very much.\u003c/p\u003e","accepted_answer_id":"40785454","answer_count":"3","comment_count":"2","creation_date":"2016-11-23 11:41:43.99 UTC","last_activity_date":"2016-11-30 21:48:42.953 UTC","last_edit_date":"2016-11-26 20:06:49.533 UTC","last_editor_display_name":"","last_editor_user_id":"5108517","owner_display_name":"","owner_user_id":"5108517","post_type_id":"1","score":"2","tags":"ios|xcode|uiviewcontroller|swift3|uinavigationitem","view_count":"74"} +{"id":"34176519","title":"bash string replacement with similar cases","body":"\u003cp\u003eI am reading lines of a document that can contain these regexps (no single quotes included, double quotes included:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e' \"text\" '\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eor\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e' \"text1/text2\" '\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI would like to use a bash script to replace text to obtain these two different outputs:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e' PRE text POST '\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eor\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e' ANOTHERPRE text1 MID text2 POST '\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI was trying to use string replace {string // / }, but i don't seem to be able to keep the 'text' parts in between the string i want to replace. \u003c/p\u003e\n\n\u003cp\u003eThe actual problem is that the string outer delimiters are the same in both cases, the difference between the cases is the \"/\", which should indicate that i can use ANOTHERPRE and MID.\u003c/p\u003e\n\n\u003cp\u003eany suggestion on how to do this in bash?\u003c/p\u003e\n\n\u003cp\u003eAs an example, I have the following line:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e hello \"user\" you are \"alive/10\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand i want to produce:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ehello PRE user POST you are ANOTHERPRE alive MID 10 POST\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"1","creation_date":"2015-12-09 10:31:08.527 UTC","last_activity_date":"2015-12-10 17:58:34.607 UTC","last_edit_date":"2015-12-10 13:31:13.813 UTC","last_editor_display_name":"","last_editor_user_id":"3182409","owner_display_name":"","owner_user_id":"3182409","post_type_id":"1","score":"-1","tags":"string|bash|replace","view_count":"40"} +{"id":"1342126","title":"Virtual Table layout in memory?","body":"\u003cp\u003ehow are virtual tables stored in memory? their layout?\u003c/p\u003e\n\n\u003cp\u003ee.g. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass A{\n public:\n virtual void doSomeWork();\n};\n\nclass B : public A{\n public:\n virtual void doSomeWork();\n};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow will be the layout of virtual tables of class A and class B in memory?\u003c/p\u003e","accepted_answer_id":"1342207","answer_count":"6","comment_count":"2","creation_date":"2009-08-27 16:11:49.027 UTC","favorite_count":"4","last_activity_date":"2016-05-29 15:59:54.023 UTC","last_edit_date":"2010-08-25 11:49:02.377 UTC","last_editor_display_name":"","last_editor_user_id":"322229","owner_display_name":"","owner_user_id":"67047","post_type_id":"1","score":"6","tags":"c++|vtable","view_count":"12189"} +{"id":"36366161","title":"PHP ternary operators: if/else if/else with NULL, 0 and 1","body":"\u003cp\u003eI'm trying to simplify this control block: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eif (!isset($mobileNumberHF['IS_VALID']) \u0026amp;\u0026amp; $mobileNumberHF['IS_VALID'] != 0) {\n echo '\u0026lt;strong class=\"text-warning\"\u0026gt;Sin validar\u0026lt;/strong\u0026gt;';\n} else if ($mobileNumberHF['IS_VALID'] == 0) {\n echo '\u0026lt;strong class=\"text-danger\"\u0026gt;Inválido\u0026lt;/strong\u0026gt;';\n} else {\n echo '\u0026lt;strong class=\"text-success\"\u0026gt;Validado\u0026lt;/strong\u0026gt;';\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eLike this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$isValidMobileNum = $mobileNumHF['IS_VALID'];\n$mobileNumStatusLabel = ($isValidMobileNum == 1) ? 'Valid' : (!isset($isValidMobileNum)) ? 'Hasn't been validated' : 'Invalid';\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe test scenarios are when \u003ccode\u003e$isValidMobileNum\u003c/code\u003e equals \u003ccode\u003eNULL, 0 or 1\u003c/code\u003e;\u003c/p\u003e\n\n\u003cp\u003eBy now, the result varies in a way I'm still trying to understand. Sometimes the output is 'Valid', sometimes 'Invalid' and sometimes 'Hasn't been validated'\u003c/p\u003e\n\n\u003cp\u003eFor example, for \u003ccode\u003e$isValidMobileNum = 1\u003c/code\u003e I'm getting \u003ccode\u003eInvalid\u003c/code\u003e? \u003c/p\u003e","accepted_answer_id":"36366443","answer_count":"3","comment_count":"3","creation_date":"2016-04-01 21:31:40.053 UTC","last_activity_date":"2016-04-01 21:57:42.57 UTC","last_edit_date":"2016-04-01 21:35:43.323 UTC","last_editor_display_name":"","last_editor_user_id":"3051080","owner_display_name":"","owner_user_id":"3051080","post_type_id":"1","score":"0","tags":"php|ternary-operator","view_count":"56"} +{"id":"42378473","title":"Could not find class 'android.graphics.drawable.RippleDrawable', Could not execute method for android:onClick, Android Studio","body":"\u003cp\u003eI am trying to make an app for ordering coffee. (I am really new to this.)\u003c/p\u003e\n\n\u003cp\u003eMy app was working perfectly until two errors appeared. Now, it runs in a device, but when you try to touch the buttons, it stops.\u003c/p\u003e\n\n\u003cp\u003eThe code is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epackage com.example.android.justjava;\nimport android.os.Bundle;\nimport android.support.v7.app.AppCompatActivity;\nimport android.view.View;\nimport android.widget.TextView;\n\nimport java.text.NumberFormat;\n\n/**\n * This app displays an order form to order coffee.\n */\npublic class MainActivity extends AppCompatActivity {\n int quantity = 0;\n //int priceOfOneCup = 5;\n\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n }\n\n /**\n * This method is called when the order button is clicked.\n */\n public void submitOrder(View view){\n //calculatePrice(quantity, priceOfOneCup);\n int price = quantity * 5 ;\n String priceMessage = \"Total: \" + price + \"€\" + \"\\nThank You!\";\n displayMessage(priceMessage);\n }\n\n /**\n * This method is called when the plus button is clicked.\n */\n public void increment(View view) {\n quantity = quantity + 1;\n displayQuantity(quantity);\n }\n\n /**\n * This method is called when the minus button is clicked.\n */\n public void decrement(View view) {\n quantity = quantity - 1;\n displayQuantity(quantity);\n }\n\n\n /**\n * This method displays the given quantity value on the screen.\n */\n private void displayQuantity(int number) {\n TextView quantityTextView = (TextView) findViewById(R.id.quantity_text_view);\n quantityTextView.setText(number);\n }\n\n /**\n * This method displays the given price on the screen.\n */\n private void displayPrice(int number) {\n TextView priceTextView = (TextView) findViewById(R.id.price_text_view);\n priceTextView.setText(NumberFormat.getCurrencyInstance().format(number));\n }\n\n /**\n * This method displays the given text on the screen.\n */\n private void displayMessage(String message) {\n TextView priceTextView = (TextView) findViewById(R.id.price_text_view);\n priceTextView.setText(message);\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eXML Code: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" encoding=\"utf-8\"?\u0026gt;\n\u0026lt;LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:tools=\"http://schemas.android.com/tools\"\n android:id=\"@+id/activity_main\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"match_parent\"\n android:orientation=\"vertical\"\n android:padding=\"16dp\"\n tools:context=\"com.example.android.justjava.MainActivity\"\u0026gt;\n\n \u0026lt;TextView\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_marginBottom=\"16dp\"\n android:text=\"Quantity\"\n android:textAllCaps=\"true\" /\u0026gt;\n\n \u0026lt;LinearLayout\n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\"\u0026gt;\n\n \u0026lt;Button\n android:layout_width=\"48dp\"\n android:layout_height=\"48dp\"\n android:onClick=\"decrement\"\n android:text=\"-\" /\u0026gt;\n\n \u0026lt;TextView\n android:id=\"@+id/quantity_text_view\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_marginLeft=\"8dp\"\n android:layout_marginRight=\"8dp\"\n android:text=\"0\"\n android:textColor=\"@android:color/black\"\n android:textSize=\"16sp\"\n /\u0026gt;\n\n \u0026lt;Button\n android:layout_width=\"48dp\"\n android:layout_height=\"48dp\"\n android:onClick=\"increment\"\n android:text=\"+\" /\u0026gt;\n\n \u0026lt;/LinearLayout\u0026gt;\n\n \u0026lt;TextView\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_marginBottom=\"16dp\"\n android:layout_marginTop=\"16dp\"\n android:text=\"Price\"\n android:textAllCaps=\"true\" /\u0026gt;\n\n \u0026lt;TextView\n android:id=\"@+id/price_text_view\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:text=\"Total: 0€\"\n android:textColor=\"@android:color/black\"\n android:textSize=\"16sp\" /\u0026gt;\n\n\n \u0026lt;Button\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_marginTop=\"16dp\"\n android:onClick=\"submitOrder\"\n android:text=\"Order\" /\u0026gt;\n \u0026lt;/LinearLayout\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe first error in the terminal:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eE/dalvikvm: Could not find class 'android.graphics.drawable.RippleDrawable', referenced from method android.support.v7.widget.AppCompatImageHelper.hasOverlappingRendering\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd the main error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eE/AndroidRuntime: FATAL EXCEPTION: main\n Process: com.example.android.justjava, PID: 32585\n java.lang.IllegalStateException: Could not execute method for android:onClick\n at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:293)\n at android.view.View.performClick(View.java:4508)\n at android.view.View$PerformClick.run(View.java:18675)\n at android.os.Handler.handleCallback(Handler.java:733)\n at android.os.Handler.dispatchMessage(Handler.java:95)\n at android.os.Looper.loop(Looper.java:136)\n at android.app.ActivityThread.main(ActivityThread.java:5584)\n at java.lang.reflect.Method.invokeNative(Native Method)\n at java.lang.reflect.Method.invoke(Method.java:515)\n at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268)\n at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)\n at dalvik.system.NativeStart.main(Native Method)\n Caused by: java.lang.reflect.InvocationTargetException\n at java.lang.reflect.Method.invokeNative(Native Method)\n at java.lang.reflect.Method.invoke(Method.java:515)\n at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:288)\n at android.view.View.performClick(View.java:4508) \n at android.view.View$PerformClick.run(View.java:18675) \n at android.os.Handler.handleCallback(Handler.java:733) \n at android.os.Handler.dispatchMessage(Handler.java:95) \n at android.os.Looper.loop(Looper.java:136) \n at android.app.ActivityThread.main(ActivityThread.java:5584) \n at java.lang.reflect.Method.invokeNative(Native Method) \n at java.lang.reflect.Method.invoke(Method.java:515) \n at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268) \n at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084) \n at dalvik.system.NativeStart.main(Native Method) \n Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x1\n at android.content.res.Resources.getText(Resources.java:1404)\n at android.support.v7.widget.ResourcesWrapper.getText(ResourcesWrapper.java:52)\n at android.widget.TextView.setText(TextView.java:4262)\n at com.example.android.justjava.MainActivity.displayQuantity(MainActivity.java:61)\n at com.example.android.justjava.MainActivity.increment(MainActivity.java:44)\n at java.lang.reflect.Method.invokeNative(Native Method) \n at java.lang.reflect.Method.invoke(Method.java:515) \n at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:288) \n at android.view.View.performClick(View.java:4508) \n at android.view.View$PerformClick.run(View.java:18675) \n at android.os.Handler.handleCallback(Handler.java:733) \n at android.os.Handler.dispatchMessage(Handler.java:95) \n at android.os.Looper.loop(Looper.java:136) \n at android.app.ActivityThread.main(ActivityThread.java:5584) \n at java.lang.reflect.Method.invokeNative(Native Method) \n at java.lang.reflect.Method.invoke(Method.java:515) \n at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268) \n at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084) \n at dalvik.system.NativeStart.main(Native Method)\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"42383387","answer_count":"1","comment_count":"0","creation_date":"2017-02-21 21:36:43.18 UTC","last_activity_date":"2017-02-24 12:56:31.087 UTC","last_edit_date":"2017-02-24 12:56:31.087 UTC","last_editor_display_name":"","last_editor_user_id":"4284627","owner_display_name":"","owner_user_id":"7601232","post_type_id":"1","score":"0","tags":"java|android|xml|android-layout|android-studio","view_count":"2307"} +{"id":"35203007","title":"Passing user defined java function as a parameter","body":"\u003cp\u003eI have a function named myFunction which takes as inputs a list and a function and it applies the function on every element of the list.\nExample: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elist = {1,2,3}\ndef square(int x):\n return x*x;\nmyFunction(list , square) should return {1 ,4, 9}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow here is the catch, the user can give any function as the input. I know that the functions can be wrapped in the interface and passed as arguments. But in my case, i wouldn't know the name of the function to begin with. Is there any way to deal with this?\u003c/p\u003e","answer_count":"2","comment_count":"6","creation_date":"2016-02-04 13:59:29.467 UTC","last_activity_date":"2016-02-04 14:23:39.003 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2928498","post_type_id":"1","score":"0","tags":"java|interface|polymorphism","view_count":"82"} +{"id":"2412942","title":"how to simulate the dos \"CD..\" in a small c shell for linux","body":"\u003cp\u003ethis is for a small project of mine, I'm trying to set the current process working directory to the One directory up as\nif my current directory is ..\\downloads\\movies\ni'd like code to set the directory to ..\\downloads\u003c/p\u003e\n\n\u003cp\u003eI know this is possible by getting the current working directory path and extracting the directory path i need from it and then do a chdir(), however this code needs to be as efficient and light as possible, and i find the above method kinda cumbersome.\u003c/p\u003e\n\n\u003cp\u003eThanks in advance falks.\u003c/p\u003e","accepted_answer_id":"2413091","answer_count":"2","comment_count":"0","creation_date":"2010-03-09 22:09:14.823 UTC","last_activity_date":"2010-03-09 22:35:23.763 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"208955","post_type_id":"1","score":"3","tags":"c|linux","view_count":"433"} +{"id":"23245137","title":"View in a different window","body":"\u003cp\u003eI just find a app in the playstore and really liked the view which can be opened every time and in any App . So I asked myself how to do that and searched for some keywords but without success :/ Is there any Tutorial to do sth like that ? Do you guys have a right keyword for it ? I just want to be able to open up my application but also see the background. Its hard to explain so I just insert the link in my post .\u003c/p\u003e\n\n\u003cp\u003eIt would be awesome if you can help me ! :)\u003c/p\u003e\n\n\u003cp\u003eLink : \u003ca href=\"https://www.youtube.com/watch?v=0ac0eLZE-vQ\" rel=\"nofollow\"\u003ehttps://www.youtube.com/watch?v=0ac0eLZE-vQ\u003c/a\u003e\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2014-04-23 13:01:54.553 UTC","last_activity_date":"2015-02-05 11:02:01.403 UTC","last_edit_date":"2014-10-18 16:48:27.71 UTC","last_editor_display_name":"","last_editor_user_id":"13302","owner_display_name":"","owner_user_id":"3339279","post_type_id":"1","score":"0","tags":"java|android|view","view_count":"41"} +{"id":"15858228","title":"Ajax - how to make every link/form on the page reload only part of that page?","body":"\u003cp\u003eI have a website, and I want to keep part of it static. Now, in order to do that, I need to replace single div, something like that:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;html\u0026gt;\n \u0026lt;head\u0026gt;\n \u0026lt;/head\u0026gt;\n \u0026lt;body\u0026gt;\n \u0026lt;div id=\"contentToReplace\"\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div id=\"myStaticContent\"\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow, how can I catch all clicks on anchors and clicks on forms submit button, and reload \u003ccode\u003econtentToReplace\u003c/code\u003e? I tried using \u003ccode\u003ejQuery.load()\u003c/code\u003e and it was perfect, but it was not loading scripts, and I need those. Also, I don't know how to submit forms with ajax requests.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-04-07 02:28:39.723 UTC","last_activity_date":"2013-04-07 03:00:42.653 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1593783","post_type_id":"1","score":"0","tags":"javascript|jquery|html|ajax","view_count":"281"} +{"id":"22069642","title":"FPDF not showing more than one image","body":"\u003cp\u003eBelow is a little snippet which works fine, it shows me a PDF file, but with only the last image I set. \u003c/p\u003e\n\n\u003cp\u003eWhat is wrong in my code?\nI didn't found documentation for ASP FPDF, only for PHP.\nAny help is apreciated. Thanks!\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;%@language=vbscript%\u0026gt;\n\u0026lt;!--#include file=\"fpdf.asp\"--\u0026gt;\n\u0026lt;%Response.ContentType=\"application/pdf\"%\u0026gt;\n\n\u0026lt;%\nimgCat = \"..\\fc_img\\cat.jpg\"\nimgDog = \"..\\fc_img\\dog.jpg\"\nSet pdf=CreateJsObject(\"FPDF\")\npdf.CreatePDF \"L\", \"mm\", \"A4\"\npdf.SetPath(\"fpdf/\")\npdf.Open()\n\npdf.AddPage()\n\npdf.SetTitle \"Life is a b1tch\"\npdf.Image imgDog , 10, 10, 20, 20\npdf.Image imgCat , 40, 40, 20, 20\n\npdf.Close()\npdf.Output()\n%\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"22299172","answer_count":"1","comment_count":"2","creation_date":"2014-02-27 13:14:15.613 UTC","last_activity_date":"2014-03-10 16:04:22.247 UTC","last_edit_date":"2014-03-10 15:28:14.367 UTC","last_editor_display_name":"","last_editor_user_id":"692942","owner_display_name":"","owner_user_id":"598591","post_type_id":"1","score":"1","tags":"javascript|pdf|vbscript|asp-classic|fpdf","view_count":"331"} +{"id":"3140112","title":"How to design non-EJB load balanced applications?","body":"\u003cp\u003eI have a java class \u003ccode\u003eProcessor\u003c/code\u003e that is listening to a jms topic and it is struggling to keep up with the speed in which messages are arriving so we've decided to go concurrent: \u003c/p\u003e\n\n\u003cp\u003eA single class listening to the topic who's job is to hand the messages out to a pool of worker threads, effectively being a load balancer. It also has to prevent 2 workers processing messages for the same customer.\u003c/p\u003e\n\n\u003cp\u003eI expected there to be quite a lot of information on the internet about this but everything seems to suggest the use of EJBs where the app server manages the pool and does the balancing. I'm sure this must be a really common problem, but can't seem to find any libraries or design patterns to assist. Am I making more out of it than it is and should just delve in and write my own code?\u003c/p\u003e","accepted_answer_id":"3140655","answer_count":"2","comment_count":"2","creation_date":"2010-06-29 11:17:20.68 UTC","favorite_count":"0","last_activity_date":"2010-06-29 12:53:34.16 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"374265","post_type_id":"1","score":"1","tags":"java|jms|load-balancing|worker-thread","view_count":"207"} +{"id":"31577121","title":"Configure Git to show warning on pushing to different branch than current branch","body":"\u003cp\u003eIs there a way to configure Git/Github to prompt with a warning message upon this scenario:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$\u0026gt; git branch\n$\u0026gt; *my_special_branch\n$\u0026gt; git commit -am \"I am about to make a grave error\"\n$\u0026gt; git push origin master\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebasically I want to prevent myself and my team from pushing to a different remote branch than the current one I am on without a warning or confirmation prompt...\u003c/p\u003e\n\n\u003cp\u003eso basically I want to prevent pushing to the \u003cem\u003eremote\u003c/em\u003e master branch from any branch but a \u003cem\u003elocal\u003c/em\u003e master branch...\u003c/p\u003e","accepted_answer_id":"32302570","answer_count":"3","comment_count":"4","creation_date":"2015-07-23 02:19:55.62 UTC","last_activity_date":"2015-08-31 00:38:20.94 UTC","last_edit_date":"2015-07-23 05:35:33.57 UTC","last_editor_display_name":"","last_editor_user_id":"1223975","owner_display_name":"","owner_user_id":"1223975","post_type_id":"1","score":"3","tags":"git|github","view_count":"171"} +{"id":"44430760","title":"add CCS style which depends on php IF statement inside mysqli_fetch_array","body":"\u003cp\u003eI want to add CCS style which depends on php IF statement. I have found something: \u003ca href=\"https://stackoverflow.com/questions/7170498/changing-the-style-inside-if-statement\"\u003echanging the style inside \u0026quot;if\u0026quot; statement\u003c/a\u003e, but somehow it doesn`t work, maybe because of WHILE statement in my code.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\n$possible_lang_list = mysqli_query($con, \n'SELECT * FROM page WHERE title = \"lang\" ORDER BY name1 ASC');\n\nwhile ($row = mysqli_fetch_array($possible_lang_list)) {\n echo '\n \u0026lt;div class=\"language\" id=\"' . $row['name2'] . '\"\u0026gt;\n \u0026lt;p\u0026gt;' . $row['name1'] . '\u0026lt;/p\u0026gt;\n \u0026lt;/div\u0026gt;\n ';\n}\n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to display only div class=\"language\" where $row['name2'] == $x, with possibility to display whole class \"language\" with JavaScript. Could anyone help?\u003c/p\u003e\n\n\u003cp\u003eI have tried:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e while ($row = mysqli_fetch_array($possible_lang_list)) {\n if ($row['name2'] == $x) {\n ?\u0026gt;\n \u0026lt;div style=\"display:block;\"\u0026gt;\n \u0026lt;?php } else {\n ?\u0026gt;\n \u0026lt;div style=\"display:none;\"\u0026gt;\n \u0026lt;?php\n echo '\n \u0026lt;div class=\"\" id=\"' . $row['name2'] . '\"\u0026gt;\n \u0026lt;p\u0026gt;' . $row['name1'] . '\u0026lt;/p\u0026gt;\n\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;';\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"44431046","answer_count":"3","comment_count":"2","creation_date":"2017-06-08 08:41:49.393 UTC","last_activity_date":"2017-06-08 09:06:16.867 UTC","last_edit_date":"2017-06-08 08:51:20.897 UTC","last_editor_display_name":"","last_editor_user_id":"7719929","owner_display_name":"","owner_user_id":"7719929","post_type_id":"1","score":"0","tags":"php|css|mysqli","view_count":"24"} +{"id":"15266821","title":"Creating a Table Model component using Netbeans","body":"\u003cp\u003eI'm trying to create a custom table model, but I got stuck.\u003c/p\u003e\n\n\u003cp\u003eI want to create a table model and bind it using the Netbeans GUI. However, as you can see on the screenshot, the Component dropdown is inactive. \u003c/p\u003e\n\n\u003cp\u003eHow can I create such a model component, and where do I put it?\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/RaKLr.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2013-03-07 08:57:21.953 UTC","last_activity_date":"2013-03-07 08:59:04.73 UTC","last_edit_date":"2013-03-07 08:59:04.73 UTC","last_editor_display_name":"","last_editor_user_id":"418556","owner_display_name":"","owner_user_id":"1358522","post_type_id":"1","score":"0","tags":"java|swing|netbeans|tablemodel","view_count":"1083"} +{"id":"40294324","title":"Canvas.drawImage simply just does not draw the image","body":"\u003cp\u003ei'm trying to generate a tile-based-map, which works just fine so far, but after replacing all the \"test-rectangles\" with images to represent the ground, the path, some houses etc. (in this case its the same image for all of them), not a single image gets drawn down.\u003c/p\u003e\n\n\u003cp\u003eWhat am i doing wrong here? I also get zero errors.\u003c/p\u003e\n\n\u003cp\u003eHeres the code snipped:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e // generate a large map \n Map.prototype.generate = function(){\n var ctx = document.createElement(\"canvas\").getContext(\"2d\"); \n ctx.canvas.width = this.width;\n ctx.canvas.height = this.height; \n\n var rows = ~~(this.width/\u0026lt;?php echo $GAME['map']['tileSize'] + $GAME['map']['tileBorder']; ?\u0026gt;) + 1;\n var columns = ~~(this.height/\u0026lt;?php echo $GAME['map']['tileSize'] + $GAME['map']['tileBorder']; ?\u0026gt;) + 1;\n\n ctx.save(); \n\n // Here i wanted to check if the image gets drawn right besides the player\n var testImage = document.createElement('img'); // Also tried new Image();\n testImage.onload = (function () {\n console.log(testImage + \"-test\");\n ctx.drawImage(testImage, 1000, 1000, \u0026lt;?php echo $GAME['map']['tileSize']; ?\u0026gt;, \u0026lt;?php echo $GAME['map']['tileSize']; ?\u0026gt;);\n }());\n testImage.src = \"http://192.168.0.140/img/terrain.png\";\n\n var imgs = [];\n var imgIndex = 0;\n\n \u0026lt;?php echo \"for (var y = 0, i = \".$tilesToLoad['xStart'].\"; i \u0026lt; \".($tilesToLoad['xStart'] + $GAME['map']['chunkSize']).\"; y+=\".($GAME['map']['tileSize'] + $GAME['map']['tileBorder']).\", i++) {\"; ?\u0026gt;\n\n \u0026lt;?php echo \"for (var x = 0, j = \".$tilesToLoad['yStart'].\"; j \u0026lt; \".($tilesToLoad['yStart'] + $GAME['map']['chunkSize']).\"; x+=\".($GAME['map']['tileSize'] + $GAME['map']['tileBorder']).\", j++) {\"; ?\u0026gt;\n imgs[imgIndex] = document.createElement('img'); \n imgs[imgIndex].onload = (function () {\n console.log(imgs[imgIndex] + \"-\" + imgIndex + \"-\" + x + \"-\" + y);\n ctx.drawImage(imgs[imgIndex], x, y, \u0026lt;?php echo $GAME['map']['tileSize']; ?\u0026gt;, \u0026lt;?php echo $GAME['map']['tileSize']; ?\u0026gt;);\n }());\n imgs[imgIndex].src = \"http://192.168.0.140/img/terrain.png\";\n imgIndex += 1;\n }\n }\n\n ctx.restore(); \n\n // store the generate map as this image texture\n this.image = new Image();\n this.image.src = ctx.canvas.toDataURL(\"image/png\"); \n\n // clear context\n ctx = null;\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003econsole.log output:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e [object HTMLImageElement]-test\n [object HTMLImageElement]-0-0-0\n [object HTMLImageElement]-1-41-0\n [object HTMLImageElement]-2-82-0\n [object HTMLImageElement]-3-123-0\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-10-27 21:16:45.33 UTC","last_activity_date":"2016-10-28 19:06:13.76 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2062191","post_type_id":"1","score":"0","tags":"javascript|html5|for-loop|canvas|drawimage","view_count":"278"} +{"id":"27339412","title":"I cannot apply CSS through Jquery on the content which is getting loaded dynamically.","body":"\u003cp\u003eThere is an anchor tag, when you click that a qtip appears. That qtip is dynamically generated. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;a class=\"change-zip\" href=\"#zip-change-tooltip\"\u0026gt;something\u0026lt;/a\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e/*this is dynamically loaded */\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"qtip\"\u0026gt;\n \u0026lt;div class=\"content\"\u0026gt;\n \u0026lt;div id=\"zip-change-tooltip\"\u0026gt;\n *content is here*\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow on above content i am using this \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(document.body).on('click','.change-zip',function(){\n\n $('#zip-change-tooltip').parents('.qtip').css('height','200px');\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt doesn't work in the first place but when i click on it second time it works fine that's because the DOM is already loaded. What should i do to make it work ? \u003c/p\u003e\n\n\u003cp\u003eThanks in advance. \u003c/p\u003e","answer_count":"3","comment_count":"4","creation_date":"2014-12-07 03:52:49.64 UTC","last_activity_date":"2014-12-07 18:06:59.097 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1819887","post_type_id":"1","score":"0","tags":"javascript|jquery|html|frontend","view_count":"134"} +{"id":"20705116","title":"When I call C++ code from C# code, is it thread-safe?","body":"\u003cp\u003eI have a C# project in which I need to determine if a given date is a holiday in a given country. I can use the date and calendar functionality in \u003ca href=\"http://quantlib.org/\" rel=\"nofollow\"\u003eQuantLib\u003c/a\u003e for this purpose. QuantLib is written in C++, so I have written a wrapper to call this code. I would like to know if the code I'm using is thread-safe.\u003c/p\u003e\n\n\u003cp\u003eHere are the QuantLib calls I use in C++ to determine if a given date is a holiday:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eextern \"C\" _declspec(dllexport) int isHoliday(int year, int month, int day,\n int trueValue, int falseValue, int errorValue)\n{\n try\n {\n QuantLib::Calendar cal = QuantLib::UnitedStates();\n QuantLib::Date date(day, (QuantLib::Month)month, year);\n\n return cal.isHoliday(date) ? trueValue : falseValue;\n }\n catch(...)\n {\n return errorValue;\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003chr\u003e\n\n\u003cp\u003eHere is the C# signature I use to call my C++ code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[DllImport(\"QuantLibHelpers.dll\", CallingConvention = CallingConvention.Cdecl)]\nprivate static extern int isHoliday(int year, int month, int day,\n int trueValue, int falseValue, int errorValue);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003chr\u003e\n\n\u003cp\u003eThe most I could find about the QuantLib code is \u003ca href=\"http://quantlib.sourcearchive.com/documentation/0.3.11/classQuantLib_1_1Calendar_bc3739c617b5a3d6e2d9482634af66f6.html#bc3739c617b5a3d6e2d9482634af66f6\" rel=\"nofollow\"\u003ehere\u003c/a\u003e. Nothing in there looks thread-unsafe, but I can't be sure. More generally, regardless of my use of QuantLib, is calling C++ code like this thread-safe? Is it possible that one thread, while creating the date object, gets interrupted by another thread which somehow corrupts the first date object? I know that I can lock all calls to the C# isHoliday() static function if this code is indeed thread-unsafe.\u003c/p\u003e\n\n\u003cp\u003eNote that my code works fine as is.\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003eI know about \u003ca href=\"http://sourceforge.net/projects/qlnet/\" rel=\"nofollow\"\u003eQLNet\u003c/a\u003e which is a .Net port of QuantLib. I prefer to use QuantLib because it appears to have better support.\u003c/p\u003e","accepted_answer_id":"20705760","answer_count":"2","comment_count":"2","creation_date":"2013-12-20 13:51:34.05 UTC","last_activity_date":"2013-12-20 14:26:10.34 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2023861","post_type_id":"1","score":"1","tags":"c#|c++|multithreading|quantlib","view_count":"394"} +{"id":"25666151","title":"Is it possible to start only one of the roles of the deployment for local integration testing purposes?","body":"\u003cp\u003eWe have a project which contains one web role and one worker role. \nI want to run integration tests for the worker role on the local computer but I do not know how to start only the instance of the worker role in order to just run the tests. I do not want to start the web role for the integration tests because I do not need it. \u003c/p\u003e\n\n\u003cp\u003eIn a separate project where the worker role was alone it was really nice and easy to do it. \u003c/p\u003e\n\n\u003cp\u003eIs it a good idea to create a separate solution (and then in the source control too) which contains only the worker and its tests? This way I will have the projects in the main solution which is the one which gets deployed but I will not \"spoil\" this solution with integration tests which are not \"executable\" in TFS online. \u003c/p\u003e\n\n\u003cp\u003eIs it generally a good idea of having separate solutions for integration testing in order not to spoil the main solution with tests that are not executable in TFS (be it TFS online or on premise)? We usually place my unit tests in a project in the main solution which tests get executed after TFS build the app.\u003c/p\u003e","accepted_answer_id":"25675227","answer_count":"1","comment_count":"0","creation_date":"2014-09-04 12:57:29.21 UTC","last_activity_date":"2014-09-04 21:35:14.143 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1042934","post_type_id":"1","score":"1","tags":"azure|integration-testing|azure-web-roles|azure-worker-roles","view_count":"84"} +{"id":"5489140","title":"Refactor packages of a jar","body":"\u003cp\u003eI am having some troubles with a jar, and I want to rename all clases to avoid conflicts, but I only have the final jar :(\u003c/p\u003e\n\n\u003cp\u003eClasses in jar are in package as it:\u003c/p\u003e\n\n\u003cp\u003eorg.foundation and I want to be available in another jar as\u003c/p\u003e\n\n\u003cp\u003eorg.foundation.oldversion\u003c/p\u003e\n\n\u003cp\u003eIs there any tool to do it ?\u003c/p\u003e\n\n\u003cp\u003eI don't want to decompile.\u003c/p\u003e","accepted_answer_id":"5489193","answer_count":"1","comment_count":"3","creation_date":"2011-03-30 16:23:44.477 UTC","last_activity_date":"2011-03-30 16:28:15.697 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"126083","post_type_id":"1","score":"0","tags":"java|refactoring|jar","view_count":"394"} +{"id":"46256686","title":"Ionic 3 posting data to Mysql","body":"\u003cp\u003ei am new to Ionic 3,i want to submit he username data to mysql. I am using the following code, it does not show any error message, but it does not show the value submitted to api.php file. How we can use the Insert command in the following api.php file.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003econtact.html\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;ion-header\u0026gt;\n \u0026lt;ion-navbar\u0026gt;\n \u0026lt;button ion-button menuToggle\u0026gt;\n \u0026lt;ion-icon name=\"menu\"\u0026gt;\u0026lt;/ion-icon\u0026gt;\n \u0026lt;/button\u0026gt;\n \u0026lt;ion-title\u0026gt;My Contact\u0026lt;/ion-title\u0026gt;\n \u0026lt;/ion-navbar\u0026gt;\n\u0026lt;/ion-header\u0026gt;\n\n\u0026lt;ion-content padding\u0026gt;\n \u0026lt;ion-list\u0026gt;\n \u0026lt;ion-item\u0026gt;\n \u0026lt;ion-label floating\u0026gt;Username\u0026lt;/ion-label\u0026gt;\n \u0026lt;ion-input type=\"text\" name=\"username\" [(ngModel)]=\"data.username\"\u0026gt;\u0026lt;/ion-input\u0026gt;\n \u0026lt;/ion-item\u0026gt;\n\u0026lt;button ion-button color=\"danger\" round (click)=\"submit()\"\u0026gt;Submit\u0026lt;/button\u0026gt;\n\u0026lt;button ion-button color=\"primary\" menuToggle\u0026gt;Toggle Menu\u0026lt;/button\u0026gt;\n\u0026lt;/ion-list\u0026gt;\n \u0026lt;/ion-content\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003econtact.ts\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport { Component } from '@angular/core';\nimport { IonicPage, NavController, NavParams } from 'ionic-angular';\nimport { Http } from '@angular/http';\n/**\n * Generated class for the ContactPage page.\n *\n * See http://ionicframework.com/docs/components/#navigation for more info\n * on Ionic pages and navigation.\n */\n\n@IonicPage()\n@Component({\n selector: 'page-contact',\n templateUrl: 'contact.html',\n})\nexport class ContactPage {\n data:any = {};\n constructor(public navCtrl: NavController, public navParams: NavParams, public http: Http) {\n this.data.username = '';\n this.data.response = '';\n this.http=http;\n }\n\nsubmit() {\n var link = '../contact/api.php';\n var myData = JSON.stringify({username: this.data.username});\n this.http.post(link, myData)\n .subscribe(data =\u0026gt; {\n this.data.response = data[\"_body\"]; \n }, error =\u0026gt; {\n console.log(\"Oooops!\");\n });\n }\n ionViewDidLoad() {\n console.log('ionViewDidLoad ContactPage');\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eapi.php\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\n // Allow from any origin\n if (isset($_SERVER['HTTP_ORIGIN'])) {\n header(\"Access-Control-Allow-Origin: {$_SERVER['HTTP_ORIGIN']}\");\n header('Access-Control-Allow-Credentials: true');\n header('Access-Control-Max-Age: 86400'); // cache for 1 day\n }\n\n // Access-Control headers are received during OPTIONS requests\n if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {\n\n if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_METHOD']))\n header(\"Access-Control-Allow-Methods: GET, POST, OPTIONS\"); \n\n if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']))\n header(\"Access-Control-Allow-Headers: {$_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']}\");\n\n exit(0);\n }\n\n echo \"You have CORS!\";\n\n $postdata = file_get_contents(\"php://input\");\n if (isset($postdata)) {\n $request = json_decode($postdata);\n $username = $request-\u0026gt;username;\n echo \"hello how are you\"\n if ($username != \"\") {\n echo \"Server returns: \" . $username;\n }\n else {\n echo \"Empty username parameter!\";\n }\n }\n else {\n echo \"Not called properly with username parameter!\";\n }\n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ePlease Help to solve the problem\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-09-16 17:38:19.443 UTC","last_activity_date":"2017-09-16 19:21:39.74 UTC","last_edit_date":"2017-09-16 19:21:39.74 UTC","last_editor_display_name":"","last_editor_user_id":"1077309","owner_display_name":"","owner_user_id":"8579500","post_type_id":"1","score":"1","tags":"php|angular|typescript|ionic3","view_count":"332"} +{"id":"37535659","title":"how can i change the font size of a text file in Eclipse","body":"\u003cp\u003eI'm specifically talking about the text font size of .txt files in Eclipse. I've already changed the default font size for .java files but any file with .txt is unchanged and really small. \u003c/p\u003e","accepted_answer_id":"37536735","answer_count":"2","comment_count":"2","creation_date":"2016-05-31 01:49:44.31 UTC","last_activity_date":"2016-05-31 04:16:23.663 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4898342","post_type_id":"1","score":"0","tags":"eclipse","view_count":"28"} +{"id":"32016143","title":"how can set where condition in list() method in grails","body":"\u003cp\u003eI am using list() method to get the data.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;g:select id=\"complaint\" class=\"form-control chosen-select\" multiple=\"true\" name=\"complaint\" from=\"${settings.Complaint.list()}\"optionKey=\"id\" optionValue=\"name\"/\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow I would like get the data as list which status is active. Is there any way to use condition in list()? \u003c/p\u003e","accepted_answer_id":"32303344","answer_count":"1","comment_count":"3","creation_date":"2015-08-14 18:02:07.717 UTC","last_activity_date":"2015-08-31 02:48:04.68 UTC","last_edit_date":"2015-08-14 18:20:23.443 UTC","last_editor_display_name":"","last_editor_user_id":"6509","owner_display_name":"","owner_user_id":"913595","post_type_id":"1","score":"-2","tags":"grails|gorm","view_count":"189"} +{"id":"23271797","title":"Want to move tortoiseSVN 1.6.2(32-bit, windows 7) to 1.7.7(64-bit,windows 8.1) is it possible..?","body":"\u003cp\u003eWant to move tortoiseSVN 1.6.2(32-bit, windows 7) to 1.7.7(64-bit,windows 8.1) is it possible..?\u003c/p\u003e\n\n\u003cp\u003eis there any issue with Migrating Working Copy.?\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2014-04-24 14:26:35.937 UTC","last_activity_date":"2014-04-24 14:35:43.007 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3563408","post_type_id":"1","score":"-1","tags":"svn|tortoisesvn","view_count":"214"} +{"id":"45462997","title":"Scaling Postgres database to handle parallel requests","body":"\u003cp\u003eI am using Postgres Database as primary database with Rails application. Currently the configuration for the database is: CPU - \u003cstrong\u003e8 cores\u003c/strong\u003e, RAM - \u003cstrong\u003e32 GB\u003c/strong\u003e, hosted on AWS. However I need to scale this server as I am facing a lot of serious bottlenecks.\u003c/p\u003e\n\n\u003cp\u003eI need to be able to handle 10000 parallel requests to this server. Even if this is not achievable I at-least need to know what would be the maximum number that this database can handle. The requests includes complex \u003cstrong\u003eSELECT\u003c/strong\u003e and \u003cstrong\u003eUPDATE\u003c/strong\u003e queries.\u003c/p\u003e\n\n\u003cp\u003eI have changed settings such as \u003cstrong\u003emax_connections\u003c/strong\u003e to \u003cstrong\u003e10000\u003c/strong\u003e and in the \u003ccode\u003erails_config/database.yml\u003c/code\u003e the \u003cstrong\u003econnection_pool\u003c/strong\u003e is set to \u003cstrong\u003e10000\u003c/strong\u003e.\u003c/p\u003e\n\n\u003cp\u003eI am running a rails code which currently runs in 50 parallel threads. The code runs fine for a while until I receive this error:\n\u003ccode\u003ePG::ConnectionBad: PQsocket() can't get socket descriptor\u003c/code\u003e. After this when I log into the postgres server and try to execute something, I get this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edb_production=# select id from product_tbl limit 5;\nWARNING: terminating connection because of crash of another server process\nDETAIL: The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory.\nHINT: In a moment you should be able to reconnect to the database and repeat your command.\nserver closed the connection unexpectedly\n This probably means the server terminated abnormally\n before or while processing the request.\nThe connection to the server was lost. Attempting reset: Succeeded.\ndb_production=#\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAfter this restarting the rails code also works fine but only for a while until I again receive the same error.\nI looked at the CPU usage while the threads are running. Some observations:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eOne SELECT query uses all the CPU (shows 100% usage) for one core, the rest are sitting idle at 0%. This can be inferred because when only one process or query is running, only one CPU shows 95-100% usage. \u003cstrong\u003eDoes this mean I will only be able to run 8 queries or threads in parallel as there are only 8 cores?\u003c/strong\u003e\u003c/li\u003e\n\u003cli\u003eRAM is kept underutilized. Even when 7 out of 8 queries or threads are running in parallel, the RAM used is only around 3 GB. \u003cstrong\u003eCan I somehow increase this and accommodate more parallel queries?\u003c/strong\u003e\u003c/li\u003e\n\u003cli\u003eFor every running thread, this is the configuration: \u003cstrong\u003evirtual memory usage-\u003e751M\u003c/strong\u003e, \u003cstrong\u003eresident memory usage-\u003e154-158M\u003c/strong\u003e, \u003cstrong\u003eshared memory used-\u003e149-150M\u003c/strong\u003e, \u003cstrong\u003eCPU%-\u003e60-100%\u003c/strong\u003e, \u003cstrong\u003eMEM%-\u003e0.5-0.6%\u003c/strong\u003e. Is everything right here or I need to tweak some settings to make use of the resources more effectively?\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eWhat are the configuration settings I need to change in order to scale the database? What must be the ideal number of threads such that I at-least don't receive the connection error? What are the checks and steps to scale the database to handle large parallel connections? How can I make full use of the available resources?\u003c/p\u003e","answer_count":"0","comment_count":"4","creation_date":"2017-08-02 13:58:08.143 UTC","last_activity_date":"2017-08-02 13:58:08.143 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7321201","post_type_id":"1","score":"1","tags":"database|multithreading|postgresql|parallel-processing|scaling","view_count":"86"} +{"id":"13272723","title":"Create indexable non-repeating combinations with fixed length","body":"\u003cp\u003eBased on this question\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://stackoverflow.com/questions/12035147/ordered-fixed-length-combinations-of-a-string\"\u003eOrdered Fixed Length Combination of a String\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI created a PHP algorithm that creates combinations of characters on a fixed length (basically a rewrite of the Java-answer)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate function getCombination($length, $input) {\n $result = array();\n\n if ($length == 0) {\n return $result;\n }\n\n $first = substr($input, 0, $length);\n $result[] = $first;\n\n if (strlen($input) == $length) {\n return $result;\n }\n\n $tails = $this-\u0026gt;getCombination($length - 1, substr($input, 1));\n\n foreach ($tails as $tail) {\n $tmp = substr($input, 0, 1) . $tail;\n\n if (!in_array($tmp, $result)) {\n $result[] = $tmp;\n }\n }\n\n return array_merge($result, $this-\u0026gt;getCombination($length, substr($input, 1)));\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFor another question, \u003ca href=\"https://stackoverflow.com/questions/13175257\"\u003eCreate fixed length non-repeating permutation of larger set\u003c/a\u003e, I was given a (brilliant) algorithm that would make permutations indexable, effectively making them adressable by providing a \"key\" that would always produce the exact same permutation, when given the same set of characters and the same length.\u003c/p\u003e\n\n\u003cp\u003eWell, now I basically need the same but for combinations, in contrast to permutations as in my other question.\u003c/p\u003e\n\n\u003cp\u003eCan the algorithm above be modified in the same way? Meaning to create a function like\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic function getCombinationByIndex($length, $index);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThat will return \u003cstrong\u003eone\u003c/strong\u003e combination out of the thousand possible that is created with the algorithm \u003cstrong\u003ewithout creating them beforehand\u003c/strong\u003e?\u003c/p\u003e","accepted_answer_id":"13274837","answer_count":"1","comment_count":"0","creation_date":"2012-11-07 15:24:26.223 UTC","last_activity_date":"2012-11-07 17:20:28.04 UTC","last_edit_date":"2017-05-23 10:24:41.733 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"204693","post_type_id":"1","score":"2","tags":"php|algorithm|combinations","view_count":"518"} +{"id":"36523208","title":"Rails \"redirect_to\" Nested routes with latest model","body":"\u003cp\u003eIn my rails app I have two models nested, \nGameround \u003e currentplayer\u003c/p\u003e\n\n\u003cp\u003eGameround is shown on play.html.erb, I also make the currentplayers there. When the currentplayer is made I want to redirect the user to currentplayer#show but I can't seem to figure out the way to route the link. I've tried everything I can think of.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eSo I need a link that says:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eGet url to thiscurrentGameround/ThiscurrentplayerIjustmade\u003c/p\u003e\n\n\u003cp\u003eMy controller:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef createPlayerforUser\n\n @latest_game_round = Gameround.order(created_at: :desc).first\n @currentplayer = @latest_game_round.currentplayers.create({\n log_id: @current_user.id\n });\n\n if @currentplayer.save\n\n redirect_to url_for([@gameround, @currentplayer])\n end\n\n end\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003econfig.routes \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e resources :gamerounds do \n resources :currentplayers\n end \n resources :gamesessions\n # The priority is based upon order of creation: first created -\u0026gt; highest priority.\n # See how all your routes lay out with \"rake routes\".\n\n # Artikkel, Alien liste\n resources :expansions do\n resources :aliens\n end\n\n resources :users\n\n # You can have the root of your site routed with \"root\"\n #root 'gamesessions#play'\n root 'gamesessions#new'\n #root 'application#show'\n #root 'public#index'\n get \"signup\", :to =\u0026gt; \"users#new\"\n get \"login\", :to =\u0026gt; \"sessions#login\"\n post \"login_attempt\", :to =\u0026gt; \"sessions#login_attempt\"\n get \"logout\", :to =\u0026gt; \"sessions#logout\"\n get \"profile\", :to =\u0026gt; \"sessions#profile\"\n get \"setting\", :to =\u0026gt; \"sessions#setting\"\n get \"play\", :to =\u0026gt; \"gamesessions#play\"\n get \"wait\", :to =\u0026gt; \"gamesessions#wait\"\n get \"aliens\", :to =\u0026gt; \"aliens#index\"\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"36523328","answer_count":"1","comment_count":"2","creation_date":"2016-04-09 21:57:14.73 UTC","last_activity_date":"2016-04-09 22:29:35.853 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6148446","post_type_id":"1","score":"0","tags":"ruby-on-rails","view_count":"29"} +{"id":"13205372","title":"haml code how to make it has some indention","body":"\u003cp\u003eI have the following code that displaying element like below\u003cbr\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Mytable\n1. line1\n2. line2\n3. line3\n4. line4\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut I want it have indention, like belows\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Mytable\n 1. line1\n 2. line2\n 3. line3\n 4. line4\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy code is at here\u003cbr\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e %div{:class =\u0026gt; 'test1'}\n %table#tablename\n %thead\n %tr\n %th.lead Mytable\n\n %tbody \n %tr\n %center\n %td 1.line1\n %tr\n %td 2. line2\n %tr \n %td 3. line3\n %tr\n %td 4. line4\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"13205409","answer_count":"2","comment_count":"0","creation_date":"2012-11-03 02:20:43.267 UTC","last_activity_date":"2012-11-03 02:29:17.61 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1691538","post_type_id":"1","score":"2","tags":"css|ruby-on-rails|haml","view_count":"186"} +{"id":"33574198","title":"How to solve SSL Handshake exception/signature does not match exception in mule esb when using web service consumer?","body":"\u003cp\u003eI am trying to send request to a secure web service(2 way ssl) using web consumer. Here is what I have done. I have used self signed certificates for testing purpose which 2 way ssl is tested with soap-ui.\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003e\u003cp\u003eimported web service in web service consumer using local references.\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eUnder references added https configuration with host, port\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eUnder TLS/SSL details added keystore details like location of keystore and password in both the places.\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eTested the secure service with soap-ui by providing keystore information successfully.\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eThe same keystore which is used in soap-ui is configured in mule esb\u003c/p\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003ewhile running the request I am getting the following error. Can any one provide me solution\u003c/p\u003e\n\n\u003cp\u003econfiguration XML as below\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;ws:consumer-config name=\"Web_Service_Consumer\" wsdlLocation=\"HelloWorld.wsdl\" service=\"helloworld_client_ep\" port=\"HelloWorld_pt\" serviceAddress=\"https://localhost:8002/soa-infra/services/default/HelloWorld/helloworld_client_ep\" doc:name=\"Web Service Consumer\" connectorConfig=\"HTTP_Request_Configuration\"/\u0026gt;\n \u0026lt;data-mapper:config name=\"String_To_XML\" transformationGraphPath=\"string_to_xml.grf\" doc:name=\"String_To_XML\"/\u0026gt;\n \u0026lt;http:request-config name=\"HTTP_Request_Configuration\" protocol=\"HTTPS\" host=\"localhost\" port=\"8002\" doc:name=\"HTTP Request Configuration\" tlsContext-ref=\"TLS_Context\"\u0026gt;\n \u0026lt;/http:request-config\u0026gt;\n \u0026lt;tls:context name=\"TLS_Context\" doc:name=\"TLS Context\"\u0026gt;\n \u0026lt;tls:key-store path=\"client.jks\" password=\"welcome1\" keyPassword=\"welcome1\"/\u0026gt;\n \u0026lt;/tls:context\u0026gt;\n\n\n\n Caused by: javax.net.ssl.SSLHandshakeException: General SSLEngine problem\n at sun.security.ssl.Alerts.getSSLException(Unknown Source) ~[?:1.7.0_65]\n at sun.security.ssl.SSLEngineImpl.fatal(Unknown Source) ~[?:1.7.0_65]\n at sun.security.ssl.Handshaker.fatalSE(Unknown Source) ~[?:1.7.0_65]\n at sun.security.ssl.Handshaker.fatalSE(Unknown Source) ~[?:1.7.0_65]\n at sun.security.ssl.ClientHandshaker.serverCertificate(Unknown Source) ~[?:1.7.0_65]\n at sun.security.ssl.ClientHandshaker.processMessage(Unknown Source) ~[?:1.7.0_65]\n at sun.security.ssl.Handshaker.processLoop(Unknown Source) ~[?:1.7.0_65]\n at sun.security.ssl.Handshaker$1.run(Unknown Source) ~[?:1.7.0_65]\n at sun.security.ssl.Handshaker$1.run(Unknown Source) ~[?:1.7.0_65]\n at java.security.AccessController.doPrivileged(Native Method) ~[?:1.7.0_65]\n at sun.security.ssl.Handshaker$DelegatedTask.run(Unknown Source) ~[?:1.7.0_65]\n at org.glassfish.grizzly.ssl.SSLUtils.executeDelegatedTask(SSLUtils.java:247) ~[grizzly-framework-2.3.16.jar:2.3.16]\n at org.glassfish.grizzly.ssl.SSLBaseFilter.doHandshakeStep(SSLBaseFilter.java:638) ~[grizzly-framework-2.3.16.jar:2.3.16]\n at org.glassfish.grizzly.ssl.SSLFilter.doHandshakeStep(SSLFilter.java:312) ~[grizzly-framework-2.3.16.jar:2.3.16]\n at org.glassfish.grizzly.ssl.SSLBaseFilter.doHandshakeStep(SSLBaseFilter.java:552) ~[grizzly-framework-2.3.16.jar:2.3.16]\n at org.glassfish.grizzly.ssl.SSLBaseFilter.handleRead(SSLBaseFilter.java:273) ~[grizzly-framework-2.3.16.jar:2.3.16]\n at com.ning.http.client.providers.grizzly.GrizzlyAsyncHttpProvider$SwitchingSSLFilter.handleRead(GrizzlyAsyncHttpProvider.java:2702) ~[async-http-client-1.8.14.jar:?]\n at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119) ~[grizzly-framework-2.3.16.jar:2.3.16]\n at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284) ~[grizzly-framework-2.3.16.jar:2.3.16]\n at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201) ~[grizzly-framework-2.3.16.jar:2.3.16]\n at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133) ~[grizzly-framework-2.3.16.jar:2.3.16]\n at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112) ~[grizzly-framework-2.3.16.jar:2.3.16]\n at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77) ~[grizzly-framework-2.3.16.jar:2.3.16]\n at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561) ~[grizzly-framework-2.3.16.jar:2.3.16]\n at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112) ~[grizzly-framework-2.3.16.jar:2.3.16]\n at org.glassfish.grizzly.strategies.SameThreadIOStrategy.executeIoEvent(SameThreadIOStrategy.java:103) ~[grizzly-framework-2.3.16.jar:2.3.16]\n at org.glassfish.grizzly.strategies.AbstractIOStrategy.executeIoEvent(AbstractIOStrategy.java:89) ~[grizzly-framework-2.3.16.jar:2.3.16]\n at org.glassfish.grizzly.nio.SelectorRunner.iterateKeyEvents(SelectorRunner.java:414) ~[grizzly-framework-2.3.16.jar:2.3.16]\n at org.glassfish.grizzly.nio.SelectorRunner.iterateKeys(SelectorRunner.java:383) ~[grizzly-framework-2.3.16.jar:2.3.16]\n at org.glassfish.grizzly.nio.SelectorRunner.doSelect(SelectorRunner.java:347) ~[grizzly-framework-2.3.16.jar:2.3.16]\n at org.glassfish.grizzly.nio.SelectorRunner.run(SelectorRunner.java:278) ~[grizzly-framework-2.3.16.jar:2.3.16]\n at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565) ~[grizzly-framework-2.3.16.jar:2.3.16]\n at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545) ~[grizzly-framework-2.3.16.jar:2.3.16]\n ... 1 more\n Caused by: sun.security.validator.ValidatorException: Certificate signature validation failed\n at sun.security.validator.SimpleValidator.engineValidate(Unknown Source) ~[?:1.7.0_65]\n at sun.security.validator.Validator.validate(Unknown Source) ~[?:1.7.0_65]\n at sun.security.ssl.X509TrustManagerImpl.validate(Unknown Source) ~[?:1.7.0_65]\n at sun.security.ssl.X509TrustManagerImpl.checkTrusted(Unknown Source) ~[?:1.7.0_65]\n at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source) ~[?:1.7.0_65]\n at sun.security.ssl.ClientHandshaker.serverCertificate(Unknown Source) ~[?:1.7.0_65]\n at sun.security.ssl.ClientHandshaker.processMessage(Unknown Source) ~[?:1.7.0_65]\n at sun.security.ssl.Handshaker.processLoop(Unknown Source) ~[?:1.7.0_65]\n at sun.security.ssl.Handshaker$1.run(Unknown Source) ~[?:1.7.0_65]\n at sun.security.ssl.Handshaker$1.run(Unknown Source) ~[?:1.7.0_65]\n at java.security.AccessController.doPrivileged(Native Method) ~[?:1.7.0_65]\n at sun.security.ssl.Handshaker$DelegatedTask.run(Unknown Source) ~[?:1.7.0_65]\n at org.glassfish.grizzly.ssl.SSLUtils.executeDelegatedTask(SSLUtils.java:247) ~[grizzly-framework-2.3.16.jar:2.3.16]\n at org.glassfish.grizzly.ssl.SSLBaseFilter.doHandshakeStep(SSLBaseFilter.java:638) ~[grizzly-framework-2.3.16.jar:2.3.16]\n at org.glassfish.grizzly.ssl.SSLFilter.doHandshakeStep(SSLFilter.java:312) ~[grizzly-framework-2.3.16.jar:2.3.16]\n at org.glassfish.grizzly.ssl.SSLBaseFilter.doHandshakeStep(SSLBaseFilter.java:552) ~[grizzly-framework-2.3.16.jar:2.3.16]\n at org.glassfish.grizzly.ssl.SSLBaseFilter.handleRead(SSLBaseFilter.java:273) ~[grizzly-framework-2.3.16.jar:2.3.16]\n at com.ning.http.client.providers.grizzly.GrizzlyAsyncHttpProvider$SwitchingSSLFilter.handleRead(GrizzlyAsyncHttpProvider.java:2702) ~[async-http-client-1.8.14.jar:?]\n at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119) ~[grizzly-framework-2.3.16.jar:2.3.16]\n at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284) ~[grizzly-framework-2.3.16.jar:2.3.16]\n at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201) ~[grizzly-framework-2.3.16.jar:2.3.16]\n at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133) ~[grizzly-framework-2.3.16.jar:2.3.16]\n at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112) ~[grizzly-framework-2.3.16.jar:2.3.16]\n at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77) ~[grizzly-framework-2.3.16.jar:2.3.16]\n at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561) ~[grizzly-framework-2.3.16.jar:2.3.16]\n at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112) ~[grizzly-framework-2.3.16.jar:2.3.16]\n at org.glassfish.grizzly.strategies.SameThreadIOStrategy.executeIoEvent(SameThreadIOStrategy.java:103) ~[grizzly-framework-2.3.16.jar:2.3.16]\n at org.glassfish.grizzly.strategies.AbstractIOStrategy.executeIoEvent(AbstractIOStrategy.java:89) ~[grizzly-framework-2.3.16.jar:2.3.16]\n at org.glassfish.grizzly.nio.SelectorRunner.iterateKeyEvents(SelectorRunner.java:414) ~[grizzly-framework-2.3.16.jar:2.3.16]\n at org.glassfish.grizzly.nio.SelectorRunner.iterateKeys(SelectorRunner.java:383) ~[grizzly-framework-2.3.16.jar:2.3.16]\n at org.glassfish.grizzly.nio.SelectorRunner.doSelect(SelectorRunner.java:347) ~[grizzly-framework-2.3.16.jar:2.3.16]\n at org.glassfish.grizzly.nio.SelectorRunner.run(SelectorRunner.java:278) ~[grizzly-framework-2.3.16.jar:2.3.16]\n at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565) ~[grizzly-framework-2.3.16.jar:2.3.16]\n at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545) ~[grizzly-framework-2.3.16.jar:2.3.16]\n ... 1 more\n Caused by: java.security.SignatureException: Signature does not match.\n at sun.security.x509.X509CertImpl.verify(Unknown Source) ~[?:1.7.0_65]\n at sun.security.x509.X509CertImpl.verify(Unknown Source) ~[?:1.7.0_65]\n at sun.security.validator.SimpleValidator.engineValidate(Unknown Source) ~[?:1.7.0_65]\n ERROR 2015-11-05 16:00:55,321 [[ACATransmitterService].ACATransmitterServiceFlow.stage1.02] org.mule.exception.CatchMessagingExceptionStrategy: \n ********************************************************************************\n Message : Error sending HTTP request. Message payload is of type: byte[]\n Code : MULE_ERROR--2\n --------------------------------------------------------------------------------\n Exception stack is:\n 1. Signature does not match. (java.security.SignatureException)\n sun.security.x509.X509CertImpl:-1 (null)\n 2. Certificate signature validation failed (sun.security.validator.ValidatorException)\n sun.security.validator.SimpleValidator:-1 (null)\n 3. General SSLEngine problem (javax.net.ssl.SSLHandshakeException)\n sun.security.ssl.Alerts:-1 (http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/net/ssl/SSLHandshakeException.html)\n 4. General SSLEngine problem (javax.net.ssl.SSLHandshakeException)\n sun.security.ssl.Handshaker:-1 (http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/net/ssl/SSLHandshakeException.html)\n 5. javax.net.ssl.SSLHandshakeException: General SSLEngine problem (java.util.concurrent.ExecutionException)\n org.glassfish.grizzly.impl.SafeFutureImpl$Sync:363 (null)\n 6. java.util.concurrent.ExecutionException: javax.net.ssl.SSLHandshakeException: General SSLEngine problem (java.io.IOException)\n org.mule.module.http.internal.request.grizzly.GrizzlyHttpClient:274 (null)\n 7. Error sending HTTP request. Message payload is of type: byte[] (org.mule.api.MessagingException)\n org.mule.module.http.internal.request.DefaultHttpRequester:190 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html)\n --------------------------------------------------------------------------------\n Root Exception stack trace:\n java.security.SignatureException: Signature does not match.\n at sun.security.x509.X509CertImpl.verify(Unknown Source)\n at sun.security.x509.X509CertImpl.verify(Unknown Source)\n at sun.security.validator.SimpleValidator.engineValidate(Unknown Source)\n + 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"2","creation_date":"2015-11-06 19:25:12.73 UTC","last_activity_date":"2015-11-07 01:25:09.013 UTC","last_edit_date":"2015-11-07 01:25:09.013 UTC","last_editor_display_name":"","last_editor_user_id":"5464197","owner_display_name":"","owner_user_id":"5464197","post_type_id":"1","score":"1","tags":"java|ssl|mule|esb|anypoint-studio","view_count":"832"} +{"id":"7022442","title":"SQL: problem word count with len()","body":"\u003cp\u003eI am trying to count words of text that is written in a column of table. Therefor I am using the following query.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT LEN(ExtractedText) - \nLEN(REPLACE(ExtractedText, ' ', '')) + 1 from EDDSDBO.Document where ID='100'.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI receive a wrong result that is much to high. \nOn the other hand, if I copy the text directly into the statement then it works, i.e.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT LEN('blablabla text') - LEN(REPLACE('blablabla text', ' ', '')) + 1.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow the datatype is \u003ccode\u003envarchar(max)\u003c/code\u003e since the text is very long. I have already tried to convert the column into \u003ccode\u003etext\u003c/code\u003e or \u003ccode\u003entext\u003c/code\u003e and to apply \u003ccode\u003edatalength()\u003c/code\u003e instead of \u003ccode\u003elen()\u003c/code\u003e. Nevertheless I obtain the same result that it does work as a string but does not work from a table.\u003c/p\u003e","answer_count":"4","comment_count":"1","creation_date":"2011-08-11 07:40:49.85 UTC","favorite_count":"0","last_activity_date":"2017-04-20 11:29:01.577 UTC","last_edit_date":"2011-08-11 07:48:52.123 UTC","last_editor_display_name":"","last_editor_user_id":"877097","owner_display_name":"","owner_user_id":"889436","post_type_id":"1","score":"4","tags":"sql|sql-server|tsql","view_count":"2954"} +{"id":"27029465","title":"Visual Studio Community 2013 Graphics Debugging","body":"\u003cp\u003eI wrote a desktop app in Visual Studio 2013 Community, the one that just came out and I am trying to use the graphics debugger. The problem I am having is that when I start up the debugger the program, the program never gets to the first frame, it only shows a white screen. Also, there is no output to the debugging interfaces. The program runs fine and the DirectX10 Graphics work fine when I do not use the graphics debugger. I have tried setting the compiler to mixed and that didn't seem to change anything. I also searched around for locale issues as I found that could be a possible issue but it didn't seem to make a difference either. Any ideas on what I need to change or setup or fix?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eIt worked correctly one time but I am having trouble getting it to work again. The message in the diagnostics hub is: Profiling of 'Graphics Frame Capture' started.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-11-20 00:06:39.21 UTC","last_activity_date":"2015-01-26 19:12:41.393 UTC","last_edit_date":"2014-11-20 03:18:45.93 UTC","last_editor_display_name":"","last_editor_user_id":"2226786","owner_display_name":"","owner_user_id":"2226786","post_type_id":"1","score":"0","tags":"c++|visual-studio-2013|directx-10","view_count":"282"} +{"id":"24659607","title":"mysql left join limit not working as expected","body":"\u003cp\u003ebasically what I'm trying to do is limit my responses to 5 per comment in my query\u003c/p\u003e\n\n\u003cp\u003e\u003cb\u003eMy following query\u003c/b\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT comments.id, comments.comment, \nreplies.id reply_id, replies.comment_id, replies.reply\nFROM comments\nLEFT JOIN (SELECT id FROM replies LIMIT 3) replies \nON comments.id = replies.comment_id\nWHERE comments.user_id = ? ORDER BY comments.id DESC LIMIT 3\n\n$comments = array();\n$comm_replies = array();\n\nwhile($row = $query-\u0026gt;fetch(PDO::FETCH_ASSOC)) {\n\n$comm_id = $row['id'];\n$comm_user_id = $row['user_id']; \n$comm = $row['comment'];\n\nif (empty($row['reply_id'])) {\n continue; \n}\n\n$comments[$comm_id] = $comm;\n$comm_replies[$comm_id][] = $row;\n}\n\nforeach ($comments as $comm_id =\u0026gt; $comm) {\necho \"comment - $comm\\n\";\nif (!isset($comm_replies[$comm_id])) {\n continue;\n}\n\n$prefix = '---';\nforeach ($comm_replies[$comm_id] as $reply_id =\u0026gt; $row) {\n echo \"$prefix $row['reply_id'], $row['reply']\\n\";\n $prefix .= '-';\n}\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cb\u003eSo what I'm trying to output is the following:\u003c/b\u003e\u003c/p\u003e\n\n\u003cp\u003e1.Question One\u003cbr\u003e\n---First Response\u003cbr\u003e\n---Second Response\u003cbr\u003e\n---Third Response\u003cbr\u003e\u003c/p\u003e\n\n\u003cp\u003e2.Question Two\u003cbr\u003e\n---First Response\u003cbr\u003e\n---Second Response\u003cbr\u003e\n---Third Response\u003cbr\u003e\u003c/p\u003e\n\n\u003cp\u003e3.Question Three\u003cbr\u003e\n---First Response\u003cbr\u003e\n---Second Response\u003cbr\u003e\n---Third Response\u003cbr\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cb\u003eInstead What i get is this:\u003c/b\u003e\u003c/p\u003e\n\n\u003cp\u003e1.Question One\u003cbr\u003e\n---First Response\u003cbr\u003e\n---Second Response\u003cbr\u003e\u003c/p\u003e\n\n\u003cp\u003eI'm not sure why its out putting just the first question and 2 responds. \u003c/p\u003e\n\n\u003cp\u003eThanks for any help in advance. \u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-07-09 16:58:06.67 UTC","last_activity_date":"2014-07-09 17:19:49.08 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3743346","post_type_id":"1","score":"0","tags":"php|mysql","view_count":"71"} +{"id":"4503328","title":"Wcf data service - 401 error","body":"\u003cp\u003eIm building a public web site where you need to be logged in and i have been using asmx-services up to now. Now i want to try Wcf data service instead and query the service via jQuery.\u003c/p\u003e\n\n\u003cp\u003eIt all works fine on localhost but once i publish my web site i get this error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e401 - Unauthorized: Access is denied due to invalid credentials.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have mapped my database using Entity Data Model and then i created a wcf data service which is connected to my Data Model like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class MyService : DataService\u0026lt;MyEntities\u0026gt;\n{\n // This method is called only once to initialize service-wide policies.\n public static void InitializeService(DataServiceConfiguration config)\n {\n\n config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2;\n\n config.SetEntitySetAccessRule(\"*\", EntitySetRights.AllRead);\n\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhere MyEntities is specified when mapping my Entity Data Model to my database.\u003c/p\u003e\n\n\u003cp\u003eAs i wrote, it all works fine on localhost, i can query my service like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e $.ajax({\n type: \"GET\",\n url: \"/OData/MyService.svc/Groups\",\n data: \"{}\",\n contentType: \"application/json; charset=utf-8\",\n dataType: \"json\",\n success: function (data) {\n//some logic\n}});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut when i use the published version I get the 401-error. (i get the same error when writing the query directly in the browser)\u003c/p\u003e\n\n\u003cp\u003eI'm really green using Wcf-services so i really need help to make this work, i have tried to Google but with no luck. Do i need to do any configuration in my service or in web.config or in the IIS?\u003c/p\u003e\n\n\u003cp\u003eIm using IIS 7.0 and asp.net 4.0\u003c/p\u003e","accepted_answer_id":"4503857","answer_count":"2","comment_count":"2","creation_date":"2010-12-21 19:55:25.62 UTC","last_activity_date":"2010-12-21 22:44:33.513 UTC","last_edit_date":"2010-12-21 20:14:52.98 UTC","last_editor_display_name":"","last_editor_user_id":"265561","owner_display_name":"","owner_user_id":"265561","post_type_id":"1","score":"1","tags":"jquery|wcf|authentication|http-status-code-401","view_count":"2639"} +{"id":"20295579","title":"How to nest multiple parfor loops","body":"\u003cp\u003e\u003ccode\u003eparfor\u003c/code\u003e is a convenient way to distribute independent iterations of intensive computations among several \"workers\". One meaningful restriction is that \u003ccode\u003eparfor\u003c/code\u003e-loops cannot be nested, and invariably, that is the answer to similar questions like \u003ca href=\"https://stackoverflow.com/questions/13444745/converting-nested-for-loops-to-parfor-loop-matlab\"\u003ethere\u003c/a\u003e and \u003ca href=\"https://stackoverflow.com/questions/19193542/using-parfor-in-matlab-for-nested-loops\"\u003ethere\u003c/a\u003e.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eWhy parallelization across loop boundaries is so desirable\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eConsider the following piece of code where iterations take a highly variable amount of time on a machine that allows 4 workers. Both loops iterate over 6 values, clearly hard to share among 4.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efor row = 1:6\n parfor col = 1:6\n somefun(row, col);\n end\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt seems like a good idea to choose the inner loop for \u003ccode\u003eparfor\u003c/code\u003e because individual calls to \u003ccode\u003esomefun\u003c/code\u003e are more variable than iterations of the outer loop. But what if the run time for each call to \u003ccode\u003esomefun\u003c/code\u003e is very similar? What if there are trends in run time and we have three nested loops? These questions come up regularly, and people go to \u003ca href=\"https://stackoverflow.com/questions/19844249/predicting-runtime-of-parallel-loop-using-a-priori-estimate-of-effort-per-iteran\"\u003eextremes\u003c/a\u003e.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003ePattern needed for combining loops\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eIdeally, \u003ccode\u003esomefun\u003c/code\u003e is run for all pairs of \u003ccode\u003erow\u003c/code\u003e and \u003ccode\u003ecol\u003c/code\u003e, and workers should get busy irrespectively of which iterand is being varied. The solution should look like\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eparfor p = allpairs(1:6, 1:6)\n somefun(p(1), p(2));\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eUnfortunately, even if I knew which builtin function creates a matrix with all combinations of \u003ccode\u003erow\u003c/code\u003e and \u003ccode\u003ecol\u003c/code\u003e, MATLAB would complain with an error \u003cem\u003eThe range of a parfor statement must be a row vector.\u003c/em\u003e Yet, \u003ccode\u003efor\u003c/code\u003e would not complain and nicely iterate over columns. An easy workaround would be to create that matrix and then index it with \u003ccode\u003eparfor\u003c/code\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ep = allpairs(1:6, 1:6);\nparfor k = 1:size(pairs, 2)\n row = p(k, 1);\n col = p(k, 2);\n somefun(row, col);\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat is the builtin function in place of \u003ccode\u003eallpairs\u003c/code\u003e that I am looking for? Is there a convenient \u003cem\u003eidiomatic pattern\u003c/em\u003e that someone has come up with?\u003c/p\u003e","accepted_answer_id":"20295693","answer_count":"3","comment_count":"0","creation_date":"2013-11-30 01:43:27.27 UTC","favorite_count":"5","last_activity_date":"2016-02-22 21:57:52.513 UTC","last_edit_date":"2017-05-23 12:09:30.28 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"1916766","post_type_id":"1","score":"4","tags":"matlab|nested-loops|parfor","view_count":"3912"} +{"id":"46502818","title":"Fill a row with formula using non-blank cell as input","body":"\u003cp\u003eI want to make a workbook using the \u003ca href=\"http://www.coolprop.org/\" rel=\"nofollow noreferrer\"\u003eCoolProp\u003c/a\u003e library that helps me calculate the properties of a fluid.A fluid has many different properties (density, temperature, pressure, entropy...) and given any 2 of them you can calculate the others. \u003c/p\u003e\n\n\u003cp\u003eKnowing this, I've made a column for each property, and a row for each state I want to calculate. \nWhat I would want for Excel to do is to automatically detect which columns (properties) have been filled and apply the PropsSI formula (that comes with CoolProp) to the ones that are blank. However, the problem is you have to tell the PropsSI formula the properties you're giving it, so Excel would also have to change the syntax depending on which columns have been filled.\u003c/p\u003e\n\n\u003cp\u003eI'm guessing vba programming is the only way I could do something like this, but still can't think of any way of doing it without using huge conditionals to check for every possible option. Is there any other way?\u003c/p\u003e\n\n\u003cp\u003eIn case you find it useful, here's the syntax of the PropsSI formula:\u003c/p\u003e\n\n\u003cp\u003ePropSI(\"NAME OF PROPERTY WANTED\",\"NAME OF PROPERTY GIVEN 1\", VALUE, \"NAME OF PROPERTY GIVEN 2\", VALUE, \"NAME OF FLUID\")\u003c/p\u003e","answer_count":"0","comment_count":"4","creation_date":"2017-09-30 12:43:16.993 UTC","last_activity_date":"2017-09-30 12:43:16.993 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1644268","post_type_id":"1","score":"0","tags":"excel|vba|excel-vba|excel-formula","view_count":"59"} +{"id":"13993430","title":"is there other way to source iframe value?","body":"\u003cp\u003eis there other way to use iframe for showing the retrieved mysql database query result?\u003c/p\u003e\n\n\u003cp\u003ei have these codes now but it's not working,\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;iframe id=\"editor\" style=\"width:500px; height:300px;\" value=\"\u0026lt;?=$textContent?\u0026gt;\"\u0026gt;\u0026lt;/iframe\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut when i tried it on textarea, it shows the query result.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;textarea value=\"\u0026lt;?=$textContent?\u0026gt;\"\u0026gt; \u0026lt;/textarea\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ehere's my database query if it would be helpful,\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php \n// Connect to server and select database.\n\n$query=\"SELECT * FROM text_tb WHERE textID ='\".$textID.\"'\"; \n$result=mysql_query($query);\nwhile($row=mysql_fetch_array($result)) { \n $textID = $row['textID'];\n $textContent = $row['textContent'];\n } \n?\u0026gt; \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethank you for the help.\u003c/p\u003e","accepted_answer_id":"13993589","answer_count":"1","comment_count":"3","creation_date":"2012-12-21 16:09:19.503 UTC","last_activity_date":"2012-12-21 16:51:40.577 UTC","last_edit_date":"2012-12-21 16:51:40.577 UTC","last_editor_display_name":"","last_editor_user_id":"1528231","owner_display_name":"","owner_user_id":"1528231","post_type_id":"1","score":"-1","tags":"php|mysql|iframe","view_count":"364"} +{"id":"5692761","title":"How to support landscape mode in uiwebview video tag?","body":"\u003cp\u003eI am loading a mp4 video file from a url using the video tag into a uiwebview:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;body style=\\\"margin:0\\\"\u0026gt;\u0026lt;video src=\\\"%@\\\" width=\\\"285\\\" height=\\\"203\\\" \nposter=\\\"%@\\\" autoplay=\\\"autoplay\\\" controls=\\\"controls\\\"\u0026gt;\u0026lt;/video\u0026gt;\u0026lt;/body\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever the video plays only in portait mode using the QuickTime player. How can i make the video play in landscape too?\u003c/p\u003e\n\n\u003cp\u003eI cannot override the function to support orientation as my application is portrait mode based, but since video starts in full screen mode, I want it to support both orientations.\u003c/p\u003e\n\n\u003cp\u003eYoutube player supports both orientations though. So are there any options to get both orientations working?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2011-04-17 09:39:17.743 UTC","last_activity_date":"2011-04-21 08:25:41.107 UTC","last_edit_date":"2011-04-18 07:27:52.863 UTC","last_editor_display_name":"","last_editor_user_id":"372026","owner_display_name":"","owner_user_id":"372026","post_type_id":"1","score":"2","tags":"iphone|objective-c|uiwebview","view_count":"2527"} +{"id":"42049283","title":"d3 line chart, line not drawing","body":"\u003cp\u003eI'm trying to mimic the simple blocks example \u003ca href=\"https://bl.ocks.org/mbostock/3883245\" rel=\"nofollow noreferrer\"\u003ehere\u003c/a\u003e, however I only seem to get the x and y axis to draw, no sign of the line. I'm loading data differently, via an array rather than a tsv file, though I've combed through a few times and I think everything is feeding into the scales and the line the same way. Non-working JSBin \u003ca href=\"https://jsbin.com/gequmowonu/edit?html,js,output\" rel=\"nofollow noreferrer\"\u003ehere\u003c/a\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;!DOCTYPE html\u0026gt;\n\u0026lt;html\u0026gt;\n\u0026lt;head\u0026gt;\n \u0026lt;script src=\"https://d3js.org/d3.v4.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;meta charset=\"utf-8\"\u0026gt;\n \u0026lt;meta name=\"viewport\" content=\"width=device-width\"\u0026gt;\n \u0026lt;title\u0026gt;JS Bin\u0026lt;/title\u0026gt;\n\u0026lt;/head\u0026gt;\n\u0026lt;body\u0026gt;\n\u0026lt;svg width=\"960\" height=\"500\"\u0026gt;\u0026lt;/svg\u0026gt;\n\n\u0026lt;script\u0026gt;\nvar data = [[\"2014-12-31\", 0.31999999999999],[\"2014-11-30\", 2.71],[\"2014-10-31\", -4.05],[\"2014-09-30\", 4.22],[\"2014-08-31\", 2.17],[\"2014-07-31\", 5.36],[\"2014-06-30\", 3.99],[\"2014-05-31\", 3.52],[\"2014-04-30\", -.46],[\"2014-03-31\", -8.22],[\"2014-02-28\", 5.89]]\n\nvar svg = d3.select(\"svg\"),\n margin = {top: 20, right: 20, bottom: 30, left: 50},\n width = +svg.attr(\"width\") - margin.left - margin.right,\n height = +svg.attr(\"height\") - margin.top - margin.bottom,\n g = svg.append(\"g\").attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\n\n\nvar parseTime = d3.timeParse(\"%Y-%m-%d\");\n\nvar x = d3.scaleTime().rangeRound([0, width]);\nvar y = d3.scaleLinear().rangeRound([height, 0]);\n\nvar data = data.map(function(d){\n return [parseTime(d[0]), +d[1]]\n});\nvar line = d3.line()\n .x(function(d){\n return d[0];\n })\n .y(function(d){\n return d[1];\n });\n\nx.domain(d3.extent(data, function(d) { return d[0]; }));\ny.domain(d3.extent(data, function(d) { return d[1]; }));\n\ng.append(\"g\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(d3.axisBottom(x))\n .select(\".domain\")\n .remove();\n\ng.append(\"g\")\n .call(d3.axisLeft(y))\n .append(\"text\")\n .attr(\"fill\", \"#000\")\n .attr(\"transform\", \"rotate(-90)\")\n .attr(\"y\", 50)\n .attr(\"dy\", \"0.9em\")\n .attr(\"text-anchor\", \"end\")\n .text(\"Price ($)\");\n\ng.append(\"path\")\n .datum(data)\n .attr(\"fill\", \"none\")\n .attr(\"stroke\", \"steelblue\")\n .attr(\"stroke-linejoin\", \"round\")\n .attr(\"stroke-linecap\", \"round\")\n .attr(\"stroke-width\", 3)\n .attr(\"d\", line);\n\u0026lt;/script\u0026gt;\n\n\u0026lt;/body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eanything obvious that I'm doing wrong? \u003c/p\u003e","accepted_answer_id":"42049380","answer_count":"1","comment_count":"0","creation_date":"2017-02-05 06:42:46.92 UTC","last_activity_date":"2017-02-05 06:57:54.62 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1051105","post_type_id":"1","score":"1","tags":"javascript|d3.js|svg","view_count":"170"} +{"id":"17178905","title":"How would I force Kernel#gets to use STDIN#gets in a rake task?","body":"\u003cp\u003eSo I'm trying to DRY up a Rake task which runs a script that takes user input, and \u003ca href=\"https://stackoverflow.com/questions/576799/how-do-i-use-gets-on-a-rake-task\"\u003eI've run into the same problem as this poster\u003c/a\u003e - by default, just calling \u003ccode\u003egets\u003c/code\u003e assumes that the rake argument (in this case, \u003ccode\u003edb:seed\u003c/code\u003e) is a file from which it should read, which of course doesn't exist. I got around this by just calling \u003ccode\u003eSTDIN.gets\u003c/code\u003e, which works fine, but I'd love to be able to just use \u003ccode\u003egets\u003c/code\u003e the way I can use \u003ccode\u003eputs\u003c/code\u003e (Rake seems to have no issue with \u003ccode\u003eSTDOUT\u003c/code\u003e by default) - as a static method.\u003c/p\u003e\n\n\u003cp\u003eIs there any way to force \u003ccode\u003eKernel#gets\u003c/code\u003e to read from \u003ccode\u003eSTDIN\u003c/code\u003e within Rake? (Or more generally, is there any way to force \u003ccode\u003eKernel#gets\u003c/code\u003e to read from \u003ccode\u003eSTDIN\u003c/code\u003e when it is ostensibly passed a command line argument?) Or would that be a bad practice?\u003c/p\u003e","accepted_answer_id":"27351652","answer_count":"1","comment_count":"2","creation_date":"2013-06-18 21:04:12.75 UTC","last_activity_date":"2014-12-08 04:55:14.263 UTC","last_edit_date":"2017-05-23 12:13:00.68 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"1459498","post_type_id":"1","score":"1","tags":"ruby-on-rails|ruby|rake","view_count":"131"} +{"id":"34142099","title":"Java selection sort not working correctly","body":"\u003cp\u003eI have just created an int[ ] class called 'Statistics' and it has two selection sort methods for listing the integers in a Statistics object (int[ ]) in ascending or descending order. When I use either of these methods they tend to work about half of the time and then not work the other half of the time. Here's a couple examples of what I mean:\u003c/p\u003e\n\n\u003cp\u003eNew Run\u003c/p\u003e\n\n\u003cp\u003eTest1 = {2, 5, 3, 7, 8, 9, 6}\u003c/p\u003e\n\n\u003cp\u003eTest1.sortDataDsc() will give me: Test1 = {8, 7, 6, 9, 3, 5, 2}\u003c/p\u003e\n\n\u003cp\u003eTest1A = {8, 7, 6, 9, 3, 5, 2}\u003c/p\u003e\n\n\u003cp\u003eTest1A.sortDataAsc() will give me: {2, 5, 3, 6, 7, 8, 9}\u003c/p\u003e\n\n\u003cp\u003eNew Run\u003c/p\u003e\n\n\u003cp\u003eTest1 = {2, 5, 3, 7, 8, 9, 6}\u003c/p\u003e\n\n\u003cp\u003eIf I do Test1.sortDataAsc() first it will sort the data correctly and also correctly sort it in descending order if I do that after.\u003c/p\u003e\n\n\u003cp\u003eNew Run\u003c/p\u003e\n\n\u003cp\u003eTest2 = {7, 4, 5, 8, 0, 1}\u003c/p\u003e\n\n\u003cp\u003eTest2.sortDataAsc() will give me: {1, 0, 4, 5, 7, 8}. \u003c/p\u003e\n\n\u003cp\u003eIt will then correctly sort these numbers in descending order and back to the correct ascending order. \u003c/p\u003e\n\n\u003cp\u003eAll of the test cases I have tried are repeatable if you enter the numbers in the same order. If you change the order of the numbers, then the output could be correct or it could be a different wrong order. I have ruled out every problem I can think of that could cause this and I cannot find any similarities between test cases. If anyone sees anything in my code I could fix or add to remedy this situation it would be greatly appreciated.\u003c/p\u003e\n\n\u003cp\u003ecount = the number of elements in the array\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e//sortDataAsc Method - Sorts data elements in Statistics array from least to greatest\npublic void sortDataAsc(){\n int min, temp;\n for(int index = 0; index \u0026lt; count; index++){\n min = index;\n for(int scan = index + 1; scan \u0026lt; count; scan++){\n if(data[scan] \u0026lt; data[min]){\n min = scan;\n }\n temp = data[min];\n data[min] = data[index];\n data[index] = temp;\n }\n }\n}\n\n//sortDataDsc Method - Sorts data elements in Statistics array from greatest to least\npublic void sortDataDsc(){\n int max, temp;\n for(int index = 0; index \u0026lt; count; index++){\n max = index;\n for(int scan = index + 1; scan \u0026lt; count; scan++){\n if(data[scan] \u0026gt; data[max]){\n max = scan;\n }\n temp = data[max];\n data[max] = data[index];\n data[index] = temp;\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-12-07 20:00:07.727 UTC","last_activity_date":"2015-12-07 20:27:14.137 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5651505","post_type_id":"1","score":"0","tags":"java|sorting","view_count":"173"} +{"id":"47429909","title":"GNU make 4.1: Missing separator when $(if ...) is true in a defined function","body":"\u003cp\u003eI am trying to generate an error in a Makefile when a string is not found in the output of a shell command. The shell command depends on a parameter, therefore the whole thing is in a defined function. Here is a minimalist example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edefine check_in_abcdefg\n$(eval TMP := $(shell echo abcdefg))\n$(if $(findstring $(1),$(TMP)),,$(error $(1) not in $(TMP)))\nendef\n\n$(call check_in_abcdefg,def)\n\nall:\n @echo Hello, world!\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI would like this Makefile to output \u003ccode\u003eHello, world!\u003c/code\u003e in this case, but I'd like it to output \u003ccode\u003exyz not in abcdefg\u003c/code\u003e if I replace the call line with this one:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(call check_in_abcdefg,xyz)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe problem is that with the \u003ccode\u003edef\u003c/code\u003e check I have this output:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eMakefile:6: *** missing separator. Stop.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eWhere line 6 is \u003ccode\u003e$(call check_in_abcdefg,def)\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eWhy does the syntax check fail when the \u003ccode\u003e$(if ...)\u003c/code\u003e condition is true since it's actually empty ?\u003c/strong\u003e \u003c/p\u003e\n\n\u003cp\u003eNote that the echo command in the dummy target \u003ccode\u003eall\u003c/code\u003e is correctly preceded by a tab, not four spaces. I am running \u003ccode\u003eGNU make 4.1.90 built for Windows32\u003c/code\u003e, and it seems not to happen for newer version of \u003ccode\u003eGNU make\u003c/code\u003e. I am looking for any answer that could help me make it work with \u003ccode\u003eGNU make 4.1.90\u003c/code\u003e\u003c/p\u003e","accepted_answer_id":"47433440","answer_count":"2","comment_count":"7","creation_date":"2017-11-22 08:26:16.68 UTC","last_activity_date":"2017-11-22 14:17:49.88 UTC","last_edit_date":"2017-11-22 14:17:49.88 UTC","last_editor_display_name":"","last_editor_user_id":"6413048","owner_display_name":"","owner_user_id":"6413048","post_type_id":"1","score":"2","tags":"makefile|gnu-make","view_count":"48"} +{"id":"41026624","title":"Inno Setup - How to change a label caption [or other controls in general], when selected value in combox box changes","body":"\u003cp\u003eWhen changing a language in combo box (without clicking ok), I want to change texts of the dialog (label, form caption, button caption)\u003c/p\u003e\n\n\n\n\u003cpre class=\"lang-pascal prettyprint-override\"\u003e\u003ccode\u003eprocedure SelectLanguage();\nvar\n LanguageForm: TSetupForm;\n CancelButton: TNewButton;\n OKButton: TNewButton;\n LangCombo: TNewComboBox;\n SelectLabel: TNewStaticText;\n Languages: TStrings;\n Params: string;\n Instance: THandle;\n P, I: Integer;\n S, L: string;\nbegin\n Languages := TStringList.Create();\n\n Languages.Add('en=English');\n Languages.Add('cs='+#$010C+'e'+#$0161+'tina');\n\n LanguageForm := CreateCustomForm;\n\n LanguageForm.Caption := SetupMessage(msgSelectLanguageTitle);\n LanguageForm.ClientWidth := ScaleX(297);\n LanguageForm.ClientHeight := ScaleY(125);\n LanguageForm.BorderStyle := bsDialog;\n LanguageForm.Center;\n\n CancelButton := TNewButton.Create(LanguageForm);\n CancelButton.Parent := LanguageForm;\n CancelButton.Left := ScaleX(214);\n CancelButton.Top := ScaleY(93);\n CancelButton.Width := ScaleY(75);\n CancelButton.Height := ScaleY(23);\n CancelButton.TabOrder := 3;\n CancelButton.ModalResult := mrCancel;\n CancelButton.Caption := SetupMessage(msgButtonCancel);\n\n OKButton := TNewButton.Create(LanguageForm);\n OKButton.Parent := LanguageForm;\n OKButton.Left := ScaleX(133);\n OKButton.Top := ScaleY(93);\n OKButton.Width := ScaleX(75);\n OKButton.Height := ScaleY(23);\n OKButton.Caption := SetupMessage(msgButtonOK);\n OKButton.Default := True\n OKButton.ModalResult := mrOK;\n OKButton.TabOrder := 2;\n\n LangCombo := TNewComboBox.Create(LanguageForm);\n LangCombo.Parent := LanguageForm;\n LangCombo.Left := ScaleX(16);\n LangCombo.Top := ScaleY(56);\n LangCombo.Width := ScaleX(273);\n LangCombo.Height := ScaleY(21);\n LangCombo.Style := csDropDownList;\n LangCombo.DropDownCount := 16;\n LangCombo.TabOrder := 1;\n\n SelectLabel := TNewStaticText.Create(LanguageForm);\n SelectLabel.Parent := LanguageForm;\n SelectLabel.Left := ScaleX(16);\n SelectLabel.Top := ScaleY(8);\n SelectLabel.Width := ScaleX(273);\n SelectLabel.Height := ScaleY(39);\n SelectLabel.AutoSize := False\n SelectLabel.Caption := SetupMessage(msgSelectLanguageLabel);\n SelectLabel.TabOrder := 0;\n SelectLabel.WordWrap := True;\n\n for I := 0 to Languages.Count - 1 do\n begin\n P := Pos('=', Languages.Strings[I]);\n L := Copy(Languages.Strings[I], 0, P - 1);\n S := Copy(Languages.Strings[I], P + 1, Length(Languages.Strings[I]) - P);\n LangCombo.Items.Add(S);\n if L = ActiveLanguage then\n LangCombo.ItemIndex := I;\n end;\n\n if LanguageForm.ShowModal = mrOK then\n begin\n { ... }\n end;\nend;\n\nfunction InitializeSetup(): Boolean;\nbegin\n SelectLanguage();\n { ... }\nend;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/MSAqA.jpg\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/MSAqA.jpg\" alt=\"Spanish first language\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eSpanish: first language.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/RyY1i.jpg\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/RyY1i.jpg\" alt=\"I select english and no change the language of the language selector\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI select English and no change the language of the language selector.\u003c/p\u003e","accepted_answer_id":"41039658","answer_count":"1","comment_count":"4","creation_date":"2016-12-07 20:19:11.383 UTC","favorite_count":"2","last_activity_date":"2016-12-11 23:35:23.557 UTC","last_edit_date":"2016-12-11 23:35:23.557 UTC","last_editor_display_name":"","last_editor_user_id":"7253519","owner_display_name":"","owner_user_id":"7253519","post_type_id":"1","score":"1","tags":"inno-setup","view_count":"265"} +{"id":"10058673","title":"Is it possible to save only SOME parts of a nested form to the DB","body":"\u003cp\u003eI have a nested form that takes \"brand\" \"model\" \"submodel\" and \"style\" ... Now, there are multiple styles for any given brand+model+submodel combination.. but I don't want to re-save the same brand name (or model or submodel) twice in my database.. \u003c/p\u003e\n\n\u003cp\u003eSo, given the above situation, what would I need to do in my CREATE action in my controller to ensure that brand names in the db are unique.. etc.. but so that the nested form can still be submitted?\u003c/p\u003e\n\n\u003cp\u003eAlso, the saved 'style' would need to adopt the submodel id from an existing submodel object, if one (with the same submodel name) is already listed in the submodel table.\u003c/p\u003e\n\n\u003cp\u003eUPDATE:\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/OROXB.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eI would like to allow my nested form to save x y and z, and have the following:\u003c/p\u003e\n\n\u003cp\u003ePanasonic (not saved, but the ID is read out and saved with model x as brand_id)\nX (saved with brand_id from Panasonic)\nY (saved with model_id from model X)\nZ (saved with submodel_id from Y)\u003c/p\u003e\n\n\u003cp\u003eOf course if Model X already exists then I would like \u003c/p\u003e\n\n\u003cp\u003ePanasonic (not saved)\nX (not saved)\nY (saved with X's ID as model_id)\nZ (saved with Ys new ID as submodel_id)\u003c/p\u003e\n\n\u003cp\u003eYou see where I'm going with this? =)\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2012-04-07 21:50:09.963 UTC","last_activity_date":"2012-04-08 09:35:46.567 UTC","last_edit_date":"2012-04-08 07:31:45.703 UTC","last_editor_display_name":"","last_editor_user_id":"881559","owner_display_name":"","owner_user_id":"881559","post_type_id":"1","score":"0","tags":"ruby-on-rails","view_count":"44"} +{"id":"30304929","title":"Two table SQL double join?","body":"\u003cp\u003eI have two tables, \u003ccode\u003esections\u003c/code\u003e and \u003ccode\u003earticles\u003c/code\u003e. Originally it was a one-to-many relationship, therefore \u003ccode\u003earticles\u003c/code\u003e has a \u003ccode\u003esectionID\u003c/code\u003e column. Then one day it was decided to allow each article to belong to two sections. Rather than making another 'articles-in-section' table, I opted to not deal with refactoring the data, and I just added an \u003ccode\u003eadditionalSectionID\u003c/code\u003e column onto the \u003ccode\u003earticles\u003c/code\u003e table. Now I have a problem.\u003c/p\u003e\n\n\u003cp\u003eI want to show all the articles associated with a given section, whether as its primary or secondary section. Essentially, I'm looking for some sort of double join between two tables.\u003c/p\u003e\n\n\u003cp\u003eThese two questions have answers to the same issue - \u003ca href=\"https://stackoverflow.com/questions/22768480/join-two-tables-with-two-columns-sql-server-2008-r2\"\u003e1\u003c/a\u003e,\u003ca href=\"https://stackoverflow.com/questions/26598409/sequelize-double-joining-table-on-two-ids\"\u003e2\u003c/a\u003e, but with a different db server. Is there are a way to do this in PHP/MySQL?\u003c/p\u003e\n\n\u003cp\u003eTables' structure is basically like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e-- SECTIONS:\nid title description moderatorID url\n\n-- ARTICLES: \nid title shortDesc fullText photo sectionID additionalSectionID\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"30318344","answer_count":"2","comment_count":"6","creation_date":"2015-05-18 13:46:26.593 UTC","last_activity_date":"2015-05-21 06:55:05.193 UTC","last_edit_date":"2017-05-23 11:58:09.033 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"1857802","post_type_id":"1","score":"1","tags":"php|mysql|sql|join","view_count":"387"} +{"id":"34276984","title":"Restructuring data using apply family of functions","body":"\u003cp\u003eI have inherited a data set that is 23 attributes measured for each of 13 names (between-subjects--each participant only rated one name on all of these attributes). Right now it's structured such that the attributes are the fastest-moving factor, followed by the name. So the the data look like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSub# N1-item1 N1-item2 N1-item3 […] N2-item1 N2-item2 N2-item3\n1 3 5 3 NA NA NA\n2 NA NA NA 1 5 3\n3 3 5 3 NA NA NA\n4 NA NA NA 2 2 1\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt needs to be restructured it such that it's collapsed over name, and all of the item1 entries are the same column (subjects don't matter for this purpose), as below (bearing in mind that there are 23 items not 3 and 13 names not 2):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eName item1 item2 item3\nN1 3 5 3 \nN2 1 5 3 \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI can do this with loops and, but I'd rather do it in a manner more natural to R, which I'm guessing would be one of the apply family of functions, but I can't quite wrap my head around it--what is the smart way to do this?\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2015-12-14 21:31:44.53 UTC","last_activity_date":"2015-12-14 22:33:46.573 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2266578","post_type_id":"1","score":"2","tags":"r|dataframe","view_count":"40"} +{"id":"28555409","title":"JavaFX to Android - Execution failed for task ':deleteSrcAndLayout'","body":"\u003cp\u003egood day, I got an issue in creating an android project, Im currently using windows7 with JDK8u40 installed and Im using the latest dalvik sdk. But when I attempted to create an android project, an error was thrown:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e* What went wrong:\nExecution failed for task ':deleteSrcAndLayout'.\n\u0026gt; Directory does not exist: C:\\AndroidFX\\CodeGenerator\\src\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere's the complete error log:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eC:\\dalvik-sdk\\samples\\Ensemble8\u0026gt;./gradlew --info createProject -PDEBUG -PDIR=C:/\nAndroidFX -PPACKAGE=\"hello\" -PNAME=\"CodeGenerator\" -PANDROID_SDK=C:/AndroidSDK/s\ndk -PJFX_SDK=C:/dalvik-sdk -PJFX_APP=C:/Jar -PJFX_MAIN=\"hello.Hello\"\nStarting Build\nSettings evaluated using empty settings script.\nProjects loaded. Root project using build file 'C:\\dalvik-sdk\\samples\\Ensemble8\\\nbuild.gradle'.\nIncluded projects: [root project 'Ensemble8']\nEvaluating root project 'Ensemble8' using build file 'C:\\dalvik-sdk\\samples\\Ense\nmble8\\build.gradle'.\nStarting file lock listener thread.\nAll projects evaluated.\nSelected primary task 'createProject'\nTasks to be executed: [task ':conf', task ':androidCreateProject', task ':delete\nSrcAndLayout', task ':writeAntProperties', task ':updateManifest', task ':update\nStringsXml', task ':updateBuildXml', task ':createProject']\n:conf (Thread[main,5,main]) started.\n:conf\nExecuting task ':conf' (up-to-date check took 0.0 secs) due to:\n Task has not declared any outputs.\n\n====================================================\nAndroid SDK: [C:/AndroidSDK/sdk]\nTarget: [android-21]\nProject name: [CodeGenerator]\nPackage: [hello]\nJavaFX application: [C:/Jar]\nJavaFX sdk: [C:/dalvik-sdk]\nJavaFX main.class: [hello.Hello]\nWorkdir: [C:/AndroidFX]\ndebug: [true]\n===================================================\n\n:conf (Thread[main,5,main]) completed. Took 0.078 secs.\n:androidCreateProject (Thread[main,5,main]) started.\n:androidCreateProject\nExecuting task ':androidCreateProject' (up-to-date check took 0.0 secs) due to:\n Task has not declared any outputs.\nStarting process 'command 'C:/AndroidSDK/sdk/tools/android.bat''. Working direct\nory: C:\\AndroidFX Command: C:/AndroidSDK/sdk/tools/android.bat create project -n\n CodeGenerator -p CodeGenerator -t android-21 -k hello -a Activity\nAn attempt to initialize for well behaving parent process finished.\nSuccessfully started process 'command 'C:/AndroidSDK/sdk/tools/android.bat''\nError: Package name 'hello' contains invalid characters.\nA package name must be constitued of two Java identifiers.\nEach identifier allowed characters are: a-z A-Z 0-9 _\n Proces\ns 'command 'C:/AndroidSDK/sdk/tools/android.bat'' finished with exit value 0 (st\nate: SUCCEEDED)\n:androidCreateProject (Thread[main,5,main]) completed. Took 1.375 secs.\n:deleteSrcAndLayout (Thread[main,5,main]) started.\n:deleteSrcAndLayout\nExecuting task ':deleteSrcAndLayout' (up-to-date check took 0.0 secs) due to:\n Task has not declared any outputs.\n:deleteSrcAndLayout FAILED\n:deleteSrcAndLayout (Thread[main,5,main]) completed. Took 0.594 secs.\n\nFAILURE: Build failed with an exception.\n\n* Where:\nBuild file 'C:\\dalvik-sdk\\samples\\Ensemble8\\build.gradle' line: 203\n\n* What went wrong:\nExecution failed for task ':deleteSrcAndLayout'.\n\u0026gt; Directory does not exist: C:\\AndroidFX\\CodeGenerator\\src\n\n* Try:\nRun with --stacktrace option to get the stack trace. Run with --debug option to\nget more log output.\n\nBUILD FAILED\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eTotal time: 6.531 secs\u003c/p\u003e\n\n\u003cp\u003ePlease help me!! Im stuck!!!!\nI also tried JDK7u75 but it didnt worked!!\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-02-17 05:39:56.273 UTC","last_activity_date":"2015-02-17 08:25:41.887 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4189071","post_type_id":"1","score":"0","tags":"javafx|javafx-8","view_count":"171"} +{"id":"34728004","title":"Templates in React","body":"\u003cp\u003eI've been trying to learn \u003ccode\u003eReact\u003c/code\u003e through building my own website by using it, and have come to a point where I'm very tempted to use \u003ccode\u003ejinja2\u003c/code\u003e templates. I understand the component paradigm pretty well, but am having a hard time piecing together the larger picture.\u003c/p\u003e\n\n\u003cp\u003eFor example, let's say I'm building \u003ca href=\"http://www.imgur.com\" rel=\"nofollow\"\u003ehttp://www.imgur.com\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eFor the components, I might write a image \u003ccode\u003ecard component\u003c/code\u003e for each image, perhaps a \u003ccode\u003emouseover component\u003c/code\u003e for the short summary of each image, etc...\u003c/p\u003e\n\n\u003cp\u003eHowever, how am I suppose to put the larger pieces together? In \u003ccode\u003ejinja2\u003c/code\u003e, I can just extend a base template or include a header/footer. What is the proper way to do that sort of thing in \u003ccode\u003eReact\u003c/code\u003e? I'd like to get rid of conventional templates altogether. \u003c/p\u003e","accepted_answer_id":"34728436","answer_count":"1","comment_count":"3","creation_date":"2016-01-11 17:55:22.8 UTC","last_activity_date":"2016-01-11 18:25:06.72 UTC","last_edit_date":"2016-01-11 18:18:15.93 UTC","last_editor_display_name":"","last_editor_user_id":"3783770","owner_display_name":"","owner_user_id":"3783770","post_type_id":"1","score":"0","tags":"templates|web|reactjs","view_count":"103"} +{"id":"44251493","title":"iPhone does not remember my Android USB host. Keep asking \"Allow this device to access photos and videos\" instead of showing \"Trust this computer\"","body":"\u003cp\u003eI'm developing an android USB host application which read photos from iphone, treat iphone as external MTP/PTP devices when iphone connect to the host via USB.\u003c/p\u003e\n\n\u003cp\u003eThis app works fine, except that it show the popup message on iphone every time I connect the iphone to the android USB host.\u003c/p\u003e\n\n\u003cp\u003eiPhone Keeps Prompting \"Allow this device to access photos and videos?\", In PC(Windows/Linux/Mac), when iphone connected to the usb host, the popup is \"Trust this Computer? Your settings and data will be accessible from this computer when connected\", and if I tap Trust, this popup will not show again.\u003c/p\u003e\n\n\u003cp\u003eSo is this because android or I missed something when doing the USB communication? How can I resolve this issue so that when iPhone connected to my android USB host, \"Trust this computer\" popup can be shown on iphone and iphone can remember my android USB host?\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-05-29 23:42:52.913 UTC","last_activity_date":"2017-05-30 00:32:37.093 UTC","last_edit_date":"2017-05-30 00:32:37.093 UTC","last_editor_display_name":"","last_editor_user_id":"6930324","owner_display_name":"","owner_user_id":"6930324","post_type_id":"1","score":"1","tags":"android|ios|iphone|linux","view_count":"59"} +{"id":"8507540","title":"How to make sure my websites look good cross browser","body":"\u003cp\u003eI enjoy making websites. I spend all my free time on them. But when I test them in other browsers and computers they look different.\u003c/p\u003e\n\n\u003cp\u003eI have been given advice such as use \u003ccode\u003emargin: 0 auto;\u003c/code\u003e to make a main wrap which always stays centered. But anyone else have any good tips and places to expand what I know? \u003c/p\u003e\n\n\u003cp\u003eThis is mainly about layout. Not really bothered about how different buttons look because of different browsers not displaying shadowing and gradients.\u003c/p\u003e","accepted_answer_id":"8507606","answer_count":"5","comment_count":"0","creation_date":"2011-12-14 15:59:39.71 UTC","last_activity_date":"2011-12-14 16:28:37.793 UTC","last_edit_date":"2011-12-14 16:03:12.38 UTC","last_editor_display_name":"","last_editor_user_id":"94197","owner_display_name":"","owner_user_id":"1018369","post_type_id":"1","score":"0","tags":"html","view_count":"1229"} +{"id":"5780678","title":"p2p simulation and distributed hash table","body":"\u003cp\u003eI am learning the p2p architecture through a simulation within a single machine. For that I was told that I can use named pipes. I am in the design phase of the simulation. Here is how I plan to move forward:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003e\u003cp\u003eCreate a peer program that is able to join the p2p 'network'. The network is a collection of such peers. The peer is identified via the process id in the machine. \u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eWhen a peer is created i.e., joins the network, it announces it's arrival through bootstrapping itself to a 'master-node' or tracker. When the peer announces its arrival, the master-node updates its list of peers (process ids), and returns the list of peers available in the network to the new peer. \u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eOnce in the network, the peer can now download a file from the network or upload a file to an incoming request for a file that s/he has. The files that the peer receives through the network automatically becomes available for upload.\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eTo download a file, the peer calls a location algorithm that locates the peer with the file that the current peer is seeking to download.\u003c/p\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eAs you can see, there is a gap in my understanding of the design. From my naive approach, I see #2 and #3 as different steps. However, I have a feeling that they must somehow be related. I guess my understanding lacks in knowing how a distributed hash table and algorithm like Chord or CAN works. I need help in rounding up these scattered ideas that will help me actually implement the simulation. \u003c/p\u003e\n\n\u003cp\u003eTo begin, my first question is: where and how do I initiate the location algorithm? Or where is the distributed hash table created in the steps listed above? \u003c/p\u003e","accepted_answer_id":"5781486","answer_count":"1","comment_count":"0","creation_date":"2011-04-25 16:48:16.447 UTC","last_activity_date":"2012-01-30 18:09:51.127 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"672271","post_type_id":"1","score":"1","tags":"hashtable|p2p|dht","view_count":"815"} +{"id":"47171631","title":"How to group and rank with reference to another column","body":"\u003cp\u003eI need help in grouping or partitioning and ranking according to the subject. Every subject must have first to last student.\nI am using the code below with VB 2010.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eDim TotaledRecords = From p In db.Assessments\nWhere p.Class = cboclass.Text And p.Stream = cbostream.Text\nSelect p\nOrder By p.Total Descending\n\nFor j = 1 To TotaledRecords.Count\nTotaledRecords.ToList(j - 1).Position = j\nNext\ndb.SubmitChanges()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want it to restart the ranking with respect to the subject.\u003c/p\u003e\n\n\u003cp\u003eSee attached picture:\n\u003ca href=\"https://i.stack.imgur.com/xz093.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/xz093.png\" alt=\"\"\u003e\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"47183888","answer_count":"1","comment_count":"0","creation_date":"2017-11-08 04:31:51.377 UTC","last_activity_date":"2017-11-09 12:03:19.603 UTC","last_edit_date":"2017-11-08 11:44:02.067 UTC","last_editor_display_name":"","last_editor_user_id":"1905949","owner_display_name":"","owner_user_id":"8903261","post_type_id":"1","score":"1","tags":"vb.net|linq|grouping|vb.net-2010|rank","view_count":"54"} +{"id":"5086387","title":"Howto create a c# assembly to load into sql server 2008","body":"\u003cp\u003eI was wondering if anyone would be able to provide me with some guidance or book recommendations on creating a C# assembly that will be loaded into sqlserver and run on the database as new data comes in. \u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eBackground:\u003c/strong\u003e\u003cbr\u003e\nI have a few years of Java experience and had created an algorithm to run against data retrieved from a sql query. My employer now wants me to create it as a c# assembly that sits on the database directly and performs the analysis as data comes in (or at periodic points) and sends out alerts if they are above a certain threshold. \u003c/p\u003e\n\n\u003cp\u003eI have never coded in c# but I am told that it is very similar to Java. The learning of c# is not my issue here, I think that I can pick that up from online resources. What I am having trouble finding information on is the assembly and how it ties into sqlserver / if there needs to be anything specific done in the code for it to work. \u003c/p\u003e\n\n\u003cp\u003eI have been browsing Microsoft's msdn library online to get an idea and I think that what I am looking for is a \u003ccode\u003eC# SQL CLR Database Project\u003c/code\u003e. \u003c/p\u003e\n\n\u003cp\u003eIs this correct for what I am trying to accomplish? If so does anybody have any tips / things to look out for when working on this?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eps.\u003c/strong\u003e Is there a way to deal directly with the tables in some manner? Instead of constantly performing a query on the data like I do with Java? I am not sure if this is possible but I thought it may be since the assembly is connected directly to the database somehow.\u003c/p\u003e","accepted_answer_id":"5086505","answer_count":"2","comment_count":"4","creation_date":"2011-02-23 02:29:27.25 UTC","last_activity_date":"2011-02-23 05:48:30.26 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"589131","post_type_id":"1","score":"3","tags":"c#|sql-server-2008|assemblies","view_count":"1639"} +{"id":"13535299","title":"Android - how to verify an in-app purchase?","body":"\u003cp\u003eI'm trying learn about in-app purchases by following this tutorial \u003ca href=\"http://blog.blundell-apps.com/simple-inapp-billing-payment/\" rel=\"nofollow\"\u003ehttp://blog.blundell-apps.com/simple-inapp-billing-payment/\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003ehere's my code so far:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class main extends Activity{\n\n @Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n Log.e(\"BillingService\", \"Starting\");\n setContentView(R.layout.main);\n\n startService(new Intent(this, BillingService.class));\n BillingHelper.setCompletedHandler(mTransactionHandler);\n\n }\n\n ////////////////////////////////\n\n public Handler mTransactionHandler = new Handler(){\n public void handleMessage(android.os.Message msg) {\n\n Log.e(\"IN APP\", \"Transaction complete\");\n Log.e(\"IN APP\", \"Transaction status: \"+BillingHelper.latestPurchase.purchaseState);\n Log.e(\"IN APP\", \"Item purchased is: \"+BillingHelper.latestPurchase.productId);\n\n if(BillingHelper.latestPurchase.isPurchased())\n {\n showItem();\n }\n\n };\n\n };\n\n ////////////////////////////////\n\n public void BuyButtonClick(View v) {\n\n if(BillingHelper.isBillingSupported()){\n Log.e(\"IN APP\",\"Trying to buy...\");\n BillingHelper.requestPurchase(this, \"android.test.purchased\"); \n } else {\n Log.e(\"IN APP\",\"Can't purchase on this device\");\n }\n\n }\n\n ////////////////////////////////////////////////\n\n private void showItem() {\n\n TextView tv1 = (TextView)findViewById(R.id.tv1);\n tv1.setText(\"PAID!\");\n\n }\n\n ////////////////////////////////////////////////\n\n @Override\n protected void onDestroy() {\n BillingHelper.stopService();\n super.onDestroy();\n }\n\n ////////////////////////////////\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eEverything seems to work fine, but I also want some way to check if the item was purchased when the app starts. I assume it might use \u003cstrong\u003eBillingHelper.verifyPurchase(signedData, signature)\u003c/strong\u003e , but what data and sig should I put in there? Or maybe there's some other way about it?\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2012-11-23 20:23:00.47 UTC","favorite_count":"1","last_activity_date":"2012-12-10 11:19:27.227 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"296516","post_type_id":"1","score":"1","tags":"android","view_count":"605"} +{"id":"41131141","title":"Returning Promise from function having Angular 2 http call which returns an Observable","body":"\u003cp\u003eI have a method in my service which reads the token from storage and returns a promise.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003egetToken() {\n return this.storage.get('access_token');\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e(storage.get returns a promise)\u003c/p\u003e\n\n\u003cp\u003eI need to modify the above method such that it first read the access token from storage and check its expiry, if its not expired return it immediately, if its expired read refresh_token from storage i.e. this.storage.get('refresh_token') which again returns a promise, after checking if its not expired, I need to make http request using Angular 2 http.post to my api which will return a new access token. Once it receive the new access token the getToken function will return.\u003c/p\u003e\n\n\u003cp\u003eI though the below will work, but it doesnt:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003egetToken() {\n var promise = new Promise(function (resolve, reject) {\n this.storage.get('access_token').then((accessToken) =\u0026gt; {\n //check if the token is expired\n if (accessToken) {\n if (!this.isExpired(accessToken)) {\n resolve(accessToken);\n }\n else {\n this.storage.get('refresh_token').then((refreshToken) =\u0026gt; {\n if (!this.isExpired(refreshToken)) {\n this.http.post('/api/refresh/', { token:refreshToken })\n .subscribe((data) =\u0026gt; {\n resolve(data);\n });\n }\n else {\n resolve(null);\n }\n });\n }\n } else {\n resolve(null);\n }\n });\n });\n\n return promise;\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCan anyone please guide, how to achieve this?\u003c/p\u003e","accepted_answer_id":"41131303","answer_count":"1","comment_count":"5","creation_date":"2016-12-13 21:49:14.99 UTC","last_activity_date":"2016-12-13 22:01:47.473 UTC","last_edit_date":"2016-12-13 22:01:47.473 UTC","last_editor_display_name":"","last_editor_user_id":"1048572","owner_display_name":"","owner_user_id":"2755616","post_type_id":"1","score":"0","tags":"javascript|angular|promise|observable|es6-promise","view_count":"706"} +{"id":"9854154","title":"Get text with PHP Simple HTML DOM Parser","body":"\u003cp\u003ei'm using PHP Simple HTML DOM Parser to get text from a webpage.\nThe page i need to manipulate is something like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;html\u0026gt;\n\u0026lt;head\u0026gt;\n\u0026lt;title\u0026gt;title\u0026lt;/title\u0026gt;\n\u0026lt;body\u0026gt;\n\u0026lt;div id=\"content\"\u0026gt;\n\u0026lt;h1\u0026gt;HELLO\u0026lt;/h1\u0026gt;\nHello, world!\n\u0026lt;/div\u0026gt;\n\u0026lt;/body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI need to get the \u003ccode\u003eh1\u003c/code\u003e element and the text that has no tags.\nto get the \u003ccode\u003eh1\u003c/code\u003e i use this code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$html = file_get_html(\"remote_page.html\");\nforeach($html-\u0026gt;find('#content') as $text){\necho \"H1: \".$text-\u0026gt;find('h1', 0)-\u0026gt;plaintext;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut the other text?\nI also tried this into the foreach but i get the full text:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$text-\u0026gt;plaintext;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut it returned also the \u003ccode\u003eH1\u003c/code\u003e tag...\u003c/p\u003e","answer_count":"3","comment_count":"4","creation_date":"2012-03-24 18:05:51.023 UTC","favorite_count":"2","last_activity_date":"2016-12-14 04:05:47.197 UTC","last_edit_date":"2012-03-24 18:14:15.057 UTC","last_editor_display_name":"","last_editor_user_id":"367456","owner_display_name":"","owner_user_id":"345812","post_type_id":"1","score":"0","tags":"php|html-parsing|simple-html-dom","view_count":"4337"} +{"id":"5175687","title":"How to export sqlite database file from iphone to MAC?","body":"\u003cp\u003eHow to export sqlite database file from iphone to MAC?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2011-03-03 01:41:23.087 UTC","favorite_count":"1","last_activity_date":"2011-03-03 01:44:08.77 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"488156","post_type_id":"1","score":"2","tags":"iphone|objective-c|sqlite","view_count":"1813"} +{"id":"42555914","title":"python request.POST to firebase server with multiprocessing","body":"\u003cp\u003eI'm trying to post a Json payload to a server, but because it takes a long time i wish to dump data in an asynchronous manner. \"initialize the worker, leave the function while the worker is posting, start a new worker with most up to data payload\" i need to avoid the “GIL” and use all cores too\u003c/p\u003e\n\n\u003cp\u003emultiprocessing has the Pool function, however I can't pass different arguments to workers.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efrom multiprocessing import Pool, TimeoutError\n\nimport requests \nimport json\n\npayload = {\n 'x_axis': 0,\n 'y_axis': 0,\n 'z_axis': 0,\n}\n\n\ndef f(x,y,z):\n r = requests.patch('https://\u0026lt;serverplace\u0026gt;.firebaseio.com/\u0026lt;name\u0026gt;.json', data=json.dumps(payload))\n\n\nif __name__ == '__main__':\n for i in range (4):\n pool = Pool(processes = 1)\n res = pool.apply_async(f, (i,i,i))\n print res.get(timeout=2)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe aim of my program is to receive data through i2c, create an object, json that object and then request.post it.\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2017-03-02 12:45:01.723 UTC","last_activity_date":"2017-03-02 12:45:01.723 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6423473","post_type_id":"1","score":"0","tags":"python|firebase|python-requests|python-multiprocessing","view_count":"64"} +{"id":"25046815","title":"How to check if a process is running on a client's computer (on server-side)? [Java]","body":"\u003cp\u003eSo, how can I check if a process is running in Java?\u003c/p\u003e\n\n\u003cp\u003eI'm running a private server of some game...\u003c/p\u003e\n\n\u003cp\u003eAnd I got the player's IP and the port that they are using to connect..\u003c/p\u003e\n\n\u003cp\u003eThanks in-advance.\u003c/p\u003e\n\n\u003cp\u003eEDIT:\u003c/p\u003e\n\n\u003cp\u003eI am using Windows 7, and again, I need to get the client's processes information\u003c/p\u003e\n\n\u003cp\u003eand then determine if the process is running or not, and not my server's computer \u003c/p\u003e\n\n\u003cp\u003eprocesses.. :/\u003c/p\u003e\n\n\u003cp\u003eany ideas?? :(\u003c/p\u003e","answer_count":"2","comment_count":"5","creation_date":"2014-07-30 20:59:10.937 UTC","favorite_count":"0","last_activity_date":"2014-07-31 05:50:32.8 UTC","last_edit_date":"2014-07-31 05:50:32.8 UTC","last_editor_display_name":"","last_editor_user_id":"3893092","owner_display_name":"","owner_user_id":"3893092","post_type_id":"1","score":"1","tags":"java|process|ip|client|port","view_count":"508"} +{"id":"5779659","title":"Writing a cross-platform program","body":"\u003cp\u003eHow could I write a program which runs on both Windows 7, Mac OS X (and maybe linux too)?\u003c/p\u003e\n\n\u003cp\u003eI heard Qt are a great framework to build cross-platform GUIs, but I think every program version need a recompile, isn't that right? And should I compile the win version under windows, the mac version under mac os x, the linux version under linux and so on?\u003c/p\u003e\n\n\u003cp\u003eI'm getting ideas and/or suggestions\u003c/p\u003e","accepted_answer_id":"5779687","answer_count":"5","comment_count":"1","creation_date":"2011-04-25 14:58:57.17 UTC","favorite_count":"4","last_activity_date":"2011-04-25 17:10:44.703 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1938163","post_type_id":"1","score":"4","tags":"c++|windows|osx|cross-platform|cross-compiling","view_count":"1394"} +{"id":"24913938","title":"R ggplot - include lower and upper bound for y-axes","body":"\u003cp\u003eI'm using ggplot in R to represent my data into a plot. The problem is the lower and upper bound of the y-axes (0 and 1.45) are not included\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/xvFIM.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edata \u0026lt;- data.frame(User= numeric(0), Time= numeric(0), \n Category= character(), stringsAsFactors=FALSE)\n\ndata[1,] \u0026lt;- c(1,0.42,\"Category 1\")\ndata[2,] \u0026lt;- c(2,0.63,\"Category 1\")\ndata[3,] \u0026lt;- c(3,0.50,\"Category 1\")\ndata[4,] \u0026lt;- c(4,0.72,\"Category 1\")\ndata[5,] \u0026lt;- c(4,0.73,\"Category 2\")\ndata[6,] \u0026lt;- c(5,0.60,\"Category 1\")\n\nlibrary(ggplot2)\n\nggplot(data= data, aes(x=User, y=Time, fill= Category)) + \ngeom_bar(stat=\"identity\")\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow can I resolve this?\u003c/p\u003e","accepted_answer_id":"24914107","answer_count":"1","comment_count":"0","creation_date":"2014-07-23 14:56:15.16 UTC","last_activity_date":"2014-07-23 15:05:59.463 UTC","last_edit_date":"2014-07-23 15:05:59.463 UTC","last_editor_display_name":"","last_editor_user_id":"2250190","owner_display_name":"","owner_user_id":"3869305","post_type_id":"1","score":"1","tags":"r|ggplot2","view_count":"153"} +{"id":"36879362","title":"Alguém pode me explicar como isso?","body":"\u003cp\u003eEstou usando Realm para armazenamento de alguns dados, e durante um debug me deparei com a seguinte situação:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/USwBq.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/USwBq.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eNo lado esquerdo da imagem está a verificação dos valores vindos de um request do Realm. \u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003evar result = realm.objects(Model).filter(\"...\")\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eEntao no lado direito surge os valores quado imprimo a description do objeto resultante da pesquisa.\u003c/p\u003e\n\n\u003cp\u003eComo funciona isso ?\u003c/p\u003e","accepted_answer_id":"36884291","answer_count":"1","comment_count":"7","creation_date":"2016-04-27 02:45:57.497 UTC","last_activity_date":"2016-04-27 08:26:21.95 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3841627","post_type_id":"1","score":"-5","tags":"swift|debugging|realm","view_count":"40"} +{"id":"29047018","title":"how to reload all otp code when developing an otp application?","body":"\u003cp\u003eWhile I'm learning OTP I've been making a lot of changes to the .app and .erl files and re-running my application to see the effect of the changes.\u003c/p\u003e\n\n\u003cp\u003eI've tried the following sequence of commands to pick up all my new changes, but it doesn't seem to work:\u003c/p\u003e\n\n\u003cp\u003eCompile src files ...\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eerlc -o ebin src/*.erl\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e... followed by this is the erlang shell:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eapplication:stop(my_app).\napplication:unload(my_app).\napplication:load(my_app).\napplication:start(my_app).\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, this doesn't seem to work. The only way I have found to work is to exit the erlang shell, recompile the app and then run \u003ccode\u003eapplication:start(my_app).\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eIs there an easier way of picking up my changes?\u003c/p\u003e","accepted_answer_id":"29047956","answer_count":"1","comment_count":"2","creation_date":"2015-03-14 08:31:50.35 UTC","last_activity_date":"2015-03-14 10:39:10.99 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1033422","post_type_id":"1","score":"1","tags":"erlang|erlang-shell","view_count":"255"} +{"id":"35283660","title":"Get value from select angularJs and Firebase","body":"\u003cp\u003eI am currently working on a CRM in angularJs and Firebase, but I need to get the variable from an \u003ccode\u003eng-repeat\u003c/code\u003e such follows\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;select class=\"form-control\" id=\"sel1\"\u0026gt;\n \u0026lt;option value=\"\"\u0026gt;--Choose an Account--\u0026lt;/option\u0026gt;\n \u0026lt;option class=\"dropdown\" value=\"{{contact.account}}\" ng-repeat=\"account in accounts\"\u0026gt;{{account.name}}\u0026lt;/option\u0026gt;\n\u0026lt;/select\u0026gt;\u0026lt;br /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eController\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e $scope.addConct = function () {\n var account = $scope.contact.account;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe \u003ccode\u003eaccounts.name\u003c/code\u003e is working fine, it shows all the accounts. How can I get that account string and assign that String to my \u003ccode\u003econtact.account\u003c/code\u003e?\u003c/p\u003e\n\n\u003cp\u003eThanks in advance. \u003c/p\u003e","accepted_answer_id":"35283721","answer_count":"1","comment_count":"0","creation_date":"2016-02-09 04:03:14.727 UTC","last_activity_date":"2016-02-09 06:11:32.72 UTC","last_edit_date":"2016-02-09 06:11:32.72 UTC","last_editor_display_name":"","last_editor_user_id":"4281154","owner_display_name":"","owner_user_id":"4734580","post_type_id":"1","score":"0","tags":"javascript|angularjs|firebase","view_count":"229"} +{"id":"19402818","title":"Best way to save images which comes from server in android","body":"\u003cp\u003eI am working on one application and getting product images from the server. \u003cem\u003eCurrently I am saving those images into the SQLite database after converting them into byte array and at the time of use I convert them back into bitmap.\u003c/em\u003e \u003c/p\u003e\n\n\u003cp\u003eNow I have below two queries:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003e\u003cp\u003eWhat is the best way to save the images in app from where we can sync them also and get when ever required.\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eHow to assign them on image view or button because sometimes memory issue arises and application stop suddenly.\u003c/p\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003ePlease guide me. Any help is appreciated. \u003c/p\u003e","answer_count":"3","comment_count":"6","creation_date":"2013-10-16 11:59:49.227 UTC","favorite_count":"1","last_activity_date":"2013-10-17 11:27:42.57 UTC","last_edit_date":"2013-10-17 11:27:42.57 UTC","last_editor_display_name":"","last_editor_user_id":"2794829","owner_display_name":"","owner_user_id":"2794829","post_type_id":"1","score":"2","tags":"android|file|bitmap|android-sqlite|android-image","view_count":"2224"} +{"id":"45199303","title":"Which class to use for keeping time and date in Java","body":"\u003cp\u003eI'm building a simple organizer app and trying to pick a class to keep my date and time in object. Which classes should I use? I've seen that lots of methods in \u003ccode\u003eDate\u003c/code\u003e class are deprecated. Maybe \u003ccode\u003eCalendar\u003c/code\u003e then? Recommend something. Thanks.\u003c/p\u003e","accepted_answer_id":"45200143","answer_count":"2","comment_count":"9","creation_date":"2017-07-19 19:20:24.877 UTC","last_activity_date":"2017-07-19 20:10:24.38 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6567136","post_type_id":"1","score":"0","tags":"java|class|date|time|calendar","view_count":"421"} +{"id":"29374435","title":"Placing 2 divs (top bottom) behind container div","body":"\u003cp\u003eIm trying to place background divs behind the container. I thought i would place one div at the top and one at the bottom. Then make the container have a position:relative. But only the top goes behind the container. This is what it looks like \u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://oi62.tinypic.com/2lm3mvk.jpg\" rel=\"nofollow\"\u003ehttp://oi62.tinypic.com/2lm3mvk.jpg\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eAnd this is how i want it to look like \u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://oi57.tinypic.com/5zjjvs.jpg\" rel=\"nofollow\"\u003ehttp://oi57.tinypic.com/5zjjvs.jpg\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eBoth blue divs are suppossed to be behind and the brown div is the container. The red divs are header/footer. How am I suppossed to do this?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;body\u0026gt;\n \u0026lt;div id=\"wrapper\"\u0026gt;\n \u0026lt;div id=\"top\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;div class=\"blueLeft\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;div class=\"padding\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;div id=\"container\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;div class=\"blueRight\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;div id=\"bottom\"\u0026gt;\u0026lt;/div\u0026gt;\n\n\n \u0026lt;/div\u0026gt;\n \u0026lt;/body\u0026gt;\n\n#wrapper{\n width:100%;\n height:100%;\n}\n\n#top,#bottom{\n background-color: red;\n width:100%;\n height:200px;\n clear:both;\n}\n\n#container{\n background-color: brown;\n width:800px;\n height:600px;\n margin:0 auto;\n position: relative;\n}\n\n.blueLeft{\n width: 100%;\n height: 200px;\n background-color: blue;\n float:left;\n}\n\n.blueRight{\n width: 100%;\n height: 300px;\n background-color: blue;\n float:right;\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"29374995","answer_count":"3","comment_count":"5","creation_date":"2015-03-31 17:08:40.39 UTC","last_activity_date":"2015-06-11 23:40:14.24 UTC","last_edit_date":"2015-06-11 23:40:14.24 UTC","last_editor_display_name":"","last_editor_user_id":"64046","owner_display_name":"","owner_user_id":"4734903","post_type_id":"1","score":"1","tags":"html|css|css-float","view_count":"205"} +{"id":"25855887","title":"App Engine not iterating over a cursor?","body":"\u003cp\u003eI perform an app engine query to get a cursor (wrec), and the code shows the number of records correctly by iterating. But then \"for rec in wrec\" does not run (no logging.info inside this loop).\u003c/p\u003e\n\n\u003cp\u003eThere's also a GQL SELECT of the same table, with another cursor (wikiCursor) that jinja2 renders properly. Here's the part that doesn't work:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ewrec = Wiki.all().ancestor(wiki_key()).filter('pagename \u0026gt;=', findPage).filter('pagename \u0026lt;', findPage + u'\\ufffd').run()\nfoundRecs = sum(1 for _ in wrec) \nlogging.info(\"Class WikiPage: foundRecs is %s\", foundRecs)\naFoundRecs = []\nif foundRecs \u0026gt; 0: \n for rec in wrec:\n logging.info(\"Class WikiPage: value is %s\", wrec.pagename)\n aFoundRecs.append(rec.pagename)\n self.render(\"permalink.html\", userRec=self.userRec, wikipage=pagename,\n wikiCursor=wikiCursor, wrec=wrec, foundRecs=foundRecs)\nelse:\n errorText = \"Could not find anything for your entry.\"\n self.render(\"permalink.html\", userRec=self.userRec, wikipage=pagename, wikiCursor=wikiCursor, error=errorText) \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is a portion of the log, showing the first logging.info statement, but not the second:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eINFO 2014-09-15 19:35:29,525 main.py:410] Class WikiPage: foundRecs is 3\nINFO 2014-09-15 19:35:29,581 module.py:652] default: \"POST / HTTP/1.1\" 200 3058\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhy is the wrec for loop not running?\u003c/p\u003e","accepted_answer_id":"25859770","answer_count":"1","comment_count":"1","creation_date":"2014-09-15 19:53:17.4 UTC","last_activity_date":"2014-09-16 02:24:43.19 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2415720","post_type_id":"1","score":"0","tags":"google-app-engine|python-2.7|cursor|iteration|jinja2","view_count":"51"} +{"id":"39236089","title":"Socket - sending a big string in c","body":"\u003cp\u003eI am trying to understand why my function dosnt sending the all string (Its send only 53576 elements from 365568: \nThis is the function I am using in the client side: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#define DATASIZEBUFFER 4000// 365568\nvoid DieWithError(char *errorMessage);/* Error handling function */\n\n\nvoid TcpClient ( char *servIP , unsigned short echoServPort , Hash_t *HashData)//(int argc, char *argv[])\n{\nint sock; //Socket descriptor \nstruct sockaddr_in ServAddr; //Echo server address \nint bytesRcvd, totalBytesRcvd; //Bytes read in single recv()\n //and total bytes read \n\n// Create a reliable, stream socket using TCP \nif ((sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP)) \u0026lt; 0)\n DieWithError(\" socket () failed\") ;\n\n// Construct the server address structure \nmemset(\u0026amp;ServAddr, 0, sizeof(ServAddr)); /* Zero out structure */\nServAddr.sin_family = AF_INET; /* Internet address family */\nServAddr.sin_addr.s_addr = inet_addr(servIP);/* Server IP address */\nServAddr.sin_port = htons(echoServPort); /* Server port */\n\n// Establish the connection to the server \nif (connect(sock, (struct sockaddr *) \u0026amp;ServAddr, sizeof(ServAddr)) \u0026lt; 0)\n DieWithError(\" connect () failed\") ;\nfor (;;)\n{\n// Send the string to the server //\n\n if (send(sock, HashData-\u0026gt;array , HashData-\u0026gt;elementNumber, 0) != HashData-\u0026gt;elementNumber)\n {\n printf (\"Bytes Nedded to recived: %ld\\nAnd (DATASIZEBUFFER) is %d\\n\", HashData-\u0026gt;elementNumber , DATASIZEBUFFER);\n DieWithError(\"send() sent a different number of bytes than expected\");\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"39236256","answer_count":"1","comment_count":"1","creation_date":"2016-08-30 19:58:03.87 UTC","last_activity_date":"2016-08-31 21:58:51.643 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6426442","post_type_id":"1","score":"1","tags":"c|sockets","view_count":"110"} +{"id":"36339225","title":"What is the right type of file for server side includes","body":"\u003cp\u003eI have been coding a website using html and css. To improve my website and to be more efficient, I have been trying to incorporate server side includes for my header, nabber, content section, and footer. I have researched many different ways to do this. I have come up with this so far:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;!-- #include virtual=\"../includes/navbar.txt\" --\u0026gt;\n\u0026lt;!--#include virtual=\"../includes/content.txt\"--\u0026gt;\n\u0026lt;!--include virtual=\"../includes/footer.txt\"--\u0026gt;\n\u0026lt;!-- #include virtual=\"../includes/header.txt\" --\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWith the proper syntax of the exclamation point and all that.\u003c/p\u003e\n\n\u003cp\u003eThis does not work when testing using MAMP or any other tester.\nIs there a different type of file that would work when using SSI's instead of .txt? Thank you! \u003c/p\u003e","accepted_answer_id":"36356140","answer_count":"1","comment_count":"4","creation_date":"2016-03-31 16:46:12.367 UTC","last_activity_date":"2016-04-01 12:16:56.49 UTC","last_edit_date":"2016-04-01 12:13:19.883 UTC","last_editor_display_name":"","last_editor_user_id":"1982831","owner_display_name":"","owner_user_id":"6124406","post_type_id":"1","score":"2","tags":"html|ssi","view_count":"52"} +{"id":"28168768","title":"append ajax response on popup window using jquery-mobile","body":"\u003cp\u003eI am developing a application . in that i want to append ajax response on \n popup window using jquery mobile . so how to append it . i am posting some\u003cbr\u003e\n few code . i want to append response on \u003cem\u003ed2 id\u003c/em\u003e that id is of tag.\n \u003cstrong\u003eMy ajax code\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e $(\"#b1\").click(function(){\n $.ajax({\n type:\"post\",\n url:\"http://localhost/register.php\",\n data: $(\"#frm\").serialize(),\n success:function(response)\n\n {\n\n $(\"#d2\").html(response);\n\n\n },\n error:function(response)\n {\n }\n });\n }); \n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-01-27 10:55:12.86 UTC","last_activity_date":"2015-01-27 11:00:56.797 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4468954","post_type_id":"1","score":"0","tags":"php|ajax|html5|jquery-mobile","view_count":"169"} +{"id":"10281552","title":"setStorageEncryption produces no effect","body":"\u003cp\u003eI've played with Device Administration API on my Pandaboard and it seems that setStorageEncryption method produces no effect, despite status returned by getStorageEncryption is TRUE.\u003c/p\u003e\n\n\u003cp\u003eIn case of Panda board the application internal storage is physically placed somewhere on the removable flash card (it doesn't have any other flash storage). So i did the following:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eCall setStorageEncryption(true) (DeviceAdminSample.java from ApiDemos example).\u003c/li\u003e\n\u003cli\u003eVerify that the encryption is active by calling getStorageEncryption, getStorageEncryptionStatus and save an example file on internal storage.\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cpre class=\"lang-java prettyprint-override\"\u003e\u003ccode\u003eif (mDPM.getStorageEncryption(mDeviceAdminSample)) {\n string = \"TRUE Encryption\";\n}\n\nFileOutputStream fos = null;\n\nfos = openFileOutput(\"hello_file.txt\", Context.MODE_PRIVATE);\nfos.write(string.getBytes());\nfos.close();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003col\u003e\n\u003cli\u003e\u003cp\u003eExtract the SD card from the Pandaboard, put it into the card-reader and copy the whole content to my PC\u003c/p\u003e\n\n\u003cp\u003esudo dd if=/dev/sdc of=~/workspace/flash_card.bin\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003etry to find the string:\n\u003c/p\u003e\n\n\u003cp\u003e$ grep -Ubo --binary-files=text 'TRUE Encryption' ~/workspace/flash_card.bin\u003c/p\u003e\n\n\u003cp\u003e583576877:TRUE Encryption\u003c/p\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eAs it found the string i make a conclusion that no encryption is in place.\u003c/p\u003e\n\n\u003cp\u003eDoes actually setStorageEncryption enables the encryption or it only requests encryption or in other words \"declares your intent\" to have the storage encrypted?\u003c/p\u003e","accepted_answer_id":"11995104","answer_count":"1","comment_count":"0","creation_date":"2012-04-23 13:31:15.79 UTC","favorite_count":"1","last_activity_date":"2012-08-16 20:40:26.207 UTC","last_edit_date":"2012-04-23 14:39:46.303 UTC","last_editor_display_name":"","last_editor_user_id":"779136","owner_display_name":"","owner_user_id":"779136","post_type_id":"1","score":"9","tags":"java|android|security|encryption","view_count":"1093"} +{"id":"40033089","title":"wpdb foreach loop with if/else statement","body":"\u003cp\u003eI know this has been asked hundreds of times but I am skipping a step somewhere and would really appreciate it if someone could help me figure out what's wrong (or help me write it better).\u003c/p\u003e\n\n\u003cp\u003eI'm using wordpress/woocommerce. When a user buys a product, I insert the following into a table: user_id, email, product_id, timestamp.\u003c/p\u003e\n\n\u003cp\u003eOn each product page I am trying to write some code that loops through the table to check if the user has bought the respective video; if so, it'll display the video, if not, it'll show some text.\u003c/p\u003e\n\n\u003cp\u003eMy logic is a bit off, or I'm doing too much, but I am trying to follow \u003ca href=\"https://codex.wordpress.org/Class_Reference/wpdb#SELECT_Generic_Results\" rel=\"nofollow\"\u003ethe example\u003c/a\u003e in the codex. Right now with the code below it will display the video for that page (since I've purchased it), but if I haven't it won't display the \u003cem\u003eelse\u003c/em\u003e text; I will have 6-9 videos so if I can make this code more efficient I would love to learn how. Thanks. Here is my code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eglobal $wpdb;\n$user_id = get_current_user_id();\n\n$results = $wpdb-\u0026gt;get_results(\"SELECT * FROM awdwp_webinar_orders WHERE user_id=\" . $user_id . \"\");\n\nif ( $results ) {\n foreach( $results as $result ) {\n $loop_uid = $result-\u0026gt;user_id;\n $loop_pid = $result-\u0026gt;product_id;?\u0026gt;\n\n if ( is_product(991) \u0026amp;\u0026amp; $loop_uid == $user_id \u0026amp;\u0026amp; $loop_pid == 991 ) {\n echo '\u0026lt;h2\u0026gt;' . get_the_title($id) . '\u0026lt;h2\u0026gt;';\n $the_video = get_field('video_file'); \n //display video code\n } //end if\n } //end foreach \n} else {\n echo \"please purchase\";\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"0","creation_date":"2016-10-14 00:24:53.603 UTC","last_activity_date":"2016-10-17 21:36:26.943 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7010018","post_type_id":"1","score":"0","tags":"php|mysql|wordpress","view_count":"62"} +{"id":"25254700","title":"Communicating with/opening Containing app from Share extension","body":"\u003cp\u003eHere is what I have tried that has NOT worked:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eUsing openURL to attempt to open the containing app\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eHere is what I have thought of that wouldn't work:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eUsing local notifications to provide a link to the containing app (creating the local notification from the extension)\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eHere are options I am considering:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eUsing a UIDocumentInteractionController and a custom file extension type to provide a link to my containing app (and my containing app only)\u003c/li\u003e\n\u003cli\u003eStarting a \"fake\" NSURL session to get the following functionality: In iOS, if your extension isn’t running when a background task completes, the system launches your containing app in the background and calls the application:handleEventsForBackgroundURLSession:completionHandler: app delegate method.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eThe UIDocumentInteractionController is confirmed to work in Xcode 6.5, but the flow is kind of wonky. The NSURL thing should work as well, but it's also a bit fishy. Does anyone have any other ideas of getting my containing app to open from a share extension, or an idea to communicate with it from a share extension?\u003c/p\u003e","answer_count":"1","comment_count":"5","creation_date":"2014-08-12 01:05:08.37 UTC","favorite_count":"8","last_activity_date":"2014-08-12 18:38:09.427 UTC","last_edit_date":"2014-08-12 18:38:09.427 UTC","last_editor_display_name":"","last_editor_user_id":"3923882","owner_display_name":"","owner_user_id":"3923882","post_type_id":"1","score":"10","tags":"ios|ios8|ios-app-extension","view_count":"4832"} +{"id":"15236652","title":"Issues starting a rails server","body":"\u003cp\u003eI am working on an application that makes use of Ruby on Rails. There are 5 of us in the group and so we are using GitHub. I have rails setup on my computer and am able to create my own projects and databases from scratch but when I clone our existing project from GitHub and try to start the server I run into all sorts of issues. \u003c/p\u003e\n\n\u003cp\u003eI should mention that I am working on a Windows 7 machine and the initial project was created on a Linux machine. I imagine this could be the source of some of the issues.\u003c/p\u003e\n\n\u003cp\u003eBottom line, when I am in the necessary folder and I type \u003ccode\u003erails s\u003c/code\u003e I get a lengthy error message that starts with:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eC:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32\n/lib/mysql2/client.rb:44:in `connect': Access denied for user 'root'@'localhost'\n(using password: NO) (Mysql2::Error)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThere is a ton more information that I could provide but I'm not sure what all is needed to help solve this issue. I am a beginner (both with StackOverflow and RoR) so I apologize for not being more clear and concise. \u003c/p\u003e\n\n\u003cp\u003eThanks in advance.\u003c/p\u003e\n\n\u003cp\u003eAdditional Information:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003emysql: Ver 14.14 Distrib 5.5.30, for Win 64 (x86) \u003c/li\u003e\n\u003cli\u003eruby: Ver 1.9.3p125\u003c/li\u003e\n\u003cli\u003erails: Ver 3.2.0 \u003c/li\u003e\n\u003cli\u003emysql gem: Ver 2.9.1 \u003c/li\u003e\n\u003cli\u003emysql2 gem: Ver 0.3.11\u003c/li\u003e\n\u003c/ul\u003e","accepted_answer_id":"15236725","answer_count":"1","comment_count":"0","creation_date":"2013-03-06 00:12:23.033 UTC","last_activity_date":"2013-03-06 00:20:25.253 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2108990","post_type_id":"1","score":"0","tags":"ruby-on-rails|github","view_count":"86"} +{"id":"15190333","title":"Windows 8 StorageFile.GetFileFromPathAsync Using UNC Path","body":"\u003cp\u003eHas anyone EVER managed to use a windows 8 app to copy files from a unc dir to a local dir ?\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://msdn.microsoft.com/en-us/library/windows/apps/hh967755.aspx\" rel=\"nofollow\"\u003eAccording to the official documentation here\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eIt is possible to connect to a UNC path\u003c/p\u003e\n\n\u003cp\u003eI am using the std FILE ACCESS sample and have changed one line of code to read as below\nI have added all the capabilities\nAdded .txt as a file type\nThe UNC path is read write to everyone and is located on the same machine..\u003c/p\u003e\n\n\u003cp\u003eBut I keep getting Access Denied Errors.\u003c/p\u003e\n\n\u003cp\u003eCan anyone possibly provide me with a working example \nThis is driving me mad and really questioning the whole point of win 8 dev for LOB apps.\u003c/p\u003e\n\n\u003cp\u003eTIA\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate async void Initialize()\n {\n try\n {\n //sampleFile = await Windows.Storage.KnownFolders.DocumentsLibrary.GetFileAsync(filename);\n string myfile = @\"\\\\ALL387\\Temp\\testfile.txt\";\n sampleFile = await Windows.Storage.StorageFile.GetFileFromPathAsync(myfile);\n\n }\n catch (FileNotFoundException)\n {\n // sample file doesn't exist so scenario one must be run\n }\n\n catch (Exception e)\n {\n var fred = e.Message;\n\n }\n }\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"0","creation_date":"2013-03-03 20:14:59.42 UTC","last_activity_date":"2014-02-08 00:33:47.79 UTC","last_edit_date":"2013-03-03 20:16:33.797 UTC","last_editor_display_name":"","last_editor_user_id":"1776603","owner_display_name":"","owner_user_id":"957996","post_type_id":"1","score":"0","tags":"file|windows-8|unc","view_count":"7202"} +{"id":"35552024","title":"I want to set the print area of a sheet to nothing without having to hiding the sheet","body":"\u003cp\u003eI have a document that I print out regularly and have a version control page that I don't want to include within it.\u003c/p\u003e\n\n\u003cp\u003eDoes anyone have a way of doing this short of hiding the sheet or printing sheets 2-10?\u003c/p\u003e\n\n\u003cp\u003eI'd ideally not like to use VBA but will if needs be.\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e\n\n\u003cp\u003eUpdate\u003c/p\u003e\n\n\u003cp\u003eThis has been marked as duplicate but as per above, I don't want to use VBA so I am looking for an alternative solution to the other question. Thanks\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2016-02-22 11:07:02.173 UTC","last_activity_date":"2016-02-22 11:24:31.03 UTC","last_edit_date":"2016-02-22 11:24:31.03 UTC","last_editor_display_name":"","last_editor_user_id":"3032288","owner_display_name":"","owner_user_id":"3032288","post_type_id":"1","score":"1","tags":"excel","view_count":"25"} +{"id":"37509977","title":"Faraday get access to the request parameters","body":"\u003cp\u003eStruggling a bit with faraday. I would like to know what I actually send to the server. I get the response body, but not access the request body. I found that there is a \u003ccode\u003erequest.env\u003c/code\u003e method, but I can't get access to the body there somehow.\u003c/p\u003e\n\n\u003cp\u003eHow would that work?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003econn = Faraday.new(:url =\u0026gt; 'http://sushi.com') do |faraday|\n faraday.request :url_encoded # form-encode POST params\n faraday.response :logger # log requests to STDOUT\n faraday.adapter Faraday.default_adapter # make requests with Net::HTTP\nend\n\ndata = conn.post do |req|\n req.url '/nigiri'\n req.headers['Content-Type'] = 'application/json'\n req.body = '{ \"name\": \"Unagi\" }'\nend\n\n# how do I get access to the request body here?\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat I tried doing was this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[4] pry(main)\u0026gt; request.env.request\n\n=\u0026gt; #\u0026lt;struct Faraday::RequestOptions\n params_encoder=nil,\n proxy=nil,\n bind=nil,\n timeout=nil,\n open_timeout=nil,\n boundary=nil,\n oauth=nil\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut I have no access to the body. Any ideas?\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","accepted_answer_id":"37513569","answer_count":"1","comment_count":"1","creation_date":"2016-05-29 12:36:48.863 UTC","favorite_count":"1","last_activity_date":"2016-05-29 18:41:19.637 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"788652","post_type_id":"1","score":"1","tags":"ruby|faraday","view_count":"655"} +{"id":"40682449","title":"InAppBrowser plugin Authentication","body":"\u003cp\u003eI have an \u003cstrong\u003eIonic 2\u003c/strong\u003e app made to view \u003cem\u003e.pdf\u003c/em\u003e files on a server where \u003cstrong\u003eauthentication\u003c/strong\u003e with a cookie is required.\nI want to use the \u003cstrong\u003eInAppBrowser\u003c/strong\u003e plugin with Ionic Native to do it.\nDoes the opened page keep your cookies to keep you authenticated ?\nAnd if not, how can I view \u003cem\u003e.pdf\u003c/em\u003e files authenticated ?\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2016-11-18 17:03:34.11 UTC","last_activity_date":"2016-11-18 18:19:00.533 UTC","last_edit_date":"2016-11-18 18:19:00.533 UTC","last_editor_display_name":"","last_editor_user_id":"3915438","owner_display_name":"","owner_user_id":"4269276","post_type_id":"1","score":"1","tags":"javascript|html|cordova|ionic-framework|ionic2","view_count":"74"} +{"id":"13694185","title":"How can I split the output of \"ps -ef\" into \"row output\"","body":"\u003cp\u003eHow can I split the output of \"ps -ef\" into \"row output\". One of the problems I am having is how to handle the \"gpm -m /dev/input/mice -t exps2\" as a single item during string tokenization.\u003c/p\u003e\n\n\u003cp\u003eIf 'ps -ef' output is like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eroot 3410 1 0 Jun17 ? 00:00:00 gpm -m /dev/input/mice -t exps2\nroot 3424 1 0 Jun17 ? 00:00:00 crond\nroot 3488 1 0 Jun17 ? 00:00:00 /usr/sbin/atd\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThen, how can I pretty print it so it looks like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e1:\nroot\n3410\n00:00:00\ngpm -m /dev/input/mice -t exps2\n\n2: \nroot\n3424\n00:00:00\ncrond\n\n3: \nroot\n3488\n00:00:00\n/usr/sbin/atd\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"13695683","answer_count":"3","comment_count":"1","creation_date":"2012-12-04 00:24:53.277 UTC","last_activity_date":"2012-12-04 17:46:17.557 UTC","last_edit_date":"2012-12-04 00:34:56.617 UTC","last_editor_display_name":"","last_editor_user_id":"118228","owner_display_name":"","owner_user_id":"118228","post_type_id":"1","score":"0","tags":"bash|shell","view_count":"396"} +{"id":"43125110","title":"Tensorflow classification not running correctly with multiprocessing, but is with multithreading","body":"\u003cp\u003eI have an app that should be classifying images in parallel every 5 seconds. I want to get around the Global Interpreter Lock, so I am trying to use the multiprocessing library rather than multithreading. More or less, my code looks like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e# Loads label file, strips off carriage return\nlabel_lines = [line.rstrip() for line \n in tf.gfile.GFile(\"/home/aneksteind/tensorflowSource/output_labels.txt\")]\n\n# Unpersists graph from file\nf = tf.gfile.FastGFile(\"/home/aneksteind/tensorflowSource/output_graph.pb\", 'rb')\ngraph_def = tf.GraphDef()\ngraph_def.ParseFromString(f.read())\n_ = tf.import_graph_def(graph_def, name='')\n\nsess = tf.Session()\nmainGraph = sess.graph\n\n# a function that starts a thread for each region of interest to classify\ndef checkFrames():\n timer = threading.Timer(5.0, checkFrames)\n timer.daemon = True\n timer.start()\n if(started):\n index = 0\n threads = []\n for roi in rois:\n p = Process(target=containsPlane, args=(frame, roi, index))\n p.daemon = True\n p.start()\n index += 1\n\ndef containsPlane(frame, roi, index):\n tempGraph = mainGraph\n tempSession = tf.Session(graph=tempGraph)\n tempTensor = tempSession.graph.get_tensor_by_name('final_result:0')\n predictions = tempSession.run(tempTensor, \\\n {'DecodeJpeg:0': subframe})\n\n ...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I am running this code using a Thread, it runs just fine. It prints out each preliminary message/warnings before classifying for the first time only once and classifies each image, but not in parallel.\u003c/p\u003e\n\n\u003cp\u003eWhen I change to a Process, the preliminary messages/warnings repeatedly show up and the images are never classified. Could this be due to the sessions sharing a state of some sort? What can I do differently so that multiple images are classified in parallel?\u003c/p\u003e","answer_count":"1","comment_count":"5","creation_date":"2017-03-30 17:55:03.46 UTC","last_activity_date":"2017-03-31 15:04:04.547 UTC","last_edit_date":"2017-03-30 18:22:45.75 UTC","last_editor_display_name":"","last_editor_user_id":"4884986","owner_display_name":"","owner_user_id":"4884986","post_type_id":"1","score":"0","tags":"python|multithreading|python-3.x|parallel-processing|tensorflow","view_count":"102"} +{"id":"5850847","title":"This `do..while` loop isn't working","body":"\u003cpre\u003e\u003ccode\u003eint sc1,sc2,a=0,b=0;\n\ndo\n{\n\n printf(\"Give the scores\\n\");\n\n scanf(\"%d %d\", \u0026amp;sc1,\u0026amp;sc2);\n\n //===============================================\n\n if (sc1 \u0026gt; sc2) \n a+=1;\n else if (sc1\u0026lt;sc2)\n b+=1;\n else if (sc1==sc2)\n printf(\"tie\\n\");\n\n //===============================================\n\n if (a\u0026gt;b) \n printf(\"team 1 is in the lead\\n\");\n else if (a\u0026lt;b)\n printf(\"team 2 is in the lead\\n\");\n else if (b==a)\n printf(\"tie\\n\"); \n\n}\nwhile((a==3) || (b==3));\n\n//===============================================\n\n\nif (a==3)\n printf(\"team 1 got the cup\");\nelse\n printf(\"team 2 got the cup\");\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI think that I wrote something wrong. I've searched it a lot but can't seem to find what is wrong with it.\u003c/p\u003e\n\n\u003cp\u003e(One of the two teams can win the cup and that team has to have 3 wins)\u003c/p\u003e\n\n\u003cp\u003e*else if(sc1\n\n\u003cp\u003e*else if(a\u003eb)\u003c/p\u003e","accepted_answer_id":"5850864","answer_count":"5","comment_count":"2","creation_date":"2011-05-01 19:41:32.037 UTC","last_activity_date":"2014-06-11 17:07:07.513 UTC","last_edit_date":"2014-06-11 17:07:07.513 UTC","last_editor_display_name":"","last_editor_user_id":"1227991","owner_display_name":"","owner_user_id":"733587","post_type_id":"1","score":"0","tags":"c++|loops|while-loop|do-while","view_count":"472"} +{"id":"45734680","title":"Stop Highcharts plot area from adjusting","body":"\u003cp\u003eI am using Highcarts with React to create a dynamic line graph. On the graph there is a series for a vertical line which can be moved around the graph in response to some user inputs elsewhere on the page.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/cQTN0.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/cQTN0.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThe problem I am having is that when the vertical line is dragged to either end of the graph, Highcharts automatically adjusts the plotting area to make space for it, resulting in the graph shifting to the left or right.\u003c/p\u003e\n\n\u003cp\u003eI would like to turn this off and allow enough space on either side of the graph so that no automatic adjustment of the graph is performed. I have tried setting \u003ccode\u003emargin\u003c/code\u003e and \u003ccode\u003espacing\u003c/code\u003e parameters of the chart but they do not extend the plot area in the way I need.\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2017-08-17 12:06:18.447 UTC","last_activity_date":"2017-08-17 12:06:18.447 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"655214","post_type_id":"1","score":"0","tags":"highcharts","view_count":"23"} +{"id":"39646542","title":"TSQL Number Rows Based on change in fieldvalue and sorted on date with incremented numbers on duplicates","body":"\u003cp\u003eSay I have a data like the following:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eX | 2/2/2000\nX | 2/3/2000\nB | 2/4/2000\nB | 2/10/2000\nB | 2/10/2000\nJ | 2/11/2000\nX | 3/1/2000\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI would like to get a dataset like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e1 | X | 2/2/2000\n1 | X | 2/3/2000\n2 | B | 2/4/2000\n2 | B | 2/10/2000\n2 | B | 2/10/2000\n3 | J | 2/11/2000\n4 | X | 3/1/2000\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo far everything I have tried has either ended up numbering each change resetting the count on each field value change or in the example leave the last X as 1.\u003c/p\u003e","accepted_answer_id":"39646630","answer_count":"2","comment_count":"3","creation_date":"2016-09-22 18:38:12.677 UTC","last_activity_date":"2016-09-22 18:43:18.403 UTC","last_edit_date":"2016-09-22 18:43:18.403 UTC","last_editor_display_name":"","last_editor_user_id":"1144035","owner_display_name":"","owner_user_id":"1255686","post_type_id":"1","score":"0","tags":"sql|sql-server","view_count":"13"} +{"id":"31736003","title":"Not sure what im supposed to do using StringBuilder","body":"\u003cp\u003eI'm being asked to provide my own implementations in a new class for the methods listed below. I'm not sure what i am supposed to do with them. Any ideas? I just recently switched over to java from using C++. Most area are at least somewhat similar between the two but I am having difficulty with strings and methods. \u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003eOkay that all makes sense but what am i supposed to do with these methods? like the first one \"public MystringBuilder1(String s)\". is that just declaring the variable \"s\" as a string type? and how do i implement it? If you put \"public MystringBuilder1(String s)\" in a class it just comes back with an error. The book never explained any of those methods and then said \"here do this\" so i am totally lost. Maybe im just missing the point?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic MyStringBuilder1(String s);\n\npublic MyStringBuilder1 append(MyStringBuilder1 s);\n\npublic MyStringBuilder1 append(int i);\n\npublic String toString();\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"31736084","answer_count":"2","comment_count":"4","creation_date":"2015-07-30 23:58:24.037 UTC","last_activity_date":"2015-07-31 20:05:04.163 UTC","last_edit_date":"2015-07-31 20:05:04.163 UTC","last_editor_display_name":"","last_editor_user_id":"5113138","owner_display_name":"","owner_user_id":"5113138","post_type_id":"1","score":"-4","tags":"java|methods|stringbuilder","view_count":"105"} +{"id":"39057174","title":"clip.stop(); not stopping audio from playing","body":"\u003cp\u003eI'm unable to get clip.stop() to stop the current sound unless it immediately follows\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e clip.loop(Clip.LOOP_CONTINUOUSLY);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere's a bit of the code that I'm currently using followed by code that does not produce a sound.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etry {\n Clip clip = AudioSystem.getClip();\n if(clock == 2){\n clip.open(AudioSystem.getAudioInputStream(new File(\"res//battle.wav\")));\n clip.loop(Clip.LOOP_CONTINUOUSLY);\n System.out.println(clock);\n }\n if(clock \u0026gt;=300){\n clip.stop();\n xaxis+=100;\n yaxis+=100;\n System.out.println(\"we tried to stop\");\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etry {\n Clip clip = AudioSystem.getClip();\n if(clock == 2){\n clip.open(AudioSystem.getAudioInputStream(new File(\"res//battle.wav\")));\n clip.loop(Clip.LOOP_CONTINUOUSLY);\n clip.stop();\n System.out.println(clock);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ecurrently clock = 2; only occurs once, otherwise it would have the audio overlapping and taking up all the memory loading the music.\nAny help is appreciated. Thank you.\u003c/p\u003e","accepted_answer_id":"39068527","answer_count":"1","comment_count":"0","creation_date":"2016-08-20 17:58:30.633 UTC","last_activity_date":"2016-08-21 21:55:32.3 UTC","last_edit_date":"2016-08-21 21:55:32.3 UTC","last_editor_display_name":"","last_editor_user_id":"4294782","owner_display_name":"","owner_user_id":"5559254","post_type_id":"1","score":"0","tags":"java|audio","view_count":"152"} +{"id":"46199124","title":"Test of Signal to Noise Ratio (SNR, dB) function in python","body":"\u003cp\u003eI'm wondering if there is an SNR function in python similar to Matlab one: \u003ca href=\"https://uk.mathworks.com/help/signal/ref/snr.html\" rel=\"nofollow noreferrer\"\u003ehttps://uk.mathworks.com/help/signal/ref/snr.html\u003c/a\u003e.\u003c/p\u003e\n\n\u003cp\u003eI have found \u003ca href=\"https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.signaltonoise.html\" rel=\"nofollow noreferrer\"\u003escipy.stats.signaltonoise\u003c/a\u003e, but here SNR is defined as the mean divided by the standard deviation, and that type of SNR is mainly used for images.\u003c/p\u003e\n\n\u003cp\u003eWhat I'm looking for is S/N = 20 log10(Asignal/Anoise).\u003c/p\u003e\n\n\u003cp\u003eI have created my own function:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efrom __future__ import division\nimport numpy as np;\nimport scipy as sp;\nfrom scipy.stats import signaltonoise\nfrom scipy.signal import argrelextrema\nfrom pylab import *\nimport operator\n\ndef SNR(signal):\n max_index, max_value = max(enumerate(signal), key=operator.itemgetter(1))\n leftsignal = signal[0:max_index];\n rightsignal = signal[max_index:];\n\n leftMin = array(leftsignal);\n rightMin = array(rightsignal);\n\n findLMin = argrelextrema(leftMin, np.less)[0][-1];\n findRMin = argrelextrema(rightMin, np.less)[0][0]+len(leftsignal);\n\n x = np.linspace(0, 100,len(signal));\n\n\n\n Anoise = np.mean(list(signal[0:findLMin])+list(signal[findRMin:]))\n #Asignal = 1-(signal[findLMin]+signal[findRMin])/2\n Asignal = 1-Anoise;\n\n snr_value = 20*np.log10(Asignal/Anoise);\n\n plot(x[0:findLMin], signal[0:findLMin],'b')\n plot(x[findLMin:findRMin],signal[findLMin:findRMin],'r')\n plot(x[findRMin:],signal[findRMin:],'b');\n plot([x[max_index], x[max_index]],[1, 1- Asignal],'r--');\n plot(x, x*0+Anoise,'b--');\n show();\n\n print snr_value\n return snr_value;\n\nSNR(signal);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWith my output the results are following:\n\u003ca href=\"https://i.stack.imgur.com/lSJN3.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/lSJN3.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eSNR = 37.3851761912dB\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003e\u003cstrong\u003eThe only question I have is, how to better calculate Asignal?\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Asignal = 1-(signal[findLMin]+signal[findRMin])/2\nOR\n Asignal = 1-Anoise;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf I did any stupid mistakes, please let me know.\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2017-09-13 13:38:36.727 UTC","last_activity_date":"2017-09-13 13:47:32.713 UTC","last_edit_date":"2017-09-13 13:47:32.713 UTC","last_editor_display_name":"","last_editor_user_id":"7174481","owner_display_name":"","owner_user_id":"7174481","post_type_id":"1","score":"0","tags":"python|signals|noise|ratio","view_count":"622"} +{"id":"25389686","title":"JQuery Typer effect not working in HTML","body":"\u003cp\u003eThis is my first time writing a website (personal page) and I'm having trouble getting a JQuery effect to work in the website. I found this code online (which basically says to add this to your webpage for it to work) but all that shows up is \"foo\" on the bottom of the page:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div id=\"typer\"\u0026gt;foo\u0026lt;/div\u0026gt;\n \u0026lt;script src=\"//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;script src='jquery.typer.js'\u0026gt;\u0026lt;/script\u0026gt; \n \u0026lt;script\u0026gt;\n var win = $(window),\n foo = $('#typer');\n foo.typer(['TEXT A', 'TEXT B', 1337]);\n \u0026lt;/script\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is all located in the bottom of the of my page. Am I missing something that will make the JQuery run?\u003c/p\u003e","accepted_answer_id":"25389801","answer_count":"1","comment_count":"3","creation_date":"2014-08-19 17:40:54.32 UTC","last_activity_date":"2014-08-19 17:48:12.847 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3957405","post_type_id":"1","score":"0","tags":"jquery|html","view_count":"43"} +{"id":"43000883","title":"angular 2 share html and code between components in same area of the app","body":"\u003cp\u003eI’m looking for a pattern and capabilities in angular2 to address the equivalent of ng-include in angular2 with something to also share code between components in same area of the app.\u003c/p\u003e\n\n\u003cp\u003eThe use case: My app will have several different areas, each area has it own header/footer and behavior. \u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eApp \"areas\" include:\u003c/strong\u003e \u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003e/welcome – public content \u003c/li\u003e\n\u003cli\u003e/login – still public but includes login,\nlogout, registration, etc. \u003c/li\u003e\n\u003cli\u003e/main – main end user part of the app\u003c/li\u003e\n\u003cli\u003e/admin – administration area\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eEach area like this includes multiple components and templates. \u003c/p\u003e\n\n\u003cp\u003eAt the moment I have template-html segments and component-code behavior that is manually replicated for all the components in an area. \u003c/p\u003e\n\n\u003cp\u003eIdeally I would like to class hierarchy or something similar to support this, so that code is written in one place for each segment. \u003c/p\u003e\n\n\u003cp\u003eAny ideas on how to implement that?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-03-24 13:33:11.883 UTC","last_activity_date":"2017-07-30 01:34:25.527 UTC","last_edit_date":"2017-03-24 15:08:11.293 UTC","last_editor_display_name":"","last_editor_user_id":"6342440","owner_display_name":"","owner_user_id":"6342440","post_type_id":"1","score":"0","tags":"angular|angular2-template","view_count":"295"} +{"id":"1129378","title":"C# creating callbacks playback finished","body":"\u003cp\u003eC# 2008 SP1\u003c/p\u003e\n\n\u003cp\u003eI am using the following code to record, play, and stop save the recording. Everything works fine. However, I would like to add a call back that will fire when the playback has finished.\u003c/p\u003e\n\n\u003cp\u003eI am P/Invoke using the winmm.dll library.\u003c/p\u003e\n\n\u003cp\u003eMany thanks for any advice.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic partial class SoundTest : Form\n {\n const uint SND_ASYNC = 0x0001;\n const uint SND_FILENAME = 0x00020000;\n const uint SND_NODEFAULT = 0x0002;\n\n [DllImport(\"winmm.dll\")]\n private static extern int mciSendString(string lpstrCommand, string lpstrReturnString, \n int returnLength, int hwndCallBack);\n\n [DllImport(\"winmm.dll\")]\n private static extern bool PlaySound(string pszsound, UIntPtr hmod, uint fdwSound);\n\n public SoundTest()\n {\n InitializeComponent();\n }\n\n private void Form1_Load(object sender, EventArgs e)\n {\n // Disable stop button\n this.btnSaveStop.Enabled = false;\n }\n\n private void btnRecord_Click(object sender, EventArgs e)\n {\n // Disable play and record button\n this.btnRecord.Enabled = false;\n this.btnPlay.Enabled = false;\n // Enable stop button\n this.btnSaveStop.Enabled = true;\n\n // Record from microphone\n mciSendString(\"Open new Type waveaudio Alias recsound\", \"\", 0, 0);\n mciSendString(\"record recsound\", \"\", 0, 0); \n }\n\n private void btnSaveStop_Click(object sender, EventArgs e)\n {\n // Enable play and record\n this.btnRecord.Enabled = true;\n this.btnPlay.Enabled = true;\n // Disable Stop button\n this.btnSaveStop.Enabled = false;\n mciSendString(\"save recsound c:\\\\record.wav\", \"\", 0, 0);\n mciSendString(\"close recsound \", \"\", 0, 0);\n }\n\n private void btnPlay_Click(object sender, EventArgs e)\n {\n //// Diable record button while playing back\n //this.btnRecord.Enabled = false;\n PlaySound(\"c:\\\\record.wav\", UIntPtr.Zero, SND_ASYNC | SND_FILENAME | SND_NODEFAULT); \n }\n }\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"0","creation_date":"2009-07-15 04:12:36.223 UTC","last_activity_date":"2009-07-15 07:49:49.403 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"70942","post_type_id":"1","score":"0","tags":"c#|callback","view_count":"1342"} +{"id":"38494358","title":"Javascript cannot read input value","body":"\u003cp\u003eMy input value is not being read by my javascript. First problem is because the input value has integrate with autoload \u003ccode\u003ediv\u003c/code\u003e. If I use a pure input value it works, but if the input is integrated with the autoload \u003ccode\u003ediv\u003c/code\u003e it stops working.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eHere's my php code:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;form method=\"post\" action=\"\" target=\"_parent\"\u0026gt;\n \u0026lt;h4 style=\"color: grey; font-size: 30px; margin: auto;\"\u0026gt;\u0026lt;b\u0026gt;Jumlah Diterima\u0026lt;/b\u0026gt;\u0026lt;/h4\u0026gt;\n \u0026lt;div class=\"input-control\"\u0026gt;\n \u0026lt;input type=\"text\" name=\"amt\" id=\"amt\" style=\"width:300px; font-size: 30px; height: 50px; font-weight: bold; margin: auto; color:grey;\"\u0026gt;\n \u0026lt;/div\u0026gt;\u0026lt;br/\u0026gt;\u0026lt;br/\u0026gt;\u0026lt;br/\u0026gt;\n \u0026lt;h4 style=\"color: grey; font-size: 30px; margin: auto;\"\u0026gt;\u0026lt;b\u0026gt;Jumlah Tagihan\u0026lt;/b\u0026gt;\u0026lt;/h4\u0026gt;\u0026lt;br\u0026gt;\u0026lt;br\u0026gt;\n \u0026lt;h4 style=\"color: grey; font-size: 30px; margin: auto;\"\u0026gt;\u0026lt;b\u0026gt;Rp. \u0026lt;?php echo $nominal; ?\u0026gt;,-\u0026lt;/b\u0026gt;\u0026lt;/h4\u0026gt;\n \u0026lt;input type=\"text\" id=\"nominal\" name=\"nominal\" value=\"1000\"\u0026gt;\n \u0026lt;br\u0026gt;\u0026lt;br\u0026gt;\u0026lt;br\u0026gt;\u0026lt;br\u0026gt;\u0026lt;br\u0026gt;\n\u0026lt;input type=\"submit\" value=\"Selesai\" style=\"background: #1ba1e2; border-color: #1ba1e2; height: 70px; font-weight: bold; margin-left: 150px; width:280px; font-size: 30px;\" class=\"button primary\" /\u0026gt;\n \u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eHere's my javascript\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;script type=\"text/javascript\" src=\"http://code.jquery.com/jquery-3.1.0.slim.js\"\u0026gt;\u0026lt;/script\u0026gt;\n\u0026lt;script type=\"text/javascript\"\u0026gt;\n var $jq = jQuery.noConflict();\n\u0026lt;/script\u0026gt;\n\u0026lt;script type=\"text/javascript\" src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\n\u0026lt;script\u0026gt;\n$jq(function() {\n var money = 7000;\n\n $jq(\"#nominal\").on(\"change keyup\", function() {\n var input = $jq(this);\n\n // remove possible existing message\n if( input.next().is(\"form\") )\n input.next().remove();\n\n // show message\n if( input.val() \u0026gt; money )\n input.after(\"\u0026lt;form method=\\\"post\\\" action=\\\"\\\"\u0026gt;\u0026lt;input type=\\\"submit\\\" name=\\\"yes\\\" value=\\\"Yes\\\"\u0026gt;\u0026lt;input type=\\\"submit\\\" name=\\\"no\\\" value=\\\"No\\\"\u0026gt;\u0026lt;/form\u0026gt;\");\n });\n});\n\u0026lt;/script\u0026gt;\n\u0026lt;script\u0026gt;\nfunction loadValue5() {\n $.ajax({\n method: 'GET',\n url: 'grab_count_old.php',\n success: function(responseText) {\n $('#amt').fadeOut('fast', function () {\n $('#amt').val(responseText).fadeIn('fast', function() {\n setTimeout(loadValue5, 100);\n });\n });\n }\n });\n}\nloadValue5();\n\u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eHere's my \u003ccode\u003egrab_count.php\u003c/code\u003e (Autoload)\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\ninclude(\"../config/db_function.php\");\ndb_function();\n\nmysql_select_db(\"testpy\") or die(mysql_error());\n$result = mysql_query(\"SELECT * FROM datapy ORDER BY No DESC LIMIT 0,1\")\nor die(mysql_error());\n while($row = mysql_fetch_array( $result )) {\n echo $row['nilai_1'];\n }\n\n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn some cases, if change the \u003ccode\u003eID\u003c/code\u003e in the javascript with \u003ccode\u003e#nominal\u003c/code\u003e (pure input) it will work, but if I change with \u003ccode\u003e#amt\u003c/code\u003e (input with autoload) it's not working. Any help would be appreciated on this, I am not sure how to fix it.\u003c/p\u003e","answer_count":"0","comment_count":"6","creation_date":"2016-07-21 03:23:41.077 UTC","last_activity_date":"2016-07-21 03:34:29.31 UTC","last_edit_date":"2016-07-21 03:34:29.31 UTC","last_editor_display_name":"","last_editor_user_id":"3711988","owner_display_name":"","owner_user_id":"6527250","post_type_id":"1","score":"0","tags":"javascript|php|jquery|html|input","view_count":"117"} +{"id":"32418278","title":"Giving a Client in a TCP Socket a unique ID in C","body":"\u003cp\u003eI have made a server in C that accepts any amount of clients to connect to it and stream a message. \u003c/p\u003e\n\n\u003cp\u003eI have a separate file called client.c that connects to this server using a socket. I want to give each client that is connected to the server a unique ID specified by the user.\u003c/p\u003e\n\n\u003cp\u003eThe clients can be on a separate system or the same system.\u003c/p\u003e\n\n\u003cp\u003eWould I have to create a client server that keeps track of all the clients currently active?\u003c/p\u003e\n\n\u003cp\u003eThank you! \u003c/p\u003e","answer_count":"0","comment_count":"6","creation_date":"2015-09-05 22:26:47.323 UTC","last_activity_date":"2015-09-05 22:26:47.323 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4139046","post_type_id":"1","score":"0","tags":"c|sockets|tcp|tcpclient|tcp-ip","view_count":"432"} +{"id":"13133132","title":"How to retrieve invalid references from Velocity Engine?","body":"\u003cp\u003eI am wondering if there is a way to retrieve a list of invalid references in Velocity after calling VelocityEngine.evaluate.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://stackoverflow.com/questions/7649289/velocity-eventhandler\"\u003eVelocity Eventhandler\u003c/a\u003e has some nice information about creating an \u003cstrong\u003eAppSpecificInvalidReferenceEventHandler\u003c/strong\u003e which I have used in the VelocityEngine as follows.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;bean id=\"templateVelocityEngine\" class=\"org.springframework.ui.velocity.VelocityEngineFactoryBean\"\u0026gt;\n \u0026lt;property name=\"velocityProperties\"\u0026gt;\n \u0026lt;props\u0026gt;\n \u0026lt;prop key=\"resource.loader\"\u0026gt;class\u0026lt;/prop\u0026gt;\n \u0026lt;prop key=\"class.resource.loader.class\"\u0026gt;org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader\u0026lt;/prop\u0026gt;\n \u0026lt;prop key=\"class.resource.loader.cache\"\u0026gt;true\u0026lt;/prop\u0026gt; \n \u0026lt;prop key=\"eventhandler.invalidreferences.class\"\u0026gt;xyz.util.AppSpecificInvalidReferenceEventHandler,org.apache.velocity.app.event.implement.ReportInvalidReferences\u0026lt;/prop\u0026gt;\n \u0026lt;/props\u0026gt;\n \u0026lt;/property\u0026gt; \n\u0026lt;/bean\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAfter velocity's evaluate call, I see the log statements showing that AppSpecificInvalidReferenceEventHandler is working, but I can't see how to retrieve that class and it's List of InvalidReferenceInfo if I declare the \u003cem\u003eeventhandler.invalidreferences.class\u003c/em\u003e in the Spring context as above.\u003c/p\u003e\n\n\u003cp\u003ePopulating and evaluating the template looks like the following :-\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eVelocityContext context = new VelocityContext();\nStringWriter bodyWriter = new StringWriter();\n\ncontext.put(\"body\", \"some body text!\");\n\nboolean result = templateVelocityEngine.evaluate(context, bodyWriter, \"logTag\", \"template ${body} text here loaded from a file\");\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo I would like to do something like the following (except ec.getInvalidReferenceEventHandlers() is null)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eEventCartridge ec = context.getEventCartridge();\nIterator it = ec.getInvalidReferenceEventHandlers();\n\nwhile (it.hasNext()) {\n Object obj = it.next();\n\n if (obj instanceof ReportInvalidReferences) {\n AppSpecificInvalidReferenceEventHandler handler = (AppSpecificInvalidReferenceEventHandler) obj;\n List invalidRefs = handler.getInvalidReferences();\n\n if (!invalidRefs.isEmpty()) {\n // process the list of invalid references here\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe only way around this I've found so far is to not declare \u003cem\u003eeventhandler.invalidreferences.class\u003c/em\u003e in the Spring bean i.e. instead I would do the following\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eReportInvalidReferences reporter = new AppSpecificInvalidReferenceEventHandler();\nEventCartridge ec = new EventCartridge();\nec.addEventHandler(reporter);\nec.attachToContext(context);\nVelocityContext context = new VelocityContext();\nStringWriter bodyWriter = new StringWriter();\n\ncontext.put(\"body\", \"some body text!\");\n\nboolean result = templateVelocityEngine.evaluate(context, bodyWriter, \"logTag\", \"template ${body} text here loaded from a file\");\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWith the additional pre Velocity evaluate setup code above (and commenting the \u003cem\u003eeventhandler.invalidreferences.class\u003c/em\u003e in the Spring bean), I can then call\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eec.getInvalidReferenceEventHandlers();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd I get back the AppSpecificInvalidReferenceEventHandler in the Iterator returned...\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2012-10-30 05:25:38.843 UTC","last_activity_date":"2012-10-30 05:25:38.843 UTC","last_edit_date":"2017-05-23 11:48:11.357 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"236383","post_type_id":"1","score":"1","tags":"velocity","view_count":"400"} +{"id":"32431175","title":"Google Places API not returning after second request","body":"\u003cp\u003eI have a few coordinate pairs that I am trying to poll Google Places for information. The problem is that after the second request (each request is at least 1 second apart from the other), the third request never returns - it just hangs there indefinitely.\u003c/p\u003e\n\n\u003cp\u003eHere is the code that I use to call Google Places;\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eMap\u0026lt;Double, Double\u0026gt; coordinates = new HashMap\u0026lt;\u0026gt;();\ncoordinates.put(40.7549309, -73.9840195);\ncoordinates.put(48.8616147, 2.3355015);\ncoordinates.put(36.106965, -112.112997);\n\n\nfor(Map.Entry\u0026lt;String, String\u0026gt; entry : coodinates.entrySet()){\n getNearbyPlaces(entry.getKey(), entry.getValue(), 50);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThere code responsible is here;\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate static final String API_URL = \"https://maps.googleapis.com/maps/api/place/json/key=%s\u0026amp;location=%f,%f\u0026amp;radius=%f\";\n\nprivate final HttpClient client = HttpClientBuilder.create().build();\n\npublic List\u0026lt;GeoLocation\u0026gt; getNearbyPlaces(final Double lat, final Double lng, final Double radius) {\n try {\n final String uri = String.format(API_URL, getApiKey(), lat, lng, radius);\n return getPlaces(uri, limit);\n } catch (Exception e) {\n LOGGER.error(String.format(\"error getting nearby places by lat=%f lng=%f\", lat, lng), e);\n throw new RuntimeException(e);\n }\n}\n\nprivate List\u0026lt;Place\u0026gt; getPlaces(final String uri, final Integer limit) throws IOException {\n\n Integer maxLimit = Math.min(limit, MAXIMUM_RESULTS); // max of 60 results possible\n int pages = (int) Math.ceil(maxLimit / (double) MAXIMUM_PAGE_RESULTS);\n\n final List\u0026lt;Place\u0026gt; places = new LinkedList\u0026lt;\u0026gt;();\n\n String updatedUri = uri;\n // new request for each page\n for (int i = 0; i \u0026lt; pages; i++) {\n final String raw = this.get(updatedUri);\n places.add(new Place(parseRawIntoPlace(raw))); \n final String nextPage = parseNextPage(raw);\n if (nextPage != null) {\n maxLimit -= MAXIMUM_PAGE_RESULTS;\n updatedUri = getNextUri(nextPage);\n sleep(3000); // Page tokens have a delay before they are available... 3 seconds ought to be plenty ...\n } else {\n break;\n }\n }\n\n return places;\n}\n\n\nprivate String get(final String uri) throws IOException {\n try {\n final HttpGet get = new HttpGet(uri);\n return readString(client.execute(get));\n } catch (Exception e) {\n throw new IOException(e);\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOf note is that this code worked fine till about a couple of weeks ago. This is a recent manifestation.\u003c/p\u003e\n\n\u003cp\u003eIf I kill the application, and run it again, it will complete the two requests, then just hang on the third one, again.\u003c/p\u003e\n\n\u003cp\u003eI have tried different coordinates at different order - I still get the same result (I tried to eliminate the very remote possibility of Google not liking a particular coordinate pair)\u003c/p\u003e\n\n\u003cp\u003eAny help is greatly appreciated.\u003c/p\u003e\n\n\u003cp\u003eFYI - my usage of the Places API falls well within their usage policies, and a fraction of the 2500 per day quota.\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2015-09-07 04:37:50.95 UTC","last_activity_date":"2015-09-07 04:37:50.95 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2270726","post_type_id":"1","score":"2","tags":"java|google-places-api|google-places","view_count":"70"} +{"id":"44670123","title":"Passing values directly to setter method using for loop","body":"\u003cp\u003ethis my getter and setter:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate int[] test;\n\npublic int[] getTest() {\n return Arrays.copyOf(test, test.length);\n}\n\npublic void setTest(int[] test) {\n this.test= Arrays.copyOf(test, test.length);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd here is my code for manually passing values to the setter method\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSample sample = new Sample(); \nsample.setTest(new int[]{0,1,2,3});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhat I want is something like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efor (int i = 0; i \u0026lt; 3; i++) {\n //code here for passing the value to the setter\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is working on my side, is there a way to pass this values using a for loop? Also I want to know how to pass in an array as a whole?\u003c/p\u003e","accepted_answer_id":"44670251","answer_count":"2","comment_count":"6","creation_date":"2017-06-21 07:59:02.187 UTC","last_activity_date":"2017-06-21 08:56:38.423 UTC","last_edit_date":"2017-06-21 08:56:38.423 UTC","last_editor_display_name":"","last_editor_user_id":"1531124","owner_display_name":"","owner_user_id":"2658856","post_type_id":"1","score":"3","tags":"java|arrays|for-loop|getter-setter","view_count":"158"} +{"id":"203382","title":"Do stateless random number generators exist?","body":"\u003cp\u003eIs there a difference between generating multiple numbers using a single random number generator (RNG) versus generating one number per generator and discarding it? Do both implementations generate numbers which are equally random? Is there a difference between the normal RNGs and the secure RNGs for this?\u003c/p\u003e\n\n\u003cp\u003eI have a web application that is supposed to generate a list of random numbers on behalf of clients. That is, the numbers should appear to be random from each client's point of view. Does this mean I need retain a separate random RNG per client session? Or can I share a single RNG across all sessions? Or can I create and discard a RNG on a per-request basis?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eUPDATE\u003c/strong\u003e: This question is related to \u003ca href=\"https://stackoverflow.com/questions/471157/is-a-subset-of-a-random-sequence-also-random\"\u003eIs a subset of a random sequence also random?\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"203646","answer_count":"10","comment_count":"0","community_owned_date":"2008-10-15 01:02:45.64 UTC","creation_date":"2008-10-15 01:02:45.657 UTC","favorite_count":"2","last_activity_date":"2009-03-07 00:15:53.98 UTC","last_edit_date":"2017-05-23 10:32:50.733 UTC","last_editor_display_name":"Jonathan Leffler","last_editor_user_id":"-1","owner_display_name":"Gili","owner_user_id":"14731","post_type_id":"1","score":"14","tags":"random|prng|stateless","view_count":"5043"} +{"id":"17966282","title":"Regular Expression for Numbers after KeyWord","body":"\u003cp\u003eI have String as \u003ccode\u003e\"red:124green:45blue:23\"\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eI have to get values for red,green, blue.\u003c/p\u003e\n\n\u003cp\u003eThe output pattern should as to be\n\u003ccode\u003e124\u003c/code\u003e Only, So i can Assign this value to red String.\u003c/p\u003e\n\n\u003cp\u003esecond the output Should be \u003ccode\u003e45\u003c/code\u003e,So i can Assign this value to green String and So on..\u003c/p\u003e","answer_count":"2","comment_count":"2","creation_date":"2013-07-31 09:15:53.71 UTC","last_activity_date":"2013-07-31 09:27:41.89 UTC","last_edit_date":"2013-07-31 09:18:11.403 UTC","last_editor_display_name":"","last_editor_user_id":"1679863","owner_display_name":"","owner_user_id":"2637373","post_type_id":"1","score":"-2","tags":"ios|regex","view_count":"46"} +{"id":"6729757","title":"Creating Lua Advanced Table","body":"\u003cp\u003eNeed to create some table so I can get an info from it in this way:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etable[attacker][id]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd if I'll use\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprint(table[attacker][id])\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt should print the \u003cstrong\u003evalue\u003c/strong\u003e.\u003c/p\u003e\n\n\u003cp\u003eTried many ways, but haven't found any good ...\u003c/p\u003e\n\n\u003cp\u003eI guess it should be something like this... \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etable.insert(table, attacker, [id] = value)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e^ This does not work.\u003c/p\u003e\n\n\u003cp\u003eCan someone help me?\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdit\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eWell, when I try it this way:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ex = {}\nfunction xxx()\n if not x[attacker][cid] then\n x[attacker][cid] = value\n else\n x[attacker][cid] = x[attacker][cid] + value\n end\n print(x[attacker][cid])\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI get an error saying: \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eattempt to index field '?' (a nil value)\u003c/p\u003e\n\u003c/blockquote\u003e","accepted_answer_id":"6729788","answer_count":"3","comment_count":"1","creation_date":"2011-07-18 07:21:19.217 UTC","favorite_count":"0","last_activity_date":"2013-11-28 22:18:28.01 UTC","last_edit_date":"2013-11-28 22:18:28.01 UTC","last_editor_display_name":"","last_editor_user_id":"1190388","owner_display_name":"","owner_user_id":"848925","post_type_id":"1","score":"2","tags":"multidimensional-array|insert|lua|lua-table","view_count":"1505"} +{"id":"28753529","title":"Cannnot open include file: `osg/Node`: No such file or directory","body":"\u003cp\u003eI don't know how I should ask this question. If I make any mistakes, I would appreciate it if someone could correct them.\u003c/p\u003e\n\n\u003cp\u003eI wrote a program in \u003ccode\u003eOpenscenegraph\u003c/code\u003e from \u003ca href=\"http://trac.openscenegraph.org/projects/osg//attachment/wiki/Support/Tutorials/NPS_Tutorials_src.rar\" rel=\"nofollow\"\u003eOpenSceneGraph Tutorial\u003c/a\u003e on \u003ccode\u003eMicrosoft Visual Studio\u003c/code\u003e but when I press on Debugged, it gave error like this.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e1\u0026gt;------ Build started: Project: ConsoleApplication1, Configuration: Debug Win32 ------\n1\u0026gt; GeometryTest.cpp\n1\u0026gt;c:\\osg\\test\\geometrytest.cpp(1): fatal error C1083: Cannot open include file: 'osg/Node': No such file or directory\n========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am newbie for Openscenegraph and visual studio, but I don't have library called \u003ccode\u003eNode\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eso please guide me on that what should I do to resolve this error?\nThank you\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;osg/Node\u0026gt;\n#include \u0026lt;osg/Group\u0026gt;\n#include \u0026lt;osg/Geode\u0026gt;\n#include \u0026lt;osg/Geometry\u0026gt;\n#include \u0026lt;osg/Texture2D\u0026gt;\n#include \u0026lt;osgDB/ReadFile\u0026gt; \n#include \u0026lt;osgViewer/Viewer\u0026gt;\n#include \u0026lt;osg/PositionAttitudeTransform\u0026gt;\n#include \u0026lt;osgGA/TrackballManipulator\u0026gt;\nint main()\n{\n osgViewer::Viewer viewer;\n osg::Group* root = new osg::Group();\n osg::Geode* pyramidGeode = new osg::Geode();\n osg::Geometry* pyramidGeometry = new osg::Geometry();\n osg::Geode* crossGeode = new osg::Geode();\n osg::Geometry* crossGeometry = new osg::Geometry();\n\n //Associate the pyramid geometry with the pyramid geode \n // Add the pyramid geode to the root node of the scene graph.\n\n pyramidGeode-\u0026gt;addDrawable(pyramidGeometry); \n root-\u0026gt;addChild(pyramidGeode);\n crossGeode-\u0026gt;addDrawable(crossGeometry); \n root-\u0026gt;addChild(crossGeode);\n\n //Declare an array of vertices. Each vertex will be represented by \n //a triple -- an instances of the vec3 class. An instance of \n //osg::Vec3Array can be used to store these triples. Since \n //osg::Vec3Array is derived from the STL vector class, we can use the\n //push_back method to add array elements. Push back adds elements to \n //the end of the vector, thus the index of first element entered is \n //zero, the second entries index is 1, etc.\n //Using a right-handed coordinate system with 'z' up, array \n //elements zero..four below represent the 5 points required to create \n //a simple pyramid.\n\n osg::Vec3Array* pyramidVertices = new osg::Vec3Array;\n pyramidVertices-\u0026gt;push_back( osg::Vec3( 0, 0, 0) ); // front left \n pyramidVertices-\u0026gt;push_back( osg::Vec3(10, 0, 0) ); // front right \n pyramidVertices-\u0026gt;push_back( osg::Vec3(10,10, 0) ); // back right \n pyramidVertices-\u0026gt;push_back( osg::Vec3( 0,10, 0) ); // back left \n pyramidVertices-\u0026gt;push_back( osg::Vec3( 5, 5,10) ); // peak\n\n float clen;\n clen = 12.0;\n osg::Vec3Array* crossVertices = new osg::Vec3Array;\n crossVertices-\u0026gt;push_back (osg::Vec3(-clen, 0.0, 0.0));\n crossVertices-\u0026gt;push_back (osg::Vec3( clen, 0.0, 0.0));\n crossVertices-\u0026gt;push_back (osg::Vec3( 0.0, 0.0, -clen));\n crossVertices-\u0026gt;push_back (osg::Vec3( 0.0, 0.0, clen)); \n\n //Associate this set of vertices with the geometry associated with the \n //geode we added to the scene.\n\n pyramidGeometry-\u0026gt;setVertexArray( pyramidVertices );\n crossGeometry-\u0026gt;setVertexArray (crossVertices);\n //Next, create a primitive set and add it to the pyramid geometry. \n //Use the first four points of the pyramid to define the base using an \n //instance of the DrawElementsUint class. Again this class is derived \n //from the STL vector, so the push_back method will add elements in \n //sequential order. To ensure proper backface cullling, vertices \n //should be specified in counterclockwise order. The arguments for the \n //constructor are the enumerated type for the primitive \n //(same as the OpenGL primitive enumerated types), and the index in \n //the vertex array to start from.\n\n osg::DrawElementsUInt* pyramidBase = \n new osg::DrawElementsUInt(osg::PrimitiveSet::QUADS, 0);\n pyramidBase-\u0026gt;push_back(3);\n pyramidBase-\u0026gt;push_back(2);\n pyramidBase-\u0026gt;push_back(1);\n pyramidBase-\u0026gt;push_back(0);\n pyramidGeometry-\u0026gt;addPrimitiveSet(pyramidBase);\n\n osg::DrawElementsUInt* cross = \n new osg::DrawElementsUInt(osg::PrimitiveSet::LINES, 0);\n cross-\u0026gt;push_back(3);\n cross-\u0026gt;push_back(2);\n cross-\u0026gt;push_back(1);\n cross-\u0026gt;push_back(0);\n crossGeometry-\u0026gt;addPrimitiveSet(cross);\n\n //Repeat the same for each of the four sides. Again, vertices are \n //specified in counter-clockwise order. \n\n osg::DrawElementsUInt* pyramidFaceOne = \n new osg::DrawElementsUInt(osg::PrimitiveSet::TRIANGLES, 0);\n pyramidFaceOne-\u0026gt;push_back(0);\n pyramidFaceOne-\u0026gt;push_back(1);\n pyramidFaceOne-\u0026gt;push_back(4);\n pyramidGeometry-\u0026gt;addPrimitiveSet(pyramidFaceOne);\n\n osg::DrawElementsUInt* pyramidFaceTwo = \n new osg::DrawElementsUInt(osg::PrimitiveSet::TRIANGLES, 0);\n pyramidFaceTwo-\u0026gt;push_back(1);\n pyramidFaceTwo-\u0026gt;push_back(2);\n pyramidFaceTwo-\u0026gt;push_back(4);\n pyramidGeometry-\u0026gt;addPrimitiveSet(pyramidFaceTwo);\n\n osg::DrawElementsUInt* pyramidFaceThree = \n new osg::DrawElementsUInt(osg::PrimitiveSet::TRIANGLES, 0);\n pyramidFaceThree-\u0026gt;push_back(2);\n pyramidFaceThree-\u0026gt;push_back(3);\n pyramidFaceThree-\u0026gt;push_back(4);\n pyramidGeometry-\u0026gt;addPrimitiveSet(pyramidFaceThree);\n\n osg::DrawElementsUInt* pyramidFaceFour = \n new osg::DrawElementsUInt(osg::PrimitiveSet::TRIANGLES, 0);\n pyramidFaceFour-\u0026gt;push_back(3);\n pyramidFaceFour-\u0026gt;push_back(0);\n pyramidFaceFour-\u0026gt;push_back(4);\n pyramidGeometry-\u0026gt;addPrimitiveSet(pyramidFaceFour);\n\n //Declare and load an array of Vec4 elements to store colors. \n\n osg::Vec4Array* colors = new osg::Vec4Array;\n colors-\u0026gt;push_back(osg::Vec4(1.0f, 0.0f, 0.0f, 1.0f) ); //index 0 red\n colors-\u0026gt;push_back(osg::Vec4(0.0f, 1.0f, 0.0f, 1.0f) ); //index 1 green\n colors-\u0026gt;push_back(osg::Vec4(0.0f, 0.0f, 1.0f, 1.0f) ); //index 2 blue\n colors-\u0026gt;push_back(osg::Vec4(1.0f, 1.0f, 1.0f, 1.0f) ); //index 3 white\n\n //Declare the variable that will match vertex array elements to color \n //array elements. This vector should have the same number of elements \n //as the number of vertices. This vector serves as a link between \n //vertex arrays and color arrays. Entries in this index array \n //coorespond to elements in the vertex array. Their values coorespond \n //to the index in he color array. This same scheme would be followed \n //if vertex array elements were matched with normal or texture \n //coordinate arrays.\n // Note that in this case, we are assigning 5 vertices to four \n // colors. Vertex array element zero (bottom left) and four (peak) \n // are both assigned to color array element zero (red).\n\n osg::TemplateIndexArray\n \u0026lt;unsigned int, osg::Array::UIntArrayType,4,4\u0026gt; *colorIndexArray;\n colorIndexArray = \n new osg::TemplateIndexArray\u0026lt;unsigned int, osg::Array::UIntArrayType,4,4\u0026gt;;\n colorIndexArray-\u0026gt;push_back(0); // vertex 0 assigned color array element 0\n colorIndexArray-\u0026gt;push_back(1); // vertex 1 assigned color array element 1\n colorIndexArray-\u0026gt;push_back(2); // vertex 2 assigned color array element 2\n colorIndexArray-\u0026gt;push_back(3); // vertex 3 assigned color array element 3\n colorIndexArray-\u0026gt;push_back(0); // vertex 4 assigned color array element 0\n\n //The next step is to associate the array of colors with the geometry, \n //assign the color indices created above to the geometry and set the \n //binding mode to _PER_VERTEX.\n\n pyramidGeometry-\u0026gt;setColorArray(colors);\n pyramidGeometry-\u0026gt;setColorIndices(colorIndexArray);\n pyramidGeometry-\u0026gt;setColorBinding(osg::Geometry::BIND_PER_VERTEX);\n crossGeometry-\u0026gt;setColorArray(colors);\n crossGeometry-\u0026gt;setColorIndices(colorIndexArray);\n crossGeometry-\u0026gt;setColorBinding(osg::Geometry::BIND_PER_VERTEX);\n\n //Now that we have created a geometry node and added it to the scene \n //we can reuse this geometry. For example, if we wanted to put a \n //second pyramid 15 units to the right of the first one, we could add \n //this geode as the child of a transform node in our scene graph. \n\n // Declare and initialize a transform node.\n osg::PositionAttitudeTransform* pyramidTwoXForm =\n new osg::PositionAttitudeTransform();\n\n // Use the 'addChild' method of the osg::Group class to\n // add the transform as a child of the root node and the\n // pyramid node as a child of the transform.\n\n root-\u0026gt;addChild(pyramidTwoXForm);\n pyramidTwoXForm-\u0026gt;addChild(pyramidGeode);\n\n // Declare and initialize a Vec3 instance to change the\n // position of the model in the scene\n\n osg::Vec3 pyramidTwoPosition(15,0,0);\n pyramidTwoXForm-\u0026gt;setPosition( pyramidTwoPosition ); \n\n //The final step is to set up and enter a simulation loop.\n\n viewer.setSceneData( root );\n //viewer.run();\n\n viewer.setCameraManipulator(new osgGA::TrackballManipulator());\n viewer.realize();\n\n while( !viewer.done() )\n {\n viewer.frame();\n } \n\n return 0;\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-02-26 21:56:30.293 UTC","favorite_count":"1","last_activity_date":"2015-03-03 15:45:06.59 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4509106","post_type_id":"1","score":"0","tags":"visual-studio|openscenegraph","view_count":"887"} +{"id":"10826256","title":"Can a streaming collection be implemented in Java?","body":"\u003cp\u003eI needed to implement a utility server that tracks few custom variables that will be sent from any other server. To track the variables, a key value collection, either JDK defined or custom needs to be used. \u003c/p\u003e\n\n\u003cp\u003eHere are few considerations - \u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eKeeping all the variables in memory of the server all the time is memory intensive.\u003c/li\u003e\n\u003cli\u003eThis server needs to be a very lightweight server and I do not want heavy database operations.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eIs there a pre-defined streaming collection which can serialize the data after a threshold memory and retrieve it on need basis? \u003c/p\u003e\n\n\u003cp\u003eI hope I am clear in defining the problem statement.\u003c/p\u003e\n\n\u003cp\u003ePlease suggest if any other better approach.\u003c/p\u003e","accepted_answer_id":"10826302","answer_count":"3","comment_count":"2","creation_date":"2012-05-31 01:11:28.56 UTC","favorite_count":"3","last_activity_date":"2016-10-10 21:17:23.723 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1401472","post_type_id":"1","score":"4","tags":"java|collections|streaming","view_count":"184"} +{"id":"21768920","title":"CSS Transitions on tab load - bug","body":"\u003cp\u003eI am creating a home screen and I have 3 tabs that you can go between on the home screen. When you click one all the li's within the tab transition in to the page but if you click between the tabs quickly then they don't always load. This only seems to effect Chrome on pc and mac and sometimes safari on mac. Fine on firefox on pc and mac.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://codepen.io/2ne/pen/1f7dbb81f464fb5b0e1a4f5bacc30a56\" rel=\"nofollow\"\u003ehttp://codepen.io/2ne/pen/1f7dbb81f464fb5b0e1a4f5bacc30a56\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eTab JS\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(document).ready(function() {\n $('nav li').click(function(){\n $('nav li').removeClass('active');\n $(this).addClass('active');\n $('.tab').removeClass('active');\n $('#' + $(this).attr('data-tab')).addClass('active');\n });\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ePortion of css\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e.tab-content .tab li {\n opacity: 0;\n transform: translatey(-50px) scale(0);\n}\n.tab-content .tab.active li { \n transition: all 500ms ease;\n transform-origin: top center;\n transform: translatey(0) scale(1);\n opacity: 1;\n}\n@for $i from 1 through 50 {\n .tab-content .tab.active li:nth-child(#{$i}) {\n transition-delay: (#{$i * 0.1}s); \n }\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-02-14 01:00:12.257 UTC","last_activity_date":"2014-02-14 01:26:16.457 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1838651","post_type_id":"1","score":"0","tags":"javascript|jquery|css|css3|css-transitions","view_count":"187"} +{"id":"16121352","title":"Replace or remove nth occurrence of \\n","body":"\u003cp\u003eThis is my string:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar ok = \"\\n\\n33333333333\\n\\n\\n\";\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow to replace the 4th occurence of '\\n' with ''?\nOr, how to remove the 4th occurence of '\\n'?\u003c/p\u003e","answer_count":"2","comment_count":"4","creation_date":"2013-04-20 14:21:40.737 UTC","last_activity_date":"2013-07-25 08:28:25.15 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"966638","post_type_id":"1","score":"0","tags":"javascript|jquery","view_count":"912"} +{"id":"33869936","title":"how to store an value in core data if an uibutton is pressed?","body":"\u003cp\u003eimport UIKit\nimport CoreData\u003c/p\u003e\n\n\u003cp\u003eclass ViewController: UIViewController {\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@IBAction func btnGood(sender: AnyObject) {\n\n var appDel:AppDelegate = (UIApplication.sharedApplication().delegate as! AppDelegate)\n var context: NSManagedObjectContext = appDel.managedObjectContext\n\n var record = NSEntityDescription.insertNewObjectForEntityForName(\"Meals\", inManagedObjectContext: context) as NSManagedObject\n record.setValue(1, forKey: \"data\")\n do {\n try context.save()\n } catch {\n print(\"error\")\n }\n print(record)\n print(\"Object Saved\")\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eerror -\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e2015-11-23 17:10:12.264 statsStoring[5355:669919] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Unacceptable type of value for attribute: property = \"data\"; desired type = NSString; given type = __NSCFNumber; value = 1.'\n*** First throw call stack:\n(\n 0 CoreFoundation 0x0000000101a3be65 __exceptionPreprocess + 165\n 1 libobjc.A.dylib 0x000000010377adeb objc_exception_throw + 48\n 2 CoreData 0x00000001015d6990 _PFManagedObject_coerceValueForKeyWithDescription + 2864\n 3 CoreData 0x00000001015ae801 _sharedIMPL_setvfk_core + 177\n 4 statsStoring 0x00000001014c83ec _TFC12statsStoring14ViewController7btnGoodfS0_FPSs9AnyObject_T_ + 684\n 5 statsStoring 0x00000001014c8786 _TToFC12statsStoring14ViewController7btnGoodfS0_FPSs9AnyObject_T_ + 54\n 6 UIKit 0x000000010225c8c8 -[UIApplication sendAction:to:from:forEvent:] + 92\n 7 UIKit 0x00000001023cb328 -[UIControl sendAction:to:forEvent:] + 67\n 8 UIKit 0x00000001023cb5f4 -[UIControl _sendActionsForEvents:withEvent:] + 311\n 9 UIKit 0x00000001023ca724 -[UIControl touchesEnded:withEvent:] + 601\n 10 UIKit 0x00000001022cbbcf -[UIWindow _sendTouchesForEvent:] + 835\n 11 UIKit 0x00000001022cc904 -[UIWindow sendEvent:] + 865\n 12 UIKit 0x000000010227b29a -[UIApplication sendEvent:] + 263\n 13 UIKit 0x00000001022554cb _UIApplicationHandleEventQueue + 6844\n 14 CoreFoundation 0x0000000101967a31 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17\n 15 CoreFoundation 0x000000010195d95c __CFRunLoopDoSources0 + 556\n 16 CoreFoundation 0x000000010195ce13 __CFRunLoopRun + 867\n 17 CoreFoundation 0x000000010195c828 CFRunLoopRunSpecific + 488\n 18 GraphicsServices 0x00000001060b5ad2 GSEventRunModal + 161\n 19 UIKit 0x000000010225ad44 UIApplicationMain + 171\n 20 statsStoring 0x00000001014ca89d main + 109\n 21 libdyld.dylib 0x000000010429492d start + 1\n)\nlibc++abi.dylib: terminating with uncaught exception of type NSException\n(lldb) \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ei want if the user pressed btngood button then '1 (true)' value should save in the 'data' attribute ! for this i tried 1 but its giving me an error and i know that its not the right way to do that\u003c/p\u003e","accepted_answer_id":"33870690","answer_count":"2","comment_count":"0","creation_date":"2015-11-23 11:25:58.387 UTC","last_activity_date":"2015-11-23 13:03:16.063 UTC","last_edit_date":"2015-11-23 13:03:16.063 UTC","last_editor_display_name":"","last_editor_user_id":"363777","owner_display_name":"user5556622","post_type_id":"1","score":"2","tags":"ios|swift|swift2","view_count":"80"} +{"id":"44241581","title":"Visual Studio , matrix multiplication","body":"\u003cp\u003eWell here is my code, not finished, but I'm getting 2 issues I don't know how to fix.\u003c/p\u003e\n\n\u003cp\u003eFirst because most of the people here and English speakers\n\u003ccode\u003enCA/B/C-number os colums A/B/C nLA/B/C-number os lines A/B/C\u0026amp;#96;\u0026amp;#96;\u003c/code\u003e\nMy problems are , the fact that the following program , doesnt properly multiply and make the correct size , even though i defined \u003ccode\u003enLC = nLA ; nCC = nCB\u003c/code\u003e , Matrix A always come before the B one , its still not complete the program , but I can't figure this problems out \u003c/p\u003e\n\n\u003cp\u003eI know the composition is bad , but its how we are supposed to built it , with this kind of memory allocations.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#define _CRT_SECURE_NO_WARNINGS\n#include\u0026lt;stdlib.h\u0026gt;\n#include\u0026lt;stdio.h\u0026gt;\n\n\nint main()\n{\n char menu;\n int i, j;\n int n_linhas, n_colunas; int nLA, nCA, nLB, nCB, nLC, nCC;\n int **Matriz_A, **Matriz_B, **Matriz_C;\n FILE *file;\n file = fopen(\"C:\\\\PC\\\\FicheiroEscrito.txt\", \"w+\");\n printf(\"\\n Qual a dimensao da matriz A?\\n\");\n scanf_s(\" %d%d\", \u0026amp;nLA,\u0026amp;nCA);\n printf(\"\\n Qual a dimensao da matriz B?\\n\");\n scanf_s(\" %d%d\", \u0026amp;nLB,\u0026amp;nCB);\n nLC = nLA ;\n nCC = nCB ;\n char option;\n\n if (nCA!=nLB)\n { \n printf(\"\\Dimensoes nao multiplicaveis\");\n printf(\"\\n\\n\\n\");\n system(\"pause\");\n return 0;\n }\n\n do {\n //File , text , exit\n printf(\"\\n Bem vindos a um programa \\n\");\n printf(\"\\n Que pretende calcular a multiplicação de duas matrizes A e B\\n\");\n printf(\"\\n sendo este um programa que foi construido atraves dos conhecimentos adquiridos durante o semestre\\n\");\n printf(\"\\n Como este demonstra , arrays , allocacoes de memoria e funcoes \\n\");\n printf(\"\\n Como quer fornecer os dados ao programa? \\n\");\n printf(\"\\n Por Teclado (responda*T*)\\n\");\n printf(\"\\n Por Ficheiro (responda*F*)\\n\");\n printf(\"\\n Desejo sair (responda*S*)\\n\");\n scanf(\" %c\", \u0026amp;option);\n fprintf(file, \"\\n Menu principal\\n\");\n fprintf(file, \"\\n Como quer fornecer os dados ao programa? \\n\");\n fprintf(file, \"\\n Por Teclado (responda*T*) \\n\");\n fprintf(file, \"\\n Por Ficheiro (responda*F*)\\n\");\n fprintf(file, \"\\n Desejo sair (responda*S*)\\n\");\n fprintf(file, \"\\n %c \\n\", option);\n\n switch (option)\n {\n case 'S':\n case 's':\n exit(1);\n break;\n\n case 'T': // por teclado\n case't':\n Matriz_A = (int**)malloc(nLA*sizeof(int*));\n for (i = 0; i \u0026lt; nLA; i++)\n {\n Matriz_A[i] = (int*)malloc(nCA*sizeof(int));\n }\n if (Matriz_A == NULL)\n {\n printf(\"\\n A alocacao de memoria para a matriz nao foi feita\\n\");\n exit(1);\n }\n Matriz_B = (int**)malloc(nLB*sizeof(int*));\n for (i = 0; i \u0026lt; nLB; i++)\n {\n Matriz_B[i] = (int*)malloc(nCB*sizeof(int));\n }\n if (Matriz_B == NULL)\n {\n printf(\"\\n A alocacao de memoria para a matriz nao foi feita\\n\");\n exit(1);\n }\n Matriz_C = (int**)malloc(nLC*sizeof(int*));\n for (i = 0; i \u0026lt; nLC; i++)\n {\n Matriz_C[i] = (int*)malloc(nCC*sizeof(int));\n }\n if (Matriz_C == NULL)\n {\n printf(\"\\n A alocacao de memoria para a matriz nao foi feita\\n\");\n exit(1);\n }\n for (i = 0; i \u0026lt; nLA; i++)\n {\n for (j = 0; j \u0026lt; nCA; j++)\n {\n printf(\"\\n Qual o valor do elemento da matriz A [%d] [%d]?\\n\", i, j);\n scanf_s(\" %d\", \u0026amp;Matriz_A[i][j]);\n }\n }\n for (i = 0; i \u0026lt; nLB; i++)\n {\n for (j = 0; j \u0026lt; nCB; j++)\n {\n printf(\"\\n Qual o valor do elemento da matriz B [%d] [%d]?\\n\", i, j);\n scanf_s(\" %d\", \u0026amp;Matriz_B[i][j]);\n }\n }\n for (i = 0; i \u0026lt; nLA; i++)\n {\n for (j = 0; j \u0026lt; nCB; j++)\n {\n Matriz_C[i][j] += Matriz_A[i][j] * Matriz_B[i][j];\n }\n }\n printf(\"\\n DADOS \\n\");\n printf(\"\\nMatriz A \\n\");\n for (i = 0; i \u0026lt; nLA; i++)\n {\n for (j = 0; j \u0026lt; nCA; j++)\n {\n printf(\"%4d \", Matriz_A[i][j]);\n }\n printf(\"\\n\");\n }\n printf(\"\\nMatriz B \\n\");\n for (i = 0; i \u0026lt; nLB; i++)\n {\n for (j = 0; j \u0026lt; nCB; j++)\n {\n printf(\"%4d \", Matriz_B[i][j]);\n }\n printf(\"\\n\");\n }\n printf(\"\\n RESULTADOS \\n\");\n printf(\"\\nMatriz C \\n\");\n for (i = 0; i \u0026lt; nLC; i++)\n {\n for (j = 0; j \u0026lt; nCA; j++)\n {\n printf(\"%4d \", Matriz_C[i][j]);\n }\n printf(\"\\n\");\n }\n for (i = 0; i \u0026lt; nLC; i++)\n {\n free(Matriz_C[i]);\n }\n free(Matriz_C);\n for (i = 0; i \u0026lt; nLB; i++)\n {\n free(Matriz_B[i]);\n }\n free(Matriz_B);\n\n for (i = 0; i \u0026lt; nLA; i++)\n {\n free(Matriz_A[i]);\n }\n free(Matriz_A);\n\n\n while (option != 'T');\n printf(\"\\n\\n\\n\");\n fprintf(file, \"\\n\\n\\n\");\n system(\"pause\");\n return 0;\n }\n }\n while (option != 'S');\n printf(\"\\n\\n\\n\");\n printf (\"\\n\\n\\n\");\n system(\"pause\");\n return 0;\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"3","creation_date":"2017-05-29 11:37:17.573 UTC","last_activity_date":"2017-06-01 14:12:20.797 UTC","last_edit_date":"2017-06-01 14:12:20.797 UTC","last_editor_display_name":"","last_editor_user_id":"3163306","owner_display_name":"","owner_user_id":"8081169","post_type_id":"1","score":"0","tags":"matrix-multiplication","view_count":"38"} +{"id":"26174900","title":"Exact way of ignore/unignore files in git","body":"\u003cp\u003eIn my project I have a gitignore file, that nicely has statement to ignore node_modules, such as:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e########################\n# node.js / npm\n########################\nlib-cov\n*.seed\n*.log\n*.csv\n*.dat\n*.out\n*.pid\n*.gz\n\n\nlogs\nresults\n\nnode_modules\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt works just as expected. Git does not see any change within node_modules. \u003c/p\u003e\n\n\u003cp\u003eI have changes in a file within node_modules that I would like to include in further commits, as it will change definitely. But at the same time I want to keep the rest of the node_modules ignored.\nThis is example of what I need to \"unignore\":\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e node_module/passport-saml/saml.js\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSome time ago, I had the same issue. I have followed some instructions how to do it, but I ended up creating a mess... I remember I used git uncheck / untrack or something similar. It took me more time to fix the thing I broke while trying to \"unignore\" the file. At the end, I ended up manually changing the line of code on the git.\u003c/p\u003e\n\n\u003cp\u003eThis time I really would like to do it properly.\u003c/p\u003e","accepted_answer_id":"26174962","answer_count":"3","comment_count":"0","creation_date":"2014-10-03 07:28:34.3 UTC","favorite_count":"2","last_activity_date":"2014-10-03 07:33:32.403 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"769599","post_type_id":"1","score":"3","tags":"git","view_count":"605"} +{"id":"3154301","title":"What should itertools.product() yield when supplied an empty list?","body":"\u003cp\u003eI guess it's an academic question, but the second result does not make sense to me. Shouldn't it be as thoroughly empty as the first? What is the rationale for this behavior?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efrom itertools import product\n\none_empty = [ [1,2], [] ]\nall_empty = []\n\nprint [ t for t in product(*one_empty) ] # []\nprint [ t for t in product(*all_empty) ] # [()]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eUpdates\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eThanks for all of the answers -- very informative.\u003c/p\u003e\n\n\u003cp\u003eWikipedia's discussion of the \u003ca href=\"http://en.wikipedia.org/wiki/Empty_product#Nullary_Cartesian_product\" rel=\"nofollow noreferrer\"\u003eNullary Cartesian Product\u003c/a\u003e provides a definitive statement:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eThe Cartesian product of no sets ...\n is the singleton set containing the\n empty tuple.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eAnd here is some code you can use to work through the insightful \u003ca href=\"https://stackoverflow.com/questions/3154301/what-should-itertools-product-yield-when-supplied-an-empty-list/3154629#3154629\"\u003eanswer from sth\u003c/a\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efrom itertools import product\n\ndef tproduct(*xss):\n return ( sum(rs, ()) for rs in product(*xss) )\n\ndef tup(x):\n return (x,)\n\nxs = [ [1, 2], [3, 4, 5] ]\nys = [ ['a', 'b'], ['c', 'd', 'e'] ]\n\ntxs = [ map(tup, x) for x in xs ] # [[(1,), (2,)], [(3,), (4,), (5,)]]\ntys = [ map(tup, y) for y in ys ] # [[('a',), ('b',)], [('c',), ('d',), ('e',)]]\n\na = [ p for p in tproduct( *(txs + tys) ) ]\nb = [ p for p in tproduct( tproduct(*txs), tproduct(*tys) ) ]\n\nassert a == b\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"3154629","answer_count":"2","comment_count":"0","creation_date":"2010-07-01 00:04:54.23 UTC","favorite_count":"1","last_activity_date":"2012-09-16 19:38:35.41 UTC","last_edit_date":"2017-05-23 11:53:26.26 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"55857","post_type_id":"1","score":"8","tags":"python|itertools|cross-product","view_count":"1410"} +{"id":"11730421","title":"Relative prefix for django urlpatterns?","body":"\u003cp\u003eI tried doing something like\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eurlpatterns = patterns('.persons.views',\n\n)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ein my urls.py file with the directories looking like\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emain folder\n\\profile\n \\person\n urls.py \u0026lt;- this is the file\n urls.py\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut I got the error \"relative imports require the 'package' argument\"\u003c/p\u003e\n\n\u003cp\u003eI could do 'profiles.persons.view' as the prefix, but I want to try to do a relative prefix like a relative import. How do I fix this such that the relative prefix works? I'm using django 1.4 and python 2.7.\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2012-07-30 22:09:49.757 UTC","last_activity_date":"2012-07-30 22:09:49.757 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"749477","post_type_id":"1","score":"2","tags":"python|django|url|url-pattern","view_count":"424"} +{"id":"40064361","title":"Access and change of the value of a css pseudoclass via code in JavaFX 8","body":"\u003cp\u003eIs it possible to access css pseudo-classes such as \u003ccode\u003e.text-area *.text {}\u003c/code\u003e and more importantly change values of them via code?\n\u003ccode\u003etextArea.setStyle()\u003c/code\u003e does not seem to be applicable in this case.\nTo describe the problem: \nI'm trying to change the text-alignment of an TextArea on a button click. \nI know it's possible to change the alignment via \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e.text-area *.text {\n-fx-text-alignment: center;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut how can i bind that to a button click?\u003c/p\u003e","accepted_answer_id":"40066407","answer_count":"1","comment_count":"0","creation_date":"2016-10-15 21:22:27.007 UTC","last_activity_date":"2016-10-16 03:13:59.277 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6586867","post_type_id":"1","score":"0","tags":"java|css|javafx|javafx-8","view_count":"145"} +{"id":"11255582","title":"Specifying routes by subdomain in Express using vhost middleware","body":"\u003cp\u003eI'm using the \u003ccode\u003evhost\u003c/code\u003e express/connect middleware and I'm a bit confused as to how it should be used. I want to have one set of routes apply to hosts with subdomains, and another set to apply for hosts without subdomains.\u003c/p\u003e\n\n\u003cp\u003eIn my app.js file, I have \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar app = express.createServer();\n\napp.use...(middlware)...\napp.use(express.vhost('*.host', require('./domain_routing')(\"yes\")));\napp.use(express.vhost('host', require('./domain_routing')(\"no\")));\napp.use...(middlware)...\n\napp.listen(8000);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand then in \u003ccode\u003edomain_routing.js\u003c/code\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emodule.exports = function(subdomain){\n\n var app = express.createServer();\n\n require('./routes')(app, subdomain);\n\n return app;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand then in \u003ccode\u003eroutes.js\u003c/code\u003e I plan to run sets of routes, dependent on whether the subdomain variable passed in is \u003ccode\u003e\"yes\"\u003c/code\u003e or \u003ccode\u003e\"no\"\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eAm I on the right track or is this not how you use this middleware? I'm a bit confused on the fact that there are two \u003ccode\u003eapp\u003c/code\u003e server instances being created (as that's how examples on the web seem to do things). Should I instead pass in the original \u003ccode\u003eapp\u003c/code\u003e server instance and just use that instead of creating a separate one instead the subdomain router?\u003c/p\u003e","accepted_answer_id":"11259052","answer_count":"1","comment_count":"0","creation_date":"2012-06-29 03:13:42.85 UTC","favorite_count":"2","last_activity_date":"2012-06-29 09:11:44.673 UTC","last_edit_date":"2012-06-29 04:06:53.21 UTC","last_editor_display_name":"","last_editor_user_id":"730569","owner_display_name":"","owner_user_id":"730569","post_type_id":"1","score":"5","tags":"javascript|node.js|express|subdomain|middleware","view_count":"1197"} +{"id":"42349773","title":"Paw HTTP Library doesn't handle chunked transfer encoding","body":"\u003cp\u003eWhen I issue a request using the Paw HTTP Library to a server that responds using chunked transfer encoding, the transfer-encoding characters don't get stripped out and the response fails to parse as JSON. Additionally, I get two HTTP response codes.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eRequest\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ePOST /path/to/endpoint HTTP/1.1\nContent-Type: application/json\nHost: hostname.domain.invalid:443\nConnection: close\nUser-Agent: Paw/3.0.16 (Macintosh; OS X/10.11.6) GCDHTTPRequest\nContent-Length: 116\n\n{\n \"body\": \"body\"\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003ch1\u003ePaw HTTP Library response\u003c/h1\u003e\n\n\u003cpre\u003e\u003ccode\u003eHTTP/1.1 100 Continue\n\nHTTP/1.1 401 \nDate: Mon, 20 Feb 2017 16:05:18 GMT\nServer: Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.1e-fips\nX-Application-Context: application:tst:443\nX-Content-Type-Options: nosniff\nX-XSS-Protection: 1; mode=block\nCache-Control: no-cache, no-store, max-age=0, must-revalidate\nPragma: no-cache\nExpires: 0\nContent-Type: application/json;charset=UTF-8\nConnection: close\nTransfer-Encoding: chunked\n\nce\n{\"body\":\"body\"}\n0\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003ch1\u003eNSURLConnection response\u003c/h1\u003e\n\n\u003cpre\u003e\u003ccode\u003eHTTP/1.1 401 UNAUTHORIZED\nContent-Type: application/json;charset=UTF-8\nKeep-Alive: timeout=5, max=100\nPragma: no-cache\nX-Application-Context: application:tst:443\nX-XSS-Protection: 1; mode=block\nServer: Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.1e-fips\nExpires: 0\nTransfer-Encoding: Identity\nCache-Control: no-cache, no-store, max-age=0, must-revalidate\nDate: Mon, 20 Feb 2017 16:15:23 GMT\nConnection: Keep-Alive\nX-Content-Type-Options: nosniff\n\n{\"body\":\"body\"}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI expect that the \u003ccode\u003ece\u003c/code\u003e and \u003ccode\u003e0\u003c/code\u003e \u003ca href=\"https://en.wikipedia.org/wiki/Chunked_transfer_encoding\" rel=\"nofollow noreferrer\"\u003etransfer-encoding characters\u003c/a\u003e would be stripped out, as they are with \u003ccode\u003eNSURLConnection\u003c/code\u003e, and that the body would correctly parse as JSON.\u003c/p\u003e\n\n\u003cp\u003eI don't see any documentation of this issue on the \u003ca href=\"https://paw.cloud/docs/advanced/http-libraries\" rel=\"nofollow noreferrer\"\u003eHTTP libraries page\u003c/a\u003e. \u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-02-20 16:35:41.17 UTC","last_activity_date":"2017-02-20 16:35:41.17 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"110776","post_type_id":"1","score":"0","tags":"paw-app","view_count":"79"} +{"id":"27585257","title":"Appending to elements within an Rcpp List","body":"\u003cp\u003ePossibly a stupid question, but I've hunted around a lot for an answer and been unable to find one:\u003c/p\u003e\n\n\u003cp\u003eI'm trying to write a file reader, a la \u003ccode\u003efread\u003c/code\u003e or \u003ccode\u003eread.delim\u003c/code\u003e but implemented in C++ and connected to R via Rcpp. The easiest way to do this and have it output a data.frame is have it produce a \u003ccode\u003eList\u003c/code\u003e of vectors - one for each column - and set the class to \u003ccode\u003edata.frame\u003c/code\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eList foo;\nfoo.push_back(column);\nfoo.attr(\"class\") = \"data.frame\";\nreturn foo;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSimple enough, and I've done it before. Unfortunately:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eThe file(s) I want to read in can have a varying number of fields;\u003c/li\u003e\n\u003cli\u003eThis model only works elegantly if you're reading from the file column-wise, while actual files tend to be read row-wise.\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eSo, the answer is to be able to define foo and then, for each row I read in, push_back() a field on to each of foo's underlying vectors:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eList foo(1);\nfoo[0].push_back(\"turnip\");\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eUnfortunately I can't work out how to do that: it doesn't appear that a List's member vectors can be pushed_back() to, since this results in the error \"Rcpp::Vector\u0026lt;19\u003e::Proxy has no member named push_back()\"\u003c/p\u003e\n\n\u003cp\u003eSo, my question: is there any way to append to a vector within an Rcpp list? Or is my only option to read the file in column-by-column, appending the resulting vectors to \"foo\", and bite the performance cost that's going to result from having to iterate through it [number of columns] times instead of once?\u003c/p\u003e\n\n\u003cp\u003eHopefully this question is clear enough. Happy to answer any questions.\u003c/p\u003e","accepted_answer_id":"27585789","answer_count":"1","comment_count":"0","creation_date":"2014-12-20 23:18:01.877 UTC","favorite_count":"1","last_activity_date":"2014-12-21 01:34:23.74 UTC","last_edit_date":"2014-12-20 23:27:31.737 UTC","last_editor_display_name":"","last_editor_user_id":"4060324","owner_display_name":"","owner_user_id":"4060324","post_type_id":"1","score":"3","tags":"r|rcpp","view_count":"1262"} +{"id":"45313049","title":"Round total price with VAT at cart but products are without rounding and without VAT at NOPCOMMERCE","body":"\u003cp\u003eHow change any files at source code NOPCOMMERCE 3.9 ?\nI need Round total price with VAT at the cart (summary order) but common products at catalog must be without rounding and without VAT at NOPCOMMERCE\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-07-25 20:35:42.153 UTC","last_activity_date":"2017-07-25 20:35:42.153 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3533850","post_type_id":"1","score":"0","tags":"nopcommerce-3.90","view_count":"13"} +{"id":"26576806","title":"Defacing the Title on Spree Admin pages","body":"\u003cp\u003eI would like to change the title on spree admin pages, and i`m trying to do that on deface:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eDeface::Override.new(:virtual_path =\u0026gt; 'spree/admin/shared/_header.html.erb',\n :name =\u0026gt; 'override',\n :replace =\u0026gt; 'title') do\n '\u0026lt;title\u0026gt;MyOnly Administrativo\u0026lt;/title\u0026gt;'\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is not working at all....\u003c/p\u003e","accepted_answer_id":"26579349","answer_count":"1","comment_count":"0","creation_date":"2014-10-26 19:09:30.443 UTC","last_activity_date":"2014-10-26 23:51:08.347 UTC","last_edit_date":"2014-10-26 21:14:24.027 UTC","last_editor_display_name":"","last_editor_user_id":"1679751","owner_display_name":"","owner_user_id":"3399504","post_type_id":"1","score":"0","tags":"ruby-on-rails|spree","view_count":"492"} +{"id":"12661763","title":"Exchange SQL Server 2008 Database Mail issue","body":"\u003cp\u003eIn my web application I have created a mail sender class and set the configurations of \u003ccode\u003eweb.config\u003c/code\u003e file like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;mailSettings\u0026gt;\n \u0026lt;smtp deliveryMethod=\"PickupDirectoryFromIis\"\u0026gt;\n \u0026lt;network host=\"smtp.domain.com\"\n port=\"587\"\n userName=\"mail@domain.com\"\n password=\"password\"/\u0026gt;\n \u0026lt;/smtp\u0026gt;\n \u0026lt;/mailSettings\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is sending email. But SQL Server database mail can not send mail with the same account info.\u003c/p\u003e\n\n\u003cp\u003eOnly one difference is \u003ccode\u003ePickupDirectoryFromIis\u003c/code\u003e .\u003c/p\u003e\n\n\u003cp\u003eIs there any setting on exchange server?\u003c/p\u003e\n\n\u003cp\u003eIn the SQL Server Logs the errors are following.\u003c/p\u003e\n\n\u003cp\u003eMessage\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e\u003cem\u003eThe mail could not be sent to the recipients because of the mail\n server failure. (Sending Mail using Account 2 (2012-09-30T16:55:04).\n Exception Message: Cannot send mails to mail server. (The SMTP server\n requires a secure connection or the client was not authenticated. The\n server response was: 5.7.1 Client was not authenticated).\u003c/em\u003e\u003c/p\u003e\n\u003c/blockquote\u003e","answer_count":"1","comment_count":"0","creation_date":"2012-09-30 13:53:27.19 UTC","last_activity_date":"2017-01-11 08:16:09.667 UTC","last_edit_date":"2012-09-30 14:06:11.187 UTC","last_editor_display_name":"","last_editor_user_id":"13302","owner_display_name":"","owner_user_id":"554271","post_type_id":"1","score":"1","tags":"sql-server-2008|exchange-server","view_count":"758"} +{"id":"26151311","title":"How do I access a second sub-element within a list and pass it to *apply?","body":"\u003cp\u003eGiven a list (\u003ccode\u003elist.data.partitions\u003c/code\u003e) with 72 elements (\u003ccode\u003edataset_1\u003c/code\u003e, \u003ccode\u003edataset_2\u003c/code\u003e, etc.), each of which contain two sub-elements (2 dataframes):\u003ccode\u003e$training\u003c/code\u003e and \u003ccode\u003e$testing\u003c/code\u003e; e.g.:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026gt; str(list.data.partitions$dataset_1)\nList of 2\n $ training:'data.frame': 81 obs. of 20 variables:\n ..$ b0 : num [1:81] 11.61 9.47 10.61 7.34 12.65 ...\n ..$ b1 : num [1:81] 11.6 9.94 10.7 10.11 12.2 ...\n ..$ b2 : num [1:81] 34.2 31 32.7 27.9 36.1 ...\n ...\n ..$ index: num [1:81] 0.165 0.276 0.276 0.181 0.201 ...\n\n $ testing :'data.frame': 19 obs. of 20 variables:\n ..$ b0 : num [1:19] 6.05 12.4 13.99 16.82 8.8 ...\n ..$ b1 : num [1:19] 12.4 10.8 11.8 13.7 16.3 ...\n ..$ b2 : num [1:19] 25.4 29.8 31.2 34.1 27.3 ...\n ...\n ..$ index: num [1:19] 0.143 1.114 0.201 0.529 1.327 ...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow would I correctly access the \u003ccode\u003e$testing\u003c/code\u003e dataframe using lapply (or similar functionality) and caret's \u003ccode\u003epredict\u003c/code\u003e function below:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e fun.predict.rf \u0026lt;- function(x, y) {\n predict(x, newdata = y$testing)\n }\n\n list.predictions \u0026lt;- lapply(list.models, fun.predict.rf, y=list.data.partitions)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe above function \"works\", but it returns predictions based on \u003ccode\u003e$training\u003c/code\u003e dataframe (~80 obs), instead of the \u003ccode\u003e$testing\u003c/code\u003e dataframe (~20 obs) that was specified. Ultimately, I'd expect a list containing predictions for each of the elements in my list, based on the \u003ccode\u003e$testing\u003c/code\u003e dataframe.\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003elist.models\u003c/code\u003e is a list of 72 models based on the \u003ccode\u003e$training\u003c/code\u003e dataframe using the \u003ccode\u003ecaret\u003c/code\u003e package in R (not shown or included). The number of models (72) in \u003ccode\u003elist.models\u003c/code\u003e equals the number of elements (72) in \u003ccode\u003elist.data.partitions\u003c/code\u003e when considering a single sub-element (either \u003ccode\u003e$training\u003c/code\u003e or \u003ccode\u003e$testing\u003c/code\u003e). The name of each of the 72 elements in \u003ccode\u003elist.data.partitions\u003c/code\u003e differs like so: \u003ccode\u003edataset_1\u003c/code\u003e, \u003ccode\u003edataset_2\u003c/code\u003e, etc., but the structure is identical (see \u003ccode\u003estr\u003c/code\u003e output above).\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003elist.data.partitions\u003c/code\u003e can be downloaded \u003ca href=\"http://filebin.ca/1cHVeR9ayOX5\" rel=\"nofollow\"\u003ehere\u003c/a\u003e. In this version, the 72 elements do not have names, but in my version the 72 elements are named (e.g., \u003ccode\u003edataset_1\u003c/code\u003e, \u003ccode\u003edataset_2\u003c/code\u003e, etc). Each of the sub-elements are still named \u003ccode\u003e$training\u003c/code\u003e and \u003ccode\u003e$testing\u003c/code\u003e.\u003c/p\u003e","accepted_answer_id":"26168167","answer_count":"2","comment_count":"7","creation_date":"2014-10-01 21:53:30.047 UTC","last_activity_date":"2015-01-11 05:50:47.69 UTC","last_edit_date":"2015-01-11 05:50:47.69 UTC","last_editor_display_name":"","last_editor_user_id":"134830","owner_display_name":"","owner_user_id":"1373765","post_type_id":"1","score":"2","tags":"r|lapply|r-caret","view_count":"171"} +{"id":"43398617","title":"Change $invalid or required dxtagbox angularjs","body":"\u003cp\u003eI am trying to validate a form using $invalid, I don´t even need a controller for that, this Works great with input and checkboxes, but when I use devextreme widgets it seems to fail.\u003c/p\u003e\n\n\u003cp\u003eThis is my simple form\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;form name=\"step1\" role=\"form\" novalidate\u0026gt;\n \u0026lt;div id=\"Chk1\" class=\"checkBox\" dx-check-box=\"Chk1_Options\" name=\"Chk1\" value=\"Values.Chk1\" ng-model=\"Values.Chk1\" \u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;div dx-tag-box=\"tag_options\" id=\"Tag_Options\" name=\"Tag_Options\" ng-model=\"Values.Tag_Options\" \u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;p class=\"help-block\"\u0026gt;\n \u0026lt;span ng-show=\"step1.Tag_Options.$invalid \"\u0026gt;Select at list One Option\u0026lt;/span\u0026gt;\n \u0026lt;/p\u0026gt;\n .....\n\u0026lt;/form\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn my Controller\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eapp.controller(\"Controller1\", ['$rootScope', '$scope', '$http', '$location', '$window', \nfunction ($rootScope, $scope, $http, $location, $window ) {\n\n ...\n\n $scope.Values = {};\n $scope.Tag_Options_disabled=true;\n\n $scope.Chk1_Options = {\n text: \"Check if Need it\",\n value: false,\n onValueChanged: function (info) {\n // When the new value is Checked\n if (info.value) {\n // Enable the TagBox using bindingOptions on Tag_Options\n $scope.Tag_Options_disabled=true;\n // Reset TagBox Contaier\n $scope.Tag_Options_instance.reset();\n // Also Clear Values\n $scope.Values.Tag_Options=null;\n // ********** I need to make it \"required\". ********** \n document.getElementById(\"Tag_Options\").required = true;\n } else {\n // ****** if I deselect CheckBox then I need to make it NOT required so the form can be Valid ****** \n document.getElementById(\"Tag_Options\").required = false;\n // Then Disable the TagBox using bindingOptions on Tag_Options\n $scope.Tag_Options_disabled=true;\n // Reset TagBox Contaier in case something was there\n $scope.Tag_Options_instance.reset();\n // Also Clear Values\n $scope.Values.Tag_Options=null;\n }\n\n }\n }\n\n\n $scope.Tag_Options = {\n datasource: data,\n valueExp: \"Id\",\n displayExpr: \"Ítem_Name\",\n showSelectionControls: true,\n bindingOptions: {\n disabled: 'Tag_Options_disabled'\n },\n onInitialized: function (e) {\n $scope.Tag_Options_instance = e.component;\n }\n\n }\n\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI've tried with \u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003cp\u003edocument.getElementById(\"xxx\").setAttribute(\"required\", true);\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003etag_Options.attributes[\"aria-invalid\"].value = true; \u0026lt;\u0026lt;-- I don't know why this element was created but it appears on attributes of the object\u003c/p\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eAt the end it Works ONLY on the second time I check the Checkbox, but even when it Works I can't find the right attribute to initialize it and the make it work since the first time.\u003c/p\u003e\n\n\u003cp\u003eCan anyone help me, I've been working arroung for 3 days I am giving up.\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2017-04-13 17:44:19.673 UTC","last_activity_date":"2017-04-13 17:44:19.673 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7863402","post_type_id":"1","score":"1","tags":"javascript|angularjs|devexpress|required|devextreme","view_count":"62"} +{"id":"33467831","title":"How to print return from overloaded methods in Java","body":"\u003cp\u003eI'm trying to sum the Ascii values of different strings while adhering to the following instructions: \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eCreate two overloaded methods. One that will give the sum of the\n ascii values of each character in a String and another which will\n produce the sum of the ascii values of two Strings.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eUsing the methods that I already wrote, how could I print out the sum in my main? Thanks! \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class Exam3Question2 \n{\n public static int sumAscii(String Input)\n {\n\n String s = Input; \n int sum = 0;\n for (int i = 0; i \u0026lt; s.length(); i++)\n {\n sum+= (int)s.charAt(i);\n }\n return sum;\n }\n\n public int sumAscii( String Input1, String Input2)\n {\n int sum = sumAscii(Input1) + sumAscii(Input2);\n return sum;\n }\n public static void main(String[] args) \n {\n Exam3Question2 c = new Exam3Question2();\n Scanner in = new Scanner(System.in);\n String word;\n System.out.println(\"Enter some text\");\n word = in.nextLine();\n sumAscii(word);\n int sum1 = c.sumAscii(Input1);\n int sum2 = c.sumAscii(Input1, Input2);\n int sum3 = sum1 + sum2;\n System.out.println(\"The sum of the two strings is: \" + sum3);\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"3","comment_count":"7","creation_date":"2015-11-01 22:14:23.107 UTC","last_activity_date":"2015-11-02 00:37:13.557 UTC","last_edit_date":"2015-11-02 00:13:23.947 UTC","last_editor_display_name":"","last_editor_user_id":"1413133","owner_display_name":"","owner_user_id":"5487241","post_type_id":"1","score":"2","tags":"java|methods|ascii","view_count":"114"} +{"id":"513782","title":"Why did ASP.NET generate the same cookie key for a domain and subdomain?","body":"\u003ch3\u003eBug:\u003c/h3\u003e\n\n\u003cp\u003eI've got an ASP.NET web application that occasionally sets identical cookie keys for \".www.mydomain.com\" and \"www.mydomain.com\". I'm trying to figure out what default cookie domain ASP.NET sets, and how I accidentally coded the site to sometimes prepend a \".\" to the cookie domain.\u003c/p\u003e\n\n\u003cp\u003eWhen 2 cookies have the same key and are sent up from the browser, the ASP.NET web application is unable to differentiate between the two because the domain value is not sent in the header. (See my \u003ca href=\"https://stackoverflow.com/questions/481230/why-are-request-cookie-poperties-null-or-incorrect-on-asp-net-postback\"\u003eprevious question\u003c/a\u003e)\u003c/p\u003e\n\n\u003ch3\u003eEvidence:\u003c/h3\u003e\n\n\u003cp\u003eI've enabled W3C logging on the web server and verified that both cookies are sent from the client. Here's an example from the log file (paired down for brevity).\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e80 GET /default.aspx page= 200 0 0 - - - - - +MyCookie2=sessionID=559ddb9b-0f38-4878-bb07-834c2ca9caae;+MyCookie2=sessionID=e13d83cd-eac2-46fc-b39d-01826b91cb2c;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003ch3\u003ePossible Factor:\u003c/h3\u003e\n\n\u003cp\u003eI am using subdomain enabled forms authentication.\u003c/p\u003e\n\n\u003cp\u003eHere's my web.config settings:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;authentication mode=\"Forms\"\u0026gt;\n\u0026lt;forms domain=\"mydomain.com\" enableCrossAppRedirects=\"true\" loginUrl=\"/login\" requireSSL=\"false\" timeout=\"5259600\" /\u0026gt;\n \u0026lt;/authentication\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere's and example of setting custom cookies:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eHttpCookie cookie1 = new HttpCookie(\"MyCookie1\") {HttpOnly = true, Expires = expiration};\nlogosCookie[\"email\"] = user.Email;\nlogosCookie[\"keycode\"] = user.PasswordHash;\nlogosCookie[\"version\"] = currentCookieVersion;\ncontext.Response.Cookies.Remove(\"cookie1\");\ncontext.Response.Cookies.Add(cookie1);\n\n// set FormsAuth cookie manually so we can add the UserId to the ticket UserData\nvar userData = \"UserId=\" + user.UserID;\nFormsAuthenticationTicket ticket = new FormsAuthenticationTicket(2, user.Email, now, expiration, true, userData);\n\nstring str = FormsAuthentication.Encrypt(ticket);\nHttpCookie cookie = new HttpCookie(FormsAuthentication.FormsCookieName, str)\n {\n HttpOnly = true,\n Path = FormsAuthentication.FormsCookiePath,\n Secure = FormsAuthentication.RequireSSL,\n Expires = ticket.Expiration\n };\nif (FormsAuthentication.CookieDomain != null)\n{\n cookie.Domain = FormsAuthentication.CookieDomain;\n}\n\ncontext.Response.Cookies.Remove(FormsAuthentication.FormsCookieName);\ncontext.Response.Cookies.Add(cookie1 );\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere's another example of setting a cookie.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar cookie2 = new HttpCookie(\"MyCookie2\");\ncookie2[CookieSessionIdKey] = Guid.NewGuid();\ncookie2.Expires = DateTime.Now.AddYears(10);\nHttpContext.Current.Response.Cookies.Set(cookie2);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003ch3\u003eUndesirable Resolution:\u003c/h3\u003e\n\n\u003cp\u003eI can manually force the cookie domain to be a specific value, but I'd like to avoid explicitly declaring the domain. I'd prefer to use the default framework behavior and change my use of ASP.NET to avoid prepend the \".\" to the cookie domain for custom cookies.\u003c/p\u003e","accepted_answer_id":"584434","answer_count":"1","comment_count":"0","creation_date":"2009-02-04 22:58:01.25 UTC","favorite_count":"1","last_activity_date":"2009-03-07 05:45:34.61 UTC","last_edit_date":"2017-05-23 10:32:49.483 UTC","last_editor_display_name":"Rich B","last_editor_user_id":"-1","owner_display_name":"Jim Straatman","owner_user_id":"33496","post_type_id":"1","score":"2","tags":"asp.net|authentication|cookies|forms-authentication|subdomain","view_count":"4030"} +{"id":"11260826","title":"Ext.define and handler scope","body":"\u003cp\u003eI got exactly the same problem as \u003ca href=\"http://www.sencha.com/forum/showthread.php?140992-Ext.define-and-the-Scope\" rel=\"nofollow\"\u003ehttp://www.sencha.com/forum/showthread.php?140992-Ext.define-and-the-Scope\u003c/a\u003e and unfortunately there's no clear answer on the thread.\u003c/p\u003e\n\n\u003cp\u003eI know that \u003ccode\u003escope:this\u003c/code\u003e won't work since it will only change the scope from the button to the \u003cstrong\u003ewindow\u003c/strong\u003e, and based on my search and the suggestion given on the thread, I conclude that the only solution is\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003edefine the alias when extending grid panel.\u003c/li\u003e\n\u003cli\u003etraverse the DOM using \u003ccode\u003ethis.up('alias')\u003c/code\u003e to get the grid panel.\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eIs it \u003cem\u003ereally\u003c/em\u003e the only solution? Thanks.\u003c/p\u003e","accepted_answer_id":"11261159","answer_count":"2","comment_count":"0","creation_date":"2012-06-29 11:18:06.263 UTC","last_activity_date":"2012-06-29 11:43:29.157 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1490929","post_type_id":"1","score":"0","tags":"extjs4","view_count":"1704"} +{"id":"26200232","title":"IllegalArgumentException on RMI Call","body":"\u003cp\u003eI have the following class definitions: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class Client extends AbstractServer implements IClient\n\npublic abstract class AbstractServer implements IServer\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe goal is to create a distributed/peer to peer game (for a school assignment) using Java RMI. P2P in a sense that at the start, there is 1 client that acts as the \"server\" accepting client's requests to join game etc. This primary server also selects a backup server, that functions as the primary (then selecting a new backup) if the old primary fails. \u003c/p\u003e\n\n\u003cp\u003eIn this sense, all clients can act as a server. Thats why I modeled the \u003ccode\u003eClient\u003c/code\u003e this way (extending an \u003ccode\u003eAbstractServer\u003c/code\u003e which implements the server code)\u003c/p\u003e\n\n\u003cp\u003eThe problem is: In client's main method: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclient = new Client();\nRegistry registry = LocateRegistry.getRegistry(host);\nIServer stub = (IServer) registry.lookup(\"Maze\");\n\nclient.id = stub.joinGame(client); // this line triggers exception\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eException details: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ejava.lang.IllegalArgumentException: argument type mismatch\n at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)\n at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n at java.lang.reflect.Method.invoke(Method.java:606)\n at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322)\n at sun.rmi.transport.Transport$1.run(Transport.java:177)\n at sun.rmi.transport.Transport$1.run(Transport.java:174)\n at java.security.AccessController.doPrivileged(Native Method)\n at sun.rmi.transport.Transport.serviceCall(Transport.java:173)\n at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:556)\n at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:811)\n at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:670)\n at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)\n at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)\n at java.lang.Thread.run(Thread.java:745)\n at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:275)\n at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:252)\n at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:161)\n at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:194)\n at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:148)\n at com.sun.proxy.$Proxy0.joinGame(Unknown Source)\n at client.Client.main(Client.java:31)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhats wrong? The IServer implementation looks like: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic interface IServer extends Remote {\n public int joinGame(Client client) throws RemoteException;\n ...\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhy the problem? \u003ccode\u003ejoinGame\u003c/code\u003e accepts a \u003ccode\u003eClient\u003c/code\u003e which I provided? \u003c/p\u003e\n\n\u003cp\u003eBy the way: the source is on \u003cstrong\u003e\u003ca href=\"https://github.com/jiewmeng/cs5223-assignment1\" rel=\"nofollow\"\u003eGitHub\u003c/a\u003e\u003c/strong\u003e\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2014-10-05 06:34:49.493 UTC","last_activity_date":"2014-10-07 06:36:54.883 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"292291","post_type_id":"1","score":"0","tags":"java|rmi|illegalargumentexception","view_count":"502"} +{"id":"35929906","title":"Cannot implicitly convert Telerik radgrid string to SystemDatetime","body":"\u003cp\u003eI have a Telerik radgrid textbox that stores date value. On update of the grid for the date I get an issue. Can anyone help me regarding this. I tried DateTime.TryParse ,Convert.Datatime... But nothing worked..\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;telerik:GridBoundColumn DataField=\"DTTM\" \n HeaderText=\"Date Registered\" SortExpression=\"DTTM\" UniqueName=\"DTTM\"\u0026gt;\n\u0026lt;/telerik:GridBoundColumn\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOn update:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eupdhost.DTTM=ShowDate((RadTextBox)editedItem.FindControl(\"DtB\"));\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eShowDate()\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate string ShowDate(object datVal)\n{\n string newStr = \"\";\n DateTime tmpDttm = default(DateTime);\n if ((datVal != null)) \n {\n try \n {\n tmpDttm = (DateTime)datVal;\n newStr = tmpDttm.ToString(\"MM/dd/yyyy h:mm tt\") + \" \";\n } \n catch (Exception ex) {\n //Do Nothing\n }\n }\n return newStr;\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"4","creation_date":"2016-03-11 00:14:36.79 UTC","last_activity_date":"2016-03-11 08:15:31.247 UTC","last_edit_date":"2016-03-11 08:15:31.247 UTC","last_editor_display_name":"","last_editor_user_id":"3997704","owner_display_name":"","owner_user_id":"5889940","post_type_id":"1","score":"1","tags":"c#|asp.net|radgrid|radgridview","view_count":"87"} +{"id":"7481094","title":"Fragment inside a ScrollView is too small","body":"\u003cp\u003eShort question: I want the fragment, which is inside a scroll view, to occupy all the available space. How can I achieve that?\u003c/p\u003e\n\n\u003cp\u003eDetails: I have a fragment, which I put inside a ScrollView in the parent layout. That scroll view occupies most of the space in the parent layout. Despite that, the fragment appears very small inside the scroll view. The picture illustrates this: \u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/u7UNp.jpg\" alt=\"the fragment, or the scroll view, doesn\u0026#39;t take the whole space\"\u003e\u003c/p\u003e\n\n\u003cp\u003eThis is the XML for the fragment:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" encoding=\"utf-8\"?\u0026gt;\n\u0026lt;GridView xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:id=\"@+id/ImagePickerGridView\" android:orientation=\"vertical\"\n android:layout_width=\"fill_parent\" android:layout_height=\"fill_parent\"\n android:gravity=\"center\" android:stretchMode=\"columnWidth\"\n android:numColumns=\"auto_fit\" android:horizontalSpacing=\"5dp\"\n android:verticalSpacing=\"5dp\" android:background=\"@color/orange1\"\u0026gt;\n\u0026lt;/GridView\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is the XML for the parent layout:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" encoding=\"utf-8\"?\u0026gt;\n\u0026lt;LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:id=\"@+id/LinearLayout1\" android:orientation=\"vertical\"\n android:layout_width=\"fill_parent\" android:layout_height=\"fill_parent\"\n android:gravity=\"center\" android:stretchMode=\"columnWidth\"\n android:numColumns=\"auto_fit\" android:horizontalSpacing=\"5dp\"\n android:verticalSpacing=\"5dp\"\u0026gt;\n \u0026lt;ScrollView android:layout_width=\"match_parent\"\n android:id=\"@+id/imagePickerScrollView\" android:layout_weight=\"1.0\"\n android:layout_height=\"match_parent\" android:background=\"@color/orange1\" android:layout_gravity=\"fill_vertical\"\u0026gt;\n \u0026lt;/ScrollView\u0026gt;\n \u0026lt;LinearLayout android:id=\"@+id/linearLayout3\"\n android:layout_width=\"match_parent\" android:layout_height=\"wrap_content\"\n android:background=\"@color/blue1\"\u0026gt;\n \u0026lt;Button android:layout_height=\"wrap_content\"\n android:layout_width=\"wrap_content\" android:layout_weight=\"1.0\"\n android:text=\"@string/ImportSelectedButton\" android:id=\"@+id/importSelectedButton\"\n android:layout_marginLeft=\"@dimen/standardMargin\"\n android:layout_marginTop=\"@dimen/standardMargin\"\n android:layout_marginBottom=\"@dimen/standardMargin\" android:onClick=\"onImportSelected\"\u0026gt;\u0026lt;/Button\u0026gt;\n \u0026lt;Button android:layout_height=\"wrap_content\"\n android:layout_width=\"wrap_content\" android:layout_weight=\"1.0\"\n android:text=\"@string/CancelButton\" android:id=\"@+id/cancelButton\"\n android:layout_marginRight=\"@dimen/standardMargin\"\n android:layout_marginTop=\"@dimen/standardMargin\"\n android:layout_marginBottom=\"@dimen/standardMargin\" android:onClick=\"onCancel\"\u0026gt;\u0026lt;/Button\u0026gt;\n \u0026lt;/LinearLayout\u0026gt;\n\u0026lt;/LinearLayout\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd finally, this is how I add the fragment to the activity:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.image_picker_1);\n\n Log.d(CLASS_NAME, \"onCreate\");\n\n m_multiPicSelect = getIntent().getBooleanExtra(IntentHelper.MULTI_SELECT, false);\n FragmentManager fragmentManager = getSupportFragmentManager();\n FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();\n\n Fragment fragment = new ImagePickerFragment();\n fragmentTransaction.add(R.id.imagePickerScrollView, fragment);\n fragmentTransaction.commit();\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"7481315","answer_count":"3","comment_count":"0","creation_date":"2011-09-20 06:40:11.87 UTC","favorite_count":"1","last_activity_date":"2011-09-20 07:03:59.763 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"839965","post_type_id":"1","score":"0","tags":"android|android-layout|android-fragments","view_count":"4123"} +{"id":"43234961","title":"Red vid modal window is opening more than one","body":"\u003cpre\u003e\u003ccode\u003eView [\n Size 400x400\n button \"click\" [\n view/flags [\n Size 300x100\n text \"modal window\"\n ]['modal 'pop-up]\n ]\n]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eProblem is if I click button 4 times it will create 4 modal window. But I want no other modal window if 1 modal window is already open. How can I do it\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2017-04-05 15:02:47.32 UTC","last_activity_date":"2017-04-06 06:37:39.643 UTC","last_edit_date":"2017-04-06 04:32:46.703 UTC","last_editor_display_name":"","last_editor_user_id":"2081311","owner_display_name":"","owner_user_id":"7819684","post_type_id":"1","score":"3","tags":"red","view_count":"63"} +{"id":"23438914","title":"User scope with Devise and Rails 4.1","body":"\u003cp\u003eI'm doing some proof of concepts with Rails. I created a Customer, and apply to it DEVISE.\nEverythig works fine, but now i'm trying to logging with a customer and enter directly into his scope.\nlocalhost:3000/customers/1\nAfter this hide the /customers/1 with some word, for example: myProfile.\u003c/p\u003e\n\n\u003cp\u003eI'm trying to do the first part with \u003c/p\u003e\n\n\u003cp\u003emodule ApplicationHelper\u003cbr\u003e\n\u003cbr\u003e\nprotected\u003cbr\u003e\n def after_sign_in_path_for(resource)\u003cbr\u003e\n #path to redirect\u003cbr\u003e\n end\u003cbr\u003e\nend\u003cbr\u003e\u003c/p\u003e\n\n\u003cp\u003eI was trying with definitions from routes.rb\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eredirect_to(customers_path)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eor something like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@customer= Customer.find_by_email(current_customer.email)\nredirect_to(customer_path(@customer))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut nothing is working yet. \u003c/p\u003e\n\n\u003cp\u003eI'm not sure how to send messages to the console of the server (like in Java with some System.out.println) to check the contents...\u003c/p\u003e\n\n\u003cp\u003eThanks a lot!\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2014-05-03 00:37:33.717 UTC","last_activity_date":"2014-05-03 00:37:33.717 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3562685","post_type_id":"1","score":"0","tags":"ruby-on-rails|ruby|devise","view_count":"123"} +{"id":"14012436","title":"Jsoup on Android : Follow redirection with Javascript (window.location)","body":"\u003cp\u003eOn my Android application, I'm using JSOUP to POST data to simulate a submit action for a login form (automatic log-in to a WISPR hotspot)\nThis is the raw Response that I get from the POST :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://\nwww.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\"\u0026gt;\n\u0026lt;html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"fr\" lang=\"fr\"\u0026gt;\n \u0026lt;head\u0026gt;\n \u0026lt;meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" /\u0026gt;\n \u0026lt;title\u0026gt;connexion\u0026lt;/title\u0026gt;\n \u0026lt;script type=\"text/javascript\"\u0026gt;\n window.location = \"http://192.168.2.1:3990/logon?username=0325767676@ssowifi.neuf.fr\u0026amp;amp;response=e30ee504ba06fa77502f1b9e8ccbaf8d\u0026amp;amp;uamip=192.168.2.1\u0026amp;userurl=http%3A%2F%2Fwww.sfr.fr%3Bneuf%3Bfr%3B3%3Bhttp%3A%2F%2Fwww.sfr.fr%3B\";\n \u0026lt;/script\u0026gt;\n \u0026lt;/head\u0026gt;\n \u0026lt;body\u0026gt;\n \u0026lt;/body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI compared it with the response that I get with a desktop browser using Firebug when login is successful and it's exactly the same, except of course the 'response' param.\u003c/p\u003e\n\n\u003cp\u003eAs you can see, here, it uses Javascript for redirection.\nAs JSOUP only follows 3xx redirection, I tried to parse the given Location URL from the response and execute afterwards a GET request on it\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eDocument doc = Jsoup.connect(parsedRedirectURL).cookies(cookies).get();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut I'm getting an\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eJava.net.SocketTimeoutException: failed to connect to /192.168.2.1 (port 3390) after 3000ms\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eWhat am I missing ?\u003c/p\u003e","accepted_answer_id":"14012510","answer_count":"1","comment_count":"0","creation_date":"2012-12-23 16:05:38.387 UTC","last_activity_date":"2012-12-23 16:14:57.963 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"982251","post_type_id":"1","score":"0","tags":"android|redirect|jsoup","view_count":"504"} +{"id":"20975165","title":"Powerpoint add-on to get text in notes in slides and convert it to audio. Doesn't seem to be getting the notes in the slides like it should?","body":"\u003cp\u003eHere is the code I've been working on. I imagine it should display a message box with the notes in slides but it doesn't. Also I'm not sure how to implement the speech synthesis with the code I have some of it in but could be in the wrong place.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Xml.Linq;\nusing PowerPoint = Microsoft.Office.Interop.PowerPoint;\nusing Office = Microsoft.Office.Core;\nusing Microsoft.Office.Interop.PowerPoint;\nusing System.Speech.Synthesis;\n\n\nnamespace FirstPowerPointAddIn\n{\npublic partial class ThisAddIn\n{\nprivate void ThisAddIn_Startup(object sender, System.EventArgs e) \n{\n\n\n SpeechSynthesizer synth = new SpeechSynthesizer();\n // Configure the audio output. \n synth.SetOutputToDefaultAudioDevice();\n\n PowerPoint.Application oPowerPoint = null;\n try\n {\n oPowerPoint.SlideShowBegin += oPowerPoint_SlideShowBegin;\n\n\n\n oPowerPoint.SlideShowNextSlide += oPowerPoint_SlideShowNextSlide;\n\n }\n catch(Exception)\n {\n Console.WriteLine(\"error\");\n }\n }\n\n\n\n private void ThisAddIn_Shutdown(object Pender, System.EventArgs e)\n {\n }\n\n\n\n private void oPowerPoint_SlideShowBegin(SlideShowWindow Wn) \n\n // If the slide has notes, get the notes\n {\n if (Wn.View.Slide.HasNotesPage == Microsoft.Office.Core.MsoTriState.msoTrue)\n {\n\n if (Wn.View.Slide.NotesPage.Shapes[2].TextFrame.HasText == Microsoft.Office.Core.MsoTriState.msoTrue)\n\n System.Windows.Forms.MessageBox.Show(Wn.View.Slide.NotesPage.Shapes[2].TextFrame.TextRange.Text);\n\n\n\n }\n }\n void oPowerPoint_SlideShowNextSlide(PowerPoint.SlideShowWindow Wn)\n {\n\n if (Wn.View.Slide.HasNotesPage == Microsoft.Office.Core.MsoTriState.msoTrue)\n {\n\n if (Wn.View.Slide.NotesPage.Shapes[2].TextFrame.HasText == Microsoft.Office.Core.MsoTriState.msoTrue)\n\n System.Windows.Forms.MessageBox.Show(Wn.View.Slide.NotesPage.Shapes[2].TextFrame.TextRange.Text);\n\n\n\n }\n }\n\n #region VSTO generated code\n\n /// \u0026lt;summary\u0026gt;\n /// Required method for Designer support - do not modify\n /// the contents of this method with the code editor.\n /// \u0026lt;/summary\u0026gt;\n private void InternalStartup()\n {\n this.Startup += new System.EventHandler(ThisAddIn_Startup);\n this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown);\n }\n\n #endregion\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e}\u003c/p\u003e","answer_count":"2","comment_count":"1","creation_date":"2014-01-07 15:13:30.367 UTC","last_activity_date":"2014-09-16 18:39:13.887 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3169544","post_type_id":"1","score":"0","tags":"c#|powerpoint|add-in|speech-synthesis","view_count":"1035"} +{"id":"43274712","title":"Log4j2.xml monitorInterval not working","body":"\u003cp\u003eHi I am using log4j2 and I have written a log4j2.xml file which is under \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esrc/main/resources\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have also added an attribute \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;Configuration monitorInterval=\"60\"\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut this doesn't work. How do I add this file to my classpath using Intellij.\u003c/p\u003e\n\n\u003cp\u003eI have included the following in my pom.xml under build tag:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;resources\u0026gt;\n \u0026lt;resource\u0026gt;\n \u0026lt;directory\u0026gt;src/main/resources\u0026lt;/directory\u0026gt;\n \u0026lt;/resource\u0026gt;\n\u0026lt;/resources\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"3","creation_date":"2017-04-07 09:36:45.783 UTC","last_activity_date":"2017-04-07 11:07:31.103 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4635458","post_type_id":"1","score":"0","tags":"classpath|log4j2","view_count":"197"} +{"id":"29126287","title":"antlr4 compile error: Serialized ATN data element out of range","body":"\u003cp\u003eantlr4.5, target Java, jdk1.6.\u003c/p\u003e\n\n\u003cp\u003eI compiled a \u003ccode\u003e.g4\u003c/code\u003e combined file, and got this error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eException in thread \"main\" java.lang.UnsupportedOperationException: Serialized ATN data element out of range.\nat org.antlr.v4.runtime.atn.ATNSerializer.serialize(ATNSerializer.java:370)\nat org.antlr.v4.runtime.atn.ATNSerializer.getSerialized(ATNSerializer.java:547)\nat org.antlr.v4.codegen.model.SerializedATN.\u0026lt;init\u0026gt;(SerializedATN.java:46)\nat org.antlr.v4.codegen.model.Recognizer.\u0026lt;init\u0026gt;(Recognizer.java:87)\nat org.antlr.v4.codegen.model.Lexer.\u0026lt;init\u0026gt;(Lexer.java:51)\nat org.antlr.v4.codegen.OutputModelController.lexer(OutputModelController.java:176)\nat org.antlr.v4.codegen.OutputModelController.buildLexerOutputModel(OutputModelController.java:129)\nat org.antlr.v4.codegen.CodeGenerator.generateLexer(CodeGenerator.java:144)\nat org.antlr.v4.codegen.CodeGenPipeline.process(CodeGenPipeline.java:73)\nat org.antlr.v4.Tool.processNonCombinedGrammar(Tool.java:429)\nat org.antlr.v4.Tool.process(Tool.java:379)\nat org.antlr.v4.Tool.processGrammarsOnCommandLine(Tool.java:346)\nat org.antlr.v4.Tool.main(Tool.java:193)\nat com.dicp.fdsl.antlr.FDSLCompiler.main(FDSLCompiler.java:13)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat does this error mean?\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2015-03-18 15:37:03.11 UTC","favorite_count":"1","last_activity_date":"2016-11-20 19:10:14.003 UTC","last_edit_date":"2015-03-18 18:05:42.57 UTC","last_editor_display_name":"","last_editor_user_id":"125389","owner_display_name":"","owner_user_id":"4686033","post_type_id":"1","score":"0","tags":"java|antlr","view_count":"164"} +{"id":"28882856","title":"Issue Copying and Deleting Arrays in C++","body":"\u003cp\u003eI've been playing around with my own sockets and buffers lately. For the following code, I have allocated a byte buffer within my class of size bufferSize. The buffer is used as a wrap-around, and so I also track the front and back indices of the buffer.\u003c/p\u003e\n\n\u003cp\u003eIn the code below, I allocate a local buffer that is the size of the class member buffer minus the data currently in the buffer, then read the socket data into it. I then copy the local buffer into the class buffer using the front/back indices.\u003c/p\u003e\n\n\u003cp\u003eThe code, as written, will print the expected data (I am sending test strings). However, if I uncomment the delete[] on the local buffer, the data in the class buffer is deleted as well. I have tried using memcpy and strcpy to copy the data from local to class buffer, to no avail. However, this is an obvious memory leak if I never delete the local buffer.\u003c/p\u003e\n\n\u003cp\u003eI think I must be missing something obvious and stupid, but for the life of me I can't see what it is.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eint readIntoBuffer(int timeout) {\n int lbufsize = bufferSize-bytesAvailable();\n\n byte *local_buffer = new byte[lbufsize+1];\n\n // read into the local buffer\n int bytes_read = socket-\u0026gt;recv(local_buffer, lbufsize, timeout);\n\n // null-terminate the local buffer\n local_buffer[bytes_read] = '\\0';\n\n for (int i = 0; i \u0026lt; bytes_read; i++) {\n // copy into class buffer, byte by byte\n buffer[bufferBack] = local_buffer[i];\n\n // update back index\n bufferBack = (bufferBack + 1) % bufferSize;\n }\n\n // null-terminator at current end of class buffer\n buffer[bufferBack] = '\\0';\n\n //delete[] local_buffer; \n\n std::cout \u0026lt;\u0026lt; buffer+bufferFront \u0026lt;\u0026lt; std::endl;\n\n return bytes_read;\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"7","creation_date":"2015-03-05 16:31:35.783 UTC","last_activity_date":"2015-03-05 18:26:23.593 UTC","last_edit_date":"2015-03-05 16:46:12.543 UTC","last_editor_display_name":"","last_editor_user_id":"2725525","owner_display_name":"","owner_user_id":"2725525","post_type_id":"1","score":"0","tags":"c++|delete-operator","view_count":"48"} +{"id":"30925390","title":"Rails 4 - NO manifest.json after assets precompile on production server","body":"\u003cp\u003eHere is the app/assets/ for a Rails 4.2 app.\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/K8a9f.jpg\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eThere are 3 bootstraps js and css files. After deploying to production (ubuntu 12.1), assets precompile was done on server (deployed under suburi):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eRAILS_ENV=production bundle exec rake assets:precompile RAILS_RELATIVE_URL_ROOT=/mysuburi\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is the \u003ccode\u003eproduction.rb\u003c/code\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e config.cache_classes = true\n config.eager_load = true\n config.consider_all_requests_local = false\n config.action_controller.perform_caching = true\n config.serve_static_files = false #ENV['RAILS_SERVE_STATIC_FILES'].present?\n config.assets.compress = true\n config.assets.js_compressor = :uglifier\n config.assets.compile = false\n config.assets.digest = true\n config.log_level = :debug\n config.i18n.fallbacks = true\n config.active_support.deprecation = :notify\n config.log_formatter = ::Logger::Formatter.new\n config.active_record.dump_schema_after_migration = false\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is the head of \u003ccode\u003eapplication.css.scss\u003c/code\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@import \"bootstrap.min.css\";\n@import \"bootstrap-theme.min.css\";\n\n@import \"simple_form.css.scss\";\n@import \"user_menus.css.scss\";\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn \u003ccode\u003eapplication.js\u003c/code\u003e, it has:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e//= require bootstrap.min\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is the output of \u003ccode\u003els\u003c/code\u003e for public/assets/ on production server:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eapplication-05cf37813d76c2bd659271403789374cc118f1a4e616ec220969577b79ff6514.css\napplication-375b4b5d8fc285716f4fdca966aa960912efe8292242df8f1a60b99d5caa4b02.js\nauthentify\nbanquet_coursex\nbanquetx\nbiz_workflowx\ncommonx\nglyphicons-halflings-regular-5d234508037dc13a419ef6ce48f3fc73dbb477f1a162c052b872182b494e626e.svg\nglyphicons-halflings-regular-bd18efd3efd70fec8ad09611a20cdbf99440b2c1d40085c29be036f891d65358.ttf\nglyphicons-halflings-regular-f495f34e4f177cf0115af995bbbfeb3fcabc88502876e76fc51a4ab439bc8431.eot\nglyphicons-halflings-regular-fc969dc1c6ff531abcf368089dcbaf5775133b0626ff56b52301a059fc0f9e1e.woff\njquery-ui\nsearchx\nstate_machine_logx\nuser_manualx\nuser_menus-7c46e17f4172c2a954eeaf85e80b4e030d1ed0fb3927288bbe07eeb4fb8cbfc5.css\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBy comparing with other Rails app, it is missing \u003ccode\u003emanifest.json\u003c/code\u003e under /assets. We tried various config options in \u003ccode\u003econfig/environment/production.rb\u003c/code\u003e with no avail. The only option works on production server is live compilation of \u003ccode\u003econfig.assets.compile = true\u003c/code\u003e (not recommended). What is wrong with our code to cause assets precompile failing?\u003c/p\u003e\n\n\u003cp\u003eUPDATE: we have re-built the Rails app from ground up and the assets problem remains the same. This assets precompile issue may have nothing to do with setup in \u003ccode\u003econfig/production.rb' and 'config/initializers/aseets.rb\u003c/code\u003e as we suspect. Rolling back version of \u003ccode\u003ebundler\u003c/code\u003e and \u003ccode\u003erake\u003c/code\u003e did not help. The same bootstrap css and js files have been used in another Rails 4.2 app running on the same production server without the problem. \u003c/p\u003e","answer_count":"3","comment_count":"5","creation_date":"2015-06-18 20:38:17.15 UTC","last_activity_date":"2016-08-24 16:19:22.787 UTC","last_edit_date":"2015-06-22 15:53:49.833 UTC","last_editor_display_name":"","last_editor_user_id":"938363","owner_display_name":"","owner_user_id":"938363","post_type_id":"1","score":"15","tags":"ruby-on-rails|ruby-on-rails-4|asset-pipeline|precompile","view_count":"2475"} +{"id":"921144","title":"jquery and html elements that run at server","body":"\u003cp\u003eI have a element contained in a user control (header). This div includes sub divs inside it. One of them includes user options. The user options div () displays the username of the logged in user, and couple of links related to already signed in users such as logout, settings etc.. the \"user_options\" div is absolutely positioned within the \"header\" div.\u003c/p\u003e\n\n\u003cp\u003eNow, in the login page itself, I want to hide this div since the user is taken there because she/he is not logged in. In this case, I put a runat=\"server\" attribute to the \"user_options\" div and I carry a check in page_load event of the .aspx page to see is the user is logged in as follows;\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eif check_user_loggedin() then\n user_options.attributes(\"style\") = \"display:none;\"\n ' also tried this with user_options.visible = false and \nelse\n user_options.attributes(\"style\") = \"display:block;\" \n ' in this one, I even tried the whole positioning css e.g. display:block; positon:absolute; left:100px; etc...\nend if\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003enow with this code, when I run the project, it works fine where I do not want to display the div - it gets hidden successfully. But in those pages where I need to show the div, it still gets displayed at the far top left side of the page, and the jquery click event of other \"div\" elements inside it also don't work.\u003c/p\u003e\n\n\u003cp\u003eI presume it has something to the with the execution order or the page event cycle but can you suggest any workaround for this?\u003c/p\u003e\n\n\u003cp\u003e========= EDIT ========================= \u003cbr/\u003e\nTHIS IS THE CSS:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e #user_options\n {\n position:absolute;\n top:18px;\n right:10px;\n width:200px;\n color:#ffffff;\n text-align:right;\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eTHIS IS THE HTML:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div id=\"user_options\" **runat=\"server\"**\u0026gt;\n \u0026lt;strong\u0026gt;\u0026lt;a class=\"whiteLink\" href=\"#\"\u0026gt;\u0026lt;%=MyNamespace.Users.getUsernameFromCookie%\u0026gt;\u0026lt;/a\u0026gt;\u0026lt;/strong\u0026gt; | \u0026lt;a class=\"whiteLink\" href=\"usr_logout.aspx\"\u0026gt;logout\u0026lt;/a\u0026gt; | \u0026lt;a class=\"whiteLink\" href=\"#\"\u0026gt;settings\u0026lt;/a\u0026gt; | \u0026lt;a class=\"whiteLink\" href=\"#\"\u0026gt;help\u0026lt;/a\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eTHIS IS THE CODE IN USER CONTROL:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ePrivate _displayUserOptions As Boolean\nPublic Property displayUserOptions() As Boolean\n Get\n Return _displayUserOptions\n End Get\n Set(ByVal value As Boolean)\n _displayUserOptions = value\n End Set\nEnd Property\n\n\nProtected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load\n If displayUserOptions Then\n user_options.Attributes(\"style\") = \"display:none;\"\n Else\n user_options.Attributes(\"style\") = \"display:block;\"\n End If\nEnd Sub\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eTHIS IS WHAT I CALL IN THE HTML PAGE TO DISPLAY THE USER CONTROL\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;uc1:x_layout_top ID=\"x_layout_top1\" runat=\"server\" displayUserOptions=\"false\" /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"3","creation_date":"2009-05-28 14:30:33.917 UTC","last_activity_date":"2009-05-29 14:52:49.38 UTC","last_edit_date":"2009-05-28 15:18:55.207 UTC","last_editor_display_name":"","last_editor_user_id":"49742","owner_display_name":"","owner_user_id":"49742","post_type_id":"1","score":"1","tags":"asp.net|jquery","view_count":"3557"} +{"id":"45530275","title":"How to extract stored functions and procedures from mysqldump file","body":"\u003cp\u003eSo I upgraded to MariaDB 10.2 slightly haphazardly and lost my stored functions and procedures (no idea why). Luckily I do have weekly backups (mysqldump) but I don't want to rebuild the whole DB again.\u003c/p\u003e\n\n\u003cp\u003eThere are some clever options out there - like upload the old DB backup into a new database on your cluster, then copy the functions across, but I thought easiest thing was to extract just the functions and procs from the mysqldump file. Here is my solution, hopefully you may find it useful, or improve upon it...\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003egawk '/Dumping routines for/,/Dump completed/{print}' backupfile.sql \u0026gt; foo1.sql\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThen you can import back into the DB in the normal way...\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emysql -u\u0026lt;user\u0026gt; -p\u0026lt;psw\u0026gt; DBNAME \u0026lt; foo1.sql\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"3","creation_date":"2017-08-06 08:50:17.233 UTC","last_activity_date":"2017-09-18 10:42:12.807 UTC","last_edit_date":"2017-09-18 10:42:12.807 UTC","last_editor_display_name":"","last_editor_user_id":"3566845","owner_display_name":"","owner_user_id":"3566845","post_type_id":"1","score":"0","tags":"awk|mariadb|gawk|ubuntu-server","view_count":"22"} +{"id":"46613742","title":"Received fatal alert: bad_record_mac when Git Push with netbeans 8","body":"\u003cp\u003eHey i am using Netbeans 8, SpringMVC, Java, Oracle and my project run fine but when i try to make git push then alert me with Received \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eGit Command Returned with the following error: \u003ca href=\"https://ftoro%40medianet.com.ve@bitbucket.org/Fideltoro/svservicios\" rel=\"nofollow noreferrer\"\u003ehttps://ftoro%40medianet.com.ve@bitbucket.org/Fideltoro/svservicios\u003c/a\u003e: Received fatal alert: bad_record_mac \u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eneed help please \u003c/p\u003e\n\n\u003cp\u003ei check my credentials and the url\u003c/p\u003e\n\n\u003cp\u003eactually when i make Git Pull he works fine, the problem is with push only\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2017-10-06 20:50:15.623 UTC","favorite_count":"1","last_activity_date":"2017-10-07 04:40:18.433 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"8468866","post_type_id":"1","score":"1","tags":"java|git|spring-mvc|netbeans|bitbucket","view_count":"21"} +{"id":"38414678","title":"Want to skip number while performing for loop","body":"\u003cp\u003eWhile using for loop in python whatever range we initially define that is fixed.\u003c/p\u003e\n\n\u003cp\u003eIn any case can we skip at some step like.code give \u003ccode\u003ei={0,1,2,3,4,5,6,7,8,9)\u003c/code\u003e \u003c/p\u003e\n\n\u003cp\u003eI want \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ei={0,1,2,3,4,8,9}\n for i in range(0,10):\n print i\n if(i==4):\n i=i+3 \n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"0","creation_date":"2016-07-16 19:12:30.93 UTC","last_activity_date":"2016-07-16 21:35:23.437 UTC","last_edit_date":"2016-07-16 21:35:23.437 UTC","last_editor_display_name":"","last_editor_user_id":"6229559","owner_display_name":"","owner_user_id":"6598332","post_type_id":"1","score":"0","tags":"python-2.7","view_count":"23"} +{"id":"6094957","title":"High Pass Filter for image processing in python by using scipy/numpy","body":"\u003cp\u003eI am currently studying image processing. In Scipy, I know there is one median filter in Scipy.signal. Can anyone tell me if there is one filter similar to high pass filter?\u003c/p\u003e\n\n\u003cp\u003eThank you\u003c/p\u003e","accepted_answer_id":"6117387","answer_count":"3","comment_count":"0","creation_date":"2011-05-23 08:55:21.657 UTC","favorite_count":"16","last_activity_date":"2011-05-24 22:02:35.737 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"724733","post_type_id":"1","score":"12","tags":"python|image-processing|numpy|scipy","view_count":"23753"} +{"id":"32089094","title":"Ember re-render when not in DOM","body":"\u003cp\u003eI have four components setup from the same model. Depending on the state of the item, it will be shown in one of the four components.\u003c/p\u003e\n\n\u003cp\u003eComponents are: is-new, is-ready, is-started, is-completed.\u003c/p\u003e\n\n\u003cp\u003eOn each of these components I have a timestamp, that I would like to update continuously. However Ember breaks with the following error whenever the DOM or state of the models update.\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eSomething you did caused a view to re-render after it rendered but before it was inserted into the DOM.\n\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eThis is an example of one of the components:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport Ember from 'ember';\n\nexport default Ember.Component.extend({\n tagName: 'article',\n\n click: function() {\n this.attrs.action();\n },\n\n didInsertElement: function() {\n this.updateCreatedAt();\n },\n\n updateCreatedAt: function() {\n console.log(this.isDestroying, this.isDestroyed);\n if (this.isVisible \u0026amp;\u0026amp; !this.isDestroying \u0026amp;\u0026amp; !this.isDestroyed) {\n this.rerender();\n }\n Ember.run.later(this, 'updateCreatedAt', 60000);\n }\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eDoes anyone have any clues on this matter?\u003c/p\u003e","accepted_answer_id":"32097285","answer_count":"1","comment_count":"3","creation_date":"2015-08-19 07:28:43.99 UTC","last_activity_date":"2015-08-19 13:42:48.107 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"961680","post_type_id":"1","score":"0","tags":"ember.js|ember-cli|ember-components","view_count":"177"} +{"id":"2352935","title":"dcommit to SVN in 1 commit after cherry-picking in git","body":"\u003cp\u003eI would like to know if there is a clean way to do git-svn dcommit of multiple local commits as 1 commit into subversion.\u003c/p\u003e\n\n\u003cp\u003eThe situation that I have is I am cherry picking some bug fixes changes from our trunk into the maintenance branch. The project preference is to have the bug fixes to be committed as 1 commit in subversion, but I would like to keep the history of changes that I had cherry-picked on my local git for references.\u003c/p\u003e\n\n\u003cp\u003eCurrently what I do is to do all cherry-picking on \u003cstrong\u003ebranch X\u003c/strong\u003e and then do a \u003cem\u003esquash merge\u003c/em\u003e into \u003cstrong\u003enew branch Y\u003c/strong\u003e. The dcommit will then be done from \u003cstrong\u003ebranch Y\u003c/strong\u003e.\u003c/p\u003e\n\n\u003cp\u003eIs there a better way to do it without using an intermediary branch?\u003c/p\u003e","accepted_answer_id":"2542132","answer_count":"2","comment_count":"1","creation_date":"2010-02-28 22:26:22.49 UTC","last_activity_date":"2010-03-30 00:22:46.507 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"10638","post_type_id":"1","score":"2","tags":"git|git-svn","view_count":"212"} +{"id":"2307555","title":"VS2008 jQuery Intellisense not working - (jquery-1.4.1.js)","body":"\u003cp\u003eI have searched on google, followed scottguthrie's article \u0026amp; also here on SO for a solution but to no avail. My environment consists of VS2008 SP1, including hotfix for JQuery intellisense.\u003c/p\u003e\n\n\u003cp\u003eI have downloaded 'jquery-1.4.1.js' \u0026amp; also 'jquery-1.4.1-vsdoc.js' from the jquery website.\nReferenced it in an 'HTM' file like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;script src=\"Js/jquery-1.4.1.js\" type=\"text/javascript\"\u0026gt;\u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand when i write code like below, there is no intellisense.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;script type=\"text/javascript\"\u0026gt; \n $\n\u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny ideas? TIA\u003c/p\u003e","accepted_answer_id":"2308703","answer_count":"3","comment_count":"0","creation_date":"2010-02-21 21:38:36.197 UTC","last_activity_date":"2010-07-11 20:37:05.77 UTC","last_edit_date":"2010-07-11 20:37:05.77 UTC","last_editor_display_name":"","last_editor_user_id":"14343","owner_display_name":"","owner_user_id":"168882","post_type_id":"1","score":"2","tags":"jquery|intellisense|visual-studio-2008-sp1","view_count":"936"} +{"id":"13655960","title":"Eclipse/Maven/Junit : junit throws classnotfound even though the compiled class is in test-classes folder","body":"\u003cp\u003eI recently upgraded my environment from Eclipse Ganymede to Eclipse Juno. My application was using the old maven-eclipse-plugin, so I had to make changes in the .classpath and .project and .settings files so that the m2e plugin in eclipse juno gets all the information correctly. I did this by following this link - \u003ca href=\"http://blog.frankel.ch/migrating-from-m2eclipse-to-m2e\" rel=\"nofollow\"\u003ehttp://blog.frankel.ch/migrating-from-m2eclipse-to-m2e\u003c/a\u003e \u003c/p\u003e\n\n\u003cp\u003eMy application runs perfectly fine using tomcat7 and maven also works fine.\nMy issues started when I tried to run a test as junit test in eclipse. This gives me a ClassNotFoundException. As a side note even if I add my test-classes folder as a classpath variable in eclipse, it still has issues because then it says it cannot find the resources folder. This very same environment worked perfectly fine with the earlier eclipse, maven plugin and classpath configuration. So I don't know what has changed. \u003c/p\u003e\n\n\u003cp\u003eI am sharing with you my project structure and classpath details. Please bear with me as the question is a bit long. \u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eXXX\n\u003cul\u003e\n\u003cli\u003eDBUnit (similar to Web)\u003c/li\u003e\n\u003cli\u003eOthers (similar to Web)\u003c/li\u003e\n\u003cli\u003eWeb\n\u003cul\u003e\n\u003cli\u003esrc/main/java\u003c/li\u003e\n\u003cli\u003esrc/main/resources\u003c/li\u003e\n\u003cli\u003esrc/test/java\u003c/li\u003e\n\u003cli\u003esrc/test/resources\u003c/li\u003e\n\u003cli\u003etarget/classes\u003c/li\u003e\n\u003cli\u003etarget/test-classes\u003c/li\u003e\n\u003cli\u003e.settings\u003c/li\u003e\n\u003cli\u003e.classpath\u003c/li\u003e\n\u003cli\u003e.project\u003c/li\u003e\n\u003c/ul\u003e\u003c/li\u003e\n\u003cli\u003etarget/classes\u003c/li\u003e\n\u003cli\u003e.settings\u003c/li\u003e\n\u003cli\u003e.classpath\u003c/li\u003e\n\u003cli\u003e.project\u003c/li\u003e\n\u003c/ul\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eThe classpath entry under Web is as follows : \u003c/p\u003e\n\n\u003cpre class=\"lang-xml prettyprint-override\"\u003e\u003ccode\u003e\u0026lt;classpathentry kind=\"src\" output=\"target/classes\" path=\"src/main/java\"/\u0026gt;\n\u0026lt;classpathentry kind=\"src\" output=\"target/test-classes\" path=\"src/test/java\"/\u0026gt;\n\u0026lt;classpathentry excluding=\"**\" kind=\"src\" output=\"target/classes\" path=\"src/main/resources\"/\u0026gt;\n\u0026lt;classpathentry excluding=\"**\" kind=\"src\" output=\"target/test-classes\" path=\"src/test/resources\"/\u0026gt;\n\u0026lt;classpathentry kind=\"con\" path=\"org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER\"/\u0026gt;\n\u0026lt;classpathentry kind=\"con\" path=\"org.eclipse.jdt.launching.JRE_CONTAINER\"/\u0026gt;\n\u0026lt;classpathentry kind=\"output\" path=\"target/classes\"/\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd the classpath entry under XXX is as follows : \u003c/p\u003e\n\n\u003cpre class=\"lang-xml prettyprint-override\"\u003e\u003ccode\u003e\u0026lt;classpathentry kind=\"src\" output=\"Others/target/classes\" path=\"Others/src/main/java\"/\u0026gt;\n\u0026lt;classpathentry kind=\"src\" path=\"DBUnit/src/main/java\"/\u0026gt;\n\u0026lt;classpathentry kind=\"src\" path=\"Web/src/main/java\"/\u0026gt;\n\u0026lt;classpathentry excluding=\"mock/\" kind=\"src\" output=\"Web/target/test-classes\" path=\"Web/src/test/java\"/\u0026gt;\n\u0026lt;classpathentry excluding=\"**\" kind=\"src\" output=\"Web/target/classes\" path=\"Web/src/main/resources\"/\u0026gt;\n\u0026lt;classpathentry kind=\"con\" path=\"org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6\"/\u0026gt;\n\u0026lt;classpathentry kind=\"con\" path=\"org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER\"/\u0026gt;\n\u0026lt;classpathentry kind=\"var\" path=\"TOMCAT_HOME/lib/annotations-api.jar\"/\u0026gt;\n\u0026lt;classpathentry kind=\"var\" path=\"TOMCAT_HOME/lib/el-api.jar\"/\u0026gt;\n\u0026lt;classpathentry kind=\"var\" path=\"TOMCAT_HOME/lib/jasper.jar\"/\u0026gt;\n\u0026lt;classpathentry kind=\"var\" path=\"TOMCAT_HOME/lib/jsp-api.jar\"/\u0026gt;\n\u0026lt;classpathentry kind=\"var\" path=\"TOMCAT_HOME/lib/servlet-api.jar\"/\u0026gt;\n\u0026lt;classpathentry kind=\"output\" path=\"target/classes\"/\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo when I clean the project eclipse does not place the main java classes under the the module1/target/classes folder and it also does not copy the resources folder under classes either.\u003c/p\u003e\n\n\u003cp\u003eI have searched around quite a bit regarding this problem. \u003c/p\u003e\n\n\u003cp\u003eOne solution also suggested to import the project into eclipse as a Maven project and update configuration. This splits my project into multiple modules and maven/eclipse throws me the exception - \"Path must include project and resource name\". I don't understand this error either.\u003c/p\u003e\n\n\u003cp\u003eAnother one suggested the removal of excluding=\"**\". I removed it but that did not help either.\u003c/p\u003e\n\n\u003cp\u003eIs there something wrong with the project structure? Does module1 require classpath and project files?\u003c/p\u003e\n\n\u003cp\u003ePlease help, I'll be really grateful. Thanks.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eUpdate 03rd Dec 2012\u003c/strong\u003e \u003c/p\u003e\n\n\u003cp\u003eThis is the exception - \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eClass not found com.iei.gas.service.QuartzTestService\njava.lang.ClassNotFoundException: com.iei.gas.service.QuartzTestService \nat java.net.URLClassLoader$1.run(URLClassLoader.java:366)\nat java.net.URLClassLoader$1.run(URLClassLoader.java:355)\nat java.security.AccessController.doPrivileged(Native Method)\nat java.net.URLClassLoader.findClass(URLClassLoader.java:354)\nat java.lang.ClassLoader.loadClass(ClassLoader.java:423)\nat sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)\nat java.lang.ClassLoader.loadClass(ClassLoader.java:356)\nat org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClass(RemoteTestRunner.java:693)\nat org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClasses(RemoteTestRunner.java:429)\nat org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452)\nat org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)\nat org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)\nat org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"5","creation_date":"2012-12-01 03:07:15.967 UTC","last_activity_date":"2012-12-03 06:31:36.003 UTC","last_edit_date":"2012-12-03 06:31:36.003 UTC","last_editor_display_name":"","last_editor_user_id":"931293","owner_display_name":"","owner_user_id":"931293","post_type_id":"1","score":"1","tags":"eclipse|maven-2|junit4|m2eclipse|m2e","view_count":"1247"} +{"id":"15479561","title":"Android App: Convert 3gp to mp3","body":"\u003cp\u003eMy soundfiles should be changed from 3gp to mp3.\u003c/p\u003e\n\n\u003cp\u003eI've tried to do this with ffmpeg:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003effmpeg -i input.3gp -vn -acodec libmp3lame -ab 64k output.mp3\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut the new mp3 file is only 0 KB big.\u003c/p\u003e\n\n\u003cp\u003eCould libmp3lame be the problem? \nIs it even possible to do that in Java?(since I only found c++ examples)\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2013-03-18 14:42:48.477 UTC","last_activity_date":"2013-03-18 15:02:44.163 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2043332","post_type_id":"1","score":"0","tags":"java|android|eclipse|ffmpeg|mp3","view_count":"689"} +{"id":"16144470","title":"Get last_insert_id with singleton pattern","body":"\u003cp\u003eI was wondering about a thing when using the singleton pattern on a database connection class. \u003c/p\u003e\n\n\u003cp\u003eAs I understand it, the singleton pattern prevents the creation of more then 1 object of a given class that uses the pattern. \u003c/p\u003e\n\n\u003cp\u003eLets say I need the id from a row I just inserted which I get via the \u003ccode\u003emysqli::$insert_id\u003c/code\u003e.\nWhat if another use of the connection object was used to insert a row at the same time, might that result in a chance of returning a different id then the one expected or is it certain always to return the right id?\u003c/p\u003e\n\n\u003cp\u003eSorry for the newbie question, I have just been wondering whether there were a tiny chance on a multiuser application that getting the id this way might be inconsistent.\u003c/p\u003e\n\n\u003cp\u003eThanks in advance.\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2013-04-22 10:08:43.537 UTC","last_activity_date":"2013-04-22 10:40:13.373 UTC","last_edit_date":"2013-04-22 10:40:13.373 UTC","last_editor_display_name":"","last_editor_user_id":"2269749","owner_display_name":"","owner_user_id":"649717","post_type_id":"1","score":"1","tags":"php|oop|singleton","view_count":"241"} +{"id":"19326117","title":"Elasticsearch Nest, parent/child relationship","body":"\u003cp\u003ecan you help me out to define a parent/child relationship using \u003ccode\u003eNESTclient\u003c/code\u003e for elasticsearch?\nmy code looks like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[ElasticType(Name = \"type_properties\", DateDetection = true,.....)]\npublic class Properties{....}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003chr\u003e\n\n\u003cpre\u003e\u003ccode\u003e[ElasticType(Name = \"type_sales\", DateDetection = true, , ParentType = \"type_properties\")]\npublic class SalesHistory{....}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI defined the parentType, but I don't see this sales documents related to a parent property.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n \"_index\": \"testparentchild\",\n \"_type\": \"type_sales\",\n \"_id\": \"dVd1tUJ0SNyoiSer7sNA\",\n \"_version\": 1,\n \"_score\": 1,\n \"_source\": {\n \"salesRecId\": 179504762,\n \"salesPrice\": 150000,\n \"salesDate\": \"2003-04-07T00:00:00\",\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"19360482","answer_count":"1","comment_count":"0","creation_date":"2013-10-11 19:50:34.827 UTC","last_activity_date":"2016-12-09 09:58:28.047 UTC","last_edit_date":"2016-12-09 09:58:28.047 UTC","last_editor_display_name":"","last_editor_user_id":"6340959","owner_display_name":"","owner_user_id":"2824011","post_type_id":"1","score":"0","tags":"elasticsearch|nest","view_count":"1534"} +{"id":"46334908","title":"Loading failed javacript file when deploy web application on weblogic","body":"\u003cp\u003ei have a problem with load javacript file on jsp page when deploy my web application on weblogic server. Before I deploy it on Tomcat 7 and it work normally.\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eFirst I see on console window of firefox. My jsp page couldn't load js file on \u003cstrong\u003e\u003cem\u003e/resources/\u003c/em\u003e\u003c/strong\u003e folder (this folder is the same level with \u003cstrong\u003e\u003cem\u003e/WEB-INF/\u003c/em\u003e\u003c/strong\u003e):\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eLoading failed for the \u003ccode\u003e\u0026lt;script\u0026gt;\u003c/code\u003e with source “http ://10.3.11.25:7001/resources/assets/global/plugins/jquery.min.js”. 10.3.11.25:7001:104\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eImage i have capture:\n\u003ca href=\"https://i.stack.imgur.com/TJSLf.png\" rel=\"nofollow noreferrer\"\u003eConsole log of browser\u003c/a\u003e\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eI try copy the url: “http ://10.3.11.25:7001/resources/assets/global/plugins/jquery.min.js” to address bar. \u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003e=\u003e I can access it, but i only can download the js file (It not display the source code on browser as normally).\u003c/p\u003e\n\n\u003cp\u003e=\u003e What is my problem. I deploy my web application on weblogic 12c\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eUPDATE:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eNetwork tab load js file ok, all status is 200: \n\u003ca href=\"https://i.stack.imgur.com/E9qjw.png\" rel=\"nofollow noreferrer\"\u003eCapture image\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003eSource code include on jsp:\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003e\u003ccode\u003e\u0026lt;script src=\"resources/assets/global/plugins/jquery.min.js\"\n type=\"text/javascript\"\u0026gt;\u0026lt;/script\u0026gt;\n\u0026lt;script src=\"resources/assets/global/plugins/jquery-migrate.min.js\"\n type=\"text/javascript\"\u0026gt;\u0026lt;/script\u0026gt;\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eUPDATE 2:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eAll status is 200 but load O KB and response is notthing\u003c/li\u003e\n\u003cli\u003eWhen i copy the js url to address bar it show popup download it (not display the source code as normally)\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003ePS: Sorry i can post more than 2 picture.\u003c/p\u003e","accepted_answer_id":"46356494","answer_count":"1","comment_count":"10","creation_date":"2017-09-21 03:17:09.437 UTC","last_activity_date":"2017-09-22 03:44:41.263 UTC","last_edit_date":"2017-09-21 03:40:25.14 UTC","last_editor_display_name":"","last_editor_user_id":"8645550","owner_display_name":"","owner_user_id":"8645550","post_type_id":"1","score":"0","tags":"javascript|deployment|weblogic12c","view_count":"70"} +{"id":"16250969","title":"How to render Backbone el correctly into the view page","body":"\u003cp\u003eI'm trying to working correctly with my first \u003ccode\u003eBackbone\u003c/code\u003e app and trying to render it into my page.\u003c/p\u003e\n\n\u003cp\u003eI've wrote this app but I didn't got how I shoud put the app html rendered in the html view:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;script type=\"text/javascript\"\u0026gt;\n$(function(){\n var SearchApp = new Search.Views.App({\n id:\"product-name-results\"\n });\n SearchApp.render();\n});\n\u0026lt;script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is my app\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar Search = {\n Models: {},\n Collections: {},\n Views: {},\n Templates:{}\n}\n\nSearch.Views.App = Backbone.View.extend({\n initialize:function () {\n console.log('Search.Views.App initialize')\n }, \n render:function (options) {\n this.$el.html('hello world');\n }\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eObviously this render method not appending in the \u003ccode\u003ehtml view\u003c/code\u003e, but how to append it into the view?\u003c/p\u003e","accepted_answer_id":"16251013","answer_count":"1","comment_count":"0","creation_date":"2013-04-27 10:27:02.6 UTC","last_activity_date":"2013-04-27 10:40:12.98 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"185921","post_type_id":"1","score":"0","tags":"backbone.js|render|el","view_count":"89"} +{"id":"4836723","title":"Trouble with inserting notes into a JTree","body":"\u003cp\u003eI have a \u003ccode\u003eJTree\u003c/code\u003e which is constructed with the following method:\u003cbr\u003e\n(The \u003ccode\u003eBKMNode\u003c/code\u003e class extends \u003ccode\u003eDefaultMutableTreeNode\u003c/code\u003e, and the\u003ccode\u003eDataNode\u003c/code\u003e simply holds the data) \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e void populateTree(BKMNode parent) {\n for (DataNode node : nodes) {\n BKMNode treeNode = new BKMNode(node.name,node.fullName,null);\n // check if this node was already added before\n if (! existingNodes.contains(ip + \".\" + node.fullName)) {\n existingNodes.add(ip + \".\" + node.fullName);\n DefaultTreeModel model = (DefaultTreeModel)tree.getModel();\n model.insertNodeInto(treeNode, parent, parent.getChildCount());\n System.out.println(\"adding \" + ip + \".\" + node.fullName);\n }\n node.populateTree(treeNode);\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003ccode\u003e// some more non-relevant code...\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eWhen the tree is created at the application startup, everything is fine.\u003cbr\u003e\nBut once in a while my application adds nodes to the tree using the same method.\u003cbr\u003e\nWhen the application attempts to add a new node to the tree in does print the text, but nothing changes on the \u003ccode\u003eGUI\u003c/code\u003e.\u003cbr\u003e\nI tried calling \u003ccode\u003eJTree.invalidate()\u003c/code\u003e, \u003ccode\u003evalidate()\u003c/code\u003e, \u003ccode\u003erepaint()\u003c/code\u003e, \u003ccode\u003ereload()\u003c/code\u003e but nothing seems to help. \u003c/p\u003e\n\n\u003cp\u003eThe \u003ccode\u003epopulateTree\u003c/code\u003e method is always called from the \u003ccode\u003eEDT\u003c/code\u003e. \u003c/p\u003e\n\n\u003cp\u003eDoes anyone know what's the problems here? \u003c/p\u003e\n\n\u003cp\u003eThanks a lot in advance! \u003c/p\u003e","answer_count":"2","comment_count":"8","creation_date":"2011-01-29 11:59:40.373 UTC","favorite_count":"0","last_activity_date":"2014-06-25 11:28:14.557 UTC","last_edit_date":"2014-06-25 11:28:14.557 UTC","last_editor_display_name":"","last_editor_user_id":"3485434","owner_display_name":"","owner_user_id":"594926","post_type_id":"1","score":"0","tags":"java|swing|jtree","view_count":"1088"} +{"id":"47012524","title":"iOS TableView Constraints doesn’t work","body":"\u003cp\u003e\u003cstrong\u003eHi. I’m already tried to find some info about it at Goodle, but nothing could help me.\u003c/strong\u003e\u003cbr\u003e\nI’m swift beginner. Help me, please.\u003c/p\u003e\n\n\u003cp\u003eI want to auto layout this \u003ccode\u003eTableViewCell\u003c/code\u003e in \u003ccode\u003eTableViewController\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/GqbT7.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/GqbT7.png\" alt=\"TableViewController\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eNow it’s look fine in IB, Preview and Simulator, but only on this screen size, sure.\u003c/p\u003e\n\n\u003cp\u003eThen I added by 5 constrains, as I saw at one StackOverflow answer, to each of subview of Cell like this:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/e086F.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/e086F.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eand now, when I run project is look crashed:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/ozIbI.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/ozIbI.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eWHY\u003c/strong\u003e ?\u003c/p\u003e","accepted_answer_id":"47014459","answer_count":"2","comment_count":"5","creation_date":"2017-10-30 10:02:50.287 UTC","last_activity_date":"2017-10-30 11:44:45.793 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2802580","post_type_id":"1","score":"0","tags":"ios|swift|storyboard","view_count":"84"} +{"id":"46387133","title":"Override CSS list-style-type for h3 elements","body":"\u003cp\u003eI am working on a blog site built with Middleman. The default list-style-type for lists is in _lists.scss and works correctly where each li element has a disc. However, I want to override this for the h3 element in the li. \u003c/p\u003e\n\n\u003cp\u003eHere is an example of my list html:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div id=\"main\" role=\"main\"\u0026gt;\n\u0026lt;ul\u0026gt;\n \u0026lt;li\u0026gt;\n \u0026lt;h3\u0026gt;heading\u0026lt;/h3\u0026gt;\n \u0026lt;/li\u0026gt;\n\u0026lt;/ul\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is the css I have been working with:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eul, ol {\n margin: 0;\n padding: 0;\n list-style-type: none;\n\n \u0026amp;%default-ul {\n list-style-type: disc;\n margin-bottom: $base-line-height / 2;\n padding-left: $base-line-height;\n }\n\n \u0026amp;%default-ol {\n list-style-type: decimal;\n margin-bottom: $base-line-height / 2;\n padding-left: $base-line-height;\n }\n}\n\n#main \u0026gt; ul \u0026gt; li \u0026gt; h3 {\n list-style-type: none;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut nothing changes on the screen. \u003c/p\u003e\n\n\u003cp\u003eAnything I am missing? Any help is appreciated.\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2017-09-24 06:06:49.893 UTC","last_activity_date":"2017-09-24 06:43:10.227 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"302274","post_type_id":"1","score":"0","tags":"css|middleman","view_count":"53"} +{"id":"5536096","title":"how to use log4j with Netbeans 6.9.1 for Java desktop application","body":"\u003cp\u003eI am trying to use log4j for my Java desktop application that i am developing using Netbeans IDE 6.9.1. I have log4j.properties file in META-INF folder for logging during development. I also tried to put it along with the executable jar(after installation) but both of them did not work. It also throws exception when i call the method.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ePropertyConfigurator.configure(filepath);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand it always throws this exception irrespective of the location of log.properties file\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ejava.io.FileNotFoundException: META-INF\\log4j.properties (The system cannot find the path specified)\n at java.io.FileInputStream.open(Native Method)\n at java.io.FileInputStream.\u0026lt;init\u0026gt;(FileInputStream.java:106)\n at java.io.FileInputStream.\u0026lt;init\u0026gt;(FileInputStream.java:66)\n at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:306)\n at org.apache.log4j.PropertyConfigurator.configure(PropertyConfigurator.java:324)\n at fi.xmldation.common.SharedMethods.readSettingsFile(SharedMethods.java:43)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs it a bug in the IDE or I am doing something wrong? \u003c/p\u003e","accepted_answer_id":"5539080","answer_count":"3","comment_count":"1","creation_date":"2011-04-04 08:23:15.25 UTC","last_activity_date":"2012-11-28 11:28:51.49 UTC","last_edit_date":"2011-04-04 08:25:16.45 UTC","last_editor_display_name":"","last_editor_user_id":"360299","owner_display_name":"","owner_user_id":"360299","post_type_id":"1","score":"0","tags":"log4j|netbeans-6.9|java","view_count":"6568"} +{"id":"25804948","title":"JBoss6 fails to start on Windows (32bit) machine with JDK 7","body":"\u003cp\u003eJBoss will not start with my current configuration. I receive the error:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eError occurred during initialization of VM Could not reserve enough\n space for object heap Error: Could not create the Java Virtual\n Machine. Error: A fatal exception has occurred. Program will exit.\n Press any key to continue . . .\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eThe JAVA_OPTS being used by JBoss are:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e-client \n-Dprogram.name=standalone.bat \n-Xms128 \n-Xmx2G \n-XX:MaxPermSize=256M \n-Djava.net.preferIPv4Stack=true \n-Djboss.modules.system.pkgs=org.jboss.byteman \n-Xms1024m \n-Xmx2048m \n-XX:PermSize=32m \n-XX:MaxPermSize=512m \n-Xss2m \n-XX:+UseConcMarkSweepGC \n-XX:+CMSClassUnloadingEnabled \n-Djavax.xml.soap.MessageFactory=org.apache.axis.soap.MessageFactoryImpl \n-Djavax.xml.soap.SOAPConnectionFactory=org.apache.axis.soap.SOAPConnectionFactor‌​yImpl \n-Djavax.xml.soap.SOAPFactory=org.apache.axis.soap.SOAPFactoryImpl\"\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"25807261","answer_count":"3","comment_count":"4","creation_date":"2014-09-12 09:24:02.683 UTC","favorite_count":"4","last_activity_date":"2014-09-12 11:50:12.313 UTC","last_edit_date":"2014-09-12 11:50:12.313 UTC","last_editor_display_name":"","last_editor_user_id":"575766","owner_display_name":"","owner_user_id":"4033719","post_type_id":"1","score":"1","tags":"java|java-7|jboss6.x|jvm-arguments","view_count":"174"} +{"id":"20181672","title":"Using the ServiceStack AuthProvider, how to limit an authenticated user to its own resources?","body":"\u003cp\u003eI am using the ServiceStack Credentials AuthProvider for an REST service and the authentication process works perfect but I need to limit an authenticated user to its own resources in the database.\u003c/p\u003e\n\n\u003cp\u003eFor example, if the user(id=1) is logged in, she can obviously retrieve her orders through /api/users/1/orders. Now, how can this user be thrown the \"not authenticated\" message through the /api/users/2/orders?\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2013-11-24 22:05:15.043 UTC","favorite_count":"1","last_activity_date":"2013-11-25 12:45:47.22 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2958608","post_type_id":"1","score":"2","tags":"authentication|servicestack","view_count":"106"} +{"id":"34196898","title":"GmailApp.sendEmail stopped working","body":"\u003cp\u003eI had script that was working up until about a month ago.. No errors just plain stopped.\u003c/p\u003e\n\n\u003cp\u003eI've since tried to rewrite the script with some help from others but still nothing... \u003c/p\u003e\n\n\u003cp\u003eThe Script is attached to a Google Form Response Spreadsheet. When the form is submitted it is supposed to send 2 emails out. One to the submitter and one to the recipient.\u003c/p\u003e\n\n\u003cp\u003ehere's where I am at. Still no errors.. At least none that I know of.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction getResponseURL(timestamp) {\nvar id = SpreadsheetApp.getActive().getFormUrl().match(/[\\_\\-\\w]{25,}/);\nvar form = FormApp.openById(id);\nvar resp = form.getResponses(new Date(timestamp.getTime() - 1000*5));\n\nif (resp.length) return resp[0].getEditResponseUrl(); else return \"\";\n}\n\nfunction SendGoogleForm(e) {\nvar val = {\n/*\nEnter column header for recipient address\nFor an example\n'subject': 'Email'\n*/\n'recipient': 'Email',\n\n/*\nEnter your email alias\n*/\n'alias': 'email@themarcjosephband.ca',\n\n/*\nReceiver's email for the notifications:\n*/\n'to': 'info@themarcjosephband.ca',\n\n/*\nReplyTo email for the receiver's notifications:\n*/\n'replyto' : 'info@themarcjosephband.ca',\n\n/*\n1. the subject includes a row number and the person's name automatically - just want to fill in the text afterwards\nChange the 'subject' value below.\nFor an example\n'subject': 'test'\nOR\n'subject': 'the text afterwards'\n*/\n\n'subject': 'Quote Request',\n'subject2': 'Quote Request',\n\n/*\n2. the body of course includes the form fields that were filled in, I just want to add text prior to that.\nChange the 'text' value below.\nFor an example\n'text': 'test'\nOR\n'text': 'add text prior to that'\n*/\n\n'text': 'The following quote request has been submitted.'\n}\n\nvar recipient = \"\";\n\nvar s = SpreadsheetApp.getActiveSheet();\nvar headers = s.getRange(1,1,1,s.getLastColumn()).getValues()[0]; \n\nvar subject = \"[#\" + s.getLastRow() + \"] \" + e.namedValues[\"Name\"].toString() + \" \" + val.subject;\n\nvar body, message = [['','']];\n\nfor(var i in headers) {\nvar col = headers[i];\nif ( e.namedValues[col] \u0026amp;\u0026amp; (e.namedValues[col].toString() !== \"\") \u0026amp;\u0026amp; (col !== \"Timestamp\") \u0026amp;\u0026amp; col !== \"What is the color of oranges?\" ) {\n message.push([col, e.namedValues[col].toString()]); \n if (col === val.recipient) {\n recipient = e.namedValues[col].toString();\n }\n}\n}\n\nvar textBody = \"\", htmlBody = \"\"; \nfor (var i=0; i\u0026lt;message.length; i++) {\nhtmlBody += \"\u0026lt;tr\u0026gt;\u0026lt;td\u0026gt;\u0026lt;strong\u0026gt;\" + message[i][0] + '\u0026lt;/strong\u0026gt;\u0026lt;/td\u0026gt;\u0026lt;td\u0026gt;'+ message[i][1] + \"\u0026lt;/td\u0026gt;\u0026lt;/tr\u0026gt;\";\ntextBody += message[i][0] + \" :: \" + message[i][1] + \"\\n\\n\";\n}\nhtmlBody = val.text + \"\u0026lt;br /\u0026gt;\u0026lt;br /\u0026gt;\u0026lt;table border='0' cellspacing='0' cellpadding='2'\u0026gt;\" + htmlBody + \"\u0026lt;/table\u0026gt;\";\ntextBody = val.text + \"\\n\\n\" + textBody;\n\nvar responseURL = getResponseURL(new Date(e.namedValues[\"Timestamp\"].toString()));\n\n/*\n3. the body also includes a line with a link to edit the response at the end.\nIt's below\n*/\n\nif (responseURL !== \"\") {\n\nhtmlBody = htmlBody + \"\u0026lt;br\u0026gt;\u0026lt;br\u0026gt;\" + \"You can edit the response by \u0026lt;a href='\" + responseURL + \"'\u0026gt;clicking here\u0026lt;/a\u0026gt;.\";\n\ntextBody = textBody + \"\\n\\n\" + \"Click the link below to edit the response:\\n\" + responseURL;\n\n}\n\nGmailApp.sendEmail ( val.to, subject, textBody, {\nhtmlBody: htmlBody, replyTo: recipient, from: val.alias } );\n\nGmailApp.sendEmail ( recipient, val.subject2, textBody, {\nhtmlBody: htmlBody, replyTo: val.replyto, from: val.alias } ); \n\n}\n\nfunction Authorize() {\n Browser.msgBox(\"Script authorized.\");\n}\n\n\nfunction InitializeTriggers() {\n\nReset(true);\n\n ScriptApp.newTrigger(\"SendGoogleForm\")\n .forSpreadsheet(SpreadsheetApp.getActiveSpreadsheet())\n .onFormSubmit()\n .create();\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-12-10 08:25:03.137 UTC","last_activity_date":"2015-12-10 10:03:06.883 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5663011","post_type_id":"1","score":"1","tags":"google-apps-script|google-spreadsheet","view_count":"220"} +{"id":"22663096","title":"Alt Codes and jQuery keyup event - Value not updated when alt key is released","body":"\u003cpre\u003e\u003ccode\u003e\u0026lt;div style=\"color: blue\"\u0026gt;\u0026lt;/div\u0026gt;\n\u0026lt;input type=\"text\"\u0026gt;\n\n\u0026lt;script\u0026gt;\n$('input').keyup(function(){\n $('div').html($(this).val());\n });\n\u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003ca href=\"http://jsfiddle.net/NMqhW/\" rel=\"nofollow\"\u003ehttp://jsfiddle.net/NMqhW/\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eBasically when alt codes are used the release of the alt key seems to fire the event; however, the value of the triggering element at the time the alt key is released seems to not be updated with the alt code symbol. (At-least in my chrome version 34; Windows)\u003c/p\u003e\n\n\u003cp\u003eAlt does appear to be firing as if I add a console.log to the keyup it does trigger when alt is released.\u003c/p\u003e\n\n\u003cp\u003eIs there any way to make it work (\u003cem\u003eideally without a hack\u003c/em\u003e) such that the Alt code change also updates the DIV?\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2014-03-26 13:52:32.317 UTC","favorite_count":"1","last_activity_date":"2017-08-17 21:59:12.76 UTC","last_edit_date":"2014-03-26 14:26:42.96 UTC","last_editor_display_name":"","last_editor_user_id":"299408","owner_display_name":"","owner_user_id":"299408","post_type_id":"1","score":"1","tags":"javascript|jquery","view_count":"388"} +{"id":"27693122","title":"Create type copies","body":"\u003cp\u003eHow do you create type copies? For example, how do I create types \u003ccode\u003eMass\u003c/code\u003e, \u003ccode\u003eAcceleration\u003c/code\u003e and \u003ccode\u003eForce\u003c/code\u003e which are not implicitly convertible to \u003ccode\u003edouble\u003c/code\u003e(or any other numeric type), but otherwise have all the characteristics of a \u003ccode\u003edouble\u003c/code\u003e. This would allow a compile-time input validity check for this function:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eForce GetForceNeeded(Mass m, Acceleration a);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eensuring that \u003ccode\u003eGetForceNeeded\u003c/code\u003e can only be called with arguments of type \u003ccode\u003eMass\u003c/code\u003e and \u003ccode\u003eAcceleration\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eOf course, I could achieve this by manually creating a copy of the type:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass Force final\n{\npublic:\n//overload all operators\nprivate:\ndouble value;\n};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut this is cumbersome. Is there a generic solution?\u003c/p\u003e","accepted_answer_id":"27693743","answer_count":"1","comment_count":"13","creation_date":"2014-12-29 17:13:24.967 UTC","last_activity_date":"2014-12-29 18:15:22.24 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"862351","post_type_id":"1","score":"3","tags":"c++|c++11","view_count":"135"} +{"id":"44854786","title":"Why are later stages executed and active, and previous stages still in pending state in a Spark job?","body":"\u003cp\u003eI have Scala code that operates on some Spark RDD's as follows. I am union'ing 2 RDDs, then doing a cartesian operation with another RDD, followed by pairwise operations, reduction, then outputting the results back to HDFS.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eval domesticRDD = getDomesticRDD(...)\nval foreignRDD = getForeignRDD(...)\nval mergedRDD = domesticRDD.union(foreignRDD)\n\nval globalRDD = getGlobalRDD(...)\nval prodRDD = mergedRDD.cartesian(globalRDD)\n .map(t =\u0026gt; doSomeComputation(t._1, t._2))\n .reduceByKey((x, y) =\u0026gt; if (x.score \u0026gt; y.score) x else y)\n .saveAsTextFile('/some/path')\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis job is broken into 4 stages.\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003estage 1 rdd for domesticRDD\u003c/li\u003e\n\u003cli\u003estage 2 rdd for foreignRDD\u003c/li\u003e\n\u003cli\u003estage 3 map operation for doSomethingComputation\u003c/li\u003e\n\u003cli\u003estage 4 saveAsTextFile \u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eHow come when I look at the Spark Application UI, stage 3 is cranking along, while stage 1 and 2 are 0/1 (have not even started)? Stages 1 and 2 are still pending but stage 3 is active. This does not make any sense to me. Could someone please explain why this happens?\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-06-30 21:02:59.383 UTC","last_activity_date":"2017-06-30 21:02:59.383 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2175052","post_type_id":"1","score":"0","tags":"apache-spark|rdd","view_count":"15"} +{"id":"13713154","title":"How do you change text in a textbox AS3?","body":"\u003cp\u003eI have a TextField called \"textbox\". I have this code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etextbox.text = 'hello'; \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethe code is right but its not changing the text when played. The previous text clears but the new text (\u003cstrong\u003ehello\u003c/strong\u003e) doesn't appear.\nI'm guessing its something to do with the properties but i just don't know what.\u003c/p\u003e","answer_count":"2","comment_count":"1","creation_date":"2012-12-04 22:34:13.12 UTC","last_activity_date":"2012-12-08 17:01:16.603 UTC","last_edit_date":"2012-12-05 00:55:11.6 UTC","last_editor_display_name":"","last_editor_user_id":"1457439","owner_display_name":"","owner_user_id":"1830624","post_type_id":"1","score":"2","tags":"actionscript-3|flash|flex|actionscript|textfield","view_count":"3029"} +{"id":"46798705","title":"Is there working example of OAuth2 with WebFlux","body":"\u003cp\u003eI'm trying to add OAuth2 to WebFlux and can't find any working example.\u003c/p\u003e\n\n\u003cp\u003eTo Implement own Authorization Server I use such code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@EnableAuthorizationServer\n@Configuration\npublic class ServerAuth extends AuthorizationServerConfigurerAdapter {\n...\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd my spring boot application stops working because inside \u003cstrong\u003eAuthorizationServerConfigurerAdapter\u003c/strong\u003e class there's usage of \u003cstrong\u003eAuthorizationServerSecurityConfigurer\u003c/strong\u003e which depends of \u003cstrong\u003ejavax.servlet.Filter\u003c/strong\u003e but in the WebFlux application, there're no Servlet filters.\u003c/p\u003e\n\n\u003cp\u003eAlso \u003cstrong\u003eAuthorizationServerEndpointsConfigurer\u003c/strong\u003e expects to be initialized with \u003cstrong\u003eUserDetailsService\u003c/strong\u003e (old non reactive api) not reactive \u003cstrong\u003eUserDetailsRepository\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eIs it possible to use oauth2 in the current WebFlux application if yes could you show the example.\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2017-10-17 20:31:06.39 UTC","last_activity_date":"2017-11-13 18:58:26.167 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"729391","post_type_id":"1","score":"2","tags":"spring-boot|spring-security|spring-security-oauth2|spring-webflux","view_count":"132"} +{"id":"36358798","title":"DOM parsing a document: adding and removing comma based on condition","body":"\u003cp\u003eI am using Python's \u003ca href=\"http://www.clips.ua.ac.be/pages/pattern-web\" rel=\"nofollow\"\u003epattern.web\u003c/a\u003e module to perform some basic web mining tasks. I am trying to extract only first 15 keywords and append each keyword with a comma \u003ccode\u003e\",\"\u003c/code\u003e. So, my resulting file contains a list of keywords that looks like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003escallops, scallop shells, sea scallops, scallop shell, how to cook scallops, scallop shells for sale, frozen scallops, fresh scallops, dry scallops, cooking scallops, baptism shell, scallop recipe, large scallop shells, diver scallops, bay scallops,\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow, I do not want the comma \u003ccode\u003e\",\"\u003c/code\u003e after the 15th/last keyword \u003ccode\u003e\"bay scallops,\"\u003c/code\u003e\nI need a little help to modify my code below so that at the 15th iteration the code doesn't add the comma. If it were a simple for loop iterating an array, I could use \u003ccode\u003eiteritems()\u003c/code\u003e to extract key and value and add an if condition, but here I cannot figure out how to do it. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efrom pattern.web import URL, DOM, plaintext, extension\n\nfolder = '../some_folder'\n\ndom = DOM(content)\nprint \"traversing ... \"\nfor e in dom('td.spgb-f')[:15]:\n for a in e('span.sptc-e'):\n File = open(os.path.join(folder, \"meta_keywords.html\"), mode=\"a\")\n print ('adding %s' %(plaintext(a.content)))\n File.write(plaintext(a.content) + \", \")\n File.close()\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"36359089","answer_count":"3","comment_count":"0","creation_date":"2016-04-01 14:22:37.813 UTC","last_activity_date":"2016-04-01 14:40:03.51 UTC","last_edit_date":"2016-04-01 14:34:52.68 UTC","last_editor_display_name":"","last_editor_user_id":"98057","owner_display_name":"","owner_user_id":"5194792","post_type_id":"1","score":"0","tags":"python","view_count":"36"} +{"id":"47314676","title":"Vim syntax: Spell checking some strings, but not others","body":"\u003cp\u003eThis is a followup to \u003ca href=\"https://stackoverflow.com/questions/47296273/vim-syntax-spell-checking-between-certain-regions\"\u003eVim syntax: Spell checking between certain regions\u003c/a\u003e I'm trying to create a syntax file for this language called Sugar Cube 2. You can find more about it here: \u003ca href=\"http://www.motoslave.net/sugarcube/2/docs/macros.html\" rel=\"nofollow noreferrer\"\u003ehttp://www.motoslave.net/sugarcube/2/docs/macros.html\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThe \u003ca href=\"http://www.motoslave.net/sugarcube/2/docs/macros.html#macros-link\" rel=\"nofollow noreferrer\"\u003elink\u003c/a\u003e has this syntax: \u003ccode\u003e\u0026lt;\u0026lt;link \"linkText\" \"passageName\"\u0026gt;\u0026gt;\u003c/code\u003e e.g.:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;\u0026lt;link \"Onward, Reginald!\" \"ThePassageName\"\u0026gt;\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI would like to spell check that \"Onward, Reginald!\" but not \"ThePassageName\". How do I do that? I tried messing around with lines like this, but I think I'm going in the wrong direction:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esyn region noSpellString start=+\"+ end=+\"+ skip=+\\\\\"+ contains=@NoSpell\nsyn region spellString start=+\"+ end=+\"+ skip=+\\\\\"+ nextgroup=noSpellString\nsyn match linkMacro \"\u0026lt;\u0026lt;link\\s+\" nextgroup=spellString skipwhite skipempty\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-11-15 18:24:19.337 UTC","last_activity_date":"2017-11-16 14:01:47.847 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"61624","post_type_id":"1","score":"0","tags":"vim|vim-syntax-highlighting","view_count":"21"} +{"id":"16311149","title":"Queueing Method Calls So That They Are Performed By A Single Thread In Clojure","body":"\u003cp\u003eI'm building a wrapper around OrientDB in Clojure. One of the biggest limitations (IMHO) of OrientDB is that the \u003ccode\u003eODatabaseDocumentTx\u003c/code\u003e is not thread-safe, and yet the lifetime of this thing from \u003ccode\u003e.open()\u003c/code\u003e to \u003ccode\u003e.close()\u003c/code\u003e is supposed to represent a single transaction, effectively forcing transactions to occur is a single thread. Indeed, thread-local refs to these hybrid database/transaction objects are provided by default. But what if I want to log in the same thread as I want to persist \"real\" state? If I hit an error, the log entries get rolled back too! That use case alone puts me off of virtually all DBMS's since most do not allow named transaction scope management. /soapbox\u003c/p\u003e\n\n\u003cp\u003eAnyways, OrientDB is the way it is, and it's not going to change for me. I'm using Clojure and I want an elegant way to construct a \u003ccode\u003ewith-tx\u003c/code\u003e macro such that all imperative database calls within the \u003ccode\u003ewith-tx\u003c/code\u003e body are serialized.\u003c/p\u003e\n\n\u003cp\u003eObviously, I can brute-force it by creating a sentinel at the top level of the \u003ccode\u003ewith-tx\u003c/code\u003e generated body and deconstructing every form to the lowest level and wrapping them in a synchronized block. That's terrible, and I'm not sure how that would interact with something like \u003ccode\u003epmap\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eI can search the macro body for calls to the \u003ccode\u003eODatabaseDocumentTx\u003c/code\u003e object and wrap those in synchronized blocks.\u003c/p\u003e\n\n\u003cp\u003eI can create some sort of dispatching system with an agent, I guess.\u003c/p\u003e\n\n\u003cp\u003eOr I can subclass ODatabaseDocumentTx with synchronized method calls.\u003c/p\u003e\n\n\u003cp\u003eI'm scratching my head trying to come up with other approaches. Thoughts? In general the agent approach seems more appealing simply because if a block of code has database method calls interspersed, I would rather do all the computation up front, queue the calls, and just fire a whole bunch of stuff to the DB at the end. That assumes, however, that the computation doesn't need to ensure consistency of reads. IDK.\u003c/p\u003e","answer_count":"2","comment_count":"1","creation_date":"2013-05-01 00:41:52.13 UTC","favorite_count":"1","last_activity_date":"2013-05-01 05:15:28.71 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"45051","post_type_id":"1","score":"2","tags":"clojure|parallel-processing|synchronization|orientdb","view_count":"181"} +{"id":"1721277","title":"Textbox using password mode","body":"\u003cp\u003eHi I am using a text box with Password mode. And inserting the value using encryption. After that while updating the information I have to display the text again using password mode. But While assigning the data It is not displaying it in the textbox. How can I overcome this?\u003c/p\u003e","accepted_answer_id":"1721304","answer_count":"2","comment_count":"5","creation_date":"2009-11-12 10:22:01.657 UTC","favorite_count":"1","last_activity_date":"2013-01-07 06:37:17.197 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"182536","post_type_id":"1","score":"3","tags":"c#|asp.net","view_count":"8024"} +{"id":"15358093","title":"how to add 3 legend for a single series barchart?? JAVAFX","body":"\u003cp\u003eHere is my code to generate 10 bars of different colors. I want to add legend respectively but it only shows yellow legend i can change its color but i want 3 legend. \u003c/p\u003e\n\n\u003cp\u003eI think it shows only 1 color because there is only 1 series. Is it possible to add more than 1 legend for a single series?\u003c/p\u003e\n\n\u003cp\u003eoutput:\u003cimg src=\"https://i.stack.imgur.com/fSNu7.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eor if i can add this image as legend to the middle left of my chart\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/cchch.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003ei need how to display image in bar chart or how to create 3 different labels for a single series bar chart\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport javafx.application.Application;\nimport javafx.beans.value.*;\nimport javafx.scene.*;\nimport javafx.scene.chart.*;\nimport javafx.stage.Stage;\n\npublic class DynamicallyColoredBarChart extends Application {\n\n @Override\n public void start(Stage stage) {\n final CategoryAxis xAxis = new CategoryAxis();\n xAxis.setLabel(\"Bars\");\n final NumberAxis yAxis = new NumberAxis();\n yAxis.setLabel(\"Value\");\n\n final BarChart\u0026lt;String, Number\u0026gt; bc = new BarChart\u0026lt;\u0026gt;(xAxis, yAxis);\n bc.setLegendVisible(false);\n\n XYChart.Series series1 = new XYChart.Series();\n\n for (int i = 0; i \u0026lt; 10; i++) {\n // change color of bar if value of i is \u0026gt;5 than red if i\u0026gt;8 than blue\n final XYChart.Data\u0026lt;String, Number\u0026gt; data = new XYChart.Data(\"Value \" + i, i);\n data.nodeProperty().addListener(new ChangeListener\u0026lt;Node\u0026gt;() {\n @Override\n public void changed(ObservableValue\u0026lt;? extends Node\u0026gt; ov, Node oldNode, Node newNode) {\n if (newNode != null) {\n if (data.getYValue().intValue() \u0026gt; 8) {\n newNode.setStyle(\"-fx-bar-fill: navy;\");\n } else if (data.getYValue().intValue() \u0026gt; 5) {\n newNode.setStyle(\"-fx-bar-fill: red;\");\n }\n }\n }\n });\n series1.getData().add(data);\n }\n bc.getData().add(series1);\n stage.setScene(new Scene(bc));\n stage.show();\n }\n\n public static void main(String[] args) {\n launch(args);\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"1","creation_date":"2013-03-12 09:58:45.053 UTC","last_activity_date":"2013-03-13 00:24:25.64 UTC","last_edit_date":"2013-03-12 19:39:27.887 UTC","last_editor_display_name":"","last_editor_user_id":"2058260","owner_display_name":"","owner_user_id":"2058260","post_type_id":"1","score":"0","tags":"css|javafx-2|bar-chart|legend|color-scheme","view_count":"1223"} +{"id":"4849798","title":"Javascript: how to post the whole page?","body":"\u003cp\u003eIs it possible to post the whole html page to the server(assuming that the server can handle it)?\u003c/p\u003e\n\n\u003cp\u003eI'm trying to implement the following setup. The user makes some changes(the user selects some text, and this text is wrapped in \u0026lt;span\u0026gt; tags with some class) to html and submits the page. The server extracts some relevant changes from a page. \nIs this possible? Or I need to design some more complex scheme?\u003c/p\u003e","accepted_answer_id":"4849868","answer_count":"4","comment_count":"0","creation_date":"2011-01-31 10:27:40.17 UTC","favorite_count":"0","last_activity_date":"2011-01-31 10:36:44.677 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"84336","post_type_id":"1","score":"2","tags":"javascript|html|ajax","view_count":"695"} +{"id":"13034930","title":"Storing a reversed string","body":"\u003cp\u003eI Want to store the reversed string a in b without any function.\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003epublic static void main(String args[])\n {\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e BufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n String a=br.readLine();\n String b;\n for(int x=0,y=a.length()-1;x\u0026lt;a.length();x++,y--)\n {\n b.charAt(x)=a.charAt(y);\n }\n\u003c/code\u003e\u003c/pre\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eBut I get this error :\u003c/p\u003e\n\n\u003cblockquote\u003e\n\u003cpre\u003e\u003ccode\u003e b.charAt(x)=a.charAt(y);\n ^\n\u003c/code\u003e\u003c/pre\u003e\n \n \u003cp\u003erequired: variable\u003c/p\u003e\n \n \u003cp\u003efound: value\u003c/p\u003e\n \n \u003cp\u003e1 error\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eCan you explain it and help me fix it ?\u003c/p\u003e","accepted_answer_id":"13035028","answer_count":"5","comment_count":"5","creation_date":"2012-10-23 16:18:00.31 UTC","last_activity_date":"2012-10-23 16:35:59.413 UTC","last_edit_date":"2012-10-23 16:23:35.773 UTC","last_editor_display_name":"","last_editor_user_id":"263525","owner_display_name":"","owner_user_id":"1741811","post_type_id":"1","score":"-4","tags":"java","view_count":"108"} +{"id":"47477829","title":"Wordpress Hide Add to Cart Multiple Categories","body":"\u003cp\u003eI'm trying to remove/hide the add to cart button for around 8 categories. What needs to happen is every product in the 8 categories needs to have the add to cart button hidden/removed.\u003c/p\u003e\n\n\u003cp\u003eI have this code already however only works for one category:\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003efunction themepaint_custom_cart_buttons(){\n $product = get_product();\n if ( has_term( 'cases', 'product_cat') ){\n remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart' );\n remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );\n remove_action( 'woocommerce_simple_add_to_cart', 'woocommerce_simple_add_to_cart', 30 );\n remove_action( 'woocommerce_grouped_add_to_cart', 'woocommerce_grouped_add_to_cart', 30 );\n remove_action( 'woocommerce_variable_add_to_cart', 'woocommerce_variable_add_to_cart', 30 );\n remove_action( 'woocommerce_external_add_to_cart', 'woocommerce_external_add_to_cart', 30 );\n }\n}\nadd_action( 'wp', 'themepaint_custom_cart_buttons' );\u003c/code\u003e\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2017-11-24 17:27:38.59 UTC","last_activity_date":"2017-11-24 17:47:51.667 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"8862501","post_type_id":"1","score":"0","tags":"php|wordpress|function|woocommerce","view_count":"12"} +{"id":"17926804","title":"How to Creatcustom Counters in Hadoop 2.0.3 alpha","body":"\u003cp\u003eI am new to Hadoop.I am trying to write a custom counter in my reducer.I found a example of using custom counters but it was in hadoop 1.x. I dont find any proper solution for counters in hadoop 2.x\n Can anyone help me on this issue..?\nThanks in Advance\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-07-29 14:34:12.937 UTC","last_activity_date":"2013-07-30 02:36:09.953 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1992453","post_type_id":"1","score":"1","tags":"hadoop|hdfs","view_count":"201"} +{"id":"14156997","title":"Iterate through JSON","body":"\u003cp\u003ei'm wondering how i could loop through this json data to get the values inside it with jquery? All i've got is \u003ccode\u003eundefined\u003c/code\u003e. I'm using \u003ccode\u003e$.ajax.get()\u003c/code\u003e to get the file then i'm trying to loop through it to get data inside it. The JSON looks like this...\u003c/p\u003e\n\n\u003cp\u003eThe result from the get is a string!\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e [\n {\n \"category\": \"anti-social-behaviour\", \n \"persistent_id\": \"\", \n \"location_subtype\": \"STATION\", \n \"month\": \"2012-11\", \n \"location\": {\n \"latitude\": \"52.6313999\", \n \"street\": {\n \"id\": 1447707, \n \"name\": \"Leicester\"\n }, \n \"longitude\": \"-1.1252999\"\n }, \n \"context\": \"\", \n \"id\": 18782816, \n \"location_type\": \"BTP\", \n \"outcome_status\": {\n \"category\": \"Under investigation\", \n \"date\": \"2012-11\"\n }\n }\n]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eRegards /Haris!\u003c/p\u003e","accepted_answer_id":"14157050","answer_count":"4","comment_count":"3","creation_date":"2013-01-04 12:13:02.543 UTC","last_activity_date":"2013-01-04 12:27:53.943 UTC","last_edit_date":"2013-01-04 12:18:00.6 UTC","last_editor_display_name":"","last_editor_user_id":"1350017","owner_display_name":"","owner_user_id":"1350017","post_type_id":"1","score":"1","tags":"jquery|json","view_count":"106"} +{"id":"924041","title":"Is there a good way to detect empty results in a Linq-To-Entities query?","body":"\u003cp\u003eThe only way I know of is awkward:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e'check for empty return\nDim count As Integer = (From s In myEntity.employee Where employeeID = myEmployeeIDVariable).Count\n\n'If there is a record, then process\nIf count \u0026gt; 0 Then\n Dim r = (From s In myEntity.employee Where employeeID = myEmployeeIDVariable).First()\n\n . . . do stuff . . .\nEnd If\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"924061","answer_count":"2","comment_count":"0","creation_date":"2009-05-29 01:45:30.043 UTC","last_activity_date":"2009-05-29 08:08:15.28 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"13338","post_type_id":"1","score":"3","tags":".net|vb.net|linq|linq-to-entities","view_count":"8244"} +{"id":"18567561","title":"Custom adapter does not called getVIew","body":"\u003cp\u003eHere is the code of my custom adapter... it doesn't call my get view... returns only white blank page without nothing. I don't know what is the problem. Does anybody can help. Thanks a lot previously! \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public class ProductShopsAdapter extends ArrayAdapter\u0026lt;ProductShop\u0026gt; {\n\n private Context cntx;\n private ArrayList\u0026lt;ProductShop\u0026gt; shopValues;\n ProductShopsHolder holder = null;\n\n\n public ProductShopsAdapter(Context context, int textViewResourceId, ArrayList\u0026lt;ProductShop\u0026gt; stringValues) {\n super(context,textViewResourceId);\n shopValues = stringValues;\n cntx = context;\n }\n\n @Override\n public View getView(int position, View convertView, ViewGroup parent) {\n\n if (convertView == null) {\n holder = new ProductShopsHolder(); \n\n LayoutInflater layoutInflater = (LayoutInflater)cntx.getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n convertView = layoutInflater.inflate(R.layout.shops_list, null);\n\n //Holder Elements initialization\n holder.setShopName((TextView)convertView.findViewById(R.id.shop_name));\n holder.setPrice((TextView)convertView.findViewById(R.id.shop_part_price));\n\n convertView.setTag(holder);\n } else {\n holder = (ProductShopsHolder) convertView.getTag();\n }\n holder.getShopName().setText(getItem(position).getShopName());\n holder.getPrice().setText(getItem(position).getPrice());\n\n return convertView;\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand here is my XML\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;?xml version=\"1.0\" encoding=\"UTF-8\"?\u0026gt;\n\u0026lt;RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:tools=\"http://schemas.android.com/tools\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"match_parent\"\n tools:context=\".ProductShopsActivity\" \u0026gt;\n\n \u0026lt;ListView\n android:id=\"@android:id/list\"\n android:layout_width=\"fill_parent\"\n android:layout_height=\"wrap_content\"\n android:layout_above=\"@+id/footer\"\n android:padding=\"0dp\" \u0026gt;\n \u0026lt;/ListView\u0026gt;\n\n \u0026lt;include\n android:id=\"@+id/footer\"\n android:layout_width=\"fill_parent\"\n android:layout_height=\"wrap_content\"\n android:layout_alignLeft=\"@android:id/list\"\n android:layout_alignParentBottom=\"true\"\n android:layout_alignParentRight=\"true\"\n layout=\"@layout/footer_menu\" /\u0026gt;\n\n\u0026lt;/RelativeLayout\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand single view : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;RelativeLayout \n xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:id=\"@+id/layout_item\"\n android:layout_width=\"fill_parent\"\n android:layout_height=\"wrap_content\"\n android:background=\"#f2f2f2\"\n android:orientation=\"horizontal\"\n android:padding=\"10dp\" \u0026gt;\n\n \u0026lt;TextView\n android:id=\"@+id/shop_name\"\n android:layout_width=\"fill_parent\"\n android:layout_height=\"wrap_content\"\n android:layout_weight=\"1\"\n android:gravity=\"center\"\n android:text=\"Technomarket\"\n android:textSize=\"14sp\" /\u0026gt;\n\n \u0026lt;TextView\n android:id=\"@+id/shop_part_price\"\n android:layout_width=\"fill_parent\"\n android:layout_height=\"wrap_content\"\n android:layout_weight=\"1\"\n android:gravity=\"center\"\n android:text=\"30 лв.\"\n android:textSize=\"18sp\" /\u0026gt;\n\n \u0026lt;TextView\n android:id=\"@+id/details_button\"\n android:layout_width=\"fill_parent\"\n android:layout_height=\"wrap_content\"\n android:layout_weight=\"1\"\n android:drawableRight=\"@drawable/rightarrow\"\n android:gravity=\"center\"\n android:text=\"Детайли\"\n android:textColor=\"#289bd6\"\n android:textSize=\"14sp\" /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003c/p\u003e","accepted_answer_id":"18567844","answer_count":"1","comment_count":"1","creation_date":"2013-09-02 07:16:50.95 UTC","last_activity_date":"2013-09-02 07:33:51.357 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2563355","post_type_id":"1","score":"0","tags":"adapter","view_count":"2763"} +{"id":"9686186","title":"IIS application using application pool identity loses primary token?","body":"\u003cp\u003e(This is a question about a vague problem. I try to present all relevant data, in the hope that someone has helpful information; apologies for the long description.)\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eOur web app\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eWe have a .NET 4 web application running in IIS 7.5 accessing Active Directory and a SQL Server database.\u003c/p\u003e\n\n\u003cp\u003eThis web application is running under a virtual 'app pool identity', by setting the Identity of the application's application pool to \u003ca href=\"http://msdn.microsoft.com/en-us/library/bb386459.aspx\" rel=\"nofollow noreferrer\"\u003eApplicationPoolIdentity\u003c/a\u003e. A concise description of virtual identities can be found in \u003ca href=\"https://stackoverflow.com/a/3680803\"\u003ea StackOverflow answer\u003c/a\u003e, and the blog post to which it refers: an app pool identity is just an additional group which is added to the web application's worker processes which is running as 'network service'. However, \u003ca href=\"http://forums.iis.net/p/1171701/1957045.aspx#1957045\" rel=\"nofollow noreferrer\"\u003eone source\u003c/a\u003e vaguely suggests that \"Network Service and ApplicationPoolIdentity do have differences that IIS.net site documents do not publish.\" So a virtual identity might be more than just an additional group.\u003c/p\u003e\n\n\u003cp\u003eWe chose to use ApplicationPoolIdentity, as opposed to NetworkService, because it became the default in IIS 7.5 (see, e.g., \u003ca href=\"http://msdn.microsoft.com/en-us/library/bb386459.aspx#attributesAndElementsToggle\" rel=\"nofollow noreferrer\"\u003ehere\u003c/a\u003e), and per Microsoft's recommendation: \"This identity allows administrators to specify permissions that pertain only to the identity under which the application pool is running, thereby increasing server security.\" (from \u003ca href=\"http://msdn.microsoft.com/en-us/library/bb386459.aspx#attributesAndElementsToggle\" rel=\"nofollow noreferrer\"\u003eprocessModel Element for add for applicationPools [IIS 7 Settings Schema]\u003c/a\u003e) \"Application Pool Identities are a powerful new isolation feature\" which \"make running IIS applications even more secure and reliable. \" (from \u003ca href=\"http://learn.iis.net/page.aspx/624/application-pool-identities/\" rel=\"nofollow noreferrer\"\u003eIIS.net article \"Application Pool Identities\"\u003c/a\u003e)\u003c/p\u003e\n\n\u003cp\u003eThe application uses Integrated Windows Authentication, but with \u003ca href=\"http://msdn.microsoft.com/en-us/library/72wdk8cc.aspx\" rel=\"nofollow noreferrer\"\u003e\u003ccode\u003e\u0026lt;identity impersonate=\"false\"/\u0026gt;\u003c/code\u003e\u003c/a\u003e, so that not the end user's identity but the virtual app pool identity is used to run our code.\u003c/p\u003e\n\n\u003cp\u003eThis application queries Active Directory using the \u003ca href=\"http://msdn.microsoft.com/en-us/library/system.directoryservices.aspx\" rel=\"nofollow noreferrer\"\u003eSystem.DirectoryServices\u003c/a\u003e classes, i.e., the ADSI API. In most places this is done without specifying an additional username/password or other credentials.\u003c/p\u003e\n\n\u003cp\u003eThis application also connects to a SQL Server database using \u003ccode\u003eIntegrated Security=true\u003c/code\u003e in the connection string. If the database is local, then we see that \u003ccode\u003eIIS APPPOOL\\OurAppPoolName\u003c/code\u003e is used to connect to the database; if the database is remote, then the machine account \u003ccode\u003eOURDOMAIN\\ourwebserver$\u003c/code\u003e is used.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eOur problems\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eWe regularly have issues where a working installation starts to fail in one of the following ways.\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003cp\u003eWhen the database is on a remote system, then the database connection starts to fail: \"Login failed for user 'NT AUTHORITY\\ANONYMOUS LOGON'. Reason: Token-based server access validation failed with an infrastructure error. Check for previous errors.\" The previous error is \"Error: 18456, Severity: 14, State: 11.\" So it seems that now \u003ccode\u003eOURDOMAIN\\ourwebserver$\u003c/code\u003e is not used anymore, but instead anonymous access is attempted. (We have anecdotal evidence that this problem occurred when UAC was switched off, and that it went away after switching on UAC. But note that changing UAC requires a reboot...) A similar problem is reported in \u003ca href=\"http://forums.iis.net/t/1181039.aspx\" rel=\"nofollow noreferrer\"\u003eIIS.net thread \"use ApplicationPoolIdentity to connect to SQL\"\u003c/a\u003e, specifically in \u003ca href=\"http://forums.iis.net/p/1181039/2010748.aspx#2010748\" rel=\"nofollow noreferrer\"\u003eone reply\u003c/a\u003e.\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eActive Directory operations through ADSI (System.DirectoryServices) start to fail with error 0x8000500C (\"Unknown Error\"), 0x80072020 (\"An operations error occurred.\"), or 0x200B (\"The specified directory service attribute or value does not exist\").\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eSigning in to the application from Internet Explorer starts to fail, with HTTP 401 errors. But if in IIS we then put NTLM before Negotiate then it works again. (Note that access to AD is needed for Kerberos but not for NTLM.) A similar problem is reported in \u003ca href=\"http://forums.iis.net/t/1171701.aspx\" rel=\"nofollow noreferrer\"\u003eIIS.net thread \"Window Authentication Failing with AppPool Identity\"\u003c/a\u003e.\u003c/p\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003e\u003cstrong\u003eOur hypothesis and workaround\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eAt least the AD and sign-in problems always seem to go away when switching the application pool from ApplicationPoolIdentity to NetworkService. (We found \u003ca href=\"http://forums.iis.net/p/1181039/2010748.aspx#2010748\" rel=\"nofollow noreferrer\"\u003eone report\u003c/a\u003e confirming this.)\u003c/p\u003e\n\n\u003cp\u003ePage \u003ca href=\"http://msdn.microsoft.com/en-us/library/ms180891.aspx\" rel=\"nofollow noreferrer\"\u003e\"Troubleshooting Authentication Problems on ASP Pages\"\u003c/a\u003e has some suggestions related to primary vs. secondary tokens, and what I find encouraging is that it links the first two of our errors: it mentions \u003ccode\u003eNT AUTHORITY\\ANONYMOUS LOGON\u003c/code\u003e access, and AD errors 0x8000500C and \"The specified directory service attribute or value does not exist\".\u003c/p\u003e\n\n\u003cp\u003e(The same page also mentions ADSI schema cache problems, but everything we can find on that topic is old. For now we consider this to be unrelated.)\u003c/p\u003e\n\n\u003cp\u003eBased on the above, our current working \u003cem\u003ehypothesis\u003c/em\u003e is that, only when running under a virtual app pool identity, \u003cem\u003eour web application (IIS? worker process?) suddenly loses its primary token\u003c/em\u003e, so that IIS only has a secondary token, so that all access to Active Directory and SQL Server is done anonymously, leading to all of the above errors.\u003c/p\u003e\n\n\u003cp\u003eFor now we intend to switch from ApplicationPoolIdentity to NetworkService. Hopefully this makes all of the above problems go away. But we are not sure; and we would like to switch back if possible.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eOur question\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eIs the above hypothesis correct, and if so, is this a bug in IIS/Windows/.NET? Under which circumstances does this primary token loss occur?\u003c/p\u003e","accepted_answer_id":"9801425","answer_count":"3","comment_count":"2","creation_date":"2012-03-13 14:36:37.687 UTC","favorite_count":"23","last_activity_date":"2016-06-03 15:55:44.1 UTC","last_edit_date":"2017-05-23 12:31:52.607 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"223837","post_type_id":"1","score":"59","tags":"asp.net|active-directory|iis-7.5|adsi|applicationpoolidentity","view_count":"47557"} +{"id":"7333919","title":"How to Reload a frame via Proxy?","body":"\u003cp\u003eI'm trying to create a simple framed page that reloads each x seconds and each frame and each time it reloads it has to use a different proxy from a list that I have.\nThe list is formatted like this:\nIP:PORT\nAny idea or solution?\nActually what I'm using is a simple solution with meta refresh.\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003e\u0026lt;meta http-equiv=\"refresh\" content=\"600\"\u0026gt;\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003ebut I don't really know how to integrate the list...maybe php or javascript?\u003c/p\u003e\n\n\u003cp\u003e... I Forgot to say.... I'm almost a newbie in Js and stuff like this :-) So please be kind with me!\u003c/p\u003e","accepted_answer_id":"7334685","answer_count":"2","comment_count":"2","creation_date":"2011-09-07 12:30:26.473 UTC","favorite_count":"1","last_activity_date":"2012-06-30 15:38:24.237 UTC","last_edit_date":"2012-06-30 15:38:24.237 UTC","last_editor_display_name":"","last_editor_user_id":"210916","owner_display_name":"","owner_user_id":"267658","post_type_id":"1","score":"0","tags":"php|javascript|proxy|meta-tags|reload","view_count":"334"} +{"id":"3451071","title":"JBoss Monitoring with Cacti","body":"\u003cp\u003eIf there is anyone out there who has experience with monitoring JBoss with Cacti, I need help! \u003c/p\u003e\n\n\u003cp\u003eI used \u003ca href=\"http://forums.cacti.net/viewtopic.php?t=16322\u0026amp;highlight=jboss\" rel=\"nofollow noreferrer\"\u003ethis\u003c/a\u003e template posted on the Cacti forums. It has 3 template graphs, and 2 of those graphs are working really well.\u003c/p\u003e\n\n\u003cp\u003eFor some reason though, the third graph (Transaction Manager) isn't working. I'm get 0's for all the values. I got 0's again when I tried using snmpget command (from the Net-SNMP tool) using the oid's of the transaction attriubtes (.1.2.3.4.5.1. 6,7,8). What might be causing this?\u003c/p\u003e\n\n\u003cp\u003eI also need to monitor some attributes that aren't in the template. One example is Connection Count. I decided to copy the template exactly and only change the oid to get the attribute I want from JBoss. This didn't work as I get -1 for all the values in my graph. Is there anything I need to do on the JBoss side to get these attributes to graph? \u003c/p\u003e\n\n\u003cp\u003eAny help is appreciated as I really really need to get these graphs working soon. \u003c/p\u003e\n\n\u003cp\u003eThanks in advance!\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2010-08-10 16:14:37.067 UTC","last_activity_date":"2015-06-25 14:40:13.037 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"70398","post_type_id":"1","score":"2","tags":"jboss|attributes|monitoring|snmp|cacti","view_count":"1430"} +{"id":"35076390","title":"How to make a do statement restart?","body":"\u003cp\u003eI really do not know to how explain this but here we go.\u003c/p\u003e\n\n\u003cp\u003eI am testing something for a bigger program I have to make. In the program I have to validate input from the user to see if it is being to be accepted as a valid answer. \u003c/p\u003e\n\n\u003cp\u003eI have the code to where it will say if the input is invalid but if I attempted to enter another letter the code crashes with this error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eEnter a letter:\nf\nYour answer is not valid.\nA\nEnter a letter:\nException in thread \"main\" java.lang.StringIndexOutOfBoundsException: String index out of range: 0\n at java.lang.String.charAt(String.java:695)\n at example.main(example.java:18)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is the code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport java.util.Scanner;\n\npublic class example\n{\n public static void main(String[] args)\n {\n Scanner input = new Scanner(System.in);\n\n\n boolean UserInput;\n\n do\n {\n char user_answer = 0;\n\n\n System.out.println(\"Enter a letter:\");\n user_answer=input.nextLine().charAt(0);\n\n if ( user_answer == 'A')\n {\n\n UserInput = true;\n }\n else if (user_answer == 'B')\n {\n\n UserInput = true;\n }\n else if (user_answer == 'C')\n {\n\n UserInput = true;\n }\n else if (user_answer == 'D')\n {\n\n UserInput = true;\n }\n else\n {\n System.out.println(\"Your answer is not valid.\");\n UserInput = false;\n input.next();\n }\n\n\n }\n\n while (!UserInput);\n\n\n }\n\n} \n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"35076496","answer_count":"3","comment_count":"0","creation_date":"2016-01-29 03:30:21.387 UTC","last_activity_date":"2016-01-29 06:18:43.683 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5618607","post_type_id":"1","score":"1","tags":"java|validation","view_count":"46"} +{"id":"32997763","title":"UINavigationBar and UITabBar Appearance proxies weird result","body":"\u003cp\u003eWhen I use the below code from a singleton, UITabBar appearance is not working completely (not changing at all), and UINavigationBar appearance is changing arbitrarily, not according to switch cases.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#pragma mark - UITabBarController Delegate\n\n- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController\n{\n NSLog(@\"switch\");\n switch ([tabBarController.viewControllers indexOfObject:viewController])\n {\n case 0:\n [[UINavigationBar appearance] setBackgroundImage:[UIColor imageWithColor:[AppConfiguration color3]] forBarMetrics:UIBarMetricsDefault];\n [[UITabBar appearance] setBarTintColor:[AppConfiguration color3]];\n break;\n case 1:\n [[UINavigationBar appearance] setBackgroundImage:[UIColor imageWithColor:[AppConfiguration color4]] forBarMetrics:UIBarMetricsDefault];\n [[UITabBar appearance] setBarTintColor:[AppConfiguration color4]];\n break;\n case 2:\n [[UINavigationBar appearance] setBackgroundImage:[UIColor imageWithColor:[AppConfiguration color5]] forBarMetrics:UIBarMetricsDefault];\n [[UITabBar appearance] setBarTintColor:[AppConfiguration color5]];\n break;\n\n default:\n NSLog(@\"UITabBar index: %lu\", (unsigned long)[tabBarController.viewControllers indexOfObject:viewController]);\n break;\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"5","creation_date":"2015-10-07 16:35:48.817 UTC","last_activity_date":"2015-10-07 16:35:48.817 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1139419","post_type_id":"1","score":"0","tags":"ios|uinavigationbar|uitabbar|uiappearance","view_count":"65"} +{"id":"4584798","title":"Dojo js toolkit: Problem with dynamically filled select","body":"\u003cp\u003eI'm having some issues with dijit.form.Select items. \u003c/p\u003e\n\n\u003cp\u003eIn a page i have two of these items: one is filled while the html page is being loaded and the other one is filled depending on which option the user has selected on the first one. \u003c/p\u003e\n\n\u003cp\u003eHere's an example of what I'm talking about (now I'm keeping the code simple, but in the real version I've included all the necessary dojo modules and libraries in the head section): \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;html\u0026gt; \n \u0026lt;head\u0026gt; \n \u0026lt;script type=\"text/javascript\"\u0026gt; \n function updateB(val){ \n\n var menu = dojo.byId(\"selB\"); \n\n menu.options.lenght=0; \n\n if(val==\"aaa\") \n menu.addOption({value: \"aa\", label: \"aa\"}); \n else \n menu.addOption({value: \"bb\", label: \"bb\"}); \n } \n \u0026lt;/script\u0026gt; \n \u0026lt;/head\u0026gt; \n\n \u0026lt;body\u0026gt; \n \u0026lt;select id=\"selA\" name=\"selA\" dojoType=\"dijit.form.Select\" style=\"width: 180px;\" onchange=\"updateB(this.get('value'));\"\u0026gt;\u0026lt;/select\u0026gt; \n\n \u0026lt;select id=\"selB\" name=\"selB\" dojoType=\"dijit.form.Select\" style=\"width: 180px; \"\u0026gt;\u0026lt;/select\u0026gt; \n\n \u0026lt;script type=\"text/javascript\"\u0026gt; \n var menu = dojo.byId(\"selA\"); \n\n menu.addOption({value: \"aaa\", label: \"aaa\"},{value: \"bbb\", label: \"bbb\"}); \n\n \u0026lt;/script\u0026gt; \n\n \u0026lt;/body\u0026gt; \n\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I load the page in my browser, menu selA contains the options aaa and bbb. But selB, whenether I select aaa or bbb in selA remains empty. In javascript error console i can read: dojo.byId [undefined] is not a function. I've spent a lot of time trying to make this work (tryied a lot of alternatives) but had no luck. I can only manage to fill dojo select on onload events, not on onchange (associated with another select) or onclick (associated to a button). With standard HTML select items everything works ok instead. \nWhat can I do in order to fix this issue? \u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","accepted_answer_id":"4585107","answer_count":"1","comment_count":"0","creation_date":"2011-01-03 13:23:49.317 UTC","last_activity_date":"2011-01-04 04:35:49.403 UTC","last_edit_date":"2011-01-04 04:35:49.403 UTC","last_editor_display_name":"","last_editor_user_id":"26394","owner_display_name":"","owner_user_id":"561275","post_type_id":"1","score":"0","tags":"javascript|html|select|dynamic|dojo","view_count":"3190"} +{"id":"45584524","title":"Incrementing char value (more than one letter)","body":"\u003cp\u003eI am confronted with the following code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eint get_config(const char *key, char *value) {\n\nFILE *fp = NULL;\nchar s[100];\nchar *ret1 = NULL;\nchar *ret2 = NULL;\n\nfp = fopen(CONFIG_FILE_PATH, \"r\");\n\nif (fp == NULL) {\n perror(CONFIG_FILE_PATH);\n return FALSE;\n}\n\nwhile (fgets(s, 100, fp) != NULL) {\n //printf(\"line=%s\", s);\n ret1 = strstr(s, key);\n if (ret1 != NULL) {\n\n ret1 = strstr(s, \"=\");\n if (ret1 != NULL) {\n ret1++;\n ret2 = strstr(s, \"\\n\");\n\n strncpy(value, ret1, ret2 - ret1);\n //printf(\"ret1=%p ret2=%p\\n\", ret1,ret2);\n value[ret2 - ret1] = 0x0;\n\n printf(\"config key=%s value=%s\\n\", key, value);\n\n fclose(fp);\n fp = NULL;\n ret1 = NULL;\n ret2 = NULL;\n\n return TRUE;\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI struggle to understand what \u003ccode\u003eret1++\u003c/code\u003e does. If I understood the \u003ccode\u003estrstr()\u003c/code\u003e correctly, after \u003ccode\u003eret1 = strstr(s, \"=\");\u003c/code\u003e ret1 will contain all everything following the = sign within s.\u003c/p\u003e\n\n\u003cp\u003eLets assume this not a number, but a word \"value\", resulting in \u003ccode\u003eret1 = value\u003c/code\u003e What does this mean for \u003ccode\u003eret1++\u003c/code\u003e?\nMaybe my assumption of the CONFIG_FILE_PATH is wrong, and a number always follows the equal sign.\u003c/p\u003e\n\n\u003cp\u003eSidenote:\n\u003cem\u003eI just wished, I knew what CONFIG_FILE_PATH looks like. But as \u003ccode\u003e#define CONFIG_FILE_PATH \"/etc/config/duvs.conf\"\u003c/code\u003e But this path is probably located on the device, this program is written for... :/\u003c/em\u003e\u003c/p\u003e","answer_count":"2","comment_count":"2","creation_date":"2017-08-09 07:44:13.503 UTC","last_activity_date":"2017-08-09 09:33:49.87 UTC","last_edit_date":"2017-08-09 09:33:49.87 UTC","last_editor_display_name":"","last_editor_user_id":"8432379","owner_display_name":"","owner_user_id":"3554329","post_type_id":"1","score":"0","tags":"c++|string|char|increment|strstr","view_count":"35"} +{"id":"27840157","title":"PHP SQL Check Referential Integrity for whole DB","body":"\u003cp\u003eI was wondering if there was an option to check the referntial integrity of my database without checking everything manually. I must mention that I'm completely new to SQL and have the task to check the referential integrity. \u003c/p\u003e\n\n\u003cp\u003eWith the search I found this question:\n\u003ca href=\"https://stackoverflow.com/questions/10921144/how-to-find-records-that-violate-referential-integrity\"\u003ehow to find records that violate referential integrity\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003ewhich was already helpful, but I got quite a lot of tables and I was wondering if there was a faster way than writting hundreds of the querys in the format of the question I found.\u003c/p\u003e\n\n\u003cp\u003eThanks for helping,\nYíu\u003c/p\u003e\n\n\u003cp\u003eEDIT:\nI know that most databases check that automatically, but I'm a student and the task says \n\"These scripts should illustrate updating and referential integrity of your database.\n! Please point explicitly where you check referential integrity (adding rows, modifying rows, deleting rows). \"\u003c/p\u003e\n\n\u003cp\u003eSo I guess I have to check it manually.\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2015-01-08 12:27:59.207 UTC","favorite_count":"1","last_activity_date":"2015-01-08 13:08:19.45 UTC","last_edit_date":"2017-05-23 11:43:30.31 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"4241871","post_type_id":"1","score":"1","tags":"mysql|foreign-keys|referential-integrity|generic-foreign-key","view_count":"163"} +{"id":"25876317","title":"How to resolve a conflict between bootstrap.js and angularjs for angular lists","body":"\u003cp\u003eThis is my html code \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"form-group\"\u0026gt;\n\n \u0026lt;select ng-model=\"modSelectedState\" id=\"selectState\" name=\"selectState\"\n ng-options=\"state as state.full_name for state in states\"\u0026gt;\n \u0026lt;option value=\"\"\u0026gt;Select State...\u0026lt;/option\u0026gt; \u0026lt;/select\u0026gt;\n \u0026lt;/div\u0026gt;\u0026lt;!-- /.form-group --\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt renders as expected until i add this line to my code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;script type=\"text/javascript\" src=\"scripts/bootstrap/js/bootstrap.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAt which point all i see when i render the page is the default option (\"select state\"). When I remove bootstrap.js everything renders as expected - that is I see the list of all states.\u003c/p\u003e\n\n\u003cp\u003eThis is how I load the code in the controller \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e $http.get('./data/states.js').success(function (data) {\n $scope.states = data.locations;\n });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003estates.js is stored locally. \u003c/p\u003e\n\n\u003cp\u003eI have some other angular elements on the page and they all work fine. I also tried to play with the loading order (i.e. load bootstrap before angular and vice versa) but the result is the same - the list renders fine without bootstrap and it doesn't render with bootstrap. \u003c/p\u003e\n\n\u003cp\u003eIs there any known conflict between those two libraries when it comes to binding lists? Is there any known workaround? \u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2014-09-16 18:50:27.85 UTC","last_activity_date":"2014-09-17 02:10:48.693 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1106499","post_type_id":"1","score":"0","tags":"javascript|css|angularjs|twitter-bootstrap","view_count":"1669"} +{"id":"47352728","title":"Is it possible to use client side libraries (google.visualization) on server side?","body":"\u003cp\u003eIs it possible to call google.visualization or to get the result of work HtmlService without client side?\u003c/p\u003e\n\n\u003cp\u003eFor example:\nI would like to obtain the result of chart.getImageURI() ( data:image/png;base64) and insert this picture in the spreadsheet when it will be open?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-11-17 14:18:28.493 UTC","last_activity_date":"2017-11-17 21:46:58.387 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1942083","post_type_id":"1","score":"0","tags":"google-apps-script|google-spreadsheet","view_count":"24"} +{"id":"38759733","title":"c#.net code for retrive data from dataset or datatable object","body":"\u003cp\u003eI have created a class file. In that class file, i have created a method name as getdata of type dataset or datatable. This method is to retrieve/fetch data from database and return dataset or datatable object. \u003c/p\u003e\n\n\u003cp\u003eI want to display data from dataset or datatable object using combobox event into textboxes. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate void comboBox1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)\n{\n try\n {\n DataOperation DO = new DataOperation();\n //DataSet DS = new DataSet(); \n // DS = DO.GetCompnyDetails(Convert.ToInt32(CmBxCompanyName.Text), \n \"SelectById\"); \n\n //txtCompanyId.Text = DS.Tables[0].Rows[0[\"c_id\"].ToString();\n //txt_mno.Text = DS.Tables[0].Rows[0][\"cont_no\"].ToString();\n //txt_add.Text = DS.Tables[0].Rows[0][\"address\"].ToString();\n //txt_vno.Text = DS.Tables[0].Rows[0][\"vat_no\"].ToString();\n //txtCstNo.Text = DS.Tables[0].Rows[0][\"CSTNo\"].ToString();\n //txt_eid.Text = DS.Tables[0].Rows[0][\"e_id\"].ToString();\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003chr\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate void comboBox1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)\n{ \n try\n {\n DataOperation DO = new DataOperation();\n DataTable Dt;\n Dt = DO.GetPymntDetails(Convert.ToInt32(CmBxCompanyName.Selected Index), \"SelectById\");\n\n if (Dt != null)\n {\n txtCompanyId.Text = Dt.Rows[0].ItemArray[0].ToString();\n txt_mno.Text = Dt.Rows[0].ItemArray[1].ToString();\n txt_add.Text = Dt.Rows[0].ItemArray[2].ToString();\n txt_vno.Text = Dt.Rows[0].ItemArray[3].ToString();\n txtCstNo.Text = Dt.Rows[0].ItemArray[4].ToString();\n txt_eid.Text = Dt.Rows[0].ItemArray[5].ToString();\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"4","creation_date":"2016-08-04 06:14:07.293 UTC","last_activity_date":"2016-08-04 07:02:48.517 UTC","last_edit_date":"2016-08-04 06:15:45.433 UTC","last_editor_display_name":"","last_editor_user_id":"6400526","owner_display_name":"","owner_user_id":"3600878","post_type_id":"1","score":"0","tags":"c#|windows","view_count":"65"} +{"id":"15355401","title":"primefaces dataTable selection Object type","body":"\u003cpre\u003e\u003ccode\u003e@ManagedBean(name = \"menuCtrl\")\n@ApplicationScoped\npublic class MenuControleur extends AbstractControleur implements Serializable {\n\nprivate static final Logger log = Logger.getLogger(ApplicationControleur.class);\n\nprivate PanierBeans[] selectedRep;\n\npublic PanierBeans[] getSelectedRep() {\n return selectedRep;\n}\n\npublic void setSelectedRep(PanierBeans[] selectedRep) {\n this.selectedRep = selectedRep;\n}\n\n// cache\nprivate List\u0026lt;Spectacle\u0026gt; spectacles;\nprivate List\u0026lt;Representation\u0026gt; representations;\nprivate Spectacle specSelec = new Spectacle();\n\n\nprivate List\u0026lt;Artiste\u0026gt; artistes;\nprivate List\u0026lt;Representation\u0026gt; representationsFiltrees;\nprivate List lignesSelec;\n\npublic List getLignesSelec() {\n return lignesSelec;\n}\n\npublic void setLignesSelec(List lignesSelec) {\n this.lignesSelec = lignesSelec;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand in the facelet i have this table\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;p:dataTable id=\"dataTable\" var=\"rep\" value=\"#{menuCtrl.specSelec.representations}\" widgetVar=\"representationsTable\" \n emptyMessage=\"Pas de représentation trouvée avec les criteres précisés\" filteredValue=\"#{menuCtrl.representationsFiltrees}\" paginator=\"true\" rows=\"10\"\n style=\"background: none\" \u0026gt; \n\n \u0026lt;f:facet name=\"header\"\u0026gt; \n \u0026lt;p:outputPanel\u0026gt; \n \u0026lt;h:outputText value=\"Search all fields:\" /\u0026gt; \n \u0026lt;p:inputText id=\"globalFilter\" onkeyup=\"representationsTable.filter()\" style=\"width:150px\" /\u0026gt; \n \u0026lt;/p:outputPanel\u0026gt; \n \u0026lt;/f:facet\u0026gt; \n\n\n \u0026lt;p:column id=\"photoArtiste\" headerText=\"Artiste\" \u0026gt; \n \u0026lt;ui:param name=\"imgPath\" value=\"images:#{menuCtrl.specSelec.artiste.lienPhoto}.png\" /\u0026gt;\n \u0026lt;p:graphicImage value=\"#{resource[imgPath]}\" /\u0026gt; \n \u0026lt;/p:column\u0026gt;\n\n \u0026lt;p:column id=\"nomArtiste\" filterBy=\"#{rep}\" \n headerText=\"Artiste\" \n filterMatchMode=\"contains\"\u0026gt; \n \u0026lt;h:outputText value=\"#{menuCtrl.specSelec.artiste.nom}\" /\u0026gt; \n \u0026lt;/p:column\u0026gt;\n \u0026lt;p:column id=\"nomSpectacle\" filterBy=\"#{rep}\" \n headerText=\"Spectacle\" \n filterMatchMode=\"contains\"\u0026gt; \n \u0026lt;h:outputText value=\"#{menuCtrl.specSelec.nomSpectacle}\" /\u0026gt; \n \u0026lt;/p:column\u0026gt;\n\n \u0026lt;p:column id=\"addColumn\" filterBy=\"#{rep.adresse}\" \n headerText=\"Ville\" footerText=\"contains\" \n filterMatchMode=\"contains\"\u0026gt; \n \u0026lt;h:outputText value=\"#{rep.salle.adresseSalle}\" /\u0026gt; \n \u0026lt;/p:column\u0026gt;\n\n \u0026lt;p:column id=\"dateDebutColumn\" headerText=\"Date\" footerText=\"startsWith\"\u0026gt;\n\n \u0026lt;h:outputText value=\"#{rep.dateDebut}\" \n id=\"popupDate\"\u0026gt; \n \u0026lt;f:convertDateTime pattern=\"d/M/yyyy\" /\u0026gt; \n \u0026lt;/h:outputText\u0026gt;\n\n\n \u0026lt;/p:column\u0026gt; \n \u0026lt;p:column id=\"dispColumn\" \n headerText=\"Disponibilité\"\u0026gt; \n \u0026lt;p:inputText id=\"champDisBillets\" value=\"100\" size=\"5\" readonly=\"true\" /\u0026gt;\n \u0026lt;/p:column\u0026gt;\n \u0026lt;p:column id=\"qteBillets\" \n headerText=\"Qte Billets\"\u0026gt; \n \u0026lt;p:selectOneMenu value=\"#{buttonBean.number}\"\u0026gt; \n \u0026lt;f:selectItem itemLabel=\"1\" itemValue=\"1\" /\u0026gt; \n \u0026lt;f:selectItem itemLabel=\"2\" itemValue=\"2\" /\u0026gt; \n \u0026lt;f:selectItem itemLabel=\"3\" itemValue=\"3\" /\u0026gt;\n \u0026lt;f:selectItem itemLabel=\"4\" itemValue=\"4\" /\u0026gt; \n \u0026lt;f:selectItem itemLabel=\"5\" itemValue=\"5\" /\u0026gt; \n \u0026lt;f:selectItem itemLabel=\"6\" itemValue=\"6\" /\u0026gt;\n \u0026lt;/p:selectOneMenu\u0026gt; \n \u0026lt;/p:column\u0026gt; \n \u0026lt;p:calendar value=\"#{calendarBean.date2}\" id=\"popupCal\" /\u0026gt; \n\n \u0026lt;p:column id=\"priceColumn\" filterBy=\"#{rep}\" \n headerText=\"Prix\" footerText=\"contains\" \n filterMatchMode=\"contains\"\u0026gt; \n\n \u0026lt;p:inputText id=\"prixBillets\" value=\"#{rep.prix}\" readonly=\"true\" size=\"5\"/\u0026gt; \n \u0026lt;/p:column\u0026gt;\n \u0026lt;/p:dataTable\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003enom i want to add checkboxes but in that case i would have to add a selection attributes that point to one of the managed bean attributes, thing is the rows are populated with differents inds of objects so what type o object should in selection ?\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2013-03-12 07:17:55.777 UTC","last_activity_date":"2013-03-12 07:17:55.777 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2133558","post_type_id":"1","score":"1","tags":"java|jsf|primefaces|managed-bean","view_count":"569"} +{"id":"41205828","title":"how to fire loadmore after fetching and showing every 100 records from realm","body":"\u003cp\u003eRealm recyclerview in following address: \u003ca href=\"https://github.com/thorbenprimke/realm-recyclerview\" rel=\"nofollow noreferrer\"\u003erealmrecyclerview\u003c/a\u003e has the loadmore feature and there is a example project which creates a 60 realm object then query realm and set the results of the query to recyclerview's adapter. after scrolling the recyclerview to end onloadmore listner get fired in loadmore function another async method get called which creates 60 more object and save to realm, then recyclerview shows the new objects.\nI want to use this loadmore functionality to paginate the big dataset query.I tried to query in the onloadmore function but the adapter did not refereshed with new query results. but when I recreated the adapter and set to recyclerview it was working.\u003c/p\u003e","answer_count":"1","comment_count":"6","creation_date":"2016-12-18 05:42:26.72 UTC","last_activity_date":"2016-12-19 02:47:22.733 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3162690","post_type_id":"1","score":"0","tags":"android|android-recyclerview|realm","view_count":"240"} +{"id":"163881","title":"WPF Alternative for python","body":"\u003cp\u003eIs there any alternative for WPF (windows presentation foundation) in python? \u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://msdn.microsoft.com/en-us/library/aa970268.aspx#Programming_with_WPF\" rel=\"nofollow noreferrer\"\u003ehttp://msdn.microsoft.com/en-us/library/aa970268.aspx#Programming_with_WPF\u003c/a\u003e \u003c/p\u003e","accepted_answer_id":"163905","answer_count":"4","comment_count":"1","creation_date":"2008-10-02 18:35:16.207 UTC","last_activity_date":"2008-10-02 18:47:36.647 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"23609","post_type_id":"1","score":"4","tags":"python|user-interface","view_count":"10548"} +{"id":"6023768","title":"Common layouts, different resources","body":"\u003cp\u003eI need your suggestion for my application. I have written an application two month ago, and now have been asked to write similar application. I've got an idea to change only resources. I'd like to change my application to use different resources but common layouts.\u003c/p\u003e\n\n\u003cp\u003eHave you any ideas how to use different resources without replaceing them and renaming as thay are used in application.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2011-05-16 21:39:39.07 UTC","favorite_count":"1","last_activity_date":"2012-02-04 10:57:57.49 UTC","last_edit_date":"2012-02-04 10:57:57.49 UTC","last_editor_display_name":"","last_editor_user_id":"958370","owner_display_name":"","owner_user_id":"717177","post_type_id":"1","score":"1","tags":"android|android-resources","view_count":"167"} +{"id":"33170756","title":"How do I create a interval of 7 days without 'w','week' or 'WeekOfYear'?","body":"\u003cp\u003eI am trying to sort data by the week it was created. I can not use \u003ccode\u003e'w'\u003c/code\u003e in \u003ccode\u003eDateAdd\u003c/code\u003e, \u003ccode\u003e'week'\u003c/code\u003e or \u003ccode\u003e'WeekOfYear'\u003c/code\u003e without an error stating that function/expression is inaccessible. \u003c/p\u003e\n\n\u003cp\u003eWhat is the best way to create a substitute expression? I want the expression to group the dates based on the week it was created. \u003c/p\u003e\n\n\u003cp\u003eI am trying to replicate this:\n\u003ca href=\"http://imgur.com/Pk8YjUv\" rel=\"nofollow\"\u003ehttp://imgur.com/Pk8YjUv\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"33173076","answer_count":"1","comment_count":"4","creation_date":"2015-10-16 12:40:31.31 UTC","last_activity_date":"2015-10-18 14:30:10.85 UTC","last_edit_date":"2015-10-18 14:30:10.85 UTC","last_editor_display_name":"","last_editor_user_id":"3653989","owner_display_name":"","owner_user_id":"5451449","post_type_id":"1","score":"0","tags":"sql-server-2008|date|reporting-services|parameters|bids","view_count":"60"} +{"id":"41660420","title":"How to use jni.h for Android?","body":"\u003cp\u003eI want to call Java codes included \u003ccode\u003eAndroid SDK\u003c/code\u003e classes from C++. I can call pure Java codes from C++ for \u003ccode\u003edesktop console application\u003c/code\u003e. But I cannot call Java codes included \u003ccode\u003eAndroid SDK\u003c/code\u003e classes from C++ for Android (I get this error: \u003ccode\u003eJNI_CreateJavaVM was not declared in this scope.\u003c/code\u003e). I want an example for \u003ccode\u003eJava Native Interface\u003c/code\u003e for Android. Have you got examples about JNI for Android? Also, I found JNI examples and codes for desktop only, no Android.\nAlso I found different \u003ccode\u003ejni.h\u003c/code\u003e and \u003ccode\u003elibjvm.so\u003c/code\u003e files positions:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ejni.h Directories: ------------------------------------\n\n/usr/lib/jvm/java-8-oracle/include/jni.h\nAndroid/Sdk/ndk-bundle/platforms/android-*/arch-arm/usr/include/jni.h\nandroid-studio/jre/include/jni.h\n\nlibjvm.so Directories: --------------------------------\n\n/home/username/android-studio/jre/jre/lib/amd64/server/libjvm.so\n/usr/lib/jvm/java-8-oracle/jre/lib/amd64/server/libjvm.so\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-01-15 11:08:38.93 UTC","last_activity_date":"2017-01-16 10:45:38.713 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5106997","post_type_id":"1","score":"2","tags":"java|android|c++|android-ndk|jni","view_count":"272"} +{"id":"13557008","title":"How to make three JSF h:selectOneMenus that depend on each other","body":"\u003cp\u003eI hope someone can help me. This is a \"Category-Type-Item\" situation where the user has to select from three different drop-down lists. In JSF I made it with three \u003ccode\u003eh:selectoneMenu\u003c/code\u003e. The first two \u003ccode\u003eh:selectOneMenu\u003c/code\u003e work OK. I read a solution \u003ca href=\"https://stackoverflow.com/questions/7556245/jsf-2-0-malformedxml-when-using-ajax-on-a-commandlink\"\u003ehere\u003c/a\u003e, about a \"malformedXML\" error when I tried the first time. That's the reason each selectOneMenu is surrounded by a \u003ccode\u003eh:panelGorup\u003c/code\u003e. I implemented it and work partially and only after reload (F5) the page, but this is not an acceptable solution.\u003c/p\u003e\n\n\u003cp\u003eHere is the code that I'm implementing:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;p:panel rendered=\"#{temporadaControllerExt.noHayGrupos}\" \n style=\"width: 650px\"\u0026gt;\n\n \u0026lt;h:panelGrid columns=\"3\"\u0026gt;\n \u0026lt;h:panelGroup id=\"fases\"\u0026gt;\n \u0026lt;h:outputLabel value=\"Fase: \"/\u0026gt;\n \u0026lt;h:selectOneMenu value=\"#{temporadaControllerExt.faseSelectedFinal}\"\u0026gt;\n \u0026lt;f:selectItems value=\"#{temporadaControllerExt.fases}\"/\u0026gt;\n \u0026lt;f:ajax render=\"grupos\"/\u0026gt;\n \u0026lt;/h:selectOneMenu\u0026gt;\n \u0026lt;/h:panelGroup\u0026gt;\n\n \u0026lt;h:panelGroup id=\"grupos\"\u0026gt;\n \u0026lt;h:outputLabel value=\"Grupo: \"/\u0026gt;\n \u0026lt;h:selectOneMenu value=\"#{temporadaControllerExt.grupoSelected}\" \n disabled=\"#{temporadaControllerExt.grupoListDisable}\"\u0026gt;\n \u0026lt;f:selectItems value=\"#{temporadaControllerExt.gruposDefase}\"/\u0026gt;\n \u0026lt;f:ajax render=\"jornadas\"/\u0026gt;\n \u0026lt;/h:selectOneMenu\u0026gt;\n \u0026lt;/h:panelGroup\u0026gt;\n\n \u0026lt;h:panelGroup id=\"jornadas\"\u0026gt;\n \u0026lt;h:outputLabel value=\"Jornada: \"/\u0026gt;\n \u0026lt;h:selectOneMenu value=\"#{temporadaControllerExt.jornadaSelected}\" \n disabled=\"#{temporadaControllerExt.jornadaListDiseable}\"\u0026gt;\n \u0026lt;f:selectItems value=\"#{temporadaControllerExt.jornadasEnGrupo}\"/\u0026gt;\n \u0026lt;/h:selectOneMenu\u0026gt;\n \u0026lt;/h:panelGroup\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003c/p\u003e\n\n\u003cp\u003eOf course is not complete, for space reasons. And here is part of the bean controller that I'm using:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@ManagedBean(name = \"temporadaControllerExt\")\n@SessionScoped\npublic class TemporadaControllerExt extends TemporadaController {\n\n private Fase fase;\n private Grupo grupo;\n private Jornada jornada;\n\n private String faseSelectedFinal;\n private String grupoSelected;\n private String jornadaSelected;\n private boolean grupoListDiseable = true;\n private boolean jornadaListDiseable = true;\n\n // a lot more declarations, and methods incluiding getters \u0026amp; setters not important for the answer...\n\n //Entities Cache \n private Map\u0026lt;String, Fase\u0026gt; mapFases = new HashMap\u0026lt;\u0026gt;();\n private Map\u0026lt;String, Grupo\u0026gt; mapGrupos = new HashMap\u0026lt;\u0026gt;();\n\n // use to enable the second selectOneMenu\n public void setFaseSelectedFinal(String faseSelectedFinal) {\n this.faseSelectedFinal = faseSelectedFinal;\n this.grupoListDiseable = false;\n }\n\n public void setGrupoSelected(String grupoSelected) {\n this.grupoSelected = grupoSelected;\n this.jornadaListDiseable = false;\n }\n\n // methods used to populate the selecOneMenu's\n public List\u0026lt;SelectItem\u0026gt; getFases(){\n List\u0026lt;SelectItem\u0026gt; fasesList = new ArrayList\u0026lt;\u0026gt;();\n fasesList.add(new SelectItem(\"-- Seleccione Fase --\"));\n for(Map.Entry\u0026lt;String, Fase\u0026gt; item : mapFases.entrySet()){\n fasesList.add(new SelectItem(item.getKey()));\n } \n return fasesList;\n }\n\n public List\u0026lt;SelectItem\u0026gt; getGruposDefase(){\n List\u0026lt;SelectItem\u0026gt; grupoList = new ArrayList\u0026lt;\u0026gt;();\n grupoList.add(new SelectItem(\"-- Seleccione Grupo --\"));\n\n Fase faseSel = mapFases.get(faseSelectedFinal);\n List\u0026lt;Grupo\u0026gt; grupoInt = faseSel.getGrupoList();\n for(Grupo grp : grupoInt){\n grupoList.add(new SelectItem(grp.getNombre()));\n }\n\n return grupoList;\n }\n\n public List\u0026lt;SelectItem\u0026gt; getJornadasEnGrupo(){\n List\u0026lt;SelectItem\u0026gt; jornadaList = new ArrayList\u0026lt;\u0026gt;();\n jornadaList.add(new SelectItem(\"-- Seleccione Jornada --\"));\n\n Grupo grupoSel = mapGrupos.get(grupoSelected);\n for(Jornada jor : grupoSel.getJornadaList()){\n jornadaList.add(new SelectItem(jor.getNumero().toString()));\n }\n return jornadaList;\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAs you can appreciate I'm using primefaces (3.4), and this panel is rendered in accordance to the value of the \"noHayGrupos\" boolean variable. This works OK, my problem is the selectOneMenu chain.\u003c/p\u003e","accepted_answer_id":"13661504","answer_count":"1","comment_count":"0","creation_date":"2012-11-26 00:09:04.727 UTC","last_activity_date":"2016-06-15 20:59:36.463 UTC","last_edit_date":"2017-05-23 12:24:03.88 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"1704344","post_type_id":"1","score":"1","tags":"ajax|jsf-2|primefaces|selectonemenu|chain","view_count":"1239"} +{"id":"35969409","title":"'inout [int]' (aka 'inout Array\u003cint\u003e') is not convertible to 'Array\u003cElement\u003e'","body":"\u003cp\u003eThe code is to store activity data into a bar chart, however, the last line is flagging up this error of which I have never come across. \u003c/p\u003e\n\n\u003cp\u003eCode:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar days:[String] = []\nvar stepsTaken:[Int] = []\nlet activityManager = CMMotionActivityManager()\nlet pedoMeter = CMPedometer()\n\nlet formatter = NSDateFormatter()\n formatter.dateFormat = \"d MMM\"\n dispatch_sync(serialQueue, { () -\u0026gt; Void in\n let today = NSDate()\n for day in 0...6{\nlet fromDate = NSDate(timeIntervalSinceNow: Double(-7+day) * 86400)\nlet toDate = NSDate(timeIntervalSinceNow: Double(-7+day+1) * 86400)\nlet dtStr = formatter.stringFromDate(toDate)\n self.pedoMeter.queryPedometerDataFromDate(fromDate, toDate: toDate) { data, error in\n if let data = data {\n if(error == nil){\n print(\"\\(dtStr) : \\(data.numberOfSteps)\")\n self.days.append(dtStr)\n self.stepsTaken.append(Int(data.numberOfSteps))\n print(\"Days :\\(self.days)\")\n print(\"Steps :\\(self.stepsTaken)\")\n\n if(self.days.count == 7){\n dispatch_sync(dispatch_get_main_queue(), { () -\u0026gt; Void in\n let xVals = self.days\n var yVals: [BarChartDataEntry] = []\n for idx in 0...6 {\n yVals.append(BarChartDataEntry(value: Float(self.stepsTaken[idx]), xIndex: idx))\n }\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"1","creation_date":"2016-03-13 11:02:31.033 UTC","favorite_count":"0","last_activity_date":"2016-03-13 11:02:31.033 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6056610","post_type_id":"1","score":"1","tags":"arrays|swift|swift2","view_count":"324"} +{"id":"29946241","title":"Parse Swift Update Errors","body":"\u003cp\u003eAfter the recent Swift update, I have been trying to debut a few lines of code and don't seem to be understanding what's wrong..\u003c/p\u003e\n\n\u003cp\u003eThe lines are\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e PFGeoPoint.geoPointForCurrentLocationInBackground {\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewith the error message \"Cannot invoke 'geoPointForCurrentLocationInBackground' with an argument list of type '((PFGeoPoint\", NSError!) -\u003e Void)'\"\u003c/p\u003e\n\n\u003cp\u003eThe second line is \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e PFUser.logInWithUsernameInBackground(username:usernameTextField.text, password:passwordTextField.text, target: self) {\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWith the error \"Extra argument 'target' in call\"\u003c/p\u003e\n\n\u003cp\u003eI've tried looking online and debugging these, but I honestly have no idea what's going on. It seems to be an error in the parse code and I'm not sure why that is...\u003c/p\u003e\n\n\u003cp\u003eEdit: I fixed second error I was having. code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ePFUser.logInWithUsernameInBackground(usernameTextField.text, password:passwordTextField.text) {\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"29951249","answer_count":"1","comment_count":"0","creation_date":"2015-04-29 14:09:25.467 UTC","last_activity_date":"2015-04-29 18:45:24.847 UTC","last_edit_date":"2015-04-29 14:35:26.667 UTC","last_editor_display_name":"","last_editor_user_id":"2491669","owner_display_name":"","owner_user_id":"2491669","post_type_id":"1","score":"3","tags":"ios|swift|parse.com","view_count":"162"} +{"id":"8837978","title":"How do you set the namespace AND property value of a ksoap2 PropertyInfo?","body":"\u003cp\u003eI am using ksoap2 to operate an azure web service, and the service uses the namespace\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://schemas.microsoft.com/2003/10/Serialization/Arrays\" rel=\"nofollow\"\u003ehttp://schemas.microsoft.com/2003/10/Serialization/Arrays\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003ewhich means some of the inner elements look like\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;n:string xmlns:n=\"http://schemas.microsoft.com/2003/10/Serialization/Arrays\"\u0026gt;value\u0026lt;/n:string\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow I want to send strings of this type but if you add a property to a \u003ccode\u003eSoapObject\u003c/code\u003e using the \u003ccode\u003ePropertyInfo\u003c/code\u003e class, I can't find a way to set the actual value, so I would have\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;n:string xmlns:n=\"http://schemas.microsoft.com/2003/10/Serialization/Arrays\"/\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOn the other hand, I can add a name/value pair directly, but then I can't set the namespace:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;string\u0026gt;value\u0026lt;/string\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs there a way to do this without implementing a lot of \u003ccode\u003eKvmSerializable\u003c/code\u003e classes?\u003c/p\u003e","accepted_answer_id":"8838935","answer_count":"1","comment_count":"0","creation_date":"2012-01-12 15:51:15.837 UTC","last_activity_date":"2012-01-12 16:53:56.493 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"808808","post_type_id":"1","score":"0","tags":"android|azure|ksoap2","view_count":"312"} +{"id":"42920052","title":"populate Entry using tkinter","body":"\u003cp\u003eI have a issue when I want to populate a entry box using tkinter. My current script are calling another script to get values. Then I want the data to be displayed in a Tkinter entry box.\u003c/p\u003e\n\n\u003cp\u003eThis is my current code, I am have tried \u003ccode\u003etbName.set(\"tbName\", account.getName())\u003c/code\u003e somethhing like that (with and without the tbName) I have also triws StringVar. I am not sure if I am using it wrong. I have looked at the following site : \u003ca href=\"http://effbot.org/tkinterbook/entry.htm\" rel=\"nofollow noreferrer\"\u003eeffbot\u003c/a\u003e. I am very new to Python so any help will b apritiated.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efrom Tkinter import *\nfrom bank import Bank, SavingsAccount\n\n\nclass BankManager(object):\n\n root = Tk()\n\n lblName = Label(root, text=\"Name\")\n lblPin = Label(root, text=\"Pin\")\n lblBalance = Label(root, text=\"Balance R\")\n lblStatus = Label(root, text=\"Status\")\n\n tbName = Entry(root)\n tbPin = Entry(root)\n tbBalance = Entry(root)\n tbStatus = Entry(root)\n\n def __init__(self):\n self.bank = None\n self.app = None\n self.current_index = 0\n self.create_bank()\n self.populate_gui(self.current_index)\n\n def new_account(self, event):\n name = self.app.getEntry('name')\n pin = self.app.getEntry('pin')\n balance = self.app.getEntry('balance')\n account = self.bank.get(pin)\n if account:\n self.app.setEntry(\"status\", \"Account with pin exists\")\n else:\n self.bank.add(SavingsAccount(name, pin, float(balance)))\n self.app.setEntry(\"status\", \"New account created\")\n self.current_index = self.bank.getPins().index(pin)\n\n btnNewAcc = Button(root,text=\"New Account\")\n btnNewAcc.bind(\"\u0026lt;Button\u0026gt;\",new_account)\n\n def update_account(self, event):\n name = self.app.getEntry('name')\n pin = self.app.getEntry('pin')\n balance = self.app.getEntry('balance')\n account = self.bank.get(pin)\n if account:\n account._name = name\n account._balance = balance\n self.app.setEntry(\"status\", \"Account updated\")\n else:\n self.app.setEntry(\"status\", \"Account with pin doesn't exist\")\n\n btnUpdateAcc = Button(root, text=\"Update Account\")\n btnUpdateAcc.bind(\"\u0026lt;Button\u0026gt;\",update_account)\n\n def remove_account(self, event):\n pin = self.app.getEntry('pin')\n account = self.bank.get(pin)\n if account:\n self.bank.remove(pin)\n self.app.setEntry(\"status\", \"Account removed\")\n self.current_index = 0\n else:\n self.app.setEntry(\"status\", \"Account with pin doesn't exist\")\n\n btnRemoveAcc = Button(root,text=\"Remove Account\")\n btnRemoveAcc.bind(\"\u0026lt;Button\u0026gt;\",remove_account)\n\n def compute_interest(self, event):\n self.bank.computeInterest()\n pin = self.app.getEntry('pin') \n account = self.bank.get(pin)\n if account:\n self.app.setEntry(\"status\", \"Interest updated\")\n self.app.setEntry(\"balance\", str(account.getBalance()))\n else:\n self.app.setEntry(\"status\", \"Account with pin doesn't exist\")\n\n btnConputeInterest = Button(root,text=\"Compute Interest\")\n btnConputeInterest.bind(\"\u0026lt;Button\u0026gt;\",compute_interest)\n\n def press_navigator(self, event):\n if button == \"Previous\":\n if self.current_index == 0:\n self.current_index = len(self.bank.getPins()) - 1\n else:\n self.current_index -= 1\n elif button == \"Next\":\n if self.current_index == len(self.bank.getPins()) - 1:\n self.current_index = 0\n else:\n self.current_index += 1\n self.populate_gui(self.current_index)\n\n btnPrevious = Button(root,text=\"Previous\")\n btnPrevious.bind(\"\u0026lt;Button\u0026gt;\",press_navigator)\n\n btnNext = Button(root,text=\"Next\")\n btnNext.bind(\"\u0026lt;Button\u0026gt;\",press_navigator)\n\n lblName.grid(row=0)\n lblPin.grid(row=1)\n lblBalance.grid(row=2)\n lblStatus.grid(row=3)\n\n tbName.grid(row=0, column=1)\n tbPin.grid(row=1, column=1)\n tbBalance.grid(row=2, column=1)\n tbStatus.grid(row=3, column=1)\n\n btnNewAcc.grid(row=0, column=2)\n btnUpdateAcc.grid(row=1, column=2)\n btnRemoveAcc.grid(row=2, column=2)\n btnConputeInterest.grid(row=3, column=2)\n btnPrevious.grid(row=4, column=0)\n btnNext.grid(row=4, column=1)\n\n root.mainloop()\n\n def create_bank(self):\n self.bank = Bank()\n a1 = SavingsAccount('zzz', '111', 100)\n a2 = SavingsAccount('yyy', '222', 200)\n a3 = SavingsAccount('xxx', '333', 300)\n self.bank.add(a1)\n self.bank.add(a3)\n self.bank.add(a2)\n\n def populate_gui(self, index):\n account = self.bank.get(self.bank.getPins()[index])\n tbName.set(\"tbName\", account.getName()) \n\nif __name__ == '__main__':\n BankManager()\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"42937729","answer_count":"1","comment_count":"7","creation_date":"2017-03-21 06:39:21.557 UTC","last_activity_date":"2017-03-21 20:40:51.14 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6693106","post_type_id":"1","score":"-1","tags":"python|tkinter","view_count":"97"} +{"id":"3192115","title":"Converting QuickReport To FastReport","body":"\u003cp\u003eI am Converting a QuickReport to a FastReport in Delphi source, I want to determine the event method name that assigned to a QuickReport object and according to it assign a method to the same event of the FastReport object.\nHow can I do it?\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2010-07-07 05:22:10.463 UTC","favorite_count":"2","last_activity_date":"2012-04-04 11:51:59.613 UTC","last_edit_date":"2012-04-04 11:51:59.613 UTC","last_editor_display_name":"","last_editor_user_id":"505893","owner_display_name":"","owner_user_id":"385171","post_type_id":"1","score":"4","tags":"delphi|migration|fastreport|quickreports","view_count":"6075"} +{"id":"12049365","title":"Retrieve object executed via ExecutorService.submit","body":"\u003cp\u003eI have an ExecutorService that runs several solvers in parallel. Each solver modifies several internal variables which value must be returned.\nIt is not possible to encapsulate all the variables in a class to be returned via a callable object for compatibility issues. Therefore, make the solvers either callable or runnable does not make any difference in my case, as I cannot retrieve all the variables I need.\u003c/p\u003e\n\n\u003cp\u003eI considered following two options:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eEach solver access a synchronized class and writes its values there.\u003c/li\u003e\n\u003cli\u003eAccess the objects (solvers) that have been submitted by the executor in order to get their variables via get methods.\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eI prefer the second option, but I don't find the way to gain access to the objects submitted.\u003c/p\u003e\n\n\u003cp\u003eAny suggestion (for any of the options)?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2012-08-21 06:23:22.53 UTC","last_activity_date":"2013-03-21 09:41:37.383 UTC","last_edit_date":"2012-08-21 17:22:57.793 UTC","last_editor_display_name":"","last_editor_user_id":"237838","owner_display_name":"","owner_user_id":"1613227","post_type_id":"1","score":"0","tags":"submit|return|runnable|executorservice|callable","view_count":"92"} +{"id":"4775904","title":"Access in-memory unzipped file with codecs.open()","body":"\u003cp\u003eI'm trying to open in-memory unzipped files with \u003ccode\u003ecodecs.open()\u003c/code\u003e. I've figured out how to unzip a file in memory, but I don't know how to create a file object and open it with \u003ccode\u003ecodecs\u003c/code\u003e. I've experimented with different \u003ccode\u003eZipFile\u003c/code\u003e properties, but no luck.\u003c/p\u003e\n\n\u003cp\u003eSo, here how I opened the zip in memory:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport zipfile, io\n\nf = 'somezipfile.zip'\nmemory_object = io.BytesIO(f.read()) \nzip_in_memory = zipfile.ZipFile(memory_object)\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"4776009","answer_count":"1","comment_count":"0","creation_date":"2011-01-23 19:24:32.24 UTC","last_activity_date":"2011-01-23 19:41:10.67 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"559807","post_type_id":"1","score":"1","tags":"python|memory|codec|zipfile","view_count":"689"} +{"id":"43175449","title":"Is it possible to backup all the files under chrome/developer tools/sources?","body":"\u003cp\u003eI loaded a site and checking developer tools I can see a lot of folders and files under the Sources section, aunder a folder called top.\u003c/p\u003e\n\n\u003cp\u003eIs there a way or extension to help me copy all those folders and files to my hard drive?\u003c/p\u003e\n\n\u003cp\u003eEven if it's a third party tool would help, at the moment I cannot think on anything else other than manually copying everything, which would take quite a while!\u003c/p\u003e\n\n\u003cp\u003eThank you.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-04-03 01:50:37.683 UTC","last_activity_date":"2017-04-03 19:07:57.893 UTC","last_edit_date":"2017-04-03 02:06:11.007 UTC","last_editor_display_name":"","last_editor_user_id":"3591628","owner_display_name":"","owner_user_id":"1155105","post_type_id":"1","score":"1","tags":"google-chrome|google-chrome-devtools|google-developer-tools","view_count":"30"} +{"id":"32319329","title":"jQuery - Only carry out action if url doesn't contain any parametres","body":"\u003cp\u003eI have a function that runs only if an attribute is blank:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eif (!$(\".main-image\").attr(\"src\")) {\n loadImageAjax();\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut I also only want it to run IF the url doesn't contain any parametres.\u003c/p\u003e\n\n\u003cp\u003eSo only if the domain is simply: www.domain.com and not www.domain.com/?image=33\u003c/p\u003e","accepted_answer_id":"32319518","answer_count":"1","comment_count":"0","creation_date":"2015-08-31 20:19:50.14 UTC","last_activity_date":"2015-08-31 20:47:41.017 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2921557","post_type_id":"1","score":"0","tags":"javascript|jquery","view_count":"72"} +{"id":"46288939","title":"How to Fetch a single Object Details using its ObjectID in a CA Agile Central (AKA Rally) Custom App?","body":"\u003cp\u003eI have an app which is fetching data from Lookback API. I get User ObjectID in the data, however I would like to get the DisplayName of the User instead of ObjectID. Rally Lookback API does not allow to Hydrate User field, so I cannot have User Name while loading Lookback API Data. \nI tried creating store with user Object ID filter to get the User Name, but I don't get the name of the user, until Lookback API data load is complete. By the time Lookback API data load is complete my data operations are also complete. So loading User Name after first load is not useful. I tried setting async property of Store to false/true, didn't work.\nAny way to accomplish this with Rally SDK 2.0?\nHere is the Code Block -\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e//Lookback call\n_getStoriesByUser: function (user_story_ids, user_oids, user_story_state, users) {\n this.acceptedByTM = [];\n var scheduleStates = [];\n scheduleStates.push('Accepted');\n scheduleStates.push('Released to Prod');\n\n var deferred = Ext.create('Deft.Deferred');\n var me = this;\n console.time(\"FetchingLBData\");\n var snapshotStore = Ext.create('Rally.data.lookback.SnapshotStore', {\n \"context\": this.getContext().getDataContext(),\n \"fetch\": [\"ScheduleState\", \"_User\", \"_PreviousValues.ScheduleState\"],\n \"hydrate\": [\"ScheduleState\"],\n \"find\": {\n \"ObjectID\": { \"$in\": user_story_ids },\n //\"_User\": { \"$in\": user_oids },\n \"_TypeHierarchy\": \"HierarchicalRequirement\",\n \"ScheduleState\": { \"$in\": scheduleStates },\n \"_PreviousValues.ScheduleState\": { \"$ne\": null },\n \"Children\": null\n },\n \"sort\": { \"_ValidFrom\": -1 }\n });\n\n snapshotStore.load({\n callback: function (records, operation) {\n if (operation.wasSuccessful()) {\n console.timeEnd(\"FetchingLBData\");\n me.logger.log(\"LB US Count \u0026gt;\u0026gt;\", records.length, records)\n var total_us_accepted_by_tm = 0;\n var tmAcceptedUS = 0;\n var nontmAcceptedUS = 0;\n var tm_accepted = [];\n Ext.Array.each(user_story_state, function (uss) {\n Ext.Array.each(records, function (rec) {\n if ((rec.get('ObjectID') == uss.ObjectID \u0026amp;\u0026amp; rec.get('ScheduleState') == 'Accepted') \u0026amp;\u0026amp; (uss.ScheduleState == 'Accepted' || uss.ScheduleState == 'Released to Prod')) {\n total_us_accepted_by_tm += 1;\n tm_accepted.push({ ObjectID: rec.get('ObjectID'), UserObjectID: rec.get('_User') });\n var userName;\n //userName = me._fetchUserName(rec.get('_User')).value;\n me._fetchUserName(rec.get('_User')).then({\n success: function (records) {\n userName = records[0].get('DisplayName')\n },\n failure: function (error) {\n console.log('Error in Execution:', error)\n }\n }).always(function() {\n console.log('Waiting for Update!');\n });\n //userName = rec.get('_User').DisplayName;\n console.log('Accepted By Name: ', userName);\n\n me.acceptedByTM.push({ ObjectID: rec.get('ObjectID'), UserObjectID: userName });\n return false;\n\n }\n });\n\n });\n\n deferred.resolve(me.acceptedByTM);\n } else {\n deferred.reject('Problem querying lookback');\n }\n },\n scope: me\n });\n return deferred;\n},\n\n//Get User Details for a given user\n_fetchUserName: function (userObjId) {\n var me = this;\n var userName;\n var userDetails;\n var deferred = Ext.create('Deft.Deferred');\n me.logger.log(\"Fetching User Information for User \u0026gt;\u0026gt;\", userObjId);\n\n var userFilter = Ext.create('Rally.data.wsapi.Filter', {\n property: 'ObjectID',\n value: userObjId\n });\n\n userDetails = Ext.create('Rally.data.wsapi.Store', {\n model: 'User',\n fetch: ['ObjectID', 'DisplayName'],\n filters: userFilter,\n limit: 1,\n pageSize: 1\n });\n\n userDetails.load({\n scope: this,\n callback: function (records, operation, success) {\n console.log(\"Operation Status: \", operation.synchronous);\n if (success) {\n //userName = records[0].get('DisplayName');\n deferred.resolve(records);\n } else {\n deferred.reject(Ext.String.format(\"Error getting {0} count for {1}: {2}\", 'User', userFilter.toString(), operation.error.errors.join(',')));\n }\n }\n });\n\n return deferred.promise;\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"46458006","answer_count":"1","comment_count":"3","creation_date":"2017-09-18 22:16:40.857 UTC","last_activity_date":"2017-09-27 22:11:22.603 UTC","last_edit_date":"2017-09-19 15:40:39.193 UTC","last_editor_display_name":"","last_editor_user_id":"8629074","owner_display_name":"","owner_user_id":"8629074","post_type_id":"1","score":"0","tags":"rally","view_count":"40"} +{"id":"15019982","title":"Python3: How to create a dict of different objects of the same class?","body":"\u003cp\u003eI would like to create a dict, containing several objects of the same class. Each object must be independent.\nSomething like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#!/usr/bin/python3\n\nclass myReserve():\n\n myList = dict()\n\n def __init__(self, initName):\n self.myName = initName\n self.setList()\n\n def setList(self):\n if self.myName == \"fruit\":\n self.myList[0] = \"Orange\"\n self.myList[1] = \"Lemon\"\n elif self.myName == \"vegetable\":\n self.myList[0] = \"Tomato\"\n self.myList[1] = \"Carrot\"\n #If neither fruit nor vegetable\n #myList should be empty.\n\n\nmyStore = dict()\nmyStore[0] = myReserve(\"fruit\")\nmyStore[1] = myReserve(\"vegetable\")\nmyStore[2] = myReserve(\"spices\")\n\nprint(myStore[0].myList)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis prints:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{0: 'Tomato', 1: 'Carrot'}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI thought it would print:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{0: 'Orange', 1: 'Lemon'}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI understood objects are passed by reference in Python. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edict1 = {\"var\": 128}\ndict2 = dict1\ndict2[\"var\"] = 0\nprint(dict1[\"var\"])\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWill print: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e0\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBy creating a class I want to create a structure for different objects. I don't understand the behaviour of the first code example. Is it possible to do something like this in a Python way?\u003c/p\u003e","accepted_answer_id":"15020562","answer_count":"1","comment_count":"0","creation_date":"2013-02-22 08:40:57.54 UTC","last_activity_date":"2017-08-02 14:40:18.09 UTC","last_edit_date":"2017-08-02 14:40:18.09 UTC","last_editor_display_name":"","last_editor_user_id":"1033581","owner_display_name":"","owner_user_id":"1918443","post_type_id":"1","score":"0","tags":"python|python-3.x","view_count":"98"} +{"id":"12816692","title":"How to programmatically subclass a UIViewController stored in a Storyboard?","body":"\u003cp\u003eI'm working on my first iPad application and using Storyboards for the first time. \u003c/p\u003e\n\n\u003cp\u003eI've got UITableViewController in my Storyboard that uses \"Dynamic Prototypes\" for custom cells. \u003c/p\u003e\n\n\u003cp\u003eWhat I want to do is programatically instantiate my UITableViewController subclasses but loading the super view controller from the Storyboard.\u003c/p\u003e\n\n\u003cp\u003eThis is because I have a single UI but multiple subclasses for specific functionality that I need for each different instance.\u003c/p\u003e\n\n\u003cp\u003eThis was very easy to do with .xib files, I would write the following code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eMyViewControllerSubClassA *viewControllerA = [[MyViewControllerSubClassA alloc] initWithNibName:@\"generalViewControllerNib\" bundle:nil];\n\nMyViewControllerSubClassB *viewControllerB = [[MyViewControllerSubClassB alloc] initWithNibName:@\"generalViewControllerNib\" bundle:nil];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI know I can assign a subclass in the Storyboard editor when clicking on the View Controller but I want to set the subclass programmatically when instantiating.\u003c/p\u003e\n\n\u003cp\u003eThis seems impossible to do with Storyboards as they are instantiated automatically.\u003c/p\u003e\n\n\u003cp\u003eThis makes the entire concept of Storyboards seem flawed and not very OO.\u003c/p\u003e\n\n\u003cp\u003eIf I move the View Controller out of the Storyboard and into a .xib file I lose the ability to use Dynamic \u0026amp; Static Prototypes cells as these are supported only when using Storyboards. Also Apple's documentation basically says use Storybaords from now on.\u003c/p\u003e","answer_count":"1","comment_count":"8","creation_date":"2012-10-10 10:01:41.743 UTC","favorite_count":"2","last_activity_date":"2012-10-10 10:06:55.19 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"248848","post_type_id":"1","score":"2","tags":"xcode|ios5|uiviewcontroller|storyboard|uistoryboardsegue","view_count":"1220"} +{"id":"7799223","title":"Java Application to read WiFi Signal and SSID?","body":"\u003cp\u003eI've been searching a lot about this topic but I didn't find anything useful up till now, I want to create a simple application that can read\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eWiFi Signal Strength \u003c/li\u003e\n\u003cli\u003eSSID of AP\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eusing Java. Is this possible, if yes then how?\u003c/p\u003e\n\n\u003cp\u003eAlso i have another question, can I make the same application using J2ME?\u003c/p\u003e","answer_count":"1","comment_count":"5","creation_date":"2011-10-17 20:33:06.787 UTC","last_activity_date":"2012-10-03 15:24:29.8 UTC","last_edit_date":"2011-10-17 21:04:11.207 UTC","last_editor_display_name":"","last_editor_user_id":"571271","owner_display_name":"","owner_user_id":"999916","post_type_id":"1","score":"3","tags":"java|wifi|signals|ssid","view_count":"2724"} +{"id":"28496884","title":"How can I perform the following computation in a more elegant (and Pythonic) way?","body":"\u003cp\u003eGiven the object \u003ccode\u003edata\u003c/code\u003e, which is of type \u003ccode\u003enumpy.ndarray\u003c/code\u003e, how can I perform the following in one line?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eVERY_LOW = np.where(data\u0026lt;=-2, 'VERY_LOW', 'LOL').astype('S12') \nLOW = np.where((data\u0026gt;-2) \u0026amp; (data\u0026lt;=-1), 'LOW', VERY_LOW)\nAVERAGE = np.where((data\u0026gt;-1) \u0026amp; (data\u0026lt;+1), 'AVERAGE', LOW)\nHIGH = np.where((data\u0026gt;=+1) \u0026amp; (data\u0026lt;+2), 'HIGH', AVERAGE)\nVERY_HIGH = np.where(data\u0026gt;=+2, 'VERY_HIGH', HIGH)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBasically, what I am trying to achieve is to assign a tag to each cell depending on its value (one out of five available).\u003c/p\u003e","accepted_answer_id":"28497775","answer_count":"2","comment_count":"0","creation_date":"2015-02-13 09:59:08.697 UTC","last_activity_date":"2015-02-13 11:06:01.52 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"706838","post_type_id":"1","score":"0","tags":"python|numpy|multidimensional-array","view_count":"45"} +{"id":"11080733","title":"how to make a jquery menu that slides and hides what was before?","body":"\u003cp\u003eBasically what i am trying to achieve is having the ul menu on the left side of my content div, at the start only one li should be visible.\nOnce clicked it has to slide out or a sort of animation and be replaced by 4 \u003cstrong\u003eli\u003c/strong\u003e that contain the different navigation \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e(function($){\n $(function(){\n\n $('li.dropdown').click(function() {\n $(this).fadeOut('slow')\n .siblings('li.stage2').css('display', 'block');\n });\n });\n})(jQuery);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethis currently does it but the siblings coming in isn't smooth and when the fadOut animation is over they jump in the place of the other, any help would be appreciated.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT\u003c/strong\u003e\nNot a drop down menu.\u003c/p\u003e","accepted_answer_id":"11081389","answer_count":"2","comment_count":"0","creation_date":"2012-06-18 10:09:37.17 UTC","last_activity_date":"2012-06-18 12:38:27.723 UTC","last_edit_date":"2012-06-18 12:38:27.723 UTC","last_editor_display_name":"","last_editor_user_id":"112407","owner_display_name":"","owner_user_id":"1401094","post_type_id":"1","score":"1","tags":"jquery|html|css","view_count":"242"} +{"id":"25334057","title":"How can I access Box.com Comments using API","body":"\u003cp\u003eI am trying to using Box API to get comments that have been made on the files and folders. \u003c/p\u003e\n\n\u003cp\u003eI have tried looking at the box content api but could not find anything useful. Am I missing something here?\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2014-08-15 20:52:21.48 UTC","last_activity_date":"2014-08-16 07:26:59.753 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2316656","post_type_id":"1","score":"0","tags":"box-api|box","view_count":"70"} +{"id":"44784296","title":"Animate child inside parent","body":"\u003cp\u003eI'm trying to animate a child div inside a parent div with TweenMax. The animation should start from a random position within the parent div (which is working pretty good). But the animation should not be able to go outside of the parent div. How can I make the child div animate from random start positions but not go outside of parent div?\u003c/p\u003e\n\n\u003cp\u003eThis is my js so far:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar main = $('.outer');\nvar box = $('.inner');\n\nvar width = main.width();\nvar height = main.height();\n\n$( '.inner' ).each(function( index ) {\n $(this).css({\n left : Math.random() * ($('.inner').width() - $(this).width()),\n top : Math.random() * ($('.inner').height() - $(this).height())\n });\n});\n\nfunction randomNumber(min, max) {\n return (Math.random() * (max - min)) + min;\n}\n\nTweenLite.defaultEase = Linear.easeNone;\nvar tl = new TimelineLite()\n\ntl.to(\".inner\", 3.05, {x:randomNumber(0, width), repeat:-1, yoyo:true})\n .to(\".inner\", 3.4, {y:randomNumber(0, height), repeat:-1, yoyo:true}, 0)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003ca href=\"https://jsfiddle.net/jdornell/7q8jnzq0/9/\" rel=\"nofollow noreferrer\"\u003eFiddle\u003c/a\u003e\u003c/p\u003e","answer_count":"0","comment_count":"5","creation_date":"2017-06-27 15:30:42.71 UTC","last_activity_date":"2017-06-27 15:30:42.71 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3983968","post_type_id":"1","score":"0","tags":"javascript|jquery|animation|tweenmax","view_count":"84"} +{"id":"38628438","title":"Multiple buttons in the same page submit to Ajax","body":"\u003cp\u003eI have multiple button in the same page like 50 maybe more to submit a single value to Ajax wordpress way. They look like this: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;input id=\"1-57977357564a7\" class=\"button-primary\" type=\"submit\" value=\"Done\"/\u0026gt;\n\u0026lt;input id=\"2-57977357564a7\" class=\"button-primary\" type=\"submit\" value=\"Done\"/\u0026gt;\n\u0026lt;input id=\"3-57977357564a9\" class=\"button-primary\" type=\"submit\" value=\"Done\"/\u0026gt;\n// And so on, more buttons\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eEach button should update on row in some database table.\nIt should call \u003ccode\u003eupdate_completed_todos()\u003c/code\u003e using Ajax\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eadd_action('wp_ajax_update_completed_todos', 'update_completed_todos');\nadd_action( 'wp_ajax_nopriv_update_completed_todos', 'update_completed_todos' );\nfunction update_completed_todos() {\n global $wpdb;\n $table_name = $wpdb-\u0026gt;prefix . 'todos';\n $id = '';// Need to pass the id here some how\n $result = $wpdb-\u0026gt;get_results(\"SELECT id FROM \" . $table_name . \" WHERE id = '\" .$id.\"'\");\n if (count ($result) \u0026gt; 0) {\n $wpdb-\u0026gt;update( \n $table_name, \n array( \n 'complete' =\u0026gt; '10', \n ),\n array( 'id' =\u0026gt; $id )\n );\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI need to pass the \u003ccode\u003eid\u003c/code\u003e some how to this function. \u003cbr\u003e\nWhat should I write in Ajax to pass the \u003ccode\u003eid\u003c/code\u003e? \u003cbr\u003e\nAnd how I can make each button target this Ajax? \u003cbr\u003e\nAs Ajax may not pass \u003ccode\u003eid\u003c/code\u003e instead of a value, what should I do to pass any value to Ajax here? \u003cbr\u003e\nThe Ajax should be something like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$.ajax({\n url: \"\u0026lt;?php echo esc_js( admin_url( 'admin-ajax.php' ) ) ?\u0026gt;\",\n type: \"POST\",// I am not sure\n data: // Something I don't know here\n //may be more here \n });\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"38628553","answer_count":"1","comment_count":"2","creation_date":"2016-07-28 06:17:33.41 UTC","last_activity_date":"2016-07-28 13:09:20.03 UTC","last_edit_date":"2016-07-28 06:32:17.8 UTC","last_editor_display_name":"","last_editor_user_id":"2873388","owner_display_name":"","owner_user_id":"2873388","post_type_id":"1","score":"0","tags":"javascript|php|jquery|ajax|wordpress","view_count":"402"} +{"id":"38067842","title":"How to submit form without reloading page, without jQuery?","body":"\u003cp\u003eI have form as follows, it require to sent an action to my java Servlet to do an update to the database.\u003c/p\u003e\n\n\u003cp\u003eHow do I submit the form without the page get reloaded here? \nCurrently with \u003ccode\u003eaction=\"myServlet\"\u003c/code\u003e it keep direct me to a new page. And if I remove the action to myServlet, the input is not added to my database.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;form name=\"detailsForm\" method=\"post\" action=\"myServlet\" \n onsubmit=\"return submitFormAjax()\"\u0026gt;\n name: \u0026lt;input type=\"text\" name=\"name\" id=\"name\"/\u0026gt; \u0026lt;br/\u0026gt;\n \u0026lt;input type=\"submit\" name=\"add\" value=\"Add\" /\u0026gt;\n\u0026lt;/form\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn the view of my Java servlet, \u003ccode\u003erequest.getParameter\u003c/code\u003e will look for the name and proceed to add it into my db.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@Override\nprotected void doPost(HttpServletRequest request, HttpServletResponse response) \n throws ServletException, IOException\n{ \n if (request.getParameter(\"add\") != null) {\n try {\n Table.insert(name);\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn my JavaScript part, I have a \u003ccode\u003esubmitFormAjax\u003c/code\u003e function\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction submitFormAjax()\n{\n var xmlhttp;\n if (window.XMLHttpRequest) {\n // code for modern browsers\n xmlhttp = new XMLHttpRequest();\n } else {\n // code for IE6, IE5\n xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n\n xmlhttp.onreadystatechange = function() {\n if (xmlhttp.readyState == 4 \u0026amp;\u0026amp; xmlhttp.status == 200)\n alert(xmlhttp.responseText); // Here is the response\n }\n\n var id = document.getElementById(\"name\").innerHTML;\n xmlhttp.open(\"POST\",\"/myServlet\",true);\n xmlhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n xmlhttp.send(\"name=\" + name); \n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"3","comment_count":"2","creation_date":"2016-06-28 05:36:59.393 UTC","last_activity_date":"2017-06-20 15:39:36.983 UTC","last_edit_date":"2017-06-19 14:50:20.063 UTC","last_editor_display_name":"","last_editor_user_id":"2878556","owner_display_name":"","owner_user_id":"1526669","post_type_id":"1","score":"2","tags":"javascript|ajax","view_count":"5873"} +{"id":"6270956","title":"Timer speeding up","body":"\u003cp\u003eI wrote a simple WinForm program in C# that displays the time, updating every second by creating an event. Although it starts off fine, after some time I notice that it's updating more quickly than every second. As more time passes, it continues to increase its updating speed. Any thoughts?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic static void Update(){\n if(!Pause) {\n aTimer = new System.Timers.Timer(1000);\n aTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent);\n aTimer.Enabled = true;\n }\n}\n\nprivate static void OnTimedEvent(object source,ElapsedEventArgs e) {\n Form1obj.updateLabel1(DateTime.Now.ToString());\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn my Form class:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic void updateLabel1(string msg) {\n\n if (this.label1.InvokeRequired)\n {\n SetTextCallback d = new SetTextCallback(updateLabel1);\n this.Invoke(d, new object[] { msg });\n }\n else\n this.label1.Text = msg;\n\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"6271027","answer_count":"1","comment_count":"3","creation_date":"2011-06-07 20:04:13.767 UTC","favorite_count":"0","last_activity_date":"2011-06-07 20:11:42.08 UTC","last_edit_date":"2011-06-07 20:11:42.08 UTC","last_editor_display_name":"","last_editor_user_id":"759705","owner_display_name":"","owner_user_id":"759705","post_type_id":"1","score":"1","tags":"c#|winforms|timer","view_count":"557"} +{"id":"20791324","title":"Android - Graying out characters on keyboard?","body":"\u003cp\u003eI want to have an EditText element accept only 0's and 1's. I have specified its 'digits' attribute to:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eandroid:digits=\"01\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis allows for only 0 and 1 to be entered, but I want to know if there is a way to 'grey-out' all of the keyboard buttons except for 0 and 1?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-12-26 21:11:59.327 UTC","last_activity_date":"2013-12-26 21:15:41.31 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2121620","post_type_id":"1","score":"0","tags":"android","view_count":"60"} +{"id":"16710085","title":"Setting the image capture view in AVCaptureStillImageOutput class","body":"\u003cp\u003eI am using \u003ccode\u003eAVCaptureConnection\u003c/code\u003e and \u003ccode\u003eAVCaptureStillImageOutput\u003c/code\u003e class to create a overlay screen and capturing the image.In the view,I have a custom tab bar with some custom controls like capture button,flash button etc.\u003c/p\u003e\n\n\u003cp\u003eThe problem is that the camera is capturing the whole image and it is seen in the preview page.i.e. the custom tabbar is of 40 pixels,so the user is shown the capture area with the tab bar.User takes the image till the custom tabbar.but in the preview screen,the image gets extended and he sees extra apart from the image he took.\u003c/p\u003e\n\n\u003cp\u003eI tried looking up for property in \u003ccode\u003eAVCaptureConnection\u003c/code\u003e to set the capture area but couldn't found anything.Anyone has faced the issue earlier,please help.\u003cimg src=\"https://i.stack.imgur.com/Dqbry.jpg\" alt=\"1st screen where user takes the image\"\u003e\u003c/p\u003e\n\n\u003cp\u003eAs you can see the user is seeing the extra apart from what he has taken\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/nnnSy.jpg\" alt=\"image that is taken\"\u003e\u003c/p\u003e","accepted_answer_id":"16756824","answer_count":"1","comment_count":"0","creation_date":"2013-05-23 09:21:57.503 UTC","last_activity_date":"2013-05-26 06:38:21.41 UTC","last_edit_date":"2013-05-23 13:20:11.523 UTC","last_editor_display_name":"","last_editor_user_id":"981914","owner_display_name":"","owner_user_id":"849907","post_type_id":"1","score":"2","tags":"iphone|ios|ios6|avcapturesession|image-capture","view_count":"1131"} +{"id":"34438585","title":"XMLUnit, can i ignore one attribut value AND ignore element order","body":"\u003cp\u003emodele.XML\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version='1.0' encoding='UTF-8'?\u0026gt;\n\u0026lt;MyFile fileId=\"1\" nbrItems=\"3\"\u0026gt;\n \u0026lt;MyElement Date=\"2015-12-08T17:22:56+01:00\" status=\"ACTIVE\" Attribut1=\"testintegrationEF133\" Attribut2=\"MerryChristmas\"\u0026gt;\u0026lt;/MyElement\u0026gt;\n \u0026lt;MyElement Date=\"2015-12-08T17:22:56+01:00\" status=\"ACTIVE\" Attribut1=\"testintegrationEF134\" Attribut2=\"MerryChristmas\"\u0026gt;\u0026lt;/MyElement\u0026gt;\n \u0026lt;MyElement Date=\"2015-12-08T17:22:56+01:00\" status=\"ACTIVE\" Attribut1=\"testintegrationEF135\" Attribut2=\"MerryChristmas\"\u0026gt;\u0026lt;/MyElement\u0026gt;\n\u0026lt;/MyFile \u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003etoCheck.xml\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version='1.0' encoding='UTF-8'?\u0026gt;\n\u0026lt;MyFile fileId=\"1\" nbrItems=\"3\"\u0026gt;\n \u0026lt;MyElement Date=\"3015-12-08T17:22:56+01:00\" status=\"ACTIVE\" Attribut1=\"testintegrationEF135\" Attribut2=\"MerryChristmas\"\u0026gt;\u0026lt;/MyElement\u0026gt;\n \u0026lt;MyElement Date=\"3015-12-08T17:22:56+01:00\" status=\"ACTIVE\" Attribut1=\"testintegrationEF134\" Attribut2=\"MerryChristmas\"\u0026gt;\u0026lt;/MyElement\u0026gt;\n \u0026lt;MyElement Date=\"3015-12-08T17:22:56+01:00\" status=\"ACTIVE\" Attribut1=\"testintegrationEF133\" Attribut2=\"MerryChristmas\"\u0026gt;\u0026lt;/MyElement\u0026gt;\n\u0026lt;/MyFile \u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy first problem was to ignore the Attribut \"Date\" :\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eI solved it by using Regex and an overriding of DifferenceListener \u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eThe second problem was the order of my elements \"MyElement\" :\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eI solved it by using overrideElementQualifier(new ElementNameAndAttributeQualifier());\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eBUT, when I want to do this two \"tricks\" at the same times i got this error :\u003c/p\u003e\n\n\u003cp\u003eExpected attribute value 'testintegrationEF133' but was 'testintegrationEF134'...\u003c/p\u003e\n\n\u003cp\u003eMy test :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic void testXmlDiffs( File pathFileToCheck) throws MyException, SAXException, IOException {\n try{\n\n final String[] fileType = pathFileToCheck.getName().split(SEPARATOR);\n final InputStreamReader fileModele = findXmlModele(fileType[1]);\n final String pathFileToCheck2 = BUNDLE.getString(\"paths.in\").concat(pathFileToCheck.getName());\n\n if (fileModele == null){\n logFichierIntrouvable(fileType[1], pathFileToCheck); \n }\n else{\n Reader frModele = null;\n InputStreamReader frToCheck = null;\n frToCheck = new InputStreamReader(new FileInputStream(pathFileToCheck2), UTF_8_ENCODING);\n frModele = fileModele;\n\n XMLUnit.setIgnoreWhitespace(true);\n XMLUnit.setNormalize(true);\n XMLUnit.setNormalizeWhitespace(true);\n XMLUnit.setIgnoreDiffBetweenTextAndCDATA(true);\n XMLUnit.setIgnoreAttributeOrder(true);\n XMLUnit.setCompareUnmatched(false);\n\n Diff diff = new Diff(frModele, frToCheck);\n\n diff.overrideElementQualifier(new ElementNameAndAttributeQualifier());\n diff.overrideDifferenceListener(new SuperListener()); \n logResultOk(fileType[1], diff , pathFileToCheck, startTime);\n }\n }catch(final Exception e) {\n throw e;\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf you have any idee or want more informations you can ask me :-)\u003c/p\u003e\n\n\u003cp\u003ethank you\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2015-12-23 15:12:15.363 UTC","last_activity_date":"2015-12-24 09:37:39.417 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5704052","post_type_id":"1","score":"0","tags":"xml|order|xml-attribute|xmlunit","view_count":"73"} +{"id":"861832","title":"validating CEdit without subclassing","body":"\u003cp\u003eIs there any way to validate the contents of a CEdit box without subclassing?\u003c/p\u003e\n\n\u003cp\u003eI want to check for invalid filename characters in a CEdit box and not allow the user to input it at all (keypress should not be recorded, if pasted in the box, the invalid characters should just not make it to the edit box)..\u003c/p\u003e\n\n\u003cp\u003eIs there any easy way to do this?\u003c/p\u003e\n\n\u003cp\u003eOn a side note, how do I make a variable that is tied to this box? If I add a variable that is not a control one, would this variable always contain what is in the edit control?\u003c/p\u003e\n\n\u003cp\u003eThanks..\u003c/p\u003e","accepted_answer_id":"861848","answer_count":"3","comment_count":"0","creation_date":"2009-05-14 06:24:28.507 UTC","last_activity_date":"2009-05-14 14:19:14.623 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"29482","post_type_id":"1","score":"1","tags":"c++|mfc|cedit","view_count":"1982"} +{"id":"37106685","title":"protobuf-net: where is unity folder? Or other folders listed?","body":"\u003cp\u003eI just downloaded \u003ca href=\"https://github.com/mgravell/protobuf-net\" rel=\"nofollow\"\u003eprotobuf-net\u003c/a\u003e, Here is the contents of 'What files do I need.txt'\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e protobuf-net can be used on multiple platforms, and many different builds are available.\n\n In particular, though, there are 2 main uses:\n\n - the \"full\" version, which includes as much type-model / runtime support as will work on your chosen platform\n - the \"core only\" version, which includes just the fundamental reader/writer API and core objects\n\n If you are on a rich framework like full .NET, the \"full\" version is entirely appropriate and will work fine.\n\n However, if you are on a restricted framework (Silverlight, Phone 7, WinRT, etc) then many operations would either\n be slow, or impossible. To address this, protobuf-net provides these frameworks with a \"precompile\" facility,\n which moves all of the impossible / slow steps to a build-time operation, emitting a serialiation dll you\n can reference and use (now very fast etc) from your chosen framework.\n\n More information about the precompiler is here:\n http://marcgravell.blogspot.co.uk/2012/07/introducing-protobuf-net-precompiler.html\n\n protobuf-net also includes a utility for processing \".proto\" files (the schema DSL used by multiple protobuf\n implementations) into C# and VB.NET; this is the ProtoGen tool.\n\n Neither precompile nor ProtoGen need to be deployed with your application.\n\n\n So: what do I need?\n\n example: running on .NET 4.0\n\n solution: copy the files from Full\\net30. Note that protobuf-net does not require any 4.0 features, so using \"net30\" will\n give you all of protobuf-net including WCF support (which is the difference between \"net20\" and \"net30\").\n\n\n example: running on Silverlight 4\n\n option 1: copy the files from Full\\sl4, and accept that it isn't quite as optimal as it could be - but perfectly fine\n for light-to-moderate serialization usage.\n\n option 2: copy the files from CoreOnly\\sl4, and use \"precompile\" (in the Precompile folder) at build-time to generate\n a serialization assembly (this also needs to be referenced and deployed from you application).\n\n Additional:\n\n Note that each framework contains 3 files:\n\n - protobuf-net.dll the library itself\n - protobuf-net.xml intellisense xml, used by thre IDE when developing\n - protobuf-net.pdb debugging symbols, useful when debugging\n\n Of these - the only one you **need** to deploy is the dll; the pdb may be useful for investigating crash reports. The\n xml is used only by the IDE.\n\n Folders:\n\n cf20 compact framework 2.0\n cf35 compact framework 3.5\n ios iPad/iPod/iPhone via MonoTouch\n net11 regular .NET 1.1 (excluded generics)\n net20 regular .NET 2.0 (excludes WCF hooks)\n net30 regular .NET 3.0 or above (including 3.5, 4.0, 4.5, ...)\n netcore45 windows store apps / windows runtime 4.5\n portable portable class library (phone 7, xna, silverlight)\n sl4 silverlight 4 or above\n wp71 windows phone 7.1\n unity specific to unity (avoids missing \"interlocked\" methods)\n\n License:\n\n The full license is shown separately, but boils down to \"do what you like with it, don't sue me,\n don't blame me if it goes horribly wrong, don't claim you wrote protobuf-net\"\n\n Finally:\n\n All feedback welcome.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to us it with unity, the unity folder or most of the other folders listed including 'full' dont seem to exist... Am I missing something very fundamental here?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-05-09 01:33:50.817 UTC","last_activity_date":"2016-08-14 09:26:24.437 UTC","last_edit_date":"2016-05-09 01:39:35.477 UTC","last_editor_display_name":"","last_editor_user_id":"1432808","owner_display_name":"","owner_user_id":"1432808","post_type_id":"1","score":"0","tags":"unity3d|protobuf-net","view_count":"204"} +{"id":"17820946","title":"How to reference to emberJS controller from another view","body":"\u003cp\u003eI'm using ember tools for my app. Now I want to add a TextField to trigger a search in my controller, like in \u003ca href=\"http://alg.github.io/talks/emberjs/#/title\" rel=\"nofollow\"\u003ethis example.\u003c/a\u003e This is the controller and view:\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eProductsController:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar ProductsController = Ember.ArrayController.extend({\n search: function(query) {\n console.log(query);\n }\n});\n\nmodule.exports = ProductsController;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eSearchFieldView:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar SearchFieldView = Ember.TextField.extend({\n insertNewline: function() {\n var query = this.get('value');\n App.ProductsController.search(query);\n }\n});\nmodule.exports = SearchFieldView;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut whenever the textfield is changing I've got the error that the \u003ccode\u003eApp.ProductsController\u003c/code\u003e has no method \u003ccode\u003esearch\u003c/code\u003e. So I've got the feeling it is not the one I have created but the generated one.\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2013-07-23 20:58:35.637 UTC","favorite_count":"1","last_activity_date":"2013-07-24 05:16:12.567 UTC","last_edit_date":"2013-07-23 20:59:55.73 UTC","last_editor_display_name":"","last_editor_user_id":"445131","owner_display_name":"","owner_user_id":"184883","post_type_id":"1","score":"2","tags":"ember.js","view_count":"651"} +{"id":"17372039","title":"Sort a dictionary by key if the key exists, if it doesn't put it to the end of the list","body":"\u003cp\u003eBeen scratching my head on how to accomplish this,\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esorted_dict = sorted(dict['values'],\n key=lambda k: k['a']['b'])\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow in this dict some values of a have a b value, while some don't. I want it to sort by b values and if it doesn't exist, just put it at the back of the list. Is there anyway to do without some complex code such as splitting the values of a for those that have a b value and those that don't?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-06-28 19:14:43.107 UTC","last_activity_date":"2013-06-28 19:17:57.947 UTC","last_editor_display_name":"","owner_display_name":"user611105","post_type_id":"1","score":"1","tags":"python|python-2.7","view_count":"375"} +{"id":"7515233","title":"Is it better to give an NSMutableArray or to create an NSArray from it?","body":"\u003cp\u003eThis is a question that's been bothering me for a while.\u003c/p\u003e\n\n\u003cp\u003eI want to send some data in an NSArray to a viewController, and sometimes I need to create a NSMutableArray and populate it element by element.\u003c/p\u003e\n\n\u003cp\u003eIf I send it to the viewController, it will be useless, as it only needs to read the array. So I'm wondering if it's more expensive to send an NSMutableArray, or to create a (maybe?) more lightweight NSArray, with the cost of memory allocation, and releasing the (maybe?) heavier NSMutableArray.\u003c/p\u003e\n\n\u003cp\u003eBy the way, I know it's over optimization, but I'm curious.\u003c/p\u003e","accepted_answer_id":"7516920","answer_count":"4","comment_count":"0","creation_date":"2011-09-22 13:08:16.72 UTC","last_activity_date":"2011-09-23 09:55:49.503 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"183904","post_type_id":"1","score":"3","tags":"objective-c|ios|cocoa","view_count":"292"} +{"id":"36290990","title":"What is -33 in binary?","body":"\u003cp\u003eI was under the impression that it would be 10100001, but I am given a multiple choice question with the following options. What am I missing here?\u003c/p\u003e\n\n\u003cp\u003e11100011\u003c/p\u003e\n\n\u003cp\u003e10101011\u003c/p\u003e\n\n\u003cp\u003e11011111\u003c/p\u003e\n\n\u003cp\u003e11001100\u003c/p\u003e","accepted_answer_id":"36291056","answer_count":"2","comment_count":"0","creation_date":"2016-03-29 17:22:45.183 UTC","last_activity_date":"2016-03-29 17:47:18.273 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4272549","post_type_id":"1","score":"0","tags":"binary","view_count":"67"} +{"id":"29524907","title":"WPF mvvm property in viewmodel without setter?","body":"\u003cp\u003eI'm dealing with some WPF problems using and sticking to the MVVM pattern.\u003c/p\u003e\n\n\u003cp\u003eMost of my properties look like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic string Period\n{\n get { return _primaryModel.Period; }\n set\n {\n if (_primaryModel.Period != value)\n {\n _primaryModel.Period = value;\n RaisePropertyChanged(\"Period\");\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis works excellent.\u003c/p\u003e\n\n\u003cp\u003eHowever I also have some properties like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic bool EnableConsignor\n{\n get\n {\n return (ConsignorViewModel.Id != 0);\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt doesn't have a setter as the id is changed \"automatically\" (every time the save of \u003ccode\u003eConsignorViewModel\u003c/code\u003e is called. However this leads to the problem that the \"system\" doesn't know when the bool changes from false to true (as no \u003ccode\u003eRaisePropertyChanged\u003c/code\u003e is called).\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2015-04-08 20:38:52.987 UTC","favorite_count":"0","last_activity_date":"2017-03-30 01:08:16.2 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2081129","post_type_id":"1","score":"3","tags":"c#|wpf|mvvm","view_count":"943"} +{"id":"23459014","title":"Getting LibGDX to work in Eclipse","body":"\u003cp\u003eSo I've been trying to install libgdx for a few days with Eclipse and it kept telling me various things (Android ADT, Java JDK, etc.) needed to be updated, so I did that, but I kept getting the same error.\u003c/p\u003e\n\n\u003cp\u003eThen I decided to download an older version \u003ca href=\"http://libgdx.badlogicgames.com/releases/\" rel=\"nofollow\"\u003e(0.9.8)\u003c/a\u003e and I used the gdx-setup-ui.jar to set up my projects. But upon opening them in the Eclipse/ADT bundle, the Android and HTML projects had errors in them involving the import statements, which I tried to solve to no avail.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://www.gamefromscratch.com/post/2013/09/19/LibGDX-Tutorial-1-Creating-an-initial-project.aspx\" rel=\"nofollow\"\u003eThis\u003c/a\u003e is the tutorial I've mainly tried to follow.\u003c/p\u003e\n\n\u003cp\u003eDoes anybody have a solution for me to get it to work? I'm most familiar with Eclipse, having worked with it for Android for a while now, so I'd prefer not to switch IDEs.\u003c/p\u003e\n\n\u003cp\u003eThanks in Advance\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-05-04 17:01:57.95 UTC","last_activity_date":"2014-05-04 17:51:34.007 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3321488","post_type_id":"1","score":"0","tags":"android|html|eclipse|libgdx","view_count":"53"} +{"id":"17430173","title":"Slugs not working in Forms with GET method","body":"\u003cp\u003eThis is my routing:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emyapp_upgradeAccount:\n path: /upgradeAccount\n defaults: { _controller: myapp:UpgradeAccount:index }\n\nmyapp_checkUsernameForUpgrade:\n path: /upgradeAccount/check/{username}\n defaults: { _controller: myapp:UpgradeAccount:checkUsername }\n methods: [GET]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand this is my form\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;form method=\"get\" action=\"upgradeAccount/check\"\u0026gt;\n \u0026lt;label for=\"username\"\u0026gt;Insert your username:\u0026lt;/label\u0026gt;\n \u0026lt;input name=\"username\" type=\"text\"\u0026gt;\n \u0026lt;input id=\"chech-username-for-upgrade\" class=\"green\" type=\"submit\" value=\"Check\"\u0026gt;\n ...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut everytime I submit the form I get this error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eNo route found for \"GET /upgradeAccount/check\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe problem is that when I submit the form, I get the following URL:\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003ehttp://localhost/app_dev.php/upgradeAccount/check?username=123\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003ewhen i think I should be getting\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003ehttp://localhost/app_dev.php/upgradeAccount/check/123\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eIf I trz the latter manually, it works allright. What am I missing?\u003c/p\u003e","accepted_answer_id":"17430499","answer_count":"3","comment_count":"0","creation_date":"2013-07-02 15:55:06.663 UTC","last_activity_date":"2013-07-03 19:05:18.603 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"392684","post_type_id":"1","score":"0","tags":"symfony|routing","view_count":"738"} +{"id":"30403834","title":"Prolog combinatorics","body":"\u003cp\u003eIs there any way to generate all possibilities like 9 letters to be divided in 3 teams, like this: \u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003e1st team: 2 letters \u003c/li\u003e\n\u003cli\u003e2nd team: 3 letters \u003c/li\u003e\n\u003cli\u003e3rd team: 4 letters \u003c/li\u003e\n\u003cli\u003e?\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eExample:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efind([a, b, c, d, e, f, g, h, i], T1, T2, T3).\nT1 = [a, b]\nT2 = [c, d, e]\nT3 = [f, g, h, i]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNext generation should be the next combination, until there are no more combinations.\u003c/p\u003e","accepted_answer_id":"30404870","answer_count":"1","comment_count":"0","creation_date":"2015-05-22 18:46:05.517 UTC","last_activity_date":"2015-12-09 15:19:10.633 UTC","last_edit_date":"2015-12-09 15:19:10.633 UTC","last_editor_display_name":"","last_editor_user_id":"2546444","owner_display_name":"","owner_user_id":"2354689","post_type_id":"1","score":"-2","tags":"prolog|logic-programming","view_count":"273"} +{"id":"4500506","title":"PHP is truncating MSSQL Blob data (4096b), even after setting INI values. Am I missing one?","body":"\u003cp\u003eI am writing a PHP script that goes through a table and extracts the \u003ccode\u003evarbinary(max)\u003c/code\u003e blob data from each record into an external file. The code is working perfectly (I used virtually the same code to go through some images) except when a file is over 4096b - the data is truncated at exactly 4096.\u003c/p\u003e\n\n\u003cp\u003eI've modified the values for \u003ccode\u003emssql.textlimit\u003c/code\u003e, \u003ccode\u003emssql.textsize\u003c/code\u003e, and \u003ccode\u003eodbc.defaultlrl\u003c/code\u003e without any success. \u003c/p\u003e\n\n\u003cp\u003eAm I missing something here?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php \n ini_set(\"mssql.textlimit\" , \"2147483647\");\n ini_set(\"mssql.textsize\" , \"2147483647\");\n ini_set(\"odbc.defaultlrl\", \"0\");\n\n include_once('common.php'); //Connection to DB takes place here.\n $id=$_REQUEST['i'];\n $q = odbc_exec($connect, \"Select id,filename,documentBin from Projectdocuments where id = $id\"); \n if (odbc_fetch_row($q)){\n\n echo \"Trying $filename ... \";\n $fileName=\"projectPhotos/docs/\".odbc_result($q,\"filename\");\n\n if (file_exists($fileName)){\n unlink($fileName);\n } \n\n if($fh = fopen($fileName, \"wb\")) {\n $binData=odbc_result($q,\"documentBin\");\n fwrite($fh, $binData) ;\n fclose($fh);\n $size = filesize($fileName);\n echo (\"$fileName\u0026lt;br /\u0026gt;Done ($size)\u0026lt;br\u0026gt;\u0026lt;br\u0026gt;\");\n }else {\n echo (\"$fileName Failed\u0026lt;br\u0026gt;\");\n }\n } \n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eOUTPUT\u003c/strong\u003e\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eTrying ... projectPhotos/docs/file1.pdf\n Done (4096)\u003c/p\u003e\n \n \u003cp\u003eTrying ... projectPhotos/docs/file2.zip Done (4096)\u003c/p\u003e\n \n \u003cp\u003eTrying ...\n projectPhotos/docsv3.pdf Done (4096)\u003c/p\u003e\n \n \u003cp\u003eetc..\u003c/p\u003e\n\u003c/blockquote\u003e","accepted_answer_id":"4500598","answer_count":"4","comment_count":"0","creation_date":"2010-12-21 14:51:18.327 UTC","last_activity_date":"2015-09-04 18:51:21.77 UTC","last_edit_date":"2010-12-21 15:02:25.61 UTC","last_editor_display_name":"","last_editor_user_id":"83809","owner_display_name":"","owner_user_id":"83809","post_type_id":"1","score":"2","tags":"sql|blob|php|truncation","view_count":"5023"} +{"id":"1901087","title":"how to get Compiler error message? asp.net","body":"\u003cp\u003ehow can I get Compiler Error Message if a have pageUrl.\u003c/p\u003e\n\n\u003cp\u003eI'm tried using HttpWebRequest class, but haven't get result yet.\u003c/p\u003e\n\n\u003cp\u003eProblem that, i have collection of pages, than must execute automatically. and if page fails, create log.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://content.screencast.com/users/Telman/folders/Jing/media/c8f358e3-0d95-4c1a-9dae-c98e2dec4456/2009-12-14_1854.png\" rel=\"nofollow noreferrer\"\u003ealt text http://content.screencast.com/users/Telman/folders/Jing/media/c8f358e3-0d95-4c1a-9dae-c98e2dec4456/2009-12-14_1854.png\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003ethank you\u003c/p\u003e","answer_count":"5","comment_count":"1","creation_date":"2009-12-14 13:58:07.883 UTC","favorite_count":"1","last_activity_date":"2009-12-14 15:03:07.89 UTC","last_edit_date":"2009-12-14 15:02:28.003 UTC","last_editor_display_name":"","last_editor_user_id":"211452","owner_display_name":"","owner_user_id":"211452","post_type_id":"1","score":"1","tags":"c#|asp.net|.net-3.5|logging","view_count":"417"} +{"id":"11177676","title":"Two public classes in one file java","body":"\u003cp\u003eOk, this might be kiddies question in java. We can't define two public classes in one file. But, in one of the examples from the book SCJP study guide, this example was mentioned:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic abstract class A{\n public abstract void show(String data);\n}\n\npublic class B extends A{\n public void show(String data){\n System.out.println(\"The string data is \"+data);\n }\n public static void main(String [] args){\n B b = new B();\n b.show(\"Some sample string data\");\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I copy pasted this into netbeans immediately compile error was thrown, that public class A should me mentioned in separate file. Is that example from SCJP styudy guide really wrong? Also in some of the mock test I found many questions having such pattern but in none of the options was a compiler error was mentioned. Getting worried here\u003c/p\u003e","accepted_answer_id":"11177688","answer_count":"5","comment_count":"9","creation_date":"2012-06-24 13:04:04.687 UTC","favorite_count":"1","last_activity_date":"2015-01-15 14:11:18.377 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"877942","post_type_id":"1","score":"7","tags":"java","view_count":"22596"} +{"id":"18903443","title":"URL rewrite confusion","body":"\u003cp\u003ei have a htaccess file to help rewrite my url of ../players.php?first_name=Richard\u0026amp;last_name=Marston this gives me the url of ../Richard%20Marston, here is my .htaccess file contents\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eOptions +FollowSymlinks\nRewriteEngine On\nRewriteCond %{REQUEST_FILENAME} !-f\nRewriteCond %{REQUEST_FILENAME} !-d\nRewriteRule ^(.*)$ players.php?first_name=$1\u0026amp;last_name=$2\n\nIndexIgnore *\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ecan someone help and amend my current .htaccess file so it reads without the %20 and instead either with no gap such as ../RichardMarston ... or with a - such as ../Richard-Marston for profile pages\u003c/p\u003e\n\n\u003cp\u003eMuch appreciated\u003c/p\u003e","accepted_answer_id":"18903511","answer_count":"2","comment_count":"1","creation_date":"2013-09-19 19:36:23.737 UTC","last_activity_date":"2013-09-19 19:40:57.683 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2188631","post_type_id":"1","score":"0","tags":"php|.htaccess|mod-rewrite","view_count":"37"} +{"id":"28655898","title":"distinguish between two elements in html code","body":"\u003cp\u003eI am trying to understand how to distinguish between two buttons in my document, I want it to behave so that in addition to hiding the paragraphs, it also hides just the \u003cem\u003e\"Click Me!\"\u003c/em\u003e button when clicking \u003cem\u003e\"Hide\u003c/em\u003e\". Where am I going wrong?\u003c/p\u003e\n\n\u003cpre class=\"lang-html prettyprint-override\"\u003e\u003ccode\u003e\u0026lt;!DOCTYPE html\u0026gt;\n\u0026lt;html\u0026gt;\n \u0026lt;head\u0026gt;\n \u0026lt;script src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;script\u0026gt;\n $(document).ready(function(){\n $(\"button\").click(function(){\n $(\"p\").hide(1000);\n $(\"button name='me'\").hide(1000);\n });\n });\n \u0026lt;/script\u0026gt;\n \u0026lt;/head\u0026gt;\n \u0026lt;body\u0026gt;\n \u0026lt;button name=\"me\" type=\"button\" \n onclick=\"alert('Hello world!')\"\u0026gt;Click Me!\u0026lt;/button\u0026gt;\n\n \u0026lt;button\u0026gt;Hide\u0026lt;/button\u0026gt;\n \u0026lt;p\u0026gt;This is a paragraph with little content.\u0026lt;/p\u0026gt;\n \u0026lt;p\u0026gt;This is another small paragraph.\u0026lt;/p\u0026gt;\n \u0026lt;/body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"28655953","answer_count":"2","comment_count":"0","creation_date":"2015-02-22 08:19:36.527 UTC","last_activity_date":"2015-02-22 09:01:23.76 UTC","last_edit_date":"2015-02-22 09:01:23.76 UTC","last_editor_display_name":"","last_editor_user_id":"1238344","owner_display_name":"","owner_user_id":"4207672","post_type_id":"1","score":"0","tags":"javascript|jquery|html","view_count":"45"} +{"id":"19156163","title":"OnClick in Fragment not responding","body":"\u003cp\u003eI'm having an issue with setting up a OnClick within a fragment to my ImageView XML.\u003c/p\u003e\n\n\u003cp\u003eI have a ViewPager that displays a ImageView and a Progress bar inside when the app is running to display images that you can swipe through. \u003c/p\u003e\n\n\u003cp\u003eI am aiming to make it so when the user clicks on the image that is currently being displayed,\nit comes up with a toast message. \u003c/p\u003e\n\n\u003cp\u003eThe problem I am having is that nothing happens once I click on the image that is currently in view.\u003c/p\u003e\n\n\u003cp\u003eAny help would be great, thanks.\u003c/p\u003e\n\n\u003cp\u003eXML to fragment that controls ImageView and Progress bar:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" encoding=\"utf-8\"?\u0026gt;\n\u0026lt;FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\nandroid:layout_width=\"fill_parent\"\nandroid:layout_height=\"fill_parent\" \u0026gt;\n\n\u0026lt;ProgressBar\n style=\"?android:attr/progressBarStyleLarge\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_gravity=\"center\" /\u0026gt;\n\nRecyclingImageView\n android:id=\"@+id/imageView\"\n android:layout_width=\"fill_parent\"\n android:layout_height=\"fill_parent\"\n android:contentDescription=\"@string/imageview_description\" /\u0026gt;\n\n\u0026lt;/FrameLayout\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFragment that controls ImageView:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class ImageDetailFragment extends Fragment {\nprivate static final String IMAGE_DATA_EXTRA = \"extra_image_data\";\nprivate String mImageUrl;\nprivate RecyclingImageView mImageView;\nprivate ImageFetcher mImageFetcher;\n\npublic static ImageDetailFragment newInstance(String imageUrl) {\n final ImageDetailFragment f = new ImageDetailFragment();\n\n final Bundle args = new Bundle();\n args.putString(IMAGE_DATA_EXTRA, imageUrl);\n f.setArguments(args);\n\n return f;\n}\n\npublic ImageDetailFragment() {\n}\n\n@Override\npublic void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n mImageUrl = getArguments() != null ? getArguments().getString(\n IMAGE_DATA_EXTRA) : null;\n}\n\n\n\n@Override\npublic View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n\n final View v = inflater.inflate(R.layout.image_detail_fragment,\n container, false);\n\n mImageView = (RecyclingImageView) v.findViewById(R.id.imageView);\n mImageView.setOnClickListener(new OnClickListener() {\n @Override\n public void onClick(View arg0) {\n Toast.makeText(getActivity(), \"Cilcked..\",Toast.LENGTH_SHORT).show();\n }\n });\n\nreturn v;\n }\n\n@Override\npublic void onActivityCreated(Bundle savedInstanceState) {\n super.onActivityCreated(savedInstanceState);\n\n if (Batmanark.class.isInstance(getActivity())) {\n mImageFetcher = ((Batmanark) getActivity()).getImageFetcher();\n mImageFetcher.loadImage(mImageUrl, mImageView);\n }\n\n // Pass clicks on the ImageView to the parent activity to handle\n if (OnClickListener.class.isInstance(getActivity())\n \u0026amp;\u0026amp; Utils.hasHoneycomb()) {\n mImageView.setOnClickListener((OnClickListener) getActivity());\n }\n}\n\n@Override\npublic void onDestroy() {\n super.onDestroy();\n if (mImageView != null) {\n // Cancel any pending image work\n ImageWorker.cancelWork(mImageView);\n mImageView.setImageDrawable(null);\n }\n}\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eViewPager XML:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" encoding=\"utf-8\"?\u0026gt;\n\u0026lt;RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\nxmlns:ads=\"http://schemas.android.com/apk/lib/com.google.ads\"\nandroid:id=\"@+id/rellayout\"\nandroid:layout_width=\"fill_parent\"\nandroid:layout_height=\"fill_parent\" \u0026gt;\n\nViewPager\n android:id=\"@+id/pager\"\nandroid:layout_width=\"fill_parent\"\nandroid:layout_height=\"fill_parent\" \u0026gt;\n\u0026lt;/android.support.v4.view.ViewPager\u0026gt;\n\n\u0026lt;com.google.ads.AdView\nandroid:id=\"@+id/ad\"\nandroid:layout_width=\"wrap_content\"\nandroid:layout_height=\"wrap_content\"\nandroid:layout_alignParentBottom=\"true\"\nandroid:layout_centerHorizontal=\"true\"\nads:adSize=\"BANNER\"\nads:adUnitId=\"AdIdHere\"\nads:loadAdOnCreate=\"true\" \u0026gt;\n\u0026lt;/com.google.ads.AdView\u0026gt;\n\n\n\u0026lt;/RelativeLayout\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eViewPager Class:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class Batmanark extends FragmentActivity implements OnClickListener {\nprivate static final String IMAGE_CACHE_DIR = \"images\";\npublic static final String EXTRA_IMAGE = \"extra_image\";\n\nprivate ImagePagerAdapter mAdapter;\nprivate ImageFetcher mImageFetcher;\nprivate ViewPager mPager;\n\n@TargetApi(11)\n@Override\npublic void onCreate(Bundle savedInstanceState) {\n if (BuildConfig.DEBUG) {\n Utils.enableStrictMode();\n }\n super.onCreate(savedInstanceState);\n setContentView(R.layout.image_detail_pager);\n\n AdView ad = (AdView) findViewById(R.id.ad);\n ad.loadAd(new AdRequest());\n\n final DisplayMetrics displayMetrics = new DisplayMetrics();\n getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);\n final int height = displayMetrics.heightPixels;\n final int width = displayMetrics.widthPixels;\n\n\n final int longest = (height \u0026gt; width ? height : width) / 2;\n\n ImageCache.ImageCacheParams cacheParams = new ImageCache.ImageCacheParams(\n this, IMAGE_CACHE_DIR);\n cacheParams.setMemCacheSizePercent(0.25f); \n\n\n mImageFetcher = new ImageFetcher(this, longest);\n mImageFetcher.addImageCache(getSupportFragmentManager(), cacheParams);\n mImageFetcher.setImageFadeIn(false);\n\n\n mAdapter = new ImagePagerAdapter(getSupportFragmentManager(),\n Images.imageUrlsBatmanark.length);\n mPager = (ViewPager) findViewById(R.id.pager);\n mPager.setAdapter(mAdapter);\n mPager.setPageMargin((int) getResources().getDimension(\n R.dimen.image_detail_pager_margin));\n mPager.setOffscreenPageLimit(2);\n\n\n getWindow().addFlags(LayoutParams.FLAG_FULLSCREEN);\n\n\n if (Utils.hasHoneycomb()) {\n final ActionBar actionBar = getActionBar();\n\n\n actionBar.setDisplayShowTitleEnabled(false);\n actionBar.setDisplayHomeAsUpEnabled(true);\n\n\n mPager.setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener() {\n @Override\n public void onSystemUiVisibilityChange(int vis) {\n if ((vis \u0026amp; View.SYSTEM_UI_FLAG_LOW_PROFILE) != 0) {\n actionBar.hide();\n } else {\n actionBar.show();\n }\n }\n });\n\n\n mPager.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);\n actionBar.hide();\n }\n\n\n final int extraCurrentItem = getIntent().getIntExtra(EXTRA_IMAGE, -1);\n if (extraCurrentItem != -1) {\n mPager.setCurrentItem(extraCurrentItem);\n }\n}\n\n@Override\npublic void onResume() {\n super.onResume();\n mImageFetcher.setExitTasksEarly(false);\n}\n\n@Override\nprotected void onPause() {\n super.onPause();\n mImageFetcher.setExitTasksEarly(true);\n mImageFetcher.flushCache();\n}\n\n@Override\nprotected void onDestroy() {\n super.onDestroy();\n mImageFetcher.closeCache();\n}\n\n@Override\npublic boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n NavUtils.navigateUpFromSameTask(this);\n return true;\n case R.id.clear_cache:\n mImageFetcher.clearCache();\n Toast.makeText(this, R.string.clear_cache_complete_toast,\n Toast.LENGTH_SHORT).show();\n return true;\n }\n return super.onOptionsItemSelected(item);\n}\n\n@Override\npublic boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n return true;\n}\n\npublic ImageFetcher getImageFetcher() {\n return mImageFetcher;\n}\n\n\nprivate class ImagePagerAdapter extends FragmentStatePagerAdapter {\n private final int mSize;\n\n public ImagePagerAdapter(FragmentManager fm, int size) {\n super(fm);\n mSize = size;\n }\n\n @Override\n public int getCount() {\n return mSize;\n }\n\n @Override\n public Fragment getItem(int position) {\n return ImageDetailFragment\n .newInstance(Images.imageUrlsBatmanark[position]);\n }\n}\n\n\n@TargetApi(11)\n@Override\npublic void onClick(View v) {\n final int vis = mPager.getSystemUiVisibility();\n if ((vis \u0026amp; View.SYSTEM_UI_FLAG_LOW_PROFILE) != 0) {\n mPager.setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);\n } else {\n mPager.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);\n }\n}\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"19156601","answer_count":"2","comment_count":"1","creation_date":"2013-10-03 09:57:03.143 UTC","favorite_count":"1","last_activity_date":"2013-10-05 17:02:25.24 UTC","last_edit_date":"2013-10-05 17:02:25.24 UTC","last_editor_display_name":"","last_editor_user_id":"2657363","owner_display_name":"","owner_user_id":"2657363","post_type_id":"1","score":"0","tags":"android|android-fragments|uiimageview|onclick","view_count":"3746"} +{"id":"10745095","title":"Printing ASCII file from R via ASCII file editor","body":"\u003cp\u003eI am using R (windows) and have a function that creates an ASCII file using \u003ccode\u003esink()\u003c/code\u003e. I then try and print the file using the system command:\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003esystem(paste('\"c:/Program files (x86)/IDM Computer Solutions/UltraEdit/uedit32.exe\"',' /p d:/R/rtmpfile.prt'), intern=TRUE)\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eThe above goes through the motions but does not actually print anything (although once in a while it actually prints). However, if I open up a command window and execute the same command as a batch file it always prints OK (i.e. \u003ccode\u003ec:\\program files (x86)\\idm computer solutions\\ultraedit\\uedit32.exe /p d:\\R\\rtmpfile.prt\u003c/code\u003e).\u003c/p\u003e\n\n\u003cp\u003eIn short, I want to send an ASCII file saved in a folder to my local printer (and do so using an R function). Any suggestions? \u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2012-05-24 20:52:12.253 UTC","last_activity_date":"2012-05-25 17:55:55.41 UTC","last_edit_date":"2012-05-25 17:55:55.41 UTC","last_editor_display_name":"","last_editor_user_id":"850152","owner_display_name":"","owner_user_id":"1416022","post_type_id":"1","score":"0","tags":"r","view_count":"145"} +{"id":"23652820","title":"How to make handsontable table zebra striped?","body":"\u003cp\u003eI'm displaying some data in table by using handsontable library. Normally i can zebra stripe an html table like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e.zebraStyle {\n tr:nth-child(even) {background: #CCC}\n tr:nth-child(odd) {background: #FFF}\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut with handsontable i display my table within div element. How can i do this? Below you can see my html code:\u003c/p\u003e\n\n\u003cp\u003e\n\n \n \n \n \n \n \n \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;style type=\"text/css\"\u0026gt;\n body {background: white; margin: 20px;}\n h2 {margin: 20px 0;}\n .zebraStyle tr:nth-child(even) {background: #CCC}\n .zebraStyle tr:nth-child(odd) {background: #FFF}\n \u0026lt;/style\u0026gt;\n\n \u0026lt;script type='text/javascript'\u0026gt;\n var arr= [[\"\", \"2012\", \"2013\", \"2014(YTD)\"],[\"Ferrari\", 1460089088.3900001, 1637243070.99, 283566771.55000001],[\"Alfa Romeo\", 1199141138.1900001, 1224624821.1500001, 192307335.49000001]];\n $(document).ready( function(){\n $('#myTable').handsontable({\n data: arr,\n minSpareRows: 1,\n contextMenu: true,\n readOnly: true,\n fixedColumnsLeft: 1\n });\n $('#myTable').find('table').addClass('zebraStyle');\n });\n \u0026lt;/script\u0026gt;\n\u0026lt;/head\u0026gt;\n\u0026lt;body\u0026gt;\n \u0026lt;div id=\"myTable\" class=\"handsontable\" style=\"width: 400px; margin-left:auto; margin-right:auto; background-color:silver\"\u0026gt;\u0026lt;/div\u0026gt;\n\u0026lt;/body\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003c/p\u003e","accepted_answer_id":"23655159","answer_count":"2","comment_count":"11","creation_date":"2014-05-14 11:03:46.803 UTC","last_activity_date":"2015-12-03 22:52:37 UTC","last_edit_date":"2014-05-14 12:25:44.67 UTC","last_editor_display_name":"","last_editor_user_id":"1450201","owner_display_name":"","owner_user_id":"1450201","post_type_id":"1","score":"2","tags":"javascript|jquery|css|handsontable|zebra-striping","view_count":"1163"} +{"id":"17817286","title":"How to update ListView in Android after an IntentService returns something to an ResultReceiver","body":"\u003cp\u003ePerhaps the reason I can't find an answer to this, is that I'm doing the question the wrong way, but still I hope that here on SO someone can answer this.\u003c/p\u003e\n\n\u003cp\u003eI have a MainActivity with a ListView that present some values - after processing - from a database:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class MainActivity extends Activity {\nListView mainViewList;\n CTTObjectsArrayAdapter arrayAdapter;\n ArrayList\u0026lt;CTTObject\u0026gt; cttObjects = null;\n public UpdateObjectResultReceiver updateObjectReceiver;\n\n@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n\n // Update all the Objects in the DB\n CTTUtilities.updateAllObjects(context, updateObjectReceiver);\n // DB stuff\n CTTObjectsDataSource dataSource = new CTTObjectsDataSource(context);\n dataSource.open();\n\n // Initialize ListView\n mainViewList = (ListView) findViewById(R.id.listMain);\n\n // Initialize our ArrayList\n cttObjects = new ArrayList\u0026lt;CTTObject\u0026gt;();\n cttObjects = dataSource.getAllObjects();\n dataSource.close();\n\n // Initialize our array adapter notice how it references the\n // listMain.xml layout\n arrayAdapter = new CTTObjectsArrayAdapter(context,\n R.layout.main_list_row_layout, cttObjects);\n\n // Set the above adapter as the adapter of choice for our list\n mainViewList.setAdapter(arrayAdapter);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow, what I need, is to call the following snippet that updates the ListView when the updateObjectReceiver variable receives an answer from the Intent Service that I started and that updated the database:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecttObjects.clear();\nCTTObjectsDataSource dataSource = new CTTObjectsDataSource(context);\ndataSource.open();\ncttObjects.addAll(dataSource.getAllObjects());\ndataSource.close();\narrayAdapter.notifyDataSetChanged();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow can I do this then?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eAfter implementing the receiver.send and the method proposed below, the app fails with:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e07-23 20:30:40.435: W/dalvikvm(3467): threadid=15: thread exiting with uncaught exception (group=0x40c88930)\n07-23 20:30:40.435: E/AndroidRuntime(3467): FATAL EXCEPTION: IntentService[UpdateObjectIntentService]\n07-23 20:30:40.435: E/AndroidRuntime(3467): java.lang.NullPointerException\n07-23 20:30:40.435: E/AndroidRuntime(3467): at info.hecatosoft.ctttrack2.UpdateObjectIntentService.onHandleIntent(UpdateObjectIntentService.java:89)\n07-23 20:30:40.435: E/AndroidRuntime(3467): at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)\n07-23 20:30:40.435: E/AndroidRuntime(3467): at android.os.Handler.dispatchMessage(Handler.java:99)\n07-23 20:30:40.435: E/AndroidRuntime(3467): at android.os.Looper.loop(Looper.java:137)\n07-23 20:30:40.435: E/AndroidRuntime(3467): at android.os.HandlerThread.run(HandlerThread.java:60)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT 2:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eIt fails in the line: \u003ccode\u003ereceiver.send(STATUS_UPDATED_CHANGED, Bundle.EMPTY);\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eThe code in question is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@Override\n protected void onHandleIntent(Intent arg0) {\n // ---process the received extras to the service call and get the URL\n // from it---\n this.receiver = arg0.getParcelableExtra(RECEIVER_KEY);\n String recTrackNo = arg0.getStringExtra(\"trackNo\");\n Log.i(\"jbssmDeveloper\", \"received trackNo=\" + recTrackNo);\n\n String jsonDataString = null;\n\n jsonDataString = getHTTPJSONData(recTrackNo);\n\n if (jsonDataString != null) {\n dataSource = new CTTObjectsDataSource(getBaseContext());\n dataSource.open();\n CTTObject cttObject = dataSource\n .getObjectWithTrackNo(recTrackNo);\n dataSource.close();\n updateDB(cttObject, jsonDataString);\n receiver.send(STATUS_UPDATED_CHANGED, Bundle.EMPTY);\n }\n receiver.send(STATUS_ERROR, Bundle.EMPTY);\n this.stopSelf();\n }\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"17817431","answer_count":"2","comment_count":"8","creation_date":"2013-07-23 17:42:03.177 UTC","last_activity_date":"2013-07-23 19:40:02.823 UTC","last_edit_date":"2013-07-23 19:40:02.823 UTC","last_editor_display_name":"","last_editor_user_id":"865662","owner_display_name":"","owner_user_id":"865662","post_type_id":"1","score":"2","tags":"android|database|listview|intentservice","view_count":"1279"} +{"id":"9459761","title":"CGContextSetShadowWithColor not working","body":"\u003cp\u003eThis code should be showing a shadow, but it isn't:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCGContextRef context = UIGraphicsGetCurrentContext();\n\n//Border\nCGMutablePathRef outerPath = createRoundedRectForRect(self.bounds, MENU_BUTTON_OUTER_RADIUS);\n\nCGContextSetFillColorWithColor(context, [[UIColor colorWithWhite:0 alpha:0.18] CGColor]);\nCGContextAddPath(context, outerPath);\nCGContextFillPath(context);\n\n//Button\n\nUIColor *buttonColor;\nif (self.type == JMenuButtonTypeBlack) {\n buttonColor = [UIColor colorWithWhite:0 alpha:1.0];\n}\nelse if (self.type == JMenuButtonTypeWhite) {\n buttonColor = [UIColor colorWithWhite:0.72 alpha:1.0];\n}\n\nCGRect insideRect = rectForRectWithInset(self.bounds, 3);\n\nCGMutablePathRef innerPath = createRoundedRectForRect(insideRect, MENU_BUTTON_INNER_RADIUS);\nCGPoint gradientTop = CGPointMake(0, insideRect.origin.y);\nCGPoint gradientBottom = CGPointMake(0, insideRect.origin.y + insideRect.size.height);\n\n//Base color\nCGContextSaveGState(context);\nCGContextSetFillColorWithColor(context, [buttonColor CGColor]);\nCGContextAddPath(context, innerPath);\nCGContextFillPath(context);\nCGContextRestoreGState(context);\n\n//Gradient 1\nCGContextSaveGState(context);\n\nCGFloat colors [] = { \n 1.0, 1.0, 1.0, 0.16, \n 0.0, 0.0, 0.0, 0.11\n};\n\nCGColorSpaceRef baseSpace = CGColorSpaceCreateDeviceRGB();\nCGGradientRef gradient = CGGradientCreateWithColorComponents(baseSpace, colors, NULL, 2);\n\nCGContextAddPath(context, innerPath);\nCGContextClip(context);\n\nCGContextDrawLinearGradient(context, gradient, gradientTop, gradientBottom, 0);\nCGGradientRelease(gradient), gradient = NULL;\nCGColorSpaceRelease(baseSpace), baseSpace = NULL;\n\nCGContextRestoreGState(context);\n\n\n//Shadow\nCGContextSaveGState(context);\nCGContextAddPath(context, innerPath);\nCGContextSetShadowWithColor(context, CGSizeMake(0, 2), 3.0, [[UIColor blackColor] CGColor]);\nCGContextRestoreGState(context);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is what it looks like so far. The shadow code doesn't make a difference:\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/nGCj3.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e","accepted_answer_id":"9459854","answer_count":"1","comment_count":"0","creation_date":"2012-02-27 03:40:41.85 UTC","last_activity_date":"2012-02-27 16:35:59.25 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"561395","post_type_id":"1","score":"-1","tags":"iphone|objective-c|core-graphics","view_count":"2492"} +{"id":"21757554","title":"Solve tasks in PHP and then redirect to another PHP file","body":"\u003cp\u003eSo im currently programming a register form, which passes variables with the entered informations to another php file through POST. Well, im performing some checks in this PHP file and whould like to pass the variables after that to the next register form on another php site.\u003c/p\u003e\n\n\u003cp\u003eIs this somehow possible ? \u003c/p\u003e\n\n\u003cp\u003eI will be thankfull for every answer i get!\u003c/p\u003e\n\n\u003cp\u003e-english is not my main language.\u003c/p\u003e","accepted_answer_id":"21757663","answer_count":"1","comment_count":"8","creation_date":"2014-02-13 14:52:34.837 UTC","last_activity_date":"2014-02-13 14:56:32.473 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3306537","post_type_id":"1","score":"0","tags":"php|variables|redirect|task","view_count":"72"} +{"id":"41295013","title":"500: Backend Error on Google Search Console API (webmasters/v3)","body":"\u003cp\u003eI use node.js to query data from search console api. I get response status 500 and message \"backend error\".\u003c/p\u003e\n\n\u003cp\u003eI have tried some solutions but they did not work:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003echeck API key(set key restriction to \"none\" because I do not have ipv6 address)\u003c/li\u003e\n\u003cli\u003esend json data instead of js object\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eBelow is my code snippet. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e var data = {\n startDate: '2016-12-01',\n endDate: '2016-12-20',\n dimensions: ['query'],\n rowLimit: '1000'\n };\n\n var options = {\n url: 'https://content.googleapis.com/webmasters/v3/sites/' + siteUrl +'/searchAnalytics/query?key=' + apiKey + '\u0026amp;access_token=' + accessToken,\n headers: {\n 'content-type': 'application/json',\n },\n json: true,\n method: 'post',\n body: JSON.stringify(data)\n };\n\n function callback(error, response, body) {\n if(!error \u0026amp;\u0026amp; response.statusCode == 200) {\n console.log(response);\n } else {\n console.log(body.error.code + ': ' + response.statusMessage + ' (' + body.error.message + ')');\n }\n }\n\n request(options, callback);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny ideas?\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2016-12-23 04:01:53.693 UTC","last_activity_date":"2016-12-23 04:01:53.693 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2481793","post_type_id":"1","score":"0","tags":"google-api|google-api-webmasters","view_count":"177"} +{"id":"33136957","title":"Alternative to itertools.tee in python","body":"\u003cp\u003eI'm doing some processing of large input data split over several files. Trying to separate the processing algorithms from the I/O, I set everything up using generators. This works pretty well except when I want to do some intermediate manipulations of the data passing through the generators. Here's an example that hits the important points\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport numpy as np\nfrom itertools import izip, tee\n\n# Have two input matrices. In reality they're very large, so data is provided\n# one row at a time via generators.\nM, N = 100, 3\ndef gen_data_rows(m,n):\n for i in range(m):\n yield np.random.normal(size=n)\n\nrows1 = gen_data_rows(M,N)\nrows2 = gen_data_rows(M,N)\n\n# Signal processing operates on chunks of the input, e.g. blocks of rows and\n# yields results at a reduced rate. Here's a simple example.\ndef foo_rows(rows):\n i = 0\n for row in rows:\n if i % 5 == 0:\n yield row\n i += 1\n\n# But what if we want to do some transformations between the raw input data\n# and the processing?\ndef fun1(x, y):\n return x + y\n\ndef fun2(x, y):\n return (x + y)**2\n\ndef foo_transformed_rows(rows1, rows2):\n # Define a generator that consumes both inputs at the same time and\n # produces two streams of output I'd like to send to foo_rows().\n def gen_transformed_rows(rows1, rows2):\n for x, y in izip(rows1, rows2):\n yield fun1(x,y), fun2(x,y)\n\n # Do I really need to tee the above and define separate generators to pick\n # off each result?\n def pick_generator_idx(gen, i):\n for vals in gen:\n yield vals[i]\n\n gen_xformed_rows, dupe = tee(gen_transformed_rows(rows1, rows2))\n gen_foo_fun1 = foo_rows(pick_generator_idx(gen_xformed_rows, 0))\n gen_foo_fun2 = foo_rows(pick_generator_idx(dupe, 1))\n for foo1, foo2 in izip(gen_foo_fun1, gen_foo_fun2):\n yield foo1, foo2\n\n\nfor foo1, foo2 in foo_transformed_rows(rows1, rows2):\n print foo1, foo2\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI think the main complication here is that I've got two inputs that I want to combine into two intermediate generators (I/O is the bottleneck, so I really don't want to run through the data twice). Is there a better way to implement the \u003ccode\u003efoo_transformed_rows()\u003c/code\u003e function? Having to \u003ccode\u003etee()\u003c/code\u003e the the desired data and define generators just to pick items out of a tuple seems like overkill.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdit\u003c/strong\u003e: I modified the example slightly in response to a comment, but unfortunately it's still pretty long in order to remain complete. The essential problem is dealing with a multi-input-multi-output (MIMO) data stream. I guess I'd like something like a \u003ccode\u003eyield\u003c/code\u003e statement that produces multiple generators, e.g.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef two_streams(gen_a, gen_b):\n \"Consumes two generators, produces two results.\"\n for a, b in itertools.izip(gen_a, gen_b):\n c, d = foo(a, b)\n yield c, d\n\n# This doesn't work. You get one generator of tuples instead of\n# two generators of singletons.\ngen_c, gen_d = two_streams(gen_a, gen_b)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI thought maybe there would be some itertools magic to do the equivalent.\u003c/p\u003e","accepted_answer_id":"33138402","answer_count":"1","comment_count":"2","creation_date":"2015-10-14 22:47:40.53 UTC","last_activity_date":"2015-10-15 01:38:19.073 UTC","last_edit_date":"2015-10-15 00:56:09.047 UTC","last_editor_display_name":"","last_editor_user_id":"112699","owner_display_name":"","owner_user_id":"112699","post_type_id":"1","score":"2","tags":"python|itertools","view_count":"152"} +{"id":"10031482","title":"GlassFish JSF : IndexOutOfBoundsException no personalized classes in trace","body":"\u003cp\u003eI'm having an issue with a GlassFish server I am running. It seems to be \"crashing\" or stops responding after a while, espeacially under heavy load. I have gone back to check my application and make sure it is not the application itself that is creating this. I've been going through the log files of the server and keep finding this error all the time :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ejava.lang.IndexOutOfBoundsException: Index: 0, Size: 0\n at java.util.ArrayList.rangeCheck(ArrayList.java:604)\n at java.util.ArrayList.get(ArrayList.java:382)\n at javax.faces.component.AttachedObjectListHolder.restoreState(AttachedObjectListHolder.java:165)\n at javax.faces.component.UIComponentBase.restoreState(UIComponentBase.java:1560)\n at javax.faces.component.UIOutput.restoreState(UIOutput.java:256)\n at com.sun.faces.application.view.StateManagementStrategyImpl$2.visit(StateManagementStrategyImpl.java:267)\n at com.sun.faces.component.visit.FullVisitContext.invokeVisitCallback(FullVisitContext.java:151)\n at javax.faces.component.UIComponent.visitTree(UIComponent.java:1590)\n at javax.faces.component.UIComponent.visitTree(UIComponent.java:1601)\n at javax.faces.component.UIComponent.visitTree(UIComponent.java:1601)\n at com.sun.faces.application.view.StateManagementStrategyImpl.restoreView(StateManagementStrategyImpl.java:254)\n at com.sun.faces.application.StateManagerImpl.restoreView(StateManagerImpl.java:188)\n at com.sun.faces.application.view.ViewHandlingStrategy.restoreView(ViewHandlingStrategy.java:123)\n at com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(FaceletViewHandlingStrategy.java:453)\n at com.sun.faces.application.view.MultiViewHandler.restoreView(MultiViewHandler.java:148)\n at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:303)\n at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:192)\n at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)\n at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116)\n at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)\n at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)\n at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1542)\n at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)\n at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)\n at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)\n at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)\n at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)\n at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)\n at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)\n at com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:131)\n at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:328)\n at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)\n at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)\n at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)\n at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)\n at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746)\n at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)\n at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)\n at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)\n at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)\n at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)\n at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)\n at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)\n at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)\n at com.sun.grizzly.ContextTask.run(ContextTask.java:71)\n at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)\n at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)\n at java.lang.Thread.run(Thread.java:722)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT\u003c/strong\u003e: Other logs :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ejava.util.zip.ZipException: Not in GZIP format\n at java.util.zip.GZIPInputStream.readHeader(GZIPInputStream.java:164)\n at java.util.zip.GZIPInputStream.\u0026lt;init\u0026gt;(GZIPInputStream.java:78)\n at java.util.zip.GZIPInputStream.\u0026lt;init\u0026gt;(GZIPInputStream.java:90)\n at com.sun.faces.renderkit.ClientSideStateHelper.doGetState(ClientSideStateHelper.java:231)\n at com.sun.faces.renderkit.ClientSideStateHelper.getState(ClientSideStateHelper.java:198)\n at com.sun.faces.renderkit.ResponseStateManagerImpl.getState(ResponseStateManagerImpl.java:100)\n at com.sun.faces.application.view.StateManagementStrategyImpl.restoreView(StateManagementStrategyImpl.java:227)\n at com.sun.faces.application.StateManagerImpl.restoreView(StateManagerImpl.java:188)\n at com.sun.faces.application.view.ViewHandlingStrategy.restoreView(ViewHandlingStrategy.java:123)\n at com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(FaceletViewHandlingStrategy.java:453)\n at com.sun.faces.application.view.MultiViewHandler.restoreView(MultiViewHandler.java:148)\n at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:303)\n at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:192)\n at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)\n at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116)\n at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)\n at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)\n at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1542)\n at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)\n at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)\n at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)\n at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)\n at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)\n at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)\n at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)\n at com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:131)\n at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:328)\n at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)\n at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)\n at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)\n at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)\n at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746)\n at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)\n at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)\n at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)\n at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)\n at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)\n at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)\n at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)\n at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)\n at com.sun.grizzly.ContextTask.run(ContextTask.java:71)\n at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)\n at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)\n at java.lang.Thread.run(Thread.java:722)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAND : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ejavax.faces.application.ViewExpiredException: viewId:/index.xhtml - View /index.xhtml could not be restored.\n at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:205)\n at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)\n at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116)\n at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)\n at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)\n at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1542)\n at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)\n at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)\n at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)\n at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)\n at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)\n at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)\n at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)\n at com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:131)\n at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:328)\n at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)\n at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)\n at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)\n at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)\n at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746)\n at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)\n at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)\n at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)\n at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)\n at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)\n at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)\n at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)\n at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)\n at com.sun.grizzly.ContextTask.run(ContextTask.java:71)\n at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)\n at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)\n at java.lang.Thread.run(Thread.java:722)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eALSO : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ejava.lang.ArrayIndexOutOfBoundsException: 4\n at javax.faces.component.UIComponentBase.restoreState(UIComponentBase.java:1576)\n at com.sun.faces.application.view.StateManagementStrategyImpl$2.visit(StateManagementStrategyImpl.java:267)\n at com.sun.faces.component.visit.FullVisitContext.invokeVisitCallback(FullVisitContext.java:151)\n at javax.faces.component.UIComponent.visitTree(UIComponent.java:1590)\n at javax.faces.component.UIComponent.visitTree(UIComponent.java:1601)\n at javax.faces.component.UIForm.visitTree(UIForm.java:344)\n at javax.faces.component.UIComponent.visitTree(UIComponent.java:1601)\n at javax.faces.component.UIComponent.visitTree(UIComponent.java:1601)\n at com.sun.faces.application.view.StateManagementStrategyImpl.restoreView(StateManagementStrategyImpl.java:254)\n at com.sun.faces.application.StateManagerImpl.restoreView(StateManagerImpl.java:188)\n at com.sun.faces.application.view.ViewHandlingStrategy.restoreView(ViewHandlingStrategy.java:123)\n at com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(FaceletViewHandlingStrategy.java:453)\n at com.sun.faces.application.view.MultiViewHandler.restoreView(MultiViewHandler.java:148)\n at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:303)\n at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:192)\n at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)\n at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116)\n at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)\n at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)\n at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1542)\n at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)\n at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)\n at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)\n at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)\n at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)\n at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)\n at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)\n at com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:131)\n at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:328)\n at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)\n at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)\n at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)\n at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)\n at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746)\n at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)\n at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)\n at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)\n at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)\n at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)\n at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)\n at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)\n at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)\n at com.sun.grizzly.ContextTask.run(ContextTask.java:71)\n at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)\n at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)\n at java.lang.Thread.run(Thread.java:722)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo, as with any Java errors, I go down the stack trace to find where this is being generated from. The issue I am having is that, none of the classes I have made show up in the trace... this leads me to beleive (and I might be wrong) that this isn't generated from my code - even tho it makes no sense being that my code almost HAS to be the source of this error.\u003c/p\u003e\n\n\u003cp\u003eAny input on this would be greatly appreciated.\u003c/p\u003e\n\n\u003cp\u003eI am running Glasffish Open Source V.3.1 and JSF 2.0\u003c/p\u003e\n\n\u003cp\u003e\u003cem\u003eI am at a loss as to how to find source of these errors.\u003c/em\u003e\u003c/p\u003e","accepted_answer_id":"10182825","answer_count":"2","comment_count":"2","creation_date":"2012-04-05 15:25:55.983 UTC","last_activity_date":"2016-02-05 13:22:05.317 UTC","last_edit_date":"2012-04-10 12:51:49.93 UTC","last_editor_display_name":"","last_editor_user_id":"686036","owner_display_name":"","owner_user_id":"686036","post_type_id":"1","score":"2","tags":"java|jsf|jsf-2|glassfish-3","view_count":"1948"} +{"id":"23675199","title":"com.sun.proxy.$Proxy error on creating pointcut on jdbcTemplate","body":"\u003cp\u003eI try to make a pointcut, to log the SQL queries \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e @Before(\"execution(* org.springframework.jdbc.core.JdbcTemplate.*(String, ..))\")\npublic void logSQLQueries() {\n System.out.println(\"@@\");\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am trying to implement the code as here; \n\u003ca href=\"http://www.gotoquiz.com/web-coding/programming/java-programming/log-sql-statements-with-parameter-values-filled-in-spring-jdbc/\" rel=\"noreferrer\"\u003ehttp://www.gotoquiz.com/web-coding/programming/java-programming/log-sql-statements-with-parameter-values-filled-in-spring-jdbc/\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003ebut I get \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ejava.lang.IllegalArgumentException: Can not set org.springframework.jdbc.core.JdbcTemplate field com.xyz.abc.dao.ABCDaoImpl.jdbcTemplate to com.sun.proxy.$Proxy53\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have created the jdbcTemplate bean in my *-servlet.xml and have autowired this in all my DAO's. Works perfectly fine but adding the pointcut gives the exception. Any ideas ?? \u003c/p\u003e","accepted_answer_id":"23679453","answer_count":"1","comment_count":"5","creation_date":"2014-05-15 10:08:53.153 UTC","last_activity_date":"2014-05-15 13:18:32.15 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1842145","post_type_id":"1","score":"5","tags":"spring|spring-mvc|proxy|aspectj|spring-aop","view_count":"4100"} +{"id":"26429519","title":"JQuery Mobile swipe event only firing every other swipe","body":"\u003cp\u003eI have set up a swipeleft event in my app to move between fields of a form. All of the fields are dynamically generated, so I'm not swapping between pages, I'm clearing and re-generating all the DOM elements. The problem is the swipe event only fires every other time I swipe on the page or if I touch or tap anything on the page.\u003c/p\u003e\n\n\u003cp\u003eHere's the code that sets up the events:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(document).delegate(\"#scorePage\", \"pageshow\", function() {\n $.event.special.swipe.scrollSupressionThreshold = 10;\n $.event.special.swipe.horizontalDistanceThreshold = 30;\n $.event.special.swipe.durationThreshold = 500;\n $.event.special.swipe.verticalDistanceThreshold = 75;\n $('#divFoo').on(\"swipeleft\", swipeLeftHandler);\n $('#divFoo').on(\"swiperight\", swipeRightHandler);\n tableCreate(traits[0].keyboardID);\n}); \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFor context, tableCreate is putting a dynamically generated table into \u003ccode\u003edivFoo\u003c/code\u003e that contains information a user can pick from. Here's the event code itself:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction swipeLeftHandler() {\n $(\"#divFoo\").empty();\n traitIndex++;\n tableCreate(traits[traitIndex].keyboardID);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhy is my swipe event only firing every other time there is a swipe on the page?\u003c/p\u003e\n\n\u003cp\u003ePrimarily testing on Android right now, if that makes a difference.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdit\u003c/strong\u003e I'm using JQuery Mobile version 1.4.4\u003c/p\u003e","accepted_answer_id":"26470024","answer_count":"1","comment_count":"4","creation_date":"2014-10-17 16:32:35.253 UTC","last_activity_date":"2014-10-20 16:04:33.217 UTC","last_edit_date":"2014-10-17 17:16:50.693 UTC","last_editor_display_name":"","last_editor_user_id":"1306907","owner_display_name":"","owner_user_id":"1306907","post_type_id":"1","score":"0","tags":"android|jquery-mobile","view_count":"167"} +{"id":"19851726","title":"In app facebook like Android","body":"\u003cp\u003e\u003ca href=\"https://developers.facebook.com/docs/opengraph/guides/og.likes/\" rel=\"nofollow\"\u003ehttps://developers.facebook.com/docs/opengraph/guides/og.likes/\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI need to implement like feature in my android app. I read that facebook feeds cannot be liked through facebook android sdk. So my plan was to do inapp liking.\u003c/p\u003e\n\n\u003cp\u003eAny tutorials available? Could anyone help me.\u003c/p\u003e","answer_count":"2","comment_count":"1","creation_date":"2013-11-08 04:41:33.643 UTC","favorite_count":"1","last_activity_date":"2013-11-08 09:34:48.563 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2550391","post_type_id":"1","score":"0","tags":"android|facebook","view_count":"1070"} +{"id":"32757830","title":"Dynamic fields JS value showing \"undefined\"","body":"\u003cp\u003e\u003cstrong\u003eBelow is simple HTML:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;input type=\"text\" class=\"form-control\" id=\"user[0].first_name\" name=\"user[0].first_name\" placeholder=\"First Name\"\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eAnd here's the JS:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e emailIndex = 0;\nfor (var i = 0; i \u0026lt;= emailIndex; i++) {\n data[\"user[\" + i + \"].first_name\"] = $(\"#user[\" + i + \"].first_name\").val();\n\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf I try to print the ID \u003cem\u003euser[0].first_name\u003c/em\u003e returns: \u003cstrong\u003eundefined\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eWhat's wrong there?\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","accepted_answer_id":"32758482","answer_count":"3","comment_count":"3","creation_date":"2015-09-24 09:25:03.213 UTC","last_activity_date":"2015-09-24 09:58:54.1 UTC","last_edit_date":"2015-09-24 09:34:42.263 UTC","last_editor_display_name":"","last_editor_user_id":"1624813","owner_display_name":"","owner_user_id":"1624813","post_type_id":"1","score":"0","tags":"javascript|html|undefined|var|value","view_count":"282"} +{"id":"6930765","title":"How to find a string in field and add an url before it in mysql database?","body":"\u003cp\u003eI would like to know how to find in a table field all possible instances of a string e.g.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003euploads/\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand add before all of them another string e.g.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ehttp://example.com/\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy idea is to update all my records in database where the old links are not working so for instace I have something like this for a field \u003cstrong\u003eperex\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCheck this car \u0026lt;img src=\"/uploads/audi.jpg\"\u0026gt;. It is fantastic!\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eTo look like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCheck this car \u0026lt;img src=\"http://example.com/uploads/audi.jpg\"\u0026gt;. It is fantastic!\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd I have hundreds of this situations in my db.\u003c/p\u003e\n\n\u003cp\u003eWhat could an update query look like? Assume we have it in one table called \u003cstrong\u003ecars\u003c/strong\u003e and field is called \u003cstrong\u003eperex\u003c/strong\u003e. We need to find there all instances of \u003cstrong\u003e/uploads\u003c/strong\u003e and add before the slash \u003cstrong\u003ehttp://example.com/\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eThanks in advance for your answer.\u003c/p\u003e","accepted_answer_id":"6930871","answer_count":"2","comment_count":"0","creation_date":"2011-08-03 17:42:24.817 UTC","last_activity_date":"2011-08-03 17:51:47.507 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"877067","post_type_id":"1","score":"1","tags":"mysql","view_count":"37"} +{"id":"14383551","title":"How to detect/find Windows 8 current scale percentage","body":"\u003cp\u003eThere are three scale percentages in Windows 8:\n•100% when no scaling is applied\n•140% for HD tablets\n•180% for quad-XGA tablets\u003c/p\u003e\n\n\u003cp\u003eHow can I detect in WinRT code what percentage the screen is at that moment?\u003c/p\u003e\n\n\u003cp\u003e(I want to make a custom image service that loads the best resolution from a database)\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-01-17 16:24:32.04 UTC","last_activity_date":"2013-01-17 16:43:14.567 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1949015","post_type_id":"1","score":"0","tags":"resources|windows-runtime|scaling","view_count":"164"} +{"id":"5762077","title":"What is the best way to support new property in legacy code","body":"\u003cp\u003eI have a architecture question about legacy.\n For example I have a class that using everywhere in project. Projects don't have any Unit Tests\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public class LegacyObject \n {\n public Dictionary\u0026lt;string, string[]\u0026gt; MyLegacyProperty { get;set;} \n } \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI need to change dictionary type to other type for example \u003ccode\u003eIEnumerable\u0026lt;KeyValuePair\u0026lt;TKey, TValue\u0026gt;\u0026gt;\u003c/code\u003e. \n What is the best way to change it and don't change the part of code where dictionary MyLegacyProperty using. \u003c/p\u003e","accepted_answer_id":"5762125","answer_count":"2","comment_count":"0","creation_date":"2011-04-23 04:01:26.233 UTC","last_activity_date":"2011-04-23 04:16:48.66 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"307072","post_type_id":"1","score":"0","tags":"c#|dictionary|properties|ienumerable|legacy-code","view_count":"60"} +{"id":"42505426","title":"Connect to SQL server from self made module","body":"\u003cp\u003eI currently have many scripts that connect to the same MSSQL database. I make the connection in each of the scripts, but for ease of use I want to put the connection in a module and call that module from my script. The code in my module connect_to_db.pyc looks like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport pyodbc\n\ndef sql_connect():\n server=\"some_server.net\"\n port=\"1433\"\n user = \"my_username@my_domain\"\n server=\"my_server\"\n database=\"my_database\"\n conn = pyodbc.connect('DRIVER={SQL Server};SERVER=my_server,1433', \n user=user, \n password=password, \n database=database) \n c=conn.cursor()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThen, in my script I try to call this module and run a query:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efrom connect_to_db import sql_connect\n\nsql_connect()\nc.execute(\"SELECT * FROM table\")\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI get the error that the name c is not defined. I tried to define it as a global too, but it don't help. It must have something to do with my lack of understanding modules, but I can't figure out what.\u003c/p\u003e","accepted_answer_id":"42505560","answer_count":"2","comment_count":"0","creation_date":"2017-02-28 09:54:13.513 UTC","last_activity_date":"2017-02-28 11:31:42.91 UTC","last_edit_date":"2017-02-28 09:55:16.243 UTC","last_editor_display_name":"","last_editor_user_id":"3706016","owner_display_name":"","owner_user_id":"4742122","post_type_id":"1","score":"0","tags":"python|sql-server|module","view_count":"63"} +{"id":"32880002","title":"Getting values from twitch.tv JSON response","body":"\u003cp\u003eI have just started using JSON.NET and I am having some trouble getting the values from JSON items.\u003c/p\u003e\n\n\u003cp\u003eI have come across some code over the past few days which will allow me to grab the names but not he associated values.\u003c/p\u003e\n\n\u003cp\u003eI am working with the twitch.tv Web API. Here is my code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eDim sUrl As String = Convert.ToString(\"https://api.twitch.tv/kraken/streams/\") \u0026amp; sUsername\nDim wRequest As HttpWebRequest = DirectCast(HttpWebRequest.Create(sUrl), HttpWebRequest)\nwRequest.ContentType = \"application/json\"\nwRequest.Accept = \"application/vnd.twitchtv.v3+json\"\nwRequest.Method = \"GET\"\n\nDim wResponse As WebResponse = wRequest.GetResponse()\nDim dataStream As Stream = wResponse.GetResponseStream()\nDim reader As New StreamReader(dataStream)\nDim res As String = reader.ReadToEnd()\nDim outer As JToken = JToken.Parse(res)\nDim inner As JObject = outer(\"stream\").Value(Of JObject)()\nDim keys As List(Of String) = inner.Properties().[Select](Function(p) p.Name).ToList()\n\nFor Each k As String In keys\n Debug.WriteLine(k)\nNext\n\n\nreader.Close()\nwResponse.Close()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe raw JSON is as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n \"_links\": {\n \"self\": \"https: //api.twitch.tv/kraken/streams/jojosaysbreee\",\n \"channel\": \"https: //api.twitch.tv/kraken/channels/jojosaysbreee\"\n },\n \"stream\": {\n \"_id\": 16717827552,\n \"game\": \"TomClancy'sRainbowSix: Siege\",\n \"viewers\": 15,\n \"created_at\": \"2015-09-30T21: 19: 10Z\",\n \"video_height\": 720,\n \"average_fps\": 59.9630366205,\n \"is_playlist\": false,\n \"_links\": {\n \"self\": \"https: //api.twitch.tv/kraken/streams/jojosaysbreee\"\n },\n \"preview\": {\n \"small\": \"http: //static-cdn.jtvnw.net/previews-ttv/live_user_jojosaysbreee-80x45.jpg\",\n \"medium\": \"http: //static-cdn.jtvnw.net/previews-ttv/live_user_jojosaysbreee-320x180.jpg\",\n \"large\": \"http: //static-cdn.jtvnw.net/previews-ttv/live_user_jojosaysbreee-640x360.jpg\",\n \"template\": \"http: //static-cdn.jtvnw.net/previews-ttv/live_user_jojosaysbreee-{width}x{height}jpg\"\n },\n \"channel\": {\n \"_links\": {\n \"self\": \"http: //api.twitch.tv/kraken/channels/jojosaysbreee\",\n \"follows\": \"http: //api.twitch.tv/kraken/channels/jojosaysbreee/follows\",\n \"commercial\": \"http: //api.twitch.tv/kraken/channels/jojosaysbreee/commercial\",\n \"stream_key\": \"http: //api.twitch.tv/kraken/channels/jojosaysbreee/stream_key\",\n \"chat\": \"http: //api.twitch.tv/kraken/chat/jojosaysbreee\",\n \"features\": \"http: //api.twitch.tv/kraken/channels/jojosaysbreee/features\",\n \"subscriptions\": \"http: //api.twitch.tv/kraken/channels/jojosaysbreee/subscriptions\",\n \"editors\": \"http: //api.twitch.tv/kraken/channels/jojosaysbreee/editors\",\n \"videos\": \"http: //api.twitch.tv/kraken/channels/jojosaysbreee/videos\",\n \"teams\": \"http: //api.twitch.tv/kraken/channels/jojosaysbreee/teams\"\n },\n \"background\": null,\n \"banner\": null,\n \"broadcaster_language\": \"en\",\n \"display_name\": \"JOJOsaysbreee\",\n \"game\": \"TomClancy'sRainbowSix: Siege\",\n \"logo\": \"http: //static-cdn.jtvnw.net/jtv_user_pictures/jojosaysbreee-profile_image-26a326e1c867f257-300x300.jpeg\",\n \"mature\": true,\n \"status\": \"BetaHype\u0026lt;3\",\n \"partner\": false,\n \"url\": \"http: //www.twitch.tv/jojosaysbreee\",\n \"video_banner\": \"http: //static-cdn.jtvnw.net/jtv_user_pictures/jojosaysbreee-channel_offline_image-67b08d519585b45f-640x360.jpeg\",\n \"_id\": 41382559,\n \"name\": \"jojosaysbreee\",\n \"created_at\": \"2013-03-16T09: 33: 34Z\",\n \"updated_at\": \"2015-10-01T05: 15: 26Z\",\n \"delay\": null,\n \"followers\": 2318,\n \"profile_banner\": \"http: //static-cdn.jtvnw.net/jtv_user_pictures/jojosaysbreee-profile_banner-6abce6a882f4f9e4-480.jpeg\",\n \"profile_banner_background_color\": \"#ffffff\",\n \"views\": 15939,\n \"language\": \"en\"\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe response from the code is all the names from \"stream\":\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e_id\ngame\nviewers\ncreated_at\nvideo_height\naverage_fps\nis_playlist\n_links\npreview\nchannel\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat I am trying to accomplish is getting all the associated values after each one of those items but I cannot seem to get it right. I know it needs to iterate deeper but I've tried IEnumerable method and was unsuccessful there also.\u003c/p\u003e\n\n\u003cp\u003eAny and all help is much appreciated.\u003c/p\u003e","accepted_answer_id":"32880153","answer_count":"1","comment_count":"0","creation_date":"2015-10-01 05:24:45.853 UTC","last_activity_date":"2015-10-01 06:01:07.3 UTC","last_edit_date":"2015-10-01 05:55:29.693 UTC","last_editor_display_name":"","last_editor_user_id":"3191599","owner_display_name":"","owner_user_id":"4322430","post_type_id":"1","score":"1","tags":"json|vb.net|parsing|json.net|twitch","view_count":"471"} +{"id":"31857625","title":"Select alternate points and move labels above/below","body":"\u003cp\u003eI am fairly new to VBA and trying to select alternating points to place datalabels above and below.\u003c/p\u003e\n\n\u003cp\u003eHere is my code that is currently placing a datalabel below point 1 which I want, but then I want the 3rd point's label to be placed below as well, and the other ones above. I have tried many different loops and codes but nothing seems to work and I'm not sure why it seems to copy and paste instead of move the label.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e For x = 1 To ActiveChart.SeriesCollection(1).Points.Count\n\n With ActiveChart.SeriesCollection(1).Points(x).DataLabel\n .Position = xlLabelPositionBelow\n .Orientation = xlHorizontal\n End With\n x = x + 2\n\n Next x\n\n For x = 2 To ActiveChart.SeriesCollection(1).Points.Count\n\n With ActiveChart.SeriesCollection(1).Points(x).DataLabel\n .Position = xlLabelPositionAbove \n .Orientation = xlHorizontal\n End With\n x = x + 2\n\n Next x\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is what my code currently produces:\n\u003ca href=\"https://i.stack.imgur.com/Yp0e0.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/Yp0e0.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eHere is what I would like it to do:\n\u003ca href=\"https://i.stack.imgur.com/1LcPa.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/1LcPa.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI feel like it is something simple that I am missing if this is possible. So any help would be greatly appreciated. Is it possible there is an easier way?\nThank you in advance.\u003c/p\u003e","accepted_answer_id":"31857959","answer_count":"2","comment_count":"0","creation_date":"2015-08-06 13:51:19.88 UTC","last_activity_date":"2015-08-06 14:44:48.123 UTC","last_edit_date":"2015-08-06 14:03:51.157 UTC","last_editor_display_name":"","last_editor_user_id":"5152545","owner_display_name":"","owner_user_id":"5152545","post_type_id":"1","score":"1","tags":"excel|excel-vba","view_count":"380"} +{"id":"37114246","title":"android service not starting or giving explict error","body":"\u003cp\u003eI have a service which check for screen on of. I am calling this service from an activity which is mentioned below. Now when i call the service in any device below lollipop it works. It was working with lollipop also. Suddenly it stopped working on lollipop and gives me error\n java.lang.IllegalArgumentException: Service Intent must be explicit\nno i tried various methods and not able to understand whats happening.....\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epackage com.androidexample.screenonoff;\n\nimport android.app.Activity;\nimport android.app.AlertDialog;\nimport android.app.Service;\nimport android.content.BroadcastReceiver;\nimport android.content.Context;\nimport android.content.DialogInterface;\nimport android.content.Intent;\nimport android.content.IntentFilter;\nimport android.os.IBinder;\nimport android.util.Log;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.ImageView;\nimport android.widget.TextView;\nimport android.widget.Toast;\n\n\npublic class AEScreenOnOffService extends Service {\n BroadcastReceiver mReceiver=null;\n\n @Override\n public void onCreate() {\n super.onCreate();\n\n // Toast.makeText(getBaseContext(), \"Service on create\", Toast.LENGTH_SHORT).show();\n\n // Register receiver that handles screen on and screen off logic\n IntentFilter filter = new IntentFilter(Intent.ACTION_SCREEN_ON);\n filter.addAction(Intent.ACTION_SCREEN_OFF);\n mReceiver = new AEScreenOnOffReceiver();\n registerReceiver(mReceiver, filter);\n\n }\n\n @Override\n public void onStart(Intent intent, int startId) { \n\n boolean screenOn = false;\n\n try{\n // Get ON/OFF values sent from receiver ( AEScreenOnOffReceiver.java ) \n screenOn = intent.getBooleanExtra(\"screen_state\", false);\n\n }catch(Exception e){}\n\n // Toast.makeText(getBaseContext(), \"Service on start :\"+screenOn, \n //Toast.LENGTH_SHORT).show();\n\n if (!screenOn) {\n\n // your code here\n // Some time required to start any service\n //Toast.makeText(getBaseContext(), \"Begin \", Toast.LENGTH_LONG).show();\n // Intent yourintent = new Intent(this, postlockscreen.class);\n //yourintent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n //startActivity(yourintent);\n\n\n } else {\n\n // your code here\n // Some time required to stop any service to save battery consumption\n //Toast.makeText(getBaseContext(), \"Screen off,\", Toast.LENGTH_LONG).show();\n Intent yourintent = new Intent(this, postlockscreen.class);\n yourintent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n startActivity(yourintent);\n }\n }\n\n @Override\n public IBinder onBind(Intent intent) {\n // TODO Auto-generated method stub\n return null;\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNo when i start the service from any device lesser than lollipop it starts the service and works fine\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epackage com.androidexample.screenonoff;\n\nimport android.os.Bundle;\nimport android.app.Activity;\nimport android.content.Intent;\n\npublic class ScreenOnOff extends Activity {\n\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_screen_on_off);\n\n // Start AEScreenOnOffService Service\n\n Intent i0 = new Intent();\n i0.setAction(\"com.androidexample.screenonoff.AEScreenOnOffService\");\n startService(i0);\n //startService(new Intent(this, AEScreenOnOffService.class));\n\n }\n\n\n\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"2","creation_date":"2016-05-09 11:07:57.887 UTC","last_activity_date":"2016-05-09 11:07:57.887 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5737743","post_type_id":"1","score":"0","tags":"android|android-service","view_count":"133"} +{"id":"33451633","title":"Angular 2, passing full object as parameter","body":"\u003cp\u003eI studying angular 2 and I m having a problem.\u003c/p\u003e\n\n\u003cp\u003eIn fact, actually, I pass each component property to the template like following :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport {Component, bootstrap, NgFor,NgModel} from 'angular2/angular2';\nimport {TodoItem} from '../item/todoItem';\n\n\n@Component({\n selector: 'todo-list',\n providers: [],\n templateUrl: 'app/todo/list/todoList.html',\n directives: [NgFor,TodoItem,NgModel],\n pipes: [],\n styleUrls:['app/todo/list/todoList.css']\n})\nexport class TodoList {\n\n list:Array\u0026lt;Object\u0026gt;;\n\n constructor(){\n this.list = [\n {title:\"Text 1\", state:false},\n {title:\"Text 2\", state:true}\n ];\n }\n}\n\n\n\n\u0026lt;todo-item [title]=\"item.title\" [state]=\"item.state\" *ng-for=\"#item of list\"\u0026gt;\u0026lt;/todo-item\u0026gt;\n\nimport {Component, bootstrap, Input} from 'angular2/angular2';\n\n\n@Component({\n selector: 'todo-item',\n providers: [],\n templateUrl: 'app/todo/item/todoItem.html',\n directives: [],\n pipes: [],\n styleUrls:['app/todo/item/todoItem.css']\n})\nexport class TodoItem {\n\n @Input()\n title:String;\n\n @Input()\n state:Boolean;\n\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI was wondering if I can pass the full object directly inside of the template with passing each property ?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;todo-item [fullObj]=\"item\" *ng-for=\"#item of list\"\u0026gt;\u0026lt;/todo-item\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"33455819","answer_count":"2","comment_count":"3","creation_date":"2015-10-31 12:35:28.82 UTC","favorite_count":"1","last_activity_date":"2017-09-15 11:09:58.343 UTC","last_edit_date":"2017-09-15 11:09:58.343 UTC","last_editor_display_name":"","last_editor_user_id":"5765795","owner_display_name":"","owner_user_id":"5423180","post_type_id":"1","score":"13","tags":"angular|typescript","view_count":"32069"} +{"id":"19086472","title":"Cannot call method 'lat' of null","body":"\u003cp\u003eSo good morning,\u003c/p\u003e\n\n\u003cp\u003eI'm working on a project witch includes google maps.\nEverything working so fine, i (thought) was finished with the part of coding the maps but then it hit me. Testing my project on firefox OK, testing it on Chrome 568 errors (@#$%@#).\u003c/p\u003e\n\n\u003cp\u003eSo what caused all this mess? I load my page, the one with the maps(on chrome), everything ok but after about a minute my marker vanish from canvas and scrolling the mouse over the map cause all these errors.\u003c/p\u003e\n\n\u003cp\u003eSo i thought, ok i've done some thing really bad but why not in firefox. Being more patient than some minutes, the problem is there it is not like on chrome where i can see it always, but some times it is happening there too.\u003c/p\u003e\n\n\u003cp\u003eSo the code part\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://dl.dropboxusercontent.com/u/52031434/maps.js\" rel=\"nofollow\"\u003eLink to my file\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003esorry about the link, but its a bit of code.\u003c/p\u003e\n\n\u003cp\u003eIf i find my solution, i post to save you from my hell.\u003c/p\u003e\n\n\u003cp\u003eThanks in advance all of you(and sorry for my english)!\u003c/p\u003e","answer_count":"0","comment_count":"6","creation_date":"2013-09-30 04:28:01.117 UTC","last_activity_date":"2013-09-30 04:28:01.117 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"717937","post_type_id":"1","score":"1","tags":"javascript|jquery|google-maps|google-chrome","view_count":"835"} +{"id":"20759326","title":"Quick Search for a Person's name","body":"\u003cp\u003eI was curious to know about the best quick search query that is used to retrieve a person's info. Currently, we have a database which has columns for first name, last name and salutation. The user should be allowed to search for any permutation and combination of these columns. The simple search query is taking a lot of time and thus making this quick search slow (As the query needs to scan all the rows for first name, last name and salutation). Could you please share the various fast or advanced techniques that could be used for this purpose. \u003c/p\u003e","answer_count":"3","comment_count":"4","creation_date":"2013-12-24 10:34:42.973 UTC","favorite_count":"2","last_activity_date":"2013-12-24 11:52:30.403 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2119276","post_type_id":"1","score":"5","tags":"sql|sql-server|sql-server-2008","view_count":"610"} +{"id":"15181560","title":"Python RLock IO-Bound?","body":"\u003cp\u003eI have a set of CPU-bound processes that take any number of cores to 100% utilization as long as their only synchronization is getting jobs out of a Queue.\u003c/p\u003e\n\n\u003cp\u003eAs soon as I add an RLock to avoid worst case scenarios when updating a directory in the file system, CPU/core utilization drops to 60%, as if the processes had become IO-bound.\u003c/p\u003e\n\n\u003cp\u003eWhat's the explanation? \u003c/p\u003e\n\n\u003cp\u003eThis is not about overall speed. It is about CPU/core utilization, so Python 2/3, Cython, or PyPy should not matter.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eUpdate:\u003c/strong\u003e I gave a partial answer to my own question. The final solution for my particular case consisted on modifying the way the file system was accessed so no synchronization was needed (a \"sort of\" map/reduce).\u003c/p\u003e","accepted_answer_id":"15311417","answer_count":"2","comment_count":"0","creation_date":"2013-03-03 01:44:51.587 UTC","last_activity_date":"2013-03-09 15:32:53.583 UTC","last_edit_date":"2013-03-09 13:54:27.187 UTC","last_editor_display_name":"","last_editor_user_id":"545637","owner_display_name":"","owner_user_id":"545637","post_type_id":"1","score":"0","tags":"python|synchronization|multiprocessing|cpu-usage","view_count":"235"} +{"id":"43023893","title":"C system call I/O and sscanf practice","body":"\u003cp\u003eI'm trying to write a C program that take input and output using system calls (\u003ccode\u003eread\u003c/code\u003e and \u003ccode\u003ewrite\u003c/code\u003e). However, I also want to convert using \u003ccode\u003esscanf\u003c/code\u003e. The program will input a starting and ending value and will count to that ending value. I'm trying to use \u003ccode\u003esscanf\u003c/code\u003e to convert.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eint main(int argc, char **argv){ \n char beg[5]; \n char stop[5]; \n int i, start, end; \n\n write(1, \"Starting value: \", 16); \n read(0, beg, 4); \n sscanf(beg,\"%d\",\u0026amp;start); \n\n write(1, \"Ending value: \", 14); \n read(0, stop, 4); \n sscanf(stop,\"%d\",\u0026amp;end); \n\n\n int dif = end - start; \n if (dif \u0026gt;= 0){ \n for (i = start; i \u0026lt;= end; i++){ \n write(1, \u0026amp;i, sizeof(i)); \n } \n write(1, \"\\n\", 1); \n } \n return 0;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eDesired output:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eStarting value: 1\nEnding value: 4\n1 2 3 4\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, nothing prints for the count (it works if I used \u003ccode\u003eprintf(\"%d \", i);\u003c/code\u003e)\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2017-03-26 01:17:01.857 UTC","last_activity_date":"2017-03-26 02:08:40.18 UTC","last_edit_date":"2017-03-26 02:08:40.18 UTC","last_editor_display_name":"","last_editor_user_id":"616815","owner_display_name":"","owner_user_id":"7480788","post_type_id":"1","score":"1","tags":"c|io|system-calls|scanf","view_count":"46"} +{"id":"34332961","title":"How can i dispose IDisposable when it is declared in a parameter?","body":"\u003cpre\u003e\u003ccode\u003eSendEmail(\"message\", \"subject\", new System.Net.Mail.Attachment(path1), new System.Net.Mail.Attachment(path2));\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow can i dispose the last two attachments in the parameter? Will it dispose itself when done?\u003c/p\u003e","accepted_answer_id":"34333044","answer_count":"1","comment_count":"8","creation_date":"2015-12-17 11:02:48.493 UTC","last_activity_date":"2015-12-17 11:06:17.463 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2101976","post_type_id":"1","score":"2","tags":"c#|.net|idisposable","view_count":"54"} +{"id":"32725894","title":"Marionette CompositeView in the select\u003eoption context","body":"\u003cp\u003eI'm trying to set up a simple Marionette's \u003ccode\u003eCompositeView\u003c/code\u003e. Here's what I want in the end:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e%select#target-id\n %option{:value =\u0026gt; \"#{@id}\"} = @name\n %option{:value =\u0026gt; \"#{@id}\"} = @name \n etc\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn my \u003ccode\u003eCompositeView\u003c/code\u003e I specify the \u003ccode\u003echildViewContainer: select\u003c/code\u003e and I need to display both @name (for the readability) and @id (for the related event) in the options of this select. Due to the nature of default div element I can to speficfy \u003ccode\u003etagName\u003c/code\u003e as \u003ccode\u003eoption\u003c/code\u003e in my \u003ccode\u003eItemView\u003c/code\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass New.TargetView extends App.Views.ItemView\n template: \"path/to/template\"\n tagName: 'option'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd in the template I can pass only the content of to-be-created option element: \u003ccode\u003e= @name\u003c/code\u003e. This works fine, Marionette creates an option element for each model and populates it with the name of the model. The problem is that I don't know how to pass an attributes as well, since I can't specify an attribute of the element that hasn't been created yet.\u003c/p\u003e\n\n\u003cp\u003eI've also tried to set an \u003ccode\u003eattributes\u003c/code\u003e property on the \u003ccode\u003eItemView\u003c/code\u003e like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eattributes:\n value: \"#{@id}\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd it technically works: the options are populated with the \u003ccode\u003evalue=\"\"\u003c/code\u003e attribute, but the content is undefined. Please advice.\u003c/p\u003e","accepted_answer_id":"32760455","answer_count":"2","comment_count":"0","creation_date":"2015-09-22 20:06:34.197 UTC","last_activity_date":"2015-09-24 11:43:08.773 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5165511","post_type_id":"1","score":"1","tags":"javascript|backbone.js|marionette","view_count":"72"} +{"id":"33530773","title":"Performance reading end of large file","body":"\u003cp\u003eI have need to implement something similar to tail -f to read new lines added to a log file and handle the log file rolling over. This is for Solaris 10. Currently, the application checks the status of the file every second and if the file has changed, it opens the file, seeks to near the end and reads from there to the end of the file.\u003c/p\u003e\n\n\u003cp\u003eThat all seems to work fine, but I'm curious what the performance impacts would be when the log file is very large. Does seek actually need to read through the whole file, or is it smart enough to only load the end of the file?\u003c/p\u003e","accepted_answer_id":"33535629","answer_count":"1","comment_count":"0","creation_date":"2015-11-04 19:50:26.343 UTC","last_activity_date":"2015-11-05 02:25:57.253 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1917337","post_type_id":"1","score":"0","tags":"unix|solaris-10","view_count":"32"} +{"id":"17305940","title":"Is CWSpear`s hover dropdown menu amd ready (require.js)?","body":"\u003cp\u003eI was trying to make use of the \u003ca href=\"https://github.com/CWSpear/twitter-bootstrap-hover-dropdown\" rel=\"nofollow\"\u003eCWSpear`s plugin\u003c/a\u003e, for dropdown menus with hover, using require.js. \nBut I keep getting an error for it: \"Error: Script error\".\nWhat do I need to do with in order to use it with require.js?\u003c/p\u003e\n\n\u003cp\u003eEDIT:\u003c/p\u003e\n\n\u003cp\u003eTo help @jakee by focusing the question, this is the configuration I've made :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003erequirejs.config({\n paths: {\n \"myBootstrap\": _myBootstrappingPath + \"js/bootstrap\",\n \"myControllers\" : _myBootstrappingPath + \"js/controllers\", \n\n //jquery\n \"jquery\": _libsPath + \"jquery/1.9.1/js/jquery\",\n \"jquery_validate\": _libsPath + \"jquery/validate/1.12.0/js/jquery.validate\",\n\n //Bootstrap related\n \"twitterBootstrap\": _libsPath + \"bootstrap/2.3.1/\",\n \"select2\" : _libsPath + \"select2/3.3.2/select2\", \n\n //misc\n \"underscore\": _libsPath + \"underscore/1.4.4/js/underscore\",\n \"backbone\": _libsPath + \"backbone/1.0.0/js/backbone\",\n\n \"backbonePageable\": _libsPath + \"backbone/backbone-pageable/1.2.0/js/backbone-pageable\",\n \"backgrid\": _libsPath + \"backgrid/0.2.0/backgrid\",\n \"backgridAssets\": _libsPath + \"backgrid/0.2.0/assets/js\",\n \"backgridExtensions\": _libsPath + \"backgrid/0.2.0/extensions\",\n\n //plugins and extensions \n \"plugins_datetimepicker\": _pluginsPath + \"/datetimePicking/bootstrap-datetimepicker\", \n \"plugins_dropdownHover\": _pluginsPath + \"/dropdownHover/dropdownHover\",\n },\n shim: {\n underscore: {\n exports: '_'\n },\n backbone: {\n deps: [\"underscore\", \"jquery\"],\n exports: \"Backbone\"\n }, \n bootstrap: {\n deps: [\"jquery\"],\n exports: \"$.fn.popover\"\n }, \n 'select2': [\"jquery\"],\n 'backgrid': {\n deps: [\"jquery\", \"backbone\"],\n exports: \"Backgrid\"\n },\n 'backbonePageable': {\n deps: [\"jquery\", \"underscore\", \"backbone\"],\n exports: \"PageableCollection\",\n init: function(nhonho){\n Backbone.PageableCollection = PageableCollection;\n }\n },\n plugins_datetimepicker: {\n deps: [\"jquery\", \"bootstrap\"]\n },\n plugins_dropdownHover: {\n deps: [\"jquery\", \"bootstrap\"]\n } \n }\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand use it in:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e(function (bs) {\n\n require([\"jquery\", \n \"twitterBootstrap\", \n \"select2\", \n \"plugins_datetimepicker\", \n \"plugins_dropdownHover\", \n \"myControllers/defaultController\"], function ($) {\n\n var defaultCtrlr = new ticket.defaultController(bs);\n\n bs.onInit();\n defaultCtrlr.start(bs.options);\n bs.onReady();\n }); \n\n\n})(window.my.bootstrap);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAs long as I comment the \u003ccode\u003e\"plugins_dropdownHover\"\u003c/code\u003e line, in the defines, it works fine. If it tries to load that script, it fails.\u003c/p\u003e","accepted_answer_id":"17458655","answer_count":"2","comment_count":"0","creation_date":"2013-06-25 19:33:11.16 UTC","last_activity_date":"2013-07-03 21:46:35 UTC","last_edit_date":"2013-07-02 19:48:33.767 UTC","last_editor_display_name":"","last_editor_user_id":"141345","owner_display_name":"","owner_user_id":"141345","post_type_id":"1","score":"0","tags":"javascript|twitter-bootstrap|drop-down-menu|requirejs","view_count":"371"} +{"id":"28211864","title":"Subclass of Subclass of NSmanagedobject","body":"\u003cp\u003eI want to add some business logic of a class \"person\" which is a subclass of NSmanagedObject \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eIs Categories is the only option to Implement the Business logic of a sublass of NSmanagedobject ?\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003ebecause I don't want to implement business logic into the same class which is a subclass of NSManagedObject class\u003c/p\u003e\n\n\u003cp\u003eLooking forward for you participation\u003c/p\u003e\n\n\u003cp\u003ethanks,\u003c/p\u003e","accepted_answer_id":"28213532","answer_count":"1","comment_count":"1","creation_date":"2015-01-29 10:05:34.647 UTC","favorite_count":"2","last_activity_date":"2015-01-29 11:24:55.96 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3973647","post_type_id":"1","score":"-1","tags":"ios|objective-c|iphone|core-data","view_count":"61"} +{"id":"46271542","title":"Android O 8.0.0 Having issue and crashes on calling sync() method of CookieSyncManager","body":"\u003cp\u003eSeen the log as follows only specific to Android \"O\" 8 Google Pixel :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eFatal Exception: java.lang.NullPointerException\n at android.content.res.AssetManager.addAssetPathNative(AssetManager.java)\n at android.content.res.AssetManager.addAssetPathInternal(AssetManager.java:689)\n at android.content.res.AssetManager.addAssetPathAsSharedLibrary(AssetManager.java:684)\n at android.webkit.WebViewFactory.getProviderClass(WebViewFactory.java:407)\n at android.webkit.WebViewFactory.getProvider(WebViewFactory.java:211)\n at android.webkit.CookieManager.getInstance(CookieManager.java:39)\n at android.webkit.CookieSyncManager.sync(CookieSyncManager.java:112)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eInterestingly the issue is there on a call doing\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eandroid.webkit.CookieSyncManager cookieSyncManager = android.webkit.CookieSyncManager.createInstance(context);\n cookieSyncManager.sync();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAs per the document \u003ca href=\"https://developer.android.com/reference/android/webkit/CookieSyncManager.html\" rel=\"nofollow noreferrer\"\u003ehttps://developer.android.com/reference/android/webkit/CookieSyncManager.html\u003c/a\u003e \nthe call to sync() is deprecated and should call to flush() instead. but the method is just deprecated.\nOn having an internal check with code of \u003ccode\u003eCookieSyncManager\u003c/code\u003e found that it does as follows\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e/**\n * sync() forces sync manager to sync now\n * @deprecated Use {@link CookieManager#flush} instead.\n */\n @Deprecated\n public void sync() {\n CookieManager.getInstance().flush();\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eInterested to know the cause of this failure as Crashlytics shows a big number of crashes on the same.\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2017-09-18 04:18:00.863 UTC","last_activity_date":"2017-10-09 02:20:18.047 UTC","last_edit_date":"2017-09-18 06:28:49.437 UTC","last_editor_display_name":"","last_editor_user_id":"4449278","owner_display_name":"","owner_user_id":"2869772","post_type_id":"1","score":"0","tags":"android|android-8.0-oreo","view_count":"102"} +{"id":"12920043","title":"Is this simple VB.NET code valid?","body":"\u003cp\u003eSo I made \u003ca href=\"http://myscrambledmind.com/helloworlds.php\" rel=\"nofollow\"\u003ethis\u003c/a\u003e and someone has submitted a new VB.NET hello world example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eModule m1\nSub Main()\n Console.out.writeline(\"Hello World\")\nEnd Sub\nEnd Module\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs this valid VB.NET? I don't know the language, so wanted to check it.\u003c/p\u003e\n\n\u003cp\u003eThe example that is currently on the website is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eConsole.WriteLine (\"Hello, World!\")\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat I'm mainly questioning is the \u003ccode\u003eConsole.out.writeline\u003c/code\u003e - is this right?\u003c/p\u003e\n\n\u003cp\u003eThanks in advance. :)\u003c/p\u003e","accepted_answer_id":"12920078","answer_count":"2","comment_count":"0","creation_date":"2012-10-16 17:13:50.547 UTC","last_activity_date":"2012-10-16 17:21:27.457 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1685296","post_type_id":"1","score":"2","tags":"vb.net","view_count":"109"} +{"id":"8549667","title":"How to insert and pull data out of temporary table using the one SQL Statement","body":"\u003cp\u003eI am wondering how I can either use multiple or the same select statement to to insert data into a temporary table and then select data out of the temporary using the same query.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT ADDRESS INTO tempTable FROM LOCATION,\nSELECT AddrFMT([ADDRESS]) AS ADDRESS1 FROM tempTable;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks everyone!\u003c/p\u003e","accepted_answer_id":"8549705","answer_count":"3","comment_count":"6","creation_date":"2011-12-18 03:45:01.723 UTC","last_activity_date":"2011-12-18 04:31:35.607 UTC","last_edit_date":"2011-12-18 03:51:29.073 UTC","last_editor_display_name":"user596075","owner_display_name":"","owner_user_id":"1044581","post_type_id":"1","score":"1","tags":"sql|sql-server","view_count":"1784"} +{"id":"33087076","title":"LWJGL: Opening window causes program to crash","body":"\u003cp\u003eI am attempting to make a simple game in Java / LWJGL. I was following a tutorial that was made on windows and I'm using a mac. I copied his code for opening up a window character for character and the program crashed instantly giving me a very long and weird error that probably has something to do with pointers (I don't actually know). Here is the line for creating a window that I used where width and height are defined in the properties:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e window = glfwCreateWindow(width, height, \"Flappy Bird\", NULL, NULL);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I run it on my mac, it gives me this error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e2015-10-12 13:18:38.475 java[496:31875] *** Assertion failure in + [NSUndoManager _endTopLevelGroupings], /SourceCache/Foundation/Foundation-1154/Misc.subproj/NSUndoManager.m:340\n2015-10-12 13:18:38.476 java[496:31875] +[NSUndoManager(NSInternal) _endTopLevelGroupings] is only safe to invoke on the main thread.\n2015-10-12 13:18:38.476 java[496:31875] (\n0 CoreFoundation 0x00007fff98c3003c __exceptionPreprocess + 172\n1 libobjc.A.dylib 0x00007fff9620a76e objc_exception_throw + 43\n2 CoreFoundation 0x00007fff98c2fe1a +[NSException raise:format:arguments:] + 106\n3 Foundation 0x00007fff99f6199b -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 195\n4 Foundation 0x00007fff99ee364f +[NSUndoManager(NSPrivate) _endTopLevelGroupings] + 156\n5 AppKit 0x00007fff96ecbb95 -[NSApplication run] + 756\n6 libglfw.dylib 0x000000010d597974 initializeAppKit + 1332\n7 libglfw.dylib 0x000000010d597035 _glfwPlatformCreateWindow + 37\n8 libglfw.dylib 0x000000010d59397b glfwCreateWindow + 443\n9 ??? 0x0000000104411eee 0x0 + 4366343918\n10 ??? 0x0000000104406929 0x0 + 4366297385\n11 ??? 0x0000000104406929 0x0 + 4366297385\n12 ??? 0x0000000104406929 0x0 + 4366297385\n13 ??? 0x000000010440685a 0x0 + 4366297178\n14 ??? 0x0000000104406d34 0x0 + 4366298420\n)\n2015-10-12 13:18:38.477 java[496:31875] *** Assertion failure in +[NSUndoManager _endTopLevelGroupings], /SourceCache/Foundation/Foundation-1154/Misc.subproj/NSUndoManager.m:340\n2015-10-12 13:18:38.477 java[496:31875] An uncaught exception was raised\n2015-10-12 13:18:38.477 java[496:31875] +[NSUndoManager(NSInternal) _endTopLevelGroupings] is only safe to invoke on the main thread.\n2015-10-12 13:18:38.477 java[496:31875] (\n0 CoreFoundation 0x00007fff98c3003c __exceptionPreprocess + 172\n1 libobjc.A.dylib 0x00007fff9620a76e objc_exception_throw + 43\n2 CoreFoundation 0x00007fff98c2fe1a +[NSException raise:format:arguments:] + 106\n3 Foundation 0x00007fff99f6199b -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 195\n4 Foundation 0x00007fff99ee364f +[NSUndoManager(NSPrivate) _endTopLevelGroupings] + 156\n5 AppKit 0x00007fff96ecbc41 -[NSApplication run] + 928\n6 libglfw.dylib 0x000000010d597974 initializeAppKit + 1332\n7 libglfw.dylib 0x000000010d597035 _glfwPlatformCreateWindow + 37\n8 libglfw.dylib 0x000000010d59397b glfwCreateWindow + 443\n9 ??? 0x0000000104411eee 0x0 + 4366343918\n10 ??? 0x0000000104406929 0x0 + 4366297385\n11 ??? 0x0000000104406929 0x0 + 4366297385\n12 ??? 0x0000000104406929 0x0 + 4366297385\n13 ??? 0x000000010440685a 0x0 + 4366297178\n14 ??? 0x0000000104406d34 0x0 + 4366298420\n)\n2015-10-12 13:18:38.478 java[496:31875] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '+[NSUndoManager(NSInternal) _endTopLevelGroupings] is only safe to invoke on the main thread.'\n*** First throw call stack:\n(\n0 CoreFoundation 0x00007fff98c3003c __exceptionPreprocess + 172\n1 libobjc.A.dylib 0x00007fff9620a76e objc_exception_throw + 43\n2 CoreFoundation 0x00007fff98c2fe1a +[NSException raise:format:arguments:] + 106\n3 Foundation 0x00007fff99f6199b -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 195\n4 Foundation 0x00007fff99ee364f +[NSUndoManager(NSPrivate) _endTopLevelGroupings] + 156\n5 AppKit 0x00007fff96ecbc41 -[NSApplication run] + 928\n6 libglfw.dylib 0x000000010d597974 initializeAppKit + 1332\n7 libglfw.dylib 0x000000010d597035 _glfwPlatformCreateWindow + 37\n8 libglfw.dylib 0x000000010d59397b glfwCreateWindow + 443\n9 ??? 0x0000000104411eee 0x0 + 4366343918\n10 ??? 0x0000000104406929 0x0 + 4366297385\n11 ??? 0x0000000104406929 0x0 + 4366297385\n12 ??? 0x0000000104406929 0x0 + 4366297385\n13 ??? 0x000000010440685a 0x0 + 4366297178\n14 ??? 0x0000000104406d34 0x0 + 4366298420\n)\nlibc++abi.dylib: terminating with uncaught exception of type NSException\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eA window also pops up that says, \"java quit unexpectedly while using the libglfw.dylib plug-in.\"\u003c/p\u003e\n\n\u003cp\u003eDid I install LWJGL wrong or is my code flawed? Thanks for the help!\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;terminated\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"1","creation_date":"2015-10-12 17:38:09.663 UTC","last_activity_date":"2015-10-13 11:41:09.03 UTC","last_edit_date":"2015-10-12 18:10:18.453 UTC","last_editor_display_name":"","last_editor_user_id":"5232703","owner_display_name":"","owner_user_id":"5232703","post_type_id":"1","score":"5","tags":"java|opengl|lwjgl","view_count":"301"} +{"id":"17840145","title":"Dynamic Condition Objects","body":"\u003cp\u003eIn BO XI 3.1, is it possible to create a condition object that filters on multiple tables, without adding all of those tables to the query if they weren't already present?\u003c/p\u003e\n\n\u003cp\u003eFor example, if I have several tables which all contain both current and historical data, and each table has a flag to indicate if the record is current or historical - can I create a \u003cstrong\u003esingle\u003c/strong\u003e \"Current Data\" condition that filters \u003cstrong\u003eall\u003c/strong\u003e of such tables to pull only current data? The catch would be that the query might not be selecting from all of these tables, and I don't want the inclusion of the condition to add joins to tables I'm not selecting from.\u003c/p\u003e\n\n\u003cp\u003eIn other words, can a condition check which tables are being used by the query and apply filters only on those tables?\u003c/p\u003e","accepted_answer_id":"20982689","answer_count":"1","comment_count":"0","creation_date":"2013-07-24 16:47:29.71 UTC","last_activity_date":"2014-01-07 21:51:40.807 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"312117","post_type_id":"1","score":"1","tags":"business-objects","view_count":"224"} +{"id":"14029999","title":"Is it possible to get two sets of data with one query","body":"\u003cp\u003eI need to get some items from database with top three comments for each item.\u003c/p\u003e\n\n\u003cp\u003eNow I have two stored procedures \u003ccode\u003eGetAllItems\u003c/code\u003e and \u003ccode\u003eGetTopThreeeCommentsByItemId\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eIn application I get 100 items and then in foreach loop I call \u003ccode\u003eGetTopThreeeCommentsByItemId\u003c/code\u003e procedure to get top three comments.\u003c/p\u003e\n\n\u003cp\u003eI know that this is bad from performance standpoint.\u003c/p\u003e\n\n\u003cp\u003eIs there some technique that allows to get this with one query?\u003c/p\u003e\n\n\u003cp\u003eI can use \u003ccode\u003eOUTER APPLY\u003c/code\u003e to get one top comment (\u003cem\u003eif any\u003c/em\u003e) but I don't know how to get three.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eItems {ItemId, Title, Description, Price etc.}\nComments {CommentId, ItemId etc.}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSample data that I want to get\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003cp\u003eItem_1\u003cbr\u003e\n-- comment_1\u003cbr\u003e\n-- comment_2\u003cbr\u003e\n-- comment_3 \u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eItem_2\u003cbr\u003e\n-- comment_4\u003cbr\u003e\n-- comment_5\u003c/p\u003e\u003c/li\u003e\n\u003c/ul\u003e","accepted_answer_id":"14030111","answer_count":"4","comment_count":"1","creation_date":"2012-12-25 10:58:05.843 UTC","favorite_count":"1","last_activity_date":"2012-12-25 12:22:13.73 UTC","last_edit_date":"2012-12-25 12:22:13.73 UTC","last_editor_display_name":"","last_editor_user_id":"13302","owner_display_name":"","owner_user_id":"480231","post_type_id":"1","score":"4","tags":"sql-server|sql-server-2008|tsql|stored-procedures","view_count":"110"} +{"id":"46682632","title":"angular 4 reactive form group validation","body":"\u003cp\u003ei need advice! I want validate reactive form.\nI have two form groups and both have input with same formcontrolname.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003emy code:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e this.form = this.fb.group({\n group1: this.fb.group({\n name: ['', Validators.required],\n }),\n group2: this.fb.group({\n name: [ '', Validators.required],\n })\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow cen i get both of name?\u003c/p\u003e\n\n\u003cp\u003eI tried this. But i dont know which one i get. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eget name() { return this.form.get('name'); }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","accepted_answer_id":"46682912","answer_count":"3","comment_count":"0","creation_date":"2017-10-11 07:47:05.873 UTC","last_activity_date":"2017-10-11 08:01:53.973 UTC","last_edit_date":"2017-10-11 07:50:40.58 UTC","last_editor_display_name":"","last_editor_user_id":"8005195","owner_display_name":"","owner_user_id":"8741881","post_type_id":"1","score":"2","tags":"angular|validation|angular-reactive-forms","view_count":"71"} +{"id":"30091549","title":"How do I use the foreach method in MongoDB to do scraping/API calls without getting blacklisted by sites?","body":"\u003cp\u003eI have about 20 documents currently in my collection (and I'm planning to add many more probably in the 100s). I'm using the MongoDB Node.js clients \u003ccode\u003ecollection.foreach()\u003c/code\u003e method to iterate through each one and based on the document records go to 3 different endpoints: two APIs (Walmart and Amazon) and one website scrape (name not relevant). Each document contains the relevant data to execute the requests and then I update the documents with the returned data.\u003c/p\u003e\n\n\u003cp\u003eThe problem I'm encountering is the Walmart API and the website scrape will not return data toward the end of the iteration. Or at least my database is not getting updated. My assumption is that the \u003ccode\u003eforeach\u003c/code\u003e method is firing off a bunch of simultaneous requests and either I'm bumping up against some arbitrary limit of simultaneous requests allowed by the endpoint or the endpoints simply can't handle this many requests and ignore anything above and beyond its \"request capacity.\" I've ran some of the documents that were not updating through the same code but in a different collection that contained just a single document and they did update so I don't think it's bad data inside the document. \u003c/p\u003e\n\n\u003cp\u003eI'm running this on Heroku (and locally for testing) using Node.js. Results are similar both on Heroku instance and locally.\u003c/p\u003e\n\n\u003cp\u003eIf my assumption is correct I need a better way to structure this so that there is some separation between requests or maybe it only does x records on a single pass.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-05-07 03:46:04.953 UTC","last_activity_date":"2015-05-07 21:31:59.383 UTC","last_edit_date":"2015-05-07 21:31:59.383 UTC","last_editor_display_name":"","last_editor_user_id":"472495","owner_display_name":"","owner_user_id":"241068","post_type_id":"1","score":"0","tags":"node.js|web-scraping","view_count":"66"} +{"id":"43499731","title":"Positioning content relative to something else","body":"\u003cp\u003eI have three labels in my view:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/Ykz2D.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/Ykz2D.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThe first label is a description and as the text will be fetched from an API it varies in length.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eFirst question\u003c/strong\u003e is how do I make the description label auto-adjust its height?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eSecond question\u003c/strong\u003e is how do I make label 1 move relative to the height of description label and also label 2 relative to label 1.\u003c/p\u003e","accepted_answer_id":"43499823","answer_count":"4","comment_count":"2","creation_date":"2017-04-19 15:15:11.46 UTC","last_activity_date":"2017-04-19 15:30:13.62 UTC","last_edit_date":"2017-04-19 15:19:55.483 UTC","last_editor_display_name":"","last_editor_user_id":"1226963","owner_display_name":"","owner_user_id":"1003632","post_type_id":"1","score":"0","tags":"ios|xcode|constraints","view_count":"28"} +{"id":"39394859","title":"DataTables, print with counter column","body":"\u003cp\u003eI have a table with counter column, but when I print it counter column are empty. And there is a 'id' column. which is hidden in table view.\u003c/p\u003e\n\n\u003cp\u003eHow can I print with counter column?!\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;script type=\"text/javascript\" language=\"javascript\" class=\"init\"\u0026gt;\n$(document).ready(function() {\n var table = $('#example').DataTable( {\n \"dom\": 'lBfrtip',\n \"buttons\": [ 'print'],\n \"ajax\": \"data/mine.txt\",\n \"columns\": [\n { \"data\": \"\" },\n { \"data\": \"id\" },\n { \"data\": \"name\" },\n { \"data\": \"position\" },\n { \"data\": \"office\" },\n { \"data\": \"extn\" },\n { \"data\": \"start_date\" },\n { \"data\": \"salary\" },\n { \"data\": \"functions\" }\n ],\n \"columnDefs\": [ {\n \"searchable\": false,\n \"orderable\": false,\n \"targets\": -1,\n \"data\": null,\n \"defaultContent\": \"\u0026lt;qwerty_1\u0026gt;Bla bla!\u0026lt;/qwerty_1\u0026gt;\"\n } ],\n \"order\": [[ 1, 'asc' ]]\n\n } );\n\n\n table.column(1).visible(false);\n\n $('#example tbody').on( 'click', 'qwerty_1', function () {\n var data = table.row( $(this).parents('tr') ).data();\n alert(data['id']);\n } );\n\n table.on( 'order.dt search.dt', function () {\n table.column(0, {search:'applied', order:'applied'}).nodes().each( function (cell, i) {\n cell.innerHTML = i+1;\n } );\n } ).draw();\n\n} );\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003c/p\u003e","accepted_answer_id":"39398141","answer_count":"2","comment_count":"3","creation_date":"2016-09-08 15:25:25.877 UTC","last_activity_date":"2016-11-29 18:52:28.58 UTC","last_edit_date":"2016-09-08 15:45:43.46 UTC","last_editor_display_name":"","last_editor_user_id":"6809937","owner_display_name":"","owner_user_id":"6809937","post_type_id":"1","score":"1","tags":"printing|datatables","view_count":"128"} +{"id":"19285426","title":"How can iOS7 untethered energy/network recordings be accessed?","body":"\u003cp\u003eiOS7 has a preference under \" Preferences | Developer | Instruments / Logging | Untethered Recording\" to record the energy and network usage data.\u003c/p\u003e\n\n\u003cp\u003eHow do I extract this from the device to view in Xcode or Instruments?\u003c/p\u003e","accepted_answer_id":"19285496","answer_count":"1","comment_count":"0","creation_date":"2013-10-10 01:08:10.677 UTC","favorite_count":"5","last_activity_date":"2013-10-10 01:15:30.757 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"389159","post_type_id":"1","score":"17","tags":"ios|xcode|ios7|xcode-instruments","view_count":"4992"} +{"id":"8837091","title":"Mongodb database design","body":"\u003cp\u003eI got users, they can create activities and users have friends and each user should be able to get all activities from their friends, a single activity can have multiple users.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eUsers -\u0026gt; _id, name, friendList\nActivity -\u0026gt; _id, description, date, involvedUsers\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo an example document would be:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\"User theo\": 1, theo, array(mike, rutger, tijmen)\n\"User mike\": 2, mike, array(theo, rutger, tijmen)\n\nActivity x: 1, 'having fun with friends', {{todaydatetime}}, array(1, 2)\nActivity y: 2, 'going out', {{saturdaydatetime}}, array(1, 2)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo now if \"theo\" logs in, he has to get that Mike is \"going to have fun with friends\" same if Mike logs in.\u003c/p\u003e\n\n\u003cp\u003eAnd if they select saturday as date, Mike will get that Theo is going out, and Theo would get the activity that Mike is going out.\u003c/p\u003e\n\n\u003cp\u003eHow can I accomplish this, I know it's pretty easy in MySql with joins etc, but how can I get all the activities of the users \"friendlist\" and filtered by a certain date, so for example give me all activities that are happening saturday.\u003c/p\u003e","accepted_answer_id":"8838687","answer_count":"2","comment_count":"8","creation_date":"2012-01-12 14:56:01.193 UTC","favorite_count":"1","last_activity_date":"2012-01-12 18:26:13.563 UTC","last_edit_date":"2012-01-12 15:53:32.337 UTC","last_editor_display_name":"","last_editor_user_id":"125816","owner_display_name":"","owner_user_id":"1064710","post_type_id":"1","score":"1","tags":"mongodb","view_count":"1064"} +{"id":"2229008","title":"Adding endpoints implementing different interfaces to an AJAX-enabled WCF Service","body":"\u003cp\u003eI have an AJAX-enabled WCF service and everything works fine with the ajax endpoint. Now I want to add another wsHttpBinding endpoint that corresponds to another interface that is subset of the AJAX interface (i.e. I want only specific methods to be exposed in WSDL). I have a class that implements both interfaces but when I visit the service address MyService.svc?wsdl it contains metadata about both services. How can I configure WCF to do this? The service is hosted in a website application in IIS.\u003c/p\u003e\n\n\u003cp\u003eMaybe I don't really get the concept and a service corresponds to an interface so if I have 2 interfaces I have 2 services (i.e. 2 .svc files).\u003c/p\u003e","accepted_answer_id":"2229886","answer_count":"1","comment_count":"0","creation_date":"2010-02-09 12:39:32.497 UTC","last_activity_date":"2010-02-09 14:48:25.25 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"122507","post_type_id":"1","score":"1","tags":".net|wcf|wcf-configuration","view_count":"462"} +{"id":"1178425","title":"download a file from ftp using curl and php","body":"\u003cp\u003eI'm trying to download a file from an ftp server using curl and php but I can't find any documentation to help\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$curl = curl_init();\ncurl_setopt($curl, CURLOPT_URL,\"ftp://$_FTP[server]\");\ncurl_setopt($curl, CURLOPT_FTPLISTONLY, 1);\ncurl_setopt($curl, CURLOPT_USERPWD, \"$_FTP[username]:$_FTP[password]\");\ncurl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\n$result = curl_exec ($curl);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ei can get a list of files but thats about it\u003c/p\u003e","answer_count":"6","comment_count":"3","creation_date":"2009-07-24 15:28:43.57 UTC","favorite_count":"10","last_activity_date":"2012-12-01 22:40:10.643 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"143596","post_type_id":"1","score":"21","tags":"php|curl","view_count":"38489"} +{"id":"33984172","title":"How to play alarm on specified time in android?","body":"\u003cp\u003eI'm a beginner to android development.\u003c/p\u003e\n\n\u003cp\u003eI'm developing an app that need to play alarm exactly from 8 hrs from the time which am clicking a button.\u003c/p\u003e\n\n\u003cp\u003eI've created a line which gets the current time but am stuck to calculate 8 hrs from current time and play the alarm tone.\u003c/p\u003e\n\n\u003cp\u003eHere's my code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport android.os.Bundle;\nimport android.app.Activity;\nimport android.widget.ToggleButton; \nimport java.text.SimpleDateFormat;\nimport java.util.Calendar;\nimport android.widget.Toast;\nimport android.view.View.OnClickListener;\nimport android.view.*;\n\npublic class MainActivity extends Activity {\n\n public ToggleButton tgb1;\n\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n\n\n tgb1 = (ToggleButton) findViewById(R.id.toggleButton1);\n\n tgb1.setOnClickListener(new OnClickListener(){\n @Override\n public void onClick(View arg0) {\n\n\n if (tgb1.getText().toString().equals(\"Click to Turn Off\"))\n {\n\n Calendar c = Calendar.getInstance();\n SimpleDateFormat sdf = new SimpleDateFormat(\"hh:mm\");\n String strDate = sdf.format(c.getTime());\n c.add(Calendar.HOUR,8);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut I don't know to proceed further from here. Kindly help me in calculating 8 hrs from current time and play alarm tone.\u003c/p\u003e\n\n\u003cp\u003eWaiting for your kind response.\u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2015-11-29 14:59:20.347 UTC","last_activity_date":"2015-11-29 15:41:12.63 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2508913","post_type_id":"1","score":"0","tags":"android|timer|alarmmanager|alarm","view_count":"124"} +{"id":"29371632","title":"Parse: Basic App to App Communication","body":"\u003cp\u003eI am trying to figure out what the basic steps are for getting data passed between users. For example, say I, a user of the app, want to send another user of my app a message or a geopoint or some other form of data. I know the first step would be posting the data to Parse, which I don't have a problem with. But then, how would the other user know there is data to retrieve and also how would they go about retrieving it. Are push notifications the proper and only way of letting the recipient's app know its being sent something? When the recipient app knows there is data posted intended for it to retrieve, how does it go about locating it with a PFQuery? Does the posting app need to supply the receiving app with a UID of some form that the receiving app can then use in its query to locate the data? This is kind of the last puzzle piece for my app and unfortunately it's the only thing Parse didn't make clear to me. It is more than likely user error on my part not finding the correct documentation but, app to app communication is key in most apps and so I need to figure out the defacto way that Parse accomplishes this. Thanks in advance for any help!\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2015-03-31 14:52:06.78 UTC","last_activity_date":"2015-03-31 21:24:28.683 UTC","last_edit_date":"2015-03-31 15:53:03.73 UTC","last_editor_display_name":"","last_editor_user_id":"1566221","owner_display_name":"","owner_user_id":"3813178","post_type_id":"1","score":"0","tags":"ios|parse.com","view_count":"61"} +{"id":"42420896","title":"Gray out specific radio-set after specific answer in other radio-set","body":"\u003cp\u003eI have a form with two question:\u003cbr /\u003e\u003cbr /\u003e\n1. What day you want to come\u003cbr /\u003e\n2. What time you want to come\u003cbr /\u003e\u003cbr /\u003e\nWhen you answer in question 1 \"I can't attend\" question 2 should be grayed out. I found a lot of possible solutions, but not the one which could help me :( . Most were with a checkbox, and based on the checked option a radio button was disabled or not. However, this is what I have so far:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;fieldset\u0026gt;\n \u0026lt;div\u0026gt;\n ~(IF(CHARINDEX('VISIT_DAY',DATA_ERROR)\u0026gt;=0,'\u0026lt;label style=\"color:#CC0000; font-weight:bold; width:100% !important; padding:0px !important; margin:0px !important; text-align:left !important;\"\u0026gt;','\u0026lt;label style=\"color:black; font-weight:bold; width:100% !important; padding:0px !important; margin:0px !important; text-align:left !important;\"\u0026gt;'))~ Ja, ik ben graag bij dit evenement aanwezig. Mijn voorkeursdag is:\u0026lt;span style=\"color:#CC0000;display:inline !important;\"\u0026gt;*\u0026lt;/span\u0026gt; ~(IF(CHARINDEX('VISIT_DAY',DATA_ERROR)\u0026gt;=0,'\u0026lt;/label\u0026gt;','\u0026lt;/label\u0026gt;'))~\n\n \u0026lt;div style=\"clear:both;\"\u0026gt;\n \u0026lt;/div\u0026gt;\n\n \u0026lt;div style=\"float:left !important; clear:none !important;color:black;\"\u0026gt;\n \u0026lt;input type=\"radio\" value=\"A\" style=\"width: auto !important;\" ~(IF(@VISIT_DAY='A','checked',''))~ name=\"VISIT_DAY\" /\u0026gt; 21 maart 2017\u0026lt;br /\u0026gt;\n \u0026lt;input type=\"radio\" value=\"B\" style=\"width: auto !important;\" ~(IF(@VISIT_DAY='B','checked',''))~ name=\"VISIT_DAY\" /\u0026gt; 22 maart 2017\u0026lt;br /\u0026gt;\n \u0026lt;input type=\"radio\" value=\"C\" style=\"width: auto !important;\" ~(IF(@VISIT_DAY='C','checked',''))~ name=\"VISIT_DAY\" /\u0026gt; Ik kan niet aanwezig zijn\u0026lt;br /\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n\n \u0026lt;div\u0026gt;\n ~(IF(CHARINDEX('VISIT_TIME',DATA_ERROR)\u0026gt;=0,'\u0026lt;label style=\"color:#CC0000; font-weight:bold; width:100% !important; padding:0px !important; margin:0px !important; text-align:left !important;\"\u0026gt;','\u0026lt;label style=\"color:black; font-weight:bold; width:100% !important; padding:0px !important; margin:0px !important; text-align:left !important;\"\u0026gt;'))~ Ik zal komen binnen het volgende tijdsbestek:\u0026lt;span style=\"color:#CC0000;display:inline !important;\"\u0026gt;*\u0026lt;/span\u0026gt; ~(IF(CHARINDEX('VISIT_TIME',DATA_ERROR)\u0026gt;=0,'\u0026lt;/label\u0026gt;','\u0026lt;/label\u0026gt;'))~\n\n \u0026lt;div style=\"clear:both;\"\u0026gt;\n \u0026lt;/div\u0026gt;\n\n \u0026lt;div style=\"float:left !important; clear:none !important;color:black;\"\u0026gt;\n \u0026lt;input type=\"radio\" value=\"A\" style=\"width: auto !important;\" ~(IF(@VISIT_TIME='A','checked',''))~ name=\"VISIT_TIME\" /\u0026gt; 09.30 - 13.00\u0026lt;br /\u0026gt;\n \u0026lt;input type=\"radio\" value=\"B\" style=\"width: auto !important;\" ~(IF(@VISIT_TIME='B','checked',''))~ name=\"VISIT_TIME\" /\u0026gt; 13.00 - 16.30\u0026lt;br /\u0026gt;\n \u0026lt;input type=\"radio\" value=\"C\" style=\"width: auto !important;\" ~(IF(@VISIT_TIME='C','checked',''))~ name=\"VISIT_TIME\" /\u0026gt; 16.30 - 20.00\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/fieldset\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo, when option C is selected in question 1, question two should be grayed out/disabled. Thank you very much! so far. \u003cbr /\u003e\u003cbr /\u003e\nEelco \u003c/p\u003e","accepted_answer_id":"42421070","answer_count":"1","comment_count":"0","creation_date":"2017-02-23 16:13:08.883 UTC","last_activity_date":"2017-02-23 16:21:07.62 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7612198","post_type_id":"1","score":"0","tags":"javascript|jquery|html","view_count":"17"} +{"id":"38696379","title":"pass Var from one javascript class to another","body":"\u003cp\u003eI have a controller and a view class.In my controller class I have this code. I am trying to get the AccNo which is passed in the url. I know this code works fine for retrieving the account number, but I now need to pass the Var in to the view class. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e getURLParameter : function(name) {\n return decodeURIComponent((new RegExp('[?|\u0026amp;]' + name + '=' + '([^\u0026amp;;]+?)(\u0026amp;|#|;|$)').exec(location.search)||[,\"\"])[1].replace(/\\+/g, '%20'))||null\n },\n\n // Parse URL parameters \n parseAndSetURLParameters : function(){\n\n var accNo = this.getURLParameter('accNo');\n\n },\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"3","creation_date":"2016-08-01 10:20:04.363 UTC","last_activity_date":"2016-08-01 12:49:19.403 UTC","last_edit_date":"2016-08-01 12:49:19.403 UTC","last_editor_display_name":"user663031","owner_display_name":"","owner_user_id":"1838945","post_type_id":"1","score":"0","tags":"javascript|sapui5|var","view_count":"64"} +{"id":"17028443","title":"Return comma separated list of names from comma separate list of IDs","body":"\u003cp\u003eTo begin with, please don't hold the crappy database structure against me. We all have things we have to deal with that we can't change, and I inherited these tables that are deeply ingrained within the application.\u003c/p\u003e\n\n\u003cp\u003eConsider these two tables:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ePersonnel\n+-----+-------+--------------+\n| ID | Name | TECHNIQUE_ID |\n+-----+-------+--------------+\n| 134 | Bob | 1,2,4 |\n+-----+-------+--------------+\n| 135 | Mary | 1,3,4 |\n+-----+-------+--------------+\n| 136 | Frank | 2 |\n+-----+-------+--------------+\n\nTechniques\n+-----+----------+\n| ID | Name |\n+-----+----------+\n| 1 | Fishing |\n+-----+----------+\n| 2 | Archery |\n+-----+----------+\n| 3 | Bowling |\n+-----+----------+\n| 4 | Hiking |\n+-----+----------+\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat I need is a listing of each person with a comma-separated list of the techniques they perform. Essentially turning \"1,3,4\" into \"Fishing,Bowling,Hiking\".\u003c/p\u003e\n\n\u003cp\u003eI can do this in the CF code by having a nested query, but the report has thousands of rows... which means it could be running tens of thousands of queries just for one report. I'd prefer to do it all in one query.\u003c/p\u003e","accepted_answer_id":"17028788","answer_count":"3","comment_count":"5","creation_date":"2013-06-10 16:18:40.007 UTC","last_activity_date":"2013-06-10 18:20:55.177 UTC","last_edit_date":"2013-06-10 17:07:26.37 UTC","last_editor_display_name":"","last_editor_user_id":"21727","owner_display_name":"","owner_user_id":"2283816","post_type_id":"1","score":"1","tags":"sql-server|coldfusion","view_count":"1491"} +{"id":"7610562","title":"Center page in IE","body":"\u003cp\u003eI am trying to center page on IE. If I force quirk-mode by adding \u003ccode\u003e\u0026lt;!-- some comment --\u0026gt;\u003c/code\u003e before DOCTYPE declaration \u003ccode\u003emargin: auto;\u003c/code\u003e doesn't work properly and page is adjusted to the left. If I remove the comment page is centered, but some other elements are in mess. Could you give me some hints how to solve this?\u003c/p\u003e","answer_count":"3","comment_count":"3","creation_date":"2011-09-30 12:46:18.497 UTC","last_activity_date":"2011-09-30 12:52:50.01 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"969795","post_type_id":"1","score":"2","tags":"css|internet-explorer|quirks-mode","view_count":"423"} +{"id":"33523013","title":"How to build a number from a list of numbers in Prolog?","body":"\u003cp\u003eI'm pretty new in Prolog, and I was trying (without any success) to get a number from it's representation as a list of numbers.\nEg:\nL=[1,2,3] =\u003e N=123\nI managed to build this recursive algorithm but it sais \"Arithmetic Conv is not a function\". Can someone help me correcting it?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e conv([],0).\n conv([H|T],R):-\n R is H*10+conv(T,R).\n conv([E],R):-\n R is E.\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"33554960","answer_count":"1","comment_count":"0","creation_date":"2015-11-04 13:21:02.52 UTC","last_activity_date":"2015-11-05 21:22:39.913 UTC","last_edit_date":"2015-11-05 21:22:39.913 UTC","last_editor_display_name":"","last_editor_user_id":"4609915","owner_display_name":"","owner_user_id":"5524834","post_type_id":"1","score":"1","tags":"list|prolog|clpfd","view_count":"50"} +{"id":"46986185","title":"Tube geometry not working with array of vertices [ THREE.js ]","body":"\u003cp\u003eI am having a little problem creating a tube spline from a array random points. I don´t have no clue why this doesn't work. \u003c/p\u003e\n\n\u003cp\u003eI get this error:\u003c/p\u003e\n\n\u003cp\u003eUncaught TypeError: Cannot read property 'x' of undefined\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e for (var i = 0; i \u0026lt; 5; i++) {\n\n //particle = new THREE.Sprite( material );\n particle.position.x = (Math.random() - 0.5)* 20;\n particle.position.y = (Math.random() - 0.5)* 20;\n particle.position.z = (Math.random() - 0.5)* 20;\n\n particle.scale.x = particle.scale.y = 1;\n scene.add( particle );\n\n geometry.vertices.push( particle.position );\n\n //var line = new THREE.Line( geometry, new THREE.LineBasicMaterial( { color: 0xffffff, opacity: 0.5 } ) );\n\n //scene.add( line );\n\n//HERE IS WHERE THE PROBLEM START\n\n var tubeVertices = new THREE.Vector3(geometry.vertices);\n var Spline = new THREE.CatmullRomCurve3( \n tubeVertices\n );\n\n var material = new THREE.MeshLambertMaterial( { color: 0xff00ff } );\n var tubeGeometry = new THREE.TubeGeometry( Spline, 5, 1, 5);\n var tube = new THREE.Mesh(tubeGeometry,material);\n scene.add( tube ); \n\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI had tried this way but it doesn't work also. I add a picture of the error. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e ....\n var tubeVertices = new THREE.Vector3(geometry.vertices[1]);\n console.log(tubeVertices);\n\n var sampleClosedSpline = new THREE.CatmullRomCurve3( \n new THREE.Vector3(geometry.vertices[0]),\n new THREE.Vector3(geometry.vertices[1]),\n new THREE.Vector3(geometry.vertices[2]),\n new THREE.Vector3(geometry.vertices[3]),\n new THREE.Vector3(geometry.vertices[4])\n );\n ...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/ACjFP.jpg\" rel=\"nofollow noreferrer\"\u003ehere is what i am trying to make\u003c/a\u003e\n\u003ca href=\"https://i.stack.imgur.com/Ptwqg.png\" rel=\"nofollow noreferrer\"\u003eERROR_IMG\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThank you in advance \u003c/p\u003e","answer_count":"0","comment_count":"6","creation_date":"2017-10-28 04:15:34.31 UTC","last_activity_date":"2017-10-30 19:50:45.797 UTC","last_edit_date":"2017-10-30 19:50:45.797 UTC","last_editor_display_name":"","last_editor_user_id":"8846617","owner_display_name":"","owner_user_id":"8846617","post_type_id":"1","score":"0","tags":"javascript|arrays|three.js|geometry|vertices","view_count":"42"} +{"id":"27042719","title":"Newton method for computing an inverse","body":"\u003cp\u003eThis is following the question I asked in this thread : \u003ca href=\"https://stackoverflow.com/questions/27040467/link-error-missing-vtable/27042411#27042411\"\u003eLink error missing vtable\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI defined a class 'function' and two others classes 'polynomial' and 'affine' that inherit from 'function'. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass function {\n\n public:\n function(){};\n virtual function* clone()const=0;\n virtual float operator()(float x)const=0; //gives the image of a number by the function\n virtual function* derivative()const=0;\n virtual float inverse(float y)const=0; \n virtual ~function(){}\n\n };\n\n class polynomial : public function {\n protected:\n int degree;\n private:\n float *coefficient;\n public:\n\n polynomial(int d);\n virtual~polynomial();\n virtual function* clone()const;\n int get_degree()const;\n float operator[](int i)const; //reads coefficient number i\n float\u0026amp; operator[](int i); //updates coefficient number i\n virtual float operator()(float x)const; \n virtual function* derivative()const;\n virtual float inverse(float y)const; \n\n };\n\n class affine : public polynomial {\n int a; \n int b; \n //ax+b\n public:\n affine(int d,float a_, float b_);\n function* clone()const;\n float operator()(float x)const;\n function* derivative()const;\n float inverse(float y)const;\n ~affine(){}\n };\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMethod \u003cstrong\u003einverse\u003c/strong\u003e in \u003cstrong\u003epolyomial\u003c/strong\u003e does not seem to work fine. It is based on the Newton method applied to the function x-\u003ef(x)-y for fixed y (the element for which we're computing the inverse) and the current polynomial f. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efloat polynomial::inverse(float y)const\n{\n int i=0;\n float x0=1;\n function* deriv=derivative();\n float x1=x0+(y-operator()(x0))/(deriv-\u0026gt;operator()(x0));\n while(i\u0026lt;=100 \u0026amp;\u0026amp; abs(x1-x0)\u0026gt;1e-5)\n {\n x0=x1;\n x1=x0+(y-operator()(x0))/(deriv-\u0026gt;operator()(x0));\n i++;\n }\n\n if(abs(x1-x0)\u0026lt;=1e-5) \n {\n //delete deriv; //I get memory problems when I uncomment this line\n return x1; \n }\n\n else \n {\n cout\u0026lt;\u0026lt;\"Maximum iteration reached in polynomial method 'inverse'\"\u0026lt;\u0026lt;endl;\n //delete deriv; //same here\n return -1;\n }\n}\n\ndouble polynomial::operator()(double x)const\n{\n double value=0;\n for(int i=0;i\u0026lt;=degree;i++) value+=coefficient[i]*pow(x,i);\n return value;\n}\npolynomial* polynomial::derivative()const\n{\n if(degree==0)\n {\n return new affine(0,0,0);\n }\n polynomial* deriv=new polynomial(degree-1);\n for(int i=0;i\u0026lt;degree;i++)\n deriv[i]=(i+1)*coefficient[i+1]; \n return deriv;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI test this method with p:x-\u003ex^3 :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \"function.h\"\n\nint main(int argc, const char * argv[])\n{\n\n polynomial p(3);\n for(int i=0;i\u0026lt;=2;i++) p[i]=0;\n p[3]=1;\n cout\u0026lt;\u0026lt;\"27^(1/3)=\"\u0026lt;\u0026lt;p.inverse(27);\n\n\n\n return 0;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis script outputs \u003ccode\u003e27^(1/3)=Maximum iteration reached in polynomial method 'inverse'\n-1\u003c/code\u003e even if I put 10,000 instead of 100. I've read some articles on the internet and it seems that it's a common way to compute the inverse. \u003c/p\u003e","answer_count":"2","comment_count":"4","creation_date":"2014-11-20 15:01:36.25 UTC","last_activity_date":"2014-11-20 21:32:42.497 UTC","last_edit_date":"2017-05-23 11:57:55.02 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"4248384","post_type_id":"1","score":"0","tags":"c++|xcode4","view_count":"368"} +{"id":"21523769","title":"Joomla 3.2 security breach","body":"\u003cp\u003eI have the following problem on a joomla 3.2 site. \u003c/p\u003e\n\n\u003cp\u003eI developed the site on localhost environment using xampp with no problems. \u003c/p\u003e\n\n\u003cp\u003eWhen I moved the site on a live server it got hacked. The hacker used the the core function from joomla (add image) to insert a script that hacked the entire server. \u003c/p\u003e\n\n\u003cp\u003eThe hacker renamed the script into a .jpg or .png extension and was able to upload it on the server. My confusion is that on localhost I am unnable to upload a script renamed into a .jpg or .png extension because it says \"invalid image type\", however on the live site I can upload anything as long as I rename the file with an image extension. \u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eMy question is:\u003c/strong\u003e \u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eHow come is this possible on the live server to do this and on my localhost not? \u003c/li\u003e\n\u003cli\u003eAre there any issues with the server configuration? \u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003ePS: I checked the \u003ccode\u003e\"add image\"\u003c/code\u003e code on the localhost environment and on the live server and everything is the same.\u003c/p\u003e\n\n\u003cp\u003eThe server is Apache with PHP 5.3.28.\u003c/p\u003e\n\n\u003cp\u003eAlso I want to add that before the site was hacked the file permissions where screwed up. Now the folders are 755 and files are 644.\u003c/p\u003e\n\n\u003cp\u003eThanks \u003c/p\u003e","answer_count":"1","comment_count":"8","creation_date":"2014-02-03 09:35:16.96 UTC","favorite_count":"1","last_activity_date":"2014-12-19 23:43:41.067 UTC","last_edit_date":"2014-12-19 23:43:41.067 UTC","last_editor_display_name":"","last_editor_user_id":"1592884","owner_display_name":"","owner_user_id":"3214438","post_type_id":"1","score":"0","tags":"php|image|security|joomla","view_count":"299"} +{"id":"46953699","title":"Mysql find_in_set with Join not working in postgres","body":"\u003cp\u003eMy mysql query is working proper in SQL database server but when i run same query in Postgres database than find set is not working.\nbelow is my query : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT omh.id as idd, omh.modified as modified, omh.modified as modified1, \nDATE_FORMAT(omh.modified, '%m/%d/%Y') as only_date, DATE_FORMAT(omh.modified, '%h:%i %p') as only_time\n\nFROM order_memo_history as omh\n\nLEFT JOIN users as usr ON (FIND_IN_SET(usr.user_id, omh.users_id) != 0)\n\nINNER JOIN service_order as so ON omh.order_id = so.o_id\nLEFT JOIN users as u ON omh.user_id = u.user_id\nWHERE (omh.modified BETWEEN \"2017-09-01 06:00:00\" AND \"2017-10-27 05:59:00\")\nAND IF((so.merge_company_id='0'),(omh.company_id = 2819), ((omh.order_id = so.o_id AND omh.company_id = so.merge_company_id) OR (so.merge_company_id = 2819 \n AND (omh.group_id = 2819 OR omh.group_id = '0'))))\nGROUP BY idd ORDER BY modified ASC\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am getting error\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eERROR: function find_in_set(integer, text) does not exist\nLINE 6: LEFT JOIN users as usr ON (FIND_IN_SET(usr.user_id, omh.user...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have try with string_to_array but not worked\u003c/p\u003e","answer_count":"1","comment_count":"6","creation_date":"2017-10-26 11:56:13.94 UTC","last_activity_date":"2017-10-26 13:12:04.29 UTC","last_edit_date":"2017-10-26 11:57:09.637 UTC","last_editor_display_name":"","last_editor_user_id":"1034105","owner_display_name":"","owner_user_id":"5369026","post_type_id":"1","score":"1","tags":"mysql|database|postgresql","view_count":"40"} +{"id":"29476819","title":"Using For loop through string +","body":"\u003cp\u003eFirst, I want to say that this is my first attempt at building vba code. I am trying to extract data from the web using a web query .Add(Connection,Destination,sql). What I want my code to do is to loop through the string 'str' containing stock tickers to be inserted into my url using a for loop and pasting the table data in the active sheet. \u003c/p\u003e\n\n\u003cp\u003eIn addition, it would be an extra if I could create a new sheet for every url queried with the corresponding NYSE name.\u003c/p\u003e\n\n\u003cp\u003eCurrently my code does not run because it is not extracting the data. I think the error is in how I am specifying the url using the loop index NYSE(i).\u003c/p\u003e\n\n\u003cp\u003eThanks for any responses, advice, and suggestions.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSub URL_Get_Query()\n\n\nDim NYSE(1 To 22) As String\nNYSE(1) = \"APC\"\nNYSE(2) = \"APA\"\nNYSE(3) = \"COG\"\nNYSE(4) = \"CHK\"\nNYSE(5) = \"XEC\"\nNYSE(6) = \"CRK\"\nNYSE(7) = \"CLR\"\nNYSE(8) = \"DNR\"\nNYSE(9) = \"DVN\"\nNYSE(10) = \"ECA\"\nNYSE(11) = \"EOG\"\nNYSE(12) = \"XCO\"\nNYSE(13) = \"MHR\"\nNYSE(14) = \"NFX\"\nNYSE(15) = \"NBL\"\nNYSE(16) = \"PXD\"\nNYSE(17) = \"RRC\"\nNYSE(18) = \"ROSE\"\nNYSE(19) = \"SD\"\nNYSE(20) = \"SWN\"\nNYSE(21) = \"SFY\"\nNYSE(22) = \"WLL\"\nFor i = 1 To 22\n Debug.Print NYSE(i)\n With ActiveSheet.QueryTables.Add(Connection:= _\n \"URL;http://finance.yahoo.com/q/ks?s=NYSE(i)+Key+Statistics\", _\n Destination:=Range(\"a1\"))\n\n .BackgroundQuery = True\n .TablesOnlyFromHTML = True\n .Refresh BackgroundQuery:=False\n .SaveData = True\n End With\nNext i\nEnd Sub\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"29476993","answer_count":"1","comment_count":"2","creation_date":"2015-04-06 18:04:14.237 UTC","last_activity_date":"2015-04-06 18:14:36.087 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4755608","post_type_id":"1","score":"0","tags":"excel|vba|financial|excel-web-query","view_count":"105"} +{"id":"46271265","title":"How to make a custom markdown syntax for my markdown using remark?","body":"\u003cp\u003eI want a custom syntax for my markdown so that I can use it with my React Component. I am using using \u003ccode\u003eremark\u003c/code\u003e and \u003ccode\u003eremark-react\u003c/code\u003e to render my markdown into React components. How do a I define a custom syntax for markdown so that I can use it to render my React Component?\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-09-18 03:39:54.963 UTC","last_activity_date":"2017-09-18 03:39:54.963 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2049660","post_type_id":"1","score":"0","tags":"reactjs|syntax|markdown|custom-component|remarkjs","view_count":"22"} +{"id":"5254083","title":"Sed to wrap lines in text file?","body":"\u003cp\u003eI am a newbie with Sed. I have a bunch of ASCII files containing data that's laid out like so:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eTest_Version:2.6.3\nModel-Manufacturer:\nHR21-100\nTest_Version:2.6.3\nModel-Manufacturer:\nD12-100\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAll I want to do is fold the lines for \"Model-Manufacturer:\" like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eTest_Version:2.6.3\nModel-Manufacturer:HR21-100\nTest_Version:2.6.3\nModel-Manufacturer:D12-100\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI tried to use sed since I discovered there are 2 hex values (0xA for \\n) after \"Model-Manufacturer:\"\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecat myfile| sed -n \"/[[:xdigit:]]\\{2\\}/p\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe output looked like this for my match code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eModel-Manufacturer:\nHR21-100\nModel-Manufacturer:\nD12-100\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis tells me I am on the right track, right? What I cannot figure out is the proper match/replace code to fold the lines for \"Model-Manufacturer:\". A attempt with\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecat myfile| sed \"s/[[:xdigit:]]\\{3\\}//g\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ecompleted messed up my file. Any idea how to do this?\u003c/p\u003e","accepted_answer_id":"5254348","answer_count":"3","comment_count":"0","creation_date":"2011-03-10 00:28:08.01 UTC","last_activity_date":"2011-03-10 03:00:51.95 UTC","last_edit_date":"2011-03-10 00:34:57.38 UTC","last_editor_display_name":"","last_editor_user_id":"484638","owner_display_name":"","owner_user_id":"484638","post_type_id":"1","score":"1","tags":"sed","view_count":"2186"} +{"id":"1054913","title":"MVVM model design","body":"\u003cp\u003eIn MVVM pattern I don't want to think about the view while creating the model. So I use public properties with data stored in ILists and so on.\nBut then my viewmodel isn't informed of changes done to these lists on model side.\nShould I use ObservableCollections in my model instead? But this seems strange to me.\u003c/p\u003e","accepted_answer_id":"1055037","answer_count":"2","comment_count":"0","creation_date":"2009-06-28 13:16:16.753 UTC","favorite_count":"2","last_activity_date":"2009-06-28 14:56:05.973 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"87550","post_type_id":"1","score":"1","tags":"c#|wpf|mvvm","view_count":"1166"} +{"id":"45779263","title":"post/redirect/get - how to unset session variables","body":"\u003cp\u003eBellow is part of the code from register.php\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eif($_SERVER['REQUEST_METHOD'] == \"POST\") {\n\n /* running some checks of an input*/\n\n if(sizeof($errorArray)==0) {\n // redirecting to avoid form resubmission\n $_SESSION['registered'] = true;\n header('location: success.php',true,303);\n }\n\nelse{\n $_SESSION['post']['email'] = $_POST['email'];\n $_SESSION['post']['name'] = $_POST['name'];\n $_SESSION['errorArray'] = $errorArray;\n header('location: register.php',true,303);\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eLogic is simple -- if an errorArray is empty redirect to a success page, else redirect to register.php itself. To avoid form resubmission i tried to put post variables into session variable, so the user doesn't have to fill form again in case of error. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\n if (isset($_SESSION['errorArray'])) {\n if (sizeof($_SESSION['errorArray']) != 0) {\n echo '\u0026lt;div class=\"alert alert-danger\" role=\"alert\"\u0026gt;\n \u0026lt;h4\u0026gt;There were errors in Your input:\u0026lt;/h4\u0026gt;';\n foreach ($_SESSION['errorArray'] as $item) {\n echo $item . '\u0026lt;br\u0026gt;';\n }\n }\n $_SESSION['post'] = null;\n $_SESSION['errorArray'] = null;\n }\n ?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis part of a code is executed later in register.php but it doesen't gives me the result I want. Somehow the variables are sett to null before the loop above is executed (??!). \u003ca href=\"https://stackoverflow.com/a/5204561/8422672\"\u003eI have found a solution with get method\u003c/a\u003e that includes microtime in url passed to header , but it seams to me that there is more elegant solution that does not every time adds new values to a session variable.\u003c/p\u003e\n\n\u003cp\u003eIs there some way around this?\u003c/p\u003e\n\n\u003cp\u003eedit :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;?php\nsession_start();\nif ($_SERVER['REQUEST_METHOD'] == \"POST\") {\n\n // array to hold all the errors of input\n $errorArray = [];\n $emailRegex = '/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$/';\n $nameRegex = '/^[a-z0-9][a-z0-9_]*[a-z0-9]$/';\n $passwordRegex = '/^[a-z0-9][-a-z0-9_!@#$?]*[a-z0-9]$/';\n\n $email = $_POST['email'];\n if (empty($email)) {\n array_push($errorArray, \"E-mail field required\");\n } else {\n if (!preg_match($emailRegex, $email)) array_push($errorArray, 'Invalid email');\n }\n $name = $_POST['name'];\n if (empty($name)) {\n array_push($errorArray, \"Name field required\");\n } else {\n if (!preg_match($nameRegex, $name)) array_push($errorArray, 'Invalid name');\n }\n\n $password = $_POST['password'];\n $passwordR = $_POST['passwordR'];\n\n\n if (empty($passwordR) || empty($password)) {\n array_push($errorArray, 'Password fields required');\n } else if (!preg_match($passwordRegex, $password)) {\n array_push($errorArray, 'Invalid password');\n } else {\n if ($password !== $passwordR) {\n array_push($errorArray, 'Password inputs are not the same');\n }\n }\n\n if (sizeof($errorArray) == 0) {\n // redirecting to avoid form resubmission\n $_SESSION['registered'] = true;\n header('location: success.php', true, 303);\n } else {\n $_SESSION['post']['email'] = $_POST['email'];\n $_SESSION['post']['name'] = $_POST['name'];\n $_SESSION['errorArray'] = $errorArray;\n header('location: register.php', true, 303);\n }\n}\n?\u0026gt;\n\n\u0026lt;!DOCTYPE html\u0026gt;\n\u0026lt;html lang=\"en\"\u0026gt;\n\u0026lt;head\u0026gt;\n \u0026lt;meta charset=\"utf-8\"\u0026gt;\n \u0026lt;title\u0026gt;Log\u0026lt;/title\u0026gt;\n \u0026lt;link rel=\"stylesheet\" href=\"css/bootstrap.min.css\" type=\"text/css\"\u0026gt;\n \u0026lt;link rel=\"stylesheet\" href=\"css/maincss.css\" type=\"text/css\"\u0026gt;\n \u0026lt;meta name=\"viewport\" content=\"width = device-width, initial-scale = 1, user - scalable = no\"\u0026gt;\n \u0026lt;script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;script src=\"js/bootstrap.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\n\u0026lt;/head\u0026gt;\n\u0026lt;body\u0026gt;\n\n\u0026lt;nav class=\"navbar navbar-default navbar-fixed\"\u0026gt;\n \u0026lt;div class=\"container\"\u0026gt;\n \u0026lt;a href=\"index.php\" class=\"navbar-brand col-xs-5\"\u0026gt;Home\u0026lt;/a\u0026gt;\n \u0026lt;ul class=\"navbar-brand col-xs-5\"\u0026gt;\u0026lt;?= (isset($username)) ? 'Welcome ' . $username : ''; ?\u0026gt;\u0026lt;/ul\u0026gt;\n \u0026lt;a href=\"login.php\" class=\"navbar-brand col-xs-1\"\u0026gt;Login\u0026lt;/a\u0026gt;\n \u0026lt;a href=\"register.php\" class=\"navbar-brand col-xs-1\"\u0026gt;Register\u0026lt;/a\u0026gt;\n \u0026lt;/div\u0026gt;\n\u0026lt;/nav\u0026gt;\n\n\n\u0026lt;div class=\"container\"\u0026gt;\n\n \u0026lt;form class=\"form-signin\" action=\"register.php\" method=\"post\"\u0026gt;\n \u0026lt;h2 class=\"form-signin-heading text-center text-capitalize\"\u0026gt;Registration form\u0026lt;/h2\u0026gt;\n \u0026lt;!-- I have purposely excluded required attribute from inputs and set type=\"text\"\n for an email so all the checks could be done on server side --\u0026gt;\n \u0026lt;div class=\"row center-block\"\u0026gt;\n \u0026lt;div class=\"col-xs-4\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;div class=\"col-xs-4\"\u0026gt;\n \u0026lt;label for=\"email\" class=\"sr-only\"\u0026gt;Email address\u0026lt;/label\u0026gt;\n \u0026lt;input type=\"text\" id=\"email\" name=\"email\" class=\"form-control\" placeholder=\"Email address\"\n value=\"\u0026lt;?= (isset($_SESSION['post']['email'])) ? $_SESSION['post']['email'] : ''; ?\u0026gt;\" autofocus\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"col-xs-4\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;br\u0026gt;\n \u0026lt;div class=\"row center-block\"\u0026gt;\n \u0026lt;div class=\"col-xs-4\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;div class=\"col-xs-4\"\u0026gt;\n \u0026lt;label for=\"name\" class=\"sr-only\"\u0026gt;Name\u0026lt;/label\u0026gt;\n \u0026lt;input type=\"text\" id=\"name\" name=\"name\" class=\"form-control\" placeholder=\"Name\"\n value=\"\u0026lt;?= (isset($_SESSION['post']['name'])) ? $_SESSION['post']['name'] : ''; ?\u0026gt;\" autofocus\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"col-xs-4\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;br\u0026gt;\n \u0026lt;div class=\"row center-block\"\u0026gt;\n \u0026lt;div class=\"col-xs-4\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;div class=\"col-xs-4\"\u0026gt;\n \u0026lt;label for=\"password\" class=\"sr-only\"\u0026gt;Password\u0026lt;/label\u0026gt;\n \u0026lt;input type=\"password\" id=\"password\" name=\"password\" class=\"form-control\" placeholder=\"Password\"\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"col-xs-4\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;br\u0026gt;\n \u0026lt;div class=\"row center-block\"\u0026gt;\n \u0026lt;div class=\"col-xs-4\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;div class=\"col-xs-4\"\u0026gt;\n \u0026lt;label for=\"passwordR\" class=\"sr-only\"\u0026gt;Repeat Password\u0026lt;/label\u0026gt;\n \u0026lt;input type=\"password\" id=\"passwordR\" name=\"passwordR\" class=\"form-control\"\n placeholder=\"Repeat Password\"\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"col-xs-4\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;br\u0026gt;\n \u0026lt;div class=\"row\"\u0026gt;\n \u0026lt;div class=\"col-xs-4\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;div class=\"col-xs-4 center-block\"\u0026gt;\n \u0026lt;button class=\"btn btn-lg btn-primary btn-block\" type=\"submit\"\u0026gt;Submit\u0026lt;/button\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"col-xs-4\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;br\u0026gt;\n \u0026lt;div\u0026gt;\n \u0026lt;?php\n if (isset($_SESSION['errorArray'])) {\n if (sizeof($_SESSION['errorArray']) != 0) {\n echo '\u0026lt;div class=\"alert alert-danger\" role=\"alert\"\u0026gt;\n \u0026lt;h4\u0026gt;There were errors in Your input:\u0026lt;/h4\u0026gt;';\n foreach ($_SESSION['errorArray'] as $item) {\n echo $item . '\u0026lt;br\u0026gt;';\n }\n }\n // $_SESSION['post'] = null;\n // $_SESSION['errorArray'] = null;\n }\n ?\u0026gt;\n \u0026lt;/div\u0026gt;\n\n \u0026lt;/form\u0026gt;\n\u0026lt;/body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"4","creation_date":"2017-08-20 06:47:46.733 UTC","last_activity_date":"2017-08-20 07:42:37.77 UTC","last_edit_date":"2017-08-20 07:42:37.77 UTC","last_editor_display_name":"","last_editor_user_id":"8422672","owner_display_name":"","owner_user_id":"8422672","post_type_id":"1","score":"0","tags":"php|session|registration","view_count":"45"} +{"id":"4135782","title":"Annoying mysql update query problem","body":"\u003cp\u003eI'm trying to update using mysql_query in php and it gives me this error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'read='1' WHERE id='14'' at line 1\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI've been looking at my query for about 10 minutes now and I cant find whats wrong with it. Here it is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e if ($row['read'] == 0) {\n mysql_query(\"UPDATE mail SET read='1' WHERE id='$mailid'\") or die(mysql_error());\n } \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eDo anyone see where the error is?\u003c/p\u003e","accepted_answer_id":"4135800","answer_count":"3","comment_count":"0","creation_date":"2010-11-09 16:06:16.503 UTC","last_activity_date":"2010-11-09 16:08:15.783 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"441695","post_type_id":"1","score":"0","tags":"php|mysql","view_count":"100"} +{"id":"33185987","title":"Interrupt based Soft_Uart with MikroC libraries","body":"\u003cp\u003eIs there any way to use MikroC Pro for PIC libraries to make an interrupt on change based soft_uart?\u003c/p\u003e\n\n\u003cp\u003ebytes read by the below routine are rubbish. I am using a 20MHz crystal, and will try a 32MHz one when I get one.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003echar error, data_;\n\nvoid interrupt(){\n if (IOCAF.IOCAF2){\n do{\n data_ = Soft_Uart_Read(\u0026amp;error);\n }while(error);\n Soft_Uart_Write(data_);\n IOCAF.IOCAF2 = 0;\n }\n}\n\nvoid main() {\n //set RA2, pin 11, as input\n TRISA = 0b001100;\n TRISC = 0;\n ANSELA = 0;\n ANSELC = 0;\n //enable interrupts\n INTCON.GIE = 1;\n //enable interrupt on change\n INTCON.IOCIE = 1;\n //Clear all IOC flags in PORTA\n IOCAF = 0;\n //enable rising edge detection on RA2, pin 11\n IOCAP.IOCAP2 = 1;\n //Initialise software uart Pin11 = Rx, Pin12 = Tx\n error = Soft_Uart_Init(\u0026amp;PORTA, 2,1,9600,0);\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-10-17 11:15:52.55 UTC","last_activity_date":"2015-10-18 09:15:21.46 UTC","last_edit_date":"2015-10-18 07:24:57.6 UTC","last_editor_display_name":"","last_editor_user_id":"2804458","owner_display_name":"","owner_user_id":"2804458","post_type_id":"1","score":"0","tags":"pic|uart|mikroc","view_count":"364"} +{"id":"25130629","title":"Dynamic nested json string to java object using jackson","body":"\u003cp\u003ei have trouble in parsing json\u003c/p\u003e\n\n\u003cp\u003eI have a nested json string, i need to convert to java object , the string look like this, i want to ask how to handle this nested dynamic json using jackson, how to decode dynamic nested json string \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n\n\"resultCode\": \"0\",\n\"dataObject\": [\n {\n \"lastSyncDate\": \"20140101000000\",\n \"count\": 2,\n \"refType\": \"ADO\",\n \"update\": [\n {\n \"artist\": \"C\",\n \"albumTitle\": \"道\",\n \"productTitle\": \"道\",\n \"thumbnail\": \"http://w.com/mposter/album/m/VACL00020880A_m.jpg\",\n \"lastSyncDate\": \"20140425120159\",\n \"refId\": \"VACL00214522\"\n },\n {\n \"artist\": \"楊\",\n \"albumTitle\": \"學\",\n \"productTitle\": \"美\",\n \"thumbnail\": \"http://m.jpg\",\n \"lastSyncDate\": \"20140324161831\",\n \"refId\": \"VACP00168673\"\n }\n ],\n \"delete\": [ ]\n },\n {\n \"lastSyncDate\": \"20140101000000\",\n \"count\": 8,\n \"refType\": \"PAT\",\n \"update\": [\n {\n \"artist\": \"方\",\n \"thumbnail\": \"http://t.com/moov/images/profile/PAT/8/70/00021870_tn_1_s.jpg\",\n \"lastSyncDate\": \"20140201010203\",\n \"refId\": \"00021870\"\n },\n {\n \"artist\": \"楊\",\n \"lastSyncDate\": \"20140328120831\",\n \"refId\": \"00000125\"\n },\n {\n \"artist\": \"陳\",\n \"thumbnail\": \"http://s.jpg\",\n \"lastSyncDate\": \"20140328185030\",\n \"refId\": \"00017704\"\n }\n ],\n \"delete\": [ ]\n },\n {\n \"lastSyncDate\": \"20140101000000\",\n \"count\": 4,\n \"refType\": \"PAB\",\n \"update\": [\n {\n \"artist\": \"陳\",\n \"albumTitle\": \"The Key\",\n \"thumbnail\": \"http:/m.jpg\",\n \"lastSyncDate\": \"20140603143528\",\n \"refId\": \"VAUN00031629A\"\n },\n {\n \"artist\": \"何\",\n \"albumTitle\": \"梁\",\n \"thumbnail\": \"http://m.jpg\",\n \"lastSyncDate\": \"20140603143528\",\n \"refId\": \"VAEA00003170A\"\n },\n {\n \"artist\": \"何\",\n \"albumTitle\": \"艷\",\n \"thumbnail\": \"http://m.jpg\",\n \"lastSyncDate\": \"20110603151452\",\n \"refId\": \"VAEA00003179A\"\n }\n ],\n \"delete\": [ ]\n },\n {\n \"lastSyncDate\": \"20140101000000\",\n \"count\": 4,\n \"refType\": \"PP\",\n \"update\": [\n {\n \"chiName\": \"其\",\n \"engName\": \"Other\",\n \"lastSyncDate\": \"20140130010203\",\n \"chiAuthor\": \"\",\n \"engAuthor\": \"\",\n \"refId\": \"PP1000000003\"\n },\n {\n \"chiName\": \"演\",\n \"engName\": \"E演\",\n \"thumbnail\": \"http://s.jpg\",\n \"lastSyncDate\": \"20140126010758\",\n \"chiAuthor\": \"專\",\n \"engAuthor\": \"Recommended\",\n \"refId\": \"PP1000000040\"\n },\n {\n \"chiName\": \"日本派台歌\",\n \"engName\": \"Japan New Releases\",\n \"lastSyncDate\": \"20140126010758\",\n \"chiAuthor\": \"\",\n \"engAuthor\": \"\",\n \"refId\": \"PP1000000057\"\n },\n {\n \"chiName\": \"9\",\n \"engName\": \"9\",\n \"thumbnail\": \"http://s.jpg\",\n \"lastSyncDate\": \"20140126010203\",\n \"chiAuthor\": \"專\",\n \"engAuthor\": \"Recommended\",\n \"refId\": \"PP1000000048\"\n }\n ],\n \"delete\": [ ]\n }\n]\n\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"25131473","answer_count":"2","comment_count":"1","creation_date":"2014-08-05 03:14:54.953 UTC","favorite_count":"2","last_activity_date":"2015-01-05 10:14:34.287 UTC","last_edit_date":"2014-08-05 03:59:23.893 UTC","last_editor_display_name":"","last_editor_user_id":"23893","owner_display_name":"","owner_user_id":"3324733","post_type_id":"1","score":"0","tags":"java|json|object|nested|jackson","view_count":"10330"} +{"id":"17267341","title":"How do I mark conflicts as resolved in the git GUI tool?","body":"\u003cp\u003eI'm trying to merge changes from a feature branch into the development branch of my project. I use both the GitHub GUI app for Mac OS X as well as the command line to manage my git projects. For a long time, I've been able to manage merge conflicts with the command line, but I have no idea if and how to do the same thing in the GUI client. Even if I resolve the conflicts in BBEdit and then click the \"Commit\" button, it still says:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e•error: 'commit' is not possible because you have unmerged files.\nhint: Fix them up in the work tree,\nhint: and then use 'git add/rm \u0026lt;file\u0026gt;' as\nhint: appropriate to mark resolution and make a commit,\nhint: or use 'git commit -a'.\nfatal: Exiting because of an unresolved conflict.\n (128)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow can I resolve this without resorting to the command line?\u003c/p\u003e","answer_count":"2","comment_count":"6","creation_date":"2013-06-24 02:43:39.977 UTC","favorite_count":"2","last_activity_date":"2016-11-11 12:49:19.133 UTC","last_edit_date":"2013-06-24 03:35:08.367 UTC","last_editor_display_name":"","last_editor_user_id":"1157237","owner_display_name":"","owner_user_id":"1023812","post_type_id":"1","score":"3","tags":"git|merge","view_count":"3992"} +{"id":"24708139","title":"Python - validate a url as having a domain name or ip address","body":"\u003cp\u003eI need to validate a url in Python and ensure that the host/netloc component is a domain name or ip v4/v6 address.\u003c/p\u003e\n\n\u003cp\u003eMost StackOverflow Q\u0026amp;As on this general topic say to \"just use \u003ccode\u003eurlparse\u003c/code\u003e\". That is not applicable to this situation.\u003c/p\u003e\n\n\u003cp\u003eI have already used \u003ccode\u003eurlparse\u003c/code\u003e to validate that I do indeed have a url. \u003c/p\u003e\n\n\u003cp\u003eThe problem is that I need to further validate the \u003ccode\u003e.netloc\u003c/code\u003e from urlparse to ensure that I am getting a Domain Name OR IP Address, and not just a hostname.\u003c/p\u003e\n\n\u003cp\u003eLet me illustrate:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026gt;\u0026gt;\u0026gt; from urlparse import urlparse\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis works as expected / desired :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026gt;\u0026gt;\u0026gt; ## domain name\n\u0026gt;\u0026gt;\u0026gt; print urlparse(\"http://example.com\").netloc\nexample.com\n\n\u0026gt;\u0026gt;\u0026gt; ## ipv4\n\u0026gt;\u0026gt;\u0026gt; print urlparse(\"http://255.255.255.255\").netloc\n255.255.255.255\n\n\u0026gt;\u0026gt;\u0026gt; ## acceptable hostname\n\u0026gt;\u0026gt;\u0026gt; print urlparse(\"http://localhost\").netloc\nlocalhost\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut I often run into typos that will let a malformed URL slip through. Someone might accidentally miss a '.' in a domain name:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026gt;\u0026gt;\u0026gt; ## valid hostname, but unacceptable\n\u0026gt;\u0026gt;\u0026gt; print urlparse(\"http://examplecom\").netloc\nexamplecom\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003ccode\u003eexamplecom\u003c/code\u003e is indeed a valid hostname, and could exist on a network, but it is not a valid domain name.\u003c/p\u003e\n\n\u003cp\u003eThere also doesn't seem to be any rules enforced for IP Addresses :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026gt;\u0026gt;\u0026gt; print urlparse(\"http://266.266.266.266\").netloc\n266.266.266.266\n\n\u0026gt;\u0026gt;\u0026gt; print urlparse(\"http://999.999.999.999.999\").netloc\n999.999.999.999.999\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"2","creation_date":"2014-07-11 23:44:42.24 UTC","last_activity_date":"2014-07-12 00:15:38.067 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"442650","post_type_id":"1","score":"0","tags":"python|url","view_count":"1554"} +{"id":"14604782","title":"XSL syntax to only copy with more than one word","body":"\u003cp\u003eI have large XML files that must be trimmed to exclude specific nodes, and use xsl:template match statements to identify some for exclusion.\u003c/p\u003e\n\n\u003cp\u003eBut what syntax can I use to exclude or include based on number of words?\u003c/p\u003e\n\n\u003cp\u003eExample: this is used to exclude string nodes where the content of instring is identical to the content of outstring\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;xsl:template match=\"string[instring=outstring]\"/\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI need to change that to only match if it is also the case that there is more than one word in instring and outstring. \u003c/p\u003e\n\n\u003cp\u003ePseudo syntax now is: exclude string nodes where instring = outstring\nPseudo syntax needed is: exclude string nodes where instring = outstring AND instring/outstring is more than one word (i.e. keep those identical strings, if they are just one word)\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-01-30 13:07:15.873 UTC","last_activity_date":"2013-01-30 14:17:29.997 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2025383","post_type_id":"1","score":"0","tags":"xslt","view_count":"44"} +{"id":"30234368","title":"Magento: Rewriting Mage_Eav_Model_Entity_Type","body":"\u003cp\u003eI'm trying to override Magento order number creation by rewriting class Mage_Eav_Model_Entity_Type.\u003c/p\u003e\n\n\u003cp\u003eapp/code/local/Custom/MyModule/Model/Entity/Type.php:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\nclass Custom_MyModule_Model_Entity_Type extends Mage_Eav_Model_Entity_Type {\n public function fetchNewIncrementId($storeId = null) {\n $incrementId = parent::fetchNewIncrementId($storeId);\n $incrementId = 'test' . $incrementId;\n return $incrementId;\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut what should I write to app/code/local/Custom/MyModule/etc/config.xml? See TODO1 and TODO2 below.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\"?\u0026gt;\n\u0026lt;config\u0026gt;\n \u0026lt;modules\u0026gt;\n \u0026lt;Custom_MyModule\u0026gt;\n \u0026lt;version\u0026gt;1.0.0\u0026lt;/version\u0026gt;\n \u0026lt;/Custom_MyModule\u0026gt;\n \u0026lt;/modules\u0026gt;\n \u0026lt;global\u0026gt;\n \u0026lt;models\u0026gt;\n \u0026lt;TODO1\u0026gt;\n \u0026lt;rewrite\u0026gt;\n \u0026lt;TODO2\u0026gt;Custom_MyModule_Model_Entity_Type\u0026lt;/TODO2\u0026gt;\n \u0026lt;/rewrite\u0026gt;\n \u0026lt;/TODO1\u0026gt;\n \u0026lt;/models\u0026gt;\n \u0026lt;/global\u0026gt;\n\u0026lt;/config\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"30234531","answer_count":"1","comment_count":"0","creation_date":"2015-05-14 09:58:32.267 UTC","last_activity_date":"2015-05-14 10:12:47.73 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2158271","post_type_id":"1","score":"1","tags":"php|magento","view_count":"158"} +{"id":"40749869","title":"Linked List sorting error","body":"\u003cp\u003eThis code is supposed to sort through a list of 6 elements, ignoring the first. For some reason, I always get an error stating \"TypeError: 'NoneType' object is not subscriptable\". If anyone could offer me a solution or explain a fix to me that would be much appreciated.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef bubbleSortLinkedList(aLinkedList):\n pointer = aLinkedList\n swapped = True\n while swapped:\n pointer = aLinkedList['next']\n swapped = False\n for i in range(4):\n if pointer['data'] \u0026gt; pointer['next']['data']:\n pointer['data'], pointer['next']['data'] = pointer['next']['data'], pointer['data']\n swapped = True\n pointer = pointer['next']\n aLinkedList = pointer \n return aLinkedList\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"40750269","answer_count":"1","comment_count":"2","creation_date":"2016-11-22 19:12:56.54 UTC","last_activity_date":"2016-11-22 19:39:15.853 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7120770","post_type_id":"1","score":"0","tags":"python|linked-list|bubble-sort","view_count":"41"} +{"id":"17302152","title":"Checkbox - check add text, uncheck remove original text in text area","body":"\u003cpre\u003e\u003ccode\u003e\u0026lt;script language=\"javascript\" type=\"text/javascript\"\u0026gt;\n\nfunction moveNumbers(num) { \n var txt=document.getElementById(\"result\").value; \n txt=txt + num; \n document.getElementById(\"result\").value=txt; \n} \n\u0026lt;/script\u0026gt;\n\n\u0026lt;textarea id=\"result\" name=\"image_id\" rows=\"8\" cols=\"11\" readonly\u0026gt;\n\n\u0026lt;/textarea\u0026gt;\n\u0026lt;tr\u0026gt;\n\n \u0026lt;?php\n $path = \"photos/\";\n $dir_handle = @opendir($path) or die(\"Unable to open folder\");\n echo \"\u0026lt;table height='500px'width='800px'align='center'border='1'\u0026gt;\";\n echo \"\u0026lt;tr\u0026gt;\";\n while (false !== ($file = readdir($dir_handle))) {\n\n if($file == \"index.php\")\n continue;\n if($file == \".\")\n continue;\n if($file == \"..\")\n continue;\n\n echo ($x % 6 == 0) ? \"\u0026lt;/tr\u0026gt;\u0026lt;tr\u0026gt;\" : \"\";\n echo \"\u0026lt;td\u0026gt;\u0026lt;input type='checkbox' name='add' value='$file' \n onclick='moveNumbers(this.value)'\u0026gt;\n \u0026lt;img src='photos/$file'alt='$file' style='height:auto;width:50%;'alt='$file'\u0026gt;\n \u0026lt;br\u0026gt;\n $file\n \u0026lt;/td\u0026gt;\";\n $x++;\n }\n echo \"\u0026lt;/tr\u0026gt;\";\n echo \"\u0026lt;/table\u0026gt;\";\n closedir($dir_handle);\n ?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHi all, having some trouble with the check boxes. Click on the check box, text appears in text area no problem. I have been trying to figure out how to when you uncheck the check box the text is removed. E.G. Checked -\u003e Text 123 inputted, Uncheck -\u003e Test 123 removed.\nCheers.\u003c/p\u003e","accepted_answer_id":"17302322","answer_count":"2","comment_count":"2","creation_date":"2013-06-25 16:03:26.037 UTC","last_activity_date":"2013-06-26 06:50:38.433 UTC","last_edit_date":"2013-06-26 06:50:38.433 UTC","last_editor_display_name":"","last_editor_user_id":"2231905","owner_display_name":"","owner_user_id":"1829346","post_type_id":"1","score":"0","tags":"php|javascript|html","view_count":"1143"} +{"id":"17999701","title":"C# Display 2 decimal places","body":"\u003cp\u003eI cant figure out how to display 2 decimal within this code. Below is a code show when i chose the option from combobox1 and combobox2 then i key any value to textbox2, so it will store the new value. And also if i chose back the same option from combobox1 and combobox2 it will auto take 1/textBox2.Text. But i want to display only 2 decimal places. Can anyone help out with this code? \u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e int index1 = comboBox1.SelectedIndex;\n int index2 = comboBox2.SelectedIndex;\n arr[index1, index2] = double.Parse(textBox2.Text);\n arr[index2, index1] = (1 / double.Parse(textBox2.Text)); \n MessageBox.Show(\"Your Current Rate Have Been Updated\"); \n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"2","creation_date":"2013-08-01 16:34:49.283 UTC","last_activity_date":"2013-08-01 17:09:33.057 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2607234","post_type_id":"1","score":"0","tags":"c#","view_count":"9046"} +{"id":"8044578","title":"Switch from Synchronous request to Asynchronous request with image upload?","body":"\u003cp\u003eI need some help, i have been searching around and cant find the correct answer im looking for.\u003c/p\u003e\n\n\u003cp\u003eI am uploading images and videos to my server via php, When im uploading the video or image, i want to be able to show a progress view, i have been told that the only way to do this is to use asynchronous instead of synchronous. I have been looking at ways to set up this, but cant really seem to find a good tutorial that will help me with what im trying to accomplish.\u003c/p\u003e\n\n\u003cp\u003eHere is some code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e- (void)post:(NSData *)fileData\n{\n\n\nNSMutableArray *array = [[NSMutableArray alloc]initWithContentsOfFile:[self saveUserLogin]];\n\nint test;\nNSString *string = [array objectAtIndex:3];\ntest = [string intValue];\ntest++;\nNSData *videoData = fileData;\nNSString *urlString = [[NSString alloc]initWithFormat:@\"http://www.site.com/members/uploadMovie.php?\u0026amp;username=%@\", [array objectAtIndex:0]];\n\nNSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];\n[request setURL:[NSURL URLWithString:urlString]];\n[request setHTTPMethod:@\"POST\"];\n\nNSString *boundary = [NSString stringWithString:@\"---------------------------14737809831466499882746641449\"];\nNSString *contentType = [NSString stringWithFormat:@\"multipart/form-data; boundary=%@\", boundary];\n[request addValue:contentType forHTTPHeaderField:@\"Content-Type\"];\n\nNSMutableData *body = [NSMutableData data];\n[body appendData:[[NSString stringWithFormat:@\"\\r\\n--%@\\r\\n\", boundary] dataUsingEncoding:NSUTF8StringEncoding]];\nNSString *postName = [[NSString alloc]initWithFormat:@\"Content-Disposition: form-data; name=\\\"userfile\\\"; filename=\\\"vid%i.mov\\\"\\r\\n\", test];\n[body appendData:[[NSString stringWithString:postName] dataUsingEncoding:NSUTF8StringEncoding]];\n[body appendData:[[NSString stringWithString:@\"Content-Type: application/octet-stream\\r\\n\\r\\n\"] dataUsingEncoding:NSUTF8StringEncoding]];\n[body appendData:[NSData dataWithData:videoData]];\n[body appendData:[[NSString stringWithFormat:@\"\\r\\n--%@--\\r\\n\", boundary] dataUsingEncoding:NSUTF8StringEncoding]];\n[request setHTTPBody:body];\n\n\nNSData *returnData = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];\nNSString *returnString = [[NSString alloc] initWithData:returnData encoding:NSUTF8StringEncoding];\n\nNSLog(@\"%@\", returnString);\n\nNSArray *values = [[NSArray alloc] initWithObjects: [array objectAtIndex:0],[array objectAtIndex:1], [array objectAtIndex:2], [NSString stringWithFormat:@\"%i\", test], nil];\n[values writeToFile:[self saveUserLogin] atomically:YES];\n[self.delegate didFinishController:self];\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethis is some code that im using to send a video. filedata is a paramater being passed in with the video data. I want to animate a UIProgressview for the upload progress. I have also heard that apple likes people to use asynchronous anyways. If someone could please help me set up asynchronous instead of what i have, i would be really grateful. Please be specific if you reply, like to what i need to import what delegates, methods. etc.\u003c/p\u003e\n\n\u003cp\u003eThank you very much :)\u003c/p\u003e\n\n\u003cp\u003eEDIT:\u003c/p\u003e\n\n\u003cp\u003eThis is what it looks like now:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e- (void)post:(NSData *)fileData\n{\n\n\nNSMutableArray *array = [[NSMutableArray alloc]initWithContentsOfFile:[self saveUserLogin]];\n\nint test;\nNSString *string = [array objectAtIndex:3];\ntest = [string intValue];\ntest++;\nNSData *videoData = fileData;\nNSString *urlString = [[NSString alloc]initWithFormat:@\"http://www.site.com/members/uploadMovie.php?\u0026amp;username=%@\", [array objectAtIndex:0]];\n\nNSMutableURLRequest *request = [[NSMutableURLRequest alloc]initWithURL:[NSURL URLWithString:urlString] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:30];\n\nNSString *boundary = [NSString stringWithString:@\"---------------------------14737809831466499882746641449\"];\nNSString *contentType = [NSString stringWithFormat:@\"multipart/form-data; boundary=%@\", boundary];\n[request addValue:contentType forHTTPHeaderField:@\"Content-Type\"];\n\nNSMutableData *body = [NSMutableData data];\n[body appendData:[[NSString stringWithFormat:@\"\\r\\n--%@\\r\\n\", boundary] dataUsingEncoding:NSUTF8StringEncoding]];\nNSString *postName = [[NSString alloc]initWithFormat:@\"Content-Disposition: form-data; name=\\\"userfile\\\"; filename=\\\"vid%i.mov\\\"\\r\\n\", test];\n[body appendData:[[NSString stringWithString:postName] dataUsingEncoding:NSUTF8StringEncoding]];\n[body appendData:[[NSString stringWithString:@\"Content-Type: application/octet-stream\\r\\n\\r\\n\"] dataUsingEncoding:NSUTF8StringEncoding]];\n[body appendData:[NSData dataWithData:videoData]];\n[body appendData:[[NSString stringWithFormat:@\"\\r\\n--%@--\\r\\n\", boundary] dataUsingEncoding:NSUTF8StringEncoding]];\n[request setHTTPBody:body];\n\n\n//NSData *returnData = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];\n//NSString *returnString = [[NSString alloc] initWithData:returnData encoding:NSUTF8StringEncoding];\nNSURLConnection *connection = [[NSURLConnection alloc]initWithRequest:request delegate:self];\nif (connection) {\n NSLog(@\"connected\");\n responceData = [NSMutableData data];\n\n}\nelse{\n NSLog(@\"error\");\n}\n// NSLog(@\"%@\", returnString);\n\nNSArray *values = [[NSArray alloc] initWithObjects: [array objectAtIndex:0],[array objectAtIndex:1], [array objectAtIndex:2], [NSString stringWithFormat:@\"%i\", test], nil];\n[values writeToFile:[self saveUserLogin] atomically:YES];\n // [self.delegate didFinishController:self];\n}\n\n- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {\n[responceData appendData:data];\n}\n\n- (void) connectionDidFinishLoading:(NSURLConnection *)connection {\n\nNSString* responseString = [[NSString alloc] initWithData:responceData encoding:NSUTF8StringEncoding];\nNSLog(@\"result: %@\", responseString);\n\n}\n\n- (void) connection:(NSURLConnection *)connection didFailWithError:(NSError *)error {\nNSLog(@\"error - read error object for details\");\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"8044731","answer_count":"1","comment_count":"0","creation_date":"2011-11-08 00:31:41.65 UTC","favorite_count":"1","last_activity_date":"2011-11-08 03:41:10.357 UTC","last_edit_date":"2011-11-08 03:41:10.357 UTC","last_editor_display_name":"","last_editor_user_id":"827602","owner_display_name":"","owner_user_id":"827602","post_type_id":"1","score":"0","tags":"iphone|objective-c|ios|asynchronous","view_count":"1217"} +{"id":"45330266","title":"Referencing a Workbook variable in IF formula","body":"\u003cp\u003eI have a macro which is comparing numbers between two workbooks and outputting if it's correct or incorrect.\nOne of the workbooks is stored as a variable as it references last month in it's name. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eDim wb As Workbook\nSet wb = Workbooks(\"Monthly Life Management Report \" \u0026amp; Format(DateAdd(\"m\", -1, Date), \"mmmm yyyy\") \u0026amp; \".xlsm\")\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am getting a application or object defined error when running the final part of the macro.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Range(\"E8\").Select\nActiveCell.FormulaR1C1 = _\n\"=IF([wb]'2 Claims'!R8C5 =[Template.xlsx]Claims!R8C5,\"\"Correct\"\",\"\"Incorrect\"\")\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eEntire Script\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSub Monthly_Life_Management()\n\n\nDim thisWb As Workbook\nSet thisWb = ActiveWorkbook\nWorkbooks.Add\nActiveWorkbook.SaveAs Filename:=thisWb.Path \u0026amp; \"\\Validation_File_\" \u0026amp; Format(Date, \"dd mm yy\") \u0026amp; \".xls\"\n\n\nDim wb As Workbook\nSet wb = Workbooks(\"Monthly Life Management Report \" \u0026amp; Format(DateAdd(\"m\", -1, Date), \"mmmm yyyy\") \u0026amp; \".xlsm\")\n\n\n\n'Claims Tab\n wb.Activate\n Sheets(\"2 Claims\").Select\n\n Range(\"C2:C13\").Select\n Application.CutCopyMode = False\n Selection.Copy\n Windows(\"Validation_File_\" \u0026amp; Format(Date, \"dd mm yy\") \u0026amp; \".xls\").Activate\n Range(\"C2\").Select\n ActiveSheet.Paste\n\n wb.Activate\n Sheets(\"2 Claims\").Select\n Range(\"D2:D13\").Select\n Application.CutCopyMode = False\n Selection.Copy\n Windows(\"Validation_File_\" \u0026amp; Format(Date, \"dd mm yy\") \u0026amp; \".xls\").Activate\n Range(\"D2\").Select\n ActiveSheet.Paste\n\n wb.Activate\n Sheets(\"2 Claims\").Select\n Range(\"E7:G7\").Select\n Application.CutCopyMode = False\n Selection.Copy\n Windows(\"Validation_File_\" \u0026amp; Format(Date, \"dd mm yy\") \u0026amp; \".xls\").Activate\n Range(\"E7\").Select\n ActiveSheet.Paste\n\n'Counts\n Range(\"E8\").Select\n ActiveCell.FormulaR1C1 = _\n\"=IF('[wb]2 Claims'!R8C5 ='[Template.xlsx]Claims'!R8C5,\"\"Correct\"\",\"\"Incorrect\"\")\"\n\n Cells.Select\n Selection.Copy\n Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _\n:=False, Transpose:=False\n\nEnd Sub\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"45330401","answer_count":"1","comment_count":"0","creation_date":"2017-07-26 14:43:07.887 UTC","favorite_count":"0","last_activity_date":"2017-07-26 15:31:01.257 UTC","last_edit_date":"2017-07-26 15:20:47.717 UTC","last_editor_display_name":"","last_editor_user_id":"4611189","owner_display_name":"","owner_user_id":"4611189","post_type_id":"1","score":"1","tags":"excel|vba|excel-vba","view_count":"27"} +{"id":"7119915","title":"How to Append/Queue Media File to the Current Media Player program in C#.net?","body":"\u003cp\u003eI used:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSystem.Diagnostics.Process.Start(@\"D:\\Song1.mp3\");\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt played the MP3 file with my default Media Play (e.g Window Media Player);\u003c/p\u003e\n\n\u003cp\u003eI have another MP3 File (e.g D:\\Song2.mp3) that i want to append/queue to the current Media Player. Anyone please tell me how to do this?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2011-08-19 09:56:14.917 UTC","last_activity_date":"2011-08-19 10:21:08.317 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"902204","post_type_id":"1","score":"1","tags":"c#|media-player","view_count":"434"} +{"id":"16038518","title":"Maven: Build dependencies with dynamic params on persistence.xml file when main project is been compiled","body":"\u003cp\u003eI am a new maven user.\u003c/p\u003e\n\n\u003cp\u003eI am developing differents projects that depends on a maven project that needs to connect to db using JPA. So, for each parent project I need to set the db URL, user name and password on persistence.xml on dependent project.\u003c/p\u003e\n\n\u003cp\u003eI want to know if there is a way to recompile the dependency setting this values dynamically on persistence.xml while one of parent projects.\u003c/p\u003e\n\n\u003cp\u003eThanks in advance\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-04-16 13:33:13.307 UTC","last_activity_date":"2013-04-16 14:05:40.533 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1464529","post_type_id":"1","score":"0","tags":"java|maven|jpa|dependencies","view_count":"145"} +{"id":"45169408","title":"Hide VSTS/TFS extension's Summary section when extension not added to build task","body":"\u003cp\u003eWe have developed VSTS/TFS extension which consists summary page with details generated from our extension task, at the end of build.\u003c/p\u003e\n\n\u003cp\u003ewe have added contribution similar to below in manifest file to add this summary section\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n \"id\": \"build-status-section\",\n \"type\": \"ms.vss-build-web.build-results-section\",\n \"description\": \"A section contributing to our own new tab and also to existing build 'summary' tab\",\n \"targets\": [\n \".build-info-tab\",\n \"ms.vss-build-web.build-results-summary-tab\"\n ],\n \"properties\": {\n \"name\": \"Custom Section\",\n \"uri\": \"statusSection.html\",\n \"order\": 20,\n \"height\": 500\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever currently we are facing issue as even when user not add our extension task in to his build our summary page will appear in summary tab (if our extension is installed and enabled).\u003c/p\u003e\n\n\u003cp\u003eIs there any way to avoid displaying summary section when our task is not added to their build. Please be kind enough to help on this.\u003c/p\u003e","accepted_answer_id":"45181613","answer_count":"1","comment_count":"0","creation_date":"2017-07-18 14:17:34.557 UTC","last_activity_date":"2017-07-19 05:56:24.837 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6772880","post_type_id":"1","score":"0","tags":"tfs|vsts|vsts-build|vsts-build-task","view_count":"122"} +{"id":"19406847","title":"Is it possible to create a variable data type in Assembly?","body":"\u003cp\u003eI'm studying (slowly) x86 assembly and one thing I'd like to know is:\u003c/p\u003e\n\n\u003cp\u003eIs it possible for me to create a variable data type like a 16 byte integer?\u003c/p\u003e\n\n\u003cp\u003eOr do I only have access to db (8 bits), dw (2 bytes) and dd (4 bytes)?\u003c/p\u003e","accepted_answer_id":"19406973","answer_count":"1","comment_count":"0","creation_date":"2013-10-16 14:59:34.44 UTC","last_activity_date":"2013-10-16 15:42:34.663 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1257566","post_type_id":"1","score":"0","tags":"assembly","view_count":"91"} +{"id":"23510159","title":"pandas filling date gaps and overwrite with function","body":"\u003cp\u003eI have a big data frame with 2 groups: score and day.\nIs there a simple possibility with pandas tools to fill the gaps and the missing scores with the average (alternative ewma etc..) of the values before.\u003c/p\u003e\n\n\u003cp\u003eFirst of all I group overwrite the scores by grouping and later stack the \nmodified grouped df's together.\u003c/p\u003e\n\n\u003cpre class=\"lang-python prettyprint-override\"\u003e\u003ccode\u003e dfg = df.groupby(['g1','g2'])\n for name , group in dfg:\n print group\n break\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cpre class=\"lang-all prettyprint-override\"\u003e\u003ccode\u003e ix g1 g2 score day\n 4 19 24 4.150513 2014-02-12\n 5 19 24 6.986235 2014-02-13\n 6 19 24 9.634231 2014-02-14\n 7 19 24 1.818548 2014-02-15\n 8 19 24 1.699897 2014-03-02\n 9 19 24 2.128781 2014-03-25\n 10 19 24 1.720297 2014-03-26\n 14 19 24 2.079877 2014-03-30\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"2","creation_date":"2014-05-07 06:18:34.4 UTC","favorite_count":"1","last_activity_date":"2015-07-10 12:48:17.41 UTC","last_edit_date":"2015-07-10 12:48:17.41 UTC","last_editor_display_name":"","last_editor_user_id":"1967704","owner_display_name":"","owner_user_id":"2586303","post_type_id":"1","score":"1","tags":"pandas|gaps-in-data","view_count":"76"} +{"id":"30175896","title":"How can I copy a Google drive folder and remove Google drive association?","body":"\u003cp\u003eI want to copy a folder from Google drive and paste it somewhere else on my hard drive. When I do this, the folder icon looks like the folder is still associated with Google drive. How can I copy a Google drive folder and remove Google drive association?\u003c/p\u003e","accepted_answer_id":"30200397","answer_count":"1","comment_count":"3","creation_date":"2015-05-11 19:17:55.56 UTC","favorite_count":"1","last_activity_date":"2015-05-12 20:02:45.62 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"152118","post_type_id":"1","score":"2","tags":"google-drive-sdk","view_count":"478"} +{"id":"28267502","title":"how to change actionbar's menu item text color in material design","body":"\u003cp\u003eI'm trying to update my notepad app to use Material Design, even on older devices.\u003c/p\u003e\n\n\u003cp\u003eWhat i did so far:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eadd library appcompat_v7 to my project, to support Material Design on older devices\u003c/li\u003e\n\u003cli\u003emodify theme in AndroidManifest, adding \u003ccode\u003eandroid:theme=\"@style/Theme.NoteItTheme\"\u003c/code\u003e to \u003ccode\u003e\u0026lt;application ... \u0026gt;\u0026lt;/application\u0026gt;\u003c/code\u003e attributes\u003c/li\u003e\n\u003cli\u003e\u003cp\u003ecreating the theme in /res/values/themes.xml:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" encoding=\"utf-8\"?\u0026gt;\n\u0026lt;resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\u0026gt;\n \u0026lt;style name=\"Theme.NoteItTheme\" parent=\"Theme.AppCompat.Light\"\u0026gt;\n \u0026lt;!-- Here we setting appcompat’s actionBarStyle --\u0026gt;\n \u0026lt;!-- \u0026lt;item name=\"actionBarStyle\"\u0026gt;@style/MyActionBarStyle\u0026lt;/item\u0026gt; --\u0026gt; \n\n \u0026lt;!-- ...and here we setting appcompat’s color theming attrs --\u0026gt;\n \u0026lt;item name=\"colorPrimary\"\u0026gt;@color/primary\u0026lt;/item\u0026gt;\n \u0026lt;item name=\"colorPrimaryDark\"\u0026gt;@color/primary_dark\u0026lt;/item\u0026gt;\n \u0026lt;item name=\"android:textColorPrimary\"\u0026gt;@color/text\u0026lt;/item\u0026gt;\n \u0026lt;item name=\"colorAccent\"\u0026gt;@color/ui\u0026lt;/item\u0026gt;\n\n \u0026lt;!-- The rest of your attributes --\u0026gt;\n\u0026lt;/style\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003c/p\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003e\u003cstrong\u003eThe problem:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eAs you can better see here:\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/suM8U.jpg\" alt=\"the problem\"\u003e\u003c/p\u003e\n\n\u003cp\u003ewhen i expand the actionbar's menu, text color and background color are very similar.\nI hadn't this problem before, how do i change just the items text color?\u003c/p\u003e","accepted_answer_id":"28269479","answer_count":"2","comment_count":"0","creation_date":"2015-02-01 20:30:16.593 UTC","favorite_count":"1","last_activity_date":"2015-09-23 12:29:46.33 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2270403","post_type_id":"1","score":"3","tags":"android|appcompat|material-design","view_count":"5739"} +{"id":"41046649","title":"Android Custom Content View","body":"\u003cp\u003eI've made a custom layoutView instead of a built in xml that comes with each Android activity. So onCreate in my MainActivity I've set:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e setContentView(mainActivity_layoutView);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003emainActivity_layoutView is my custom layout java class. I made that layout so I could do my own custom animations. Now here is the question:\nSince mainActivity_layoutView is a java class, how do I add a button to my custom layout? Typically if you are referencing the xml file, you would just add this line \"button.findViewById(R.id.mybutton);\", but I am not using the xml file, I'm using my custom java class, so how would I go about adding a button to it? Thanks... \u003c/p\u003e","accepted_answer_id":"41046812","answer_count":"1","comment_count":"0","creation_date":"2016-12-08 18:43:48.813 UTC","last_activity_date":"2016-12-08 18:54:17.787 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5258441","post_type_id":"1","score":"0","tags":"java|android|xml","view_count":"60"} +{"id":"6873077","title":"Streaming or custom Jar in Hadoop","body":"\u003cp\u003eI'm running a streaming job in Hadoop (on Amazon's EMR) with the mapper and reducer written in Python. I want to know about the speed gains I would experience if I implement the same mapper and reducer in Java (or use Pig).\u003c/p\u003e\n\n\u003cp\u003eIn particular, I'm looking for people's experiences on migrating from streaming to custom jar deployments and/or Pig and also documents containing benchmark comparisons of these options. I found this \u003ca href=\"https://stackoverflow.com/questions/1482282/java-vs-python-on-hadoop\"\u003equestion\u003c/a\u003e, but the answers are not specific enough for me. I'm not looking for comparisons between Java and Python, but comparisons between custom jar deployment in Hadoop and Python-based streaming.\u003c/p\u003e\n\n\u003cp\u003eMy job is reading NGram counts from the Google Books NGgram dataset and computing aggregate measures. It seems like CPU utilization on the compute nodes are close to 100%. (I would like to hear your opinions about the differences of having CPU-bound or an IO-bound job, as well).\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e\n\n\u003cp\u003eAmaç\u003c/p\u003e","accepted_answer_id":"6889756","answer_count":"1","comment_count":"0","creation_date":"2011-07-29 12:29:35.087 UTC","favorite_count":"3","last_activity_date":"2011-07-31 13:34:50.38 UTC","last_edit_date":"2017-05-23 12:17:31.587 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"252684","post_type_id":"1","score":"10","tags":"java|python|streaming|hadoop|mapreduce","view_count":"2001"} +{"id":"7433636","title":"How to send an object to the Telerik MVC Grid Ajax Select() Controller Method","body":"\u003cp\u003eI am using the Telerik MVC Grid with Ajax binding, and am having a problem passing an object to the controller to be used to filter data. I am able to pass simple data (string, int), but not a more complex object.\u003c/p\u003e\n\n\u003cp\u003eFor instance, I can to this no problem:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e.DataBinding(dataBinding =\u0026gt; dataBinding.Ajax().Select(\"_CasesAjaxBinding\", \"Home\", new {orderId = \"12345\"} ))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd then in my controller, handle the orderId like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic ActionResult _CasesAjaxBinding(string orderId)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe problem I am having is when I try to pass a more complex object (in this case the @Model) to the controller, like this (The @Model is type CaseFilterModel):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e.DataBinding(dataBinding =\u0026gt; dataBinding.Ajax().Select(\"_CasesAjaxBinding\", \"Home\", new {filterSpec = @Model} ))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd then trying to handle the object, like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic ActionResult _CasesAjaxBinding(CaseFilterModel filterSpec)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe filterSpec parameter is always null.\u003c/p\u003e\n\n\u003cp\u003eThanks in advance for any ideas!\u003c/p\u003e","accepted_answer_id":"7433950","answer_count":"2","comment_count":"0","creation_date":"2011-09-15 15:44:05.64 UTC","favorite_count":"4","last_activity_date":"2013-04-18 22:01:57.993 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"669979","post_type_id":"1","score":"5","tags":"c#|asp.net-mvc|telerik-mvc","view_count":"9101"} +{"id":"26438413","title":"decimal issue when adding a flat fee","body":"\u003cp\u003eI have a small issue I believe the code is doing exactly what its suppose to be doing I have a function whereby I pass in an amount and I add a flat fee of 40 cents to it for the surcharge.\u003c/p\u003e\n\n\u003cp\u003eBelow is how my current code is constructed\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eDouble surcharge;\nsurcharge = 0.4 * moneyIn / 100;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf I pass 999.00m in as moneyIn it returns 0.3996 when in fact it should return 0.4 I'm unsure what I need to do to make it be 0.4 I'm learning percentages within c# so please bare with me.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-10-18 09:49:59.85 UTC","last_activity_date":"2014-10-18 09:52:43.377 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1259536","post_type_id":"1","score":"-1","tags":"c#|decimal","view_count":"64"} +{"id":"40479421","title":"How to add delete button in my php rows","body":"\u003cp\u003eI am new to php coding.\u003c/p\u003e\n\n\u003cp\u003eI am adding each row delete button but it should not working please help me.\u003c/p\u003e\n\n\u003cp\u003eThis is my html code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;!DOCTYPE html\u0026gt;\n\u0026lt;html\u0026gt;\n\u0026lt;head\u0026gt;\n\u0026lt;/head\u0026gt;\n\u0026lt;body\u0026gt;\n\u0026lt;?php\n $connection = mysql_connect('localhost', 'root','');\nif (!$connection)\n{\n die(\"Database Connection Failed\" . mysql_error());\n}\n$select_db = mysql_select_db( \"emp\",$connection);\nif (!$select_db)\n{\n die(\"Database Selection Failed\" . mysql_error());\n}\n $sql = \"SELECT * FROM venu \"; \n $result = mysql_query($sql) or die(mysql_error());\n ?\u0026gt;\n \u0026lt;table border=\"2\" style= \" margin: 0 auto;\" id=\"myTable\"\u0026gt;\n \u0026lt;thead\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;th\u0026gt;name\u0026lt;/th\u0026gt;\n \u0026lt;th\u0026gt;id\u0026lt;/th\u0026gt;\n \u0026lt;th\u0026gt;rollnumber\u0026lt;/th\u0026gt;\n \u0026lt;th\u0026gt;address\u0026lt;/th\u0026gt;\n \u0026lt;th\u0026gt;phonenumber\u0026lt;/th\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;/thead\u0026gt;\n \u0026lt;tbody\u0026gt;\n \u0026lt;?php\n while($row = mysql_fetch_array($result))\n {\n echo \"\u0026lt;tr\u0026gt;\";\n echo \"\u0026lt;td\u0026gt;\" . $row['name'] . \"\u0026lt;/td\u0026gt;\";\n echo \"\u0026lt;td\u0026gt;\" . $row['id'] . \"\u0026lt;/td\u0026gt;\";\n echo \"\u0026lt;td\u0026gt;\" . $row['rollnumber'] . \"\u0026lt;/td\u0026gt;\";\n echo \"\u0026lt;td\u0026gt;\" . $row['address'] . \"\u0026lt;/td\u0026gt;\";\n echo \"\u0026lt;td\u0026gt;\" . $row['phonenumber'] . \"\u0026lt;/td\u0026gt;\";\n echo \"\u0026lt;td\u0026gt;\u0026lt;form action='delete.php' method='POST'\u0026gt;\u0026lt;input type='hidden' value='\".$row[\"address\"].\"'/\u0026gt;\u0026lt;input type='submit' name='submit-btn' value='delete' /\u0026gt;\u0026lt;/form\u0026gt;\u0026lt;/td\u0026gt;\u0026lt;/tr\u0026gt;\";\n echo \"\u0026lt;/tr\u0026gt;\";\n\n\n }\n ?\u0026gt;\n \u0026lt;/tbody\u0026gt;\n \u0026lt;/table\u0026gt;\n \u0026lt;/body\u0026gt;\n \u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is my delete php code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\n$connection = mysql_connect('localhost', 'root','');\nif (!$connection)\n{\n die(\"Database Connection Failed\" . mysql_error());\n}\n$select_db = mysql_select_db( \"emp\",$connection);\nif (!$select_db)\n{\n die(\"Database Selection Failed\" . mysql_error());\n}\n error_reporting(0);\n session_start();\n $name = $_POST['name'];\n $id = $_POST['id'];\n $rollnumber = $_POST['rollnumber'];\n $address = $_POST['address'];\n $phonenumber = $_POST['phonenumber'];\n if($name!='' and $id!='')\n {\n $sql = mysql_query(\"DELETE FROM 'venu' WHERE name='balaji'AND id='93'AND rollnumber='93'AND address='bangalore'AND phonenumber='1234567890'\");\n echo \"\u0026lt;br/\u0026gt;\u0026lt;br/\u0026gt;\u0026lt;span\u0026gt;deleted successfully...!!\u0026lt;/span\u0026gt;\";\n}\nelse{\necho \"\u0026lt;p\u0026gt;ERROR\u0026lt;/p\u0026gt;\";\n}\nmysql_close($connection); \n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am trying to delete each row using button but should not working please help me.\u003c/p\u003e","accepted_answer_id":"40479557","answer_count":"3","comment_count":"4","creation_date":"2016-11-08 05:11:42.457 UTC","last_activity_date":"2016-11-08 07:57:38.607 UTC","last_edit_date":"2016-11-08 07:00:15.917 UTC","last_editor_display_name":"","last_editor_user_id":"6099347","owner_display_name":"","owner_user_id":"6868402","post_type_id":"1","score":"-4","tags":"php|html","view_count":"639"} +{"id":"29910720","title":"Android Studio - Error Building - Android tasks have already been created","body":"\u003cp\u003eGetting the following error when building the project:\u003c/p\u003e\n\n\u003cp\u003eError:(2, 0) Android tasks have already been created.\nThis happens when calling android.applicationVariants,\nandroid.libraryVariants or android.testVariants.\nOnce these methods are called, it is not possible to\ncontinue configuring the model.\u003c/p\u003e\n\n\u003cp\u003eRoot build.gradle:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ebuildscript {\n repositories {\n jcenter()\n }\n dependencies {\n classpath 'com.android.tools.build:gradle:1.1.0'\n }\n}\napply plugin: 'android'\n\nandroid {\n compileSdkVersion 'Google Inc.:Google APIs:19'\n buildToolsVersion '19.1.0'\n defaultConfig {\n versionCode 5\n versionName '5'\n targetSdkVersion 19\n minSdkVersion 10\n applicationId 'tsp.movil'\n }\n}\ndependencies {\n compile 'com.google.android.gms:play-services:7.0.0'\n compile 'com.android.support:support-v4:22.1.1'\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eApp build.gradle:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eandroid {\n compileSdkVersion 'Google Inc.:Google APIs:19'\n buildToolsVersion '19.1.0'\n defaultConfig {\n applicationId \"tsp.movil\"\n minSdkVersion 10\n targetSdkVersion 19\n versionCode 5\n versionName '5'\n }\n buildTypes {\n release {\n minifyEnabled false\n proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'\n }\n }\n productFlavors {\n }\n}\ndependencies {\n compile 'com.android.support:support-v4:19.1.0'\n compile 'com.google.android.gms:play-services:+'\n compile files('libs/zbar.jar')\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"29910970","answer_count":"2","comment_count":"0","creation_date":"2015-04-28 05:05:29.09 UTC","last_activity_date":"2015-04-28 05:55:23.473 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4700871","post_type_id":"1","score":"0","tags":"android|android-studio|build","view_count":"927"} +{"id":"45713138","title":"ReactJS: What is the correct way to set a state value as array?","body":"\u003cp\u003eI have an array of object that get users data using fetch API. I have tried constructor, create a function, bind it. It didn't work. I tried ComponentDidMount and setState, it returns undefined.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass Admin extends Component {\n\n\n componentDidMount () {\n\n var that = this;\n fetch('http://localhost:4500/data/users', {\n method: 'GET',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n }\n }).then(function(response) {\n return response.json();\n }).then(function(json){\n console.log(json);\n that.state = {users: json};\n });\n\n }\n\n render() {\n\n return (\n\n \u0026lt;SpicyDatatable\n tableKey={key}\n columns={columns}\n rows={this.state.users}\n config={customOptions}\n /\u0026gt;\n );\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat is the correct way to set a state value as array and render it? Thanks\u003c/p\u003e","accepted_answer_id":"45713248","answer_count":"3","comment_count":"1","creation_date":"2017-08-16 12:06:49.333 UTC","last_activity_date":"2017-08-16 12:31:12.187 UTC","last_edit_date":"2017-08-16 12:12:29.157 UTC","last_editor_display_name":"","last_editor_user_id":"4425849","owner_display_name":"","owner_user_id":"3437113","post_type_id":"1","score":"2","tags":"javascript|node.js|reactjs|fetch-api","view_count":"42"} +{"id":"32759988","title":"How to debug startup exceptions with service hosted in IIS?","body":"\u003cp\u003eI have my service running in IIS. I have a non fatal exception occurring and being logged on startup.\u003c/p\u003e\n\n\u003cp\u003eHow do I attach Visual Studio to IIS so that it also debugs the startup?\u003c/p\u003e\n\n\u003cp\u003eI know I can attached visual studio to the \u003ccode\u003ew3wp.exe\u003c/code\u003e to debug while its running. \u003c/p\u003e","accepted_answer_id":"32760404","answer_count":"3","comment_count":"2","creation_date":"2015-09-24 11:17:38.61 UTC","last_activity_date":"2016-12-22 03:59:53.593 UTC","last_edit_date":"2015-09-24 11:25:21.52 UTC","last_editor_display_name":"","last_editor_user_id":"993547","owner_display_name":"","owner_user_id":"1680271","post_type_id":"1","score":"3","tags":"c#|debugging|iis","view_count":"464"} +{"id":"6813503","title":"passing arraylist of bitmap from activity to another","body":"\u003cp\u003eI have an android where i want to pass a arraylist of bitmap from one activity to andother .how can i do that.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eArrayList\u0026lt;String\u0026gt; questionArray;\n\n ArrayList\u0026lt;Bitmap\u0026gt;questionBitmap=new ArrayList\u0026lt;Bitmap\u0026gt;(); questionBitmap=loadBitmapFromAllArray(questionArray);public ArrayList\u0026lt;Bitmap\u0026gt; loadBitmapFromAllArray(ArrayList\u0026lt;String\u0026gt; questionArray) \n {\n URL questionUrl = null;\n ArrayList\u0026lt;Bitmap\u0026gt;questionBitmap=new ArrayList\u0026lt;Bitmap\u0026gt;();\n for(int b =0; b \u0026lt;questionArray.size(); b+=1)\n {\n String questionSource=questionArray.get(b);\n try \n {\n questionUrl=new URL(questionSource);\n } \n catch (MalformedURLException e)\n {\n e.printStackTrace();\n }\n questionBitmap.add(getRemoteImage(questionUrl));\n }\n return questionBitmap; \n }\n public Bitmap getRemoteImage(final URL aURL) { \n try {\n final URLConnection conn = aURL.openConnection();\n conn.connect();\n final BufferedInputStream bis = new BufferedInputStream(conn.getInputStream());\n final Bitmap bm = BitmapFactory.decodeStream(bis);\n bis.close();\n return bm;\n }\n catch (IOException e) \n {\n }\n return null;\n }\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"1","creation_date":"2011-07-25 08:37:41.89 UTC","last_activity_date":"2015-07-19 19:42:08.35 UTC","last_edit_date":"2015-07-19 19:42:08.35 UTC","last_editor_display_name":"","last_editor_user_id":"3240583","owner_display_name":"","owner_user_id":"669904","post_type_id":"1","score":"0","tags":"android|arraylist","view_count":"1632"} +{"id":"37143271","title":"why must a fragment accompany a different activity","body":"\u003cp\u003eActivityA launches fragmentA. I need to launch fragmentB. There are 2 ways of doing it, but I dont know which is the best way First way, create a ActivityB which would launch FragmentB. Therefore, ActivityA--\u003e ActivityB--\u003e FragmentB.\u003c/p\u003e\n\n\u003cp\u003eThe second way, is just replacing FragmentA with FragmentB\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eFragment b = AddRecordFragment.init(Integer.valueOf(f.getId()));\ngetFragmentManager().beginTransaction().replace(R.id.container,b).addToBackStack(null).commit();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I took the Udacity course, they perferred the first way, but I cant see the logic in creating an second activity (activityB) for the mere purpose of launching an Fragment. Can you tell me what is the advantages and disadvantages to each ?\u003c/p\u003e","accepted_answer_id":"37143853","answer_count":"3","comment_count":"3","creation_date":"2016-05-10 15:44:18.14 UTC","last_activity_date":"2016-05-10 16:16:32.963 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6166748","post_type_id":"1","score":"1","tags":"android|android-layout|android-fragments","view_count":"38"} +{"id":"31363259","title":"How to print vector class type contents","body":"\u003cp\u003eI am having problem to print out the vector that hold my person info.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003estruct PersonInfo{\n\n string name;\n vector\u0026lt;string\u0026gt; phones; \n};\n\nint main(){\n\n string line, word;\n vector\u0026lt;PersonInfo\u0026gt; people;\n while(getline(cin, line)){\n PersonInfo info;\n istringstream record(line);\n record \u0026gt;\u0026gt; info.name;\n while(record \u0026gt;\u0026gt; word)\n info.phones.push_back(word);\n people.push_back(info);\n\n }\n for(auto i = people.begin(); i != people.end(); i++)\n cout \u0026lt;\u0026lt; people \u0026lt;\u0026lt; endl;\n return 0;\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"3","comment_count":"1","creation_date":"2015-07-12 00:42:33.24 UTC","last_activity_date":"2015-07-13 09:29:18.873 UTC","last_edit_date":"2015-07-12 00:44:43.77 UTC","last_editor_display_name":"","last_editor_user_id":"241631","owner_display_name":"","owner_user_id":"4777183","post_type_id":"1","score":"-4","tags":"c++|class|vector","view_count":"2161"} +{"id":"13465439","title":"How to map a command to multiple edits","body":"\u003cp\u003eI'm using the plugin \u003ca href=\"https://github.com/tpope/vim-surround\" rel=\"nofollow\"\u003evim-surround\u003c/a\u003e, which maps ds( to \"delete surrounding brackets\", e.g. turns (Hello) into Hello. I want to map a command to delete a function appliction, e.g. turning foo(bar) into bar.\u003c/p\u003e\n\n\u003cp\u003eI tried\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enmap \u0026lt;Leader\u0026gt;df bdt(ds(\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eto go to the beginning of the word, delete up to the first (, and then delete the surrounding parentheses. However, when I use it, it only deletes up to the bracket, and doesn't do the subsequent deletion of the brackets themselves. I've tried putting other editing commands after the initial part, and that works. So\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enmap \u0026lt;Leader\u0026gt;df bdt(x\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eworks as expected.\u003c/p\u003e\n\n\u003cp\u003eSimilarly, I tried just doing\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enmap \u0026lt;Leader\u0026gt;s ds(\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand that also works!\u003c/p\u003e\n\n\u003cp\u003eOther things that don't work:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enmap \u0026lt;Leader\u0026gt;df bdt(\u0026lt;bar\u0026gt;ds(\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eDoes anyone know how I can make this work?\u003c/p\u003e","accepted_answer_id":"13466425","answer_count":"2","comment_count":"0","creation_date":"2012-11-20 01:46:49.613 UTC","last_activity_date":"2012-11-20 07:38:03.77 UTC","last_edit_date":"2012-11-20 01:57:18.533 UTC","last_editor_display_name":"","last_editor_user_id":"1507392","owner_display_name":"","owner_user_id":"1837423","post_type_id":"1","score":"3","tags":"vim","view_count":"70"} +{"id":"6135115","title":"C++ Protected / Public overloads","body":"\u003cp\u003eI have a class like this :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass Foo\n{\npublic:\n Foo()\n {\n for(int i = 0; i \u0026lt; 10; ++i)\n v.push_back(i);\n };\n const vector\u0026lt;double\u0026gt;\u0026amp; V() const {return v;};\nprotected:\n vector\u0026lt;double\u0026gt;\u0026amp; V() {return v;};\nprivate:\n vector\u0026lt;double\u0026gt; v;\n};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd then a piece of code like this :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eFoo foo;\nfor(int i = 0; i \u0026lt; (int) foo.V().size(); ++i)\n cout \u0026lt;\u0026lt; foo.V().at(i) \u0026lt;\u0026lt; endl;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, the latter raises a compilation error saying the \u003ccode\u003eV()\u003c/code\u003e call is a protected method while i am just trying to read from it, not modify it.\u003c/p\u003e\n\n\u003cp\u003eI have tried the following (but without success).\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eFoo foo;\nconst vector\u0026lt;double\u0026gt;\u0026amp; test = foo.V();\nfor(int i = 0; i \u0026lt; (int) test.size(); ++i)\n cout \u0026lt;\u0026lt; test.at(i) \u0026lt;\u0026lt; endl;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMany thanks for your help.\u003c/p\u003e\n\n\u003cp\u003e=====\u003c/p\u003e\n\n\u003cp\u003eThank you all for the explanations and solutions ! It's greatly appreciated !\u003c/p\u003e","accepted_answer_id":"6135142","answer_count":"4","comment_count":"1","creation_date":"2011-05-26 07:26:23.483 UTC","last_activity_date":"2011-05-26 07:58:06.12 UTC","last_edit_date":"2011-05-26 07:50:25.687 UTC","last_editor_display_name":"","last_editor_user_id":"666231","owner_display_name":"","owner_user_id":"666231","post_type_id":"1","score":"4","tags":"c++|overloading|public|protected","view_count":"477"} +{"id":"30226094","title":"How do I decompose a number into powers of 2?","body":"\u003cp\u003eI'm trying to create a function that receives a number as an argument and performs actions on that number to find out its closest powers of 2 that will then add up to that number. For example, if the user enters 4, the function will append 4 because it is already a power of 2. If the user enters a 14 the function should see that 14 is not a power of 2 and the closest powers of 2 that make up 14 are 2,4, and 8.\u003c/p\u003e\n\n\u003cp\u003eKey notes:\nI am only going up to 2^9.\u003c/p\u003e\n\n\u003cp\u003eWhat i have so far:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef powers_finder(n):\n powers=[]\n i=0\n total=0\n while i\u0026lt;10:\n value=2**i\n total=total+value\n i=i+1\n #This if statement is for if the user enters a power of 2 as n\n #Then the number will be appended right away into my powers list.\n if value==n:\n powers.append(value)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe problem here being if the user enters in lets say 5 as (n) 5 is made up of the power 2^2=4 and 2^0=1 4+1=5. How can i extend my function to include this process? \u003c/p\u003e\n\n\u003cp\u003ethank you!\u003c/p\u003e","answer_count":"8","comment_count":"7","creation_date":"2015-05-13 22:13:38.017 UTC","favorite_count":"0","last_activity_date":"2015-05-14 19:15:46.273 UTC","last_edit_date":"2015-05-14 19:15:46.273 UTC","last_editor_display_name":"","last_editor_user_id":"4890269","owner_display_name":"","owner_user_id":"4788595","post_type_id":"1","score":"4","tags":"python|python-3.x","view_count":"2485"} +{"id":"30257549","title":"While selecting values in selectOneMenu, values are not getting selected","body":"\u003cp\u003eI use selectOneMenu component. Using Primefaces 5.2. I reduced the body size as zoom=\"95%\". For first time selected an value and once again selecting other value--\u003evalue is not getting selected, still the older value is getting displayed.\u003c/p\u003e\n\n\u003cp\u003eXhtml code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;h:body style=\"zoom:95%;\"\u0026gt;\n \u0026lt;p:selectOneMenu id=\"id\" value=\"#{manageBean.summarySearch.status}\" style=\"width:180px;\"\u0026gt; \n \u0026lt;f:selectItem itemLabel=\"Pending\" itemValue=\"Pending\"/\u0026gt;\n \u0026lt;f:selectItem itemLabel=\"Approved\" itemValue=\"Approved\" /\u0026gt;\n \u0026lt;f:selectItem itemLabel=\"Rejected\" itemValue=\"Rejected\" /\u0026gt;\n \u0026lt;f:selectItem itemLabel=\"All\" itemValue=\"All\" /\u0026gt;\n \u0026lt;/p:selectOneMenu\u0026gt;\n\n \u0026lt;p:commandButton value=\"Search\" actionListener=\"#{manageBean.search}\" \n update=\":listForm:empDT\" /\u0026gt;\n\u0026lt;/h:body\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBean:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic void search(){\n\n summaryList=manageDao.findDetail(summarySearch,new Utill().getId()); \n\n if(summaryList.size()==0)\n {\n FacesContext.getCurrentInstance().addMessage(\"editMessage\",new FacesMessage(FacesMessage.SEVERITY_ERROR,NO_RECORD_FOUND,\"\"));\n }\n\n }\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"4","creation_date":"2015-05-15 10:44:43.51 UTC","last_activity_date":"2015-05-15 11:08:00.63 UTC","last_edit_date":"2015-05-15 11:08:00.63 UTC","last_editor_display_name":"","last_editor_user_id":"4303154","owner_display_name":"","owner_user_id":"4303154","post_type_id":"1","score":"0","tags":"primefaces","view_count":"104"} +{"id":"22524220","title":"Unable to remove all classes in td with jQuery","body":"\u003cp\u003eI am trying to remove \u003ccode\u003ecolspan\u003c/code\u003e class but it is removing only \u003ccode\u003ecreate\u003c/code\u003e class. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;td class=\"create colspan\"\u0026gt;\n\u0026lt;/td\u0026gt;\n\nif ($(this).prev().hasClass('colspan') || $(this).next().hasClass('colspan')) {\n alert('yes');\n } else {\n $(this).removeClass(); \n $(this).removeClass('.colspan')\n }\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"3","comment_count":"2","creation_date":"2014-03-20 05:31:30.043 UTC","last_activity_date":"2014-03-20 05:56:34.867 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2451379","post_type_id":"1","score":"2","tags":"javascript|jquery","view_count":"117"} +{"id":"37863736","title":"Mandos in Docker","body":"\u003cp\u003eI try to setup Mandos inside a Docker container and failed with dbus errors. It's possible to run the server without dbus, but mandos-ctl and mandos-monitor need dbus to run.\u003c/p\u003e\n\n\u003cp\u003emy Dockerfile\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eFROM ubuntu:16.04\nRUN locale-gen de_DE.UTF-8\nENV TERM=xterm\nRUN apt-get update \\\n \u0026amp;\u0026amp; apt-get install -y mandos \\\n fping \\\n dbus \\\n \u0026amp;\u0026amp; rm -rf /var/lib/apt/lists/*\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBuild it: \u003ccode\u003edocker build -t mandos-server .\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eIf I host mount \u003ccode\u003e/var/run/dbus\u003c/code\u003e and start the container with:\n\u003ccode\u003edocker run -v /dev/log:/dev/log -v /var/run/dbus:/var/run/dbus -it mandos-server bash\u003c/code\u003e and start \u003ccode\u003emandos --debug\u003c/code\u003e I get the following errors:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e2016-06-16 15:26:30,278 root [11]: DEBUG: Did setuid/setgid to 108:111\n2016-06-16 15:26:30,280 root [11]: ERROR: Disabling D-Bus:\nTraceback (most recent call last):\n File \"/usr/sbin/mandos\", line 3009, in main\n do_not_queue=True)\n File \"/usr/lib/python2.7/dist-packages/dbus/service.py\", line 131, in __new__\n retval = bus.request_name(name, name_flags)\n File \"/usr/lib/python2.7/dist-packages/dbus/bus.py\", line 303, in request_name\n 'su', (name, flags))\n File \"/usr/lib/python2.7/dist-packages/dbus/connection.py\", line 651, in call_blocking\n message, timeout)\nDBusException: org.freedesktop.DBus.Error.AccessDenied: Connection \":1.362\" is not allowed to own the service \"se.recompile.Mandos\" due to security policies in the configuration file\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSecond trial:\nStarting the container without mounting dbus \u003ccode\u003edocker run -v /dev/log:/dev/log -it mandos-server bash\u003c/code\u003e\nand starting dbus by hand:\n\u003ccode\u003e/etc/init.d/dbus start\n * Starting system message bus dbus [ OK ]\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003emandos --debug\u003c/code\u003e leeds to the following error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e2016-06-16 15:36:38,338 root [40]: DEBUG: Did setuid/setgid to 108:111\n2016-06-16 15:36:38,353 root [40]: WARNING: Could not load persistent state: No such file or directory\n2016-06-16 15:36:38,359 root [40]: WARNING: No clients defined\n2016-06-16 15:36:38,361 root [40]: INFO: Now listening on address '::', port 39145, flowinfo 0, scope_id 0\n2016-06-16 15:36:38,363 dbus.proxies [40]: ERROR: Introspect error on org.freedesktop.Avahi:/: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.Spawn.FileInvalid: Cannot do system-bus activation with no user\n\n2016-06-16 15:36:38,363 dbus.proxies [40]: DEBUG: Executing introspect queue due to error\n2016-06-16 15:36:38,363 root [40]: CRITICAL: D-Bus Exception\nTraceback (most recent call last):\n File \"/usr/sbin/mandos\", line 3415, in main\n service.activate()\n File \"/usr/sbin/mandos\", line 470, in activate\n self.server_state_changed(self.server.GetState())\n File \"/usr/lib/python2.7/dist-packages/dbus/proxies.py\", line 70, in __call__\n return self._proxy_method(*args, **keywords)\n File \"/usr/lib/python2.7/dist-packages/dbus/proxies.py\", line 145, in __call__\n **keywords)\n File \"/usr/lib/python2.7/dist-packages/dbus/connection.py\", line 651, in call_blocking\n message, timeout)\nDBusException: org.freedesktop.DBus.Error.Spawn.FileInvalid: Cannot do system-bus activation with no user\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny idea whats going wrong and maybe a solution?\u003c/p\u003e","accepted_answer_id":"40794447","answer_count":"3","comment_count":"2","creation_date":"2016-06-16 15:42:31.817 UTC","last_activity_date":"2016-11-24 21:02:36.697 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2638109","post_type_id":"1","score":"1","tags":"encryption|luks","view_count":"151"} +{"id":"33806309","title":"Convert date into dd-mm-yy format and select last 12 dates from a picked value in SQL 2008","body":"\u003cp\u003eI have a table with a column 'Required date'. I need to convert the date format into dd-mm-yy format. I am able to do that using the following code - \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSelect Convert(VARCHAR(8),[RecordDate], 3) AS [DD/MM/YY]\nFrom [resolveConfig].dbo.myTable \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow, when a date is picked, I would like to select the last 12 days data from the table from the 'picked date'. \u003c/p\u003e\n\n\u003cp\u003eHow can I do that?\nIt is already converting the date to string format so i guess dateadd() would not work?\u003c/p\u003e\n\n\u003cp\u003eI am using sql 2008.\u003c/p\u003e\n\n\u003cp\u003ePlease help.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-11-19 14:14:07.58 UTC","last_activity_date":"2015-11-24 08:39:55.817 UTC","last_edit_date":"2015-11-19 14:50:58.52 UTC","last_editor_display_name":"","last_editor_user_id":"2311633","owner_display_name":"","owner_user_id":"5581614","post_type_id":"1","score":"0","tags":"mysql|sql-server-2008|datetime","view_count":"210"} +{"id":"22289983","title":"Dynamically increase and decrease char arrays?","body":"\u003cp\u003eI have to send data with UDP. The buffer field is of type char. I also have to encrypt/decrypt what I send. Here's my code for encrypting/decrypting.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003econst unsigned BUFFER_SIZE = 128;\nchar data[BUFFER_SIZE];\n\ncout \u0026lt;\u0026lt; \"Enter something.\" \u0026lt;\u0026lt; endl;\ncin.getline(data, BUFFER_SIZE);\ncout \u0026lt;\u0026lt; data;\nchar outchar[BUFFER_SIZE];\n\n\nfor(int i = 0; i \u0026lt; strlen(data); i++)\n{\n //outchar[i] = data[i];\n outchar[i] = encr[(int)data[i]];\n cout \u0026lt;\u0026lt; outchar[i];\n\n}\n\ncout \u0026lt;\u0026lt; \"Correct so far\" \u0026lt;\u0026lt; endl;\n\n\nchar transchar[BUFFER_SIZE];\nfor(int j = 0; j \u0026lt; strlen(outchar); j++)\n{\ntranschar[j] = decr[(int)outchar[j]];\ncout \u0026lt;\u0026lt; transchar[j]; // prints out decrypted text and unused space!\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe problem here is that using the fixed size of char means there is a lot of unused space in the buffer. In the code provided, it gets printed to screen.\u003c/p\u003e\n\n\u003cp\u003eIs there anyway to dynamically increase and decrease the buffer (char array) size so that I do not get the unused space?\u003c/p\u003e\n\n\u003cp\u003eEDIT: Something I don't think is clear: \u003cstrong\u003eEVERY LETTER has to be encrypted and decrypted!\u003c/strong\u003e The words are not encrypted, the letters that make them up are! The advice given up to now would translate words into an array. I need the characters.\u003c/p\u003e\n\n\u003cp\u003eEDIT2: deleted.\u003c/p\u003e\n\n\u003cp\u003eEDIT3: Russians, you got to love them. Big thanks to Vlad from Moscow!\u003c/p\u003e","accepted_answer_id":"22290058","answer_count":"1","comment_count":"10","creation_date":"2014-03-10 00:07:59.693 UTC","last_activity_date":"2015-12-07 17:52:58.82 UTC","last_edit_date":"2015-12-07 17:52:58.82 UTC","last_editor_display_name":"","last_editor_user_id":"2877241","owner_display_name":"","owner_user_id":"2955135","post_type_id":"1","score":"0","tags":"c++|arrays|string|char","view_count":"416"} +{"id":"47189779","title":"What causes \"unknown resolver null\" in Spark Kafka Connector?","body":"\u003cp\u003eI am new to spark, I have start zookeeper, kafka(0.10.1.1) on my local, also spark standalone(2.2.0) with one master and 2 workers. my local scal version is 2.12.3\u003c/p\u003e\n\n\u003cp\u003eI was able to run wordcount on spark, and using kafka console producer and consumer to pub/sub message from kafka topic.\u003c/p\u003e\n\n\u003cp\u003eThe problem I have is: whenever I add kafka package using the spark-submit --packages, I got\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e...\n:: problems summary ::\n:::: ERRORS\n unknown resolver null\n\n:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS\n:: retrieving :: org.apache.spark#spark-submit-parent\n confs: [default]\n 0 artifacts copied, 13 already retrieved (0kB/9ms)\n...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eEven I am not using the kafka connector at all.\nThe detail logs are following:\u003c/p\u003e\n\n\u003cp\u003ecommand\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$SPARK_HOME/bin/spark-submit --packages org.apache.spark:spark-streaming-kafka-0-10_2.11:2.2.0 --master spark://TUSMA06RMLVT047:7077 build/libs/sparkdriver-1.0-SNAPSHOT.jar\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003elog\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eIvy Default Cache set to: /Users/v0001/.ivy2/cache\nThe jars for the packages stored in: /Users/v0001/.ivy2/jars\n:: loading settings :: url = jar:file:/usr/local/Cellar/apache-spark/2.2.0/libexec/jars/ivy-2.4.0.jar!/org/apache/ivy/core/settings/ivysettings.xml\norg.apache.spark#spark-streaming-kafka-0-10_2.11 added as a dependency\n:: resolving dependencies :: org.apache.spark#spark-submit-parent;1.0\n confs: [default]\n found org.apache.spark#spark-streaming-kafka-0-10_2.11;2.2.0 in local-m2-cache\n found org.apache.kafka#kafka_2.11;0.10.0.1 in local-m2-cache\n found com.101tec#zkclient;0.8 in local-m2-cache\n found org.slf4j#slf4j-api;1.7.16 in spark-list\n found org.slf4j#slf4j-log4j12;1.7.16 in spark-list\n found log4j#log4j;1.2.17 in spark-list\n found com.yammer.metrics#metrics-core;2.2.0 in local-m2-cache\n found org.scala-lang.modules#scala-parser-combinators_2.11;1.0.4 in spark-list\n found org.apache.kafka#kafka-clients;0.10.0.1 in local-m2-cache\n found net.jpountz.lz4#lz4;1.3.0 in spark-list\n found org.xerial.snappy#snappy-java;1.1.2.6 in spark-list\n found org.apache.spark#spark-tags_2.11;2.2.0 in local-m2-cache\n found org.spark-project.spark#unused;1.0.0 in spark-list\n:: resolution report :: resolve 1805ms :: artifacts dl 14ms\n :: modules in use:\n com.101tec#zkclient;0.8 from local-m2-cache in [default]\n com.yammer.metrics#metrics-core;2.2.0 from local-m2-cache in [default]\n log4j#log4j;1.2.17 from spark-list in [default]\n net.jpountz.lz4#lz4;1.3.0 from spark-list in [default]\n org.apache.kafka#kafka-clients;0.10.0.1 from local-m2-cache in [default]\n org.apache.kafka#kafka_2.11;0.10.0.1 from local-m2-cache in [default]\n org.apache.spark#spark-streaming-kafka-0-10_2.11;2.2.0 from local-m2-cache in [default]\n org.apache.spark#spark-tags_2.11;2.2.0 from local-m2-cache in [default]\n org.scala-lang.modules#scala-parser-combinators_2.11;1.0.4 from spark-list in [default]\n org.slf4j#slf4j-api;1.7.16 from spark-list in [default]\n org.slf4j#slf4j-log4j12;1.7.16 from spark-list in [default]\n org.spark-project.spark#unused;1.0.0 from spark-list in [default]\n org.xerial.snappy#snappy-java;1.1.2.6 from spark-list in [default]\n ---------------------------------------------------------------------\n | | modules || artifacts |\n | conf | number| search|dwnlded|evicted|| number|dwnlded|\n ---------------------------------------------------------------------\n | default | 13 | 2 | 2 | 0 || 13 | 0 |\n ---------------------------------------------------------------------\n\n:: problems summary ::\n:::: ERRORS\n unknown resolver null\n\n\n:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS\n:: retrieving :: org.apache.spark#spark-submit-parent\n confs: [default]\n 0 artifacts copied, 13 already retrieved (0kB/9ms)\nUsing Spark's default log4j profile: org/apache/spark/log4j-defaults.properties\n17/11/08 15:53:55 INFO SparkContext: Running Spark version 2.2.0\n17/11/08 15:53:55 WARN NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable\n17/11/08 15:53:55 INFO SparkContext: Submitted application: WordCount\n17/11/08 15:53:55 INFO SecurityManager: Changing view acls to: v0001\n17/11/08 15:53:55 INFO SecurityManager: Changing modify acls to: v0001\n17/11/08 15:53:55 INFO SecurityManager: Changing view acls groups to: \n17/11/08 15:53:55 INFO SecurityManager: Changing modify acls groups to: \n17/11/08 15:53:55 INFO SecurityManager: SecurityManager: authentication disabled; ui acls disabled; users with view permissions: Set(v0001); groups with view permissions: Set(); users with modify permissions: Set(v0001); groups with modify permissions: Set()\n17/11/08 15:53:55 INFO Utils: Successfully started service 'sparkDriver' on port 63760.\n17/11/08 15:53:55 INFO SparkEnv: Registering MapOutputTracker\n17/11/08 15:53:55 INFO SparkEnv: Registering BlockManagerMaster\n17/11/08 15:53:55 INFO BlockManagerMasterEndpoint: Using org.apache.spark.storage.DefaultTopologyMapper for getting topology information\n17/11/08 15:53:55 INFO BlockManagerMasterEndpoint: BlockManagerMasterEndpoint up\n17/11/08 15:53:55 INFO DiskBlockManager: Created local directory at /private/var/folders/26/lfnkdm_d6mj48xfwdyl_sntm8tdtp9/T/blockmgr-b6a7af13-30eb-43ef-a235-e42105699289\n17/11/08 15:53:55 INFO MemoryStore: MemoryStore started with capacity 366.3 MB\n17/11/08 15:53:55 INFO SparkEnv: Registering OutputCommitCoordinator\n17/11/08 15:53:55 INFO Utils: Successfully started service 'SparkUI' on port 4040.\n17/11/08 15:53:55 INFO SparkUI: Bound SparkUI to 0.0.0.0, and started at http://10.0.1.2:4040\n17/11/08 15:53:55 INFO SparkContext: Added JAR file:/Users/v0001/.ivy2/jars/org.apache.spark_spark-streaming-kafka-0-10_2.11-2.2.0.jar at spark://10.0.1.2:63760/jars/org.apache.spark_spark-streaming-kafka-0-10_2.11-2.2.0.jar with timestamp 1510174435998\n17/11/08 15:53:55 INFO SparkContext: Added JAR file:/Users/v0001/.ivy2/jars/org.apache.kafka_kafka_2.11-0.10.0.1.jar at spark://10.0.1.2:63760/jars/org.apache.kafka_kafka_2.11-0.10.0.1.jar with timestamp 1510174435999\n17/11/08 15:53:55 INFO SparkContext: Added JAR file:/Users/v0001/.ivy2/jars/org.apache.spark_spark-tags_2.11-2.2.0.jar at spark://10.0.1.2:63760/jars/org.apache.spark_spark-tags_2.11-2.2.0.jar with timestamp 1510174435999\n17/11/08 15:53:55 INFO SparkContext: Added JAR file:/Users/v0001/.ivy2/jars/org.spark-project.spark_unused-1.0.0.jar at spark://10.0.1.2:63760/jars/org.spark-project.spark_unused-1.0.0.jar with timestamp 1510174435999\n17/11/08 15:53:55 INFO SparkContext: Added JAR file:/Users/v0001/.ivy2/jars/com.101tec_zkclient-0.8.jar at spark://10.0.1.2:63760/jars/com.101tec_zkclient-0.8.jar with timestamp 1510174435999\n17/11/08 15:53:55 INFO SparkContext: Added JAR file:/Users/v0001/.ivy2/jars/org.slf4j_slf4j-log4j12-1.7.16.jar at spark://10.0.1.2:63760/jars/org.slf4j_slf4j-log4j12-1.7.16.jar with timestamp 1510174435999\n17/11/08 15:53:55 INFO SparkContext: Added JAR file:/Users/v0001/.ivy2/jars/com.yammer.metrics_metrics-core-2.2.0.jar at spark://10.0.1.2:63760/jars/com.yammer.metrics_metrics-core-2.2.0.jar with timestamp 1510174435999\n17/11/08 15:53:56 INFO SparkContext: Added JAR file:/Users/v0001/.ivy2/jars/org.scala-lang.modules_scala-parser-combinators_2.11-1.0.4.jar at spark://10.0.1.2:63760/jars/org.scala-lang.modules_scala-parser-combinators_2.11-1.0.4.jar with timestamp 1510174436000\n17/11/08 15:53:56 INFO SparkContext: Added JAR file:/Users/v0001/.ivy2/jars/org.apache.kafka_kafka-clients-0.10.0.1.jar at spark://10.0.1.2:63760/jars/org.apache.kafka_kafka-clients-0.10.0.1.jar with timestamp 1510174436000\n17/11/08 15:53:56 INFO SparkContext: Added JAR file:/Users/v0001/.ivy2/jars/org.slf4j_slf4j-api-1.7.16.jar at spark://10.0.1.2:63760/jars/org.slf4j_slf4j-api-1.7.16.jar with timestamp 1510174436000\n17/11/08 15:53:56 INFO SparkContext: Added JAR file:/Users/v0001/.ivy2/jars/log4j_log4j-1.2.17.jar at spark://10.0.1.2:63760/jars/log4j_log4j-1.2.17.jar with timestamp 1510174436000\n17/11/08 15:53:56 INFO SparkContext: Added JAR file:/Users/v0001/.ivy2/jars/net.jpountz.lz4_lz4-1.3.0.jar at spark://10.0.1.2:63760/jars/net.jpountz.lz4_lz4-1.3.0.jar with timestamp 1510174436000\n17/11/08 15:53:56 INFO SparkContext: Added JAR file:/Users/v0001/.ivy2/jars/org.xerial.snappy_snappy-java-1.1.2.6.jar at spark://10.0.1.2:63760/jars/org.xerial.snappy_snappy-java-1.1.2.6.jar with timestamp 1510174436000\n17/11/08 15:53:56 INFO SparkContext: Added JAR file:/Users/v0001/iot/thingspace/go/src/stash.verizon.com/npdthing/metrics/sparkdriver/build/libs/sparkdriver-1.0-SNAPSHOT.jar at spark://10.0.1.2:63760/jars/sparkdriver-1.0-SNAPSHOT.jar with timestamp 1510174436000\n17/11/08 15:53:56 INFO Executor: Starting executor ID driver on host localhost\n17/11/08 15:53:56 INFO Utils: Successfully started service 'org.apache.spark.network.netty.NettyBlockTransferService' on port 63761.\n17/11/08 15:53:56 INFO NettyBlockTransferService: Server created on 10.0.1.2:63761\n17/11/08 15:53:56 INFO BlockManager: Using org.apache.spark.storage.RandomBlockReplicationPolicy for block replication policy\n17/11/08 15:53:56 INFO BlockManagerMaster: Registering BlockManager BlockManagerId(driver, 10.0.1.2, 63761, None)\n17/11/08 15:53:56 INFO BlockManagerMasterEndpoint: Registering block manager 10.0.1.2:63761 with 366.3 MB RAM, BlockManagerId(driver, 10.0.1.2, 63761, None)\n17/11/08 15:53:56 INFO BlockManagerMaster: Registered BlockManager BlockManagerId(driver, 10.0.1.2, 63761, None)\n17/11/08 15:53:56 INFO BlockManager: Initialized BlockManager: BlockManagerId(driver, 10.0.1.2, 63761, None)\n17/11/08 15:53:56 INFO MemoryStore: Block broadcast_0 stored as values in memory (estimated size 236.5 KB, free 366.1 MB)\n17/11/08 15:53:56 INFO MemoryStore: Block broadcast_0_piece0 stored as bytes in memory (estimated size 22.9 KB, free 366.0 MB)\n17/11/08 15:53:56 INFO BlockManagerInfo: Added broadcast_0_piece0 in memory on 10.0.1.2:63761 (size: 22.9 KB, free: 366.3 MB)\n17/11/08 15:53:56 INFO SparkContext: Created broadcast 0 from textFile at WordCount.java:15\n17/11/08 15:53:56 INFO FileInputFormat: Total input paths to process : 1\n17/11/08 15:53:56 INFO FileOutputCommitter: File Output Committer Algorithm version is 1\n17/11/08 15:53:56 INFO SparkContext: Starting job: saveAsTextFile at WordCount.java:21\n17/11/08 15:53:56 INFO DAGScheduler: Registering RDD 2 (flatMapToPair at WordCount.java:18)\n17/11/08 15:53:56 INFO DAGScheduler: Got job 0 (saveAsTextFile at WordCount.java:21) with 1 output partitions\n17/11/08 15:53:56 INFO DAGScheduler: Final stage: ResultStage 1 (saveAsTextFile at WordCount.java:21)\n17/11/08 15:53:56 INFO DAGScheduler: Parents of final stage: List(ShuffleMapStage 0)\n17/11/08 15:53:56 INFO DAGScheduler: Missing parents: List(ShuffleMapStage 0)\n17/11/08 15:53:56 INFO DAGScheduler: Submitting ShuffleMapStage 0 (MapPartitionsRDD[2] at flatMapToPair at WordCount.java:18), which has no missing parents\n17/11/08 15:53:56 INFO MemoryStore: Block broadcast_1 stored as values in memory (estimated size 5.3 KB, free 366.0 MB)\n17/11/08 15:53:56 INFO MemoryStore: Block broadcast_1_piece0 stored as bytes in memory (estimated size 3.1 KB, free 366.0 MB)\n17/11/08 15:53:56 INFO BlockManagerInfo: Added broadcast_1_piece0 in memory on 10.0.1.2:63761 (size: 3.1 KB, free: 366.3 MB)\n17/11/08 15:53:56 INFO SparkContext: Created broadcast 1 from broadcast at DAGScheduler.scala:1006\n17/11/08 15:53:56 INFO DAGScheduler: Submitting 1 missing tasks from ShuffleMapStage 0 (MapPartitionsRDD[2] at flatMapToPair at WordCount.java:18) (first 15 tasks are for partitions Vector(0))\n17/11/08 15:53:56 INFO TaskSchedulerImpl: Adding task set 0.0 with 1 tasks\n17/11/08 15:53:56 INFO TaskSetManager: Starting task 0.0 in stage 0.0 (TID 0, localhost, executor driver, partition 0, PROCESS_LOCAL, 4937 bytes)\n17/11/08 15:53:56 INFO Executor: Running task 0.0 in stage 0.0 (TID 0)\n17/11/08 15:53:56 INFO Executor: Fetching spark://10.0.1.2:63760/jars/org.slf4j_slf4j-api-1.7.16.jar with timestamp 1510174436000\n17/11/08 15:53:57 INFO TransportClientFactory: Successfully created connection to /10.0.1.2:63760 after 30 ms (0 ms spent in bootstraps)\n17/11/08 15:53:57 INFO Utils: Fetching spark://10.0.1.2:63760/jars/org.slf4j_slf4j-api-1.7.16.jar to /private/var/folders/26/lfnkdm_d6mj48xfwdyl_sntm8tdtp9/T/spark-07e33210-a6be-447c-92a0-4dd504e80965/userFiles-9a4b5741-a318-420e-b112-1a4441ba030a/fetchFileTemp4839646631087629609.tmp\n17/11/08 15:53:57 INFO Executor: Adding file:/private/var/folders/26/lfnkdm_d6mj48xfwdyl_sntm8tdtp9/T/spark-07e33210-a6be-447c-92a0-4dd504e80965/userFiles-9a4b5741-a318-420e-b112-1a4441ba030a/org.slf4j_slf4j-api-1.7.16.jar to class loader\n17/11/08 15:53:57 INFO Executor: Fetching spark://10.0.1.2:63760/jars/org.apache.kafka_kafka_2.11-0.10.0.1.jar with timestamp 1510174435999\n17/11/08 15:53:57 INFO Utils: Fetching spark://10.0.1.2:63760/jars/org.apache.kafka_kafka_2.11-0.10.0.1.jar to /private/var/folders/26/lfnkdm_d6mj48xfwdyl_sntm8tdtp9/T/spark-07e33210-a6be-447c-92a0-4dd504e80965/userFiles-9a4b5741-a318-420e-b112-1a4441ba030a/fetchFileTemp8667361266232337100.tmp\n17/11/08 15:53:57 INFO Executor: Adding file:/private/var/folders/26/lfnkdm_d6mj48xfwdyl_sntm8tdtp9/T/spark-07e33210-a6be-447c-92a0-4dd504e80965/userFiles-9a4b5741-a318-420e-b112-1a4441ba030a/org.apache.kafka_kafka_2.11-0.10.0.1.jar to class loader\n17/11/08 15:53:57 INFO Executor: Fetching spark://10.0.1.2:63760/jars/org.slf4j_slf4j-log4j12-1.7.16.jar with timestamp 1510174435999\n17/11/08 15:53:57 INFO Utils: Fetching spark://10.0.1.2:63760/jars/org.slf4j_slf4j-log4j12-1.7.16.jar to /private/var/folders/26/lfnkdm_d6mj48xfwdyl_sntm8tdtp9/T/spark-07e33210-a6be-447c-92a0-4dd504e80965/userFiles-9a4b5741-a318-420e-b112-1a4441ba030a/fetchFileTemp5418243157152191799.tmp\n17/11/08 15:53:57 INFO Executor: Adding file:/private/var/folders/26/lfnkdm_d6mj48xfwdyl_sntm8tdtp9/T/spark-07e33210-a6be-447c-92a0-4dd504e80965/userFiles-9a4b5741-a318-420e-b112-1a4441ba030a/org.slf4j_slf4j-log4j12-1.7.16.jar to class loader\n17/11/08 15:53:57 INFO Executor: Fetching spark://10.0.1.2:63760/jars/org.scala-lang.modules_scala-parser-combinators_2.11-1.0.4.jar with timestamp 1510174436000\n17/11/08 15:53:57 INFO Utils: Fetching spark://10.0.1.2:63760/jars/org.scala-lang.modules_scala-parser-combinators_2.11-1.0.4.jar to /private/var/folders/26/lfnkdm_d6mj48xfwdyl_sntm8tdtp9/T/spark-07e33210-a6be-447c-92a0-4dd504e80965/userFiles-9a4b5741-a318-420e-b112-1a4441ba030a/fetchFileTemp2366789843424249528.tmp\n17/11/08 15:53:57 INFO Executor: Adding file:/private/var/folders/26/lfnkdm_d6mj48xfwdyl_sntm8tdtp9/T/spark-07e33210-a6be-447c-92a0-4dd504e80965/userFiles-9a4b5741-a318-420e-b112-1a4441ba030a/org.scala-lang.modules_scala-parser-combinators_2.11-1.0.4.jar to class loader\n17/11/08 15:53:57 INFO Executor: Fetching spark://10.0.1.2:63760/jars/org.apache.spark_spark-tags_2.11-2.2.0.jar with timestamp 1510174435999\n17/11/08 15:53:57 INFO Utils: Fetching spark://10.0.1.2:63760/jars/org.apache.spark_spark-tags_2.11-2.2.0.jar to /private/var/folders/26/lfnkdm_d6mj48xfwdyl_sntm8tdtp9/T/spark-07e33210-a6be-447c-92a0-4dd504e80965/userFiles-9a4b5741-a318-420e-b112-1a4441ba030a/fetchFileTemp2527586655699915856.tmp\n17/11/08 15:53:57 INFO Executor: Adding file:/private/var/folders/26/lfnkdm_d6mj48xfwdyl_sntm8tdtp9/T/spark-07e33210-a6be-447c-92a0-4dd504e80965/userFiles-9a4b5741-a318-420e-b112-1a4441ba030a/org.apache.spark_spark-tags_2.11-2.2.0.jar to class loader\n17/11/08 15:53:57 INFO Executor: Fetching spark://10.0.1.2:63760/jars/org.spark-project.spark_unused-1.0.0.jar with timestamp 1510174435999\n17/11/08 15:53:57 INFO Utils: Fetching spark://10.0.1.2:63760/jars/org.spark-project.spark_unused-1.0.0.jar to /private/var/folders/26/lfnkdm_d6mj48xfwdyl_sntm8tdtp9/T/spark-07e33210-a6be-447c-92a0-4dd504e80965/userFiles-9a4b5741-a318-420e-b112-1a4441ba030a/fetchFileTemp4436635514367901872.tmp\n17/11/08 15:53:57 INFO Executor: Adding file:/private/var/folders/26/lfnkdm_d6mj48xfwdyl_sntm8tdtp9/T/spark-07e33210-a6be-447c-92a0-4dd504e80965/userFiles-9a4b5741-a318-420e-b112-1a4441ba030a/org.spark-project.spark_unused-1.0.0.jar to class loader\n17/11/08 15:53:57 INFO Executor: Fetching spark://10.0.1.2:63760/jars/com.101tec_zkclient-0.8.jar with timestamp 1510174435999\n17/11/08 15:53:57 INFO Utils: Fetching spark://10.0.1.2:63760/jars/com.101tec_zkclient-0.8.jar to /private/var/folders/26/lfnkdm_d6mj48xfwdyl_sntm8tdtp9/T/spark-07e33210-a6be-447c-92a0-4dd504e80965/userFiles-9a4b5741-a318-420e-b112-1a4441ba030a/fetchFileTemp4322710809557945921.tmp\n17/11/08 15:53:57 INFO Executor: Adding file:/private/var/folders/26/lfnkdm_d6mj48xfwdyl_sntm8tdtp9/T/spark-07e33210-a6be-447c-92a0-4dd504e80965/userFiles-9a4b5741-a318-420e-b112-1a4441ba030a/com.101tec_zkclient-0.8.jar to class loader\n17/11/08 15:53:57 INFO Executor: Fetching spark://10.0.1.2:63760/jars/org.apache.spark_spark-streaming-kafka-0-10_2.11-2.2.0.jar with timestamp 1510174435998\n17/11/08 15:53:57 INFO Utils: Fetching spark://10.0.1.2:63760/jars/org.apache.spark_spark-streaming-kafka-0-10_2.11-2.2.0.jar to /private/var/folders/26/lfnkdm_d6mj48xfwdyl_sntm8tdtp9/T/spark-07e33210-a6be-447c-92a0-4dd504e80965/userFiles-9a4b5741-a318-420e-b112-1a4441ba030a/fetchFileTemp6210645736090344233.tmp\n17/11/08 15:53:57 INFO Executor: Adding file:/private/var/folders/26/lfnkdm_d6mj48xfwdyl_sntm8tdtp9/T/spark-07e33210-a6be-447c-92a0-4dd504e80965/userFiles-9a4b5741-a318-420e-b112-1a4441ba030a/org.apache.spark_spark-streaming-kafka-0-10_2.11-2.2.0.jar to class loader\n17/11/08 15:53:57 INFO Executor: Fetching spark://10.0.1.2:63760/jars/log4j_log4j-1.2.17.jar with timestamp 1510174436000\n17/11/08 15:53:57 INFO Utils: Fetching spark://10.0.1.2:63760/jars/log4j_log4j-1.2.17.jar to /private/var/folders/26/lfnkdm_d6mj48xfwdyl_sntm8tdtp9/T/spark-07e33210-a6be-447c-92a0-4dd504e80965/userFiles-9a4b5741-a318-420e-b112-1a4441ba030a/fetchFileTemp2587760876873828850.tmp\n17/11/08 15:53:57 INFO Executor: Adding file:/private/var/folders/26/lfnkdm_d6mj48xfwdyl_sntm8tdtp9/T/spark-07e33210-a6be-447c-92a0-4dd504e80965/userFiles-9a4b5741-a318-420e-b112-1a4441ba030a/log4j_log4j-1.2.17.jar to class loader\n17/11/08 15:53:57 INFO Executor: Fetching spark://10.0.1.2:63760/jars/com.yammer.metrics_metrics-core-2.2.0.jar with timestamp 1510174435999\n17/11/08 15:53:57 INFO Utils: Fetching spark://10.0.1.2:63760/jars/com.yammer.metrics_metrics-core-2.2.0.jar to /private/var/folders/26/lfnkdm_d6mj48xfwdyl_sntm8tdtp9/T/spark-07e33210-a6be-447c-92a0-4dd504e80965/userFiles-9a4b5741-a318-420e-b112-1a4441ba030a/fetchFileTemp8763096223513955185.tmp\n17/11/08 15:53:57 INFO Executor: Adding file:/private/var/folders/26/lfnkdm_d6mj48xfwdyl_sntm8tdtp9/T/spark-07e33210-a6be-447c-92a0-4dd504e80965/userFiles-9a4b5741-a318-420e-b112-1a4441ba030a/com.yammer.metrics_metrics-core-2.2.0.jar to class loader\n17/11/08 15:53:57 INFO Executor: Fetching spark://10.0.1.2:63760/jars/org.apache.kafka_kafka-clients-0.10.0.1.jar with timestamp 1510174436000\n17/11/08 15:53:57 INFO Utils: Fetching spark://10.0.1.2:63760/jars/org.apache.kafka_kafka-clients-0.10.0.1.jar to /private/var/folders/26/lfnkdm_d6mj48xfwdyl_sntm8tdtp9/T/spark-07e33210-a6be-447c-92a0-4dd504e80965/userFiles-9a4b5741-a318-420e-b112-1a4441ba030a/fetchFileTemp2368772990989848791.tmp\n17/11/08 15:53:57 INFO Executor: Adding file:/private/var/folders/26/lfnkdm_d6mj48xfwdyl_sntm8tdtp9/T/spark-07e33210-a6be-447c-92a0-4dd504e80965/userFiles-9a4b5741-a318-420e-b112-1a4441ba030a/org.apache.kafka_kafka-clients-0.10.0.1.jar to class loader\n17/11/08 15:53:57 INFO Utils: Fetching spark://10.0.1.2:63760/jars/org.xerial.snappy_snappy-java-1.1.2.6.jar to /private/var/folders/26/lfnkdm_d6mj48xfwdyl_sntm8tdtp9/T/spark-07e33210-a6be-447c-92a0-4dd504e80965/userFiles-9a4b5741-a318-420e-b112-1a4441ba030a/fetchFileTemp5933403694236070460.tmp\n17/11/08 15:53:57 INFO Executor: Adding file:/private/var/folders/26/lfnkdm_d6mj48xfwdyl_sntm8tdtp9/T/spark-07e33210-a6be-447c-92a0-4dd504e80965/userFiles-9a4b5741-a318-420e-b112-1a4441ba030a/org.xerial.snappy_snappy-java-1.1.2.6.jar to class loader\n17/11/08 15:53:57 INFO Executor: Fetching spark://10.0.1.2:63760/jars/sparkdriver-1.0-SNAPSHOT.jar with timestamp 1510174436000\n17/11/08 15:53:57 INFO Utils: Fetching spark://10.0.1.2:63760/jars/sparkdriver-1.0-SNAPSHOT.jar to /private/var/folders/26/lfnkdm_d6mj48xfwdyl_sntm8tdtp9/T/spark-07e33210-a6be-447c-92a0-4dd504e80965/userFiles-9a4b5741-a318-420e-b112-1a4441ba030a/fetchFileTemp9172284954823303788.tmp\n17/11/08 15:53:57 INFO Executor: Adding file:/private/var/folders/26/lfnkdm_d6mj48xfwdyl_sntm8tdtp9/T/spark-07e33210-a6be-447c-92a0-4dd504e80965/userFiles-9a4b5741-a318-420e-b112-1a4441ba030a/sparkdriver-1.0-SNAPSHOT.jar to class loader\n17/11/08 15:53:57 INFO Executor: Fetching spark://10.0.1.2:63760/jars/net.jpountz.lz4_lz4-1.3.0.jar with timestamp 1510174436000\n17/11/08 15:53:57 INFO Utils: Fetching spark://10.0.1.2:63760/jars/net.jpountz.lz4_lz4-1.3.0.jar to /private/var/folders/26/lfnkdm_d6mj48xfwdyl_sntm8tdtp9/T/spark-07e33210-a6be-447c-92a0-4dd504e80965/userFiles-9a4b5741-a318-420e-b112-1a4441ba030a/fetchFileTemp2018048990610379910.tmp\n17/11/08 15:53:57 INFO Executor: Adding file:/private/var/folders/26/lfnkdm_d6mj48xfwdyl_sntm8tdtp9/T/spark-07e33210-a6be-447c-92a0-4dd504e80965/userFiles-9a4b5741-a318-420e-b112-1a4441ba030a/net.jpountz.lz4_lz4-1.3.0.jar to class loader\n17/11/08 15:53:57 INFO HadoopRDD: Input split: file:/usr/local/Cellar/apache-spark/2.2.0/libexec/logs/spark-v0001-org.apache.spark.deploy.master.Master-1-TUSMA06RMLVT047.out:0+3424\n17/11/08 15:53:57 INFO Executor: Finished task 0.0 in stage 0.0 (TID 0). 1192 bytes result sent to driver\n17/11/08 15:53:57 INFO TaskSetManager: Finished task 0.0 in stage 0.0 (TID 0) in 571 ms on localhost (executor driver) (1/1)\n17/11/08 15:53:57 INFO TaskSchedulerImpl: Removed TaskSet 0.0, whose tasks have all completed, from pool \n17/11/08 15:53:57 INFO DAGScheduler: ShuffleMapStage 0 (flatMapToPair at WordCount.java:18) finished in 0.590 s\n17/11/08 15:53:57 INFO DAGScheduler: looking for newly runnable stages\n17/11/08 15:53:57 INFO DAGScheduler: running: Set()\n17/11/08 15:53:57 INFO DAGScheduler: waiting: Set(ResultStage 1)\n17/11/08 15:53:57 INFO DAGScheduler: failed: Set()\n17/11/08 15:53:57 INFO DAGScheduler: Submitting ResultStage 1 (MapPartitionsRDD[4] at saveAsTextFile at WordCount.java:21), which has no missing parents\n17/11/08 15:53:57 INFO MemoryStore: Block broadcast_2 stored as values in memory (estimated size 72.6 KB, free 366.0 MB)\n17/11/08 15:53:57 INFO MemoryStore: Block broadcast_2_piece0 stored as bytes in memory (estimated size 26.1 KB, free 365.9 MB)\n17/11/08 15:53:57 INFO BlockManagerInfo: Added broadcast_2_piece0 in memory on 10.0.1.2:63761 (size: 26.1 KB, free: 366.2 MB)\n17/11/08 15:53:57 INFO SparkContext: Created broadcast 2 from broadcast at DAGScheduler.scala:1006\n17/11/08 15:53:57 INFO DAGScheduler: Submitting 1 missing tasks from ResultStage 1 (MapPartitionsRDD[4] at saveAsTextFile at WordCount.java:21) (first 15 tasks are for partitions Vector(0))\n17/11/08 15:53:57 INFO TaskSchedulerImpl: Adding task set 1.0 with 1 tasks\n17/11/08 15:53:57 INFO TaskSetManager: Starting task 0.0 in stage 1.0 (TID 1, localhost, executor driver, partition 0, ANY, 4621 bytes)\n17/11/08 15:53:57 INFO Executor: Running task 0.0 in stage 1.0 (TID 1)\n17/11/08 15:53:57 INFO ShuffleBlockFetcherIterator: Getting 1 non-empty blocks out of 1 blocks\n17/11/08 15:53:57 INFO ShuffleBlockFetcherIterator: Started 0 remote fetches in 4 ms\n17/11/08 15:53:57 INFO FileOutputCommitter: File Output Committer Algorithm version is 1\n17/11/08 15:53:57 INFO FileOutputCommitter: Saved output of task 'attempt_20171108155356_0001_m_000000_1' to file:/Users/v0001/iot/thingspace/go/src/stash.verizon.com/npdthing/metrics/sparkdriver/wordcount.out/_temporary/0/task_20171108155356_0001_m_000000\n17/11/08 15:53:57 INFO SparkHadoopMapRedUtil: attempt_20171108155356_0001_m_000000_1: Committed\n17/11/08 15:53:57 INFO Executor: Finished task 0.0 in stage 1.0 (TID 1). 1224 bytes result sent to driver\n17/11/08 15:53:57 INFO TaskSetManager: Finished task 0.0 in stage 1.0 (TID 1) in 123 ms on localhost (executor driver) (1/1)\n17/11/08 15:53:57 INFO TaskSchedulerImpl: Removed TaskSet 1.0, whose tasks have all completed, from pool \n17/11/08 15:53:57 INFO DAGScheduler: ResultStage 1 (saveAsTextFile at WordCount.java:21) finished in 0.123 s\n17/11/08 15:53:57 INFO DAGScheduler: Job 0 finished: saveAsTextFile at WordCount.java:21, took 0.852166 s\n17/11/08 15:53:57 INFO SparkContext: Invoking stop() from shutdown hook\n17/11/08 15:53:57 INFO SparkUI: Stopped Spark web UI at http://10.0.1.2:4040\n17/11/08 15:53:57 INFO MapOutputTrackerMasterEndpoint: MapOutputTrackerMasterEndpoint stopped!\n17/11/08 15:53:57 INFO MemoryStore: MemoryStore cleared\n17/11/08 15:53:57 INFO BlockManager: BlockManager stopped\n17/11/08 15:53:57 INFO BlockManagerMaster: BlockManagerMaster stopped\n17/11/08 15:53:57 INFO OutputCommitCoordinator$OutputCommitCoordinatorEndpoint: OutputCommitCoordinator stopped!\n17/11/08 15:53:57 INFO SparkContext: Successfully stopped SparkContext\n17/11/08 15:53:57 INFO ShutdownHookManager: Deleting directory /private/var/folders/26/lfnkdm_d6mj48xfwdyl_sntm8tdtp9/T/spark-07e33210-a6be-447c-92a0-4dd504e80965\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"2","creation_date":"2017-11-08 21:12:13.357 UTC","last_activity_date":"2017-11-10 10:47:16.48 UTC","last_edit_date":"2017-11-10 10:47:16.48 UTC","last_editor_display_name":"","last_editor_user_id":"5057350","owner_display_name":"","owner_user_id":"4445793","post_type_id":"1","score":"2","tags":"java|apache-spark|apache-kafka|spark-streaming|spark-submit","view_count":"40"} +{"id":"45633184","title":"InsertMany throw E11000 duplicate key error but insert successfully","body":"\u003cp\u003eI am using mongoose to insert bulk data to database.\nThe \u003ccode\u003einsertMany\u003c/code\u003e throw E11000 duplicate key error although the data is saved succeed in database.\u003c/p\u003e\n\n\u003cp\u003eHere is my codes: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e var data = [\n {_id: '598d7ae7c3148a6d853866e8'}, \n {_id: '598d7afdc3148a6d853866f4'}\n ]\nMovies.insertMany(data, function(error, docs) {});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis happen infrequently.\u003c/p\u003e\n\n\u003cp\u003eAppreciated any help.\u003c/p\u003e\n\n\u003cp\u003eThanks \u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2017-08-11 10:38:37.427 UTC","last_activity_date":"2017-08-12 04:54:00.103 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3827723","post_type_id":"1","score":"0","tags":"node.js|mongodb|mongoose","view_count":"72"} +{"id":"15257591","title":"Binding empty values to numerical fields in Play Framework 2 (Java)","body":"\u003cp\u003eI have forms where I want to be able to leave some numerical fields empty, but I get \"Invalid value\" errors from \u003ccode\u003eForm.bindFromRequest()\u003c/code\u003e. This seems like a common requirement, but I can't find any documentation on this after hours of searching. I am still hoping I've missed something obvious, though! \u003c/p\u003e\n\n\u003cp\u003eI did some digging and found that Play uses Spring's \u003ccode\u003eDataBinder\u003c/code\u003e class to do the actual binding. That class is really sophisticated and would allow me to set custom binders for my fields, and if I was using Spring I could just add an \u003ccode\u003e@InitBinder\u003c/code\u003e method to my controller to set up the binder exactly the way I want using a \u003ccode\u003eCustomNumberEditor\u003c/code\u003e. However, it seems that Play Framework's \u003ccode\u003eForm\u003c/code\u003e object does not allow access to the DataBinder, apart from setting allowed fields. So, the binder tries to convert an empty string into a long, which gives a \u003ccode\u003eNumberFormatException\u003c/code\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eFailed to convert property value of type 'java.lang.String' to required type 'long' \nfor property 'unitPriceExVAT'; \nnested exception is java.lang.NumberFormatException: For input string: \"\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo, is there some other way of getting the binder to allow empty numerical fields?\u003c/p\u003e","accepted_answer_id":"15259097","answer_count":"1","comment_count":"0","creation_date":"2013-03-06 20:43:18.01 UTC","last_activity_date":"2013-03-06 22:09:31.53 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"239775","post_type_id":"1","score":"1","tags":"java|forms|playframework-2.0|databinder","view_count":"566"} +{"id":"36292010","title":"save a Google Chart server-side","body":"\u003cp\u003eI made a JS script that pulls data from a Postgres database and visualizes them as a bunch of beautiful Google Charts. That works fine, but it is very slow and sometimes the web page just times out. \u003c/p\u003e\n\n\u003cp\u003eTo remedy, I was thinking of creating the charts as PNG/GIF/SVG/Whatever, and use a cron job to refresh the charts at specific intervals. That would sacrifice interactivity (which is not very important in this instance) for speed. However, a google search does not provide a clear path for creating Google charts with PHP. Any suggestions? \u003c/p\u003e\n\n\u003cp\u003eHere is my JS script: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e google.setOnLoadCallback(drawManyCharts); \n\n function drawManyCharts()\n //parameters are: timeUnit, target div, abscissa bins, MultiplicationFactor, Graphtype, SensorString\n {drawAllCharts(\"minutes\", \"GoogleChart_div\", 500, 0.01, \"Linechart\", \"Temperature\"); \n drawAllCharts(\"hours\", \"GoogleChart2_div\", 400, 0.01, \"Linechart\", \"Temperature\");\n drawAllCharts(\"days\", \"GoogleChart3_div\", 48, 0.01, \"Linechart\", \"Temperature\");\n drawAllCharts(\"weeks\", \"GoogleChart4_div\", 48, 0.01, \"Linechart\", \"Temperature\");\n drawAllCharts(\"hours\", \"GoogleChartPressure_div\", 48, 0.01, \"Linechart\", \"Pressure\");\n }\n\n function drawAllCharts(TimeUnit, containerChart, NoAbscissaBins, MultiplicationFactor, Graphtype, SensorString)\n {\n\n // var SensorString=\"Temperature\"; \n var TableType=\"integer\";\n // var NoAbscissaBins=12;\n var DataTableName=\"dataMasterTable\";\n // var TimeUnit=\"days\";\n var TimeStart=\"test\";\n // var Graphtype=\"Linechart\";\n var graphtitle = \"Heizungskeller\";\n var OrdinateLabel = \"Temperature (Celsius 100x)\" \n var maxViewWindow= 8000;\n var minViewWindow= 0;\n\n var GoogleArray = $.ajax({ \n url: \"/php/PrepareGoogleDataTable.php\" +\"?\"+\n \"SensorString=\"+SensorString + \"\u0026amp;\"+\n \"TableType=\" + TableType +\"\u0026amp;\"+\n \"NoAbscissaBins=\" + NoAbscissaBins + \"\u0026amp;\"+\n \"MultiplicationFactor=\" + MultiplicationFactor + \"\u0026amp;\"+\n \"DataTableName=\" + DataTableName +\"\u0026amp;\"+\n \"TimeUnit=\" + TimeUnit +\"\u0026amp;\"+\n \"TimeStart=\" + TimeStart, \n //dataType:\"json\", \n async: false \n }).responseText;\n console.log(GoogleArray);\n GoogleArray = JSON.parse(GoogleArray); \n eval(GoogleArray.GoogleAddColumns);\n eval(GoogleArray.GoogleAddRows);\n\n\n\n //create dynamic dataview for charts\n //columns as specified by TableType\n switch (TableType)\n {\n case \"boolean\":\n eval(GoogleArray.GoogleVisualizeColumnCount) ;\n break;\n\n case \"integer\" :\n eval(GoogleArray.GoogleVisualizeColumnsMinStdevStdevMax) ;\n eval(GoogleArray.GoogleVisualizeColumnsAvg) ;\n break;\n\n case \"float\" :\n eval(GoogleArray.GoogleVisualizeColumnsMinStdevStdevMax) ;\n eval(GoogleArray.GoogleVisualizeColumnsAvg) ;\n break;\n\n case \"string\" :\n break;\n\n\n }\n\n switch (Graphtype)\n {\n case \"Candlestick\":\n var optionsCandlestick = {\n width: '100%', \n height: 480,\n bar:{groupWidth: '90%'},\n vAxis: {minValue: 0,\n baseline: 0,\n textStyle: {color: 'blue',\n fontSize: 10},\n viewWindowMode: 'explicit',\n viewWindow: {max: maxViewWindow,\n min: minViewWindow\n }\n },\n hAxis: {textStyle: \n {color: 'blue',\n fontSize: 10},\n },\n pointSize: 5,\n title: graphtitle\n };\n\n var wrapper = new google.visualization.ChartWrapper(\n {chartType: 'CandlestickChart',\n dataTable: dataViewMinStdevStdevMax,\n options: optionsCandlestick,\n containerId: containerChart});\n wrapper.draw();\n\n break;\n\n case \"StackedColumn\":\n\n var optionsColumnchart = {\n chartArea: {width: '80%', height: '70%'},\n //legend: {position: 'in'},\n //titlePosition: 'in', \n axisTitlesPosition: 'in',\n hAxis: {textPosition: 'in'}, \n vAxis: {textPosition: 'in'},\n width: '100%', \n height: 520, \n isStacked: true, \n pointSize: 3,\n fontSize: 10,\n backgroundColor: 'transparent', \n bar:{groupWidth: '90%'},\n hAxis:{slantedTextAngle: 90},\n legend:{position: 'in', textStyle: {color: 'blue', fontSize: 12}},\n title: graphtitle\n }; \n var wrapper = new google.visualization.ChartWrapper(\n {chartType: 'ColumnChart',\n dataTable: dataViewCount,\n options: optionsColumnchart,\n containerId: containerChart});\n wrapper.draw();\n break;\n\n case \"Linechart\":\n //these are the customizable options from google\n var optionsLinechart = {\n chartArea: {width: '80%', height: '70%'},\n //legend: {position: 'in'},\n width: 1000, \n height: 480, \n pointSize: 0,\n title: graphtitle,\n vAxis: {title: OrdinateLabel}\n };\n\n var wrapper = new google.visualization.ChartWrapper(\n {chartType: 'LineChart',\n dataTable: dataViewAvg,\n options: optionsLinechart,\n containerId: containerChart});\n wrapper.draw();\n break;\n\n }\n\n } \n \u0026lt;/script\u0026gt; \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand here is the PHP script that takes Postgres data and converts them into a Google Chart-digestible format: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;?php\n if(isset($_GET['SensorString']) \u0026amp;\u0026amp; \n (!empty($_GET['SensorString'])) \u0026amp;\u0026amp; \n (!empty($_GET['TableType'])) \u0026amp;\u0026amp; \n (!empty($_GET['TimeUnit'])) \u0026amp;\u0026amp; \n (!empty($_GET['NoAbscissaBins'])) \u0026amp;\u0026amp; \n (!empty($_GET['DataTableName'])) \u0026amp;\u0026amp; \n (!empty($_GET['MultiplicationFactor'])) \u0026amp;\u0026amp; \n (!empty($_GET['TimeStart'])))\n\n {$SensorString = str_replace ( \"*\", \"%\", $_GET['SensorString']); // string to fill \"WHERE\" condition\n $TableType = $_GET['TableType']; // boolean/integer/float/string\n $TimeUnit = $_GET['TimeUnit']; //hours/days/weeks/months/years\n $NoAbscissaBins = $_GET['NoAbscissaBins']; //number of time units to be displayed on the abscissa\n $DataTableName = $_GET['DataTableName']; //number of time units to be displayed on the abscissa\n $TimeStart = $_GET['TimeStart']; //should not necessarily be used\n\n }\n else \n {// assume Bewegungsmelder, boolean, hours, 12 bins\n $SensorString = \"OutsideTemp\";\n $TableType = \"float\";\n $TimeUnit = \"days\";\n $TimeStart = -12; \n $NoAbscissaBins = 30;\n $DataTableName = \"dataMasterTable\";\n }\n\n $RedirectEchoToFile = false;\n\n\n\n $DataCollectionArray = DataCollectionCrossTab($SensorString, $TableType, $TimeUnit, $NoAbscissaBins, $TimeStart, $DataTableName);\n //echo \"GoogleDataRow: \". $DataCollectionArray['GoogleDataRow'] ;\n $GoogleArray = PrepareGoogleChart($DataCollectionArray);\n\n\n /* $GoogleArray has the following keys:\n / [0] =\u0026gt; GoogleAddColumns \n / [1] =\u0026gt; GoogleAddRows \n / [2] =\u0026gt; GoogleVisualizeColumnCount \n / [3] =\u0026gt; GoogleVisualizeColumnsAvg \n / [4] =\u0026gt; GoogleVisualizeColumnsMinStdevStdevMax \n / [5] =\u0026gt; MainCrosstabSelectQuery \n */\n\n\n echo json_encode($GoogleArray);\n\n\n\n //---------------------------------------------------\n\n Function PrepareGoogleChart($DataCollectionArray)\n {\n // var GoogleAddColumns adds columns to DataTable\n\n $TimeUnit = \"hours\"; // (can be \"hours\", \"days\", \"months\", \"years\" )\n $GoogleAddColumns = \"\"; \n\n // var GoogleVisualizeColumnsAll renders DataView1 view of DataTable\n // var VisualizeFirstColumn sets the first column, and renders \"hours\" (can be changed to days etc.)\n $VisualizeFirstColumn = \".setColumns([\n {calc: function(data, row) \n {return data.getFormattedValue(row, \" \n . ColumnLabel($TimeUnit). \"); }, \n type:'string'}\";\n\n //set up dataView1, which is essentially useless\n $GoogleVisualizeColumnsAll = \n \"var dataView1 = new google.visualization.DataView(\".$DataCollectionArray['DataTableName'].\");\".chr(13)\n .\"dataView1\".$VisualizeFirstColumn;\n\n //set up dataViewCount, which is good to count events from IpsLoggingBoolean and feed a column chart\n $GoogleVisualizeColumnCount = \n \"var dataViewCount = new google.visualization.DataView(\".$DataCollectionArray['DataTableName'].\");\"\n .chr(13).\"dataViewCount\".$VisualizeFirstColumn;\n\n //set up dataViewAvg, which visualizes only the averages and is good for line charts\n $GoogleVisualizeAvg = \n \"var dataViewAvg = \n new google.visualization.DataView(\".$DataCollectionArray['DataTableName'].\");\".chr(13).\n \"dataViewAvg\"\n .\".setColumns([ {calc: function(data, row) \n {return data.getFormattedValue(row, \" \n . ColumnLabel($TimeUnit). \"); }, \n type:'string'}\";\n\n //set up dataViewMinStdevStdevMax, which can feed a candlestick chart \n $GoogleVisualizeColumnsMinStdevStdevMax = \n \"var dataViewMinStdevStdevMax = \n new google.visualization.DataView(\".$DataCollectionArray['DataTableName'].\");\".chr(13)\n .\"dataViewMinStdevStdevMax\"\n .\".setColumns([ {calc: function(data, row) \n {return data.getFormattedValue(row, \" \n . ColumnLabel($TimeUnit). \"); }, \n type:'string'}\";\n\n $GoogleVisualizeScattergram = \n \"var dataViewScattergram = new google.visualization.DataView(\".$DataCollectionArray['DataTableName'].\");\"\n .chr(13).\"dataViewScattergram.setColumns([\";\n\n\n //create strings for Google DataTable/DataView1 columns definition\n $GoogleAddColumns = \n \"var \". $DataCollectionArray['DataTableName']. \"= new google.visualization.DataTable();\".chr(13). \n $DataCollectionArray['DataTableName'].\".addColumn('string', 'hoursIndex');\".chr(13).\n $DataCollectionArray['DataTableName'].\".addColumn('string', 'hours');\".chr(13).\n $DataCollectionArray['DataTableName'].\".addColumn('string', 'PlaceHolder1');\".chr(13).\n $DataCollectionArray['DataTableName'].\".addColumn('string', 'PlaceHolder2');\".chr(13).\n $DataCollectionArray['DataTableName'].\".addColumn('string', 'PlaceHolder3'); \";\n\n for ($varIndex=0; $varIndex \u0026lt; ($DataCollectionArray['NumberOfColumns']-5); $varIndex++)\n {\n\n Switch ($DataCollectionArray['TableType'])\n {\n case \"boolean\":\n $GoogleAddColumns .= \n $DataCollectionArray['DataTableName'].\".addColumn('number', \".$DataCollectionArray['CategoryArray'][$varIndex]. \", 'count$varIndex'); \";\n break;\n\n case \"integer\":\n $GoogleAddColumns .= \n $DataCollectionArray['DataTableName'].\".addColumn('number', \".$DataCollectionArray['CategoryArray'][$varIndex]. \" +'avg'); \".chr(13).\n $DataCollectionArray['DataTableName'].\".addColumn('number', \".$DataCollectionArray['CategoryArray'][$varIndex]. \" +'stddev+'); \".chr(13).\n $DataCollectionArray['DataTableName'].\".addColumn('number', \".$DataCollectionArray['CategoryArray'][$varIndex]. \" +'stddev-'); \". chr(13).\n $DataCollectionArray['DataTableName'].\".addColumn('number', \".$DataCollectionArray['CategoryArray'][$varIndex]. \" +'max'); \" .chr(13).\n $DataCollectionArray['DataTableName'].\".addColumn('number', \".$DataCollectionArray['CategoryArray'][$varIndex]. \" +'min'); \" .chr(13);\n break;\n\n case \"float\":\n $GoogleAddColumns .= \n $DataCollectionArray['DataTableName'].\".addColumn('number', \".$DataCollectionArray['CategoryArray'][$varIndex]. \" +'avg'); \".chr(13).\n $DataCollectionArray['DataTableName'].\".addColumn('number', \".$DataCollectionArray['CategoryArray'][$varIndex]. \" +'stddev+'); \".chr(13).\n $DataCollectionArray['DataTableName'].\".addColumn('number', \".$DataCollectionArray['CategoryArray'][$varIndex]. \" +'stddev-'); \". chr(13).\n $DataCollectionArray['DataTableName'].\".addColumn('number', \".$DataCollectionArray['CategoryArray'][$varIndex]. \" +'max'); \" .chr(13).\n $DataCollectionArray['DataTableName'].\".addColumn('number', \".$DataCollectionArray['CategoryArray'][$varIndex]. \" +'min'); \" .chr(13);\n break;\n\n case \"string\":\n //no visualization in case of strings, but a \"tableChart\" could be generated if need be.\n break;\n }\n\n $GoogleVisualizeColumnsAll .= \n \", \". strval(($varIndex+1)*4+1).\", \". \n strval(($varIndex+1)*4+2).\", \". \n strval(($varIndex+1)*4+3).\", \". \n strval(($varIndex+1)*4+4); \n\n $GoogleVisualizeColumnCount .= \n \", \". strval(($varIndex+1)+4); \n\n $GoogleVisualizeAvg .= \n \", \". strval(($varIndex+1)*5+0); \n\n $GoogleVisualizeColumnsMinStdevStdevMax .= \n \", \". strval(($varIndex+1)*5+1).\n \", \". strval(($varIndex+1)*5+2).\n \", \". strval(($varIndex+1)*5+3).\n \", \". strval(($varIndex+1)*5+4); \n\n $GoogleVisualizeScattergram .= strval(($varIndex+1)*4+2).\", \";\n }\n\n //echo \"Tabletype: \". $DataCollectionArray['TableType'].chr(13).\"\u0026lt;br\u0026gt;\".\"\u0026lt;br\u0026gt;\";\n //echo \"GoogleAddColumns: \". $GoogleAddColumns.chr(13).\"\u0026lt;br\u0026gt;\".\"\u0026lt;br\u0026gt;\";\n\n $GoogleVisualizeColumnsAll .= \"]);\".chr(13);\n $GoogleVisualizeColumnCount .= \"]);\".chr(13);\n $GoogleVisualizeAvg .= \"]);\".chr(13);\n $GoogleVisualizeColumnsMinStdevStdevMax.= \"]);\".chr(13);\n $GoogleVisualizeScattergram = substr($GoogleVisualizeScattergram, 0, -2) . \"]);\".chr(13);\n\n VerboseEcho($GoogleAddColumns. \"\u0026lt;br\u0026gt;\u0026lt;br\u0026gt;\u0026lt;br\u0026gt;\".$GoogleVisualizeColumnsAll);\n\n\n //create dataset rows to be processed into google datatable\n $DataForGoogleChart = $DataCollectionArray['GoogleDataRow'];\n\n\n\n //echo \"\u0026lt;br\u0026gt;\u0026lt;font color='green'\u0026gt;DataForGoogleChart: $DataForGoogleChart\u0026lt;/font\u0026gt;\u0026lt;br\u0026gt;\";\n\n\n $GoogleFormattedDataArray = array(\n 'GoogleAddColumns' =\u0026gt; $GoogleAddColumns,\n 'GoogleAddRows' =\u0026gt; $DataCollectionArray['DataTableName'].'.addRows('.$DataCollectionArray['GoogleDataRow'].'); '.chr(13),\n 'GoogleVisualizeColumnCount' =\u0026gt; $GoogleVisualizeColumnCount,\n 'GoogleVisualizeColumnsAvg' =\u0026gt; $GoogleVisualizeAvg,\n 'GoogleVisualizeColumnsMinStdevStdevMax' =\u0026gt; $GoogleVisualizeColumnsMinStdevStdevMax,\n 'MainCrosstabSelectQuery' =\u0026gt; $DataCollectionArray['MainCrosstabSelectQuery'] \n );\n\n return $GoogleFormattedDataArray;\n }\n\n\n\n\n //-----------------------------------------------------\n\n Function DataCollectionCrossTab($SensorString, $TableType, $TimeUnit, $NoAbscissaBins, $TimeStart, $DataTableName) //sensorstring: e.g. DigitalInput 2\n {\n $dbconn = pg_connect(\"host=10.10.10.8 port=5432 dbname=IpsLogging user=*** password=***\") \n or die ('connection aborted: ' . pg_last_error().chr(13));\n\n switch ($TableType)\n {\n case \"boolean\":\n $IpsTable = \"loggingdb_ips_boolean\";\n $AggregateFunctions = \"COUNT(*) As value \";\n $SensorColumn = 2;\n $WhereClause=\" AND (log.ipsvalue = true) \"; //only movement triggers\n break;\n case \"integer\":\n $IpsTable = \"loggingdb_ips_integer\";\n $AggregateFunctions = \"(AVG(ipsvalue)::NUMERIC(8,2)) \n ||'', '' || \n (MIN(ipsvalue)::NUMERIC(8,2)) \n ||'', '' || \n ((AVG(ipsvalue)::NUMERIC(8,2)) - (coalesce(STDDEV(ipsvalue), 0)::NUMERIC(8,2))) \n ||'', '' || \n ((AVG(ipsvalue)::NUMERIC(8,2)) + (coalesce(STDDEV(ipsvalue), 0)::NUMERIC(8,2))) \n ||'', '' || \n (MAX(ipsvalue)::NUMERIC(8,2)) \n As value \";\n $WhereClause=\"\";\n $SensorColumn = 4;\n break;\n case \"float\":\n $IpsTable = \"loggingdb_ips_float\";\n $AggregateFunctions = \"(AVG(ipsvalue)::NUMERIC(8,2)) \n ||'', '' || \n (MIN(ipsvalue)::NUMERIC(8,2)) \n ||'', '' || \n ((AVG(ipsvalue)::NUMERIC(8,2)) - (coalesce(STDDEV(ipsvalue), 0)::NUMERIC(8,2))) \n ||'', '' || \n ((AVG(ipsvalue)::NUMERIC(8,2)) + (coalesce(STDDEV(ipsvalue), 0)::NUMERIC(8,2))) \n ||'', '' || \n (MAX(ipsvalue)::NUMERIC(8,2)) \n As value \";\n $SensorColumn = 4;\n $WhereClause=\"\";\n break;\n case \"string\":\n $IpsTable = \"loggingdb_ips_string\";\n $WhereClause=\"\";\n break;\n }\n\n Switch ($TimeUnit)\n {case \"minutes\":\n $SelectRowNames = \n \"to_char(ipstimestamp, ''YYYYMMDDHH24MI'') As row_name, \n to_char(ipstimestamp, ''FMHH24h:MI'') As labelled_row_name, \n ''PlaceHolder1'' As PlaceHolder1,\n ''PlaceHolder2'' As PlaceHolder2,\n ''PlaceHolder3'' As PlaceHolder3,\";\n $GroupOrder = \" \n GROUP BY row_name, labelled_row_name, PlaceHolder1, PlaceHolder2, PlaceHolder3, objectid, category \n ORDER BY row_name, labelled_row_name, PlaceHolder1, PlaceHolder2, PlaceHolder3, objectid, category', \";\n break;\n\n case \"hours\":\n $SelectRowNames = \n \"to_char(ipstimestamp, ''YYYYMMDDHH24'') As row_name, \n to_char(ipstimestamp, ''FMDD mon FMHH24h'') As labelled_row_name, \n ''PlaceHolder1'' As PlaceHolder1,\n ''PlaceHolder2'' As PlaceHolder2,\n ''PlaceHolder3'' As PlaceHolder3,\";\n $GroupOrder = \" \n GROUP BY row_name, labelled_row_name, PlaceHolder1, PlaceHolder2, PlaceHolder3, objectid, category \n ORDER BY row_name, labelled_row_name, PlaceHolder1, PlaceHolder2, PlaceHolder3, objectid, category', \";\n break;\n\n case \"days\":\n $SelectRowNames = \n \"to_char(ipstimestamp, ''YYYYMMDD'') As row_name, \n to_char(ipstimestamp, ''FMDD mon YYYY'') As labelled_row_name, \n ''PlaceHolder1'' As PlaceHolder1,\n ''PlaceHolder2'' As PlaceHolder2,\n ''PlaceHolder3'' As PlaceHolder3,\";\n $GroupOrder = \" \n GROUP BY row_name, labelled_row_name, PlaceHolder1, PlaceHolder2, PlaceHolder3, objectid, category \n ORDER BY row_name, labelled_row_name, PlaceHolder1, PlaceHolder2, PlaceHolder3, objectid, category', \"; \n break;\n\n case \"weeks\":\n $SelectRowNames = \n \"to_char(ipstimestamp, ''YYYYWW'') As row_name, \n ''wk'' || to_char(ipstimestamp, ''FMWW YYYY'') As labelled_row_name, \n ''PlaceHolder1'' As PlaceHolder1,\n ''PlaceHolder2'' As PlaceHolder2,\n ''PlaceHolder3'' As PlaceHolder3,\";\n $GroupOrder = \" \n GROUP BY row_name, labelled_row_name, PlaceHolder1, PlaceHolder2, PlaceHolder3, objectid, category \n ORDER BY row_name, labelled_row_name, PlaceHolder1, PlaceHolder2, PlaceHolder3, objectid, category', \"; \n break;\n\n case \"months\":\n $SelectRowNames = \n \"to_char(ipstimestamp, ''YYYYMM'') As row_name, \n to_char(ipstimestamp, ''mon YYYY'') As labelled_row_name, \n ''PlaceHolder1'' As PlaceHolder1,\n ''PlaceHolder2'' As PlaceHolder2,\n ''PlaceHolder3'' As PlaceHolder3,\";\n $GroupOrder = \" \n GROUP BY row_name, labelled_row_name, PlaceHolder1, PlaceHolder2, PlaceHolder3, objectid, category \n ORDER BY row_name, labelled_row_name, PlaceHolder1, PlaceHolder2, PlaceHolder3, objectid, category', \"; \n break;\n\n case \"years\":\n $SelectRowNames = \n \"to_char(ipstimestamp, ''YYYY'') As row_name, \n to_char(ipstimestamp, ''YYYY'') As labelled_row_name, \n ''PlaceHolder1'' As PlaceHolder1,\n ''PlaceHolder2'' As PlaceHolder2,\n ''PlaceHolder3'' As PlaceHolder3,\";\n $GroupOrder = \" \n GROUP BY row_name, labelled_row_name, PlaceHolder1, PlaceHolder2, PlaceHolder3, objectid, category \n ORDER BY row_name, labelled_row_name, PlaceHolder1, PlaceHolder2, PlaceHolder3, objectid, category', \"; \n break;\n } \n\n\n\n // echo \"type \".$IpsTable.\" \u0026lt;br\u0026gt;\";\n $SensorResult = GetSensorNames($SensorString, $TableType, \"\", \"\",0, 1);\n // echo \"SensorResult: \".$SensorResult.chr(13);\n $CategoryString = implode(\", \", pg_fetch_all_columns($SensorResult,$SensorColumn));\n $CategoryArray = pg_fetch_all_columns(GetSensorNames($SensorString, $TableType, \"\", \"\",0, 0),5); //array containing the name of each sensor\n\n // echo \"\u0026lt;strong\u0026gt;CategoryString: \u0026lt;/strong\u0026gt;\". $CategoryString.chr(13).\"\u0026lt;br\u0026gt;\u0026lt;br\u0026gt;\u0026lt;br\u0026gt;\u0026lt;br\u0026gt;\";\n //Print_r ($CategoryArray);\n\n\n //primary query (non-crosstabbed yet)\n $PrimaryQuery =\"'SELECT \". $SelectRowNames. \n \"varid As category, \" \n .$AggregateFunctions\n .\" FROM $IpsTable As log \n JOIN ipsobjects_with_parent ips \n ON log.varid = ips.objectid\n WHERE (ips.objectname LIKE ''\".$SensorString.\"'') \"\n . $WhereClause . \" \n AND (ipstimestamp \u0026gt; (now()- ''\". $NoAbscissaBins . \" \" . $TimeUnit. \"''::interval)) \". $GroupOrder ;\n\n // echo \"\u0026lt;strong\u0026gt;PrimaryQuery: $PrimaryQuery\u0026lt;/strong\u0026gt;\";\n\n //main crosstab query which pulls all the content data:\n $MainCrosstabSelectQuery = \n \"SELECT * FROM crosstab\n (\" .$PrimaryQuery .\n \"'SELECT DISTINCT varid \n FROM $IpsTable As log \n JOIN ipsobjects_with_parent ips \n ON log.varid = ips.objectid\n WHERE (ips.objectname LIKE ''\".$SensorString.\"'')\n ORDER BY 1;' \n )\n\n As CountsPerHour(row_name text, \n label_row_name text, \n PlaceHolder1 text, \n PlaceHolder2 text, \n PlaceHolder3 text, \" \n .$CategoryString.\")\";\n\n //echo \"\u0026lt;br\u0026gt;\u0026lt;font color='red'\u0026gt;$MainCrosstabSelectQuery\u0026lt;/font\u0026gt;\u0026lt;br\u0026gt;\";\n\n $QueryResult=pg_query ($dbconn, $MainCrosstabSelectQuery);\n $CrosstabArray = pg_fetch_all($QueryResult);\n //echo \"CrosstabArray: \" . $CrosstabArray ;\n //$table = good_query_table($CrosstabArray, $QueryResult, 0);\n //BetterTable($QueryResult); //this functions outputs a nicely formatted crosstab!\n\n if (!$QueryResult) \n echo \"PG Error: \". pg_last_error().chr(13);\n\n // create bracketed Array of Arrays GoogleDataRow\n $GoogleDataRow =\"[\"; //opening bracket inserted\n while ($field = pg_fetch_row($QueryResult)) \n {\n\n $GoogleDataRow .=\"[\"; \n $index =0;\n\n switch ($TableType)\n {\n case \"boolean\":\n foreach ($field as $col_value) {\n $index++;\n if ($index\u0026lt;6)\n //the first five columns are strings (date headers)\n {$GoogleDataRow .= \"'\".$col_value.\"', \";} \n else{\n //anythign above 5 is data\n //substitute NULL with zeroes, else GoogleChart doesnt work\n if($col_value == NULL) $col_value = \"null\"; \n $GoogleDataRow .= $col_value.\", \";\n }\n }\n break;\n\n case \"integer\":\n foreach ($field as $col_value) {\n ++$index;\n if ($index\u0026lt;6)\n {//the first give columns are strings (date headers)\n $GoogleDataRow .= \"'\".$col_value.\"', \";} \n else{\n //anythign above 5 is data\n //substitute NULL with 5x zeroes, else GoogleChart doesnt work\n if($col_value == NULL) $col_value = \"null,null,null,null,null\"; \n $GoogleDataRow .= $col_value.\", \";\n }\n }\n break;\n\n case \"float\":\n foreach ($field as $col_value) {\n ++$index;\n if ($index\u0026lt;6)\n {//the first give columns are strings (date headers)\n $GoogleDataRow .= \"'\".$col_value.\"', \";} \n else{\n //anythign above 5 is data\n //substitute NULL with 5x zeroes, else GoogleChart doesnt work\n if($col_value == NULL) $col_value = \"null,null,null,null,null\"; \n $GoogleDataRow .= $col_value.\", \";\n }\n }\n break;\n\n case \"string\":\n foreach ($field as $col_value) {\n ++$index;\n if ($index\u0026lt;5)\n //the first give columns are strings (date headers)\n {$GoogleDataRow .= \"'\".$col_value.\"', \";} \n else{\n //anythign above 5 is data\n //substitute NULL with zeroes, else GoogleChart doesnt work\n if($col_value == NULL) $col_value = 0; \n $GoogleDataRow .= $col_value.\" \";\n }\n }\n break;\n }\n\n $GoogleDataRow = substr($GoogleDataRow,0,-5).\"], \";\n\n //echo \"\u0026lt;br\u0026gt;\u0026lt;font color='blue'\u0026gt;$GoogleDataRow \u0026lt;/font\u0026gt;\u0026lt;br\u0026gt;\"; \n }\n\n\n $GoogleDataRow = substr($GoogleDataRow,0,-2).\"]\";\n\n $DataCollectionArray = array(\n \"GoogleDataRow\"=\u0026gt;$GoogleDataRow,\n \"NumberOfColumns\"=\u0026gt;pg_num_fields($QueryResult), // total number of columns, including all row headers\n \"CategoryArray\"=\u0026gt;$CategoryArray,\n \"TableType\"=\u0026gt;$TableType,\n \"DataTableName\" =\u0026gt; $DataTableName, \n \"MainCrosstabSelectQuery\" =\u0026gt; $MainCrosstabSelectQuery \n );\n return $DataCollectionArray;\n }\n\n\n\n //---------------------------------------\n\n function BetterTable($result)\n {\n $i = 0;\n echo \"\u0026lt;html\u0026gt;\n \u0026lt;body\u0026gt;\n \u0026lt;table\u0026gt;\n \u0026lt;table class='BetterTable' border='1'\u0026gt;\";\n\n echo \"\u0026lt;tr\u0026gt;\";\n echo '\u0026lt;td\u0026gt;Line #\n \u0026lt;/td\u0026gt;';\n while ($i \u0026lt; pg_num_fields($result))\n {\n $fieldName = pg_field_name($result, $i);\n echo '\u0026lt;td\u0026gt;' . $fieldName . '\u0026lt;/td\u0026gt;';\n $i = $i + 1;\n }\n echo '\u0026lt;/tr\u0026gt;';\n $i = 0;\n\n while ($field = pg_fetch_row($result)) \n {\n if ($i%2 == 0) \n Echo \"\u0026lt;tr bgcolor=\\\"#d0d0d0\\\" \u0026gt;\";\n else \n Echo \"\u0026lt;tr bgcolor=\\\"#eeeeee\\\"\u0026gt;\";\n $fields = count($field);\n $y = 0;\n echo '\u0026lt;td\u0026gt;'.$i. '\u0026lt;/td\u0026gt;';\n while ($y \u0026lt; $fields)\n {\n $c_row = current($field);\n echo '\u0026lt;td\u0026gt;'.$c_row . '\u0026lt;/td\u0026gt;';\n next($field);\n $y = $y + 1;\n }\n echo '\u0026lt;/tr\u0026gt;';\n $i = $i + 1;\n }\n\n\n echo '\u0026lt;/table\u0026gt;\u0026lt;br\u0026gt;\u0026lt;br\u0026gt;\u0026lt;/body\u0026gt;\u0026lt;/html\u0026gt;';\n\n }\n\n //----------------------------------------------------\n\n Function GetSensorNames($SensorType, $TableType, $prefix, $postfix, $QueryType, $column)\n {//TableType specifies the type of variable, and redirectes to the correct table.\n //prefix and postfix are adapters returned for each row\n //\n //retrieve full names of DataCollection variables, including parent names\n //QueryColumns specifies which query columns (see below)\n\n $dbconn = pg_connect(\"host=10.10.10.8 port=5432 dbname=IpsLogging user=*** password=***\") \n or die ('connection aborted: ' . pg_last_error().chr(13));\n\n\n switch ($TableType)\n {\n case \"boolean\":\n $IpsTable = \"loggingdb_ips_boolean\";\n break;\n case \"integer\":\n $IpsTable = \"loggingdb_ips_integer\";\n break;\n case \"float\":\n $IpsTable = \"loggingdb_ips_float\";\n break;\n case \"string\":\n $IpsTable = \"loggingdb_ips_string\";\n break;\n }\n // echo \"type \".$IpsTable.\" \u0026lt;br\u0026gt;\";\n\n\n if ($prefix!=\"\") $prefix = $prefix.\" || \";\n if ($postfix!=\"\")$postfix = \" || \". $postfix;\n\n $GetSensorNamesString = \n \"SELECT \n DISTINCT '\\\"' || varid ||'\\\"' || ' integer ' as integername,\n varid as NakedVariable, \n '\\\"' || ips.parentname || ' - ' || ips.objectname || ' (' || ips.objectid || ')\\\"' || ' integer ' AS fullname,\n '\\\"' || ips.parentname || ' - ' || ips.objectname || ' (' || ips.objectid || ')\\\"' || ' numeric(8,2) ' AS fullnamenumeric,\n '\\\"' || ips.parentname || ' - ' || ips.objectname || ' (' || ips.objectid || ')\\\"' || ' text ' AS fullnamestring,\n '\\\"' || ips.parentname || ' - ' || ips.objectname || ' (' || ips.objectid || ')\\\"' AS fullnamestring,\n ips.parentname || ' - ' || ips.objectname || ' (' || ips.objectid || ')' || ' text ' AS fullnamestringwithoutquotes,\n $prefix varid $postfix as DecoratedVariable\n\n FROM $IpsTable As log \n JOIN ipsobjects_with_parent ips \n ON log.varid = ips.objectid\n WHERE (ips.objectname LIKE '$SensorType')\n ORDER BY 1;\n \";\n //echo \"\u0026lt;strong\u0026gt;$GetSensorNamesString\u0026lt;/strong\u0026gt;\"; \n\n $QueryResult=pg_query ($dbconn, $GetSensorNamesString);\n if (!$QueryResult) \n echo \"PG Error: \". pg_last_error().chr(13);\n else\n {return $QueryResult;}\n }\n //-----------------------------\n Function ColumnLabel($TimeUnit)\n {\n switch ($TimeUnit)\n {\n case \"minutes\": $ColumnLabel= \"0\"; break;\n case \"hours\": $ColumnLabel= \"1\"; break;\n case \"days\": $ColumnLabel= \"2\"; break;\n case \"months\": $ColumnLabel= \"3\"; break;\n case \"years\": $ColumnLabel= \"4\"; break;}\n return($ColumnLabel);\n }\n //--------------------------------------------\n function VerboseEcho($Anything)\n {global $Verbose;\n if ($Verbose == true) Echo $Anything;}\n ?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-03-29 18:13:17.953 UTC","last_activity_date":"2016-03-29 18:40:05.923 UTC","last_edit_date":"2016-03-29 18:40:05.923 UTC","last_editor_display_name":"","last_editor_user_id":"1320581","owner_display_name":"","owner_user_id":"1320581","post_type_id":"1","score":"2","tags":"javascript|php|postgresql|charts|google-visualization","view_count":"87"} +{"id":"40345980","title":"Trying to add 10 to this.y variable, but returns NaN","body":"\u003cp\u003eI seem to have done something wrong and cant find any solutions. I've tried to convert them into numbers and tried += but i get NaN.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction circle() {\n this.x = 60;\n this.y = 200;\n this.draw = function() {\n ellipse(this.x, this.y, 20, \"green\");\n };\n\n\n this.move = function() {\n $(document).keydown(function(e) {\n // console.log(e.keyCode);\n if (e.keyCode === 68) {\n this.y += 1;\n console.log(this.y);\n }\n });\n };\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMight it be because they are not variables?\u003c/p\u003e\n\n\u003cp\u003ethanks :)\u003c/p\u003e","accepted_answer_id":"40346111","answer_count":"1","comment_count":"11","creation_date":"2016-10-31 16:01:59.417 UTC","last_activity_date":"2016-10-31 16:12:21.017 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7035941","post_type_id":"1","score":"0","tags":"javascript|jquery|html","view_count":"49"} +{"id":"38765068","title":"Strange happenings in the barren wastes of visual studio","body":"\u003cp\u003eSo I was just happily going along defining a new class when this happend: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass Thing : public OtherThing\n{\npublic:\n Thing : public OtherThing();//here\n};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI really have no idea why visual assist/studio did this and i've never seen it before so really my question is what does it mean?\u003c/p\u003e\n\n\u003cp\u003eJust for the sake of clarity I would normally define the same class like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass Thing : public OtherThing\n{\npublic:\n Thing();\n};\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"38766386","answer_count":"1","comment_count":"5","creation_date":"2016-08-04 10:39:54.527 UTC","last_activity_date":"2016-08-04 12:07:26.017 UTC","last_edit_date":"2016-08-04 12:07:26.017 UTC","last_editor_display_name":"","last_editor_user_id":"6564148","owner_display_name":"","owner_user_id":"6564148","post_type_id":"1","score":"0","tags":"c++|visual-studio-2012","view_count":"66"} +{"id":"6321663","title":"NSButton over QTCaptureView","body":"\u003cp\u003eIs there any way to put NSButton object over QTCaptureView? \nI have done following, \u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eIn interface builder, added a\nQTCaptureView, \u003c/li\u003e\n\u003cli\u003eAdded a button\non top of QTCaptureView and it's\nallowing to do so.\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eWhen i launch the application, I can see the button over the QTCaptureView but when I start the Camera which will show the Preview in the QTCaptureView session, button is overriding by QTCaptureView. \u003c/p\u003e\n\n\u003cp\u003eAny idea what i am doing wrong ?\u003c/p\u003e\n\n\u003cp\u003eBasically I need to implement a Control which shows QTCaptureView and a Button over it; when user presses the button then I need to Launch the NSImageView over the QTCaptureView.\u003c/p\u003e","accepted_answer_id":"6322313","answer_count":"1","comment_count":"0","creation_date":"2011-06-12 11:24:20.627 UTC","favorite_count":"1","last_activity_date":"2011-06-17 19:47:48.46 UTC","last_edit_date":"2011-06-12 11:29:59.803 UTC","last_editor_display_name":"","last_editor_user_id":"24424","owner_display_name":"","owner_user_id":"1565490","post_type_id":"1","score":"1","tags":"objective-c|cocoa|nsbutton","view_count":"234"} +{"id":"42738005","title":"PySNMP Instrumentation Controller with asyncio","body":"\u003cp\u003eI need to write simple SNMP responder where part of the job is to call some external script through \u003ccode\u003easyncio.subprocess\u003c/code\u003e module. Now I am experimenting with \u003ccode\u003epysnmp\u003c/code\u003e but following slightly modified code from examples doesn't work:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport asyncio \n\nfrom pysnmp.entity import engine, config \nfrom pysnmp.entity.rfc3413 import cmdrsp, context \nfrom pysnmp.carrier.asyncio.dgram import udp \nfrom pysnmp.smi import instrum \nfrom pysnmp.proto.api import v2c \n\nsnmpEngine = engine.SnmpEngine() \n\nconfig.addTransport( \n snmpEngine, \n udp.domainName, \n udp.UdpTransport().openServerMode(('0.0.0.0', 161)) \n) \n\n# config.addV1System(snmpEngine, 'my-area', 'public') \nconfig.addV1System(snmpEngine, 'public', 'public', contextName='my-context') \nconfig.addV1System(snmpEngine, 'private', 'private', contextName='my-context') \n\n# Allow full MIB access for each user at VACM \nconfig.addVacmUser(snmpEngine, 2, \"public\", 'noAuthNoPriv', (1, 3, 6, 1, 2, 1), (1, 3, 6, 1, 2, 1)) \nconfig.addVacmUser(snmpEngine, 2, \"private\", 'noAuthNoPriv', (1, 3, 6, 1, 2, 1), (1, 3, 6, 1, 2, 1)) \n\n# Create an SNMP context \nsnmpContext = context.SnmpContext(snmpEngine) \n\n# Very basic Management Instrumentation Controller without \n# any Managed Objects attached. It supports only GET's and \n# always echos request var-binds in response. \nclass EchoMibInstrumController(instrum.AbstractMibInstrumController): \n @asyncio.coroutine \n def readVars(self, varBinds, acInfo=(None, None)): \n yield from asyncio.sleep(1) \n return [(ov[0], v2c.OctetString('You queried OID %s' % ov[0])) for ov in varBinds] \n\n# Create a custom Management Instrumentation Controller and register at \n# SNMP Context under ContextName 'my-context' \nsnmpContext.registerContextName( \n v2c.OctetString('my-context'), # Context Name \n EchoMibInstrumController() # Management Instrumentation \n) \n\n# Register GET\u0026amp;SET Applications at the SNMP engine for a custom SNMP context \ncmdrsp.GetCommandResponder(snmpEngine, snmpContext) \ncmdrsp.SetCommandResponder(snmpEngine, snmpContext) \n\nloop = asyncio.get_event_loop() \nloop.run_forever()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen try to make a query with following command \u003ccode\u003esnmpget -v 2c -c public 127.0.0.1 .1.3.6.1.2.1.1.1.0\u003c/code\u003e script fails with the following traceback.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eException in callback AbstractTransportDispatcher._cbFun(\u0026lt;pysnmp.carri...x7f4c7540d518\u0026gt;, ('127.0.0.1', 44209), b'0)\\x02\\x01\\...1\\x00\\x05\\x00') \nhandle: \u0026lt;Handle AbstractTransportDispatcher._cbFun(\u0026lt;pysnmp.carri...x7f4c7540d518\u0026gt;, ('127.0.0.1', 44209), b'0)\\x02\\x01\\...1\\x00\\x05\\x00')\u0026gt; \nTraceback (most recent call last): \n File \"/usr/lib/python3.4/asyncio/events.py\", line 120, in _run \n self._callback(*self._args) \n File \"/opt/profiset2/lib/python3.4/site-packages/pysnmp/carrier/base.py\", line 70, in _cbFun \n self, transportDomain, transportAddress, incomingMessage \n File \"/opt/profiset2/lib/python3.4/site-packages/pysnmp/entity/engine.py\", line 154, in __receiveMessageCbFun \n self, transportDomain, transportAddress, wholeMsg \n File \"/opt/profiset2/lib/python3.4/site-packages/pysnmp/proto/rfc3412.py\", line 421, in receiveMessage \n PDU, maxSizeResponseScopedPDU, stateReference) \n File \"/opt/profiset2/lib/python3.4/site-packages/pysnmp/entity/rfc3413/cmdrsp.py\", line 140, in processPdu \n (self.__verifyAccess, snmpEngine)) \n File \"/opt/profiset2/lib/python3.4/site-packages/pysnmp/entity/rfc3413/cmdrsp.py\", line 247, in handleMgmtOperation \n mgmtFun(v2c.apiPDU.getVarBinds(PDU), (acFun, acCtx))) \n File \"/opt/profiset2/lib/python3.4/site-packages/pysnmp/entity/rfc3413/cmdrsp.py\", line 46, in sendVarBinds \n v2c.apiPDU.setVarBinds(PDU, varBinds) \n File \"/opt/profiset2/lib/python3.4/site-packages/pysnmp/proto/api/v1.py\", line 135, in setVarBinds \n varBindList.getComponentByPosition(idx), varBind \n File \"/opt/profiset2/lib/python3.4/site-packages/pysnmp/proto/api/v1.py\", line 38, in setOIDVal \n oid, val = oidVal[0], oidVal[1] \nTypeError: 'Future' object does not support indexing\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMay be I am doing something stupid and I admit that I don't know much about SNMP, then, please, direct me in the right direction.\u003c/p\u003e","accepted_answer_id":"42738986","answer_count":"1","comment_count":"0","creation_date":"2017-03-11 16:58:10.593 UTC","last_activity_date":"2017-03-11 18:28:16.52 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"752419","post_type_id":"1","score":"0","tags":"async-await|python-asyncio|pysnmp","view_count":"83"} +{"id":"36272283","title":"How do I parse out a text file with AWK and fprint in BASH?","body":"\u003cp\u003e\u003cstrong\u003eI have a sample.txt file as follows:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eName City ST Zip CTY\nJohn Smith BrooklynNY10050USA\nPaul DavidsonQueens NY10040USA\nMichael SmithNY NY10030USA\nGeorge HermanBronx NY10020USA\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eImage of input (in case if upload doesn't show properly)\n\u003ca href=\"http://i.stack.imgur.com/Iv7nX.jpg\" rel=\"nofollow\"\u003eInput\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eDesired output is into separate columns as shown below:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://i.stack.imgur.com/KK4rf.jpg\" rel=\"nofollow\"\u003eDesired Output\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI tried this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#!/bin/bash\nawk '{printf \"%13-s %-8s %-2s %-5s %-3s\\n\", $1, $2, $3, $4, $5}' sample.txt \u0026gt; new.txt\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eAnd it's unsuccessful with this result:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eName City ST Zip CTY\n\nJohn Smith BrooklynNY10050USA\n\nPaul DavidsonQueens NY10040USA\n\nMichael SmithNY NY10030USA\n\nGeorge HermanBronx NY10020USA\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWould appreciate it if anyone could tweak this so the text file will be in delimited format as shown above. Thank you so much!!\u003c/p\u003e","answer_count":"3","comment_count":"0","creation_date":"2016-03-28 22:29:13.243 UTC","last_activity_date":"2016-03-28 23:52:59.957 UTC","last_edit_date":"2016-03-28 22:31:09.283 UTC","last_editor_display_name":"","last_editor_user_id":"1735756","owner_display_name":"","owner_user_id":"3395315","post_type_id":"1","score":"1","tags":"linux|awk|printf","view_count":"70"} +{"id":"36450173","title":"Wordpress Menu with ::after CSS Styling","body":"\u003cp\u003eI want to add the | pipe to the end of each li tag excluding the first and last. is there a better way to do this, was thinking maybe using \u003ccode\u003e:nth-child()\u003c/code\u003e selector?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e .categoryMenu ul li::after {\n content: ' | ';\n }\n\n.categoryMenu ul li:nth-child(1) {\n content: 'hello';\n background: red;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eseems that the content css property does not work with \u003ccode\u003e:nth-child()\u003c/code\u003e only \u003ccode\u003e::after\u003c/code\u003e\u003c/p\u003e","accepted_answer_id":"36450309","answer_count":"3","comment_count":"1","creation_date":"2016-04-06 11:44:34.073 UTC","last_activity_date":"2016-04-06 13:46:49.59 UTC","last_edit_date":"2016-04-06 13:46:49.59 UTC","last_editor_display_name":"","last_editor_user_id":"2419183","owner_display_name":"","owner_user_id":"1618877","post_type_id":"1","score":"2","tags":"css|css3","view_count":"72"} +{"id":"36631385","title":"Multi-Programming with OSMESA","body":"\u003cp\u003eI have being trying to multi-program my software to run on different threads on my client machine with c++; and rendering opengl drawings off-scrren with OSMESA. Does anybody know if its theoretical possible to do this using OSMESA.\u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2016-04-14 18:40:37.203 UTC","last_activity_date":"2016-04-14 18:40:37.203 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3292834","post_type_id":"1","score":"0","tags":"c++|opengl","view_count":"61"} +{"id":"28919405","title":"Java Dealing with Double values having E","body":"\u003cp\u003eSuppose that I have:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e double Nc= 7.6695805E-4;\n NumberFormat formatter = new DecimalFormat(\"0.00000000000\");\n String string = formatter.format(Nc);\n System.out.println(string);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethe output would be:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e 0.00076695805\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut it is place in string type variable!\nWhat i have to do is to convert it into double or float or long so that it should remain same as 0.00076695805 and so that i can use it for my calculation!\nwhat i have tried is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e double Nc= 7.6695805E-4;\n NumberFormat formatter = new DecimalFormat(\"0.00000000000\");\n String string = formatter.format(Nc);\n System.out.println(Double.parseDouble(string));\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethe output becomes:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e 7.6695805E-4 //which is same as i gave\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eso what should be the solution!\u003c/p\u003e","accepted_answer_id":"28919426","answer_count":"2","comment_count":"2","creation_date":"2015-03-07 20:06:49.053 UTC","favorite_count":"1","last_activity_date":"2015-03-07 20:11:05.423 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3411946","post_type_id":"1","score":"-2","tags":"java|string|math|rounding|number-formatting","view_count":"1207"} +{"id":"21332992","title":"CakePHP routing a role to a prefix with a different name","body":"\u003cp\u003eI have the following user roles in my application:\u003c/p\u003e\n\n\u003cp\u003eAdmin\nClient\nContractor\u003c/p\u003e\n\n\u003cp\u003eThey are controlled by ACL for each function / page.\u003c/p\u003e\n\n\u003cp\u003eI want to create a new one called Client_site. But I want this new role to route through to the Client prefixed pages. e.g. /client/:controller/:action\u003c/p\u003e\n\n\u003cp\u003eBasically I want it to use all the same pages as the client role, but just have read only access to them. Which I have set up in the ACL tables.\u003c/p\u003e\n\n\u003cp\u003eHow would I set this up in the routing?\u003c/p\u003e\n\n\u003cp\u003eAlso is there anything else I will need to amend to get this working?\u003c/p\u003e","accepted_answer_id":"21355955","answer_count":"1","comment_count":"1","creation_date":"2014-01-24 12:40:41.547 UTC","last_activity_date":"2014-01-25 20:38:02.073 UTC","last_edit_date":"2014-01-24 13:58:34.153 UTC","last_editor_display_name":"","last_editor_user_id":"2453502","owner_display_name":"","owner_user_id":"2453502","post_type_id":"1","score":"-3","tags":"php|cakephp|routing|acl|prefixes","view_count":"134"} +{"id":"4681122","title":"Tricky WPF binding","body":"\u003cp\u003eI'm unable to do a simple but yet tricky WPF binding in Silverlight 4 (WP7 development)\u003c/p\u003e\n\n\u003cp\u003eI have the following code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eClass People{\n public string firstname;\n public string lastname;\n}\n\nClass DataSource{\n public static List\u0026lt;People\u0026gt; people; // consider this as a list filled with objects already\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm trying to put the list of people into a ListBox, here's the xaml I've tried:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;ListBox x:Name=\"peoplelistbox\" Margin=\"0,0,-12,0\" ItemsSource=\"{Binding DataSource.people}\"\u0026gt;\n \u0026lt;ListBox.ItemTemplate\u0026gt;\n \u0026lt;DataTemplate\u0026gt;\n \u0026lt;StackPanel Margin=\"0,0,0,17\" Width=\"432\"\u0026gt;\n \u0026lt;TextBlock Text=\"{Binding firstname}\" TextWrapping=\"Wrap\"/\u0026gt;\n \u0026lt;TextBlock Text=\"{Binding lastname}\" TextWrapping=\"Wrap\"/\u0026gt;\n \u0026lt;/StackPanel\u0026gt;\n \u0026lt;/DataTemplate\u0026gt;\n \u0026lt;/ListBox.ItemTemplate\u0026gt;\n \u0026lt;/ListBox\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut unfortunately my listbox remains empty. What am I doing wrong ?\u003c/p\u003e\n\n\u003cp\u003eThank you in advance :)\u003c/p\u003e\n\n\u003cp\u003eCheers,\nMiloud B.\u003c/p\u003e","accepted_answer_id":"4681203","answer_count":"3","comment_count":"0","creation_date":"2011-01-13 14:30:02.007 UTC","favorite_count":"1","last_activity_date":"2011-01-20 11:11:37.22 UTC","last_edit_date":"2011-01-20 11:11:37.22 UTC","last_editor_display_name":"","last_editor_user_id":"566791","owner_display_name":"","owner_user_id":"429059","post_type_id":"1","score":"2","tags":"wpf|data-binding|windows-phone-7|listbox|binding","view_count":"1462"} +{"id":"18905301","title":"How do I render a fullscreen frame with a different resolution than my display?","body":"\u003cp\u003eI am in the process of teaching myself DirectX development while going through all the tutorials on \u003ca href=\"http://directxtutorial.com/\" rel=\"nofollow\"\u003ehttp://directxtutorial.com/\u003c/a\u003e. I have run into a problem that I believe is related to me having multiple monitors.\u003c/p\u003e\n\n\u003cp\u003eMy display is 1920 x 1080. When my code runs in its current state my primary monitor becomes black with the cursor in the middle. When I set my SCREEN defines at the top of my code to 1920 x 1080 my program runs fine and displays my sprite with the navy background. When I leave the SCREEN defines as 1440 x 900 and disable my second monitor my program runs fine. This is what leads me to believe there is some issue with my second monitor hosing up things.\u003c/p\u003e\n\n\u003cp\u003eAny help would be appreciated!\u003c/p\u003e\n\n\u003cp\u003eBelow is my current code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e // include the basic windows header files and the Direct3D header file\n #include \u0026lt;windows.h\u0026gt;\n #include \u0026lt;windowsx.h\u0026gt;\n #include \u0026lt;d3d9.h\u0026gt;\n #include \u0026lt;d3dx9.h\u0026gt;\n\n // define the screen resolution and keyboard macros\n #define SCREEN_WIDTH 1440\n #define SCREEN_HEIGHT 900\n #define KEY_DOWN(vk_code) ((GetAsyncKeyState(vk_code) \u0026amp; 0x8000) ? 1 : 0)\n #define KEY_UP(vk_code) ((GetAsyncKeyState(vk_code) \u0026amp; 0x8000) ? 0 : 1)\n\n // include the Direct3D Library file\n #pragma comment (lib, \"d3d9.lib\")\n #pragma comment (lib, \"d3dx9.lib\")\n\n // global declarations\n LPDIRECT3D9 d3d; // the pointer to our Direct3D interface\n LPDIRECT3DDEVICE9 d3ddev; // the pointer to the device class\n LPD3DXSPRITE d3dspt; // the pointer to our Direct3D Sprite interface\n BOOL stimToggle = TRUE;\n\n // sprite declarations\n LPDIRECT3DTEXTURE9 sprite; // the pointer to the sprite\n\n // function prototypes\n void initD3D(HWND hWnd); // sets up and initializes Direct3D\n void render_frame(void); // renders a single frame\n void cleanD3D(void); // closes Direct3D and releases memory\n void init_input(HWND hWnd);\n\n // the WindowProc function prototype\n LRESULT CALLBACK WindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);\n\n\n // the entry point for any Windows program\n int WINAPI WinMain(HINSTANCE hInstance,\n HINSTANCE hPrevInstance,\n LPSTR lpCmdLine,\n int nCmdShow)\n {\n HWND hWnd;\n WNDCLASSEX wc;\n\n ZeroMemory(\u0026amp;wc, sizeof(WNDCLASSEX));\n\n wc.cbSize = sizeof(WNDCLASSEX);\n wc.style = CS_HREDRAW | CS_VREDRAW;\n wc.lpfnWndProc = (WNDPROC)WindowProc;\n wc.hInstance = hInstance;\n wc.hCursor = LoadCursor(NULL, IDC_ARROW);\n wc.hbrBackground = (HBRUSH)COLOR_WINDOW;\n wc.lpszClassName = L\"WindowClass1\";\n\n RegisterClassEx(\u0026amp;wc);\n\n hWnd = CreateWindowEx(NULL,\n L\"WindowClass1\",\n L\"Our Direct3D Program\",\n WS_EX_TOPMOST | WS_POPUP,\n 0, 0,\n SCREEN_WIDTH, SCREEN_HEIGHT,\n NULL,\n NULL,\n hInstance,\n NULL);\n\n ShowWindow(hWnd, nCmdShow);\n\n // set up and initialize Direct3D\n initD3D(hWnd);\n init_input(hWnd);\n\n // enter the main loop:\n\n MSG msg;\n\n while(TRUE)\n {\n //DWORD starting_point = GetTickCount();\n\n if (PeekMessage(\u0026amp;msg, NULL, 0, 0, PM_REMOVE))\n {\n if (msg.message == WM_QUIT)\n break;\n\n TranslateMessage(\u0026amp;msg);\n DispatchMessage(\u0026amp;msg);\n }\n\n render_frame();\n\n // check the 'escape' key\n if(KEY_DOWN(VK_ESCAPE))\n PostMessage(hWnd, WM_DESTROY, 0, 0);\n\n //while ((GetTickCount() - starting_point) \u0026lt; 25);\n }\n\n // clean up DirectX and COM\n cleanD3D();\n\n return msg.wParam;\n }\n\n\n // this is the main message handler for the program\n LRESULT CALLBACK WindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)\n {\n switch(message)\n {\n case WM_DESTROY:\n {\n PostQuitMessage(0);\n return 0;\n } break;\n case WM_INPUT:\n {\n RAWINPUT InputData;\n\n UINT DataSize = sizeof(RAWINPUT);\n GetRawInputData((HRAWINPUT)lParam,\n RID_INPUT,\n \u0026amp;InputData,\n \u0026amp;DataSize,\n sizeof(RAWINPUTHEADER));\n\n // set the mouse button status\n if(InputData.data.mouse.usButtonFlags == RI_MOUSE_LEFT_BUTTON_DOWN)\n stimToggle = FALSE;\n if(InputData.data.mouse.usButtonFlags == RI_MOUSE_LEFT_BUTTON_UP)\n stimToggle = TRUE;\n\n return 0;\n } break;\n }\n\n return DefWindowProc (hWnd, message, wParam, lParam);\n }\n\n\n // this function initializes and prepares Direct3D for use\n void initD3D(HWND hWnd)\n {\n d3d = Direct3DCreate9(D3D_SDK_VERSION);\n\n D3DPRESENT_PARAMETERS d3dpp;\n\n ZeroMemory(\u0026amp;d3dpp, sizeof(d3dpp));\n d3dpp.Windowed = FALSE;\n d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;\n d3dpp.hDeviceWindow = hWnd;\n d3dpp.BackBufferFormat = D3DFMT_X8R8G8B8;\n d3dpp.BackBufferWidth = SCREEN_WIDTH;\n d3dpp.BackBufferHeight = SCREEN_HEIGHT;\n d3dpp.BackBufferCount = 1;\n d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;\n d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT;\n d3dpp.EnableAutoDepthStencil = FALSE;\n\n // create a device class using this information and the info from the d3dpp stuct\n d3d-\u0026gt;CreateDevice(D3DADAPTER_DEFAULT,\n D3DDEVTYPE_HAL,\n hWnd,\n D3DCREATE_SOFTWARE_VERTEXPROCESSING,\n \u0026amp;d3dpp,\n \u0026amp;d3ddev);\n\n\n D3DXCreateSprite(d3ddev, \u0026amp;d3dspt); // create the Direct3D Sprite object\n\n D3DXCreateTextureFromFileEx(d3ddev, // the device pointer\n L\"ast_sprite.png\", // the new file name\n D3DX_DEFAULT, // default width\n D3DX_DEFAULT, // default height\n D3DX_DEFAULT, // no mip mapping\n NULL, // regular usage\n D3DFMT_A8R8G8B8, // 32-bit pixels with alpha\n D3DPOOL_MANAGED, // typical memory handling\n D3DX_DEFAULT, // no filtering\n D3DX_DEFAULT, // no mip filtering\n D3DCOLOR_XRGB(0, 0, 128), // the hot-pink color key\n NULL, // no image info struct\n NULL, // not using 256 colors\n \u0026amp;sprite); // load to sprite\n\n return;\n }\n\n\n // this is the function used to render a single frame\n void render_frame(void)\n {\n // clear the window to a deep blue\n d3ddev-\u0026gt;Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0, 0, 128), 1.0f, 0);\n\n if(stimToggle)\n {\n d3ddev-\u0026gt;BeginScene(); // begins the 3D scene\n d3dspt-\u0026gt;Begin(D3DXSPRITE_ALPHABLEND); // begin sprite drawing\n\n D3DSURFACE_DESC surfaceDesc;\n sprite-\u0026gt;GetLevelDesc(NULL, \u0026amp;surfaceDesc); \n\n // draw the sprite\n D3DXVECTOR3 center(surfaceDesc.Width / 2.0f, surfaceDesc.Height / 2.0f, 0.0f); // center at the upper-left corner\n D3DXVECTOR3 position(SCREEN_WIDTH / 2.0f, SCREEN_HEIGHT / 2.0f, 0.0f); // position at 50, 50 with no depth\n d3dspt-\u0026gt;Draw(sprite, NULL, \u0026amp;center, \u0026amp;position, D3DCOLOR_XRGB(255, 255, 255));\n\n d3dspt-\u0026gt;End(); // end sprite drawing\n d3ddev-\u0026gt;EndScene(); // ends the 3D scene\n }\n\n d3ddev-\u0026gt;Present(NULL, NULL, NULL, NULL);\n\n return;\n }\n\n // this is the function that initializes the Raw Input API\n void init_input(HWND hWnd)\n {\n RAWINPUTDEVICE Mouse;\n Mouse.usUsage = 0x02; // register mouse\n Mouse.usUsagePage = 0x01; // top-level mouse\n Mouse.dwFlags = NULL; // flags\n Mouse.hwndTarget = hWnd; // handle to a window\n\n RegisterRawInputDevices(\u0026amp;Mouse, 1, sizeof(RAWINPUTDEVICE)); // register the device\n }\n\n // this is the function that cleans up Direct3D and COM\n void cleanD3D(void)\n {\n sprite-\u0026gt;Release();\n d3ddev-\u0026gt;Release();\n d3d-\u0026gt;Release();\n\n return;\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eEDIT:\nHere is my debug information from my Output window.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eDirect3D9: (INFO) :======================= Hal SWVP device selected\n\nDirect3D9: (INFO) :HalDevice Driver Style b\n\nDirect3D9: :Subclassing window 00680b0a\nDirect3D9: :StartExclusiveMode\nDirect3D9: :WM_DISPLAYCHANGE: 1440x900x32\nDirect3D9: (ERROR) :Lost due to display uniqueness change\nPrototype.exe has triggered a breakpoint.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is where it triggers the breakpoint. When I click continue, the rest of the below is displayed.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eDirect3D9: (INFO) :Using FF to PS converter\n\nDirect3D9: (INFO) :Enabling multi-processor optimizations\nDirect3D9: (INFO) :DDI threading started\n\nDirect3D9: (INFO) :Using FF to VS converter in software vertex processing\n\nDirect3D9: (ERROR) :************************************************************\nDirect3D9: (ERROR) :ASSERTION FAILED! File s:\\gfx_aug09\\windows\\directx\\dxg\\inactive\\d3d9\\d3d\\fw\\lhbatchfilter.cpp Line 3466: pArgs-\u0026gt;Flags.Discard\nDirect3D9: (ERROR) :************************************************************\nDirect3D9: (ERROR) :************************************************************\nDirect3D9: (ERROR) :ASSERTION FAILED! File s:\\gfx_aug09\\windows\\directx\\dxg\\inactive\\d3d9\\d3d\\fw\\lhbatchfilter.cpp Line 3466: pArgs-\u0026gt;Flags.Discard\nDirect3D9: (ERROR) :************************************************************\nDirect3D9: (ERROR) :************************************************************\nDirect3D9: (ERROR) :ASSERTION FAILED! File s:\\gfx_aug09\\windows\\directx\\dxg\\inactive\\d3d9\\d3d\\fw\\lhbatchfilter.cpp Line 3466: pArgs-\u0026gt;Flags.Discard\nDirect3D9: (ERROR) :************************************************************\nD3D9 Helper: Warning: Default value for D3DRS_POINTSIZE_MAX is 2.19902e+012f, not 4.16345e-316f. This is ok.\nDirect3D9: :WM_ACTIVATEAPP: BEGIN Activating app pid=00003c58, tid=00005888\nDirect3D9: :*** Active state changing\nDirect3D9: :WM_ACTIVATEAPP: DONE Activating app pid=00003c58, tid=00005888\nDirect3D9: :WM_ACTIVATEAPP: BEGIN Activating app pid=00003c58, tid=00005888\nDirect3D9: :*** Already activated\nDirect3D9: :WM_ACTIVATEAPP: DONE Activating app pid=00003c58, tid=00005888\nDirect3D9: :WM_ACTIVATEAPP: BEGIN Activating app pid=00003c58, tid=00005888\nDirect3D9: :*** Already activated\nDirect3D9: :WM_ACTIVATEAPP: DONE Activating app pid=00003c58, tid=00005888\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-09-19 21:34:45.963 UTC","last_activity_date":"2013-09-23 19:34:19.817 UTC","last_edit_date":"2013-09-23 19:34:19.817 UTC","last_editor_display_name":"","last_editor_user_id":"678329","owner_display_name":"","owner_user_id":"678329","post_type_id":"1","score":"0","tags":"c++|directx|direct3d|directx-9|direct3d9","view_count":"1659"} +{"id":"4547041","title":"How to change the xslt processor used in a .NET program?","body":"\u003cp\u003eHow to change xslt processor in .net 2.0?\u003c/p\u003e\n\n\u003cp\u003eThe question can be vague cause I'm totaly noob with that. I used jetbrain to trace my web app\nand I saw that xslt transformation take very long time. I folowed \u003ca href=\"http://msdn.microsoft.com/en-us/library/ff649152.aspx\" rel=\"nofollow\"\u003emicrosoft msdn recommandations\u003c/a\u003e \nbut someone told me to turn (upgrade) my xslt processor to 2.0. to increase performance.\u003c/p\u003e\n\n\u003cp\u003eCan you explain me what something about that.\u003c/p\u003e","accepted_answer_id":"4548762","answer_count":"1","comment_count":"11","creation_date":"2010-12-28 15:13:26.557 UTC","last_activity_date":"2010-12-29 16:51:29.627 UTC","last_edit_date":"2010-12-28 19:13:20.113 UTC","last_editor_display_name":"","last_editor_user_id":"36305","owner_display_name":"","owner_user_id":"454998","post_type_id":"1","score":"1","tags":"c#|.net|xslt","view_count":"1003"} +{"id":"45434749","title":"Get all existing users in the database from the given list of user","body":"\u003cp\u003eI have an API which will take list of users as input. \nAnd the output should be all the user who already exits in the database from the list of input users.\u003c/p\u003e\n\n\u003cp\u003eOne approach I know is to get all the users from the database and loop them all to find if it matches with the input list of users using some programming language.\u003c/p\u003e\n\n\u003cp\u003eOther approach is I can send input users list to the database and loop at database end to find the matched user from the input list of users.\u003c/p\u003e\n\n\u003cp\u003eBut in the above approaches if i have more users in the database it takes long time to process them.\u003c/p\u003e\n\n\u003cp\u003eI there any standard algorithm or approach to handle this kind of problems with more number of records. \u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-08-01 09:59:29.453 UTC","last_activity_date":"2017-08-01 09:59:29.453 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2621285","post_type_id":"1","score":"0","tags":"database|python-3.x","view_count":"9"} +{"id":"31262865","title":"What does ((Port *)0x41004400UL) mean here?","body":"\u003cp\u003eI'm working on a developing board that has a 32-bit ARM based microntroller on it (namely the board is Atmel SAM D21J18A). I'm still at the learning phase and I have a lot to go, but I'm really into embedded systems.\u003c/p\u003e\n\n\u003cp\u003eI have some background in C. However, it's obviously not enough. I was looking at the codes of an example project by Atmel, and I didn't really get some parts of it. Here is one of them:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e #define PORT ((Port *)0x41004400UL) /**\u0026lt; \\brief (PORT) APB Base Address */\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ePort is defined as:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e typedef struct {\n PortGroup Group[2]; /**\u0026lt; \\brief Offset: 0x00 PortGroup groups [GROUPS] */\n } Port;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand PortGroup is defined as:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etypedef struct {\n __IO PORT_DIR_Type DIR; /**\u0026lt; \\brief Offset: 0x00 (R/W 32) Data Direction */\n __IO PORT_DIRCLR_Type DIRCLR; /**\u0026lt; \\brief Offset: 0x04 (R/W 32) Data Direction Clear */\n __IO PORT_DIRSET_Type DIRSET; /**\u0026lt; \\brief Offset: 0x08 (R/W 32) Data Direction Set */\n __IO PORT_DIRTGL_Type DIRTGL; /**\u0026lt; \\brief Offset: 0x0C (R/W 32) Data Direction Toggle */\n __IO PORT_OUT_Type OUT; /**\u0026lt; \\brief Offset: 0x10 (R/W 32) Data Output Value */\n __IO PORT_OUTCLR_Type OUTCLR; /**\u0026lt; \\brief Offset: 0x14 (R/W 32) Data Output Value Clear */\n __IO PORT_OUTSET_Type OUTSET; /**\u0026lt; \\brief Offset: 0x18 (R/W 32) Data Output Value Set */\n __IO PORT_OUTTGL_Type OUTTGL; /**\u0026lt; \\brief Offset: 0x1C (R/W 32) Data Output Value Toggle */\n __I PORT_IN_Type IN; /**\u0026lt; \\brief Offset: 0x20 (R/ 32) Data Input Value */\n __IO PORT_CTRL_Type CTRL; /**\u0026lt; \\brief Offset: 0x24 (R/W 32) Control */\n __O PORT_WRCONFIG_Type WRCONFIG; /**\u0026lt; \\brief Offset: 0x28 ( /W 32) Write Configuration */\n RoReg8 Reserved1[0x4];\n __IO PORT_PMUX_Type PMUX[16]; /**\u0026lt; \\brief Offset: 0x30 (R/W 8) Peripheral Multiplexing n */\n __IO PORT_PINCFG_Type PINCFG[32]; /**\u0026lt; \\brief Offset: 0x40 (R/W 8) Pin Configuration n */\n RoReg8 Reserved2[0x20];\n} PortGroup;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo here, we are looking at the address 0x41004400UL, get the data in there, and then what happens?\u003c/p\u003e\n\n\u003cp\u003eI looked up for this but couldn't find anything useful. If you have any suggestions (tutorials, books etc.), please let me hear.\u003c/p\u003e","accepted_answer_id":"31266754","answer_count":"2","comment_count":"3","creation_date":"2015-07-07 07:56:37.093 UTC","last_activity_date":"2015-07-07 13:39:46.26 UTC","last_edit_date":"2015-07-07 13:39:46.26 UTC","last_editor_display_name":"","last_editor_user_id":"3160184","owner_display_name":"","owner_user_id":"3160184","post_type_id":"1","score":"0","tags":"c|arm|embedded|atmel|atmelstudio","view_count":"192"} +{"id":"35542092","title":"Cannot convert value of type 'Array\u003cString\u003e' to expected argument type 'String?'","body":"\u003cp\u003eI am using \u003ccode\u003eWatchConnectivity\u003c/code\u003e framework to send an array called \u003ccode\u003ewatchItems\u003c/code\u003e of string value to the apple watch from the phone. I add the \u003ccode\u003ewatchItems\u003c/code\u003e from the sent dictionary and add it to an array called \u003ccode\u003eitems\u003c/code\u003e on the watch to use in a \u003ccode\u003eWKInterfaceTable\u003c/code\u003e. \u003c/p\u003e\n\n\u003cp\u003eThe error is occurring for the following line when setting the text of the label to theItem. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efor (index, theItem) in self.items.enumerate() {\n let row = self.table.rowControllerAtIndex(index) as! CellRowController\n row.bookmarksCellLabel.setText(theItem)\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHeres a full explanation of what I am doing. \u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eiPhone\u003c/strong\u003e \u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eself.items\u003c/code\u003e is an array of \u003ccode\u003eNSManagedObject\u003c/code\u003es and each item has a property called \u003ccode\u003etitle\u003c/code\u003e which is a string. So I loop through the \u003ccode\u003eobjects\u003c/code\u003e array and add all the string values to an array called \u003ccode\u003ewatchItems\u003c/code\u003e.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunc session(session: WCSession, didReceiveMessage message: [String : AnyObject], replyHandler: ([String : AnyObject]) -\u0026gt; Void) {\n\n var watchItems = [\"\"]\n\n for item in self.items {\n watchItems.append(item.title)\n }\n\n //send a reply\n replyHandler( [ \"Value\" : [watchItems]])\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eApple Watch\u003c/strong\u003e \u003c/p\u003e\n\n\u003cp\u003eHere I add the watchItems array from the received message dictionary to the \u003ccode\u003eitems\u003c/code\u003e array on the watch. The \u003ccode\u003ewatchItems\u003c/code\u003e array is an array of string values and so is the \u003ccode\u003eitems\u003c/code\u003e array on the watch. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar items = [String]()\n\n@IBAction func refreshAction() {\n let messageToSend = [\"Value\":\"Hello iPhone\"]\n session.sendMessage(messageToSend, replyHandler: { replyMessage in\n\n let value = replyMessage[\"Value\"] as! String\n self.titleLabel.setText(value)\n\n }, errorHandler: {error in\n // catch any errors here\n print(error)\n })\n}\n\n\nfunc session(session: WCSession, didReceiveMessage message: [String : AnyObject], replyHandler: ([String : AnyObject]) -\u0026gt; Void) {\n\n let value = message[\"Value\"] as! [String]\n\n dispatch_async(dispatch_get_main_queue()) {\n self.items.removeAll()\n self.items.append(value)\n self.loadTableData()\n }\n\n //send a reply\n replyHandler([\"Value\":\"Yes\"])\n\n} \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFunction to reload the \u003ccode\u003eWKInterfaceTable\u003c/code\u003e and set label as each item in the items array. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunc loadTableData() {\n table.setNumberOfRows(self.items.count, withRowType: \"CellRow\")\n if self.items.count \u0026gt; 0 {\n for (index, theItem) in self.items.enumerate() {\n let row = self.table.rowControllerAtIndex(index) as! CellRowController\n row.cellLabel.setText(theItem)\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI get the error when adding the string value to the \u003ccode\u003ecellLabel\u003c/code\u003e. Does anybody know where I may be going wrong ? \u003c/p\u003e","answer_count":"0","comment_count":"9","creation_date":"2016-02-21 21:11:03.223 UTC","favorite_count":"2","last_activity_date":"2016-03-16 15:34:43.627 UTC","last_edit_date":"2016-03-16 15:34:43.627 UTC","last_editor_display_name":"","last_editor_user_id":"4556409","owner_display_name":"","owner_user_id":"4556409","post_type_id":"1","score":"0","tags":"ios|arrays|swift|watchconnectivity","view_count":"527"} +{"id":"856460","title":"Shrink image using javascript","body":"\u003cp\u003eI need to shrink the image that was kept in div background-image using javascript.for that image four's side having rounded corner.\u003c/p\u003e\n\n\u003cp\u003eIs it possible in javascript?\u003c/p\u003e\n\n\u003cp\u003eany suggestions ?\u003c/p\u003e","answer_count":"4","comment_count":"0","creation_date":"2009-05-13 06:57:57.203 UTC","last_activity_date":"2013-01-09 10:42:20.273 UTC","last_edit_date":"2013-01-09 10:42:20.273 UTC","last_editor_display_name":"","last_editor_user_id":"1471203","owner_display_name":"","owner_user_id":"68381","post_type_id":"1","score":"0","tags":"javascript|html|css|dhtml","view_count":"999"} +{"id":"4139765","title":"Is there a good and free software to backup a mysql database?","body":"\u003cp\u003eI'm looking for a software or script to make a daily backup (automatic) of a mysql database.\nAny suggestions?\u003c/p\u003e\n\n\u003cp\u003eRight now my solution is to use Mysql workbench with mysql dump, but I have to do it manually, so anything free and automatic would be appreciated.\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","accepted_answer_id":"4139792","answer_count":"1","comment_count":"2","creation_date":"2010-11-09 23:24:39.69 UTC","favorite_count":"1","last_activity_date":"2010-11-09 23:28:32.133 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"407097","post_type_id":"1","score":"0","tags":"mysql|mysqldump","view_count":"276"} +{"id":"23389980","title":"Passing an Id from one controller to another","body":"\u003cp\u003eHi I have this in my mvc 4 application. Once you add a festival to the system and I want to add an event to that festival by passing an id. Can anyone help me? here is my controller along with my view, viewmodel and model. I am getting an error : \u003c/p\u003e\n\n\u003cp\u003eThe parameters dictionary contains a null entry for parameter 'festID' of non-nullable type 'System.Int32' for method 'System.Web.Mvc.ActionResult Create2(MyFestival.Models.EventsVM, Int32)' in 'MyFestival.Controllers.EventsController'. An optional parameter must be a reference type, a nullable type, or be declared as an optional parameter. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e [HttpGet]\n public ActionResult Create2(int festID)\n {\n EventsVM events = new EventsVM { festivalID = festID };\n\n events.eType = db.EType.ToDictionary(p =\u0026gt; p.ID, q =\u0026gt; q.EType);\n events.eType.Add(-1, \"----- Add New Event Type -----\");\n\n events.eventsDate = DateTime.Now;\n events.startTime = DateTime.Now;\n events.endTime = DateTime.Now;\n\n return View(events);\n }\n\n [HttpPost]\n [ValidateAntiForgeryToken]\n public ActionResult Create2(EventsVM model, int festID)\n {\n if (ModelState.IsValid != true)\n {\n if (model.selectedEType != -1)\n {\n //db.save stuff from create.\n Events Newevent = new Events();\n Newevent.EndTime = model.endTime;\n Newevent.StartTime = model.startTime;\n Newevent.EventsDate = model.eventsDate = DateTime.Now;\n Newevent.EventsName = model.EventsName;\n Newevent.EType = db.EType.Where(p =\u0026gt; p.ID == model.selectedEType).Single();\n Newevent.Location = model.Location;\n if (Request.Files.Count != 0)\n {\n string fileName = Guid.NewGuid().ToString();\n string serverPath = Server.MapPath(\"~\\\\Content\\\\EventPicture\");\n Bitmap newImage = new Bitmap(Request.Files[0].InputStream);\n newImage.Save(serverPath + \"\\\\\" + fileName + \".jpg\", System.Drawing.Imaging.ImageFormat.Jpeg);\n model.eventsImage = \"Content/EventPicture/\" + fileName + \".jpg\";\n\n Newevent.FestivalID = model.festivalID = festID;\n\n db.Events.Add(Newevent);\n db.SaveChanges();\n //Change the model.festivalID to Newevent.FestivalID\n return RedirectToAction(\"Details\", \"Festival\", new { id = Newevent.FestivalID });\n }\n else\n {\n db.Events.Add(Newevent);\n db.SaveChanges();\n //Change the model.festivalID to Newevent.FestivalID\n return RedirectToAction(\"Details\", \"Festival\", new { id = Newevent.FestivalID });\n }\n }\n ModelState.AddModelError(\"\", \"No Event Type Picked\");\n }\n\n model.eType = db.EType.ToDictionary(p =\u0026gt; p.ID, q =\u0026gt; q.EType);\n model.eType.Add(-1, \"----- Add New Event Type -----\");\n model.eventsDate = DateTime.Now;\n model.startTime = DateTime.Now;\n model.endTime = DateTime.Now;\n\n return View(model);\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is my Model\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class Events\n{\n [Required]\n public int ID { get; set; }\n\n [Required]\n public int FestivalID { get; set; }\n\n [Required(ErrorMessage=\"Please input the Event Name.\")]\n [Display(Name = \"Event name\"), StringLength(100)]\n [DisplayFormat(ApplyFormatInEditMode = true)]\n public string EventsName { get; set; }\n\n [Display(Name = \"Event date\")/*, DataType(DataType.Date)*/]\n [DisplayFormat(DataFormatString = \"{0:dd-MMM-yyyy}\", ApplyFormatInEditMode = true)]\n [Required(ErrorMessage = \"Please input the Event's Date.\")]\n public DateTime EventsDate { get; set; }\n\n [Display(Name = \"Start Time\"), DataType(DataType.Time)]\n [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = \"{0:hh:mm tt}\")]\n [Required(ErrorMessage = \"Please input the Event's Start Time.\")]\n public DateTime StartTime { get; set; }\n\n [Display(Name = \"End Time\"), DataType(DataType.Time)]\n [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = \"{0:hh:mm tt}\")]\n [Required(ErrorMessage = \"Please input the Event's end time.\")]\n public DateTime EndTime { get; set; }\n\n [Required]\n [Display(Name = \"Location\")]\n [DisplayFormat(ApplyFormatInEditMode = true)]\n public string Location { get; set; }\n\n [Required]\n [Display(Name = \"Event Type\")]\n [DisplayFormat(ApplyFormatInEditMode = true)]\n public virtual EventType EType { get; set; }\n\n [Display(Name = \"Event Logo\")]\n [DataType(DataType.Upload)]\n [DisplayFormat(ApplyFormatInEditMode = true)]\n public string EventLogo { get; set; }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eViewModel\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class EventsVM\n{\n [Required]\n [Display(Name = \"Event Type\")]\n [DisplayFormat(ApplyFormatInEditMode = true)]\n public Dictionary\u0026lt;int, string\u0026gt; eType { get; set; }\n\n public int selectedEType { get; set; }\n\n [Required]\n public int ID { get; set; }\n\n [Required]\n public int festivalID { get; set; }\n\n [Required]\n [Display(Name = \"Event Name\"), StringLength(100)]\n [DisplayFormat(ApplyFormatInEditMode = true)]\n public string EventsName { get; set; }\n\n [Required]\n [Display(Name = \"Event Date\")/*, DataType(DataType.Date)*/]\n [DisplayFormat(DataFormatString = \"{0:dd-MM-yyyy}\", ApplyFormatInEditMode = true)]\n public DateTime eventsDate { get; set; }\n\n [Display(Name = \"Start Time\"), DataType(DataType.Time)]\n [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = \"{0:hh:mm tt}\")]\n [Required(ErrorMessage = \"Please input the Event's Start Time.\")]\n public DateTime startTime { get; set; }\n\n [Display(Name = \"End Time\"), DataType(DataType.Time)]\n [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = \"{0:hh:mm tt}\")]\n [Required(ErrorMessage = \"Please input the Event's end time.\")]\n public DateTime endTime { get; set; }\n\n [Required]\n [Display(Name = \"Location\")]\n [DisplayFormat(ApplyFormatInEditMode = true)]\n public string Location { get; set; }\n\n public HttpPostedFileWrapper imageFile { get; set; }\n [Display(Name=\"Event Image\")]\n public string eventsImage { get; set; }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd here is my View\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@model MyFestival.Models.EventsVM\n\n@{\n ViewBag.Title = \"Create Event\";\n Layout = \"~/Views/Shared/Festival.cshtml\";\n}\n\n\u0026lt;h2\u0026gt;Add an event for #@Model.festivalID\u0026lt;/h2\u0026gt;\n\n@using (Html.BeginForm())\n{\n@*@using (Html.BeginForm(\"Create2\", \"Events\", FormMethod.Post, new {enctype=\"multipart/form-data\"}))\n{*@\n@Html.AntiForgeryToken()\n\n\u0026lt;div class=\"form-horizontal\"\u0026gt;\n \u0026lt;hr /\u0026gt;\n @Html.ValidationSummary(true)\n\n \u0026lt;div class=\"form-group\"\u0026gt;\n @Html.LabelFor(model =\u0026gt; model.EventsName, new { @class = \"control-label col-md-2\" })\n \u0026lt;div class=\"col-md-10\"\u0026gt;\n \u0026lt;div class=\"input-group\"\u0026gt;\n \u0026lt;span class=\"input-group-addon\"\u0026gt;\u0026lt;i class=\"glyphicon glyphicon-pencil\"\u0026gt;\u0026lt;/i\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;input class=\"form-control\" id=\"EventsName\" required=\"required\" style=\"width: 210px\" name=\"EventsName\" placeholder=\"Please enter event name\" /\u0026gt;\n @*@Html.EditorFor(model =\u0026gt; model.EventsName, new { @class = \"form-control\", @style = \"width:250px\" })*@\n \u0026lt;/div\u0026gt;\n @Html.ValidationMessageFor(model =\u0026gt; model.EventsName, null, new { @style = \"color:red;\" })\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n\n \u0026lt;div class=\"form-group\"\u0026gt;\n @Html.LabelFor(model =\u0026gt; model.eventsDate, new { @class = \"control-label col-md-2\" })\n \u0026lt;div class=\"col-md-10\"\u0026gt;\n \u0026lt;div class=\"input-group\"\u0026gt;\n \u0026lt;span class=\"input-group-addon\"\u0026gt;\u0026lt;i class=\"glyphicon glyphicon-calendar\"\u0026gt;\u0026lt;/i\u0026gt;\u0026lt;/span\u0026gt;\n @Html.TextBoxFor(model =\u0026gt; model.eventsDate, new { @class = \"form-control datepicker\", @style = \"width:210px\" })\n \u0026lt;/div\u0026gt;\n @Html.ValidationMessageFor(model =\u0026gt; model.eventsDate, null, new { @style = \"color:red;\" })\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n\n \u0026lt;div class=\"form-group\"\u0026gt;\n @Html.LabelFor(model =\u0026gt; model.startTime, new { @class = \"control-label col-md-2\" })\n \u0026lt;div class=\"col-md-10\"\u0026gt;\n \u0026lt;div class=\"input-group\"\u0026gt;\n \u0026lt;span class=\"input-group-addon\"\u0026gt;\u0026lt;i class=\"glyphicon glyphicon-time\"\u0026gt;\u0026lt;/i\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;input id=\"startTime\" name=\"startTime\" required=\"required\" class=\"form-control bootstrap-timepicker\" style=\"width: 210px\" /\u0026gt;\n @*@Html.EditorFor(model =\u0026gt; model.startTime, new { @class = \"form-control\", @style = \"width:250px\" })*@\n \u0026lt;/div\u0026gt;\n @*@Html.EditorFor(model =\u0026gt; model.startTime, new { @class = \"form-control\" })*@\n @Html.ValidationMessageFor(model =\u0026gt; model.startTime, null, new { @style = \"color:red;\" })\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n\n \u0026lt;div class=\"form-group\"\u0026gt;\n @Html.LabelFor(model =\u0026gt; model.endTime, new { @class = \"control-label col-md-2\" })\n \u0026lt;div class=\"col-md-10\"\u0026gt;\n \u0026lt;div class='input-group date' id='datetimepicker4'\u0026gt;\n \u0026lt;span class=\"input-group-addon\"\u0026gt;\u0026lt;i class=\"glyphicon glyphicon-time\"\u0026gt;\u0026lt;/i\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;input name=\"endTime\" id=\"endTime\" type='text' class=\"form-control bootstrap-timepicker\" style=\"width: 210px\" /\u0026gt;\n @*@Html.TextBoxFor(model =\u0026gt; model.startDate, new { @class = \"form-control datepicker\", @style = \"width:210px\" })*@\n \u0026lt;/div\u0026gt;\n @Html.ValidationMessageFor(model =\u0026gt; model.endTime, null, new { @style = \"color:red;\" })\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n\n \u0026lt;div class=\"form-group\"\u0026gt;\n @Html.LabelFor(model =\u0026gt; model.eType, new { @class = \"control-label col-md-2\" })\n \u0026lt;div class=\"col-md-10\"\u0026gt;\n \u0026lt;div class=\"input-group\"\u0026gt;\n \u0026lt;span class=\"input-group-addon\"\u0026gt;\u0026lt;i class=\"glyphicon glyphicon-tag\"\u0026gt;\u0026lt;/i\u0026gt;\u0026lt;/span\u0026gt;\n @Html.DropDownListFor(p =\u0026gt; p.selectedEType, Model.eType.Select(p =\u0026gt; new SelectListItem() { Text = p.Value.ToString(), Value = p.Key.ToString(), Selected = false }), new { @class = \"form-control\", @style = \"width:210px\", @onchange = \"checkaddnew();\" })\n \u0026lt;/div\u0026gt;\n @Html.ValidationMessageFor(model =\u0026gt; model.eType, null, new { @style = \"color:red;\" })\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n\n \u0026lt;div class=\"form-group\"\u0026gt;\n @Html.LabelFor(model =\u0026gt; model.Location, new { @class = \"control-label col-md-2\" })\n \u0026lt;div class=\"col-md-10\"\u0026gt;\n @Html.TextAreaFor(model =\u0026gt; model.Location, new { @style = \"width:300px;\", @class = \"form-control\", @rows = \"3\" })\n @Html.ValidationMessageFor(model =\u0026gt; model.Location, null, new { @style = \"color:red;\" })\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n\n \u0026lt;div class=\"form-group\"\u0026gt;\n @Html.LabelFor(model =\u0026gt; model.eventsImage, new { @class = \"control-label col-md-2\" })\n \u0026lt;div class=\"col-md-10\"\u0026gt;\n \u0026lt;input name=\"imageFile\" id=\"File\" type=\"file\" /\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n\n \u0026lt;div class=\"form-group\"\u0026gt;\n \u0026lt;div class=\"col-md-offset-2 col-md-10\"\u0026gt;\n \u0026lt;input type=\"submit\" value=\"Create\" class=\"btn btn-info\" /\u0026gt;\n\n @Html.ActionLink(\"Back to List\", \"Index\", \"Festival\", null, new { @class = \"btn btn-danger\" })\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n}\n\n@Html.Partial(\"CreateEventType\", new MyFestival.Models.EventTypeVM())\n\n\n@section Scripts {\n@Scripts.Render(\"~/bundles/jqueryval\")\n\n\u0026lt;script\u0026gt;\n $(document).ready(function () {\n $('#selectedEType').change(function () {\n if ($(this).find(\":selected\").val() == -1) {\n $('#myModal').modal('show');\n }\n });\n });\n\u0026lt;/script\u0026gt;\n\n\u0026lt;script type=\"text/javascript\"\u0026gt;\n function ajaxResponse(data) {\n alert(\"This Worked and the Data ID is: \" + data.EventTypeID);\n var newOption = \"\u0026lt;option value='\" + data.EventTypeID + \"'\u0026gt;\" + data.Name + \"\u0026lt;/option\u0026gt;\";\n $('#selectedEType').append(newOption);\n $('#myModal').modal('hide');\n\n $(\"#selectedEType option[value='\" + data.EventTypeID + \"']\").attr(\"selected\", \"selected\");\n };\n\u0026lt;/script\u0026gt;\n\n\u0026lt;script type=\"text/javascript\"\u0026gt;\n $(document).ready(function () {\n $(\"#eventsDate\").datepicker('setDate', '+1',{dateFormat: \"dd/mm/yy\"}).on('changeDate', function (ev) {\n $(this).blur();\n $(this).datepicker('hide');\n });\n });\n\u0026lt;/script\u0026gt;\n\n\u0026lt;script type=\"text/javascript\"\u0026gt;\n $('#startTime').timepicker({\n minuteStep: 5,\n showInputs: false,\n disableFocus: true\n });\n\u0026lt;/script\u0026gt;\n\n \u0026lt;script type=\"text/javascript\"\u0026gt;\n $('#endTime').timepicker({\n minuteStep: 5,\n showInputs: false,\n disableFocus: true\n });\n\u0026lt;/script\u0026gt;\n\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"23390211","answer_count":"1","comment_count":"2","creation_date":"2014-04-30 13:50:12.127 UTC","last_activity_date":"2014-04-30 14:00:12.283 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3564900","post_type_id":"1","score":"0","tags":"c#|asp.net-mvc-4","view_count":"619"} +{"id":"1208315","title":"Fluent nHibernate with BindingList\u003cT\u003e","body":"\u003cp\u003enHibernate is giving the error : Custom type does not implement UserCollectionType: myApp.Domain.OrderLineCollection. \u003c/p\u003e\n\n\u003cp\u003eBindingList implements IList, so why is nHibernate trying to use UserCollectionType instead of IList?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class OrderHeader\n{\n public virtual int OrderHeaderId { get; set; }\n public virtual string OrderNumber { get; set; }\n public virtual OrderLineCollection Line { get; set; }\n}\n\npublic class OrderLineCollection : BindingList\u0026lt;OrderHeader\u0026gt; { }\n\npublic class OrderHeaderMap : ClassMap\u0026lt;OrderHeader\u0026gt;\n{\n public OrderHeaderMap()\n {\n WithTable(\"Orders\");\n Id(x =\u0026gt; x.OrderHeaderId, \"OrderId\").GeneratedBy.Identity();\n Map(x =\u0026gt; x.OrderNumber);\n HasMany(x =\u0026gt; x.Line).WithKeyColumn(\"OrderHeaderId\").AsList();\n }\n}\n\n\u0026lt;list name=\"Line\"\u0026gt;\n \u0026lt;key column=\"OrderHeaderId\" /\u0026gt; \n \u0026lt;index /\u0026gt; \n \u0026lt;one-to-many class=\"myApp.Domain.OrderLine, myApp.Domain, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null\" /\u0026gt; \n\u0026lt;/list\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"1208364","answer_count":"3","comment_count":"0","creation_date":"2009-07-30 18:08:02.717 UTC","last_activity_date":"2011-07-22 18:24:23.907 UTC","last_edit_date":"2009-07-31 13:31:32.33 UTC","last_editor_display_name":"","last_editor_user_id":"95814","owner_display_name":"","owner_user_id":"95814","post_type_id":"1","score":"1","tags":"nhibernate|fluent-nhibernate","view_count":"1543"} +{"id":"14328756","title":"Save chosen option in drop down menu after reload","body":"\u003cp\u003eI'm using this drop down menu:\u003c/p\u003e\n\n\u003cp\u003eHTML:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;ul id=\"dropdown\"\u0026gt;\n \u0026lt;li\u0026gt; Choose theme\n \u0026lt;ul\u0026gt; \n \u0026lt;li id=\"stylesheet1\" \u0026gt; \u0026lt;a href=\"#\"\u0026gt; Default \u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li id=\"stylesheet2\" \u0026gt; \u0026lt;a href=\"#\"\u0026gt; Theme 1 \u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li id=\"stylesheet3\" \u0026gt; \u0026lt;a href=\"#\"\u0026gt; Theme 2 \u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li id=\"stylesheet4\" \u0026gt; \u0026lt;a href=\"#\"\u0026gt; Theme 3 \u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n\n \u0026lt;/ul\u0026gt;\n\u0026lt;/li\u0026gt;\n\u0026lt;/ul\u0026gt; \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd this is the CSS:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#dropdown {\n float: left;\n margin: 0;\n padding: 0;\n }\n#dropdown li {\n background: #F7F0E0;\n border:1px solid #666;\n float: left;\n list-style: none;\n margin: 0;\n padding:0 0 0 10px;\n position: relative;\n height:20px;\n width:100px;\n}\n#dropdown li:hover {\n background: #FF2828;\n}\n#dropdown li a {\n text-decoration:none;\n}\n#dropdown ul {\n background: #F7F0E0;\n display: none;\n margin: 0;\n padding: 0;\n position: absolute;\n top: 20px;\n left: -1px;\n z-index: 500;\n}\n #dropdown ul {\n position: absolute;\n }\n #dropdown li:hover ul {\n display: block;\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs it possible that the option chosen is kept for the next time the page reloads? Or should I make another drop down, for example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;form\u0026gt;\n\u0026lt;select id=\"myList\" \u0026gt;\n \u0026lt;option id=\"stylesheet1\"\u0026gt;Default\u0026lt;/option\u0026gt;\n \u0026lt;option id=\"stylesheet2\"\u0026gt;Theme 1\u0026lt;/option\u0026gt;\n \u0026lt;option id=\"stylesheet3\"\u0026gt;Theme 2\u0026lt;/option\u0026gt; \n \u0026lt;option\u0026gt;Theme 3\u0026lt;/option\u0026gt;\n\u0026lt;/select\u0026gt;\n\n\u0026lt;form\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am using javascript and cookies on my page, should I use this to be able to this as well?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-01-14 23:32:53.72 UTC","last_activity_date":"2013-01-14 23:48:11.457 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1851972","post_type_id":"1","score":"0","tags":"html","view_count":"161"} +{"id":"33243181","title":"Cimg border reading","body":"\u003cpre\u003e\u003ccode\u003e#include \"CImg.h\"\n#include \u0026lt;iostream\u0026gt;\n#include \u0026lt;string\u0026gt;\n#include \u0026lt;sstream\u0026gt;\n#include\u0026lt;math.h\u0026gt;\n\nusing namespace std;\nusing namespace cimg_library;\n\nclass Imagen{\npublic:\n\nCImg\u0026lt;int\u0026gt; contorno(char[60]);\nCImg\u0026lt;int\u0026gt; binarizar(char[60],int);\nCImg\u0026lt;int\u0026gt; grises(char[60]);};\n\nCImg\u0026lt;int\u0026gt; Imagen::binarizar(char nombreImagen[60],int factorB){\nCImg\u0026lt;int\u0026gt; imagen(nombreImagen);\nunsigned char r,g,b,promedio;\nCImg\u0026lt;int\u0026gt; imagenB(imagen.width(),imagen.height(),1,1);\nfor(int x=0;x\u0026lt;imagenB.width();x++){\n for(int y=0;y\u0026lt;imagenB.height();y++){\n r=imagen(x,y,0,0);\n g=imagen(x,y,0,1);\n b=imagen(x,y,0,2);\n promedio=((r+g+b)/3);\n\n if( promedio\u0026gt;=factorB)\n imagenB(x,y,0,0)=255;\n\n if( promedio\u0026lt;=factorB)\n imagenB(x,y,0,0)=0;\n\n }}\n\nreturn imagenB;}\n\nCImg\u0026lt;int\u0026gt; Imagen::grises(char nombreImagen[60]){\nCImg\u0026lt;int\u0026gt; imagen(nombreImagen);\nCImg\u0026lt;int\u0026gt; imagenG(imagen.width(),imagen.height(),1);\ncimg_forXYC(imagen,x,y,c) {\n imagenG(x,y,0)= (imagen(x,y,0)+imagen(x,y,1)+imagen(x,y,2))/3;\n}\nreturn imagenG;}\n\nCImg\u0026lt;int\u0026gt; Imagen::Contorno(char nombreImagen[60]){\nCImg\u0026lt;int\u0026gt;imagen(nombreImagen);\nCImg\u0026lt;int\u0026gt;imagenCont(imagen.width(),imagen.height(),1);\n CImg\u0026lt;int\u0026gt;imagenGris2(imagen.width(),imagen.height(),1);\nint a,b,c,d;\nfor(int x=0;x\u0026lt;imagen.width();x++){\n for(int y=0;y\u0026lt;imagen.height();y++){\n imagenGris2=(imagen(x,y,0)+imagen(x,y,1)+imagen(x,y,2))/3;\n a = imagenGris2(x,y,0);\n b = -imagenGris2(x+1,y+1,0);\n c = imagenGris2(x+1,y,0);\n d = -imagenGris2(x,y+1,0);\n imagenCont(x,y,0) = (sqrt(pow((a+b),2)+pow((c+d),2)));\n\n\n }\n}\nreturn imagenCont; }\n\nint main () {\n\nImagen img;\nchar nomImg [60];\nint opcion, factorBinarizar;\ncout\u0026lt;\u0026lt;\"ñññ.\"\u0026lt;\u0026lt;endl\u0026lt;\u0026lt;endl;\ncout\u0026lt;\u0026lt;\"Manipulacion de Imagenes Basica.\"\u0026lt;\u0026lt;endl\u0026lt;\u0026lt;endl;\ncout\u0026lt;\u0026lt;\"Ingrese el nombre de la imagen: \"\u0026lt;\u0026lt;endl;\ncin\u0026gt;\u0026gt;nomImg;\n\ndo{\n CImg\u0026lt;int\u0026gt; nvaImagenGris, nvaImagenBin, nvaImagenCont;\n cout\u0026lt;\u0026lt;\"Seleccione una opcion:\"\u0026lt;\u0026lt;endl\u0026lt;\u0026lt;endl\u0026lt;\u0026lt;\"[1].visualizar escala de grises.\\n[2].Visualizar la imagen binarizada.\\n[3].Visualizar contornos de la imagen.\\n[4].Guardar las imagenes y salir.\\n\";\n cin\u0026gt;\u0026gt;opcion;\n\n switch(opcion){\n case 1:nvaImagenGris=img.grises(nomImg);break;\n case 2:\n cout\u0026lt;\u0026lt;\"Ingrese el numero factor de binarizacion:\"\u0026lt;\u0026lt;endl;\n cin\u0026gt;\u0026gt;factorBinarizar;\n nvaImagenBin=img.binarizar(nomImg,factorBinarizar);\n break;\n case 3:\n nvaImagenCont=img.Contorno(nomImg);\n break;\n case 4:\n nvaImagenGris.save(\"ImModGris.bmp\");\n nvaImagenBin.save(\"ImModBin.bmp\");\n nvaImagenCont.save(\"ImModCont.bmp\");\n break;\n default:\n cout\u0026lt;\u0026lt;\"opcion incorrecta\"\u0026lt;\u0026lt;endl;\n break;\n }\n if(opcion==1){\n CImgDisplay ventana(nvaImagenGris, \"Imagen grises\",1 );\n ventana.wait(3000);}\n else if (opcion==2){\n CImgDisplay ventaNa(nvaImagenBin, \"Imaen Binarizada\",1 );\n ventaNa.wait(3000);}\n else if (opcion==3){\n CImgDisplay ventanA(nvaImagenCont,\"Contorno de la Imagen\",1);\n ventanA.wait(3000);}\n\n}while(opcion != 4);\nreturn 0;}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have problems with the \"contorno\" method, it is suposed to show only de borders of a .bmp image, but instead it shows me a black window, I am new using CImg so I don't know why this is happening, any idea and/or solution for this?\u003c/p\u003e\n\n\u003cp\u003eI'm using \u003ccode\u003ecode::blocks\u003c/code\u003e on a windows 10 OS.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-10-20 17:34:58.543 UTC","last_activity_date":"2015-11-30 18:11:09.993 UTC","last_edit_date":"2015-11-14 09:27:11.54 UTC","last_editor_display_name":"","last_editor_user_id":"5239503","owner_display_name":"","owner_user_id":"5421277","post_type_id":"1","score":"0","tags":"c++|image|cimg","view_count":"160"} +{"id":"2964288","title":"What programming language/compiler/libraries should I use to create an app that runs on Windows XP without any additional software?","body":"\u003cp\u003eI need to create a basic app to check the availability of components and if necessary download them to any computer running Windows XP or above. Which language (preferably free or VS 2010) should I use to create such an application which can run without requiring any frameworks installed beforehand?\u003c/p\u003e","accepted_answer_id":"2964509","answer_count":"3","comment_count":"3","creation_date":"2010-06-03 08:21:18.613 UTC","last_activity_date":"2010-06-04 00:26:52.72 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"228534","post_type_id":"1","score":"2","tags":"windows","view_count":"343"} +{"id":"1213516","title":"Collapse panel javascript issues","body":"\u003cp\u003eI have a collapsible panel extender. I have no issues with the extender. however, I have a link that opens the panel and I want another link saying collapse to close it. I want to hide one show one javascript side. The issue is that it only works for the first row but not the others because I am not getting the unique ID or something. I haven't found a legitimate answer yet. I've tried jquery by getting parent elements and I was unsuccessful. What can I do?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eAnswer:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;asp:TemplateField HeaderText=\"Lng Descr\" SortExpression=\"LongDescription\"\u0026gt;\n \u0026lt;EditItemTemplate\u0026gt;\n \u0026lt;asp:TextBox ID=\"TextBox3\" runat=\"server\" Text='\u0026lt;%# Bind(\"LongDescription\") %\u0026gt;' TextMode =\"MultiLine\" Rows=\"5\" \u0026gt;\u0026lt;/asp:TextBox\u0026gt;\n \u0026lt;/EditItemTemplate\u0026gt;\n \u0026lt;ItemTemplate\u0026gt; \n \u0026lt;table\u0026gt; \n \u0026lt;tr id=\"expand\" style=\"display:\"\u0026gt; \n \u0026lt;td\u0026gt; \n \u0026lt;asp:Label ID=\"Label3\" runat=\"server\" ForeColor=\"Blue\"\u0026gt;\u0026lt;u\u0026gt;\u0026lt;/u\u0026gt;\u0026lt;/asp:Label\u0026gt;\n \u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;/table\u0026gt;\n \u0026lt;asp:Panel ID=\"Panel1\" runat=\"server\" \u0026gt;\n \u0026lt;table\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;\n \u0026lt;%#Eval(\"LongDescription\")%\u0026gt;\n \u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;/table\u0026gt;\n \u0026lt;/asp:Panel\u0026gt;\n \u0026lt;ajaxToolkit:CollapsiblePanelExtender ID=\"cpe\" runat=\"Server\" \n TargetControlID = \"Panel1\"\n CollapsedSize=\"0\"\n ExpandedSize=\"50\"\n Collapsed=\"true\" \n ExpandControlID=\"Label3\"\n CollapseControlID=\"Label3\"\n AutoCollapse=\"false\" \n Scrollcontents=\"false\" \n collapsedText=\"\u0026lt;u\u0026gt;Expand\"\n ExpandDirection=\"Vertical\"\n ExpandedText = \"\u0026lt;u\u0026gt;Collapse\"\n TextLabelID=\"Label3\" /\u0026gt;\n \u0026lt;/ItemTemplate\u0026gt;\n \u0026lt;/asp:TemplateField\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"1","creation_date":"2009-07-31 16:20:36.5 UTC","last_activity_date":"2009-07-31 23:10:19.543 UTC","last_edit_date":"2009-07-31 20:04:46.377 UTC","last_editor_display_name":"","last_editor_user_id":"103617","owner_display_name":"","owner_user_id":"103617","post_type_id":"1","score":"0","tags":"c#|asp.net|javascript|visual-studio|collapsiblepanelextender","view_count":"2311"} +{"id":"31962522","title":"Reproducible CFQUERYPARAM performance issue in Coldfusion 10","body":"\u003cp\u003eI've consistently been able to reproduce a serious parameterization performance issue with Coldfusion 10 querying SQL Server 2008 R2 and would be interested to know what others get. The code is below.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eWhat does the test do?\u003c/strong\u003e\nIt creates a table with 100 rows. A data column is blank in all but one. It then runs a Coldfusion query 10 times, half using cfqueryparam and half using a simple string. It returns a list with the response time for each. When I run this, apart from the initial calls, the parameterized query runs much more slowly (by about 10-100 times).\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eWhat's happening in SQL Server?\u003c/strong\u003e\nI can see no difference in SQL server. In both cases the plan cache indicates virtually identical plans (one is obviously parameterized) and the profiler shows fast responses for both. However, Coldfusion struggles with the parameterized query.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eWhat fixes the issue?\u003c/strong\u003e\nCuriously, if I change the varchar to an nvarchar, the problem goes away. Or if I move the non-blank to the start, then both responses are slow (go figure). If I make all records blank or non-blank then again the issue isn't there. It must be a mix. I can't reproduce the issue in CF9 but haven't tried CF11.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;cfset datasource=\"yourdatasource\" /\u0026gt;\n\u0026lt;cfquery name=\"createdata\" datasource=\"#datasource#\"\u0026gt;\n --EMPTY PREVIOUS TESTS\n IF OBJECT_ID('aaatest', 'U') IS NOT NULL\n BEGIN\n TRUNCATE TABLE aaatest;\n DROP TABLE aaatest;\n END\n\n --CREATE TABLE TO CONTAIN DATA\n CREATE TABLE [dbo].[aaatest](\n [id] [int] NOT NULL,\n [somedata] [varchar](max) NULL,\n [somekey] [int] NOT NULL\n ) ON [PRIMARY];\n\n --INSERT 100 ROWS WITH 99 BLANK AND 1 NON-BLANK\n WITH datatable AS (\n SELECT 1 id\n UNION all\n SELECT id + 1\n FROM datatable \n WHERE id + 1 \u0026lt;= 100\n )\n INSERT INTO aaatest(id,somekey,somedata)\n SELECT id,1,case when id=99 then 'A' else '' end\n FROM datatable;\n\u0026lt;/cfquery\u0026gt;\n\n\u0026lt;cfset results=[] /\u0026gt;\n\u0026lt;cfloop from=\"1\" to=\"10\" index=\"n\"\u0026gt;\n \u0026lt;!--- use parameters for every other test ---\u0026gt;\n \u0026lt;cfset useParameters = (n mod 2 is 0) /\u0026gt;\n \u0026lt;cfquery name=\"myquery\" datasource=\"#datasource#\" result=\"result\"\u0026gt;\n SELECT somedata \n FROM aaatest\n WHERE somekey=\n \u0026lt;cfif useParameters\u0026gt;\n \u0026lt;cfqueryparam value=\"1\" CFSQLType=\"CF_SQL_INTEGER\" /\u0026gt;\n \u0026lt;cfelse\u0026gt;\n 1\n \u0026lt;/cfif\u0026gt;\n \u0026lt;/cfquery\u0026gt;\n \u0026lt;!--- store results with parameter test marked with a P ---\u0026gt;\n \u0026lt;cfset arrayAppend(results,(useParameters?'P':'')\u0026amp;result.executiontime) /\u0026gt;\n\u0026lt;/cfloop\u0026gt;\n\n\u0026lt;cfdump var=\"#results#\" /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"35581220","answer_count":"1","comment_count":"18","creation_date":"2015-08-12 10:25:08.87 UTC","last_activity_date":"2016-03-24 12:01:19.62 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"164924","post_type_id":"1","score":"7","tags":"sql-server|coldfusion|sql-server-2008-r2|coldfusion-10","view_count":"405"} +{"id":"41595373","title":"Piping results with dplyr to fitdist package","body":"\u003cp\u003eI'm trying to group a set of data by \"Area\" and then get R to do a fitdist analysis on each of the Area groups. For some reason I can not do the piping correctly to pass the variable \"cpl\" to the fitdist function. Am I doing something obviously wrong? I've attempted many permutations but no luck so far. The variable cpl does exist.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026gt; str(ccpldw2)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e'data.frame': 149 obs. of 2 variables:\n $ Area: Factor w/ 4 levels \"2\",\"4\",\"5\",\"7\": 1 1 1 1 1 1 1 1 1 1 ...\n $ cpl : num 0.0007 0.0007 0.0007 0.0007 0.0009 0.0019 0.0022 0.003 0.003 0.0031 ...\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eresults \u0026lt;- group_by(ccpldw2, Area) %\u003e% fitdist(cpl, \"lnorm\")\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eError in fitdist(., cpl, \"lnorm\") : object 'cpl' not found\u003c/p\u003e\n\n\u003cp\u003eApologies, here is a MWE,\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003erm(list=ls())\n\nlibrary(fitdistrplus)\nlibrary(dplyr)\n\ninputdata \u0026lt;- data.frame(Area = as.factor (rep(c(2,3,7),10)),\n cpl = rlnorm(30, -5.07, 1.04))\n\nresults \u0026lt;- group_by(inputdata, Area) %\u0026gt;% fitdist(cpl, \"lnorm\")\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhich gives me this error.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eError in fitdist(., cpl, \"lnorm\") : object 'cpl' not found\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"1","creation_date":"2017-01-11 16:01:23.21 UTC","last_activity_date":"2017-01-12 13:51:39.173 UTC","last_edit_date":"2017-01-12 13:51:39.173 UTC","last_editor_display_name":"","last_editor_user_id":"3182102","owner_display_name":"","owner_user_id":"3182102","post_type_id":"1","score":"0","tags":"r|dplyr|piping|fitdistrplus","view_count":"69"} +{"id":"20933712","title":"How to know if a user clicked play on a video","body":"\u003cp\u003eI do not even know where to start with this but what I want to do is I want to be able to know if someone has clicked play on a video on my site. The code for the video embed is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"gv-placement-sap\" id=\"gv_target_7196907613889253931538584\"\u0026gt;\n\u0026lt;/div\u0026gt;\n\n\u0026lt;script\u0026gt;!function(a,b,c){var d=a.getElementsByTagName(b)[0];a.getElementById(c)||(a=a.createElement(b),a.id=c,a.src=(\"https:\"==document.location.protocol?\"http://player-services.goviral-content.com\".replace(/^http\\:/,\"https:\"):\"http://player-services.goviral-content.com\")+\"/embed-code/index/find?placementVersionId=7196907613889253931538584\",d.parentNode.insertBefore(a,d))}(document,\"script\",\"gv_script_7196907613889253931538584\");\u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny help is appreciated..thanks\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2014-01-05 12:44:17.993 UTC","last_activity_date":"2014-01-05 13:37:27.107 UTC","last_edit_date":"2014-01-05 12:45:48.017 UTC","last_editor_display_name":"","last_editor_user_id":"1433392","owner_display_name":"","owner_user_id":"2950959","post_type_id":"1","score":"0","tags":"javascript|jquery|html|video|video-embedding","view_count":"196"} +{"id":"10041697","title":"Error redirection in WebView","body":"\u003cp\u003eI'm developing a browser-like application in android using WebView.\nWhile loading the URL, I want to display a specific page/message/toast whenever server returns 404 response. I tried using \u003ccode\u003eshouldOverrideUrlLoading\u003c/code\u003e, but it can filter URLs based on URL string only. Is there any good way to get the server's response code within \u003ccode\u003eWebViewClient\u003c/code\u003e or \u003ccode\u003eWebChromeClient\u003c/code\u003e (without loading the URL twice)?\u003c/p\u003e","accepted_answer_id":"11322153","answer_count":"1","comment_count":"5","creation_date":"2012-04-06 09:38:26.053 UTC","last_activity_date":"2012-08-09 02:19:48.883 UTC","last_edit_date":"2012-04-06 10:03:41.287 UTC","last_editor_display_name":"","last_editor_user_id":"925202","owner_display_name":"","owner_user_id":"925202","post_type_id":"1","score":"0","tags":"android|webview","view_count":"778"} +{"id":"18102924","title":"How to remove heroku ssh keys that don't have a name","body":"\u003cp\u003eThe heroku docs mention how to remove ssh keys that have a name associated with them using \u003cem\u003eheroku keys:remove\u003c/em\u003e:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://devcenter.heroku.com/articles/keys\"\u003ehttps://devcenter.heroku.com/articles/keys\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eBut I have managed to upload some keys that don't have a name and now can't find a way to delete them. The \u003cem\u003eheroku keys:remove\u003c/em\u003e command expects a name to be specified.\u003c/p\u003e\n\n\u003cp\u003eIs there some other way to clear ssh keys associated with an account?\u003c/p\u003e","accepted_answer_id":"18109299","answer_count":"1","comment_count":"0","creation_date":"2013-08-07 12:05:14.893 UTC","favorite_count":"1","last_activity_date":"2013-08-07 16:56:30.19 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2660582","post_type_id":"1","score":"8","tags":"heroku|ssh-keys","view_count":"2378"} +{"id":"35686138","title":"How to install this github ruby(gem) project on my ubuntu system?","body":"\u003cp\u003eI am new to Ruby and this project is a ruby gem.\nLink to the project \u003ca href=\"https://github.com/cheerfulstoic/music\" rel=\"nofollow\"\u003ehttps://github.com/cheerfulstoic/music\u003c/a\u003e.\nI can't find any steps to setup this project.\u003c/p\u003e","accepted_answer_id":"35686344","answer_count":"1","comment_count":"1","creation_date":"2016-02-28 17:57:02.683 UTC","last_activity_date":"2016-02-28 18:14:11.18 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5056289","post_type_id":"1","score":"0","tags":"ruby|github|repository","view_count":"14"} +{"id":"6826260","title":"How does += (plus equal) work?","body":"\u003cp\u003eI'm a bit confused with the += sign. How does it work?\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003e\u003cp\u003e\u003ccode\u003e1 += 2\u003c/code\u003e // equals ?\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eand this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar data = [1,2,3,4,5];\nvar sum = 0;\ndata.forEach(function(value) {\n sum += value; \n});\nsum = ?\n\u003c/code\u003e\u003c/pre\u003e\u003c/li\u003e\n\u003c/ol\u003e","answer_count":"12","comment_count":"5","creation_date":"2011-07-26 06:43:49.26 UTC","favorite_count":"7","last_activity_date":"2017-10-27 12:14:05.813 UTC","last_edit_date":"2014-03-05 06:12:16.733 UTC","last_editor_display_name":"","last_editor_user_id":"792066","owner_display_name":"","owner_user_id":"747871","post_type_id":"1","score":"29","tags":"javascript","view_count":"44497"} +{"id":"32383768","title":"Require TextBox depending on RadioButtonList selection in Repeater","body":"\u003cp\u003eI have a repeater with a RadioButtonList and TextBox inside. I want the TextBox to be required only if the RadioButtonList has a value of 1 or 2. How can I achieve this? \u003c/p\u003e\n\n\u003cp\u003eI thought I could initially enable the RFV on a selected index change but it can't see the items since it is within a repeater. Do I need to do this within the ItemDataBound?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;asp:Repeater ID=\"repeaterSurvey\" runat=\"server\"\u0026gt;\n \u0026lt;ItemTemplate\u0026gt;\n \u0026lt;div class=\"form-group\"\u0026gt;\n \u0026lt;asp:Label ID=\"labelQuestion\" runat=\"server\" Text='\u0026lt;%# Eval(\"Question\")%\u0026gt;' /\u0026gt;\n \u0026lt;asp:RequiredFieldValidator ID=\"RFV1\" CssClass=\"required\" runat=\"server\" \n ErrorMessage=\"Required\" Display=\"Dynamic\" ControlToValidate=\"surveyList\" /\u0026gt;\n\n \u0026lt;asp:RadioButtonList RepeatDirection=\"Horizontal\" ID=\"surveyList\" AutoPostBack=\"true\"\n OnSelectedIndexChanged=\"surveyList_SelectedIndexChanged\" runat=\"server\"\u0026gt;\n \u0026lt;asp:ListItem Value=\"1\"\u0026gt;Strongly Disagree\u0026lt;/asp:ListItem\u0026gt;\n \u0026lt;asp:ListItem Value=\"2\"\u0026gt;Disagree\u0026lt;/asp:ListItem\u0026gt;\n \u0026lt;asp:ListItem Value=\"3\"\u0026gt;Agree\u0026lt;/asp:ListItem\u0026gt;\n \u0026lt;asp:ListItem Value=\"4\"\u0026gt;Strongly Agree\u0026lt;/asp:ListItem\u0026gt;\n \u0026lt;asp:ListItem Value=\"0\"\u0026gt;N/A\u0026lt;/asp:ListItem\u0026gt;\n \u0026lt;/asp:RadioButtonList\u0026gt;\n \u0026lt;asp:HiddenField ID=\"hiddenfieldID\" Value='\u0026lt;%# Eval(\"ID\")%\u0026gt;' runat=\"server\" /\u0026gt;\n \u0026lt;asp:TextBox ID=\"textboxComment\" Placeholder=\"Comments\" CssClass=\"form-control\" TextMode=\"MultiLine\"\n Rows=\"3\" runat=\"server\"\u0026gt;\u0026lt;/asp:TextBox\u0026gt;\n \u0026lt;asp:RequiredFieldValidator ID=\"RFV2\" Enabled=\"false\" CssClass=\"required\" runat=\"server\"\n ErrorMessage=\"Comment Required\" Display=\"Dynamic\" ControlToValidate=\"textboxComment\" /\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/ItemTemplate\u0026gt;\n\u0026lt;/asp:Repeater\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCodebehind\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprotected void surveyList_SelectedIndexChanged(object sender, System.EventArgs e)\n{\n if (surveyList.SelectedValue == \"1\" || surveyList.SelectedValue == \"2\")\n {\n RFV2.Enabled = true;\n }\n else\n {\n RFV2.Enabled = false;\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"5","creation_date":"2015-09-03 19:17:36.97 UTC","last_activity_date":"2015-09-03 21:36:07.347 UTC","last_edit_date":"2015-09-03 19:55:23.037 UTC","last_editor_display_name":"","last_editor_user_id":"1148077","owner_display_name":"","owner_user_id":"1148077","post_type_id":"1","score":"0","tags":"c#|asp.net|repeater|requiredfieldvalidator","view_count":"66"} +{"id":"23950577","title":"how to create custom grid view programatically in android?","body":"\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/8oeHp.jpg\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eI want to create custom grid view where grid view first image will be parent match only width and else image view \u003ccode\u003e100 x 100\u003c/code\u003e. Grid view depend on arraylist values\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2014-05-30 08:53:22.613 UTC","favorite_count":"1","last_activity_date":"2014-05-30 09:05:04.957 UTC","last_edit_date":"2014-05-30 09:05:04.957 UTC","last_editor_display_name":"","last_editor_user_id":"2354564","owner_display_name":"","owner_user_id":"2248045","post_type_id":"1","score":"2","tags":"android-layout|gridview|android-listview","view_count":"69"} +{"id":"42419771","title":"Session variables are not persisting between page loads","body":"\u003cp\u003eI try to create a session to be available for PHP pages.\u003c/p\u003e\n\n\u003cp\u003eBut it is not working.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eTest1.php\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esession_start();\n$_SESSION[\"current_id\"] = 7 ;\n\necho \"Current id : \" . $_SESSION['current_id'] . \"\u0026lt;/br\u0026gt;\" ;\nif (!is_writable(session_save_path())) {\n echo 'Session path \"' . session_save_path() . '\" is not writable for PHP!'; }\nelse {\n echo 'Session path \"' . session_save_path() . '\" is Writable for PHP!'; } \necho(\"\u0026lt;/br\u0026gt;\"); \nvar_dump($_SESSION);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eResult\u003c/strong\u003e:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eCurrent id : 7\u003cbr\u003e\n Session path \"/var/lib/php5\" is Writable for PHP!\n /home/ubuntu/workspace/CRF/main1.php:58: array(1) { 'current_id' =\u003e string(1) \"7\" }\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003e\u003cstrong\u003eTets2.php\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esession_start();\necho \"Current id : \" . $_SESSION['current_id'] . \"\u0026lt;/br\u0026gt;\" ;\necho(\"\u0026lt;/br\u0026gt;\"); \nvar_dump($_SESSION);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eResult\u003c/strong\u003e:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eCurrent id : /home/ubuntu/workspace/CRF/workflow.php:108: array(0) { }\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eAny Ideas?\u003c/p\u003e","answer_count":"0","comment_count":"8","creation_date":"2017-02-23 15:23:29.273 UTC","last_activity_date":"2017-02-27 16:32:41.407 UTC","last_edit_date":"2017-02-27 16:32:41.407 UTC","last_editor_display_name":"","last_editor_user_id":"5104596","owner_display_name":"","owner_user_id":"7470692","post_type_id":"1","score":"0","tags":"php|session","view_count":"393"} +{"id":"8891564","title":"how to take the phone number","body":"\u003cp\u003ei want to take the phone number from the phone dialer to use it in my application for that\ni used this code in the manifest file \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;uses-permission android:name=\"android.permission.READ_PHONE_STATE\" /\u0026gt;\n\n \u0026lt;intent-filter \u0026gt;\n\n \u0026lt;action android:name=\"android.intent.action.CALL\" /\u0026gt;\n\n \u0026lt;action android:name=\"android.intent.action.CALL_PRIVILEGED\" /\u0026gt;\n\n \u0026lt;category android:name=\"android.intent.category.DEFAULT\" /\u0026gt;\n \u0026lt;data android:scheme=\"tel\" /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/1uwRh.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eand to get the phone number that i call , so i did use this method \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e TelephonyManager phoneManager = (TelephonyManager) \n getApplicationContext().getSystemService(Context.TELEPHONY_SERVICE);\n String phoneNumber = phoneManager.getLine1Number();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut its return null when no sim card and nothing when its included \u003c/p\u003e\n\n\u003cp\u003eso is there any other method to get the phone number that i use into my application \u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2012-01-17 08:23:04.947 UTC","last_activity_date":"2012-04-21 01:45:41.363 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1118865","post_type_id":"1","score":"0","tags":"android","view_count":"437"} +{"id":"16456608","title":"aChartEngine shows two charts instead one","body":"\u003cp\u003eplease look at the images, the first is the adb emulator and the second is a Samsung Galaxy Tab.\u003c/p\u003e\n\n\u003cp\u003eImage1 \u003ca href=\"http://i41.tinypic.com/qph4kl.png\" rel=\"nofollow noreferrer\"\u003eImage 1 http://i41.tinypic.com/qph4kl.png\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eImage2 \u003ca href=\"http://i41.tinypic.com/2czzwpg.jpg\" rel=\"nofollow noreferrer\"\u003eImage 2 http://i41.tinypic.com/2czzwpg.jpg\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI don't know why in the Tab aChartEngine shows two charts.\u003c/p\u003e\n\n\u003cp\u003eThis is the code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e`private void MostrarCurvas(Estructuras.DatosCurva curva_uno, Estructuras.DatosCurva curva_dos) { XYSeries uno = new XYSeries(\"Adquisicion\");\nXYSeries dos = new XYSeries(\"Interpolacion\");\n\nfor (int i = 0; i \u0026lt; curva_uno.b.Length; i++)\n{\n uno.Add(curva_uno.a[i], curva_uno.b[i]);\n}\n\nfor (int i = 0; i \u0026lt; curva_dos.b.Length; i++)\n{\n dos.Add(curva_dos.a[i], curva_dos.b[i]);\n}\n\nXYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset();\ndataset.AddSeries(uno);\ndataset.AddSeries(dos);\n\nXYSeriesRenderer unoRender = new XYSeriesRenderer();\nunoRender.Color = Color.Blue;\nunoRender.PointStyle = PointStyle.Point;\nunoRender.LineWidth = 1;\n\nXYSeriesRenderer dosRender = new XYSeriesRenderer();\ndosRender.Color = Color.Green;\ndosRender.PointStyle = PointStyle.Point;\ndosRender.LineWidth = 1;\n\nXYMultipleSeriesRenderer multiRenderer = new XYMultipleSeriesRenderer();\nmultiRenderer.XTitle = \"(V)\";\nmultiRenderer.YTitle = \"(I)\";\n\nmultiRenderer.AddSeriesRenderer(unoRender);\nmultiRenderer.AddSeriesRenderer(dosRender);\n\nLinearLayout layout = FindViewById\u0026lt;LinearLayout\u0026gt;(Resource.Id.graph);\nGraphicalView ChartView = ChartFactory.GetLineChartView(this, dataset, multiRenderer);\n\nlayout.AddView(ChartView); }`\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"16457591","answer_count":"1","comment_count":"0","creation_date":"2013-05-09 07:26:38.3 UTC","favorite_count":"1","last_activity_date":"2013-05-09 09:37:21.727 UTC","last_edit_date":"2013-05-09 09:37:21.727 UTC","last_editor_display_name":"","last_editor_user_id":"1752560","owner_display_name":"","owner_user_id":"2332664","post_type_id":"1","score":"1","tags":"c#|mono|xamarin.android|achartengine","view_count":"134"} +{"id":"5328892","title":"Value of submit button clicked","body":"\u003cp\u003eThis should be really straight forward.\u003c/p\u003e\n\n\u003cp\u003eI'm checking if a form is being submitted using jquery. The form has multiple submit buttons with various values:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;button type=\"submit\" value=\"foo\"\u0026gt;Foo\u0026lt;/button\u0026gt;\n\u0026lt;button type=\"submit\" value=\"bar\"\u0026gt;Bar\u0026lt;/button\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI would like to find the value of the button that just submitted the form:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(form).live('submit', function() {\n // Get value of submit button\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","accepted_answer_id":"5329081","answer_count":"6","comment_count":"0","creation_date":"2011-03-16 17:02:22.92 UTC","favorite_count":"4","last_activity_date":"2013-09-26 10:17:38.923 UTC","last_editor_display_name":"","owner_display_name":"user623520","post_type_id":"1","score":"12","tags":"jquery","view_count":"29496"} +{"id":"39505455","title":"Strongname Signing IKVM PDFBox for Word Addin","body":"\u003cp\u003efor a Word Addin I am using PDFBox to manipulate PDFs. Or rather I would like to use it. I used it before with a self-created Desktop App. PDFBox is a Java Library that can be made usable as DLLs with IKVM (like here: \u003cstrong\u003e\u003ca href=\"http://www.squarepdf.net/pdfbox-in-net\" rel=\"nofollow\"\u003ehttp://www.squarepdf.net/pdfbox-in-net\u003c/a\u003e\u003c/strong\u003e ). The problem that I experience is that all libraries for Wordaddins must be strongnamed. I tried to strongname sign but then I get an exception that a part of apache common logging (in directory MANIFEST.MF) cannot be found.\nI know this is pretty vague so far and I will post more details later on, but maybe someone already went through this and has an idea on how to do this right or can point me to some place where there is already a strongnamed version of PDFBox.\nThanks in advance!\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-09-15 07:37:22.127 UTC","last_activity_date":"2016-09-19 12:50:35.217 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1106000","post_type_id":"1","score":"0","tags":"pdfbox|strongname|ikvm|word-addins","view_count":"37"} +{"id":"13613664","title":"C: Error at accessing dynamically allocated elements","body":"\u003cp\u003eI am trying to write a function that searches a certain element. However, it exists with error when I try to access an element. I commented the rows that generate the error in \u003ccode\u003esearch\u003c/code\u003e function.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;stdlib.h\u0026gt;\n#include \u0026lt;stdio.h\u0026gt;\n#define m 2\n\ntypedef struct pag {\n int nr;\n int key[m];\n struct pag * child[m + 1];\n}* page;\n\npage init(page B) {\n int i;\n B = malloc(sizeof(struct pag));\n\n for (i = 0; i \u0026lt; m; i++) {\n B-\u0026gt;key[i] = 0;\n B-\u0026gt;child[i] = malloc(sizeof(struct pag));\n }\n B-\u0026gt;child[i] = malloc(sizeof(struct pag));\n return B;\n}\n\npage search(page B, int k) {\n int i;\n if (B == NULL )\n return B;\n // 1. cautare liniara\n for (i = 0; i \u0026lt; m; i++) {\n // 2. find the desired value\n if (B-\u0026gt;key[i] == k) {\n return B;\n // 3. find the value greater or equal, take the left road to the child\n } else if (B-\u0026gt;key[i] \u0026gt;= k) {\n return search(B-\u0026gt;child[i], k); //exists with error here\n }\n }\n\n return search(B-\u0026gt;child[i], k); //also exists with error here\n}\n\nint main() {\n page B = init(B);\n\n if (search(B, 2) == NULL )\n printf(\"Negasit\");\n else\n printf(\"Gasit\");\n\n return 0;\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"5","creation_date":"2012-11-28 20:18:04.017 UTC","last_activity_date":"2012-11-28 20:31:19.62 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"898390","post_type_id":"1","score":"-6","tags":"c","view_count":"31"} +{"id":"16045165","title":"Sum Query in Elasticsearch","body":"\u003cp\u003eI'm fairly new to Elasticsearch. I'm trying to write a query that will group by a field and calculate a sum. In SQL, my query would look like this:\n\u003ccode\u003eSELECT lane, SUM(routes) FROM lanes GROUP BY lane\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eI have this data that looks like this in ES:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n \"_index\": \"kpi\",\n \"_type\": \"mroutes_by_lane\",\n \"_id\": \"TUeWFEhnS9q1Ukb2QdZABg\",\n \"_score\": 1.0,\n \"_source\": {\n \"warehouse_id\": 107,\n \"date\": \"2013-04-08\",\n \"lane\": \"M05\",\n \"routes\": 4047\n }\n},\n{\n \"_index\": \"kpi\",\n \"_type\": \"mroutes_by_lane\",\n \"_id\": \"owVmGW9GT562_2Alfru2DA\",\n \"_score\": 1.0,\n \"_source\": {\n \"warehouse_id\": 107,\n \"date\": \"2013-04-08\",\n \"lane\": \"M03\",\n \"routes\": 4065\n }\n},\n{\n \"_index\": \"kpi\",\n \"_type\": \"mroutes_by_lane\",\n \"_id\": \"JY9xNDxqSsajw76oMC2gxA\",\n \"_score\": 1.0,\n \"_source\": {\n \"warehouse_id\": 107,\n \"date\": \"2013-04-08\",\n \"lane\": \"M05\",\n \"routes\": 3056\n }\n},\n{\n \"_index\": \"kpi\",\n \"_type\": \"mroutes_by_lane\",\n \"_id\": \"owVmGW9GT345_2Alfru2DB\",\n \"_score\": 1.0,\n \"_source\": {\n \"warehouse_id\": 107,\n \"date\": \"2013-04-08\",\n \"lane\": \"M03\",\n \"routes\": 5675\n }\n},\n...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to essentially run the same query in ES as I did in SQL, so that my result would be something like (in json of course): \u003ccode\u003eM05: 7103, M03: 9740\u003c/code\u003e\u003c/p\u003e","accepted_answer_id":"16048098","answer_count":"1","comment_count":"0","creation_date":"2013-04-16 19:11:33.503 UTC","last_activity_date":"2016-12-07 16:15:18.933 UTC","last_edit_date":"2016-12-07 16:15:18.933 UTC","last_editor_display_name":"","last_editor_user_id":"6340959","owner_display_name":"","owner_user_id":"2242934","post_type_id":"1","score":"3","tags":"nosql|elasticsearch","view_count":"2760"} +{"id":"582287","title":"nunit setup/teardown not working?","body":"\u003cp\u003eOk, I've got a strange problem. I am testing a usercontrol and have code like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[TestFixture]\npublic myTestClass : UserControl\n{\n MyControl m_Control;\n\n [Test]\n public void TestMyControl()\n {\n m_Control = new MyControl();\n this.Controls.Add(m_Control);\n\n Assert.That(/*SomethingOrOther*/)\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis works fine, but when I change it to:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[TestFixture]\npublic myTestClass : UserControl\n{\n MyControl m_Control;\n\n [Setup]\n public void Setup()\n {\n m_Control = new MyControl();\n this.Controls.Add(m_Control);\n }\n\n [TearDown]\n public void TearDown()\n {\n this.Controls.Clear();\n }\n\n [Test]\n public void TestMyControl()\n {\n Assert.That(/*SomethingOrOther*/);\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI get an Object Reference Not Set To An Instance of an Object. I even output to the console to ensure that the setup/teardown were running at the correct times, and they were... but still it isn't newing up the usercontrols.\u003c/p\u003e\n\n\u003cp\u003eedit\u003e The exact code is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[TestFixture]\npublic class MoneyBoxTests : UserControl\n{\n private MoneyBox m_MoneyBox;\n private TextBox m_TextBox;\n\n #region \"Setup/TearDown\"\n [SetUp]\n public void Setup()\n {\n MoneyBox m_MoneyBox = new MoneyBox();\n TextBox m_TextBox = new TextBox();\n\n this.Controls.Add(m_MoneyBox);\n this.Controls.Add(m_TextBox);\n }\n\n [TearDown]\n public void TearDown()\n {\n this.Controls.Clear();\n }\n #endregion\n\n [Test]\n public void AmountConvertsToDollarsOnLeave()\n {\n m_MoneyBox.Focus();\n m_MoneyBox.Text = \"100\";\n m_TextBox.Focus();\n\n Assert.That(m_MoneyBox.Text, Is.EqualTo(\"$100.00\"), \"Text isn't $100.00\");\n }\n\n [Test]\n public void AmountStaysANumberAfterConvertToDollars()\n {\n m_MoneyBox.Focus();\n m_MoneyBox.Text = \"100\";\n m_TextBox.Focus();\n\n Assert.That(m_MoneyBox.Amount, Is.EqualTo(100), \"Amount isn't 100\");\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI get the exception(s) at the respective m_MoneyBox.Focus() calls.\u003c/p\u003e\n\n\u003cp\u003eSolved - See Joseph's comments\u003c/p\u003e","accepted_answer_id":"582364","answer_count":"3","comment_count":"0","creation_date":"2009-02-24 15:52:09.36 UTC","last_activity_date":"2013-01-20 17:07:44.553 UTC","last_edit_date":"2009-02-24 16:50:48.627 UTC","last_editor_display_name":"SnOrfus","last_editor_user_id":"48553","owner_display_name":"SnOrfus","owner_user_id":"48553","post_type_id":"1","score":"2","tags":"c#|unit-testing","view_count":"4518"} +{"id":"24733176","title":"Error: can't find any special indices 2d (needs index) 2dsphere (needs index)","body":"\u003cp\u003eWhen i use this find command on heroku cloud server: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eusers.find({$and: [\n{loc: { $nearSphere: user.loc.coordinates,\n $maxDistance: user.dis / 3959}},\n{age: {$gte: user.age_down}},\n{age: {$lte: user.age_up}},\n{gender: user.interested},\n{interested: user.gender}]})\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ei get the \u003ccode\u003ecan't find any special indices 2d (needs index) 2dsphere (needs index)\u003c/code\u003e Error.\u003c/p\u003e\n\n\u003cp\u003ethe results (in heroku) of the db.users.getIndexes() are:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ePRIMARY\u0026gt; db.getIndexes()\n[\n {\n \"v\" : 1,\n \"key\" : {\n \"_id\" : 1\n },\n \"ns\" : \"app27206755.users\",\n \"name\" : \"_id_\"\n },\n {\n \"v\" : 1,\n \"key\" : {\n \"loc\" : \"2dsphere\"\n },\n \"ns\" : \"app27206755.users\",\n \"name\" : \"loc_2dsphere\",\n \"background\" : true\n }\n]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethe weird thing is that in my local server it works perfectly (the same code exactly) but the problem is only on heroku.. i think that maybe i have a newer version of mongo on my local machin. the problem is that i dont know how to update the version of mongodb on the heroku cloud server, or if its even possible?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003e\u003cem\u003eUpdate\u003c/em\u003e\u003c/strong\u003e: i just found that the version of mongo in heroku is 2.4.8 and in my local machine is 2.6.3.\nany idea how to upgrade ?\u003c/p\u003e\n\n\u003cp\u003ethanks !\u003c/p\u003e","answer_count":"0","comment_count":"5","creation_date":"2014-07-14 09:16:50.527 UTC","last_activity_date":"2014-07-14 11:46:20.857 UTC","last_edit_date":"2014-07-14 11:46:20.857 UTC","last_editor_display_name":"","last_editor_user_id":"3545212","owner_display_name":"","owner_user_id":"3545212","post_type_id":"1","score":"0","tags":"mongodb|heroku","view_count":"492"} +{"id":"14936304","title":"using AND condition MYsql","body":"\u003cp\u003eWhat I need is: when I give training_id 172 AND training_id 174 it have to return user 150 only\u003cbr\u003e\n\u003cbr\u003e\n\u003cimg src=\"https://i.stack.imgur.com/bvgnH.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eI tried this but it doen't work\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT user_id FROM Training_users WHERE training_id = 172 AND training_id = 174\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMost of the times training_id might be more than 2 \u003c/p\u003e","accepted_answer_id":"14936406","answer_count":"5","comment_count":"7","creation_date":"2013-02-18 12:27:28.553 UTC","last_activity_date":"2013-02-18 13:05:03.833 UTC","last_edit_date":"2013-02-18 12:57:51.307 UTC","last_editor_display_name":"","last_editor_user_id":"1626398","owner_display_name":"","owner_user_id":"1626398","post_type_id":"1","score":"0","tags":"php|mysql|cakephp|cakephp-1.3","view_count":"95"} +{"id":"23745516","title":"Append document to iFrame","body":"\u003cp\u003eI am currently receiving parts of a webpage through an XHR, and then parsing them using the \u003ca href=\"https://developer.mozilla.org/en-US/docs/Web/API/DOMParser\" rel=\"nofollow\"\u003eDOMParser\u003c/a\u003e. After this I change some of the elements, but I am failing to append the document to the iFrame. \u003c/p\u003e\n\n\u003cp\u003eThe document that is parsed is all right, but when appending this document to the iFrame by calling \u003ccode\u003eiFrame.contentDocument = parsedDocument\u003c/code\u003e, \u003ccode\u003eiFrame.contentDocument\u003c/code\u003e stays empty (actually there are html, head and body tags but their content is empty).\u003c/p\u003e\n\n\u003cp\u003eI am parsing the received data like so:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar parser = new DOMParser();\nvar parsedDocument= parser.parseFromString(xhr.response, 'text/html');\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd my expectation was to do something like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eiFrame.contentDocument = parsedDocument;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"23745880","answer_count":"1","comment_count":"8","creation_date":"2014-05-19 19:16:34.497 UTC","last_activity_date":"2014-05-19 19:46:22.203 UTC","last_edit_date":"2014-05-19 19:21:36.807 UTC","last_editor_display_name":"","last_editor_user_id":"2844473","owner_display_name":"","owner_user_id":"2844473","post_type_id":"1","score":"1","tags":"javascript|html|iframe|xmlhttprequest","view_count":"211"} +{"id":"24757600","title":"Applying d3.js Density map of homicides example to own data fails","body":"\u003cp\u003eWe tried to reproduce the beautiful example of \u003ca href=\"http://bl.ocks.org/diegovalle/5166482\" rel=\"nofollow\"\u003ebl.ocks.org/diegovalle/5166482\u003c/a\u003e, using d3.js and leaflet, but with our own data, which is on a regular lon-lat grid.\u003cbr\u003e\nIn R, we first retrieve the data from a mysql table, and write them to a shapefile: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e lonmin \u0026lt;- -10; lonmax \u0026lt;- 10 \n latmin \u0026lt;- 30; latmax \u0026lt;- 50 \n dlon \u0026lt;- dlat \u0026lt;- 0.5 \n lon \u0026lt;- seq(from=lonmin, to=lonmax, by=dlon) \n lat \u0026lt;- seq(from=latmin, to=latmax, by=dlat) \n nlon \u0026lt;- length(lon); nlat \u0026lt;- length(lat) \n\n # cl \u0026lt;- a mysql request \n solRad \u0026lt;- matrix(cl$solRad, ncol=nlon, nrow=nlat) \n\n # Plot the data \n levels=seq(from=-40, to=1000, by=40) \n filled.contour(solRad, x=lon, y=lat, levels=levels, col=col) \n\n # Write a shapefile \n require(maptools); require(rgdal) \n writeOGR(ContourLines2SLDF(contourLines(lon, lat, solRad, levels=levels)),\n \"solRad.shp\", \"contours\", \"ESRI Shapefile\") \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eYou can look at the filled.contour output ![here] \u003ca href=\"http://www.jonxion.ch/5166482/solRad.png\" rel=\"nofollow\"\u003ehttp://www.jonxion.ch/5166482/solRad.png\u003c/a\u003e. We then transform the shape file to a topojson file, which you can find by replacing the .png in the above link by .json. \u003c/p\u003e\n\n\u003cp\u003eFinally, we render it with D3.js and Leaflet, leading to this faulty result [here] \u003ca href=\"http://www.jonxion.ch/5166482/\" rel=\"nofollow\"\u003ehttp://www.jonxion.ch/5166482/\u003c/a\u003e \u003c/p\u003e\n\n\u003cp\u003eWe browsed many tutorials and other examples without finding the cue to our problem. What are we doing wrong? \u003c/p\u003e\n\n\u003cp\u003eMight it be a d3.js limitation? We recognise that our data is more complex, but Diegovalle's data contains unclosed contours too (see its upper left corner). Would writing ContourPolygones instead of ContourLines solve our problem? Does such routines exist? Or, is there an alternative technique to d3.js? Thank's in advance for your help! \u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2014-07-15 11:54:58.317 UTC","last_activity_date":"2014-07-15 13:39:16.443 UTC","last_edit_date":"2014-07-15 13:39:16.443 UTC","last_editor_display_name":"","last_editor_user_id":"3239459","owner_display_name":"","owner_user_id":"2591909","post_type_id":"1","score":"1","tags":"r|d3.js","view_count":"269"} +{"id":"39333229","title":"\"mpromise (mongoose's default promise library) is deprecated\" error when testing","body":"\u003cp\u003eFor a while I have been getting this error and I decided to fix it today but after an hour trying to fix it I can find the solution.\u003c/p\u003e\n\n\u003cp\u003eWhen I test my mongoose User model this error/warning is generated:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eMongoose: mpromise (mongoose's default promise library) is deprecated, plug in your own promise library instead: http://mongoosejs.com/docs/promises.html\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is my test:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e 1 var assert = require('chai').assert;\n 2 var mongoose = require('mongoose');\n 3 var clearDB = require('mocha-mongoose')(require('../../config/database').uri, { skip: ['workouts'] });\n 4 var database = require('../../config/database').connect;\n 5\n 6 var User = require('../../app/models/user');\n 7 var user = new User({});\n 8\n 9 var req_body = {\n 10 username: \"garyvee\",\n 11 email: \"gary@vaynermedia.com\",\n 12 password: \"secret\"\n 13 };\n 14\n 15 describe('User', function() {\n 16 beforeEach(function(done) {\n 17 user.username = \"johnsmith\";\n 18 user.email = \"john@gmail.com\";\n 19 user.password = \"secret\";\n 20 done();\n 21 });\n 22\n 23 it('can be saved', function() {\n 24 return user.save(function(err: any) {\n 25 assert.isNull(err);\n 26 })\n 27 });\n 28 });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI think it has something to do with the \u003ccode\u003e.save\u003c/code\u003e but I don't know how to fix it. Can someone help me and tell me how to fix it so that error/warning isn't shown.\u003c/p\u003e","accepted_answer_id":"39334069","answer_count":"4","comment_count":"0","creation_date":"2016-09-05 14:57:00.02 UTC","favorite_count":"6","last_activity_date":"2017-01-24 19:29:37.773 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4165166","post_type_id":"1","score":"11","tags":"node.js|mongodb|mongoose|mocha","view_count":"14913"} +{"id":"8116630","title":"Custom Validation in PHP Codeigniter - one of two fields required","body":"\u003cp\u003eMy form has a cellphone and a phone field. I want the user to fill either one of the fields, or both, but not neither.\u003c/p\u003e\n\n\u003cp\u003eI've seen ways to do it in other languages, but could I have some advice on how to do it with Codeigniter?\u003c/p\u003e","accepted_answer_id":"8116678","answer_count":"3","comment_count":"3","creation_date":"2011-11-14 02:23:56.21 UTC","last_activity_date":"2015-01-19 04:04:20.497 UTC","last_edit_date":"2011-11-14 02:26:16.747 UTC","last_editor_display_name":"","last_editor_user_id":"362536","owner_display_name":"","owner_user_id":"1038763","post_type_id":"1","score":"1","tags":"php|forms|validation|codeigniter","view_count":"3737"} +{"id":"27287066","title":"Perform the action on all the files in directory","body":"\u003cp\u003eRight now i am choosing a file and it working good.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e JFileChooser fileChooser = new JFileChooser();\n fileChooser.setCurrentDirectory(new File(System\n .getProperty(\"user.home\") + \"/Desktop\"));\n int result = fileChooser.showOpenDialog(fileChooser);\n if (result == JFileChooser.APPROVE_OPTION) {\n selectedFile = fileChooser.getSelectedFile();\n }\n BufferedReader reader = new BufferedReader(new FileReader(\n selectedFile.getAbsolutePath()));\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eit helps me to perform the read and write operation on the selected file.\u003c/p\u003e\n\n\u003cp\u003eBut i want to add functionality such that i select the folder and it perform the read and write operations on all the files present in it or if i switch inside folder i can select a file on which i need to perform action\u003c/p\u003e\n\n\u003cp\u003ei tried \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e chooser = new JFileChooser(); \n chooser.setCurrentDirectory(new java.io.File(\".\"));\n chooser.setDialogTitle(choosertitle);\n chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut it is not working.\u003c/p\u003e\n\n\u003cp\u003ePlease help\u003c/p\u003e","answer_count":"1","comment_count":"4","creation_date":"2014-12-04 05:38:46.733 UTC","last_activity_date":"2014-12-04 05:53:45.21 UTC","last_edit_date":"2014-12-04 05:45:26.61 UTC","last_editor_display_name":"user4056965","owner_display_name":"user4056965","post_type_id":"1","score":"0","tags":"java|file|file-io|file-handling","view_count":"178"} +{"id":"14307940","title":"ajax upload using iframe","body":"\u003cp\u003eI need an information. If I have a form, used for uploading a file and having it target an Iframe.\u003cbr\u003e\nI then use Ajax to get the Upload progress. Let say that a simple layout with 2\ncolumn only.\u003c/p\u003e\n\n\u003cp\u003eThe Form being on column 1 and the Iframe on column 2. I want to still be \nable to use the column 1. \u003c/p\u003e\n\n\u003cp\u003eSo while the the upload is still in process. Will I be able to use column 1 to show other page content?\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2013-01-13 20:43:20.647 UTC","last_activity_date":"2013-01-14 07:33:22.797 UTC","last_edit_date":"2013-01-14 07:33:22.797 UTC","last_editor_display_name":"","last_editor_user_id":"1687214","owner_display_name":"","owner_user_id":"1687214","post_type_id":"1","score":"0","tags":"html|ajax|forms|iframe","view_count":"160"} +{"id":"3297254","title":"How to use MinGW's gcc compiler when installing Python package using Pip?","body":"\u003cp\u003eI configured MinGW and distutils so now I can compile extensions using this command:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esetup.py install\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMinGW's gcc compiler will be used and package will be installed. For that I installed MinGW and \u003ca href=\"https://docs.python.org/2/install/#location-and-names-of-config-files\" rel=\"nofollow noreferrer\"\u003ecreated distutils.cfg\u003c/a\u003e file with following content:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[build]\ncompiler = mingw32\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt's cool but now I'd like to use all pip benefits. Is there a way to use the same MinGW's gcc compiler in pip? So that when I run this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epip install \u0026lt;package name\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003epip will use MinGW's gcc compiler and compile C code if needed?\u003c/p\u003e\n\n\u003cp\u003eCurrently I get this error: \u003ccode\u003eUnable to find vcvarsall.bat\u003c/code\u003e. Seems pip doesn't know that I have gcc compiler. How can I configure pip to use gcc compiler?\u003c/p\u003e","answer_count":"3","comment_count":"1","creation_date":"2010-07-21 07:56:07.077 UTC","favorite_count":"38","last_activity_date":"2017-07-30 10:27:20.113 UTC","last_edit_date":"2017-07-30 10:27:20.113 UTC","last_editor_display_name":"","last_editor_user_id":"1033581","owner_display_name":"","owner_user_id":"203485","post_type_id":"1","score":"55","tags":"python|windows|mingw|pip|distutils","view_count":"53813"} +{"id":"15117896","title":"jquery datatables editable how to make cell 'read only' after editing?","body":"\u003cp\u003eI am using jquery-datatables-editable plugin with jQuery DataTables successfully. Is there a way to make editable cells UN-editable \u003cem\u003eafter\u003c/em\u003e they have been edited?\u003c/p\u003e\n\n\u003cp\u003eBasically I have a table with a checkbox, and once it is checked it needs to be uneditable. I am assuming this would be a 'fnOnCellUpdated' parameter or maybe part of a rowcallback function?\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2013-02-27 17:01:47.623 UTC","last_activity_date":"2013-02-27 19:22:30.147 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1836422","post_type_id":"1","score":"0","tags":"datatables","view_count":"1153"} +{"id":"38357193","title":"websphere liberty on docker container","body":"\u003cp\u003e\u003cbr/\u003eI'm running a docker container by the image websphere-liberty:webProfile7. I've installed adminCenter, modified the server.xml of defaultServer as shown at \u003ca href=\"https://developer.ibm.com/wasdev/downloads/#asset/features-com.ibm.websphere.appserver.adminCenter-1.0\" rel=\"nofollow\"\u003ehttps://developer.ibm.com/wasdev/downloads/#asset/features-com.ibm.websphere.appserver.adminCenter-1.0\u003c/a\u003e then restarted the server, but I continue to can not access the adminCenter or the login page. When i go on my 192.168.99.100:80/admincenter I see a websphere page tha says me \"Context Root Not Found\".\u003cbr/\u003eWhat's the problem?\u003c/p\u003e","accepted_answer_id":"38359200","answer_count":"1","comment_count":"1","creation_date":"2016-07-13 16:33:39.443 UTC","last_activity_date":"2016-07-13 18:32:18.707 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4090885","post_type_id":"1","score":"0","tags":"java|docker|websphere-liberty","view_count":"308"} +{"id":"9963020","title":"base64 encode image blob not showing in IE","body":"\u003cpre\u003e\u003ccode\u003e echo '\u0026lt;img src=\"data:image/jpg/png/jpeg;base64,' . base64_encode( $row['image'] ) . '\" height=\"150\" /\u0026gt;';\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is showing up images great in firefox, safari and chrome, but in internet explorer it shows a nice red cross, and I assume it is because of the encoding?\u003c/p\u003e\n\n\u003cp\u003eDoes anyone know how to get working in internet explorer as well?\u003c/p\u003e\n\n\u003cp\u003ePretty urgent job!\u003c/p\u003e\n\n\u003cp\u003eMuch appreciated for your help!\u003c/p\u003e","accepted_answer_id":"9963144","answer_count":"2","comment_count":"0","creation_date":"2012-04-01 08:38:17.39 UTC","last_activity_date":"2012-04-01 08:55:14.86 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1250526","post_type_id":"1","score":"0","tags":"php|image|internet-explorer|base64|encode","view_count":"4591"} +{"id":"5816985","title":"Random number generator which gravitates numbers to any given number in range?","body":"\u003cp\u003eI'm trying to come up with a random number generator which returns a float value between 0 and 1 weights the returned value in either one direction or the other.\u003c/p\u003e\n\n\u003cp\u003eIs there any reliable way to do this based on passing in two numbers, say Random(0.5) where '0.5' means the number between 0 and 1 returned will gravitate towards 0.5.\u003c/p\u003e","accepted_answer_id":"5817057","answer_count":"2","comment_count":"9","creation_date":"2011-04-28 10:11:50.013 UTC","favorite_count":"1","last_activity_date":"2015-03-09 14:40:31.51 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"79891","post_type_id":"1","score":"3","tags":"c#|random","view_count":"2072"} +{"id":"22596318","title":"Display text and buttons in Variable Length Paragraph","body":"\u003cp\u003eFor my app I have a \"summary\" paragraph that will be of variable length depending on a number of factors. Certain parts will also be buttons to other information. For example: Your flight #1234(button) from New York to San Francisco (another different button) is On time. Not only is the information variable, but what factors are displayed. For example sometimes there might be a connection to display. Where should I start looking for methods to do this? Any help is appreciated.\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2014-03-23 19:59:13.523 UTC","last_activity_date":"2014-03-23 19:59:13.523 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1828081","post_type_id":"1","score":"1","tags":"ios","view_count":"55"} +{"id":"9948917","title":"Creating simple web page associating image with excel column","body":"\u003cp\u003eI have an excel page with columns such as:\u003c/p\u003e\n\n\u003cp\u003eCol Col2 Col3\u003cbr\u003e\nabc 1 3\u003cbr\u003e\ndef 4 5\u003cbr\u003e\nhgi 9 5 \u003c/p\u003e\n\n\u003cp\u003eand so on. \u003c/p\u003e\n\n\u003cp\u003eAnd I have various images in a folder with file names corresponding to 'Col' i.e. abc.jpg, def.jpg, etc. \u003c/p\u003e\n\n\u003cp\u003eI want to create a webpage with asks for a string from a user, searches it in Col1, then displays corresponding Col2, Col3, and the image corresponding to that Col1.\u003c/p\u003e\n\n\u003cp\u003eNOW, I'm not asking for what to do, but I just want to know HOW will I do this? What all tools/scripts/languages/software do I need to know to implement a system like this? I'll get to learning that straight away.\u003c/p\u003e\n\n\u003cp\u003eI have very little experience in web development hence a very noob-ish question.\u003c/p\u003e\n\n\u003cp\u003eThanks a lot guys!\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2012-03-30 18:56:54.643 UTC","last_activity_date":"2012-03-31 10:02:52.677 UTC","last_edit_date":"2012-03-31 10:02:52.677 UTC","last_editor_display_name":"","last_editor_user_id":"1265125","owner_display_name":"","owner_user_id":"1265125","post_type_id":"1","score":"0","tags":"html|database","view_count":"79"} +{"id":"14429686","title":"Change multiple dataframes in a loop","body":"\u003cp\u003eI have, for example, this three datasets (in my case, they are many more and with a lot of variables):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edata_frame1 \u0026lt;- data.frame(a=c(1,5,3,3,2), b=c(3,6,1,5,5), c=c(4,4,1,9,2))\ndata_frame2 \u0026lt;- data.frame(a=c(6,0,9,1,2), b=c(2,7,2,2,1), c=c(8,4,1,9,2))\ndata_frame2 \u0026lt;- data.frame(a=c(0,0,1,5,1), b=c(4,1,9,2,3), c=c(2,9,7,1,1))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eon each data frame I want to add a variable resulting from a transformation of an existing variable on that data frame. I would to do this by a loop. For example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edatasets \u0026lt;- c(\"data_frame1\",\"data_frame2\",\"data_frame3\")\nvars \u0026lt;- c(\"a\",\"b\",\"c\")\nfor (i in datasets){\n for (j in vars){\n # here I need a code that create a new variable with transformed values\n # I thought this would work, but it didn't...\n get(i)$new_var \u0026lt;- log(get(i)[,j])\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eDo you have some valid suggestions about that?\u003c/p\u003e\n\n\u003cp\u003eMoreover, it would be great for me if it were possible also to assign the new column names (in this case \u003ccode\u003enew_var\u003c/code\u003e) by a character string, so I could create the new variables by another for loop nested in the other two.\u003c/p\u003e\n\n\u003cp\u003eHope I've not been too tangled in explain my problem.\u003c/p\u003e\n\n\u003cp\u003eThanks in advance.\u003c/p\u003e","accepted_answer_id":"14429844","answer_count":"1","comment_count":"3","creation_date":"2013-01-20 21:44:05.52 UTC","last_activity_date":"2013-01-20 22:09:17.797 UTC","last_edit_date":"2013-01-20 21:50:42.81 UTC","last_editor_display_name":"","last_editor_user_id":"1665868","owner_display_name":"","owner_user_id":"1665868","post_type_id":"1","score":"0","tags":"r|for-loop|dataframe","view_count":"1763"} +{"id":"824146","title":"use vc++ class library in c#","body":"\u003cp\u003ei have created a simple \"public ref class\" in the vc++ project, which is configured to generate a dynamik library.\nIn the c# Project (simple console application) i added the vc++ project as to the References and doing a \"using myVC++library\".\nBut when i try to create an object from the vc++ dll i always get: System.BadImageFormatException was unhandled\u003c/p\u003e\n\n\u003cp\u003eany clues or helpfull tutorials on this?\u003c/p\u003e\n\n\u003cp\u003eTIA\u003c/p\u003e","accepted_answer_id":"824567","answer_count":"1","comment_count":"0","creation_date":"2009-05-05 09:53:55.737 UTC","last_activity_date":"2009-05-05 12:04:28.747 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"95359","post_type_id":"1","score":"0","tags":"c#|visual-c++|dll","view_count":"367"} +{"id":"14530891","title":"Insert correct arrays doesn't work","body":"\u003cp\u003eWell, now i am getting \"has to be an array\", before it had to be a string.\u003c/p\u003e\n\n\u003cp\u003eCan someone help me out of this problem? Check comments.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e function publishPhoto() {\n var tags = []; var x,y=0;\n if ( harBilled == 0 ) {\n if ( profilSendt==0) {\n var c =0;\n //Get the online friends from array!\n for ( i=0;i\u0026lt;globalTags.length;i++){\n\n\n if ( c \u0026lt; 49 ){ //max 50 tags!\n tags.push({\"tag_uid\": \"\"+globalTags[i]+\"\",\n \"x\" : \"\"+(Math.floor(Math.random() * 309) + 1)+\"\",\n \"y\" : \"\"+(Math.floor(Math.random() * 309) + 1)+\"\"\n });\n }\n c = c+1;\n }\n\n var newJson = new String(array2json(tags));\n newJson = newJson.toString();\n\n FB.api('me/photos', 'post', {\n message: txt2send,\n status: 'success',\n url: 'http://meedies.com/0bcf1f22_smush_400x400.jpeg',\n\n }, function (response) {\n if (!response || response.error) {\n harBilled=0;\n alert(var_dump(response.error));\n } else {\n var fi = response.id;\n alert(\"Now this!\");\n FB.api(fi + '/tags?tags='+tags, 'POST', function(response){\n alert(var_dump(response));\n });\n\n harBilled=1;\n //getPages()\n }\n })\n profilSendt=1;\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am trying to insert multiple ids to be tagged on a picture. Can something help me though this correctly\u003c/p\u003e","answer_count":"5","comment_count":"1","creation_date":"2013-01-25 21:46:53.433 UTC","last_activity_date":"2013-01-25 23:40:57.133 UTC","last_edit_date":"2013-01-25 23:07:43.54 UTC","last_editor_display_name":"","last_editor_user_id":"1972220","owner_display_name":"","owner_user_id":"1972220","post_type_id":"1","score":"1","tags":"javascript|facebook|facebook-graph-api|facebook-javascript-sdk","view_count":"168"} +{"id":"38552606","title":"How to automatically pick up current date and time in rails","body":"\u003cp\u003eI have an model wherein i am collecting some data from the form. along with this data i need to automatically log in current data and time when a post request is made.\u003c/p\u003e\n\n\u003cp\u003eHow can i get current date and time. currently I am able to get current date and time as string type in rails using strftime function.I need the data identical to how it is stored in created and updated timestamps.\u003c/p\u003e","answer_count":"1","comment_count":"6","creation_date":"2016-07-24 13:35:37.733 UTC","last_activity_date":"2016-07-24 14:45:23.793 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6631437","post_type_id":"1","score":"0","tags":"ruby-on-rails","view_count":"61"} +{"id":"24856577","title":"array_multisort appears sort is incorrect","body":"\u003cp\u003eI have several arrays containing team data... \u003ccode\u003earray_multisort()\u003c/code\u003e appears to not be keeping the team data associations. I have something like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eTeams[$z] = various strings\nConfNum[$z] = various strings\n$DivNum[$z] = various strings\n$DivWinner[$z] = integer of 1 or 0.\n$TeamRank[$z] = integer of the team's rank\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003efor debugging, I use a for loop and print the value of each... so \u003ccode\u003e$Teams[$z] - $ConfNum[$z] - $DivNum[$z]\u003c/code\u003e ... etc.\u003c/p\u003e\n\n\u003cp\u003eI run \u003ccode\u003earray_multisort()\u003c/code\u003e (I've used this many times in the past) and suddenly the associations are no longer there.\u003c/p\u003e\n\n\u003cp\u003eHere's my debugging. \u003c/p\u003e\n\n\u003cp\u003eBEFORE array_multisort:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ekey - Teams - Conf - Div - Rank - DivWin - Series\nz:0 - 3 - 2 - 2 - 0 - 1 - 1\nz:1 - 10 - 2 - 7 - 8 - 1 - 2\nz:2 - 75 - 2 - 2 - 2 - 0 - 3\nz:3 - 11 - 2 - 2 - 5 - 0 - 4\nz:4 - 55 - 1 - 1 - 1 - 1 - 5\nz:5 - 79 - 1 - 6 - 3 - 1 - 6\nz:6 - 67 - 1 - 6 - 4 - 0 - 7\nz:7 - 4 - 1 - 1 - 6 - 0 - 8\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ePlease note z:1... team 10 should be Conf 2 Div 2 .. etc. I then run my array_multsort:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003earray_multisort($DivWinner,SORT_DESC,$TeamRank,$Teams,$ConfNum,$DivNum,$SeriesID);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis puts my DivWinners at the top, then sorted by my TeamRank. I include Teams, ConfNum, DivNum, SeriesID as I want to maintain the associations for all those arrays after the sort.\u003c/p\u003e\n\n\u003cp\u003eAfter the sort I get this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ekey - Teams - Conf - Div - Rank - DivWin - Series\nz:0 - 3 - 2 - 2 - 0 - 1 - 1\nz:1 - 10 - 1 - 1 - 1 - 1 - 2\nz:2 - 11 - 1 - 6 - 3 - 1 - 4\nz:3 - 4 - 2 - 7 - 8 - 1 - 8\nz:4 - 75 - 2 - 2 - 2 - 0 - 3\nz:5 - 55 - 1 - 6 - 4 - 0 - 5\nz:6 - 79 - 2 - 2 - 5 - 0 - 6\nz:7 - 67 - 1 - 1 - 6 - 0 - 7\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo now we go and look at team 10 again. \u003c/p\u003e\n\n\u003cp\u003eIt's now set to Conf 1 Div 1... completely incorrect. \u003c/p\u003e\n\n\u003cp\u003eIt is a DivWinner (set to 1) so it should rank \"higher\", however, TeamRank is 8... so of the four DivWinners, it should be the lowest... instead it's ranked 2nd.\u003c/p\u003e","accepted_answer_id":"24857353","answer_count":"2","comment_count":"4","creation_date":"2014-07-21 01:33:32.987 UTC","last_activity_date":"2014-07-21 11:26:29.287 UTC","last_edit_date":"2014-07-21 11:09:09.637 UTC","last_editor_display_name":"","last_editor_user_id":"3859001","owner_display_name":"","owner_user_id":"3859001","post_type_id":"1","score":"2","tags":"php|array-multisort","view_count":"108"} +{"id":"42592601","title":"Replacing null bytes with `sed` vs `tr`","body":"\u003cp\u003eBash newbie; using this idiom to generate repeats of a string:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eecho $(head -c $numrepeats /dev/zero | tr '\\0' 'S')\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI decided I wanted to replace each null byte with more than one character (eg. 'MyString' instead of just 'S'), so I tried the following with sed\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eecho $(head -c $numrepeats /dev/zero | sed 's/\\0/MyString/g' )\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut I just get an empty output. I realized I have to do\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eecho $(head -c $numrepeats /dev/zero | sed 's/\\x0/MyString/g' )\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eor\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eecho $(head -c $numrepeats /dev/zero | sed 's/\\x00/MyString/g' )\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003einstead, but I don't understand why. What is the difference between the characters that \u003ccode\u003etr\u003c/code\u003e and \u003ccode\u003esed\u003c/code\u003e match? Is it because \u003ccode\u003esed\u003c/code\u003e is matching against a regex?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdit\u003c/strong\u003e\nInteresting discovery that \u003ccode\u003e\\0\u003c/code\u003e in the \u003ccode\u003ereplacement\u003c/code\u003e portion of the \u003ccode\u003e's/regexp/replacement'\u003c/code\u003e \u003ccode\u003esed\u003c/code\u003e command actually behaves the same as \u003ccode\u003e\u0026amp;\u003c/code\u003e. Still doesn't explain why \u003ccode\u003e\\0\u003c/code\u003e in \u003ccode\u003eregexp\u003c/code\u003e doesn't match the nullbyte though (as it does in \u003ccode\u003etr\u003c/code\u003e and most other regex implementations)\u003c/p\u003e","accepted_answer_id":"42592972","answer_count":"3","comment_count":"5","creation_date":"2017-03-04 05:43:50.203 UTC","last_activity_date":"2017-03-05 04:58:31.823 UTC","last_edit_date":"2017-03-05 03:13:47.67 UTC","last_editor_display_name":"","last_editor_user_id":"4550915","owner_display_name":"","owner_user_id":"4550915","post_type_id":"1","score":"2","tags":"bash|sed","view_count":"348"} +{"id":"22640304","title":"I am confused about how to install package 'pymc' into iPython on Mac","body":"\u003cp\u003eI am new to Python and iPython. I have problem installing the package 'pymc' into iPython on Mac.\u003c/p\u003e\n\n\u003cp\u003eI basically followed these \u003ca href=\"http://www.pa.uky.edu/~robert/html/epd_+_pymc_on_newton.html\" rel=\"nofollow\"\u003einstructions\u003c/a\u003e.\u003c/p\u003e\n\n\u003cp\u003eHere is what I did:\u003c/p\u003e\n\n\u003cp\u003eFirst, I downloaded the pymc source file from github, and then I unzipped this under the folder \"Document\", this unzipped folder was called \"pymc-devs-pymc-79bc2dc\";\u003c/p\u003e\n\n\u003cp\u003eSecond, from a terminal, I typed:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecd /Users/shijiabian/Documents/pymc-devs-pymc-79bc2dc\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThird, I wanted to make canopy python to be my default python. Under the directory of \"pymc-devs-pymc-79bc2dc\", I typed:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eexport PATH=/Users/shijiabian/Library/Enthought/Canopy_64bit/User/bin:$PATH\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis step followed \u003ca href=\"https://support.enthought.com/entries/23646538-Make-Canopy-s-Python-be-your-default-Python-i-e-on-the-PATH-\" rel=\"nofollow\"\u003ehttps://support.enthought.com/entries/23646538-Make-Canopy-s-Python-be-your-default-Python-i-e-on-the-PATH-\u003c/a\u003e. But I was not sure if I need type this under different directory. However, the output looked correct for me.\u003c/p\u003e\n\n\u003cp\u003eFourth step, I tried two different approaches.\u003c/p\u003e\n\n\u003cp\u003eThe first approach: I typed the codes below into terminal:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecd pymc-devs-pymc-b6aa943/\npython setup.py config_fc --fcompiler gfortran build\npython setup.py install\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, there were errors returned after entering python setup.py config_fc --fcompiler gfortran build. I was wondering if I needed install other packages.\u003c/p\u003e\n\n\u003cp\u003eThe second approach was that I used pip directly:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epip install \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe installation was successful. Then I moved to the next step.\u003c/p\u003e\n\n\u003cp\u003eFifth step, I still followed the instruction \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026gt; ipython\n\u0026gt;\u0026gt;\u0026gt; In [1]: import pymc\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThere was a warning message:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eWarning: statsmodels and/or patsy not found, not importing glm submodule.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI was quite confused if I did anything improper.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-03-25 16:14:23.03 UTC","favorite_count":"1","last_activity_date":"2014-03-25 16:30:22.663 UTC","last_edit_date":"2014-03-25 16:24:14.03 UTC","last_editor_display_name":"","last_editor_user_id":"104349","owner_display_name":"","owner_user_id":"3451514","post_type_id":"1","score":"0","tags":"python|package|ipython|canopy|pymc","view_count":"1794"} +{"id":"9462030","title":"PetaPoco orm tool with Asp.Net GridView","body":"\u003cp\u003eI am trying PetaPoco with my Asp.Net Project. How can I use PetaPoco with Asp.Net GridView. I am new at web programming.\nI tried all code samples in the blog. They all are working with console app. But in Asp.Net I could not bind the datasource to GridView.\u003c/p\u003e\n\n\u003cp\u003eThank you\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Web;\nusing System.Web.UI;\nusing System.Web.UI.WebControls;\nusing System.Data;\nusing PetaPoco;\nusing northwind;\nusing System.Dynamic;\n\nnamespace Mng\n{\n public partial class Default : System.Web.UI.Page\n {\n public northwindDB db;\n\n protected void Page_Load(object sender, EventArgs e)\n {\n\n db = new northwindDB();\n\n if (!Page.IsPostBack)\n {\n var q = db.Query\u0026lt;Product\u0026gt;(\"SELECT top 10 * FROM Products\");\n grdMng.DataSource = q;\n\n }\n else\n {\n Response.Write(\"Postback occurs\");\n }\n }\n\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"9462626","answer_count":"1","comment_count":"0","creation_date":"2012-02-27 08:33:37.88 UTC","last_activity_date":"2012-02-27 09:25:51.64 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"427554","post_type_id":"1","score":"0","tags":"asp.net|gridview|asp.net-4.0|petapoco","view_count":"445"} +{"id":"45035664","title":"Authenticate to Google Container Service With Script: Non-interactive gcloud auth login?","body":"\u003cp\u003eI'm creating a jenkins job to deploy a container to GKE, and part of this script requires me to authenticate to the container service with:\u003c/p\u003e\n\n\u003cp\u003e\"gcloud auth login\"\u003c/p\u003e\n\n\u003cp\u003eHowever, this is an interactive operation that requires me to go and fetch a token in the browser:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e gcloud auth login\n Go to the following link in your browser:\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e(Which Jenkins clearly can't do, or at least not easily)\u003c/p\u003e\n\n\u003cp\u003eIs there a way to automate this step?\u003c/p\u003e","accepted_answer_id":"45056842","answer_count":"1","comment_count":"0","creation_date":"2017-07-11 13:14:02.347 UTC","last_activity_date":"2017-07-12 11:47:29.783 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6052496","post_type_id":"1","score":"1","tags":"jenkins|gcloud","view_count":"77"} +{"id":"40866542","title":"segmentation fault php7 symfony cli command using soap","body":"\u003cp\u003eI am tring to upgrade to php7 and symfony3 from php5.6 and symfony2 resp. I have some symfony console commands which uses soap to request third party apis. \u003c/p\u003e\n\n\u003cp\u003eAfter upgrading to php7 and php7.0-soap, but command fails with segmentation fault. I tried debugging with gdb, below is the trace. Looks like this is the issue with php7.0-soap ? What is the solution ?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eProgram received signal SIGSEGV, Segmentation fault.\n0x00005555557bc4db in zend_hash_destroy ()\n(gdb) bt\n#0 0x00005555557bc4db in zend_hash_destroy ()\n#1 0x00007fffecbbe141 in delete_type_persistent () from /usr/lib/php/20151012/soap.so\n#2 0x00005555557bc5dd in zend_hash_destroy ()\n#3 0x00007fffecbc55f1 in ?? () from /usr/lib/php/20151012/soap.so\n#4 0x00007fffecbc565f in ?? () from /usr/lib/php/20151012/soap.so\n#5 0x00005555557bc4d2 in zend_hash_destroy ()\n#6 0x00007fffecb95f0b in zm_shutdown_soap () from /usr/lib/php/20151012/soap.so\n#7 0x00005555557b25f3 in module_destructor ()\n#8 0x00005555557ab08c in ?? ()\n#9 0x00005555557bd048 in zend_hash_graceful_reverse_destroy ()\n#10 0x00005555557ac055 in zend_shutdown ()\n#11 0x000055555574fb3b in php_module_shutdown ()\n#12 0x000055555563d796 in main ()\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"1","creation_date":"2016-11-29 12:58:56.71 UTC","favorite_count":"1","last_activity_date":"2017-01-26 13:16:37.413 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1191081","post_type_id":"1","score":"3","tags":"soap|segmentation-fault|symfony|php-7","view_count":"232"} +{"id":"16505208","title":"Mac OSX capture all keypresses from MenuBar application","body":"\u003cp\u003eI'm sure most people are familiar with Alfred, the awesome task launcher. What I want to know is how does Alfred detect that I'm pressing Command-Shift-Space to launch its UI? Does it override `keyDown' or something entirely different?\u003c/p\u003e\n\n\u003cp\u003eEvery post I've seen so far talks about overriding \u003ccode\u003ekeyDown\u003c/code\u003e but from my understanding, that override has to be part of a view. How does Alfred do it without having a view being presented, with just the menubar icon on top?\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2013-05-12 07:41:17.767 UTC","last_activity_date":"2014-05-06 00:56:40.807 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1369331","post_type_id":"1","score":"0","tags":"osx|keydown","view_count":"215"} +{"id":"23513434","title":"Android: Weird crash message on method call","body":"\u003cp\u003eI've designed app for Android and get occasional reports for crashes:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ejava.lang.NullPointerException\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eat this line in source code :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eint y = -(int)(fft.freqToIndex(freq)/DrawXStep*DrawXMult); // Calculate bin\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm trying to isolate possible causes for this error. The only one that comes to my mind is that object fft was not properly initialized and method is not accessible.\u003c/p\u003e\n\n\u003cp\u003eIs there any other possible source for NullPointerException in this line from source code ?\u003c/p\u003e\n\n\u003cp\u003eThanks in advance,\nregards,\nBor.\u003c/p\u003e","answer_count":"2","comment_count":"3","creation_date":"2014-05-07 09:06:58.033 UTC","last_activity_date":"2014-05-07 10:03:55.98 UTC","last_edit_date":"2014-05-07 10:03:55.98 UTC","last_editor_display_name":"","last_editor_user_id":"101361","owner_display_name":"","owner_user_id":"2064070","post_type_id":"1","score":"0","tags":"java|android|nullpointerexception","view_count":"52"} +{"id":"33799328","title":"How to send a single email from excel-vba if there is same email address but different data","body":"\u003cp\u003eI am working on a project where i need to send emails to a specific people about the requests under my queue. I have the requests listed under \"Column A and B\" and the email addresses in \"Column G\".\nI have created a macro in excel that allows me to send the emails with a pre fabricated text to those people. The only problem I am having is that some users have created many requests which are under my queue, but the macro sends individual email about each request. I want that if these are multiple entries of an email address in \"Column G\", then the requests they have raised in \"Column A and B\" should get consolidated and only one email is sent to them for all requests. Please help.\u003c/p\u003e\n\n\u003cp\u003eHere is the code I made so far:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSub SendEmail(what_address_to As String, what_address_cc As String, subject_line As String, mail_body As String)\nDim olApp As Outlook.Application\nSet olApp = CreateObject(\"Outlook.Application\")\n\nDim olMail As Outlook.MailItem\nSet olMail = olApp.CreateItem(olMailItem)\n\nolMail.To = what_address_to\nolMail.CC = \"*IS GLOBAL External Connectivity Risk and Reconciliation\" \u0026amp; \";\" \u0026amp; what_adress_cc\nolMail.Subject = subject_line\nolMail.BodyFormat = olFormatHTML\nolMail.HTMLBody = mail_body\nolMail.Save\n\nEnd Sub\n\nSub SendMassEmail()\n\nrow_number = 1\n\nDo\nDoEvents\nrow_number = row_number + 1\nDim mail_body_message As String\nDim CMP_number As String\nDim CCR_ID As String\n\nmail_body_message = Sheet3.Range(\"E2\")\nCMP_number = Sheet1.Range(\"A\" \u0026amp; row_number)\nCCR_ID = Sheet1.Range(\"B\" \u0026amp; row_number)\nwhat_address_to = Sheet1.Range(\"G\" \u0026amp; row_number)\nwhat_address_cc = Sheet1.Range(\"P\" \u0026amp; row_number)\nmail_body_message = Replace(mail_body_message, \"replace_CMP_here\", CMP_number)\nmail_body_message = Replace(mail_body_message, \"replace_CCR_ID_here\", CCR_ID)\nCall SendEmail(Sheet1.Range(\"G\" \u0026amp; row_number), Sheet1.Range(\"P\" \u0026amp; row_number), \"Termination CMP\" \u0026amp; \" \" \u0026amp; Sheet1.Range(\"A\" \u0026amp; row_number) \u0026amp; \" \" \u0026amp; \"is up for termination\", mail_body_message)\n\nLoop Until row_number = \"\"\n\nEnd Sub\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ePlease advise how can i send a single email to same email address with all the requests they created.\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2015-11-19 09:03:39.393 UTC","last_activity_date":"2015-11-19 09:03:39.393 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5580201","post_type_id":"1","score":"0","tags":"excel|vba|excel-vba|email","view_count":"86"} +{"id":"29570762","title":"What are browser-friendly alternatives for the flow* elements generated by Inkscape?","body":"\u003cp\u003eOn a project I'm working on, I've got some views that use maps generated by Inkscape. However, we've ran into some slight problems...specifically, some of the maps do not render text, at all.\u003c/p\u003e\n\n\u003cp\u003eAfter \u003ca href=\"https://stackoverflow.com/questions/3924646/how-to-properly-display-multiline-text-in-svg-1-1\"\u003esome research\u003c/a\u003e into this issue here on StackOverflow, I discovered there's some good reasons for this:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eInkscape generates SVG 1.1 documents, not SVG 1.2 documents, despite including \u003ccode\u003eflowRoot\u003c/code\u003e, \u003ccode\u003eflowRegion\u003c/code\u003e, and \u003ccode\u003eflowPara\u003c/code\u003e elements. I updated my maps to be version 1.2 documents, but it didn't help.\u003c/li\u003e\n\u003cli\u003eI read that those \u003ccode\u003eflow*\u003c/code\u003e elements, being part of the SVG 1.2 standard, aren't actually implemented in most browsers, because SVG 1.2 was never accepted by anyone. This explains why no amount of cajoling caused the text on our maps to appear.\u003c/li\u003e\n\u003cli\u003eIt's generally recommended that if your SVG is going to be viewed in a browser, to use \u003ccode\u003e\u0026lt;text\u0026gt;\u003c/code\u003e instead of \u003ccode\u003e\u0026lt;flowPara\u0026gt;\u003c/code\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eThis revealed a deeper problem that I couldn't find the answers to from a Google search: Inkscape is filling the documents with \u003cem\u003eother\u003c/em\u003e crap that \u003cem\u003eit\u003c/em\u003e can render (\u003ccode\u003eflowRoot\u003c/code\u003e and \u003ccode\u003eflowRegion\u003c/code\u003e, respectively), but IE/Chrome has no implementation for.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eQuestions:\u003c/strong\u003e\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eWhat widely-implemented SVG tag makes a good replacement for \u003ccode\u003eflowRoot\u003c/code\u003e?\u003c/li\u003e\n\u003cli\u003eWhat widely-implemented SVG tag makes a good replacement for \u003ccode\u003eflowRegion\u003c/code\u003e?\u003c/li\u003e\n\u003cli\u003eIf no such alternatives exist, is there some easy way, or even a general heuristic, on how best to modify the SVG document to be fully viewable on a modern browser (IE11 or Chrome)?\u003c/li\u003e\n\u003c/ol\u003e","accepted_answer_id":"29576766","answer_count":"1","comment_count":"0","creation_date":"2015-04-10 21:11:01.8 UTC","last_activity_date":"2015-04-11 10:23:01.953 UTC","last_edit_date":"2017-05-23 11:57:03.64 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"1404206","post_type_id":"1","score":"2","tags":"svg|compatibility","view_count":"331"} +{"id":"45244133","title":"Accessing a function's variable outside the function with return","body":"\u003cp\u003eThis is a very basic question but I'm not being able to find the answer to it.\u003c/p\u003e\n\n\u003cp\u003eI have the following JavaScript code\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar forge = require('node-forge');\nvar bigInt = require(\"big-integer\");\n\nvar bits = 160;\n\nvar prime = forge.prime.generateProbablePrime(bits, function(err, num) {\n if (err) {\n console.log(err);\n } else {\n return num;\n }\n});\n\nconsole.log(prime);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI was expecting the \u003ccode\u003econsole.log(prime)\u003c/code\u003e to log the prime number to the console, but I just get \u003ccode\u003eundefined\u003c/code\u003e back. How can I grab the \u003ccode\u003enum\u003c/code\u003e and access it outside of the function \u003ccode\u003eforge.prime.generateProbablePrime\u003c/code\u003e?\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2017-07-21 18:09:27.273 UTC","last_activity_date":"2017-07-21 18:09:27.273 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3861965","post_type_id":"1","score":"0","tags":"javascript|scope","view_count":"21"} +{"id":"30922700","title":"how to add specific attributes to a NSAttributedString in Swift","body":"\u003cp\u003eThis is a simple question but is erroring in several places so I think there's something I'm just not getting (and it's a coworkers app who's no longer here). I am migrating an Objective-C app to Swift and am having some problems with NSAttributedString. \u003c/p\u003e\n\n\u003cp\u003eThere is a note.body which gets set to an NSMutableAttributedString and each note has a .frags array of strings which are the sections that we want to add the attributes to.\u003c/p\u003e\n\n\u003cp\u003eI have:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar attrs = [NSFontAttributeName : UIFont.systemFontOfSize(9.0)]\nvar gString = NSMutableAttributedString(string:note.body, attributes:attrs) // say note.body=\"birds and bees\"\n\nlet firstAttributes = [NSForegroundColorAttributeName: UIColor.blueColor(), NSBackgroundColorAttributeName: UIColor.yellowColor(), NSUnderlineStyleAttributeName: 1]\nfor (val) in note.frags { // say note.frags=[\"bees\"]\n let tmpVal = val\n gString.addAttribute(NSUnderlineStyleAttributeName, value: NSUnderlineStyle.StyleDouble.rawValue, range: gString.string.rangeOfString(tmpVal))\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow would I add the first attributes?\u003c/p\u003e\n\n\u003cp\u003eThe error I get is:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eCannot invoke 'addAttribute' with an argument list of type '(String,\n value: Int, range: Range?)'\u003c/p\u003e\n\u003c/blockquote\u003e","accepted_answer_id":"30923121","answer_count":"1","comment_count":"1","creation_date":"2015-06-18 18:10:21.137 UTC","last_activity_date":"2015-06-18 18:33:50.013 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"152825","post_type_id":"1","score":"1","tags":"swift|nsattributedstring","view_count":"987"} +{"id":"28776197","title":"Best way to call a method - Python","body":"\u003cp\u003eI have these two classes, but I want to know what is the best way to call a function inside a class.\u003c/p\u003e\n\n\u003cp\u003eI like to use this one with attributes:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass myclass():\n def myfunction(self):\n return self.x + self.y\n\nz = myclass()\nz.x = 4\nz.y = 3\nprint z.myfunction()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut I don't know if it's correct. Or should I be using this instead the last one?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass myclass():\n def myfunction(self,x,y):\n return x + y\n\nz = myclass()\nprint z.myfunction(4,3)\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"28776224","answer_count":"1","comment_count":"3","creation_date":"2015-02-27 23:40:38.073 UTC","last_activity_date":"2016-01-13 13:36:55.063 UTC","last_edit_date":"2016-01-13 13:36:55.063 UTC","last_editor_display_name":"","last_editor_user_id":"100297","owner_display_name":"","owner_user_id":"4616458","post_type_id":"1","score":"1","tags":"python|python-2.7|class|oop|methods","view_count":"78"} +{"id":"30677953","title":"UIKit Slideset setup","body":"\u003cp\u003eI'm trying to create an UIKit Slideset. Tried several times but I can't figure it out. If you familiar with it let me know how does it work. Here is my HTML code:\u003c/p\u003e\n\n\u003cp\u003e\u003cdiv class=\"snippet\" data-lang=\"js\" data-hide=\"false\"\u003e\r\n\u003cdiv class=\"snippet-code\"\u003e\r\n\u003cpre class=\"snippet-code-html lang-html prettyprint-override\"\u003e\u003ccode\u003e\u0026lt;div data-uk-slideset=\"{default: 4}\"\u0026gt;\r\n \u0026lt;div class=\"uk-slidenav-position\"\u0026gt;\r\n \u0026lt;ul class=\"uk-grid uk-slideset\"\u0026gt;\r\n \u0026lt;li\u0026gt;\u0026lt;img src=\"img/images1\"\u0026lt;/li\u0026gt;\r\n \u0026lt;li\u0026gt;\u0026lt;img src=\"img/images1\"\u0026lt;/li\u0026gt;\r\n \u0026lt;li\u0026gt;\u0026lt;img src=\"img/images1\"\u0026lt;/li\u0026gt;\r\n \u0026lt;li\u0026gt;\u0026lt;img src=\"img/images1\"\u0026lt;/li\u0026gt;\r\n \u0026lt;li\u0026gt;\u0026lt;img src=\"img/images1\"\u0026lt;/li\u0026gt;\r\n \u0026lt;li\u0026gt;\u0026lt;img src=\"img/images1\"\u0026lt;/li\u0026gt;\r\n \u0026lt;li\u0026gt;\u0026lt;img src=\"img/images1\"\u0026lt;/li\u0026gt;\r\n \u0026lt;li\u0026gt;\u0026lt;img src=\"img/images1\"\u0026lt;/li\u0026gt;\r\n \u0026lt;li\u0026gt;\u0026lt;img src=\"img/images1\"\u0026lt;/li\u0026gt;\r\n \u0026lt;li\u0026gt;\u0026lt;img src=\"img/images1\"\u0026lt;/li\u0026gt;\r\n \u0026lt;li\u0026gt;\u0026lt;img src=\"img/images1\"\u0026lt;/li\u0026gt;\r\n \u0026lt;li\u0026gt;\u0026lt;img src=\"img/images1\"\u0026lt;/li\u0026gt;\r\n \u0026lt;/ul\u0026gt;\r\n \u0026lt;a href=\"\" class=\"uk-slidenav uk-slidenav-previous\" data-uk-slideset-item=\"previous\"\u0026gt;\u0026lt;/a\u0026gt;\r\n \u0026lt;a href=\"\" class=\"uk-slidenav uk-slidenav-next\" data-uk-slideset-item=\"next\"\u0026gt;\u0026lt;/a\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;ul class=\"uk-slideset-nav uk-dotnav uk-flex-center\"\u0026gt;...\u0026lt;/ul\u0026gt;\r\n\u0026lt;/div\u0026gt;\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-06-06 01:15:31.803 UTC","last_activity_date":"2015-12-01 09:56:39.66 UTC","last_edit_date":"2015-06-06 01:51:16.467 UTC","last_editor_display_name":"","last_editor_user_id":"483779","owner_display_name":"","owner_user_id":"4883079","post_type_id":"1","score":"0","tags":"javascript|html|uikit","view_count":"760"} +{"id":"4382632","title":"Pointcuts and Aspect-Oriented Programming","body":"\u003cp\u003eHow are pointcuts used in aspect-oriented programming language to add functionality into an existing program?\u003c/p\u003e\n\n\u003cp\u003eTo my understanding, from this Wikipedia article - \u003ca href=\"http://en.wikipedia.org/wiki/Pointcut\" rel=\"nofollow\"\u003ehttp://en.wikipedia.org/wiki/Pointcut\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003ePointcuts are placed into a specific spot in a piece of code, and when that point is reached, based on the evaluation of the pointcut, more code can be executed at a specific point somewhere in the code based on the evaluation of the pointcut. Is this a correct understanding?\u003c/p\u003e\n\n\u003cp\u003eIf so, then that would add functionality because the programmer can execute different piece of code based off that evaluation.\u003c/p\u003e","accepted_answer_id":"4382748","answer_count":"2","comment_count":"0","creation_date":"2010-12-07 23:11:09.04 UTC","favorite_count":"1","last_activity_date":"2010-12-08 10:54:39.85 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"431203","post_type_id":"1","score":"3","tags":"aop|functionality|pointcuts","view_count":"299"} +{"id":"12833346","title":"J2EE filter : login page unable to load the css or any images","body":"\u003cp\u003eI have already visited \u003ca href=\"https://stackoverflow.com/questions/10973997/java-filterimplementation-for-session-checking/10974023#10974023\"\u003eJava FilterImplementation for session checking\u003c/a\u003e link, which says about Spring security. I did not get the help i need.\u003c/p\u003e\n\n\u003cp\u003eAfter applying filter login.jsp is unable to load CSS and images.\u003c/p\u003e\n\n\u003cp\u003eI am trying simple example providing filter in web.xml and applying the filter on pages other than login.jsp.\nWeb.xml file is :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;filter\u0026gt;\n \u0026lt;filter-name\u0026gt;struts2\u0026lt;/filter-name\u0026gt;\n \u0026lt;filter-class\u0026gt;\n org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter\n \u0026lt;/filter-class\u0026gt;\n\u0026lt;/filter\u0026gt;\n\u0026lt;filter-mapping\u0026gt;\n \u0026lt;filter-name\u0026gt;struts2\u0026lt;/filter-name\u0026gt;\n \u0026lt;url-pattern\u0026gt;/*\u0026lt;/url-pattern\u0026gt;\n\u0026lt;/filter-mapping\u0026gt;\n \u0026lt;filter\u0026gt;\n \u0026lt;filter-name\u0026gt;AuthenticationFilter2\u0026lt;/filter-name\u0026gt;\n \u0026lt;filter-class\u0026gt;filter.AuthorizationFilter2\u0026lt;/filter-class\u0026gt;\n \u0026lt;init-param\u0026gt;\n \u0026lt;param-name\u0026gt;avoid-urls\u0026lt;/param-name\u0026gt;\n \u0026lt;param-value\u0026gt;login.jsp\u0026lt;/param-value\u0026gt;\n \u0026lt;/init-param\u0026gt;`\n \u0026lt;filter\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd the filter class is :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e private ArrayList\u0026lt;String\u0026gt; urlList;\n\npublic void destroy() {\n // TODO Auto-generated method stub\n System.out.println(\"authorization filter2 destroy method....\");\n}\n\n\n\n\npublic void doFilter(ServletRequest req, ServletResponse res,\n FilterChain chain) throws IOException, ServletException {\n\n System.out.println(\"authorization filter2 doFilter method....\");\n\n HttpServletRequest request = (HttpServletRequest) req;\n HttpServletResponse response = (HttpServletResponse) res;\n String url = request.getServletPath();\n\n System.out.println(\"ppp:\"+request.getRequestURL());\n\n System.out.println(\"url is :\"+url);\n\n boolean allowedRequest = false;\n\n System.out.println(\"url list is :\"+urlList);\n\n if(urlList.contains(url.substring(1))) {\n allowedRequest = true;\n }\n System.out.println(\"request allowed.....\"+allowedRequest); \n if (!allowedRequest) {\n\n Map session = ActionContext.getContext().getSession();\n\n /*HttpSession session = request.getSession(false);*/\n /* if (null == session) {\n response.sendRedirect(\"login.jsp\");\n }*/\n\n System.out.println(\"session contains login :\"+session.containsKey(\"login\"));\n\n\n\n if(!session.containsKey(\"login\")){\n response.sendRedirect(\"login.jsp\");\n }\n\n }\n\n chain.doFilter(req, res);\n}\n\npublic void init(FilterConfig config) throws ServletException {\n System.out.println(\"authorization filter2 init method....\");\n String urls = config.getInitParameter(\"avoid-urls\");\n StringTokenizer token = new StringTokenizer(urls, \",\");\n\n urlList = new ArrayList\u0026lt;String\u0026gt;();\n\n while (token.hasMoreTokens()) {\n urlList.add(token.nextToken());\n\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eLogin page contains \u003ccode\u003ecss\u003c/code\u003e and \u003ccode\u003eimages\u003c/code\u003e as per the requirement.\u003c/p\u003e\n\n\u003cp\u003ePlease help me out. Thank you.\u003c/p\u003e","accepted_answer_id":"12948938","answer_count":"2","comment_count":"0","creation_date":"2012-10-11 06:17:34.02 UTC","favorite_count":"1","last_activity_date":"2013-08-29 05:44:09.037 UTC","last_edit_date":"2017-05-23 12:00:53.023 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"1331089","post_type_id":"1","score":"2","tags":"java|jsp|java-ee|servlet-filters","view_count":"4605"} +{"id":"26934405","title":"timescale definition in modelsim","body":"\u003cp\u003eI have an issue while simulating my system with a verilog bench. I have a signal (clk_out) from which I want to measure and auto-check the period and both high and low time. Signal clk_out has a period of 1 second and both high time and low time are 500ms.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e`timescale 1ms / 1ps \n\nmodule tb;\n\nparameter PASSED = 1;\nparameter FAILED = 0;\n\nwire clk_out;\nreg reset_n;\nreg result;\nrealtime time1;\nrealtime time2;\nrealtime time3;\n\n\ninitial begin\nresult = PASSED;\nreset_n = 1'b0;\n\n// stay in reset for 100ms\nreset_n = #100 1'b1;\n\n@(negedge clk_out);\ntime1 = $realtime;\n@(posedge clk_out);\ntime2 = $realtime;\n@(negedge clk_out);\ntime3 = $realtime;\n\n$display(\"\\n\");\n$display(\"period is %f, high time is %f, and low time is %f\",time3-time1,time3-time2,time2-time1);\n$display(\"\\n\");\n\nif (time3-time1 \u0026lt;= 999 || time3-time1 \u0026gt;= 1001) begin\n result = FAILED;\nend\n\nif (time2-time1 \u0026lt;= time3*0.998/2 || time2-time1 \u0026gt;= time3*1.002/2) begin\n result = FAILED;\nend\n\nif (time3-time2 \u0026lt;= time3*0.998/2 || time3-time2 \u0026gt;= time3*1.002/2) begin\n result = FAILED;\nend\n\n$display(\"\\n\");\n$display(\"=================================================\");\nif (result) begin\n$display(\"Test is PASSED\");\nend else begin\n$display(\"Test is FAILED\");\nend\n\n// create the 1Hz signal when not in reset\nmy_module my_module_under_test\n(\n .RESET_N (reset_n),\n .CLK_OUT (clk_out)\n);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003emodelsim output is as follow :\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eperiod is 1000000000.000000, high time is 500000000.000000, and low time is 500000000.000000\u003c/p\u003e\n \n \u003cp\u003e=================================================\u003c/p\u003e\n \n \u003ch1\u003etest is FAILED\u003c/h1\u003e\n \n \u003cp\u003e=============== END OF SIMULATION ===============\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eIt seems that the timescale define at the file top is not read by the simulator. I expected to have :\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003etime3 - time1 = 1000.00000\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003etime2 - time1 = 500.00000\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003etime3 - time2 = 500.00000\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eWhat am I doing wrong ?\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","accepted_answer_id":"26939409","answer_count":"2","comment_count":"1","creation_date":"2014-11-14 16:20:50.72 UTC","last_activity_date":"2014-11-14 21:50:10.623 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1182849","post_type_id":"1","score":"0","tags":"time|verilog|modelsim","view_count":"1886"} +{"id":"28774881","title":"Chrome Web Store does not accept localization message file in hindi","body":"\u003cp\u003eI have developed an extension for Google Chrome, and I now localizing it to several languages. I have successfully localized it to many languages that use different alphabets (e.g. Russian, Hebrew, ...), but today I tried to upload to the web store a new version of the extension containing Hindi localization, and I got the following error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eAn error occurred: Failed to process your item.\n\n_locales/hi/messages.json:1:1: a object must begin with '{'.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe messages.json file for Hindi (hi) contains the following:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n \"appName\": {\n \"message\": \"Mind the Word\",\n \"description\": \"The title of the application, displayed in the web store.\"\n },\n \"appDesc\": {\n \"message\": \"इंटरनेट सर्फिंग करते समय भाषा सीखें|\",\n \"description\": \"The description of the application, displayed in the web store.\"\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI suspect it is an encoding issue. How can I solve this?\u003c/p\u003e","accepted_answer_id":"28775050","answer_count":"1","comment_count":"0","creation_date":"2015-02-27 21:47:22.477 UTC","last_activity_date":"2015-02-27 21:59:02.647 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1262612","post_type_id":"1","score":"0","tags":"google-chrome|google-chrome-extension","view_count":"40"} +{"id":"45878691","title":"Reduce python executable size cx_freeze","body":"\u003cp\u003eI'm developing a small app for Windows which gets some data with \u003ccode\u003erequests\u003c/code\u003e, process them (no numpy) and plot them with matplotlib on a Tk window. \u003c/p\u003e\n\n\u003cp\u003eI use theses libs: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport requests\nimport os\nimport tkinter as tk\nimport matplotlib.pyplot as plt\nfrom matplotlib.backends.backend_tkagg import FigureCanvasTkAgg\nfrom matplotlib.figure import Figure\nimport matplotlib.dates as mdates\nfrom ttkthemes import ThemedStyle\nimport datetime\nfrom matplotlib.backends.backend_tkagg import NavigationToolbar2TkAgg\nfrom matplotlib.backend_bases import key_press_handler\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I wrap everything with a cx_freeze setup I got a almost 300Mb file! \nI miss an \"optimized way\" to reduce the lib size or use lightweight lib. I know that there are a lot of plotting/GUI frameworks, but which could fit the best to my app? \u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2017-08-25 09:44:57.903 UTC","last_activity_date":"2017-08-25 11:40:32.68 UTC","last_edit_date":"2017-08-25 11:40:32.68 UTC","last_editor_display_name":"","last_editor_user_id":"6220679","owner_display_name":"","owner_user_id":"8106731","post_type_id":"1","score":"1","tags":"python|size|cx-freeze","view_count":"157"} +{"id":"32993871","title":"What versions of Primefaces extensions are compatible with the Primefaces 3.5?","body":"\u003cp\u003eI would like to know what versions of Primefaces extensions are compatible with the Primefaces 3.5?\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2015-10-07 13:43:29.977 UTC","last_activity_date":"2017-10-14 19:27:55.38 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3307533","post_type_id":"1","score":"0","tags":"primefaces|primefaces-extensions","view_count":"394"} +{"id":"34030430","title":"Implementing a map with unknown key type","body":"\u003cp\u003eI'm a physicist working on a code that needs to construct and then cache a number of matrices of different type. The matrices then need to be retrievable, given a set of information that uniquely specifies them (a 'key'). I'm trying to find a flexible way of doing this.\u003c/p\u003e\n\n\u003cp\u003eMy current approach involves bundling together all the 'key' information into a single class:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass FilterKey{\n public:\n FilterKey(const char type, const X key1, const Y* key2...);\n ~FilterKey();\n bool operator==(const FilterKey\u0026amp; rhs) const;\n private:\n char type; X mKey1; Y* mpKey2;\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eUser code passes these to an interface class called \"MatrixDirectory\", instantiated as a global variable (but \u003cem\u003enot\u003c/em\u003e a singleton) that stores a map between types and caches:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e//MatrixDirectory.hpp\nclass MatrixDirectory : private NonCopyable{\n public:\n void Clear(); //Calls destructors.\n void Filter(std::vector\u0026lt;double\u0026gt;\u0026amp; U, const FilterKey\u0026amp; key);\n private:\n std::map\u0026lt;char types, FilterCache* caches\u0026gt; mpFilterCaches;\n};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen MatrixDirectory::Filter encounters a new char type it calls the FilterCacheFactory, which constructs the appropriate derived class from FilterCache based on the char:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e//FilterCacheFactory.cpp\nnamespace FilterCacheFactory{\n FilterCache* MakeFilterCache(char type) {\n if '1'==type return new OneDFilterCache();\n else if 'S'==type return new S2FilterCache();\n else if 'B'==type return new B2FilterCache();\n else REQUIRE(False, \"Invalid filter type '\" \u0026lt;\u0026lt; type \u0026lt;\u0026lt; \"'!\");\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand inserts the result into the map. The actual FilterCaches then manage the matrices and perform whatever filtering is necessary, given a FilterKey. \u003c/p\u003e\n\n\u003cp\u003eThis, or approximately this, I think will work. But I'm a bit concerned about having to be so explicit about FilterKey. It would be better if MatrixDirectory could store also FilterCaches that are keyed on different types. I guess I could do this with variadic templates but I don't want to have to directly #include everything. Is there another way?\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2015-12-01 21:22:20.59 UTC","last_activity_date":"2015-12-01 21:29:51.003 UTC","last_edit_date":"2015-12-01 21:29:51.003 UTC","last_editor_display_name":"","last_editor_user_id":"3023429","owner_display_name":"","owner_user_id":"3023429","post_type_id":"1","score":"4","tags":"c++|matrix","view_count":"146"} +{"id":"14278980","title":"animate callback function not firing - using queue : false","body":"\u003cp\u003eIm having trouble getting my animate complete function to fire when i add \u003cpre\u003e{duration : 2000, queue : false}\u003c/pre\u003e\u003c/p\u003e\n\n\u003cp\u003eExample:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecurrent.animate({left: \"-=600px\"}, {duration : 2500, queue : false});\nnext.animate({left: \"-=600px\"}, {duration : 2500, queue : false}, function(){\n // Run stuff here once both animations above have finished \n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have tried .done() with no success,\u003c/p\u003e\n\n\u003cp\u003eAny ideas would be grateful!\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","accepted_answer_id":"14279135","answer_count":"1","comment_count":"0","creation_date":"2013-01-11 13:15:13.817 UTC","last_activity_date":"2013-01-11 13:23:31.56 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1406211","post_type_id":"1","score":"0","tags":"javascript|jquery","view_count":"66"} +{"id":"6332885","title":"Perl threads with alarm","body":"\u003cp\u003eIs there any way to get alarm (or some other timeout mechanism) working in perl (\u003e=5.012) threads?\u003c/p\u003e","accepted_answer_id":"6333362","answer_count":"1","comment_count":"0","creation_date":"2011-06-13 15:54:17.887 UTC","favorite_count":"1","last_activity_date":"2011-06-13 16:33:31.583 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"758523","post_type_id":"1","score":"3","tags":"multithreading|perl|timeout","view_count":"2547"} +{"id":"7059252","title":"JavaScript Glib.spawn_async stdout file descriptor","body":"\u003cp\u003eI want to spawn a process using spawn_async in the GLib bindings in javascript in a gnome3 shell-extension.\u003c/p\u003e\n\n\u003cp\u003eI need something like the \"standard_output=True\" parameter in the python doc \u003ca href=\"http://developer.gnome.org/pygobject/stable/glib-functions.html\" rel=\"nofollow\"\u003ehttp://developer.gnome.org/pygobject/stable/glib-functions.html\u003c/a\u003e which, when enabled, returns a filedescriptor to stdout of the process. The python API and C API differ heavily in this point.\u003c/p\u003e\n\n\u003cp\u003eUnfortunately, I cannot find any precise documentation of the JS API to GTK anywhere, the official page doesn't even list it though the shell is written in js to big parts...\u003c/p\u003e\n\n\u003cp\u003eThe background of my question is that I call a python script doing serial communication, since I saw no other way to let JS get its data from such a script but through spawning a process.\u003c/p\u003e\n\n\u003cp\u003eDo you have any guess how to get the stdout of a process started like this?\u003c/p\u003e","accepted_answer_id":"7059399","answer_count":"2","comment_count":"0","creation_date":"2011-08-14 19:43:50.823 UTC","last_activity_date":"2011-08-15 19:57:05.433 UTC","last_edit_date":"2011-08-14 19:59:21.217 UTC","last_editor_display_name":"","last_editor_user_id":"228140","owner_display_name":"","owner_user_id":"228140","post_type_id":"1","score":"1","tags":"javascript|python|glib|gnome-3|gnome-shell","view_count":"474"} +{"id":"38402094","title":"How do I disable OPTIONS method on Django Rest Framework globally?","body":"\u003cp\u003eI want to disable \u003ccode\u003eOPTIONS\u003c/code\u003e method on my API built with Django Rest Framework (DRF) globally (on all the API endpoints)\u003c/p\u003e\n\n\u003cp\u003ecurrently an \u003ccode\u003eOPTIONS\u003c/code\u003e call returns,\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n \"parses\": [\n \"application/json\",\n \"application/x-www-form-urlencoded\",\n \"multipart/form-data\"\n ],\n \"renders\": [\n \"application/json\"\n ],\n \"name\": \"Login Oauth2\",\n \"description\": \"\"\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhich is something that I don't want someone to peek into. I want to return a blank character \u003ccode\u003e\u003c/code\u003e as github does on its API or something else.\u003c/p\u003e\n\n\u003cp\u003eI tried \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@api_view(['POST'])\ndef my_method(request):\n if request.method == 'OPTIONS':\n return Response()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eon an function based view, which returns an \u003ccode\u003e\u003c/code\u003e but inspecting the headers show,\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eAllow →POST, OPTIONS, OPTIONS\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhich has a repeated \u003ccode\u003eOPTIONS\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eHow do I achieve it? Thanks.\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2016-07-15 17:33:10.48 UTC","favorite_count":"1","last_activity_date":"2017-02-16 04:32:31.83 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5170375","post_type_id":"1","score":"0","tags":"python|django|rest|django-rest-framework","view_count":"700"} +{"id":"40834938","title":"Vertically centering an element with CSS","body":"\u003cp\u003eI am trying to vertically center content in my div. \u003c/p\u003e\n\n\u003cp\u003eHTML:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div id=\"header\"\u0026gt;\n \u0026lt;div class=\"col-xs-1 col-sm-1 col-md-1 col-lg-1\" id=\"logo-img-div\"\u0026gt;\u0026lt;img id=\"logo-img\" src=\"logo.png\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;div class=\"col-xs-3 col-sm-3 col-md-3 col-lg-3\" id=\"logo-text\"\u0026gt;Text\u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCSS:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e @media only screen and (min-width: 768px) {\n .col-sm-1 {width: 8.33%; float: left;}\n .col-sm-2 {width: 16.66%; float: left;}\n .col-sm-3 {width: 25%; float: left;}\n .col-sm-4 {width: 33.33%; float: left;}\n .col-sm-5 {width: 41.66%; float: left;}\n .col-sm-6 {width: 50%; float: left;}\n .col-sm-7 {width: 58.33%; float: left;}\n .col-sm-8 {width: 66.66%; float: left;}\n .col-sm-9 {width: 75%; float: left;}\n .col-sm-10 {width: 83.33%; float: left;}\n .col-sm-11 {width: 91.66%; float: left;}\n .col-sm-12 {width: 100%; float: left;}\n\n\n }\n\n* {\n color: #2c2c2c;\n height: 100%;\n width: 100%;\n margin: 0 !important;\n font-family: 'Raleway';\n}\n\n#header {\n height: 10%;\n background-color: #2c2c2c;\n color: #c4c3c3;\n font-family: 'title'; \n}\n\n#logo-img {\n height: 80%;\n width: auto;\n\n}\n\n#logo-img-div {\n\n}\n\n\n#logo-text {\n color: #c4c3c3;\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to center content of logo-img-div and logo-text, but keep those two divs on the left of header content. I've found many similar questions but none of the solutions worked.\u003c/p\u003e","answer_count":"3","comment_count":"1","creation_date":"2016-11-27 23:02:52.517 UTC","last_activity_date":"2016-11-28 00:16:02.94 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3597446","post_type_id":"1","score":"0","tags":"html|css","view_count":"50"} +{"id":"2479858","title":"Django logs: any tutorial to log to a file","body":"\u003cp\u003eI am working with a django project, I haven't started. The developed working on the project left. During the knowledge transfer, it was told to me that all the events are logged to the database. I don't find the database interface useful to search for logs and sometimes they don't even log(I might be wrong). I want to know, if there is an easy tutorial that explains how to enable logging in Django with minimal configuration changes.\u003c/p\u003e\n\n\u003cp\u003eThank you\u003cbr\u003e\nBala\u003c/p\u003e","accepted_answer_id":"2483694","answer_count":"1","comment_count":"2","creation_date":"2010-03-19 18:55:31.613 UTC","favorite_count":"1","last_activity_date":"2010-03-20 15:55:31.693 UTC","last_edit_date":"2010-03-19 19:02:27.96 UTC","last_editor_display_name":"","last_editor_user_id":"207335","owner_display_name":"","owner_user_id":"207335","post_type_id":"1","score":"2","tags":"python|django|logging|mod-python","view_count":"619"} +{"id":"7583438","title":"How to handle multiple asynch downloads","body":"\u003cp\u003eI recently moved my background synch downloads to a view controller and need some advice on how to best handle them asynch. I have written all the code to show a progressview as the download occurs but as you might have guessed it's not that simple. Here's how it works.\u003c/p\u003e\n\n\u003cp\u003euser sees a tableview with two entires one for each database. they can press a button to download the database and when the download starts that fires off the asynch URL connection,etc. This works to a certain extent however it's not that simple.\u003c/p\u003e\n\n\u003cp\u003ehere's what i want it to do.\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003edownload the main update URL (works ok)\u003c/li\u003e\n\u003cli\u003ethen download a secondary URL.\u003c/li\u003e\n\u003cli\u003ethen apply the first URL content to the sqlite store (code written for that)\u003c/li\u003e\n\u003cli\u003ethen apply the 2nd URL content to the sqlite store (code written for that)\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003e(All the while showing progress to the user)\u003c/p\u003e\n\n\u003cp\u003ewhen the downloads were synch it was easy as i just waited for them to finish in order to fire the next activity off but when using the asynch method i'm struggling with how to get them to wait. Step 3 depends upon step 1 finishing and step 4 depends on step 2 finishing and overall success relies on all finishing. step 4 needs to wait for step 3 to finish otherwise the database locks will cause a clash.\u003c/p\u003e\n\n\u003cp\u003ethe second complication is that if the user presses the second button while the first is downloading then steps 3, 4 will clash if they execute at the same time as the first row is accessing the database.\u003c/p\u003e\n\n\u003cp\u003eHas anyone done anything similar and if so what was the strategy you used to manage the flow of events.\u003c/p\u003e\n\n\u003cp\u003eAlso i wanted to wrap this all up in a backgroundTask with ExpirationHandler so it would survive the user pressing the home button... but the delegate methods don't get called when i do that.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2011-09-28 12:47:54.55 UTC","last_activity_date":"2012-02-24 13:36:14.003 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"333661","post_type_id":"1","score":"0","tags":"nsurlconnection","view_count":"190"} +{"id":"17413578","title":"Script engine prior to Java SE 6?","body":"\u003cp\u003eFor some reason, I have to use Java 5. I started learning programming from java se 7 so i am not familiar with the old versions. \u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003ejavax.script\u003c/code\u003e package, which contains the \u003ccode\u003eScriptEngine\u003c/code\u003e class and \u003ccode\u003eScriptEngineManager\u003c/code\u003e class does not exist in Java 5. But Rhino project was created way before Java 5. So I am wondering how to use java script engine before \u003ccode\u003ejavax.script\u003c/code\u003e was introduced in java 6?\u003c/p\u003e\n\n\u003cp\u003e(I scanned through Java se 5 API documentation. There doesn't seem to be a substitution for \u003ccode\u003eScriptEngine\u003c/code\u003e class. And all the online searching result gives me the modern code.)\u003c/p\u003e","accepted_answer_id":"17413791","answer_count":"2","comment_count":"3","creation_date":"2013-07-01 20:57:32.087 UTC","last_activity_date":"2014-03-02 05:38:44.463 UTC","last_edit_date":"2014-03-02 05:38:44.463 UTC","last_editor_display_name":"","last_editor_user_id":"139985","owner_display_name":"","owner_user_id":"1467926","post_type_id":"1","score":"3","tags":"java|java-5|scriptengine","view_count":"217"} +{"id":"6963276","title":"Eclipse has multiple copies of same Android Device","body":"\u003cp\u003eI've been programming for Android devices for some time now and just recently came across this:\u003cimg src=\"https://i.stack.imgur.com/gC10b.png\" alt=\"Multiple devices with same name in Eclipse..\"\u003e\u003c/p\u003e\n\n\u003cp\u003eThere is a single one in the list online, but I can't run/debug my programs because it reports \"ADB rejected install command with: device offline\" since every other device has the same ID.\u003c/p\u003e\n\n\u003cp\u003eA reset fixes this, but is there any other options? Why is this happening?\u003c/p\u003e","answer_count":"3","comment_count":"2","creation_date":"2011-08-05 22:28:18.357 UTC","favorite_count":"2","last_activity_date":"2014-09-26 14:08:00.2 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"697151","post_type_id":"1","score":"9","tags":"android|eclipse|adb","view_count":"5539"} +{"id":"43002267","title":"Jasmine not working unless script is placed into fixture","body":"\u003cp\u003eThe following PASSES in Jasmine:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e// test.html\n\n\u0026lt;button id=\"click\"\u0026gt;\u0026lt;/button\u0026gt;\n\n\u0026lt;script\u0026gt;\n console.log(\"in JS\")\n $(\"#click\").click(function() {\n console.log(\"in click\")\n testFunction();\n })\n function testFunction() {\n }\n\u0026lt;/script\u0026gt;\n\n// test_spec.js\n\ndescribe(\"when #click is clicked\", function() {\n beforeEach(function() {\n loadFixtures('catalog_page.html')\n })\n it(\"should call testFunction\", function() {\n spyOn(window, \"testFunction\")\n $(\"#click\").click();\n expect(window.testFunction).toHaveBeenCalled()\n })\n})\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd the console output is as expected:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ein JS\nin click\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThat's what I mean by Jasmine is working when script is placed into fixture. of course that's not where the script code is supposed to go. So if I did it the right way...\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e// assets/test.js = same script copied from test.html fixture about\n// test.html = only button (removed script)\n// test_spec.js = same test code as above\n\n// jasmine.yml (first 2 assets were present earlier, only difference is adding assets/test.js)\n\n...\nsrc_files:\n - https://code.jquery.com/jquery-2.2.4.min.js\n - assets/jasmine-jquery.js\n - assets/test.js\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow the test fails, HOWEVER, in my console, I get:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ein JS\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhich implies that the JS successfully loaded, however, the click didn't do anything. Why might this be the case?\u003c/p\u003e\n\n\u003cp\u003eThe jasmine browser shows no console errors in either scenario (although there is a warning that should be unrelated: \u003ccode\u003eSynchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.\u003c/code\u003e)\u003c/p\u003e\n\n\u003cp\u003eWhat might cause this? \u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-03-24 14:35:57.407 UTC","last_activity_date":"2017-03-24 14:35:57.407 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2731253","post_type_id":"1","score":"0","tags":"javascript|jquery|ruby-on-rails|jasmine|jasmine-jquery","view_count":"23"} +{"id":"35747533","title":"Pandas is not appending dataframe","body":"\u003cp\u003eI am trying this but df is returning blank\ntextbox values are list like (54.0, 60.18, 86.758, 73.71)\nThink like having csv file whose header are x y h w and textbox values will get appended in it\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport pandas\nlist111 = [(72.0, 578.18, 378.0, 591.71),(54.0, 564.18, 378.0, 577.71),(54.0, 550.18, 378.0, 563.71),(54.0, 536.18, 378.0, 549.71)]\ndf = pd.DataFrame()\nprint df\nlist_title = [\"x\",\"y\",\"h\",\"w\"]\nfor textbox in list111:\n zipped=zip(list_title,textbox)\n df1 = pd.DataFrame(zipped)\n df.append(df1,ignore_index=True)\n print df1,df\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"35747721","answer_count":"2","comment_count":"2","creation_date":"2016-03-02 12:41:25.103 UTC","favorite_count":"0","last_activity_date":"2016-03-02 14:03:08.783 UTC","last_edit_date":"2016-03-02 13:08:28.01 UTC","last_editor_display_name":"","last_editor_user_id":"5068287","owner_display_name":"","owner_user_id":"5068287","post_type_id":"1","score":"1","tags":"python|pandas","view_count":"235"} +{"id":"47172744","title":"Automatic email from wordpress in a specified time","body":"\u003cp\u003eI would like to send an automatic email from my wordpress site when my ssl certification validation is over. (I mean before 3 days to event)\u003c/p\u003e\n\n\u003cp\u003eI try to use the wordpress cron, but the email not send in the specified time.\u003c/p\u003e\n\n\u003cp\u003eWhat is the problem?\u003c/p\u003e\n\n\u003cp\u003eThank you for help!\u003c/p\u003e\n\n\u003cp\u003eMy code in the functions.php:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e// create a scheduled event (if it does not exist already)\nfunction myprefix_custom_cron_schedule( $schedules ) {\n $schedules['every_six_hours'] = array(\n 'interval' =\u0026gt; 21600, // Every 6 hours\n 'display' =\u0026gt; __( 'Every 6 hours' ),\n );\n return $schedules;\n}\nadd_filter( 'cron_schedules', 'myprefix_custom_cron_schedule' );\n\n//Schedule an action if it's not already scheduled\nif ( ! wp_next_scheduled( 'myprefix_cron_hook' ) ) {\n wp_schedule_event( time(), 'every_six_hours', 'myprefix_cron_hook' );\n}\n\n///Hook into that action that'll fire every six hours\n add_action( 'myprefix_cron_hook', 'myprefix_cron_function' );\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy code in the php:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction displayHostsSection(){\n$opts = get_option('sslMail');\ndate_default_timezone_set('Europe/Budapest'); // CDT\n$send_date = date('Y.m.d', strtotime(\"+3 days\"));\nif (isset($opts['hosts'])) {\nforeach($opts['hosts'] as $host =\u0026gt; $date) {\n$d = ($date instanceof DateTime) ? $date-\u0026gt;format('Y.m.d') : 'Unknown';\n\n\n\nfunction myprefix_cron_function() {\n\nif($send_date == $d){\n\n$to = get_option('admin_email');\n$subject = \"My Subject\";\n$txt = \"My Text\";\n$headers = \"From: $host \" . \"\\r\\n\" .\n\"CC: \";\n\nmail($to,$subject,$txt,$headers);\n\n};\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"5","creation_date":"2017-11-08 06:12:24.597 UTC","last_activity_date":"2017-11-08 06:12:24.597 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4849781","post_type_id":"1","score":"1","tags":"php|wordpress|email|cron","view_count":"23"} +{"id":"25477841","title":"OpenCV - LBP Traincascade can’t pass Precalculation in Stage 0, but HAAR works fine?","body":"\u003cp\u003eI run opencv_traincascade, and I never reach the precalculation time for stage 0. \u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdit: My problem seems to be specific to LBP training. I changed featureType to HAAR and the classifier below finished training in a matter of minutes\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdit: Precalculation time is in seconds, so at stage 0 you should see it reach precalculation within 10 seconds, but I've seen it as high as 40 seconds. Precalculation time may increase steadily from stage to stage, and then suddenly increase dramatically to half an hour in the later stages (and perhaps even longer than that if you are working with thousands of samples, but I haven't got that far yet)\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e(I will continue to update this post filling in things I've come to understand that prevented me from understanding precalculation, and perhaps find out why HAAR training would work while LBP doesn't. It would probably just require looking at the source code for initiating the stage cycle)\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eProblem\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI run opencv_traincascade, and I never reach the precalculation time for stage 0.\u003c/p\u003e\n\n\u003cp\u003eI’m using an MacBook Air purchased in 2014. \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eProcessor 1.3 GHz Intel Core i5\u003cbr\u003e\n Memory 4 GB 1600 MHz DDR3\u003cbr\u003e\n Graphics Intel HD Graphics 5000\u003cbr\u003e\n Software OS X 10.9.4 (13E28)\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eMy terminal looks something like this, and runs some 390% (really?) of my CPU and 4 threads in my Activity Monitor. \u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003e===== TRAINING 0-stage =====\n\u0026lt;BEGIN\nPOS count : consumed x : x\nNEG count : acceptanceRatio y : 1\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eAlthough I’ve tried creating many classifiers, for the sake of sharing something we can all relate to, I’m going to reference a tutorial for car detection since I get the same result not matter if it’s a training of my own or not. This trainer has been published, and I’ve seen other people reference it, so I assume it works.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://www.youtube.com/watch?v=WEzm7L5zoZE\" rel=\"noreferrer\"\u003ehttps://www.youtube.com/watch?v=WEzm7L5zoZE\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eOn my desktop I have:\u003c/p\u003e\n\n\u003cp\u003eA pos folder with the relative file paths and information (1 0 0 100 40) in a cars.info folder;\u003cbr\u003e\nA bg.txt file with relative paths to a neg folder containing the negative samples;\u003cbr\u003e\nAn empty data folder named “data”;\u003cbr\u003e\nA cars.vec file of positive samples. I can view the vector file and the images are there. \u003c/p\u003e\n\n\u003cp\u003eThere are 550 positive samples at 100x40 originally, and 48x24 after using createsamples to create the vec file\u003c/p\u003e\n\n\u003cp\u003eThere are 500 negative samples at 100x40\u003c/p\u003e\n\n\u003cp\u003eHere was the createsamples command, for reference:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eopencv_createsamples -info cars.info -num 550 -w 48 -h 24 -vec cars.vec\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThen I run the following command:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eopencv_traincascade -data data -vec cars.vec -bg bg.txt -numPos 500 -numNeg 500 -numStages 2 -w 48 -h 24 -featureType LBP\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003ccode\u003ePARAMETERS:\ncascadeDirName: data\nvecFileName: cars.vec\nbgFileName: bg.txt\nnumPos: 500\nnumNeg: 500\nnumStages: 2\nprecalcValBufSize[Mb] : 256\nprecalcIdxBufSize[Mb] : 256\nstageType: BOOST\nfeatureType: LBP\nsampleWidth: 48\nsampleHeight: 24\nboostType: GAB\nminHitRate: 0.995\nmaxFalseAlarmRate: 0.5\nweightTrimRate: 0.95\nmaxDepth: 1\nmaxWeakCount: 100\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eThis is my output that I’ve never seen reach precalculation for LBP, no matter what I’m trying to train; how I’ve tried to change the sample size, resolution of images, minHitRate, or lowering numPos. \u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003e===== TRAINING 0-stage =====\n\u0026lt;BEGIN\nPOS count : consumed 500 : 500\nNEG count : acceptanceRatio 500 : 1\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003ePlease ask for any information I failed to supply. I apologize.\u003c/p\u003e\n\n\u003cp\u003eI’ve read about trainers being stuck in infinite loops, and modification of the source code needed. However, I hope that can be avoided since this appears to work for others (at least the author).\u003c/p\u003e\n\n\u003cp\u003eThank you all for all the past questions and answers that have helped me with various coding projects.\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2014-08-25 01:11:49.213 UTC","favorite_count":"1","last_activity_date":"2017-04-28 06:35:58.333 UTC","last_edit_date":"2016-02-02 16:01:29.76 UTC","last_editor_display_name":"","last_editor_user_id":"2040863","owner_display_name":"","owner_user_id":"3973770","post_type_id":"1","score":"9","tags":"opencv","view_count":"925"} +{"id":"41824694","title":"Excel: Is it possible to converge several ComboBox outputs into a single Cell?","body":"\u003cp\u003e\u003cstrong\u003eContext\u003c/strong\u003e: My Excel worksheet consists of a userform that outputs to several sheets. A function of this userform is a date selector, that is desired to output to a single cell. However, due to the nature of its design (Obtained from a gentleman from this particular site, Doug Glancy) it consists of three comboboxes.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eIt is displayed as\u003c/strong\u003e:\u003c/p\u003e\n\n\u003cp\u003e[ComboBox1: Day] [ComboBox2: Month] [ComboBox3: Year]\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/N4Rdn.jpg\" rel=\"nofollow noreferrer\"\u003eHere is an image for visual reference\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eIs there any particular method of forcing a concrescence from several outputs into a single cell? And if not, what would be an alternative method for accomplishing a similar result?\u003c/p\u003e\n\n\u003cp\u003eEdit: Here is my current code for transmitting data from the userform:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Sub Transfer()\n\nDim emptyRow As Long\n\n'Make Sheet2 active\nSheet2.Activate\n\n'Determine emptyRow\nemptyRow = WorksheetFunction.CountA(Range(\"B:B\")) + 1\n\n'Transfer information\nCells(emptyRow, 2).Value = TextBoxSON.Value\nCells(emptyRow, 3).Value = TextBoxJobDescription.Value\nCells(emptyRow, 4).Value = TextBoxCustomer.Value\nCells(emptyRow, 5).Value = TextBoxQuantity.Value\nCells(emptyRow, 6).Value = TextBoxDateRequired.Value\n\nDim LR As Integer\nLR = Range(\"B\" \u0026amp; Rows.Count).End(xlUp).Row\nApplication.EnableEvents = False\nRange(\"A4:BB\" \u0026amp; LR).Sort Key1:=Range(\"A4\"), Order1:=xlAscending, _\n Header:=xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom\nApplication.EnableEvents = True\n\nEnd Sub\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eEdit: Big thanks to \u003ca href=\"https://stackoverflow.com/users/7446760/clr\"\u003eCLR\u003c/a\u003e for the answer:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emydate = DateSerial(cboYear.Value, cboMonth.Value, cboDay.Value)\nCells(emptyRow, 6).Value = mydate\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis code enables the data to be output exactly as desired. Hope this helps anyone in the future.\u003c/p\u003e\n\n\u003cp\u003e(\u003cstrong\u003eIrrelevant (But seemingly necessary) information\u003c/strong\u003e: Hey, I'm a new SO user. After hours (and hours) of trying to find and understand this problem, I have not arrived to any possible conclusion and, with the angry hands of the clock pointing furiously at me, I am forced to (shamefully) ask this question. \u003c/p\u003e\n\n\u003cp\u003eI am not Excel proficient nor VBA literate. However, I have been slowly learning the language through sites such as HomeandLearn.org to overcome my difficulties but seemingly to no avail on this particular problem. I must apologise in advance for any inappropriate use or misuse of terminology or any other uninformed misapprehension that has been made in my above question. I have attempted to familiarise myself with the community and the rules of this site before asking this question and have searched extensively for an answer. \u003c/p\u003e\n\n\u003cp\u003eAny assistance would be appreciated. Thank you.)\u003c/p\u003e","accepted_answer_id":"41825408","answer_count":"2","comment_count":"0","creation_date":"2017-01-24 09:37:07.683 UTC","last_activity_date":"2017-01-24 11:09:15.473 UTC","last_edit_date":"2017-05-23 12:16:45.683 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"7461860","post_type_id":"1","score":"0","tags":"excel|vba|excel-vba|combobox","view_count":"39"} +{"id":"21497766","title":"getLine1Number() Returns blank, not null","body":"\u003cp\u003eI want to get Mobile Number of Device. I have used following code reference by \u003ca href=\"https://stackoverflow.com/users/176761/alex-volovoy\"\u003eAlex Volovoy's\u003c/a\u003e \u003cstrong\u003e\u003ca href=\"https://stackoverflow.com/a/2480307/1318946\"\u003eThis Link\u003c/a\u003e\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eTelephonyManager tMgr = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);\nString mPhoneNumber = tMgr.getLine1Number();\n\nLog.d(\"msg\", \"Phone : \"+mPhoneNumber);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eOUTPUT in Logcat:\u003c/strong\u003e\u003c/p\u003e\n\n\u003ch3\u003eWithout Simcard Phones Returns:\u003c/h3\u003e\n\n\u003cpre\u003e\u003ccode\u003e02-01 17:22:45.472: D/msg(29102): Phone : null\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003ch3\u003eWith Simcard:\u003c/h3\u003e\n\n\u003cpre\u003e\u003ccode\u003e02-01 17:22:45.472: D/msg(29102): Phone : \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have also taken permission in \u003cstrong\u003e\u003ccode\u003e\u0026lt;uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/\u0026gt;\u003c/code\u003e\u003c/strong\u003e in \u003cstrong\u003e\u003ccode\u003eAndroidManifest.xml\u003c/code\u003e\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eSo what should i do? Is there any Mistake?\u003c/p\u003e","accepted_answer_id":"21497906","answer_count":"2","comment_count":"0","creation_date":"2014-02-01 12:02:01.71 UTC","favorite_count":"1","last_activity_date":"2016-02-11 20:38:11.753 UTC","last_edit_date":"2017-05-23 11:47:02.487 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"1318946","post_type_id":"1","score":"10","tags":"android|telephonymanager","view_count":"17055"} +{"id":"11218036","title":"Forced transparent border on a div of pictures?","body":"\u003cp\u003eI have a div of pictures that will be updated frequently on wordpress. I don't want it to be necessary to edit the individual photo's border. (If you can vision it, it's kind of a dome shaped border around a group of 8 photos that I created by using the clipping mask on photoshop)\u003c/p\u003e\n\n\u003cp\u003eAgain, this is going to be used on wordpress. I'm wondering if it's super simple and some css trick that I can use to make the border.png file overlay the pictures div and become transparent, but block out the areas that it's covering on the picture div.\u003c/p\u003e\n\n\u003cp\u003eThanks so much, I hope someone can help!\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2012-06-27 01:06:24.063 UTC","last_activity_date":"2012-06-27 18:52:12.413 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2184437","post_type_id":"1","score":"0","tags":"css|wordpress|overlay|transparency|transparent","view_count":"142"} +{"id":"45813663","title":"Does Apple reject the app if Bundle Display Name and iTunes app name are not identical?","body":"\u003cp\u003eDoes Apple reject the app if Bundle Display Name and iTunes app name are not identical?\u003c/p\u003e\n\n\u003cp\u003eex : My app name is ABC, iTunes doesn't let me use it in App Store as it's already taken by someone else. So, I'm going to change it as ABC - My country name. \u003c/p\u003e\n\n\u003cp\u003eDoes it make a confusion to the user? And will my app get rejected by Apple? \u003c/p\u003e","accepted_answer_id":"45835761","answer_count":"1","comment_count":"1","creation_date":"2017-08-22 09:22:08.207 UTC","last_activity_date":"2017-08-23 09:26:02.687 UTC","last_edit_date":"2017-08-22 09:41:48.033 UTC","last_editor_display_name":"","last_editor_user_id":"2423794","owner_display_name":"","owner_user_id":"2423794","post_type_id":"1","score":"-1","tags":"app-store|itunes","view_count":"69"} +{"id":"37472324","title":"I am writing tests for users, and am getting this error:","body":"\u003cpre\u003e\u003ccode\u003e$ Rspec spec/models/user_spec.rb\n/usr/local/rvm/gems/ruby-2.3.1/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1361:\nin `load': /Users/Tish/Projects/trainer-project/spec/models/user_spec.rb:14:\nsyntax error, unexpected tIDENTIFIER, expecting keyword_end (SyntaxError)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ehere is user_spec.rb:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003erequire 'rails_helper'\n\nRSpec.describe User, type: :model do\n\n it \"requires a name\" do\n John = User.new(name: nil, email: 'me@gmail.com', password: 'password')\n expect(John).not_to_be_valid\n expect(John.errors[:name].any?).to_be_truthy\n end\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethe error message points to these lines saying it expects 'end', but end is there...\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e it \"requires an email\" do\n John = User.new(name: 'John', email: nil, password: 'password')\n expect(John).not_to_be_valid\n expect(John.errors[:email].any?)to_be_truthy\n end\n\n it \"requires a password\" do\n John = User.new(name: 'John', email: 'me@gmail.com', password: nil)\n expect(John).not_to_be_valid\n expect(John.errors[:password].any?)to_be_truthy\n end\nend\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"1","creation_date":"2016-05-26 22:54:28.21 UTC","last_activity_date":"2016-05-26 23:30:26.097 UTC","last_edit_date":"2016-05-26 23:30:26.097 UTC","last_editor_display_name":"","last_editor_user_id":"1469259","owner_display_name":"","owner_user_id":"2196662","post_type_id":"1","score":"0","tags":"ruby-on-rails|ruby","view_count":"40"} +{"id":"26044603","title":"Traversing a boost::ublas matrix using iterators","body":"\u003cp\u003eI simply want to traverse a matrix from start to finish touching upon every element. However, I see that there is no one iterator for boost matrix, rather there are two iterators, and I haven't been able to figure out how to make them work so that you can traverse the entire matrix\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e typedef boost::numeric::ublas::matrix\u0026lt;float\u0026gt; matrix;\n\n matrix m1(3, 7);\n\n for (auto i = 0; i \u0026lt; m1.size1(); i++)\n {\n for (auto j = 0; j \u0026lt; m1.size2(); j++)\n {\n m1(i, j) = i + 1 + 0.1*j;\n }\n }\n\n for (auto itr1 = m1.begin1(); itr1!= m1.end1(); ++itr1)\n { \n for (auto itr2 = m1.begin2(); itr2 != m1.end2(); itr2++)\n {\n //std::cout \u0026lt;\u0026lt; *itr2 \u0026lt;\u0026lt; \" \";\n //std::cout \u0026lt;\u0026lt; *itr1 \u0026lt;\u0026lt; \" \";\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis code of mine, prints only row1 of matrix using itr1 and only column1 of the matrix using itr2. What can be done to instead access all rows and columns? \u003c/p\u003e","accepted_answer_id":"26045280","answer_count":"1","comment_count":"0","creation_date":"2014-09-25 17:27:33.51 UTC","favorite_count":"1","last_activity_date":"2014-09-25 18:09:20.22 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3670482","post_type_id":"1","score":"3","tags":"c++|boost|matrix|iterator|ublas","view_count":"1630"} +{"id":"45851771","title":"Access-Control-Allow-Origin issues even on setting it up","body":"\u003cp\u003eMy nodejs/express includes:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eapp.use(function handleAppError(err, req, res, next) {\n const msg = 'ERROR: App error: ' + util.inspect(err);\n // Website you wish to allow to connect\n res.setHeader('Access-Control-Allow-Origin', '*');\n\n console.log(msg);\n if (res.headersSent) {\n next(err);\n } else {\n res.status(500).send(msg);\n }\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e…but on making a call, I still end up with an error in Chrome:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eXMLHttpRequest cannot load http://:8080/management-api/v1/bots.\n Response to preflight request doesn't pass access control check: No\n 'Access-Control-Allow-Origin' header is present on the requested\n resource. Origin '\u003ca href=\"http://localhost:8100\" rel=\"nofollow noreferrer\"\u003ehttp://localhost:8100\u003c/a\u003e' is therefore not allowed\n access.\u003c/p\u003e\n\u003c/blockquote\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-08-24 01:55:42.267 UTC","last_activity_date":"2017-08-24 03:50:37.8 UTC","last_edit_date":"2017-08-24 03:50:37.8 UTC","last_editor_display_name":"","last_editor_user_id":"441757","owner_display_name":"","owner_user_id":"135982","post_type_id":"1","score":"0","tags":"node.js|cors|preflight","view_count":"33"} +{"id":"39191052","title":"How to early exit a composition of Promises","body":"\u003cp\u003eI'd like to do something like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ereturn1stPromise()\n .then(if1stPromiseSucceeds) // returns 2nd Promise\n .catch(if1stPromiseFails)\n .then(if2ndPromiseSucceeds) // execute only if 1st Promise succeeds\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'd like the 2nd \u003ccode\u003e.then\u003c/code\u003e to execute only if 1st Promise succeeds. Or in different words - I don't want the 2nd \u003ccode\u003e.then\u003c/code\u003e to execute if the catch has been executed.\u003c/p\u003e\n\n\u003cp\u003eIs this even possible or do I have nest the 2nd promise inside the first \u003ccode\u003ethen\u003c/code\u003e like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ereturn1stPromise()\n .then(function (data) {\n return if1stPromiseSucceeds(data).then(if2ndPromiseSucceeds);\n })\n .catch(if1stPromiseFails);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn addition - any good resources on how to control flow with Promises where it's more thread like?\u003c/p\u003e","accepted_answer_id":"39191126","answer_count":"2","comment_count":"5","creation_date":"2016-08-28 12:00:53.937 UTC","favorite_count":"0","last_activity_date":"2016-08-28 12:53:53.683 UTC","last_edit_date":"2016-08-28 12:27:46.723 UTC","last_editor_display_name":"","last_editor_user_id":"36821","owner_display_name":"","owner_user_id":"36821","post_type_id":"1","score":"2","tags":"javascript|promise","view_count":"123"} +{"id":"2680288","title":"Freebase; select a random record?","body":"\u003cp\u003e1) Is there any way to select a random record from Freebase? If I do a limit of 1, it consistently returns the same record. I could grab the larger data set and select a random rec from that but that seems like overkill. Analogous to MySQL's :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eselect * from profiles order by rand() limit 1;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e2) Is there any way to tell Freebase not to select certain items in a set?\u003c/p\u003e\n\n\u003cp\u003eAnalogous to MySQL's :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eselect * from profiles where id NOT IN (SELECT profile_id from approved_profiles)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks in advance\u003c/p\u003e","accepted_answer_id":"2685330","answer_count":"1","comment_count":"0","creation_date":"2010-04-21 04:19:12.577 UTC","favorite_count":"3","last_activity_date":"2010-04-21 17:56:04.4 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"168083","post_type_id":"1","score":"2","tags":"freebase|mql","view_count":"275"} +{"id":"33225352","title":"Regex: how to separate strings by apostrophes in certain cases only","body":"\u003cp\u003eI am looking to capitalize the first letter of words in a string. I've managed to put together something by reading examples on here. However, I'm trying to get any names that start with O' to separate into 2 strings so that each gets capitalized. I have this so far:\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003e\\b([^\\W_\\d](?!')[^\\s-]*) *\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003ewhich omits selecting the X' from any string X'XYZ. That works for capitalizing the part after the ', but doesn't capitalize the X'. Further more, i'm becomes i'M since it's not specific to O'. To state the goal:\no'malley should go to O'Malley\no'malley's should go to O'Malley's\ndon't should go to Don't\ni'll should go to I'll\n(as an aside, I want to omit any strings that start with numbers, like 23F, that seems to work with what I have)\nHow to make it specific to the strings that start with O'? Thx\u003c/p\u003e","accepted_answer_id":"33225673","answer_count":"1","comment_count":"3","creation_date":"2015-10-19 23:00:07.92 UTC","last_activity_date":"2015-10-20 00:26:00.097 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5464822","post_type_id":"1","score":"1","tags":"regex","view_count":"38"} +{"id":"45107199","title":"Rails 5 with Devise - Devise User has_one Login","body":"\u003cp\u003eI am making a website for an existing database. This database is from a game and I can't make many changes in the existing tables. \u003c/p\u003e\n\n\u003cp\u003eI decided to use Devise as the authentication solution.\nI will use the User model from Devise for the website and the database has a Login table with some important informations.\u003c/p\u003e\n\n\u003cp\u003eThey will have a \u003cstrong\u003eone to one association\u003c/strong\u003e where the User has_one Login and the Login belongs to User.\u003c/p\u003e\n\n\u003cp\u003eI changed the User registration form to have some Login information. I used nested form for that. When I signup it should create the User and Login.\u003c/p\u003e\n\n\u003cp\u003eI'm trying this create part but it's not working. I tried many different ways but it never works. The two main problems are: \u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eit creates the User but do not create the Login\u003c/li\u003e\n\u003cli\u003eit creates both but the Login does not have the information that i\nput in the form. They are all blank\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eI tried many different ways:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eoverride the new method in the RegistrationController using resource.build_login\u003c/li\u003e\n\u003cli\u003eoverride sign_up_params method with permit inside\u003c/li\u003e\n\u003cli\u003eput the resource.build_login in the new view\u003c/li\u003e\n\u003cli\u003eoverride build_resource and put resource.build_login there\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eNone of them works.\u003c/p\u003e\n\n\u003cp\u003eI'm using Rails 5.0.2 and Devise 4.2.0.\u003c/p\u003e\n\n\u003cp\u003eThese are the models:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass Login \u0026lt; ApplicationRecord\n belongs_to :user\n # accepts_nested_attributes_for :user\nend\n\nclass User \u0026lt; ApplicationRecord\n devise :database_authenticatable, :registerable,\n :recoverable, :rememberable, :trackable, :validatable\n\n has_one :login\n # accepts_nested_attributes_for :login\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOne important question is where should I put the \u003cstrong\u003eaccepts_nested_attributes_for\u003c/strong\u003e? I saw people using it in the Model that has belong and I also saw people using in the has_one model.\u003c/p\u003e\n\n\u003cp\u003eThis is my RegistrationController:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass Users::RegistrationsController \u0026lt; Devise::RegistrationsController\n def new\n super\n resource.build_login\n end\n def create\n super\n end\n def sign_up_params\n params.require(resource_name).permit(:email, :password, \n :password_confirmation, login_attributes: \n [:userid, :birthdate, :sex])\n end\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd this is my view:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;%= simple_form_for(resource, as: resource_name, url: \n registration_path(resource_name)) do |f| %\u0026gt;\n \u0026lt;%= f.error_notification %\u0026gt;\n \u0026lt;%= f.input :email, required: true, autofocus: true, class: 'form-\n control' %\u0026gt;\n \u0026lt;%= f.input :password, required: true, hint: (\"No mínimo #\n {@minimum_password_length} caracteres\" if \n @minimum_password_length) %\u0026gt;\n \u0026lt;%= f.input :password_confirmation, required: true %\u0026gt;\n \u0026lt;%= f.simple_fields_for :login do |ff| %\u0026gt;\n \u0026lt;%= ff.input :userid %\u0026gt;\n \u0026lt;%= ff.input :birthdate %\u0026gt;\n \u0026lt;%= ff.label :sex %\u0026gt;\n \u0026lt;%= ff.input_field :sex, collection: [['Feminino', 'F'], \n ['Masculino', 'M']], class: 'form-control' %\u0026gt;\n \u0026lt;% end %\u0026gt;\n \u0026lt;%= f.button :submit, 'Cadastrar', class: 'btn btn-primary' %\u0026gt;\n\u0026lt;% end %\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI hope that all the information needed are there.\u003c/p\u003e\n\n\u003cp\u003eMost answers I found for this problem were to Rails 4 or Rails 3 and maybe they didn't work for me because I'm using Rails 5.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdit #1:\u003c/strong\u003e Added create method in RegistrationController.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdit #2:\u003c/strong\u003e With \u003ccode\u003eaccepts_nested_attributes_for\u003c/code\u003e in user the fields doesn't appear so I changed \u003ccode\u003eaccepts_nested_attributes_for\u003c/code\u003e to login model.\u003c/p\u003e\n\n\u003cp\u003eAnd here is the log for how the code is now:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eStarted POST \"/users\" for 127.0.0.1 at 2017-07-14 20:24:40 -0300\nProcessing by Users::RegistrationsController#create as HTML\n Parameters: {\"utf8\"=\u0026gt;\"✓\", \"authenticity_token\"=\u0026gt;\n \"habj5iep5SaE5nkyimzFyVslsCAIvy7ZokmM\n KA8WDgbgQkYCa/mofo83sllRiwX13OCkPXIjbkR+CcDKBICXOw==\",\n \"user\"=\u0026gt;{\"email\"=\u0026gt;\"breno@gmail.com\", \"password\"=\u0026gt;\"[FILTERED]\", \n \"password_confirmation\"=\u0026gt;\"[FILTERED]\", \"login\"=\u0026gt;\n {\"userid\"=\u0026gt;\"breno1\", \"birthdate\"=\u0026gt;\"13/07/2017\", \"sex\"=\u0026gt;\"M\"}}, \n \"commit\"=\u0026gt;\"Cadastrar\"}\nUnpermitted parameter: login\n(10.8ms) BEGIN\nUser Exists (10.1ms) SELECT 1 AS one FROM `users` WHERE \n `users`.`email` = BINARY 'breno@gmail.com' LIMIT 1\nSQL (11.5ms) INSERT INTO `users` (`email`, `encrypted_password`, \n `created_at`, `updated_at`) VALUES ('breno@gmail.com', \n '$2a$11$4le6ZB5JyrYZGYLXvtlwa.c6BA463BvNYkSINfU0C10LoJADEYJ8q', \n '2017-07-14 23:24:41', '2017-07-14 23:24:41')\n(18.3ms) COMMIT\n(12.6ms) BEGIN\nSQL (11.0ms) UPDATE `users` SET `sign_in_count` = 1, \n `current_sign_in_at` = '2017-07-14 23:24:41', `last_sign_in_at` = \n '2017-07-14 23:24:41', `current_sign_in_ip` = '127.0.0.1', \n `last_sign_in_ip` = '127.0.0.1' WHERE `users`.`id` = 33\n(11.6ms) COMMIT\nRedirected to http://localhost:3000/\nCompleted 302 Found in 436ms (ActiveRecord: 85.8ms)\n\n\nStarted GET \"/\" for 127.0.0.1 at 2017-07-14 20:24:41 -0300\nProcessing by HomeController#index as HTML\nRendering home/index.html.erb within layouts/application\nRendered home/index.html.erb within layouts/application (0.7ms)\nUser Load (13.7ms) SELECT `users`.* FROM `users` WHERE `users`.`id` \n = 33 ORDER BY `users`.`id` ASC LIMIT 1\nLogin Load (11.1ms) SELECT `login`.* FROM `login` WHERE \n `login`.`user_id` = 33 LIMIT 1\nRendered layouts/_side_navbar.html.erb (26.0ms)\nCompleted 500 Internal Server Error in 619ms (ActiveRecord: 24.8ms)\n\n\n\nActionView::Template::Error (undefined method `userid' for \n nil:NilClass):\n4: \u0026lt;div class=\"sidenav-header-inner text-center\"\u0026gt;\n5: \u0026lt;%= image_tag 'avatar-1.jpg', class: 'img-fluid rounded-\n circle' %\u0026gt;\n6: \u0026lt;h2 class=\"h5 text-uppercase\"\u0026gt;\n7: \u0026lt;%= current_user.login.userid %\u0026gt;\n8: \u0026lt;/h2\u0026gt;\n9: \u0026lt;span class=\"text-uppercase\"\u0026gt;\n10: \u0026lt;%= current_user.is_admin? ? 'administrador' : 'jogador' \n %\u0026gt;\n\napp/views/layouts/_side_navbar.html.erb:7:in \n`_app_views_layouts__side_navbar_html_erb__415501206315934300_\n 70011534596860'\napp/views/layouts/application.html.erb:13:in \n`_app_views_layouts_application_html_erb__1458307398416558594_\n 70011827322320'\nRendering /home/prikster/.rvm/gems/ruby-2.3.1/gems/actionpack-\n 5.0.2/lib/action_dispatch/middleware/templates/rescues/\n template_error.html.erb within rescues/layout\nRendering /home/prikster/.rvm/gems/ruby-2.3.1/gems/actionpack-\n 5.0.2/lib/action_dispatch/middleware/templates/rescues/\n _source.html.erb\nRendered /home/prikster/.rvm/gems/ruby-2.3.1/gems/actionpack-\n 5.0.2/lib/action_dispatch/middleware/templates/rescues/\n _source.html.erb (32.9ms)\nRendering /home/prikster/.rvm/gems/ruby-2.3.1/gems/actionpack-\n 5.0.2/lib/action_dispatch/middleware/templates/rescues/\n _trace.html.erb\nRendered /home/prikster/.rvm/gems/ruby-2.3.1/gems/actionpack-\n 5.0.2/lib/action_dispatch/middleware/templates/rescues/\n _trace.html.erb (5.0ms)\nRendering /home/prikster/.rvm/gems/ruby-2.3.1/gems/actionpack-\n 5.0.2/lib/action_dispatch/middleware/templates/rescues/\n _request_and_response.html.erb\nRendered /home/prikster/.rvm/gems/ruby-2.3.1/gems/actionpack-\n 5.0.2/lib/action_dispatch/middleware/templates/rescues/\n _request_and_response.html.erb (1.7ms)\nRendered /home/prikster/.rvm/gems/ruby-2.3.1/gems/actionpack-\n 5.0.2/lib/action_dispatch/middleware/templates/rescues/\n template_error.html.erb within rescues/layout (62.6ms)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs \u003ccode\u003eaccepts_nested_attributes_for\u003c/code\u003e in the right model?\u003c/p\u003e\n\n\u003cp\u003eIn the log there is a line pointing to an \u003ccode\u003eUnpermitted parameter: login\u003c/code\u003e. What should I do to correct this?\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2017-07-14 15:57:59.847 UTC","last_activity_date":"2017-07-15 03:25:34.11 UTC","last_edit_date":"2017-07-14 23:38:33.857 UTC","last_editor_display_name":"","last_editor_user_id":"7999165","owner_display_name":"","owner_user_id":"7999165","post_type_id":"1","score":"0","tags":"ruby-on-rails|devise|nested-forms|accepts-nested-attributes","view_count":"66"} +{"id":"40666801","title":"Why does scala.beans.beanproperty work differently in spark","body":"\u003cp\u003eIn a scala REPL the following code\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport scala.beans.BeanProperty\n\nclass EmailAccount {\n @scala.beans.BeanProperty var accountName: String = null\n\n override def toString: String = {\n return s\"acct ($accountName)\"\n }\n}\nclassOf[EmailAccount].getDeclaredConstructor()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eresults in \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eres0: java.lang.reflect.Constructor[EmailAccount] = public EmailAccount()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ehowever in spark's REPL I get\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ejava.lang.NoSuchMethodException: EmailAccount.\u0026lt;init\u0026gt;()\n at java.lang.Class.getConstructor0(Class.java:2810)\n at java.lang.Class.getDeclaredConstructor(Class.java:2053)\n ... 48 elided\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat causes this discrepancy? How can I get spark to match the behavior of the spark shell.\u003c/p\u003e\n\n\u003cp\u003eI launched the REPLs like so:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e/home/placey/Downloads/spark-2.0.0-bin-hadoop2.7/bin/spark-shell --master local --jars /home/placey/snakeyaml-1.17.jar\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003escala -classpath \"/home/placey/snakeyaml-1.17.jar\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eScala versions are \nspark:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eUsing Scala version 2.11.8 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_55)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003escala:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eWelcome to Scala version 2.11.6 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_55).\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"40689204","answer_count":"1","comment_count":"0","creation_date":"2016-11-17 23:19:59.523 UTC","last_activity_date":"2016-11-19 04:26:14.61 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1269969","post_type_id":"1","score":"1","tags":"scala|apache-spark|javabeans","view_count":"80"} +{"id":"40004453","title":"Is this number a power of two?","body":"\u003cp\u003eI have a number (in base 10) represented as a string with up to 10^6 digits. I want to check if this number is a power of two. One thing I can think of is binary search on exponents and using FFT and fast exponentiation algorithm, but it is quite long and complex to code. Let n denote the length of the input (i.e., the number of decimal digits in the input). What's the most efficient algorithm for solving this problem, as a function of n?\u003c/p\u003e","answer_count":"3","comment_count":"8","creation_date":"2016-10-12 17:07:58.207 UTC","favorite_count":"2","last_activity_date":"2016-10-14 20:00:40.82 UTC","last_edit_date":"2016-10-13 16:26:35.32 UTC","last_editor_display_name":"","last_editor_user_id":"4201961","owner_display_name":"","owner_user_id":"4201961","post_type_id":"1","score":"3","tags":"algorithm|binary","view_count":"197"} +{"id":"16131358","title":"show data from multiple table order by datetime","body":"\u003cp\u003eI have a php page and want to display data from multiple tables (currently 3 tables)\u003cbr\u003e\nall tables have date-time column\u003cbr\u003e\nand other columns are totally different (in numbers \u0026amp; data-type etc)\nI want to display\u003cbr\u003e\nmost recent row from either of three tables\u003cbr\u003e\n2nd most recent row from either of three tables\u003cbr\u003e\n3rd most recent row from either of three tables\u003cbr\u003e\nand so on \u003c/p\u003e\n\n\u003cp\u003emy tables structure is like below \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eATTANDANCE [a_id,date-time,employee,attandance_more....] \n\nTASKS_ASSIGN[ta_id,date-time,employee,title,detail,duration,task_assign_more.....]\n\nTASK_COMPLETED [tc_id,date-time,employee,stars,task_completed_more....] \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ei want to display as facebook as \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Alam has joined office at 23-mar-2013 **08:00am** \n Haider has joined office at 23-mar-2013 **08:01am** \n Alam has completed xyz-task at 22-mar-2013 **03:45pm**\n Alam has joined office at 22-mar-2013 **10:12am**\n ......\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"16131581","answer_count":"2","comment_count":"4","creation_date":"2013-04-21 12:58:02.723 UTC","last_activity_date":"2013-04-21 13:24:37.203 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2287589","post_type_id":"1","score":"0","tags":"php|mysql|sql-order-by","view_count":"684"} +{"id":"11693666","title":"bootstrap modal dialog from another modal dialog","body":"\u003cp\u003eI am using the twitter bootstrap modal plugin and I have a modal dialog from which, on the click of a button, I want to show a smaller modal dialog.\u003c/p\u003e\n\n\u003cp\u003eWhat is happening is that my second smaller modal dialog is not really modal, because I can still access the first dialog underneath it ( click buttons select text etc..)\u003c/p\u003e\n\n\u003cp\u003eI do have the data-backdrop=\"static\" attribute setup for the second modal dialog but it does not seem to work properly.\u003c/p\u003e\n\n\u003cp\u003eIs this normal behavior ?\u003c/p\u003e","accepted_answer_id":"11693806","answer_count":"2","comment_count":"0","creation_date":"2012-07-27 18:32:21.683 UTC","favorite_count":"1","last_activity_date":"2013-03-07 19:47:29.69 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"130211","post_type_id":"1","score":"1","tags":"twitter-bootstrap|modal-dialog","view_count":"2785"} +{"id":"12692071","title":"Jenkins Amazon EC2 agent cloud - Windows slaves","body":"\u003cp\u003eI need to create Jenkins agent cloud which runs under Windows VMs on Amazon EC2.\u003c/p\u003e\n\n\u003cp\u003eMy view of this is simple scenario:\u003c/p\u003e\n\n\u003cp\u003eI have few of pre-configures AMIs, each of VM have specific environment which matches one of my projects. I have few projects to build often enough to keep VM running. But some builds will run weekly, others mounthly... Jenkins should be able to start VM automatically when project should be built and terminate VM when build is completed. I have several BCB projects and many .NET projects, Windows as slave VM OS is absolutely necessary.\u003c/p\u003e\n\n\u003cp\u003eIt is not a problem to prepare pre-configured AMI where Jenkins slave is installed and configured. But I have no idea how to manage such slave VMs from master (run/terminate them)\u003c/p\u003e\n\n\u003cp\u003eI found Amazon EC2 plugin which can be used to run and terminate VMs. But it also tries to install and run slave there. Unfortunately, windows slaves are not supported yet.\nIs there a way to use pre-configured AMIs or let Amazon EC2 plugin install agent on Windows VM?\u003c/p\u003e\n\n\u003cp\u003eI tried to use TeamCity also - it can run pre-configured windows AMI and build projects there (exact my scenario). But I need too many VMs and my boss is not ready to pay for licenses (3 free licenses are not enough)\u003c/p\u003e\n\n\u003cp\u003eIs it possible to use Jenkins for my scenario? Is it any other alternatives?\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2012-10-02 14:17:35.19 UTC","favorite_count":"2","last_activity_date":"2014-06-09 19:39:20.09 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"820349","post_type_id":"1","score":"6","tags":".net|continuous-integration|jenkins|build-automation","view_count":"1089"} +{"id":"40122967","title":"Place twilio call on hold","body":"\u003cp\u003eI have an existing softphone dialer using the php \u0026amp; javascript sdk's. It accepts \u0026amp; makes calls without problems.\u003c/p\u003e\n\n\u003cp\u003eI'm trying to add 'hold' functionality to the dialer, however every time i try to update the call's url:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$call = $client\n -\u0026gt;calls($_REQUEST['callSid'])\n -\u0026gt;update(['url' =\u0026gt; '/hold-queue]);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand \u003ccode\u003e/hold-queue\u003c/code\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;Response\u0026gt;\n \u0026lt;Enqueue waitUrl=\"/hold-music\"\u0026gt;test\u0026lt;/Enqueue\u0026gt;\n\u0026lt;/Response\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe external phone is disconnected and the soft phone is placed into the queue instead.\u003c/p\u003e\n\n\u003cp\u003eEven if I dont try the \u003ccode\u003e\u0026lt;Enqueue\u0026gt;\u003c/code\u003e and use a simple \u003ccode\u003e\u0026lt;Play\u0026gt;\u003c/code\u003e tag I still have this problem.\u003c/p\u003e\n\n\u003cp\u003eI need to apply the twiml to the context of the external caller, not the soft phone.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-10-19 05:35:55.017 UTC","last_activity_date":"2016-10-20 09:25:17.497 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"123429","post_type_id":"1","score":"0","tags":"javascript|php|twilio|twilio-php","view_count":"117"} +{"id":"46815507","title":"Buffer is too large error despite assigning ReliableFragmented channel to Network Manager","body":"\u003cp\u003eI'm having trouble with sending an image file that's around 1.5 mb across my network. I have configured NetworkManager to use QoSType ReliableFragmented, but it's apparently not working. What am I doing wrong? Code and screenshot of NetworkManager component attached.\u003c/p\u003e\n\n\u003cp\u003eThe error I'm receving is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eNetworkWriter WriteBytes: buffer is too large (1699064) bytes. The maximum buffer size is 64K bytes.\nUnityEngine.Networking.NetworkWriter:WriteBytesFull(Byte[])\nTextureMessage:Serialize(NetworkWriter)\nUnityEngine.Networking.NetworkServer:SendToAll(Int16, MessageBase)\nServer:SendTexture(Texture2D, String) (at Assets/Scripts/Server.cs:41)\nServer:SendOnButtonPress() (at Assets/Scripts/Server.cs:28)\nUnityEngine.EventSystems.EventSystem:Update()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCode to start network and serialize data\u003c/p\u003e\n\n\u003cp\u003eTextureMessage.cs\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eusing UnityEngine.Networking;\n\npublic class TextureMessage : MessageBase\n{\n public byte[] textureBytes;\n public string message; //Optional\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMyMsgType.cs\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eusing UnityEngine.Networking;\n\npublic class MyMsgType\n{\n public static short texture = MsgType.Highest + 1;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eServer.cs\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eusing System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\nusing UnityEngine.Networking;\n\npublic class Server : MonoBehaviour {\n\n public Texture2D textureToSend;\n string messageToSend = \"Test Message\";\n\n // Use this for initialization\n void Start ()\n {\n NetworkManager.singleton.StartHost();\n Debug.Log(\"Server Started.\");\n }\n\n public void SendOnButtonPress()\n {\n SendTexture(textureToSend, messageToSend);\n }\n\n //Call to send the Texture and a simple string message\n public void SendTexture(Texture2D texture, string message)\n {\n TextureMessage msg = new TextureMessage();\n\n //Convert Texture2D to byte array\n\n msg.textureBytes = texture.GetRawTextureData();\n msg.message = message;\n\n NetworkServer.SendToAll(MyMsgType.texture, msg);\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/56hsd.jpg\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/56hsd.jpg\" alt=\"Network Manager Component\"\u003e\u003c/a\u003e\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2017-10-18 17:00:46.573 UTC","last_activity_date":"2017-10-18 19:57:47.17 UTC","last_edit_date":"2017-10-18 18:26:40.08 UTC","last_editor_display_name":"","last_editor_user_id":"2037258","owner_display_name":"","owner_user_id":"2037258","post_type_id":"1","score":"0","tags":"c#|unity3d|networking|networkmanager","view_count":"37"} +{"id":"36124515","title":"Sonarqube integration in hudson and SVN","body":"\u003cp\u003eI am trying to run sonarqube as part of a hudson job. I installed sonarqube 5.4 and sonar plugin 2.0.1 in hudson. \u003c/p\u003e\n\n\u003cp\u003eBut when the job runs I get the following error, where do I provide SVN authentication details for Sonar? \u003c/p\u003e\n\n\u003cp\u003eI already provided SVN details as part of my job but sonar is unable to read that properties.\u003c/p\u003e\n\n\u003cp\u003eCan't I make sonar to read source downloaded by hudson instead of again trying to connect to SVN?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eFailed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.1:sonar (default-cli) on project MyProject: Error when executing blame for file Myfile.java: svn: E170001: Authentication required for ' Subversion repository' \n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"36127184","answer_count":"1","comment_count":"1","creation_date":"2016-03-21 06:31:26.633 UTC","last_activity_date":"2016-03-21 09:27:16.473 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4702372","post_type_id":"1","score":"1","tags":"svn|jenkins|sonarqube|hudson|sonar-runner","view_count":"1080"} +{"id":"22200432","title":"Surrogate key in pig script","body":"\u003cp\u003eI have a requirement to convert an existing ETL flow to Pig script, am trying to keep my dimensions in hdfs so that I no need to look at database when i load my fact table. Here am facing problem , am not able to create surrogate key for new dimension records. Is it possible to create surrogate key in pig ? If yes, please let me know how to create surrogate key.\u003c/p\u003e\n\n\u003cp\u003eThanks\nSelvam\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-03-05 14:22:36.637 UTC","last_activity_date":"2014-03-15 00:44:58.54 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3350280","post_type_id":"1","score":"2","tags":"hadoop|hive|apache-pig|sqoop","view_count":"1999"} +{"id":"20219527","title":"Batch file set wmi output as a variable","body":"\u003cp\u003eHello having my first go with a BATCH script, I'm getting the size of the HDD as follow:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ewmic diskdrive get size\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhich works fine but I'd like to store this value into a variable for later use, such as using ECHO to display the value.\u003c/p\u003e\n\n\u003cp\u003eI'm not sure how I set the output of the above command to a variable. I went with:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSET hddbytes=wmic diskdrive get size\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut this just sets the variable to the above text string and not the output.\u003c/p\u003e","accepted_answer_id":"20219840","answer_count":"3","comment_count":"2","creation_date":"2013-11-26 14:16:48.567 UTC","last_activity_date":"2013-12-05 00:38:40.907 UTC","last_edit_date":"2013-12-05 00:38:40.907 UTC","last_editor_display_name":"","last_editor_user_id":"2299431","owner_display_name":"","owner_user_id":"1005169","post_type_id":"1","score":"6","tags":"windows|batch-file","view_count":"21895"} +{"id":"32150369","title":"java - Calling a PL/SQL Stored Procedure With Arrays","body":"\u003cp\u003eI have a PL/SQL stored procedure similar to the following that I need to call in Java:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eTYPE AssocArrayVarchar20_t is table of VARCHAR2(20) index by BINARY_INTEGER\nTYPE AssocArrayVarchar4100_t is table of VARCHAR2(4100) index by BINARY_INTEGER\nTYPE AssocArrayNumber_t is table of NUMBER index by BINARY_INTEGER\n\nPROCEDURE DATA_WRITE( I_NAME IN AssocArrayVarchar20_t,\n I_NUM IN AssocArrayNumber_t,\n I_NOTE IN AssocArrayVarchar4100_t)\n // Do Stuff\nEND DATA_WRITE;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI tried the following in Java:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCallableStatement stmt = conn.prepareCall(\"begin DATA_WRITE(?, ?, ?); end;\");\nstmt.setArray(0, conn.createArrayOf(\"VARCHAR\", new String[]{ name }));\nstmt.setArray(1, conn.createArrayOf(\"NUMBER\", new Integer[]{ num }));\nstmt.setArray(2, conn.createArrayOf(\"VARCHAR2\", new String[]{ notes }));\nstmet.execute;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I do this I get a \u003ccode\u003eSQLException: Unsupported Feature\"\u003c/code\u003e on the \u003ccode\u003ecreateArrayOf()\u003c/code\u003e method. I've also tried \u003ccode\u003esetObject()\u003c/code\u003e and inside of \u003ccode\u003ecreateArrayOf\u003c/code\u003e: \u003ccode\u003e\"varchar\"\u003c/code\u003e, \u003ccode\u003e\"AssocArrayVarchar20_t\"\u003c/code\u003e, \u003ccode\u003e\"varchar_t\"\u003c/code\u003e. Nothing seems to change that outcome.\u003c/p\u003e\n\n\u003cp\u003eDoes anyone know what I'm doing wrong? I can't seem to get it to work.\u003c/p\u003e\n\n\u003cp\u003eUPDATE: Success!\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eOracleCallableStatement pStmt = (OracleCallableStatement) conn.prepareCall(\"begin DATA_WRITE(?, ?, ?); end;\");\npStmt.setPlsqlIndexTable(1, new String[]{ name }, 1, 1, OracleTypes.VARCHAR, 20);\npStmt.setPlsqlIndexTable(2, new Integer[]{ num }, 1, 1, OracleTypes.NUMBER, 0);\npStmt.setPlsqlIndexTable(3, new String[]{ notes }, 1, 1, OracleTypes.VARCHAR, 4100);\npStmt.execute();\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"32150569","answer_count":"2","comment_count":"1","creation_date":"2015-08-21 22:50:50.453 UTC","last_activity_date":"2016-01-19 13:47:49.537 UTC","last_edit_date":"2015-08-24 18:43:13.89 UTC","last_editor_display_name":"","last_editor_user_id":"3499973","owner_display_name":"","owner_user_id":"3499973","post_type_id":"1","score":"2","tags":"java|oracle|jdbc|plsql|associative-array","view_count":"2635"} +{"id":"6526512","title":"Hibernate HQL Query Subselects or Joins","body":"\u003cp\u003eIn a custom blog platform with User(s), Post(s), and Message(s).\nI know how to do an HQL query with distinct Users and their Post count. Also distinct Users and their Message count.\u003c/p\u003e\n\n\u003cp\u003eBut if I combine the two with \"inner join\" technique I get the same count for Posts and Messages. I understand why this is happening because of the joins. How could I do sub-selects in the HQL to get the two counts as separately but as one trip to the database?\u003c/p\u003e\n\n\u003cp\u003eHere is an example of the last HQL query I tried.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e select u.username, count(m), count(p) from User as u \n inner join u.Messages as m\n inner join u.Posts as p\n group by u.id \n order by count(m) desc\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNote: I will be changing the order by based off of an option on a web page.\u003c/p\u003e","accepted_answer_id":"6526783","answer_count":"1","comment_count":"2","creation_date":"2011-06-29 20:00:34.553 UTC","last_activity_date":"2012-09-05 11:12:57.663 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"36590","post_type_id":"1","score":"0","tags":"java|hibernate|hql","view_count":"3003"} +{"id":"31998654","title":"Access iframe elements after refresh","body":"\u003cp\u003eI am trying to extract data from a school peoplesoft portal page with an iframe element. \nOn the Homepage, the page source has the iframe element. When I click on a button to leave that page(i.e. search classes) the page source stays the same but the elements on the page are different(observed using inspect element). \nI can access elements on the homepage, but not any of the others because I don't think I take into account the reloading of data/injection of other elements in the iframe. How can I access the elements post reload?\nthis is the snippet i'm using to access elements:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar iframe = document.getElementById(\"id of iframe\");\nvar innerDoc = iframe.contentDocument || iframe.contentWindow.document;\nvar element = innerDoc.getElementById(\"name of id desired in iframe\");\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"31998729","answer_count":"1","comment_count":"0","creation_date":"2015-08-13 21:22:01.91 UTC","last_activity_date":"2015-08-14 12:37:47.487 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5222488","post_type_id":"1","score":"0","tags":"javascript|dom|iframe|peoplesoft","view_count":"111"} +{"id":"46382505","title":"Modeling optional filter params in react-apollo","body":"\u003cp\u003eI am using \u003ca href=\"https://github.com/apollographql/react-apollo\" rel=\"nofollow noreferrer\"\u003e\u003ccode\u003ereact-apollo\u003c/code\u003e\u003c/a\u003e to access a \u003ccode\u003egraphql\u003c/code\u003e in a web app.\u003c/p\u003e\n\n\u003cp\u003eI have a query that looks like this that allows me to filter a schedule of games:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003equery($pagination:Int!, $divisionId:ID, $teamId:ID, $startDate:DateTime!, $endDate:DateTime!\n){\n games: allGames (\n orderBy: date_ASC,\n first: $pagination,\n filter: {\n date_gte: $startDate,\n date_lte: $endDate,\n division: {id: $divisionId},\n OR: [\n {homeTeam: {id: $teamId} },\n {awayTeam: {id: $teamId} },\n ]\n }\n){\n id\n .... more fields\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe \u003ccode\u003estartDate\u003c/code\u003e and \u003ccode\u003eendDate\u003c/code\u003e variables are required for every request, but the \u003ccode\u003eteamId\u003c/code\u003e and \u003ccode\u003edivisionId\u003c/code\u003e are not. I would like to display all \u003ccode\u003eteamIds\u003c/code\u003e and \u003ccode\u003edivisionIds\u003c/code\u003e in the initial request, and allow the use to filter / drill down as needed.\u003c/p\u003e\n\n\u003cp\u003eI was looking to see if I could add a wildcard (\u003ccode\u003e*\u003c/code\u003e) or something of that sort, but I am not sure if it's possible. With graphql mutations, a \u003ccode\u003enull\u003c/code\u003e value for a variable allows me to write a single mutation that is applicable to multiple use cases (partial updates \u0026amp; creates), but I cannot figure out how to achieve similar functionality with queries.\u003c/p\u003e\n\n\u003cp\u003eDo I need to call a different query for each of the filter scenarios (one for no \u003ccode\u003edivisionId\u003c/code\u003e \u0026amp; \u003ccode\u003eteamId\u003c/code\u003e, one for just divisionId, one for just \u003ccode\u003eteamId\u003c/code\u003e, and one for both \u003ccode\u003edivisionId\u003c/code\u003e and \u003ccode\u003eteamId\u003c/code\u003e? Are \u003ca href=\"http://dev.apollodata.com/react/fragments.html\" rel=\"nofollow noreferrer\"\u003efragments\u003c/a\u003e something that would help me achieve this with less overhead (because the last sentence makes the process seem a bit too cumbersome / not DRY).\u003c/p\u003e\n\n\u003cp\u003eOr do i switch \u003ccode\u003edivision\u003c/code\u003e and \u003ccode\u003eid\u003c/code\u003e to \u003ccode\u003edivision_in\u003c/code\u003e and \u003ccode\u003eid_in\u003c/code\u003e and pass them (somewhat large) arrays with all the possible values for \u003ccode\u003edivisionIds\u003c/code\u003e and \u003ccode\u003eteamdIds\u003c/code\u003e as initial props? \u003c/p\u003e","accepted_answer_id":"46386940","answer_count":"1","comment_count":"0","creation_date":"2017-09-23 17:41:03.073 UTC","last_activity_date":"2017-09-24 05:35:16.537 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5045662","post_type_id":"1","score":"0","tags":"reactjs|graphql|apollo|react-apollo","view_count":"37"} +{"id":"4109025","title":"why does datagridview disappear after refreshing twice?","body":"\u003cp\u003eon form load, my datagridview display a datatable. once the user clicks the delete button, it deletes one of the rows in the data source:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate void btnDelete_Click(object sender, EventArgs e)\n {\n Int32 selectedRowCount =\n dataGridView1.Rows.GetRowCount(DataGridViewElementStates.Selected);\n if (selectedRowCount == 1)\n {\n\n\n qResults.Rows.RemoveAt(dataGridView1.SelectedRows[0].Index);\n chart1.DataSource = qResults;\n InitializeChart();\n\n dataGridView1.Columns.Clear();\n dataGridView1.DataBindings.Clear();\n dataGridView1.DataSource = qResults;\n\n\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethe first time i click this button, it works. it deletes the datapoint from the source and refreshes the chart. however, the second time i click it, it completely wipes out the datagridview and display NOTHING. \u003cstrong\u003ebut please note that the chart displays correctly\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eanyone know what am i donig wrong?\u003c/p\u003e","accepted_answer_id":"4109072","answer_count":"1","comment_count":"0","creation_date":"2010-11-05 18:42:24.693 UTC","last_activity_date":"2010-11-05 18:49:29.1 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"117700","post_type_id":"1","score":"1","tags":"c#|.net|data-binding","view_count":"878"} +{"id":"7594973","title":"Language Oriented Programming Articles/Papers/Tutorials","body":"\u003cp\u003eThere is number of tools on the market like MPS, that promote Language Oriented Programming, which supposedly gives ability to programmer to design a (ideal?)language for task. This sounds interesting and boring at same time for some reason, so I was wondering if anyone know and can recommend articles regarding subject.\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","accepted_answer_id":"7595983","answer_count":"3","comment_count":"0","creation_date":"2011-09-29 09:08:18.597 UTC","favorite_count":"4","last_activity_date":"2011-10-30 04:07:43.077 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"462076","post_type_id":"1","score":"4","tags":"programming-languages|computer-science|dsl|mps","view_count":"267"} +{"id":"37823718","title":"1 to many select and concat","body":"\u003cp\u003eI have two tables:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[customer]\nid\nname\n\n[customer_photo]\nid\ncustomer_id\nphoto\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to select all customers and their photos.\u003c/p\u003e\n\n\u003cp\u003eThis query is doing it, but getting only users who have at least one photo:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT customer.id, name, GROUP_CONCAT(cp.photo) as photos \nFROM customer \nJOIN customer_photo cp ON cp.customer_id = customer.id \nGROUP BY customer.id\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to get all users, even if they don't have a photo.\u003c/p\u003e","accepted_answer_id":"37823781","answer_count":"1","comment_count":"1","creation_date":"2016-06-14 23:22:54.613 UTC","last_activity_date":"2016-06-14 23:28:28.49 UTC","last_edit_date":"2016-06-14 23:27:51.063 UTC","last_editor_display_name":"","last_editor_user_id":"6466877","owner_display_name":"","owner_user_id":"6466877","post_type_id":"1","score":"0","tags":"mysql|sql","view_count":"20"} +{"id":"27680521","title":"Is cache.xml mandatory to have in ehcache?","body":"\u003cp\u003eI want to start using ehcache-1.2.3.jar in my project. But I want to know if it is mandatory to build cache.xml?\u003c/p\u003e\n\n\u003cp\u003eIf yes then why and If no then what situations it might be useful to build cache.xml.\nFollowing is sample code.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e CacheManager.getInstance().addCache(\"MyCache\");\n Cache c= CacheManager.getInstance().getCache(\"MyCache\");\n Employee emp=new Employee();\n emp.setEmpName(\"Ramji\");\n Element e=new Element(\"emp\", emp);\n c.put(e );\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"1","creation_date":"2014-12-28 20:57:24.457 UTC","last_activity_date":"2014-12-28 21:08:50.37 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3431369","post_type_id":"1","score":"1","tags":"java|java-ee|ehcache","view_count":"104"} +{"id":"29341925","title":"Setting user ip using Mixpanel PHP library","body":"\u003cp\u003eI'm setting user details using Mixpanel PHP library ($mixpanel-\u003epeople-\u003eset). It works fine, email, registration date etc. are set correctly.\u003c/p\u003e\n\n\u003cp\u003eHowever the location (Country, City, Tomezone) attributes are all wrong. I believe this could be solved by setting the user IP somehow (since we're seding a \"hit\" from backend and our server IP might be used by default). The problem is Mixpanel API reference doesn't mention this even once.\u003c/p\u003e\n\n\u003cp\u003eHow can this be achieved? How can I set the IP address for my Mixpanel users?\u003c/p\u003e\n\n\u003cp\u003eThank you\u003c/p\u003e","accepted_answer_id":"29342075","answer_count":"1","comment_count":"0","creation_date":"2015-03-30 08:50:34.567 UTC","last_activity_date":"2015-03-30 08:58:12.58 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2012546","post_type_id":"1","score":"1","tags":"php|ip|mixpanel","view_count":"459"} +{"id":"15021681","title":"Accesing Excel Table (ListObject) by Linq","body":"\u003cp\u003eI need to create a table in Excel (programatically) and then access the \u003ccode\u003eListObject\u003c/code\u003e that the table is based on by Linq. It must be done as fast as possible. I have dug through tons of examples and I cannot find a solution that satisfies me. Most Linq queries to Excel data require openXML and acces to the whole file. I need to do this in application-level addin with acces to specific worksheet. \u003c/p\u003e\n\n\u003cp\u003eI also thought of binding \u003ccode\u003eListObject\u003c/code\u003e to data table and then use Linq. But I cannot bind \u003ccode\u003eDataTable\u003c/code\u003e to \u003ccode\u003eListObject\u003c/code\u003e that alredy exist (the data table would erase the data in \u003ccode\u003eListObject\u003c/code\u003e)\u003c/p\u003e\n\n\u003cp\u003eHas anyone tried this before ?\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2013-02-22 10:13:00.27 UTC","favorite_count":"1","last_activity_date":"2013-02-22 21:30:58.807 UTC","last_edit_date":"2013-02-22 21:30:58.807 UTC","last_editor_display_name":"","last_editor_user_id":"1193333","owner_display_name":"","owner_user_id":"1658223","post_type_id":"1","score":"1","tags":"linq|excel|vsto|listobject","view_count":"423"} +{"id":"19060648","title":"How do I reverse something broken on an iOS / XCode project? How do I tell Xcode, \"Try it again, for the first time!\"?","body":"\u003cp\u003eI have been working with an iOS application in Xcode and, until about an hour ago, was steadily improving the software, and making Time Machine backups every hour or two. Then, as mentioned at \u003ca href=\"https://stackoverflow.com/questions/19059971/what-is-causing-this-secondary-damage#19060037\"\u003eWhat is causing this secondary damage?\u003c/a\u003e , I broke something and the problem was alleged in old boilerplate code.\u003c/p\u003e\n\n\u003cp\u003eI thought that I would use Time Machine to restore a \"last known good\" checkpoint, but Time Machine said I didn't have permissions. So I manually copied the past two or so known good backups, and Xcode claimed identical build errors, in the same two lines of boilerplate project code.\u003c/p\u003e\n\n\u003cp\u003eIt seems to me that Xcode stores more state than in the project directory itself.\u003c/p\u003e\n\n\u003cp\u003eIs there a way to get Xcode to forget it knows the syntax errors, let go of that state completely, and process the code as of the last checkpoint or two where things have been working?\u003c/p\u003e\n\n\u003cp\u003eI'd appreciate knowing how to reset whatever state is finding those syntax errors in old and new versions of the project.\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2013-09-27 21:51:08.963 UTC","last_activity_date":"2013-09-28 00:46:50.167 UTC","last_edit_date":"2017-05-23 12:32:50.25 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"116906","post_type_id":"1","score":"0","tags":"xcode|version-control|timemachine","view_count":"485"} +{"id":"21134759","title":"android setting password type with custom font","body":"\u003cp\u003eI have used this code to set textType = password.\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003emInputText.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eI however it ruins my custom font for the editText.\u003c/p\u003e\n\n\u003cp\u003eHow can I combine them both?\u003c/p\u003e","accepted_answer_id":"21134931","answer_count":"2","comment_count":"1","creation_date":"2014-01-15 10:20:55.853 UTC","last_activity_date":"2014-01-15 12:37:04.04 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1065869","post_type_id":"1","score":"2","tags":"java|android|textview","view_count":"858"} +{"id":"16706548","title":"Twilio sms not coming in mobile","body":"\u003cp\u003eI have implemented test twilio sms application. I have downloaded three files from \u003ca href=\"https://github.com/benedmunds/CodeIgniter-Twilio\"\u003ehttps://github.com/benedmunds/CodeIgniter-Twilio\u003c/a\u003e \u003c/p\u003e\n\n\u003cp\u003eI have used my account_sid, auth_token in twilio.php file which is in config folder. I have also used 'from' number as +15005550006 in that file.\u003c/p\u003e\n\n\u003cp\u003eI have used following codes in my controller \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');\n\nclass Twiliosms extends TL_Controller {\n\nfunction __construct()\n{\n parent::__construct();\n}\nfunction index()\n{\n $this-\u0026gt;load-\u0026gt;library('twilio');\n\n $from = '+15005550006';\n $to = '+91xxxxxxxxxx';\n $message = 'This is a test...';\n\n $response = $this-\u0026gt;twilio-\u0026gt;sms($from, $to, $message);\n //echo \"\u0026lt;pre\u0026gt;\";print_r($response);echo \"\u0026lt;/pre\u0026gt;\";\n\n if($response-\u0026gt;IsError)\n echo 'Error: ' . $response-\u0026gt;ErrorMessage;\n else\n //echo 'Sent message to ' . $to;\n echo 'Sent message';\n}\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow when I run the controller file in the browser(not in my machine but in server), it runs successfully and it shows \"Sent message\".\u003c/p\u003e\n\n\u003cp\u003eBut no sms is received. Please help.\u003c/p\u003e","answer_count":"3","comment_count":"1","creation_date":"2013-05-23 05:58:17.967 UTC","favorite_count":"1","last_activity_date":"2015-10-28 08:18:07.417 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2346003","post_type_id":"1","score":"10","tags":"twilio","view_count":"9325"} +{"id":"7660939","title":"ExtJs 3.3.1 - Placing the name of the Group within the framework of the existing Grid","body":"\u003cp\u003eIs there some property or method in order to align the string with the name of the group (in my case the name of Merchant 1) according to the existing grid in the Grid? \nTo not have to prescribe everything in the property groupTextTpl (create table, etc.) \nTo edit the icon (which I highlighted in the picture) was exactly under the column of Edit. \u003c/p\u003e\n\n\u003cp\u003eWell, or there is some method that has been put kotroy separators between the values?\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://i.stack.imgur.com/wRkQo.jpg\" rel=\"nofollow\"\u003ePicture\u003c/a\u003e\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2011-10-05 11:59:31.077 UTC","last_activity_date":"2011-10-05 11:59:31.077 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"948228","post_type_id":"1","score":"0","tags":"extjs|grid","view_count":"106"} +{"id":"6924948","title":"drag and drop in drupal 6 block","body":"\u003cp\u003eI am working on drupal. I am facing problem in block. There is no drag and drop function on the page. When i dissable javascript on my browser it show weight option to set manually, after enable again it is not showing.\u003c/p\u003e\n\n\u003cp\u003ecan any one suggest about this type of problem. if there is any css related issue please suggest me about this\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2011-08-03 10:19:32.79 UTC","last_activity_date":"2011-08-03 10:24:57.89 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"876384","post_type_id":"1","score":"0","tags":"drupal-6","view_count":"737"} +{"id":"10330796","title":"Adding auto hyperlink to images","body":"\u003cp\u003eI have created a wordpress blog for images. While publishing all the posts, I didn't use wordpress editor to upload images. Instead, I used FillaZilla to upload the images. Then, in the wordpress editor, I manually wrote only the image tag (below) in all the posts and published it. All posts contain no text, but only images. Like this,\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;img alt=\"\" title=\"\" src=\"\"\u0026gt;\u0026lt;/img\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow what I want to ask you is that I want the images in all the posts to get auto hyperlink address same as the image src. I have more than 200 blog posts in my wordpress blog. I don't want to edit all of them one by one. Here's the coding of the wordpress content area,\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"post-entry\"\u0026gt;\n \u0026lt;p\u0026gt;\u0026lt;img src='http://www.mywebsite.com/wp-content/uploads/2012/04/sun.jpg' title=\"sun\" alt=\"sun\" /\u0026gt;\u0026lt;/p\u0026gt;\n\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCould anyone please help me on this? how can I add hyperlink to the images? Is there any code which I can put in the post-entry div in my wordpress theme page?\u003c/p\u003e\n\n\u003cp\u003e@chandu-vkm explained (in the comments) exactly what I was looking for. Now I have one more question. When I add a a span tag before img , the code @chandu-vkm mentioned doesn't let me add span tag right before img tag. Instead it places the place tag outside the p tag, like in the code below.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"post_div\"\u0026gt;\n\u0026lt;span class=\"entry\"\u0026gt;\u0026lt;/span\u0026gt;\n\u0026lt;p\u0026gt;\n\u0026lt;img src='http://www.mywebsite.com/wp-content/uploads/2012/04/sun.jpg' title=\"Cute Teddy Bear\" alt=\"Cute Teddy Bear\" /\u0026gt;\n\u0026lt;/p\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut I want span to be placed right after p, like this.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;div class=\"post_div\"\u0026gt;\n \u0026lt;p\u0026gt;\n \u0026lt;span class=\"entry\"\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;img src='http://www.mywebsite.com/wp-content/uploads/2012/04/sun.jpg' title=\"Cute Teddy Bear\" alt=\"Cute Teddy Bear\" /\u0026gt;\n \u0026lt;/p\u0026gt;\n \u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSomebody please help me out.\u003c/p\u003e","accepted_answer_id":"10331310","answer_count":"2","comment_count":"0","creation_date":"2012-04-26 09:36:37.427 UTC","favorite_count":"1","last_activity_date":"2012-04-26 14:03:25.307 UTC","last_edit_date":"2012-04-26 13:28:16.58 UTC","last_editor_display_name":"","last_editor_user_id":"1356481","owner_display_name":"","owner_user_id":"1356481","post_type_id":"1","score":"3","tags":"image|wordpress|hyperlink","view_count":"740"} +{"id":"6215331","title":"What services let me query big data and let me provide a non-simple query code","body":"\u003cp\u003eI would like to create huge data sets (25 ints a row, 30 rows per second, multiply that by 60).\nOn the other hand, I want to query it for rows that match a certain condition (e.g. rows that not more than 5 ints of the 25 are out of a certain range).\u003c/p\u003e\n\n\u003cp\u003eAnd I want it all in real time, i.e. inserting and querying continuously.\u003c/p\u003e\n\n\u003cp\u003eDoes someone know how to do it, preferably using a cloud service (Amazon? Google?)\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2011-06-02 13:41:57.483 UTC","last_activity_date":"2011-06-02 13:49:58.763 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"781214","post_type_id":"1","score":"0","tags":"real-time|bigdata","view_count":"47"} +{"id":"46599654","title":"Finding a good way to pass information through a callback with Google Maps API","body":"\u003cp\u003eI have some code which calls Google Maps asynchronously:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar directionsService = new google.maps.DirectionsService;\ndirectionsService.route(arg1, callback);\ndirectionsService.route(arg2, callback);\ndirectionsService.route(arg3, callback);\n\nfunction callback(response, status) {\n // complex function here\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eRight now each callback results in a single piece of data which is stored in a global variable. The design has grown somewhat and now I'd like to include a parameter with each of the callbacks. But I can't do this directly, since I don't control \u003ccode\u003edirectionsService.route\u003c/code\u003e. It also strikes me that this is already a roundabout way to handle the problem; I'd much rather pass \u003ccode\u003earg1, arg2, arg3\u003c/code\u003e and their parameters to a function which can handle the async stuff and clean up when all have returned. Any suggestions on what is the best way to go about this?\u003c/p\u003e\n\n\u003cp\u003eI could dig my hole deeper by adding another global and updating it between calls. I could write a wrapper for directionsService.route which wraps it in another layer of callback indirection. I could try to bludgeon the callback format into one matching that required by a library like \u003ca href=\"https://caolan.github.io/async/\" rel=\"nofollow noreferrer\"\u003easync\u003c/a\u003e. I could write several versions of my callback function, or replace it with a function generator. Are any of these options reasonable? Is there something better?\u003c/p\u003e\n\n\u003cp\u003eHonestly this is a small project and I don't need something that scales well, but just for my own peace of mind I'd like something unterrible and somewhat DRY.\u003c/p\u003e","accepted_answer_id":"46610089","answer_count":"1","comment_count":"0","creation_date":"2017-10-06 06:35:35.883 UTC","last_activity_date":"2017-10-06 16:25:51.137 UTC","last_edit_date":"2017-10-06 16:15:58.167 UTC","last_editor_display_name":"","last_editor_user_id":"341362","owner_display_name":"","owner_user_id":"341362","post_type_id":"1","score":"0","tags":"javascript|google-maps|asynchronous|google-maps-api-3|callback","view_count":"23"} +{"id":"11921496","title":"How to keep the block text in div tag refresh function?","body":"\u003cp\u003eI have a page that the function is to refresh div tag.\nDiv tag function is refresh the data will receive.\u003c/p\u003e\n\n\u003cp\u003eSo far that's ok.\u003c/p\u003e\n\n\u003cp\u003eWhen I block the text using mouse, that's will clear the block text based on timing \"20000\". This below the JS script function.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;script src='js/jquery.min.js'\u0026gt;\u0026lt;/script\u0026gt;\n\u0026lt;script\u0026gt;\n $(document).ready(function()\n {\n $(\"#content2\").load(\"post_rf.php\");\n var refreshId = setInterval(function()\n {\n $(\"#content2\").load('post_rf.php?randval='+ Math.random());\n }, 20000);\n $.ajaxSetup({ cache: false });\n });\n \u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat I want to do is, how to keep the block text in div refresh function ?\nBecause some user maybe want to copy the text. In this case, user must quickly copy the text before div refresh.\u003c/p\u003e\n\n\u003cp\u003eMaybe the example like facebook post live update.\u003c/p\u003e","accepted_answer_id":"11921514","answer_count":"1","comment_count":"0","creation_date":"2012-08-12 10:26:20.943 UTC","last_activity_date":"2012-08-12 15:05:29.1 UTC","last_edit_date":"2012-08-12 15:05:29.1 UTC","last_editor_display_name":"","last_editor_user_id":"569101","owner_display_name":"","owner_user_id":"1593281","post_type_id":"1","score":"0","tags":"php|jquery","view_count":"263"} +{"id":"25627155","title":"Gmap3 issue with style and hover","body":"\u003cp\u003eI have questions about gmap3 integrate to my site.\nThis is my code\n?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e $(\"#mapa\").gmap3({\n\n\nmap:{\n options:{\n center:[41.993752,21.427277],\n zoom: 16,\n zoomControl: false,\n scaleControl: false,\n scrollwheel: false,\n disableDoubleClickZoom: false \n }\n },\n marker:{\n values:[\n {latLng:[41.993889, 21.416522], options:{icon: \"css/img/marker.png\"}},\n {latLng:[41.99452, 21.433433], options:{icon: \"css/img/marker.png\"}}\n ],\n options:{\n draggable: false\n }\n\n }\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003col\u003e\n\u003cli\u003eThe code above work if script in index file, but if i try to put from custom.js no work (no show map) why?\u003c/li\u003e\n\u003cli\u003eHow to make gray map style to code above?\u003c/li\u003e\n\u003cli\u003eHow to make hover effect to marker?\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eThank you,\nI hope undestand all what i need.\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2014-09-02 15:33:41.023 UTC","last_activity_date":"2014-09-03 12:22:09.49 UTC","last_edit_date":"2014-09-02 15:35:39.38 UTC","last_editor_display_name":"","last_editor_user_id":"49478","owner_display_name":"","owner_user_id":"3325605","post_type_id":"1","score":"0","tags":"jquery|jquery-gmap3","view_count":"67"} +{"id":"32334704","title":"SQLAlchemy distinct() doesn't return unique records with a keyword search","body":"\u003cp\u003eI have a search bar which searches for users with the following query:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edb.session.query(User).filter(or_(User.name.contains(keyword), User.location.contains(keyword))).limit(16).all()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAs you can see, it searches using keywords (which comes from a list formed by the search query). If I search for 'John Smith', the search will find a user with a name containing 'John' and then the same user with a name containing 'Smith', so it will return the User twice.\u003c/p\u003e\n\n\u003cp\u003eTo solve this issue I tried using \u003ccode\u003edistinct()\u003c/code\u003e like so:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edb.session.query(User).distinct().filter(or_(User.name.contains(keyword), User.location.contains(keyword))).limit(16).all()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut it didn't work so I tried using \u003ccode\u003edistinct(User.id)\u003c/code\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edb.session.query(User).distinct(User.id).filter(or_(User.name.contains(keyword), User.location.contains(keyword))).limit(16).all()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethough that did not work either.\nSo what is the problem? \u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdit:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eOne bit I forgot to mention the code looks like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003equery = 'John Smith'\nfor keyword in query.split():\n db.session.query(User).distinct().filter(or_(User.name.contains(keyword), User.location.contains(keyword))).limit(16).all()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is why it returns 2 of the same user. I use the for loop because there are other field to the database, so if I searched for \u003ccode\u003eJohn Smith Mexico\u003c/code\u003e it would search by each word.\u003c/p\u003e","accepted_answer_id":"32359134","answer_count":"1","comment_count":"0","creation_date":"2015-09-01 14:50:30.04 UTC","last_activity_date":"2015-09-03 04:57:40.773 UTC","last_edit_date":"2015-09-01 20:59:13.617 UTC","last_editor_display_name":"","last_editor_user_id":"2961662","owner_display_name":"","owner_user_id":"2961662","post_type_id":"1","score":"0","tags":"python|database|sqlalchemy|flask-sqlalchemy","view_count":"367"} +{"id":"5258342","title":"What's the best way to save the sensor data to local machine for analysis?","body":"\u003cp\u003eHI,\u003c/p\u003e\n\n\u003cp\u003eI am building a small application using accelerometers on the phone. I hope I can get the accelerometer data from the phone and analyze them at my PC and then I can build a model based on these data and deploy the model on the phone. \u003c/p\u003e\n\n\u003cp\u003eBut I just don't know how to get the data out of the phone. \u003c/p\u003e\n\n\u003cp\u003eThanks a lot!\u003c/p\u003e","accepted_answer_id":"5258579","answer_count":"2","comment_count":"0","creation_date":"2011-03-10 10:27:22.823 UTC","favorite_count":"1","last_activity_date":"2011-03-10 10:47:45.487 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"183828","post_type_id":"1","score":"2","tags":"windows-phone-7","view_count":"195"} +{"id":"42294796","title":"Mysql getting weekly report between 2 dates","body":"\u003cp\u003eI need to get number of users registered in a week, given start date and end date.\nRight now the logic used is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eweek_days_list = [['2017-01-01', '2017-01-07'], ['2017-01-08', '2017-01-14']]\n\nfor week in week_days_list:\n query = 'SELECT COUNT('*') AS `__count` FROM `user_table`\n INNER JOIN `user_auth` ON (`user_table`.`user_id` = `user_auth`.`id` ) \n WHERE `user_auth`.`date_joined` BETWEEN week[0] \n AND week[1];'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eResult is:\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003e__count \u003c/p\u003e\n\n\u003cp\u003e15\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003eI want it to reduce it to 1 query.\nEg:\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003eWeek Interval | count\u003c/p\u003e\n\n\u003cp\u003e'2017-01-01' | 15\u003c/p\u003e\n\n\u003cp\u003e'2017-01-08' | 12\u003c/p\u003e\n\n\u003chr\u003e","answer_count":"2","comment_count":"0","creation_date":"2017-02-17 09:56:30.943 UTC","last_activity_date":"2017-02-17 10:08:32.887 UTC","last_edit_date":"2017-02-17 10:08:32.887 UTC","last_editor_display_name":"","last_editor_user_id":"1733321","owner_display_name":"","owner_user_id":"7562857","post_type_id":"1","score":"1","tags":"python|mysql|sql","view_count":"35"} +{"id":"30367710","title":"Using a variable created in foreach","body":"\u003cp\u003eI am trying to extract duplicates compared from an XML file and a DB table column\u003c/p\u003e\n\n\u003cp\u003eHere is my current code\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eusing (AH_ODS_DBEntities db = new AH_ODS_DBEntities())\n{\n //XML CustomerRefNbr \n string[] allFiles = Directory.GetFiles(@\"C:\\xml\\\");\n foreach (var @CRN in allFiles)\n {\n XElement xEle = XElement.Load(@CRN);\n IEnumerable\u0026lt;XElement\u0026gt; invoices = xEle.Elements();\n foreach (XElement pEle in invoices)\n {\n string c = pEle.Element(\"CustomerRef\").Value;\n }\n\n //DB CustomerRefNbr\n IEnumerable\u0026lt;string\u0026gt; rs = db.Sales.AsQueryable().Select(crn =\u0026gt; crn.CustomerRefNbr);\n foreach (string invoice in rs)\n {\n string i = invoice;\n }\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat I'm trying to achieve is to get string c and i, compare if they have a match and put them in a list. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar duplicateCRN= db.Sales.SqlQuery(\"SELECT * FROM Sales WHERE \" + i + \"==\" + c)\n .ToList\u0026lt;Sale\u0026gt;(); \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNot sure if I'm doing this right though.\u003c/p\u003e","accepted_answer_id":"30367864","answer_count":"2","comment_count":"1","creation_date":"2015-05-21 07:51:59.507 UTC","last_activity_date":"2015-05-21 08:12:47.057 UTC","last_edit_date":"2015-05-21 07:55:07.973 UTC","last_editor_display_name":"","last_editor_user_id":"1449181","owner_display_name":"","owner_user_id":"1349083","post_type_id":"1","score":"0","tags":"c#","view_count":"126"} +{"id":"39451979","title":"Google Proximity Beacon API gives 403 unauthorised error","body":"\u003cp\u003eI am trying to consume Google's Beacon Proximity api. i have followed following steps to integrate them:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e1) Signed up on Google Api Console.\n2) Created new Project.\n3) enabled Beacon proximity api and Nearby Api.\n4) Generated Api key from Credentials. \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAfterwards i invoke the following api:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e {\n \"advertisedId\": {\n \"type\": \"EDDYSTONE\",\n \"id\": \"ABEiM0RVZneImaq7zN3u/w==\"\n },\n \"status\": \"ACTIVE\",\n \"placeId\": \"ChIJL_P_CXMEDTkRw0ZdG-0GVvw\",\n \"latLng\": {\n \"latitude\": \"71.6693771\",\n \"longitude\": \"-22.1966037\"\n },\n \"indoorLevel\": {\n \"name\": \"1\"\n },\n \"expectedStability\": \"STABLE\",\n \"description\": \"An example beacon.\",\n \"properties\": {\n \"position\": \"entryway\"\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewith the follwing url:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ehttps://proximitybeacon.googleapis.com/v1beta1/beacons:register?key=xxxx(my_api_key)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut the response says: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n \"error\": {\n \"code\": 403,\n \"message\": \"Unauthorized.\",\n \"status\": \"PERMISSION_DENIED\"\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhat is it that i am missing..\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eI also tried to use Beacon tools app but after entering EID and all other credentials..the App crashes(on android), while it is not able to connect to my eddystone on Ios. \n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"2","creation_date":"2016-09-12 13:53:34.357 UTC","favorite_count":"1","last_activity_date":"2016-09-12 21:54:26.023 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1768001","post_type_id":"1","score":"0","tags":"android|ibeacon|iot|eddystone|proximityapi","view_count":"188"} +{"id":"19292475","title":"Kendo DatePicker Format validation and error message","body":"\u003cp\u003eI was create a page has Datepicker with dd/MM/yyyy format with culture ar-SA but when I try to set the date it's always returns invalid date\nhere is the datepicker\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@Html.Kendo().DatePickerFor(model =\u0026gt; model.ValidStartDate).HtmlAttributes(new { id = \"ValidStartDate_\" + Model.ItemCode }).Culture(\"ar-SA\").Format(\"dd/MM/yyyy\").ParseFormats(new string[] {\"dd/MM/yyyy\"})\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eanother problem is the validation message it's always return the default message instead the custom message I set in the view model\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[Date( ErrorMessageResourceType = typeof(Global), ErrorMessageResourceName = \"ValidStartDate_InvalidDate\")]\n public Nullable\u0026lt;System.DateTime\u0026gt; ValidStartDateH { get; set; }\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"3","comment_count":"4","creation_date":"2013-10-10 09:49:26.833 UTC","last_activity_date":"2014-01-16 10:28:00.553 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2814155","post_type_id":"1","score":"1","tags":"asp.net-mvc-4|datepicker|kendo-ui","view_count":"9308"} +{"id":"8292015","title":"How to check whether user opened email?","body":"\u003cp\u003eI am trying to figure out when the user opens an email that i sent to him. I am sending an html email with an image in it. This image is handled by a generic handler. At the moment this handler is not hit. Is this a good way of achieving my goal?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public void ProcessRequest(HttpContext context)\n {\n byte[] byteArray = System.IO.File.ReadAllBytes(@\"c:\\temp\\Desert.jpg\");\n context.Response.Clear();\n context.Response.ContentType = \"image/bmp\";\n context.Response.BinaryWrite(byteArray);\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethe email body looks like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\"\u0026lt;html\u0026gt;\u0026lt;head\u0026gt;\u0026lt;title\u0026gt;\u0026lt;/title\u0026gt;\u0026lt;/head\u0026gt;\u0026lt;body\u0026gt;\u0026lt;form name='form1' method='post' action='Default.aspx'\u0026gt;\u0026lt;div\u0026gt;\u0026lt;img id='Image1' src='ImageHandler.ashx?img=1' style='border-width:0px;' /\u0026gt;\u0026lt;/div\u0026gt;\u0026lt;/form\u0026gt;\u0026lt;/body\u0026gt;\u0026lt;/html\u0026gt;\";\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"8292391","answer_count":"4","comment_count":"3","creation_date":"2011-11-28 05:56:37.35 UTC","last_activity_date":"2011-11-28 10:30:10 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1029283","post_type_id":"1","score":"0","tags":"asp.net|handler","view_count":"451"} +{"id":"41608354","title":"Multiple applications using Liquibase with different datasource in OSGi Container","body":"\u003cp\u003eI am using Liquibase in OSGi environment via bundle org.openengsb.labs.liquibase.extender (\u003ca href=\"https://github.com/openengsb-labs/labs-liquibase\" rel=\"nofollow noreferrer\"\u003ehttps://github.com/openengsb-labs/labs-liquibase\u003c/a\u003e) which defines datasource globaly in org.openengsb.labs.liquibase.cfg (\u003ca href=\"https://github.com/openengsb-labs/labs-liquibase#configuration-file\" rel=\"nofollow noreferrer\"\u003ehttps://github.com/openengsb-labs/labs-liquibase#configuration-file\u003c/a\u003e).\u003c/p\u003e\n\n\u003cp\u003eDoes anyboady have experience with multiple bundles using different datasources for Liquibase?\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2017-01-12 08:32:00.207 UTC","last_activity_date":"2017-01-12 08:32:00.207 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"461790","post_type_id":"1","score":"0","tags":"osgi|liquibase|liquibase-hibernate","view_count":"48"} +{"id":"47522665","title":"Combining more than two charts in xlsx writer, using python","body":"\u003cp\u003eHere are my three chart types:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003echart = workbook.add_chart({'type': 'line'})\narea = workbook.add_chart({'type': 'area'})\nscatter = workbook.add_chart({'type':'scatter'})\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eExpected output is to combine all 3 to put into a single graph:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003echart.combine(area) ##1 works fine\nchart.combine(scatter) ##if more than 2 combines; it picks only last one, ignores first combine\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eExample graph:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/BI421.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/BI421.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e \u003c/p\u003e\n\n\u003cp\u003eThis currently has scatter and line merged, but I'd also like to merge area (or add an area fill) between the red line and the x axis (where x = 0) , to be able to see the difference between positive and negative. Thanks\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-11-28 01:48:19.63 UTC","last_activity_date":"2017-11-28 01:48:19.63 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"8242299","post_type_id":"1","score":"0","tags":"python|pandas|xlsxwriter","view_count":"18"} +{"id":"47145238","title":"Change the format of the time stamp in the post title in HUGO-Xmin theme","body":"\u003cp\u003eI built a site with the R blogdown package:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003einstall.packages('blogdown')\nblogdown::new_site(theme='yihui/hugo-xmin')\nblogdown::serve_site()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eA post title in xmin theme looks like this:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/IIhFT.jpg\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/IIhFT.jpg\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI was wondering how to display the complete time stamp such as \u003ccode\u003e2017-08-17 15:22:06 GMT\u003c/code\u003e beneath the author instead of the date \u003ccode\u003e2017/08/17\u003c/code\u003e?\u003c/p\u003e","accepted_answer_id":"47149588","answer_count":"1","comment_count":"1","creation_date":"2017-11-06 20:29:49.793 UTC","last_activity_date":"2017-11-07 03:40:10.437 UTC","last_edit_date":"2017-11-06 20:37:18.423 UTC","last_editor_display_name":"","last_editor_user_id":"4260791","owner_display_name":"","owner_user_id":"4260791","post_type_id":"1","score":"1","tags":"css|r|hugo|blogdown","view_count":"34"} +{"id":"34494310","title":"invalid argument and illegal offset","body":"\u003cp\u003eI have a page in my web application, where I type some text inside an \u003ccode\u003e\u0026lt;input type=\"search\"\u003c/code\u003e and I choose from a drop list, a type to complete my search action, then when I click on search submit button, the web app go to MySQL and search for rows then show them to me in HTML table.\u003c/p\u003e\n\n\u003cp\u003eI have this SQL code that it is placed on top of my HTML page:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\nrequire_once('../include/global.php');\n$result6 = 0;\n$message = '';\nif(isset($_POST['submit_search']))\n{\n $selected = $_POST['select_search_type'];\n $search = $_POST['search_item'];\n try\n {\n if($selected==\"item_name\")\n {\n $query = (\"SELECT * FROM inventory WHERE item_name= :search\");\n $stmt6 = $conn-\u0026gt;prepare($query);\n $stmt6-\u0026gt;bindParam(\":search\", $search);\n $count6 = $stmt6-\u0026gt;execute();\n $result6 = $stmt6-\u0026gt;fetch(PDO::FETCH_ASSOC);\n }\n\n if($selected==\"item_cat\")\n {\n $query = (\"SELECT * FROM inventory WHERE item_cat= :search\");\n $stmt6 = $conn-\u0026gt;prepare($query);\n $stmt6-\u0026gt;bindParam(\":search\", $search);\n $count6 = $stmt6-\u0026gt;execute();\n $result6 = $stmt6-\u0026gt;fetch(PDO::FETCH_ASSOC);\n }\n if($selected==\"item_code\")\n {\n $query = (\"SELECT * FROM inventory WHERE item_code= :search\");\n $stmt6 = $conn-\u0026gt;prepare($query);\n $stmt6-\u0026gt;bindParam(\":search\", $search);\n $count6 = $stmt6-\u0026gt;execute();\n $result6 = $stmt6-\u0026gt;fetch(PDO::FETCH_ASSOC);\n }\n }\n catch(PDOException $e)\n {\n echo $e-\u0026gt;getMessage();\n }\n}\n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd in the webpage HTML form I have this code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;form action=\"\" method=\"post\"\u0026gt;\n\u0026lt;input type=\"search\" name=\"search_item\"/\u0026gt;\n\u0026lt;select id=\"selectW\" name=\"select_search_type\"\u0026gt;\n\u0026lt;option value=\"select_search\"\u0026gt;select\u0026lt;/option\u0026gt;\n\u0026lt;option value=\"item_name\"\u0026gt;product\u0026lt;/option\u0026gt;\n\u0026lt;option value=\"item_cat\"\u0026gt;category\u0026lt;/option\u0026gt;\n\u0026lt;option value=\"item_code\"\u0026gt;code\u0026lt;/option\u0026gt;\n\u0026lt;/select\u0026gt;\n\u0026lt;input type=\"submit\" name=\"submit_search\" value=\"search\"/\u0026gt;\n\u0026lt;/form\u0026gt;\n\u0026lt;/div\u0026gt;\n\u0026lt;div id=\"section2\"\u0026gt;\n\u0026lt;form action=\"\" method=\"post\"\u0026gt;\n\u0026lt;table class=\"imagetable\" border=\"1\" cellspacing=\"2\" cellpadding=\"2\"\u0026gt;\n\u0026lt;tr\u0026gt;\n\u0026lt;th align=\"center\"\u0026gt;product\u0026lt;/th\u0026gt;\n\u0026lt;th align=\"center\"\u0026gt;code\u0026lt;/th\u0026gt;\n\u0026lt;th align=\"center\"\u0026gt;price\u0026lt;/th\u0026gt;\n\u0026lt;th align=\"center\"\u0026gt;number\u0026lt;/th\u0026gt;\n\u0026lt;/tr\u0026gt;\n\u0026lt;?php foreach ($result6 as $show_search) { //var_dump($show_search);?\u0026gt;\n\u0026lt;tr\u0026gt;\n\u0026lt;td align=\"center\"\u0026gt;\u0026lt;?php echo $show_search['item_name'] ?\u0026gt;\u0026lt;/td\u0026gt;\n\u0026lt;td align=\"center\"\u0026gt;\u0026lt;?php echo $show_search['item_code'] ?\u0026gt;\u0026lt;/td\u0026gt;\n\u0026lt;td align=\"center\"\u0026gt;\u0026lt;?php echo $show_search['buy_price'] ?\u0026gt;\u0026lt;/td\u0026gt;\n\u0026lt;td align=\"center\"\u0026gt;\u0026lt;?php echo $show_search['item_sold'] ?\u0026gt;\u0026lt;/td\u0026gt;\n\u0026lt;/tr\u0026gt;\n\u0026lt;?php } ?\u0026gt;\n\u0026lt;/table\u0026gt; \n\u0026lt;/form\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow, when I run and test my page, the first error was:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eWarning: Invalid argument supplied for foreach()\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eSo I changed \u003ccode\u003eresult6 = 0;\u003c/code\u003e into \u003ccode\u003eresult6 = array();\u003c/code\u003e. but I got the same warning.\u003c/p\u003e\n\n\u003cp\u003eThen after that, when I type a name in search text box, I got this error when submitting my search:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eWarning: Illegal string offset 'item_code' \u003c/p\u003e\n \n \u003cp\u003eWarning: Illegal string offset 'item_name'\u003c/p\u003e\n \n \u003cp\u003eWarning: Illegal string offset 'buy_price'\u003c/p\u003e\n \n \u003cp\u003eWarning: Illegal string offset 'item_sold'\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI tried this code \u003ca href=\"https://stackoverflow.com/questions/6572061/php-warning-invalid-argument-supplied-for-foreach?answertab=votes#tab-top\"\u003ein this link but still the same error\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThen I saw \u003ca href=\"https://stackoverflow.com/questions/9869150/illegal-string-offset-warning-php\"\u003ethis link here for the illegal offset\u003c/a\u003e but it is not relevant with my code (Don't worth to test, different code).\u003c/p\u003e\n\n\u003cp\u003eAny help is appreciated.\u003c/p\u003e","answer_count":"1","comment_count":"8","creation_date":"2015-12-28 13:19:42.23 UTC","last_activity_date":"2015-12-28 20:45:12.087 UTC","last_edit_date":"2017-05-23 12:30:59.88 UTC","last_editor_display_name":"user5723483","last_editor_user_id":"-1","owner_display_name":"user5723483","post_type_id":"1","score":"2","tags":"php|html|mysql|pdo","view_count":"83"} +{"id":"3351799","title":"HTML Page Size - page weight","body":"\u003cp\u003eI have to measure the over all page size of all the pages on my company's intrAnet site.\u003c/p\u003e\n\n\u003cp\u003ePlease let me know how I can measure / calculate it.\u003c/p\u003e\n\n\u003cp\u003eExpectation : I open the intrAnet page in IE/Firefox. After it is completely loaded, the tool or utility should give me the complete size of page.\u003c/p\u003e\n\n\u003cp\u003e\u003cem\u003ePS : Complete size of page means :Accumulative size of html, used images, css, scripts, flash files etc.\u003c/em\u003e\u003c/p\u003e\n\n\u003cp\u003eIf I \u003cstrong\u003esave the complete page\u003c/strong\u003e on my desktop then it does not save the flash files and other images which are getting called through Java script, thats why I am not able to calculate the web page size.\u003c/p\u003e\n\n\u003cp\u003ePlease reply soon.\u003c/p\u003e\n\n\u003cp\u003eregds\nVivek\u003c/p\u003e","answer_count":"5","comment_count":"0","creation_date":"2010-07-28 10:05:40.697 UTC","last_activity_date":"2015-09-01 07:26:35.827 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"404367","post_type_id":"1","score":"3","tags":"html|size|weight","view_count":"7897"} +{"id":"15840198","title":"p:first child doesn't work if a img tag is immediately after the p tag?","body":"\u003cp\u003eHy there,\ncan't make it to work i have something like this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e .body-post p:first-child:first-letter\n {\n font-size:240%;\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand here the html:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;div class=\"body-post\"\u0026gt;\n \u0026lt;p\u0026gt;\u0026lt;img src=\"http://#\" align=\"left\" style=\"margin-right:5px;\"/\u0026gt;\n some text\u0026lt;/p\u0026gt;\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo if theres no picture the first letter works. Is there a way to skip the img tag. I cant edit the source code because im doing some template for a blogger domain. nothing serious, its just so confusing. first letter should select the letter not the image.\u003c/p\u003e","accepted_answer_id":"15840577","answer_count":"2","comment_count":"1","creation_date":"2013-04-05 17:44:37.423 UTC","last_activity_date":"2013-04-05 18:05:20.143 UTC","last_edit_date":"2013-04-05 17:48:08.133 UTC","last_editor_display_name":"","last_editor_user_id":"219136","owner_display_name":"","owner_user_id":"2133169","post_type_id":"1","score":"1","tags":"html|css|image","view_count":"265"} +{"id":"20739256","title":"I Can't access my class library in a web application","body":"\u003cp\u003eI have added Class Library in my web Project through Add reference option, but i am facing an error \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eError 2 \u003cem\u003eThe type or namespace name 'UserDetailsDll' could not be\n found (are you missing a using directive or an assembly reference?)\u003c/em\u003e*\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI hope some one will help me.\u003c/p\u003e\n\n\u003cp\u003eThanks in Advance.\u003c/p\u003e","accepted_answer_id":"20739367","answer_count":"2","comment_count":"1","creation_date":"2013-12-23 07:56:18.353 UTC","last_activity_date":"2013-12-23 08:16:56.003 UTC","last_edit_date":"2013-12-23 08:00:26.207 UTC","last_editor_display_name":"","last_editor_user_id":"447156","owner_display_name":"","owner_user_id":"3110174","post_type_id":"1","score":"0","tags":"c#","view_count":"95"} +{"id":"44091266","title":"How do I export the results into an Excel spreadsheet and highlight them in green once the files have been deleted from a csv list in Powershell?","body":"\u003cp\u003eI have a powershell script that removes files from a csv list. However, I'm not sure how to export the results once the files have been deleted from the list and mark them in green in a spreadsheet in Excel. How would I approach this? Below is my powershell script:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$files = Get-Content \"C:\\test\\remove.csv\"\nforeach ($file in $files) {\nRemove-Item -Path $file -force\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"4","creation_date":"2017-05-20 22:08:38.68 UTC","last_activity_date":"2017-05-20 22:08:38.68 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3683976","post_type_id":"1","score":"0","tags":"excel|powershell|csv|export-to-csv","view_count":"44"} +{"id":"34737368","title":"Group within a Group XSLT 1.0 with Sum \u0026 Count of Distinct Values","body":"\u003cp\u003eI would like to implement a Group by function within Current-Group using XSLT 1.0...I have managed to get the top level grouping based on \"Organization\", but a sub group within using \"Covers\"; I have failed at :(\u003c/p\u003e\n\n\u003cp\u003e(\u003ca href=\"http://xsltransform.net/pPzifpL/16\" rel=\"nofollow\"\u003ehttp://xsltransform.net/pPzifpL/16\u003c/a\u003e) has the XML \u0026amp; XSLT setup currently used.\u003c/p\u003e\n\n\u003cp\u003eI also need to apply a Sum(Current-Group()/SumInsured) and a count of distinct(Addenda), but this is not supported with 1.0...Please help me experts.\u003c/p\u003e\n\n\u003cp\u003eExpected Output: (Text)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eClient Sum Insured Report\n\nUK\nSNo. Policy Number Customer Name Cover Note # No. of Addendas Sum Insured Total Commission\n 1 POL1 ABC 50242 2 40000 65\n 2 POL2 XYZ 12345 1 30000 30\nTotals : 70000 95\n\nUS\nSNo. Policy Number Customer Name Cover Note # No. of Addendas Sum Insured Total Commission\n 1 JKL 45678 0 10000 10\nTotals : 10000 10\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eXML:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" encoding=\"UTF-8\"?\u0026gt;\u0026lt;?Siebel-Property-Set EscapeNames=\"true\"?\u0026gt;\u0026lt;SiebelMessage MessageId=\"1-OC05\" IntObjectName=\"Client Sum Insured Report IO\" MessageType=\"Integration Object\" IntObjectFormat=\"Siebel Hierarchical\"\u0026gt;\n\u0026lt;ListOfClientSumInsuredReportIo\u0026gt;\n \u0026lt;GroupPolicies\u0026gt;\n \u0026lt;Addenda\u0026gt;50242-1\u0026lt;/Addenda\u0026gt;\n \u0026lt;CommAmt\u0026gt;50\u0026lt;/CommAmt\u0026gt;\n \u0026lt;Cover\u0026gt;50242\u0026lt;/Cover\u0026gt;\n \u0026lt;Customer\u0026gt;ABC\u0026lt;/Customer\u0026gt;\n \u0026lt;Policy\u0026gt;POL1\u0026lt;/Policy\u0026gt;\n \u0026lt;SumInsured\u0026gt;10000\u0026lt;/SumInsured\u0026gt;\n \u0026lt;Organization\u0026gt;UK\u0026lt;/Organization\u0026gt;\n \u0026lt;/GroupPolicies\u0026gt;\n \u0026lt;GroupPolicies\u0026gt;\n \u0026lt;Addenda\u0026gt;50242-2\u0026lt;/Addenda\u0026gt;\n \u0026lt;CommAmt\u0026gt;5\u0026lt;/CommAmt\u0026gt;\n \u0026lt;Cover\u0026gt;50242\u0026lt;/Cover\u0026gt;\n \u0026lt;Customer\u0026gt;ABC\u0026lt;/Customer\u0026gt;\n \u0026lt;Policy\u0026gt;POL1\u0026lt;/Policy\u0026gt;\n \u0026lt;SumInsured\u0026gt;20000\u0026lt;/SumInsured\u0026gt;\n \u0026lt;Organization\u0026gt;UK\u0026lt;/Organization\u0026gt;\n \u0026lt;/GroupPolicies\u0026gt;\n \u0026lt;GroupPolicies\u0026gt;\n \u0026lt;Addenda\u0026gt;\u0026lt;/Addenda\u0026gt;\n \u0026lt;CommAmt\u0026gt;10\u0026lt;/CommAmt\u0026gt;\n \u0026lt;Cover\u0026gt;50242\u0026lt;/Cover\u0026gt;\n \u0026lt;Customer\u0026gt;ABC\u0026lt;/Customer\u0026gt;\n \u0026lt;Policy\u0026gt;POL1\u0026lt;/Policy\u0026gt;\n \u0026lt;SumInsured\u0026gt;10000\u0026lt;/SumInsured\u0026gt;\n \u0026lt;Organization\u0026gt;UK\u0026lt;/Organization\u0026gt;\n \u0026lt;/GroupPolicies\u0026gt;\n \u0026lt;GroupPolicies\u0026gt;\n \u0026lt;Addenda\u0026gt;12345-1\u0026lt;/Addenda\u0026gt;\n \u0026lt;CommAmt\u0026gt;20\u0026lt;/CommAmt\u0026gt;\n \u0026lt;Cover\u0026gt;12345\u0026lt;/Cover\u0026gt;\n \u0026lt;Customer\u0026gt;XYZ\u0026lt;/Customer\u0026gt;\n \u0026lt;Policy\u0026gt;POL2\u0026lt;/Policy\u0026gt;\n \u0026lt;SumInsured\u0026gt;20000\u0026lt;/SumInsured\u0026gt;\n \u0026lt;Organization\u0026gt;UK\u0026lt;/Organization\u0026gt;\n \u0026lt;/GroupPolicies\u0026gt;\n \u0026lt;GroupPolicies\u0026gt;\n \u0026lt;Addenda\u0026gt;\u0026lt;/Addenda\u0026gt;\n \u0026lt;CommAmt\u0026gt;10\u0026lt;/CommAmt\u0026gt;\n \u0026lt;Cover\u0026gt;12345\u0026lt;/Cover\u0026gt;\n \u0026lt;Customer\u0026gt;XYZ\u0026lt;/Customer\u0026gt;\n \u0026lt;Policy\u0026gt;POL2\u0026lt;/Policy\u0026gt;\n \u0026lt;SumInsured\u0026gt;10000\u0026lt;/SumInsured\u0026gt;\n \u0026lt;Organization\u0026gt;UK\u0026lt;/Organization\u0026gt;\n \u0026lt;/GroupPolicies\u0026gt;\n \u0026lt;GroupPolicies\u0026gt;\n \u0026lt;Addenda\u0026gt;\u0026lt;/Addenda\u0026gt;\n \u0026lt;CommAmt\u0026gt;10\u0026lt;/CommAmt\u0026gt;\n \u0026lt;Cover\u0026gt;45678\u0026lt;/Cover\u0026gt;\n \u0026lt;Customer\u0026gt;JKL\u0026lt;/Customer\u0026gt;\n \u0026lt;Policy\u0026gt;\u0026lt;/Policy\u0026gt;\n \u0026lt;SumInsured\u0026gt;10000\u0026lt;/SumInsured\u0026gt;\n \u0026lt;Organization\u0026gt;US\u0026lt;/Organization\u0026gt;\n \u0026lt;/GroupPolicies\u0026gt;\n\u0026lt;/ListOfClientSumInsuredReportIo\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003c/p\u003e\n\n\u003cp\u003eXSLT Used:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" encoding=\"utf-8\"?\u0026gt;\n \u0026lt;xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"\u0026gt;\n \u0026lt;xsl:output method=\"text\" indent=\"yes\"/\u0026gt; \n \u0026lt;xsl:template match=\"/SiebelMessage/ListOfClientSumInsuredReportIo\"\u0026gt;\n \u0026lt;xsl:text\u0026gt;\u0026amp;#09;\u0026amp;#09;\u0026lt;/xsl:text\u0026gt;\n \u0026lt;xsl:text\u0026gt;Client Sum Insured Report\u0026lt;/xsl:text\u0026gt;\n \u0026lt;xsl:text\u0026gt;\u0026amp;#10;\u0026lt;/xsl:text\u0026gt;\n \u0026lt;xsl:apply-templates select=\"GroupPolicies[not(preceding-sibling::GroupPolicies/Organization = Organization)]/Organization\" /\u0026gt;\n \u0026lt;/xsl:template\u0026gt;\n\n \u0026lt;xsl:template match=\"GroupPolicies\" \u0026gt;\n \u0026lt;xsl:variable name=\"count\" select=\"position()\"/\u0026gt;\n \u0026lt;!--xsl:value-of select=\"{$count}\"/--\u0026gt;\n \u0026lt;xsl:text\u0026gt;\u0026amp;#09;\u0026lt;/xsl:text\u0026gt;\n \u0026lt;xsl:value-of select=\"Policy\"/\u0026gt;\n \u0026lt;xsl:text\u0026gt;\u0026amp;#09;\u0026lt;/xsl:text\u0026gt;\n \u0026lt;xsl:value-of select=\"Customer\"/\u0026gt;\n \u0026lt;xsl:text\u0026gt;\u0026amp;#09;\u0026lt;/xsl:text\u0026gt;\n \u0026lt;xsl:value-of select=\"Cover\"/\u0026gt;\n \u0026lt;xsl:text\u0026gt;\u0026amp;#09;\u0026lt;/xsl:text\u0026gt;\n \u0026lt;xsl:value-of select=\"Addenda\"/\u0026gt; \u0026lt;!-- Getting Distinct Count of Addendas while it is not blank--\u0026gt;\n \u0026lt;xsl:text\u0026gt;\u0026amp;#09;\u0026lt;/xsl:text\u0026gt;\n \u0026lt;xsl:value-of select=\"SumInsured\"/\u0026gt;\n \u0026lt;xsl:text\u0026gt;\u0026amp;#09;\u0026lt;/xsl:text\u0026gt;\n \u0026lt;xsl:value-of select=\"CommAmt\"/\u0026gt; \n \u0026lt;xsl:text\u0026gt;\u0026amp;#10;\u0026lt;/xsl:text\u0026gt; \n \u0026lt;/xsl:template\u0026gt; \n\n \u0026lt;xsl:template match=\"Organization\" \u0026gt;\n \u0026lt;xsl:text\u0026gt;\u0026amp;#10;\u0026lt;/xsl:text\u0026gt;\n \u0026lt;xsl:text\u0026gt;SNo.\u0026lt;/xsl:text\u0026gt;\n \u0026lt;xsl:text\u0026gt;\u0026amp;#09;\u0026lt;/xsl:text\u0026gt;\n \u0026lt;xsl:text\u0026gt;Policy Number\u0026lt;/xsl:text\u0026gt;\n \u0026lt;xsl:text\u0026gt;\u0026amp;#09;\u0026lt;/xsl:text\u0026gt;\n \u0026lt;xsl:text\u0026gt;Customer Name\u0026lt;/xsl:text\u0026gt;\n \u0026lt;xsl:text\u0026gt;\u0026amp;#09;\u0026lt;/xsl:text\u0026gt;\n \u0026lt;xsl:text\u0026gt;Cover Note #\u0026lt;/xsl:text\u0026gt;\n \u0026lt;xsl:text\u0026gt;\u0026amp;#09;\u0026lt;/xsl:text\u0026gt;\n \u0026lt;xsl:text\u0026gt;No. of Addendas\u0026lt;/xsl:text\u0026gt;\n \u0026lt;xsl:text\u0026gt;\u0026amp;#09;\u0026lt;/xsl:text\u0026gt;\n \u0026lt;xsl:text\u0026gt;Sum Insured\u0026lt;/xsl:text\u0026gt;\n \u0026lt;xsl:text\u0026gt;\u0026amp;#09;\u0026lt;/xsl:text\u0026gt;\n \u0026lt;xsl:text\u0026gt;Total Commission\u0026lt;/xsl:text\u0026gt;\n \u0026lt;xsl:text\u0026gt;\u0026amp;#10;\u0026lt;/xsl:text\u0026gt;\n\n \u0026lt;xsl:variable name=\"temp\" select=\".\" /\u0026gt; \n \u0026lt;xsl:apply-templates select=\"//GroupPolicies[Organization = current()]\" /\u0026gt;\n\n \u0026lt;/xsl:template\u0026gt;\n \u0026lt;/xsl:stylesheet\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThank you for any suggestions.\u003c/p\u003e","accepted_answer_id":"34737849","answer_count":"1","comment_count":"2","creation_date":"2016-01-12 07:00:55.293 UTC","last_activity_date":"2016-01-12 08:01:15.823 UTC","last_edit_date":"2016-01-12 07:54:29.113 UTC","last_editor_display_name":"","last_editor_user_id":"5579728","owner_display_name":"","owner_user_id":"5579728","post_type_id":"1","score":"0","tags":"xml|text|xslt-1.0|grouping|distinct-values","view_count":"133"} +{"id":"42811230","title":"valgrind doesnt work on my 32bit executable in linux ubuntu 16.04","body":"\u003cp\u003eI'm trying to run the valgrind tool on my 32bit executable(sample), I built under the linux Ubuntu host 16.04(64bit), but it failed to run, error: wrong ELF.\u003c/p\u003e\n\n\u003cp\u003esample application is built to run in arm32, cross-compiled in my host linux machine.\u003c/p\u003e\n\n\u003cp\u003eThis is the command I ran.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evalgrind --tool=callgrind ./sample\nvalgrind: wrong ELF executable class (eg. 32-bit instead of 64-bit)\nvalgrind: ./sample: cannot execute binary file\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI ran memcheck tool but that also failed.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evalgrind --tool=memcheck ./updater \nvalgrind: wrong ELF executable class (eg. 32-bit instead of 64-bit)\nvalgrind: ./updater: cannot execute binary file\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThen what I did, I exported the valgrind lib path but that didn't help+\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$export VALGRIND_LIB=\"/usr/lib/valgrind\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI jut ls my lib dir, I found entire list and find callgrind and all libs are there.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecallgrind-amd64-linux \ncallgrind-x86-linux\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eDon't know what is wrong and how to use valgrind on my executables.\u003c/p\u003e\n\n\u003cp\u003eAny help, appreciated.\u003c/p\u003e","accepted_answer_id":"42819369","answer_count":"1","comment_count":"0","creation_date":"2017-03-15 13:29:25.5 UTC","last_activity_date":"2017-03-15 19:48:53.753 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7640269","post_type_id":"1","score":"0","tags":"arm|valgrind|callgrind|kcachegrind","view_count":"93"} +{"id":"35398363","title":"Incorrect use of ddply to summarise data in R","body":"\u003cp\u003eI have a problem performing a fairly simple ddply operation: I have the following dataframe.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e+----------+----------+\n| Expenses | Category |\n+----------+----------+\n| 735 | 1 |\n| 992 | 2 |\n| 943 | 1 |\n| 995 | 3 |\n| 914 | 3 |\n| 935 | 1 |\n| 956 | 3 |\n| 946 | 2 |\n| 978 | 1 |\n| 924 | 1 |\n+----------+----------+\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am trying to calculate the N and mean of expenses for each category, by executing the following:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eddply(df, .(Category), summarise, N = length(df$Expenses), mean = mean(df$Expenses))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever i get:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Category N mean\n1 1 10 931.8\n2 2 10 931.8\n3 3 10 931.8\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCould you help figuring out what I'm doing wrong here?\u003c/p\u003e\n\n\u003cp\u003eHere is the df's \u003ccode\u003edput\u003c/code\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003estructure(list(Expenses = c(735, 992, 943, 995, 914, 935, 956, \n946, 978, 924), Category = c(1L, 2L, 1L, 3L, 3L, 1L, 3L, 2L, \n1L, 1L)), .Names = c(\"Expenses\", \"Category\"), class = \"data.frame\", row.names = c(NA, \n-10L))\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"2","creation_date":"2016-02-14 21:44:48.12 UTC","last_activity_date":"2016-02-14 21:50:31.65 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1161712","post_type_id":"1","score":"0","tags":"r|plyr","view_count":"33"} +{"id":"27123405","title":"Subtract time from midnight in mysql","body":"\u003cp\u003eI am using mysql and I have a column which tracks the datetime, in the form, yyyy-mm-dd hh:mm:ss. I want to fetch that timestamp and calculate the difference of midnight to the time.\u003c/p\u003e\n\n\u003cp\u003eExample, if the datetime has 2014-11-22 13:53:41, I want the value of:\n(Midnight of 2014-11-22) - (2014-11-22 13:53:41).\u003c/p\u003e\n\n\u003cp\u003eThe value comes out to be: 11:07:19.\u003c/p\u003e\n\n\u003cp\u003eI want this value to be shown as counter on my website which uses php. \u003c/p\u003e","accepted_answer_id":"27123636","answer_count":"1","comment_count":"1","creation_date":"2014-11-25 09:48:43.047 UTC","last_activity_date":"2014-11-25 11:57:55.613 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4054502","post_type_id":"1","score":"0","tags":"php|mysql|date|datetime","view_count":"88"} +{"id":"4317632","title":"SQL Count on multiple joins with dynamic WHERE","body":"\u003cp\u003eMy issue is that I have a Select statement that has a where clause that is generated on the fly. It is joined across 5 tables. \u003c/p\u003e\n\n\u003cp\u003eI basically need a Count of each DISTINCT instance of a USER ID in table 1 that falls into the scope of the WHERE. This has to be able to be executed in one statement as well. So, Esentially, I can't do a global GROUP BY because of the other 4 tables data I need returned. \u003c/p\u003e\n\n\u003cp\u003eIf I could get a column that had the count that was duplicated where the primary key column is that would be perfect. Right now this is what I'm looking at as my query:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT * \nFROM TBL1 1 \n INNER JOIN TBL2 2 On 2.FK = 1.FK\n INNER JOIN TBL3 3 On 3.PK = 2.PK INNER JOIN TBL4 4 On 4.PK = 3.PK \n LEFT OUTER JOIN TBL5 5 ON 4.PK = 5.PK \nWHERE 1.Date_Time_In BETWEEN '2010-11-15 12:00:00' AND '2010-11-30 12:00:00'\nORDER BY \n 4.Column\n , 3.Column\n , 3.Column2\n , 1.Date_Time_In DESC\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo instead of selecting all columns, I will be filtering it down to about 5 or 6 but with that I need something like a Total column that is the Distinct count of TBL1's Primary Key that applies the WHERE clause that has a possibility of growing and shrinking in size. \u003c/p\u003e\n\n\u003cp\u003eI almost wish there was a way to apply the same WHERE clause to a subselect because I realize that would work but don't know of a way other than creating a variable and just placing it in both places which I can't do either.\u003c/p\u003e","accepted_answer_id":"4317830","answer_count":"2","comment_count":"3","creation_date":"2010-11-30 19:25:30.583 UTC","last_activity_date":"2010-11-30 20:07:41.747 UTC","last_edit_date":"2010-11-30 20:07:41.747 UTC","last_editor_display_name":"","last_editor_user_id":"52598","owner_display_name":"","owner_user_id":"363993","post_type_id":"1","score":"1","tags":"sql|sql-server|sql-server-2005","view_count":"418"} +{"id":"39225115","title":"How to use HTML in custom tooltip in angular charts?","body":"\u003cp\u003eIs it possible to render HTML in a tooltip on a chart using angular-chart 1.0?\nI've built the chart below, but need to render two values on separate lines in the tooltip, however the br tag is appearing as text\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div ng-app=\"doughnutApp\" ng-controller=\"DoughnutCtrl as doughnutCtrl\"\u0026gt;\n \u0026lt;canvas id=\"doughnut\" \n class=\"chart chart-doughnut\" \n chart-data=\"doughnutCtrl.labelsValues.values\" \n chart-labels=\"doughnutCtrl.labelsValues.labels\" \n chart-options=\"doughnutCtrl.chartOptions\"\u0026gt;\n \u0026lt;/canvas\u0026gt;\n\u0026lt;/div\u0026gt;\n\n\u0026lt;script\u0026gt;\n var app = angular.module('doughnutApp', ['chart.js']);\n app.controller('DoughnutCtrl', function() {\n var vm = this;\n vm.labelsValues = {\n \"labels\": [\"Label 1\", \"Label 2\", \"Label 3\", \"Label 4\", \"Label 5\", \"Label 6\", \"Label 7\", \"Label 8\"],\n \"values\": [1, 2, 3, 4, 5, 6, 7, 8]\n };\n\n vm.chartOptions = {\n tooltips: {\n callbacks: {\n label: function(tooltipItem, data) {\n return \"Line 1\u0026lt;br/\u0026gt;Line 2\";\n }\n }\n }\n };\n });\n\u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWorking plunker here: \u003ca href=\"http://plnkr.co/jtOM2PIccrb87wmFZc0p\" rel=\"nofollow\"\u003ehttp://plnkr.co/jtOM2PIccrb87wmFZc0p\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eOne workaround is to put one line in the \"label\" callback and the other in the \"beforeLabel\" callback, but that still wouldn't render colours, font styles, etc\u003c/p\u003e","accepted_answer_id":"42585367","answer_count":"1","comment_count":"1","creation_date":"2016-08-30 10:32:43.743 UTC","favorite_count":"1","last_activity_date":"2017-03-03 17:46:50.433 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1610140","post_type_id":"1","score":"2","tags":"angularjs|angular-chart|chart.js","view_count":"1046"} +{"id":"4699879","title":"OAuth-php behavior differs from a local version to a domain.com version","body":"\u003cp\u003eI've been developing locally and exposing them with OAuth (oauth-php framework). Everything works perfectly fine locally on my laptop but when I deploy everything on my server it doesn't work anymore I get the following error when I'm trying to get a request_token:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCan't verify request, missing oauth_consumer_key or oauth_token\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI've be investigating why it doesn't behave the same and the only clue that I found is in the log of OAuth: it looks like the oauth-php framework doesn't fetch properly the parameters in my POST Requests.\u003c/p\u003e\n\n\u003cp\u003eI have the same version of PHP on my server and on my local environment. I don't know what else could be affecting the oauth-php framework.\u003c/p\u003e\n\n\u003cp\u003eWhat can I do to find the problem? I don't know where to look...\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e\n\n\u003cp\u003eMartin\u003c/p\u003e","accepted_answer_id":"5501469","answer_count":"1","comment_count":"2","creation_date":"2011-01-15 13:42:04.19 UTC","favorite_count":"1","last_activity_date":"2011-03-31 14:29:20.007 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"472220","post_type_id":"1","score":"0","tags":"php|http|post|oauth","view_count":"97"} +{"id":"34926002","title":"Yesod 1.4 Authentification Logout \"Permission denied\"","body":"\u003cp\u003eI'm trying out the authentication and authorization example from yesodweb.\nThe login works fine now with BrowserId and Google but when I want to logout I get a:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003ePermission denied\u003c/p\u003e\n \n \u003cp\u003eA valid CSRF token wasn't present in HTTP headers or POST parameters. \u003eCheck the Yesod.Core.Handler docs of the yesod-core package for details \u003eon CSRF protection.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eThis is the form send from the auth subsite after clicking on the logout link: \u003ca href=\"http://lpaste.net/150405\" rel=\"nofollow\"\u003ehttp://lpaste.net/150405\u003c/a\u003e.\nIt's obvious that the token is not in the form, but the token is in the cookie my browser is sending in the POST with the form: \u003ca href=\"http://lpaste.net/150406\" rel=\"nofollow\"\u003ehttp://lpaste.net/150406\u003c/a\u003e.\u003c/p\u003e\n\n\u003cp\u003eWhat I'm doing wrong here? I don't want to be logged in forever :)\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2016-01-21 14:08:34.34 UTC","last_activity_date":"2016-01-21 14:08:34.34 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5821509","post_type_id":"1","score":"1","tags":"yesod","view_count":"67"} +{"id":"11389654","title":"Why i am getting \"The parameters dictionary contains a null entry for parameter x\" when i pass parameter value as null?","body":"\u003cp\u003eI have a Action method like this \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[HttpPost]\npublic ActionResult DoSearchRequestOperation(SearchRequestModelDto data)\n{\n //..\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhen I us this url string \u003ccode\u003ehttp://localhost:9124/Search/SearchRequest?searchRequestFor=0\u003c/code\u003e , it works. but when i use the url \u003ccode\u003ehttp://localhost:9124/Search/SearchRequest?searchRequestFor=\u003c/code\u003e , it is throwing this exception \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eSystem.ArgumentException: The parameters dictionary contains a null\n entry for parameter 'searchRequestFor' of non-nullable type\n 'xxxx.Shared.Dto.Process.Search.SearchRequestFor' for method\n 'System.Web.Mvc.ActionResult\n SearchRequest(xxxx.Shared.Dto.Process.Search.SearchRequestFor)' in\n 'xxxx.WebServer.UI.Controllers.SearchController\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eif the user is giving second url it should take the value 0.\u003c/p\u003e\n\n\u003cp\u003eI tried changing the maproute like below, but that also is not working.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e routes.MapRoute(\n \"Default1\", // Route name\n \"{controller}/{action}/{id}\", // URL with parameters\n new { controller = \"Home\", action = \"Dashboard\", id = 0 } \n );\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is the SearchRequestModelDto class \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[DataContract]\npublic class SearchRequestModelDto : UIBoundDto\n{\n public SearchRequestModelDto()\n {\n Criteria = new SearchRequestCriteriaDto();\n SearchResult = new SearchRequestResultDto();\n }\n\n [DataMember]\n public SearchRequestCriteriaDto Criteria { get; set; }\n\n [DataMember]\n public SearchRequestResultDto SearchResult { get; set; }\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"11389717","answer_count":"2","comment_count":"0","creation_date":"2012-07-09 05:50:50.337 UTC","favorite_count":"1","last_activity_date":"2015-02-21 18:38:58.35 UTC","last_edit_date":"2015-02-21 18:38:58.35 UTC","last_editor_display_name":"","last_editor_user_id":"769831","owner_display_name":"","owner_user_id":"609724","post_type_id":"1","score":"1","tags":"asp.net-mvc-3","view_count":"1101"} +{"id":"13933248","title":"MySQL - 2 way query check","body":"\u003cp\u003eI am implementing \"\u003cstrong\u003eAdd Friend\u003c/strong\u003e\" in my web app, so users could add other users as fiends.\u003c/p\u003e\n\n\u003cp\u003eWe have 2 tables: \u003cstrong\u003etbl_users\u003c/strong\u003e and \u003cstrong\u003etbl_relations\u003c/strong\u003e, tbl_users have an unique ID for the registered users and tbl_relations will store the users which are friends, for example some rows in tbl_relations are:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eid user_id_1 user_id_2\n1 4 6\n2 4 8\n3 8 23\n4 12 84\n5 3 4\n...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn the above results, the id is the unique id for the tbl_relations, user_id_1 is foreign key to tbl_users and user_id_2 is foreign key to tbl_users, now imagine we want to query and check if user with id \"4\" is friend with user with id \"9\" or not, here we need to send the query in 2 ways, I mean:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT * FROM tbl_relations WHERE (user_id_1 = '4' AND user_id_2 = '9') OR (user_id_1 = '9' AND user_id_2 = '4')\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe above query seems a little weird to me, there should be another way for implementing this I guess, maybe a different database structure?\u003c/p\u003e\n\n\u003cp\u003eOr another query, we want to get the \u003cstrong\u003emutual friends\u003c/strong\u003e between users with id \"4\" and \"8\", how I'm supposed to get the mutual friends in this scenario? is there any better database structure for this?\u003c/p\u003e\n\n\u003cp\u003eI would appreciate any kind of help.\u003c/p\u003e","accepted_answer_id":"13933338","answer_count":"2","comment_count":"0","creation_date":"2012-12-18 12:40:34.443 UTC","favorite_count":"2","last_activity_date":"2012-12-18 12:45:44.527 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1329189","post_type_id":"1","score":"1","tags":"mysql|database-design","view_count":"105"} +{"id":"17904085","title":"Java WatchEvent check Type?","body":"\u003cp\u003eJava WatchEvent check Type??\u003c/p\u003e\n\n\u003cp\u003eI will check the Path type in the WatchEvent, I want to check the path is a file or folder in the WatchEvent :)\u003c/p\u003e\n\n\u003cp\u003eI have no more details......\u003c/p\u003e\n\n\u003cp\u003eMy Java Source Code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epackage de.R3N3PDE.DriveIO;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.nio.file.FileSystems;\nimport java.nio.file.Path;\nimport java.nio.file.StandardWatchEventKinds;\nimport java.nio.file.WatchEvent;\nimport java.nio.file.WatchKey;\nimport java.nio.file.WatchService;\n\npublic class DriveIO {\n static WatchService watcher;\n public static void main(String args[]){\n try {\n watcher = FileSystems.getDefault().newWatchService();\n new File(\"C:/Users/R3N3PDE/Desktop/Test\").toPath().register(watcher, StandardWatchEventKinds.ENTRY_CREATE, StandardWatchEventKinds.ENTRY_DELETE, StandardWatchEventKinds.ENTRY_MODIFY);\n } catch (IOException e1) {\n e1.printStackTrace();\n }\n\n while(true){\n WatchKey key;\n try {\n key = watcher.take();\n } catch (InterruptedException x) {\n return;\n }\n\n for (WatchEvent\u0026lt;?\u0026gt; event: key.pollEvents()) {\n WatchEvent.Kind\u0026lt;?\u0026gt; kind = event.kind();\n WatchEvent\u0026lt;Path\u0026gt; ev = (WatchEvent\u0026lt;Path\u0026gt;)event;\n Path filename = ev.context().toAbsolutePath();\n if(filename.toFile().isDirectory()){\n System.out.println(\"Is Dir\");\n }else{\n System.out.println(\"Is File\");\n }\n }\n boolean valid = key.reset();\n if (!valid) {\n break;\n }\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"17905773","answer_count":"1","comment_count":"0","creation_date":"2013-07-28 01:20:20.677 UTC","last_activity_date":"2013-07-28 06:54:29.44 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1849433","post_type_id":"1","score":"-2","tags":"java","view_count":"320"} +{"id":"19491692","title":"DependencyProperty - How to set a step change in value?","body":"\u003cp\u003eI created a DependencyProperty for UserControl that should be in the range of -2 .. 2\u003c/p\u003e\n\n\u003cp\u003eWhen rotating the mouse scroll wheel in the properties window.\nThe property value changes by one. And I want to value changed by 0.1\nHow do I set a step change in DependencyProperty? \nI work with properties in XAML editor.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public double Value\n {\n get { return (double)GetValue(BarValueProperty); }\n set { SetValue(BarValueProperty, value); }\n }\n\n\n public static readonly DependencyProperty BarValueProperty =\n DependencyProperty.Register(\"Value\", typeof(double), typeof(MeterBar), new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.AffectsRender));\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-10-21 10:12:12.843 UTC","last_activity_date":"2013-10-21 10:29:40.883 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2011732","post_type_id":"1","score":"0","tags":"wpf|xaml|dependency-properties","view_count":"119"} +{"id":"3284624","title":"Exchange Management Powershell with .Net","body":"\u003cp\u003eWhy am I receiving this Exception:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSystem.Management.Automation.CommandNotFoundException: The term new-storagegroup....\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eRelevant code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eRunspaceConfiguration rsConfig = RunspaceConfiguration.Create();\nPSSnapInException snapInException = null;\nPSSnapInInfo info = rsConfig.AddPSSnapIn(\"Microsoft.Exchange.Management.PowerShell.Admin\", out snapInException);\nRunspace myRunSpace = RunspaceFactory.CreateRunspace(rsConfig);\nmyRunSpace.Open();\n\n//Create pipeline and feed it the script text\nPipeline pipeline = myRunSpace.CreatePipeline();\n\nstring strScript = \"new-storagegroup -Server KINGKONG\"\n + \" -LogFolderPath c:\\\\rsg\\\\logs -Name RecoveryGroup -SystemFolderPath c:\\\\rsg\\\\data -Recovery\";\n\n//Create an instance of the Command class by using the name of the cmdlet that you want to run\nCommand myCommand = new Command(strScript);\n\n//Add the command to the Commands collection of the pipeline.\npipeline.Commands.Add(myCommand);\n\nCollection\u0026lt;PSObject\u0026gt; results = pipeline.Invoke();\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"3284661","answer_count":"1","comment_count":"0","creation_date":"2010-07-19 20:09:18.877 UTC","last_activity_date":"2013-06-20 16:47:14.483 UTC","last_edit_date":"2013-06-20 16:47:14.483 UTC","last_editor_display_name":"","last_editor_user_id":"985906","owner_display_name":"","owner_user_id":"357849","post_type_id":"1","score":"3","tags":".net|powershell","view_count":"535"} +{"id":"4542164","title":"Facebook \"Automatic\" share function","body":"\u003cp\u003eI have a classifieds website, and we also have a Facebook fanpage.\u003c/p\u003e\n\n\u003cp\u003eI would like to share new classifieds in that Fanpage.\nIe, when user posts a new classified, I want a function to \"Share\" it on our FB fanpage.\u003c/p\u003e\n\n\u003cp\u003eIs this possible? How?\u003c/p\u003e\n\n\u003cp\u003eAny articles about how to do it is appreciated?\u003c/p\u003e\n\n\u003cp\u003eThe website is php based.\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","accepted_answer_id":"4542423","answer_count":"1","comment_count":"0","creation_date":"2010-12-27 22:08:32.75 UTC","last_activity_date":"2010-12-27 22:53:59.983 UTC","last_editor_display_name":"","owner_display_name":"user188962","post_type_id":"1","score":"0","tags":"php|javascript|html|facebook","view_count":"5713"} +{"id":"13738769","title":"Android HttpURLConnection POST gives HTTP error 411","body":"\u003cp\u003eI'm having problems with POST request and when running on emulator.\u003c/p\u003e\n\n\u003cp\u003eProblem with device:\nWhen sending POST request I am getting this 411 error (Content-Length required). Adding that request property doesn't help.\u003c/p\u003e\n\n\u003cp\u003eProblem with emulator:\nWhen typing REST url to web client, it works. But when running it with the application client, I get UnkownHostExpection.\u003c/p\u003e\n\n\u003cp\u003eThis far I am pretty clueless what to be done to fix my issues, so I was hoping you could point out some tips to solve these.\u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e\n\n\u003cp\u003eHere is relevant code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e URL url = new URL(\"http://etc..\");\n\n HttpURLConnection conn = (HttpURLConnection) url.openConnection();\n\n conn.addRequestProperty(\"Accept\", \"application/json\");\n conn.addRequestProperty(\"Content-Type\", \"application/json\");\n conn.setRequestProperty(\"Accept-Charset\", CHARSET_UTF8);\n\n conn.setRequestMethod(\"POST\");\n conn.setDoOutput(true);\n conn.setChunkedStreamingMode(0);\n conn.getOutputStream().write(myPostParams.getBytes(CHARSET_UTF8));\n\n conn.connect();\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"2","creation_date":"2012-12-06 07:22:10.63 UTC","last_activity_date":"2015-11-24 00:24:57.34 UTC","last_edit_date":"2015-11-24 00:24:57.34 UTC","last_editor_display_name":"","last_editor_user_id":"1017973","owner_display_name":"","owner_user_id":"1238164","post_type_id":"1","score":"2","tags":"android|android-emulator|android-networking","view_count":"1222"} +{"id":"11833340","title":"Android Device/Screen support","body":"\u003cp\u003eAs you all know, the latest devices from LG, Samsung and HTC got all sorts of different screen dimension.\u003c/p\u003e\n\n\u003cp\u003eAs I tried my app on galaxy sII, older nexus one and they seems fine until I tried it on galaxy tab and all layout is stretched. I only have 1 set of layouts for all; and graphics for ldpi/mdpi/hdpi but not xhdpi \u003c/p\u003e\n\n\u003cp\u003eI am wondering how could I disable support or install for tablet devices like the Tab, Flyer...etc., but supporting the Galaxy note and other 4+\" devices? \u003c/p\u003e\n\n\u003cp\u003eThank you in advance, because I am quite confuse on the screen size vs. density thing\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2012-08-06 17:51:19.42 UTC","last_activity_date":"2012-08-06 18:09:06.467 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"452520","post_type_id":"1","score":"0","tags":"android|android-resolution","view_count":"134"} +{"id":"1578381","title":"IOErrorEvent Eluding Capture","body":"\u003cp\u003eI'm working on a Flex application that processes and displays small amounts of HTML, sometimes including images. I'm getting the HTML out of third-party RSS feeds. Sometimes, I see this in a pop-up window:\u003c/p\u003e\n\n\u003cpre\u003eError #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.\u003c/pre\u003e\n\n\u003cp\u003eThe RSS URL is just fine, but there's apparently something in the downloaded HTML that's causing a problem. Since the application is meant to run as part of a non-interactive digital sign, anything that requires a click to continue is completely unacceptable. I don't care how useless or malformed a URL is; the app needs to ignore the problem without pestering the user.\u003c/p\u003e\n\n\u003cp\u003eUnfortunately, I'm having no luck trapping this event. I'm sprinkling calls like this liberally through the code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[object].addEventListener(IOErrorEvent.IO_ERROR, handleIOError);\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e... where \u003ccode\u003e[object]\u003c/code\u003e is everything from the mx:Text object rendering the HTML to its mx:Canvas parent to the mx:Application top-level app, and \u003ccode\u003ehandleIOError\u003c/code\u003e is a simple function that looks like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e private function handleIOError(event:IOErrorEvent):void {\n trace (\"IO error occurred: \" + event);\n }\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut so far, nothing; that bloody error keeps popping up in the Flash player. Does anybody have any insight as to where I'm going wrong?\u003c/p\u003e","answer_count":"2","comment_count":"2","creation_date":"2009-10-16 14:25:23.703 UTC","last_activity_date":"2009-10-16 14:49:35.08 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"86404","post_type_id":"1","score":"0","tags":"flex|actionscript-3","view_count":"388"} +{"id":"43786377","title":"BRIO Report (.bqy files) export Data into CSV","body":"\u003cp\u003eI have 100 .bqy (Brio report) and i want to export all section data into CSV files by using some programmatic way (python/Java/JS).\u003cbr\u003e\u003cbr\u003e\n\u003cb\u003eCondition: \u003c/b\u003e\u003cbr\u003eI can not connect to server/ DB/ workspace.\u003cbr\u003e\neverything needs to be done in local.\u003cbr\u003eI have installed only Hyperion interactive reporting studio client.\u003c/p\u003e\n\n\u003cp\u003e\u003cb\u003eQuestions:\u003cbr\u003e \n\u003cI\u003e1.\u003c/i\u003e\u003c/b\u003e does Brio Report (.BQY files) allow programming languages to interact? (interact means say fetching section data, exporting data of particular section, applying filter)\nif Yes, then which language?\u003cbr\u003e\n\u003cb\u003e2\u003c/b\u003e Some Java API/SDK are available, but in Hyperion interactive reporting studio client, I did not find any sample and SDK referenced library/jars, with some trick, \u003cb\u003ecan i able to run my custom java code on Brio file(.bqy files)\u003c/b\u003e\nFor further reference,\n\u003cbr\u003e[\u003ca href=\"https://docs.oracle.com/cd/E10530_01/doc/epm.931/hs_developer.pdf][1]\" rel=\"nofollow noreferrer\"\u003ehttps://docs.oracle.com/cd/E10530_01/doc/epm.931/hs_developer.pdf][1]\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI did this work using js, Actually I am stuck here, looking for further step.\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2017-05-04 14:56:24.083 UTC","last_activity_date":"2017-05-04 15:03:19.43 UTC","last_edit_date":"2017-05-04 15:03:19.43 UTC","last_editor_display_name":"","last_editor_user_id":"5059894","owner_display_name":"","owner_user_id":"5059894","post_type_id":"1","score":"0","tags":"java|python|reporting|hyperion|brio","view_count":"66"} +{"id":"26131421","title":"IBM Worklight update / migrating from version 6.1 to 6.2 error","body":"\u003cp\u003eI download the new version (6.2) but when i try to run my app it show several errors as:\u003c/p\u003e\n\n\u003cp\u003e-No MBean found for worklight project\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003cp\u003efiles in the worklight conf server folder cannot be found\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003ecant deploy adapter\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003ecan run app on server\u003c/p\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003edo i need to make something especial, or there ir a guide where i can follow the steps to pass from 6.1 to 6.2??\u003c/p\u003e","accepted_answer_id":"26162083","answer_count":"1","comment_count":"5","creation_date":"2014-09-30 22:47:37.067 UTC","last_activity_date":"2014-10-02 13:37:13.8 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3889543","post_type_id":"1","score":"0","tags":"html|eclipse|ibm-mobilefirst","view_count":"124"} +{"id":"27285363","title":"Wordpress jQuery is not found when using specific theme","body":"\u003cp\u003eI have created a shortcode via a plugin which adds a bunch of javascript and html out to a page via the PHP for the plugin.\u003c/p\u003e\n\n\u003cp\u003eThis works just great on the twentyfourteen theme - and my plugin works as expected.\u003c/p\u003e\n\n\u003cp\u003eWhen I try installing my plugin and using my shortcode in a OptimizePress theme it does not work.\u003c/p\u003e\n\n\u003cp\u003eWhen I attempt it there is a console error stating :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eUncaught ReferenceError: jQuery is not defined\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is on this line:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e jQuery(document).ready(function() { --this line\n jQuery('#calendar').fullCalendar({\n header: {\n left: 'prev,next today',\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is part of the javascript I add to the page as part of the shortcode.\u003c/p\u003e\n\n\u003cp\u003eInterestingly when I look at the source for the page there is certainly jQuery loaded. However, for some reason when I use this shortcode in this theme it has positioned my javascript I echo out as part of the plugin into the \u003cstrong\u003e\u003c/strong\u003e as seen in my picture below (my code is inside the highlighted script tag)- whereas the jQuery doesnt load until the end of the page - which is probably why we hit this error with jQuery not being defined.\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/vetHT.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eWhen the shortcode is used in the twentyfourteen theme my javascript output as part of the plugin is contained inline within the body as seen in this pic (the script tag) of the page - meaning it can find jQuery as it will have loaded:\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/tyzq9.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eCan anybody suggest why this is happening and how I can make my javascript sit inline rather than in the of my document when using shortcodes in OptimizePress to help resolve this error or any other solutions to resolving this problem.\u003c/p\u003e","answer_count":"1","comment_count":"8","creation_date":"2014-12-04 02:40:49.453 UTC","last_activity_date":"2014-12-04 15:58:37.95 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"265683","post_type_id":"1","score":"0","tags":"javascript|jquery|wordpress|wordpress-plugin|wordpress-theming","view_count":"369"} +{"id":"24276281","title":"Batch file not in silence mode del /s /q /f file","body":"\u003cp\u003eWhen i run this command in cmd or as a batch file it does not run in silence mode as /q should do, instead it displays \"Deleted file - file\"\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edel /s /q /f file\nDelteded file - file\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ei hope this will help others as well\u003c/p\u003e","accepted_answer_id":"24276378","answer_count":"2","comment_count":"0","creation_date":"2014-06-18 02:47:18.833 UTC","last_activity_date":"2014-06-18 02:59:54.497 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3750124","post_type_id":"1","score":"4","tags":"batch-file","view_count":"9000"} +{"id":"19244963","title":"Rails 3 retain value of Dropdown box which is populated by ajax after validation fails","body":"\u003cp\u003eHave three dropdown box for country,state and city. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e.entry.float\n %label{:for =\u0026gt; \"hospital-country\"} Country\n = select_tag :country_id, options_for_select([\"Select option\"] + @countries.collect{ |c| [c.name, c.id] },@hospital.country_id),{:name =\u0026gt;\"hospital[country_id]\",:class =\u0026gt; \"select r5\",:id =\u0026gt; \"hospital-country\",:onchange=\u0026gt;\"country_change()\"}\n\n.entry.float\n %label{:for =\u0026gt; \"hospital-state\"} State\n = select_tag :state, options_for_select([\"Select option\"]),{:name =\u0026gt;\"hospital[state]\",:id =\u0026gt; 'hospital-state',:class =\u0026gt; \"select r5\",:disabled =\u0026gt; true,:onchange=\u0026gt;\"state_change()\"}\n\n.entry.float\n %label{:for =\u0026gt; \"hospital-city\"} City\n = select_tag :city, options_for_select([\"Select option\"]),{:name =\u0026gt;\"hospital[city]\",:id =\u0026gt; 'hospital-city',:class =\u0026gt; \"select r5\",:disabled =\u0026gt; true}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn which country is populated by `\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e@countries = WorldCountry.all\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003e`\nand state and cities are populated by ajax call of country and state dropdown box respectively using jquery\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction country_change() {\n $('#hospital-state').find('option[value!=\"Select option\"]').remove();\n $('#hospital-state').next().text(\"Select option\");\n $('#hospital-state').attr('disabled', 'disabled');\n $('#hospital-city').find('option[value!=\"Select option\"]').remove();\n $('#hospital-city').next().text(\"Select option\");\n $('#hospital-city').attr('disabled', 'disabled');\n if ($('#hospital-country').val() != \"\" \u0026amp;\u0026amp; $('#hospital-country').val() != \"Select option\") {\n $.ajax({\n type : 'post',\n url : '/hospitals/country_change',\n data : {\n country_id : $('#hospital-country').val()\n },\n dataType : \"json\",\n success : function(data) {\n var select = $('#hospital-state');\n if (data.length \u0026gt; 0) {\n select.removeAttr('disabled');\n $.each(data, function(key, value) {\n $(\"\u0026lt;option/\u0026gt;\").val(value[1]).text(value[0]).appendTo(select);\n });\n } \n },\n failure : function() {\n }\n })\n } \n};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAll this are working. But when validation fails i can only retain the value of country.\nHow to retain the value of State and Cities which works only in ajax.\u003c/p\u003e","accepted_answer_id":"19262837","answer_count":"1","comment_count":"1","creation_date":"2013-10-08 10:17:51.837 UTC","favorite_count":"0","last_activity_date":"2013-10-09 03:59:09.153 UTC","last_edit_date":"2013-10-08 10:31:24 UTC","last_editor_display_name":"","last_editor_user_id":"2805785","owner_display_name":"","owner_user_id":"2805785","post_type_id":"1","score":"0","tags":"ruby-on-rails-3","view_count":"341"} +{"id":"5226251","title":"HTML: Image with absolute position, text flow over. How to do it?","body":"\u003cp\u003eI'm trying to modify a code not written by me, so I want to modify only what's necessary, to not mess up with an entire site.\u003c/p\u003e\n\n\u003cp\u003eI want to achieve this\n\u003ca href=\"http://www.yourhtmlsource.com/examples/positioning1.html\" rel=\"nofollow\"\u003ehttp://www.yourhtmlsource.com/examples/positioning1.html\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003ebut with the image in the back, instead of being in front of text.\u003c/p\u003e\n\n\u003cp\u003eHow can I do it without using position:absolute on text?\u003c/p\u003e\n\n\u003cp\u003e(source:http://www.yourhtmlsource.com/stylesheets/csslayout.html)\u003c/p\u003e","accepted_answer_id":"5226274","answer_count":"2","comment_count":"0","creation_date":"2011-03-07 22:52:01.827 UTC","last_activity_date":"2011-03-07 23:01:38.97 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"648958","post_type_id":"1","score":"2","tags":"html|css","view_count":"2980"} +{"id":"46196357","title":"Check if an attached object have any related data base on navigation property","body":"\u003cp\u003eI was try to create a function that could detect if one attached object have related data in different table.\u003c/p\u003e\n\n\u003cp\u003eI expect to avoid cascade delete but warn the user manually remove the children instead.\nIt has to be dynamic and each navigation property is also unknown type.\nThere are too many various class instance, and the properties are changing everyday, so I can't hard code otherwise I can just count them one by one.\u003c/p\u003e\n\n\u003cp\u003eMy problem is when I selecting the value return by Property.GetValue(), it is boxed object and also there are dynamic type collection within, therefore I can't count the record and do the relevant checking.\u003c/p\u003e\n\n\u003cp\u003eMy question is how can I cast object convert to ICollection refer to the dynamic type in Linq method?\u003c/p\u003e\n\n\u003cp\u003eI was spending one whole day and couldn't get an answer, maybe it is my misunderstanding of the EF concept but please help, many thanks!\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e//Domain Model\npublic class Course\n{\n [Key]\n public int CourseID { get; set; }\n [ForeignKey(\"CourseID\")]\n public virtual ICollection\u0026lt;CourseTeacher\u0026gt; Teachers { get; set; }\n [ForeignKey(\"CourseID\")]\n public virtual ICollection\u0026lt;CourseInfo\u0026gt; CourseInfo { get; set; }\n [ForeignKey(\"CourseID\")]\n public virtual ICollection\u0026lt;CourseSession\u0026gt; Sessions { get; set; }\n}\n\n// Controller Delete Action\n[HttpPost, ActionName(\"Delete\")]\n[ValidateAntiForgeryToken]\npublic ActionResult DeleteConfirmed(int id)\n{\n Course course = db.Courses.Find(id);\n\n bool CannotDel = ValidateRelationalData(typeof(course), course);\n\n //if failed, warn the user and stop the delete action otherwise delete this record\n}\n\n// Public function I was trying to make \npublic static bool ValidateRelationalData(Type anyType, dynamic anyInstance)\n{\n bool IsExisted = anyType.GetProperties()\n .Where(p =\u0026gt; typeof(IEnumerable).IsAssignableFrom(p.PropertyType) \u0026amp;\u0026amp;\n p.PropertyType != typeof(byte[]) \u0026amp;\u0026amp;\n p.PropertyType != typeof(string)\n )\n .Select(prop =\u0026gt; (ICollection)prop.GetValue(anyInstance, null))\n .Where(c =\u0026gt; c.Count() \u0026gt; 0)\n .Any(); //(ICollection)prop.GetValue(anyInstance, null)) won't work here, because no specific type\n return IsExisted;\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"46197703","answer_count":"1","comment_count":"0","creation_date":"2017-09-13 11:28:10.063 UTC","favorite_count":"1","last_activity_date":"2017-09-13 20:06:37.577 UTC","last_edit_date":"2017-09-13 12:04:37.827 UTC","last_editor_display_name":"","last_editor_user_id":"1013839","owner_display_name":"","owner_user_id":"1013839","post_type_id":"1","score":"2","tags":"c#|.net|linq|reflection|entity-framework-6","view_count":"84"} +{"id":"46649202","title":"Run Goglang with aws-vault","body":"\u003cp\u003eI use aws-vault to establish a secure sesssion to my dev AWS env in ZSH, all good. Now I want to run my IDE (Gogland) such that it assumes that aws-vault session so that I can then in turn debug some tests that have a dependency on S3.\u003c/p\u003e\n\n\u003cp\u003eHow can I can a process (such as Gogland) so that it inherits the aws-vault session? I have tried simply starting Gogland from the shell after having established a vault session to no avail.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-10-09 14:46:36.633 UTC","last_activity_date":"2017-10-09 16:10:09.54 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1022177","post_type_id":"1","score":"0","tags":"amazon-web-services|gogland|aws-vault","view_count":"22"} +{"id":"30418577","title":"How to define priorities for request mappings in Spring MVC?","body":"\u003cp\u003eUsing SpringMVC, I have a method that catch all REST requests:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@RequestMapping(value = \"/**\")\npublic Object catchAll(@RequestBody(required = false) Object body, HttpMethod method, HttpServletRequest request, HttpServletResponse response) {\n // ...\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow I would like to catch just a few requests with the following endpoint:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@RequestMapping(value = \"/test\", method = RequestMethod.POST)\npublic Object post(@RequestBody Object body, HttpMethod method, HttpServletRequest request, HttpServletResponse response) {\n // ...\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eRight now, when I call:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e/test\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003ethe second method is never called.\u003c/p\u003e\n\n\u003cp\u003eWhat can I do to have my 2nd method always called in place of the first one?\u003c/p\u003e","accepted_answer_id":"30419551","answer_count":"1","comment_count":"1","creation_date":"2015-05-23 23:30:09.907 UTC","last_activity_date":"2015-05-24 02:38:34.927 UTC","last_edit_date":"2015-05-23 23:58:06.057 UTC","last_editor_display_name":"","last_editor_user_id":"1365879","owner_display_name":"","owner_user_id":"1365879","post_type_id":"1","score":"1","tags":"java|spring|rest|spring-mvc","view_count":"758"} +{"id":"41795363","title":"How to handle heavily nested objects with D3","body":"\u003cp\u003eDisclaimer: I'm very new to D3, so I'm certain this is possible but haven't yet figured out even what to search for to figure it out. \u003c/p\u003e\n\n\u003cp\u003eI'm trying to create a visualization using D3 that pulls from one large array full of nested JSON objects/arrays. For the sake of example, let's say my object looks like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar arr = [\n {\n \"name\":\"John\",\n \"info\":[\n {\n \"age\":31,\n \"height\":6,\n \"weight\":155,\n \"eyes\":\"green\"\n },\n {\n \"age\":35,\n \"height\":6,\n \"weight\":165,\n \"eyes\":\"green\"\n }\n ]\n },\n {\n \"name\":\"Eric\",\n \"info\":[\n {\n \"age\":29,\n \"height\":5,\n \"weight\":135,\n \"eyes\":\"brown\"\n },\n {\n \"age\":30,\n \"height\":5,\n \"weight\":155,\n \"eyes\":\"brown\"\n }\n ]\n }\n]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow, say I want to take this data and visualize it, but need to use more divs for styling than the nesting levels of the object reflect. So, I want code that looks like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div\u0026gt;\n \u0026lt;h1\u0026gt;John\u0026lt;/h1\u0026gt;\n \u0026lt;div\u0026gt;\n \u0026lt;div\u0026gt;\n \u0026lt;div\u0026gt;\n \u0026lt;h2\u0026gt;Age:31\u0026lt;/h2\u0026gt;\n \u0026lt;div\u0026gt;\n \u0026lt;p\u0026gt;Weight:155\u0026lt;/p\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div\u0026gt;\n \u0026lt;h2\u0026gt;Age:35\u0026lt;/h2\u0026gt;\n \u0026lt;div\u0026gt;\n \u0026lt;p\u0026gt;Weight:165\u0026lt;/p\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u0026lt;div\u0026gt;\n \u0026lt;h1\u0026gt;Eric\u0026lt;/h1\u0026gt;\n \u0026lt;div\u0026gt;\n \u0026lt;div\u0026gt;\n \u0026lt;div\u0026gt;\n \u0026lt;h2\u0026gt;Age:29\u0026lt;/h2\u0026gt;\n \u0026lt;div\u0026gt;\n \u0026lt;p\u0026gt;Weight:135\u0026lt;/p\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div\u0026gt;\n \u0026lt;h2\u0026gt;Age:30\u0026lt;/h2\u0026gt;\n \u0026lt;div\u0026gt;\n \u0026lt;p\u0026gt;Weight:155\u0026lt;/p\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt; \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow, if I didn't have extra divs, it'd be fairly simple to use\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar visualization = d3.select(\"body\").selectAll(\"div\")\n .data(arr)\n .enter()\n .append(\"div\");\n\nvar person = visualization.selectAll(\"h1\")\n .data(function(d){return(d.name)}\n .enter()\n .append(\"h1\")\n .text(function(d){return d});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd then I could do the same with divs and loop through d.info to create what I need. However, when I append nested divs I can no longer use the data of the parents to loop through, and can't seem to find the index of the parent div in the automatic looping through that .data() does. \u003c/p\u003e\n\n\u003cp\u003eReally, what I want to be able to do is create divs based on the length of arr[], append some info like \"name\" to that div, then append some divs for stylistic purposes to the root div, then get back into just the data of that root div for looping through. I would like to use D3 to do this because I know this is what it's built for, but at this point I'm about ready to brute force it using for loops where I know the index I'm in and can use that on more nested data. Hopefully that makes sense, but I'm completely stuck on how to properly do it using D3.\u003c/p\u003e\n\n\u003cp\u003ePlease ask if any of this is unclear - really hoping to get this figured out. Thanks!\u003c/p\u003e","accepted_answer_id":"41796562","answer_count":"1","comment_count":"0","creation_date":"2017-01-22 19:43:21.78 UTC","last_activity_date":"2017-01-22 21:54:27.227 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7294740","post_type_id":"1","score":"1","tags":"javascript|json|d3.js|nested|visualization","view_count":"36"} +{"id":"12169281","title":"how to call a Google API","body":"\u003cp\u003eI read the following two pages on Google:\n1) \u003ca href=\"https://developers.google.com/google-apps/documents-list/#getting_a_list_of_documents_and_files\" rel=\"nofollow\"\u003ehttps://developers.google.com/google-apps/documents-list/#getting_a_list_of_documents_and_files\u003c/a\u003e\nand\n2) \u003ca href=\"https://developers.google.com/accounts/docs/OAuth2WebServer\" rel=\"nofollow\"\u003ehttps://developers.google.com/accounts/docs/OAuth2WebServer\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI can go as far as getting an access_token (OAuth2) to be used in a subsequent Google API call (I want to call Google Docs Listing or Google Drive).\u003c/p\u003e\n\n\u003cp\u003eI wanted to use curl or something similar and just form my https URL.\n- As such in the 1st document states to form a URL as follows:\nhttps: //docs.google.com/feeds/default/private/full\n- In the 2nd document, the example states to use something like https: //www.googleapis.com/oauth2/v1/userinfo?access_token=xxxxx\n(adding the access token to the call)\u003c/p\u003e\n\n\u003cp\u003eSeveral questions\n- Do I call googleapis.com or docs.google.com?\n- can I call https: //docs.google.com/feeds/default/private/full?access_token=xxxxx \n just add the access token to the call?\u003c/p\u003e\n\n\u003cp\u003ethanks\u003c/p\u003e","answer_count":"3","comment_count":"0","creation_date":"2012-08-29 00:14:46.407 UTC","favorite_count":"1","last_activity_date":"2015-01-13 11:00:25.667 UTC","last_edit_date":"2012-08-29 04:11:23.9 UTC","last_editor_display_name":"","last_editor_user_id":"186674","owner_display_name":"","owner_user_id":"1368599","post_type_id":"1","score":"3","tags":"google-api|google-docs-api|google-drive-sdk","view_count":"3206"} +{"id":"24611936","title":"Why there is no writeStringArray() in Parcel.cpp?","body":"\u003cp\u003eWhy there's no writeStringArray() in cpp implementation?\nI found there's writeStringArray() in java but not in cpp.\nOf course I can simply write one refer to the java code, just wondering why Android didn't provide that interface?\nIs there any concern?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-07-07 13:38:07.603 UTC","last_activity_date":"2014-07-07 13:47:08.473 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1318878","post_type_id":"1","score":"0","tags":"android|android-framework|parcel","view_count":"172"} +{"id":"30533154","title":"Create a slideshow with 5 images using ffmpeg with an output rate of 3 fps","body":"\u003cp\u003eI tried everything, so this is my last chance.\u003c/p\u003e\n\n\u003cp\u003eI need to make a slideshow using ffmpeg of the following files:\nimage-1.jpg\nimage-2.jpg\nimage-3.jpg\nimage-4.jpg\nimage-5.jpg\u003c/p\u003e\n\n\u003cp\u003eThe input rate will be 1 fps (these are images so it's normal), but I would like the output rate to be 3 fps. Each image must last 1 minute for example.\u003c/p\u003e\n\n\u003cp\u003eMy aim is to have the smallest output file size for this slideshow. I can use any codec I want.\u003c/p\u003e\n\n\u003cp\u003eI tried this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003effmpeg -f image2 -r 1/30 -i image-%d.jpeg video.mpg\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut ffmpeg says:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eMPEG1/2 does not support 5/1 fps\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"0","creation_date":"2015-05-29 15:13:57.15 UTC","last_activity_date":"2015-05-29 15:49:00.063 UTC","last_edit_date":"2015-05-29 15:49:00.063 UTC","last_editor_display_name":"","last_editor_user_id":"4953735","owner_display_name":"","owner_user_id":"4953735","post_type_id":"1","score":"2","tags":"image|ffmpeg|slideshow","view_count":"202"} +{"id":"41520838","title":"\"Could not resolve name\" while debugging ALEA Kernel with Atomic Operation (atomic_add)","body":"\u003cp\u003eI am using ALEA GPU for GPU Programming (C#). If I use an Atomic Operation like atomic_add in the Kernel, I get \"Could not resolve name\" error in CUDA WarpWatch window for my variables during Kernel debugging. I see the values of blockIdx.x, blockDim.x, threadIdx.x and arrays but variable names cannot be resolved. The kernel works as expected but variables cannot be monitored during debugging, thus making it difficult to fix any bug. CUDA 8 Toolkit is installed and I am using Visual Studio 2015. \u003c/p\u003e\n\n\u003cp\u003eAny ideas?\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2017-01-07 11:16:34.843 UTC","last_activity_date":"2017-01-08 14:41:41.143 UTC","last_edit_date":"2017-01-07 21:44:22.993 UTC","last_editor_display_name":"","last_editor_user_id":"7387238","owner_display_name":"","owner_user_id":"7387238","post_type_id":"1","score":"0","tags":"c#|cuda|aleagpu","view_count":"93"} +{"id":"31376467","title":"Make custom selected tab bar Item in iOS Swift","body":"\u003cp\u003eI am working on an application using Swift which needs to have a TabBarController and when user will select a tab then that particular tab bar item shows a 3d visual effect (Although it will be an static image I guess) which contains shadow and that tab bar item will be bigger in size as well with different tint colour. \u003c/p\u003e\n\n\u003cp\u003ePlease see the attached image.\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/GRFQy.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eI have searched a lot on internet but no luck. Please someone help :( \u003c/p\u003e","answer_count":"2","comment_count":"2","creation_date":"2015-07-13 06:12:12.96 UTC","last_activity_date":"2015-07-13 06:23:28.097 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2811053","post_type_id":"1","score":"1","tags":"ios|user-interface|uitabbarcontroller|uitabbaritem","view_count":"538"} +{"id":"8740014","title":"A strange String assignment phnomenon in Java","body":"\u003cpre\u003e\u003ccode\u003epublic static void main(String[] args){\n\n/* lots of codes */\n\n if(profile.addFriend(buffernametwo)){\n boolean a = profile.addFriend(buffernametwo);\n System.out.println(a); \n //prints false; however if I directly put profile.addFriend(buffernametwo) \n //and follow the debugger, it will appear true\n\n /* lots of codes */\n\n }\n/* lots of codes */\n\n//the following method is in a different class\n\npublic boolean addFriend(String friend) {\n\n for(int i = 0;i \u0026lt; profile_friend.size();i++){\n //Here is the point\n if(friend == profile_friend.get(i)){\n return false;\n }\n }\n profile_friend.add(friend);\n return true;\n\n/* lots of codes */\n\nprivate ArrayList\u0026lt;String\u0026gt; profile_friend = new ArrayList\u0026lt;String\u0026gt;();\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe question is in the comment of the code\u003c/p\u003e","answer_count":"2","comment_count":"4","creation_date":"2012-01-05 09:13:08.173 UTC","last_activity_date":"2012-01-18 19:58:11.487 UTC","last_edit_date":"2012-01-18 19:58:11.487 UTC","last_editor_display_name":"","last_editor_user_id":"20770","owner_display_name":"","owner_user_id":"807018","post_type_id":"1","score":"0","tags":"string|boolean|variable-assignment|equals","view_count":"89"} +{"id":"46185677","title":"What databases are needed for IdentityServer4 AD provider","body":"\u003cp\u003eCurrently I have a working IdentityServer4 service that allows users to authenticate to active directory only. They authenticate and then they have no issue accessing the api. I'm using the the IDP server from \u003ca href=\"https://github.com/IdentityServer/IdentityServer4.Samples/tree/release/Quickstarts/8_EntityFrameworkStorage/src/QuickstartIdentityServer\" rel=\"nofollow noreferrer\"\u003eIdentityServer4 Quickstart\u003c/a\u003e with all the local user account stuff stripped out. Here is my database:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/TPwLC.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/TPwLC.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eMy question is this, were are tokens stored? Only in the browser? Am I doing something wrong? Should there be some sort of database that holds tokens for SSO? It is working but I'm worried I'm missing out on some sort of functionality.\u003c/p\u003e","accepted_answer_id":"46231056","answer_count":"1","comment_count":"0","creation_date":"2017-09-12 21:36:03.49 UTC","last_activity_date":"2017-09-15 03:05:44.127 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4055033","post_type_id":"1","score":"1","tags":"identityserver4","view_count":"40"} +{"id":"35439986","title":"SQLite autoincrement primary key fields dont allow update","body":"\u003cp\u003eI have got a database table with a column \"id INTEGER PRIMARY KEY AUTOINCREMENT\". When I try to update an existing row of this table with the primary key, the app exits saying \"Unfortunately is stopped.\"\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic int updateUser(User user) {\n SQLiteDatabase db = this.getWritableDatabase();\n\n ContentValues values = new ContentValues();\n\n values.put(KEY_FIRSTNAME, user.getUser_firstName()); // user first name\n values.put(KEY_LASTNAME, user.getUser_lastName()); // user first name\n values.put(KEY_USERNAME, user.getUsername());\n values.put(KEY_PASSWORD, user.getPassword());\n values.put(KEY_USERLEVEL, user.getUser_level());\n values.put(KEY_DESIGNATION, user.getDesignation());\n values.put(KEY_MOBILENO, user.getMobile_no());\n values.put(KEY_EMAIL, user.getEmail());\n values.put(KEY_NIC, user.getNIC());\n values.put(KEY_GENDER, user.getGender());\n values.put(KEY_DOB, user.getDOB());\n values.put(KEY_AVAILABILITY, user.getAvailability());\n\n db.close();\n\n // updating row\n return db.update(TABLE_USERS, values, KEY_ID + \" = ?\",\n new String[] { String.valueOf(user.getUser_id()) });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eLogcat :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eE/AndroidRuntime﹕ FATAL EXCEPTION: main\njava.lang.RuntimeException: Unable to start activity ComponentInfo{com.projectmanagementsys.com.sasith.project_management/com.projectmanagementsys.com.sasith.project_management.AddUser}: java.lang.IllegalStateException: attempt to re-open an already-closed object: SQLiteDatabase: /data/data/com.projectmanagementsys.com.sasith.project_management/databases/ProjectManagement\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThere is no error in the whole thing and the code works well when I comment the update query. Can someone give a solution please ?\nThank you.\u003c/p\u003e","accepted_answer_id":"35442143","answer_count":"1","comment_count":"7","creation_date":"2016-02-16 18:08:35.067 UTC","last_activity_date":"2016-02-16 20:15:17.797 UTC","last_edit_date":"2016-02-16 18:48:07.5 UTC","last_editor_display_name":"","last_editor_user_id":"4932745","owner_display_name":"","owner_user_id":"4932745","post_type_id":"1","score":"-1","tags":"android|sqlite|android-sqlite|android-database","view_count":"55"} +{"id":"7944438","title":"I/O Operation On Channels Using ByteBuffer - Performance Comparision","body":"\u003cp\u003eI want to perform I/O operation on channels using \u003ccode\u003eByteBuffer\u003c/code\u003e. Finally I came up with three solutions:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eFileChannel inChannel = new FileInputStream(\"input.txt\").getChannel();\nFileChannel outChannel = new FileOutputStream(\"output.txt\").getChannel();\nByteBuffer buf = ByteBuffer.allocate(1024 * 1024);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMethod 1: using \u003ccode\u003ehasRemaining()\u003c/code\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ewhile (inChannel.read(buf) != -1) {\n buf.flip(); \n while (buf.hasRemaining()) {\n outChannel.write(buf);\n } \n buf.clear();\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMethod 2: using \u003ccode\u003ecompact()\u003c/code\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ewhile (inChannel.read(buf) != -1 || buf.position() \u0026gt; 0) {\n buf.flip();\n outChannel.write(buf);\n buf.compact();\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMethod 3: hybrid model\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ewhile (inChannel.read(buf) != -1) {\n buf.flip();\n outChannel.write(buf);\n buf.compact();\n}\n// final flush of pending output\nwhile (buf.hasRemaining())\n outChannel.write(buf);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe question is: Which method has the most performance and throughput?\u003c/p\u003e","accepted_answer_id":"7944604","answer_count":"2","comment_count":"1","creation_date":"2011-10-30 10:38:46.937 UTC","favorite_count":"1","last_activity_date":"2011-11-10 18:13:03.487 UTC","last_edit_date":"2011-10-30 12:15:57.597 UTC","last_editor_display_name":"","last_editor_user_id":"57695","owner_display_name":"","owner_user_id":"654269","post_type_id":"1","score":"3","tags":"java|performance|bytebuffer|channels","view_count":"607"} +{"id":"7115807","title":"How to use your own class in glVertexPointer / glColorPointer / glNormalPointer","body":"\u003cp\u003eI have a class representing a vertex as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass Vertex\n{\npublic:\nVertex(void);\n~Vertex(void);\n\nGLfloat x;\nGLfloat y;\nGLfloat z;\n\nGLfloat r;\nGLfloat g;\nGLfloat b;\n\nGLfloat nx;\nGLfloat ny;\nGLfloat nz;\n\nVertex getCoords();\n\nVertex crossProd(Vertex\u0026amp; b);\nvoid normalize();\n\nVertex operator-(Vertex\u0026amp; b);\nVertex\u0026amp; operator+=(const Vertex\u0026amp; b);\nbool operator==(const Vertex\u0026amp; b) const;\n};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI initialize my VBO's as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eglGenBuffers(2, buffers);\n\nglBindBuffer(GL_ARRAY_BUFFER, buffers[0]);\nglBufferData(GL_ARRAY_BUFFER, fVertices.size()*sizeof(Vertex), \u0026amp;(fVertices[0].x), GL_STATIC_DRAW);\nglVertexPointer(3, GL_UNSIGNED_BYTE, sizeof(Vertex), BUFFER_OFFSET(0));\nglColorPointer(3, GL_FLOAT, sizeof(Vertex), BUFFER_OFFSET(6*sizeof(GL_FLOAT)));\nglNormalPointer( GL_FLOAT, sizeof(Vertex), BUFFER_OFFSET(3*sizeof(GL_FLOAT)));\n\nglBindBuffer(GL_ELEMENT_ARRAY_BUFFER, buffers[2]);\nglBufferData(GL_ELEMENT_ARRAY_BUFFER, fIndices.size()*sizeof(GLushort), \u0026amp;fIndices[0], GL_STATIC_DRAW);\nglIndexPointer(GL_UNSIGNED_SHORT, 0, BUFFER_OFFSET(0));\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut when drawing this is all messed up. It's probably because I pass the wrong stride and/or buffer offset I presume.\u003c/p\u003e\n\n\u003cp\u003eThe strange thing is, I was experimenting with pointer to see if the adresses match, trying to figure it out myself, I encountered something odd:\u003c/p\u003e\n\n\u003cp\u003eIf I do: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eGLfloat *test = \u0026amp;(fVertices[0]).x;\nGLfloat *test2 = \u0026amp;(fVertices[0]).y;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethen \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etest + sizeof(GLfloat) != test2;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003efVertices is a std::vector btw.\u003c/p\u003e\n\n\u003cp\u003eHope that anyone can enlighten me about what to pass on to the gl*pointer calls.\u003c/p\u003e","accepted_answer_id":"7116154","answer_count":"1","comment_count":"1","creation_date":"2011-08-19 00:42:46.563 UTC","last_activity_date":"2011-08-19 01:55:29.213 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"440151","post_type_id":"1","score":"2","tags":"c++|opengl","view_count":"1258"} +{"id":"19111639","title":"@using block before @Html.BeginForm","body":"\u003cp\u003eI was wondering why enclose @Html.BeginForm() in @using block like below. Does it matter if I don't use @using block? \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@using (Html.BeginForm())\n{\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"19111699","answer_count":"1","comment_count":"1","creation_date":"2013-10-01 08:41:40.803 UTC","favorite_count":"1","last_activity_date":"2014-02-11 21:38:52.2 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2330518","post_type_id":"1","score":"3","tags":"asp.net|asp.net-mvc","view_count":"1945"} +{"id":"17660757","title":"How do I allocate ludicrous amounts of memory in C?","body":"\u003cp\u003eI'm trying to investigate the practicalities of a d-dimensional range searching algorithm which is proven to be good in the asymptotic cases, but has large constants associated with it. This means I need to be able to vary the number of points in d-dimensional space up to some very large values. Using \u003ccode\u003e1\u0026lt;\u0026lt;20\u003c/code\u003e (2 to the power of 20) points starts causing my \u003ccode\u003emalloc\u003c/code\u003es to return null pointers. I'm \u003ccode\u003efree\u003c/code\u003eing memory up as frequently as I possibly can, and I'm making what few savings I can in what few places I can, but I'd like to be able to go up to values closer to \u003ccode\u003e1\u0026lt;\u0026lt;28\u003c/code\u003e. Is there a conventional way of handling blocks of memory of this sort of size?\u003c/p\u003e","accepted_answer_id":"17660894","answer_count":"4","comment_count":"2","creation_date":"2013-07-15 18:00:38.477 UTC","last_activity_date":"2013-07-15 21:40:05.923 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2581168","post_type_id":"1","score":"0","tags":"c|memory|memory-management","view_count":"153"} +{"id":"3450436","title":"Asynchronous PureMVC in Python","body":"\u003cp\u003eTaking the following code from \u003ca href=\"http://www.andypatterns.com/index.php/blog/puremvc_minimal_wxpython/\" rel=\"nofollow noreferrer\"\u003ehere\u003c/a\u003e, from the shortened version at the bottom, exists this proxy:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass DataModelProxy(puremvc.patterns.proxy.Proxy):\n NAME = \"DataModelProxy\"\n\n def __init__(self):\n super(DataModelProxy, self).__init__(DataModelProxy.NAME, [])\n self.realdata = Data()\n self.sendNotification(AppFacade.DATA_CHANGED, self.realdata.data)\n\n def setData(self, data):\n self.realdata.data = data\n print \"setData (model) to\", data\n self.sendNotification(AppFacade.DATA_CHANGED, self.realdata.data)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eQuoting from \u003ca href=\"http://puremvc.org/pages/docs/Python/docs/\" rel=\"nofollow noreferrer\"\u003ehere\u003c/a\u003e from the PureMVC Python docs, it says:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eA Proxy might simply manage a reference to a local data object, in which case interacting with it might involve setting and getting of its data in synchronous fashion.\u003c/p\u003e\n \n \u003cp\u003eProxy classes are also used to encapsulate the application's interaction with remote services to save or retrieve data, in which case, we adopt an asyncronous idiom; setting data (or calling a method) on the Proxy and listening for a Notification to be sent when the Proxy has retrieved the data from the service.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eIf this is the case, how can I get my proxy to perfrom asynchronously when I have expensive and time consuming data to retreive?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2010-08-10 15:09:24.12 UTC","last_activity_date":"2011-02-16 10:24:03.343 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"302980","post_type_id":"1","score":"2","tags":"python|model-view-controller|asynchronous|puremvc","view_count":"414"} +{"id":"35100100","title":"Form inside Owl Carousel version 1\u00262","body":"\u003cp\u003eI am building a simple form inside an Owl Carousel but I can't get it to work on their version 2.\u003c/p\u003e\n\n\u003cp\u003eThe problem is when the user click inside the input type on the second version the console log gives an error :Uncaught TypeError: Cannot read property 'name' of undefined.\u003c/p\u003e\n\n\u003cp\u003eon the first version everything works fine. \u003ca href=\"https://fiddle.jshell.net/ryangus/w7hn3oem/\" rel=\"nofollow\"\u003eHere is a fiddle for v1\u003c/a\u003e I was just wondering if somebody can take a look, i tried using \u003cstrong\u003emouseDrag:false\u003c/strong\u003e but it doesn't do the trick.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://grupomesm.com/cindy/owl-exp/\" rel=\"nofollow\"\u003eAnd here is the link for version 2\u003c/a\u003e and the code goes like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(document).ready(function () {\n var owl = $('.owl-carousel');\n owl.owlCarousel({\n items:1,\n mouseDrag:false\n\n });\n // Go to the next item\n $('.customNextBtn').click(function () {\n owl.trigger('next.owl.carousel');\n }) \n });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks in advanced for any pointer.\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2016-01-30 09:28:30.313 UTC","last_activity_date":"2016-01-30 09:28:30.313 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1212548","post_type_id":"1","score":"1","tags":"javascript|jquery|owl-carousel|owl-carousel-2","view_count":"306"} +{"id":"45177597","title":"SQL update table loop","body":"\u003cp\u003eI have this following query that gets me a small result set\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT \n LOC, PLAN, FiscalYear, FiscalPeriod, SALES \nFROM\n #CurrentPrd PrdAg\nWHERE \n NOT EXISTS (SELECT AGE.ECPLAN \n FROM ECPG_BAK AGE \n WHERE PrdAg.LOC = AGE.STORE \n AND PrdAg.PLAN = AGE.PLAN \n AND PrdAg.FiscalYear = AGE.FiscalYear \n AND PrdAg.FiscalPeriod = AGE.FiscalPeriod)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe result set looks like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eLOC PLAN FiscalYear FiscalPeriod SALES\n---------------------------------------------------\n 5 6 2031 5 -0.206232\n12 6 2031 5 5.243052\n12 8 2020 4 1.699716\n12 8 2020 5 1.699716\n14 6 2031 5 0.299972\n19 6 2031 5 1.549812\n19 8 2020 5 20.114116\n33 6 2031 5 2.159767\n33 8 2020 5 23.796883\n34 6 2031 5 1.142360\n34 8 2020 5 9.348583\n................................................\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThen I have this other query that gets me a number that I need to add to the \u003ccode\u003eSALES\u003c/code\u003e column. For example, the query below, I used fixed loc and plan to come up with a number:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eselect \n (select SALES \n from #TOT \n where loc = 12 and PLAN = 6) - (select sum(sales) \n from #CurrentPrd \n where store = 12 and PLAN = 6) as Comp\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eLet's assume this query above gets me 10, then I need to add it to line 2 of the result set above, making it \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eLOC PLAN FiscalYear FiscalPeriod SALES\n----------------------------------------------\n12 6 2031 5 15.243052\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy goal is to make it somewhat dynamic and do the whole process in a simple way, so for each LOC and PLAN combination, I would plug those values into the second select to retrieve the correct number to add to SALES, then update #CurrentPrd. Writing the new number to a new temp table is also an option.\u003c/p\u003e\n\n\u003cp\u003eI hope I was able to explain what I'm trying to do. Any help would be appreciated.\u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","accepted_answer_id":"45178214","answer_count":"1","comment_count":"1","creation_date":"2017-07-18 21:42:28.543 UTC","last_activity_date":"2017-07-19 04:53:52.523 UTC","last_edit_date":"2017-07-19 04:53:52.523 UTC","last_editor_display_name":"","last_editor_user_id":"13302","owner_display_name":"","owner_user_id":"7559988","post_type_id":"1","score":"0","tags":"sql-server|dynamic|sql-update","view_count":"52"} +{"id":"24118745","title":"How to assign two consecutive inputs to two different variables?","body":"\u003cp\u003eI have been coding in Python for about 4 months now but I saw a very simple problem on Hackerrank . com which I could not solve. The problem asked to print the sum of the two consecutive inputs from stdin through stdout. Here is the sollution given by hackerrank but I don't undrestand why it works. Why don't both variables get overwritten and get the value of the second input? \u003c/p\u003e\n\n\u003cp\u003eHere is solution given by Hackerrank: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef solveMeFirst(a,b):\n return a+b\n\n\nnum1 = input()\nnum2 = input()\nres = solveMeFirst(num1,num2)\nprint res\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"24118796","answer_count":"2","comment_count":"0","creation_date":"2014-06-09 10:52:41.443 UTC","last_activity_date":"2014-06-09 11:09:08.95 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1938344","post_type_id":"1","score":"0","tags":"python","view_count":"582"} +{"id":"323558","title":"Generic ThreadPool in .NET","body":"\u003cp\u003eHere's a relatively common task for me, and, I think, for many a .NET programmer:\u003cbr\u003e\nI want to use the .NET ThreadPool for scheduling worker threads that need to process a given type of tasks.\u003c/p\u003e\n\n\u003cp\u003eAs a refresher, the signatures for the queueing method of the ThreadPool and its associated delegate are:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic static bool QueueUserWorkItem (\n WaitCallback callBack,\n Object state\n)\npublic delegate void WaitCallback (Object state)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eTherefore, a typical generic worker thread class would look something like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class Worker\u0026lt;T\u0026gt; {\n public void schedule(T i_task) {\n ThreadPool.QueueUserWorkItem(execute, i_task)\n }\n private void execute(Object o){\n T task = (T)o; //What happened to the type safety? \n executeTask(task);\n }\n private void executeTask(T i_task){\n //process i_task\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNotice the type of the \u003ccode\u003estate\u003c/code\u003e parameter? It's \u003cem\u003e\u003ccode\u003eObject\u003c/code\u003e\u003c/em\u003e !\u003c/p\u003e\n\n\u003cp\u003eWhat's the compelling reason why the .NET team chose not to make the \u003ccode\u003eQueueUserWorkItem\u003c/code\u003e method (or the whole \u003ccode\u003eThreadPool\u003c/code\u003e class) generic? I can't believe they just overlooked it.\u003c/p\u003e\n\n\u003cp\u003eHere's how I'd like to see it:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e//in the ThreadPool class:\npublic static bool QueueUserWorkItem\u0026lt;T\u0026gt; (\n WaitCallback\u0026lt;T\u0026gt; callBack,\n T state\n)\npublic delegate void WaitCallback\u0026lt;T\u0026gt; (T state)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis would make the worker class type-safe (and a lot clearer, IMHO):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class Worker\u0026lt;T\u0026gt; {\n public void schedule(T i_task) {\n ThreadPool.QueueUserWorkItem\u0026lt;T\u0026gt;(execute, i_task)\n }\n private void execute(T i_task){\n //process i_task\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI must be missing something.\u003c/p\u003e","accepted_answer_id":"323575","answer_count":"3","comment_count":"0","creation_date":"2008-11-27 11:56:55.3 UTC","favorite_count":"2","last_activity_date":"2012-11-02 07:37:31.297 UTC","last_edit_date":"2012-11-02 07:37:31.297 UTC","last_editor_display_name":"Blair Conrad","last_editor_user_id":"1252063","owner_display_name":"Cristi Diaconescu","owner_user_id":"11545","post_type_id":"1","score":"5","tags":"c#|.net|multithreading|generics|threadpool","view_count":"3283"} +{"id":"283210","title":"Advice on which language/Framework to choose for web application?","body":"\u003cp\u003eI am a c++ developer trying to create a web application using a language or framework that meets the following criteria:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eVery fast development time\u003c/li\u003e\n\u003cli\u003eText searching and other text manipulation\u003c/li\u003e\n\u003cli\u003eEasy to configure and maintain the application\u003c/li\u003e\n\u003cli\u003eTagging system support\u003c/li\u003e\n\u003cli\u003eFree (as in Beer) IDE\u003c/li\u003e\n\u003cli\u003e3-4 weekend project\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eCan anyone suggest a language or framework that would be beneficial, giving this criteria?\u003c/p\u003e","accepted_answer_id":"283244","answer_count":"8","comment_count":"3","creation_date":"2008-11-12 07:00:56.69 UTC","favorite_count":"1","last_activity_date":"2011-12-29 14:33:22.53 UTC","last_edit_date":"2009-04-08 20:48:42.403 UTC","last_editor_display_name":"rajKumar","last_editor_user_id":"16587","owner_display_name":"yesraaj","owner_user_id":"22076","post_type_id":"1","score":"0","tags":"web-applications|frameworks|rad","view_count":"448"} +{"id":"15627173","title":"copy data between sql tables","body":"\u003cp\u003eI am working with sql server 2012 and have a database.\u003c/p\u003e\n\n\u003cp\u003eIn this database, I have 2 tables. 1 table the backend to real time data. The other the exact same structure but a staging table - no real time system working off it.\u003c/p\u003e\n\n\u003cp\u003eI want to write a sql query to be included in a stored procedure/sql job that runs against the staging table and update/insert data in to the real time table. If the record exist in the real time table, update it, if not insert in to it. As the staging table could have ~100,000 when it needs to run each day - I am concerned about performance, in particular the possibility of the real time table being locked. There is a possibility that the real time table is being updated from another source while the query is running, so locking at the row level may be required.\u003c/p\u003e\n\n\u003cp\u003eI have outlined the process and my concern so I would like assistance in writing the query. I need to not impact the performance of the real time table, but unsure no other system updates the row for each row as the data is being transferred. How could I do this with sql?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-03-26 00:16:17.503 UTC","last_activity_date":"2013-03-26 01:00:52.367 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"373674","post_type_id":"1","score":"0","tags":"sql|sql-server|sql-server-2012","view_count":"204"} +{"id":"39789043","title":"How automatically create SQL Server relationship diagram?","body":"\u003cp\u003eI am new to SQL Server. On the previous job I used working with Postgres and MySQL. But now I was faced with the task connected with SQL Server. And I discovered very strange thing in the DB with that I should work. There don't exist any relations! \u003c/p\u003e\n\n\u003cp\u003eIs it normal to SQL Server? How can I automatically connect tables according to their primary keys? Any other ideas? \u003c/p\u003e\n\n\u003cp\u003eAn screenshot of the ER diagram:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/KnDp0.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/KnDp0.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e","answer_count":"0","comment_count":"7","creation_date":"2016-09-30 10:11:27.897 UTC","last_activity_date":"2016-09-30 12:30:39.26 UTC","last_edit_date":"2016-09-30 12:30:39.26 UTC","last_editor_display_name":"","last_editor_user_id":"13302","owner_display_name":"","owner_user_id":"6583790","post_type_id":"1","score":"2","tags":"sql-server|sql-server-2008|tsql|ssms","view_count":"140"} +{"id":"42151453","title":"I want to know the output of code","body":"\u003cpre\u003e\u003ccode\u003efor(print(\"a\");print(\"b\");print(\"c\"))\n{\nprintf(\"d\");\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis question was asked in an interview , my answer was \"abdcabdcabdc.....\" .\n I want to know the proper output an explanation.Please help me out.\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2017-02-10 04:19:42.01 UTC","last_activity_date":"2017-02-10 04:50:56.657 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7543765","post_type_id":"1","score":"-1","tags":"c","view_count":"33"} +{"id":"20373824","title":"Extjs tree panel not loading json data","body":"\u003cp\u003eHi I am trying to load data for tree panel through json and\u003cbr\u003e\nI'm referring \u003ca href=\"http://docs.sencha.com/extjs/4.2.0/extjs-build/examples/build/KitchenSink/ext-theme-neptune/#tree-reorder\" rel=\"nofollow\"\u003ethis link\u003c/a\u003e. tree panel is showing properly except there is no data.\n\u003cbr/\u003e\u003cbr/\u003e here is my code \u003cbr/\u003e \u003cstrong\u003eEdit\u003c/strong\u003e updated code as Objectone suggested\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eExt.require([\n'Ext.tree.*',\n'Ext.data.*',\n'Ext.tip.*'\n]);\n\nExt.onReady(function() {\n\nvar store = Ext.create('Ext.data.TreeStore', {\n proxy: {\n type: 'ajax',\n url: 'treeJson.json'\n }, \n root: {\n expanded: true\n },\n folderSort: true,\n sorters: [{\n property: 'text',\n direction: 'ASC'\n }]\n});\n\nvar tree = Ext.create('Ext.tree.Panel', {\n store: store,\n renderTo: 'tree-div',\n height: 300,\n width: 250,\n title: 'Files',\n useArrows: true,\n dockedItems: [{\n xtype: 'toolbar',\n items: [{\n text: 'Expand All',\n handler: function(){\n tree.expandAll();\n }\n }, {\n text: 'Collapse All',\n handler: function(){\n tree.collapseAll();\n }\n }]\n }]\n});\n\nconsole.log(store.getRootNode());\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ehere is json \u003cbr/\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[\n {\n \"text\": \"To Do\",\n \"cls\": \"folder\",\n \"expanded\": true,\n \"children\": [\n {\n \"text\": \"Go jogging\",\n \"leaf\": true\n },\n {\n \"text\": \"Take a nap\",\n \"leaf\": true\n },\n {\n \"text\": \"Climb Everest\",\n \"leaf\": true\n }\n ]\n}\n]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFirebug is showing no error,\u003cbr/\u003e\nAny idea what I'm doing wrong?\u003c/p\u003e\n\n\u003cp\u003eThanks in advance\u003c/p\u003e","accepted_answer_id":"20377744","answer_count":"1","comment_count":"2","creation_date":"2013-12-04 11:14:30.673 UTC","last_activity_date":"2013-12-05 04:54:58.623 UTC","last_edit_date":"2013-12-05 04:54:58.623 UTC","last_editor_display_name":"","last_editor_user_id":"2918446","owner_display_name":"","owner_user_id":"2918446","post_type_id":"1","score":"1","tags":"javascript|json|extjs|extjs4","view_count":"2540"} +{"id":"38637560","title":"Is there a difference between == true and != false in swift?","body":"\u003cp\u003eI had this code in my Swift App\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunc parseJSON() {\n\n let urlString = \"www.websitethatlinkstoJSONfile.com\"\n\n if NSURL(string: urlString) == true {\n let url = NSURL(string: urlString)\n let data = try? NSData(contentsOfURL: url!, options: []) as NSData\n let json = NSData(data: data!)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e// more code\u003c/p\u003e\n\n\u003cp\u003eHowever, even though the link actually worked and was true, the if statement was never met and it kept skipping it and moving to else. So I changed the code to \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eif NSURL(string: urlString) != false \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand it worked perfectly. I'm not sure why though?\u003c/p\u003e","accepted_answer_id":"38637760","answer_count":"4","comment_count":"2","creation_date":"2016-07-28 13:17:21.287 UTC","last_activity_date":"2016-07-28 14:01:32.957 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6416639","post_type_id":"1","score":"3","tags":"swift|xcode|if-statement|boolean|nsurl","view_count":"934"} +{"id":"43847208","title":"PHP Memory Dump","body":"\u003cp\u003eI have a long execute PHP script that executes for months , In last version I have a memory leakage and I dont know where is problem , As I have many changes in last version I cannot manually check changes\u003c/p\u003e\n\n\u003cp\u003eNotice that is is long execute PHP script after 10 days , I see that the script consume about 5GB RAM (the previous version just consumed 280MB RAM ) , I want to dump memory after days to see what remains in RAM forever , How can I do this?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-05-08 12:04:25.9 UTC","last_activity_date":"2017-05-08 12:14:13.01 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6447123","post_type_id":"1","score":"1","tags":"php|memory-leaks","view_count":"140"} +{"id":"40613363","title":"Cannot convert source type, an explicit conversion exists","body":"\u003cp\u003eI have written a simple excample to clearify my Problem. This is the Code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003einternal interface IAnimal\n{\n string Name { get; set; }\n}\n\nclass Animal : IAnimal\n{\n public string Name { get; set; }\n}\n\nclass Cow : Animal {}\nclass Sheep : Animal {}\n\n\ninternal interface IFarm\u0026lt;T\u0026gt; where T : IAnimal\n{\n T TheAnimal { get; }\n}\n\nclass Farm\u0026lt;T\u0026gt; : IFarm\u0026lt;T\u0026gt; where T : IAnimal\n{\n public T TheAnimal { get; }\n}\n\n\nclass CattleFarm : Farm\u0026lt;Cow\u0026gt; {}\nclass SheepFarm : Farm\u0026lt;Sheep\u0026gt; {}\n\n\nclass Demo\n{\n private IFarm\u0026lt;IAnimal\u0026gt; AnyFarm;\n void Foo()\n {\n AnyFarm = new CattleFarm();\n var name = AnyFarm.TheAnimal.Name;\n AnyFarm = new SheepFarm();\n name = AnyFarm.TheAnimal.Name;\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhy do I get the compiler error when trying to assign CattleFarm or SheepFarm to AnyFarm?\u003c/p\u003e\n\n\u003cp\u003eWhere is my fault?\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2016-11-15 15:13:43.767 UTC","last_activity_date":"2016-11-15 15:13:43.767 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2037761","post_type_id":"1","score":"0","tags":"c#|syntax-error","view_count":"26"} +{"id":"45720359","title":"How to parse through JSON data from URL in Swift 3","body":"\u003cp\u003eI am trying to loop through a JSON dictionary which is retrieved from POSTing to a URL. After retrieving the data and serializing it as a JSON object, I am unable to access the individual parts of the data.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunc retrieveLotStatus(lotNumber: String) {\n let allowedChars = (CharacterSet(charactersIn: \"!*'();:@\u0026amp;=+$,/?%#-[] \").inverted)\n\n var url = URLRequest(url: URL(string: \"fakeURLHere\")!)\n let BodyData = \"lotNum=\" + lotNumber + \"\u0026amp;field=\" + PHASE.addingPercentEncoding(withAllowedCharacters: allowedChars)!\n url.httpMethod = \"POST\"\n url.httpBody = BodyData.data(using: .utf8)\n let task = URLSession.shared.dataTask(with: url) { data, response, error in\n guard let data = data, error == nil else {\n print(error?.localizedDescription ?? \"No Data\")\n return\n }\n let responseJSON = try? JSONSerialization.jsonObject(with: data, options: [])\n print(responseJSON)\n if let jsonData = responseJSON as? [String: Any] {\n if let ItemNumber = jsonData[\"ItemNumber\"] as? [String: Any] {\n print(ItemNumber)\n }\n }\n }\n task.resume()\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is an example of what JSON data is being retrieved when printing the response for reference\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Optional(\u0026lt;__NSArrayI 0x17d08c90\u0026gt;(\n{\n Count = 4;\n ItemNumber = 1;\n PercentComplete = \"100.00\";\n Total = 4;\n},\n{\n Count = 1;\n ItemNumber = 10;\n PercentComplete = \"100.00\";\n Total = 1;\n},\n{\n Count = 1;\n ItemNumber = 10a;\n PercentComplete = \"100.00\";\n Total = 1;\n},\n{\n Count = 1;\n ItemNumber = 11;\n PercentComplete = \"100.00\";\n Total = 1;\n},\n{\n Count = 1;\n ItemNumber = 11a;\n PercentComplete = \"100.00\";\n Total = 1;\n},\n{\n Count = 4;\n ItemNumber = 1a;\n PercentComplete = \"100.00\";\n Total = 4;\n},\n{\n Count = 2;\n ItemNumber = 2;\n PercentComplete = \"100.00\";\n Total = 2;\n},\n{\n Count = 2;\n ItemNumber = 2a;\n PercentComplete = \"100.00\";\n Total = 2;\n},\n{\n Count = 1;\n ItemNumber = 3;\n PercentComplete = \"100.00\";\n Total = 1;\n},\n{\n Count = 1;\n ItemNumber = 3a;\n PercentComplete = \"100.00\";\n Total = 1;\n},\n{\n Count = 1;\n ItemNumber = 4;\n PercentComplete = \"100.00\";\n Total = 1;\n},\n{\n Count = 1;\n ItemNumber = 4a;\n PercentComplete = \"100.00\";\n Total = 1;\n},\n{\n Count = 1;\n ItemNumber = 5;\n PercentComplete = \"100.00\";\n Total = 1;\n},\n{\n Count = 1;\n ItemNumber = 5a;\n PercentComplete = \"100.00\";\n Total = 1;\n},\n{\n Count = 1;\n ItemNumber = 6;\n PercentComplete = \"100.00\";\n Total = 1;\n},\n{\n Count = 1;\n ItemNumber = 6a;\n PercentComplete = \"100.00\";\n Total = 1;\n},\n{\n Count = 1;\n ItemNumber = 7;\n PercentComplete = \"100.00\";\n Total = 1;\n},\n{\n Count = 1;\n ItemNumber = 7a;\n PercentComplete = \"100.00\";\n Total = 1;\n},\n{\n Count = 1;\n ItemNumber = 8;\n PercentComplete = \"100.00\";\n Total = 1;\n},\n{\n Count = 1;\n ItemNumber = 8a;\n PercentComplete = \"100.00\";\n Total = 1;\n},\n{\n Count = 1;\n ItemNumber = 9;\n PercentComplete = \"100.00\";\n Total = 1;\n},\n{\n Count = 1;\n ItemNumber = 9a;\n PercentComplete = \"100.00\";\n Total = 1;\n}\n)\n)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am trying to loop through each object and append the value to a table. However before I can get to formatting them as UITableCell, I am trying to simply read each responseJSON[\"ItemNumber\"], responseJSON[\"Count\"], responseJSON[\"Total\"] and responseJSON[\"PercentComplete\"]\u003c/p\u003e","accepted_answer_id":"45720724","answer_count":"1","comment_count":"1","creation_date":"2017-08-16 18:10:05.897 UTC","last_activity_date":"2017-08-16 18:34:48.133 UTC","last_edit_date":"2017-08-16 18:12:00.143 UTC","last_editor_display_name":"","last_editor_user_id":"6296515","owner_display_name":"","owner_user_id":"6296515","post_type_id":"1","score":"0","tags":"ios|json|swift","view_count":"57"} +{"id":"15190113","title":"OpenGL blending mode and depth buffer","body":"\u003cp\u003eThe read circle is nearer to the viewer and the texture has a transparent background.\u003c/p\u003e\n\n\u003cp\u003e(Both objects are squares with the same size, just different texture and x, z coords).\u003c/p\u003e\n\n\u003cp\u003eI want:\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/w4uIT.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eBut I have:\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/TfsRC.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eI know I have to do something with blending modes and maybe the depth buffer, but I don't know exactly what. Can someone help me?\u003c/p\u003e\n\n\u003cp\u003eThe current code to load the texture:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic void initTexture(GL10 gl, Bitmap bitmap) {\n gl.glEnable(GL10.GL_BLEND);\n gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);\n\n int[] texture = new int[1];\n gl.glGenTextures(1, texture, 0);\n\n textureId = texture[0];\n gl.glBindTexture(GL10.GL_TEXTURE_2D, textureId);\n\n gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_NEAREST);\n gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR);\n\n gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, GL10.GL_REPEAT);\n gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_REPEAT);\n\n GLUtils.texImage2D(GLES10.GL_TEXTURE_2D, 0, bitmap, 0);\n bitmap.recycle();\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe relevant part of drawing, for each of these objects:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e gl.glBindTexture(GL10.GL_TEXTURE_2D, textureId);\n\n gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);\n gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);\n\n gl.glFrontFace(GL10.GL_CW);\n\n gl.glVertexPointer(3, GL10.GL_FLOAT, 0, verticesBuffer);\n gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, textureBuffer);\n\n gl.glDrawElements(GLES20.GL_TRIANGLES, indices.length, GLES10.GL_UNSIGNED_SHORT, indicesBuffer);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e\n\n\u003cp\u003eNote: I'm using OpenGL ES 1.\u003c/p\u003e","answer_count":"3","comment_count":"0","creation_date":"2013-03-03 19:54:18.073 UTC","last_activity_date":"2013-03-04 15:19:02.307 UTC","last_edit_date":"2013-03-04 15:17:57.58 UTC","last_editor_display_name":"","last_editor_user_id":"752976","owner_display_name":"","owner_user_id":"930450","post_type_id":"1","score":"3","tags":"android|opengl-es","view_count":"865"} +{"id":"33992468","title":"Magento API with iOS application and Oauth 1.0 Login","body":"\u003cp\u003eI want to use \u003ccode\u003emagento API\u003c/code\u003e in my application to get product list, add to \ncart and purchase it from application etc. \u003c/p\u003e\n\n\u003cp\u003eI am very new to magento, I want to know that do I need to implement \u003ccode\u003eoauth 1.0\u003c/code\u003e login to use API from my iOS application?\u003c/p\u003e\n\n\u003cp\u003eAs per this link, I am assuming that I need to implement oauth 1.0 \u003ca href=\"http://devdocs.magento.com/guides/m1x/api/rest/introduction.html\" rel=\"nofollow\"\u003eMagento API\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI have tried with this sample code \u003ca href=\"https://www.cocoacontrols.com/controls/simple-oauth-1-0a-client\" rel=\"nofollow\"\u003eOauth 1.0\u003c/a\u003e, I am able to get \u003ccode\u003eoauth_token\u003c/code\u003e and \u003ccode\u003eoauth_verifier\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eBut in last step I want \u003ccode\u003eoauth_token\u003c/code\u003e and \u003ccode\u003eoauth_token_secret\u003c/code\u003e which I am not getting and instead of that I am getting html page in response. Not sure where I am wrong.\u003c/p\u003e\n\n\u003cp\u003eCan you please guide me am I going on right track to use magento API\nAnd to use \u003cstrong\u003eOauth 1.0\u003c/strong\u003e?\u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2015-11-30 06:15:19.333 UTC","last_activity_date":"2015-11-30 07:47:04.07 UTC","last_edit_date":"2015-11-30 07:47:04.07 UTC","last_editor_display_name":"","last_editor_user_id":"3161009","owner_display_name":"","owner_user_id":"3161009","post_type_id":"1","score":"4","tags":"ios|objective-c|api|magento|oauth","view_count":"172"} +{"id":"11685235","title":"Login using Python in basic HTML form","body":"\u003cblockquote\u003e\n \u003cp\u003e\u003cstrong\u003ePossible Duplicate:\u003c/strong\u003e\u003cbr\u003e\n \u003ca href=\"https://stackoverflow.com/questions/663490/python-how-do-you-login-to-a-page-and-view-the-resulting-page-in-a-browser\"\u003ePython: How do you login to a page and view the resulting page in a browser?\u003c/a\u003e \u003c/p\u003e\n\u003c/blockquote\u003e\n\n\n\n\u003cp\u003eI wanted to know how I can perform login's on pages like \u003ca href=\"http://www.deshabhimani.com/signin.php\" rel=\"nofollow noreferrer\"\u003ehttp://www.deshabhimani.com/signin.php\u003c/a\u003e which has a php-based login prompt using python. This form is used to login to \u003ca href=\"http://www.deshabhimani.com/epaper.php\" rel=\"nofollow noreferrer\"\u003ehttp://www.deshabhimani.com/epaper.php\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThe site does not provide a HTTP API.\u003c/p\u003e\n\n\u003cp\u003eI want to later use python to download all the pages of the epaper(which are individual) and then make it into a final one file pdf. \u003c/p\u003e\n\n\u003cp\u003eThe file which I want to download is \u003ca href=\"http://www.deshabhimani.com/epaper.php?page=43210\u0026amp;ddate=27-07-2012\u0026amp;edition=Kochi\" rel=\"nofollow noreferrer\"\u003ehttp://www.deshabhimani.com/epaper.php?page=43210\u0026amp;ddate=27-07-2012\u0026amp;edition=Kochi\u003c/a\u003e which is only accessible by logging in\u003c/p\u003e","accepted_answer_id":"11685523","answer_count":"1","comment_count":"2","creation_date":"2012-07-27 09:41:45.053 UTC","last_activity_date":"2012-07-27 10:05:57.943 UTC","last_edit_date":"2017-05-23 12:03:16.507 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"835277","post_type_id":"1","score":"3","tags":"python|login","view_count":"11857"} +{"id":"7580894","title":"XmlTextWriter and null strings","body":"\u003cp\u003eI want to serialize an object where some of the member variables are of type \u003ccode\u003estring\u003c/code\u003e and have the value \u003ccode\u003enull\u003c/code\u003e.\nI use the following code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e var writer = new XmlTextWriter(stream, Encoding.UTF8);\n writer.Formatting = Formatting.Indented;\n\n var s = new XmlSerializer(typeof(model.GetType())); \n s.Serialize(writer, model);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe strings with value \u003ccode\u003enull\u003c/code\u003e don't appear in the Xml file (which is obviously intended behavior), although I don't want that. \nHow can I make \u003ccode\u003enull\u003c/code\u003e strings appear in the Xml file by overriding the \u003ccode\u003eXmlTextWriter\u003c/code\u003e class?\u003c/p\u003e\n\n\u003cp\u003eEDIT: I can't modify the object model that needs to be serialized, so Xml attributes are no option.\u003c/p\u003e","accepted_answer_id":"7580926","answer_count":"3","comment_count":"0","creation_date":"2011-09-28 09:12:34.91 UTC","last_activity_date":"2011-09-28 09:26:46.167 UTC","last_edit_date":"2011-09-28 09:18:24.22 UTC","last_editor_display_name":"","last_editor_user_id":"451540","owner_display_name":"","owner_user_id":"451540","post_type_id":"1","score":"1","tags":"c#|xml|xml-serialization","view_count":"1091"} +{"id":"29942231","title":"Number().toLocaleString() has different format in different browsers","body":"\u003cp\u003eI format a float to a locale string (Euro) and there are very different results in every browser. Is it possible to fix without an own function?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar sum=2282.0000;\nvar formated_sum = Number(sum.toFixed(2)).toLocaleString(\"de-DE\", {style: \"currency\", currency: \"EUR\"});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFirefox result: 2.282,00 € \u003c/p\u003e\n\n\u003cp\u003eChrome result: 2.282 € \u003c/p\u003e\n\n\u003cp\u003eIE result: 2.282,00 € \u003c/p\u003e\n\n\u003cp\u003eSafari result: 2282 €\u003c/p\u003e\n\n\u003cp\u003eSafari results are very much wrong, chrome results are not so much bad.\nAny Idea how to fix that without writing an own function for formatting?\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003eThis question may already have an answer here:\nInconsistent behavior of toLocaleString() in different browser \nNo, my question is different because i am searching for a solution for Currency, not DATE\u003c/p\u003e","answer_count":"3","comment_count":"4","creation_date":"2015-04-29 11:22:08.347 UTC","favorite_count":"0","last_activity_date":"2015-11-30 22:36:13.833 UTC","last_edit_date":"2015-04-29 12:05:18.52 UTC","last_editor_display_name":"","last_editor_user_id":"2099411","owner_display_name":"","owner_user_id":"2099411","post_type_id":"1","score":"4","tags":"javascript|formatting|numbers","view_count":"5020"} +{"id":"3782066","title":"how to get my UIWindow using UIApplication?","body":"\u003cp\u003eI have only one window and I tried\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eUIWindow* mWindow = [[UIApplication sharedApplication] keyWindow];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut this returned nil.\u003c/p\u003e\n\n\u003cp\u003eI also tried:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eUIWindow* mWindow = (UIWindow*)[[UIApplication sharedApplication].windows objectAtIndex:0];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut this raised an exception and the app closed, when I tried to print out\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[[UIApplication sharedApplication].windows count]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt printed 0\u003c/p\u003e\n\n\u003cp\u003eNote: I am putting this in my only view controller's viewDidLoad method and this is completely a new iPad View Based Application so I changed nothing, just trying to get the window\u003c/p\u003e\n\n\u003cp\u003ePlease help me to get this object\u003c/p\u003e","accepted_answer_id":"3782394","answer_count":"4","comment_count":"0","creation_date":"2010-09-23 19:56:35.35 UTC","favorite_count":"8","last_activity_date":"2013-03-25 19:25:30.04 UTC","last_editor_display_name":"","owner_display_name":"user416445","post_type_id":"1","score":"41","tags":"iphone|uiwindow|uiapplication","view_count":"45860"} +{"id":"35906044","title":"ExpectedException extract the ExceptionType to a System.Type variable","body":"\u003cp\u003eFollowing approach works,\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e [TestMethod]\n [ExpectedException(typeof(ApiException), StaticStringHelper.ApiDoesNotSupportThisMethod)]\n public async Task CreditCard_GetAll_MethodNotAllowed()\n {\n //Test\n\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003ccode\u003eStaticStringHelper.ApiDoesNotSupportThisMethod\u003c/code\u003e is a string variable.\nI want to extract the ExceptionType to a variable so that it can be reused across all unit tests. Reason is that if I introduce a custom exception for method not allowed in future instead of the generic exception, I only have to change one place. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e private static Type typeVariable = Type.GetType(\"ApiException\");\n\n [TestMethod]\n [ExpectedException(typeVariable, StaticStringHelper.ApiDoesNotSupportThisMethod)]\n public async Task CreditCard_GetAll_MethodNotAllowed()\n {\n\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis does not work. \u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/BbsGT.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/BbsGT.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eAccording to the \u003ca href=\"https://msdn.microsoft.com/en-us/library/microsoft.visualstudio.testtools.unittesting.expectedexceptionattribute.aspx\" rel=\"nofollow noreferrer\"\u003edefinition\u003c/a\u003e it accepts \"System.Type\" as the first parameter.\u003c/p\u003e\n\n\u003cp\u003eIs there a way to get around?\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2016-03-10 01:38:44.453 UTC","favorite_count":"0","last_activity_date":"2016-03-10 01:38:44.453 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1506710","post_type_id":"1","score":"1","tags":"c#|unit-testing|exception","view_count":"17"} +{"id":"28744906","title":"Swift: Found nil while unwrapping an optional value","body":"\u003cp\u003eI'm aware of why this error occurs but I'm having trouble finding a solution here. Basically I'm trying to get a thumbnail of someones avatar from the address book. I get the data and then need to check the data is not nil (in other words we successfully got an image). If we have it then I return it as a UIImage. The code works well in objective-c. The ported code crashes with the \u003ccode\u003efound nil while unwrapping an optional value\u003c/code\u003e error on the \u003ccode\u003edata = ABPerson...\u003c/code\u003e.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e var data :NSData? = NSData()\n\n var ref :ABRecordRef? = delegate.localContacts.objectForKey(email)\n\n if ref != nil {\n data = ABPersonCopyImageDataWithFormat(ref, kABPersonImageFormatThumbnail).takeRetainedValue()\n }\n\n if data?.length \u0026gt; 0 {\n return UIImage(data: data!)!\n } \n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"28745114","answer_count":"1","comment_count":"0","creation_date":"2015-02-26 14:24:04.897 UTC","last_activity_date":"2015-02-26 14:33:15.55 UTC","last_editor_display_name":"","owner_display_name":"user470763","post_type_id":"1","score":"0","tags":"ios|swift","view_count":"367"} +{"id":"37802132","title":"iOS system libraries leak","body":"\u003cpre\u003e\u003ccode\u003eEnvironment: iOS 7.0, Xcode 7.3.1, autolayout = use \"masonry\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHigh margin of error。\u003c/p\u003e\n\n\u003cp\u003eDo a scrollView or an UITableView through the use of masonry, then press the home button to make the app into the background, to open the app, slip quickly, there will be a memory leak and memory increase, could you tell me how to do this? Thanks. \u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/e792j.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/e792j.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\n\u003ca href=\"https://i.stack.imgur.com/VoSMm.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/VoSMm.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2016-06-14 02:44:44.143 UTC","last_activity_date":"2016-06-14 20:23:03.92 UTC","last_edit_date":"2016-06-14 20:23:03.92 UTC","last_editor_display_name":"","last_editor_user_id":"6293599","owner_display_name":"","owner_user_id":"3924521","post_type_id":"1","score":"1","tags":"ios|memory|memory-leaks|masonry","view_count":"86"} +{"id":"18578272","title":"When PHP is builting URL, script stop working","body":"\u003cp\u003eEverytime I run this part of my script, stript stop working.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$url = $this-\u0026gt;getUrl . '?id=' . $this-\u0026gt;apiKey . '\u0026amp;email=' . urlencode($this-\u0026gt;email) . '\u0026amp;produkt[]=' . urlencode($this-\u0026gt;product) . '\u0026amp;orderid=' . $this-\u0026gt;order_id;\nforeach ($this-\u0026gt;products as $product) {\n$url .= '\u0026amp;produkt[]=' . urlencode($product);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I change \u003ccode\u003e$url = $this-\u0026gt;getUr ... ...\u003c/code\u003e to \u003ccode\u003e$url = http://blablabla.com/blabla... ...\u003c/code\u003e all is working fine.\u003c/p\u003e\n\n\u003cp\u003eWhere is a bug?\u003c/p\u003e","accepted_answer_id":"18658026","answer_count":"2","comment_count":"1","creation_date":"2013-09-02 17:30:07.19 UTC","last_activity_date":"2013-09-06 12:35:09.143 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2561489","post_type_id":"1","score":"-1","tags":"php|url","view_count":"54"} +{"id":"33272302","title":"Why is my form not being submitted?","body":"\u003cp\u003eI have 2 functions - one generates the form on my main page and the other processes the submitted form. This is the Braintree sandbox API and their method is this: take in user info and submit to Braintree server, BT server returns a payment method nonce to me which I can then use to POST and view the transaction in my sandbox control panel. However, the form isn't being submitted and I'm not sure at what point in the process the whole submission is failing. \u003cstrong\u003eNOTE\u003c/strong\u003e - I am submitting the form to the same PHP file where the form is located.\u003c/p\u003e\n\n\u003cp\u003eI still need help on this...\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eask.php\u003c/strong\u003e - This is the page where I call both functions\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div\u0026gt;\n \u0026lt;?php \n fd_bt_form(); \n fd_process_trans();\n ?\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003efind-do-for-anspress.php\u003c/strong\u003e \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e $FD_Braintree_Keys = array(\n\n Braintree_Configuration::environment('sandbox'),\n Braintree_Configuration::merchantId('A'),\n Braintree_Configuration::publicKey('B'),\n Braintree_Configuration::privateKey('C')\n\n ); \n\n\nfunction fd_bt_form()\n{\n $class_bt_token = new Braintree_ClientToken();\n $clientToken = $class_bt_token-\u0026gt;generate();\n\n ?\u0026gt;\n \u0026lt;script src=\"https://js.braintreegateway.com/v2/braintree.js\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;script\u0026gt;\n\n braintree.setup(\n '\u0026lt;?php echo $clientToken ?\u0026gt;',\n 'custom', {\n id: 'checkout',\n }); \n\n \u0026lt;/script\u0026gt;\n \u0026lt;?php \n\n echo \n '\u0026lt;form id=\"checkout\" action=\"\" method=\"POST\"\u0026gt;\n \u0026lt;p\u0026gt;\n \u0026lt;label\u0026gt;\u0026lt;font size=\"5\"\u0026gt;Amount:\u0026lt;/font\u0026gt;\u0026lt;/label\u0026gt;\n \u0026lt;input type=\"text\" size=\"4\" name=\"amount\" id=\"amount\" /\u0026gt;\n \u0026lt;/p\u0026gt;\n \u0026lt;input data-braintree-name=\"number\" value=\"378282246310005\"\u0026gt;\n \u0026lt;br\u0026gt; \u0026lt;br /\u0026gt;\n \u0026lt;input data-braintree-name=\"expiration_month\" value=\"05\"\u0026gt;\n \u0026lt;input data-braintree-name=\"expiration_year\" value=\"17\"\u0026gt;\n \u0026lt;br\u0026gt; \u0026lt;br /\u0026gt;\n \u0026lt;input data-braintree-name=\"cvv\" value=\"531\"\u0026gt;\n \u0026lt;br\u0026gt; \u0026lt;br /\u0026gt;\n \u0026lt;input type=\"submit\" id=\"submit\" value=\"Pay\"\u0026gt; \n \u0026lt;/form\u0026gt;';\n\n echo $_POST[\"payment_method_nonce\"];\n global $bt_nonce;\n $bt_nonce = $_POST[\"payment_method_nonce\"]; \n\n return $bt_nonce;\n}\n\nfunction fd_process_trans() {\n\n $FD_Braintree_Keys;\n\n $nonce = $_POST[\"payment_method_nonce\"]; \n $amount = $_POST[\"amount\"];\n\n $result = Braintree_Transaction::sale(array(\n 'amount' =\u0026gt; $amount,\n 'paymentMethodNonce' =\u0026gt; $nonce,\n 'options' =\u0026gt; array(\n 'submitForSettlement' =\u0026gt; True,\n ),\n ));\n\n if ($result-\u0026gt;success) {\n echo \"Success!\";\n }\n else {\n echo \"Transaction failed.\";\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"6","creation_date":"2015-10-22 02:10:40.593 UTC","last_activity_date":"2015-10-23 23:21:50.153 UTC","last_edit_date":"2015-10-23 23:21:50.153 UTC","last_editor_display_name":"","last_editor_user_id":"4407044","owner_display_name":"","owner_user_id":"4407044","post_type_id":"1","score":"0","tags":"php|forms","view_count":"66"} +{"id":"31155129","title":"Subsets count on Hive using CTE","body":"\u003cp\u003eI want to count the rows in a Hive table and at the same time, count the subsets (based on certain conditions in WHERE clause) in a single query. I came across CTE in this \u003ca href=\"https://stackoverflow.com/questions/4414539/easiest-way-to-get-a-total-count-and-a-count-of-a-subset\"\u003epost\u003c/a\u003e, which I think applies to non-Hive SQL. I've researched a bit and found out that Hive has CTE. However this form does not work in Hive when I tried:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eWITH MY_TABLE AS (\n SELECT *\n FROM orig_table\n WHERE base_condition\n)\nSELECT\n (SELECT COUNT(*) FROM MY_TABLE) AS total,\n (SELECT COUNT(*) FROM MY_TABLE WHERE cond_1) AS subset_1,\n ...\n (SELECT COUNT(*) FROM MY_TABLE WHERE cond_n) AS subset_n;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eDoes anyone have a workaround or similar working idea for Hive?\u003c/p\u003e","accepted_answer_id":"31161802","answer_count":"1","comment_count":"0","creation_date":"2015-07-01 07:30:43.543 UTC","last_activity_date":"2015-07-01 12:49:23.7 UTC","last_edit_date":"2017-05-23 10:26:48.487 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"3518757","post_type_id":"1","score":"0","tags":"hive|hiveql","view_count":"571"} +{"id":"25191504","title":"Mutating list while making multiple replacements in a loop","body":"\u003cp\u003eI have a csv file with one column which has following data in a test.csv file\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e3 0JKT02 CX85d\n3 0JNAd0 CP80d\n3 0KAAd0 CT894\n3 0KAAd0 CT895\n3 0LARd0 CL003\n3 0JNA10 CL80d\n3 0JNA20 CL80d\n3 0JNA30 CL80d\n3 0JNA40 CL80d\n3 0FAK3e CL00v\n3 0FAK3e CT00e\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhat I want to do is to replace all the small cap (d, e and v) with instances. Here \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ed = [1,2,3,4]\ne = [1,2]\nv = [3,4]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo to take example of last two items, I need to get \n\u003ccode\u003e3 0FAK31 CL003\u003c/code\u003e, \u003ccode\u003e3 0FAK32 CT003\u003c/code\u003e, \u003ccode\u003e3 0FAK31 CL004\u003c/code\u003e, \u003ccode\u003e3 0FAK32 CT004\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eI have declared an array with all the old values in them, I loop through this array and update it one by one, because it mutates, i'm not getting my expected results. It seems it skips after 'remove' code and just screws up the list. Plus it still has e and v variable in the 'oldarray'. I'm frustrated, please help. Also if you can critic my code and suggest more pythonic way of doin it, I would appreciate it. Here is the code...\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass Compare:\n def __init__(self):\n f1 = open('test.csv','r')\n self.oldarray = []\n for row1 in f1:\n self.oldarray.append(row1.strip('\\n').strip()) \n self.dict1 = {'d':[1,2,3,4],'e':['1','2'], 'v':['3','4']}\n\n def work(self,key,values):\n for item in self.oldarray:\n if key in item:\n for each in values:\n self.oldarray.append(item.replace(key,each))\n self.oldarray.remove(item) \n\n def do(self):\n for key,values in self.dict1.items():\n self.work(key,values)\n\nif __name__ == '__main__':\n import csv\n x = Compare()\n x.do()\n for i in x.oldarray:\n print i\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"25231770","answer_count":"1","comment_count":"3","creation_date":"2014-08-07 20:21:43.21 UTC","last_activity_date":"2014-08-10 18:34:22.07 UTC","last_edit_date":"2014-08-10 18:34:22.07 UTC","last_editor_display_name":"","last_editor_user_id":"162768","owner_display_name":"","owner_user_id":"3698027","post_type_id":"1","score":"1","tags":"python|list|loops|mutable","view_count":"206"} +{"id":"43924258","title":"Pass data from RecyclerView element to new activity (Xamarin)","body":"\u003cp\u003eI have RecyclerView and write code to start activity by clicking on element in recycler view\u003c/p\u003e\n\n\u003cp\u003eI have this code in Adapter\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evoid OnItemClick(int position)\n {\n _context.StartActivity(new Intent(_context, typeof(Tours_detail)));\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI need to pass data to Activity. How I can do this?\u003c/p\u003e\n\n\u003cp\u003eFor example with PutExtra?\u003c/p\u003e","accepted_answer_id":"43924368","answer_count":"1","comment_count":"0","creation_date":"2017-05-11 19:42:15.167 UTC","last_activity_date":"2017-05-11 19:56:12.78 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7955835","post_type_id":"1","score":"2","tags":"c#|android|xamarin|xamarin.android","view_count":"40"} +{"id":"24592493","title":"Updating Tables MySql/PHP - inserting variable name instead of values","body":"\u003cp\u003ei've searched too much about it, but, i'm not even rookie in PHP scripting... so I need help.\u003c/p\u003e\n\n\u003cp\u003ei'm developing a homemade system to home automation, based on PHP/MySql, and, i need a backend to update the database tables and make things really happen in live.\u003c/p\u003e\n\n\u003cp\u003eso, i found the code i need, and, after some adaptation, here it is.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\n$username = \"root\";\n$password = \"\";\n$hostname = \"localhost\"; \n$database = \"domonet\";\n$tabela = \"AtuadorAnalogico\";\n$valor1 = \"AA_id\";\n$valor2 = \"AA_nome\";\n$valor3 = \"AA_valor\";\n\n//connection to the database\n\n$dbhandle = mysql_connect($hostname, $username, $password) \n or die(\"Unable to connect to MySQL\");\necho \"Connected to MySQL\u0026lt;br\u0026gt;\";\n\n\n//select a database to work with\n\n$selected = mysql_select_db($database,$dbhandle) \n or die(\"Could not select examples\");\n echo \"Connected ao banco\u0026lt;br\u0026gt;\";\n\n//get data from db\n\n$sql = mysql_query(\"SELECT * FROM $tabela\");\n$count=mysql_num_rows($sql);\n\n//start a table\n\necho '\u0026lt;form name=\"form1\" method=\"post\" action=\"\"\u0026gt;\n\u0026lt;table width=\"292\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\"\u0026gt;';\n\n//start header of table\n\necho '\u0026lt;tr\u0026gt;\n\u0026lt;th\u0026gt;\u0026amp;nbsp;\u0026lt;/th\u0026gt;\n\u0026lt;th\u0026gt;Name\u0026lt;/th\u0026gt;\n\u0026lt;th\u0026gt;Email\u0026lt;/th\u0026gt;\n\u0026lt;/tr\u0026gt;';\n\n//loop through all results\n\nwhile($r=mysql_fetch_object($sql)){\n\n//print out table contents and add id into an array and email into an array\n\necho '\u0026lt;tr\u0026gt;\n\u0026lt;td\u0026gt;\u0026lt;input type=\"hidden\" name=\"id[]\" value='.$r-\u0026gt;$valor1.' readonly\u0026gt;\u0026lt;/td\u0026gt;\n\u0026lt;td\u0026gt;'.$r-\u0026gt;$valor2.'\u0026lt;/td\u0026gt;\n\u0026lt;td\u0026gt;\u0026lt;input name=\"email[]\" type=\"text\" id=\"price\" value=\"'.$r-\u0026gt;$valor3.'\"\u0026gt;\u0026lt;/td\u0026gt;\n\u0026lt;/tr\u0026gt;';\n}\n\n//submit button\n\n\necho' \u0026lt;tr\u0026gt;\n\u0026lt;td colspan=\"3\" align=\"center\"\u0026gt;\u0026lt;input type=\"submit\" name=\"Submit\" value=\"Submit\"\u0026gt;\u0026lt;/td\u0026gt;\n\u0026lt;/tr\u0026gt;\n\u0026lt;/table\u0026gt;\n\u0026lt;/form\u0026gt;';\n\n\n// if form has been submitted, process it\n\n\nif(isset($_POST[\"Submit\"]))\n{\n // get data from form\n\n $name = $_POST['name'];\n\n // loop through all array items\n\n foreach($_POST['id'] as $value)\n {\n\n // minus value by 1 since arrays start at 0 \n\n $item = $value-1;\n\n //update table\n\n //appending suggested changes \n //place of var_dumps\n //$sql1 = mysql_query(\"UPDATE $tabela SET $valor3='$valor3[$item]' WHERE $valor1='$value'\") or die(mysql_error());\n $sql1 = mysql_query(\"UPDATE $tabela SET $valor3='$email[$item]' WHERE $valor1='$value'\") or die(mysql_error());\n\n\n\n }\n\n// redirect user\n\n$_SESSION['success'] = 'Updated';\nheader(\"location:index.php\");\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe problem is, after clicking at the 'submit' button, the database table just get weird.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eFrom This:\nmysql\u0026gt; select * from AtuadorAnalogico;\n+-------+---------+----------+\n| AA_id | AA_nome | AA_valor |\n+-------+---------+----------+\n| 0 | nome1 | d |\n| 1 | nome2 | Agfd |\n| 2 | nome3 | Aasd |\n| 3 | nome4 | _asda |\n| 5 | teste5 | a |\n| 6 | teste6 | asda |\n| 7 | testte1 | o |\n| 8 | testte2 | rwqdq |\n| 9 | asdadsd | gwrg |\n| 10 | asdadsd | qdw |\n| 11 | adasd | 234 |\n| 12 | adasd | g42 |\n+-------+---------+----------+\n12 rows in set (0.00 sec)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eTo This:\nmysql\u0026gt; select * from AtuadorAnalogico\n+-------+---------+----------+\n| AA_id | AA_nome | AA_valor |\n+-------+---------+----------+\n| 0 | nome1 | |\n| 1 | nome2 | |\n| 2 | nome3 | |\n| 3 | nome4 | |\n| 5 | teste5 | |\n| 6 | teste6 | |\n| 7 | testte1 | |\n| 8 | testte2 | |\n| 9 | asdadsd | |\n| 10 | asdadsd | |\n| 11 | adasd | |\n| 12 | adasd | |\n+-------+---------+----------+\n12 rows in set (0.00 sec)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ePlease, I really can't see my mistake.\u003c/p\u003e\n\n\u003cp\u003eThanks a lot for the code revision.\u003c/p\u003e\n\n\u003cp\u003ePS.: just to remember. When i run the php in browser, it DOES show the contents of the database table just as it is. after clicking the submit, the thing goes crazy.\u003c/p\u003e\n\n\u003ch1\u003eEDIT1\u003c/h1\u003e\n\n\u003cp\u003eafter renaming 'valor3' to 'email', it is not writing the string to the table anymore.\nbut, leaving the whole column blank (writing blank in all column cells as shown above) .\u003c/p\u003e\n\n\u003ch1\u003eEDIT2\u003c/h1\u003e\n\n\u003cp\u003ein comments, we just figured that is a logical problem with the code.\njust can't figure out what to do.\u003c/p\u003e\n\n\u003ch1\u003eUpdate\u003c/h1\u003e\n\n\u003cpre\u003e\u003ccode\u003ethe output from just before the sql1 query:\nvar_dump($email);\nvar_dump($tabela);\nvar_dump($item);\nvar_dump($valor3);\nvar_dump($valor1);\nvar_dump($value);\n\nvardump $email: NULL\nvardump $tabela: string(16) \"AtuadorAnalogico\"\nvardump $item: int(-1)\nvardump $valor3: string(8) \"AA_valor\"\nvardump $valor1: string(5) \"AA_id\"\nvardump $value: string(1) \"0\"\n\nvardump $email: NULL\nvardump $tabela: string(16) \"AtuadorAnalogico\"\nvardump $item: int(0)\nvardump $valor3: string(8) \"AA_valor\"\nvardump $valor1: string(5) \"AA_id\"\nvardump $value: string(1) \"1\"\nvardump $email: NULL\n\nvardump $tabela: string(16) \"AtuadorAnalogico\"\nvardump $item: int(1)\nvardump $valor3: string(8) \"AA_valor\"\nvardump $valor1: string(5) \"AA_id\"\nvardump $value: string(1) \"2\" \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eps.: i reduced the number of rows, so makes easyer to see and think.\u003c/p\u003e\n\n\u003ch1\u003eI FOUND IT!\u003c/h1\u003e\n\n\u003cp\u003estack didn't allowed me to answer my own question, so, i'm editing as they wish.\u003c/p\u003e\n\n\u003cp\u003erenaming this line fields 'name' and 'id' to \"\"anything\"\":\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;td\u0026gt;\u0026lt;input name=\"valores[]\" type=\"text\" id=\"valores\" value=\"'.$r-\u0026gt;$valor3.'\"\u0026gt;\u0026lt;/td\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003erenaming this to the same as before:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e $valores = $_POST['valores'];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003echanging this to EQUAL (as stated by @JA):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e $item = $value;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand adapting the query like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e $sql1 = mysql_query(\"UPDATE $tabela SET $valor3='$valores[$item]' WHERE $valor1='$value'\") or die(mysql_error());\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand IT's DONE!\u003c/p\u003e\n\n\u003ch1\u003eThanks so much for your brainstorming.\u003c/h1\u003e\n\n\u003cp\u003eand special thanks for @arielnmz who gave me the idea of dumping the vars so i can find the logic error.\u003c/p\u003e\n\n\u003cp\u003eby the way, the code finished.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\n$username = \"root\";\n$password = \"\";\n$hostname = \"localhost\"; \n$database = \"domonet\";\n$tabela = \"AtuadorAnalogico\";\n$valor1 = \"AA_id\";\n$valor2 = \"AA_nome\";\n$valor3 = \"AA_valor\";\n\n//connection to the database\n\n$dbhandle = mysql_connect($hostname, $username, $password) \n or die(\"Unable to connect to MySQL\");\necho \"Connected to MySQL\u0026lt;br\u0026gt;\";\n\n\n//select a database to work with\n\n$selected = mysql_select_db($database,$dbhandle) \n or die(\"Could not select examples\");\n echo \"Connected ao banco\u0026lt;br\u0026gt;\";\n\n//get data from db\n\n$sql = mysql_query(\"SELECT * FROM $tabela\");\n$count=mysql_num_rows($sql);\n\n//start a table\n\necho '\u0026lt;form name=\"form1\" method=\"post\" action=\"\"\u0026gt;\n\u0026lt;table width=\"292\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\"\u0026gt;';\n\n//start header of table\n\necho '\u0026lt;tr\u0026gt;\n\u0026lt;th\u0026gt;\u0026amp;nbsp;\u0026lt;/th\u0026gt;\n\u0026lt;th\u0026gt;Name\u0026lt;/th\u0026gt;\n\u0026lt;th\u0026gt;Email\u0026lt;/th\u0026gt;\n\u0026lt;/tr\u0026gt;';\n\n//loop through all results\n\nwhile($r=mysql_fetch_object($sql)){\n\n//print out table contents and add id into an array and email into an array\n\necho '\u0026lt;tr\u0026gt;\n\u0026lt;td\u0026gt;\u0026lt;input type=\"hidden\" name=\"id[]\" value='.$r-\u0026gt;$valor1.' readonly\u0026gt;\u0026lt;/td\u0026gt;\n\u0026lt;td\u0026gt;'.$r-\u0026gt;$valor2.'\u0026lt;/td\u0026gt;\n\u0026lt;td\u0026gt;\u0026lt;input name=\"valores[]\" type=\"text\" id=\"valores\" value=\"'.$r-\u0026gt;$valor3.'\"\u0026gt;\u0026lt;/td\u0026gt;\n\u0026lt;/tr\u0026gt;';\n}\n\n//submit button\n\n\necho' \u0026lt;tr\u0026gt;\n\u0026lt;td colspan=\"3\" align=\"center\"\u0026gt;\u0026lt;input type=\"submit\" name=\"Submit\" value=\"Submit\"\u0026gt;\u0026lt;/td\u0026gt;\n\u0026lt;/tr\u0026gt;\n\u0026lt;/table\u0026gt;\n\u0026lt;/form\u0026gt;';\n\n// if form has been submitted, process it\n\nif(isset($_POST[\"Submit\"]))\n{\n // get data from form\n\n $valores = $_POST['valores'];\n\n // loop through all array items\n\n foreach($_POST['id'] as $value)\n {\n // minus value by 1 since arrays start at 0 (not anymore)\n\n $item = $value;\n //update table\n\n $sql1 = mysql_query(\"UPDATE $tabela SET $valor3='$valores[$item]' WHERE $valor1='$value'\") or die(mysql_error());\n\n }\n\n// redirect user\n\n$_SESSION['success'] = 'Updated';\nheader(\"location:index.php\");\n};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eEverybody have a great night!\u003c/p\u003e","accepted_answer_id":"24592958","answer_count":"1","comment_count":"21","creation_date":"2014-07-06 03:37:30.287 UTC","last_activity_date":"2014-07-06 05:31:43.087 UTC","last_edit_date":"2014-07-06 05:31:43.087 UTC","last_editor_display_name":"","last_editor_user_id":"3808783","owner_display_name":"","owner_user_id":"3808783","post_type_id":"1","score":"-1","tags":"php|mysql|forms","view_count":"700"} +{"id":"16096046","title":"How to specify cx_Oracle stored function RECORD return type?","body":"\u003cpre\u003e\u003ccode\u003e CREATE OR REPLACE my_package as \n TYPE x_type IS RECORD { a_val number,\n b_val varchar2(20),\n c_val boolean }; \n FUNCTION my_func ( d number )\n RETURN x_type;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003chr\u003e\n\n\u003cp\u003eWhat should be the correct way to specify x_type in cx Oracle code?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecurs.callfunc('my_func', x_type, [1])\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks,\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-04-19 02:03:28.073 UTC","last_activity_date":"2013-04-19 05:00:08.593 UTC","last_edit_date":"2013-04-19 02:59:11.09 UTC","last_editor_display_name":"","last_editor_user_id":"965229","owner_display_name":"","owner_user_id":"965229","post_type_id":"1","score":"1","tags":"python|oracle|cx-oracle|stored-functions","view_count":"631"} +{"id":"9884952","title":"Where to start for Jruby on rails?","body":"\u003cp\u003eAny tutorials or blog are available to start with JRuby on Rails\u003cbr\u003e\nwhich guide me to the installation and small JRuby on Rails application ?\nI have gone through this Walkthroughs And Tutorials(https://github.com/jruby/jruby/wiki/WalkthroughsAndTutorials) link but most of the JRuby on Rails links are broken. \u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2012-03-27 07:18:45.177 UTC","favorite_count":"7","last_activity_date":"2013-04-12 09:40:04.717 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"363503","post_type_id":"1","score":"5","tags":"jruby|jrubyonrails","view_count":"4100"} +{"id":"44635780","title":"Function is not called in pagemethods","body":"\u003cp\u003eI have a asp .net site in which I'm using PageMethods to call a function in code-behind from a javascript event. In this case my website is configured as follows:\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003e\u0026lt;asp:ScriptManager ID=\"ScriptManager1\" runat=\"server\" EnablePageMethods=\"true\" /\u0026gt;\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eThe javascript is the following\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(document).ready(function () {\n $('.btnLike').click(function () {\n PageMethods.update(this.id,OnSucceeded, OnFailed);\n });\n\n function OnSucceeded(response) {\n alert('Success: ' + response)\n }\n function OnFailed(error) {\n alert ('Failed: ' + error)\n }\n });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe function in the code-behind page is the next one\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;System.Web.Services.WebMethod()\u0026gt;\n\u0026lt;System.Web.Script.Services.ScriptMethod()\u0026gt;\nPublic Shared Function update(ByVal text As String) As String\n Debug.Print(\" -- Method update() called with argument: \" \u0026amp; text)\n Return text\nEnd Function\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is what it is happening:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eJavascript function \u003ccode\u003e$('.btnLike').click(function ()\u003c/code\u003e is getting called\u003c/li\u003e\n\u003cli\u003eIn code-bihd the method \u003ccode\u003ePage_Load()\u003c/code\u003e is called but it never reaches the \u003ccode\u003eupdate()\u003c/code\u003e method which is the one I actually requested from the javascript\u003c/li\u003e\n\u003cli\u003eThe OnSucceed function in the javascript response for PageMethods is getting fired\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eCan anyone help me figure out why is the method not being called?\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-06-19 16:38:29.507 UTC","last_activity_date":"2017-06-19 16:38:29.507 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7613143","post_type_id":"1","score":"0","tags":"javascript|asp.net|vb.net|pagemethods","view_count":"59"} +{"id":"21354656","title":"Method for converting diverse JSON files into RDBMS schema?","body":"\u003cp\u003eI have a large amount of JSON instances. I would like to store them in an RDBMS for querying. Once there they will never change, it's a data warehousing issue. I have lots of RDBMS data that I want to match the JSON data with, so it would be poor efficiency to store the JSON in a more traditional manner (e.g. couchdb).\u003c/p\u003e\n\n\u003cp\u003eFrom hunting the web, I gather that the best approach might be to create JSON schema (\u003ca href=\"http://json-schema.org/\" rel=\"nofollow\"\u003ehttp://json-schema.org/\u003c/a\u003e) files using a tool such as (\u003ca href=\"https://github.com/perenecabuto/json_schema_generator\" rel=\"nofollow\"\u003ehttps://github.com/perenecabuto/json_schema_generator\u003c/a\u003e) and then use that to build a structured RDBMS series of tables. My data is sufficiently limited in scope (minimal JSON nesting) that I could do this by hand if needed, but a tool that automatically converted from JSON schema -\u003e DB DDL statements would be great if it is our there.\u003c/p\u003e\n\n\u003cp\u003eMy question is two parted but aimed at the first issue - is there a tool or method by which I can create a master schema that describes all of my data, as many instances are missing various fields (and I have tens of gigs of json data)? The second part is with the serialization process. Does there exist a library (ideally python, I'm flexible though) that would take a schema file and a json object and output the DML to insert that into a RDBMS?\u003c/p\u003e\n\n\u003cp\u003eAll suggestions welcome!\u003c/p\u003e\n\n\u003cp\u003eChris \u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-01-25 18:41:14.35 UTC","last_activity_date":"2014-08-26 23:08:19.2 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3137396","post_type_id":"1","score":"2","tags":"python|json|rdbms","view_count":"587"} +{"id":"24434464","title":"Different views based on user type - Correct segue type after login?","body":"\u003cp\u003eI have a Login View Controller which is the initial view controller. Here users input their username and password, which is then sent off to the server to be checked. If the user has inputted correct credentials the server responds with some JSON data including the user type (either 'student' or 'demonstrator'). I'm using the returned user type to decide on what views the user the will see. (users will see different tab controllers)\u003c/p\u003e\n\n\u003cp\u003eThe bit I'm struggling on is on what type of segue to perform. Push or Modal? I tried embedding a navigation controller into the Login View Controller and performing a Push Segue to the correct view, but this seems to not play nice with other navigation controllers that are embedded in the other views (title's disappear etc). \u003c/p\u003e\n\n\u003cp\u003eIs the modal segue type the correct one to use in this situation? The user wont be returning back to the login screen at all. \u003c/p\u003e","accepted_answer_id":"24437916","answer_count":"1","comment_count":"0","creation_date":"2014-06-26 15:25:03.14 UTC","last_activity_date":"2014-06-26 18:45:00.98 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"273173","post_type_id":"1","score":"0","tags":"ios|xcode|ios7|xcode5|segue","view_count":"317"} +{"id":"29990247","title":"Software keyboard move editTexts for android","body":"\u003cp\u003eI'm trying to get the editTexts, and sign in button to move up when the software keyboard is out however I want the background to not be compressed(I'm going to add an image soon). I have the TextView(Login), two EditTexts(email and password) and signin button in a ScrollView because I thought that might help however I have not be able to figure anything out.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://i.imgur.com/vlYifc6.png\" rel=\"nofollow\"\u003ehttp://i.imgur.com/vlYifc6.png\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://i.imgur.com/vlYifc6.png\" rel=\"nofollow\"\u003ehttp://i.imgur.com/vlYifc6.png\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThis is the xml\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:tools=\"http://schemas.android.com/tools\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"match_parent\"\n android:paddingLeft=\"@dimen/activity_horizontal_margin\"\n android:paddingRight=\"@dimen/activity_horizontal_margin\"\n android:paddingTop=\"@dimen/activity_vertical_margin\"\n android:paddingBottom=\"@dimen/activity_vertical_margin\" tools:context=\".MainActivity\"\u0026gt;\n\n \u0026lt;ScrollView\n android:layout_width=\"fill_parent\"\n android:layout_height=\"wrap_content\"\n android:id=\"@+id/scrollView\"\n android:layout_centerVertical=\"true\"\n android:layout_centerHorizontal=\"true\" \u0026gt;\n\n \u0026lt;LinearLayout\n android:orientation=\"vertical\"\n android:layout_width=\"fill_parent\"\n android:layout_height=\"wrap_content\"\n android:layout_centerVertical=\"true\"\n android:layout_centerHorizontal=\"true\"\n android:gravity=\"center\"\n android:id=\"@+id/textLayout\"\u0026gt;\n\n \u0026lt;TextView\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:textAppearance=\"?android:attr/textAppearanceLarge\"\n android:text=\"Login\"\n android:id=\"@+id/loginView\"\n android:textSize=\"22dp\"\n android:layout_above=\"@+id/textLayout\"\n android:layout_centerHorizontal=\"true\" /\u0026gt;\n\n \u0026lt;EditText\n android:layout_width=\"fill_parent\"\n android:layout_height=\"wrap_content\"\n android:id=\"@+id/emailTextfield\"\n android:inputType=\"textEmailAddress\"\n android:background=\"@android:drawable/edit_text\"\n android:textColor=\"@android:color/primary_text_light\"\n android:text=\"andresc1305@yahoo.com\"\n android:hint=\"Email\" /\u0026gt;\n\n \u0026lt;EditText\n android:layout_width=\"fill_parent\"\n android:layout_height=\"wrap_content\"\n android:inputType=\"textPassword\"\n android:hint=\"Password\"\n android:text=\"Andres123\"\n android:background=\"@android:drawable/edit_text\"\n android:textColor=\"@android:color/primary_text_light\"\n android:ems=\"10\"\n android:id=\"@+id/passwordTextfield\" /\u0026gt;\n\n \u0026lt;Button\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:text=\"SIGN IN\"\n android:background=\"@android:color/transparent\"\n android:textSize=\"24dp\"\n android:id=\"@+id/signinButton\"\n android:layout_below=\"@+id/textLayout\"\n android:layout_centerHorizontal=\"true\"\n android:onClick=\"onSigninClick\"/\u0026gt;\n \u0026lt;/LinearLayout\u0026gt;\n \u0026lt;/ScrollView\u0026gt;\n\n \u0026lt;Button\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:text=\"Forgot your password?\"\n android:background=\"@android:color/transparent\"\n android:textSize=\"14dp\"\n android:id=\"@+id/forgotButton\"\n android:layout_alignParentBottom=\"true\"\n android:layout_alignParentLeft=\"true\"\n android:layout_alignParentStart=\"true\"\n android:onClick=\"onPasswordRecoverClick\"/\u0026gt;\n\n \u0026lt;Button\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:text=\"Register\"\n android:background=\"@android:color/transparent\"\n android:textSize=\"14dp\"\n android:id=\"@+id/registerButton\"\n android:layout_alignTop=\"@+id/forgotButton\"\n android:layout_alignParentRight=\"true\"\n android:layout_alignParentEnd=\"true\"\n android:onClick=\"onRegisterClick\"/\u0026gt;\n\n\n\u0026lt;/RelativeLayout\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"3","comment_count":"1","creation_date":"2015-05-01 15:49:22.237 UTC","last_activity_date":"2016-01-15 16:31:17.837 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4813346","post_type_id":"1","score":"0","tags":"android|android-layout|keyboard|android-softkeyboard","view_count":"202"} +{"id":"24191442","title":"How do I get WordPress emails working on OpenShift?","body":"\u003cp\u003eI installed WordPress using OpenShift's default package. Emails are not being sent (default welcome message and forgotten password link, new user, etc). What do I have to do to get these working?\u003c/p\u003e","accepted_answer_id":"24192686","answer_count":"1","comment_count":"0","creation_date":"2014-06-12 18:26:31.553 UTC","last_activity_date":"2014-06-12 19:39:09.477 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"225835","post_type_id":"1","score":"1","tags":"openshift","view_count":"523"} +{"id":"35409101","title":"Using facebook graph api not returning photo url link","body":"\u003cp\u003eI am using the Facebook Graph API. I want to get a photo url by \u003ccode\u003epost_id\u003c/code\u003e but it is not returning a photo url link. Actually I want to use that link for further operations. Can some body solve this problem please?\u003c/p\u003e\n\n\u003cp\u003emy code is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$response1 = Facebook::post('/me/photos', $data);\n $response = $response1-\u0026gt;getGraphUser()-\u0026gt;asArray();\n $graphNode = $response1-\u0026gt;getGraphNode();\n $post_id = $graphNode['id'];\n\n $getImageLink = Facebook::get('/' . $post_id);\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-02-15 12:12:53.817 UTC","last_activity_date":"2016-02-17 14:05:09.663 UTC","last_edit_date":"2016-02-17 14:05:09.663 UTC","last_editor_display_name":"","last_editor_user_id":"1503237","owner_display_name":"","owner_user_id":"2623748","post_type_id":"1","score":"-1","tags":"php|ajax|facebook-graph-api","view_count":"90"} +{"id":"41799387","title":"gdb in sublime text 3: debugger doesn't stop at breakpoints and exits immediately","body":"\u003cp\u003eI've setup SublimeGDB by following the instructions on the github page. It wasn't running so I included a .sublime-project file to the specifications outlined here: \u003ca href=\"https://thenigh7sh4de.wordpress.com/2014/03/28/setting-up-sublimegdb/\" rel=\"nofollow noreferrer\"\u003ehttps://thenigh7sh4de.wordpress.com/2014/03/28/setting-up-sublimegdb/\u003c/a\u003e .\u003c/p\u003e\n\n\u003cp\u003eI'm able to set breakpoints, but when I press f5 to run I see the SublimeGDB interface flicker and then disappear, with the message \"GDB Session Ended\". \u003c/p\u003e\n\n\u003cp\u003eMy particular c++ program takes \u003ccode\u003ecin\u003c/code\u003e input and it doesn't seem to display. My build system is C++ Single File and I'm running in Ubuntu.\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2017-01-23 04:45:59.753 UTC","favorite_count":"1","last_activity_date":"2017-01-23 04:45:59.753 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4382391","post_type_id":"1","score":"1","tags":"c++|gdb|sublimetext3","view_count":"572"} +{"id":"37219246","title":"How to retrieve entity name by object type code using JavaScript in CRM?","body":"\u003cp\u003eIs there anyway on client side in Dynamics CRM 2011 from JavaScript to retrieve Entity Logical Name by Object Type Code?\u003c/p\u003e\n\n\u003cp\u003eExample: Object Type Code = 1, Logical Name is Account\u003c/p\u003e","answer_count":"3","comment_count":"0","creation_date":"2016-05-13 21:00:17.103 UTC","favorite_count":"0","last_activity_date":"2016-11-24 08:36:17.39 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"389506","post_type_id":"1","score":"2","tags":"javascript|dynamics-crm-2011|dynamics-crm","view_count":"395"} +{"id":"29277988","title":"effect of instance type on Method invocation from derived class","body":"\u003cp\u003eSuppose I have the following:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003estatic void Main(string[] args)\n{\n DerivedClass input = new DerivedClass();\n input.WriteName(); // Outputs BaseClass\n}\n\nclass BaseClass\n{\n public void WriteName()\n {\n Console.WriteLine(GetName());//this.GetType()\n }\n\n protected string GetName()\n {\n return \"BaseClass\";\n }\n}\n\nclass DerivedClass : BaseClass\n{\n protected new string GetName()\n {\n return \"DerivedClass\";\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI ran some tests(using GetType()) about the object type from which \u003ccode\u003eGetName()\u003c/code\u003e Method is invoked (I mean \u003ccode\u003eDerivedClass.GetName\u003c/code\u003e from \u003ccode\u003eWriteName\u003c/code\u003e). I know that \u003ccode\u003eWriteName\u003c/code\u003e cannot see the new Method in \u003ccode\u003eDerivedClass\u003c/code\u003e class and \u003ccode\u003eGetName\u003c/code\u003e Method is hidden by \u003ccode\u003enew\u003c/code\u003e keyword, but does the instance type (\u003ccode\u003eDerivedClass\u003c/code\u003e) not have any effect on that?\nis the type up-casted to base class when calling \u003ccode\u003eGetName\u003c/code\u003e Method? when calling from Main Method \u003ccode\u003eDerivedClass.GetName\u003c/code\u003e seems to provide the expected result.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-03-26 12:05:42.227 UTC","last_activity_date":"2015-03-26 12:21:03.727 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3723486","post_type_id":"1","score":"0","tags":"c#|inheritance|instancetype","view_count":"42"} +{"id":"36783164","title":"Grunt Task \"default\" not found","body":"\u003cp\u003eI'm new to use grunt, I just create a real sample to run. But I get blocked my A warning \u003ccode\u003eWarning: Task \"default\" not found\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eI just copied sample from \u003ca href=\"http://gruntjs.com/getting-started\" rel=\"nofollow\"\u003ehttp://gruntjs.com/getting-started\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eMy package is \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n \"name\": \"my-project-name\",\n \"version\": \"0.1.0\",\n \"devDependencies\": {\n \"grunt\": \"~0.4.5\",\n \"grunt-contrib-jshint\": \"~0.10.0\",\n \"grunt-contrib-nodeunit\": \"~0.4.1\",\n \"grunt-contrib-uglify\": \"~0.5.0\"\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003emy Gruntfile.js is \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emodule.exports = function(grunt) {\n\n grunt.registerTask('default', 'Log some stuff.', function() {\n grunt.log.write('Logging some stuff...').ok();\n });\n\n};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eit just print some simple log, why it doesn't work?\u003c/p\u003e","accepted_answer_id":"40312678","answer_count":"1","comment_count":"0","creation_date":"2016-04-22 01:27:50.363 UTC","last_activity_date":"2016-10-31 17:32:29.693 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5153261","post_type_id":"1","score":"0","tags":"gruntjs","view_count":"50"} +{"id":"37191161","title":"Install PDO_OCI on PHP7","body":"\u003cp\u003eHe,\u003c/p\u003e\n\n\u003cp\u003eI try since several days to install PDO_OCI on PHP7 on a new server.\nI have ever on other server PDO_OCI but on PHP 5.4, and all is good, not problem with this version.\u003c/p\u003e\n\n\u003cp\u003eI have the message :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e:/home/pear/download/PDO_OCI-1.0# make\n/bin/bash /home/pear/download/PDO_OCI-1.0/libtool --mode=compile cc -I -I. \n-I/home/pear/download/PDO_OCI-1.0 -DPHP_ATOM_INC \n-I/home/pear/download/PDO_OCI-1.0/include \n-I/home/pear/download/PDO_OCI-1.0/main \n-I/home/pear/download/PDO_OCI-1.0 \n-I/usr/include/php/20151012 \n-I/usr/include/php/20151012/main \n-I/usr/include/php/20151012/TSRM \n-I/usr/include/php/20151012/Zend \n-I/usr/include/php/20151012/ext \n-I/usr/include/php/20151012/ext/date/lib \n-I/usr/lib/oracle/instantclient/include/oracle/12.1/client -DHAVE_CONFIG_H -g -O2 -c \n/home/pear/download/PDO_OCI-1.0/oci_driver.c -o oci_driver.lo\nlibtool: compile: cc -I -I. \n-I/home/pear/download/PDO_OCI-1.0 -DPHP_ATOM_INC \n-I/home/pear/download/PDO_OCI-1.0/include \n-I/home/pear/download/PDO_OCI-1.0/main \n-I/home/pear/download/PDO_OCI-1.0 \n-I/usr/include/php/20151012 \n-I/usr/include/php/20151012/main \n-I/usr/include/php/20151012/TSRM \n-I/usr/include/php/20151012/Zend \n-I/usr/include/php/20151012/ext \n-I/usr/include/php/20151012/ext/date/lib \n-I/usr/lib/oracle/instantclient/include/oracle/12.1/client -DHAVE_CONFIG_H -g -O2 -c \n/home/pear/download/PDO_OCI-1.0/oci_driver.c -fPIC -DPIC -o .libs/oci_driver.o\n\n/home/pear/download/PDO_OCI-1.0/oci_driver.c: In function 'pdo_oci_fetch_error_func':\n/home/pear/download/PDO_OCI-1.0/oci_driver.c:51:3: error: \ntoo many arguments to function 'add_next_index_string' add_next_index_string(info, einfo-\u0026gt;errmsg, 1);\n\nIn file included from /usr/include/php/20151012/main/php.h:39:0,\n from /home/pear/download/PDO_OCI-1.0/oci_driver.c:25:\n/usr/include/php/20151012/Zend/zend_API.h:432:14: note: declared here\n ZEND_API int add_next_index_string(zval *arg, const char *str);\n ^\n/home/pear/download/PDO_OCI-1.0/oci_driver.c: In function 'oci_handle_preparer':\n/home/pear/download/PDO_OCI-1.0/oci_driver.c:238:59: warning: passing argument 5 of 'pdo_parse_params' from incompatible pointer type\n ret = pdo_parse_params(stmt, (char*)sql, sql_len, \u0026amp;nsql, \u0026amp;nsql_len TSRMLS_CC);\n ^\nIn file included from /home/pear/download/PDO_OCI-1.0/oci_driver.c:29:0:\n/usr/include/php/20151012/ext/pdo/php_pdo_driver.h:678:13: note: expected 'size_t *' but argument is of type 'int *'\n PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, size_t inquery_len,\n ^\n/home/pear/download/PDO_OCI-1.0/oci_driver.c: At top level:\n/home/pear/download/PDO_OCI-1.0/oci_driver.c:411:2: warning: initialization from incompatible pointer type\n oci_handle_preparer,\n ^\n/home/pear/download/PDO_OCI-1.0/oci_driver.c:411:2: warning: (near initialization for 'oci_methods.preparer')\n/home/pear/download/PDO_OCI-1.0/oci_driver.c:412:2: warning: initialization from incompatible pointer type\n oci_handle_doer,\n ^\n/home/pear/download/PDO_OCI-1.0/oci_driver.c:412:2: warning: (near initialization for 'oci_methods.doer')\n/home/pear/download/PDO_OCI-1.0/oci_driver.c:413:2: warning: initialization from incompatible pointer type\n oci_handle_quoter,\n ^\n/home/pear/download/PDO_OCI-1.0/oci_driver.c:413:2: warning: (near initialization for 'oci_methods.quoter')\nMakefile:198: recipe for target 'oci_driver.lo' failed\nmake: *** [oci_driver.lo] Error 1\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy configuration :\nLinux server System Linux 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u4 (2016-02-29) x86_64 \nPHP PHP Version 7.0.4-1~dotdeb+8.1\nPDO drivers mysql \nOCI8 Support enabled (is work).\u003c/p\u003e\n\n\u003cp\u003eI have read PDO_OCI is include on PHP7 \u003ca href=\"https://github.com/php/php-src/tree/PHP-7.0.7/ext/pdo_oci\" rel=\"nofollow\"\u003ehttps://github.com/php/php-src/tree/PHP-7.0.7/ext/pdo_oci\u003c/a\u003e\nbut how activate it ?\u003c/p\u003e\n\n\u003cp\u003eMy code to PHP 5.4 doesn't work on this server PHP7.\u003c/p\u003e\n\n\u003cp\u003eSomebody have a solution ?\u003c/p\u003e\n\n\u003cp\u003eRegards\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2016-05-12 15:18:44.77 UTC","last_activity_date":"2017-08-22 14:19:19.15 UTC","last_edit_date":"2016-05-12 16:30:28.013 UTC","last_editor_display_name":"","last_editor_user_id":"1255289","owner_display_name":"","owner_user_id":"2460317","post_type_id":"1","score":"0","tags":"php|linux|pdo|driver|oci8","view_count":"3415"} +{"id":"40427670","title":"Sync Vue.js data with some existing html?","body":"\u003cp\u003eI am using Vue.js clientside, and populate a list as follows (this works after an ajax/json api request which I populate with Vue data and methods).\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div id=\"myDiv1\"\u0026gt;\n \u0026lt;li v-for=\"item in items\"\u0026gt;\n {{ item.title }}\n \u0026lt;/li\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI currently intialise Vue with\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar vueApp = new Vue({\n...\n data: {\n items: {},\n },\n methods: { ajaxCallAndUpdateVueItems: function(){...} \n } \n})\n\najaxCallAndUpdateVueItems() on some event\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, I would like to preload/render on the server side an initial state of the list (for a few reasons like speed, seo, initialstate first time only). This state varies depending on things like location of the user, which the server calculates.\u003c/p\u003e\n\n\u003cp\u003eSo I want to send the initial page to the client with\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div id=\"myDiv1\"\u0026gt; \n \u0026lt;li\u0026gt;Some title1\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;Some title2\u0026lt;/li\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs there any way to somehow initialise the Vue data with the content of myDiv1 for example, so I don't have 2 sets of html I somehow mess with (e.g deleting the initial html block and repopulating via Vue) ?\u003c/p\u003e","answer_count":"0","comment_count":"6","creation_date":"2016-11-04 16:36:11.66 UTC","last_activity_date":"2016-11-04 16:49:20.817 UTC","last_edit_date":"2016-11-04 16:49:20.817 UTC","last_editor_display_name":"","last_editor_user_id":"1429053","owner_display_name":"","owner_user_id":"1429053","post_type_id":"1","score":"2","tags":"javascript|vue.js","view_count":"166"} +{"id":"45892845","title":"Javascript \"not a function\" error, on an already defined function","body":"\u003cp\u003eI was just playing around with DFS in node, and suddenly got this error.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eTypeError: sNode.hasNeighbors is not a function\n at recursiveDFS (/home/***/Graphs/dfs2.js:53:27)\n at /home/***/Graphs/dfs2.js:56:17\n at Array.forEach (\u0026lt;anonymous\u0026gt;)\n at recursiveDFS (/home/***/Graphs/dfs2.js:54:30)\n at Object.\u0026lt;anonymous\u0026gt; (/home/***Graphs/dfs2.js:62:1)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is the code.\nIf I reference the function it says \"is not a function\"\nWhen I reference the function as a property it says \"it's a function\"\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction Node(vert) {\n this.visited = false;\n this.vertex = vert;\n let neighbors = [];\n\n this.addNeighbors = function(node_str) {\n if (node_str.length == 1) {\n neighbors.push(parseInt(node_str));\n } else {\n nodes = node_str.split(\" \");\n for (var i = 0; i \u0026lt; nodes.length; i++) {\n neighbors.push(parseInt(nodes[nodes[i]]));\n }\n }\n };\n\n this.hasNeighbors = function() {\n return neighbors.length \u0026gt; 0;\n };\n\n this.getNeighbors = function() {\n return neighbors;\n };\n}\n\nlet node = [];\nnode[0] = new Node(0);\nnode[1] = new Node(1);\nnode[2] = new Node(2);\nnode[3] = new Node(3);\nnode[4] = new Node(4);\nnode[5] = new Node(5);\nnode[6] = new Node(6);\nnode[7] = new Node(7);\nnode[8] = new Node(8);\nnode[9] = new Node(9);\n\nnode[0].addNeighbors(\"1\");\n\nnode[1].addNeighbors(\"0 1\");\n\nnode[2].addNeighbors(\"1 3\");\n\nnode[3].addNeighbors(\"2 4 5\");\n\nnode[4].addNeighbors(\"3 5 6\");\n\nfunction recursiveDFS(sNode) {\n if (!sNode.visited) {\n sNode.visited = true;\n //console.log(sNode.hasNeighbors());\n sNode.getNeighbors().forEach(function(neighbor) {\n if (!neighbor.visited) {\n recursiveDFS(neighbor);\n }\n }, this);\n }\n}\n\nrecursiveDFS(node[0]);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOutside the recursiveDFS function everything works completely fine.\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2017-08-26 07:09:52.767 UTC","last_activity_date":"2017-08-26 07:09:52.767 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"8519668","post_type_id":"1","score":"0","tags":"javascript|node.js|function|object|graph-algorithm","view_count":"36"} +{"id":"10443199","title":"Store ByteArrayOutputStream in SD Card","body":"\u003cp\u003eI am getting a \u003ccode\u003eByteArrayOutputStream\u003c/code\u003e of Camera and want to Store this video stream into SD Card as a file, file extension would be anything.\u003c/p\u003e\n\n\u003cp\u003eHow can I fetch streaming and store it into SD Card,as I am getting a live camera stream and want to update that continously in SD Card.\u003c/p\u003e\n\n\u003cp\u003eCould you please provide me a sample tutorials related to camera streaming.\u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","accepted_answer_id":"10443223","answer_count":"1","comment_count":"0","creation_date":"2012-05-04 05:34:37.327 UTC","favorite_count":"1","last_activity_date":"2012-05-04 08:32:35.197 UTC","last_edit_date":"2012-05-04 08:32:35.197 UTC","last_editor_display_name":"","last_editor_user_id":"646806","owner_display_name":"","owner_user_id":"932623","post_type_id":"1","score":"1","tags":"android|video-streaming","view_count":"1479"} +{"id":"16757443","title":"Spring Data Solr - Exception in mapping a custom repository","body":"\u003cp\u003eI am trying to use faceted search with a custom repository as follows:\u003c/p\u003e\n\n\u003cp\u003eRepository:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic interface POISearchRepository extends CustomSolrRepository, SolrCrudRepository\u0026lt;POISearch, String\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCustom interface: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic interface CustomSolrRepository { \n\n FacetPage\u0026lt;POISearch\u0026gt; facetSearch(String location, String categories, String duration, Pageable page) throws Exception; \n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCustom impl:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@Repository\npublic class POISearchImpl implements CustomSolrRepository {\n\n@Resource\nprivate SolrTemplate solrTemplate;\n\n@Override\npublic FacetPage\u0026lt;POISearch\u0026gt; facetSearch(String location, String categories, String duration, Pageable page) throws Exception {\n\n......\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eUnfortunately, I keep getting the following exception:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eCaused by:\n org.springframework.data.mapping.PropertyReferenceException: No\n property facet found for type com.example.domain.POISearch at\n org.springframework.data.mapping.PropertyPath.(PropertyPath.java:75)\n at\n org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:327)\n at\n org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:353)\n at\n org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:307)\n at\n org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:271)\n at\n org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:245)\n at\n org.springframework.data.repository.query.parser.Part.(Part.java:72)\n at\n org.springframework.data.repository.query.parser.PartTree$OrPart.(PartTree.java:180)\n at\n org.springframework.data.repository.query.parser.PartTree$Predicate.buildTree(PartTree.java:260)\n at\n org.springframework.data.repository.query.parser.PartTree$Predicate.(PartTree.java:240)\n at\n org.springframework.data.repository.query.parser.PartTree.(PartTree.java:68)\n at\n org.springframework.data.solr.repository.query.PartTreeSolrQuery.(PartTreeSolrQuery.java:36)\n at\n org.springframework.data.solr.repository.support.SolrRepositoryFactory$SolrQueryLookupStrategy.resolveQuery(SolrRepositoryFactory.java:101)\n at\n org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.(RepositoryFactorySupport.java:279)\n at\n org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:147)\n at\n org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.getObject(RepositoryFactoryBeanSupport.java:153)\n at\n org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.getObject(RepositoryFactoryBeanSupport.java:43)\n at\n org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:142)\n ... 57 more\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eIt seems like the repository tries to resolve the custom method and that causes the exception (changing the method names shows that)\u003c/p\u003e","accepted_answer_id":"16758891","answer_count":"1","comment_count":"0","creation_date":"2013-05-26 08:23:16.577 UTC","last_activity_date":"2013-05-26 11:43:22.347 UTC","last_edit_date":"2013-05-26 11:03:38.067 UTC","last_editor_display_name":"","last_editor_user_id":"197127","owner_display_name":"","owner_user_id":"197127","post_type_id":"1","score":"1","tags":"spring|solr|spring-data|facets|spring-data-solr","view_count":"700"} +{"id":"22387135","title":"Full width nav bar for my website","body":"\u003cp\u003eI need some help. I have a website and I want to make some changes, but I don't know how. I read other questions here, but they didn't help. This is my website: \u003ca href=\"http://www.bijuterii-din-inox.ro\" rel=\"nofollow\"\u003ehttp://www.bijuterii-din-inox.ro\u003c/a\u003e.\u003c/p\u003e\n\n\u003cp\u003eI want my nav bar to be the full width of the page. Can you please give me a hand!? Thanks.\u003c/p\u003e\n\n\u003cp\u003eThis is my css:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#top_nav {\n padding: 0 2px;\n}\n\n#top_nav ul {\n display: block;\n height: 43px;\n}\n\n#top_nav ul li i,\n#top_nav ul li b {\n display: none;\n float: none;\n width: auto;\n height: auto;\n}\n\n#top_nav ul li a {\n float: left;\n height: 43px;\n line-height: 43px;\n padding: 0 20px;\n font-weight: 700;\n}\n\n#top_nav ul li.first a {\n padding-left: 20px;\n}\n\n#top_nav ul li.last,\n#top_nav ul li.single {\n background: none;\n}\n\n#top_nav ul li.single a {\n padding-left: 0;\n padding-top: 2px;\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"4","creation_date":"2014-03-13 18:02:17.483 UTC","last_activity_date":"2014-03-13 19:42:55.17 UTC","last_edit_date":"2014-03-13 19:22:26.577 UTC","last_editor_display_name":"","last_editor_user_id":"3150271","owner_display_name":"","owner_user_id":"3416680","post_type_id":"1","score":"0","tags":"html|css","view_count":"59"} +{"id":"9797983","title":"How can I know request destination?","body":"\u003cp\u003eI created a webpage by classic asp. A date was displayed in this page. But I want to display it with request country dateformat. So, I need to know which request came from? How can I know it? Thanks.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2012-03-21 02:49:01.59 UTC","last_activity_date":"2012-03-21 03:40:32.097 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"461322","post_type_id":"1","score":"0","tags":"asp-classic","view_count":"37"} +{"id":"26728512","title":"How to Group Data between DateTime using Linq","body":"\u003cp\u003eMy student class is\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass Student\n{\n public string FirstName { get; set; }\n public string LastName { get; set; }\n public int ID { get; set; }\n public DateTime Admission{get; set;}\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to group the data between datetime where Admission must between Today 7 am to next morning 7 am , for example :- 11/4/2014 7:0:0 and 11/5/2014 7:0:0 all data between these datetime's must be in a single group \u003c/p\u003e\n\n\u003cp\u003eCurrently i am doing it like this \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar groupByAdmsn = listOfStudent.\nGroupBy(x =\u0026gt; x.Admission \u0026lt; new DateTime(x.Admission.Year, x.Admission.Month, x.Admission.Day, 7, 0, 0).AddDays(1) \u0026amp;\u0026amp;\n x.Admission \u0026gt;= new DateTime(x.Admission.Year, x.Admission.Month, x.Admission.Day, 7, 0, 0))\n.Select(x =\u0026gt; x)\n.ToList();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut it is not working.\u003c/p\u003e","accepted_answer_id":"26729185","answer_count":"2","comment_count":"0","creation_date":"2014-11-04 05:46:23.113 UTC","last_activity_date":"2014-11-05 06:54:59.35 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1770375","post_type_id":"1","score":"0","tags":"c#|linq|datetime","view_count":"253"} +{"id":"33071351","title":"How to plot random x-values in gnuplot","body":"\u003cp\u003eI have a data set with two columns, \u003ccode\u003e(x,y)\u003c/code\u003e which looks like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e4 16\n1 1\n5 25\n3 9\n7 49\n0 0\n2 4\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow I want to plot this in gnuplot \u003ccode\u003eu 1:2\u003c/code\u003e in the order in which column 1 is arranged. Basically on x-axis, gnuplot should have first 4, then 1, then 5 and so on. Is it possible with gnuplot or any other plotting tool?\u003c/p\u003e","accepted_answer_id":"33074968","answer_count":"2","comment_count":"1","creation_date":"2015-10-11 23:46:41.043 UTC","last_activity_date":"2015-10-12 09:55:33.05 UTC","last_edit_date":"2015-10-12 06:59:14.27 UTC","last_editor_display_name":"","last_editor_user_id":"2604213","owner_display_name":"","owner_user_id":"5434654","post_type_id":"1","score":"-1","tags":"matplotlib|gnuplot","view_count":"70"} +{"id":"34310608","title":"memory allocation in custom initialization","body":"\u003cp\u003eRan allocation profiler on my code. Found following problem on the inserted code. Could someone please point me what is wrong in the code. Added the picture so as too show the color coding.\n\u003ca href=\"https://i.stack.imgur.com/tKwXQ.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/tKwXQ.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eCode for initializing the point is as below:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@autoreleasepool {\n\nif(!coordString){\n return nil;\n}\nif([coordString length]\u0026lt;3){\n return nil;\n}\n\n__weak NSArray* coords=[coordString componentsSeparatedByString:@\",\"];\n if(nil != coords \u0026amp;\u0026amp; ([coords count]==2)){\n self = [super init];\n if(nil != self){\n self.coordX= [[coords objectAtIndex:0] doubleValue];\n self.coordY = [[coords objectAtIndex:1] doubleValue];\n\n return self;\n }else {\n return nil;\n }\n\n }else{\n\n return nil;\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ePlease suggest where the problem might be.\nAllocation snapshot indicates the persistance memory.\n\u003ca href=\"https://i.stack.imgur.com/psyc7.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/psyc7.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e","answer_count":"1","comment_count":"8","creation_date":"2015-12-16 11:16:28.063 UTC","last_activity_date":"2015-12-16 16:57:47.527 UTC","last_edit_date":"2015-12-16 13:03:17.037 UTC","last_editor_display_name":"","last_editor_user_id":"1271381","owner_display_name":"","owner_user_id":"1271381","post_type_id":"1","score":"1","tags":"ios|objective-c|memory-leaks|profiler","view_count":"52"} +{"id":"1182612","title":"What is the difference between X509Certificate2 and X509Certificate in .NET?","body":"\u003cp\u003eWhat is the difference between the two?\u003c/p\u003e","accepted_answer_id":"1182626","answer_count":"3","comment_count":"0","creation_date":"2009-07-25 17:48:20.29 UTC","favorite_count":"2","last_activity_date":"2017-07-13 08:44:52.13 UTC","last_edit_date":"2014-11-24 12:52:11.73 UTC","last_editor_display_name":"","last_editor_user_id":"1280810","owner_display_name":"","owner_user_id":"127853","post_type_id":"1","score":"55","tags":".net|ssl|certificate|x509certificate","view_count":"28867"} +{"id":"36726367","title":"aligning text fields in css html form","body":"\u003cp\u003eI'm trying to make a website form look like this where the \n\u003ca href=\"http://i.stack.imgur.com/7Vc1B.png\" rel=\"nofollow\"\u003eright side of text fields are aligned\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eWhen I change the size of the screen, the text fields are no longer in alignment. How can I keep them aligned regardless of screen size?\u003c/p\u003e\n\n\u003cp\u003eHere is my code:\u003c/p\u003e\n\n\u003cp\u003e\u003cdiv class=\"snippet\" data-lang=\"js\" data-hide=\"false\"\u003e\r\n\u003cdiv class=\"snippet-code\"\u003e\r\n\u003cpre class=\"snippet-code-html lang-html prettyprint-override\"\u003e\u003ccode\u003e\u0026lt;head\u0026gt;\r\n\r\n \u0026lt;META HTTP-EQUIV=\"Content-type\" CONTENT=\"text/html; charset=UTF-8\"\u0026gt;\r\n \u0026lt;title\u0026gt;Coat Request Form\u0026lt;/title\u0026gt;\r\n\r\n \u0026lt;/head\u0026gt;\r\n\r\n \u0026lt;body\u0026gt;\r\n\r\n \u0026lt;form target=\"_top\" action=\"https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8\" method=\"POST\"\u0026gt;\r\n\r\n \u0026lt;p\u0026gt;\r\n \u0026lt;input type=hidden name=\"oid\" value=\"00Di0000000gO95\"\u0026gt;\r\n \u0026lt;input type=hidden name=\"retURL\" value=\"http://www.empowermentplan.org/#!thank-you/jiwpq\"\u0026gt; \r\n\r\n \u0026lt;span style=\"display:inline-block\" margin-right=\"30px\"\u0026gt;\r\n \u0026lt;label class=\"required\" for=\"first_name\" style=\"display:block\"\u0026gt;First Name\u0026lt;/label\u0026gt; \r\n \u0026lt;input id=\"first_name\" maxlength=\"40\" name=\"first_name\" size=\"20\" type=\"text\" required /\u0026gt;\u0026lt;br\u0026gt;\r\n \u0026lt;/span\u0026gt;\r\n\r\n \u0026lt;span style=\"display:inline-block\"\u0026gt;\r\n \u0026lt;label class=\"required\" for=\"last_name\" style=\"display:block\"\u0026gt;Last Name\u0026lt;/label\u0026gt;\r\n \u0026lt;input id=\"last_name\" maxlength=\"80\" name=\"last_name\" size=\"20\" type=\"text\" required /\u0026gt;\u0026lt;br\u0026gt;\r\n \u0026lt;/span\u0026gt;\r\n \u0026lt;br\u0026gt;\r\n \u0026lt;span style=\"display:inline-block\"\u0026gt;\r\n \u0026lt;label class=\"required\" for=\"email\" style=\"display:block\" \u0026gt;Email\u0026lt;/label\u0026gt;\r\n \u0026lt;input id=\"email\" maxlength=\"80\" name=\"email\" size=\"20\" type=\"text\" required/\u0026gt;\u0026lt;br\u0026gt;\r\n \u0026lt;/span\u0026gt;\r\n\r\n \u0026lt;span style=\"display:inline-block\"\u0026gt;\r\n \u0026lt;label for=\"phone\" style=\"display:block\" \u0026gt;Phone\u0026lt;/label\u0026gt;\r\n \u0026lt;input id=\"phone\" maxlength=\"40\" name=\"phone\" size=\"20\" type=\"text\" /\u0026gt;\u0026lt;br\u0026gt;\r\n \u0026lt;/span\u0026gt;\r\n\r\n \u0026lt;br\u0026gt;\r\n\r\n \u0026lt;span style=\"display:inline-block\"\u0026gt;\r\n \u0026lt;label for=\"company\" style=\"display:block\"\u0026gt;Company (optional)\u0026lt;/label\u0026gt;\r\n \u0026lt;input id=\"company\" maxlength=\"40\" name=\"company\" size=\"20\" type=\"text\" /\u0026gt;\u0026lt;br\u0026gt;\r\n \u0026lt;/span\u0026gt;\r\n\r\n \u0026lt;span style=\"display:inline-block\"\u0026gt;\r\n\r\n \u0026lt;label style=\"display:block\"\u0026gt;How many coats?\u0026lt;/label\u0026gt;\r\n \u0026lt;input id=\"00Ni000000H0CxE\" name=\"00Ni000000H0CxE\" size=\"20\" type=\"text\" /\u0026gt;\u0026lt;br\u0026gt;\r\n\r\n \u0026lt;/span\u0026gt;\r\n\r\n\r\n \u0026lt;label style=\"display:block\"\u0026gt;Who are the coats for?\u0026lt;/label\u0026gt;\r\n \u0026lt;textarea id=\"00Ni000000H0Cy2\" name=\"00Ni000000H0Cy2\" rows=\"3\" type=\"text\" wrap=\"soft\"\u0026gt;\u0026lt;/textarea\u0026gt;\u0026lt;br\u0026gt;\r\n \u0026lt;input type=\"submit\" name=\"submit\" class=\"btn\"\u0026gt;\r\n\r\n \u0026lt;select style=\"visibility:hidden\" id=\"00Ni000000H0Cxx\" name=\"00Ni000000H0Cxx\" title=\"Topic\"\u0026gt;\r\n \u0026lt;option type=\"hidden\" value=\"Coats\"\u0026gt;Coats\u0026lt;/option\u0026gt; \u0026lt;/select\u0026gt;\u0026lt;br\u0026gt;\r\n \u0026lt;/p\u0026gt;\r\n \u0026lt;/form\u0026gt;\r\n \u0026lt;/body\u0026gt;\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003c/p\u003e","answer_count":"3","comment_count":"2","creation_date":"2016-04-19 18:16:38.543 UTC","last_activity_date":"2016-04-19 18:37:30.647 UTC","last_edit_date":"2016-04-19 18:21:34.013 UTC","last_editor_display_name":"","last_editor_user_id":"4802649","owner_display_name":"","owner_user_id":"6226356","post_type_id":"1","score":"1","tags":"html|css|forms|alignment","view_count":"39"} +{"id":"29990185","title":"Open files limit server can support","body":"\u003cp\u003eI am continuously getting Socket connection problem (too many open files) in tomcats catalina.out. When I do \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eulimit -n\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI get 1024. Is there a way I can find whats the maximum number of open files the server can support before increasing the limit. I don't want to arbitrarily increase the limit to a value the server cant support. I am searching, I can find how to increase it but cant find how to figure out server limitations. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecat /proc/version\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eLinux version 2.6.32-431.5.1.el6.x86_64 (mockbuild@c6b10.bsys.dev.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC) ) #1 SMP Wed Feb 12 00:41:43 UTC 2014\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecat /etc/redhat-release\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCentOS release 6.5 (Final)\u003c/p\u003e\n\n\u003cp\u003eAs pointed out by my friend in the answer below.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecat /proc/sys/fs/file-max\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to know this limit (maximum number of open files) the system supports. So I can set it.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-05-01 15:45:44.563 UTC","last_activity_date":"2015-05-01 17:05:24.28 UTC","last_edit_date":"2015-05-01 16:50:15.387 UTC","last_editor_display_name":"","last_editor_user_id":"3335579","owner_display_name":"","owner_user_id":"3335579","post_type_id":"1","score":"0","tags":"linux|tomcat|centos|server","view_count":"192"} +{"id":"18126591","title":"How to bind DBnull values to grid view?","body":"\u003cp\u003eI am facing struggle to bind values to grid which are retrieved from data base. I have a database column of type DateTime which is nullable. So, when I am trying to bind that null value, it is throwing an error while adding those column value to object property . So, before adding values fetched from database, i am using a function that converts the value to its default type before adding to object. Since , the default value for datetime Type is 1/1/0001 12:00:00 AM . So, where ever null values are present , I am getting this value for this field.\u003c/p\u003e\n\n\u003cp\u003eHow to solve this issue? Please give your sugesstions.\u003c/p\u003e\n\n\u003cp\u003eTo explain my scenario , i am adding a piece of code here.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic static T GetValue\u0026lt;T\u0026gt;(object o)\n{\n T val = default(T);\n\n if (o != null \u0026amp;\u0026amp; o != DBNull.Value)\n {\n val = (T)o;\n }\n return val;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is the helper function I am using while reading data from the data reader.\u003c/p\u003e","accepted_answer_id":"18734285","answer_count":"1","comment_count":"3","creation_date":"2013-08-08 12:54:02.763 UTC","last_activity_date":"2013-09-11 06:39:05.03 UTC","last_edit_date":"2013-08-08 15:20:46.12 UTC","last_editor_display_name":"","last_editor_user_id":"305637","owner_display_name":"","owner_user_id":"2587505","post_type_id":"1","score":"1","tags":"c#-4.0|gridview|dbnull","view_count":"575"} +{"id":"40716098","title":"http rest: Disadvantages of using json in query string?","body":"\u003cp\u003eI want to use query string as json, for example: \u003ccode\u003e/api/uri?{\"key\":\"value\"}\u003c/code\u003e, instead of \u003ccode\u003e/api/uri?key=value\u003c/code\u003e. Advantages, from my point of view, are:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003ejson keep types of parameters, such are booleans, ints, floats and strings. Standard query string treats all parameters as strings.\u003c/li\u003e\n\u003cli\u003ejson has less symbols for deep nested structures, For example, \u003ccode\u003e?{\"a\":{\"b\":{\"c\":[1,2,3]}}}\u003c/code\u003e vs \u003ccode\u003e?a[b][c][]=1\u0026amp;a[b][c][]=2\u0026amp;a[b][c][]=3\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003eEasier to build on client side\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eWhat disadvantages could be in that case of json usage?\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2016-11-21 08:54:55.423 UTC","last_activity_date":"2016-11-22 08:42:56.297 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1209428","post_type_id":"1","score":"0","tags":"json|rest|http|query-string","view_count":"82"} +{"id":"27384346","title":"C# novice in need","body":"\u003cp\u003eBelow is the code to our \u003ccode\u003ecs.aspx\u003c/code\u003e recall page. The idea is that we scan a barcode and it references the code to see of a UPC is on the recall list. If it is, the \"STOP SIGN\" is supposed to show, if it is not on the list, the \"GREEN Light\" is supposed to show. The problem with the code below is that after the \"GREEN LIGHT\" icon is called, it requires a manual enter on the keyboard for the next barcode scan to work properly. \u003c/p\u003e\n\n\u003cp\u003eHere is what the results are:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eScan Barcode 12345\u003c/li\u003e\n\u003cli\u003eGreen light icon shows\u003c/li\u003e\n\u003cli\u003eScan Barcode 54321\u003c/li\u003e\n\u003cli\u003eGreen light icon goes away (this is where I need the Green Light to show again or stay)\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eI am lost. Here is the code (we use Chrome or Firefox browser to call the \u003ccode\u003ecs.aspx\u003c/code\u003e)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;%@ Page Language=\"C#\" AutoEventWireup=\"true\" CodeFile=\"CS.aspx.cs\" Inherits=\"CS\" %\u0026gt;\n\n\n\u0026lt;!DOCTYPE html\u0026gt;\n\u0026lt;html lang=\"en\"\u0026gt;\n\u0026lt;head id=\"Head1\"\u0026gt;\n \u0026lt;meta charset=\"utf-8\" /\u0026gt;\n\n \u0026lt;link href=\"~/favicon.ico\" rel=\"shortcut icon\" type=\"image/x-icon\" /\u0026gt;\n\n\n \u0026lt;script src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js\"\u0026gt;\n \u0026lt;/script\u0026gt;\n \u0026lt;script\u0026gt;\n $(document).ready(function () {\n $('#txtUPC').focus();\n\n $(\"input\").keyup(function (event) {\n\n var strUPC = $(this).val();\n\n\n if (strUPC == \"000035\" ) {\n $(\"#stop_dialog\").show();\n var lblStopText = \"Recalled Product: UPC:000035 Product: Test Scan\";\n $('#lblStop').val(lblStopText);\n $(\"#check_green\").hide();\n setTimeout(function () {\n $(\"input\").prop('disabled', true);}, 800);\n\n return;\n }\n\n if (strUPC == \"037600245289\" ) {\n $(\"#stop_dialog\").show();\n var lblStopText = \"Recalled Product: UPC:037600245289 Product: Hormel Chili Hot No Beans\";\n $('#lblStop').val(lblStopText);\n $(\"#check_green\").hide();\n setTimeout(function () {\n $(\"input\").prop('disabled', true);}, 800);\n\n return;\n }\n\n if (strUPC == \"013409128442\" ) {\n $(\"#stop_dialog\").show();\n var lblStopText = \"Recalled Product: UPC:013409128442 Product: Sweet Baby Ray's Baffolo Wing Sauce\";\n $('#lblStop').val(lblStopText);\n $(\"#check_green\").hide();\n setTimeout(function () {\n $(\"input\").prop('disabled', true);}, 800);\n\n return;\n }\n\n if (strUPC == \"041130311222\" ) {\n $(\"#stop_dialog\").show();\n var lblStopText = \"Recalled Product: UPC:041130311222 Product: Shoppers Value Pinto Beans\";\n $('#lblStop').val(lblStopText);\n $(\"#check_green\").hide();\n setTimeout(function () {\n $(\"input\").prop('disabled', true);}, 800);\n\n return;\n }\n\n if (strUPC == \"041800501267\" ) {\n $(\"#stop_dialog\").show();\n var lblStopText = \"Recalled Product: UPC:041800501267 Product: Welch's Grape\";\n $('#lblStop').val(lblStopText);\n $(\"#check_green\").hide();\n setTimeout(function () {\n $(\"input\").prop('disabled', true);}, 800);\n\n return;\n }\n\n if (strUPC == \"041130311208\" ) {\n $(\"#stop_dialog\").show();\n var lblStopText = \"Recalled Product: UPC:041130311208 Product: Shoppers Value Dark Red Kidney Beans\";\n $('#lblStop').val(lblStopText);\n $(\"#check_green\").hide();\n setTimeout(function () {\n $(\"input\").prop('disabled', true);}, 800);\n\n return;\n }\n $(\"#check_green\").toggle();\n\n enterUPC(strUPC);\n\n $('#txtUPC').focus();\n\n $('#Reset').click();\n\n\n });\n\n\n $('#Reset').click(function () {\n\n setTimeout(function () {\n\n document.getElementById('txtUPC').focus();\n }, 800);\n\n\n setTimeout(function () {\n\n document.getElementById('txtUPC').value = \"\";\n }, 800);\n\n\n });\n\n\n function doreset() {\n $('#txtUPC').val(\"\");\n $('#txtUPC').focus();\n\n }\n\n\n function enterUPC(strUPC) {\n\n\n $('#lblUPC').val(strUPC);\n\n\n var dNow = new Date();\n var localdate = (dNow.getMonth() + 1) + '/' + dNow.getDate() + '/' + dNow.getFullYear() + ' ' + dNow.getHours() + ':' + dNow.getMinutes() + ':' + dNow.getSeconds();\n\n $('#lbltimestamp').val(localdate);\n\n setTimeout(function () {\n\n $('#Go').click();\n }, 200);\n\n\n\n }\n\n\n $('#Go').click(function () {\n var code = {};\n code.UPC = $(\"[id*=lblUPC]\").val();\n code.strDate = $(\"[id*=lbltimestamp]\").val();\n $.ajax({\n type: \"POST\",\n url: \"CS.aspx/SaveUPC\",\n data: '{code: ' + JSON.stringify(code) + '}',\n contentType: \"application/json; charset=utf-8\",\n dataType: \"json\",\n\n });\n return false;\n });\n\n\n\n\n });\n\n\u0026lt;/script\u0026gt;\n\n\n\u0026lt;/head\u0026gt;\n\u0026lt;body\u0026gt;\n\nEnter UPC: \u0026lt;input type=\"text\" ID=\"txtUPC\"/\u0026gt;\n \u0026lt;br /\u0026gt; \u0026lt;input type=\"text\" id=\"lblUPC\" runat=\"server\" readonly=\"readonly\" style=\"border: 0px; background-color: transparent;\" size=\"100\" /\u0026gt;\n \u0026lt;br /\u0026gt;\n\u0026lt;input type=\"text\" id=\"lbltimestamp\" runat=\"server\" readonly=\"readonly\" style=\"border: 0px; background-color: transparent;\" size=\"100\" /\u0026gt;\n\n \u0026lt;input type=\"button\" id=\"Go\" value=\"\"/\u0026gt; \n \u0026lt;input type=\"button\" id=\"Reset\" value=\"Reset\"/\u0026gt; \n \u0026lt;br /\u0026gt;\n\u0026lt;div id=\"check_green\" style=\"display: none\"\u0026gt;\n\n \u0026lt;br /\u0026gt; \u0026lt;img src=\"Green.png\" alt=\"Good\" /\u0026gt;\n \u0026lt;br /\u0026gt; \n\u0026lt;/div\u0026gt;\n\n \u0026lt;div id=\"stop_dialog\" style=\"display: none\"\u0026gt;\n\n \u0026lt;input type=\"text\" id=\"lblStop\" runat=\"server\" readonly=\"readonly\" style=\"border: 0px; background-color: transparent;\" size=\"100\" /\u0026gt;\n\u0026lt;br /\u0026gt;\n \u0026lt;img src=\"Stop.png\" alt=\"Stop\" /\u0026gt;\n\n\u0026lt;/div\u0026gt;\n\n\n\n \u0026lt;form id=\"form1\" runat=\"server\"\u0026gt;\n\n\n\n \u0026lt;br /\u0026gt;\n \u0026lt;/form\u0026gt;\n\u0026lt;script type=\"text/javascript\" src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\n\u0026lt;script type=\"text/javascript\" src=\"http://cdn.jsdelivr.net/json2/0.1/json2.js\"\u0026gt;\u0026lt;/script\u0026gt;\n\n\n\u0026lt;/body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e(I am not sure what I am doing)\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2014-12-09 16:50:16.48 UTC","last_activity_date":"2015-06-04 05:20:25.647 UTC","last_edit_date":"2015-06-04 05:20:25.647 UTC","last_editor_display_name":"","last_editor_user_id":"478656","owner_display_name":"","owner_user_id":"4342334","post_type_id":"1","score":"-2","tags":"javascript|c#|jquery|html|css","view_count":"82"} +{"id":"40815154","title":"Capybara: How to hit the first button in rspec?","body":"\u003cp\u003eHere is the html source code for 2 \u003ccode\u003eSave\u003c/code\u003e buttons in \u003ccode\u003eRails 4\u003c/code\u003e spec. The program should click the first \u003ccode\u003eSave\u003c/code\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"btn-toolbar\"\u0026gt;\n \u0026lt;a class=\"btn btn-primary\" href=\"/view_handler?index=0\"\u0026gt;\n \u0026lt;span class=\"translation_missing\" title=\"translation missing: en.Back\"\u0026gt;Back\u0026lt;/span\u0026gt;\n \u0026lt;/a\u0026gt;\n \u0026lt;input class=\"btn btn-default btn btn-primary\" name=\"commit\" value=\"Save\" type=\"submit\"\u0026gt;\n \u0026lt;input class=\"btn btn-default btn btn-primary\" name=\"commit\" value=\"Save \u0026amp; New\" and_new=\"true\" type=\"submit\"\u0026gt;\n\u0026lt;/div\u0026gt;`\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is the code I tried:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efirst('input.btn.btn-default').click_button 'Save'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe error returned is:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eCapybara::ElementNotFound:\n Unable to find button \"Save\"\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eWhat's the right way to click button \u003ccode\u003eSave\u003c/code\u003e in spec?\u003c/p\u003e","accepted_answer_id":"40815575","answer_count":"1","comment_count":"1","creation_date":"2016-11-26 05:09:27.83 UTC","last_activity_date":"2016-11-26 17:51:06.207 UTC","last_edit_date":"2016-11-26 17:51:06.207 UTC","last_editor_display_name":"","last_editor_user_id":"1033737","owner_display_name":"","owner_user_id":"938363","post_type_id":"1","score":"0","tags":"ruby-on-rails|rspec|capybara","view_count":"374"} +{"id":"6321295","title":"C# Creating admin shortcut","body":"\u003cp\u003eI found this \u003ca href=\"http://vbaccelerator.com/home/NET/Code/Libraries/Shell_Projects/Creating_and_Modifying_Shortcuts/article.asp\" rel=\"nofollow\"\u003earticle\u003c/a\u003e but it does not contain support for run as admin..\u003c/p\u003e\n\n\u003cp\u003eWell i need to create a shortcut to notepad to edit a xml file, but i need notepad to run as administrator, how would i go about to do that?\u003c/p\u003e","accepted_answer_id":"7067873","answer_count":"2","comment_count":"0","creation_date":"2011-06-12 09:48:01.093 UTC","favorite_count":"0","last_activity_date":"2017-02-13 01:23:13.133 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"58553","post_type_id":"1","score":"3","tags":"c#|.net","view_count":"731"} +{"id":"46660637","title":"FullCalendar adding data-date at tbody td on the div with a class of fc-content-skeleton","body":"\u003cp\u003eCan I add \u003ccode\u003edate-add\u003c/code\u003e at the tbody td of the div with class \u003ccode\u003efc-content-skeleton\u003c/code\u003e table? coz only the thead td has a \u003ccode\u003edata-date\u003c/code\u003e, can we data-date at it also?\u003c/p\u003e","accepted_answer_id":"46683776","answer_count":"1","comment_count":"1","creation_date":"2017-10-10 07:13:34.143 UTC","last_activity_date":"2017-10-13 02:22:52 UTC","last_edit_date":"2017-10-13 02:22:52 UTC","last_editor_display_name":"","last_editor_user_id":"5650328","owner_display_name":"","owner_user_id":"6064807","post_type_id":"1","score":"0","tags":"fullcalendar","view_count":"53"} +{"id":"41528010","title":"Error with popover and UIAlertController","body":"\u003cp\u003eI have an app with a popover. As I'm coming out of the popover. I am dismissing the popover via a \u003ccode\u003eUIAlertController\u003c/code\u003e (user answers Yes). Before dismissing the popover, though, I am calling a function on the delegate. Within that function is another \u003ccode\u003eUIAlertController\u003c/code\u003e. The second \u003ccode\u003eUIAlertController\u003c/code\u003e is not displaying because of the following error:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eAttempting to load the view of a view controller while it is deallocating is not allowed and may result in undefined behavior.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eTo demo this here, I created a quick project that shows the problem. It is just a view controller with a button that calls the popover and a button on the popover that closes it and calls a delegate function containing another \u003ccode\u003eUIAlertController\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/zgRRX.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/zgRRX.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e \u003c/p\u003e\n\n\u003cp\u003eThis is the code for the view controller that calls the popover:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e//Delegate function called from popover\nfunc doSomeStuff() {\n let alert = UIAlertController(title: \"Some Stuff\", message: \"Do you want to do some stuff\", preferredStyle: .Alert)\n\n alert.addAction(UIAlertAction(title: \"Yes\", style: .Default, handler: {action in\n print(\"We did something here.\")\n }))\n alert.addAction(UIAlertAction(title: \"No\", style: .Cancel, handler: nil))\n\n presentViewController(alert, animated: true, completion: nil)\n}\n\n@IBAction func callPopover(sender: UIButton) {\n let popoverVC = self.storyboard?.instantiateViewControllerWithIdentifier(\"PopoverView\") as! PopoverController\n popoverVC.modalPresentationStyle = UIModalPresentationStyle.Popover\n popoverVC.preferredContentSize = CGSizeMake(200, 200)\n\n if let popoverController = popoverVC.popoverPresentationController {\n popoverController.backgroundColor = UIColor.lightGrayColor()\n popoverController.permittedArrowDirections = UIPopoverArrowDirection(rawValue: 0)\n\n popoverController.sourceRect = CGRectMake(CGRectGetMidX(self.view.bounds), CGRectGetMidY(self.view.bounds),0,0)\n popoverController.sourceView = callPopoverButton\n\n popoverController.delegate = self\n\n popoverVC.delegate = self\n\n self.presentViewController(popoverVC, animated: true, completion: nil)\n }\n}\n\n//Allows popover to present on devices besides iPad.\nfunc adaptivePresentationStyleForPresentationController(controller: UIPresentationController) -\u0026gt; UIModalPresentationStyle{\n return UIModalPresentationStyle.None\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe callPopover function is the action for the button on the first screen.\u003c/p\u003e\n\n\u003cp\u003eThis is the code for the popover screen:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar delegate: ViewController!\n\noverride func viewDidLoad() {\n super.viewDidLoad()\n}\n\n@IBAction func returnToMainView(sender: UIButton) {\n let alert = UIAlertController(title: \"Dismiss Popover\", message: \"Do you want to dismiss this popover?\", preferredStyle: .Alert)\n\n alert.addAction(UIAlertAction(title: \"Yes\", style: .Default, handler: {action in\n self.delegate.doSomeStuff()\n self.dismissViewControllerAnimated(true, completion: nil)\n }))\n\n alert.addAction(UIAlertAction(title: \"No\", style: .Cancel, handler: nil))\n\n self.presentViewController(alert, animated: true, completion: nil)\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen tapping the popover button on the first screen, the popover displays correctly:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/Ui0uZ.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/Ui0uZ.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eTapping the return button displays the alert:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/jfAQD.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/jfAQD.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eClicking Yes returns from the alert and should display the second alert, but that's where I get the error.\u003c/p\u003e\n\n\u003cp\u003eI think that the second alert is not displaying because the popover has not finished being dismissed, but have no idea how to get around it.\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2017-01-08 00:07:13.097 UTC","last_activity_date":"2017-01-08 00:34:07.327 UTC","last_edit_date":"2017-01-08 00:21:49.153 UTC","last_editor_display_name":"","last_editor_user_id":"4321599","owner_display_name":"","owner_user_id":"4321599","post_type_id":"1","score":"0","tags":"ios|swift|popover|uialertcontroller","view_count":"169"} +{"id":"37250861","title":"MediaPlayer crashing while playing mp3 from chunks of bytes?","body":"\u003cp\u003eI’m building an android application. The app functionality is that it transfer audio file from one device to another via bluetooth.\u003c/p\u003e\n\n\u003cp\u003eI’m trying to play the file in chunks in media player. Means that reciever receive audio file in chunks,play this file and add next chunk into the existing file.\u003c/p\u003e\n\n\u003cp\u003eI’m sending chunks of bytes(audio file) to another device and adding followed chunks into it. Playing these chunks at receiver side.\u003c/p\u003e\n\n\u003cp\u003eBut the is issue my app is crashing and getting this error:\u003c/p\u003e\n\n\u003cp\u003eError: \u003cstrong\u003eMediaPlayer prepare failed: status = 0x1\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eHere is my code:\u003c/p\u003e\n\n\u003cp\u003eThis is my code where i am sending audiofile when devices are paired,\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eInputStream inStream = getResources().openRawResource(R.raw.comman);\n byte[] music = inputStreamToByteArray(inStream);\n\n // Invoke client thread to send\n message = new Message();\n message.obj = music;\n MainApplication.clientThread.incomingHandler.sendMessage(message);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethis is code where converting sending data into chunks:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e byte[] buffer = new byte[Constants.CHUNK_SIZE];\n Log.v(TAG, \"Waiting for data. Expecting \" + progressData.remainingSize + \" more bytes.\");\n int bytesRead = inputStream.read(buffer);\n dataOutputStream.write(buffer, 0, bytesRead);\n progressData.remainingSize -= bytesRead;\n readBuf = buffer;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethis is code where i am receiving chunks of bytes,\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e File tempMp3 = File.createTempFile(\"kurchina\", \"mp3\", getCacheDir());\n tempMp3.deleteOnExit();\n FileOutputStream fos = new FileOutputStream(tempMp3);\n fos.write(mp3SoundByteArray); //mp3SoundByteArray is byte chunks\n fos.close();\n MediaPlayer mediaPlayer = new MediaPlayer();\n FileInputStream fis = new FileInputStream(tempMp3);\n FileDescriptor fileDescriptor = fis.getFD();\n mediaPlayer.reset();\n mediaPlayer.setDataSource(fileDescriptor);\n mediaPlayer.prepare(); // here my app is crashing\n mediaPlayer.start();\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"3","creation_date":"2016-05-16 09:40:04.127 UTC","last_activity_date":"2016-05-16 09:50:00.67 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3683054","post_type_id":"1","score":"0","tags":"android|audio|streaming|bytearray|media-player","view_count":"195"} +{"id":"33016037","title":"Fancy Tree Plugin is removing \u003ca\u003e-tags and IDs from my \u003cli\u003e-elements","body":"\u003cp\u003eedit: Somehow i have forgotten to say hi... Hi guys!\u003c/p\u003e\n\n\u003cp\u003eso far i've always found an answere to my questions because the question has already been asked and answered. But this time i searched for hours and still have no idea why my code is not working how it is supposed to do.\u003c/p\u003e\n\n\u003cp\u003eTo my background: i am an apprentice in the 2nd year, so please don't be to hard on me :-)\u003c/p\u003e\n\n\u003cp\u003eI am using Fancytree-2.12.0, jQuery-UI-1.11.4 and jQuery-1.11.3.\u003c/p\u003e\n\n\u003cp\u003eHere is the HTML Markup:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div id=\"CategorieTree\"\u0026gt;\n \u0026lt;ul id=\"treeData\" style=\"display:none;\"\u0026gt;\n \u0026lt;li id=\"rootNode\" class=\"expanded\"\u0026gt;\n \u0026lt;a href=\"loadPage.asp?Start=1\"\u0026gt;\u0026lt;strong\u0026gt;rootNode title\u0026lt;/strong\u0026gt;\u0026lt;/a\u0026gt;\n \u0026lt;ul\u0026gt;\n \u0026lt;li id=\"100\"\u0026gt;\u0026lt;a href=\"loadPage.asp?Content=100\"\u0026gt;title 100\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li id=\"200\"\u0026gt;\u0026lt;a href=\"loadPage.asp?Content=200\"\u0026gt;title 200\u0026lt;/a\u0026gt;\n \u0026lt;ul\u0026gt;\n \u0026lt;li id=\"210\"\u0026gt;\u0026lt;a href=\"loadPage.asp?Content=210\"\u0026gt;title 210\u0026lt;/a\u0026gt;\n \u0026lt;ul\u0026gt;\n \u0026lt;li id=\"211\"\u0026gt;\u0026lt;a href=\"loadPage.asp?Content=211\"\u0026gt;title 211\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li id=\"212\"\u0026gt;\u0026lt;a href=\"loadPage.asp?Content=212\"\u0026gt;title 212\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n \u0026lt;/li\u0026gt;\n \u0026lt;li id=\"220\"\u0026gt;\u0026lt;a href=\"loadPage.asp?Content=220\"\u0026gt;title 220\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n \u0026lt;/li\u0026gt;\n \u0026lt;li id=\"300\"\u0026gt;\u0026lt;a href=\"loadPage.asp?Content=300\"\u0026gt;title 300\u0026lt;/a\u0026gt;\n \u0026lt;ul\u0026gt;\n \u0026lt;li id=\"310\"\u0026gt;\u0026lt;a href=\"loadPage.asp?Content=310\"\u0026gt;title 310\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li id=\"320\"\u0026gt;\u0026lt;a href=\"loadPage.asp?Content=320\"\u0026gt;title 320\u0026lt;/a\u0026gt;\n \u0026lt;ul\u0026gt;\n \u0026lt;li id=\"321\"\u0026gt;\u0026lt;a href=\"loadPage.asp?Content=321\"\u0026gt;title 321\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n \u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n \u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n \u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe Tree is displayed totally fine. But when i try to click an element and the links should reload the page with different content, nothing happens! When i open the dev-tools (i am using chrome Version 45.0.2454.101 m) i can see my original and another that is obviously created by FancyTree, but here all my IDs and the aTag-elments are removed like that:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div id=\"CategorieTree\"\u0026gt;\n \u0026lt;ul class=\"ui-fancytree fancytree-container fancytree-plain\"\u0026gt;\n \u0026lt;li class=\"fancytree-lastsib\"\u0026gt;\n \u0026lt;span class=\"lots of classes\"\u0026gt;\n \u0026lt;span class=\"fancytree-expander\"\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;span class=\"fancytree-title\"\u0026gt;\u0026lt;strong\u0026gt;rootNode title\u0026lt;/strong\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;/span\u0026gt;\n \u0026lt;ul\u0026gt;\n \u0026lt;li\u0026gt;\n \u0026lt;span class=\"lots of classes\"\u0026gt;\n \u0026lt;span class=\"fancytree-expander\"\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;span class=\"fancytree-title\"\u0026gt;title 100\u0026lt;/span\u0026gt;\n \u0026lt;/span\u0026gt;\n \u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\n \u0026lt;span class=\"lots of classes\"\u0026gt;\n \u0026lt;span class=\"fancytree-expander\"\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;span class=\"fancytree-title\"\u0026gt;title 200\u0026lt;/span\u0026gt;\n \u0026lt;/span\u0026gt;\n \u0026lt;ul\u0026gt;\n \u0026lt;li\u0026gt;\n \u0026lt;span class=\"lots of classes\"\u0026gt;\n \u0026lt;span class=\"fancytree-expander\"\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;span class=\"fancytree-title\"\u0026gt;title 210\u0026lt;/span\u0026gt;\n \u0026lt;/span\u0026gt;\n \u0026lt;ul\u0026gt;\n \u0026lt;li\u0026gt;\n ....and so on\n \u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n \u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n \u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n \u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is my JavaScript for the initialization:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;script type=\"text/javascript\"\u0026gt;\n $(\"#CategorieTree\").fancytree({\n activeVisible: true, // Make sure, active nodes are visible (expanded).\n aria: false, // Enable WAI-ARIA support.\n autoActivate: true, // Automatically activate a node when it is focused (using keys).\n autoCollapse: false, // Automatically collapse all siblings, when a node is expanded.\n autoScroll: false, // Automatically scroll nodes into visible area.\n clickFolderMode: 4, // 1:activate, 2:expand, 3:activate and expand, 4:activate (dblclick expands)\n checkbox: false, // Show checkboxes.\n debugLevel: 2, // 0:quiet, 1:normal, 2:debug\n disabled: false, // Disable control\n focusOnSelect: false, // Set focus when node is checked by a mouse click\n generateIds: false, // Generate id attributes like \u0026lt;span id='fancytree-id-KEY'\u0026gt;\n idPrefix: \"ft_\", // Used to generate node id´s like \u0026lt;span id='fancytree-id-\u0026lt;key\u0026gt;'\u0026gt;.\n icons: false, // Display node icons.\n keyboard: true, // Support keyboard navigation.\n keyPathSeparator: \"/\", // Used by node.getKeyPath() and tree.loadKeyPath().\n minExpandLevel: 1, // 1: root node is not collapsible\n quicksearch: false, // Navigate to next node by typing the first letters.\n selectMode: 2, // 1:single, 2:multi, 3:multi-hier\n tabbable: true, // Whole tree behaves as one single control\n titlesTabbable: false // Node titles can receive keyboard focus\n });\n\u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy Question is:\nDo aTags NEVER work when you initialize fancytree with pure HTML-Markup or did i just do something wrong?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdit:\u003c/strong\u003e I got my IDs! \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003egenerateIds: false;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ehad to be set to true.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdit 2:\u003c/strong\u003e I have not found a solution for my a-Tag problem. They still get removed when i initialize my tree with plain HTML-markup. Thus i have rewritten my code and now i initialize the tree by using the source-attribute.\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2015-10-08 12:37:50.63 UTC","last_activity_date":"2015-10-09 11:11:01.647 UTC","last_edit_date":"2015-10-09 11:11:01.647 UTC","last_editor_display_name":"","last_editor_user_id":"5086829","owner_display_name":"","owner_user_id":"5086829","post_type_id":"1","score":"1","tags":"fancytree","view_count":"268"} +{"id":"38355213","title":"XSL: How can I access a variable defined in a called template, in the calling parent scope?","body":"\u003cp\u003eMy code looks something like this (deliberate simplification):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;xsl:template match=\"/\"\u0026gt;\n \u0026lt;xsl:call-template name=\"call_me\" /\u0026gt;\n \u0026lt;xsl:value-of select=\"$inner_variable\" /\u0026gt;\n\u0026lt;/xsl:template\u0026gt;\n\n\u0026lt;xsl:template name=\"call_me\"\u0026gt;\n \u0026lt;xsl:variable name=\"inner_variable\" select=\"/*\" /\u0026gt;\n\u0026lt;/xsl:template\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eObviously this won't work because of the scope of the variable. My question is:\nis there any way to either define the variable globally from the \u003ccode\u003ecall_me\u003c/code\u003e template, or to access this local variable from the parent (calling template) scope?\u003c/p\u003e\n\n\u003cp\u003eEDIT: The variable is not a XML tree fragment, but a node-set processed by C# functions. So I really need to access the variable.\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2016-07-13 14:56:52.97 UTC","favorite_count":"0","last_activity_date":"2016-07-13 15:20:01.13 UTC","last_edit_date":"2016-07-13 15:20:01.13 UTC","last_editor_display_name":"","last_editor_user_id":"6585077","owner_display_name":"","owner_user_id":"6585077","post_type_id":"1","score":"0","tags":"xslt","view_count":"40"} +{"id":"30864438","title":"Is it possible to permit all users except anonymous one?","body":"\u003cp\u003eHow can I permit access to URL such that only anonymous one can't get the page?\nI'm using Spring security.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;intercept-url pattern=\"/pattern/page.html\" access=\"__WHAT_SHOULD_BE_HERE__\"/\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"30864546","answer_count":"1","comment_count":"1","creation_date":"2015-06-16 10:02:01.533 UTC","last_activity_date":"2015-06-16 10:11:57.06 UTC","last_edit_date":"2015-06-16 10:11:57.06 UTC","last_editor_display_name":"","last_editor_user_id":"1314593","owner_display_name":"","owner_user_id":"3663882","post_type_id":"1","score":"0","tags":"java|spring|spring-security","view_count":"60"} +{"id":"45381688","title":"Python: Can't Convert lists from SQL","body":"\u003cp\u003eHello I am trying to learn Python, and right now I want to import some data from SQL. Unfortunately I have a problem that I wasn't capable of solving. I am getting the following error message: \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003ecursor.execute(\"select * from matchinfo WHERE matchid = '%i'\" %\n Matchid) TypeError: %i format: a number is required, not pyodbc.Row\"\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI guess the issue is that the list data isn't formatted as integers, however when I try to do stuff like \"Matchid[0] = int(Matchid[0])\" (and then print out Matchid[0]) it's not working either. So I am not really sure how to fix the problem. The code is below and thanks in advance.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport pyodbc\n\ncnxn = pyodbc.connect('DRIVER={SQL Server};SERVER=DESKTOP- \nFCDHA0J\\SQLEXPRESS;DATABASE=Data')\n\ncursor = cnxn.cursor()\n\ncursor.execute(\"select matchid from matchinfo where matchid \u0026gt; 1 order by dato asc\")\n\nMatchinfo = cursor.fetchall()\n\n\nfor Matchid in Matchinfo:\n\n print(Matchinfo[0])\n\n cursor.execute(\"select * from matchinfo WHERE matchid = '%i'\" % Matchid)\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"45381935","answer_count":"1","comment_count":"0","creation_date":"2017-07-28 20:12:40.5 UTC","last_activity_date":"2017-07-28 23:39:15.167 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"8383850","post_type_id":"1","score":"1","tags":"python","view_count":"34"} +{"id":"25204127","title":"Is it possible to create a multiplot of data and images with ggplot?","body":"\u003cp\u003eI would like to know if it is possible with ggplot2 to create a multiple plot (like a facet) including images to look like that:\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/3anUH.png\" alt=\"What I would like\"\u003e\u003c/p\u003e\n\n\u003cp\u003eI don't know exactly how to arrange the image data to pass them to \u003ccode\u003egeom_raster()\u003c/code\u003e or how to include an image in a data frame...\u003c/p\u003e\n\n\u003cp\u003ewhat I have tried:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026gt; img1 \u0026lt;- readPNG('1.png')\n\u0026gt; img2 \u0026lt;- readPNG('2.png')\n\u0026gt; img3 \u0026lt;- readPNG('3.png')\n\n\u0026gt; test \u0026lt;- data.frame(c(1,2,3),c(5,2,7),c(img1,img2,img3))\n\u0026gt; nrow(test)\n [1] 4343040\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI already have a problem here to build a data frame with the images inside... each 3 lines a repeated (I guess once per pixel). \u003c/p\u003e","accepted_answer_id":"25246674","answer_count":"3","comment_count":"2","creation_date":"2014-08-08 12:59:31.52 UTC","last_activity_date":"2014-08-12 02:17:35.067 UTC","last_edit_date":"2014-08-08 14:12:15.437 UTC","last_editor_display_name":"","last_editor_user_id":"841120","owner_display_name":"","owner_user_id":"841120","post_type_id":"1","score":"5","tags":"r|ggplot2","view_count":"1038"} +{"id":"23266315","title":"Concurrent Modification Exception in publishResults","body":"\u003cp\u003eI'm implementing Filter in my Custom Adapter but I got CME when I press the search icon in action bar. I do some research and edit my code but no effect.\u003c/p\u003e\n\n\u003cp\u003eMy code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate class TaskFilter extends Filter {\n\n @Override\n protected FilterResults performFiltering(CharSequence constraint) {\n\n constraint = constraint.toString().toLowerCase();\n FilterResults result = new FilterResults();\n if (constraint != null \u0026amp;\u0026amp; constraint.toString().length() \u0026gt; 0) {\n ArrayList\u0026lt;TaskModel\u0026gt; filteredItems = new ArrayList\u0026lt;TaskModel\u0026gt;();\n\n for (int i = 0, l = originalList.size(); i \u0026lt; l; i++) {\n TaskModel country = originalList.get(i);\n if (country.getName().toString().toLowerCase().contains(constraint))\n filteredItems.add(country);\n }\n result.count = filteredItems.size();\n result.values = filteredItems;\n } else {\n synchronized (this) {\n result.values = originalList;\n result.count = originalList.size();\n }\n }\n return result;\n }\n\n @Override\n protected void publishResults(CharSequence constraint,\n FilterResults results) {\n clear();\n List\u0026lt;TaskModel\u0026gt; listcopy = (List\u0026lt;TaskModel\u0026gt;) results.values;\n synchronized (listcopy) {\n for (Iterator\u0026lt;TaskModel\u0026gt; it = listcopy.iterator(); it.hasNext(); ) { \n TaskModel f = (TaskModel) it.next(); //this one cause the CME\n add(f);\n } \n }\n notifyDataSetChanged();\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat can I do?\u003c/p\u003e","answer_count":"0","comment_count":"6","creation_date":"2014-04-24 10:29:10.57 UTC","favorite_count":"1","last_activity_date":"2014-04-24 10:29:10.57 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1616392","post_type_id":"1","score":"0","tags":"android|concurrentmodification","view_count":"263"} +{"id":"6882940","title":"jQuery CrossDomain iframe Mousemove function","body":"\u003cp\u003eI'm working on project where I'm embedding vimeo videos FULLSCREEN using code :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;iframe id=\"iframe\" src=\"http://player.vimeo.com/video/...../..\" width=\"100%\" height=\"100%\" frameborder=\"0\"\u0026gt;\u0026lt;/iframe\u0026gt; \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm using Mousemove function on parent page to show company logo on Mousemove like this :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e $(document).ready(function() {\n var $top = $('#logo');\n var $document = $(document);\n var timer = null;\n var timerIsRunning = false;\n\n $top.hide();\n\n $document.mousemove(function(e){\n e.stopPropagation();\n });\n setTimeout(function() {\n $document.mousemove(function(e) {\n if($top.is(':hidden')) {\n $top.fadeIn(2000);\n } else {\n if(!timerIsRunning) {\n timerIsRunning = true;\n clearTimeout(timer);\n timer = setTimeout(function() { $top.fadeOut(); }, 15000);\n setTimeout(function() {timerIsRunning = true;}, 15000);\n }\n }\n });\n }, 2000);\n\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy issue is browser doesn't detect Mousemove function over embedded fullscreen video \u0026amp; that is why Logo div doesn't appear...\u003c/p\u003e\n\n\u003cp\u003eUsing CSS \u003ccode\u003epointer-events: none;\u003c/code\u003e It works but disabled Video Player Control.\u003c/p\u003e\n\n\u003cp\u003eIs there any Solution ?\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2011-07-30 11:55:03.733 UTC","last_activity_date":"2012-05-30 09:53:29.377 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"369411","post_type_id":"1","score":"0","tags":"jquery|iframe|vimeo|mousemove","view_count":"1456"} +{"id":"21830187","title":"Wiring up Knockout with SignalR (Object doesn't support property or method)","body":"\u003cp\u003eI'm getting the following js error (on the line of code marked ###) when starting my app:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eJavaScript runtime error: Object doesn't support property or method 'messages'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI've previously had this working without knockout, but am trying to add in knockout as I feel this will be easier to maintain in the long run. I suspect that as this is my first venture into both SignalR and Knockout, I've done something blindingly stupid, so any pointers please let me know. The mappedMessages data is fully populated, it's just when it tries to set self.messages it has the issue. Knockout 3.0.0, SignalR 1.1.3.\u003c/p\u003e\n\n\u003cp\u003eThe full javascript code is below:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(function () {\n\n var messageHub = $.connection.messageHubMini;\n\n function init() { }\n\n\n function Message(data) {\n this.Operator = ko.observable(data.Operator);\n this.text = ko.observable(data.Text);\n }\n\n function MessagesViewModel() {\n // Data\n var self = this;\n self.messages = ko.observableArray([]); //### message on this line\n }\n\n // Add a client-side hub method that the server will call\n messageHub.client.updateMessages = function (data) {\n\n var mappedMessages = $.map(data, function (item) { return new Message(item) });\n self.messages(mappedMessages);\n }\n\n // Start the connection\n $.connection.hub.start().done(init);\n\n ko.applyBindings(new MessagesViewModel());\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks :)\u003c/p\u003e","accepted_answer_id":"21831075","answer_count":"1","comment_count":"0","creation_date":"2014-02-17 13:19:57.967 UTC","last_activity_date":"2014-02-17 14:53:51.737 UTC","last_edit_date":"2014-02-17 13:35:56.09 UTC","last_editor_display_name":"","last_editor_user_id":"786103","owner_display_name":"","owner_user_id":"786103","post_type_id":"1","score":"0","tags":"javascript|knockout.js|signalr|signalr-hub","view_count":"570"} +{"id":"36160156","title":"SWRevealViewController toggle not working with custom Navigation Bar Button","body":"\u003cp\u003eI am using SWRevealViewController to show a side menu in Swift 2.0 I have downloaded the files from GitHub, created the bridging header and connected segues correctly. I am creating a custom button but the action \"reveal toggle\" is not firing. Where am I making a mistake?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esuper.viewDidLoad()\n self.navigationController?.navigationBar.topItem?.title = \"DASHBOARD\"\n self.navigationController!.navigationBar.tintColor = UIColor.whiteColor()\n self.navigationController!.navigationBar.titleTextAttributes =\n [NSForegroundColorAttributeName: UIColor.whiteColor()]\n self.navigationController!.navigationBar.titleTextAttributes = [ NSFontAttributeName: UIFont(name: \"Teko-Regular\", size: 26)!]\n self.navigationController?.navigationBar.barTintColor = UIColor.redColor()\n let btnName = UIButton()\n btnName.setImage(UIImage(named: \"LeftNavItem\"), forState: .Normal)\n btnName.frame = CGRectMake(0, 0, 20, 20)\n\n let leftBarButton = UIBarButtonItem()\n leftBarButton.customView = btnName\n self.navigationItem.leftBarButtonItem = leftBarButton\n if self.revealViewController() != nil {\n //print(self.revealViewController())\n leftBarButton.target = self.revealViewController()\n leftBarButton.action = Selector(\"revealToggle:\")\n\n self.view.addGestureRecognizer(self.revealViewController().panGestureRecognizer())\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe gesture recognizer is firing properly, but not the \"revealToggle:\" What's the mistake? \u003c/p\u003e","accepted_answer_id":"36160380","answer_count":"1","comment_count":"0","creation_date":"2016-03-22 16:35:59.263 UTC","last_activity_date":"2016-03-22 17:07:10.62 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4900697","post_type_id":"1","score":"0","tags":"ios|swift|swrevealviewcontroller","view_count":"886"} +{"id":"15395183","title":"Indy 9 - Email with body as RTF and with attachments","body":"\u003cp\u003eI'm trying to send a email with indy 9:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eBody as RTF, formatted from a TRichEdit\u003c/li\u003e\n\u003cli\u003eA single file attached\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003e\u003cstrong\u003eThe code:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Message := TIdMessage.Create()\n Message.Recipients.EMailAddresses := 'someone@domain.dotcom';\n\n Message.ContentType := 'multipart/alternative';\n\n with TIdText.Create(Message.MessageParts) do\n ContentType := 'text/plain';\n\n with TIdText.Create(Message.MessageParts) do\n begin\n ContentType := 'text/richtext';\n Body.LoadFromFile('c:\\bodymsg.rtf');\n end;\n\n TIdAttachment.Create(Message.MessageParts, 'c:\\myattachment.zip');\n\n // send...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eThe result\u003c/strong\u003e: body comes empty (using web gmail and outlook 2010 as clients).\u003c/p\u003e\n\n\u003cp\u003eI'm already tried other content types without success: \u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003etext/rtf \u003c/li\u003e\n\u003cli\u003etext/enriched\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003e\u003cstrong\u003eNOTE:\u003c/strong\u003e I'll not upgrade to Indy 10.\u003c/p\u003e","accepted_answer_id":"15397509","answer_count":"1","comment_count":"6","creation_date":"2013-03-13 19:55:23.367 UTC","favorite_count":"1","last_activity_date":"2013-03-13 22:18:29.273 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1470436","post_type_id":"1","score":"3","tags":"delphi|indy","view_count":"3542"} +{"id":"20967812","title":"How to insert into an existing temp table in SQL Server","body":"\u003cp\u003eI am trying to execute two select statements into a query that pumps data into a temp table. The first query will have 5 columns while the second query will have only one column.\u003c/p\u003e\n\n\u003cp\u003eThe first can be achieved by:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSelect a.ID AS [a], \n b.ID AS [b], \n c.ID AS [c]\nINTO #testingTemp\nFROM\n....\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow I have my second query trying to pump data into \u003ccode\u003e#testingTemp\u003c/code\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSelect z.ID AS [c]\nINTO #testingTemp\nFROM\n.... \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut my problem is \u003ccode\u003eThere is already an object named #testingTemp in the database\u003c/code\u003e?\u003c/p\u003e\n\n\u003cp\u003eI tried to search for a solution on the Internet but mostly people are only facing the problem at my first part but apparently nobody trying to expand a temp table on second query?\u003c/p\u003e","accepted_answer_id":"20967888","answer_count":"3","comment_count":"2","creation_date":"2014-01-07 09:18:26.913 UTC","favorite_count":"2","last_activity_date":"2016-11-22 10:52:28.09 UTC","last_edit_date":"2016-11-22 10:52:28.09 UTC","last_editor_display_name":"","last_editor_user_id":"336648","owner_display_name":"","owner_user_id":"1460189","post_type_id":"1","score":"5","tags":"sql|sql-server|temp-tables","view_count":"32457"} +{"id":"10345302","title":"Regular Expression in Sql Server","body":"\u003cp\u003eI have special selection criterion for particular column and need the regular epxression for that.\ne.g: A123456, S008942\nthis id's should get selected only\nThe first letter is alphabet and next 6 letters are digits.\nIt will always be like total of 7 letters (1Alphabet+6NumericDigits)\u003c/p\u003e\n\n\u003cp\u003eAny help is appreciated.\nThanks\u003c/p\u003e","accepted_answer_id":"10345568","answer_count":"3","comment_count":"1","creation_date":"2012-04-27 05:38:48.563 UTC","last_activity_date":"2012-04-27 06:05:00.677 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1113150","post_type_id":"1","score":"2","tags":"c#|regex|sql-server-2008","view_count":"622"} +{"id":"29267707","title":"Database solution for chat app","body":"\u003cp\u003eI am building a chat app with swift.You know I need to store all messages in a database.But I am so confused right now.Because I found the core data but I am not sure it is good for this case.\u003c/p\u003e\n\n\u003cp\u003eI need to store all messages like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eid -\u0026gt; Primary key\nsender -\u0026gt; String\nreceiver -\u0026gt; String\nmessage -\u0026gt; String\ndate -\u0026gt; Integer\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs core data good for this case ? If it is not then which solution is good for this case ? \u003c/p\u003e\n\n\u003cp\u003ePs:If you have a question please ask me in the comments.\u003c/p\u003e","accepted_answer_id":"29267811","answer_count":"1","comment_count":"3","creation_date":"2015-03-25 22:25:48.887 UTC","last_activity_date":"2016-03-04 11:50:50.467 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4266906","post_type_id":"1","score":"0","tags":"ios|swift","view_count":"475"} +{"id":"24909257","title":"Pandas does not plot if label includes Turkish Characters like ş,ö,ü","body":"\u003cp\u003eMy problem, I can't plot when label include turkish characters like ş,ö,ü,İ,Ğ,ğ \u003c/p\u003e\n\n\u003cp\u003eit just gives this output --\u003e matplotlib.figure.Figure at 0x7f8499386050 not show the graph\u003c/p\u003e\n\n\u003cp\u003eHow can I fix it?\u003c/p\u003e\n\n\u003cp\u003ehere is my code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef draw_pie(year,y,by):\n\n v=data[data['yil']==year]\n\n v=v.sort(y,ascending=False).head(20)\n\n v=v.groupby(by).aggregate('sum')\n\n veri= v[ y ]\n\n veri.plot(figsize=(10,10),kind='pie', labels=v.index,\n autopct='%.2f', fontsize=20)\n plt.show()\n\n draw_pie(2014,'toplam_hasilat','tur')\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003edon't show beacuse tur contains 'Aşk' , 'Gençlik' \u003c/p\u003e\n\n\u003cp\u003eit is okay without turkish characters.\u003c/p\u003e\n\n\u003cp\u003eThank you in advance\u003c/p\u003e","accepted_answer_id":"24909831","answer_count":"2","comment_count":"0","creation_date":"2014-07-23 11:27:54.507 UTC","last_activity_date":"2016-07-17 13:23:45.243 UTC","last_edit_date":"2014-07-23 12:25:49.913 UTC","last_editor_display_name":"","last_editor_user_id":"3297428","owner_display_name":"","owner_user_id":"3793185","post_type_id":"1","score":"0","tags":"matplotlib|pandas","view_count":"189"} +{"id":"17879846","title":"Bootstrap scrollspy offset on a fixed navbar does not work","body":"\u003cp\u003eI have created and exact fiddle of my problem here for testing: \u003ca href=\"http://jsfiddle.net/aVBUy/7/\"\u003ehttp://jsfiddle.net/aVBUy/7/\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThe issue is, when I click on navbar items, I have a script which scrolls to the element id. And I am using scrollspy to highlight the nav elements when page is in correct position. However the scrollspy is only changing the active state when it hits the top of the browser/device. Because my navbar is fixed I need an offset applied to scrollspy to offset by 51px (navbar height).\u003c/p\u003e\n\n\u003cp\u003eI've tried everything and I can't get it to work. Please check my fiddle and see if you can find the where I'm going wrong, would help me so much.\u003c/p\u003e\n\n\u003cp\u003eHere's my minimised code...\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eHTML\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"navbar navbar-inverse navbar-fixed-top\"\u0026gt;\n \u0026lt;div class=\"navbar-inner\"\u0026gt;\n \u0026lt;div class=\"container\"\u0026gt;\n \u0026lt;a class=\"btn btn-navbar\" data-toggle=\"collapse\" data-target=\".nav-collapse\"\u0026gt;\n \u0026lt;span class=\"icon-bar\"\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;span class=\"icon-bar\"\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;span class=\"icon-bar\"\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;/a\u0026gt;\n \u0026lt;a class=\"brand\" href=\"#\"\u0026gt;\u0026lt;img src=\"img/logo.gif\" alt=\"\" /\u0026gt;\u0026lt;/a\u0026gt;\n \u0026lt;div class=\"nav-collapse collapse\"\u0026gt;\n \u0026lt;ul class=\"nav\"\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#welcome\" data-scroll=\"#welcome\"\u0026gt;Welcome\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#about\" data-scroll=\"#about\"\u0026gt;About\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#route\" data-scroll=\"#route\"\u0026gt;The Route\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#bike\" data-scroll=\"#bike\"\u0026gt;The Bike\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u0026lt;div class=\"container\"\u0026gt;\n \u0026lt;div id=\"welcome\" class=\"row-fluid\"\u0026gt;\n \u0026lt;div class=\"span12\"\u0026gt;\n \u0026lt;h3\u0026gt;Welcome\u0026lt;/h3\u0026gt;\n ...\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;hr /\u0026gt;\n \u0026lt;div id=\"about\" class=\"row-fluid\"\u0026gt;\n \u0026lt;div class=\"span12\"\u0026gt;\n \u0026lt;h3\u0026gt;About the ride\u0026lt;/h3\u0026gt;\n ...\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;hr /\u0026gt;\n \u0026lt;div id=\"route\" class=\"row-fluid\"\u0026gt;\n \u0026lt;div class=\"span12\"\u0026gt;\n \u0026lt;h3\u0026gt;The Route\u0026lt;/h3\u0026gt;\n ...\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;hr /\u0026gt;\n \u0026lt;div id=\"bike\" class=\"row-fluid\"\u0026gt;\n \u0026lt;div class=\"span12\"\u0026gt;\n \u0026lt;h3\u0026gt;The Bike\u0026lt;/h3\u0026gt;\n ...\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;hr\u0026gt;\n \u0026lt;footer\u0026gt;\n \u0026lt;p class=\"muted\"\u0026gt;\u0026lt;small\u0026gt;© 2013 All rights reserved.\u0026lt;/small\u0026gt;\u0026lt;/p\u0026gt;\n \u0026lt;/footer\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eCSS\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ebody {\n padding: 51px 0 0;\n}\n/* Override Bootstrap Responsive CSS fixed navbar */\n @media (max-width: 979px) {\n .navbar-fixed-top, .navbar-fixed-bottom {\n position: fixed;\n margin-left: 0px;\n margin-right: 0px;\n }\n}\nbody \u0026gt; .container {\n padding: 0 15px;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eSCRIPT\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar offsetHeight = 51;\n\n$('.nav-collapse').scrollspy({\n offset: offsetHeight\n});\n\n$('.navbar li a').click(function (event) {\n var scrollPos = $('body \u0026gt; .container').find($(this).attr('href')).offset().top - offsetHeight;\n $('body,html').animate({\n scrollTop: scrollPos\n }, 500, function () {\n $(\".btn-navbar\").click();\n });\n return false;\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eFIDDLE\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://jsfiddle.net/aVBUy/7/\"\u003ehttp://jsfiddle.net/aVBUy/7/\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"17885251","answer_count":"6","comment_count":"0","creation_date":"2013-07-26 11:11:49.47 UTC","favorite_count":"4","last_activity_date":"2017-05-10 14:18:32.93 UTC","last_edit_date":"2015-12-14 16:11:05.47 UTC","last_editor_display_name":"","last_editor_user_id":"4278038","owner_display_name":"","owner_user_id":"801773","post_type_id":"1","score":"15","tags":"jquery|twitter-bootstrap|jsfiddle|scrollspy","view_count":"39536"} +{"id":"40543800","title":"SyntaxError: missing ; before statement on JSONResponse","body":"\u003cp\u003eI am getting this kind of error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSyntaxError: missing ; before statement\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI don't know what causes the error but I have this code here:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e(function pollschedule(){\n $.ajax({type: \"GET\",\n dataType: \"jsonp\",\n contentType: \"application/json\",\n url: \"http://127.0.0.1:8080/get/schedule/1/\",\n success: function(data){\n console.log(data);\n }, \n complete: pollschedule, timeout: 5000});\n})();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn case you might need to see what \u003ca href=\"http://127.0.0.1:8080/get/schedule/1/\" rel=\"nofollow noreferrer\"\u003ehttp://127.0.0.1:8080/get/schedule/1/\u003c/a\u003e is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef get_schedule(request, sid):\n schedule = Schedule.objects.filter(id=sid, date=datetime.datetime.now()).values('id', 'sched__name', 'date', 'time')\n sched_collection = collections.defaultdict(list)\n for i in schedule:\n sched_collection[i['sched__name']].append(i)\n\n return JsonResponse({\"schedule\" : dict(sched_collection)})\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd returns this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\"schedule\": {\"CWW\": [{\"date\": \"2016-11-11\", \"time\": \"17:10:10\"}]}}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe error points the semi-colon after \"schedule\" in the response.\u003c/p\u003e","accepted_answer_id":"40543852","answer_count":"1","comment_count":"0","creation_date":"2016-11-11 08:17:43.42 UTC","last_activity_date":"2016-11-11 08:20:47.26 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6795411","post_type_id":"1","score":"1","tags":"jquery|python|json|ajax|django","view_count":"102"} +{"id":"18814434","title":"Can I create a ranked dict by iterating over an existing dict?","body":"\u003cp\u003eI've been searching for the answer to this for a while, but no joy.\u003c/p\u003e\n\n\u003cp\u003eI have a dict containing hotel names and prices.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emydict = {'HotelA': 100, 'HotelB': 300, 'HotelC': 200}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI would simply like to iterate over the dict and return a separate dict whose values rank the keys based on lowest to highest values, eg:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emynewdict = {'HotelA': 1, 'HotelB': 3, 'HotelC': 2}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am aware of how to use \u003ccode\u003esorted\u003c/code\u003e to iterate over a dictionary and provide an ordered list, but am unsure as to the best way to handle the above. All help greatly appreciated.\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2013-09-15 16:02:34.107 UTC","last_activity_date":"2013-09-16 15:23:06.373 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2781522","post_type_id":"1","score":"0","tags":"python-2.7|dictionary|ranking","view_count":"35"} +{"id":"43417697","title":"Round cells then auto fill VBA","body":"\u003cp\u003eIn cell AR8, I am looking for a macro that will insert this equation \" =ROUND(IF(AP8\u003e(AN8*P8),AP8,AN8*P8),2) \" then auto fill it down the column for the next 800-1000 rows below.\u003c/p\u003e","accepted_answer_id":"43419269","answer_count":"1","comment_count":"7","creation_date":"2017-04-14 19:05:14.57 UTC","last_activity_date":"2017-04-14 21:15:44.75 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7858661","post_type_id":"1","score":"-9","tags":"excel|vba|excel-vba|excel-formula","view_count":"54"} +{"id":"12763339","title":"UITextField to sms recipents","body":"\u003cp\u003eI have a UITextField that the user will enter a cell phone number.The user touches a IBAction button and it is passed to the MFMessageComposeViewController sms recipients.it seems that the recipients will not alow a NSString to be used.Passing a NSString to the body works but not the recipients.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e-(IBAction)buttonSMS: (id)sender\n{\n if([MFMessageComposeViewController canSendText])\n {\n\n MFMessageComposeViewController *picker = [[MFMessageComposeViewController alloc] init];\n\n picker.recipients=[NSArray arrayWithObjects:@\"15557774444\", nil];\n picker.body = textField.text;\n picker.messageComposeDelegate = self;\n [self presentViewController:picker animated:YES completion:NULL];\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethis is what i tried\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epicker.recipients = telField.text;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ein place of\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epicker.recipients=[NSArray arrayWithObjects:@\"15557774444\", nil];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCan some one point me in the rite direction with some sample code.....please and thankyou\u003c/p\u003e\n\n\u003cp\u003eExpert in all things html,javascript and css but newbee in objective c\u003c/p\u003e","accepted_answer_id":"12763371","answer_count":"1","comment_count":"0","creation_date":"2012-10-06 19:58:17.73 UTC","last_activity_date":"2012-10-06 21:06:24.537 UTC","last_edit_date":"2012-10-06 21:06:24.537 UTC","last_editor_display_name":"","last_editor_user_id":"265530","owner_display_name":"","owner_user_id":"1725650","post_type_id":"1","score":"0","tags":"objective-c|ios|sms|uitextfield","view_count":"85"} +{"id":"26507585","title":"How to remove a nested div in HTML via child selector","body":"\u003cp\u003ehow can I select and remove the div shown in the picture with a red frame:\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/WatrN.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eI dont get any jQuery selection correctly, in my opinion I need to find div with title = Heatmap, then navigate two divs up and delete the whole div - is this possible ?? \nThanks !\u003c/p\u003e","accepted_answer_id":"26507623","answer_count":"1","comment_count":"5","creation_date":"2014-10-22 12:35:10.273 UTC","last_activity_date":"2014-10-23 14:24:44.443 UTC","last_edit_date":"2014-10-23 14:24:44.443 UTC","last_editor_display_name":"","last_editor_user_id":"909388","owner_display_name":"","owner_user_id":"909388","post_type_id":"1","score":"0","tags":"jquery|html|jquery-selectors|parent|removechild","view_count":"911"} +{"id":"46400339","title":"Bug with kendo grid,for closing pop up editor,you need to press cancel many times","body":"\u003cp\u003eits over a week im dealing with a strange behavior of kendo grid ,let me split my problem, for better understanding ,i have a autocomplete text box ,after I press ENTER,it binds my grid,when I press \"add new record\" on my kendo grid,if I press cancel,the pop up will be closed,BUTTT after second search and the add new record,if press cancel,this time needs 2times pressing,3d time needs 3times pressing.......made me crazy,badly need your help\u003c/p\u003e\n\n\u003cp\u003eHere is the code\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e $(document).keypress(function (e) {\n\n var myResult;\n var modelProducerResult;\n var temp = null;\n var mydata;\n var mydata_deviceType;\n var modelProducerDrpList;\n if (e.which == 13) {\n var i = 0;\n debugger;\n var flag = 0;\n // $('#turbingrid').data().kendoGrid.refresh();\n var drp = document.getElementById('autocomplete').value;\n $.ajax({\n dataType: \"json\",\n type: \"POST\",\n url: \"@Url.Action(\"turbineDeviceDetail\",\"AdminTool\")\",\n contentType: \"application/json; charset=utf-8\",\n data: JSON.stringify({ \"turbine\": drp, }),\n\n success: function (result) {\n //debugger;\n myResult = result;\n var flg = \"s\";\n $.ajax({\n dataType: \"json\",\n type: \"POST\",\n url: \"@Url.Action(\"producersDevice\",\"AdminTool\")\",\n contentType: \"application/json; charset=utf-8\",\n data: JSON.stringify({ \"flg\": flg, }),\n success: function (data) {\n // debugger;\n mydata = data;\n }\n })\n\n var flg_dvType = \"s\";\n $.ajax({\n dataType: \"json\",\n type: \"POST\",\n url: \"@Url.Action(\"deviceTypeList\",\"AdminTool\")\",\n contentType: \"application/json; charset=utf-8\",\n data: JSON.stringify({ \"flg\": flg_dvType, }),\n success: function (data) {\n // debugger;\n mydata_deviceType = data;\n\n }\n\n });\n\n dataSource = new kendo.data.DataSource({\n transport: {\n read: function (options) {\n options.success(result); // where data is the local data array\n\n },\n\n create: function (options) {\n\n\n if ($(\"input[name='DeviceIP']\").val() == \"\" || $(\"input[name='TurbineId']\").val() == \"\") {\n alert(\"DeviceIP and TurbineID could not be blank \");\n $(\"input[name='DeviceIP']\").css(\"background-color\", \"red\");\n $(\"input[name='TurbineId']\").css(\"background-color\", \"red\");\n\n }\n else\n\n\n $.ajax({\n type: \"POST\",\n url: \"@Url.Action(\"AddDeviceToTurbine\",\"AdminTool\")\",\n data: options.data.models[0],\n dataType: \"json\",\n success: function (data) {\n options.success(data);\n alert(\"New Device Has Been Inserted\");\n //var e = $.Event(\"keypress\", { which: 13 });\n //$('#autocomplete').trigger(e);\n\n\n },\n //error: function (data) {\n // options.error(data);\n // alert(\"Insert New Data Has Been Failed\");\n // alert(data);\n\n //},\n error: function (xhr, status, error) {\n alert(xhr.responseText);\n\n }\n });\n\n },\n update: function (options) {\n\n if ($(\"input[name='DeviceIP']\").val() == \"\" || $(\"input[name='TurbineId']\").val() == \"\") {\n alert(\"DeviceIP and TurbineID could not be blank \");\n\n $(\"input[name='DeviceIP']\").css(\"background-color\", \"red\");\n $(\"input[name='TurbineId']\").css(\"background-color\", \"red\");\n }\n else\n $.ajax({\n type: \"POST\",\n url: \"@Url.Action( \"update_grid\",\"AdminTool\")\",\n data: options.data.models[0],\n dataType: \"json\",\n success: function (data) {\n options.success(data);\n alert(\"Update Has Been Done!\");\n var value = document.getElementById('autocomplete').value;\n var e = $.Event(\"keypress\", { which: 13 });\n $('#autocomplete').trigger(e);\n\n },\n error: function (data) {\n options.error(data);\n alert(\"Update Failed!\");\n },\n });\n\n\n },\n\n parameterMap: function (options, operation) {\n if (operation !== \"read\" \u0026amp;\u0026amp; options.models) {\n return { models: kendo.stringify(options.models) };\n }\n }\n },\n batch: true,\n pageSize: 40,\n schema: {\n //data: employee,\n model: {\n id: \"DeviceIP\",\n fields: {\n DeviceIP: { editable: true, nullable: false },\n //Producer: { type:\"string\" },\n //3 Model: { type: \"string\" },\n DeviceType: { type: \"string\" },\n Description: { type: \"string\" },\n Username: { type: \"string\" },\n Password: { type: \"string\" },\n PublicIP: { type: \"string\" },\n ModelProducer: { type: \"string\" },\n Model: { type: \"string\" },\n Producer: { type: \"string\" },\n TurbineId: { type: \"string\" }\n //UnitPrice: { type: \"number\", validation: { required: true, min: 1} },\n //Discontinued: { type: \"boolean\" },\n //UnitsInStock: { type: \"number\", validation: { min: 0, required: true } }\n }\n }\n }\n\n\n });\n\n $(\"#turbingrid\").kendoGrid({\n // debugger;\n\n dataSource: dataSource,\n scrollable: false,\n\n //toolbar: [\"create\"],\n toolbar: [\n {\n name: \"create\",\n text: \"ADD NEW DEVICE\"\n }\n ],\n\n columns: [\n { field: 'DeviceIP', title: 'DeviceIP', width: '100px', id: 'DeviceIP' },\n { field: 'Producer', title: 'Producer', width: '80px', id: 'Producer' },//editor: ProductNameDropDownEditor,\n { field: 'Model', title: 'Model', width: '220px', id: 'Model' },\n // { field: 'DeviceType', title: 'DeviceType', width: '100px', id: 'DeviceType', editor: deviceTypesList },\n { field: 'Description', title: 'Description', width: '220px' },\n { field: 'Username', title: 'Username', width: '120px' },\n { field: 'Password', title: 'Password', width: '100px' },\n { field: 'PublicIP', title: 'PublicIP', width: '120px', id: 'PublicIP' },\n { field: 'TurbineId', title: 'TurbineId', width: '120px', id: 'TurbineId', hidden: true },\n { field: 'device_id', title: 'device_id', width: '120px', id: 'deviceid', hidden: true },\n // { field: 'ModelProducer', title: 'Producer/Model', id: 'ModelProducer', hidden: true, editor: modelPro },\n {\n command: [\"edit\"], title: \"\u0026amp;nbsp;\"\n\n }\n ],\n\n\n\n\n editable: \"popup\",\n\n });\n }\n })\n }\n });\n\n\n //This Part Is For The AUTOCOMPLETE textbox\n\n $(document).ready(function () {\n var value = document.getElementById('autocomplete').value;\n $.ajax({\n dataType: \"json\",\n type: \"POST\",\n url: \"@Url.Action(\"List_Turbine\",\"AdminTool\")\",\n contentType: \"application/json; charset=utf-8\",\n //data: JSON.stringify({ \"name\": value ,}),\n data: {},\n success: function (result) {\n $(\"#autocomplete\").kendoAutoComplete({\n dataSource: result,\n dataTextField: \"Text\",\n\n\n // filter: \"contains\"\n\n });\n\n\n }\n })\n\n });\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"11","creation_date":"2017-09-25 08:07:22.853 UTC","last_activity_date":"2017-09-25 08:07:22.853 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"8643848","post_type_id":"1","score":"0","tags":"javascript|jquery|kendo-ui|kendo-grid","view_count":"22"} +{"id":"47502406","title":"Singleton in enum performance","body":"\u003cp\u003eI was wondering about singleton in enum and it's performance.\u003c/p\u003e\n\n\u003cp\u003eWhen we have multithreaded environment we have to synchronize moment, when an instance is created.\u003c/p\u003e\n\n\u003cp\u003eSimply, we can use synchronized mod, for function called getInstance() which create instance\nSomethink like that:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic synchronized Singleton getInstance(){\n if(instance == null){\n instance = new Singleton();\n }\n return instance;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt's lazy implementation it's good for me. But synchronized method is slow.\nWe can use double-locking to make it faster.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eHow about enum?\u003c/strong\u003e\nWhen we implement singleton as enum, instance of singleton will be created as first use. Next use, return current instance.\u003c/p\u003e\n\n\u003cp\u003eHow it works?\nWhen we want to get existing instance, there is implicit synchronized method which are slow? Or there is Double-lock implemented?\u003c/p\u003e","answer_count":"3","comment_count":"0","creation_date":"2017-11-27 00:13:30.47 UTC","last_activity_date":"2017-11-27 12:34:39.523 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3900951","post_type_id":"1","score":"3","tags":"java|multithreading|enums","view_count":"63"} +{"id":"21342403","title":"Determining matrix dimensions","body":"\u003cp\u003eWhile previously attempting to ascertain the dimensions of a matrix, I have used the \u003ccode\u003ecore.matrix\u003c/code\u003e function shape. This function has done exactly what I have asked. I input one nested vector into the function and output the dimension. However, I am looking to input multiple matrices/nested vectors into the function and am running into trouble. Is the shape function capable of handling multiple inputs, or is there another way to determine the dimensions of multiple nested vectors?\u003c/p\u003e\n\n\u003cp\u003eAn example input would look like: [[1 1] [1 1]] [[2 2 2] [2 2 2]]\u003c/p\u003e\n\n\u003cp\u003ethe expected output would be: [2 2] for first matrix and [3 3] for second matrix, as both inputs are square matrices. \u003c/p\u003e","accepted_answer_id":"21342772","answer_count":"1","comment_count":"0","creation_date":"2014-01-24 21:01:04.12 UTC","last_activity_date":"2014-01-24 21:26:41.11 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2869208","post_type_id":"1","score":"2","tags":"clojure|clojure-contrib","view_count":"65"} +{"id":"42152710","title":"How to fix the first row in jquery datatable?","body":"\u003cp\u003eI want to provide a dropdown list to my DataTable on first row by following this page: \u003ca href=\"https://datatables.net/examples/api/multi_filter_select.html\" rel=\"nofollow noreferrer\"\u003ejQuery DataTable\u003c/a\u003e. However, I don't want this row being sortable which the whole row will stay on the top of the tbody.\u003c/p\u003e\n\n\u003cp\u003eSo how to set this row will not be sortable? \u003c/p\u003e\n\n\u003cpre class=\"lang-js prettyprint-override\"\u003e\u003ccode\u003e$('.tables').dataTable({\n \"columnDefs\": [{\n \"targets\": 4,\n \"orderable\": false\n }],\n \"order\": [\n [9, \"desc\"]\n ],\n 'initComplete': function() {\n this.api().columns().every(function() {\n var column = this;\n console.log(column);\n var header = column.header();\n if (header.innerText != \"myKeyword\") {\n console.log(column.header());\n var select = $('\u0026lt;select\u0026gt;' +\n '\u0026lt;option value=\"All\"\u0026gt;All\u0026lt;/option\u0026gt;' +\n '\u0026lt;/select\u0026gt;')\n .appendTo($(column.header()))\n .on('change', function() {\n var val = $.fn.dataTable.util.escapeRegex(\n $(this).val()\n\n );\n\n if (val == 'All')\n val = '';\n column\n .search(val ? '^' + val + '$' : '', true, false)\n .draw();\n });\n\n column.data().unique().sort().each(function(d, j) {\n\n select.append('\u0026lt;option value=\"' + d + '\"\u0026gt;' + d + '\u0026lt;/option\u0026gt;')\n });\n\n }\n\n });\n }\n});\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"2","creation_date":"2017-02-10 06:17:44.35 UTC","last_activity_date":"2017-02-26 20:07:21.89 UTC","last_edit_date":"2017-02-26 20:07:21.89 UTC","last_editor_display_name":"","last_editor_user_id":"13302","owner_display_name":"","owner_user_id":"7155607","post_type_id":"1","score":"0","tags":"javascript|jquery|datatables","view_count":"365"} +{"id":"10078181","title":"Competing-Consumers Messaging Pattern in Azure Service Bus","body":"\u003cp\u003eI'm just getting started with Windows Azure Service Bus (\u003cem\u003eTopics \u0026amp; Queues\u003c/em\u003e) and I'm trying to implement a Competing-Consumers messaging pattern.\u003c/p\u003e\n\n\u003cp\u003eEssentially, I want to have a set of message \u003cstrong\u003eProducers\u003c/strong\u003e and a set of message \u003cstrong\u003eConsumers\u003c/strong\u003e. Once a message is produced, I want the first available Consumer to process the message. No other Consumers should get the message. \u003c/p\u003e\n\n\u003cp\u003eIs there a way to do this in Azure?\u003c/p\u003e","accepted_answer_id":"10079560","answer_count":"3","comment_count":"2","creation_date":"2012-04-09 18:53:45.523 UTC","last_activity_date":"2012-05-11 19:38:43.607 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"308665","post_type_id":"1","score":"2","tags":"azure|azureservicebus","view_count":"1247"} +{"id":"35856406","title":"C# Asynchronous Function Threading","body":"\u003ch1\u003eTests\u003c/h1\u003e\n\n\u003cp\u003eI have a function f1(string, string) which takes 4 seconds to execute (irrelevant what it does). Tested this by calling f1(\"a\", \"b\") in main.\u003c/p\u003e\n\n\u003cp\u003eCalling \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eConsole.WriteLine(f1(\"a\", \"b\")); \nConsole.WriteLine(f1(\"a\", \"b\")); \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewill wait 4 seconds for the first function to finish, prompt the return, wait another 4 seconds, prompt the second result all fine and dandy.\u003c/p\u003e\n\n\u003cp\u003eI've tried doing this in parallel by creating two separate anonymous threads with lambda like so:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enew Thread(() =\u0026gt; {Console.WriteLine(f1(\"a\", \"b\")); }).Start();\nnew Thread(() =\u0026gt; {Console.WriteLine(f1(\"a\", \"b\")); }).Start();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSince I have a dual core processor and the functions are processing heavy (OS balanced this out very well) I have gotten both prompts after 4 seconds (instead of 8) so I know it worked in parallel. \u003c/p\u003e\n\n\u003ch1\u003eQuestion\u003c/h1\u003e\n\n\u003cp\u003eHow can I write a function f1Async(string, string) which would initially call f1(string, string) albeit on a different thread every time (like I've done manually in main)? In order to know what the output of f1Async will be I have to wait for the thread to finish thus calling f1Async() two times in a row will result in the function waiting for one thread to finish before moving on to the second call.\u003c/p\u003e","accepted_answer_id":"35856608","answer_count":"1","comment_count":"2","creation_date":"2016-03-07 23:47:42.357 UTC","last_activity_date":"2016-03-08 00:21:51.543 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2382272","post_type_id":"1","score":"0","tags":"c#|multithreading","view_count":"46"} +{"id":"26201613","title":"Stop Angular from listing all from database?","body":"\u003cp\u003eI have a simple Angular Script which works like ajax to return search results, but when I don't type anything into the search box, it lists all of the data in the data base, how do I stop this?\u003c/p\u003e\n\n\u003cp\u003eMy script is here: \u003ca href=\"http://www.elliottcoe.com/search/search.js\" rel=\"nofollow\"\u003ehttp://www.elliottcoe.com/search/search.js\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"26201738","answer_count":"2","comment_count":"0","creation_date":"2014-10-05 10:11:02.173 UTC","last_activity_date":"2014-10-05 11:00:38.033 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2543495","post_type_id":"1","score":"1","tags":"database|angularjs","view_count":"38"} +{"id":"35718406","title":"Docker \\ commit a container with its data","body":"\u003cp\u003elots of documentation, but I still missing something. My Goal is to run one-time registry (2.0) push to it couple of images and export\\commit the container.\nI need to take it in zip file to machine without internet.\u003c/p\u003e\n\n\u003cp\u003eThing is - the images I pushed to registry aren't kept. whenever I import the regsitry to test - it comes empty. I understand that commit\\export will not work on mounted volumes - how do I \"disable\" the volumes of the initial registry docker?\u003c/p\u003e","accepted_answer_id":"35727366","answer_count":"1","comment_count":"0","creation_date":"2016-03-01 08:56:29.333 UTC","last_activity_date":"2016-03-01 15:51:21.44 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1025852","post_type_id":"1","score":"0","tags":"docker|docker-registry","view_count":"126"} +{"id":"10853666","title":"Get RowEditing or Grid from a RowEditing component (a combobox in this case)","body":"\u003cp\u003eI'm building a \"fix\" for combobox because it shows the value field instead of the display field in the textbox when you open the row editor. However, to do this I have to change the value of the combobox just before is sent to the server. To do this, my idea was to hook to beforeedit event of row editing plugin.\u003c/p\u003e\n\n\u003cp\u003eThe biggest problem, is that I can't find a way to reach the grid which I'm row editing, or directly the row editing plugin.\u003c/p\u003e\n\n\u003cp\u003eOnly thing I can find is the form where the combobox is in with \u003ccode\u003ecombobox.up('form')\u003c/code\u003e and I can hook to those events, but I think they don't happen \"early enough\". I can't find a way to obtain the rowediting plugin from the form however :\\\u003c/p\u003e\n\n\u003cp\u003eAny idea on how to solve this problem?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdit 1:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eAs sha requested, this is the problem shown as images:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://dl.dropbox.com/u/762638/Files/Images/Screenshots/show_combobox_extjs_problem/part_1.png\" rel=\"nofollow\"\u003ehttp://dl.dropbox.com/u/762638/Files/Images/Screenshots/show_combobox_extjs_problem/part_1.png\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://dl.dropbox.com/u/762638/Files/Images/Screenshots/show_combobox_extjs_problem/part_2.png\" rel=\"nofollow\"\u003ehttp://dl.dropbox.com/u/762638/Files/Images/Screenshots/show_combobox_extjs_problem/part_2.png\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://dl.dropbox.com/u/762638/Files/Images/Screenshots/show_combobox_extjs_problem/part_3.png\" rel=\"nofollow\"\u003ehttp://dl.dropbox.com/u/762638/Files/Images/Screenshots/show_combobox_extjs_problem/part_3.png\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eAnd here you can find the combobox code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eExt.define('Fdd.form.field.XComboBox', {\n extend: 'Ext.form.field.ComboBox',\n alias: 'widget.xcombobox',\n\n displayField: 'display',\n queryMode: 'local',\n valueField: 'value',\n //forceSelection: true,\n\n /**\n *\n * @property {Ext.form.Panel} parentForm\n * Contains a reference to the combobox form, used internally\n *\n * @readonly\n */\n parentForm: null,\n /**\n *\n * @property {Boolean} hasChanged\n * `true` if the combobox has changed its value since last show/hide cycle\n */\n hasChanged: false,\n\n statics: {\n xcomboboxRenderer: function(xcombobox) {\n return function(value, metaData, record, rowIndex) {\n if (value === null)\n return '';\n return xcombobox.store.getById(value.toString()).get('display');\n }\n }\n },\n\n initComponent: function() {\n var me = this;\n var xComboBoxStoreClass = 'Fdd.data.XComboBoxStore';\n var xComboBoxStoreKey = Ext.getClassName(me);\n\n // FIXME: Fix default value to be display and not value field\n // Create the combo store if not exists\n me.createComboStoreIfNotExists = function() {\n // If store is not set, we can't do anything\n if (!me.store)\n return false;\n\n // If the store is an array, we break the functionality and return to a normal combobox\n // because XComboBox is to avoid problems with stores\n if (Ext.isArray(me.store))\n return false;\n\n // We need the object for the parent store, to avoid missing references\n var parentStore = null;\n if (Ext.isString(me.store))\n parentStore = Ext.getStore(me.store)\n else\n parentStore = me.store;\n\n // If the store doesn't have the updatedAt variable, we don't enable functionalities\n // because that is a requirement\n if (!Ext.isDefined(parentStore.updatedAt))\n return false;\n\n // If parent store is of type XComboBoxStore, it means that we already have created a combo store\n if (Ext.getClassName(parentStore) == xComboBoxStoreClass)\n return false;\n\n var comboStore = Fdd.NamespaceKeyedStoreManager.lookup(xComboBoxStoreKey, parentStore.storeId);\n if (!comboStore) {\n comboStore = Ext.create(xComboBoxStoreClass, parentStore);\n Fdd.NamespaceKeyedStoreManager.register(xComboBoxStoreKey, parentStore.storeId, comboStore);\n }\n me.store = comboStore;\n\n //me.on('afterrender', function(obj, eOpts) {\n // obj.setValue(1);\n //});\n\n return comboStore;\n }\n\n // Load data if required\n me.loadUpdatedData = function() {\n me.createComboStoreIfNotExists();\n if (me.store)\n Fdd.NamespaceKeyedStoreManager.lookup(xComboBoxStoreKey, me.store.parentStore.storeId).loadIfNotUpdated();\n };\n\n // Load data if required\n me.loadUpdatedData();\n\n // Fires loadUpdatedData every time trigger is pressed\n me.on('expand', function(obj) {\n obj.loadUpdatedData();\n });\n\n // TODO: Building a fix for the problem combobox input field shows the value field instead of the display field\n me.on('boxready', function(obj) {\n obj.parentForm = obj.up('form');\n console.log(obj.parentForm);\n obj.mon(obj.parentForm, 'edit', function(editor) {\n console.log(\"beforeaction\");\n console.log(e.originalValue);\n console.log(obj);\n if (!obj.hasChanged)\n obj.setValue(obj.originalValue);\n });\n obj.mon(obj.parentForm, 'show', function() {\n /*console.log(\"move:\");\n console.log(obj.getValue());\n console.log(obj.inputEl.dom.value);*/\n obj.hasChanged = false;\n\n if (obj.parentForm) {\n if (obj.getValue() === null)\n obj.inputEl.dom.value = \"\";\n else\n obj.inputEl.dom.value = obj.store.getById(obj.getValue().toString()).get('display');\n }\n });\n });\n me.on('change', function(obj) {\n obj.hasChanged = true;\n });\n\n // Call parent initializator\n me.callParent(arguments);\n }\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe code we are talking about starts from the TODO.\u003c/p\u003e\n\n\u003cp\u003eI suggest to ignore previous part because is used to create a store-duplicate to avoid filtering and buffered stores.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdit 2:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eIt seems like the problem I'm trying to solve through this question is not directly related to the issue I'm trying to solve anymore (solved in a different way) so the question can be closed.\u003c/p\u003e\n\n\u003cp\u003eThanks anyway.\u003c/p\u003e","accepted_answer_id":"10854639","answer_count":"1","comment_count":"8","creation_date":"2012-06-01 16:00:38.7 UTC","last_activity_date":"2012-06-01 17:16:34.94 UTC","last_edit_date":"2012-06-01 17:16:34.94 UTC","last_editor_display_name":"","last_editor_user_id":"312907","owner_display_name":"","owner_user_id":"312907","post_type_id":"1","score":"0","tags":"extjs|extjs4","view_count":"2017"} +{"id":"45664983","title":"Dexie function return item after seaching","body":"\u003cp\u003eI have a simple Dexie table search function that I want to return the searched item after the searching code is actually run\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction ReturnItemFromTable() {\n db.table1\n .where('field1')\n .equals('some value')\n .first(function(item) {\n return item\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo I know the 'return' in the above code is in the wrong place for the function to know it's supposed to be returned. But if I put it in the right place it gets returns before the table.where has had a chance to run and thus returns undefined.\u003c/p\u003e\n\n\u003cp\u003eIs there a way to get this ordering done right?\u003c/p\u003e\n\n\u003cp\u003eThanks,\nFrank\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2017-08-13 21:15:42.433 UTC","last_activity_date":"2017-08-13 22:18:21.68 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"8163557","post_type_id":"1","score":"0","tags":"javascript|indexeddb|dexie","view_count":"34"} +{"id":"44646728","title":"ActionLayout not showing when LayoutDirection is set to rtl","body":"\u003cp\u003eI have an actionLayout to work as a notification badge on my toolbar. When I have my Phone in ltr everything works fine. When I turn my phone to rtl locale the badge and the menu icon disappear, though they take space on toolbar and click on them is working. Can anybody tell me what I'm doing wrong?\u003c/p\u003e\n\n\u003cp\u003ecode\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic override void OnCreateOptionsMenu(IMenu menu, MenuInflater inflater)\n {\n inflater.Inflate(Resource.Menu.welcome_menu, menu);\n\n using (var icon = menu.FindItem(Resource.Id.action_notification))\n {\n icon.Icon.ApplyDrawableTint(MobileSettingsManager.Instance.MobileSettings.Theme.NavigationBar.Icon);\n if ((Activity as BaseActivity).IsRtl() \u0026amp;\u0026amp; Build.VERSION.SdkInt \u0026gt;= BuildVersionCodes.Kitkat)\n {\n icon.Icon.AutoMirrored = true;\n var notification = menu.FindItem(Resource.Id.action_notification).ActionView;\n notification.Click += async delegate\n {\n if (Utils.IsOnline(Context))\n await MoveToNotifications();\n };\n _badge = notification.FindViewById\u0026lt;TextView\u0026gt;(Resource.Id.tv_notif_count);\n _badge.ApplyFont();\n _badge.Visibility = ViewStates.Gone;\n }\n }\n using (var icon = menu.FindItem(Resource.Id.action_filter))\n icon.Icon.ApplyDrawableTint(MobileSettingsManager.Instance.MobileSettings.Theme.NavigationBar.Icon);\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewelcome_menu.xml\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" encoding=\"utf-8\" ?\u0026gt;\n\u0026lt;menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n \u0026gt;\n\n \u0026lt;item\n android:id=\"@+id/action_filter\"\n android:icon=\"@drawable/ic_filter\"\n app:showAsAction=\"always\"/\u0026gt;\n\n \u0026lt;item\n android:id=\"@+id/action_notification\"\n app:actionLayout=\"@layout/action_notification_badge\"\n android:icon=\"@drawable/notification_bell\"\n app:showAsAction=\"always\"/\u0026gt;\n\u0026lt;/menu\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eaction_notification_badge.xml\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" encoding=\"utf-8\"?\u0026gt;\n\u0026lt;RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"match_parent\"\n android:clickable=\"true\"\n android:background=\"@android:color/transparent\"\n style=\"@android:style/Widget.ActionButton\"\u0026gt;\n \u0026lt;ImageView\n android:id=\"@+id/hotlist_bell\"\n android:src=\"@drawable/notification_bell\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:gravity=\"center\"\n android:layout_marginEnd=\"8dp\"\n android:layout_marginTop=\"8dp\"\n android:contentDescription=\"bell\" /\u0026gt;\n \u0026lt;TextView\n android:id=\"@+id/tv_notif_count\"\n android:layout_width=\"wrap_content\"\n android:minWidth=\"17sp\"\n android:textSize=\"10sp\"\n android:textColor=\"#ffffff\"\n android:layout_height=\"wrap_content\"\n android:gravity=\"center\"\n android:text=\"@null\"\n android:backgroundTint=\"#ff0000\"\n android:layout_alignTop=\"@id/hotlist_bell\"\n android:layout_alignEnd=\"@id/hotlist_bell\"\n android:layout_marginBottom=\"4dp\"\n android:layout_marginStart=\"4dp\"\n android:background=\"@drawable/rounded_square\" /\u0026gt; \n\u0026lt;/RelativeLayout\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003erounded_square.xml\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" encoding=\"utf-8\" ?\u0026gt;\n\u0026lt;shape\n xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:shape=\"oval\"\u0026gt;\n \u0026lt;solid\n android:color=\"#a3a3a3\"/\u0026gt;\n\u0026lt;/shape\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"44651205","answer_count":"1","comment_count":"0","creation_date":"2017-06-20 07:36:42.827 UTC","last_activity_date":"2017-06-21 06:36:04.81 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3200294","post_type_id":"1","score":"0","tags":"android|xml|xamarin.android","view_count":"81"} +{"id":"575385","title":"Why not always use psyco for Python code?","body":"\u003cp\u003e\u003ca href=\"http://psyco.sourceforge.net/\" rel=\"noreferrer\"\u003epsyco\u003c/a\u003e seems to be quite helpful in optimizing Python code, and it does it in a very non-intrusive way. \u003c/p\u003e\n\n\u003cp\u003eTherefore, one has to wonder. Assuming you're always on a x86 architecture (which is where most apps run these days), why not just always use \u003ccode\u003epsyco\u003c/code\u003e for all Python code? Does it make mistakes sometimes and ruins the correctness of the program? Increases the runtime for some weird cases?\u003c/p\u003e\n\n\u003cp\u003eHave you had any negative experiences with it? My most negative experience so far was that it made my code faster by only 15%. Usually it's better.\u003c/p\u003e\n\n\u003cp\u003eNaturally, using psyco is not a replacement for efficient algorithms and coding. But if you can improve the performance of your code for the cost of two lines (importing and calling psyco), I see no good reason not to.\u003c/p\u003e","accepted_answer_id":"1437939","answer_count":"8","comment_count":"0","creation_date":"2009-02-22 18:23:50.247 UTC","favorite_count":"12","last_activity_date":"2012-09-17 20:53:44.447 UTC","last_edit_date":"2009-02-22 18:43:23.333 UTC","last_editor_display_name":"eliben","last_editor_user_id":"8206","owner_display_name":"eliben","owner_user_id":"8206","post_type_id":"1","score":"37","tags":"python|optimization|psyco","view_count":"7584"} +{"id":"13370182","title":"Ajax content is being loaded regardless of if statement","body":"\u003cp\u003eI have a div being loaded with ajax but I wanted to add an if statement to only load the ajax if it is not already loaded. For some reason this isn't working on my \u003ca href=\"http://www.uvm.edu/~areid/homesite/\" rel=\"nofollow\"\u003esite\u003c/a\u003e( Click on the left eye to see the error. ). Instead, the ajax content slides in and then the content is reloaded via ajax.\u003c/p\u003e\n\n\u003cp\u003eHere is my code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;script type=\"text/javascript\"\u0026gt;\n $(window).load(function () {\n function SlideOut(element) {\n var opened = $(\".opened\"),\n div = $(\"#\" + element),\n content = $(\"#content\");\n opened.removeClass(\"opened\");\n div.addClass(\"opened\");\n content.removeClass().addClass(element);\n }\n $(\"#content div\").click(\n function () {\n var move = $(this).attr('data-move'),\n id = $(this).attr(\"id\");\n if( id == 'forehead')\n {\n $('#resume img').css('display', 'block');\n }\n\n else if(id =='left-eye23')\n { \n var leftcontent;\n leftcontent = $(\"#left-content\"); \n content = leftcontent.attr('class');\n if( !leftcontent.hasClass('photos'))\n { \n SlideOut(move);\n $(\"#left\").bind(\"webkitTransitionEnd mozTransitionEnd oTransitionEnd msTransitionEnd transitionend\", \n function(){ \n $.ajax({\n url:'photos.php',\n beforeSend: function(){\n leftcontent.html('\u0026lt;img src=\"loading.gif\" /\u0026gt; Now loding...');\n },\n }).done(function(data){\n leftcontent.html(data);\n leftcontent.addClass(\"photos\");\n }); \n });\n } \n else if (leftcontent.hasClass('photos'))\n {\n SlideOut(move); \n }\n\n }...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003c/p\u003e","answer_count":"2","comment_count":"2","creation_date":"2012-11-13 22:42:36.177 UTC","last_activity_date":"2013-02-04 02:22:36.693 UTC","last_edit_date":"2012-11-14 17:10:43.95 UTC","last_editor_display_name":"","last_editor_user_id":"1368228","owner_display_name":"","owner_user_id":"1368228","post_type_id":"1","score":"0","tags":"javascript|jquery|html|css|ajax","view_count":"117"} +{"id":"44722514","title":"Cannot set property 'innerHTML' of null??","body":"\u003cp\u003eWhy do I get this error in javascript:\nCannot set property 'innerHTML' of null\u003c/p\u003e\n\n\u003cp\u003eMy code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;asp:Literal ID=\"topLinkArticleOut\" runat=\"server\"\u0026gt;\u0026lt;/asp:Literal\u0026gt;\n\u0026lt;button type=\"button\" id=\"deleteTopLinkArticle\" name=\"deleteTopLinkArticle\" \nonclick=\"ChangeText()\" class=\"btn red\" style=\"float: right;\"\u0026gt;Delete\u0026lt;/button\u0026gt;\n\nfunction ChangeText() \n{\ndocument.getElementById(\"topLinkArticleOut\").innerHTML = \"\";\n} \n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"2","creation_date":"2017-06-23 13:22:28.09 UTC","last_activity_date":"2017-06-23 13:31:01.77 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"8036246","post_type_id":"1","score":"1","tags":"javascript|html","view_count":"60"} +{"id":"31243787","title":"Already selected items of dropdown/combo box should reflect as selected on click over Label","body":"\u003cp\u003eI am using label for attribute for input elements in my website that will help blind users. I have Combobox/Drop down in my code to enter Date (Month/Day) format. Currently if there is only single drop down , for example Select Country, then on click on Label, already selected country is reflecting as selected, that is okay. I have used this code of Jquery:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(function () {\n $('label').click(function () {\n var id = $(this).attr('for');\n $('#' + id).select();\n });\n}); \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut in Case of Date format as there are Child 'Label for' under Parent 'Label for' that is used for \"ExpiryDate\". So in this case my upper written Jquery is not working. That Jquery is working fine for Single Dropdown and for Teaxt boxes. But I want to select First child i.e. Month's already selected month should be selected. Please assist me so that I can implement it. I want to handle that when user click over Label then TextBox, Single Dropdown and Combobox/Multiple related dropdown's already entered/selected items should be shown as selected. My HTML Code is here:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"editor-label\"\u0026gt;\n \u0026lt;label for=\"ExpiryDate\"\u0026gt;*Expiration Date\u0026lt;/label\u0026gt;\n\u0026lt;/div\u0026gt;\n\n\u0026lt;div class=\"editor-field\"\u0026gt;\n \u0026lt;label class=\"accessibleText\" for=\"ExpirationMonth\"\u0026gt;\n \u0026lt;label for=\"ExpiryDate\"\u0026gt;*Expiration Date\u0026lt;/label\u0026gt;\n \u0026lt;/label\u0026gt;\n \u0026lt;select id=\"ExpirationMonth\" name=\"ExpirationMonth\" tabindex=\"0\"\u0026gt;\u0026lt;option value=\"\"\u0026gt;Month\u0026lt;/option\u0026gt;\n \u0026lt;option selected=\"selected\" value=\"1\"\u0026gt;Jan\u0026lt;/option\u0026gt;\n \u0026lt;option value=\"2\"\u0026gt;Feb\u0026lt;/option\u0026gt;\n \u0026lt;option value=\"3\"\u0026gt;Mar\u0026lt;/option\u0026gt;\n \u0026lt;option value=\"4\"\u0026gt;Apr\u0026lt;/option\u0026gt;\n \u0026lt;option value=\"5\"\u0026gt;May\u0026lt;/option\u0026gt;\n \u0026lt;option value=\"6\"\u0026gt;Jun\u0026lt;/option\u0026gt;\n \u0026lt;option value=\"7\"\u0026gt;Jul\u0026lt;/option\u0026gt;\n \u0026lt;option value=\"8\"\u0026gt;Aug\u0026lt;/option\u0026gt;\n \u0026lt;option value=\"9\"\u0026gt;Sep\u0026lt;/option\u0026gt;\n \u0026lt;option value=\"10\"\u0026gt;Oct\u0026lt;/option\u0026gt;\n \u0026lt;option value=\"11\"\u0026gt;Nov\u0026lt;/option\u0026gt;\n \u0026lt;option value=\"12\"\u0026gt;Dec\u0026lt;/option\u0026gt;\n \u0026lt;/select\u0026gt;\n\n \u0026lt;label class=\"accessibleText\" for=\"ExpirationDay\"\u0026gt;\n \u0026lt;label for=\"ExpiryDate\"\u0026gt;*Expiration Date\u0026lt;/label\u0026gt;\n \u0026lt;/label\u0026gt;\n \u0026lt;select id=\"ExpirationDay\" name=\"ExpirationDay\" tabindex=\"0\"\u0026gt;\u0026lt;option value=\"\"\u0026gt;Day\u0026lt;/option\u0026gt;\n \u0026lt;option selected=\"selected\" value=\"1\"\u0026gt;1\u0026lt;/option\u0026gt;\n \u0026lt;option value=\"2\"\u0026gt;2\u0026lt;/option\u0026gt;\n \u0026lt;option value=\"3\"\u0026gt;3\u0026lt;/option\u0026gt;\n \u0026lt;option value=\"4\"\u0026gt;4\u0026lt;/option\u0026gt;\n \u0026lt;option value=\"5\"\u0026gt;5\u0026lt;/option\u0026gt;\n \u0026lt;option value=\"6\"\u0026gt;6\u0026lt;/option\u0026gt;\n\n \u0026lt;/select\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-07-06 10:42:30.123 UTC","last_activity_date":"2015-07-06 10:49:26.28 UTC","last_edit_date":"2015-07-06 10:49:26.28 UTC","last_editor_display_name":"","last_editor_user_id":"462627","owner_display_name":"","owner_user_id":"4956321","post_type_id":"1","score":"1","tags":"javascript|jquery|html","view_count":"135"} +{"id":"10560388","title":"Sencha Touch 2: Simulating different profiles (phone/tablet) on Desktop OS (Linux/Windows)","body":"\u003cp\u003eI am learning Sench Touch 2. I figured if I want my app to be \"responsive\" to phone vs tablet platforms, I can use \u003ca href=\"http://docs.sencha.com/touch/2-0/#!/guide/profiles\" rel=\"nofollow\"\u003eProfiles\u003c/a\u003e. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eExt.define('Mail.profile.Phone', {\n extend: 'Ext.app.Profile',\n\n config: {\n name: 'Phone',\n views: ['Main']\n },\n\n isActive: function() {\n return Ext.os.is.Phone;\n },\n\n launch: function() {\n Ext.create('Mail.view.phone.Main');\n }\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am developing on Arch Linux with Chromium. I installed installed user agent switchers to fake running on a tablet/phone OS, but the profiles doesn't appear to change anything. I added \u003ccode\u003econsole.log()\u003c/code\u003e in the launch function\u003c/p\u003e\n\n\u003cp\u003eI wonder if I am using Profiles for the right thing? For example, I may want my app to display a list and a details view on tablets, and the list, animating to the details view \non a phone. If so, do I need a real tablet/phone just to test this profiles? \u003c/p\u003e","accepted_answer_id":"10561118","answer_count":"2","comment_count":"0","creation_date":"2012-05-12 01:43:02.767 UTC","favorite_count":"1","last_activity_date":"2016-08-01 20:40:55.84 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"292291","post_type_id":"1","score":"2","tags":"sencha-touch-2","view_count":"5117"} +{"id":"22415231","title":"Dynamic Where clause with unknown number of parameters","body":"\u003cp\u003eI have searched for an answer to my question, but have been unable to find one that meets my needs.\u003c/p\u003e\n\n\u003cp\u003eThe following two code snippets return the same thing and I have no preference which one to use, I am just including both in case it helps someone answer my question\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate List\u0026lt;MyClass\u0026gt; GetMyClass(string name, string city, string state, string zip)\n{\n using (MyEntities ctx = new MyEntities())\n {\n var results = from a in ctx.MyEntity\n where (a.Name == name \u0026amp;\u0026amp;\n a.City == city \u0026amp;\u0026amp;\n a.State == state \u0026amp;\u0026amp;\n a.ZIP == zip)\n select a;\n\n return results.ToList();\n }\n}\n\nprivate List\u0026lt;MyClass\u0026gt; GetMyClass(string name, string city, string state, string zip)\n{\n using (MyEntities ctx = new MyEntities())\n {\n var results = ctx.MyEntity.Where(a =\u0026gt; a.Name == name)\n .Where(a =\u0026gt; a.City == city)\n .Where(a =\u0026gt; a.State == state)\n .Where(a =\u0026gt; a.ZIP == zip)\n .Select(a =\u0026gt; a);\n\n return results.ToList();\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFor the purposes of this example, let's say I have a search screen which requires users to enter a Name and a City; State and ZIP are optional. The query must at least search by those two fields, and any additional fields, if necessary.\u003c/p\u003e\n\n\u003cp\u003eObviously, with my above examples, if a user searches only by Name and City, they would not get any results as the queries would be trying to match State == null and ZIP == null since those two parameters where not supplied.\u003c/p\u003e\n\n\u003cp\u003eHow can I rewrite this code to only search on the fields that parameters have been supplied for?\u003c/p\u003e","accepted_answer_id":"22415330","answer_count":"2","comment_count":"0","creation_date":"2014-03-14 20:34:30.113 UTC","last_activity_date":"2014-03-14 20:41:32.523 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"146694","post_type_id":"1","score":"2","tags":"c#|linq|c#-4.0|dynamic|linq-to-entities","view_count":"63"} +{"id":"29371522","title":"Set div to width and height of child image?","body":"\u003cp\u003e\u003ca href=\"http://jsfiddle.net/1tbrtoaj/1/\" rel=\"nofollow\"\u003eJSFiddle\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI have a div with class of container. The height of this div must equal the width. I have achieved this with:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e.container{\n background-color: #e6e6e6;\n position: relative;\n}\n\n.container:before{\n content: \"\";\n display: block;\n padding-top: 100%;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eInside the container is an image holder, and inside this an image. The image must be constrained, it's height or width must not exceed the container and still maintain aspect ratio. This is achieved by:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimg{\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n\n max-height: 100%; \n max-width: 100%; \n width: auto;\n height: auto;\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy question concerns the image holder, I need this to be the same width and height as the image that is inside of it. How can I do this? Using CSS only please.\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2015-03-31 14:47:22.257 UTC","last_activity_date":"2015-03-31 15:18:07.067 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1013512","post_type_id":"1","score":"0","tags":"css|css3","view_count":"949"} +{"id":"43474378","title":"Problems with \"Team Foundation Server is not your current Source Control plug-in\" when I try to start a new project in VS2017","body":"\u003cp\u003eI am new to Visual Studio 2017 and VSTS.\nFrom my VSTS page I choose to create a new application and clone it in Visual Studio.\nWhen I do this it launches Visual Studio. But then I get these error messages. How do I fix this?\n\u003ca href=\"https://i.stack.imgur.com/4XWt1.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/4XWt1.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"43486003","answer_count":"2","comment_count":"1","creation_date":"2017-04-18 14:01:04.477 UTC","last_activity_date":"2017-06-12 08:20:40.51 UTC","last_edit_date":"2017-04-18 14:16:49.017 UTC","last_editor_display_name":"","last_editor_user_id":"125673","owner_display_name":"","owner_user_id":"125673","post_type_id":"1","score":"0","tags":"git|visual-studio|vsts","view_count":"652"} +{"id":"21687487","title":"Hide data, process to new div with each function","body":"\u003cp\u003eI have multiple same class divs that produce an array and a script that puts them into lists.\u003cbr\u003e\nI would like to hide a JSON array object from briefly flashing (unprocessed) on the page before the script can process it into lists.\u003c/p\u003e\n\n\u003cp\u003eSo I put them into a hidden div and the each function stops working.\u003c/p\u003e\n\n\u003cp\u003eThe .hid divs actually contain:\u003cbr\u003e\n\u003ccode\u003e\u0026lt;%=getCurrentAttribute('item','lists')%\u0026gt;\u003c/code\u003e that produce the JSON array.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"hid\" style=\"display:none;\"\u0026gt;[{\"k\":\"Model\",\"v\":\"AB\"},{\"k\":\"Color\",\"v\":\"green\"}]\u0026lt;/div\u0026gt;\n\u0026lt;div class=\"overview\"\u0026gt;\u0026lt;/div\u0026gt;\n\u0026lt;div class=\"hid\" style=\"display:none;\"\u0026gt;[{\"k\":\"Model\",\"v\":\"AC\"},{\"k\":\"Color\",\"v\":\"blue\"}]\u0026lt;/div\u0026gt;\n\u0026lt;div class=\"overview\"\u0026gt;\u0026lt;/div\u0026gt;\n\u0026lt;div class=\"hid\" style=\"display:none;\"\u0026gt;[{\"k\":\"Model\",\"v\":\"AD\"},{\"k\":\"Color\",\"v\":\"red\"}]\u0026lt;/div\u0026gt;\n\u0026lt;div class=\"overview\"\u0026gt;\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy script\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ejQuery('.hid').each(function () {\n var $data = jQuery(this), spec,\n specs = jQuery.parseJSON($data.html());\n jQuery(\".overview\").html('\u0026lt;div class=\"bullet_spec\"\u0026gt;\u0026lt;/div\u0026gt;');\n jQuery.each(specs, function () {\n jQuery(\".overview\").children('div').append('\u0026lt;div class=\"specs\"\u0026gt;\u0026lt;span class=\"label\"\u0026gt;' + this.k + ':\u0026lt;/span\u0026gt;\u0026lt;span class=\"value\"\u0026gt; ' + this.v + '\u0026lt;/span\u0026gt;\u0026lt;/div\u0026gt;');\n });\n { \n }\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003ca href=\"http://jsfiddle.net/Qta2p/\" rel=\"nofollow\"\u003ehttp://jsfiddle.net/Qta2p/\u003c/a\u003e\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2014-02-10 20:43:18.733 UTC","last_activity_date":"2014-02-10 21:46:41.487 UTC","last_edit_date":"2014-02-10 21:46:41.487 UTC","last_editor_display_name":"","last_editor_user_id":"369450","owner_display_name":"","owner_user_id":"2430319","post_type_id":"1","score":"0","tags":"javascript|jquery|arrays|json|each","view_count":"95"} +{"id":"42201046","title":"How to configure the publish address of elasticsearch 5.0 with CLI flags?","body":"\u003cp\u003eI've used elasticsearch 2.0 with start up flags to configure the publish_addres. I need the publish address to be configured, because I want to start elasticsearch in a docker container and access it from outside. So the publish address must be the IP of the docker host, which is in my case 192.168.99.100. I want to access elasticsearch on port 9201.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edocker run -d -p 9201:9201 --name elasticsearch_test elasticsearch:5.2-alpine elasticsearch -Enetwork.publish_host=\"192.168.99.100\" -Ehttp.port=\"9201\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhich is like the old command\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edocker run -d -p 9201:9201 --name elasticsearch_test elasticsearch:2.4.1 elasticsearch -Des.network.publish_host=\"192.168.99.100\" -Des.http.port=\"9201\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut when I start the container and look into the logs I don't get the publish address 192.168.99.100:9201, but 192.168.99.100:9300 and 172.17.0.2:9201. How can I force elasticsearch to use my combination of address and port?\u003c/p\u003e\n\n\u003cp\u003eThanks in advance\u003c/p\u003e\n\n\u003cp\u003eOutput of \u003ccode\u003edocker logs elasticsearch_test\u003c/code\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[2017-02-13T09:17:03,095][INFO ][o.e.n.Node ] [] initializing ...\n[2017-02-13T09:17:03,252][INFO ][o.e.e.NodeEnvironment ] [ntIFoHQ] using [1] data paths, mounts [[/usr/share/elasticsearch/data (/dev/sda1)]], net usable_space [1gb], net total_space [17.8gb], spins? [possibly], types [ext4]\n[2017-02-13T09:17:03,252][INFO ][o.e.e.NodeEnvironment ] [ntIFoHQ] heap size [1.9gb], compressed ordinary object pointers [true]\n[2017-02-13T09:17:03,253][INFO ][o.e.n.Node ] node name [ntIFoHQ] derived from node ID [ntIFoHQnTAahC7_0cEt32Q]; set [node.name] to override\n[2017-02-13T09:17:03,257][INFO ][o.e.n.Node ] version[5.2.0], pid[1], build[24e05b9/2017-01-24T19:52:35.800Z], OS[Linux/4.4.43-boot2docker/amd64], JVM[Oracle Corporation/OpenJDK 64-Bit Server VM/1.8.0_111-internal/25.111-b14]\n[2017-02-13T09:17:05,249][INFO ][o.e.p.PluginsService ] [ntIFoHQ] loaded module [aggs-matrix-stats]\n[2017-02-13T09:17:05,250][INFO ][o.e.p.PluginsService ] [ntIFoHQ] loaded module [ingest-common]\n[2017-02-13T09:17:05,251][INFO ][o.e.p.PluginsService ] [ntIFoHQ] loaded module [lang-expression]\n[2017-02-13T09:17:05,251][INFO ][o.e.p.PluginsService ] [ntIFoHQ] loaded module [lang-groovy]\n[2017-02-13T09:17:05,251][INFO ][o.e.p.PluginsService ] [ntIFoHQ] loaded module [lang-mustache]\n[2017-02-13T09:17:05,251][INFO ][o.e.p.PluginsService ] [ntIFoHQ] loaded module [lang-painless]\n[2017-02-13T09:17:05,251][INFO ][o.e.p.PluginsService ] [ntIFoHQ] loaded module [percolator]\n[2017-02-13T09:17:05,251][INFO ][o.e.p.PluginsService ] [ntIFoHQ] loaded module [reindex]\n[2017-02-13T09:17:05,254][INFO ][o.e.p.PluginsService ] [ntIFoHQ] loaded module [transport-netty3]\n[2017-02-13T09:17:05,254][INFO ][o.e.p.PluginsService ] [ntIFoHQ] loaded module [transport-netty4]\n[2017-02-13T09:17:05,254][INFO ][o.e.p.PluginsService ] [ntIFoHQ] no plugins loaded\n[2017-02-13T09:17:05,677][WARN ][o.e.d.s.g.GroovyScriptEngineService] [groovy] scripts are deprecated, use [painless] scripts instead\n[2017-02-13T09:17:10,757][INFO ][o.e.n.Node ] initialized\n[2017-02-13T09:17:10,757][INFO ][o.e.n.Node ] [ntIFoHQ] starting ...\n[2017-02-13T09:17:11,015][WARN ][i.n.u.i.MacAddressUtil ] Failed to find a usable hardware address from the network interfaces; using random bytes: 07:0a:ef:37:62:95:b2:77\n[2017-02-13T09:17:11,198][INFO ][o.e.t.TransportService ] [ntIFoHQ] publish_address {192.168.99.100:9300}, bound_addresses {[::1]:9300}, {127.0.0.1:9300}\n[2017-02-13T09:17:11,203][INFO ][o.e.b.BootstrapChecks ] [ntIFoHQ] bound or publishing to a non-loopback or non-link-local address, enforcing bootstrap checks\n[2017-02-13T09:17:14,351][INFO ][o.e.c.s.ClusterService ] [ntIFoHQ] new_master {ntIFoHQ}{ntIFoHQnTAahC7_0cEt32Q}{cW1MZt0-RmutLXz_Tkm8mw}{192.168.99.100}{192.168.99.100:9300}, reason: zen-disco-elected-as-master ([0] nodes joined)\n[2017-02-13T09:17:14,395][INFO ][o.e.h.HttpServer ] [ntIFoHQ] publish_address {172.17.0.2:9201}, bound_addresses {[::]:9201}\n[2017-02-13T09:17:14,396][INFO ][o.e.n.Node ] [ntIFoHQ] started\n[2017-02-13T09:17:14,423][INFO ][o.e.g.GatewayService ] [ntIFoHQ] recovered [0] indices into cluster_state\n[2017-02-13T09:17:44,398][WARN ][o.e.c.r.a.DiskThresholdMonitor] [ntIFoHQ] high disk watermark [90%] exceeded on [ntIFoHQnTAahC7_0cEt32Q][ntIFoHQ][/usr/share/elasticsearch/data/nodes/0] free: 1gb[5.7%], shards will be relocated away from this node\n[2017-02-13T09:17:44,398][INFO ][o.e.c.r.a.DiskThresholdMonitor] [ntIFoHQ] rerouting shards: [high disk watermark exceeded on one or more nodes]\n[2017-02-13T09:18:14,434][WARN ][o.e.c.r.a.DiskThresholdMonitor] [ntIFoHQ] high disk watermark [90%] exceeded on [ntIFoHQnTAahC7_0cEt32Q][ntIFoHQ][/usr/share/elasticsearch/data/nodes/0] free: 1gb[5.7%], shards will be relocated away from this node\n[2017-02-13T09:18:44,438][WARN ][o.e.c.r.a.DiskThresholdMonitor] [ntIFoHQ] high disk watermark [90%] exceeded on [ntIFoHQnTAahC7_0cEt32Q][ntIFoHQ][/usr/share/elasticsearch/data/nodes/0] free: 1gb[5.7%], shards will be relocated away from this node\n[2017-02-13T09:18:44,438][INFO ][o.e.c.r.a.DiskThresholdMonitor] [ntIFoHQ] rerouting shards: [high disk watermark exceeded on one or more nodes]\n[2017-02-13T09:19:14,443][WARN ][o.e.c.r.a.DiskThresholdMonitor] [ntIFoHQ] high disk watermark [90%] exceeded on [ntIFoHQnTAahC7_0cEt32Q][ntIFoHQ][/usr/share/elasticsearch/data/nodes/0] free: 1gb[5.7%], shards will be relocated away from this node\n[2017-02-13T09:19:44,446][WARN ][o.e.c.r.a.DiskThresholdMonitor] [ntIFoHQ] high disk watermark [90%] exceeded on [ntIFoHQnTAahC7_0cEt32Q][ntIFoHQ][/usr/share/elasticsearch/data/nodes/0] free: 1gb[5.7%], shards will be relocated away from this node\n[2017-02-13T09:19:44,447][INFO ][o.e.c.r.a.DiskThresholdMonitor] [ntIFoHQ] rerouting shards: [high disk watermark exceeded on one or more nodes]\n[2017-02-13T09:20:14,453][WARN ][o.e.c.r.a.DiskThresholdMonitor] [ntIFoHQ] high disk watermark [90%] exceeded on [ntIFoHQnTAahC7_0cEt32Q][ntIFoHQ][/usr/share/elasticsearch/data/nodes/0] free: 1gb[5.7%], shards will be relocated away from this node\n[2017-02-13T09:20:44,459][WARN ][o.e.c.r.a.DiskThresholdMonitor] [ntIFoHQ] high disk watermark [90%] exceeded on [ntIFoHQnTAahC7_0cEt32Q][ntIFoHQ][/usr/share/elasticsearch/data/nodes/0] free: 1gb[5.7%], shards will be relocated away from this node\n[2017-02-13T09:20:44,459][INFO ][o.e.c.r.a.DiskThresholdMonitor] [ntIFoHQ] rerouting shards: [high disk watermark exceeded on one or more nodes]\n[2017-02-13T09:21:14,467][WARN ][o.e.c.r.a.DiskThresholdMonitor] [ntIFoHQ] high disk watermark [90%] exceeded on [ntIFoHQnTAahC7_0cEt32Q][ntIFoHQ][/usr/share/elasticsearch/data/nodes/0] free: 1gb[5.7%], shards will be relocated away from this node\n[2017-02-13T09:21:44,471][WARN ][o.e.c.r.a.DiskThresholdMonitor] [ntIFoHQ] high disk watermark [90%] exceeded on [ntIFoHQnTAahC7_0cEt32Q][ntIFoHQ][/usr/share/elasticsearch/data/nodes/0] free: 1gb[5.7%], shards will be relocated away from this node\n[2017-02-13T09:21:44,471][INFO ][o.e.c.r.a.DiskThresholdMonitor] [ntIFoHQ] rerouting shards: [high disk watermark exceeded on one or more nodes]\n[2017-02-13T09:22:14,482][WARN ][o.e.c.r.a.DiskThresholdMonitor] [ntIFoHQ] high disk watermark [90%] exceeded on [ntIFoHQnTAahC7_0cEt32Q][ntIFoHQ][/usr/share/elasticsearch/data/nodes/0] free: 1gb[5.7%], shards will be relocated away from this node\n[2017-02-13T09:22:44,485][WARN ][o.e.c.r.a.DiskThresholdMonitor] [ntIFoHQ] high disk watermark [90%] exceeded on [ntIFoHQnTAahC7_0cEt32Q][ntIFoHQ][/usr/share/elasticsearch/data/nodes/0] free: 1gb[5.7%], shards will be relocated away from this node\n[2017-02-13T09:22:44,485][INFO ][o.e.c.r.a.DiskThresholdMonitor] [ntIFoHQ] rerouting shards: [high disk watermark exceeded on one or more nodes]\n[2017-02-13T09:23:14,497][WARN ][o.e.c.r.a.DiskThresholdMonitor] [ntIFoHQ] high disk watermark [90%] exceeded on [ntIFoHQnTAahC7_0cEt32Q][ntIFoHQ][/usr/share/elasticsearch/data/nodes/0] free: 1gb[5.7%], shards will be relocated away from this node\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-02-13 09:48:55.953 UTC","last_activity_date":"2017-09-19 11:57:56.39 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2000569","post_type_id":"1","score":"2","tags":"elasticsearch|docker|elasticsearch-5","view_count":"211"} +{"id":"14044046","title":"Echo \"part\" of array (decoded from JSON)","body":"\u003cp\u003eI'am quite new to JSON and more \"advanced\" arrays. Therefore I don't know what I should search for...\u003c/p\u003e\n\n\u003cp\u003eI have this \"JSON array\" (what do you call it?):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n \"id\": \"321123321\",\n \"statuses\": {\n \"data\": [\n {\n \"message\": \"testmessage\",\n \"updated_time\": \"2012-12-25T16:33:29+0000\",\n \"id\": \"123321123\"\n }\n ],\n \"paging\": {\n \"previous\": \"1\",\n \"next\": \"1\"\n }\n }\n}​\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to create a variable from \"message\" that is called $message and a variable from \"up_datedtime\" that is called $updated.\u003c/p\u003e\n\n\u003cp\u003eTo get id I simple:\n$json_a=json_decode($string,true);\n$id $json_a['id'];\u003c/p\u003e\n\n\u003cp\u003eAnd for statuses: \n$json_a=json_decode($string,true);\n$status = $json_a['id']['statuses'];\u003c/p\u003e\n\n\u003cp\u003eBut when I try to get \"message\" I get \" Cannot use string offset as an array in\":\n $message = $json_a['id']['statuses']['data']['message'];\u003c/p\u003e\n\n\u003cp\u003eHow do I get $message from the array the proper way?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2012-12-26 17:38:14.877 UTC","last_activity_date":"2012-12-26 17:47:45.887 UTC","last_edit_date":"2012-12-26 17:42:42.623 UTC","last_editor_display_name":"","last_editor_user_id":"1353011","owner_display_name":"","owner_user_id":"1930152","post_type_id":"1","score":"0","tags":"arrays|echo","view_count":"82"} +{"id":"32348574","title":"How to calculate the sum of variables in PHP","body":"\u003cp\u003eIt calculates, but starting from the second row.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\ninclude('connect-db.php');\n$query = \"select * from users\";\n$result = mysql_query($query); \n$row = mysql_fetch_array($result);\n$sold= array();\n\nwhile ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { \n $sold=$row['contract']+$row['tva'];\n echo \"\u0026lt;table\u0026gt;\u0026lt;tr\u0026gt;\u0026lt;td\u0026gt;\" . $sold. \"\u0026lt;/td\u0026gt;\u0026lt;/tr\u0026gt;\u0026lt;/table\u0026gt;\";\n}\n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"32348651","answer_count":"3","comment_count":"1","creation_date":"2015-09-02 08:47:52.72 UTC","last_activity_date":"2015-09-02 09:06:09.85 UTC","last_edit_date":"2015-09-02 08:55:02.337 UTC","last_editor_display_name":"","last_editor_user_id":"2613662","owner_display_name":"","owner_user_id":"5291684","post_type_id":"1","score":"0","tags":"php|mysql","view_count":"110"} +{"id":"46235057","title":"pandas DF column max difference between pair of values recursively","body":"\u003cp\u003eI have a DataFrame with a column 'col1' with integers in it.\nThe DF may have anything from 100 up to 1mln rows.\nHow to compute difference between pair of values in the col1 such as:\u003c/p\u003e\n\n\u003cp\u003erow2 - row1\nrow3 - row2\nrow4 - row3\netc\u003c/p\u003e\n\n\u003cp\u003eand return max difference? \u003c/p\u003e\n\n\u003cp\u003eI know how to use loc, iloc but do not know how to force it to go through pair of values and move to next pair\u003c/p\u003e","answer_count":"1","comment_count":"4","creation_date":"2017-09-15 08:28:10.18 UTC","last_activity_date":"2017-09-15 13:02:47.253 UTC","last_edit_date":"2017-09-15 09:23:21.173 UTC","last_editor_display_name":"","last_editor_user_id":"8144295","owner_display_name":"","owner_user_id":"5892612","post_type_id":"1","score":"0","tags":"python|pandas|dataframe|difference","view_count":"111"} +{"id":"21305345","title":"Share video on a page on facebook","body":"\u003cp\u003eI want to share a video from my site on a page on facebook, not on my profile.\u003cbr\u003e\nFor Eg: I want to share video on \u003ca href=\"https://www.facebook.com/pages/Opticians/108277472608071\" rel=\"nofollow\"\u003ehttps://www.facebook.com/pages/Opticians/108277472608071\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI have a button as \u003cstrong\u003epost to wall\u003c/strong\u003e. On clicking it the video should get uploaded on the above mentioned page. I searched a lot for this but I ended in getting only share button which shares the post/video to our profile. How can i share that video on a different page on facebook? \u003c/p\u003e\n\n\u003cp\u003eAny Help would be greatly appreciated.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-01-23 10:24:12.573 UTC","last_activity_date":"2014-01-23 12:00:27.957 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2936213","post_type_id":"1","score":"1","tags":"php|facebook|facebook-graph-api","view_count":"482"} +{"id":"23659100","title":"Can't Get One Complete Background In Frameset","body":"\u003cp\u003eI am trying to get one complete background in a frameset...\nI can't seem to do it - when I add \u0026lt; body \u003e the color background I want shows but not the framset.\nIs there an easy way to put a complete background of color or color fades first and then have the framset showing with the background colors still there...\u003c/p\u003e\n\n\u003cp\u003eI have tried a \u0026lt; div class=propercolor \u003e and no luck - and as related the body tag doesn't work either. I find online where I can have each frameset specify a color = but when I do that - the fading gets wrecked...\u003c/p\u003e\n\n\u003cp\u003eThis class is just an example of fading - which works elsewhere...\u003c/p\u003e\n\n\u003cp\u003eAny help is appreciated - thx.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e .propercolor { \n background-image: -webkit-gradient(\n linear,\n left top,\n left bottom,\n color-stop(0, white),\n color-stop(1, red)\n );\n\n\n \u0026lt;HTML\u0026gt;\n\n \u0026lt;frameset rows=\"15%,75%,10%\"\u0026gt;\n\n \u0026lt;frame src=\"pit.cfm\" frameborder=\"0\" scrolling=\"no\"\u0026gt;\n\n \u0026lt;frameset cols=\"60%,40%\"\u0026gt;\n \u0026lt;FRAME src=\"schedule.cfm\" name=\"pi\" frameborder=\"0\" scrolling=\"no\"\u0026gt;\n \u0026lt;FRAME src=\"banners.cfm\" name=\"banner\" frameborder=\"0\" scrolling=\"no\"\u0026gt;\n \u0026lt;/frameset\u0026gt;\n\n \u0026lt;frame src=\"pib.cfm\" frameborder=\"0\" scrolling=\"no\"\u0026gt;\n\n \u0026lt;/frameset\u0026gt;\n\n \u0026lt;/HTML\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"5","creation_date":"2014-05-14 15:33:00.11 UTC","last_activity_date":"2014-05-14 15:52:16.13 UTC","last_edit_date":"2014-05-14 15:52:16.13 UTC","last_editor_display_name":"","last_editor_user_id":"1065868","owner_display_name":"","owner_user_id":"1348905","post_type_id":"1","score":"0","tags":"html|css|frames|frameset","view_count":"58"} +{"id":"6222712","title":"XCode 4 problem, always showing target view when stops at a break point","body":"\u003cp\u003eI just upgraded to XCode 4.0.2 and ran into a strange issue. Every time when the app stops at a breakpoint, XCode shows the target view instead of the .m file. When I manually click the file and show it, and click step, then the IDE switches to the target view again. This makes debugging virtually impossible. THis only happens to my own project. Sample projects work fine. Please help, it drives me nuts and I can not find where did I get the settings wrong.\u003c/p\u003e\n\n\u003cp\u003eP.S, this project worked fine on XCode 3, after upgrading to Xcode 4 I had problems with my targets. After wrestling a while with the schemes it finally builds and runs fine, but I can not do debugging when making changes because of this. I am not sure if I messed up some settings during the time to change the scheme and target settings.\nThanks\nRay\u003c/p\u003e","accepted_answer_id":"6322972","answer_count":"1","comment_count":"0","creation_date":"2011-06-03 03:35:32.313 UTC","last_activity_date":"2011-06-12 16:06:33.22 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"485918","post_type_id":"1","score":"1","tags":"iphone|xcode|ide","view_count":"93"} +{"id":"8067327","title":"How to block a div when arriving at the top of the window during a page scroll","body":"\u003cp\u003eOn an internet browser, I would like to have a div (typically a menu or an information bar) that stops moving when reaching the top of the screen during a page scroll. Note that I do not whant this 'div' to be stuck at one position all the time : It is a normal 'div' that follows page scrolling except when reaching the top of the screen.\nI am not sure it can be done only with css, if not, may be you could help me with jquery...\u003c/p\u003e","accepted_answer_id":"8067411","answer_count":"2","comment_count":"0","creation_date":"2011-11-09 15:32:20.2 UTC","last_activity_date":"2011-11-09 15:40:51.89 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"755371","post_type_id":"1","score":"0","tags":"jquery|css","view_count":"551"} +{"id":"40892357","title":"How to use PayPal permission token to obtain transaction information","body":"\u003cp\u003ePayPal API seems to be a disaster, but I'm battling through...\u003c/p\u003e\n\n\u003cp\u003eSo far I have been able to generate a token and verification code from \u003ca href=\"https://api-3t.paypal.com/nvp\" rel=\"nofollow noreferrer\"\u003ehttps://api-3t.paypal.com/nvp\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThe token and verification are authorised to use the TRANSACTION_SEARCH, TRANSACTION_DETAILS and ACCOUNT_BALANCE scopes.\u003c/p\u003e\n\n\u003cp\u003eBut I can't find anywhere how to actually get transaction details or balances using the token and verification code.\u003c/p\u003e\n\n\u003cp\u003eMy current code that is working uses the NVP API, but this has been validated by manually granting permissions from within PayPal. I can't see how to do this using the token and verify code.\u003c/p\u003e\n\n\u003cp\u003eMy current code (if it helps) which is working well, but without using the token and verification:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$vars['USER'] = $api_username;\n$vars['PWD'] = $api_password;\n$vars['SIGNATURE'] = $api_signature;\n$vars['STARTDATE'] = '2016-11-30T00:00:00Z;\n$vars['SUBJECT'] = 'my@paypalemail.com';\n$vars['METHOD'] = 'GetBalance';\n\n$vars = http_build_query($vars);\n\n$curl = curl_init('https://api-3t.paypal.com/nvp');\ncurl_setopt($curl, CURLOPT_FAILONERROR, true);\ncurl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);\ncurl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\ncurl_setopt($curl, CURLOPT_POSTFIELDS, $vars);\ncurl_setopt($curl, CURLOPT_HEADER, 0);\ncurl_setopt($curl, CURLOPT_POST, 1);\n$result = curl_exec($curl);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow do I convert this to use my App ID, token and verify_code generated by PayPal Permissions API?\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2016-11-30 15:38:42.123 UTC","last_activity_date":"2016-11-30 15:38:42.123 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2060885","post_type_id":"1","score":"1","tags":"php|api|paypal|paypal-sandbox|paypal-rest-sdk","view_count":"43"} +{"id":"34906193","title":"C#, Delete first row from gridview element","body":"\u003cp\u003eThis has been asked many times, but I can't seem to find a direct answer.\u003c/p\u003e\n\n\u003cp\u003eUsing C#, I use a datatable to fill a gridview. The first row of my datatable contains the table headers, so I loop through that row and fill the gridview header row. But now I need to get rid of that first row (the header row) in the table. I've looked all over, and all sources agree that the correct syntax is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e strSQL = \"SELECT * FROM [Station ID Request$]\";\n OleDbDataAdapter adaBatch = new OleDbDataAdapter(strSQL, strConnExcel);\n DataTable dtBatch = new DataTable();\n adaBatch.Fill(dtBatch);\n gv_stations.DataSource = dtBatch;\n gv_stations.DataBind();\n // Fill gridview headers with first row of data (spreadsheet headers)\n int i = 0;\n foreach (DataColumn col in dtBatch.Columns)\n {\n gv_stations.HeaderRow.Cells[i].Text = dtBatch.Rows[0][i].ToString();\n i++;\n }\n // Remove the first line of the gridview (contains header info)\n gv_stations.DeleteRow(0);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eEverything works but the last line, which gives me this error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSystem.Web.HttpException (0x80004005): The GridView 'gv_stations' fired\nevent RowDeleting which wasn't handled. at\nSystem.Web.UI.WebControls.GridView.OnRowDeleting(GridViewDeleteEventArgs e)\nat System.Web.UI.WebControls.GridView.HandleDelete(GridViewRow row, Int32\nrowIndex) at System.Web.UI.WebControls.GridView.DeleteRow(Int32 rowIndex) \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eEvery resource I've tried says that last line should be OK. Can anyone tell why I'm getting that error?\u003c/p\u003e\n\n\u003cp\u003eEDIT: Here is my gridview object, as requested.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;asp:GridView ID=\"gv_stations\" runat=\"server\"\n AutoGenerateColumns=\"True\" \n CssClass=\"c_gvv c_gvv_stations_results\"\n style=\"white-space:nowrap;\"\u0026gt;\n\u0026lt;/asp:GridView\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"34906553","answer_count":"3","comment_count":"4","creation_date":"2016-01-20 17:07:29.86 UTC","favorite_count":"1","last_activity_date":"2016-01-20 17:47:16.58 UTC","last_edit_date":"2016-01-20 17:46:00.637 UTC","last_editor_display_name":"","last_editor_user_id":"5813620","owner_display_name":"","owner_user_id":"5813620","post_type_id":"1","score":"2","tags":"c#|asp.net|gridview","view_count":"875"} +{"id":"6431101","title":"Horizontal scroll in DIV with many small DIV's inside (no text)","body":"\u003ch2\u003eObjective\u003c/h2\u003e\n\n\u003cp\u003eI have a main DIV with fixed height and width, and in that I want have lots of small DIV's to float freely. I have more small DIV's than can fit in the main DIV. Then it seems that by default is disappear small DIV's \u003cstrong\u003edown\u003c/strong\u003e outside the main DIV. I want them instead to disappear to the right.\u003c/p\u003e\n\n\u003cp\u003eI want to trigger a horizontal scrollbar, but no vertical. \u003c/p\u003e\n\n\u003ch2\u003eBackground\u003c/h2\u003e\n\n\u003cp\u003eI tested this with \u003ccode\u003ewhite-space: nowrap\u003c/code\u003e as described at \u003ca href=\"http://www.webmasterworld.com/forum83/8844.htm\" rel=\"nofollow noreferrer\"\u003ehttp://www.webmasterworld.com/forum83/8844.htm\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eAnd it works perfect if I have only text or images in the main DIV. \u003c/p\u003e\n\n\u003ch1\u003eQuestion\u003c/h1\u003e\n\n\u003cp\u003eBut how do I do when the main DIV contains only small DIV's?\u003c/p\u003e","accepted_answer_id":"6431976","answer_count":"2","comment_count":"1","creation_date":"2011-06-21 19:44:17.95 UTC","favorite_count":"2","last_activity_date":"2016-02-15 20:44:18.993 UTC","last_edit_date":"2015-11-11 00:37:53.887 UTC","last_editor_display_name":"","last_editor_user_id":"1120027","owner_display_name":"","owner_user_id":"809156","post_type_id":"1","score":"11","tags":"css|overflow|html|horizontal-scrolling","view_count":"36737"} +{"id":"28840473","title":"MYSQL inefficient count on large tables","body":"\u003cp\u003eI have a table with this structure:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eid(int), aff_id(int)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eField \u003ccode\u003eaff_id\u003c/code\u003e is \u003ccode\u003e0\u003c/code\u003e if the user was not affiliated by anybody and he registered directly, or \u003ccode\u003elarger than 0\u003c/code\u003e, if the user was affiliated by some other player and in that case it takes the value of the ID of the affiliate.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003euser #47 was affiliated by user #55, therefore in the database,\nwe will have this entry: id=47,aff_id=55\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to see how many users did a good job and affiliated/brought in other users (basically I want to see how many users are affiliates). For that I need to go through each user and see if there is anybody that has his user id inside the aff_id field.\nI do not want to see how many users have \u003ccode\u003eaff_id \u0026gt; 0\u003c/code\u003e, because that is basic stuff and it would mean how many players were affiliated.\u003c/p\u003e\n\n\u003cp\u003eFor my requirement, I run this query:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT \nCOUNT(*),\n(SELECT COUNT(*) \nFROM `users` \nWHERE `aff_id`=`u`.`id`\n) AS total_pl \nFROM `users` u \nHAVING total_pl\u0026gt;0\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eProblem is that the query takes around 30 seconds on a database with 2000 entries.\u003c/p\u003e\n\n\u003cp\u003eIf I try a different way, it takes even more time ... around 40 seconds:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT \n COUNT(*) \nFROM `users` u \nWHERE u.id IN (\n SELECT DISTINCT (`aff_id`) \n FROM users \n WHERE aff_id\u0026lt;\u0026gt;0\n)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat other options do you suggest that I should try for optimisation?\u003c/p\u003e\n\n\u003cp\u003eI was thinking to modify the first query to stop counting how many affiliated players does each user have and to find out instead only if each user has 0 affiliated players or at least 1 affiliated player, but there doesnt seem to be any difference.\u003c/p\u003e","accepted_answer_id":"28840608","answer_count":"3","comment_count":"5","creation_date":"2015-03-03 19:38:17.28 UTC","last_activity_date":"2015-03-03 20:20:05.77 UTC","last_edit_date":"2015-03-03 19:59:20.737 UTC","last_editor_display_name":"","last_editor_user_id":"1948292","owner_display_name":"","owner_user_id":"450504","post_type_id":"1","score":"0","tags":"php|mysql","view_count":"71"} +{"id":"41689766","title":"Installing Rubymine Debugger IDE after setting up rbenv global 2.1.2?","body":"\u003cp\u003eI've been trying to set up the debugger in Rubymine 2016.3. The initial error I was receiving stated that I didn't have permission to write in the version of ruby already installed in my mac os. \u003c/p\u003e\n\n\u003cp\u003eSo I downloaded rbenv and set up a new ruby 2.1.2 environment by using \u003ccode\u003erbenv global 2.1.2\u003c/code\u003e and checking to make sure it was being used with \u003ccode\u003eruby -v\u003c/code\u003e. \u003c/p\u003e\n\n\u003cp\u003eAfter selecting 2.1.2 default in preferences \u003e Ruby SDK and Gems and running the debugger, I'm still receiving this error:\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eError running testa: Failed to Install Gems. Following gems were not installed: /Applications/RubyMine.app/Contents/rb/gems/ruby-debug-ide-0.6.1.beta3.gem: Error installing ruby-debug-ide-0.6.1.beta3.gem: ERROR: Failed to build gem native extension. /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby mkrf_conf.rb Installing base gem You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eDoes anyone know how to fix this using rbenv?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-01-17 05:41:57.197 UTC","last_activity_date":"2017-01-17 11:57:07.893 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7428687","post_type_id":"1","score":"0","tags":"ruby|debugging|rubymine|rbenv","view_count":"80"} +{"id":"19394659","title":"Javascript for radio buttons in Adobe LiveCycle","body":"\u003cp\u003eHow can I do the following:\n1. I have a table with columns for Yes and No. I wanted a radio button to a cell (one for Yes and another for No) that when I click Yes, No is off and if click No, Yes is off.\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eHow can I make the radio buttons work that if I click the radio button (say the Yes button) it is on (similar to #1 above) but if I click it again, it turns off without turning on the other radio button (the No button).\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eI really would appreciate any help.\u003c/p\u003e\n\n\u003cp\u003eRegards,\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2013-10-16 03:19:53.947 UTC","last_activity_date":"2013-10-25 14:23:43.193 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2884822","post_type_id":"1","score":"1","tags":"javascript|radio-button|adobe|livecycle","view_count":"1433"} +{"id":"14365759","title":"DateTimeField without time","body":"\u003cpre\u003e\u003ccode\u003eclass Data(models.Model):\n time = models.DateTimeField()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have in my variable:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar = 2013-01-17 17:30\n\nData.objects.filter(time=var)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI need all Data from this day(2013-01-17 - without time)\u003c/p\u003e\n\n\u003cp\u003eHow to do?\u003c/p\u003e","answer_count":"3","comment_count":"0","creation_date":"2013-01-16 19:02:35.663 UTC","last_activity_date":"2015-05-20 16:00:49.927 UTC","last_edit_date":"2013-01-16 19:22:38.56 UTC","last_editor_display_name":"","last_editor_user_id":"1872327","owner_display_name":"","owner_user_id":"1872327","post_type_id":"1","score":"3","tags":"django","view_count":"2487"} +{"id":"15054605","title":"\"config\" scripts exist outside your system or Homebrew directory","body":"\u003cp\u003eRan \"brew doctor\" and got some errors. I managed to fix the path issue by following the advice at this link: \u003ca href=\"https://stackoverflow.com/questions/10343834/homebrew-wants-me-to-amend-my-path-no-clue-how?rq=1\"\u003eHow to modify PATH for Homebrew?\u003c/a\u003e.\u003c/p\u003e\n\n\u003cp\u003eHowever, completely lost with what to do with the following error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eWarning: \"config\" scripts exist outside your system or Homebrew directories.\n`./configure` scripts often look for *-config scripts to determine if\nsoftware packages are installed, and what additional flags to use when\ncompiling and linking.\n\nHaving additional scripts in your path can confuse software installed via\nHomebrew if the config script overrides a system or Homebrew provided\nscript of the same name. We found the following \"config\" scripts:\n\n/opt/sm/pkg/active/bin/curl-config\n/opt/sm/pkg/active/bin/ncurses5-config\n/opt/sm/pkg/active/bin/ncursesw5-config\n/opt/sm/pkg/active/bin/pkg-config\n/opt/sm/pkg/active/bin/xml2-config\n/opt/sm/pkg/active/bin/xslt-config\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNoob. Running OSX. Appreciate any assistance from wiser Jedis...\u003c/p\u003e","accepted_answer_id":"17631202","answer_count":"1","comment_count":"1","creation_date":"2013-02-24 17:48:19.377 UTC","favorite_count":"2","last_activity_date":"2013-07-13 14:41:27.347 UTC","last_edit_date":"2017-05-23 12:27:04.327 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"1448009","post_type_id":"1","score":"5","tags":"osx|configuration|path|homebrew","view_count":"2647"} +{"id":"37756824","title":"How to use MSBuild to xcopy only modified or new files recursively?","body":"\u003cp\u003eI need some help using MSBuild to xcopy files to two directories. \u003c/p\u003e\n\n\u003cp\u003eFirst I found out about \u003ca href=\"http://sedodream.com/2010/10/22/MSBuildExtendingTheSolutionBuild.aspx\" rel=\"nofollow\"\u003eSayed's\u003c/a\u003e after.xyz.sln.targets. This will ensure that copy file tasks will run regardless of actual Build occurs or not. \u003c/p\u003e\n\n\u003cp\u003eI wanted to use that to copy only new or modified only files to two target directories. So I need some sort of comparison code also. Steps that I can think of.\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003ecompare dir1 to dir2 and find any new or modified files in dir1.\u003c/li\u003e\n\u003cli\u003ecopy those files to dir2 recursively.\u003c/li\u003e\n\u003cli\u003ethen copy the exact file sets to dir3 recursively.\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eTIA.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-06-10 20:38:32.69 UTC","last_activity_date":"2016-06-10 21:17:11.423 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2133696","post_type_id":"1","score":"1","tags":"msbuild","view_count":"45"} +{"id":"10300998","title":"Easiest way to make http requests in java","body":"\u003cp\u003eI'm looking for a maven artifact or some pre-existing framework that will turn making http requests into a 1 liner. For those familiar with Ruby, I'm thinking about something alomg the lines of Httparty which supports get, put, post... etc.\u003c/p\u003e\n\n\u003cp\u003eex: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eResponse response = SomeLibrary.get(\"https://api.google.com/maps\")\nint code = response.code\nString body = response.body\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"10301028","answer_count":"2","comment_count":"3","creation_date":"2012-04-24 15:23:31.703 UTC","last_activity_date":"2012-04-24 15:29:15.913 UTC","last_edit_date":"2012-04-24 15:29:15.913 UTC","last_editor_display_name":"","last_editor_user_id":"847328","owner_display_name":"","owner_user_id":"847328","post_type_id":"1","score":"0","tags":"java|maven","view_count":"389"} +{"id":"46306002","title":"How to deserialize json array in c#","body":"\u003cp\u003eI am trying to deserialize the following JSON file: \u003ca href=\"http://komunikaty.tvp.pl/komunikatyxml/malopolskie/wszystkie/0?_format=json\" rel=\"nofollow noreferrer\"\u003ehttp://komunikaty.tvp.pl/komunikatyxml/malopolskie/wszystkie/0?_format=json\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eMy c# code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eMemoryStream stream1 = new MemoryStream();\nStreamWriter writer = new StreamWriter(stream1);\nDataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(ApiRegionalne));\nwriter.Write(json);\nwriter.Flush();\nstream1.Position = 0;\ndane = (ApiRegionalne)ser.ReadObject(stream1);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd my classes:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[DataContract]\npublic class newses\n{\n public int id;\n public string title;\n public bool shortcut;\n public string content;\n public bool rso_alarm;\n public string rso_icon;\n public string longitude;\n public string latitude;\n public int water_level_value;\n public int water_level_warning_status_value;\n public int water_level_alarm_status_value;\n public int water_level_trend;\n public string river_name;\n public string location_name;\n public string type;\n}\n\n[DataContract]\npublic class ApiRegionalne\n{\n [DataMember(Name = \"newses\")]\n public newses[] newses;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe JSON deserializer doesn't throw any exceptions, but my data is nevertheless null.\u003c/p\u003e\n\n\u003cp\u003eWhat am I doing wrong?\u003c/p\u003e","accepted_answer_id":"46306783","answer_count":"2","comment_count":"1","creation_date":"2017-09-19 16:59:00.247 UTC","last_activity_date":"2017-09-20 04:32:46.167 UTC","last_edit_date":"2017-09-20 04:32:46.167 UTC","last_editor_display_name":"","last_editor_user_id":"3744182","owner_display_name":"","owner_user_id":"8635494","post_type_id":"1","score":"2","tags":"c#|.net|json","view_count":"100"} +{"id":"5413362","title":"putting this javascript and php into codeigniter","body":"\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\n// This is a code to check the username from a mysql database table\n\nif(isSet($_POST['username']))\n{\n$username = $_POST['username'];\n\ninclude(\"dbconnection.php\");\n\n$sql_check = mysql_query(\"SELECT user FROM {$prefix}users WHERE user='$username'\");\n\nif(mysql_num_rows($sql_check))\n{\necho '\u0026lt;span style=\"color: red;\"\u0026gt;The username \u0026lt;b\u0026gt;'.$username.'\u0026lt;/b\u0026gt; is already in use.\u0026lt;/span\u0026gt;';\n}\nelse\n{\necho 'OK';\n}}\n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethat is the check.php witch i can change with no problem to work with CI its the below i need help with!\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;script src=\"js/jquery.js\" type=\"text/javascript\"\u0026gt;/script\u0026gt;\n\u0026lt;script type=\"text/javascript\"\u0026gt;\npic1 = new Image(16, 16);\npic1.src = \"loader.gif\";\n\n$(document).ready(function(){\n\n$(\"#username\").change(function() {\n\nvar usr = $(\"#username\").val();\n\nif(usr.length \u0026gt;= 3)\n{\n$(\"#status\").html('\u0026lt;img align=\"absmiddle\" src=\"loader.gif\" /\u0026gt; Checking availability...');\n\n$.ajax({\ntype: \"POST\",\nurl: \"check.php\",\ndata: \"username=\"+ usr,\nsuccess: function(msg){\n\n$(\"#status\").ajaxComplete(function(event, request, settings){\n\nif(msg == 'OK')\n{\n$(\"#username\").removeClass('object_error'); // if necessary\n$(\"#username\").addClass(\"object_ok\");\n$(this).html(' \u0026lt;img align=\"absmiddle\" src=\"accepted.png\" /\u0026gt; ');\n}\nelse\n{\n$(\"#username\").removeClass('object_ok'); // if necessary\n$(\"#username\").addClass(\"object_error\");\n$(this).html(msg);\n}});}});}\nelse\n{\n$(\"#status\").html('The username should have at least 3 characters.');\n$(\"#username\").removeClass('object_ok'); // if necessary\n$(\"#username\").addClass(\"object_error\");\n}});});\n\n//--\u0026gt;\n\n\u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ei understand most of what this scrip is doing and i can make it work in a normal PHP but i am using code ignighter. if i am reading it right i should only have to change the line url: \"check.php\", and of course the original php can anyone point me in the right direction on this?\u003c/p\u003e","accepted_answer_id":"5414384","answer_count":"1","comment_count":"1","creation_date":"2011-03-24 00:33:30.33 UTC","last_activity_date":"2014-06-24 11:22:52.933 UTC","last_edit_date":"2011-03-24 15:35:50.96 UTC","last_editor_display_name":"","last_editor_user_id":"37532","owner_display_name":"","owner_user_id":"570483","post_type_id":"1","score":"0","tags":"php|javascript|jquery|codeigniter","view_count":"451"} +{"id":"25888760","title":"DependencyResolver does not exist in the current context when using msbuild","body":"\u003cp\u003eI am using ASP.NET MVC 4 Dependency Injection like \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eDependencyResolver.Current.GetService\u0026lt;IUserContext\u0026gt;();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhich works fine in Visual studio but when I am building project with msbuild I always get this exception:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eBaseClasses\\EntityRepositoryBase.cs (68,40): errorCS0103: The name 'DependencyResolver' does not exist in the current context\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhat can I do? I installed mvc4 again but is the same.\u003c/p\u003e","answer_count":"2","comment_count":"2","creation_date":"2014-09-17 10:58:43.637 UTC","last_activity_date":"2015-03-13 03:34:57.253 UTC","last_edit_date":"2014-09-18 18:17:52.75 UTC","last_editor_display_name":"","last_editor_user_id":"41956","owner_display_name":"","owner_user_id":"267679","post_type_id":"1","score":"0","tags":"c#|asp.net-mvc|asp.net-mvc-4|dependency-injection|msbuild","view_count":"1269"} +{"id":"42944260","title":"Persistent sync (rsync) of local files to GCS bucket","body":"\u003cp\u003eI found out how to easily sync a local folder to my bucket at GCS.\u003c/p\u003e\n\n\u003cp\u003eLike \u003ccode\u003egsutil -m rsync -r -d . gs://mybucket/\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eI want to have a \"persistent\" sync going on, so that whenever any local files change, they will be synced with the bucket. I haven't found any way to do this with gsutil. Is there, or is there any other approach? (Like coding a local app using json API etc). BTW, I would need to sync in realtime (or close to realtime), not with cron jobs like every 10th minute.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-03-22 06:29:31.637 UTC","last_activity_date":"2017-03-22 06:35:32.283 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"129202","post_type_id":"1","score":"0","tags":"synchronization|google-cloud-storage|rsync|gsutil","view_count":"69"} +{"id":"12277853","title":"to UpperCase certain char-index in a string Javascript","body":"\u003cp\u003eok I want do have a jscript below\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(document).ready(function(){\n var str = 'post'; //the subject string\n var arr =[0,2]; //to uppercase character index 0 and 2\n\n str = str.split(\"\");\n for(var i = 0; i \u0026lt; str.length; i++){\n if($.inArray(i,arr)){\n str[i] = str[i].toUpperCase();\n }\n }\n str = str.join('');\n alert(str);\n //the result must be PoSt\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand you may see it running here\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://jsfiddle.net/laupkram/WfUUp/\" rel=\"nofollow\"\u003ehttp://jsfiddle.net/laupkram/WfUUp/\u003c/a\u003e\n ​\u003c/p\u003e\n\n\u003cp\u003enow what I want there is to provide a subject string and an array.\u003c/p\u003e\n\n\u003cp\u003ethe subject string is the string to be process and the array contains numerical values that will represent the character index in the string to uppercase.\u003c/p\u003e\n\n\u003cp\u003edid i miss something with my script that's why I get undersirable results?\u003c/p\u003e","accepted_answer_id":"12277988","answer_count":"4","comment_count":"1","creation_date":"2012-09-05 09:01:09.693 UTC","last_activity_date":"2012-09-05 09:12:42.57 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"877819","post_type_id":"1","score":"1","tags":"javascript|string|split","view_count":"1250"} +{"id":"18865203","title":"how to trim header and side information of mp3 frame using Naudio and c#","body":"\u003cp\u003eMy Problem is to get ACTUAL DATA of a mp3 frame. For this I have used NAudio and get RawData but I think in the RawData property, it returns all the bytes of the frame including header and side information.\u003c/p\u003e\n\n\u003cp\u003eCode is given below:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate void button1_Click(object sender, EventArgs e)\n{\n Mp3FileReader reader = new Mp3FileReader(\"file.mp3\");\n Mp3Frame mp3Frame = reader.ReadNextFrame();\n byte [] FrameByteArray = mp3Frame.RawData;\n\n BitArray bits = new BitArray(FrameByteArray);\n Console.Write(mp3Frame.RawData.Length);\n foreach (bool b in bits)\n {\n if (b == true)\n {\n Console.Write(\" 1\");\n }\n else\n {\n Console.Write(\" 0\");\n }\n\n }\n reader.Close();\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eit returns all frame data in bits including header and side information.\nBut I only need actual data of every frame without header and side information.\u003c/p\u003e\n\n\u003cp\u003eCan anyone help??\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-09-18 06:22:37.25 UTC","last_activity_date":"2014-06-12 13:47:50.94 UTC","last_edit_date":"2013-09-18 06:32:19.603 UTC","last_editor_display_name":"","last_editor_user_id":"2749417","owner_display_name":"","owner_user_id":"2749417","post_type_id":"1","score":"0","tags":"c#|mp3|audio-streaming|naudio","view_count":"1030"} +{"id":"6213642","title":"Using jQuery UI to style a div","body":"\u003cp\u003eI have the jQuery UI \"smoothness\" theme and I would like to use the \"look\" to style divs on my page. E.g. apply the gray, shaded, rounded-corner effect to a regular div that \u003cem\u003eISN'T\u003c/em\u003e an accordion, button, etc.\u003c/p\u003e\n\n\u003cp\u003eI thought it would be easy! Perhaps it is?!\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","accepted_answer_id":"6214400","answer_count":"2","comment_count":"1","creation_date":"2011-06-02 10:59:24.143 UTC","favorite_count":"1","last_activity_date":"2012-03-12 17:37:52.773 UTC","last_edit_date":"2011-06-02 15:53:51.73 UTC","last_editor_display_name":"","last_editor_user_id":"682480","owner_display_name":"","owner_user_id":"385768","post_type_id":"1","score":"3","tags":"jquery-ui","view_count":"4255"} +{"id":"25148466","title":"C++ cout binary value","body":"\u003cp\u003eI have one question, I have an array of unsigned chars and I want to print them but When I use cout a different value is printed.\u003c/p\u003e\n\n\u003cp\u003eThe array contains values in binary format, no with 0 and 1 but whit the representation witch chars.\u003c/p\u003e\n\n\u003cp\u003eArray to print:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[0] 147 unsigned char\n[1] 252 'ü' unsigned char\n[2] 170 'ª' unsigned char\n[3] 194 'Â' unsigned char\n[4] 108 'l' unsigned char\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat I got:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eô\nⁿ\n¬\n┬\nl\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhen i write it into a file, the representation is correct because I open the ofstream in binay mode but I cannot find how to do the same in cout.\u003c/p\u003e\n\n\u003cp\u003eBest Regards\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2014-08-05 21:16:44.187 UTC","last_activity_date":"2014-08-05 21:42:10.813 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3799835","post_type_id":"1","score":"1","tags":"c++|binary|cout","view_count":"440"} +{"id":"5559160","title":"Resulting EXE speed for C++ under VS2005, VS2008; VS2010 compilers","body":"\u003cp\u003eWhen I upgraded from VS6 to VS2005, I saw a 10% boost in the speed of my chess engine program with the default compile settings.\u003c/p\u003e\n\n\u003cp\u003eWondering if the same is true in general, and what improvements, if any, have been made to the final output of the MS C++ compiler since then.\u003c/p\u003e","accepted_answer_id":"5560184","answer_count":"3","comment_count":"0","creation_date":"2011-04-05 22:07:34.357 UTC","last_activity_date":"2015-05-25 14:20:33.16 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"409020","post_type_id":"1","score":"4","tags":"c++|visual-studio|compiler-construction|benchmarking","view_count":"748"} +{"id":"47069675","title":"Inserting picture using macro vba to adopt to a merged cell or single cell","body":"\u003cp\u003eI have a problem integrating my InsertPicture code to my FitPicture macro. I'm confused on how to get the shape to resize it automatically after using Insert function. It gives me the error regarding with the object. Here's \u003ca href=\"https://stackoverflow.com/questions/17110425/vba-to-insert-embedded-picture-excel\"\u003ea link\u003c/a\u003e of the idea that I research but still can't make anything happen. Any help is appreciated. Thanks.\u003c/p\u003e\n\n\u003cp\u003eHere's the macro I'm using to fit the picture into a merged cell or single cell:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSub FitPicture()\nOn Error GoTo NOT_SHAPE\nDim r As Range, sel As Shape\nSet sel = ActiveSheet.Shapes(Selection.Name)\nsel.LockAspectRatio = msoTrue\nSet r = Range(sel.TopLeftCell.MergeArea.Address)\n\nSelect Case (r.Width / r.Height) / (sel.Width / sel.Height)\nCase Is \u0026gt; 1\n sel.Height = r.Height * 0.9\nCase Else\n sel.Width = r.Width * 0.9\nEnd Select\n\n\nsel.Top = r.Top + 0.05 * sel.Height: sel.Left = r.Left + 0.05 * sel.Width\n\nExit Sub\nNOT_SHAPE:\nMsgBox \"Please select a picture first.\"\nEnd Sub\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere's the macro I'm using to insert a picture:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSub InsertPicture()\nDim sPicture As String, pic As Picture\n\nsPicture = Application.GetOpenFilename _\n(\"Pictures (*.gif; *.jpg; *.bmp; *.tif), *.gif; *.jpg; *.bmp; *.tif\", _\n, \"Select Picture to Import\")\n\nIf sPicture = \"False\" Then Exit Sub\n\nSet pic = ActiveSheet.Pictures.Insert(sPicture)\nWith pic\n.ShapeRange.LockAspectRatio = msoFalse\n.Height = ActiveCell.Height\n.Width = ActiveCell.Width\n.Top = ActiveCell.Top\n.Left = ActiveCell.Left\n.Placement = xlMoveAndSize\nEnd With\n\nSet pic = Nothing\n\nEnd Sub\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow can I integrate my FitPicture code to InsertPicture code? I need to resize it automatically after inserting using my mentioned modification on FitPicture. By the way, I'm using excel 2013. Thanks mates.\u003c/p\u003e","accepted_answer_id":"47108285","answer_count":"1","comment_count":"6","creation_date":"2017-11-02 07:20:27.977 UTC","last_activity_date":"2017-11-04 07:46:02.21 UTC","last_edit_date":"2017-11-04 06:47:03.753 UTC","last_editor_display_name":"","last_editor_user_id":"8854925","owner_display_name":"","owner_user_id":"8854925","post_type_id":"1","score":"0","tags":"vba|excel-vba","view_count":"43"} +{"id":"38277921","title":"Arbitrary matrix or array size in Swift","body":"\u003cp\u003eI am familiar with creating MxN matrices in Python using NumPy such as:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eIn [1]: import numpy as np\n\nIn [2]: np.zeros((10,5))\nOut[2]:\narray([[ 0., 0., 0., 0., 0.],\n [ 0., 0., 0., 0., 0.],\n [ 0., 0., 0., 0., 0.],\n [ 0., 0., 0., 0., 0.],\n [ 0., 0., 0., 0., 0.],\n [ 0., 0., 0., 0., 0.],\n [ 0., 0., 0., 0., 0.],\n [ 0., 0., 0., 0., 0.],\n [ 0., 0., 0., 0., 0.],\n [ 0., 0., 0., 0., 0.]]) \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn Swift, SIMD can create small matrices and perform operations on them (see below) but it appears to be limited to a max size of a 4x4 matrix.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport simd\n\nlet mat = float2x2([[1,2],[3,4]])\nmat[0]*9\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs there a way to define an arbitrary sized matrix of MxN dimensions in Swift and perform operations on that matrix?\u003c/p\u003e","accepted_answer_id":"38278175","answer_count":"1","comment_count":"0","creation_date":"2016-07-09 03:14:58.173 UTC","favorite_count":"0","last_activity_date":"2016-07-09 04:00:46.583 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1084875","post_type_id":"1","score":"0","tags":"arrays|swift|matrix|simd|accelerate-framework","view_count":"124"} +{"id":"19952136","title":"How to convert table th into li and td into \u003cp\u003e with javascript?","body":"\u003cp\u003eHello I have table like this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;table\u0026gt;\n \u0026lt;tbody\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;th\u0026gt;PROVINSI\u0026lt;/th\u0026gt;\n \u0026lt;th\u0026gt;KABKOT\u0026lt;/th\u0026gt;\n \u0026lt;th\u0026gt;KECAMATAN\u0026lt;/th\u0026gt;\n \u0026lt;th\u0026gt;DESA\u0026lt;/th\u0026gt;\n \u0026lt;/tr\u0026gt;\n\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;KALIMANTAN TENGAH\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;SERUYAN\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;SERUYAN HILIR\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;TANJUNG RANGAS\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;/tbody\u0026gt;\n\u0026lt;/table\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to convert this table into unordered list like this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;ul\u0026gt;\n \u0026lt;li\u0026gt;PROVINSI\u0026lt;p\u0026gt;KALIMANTAN TENGAH\u0026lt;/p\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;KABKOT\u0026lt;p\u0026gt;SERUYAN\u0026lt;/p\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;KECAMATAN\u0026lt;p\u0026gt;SERUYAN HILIR\u0026lt;/p\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;DESA\u0026lt;p\u0026gt;TANJUNG RANGAS\u0026lt;/p\u0026gt;\u0026lt;/li\u0026gt;\n\n\u0026lt;/ul\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ehow can i do this with javascript?\u003c/p\u003e\n\n\u003cp\u003ei've tried this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction(){\n var ul = $(\"\u0026lt;ul\u0026gt;\");\n $(\"table tr\").each(function(){\n var li = $(\"\u0026lt;li\u0026gt;\")\n $(\"th, td\", this).each(function(){\n var p = $(\"\u0026lt;p\u0026gt;\").html(this.innerHTML);\n li.append(p);\n });\n ul.append(li);\n }) \n $(\"table\").replaceWith(ul); \n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut i don't really understand how to loop over this table. sorry\u003c/p\u003e","accepted_answer_id":"19952556","answer_count":"4","comment_count":"2","creation_date":"2013-11-13 11:09:11.927 UTC","favorite_count":"0","last_activity_date":"2013-11-13 12:37:46.133 UTC","last_edit_date":"2013-11-13 11:35:21.07 UTC","last_editor_display_name":"","last_editor_user_id":"856170","owner_display_name":"","owner_user_id":"2087663","post_type_id":"1","score":"7","tags":"javascript|jquery|html|css","view_count":"1568"} +{"id":"18273022","title":"Keeping shape's appearance after removing it from parent in Kineticjs","body":"\u003cp\u003eMy situation is, I have shape (image) whose parent is some group. The shape, group and other possible parents may have all sorts of positions and transformations on them. When I remove the shape from the group and add it to its layer, is there an easy way to apply everything to the shape again to make it look like there was no change, on screen?\u003c/p\u003e\n\n\u003cp\u003eWhat I have done is use getAbsolutePosition, to preserve the position, but I need the transformations, such as rotation to follow along too. In the documentation, I see getAbsoluteTransform, but I see nothing about applying that transform to a shape.\u003c/p\u003e","accepted_answer_id":"18283832","answer_count":"2","comment_count":"0","creation_date":"2013-08-16 12:09:05.06 UTC","last_activity_date":"2013-08-17 00:15:35.707 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2078230","post_type_id":"1","score":"1","tags":"kineticjs","view_count":"227"} +{"id":"33767104","title":"Thread 1: EXC_BAD_INSTRUCTION Swift 2","body":"\u003cp\u003eI'm trying to make an app that will tell the time remaining until a specific date. Like some alarm apps say how much time until it will wake you up. I was having issues with ways of calculating this so I created my own function for it. My \u003cstrong\u003e\u003cem\u003eoriginal version\u003c/em\u003e\u003c/strong\u003e on a \u003cstrong\u003e\u003cem\u003eplayground\u003c/em\u003e\u003c/strong\u003e seemed to be working fine:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e//: Playground - noun: a place where people can play\n\nimport UIKit\n\nvar str = \"Hello, playground\"\n\n\nlet Test = NSCalendar.currentCalendar().component(NSCalendarUnit.Day, fromDate: NSDate())\n\nfunc Calculation() {\n\n //Months\n var month: String {\n let dateFormatter = NSDateFormatter()\n dateFormatter.dateFormat = \"MM\"\n return dateFormatter.stringFromDate(NSDate())\n }\n\n print(month)\n\n //Days\n var day: String {\n let dateFormatter = NSDateFormatter()\n dateFormatter.dateFormat = \"dd\"\n return dateFormatter.stringFromDate(NSDate())\n }\n\n print(day)\n\n\n //Hours\n var hour: String {\n let dateFormatter = NSDateFormatter()\n dateFormatter.dateFormat = \"hh\"\n return dateFormatter.stringFromDate(NSDate())\n }\n\n print(hour)\n\n //Minutes\n var minute: String {\n let dateFormatter = NSDateFormatter()\n dateFormatter.dateFormat = \"mm\"\n return dateFormatter.stringFromDate(NSDate())\n }\n\n print(minute)\n\n //Current Time\n let CurrentMonths = Int(month)\n let CurrentDays = Int(day)\n let CurrentHours = Int(hour)\n let CurrentMinutes = Int(minute)\n\n //End Date\n let EndMonths = 11;\n let EndDays = 23;\n let EndHours = 12;\n let EndMinutes = 60;\n\n //Calculation\n\n var LeftMonths = EndMonths - CurrentMonths!\n var LeftDays = EndDays - CurrentDays! - 1\n var LeftHours = EndHours - CurrentHours! - 1\n var LeftMinutes = EndMinutes - CurrentMinutes! - 1\n\n //Update Labels\n\n\n\n //Re-Run Loop To Update Time\n}\nCalculation()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI had to change it a little so it would work as a standalone iOS app in Swift 2. Currently I have the error \u003ccode\u003eThread 1: EXC_BAD_INSTRUCTION(code=EXC_1386_INVOP, subcode=0x0)\u003c/code\u003e In the console it says \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efatal error: unexpectedly found nil while unwrapping an Optional value\n(lldb) `. I checked the debug menu/console to the left of it and none of my variables are set to `nil.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is my ViewController.swift code \u003cstrong\u003e\u003cem\u003eUPDATED CODE To Fix Local Var Problem\u003c/em\u003e\u003c/strong\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport UIKit\n\nclass ViewController: UIViewController {\n\n //Current Time\n var CurrentMonths:Int = 0\n var CurrentDays:Int = 0\n var CurrentHours:Int = 0\n var CurrentMinutes:Int = 0\n\n //End Date\n var EndMonths:Int = 0\n var EndDays:Int = 0\n var EndHours:Int = 0\n var EndMinutes:Int = 0\n\n //Calculation\n\n var LeftMonths:Int = 0\n var LeftDays:Int = 0\n var LeftHours:Int = 0\n var LeftMinutes:Int = 0\n\n //Define\n var month:String = \"\"\n var day:String = \"\"\n var hour:String = \"\"\n var minute:String = \"\"\n\n //Labels\n @IBOutlet weak var DayL: UILabel!\n @IBOutlet weak var HourL: UILabel!\n @IBOutlet weak var MinuteL: UILabel!\n\n\n override func viewDidLoad() {\n super.viewDidLoad()\n // Do any additional setup after loading the view, typically from a nib.\n Calculation()\n }\n\n override func didReceiveMemoryWarning() {\n super.didReceiveMemoryWarning()\n // Dispose of any resources that can be recreated.\n }\n\n //Months\n func Month() {\n var month: String {\n let dateFormatter = NSDateFormatter()\n dateFormatter.dateFormat = \"MM\"\n return dateFormatter.stringFromDate(NSDate())\n }\n print(month)\n Day()\n }\n\n //Days\n func Day() {\n var day: String {\n let dateFormatter = NSDateFormatter()\n dateFormatter.dateFormat = \"dd\"\n return dateFormatter.stringFromDate(NSDate())\n }\n print(day)\n Hour()\n }\n\n //Hours\n func Hour() {\n var hour: String {\n let dateFormatter = NSDateFormatter()\n dateFormatter.dateFormat = \"hh\"\n return dateFormatter.stringFromDate(NSDate())\n }\n print(hour)\n Minute()\n }\n //Minutes\n func Minute() {\n var minute: String {\n let dateFormatter = NSDateFormatter()\n dateFormatter.dateFormat = \"mm\"\n return dateFormatter.stringFromDate(NSDate())\n }\n print(minute)\n }\n\n func Calculation() {\n\n //Start Calculations\n Month()\n\n //Current Time\n CurrentMonths = Int(month)!\n CurrentDays = Int(day)!\n CurrentHours = Int(hour)!\n CurrentMinutes = Int(minute)!\n\n //End Date\n EndMonths = 11;\n EndDays = 23;\n EndHours = 12;\n EndMinutes = 60;\n\n //Calculation\n\n LeftMonths = EndMonths - CurrentMonths\n LeftDays = EndDays - CurrentDays - 1\n LeftHours = EndHours - CurrentHours - 1\n LeftMinutes = EndMinutes - CurrentMinutes - 1\n\n //Update Labels\n DayL.text = String(LeftDays)\n HourL.text = String(LeftHours)\n MinuteL.text = String(LeftMinutes)\n\n\n\n //Re-Run Loop To Update Time\n Calculation()\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe error occurs on \u003ccode\u003eCurrentMonths = Int(month)!\u003c/code\u003e\nAll of the solutions from similar problems have not seem to work.\nAlso, when removing the var tag in the functions in the Calculation function, it gives me an error so I can't remove it.\u003c/p\u003e","accepted_answer_id":"33767366","answer_count":"1","comment_count":"4","creation_date":"2015-11-17 21:13:18.927 UTC","last_activity_date":"2015-11-17 21:48:04.837 UTC","last_edit_date":"2015-11-17 21:48:04.837 UTC","last_editor_display_name":"","last_editor_user_id":"2415822","owner_display_name":"","owner_user_id":"5564891","post_type_id":"1","score":"2","tags":"ios|iphone|swift","view_count":"181"} +{"id":"41333710","title":"How can I open the built-in browser in Visual Studio without opening a link?","body":"\u003cp\u003eWhen I click \u003ckbd\u003eCtrl\u003c/kbd\u003e + left mouse button on a link in Visual Studio, the built-in browser opens. Is it possible to open the built-in browser in Visual Studio \u003cem\u003ewithout\u003c/em\u003e opening a link?\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/oRyd1.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/oRyd1.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/TZFgE.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/TZFgE.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eIs it possible to open browser without clicking any link in editor?\u003c/p\u003e","accepted_answer_id":"41430950","answer_count":"1","comment_count":"0","creation_date":"2016-12-26 16:15:48.787 UTC","last_activity_date":"2017-01-02 17:35:03.293 UTC","last_edit_date":"2017-01-02 17:35:03.293 UTC","last_editor_display_name":"","last_editor_user_id":"4751173","owner_display_name":"","owner_user_id":"7106772","post_type_id":"1","score":"0","tags":"visual-studio-2015","view_count":"82"} +{"id":"30029354","title":"Clear Orchard CMS Database Cache","body":"\u003cp\u003eI want to manipulate data directly into database.\nBut the changes not reflected in Orchard Website.\nHow can tell to Orchard clear all database cache after making some data changes in database?\u003c/p\u003e","answer_count":"2","comment_count":"1","creation_date":"2015-05-04 11:46:15.17 UTC","last_activity_date":"2015-05-06 11:05:14.417 UTC","last_edit_date":"2015-05-05 08:57:53.707 UTC","last_editor_display_name":"","last_editor_user_id":"687887","owner_display_name":"","owner_user_id":"1069236","post_type_id":"1","score":"1","tags":"orchardcms","view_count":"694"} +{"id":"14826922","title":"Check if component is either type","body":"\u003cp\u003eI am trying to check if a component is type \u003ccode\u003eTMachine\u003c/code\u003e or \u003ccode\u003eTLabel\u003c/code\u003e if so i want it to free it as long as its NOT Label1 or label2\u003c/p\u003e\n\n\u003cp\u003ebut it will not let me do an \u003ccode\u003eOR\u003c/code\u003e on \u003ccode\u003eif Components[I] is (TMachine) or (TLabel) then\u003c/code\u003e Any way to fix this?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e procedure TfDeptLayout.FormClose(Sender: TObject; var Action: TCloseAction);\nvar\n I: Integer;\nbegin\n for I := ComponentCount -1 downto 0 do\n begin\n if Components[I] is (TMachine) or (TLabel) then\n if Components[I].Name \u0026lt;\u0026gt; Label2.Name then\n if Components[I].Name \u0026lt;\u0026gt; label3.Name then\n components[I].Free;\n end;\nend;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"14827128","answer_count":"1","comment_count":"3","creation_date":"2013-02-12 06:43:22.267 UTC","last_activity_date":"2013-02-12 07:31:45.19 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1414184","post_type_id":"1","score":"0","tags":"delphi","view_count":"260"} +{"id":"45192937","title":"Disadvantages of api extension with predefined (enumerated) option list instead of individual arguments","body":"\u003cp\u003eI currently need to extend a function's API that is very often used in my aplication with a new (boolean) parameter. I also foresee that, as more features are added to the program, the same function may (not yet certain) need more functionality, that (if needed) can be controled by boolean parameters. The extra functionality will only be needed by new function calls, not by the existing ones.\u003c/p\u003e\n\n\u003cp\u003eSo, to simplify its extension in the future, I plan on adding two or tree extra enumerated parameters to its API, so that new features can be added without chasing and editing all fuction calls everytime something is added. So, instead of extending to this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction(currparams..., bool option1, bool option2, bool option3, bool option4);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt would extend to this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etypedef enum{\n noopt,\n opt1,\n opt2,\n opt3,\n ...\n}APIoptions;\n\nfunction(currparams..., APIoptions option1, APIoptions option2);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAs long as the enumerated arguments I add now are enough for the future needs, this should make extending the API easier. However I don't recall seing this type of programming in the wild and would like to understand its disadvantages and potential problems and why it wouldn't be more often used.\u003c/p\u003e\n\n\u003cp\u003eThanks in advance.\u003c/p\u003e","accepted_answer_id":"45193798","answer_count":"2","comment_count":"2","creation_date":"2017-07-19 14:02:16.653 UTC","last_activity_date":"2017-07-19 15:53:37.17 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3456599","post_type_id":"1","score":"1","tags":"c++|c|api-design","view_count":"52"} +{"id":"29209417","title":"How to display two plot in a specific position with Matlab","body":"\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/rFRKt.png\" alt=\"Example of the result\"\u003e\u003c/p\u003e\n\n\u003cp\u003eHi to all,\u003c/p\u003e\n\n\u003cp\u003eWhen I run a Matlab code which generate two plot, these are overplotted (the second over the first).\u003c/p\u003e\n\n\u003cp\u003eI would like obtain a result as this figure, where the two plots are like in a \u003ccode\u003esubplot(211)\u003c/code\u003e and \u003ccode\u003esubplot(212)\u003c/code\u003e, the first and the second in two colons, but without using \u003ccode\u003esubplot\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eIt is possible?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eUPDATE\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI generate this two plot with two subfuncion:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction create_figure(X1, YMatrix1, p)\n%CREATE_FIGURE(X1, YMATRIX1)\n% X1: vector of x data\n% YMATRIX1: matrix of y data\n% P: parameters used in legend\n\n% Create figure\nfigure1 = figure('Name','Acceleration Power vs. Velocity LPF 1st order');\n...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction create_figure_gamma(X1, YMatrix1, p)\n%CREATE_FIGURE_GAMMA(X1, YMATRIX1, P)\n% X1: vector of x data\n% YMATRIX1: matrix of y data\n% P: parameters used in legend\n\n% Create figure\nfigure1 = figure('Name','gamma trend vs. Velocity');\n...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOf course, I can give in output the parameter \u003ccode\u003efigure1\u003c/code\u003e, writing:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction figure1 = create_figure(X1, YMatrix1, p)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI think that which this parameter is possible set the position of the two plots, but I do not know the procedure respect the generic window size.\u003c/p\u003e","accepted_answer_id":"29210678","answer_count":"2","comment_count":"1","creation_date":"2015-03-23 11:45:59.077 UTC","last_activity_date":"2015-03-23 12:49:33.347 UTC","last_edit_date":"2015-03-23 12:13:43.55 UTC","last_editor_display_name":"","last_editor_user_id":"2314915","owner_display_name":"","owner_user_id":"2314915","post_type_id":"1","score":"0","tags":"matlab|plot|matlab-figure","view_count":"114"} +{"id":"44181462","title":"Can I use ReportPortal with nightwatchjs?","body":"\u003cp\u003eCan I use ReportPortal with nightwatchjs + mocha?\nIf someone has experience, then tell in details please!\nP.s.: Now for reporting I use mochawesome-report-generator.\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2017-05-25 13:10:51.99 UTC","last_activity_date":"2017-06-14 16:12:47.003 UTC","last_edit_date":"2017-05-25 14:11:13.973 UTC","last_editor_display_name":"","last_editor_user_id":"7787841","owner_display_name":"","owner_user_id":"7787841","post_type_id":"1","score":"0","tags":"reportportal","view_count":"30"} +{"id":"37614239","title":"How to update angular 1.2 service to 1.5 in angular 2 style","body":"\u003cp\u003e\u003ca href=\"https://github.com/snapjay/ngCart/blob/master/src/ngCart.js#L30\" rel=\"nofollow\"\u003ehttps://github.com/snapjay/ngCart/blob/master/src/ngCart.js#L30\u003c/a\u003e\nI need to update this repo from 1.2 angular to 1.5 and in 2.0 in future\nI am start to upgrade this example from addToCart component\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport * as angular from 'angular';\nimport angularMeteor from 'angular-meteor';\n\nimport { name as ngCart } from '../../../api/ngCart/ngCart';\n\n\nimport './addToCart.html';\nclass AddToCart {\n constructor($scope, $reactive) {//, ngCart\n //ngCart object here should service return function?\n //angular_angular.js?hash=08f63d2…:13439 TypeError: _apiNgCartNgCart.name.getItemById is not a function\n 'ngInject';\n $reactive(this).attach($scope);\n\n if (this.inCart()) {\n this.q = ngCart.getItemById(this.id).getQuantity();\n } else {\n this.q = parseInt(this.quantity);\n }\n\n this.qtyOpt = [];\n for (var i = 1; i \u0026lt;= this.quantityMax; i++) {\n this.qtyOpt.push(i);\n }\n }\n\n inCart() {\n console.log(\"cart \" + ngCart);\n return ngCart.getItemById(this.id);\n }\n\n}\n\nconst name = 'addToCart';\n\n// create a module\nexport default angular.module(name, [\n angularMeteor,\n ngCart\n]).component(name, {\n templateUrl: `imports/ui/components/${name}/${name}.html`,\n controllerAs: name,\n bindings: {\n id: '@',\n name: '@',\n quantity: '@',\n quantityMax: '@',\n price: '@',\n data: '='\n },\n controller: AddToCart\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand it gives me following error \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eTypeError: _apiNgCartNgCart.name.getItemById is not a function\n at AddToCart.inCart (addToCart.js:39)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand here ngCart service\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport { name as ngCartItem } from './ngCartItem';\nimport { name as store } from './store';\n\nclass NgCart {\n constructor($scope, $reactive, $window) {\n 'ngInject';\n $reactive(this).attach($scope);\n }\n\n $onInit() {\n // $rootScope.$on('ngCart:change', function(){ // i shouldn't user rooutscope here\n // ngCart.$save();\n // });\n if (angular.isObject(store.get('cart'))) {\n this.$restore(store.get('cart'));\n } else {\n this.init();\n }\n }\n\n init() {\n this.$cart = {\n shipping: null,\n taxRate: null,\n tax: null,\n items: []\n };\n };\n\n\n\n addItem(id, name, price, quantity, data) {\n\n var inCart = this.getItemById(id);\n\n if (typeof inCart === 'object') {\n //Update quantity of an item if it's already in the cart\n inCart.setQuantity(quantity, false);\n // $rootScope.$broadcast('ngCart:itemUpdated', inCart);\n } else {\n var newItem = new ngCartItem(id, name, price, quantity, data);\n this.$cart.items.push(newItem);\n // $rootScope.$broadcast('ngCart:itemAdded', newItem);\n }\n\n // $rootScope.$broadcast('ngCart:change', {});\n };\n\n getItemById(itemId) {\n var items = this.getCart().items;\n var build = false;\n\n angular.forEach(items, function (item) {\n if (item.getId() === itemId) {\n build = item;\n }\n });\n return build;\n };\n\n setShipping(shipping) {\n this.$cart.shipping = shipping;\n return this.getShipping();\n };\n\n getShipping() {\n if (this.getCart().items.length == 0) return 0;\n return this.getCart().shipping;\n };\n\n setTaxRate(taxRate) {\n this.$cart.taxRate = +parseFloat(taxRate).toFixed(2);\n return this.getTaxRate();\n };\n\n getTaxRate() {\n return this.$cart.taxRate\n };\n\n getTax() {\n return +parseFloat(((this.getSubTotal() / 100) * this.getCart().taxRate)).toFixed(2);\n };\n\n setCart(cart) {\n this.$cart = cart;\n return this.getCart();\n };\n\n getCart() {\n return this.$cart;\n };\n\n getItems() {\n return this.getCart().items;\n };\n\n getTotalItems() {\n var count = 0;\n var items = this.getItems();\n angular.forEach(items, function (item) {\n count += item.getQuantity();\n });\n return count;\n };\n\n getTotalUniqueItems() {\n return this.getCart().items.length;\n };\n\n getSubTotal() {\n var total = 0;\n angular.forEach(this.getCart().items, function (item) {\n total += item.getTotal();\n });\n return +parseFloat(total).toFixed(2);\n };\n\n totalCost() {\n return +parseFloat(this.getSubTotal() + this.getShipping() + this.getTax()).toFixed(2);\n };\n\n removeItem(index) {\n var item = this.$cart.items.splice(index, 1)[0] || {};\n // $rootScope.$broadcast('ngCart:itemRemoved', item);\n // $rootScope.$broadcast('ngCart:change', {});\n\n };\n\n removeItemById(id) {\n var item;\n var cart = this.getCart();\n angular.forEach(cart.items, function (item, index) {\n if (item.getId() === id) {\n item = cart.items.splice(index, 1)[0] || {};\n }\n });\n this.setCart(cart);\n // $rootScope.$broadcast('ngCart:itemRemoved', item);\n // $rootScope.$broadcast('ngCart:change', {});\n };\n\n empty() {\n\n // $rootScope.$broadcast('ngCart:change', {});\n this.$cart.items = [];\n $window.localStorage.removeItem('cart');\n };\n\n isEmpty() {\n\n return (this.$cart.items.length \u0026gt; 0 ? false : true);\n\n };\n\n toObject() {\n\n if (this.getItems().length === 0) return false;\n\n var items = [];\n angular.forEach(this.getItems(), function (item) {\n items.push(item.toObject());\n });\n\n return {\n shipping: this.getShipping(),\n tax: this.getTax(),\n taxRate: this.getTaxRate(),\n subTotal: this.getSubTotal(),\n totalCost: this.totalCost(),\n items: items\n }\n };\n\n\n $restore(storedCart) {\n var _self = this;\n _self.init();\n _self.$cart.shipping = storedCart.shipping;\n _self.$cart.tax = storedCart.tax;\n\n angular.forEach(storedCart.items, function (item) {\n _self.$cart.items.push(new ngCartItem(item._id, item._name, item._price, item._quantity, item._data));\n });\n this.$save();\n };\n\n $save() {\n return store.set('cart', JSON.stringify(this.getCart()));\n }\n\n\n\n}\n\nconst name = 'ngCart';\n\n// create a module\nexport default angular.module(name, [\n angularMeteor,\n ngCartItem,\n store\n]).service(name, {\n controllerAs: name,\n controller: NgCart\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow to import service in 1.5?\nI am using angular-meteor and followed \u003ca href=\"http://www.angular-meteor.com/tutorials/socially/angular1/bootstrapping\" rel=\"nofollow\"\u003ethis\u003c/a\u003e tutorial\u003c/p\u003e\n\n\u003cp\u003eAnd also there can't be scope in service \n// This controller throws an unknown provider error because\n// a scope object cannot be injected into a service.\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e\u003ca href=\"https://docs.angularjs.org/error/\" rel=\"nofollow\"\u003ehttps://docs.angularjs.org/error/\u003c/a\u003e$injector/unpr?p0=$scopeProvider%20%3C-%20$scope%20%3C-%20ngCart\u003c/p\u003e\n\u003c/blockquote\u003e","accepted_answer_id":"37875647","answer_count":"2","comment_count":"0","creation_date":"2016-06-03 12:19:01.233 UTC","last_activity_date":"2016-06-17 07:31:18.693 UTC","last_edit_date":"2016-06-03 13:21:54.92 UTC","last_editor_display_name":"","last_editor_user_id":"880709","owner_display_name":"","owner_user_id":"880709","post_type_id":"1","score":"4","tags":"angularjs|angular-meteor","view_count":"170"} +{"id":"21088407","title":"Perfectly linear spacing between gridview items","body":"\u003cp\u003eI am using following code to show the GirdView items.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;GridView\n android:id=\"@+id/gridView\"\n android:gravity=\"center_horizontal\"\n android:layout_below=\"@+id/searchLayout\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"match_parent\"\n android:horizontalSpacing=\"10dp\"\n android:numColumns=\"3\"\n android:stretchMode=\"columnWidth\"\n android:verticalSpacing=\"10dp\" /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eEach GridItem (ImageView) is of size \u003ccode\u003e92dp\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eWhat i want is to show only 3 Columns or 3 images each Row and each Top, bottom ,left right all needs to be perfectly aligned and equal.\u003c/p\u003e\n\n\u003cp\u003eBelow is the result of above code.\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/HTKxv.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eIt can be seen that spaces on left and right of the grid are very less as compared with the ones in between images and also between rows are very small.\u003c/p\u003e\n\n\u003cp\u003eSecondly, I am using 92dp. above is the result of S3, but when i use small screen the 3rd image doesn't get fit like in 320 dp screen. \u003c/p\u003e\n\n\u003cp\u003eShouldn't using \"dp\" automatically adjust according to screen size?\u003c/p\u003e","answer_count":"6","comment_count":"1","creation_date":"2014-01-13 10:01:38.767 UTC","last_activity_date":"2015-02-10 11:45:16.64 UTC","last_edit_date":"2014-02-07 12:55:13.75 UTC","last_editor_display_name":"","last_editor_user_id":"1528942","owner_display_name":"","owner_user_id":"1921872","post_type_id":"1","score":"3","tags":"java|android|android-layout","view_count":"1965"} +{"id":"10846066","title":"OpenGL ES snapshot for multi-sampling giving odd colors in iOS","body":"\u003cp\u003eWhen trying to get opengl view snapshot as UIImage for multi-sampling the image colors are different.\u003c/p\u003e\n\n\u003cp\u003eWhen multi-sampling is off, it is proper.\nThis is how I am taking the snapshot:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e- (UIImage*)snapshot\n{\n\n GLint backingWidth, backingHeight;\n\n backingWidth = framebufferWidth;\n backingHeight = framebufferHeight;\n\n NSInteger myDataLength = backingWidth * backingHeight * 4;\n\n GLubyte *buffer = (GLubyte *) malloc(myDataLength);\n glReadPixels(0, 0, backingWidth, backingHeight, GL_RGBA, GL_UNSIGNED_BYTE, buffer);\n\n // gl renders \"upside down\" so swap top to bottom into new array.\n GLubyte *buffer2 = (GLubyte *) malloc(myDataLength);\n\n for(int y = 0; y \u0026lt; backingHeight; y++) {\n for(int x = 0; x \u0026lt; backingWidth * 4; x++) {\n buffer2[y*4*backingWidth + x] = buffer[(backingHeight - y -1 ) * backingWidth * 4 + x];\n }\n }\n // make data provider with data.\n CGDataProviderRef provider = CGDataProviderCreateWithData(NULL, buffer2, myDataLength, myProviderReleaseData);\n\n // prep the ingredients\n int bitsPerComponent = 8;\n int bitsPerPixel = 32;\n int bytesPerRow = 4 * backingWidth;\n CGColorSpaceRef colorSpaceRef = CGColorSpaceCreateDeviceRGB();\n CGBitmapInfo bitmapInfo = kCGBitmapByteOrderDefault | kCGImageAlphaPremultipliedLast ;\n CGColorRenderingIntent renderingIntent = kCGRenderingIntentDefault;\n\n // make the cgimage\n CGImageRef imageRef = CGImageCreate(backingWidth, backingHeight, bitsPerComponent, bitsPerPixel, bytesPerRow, colorSpaceRef, bitmapInfo, provider, NULL, NO, renderingIntent);\n\n // then make the uiimage from that\n UIImage *image1 = [UIImage imageWithCGImage:imageRef];\n\n CGImageRelease(imageRef);\n CGColorSpaceRelease(colorSpaceRef);\n CGDataProviderRelease(provider);\n free(buffer);\n\n return image1;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere are the result of taking the snapshot :\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/VCJpr.png\" alt=\"opengl view\"\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/TYEfJ.png\" alt=\"snapshot of the same view\"\u003e\u003c/p\u003e\n\n\u003cp\u003eFirst one is the opengl view I am drawing and second image is the snapshot of the image I am getting for the above mentioned code. \u003c/p\u003e\n\n\u003cp\u003eI am not using GLKit framework. want to know why multisampling is messing up the snapshot.\u003c/p\u003e","accepted_answer_id":"10846373","answer_count":"1","comment_count":"0","creation_date":"2012-06-01 07:20:05.307 UTC","last_activity_date":"2012-06-01 14:48:24.51 UTC","last_edit_date":"2012-06-01 14:48:24.51 UTC","last_editor_display_name":"","last_editor_user_id":"44729","owner_display_name":"","owner_user_id":"515915","post_type_id":"1","score":"0","tags":"ios|opengl-es|snapshot","view_count":"413"} +{"id":"47534469","title":"geting server IP that post data","body":"\u003cp\u003eI am POSTing some data from one server to another using following code:\u003c/p\u003e\n\n\u003cblockquote\u003e\n\u003cpre\u003e\u003ccode\u003e $data2 = http_build_query(\n array(\n 'desc' =\u0026gt; $desc\n ) );\n $options = array('http' =\u0026gt;\n array(\n 'method' =\u0026gt; 'POST',\n 'header' =\u0026gt; 'Content-type: application/x-www-form-urlencoded',\n 'content' =\u0026gt; $data2\n ) );\n $context = stream_context_create($options); // post request $result = file_get_contents($payment_url, false, $context);\n $result = @json_decode($result, true);\n\u003c/code\u003e\u003c/pre\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI would like to ensure that following POST comming from correct server so I have to check server IP posting this data. but $_SERVER['SERVER_ADDR'] give me wrong IP (actually give me destination`s server IP instead Posting server IP).\u003c/p\u003e","answer_count":"1","comment_count":"4","creation_date":"2017-11-28 14:52:06.933 UTC","last_activity_date":"2017-11-28 15:10:35.45 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1081526","post_type_id":"1","score":"0","tags":"php|http-post","view_count":"23"} +{"id":"24788335","title":"Maven alternate settings.xml when don't have option of mvn -s","body":"\u003cp\u003eWe're working with an integration partner who's given us a set of bash scripts, which then call Maven projects/targets. I'm trying to let our (shared) Jenkins server build those projects. In Maven2, one could provide a org.apache.maven.user-settings MAVEN_OPT setting. Maven3 no longer supports that \u003ca href=\"https://jira.codehaus.org/browse/MNG-5026\" rel=\"nofollow\"\u003eoption\u003c/a\u003e. \u003c/p\u003e\n\n\u003cp\u003e\u003cem\u003eThings I've tried:\u003c/em\u003e\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003ethe afore-mentioned org.apache.maven.user-settings\u003c/li\u003e\n\u003cli\u003ealias mvn='mvn -s /path/to/project-settings.xml'\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003e\u003cem\u003eThings I've considered, but haven't yet tried:\u003c/em\u003e\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eWriting a wrapping \u003ca href=\"http://mojo.codehaus.org/exec-maven-plugin/usage.html\" rel=\"nofollow\"\u003emvn exec\u003c/a\u003e, so I can execute my job from within Jenkins and provide an alternate settings file via its means\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eI've seen threads where others have wrestled with this, but haven't yet seen a proposed solution. \u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-07-16 18:43:58.537 UTC","last_activity_date":"2014-07-16 19:20:37.44 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"872848","post_type_id":"1","score":"2","tags":"bash|maven","view_count":"253"} +{"id":"20418189","title":"Is there a way to tell C to never allocate memory dynamically?","body":"\u003cp\u003eI want to write a C program whose memory will be constant. It can never allocate more memory than certain amount. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eint main(){\n int memory[512];\n int i = 5;\n i = i + 5;\n memory[50] = i;\n};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNotice that on this example \u003ccode\u003ei = 5\u003c/code\u003e and \u003ccode\u003ei = i+5\u003c/code\u003e will allocate memory. I want to completely avoid the internal memory allocation procedure (which I believe is kind of slow).´Is there a way to tell C to allocate it directly on my memory array?\u003c/p\u003e","answer_count":"5","comment_count":"11","creation_date":"2013-12-06 07:13:48.517 UTC","last_activity_date":"2013-12-06 08:08:33.347 UTC","last_edit_date":"2013-12-06 07:41:22.953 UTC","last_editor_display_name":"","last_editor_user_id":"1031791","owner_display_name":"","owner_user_id":"1031791","post_type_id":"1","score":"-4","tags":"c|memory-management","view_count":"172"} +{"id":"7920744","title":"Deleted Module's folder before disabling it","body":"\u003cp\u003e\u003cstrong\u003eWhat I did\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eLet's say my module was called \"some_module\". Without disabling from the Modules menu, I renamed that folder and changed the contents, now it's \"another_module\". I perceive that the site is slowing down, trying to still look for \"some_module\".\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eWhat I've tried and expected\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI've tried clearing the cache a few times, expecting Drupal to rebuild it's module list based on what's available. However, I'm not sure how the inner-workings of enabling/disabling modules works, and I don't know if my site is still going slow because of this reason, or for another reason.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eWhat I found in the documentation\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI read some of the \u003ca href=\"http://drupal.org/node/361112\" rel=\"nofollow\"\u003edocumentation on Drupal Modules\u003c/a\u003e, but it looks like there are some pretty simple functions like module_exists(), but it doesn't describe whether or not it will ever stop looking for \"some_module\".\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eMy question\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eSo, my question is: have I left behind bloated garbage that is slowing down my Drupal site by not disabling the module before renaming it?\u003c/p\u003e\n\n\u003cp\u003eAnd a bonus question...are any of \u003ca href=\"http://drupal.org/node/79237\" rel=\"nofollow\"\u003ethese documented benchmarks\u003c/a\u003e applicable to this situation?\u003c/p\u003e","accepted_answer_id":"7920814","answer_count":"1","comment_count":"0","creation_date":"2011-10-27 18:43:40.387 UTC","last_activity_date":"2012-02-15 15:22:53.23 UTC","last_edit_date":"2011-10-29 02:15:15.72 UTC","last_editor_display_name":"","last_editor_user_id":"830680","owner_display_name":"","owner_user_id":"758299","post_type_id":"1","score":"1","tags":"drupal|drupal-7|drupal-modules","view_count":"643"} +{"id":"39533220","title":"Prevent QLabel from resizing parent Widget","body":"\u003cp\u003eI have a \u003ccode\u003eQLabel\u003c/code\u003e inside a \u003ccode\u003eQFrame\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eSometimes I have too much text in the \u003ccode\u003eQLabel\u003c/code\u003e and it resizes the \u003ccode\u003eQFrame\u003c/code\u003e where it is in.\u003c/p\u003e\n\n\u003cp\u003eNow, I want to prevent the \u003ccode\u003eQLabel\u003c/code\u003e from resizing the \u003ccode\u003eQFrame\u003c/code\u003e where it resides in.\nI don't want to limit the amount of lines or setting the maximum size of the \u003ccode\u003eQLabel\u003c/code\u003e because if the window size of the app increases, I do want to allow the \u003ccode\u003eQLabel\u003c/code\u003e to increase in size.\u003c/p\u003e\n\n\u003cp\u003eJust want to prevent the \u003ccode\u003eQLabel\u003c/code\u003e from expanding it's parent.\u003c/p\u003e\n\n\u003cp\u003eAny clean way to do it?\u003c/p\u003e","accepted_answer_id":"39536443","answer_count":"1","comment_count":"2","creation_date":"2016-09-16 13:51:54.513 UTC","last_activity_date":"2016-09-16 21:26:56.523 UTC","last_edit_date":"2016-09-16 17:33:33.243 UTC","last_editor_display_name":"","last_editor_user_id":"6367468","owner_display_name":"","owner_user_id":"3508184","post_type_id":"1","score":"1","tags":"qt|pyqt|pyside","view_count":"107"} +{"id":"12601140","title":"How to show the starting address of some variables in C?","body":"\u003cpre\u003e\u003ccode\u003e#include \u0026lt;stdlib.h\u0026gt;\n#include \u0026lt;stdio.h\u0026gt;\n#include \u0026lt;math.h\u0026gt;\n#include \u0026lt;string.h\u0026gt;\n\nextern char **environ;\n\nint global_x = 10; // initialised global variable\nint global_y; // un-initialised global variable\nchar global_array1[] = \"Hello, world!\"; // initialised global array and a string literal\nchar global_array2[10]; // un-initialised global array\nchar *global_pointer1 = \"bye!\"; // global pointer to a string literal \nchar *global_pointer2; // un-initialised global pointer \nfloat global_float = 100.1; // initialised global variable\ndouble global_double; // un-initialised global variable\n\n#define ONEGB 1073741824\n#define ONEMB 1048576\n#define ONEKB 1024\n\nchar *addr(unsigned long a)\n{\n unsigned long r; // remainder\n\n r = (unsigned long) a;\n int gb = (int) ( r / ONEGB );\n\n r -= gb * ONEGB;\n int mb = (int) ( r / ONEMB );\n\n r -= mb * ONEMB;\n int kb = (int) ( r / ONEKB );\n\n r -= kb * ONEKB;\n int b = (int) ( r );\n\n char *p = malloc(64);\n\n sprintf(p, \"%4dGB, %4dMB, %4dKB, %4d\", gb, mb, kb, b);\n return p;\n}\n\nint f2(int x)\n{\n char * f2_p;\n int f2_x = 21;\n\n f2_p = malloc(1000); // dynamically allocated memory\n\n // print out the address of x\n // print out the addresses of f2_p, and f2_x\n // print out the starting address of the dynamically allocated memory\n .....\n\n L: f2_x = 10;\n return f2_x;\n}\n\nvoid f1(int x1, int x2, float x3, char x4, double x5, int x6)\n{\n int f1_x = 10;\n int f1_y;\n char *f1_p1 = \"This is inside f1\"; // pointer to another string literal \n char *f1_p2;\n\n f1_p2 = malloc(100); // dynamically allocated memory\n\n // print out the addresses of x1, x2, x3, x4, x5, x6\n // print out the addresses of f1_x, f1_y, f1_p1, f1_p2\n // print out the address of the string literal \"This is inside f1\"\n .....\n\n f1_y = f2(10);\n return;\n}\n\nint main(int argc, char *argv[])\n{\n\n // print out the addresses of argc, argv\n // print out the starting address and end address of the command line arguments of this process\n // print out the starting address and end address of the environment of this process\n // print out the starting addresses of function main, f1, and f2\n // print out the addresses of global_x, global_y, global_array1, global_array2, global_pointer1,\n // global_pointer2, global_float, global_double\n // print out the addresses of string literals 10, \"Hello, world!\", \"bye\", 100.1\n\n ..... \n\n // call function f1 with suitable arguments such as 12, -5, 33.7, 'A', 1.896e-10, 100 \n f1( .... );\n\n exit(0);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI tried to search on google, but cannot find sth useful, and in this case I just want to figure out how to print out the starting address of the dynamically allocated memory; print out the starting address and end address of the command line arguments of this process;print out the starting address and end address of the environment of this process;print out the starting addresses of function main, f1, and f2.\nanybody can help me?..thank you!\u003c/p\u003e","accepted_answer_id":"12601183","answer_count":"5","comment_count":"0","creation_date":"2012-09-26 11:52:28.32 UTC","favorite_count":"1","last_activity_date":"2017-02-19 16:11:57.377 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1700115","post_type_id":"1","score":"2","tags":"c|memory-address","view_count":"1513"} +{"id":"9093806","title":"Parsing a MIME-Message using anmar.SharpMimeTools","body":"\u003cp\u003eI'm trying to parse a MIME-Message, using \u003ca href=\"http://anmar.eu.org/projects/sharpmimetools/\" rel=\"nofollow\"\u003eSharpMimeTools\u003c/a\u003e and some sample Mime Messages from \u003ca href=\"http://www.hunnysoft.com/mime/samples/index.html\" rel=\"nofollow\"\u003eHunny Software\u003c/a\u003e. I managed to create a new Message from a file and save the Decoded Body to a file (it's a png-Image), but the created file is corrupted. Mostly the the example file and the one I've exracted look the same, but there are differences.\u003c/p\u003e\n\n\u003cp\u003eThe files can be found here: \u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eThe original Message as a Text-File: \u003ca href=\"http://dl.dropbox.com/u/7247667/SO_SampleFiles/m0013.txt\" rel=\"nofollow\"\u003em0013.txt\u003c/a\u003e \u003c/li\u003e\n\u003cli\u003eThe origninal PNG-Picture: \u003ca href=\"http://dl.dropbox.com/u/7247667/SO_SampleFiles/blueball_original.png\" rel=\"nofollow\"\u003eBlueball_original.png\u003c/a\u003e \u003c/li\u003e\n\u003cli\u003eThe extracted, corrupted PNG-Picture: \u003ca href=\"http://dl.dropbox.com/u/7247667/SO_SampleFiles/blueball.png\" rel=\"nofollow\"\u003eBlueball.png\u003c/a\u003e \u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eAn excerpt of the Hex-View of the files:\u003cbr\u003e\nOriginal:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52\n00 00 00 1b 00 00 00 1b 08 03 00 00 00 ba 0a 04\n67 00 00 03 00 50 4c 54 45 ff ff ff 00 00 08 00\n00 10 00 00 18 00 00 00 00 08 29 00 10 42 00 10\n4a 00 08 31 00 10 52 08 21 73 08 29 7b 08 29 84\n08 21 6b 00 18 5a 00 08 39 08 21 63 10 39 9c 18\n42 a5 18 42 ad 18 42 b5 10 39 a5 10 31 94 00 18\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eExtracted: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e3f 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52\n00 00 00 1b 00 00 00 1b 08 03 00 00 00 3f 0a 04 \n67 00 00 03 00 50 4c 54 45 3f 3f 3f 00 00 08 00 \n00 10 00 00 18 00 00 00 00 08 29 00 10 42 00 10 \n4a 00 08 31 00 10 52 08 21 73 08 29 7b 08 29 3f\n08 21 6b 00 18 5a 00 08 39 08 21 63 10 39 3f 18\n42 3f 18 42 3f 18 42 3f 10 39 3f 10 31 3f 00 18\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e... and finally, this is the code I'm using: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic void MIMETest()\n{\n FileStream fileStream = new FileStream(@\"D:\\m0013.txt\", FileMode.Open);\n SharpMimeMessage m = new SharpMimeMessage(fileStream);\n fileStream.Close();\n parseMessage(m); \n}\n\npublic void parseMessage(SharpMimeMessage message)\n{\n if (message.IsMultipart)\n {\n foreach (SharpMimeMessage subMessage in message)\n {\n parseMessage(subMessage);\n }\n }\n else\n {\n System.IO.File.WriteAllText(@\"D:\\Extracts\\\" + message.Name,\n message.BodyDecoded, message.Header.Encoding);\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eDo you have any suggestions how to solve this problem?\u003c/p\u003e","accepted_answer_id":"9096274","answer_count":"1","comment_count":"1","creation_date":"2012-02-01 09:54:58.643 UTC","last_activity_date":"2012-02-01 13:03:06.357 UTC","last_edit_date":"2012-02-01 11:04:55.267 UTC","last_editor_display_name":"","last_editor_user_id":"1147455","owner_display_name":"","owner_user_id":"1147455","post_type_id":"1","score":"0","tags":"c#|.net|parsing|email|mime","view_count":"1047"} +{"id":"33675946","title":"Store int inside char array in C","body":"\u003cp\u003eI am trying to store int value in char array, and access it again to retrieve value later. here is what i tried, but it is not working as i am looking for. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003echar mem[50];\nint* size = (int*)\u0026amp;mem[0];\n\nchar* isFree = (char*)\u0026amp;mem[4];\n\nchar *t = (char *)\u0026amp;mem[4];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow I want to store 1234, and 'f' in the char array according to the order. (within first 5 bytes)\u003c/p\u003e\n\n\u003cp\u003eI am not allowed to use other variables, have to use char array. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eint a = 1234;\nint *size = \u0026amp;a;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eabove one is not allowed.\u003c/p\u003e","accepted_answer_id":"33676422","answer_count":"3","comment_count":"10","creation_date":"2015-11-12 16:06:48.82 UTC","favorite_count":"0","last_activity_date":"2015-11-12 16:31:42.703 UTC","last_edit_date":"2015-11-12 16:31:42.703 UTC","last_editor_display_name":"","last_editor_user_id":"2507725","owner_display_name":"","owner_user_id":"2507725","post_type_id":"1","score":"2","tags":"c|int","view_count":"670"} +{"id":"32397132","title":"Composite Graph from Crossfilter Example","body":"\u003cp\u003eStarting from the payments example crossfilter (\u003ca href=\"https://github.com/square/crossfilter/wiki/API-Reference\" rel=\"noreferrer\"\u003ehttps://github.com/square/crossfilter/wiki/API-Reference\u003c/a\u003e) how may we create a Composite Chart with one Line Chart for each payment type (tab, visa, cash)?\u003c/p\u003e","accepted_answer_id":"32575435","answer_count":"1","comment_count":"2","creation_date":"2015-09-04 11:36:24 UTC","last_activity_date":"2015-09-14 23:45:35.287 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1543501","post_type_id":"1","score":"9","tags":"dc.js","view_count":"991"} +{"id":"29830643","title":"Looping try-catch isn't working","body":"\u003cp\u003eHow would I properly loop this try catch statement? From what I'm aware, the \n\u003ccode\u003eplayerIntInput = reader.nextInt();\u003c/code\u003e within the try block is executed and it catches the exception if one exists, this should cause the \u003ccode\u003eloop = false\u003c/code\u003e to never be reached. Then it output the message in the catch block and it should loop back to the try and ask for input again. Instead I just get an infinitely looped output from the catch block.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evoid CheckInput(int playerIntInput) {\n boolean loop = true;\n\n while(loop=true) {\n try {\n playerIntInput = reader.nextInt();\n loop = false;\n }\n catch(InputMismatchException e) {\n System.out.println(\"Invalid character was used, try again.\");\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"29830674","answer_count":"1","comment_count":"3","creation_date":"2015-04-23 17:38:13.98 UTC","last_activity_date":"2015-04-23 17:47:17.337 UTC","last_edit_date":"2015-04-23 17:40:58.877 UTC","last_editor_display_name":"","last_editor_user_id":"1935128","owner_display_name":"","owner_user_id":"4825423","post_type_id":"1","score":"0","tags":"java|try-catch|user-input|infinite-loop","view_count":"60"} +{"id":"31243054","title":"Using Dart's call() method with generics","body":"\u003cp\u003eI'm trying to write a class which can be called like a function, using generics like so:\u003c/p\u003e\n\n\u003cpre class=\"lang-dart prettyprint-override\"\u003e\u003ccode\u003etypedef T FooFunction\u0026lt;T\u0026gt;(T input);\n\nclass Foo\u0026lt;T\u0026gt; {\n final FooFunction fooFunction;\n\n Converter(FooFunction\u0026lt;T\u0026gt; this.fooFunction);\n\n T call(T input) =\u0026gt; this.fooFunction(input);\n\n static final Foo\u0026lt;String\u0026gt; stringFoo = new Foo\u0026lt;String\u0026gt;((String input) =\u0026gt; input.trim());\n\n static final Foo\u0026lt;int\u0026gt; intFoo = new Foo\u0026lt;int\u0026gt;((int input) =\u0026gt; input * -1);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd I am trying to call it like so:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eString bar = Foo.stringFoo(' Hello World ');\nint baz = Foo.intFoo('5');\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis code works fine if I remove all the type hinting, but with the type hinting in there, the analyzer is complaining that \"An argument of type 'String' cannot be assigned to the parameter type 'T'\" and that \"A value of type 'T' cannot be assigned to a variable of type 'String'.\" It's clear that what's happening here is that the analyzer is seeing the \u003ccode\u003eT\u003c/code\u003e type in the definition of \u003ccode\u003eFoo.call\u003c/code\u003e and interpreting it literally, rather than in the context of the generic type.\u003c/p\u003e\n\n\u003cp\u003eIf I change my calls to the following:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eString bar = Foo.stringFoo.fooFunction(' Hello World ');\nint baz = Foo.intFoo.fooFunction('5');\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eso that they are no longer using the \u003ccode\u003ecall\u003c/code\u003e method, the analyzer understands what's happening just fine.\u003c/p\u003e\n\n\u003cp\u003eAm I doing something wrong in how I'm declaring the \u003ccode\u003ecall\u003c/code\u003e method? Is there a way to use the \u003ccode\u003ecall\u003c/code\u003e method while maintaining the proper type hinting and static analysis the same as if I were to call the method directly? Or am I doing everything right and I just need to submit a bug report to the Dart devs?\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2015-07-06 10:07:20.233 UTC","last_activity_date":"2015-07-11 09:22:42.973 UTC","last_edit_date":"2015-07-11 09:22:42.973 UTC","last_editor_display_name":"","last_editor_user_id":"2156621","owner_display_name":"","owner_user_id":"858061","post_type_id":"1","score":"1","tags":"generics|dart","view_count":"54"} +{"id":"24876024","title":"Is there a simple way in Magento to just include something?","body":"\u003cp\u003eI'm currently working on a simple process where I've built a controller that lets me know if a person's browser is not running something comparable to the setup I'm putting together. If I go to \u003ccode\u003ehttp://example.com/useraction/index/checkbrowser\u003c/code\u003e then the code will either return a commented line that reads \u003ccode\u003e\u0026lt;!--- GOOD TO GO ---\u0026gt;\u003c/code\u003e or it will return an image and link to encourage the user to upgrade their browser. I'm doing this through a controller that I have built because it does seem to work as is without all of that caching that Magento does. Let's face it, if I were to do this on the view (even though I would think of this as something that normally SHOULD be on the view) then the proper browser information would not return to the user.\u003c/p\u003e\n\n\u003cp\u003eWith this in mind I have tried the following:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eecho $this-\u0026gt;getChildHtml('/useraction/index/checkbrowser');\necho $this-\u0026gt;getChildHtml('/useraction/index/checkbrowser',false);\necho $this-\u0026gt;getLayout()-\u0026gt;createBlock('page/template')-\u0026gt;setTemplate('/useraction/index/checkbrowser')-\u0026gt;toHtml();\ninclude('/useraction/index/checkbrowser');\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNone of this is working. What am I missing?\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2014-07-21 22:39:26.26 UTC","last_activity_date":"2014-07-22 09:35:21.3 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1370953","post_type_id":"1","score":"0","tags":"php|magento|caching|controller","view_count":"25"} +{"id":"43729172","title":"Jasmine Ignoring Tests When Testing Promises","body":"\u003cp\u003eI have run into a bizarre problem. According to my log messages, the function I am testing is working correctly, but it seems to be ignoring any \u003ccode\u003eexpect\u003c/code\u003e assertions I try to supply it.\u003c/p\u003e\n\n\u003cp\u003eThis is the method under test: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003egetSessionContext(): Promise\u0026lt;ISessionContext\u0026gt; {\n let query = '{\\\n user {\\\n userId\\\n clientId\\\n partnerId\\\n userType\\\n visibleId\\\n firstName\\\n lastName\\\n emailAddress\\\n profileImageUrl\\\n }\\\n partner {\\\n id\\\n clients {\\\n clientId\\\n partnerId\\\n clientName\\\n }\\\n }\\\n }';\n\n let success = action(\"AuthService.getSessionContext\", (sessionContext: ISessionContext) =\u0026gt; {\n if (!sessionContext.user) {\n throw new Error('Request failed');\n }\n\n this.sessionContext = sessionContext;\n this.userInfo = sessionContext.user;\n this.activeClientId = this.userInfo.clientId; //default to primary client\n this.isLoggedIn = true;\n\n return sessionContext;\n });\n\n return this.graphQLService.query({query}, {unscoped: true})\n .then(success, (data) =\u0026gt; {\n console.error('Unable to get session information', data);\n }) as Promise\u0026lt;ISessionContext\u0026gt;;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand this is my current spec:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efdescribe('::getSessionContext', () =\u0026gt; {\n it('returns a valid sessionContext', () =\u0026gt; {\n spyOn(svc.graphQLService, 'query').and.returnValue(promise_STUB);\n\n console.log(`sessionContext BEFORE ${JSON.stringify(svc.sessionContext)}`);\n expect(svc.sessionContext.user).toBeFalsy();\n console.log(`userInfo BEFORE ${JSON.stringify(svc.userInfo)}`);\n\n svc.getSessionContext().then\n (\n (result) =\u0026gt; {\n console.log(`****************************`);\n console.log(`final result ${JSON.stringify(result)}`);\n console.log(`sessionContext AFTER ${JSON.stringify(svc.sessionContext)}`);\n expect(svc.sessionContext.user).toEqual({});\n\n console.log(`userInfo AFTER ${JSON.stringify(svc.userInfo)}`);\n expect(svc.userInfo).toEqual(promiseValue.user);\n\n //FIXME expect statements are being ignored\n expect(true).toBeFalsy();\n done();\n }\n );\n });\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is the terminal output:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eLOG: 'sessionContext BEFORE {\"partner\":{\"clients\":[{\"clientId\":1234},\n{\"clientId\":1235},{\"clientId\":1236},{\"clientId\":1237}]}}'\nLOG: 'userInfo BEFORE {\"partnerId\":1234,\"clientId\":1235}'\nLOG: '****************************'\nLOG: 'final result {\"user\":{}}'\nLOG: 'sessionContext AFTER {\"user\":{}}'\nLOG: 'userInfo AFTER {}'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAs you can see, the terminal output confirms the function is working. However it is completely ignoring any expect statements I try to make. Any ideas on why this is occurring?\u003c/p\u003e","accepted_answer_id":"43729537","answer_count":"1","comment_count":"0","creation_date":"2017-05-02 02:32:44.29 UTC","last_activity_date":"2017-05-02 08:09:40.08 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5031910","post_type_id":"1","score":"0","tags":"reactjs|jasmine|karma-runner","view_count":"26"} +{"id":"22474681","title":"UITableView weird separator line color","body":"\u003cp\u003ei have a problem in setting UITableViewCell background color. I wanna change it into my own color, so I use this code to change that background color : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eUIView *bg = [[UIView alloc] init];\n\n bg.backgroundColor = [ColorManager backgroundInput];\n bg.layer.masksToBounds = YES;\n [cell setSelectedBackgroundView:bg];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI implement this code in CellForRowAtIndexPath method. \u003c/p\u003e\n\n\u003cp\u003eThe weird thing I have is, when i tap into a cell, the separator line color being highlight just like the image below. I just wanna make it still dark, anybody have idea?\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/bNByf.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eThank you\u003c/p\u003e","answer_count":"4","comment_count":"1","creation_date":"2014-03-18 09:08:48.177 UTC","last_activity_date":"2014-12-30 11:45:23.083 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"515986","post_type_id":"1","score":"0","tags":"ios|iphone|ipad|uitableview","view_count":"316"} +{"id":"2198520","title":"What is null key encryption?","body":"\u003cp\u003eIn the movie Dark Knight, the batman builds some ultra powerful sonar monitoring system and encrypts it will Null Key Encryption. \u003c/p\u003e\n\n\u003cp\u003eI was reading this \u003ca href=\"http://csrc.nist.gov/archive/ipsec/papers/rfc2410-espnull.txt\" rel=\"noreferrer\"\u003eRFC\u003c/a\u003e but couldn't comprehend it. It says something like this \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eHowever there are cases when only authentication\n and integrity protection is required, and confidentiality is not\n needed or not permitted. \u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eAnd in the end he tells Fox \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eType in your name when you are finished.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eIf its that simple, why encrypt it ?\u003c/p\u003e","accepted_answer_id":"2198614","answer_count":"2","comment_count":"1","creation_date":"2010-02-04 09:28:19.343 UTC","favorite_count":"2","last_activity_date":"2016-11-18 10:41:52.617 UTC","last_edit_date":"2010-02-04 09:52:09.643 UTC","last_editor_display_name":"","last_editor_user_id":"177758","owner_display_name":"","owner_user_id":"177758","post_type_id":"1","score":"34","tags":"encryption","view_count":"19526"} +{"id":"31762556","title":"remove items with low frequency","body":"\u003cp\u003eLet's consider the array of length \u003ccode\u003en\u003c/code\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ey=np.array([1,1,1,1,2,2,2,3,3,3,3,3,2,2,2,2,1,4,1,1,1])\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand the matrix \u003ccode\u003eX\u003c/code\u003e of size \u003ccode\u003en\u003c/code\u003e x \u003ccode\u003em\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eI want to remove items of \u003ccode\u003ey\u003c/code\u003e and rows of \u003ccode\u003eX\u003c/code\u003e, for which the corresponding value of \u003ccode\u003ey\u003c/code\u003e has low frequency.\u003c/p\u003e\n\n\u003cp\u003eI figured out this would give me the values of \u003ccode\u003ey\u003c/code\u003e which should be removed:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026gt;\u0026gt;\u0026gt; items, count = np.unique(y, return_counts=True)\n\u0026gt;\u0026gt;\u0026gt; to_remove = items[count \u0026lt; 3] # array([4])\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand this would remove the items:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026gt;\u0026gt;\u0026gt; X=X[y != to_remove,:]\n\u0026gt;\u0026gt;\u0026gt; y=y[y != to_remove]\narray([1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1])\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhile the code above works when there is only one label to remove, it fails when there are multiple values of \u003ccode\u003ey\u003c/code\u003e with low frequency (i.e. \u003ccode\u003ey=np.array([1,1,1,1,2,2,2,3,3,3,3,3,2,2,2,2,1,4,1,1,1,5,5,1,1])\u003c/code\u003e would cause \u003ccode\u003eto_remove\u003c/code\u003e to be \u003ccode\u003earray([4, 5])\u003c/code\u003e):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026gt;\u0026gt;\u0026gt; y[y != to_remove,:]\nTraceback (most recent call last):\n File \"\u0026lt;input\u0026gt;\", line 1, in \u0026lt;module\u0026gt;\nIndexError: too many indices for array\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow to fix this in a concise way?\u003c/p\u003e","accepted_answer_id":"31762704","answer_count":"3","comment_count":"0","creation_date":"2015-08-01 13:48:21.203 UTC","last_activity_date":"2015-08-27 13:14:44.2 UTC","last_edit_date":"2015-08-01 14:00:28.783 UTC","last_editor_display_name":"","last_editor_user_id":"1044117","owner_display_name":"","owner_user_id":"1044117","post_type_id":"1","score":"2","tags":"python|numpy","view_count":"215"} +{"id":"10617202","title":"Displaying images from sd card in gridview android","body":"\u003cp\u003eim Displaying images from specific folder on sd Card in GridView till know all works fine all images are getting displayed on the gridview but when i change the orientation of the Screen it crashes . below is my code and Crash Log:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e import java.io.File;\n\nimport android.content.Context;\nimport android.net.Uri;\nimport android.os.Environment;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.BaseAdapter;\nimport android.widget.GridView;\nimport android.widget.ImageView;\n\n public class ImageAdapter extends BaseAdapter {\n private Context mContext;\n File root = new File(Environment.getExternalStorageDirectory()\n + File.separator + \"MYPICS\" + File.separator);\n private File[] fileName = root.listFiles();\n int count=fileName.length;\n public ImageAdapter(Context c) {\n mContext = c;\n }\n\n public int getCount() {\n return fileName.length;\n }\n\n public Object getItem(int position) {\n return null;\n }\n\n public long getItemId(int position) {\n return 0;\n }\n\n // create a new ImageView for each item referenced by the Adapter\n public View getView(int position, View convertView, ViewGroup parent) {\n\n Uri uri = Uri.fromFile(fileName[position]);\n\n ImageView imageView;\n if (convertView == null) { // if it's not recycled, initialize some attributes\n imageView = new ImageView(mContext);\n imageView.setLayoutParams(new GridView.LayoutParams(85, 85));\n imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);\n imageView.setPadding(8, 8, 8, 8);\n } else {\n imageView = (ImageView) convertView;\n }\n\n imageView.setImageURI(uri);\n return imageView;\n }\n\n\n\n\n\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am getting Memory Out Error ,Below is my Logcat:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e 05-16 16:18:31.218: E/AndroidRuntime(26907): java.lang.OutOfMemoryError: bitmap size exceeds VM budget\n05-16 16:18:31.218: E/AndroidRuntime(26907): at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)\n05-16 16:18:31.218: E/AndroidRuntime(26907): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:573)\n05-16 16:18:31.218: E/AndroidRuntime(26907): at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:439)\n05-16 16:18:31.218: E/AndroidRuntime(26907): at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:697)\n05-16 16:18:31.218: E/AndroidRuntime(26907): at android.graphics.drawable.Drawable.createFromStream(Drawable.java:657)\n05-16 16:18:31.218: E/AndroidRuntime(26907): at android.widget.ImageView.resolveUri(ImageView.java:521)\n05-16 16:18:31.218: E/AndroidRuntime(26907): at android.widget.ImageView.setImageURI(ImageView.java:305)\n05-16 16:18:31.218: E/AndroidRuntime(26907): at com.sachin.imagegrideview.ImageAdapter.getView(ImageAdapter.java:53)\n05-16 16:18:31.218: E/AndroidRuntime(26907): at android.widget.AbsListView.obtainView(AbsListView.java:1464)\n05-16 16:18:31.218: E/AndroidRuntime(26907): at android.widget.GridView.onMeasure(GridView.java:935)\n05-16 16:18:31.218: E/AndroidRuntime(26907): at android.view.View.measure(View.java:8313)\n05-16 16:18:31.218: E/AndroidRuntime(26907): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3138)\n05-16 16:18:31.218: E/AndroidRuntime(26907): at android.widget.FrameLayout.onMeasure(FrameLayout.java:250)\n05-16 16:18:31.218: E/AndroidRuntime(26907): at android.view.View.measure(View.java:8313)\n05-16 16:18:31.218: E/AndroidRuntime(26907): at android.widget.LinearLayout.measureVertical(LinearLayout.java:531)\n05-16 16:18:31.218: E/AndroidRuntime(26907): at android.widget.LinearLayout.onMeasure(LinearLayout.java:309)\n05-16 16:18:31.218: E/AndroidRuntime(26907): at android.view.View.measure(View.java:8313)\n05-16 16:18:31.218: E/AndroidRuntime(26907): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3138)\n05-16 16:18:31.218: E/AndroidRuntime(26907): at android.widget.FrameLayout.onMeasure(FrameLayout.java:250)\n05-16 16:18:31.218: E/AndroidRuntime(26907): at android.view.View.measure(View.java:8313)\n05-16 16:18:31.218: E/AndroidRuntime(26907): at android.view.ViewRoot.performTraversals(ViewRoot.java:845)\n05-16 16:18:31.218: E/AndroidRuntime(26907): at android.view.ViewRoot.handleMessage(ViewRoot.java:1865)\n05-16 16:18:31.218: E/AndroidRuntime(26907): at android.os.Handler.dispatchMessage(Handler.java:99)\n05-16 16:18:31.218: E/AndroidRuntime(26907): at android.os.Looper.loop(Looper.java:130)\n05-16 16:18:31.218: E/AndroidRuntime(26907): at android.app.ActivityThread.main(ActivityThread.java:3687)\n05-16 16:18:31.218: E/AndroidRuntime(26907): at java.lang.reflect.Method.invokeNative(Native Method)\n05-16 16:18:31.218: E/AndroidRuntime(26907): at java.lang.reflect.Method.invoke(Method.java:507)\n05-16 16:18:31.218: E/AndroidRuntime(26907): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)\n05-16 16:18:31.218: E/AndroidRuntime(26907): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)\n05-16 16:18:31.218: E/AndroidRuntime(26907): at dalvik.system.NativeStart.main(Native Method)\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"10617378","answer_count":"2","comment_count":"9","creation_date":"2012-05-16 11:04:29.64 UTC","favorite_count":"3","last_activity_date":"2012-05-16 13:37:35 UTC","last_edit_date":"2012-05-16 13:37:35 UTC","last_editor_display_name":"","last_editor_user_id":"596725","owner_display_name":"","owner_user_id":"770703","post_type_id":"1","score":"4","tags":"android|gridview|orientation","view_count":"2902"} +{"id":"12786598","title":"MySQL return inverse? results of a search or results NOT containing","body":"\u003cp\u003eA complex one here? (for me at least). I have a table called \"tickets\", with the \"id\" column being the unique key. I have another table called \"Labels\", which doesnt have a unique key (from the looks of it). In \"Tickets\" we store ticket information (messages, who made the ticket etc). We can add a label to a ticket when we create it, so that we can search for tickets with those labels e.g. \"review later\".\u003c/p\u003e\n\n\u003cp\u003eWhat I am trying to do, is a reverse type query e.g. show me all tickets that dont have a specific label associated to it e.g. dont show me any tickets with \"review later\". IF A TICKET DOESNT HAVE ANY LABELS NOTHING IS PUT IN THE LABEL TABLE. I just cant get any type of query I write, by hand or with a query builder to work. \u003c/p\u003e\n\n\u003cp\u003eIm my image, you can see Tickets.id has 174 against it, which is also shown in Labels.ticket_id 174 with 2 x Labels set against it. \u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.imgur.com/Vewmh.jpg\" alt=\"\"\u003e\u003c/p\u003e\n\n\u003cp\u003eNo matter what query, join, does, does not etc I try, I either get back no results OR for some strange reason, I still get ticket 174 showing up.\u003c/p\u003e\n\n\u003cp\u003eHere is the most simple query I have tried.. however, I think Ive tried about 30 iterations by now from simple to very complex.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e SELECT tickets.id\n FROM\n tickets, labels_tickets\n WHERE\n tickets.id \u0026lt;\u0026gt; labels_tickets.ticket_id\n GROUP BY\n tickets.id\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCan anyone suggest why this wouldnt work or think of any method to build a statment that says:\u003c/p\u003e\n\n\u003cp\u003eShow me all tickets.id from tickets that doesnt have the label \"MyLabel\" or doesnt have a value at all in the Labels table.\u003c/p\u003e\n\n\u003cp\u003eMany thanks!\u003c/p\u003e","accepted_answer_id":"12786683","answer_count":"3","comment_count":"0","creation_date":"2012-10-08 17:30:04.43 UTC","last_activity_date":"2012-10-09 20:09:41.143 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1721045","post_type_id":"1","score":"1","tags":"mysql|select|key|where","view_count":"1644"} +{"id":"36696301","title":"C# mongodb driver - update in sub array not working","body":"\u003cp\u003eI have the following model (only the improtant type):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class Model\n{\n [BsonId]\n public ObjectId ModelId;\n public List\u0026lt;Game\u0026gt; Games;\n}\npublic class Game\n{\n [BsonId]\n public ObjectId GameId;\n public List\u0026lt;Match\u0026gt; Matches;\n}\npublic class Match\n{\n [BsonId]\n public ObjectId MatchId;\n public int[] Votes;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have the following query:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar filter = Builders\u0026lt;Model\u0026gt;.Filter.And(\n Builders\u0026lt;Model\u0026gt;.Filter.Eq(x =\u0026gt; x.ModelId, modelId),\n Builders\u0026lt;Model\u0026gt;.Filter.ElemMatch(x =\u0026gt; x.Games, t =\u0026gt; t.GameId == gameId));\n\nvar update = Builders\u0026lt;Model\u0026gt;.Update.Inc(x =\u0026gt; x.Games[-1].Matches.First(t =\u0026gt; t.MatchId == matchId).Votes[1], 2);\nvar options = new FindOneAndUpdateOptions\u0026lt;Model\u0026gt;()\n{\n ReturnDocument = ReturnDocument.After\n};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIm using \u003ccode\u003eFindOneAndUpdateAsync\u003c/code\u003e and Im able to retreive the data, but no changes are made.\nTried couple of times, still no change.\u003c/p\u003e\n\n\u003cp\u003eAnswers to Comments:\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eIs something being returned?\u003c/strong\u003e \u003c/p\u003e\n\n\u003cp\u003eYes, the entire document. moreover, when I use fixed indexes, e.g: games[0].matches[0] everything works fine.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eDid I try to run command in shell?\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eNo, unfortunartly, so far I haven't tried to work with the shell\u003c/p\u003e","answer_count":"1","comment_count":"5","creation_date":"2016-04-18 14:05:27.397 UTC","last_activity_date":"2016-04-26 13:01:07.893 UTC","last_edit_date":"2016-04-18 14:55:06.85 UTC","last_editor_display_name":"","last_editor_user_id":"1190534","owner_display_name":"","owner_user_id":"1190534","post_type_id":"1","score":"0","tags":"c#|mongodb|mongodb-.net-driver|mongodb-csharp-2.0","view_count":"215"} +{"id":"36929571","title":"Getting null in second value of 2D array in java using apache poi","body":"\u003cp\u003eI am getting null in 2D array. When I print out values of array in calling method (hello) I am getting correct values but in callee (main method) I am getting null for second value when printed out\u003c/p\u003e\n\n\u003cp\u003eFollowing is the program\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epackage TestngPackage;\n\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport org.apache.poi.openxml4j.exceptions.InvalidFormatException;\nimport org.apache.poi.ss.usermodel.Cell;\nimport org.apache.poi.ss.usermodel.Row;\nimport org.apache.poi.xssf.usermodel.XSSFSheet;\nimport org.apache.poi.xssf.usermodel.XSSFWorkbook;\n\npublic class MyReadExcel {\n\n public static XSSFWorkbook workbook;\n\n public static String[][] hello() throws IOException{\n\n FileInputStream fis = new FileInputStream(new File(\"F:\\\\TestExcel\\\\Test.xlsx\"));\n workbook = new XSSFWorkbook(fis);\n XSSFSheet sheet = workbook.getSheetAt(0);\n String s[][] = new String[2][2];\n\n for (int x = 0; x \u0026lt; sheet.getLastRowNum() + 1; x++){\n Row row=sheet.getRow(x);\n\n for (Cell c : row){\n int y = 0;\n s[x][y] = c.getStringCellValue();\n //System.out.println(s[x][y]);\n y++;\n } \n\n }\n\n workbook.close();\n fis.close();\n return s;\n }\n\n public static void main(String[] args) throws InvalidFormatException, IOException {\n\n String str[][];\n str = hello();\n\n for (int x = 0; x \u0026lt; str.length; x++){\n\n for (int y = 0; y \u0026lt; str[x].length; y++){\n System.out.println(str[x][y]);\n }\n\n System.out.println();\n } \n\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"36929698","answer_count":"1","comment_count":"3","creation_date":"2016-04-29 04:30:08.267 UTC","last_activity_date":"2016-04-29 06:23:02.19 UTC","last_edit_date":"2016-04-29 06:23:02.19 UTC","last_editor_display_name":"","last_editor_user_id":"2542856","owner_display_name":"","owner_user_id":"2932012","post_type_id":"1","score":"0","tags":"java|arrays|apache-poi","view_count":"43"} +{"id":"17558781","title":"classes and importing modules into classes","body":"\u003cp\u003eI've managed to do almost no OOP since I've been using python and I'm trying to get familiar with writing classes and so on.\u003c/p\u003e\n\n\u003cp\u003eHow can I break the following class into one other function. I'd like to rather than pass two arguments to the class pass the fname first and then call a method called display for all of the xml stuff that I want to print. When I attempted to do that I ended up with Global name issues with tree.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport sys\nclass Parser(object):\n\n def __init__(self, file_name, mylist):\n\n import xml.etree.ElementTree as etree\n self.file_name = file_name\n tree = etree.parse(self.file_name)\n for node in tree.getiterator():\n for element in mylist:\n if element in node.tag:\n print(node.tag)\n\nlist2 = ['KeyId','X509SerialNumber','CompositionPlaylistId']\nfname = sys.argv[1]\nmyfileinstance =Parser(fname,list2)\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"4","creation_date":"2013-07-09 21:42:10.327 UTC","last_activity_date":"2013-07-09 21:47:08.46 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1124541","post_type_id":"1","score":"0","tags":"python","view_count":"44"} +{"id":"45048392","title":"Disable postman dowload popup","body":"\u003cp\u003eI use postman collection runner to test that my services are up.\u003c/p\u003e\n\n\u003cp\u003eI have a POST request that return a pdf file.\u003c/p\u003e\n\n\u003cp\u003eWhen it comes to that request, I have a popup asking to download the pdf file.\u003c/p\u003e\n\n\u003cp\u003eFor testing that my request is ok, I just need the return code 200. I want to disable this download popup.\u003c/p\u003e\n\n\u003cp\u003eDo you know how to do that?\u003c/p\u003e\n\n\u003cp\u003ePS: I am using postman chrome app.\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-07-12 04:22:16.853 UTC","last_activity_date":"2017-07-12 04:22:16.853 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1529441","post_type_id":"1","score":"0","tags":"postman","view_count":"7"} +{"id":"31007637","title":"Prepend select box in text field form rails","body":"\u003cp\u003eIs there an easy way to prepend a select box or dropdown box with input to a text field in rails? I am using Twitter bootstrap, and I am able to get the select box added in, but styling is not working so well. So far I have tried two things:\u003c/p\u003e\n\n\u003cp\u003e1.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;%= f.text_field :var, label: \"Test Box\", class: 'form-control',\n placeholder: \"Test Stuff\", prepend: f.select(:options,\n options_for_select(...) %\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis gets the overall bootstrap styling to the select box, but for some reason it is reading \u003ccode\u003e:options\u003c/code\u003e as a label, and I can't get it to assign anything to it. \u003c/p\u003e\n\n\u003cp\u003e2.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;%= f.text_field :var, label: \"Test Box\", class: 'form-control',\n placeholder: \"Test Stuff\", prepend: f.select_without_bootstrap(:options,\n options_for_select(...) %\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis gets the select box in there correctly, but it is not styled (hence the \u003ccode\u003ewithout_bootstrap\u003c/code\u003e and I am having a difficult time styling it.\u003c/p\u003e\n\n\u003cp\u003eSo I am wondering if there is a better way to do this, or if this is even a possibility in general? I know I could also add it as a separate field entirely and just align it next to it, but I am trying to do it into the same field. Any help is appreciated! \u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-06-23 15:52:10.277 UTC","favorite_count":"1","last_activity_date":"2015-06-23 15:54:17.157 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2963406","post_type_id":"1","score":"0","tags":"css|ruby-on-rails|twitter-bootstrap","view_count":"82"} +{"id":"3932873","title":"Converting WPF Browser App to WPF Desktop App","body":"\u003cp\u003eWithout copying all the code from one project to another, is it possible to convert an XBAP browser app into a WPF forms app?\u003c/p\u003e","accepted_answer_id":"4083449","answer_count":"2","comment_count":"0","creation_date":"2010-10-14 12:04:56.03 UTC","last_activity_date":"2010-11-22 00:27:09.417 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"166556","post_type_id":"1","score":"2","tags":"wpf|xaml|xbap","view_count":"1293"} +{"id":"9259413","title":"Cocos2D: Access objects CGRect from a loop","body":"\u003cp\u003eExperimenting with Cocos2D collection detection and have some questions. First, some background:\u003c/p\u003e\n\n\u003cp\u003eThis is my method for adding a new item to my game, located in a different class than my game layer. This is located in my Item-class:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e-(void) addItem:(NSString *) theFileName: (NSMutableArray *) theArray{\n\n CCSprite *item = [CCSprite spriteWithFile:theFileName\n rect:CGRectMake(0, 0, 50, 50 )];\n\n //Positions\n\n\n int minX = 160;\n int maxX = 360; \n int xRange = maxX - minX;\n int xCord = (arc4random() % xRange) + minX;\n\n\n item.position = ccp(xCord, -5);\n\n [self addChild:item];\n\n [theArray addObject:item];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThen I use this method in my game layer, using a reference to the Item-class called ItemManager:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[ItemManager addItem:@\"box.png\" :itemList]; \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf I want to detect collision between two sprites, in this case a box and something else, I need to be able to use the box rect created in the addItem-method.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efor(CCSprite *newItem in itemList){\n//(if box rectangle collides with my players or whatever \n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo how can I acces the rectangle created all the way back in the original method? \u003c/p\u003e\n\n\u003cp\u003eThank you. \u003c/p\u003e","accepted_answer_id":"9259582","answer_count":"1","comment_count":"0","creation_date":"2012-02-13 11:06:43.177 UTC","last_activity_date":"2012-02-13 11:21:05.41 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1206611","post_type_id":"1","score":"0","tags":"objective-c|cocos2d-iphone|collision-detection","view_count":"188"} +{"id":"25463238","title":"java Swing summation of the two columns","body":"\u003cp\u003eI have made a GUI with Swing which extends Jframe,there are 6 columns in my jtable.I read data\nfrom a text file,in column 4 and column 5 there are values 100 and 200,so i want when user edits in column 4 and puts 160 instead of 100 column 5 automatically changes to 140 or user \nedits in column 5 say 280 instead of 200 column 4 automatically changes to 20.here is my code.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport java.awt.*;\nimport java.awt.event.*;\nimport java.io.*;\nimport java.util.*;\nimport javax.swing.*;\nimport javax.swing.table.*;\n\n public class Cs extends JFrame\n {\n private JTable table;\n private DefaultTableModel model;\n\n public Cs()\n {\n String aLine ;\n Vector columnNames = new Vector();\n Vector data = new Vector();\n\n try\n {\n FileInputStream fin = new FileInputStream(\"cs.txt\");\n BufferedReader br = new BufferedReader(new InputStreamReader(fin));\n\n\n\n StringTokenizer st1 = new StringTokenizer(br.readLine(), \" \");\n\n while( st1.hasMoreTokens() )\n {\n columnNames.addElement(st1.nextToken());\n }\n\n\n\n while ((aLine = br.readLine()) != null)\n {\n StringTokenizer st2 = new StringTokenizer(aLine, \" \");\n Vector row = new Vector();\n\n while(st2.hasMoreTokens())\n {\n row.addElement(st2.nextToken());\n }\n data.addElement( row );\n }\n br.close();\n }\n catch (Exception e)\n {\n e.printStackTrace();\n }\n\n\n\n model = new DefaultTableModel(data, columnNames);\n table = new JTable(model);\n\n JScrollPane scrollPane = new JScrollPane( table );\n getContentPane().add( scrollPane );\n }\n\n public static void main(String[] args)\n {\n Cs frame = new Cs();\n frame.setDefaultCloseOperation( EXIT_ON_CLOSE );\n frame.pack();\n frame.setVisible(true);\n }\n\n }\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"25463773","answer_count":"1","comment_count":"2","creation_date":"2014-08-23 14:59:23.403 UTC","last_activity_date":"2014-08-24 16:46:31.013 UTC","last_edit_date":"2014-08-24 14:14:55.087 UTC","last_editor_display_name":"","last_editor_user_id":"3970221","owner_display_name":"","owner_user_id":"3970221","post_type_id":"1","score":"-2","tags":"java|swing|jtable","view_count":"161"} +{"id":"28110598","title":"How can I make this code if and else?","body":"\u003cp\u003eHow can I make this code if and else?\nIf 'Rental' is true do this.... else... do the false bit. I'm getting lost in the PHP tags.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php \n if( get_post_meta($post-\u0026gt;ID, 'Rental', true) ) { \n?\u0026gt;\n\u0026lt;li style=\"padding:3px 10px; line-height: 18px; height:34px\"\u0026gt;\u0026lt;strong\u0026gt;\u0026lt;?php _e( 'Rental Potential / Actual', 'spanglishwebs' ) ?\u0026gt;:\u0026lt;/strong\u0026gt; \u0026lt;?php \n $priceWithoutFormat = get_custom_field('Rental');\n $priceWithFormat = number_format($priceWithoutFormat, 0, ',', '.');\n echo $priceWithFormat; \n?\u0026gt;\u0026amp;euro;/Annual \u0026lt;/li\u0026gt;\n\u0026lt;?php \n }\n if( get_post_meta($post-\u0026gt;ID, 'Rental', false) ) { \n?\u0026gt;\n\u0026lt;li\u0026gt;Rental Potential / Actual: N/A\u0026lt;/li\u0026gt;\n\u0026lt;?php \n } \n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"28110855","answer_count":"1","comment_count":"3","creation_date":"2015-01-23 13:05:19.063 UTC","last_activity_date":"2015-01-23 13:20:22.73 UTC","last_edit_date":"2015-01-23 13:14:26.65 UTC","last_editor_display_name":"","last_editor_user_id":"3478852","owner_display_name":"","owner_user_id":"2558317","post_type_id":"1","score":"-7","tags":"php|html","view_count":"54"} +{"id":"19858670","title":"Get an image from web with authentication","body":"\u003cp\u003eIn my iOS app I need to load an image from web, but this image is on a server in which it's necessary to give username and password. I tried to use this code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e - (void) loadImageFromWeb:(NSString *)urlImg {\n NSURL* url = [NSURL URLWithString:urlImg];\n NSURLRequest* request = [NSURLRequest requestWithURL:url];\n\n\n [NSURLConnection sendAsynchronousRequest:request\n queue:[NSOperationQueue mainQueue]\n completionHandler:^(NSURLResponse * response,\n NSData * data,\n NSError * error) {\n if (!error){\n UIImage* image = [[UIImage alloc] initWithData:data];\n [self.imageObjectScanned setImage:image];\n } else {\n NSLog(@\"ERRORE: %@\", error);\n }\n\n }];\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut it return an error and says that: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eError Domain=NSURLErrorDomain Code=-1012 \"The operation couldn’t be completed. (NSURLErrorDomain error -1012.)\" UserInfo=0x14e6b420 {NSErrorFailingURLKey=http://54.204.6.246/magento8/media/catalog/product/cache/0/image/9df78eab33525d08d6e5fb8d27136e95/s/c/scheda_non_shop.jpg, NSErrorFailingURLStringKey=http://54.204.6.246/magento8/media/catalog/product/cache/0/image/9df78eab33525d08d6e5fb8d27136e95/s/c/scheda_non_shop.jpg, NSUnderlyingError=0x14e695c0 \"The operation couldn’t be completed. (kCFErrorDomainCFNetwork error -1012.)\"}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI guess this error it's because I'm not sending the username and the password. How I can send username and password to load this image?\u003c/p\u003e","accepted_answer_id":"19859878","answer_count":"3","comment_count":"2","creation_date":"2013-11-08 12:02:12.26 UTC","last_activity_date":"2013-11-08 13:39:50.247 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1859189","post_type_id":"1","score":"1","tags":"ios|iphone|objective-c|uiimageview|nsurl","view_count":"1767"} +{"id":"8545459","title":"How can I speed up Ruby/Rake task","body":"\u003cp\u003erake --tasks takes about 18s to run. This is just the time it takes to load all the tasks, as a result any task I define will take at least this amount of time to run :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$time rake --tasks\nrake db:clean # Cleaning up database\nrake passenger:restart # Restart Application\nrake spec # Run specs\n\nreal 0m18.816s\nuser 0m7.306s\nsys 0m5.665s\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy Rakefile :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$: \u0026lt;\u0026lt; \".\"\nrequire \"rubygems\"\nrequire \"rspec/core/rake_task\"\n\ndesc \"Run those specs\"\ntask :spec do\n RSpec::Core::RakeTask.new(:spec) do |t|\n t.rspec_opts = %w{--colour --format progress}\n t.pattern = 'spec/*_spec.rb'\n end\nend\n\ntask :default =\u0026gt; :spec\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny idea why rake takes to much times ?\nThanks\u003c/p\u003e","answer_count":"4","comment_count":"3","creation_date":"2011-12-17 14:41:15.893 UTC","last_activity_date":"2016-12-14 16:33:38.237 UTC","last_edit_date":"2011-12-17 15:55:17.33 UTC","last_editor_display_name":"","last_editor_user_id":"395691","owner_display_name":"","owner_user_id":"395691","post_type_id":"1","score":"8","tags":"ruby|rake|sinatra","view_count":"2572"} +{"id":"19548749","title":"Dynamically toggling tinymce toolbar with checkbox for multiple ID's?","body":"\u003cp\u003eI have multiple text boxes in a form that open with the tinymce toolbar loaded in them.\nHere are some of the text areas'\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;p id=\"rsvpInfo\" style=\"display:none;\"\u0026gt;\u0026lt;label class=\"leftLabel\"\u0026gt;RSVP Info\u0026lt;/label\u0026gt;\u0026lt;textarea name=\"rsvp_info\" rows=\"10\" cols=\"50\" class=\"contact mceNoEditor mceBasicEditor\"\u0026gt;\u0026lt;/textarea\u0026gt;\u0026lt;/p\u0026gt;\n\n\n\n\u0026lt;p id=\"abstract\" style=\"display:none;\"\u0026gt;\u0026lt;label class=\"leftLabel\"\u0026gt;Abstract\u0026lt;/label\u0026gt;\u0026lt;textarea name=\"abstract\" rows=\"10\" cols=\"50\" class=\"contact mceNoEditor mceBasicEditor\"\u0026gt;\u0026lt;/textarea\u0026gt;\u0026lt;/p\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am trying to make a check box outside the form which is initially \u003cstrong\u003echecked\u003c/strong\u003e. Once i uncheck it, then all of the tinmcy toolbars disappear and only plain text area are displayed and vice versa.\u003c/p\u003e\n\n\u003cp\u003eI decided to use the following code (outside the form) to implement my idea but it seems as if I am doing something wrong as nothing happens on checking/unchecking the checkbox.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;script\u0026gt;\n var id = 'speakerInfo';\n var id1= 'rsvpInfo';\n var id2= 'abstract';\n var id3= 'speakerBios';\n\n if($(\"#mceCheck\".is(':checked'))\n {\n tinymce.execCommand('mceAddControl',false, id);\n tinymce.execCommand('mceAddControl',false, id1);\n tinymce.execCommand('mceAddControl',false, id2);\n tinymce.execCommand('mceAddControl',false, id3);\n }\n else\n {\n tinymce.execCommand('mceRemoveControl',false, id);\n tinymce.execCommand('mceRemoveControl',false, id1);\n tinymce.execCommand('mceRemoveControl',false, id2);\n tinymce.execCommand('mceRemoveControl',false, id3);\n }\n\u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is the code for the checkbox:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;form\u0026gt;\n \u0026lt;input type=\"checkbox\" name=\"mce\" value=\"1\" id=\"mceCheck\" checked\u0026gt; tinyMCE toolbar toggle checkbox\n \u0026lt;/form\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCan someone help me out with the jquery to dynamically change the visibilty of the tinyMCE toolbar with a checkbox?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-10-23 17:44:46.097 UTC","last_activity_date":"2013-10-23 18:11:23.497 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2441391","post_type_id":"1","score":"0","tags":"jquery|tinymce","view_count":"591"} +{"id":"6365871","title":"How to enter a Date into a table in TSQL? (Error converting data type varchar to datetime)","body":"\u003cp\u003eI want to enter 30/10/1988 as the date to a DOB column in a table using a procedure\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ealter procedure addCustomer \n@userName varchar(50),\n@userNIC varchar(50), \n@userPassword varchar(100), \n@userDOB datetime, \n@userTypeID int, \n@userEmail varchar(50), \n@userTelephone int, \n@userAddress char(100),\n@userCityID int,\n@status int output\nas\n\n declare @userID int\n declare @eid int\n declare @tid int\n declare @aid int\n\n execute getLastRaw 'userID','tblUserParent', @userID output\n\n insert into tblUserParent values (@userID, @userName, @userNIC, @userPassword, @userDOB, @userTypeID)\n\n execute getLastRaw 'addressID','tblAddress', @aid output\n\n insert into tblAddress values (@aid, @userAddress, @userID, @userCityID)\n\n execute getLastRaw 'emailID','tblEmail', @eid output\n\n insert into tblEmail values (@eid, @userEmail, @userID)\n\n execute getLastRaw 'telephoneID','tblTelephoneNO', @tid output\n\n insert into tblTelephoneNO values (@tid, @userTelephone , @userID)\n insert into tblUserCustomer values (@userID, @eid , @tid, @aid)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e...but it gives an error when i enter like this '30/10/1988'\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eMsg 8114, Level 16, State 5, Procedure addCustomer, Line 0 Error converting data type varchar to datetime.\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e...but when I enter like only the 30/10/1988\nIncorrect syntax near '/'\u003c/p\u003e\n\n\u003cp\u003eHow do I fix this?\u003c/p\u003e","accepted_answer_id":"6365912","answer_count":"4","comment_count":"0","creation_date":"2011-06-16 00:18:23.63 UTC","last_activity_date":"2011-06-16 01:41:27.49 UTC","last_edit_date":"2011-06-16 01:41:27.49 UTC","last_editor_display_name":"","last_editor_user_id":"127880","owner_display_name":"","owner_user_id":"800113","post_type_id":"1","score":"1","tags":"sql|tsql|syntax","view_count":"12356"} +{"id":"27518844","title":"Error when serving html with WSGI","body":"\u003cp\u003eI am trying to make an application that serves a simple HTML form to the user and then calls a function when the user submits the form. It uses wsgiref.simple_server to serve the HTML. The server is encountering an error and I can't understand why. The code is as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#!/usr/bin/python3\nfrom wsgiref.simple_server import make_server\nfrom wsgiref.util import setup_testing_defaults\nimport webbrowser # open user's web browser to url when server is run\nfrom sys import exc_info\nfrom traceback import format_tb\n\n# Easily serves an html form at path_to_index with style at path_to_style\n# Calls on_submit when the form is submitted, passing a dictionary with key\n# value pairs { \"input name\" : submitted_value }\nclass SimpleServer:\n def __init__(self, port=8000, on_submit=None, index_path=\"./index.html\", css_path=\"./style.css\"):\n self.port = port\n self.on_submit = on_submit\n self.index_path = index_path\n self.css_path = css_path\n\n # Forwards request to proper method, or returns 404 page\n def wsgi_app(self, environ, start_response):\n urls = [\n (r\"^$\", self.index),\n (r\"404$\", self.error_404),\n (r\"style.css$\", self.css)\n ]\n\n path = environ.get(\"PATH_INFO\", \"\").lstrip(\"/\")\n # Call another application if they called a path defined in urls\n for regex, application in urls:\n match = re.search(regex, path)\n # if the match was found, return that page\n if match:\n environ[\"myapp.url_args\"] = match.groups()\n return application(environ, start_response)\n return error_404(environ, start_response)\n\n # Gives the user a form to submit all their input. If the form has been \n # submitted, it sends the ouput of self.on_submit(user_input)\n def index(self, environ, start_response):\n # user_input is a dictionary, with keys from the names of the fields\n user_input = parse_qs(environ['QUERY_STRING'])\n\n # return either the form or the calculations\n index_html = open(self.index_path).read()\n body = index_html if user_input == {} else calculate(user_input)\n mime_type = \"text/html\" if user_input == {} else \"text/plain\"\n\n # return the body of the message\n status = \"200 OK\"\n headers = [ (\"Content-Type\", mime_type), \n (\"Content-Length\", str(len(body))) ]\n start_response(status, headers)\n return [body.encode(\"utf-8\")]\n\n\n def start_form(self):\n httpd = make_server('', self.port, ExceptionMiddleware(self.wsgi_app))\n url = \"http://localhost:\" + str(self.port)\n print(\"Visit \" + url)\n # webbrowser.open(url)\n httpd.serve_forever()\n\nif __name__ == \"__main__\":\n server = SimpleServer()\n server.start_form()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I run it, I get the error\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e127.0.0.1 - - [16/Dec/2014 21:15:57] \"GET / HTTP/1.1\" 500 0\nTraceback (most recent call last):\n File \"/usr/lib/python3.4/wsgiref/handlers.py\", line 138, in run\n self.finish_response()\n File \"/usr/lib/python3.4/wsgiref/handlers.py\", line 180, in finish_response\n self.write(data)\n File \"/usr/lib/python3.4/wsgiref/handlers.py\", line 266, in write\n \"write() argument must be a bytes instance\"\nAssertionError: write() argument must be a bytes instance\n127.0.0.1 - - [16/Dec/2014 21:15:57] \"GET / HTTP/1.1\" 500 59\n----------------------------------------\nException happened during processing of request from ('127.0.0.1', 49354)\nTraceback (most recent call last):\n File \"/usr/lib/python3.4/wsgiref/handlers.py\", line 138, in run\n self.finish_response()\n File \"/usr/lib/python3.4/wsgiref/handlers.py\", line 180, in finish_response\n self.write(data)\n File \"/usr/lib/python3.4/wsgiref/handlers.py\", line 266, in write\n \"write() argument must be a bytes instance\"\nAssertionError: write() argument must be a bytes instance\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \"/usr/lib/python3.4/wsgiref/handlers.py\", line 141, in run\n self.handle_error()\n File \"/usr/lib/python3.4/wsgiref/handlers.py\", line 368, in handle_error\n self.finish_response()\n File \"/usr/lib/python3.4/wsgiref/handlers.py\", line 180, in finish_response\n self.write(data)\n File \"/usr/lib/python3.4/wsgiref/handlers.py\", line 274, in write\n self.send_headers()\n File \"/usr/lib/python3.4/wsgiref/handlers.py\", line 331, in send_headers\n if not self.origin_server or self.client_is_modern():\n File \"/usr/lib/python3.4/wsgiref/handlers.py\", line 344, in client_is_modern\n return self.environ['SERVER_PROTOCOL'].upper() != 'HTTP/0.9'\nTypeError: 'NoneType' object is not subscriptable\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \"/usr/lib/python3.4/socketserver.py\", line 305, in _handle_request_noblock\n self.process_request(request, client_address)\n File \"/usr/lib/python3.4/socketserver.py\", line 331, in process_request\n self.finish_request(request, client_address)\n File \"/usr/lib/python3.4/socketserver.py\", line 344, in finish_request\n self.RequestHandlerClass(request, client_address, self)\n File \"/usr/lib/python3.4/socketserver.py\", line 669, in __init__\n self.handle()\n File \"/usr/lib/python3.4/wsgiref/simple_server.py\", line 133, in handle\n handler.run(self.server.get_app())\n File \"/usr/lib/python3.4/wsgiref/handlers.py\", line 144, in run\n self.close()\n File \"/usr/lib/python3.4/wsgiref/simple_server.py\", line 35, in close\n self.status.split(' ',1)[0], self.bytes_sent\nAttributeError: 'NoneType' object has no attribute 'split'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis output doesn't actually include the script I am running, which I am confused about. Any thoughts? \u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2014-12-17 05:24:08.633 UTC","last_activity_date":"2016-07-29 09:55:38.113 UTC","last_edit_date":"2014-12-22 22:36:18.673 UTC","last_editor_display_name":"","last_editor_user_id":"2443833","owner_display_name":"","owner_user_id":"2443833","post_type_id":"1","score":"4","tags":"python|wsgi|wsgiref","view_count":"1399"} +{"id":"8636280","title":". Is there any automatic way to android id text is long to make font smaller or break new line but respecting grammar rules ( break on space )?","body":"\u003cp\u003eI need to dynamically add new TextViews ( fixed length displayWidth/numberOdCells) in LinearLayout (orientation=\"horizontal\"). Problem is that text can be long. Is there any automatic way to android id text is long to make font smaller or break new line but respecting grammar rules ( break on space ) ?\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2011-12-26 13:38:39.437 UTC","last_activity_date":"2011-12-26 13:38:39.437 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"486578","post_type_id":"1","score":"0","tags":"android|android-widget","view_count":"56"} +{"id":"42315195","title":"Java SWT Centralize absolute composite on screen","body":"\u003cp\u003eI am developing an application and my employer demands that it should have an absolute size (1024 x 768). Is it possible to insert this absolute composite into another composite with fill layout (or any other) and set the absolute layout to be always centralized?\u003c/p\u003e\n\n\u003cp\u003eI am fairly new to developing screens, so I'm confused with this concept.\u003c/p\u003e\n\n\u003cp\u003eThanks in advance.\u003c/p\u003e","accepted_answer_id":"42346239","answer_count":"1","comment_count":"3","creation_date":"2017-02-18 12:34:49.31 UTC","last_activity_date":"2017-02-20 13:46:16.843 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6849093","post_type_id":"1","score":"0","tags":"java|swt","view_count":"68"} +{"id":"13893430","title":"Getting the first element in string/list","body":"\u003cp\u003eOK, I have file with this data:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edata = \"\"\"4,sons,hey,what,Z,U \n 3,dogs,watch,who,U,H\n 2,times,did,1,won,G\"\"\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm wondering, How can I extract the first element from this data?\u003c/p\u003e\n\n\u003cp\u003eIn this case first place is number so I tried:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efilter(str.isdigit, data)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut since I have other numbers in data its not working for me. Any new ideas?\u003c/p\u003e","accepted_answer_id":"13893448","answer_count":"1","comment_count":"0","creation_date":"2012-12-15 15:21:24.78 UTC","favorite_count":"0","last_activity_date":"2012-12-15 15:23:35.34 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1319368","post_type_id":"1","score":"0","tags":"python","view_count":"74"} +{"id":"47509267","title":"Complexity of NP classes","body":"\u003cp\u003eSince P problems are problems whereby the algorithms needed to solve them can be done in polynomial or less time, is it fair to say that NP problems are problems whereby there does not exist a polynomial algorithm to solve it? \u003c/p\u003e\n\n\u003cp\u003eBasically, are all problems that require an algorithm complexity of more than polynomial considered to be NP? \u003c/p\u003e\n\n\u003cp\u003eAnd so does P=NP basically says, \"is there a way to solve problems that all along have been solved using algorithms that take longer than polynomial time, but this time solving them in polynomial time?\"\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2017-11-27 10:56:34.493 UTC","last_activity_date":"2017-11-27 14:26:51.743 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2519193","post_type_id":"1","score":"-2","tags":"algorithm","view_count":"41"} +{"id":"42765975","title":"no show query in php with msg :mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean","body":"\u003ch1\u003eno show query in php\u003c/h1\u003e\n\n\u003cp\u003eits code for show query :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$query = \"SELECT input,idcode,code,org_promision,your_persent,persent,family,name,id FROM student WHERE level LIKE '{$level}'\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e$level getstring input .i give print and show $level.but not work in query.\u003c/p\u003e\n\n\u003cp\u003ei show all code about this page in below :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\n if (isset($_POST[\"submit\"])){\n $level=trim($_POST[\"level\"]);\n echo \"\u0026lt;br\u0026gt;\u0026lt;h3 style='color: white;direction: rtl;font-family: IranNastaliq'\u0026gt;\".$level.\"\u0026lt;/h3\u0026gt;\";\n $query = \"SELECT input,idcode,code,org_promision,your_persent,persent,family,name,id FROM student WHERE level LIKE \".$level;\n $results = mysqli_query($mysqli, $query);\n $bfi = \"\";\n while ($row = mysqli_fetch_array($results) ) {\n {\n\n echo \"\u0026lt;tr style='font-family: sobhanfont,serif'\u0026gt;\";\n foreach ($row as $field) {\n if ($field == $bfi) {\n\n echo '\u0026lt;td style=\"text-align: center\"\u0026gt; sa' . htmlspecialchars($field) . '\u0026lt;/td\u0026gt;';\n\n $bfi = $field;\n // }\n }\n\n echo '\u0026lt;/tr\u0026gt;';\n }\n }\n }\n ?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003ephp show me : mysqli_fetch_array() expects parameter 1 to be\n mysqli_result, boolean\u003c/p\u003e\n\u003c/blockquote\u003e","answer_count":"0","comment_count":"5","creation_date":"2017-03-13 14:23:08.743 UTC","last_activity_date":"2017-03-13 14:28:50.79 UTC","last_edit_date":"2017-03-13 14:28:50.79 UTC","last_editor_display_name":"","last_editor_user_id":"7031887","owner_display_name":"","owner_user_id":"7031887","post_type_id":"1","score":"0","tags":"php|sql|mysqli","view_count":"12"} +{"id":"16311728","title":"google earth interactive elements","body":"\u003cp\u003eIs it possible to have interactive elements (e.g. polygon responding to drag and click events) in Google Earth (I specifically need Google Earth, not Google Earth Plugin!)\nThe documentation doesn't seem to be helpful as most of the activity has moved towards the plugin, but the project in question is using Google Earth. I know I have full access to JavaScript and WebKit inside the balloons, but can I use JavaScript to access KML elements and assign event listeners to them?\u003c/p\u003e\n\n\u003cp\u003eUPDATE: \nLet's say I want to use Google Earth to control a web cam. The KML would show the region of the field of view of the camera. I would like to be able to drag that region, have JavaScript handle that dragging and invoke a web service which would rotate the webcam accordingly.\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2013-05-01 02:04:16.67 UTC","last_activity_date":"2013-05-02 00:12:39.967 UTC","last_edit_date":"2013-05-01 19:09:06.95 UTC","last_editor_display_name":"","last_editor_user_id":"68105","owner_display_name":"","owner_user_id":"68105","post_type_id":"1","score":"1","tags":"kml|google-earth","view_count":"501"} +{"id":"20064610","title":"What's the \"right\" way to organize GUI code?","body":"\u003cp\u003eI'm working on a fairly sophisticated GUI program to be deployed with MATLAB Compiler. (There are good reasons MATLAB is being used to build this GUI, that is not the point of this question. I realize GUI-building is not a strong suit for this language.)\u003c/p\u003e\n\n\u003cp\u003eThere are quite a few ways to share data between functions in a GUI, or even pass data between GUIs within an application:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003ccode\u003esetappdata/getappdata/_____appdata\u003c/code\u003e - associate arbitrary data to a handle\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eguidata\u003c/code\u003e - typically used with GUIDE; \"store[s] or retrieve[s] GUI data\" to a structure of handles\u003c/li\u003e\n\u003cli\u003eApply a \u003ccode\u003eset/get\u003c/code\u003e operation to the \u003ccode\u003eUserData\u003c/code\u003e property of a handle object\u003c/li\u003e\n\u003cli\u003eUse nested functions within a main function; basically emulates \"globally\" scoping variables.\u003c/li\u003e\n\u003cli\u003ePass the data back and forth among subfunctions\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eThe structure for my code is not the prettiest. Right now I have the engine segregated from the front-end (good!) but the GUI code is pretty spaghetti-like. Here's a skeleton of an \"activity\", to borrow Android-speak:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction myGui\n\n fig = figure(...); \n\n % h is a struct that contains handles to all the ui objects to be instantiated. My convention is to have the first field be the uicontrol type I'm instantiating. See draw_gui nested function\n\n h = struct([]);\n\n\n draw_gui;\n set_callbacks; % Basically a bunch of set(h.(...), 'Callback', @(src, event) callback) calls would occur here\n\n %% DRAW FUNCTIONS\n\n function draw_gui\n h.Panel.Panel1 = uipanel(...\n 'Parent', fig, ...\n ...);\n\n h.Panel.Panel2 = uipanel(...\n 'Parent', fig, ...\n ...);\n\n\n draw_panel1;\n draw_panel2;\n\n function draw_panel1\n h.Edit.Panel1.thing1 = uicontrol('Parent', h.Panel.Panel1, ...);\n end\n function draw_panel2\n h.Edit.Panel2.thing1 = uicontrol('Parent', h.Panel.Panel2, ...);\n end\n\n\n end\n\n %% CALLBACK FUNCTIONS\n % Setting/getting application data is done by set/getappdata(fig, 'Foo').\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have previously-written code where nothing is nested, so I ended up passing \u003ccode\u003eh\u003c/code\u003e back and forth everywhere (since stuff needed to be redrawn, updated, etc) and \u003ccode\u003esetappdata(fig)\u003c/code\u003e to store actual data. In any case, I've been keeping one \"activity\" in a single file, and I'm sure this is going to be a maintenance nightmare in the future. Callbacks are interacting with both application data and graphical handle objects, which I suppose is necessary, but that's preventing a complete segregation of the two \"halves\" of the code base.\u003c/p\u003e\n\n\u003cp\u003eSo I'm looking for some organizational/GUI design help here. Namely:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eIs there a directory structure I ought to be using to organize? (Callbacks vs drawing functions?)\u003c/li\u003e\n\u003cli\u003eWhat's the \"right way\" to interact with GUI data and keep it segregated from application data? (When I refer to GUI data I mean \u003ccode\u003eset/get\u003c/code\u003eting properties of handle objects).\u003c/li\u003e\n\u003cli\u003eHow do I avoid putting all these drawing functions into one giant file of thousands of lines and still efficiently pass both application and GUI data back and forth? Is that possible?\u003c/li\u003e\n\u003cli\u003eIs there any performance penalty associated with constantly using \u003ccode\u003eset/getappdata\u003c/code\u003e?\u003c/li\u003e\n\u003cli\u003eIs there any structure my back-end code (3 object classes and a bunch of helper functions) should take to make it easier to maintain from a GUI perspective?\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eI'm not a software engineer by trade, I just know enough to be dangerous, so I'm sure these are fairly basic questions for seasoned GUI developers (in any language). I almost feel like the lack of a GUI design standard in MATLAB (does one exist?) is seriously interfering with my ability to complete this project. This is a MATLAB project that is much more massive than any I've ever undertaken, and I've never had to give much thought to complicated UIs with multiple figure windows, etc., before.\u003c/p\u003e","accepted_answer_id":"20083075","answer_count":"5","comment_count":"2","creation_date":"2013-11-19 06:23:33.607 UTC","favorite_count":"26","last_activity_date":"2017-07-06 09:05:43.31 UTC","last_edit_date":"2014-06-06 21:19:55.297 UTC","last_editor_display_name":"","last_editor_user_id":"2778484","owner_display_name":"","owner_user_id":"238644","post_type_id":"1","score":"25","tags":"matlab|user-interface|matlab-guide|matlab-deployment","view_count":"13490"} +{"id":"24041392","title":"How to map controller method to URL with anchor?","body":"\u003cp\u003eI'm trying to create mapping for this url in my controller class:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@RequestMapping(\"/book/read/{bookId}#page-{pageNumber}\")\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOn result page i want to see preloaded page (for example 5) and empty pages for all others, they will be loaded via ajax. \u003c/p\u003e\n\n\u003cp\u003eIf i send request to \u003ca href=\"http://mylocalhost.test:8080/book/read/538f10bfe4b0afcc723edb88#page-5\" rel=\"nofollow\"\u003ehttp://mylocalhost.test:8080/book/read/538f10bfe4b0afcc723edb88#page-5\u003c/a\u003e i see no handler method for such url message in log file\u003c/p\u003e\n\n\u003cp\u003eI think Spring ignore everything after # when trying to resolve handler method, but at the same time Spring allows me to make mapping with anchors in my controller method.\nSpring looks this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e/book/read/538f10bfe4b0afcc723edb88\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut my method mapped to this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e/book/read/538f10bfe4b0afcc723edb88#page-5\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOf course if i change mapping to \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@RequestMapping(\"/book/read/{bookId}/page-{pageNumber}\")\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003erequests for this url starts work as expected. But i need this anchor positioning in my browser.\u003c/p\u003e\n\n\u003cp\u003eIs it possible to get this anchor feature in this way? \u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2014-06-04 15:21:00.54 UTC","last_activity_date":"2014-06-04 15:21:00.54 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"887536","post_type_id":"1","score":"0","tags":"spring|spring-mvc","view_count":"537"} +{"id":"3997368","title":"Position label over select and open select on click","body":"\u003cp\u003eI am trying to create a drop-down effect same as that shown in GMail. When u click a label a drop-down should open and the user should be able to select values.\u003c/p\u003e\n\n\u003cp\u003eI think it can be possible by aligning a label / div over the select such that only the allow of the select is visible and when a user clicks on the label or arrow the drop-down should open. Also the label value should not be visible in the drop-down.\u003c/p\u003e\n\n\u003cp\u003eAny help via css or JavaScript?\u003c/p\u003e","answer_count":"4","comment_count":"1","creation_date":"2010-10-22 13:42:33.513 UTC","last_activity_date":"2013-07-10 12:12:05.943 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"113004","post_type_id":"1","score":"0","tags":"javascript|css","view_count":"2375"} +{"id":"24824286","title":"How make an input in two part. One not editable and the other like a standard input","body":"\u003cp\u003eI would like to display in a textbox both ways. \nThe first displays a value that cannot be erased(readonly). \nAnd the other that will behave as an input standard. \u003c/p\u003e\n\n\u003cp\u003eThe input is in a kendo grid, I can use only one input.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eCan there be a solution on the side of masked textboxes? regex?\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003ePlease help !\u003c/p\u003e","accepted_answer_id":"24824622","answer_count":"3","comment_count":"7","creation_date":"2014-07-18 11:47:08.637 UTC","last_activity_date":"2014-07-18 12:19:12.833 UTC","last_edit_date":"2014-07-18 12:16:16.27 UTC","last_editor_display_name":"","last_editor_user_id":"2211185","owner_display_name":"","owner_user_id":"2211185","post_type_id":"1","score":"0","tags":"html|kendo-ui","view_count":"47"} +{"id":"40636065","title":"Write entity reference to a value of attribute","body":"\u003cp\u003eI now use \u003ccode\u003elxml\u003c/code\u003e module to generate XML file by Python.\u003c/p\u003e\n\n\u003cp\u003eWe must define some entity references to be parsed in our external system.\nNormally, all text string of elements are escaped on output to XML string:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efrom lxml import etree\nroot = etree.Element(\"root\")\nsub = etree.Element(\"sub\")\nsub.text = \"\u0026amp;entity;text\"\nroot.append(sub)\nprint etree.tostring(root)\n'\u0026lt;root\u0026gt;\u0026lt;sub\u0026gt;\u0026amp;amp;entity;text\u0026lt;/sub\u0026gt;\u0026lt;/root\u0026gt;' # I want to get without escaping\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI found \u003ccode\u003elxml.etree.Entity\u003c/code\u003e class is useful for this purpose.:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eroot = etree.Element(\"root\")\nsub = etree.Element(\"sub\")\nentity = etree.Entity(\"entity\")\nentity.tail = \"text\"\nsub.append(entity)\nroot.append(sub)\nprint etree.tostring(root)\n'\u0026lt;root\u0026gt;\u0026lt;sub\u0026gt;\u0026amp;entity;text\u0026lt;/sub\u0026gt;\u0026lt;/root\u0026gt;'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, if we set text with entity reference to value of attribute, it fails:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eroot = etree.Element(\"root\")\nsub = etree.Element(\"sub\")\nentity = etree.Entity(\"entity\")\nentity.tail = \"text\"\nsub.attrib[\"foo\"] = entity\n\n---------------------------------------------------------------------------\nTypeError Traceback (most recent call last)\n\u0026lt;ipython-input-52-62cb8ef3a9a6\u0026gt; in \u0026lt;module\u0026gt;()\n----\u0026gt; 1 sub.attrib[\"foo\"] = entity\n\nlxml.etree.pyx in lxml.etree._Attrib.__setitem__ (src/lxml/lxml.etree.c:58775)()\n\napihelpers.pxi in lxml.etree._setAttributeValue (src/lxml/lxml.etree.c:19025)()\n\napihelpers.pxi in lxml.etree._utf8 (src/lxml/lxml.etree.c:26460)()\n\nTypeError: Argument must be bytes or unicode, got '_Entity'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat I want to get is like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version='1.0' encoding='utf-8'?\u0026gt;\n\u0026lt;!DOCTYPE foo [\n \u0026lt;!ENTITY ent \"entity\" \u0026gt;\n \u0026lt;!ENTITY aaa \"aaaaaa\" \u0026gt;\n]\u0026gt;\n\u0026lt;foo\u0026gt;\n \u0026lt;sub bar=\"\u0026amp;ent;bas\"\u0026gt;\u0026amp;aaa;bbb\u0026lt;/sub\u0026gt;\n\u0026lt;foo\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow can we define generator for that?\u003c/p\u003e","answer_count":"0","comment_count":"6","creation_date":"2016-11-16 15:34:02.56 UTC","last_activity_date":"2016-11-16 15:34:02.56 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5686898","post_type_id":"1","score":"2","tags":"python|xml|lxml|entityreference","view_count":"126"} +{"id":"1565822","title":"Insert HTML into iframe","body":"\u003cp\u003eI am creating a in browser HTML editor. I am using the syntax highlighter called Code Mirror which is very good.\u003c/p\u003e\n\n\u003cp\u003eMy setup is an iframe that holds a view of the page which is being edited and a textarea which the plain text HTML sits which the user edits.\u003c/p\u003e\n\n\u003cp\u003eI am trying to insert the edited HTML from the textarea into the iframe which displays they rendered HTML.\u003c/p\u003e\n\n\u003cp\u003eIs this possible? I have tried the following:\u003c/p\u003e\n\n\u003cp\u003eHTML setup:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;iframe id=\"render\"\u0026gt;\n\n\u0026lt;/iframe\u0026gt;\n\n\u0026lt;textarea id=\"code\"\u0026gt;\nHTML WILL BE \n\nHERE\n\u0026lt;/textarea\u0026gt;\n\u0026lt;input type=\"submit\" id=\"edit_button\" value=\"Edit\" /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eJQuery Setup:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$('#edit_button').click(function(){\n var code = editor.getCode(); // editor.getCode() is a codemirror function which gets the HTML from the text area\n var iframe = $('#render');\n iframe.html(code)\n})\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis does not seem to load the HTML into the iframe, is there a special method to insert HTML into a iframe or is this not possible?\u003c/p\u003e\n\n\u003cp\u003eCheers\u003c/p\u003e\n\n\u003cp\u003eEef\u003c/p\u003e","accepted_answer_id":"1565849","answer_count":"4","comment_count":"1","creation_date":"2009-10-14 12:01:35.23 UTC","favorite_count":"5","last_activity_date":"2015-02-27 16:43:26.2 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"30786","post_type_id":"1","score":"17","tags":"jquery|html|iframe|insert","view_count":"31868"} +{"id":"5612949","title":"ActiveX control for drag and drop file upload in IE","body":"\u003cp\u003eHi\nI need a drag and drop file upload in my asp.net application like gmail but it should support IE browser only.I thing i have to develop a ActiveX control to achieve this .Can any one guide me or give me a link how to develop this.\u003c/p\u003e\n\n\u003cp\u003eRegards\nVairam\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2011-04-10 15:58:43.377 UTC","favorite_count":"1","last_activity_date":"2011-07-11 20:35:42.17 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"587383","post_type_id":"1","score":"0","tags":"asp.net|file|upload|drag-and-drop","view_count":"5253"} +{"id":"1399107","title":"jrails_auto_complete: wrong number of arguments","body":"\u003cp\u003eI have Rails 2.3.3 installed and jrails_auto_complete plugin seems not to work:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\n# View\ntext_field_with_auto_complete :photo, :place\n\n# Controller\nauto_complete_for :photo, :place\n\n# Routes\nmap.auto_complete ':controller/:action', \n :requirements =\u003e { :action =\u003e /auto_complete_for_\\S+/ },\n :conditions =\u003e { :method =\u003e :get }\n\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is the URL which is requested:\u003c/p\u003e\n\n\u003cpre\u003ehttp://localhost:3000/photos/auto_complete_for_photo_place?photo%5Bplace%5D=Test\u003c/pre\u003e\n\n\u003cp\u003eAnd this the response:\u003c/p\u003e\n\n\u003cpre\u003eArgumentError in PhotosController#auto_complete_for_photo_place\n\nwrong number of arguments (0 for 1)\n\nTrace:\n\n/Users/marco/Sites/foto-fiori/vendor/plugins/jrails_auto_complete/lib/jrails_auto_complete.rb:10:in `method'\n/Users/marco/Sites/foto-fiori/vendor/plugins/jrails_auto_complete/lib/jrails_auto_complete.rb:10:in `auto_complete_for_photo_place'\n/Users/marco/Sites/foto-fiori/vendor/rails/actionpack/lib/action_controller/base.rb:1327:in `send'\n...\n\nRequest Parameters:\n\n{\"photo\"=\u003e{\"place\"=\u003e\"C\"},\n \"locale\"=\u003e\"it\"}\n\n\u003c/pre\u003e","accepted_answer_id":"1420765","answer_count":"1","comment_count":"0","creation_date":"2009-09-09 11:27:58.877 UTC","last_activity_date":"2009-09-14 10:33:26.197 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"51387","post_type_id":"1","score":"0","tags":"ruby-on-rails|plugins|jrails-auto-complete","view_count":"159"} +{"id":"34871997","title":"How to implement ng-owasp framework in already existing AngularJS code","body":"\u003cp\u003eI have a requirement to implement owasp frame work to my already existing AngularJS code. How am I supposed to do that? Any tutorials or website for that? I am going through \u003ca href=\"https://github.com/hakanson/ng-owasp\" rel=\"nofollow\"\u003ehttps://github.com/hakanson/ng-owasp\u003c/a\u003e . But I am not able to follow anything by just looking at the code. Is this the right one to start. Please help me.\u003c/p\u003e\n\n\u003cp\u003eThanks,\nShruthi\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-01-19 08:38:43.83 UTC","last_activity_date":"2016-04-22 22:07:27.743 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4031088","post_type_id":"1","score":"0","tags":"angularjs|owasp","view_count":"568"} +{"id":"18928816","title":"OpenGL, Send matrix to vertex shader and display GLSL","body":"\u003cp\u003eIm trying to create a mesh of z = y^2 - x^2 for a uni assessment. Ive create a matrix array to that hold the sqaures that i want to draw as \u003ccode\u003eGL_LINE_STRIPS\u003c/code\u003e called \u003ccode\u003esqaureMatrix[100]\u003c/code\u003e. What i want to know is how i can send that to a vertex shader and display it.\u003c/p\u003e\n\n\u003cp\u003ei will put some code below that says how ive set things up so far\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003easessment.cpp\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emat4 squareMatrix[100];\n\n// this is in general how i fill the matrix\n\nmat4 pseudo = mat4\n\n(\nvec4(1,1,1,1),\nvec4(1,1,1,1),\nvec4(1,1,1,1),\nvec4(1,1,1,1)\n);\n\n// loop through and actually add to the squarematrix like\n\nsquareMatrix[0] = pseudo;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003evshader.glsl\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003euniform mat4 mMatrix;\n\n\nvoid\nmain()\n{\n for (int i = 0; i \u0026lt; 100; i++)\n {\n gl_Position = mMatrix[i];\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWell you get the jist of it. The matrix is set up fine. I thought I would just add it to clarify some things.\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2013-09-21 04:15:02.843 UTC","last_activity_date":"2013-09-21 13:21:14.703 UTC","last_edit_date":"2013-09-21 08:50:33.137 UTC","last_editor_display_name":"","last_editor_user_id":"2376386","owner_display_name":"","owner_user_id":"2801302","post_type_id":"1","score":"0","tags":"arrays|opengl|matrix|glsl|shader","view_count":"886"} +{"id":"19544092","title":"Using ToolStripMenuItem shortcuts in C#","body":"\u003cp\u003eI have a menu item to open a file. This item should be selected by typing the letter \"o\" or be activated by typing the keys Ctrl+O.\nSo I created the following object:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efileOpenMenu = new ToolStripMenuItem();\nfileOpenMenu.Name = \"fileOpenMenu\";\nfileOpenMenu.ShortcutKeys = Keys.Control | Keys.O;\nfileOpenMenu.Text = \"\u0026amp;Open...\";\nfileOpenMenu.Click += new EventHandler(FileOpenMenu_Click);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf I go to the menu then there is the letter \"o\" displayed in the right of the open item. Is this correct? I expected that the text \"Ctrl+O\" is displayed on right side because this shortcut is defined.\nIs there a way to automatically show the shortcut text instead of the access key letter?\u003c/p\u003e","answer_count":"2","comment_count":"1","creation_date":"2013-10-23 14:09:46.33 UTC","last_activity_date":"2014-04-29 17:32:19.86 UTC","last_edit_date":"2013-10-23 14:10:24.277 UTC","last_editor_display_name":"","last_editor_user_id":"447156","owner_display_name":"","owner_user_id":"2188537","post_type_id":"1","score":"1","tags":"c#|shortcut","view_count":"2437"} +{"id":"692614","title":"Mysql order by rating - but capture all","body":"\u003cp\u003eI have this PHP/MYSQL code which returns records from a table ordered by their ratings, from highest rated to lowest rated:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;table width=\"95%\"\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;?php\n if (isset($_GET['p'])) {\n $current_page = $_GET['p'];\n } else {\n $current_page = 1;\n }\n $cur_category = $_GET['category'];\n $jokes_per_page = 40;\n $offset = ($current_page - 1) * $jokes_per_page;\n\n $result = mysql_query(\"\n select jokedata.id as joke_id, jokedata.datesubmitted as datesubmitted,\n jokedata.joketitle as joke_title, sum(ratings.rating)/count(ratings.rating) as average\n from jokedata inner join ratings\n on ratings.content_type = 'joke' and ratings.relative_id = jokedata.id\n WHERE jokecategory = '$cur_category'\n group by jokedata.id\n order by average desc\n limit $offset, $jokes_per_page\n \");\n\n $cell = 1;\n while ($row = mysql_fetch_array($result)) {\n if ($cell == 5) {\n echo \"\u0026lt;/tr\u0026gt;\u0026lt;tr class=\\\"rowpadding\\\"\u0026gt;\u0026lt;td\u0026gt;\u0026lt;/td\u0026gt;\u0026lt;/tr\u0026gt;\u0026lt;tr\u0026gt;\";\n $cell = 1;\n }\n $joke_id = $row['joke_id'];\n $joke_title = $row['joke_title'];\n $joke_average = round($row['average'], 2);\n\n echo \"\u0026lt;td\u0026gt;\u0026lt;strong\u0026gt;\u0026lt;a class=\\\"joke_a\\\" href=\\\"viewjoke.php?id=$joke_id\\\"\u0026gt;$joke_title\u0026lt;/a\u0026gt;\u0026lt;/strong\u0026gt; -average rating $joke_average.\u0026lt;/td\u0026gt;\";\n $cell++;\n }\n ?\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr class=\"rowpadding\"\u0026gt;\u0026lt;td\u0026gt;\u0026lt;/td\u0026gt;\u0026lt;/tr\u0026gt;\n\u0026lt;/table\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt works perfectly but there is one problem - if an item does not have at least one rating, it will not be selected by the query at all!\u003c/p\u003e\n\n\u003cp\u003eHow can I remedy this? Thanks.\u003c/p\u003e","answer_count":"4","comment_count":"0","creation_date":"2009-03-28 11:12:23.62 UTC","favorite_count":"1","last_activity_date":"2009-04-09 08:45:01.98 UTC","last_editor_display_name":"","owner_display_name":"James","post_type_id":"1","score":"0","tags":"mysql|inner-join|rating","view_count":"1355"} +{"id":"31990536","title":"How to have a button in Magento, Which opens an Other Site URL?","body":"\u003cp\u003eam new to magento. how to have a button ,instead of add to cart button on product page. That button has to open a URL in a new window,which i mentioned in an attribute. Each product has different URL according to the product.kindly help in this issue\u003c/p\u003e\n\n\u003cp\u003eThanks in advance.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-08-13 14:06:29.747 UTC","last_activity_date":"2015-08-13 15:07:38.693 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5223870","post_type_id":"1","score":"0","tags":"magento","view_count":"270"} +{"id":"44010960","title":"Using different normalization methods in R","body":"\u003cp\u003eI ran a k-means clustering algorithm using software called Predixion about 6 months ago. I wrote an R script that would hopefully reproduce the same results from Predixion. However, the results are very different. I believe the results are different because we normalized the data differently. I need to be able to use different normalization methods for each column. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eaccount = c(\"A\",\"B\",\"C\", \"D\",\"E\")\nvar_num1= c(67,69,71,33,19)\nvar_num2= c(7175,12018, 6075, 3128, 4002)\nvar_percent= c(.22,.57,.33,.87,.62)\ndf = data.frame(account, var_num1,var_num2, var_percent)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'd like to use log normalization on column 'var_num1'. I'd like to use Min/Max Normalization for columns 'var_num2' and 'var_percent'.\u003c/p\u003e\n\n\u003cp\u003eThanks for your help.\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2017-05-16 20:26:44.3 UTC","last_activity_date":"2017-05-22 07:30:02.627 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7898134","post_type_id":"1","score":"0","tags":"r|normalization","view_count":"101"} +{"id":"11326974","title":"Twitter @Anywhere not working in phonegap application","body":"\u003cp\u003eI'm currently developing a phonegap application that uses Sencha Touch.\nI have a share to Twitter panel set up with uses the \u003ca href=\"https://dev.twitter.com/docs/anywhere/welcome#tweetbox\" rel=\"nofollow noreferrer\"\u003eTwitter @anywhere Tweet Box\u003c/a\u003e (see image).\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/XIOTg.png\" alt=\"How Twitter @Anywhere looks when it works\"\u003e\u003c/p\u003e\n\n\u003cp\u003eWhen I test my app in Safari and Mobile Safari on the device, this loads as displayed. However, when I build my app using Phonegap and proceed to load this panel, the tweet box does not load.\u003c/p\u003e\n\n\u003cp\u003eMy question is why does this not work as it should?\u003c/p\u003e\n\n\u003cp\u003eFinally, please note that in my phonegap application I have the external hosts set to allow content from any external site (my app loads content from youtube and this does work).\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2012-07-04 10:12:02.303 UTC","last_activity_date":"2013-02-26 04:33:07.363 UTC","last_edit_date":"2013-02-26 04:33:07.363 UTC","last_editor_display_name":"","last_editor_user_id":"210774","owner_display_name":"","owner_user_id":"400983","post_type_id":"1","score":"1","tags":"cordova|twitter|sencha-touch-2|twitter-anywhere","view_count":"150"} +{"id":"30748305","title":"Multiple routes with same number of params in laravel","body":"\u003cp\u003eMy client wants two urls in website:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ea) www.example.com/{cityname}-items.html \nb) www.example.com/{statename}-items.html\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow do i code \u003cstrong\u003etwo routes\u003c/strong\u003e for these two urls? First one list items in one city and second one list items under one state.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eRoute::get('{city}', 'CityController@searchCity');\nRoute::get('{state}', 'CityController@searchState');\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen i do this? only first route works, since both have same number of params Client wants to do this without updating url\u003c/p\u003e","answer_count":"2","comment_count":"1","creation_date":"2015-06-10 06:04:03.827 UTC","last_activity_date":"2015-06-10 08:03:10.22 UTC","last_edit_date":"2015-06-10 06:08:21.383 UTC","last_editor_display_name":"","last_editor_user_id":"2537981","owner_display_name":"","owner_user_id":"2477235","post_type_id":"1","score":"1","tags":"php|laravel","view_count":"70"} +{"id":"28533626","title":"Reading in Text File","body":"\u003cp\u003eI'm trying to read in a text file using Haskell, but based on my limited and little knowledge of the language, I'm have a bit of trouble an would like some help.\u003c/p\u003e\n\n\u003cp\u003eI have a text file with 1000+ random words, and would like to read in the text file\nI know that I have to \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport System.IO\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand maybe \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport Data.List\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand I have something like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emain = do \n let list = []\n handle \u0026lt;- openFile \"words.txt\" ReadMode\n contents \u0026lt;- hGetContents handle\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut I don't know much more to proceed.\nAny help would be great. I've been stuck for a while now and have a deadline coming soon. Thank you!\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2015-02-16 02:17:58.973 UTC","last_activity_date":"2015-02-16 03:48:27.653 UTC","last_edit_date":"2015-02-16 02:23:32.95 UTC","last_editor_display_name":"","last_editor_user_id":"284111","owner_display_name":"","owner_user_id":"4490870","post_type_id":"1","score":"0","tags":"haskell","view_count":"538"} +{"id":"17059840","title":"A good pythonic way to map bits to characters in python?","body":"\u003cp\u003e\u003ccode\u003ethe_map = { 1:'a',0:'b'}\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eNow to generate, 8 patterns of \u003ccode\u003ea\u003c/code\u003e and \u003ccode\u003eb\u003c/code\u003e , we create 8 bit patterns:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026gt;\u0026gt;\u0026gt; range(8)\n[0, 1, 2, 3, 4, 5, 6, 7]\n# 001,010,011....111\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow to map the bits to characters 'a' and 'b' , to receive output like :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e['aaa','aab','aba'.......'bbb']\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am looking for an efficient one liner. My approaches using translate or format seem a bit inefficient to me:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026gt;\u0026gt;\u0026gt; import string\n\u0026gt;\u0026gt;\u0026gt; [bin(x)[2:].zfill(3).translate(string.maketrans('01','ab')) for x in xrange(8)]\n['aaa', 'aab', 'aba', 'abb', 'baa', 'bab', 'bba', 'bbb']\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"17059923","answer_count":"4","comment_count":"3","creation_date":"2013-06-12 07:23:31.037 UTC","last_activity_date":"2013-06-12 07:49:39.513 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"533399","post_type_id":"1","score":"2","tags":"python","view_count":"129"} +{"id":"2045646","title":"display time in a textbox and modify with up down arrows","body":"\u003cp\u003eI want to display time in textbox or in something like a numericupdownextender used in AJAX so that the user can change time as he desires.. \u003c/p\u003e\n\n\u003cp\u003ei have used the control to show numbers and increase accordingly..\u003c/p\u003e\n\n\u003cp\u003eis there a way to do this..\u003c/p\u003e\n\n\u003cp\u003enew code but not what is desired...\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;asp:TextBox runat=\"server\" ID=\"txtHour\"\u0026gt;\u0026lt;/asp:TextBox\u0026gt;\n\u0026lt;ajaxToolkit:NumericUpDownExtender ID=\"txtHour_NumericUpDownExtender\" runat=\"server\" Enabled=\"True\" Maximum=\"12\" Minimum=\"1\" TargetControlID=\"txtHour\" Width=\"70\"\u0026gt;\u0026lt;/ajaxToolkit:NumericUpDownExtender\u0026gt;\n\n\u0026lt;asp:TextBox runat=\"server\" ID=\"txtMinute\"\u0026gt;\u0026lt;/asp:TextBox\u0026gt;\n \u0026lt;ajaxToolkit:NumericUpDownExtender ID=\"txtMinute_NumericUpDownExtender\" runat=\"server\" Enabled=\"True\" Maximum=\"60\" Minimum=\"1\" TargetControlID=\"txtMinute\" Width=\"70\"\u0026gt;\u0026lt;/ajaxToolkit:NumericUpDownExtender\u0026gt;\n\n \u0026lt;asp:TextBox runat=\"server\" ID=\"txtDayPart\"\u0026gt;\u0026lt;/asp:TextBox\u0026gt;\n \u0026lt;ajaxToolkit:NumericUpDownExtender ID=\"txtDayPart_NumericUpDownExtender\" runat=\"server\" Enabled=\"True\" RefValues=\"AM;PM\" TargetControlID=\"txtDayPart\" Width=\"70\"\u0026gt;\u0026lt;/ajaxToolkit:NumericUpDownExtender\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethe code behind is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e private void ParseTime(string TimeString)\n {\n\n // Validation of input\n\n if (TimeString.IndexOf(\":\") == -1)\n {\n\n return;\n }\n\n if ((TimeString.IndexOf(\"PM\") == -1) \u0026amp;\u0026amp; (TimeString.IndexOf(\"AM\") == -1))\n {\n\n return;\n }\n\n // Good to go with format\n\n int ColonPos = TimeString.IndexOf(\":\");\n int AMPos = TimeString.IndexOf(\"AM\");\n\n int PMPos = TimeString.IndexOf(\"PM\");\n string sHour = TimeString.Substring(0, ColonPos);\n\n string sMinutes = TimeString.Substring(ColonPos, 3); string sDayPart = (TimeString.IndexOf(\"AM\") != -1) ? TimeString.Substring(AMPos, 2) : TimeString.Substring(PMPos, 2);\n txtHour.Text = sHour;\n\n txtMinute.Text = sMinutes;\n\n txtDayPart.Text = sDayPart;\n }\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"1","creation_date":"2010-01-11 23:17:07.16 UTC","favorite_count":"1","last_activity_date":"2010-01-12 17:44:07.39 UTC","last_edit_date":"2010-01-12 05:54:04.91 UTC","last_editor_display_name":"","last_editor_user_id":"175084","owner_display_name":"","owner_user_id":"175084","post_type_id":"1","score":"2","tags":"c#|asp.net|ajax|time","view_count":"2157"} +{"id":"5462851","title":"Flex Datagrid + Tab Navigator","body":"\u003cp\u003eI have a several datagrids (with data being retrieved from some map service). \u003c/p\u003e\n\n\u003cp\u003eI want to place these data grids within seperate tabs of a tab navigator. All works fine apart from the first tab which always ends up without any datagrid in it. \u003c/p\u003e\n\n\u003cp\u003eI have tried creation policy=\"all\" and stuff but the first tab always is empty. Does anybody have any ideas as to why the first tab is always empty.\u003c/p\u003e\n\n\u003cp\u003eAny workarounds.\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar box:HBox=new HBox();\nvar dg:DataGrid = new DataGrid();\ndg.dataProvider = newAC;\nbox.label=title.text;\nbox.addChild(dg);\ntabNaviId.addChild(box);\ntabNaviId.selectedIndex=2; \nresultsArea.addChild(tabNaviId);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003edg is datagrid that is being filled up. The above code is in a loop, in each loop i am creating an Hbox+datagrid. then i am adding the Hbox to the navigator and final adding the navigator to resultsArea (which is a canvas).\u003c/p\u003e\n\n\u003cp\u003eThe above code works great apart from first time. \u003c/p\u003e\n\n\u003cp\u003eThe end result i get is, having a tab navigator with first tab without any datagrid but the remaining tabs all have the datagrids. Any ideas as to why this is happening.\u003c/p\u003e\n\n\u003cp\u003eCall to a function called createDatagrid is made:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edgCollection.addItem(parentApplication.resultsPanel.createDatagrid( token.name.toString() + \" (\" + recAC.length + \" selected)\", recAC, false, callsToMake ));\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn another Mxml component this function exists\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic function createDatagrid(titleText:String, recACAll:ArrayCollection, showContent:Boolean, callsToMake:Number):DataGrid\n {\n\n var dg:DataGrid = new DataGrid();\n var newAC:ArrayCollection = new ArrayCollection();\n var newDGCols:Array = new Array();\n\n for( var i:Number = 0; i \u0026lt; recACAll.length; i ++)\n {\n var contentStr:String = recACAll[i][CONTENT_FIELD];\n var featureGeo:Geometry = recACAll[i][GEOMETRY_FIELD];\n var iconPath:String = recACAll[i][ICON_FIELD];\n var linkStr:String = recACAll[i][LINK_FIELD];\n var linkNameStr:String = recACAll[i][LINK_NAME_FIELD];\n var featurePoint:MapPoint = recACAll[i][POINT_FIELD];\n var titleStr:String = recACAll[i][TITLE_FIELD];\n\n if( contentStr.length \u0026gt; 0)\n {\n var rows:Array = contentStr.split(\"\\n\");\n\n var tmpObj:Object = new Object();\n\n if(!showContent)\n {\n for( var j:Number = 0; j \u0026lt; rows.length; j++)\n {\n var tmpStr:String = rows[j] as String;\n var header:String = tmpStr.substring(0,tmpStr.indexOf(\":\"));\n var val:String = tmpStr.substring(tmpStr.indexOf(\":\") + 2);\n if(header.length \u0026gt; 0)\n {\n tmpObj[header] = val;\n if(newDGCols.length \u0026lt; rows.length - 1)\n {\n newDGCols.push( new DataGridColumn(header));\n }\n }\n }\n }\n else\n {\n if(newDGCols.length == 0)\n {\n newDGCols.push(new DataGridColumn(CONTENT_FIELD));\n newDGCols.push(new DataGridColumn(GEOMETRY_FIELD));\n newDGCols.push(new DataGridColumn(ICON_FIELD));\n newDGCols.push(new DataGridColumn(LINK_FIELD));\n newDGCols.push(new DataGridColumn(LINK_NAME_FIELD));\n newDGCols.push(new DataGridColumn(POINT_FIELD));\n newDGCols.push(new DataGridColumn(TITLE_FIELD));\n }\n }\n\n tmpObj[CONTENT_FIELD] = contentStr;\n tmpObj[GEOMETRY_FIELD] = featureGeo;\n tmpObj[ICON_FIELD] = iconPath;\n tmpObj[LINK_FIELD] = linkStr;\n tmpObj[LINK_NAME_FIELD] = linkNameStr;\n tmpObj[POINT_FIELD] = featurePoint;\n tmpObj[TITLE_FIELD] = titleStr;\n\n newAC.addItem(tmpObj);\n }\n\n if( showHidePic.source == minSourceI )\n {\n showHidePic.source = minSource;\n }\n else if( showHidePic.source == maxSourceI )\n {\n showHidePic.source = maxSource;\n }\n curResults = curResults + recACAll.length;\n\n if (curResults == 1)\n {\n showInfoWindow(tmpObj);\n\n if(showContent)\n {\n parentApplication.maps.map.extent = featureGeo.extent;\n }\n }\n else\n {\n showInfoWindow(null);\n // Added to avoid the overview button problem (needs checking)\n this.removeEventListener(MouseEvent.MOUSE_OVER, handleMouseOver, false);\n this.removeEventListener(MouseEvent.MOUSE_MOVE,handleMouseOver,false);\n this.removeEventListener(MouseEvent.MOUSE_OUT,handleMouseOut,false);\n this.removeEventListener(MouseEvent.MOUSE_DOWN,handleMouseDrag,false);\n this.removeEventListener(MouseEvent.MOUSE_UP,handleMouseDragStop,false);\n this.parent.removeEventListener(MouseEvent.MOUSE_MOVE,handleParentMove,false);\n this.parent.removeEventListener(MouseEvent.MOUSE_UP,handleMouseDragStop2,false);\n maximizePanel();\n }\n\n }\n\n dg.dataProvider = newAC;\n dg.columns = newDGCols;\n dg.rowCount = newAC.length;\n\n var totalDGCWidth:Number = 0;\n\n for( var m:Number = 0; m \u0026lt; dg.columns.length; m++)\n {\n var dgc2:DataGridColumn = dg.columns[m];\n\n /*if(dgc2.headerText.toUpperCase()==LINK_FIELD.toUpperCase()){\n\n //dgc.itemRenderer=new ClassFactory(CustomRenderer);\n dgc2.itemRenderer=new ClassFactory(CustomRenderer);\n }*/\n var dgcWidth2:Number = dgc2.headerText.length * CHAR_LENGTH;\n\n for( var l:Number = 0; l \u0026lt; newAC.length; l++)\n {\n var row2:Object = newAC.getItemAt(l) as Object;\n var rowVal2:String = row2[dgc2.headerText];\n\n if( rowVal2 != null)\n {\n var tmpLength2:Number = rowVal2.length * CHAR_LENGTH;\n\n if(tmpLength2 \u0026lt; CHAR_MAX_LENGTH)\n {\n if(tmpLength2 \u0026gt; dgcWidth2)\n {\n dgcWidth2 = tmpLength2;\n }\n }\n else\n {\n dgcWidth2 = CHAR_MAX_LENGTH\n break;\n }\n }\n\n }\n // Added by FT:to change the item renderer for link field\n\n\n if( dgc2.headerText == GEOMETRY_FIELD || dgc2.headerText == CONTENT_FIELD ||\n dgc2.headerText == ICON_FIELD || dgc2.headerText == LINK_FIELD ||\n dgc2.headerText == POINT_FIELD || dgc2.headerText == TITLE_FIELD ||\n dgc2.headerText == LINK_NAME_FIELD)\n {\n if(dgc2.headerText == CONTENT_FIELD \u0026amp;\u0026amp; showContent)\n {\n //something\n }\n else\n {\n\n dgcWidth2 = 0;\n }\n }\n\n totalDGCWidth += dgcWidth2;\n }\n\n dg.width = totalDGCWidth;\n\n\n\n for( var k:Number = 0; k \u0026lt; dg.columns.length; k++)\n {\n var dgc:DataGridColumn = dg.columns[k];\n var dgcWidth:Number = dgc.headerText.length * CHAR_LENGTH;\n for( var n:Number = 0; n \u0026lt; newAC.length; n++)\n {\n var row:Object = newAC.getItemAt(n) as Object;\n var rowVal:String = row[dgc.headerText];\n\n if(rowVal != null)\n {\n var tmpLength:Number = rowVal.length * CHAR_LENGTH;\n\n if(tmpLength \u0026lt; CHAR_MAX_LENGTH)\n {\n if(tmpLength \u0026gt; dgcWidth)\n {\n dgcWidth = tmpLength;\n }\n }\n else\n {\n dgcWidth = CHAR_MAX_LENGTH\n break;\n }\n }\n\n }\n if( dgc.headerText == GEOMETRY_FIELD || dgc.headerText == CONTENT_FIELD ||\n dgc.headerText == ICON_FIELD || dgc.headerText == LINK_FIELD ||\n dgc.headerText == POINT_FIELD || dgc.headerText == TITLE_FIELD ||\n dgc.headerText == LINK_NAME_FIELD)\n {\n if(dgc.headerText == CONTENT_FIELD \u0026amp;\u0026amp; showContent)\n {\n dgc.visible = true;\n }\n else\n {\n\n dgc.visible = false;\n dgcWidth = 0;\n }\n }\n\n if( dgc.headerText == LINK_COL_NAME)\n {\n dgcWidth = LINK_COL_WIDTH;\n }\n\n dgc.width = dgcWidth;\n }\n\n dg.addEventListener(ListEvent.ITEM_CLICK,rowClicked);\n dg.addEventListener(ListEvent.ITEM_ROLL_OVER,mouseOverRow);\n dg.addEventListener(ListEvent.ITEM_ROLL_OUT,mouseOutRow);\n\n var title:Text = new Text();\n title.text = titleText;\n title.setStyle(\"fontWeight\",\"bold\");\n\n //resultsArea.addChild(title);\n\n return dg;\n\n\n //tabNaviId.selectedIndex=2; \n\n\n }\n public function populateGrid(dgCollection:ArrayCollection):void{\n\n\n for( var k:Number = 0; k \u0026lt; dgCollection.length; k++)\n {\n var box:HBox=new HBox();\n var dg2:DataGrid=dgCollection.getItemAt(k) as DataGrid;\n box.label=\"some\";\n box.addChild(dg2);\n tabNaviId.addChild(box);\n\n }\n resultsArea.addChild(tabNaviId);\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand the tab navigator declared as\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;mx:Image id=\"showHidePic\" click=\"toggleResults()\"/\u0026gt;\n\u0026lt;mx:VBox y=\"20\" styleName=\"ResultsArea\" width=\"100%\" height=\"100%\"\u0026gt;\n \u0026lt;mx:HBox\u0026gt;\n \u0026lt;mx:Button label=\"Export to Excel\" click=\"downloadExcel()\"/\u0026gt;\n \u0026lt;mx:Button label=\"Clear\" click=\"clear()\" /\u0026gt;\n \u0026lt;/mx:HBox\u0026gt;\n \u0026lt;mx:VBox id=\"resultsArea\" styleName=\"ResultsContent\" paddingTop=\"10\" paddingLeft=\"10\" paddingRight=\"10\" verticalScrollPolicy=\"off\" horizontalScrollPolicy=\"off\"\u0026gt;\n \u0026lt;mx:TabNavigator id=\"tabNaviId\" width=\"622\" height=\"274\" creationPolicy=\"all\"\u0026gt;\n\n \u0026lt;/mx:TabNavigator\u0026gt;\n\n \u0026lt;/mx:VBox\u0026gt;\n\u0026lt;/mx:VBox\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"5","creation_date":"2011-03-28 17:41:07.277 UTC","last_activity_date":"2011-03-28 19:25:31.303 UTC","last_edit_date":"2011-03-28 19:25:31.303 UTC","last_editor_display_name":"","last_editor_user_id":"680684","owner_display_name":"","owner_user_id":"680684","post_type_id":"1","score":"0","tags":"flex|datagrid","view_count":"1286"} +{"id":"41990323","title":"Where are the files located when creating them with IsolatedStorageFile.GetUserStoreForApplication() in Monogame with Android?","body":"\u003cp\u003eI've tried to create files with Monogame for Android but the problem is that I don't know where they are located.\u003c/p\u003e\n\n\u003cp\u003eI used this code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e var store = IsolatedStorageFile.GetUserStoreForApplication();\n store.CreateFile(\"test.txt\");\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eSo, where is the test.txt file?\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eAnd to be 100% sure that the file actually exists I ran this code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e if (store.FileExists(\"test.txt\"))\n {\n\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand that code is true so now I know that the file exist even if I can't find it.\u003c/p\u003e\n\n\u003cp\u003eI tried to search for the file everywhere in my project and I also searched for it in my phone but no luck there.\u003c/p\u003e\n\n\u003cp\u003eI want to be able to move files from my computer to the gameproject and read/write to those files via my Phone.\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2017-02-01 21:42:38.133 UTC","favorite_count":"1","last_activity_date":"2017-02-01 21:54:05.013 UTC","last_edit_date":"2017-02-01 21:54:05.013 UTC","last_editor_display_name":"","last_editor_user_id":"2744089","owner_display_name":"","owner_user_id":"2744089","post_type_id":"1","score":"1","tags":"c#|android|xna|monogame|isolatedstoragefile","view_count":"36"} +{"id":"3488780","title":"Setting default selected option for Zend_Form_Element_Select","body":"\u003cblockquote\u003e\n \u003cp\u003e\u003cstrong\u003ePossible Duplicate:\u003c/strong\u003e\u003cbr\u003e\n \u003ca href=\"https://stackoverflow.com/questions/1588272/zend-framework-set-selected-value-in-select-box-dropdown-list\"\u003eZend Framework - Set \u0026#39;selected\u0026#39; value in select box dropdown list\u003c/a\u003e \u003c/p\u003e\n\u003c/blockquote\u003e\n\n\n\n\u003cp\u003eI have a Zend_Form with Zend_Form_Select element. I populate it from array (code inside the \u003cem\u003eApplication_Form_MyForm extends Zend_Form\u003c/em\u003e class):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$options = array('first option', 'second option', 'third option');\n$this-\u0026gt;getElement('mySelect')-\u0026gt;addMultiOptions($options);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow can I choose which value is gonna be selected automatically, as in \u003ccode\u003e\"\u0026lt;option value=\"second option\" selected=\"selected\"\u0026gt;second option\u0026lt;/option\u0026gt;\" ?\u003c/code\u003e\nThanks!\u003c/p\u003e","accepted_answer_id":"3493198","answer_count":"2","comment_count":"0","creation_date":"2010-08-15 18:59:40.637 UTC","favorite_count":"0","last_activity_date":"2012-12-24 22:50:43.69 UTC","last_edit_date":"2017-05-23 12:13:30.58 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"25413","post_type_id":"1","score":"3","tags":"php|zend-framework|zend-form|zend-form-element","view_count":"12130"} +{"id":"11478594","title":"How to add am/pm to datetime","body":"\u003cp\u003eIn my application, I have a the following fields:\ndatepicker, hours dropdown, minutes dropdown, and am/pm dropdown.\u003c/p\u003e\n\n\u003cp\u003eIn my controller I am trying to tie these fields together and create a DateTime value like this (5/18/2012 2:45 PM):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar datex = new DateTime(model.Scheduled.Value.Year, model.Scheduled.Value.Month, model.Scheduled.Value.Day, model.ScheduledHour, model.ScheduledMinute, 0);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn the above, how do I include the AM/PM value that the user selected on the UI?\u003c/p\u003e","accepted_answer_id":"11478637","answer_count":"1","comment_count":"0","creation_date":"2012-07-13 21:24:40.343 UTC","last_activity_date":"2012-07-13 21:28:56.457 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1357051","post_type_id":"1","score":"0","tags":"c#|asp.net|asp.net-mvc","view_count":"703"} +{"id":"30333801","title":"SQL Report Builder - Referencing Group On value","body":"\u003cp\u003eNew to Report Builder so not sure if this is possible or not but when creating groups, is there a way to reference the value of the group itself in an expression?\u003c/p\u003e\n\n\u003cp\u003eLets say for example I've got the following\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eType Amount\n===== ======\nA $200.00\nA $100.00\nB $100.00\nB $50.00\nC $75.00\nC $25.00\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo now I create a group, TypeGroup that groups on the 'Type' field, however when aggregating 'Amount', depending on what the 'Type' is determines the aggregation. So if TypeGroup = A, get the max of amount, if it's B get the avg, if it's C get the Sum. So in the Tablix body, I need to somehow reference which group that cell belongs to in an expression.\u003c/p\u003e\n\n\u003cp\u003eSomething like this. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e=iif(Group!TypeGroup = \"A\", Max(Field!Amount.Value),iif(Group!TypeGroup = \"B\", AVG(Fields!Amount.Value),SUM(Fields!Amount.Value)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt's the syntax for 'Group!TypeGroup' that I'm not sure on (if such a thing even existing)\u003c/p\u003e\n\n\u003cp\u003eThis is a simple example to try and describe what I'm looking for, my situation is a lot more complex. I have a long way workaround for what I need, I was just hoping that there was a way to reference the group to simplify things for me.\u003c/p\u003e\n\n\u003cp\u003eThx for any answers.\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2015-05-19 18:50:29.487 UTC","last_activity_date":"2015-05-19 20:58:00.763 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4917398","post_type_id":"1","score":"0","tags":"reporting-services|ssrs-tablix","view_count":"48"} +{"id":"40334551","title":"Visual Studio 2013 - Using Statement and Brackets off","body":"\u003cp\u003eI'm new in at programming world, i'm trying learn about MVC language, through microsoft academy, however, i facing a little issue, when i add a new class, i can't see the \"Using \" statements, Namespace, or close the class with {} brackets, as you see here \u003ca href=\"https://i.stack.imgur.com/s2J5O.jpg\" rel=\"nofollow\"\u003eMy Actual Configuration\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI would like change my configurations to this template \u003ca href=\"https://i.stack.imgur.com/XcqWi.jpg\" rel=\"nofollow\"\u003eCorrect Configuration\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eCould you please help me?\u003c/p\u003e\n\n\u003cp\u003eThank you in Advance.\nBest Regards.\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2016-10-30 22:56:44.557 UTC","favorite_count":"2","last_activity_date":"2016-10-31 05:30:23.467 UTC","last_edit_date":"2016-10-31 05:30:23.467 UTC","last_editor_display_name":"","last_editor_user_id":"3559349","owner_display_name":"","owner_user_id":"7092942","post_type_id":"1","score":"0","tags":"asp.net-mvc|visual-studio-2013","view_count":"36"} +{"id":"39601890","title":"Not supported by Swagger 2.0: Multiple operations with path WebApi2.0","body":"\u003cp\u003eI have integrated swagger in WebApi 2 application. It works fine when application has single controller. \nWhen I added second controller in the application. I got following error : \u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003e500 : {\"Message\":\"An error has occurred.\",\"ExceptionMessage\":\"Not supported by Swagger 2.0: Multiple operations with path 'api/Credential' and method 'GET'. See the config setting - \\\"ResolveConflictingActions\\\" for a potential workaround\",\"ExceptionType\":\"System.NotSupportedException\",\"StackTrace\":\" at Swashbuckle.Swagger.SwaggerGeneratorOptions.DefaultConflictingActionsResolver(IEnumerable\u003ccode\u003e1 apiDescriptions)\\r\\n at Swashbuckle.Swagger.SwaggerGenerator.CreatePathItem(IEnumerable\u003c/code\u003e1 apiDescriptions, SchemaRegistry schemaRegistry)\\r\\n at Swashbuckle.Swagger.SwaggerGenerator.\u0026lt;\u003ec__DisplayClass7.b__4(IGrouping\u003ccode\u003e2 group)\\r\\n at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable\u003c/code\u003e1 source, Func\u003ccode\u003e2 keySelector, Func\u003c/code\u003e2 elementSelector, IEqualityComparer`1 comparer)\\r\\n at Swashbuckle.Swagger.SwaggerGenerator.GetSwagger(String rootUrl, String apiVersion)\\r\\n at Swashbuckle.Application.SwaggerDocsHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\\r\\n at System.Net.Http.HttpMessageInvoker.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\\r\\n at System.Web.Http.Dispatcher.HttpRoutingDispatcher.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\\r\\n at System.Net.Http.DelegatingHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\\r\\n at System.Web.Http.Cors.CorsMessageHandler.d__0.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n at System.Web.Http.HttpServer.d__0.MoveNext()\"} \u003ca href=\"http://localhost:50950/swagger/docs/v1\" rel=\"nofollow\"\u003ehttp://localhost:50950/swagger/docs/v1\u003c/a\u003e\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eIn the second controller I have added following two methods.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e string Get(string username, string password);\n\n string Get(string credential);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf I comment one of the method. Then it works fine.\u003c/p\u003e\n\n\u003cp\u003eAny Idea how to fix it ?\u003c/p\u003e\n\n\u003cp\u003eThanks in advance.\u003c/p\u003e","answer_count":"3","comment_count":"2","creation_date":"2016-09-20 19:01:06.15 UTC","last_activity_date":"2017-03-10 10:11:40.753 UTC","last_edit_date":"2016-09-20 19:09:54.363 UTC","last_editor_display_name":"","last_editor_user_id":"2266837","owner_display_name":"","owner_user_id":"2266837","post_type_id":"1","score":"4","tags":"c#|asp.net-web-api2|swagger|swashbuckle","view_count":"4006"} +{"id":"5482939","title":"Replacing ViewController on iPhone rotation","body":"\u003cp\u003eMy App only has a portrait driven GUI, but there's a only section that needs to be rotated.\nWhen the device is being rotated I want to dismiss the current View(Controller?) and replace it with a totally different looking one.\nHow can I do? Any example code?\u003c/p\u003e","accepted_answer_id":"5483140","answer_count":"2","comment_count":"1","creation_date":"2011-03-30 06:55:36.42 UTC","favorite_count":"1","last_activity_date":"2011-03-30 08:15:06.207 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"494826","post_type_id":"1","score":"0","tags":"iphone|uiviewcontroller|rotation","view_count":"340"} +{"id":"20172664","title":"c++ dynamic libarary fundamentals","body":"\u003cp\u003e\u003ccode\u003eUsing GCC 4.6.2 [MinGW]\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eI am a bit confused about dynamic libraries, I know they have been discussed a lot on SO but none of the previous posts answer my question.\u003c/p\u003e\n\n\u003cp\u003eLets take a simple example:\u003c/p\u003e\n\n\u003cp\u003eFile 1: \u003ccode\u003emain.cpp\u003c/code\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \"function.cpp\"\n\nusing namespace std;\n\nint main()\n{\n display();\n return 0;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFile 2: \u003ccode\u003efunction.cpp\u003c/code\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;iostream\u0026gt;\n\nusing namespace std;\n\nvoid display() \n{\n cout \u0026lt;\u0026lt; \"testing...\" \u0026lt;\u0026lt; endl;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd then I do the following:\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eg++ -c main.cpp -o main.o\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eg++ -c function.cpp -o function.o\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eg++ -shared function.o -o libfunction.dll\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eg++ main.o -Lfunction.dll -o result.exe\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eOn doing this the program works.\u003c/p\u003e\n\n\u003cp\u003eSo in the directory we have files: \u003ccode\u003emain.cpp, function.cpp, main.o, function.o, libfunction.dll\u003c/code\u003e and \u003ccode\u003eresult.exe\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eBut then if I were to delete the SHARED LIBRARY \u003ccode\u003elibfunction.dll\u003c/code\u003e the program still works. How is that possible? I thought the whole idea of shared library\nis that the required code to RUN is borrowed during RUN TIME and the absence of \u003ccode\u003elibfunction.dll\u003c/code\u003e should surely give me an error of the missing library.\u003c/p\u003e\n\n\u003cp\u003eFor this I have looked into the compiler documentation but did not help\u003c/p\u003e","accepted_answer_id":"20172687","answer_count":"2","comment_count":"6","creation_date":"2013-11-24 08:40:16.037 UTC","last_activity_date":"2013-11-24 08:55:21.173 UTC","last_edit_date":"2013-11-24 08:52:31.927 UTC","last_editor_display_name":"","last_editor_user_id":"534124","owner_display_name":"","owner_user_id":"1725538","post_type_id":"1","score":"-3","tags":"c++|gcc|dll|g++|mingw","view_count":"59"} +{"id":"46250273","title":"GitHub Page loading Bootstrap CSS, but not my custom stylesheet?","body":"\u003cp\u003eI am trying to host my website for free using GitHub (and I'm new to GitHub so sorry if this is a dumb question), but it just is not using the stylesheet I created and uploaded with all my files. It also is not loading images from my images folder. So from what I can tell, it doesn't like using local files, but it is fine using linked stylesheets like Bootstrap and images linked from somewhere online.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css\" integrity=\"sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M\" crossorigin=\"anonymous\"\u0026gt;\n\u0026lt;link rel=\"stylesheet\" type=\"text/css\" href=\"_css/bootstrapOverride.css\"\u0026gt;\n\u0026lt;link rel=\"stylesheet\" type=\"text/css\" href=\"_css/animate.css\"\u0026gt;\n\u0026lt;link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css\"\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt refuses to use my bootstrapOverride.css and the animate.css.\u003c/p\u003e\n\n\u003cp\u003eHow can I make it use local files like these? Same question with images as well?\u003c/p\u003e","accepted_answer_id":"46336337","answer_count":"1","comment_count":"3","creation_date":"2017-09-16 05:07:27.283 UTC","last_activity_date":"2017-09-21 05:50:01.133 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"8475046","post_type_id":"1","score":"0","tags":"css|twitter-bootstrap|image|github|github-pages","view_count":"28"} +{"id":"10890803","title":"XML Parsing Error: not well-formed while parsing XML string with browser's built in parser","body":"\u003cp\u003eI am trying to parse a XML string with browser's built in parser using JavaScript. My XML string looks like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version='1.0' encoding='UTF-8' ?\u0026gt;\n\u0026lt;xsd:schema xmlns:xsd='http://www.w3.org/2001/XMLSchema'\n xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'\n xsi:schemaLocation='http://www.w3.org/2001/XMLSchema XMLSchema.xsd'\n elementFormDefault='qualified'\n version='1.0'\u0026gt;\n\u0026lt;xsd:element name='probeMetadata' type='OASIS.System.Processor.LinuxProcessorProbe' /\u0026gt;\n\u0026lt;xsd:complexType name='OASIS.System.Processor.LinuxProcessorProbe'\u0026gt;\n\u0026lt;xsd:complexContent\u0026gt;\n\u0026lt;xsd:extension base='OASIS.System.Processor.ProcessorProbe'\u0026gt;\n\u0026lt;xsd:sequence\u0026gt;\n \u0026lt;xsd:element name='nice_time' type='xsd:unsignedLong' /\u0026gt;\n \u0026lt;xsd:element name='iowait_time' type='xsd:unsignedLong' /\u0026gt;\n \u0026lt;xsd:element name='irq_time' type='xsd:unsignedLong' /\u0026gt;\n \u0026lt;xsd:element name='soft_irq_time' type='xsd:unsignedLong' /\u0026gt;\n\u0026lt;/xsd:sequence\u0026gt;\n\u0026lt;/xsd:extension\u0026gt;\n\u0026lt;/xsd:complexContent\u0026gt;\n\u0026lt;/xsd:complexType\u0026gt;\n\u0026lt;xsd:complexType name='OASIS.System.Processor.ProcessorProbe'\u0026gt;\n\u0026lt;xsd:sequence\u0026gt;\n \u0026lt;xsd:element name='idle_time' type='xsd:unsignedLong' /\u0026gt;\n \u0026lt;xsd:element name='system_time' type='xsd:unsignedLong' /\u0026gt;\n \u0026lt;xsd:element name='user_time' type='xsd:unsignedLong' /\u0026gt;\n\u0026lt;/xsd:sequence\u0026gt;\n\u0026lt;/xsd:complexType\u0026gt;\n\u0026lt;/xsd:schema\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI wrote a simple JavaScript code just to check whether parser is parsing my XML properly and converting it into valid XML DOM. JavaScript code looks like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eparser = new DOMParser();\nxmlDoc = parser.parseFromString(text, \"text/xml\");\n\nx = xmlDoc.documentElement.childNodes;\n\ndocument.getElementById(\"Text1\").value = x[3].nodeName;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere \"text\" is above XML. This code means nothing. I just wanted to test someting simple at first. I tested the XML at w3school.com for validity and it didnt give me error so i suppose there is no error in XML.\u003c/p\u003e","accepted_answer_id":"10892120","answer_count":"1","comment_count":"7","creation_date":"2012-06-05 02:25:50.823 UTC","favorite_count":"1","last_activity_date":"2012-06-05 05:37:14.833 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1171769","post_type_id":"1","score":"0","tags":"javascript|xml|xml-parsing|xsd","view_count":"1868"} +{"id":"16679151","title":"Beginner, Error in python regarding site-packages/celltool/numerics/fitpack/_fitpack.so","body":"\u003cp\u003eI'm a total noob at programming so please bare with me! I'm some image analysis for my research, and it involves using CellTool (\u003ca href=\"http://pantheon.yale.edu/~zp2/Celltool/\" rel=\"nofollow\"\u003ehttp://pantheon.yale.edu/~zp2/Celltool/\u003c/a\u003e), Python, and numpy. I'm on a OS X 10.8.3. On my old laptop that crashed, I was able to run my commands fine, but I got a new one and things are not going as smoothly! \u003c/p\u003e\n\n\u003cp\u003eI \u003cem\u003ebelieve\u003c/em\u003e I have CellTool and numpy installed correctly, and I'm just using Python 2.7.2 that's standard on Mac. But when I try to run this python script \"calculate_distances.py\" command, I get this error: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eYuxins-MacBook-Pro:Modified_Contours yuxinsun$ python calculate_distances.py\nTraceback (most recent call last):\n File \"calculate_distances.py\", line 24, in \u0026lt;module\u0026gt;\n normals = contours[n-1].inward_normals()\n File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/celltool/contour/contour_class.py\", line 384, in inward_normals\n import celltool.numerics.fitpack as fitpack\n File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/celltool/numerics/fitpack/__init__.py\", line 1, in \u0026lt;module\u0026gt;\n from fitpack import *\n File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/celltool/numerics/fitpack/fitpack.py\", line 34, in \u0026lt;module\u0026gt;\n import _fitpack\nImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/celltool/numerics/fitpack/_fitpack.so, 2): Library not loaded: /usr/local/lib/libgfortran.2.dylib\n Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/celltool/numerics/fitpack/_fitpack.so\n Reason: image not found\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd I have no idea what any of it means...I only need to run this python script and get the file that it spits out.\u003c/p\u003e\n\n\u003cp\u003eAm I just missing the \"fitpack\" whatever that is? If so, how do I install it? Or what can I do to fix this problem. \u003c/p\u003e\n\n\u003cp\u003eThank you for your help!!! \u003c/p\u003e","accepted_answer_id":"16679298","answer_count":"1","comment_count":"1","creation_date":"2013-05-21 20:43:05.687 UTC","last_activity_date":"2013-05-21 20:57:16.673 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1497383","post_type_id":"1","score":"0","tags":"python|numpy","view_count":"160"} +{"id":"34448264","title":"AngularJS making ng-bind-html to a dynamically constructed object name","body":"\u003cp\u003eI need to set the within the HTML code a binding to a dynamically created name, something like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div ng-bind-html=\"MyVariable_{{counter}}\"\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand in the controller I'm using the following code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e var the_string = 'MyVariable_' + p ;\n var MyHTML = '\u0026lt;font size=\"' + p + '\"\u0026gt;This is text with size depending on the index\u0026lt;/font\u0026gt;' ;\n\n var dummy = $parse(the_string);\n dummy.assign($scope, $sce.trustAsHtml(MyHTML));\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eClarification Note\u003c/strong\u003e:{{counter}} within the HTML is the parameter \"p\" passed to the javascript code.\u003c/p\u003e\n\n\u003cp\u003eThe problem appears to be within the HTML... AngularJS does not like the syntax I'm using within the HTML (i.e. \u003ccode\u003e=\"MyVariable_{{counter}}\"\u003c/code\u003e). Is there any way to accomplish this?\u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","accepted_answer_id":"34448308","answer_count":"1","comment_count":"0","creation_date":"2015-12-24 06:24:05.397 UTC","last_activity_date":"2015-12-24 06:28:11.92 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4991677","post_type_id":"1","score":"0","tags":"javascript|html|angularjs","view_count":"441"} +{"id":"35672261","title":"Adding event listeners on array of pics in specific way","body":"\u003cp\u003eI have a bunch of images, that should be distributed in conatiner one by one, which means \u003cstrong\u003eeach image shows exact after previous image is loaded and showed\u003c/strong\u003e, and each image should get an event listener.\u003cbr\u003e\nHere is my solution \u003ca href=\"https://jsfiddle.net/e2sfzn1u/4/\" rel=\"nofollow\"\u003ehttps://jsfiddle.net/e2sfzn1u/4/\u003c/a\u003e \u003cbr\u003e\nI have used Image.onload to add the image node to the markup and to define event listener for that node, and when these are ready, it goes to another image (recursively).\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar pics = [\n 'http://i.imgur.com/1oT2ZpOb.jpg',\n 'http://i.imgur.com/XsViuLib.jpg',\n 'http://i.imgur.com/aTDTI8Eb.jpg',\n 'http://i.imgur.com/4kLvWOdb.jpg'\n]\nvar cont = document.getElementById('container');\nvar each = function(arr, i) {\n if (i === undefined) {\n i = 0;\n }\n if (i \u0026lt; arr.length) {\n var img = new Image();\n img.onload = function() {\n cont.innerHTML += '\u0026lt;div class=\"sas\" id=\"' + i + '\" \u0026gt;\u0026lt;/div\u0026gt;';\n var pic = document.getElementById(i);\n pic.appendChild(img);\n pic.addEventListener('click', function() {\n alert('mda')\n });\n each(arr, i + 1);\n };\n img.src = arr[i];\n }\n};\neach(pics);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eLooks simple, but there is a problem - event listener is defined only for last element. \u003c/p\u003e","accepted_answer_id":"35680766","answer_count":"2","comment_count":"1","creation_date":"2016-02-27 16:28:17.67 UTC","last_activity_date":"2016-02-28 09:22:56.277 UTC","last_edit_date":"2016-02-27 17:53:29.783 UTC","last_editor_display_name":"","last_editor_user_id":"3872002","owner_display_name":"","owner_user_id":"5230670","post_type_id":"1","score":"0","tags":"javascript|jquery|arrays|javascript-events","view_count":"60"} +{"id":"32439045","title":"What to set for JVM heap memory for tomcat","body":"\u003cp\u003eI am using Jpedal tool to convert PDF to Image. In general this is working, however once in a while during converting large number of PDF pages into images it causes the application and tomcat to stop without any information or logs. Seems it's Out of Memory Error without any logs.\nI have increased JVM heap memory for tomcat as below : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e-Xms2048m -Xmx4096m -XX:MaxPermSize=1024m\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut still it causes tomcat to stop.\nCan anyone please help for the same.\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2015-09-07 12:41:57.243 UTC","last_activity_date":"2015-09-07 12:41:57.243 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5288281","post_type_id":"1","score":"1","tags":"java|tomcat|jvm|out-of-memory|jpedal","view_count":"239"} +{"id":"14275204","title":"Listener is not calling for facebook sdk in android","body":"\u003cp\u003eI am \u003cstrong\u003eintegrating\u003c/strong\u003e facebook sdk in my android application with single signon.\u003c/p\u003e\n\n\u003cp\u003eFacebook application if installed called but the problem is after authorization my \u003ccode\u003elistener\u003c/code\u003e does not called.\u003c/p\u003e\n\n\u003cp\u003eHere is my code.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efacebook.authorize(this, new String[] { \"publish_stream\", \"user_photos\", \"email\" }, 20003, \n createAuthorizeFacebookDialogListener(facebook,2003));\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand here is the \u003ccode\u003elistener\u003c/code\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate DialogListener createAuthorizeFacebookDialogListener(final Facebook facebook, final int facebookAuthorizeCompleteId)\n {\n DialogListener listener = new DialogListener() {\n @Override\n public void onComplete(Bundle values)\n {\n saveCredentials(facebook);\n showToast(\"Authentication with Facebook\");\n if (messageToPost != null) {\n postToWall(messageToPost);\n }\n }\n @Override\n public void onFacebookError(FacebookError e)\n {\n showToast(\"Authentication with Facebook failed!\");\n finish();\n }\n @Override\n public void onError(DialogError e)\n {\n showToast(\"Authentication with Facebook failed!\");\n finish();\n }\n @Override\n public void onCancel() {\n\n showToast(\"Authentication with Facebook cancelled!\");\n finish();\n }\n };\n return listener;\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003econtrol does not come back after authorizing the application.\u003c/p\u003e\n\n\u003cp\u003ePlease help me in this.\u003c/p\u003e","answer_count":"0","comment_count":"4","creation_date":"2013-01-11 09:33:52.483 UTC","last_activity_date":"2013-01-11 09:40:28.49 UTC","last_edit_date":"2013-01-11 09:39:43.413 UTC","last_editor_display_name":"","last_editor_user_id":"715269","owner_display_name":"","owner_user_id":"1722944","post_type_id":"1","score":"1","tags":"android|facebook|listener","view_count":"220"} +{"id":"21281667","title":"MySQL Upgrade 5.x upgrade","body":"\u003cp\u003eI'm using MySQL Server version: 5.5.28-0ubuntu0.12.04.2. \nI tried to update the version to 5.5.35 using the following command and the output also is shown below\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eroot@MATRiXDev:/home/rpolepeddi# apt-get install mysql-server\nReading package lists... Done\nBuilding dependency tree\nReading state information... Done\nThe following packages will be upgraded:\n mysql-server\n1 upgraded, 0 newly installed, 0 to remove and 215 not upgraded.\nNeed to get 11.2 kB of archives.\nAfter this operation, 1,024 B of additional disk space will be used.\nGet:1 http://gb.archive.ubuntu.com/ubuntu/ precise-updates/main mysql-server all 5.5.35-0ubuntu0.12.04.1 [11.2 kB]\nFetched 11.2 kB in 0s (73.1 kB/s)\n(Reading database ... 62346 files and directories currently installed.)\nPreparing to replace mysql-server 5.5.28-0ubuntu0.12.04.2 (using .../mysql-server_5.5.35-0ubuntu0.12.04.1_all.deb) ...\nUnpacking replacement mysql-server ...\nSetting up mysql-server (5.5.35-0ubuntu0.12.04.1) ...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut after I launch MySQL it still shows that is 5.5.28 instead of 5.5.35. Can someone explain this ?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eroot@MATRiXDev:/etc/mysql# mysql -u root -p\nEnter password:\nWelcome to the MySQL monitor. Commands end with ; or \\g.\nYour MySQL connection id is 294\nServer version: 5.5.28-0ubuntu0.12.04.2 (Ubuntu)\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"4","creation_date":"2014-01-22 11:27:55.96 UTC","last_activity_date":"2014-01-22 12:25:19.217 UTC","last_edit_date":"2014-01-22 12:25:19.217 UTC","last_editor_display_name":"","last_editor_user_id":"1047436","owner_display_name":"","owner_user_id":"1047436","post_type_id":"1","score":"0","tags":"mysql","view_count":"168"} +{"id":"44107199","title":"Change the value of a variable on rotation Js","body":"\u003cp\u003eSo basically I've googled and done research on how to do this, but haven't managed to make it work.. I've declared a variable called width. I want my JS to check, if the width of the screen is smaller than 660px, then width shall be 140px, else it should be 100px. The variable, width, should only change when I'm rotating the device \"phone\", but it isn't working? I want the variable should check the width of the screen whenever i rotate the device. I've worked on it for a long time but couldn't solve it. I know of media queries, but I would like to change the variable in JS for other reasons..\u003c/p\u003e\n\n\u003cp\u003eJS\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar width = 0;\n function check()\n {\n\nif (window.innerWidth \u0026lt; 660) \n {\n width = 140;\n }\n else{\n width = 100;\n }\n}\n\n\nwindow.addEventListener(\"orientationEvent\", check);\ndocument.write(width);\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"44107634","answer_count":"3","comment_count":"0","creation_date":"2017-05-22 07:37:00.133 UTC","last_activity_date":"2017-05-22 08:01:00.78 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7987381","post_type_id":"1","score":"1","tags":"javascript|html|ios|css|rotation","view_count":"81"} +{"id":"19191460","title":"how do I eliminate duplicatesin sql?","body":"\u003cp\u003eCan someone point me in the right direction to eliminate duplicates in the student ID field?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSQL\u0026gt; select DISTINCT(student_class.student_id) as student_Num,student_class.class_id,\n 2 event.event_id, event.event_name\n 3 from student_class, event\n 4 where student_class.class_id = '10'\n 5 and event.class_id = '10';\n\nSTUDENT_NUM CLASS_ID EVENT_ID EVENT_NAME\n----------- ---------- ---------- --------------------------------------------------\n 12 10 2 Flag FOOtball Game\n 12 10 5 PICKUP SOCCER GAME\n 9 10 5 PICKUP SOCCER GAME\n 16 10 5 PICKUP SOCCER GAME\n 6 10 2 Flag FOOtball Game\n 18 10 5 PICKUP SOCCER GAME\n 4 10 5 PICKUP SOCCER GAME\n 4 10 2 Flag FOOtball Game\n 16 10 2 Flag FOOtball Game\n 20 10 2 Flag FOOtball Game\n 3 10 5 PICKUP SOCCER GAME\n 2 10 5 PICKUP SOCCER GAME\n 3 10 2 Flag FOOtball Game\n 8 10 2 Flag FOOtball Game\n 9 10 2 Flag FOOtball Game\n 2 10 2 Flag FOOtball Game\n 6 10 5 PICKUP SOCCER GAME\n 20 10 5 PICKUP SOCCER GAME\n 18 10 2 Flag FOOtball Game\n 8 10 5 PICKUP SOCCER GAME\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"19191556","answer_count":"1","comment_count":"3","creation_date":"2013-10-04 22:00:17.48 UTC","last_activity_date":"2013-10-04 22:13:51.447 UTC","last_edit_date":"2013-10-04 22:01:18.08 UTC","last_editor_display_name":"","last_editor_user_id":"163024","owner_display_name":"","owner_user_id":"2756176","post_type_id":"1","score":"0","tags":"sql","view_count":"33"} +{"id":"14334688","title":"Copy cell selection from Excel into JSF 2 component","body":"\u003cp\u003eI need to copy the data of multiple excel cells into a JSF2 component.\nIt does not matter whether it's a primefaces, openfaces or richfaces component.\nPrimefaces has a nice component called sheet, but I don't think it provides the feature to copy data from excel to it.\u003c/p\u003e\n\n\u003cp\u003eCan anybody tell me, if there is a way? I do not want to use a file upload.\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2013-01-15 09:32:49.007 UTC","last_activity_date":"2013-01-15 09:32:49.007 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1602475","post_type_id":"1","score":"1","tags":"excel|jsf-2|components|copy-paste","view_count":"653"} +{"id":"45784237","title":"NSAttributedString Swift 4","body":"\u003cp\u003eThis code worked in Swift 3, but Xcode is complaining in Swift 4. I keep getting this error:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eCannot convert value of type '[NSAttributedString.DocumentAttributeKey : NSAttributedString.DocumentType]' to expected argument type '[NSAttributedString.DocumentReadingOptionKey : Any]'\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI'm sure it's simple but every change I've tried isn't working.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunc eulaAlert() {\n print(\"\\(globalVars.eulaAgree)\")\n let url = Bundle.main.url(forResource: \"AltitudeAlertUA\", withExtension: \"rtf\")!\n let opts = [NSAttributedString.DocumentAttributeKey.documentType:NSAttributedString.DocumentType.rtf]\n var d : NSDictionary? = nil\n let s = try! NSAttributedString(url: url, options: opts, documentAttributes: \u0026amp;d)\n self.tv.attributedText = s\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-08-20 16:11:34.037 UTC","last_activity_date":"2017-08-20 16:11:34.037 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6673189","post_type_id":"1","score":"2","tags":"ios|swift","view_count":"52"} +{"id":"14658390","title":"Spotify cocoalibspotify offline status set to 1 but all tracks stuck at waiting","body":"\u003cp\u003eI'm trying to allow tracks from Spotify to be played offline in my iOS app. I've read several posts about this problem, but none of the suggestions work for me.\u003c/p\u003e\n\n\u003cp\u003eThe issue is a playlist marked for download gets stuck with all tracks \"waiting\" to be downloaded. I can recreate it regularly in a fresh app install by creating a playlist, adding a few tracks, and mark playlist for download. Tracks download as expected. Then I background the app by tapping the home button and kill the app in the app tray. Then I start the app and successfully login with – attemptLoginWithUserName:existingCredential: I create another playlist, add some more tracks and mark for offline. The new playlist's offline status shows downloaded, but all the tracks are waiting.\u003c/p\u003e\n\n\u003cp\u003eI've tried:\u003c/p\u003e\n\n\u003cp\u003e1) flushCaches: after playlists are downloaded\u003c/p\u003e\n\n\u003cp\u003e2) flushCaches: in applicationDidEnterBackground\u003c/p\u003e\n\n\u003cp\u003e3) logout in applicationDidEnterBackground:\u003c/p\u003e\n\n\u003cp\u003e4) logout in applicationWillTerminate:\u003c/p\u003e\n\n\u003cp\u003e5) setting badly behaving playlist markedforofflineplayback to off, flush caches and set markedforofflineplayback to off again. \u003c/p\u003e\n\n\u003cp\u003eSo far, once a playlist has gotten stuck, the only way to get another playlist downloaded has been to delete the app and reinstall.\u003c/p\u003e\n\n\u003cp\u003eDoes anyone have other suggestions for how to solve this problem?\u003c/p\u003e","accepted_answer_id":"14662939","answer_count":"1","comment_count":"0","creation_date":"2013-02-02 03:51:00.633 UTC","favorite_count":"1","last_activity_date":"2013-02-02 14:34:23.723 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2034485","post_type_id":"1","score":"1","tags":"ios|spotify|cocoalibspotify-2.0","view_count":"678"} +{"id":"27677000","title":"Why don't need install SSL certificate when browser access a http webpage with https APIs","body":"\u003cp\u003eI am studying SSL. The certificate thing confuses me a lot. Assume that there is a web page \u003ca href=\"http://foo.com\" rel=\"nofollow\"\u003ehttp://foo.com\u003c/a\u003e, it uses some https APIs(like login) on this page. When browser access this page, It should have https request. But Browser can access it without installing certificate. just like accessing a normal http webpage.\u003c/p\u003e\n\n\u003cp\u003eHow this happened? \u003c/p\u003e\n\n\u003cp\u003eI mean there are https requests when load this http page, the browser should establish SSL connection with server and check certificate from server just like accessing https webpage. But we don't install any certificate for \u003ca href=\"http://foo.com\" rel=\"nofollow\"\u003ehttp://foo.com\u003c/a\u003e, browser can access it normally. \u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-12-28 13:47:54.527 UTC","last_activity_date":"2014-12-28 19:22:51.363 UTC","last_edit_date":"2014-12-28 14:06:26.23 UTC","last_editor_display_name":"","last_editor_user_id":"4399673","owner_display_name":"","owner_user_id":"4399673","post_type_id":"1","score":"-1","tags":"ssl|https","view_count":"124"} +{"id":"29437492","title":"How to use Postgres sequence with JPA?","body":"\u003cp\u003eI have a 'customer' table in my postgresql database with a particular field: \u003ccode\u003ecus_number\u003c/code\u003e which has a sequence defined. This field is not the primary key, there's already an \u003ccode\u003ecus_id\u003c/code\u003e field.\u003c/p\u003e\n\n\u003cp\u003eThe default value of the cus_number is \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enextval('customer_cus_number_seq'::regclass) it's the sequence.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWith pgadmin, when I insert a row in this customer table with a null value as the \u003ccode\u003ecus_number\u003c/code\u003e it works fine and the default value sequence is used.\nBut in my webap, when I persist a new Customer(), the row inserted has nothing in the field \u003ccode\u003ecus_number\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eHere is my custom entity definition : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class Customer implements Serializable {\n@Id\n@GeneratedValue(strategy = GenerationType.IDENTITY)\n@Basic(optional = false)\n@Column(name = \"pers_id\")\nprivate Integer id;\n\n...\n\n@Column(name = \"cus_number\")\nprivate Integer number;\n\n...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e}\u003c/p\u003e\n\n\u003cp\u003eAnd the sequence script : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e CREATE SEQUENCE customer_cus_number_seq\n INCREMENT 1\n MINVALUE 100\n MAXVALUE 9223372036854775807\n START 114\n CACHE 1;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eALTER TABLE customer_cus_number_seq\n OWNER TO fizzconsulting;\u003c/p\u003e\n\n\u003cp\u003eDo you some tips for me please ?\u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","accepted_answer_id":"29451661","answer_count":"2","comment_count":"4","creation_date":"2015-04-03 18:10:40.07 UTC","favorite_count":"1","last_activity_date":"2015-04-04 21:37:30.9 UTC","last_edit_date":"2015-04-03 18:17:12.543 UTC","last_editor_display_name":"","last_editor_user_id":"330315","owner_display_name":"","owner_user_id":"4169211","post_type_id":"1","score":"0","tags":"postgresql|jpa","view_count":"3660"} +{"id":"33815908","title":"Grails installing REST client plugin","body":"\u003cp\u003eI'm trying to start fresh a new project with rest calls.\nI downloaded the 'http-builder-helper' \u003ca href=\"https://github.com/bobbywarner/grails-http-builder-helper\" rel=\"nofollow\"\u003ehttps://github.com/bobbywarner/grails-http-builder-helper\u003c/a\u003e, then I tried the command 'grails install' and I get this error :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eTask 'install' is ambiguous in root project 'http-builder-helper'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e| Grails Version: 3.0.9\n| JVM Version: 1.7.0_79\u003c/p\u003e","accepted_answer_id":"33821438","answer_count":"1","comment_count":"0","creation_date":"2015-11-19 22:56:18.027 UTC","favorite_count":"1","last_activity_date":"2015-11-20 22:57:33.817 UTC","last_edit_date":"2015-11-19 23:25:51.427 UTC","last_editor_display_name":"","last_editor_user_id":"160313","owner_display_name":"","owner_user_id":"2406102","post_type_id":"1","score":"2","tags":"rest|grails","view_count":"429"} +{"id":"44096391","title":"Arduino Bluetooth Serial","body":"\u003cp\u003eI keep getting weird problems working with the Arduino bluetooth, and before I go buy another I wanted to see if anyone had some insight.\u003c/p\u003e\n\n\u003cp\u003eDespite setting the Serial monitor and Arduino baud rates both to 9600, I get a mismatch and all the outputted characters are garbled. Additionally, when I try and connect from a Windows computer, using Serial.println(\"Words\") gets caught in Serial.read(), and Serial.read() ends up returning \"w\" from \"Words\" (I know because changing the first letter results in a different value from Serial.read(). I'm very confused, and any help would be hugely appreciated.\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2017-05-21 11:36:20.62 UTC","last_activity_date":"2017-06-07 02:29:16.98 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6595008","post_type_id":"1","score":"0","tags":"bluetooth|arduino|serial-port|baud-rate","view_count":"50"} +{"id":"24385473","title":"mIRC - On text is not working for points","body":"\u003cp\u003eCode;\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eon *:TEXT:*:*: {\n if (%nachrichten. [ $+ [ $nick ] ] == 4) {\nset %nachrichten. $+ $nick 0\nmsg $chan test\nadd.pts $+(#,.,$nick)}\n }\n else { inc %nachrichten. $+ $nick }\n msg $chan test2\n .timer $+ $nick 1 300 unset %nachrichten. [ $+ [ $nick ] ]\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCode allows users to gain points from being active in chat. Problem is if they do !party which is a command. It won't output the !party msg?\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2014-06-24 11:30:23.81 UTC","last_activity_date":"2014-06-24 11:30:23.81 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3764992","post_type_id":"1","score":"0","tags":"irc|mirc|twitch","view_count":"150"} +{"id":"40341297","title":"Floating action button over webview not working","body":"\u003cp\u003eI have a map fragment using a webview and i want to add a button to submit a new location opening a new fragment to do this. \u003c/p\u003e\n\n\u003cp\u003eThe button it's shown but it don't work.\u003c/p\u003e\n\n\u003cp\u003eI hope you can tell me where I failed on my class code.\u003c/p\u003e\n\n\u003cp\u003eThanks all!\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eXML\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;com.melnykov.fab.FloatingActionButton\n android:id=\"@+id/fabButton\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_marginBottom=\"24dp\"\n android:layout_marginRight=\"24dp\"\n android:src=\"@drawable/ic_action_new\"\n app:fabSize=\"normal\"\n android:elevation=\"2dp\"\n android:layout_marginEnd=\"41dp\"\n android:layout_alignParentBottom=\"true\"\n android:layout_alignParentRight=\"true\"\n android:layout_alignParentEnd=\"true\"\n fab:fab_colorNormal=\"@color/colorFloatActionButton\"\n fab:fab_colorPressed=\"@color/colorFloatActionButton\"\n fab:fab_colorRipple=\"@color/colorRipple\" /\u0026gt;\n\n\n \u0026lt;WebView\n android:layout_width=\"match_parent\"\n android:layout_height=\"match_parent\"\n android:id=\"@+id/webView\"\n android:layout_gravity=\"center_horizontal\"\n android:layout_alignParentTop=\"true\"\n android:layout_alignParentLeft=\"true\"\n android:layout_alignParentStart=\"true\" /\u0026gt;\n\n\n\u0026lt;/RelativeLayout\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eJAVA CLASS\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e @Override\npublic View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n\n View rootView = inflater.inflate(R.layout.activity_web_view_map, container, false);\n\n mFabButton = (FloatingActionButton) rootView.findViewById(XXXXXXX.R.id.fabButton);\n mFabButton.setImageResource(XXXXXX.R.drawable.ic_action_new);\n\n mFabButton.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n\n FragmentManager fm = getFragmentManager();\n FragmentTransaction ft = fm.beginTransaction();\n ft.replace(R.id.webView, new New_Map_Post(), \"fragment_screen\");\n ft.commit();\n\n\n }\n });\n\n View v = inflater.inflate(R.layout.activity_web_view_map, container, false);\n mWebView = (WebView) v.findViewById(R.id.webView);\n mWebView.loadUrl(\"https://www.google.com/maps/MYMAP\");\n\n WebSettings webSettings = mWebView.getSettings();\n webSettings.setJavaScriptEnabled(true);\n mWebView.setWebViewClient(new WebViewClient());\n\n return v;\n\n\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"7","creation_date":"2016-10-31 11:30:15.393 UTC","last_activity_date":"2016-10-31 11:30:15.393 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6859223","post_type_id":"1","score":"0","tags":"java|android|button|webview","view_count":"420"} +{"id":"15092081","title":"WCF Rest - mixing HTTP and HTTPS in one ServiceContract","body":"\u003cp\u003eI currently have a Http Rest WCF4 service, defined by the ServiceContract \u003ccode\u003eIEventService\u003c/code\u003e which is exposed only over HTTP.\u003c/p\u003e\n\n\u003cp\u003eI have been tasked with making \u003cstrong\u003esome\u003c/strong\u003e of the OperationContracts to work only over HTTPS So I have split those methods into a seperate ServiceContract called \u003ccode\u003eIEventServiceHTTPS\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eHosting this on my dev box using IIS7.5 with a self-signed certificate, the methods which are part of the \u003ccode\u003eIEventServiceHTTPS\u003c/code\u003e are called fine over HTTPS and not over HTTP, as expected.\u003c/p\u003e\n\n\u003cp\u003eHowever the HTTP methods exposed by \u003ccode\u003eIEventService\u003c/code\u003e now do not work.\u003c/p\u003e\n\n\u003cp\u003eI get the following when trying to access the HTTP methods:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eHTTP Error 403.4 - Forbidden\nThe page you are trying to access is secured with Secure Sockets Layer (SSL).\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eweb.config with my changes:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;system.serviceModel\u0026gt;\n \u0026lt;serviceHostingEnvironment multipleSiteBindingsEnabled=\"true\" aspNetCompatibilityEnabled=\"true\"\u0026gt;\n \u0026lt;serviceActivations\u0026gt;\n \u0026lt;add service=\"Api.EventService\" relativeAddress=\"EventService.svc\" factory=\"Api.UnityServiceHostFactory\"/\u0026gt;\n \u0026lt;/serviceActivations\u0026gt;\n \u0026lt;/serviceHostingEnvironment\u0026gt;\n \u0026lt;behaviors\u0026gt;\n \u0026lt;serviceBehaviors\u0026gt;\n \u0026lt;behavior name=\"Api.EventServiceBehavior\"\u0026gt;\n \u0026lt;serviceMetadata httpGetEnabled=\"true\" httpsGetEnabled=\"true\"/\u0026gt;\n \u0026lt;serviceDebug includeExceptionDetailInFaults=\"true\"/\u0026gt;\n \u0026lt;/behavior\u0026gt;\n \u0026lt;/serviceBehaviors\u0026gt;\n \u0026lt;endpointBehaviors\u0026gt;\n \u0026lt;behavior name=\"WebBehavior\"\u0026gt;\n \u0026lt;webHttp/\u0026gt;\n \u0026lt;/behavior\u0026gt;\n \u0026lt;/endpointBehaviors\u0026gt;\n \u0026lt;/behaviors\u0026gt;\n \u0026lt;services\u0026gt;\n \u0026lt;service behaviorConfiguration=\"Api.EventServiceBehavior\" name=\"Api.EventService\"\u0026gt;\n \u0026lt;endpoint address=\"\" binding=\"webHttpBinding\" behaviorConfiguration=\"WebBehavior\" bindingConfiguration=\"webBindingHTTP\" contract=\"Api.IEventService\"/\u0026gt;\n **\u0026lt;endpoint address=\"\" binding=\"webHttpBinding\" behaviorConfiguration=\"WebBehavior\" bindingConfiguration=\"webBindingHTTPS\" contract=\"Api.IEventServiceHTTPS\"/\u0026gt;**\n \u0026lt;/service\u0026gt;\n \u0026lt;/services\u0026gt;\n \u0026lt;bindings\u0026gt;\n \u0026lt;webHttpBinding\u0026gt;\n \u0026lt;binding name=\"webBindingHTTP\"\u0026gt;\n \u0026lt;security mode=\"None\"\u0026gt;\u0026lt;/security\u0026gt;\n \u0026lt;/binding\u0026gt;\n **\u0026lt;binding name=\"webBindingHTTPS\"\u0026gt;\n \u0026lt;security mode=\"Transport\"\u0026gt;\n \u0026lt;/security\u0026gt;\n \u0026lt;/binding\u0026gt;**\n \u0026lt;/webHttpBinding\u0026gt;\n \u0026lt;/bindings\u0026gt;\n \u0026lt;/system.serviceModel\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny help would be greatly appreciated, thanks.\u003c/p\u003e","accepted_answer_id":"15093388","answer_count":"1","comment_count":"0","creation_date":"2013-02-26 14:50:56.293 UTC","favorite_count":"2","last_activity_date":"2013-02-26 15:48:25.48 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1097664","post_type_id":"1","score":"3","tags":"wcf|http|ssl|https|webhttpbinding","view_count":"2183"} +{"id":"14727585","title":"How to make fgets stop reading from the keyboard","body":"\u003cp\u003eI am trying to run somebody's code and I am new to c so I have a problem with reading the input. The following loop read it from the keyboard, but when I am finished it doesn't stop\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ewhile (fgets(in_line, MAXLINE, stdin) != NULL ) {\n ...\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs there any kind of character that I have to enter to simulate 'NULL'? I've tried \\0 but that doesn't seem to work. \u003c/p\u003e\n\n\u003cp\u003eI am very sorry, this problem has probably arisen tons of times, but I just cannot find a proper explanation.\u003c/p\u003e","accepted_answer_id":"14727619","answer_count":"1","comment_count":"0","creation_date":"2013-02-06 11:10:13.8 UTC","last_activity_date":"2013-02-06 11:17:42.487 UTC","last_edit_date":"2013-02-06 11:17:42.487 UTC","last_editor_display_name":"","last_editor_user_id":"1931271","owner_display_name":"","owner_user_id":"1859586","post_type_id":"1","score":"0","tags":"c","view_count":"1180"} +{"id":"45078772","title":"Ajax get with jsonp gives \"SyntaxError: missing ; before statement\" error","body":"\u003cp\u003eI am using jqeuery for GET request and getting a response in json format. But when I try to use it, it throws below error message in browser developer tools console.\u003c/p\u003e\n\n\u003cp\u003e\u0026lt;\u0026lt; SyntaxError: missing ; before statement[Learn More] hosts:1:10 \u003e\u003e\u003c/p\u003e\n\n\u003cp\u003eBelow is my code.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$.ajax({\n type: \"GET\", \n url: url, \n async: false,\n cache: false,\n data: { \"filter\": \"host.vars.osgroup==\\\"unix\\\"\"},\n jsonp: \"callback\",\n dataType: \"jsonp\",\n contentType: \"application/json; charset=utf-8\",\n headers: {\n accept:'application/json',\n \"Authorization\": \"Basic \" + btoa(username + \":\" + password)\n }\n // },\n // success : function(data)\n // {\n // console.log(data);\n // }\n\n})\n .done(function(html) {\n $(\"#displayElement\").append(html);\n });\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"3","creation_date":"2017-07-13 11:04:19.09 UTC","last_activity_date":"2017-09-07 06:55:09.34 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6727208","post_type_id":"1","score":"0","tags":"javascript|jquery|ajax|api|jsonp","view_count":"214"} +{"id":"30866693","title":"Memory leak with Mongo Java Connection","body":"\u003cp\u003eI am constructing MongoClient Connection in the below manner :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic static synchronized MongoClient getInstance(String mongoDbUri) {\n try {\n // Standard URI format: mongodb://[dbuser:dbpassword@]host:port/dbname\n if( mongoClient == null ){\n mongoClient = new MongoClient(\n new MongoClientURI(mongoDbUri));\n }\n } catch (Exception e) {\n log.error(\n \"Error mongo connection : \",\n e.getCause());\n }\n return mongoClient;\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOver a period of time when multiple transaction is run I am seeing some memory eat up with the application which is not getting released.\u003c/p\u003e\n\n\u003cp\u003eWhen analysed the heap dump saw that there was memory consumption was maximum with the class \u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003ecom.mongodb.internal.connection.PowerOfTwoBufferPool\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eThe mongo client is trying to connect to a mongos instance.The application has 3 replica sets on 3 shards and one config server to hold the metadata.\u003c/p\u003e\n\n\u003cp\u003eTo add more details to the same , I have a spring managed bean annotated with @Component.There is an annotation with @PostConstruct for the bean in which the above method is called.In the spring class we are doing insert/update/create using the Mongo Client.\u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","answer_count":"0","comment_count":"11","creation_date":"2015-06-16 11:48:45.943 UTC","favorite_count":"0","last_activity_date":"2015-06-16 12:03:35.62 UTC","last_edit_date":"2015-06-16 12:03:35.62 UTC","last_editor_display_name":"","last_editor_user_id":"2470141","owner_display_name":"","owner_user_id":"2470141","post_type_id":"1","score":"5","tags":"java|mongodb|memory-leaks","view_count":"879"} +{"id":"10469340","title":"django haystack - using a generic Views function to do search","body":"\u003cp\u003eI'm trying to convert this code from haystack into urls.py calling a generic view function, but I'm getting \u003cstrong\u003e'function' object has no attribute 'status_code'\u003c/strong\u003e. I think it's because it's not returning a response object. \u003c/p\u003e\n\n\u003cp\u003ehaystack code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efrom django.conf.urls.defaults import *\nfrom haystack.forms import ModelSearchForm, HighlightedSearchForm\nfrom haystack.query import SearchQuerySet\nfrom haystack.views import SearchView\n\nsqs = SearchQuerySet().filter(author='john')\n\n# With threading...\nfrom haystack.views import SearchView, search_view_factory\n\nurlpatterns = patterns('haystack.views',\n url(r'^$', search_view_factory(\n view_class=SearchView,\n template='search/search.html',\n searchqueryset=sqs,\n form_class=HighlightedSearchForm\n ), name='haystack_search'),\n)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy new urls.py just calls search() in views.py.\u003c/p\u003e\n\n\u003cp\u003eIn views.py, I have\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef search(request):\n sqs = SearchQuerySet().all()\n return search_view_factory(\n view_class=SearchView,\n template='search/search.html',\n searchqueryset=sqs,\n form_class=HighlightedSearchForm\n )\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm doing this because I want to mess around with sqs quite a bit depending on user inputs and status.\u003c/p\u003e\n\n\u003cp\u003eShouldn't search_view_factory above return a SearchView class, seems like it calls create_response() automatically which returns render_to_response. Tried calling create_response() manually, but that wasn't working either.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://github.com/toastdriven/django-haystack/blob/master/haystack/views.py\" rel=\"nofollow\"\u003edjango-haystack code\u003c/a\u003e can be found here.\u003c/p\u003e\n\n\u003cp\u003eThank you.\u003c/p\u003e","accepted_answer_id":"10469648","answer_count":"1","comment_count":"0","creation_date":"2012-05-06 08:57:09.36 UTC","favorite_count":"1","last_activity_date":"2012-05-06 09:58:42.863 UTC","last_edit_date":"2012-05-06 09:02:41.543 UTC","last_editor_display_name":"","last_editor_user_id":"589876","owner_display_name":"","owner_user_id":"589876","post_type_id":"1","score":"3","tags":"django|django-views|django-urls|django-haystack","view_count":"2382"} +{"id":"14778392","title":"Input dialog loop end early","body":"\u003cp\u003eWhen the user enters nothing in the input dialog box it ends the loop anyway. I've debugged the code and name is indeed \"\" when the user enters nothing. When the window is closed or cancel is clicked it doesn't exit the loop. It's like it sees the name == null and not the name == \"\". Here is the loop.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ewhile(name == \"\" || name == null){\n name = JOptionPane.showInputDialog(\"Enter you're name:\");\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCan anyone provide some insight for me?\u003c/p\u003e","answer_count":"4","comment_count":"0","creation_date":"2013-02-08 17:48:30.763 UTC","last_activity_date":"2013-02-08 18:16:44.253 UTC","last_edit_date":"2013-02-08 18:16:44.253 UTC","last_editor_display_name":"","last_editor_user_id":"232196","owner_display_name":"","owner_user_id":"2055311","post_type_id":"1","score":"0","tags":"java|while-loop|joptionpane","view_count":"387"} +{"id":"33260789","title":"Create and Send Zip file -NODE JS","body":"\u003cp\u003eI'm trying to create and then send zip file to client. I know how to create it but I've got a problem with send it to client. I tried many ways. \nI'm sending POST request from Client and as response I want to send a file.\nThis is my server-site example code\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar Zip = require('node-zip');\nrouter.post('/generator', function(req, res, next) {\n var zip = new Zip;\n\n zip.file('hello.txt', 'Hello, World!');\n var options = {base64: false, compression:'DEFLATE'};\n fs.writeFile('test1.zip', zip.generate(options), 'binary', function (error) {\n console.log('wrote test1.zip', error);\n });\n res.setHeader('Content-disposition', 'attachment; filename=test1.zip');\n res.download('test1.zip');\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e});\n I also tried something like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e res.setHeader('Content-disposition', 'attachment; filename=' + filename);\n res.setHeader('Content-type', mimetype);\n\n var filestream = fs.createReadStream(file);\n filestream.pipe(res);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI tried to use such libraries as:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003e\u003cp\u003enode-zip \u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003earchiver\u003c/p\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eCan anyone explain me how to do that ?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-10-21 13:34:45.43 UTC","last_activity_date":"2015-10-21 13:53:11.993 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4585678","post_type_id":"1","score":"2","tags":"javascript|node.js|post|zip","view_count":"1684"} +{"id":"46862328","title":"How to write a spec file not to run ./configure in CentOS7","body":"\u003cp\u003eI have written spec file just copy some files to some directory on CentOS7.\u003c/p\u003e\n\n\u003cp\u003e...(snip)...\u003c/p\u003e\n\n\u003cp\u003e%prep\n%setup -q\u003c/p\u003e\n\n\u003cp\u003e%build\u003c/p\u003e\n\n\u003cp\u003e%install\ninstall -m 644 -p $RPM_SOURCE_DIR/some/file \\\n $RPM_BUILD_ROOT%{_sysconfdir}/file\u003c/p\u003e\n\n\u003cp\u003e%clean\nrm -rf $RPM_BUILD_ROOT\u003c/p\u003e\n\n\u003cp\u003e%files\n%doc\n%config(noreplace) %{_sysconfdir}/some/file\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003e$cd rpmbuild\n$rpmbuild SPECS/my.spec\n...(snip)...\n+ ./configure --build=x86_64 ...\n/var/tmp/rpm-tmp.RidAmi: line41: ./configure: No such file or directory\u003c/p\u003e\n\n\u003cp\u003eI have not written \"./configure\" ... anywhere.\nI don't know why rpmbuild fails.\nThanks.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-10-21 10:30:31.093 UTC","last_activity_date":"2017-10-21 11:02:15.713 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5619648","post_type_id":"1","score":"0","tags":"rpmbuild","view_count":"18"} +{"id":"34224190","title":"Clone Enity framework POCO","body":"\u003cp\u003eI need to clone an Entity Framework object into a new object so i can save it into the database .\u003cbr\u003e\nIs there any easy way to do this without reflection ?\u003cbr\u003e\nIf reflection is the only way to go then please post some code for me too . \u003c/p\u003e\n\n\u003cp\u003eThe question here \n\u003ca href=\"https://stackoverflow.com/questions/3934208/how-to-clone-poco-entity-and-add-to-context\"\u003eHow to Clone POCO entity and add to context\u003c/a\u003e\nis using serialization and i do not see a need for doing that , also the answer is not using DbContext so its totally irrelevant to my question .\u003c/p\u003e\n\n\u003cp\u003ethanks \u003c/p\u003e","accepted_answer_id":"34228211","answer_count":"2","comment_count":"8","creation_date":"2015-12-11 13:00:22.777 UTC","last_activity_date":"2015-12-11 16:37:29.447 UTC","last_edit_date":"2017-05-23 11:52:23.38 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"2120199","post_type_id":"1","score":"-5","tags":"c#|.net|entity-framework-6|poco","view_count":"222"} +{"id":"39408338","title":"ZF2 - including head files when loading view with ajax / setTerminal(true)","body":"\u003cp\u003eI am currently loading parts of my site using ajax (jquery 1.x in a ZF2 app), which is working nicely, until i come to load a view that has dependent javascript/css files declared in the head of that view. Declaring \u003ccode\u003esetTerminal(true)\u003c/code\u003e on the ViewModel only returns the content portion of the view, so any \u003ccode\u003e$this-\u0026gt;headScript()-\u0026gt;appendFile()\u003c/code\u003e, \u003ccode\u003e$this-\u0026gt;inlineScript()-\u0026gt;appendFile()\u003c/code\u003e and \u003ccode\u003e$this-\u0026gt;headLink()-\u0026gt;appendStylesheet()\u003c/code\u003e files are not included.\u003c/p\u003e\n\n\u003cp\u003eThis means that whilst the content is correctly loaded via ajax, it is not functional if there are additional scripts that need to be used in that view.\u003c/p\u003e\n\n\u003cp\u003eIs there an approach of including these files somehow, so that the ajax-requested content works? \u003c/p\u003e\n\n\u003cp\u003eAs an example:\nSay i am developing a dashboard, that uses ajax to pull data from several different controllers, such as User information, Subscription information etc. In the dashboard i could just include all the javascript/css files that are defined in the User and Subscription views, but surely that is just polluting the Dashboard view with a lot of js/css files? There must be a better way.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-09-09 09:32:03.69 UTC","last_activity_date":"2016-09-09 22:09:07.303 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2298594","post_type_id":"1","score":"0","tags":"jquery|ajax|zend-framework2|zend-view","view_count":"43"} +{"id":"42101237","title":"ARM template Parameters","body":"\u003cp\u003eCurrently, all parameters passed to a template are hardcoded (for instance, Windows Vm Version: 2012-Datacenter, 2016 Datacenter and so on). is their a way to dynamically update these values based on the type of subscription or the location?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-02-07 22:29:33.73 UTC","last_activity_date":"2017-02-08 07:04:15.107 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7530888","post_type_id":"1","score":"0","tags":"azure-resource-manager","view_count":"101"} +{"id":"14326634","title":"PhantomJs rasterization - possible to make a multipage pdf from multiple pages?","body":"\u003cp\u003eI'm running phantom using their rasterize example script to create a single-page pdf of a page.\u003c/p\u003e\n\n\u003cp\u003eI have several different pages that I would like to rasterize and concatenate into a multipage pdf file. Is this possible with what is currently there or do I have to bring a tool like pdftk into the mix?\u003c/p\u003e\n\n\u003cp\u003e(alternately, is there another node module that I can use for this - I found pdftk-helper but it's shall we say...unfinished)\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-01-14 21:05:42.087 UTC","last_activity_date":"2013-05-08 07:36:10.133 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5056","post_type_id":"1","score":"6","tags":"pdf|npm|phantomjs","view_count":"2181"} +{"id":"11402426","title":"why my uploading image code accept avi and flv files","body":"\u003cp\u003eI write php code to allow user to submit image and upload it to the server. I get it working and the server receives the image. But it seems like the server is accepting even .avi and .flv files. I do write if/else statement for checking whether a file is an image, but why it doesn't work? Thank you\u003c/p\u003e\n\n\u003cp\u003eThis is my php code \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$tmpPath = $_FILES[\"image\"][\"tmp_name\"];\n$movedPath = \"submit-img/\" . $_POST[\"category\"] . \"/\" . $_FILES[\"image\"][\"name\"];\n\n$fullURL = parse_url($_SERVER['HTTP_REFERER']);\n$query = explode(\"\u0026amp;\", $fullURL[\"query\"]); //only choose first query\n$prevPage = \"gallery.php\" . \"?\" . $query[0];\n\n//I get the file type here\n$fileType = strpos($_FILES[\"image\"][\"type\"], \"image/\");\n\n//if its not an image then redirect to the previous page and send a message\nif ($fileType === false || ($_FILES[\"image\"][\"size\"]) == 0 || $_FILES[\"image\"][\"size\"]/1024 \u0026gt; 5000){\n $prevPage = $prevPage . \"\u0026amp;imgSubmit=none#imgSubmitForm\";\n header(\"Location: \" . $prevPage);\n}else if ($_FILES[\"image\"][\"size\"] \u0026gt; 0){ //if file is an image\n if (!is_file($movedPath)){\n move_uploaded_file($tmpPath, $movedPath);\n }else{\n while (is_file($movedPath)){ \n $extension = strrchr($movedPath, \".\");\n $movedPath = str_replace($extension, \"\", $movedPath) . \"1\" . $extension;\n }\n move_uploaded_file($tmpPath, $movedPath);\n }\n $prevPage = $prevPage . \"\u0026amp;imgSubmit=submitted#imgSubmitForm\";\n header(\"Location: \" . $prevPage);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e}\u003c/p\u003e","accepted_answer_id":"11402674","answer_count":"2","comment_count":"5","creation_date":"2012-07-09 20:16:33.13 UTC","last_activity_date":"2012-07-09 20:36:12.857 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1354823","post_type_id":"1","score":"0","tags":"php|image-uploading","view_count":"340"} +{"id":"15071295","title":"Getting \"cannot insert NULL into (\"schema\".\"table\".\"column\") when column is not null","body":"\u003cp\u003eWhenever I try to create a new myObj in mySchema, it keeps telling me that ID is null, but when I run the debugger, the debugger tells me the object I'm adding has no NULL values. It works on my colleague's machine, but not on mine...\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eMyObj myObj = new myObj() {\n ID = 1234,\n}\ncontainer.AddObject(\"MyObj\", myObj);\ncontainer.ObjectStateManager.ChangeObjectState(myObj, System.Data.EntityState.Added);\n// container extends ObjectContext as created by the EDMX\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is the error I get:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e---------------------------\n\n---------------------------\nSystem.Data.UpdateException: An error occurred while updating the entries. See the inner exception for details. ---\u0026gt; Oracle.DataAccess.Client.OracleException: ORA-01400: cannot insert NULL into (\"myModel\".\"myObj\".\"ID\")\nORA-06512: at line 4\n\n at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure, Boolean bCheck)\n\n at Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode, OracleConnection conn, String procedure, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, Boolean bCheck)\n\n at Oracle.DataAccess.Client.OracleCommand.ExecuteReader(Boolean requery, Boolean fillRequest, CommandBehavior behavior)\n\n at Oracle.DataAccess.Client.OracleCommand.ExecuteDbDataReader(CommandBehavior behavior)\n\n at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)\n\n at System.Data.Mapping.Update.Internal.DynamicUpdateCommand.Execute(UpdateTranslator translator, EntityConnection connection, Dictionary`2 identifierValues, List`1 generatedValues)\n\n at System.Data.Mapping.Update.Internal.UpdateTranslator.Update(IEntityStateManager stateManager, IEntityAdapter adapter)\n\n --- End of inner exception stack trace ---\n\n at System.Data.Mapping.Update.Internal.UpdateTranslator.Update(IEntityStateManager stateManager, IEntityAdapter adapter)\n\n at System.Data.EntityClient.EntityAdapter.Update(IEntityStateManager entityCache)\n\n at System.Data.Objects.ObjectContext.SaveChanges(SaveOptions options)\n\n at System.Data.Objects.ObjectContext.SaveChanges()\n---------------------------\nOK \n---------------------------\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"15076179","answer_count":"4","comment_count":"4","creation_date":"2013-02-25 16:13:34.377 UTC","favorite_count":"2","last_activity_date":"2013-09-05 11:39:36.013 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1466627","post_type_id":"1","score":"1","tags":"c#|entity-framework|inheritance|odac","view_count":"1688"} +{"id":"34658864","title":"Android 'make' error: error: too few arguments to function 'belle_sip_multipart_body_handler_new'","body":"\u003cp\u003eWhen executing \u003ccode\u003esudo make\u003c/code\u003e on an Android project (linphone) I experiencing an error stating: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ejni/..//submodules/linphone/build/android/../../coreapi/chat.c: In function 'linphone_chat_message_process_response_from_post_file':\njni/..//submodules/linphone/build/android/../../coreapi/chat.c:269:4: error: too few arguments to function 'belle_sip_multipart_body_handler_new'\nbh=belle_sip_multipart_body_handler_new(linphone_chat_message_file_transfer_on_progress, msg, first_part_bh);\n\u003c/code\u003e\u003c/pre\u003e \n\n\u003cpre\u003e\u003ccode\u003eIn file included from jni/..//submodules/linphone/build/android/../../coreapi/../../belle-sip/include/belle-sip/belle-sip.h:44:0,\n from jni/..//submodules/linphone/build/android/../../coreapi/../include/sal/sal.h:35,\n from jni/..//submodules/linphone/build/android/../../coreapi/private.h:35,\n from jni/..//submodules/linphone/build/android/../../coreapi/chat.c:26:\n\nmake[1]: *** [obj/local/armeabi-v7a/objs/linphone/chat.o] Error 1\n\n\u003c/code\u003e\u003c/pre\u003e \n\n\u003cpre\u003e\u003ccode\u003emake: *** [generate-libs] Error 2\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnyone have any idea how to resolve this? \u003c/p\u003e\n\n\u003ch2\u003eSource:\u003c/h2\u003e\n\n\u003cp\u003e\u003ca href=\"https://github.com/TheBaobabTeam/linphone-android\" rel=\"nofollow\"\u003ehttps://github.com/TheBaobabTeam/linphone-android\u003c/a\u003e\u003c/p\u003e","answer_count":"0","comment_count":"4","creation_date":"2016-01-07 15:24:21.88 UTC","last_activity_date":"2016-01-07 15:29:12.6 UTC","last_edit_date":"2016-01-07 15:29:12.6 UTC","last_editor_display_name":"","last_editor_user_id":"1176870","owner_display_name":"","owner_user_id":"5758224","post_type_id":"1","score":"0","tags":"android|android-ndk|cmake|makefile|linphone","view_count":"109"} +{"id":"44185750","title":"Json escape unicode in SQL Server","body":"\u003cp\u003eI got JSon string with escape unicode symbols\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\\u041e\\u043f\\u043e\\u0440\\u0430 \\u0448\\u0430\\u0440\\u043e\\u0432\\u0430\\u044f VW GOLF\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI know that 4 digits after \u003ccode\u003e\\u\u003c/code\u003e are the hex code of unicode character.\u003c/p\u003e\n\n\u003cp\u003eSo here's how I decoded those strings\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eALTER FUNCTION dbo.Json_Unicode_Decode(@escapedString VARCHAR(MAX))\nRETURNS VARCHAR(MAX)\nAS \nBEGIN\n DECLARE @pos INT = 0,\n @char CHAR,\n @escapeLen TINYINT = 2,\n @hexDigits TINYINT = 4\n\n SET @pos = CHARINDEX('\\u', @escapedString, @pos)\n\n WHILE @pos \u0026gt; 0\n BEGIN\n SET @char = NCHAR(CONVERT(varbinary(8), '0x' + SUBSTRING(@escapedString, @pos + @escapeLen, @hexDigits), 1))\n SET @escapedString = STUFF(@escapedString, @pos, @escapeLen + @hexDigits, @char)\n SET @pos = CHARINDEX('\\u', @escapedString, @pos)\n END\n\n RETURN @escapedString\nEND\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAre there more delicate ways to decode them?\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2017-05-25 16:46:22.827 UTC","favorite_count":"1","last_activity_date":"2017-05-26 07:39:01.133 UTC","last_edit_date":"2017-05-26 07:39:01.133 UTC","last_editor_display_name":"","last_editor_user_id":"4663587","owner_display_name":"","owner_user_id":"4663587","post_type_id":"1","score":"2","tags":"sql-server|json|unicode-escapes","view_count":"113"} +{"id":"45693766","title":"create a war file via command line in Eclipse Mars","body":"\u003cp\u003eI want to Export my Eclipse project as a .war file. I know that there are many similar questions asked, but using Maven or Ant isn't an option regarding the size of the project and the limited ressources we have. Also the libraries we use are changing alot, which would mean a lot of work with ant. I have been trying around with the jar command, but it does ignore the dependencies. \u003c/p\u003e\n\n\u003cp\u003eIs there an option to accomplish that with the jar command. Would it work having the jar command take the .classpath file of my project into account?\u003c/p\u003e\n\n\u003cp\u003eMy other option would be to write my own Eclipse plugin. What I'm bearing in mind is to simply start Eclipse and trigger the export that way. Any thoughts on that?\u003c/p\u003e\n\n\u003cp\u003eThanks in advance\u003c/p\u003e","accepted_answer_id":"45693943","answer_count":"1","comment_count":"0","creation_date":"2017-08-15 13:23:31.31 UTC","last_activity_date":"2017-08-16 07:35:06.44 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7913206","post_type_id":"1","score":"1","tags":"java|eclipse|batch-file|eclipse-plugin|war","view_count":"114"} +{"id":"43811979","title":"MapReduce to removing duplicates of string","body":"\u003cp\u003eI have a map function which finds out domain names from email id \u0026amp; emit that one to reduce function which counts no of domains. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[\n { email:\"xyz@gmail.com\"},\n { email:\"abc@abc.com\"},\n { email:\"inder@hotmail.com\"},\n { email:\"Ravi@Hotmail.com\"},\n { email:\"xxx@GMail.com\"},\n]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is the function \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edb.collection.mapReduce(\n function() {\n emit(this.email.substr(this.email.indexOf('@') + 1), 1); \n }, \n function(host, count) { \n return Array.sum(count) ; }, \n { out: \"hosts\" } \n)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOutput is good:- \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e gmail.com\n abc.com\n hotmail.com\n Hotmail.com\n GMail.com\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut what I want is \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e gmail.com\n abc.com\n hotmail.com\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI don't want to have domain name with duplicates with Capital letters in between \u0026amp; same name prior to \u0026lt;.com\u003e. Any ideas how to remove duplicates with CAPITAL LETTERS. OR any relevant example is also good. \u003c/p\u003e","accepted_answer_id":"43812232","answer_count":"3","comment_count":"2","creation_date":"2017-05-05 18:52:17.8 UTC","last_activity_date":"2017-05-06 07:44:35.083 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7268486","post_type_id":"1","score":"1","tags":"javascript|node.js|mapreduce","view_count":"61"} +{"id":"33339901","title":"Bind visible to whether field (in kendo observable) has changed or not?","body":"\u003cp\u003eI would like to show or hide elements of my kendo template based on whether or not a field in my model has changed or not.\u003c/p\u003e\n\n\u003cp\u003eFirst attempt:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;input type=\"text\" data-bind=\"value: schedulerEventFieldOne\"/\u0026gt;\n\u0026lt;input type=\"text\" data-bind=\"value: schedulerEventFieldTwo, visible: schedulerEventFieldOne.dirty\"/\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAttempt two is to have a 'schedulerEventFieldOneOrigValue' field added to my model, then doing this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;input type=\"text\" data-bind=\"value: schedulerEventFieldOne\"/\u0026gt;\n\u0026lt;input type=\"text\" data-bind=\"value: schedulerEventFieldTwo, visible: schedulerEventFieldOne != schedulerEventFieldOneOrigValue\"/\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut this gives me an error stating that schedulerEventFieldOne is not defined. It seems that it doesn't like the equality test. Which is odd since, using a \u0026lt; o r \u003e test seems to work fine: \"visible: schedulerEventFieldOne \u003e 0\" \u003c/p\u003e\n\n\u003cp\u003eIs there a way to accomplish my task using the kendo binding? Or will I have to resort to jQuery again?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-10-26 06:47:27.13 UTC","last_activity_date":"2015-10-27 01:46:02.353 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"604389","post_type_id":"1","score":"0","tags":"kendo-ui","view_count":"45"} +{"id":"46511404","title":"Python Multiprocessing:call Function in Subprocess on Object in MainProcess","body":"\u003cp\u003eI have implemented a version of the A3C Algorithm using Pythons multithreading module. Now i have noticed, that the GIL is a bigger Problem than anticipated, so i want to rewrite it as seamlessly as possible using the multiprocessing module instead, but i have problems doing so.\u003c/p\u003e\n\n\u003cp\u003eThe architecture right now looks like this:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003cp\u003eSubthreads that act as the environments which run Episodes\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003e1 Main Thread that reads the data created by the environments and trains the Neural Network with it.\u003c/p\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eAll threads share 1 Neural Network object and associated functions and also the data queue.\u003c/p\u003e\n\n\u003cp\u003eCommunication between those processes is twofold: \u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003cp\u003e(1)Environment-\u003e Queue -\u003e Main Thread NN Training\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003e(2) The Environments call the Neural Network for prediction and need immediate Answers \u003c/p\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eMy problem is mainly with the second part of communication.\nHow can i call a function from a subprocess on an object in the mainprocess?\nIn contrast to Communication (1) Queues seems like a bad option there because\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003cp\u003e(a) the process needs an immediate answer\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003e(b) ordering and correct assignment to the correct subprocess is important\u003c/p\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eHow do i best solve this line of communication?\u003c/p\u003e\n\n\u003cp\u003eAlso I expect these functions to be called 100s of times per second.\nWill message IO overhead become a problem?\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-10-01 10:19:36.78 UTC","last_activity_date":"2017-10-01 10:19:36.78 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2078905","post_type_id":"1","score":"0","tags":"python|multithreading|multiprocessing|keras|reinforcement-learning","view_count":"18"} +{"id":"47090354","title":"Cron job Issue in raspberry-pi","body":"\u003cpre\u003e\u003ccode\u003efrom time import sleep\nimport datetime\nimport os\nimport shutil\nimport cv2\nfrom filename import opvideo\n\n\n## Adding New Directory\npath= '/home/pi/Desktop/teasr/input-video'+opvideo\nos.makedirs(path)\npath1= '/home/pi/Desktop/teasr/input-image'+opvideo\nos.makedirs(path1)\nos.makedirs('/home/pi/Desktop/teasr/output-video'+opvideo)\n\n\n#######capturing\n\ncap = cv2.VideoCapture(0)\n\n# Define the codec and create VideoWriter object\nfourcc = cv2.cv.CV_FOURCC(*'XVID')\nout = cv2.VideoWriter('/home/pi/Desktop/teasr/input-video'+opvideo+ '/video.h264',fourcc, 15.0, (640,480))\ni=0\nwhile(cap.isOpened()):\n ret, frame = cap.read()\n if ret==True:\n\n # write the flipped frame\n out.write(frame)\n cv2.imshow('frame',frame)\n i=i+1\n if cv2.waitKey(1) \u0026amp; i\u0026gt;160:\n cap.release()\n out.release()\n cv2.destroyAllWindows()\n break\n else:\n break\n`\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am looking to run my code after every 10 minutes using cron job. But whenever i my code running it is not capturing video but it is making directory.I am using USB camera for making video. If i am running my code in terminal every thing looks fine and camera is also working. But at cron job it is not working properly.Please help me out to run my full code using cron job.My main purpose is to make video after every 10 mintues when raspberry pi gets switched on. Hoping that someone may help.\u003c/p\u003e","answer_count":"0","comment_count":"10","creation_date":"2017-11-03 07:15:55.413 UTC","last_activity_date":"2017-11-03 09:42:28.93 UTC","last_edit_date":"2017-11-03 09:42:28.93 UTC","last_editor_display_name":"","last_editor_user_id":"8478006","owner_display_name":"","owner_user_id":"8478006","post_type_id":"1","score":"0","tags":"python|opencv|cron|raspberry-pi","view_count":"28"} +{"id":"18206446","title":"How to find out, if facebook ID is a user, group or page","body":"\u003cp\u003ei wonder if there's any way to determine, if a given ID is a user, group or page on facebook. I've checked the \u003ca href=\"https://developers.facebook.com/docs/reference/fql/\" rel=\"nofollow\"\u003eFQL-Reference\u003c/a\u003e, but haven't found anything.\u003c/p\u003e\n\n\u003cp\u003eEDIT:\u003c/p\u003e\n\n\u003cp\u003eNevermind. It seems, that ?metadata=1 does the trick (if the profile is accessible)\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-08-13 10:16:03.567 UTC","last_activity_date":"2013-08-13 10:47:50.907 UTC","last_edit_date":"2013-08-13 10:47:50.907 UTC","last_editor_display_name":"","last_editor_user_id":"2557188","owner_display_name":"","owner_user_id":"2557188","post_type_id":"1","score":"1","tags":"php|facebook|api|facebook-graph-api|facebook-fql","view_count":"518"} +{"id":"27552956","title":"authenticate users from android in Yii","body":"\u003cp\u003eI've this android app from which users can signin and signup to Yii\u003cbr\u003e\nthe signin and signup works fine but when I'm sending other requests like editing Posts and other things, Yii doesn't remember the user, like the user never signed in.\u003cbr\u003e\nnow what information I need to save in the app and send with each request so that Yii know this user has signed in before.\u003cbr\u003e\nthis is the information that I send with my signin request:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eArrayList\u0026lt;NameValuePair\u0026gt; nameValuePair = new ArrayList\u0026lt;NameValuePair\u0026gt;();\nnameValuePair.add(new BasicNameValuePair(\"email\", signinEmail.getText().toString()));\nnameValuePair.add(new BasicNameValuePair(\"password\", signinPassword.getText().toString()));\nHttpRequest siginRequest = new HttpRequest();\nJSONObject signinResult = siginRequest.post(\"users/signin\", nameValuePair);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eplease help me cause it's driving me crazy :(\u003c/p\u003e","accepted_answer_id":"27554745","answer_count":"2","comment_count":"0","creation_date":"2014-12-18 18:06:29.297 UTC","last_activity_date":"2014-12-18 20:04:08.293 UTC","last_edit_date":"2014-12-18 19:58:23.797 UTC","last_editor_display_name":"","last_editor_user_id":"1743997","owner_display_name":"","owner_user_id":"3425760","post_type_id":"1","score":"0","tags":"java|php|android|authentication|yii","view_count":"89"} +{"id":"9833447","title":"Write-Back cache in Java, when to write back","body":"\u003cp\u003eWondering when a write-back should be performed? I thought it was when you're writing to an address, that isn't in the cache already. So if there is something in that slot, that has a valid Dirty Bit, then you'd want to copy that back to its place in main_mem, so you don't lose the data.\u003c/p\u003e\n\n\u003cp\u003eBut what about when you want to read a different address (this is a direct-mapped cache)? \u003c/p\u003e\n\n\u003cp\u003eSo do you perform a write-back everytime there is a cache miss and a dirty bit (Regardless of read or write)?\u003c/p\u003e","accepted_answer_id":"9836539","answer_count":"1","comment_count":"2","creation_date":"2012-03-23 02:39:30.92 UTC","last_activity_date":"2012-03-23 09:13:46.613 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1008883","post_type_id":"1","score":"0","tags":"java|caching","view_count":"276"} +{"id":"28969705","title":"How to compare a date when the date is stored as a varchar","body":"\u003cp\u003eThe dates in my database are stored as varchars instead of date formats due to the way it was first built.\u003c/p\u003e\n\n\u003cp\u003eThe dates look like this:\ne.g. \u003cstrong\u003e1/3/2015\u003c/strong\u003e and\n\u003cstrong\u003e10/3/2015\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI'm trying: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\"SELECT COUNT(*) n FROM tracker WHERE TIMESTAMP(STR_TO_DATE(date, '%d/%m/%Y'))\u0026lt;=NOW()\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, that's not working. It is returning the count of all records, regardless of the date.\u003c/p\u003e\n\n\u003cp\u003eHow can I count only the records where the date is today or in the past?\u003c/p\u003e","accepted_answer_id":"28969723","answer_count":"2","comment_count":"2","creation_date":"2015-03-10 16:59:27.56 UTC","favorite_count":"0","last_activity_date":"2015-03-23 14:32:46.777 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2721465","post_type_id":"1","score":"0","tags":"mysql","view_count":"28"} +{"id":"2519794","title":"LinearLayout of a WebView and a Button","body":"\u003cp\u003eI recently struggled with an apparently simple Android layout: I wanted a \u003ccode\u003eWebView\u003c/code\u003e above a \u003ccode\u003eButton\u003c/code\u003e. It worked fine with the following parameters:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eWebView:\n Height: wrap-content\n Weight: unset (by the way, what is the default?)\n\nButton:\n Height: wrap-content\n Weight: unset\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever if the web page became too big it spilled out over the button. I tried various combinations of weights and heights, and all except one either completely hide the button, or partially cover it. This is the one that works (copied from \u003ca href=\"http://code.google.com/p/apps-for-android/source/browse/trunk/Samples/WebViewDemo/res/layout/main.xml\" rel=\"noreferrer\"\u003ehttp://code.google.com/p/apps-for-android/source/browse/trunk/Samples/WebViewDemo/res/layout/main.xml\u003c/a\u003e):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eWebView:\n Height: 0\n Weight: 1\n\nButton:\n Height: wrap-content\n Weight: unset\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf you change any of those, e.g. give button a weight or change the \u003ccode\u003eWebView\u003c/code\u003e height to wrap-content then it doesn't work. My question is: Why? Can someone please explain what on Earth the android layout system is thinking?\u003c/p\u003e","answer_count":"5","comment_count":"0","creation_date":"2010-03-25 22:11:34.763 UTC","favorite_count":"1","last_activity_date":"2014-08-19 08:11:31.297 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"265521","post_type_id":"1","score":"5","tags":"android|layout|button|webview|android-linearlayout","view_count":"9497"} +{"id":"1229271","title":"Cursor disappears on bitblt","body":"\u003cp\u003eI have a windows application that scrapes pixels from the screen for recording (in the form of a video) to a custom screen-sharing format. The problem is that on machines using a software cursor, blitting from the screen with SRCCOPY|CAPTUREBLIT (so that layered windows also show up in the image) causes the cursor to blink, as described in \u003ca href=\"http://technet.microsoft.com/en-us/magazine/2009.02.windowsconfidential.aspx?pr=blog\" rel=\"nofollow noreferrer\"\u003eCase of the Disappearing Cursor\u003c/a\u003e.\u003c/p\u003e\n\n\u003cp\u003eFor single screen shots, this is not a problem, but when multiple screen shots are taken in rapid succession, the cursor blinks so fast that it sometimes seems to disappear altogether. \u003c/p\u003e\n\n\u003cp\u003eI have looked into using the Windows Media Encoder SDK (as described in a codeproject article, see below) because it doesn't cause the cursor to blink, but there seems to be no way to directly access the frame data. Unfortunately, both real-time encoding and the custom format are both requirements, which makes windows Media Encoder unusable for this purpose.\u003c/p\u003e\n\n\u003cp\u003eI have also tried the DirectX way (described in the same article, see below), and it seems to suffer from the same problem.\u003c/p\u003e\n\n\u003cp\u003eHas anyone else run into this problem? There must be a way around it - many commercial screen sharing programs have no such problem.\u003c/p\u003e\n\n\u003cp\u003earticle: www.codeproject.com/KB/dialog/screencap.aspx\u003c/p\u003e","answer_count":"5","comment_count":"0","creation_date":"2009-08-04 18:54:12.743 UTC","favorite_count":"1","last_activity_date":"2016-06-21 07:27:39.7 UTC","last_editor_display_name":"","owner_display_name":"Joshua Warner","post_type_id":"1","score":"2","tags":"windows|cursor|screenshot|bitblt","view_count":"1259"} +{"id":"11669504","title":"Store st_mode (from stat) in a file and reuse it in chmod","body":"\u003cp\u003ei'm going crazy for this.\nI'm trying to write an archive library which can store and extract files. An archive file looks like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;0,/home/user/file.txt,154,0755\u0026gt;\nfile contents (154 byte)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eEach file is identified by an header ( \u0026lt;...\u003e ), with four \"tags\" (separated by commas), file type (0 for file and 1 for directory), path, size in bytes, permissions (in octal).\nI retrieve the size and the permissions with the stat system call (i'm on Linux).\nMy problem is that i have to convert the octal value from st_mode to a string, store it in the archive file (the fourth tag in the header),then extract it and use it with the chmod syscall.\u003c/p\u003e\n\n\u003cp\u003eTo convert it to string i use:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003echar mode[6];\nsprintf (mode, \"%o\", statr.st_mode);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand to retrieve it i use atoi, but it does not seem to work. For example, the value stored in the 4th tag is 100644, but chmod set the permissions wrong (file not readable by my user).\u003c/p\u003e\n\n\u003cp\u003eI'm not sure if i explained well, i wil post the whole code if is needed (but it don't think there are implementation problem, is just a problem between conversion from octal to string)\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT: Solved!\u003c/strong\u003e Actually the strtol method worked, but i had forgotten to apply it to the directories too (so extracting a directory with files inside caused Segfault because of the bad folder's permission mask). Thanks everybody for help!\u003c/p\u003e","answer_count":"3","comment_count":"4","creation_date":"2012-07-26 12:40:25.367 UTC","last_activity_date":"2012-07-26 14:47:17.12 UTC","last_edit_date":"2012-07-26 14:35:55.203 UTC","last_editor_display_name":"","last_editor_user_id":"1510101","owner_display_name":"","owner_user_id":"1510101","post_type_id":"1","score":"0","tags":"c|unix|chmod|stat","view_count":"6841"} +{"id":"4046242","title":"What is the best way to serve small static images?","body":"\u003cp\u003eRight now I'm base 64 encoding them and using data uris. The idea was that this will somehow lower the number of requests the browser needs to make. Does this bucket hold any water?\u003c/p\u003e\n\n\u003cp\u003eWhat is the best way of serving images in general? DB, from FS, S3?\u003c/p\u003e\n\n\u003cp\u003eI am most interested in python and java based answers, but all are welcome!\u003c/p\u003e","accepted_answer_id":"4046256","answer_count":"4","comment_count":"0","creation_date":"2010-10-28 18:54:43.563 UTC","favorite_count":"1","last_activity_date":"2010-10-28 19:09:23.903 UTC","last_edit_date":"2010-10-28 19:09:23.903 UTC","last_editor_display_name":"","last_editor_user_id":"103154","owner_display_name":"","owner_user_id":"231463","post_type_id":"1","score":"3","tags":"java|javascript|python|image","view_count":"528"} +{"id":"12473604","title":"Canvas game only starts drawing when the window is inactive","body":"\u003cp\u003eI noticed something weird in my canvas code: Im making a game with little flying ghosts. The class for the ghost is below. When I just draw 1 or 2 of em by manually adding the code and having em fly to the right by updating the x every frame for example everything runs smoothly and fine.\u003c/p\u003e\n\n\u003cp\u003eNow I ran another test and added a ghost every 100 frames to an array, update its x by 100 and then draw that ghost to the frame. (code is below the first block, the draw function).\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eNow the problem is that they are actually added and drawn, but I dont see em on the board until I make the window inactive by clicking on the taskbar for example.\u003c/strong\u003e \u003c/p\u003e\n\n\u003cp\u003eAny1 got a clue what is going wrong here?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e /* \n * Class for little ghosts\n */\nfunction Ghost (name) {\n this.name = name;\n this.ghost = new Image();\n this.ghost.src = \"img/ghost.png\";\n this.ghostWidth = 150;\n this.ghostHeight = 100;\n this.ghostSpriteOffsetX = 0;\n this.ghostSpriteOffsetY = 0;\n this.ghostX = 0;\n this.ghostY = 0;\n}\nGhost.prototype.drawGhost = function() {\n context2D.drawImage(this.ghost, this.ghostSpriteOffsetX, this.ghostSpriteOffsetY, this.ghostWidth, this.ghostHeight, this.ghostX, this.ghostY, this.ghostWidth, this.ghostHeight);\n};\nGhost.prototype.goToX = function(x) {\n this.ghostX = x;\n};\nGhost.prototype.goToY = function(y) {\n this.ghostY = y;\n};\nGhost.prototype.turnPink = function() {\n this.ghostSpriteOffsetX = 0;\n};\nGhost.prototype.turnBlue = function() {\n this.ghostSpriteOffsetX = 150;\n};\nGhost.prototype.turnPurple = function() {\n this.ghostSpriteOffsetX = 300;\n };\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e-\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction draw()\n{\n// clear board\ncontext2D.clearRect(0, 0, canvas.width, canvas.height);\n\nif(frame%100==0){\n ghosts[ghostId] = new Ghost(\"g-\"+frame);\n ghosts[ghostId].goToX(frame-100);\n ghostId++;\n}\n// Draw ghost\nfor (i=0; i\u0026lt;ghosts.length; i++)\n{\n ghosts[i].drawGhost();\n}\n\n\n\nframe++;\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"6","creation_date":"2012-09-18 08:58:19.647 UTC","last_activity_date":"2012-09-18 08:58:19.647 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"565380","post_type_id":"1","score":"0","tags":"javascript|canvas","view_count":"102"} +{"id":"45791031","title":"Keep buttons in VBA","body":"\u003cp\u003eI started to learn VBA 2 weeks ago. I have a question regarding the buttons I created to run different procedures. \u003c/p\u003e\n\n\u003cp\u003eFor instance I created a button (in custom ribbon-\u003eassign macro) to run this procedure:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSub MergecsvFiles()\n Shell Environ$(\"COMSPEC\") \u0026amp; \" /c Copy C:\\Users\\user\\Desktop\\new\\*.csv C:\\Users\\user\\Desktop\\new\\CombinedFile.csv \"\nEnd Sub\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut when I send the macro (xlsm) file via e-mail the buttons are not there. How can I manage to send the macro via e-mail and also keep the buttons?\u003c/p\u003e\n\n\u003cp\u003ePS I'm using office 2016.\u003c/p\u003e","answer_count":"0","comment_count":"4","creation_date":"2017-08-21 07:00:05.327 UTC","last_activity_date":"2017-08-21 07:42:45.527 UTC","last_edit_date":"2017-08-21 07:42:45.527 UTC","last_editor_display_name":"","last_editor_user_id":"7720373","owner_display_name":"","owner_user_id":"7720373","post_type_id":"1","score":"1","tags":"vba|excel-vba","view_count":"74"} +{"id":"23086451","title":"\"ValueError: x and y must have same first dimension\", error in plotting graph in pylab","body":"\u003cp\u003eI'm using \u003ca href=\"http://scikit-learn.org/stable/auto_examples/ensemble/plot_adaboost_multiclass.html\" rel=\"nofollow\"\u003ethis tutorial\u003c/a\u003e to build an Adaboost.SAMME classifier for object recognition, using HoG features.\nThis is my code below, mostly only the top part is customized according to my problem, otherwise most of it is the same as in the tutorial. This is a very small test I'm doing, with only 17 images in all, 10 for training, 7 for testing. Once I get this up and running, I'll add loads of more images for proper training.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport sys from scipy \nimport misc, ndimage from skimage \nimport data, io, filter, color, exposure \nfrom skimage.viewer import ImageViewer \nfrom skimage.feature import hog from skimage.transform \nimport resize import matplotlib.pyplot as plt \nfrom sklearn.datasets import make_gaussian_quantiles \nfrom sklearn.ensemble import AdaBoostClassifier \nfrom sklearn.externals.six.moves import xrange \nfrom sklearn.metrics import accuracy_score \nfrom sklearn.tree import DecisionTreeClassifier \nimport pylab as pl from sklearn.externals.six.moves \nimport zip\n\nf = open(\"PATH_TO_LIST_OF_SAMPLES\\\\samples.txt\",'r') \nout = f.read().splitlines() import numpy as np\n\nimgs = [] tmp_hogs = []\n#tmp_hogs = np.zeros((17,1728)) labels = [1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0]\n\ni=0 for file in out:\n filepath = \"PATH_TO_IMAGES\\\\imgs\\\\\"\n readfile = filepath + file\n curr_img = color.rgb2gray(io.imread(readfile))\n imgs.append(curr_img)\n fd, hog_image = hog(curr_img, orientations=8, pixels_per_cell=(16, 16),\n cells_per_block=(1, 1), visualise=True, normalise=True)\n tmp_hogs.append(fd) \n i+=1\n img_hogs = np.array(tmp_hogs, dtype =float) \n\nn_split = 10 \nX_train, X_test = np.array(img_hogs[:n_split]), np.array(img_hogs[n_split:]) \ny_train, y_test = np.array(labels[:n_split]), np.array(labels[n_split:])\n\n\n#now all the code below is straight off the example on scikit-learn's website\n\nbdt_real = AdaBoostClassifier(\n DecisionTreeClassifier(max_depth=2),\n n_estimators=600,\n learning_rate=1)\n\nbdt_discrete = AdaBoostClassifier(\n DecisionTreeClassifier(max_depth=2),\n n_estimators=600,\n learning_rate=1.5,\n algorithm=\"SAMME\")\n\nbdt_real.fit(X_train, y_train)\nbdt_discrete.fit(X_train, y_train)\n\nreal_test_errors = []\ndiscrete_test_errors = []\n\nfor real_test_predict, discrete_train_predict in zip(\n bdt_real.staged_predict(X_test), bdt_discrete.staged_predict(X_test)):\n real_test_errors.append(\n 1. - accuracy_score(real_test_predict, y_test))\n discrete_test_errors.append(\n 1. - accuracy_score(discrete_train_predict, y_test))\n\nn_trees = xrange(1, len(bdt_discrete) + 1)\n\npl.figure(figsize=(15, 5))\n\npl.subplot(131)\npl.plot(n_trees, discrete_test_errors, c='black', label='SAMME')\npl.plot(n_trees, real_test_errors, c='black',\n linestyle='dashed', label='SAMME.R')\npl.legend()\npl.ylim(0.18, 0.62)\npl.ylabel('Test Error')\npl.xlabel('Number of Trees')\n\npl.subplot(132)\npl.plot(n_trees, bdt_discrete.estimator_errors_, \"b\", label='SAMME', alpha=.5)\npl.plot(n_trees, bdt_real.estimator_errors_, \"r\", label='SAMME.R', alpha=.5)\npl.legend()\npl.ylabel('Error')\npl.xlabel('Number of Trees')\npl.ylim((.2,\n max(bdt_real.estimator_errors_.max(),\n bdt_discrete.estimator_errors_.max()) * 1.2))\npl.xlim((-20, len(bdt_discrete) + 20))\n\npl.subplot(133)\npl.plot(n_trees, bdt_discrete.estimator_weights_, \"b\", label='SAMME')\npl.legend()\npl.ylabel('Weight')\npl.xlabel('Number of Trees')\npl.ylim((0, bdt_discrete.estimator_weights_.max() * 1.2))\npl.xlim((-20, len(bdt_discrete) + 20))\n\n# prevent overlapping y-axis labels\npl.subplots_adjust(wspace=0.25)\npl.show()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut I'm getting the following error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eTraceback (most recent call last):\n File \"C:\\Users\\app\\Documents\\Python Scripts\\carclassify.py\", line 101, in \u0026lt;module\u0026gt;\n pl.plot(n_trees, bdt_discrete.estimator_errors_, \"b\", label='SAMME', alpha=.5)\n File \"C:\\Users\\app\\Anaconda\\lib\\site-packages\\matplotlib\\pyplot.py\", line 2987, in plot\n ret = ax.plot(*args, **kwargs)\n File \"C:\\Users\\app\\Anaconda\\lib\\site-packages\\matplotlib\\axes.py\", line 4137, in plot\n for line in self._get_lines(*args, **kwargs):\n File \"C:\\Users\\app\\Anaconda\\lib\\site-packages\\matplotlib\\axes.py\", line 317, in _grab_next_args\n for seg in self._plot_args(remaining, kwargs):\n File \"C:\\Users\\app\\Anaconda\\lib\\site-packages\\matplotlib\\axes.py\", line 295, in _plot_args\n x, y = self._xy_from_xy(x, y)\n File \"C:\\Users\\app\\Anaconda\\lib\\site-packages\\matplotlib\\axes.py\", line 237, in _xy_from_xy\n raise ValueError(\"x and y must have same first dimension\")\nValueError: x and y must have same first dimension\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo I added these lines before the tutorial section of code, in order to see the dimensions of the X and Y arrays:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprint X_train.shape \nprint y_train.shape\nprint X_test.shape \nprint y_test.shape\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand the output was:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e(10L, 48L)\n(10L,)\n(7L, 48L)\n(7L,)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut I'm not sure if the x and y in the error are referring to my X and y... because surely it's normal for the training and testing datasets to have different sizes.\nWhat am I doing wrong?\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2014-04-15 14:18:27.737 UTC","last_activity_date":"2014-04-15 14:18:27.737 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"961627","post_type_id":"1","score":"2","tags":"python|numpy|scipy|anaconda|cascade-classifier","view_count":"2468"} +{"id":"29939479","title":"Javaservlet nullpointerexception","body":"\u003cp\u003eI'm trying to make a very simple login screen. It has to check for the password and username. There is also a default user, set in the \u003ccode\u003einit()\u003c/code\u003e. The weird thing is, it's still giving me a \u003ccode\u003eNullPointerException\u003c/code\u003e on \u003ccode\u003erd.forward();\u003c/code\u003e\u003cbr\u003e\nCould someone explain? I'm sorry for my bad english, let me know if I have to elaborate more.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epackage servlets;\n\nimport java.io.BufferedReader;\nimport java.io.File;\nimport java.io.FileReader;\nimport java.io.IOException;\nimport java.io.PrintWriter;\nimport java.sql.Connection;\nimport java.sql.DriverManager;\nimport java.sql.SQLException;\nimport java.util.ArrayList;\nimport java.util.Scanner;\nimport javax.servlet.FilterConfig;\nimport javax.servlet.RequestDispatcher;\nimport javax.servlet.ServletConfig;\nimport javax.servlet.ServletException;\nimport javax.servlet.http.HttpServlet;\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\nimport classes.user;\n\npublic class loginServlet extends HttpServlet {\nArrayList\u0026lt;user\u0026gt; alleUsers = new ArrayList\u0026lt;\u0026gt;();\nprivate String defaultUser=\"\", defaultPassword=\"\";\nprivate user userding;\n\npublic void init(ServletConfig config) throws ServletException{\n super.init(config);\n defaultUser = config.getInitParameter(\"defaultUser\");\n defaultPassword = config.getInitParameter(\"defaultPassword\");\n user userding = new user(defaultUser, defaultPassword);\n}\n\nprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n String a = req.getParameter(\"back\");\n String b = req.getParameter(\"username\");\n String c = req.getParameter(\"password\");\n Object o = getServletContext().getAttribute(\"arraylist\");\n RequestDispatcher rd = null;\n\n if (a.equals(\"Register\")) {\n rd = req.getRequestDispatcher(\"registerScherm.jsp\");\n }\n\n if (a.equals(\"Login\")) {\n System.out.println(b + \" \"+ c);\n if(!b.equals(null) \u0026amp;\u0026amp; !c.equals(null)){\n if (o instanceof ArrayList) {\n alleUsers = (ArrayList) o;\n alleUsers.add(userding);\n if (alleUsers != null) {\n for (user u : alleUsers) {\n if (b.equals(u.getUsername()) \u0026amp;\u0026amp; c.equals(u.getPassword())) {\n getServletContext().setAttribute(\"naam\", b);\n rd = req.getRequestDispatcher(\"ingelogdScherm.jsp\");\n break;\n } else {\n rd = req.getRequestDispatcher(\"loginScherm.jsp\");\n }\n }\n }\n }\n }else{\n rd = req.getRequestDispatcher(\"loginScherm.jsp\");\n }\n }\n rd.forward(req, resp);\n //It gives an error on this forward\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere's my loginscreen jsp page:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;body\u0026gt;\n \u0026lt;%\n String userName = \"\";\n for (Cookie c : request.getCookies()) {\n if (c.getName().equals(\"username\")) {\n userName = c.getValue();\n break;\n }\n }\n\n%\u0026gt;\n\u0026lt;div id=\"account\"\u0026gt;\n\u0026lt;div id=\"inputbox\"\u0026gt;\n \u0026lt;form action=\"loginServlet.do\" method=\"post\"\u0026gt;\n \u0026lt;input class=\"ltf\" type=\"text\" name=\"username\" value=\"\u0026lt;%= userName %\u0026gt;\" /\u0026gt;\u0026lt;br/\u0026gt; \n \u0026lt;input class=\"ltf\" type=\"password\" name=\"password\" /\u0026gt;\u0026lt;br/\u0026gt; \n \u0026lt;input type=\"submit\" name=\"back\" value=\"Login\" /\u0026gt; \n \u0026lt;input type=\"submit\" name=\"back\" value=\"Register\" /\u0026gt;\n \u0026lt;/form\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\n \u003c/p\u003e\n\n\u003cp\u003eOkay I think I fixed it. I removed some of the guards, which helped. I'm still confused why it didnt go through them, but it works now. Thanks!\u003c/p\u003e","accepted_answer_id":"29939857","answer_count":"3","comment_count":"6","creation_date":"2015-04-29 09:24:27.793 UTC","last_activity_date":"2015-04-30 08:42:39.853 UTC","last_edit_date":"2015-04-30 08:42:39.853 UTC","last_editor_display_name":"","last_editor_user_id":"4189129","owner_display_name":"","owner_user_id":"4189129","post_type_id":"1","score":"-2","tags":"java|servlets|nullpointerexception|server","view_count":"374"} +{"id":"36818538","title":"Multi-class classification neural networks... I'm confused","body":"\u003cp\u003eMaybe its the big words, maybe its all the numbers and equations. Let me start with what I do know and what I'm trying to do.\u003c/p\u003e\n\n\u003cp\u003eI understand that that in a neural network I have a node that sends information to another node and so on. I understand that in a Multi-class classification Neural Network that I'm trying to optimize a node or nodes with features and to do this that I need to train. Now whether or not what I understand is correct... lets move on\u003c/p\u003e\n\n\u003cp\u003eWhat I'm trying to do is understand a problem for class I'm trying to answer. The question simply asks me to design an algorithm for a Multi-Class classification Neural Network that has at least 10^5 features and then I need to train it at least 10^9 times.\u003c/p\u003e\n\n\u003cp\u003eHere is my current thought process on solving this. This is super easy in theory I'll scale this down to the fewest nodes for a simple explanation. First I have an input node and my goal is to reach an output node. The single input node has a shite-ton of features and then I put all those 10^5 some features through 10^9 trains and then send it all back to an output node. To look something like this:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/rPqb8.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/rPqb8.png\" alt=\"Not an literal representation of 10^5 features and 10^9 training sessions\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eIs there anything wrong with this algorithm? \nDoes what I suggest actually work?\nDo I understand this properly?\nI'm not sure it should be so easy as I described, please explain how I'm wrong and what I don't get if I'm wrong.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-04-24 02:10:34.33 UTC","last_activity_date":"2016-10-15 05:12:20.287 UTC","last_edit_date":"2016-04-24 21:05:07.723 UTC","last_editor_display_name":"","last_editor_user_id":"1060350","owner_display_name":"","owner_user_id":"2159236","post_type_id":"1","score":"-1","tags":"machine-learning|neural-network|classification","view_count":"322"} +{"id":"15576054","title":"OS X - Use mach read/write functions without requiring root/sudo","body":"\u003cp\u003eSo I know it's possible to use vm_read_overwrite and vm_write without asking the user to type in their password every single time your app launches.\u003c/p\u003e\n\n\u003cp\u003eI have an app that does this. I know you need to sign your application, then a password dialog will be displayed if your app reads/writes another process. You generally type in the root password once and then the app runs as your local user.\u003c/p\u003e\n\n\u003cp\u003eMy problem is I'm creating a new app, which I signed, but it's not posting the dialog for permission.\u003c/p\u003e\n\n\u003cp\u003eAm I missing another step here? Worst case I can copy/paste my existing project, but I'd rather not as it's quite large.\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-03-22 17:04:13.233 UTC","last_activity_date":"2013-03-22 17:27:41.69 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"524481","post_type_id":"1","score":"1","tags":"objective-c|xcode|osx","view_count":"276"} +{"id":"17620072","title":"Could Emacs fontify elisp string constants?","body":"\u003ch1\u003eThe Dilemma: readability or maintainability?\u003c/h1\u003e\n\n\u003cp\u003eLet's look at the following function.\nIt doesn't really matter what it does, the important part is that\nit's using twice the string \u003ccode\u003e\"(let\\\\*?[ \\t]*\"\u003c/code\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e(defun setq-expression-or-sexp ()\n \"Return the smallest list that contains point.\nIf inside VARLIST part of `let' form,\nreturn the corresponding `setq' expression.\"\n (interactive)\n (ignore-errors\n (save-excursion\n (up-list)\n (let ((sexp (preceding-sexp)))\n (backward-list 1)\n (cond\n ((looking-back \"(let\\\\*?[ \\t]*\")\n (cons 'setq\n (if (= (length sexp) 1)\n (car sexp)\n (cl-mapcan\n (lambda (x) (unless (listp x) (list x nil)))\n sexp))))\n ((progn\n (up-list)\n (backward-list 1)\n (looking-back \"(let\\\\*?[ \\t]*\"))\n (cons 'setq sexp))\n (t\n sexp))))))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSince it's a headache having to update the string in two (or more) locations,\nI'd have to \u003ccode\u003edefconst\u003c/code\u003e it like so:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e(defconst regex-let-form \"(let\\\\*?[ \\t]*\")\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAlthough the code became more maintainable, it became less readable as well,\nbecause it's hard to see at a glance what \u003ccode\u003eregex-let-form\u003c/code\u003e really is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e(defun setq-expression-or-sexp ()\n \"Return the smallest list that contains point.\nIf inside VARLIST part of `let' form,\nreturn the corresponding `setq' expression.\"\n (interactive)\n (ignore-errors\n (save-excursion\n (up-list)\n (let ((sexp (preceding-sexp)))\n (backward-list 1)\n (cond\n ((looking-back regex-let-form)\n (cons 'setq\n (if (= (length sexp) 1)\n (car sexp)\n (cl-mapcan\n (lambda (x) (unless (listp x) (list x nil)))\n sexp))))\n ((progn\n (up-list)\n (backward-list 1)\n (looking-back regex-let-form))\n (cons 'setq sexp))\n (t\n sexp))))))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003ch1\u003eThe idea: why not both?\u003c/h1\u003e\n\n\u003cp\u003eSince it's a constant anyway, why not \u003ccode\u003efont-lock\u003c/code\u003e it\nand make \u003ccode\u003eregex-let-form\u003c/code\u003e appear as if it's \u003ccode\u003e\"(let\\\\*?[ \\t]*\"\u003c/code\u003e?\nIt's a feasable job, since:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003e\u003cp\u003eIt's possible to font-lock identifiers like so: \u003ca href=\"http://www.emacswiki.org/emacs/PrettyLambda\" rel=\"nofollow\"\u003ehttp://www.emacswiki.org/emacs/PrettyLambda\u003c/a\u003e,\nor even so: \u003ca href=\"http://julien.danjou.info/projects/emacs-packages\" rel=\"nofollow\"\u003erainbow-mode\u003c/a\u003e.\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eAnd it's possible to font-lock constants. It's already done for c++-mode,\nbut not yet for emacs-lisp-mode, as far as I know.\u003c/p\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eThen it remains only to connect the two. Unfortunately, I don't know\nenough of \u003ccode\u003efont-lock\u003c/code\u003e innards to do it, but maybe someone else does?\nOr is there already a package that does this?\u003c/p\u003e","answer_count":"4","comment_count":"0","creation_date":"2013-07-12 16:54:21.397 UTC","last_activity_date":"2013-10-20 18:10:23.963 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1350992","post_type_id":"1","score":"3","tags":"emacs|elisp","view_count":"220"} +{"id":"16025473","title":"Is pg_test_fsync contrib module in postgresql 9.2 deprecated?","body":"\u003cp\u003eI have installed postgresql 9.2.4 on my machine with Ubuntu 12.04.1 LTS. Based on this documentation page (\u003ca href=\"http://www.postgresql.org/docs/9.2/static/pgtestfsync.html\" rel=\"nofollow\"\u003ehttp://www.postgresql.org/docs/9.2/static/pgtestfsync.html\u003c/a\u003e), it seems *pg_test_fsync* contrib module is part of postgresql 9.2.4 . But when I checked *pg_available_extensions* system view and also the following location on my system \u003cem\u003e/usr/share/postgresql/9.2/extension\u003c/em\u003e, I could not find this module. It seems to be missing even in the contrib documentation here (\u003ca href=\"http://packages.debian.org/experimental/postgresql-contrib-9.2\" rel=\"nofollow\"\u003ehttp://packages.debian.org/experimental/postgresql-contrib-9.2\u003c/a\u003e).\u003c/p\u003e\n\n\u003cp\u003eAm I missing something? Could anyone guide me on how can I test 'pg_test_fsync' on postgresql 9.2.4 ?\u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","accepted_answer_id":"16025828","answer_count":"1","comment_count":"1","creation_date":"2013-04-15 22:05:19.82 UTC","last_activity_date":"2013-04-15 22:39:00.81 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"202598","post_type_id":"1","score":"3","tags":"postgresql|psql|fsync","view_count":"931"} +{"id":"66504","title":"Java VNC Libraries","body":"\u003cp\u003eAre there any VNC Libraries for Java, I need to build a JSP/Servlet based VNC server, to allow user to share their desktops with helpdesk. I've seen jVNC, but i'd like to build it myself, for a University project.\u003c/p\u003e\n\n\u003cp\u003eIn particular, I'm looking for Java Libraries that I can use inside another servlet based application. Unfortuatnely tight VNC's source is in C.\u003c/p\u003e","accepted_answer_id":"66569","answer_count":"1","comment_count":"1","community_owned_date":"2008-09-15 20:16:35.41 UTC","creation_date":"2008-09-15 20:16:35.41 UTC","last_activity_date":"2008-09-16 12:33:13.61 UTC","last_edit_date":"2008-09-16 12:33:13.61 UTC","last_editor_display_name":"Sam_Cogan","last_editor_user_id":"8768","owner_display_name":"Sam_Cogan","owner_user_id":"8768","post_type_id":"1","score":"3","tags":"java|vnc","view_count":"4641"} +{"id":"34547630","title":"Google-Maps-for-Rails in an unactivated bootstrap tab","body":"\u003cp\u003eOn my Rails 4 application I added a location to my main \u003ccode\u003efoo\u003c/code\u003e object and tried to add \u003ca href=\"https://github.com/apneadiving/Google-Maps-for-Rails\" rel=\"nofollow\"\u003eGoogle-Maps-for-Rails\u003c/a\u003e to visualize it. After following the instruction on the gem page everything worked well and it still does.\u003c/p\u003e\n\n\u003cp\u003eI also added the \u003ca href=\"http://getbootstrap.com/javascript/#tabs\" rel=\"nofollow\"\u003eJS-tabs of bootstrap\u003c/a\u003e and this works well by itself too.\u003c/p\u003e\n\n\u003cp\u003eBut as soon as I put the embed code of googlemaps into a tab that is not activated on the initial page it won't launch by itself. After pressing F12 (Firefox Developer Console) it gets activated and works as intended.\u003c/p\u003e\n\n\u003cp\u003eThis is how the view looks:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;ul class='nav nav-tabs' role='tablist'\u0026gt;\n \u0026lt;li role='presentation' class='active'\u0026gt;\u0026lt;a href='#allgemein' aria-controls='allgemein' role='tab' data-toggle='tab'\u0026gt;Beschreibung\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li role='presentation'\u0026gt;\u0026lt;a href='#location' aria-controls='location' role='tab' data-toggle='tab'\u0026gt;Lage\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n\u0026lt;/ul\u0026gt;\n\n\u0026lt;div class='tab-content'\u0026gt;\n \u0026lt;div role='tabpanel' class='tab-pane fade in active' id='allgemein'\u0026gt;\n SOME INFOS\n \u0026lt;/div\u0026gt;\n\n \u0026lt;div role='tabpanel' class='tab-pane fade' id='location'\u0026gt;\n LOCATION\n \u0026lt;div style='width: 800px;'\u0026gt;\n \u0026lt;div id=\"map\" style='width: 800px; height: 400px;'\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n\n \u0026lt;script type=\"text/javascript\"\u0026gt;\n handler = Gmaps.build('Google');\n handler.buildMap({ provider: {}, internal: {id: 'map'}}, function(){\n markers = handler.addMarkers(\u0026lt;%=raw @hash.to_json %\u0026gt;);\n handler.bounds.extendWith(markers);\n handler.fitMapToBounds();\n handler.getMap().setZoom(10);\n });\n \u0026lt;/script\u0026gt;\n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny ideas why this occurs?\u003c/p\u003e\n\n\u003cp\u003eSOLUTION:\u003c/p\u003e\n\n\u003cp\u003eFound the solution with the help of preciz!\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$('#tab_location').on('shown.bs.tab', function (e) {\n google.maps.event.trigger(map, 'resize');\n});\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"34551309","answer_count":"1","comment_count":"0","creation_date":"2015-12-31 14:14:50.59 UTC","last_activity_date":"2016-01-03 19:13:14.02 UTC","last_edit_date":"2016-01-03 19:13:14.02 UTC","last_editor_display_name":"","last_editor_user_id":"3665315","owner_display_name":"","owner_user_id":"3665315","post_type_id":"1","score":"0","tags":"javascript|twitter-bootstrap|google-maps|ruby-on-rails-4|tabs","view_count":"65"} +{"id":"9853274","title":"How can I access a struct in csharp that contains dynamic arrays, from an unmanaged DLL?","body":"\u003cp\u003e-In my c code I have a struct which contains many unknown sized arrays in an unmanaged dll (c code)\u003c/p\u003e\n\n\u003cp\u003e-I need the data of \u003cstrong\u003eone instance of this struct marshaled over to c#\u003c/strong\u003e, which I will later on send back to the unmanaged c code\u003c/p\u003e\n\n\u003cp\u003e-I do not need to manipulate this data once it gets to csharp, only hold onto it/store it for a while (so it can remain in a byte array).\u003c/p\u003e\n\n\u003cp\u003e-I do not want to use the keyword 'unsafe' as it is a big project and this is just one small piece and I don't want to be compiling like that.\u003c/p\u003e\n\n\u003cp\u003eI tried marshaling it as a lpArray and everything looks fine but when i look at the contents after coming back to the csharp, it is always empty. This type of marshaling style worked for me for dynamic arrays of various types but not the struct. \u003c/p\u003e\n\n\u003cp\u003eSearching the web is drawing blanks and much more complicated scenarios than my own, but if anybody has seen such a link please post it here I would be very greatful!\u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e\n\n\u003cp\u003e--update here is more or less the structure of my code:\u003c/p\u003e\n\n\u003cp\u003ec#:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[DllImport(\"mydll.dll\", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]\nprivate static extern int W_Thread_Connect_NET(\n [MarshalAs(UnmanagedType.LPStr, SizeConst = 100)] string IPAddress, \n int DevicePort,\n [MarshalAs(UnmanagedType.LPArray)] byte[] connectionHandle\n);\n\n//and call it like this, with an empty struc to be populated by c (can this be done? it is comming back without the data):\nbyte[] myStrucParam= new byte[100];\nint result = W_Thread_Connect_NET(myStrucParam, myParam1, myParam2, ...);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ec:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e typedef struct myStructDef{\n char* myArray1, \n char* myArray2,\n int myInt1,\n ...\n } mystrucObj, *pMystrucObj;\n\n//method that i am wanting to marshal the struct as a paramter here..\n MYDLL_DLLIMPORT int APIENTRY W_Thread_Connect_NET(pMystrucObj strucReturn_handle, char * IPAddress, int DevicePort, ...)\n {\n //(omitted)\n }\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"9853777","answer_count":"1","comment_count":"7","creation_date":"2012-03-24 16:18:31.757 UTC","favorite_count":"1","last_activity_date":"2012-03-24 17:17:29.357 UTC","last_edit_date":"2012-03-24 17:10:31.623 UTC","last_editor_display_name":"","last_editor_user_id":"505088","owner_display_name":"","owner_user_id":"918079","post_type_id":"1","score":"4","tags":"c#|c|dll|marshalling|unmanaged","view_count":"422"} +{"id":"23649053","title":"Memory exhausted sending mails with pdf file attached (swiftmailer set to file)","body":"\u003cp\u003eI am trying to send emails with pdf attached.\nI have a Command to send a lot of emails and swiftmailer is configured in file spool but I have this error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ePHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 523800 bytes) in .....vendor/tcpdf/tcpdf.php on line 4989\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy swiftmailer configuration is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eswiftmailer:\n transport: \"%mailer_transport%\"\n host: \"%mailer_host%\"\n username: \"%mailer_user%\"\n password: \"%mailer_password%\"\n spool: { type: file, path: \"%kernel.root_dir%/spool\" }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand my Command is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass EnviarJustificanteCommand extends ContainerAwareCommand {\n protected function configure()\n {\n $this\n -\u0026gt;setName('preinscripciones:enviar')\n -\u0026gt;setDescription('Enviar Justificantes')\n ;\n }\n\n protected function execute(InputInterface $input, OutputInterface $output)\n { \n $em = $this-\u0026gt;getContainer()-\u0026gt;get('doctrine')-\u0026gt;getEntityManager();\n $textoMailPreinscripcion = \"......\";\n //find alumnos\n $preinscritos = $em-\u0026gt;getRepository('BackendAlumnosBundle:Historial')-\u0026gt;findAlumnosEnviarJustificante();\n foreach ($preinscritos as $key =\u0026gt; $alumno) {\n\n if ($alumno-\u0026gt;getEmail() != null) {\n $message = \\Swift_Message::newInstance()\n -\u0026gt;setSubject('Preinscripción realizada')\n -\u0026gt;setFrom(array($this-\u0026gt;container-\u0026gt;getParameter('fromemail.contact') =\u0026gt; '........'))\n -\u0026gt;setReplyTo($this-\u0026gt;container-\u0026gt;getParameter('replyto.email'))\n -\u0026gt;setTo($alumno-\u0026gt;getEmail())\n -\u0026gt;setBody($textoMailPreinscripcion);\n\n // Create your file contents in the normal way, but don't write them to disk\n $data = $this-\u0026gt;imprmirJustificantePreinscripcionPDF($escuela, $alumno, true);\n // Create the attachment with your data\n $attachment = \\Swift_Attachment::newInstance($data, 'JustificantePreinscripcion.pdf', 'application/pdf');\n // Attach it to the message\n $message-\u0026gt;attach($attachment);\n $this-\u0026gt;get('mailer')-\u0026gt;send($message);\n\n }\n //set flag to 0 as sent\n foreach ($alumno-\u0026gt;getHistorial() as $key =\u0026gt; $historial) {\n $historial-\u0026gt;setEnviarJustificante(false);\n $em-\u0026gt;persist($alumno);\n }\n }\n\n $em-\u0026gt;flush(); \n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI don't know why I have configured swiftmailer as type file the memory is exhausted. Some clue?\u003c/p\u003e\n\n\u003cp\u003eThanks in advance!\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2014-05-14 08:11:33.383 UTC","last_activity_date":"2016-05-18 06:31:25.327 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1921173","post_type_id":"1","score":"1","tags":"symfony|swiftmailer","view_count":"681"} +{"id":"11574249","title":"How to apply gesture inside scrollview in android","body":"\u003cp\u003eI am developing android application which contains the reading of epub books. In that i need to place two pages in book view. If those pages exceed the screen size user have to scroll and view the books and have to pinch zoom the book and user can pan the book for reading.\u003c/p\u003e\n\n\u003cp\u003eAt first i tried to place two webview inside the Relativelayout. I can achive this by placing relativelayout inside the scrollview and horizontal scrollview to scroll in both horizontal and vertical.\u003c/p\u003e\n\n\u003cp\u003eBut problem occur in the swipping of pages and pinchzoom is not working inside the scrollview. it remains in the first page itself. i dont know where i am going wrong. please help me its urgent. i have tried for past one week it doesnt work for me..\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2012-07-20 06:51:55.723 UTC","favorite_count":"1","last_activity_date":"2012-11-07 08:30:24.12 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"768896","post_type_id":"1","score":"1","tags":"android|scrollview|gesture|epub","view_count":"1186"} +{"id":"33252391","title":"Get current user id in a WP plugin with redux framework","body":"\u003cp\u003eI'am working on a sorter plugin for WordPress, which have Redux Framework installed to manage the options of every section. The plugin uses AJAX to get the ids of all the sections in the homepage of the website, then passes those values to the plugin main file to process in a function that stores the values in the current user meta. That works well, no problem here. The function looks like this: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eadd_action( 'wp_ajax_save_sections_ids', 'save_sections_ids_sorting_sections' ); \nfunction save_sections_ids_sorting_sections() { \n //stuff here...\n $user_ide = get_current_user_id(); //it works because it is inside a hook\n update_user_meta($user_ide, \"set-sections\", $sections_ids);\n die(); \n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThen I have to get the stored values in user_meta to pass them to the Redux Field, so I wrote other function in the main file of the plugin. The function is this: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction get_the_db_sections_ids() { \n $user_ide = 1; //This should be get_current_user_id() or something similar, but nothing works, not even globalizing $current_user and using get_currentuserinfo();\n $sections_ids = get_user_meta($user_ide, \"set-sections\", true);\n $sorter_field = array(\n \"section_id\" =\u0026gt; \"basic\",\n 'id' =\u0026gt; 'homepage-sections',\n 'type' =\u0026gt; 'sorter',\n 'title' =\u0026gt; 'Control de secciones',\n 'desc' =\u0026gt; 'Arrastra y suelta los bloques con los nombres de las secciones, tanto para ordenarlas verticalmente como para desactivarlas o activarlas.',\n 'compiler' =\u0026gt; 'true',\n 'options' =\u0026gt; array(\n 'enabled' =\u0026gt; array(\n ),\n 'disabled' =\u0026gt; $sections_ids\n ),\n );\n return $sorter_field; \n\n} \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAs you notice in the comment in the function above, I have tried several ways, also \u003ccode\u003erequire_once(\"/../../../wp-load.php\")\u003c/code\u003e, but nothing happens. I tried \u003ccode\u003edo_action\u003c/code\u003e and \u003ccode\u003eadd_actions\u003c/code\u003e, to create a hook, but those also use global variables, and for what I understand, the global variables do not work in functions with no hooks in plugins. \u003c/p\u003e\n\n\u003cp\u003eBut I havent finished yet. The really tricky part is, I am calling an instance of Redux class inside the Redux config file (\u003cem\u003esample-config.php\u003c/em\u003e for the demo, I have a custom file, but it is the same).\u003c/p\u003e\n\n\u003cp\u003eThe instance is \u003ccode\u003eRedux::setField($opt_name, get_the_db_sections_ids());\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eThe problem this does not print anything if I call it from a function, or the function linked to the AJAX call. \u003c/p\u003e\n\n\u003cp\u003eAs you can see, the second parameter of the instance is the function I wrote above that, and it works perfectly if I set \u003ccode\u003e$user_ide\u003c/code\u003e to \u003ccode\u003e1\u003c/code\u003e, but I want the data stores in all admins \u003ccode\u003euser_meta\u003c/code\u003e, in case user \u003ccode\u003e1\u003c/code\u003e is erased, or whatever. \u003c/p\u003e\n\n\u003cp\u003eIs there a way to achieve what I want, or to store the data somewhere else and get it from there. I was thinking in creating a custom table in db, and use \u003ccode\u003ewpdb\u003c/code\u003e to retrieve the data, but I think I can't use \u003ccode\u003ewpdb\u003c/code\u003e either, because it will be the same problem.\u003c/p\u003e\n\n\u003cp\u003eI get the feeling I'm missing something very basic, but I can't get it. Please help.\u003c/p\u003e","answer_count":"2","comment_count":"4","creation_date":"2015-10-21 06:29:26.74 UTC","last_activity_date":"2015-10-21 16:29:22.03 UTC","last_edit_date":"2015-10-21 16:29:22.03 UTC","last_editor_display_name":"","last_editor_user_id":"1751810","owner_display_name":"","owner_user_id":"4906412","post_type_id":"1","score":"0","tags":"php|wordpress|wordpress-plugin|redux-framework","view_count":"302"} +{"id":"20036597","title":"How to Load a UI from Another UI (Redirection)","body":"\u003cp\u003eI may be thinking about this the wrong way... but I have 2 different UIs built using UiApp;\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003ePart 1: the \"Project Index UI\"\u003c/strong\u003e which holds a list of all approved/pending projects.\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eI have unique IDs for each project, with a row of information in another Spreadsheet that correlates to each ID.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003e\u003cstrong\u003eExample\u003c/strong\u003e: Project ID 20857 really points to row 4 in \"Project Spreadsheet\".\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003ePart 2: the \"Project Details UI\"\u003c/strong\u003e which is essentially an interface for editing the values in the Spreadsheet and updating calendar events with the new information.\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003eThe goal is to give my boss an index of all projects that are currently in the system. Then, as he wants, he can click on a project ID to load another UI that presents the information for that ID.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eSo\u003c/strong\u003e: I was thinking about having the Project Name as an anchor, where the ID is embedded such as:\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003evar anchor = app.createAnchor(\"Some Project\", \"https://sites.google.com/site/mySite/asdf\u0026amp;ID=20857\");\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eWhere \u003ccode\u003easdf\u003c/code\u003e is the page where the \"Project Details UI\" is located. Then I would parse the URL to get the ID, and load the information into the Project Details UI that way.\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003eWhat I'm thinking is that this is \u003cstrong\u003eway\u003c/strong\u003e too complicated, and that there is an easier way to accomplish this but I'm just not sure.\u003c/p\u003e\n\n\u003cp\u003eIs there a better method for generating a new UI with specific data obtained through a \"link\" of some sort in the original UI?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eSolution\u003c/strong\u003e: \u003ca href=\"https://developers.google.com/apps-script/reference/ui/tab-panel\" rel=\"nofollow noreferrer\"\u003eTabPanel\u003c/a\u003e with 2 tabs - each ID acts as a reference to a row of information in a Spreadsheet. When a button is clicked, a \u003ccode\u003eserverHandler\u003c/code\u003e invokes a function with that ID as a parameter, which fills the second tab with information for that ID.\u003c/p\u003e\n\n\u003cp\u003eBelow are two illustrations of the UIs and how they should function:\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/HU93b.jpg\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/3CdbP.jpg\" alt=\"enter image description here\"\u003e\u003c/p\u003e","accepted_answer_id":"20037175","answer_count":"1","comment_count":"0","creation_date":"2013-11-17 21:48:22.9 UTC","last_activity_date":"2013-11-17 23:44:09.62 UTC","last_edit_date":"2013-11-17 23:44:09.62 UTC","last_editor_display_name":"","last_editor_user_id":"1986871","owner_display_name":"","owner_user_id":"1986871","post_type_id":"1","score":"0","tags":"google-apps-script","view_count":"96"} +{"id":"30583350","title":"command on specific device","body":"\u003cp\u003eI am trying to write a batch script, which will always be executed at a specific location (in this case on my USB-Stick), so typically I would use \u003ccode\u003eD:\u003c/code\u003e, but sometimes the stick has another drive letter. Therefore I am trying to find the device via its name (\u003ccode\u003eUSB_Stick\u003c/code\u003e).\u003c/p\u003e\n\n\u003cp\u003eI haven't found a way to do this via a batch command.\u003c/p\u003e\n\n\u003cp\u003eA PowerShell command would look like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@(get-wmiobject -query \\\"select deviceid from win32_logicaldisk where volumename='USB-STICK'\\\")[0].deviceid\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut I don't know how to use the result of this PowerShell command.\u003c/p\u003e\n\n\u003cp\u003eI tried things like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efor /f \"usebackq\" %%x in (`powershell.exe -Command \"@(get-wmiobject -query \\\"select deviceid from win32_logicaldisk where volumename='USB-STICK'\\\")[0].deviceid\"`) do (\n set res=%%x\n)\n@echo %res%\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut the result of this would only be \u003ccode\u003eommands.GetWmiObjectCommand\u003c/code\u003e and not the \u003ccode\u003eD:\u003c/code\u003e.\u003c/p\u003e","accepted_answer_id":"30584068","answer_count":"2","comment_count":"1","creation_date":"2015-06-01 21:10:40.977 UTC","last_activity_date":"2015-06-01 22:07:47.127 UTC","last_edit_date":"2015-06-01 22:05:35.33 UTC","last_editor_display_name":"","last_editor_user_id":"1630171","owner_display_name":"","owner_user_id":"4962935","post_type_id":"1","score":"1","tags":"powershell|batch-file|cmd","view_count":"70"} +{"id":"24756249","title":"Create json with column values as object keys","body":"\u003cp\u003eI have a table defined like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCREATE TABLE data_table AS (\n id bigserial,\n \"name\" text NOT NULL,\n \"value\" text NOT NULL,\n CONSTRAINT data_table_pk PRIMARY KEY (id)\n);\n\nINSERT INTO data_table (\"name\", \"value\") VALUES\n('key_1', 'value_1'),\n('key_2', 'value_2');\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI would like to get a JSON object from this table content, which will look like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n \"key_1\":\"value_1\",\n \"key_2\":\"value_2\"\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow I'm using the client application to parse the result set into JSON format. Is it possible to accomplish this by a postgresl query?\u003c/p\u003e","accepted_answer_id":"31989483","answer_count":"2","comment_count":"0","creation_date":"2014-07-15 10:49:48.98 UTC","last_activity_date":"2015-08-13 13:21:13.69 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"940569","post_type_id":"1","score":"7","tags":"json|postgresql|postgresql-9.3","view_count":"3934"} +{"id":"11326639","title":"Amazon s3 file upload confusion","body":"\u003cp\u003eI'm using com.amazonaws.services.s3.AmazonS3 to upload files from my server to amazon's one.\nEverything is working perfectly but I'm going crazy because of an issue:\u003c/p\u003e\n\n\u003cp\u003eI am uploading several files and folders (mostly images, js and css files). The files get uploaded nicely however I have one particular css file (jquery-mobile-1.0.1.css) that gets uploaded however when an html relies on that file, the css is not loaded, until I go and manually upload that one file again and make it public.\nI literally tried everything (changed file name, location, encoding) but nothing seems to be working. Does anyone have an idea what can cause the problem?\nThe files are uploaded dynamically, so the way that the particular css file gets uploaded does not differ from other css files.\u003c/p\u003e\n\n\u003cp\u003eAny help is appreciated.\u003c/p\u003e","accepted_answer_id":"11329732","answer_count":"1","comment_count":"10","creation_date":"2012-07-04 09:52:45.697 UTC","last_activity_date":"2012-07-04 13:06:28.053 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"951793","post_type_id":"1","score":"1","tags":"amazon-s3","view_count":"296"} +{"id":"14049875","title":"Download large file in LAN using C#","body":"\u003cp\u003eI am making an application which installs software on request from user.\nI am having zip files saved on server for software installation.\nOn request approval i download the file on the requested machine using Microsoft BITS service.\nBut there are several issues as my application run under Administrator privilege and BITS does not support 'run as'.\nIs there other way to download large file over network???\nPlease help..\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2012-12-27 05:38:28.467 UTC","last_activity_date":"2012-12-27 06:02:32.853 UTC","last_edit_date":"2012-12-27 05:56:46.72 UTC","last_editor_display_name":"","last_editor_user_id":"1657671","owner_display_name":"","owner_user_id":"1657671","post_type_id":"1","score":"1","tags":"c#|networking|download|microsoft-bits|bits-service","view_count":"363"} +{"id":"33138059","title":"Using API Apps with Swagger in dev/test/production environments","body":"\u003cp\u003eI'm migrating a combined Azure Website (with both Controllers and ApiControllers) to a split Web App and API App. Let's call it MyApp.\u003c/p\u003e\n\n\u003cp\u003eI've created MyAppDevApi, MyAppTestApi, and MyAppProductionApi API Apps (in different App Services) to host the three environments, expecting to promote code from one environment to another.\u003c/p\u003e\n\n\u003cp\u003eSo far, I've only deployed to MyAppDevApi, since I'm just getting started.\u003c/p\u003e\n\n\u003cp\u003eWhen I do \u003ccode\u003eAdd/Azure API App Client\u003c/code\u003e to my UI-only project to start referring to the API app, and I point it to MyAppDevApi, it uses AutoRest to create classes in my code. These classes now all have the name MyAppDevApi, rather than just MyAppApi, which is the actual namespace of the code I'm deploying to every environment. Obviously, I can't check that in... how can I promote that through Test and Prod?\u003c/p\u003e\n\n\u003cp\u003eThere's nothing in the Swagger JSON that refers to this name, so it must be on the AutoRest side (I think).\u003c/p\u003e\n\n\u003cp\u003eHas anyone come up with a strategy or work-around to deal with this multiple-environment promotion issue with API Apps?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdit\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eSo far the best thing I've come up with is to download the Swagger from the API App to a local file (which, again, has only the namespace from the original code, not from the name of the API App), and then import it into the Web App. This will generate classes in the Web App that have the naming I expect.\u003c/p\u003e\n\n\u003cp\u003eThe problem is that I then have to edit the generated MyAppApi.cs file's _baseUri property to pull from an AppSetting, have the different web.config.dev, .test, .prod, and then do the web.config transform. I mean, that'll work, but then every time I change the API App's interface, I'll regenerate... and then I'll have remember to change the _baseUri again... and someone, sometime is going to forget to do this and then deploy to production. It's really, really fragile.\u003c/p\u003e\n\n\u003cp\u003eSo... anyone have a better idea?\u003c/p\u003e","accepted_answer_id":"33223273","answer_count":"2","comment_count":"0","creation_date":"2015-10-15 00:53:11.64 UTC","last_activity_date":"2015-10-19 20:24:45.127 UTC","last_edit_date":"2015-10-15 19:22:36.373 UTC","last_editor_display_name":"","last_editor_user_id":"1179286","owner_display_name":"","owner_user_id":"1179286","post_type_id":"1","score":"1","tags":"azure|azure-web-sites|azure-api-apps","view_count":"375"} +{"id":"869969","title":"When using Excel's \"Print Titles\" how do i change the titles midway down the sheet","body":"\u003cp\u003eI have a classic ASP web app that outputs reports to Excel, but it's really just html.\u003c/p\u003e\n\n\u003cp\u003eSome reports output with multiple groups and each group can span multiple pages (vertically). I'm aware of the \"Page Titles\" ability of Excel to print a specified row (or rows) on every page, however, I need the title of each group to also display in the title. Otherwise the title of the first group gets displayed as the title of every group.\u003c/p\u003e\n\n\u003cp\u003eI saw on google groups that someone suggested putting each group on a separate worksheet however I don't think I can output multiple worksheets easily - or at all - using html alone.\u003c/p\u003e\n\n\u003cp\u003eI'm looking for a quick and dirty solution as I don't have much time to devote to maintaining this crufty old app.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2009-05-15 17:38:30.203 UTC","last_activity_date":"2010-11-07 13:54:18.82 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"16162","post_type_id":"1","score":"0","tags":"asp-classic|printing|export-to-excel","view_count":"1192"} +{"id":"46400679","title":"How to wrap it up?","body":"\u003cp\u003eI have following code snippet from the haskellbook that shows step by step, how monad transformer is going to unwrap: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emodule OuterInner where\n\n import Control.Monad.Trans.Except\n import Control.Monad.Trans.Maybe\n import Control.Monad.Trans.Reader\n\n -- We only need to use return once\n -- because it's one big Monad\n embedded :: MaybeT (ExceptT String (ReaderT () IO)) Int\n embedded = return 1\n\n maybeUnwrap :: ExceptT String (ReaderT () IO) (Maybe Int)\n maybeUnwrap = runMaybeT embedded\n\n -- Next\n eitherUnwrap :: ReaderT () IO (Either String (Maybe Int))\n eitherUnwrap = runExceptT maybeUnwrap\n\n -- Lastly\n readerUnwrap :: () -\u0026gt; IO (Either String (Maybe Int))\n readerUnwrap = runReaderT eitherUnwrap\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThere is an exercise, that I have to wrap everything again: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eembedded :: MaybeT (ExceptT String (ReaderT () IO)) Int\nembedded = ??? (const (Right (Just 1))) \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI tried as follows: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eembedded' :: MaybeT (ExceptT String (ReaderT () IO)) Int\nembedded' = MaybeT (ExceptT (ReaderT (const (Right (Just 1)))))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut the compiler complains:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eD:\\haskell\\chapter26\\src\\OuterInner.hs:24:15: error:\n * Couldn't match type `Either a0' with `IO'\n Expected type: MaybeT (ExceptT String (ReaderT () IO)) Int\n Actual type: MaybeT (ExceptT String (ReaderT () (Either a0))) Int\n * In the expression:\n MaybeT (ExceptT (ReaderT (const (Right (Just 1)))))\n In an equation for embedded':\n embedded' = MaybeT (ExceptT (ReaderT (const (Right (Just 1)))))\n\nD:\\haskell\\chapter26\\src\\OuterInner.hs:24:32: error:\n * Couldn't match type `Maybe Integer'\n with `Either String (Maybe Int)'\n Expected type: ReaderT () (Either a0) (Either String (Maybe Int))\n Actual type: ReaderT () (Either a0) (Maybe Integer)\n * In the first argument of `ExceptT', namely\n `(ReaderT (const (Right (Just 1))))'\n In the first argument of `MaybeT', namely\n `(ExceptT (ReaderT (const (Right (Just 1)))))'\n In the expression:\n MaybeT (ExceptT (ReaderT (const (Right (Just 1)))))\nFailed, modules loaded: none.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow to solve the exercise?\u003c/p\u003e","accepted_answer_id":"46403024","answer_count":"2","comment_count":"0","creation_date":"2017-09-25 08:26:57.547 UTC","last_activity_date":"2017-09-25 10:30:11.8 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1743843","post_type_id":"1","score":"1","tags":"haskell","view_count":"63"} +{"id":"44665607","title":"Kinesis writing to ElasticSearch and S3","body":"\u003cp\u003eI am using AWS Kinesis to write to Elastic Search and taking S3 as the backup. So, it is writing to both the sources. But I observed one problem that it does not push to S3 at same time as when it pushes to Elastic Search. So, does it do periodically or something like that? Any explanation if anyone could give would be appreciated. Also, if this is the case, is there any way to change it?\u003c/p\u003e","accepted_answer_id":"44711574","answer_count":"1","comment_count":"2","creation_date":"2017-06-21 01:50:26.29 UTC","last_activity_date":"2017-06-23 01:10:51.32 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1523785","post_type_id":"1","score":"0","tags":"amazon-web-services|elasticsearch|amazon-s3|amazon-kinesis","view_count":"44"} +{"id":"32222266","title":"Regex not returning any matches for UPS tracking numbers","body":"\u003cp\u003eI have a string \u003ccode\u003etrackingNumber=\"1Z96Y3W80340983689\"\u003c/code\u003e \nfor which I want to test a regex pattern against;\nwith the regular expression: \u003ccode\u003e\"/1Z\\\\?\\[0-9A-Z]\\\\{3}\\\\?\\[0-9A-Z]\\\\{3}\\\\?\\[0-9A-Z]\\\\{2}\\\\?\\[0-9A-Z]\\\\{4}\\\\?[0-9A-Z]{3}\\\\?\\[0-9A-Z]|\\[\\dT]\\\\d\\\\d\\\\d\\\\?\\\\d\\\\d\\\\d\\\\d\\\\?\\\\d\\\\d\\\\d/i\"\u003c/code\u003e\nin java\u003c/p\u003e\n\n\u003cp\u003eBut I'm not getting any matches for my regex.\u003c/p\u003e","answer_count":"2","comment_count":"5","creation_date":"2015-08-26 09:02:48.717 UTC","last_activity_date":"2015-08-26 10:04:29.787 UTC","last_edit_date":"2015-08-26 10:04:29.787 UTC","last_editor_display_name":"","last_editor_user_id":"642572","owner_display_name":"","owner_user_id":"3153599","post_type_id":"1","score":"-3","tags":"java|regex","view_count":"453"} +{"id":"44138828","title":"XMLHttpRequest - Parsing out attributes - JS","body":"\u003cp\u003eFirst off, this is a complete newbie question. I don't really have much idea of what I'm doing.\u003c/p\u003e\n\n\u003cp\u003eI have an API that returns the top 10 fund raisers from JustGiving. I can get the XML info to display, however it just dumps everything out all together. This is what JS I have so far:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar xhr = new XMLHttpRequest();\nxhr.open(\"GET\", \"https://api.justgiving.com/{appid}/v1/event/{eventID}/leaderboard?currency=gbp/\", true);\nxhr.responseJSON;\nxhr.send();\n\nxhr.onreadystatechange = processRequest;\n\nfunction processRequest(e) {\n if (xhr.readyState == 4 \u0026amp;\u0026amp; xhr.status == 200) {\n document.write(xhr.responseText);\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have been look for hours at different ways to get this information output into something I can manipulate on a web page. Something that can be wrapped in a div.\u003c/p\u003e\n\n\u003cp\u003ePretty sure its this I need to modify...\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edocument.write(xhr.responseText);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ePlease help or point me in the right direction. Or if I've gone completely in the wrong direction let me know. There is probably already a solution out there, but as my knowledge is very limited I'm probably wording all my searches wrong.\u003c/p\u003e\n\n\u003cp\u003eThe documentation for the API is \u003ca href=\"https://api.justgiving.com/docs/resources/v1/Leaderboard/GetEventLeaderboard\" rel=\"nofollow noreferrer\"\u003ehttps://api.justgiving.com/docs/resources/v1/Leaderboard/GetEventLeaderboard\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eMany thanks in advance.\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2017-05-23 15:16:34.437 UTC","last_activity_date":"2017-05-23 15:33:36.727 UTC","last_edit_date":"2017-05-23 15:31:12.96 UTC","last_editor_display_name":"","last_editor_user_id":"2240261","owner_display_name":"","owner_user_id":"2240261","post_type_id":"1","score":"1","tags":"javascript|xmlhttprequest","view_count":"33"} +{"id":"29689964","title":"How to Censor a SPECIFIC word in Java using Regex","body":"\u003cp\u003eI'd like to know how to censor the word \"ass\" (or A word) using a Java Regex highly safe. \u003c/p\u003e\n\n\u003cp\u003eThis makes things difficult as the A word can be contained in a lot of other harmless words. For example, \"grass.\"\u003c/p\u003e\n\n\u003cp\u003eI have setup partially the beginning part for a lot of the prefixes of the A word, but can't seem to find how to censor the word without censoring suffixes like \"assassin.\"\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eString string = String.replaceAll(\"^(?!(b|B|gr|gR|Gr|GR|gl|gL|Gl|GL|m|M|s|S|h|H|p|P|g|G)).*[aA4]+[\\\\W[_]]*?[$5SszZ]+[\\\\W[_]]*?[$5SszZ]+\", \"***\");\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis I find is very hard, and still can not find a solution yet.\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2015-04-17 03:52:56.297 UTC","favorite_count":"1","last_activity_date":"2015-04-23 03:22:05.637 UTC","last_edit_date":"2015-04-17 05:45:40.923 UTC","last_editor_display_name":"","last_editor_user_id":"4377568","owner_display_name":"","owner_user_id":"2954625","post_type_id":"1","score":"0","tags":"java|regex|profanity","view_count":"418"} +{"id":"79482","title":"How do I use transactions with Stomp and ActiveMQ (and Perl)?","body":"\u003cp\u003eI'm trying to replace some bespoke message queues with ActiveMQ, and I need to talk to them (a lot) from Perl. ActiveMQ provides a Stomp interface and Perl has Net::Stomp, so this seems like it should be fine, but it's not.\u003c/p\u003e\n\n\u003cp\u003eEven if I send a BEGIN command over Stomp, messages sent with SEND are immediately published, and if I ABORT the transaction, nothing happens.\u003c/p\u003e\n\n\u003cp\u003eI can't find any clear answers suggesting that suggest it's not possible, that is is possible, or that there's a relevant bit of configuration. Also, Stomp doesn't seem to be a great protocol for checking for error responses from the server.\u003c/p\u003e\n\n\u003cp\u003eAm I out of luck?\u003c/p\u003e","answer_count":"3","comment_count":"0","creation_date":"2008-09-17 02:57:59.773 UTC","favorite_count":"2","last_activity_date":"2014-04-20 07:35:25.3 UTC","last_editor_display_name":"","owner_display_name":"rjbs","owner_user_id":"10478","post_type_id":"1","score":"10","tags":"perl|activemq|stomp","view_count":"3590"} +{"id":"33291027","title":"Empty string taking precedence in python regex subpatterns with multiple groups","body":"\u003cp\u003eAs I understand, \u003ccode\u003e|\u003c/code\u003e tries different subpatterns in alternation and matches the first possible option. Whenever there are multiple groups, the later ones behave unexpectedly when one of the subpatterns is empty giving it priority.\u003c/p\u003e\n\n\u003cp\u003eExample: \u003ccode\u003ere.search(\"(ab|a|).*(as|a|).*(qwe|qw|)\", \"abcde asdfg qwerty\").groups()\u003c/code\u003e returns: \u003ccode\u003e('ab', '', '')\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eIf the empty option is removed \u003ccode\u003ere.search(\"(ab|a|).*(as|a).*(qwe|qw)\", \"abcde asdfg qwerty\").groups()\u003c/code\u003e The result is \u003ccode\u003e('ab', 'as', 'qwe')\u003c/code\u003e as expected.\u003c/p\u003e\n\n\u003cp\u003eI am interested in a way to achieve the second result and be able to match a string like \u003ccode\u003eabc qwerty\u003c/code\u003e and obtain \u003ccode\u003e('ab', '', 'qwe')\u003c/code\u003e or \u003ccode\u003eabcd asd\u003c/code\u003e and obtain \u003ccode\u003e('ab', 'as', '')\u003c/code\u003e. \u003c/p\u003e\n\n\u003cp\u003eThe explanation on why the patterns did not work as I expected will be appreciated, but it is not my main concern. Thanks in advance!\u003c/p\u003e","accepted_answer_id":"33291831","answer_count":"3","comment_count":"0","creation_date":"2015-10-22 21:24:22.267 UTC","last_activity_date":"2015-10-22 22:27:41.48 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2030167","post_type_id":"1","score":"0","tags":"python|regex|python-2.7|python-3.x","view_count":"69"} +{"id":"29262704","title":"Deleted a remote branch that I have never had local","body":"\u003cp\u003eI am using the trash git client on my desktop for cleaning up in the dead branches.\nI accidentally deleted a branch that is published that one of my group members is working on.\nThe git client gave me no warning just deleted the branch with a single click.\u003c/p\u003e\n\n\u003cp\u003eApparently he pushes to git, deletes his entire repository when he is done, meaning he does not have it locally.\nI delete his branch after he had done his stunt.\nThat being said I have never had the branch locally since I was not the one working on it. I therefore cannot use git reflog.\u003c/p\u003e\n\n\u003cp\u003eIs there any way to revert the changes? There are a couple days of work in the branch, and we really need it back.\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2015-03-25 17:38:58.293 UTC","last_activity_date":"2015-07-04 10:37:19.68 UTC","last_edit_date":"2015-07-04 10:37:19.68 UTC","last_editor_display_name":"","last_editor_user_id":"4370109","owner_display_name":"","owner_user_id":"3592588","post_type_id":"1","score":"0","tags":"git|branch|git-revert|recover","view_count":"20"} +{"id":"8073288","title":"Apache .htaccess RewriteRule","body":"\u003cp\u003eHere's my situation. I have a web root and several subdirectories, let's say:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e/var/www\n/var/www/site1\n/var/www/site2\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eDue to certain limitations, I need the ability to keep one single domain and have separate folders like this. This will work fine for me, but many JS and CSS references in both sites point to things like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\"/js/file.js\"\n\"/css/file.css\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBecause these files are referenced absolutely, they are looking for the 'js' and 'css' directories in /var/www, which of course does not exist. Is there a way to use RewriteRules to redirect requests for absolutely referenced files to point to the correct subdirectory? I have tried doing things like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eRewriteEngine on\nRewriteRule ^/$ /site1\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eor\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eRewriteEngine on\nRewriteRule ^/js/(.*)$ /site1/js/$1\nRewriteRule ^/css/(.*)$ /site1/css/$1\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut neither of these work, even redirecting to only one directory, not to mention handling both site1 and site2. Is what I'm trying possible?\u003c/p\u003e\n\n\u003cp\u003eEDIT: SOLUTION\u003c/p\u003e\n\n\u003cp\u003eI ended up adapting Jon's advice to fit my situation. I have the ability to programatically make changes to my .htaccess file whenever a new subdirectory is added or removed. For each \"site\" that I want, I have the following section in my .htaccess:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eRewriteCond %{REQUEST_URI} !^/$\nRewriteCond %{REQUEST_URI} !^/index.php$\nRewriteCond %{HTTP_COOKIE} sitename=site1\nRewriteCond %{REQUEST_URI} !^/site1/\nRewriteRule ^(.*)$ /site1/$1 [L]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIndex.php is a file that lists all my sites, deletes the \"sitename\" cookie, and sets a cookie of \"sitename=site#\" when a particular one is selected. My RewriteConds check,\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eIf the request is not for /\u003c/li\u003e\n\u003cli\u003eIf the request is not for /index.php\u003c/li\u003e\n\u003cli\u003eIf the request contains the cookie \"sitename=site1\"\u003c/li\u003e\n\u003cli\u003eIf the request does not start with \"/site1/\"\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eIf all of these conditions are met, then the request is rewritten to prepend \"/site1/\" before the request. I tried having a single set of Conds/Rules that would match (\\w+) instead of \"site1\" in the third Condition, and then refer to %1 in the fourth Condition and in the Rule, but this did not work. I gave up and settled for this.\u003c/p\u003e","accepted_answer_id":"8073440","answer_count":"2","comment_count":"0","creation_date":"2011-11-09 23:42:12.063 UTC","last_activity_date":"2011-11-10 16:56:37.563 UTC","last_edit_date":"2011-11-10 16:56:37.563 UTC","last_editor_display_name":"","last_editor_user_id":"162777","owner_display_name":"","owner_user_id":"162777","post_type_id":"1","score":"0","tags":"apache|.htaccess|mod-rewrite","view_count":"1474"} +{"id":"24784873","title":"NSImage Deprecated method: setFlipped replacement","body":"\u003cp\u003eIn the docs, \u003ca href=\"https://developer.apple.com/library/mac/documentation/cocoa/reference/applicationkit/classes/NSImage_Class/DeprecationAppendix/AppendixADeprecatedAPI.html#jumpTo_17\" rel=\"nofollow\"\u003ehttps://developer.apple.com/library/mac/documentation/cocoa/reference/applicationkit/classes/NSImage_Class/DeprecationAppendix/AppendixADeprecatedAPI.html#jumpTo_17\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eIt says \u003ccode\u003esetFlipped\u003c/code\u003e should be replaced with \u003ccode\u003edrawInRect\u003c/code\u003e -- but after looking through several examples and many failed attempts, I can't get my image to draw flipped using the arguments that are passed into \u003ccode\u003edrawInRect\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eDoes anybody have experience, or know how to flip an image with the \u003ccode\u003edrawInRect\u003c/code\u003e method? Or is there a different way?\u003c/p\u003e\n\n\u003cp\u003eThanks in advance!\u003c/p\u003e","accepted_answer_id":"24785248","answer_count":"2","comment_count":"0","creation_date":"2014-07-16 15:33:11.207 UTC","favorite_count":"1","last_activity_date":"2017-09-21 06:11:52.147 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2415178","post_type_id":"1","score":"2","tags":"objective-c|deprecated|nsimage","view_count":"1271"} +{"id":"32166851","title":"How to create a list of custom objects in GraphQL","body":"\u003cp\u003eI am currently playing around with a bunch of new technology of Facebook.\u003c/p\u003e\n\n\u003cp\u003eI have a little problem with GraphQL schemas.\nI have this model of an object:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n id: '1',\n participants: ['A', 'B'],\n messages: [\n {\n content: 'Hi there',\n sender: 'A'\n },\n {\n content: 'Hey! How are you doing?',\n sender: 'B'\n },\n {\n content: 'Pretty good and you?',\n sender: 'A'\n },\n ];\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow I want to create a GraphQL model for this. I did this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar theadType = new GraphQLObjectType({\n name: 'Thread',\n description: 'A Thread',\n fields: () =\u0026gt; ({\n id: {\n type: new GraphQLNonNull(GraphQLString),\n description: 'id of the thread'\n },\n participants: {\n type: new GraphQLList(GraphQLString),\n description: 'Participants of thread'\n },\n messages: {\n type: new GraphQLList(),\n description: 'Messages in thread'\n }\n\n })\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI know there are more elegant ways to structure the data in the first place. But for the sake of experimenting, I wanted to try it like this.\u003c/p\u003e\n\n\u003cp\u003eEverything works fine, besides my messages array, since I do not specify the Array type. I have to specify what kind of data goes into that array. But since it is an custom object, I don't know what to pass into the GraphQLList(). \u003c/p\u003e\n\n\u003cp\u003eAny idea how to resolve this besides creating an own type for messages? \u003c/p\u003e","accepted_answer_id":"32265794","answer_count":"2","comment_count":"0","creation_date":"2015-08-23 12:53:19.707 UTC","last_activity_date":"2015-08-28 07:41:21.067 UTC","last_edit_date":"2015-08-23 13:39:44.393 UTC","last_editor_display_name":"","last_editor_user_id":"4258088","owner_display_name":"","owner_user_id":"4258088","post_type_id":"1","score":"5","tags":"javascript|graphql","view_count":"3352"} +{"id":"21250935","title":"Change the document title when page load using jstl and javascript","body":"\u003cp\u003eI am changing the document page title when page loads using below method. I am using jstl 1.0.2\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;html\u0026gt;\n\u0026lt;head\u0026gt;\u0026lt;/head\u0026gt;\n\n\u0026lt;script type=\"text/javascript\" language=\"JavaScript\"\u0026gt;\nfunction updateTitle() { \n document.title = '\u0026lt;c:out value=\"${titleName}\"/\u0026gt;';\n}\n\nwindow.onload=updateTitle; \n\u0026lt;/script\u0026gt;\n\n\u0026lt;body\u0026gt;\n\u0026lt;% if(somecondition) { %\u0026gt;\n\u0026lt;c:set var=\"titleName\" value=\"new title\"/\u0026gt;\n\u0026lt;% }else if (othercondition){ %\u0026gt;\n\u0026lt;c:set var=\"titleName\" value=\"other title\"/\u0026gt;\n\u0026lt;%}%\u0026gt;\n\u0026lt;/body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut i am getting \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eThis attribute does not support request time values.\n document.title = '\u0026lt;c:out value=\"${titleName}\"/\u0026gt;';\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn web.xml, I have already define \u003ccode\u003exmlns:c=\"urn:jsptld:http://java.sun.com/jstl/core\"\u003c/code\u003e and the jsp page also i have define \u003ccode\u003e\u0026lt;%@ taglib uri=\"http://java.sun.com/jstl/core\" prefix=\"c\"%\u0026gt;\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eWhat other configaration i need to add in order to make above work and also i want to know whether my approach is correct too?\u003c/p\u003e","answer_count":"3","comment_count":"0","creation_date":"2014-01-21 06:38:07.017 UTC","last_activity_date":"2014-01-21 09:18:05.927 UTC","last_edit_date":"2014-01-21 09:18:05.927 UTC","last_editor_display_name":"","last_editor_user_id":"301957","owner_display_name":"","owner_user_id":"301957","post_type_id":"1","score":"0","tags":"java|jsp|java-ee","view_count":"750"} +{"id":"27110170","title":"Ruby: A neat way to find the number of non nil records from a Hashie::Mash","body":"\u003cp\u003eI'm using EJ Holme's rather excellent \u003ca href=\"https://github.com/ejholmes/restforce\" rel=\"nofollow\"\u003erestforce\u003c/a\u003e gem to speak to my salesforce instance.\u003c/p\u003e\n\n\u003cp\u003eIt's returning a hashie mash for a client record. I'd like to do a bit of built-in-method fu, but I'm getting stuck.\u003c/p\u003e\n\n\u003cp\u003eThe hash returns around 550 array pairs of values. For instance \u003ccode\u003eRestforce_hash.last\u003c/code\u003e would return something like: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[\"field_title\", \"field_content\"\u0026gt;]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo far so great, I want to put a summary box at the top that displays a metric for how many fields are in use for the record. \u003c/p\u003e\n\n\u003cp\u003eIf I call \u003ccode\u003eRestforce_hash.length\u003c/code\u003e I get the total number returned just fine.\u003c/p\u003e\n\n\u003cp\u003eHowever what I really want is the number of record pairs where the second item in the array (ie.. the \"field_content\" is \u003cem\u003enot\u003c/em\u003e nil.\u003c/p\u003e\n\n\u003cp\u003eI was hoping there would be some great neat one-line ruby method for this like:\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eRestforce_hash.not_nil.length\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eBut i'm not having just joy tracking something down... is there a way or do i have to iterate over the hash and count the number of != nil records?\u003c/p\u003e","accepted_answer_id":"27110227","answer_count":"3","comment_count":"0","creation_date":"2014-11-24 17:05:00.84 UTC","last_activity_date":"2014-11-24 23:54:03.083 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2236337","post_type_id":"1","score":"0","tags":"ruby|ruby-on-rails-4|salesforce|null","view_count":"60"} +{"id":"41647483","title":"how to return the second node of a path in neo4j?","body":"\u003cp\u003eI have a query for finding paths:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eMATCH p =(o:Order)-[r:seeks*2..8]-\u0026gt;(o:Order)\nWHERE o.Name=\"000089\"\n AND ALL(x IN tail(nodes(p))\n WHERE SINGLE(y IN tail(nodes(p))\n WHERE x=y))\nRETURN extract(n IN nodes(p)| n.Name) AS OrderID, length(p) \nORDER BY length(p)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy output is:\u003c/p\u003e\n\n\u003cp\u003eOrderID length(p)\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003e[000089, \u003cstrong\u003e000091\u003c/strong\u003e, 000089] 2\u003c/li\u003e\n\u003cli\u003e[000089, \u003cstrong\u003e000093\u003c/strong\u003e, 000090, 000089] 3\u003c/li\u003e\n\u003cli\u003e[000089, \u003cstrong\u003e000091\u003c/strong\u003e, 000096, 000095, 000090, 000089] 5\u003c/li\u003e\n\u003cli\u003e[000089, \u003cstrong\u003e000091\u003c/strong\u003e, 000096, 000097, 000093, 000090, 000089] 6\u003c/li\u003e\n\u003cli\u003e[000089, \u003cstrong\u003e000091\u003c/strong\u003e, 000098, 000092, 000095, 000090, 000089] 6\u003c/li\u003e\n\u003cli\u003e[000089, \u003cstrong\u003e000093\u003c/strong\u003e, 000090, 000096, 000097, 000091, 000089] 6\u003c/li\u003e\n\u003cli\u003e[000089, \u003cstrong\u003e000093\u003c/strong\u003e, 000094, 000092, 000097, 000091, 000089] 6\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eSo, what I also want to is to return the second node on each path like (the nodes marked in bold above):\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003e[000091]\u003c/li\u003e\n\u003cli\u003e[000093]\u003c/li\u003e\n\u003cli\u003e[000091]\u003c/li\u003e\n\u003cli\u003e[000091]\u003c/li\u003e\n\u003cli\u003e[000091]\u003c/li\u003e\n\u003cli\u003e[000093]\u003c/li\u003e\n\u003cli\u003e[000093]\u003c/li\u003e\n\u003c/ol\u003e","accepted_answer_id":"41648132","answer_count":"1","comment_count":"3","creation_date":"2017-01-14 06:38:54.25 UTC","last_activity_date":"2017-01-14 10:34:43.19 UTC","last_edit_date":"2017-01-14 10:34:43.19 UTC","last_editor_display_name":"","last_editor_user_id":"3580502","owner_display_name":"","owner_user_id":"7407802","post_type_id":"1","score":"1","tags":"neo4j|cypher","view_count":"201"} +{"id":"19249214","title":"ABC pdf, use specific proxy server for Gecko","body":"\u003cp\u003eIs it possible to configure which web proxy server and credentials the Gecko engine uses to convert HTML to PDF in ABC PDF.\u003c/p\u003e\n\n\u003cp\u003eI cannot find any option to set this up in the settings.\nWe are using the engine in a service and would prefer the proxy details be programmatically supplied rather than merely using the proxy that the service user happens to be configured with.\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","accepted_answer_id":"19253711","answer_count":"1","comment_count":"1","creation_date":"2013-10-08 13:35:51.683 UTC","last_activity_date":"2013-10-08 16:51:21.923 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"231821","post_type_id":"1","score":"0","tags":"c#|abcpdf","view_count":"390"} +{"id":"38848048","title":"Which CPU is better for Android Studio?","body":"\u003cp\u003eI want to know which CPU will be better for Android Studio .\u003c/p\u003e\n\n\u003cp\u003ei5 6500 or i7 6700\u003c/p\u003e\n\n\u003cp\u003eIs Android Studio use the all i7 cores or the i5 enough\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2016-08-09 10:17:16.107 UTC","last_activity_date":"2016-08-09 10:32:28.833 UTC","last_edit_date":"2016-08-09 10:32:28.833 UTC","last_editor_display_name":"","last_editor_user_id":"105466","owner_display_name":"","owner_user_id":"5327287","post_type_id":"1","score":"1","tags":"specifications","view_count":"361"} +{"id":"11659267","title":"ffmpeg 10.04 Could Not Find Codec Parameters","body":"\u003cp\u003eI am getting an error while executing the command\n\u003ccode\u003effmpeg -i /path/to/video.mp4\u003c/code\u003e :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e ffmpeg version git-2012-07-24-93342de Copyright (c) 2000-2012 the FFmpeg developers\n built on Jul 24 2012 23:55:41 with gcc 4.4.3 (Ubuntu 4.4.3-4ubuntu5.1)\n configuration: --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-gpl --enable-nonfree --enable-postproc --enable-swscale --enable-vdpau --enable-version3 --enable-libtheora --enable-libvorbis --enable-libvpx --enable-x11grab\n libavutil 51. 65.100 / 51. 65.100\n libavcodec 54. 44.100 / 54. 44.100\n libavformat 54. 20.100 / 54. 20.100\n libavdevice 54. 2.100 / 54. 2.100\n libavfilter 3. 3.100 / 3. 3.100\n libswscale 2. 1.100 / 2. 1.100\n libswresample 0. 15.100 / 0. 15.100\n libpostproc 52. 0.100 / 52. 0.100\n [mov,mp4,m4a,3gp,3g2,mj2 @ 0x2a1b240] Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), 1280x720): unspecified pixel format\n Consider increasing the value for the 'analyzeduration' and 'probesize' options\n /path/to/video.mp4: could not find codec parameters\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"11659459","answer_count":"1","comment_count":"3","creation_date":"2012-07-25 21:58:23.2 UTC","favorite_count":"4","last_activity_date":"2015-02-12 06:29:47.347 UTC","last_edit_date":"2015-02-12 06:29:47.347 UTC","last_editor_display_name":"","last_editor_user_id":"1307905","owner_display_name":"","owner_user_id":"930715","post_type_id":"1","score":"14","tags":"android|ffmpeg|ubuntu-10.04|x264","view_count":"25417"} +{"id":"40873533","title":"Chrome Extension, Event Script, how to redirect a request without adding to the navigation stack","body":"\u003cp\u003eI am writing a very very little extension to append an argument to a specific URL\u003c/p\u003e\n\n\u003cp\u003eHere is what I have now in a background script:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003echrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) {\n if (tab.url.indexOf(\"developer.apple.com/reference\") != -1 \u0026amp;\u0026amp; tab.url.indexOf(\"?language=objc\") == -1) {\n var objcURL = tab.url + \"?language=objc\";\n chrome.tabs.update(tab.id, {url: objcURL});\n }\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe issue with this is that it ruins my navigation stack. For example, if a user goes to\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e\u003ca href=\"https://developer.apple.com/reference/appkit/nsapplication\" rel=\"nofollow noreferrer\"\u003ehttps://developer.apple.com/reference/appkit/nsapplication\u003c/a\u003e\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eit will then navigate the user to \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e\u003ca href=\"https://developer.apple.com/reference/appkit/nsapplication?language=objc\" rel=\"nofollow noreferrer\"\u003ehttps://developer.apple.com/reference/appkit/nsapplication?language=objc\u003c/a\u003e\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eAnd if they hit back, it will go back to the first link, which then just redirects the user to the second link again. So you can never back out\u003c/p\u003e\n\n\u003cp\u003eMy question is, is there any way to redirect the user directly to the second link when they make a request for the first link?\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2016-11-29 18:49:28 UTC","last_activity_date":"2016-11-29 18:49:28 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2415178","post_type_id":"1","score":"0","tags":"javascript|google-chrome|redirect|google-chrome-extension","view_count":"40"} +{"id":"26258741","title":"Change object using intent and startActivityForResult","body":"\u003cp\u003eI have an object called \u003ccode\u003eContact\u003c/code\u003e which contains an arraylist of type \u003ccode\u003eTransactions\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eI pass the selected contact (from a listview in \u003ccode\u003eactivity1\u003c/code\u003e) to \u003ccode\u003eactivity2\u003c/code\u003e using \u003ccode\u003eintent\u003c/code\u003e and \u003ccode\u003estartActivityForResult\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eIn the second activity I create a new \u003ccode\u003eTransaction\u003c/code\u003e object and add it to the passed \u003ccode\u003eContact\u003c/code\u003e's arraylist of transactions, return it using \u003ccode\u003esetResult\u003c/code\u003e and retrieve it using \u003ccode\u003eonActivityResult\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eMy problem is that the original Contact object doesn't get the new Transaction.\u003c/p\u003e\n\n\u003cp\u003eSending intent:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eIntent intent = new Intent(this, AddTransactionActivity.class);\n intent.putExtra(\"contact\", selectedContact);\n startActivityForResult(intent, 1);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003erecieving intent:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eBundle b = getIntent().getExtras();\n\n if(b != null) {\n recievedContact = (Contact)b.getParcelable(\"contact\");\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSending back result:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003erecievedContact.addTransaction(transaction);\n\n Intent intent = new Intent(this, Contacts_activity.class);\n intent.putExtra(\"contact\", recievedContact);\n setResult(Activity.RESULT_OK, intent);\n finish();\n startActivity(intent);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eRetrieving result:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n if(requestCode == 1) {\n if(resultCode == Activity.RESULT_OK) {\n Bundle b = data.getExtras();\n if(b != null) {\n selectedContact = (Contact)b.getParcelable(\"contact\");\n }\n } else if (resultCode == 0) {\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eedit:\u003c/strong\u003e I put a Log.v(\"result test\", \"success\"); in onActivityResult(), it doesnt show in logcat so it seems my onActivityResult method is never called.\u003c/p\u003e","answer_count":"0","comment_count":"7","creation_date":"2014-10-08 13:57:08.603 UTC","last_activity_date":"2014-10-08 14:18:43.61 UTC","last_edit_date":"2014-10-08 14:18:43.61 UTC","last_editor_display_name":"","last_editor_user_id":"2798413","owner_display_name":"","owner_user_id":"2798413","post_type_id":"1","score":"0","tags":"java|android|android-intent|android-activity","view_count":"160"} +{"id":"6743803","title":"Condensing PHP Arrays?","body":"\u003cp\u003eHello I have the following code to generate my navigation/page menu along with applying a style element to the active page. I'd like to know how I can go about condensing the code rather than having two merging arrays?\u003c/p\u003e\n\n\u003cp\u003eHere's my current code, the difference between the two is the html link outputs. The 'Home' link needs to be \u003ccode\u003e\u0026lt;a href=\"./'. $k .'\"\u0026gt;'. $v .'\u0026lt;/a\u0026gt;\u003c/code\u003e \u003c/p\u003e\n\n\u003cp\u003eWhereas the other pages need to have \u003ccode\u003e\u0026lt;a href=\"./?p='. $k .'\"\u0026gt;'. $v .'\u0026lt;/a\u0026gt;\u003c/code\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\n\n $current = array(\n \"\" =\u0026gt; \"Home\"\n );\n foreach( $current as $k =\u0026gt; $v ) {\n $active = $_GET['p'] == $k\n ? ' class=\"current_page_item\"'\n : '';\n echo '\u0026lt;li'. $active .'\u0026gt;\u0026lt;a href=\"./'. $k .'\"\u0026gt;'. $v .'\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;';\n }\n\n $current = array(\n \"contact\" =\u0026gt; \"Contact Us\",\n \"about\" =\u0026gt; \"About Us\",\n \"privacy\" =\u0026gt; \"Privacy Policy\"\n );\n foreach( $current as $k =\u0026gt; $v ) {\n $active = $_GET['p'] == $k\n ? ' class=\"current_page_item\"'\n : '';\n echo '\u0026lt;li'. $active .'\u0026gt;\u0026lt;a href=\"./?p='. $k .'\"\u0026gt;'. $v .'\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;';\n }\n\n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny help would be much appreciated, thank you :)\u003c/p\u003e","accepted_answer_id":"6743923","answer_count":"2","comment_count":"1","creation_date":"2011-07-19 07:43:58.147 UTC","last_activity_date":"2011-07-19 08:05:05.213 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"815892","post_type_id":"1","score":"1","tags":"php|html|arrays|echo","view_count":"111"} +{"id":"11052642","title":"Read requests and responses made by browser on naviagating a web page in C# webdriver","body":"\u003cp\u003eI wants to read all the requests and responses made and get by the browser on navigating on a page.\u003c/p\u003e\n\n\u003cp\u003eFor ex:\nIf I navigate to \u003ca href=\"http://www.yahoo.com\" rel=\"nofollow\"\u003ehttp://www.yahoo.com\u003c/a\u003e then\nwe observe that browser is making a lots of GET and post requests.\nFor the purpose of image loading, content loading and to display the Ads (Advertisement).\u003c/p\u003e\n\n\u003cp\u003eI am using selenium web driver and C#.\u003c/p\u003e\n\n\u003cp\u003eCan you please help me how can I get all the requests (get/post) and responses.\u003c/p\u003e\n\n\u003cp\u003eThanks,\nRamesh Jhajharia\u003c/p\u003e","accepted_answer_id":"11053449","answer_count":"1","comment_count":"0","creation_date":"2012-06-15 14:27:59.447 UTC","last_activity_date":"2012-06-15 15:12:33.76 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"979743","post_type_id":"1","score":"0","tags":"c#|selenium|webdriver","view_count":"1555"} +{"id":"45329869","title":"Make SQL Server on Azure server available locally","body":"\u003cp\u003eI have a Azure VM running, on which I have installed SQL Server.\nBut I cannot to SQL from SSMS on my local machine. \u003c/p\u003e\n\n\u003cp\u003eThe server have a public IP and Remote Connections have been enabled, as well as TCP/IP protocols.\nI have also checked that port 1433 is open on the firewall.\nI've also created a Network Security Group on the VM as per screenshot below.\u003c/p\u003e\n\n\u003cp\u003eAnything else that might cause the problem (specific to Azure VM's)?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eError:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/A0Quc.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/A0Quc.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eNSG:\u003c/strong\u003e\n\u003ca href=\"https://i.stack.imgur.com/XL6MQ.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/XL6MQ.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eFirewall:\u003c/strong\u003e\n\u003ca href=\"https://i.stack.imgur.com/M52V6.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/M52V6.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e","answer_count":"2","comment_count":"1","creation_date":"2017-07-26 14:27:23.153 UTC","last_activity_date":"2017-07-27 18:33:16.613 UTC","last_edit_date":"2017-07-27 07:52:23.18 UTC","last_editor_display_name":"","last_editor_user_id":"1208908","owner_display_name":"","owner_user_id":"1208908","post_type_id":"1","score":"0","tags":"sql-server|azure|remote-connection","view_count":"42"} +{"id":"23806308","title":"How to Validate a template using Heat API Client?","body":"\u003cp\u003eUnable to Validate a template using Heat-API client,when used below method\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e from heatclient.client import Client \n heat = Client('1', endpoint=heat_url, token=auth_token) \n heat.stacks.validate(template_file) \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eError mesage: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e TypeError: validate() takes exactly 1 argument (2 given)\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"0","creation_date":"2014-05-22 12:03:19.767 UTC","last_activity_date":"2016-12-13 01:45:54.28 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3162710","post_type_id":"1","score":"1","tags":"openstack|openstack-heat","view_count":"1391"} +{"id":"31323465","title":"How to play movie with .mov extension in browser","body":"\u003cp\u003eI have tried the following HTML code and neither works for playing .mov files in Firefox or IE\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;video controls=\"controls\" src=\"video/video_1429118630.MOV\"\u0026gt;Your browser does not support the \u0026lt;code\u0026gt;video\u0026lt;/code\u0026gt; element.\u0026lt;/video\u0026gt;--\u0026gt;\n\n\u0026lt;embed src=\"video/video_1429118630.MOV\" \n Pluginspage=\"http://www.apple.com/quicktime/\" \n width=\"320\" height=\"250\" CONTROLLER=\"true\" LOOP=\"false\" \n AUTOPLAY=\"false\"\u0026gt;\n\u0026lt;/embed\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNot sure what I am doing wrong\u003c/p\u003e","accepted_answer_id":"31325749","answer_count":"1","comment_count":"0","creation_date":"2015-07-09 16:38:25.603 UTC","last_activity_date":"2015-07-09 18:44:15.43 UTC","last_edit_date":"2015-07-09 17:21:48.563 UTC","last_editor_display_name":"","last_editor_user_id":"13302","owner_display_name":"","owner_user_id":"354862","post_type_id":"1","score":"2","tags":"html5|quicktime","view_count":"3541"} +{"id":"46397294","title":"Python: execution order in Threading","body":"\u003cp\u003eThis is a code for testing \u003ccode\u003eThreading\u003c/code\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport threading\nimport time\n\n\nepisode = 0\nlock = threading.Lock()\n\nclass Agent(threading.Thread):\n def __init__(self, id):\n threading.Thread.__init__(self)\n self.id = id\n\n def run(self):\n global episode\n while episode \u0026lt; 5:\n with lock:\n print(\n \"{} : episode will be changed {} -\u0026gt; {}\".format(\n self.id,\n episode,\n episode+1\n )\n )\n episode += 1\n print(\"{} : changed value -\u0026gt; {}\".format(self.id, episode))\n time.sleep(1)\n\n\nif __name__ == \"__main__\":\n agents = []\n for i in range(3):\n agents.append(Agent(i))\n\n for agent in agents:\n agent.start()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eResult:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e0 : episode will be changed 0 -\u0026gt; 1\n0 : changed value -\u0026gt; 1\n0 : episode will be changed 1 -\u0026gt; 2\n0 : changed value -\u0026gt; 2\n0 : episode will be changed 2 -\u0026gt; 3\n0 : changed value -\u0026gt; 3\n0 : episode will be changed 3 -\u0026gt; 4\n0 : changed value -\u0026gt; 4\n0 : episode will be changed 4 -\u0026gt; 5\n0 : changed value -\u0026gt; 5\n1 : episode will be changed 5 -\u0026gt; 6\n1 : changed value -\u0026gt; 6\n2 : episode will be changed 6 -\u0026gt; 7\n2 : changed value -\u0026gt; 7\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is one of result that I had expected:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e0 : episode will be changed 0 -\u0026gt; 1\n0 : changed value -\u0026gt; 1\n2 : episode will be changed 1 -\u0026gt; 2\n2 : changed value -\u0026gt; 2\n1 : episode will be changed 2 -\u0026gt; 3\n1 : changed value -\u0026gt; 3\n2 : episode will be changed 3 -\u0026gt; 4\n2 : changed value -\u0026gt; 4\n0 : episode will be changed 4 -\u0026gt; 5\n0 : changed value -\u0026gt; 5\n .\n .\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI can not understand why thread id=0 keep appearing consecutively in the first place... As I know of, the execution order of threads is random, right?\u003c/p\u003e\n\n\u003cp\u003eWhat's wrong in my code? \u003c/p\u003e","accepted_answer_id":"46397392","answer_count":"2","comment_count":"0","creation_date":"2017-09-25 03:43:58.517 UTC","favorite_count":"1","last_activity_date":"2017-09-25 03:57:46.7 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3595632","post_type_id":"1","score":"1","tags":"python|multithreading","view_count":"32"} +{"id":"30234472","title":"Why is _IELinkClickByText not working how I expect it to?","body":"\u003cp\u003eI'm a first time user of Auto IT and I'm trying to click on a link on a webpage. On the webpage there is a label called \"New Business (NB) Quotation\"\nI want to click it so this is what I'm doing \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eLocal $oIE = _IE_Example(\"basic\")\n\n_IELinkClickByText($oIE,\"New Business (NB) Quotation\")\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis opens up a different webpage and I get confused.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-05-14 10:03:42.443 UTC","last_activity_date":"2016-06-17 20:57:11.363 UTC","last_edit_date":"2016-06-17 20:57:11.363 UTC","last_editor_display_name":"","last_editor_user_id":"2756409","owner_display_name":"","owner_user_id":"4899301","post_type_id":"1","score":"2","tags":"automation|autoit","view_count":"275"} +{"id":"10152754","title":"return text from other activity","body":"\u003cp\u003ei want to start activityB from activityA and return string from activityB then resume activityA is it possible?\ni refer \u003ca href=\"https://stackoverflow.com/questions/449484/android-capturing-the-return-of-an-activity\"\u003eAndroid: Capturing the return of an activity\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"10153389","answer_count":"2","comment_count":"1","creation_date":"2012-04-14 10:08:56.513 UTC","favorite_count":"1","last_activity_date":"2012-04-14 11:57:53.9 UTC","last_edit_date":"2017-05-23 11:49:03.683 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"1311055","post_type_id":"1","score":"0","tags":"android|android-activity","view_count":"1475"} +{"id":"3883055","title":"How to change the appearance of any control when property changes?","body":"\u003cp\u003eI'd like to highlight to the user anything that has been modified, so that they know what they have changed or what has been programatically changed behind the scenes for them.\u003c/p\u003e\n\n\u003cp\u003eI want to use styles to apply this logic to all my controls, but i'm not sure how. I know I need to create a trigger but not sure what to trigger on exactly or how to pick up any changes to the bound property in order to know if it's changed or not.\u003c/p\u003e\n\n\u003cp\u003ethanks.\u003c/p\u003e","answer_count":"3","comment_count":"0","creation_date":"2010-10-07 15:06:11.92 UTC","last_activity_date":"2010-10-07 18:36:37.993 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"11989","post_type_id":"1","score":"1","tags":"c#|wpf|wpf-controls|binding|expression-blend","view_count":"265"} +{"id":"17855939","title":"How to access attribute of superclass instance from child class method","body":"\u003cp\u003eI have the following class structure in my code:\u003cbr\u003e\nA superclass, A, which is basically a list of objects from a subclass, B. Class A has a method, meth, which creates a variable, var, (by reading from a file). The variable, var, needs to be accessible by a method of the subclass B. The problem is that after initialising a = A(), var is a attribute of the instance a, which can't be accessed by subclass methods using super(). var is a large array of floats (around 1e5 elements), so i'm trying to minimise memory usage by not making it an attribute of an instance of B (n times!) or passing it explicitly to methB.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass A(object):\n def __init__(self,n):\n self.data = [B() for _ in xrange(n)]\n\n def __getitem__(self,n):\n return self.data[n]\n\n def methA(self):\n with open('file.txt','r') as fp:\n self.var = fp.readlines()\n\nclass B(A):\n def __init__(self):\n self.derived_var = []\n\n def methB():\n '''This method needs to use var defined in meth of A above.'''\n\na = A(5)\na.methA()\nfor b in A:\n b.methB()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs this possible in python or is it bad coding??\u003c/p\u003e","answer_count":"3","comment_count":"0","creation_date":"2013-07-25 10:49:30.987 UTC","last_activity_date":"2013-07-25 12:44:25.46 UTC","last_edit_date":"2013-07-25 12:44:25.46 UTC","last_editor_display_name":"","last_editor_user_id":"1098683","owner_display_name":"","owner_user_id":"1098683","post_type_id":"1","score":"0","tags":"python|class","view_count":"898"} +{"id":"3251044","title":"Query to Method Expression in Linq!","body":"\u003cp\u003eHow can i right this in method Expression!\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003evar query =\n from l in list where l.Key == \"M\"\u003c/p\u003e\n \n \u003cp\u003eselect new { Value = l, Length = l.Length };\u003c/p\u003e\n\u003c/blockquote\u003e","accepted_answer_id":"3251062","answer_count":"1","comment_count":"0","creation_date":"2010-07-14 22:27:14.44 UTC","last_activity_date":"2010-07-14 22:31:59.157 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"424134","post_type_id":"1","score":"0","tags":"linq","view_count":"181"} +{"id":"7135760","title":"ANDROID : Changing Text Colour on pressing Button in Edit Text","body":"\u003cp\u003eI have 2 things:\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eEditText\u003c/code\u003e and One \u003ccode\u003eButton\u003c/code\u003e .\u003c/p\u003e\n\n\u003cp\u003eI write something in \u003ccode\u003eEditText\u003c/code\u003e and then Press \u003ccode\u003eButton\u003c/code\u003e . In an ON click Listener of that \u003ccode\u003eButton\u003c/code\u003e \nI set the text color of \u003ccode\u003eEditText\u003c/code\u003e to \"Red\". \u003c/p\u003e\n\n\u003cp\u003eProblem is that the text which was written before clicking \u003ccode\u003eButton\u003c/code\u003e also changes to red whereas I want only the characters to become red which are now typed by the user in the EditText.\u003c/p\u003e\n\n\u003cp\u003eCould anyone please help me ???\u003c/p\u003e\n\n\u003cp\u003eRegards\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2011-08-21 01:21:26.407 UTC","favorite_count":"1","last_activity_date":"2014-06-03 09:27:32.107 UTC","last_edit_date":"2014-06-03 09:27:32.107 UTC","last_editor_display_name":"","last_editor_user_id":"1373545","owner_display_name":"","owner_user_id":"829085","post_type_id":"1","score":"-1","tags":"android","view_count":"158"} +{"id":"47494562","title":"How to connect real device to android studio?","body":"\u003cp\u003eAndroid Studio doesn't connect my real device but , I am completed to all below the options ? Please solution me provide ....where is my missing...\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eEnable Debugging on the Device \u003c/li\u003e\n\u003cli\u003eInstall USB Drivers\u003c/li\u003e\n\u003cli\u003eConnect the Device to the Computer\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/mKGkg.jpg\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/mKGkg.jpg\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e","answer_count":"2","comment_count":"4","creation_date":"2017-11-26 09:08:16.42 UTC","last_activity_date":"2017-11-26 10:04:18.907 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3378686","post_type_id":"1","score":"0","tags":"android","view_count":"20"} +{"id":"28840467","title":"Chrome extension for Facebook loads just on refresh","body":"\u003cp\u003eI wrote an extension which should say 'Hi.' \u003cem\u003eevery\u003c/em\u003e time the user clicks on a page and this is the code:\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003emanifest.json\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n\"name\" : \"first-ext\",\n\"version\" : \"1.0\",\n\"manifest_version\" : 2,\n\n\"permissions\":[\n \"tabs\"\n],\n\"content_scripts\":\n[\n {\n \"matches\" : [\"https://www.facebook.com/*\"],\n \"js\": [\"jquery.js\", \"f.js\"],\n \"css\": [\"style.css\"]\n }\n]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e}\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003ef.js\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(document).ready(function(){ \n alert(\"Hi.\"); \n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm using those files and if I refresh every page everything works fine \u003cstrong\u003ebut\u003c/strong\u003e if I change page by clicking on every link then the script do not run on the new page.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eFor example\u003c/strong\u003e if open the Facebook home page the extension say \"Hi.\";\nIf now I refresh it works again.\nIf I click on a link of a time line of a friend then the browsers opens the page but the extension don't work. It's like if the script is not executed.\nIf I refresh then it works again.\u003c/p\u003e\n\n\u003cp\u003eIt's unusual because I tried the same extension on other sites and it works fine if I refresh and if I change page by clicking some link.\u003c/p\u003e\n\n\u003cp\u003eSorry for my english.\u003c/p\u003e","accepted_answer_id":"28847783","answer_count":"1","comment_count":"0","creation_date":"2015-03-03 19:38:01.723 UTC","favorite_count":"1","last_activity_date":"2015-03-04 06:16:29.223 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4629196","post_type_id":"1","score":"0","tags":"javascript|jquery|facebook|google-chrome","view_count":"111"} +{"id":"34285190","title":"Compare date from CSV to reference date","body":"\u003cp\u003eI am parsing a CSV file using a PowerShell script. I would like to compare date read from the CSV file with current date and do certain operation or exit processing script. Can any one help me on below issue?\u003c/p\u003e\n\n\u003cp\u003eDate in the CSV file is like below:\u003cbr\u003e\nTrading Date:,2015-12-14\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$CurrentTimeStamp = Get-Date\n$TradeDate = $CurrentTimeStamp.ToString(\"yyyyMMdd\")\n$CheckDate = $TradeDate\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eTradeDate is as above:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$FileTradeDate = $Cols[1]\n$TradeDate = $FileTradeDate.ToString(\"yyyy-MM-dd\")\nif ($TradeDate -ne $CheckDate) {\n $host.Exit()\n} else {\n $TradeDate = $FileTradeDate\n LogWrite $TradeDate\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am getting below error:\u003c/p\u003e\n\n\u003cpre class=\"lang-none prettyprint-override\"\u003e\u003ccode\u003eCannot find an overload for \"ToString\" and the argument count: \"1\".\nAt \\\\multinasdub301\\Software\\SysAdmin\\WebDownloads\\ProcessUBSFrescoCCYHDG.ps1:139 char:5\n+ $TradeDate = $FileTradeDate.ToString(\"yyyy-MM-dd\")\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n + CategoryInfo : NotSpecified: (:) [], MethodException\n + FullyQualifiedErrorId : MethodCountCouldNotFindBest\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"34286573","answer_count":"1","comment_count":"0","creation_date":"2015-12-15 09:17:33.787 UTC","last_activity_date":"2015-12-16 15:59:02.353 UTC","last_edit_date":"2015-12-15 10:23:49.513 UTC","last_editor_display_name":"","last_editor_user_id":"1630171","owner_display_name":"user4311023","post_type_id":"1","score":"0","tags":"csv|powershell-v3.0","view_count":"75"} +{"id":"25251030","title":"asp:dropdown menu not selecting correct list item after data bind","body":"\u003cp\u003eI have some dropdowns that are I've built an incrementer function for rather than generating all of the options by hand.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic static List\u0026lt;int\u0026gt; Incrementor(int startValue, int maxValue, int increment)\n{\n var list = new List\u0026lt;int\u0026gt;();\n for (int i = startValue; i \u0026lt;= maxValue; i += increment)\n {\n list.Add(i);\n }\n return list;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis gets called on \u003ccode\u003ePage_Load\u003c/code\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eddlMonths.DataSource = Incrementor(0, 12, 1);\nddlHOA.DataSource = Incrementor(0, 500, 50);\nddlRemodel.DataSource = Incrementor(0, 80, 5);\nddlUtilities.DataSource = Incrementor(0, 500, 100);\n\nddlMonths.DataBind();\nddlHOA.DataBind();\nddlRemodel.DataBind();\nddlUtilities.DataBind();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAfter I retrieve the object from the database, I'm getting the correct values, however, when I try to have the dropdowns select the correct value it always selects \u003ccode\u003e0\u003c/code\u003e. Do you see the error in my code?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e// If there is an offer fill out the forms\nIf (offer != null)\n{\n ddlRemodel.SelectedValue = offer.RemodelRate.ToString();\n ddlMonths.SelectedValue = offer.MonthsHeld.ToString();\n ddlHOA.SelectedValue = (offer.HOADues * 2).ToString();\n ddlUtilities.SelectedValue = offer.Utilities.ToString();\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"6","creation_date":"2014-08-11 19:37:05.687 UTC","last_activity_date":"2014-08-11 19:58:55.457 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"453985","post_type_id":"1","score":"-1","tags":"c#|data-binding|webforms","view_count":"123"} +{"id":"31492296","title":"Webpage load and AJAX","body":"\u003cp\u003e\u003cstrong\u003eGood evening everyone\u003c/strong\u003e,\u003c/p\u003e\n\n\u003cp\u003eI am sorry to ask such a question, but my knowledge on the particular subject is not strong, and I tried hard to search both here and on Google, but it appears that I know the wrong keywords, or perhaps I just missed it when I found it.\u003c/p\u003e\n\n\u003cp\u003eI would like to achieve an effect that can be shown whenever a webpage like the ones here, is loaded:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://www.birradelleremo.it/\" rel=\"nofollow\" title=\"Birra Dell\u0026#39;Eremo\"\u003eBirra Dell'Eremo\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://jurajmolnar.com/\" rel=\"nofollow\"\u003eJuraj Molnàr\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://www.palzileri.com/\" rel=\"nofollow\"\u003ePal Zileri\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eAs you can see, the webpages and the sub-pages of the website are all loaded \"behind\" a preloader, in some cases an image, in others an SVG, no matter.\u003c/p\u003e\n\n\u003cp\u003eI would like to know, or at least be pointed to, a good tutorial and way to learn such a thing. I am not only interested in the loader tho', because I did find some resources about the preloading process.\u003c/p\u003e\n\n\u003cp\u003eWhat really interests me is how those webpages, among many others, use loaders to \"asynchronously\" load content into the page, \u003cstrong\u003emaking it feel native and real-time each time you change a page from the menu\u003c/strong\u003e.\u003c/p\u003e\n\n\u003cp\u003eIs it all about using the loader both on arrival and \"departure\" from a webpage?\u003c/p\u003e\n\n\u003cp\u003eIs it fast and \"feels real time\" because the first time you change web page with the menu, the loader image and a few css rules were cached in the browser?\u003c/p\u003e\n\n\u003cp\u003eHow does it work, where can I look for it? Which are the \u003cstrong\u003ekeywords\u003c/strong\u003e?\u003c/p\u003e\n\n\u003cp\u003eThank you very much for your patience, I do hope I will not get downvoted for asking such a trivial question, but I had to ask, because I could not reach an answer on my own.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT\u003c/strong\u003e\nI might not be the clearest person in my explanation, and for that I ask of you to forgive me, but the effect that I am trying to find (the loading effect both on \"entrance\" and \"exit\" from pages) should also send you to the new page, and not load content with AJAX in a predefined DIV or any tag. I heard about the usage of the history API, but that is not what I am looking for.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT II\u003c/strong\u003e\nSo far no answer has been given, and I wasn't able to find any good answer aswell on the internet, possibly for my lack of keyword knowledge, I presume. I will try to do a loader that works both on load and unload of the page; will let you know as soon as I'm done. Thank you again.\u003c/p\u003e\n\n\u003cp\u003eThanks again.\u003c/p\u003e","answer_count":"0","comment_count":"7","creation_date":"2015-07-18 14:42:54.633 UTC","favorite_count":"1","last_activity_date":"2015-07-22 13:50:14.91 UTC","last_edit_date":"2015-07-22 13:50:14.91 UTC","last_editor_display_name":"","last_editor_user_id":"3064193","owner_display_name":"","owner_user_id":"3064193","post_type_id":"1","score":"1","tags":"javascript|css|ajax|load|loader","view_count":"28"} +{"id":"24964834","title":"Creating an associated model instance along with the primary instance","body":"\u003cp\u003eCreating an associated model instance along with the primary instance\u003c/p\u003e\n\n\u003cp\u003eWhen I create a car, I need it to have a key as well. I do both within the Car#Create action. Is that correct or not? What errors could it cause? How should it be done?\u003c/p\u003e\n\n\u003cp\u003eWhile this works, it just doesn't appear to be Rubyist, or RESTful, to me. Not that I am a stickler for that, but I want this to be right. Thanks... \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e def create\n @car = Car.new(car_params)\n @key = Key.new(key_params)\n if @key.save and @car.save\n flash[:notice] = \"Car has been created.\"\n else\n @key.destroy unless @key.nil?\n @car.destroy unless @car.nil?\n flash[:alert] = \"Car has not be created.\"\n end\n redirect_to cars_path\n end\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"24965556","answer_count":"2","comment_count":"4","creation_date":"2014-07-25 21:33:11.343 UTC","favorite_count":"1","last_activity_date":"2014-08-26 19:03:49.41 UTC","last_edit_date":"2014-08-26 19:03:49.41 UTC","last_editor_display_name":"","last_editor_user_id":"727208","owner_display_name":"","owner_user_id":"1843663","post_type_id":"1","score":"0","tags":"ruby-on-rails|ruby|rails-activerecord","view_count":"40"} +{"id":"39053899","title":"how to select a radio button in selenium python?","body":"\u003cpre\u003e\u003ccode\u003e\u0026lt;ul\u0026gt;\n\n \u0026lt;li\u0026gt;\n \u0026lt;label class=\"checkbox\"\u0026gt;\n \u0026lt;input checked=\"checked\" id=\"fechapublicacion\" name=\"fechapublicacion\" onclick=\"javascript: filtrarListado(\u0026amp;#39;fechapublicacion\u0026amp;#39;, this);\" type=\"radio\" value=\"0\" /\u0026gt;\n \u0026lt;span\u0026gt;Cualquier fecha\u0026lt;/span\u0026gt;\n \u0026lt;/label\u0026gt;\n \u0026lt;input id=\"fechapublicacionhidden\" name=\"fechapublicacionhidden\" type=\"hidden\" value=\"0\" /\u0026gt;\n \u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\n \u0026lt;label class=\"checkbox\"\u0026gt;\n \u0026lt;input id=\"fechapublicacion\" name=\"fechapublicacion\" onclick=\"javascript: filtrarListado(\u0026amp;#39;fechapublicacion\u0026amp;#39;, this);\" type=\"radio\" value=\"1\" /\u0026gt;\n \u0026lt;span\u0026gt;\u0026amp;#218;ltimas 24 horas\u0026lt;/span\u0026gt;\n \u0026lt;/label\u0026gt;\n \u0026lt;input id=\"fechapublicacionhidden\" name=\"fechapublicacionhidden\" type=\"hidden\" value=\"0\" /\u0026gt;\n \u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\n \u0026lt;label class=\"checkbox\"\u0026gt;\n \u0026lt;input id=\"fechapublicacion\" name=\"fechapublicacion\" onclick=\"javascript: filtrarListado(\u0026amp;#39;fechapublicacion\u0026amp;#39;, this);\" type=\"radio\" value=\"7\" /\u0026gt;\n \u0026lt;span\u0026gt;\u0026amp;#218;ltimos 7 d\u0026amp;#237;as\u0026lt;/span\u0026gt;\n \u0026lt;/label\u0026gt;\n \u0026lt;input id=\"fechapublicacionhidden\" name=\"fechapublicacionhidden\" type=\"hidden\" value=\"0\" /\u0026gt;\n \u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\n \u0026lt;label class=\"checkbox\"\u0026gt;\n \u0026lt;input id=\"fechapublicacion\" name=\"fechapublicacion\" onclick=\"javascript: filtrarListado(\u0026amp;#39;fechapublicacion\u0026amp;#39;, this);\" type=\"radio\" value=\"15\" /\u0026gt;\n \u0026lt;span\u0026gt;\u0026amp;#218;ltimos 15 d\u0026amp;#237;as\u0026lt;/span\u0026gt;\n \u0026lt;/label\u0026gt;\n \u0026lt;input id=\"fechapublicacionhidden\" name=\"fechapublicacionhidden\" type=\"hidden\" value=\"0\" /\u0026gt;\n \u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am trying to select the last radio button. Since all of them have same id, how can i select the last one.\u003c/p\u003e\n\n\u003cp\u003eAny help will be appreciated.\u003c/p\u003e","accepted_answer_id":"39054046","answer_count":"2","comment_count":"4","creation_date":"2016-08-20 12:01:35.28 UTC","last_activity_date":"2016-08-20 13:52:27.693 UTC","last_edit_date":"2016-08-20 12:33:04.05 UTC","last_editor_display_name":"","last_editor_user_id":"3855999","owner_display_name":"","owner_user_id":"3855999","post_type_id":"1","score":"0","tags":"python|selenium|selenium-webdriver","view_count":"1789"} +{"id":"40374653","title":"Binding viewmodel to view has usercontrol with own viewmodel","body":"\u003cp\u003eI have a UserControl 'UserControlA' with ViewModel 'ViewModelA'.\n'UserControlA' has 'UserControlB', and 'UserControlB' has 'ViewModelB'.\u003c/p\u003e\n\n\u003cp\u003eWhen I bind a DependencyProperty in 'UserControlA' with 'ViewModelA' property,\nthere is none of setter fired.\u003c/p\u003e\n\n\u003cp\u003eBelows are code,\u003c/p\u003e\n\n\u003cp\u003eViewA.xaml\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;UserControl\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \n xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n xmlns:vm=\"clr-namespace:MyTest.ViewModel\n xmlns:custom=\"clr-namespace:MyTest.Views\n x:Name=\"userControl\" x:Class=\"MyTest.Views.UserControlA\" \n mc:Ignorable=\"d\" \n d:DesignHeight=\"300\" d:DesignWidth=\"500\"\u0026gt;\n\n\u0026lt;UserControl.DataContext\u0026gt;\n \u0026lt;vm:UserViewModel x:Name=\"uvModel\"/\u0026gt;\n\u0026lt;/UserControl.DataContext\u0026gt;\n\u0026lt;Grid\u0026gt;\n\u0026lt;custom:UserControlB\u0026gt;\u0026lt;/custom:UserControlB\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003c/p\u003e\n\n\u003cp\u003eViewA.cs\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic partial class UserView : UserControl, IUserView\n{ \n static DependencyProperty UserTypeProperty = DependencyProperty.Register(\"UserType\", typeof(UserType), typeof(UserView), new PropertyMetadata(UserType.None));\n public UserType UserType { get { return (UserType)GetValue(UserTypeProperty); } set { SetValue(UserTypeProperty, value); } }\n public ViewA()\n {\n InitializeComponent();\n\n Binding typeBinding = new Binding();\n typeBinding.Source = this.DataContext;\n typeBinding.Path = new PropertyPath(\"User.UserType\");\n typeBinding.Mode = BindingMode.OneWayToSource;\n this.SetBinding(UserTypeProperty, typeBinding); \n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eViewModelA.cs\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class ViewModelA : ViewModelBase\n{\n\n User user = new User();\n public User User\n {\n get { return this.user; }\n set\n {\n this.user = value; \n RaisePropertyChanged(() =\u0026gt; User); \n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ePlease help me out from this problem.\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2016-11-02 07:38:48.253 UTC","last_activity_date":"2016-11-03 03:33:14.98 UTC","last_edit_date":"2016-11-03 03:33:14.98 UTC","last_editor_display_name":"","last_editor_user_id":"6496841","owner_display_name":"","owner_user_id":"6496841","post_type_id":"1","score":"0","tags":"wpf|mvvm|binding","view_count":"46"} +{"id":"30936022","title":"Extract ZIP's contents on screen but avoid extra information except of the file names","body":"\u003cp\u003eI am looking for a command that will print all the contents of an archive (including sub-folders and it's files) without extracting the actual archive on the disk, but only on screen.\u003c/p\u003e\n\n\u003cp\u003eI achieve something using some other questions and answers from this site, and here is my command:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eunzip -l test.zip | awk '/-----/ {p = ++p % 2; next} p {print $NF}'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe output:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e0 04-11-2009 13:43 jodconverter-webapp-2.2.2/ 1815 04-11-2009 13:43 jodconverter-webapp-2.2.2/README.txt 0 04-11-2009 13:43 jodconverter-webapp-2.2.2/src/ 5349 04-11-2009 13:42 jodconverter-webapp-2.2.2/src/jodconverter-webapp-2.2.2-sources.jar 26436 04-11-2009 13:43 jodconverter-webapp-2.2.2/LICENSE.txt 3819 04-11-2009 13:43 jodconverter-webapp-2.2.2/ChangeLog.txt 3314202 04-11-2009 13:42 jodconverter-webapp-2.2.2/jodconverter-webapp-2.2.2.war\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAs you can see the output is one line, and includes some extra information that I don't really need.\u003c/p\u003e\n\n\u003cp\u003eI want an output of this kind:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ejodconverter-webapp-2.2.2/\njodconverter-webapp-2.2.2/README.txt\njodconverter-webapp-2.2.2/src/\njodconverter-webapp-2.2.2/src/jodconverter-webapp-2.2.2-sources.jar\n.\n.\n.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo not only I want to output the file names only (and their full path) and avoid any extra other information like \u003ccode\u003etime\u003c/code\u003e \u003ccode\u003epermissions\u003c/code\u003e and so on, but also I want to use something like \u003ccode\u003ebreak-line\u003c/code\u003e to distinguish different files.\u003c/p\u003e\n\n\u003cp\u003eKeep in mind that this command will run on a PHP file to get the contents of the file, so I don't know if this can help us to use the \u003ccode\u003e\u0026lt;br\u0026gt;\u003c/code\u003e to do the break lines.\u003c/p\u003e\n\n\u003cp\u003eIs that possible with a single command?\u003c/p\u003e","accepted_answer_id":"30938036","answer_count":"1","comment_count":"0","creation_date":"2015-06-19 10:35:21.72 UTC","last_activity_date":"2015-06-19 12:22:23.837 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4329348","post_type_id":"1","score":"1","tags":"php|linux|command-line|zip","view_count":"26"} +{"id":"47261856","title":"Find Index of Object in array with Aggregate","body":"\u003cp\u003eIs there a way to get index in aggregate pipeline, I have a result from long aggreagte query \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[\n {\n \"_id\": \"59ed949227ec482044b2671e\",\n \"points\": 300,\n \"fan_detail\": [\n {\n \"_id\": \"59ed949227ec482044b2671e\",\n \"name\": \"mila \",\n \"email\": \"mila@gmail.com \",\n \"password\": \"$2a$10$J0.KfwVnZkaimxj/BiqGW.D40qXhvrDA952VV8x.xdefjNADaxnSW\",\n \"username\": \"mila 0321\",\n \"updated_at\": \"2017-10-23T07:04:50.004Z\",\n \"created_at\": \"2017-10-23T07:04:50.004Z\",\n \"celebrity_request_status\": 0,\n \"push_notification\": [],\n \"fan_array\": [],\n \"fanLength\": 0,\n \"celeb_bio\": null,\n \"is_admin\": 0,\n \"is_blocked\": 2,\n \"notification_setting\": [\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7\n ],\n \"total_stars\": 0,\n \"total_points\": 134800,\n \"user_type\": 2,\n \"poster_pic\": null,\n \"profile_pic\": \"1508742289662.jpg\",\n \"facebook_id\": \"alistnvU79vcc81PLW9o\",\n \"is_user_active\": 1,\n \"is_username_selected\": \"false\",\n \"__v\": 0\n }\n ]\n }\n],\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eso I want to find the index of \u003ccode\u003e_id\u003c/code\u003e in aggregate query and above array can contain 100s of object in it.\u003c/p\u003e","accepted_answer_id":"47262274","answer_count":"1","comment_count":"0","creation_date":"2017-11-13 10:13:34.087 UTC","last_activity_date":"2017-11-13 10:35:14.673 UTC","last_edit_date":"2017-11-13 10:35:14.673 UTC","last_editor_display_name":"","last_editor_user_id":"2313887","owner_display_name":"","owner_user_id":"6742390","post_type_id":"1","score":"0","tags":"javascript|node.js|mongodb|mongoose","view_count":"29"} +{"id":"5553330","title":"RoR3 rake unit tests suddenly don't work on new computer?","body":"\u003cp\u003eI recently deployed a Ruby on Rails 3 app (using a jruby RVM) to a new computer, using a differnet linux OS than I am used to. I ran my unit tests to make sure everything work, and the test aborted before it had (seemingly) even executed a single line of code.\u003c/p\u003e\n\n\u003cp\u003eTo debug, I deleted all the tests out of my unit test folder, and added a single dummy test:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003erequire 'test_helper'\n\nclass LineupTest \u0026lt; ActiveSupport::TestCase\n # Replace this with your real tests.\n test \"the truth\" do\n assert true\n end\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd I STILL got the abortion. Specifically, the error I am seeing is:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cblockquote\u003e\n \u003cp\u003erake test:units --trace (in /usr/local/labs/.staging/pcms1301944989)\u003c/p\u003e\n \u003c/blockquote\u003e\n \n \u003cp\u003ewhich: no sudo in\n (/home/labs/.rvm/gems/jruby-1.5.6@pcms_stable/bin:/home/labs/.rvm/gems/jruby-1.5.6@global/bin:/home/labs/.rvm/rubies/jruby-1.5.6/bin:/home/labs/.rvm/bin:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.4.4)\u003c/p\u003e\n \n \u003cp\u003e\u003cem\u003e*\u003c/em\u003e Using highline effectively in JRuby requires manually installing the\n ffi-ncurses gem.\u003c/p\u003e\n \n \u003cp\u003e\u003cem\u003e*\u003c/em\u003e jruby -S gem install ffi-ncurses\u003c/p\u003e\n \n \u003cp\u003e** Invoke test:units (first_time)\u003c/p\u003e\n \n \u003cp\u003e** Invoke test:prepare (first_time)\u003c/p\u003e\n \n \u003cp\u003e** Invoke db:test:prepare (first_time)\u003c/p\u003e\n \n \u003cp\u003e** Invoke db:abort_if_pending_migrations\n (first_time)\u003c/p\u003e\n \n \u003cp\u003e** Invoke environment (first_time)\u003c/p\u003e\n \n \u003cp\u003e** Execute environment\u003c/p\u003e\n \n \u003cp\u003e** Execute db:abort_if_pending_migrations\u003c/p\u003e\n \n \u003cp\u003e** Execute db:test:prepare\u003c/p\u003e\n \n \u003cp\u003e** Invoke db:test:load (first_time)\u003c/p\u003e\n \n \u003cp\u003e** Invoke db:test:purge (first_time)\u003c/p\u003e\n \n \u003cp\u003e** Invoke environment \u003c/p\u003e\n \n \u003cp\u003e** Execute db:test:purge\u003c/p\u003e\n \n \u003cp\u003e** Execute db:test:load\u003c/p\u003e\n \n \u003cp\u003e** Invoke db:schema:load (first_time)\u003c/p\u003e\n \n \u003cp\u003e** Invoke environment \u003c/p\u003e\n \n \u003cp\u003e** Execute db:schema:load\u003c/p\u003e\n \n \u003cp\u003e** Execute test:prepare\u003c/p\u003e\n \n \u003cp\u003e** Execute test:units which: no sudo in\n (/home/labs/.rvm/gems/jruby-1.5.6@pcms_stable/bin:/home/labs/.rvm/gems/jruby-1.5.6@global/bin:/home/labs/.rvm/rubies/jruby-1.5.6/bin:/home/labs/.rvm/bin:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.4.4)\u003c/p\u003e\n \n \u003cp\u003erake aborted! Command failed with\n status (1):\n [/home/labs/.rvm/rubies/jruby-1.5.6/bin/jru...]\u003c/p\u003e\n \n \u003cp\u003e/home/labs/.rvm/gems/jruby-1.5.6@pcms_stable/gems/rake-0.8.7/lib/rake.rb:995:in\n \u003ccode\u003esh'\n /home/labs/.rvm/gems/jruby-1.5.6@pcms_stable/gems/rake-0.8.7/lib/rake.rb:1010:in\n \u003c/code\u003ecall'\n /home/labs/.rvm/gems/jruby-1.5.6@pcms_stable/gems/rake-0.8.7/lib/rake.rb:1010:in\n \u003ccode\u003esh'\n /home/labs/.rvm/gems/jruby-1.5.6@pcms_stable/gems/rake-0.8.7/lib/rake.rb:1098:in\n \u003c/code\u003esh'\n /home/labs/.rvm/gems/jruby-1.5.6@pcms_stable/gems/rake-0.8.7/lib/rake.rb:1029:in\n \u003ccode\u003eruby'\n /home/labs/.rvm/gems/jruby-1.5.6@pcms_stable/gems/rake-0.8.7/lib/rake.rb:1098:in\n \u003c/code\u003eruby'\n /home/labs/.rvm/gems/jruby-1.5.6@pcms_stable/gems/railties-3.0.3/lib/rails/test_unit/testing.rake:26:in\n \u003ccode\u003edefine'\n /home/labs/.rvm/gems/jruby-1.5.6@pcms_stable/gems/rake-0.8.7/lib/rake.rb:1112:in\n \u003c/code\u003everbose'\n /home/labs/.rvm/gems/jruby-1.5.6@pcms_stable/gems/railties-3.0.3/lib/rails/test_unit/testing.rake:11:in\n \u003ccode\u003edefine'\n /home/labs/.rvm/gems/jruby-1.5.6@pcms_stable/gems/rake-0.8.7/lib/rake.rb:636:in\n \u003c/code\u003ecall'\n /home/labs/.rvm/gems/jruby-1.5.6@pcms_stable/gems/rake-0.8.7/lib/rake.rb:636:in\n \u003ccode\u003eexecute'\n /home/labs/.rvm/gems/jruby-1.5.6@pcms_stable/gems/rake-0.8.7/lib/rake.rb:631:in\n \u003c/code\u003eeach'\n /home/labs/.rvm/gems/jruby-1.5.6@pcms_stable/gems/rake-0.8.7/lib/rake.rb:631:in\n \u003ccode\u003eexecute'\n /home/labs/.rvm/gems/jruby-1.5.6@pcms_stable/gems/rake-0.8.7/lib/rake.rb:597:in\n \u003c/code\u003einvoke_with_call_chain'\n /home/labs/.rvm/rubies/jruby-1.5.6/lib/ruby/1.8/monitor.rb:191:in\n \u003ccode\u003emon_synchronize'\n /home/labs/.rvm/gems/jruby-1.5.6@pcms_stable/gems/rake-0.8.7/lib/rake.rb:590:in\n \u003c/code\u003einvoke_with_call_chain'\n /home/labs/.rvm/gems/jruby-1.5.6@pcms_stable/gems/rake-0.8.7/lib/rake.rb:583:in\n \u003ccode\u003einvoke'\n /home/labs/.rvm/gems/jruby-1.5.6@pcms_stable/gems/rake-0.8.7/lib/rake.rb:2051:in\n \u003c/code\u003einvoke_task'\n /home/labs/.rvm/gems/jruby-1.5.6@pcms_stable/gems/rake-0.8.7/lib/rake.rb:2029:in\n \u003ccode\u003etop_level'\n /home/labs/.rvm/gems/jruby-1.5.6@pcms_stable/gems/rake-0.8.7/lib/rake.rb:2029:in\n \u003c/code\u003eeach'\n /home/labs/.rvm/gems/jruby-1.5.6@pcms_stable/gems/rake-0.8.7/lib/rake.rb:2029:in\n \u003ccode\u003etop_level'\n /home/labs/.rvm/gems/jruby-1.5.6@pcms_stable/gems/rake-0.8.7/lib/rake.rb:2068:in\n \u003c/code\u003estandard_exception_handling'\n /home/labs/.rvm/gems/jruby-1.5.6@pcms_stable/gems/rake-0.8.7/lib/rake.rb:2023:in\n \u003ccode\u003etop_level'\n /home/labs/.rvm/gems/jruby-1.5.6@pcms_stable/gems/rake-0.8.7/lib/rake.rb:2001:in\n \u003c/code\u003erun'\n /home/labs/.rvm/gems/jruby-1.5.6@pcms_stable/gems/rake-0.8.7/lib/rake.rb:2068:in\n \u003ccode\u003estandard_exception_handling'\n /home/labs/.rvm/gems/jruby-1.5.6@pcms_stable/gems/rake-0.8.7/lib/rake.rb:1998:in\n \u003c/code\u003erun'\n /home/labs/.rvm/gems/jruby-1.5.6@pcms_stable/gems/rake-0.8.7/bin/rake:31\n /home/labs/.rvm/gems/jruby-1.5.6@pcms_stable/gems/rake-0.8.7/bin/rake:19:in `load'\n /home/labs/.rvm/gems/jruby-1.5.6@pcms_stable/bin/rake:19\u003c/p\u003e\n\u003c/blockquote\u003e","answer_count":"1","comment_count":"0","creation_date":"2011-04-05 14:16:39.74 UTC","last_activity_date":"2011-05-06 13:18:52.793 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"99502","post_type_id":"1","score":"0","tags":"ruby-on-rails-3|rake|jruby","view_count":"437"} +{"id":"31458420","title":"dependent: :destroy - can I delay this with Delayed Job?","body":"\u003cp\u003eI have two models, one stores events and the other is a join model to a calendar model. The join model integrates with a remote Calendar API, and manages itself through API calls when created or deleted (through before_save and before_destroy callbacks).\u003c/p\u003e\n\n\u003cp\u003eThis works great when deleting join model records one at a time, but since I have dependent: :destroy on the has_many association defined in my event model (I do not want orphaned events in the remote calendar), deletion of a single event will cause N api calls (where N is the number of join model records, which could hypothetically be thousands) which would readily cause timeouts.\u003c/p\u003e\n\n\u003cp\u003eIdeally I would like to delay the CalendarEvent.destroy call, but only when it is called from the deletion of an Event. For example:\u003c/p\u003e\n\n\u003cp\u003eEvent.destroy [call delay.destroy on all CalendarEvent (join model) records]\nCalendarEvent.destroy [destroy without delayed_job]\u003c/p\u003e\n\n\u003cp\u003eIs there a way to delay this through the has_many call?\u003c/p\u003e\n\n\u003cp\u003eIs there a way to pass a custom destroy method through dependent:?\u003c/p\u003e\n\n\u003cp\u003eIs there a way, in the CalendarEvent.destroy method, to know whether or not it's being called from a dependent: :destroy definition?\u003c/p\u003e","accepted_answer_id":"31462171","answer_count":"2","comment_count":"1","creation_date":"2015-07-16 15:25:20.11 UTC","last_activity_date":"2015-07-16 18:46:24.483 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2215882","post_type_id":"1","score":"0","tags":"ruby-on-rails|ruby|ruby-on-rails-4|activerecord|delayed-job","view_count":"483"} +{"id":"26870686","title":"SIGCHLD causing segmentation fault, not going into handler","body":"\u003cp\u003eI'm trying to make a simple shell and am adding in functionality to run processes in the background with \u0026amp;. \nIn my main method I basically have:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eint main() {\n if (signal(SIGCHLD, handle) == SIG_ERR)\n perror(\"Cannot catch SIGCHLD\");\n pid_t child = fork();\n if (child == 0)\n execvp(command, arguments);\n else {\n if (background == 1) {\n printf(\"1\");\n backgroundList(command, child);\n printf(\"2\"); }\n else \n waitpid(child, NULL, 0);\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd for my handler I have:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evoid handle(int s) {\n printf(\"a\");\n if (signal(SIGCHLD, handle) == SIG_ERR)\n perror(\"Cannot catch SIGCHLD\");\n pid_t pid;\n printf(\"b\");\n while((pid = waitpid(0, NULL, WNOHANG)) \u0026gt; 0) {\n printf(\"c\");\n rmBackgroundList(pid);\n printf(\"d\");\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI can can have it run a process in the foreground just fine. Running \"ls\" has the contents print to the screen, then \"a\" and \"b\" are printed since it goes into the SIGCHLD handler, but it doesn't go to \"c\" since it's already been waited on. \u003c/p\u003e\n\n\u003cp\u003eHowever, running something in the background (\"ls\u0026amp;\") will print \"1\" and \"2\", have the parent go back to the prompt, then the child will print the contents to the screen, then segmentation fault. It does not print any of the letters I have in the handler. \u003c/p\u003e\n\n\u003cp\u003eI cannot figure out why SIGCHLD is good for children that are already waited on but causes a segmentation fault and never even goes into the handler for processes that were not waited on. \u003c/p\u003e","accepted_answer_id":"26870869","answer_count":"1","comment_count":"1","creation_date":"2014-11-11 17:22:44.977 UTC","last_activity_date":"2014-11-11 17:42:32.027 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3448835","post_type_id":"1","score":"0","tags":"c|shell|signals","view_count":"208"} +{"id":"35777388","title":"opencart Add to cart in category page not adding item to cart","body":"\u003cp\u003eI am trying to add items from category page. But it is taking me to next product page rather then adding such product into the cart. But same functionality is working ok in product page.\u003c/p\u003e\n\n\u003cp\u003eTo find the solution i have added \u003cpre\u003e to check what array i am getting. After adding it such functionality of add to cart in category page was working. I am a bit confuse what to do with that. Kindly help or advice. Following is the code for Add-to-Cart button in category.tpl file.\u003c/p\u003e\n\n\u003ccode\u003e\u0026lt;button type=\"button\" onclick=\"cart.add('\u0026lt;?php echo $product['product_id']; ?\u0026gt;', '\u0026lt;?php echo $product['minimum']; ?\u0026gt;');\"\u0026gt;\u0026lt;span class=\"hidden-xs hidden-sm hidden-md\"\u0026gt;\u0026lt;?php echo $button_cart; ?\u0026gt;\u0026lt;/span\u0026gt; \u0026lt;i class=\"fa fa-shopping-cart\"\u0026gt;\u0026lt;/i\u0026gt;\u0026lt;/button\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"35777600","answer_count":"1","comment_count":"0","creation_date":"2016-03-03 16:16:14.25 UTC","last_activity_date":"2017-07-16 08:38:28.187 UTC","last_edit_date":"2016-03-03 16:31:47.81 UTC","last_editor_display_name":"","last_editor_user_id":"5525487","owner_display_name":"","owner_user_id":"5525487","post_type_id":"1","score":"0","tags":"javascript|php|jquery|opencart","view_count":"460"} +{"id":"46176780","title":"R Plotly: Bugs in parcoords plot","body":"\u003cp\u003eI'm experiencing very strange bugs when working with \u003ccode\u003eplotly\u003c/code\u003e in \u003ccode\u003eR\u003c/code\u003e when using the \u003ccode\u003eparcoords\u003c/code\u003e plot. \u003c/p\u003e\n\n\u003cp\u003eFor example, using the example provided here: \u003ca href=\"https://plot.ly/r/parallel-coordinates-plot/\" rel=\"nofollow noreferrer\"\u003ehttps://plot.ly/r/parallel-coordinates-plot/\u003c/a\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elibrary(plotly)\n\ndf \u0026lt;- read.csv(\"https://raw.githubusercontent.com/bcdunbar/datasets/master/iris.csv\")\n\ndf %\u0026gt;%\n plot_ly(type = 'parcoords',\n line = list(color = ~species_id,\n colorscale = list(c(0,'red'),c(0.5,'green'),c(1,'blue'))),\n dimensions = list(\n list(range = c(2,4.5),\n label = 'Sepal Width', values = ~sepal_width),\n list(range = c(4,8),\n constraintrange = c(5,6),\n label = 'Sepal Length', values = ~sepal_length),\n list(range = c(0,2.5),\n label = 'Petal Width', values = ~petal_width),\n list(range = c(1,7),\n label = 'Petal Length', values = ~petal_length)\n )\n )\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eresults in this plot:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/DmwEU.jpg\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/DmwEU.jpg\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThis is the \u003cem\u003ewhole\u003c/em\u003e plot, I did not crop the image on the right. If I move the axes around, the data flickers on and off and usually, RStudio crashes. Here's my sessionInfo:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026gt; sessionInfo()\n\nR version 3.4.1 (2017-06-30)\nPlatform: x86_64-w64-mingw32/x64 (64-bit)\nRunning under: Windows \u0026gt;= 8 x64 (build 9200)\n\nMatrix products: default\n\nlocale:\n[1] LC_COLLATE=German_Switzerland.1252 LC_CTYPE=German_Switzerland.1252 LC_MONETARY=German_Switzerland.1252\n[4] LC_NUMERIC=C LC_TIME=German_Switzerland.1252 \n\nattached base packages:\n[1] stats graphics grDevices utils datasets methods base \n\nloaded via a namespace (and not attached):\n[1] compiler_3.4.1 tools_3.4.1 \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand my the Version of \u003ccode\u003eplotly\u003c/code\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026gt; packageVersion('plotly')\n[1] ‘4.7.1’\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eDoes anybody experience the same problem? Is there a solution to this? \u003c/p\u003e","accepted_answer_id":"46179061","answer_count":"1","comment_count":"0","creation_date":"2017-09-12 12:46:15.663 UTC","last_activity_date":"2017-09-12 14:38:43.903 UTC","last_edit_date":"2017-09-12 14:37:30.377 UTC","last_editor_display_name":"","last_editor_user_id":"1166684","owner_display_name":"","owner_user_id":"4139249","post_type_id":"1","score":"0","tags":"r|plot|rstudio|plotly|parallel-coordinates","view_count":"66"} +{"id":"37559822","title":"Mutually exclusive elements in XSD","body":"\u003cp\u003eI want to implement a relationship where \"Rate\" element should only exists when \"ComponentInstId and \"ComponentInstIdServ\" are not present and vice versa. How can I do that in below xsd code?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" encoding=\"UTF-8\"?\u0026gt;\n\u0026lt;xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" elementFormDefault=\"qualified\" attributeFormDefault=\"unqualified\"\u0026gt;\n\u0026lt;xs:element name=\"Request\"\u0026gt;\n \u0026lt;xs:complexType\u0026gt;\n \u0026lt;xs:sequence\u0026gt;\n \u0026lt;xs:element name=\"Component\"\u0026gt;\n \u0026lt;xs:complexType\u0026gt;\n \u0026lt;xs:all\u0026gt;\n \u0026lt;xs:element name=\"ComponentId\" nillable=\"false\"\u0026gt;\n \u0026lt;xs:simpleType\u0026gt;\n \u0026lt;xs:restriction base=\"xs:integer\"\u0026gt;\n \u0026lt;xs:whiteSpace value=\"collapse\"/\u0026gt;\n \u0026lt;/xs:restriction\u0026gt;\n \u0026lt;/xs:simpleType\u0026gt;\n \u0026lt;/xs:element\u0026gt;\n \u0026lt;xs:element name=\"ComponentInstId\" nillable=\"true\" minOccurs=\"0\"\u0026gt;\n \u0026lt;xs:simpleType\u0026gt;\n \u0026lt;xs:restriction base=\"xs:integer\"\u0026gt;\n \u0026lt;xs:whiteSpace value=\"collapse\"/\u0026gt;\n \u0026lt;/xs:restriction\u0026gt;\n \u0026lt;/xs:simpleType\u0026gt;\n \u0026lt;/xs:element\u0026gt;\n \u0026lt;xs:element name=\"ComponentInstIdServ\" nillable=\"true\" minOccurs=\"0\"\u0026gt;\n \u0026lt;xs:simpleType\u0026gt;\n \u0026lt;xs:restriction base=\"xs:int\"\u0026gt;\n \u0026lt;xs:whiteSpace value=\"collapse\"/\u0026gt;\n \u0026lt;/xs:restriction\u0026gt;\n \u0026lt;/xs:simpleType\u0026gt;\n \u0026lt;/xs:element\u0026gt;\n \u0026lt;xs:element name=\"Rate\" nillable=\"true\" minOccurs=\"0\"\u0026gt;\n \u0026lt;xs:simpleType\u0026gt;\n \u0026lt;xs:restriction base=\"xs:int\"\u0026gt;\n \u0026lt;xs:whiteSpace value=\"collapse\"/\u0026gt;\n \u0026lt;xs:minInclusive value=\"0\"/\u0026gt;\n \u0026lt;/xs:restriction\u0026gt;\n \u0026lt;/xs:simpleType\u0026gt;\n \u0026lt;/xs:element\u0026gt;\n \u0026lt;/xs:all\u0026gt;\n \u0026lt;/xs:complexType\u0026gt;\n \u0026lt;/xs:element\u0026gt;\n \u0026lt;/xs:sequence\u0026gt;\n \u0026lt;/xs:complexType\u0026gt;\n\u0026lt;/xs:element\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-06-01 05:03:19.19 UTC","last_activity_date":"2016-06-03 15:13:29.627 UTC","last_edit_date":"2016-06-02 23:18:56.227 UTC","last_editor_display_name":"","last_editor_user_id":"3366906","owner_display_name":"","owner_user_id":"3366906","post_type_id":"1","score":"-1","tags":"xsd|xsd-validation","view_count":"357"} +{"id":"5614196","title":"Group by 2 columns and count","body":"\u003cp\u003eI have the following MySql table - user_actions:\nid - int\nuser_id - int\ntimestamp - datetime\naction - int\u003c/p\u003e\n\n\u003cp\u003ea data example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e1|5|01.01.2011 21:00:00|1\n2|5|01.01.2011 21:00:00|3\n3|6|01.01.2011 21:00:00|5\n3|6|01.02.2011 21:00:00|5\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to count the number of users who made an action in each day (no matter how many actions), in the above example the output should be:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e01.01.2011|2 \n01.02.2011|1 \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cul\u003e\n\u003cli\u003emeaning 2 users made actions in 01.01.2011 and one user in 01.02.2011\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eany thoughts? \u003c/p\u003e","accepted_answer_id":"5614213","answer_count":"1","comment_count":"0","creation_date":"2011-04-10 19:36:42.137 UTC","last_activity_date":"2011-04-10 20:12:50.78 UTC","last_edit_date":"2011-04-10 19:44:35.087 UTC","last_editor_display_name":"","last_editor_user_id":"553823","owner_display_name":"","owner_user_id":"553823","post_type_id":"1","score":"2","tags":"mysql","view_count":"288"} +{"id":"38860936","title":"Tracking Conversions with Facebook Conversion Pixel","body":"\u003cp\u003eFacebook recommends including their tracking pixel in the head section:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;head\u0026gt;\n\u0026lt;!-- Facebook Pixel Code --\u0026gt;\n \u0026lt;script\u0026gt;\n ... code ...\n fbq('init', 'XXXXX');\n fbq('track', \"PageView\");\n ... more code\n \u0026lt;/script\u0026gt;\n \u0026lt;!-- End Facebook Pixel Code --\u0026gt;\n\u0026lt;/head\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut I also want to track conversions. Do I add \u003ccode\u003efbq('track', 'CompleteRegistration');\u003c/code\u003e in the original pixel code in the head? Or do I fire it only on the pages where the user is converted? (e.g. \"Thank You\" page)\u003c/p\u003e\n\n\u003cp\u003eIf I just include it in the head, how does FB know what a \"Complete Registration\" is?\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2016-08-09 21:44:20.467 UTC","last_activity_date":"2017-07-19 18:20:12.857 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4621100","post_type_id":"1","score":"0","tags":"facebook","view_count":"266"} +{"id":"30220199","title":"Calling instance method from another class ruby","body":"\u003cp\u003eI am having this runtime error: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e11843:E, [2015-05-13T11:00:00.467150 #9464] ERROR -- : 2015-05-13T11:00:00-0400: [Worker(delayed_job host:server pid:9464)] Job CronJob (id=5550d0f84d6f747bcb000000) FAILED with **NoMethodError: undefined method `loadData' for AdminController:Class**\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow I can call the method loadData() from the cronJob class? I test the code using the console and it is working fine if I call from console: \u003cstrong\u003eAdminController.new.loadData()\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e class AdminController \u0026lt; ApplicationController\n\n ...\n\n def setLoadSchedule\n logger.debug \"set hour #{params[:admin][:hour]}\"\n sethour = params[:admin][:hour]\n\n Delayed::Job.find(Perseus::Application.config.delayed_job_id).destroy if Perseus::Application.config.delayed_job_id != :nil\n Perseus::Application.config.delayed_job_id = Delayed::Job.enqueue(CronJob.new, cron: '0 ' \u0026lt;\u0026lt; sethour \u0026lt;\u0026lt; ' * * 1-5')\n\n hide_action :loadData\n\n def loadData()\n ...\n end \n\n private\n def isAdmin\n if !current_user.admin\n redirect_to root_path\n end\n end\n\n end\n\n class CronJob \u0026lt; Struct.new(\"CronJob\")\n\n def perform\n AdminController.new.loadData()\n end\n end \n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"30220403","answer_count":"1","comment_count":"0","creation_date":"2015-05-13 16:13:26.887 UTC","last_activity_date":"2015-05-13 16:24:42.04 UTC","last_edit_date":"2015-05-13 16:17:21.037 UTC","last_editor_display_name":"","last_editor_user_id":"1772830","owner_display_name":"","owner_user_id":"3159178","post_type_id":"1","score":"1","tags":"ruby|ruby-on-rails-4|delayed-job","view_count":"299"} +{"id":"24989923","title":"iOS Parallax Scrolling effect (like in Yahoo News Digest app)","body":"\u003cp\u003eI would like to know how to implement parallax scrolling similar to Yahoo News Digest app. In which when user scroll horizontally background image scrolls in a different speed with the paging is enabled.\u003c/p\u003e\n\n\u003cp\u003eMay be they do it with a ScrollView with a background view. Not exactly sure. Hint to implement such scrolling would be great. I have checked similar questions but couldn't find the answer I was looking for.\u003c/p\u003e","accepted_answer_id":"24990208","answer_count":"4","comment_count":"2","creation_date":"2014-07-28 06:57:10.473 UTC","favorite_count":"12","last_activity_date":"2017-07-27 14:24:07.13 UTC","last_edit_date":"2014-07-28 07:08:39.43 UTC","last_editor_display_name":"","last_editor_user_id":"152853","owner_display_name":"","owner_user_id":"152853","post_type_id":"1","score":"15","tags":"ios|yahoo|parallax","view_count":"14812"} +{"id":"25448953","title":"Weka LIbSVm \u0026 Time series forecasting","body":"\u003cp\u003eI'm tryng to use LIBSVM regression for a forecast of 6 months in following data: \nI would use LIBSVM with RBF kernel and SVMTType-SVR with default data (I'm not expert to modify that) \u003c/p\u003e\n\n\u003cp\u003eDue the few data I evaluate on training data, but I receive a forecast of 0.5804 for each 6 months so it seems that something is wrong? I tried to also use grid search in weka looking for optimize the paramenters but the result is a constant forecast.\u003c/p\u003e\n\n\u003cp\u003eDoes anyone have some suggestion to improve me? \u003c/p\u003e\n\n\u003cp\u003eThanks \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@relation Regression_test \n\n@attribute Period date yyyy-MM-dd \n@attribute Percentage numeric \n\n@data \n2011-08-01,0 \n2011-09-01,0 \n2011-10-01,0.259403 \n2011-11-01,0.308642 \n2011-12-01,0.613497 \n2012-01-01,2.037662 \n2012-02-01,1.134486 \n2012-03-01,0.898727 \n2012-04-01,0.465357 \n2012-05-01,0.241168 \n2012-06-01,0.354359 \n2012-07-01,0.468987 \n2012-08-01,0.320699 \n2012-09-01,0.584155 \n2012-10-01,0.786552 \n2012-11-01,0.385395 \n2012-12-01,0.302407 \n2013-01-01,0.490101 \n2013-02-01,0.446799 \n2013-03-01,0.328194 \n2013-04-01,0.431381 \n2013-05-01,0.445664 \n2013-06-01,0.557984 \n2013-07-01,0.735813 \n2013-08-01,0.82297 \n2013-09-01,0.838937 \n2013-10-01,1.06926 \n2013-11-01,0.773331 \n2013-12-01,0.408285 \n2014-01-01,0.271486 \n2014-02-01,0.394293 \n2014-03-01,0.394572 \n2014-04-01,0.563725 \n2014-05-01,0.878016 \n2014-06-01,0.766179\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"0","creation_date":"2014-08-22 14:07:38.647 UTC","favorite_count":"0","last_activity_date":"2014-08-22 14:18:14.78 UTC","last_edit_date":"2014-08-22 14:18:14.78 UTC","last_editor_display_name":"","last_editor_user_id":"2907532","owner_display_name":"","owner_user_id":"2794401","post_type_id":"1","score":"1","tags":"time-series|weka|regression|libsvm","view_count":"156"} +{"id":"23064990","title":"php - regex to match div tags","body":"\u003cp\u003eI'm using regex to match specific div's in a page and replace them with a custom formatted one. I can't use domdocument as often the pages we process are mal-formed and after running it through domdocument, the pages are reformatted and don't display the same.\u003c/p\u003e\n\n\u003cp\u003eI'm currently using the following which works perfectly:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epreg_match('#(\\\u0026lt;div id=[\\'|\"]'.$key.'[\\'|\"](.*?)\\\u0026gt;)(.*?)\\\u0026lt;\\/div\\\u0026gt;#s', $contents, $response);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eTo match div tags such as:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div id=\"test\"\u0026gt;\u0026lt;/div\u0026gt;\n\u0026lt;div id=\"test\" style=\"width: 300px; height: 200px;\"\u0026gt;\u0026lt;/div\u0026gt;\netc...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe problem I'm encountering is tags where the id is after the style or class, example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"test\" id=\"test\"\u0026gt;\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf I run the following, the regex seems to become greedy and matches a ton of html before the div tag, so I'm not sure how to fix this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epreg_match('#(\\\u0026lt;div(.*?)id=[\\'|\"]'.$key.'[\\'|\"](.*?)\\\u0026gt;)(.*?)\\\u0026lt;\\/div\\\u0026gt;#s', $contents, $response);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eDoes anyone have any ideas?\u003c/p\u003e","accepted_answer_id":"23065058","answer_count":"2","comment_count":"2","creation_date":"2014-04-14 16:12:14.567 UTC","last_activity_date":"2014-04-14 16:46:21.277 UTC","last_edit_date":"2014-04-14 16:46:21.277 UTC","last_editor_display_name":"","last_editor_user_id":"8454","owner_display_name":"","owner_user_id":"799575","post_type_id":"1","score":"0","tags":"php|regex|html-parsing","view_count":"1911"} +{"id":"24264483","title":"Span issue in CSS","body":"\u003cp\u003eI have two Spans I want span1 to be exactly below span2, even if span1 changes height dynamically.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;span id=\"Div3\" style=\"Z-INDEX: 126; LEFT: 8px; WIDTH: 99.06%; TOP: 5px; visibility: visible;\"\n runat=\"server\" \u0026gt;\u0026lt;asp:image id=\"Image1\" \n style=\"Z-INDEX: 127; LEFT: 16px; right: 709px;\" runat=\"server\"\ntabIndex=\"10\"\u0026gt;\u0026lt;/asp:image\u0026gt;\u0026lt;/span\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe above Span has an image, whose height can change dynamically.\u003c/p\u003e\n\n\u003cp\u003eI want this span\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;span\u0026gt;Exactly below the image\u0026lt;/span\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eto be exactly below the span in which image is placed.\u003c/p\u003e\n\n\u003cp\u003eCould anyone help ??\u003c/p\u003e","accepted_answer_id":"24264638","answer_count":"2","comment_count":"1","creation_date":"2014-06-17 12:58:14.333 UTC","last_activity_date":"2014-06-17 13:10:40.14 UTC","last_edit_date":"2014-06-17 13:04:49.207 UTC","last_editor_display_name":"","last_editor_user_id":"5184225","owner_display_name":"","owner_user_id":"1437112","post_type_id":"1","score":"0","tags":"css","view_count":"38"} +{"id":"28803263","title":"Move divs vertically within a larger div","body":"\u003cp\u003eI am making an animation that involves a set of four divs inside one larger div. The four divs are too large to all fit in the one div at once, so I want to be able to specify the position at which the larger div should start. For example, here I have four boxes inside the div. From top to bottom, the boxes are green, purple, pink, and blue (you can't see the blue in the current jsfiddle because it is cut off). I would like the BOTTOM of the larger fulldisplay div to align with the MIDDLE of the blue box, and everything else to fit above hat until it is cut off at the top of the div. Eventually I am going to be implementing a custom-made scroll button (as I don't want it to look like the overflow:scroll one) but for now I am just trying to get CSS to display the inner divs the way I want.\u003c/p\u003e\n\n\u003cp\u003eJS FIDDLE: \u003ca href=\"http://jsfiddle.net/o33gw35w/\" rel=\"nofollow\"\u003ehttp://jsfiddle.net/o33gw35w/\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eCSS:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ebody {padding: 0; margin: 0; height: 100%; overflow: hidden; font-family: Helvetica;}\n\n.nameblock {\nheight:10%;\nwidth: 30%;\nposition: absolute;\nbackground-color: yellow;\n}\n\n.fulldisplay {\nheight:90%;\nwidth: 30%;\nposition: absolute;\noverflow: hidden ;\n}\n\n\n.spacer1 {\nheight:40%;\nposition: relative;\nbackground-color: green;\n}\n\n\n.spacer2{\nheight:40%;\nposition: relative;\nbackground-color: purple;\n}\n\n\n.spacer3 {\nheight:40%;\nposition: relative;\nbackground-color: pink;\n}\n\n\n.spacer4{\nheight:40%;\nposition: relative;\nbackground-color: blue;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHTML:\n \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;div class=\"nameblock\"\u0026gt;\u0026lt;/div\u0026gt;\u0026lt;br/\u0026gt;\n\n\u0026lt;div class=\"fulldisplay\"\u0026gt;\n \u0026lt;div class=\"spacer1\"\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"spacer2\"\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"spacer3\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;div class=\"spacer4\"\u0026gt;\u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\n\u0026lt;/body\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-03-02 05:34:25.343 UTC","last_activity_date":"2015-03-03 05:09:32.123 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4130242","post_type_id":"1","score":"0","tags":"html|css|overflow","view_count":"61"} +{"id":"31345645","title":"NullPointerException when adding a new row to tableLayout","body":"\u003cp\u003eI have an activity with a \u003ccode\u003eLinearLayout\u003c/code\u003e and a \u003ccode\u003eTableLayout\u003c/code\u003e inside. I want to add data programmatically to this table but every time I get a null pointer exception. I tried to clean my project but I still have the same error null pointer exception in this instruction : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eiptable.addView(tr_head, new TableLayout.LayoutParams(\n TableLayout.LayoutParams.FILL_PARENT,\n TableLayout.LayoutParams.WRAP_CONTENT));\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn the \u003ccode\u003eOnCreate\u003c/code\u003e method I have:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@Override\npublic void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_iposition);\n session=new SessionManager(getApplicationContext());\n ActionBar actionbar=getSupportActionBar();\n actionbar.setDisplayHomeAsUpEnabled(true);\n\n TableLayout iptable = (TableLayout) findViewById(R.id.ip_table);\n\n TableRow tr_head = new TableRow(this);\n tr_head.setId(10);\n tr_head.setBackgroundColor(Color.GRAY);\n\n TextView label_Item = new TextView(this);\n label_Item.setId(20);\n label_Item.setText(\"Valeur\");\n label_Item.setTextColor(Color.WHITE);\n label_Item.setPadding(5, 5, 5, 5);\n tr_head.addView(label_Item);\n\n TextView label_Quantity = new TextView(this);\n label_Quantity.setId(21);\n label_Quantity.setText(\"Quantite\"); \n label_Quantity.setTextColor(Color.BLACK);\n label_Quantity.setPadding(5, 5, 5, 5); \n tr_head.addView(label_Quantity); \n\n tr_head.setLayoutParams(new TableRow.LayoutParams(\n TableRow.LayoutParams.FILL_PARENT,\n TableRow.LayoutParams.WRAP_CONTENT));\n iptable.addView(tr_head, new TableLayout.LayoutParams(\n TableLayout.LayoutParams.FILL_PARENT,\n TableLayout.LayoutParams.WRAP_CONTENT));\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn \u003ccode\u003eactivity_iposition\u003c/code\u003e, I have : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:tools=\"http://schemas.android.com/tools\"\n ...\n android:background=\"@drawable/itempositionlayout\"\u0026gt;\n\n \u0026lt;TableLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:stretchColumns=\"0,1\"\n android:id=\"@+id/ip_table\" android:layout_weight=\"1\" android:layout_height=\"wrap_content\" android:layout_width=\"match_parent\"\u0026gt;\n \u0026lt;/TableLayout\u0026gt;\n\u0026lt;/RelativeLayout\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"4","creation_date":"2015-07-10 16:17:09.097 UTC","last_activity_date":"2015-07-10 16:40:59.423 UTC","last_edit_date":"2015-07-10 16:34:25.813 UTC","last_editor_display_name":"","last_editor_user_id":"635549","owner_display_name":"","owner_user_id":"3337864","post_type_id":"1","score":"0","tags":"android|android-tablelayout","view_count":"65"} +{"id":"8321093","title":"How to put this element to first place using jquery","body":"\u003cp\u003eI want to make id=\"a\" element div to be the first div in the div.b element.\u003c/p\u003e\n\n\u003cp\u003eHere is the code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class='b'\u0026gt;\n \u0026lt;div\u0026gt;a\u0026lt;/div\u0026gt;\n \u0026lt;div\u0026gt;a\u0026lt;/div\u0026gt;\n \u0026lt;div id=\"a\"\u0026gt;I want to put this div to be the first div\u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"8321205","answer_count":"4","comment_count":"1","creation_date":"2011-11-30 04:20:17.1 UTC","last_activity_date":"2011-11-30 04:34:14.19 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1063434","post_type_id":"1","score":"3","tags":"jquery","view_count":"5289"} +{"id":"36324966","title":"User Location Retrieval Not Working","body":"\u003cp\u003eI am trying to get the user location in my app that I have built following a tutorial on iOS 9. I have done it exactly the same (as far as I know) as the instructor in the video and for the guy in the video it works but for me it doesn't. First I constructed a CLLocationManager like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar locationManager = CLLocationManager()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThen I made sure to add the following lines of code in viewDidLoad():\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elocationManager.delegate = self \nlocationManager.desiredAccuracy = kCLLocationAccuracyBest \nlocationManager.requestWhenInUseAuthorization() \nlocationManager.startUpdatingLocation()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFinally, I created a method to receive updated locations:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunc locationManager(manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {\n print(locations)\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo far the window pops up in my app that asks if the user wants to allow usage of the location, but when I press Allow, nothing starts printing out in the console window. I made sure to set NSLocationWhenInUseUsageDescription and NSLocationAlwaysUsageDescription in Info.plist, still not working though, and I also added the CoreLocation.framework thing. Since I am quite new to Swift, any help with this would be greatly appreciated!\u003c/p\u003e","answer_count":"2","comment_count":"2","creation_date":"2016-03-31 05:36:08.98 UTC","last_activity_date":"2016-03-31 09:15:44.267 UTC","last_edit_date":"2016-03-31 05:37:56.483 UTC","last_editor_display_name":"","last_editor_user_id":"5195227","owner_display_name":"","owner_user_id":"5262207","post_type_id":"1","score":"0","tags":"ios|swift|maps|cllocationmanager|info.plist","view_count":"57"} +{"id":"17019363","title":"Prawn table method won't work","body":"\u003cp\u003eI have been creating pdf documents fine with prawn. I am using prawn 0.8.4. I have created a class in pdf folder in the app directory like so.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass SchoolPdf \u0026lt; Prawn::Document\n def initialize(school)\n super(top_margin: 70)\n @school = school\n school_name\n line_items\n\n end\n\n def school_name\n text \"School: #{@school.school_name}\", size: 30, style: :bold\n end\n\n def line_items\n move_down 20\n table [[1,2],[3,4]]\n end\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is code from my show action in the controller\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef show\n @school = School.find(params[:id])\n respond_to do |format|\n format.html\n format.pdf do\n pdf = SchoolPdf.new(@school)\n\n send_data pdf.render,filename: \"#{@school.school_name}_report.pdf\",\n type: \"application/pdf\",\n disposition: \"inline\"\n end\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI get the error \u003ccode\u003eundefined method 'table'\u003c/code\u003e what could be wrong?\u003c/p\u003e","accepted_answer_id":"17021986","answer_count":"1","comment_count":"4","creation_date":"2013-06-10 08:03:22.097 UTC","last_activity_date":"2013-06-10 10:42:19.33 UTC","last_edit_date":"2013-06-10 08:26:24.523 UTC","last_editor_display_name":"","last_editor_user_id":"473736","owner_display_name":"","owner_user_id":"473736","post_type_id":"1","score":"2","tags":"ruby-on-rails-3|prawn","view_count":"249"} +{"id":"36490089","title":"How do I recompile an Elixir project and reload it from within iex?","body":"\u003cp\u003eI\"m currently learning Elixir by going through the OTP and mix tutorial on the elixir-lang website, and I'm having trouble finding out how to recompile and reload the project from within the shell.\u003c/p\u003e\n\n\u003cp\u003eIn Erlang I would do \u003ccode\u003emake:all([load])\u003c/code\u003e and it would compile an load any changes that occurred. However, in \u003ccode\u003eiex\u003c/code\u003e that always says \u003ccode\u003e:up_to_date\u003c/code\u003e, which does make sense, as Elixir uses mix for it's compiling needs.\u003c/p\u003e\n\n\u003cp\u003eI can't find any equivalent from within iex.\u003c/p\u003e","accepted_answer_id":"36494891","answer_count":"3","comment_count":"3","creation_date":"2016-04-08 01:40:41.347 UTC","favorite_count":"7","last_activity_date":"2017-02-26 17:51:57.187 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"231002","post_type_id":"1","score":"19","tags":"elixir|mix","view_count":"8879"} +{"id":"20532207","title":"Android Jackson Library parsing","body":"\u003cp\u003eI am getting a \"JSONObject can't be cast to ClassResponse\" error after getting a server response. Im guessing its because the response from server doesn't match the fields in ClassResponse? Is it because of the \"data\" struct in the JSON response? I have a setter for each of the fields but not sure what I am doing wrong. Is there a way to change the annotation for the Jackson library to parse other layers of the json object? for instance..\u003c/p\u003e\n\n\u003cp\u003e@JsonProperty(\"data:accessToken\") or something of that nature... or is that even necessary?\u003c/p\u003e\n\n\u003cp\u003eserver response:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n success: \"true\"\n message: \"Record Created\"\n data: {\n userToken : \"1\"\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eClassResponse:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@JsonIgnoreProperties(ignoreUnknown = true)\npublic class LoginResponse extends Response\u0026lt;LoginResponse.Result\u0026gt;\n{\n public static class Result\n {\n\n private String mUserToken;\n private String mAccessToken;\n private String mUserId;\n\n public String getUserToken(){\n return mUserToken;\n }\n\n @JsonProperty(\"userToken\")\n public void setUserToken(final String aUserToken){\n mUserToken = aUserToken;\n }\n\n public String getAccessToken(){\n return mAccessToken;\n }\n\n @JsonProperty(\"accessToken\")\n public void setAccessToken(final String aAccessToken){\n mAccessToken = aAccessToken;\n }\n\n public String getUserId(){\n return mUserId;\n }\n\n @JsonProperty(\"user_id\")\n public void setUserId(final String aUserId){\n mUserId = aUserId;\n }\n }\n}\n\n (edit)\n @JsonProperty(\"data\")\n public void accessDataLayer(final String data) throws JSONException {\n\n JSONObject jobj = new JSONObject(data);\n\n mUserToken = jobj.getString(\"userToken\");\n mAccessToken = jobj.getString(\"accessToken\");\n mUserId = jobj.getString(\"user_id\");\n\n }\n\n\n\n@Override\npublic RESULT loadDataFromNetwork() throws Exception{\n final String url = buildUrl();\n\n HttpURLConnection conn = (HttpURLConnection) new URL(url).openConnection();\n String response;\n\n try{\n conn.setDoInput(true);\n conn.setDoOutput(true);\n\n MultipartEntity entity = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE);\n\n JSONObject submitInfo = new JSONObject();\n submitInfo = buildParams(entity);\n\n OutputStreamWriter out = new OutputStreamWriter(conn.getOutputStream());\n out.write(submitInfo.toString());\n out.close();\n\n response = readStream(conn.getErrorStream());\n\n conn.disconnect();\n }\n return parse(response);\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"1","creation_date":"2013-12-11 23:37:18.73 UTC","last_activity_date":"2013-12-13 01:26:34.127 UTC","last_edit_date":"2013-12-13 01:26:34.127 UTC","last_editor_display_name":"","last_editor_user_id":"2480370","owner_display_name":"","owner_user_id":"2480370","post_type_id":"1","score":"0","tags":"java|android|json","view_count":"749"} +{"id":"14461620","title":"Connection from PowerDesigner to MS SQL Server 2008 R2","body":"\u003cp\u003eI'm trying to connect from Sybase PowerDesigner 15 to MS SQL SERVER 2008 R2. I basically entered the following into the \u003ccode\u003eConnection Profile Definition\u003c/code\u003e dialog:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eConnection Type: Native\u003c/li\u003e\n\u003cli\u003eDBMS Type: Microsoft SQL Server\u003c/li\u003e\n\u003cli\u003eServer Name: \u003ccode\u003eMSSQLSERVER\u003c/code\u003e (which is the instance name installed on my machine, I also tried \u003ccode\u003e192.168.1.44\\MSSQLSERVER\u003c/code\u003e which is my IP on the network and the instance name)\u003c/li\u003e\n\u003cli\u003eDatabase name: \u003ccode\u003ePrevent-01222013\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003eUse integrated login: checked\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eUnfortunately, it keeps telling me \"Connection Failed!\". Where did I go wrong?\u003c/p\u003e","accepted_answer_id":"14462802","answer_count":"1","comment_count":"1","creation_date":"2013-01-22 15:05:07.37 UTC","last_activity_date":"2013-01-22 16:03:54.05 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"565283","post_type_id":"1","score":"1","tags":"sql-server|sql-server-2008|connection-string|sybase|powerdesigner","view_count":"2966"} +{"id":"28457301","title":"Obtain 3-D matrix from multiplication of one 1-D matrix and one 2-D matrix","body":"\u003cp\u003eI want to something like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ea = [1,2,3]\nb = [1,2,3;4,5,6]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThen,\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ea *some operation* b = \n[1,2,3;4,5,6] \n[2,4,6;8,10,12]\n[3,6,9;12,15,18]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eEach element of matrix \u003cem\u003ea\u003c/em\u003e is multiplied with all the elements matrix \u003cem\u003eb\u003c/em\u003e and as many elements there are in \u003cem\u003ea\u003c/em\u003e those many matrices are obtained as results. I don't want to use loops.\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2015-02-11 14:52:07.957 UTC","last_activity_date":"2015-02-11 14:52:07.957 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2574723","post_type_id":"1","score":"0","tags":"matlab|matrix|octave","view_count":"31"} +{"id":"22258024","title":"Android - service running in the background","body":"\u003cp\u003eI want to call a method every time when the battery goes to 50%, even when the app is closed or the screen is turned off.\nI tried Service and BroadcastReceiver but when I remove the app from recent apps list the Service is stopped and I doe't get calls of this method anymore.\nHow can I save it in backgroud?\u003c/p\u003e","answer_count":"2","comment_count":"6","creation_date":"2014-03-07 18:35:15.813 UTC","last_activity_date":"2016-09-09 09:56:49.477 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3393814","post_type_id":"1","score":"-1","tags":"android|broadcastreceiver|android-service|android-broadcast|background-service","view_count":"714"} +{"id":"13335232","title":"sharing SQL database between two or more android clients","body":"\u003cp\u003eI have created a java servlet with which I have attached SQL database. Android client is sendig data to java servlet to save it in database which is working fine. I want to know if multiple android clients will share the same database connection or do i need to do some threading or something else? \u003c/p\u003e\n\n\u003cp\u003eRegards,\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2012-11-11 20:40:37.573 UTC","last_activity_date":"2013-01-16 08:53:45.983 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1763745","post_type_id":"1","score":"1","tags":"android|sql|servlets","view_count":"77"} +{"id":"35022028","title":"Plot negative of an array value in gnuplot","body":"\u003cp\u003eI have a file whose data looks as follows,\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eESCALE ; pCOHP file generated by LOBSTER. Energy is shifted such that the Fermi level lies at 0 eV.\n 3 1 301 -6.23689e+00 8.81327e+00 3.79655e+00\nAverage\nNo.1:O67-\u0026gt;Zr40(2.0986491691399038)\nNo.2:O67-\u0026gt;Zr49(2.0986491691399038)\n-10.03344 0.00000 -2.82630 0.00000 -2.82968 0.00000 -2.82292\n -9.98328 0.00000 -2.82630 0.00000 -2.82968 0.00000 -2.82292\n -9.93311 0.00000 -2.82630 0.00000 -2.82968 0.00000 -2.82292\n -9.88294 0.00000 -2.82630 0.00000 -2.82968 0.00000 -2.82292\n -9.83278 0.00000 -2.82630 0.00000 -2.82968 0.00000 -2.82292\n -9.78261 0.00000 -2.82630 0.00000 -2.82968 0.00000 -2.82292\n -9.73244 0.00000 -2.82630 0.00000 -2.82968 0.00000 -2.82292\n ...\n ...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow if I need to plot the second column against first column with gnuplot, I just use the command\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eplot \"\u0026lt;fileName\u0026gt;\" every ::\u0026lt;startLineNo\u0026gt;::\u0026lt;endLineNo\u0026gt; using 1:2 title '\u0026lt;TitleValue\u0026gt;' with lines\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhere would be 6 in this case. My question is\u003c/p\u003e\n\n\u003cp\u003e\u003cem\u003eHow to plot the negative of the second column values against the first column?\u003c/em\u003e\u003c/p\u003e\n\n\u003cp\u003eIf I try 1:-2 in the previous command, it throws me a warning that says\u003c/p\u003e\n\n\u003cblockquote\u003e\n\u003cpre\u003e\u003ccode\u003eWarning: empty y range [0:0], adjusting to [-1:1]\n\u003c/code\u003e\u003c/pre\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eIf its hard to plot it using gnuplot, I will appreciate answers using other freely available plotting tools \u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2016-01-26 19:17:52.723 UTC","last_activity_date":"2016-01-26 19:17:52.723 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1652217","post_type_id":"1","score":"0","tags":"plot|gnuplot","view_count":"11"} +{"id":"7643697","title":"Data provider is not running in Selenium Grid","body":"\u003cp\u003eCan anyone please tell me that why the below error occurs: it occurs for all data provider methods. I use a static class for entire data providers and am using @Test(dataProvider = \"Search\", dataProviderClass= StaticProvider.class). it was running when i run normally with a test but on running Selenium Grid with 2 test all my data providers are throwing the below exception. I am running in sequential mode as i could not succed in parallel run. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ejava.lang.RuntimeException: jxl.read.biff.BiffException: Compound file does not contain the specified stream\n\norg.testng.internal.MethodInvocationHelper.invokeDataProvider(MethodInvocationHelper.java:130)\norg.testng.internal.Parameters.handleParameters(Parameters.java:413)\norg.testng.internal.Invoker.handleParameters(Invoker.java:1319)\norg.testng.internal.Invoker.createParameters(Invoker.java:1021)\norg.testng.internal.Invoker.invokeTestMethods(Invoker.java:1121)\norg.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)\norg.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)\norg.testng.TestRunner.runWorkers(TestRunner.java:1182)\norg.testng.TestRunner.privateRun(TestRunner.java:761)\norg.testng.TestRunner.run(TestRunner.java:612)\norg.testng.SuiteRunner.runTest(SuiteRunner.java:335)\norg.testng.SuiteRunner.runSequentially(SuiteRunner.java:330)\norg.testng.SuiteRunner.privateRun(SuiteRunner.java:292)\norg.testng.SuiteRunner.run(SuiteRunner.java:241)\norg.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)\norg.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)\norg.testng.TestNG.runSuitesSequentially(TestNG.java:1169)\norg.testng.TestNG.runSuitesLocally(TestNG.java:1094)\norg.testng.TestNG.run(TestNG.java:1006)\norg.testng.remote.RemoteTestNG.run(RemoteTestNG.java:107)\norg.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:199)\norg.testng.remote.RemoteTestNG.main(RemoteTestNG.java:170)\nCaused by: jxl.read.biff.BiffException: Compound file does not contain the specified stream\n\njxl.read.biff.CompoundFile.getPropertyStorage(CompoundFile.java:451)\njxl.read.biff.CompoundFile.getStream(CompoundFile.java:326)\njxl.read.biff.File.\u0026lt;init\u0026gt;(File.java:135)\njxl.Workbook.getWorkbook(Workbook.java:221)\njxl.Workbook.getWorkbook(Workbook.java:198)\ncom.lm.sl.StaticProvider.getTableArray(StaticProvider.java:135)\ncom.lm.sl.StaticProvider.createSearch(StaticProvider.java:32)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)\njava.lang.reflect.Method.invoke(Unknown Source)\norg.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)\norg.testng.internal.MethodInvocationHelper.invokeDataProvider(MethodInvocationHelper.java:117)\norg.testng.internal.Parameters.handleParameters(Parameters.java:413)\norg.testng.internal.Invoker.handleParameters(Invoker.java:1319)\norg.testng.internal.Invoker.createParameters(Invoker.java:1021)\norg.testng.internal.Invoker.invokeTestMethods(Invoker.java:1121)\norg.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)\norg.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)\norg.testng.TestRunner.runWorkers(TestRunner.java:1182)\norg.testng.TestRunner.privateRun(TestRunner.java:761)\norg.testng.TestRunner.run(TestRunner.java:612)\norg.testng.SuiteRunner.runTest(SuiteRunner.java:335)\norg.testng.SuiteRunner.runSequentially(SuiteRunner.java:330)\norg.testng.SuiteRunner.privateRun(SuiteRunner.java:292)\norg.testng.SuiteRunner.run(SuiteRunner.java:241)\norg.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)\norg.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)\norg.testng.TestNG.runSuitesSequentially(TestNG.java:1169)\norg.testng.TestNG.runSuitesLocally(TestNG.java:1094)\norg.testng.TestNG.run(TestNG.java:1006)\norg.testng.remote.RemoteTestNG.run(RemoteTestNG.java:107)\norg.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:199)\norg.testng.remote.RemoteTestNG.main(RemoteTestNG.java:170)\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"2","creation_date":"2011-10-04 05:37:41.307 UTC","last_activity_date":"2011-10-11 07:20:45.773 UTC","last_edit_date":"2011-10-04 05:46:18.433 UTC","last_editor_display_name":"","last_editor_user_id":"701610","owner_display_name":"","owner_user_id":"701610","post_type_id":"1","score":"1","tags":"testng|selenium-grid|jxl","view_count":"709"} +{"id":"38200273","title":"SonarQube Integration with Jenkins and Jira","body":"\u003cp\u003eI am supposed to \u003cstrong\u003esetup SonarQube\u003c/strong\u003e and I have Jenkins and Jira already running in the server. I need to know whether \u003cstrong\u003eSonarQube has to be integrated with Jenkins alone or Jenkins and Jira both\u003c/strong\u003e. I did a google and searched forums and found that plugins are available for integrating with Jenkins. But could not find integrations for Sonarqube and Jira. I also have Github configured for Version control.\nHas anyone integrated Jenkins,SonarQube and Jira together. Anyone has idea on these integrations\u003c/p\u003e","accepted_answer_id":"38202754","answer_count":"1","comment_count":"0","creation_date":"2016-07-05 09:51:10.19 UTC","last_activity_date":"2016-07-05 11:51:23.377 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3437439","post_type_id":"1","score":"0","tags":"jenkins|sonarqube|jira|atlassian|sonar-runner","view_count":"1017"} +{"id":"36107412","title":"SlidingUpPanelLayout doesnot work Properly with CoordinatorLayout as first child of SlidingUpPanelLayout","body":"\u003cp\u003eSo when fitssystemwindow is true when it collopse it automatically increase its panel hight and when it is false it works fine . But in my project i need that true So please give me any Solution;\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" encoding=\"utf-8\"?\u0026gt;\n\u0026lt;RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\nxmlns:app=\"http://schemas.android.com/apk/res-auto\"\n\nandroid:layout_width=\"match_parent\"\nandroid:layout_height=\"match_parent\"\n \u0026gt;\n\u0026lt;com.sothree.slidinguppanel.SlidingUpPanelLayout\n xmlns:sothree=\"http://schemas.android.com/apk/res-auto\"\n android:id=\"@+id/slideUpLayout\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"match_parent\"\n android:gravity=\"bottom\"\n\n sothree:umanoDragView=\"@+id/dragView\"\n sothree:umanoOverlay=\"true\"\n sothree:umanoPanelHeight=\"68dp\"\n sothree:umanoParallaxOffset=\"100dp\"\n sothree:umanoShadowHeight=\"4dp\"\u0026gt;\n \u0026lt;!-- This is the first child and show main content--\u0026gt;\n \u0026lt;?xml version=\"1.0\" encoding=\"utf-8\"?\u0026gt;\n\u0026lt;android.support.design.widget.CoordinatorLayout \nandroid:id=\"@+id/main_content\"\nandroid:layout_width=\"match_parent\"\nandroid:layout_height=\"match_parent\"\nandroid:fitsSystemWindows=\"true\" // when this is false work fine otherwise not\n \u0026gt;\n\n\u0026lt;android.support.design.widget.AppBarLayout\n android:id=\"@+id/appbar\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\"\n android:paddingTop=\"@dimen/appbar_padding_top\"\n android:theme=\"@style/AppTheme.AppBarOverlay\"\u0026gt;\n\n \u0026lt;android.support.v7.widget.Toolbar\n android:id=\"@+id/toolbar\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"?attr/actionBarSize\"\n android:background=\"?attr/colorPrimary\"\n app:layout_scrollFlags=\"scroll|enterAlways\"\n app:popupTheme=\"@style/AppTheme.PopupOverlay\"\u0026gt;\n\n \u0026lt;/android.support.v7.widget.Toolbar\u0026gt;\n\n \u0026lt;android.support.design.widget.TabLayout\n android:id=\"@+id/tabs\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\" /\u0026gt;\n\n\u0026lt;/android.support.design.widget.AppBarLayout\u0026gt;\n\n\u0026lt;android.support.v4.view.ViewPager\n android:id=\"@+id/container\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"match_parent\"\n app:layout_behavior=\"@string/appbar_scrolling_view_behavior\" /\u0026gt;\n\n\u0026lt;android.support.design.widget.FloatingActionButton\n android:id=\"@+id/fab\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_gravity=\"end|bottom\"\n android:layout_margin=\"@dimen/fab_margin\"\n android:src=\"@android:drawable/ic_dialog_email\" /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;!-- this is second child and contain inside the slidingpanel --\u0026gt;\n \u0026lt;LinearLayout\n android:id=\"@+id/dragView\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"match_parent\"\n android:background=\"#ffffff\"\n android:clickable=\"true\"\n android:focusable=\"false\"\n android:orientation=\"vertical\"\u0026gt;\n\n\n \u0026lt;/LinearLayout\u0026gt;\n\n\n \u0026lt;/com.sothree.slidinguppanel.SlidingUpPanelLayout\u0026gt;\n\n\u0026lt;/RelativeLayout\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo please Give me solution for that or any other library which has SlideupPaneLayout from bottom to Top.\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2016-03-19 21:30:10.07 UTC","favorite_count":"2","last_activity_date":"2016-03-19 21:30:10.07 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3431783","post_type_id":"1","score":"6","tags":"android|android-coordinatorlayout|android-music-player","view_count":"244"} +{"id":"38330449","title":"Soundcloud API get reposts from specific user","body":"\u003cp\u003eIam building a simple Soundcloud API app for myself. I did some research for reposts with API and I figured out that I can only repost tracks with the API but not retrieve them. Is that correct?\u003c/p\u003e\n\n\u003cp\u003eWhat I want to achieve: \u003cstrong\u003eGet all Reposted Tracks from a specific username/user_id of soundcloud.\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eIs it possible to get this information?\nThe code to repost a track is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e $repost = json_decode($soundcloud-\u0026gt;put('e1/me/track_reposts/\u0026lt;track-id\u0026gt;'), true); // do repost // \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI hope someone can help me\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-07-12 13:34:48.027 UTC","last_activity_date":"2016-07-15 16:31:21.22 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4978388","post_type_id":"1","score":"0","tags":"api|soundcloud|repost","view_count":"117"} +{"id":"15631761","title":"iOS: How to get access to a variable used in the root view controller when I'm 2 levels down in the navigation stack?","body":"\u003cp\u003eI'm trying to build an app that sends and HTTP request and some part of this request is stored in an object in the root view controller. How can I get access to this object once I'm two levels down in the navigation stack? Global variables declared in the App Delegate? I'm trying to keep MVC rules in place.\u003c/p\u003e","accepted_answer_id":"15631907","answer_count":"1","comment_count":"1","creation_date":"2013-03-26 07:38:32.38 UTC","last_activity_date":"2013-03-26 07:49:55.653 UTC","last_edit_date":"2013-03-26 07:47:07.28 UTC","last_editor_display_name":"","last_editor_user_id":"1608894","owner_display_name":"","owner_user_id":"1608894","post_type_id":"1","score":"0","tags":"ios|oop|model-view-controller|uinavigationcontroller","view_count":"124"} +{"id":"24205232","title":"Nokogiri XPATH - get range of nodes based on a search key","body":"\u003cp\u003eI have an html file with some paragraphs as below:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;p\u0026gt; paragraph 1 \u0026lt;/p\u0026gt;\n\u0026lt;p\u0026gt; paragraph 2 \u0026lt;/p\u0026gt;\n\u0026lt;p\u0026gt; paragraph 3 \u0026lt;/p\u0026gt;\n\u0026lt;p\u0026gt; paragraph 4 \u0026lt;/p\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow I want to get the first two or three of the above paragraphs.\u003c/p\u003e\n\n\u003cp\u003eThe snippet below only returns one paragraph based on the index I define.. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edoc = Nokogiri::HTML(open('test.html'))\np doc.xpath('//p[1][contains(text(), \"paragraph\")]')\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut I want a range of paragraphs like \u003ccode\u003e1..2\u003c/code\u003e how can I achieve this? Thanks\u003c/p\u003e","accepted_answer_id":"24205302","answer_count":"1","comment_count":"0","creation_date":"2014-06-13 12:24:57.057 UTC","last_activity_date":"2014-06-13 12:43:11.557 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"277740","post_type_id":"1","score":"0","tags":"ruby-on-rails|ruby|xpath|nokogiri","view_count":"173"} +{"id":"29195237","title":"Qt Problems Adding Table Widget Items","body":"\u003cp\u003eI have an invoice form which i am using to both create invoices and display the results of a stored invoice. I when i am trying to read back data from the database and display it i am getting the error of \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eQTableWidget: cannot insert an item that is already owned by another QTableWidget\n QTableWidget: cannot insert an item that is already owned by another QTableWidget\n QTableWidget: cannot insert an item that is already owned by another QTableWidget\n QTableWidget: cannot insert an item that is already owned by another QTableWidget\n QTableWidget: cannot insert an item that is already owned by another QTableWidget\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI don't understand why this is being cause. The query that i am trying to run will return 4 rows. My code is below \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eQString CompanyID;\n int row = 0;\n ui-\u0026gt;comboBox_Invoice_Account_Search-\u0026gt;setCurrentIndex(1);\n QSqlQuery Account_Name_Query;\n QTableWidgetItem *Qty_Search = new QTableWidgetItem();\n QTableWidgetItem *Description_Search = new QTableWidgetItem();\n QTableWidgetItem *Product_Code_Search = new QTableWidgetItem();\n QTableWidgetItem *Unit_Price_Search = new QTableWidgetItem();\n QTableWidgetItem *Total_Price_Search = new QTableWidgetItem();\n while(Query.next())\n {\n CompanyID = Query.value(10).toString();\n //qDebug() \u0026lt;\u0026lt; \"CompanyID \" \u0026lt;\u0026lt; CompanyID;\n ui-\u0026gt;lineEdit_Invoice_VAT-\u0026gt;setText(Query.value(9).toString());\n ui-\u0026gt;lineEdit_Invoice_Total-\u0026gt;setText(Query.value(8).toString());\n ui-\u0026gt;lineEdit_Goods_Total-\u0026gt;setText(Query.value(7).toString());\n Qty_Search-\u0026gt;setText(Query.value(3).toString());\n Description_Search-\u0026gt;setText(Query.value(4).toString());\n Product_Code_Search-\u0026gt;setText(Query.value(5).toString());\n Unit_Price_Search-\u0026gt;setText(Query.value(6).toString());\n Total_Price_Search-\u0026gt;setText(Query.value(7).toString());\n ui-\u0026gt;tableWidget_Invoice-\u0026gt;setItem(row, 0, Qty_Search);\n ui-\u0026gt;tableWidget_Invoice-\u0026gt;setItem(row, 1, Description_Search);\n ui-\u0026gt;tableWidget_Invoice-\u0026gt;setItem(row, 2, Product_Code_Search);\n ui-\u0026gt;tableWidget_Invoice-\u0026gt;setItem(row, 3, Unit_Price_Search);\n ui-\u0026gt;tableWidget_Invoice-\u0026gt;setItem(row, 4, Total_Price_Search);\n row++;\n Account_Name_Query.prepare(\"SELECT Company_Name FROM Customer WHERE Company_ID = '\"+ CompanyID +\"'\");\n Account_Name_Query.exec();\n while(Account_Name_Query.next())\n {\n ui-\u0026gt;lineEdit_Invoice_Account-\u0026gt;setText(Account_Name_Query.value(0).toString());\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhat is causing this error?\u003c/p\u003e","accepted_answer_id":"29195429","answer_count":"1","comment_count":"0","creation_date":"2015-03-22 13:55:56.947 UTC","last_activity_date":"2015-03-22 14:13:44.79 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4628805","post_type_id":"1","score":"1","tags":"c++|qt|sqlite|qtablewidget|qtablewidgetitem","view_count":"987"} +{"id":"3335558","title":"COMException when creating COM object for Excel Automation in C#","body":"\u003cp\u003eI've got this error when I create a COM object in order to use Excel automation. Any one knows why I am getting this error?\u003c/p\u003e\n\n\u003cp\u003eSystem.Runtime.InteropServices.COMException(errorCode = -2146959355)\nMessage: Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80080005.\u003c/p\u003e\n\n\u003cp\u003eThe call stack is following:\u003c/p\u003e\n\n\u003cp\u003eSystem.Runtime.Remoting.RemotingServices.AllocateUninitializedObject(RuntimeType objectType)\n at System.Runtime.Remoting.RemotingServices.AllocateUninitializedObject(Type objectType)\n at System.Runtime.Remoting.Activation.ActivationServices.CreateInstance(Type serverType)\n at System.Runtime.Remoting.Activation.ActivationServices.IsCurrentContextOK(Type serverType, Object[] props, Boolean bNewObj)\n at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean\u0026amp; canBeCached, RuntimeMethodHandle\u0026amp; ctor, Boolean\u0026amp; bNeedSecurityCheck)\n at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)\n at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)\n at System.Activator.CreateInstance(Type type, Boolean nonPublic)\n at Geotab.ComObject..ctor(Type type)\u003c/p\u003e\n\n\u003cp\u003eThis is my code:\nType excelAppType = Type.GetTypeFromProgID(\"Excel.Application\");\ncomExcelObject = new ComObject(excelAppType);\u003c/p\u003e","accepted_answer_id":"3336419","answer_count":"2","comment_count":"0","creation_date":"2010-07-26 14:07:05.243 UTC","last_activity_date":"2010-07-26 15:38:49.323 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"366599","post_type_id":"1","score":"1","tags":"c#|excel|com|automation","view_count":"5721"} +{"id":"22143823","title":"Set padding for textview works only after setting background resource - Android","body":"\u003cp\u003eSetting the background resource to a drawable xml for a textview after setting its padding doesn't pad the textview, but vice versa works. How ?\u003c/p\u003e\n\n\u003cp\u003eExample\u003c/p\u003e\n\n\u003cp\u003eworks\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e textView.setBackgroundResource(borderColor);\n textView.setPadding(10, 0, 10, 0);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003edoesn't work\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e textView.setPadding(10, 0, 10, 0);\n textView.setBackgroundResource(borderColor);\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"29864974","answer_count":"1","comment_count":"2","creation_date":"2014-03-03 10:10:41.29 UTC","last_activity_date":"2015-04-25 12:10:27.45 UTC","last_edit_date":"2014-03-03 10:13:24.583 UTC","last_editor_display_name":"","last_editor_user_id":"2580975","owner_display_name":"","owner_user_id":"3007305","post_type_id":"1","score":"0","tags":"android|textview","view_count":"850"} +{"id":"14679252","title":"how to write custom linear collection in scala","body":"\u003cp\u003eI'd like to write custom linear collection. Something like extended List in some specific cases (not for all parameter types).\u003c/p\u003e\n\n\u003cp\u003eScala has complicated collection class hierarchy and I'm lost. What trait should I extend, what methods should I implement?\u003c/p\u003e\n\n\u003cp\u003eI've found comprehended tutorial for \u003cem\u003ecustom traversable\u003c/em\u003e implementation: \u003ca href=\"http://daily-scala.blogspot.ru/2010/04/creating-custom-traversable.html\" rel=\"nofollow\"\u003ehttp://daily-scala.blogspot.ru/2010/04/creating-custom-traversable.html\u003c/a\u003e.\u003c/p\u003e\n\n\u003cp\u003eAnd I'm searching for similar hints about implementing custom linear sequence.\u003c/p\u003e","accepted_answer_id":"14679446","answer_count":"1","comment_count":"1","creation_date":"2013-02-04 01:20:54.207 UTC","last_activity_date":"2013-02-04 01:52:09.413 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"837133","post_type_id":"1","score":"3","tags":"scala|collections","view_count":"755"} +{"id":"28127964","title":"How to check out a branch in Bitbucket","body":"\u003cp\u003eI have a Git repository at \u003ca href=\"https://user_name@bitbucket.org/path/git.git\" rel=\"nofollow\"\u003ehttps://user_name@bitbucket.org/path/git.git\u003c/a\u003e.\nThis repository has a branch called \u003ccode\u003efeature/myFeature\u003c/code\u003e, which I want to check out. I have run \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003egit init\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ein the desired folder, and then, according to Bitbucket, I need to run \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003egit fetch \u0026amp;\u0026amp; git checkout feature/myFeature\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, I get the following error,\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003efatal: No remote repository specified. Please,\n specify either a URL or a remote name from which new revisions should\n be fetched.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI guess I need to specify the repository, but I don't know how exactly to do this, and at the same time specify the branch.\u003c/p\u003e\n\n\u003cp\u003eWhat should I do?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-01-24 17:02:00.583 UTC","favorite_count":"1","last_activity_date":"2015-01-24 17:18:42.623 UTC","last_edit_date":"2015-01-24 17:18:42.623 UTC","last_editor_display_name":"","last_editor_user_id":"2541573","owner_display_name":"","owner_user_id":"2011985","post_type_id":"1","score":"3","tags":"git|bitbucket","view_count":"6907"} +{"id":"6361491","title":"Strictly server-side processing (no web browser interaction): is Java or PHP better for this scenario?","body":"\u003cp\u003eHere's the situation:\u003c/p\u003e\n\n\u003cp\u003eI currently have a web application that uses PHP to serve HTML/CSS/JS and that talks to a MySQL DB. Completely vanilla and common. The PHP is a mixture of presentation logic (HTML generation, etc) and business logic (the app uses Ajax extensively to make requests for data or to tell the server to make changes to something).\u003c/p\u003e\n\n\u003cp\u003eAs part of a redesign of this system I am removing all of the presentation logic from the PHP. Instead, I will be using \u003ca href=\"http://www.sencha.com/products/extjs/\" rel=\"nofollow\"\u003eExt JS 4\u003c/a\u003e (a javascript-based windowing toolkit / app) connected to a \u003ca href=\"http://kaazing.com\" rel=\"nofollow\"\u003eweb socket gateway\u003c/a\u003e (a COMET/AJAX replacement that allows bi-directional communication) on the server. Let's wave a magic wand for a minute and forget about how the Ext JS 4 gets delivered to the browser and how it talks to the web socket gateway.\u003c/p\u003e\n\n\u003cp\u003eWhat we are left with is a web socket gateway (written in Java and running persistently listening on a specific port for web socket connections) and some business logic / DB interaction currently written in PHP.\u003c/p\u003e\n\n\u003cp\u003eAt this point, I see one of two options:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003e\u003cp\u003eKeep the business logic / DB interaction in the PHP and execute it by calling either PHP from the command line or by having the PHP / Apache listen on a different port only for communications from the web socket gateway.\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eWrite a new Java or C++ application that will be persistent and listen on a specific port for communications from the web socket gateway. The business logic / DB integration is re-written in Java or C++ code and is part of this application.\u003c/p\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eWould re-writing in Java or C++ give better performance than calling PHP over and over? (The PHP code is pretty cleanly written: object-oriented using packages like CodeIgniter and Doctrine).\u003c/p\u003e\n\n\u003cp\u003eWould the performance benefits outweigh the hassle of re-writing all the business logic? Obviously dependent on many factors such as quantity of code but what is your gut feeling?\u003c/p\u003e\n\n\u003cp\u003eIn case it might influence your thinking / feedback, you should know that the web socket gateway (Kaazing) supports JMS, Stomp, AMQP, XMPP, or something custom you build yourself.\u003c/p\u003e\n\n\u003cp\u003eLet me know if there is any other info I can provide to help you with your answers.\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","accepted_answer_id":"6361700","answer_count":"3","comment_count":"1","creation_date":"2011-06-15 17:05:31.193 UTC","favorite_count":"1","last_activity_date":"2011-06-29 13:30:42.27 UTC","last_edit_date":"2011-06-15 17:20:49.91 UTC","last_editor_display_name":"user212218","owner_display_name":"","owner_user_id":"254303","post_type_id":"1","score":"4","tags":"java|php|server-side|websocket","view_count":"757"} +{"id":"36447455","title":"What is the impact of appName in DpapiDataProtectionProvider constructor","body":"\u003cp\u003eIn our \u003ccode\u003eIdentityManager\u003c/code\u003e class we have the follow line:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprotectionProvider = new DpapiDataProtectionProvider(\"OurProduct\");\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat is the implication of that last parameter, and does it have any correlation to how the site is set up on IIS?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eBackground:\u003c/strong\u003e\nWe've been deploying an MVC5 site with a custom \u003ccode\u003eIdentityManager\u003c/code\u003e class to a validation environment for a long time without hassles, and now we're getting the following issue when attempting to reset user passwords:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSystem.Security.Cryptography.CryptographicException: The data protection operation was unsuccessful. This may have been caused by not having the user profile loaded for the current thread's user context, which may be the case when the thread is impersonating.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSome solutions are described in the following thread:\n\u003ca href=\"https://stackoverflow.com/questions/23455579/generating-reset-password-token-does-not-work-in-azure-website\"\u003eGenerating reset password token does not work in Azure Website\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eEverything is located on the same machine: IIS, Sql Server, Firefox test browser.\u003c/p\u003e\n\n\u003cp\u003eUnfortunately I don't have a full grasp of the concepts and I'm trying to figure out how the test environment has changed in order to trigger this issue where it's never happened before?\u003c/p\u003e","accepted_answer_id":"43747711","answer_count":"1","comment_count":"1","creation_date":"2016-04-06 09:48:23.773 UTC","favorite_count":"1","last_activity_date":"2017-05-02 21:42:38.11 UTC","last_edit_date":"2017-05-23 12:02:42.293 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"746984","post_type_id":"1","score":"4","tags":"c#|asp.net-identity|owin","view_count":"345"} +{"id":"16858365","title":"High CPU usage using Lauterbach T32 with Linux/Qt","body":"\u003cp\u003eI'm experiencing a very high CPU usage (~100%) using the Qt version of T32 on Linux, even when the program is waiting user interaction. The executable is t32marm-qt. \u003c/p\u003e\n\n\u003cp\u003eThis does not happen when I use the standard Tcl-based t32marm executable.\u003c/p\u003e\n\n\u003cp\u003eA strace shows that the executable continuosly cycles on the \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e clock_gettime(CLOCK_REALTIME,...)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003esyscall.\u003c/p\u003e\n\n\u003cp\u003eThe Linux distribution is Mint 14 32-bit (derivation of Ubuntu 12.10).\u003c/p\u003e\n\n\u003cp\u003eHas anybody experienced this behavior ?\u003c/p\u003e\n\n\u003cp\u003eIf so, is it a bug or just a wrong configuration ?\u003c/p\u003e","accepted_answer_id":"16892577","answer_count":"1","comment_count":"1","creation_date":"2013-05-31 13:23:48.447 UTC","last_activity_date":"2013-06-03 08:21:24.027 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2214693","post_type_id":"1","score":"0","tags":"linux|qt|mint|lauterbach","view_count":"285"} +{"id":"23170650","title":"Do I need a Google Apps Account for GCE?","body":"\u003cp\u003eWe are working on testing email on-premise and may be considering moving away from Google Apps for Email. Our current projects within GCE are tied to our current Google Apps Email accounts. Do we have to use Google Apps Email in order to use GCE? If not, does anyone know how login to the GCE web console would work since it is currently tied to our Google Apps Email accounts?\u003c/p\u003e\n\n\u003cp\u003eI can't seem to find a proper way to shift the project to a non-google authentication method.\u003c/p\u003e","accepted_answer_id":"23177104","answer_count":"2","comment_count":"0","creation_date":"2014-04-19 13:28:07.8 UTC","last_activity_date":"2014-04-20 00:22:48.427 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3286599","post_type_id":"1","score":"-1","tags":"google-compute-engine|google-cloud-platform","view_count":"101"} +{"id":"8415622","title":"make a value selected in drop down when editing","body":"\u003cp\u003eI am adding a feature to edit the ads a user puts. For that I want to make the value selected which is selected by the user when he entered the values . How can I implement this?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"nm\"\u0026gt;\n Category\n\u0026lt;/div\u0026gt;\n\u0026lt;div class=\"fl\"\u0026gt;\n \u0026lt;select name=\"category\" id = \"ad_category\" onchange=\"cangeSubCat(this.value)\" \u0026gt;\n \u0026lt;option value=\"\"\u0026gt;---Select Category---\u0026lt;/option\u0026gt;\n \u0026lt;option value=\"real_estate\"\u0026gt;Real Estate\u0026lt;/option\u0026gt;\n \u0026lt;option value=\"hotels_resturants\"\u0026gt;Hotels and Resturants\u0026lt;/option\u0026gt;\n \u0026lt;option value=\"car\"\u0026gt;Car Rental\u0026lt;/option\u0026gt; \n \u0026lt;/select\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"8415674","answer_count":"3","comment_count":"0","creation_date":"2011-12-07 12:54:37.827 UTC","last_activity_date":"2013-02-21 09:10:58.083 UTC","last_edit_date":"2013-02-21 09:10:58.083 UTC","last_editor_display_name":"","last_editor_user_id":"367456","owner_display_name":"","owner_user_id":"878357","post_type_id":"1","score":"1","tags":"php|html|smarty","view_count":"2056"} +{"id":"42130260","title":"Mapview swift add multiple markers","body":"\u003cpre\u003e\u003ccode\u003efor result in swiftyData.arrayValue {\n let classId = result[0].stringValue\n let className = result[1].stringValue\n let longitude = result[2].doubleValue\n let latitude = result[3].doubleValue\n let newClass = NearestClasses()\n newClass.classId = classId\n newClass.className = className\n newClass.longitude = longitude\n newClass.latitude = latitude\n nearestClasses?.append(newClass)\n\n let locationSec = CLLocationCoordinate2DMake(CLLocationDegrees(latitude), CLLocationDegrees(longitude))\n dropPin.coordinate = newYorkLocation \n dropPin.title = className\n self.mapeView.addAnnotation(dropPin)*/ \n let dropPin = MKPointAnnotation()\n dropPin.coordinate = locationSec \n dropPin.title = className \n self.mapeView.addAnnotation(dropPin) \n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf its one loop, this function works perfectly in swift 3. But if its multiple loop, no markers are showing on the map. Thank you\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2017-02-09 07:03:15.64 UTC","last_activity_date":"2017-02-09 07:03:15.64 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6502271","post_type_id":"1","score":"0","tags":"ios|swift3","view_count":"137"} +{"id":"46591666","title":"Postgresql multiple joins in single query where foreign key of a join doesn't exist in all tables","body":"\u003cp\u003eIs it possible to have two joins in a single query, where the second join is a connection between table_2 and table_3 (no key references in table_1)?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etable_1\n\nid | column_a\n\n\n\ntable_2\n\nid | table_1_id | table_3_id | column_b\n\n\n\ntable_3\n\nid | column_c\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eExisting Query:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT * FROM table_1 RIGHT OUTER JOIN table_2 WHERE table_1.id id = ? and WHERE column_a = ?\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eGives me the info I want from table_1 and table_2, but table_2's info will have just the table_3_id column.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eIn the same query, I'd like to join table_3 to get its data based on table_2.table_3_id\u003c/strong\u003e\u003c/p\u003e","accepted_answer_id":"46591709","answer_count":"2","comment_count":"0","creation_date":"2017-10-05 17:35:01.77 UTC","last_activity_date":"2017-10-05 18:23:27.163 UTC","last_edit_date":"2017-10-05 17:46:01.79 UTC","last_editor_display_name":"","last_editor_user_id":"2422776","owner_display_name":"","owner_user_id":"4086590","post_type_id":"1","score":"1","tags":"sql|postgresql|select|join","view_count":"39"} +{"id":"9784073","title":"Need to retrieve data from cookie that holds the logged on client","body":"\u003cp\u003eI have two different pages in my WP7 Application, Page1 and Page2. On the first page the user is asked to log in using the .NET membership API through a WCF-service. When the user is logged in this client is saved in a cookie.\u003c/p\u003e\n\n\u003cp\u003eWhen the user fills in their username and password an clicks OK, the application redirects this person to the next page using the NavigationService. But after the person is redirected to Page2 I can not access the cookie of the current logged in user.\u003c/p\u003e\n\n\u003cp\u003eI can retrieve the logged in user on Page1 where the CookieContainer is created and the client is saved to this specific container. On Page2 I want to use the same cookie as in Page1, how do I do this?\u003c/p\u003e","accepted_answer_id":"9784220","answer_count":"1","comment_count":"0","creation_date":"2012-03-20 09:20:09.25 UTC","last_activity_date":"2012-05-01 14:21:37.057 UTC","last_edit_date":"2012-05-01 14:21:37.057 UTC","last_editor_display_name":"","last_editor_user_id":"366234","owner_display_name":"","owner_user_id":"606939","post_type_id":"1","score":"4","tags":"wcf|silverlight|windows-phone-7","view_count":"62"} +{"id":"32574511","title":"Blank google map when using it inside multiple fragments on a viewpager","body":"\u003cp\u003eI have a viewpager where each \"page\" is a fragment. Each of the \"page fragments\" have a map fragment (google maps sdk for android) inside, added programatically using \u003ccode\u003egetSupportFragmentManager\u003c/code\u003e (If I use \u003ccode\u003egetFragmentManager\u003c/code\u003e it doesn't work either). Each added map is a new instance of \u003ccode\u003eSupportMapFragment\u003c/code\u003e (\u003ccode\u003eMapFragment\u003c/code\u003e doesn't work either).\u003c/p\u003e\n\n\u003cp\u003eOn the first fragment, the one that is first added to the viewpager, the map works. At the other fragments, the non-interactive map just show itself as a grey square.\u003c/p\u003e\n\n\u003cp\u003eI'm using the 'com.google.android.gms:play-services-maps:7.5.0' dependency.\u003c/p\u003e\n\n\u003cp\u003eAll the added maps are using the \u003ccode\u003elite\u003c/code\u003e version. I'm doing this with: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eGoogleMapOptions options = new GoogleMapOptions();\noptions.liteMode(true);\noptions.mapToolbarEnabled(false);\nSupportMapFragment mapFragment = SupportMapFragment.newInstance(options);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI've read on some blogspots and here on Stackoverflow that \u003cstrong\u003emaybe\u003c/strong\u003e an app can only have one instance of google maps per process. Have anybody faced the same problem? Is my guess correct?\u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","accepted_answer_id":"32577953","answer_count":"1","comment_count":"0","creation_date":"2015-09-14 21:50:44.32 UTC","last_activity_date":"2015-09-15 15:20:25.077 UTC","last_edit_date":"2015-09-15 13:43:14.543 UTC","last_editor_display_name":"","last_editor_user_id":"1739502","owner_display_name":"","owner_user_id":"1739502","post_type_id":"1","score":"0","tags":"android|google-maps|android-viewpager","view_count":"205"} +{"id":"36051479","title":"All process suspended - SQL Server","body":"\u003cp\u003eI'm trying to figured it out why our reporting tools slow down.\u003c/p\u003e\n\n\u003cp\u003eI ran sp_who2 and I've noticed a few connections that have a status of SUSPENDED and high DiskIO. The interesting thing is there is just one process that runnable at that time which is my sp_who2 query.\u003c/p\u003e\n\n\u003cp\u003eWhat happened with this DB? why is all process is suspended?\u003c/p\u003e\n\n\u003cp\u003eThank you in advance for your time.\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2016-03-17 04:05:49.843 UTC","last_activity_date":"2016-03-17 04:05:49.843 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1511798","post_type_id":"1","score":"2","tags":"sql-server","view_count":"56"} +{"id":"22430103","title":"Would like some clarification on screen resolution and screen size","body":"\u003cp\u003eI use: \u003ca href=\"http://quirktools.com/screenfly/\" rel=\"nofollow\"\u003ehttp://quirktools.com/screenfly/\u003c/a\u003e when viewing my web pages at different resolutions. I noticed when selecting the display icon which is the very first icon top left hand corner (It looks like a computer monitor), I see a drop down menu with various resolution dimensions and next to those dimensions are inches. For example, on that list, 1920 X 2000 has \"24 inches next to it. Does this mean that a 24 inch monitor will typically by default have a resolution of 1920 X 2000? or is that just a demonstration of a monitor that is 24 inches and is displaying content with a resolution of 1920 X 2000? Or can you assume that most likely a 24 inch monitor will display content with a resolution f 1920 X 2000 by default?\u003c/p\u003e","accepted_answer_id":"22433755","answer_count":"1","comment_count":"5","creation_date":"2014-03-15 21:40:01.67 UTC","last_activity_date":"2014-03-16 06:34:53.07 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2603319","post_type_id":"1","score":"0","tags":"html|css","view_count":"90"} +{"id":"20070494","title":"com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column 'hourId' cannot be null","body":"\u003cp\u003eMy project is faculty allocation. when i try to insert data, it shows the following exception.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\"com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: \nColumn 'hourId' cannot be null\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCan anyone help me how to overcome this problem?\nPlease provide sample code to avoid this exception.\u003c/p\u003e\n\n\u003cp\u003eMy coding is \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;%\n Connection con = null;\n String StaffName = request.getParameter(\"StaffName\");\n // String subcode = request.getParameter(\"subcode\");\n String hourId = request.getParameter(\"hourId\");\n String daysId = request.getParameter(\"daysId\");\n String date = request.getParameter(\"date\");\n\n\n //String queryText = \"insert into tblstaffallocation (StaffName, subcode,hourId, daysId, date) values('\"+StaffName+\"','\"+subcode+\"','+hourId+','+daysId+','+date+')\";\n\n try {\n Class.forName(\"com.mysql.jdbc.Driver\");\n con = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/StaffAllocation\",\"root\",\"success\");\n\n // PreparedStatement stat = con.PrepareStatement();\n String updateString =\"INSERT INTO tblstaffallocation (StaffName,hourId,daysId,date) VALUES (?,?,?,?)\";\n\n PreparedStatement preparedStatement = con.prepareStatement(updateString);\n\n\n preparedStatement.setString(1, StaffName);\n preparedStatement.setString(2, hourId);\n preparedStatement.setString(3, daysId);\n preparedStatement.setString(4, date);\n preparedStatement.executeUpdate();\n //int rst = stat.executeUpdate(\"insert into tblstaffallocation ('StaffName','hourId', 'daysId', 'date') values('\"+StaffName+\"','\"+hourId+\"','\"+daysId+\"','\"+date+\"')\");\n\n %\u0026gt;\n \u0026lt;table cellpadding=\"4\" border=\"1\" cellspacing=\"4\" align=\"center\"\u0026gt;\n \u0026lt;th\u0026gt;StaffName\u0026lt;/th\u0026gt;\u0026lt;th\u0026gt;hourId\u0026lt;/th\u0026gt;\u0026lt;th\u0026gt;daysId\u0026lt;/th\u0026gt;\u0026lt;th\u0026gt;date\u0026lt;/th\u0026gt;\n \u0026lt;%\n Statement st=con.createStatement();\n ResultSet rs=st.executeQuery(\"select * from tblstaffallocation\");\n while(rs.next()){\n rs.getString(1);\n rs.getString(2);\n rs.getString(3);\n rs.getString(4);\n\n }\n } catch (Exception e) { \n out.print(e);\n\n }\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"3","comment_count":"11","creation_date":"2013-11-19 11:37:09.937 UTC","last_activity_date":"2017-11-03 23:24:46.293 UTC","last_edit_date":"2013-11-19 11:55:09.733 UTC","last_editor_display_name":"","last_editor_user_id":"1796088","owner_display_name":"","owner_user_id":"2951465","post_type_id":"1","score":"1","tags":"java|mysql|jdbc","view_count":"11960"} +{"id":"43299093","title":"IvoryGoogleMapBundle: How to access Google Map Object after rendering it","body":"\u003cp\u003eI'm using IvoryGoogleMapBundle in my Symfony3 project to render a map. After configuring \u003ccode\u003e$map\u003c/code\u003e object in the controller and using this sentences in my twig file ...\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{{ ivory_google_map(map) }}\n{{ ivory_google_api([map]) }}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt produces something like that ...\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div id=\"map_canvas\" style=\"width: 100%;height: 100vh;\"\u0026gt;\u0026lt;/div\u0026gt;\n\u0026lt;style type=\"test/css\"\u0026gt;\n #map_canvas {\n width: 100%;\n height: 100vh;\n }\n\u0026lt;/style\u0026gt;\n\u0026lt;script type=\"text/javascript\"\u0026gt;\n function ivory_google_map_map58e92cb0aa95e139417147 () {\n map58e92cb0aa95e139417147_container = {\n \"base\": {\n \"coordinates\": [],\n \"bounds\": [],\n \"points\": [],\n \"sizes\": []\n },\n \"map\": null,\n \"overlays\": {\n \"icons\": [],\n \"symbols\": [],\n \"icon_sequences\": [],\n \"circles\": [],\n \"encoded_polylines\": [],\n \"ground_overlays\": [],\n \"polygons\": [],\n \"polylines\": [],\n \"rectangles\": [],\n \"info_windows\": [],\n \"info_boxes\": [],\n \"marker_shapes\": [],\n \"markers\": [],\n \"marker_cluster\": null\n },\n \"layers\": {\n \"heatmap_layers\": [],\n \"kml_layers\": []\n },\n \"events\": {\n \"dom_events\": [],\n \"dom_events_once\": [],\n \"events\": [],\n \"events_once\": []\n },\n \"functions\": []\n };\n map58e92cb0aa95e139417147_container.functions.info_windows_close = function () {};\n map58e92cb0aa95e139417147_container.functions.to_array = function (o) {\n var a = [];\n for (var k in o) {\n a.push(o[k]);\n }\n return a;\n };\n map58e92cb0aa95e139417147_container.base.coordinates.coordinate58e92cb0aaca1311661317 = coordinate58e92cb0aaca1311661317 = new google.maps.LatLng(40.416862923413, -3.7034607678652, true);\n map58e92cb0aa95e139417147_container.map = map58e92cb0aa95e139417147 = new google.maps.Map(document.getElementById(\"map_canvas\"), {\n \"fullscreenControl\": true,\n \"fullscreenControlOptions\": {\n \"position\": google.maps.ControlPosition.RIGHT_TOP\n },\n \"mapTypeId\": google.maps.MapTypeId.HYBRID,\n \"zoom\": 5\n });\n map58e92cb0aa95e139417147.setCenter(coordinate58e92cb0aaca1311661317);\n\n }\n\u0026lt;/script\u0026gt;\n\n\u0026lt;script type=\"text/javascript\"\u0026gt;\n function ivory_google_map_load () {\n google.load(\"maps\", \"3\", {\n \"other_params\": \"language=en\u0026amp;key=__MY_API_KEY__,\n \"callback\": ivory_google_map_init\n })\n };\n function ivory_google_map_init_source (src) {\n var script = document.createElement(\"script\");\n script.type = \"text/javascript\";\n script.async = true;\n script.src = src;\n document.getElementsByTagName(\"head\")[0].appendChild(script);\n };\n function ivory_google_map_init_requirement (c, r) {\n if (r()) {\n c();\n } else {\n var i = setInterval(function () {\n if (r()) {\n clearInterval(i);\n c();\n }\n }, 100);\n }\n };\n function ivory_google_map_init () {\n ivory_google_map_init_requirement(ivory_google_map_map58e92cb0aa95e139417147, function () {\n return typeof google.maps !== typeof undefined;\n });\n };\n ivory_google_map_init_source(\"https://www.google.com/jsapi?callback=ivory_google_map_load\");\n\u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow, from javascript console I can reach some properties like bounds using ...\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emap58e92cb0aa95e139417147_container.map.getBounds().getNorthEast().lat();\n\u0026gt;\u0026gt; 48.2861355244946\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut map container object has a random name on each render, so ... how can I guess that name in order to write some javascript to play with the map?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-04-08 18:52:15.433 UTC","last_activity_date":"2017-04-08 19:36:44.253 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1170997","post_type_id":"1","score":"0","tags":"javascript|google-maps|symfony|twig","view_count":"43"} +{"id":"38171718","title":"Is -fsanitize=bounds-strict included in -fsanitize=undefined for GCC 6?","body":"\u003cp\u003eI'm working on a problem report for a C++ library compiled with GCC 6. I'm reading through the \u003ca href=\"http://gcc.gnu.org/gcc-6/changes.html\" rel=\"nofollow\"\u003eGCC 6 Changes, New Features, and Fixes\u003c/a\u003e, and one of the notes is:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eUndefinedBehaviorSanitizer gained a new sanitization option, -fsanitize=bounds-strict, which enables strict checking of array bounds. In particular, it enables -fsanitize=bounds as well as instrumentation of flexible array member-like arrays.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eIs strict bounds checking included in \u003ccode\u003e-fsanitize=undefined\u003c/code\u003e? Or do we need both \u003ccode\u003e-fsanitize=undefined\u003c/code\u003e and \u003ccode\u003e-fsanitize=bounds-strict\u003c/code\u003e?\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2016-07-03 16:00:05.427 UTC","last_activity_date":"2016-07-04 12:00:57.257 UTC","last_edit_date":"2016-07-04 12:00:57.257 UTC","last_editor_display_name":"","last_editor_user_id":"608639","owner_display_name":"","owner_user_id":"608639","post_type_id":"1","score":"2","tags":"c++|sanitizer|ubsan|gcc6","view_count":"282"} +{"id":"17915026","title":"Replacing href click behavior with jquery","body":"\u003cp\u003eAs an exercise, I'm trying to make my links in the navbar contract the content div, load the page in #content using ajaxpage() and then slide it back down. I'm using the following:\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT:\u003c/strong\u003e I realized that I probably needed everything in a callback function, so I fixed that. The call still isn't working, though.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(document).ready(function()\n {\n $(\"a.link\").click(function() { \n //...\n return false;\n});\n $(\"#navbar a\").click(function(){\n $(\"#content\").slideUp(500,function(){\n var a_href = $(this).attr('href');\n ajaxpage(a_href, 'content');\n $(\"#content\").slideDown(500);\n });\n });\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWith the link being:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;a class=\"link\" href=\"home.php\"\u0026gt;Home\u0026lt;/a\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I test it, the content div correctly slides up, but then it stays there and nothing else happens. What did I do wrong here?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT:\u003c/strong\u003e After some debugging, it seems like this is the culprit:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar a_href = $(this).attr('href');\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I declare that variable and send it through an alert(), it says \"undefined\". I'm guessing I'm not grabbing the attribute properly, so this is where it's hanging up! How would I properly go about grabbing the href attribute of the link that you click?\u003c/p\u003e","accepted_answer_id":"17915191","answer_count":"2","comment_count":"3","creation_date":"2013-07-29 02:03:24.823 UTC","last_activity_date":"2013-07-29 02:29:49.49 UTC","last_edit_date":"2013-07-29 02:22:09.683 UTC","last_editor_display_name":"","last_editor_user_id":"2577320","owner_display_name":"","owner_user_id":"2577320","post_type_id":"1","score":"0","tags":"javascript|jquery","view_count":"99"} +{"id":"44078642","title":"Scanning every file in a folder in c","body":"\u003cp\u003eI'm writing a program where I need to print all the files in a given folder and store the content of the files in order to compare it to another string. \nWhat I have now is: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ewhile ((ent = readdir(dir)) != NULL)\n {\n if (!strcmp(ent-\u0026gt;d_name, \".\") || !strcmp(ent-\u0026gt;d_name, \"..\"))\n {\n // do nothing (straight logic)\n }\n else {\n\n file_name = ent-\u0026gt;d_name;\n printf(\"%s\\n\", file_name);\n file_name = ent-\u0026gt;d_name;\n printf(\"%s\\n\", file_name);\n char *fd = file_name;\n struct stat *buf;\n buf = malloc(sizeof(struct stat));\n stat(fd, buf);\n int size = buf-\u0026gt;st_size;\n printf(\"%d\", size);\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eedit:\nmy problem now is that it prints the size as negative\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2017-05-19 20:37:41.843 UTC","last_activity_date":"2017-05-20 11:56:36.973 UTC","last_edit_date":"2017-05-20 11:56:36.973 UTC","last_editor_display_name":"","last_editor_user_id":"8032521","owner_display_name":"","owner_user_id":"8032521","post_type_id":"1","score":"2","tags":"c|file","view_count":"81"} +{"id":"20636879","title":"tinymce selector to div id only","body":"\u003cp\u003eWith current setup tinymce selector is set to all textarea fields on my page. How can I change this to only one field using css id property?\u003c/p\u003e\n\n\u003cp\u003eThis is my current setup\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;script\u0026gt;\n tinymce.init({ selector: 'textarea' });\n\u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"20636938","answer_count":"2","comment_count":"0","creation_date":"2013-12-17 14:34:02.58 UTC","last_activity_date":"2013-12-17 14:39:17.907 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1375068","post_type_id":"1","score":"2","tags":"javascript|jquery|tinymce","view_count":"10938"} +{"id":"19099527","title":"Not receiving WM_COMMAND in GetMessage loop","body":"\u003cp\u003eCould someone explain why I never receive a \u003ccode\u003eWM_COMMAND\u003c/code\u003e message in my GetMessage loop?\u003cbr\u003e\nI've checked and the WndProc is receiving the \u003ccode\u003eWM_COMMAND\u003c/code\u003e message, so i'm very confused why this doesn't work.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ewhile (GetMessage(\u0026amp;msg, NULL, 0, 0) != 0)\n{\n TranslateMessage(\u0026amp;msg);\n DispatchMessage(\u0026amp;msg);\n\n if (msg.message == WM_COMMAND)\n {\n // This never happens:\n MessageBox(NULL, \"WM_COMMAND\", \"WM_COMMAND\", MB_OK);\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOS: Windows 8\u003c/p\u003e","accepted_answer_id":"19099603","answer_count":"1","comment_count":"0","creation_date":"2013-09-30 16:48:07.527 UTC","last_activity_date":"2013-09-30 16:51:53.607 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"468130","post_type_id":"1","score":"0","tags":"c++|winapi","view_count":"321"} +{"id":"25996229","title":"Building a line chart using d3.js","body":"\u003cp\u003eI'm trying to follow \u003ca href=\"http://www.d3noob.org/2014/07/d3js-multi-line-graph-with-automatic.html\" rel=\"nofollow\"\u003ethis\u003c/a\u003e tutorial to produce a simple line chart for my data in JSON format:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[{\"Machine\":\"S2\",\"Data\":[{\"Percentage\":0,\"Week\":33,\"Year\":2014,\"Monday\":\"11/08/14\",\"Items\":0},{\"Percentage\":0,\"Week\":34,\"Year\":2014,\"Monday\":\"18/08/14\",\"Items\":0},{\"Percentage\":0,\"Week\":35,\"Year\":2014,\"Monday\":\"25/08/14\",\"Items\":0},{\"Percentage\":0,\"Week\":36,\"Year\":2014,\"Monday\":\"01/09/14\",\"Items\":0},{\"Percentage\":1.141848548192784,\"Week\":37,\"Year\":2014,\"Monday\":\"08/09/14\",\"Items\":2},{\"Percentage\":58.264732011508123,\"Week\":38,\"Year\":2014,\"Monday\":\"15/09/14\",\"Items\":4},{\"Percentage\":0,\"Week\":39,\"Year\":2014,\"Monday\":\"22/09/14\",\"Items\":0}]},{\"Machine\":\"S3\",\"Data\":[{\"Percentage\":0,\"Week\":33,\"Year\":2014,\"Monday\":\"11/08/14\",\"Items\":0},{\"Percentage\":0,\"Week\":34,\"Year\":2014,\"Monday\":\"18/08/14\",\"Items\":0},{\"Percentage\":0,\"Week\":35,\"Year\":2014,\"Monday\":\"25/08/14\",\"Items\":0},{\"Percentage\":0,\"Week\":36,\"Year\":2014,\"Monday\":\"01/09/14\",\"Items\":0},{\"Percentage\":7.7532100624144213,\"Week\":37,\"Year\":2014,\"Monday\":\"08/09/14\",\"Items\":15},{\"Percentage\":0,\"Week\":38,\"Year\":2014,\"Monday\":\"15/09/14\",\"Items\":0},{\"Percentage\":0,\"Week\":39,\"Year\":2014,\"Monday\":\"22/09/14\",\"Items\":0}]}]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is the code I have produced:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction CreateOeeChart(json)\n{\n// Set the dimensions of the canvas / graph\nvar margin = {top: 30, right: 20, bottom: 30, left: 50},\n width = 600 - margin.left - margin.right,\n height = 270 - margin.top - margin.bottom;\n\n// Parse the date / time - this is causing me problems\nvar parseDate = d3.time.format(\"%d/%m/%Y\").parse;\n\n// Set the ranges\nvar x = d3.time.scale().range([0, width]);\nvar y = d3.scale.linear().range([height, 0]);\n\n// Define the axes\nvar xAxis = d3.svg.axis().scale(x)\n .orient(\"bottom\").ticks(5);\n\nvar yAxis = d3.svg.axis().scale(y)\n .orient(\"left\").ticks(5);\n\n// Define the line\nvar line = d3.svg.line()\n .x( function(d) { return x(d.Monday); })\n .y( function(d) { return y(d.Percentage); });\n\n// Adds the svg canvas\nvar svg = d3.select(\"#oeeChart\")\n .append(\"svg\")\n .attr(\"width\", width + margin.left + margin.right)\n .attr(\"height\", height + margin.top + margin.bottom)\n .append(\"g\")\n .attr(\"transform\", \n \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\n// Modify date data\njsonString.forEach(function (d) {\n d.Data.forEach(function (v) {\n v.Monday = parseDate(v.Monday);\n });\n});\n\n// Scale the range of the data\nx.domain(d3.extent(jsonString, function (d) {\n d.Data.forEach(function (v) {\n return v.Monday;\n });\n}));\ny.domain([0, 100]); \n\n// Loop through the json object and use line function to draw the lines\njsonString.forEach( function (d) {\n svg.append(\"path\")\n .attr(\"class\", \"line\")\n .attr(\"d\", line(d.Data));\n});\n\n// Add the X Axis\nsvg.append(\"g\")\n .attr(\"class\", \"x axis\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(xAxis);\n\n// Add the Y Axis\nsvg.append(\"g\")\n .attr(\"class\", \"y axis\")\n .call(yAxis);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e}\u003c/p\u003e\n\n\u003cp\u003eWhen I try to append path \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e jsonString.forEach( function (d) {\n svg.append(\"path\")\n .attr(\"class\", \"line\")\n .attr(\"d\", line(d.Data));\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI get the \"Invalid value for path attribute...\" error. Why is that?\u003c/p\u003e","accepted_answer_id":"25996984","answer_count":"1","comment_count":"2","creation_date":"2014-09-23 13:21:21.467 UTC","favorite_count":"1","last_activity_date":"2014-09-23 13:55:04.133 UTC","last_edit_date":"2014-09-23 13:36:51.517 UTC","last_editor_display_name":"","last_editor_user_id":"935018","owner_display_name":"","owner_user_id":"935018","post_type_id":"1","score":"1","tags":"javascript|svg|d3.js|graph|line","view_count":"226"} +{"id":"46547755","title":"Audio streaming using bluetooth-A2dp profile to two speakers","body":"\u003cp\u003eI am new to bluetooth and have just started using \u003ccode\u003ebluez stack(5.37)\u003c/code\u003e. I would like to know the possibilities of streaming audio simultaneously to two bluetooth speakers/Headsets using \u003ccode\u003eA2dp\u003c/code\u003e profile. \u003c/p\u003e\n\n\u003cp\u003eAs per my study and experimentation \u003ccode\u003eA2dp\u003c/code\u003e profile is able to stream over only to one connected device although I successfully connected to 3 headsets.\u003c/p\u003e\n\n\u003cp\u003eI am using \u003cstrong\u003eImx6-Sabre board\u003c/strong\u003e running linux which is integrated with Bluez(5.37). Also my condition is I should be able to use \u003ccode\u003eA2dp\u003c/code\u003e so that interoperability remains with standard headsets/speakers.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003ePlease guide me in this\u003c/strong\u003e.\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-10-03 15:04:52.25 UTC","last_activity_date":"2017-10-03 15:20:31.31 UTC","last_edit_date":"2017-10-03 15:20:31.31 UTC","last_editor_display_name":"","last_editor_user_id":"537647","owner_display_name":"","owner_user_id":"8714722","post_type_id":"1","score":"0","tags":"bluetooth|core-bluetooth|a2dp","view_count":"24"} +{"id":"8615010","title":"app engine upload mechanisme for changed data, does it upload whole or delta?","body":"\u003cp\u003eI upload my_app to \u003ccode\u003eapp engine app\u003c/code\u003e by: \u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eappcfg.py update c:\\my_app ...\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eIf I already uploaded for my_app then done a minor changement in file, \u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eDoes it upload whole project to \u003ccode\u003eapp engine\u003c/code\u003e and overwrite whole previous project?\u003c/li\u003e\n\u003cli\u003eOr does it upload only relevent change and overwrite relevent part?\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eAnd what is the case for the issue for this command: \u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003ebulkloader.py --restore --filename=my_kind.dump ...\u003c/code\u003e \u003c/p\u003e","accepted_answer_id":"8615864","answer_count":"1","comment_count":"0","creation_date":"2011-12-23 10:36:16.547 UTC","last_activity_date":"2011-12-23 12:05:23.78 UTC","last_edit_date":"2011-12-23 11:58:02.5 UTC","last_editor_display_name":"","last_editor_user_id":"492258","owner_display_name":"","owner_user_id":"492258","post_type_id":"1","score":"0","tags":"google-app-engine|bulkloader","view_count":"82"} +{"id":"4493185","title":"Unique Key Constraint","body":"\u003cp\u003eWhat's the best practice in handling data insertion/update on a table with unique key constraints \u003cstrong\u003eat the application level\u003c/strong\u003e? These are what I came up with:\u003c/p\u003e\n\n\u003ch2\u003e1. Run a query on the table before inserting data to see if it will violate the constraint.\u003c/h2\u003e\n\n\u003cp\u003ePros\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eYou have full control so you don't have to deal with any DBMS specific error messages.\u003c/li\u003e\n\u003cli\u003eAddtional layer of data integrity check\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eCons\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eThere might be a performance hit since there will be no constraint violation most of the time.\u003c/li\u003e\n\u003cli\u003eYou will need to lock the table while you run the query for duplicate data.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003ch2\u003e2. Do nothing. Update the table and see what sticks.\u003c/h2\u003e\n\n\u003cp\u003ePros\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eSimple!\u003c/li\u003e\n\u003cli\u003eFaster overall since you don't have to run an additional query everytime you update a table.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eCons\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eYour validation routine depends on the database layer.\u003c/li\u003e\n\u003cli\u003eIf the data doesn't stick, you have to wade through the stack trace to find the cause.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eWhich one is the more widely accepted solution? Are there alternatives to these?\u003c/p\u003e\n\n\u003cp\u003eI'm using Java, JPA, Hibernate, and Spring BTW. Any suggestions, even framework specific, are welcome!\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","accepted_answer_id":"4493254","answer_count":"4","comment_count":"3","creation_date":"2010-12-20 19:37:07.217 UTC","last_activity_date":"2010-12-20 19:55:50.797 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"407236","post_type_id":"1","score":"2","tags":"java|design-patterns|database-design|application-design","view_count":"481"} +{"id":"40643911","title":"Drag and drop file and send with post request","body":"\u003cp\u003eI'm attempting to create a drag and drop file upload form. I got the drag and drop part working, but I can't figure out how to submit the file once I have it. I can't use ajax, the form needs to redirect just like an html upload form would.\u003c/p\u003e\n\n\u003cp\u003eHere's my drag and drop code.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(\"html\").on(\"dragover\", function(event) {\n event.preventDefault(); \n event.stopPropagation();\n $(this).addClass('dragging');\n});\n\n$(\"html\").on(\"dragleave\", function(event) {\n event.preventDefault(); \n event.stopPropagation();\n $(this).removeClass('dragging');\n});\n\n$(\"html\").on(\"drop\", function(event) {\n event.preventDefault();\n event.stopPropagation();\n console.log(event.originalEvent.dataTransfer.files)\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNormally when posting data generated through javscript I use the function below, but it doesn't work for files as you can't set file inputs.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction post(path, data) {\n let form = $('\u0026lt;form\u0026gt;')\n .attr({\n method: 'post',\n path: path\n })\n .appendTo('body')\n\n for(let key in data) {\n if(!data.hasOwnProperty(key)) continue;\n\n $('\u0026lt;input\u0026gt;')\n .attr({\n type: 'hidden',\n name: key,\n value: data[key]\n })\n .appendTo(form)\n }\n\n form.submit()\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"0","creation_date":"2016-11-16 23:04:17.007 UTC","last_activity_date":"2016-12-02 04:40:23.24 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2388661","post_type_id":"1","score":"3","tags":"javascript|jquery|file-upload|drag-and-drop","view_count":"248"} +{"id":"19641994","title":"A bit of an explanation on the array_diff_uassoc function in php","body":"\u003cp\u003eSorry for another noob question, but... Can someone please explain to me what the function myfunction is actually doing. I understand it's checking if the variables $a and $b are identical and than it's suppose to return 0 if they're identical but the next return is confusing. I see their using the ternary operators. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction myfunction($a,$b)\n{\nif ($a===$b)\n {\n return 0;\n }\n return ($a\u0026gt;$b)?1:-1;\n}\n\n$a1=array(\"a\"=\u0026gt;\"red\",\"b\"=\u0026gt;\"green\",\"c\"=\u0026gt;\"blue\");\n$a2=array(\"a\"=\u0026gt;\"red\",\"b\"=\u0026gt;\"green\",\"d\"=\u0026gt;\"blue\");\n$a3=array(\"e\"=\u0026gt;\"yellow\",\"a\"=\u0026gt;\"red\",\"d\"=\u0026gt;\"blue\");\n\n$result=array_diff_uassoc($a1,$a2,$a3,\"myfunction\");\nprint_r($result);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethe print_r returns \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eArray ( [c] =\u0026gt; blue )\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut how did we get here...\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2013-10-28 18:07:26.79 UTC","last_activity_date":"2013-10-28 18:21:46.73 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2908375","post_type_id":"1","score":"0","tags":"php","view_count":"153"} +{"id":"32970013","title":"Select ListViewItem when child element has focus UWP","body":"\u003cp\u003eI'm writing a Universal Windows App and I have a ListView where the ListViewItems contain a TextBox and a Button. When I click in the text box I would like that ListViewItem to become selected. I've found solutions for WPF but Style.Triggers isn't available in UWP. Can anyone point me to the correct way to do this?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;Page\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n xmlns:controls=\"using:CycleStreetsUniversal.Controls\"\n xmlns:common=\"using:CycleStreetsUniversal.Common\"\n xmlns:utils=\"using:CycleStreetsUniversal.Utils\"\n xmlns:interactivity=\"using:Microsoft.Xaml.Interactivity\" \n xmlns:core=\"using:Microsoft.Xaml.Interactions.Core\"\n xmlns:converters=\"using:CycleStreetsUniversal.Converters\"\n x:Class=\"CycleStreetsUniversal.Pages.HomePage\"\n mc:Ignorable=\"d\" FontWeight=\"Light\"\u0026gt;\n\n \u0026lt;Page.Resources\u0026gt;\n \u0026lt;DataTemplate x:Key=\"DirectionItem\"\u0026gt;\n \u0026lt;Grid Padding=\"8,6,0,6\"\u0026gt;\n \u0026lt;Grid.ColumnDefinitions\u0026gt;\n \u0026lt;ColumnDefinition/\u0026gt;\n \u0026lt;ColumnDefinition Width=\"50\"/\u0026gt;\n \u0026lt;ColumnDefinition Width=\"50\"/\u0026gt;\n \u0026lt;/Grid.ColumnDefinitions\u0026gt;\n \u0026lt;AutoSuggestBox x:Name=\"autoSuggestBox\" PlaceholderText=\"{Binding Watermark}\" QueryIcon=\"Find\" Text=\"{Binding LocationName}\" /\u0026gt; \n \u0026lt;Button Grid.Column=\"2\" Visibility=\"{Binding ShowAddButton, Converter={StaticResource BooleanToVisibilityConverter}}\" /\u0026gt;\n \u0026lt;Button Grid.Column=\"1\" Visibility=\"{Binding ShowMinusButton, Converter={StaticResource BooleanToVisibilityConverter}}\" /\u0026gt;\n \u0026lt;/Grid\u0026gt;\n \u0026lt;/DataTemplate\u0026gt;\n \u0026lt;/Page.Resources\u0026gt;\n\n \u0026lt;Grid Background=\"{ThemeResource ApplicationPageBackgroundThemeBrush}\"\u0026gt;\n \u0026lt;Grid x:Name=\"Directions\" HorizontalAlignment=\"Left\" Margin=\"0\" Width=\"346\" DataContext=\"{Binding DirectionPlanner, Mode=OneWay, Source={StaticResource Locator}}\"\u0026gt;\n \u0026lt;Grid.Background\u0026gt;\n \u0026lt;SolidColorBrush Color=\"{ThemeResource SystemAltHighColor}\"/\u0026gt;\n \u0026lt;/Grid.Background\u0026gt;\n \u0026lt;StackPanel VerticalAlignment=\"Top\"\u0026gt;\n \u0026lt;ListView x:Name=\"DirectionEntryList\" ItemTemplate=\"{StaticResource DirectionItem}\" ItemsSource=\"{Binding Entries}\"\u0026gt;\n \u0026lt;ListView.ItemContainerStyle\u0026gt;\n \u0026lt;Style TargetType=\"ListViewItem\"\u0026gt;\n \u0026lt;Setter Property=\"HorizontalContentAlignment\" Value=\"Stretch\"/\u0026gt;\n \u0026lt;/Style\u0026gt;\n \u0026lt;/ListView.ItemContainerStyle\u0026gt;\n \u0026lt;/ListView\u0026gt;\n \u0026lt;Button x:Name=\"crosshairButton\" VerticalAlignment=\"Top\" d:LayoutOverrides=\"LeftPosition, RightPosition\" Margin=\"20,0\" HorizontalAlignment=\"Stretch\" Padding=\"0\" Click=\"crosshairButton_Click\"\u0026gt;\n \u0026lt;Grid Height=\"50\"\u0026gt;\n \u0026lt;Grid.ColumnDefinitions\u0026gt;\n \u0026lt;ColumnDefinition/\u0026gt;\n \u0026lt;ColumnDefinition/\u0026gt;\n \u0026lt;/Grid.ColumnDefinitions\u0026gt;\n \u0026lt;Image x:Name=\"image\" Source=\"ms-appx:///Assets/crosshair.png\"/\u0026gt;\n \u0026lt;TextBlock Text=\"Set Location to Crosshair\" Grid.Column=\"1\" VerticalAlignment=\"Center\" MaxLines=\"2\" TextWrapping=\"Wrap\"/\u0026gt;\n \u0026lt;/Grid\u0026gt;\n \u0026lt;/Button\u0026gt;\n \u0026lt;/StackPanel\u0026gt;\n \u0026lt;/Grid\u0026gt;\n \u0026lt;/Grid\u0026gt;\n\u0026lt;/Page\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe AutoSuggestBox in the data template needs to set the selected item in DirectionEntryList to the List View item that the AutoSuggestBox is a child of.\u003c/p\u003e","accepted_answer_id":"33099118","answer_count":"2","comment_count":"3","creation_date":"2015-10-06 12:29:21.343 UTC","favorite_count":"1","last_activity_date":"2015-10-13 10:03:02.53 UTC","last_edit_date":"2015-10-07 10:08:06.01 UTC","last_editor_display_name":"","last_editor_user_id":"856009","owner_display_name":"","owner_user_id":"856009","post_type_id":"1","score":"2","tags":"c#|xaml|uwp","view_count":"3245"} +{"id":"7566301","title":"Regular expression for matching css string","body":"\u003cp\u003eI search for regular expression that will validate css code.\nI want to take css string(from text input) and match by this expression.\nIs anybody know useful regex for this staff\nthanks for advise\u003c/p\u003e","answer_count":"2","comment_count":"2","creation_date":"2011-09-27 08:37:51.583 UTC","last_activity_date":"2011-09-27 08:49:55.073 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"750487","post_type_id":"1","score":"-3","tags":"javascript|regex","view_count":"344"} +{"id":"38649715","title":"How to check the boolean of checkbox?","body":"\u003cp\u003eI know this might sounds duplicate questions but none of them work for me. So far that i have done is getting the value but i want to know how to get the on/off value from the checkbox. I tried hidden field but i can't get the 1/0 value from the checkbox itself. All i get is the value.\u003c/p\u003e\n\n\u003cp\u003eMy code is like this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(document).delegate('.sBorrow', 'change', function(){\n var sBorrowClass = $(this).attr('class');\n var sBorrowValue = $(this).attr('value');\n var sBorrowName = $(this).attr('name');\n\n if(sBorrowClass.checked = true){\n alert(sBorrowValue);\n alert(\"unchecked\");\n }\n else{\n alert(sBorrowValue);\n alert(sBorrowClass);\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFor the checkbox form is like this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eforeach($r as $row){\n $sBorrow = $_SESSION['sBorrow'];\n\n echo \"\u0026lt;tr align='center'\u0026gt;\u0026lt;td\u0026gt;\". ($startrow+1) .\"\u0026lt;/td\u0026gt;\u0026lt;td\u0026gt;\". $row['matricno'] .\"\u0026lt;/td\u0026gt;\u0026lt;td\u0026gt;\". $row['studentname'] .\"\u0026lt;/td\u0026gt;\u0026lt;td\u0026gt;\". $row['programme'] .\"\u0026lt;/td\u0026gt;\u0026lt;td\u0026gt;\". $row['title'] .\"\u0026lt;/td\u0026gt;\u0026lt;td\u0026gt;\". $row['thesis_level'] .\"\u0026lt;/td\u0026gt;\u0026lt;td\u0026gt;\". $row['serialno'] .\"\u0026lt;/td\u0026gt;\u0026lt;td\u0026gt;\". $row['bavailable'] .\"\u0026lt;/td\u0026gt;\u0026lt;td\u0026gt;\n \u0026lt;form method='post'\u0026gt;\n \u0026lt;input type='checkbox' name='sBorrow' id='sBorrow' class='sBorrow' value='\". $row['serialno'] .\"'\u0026gt;\n \u0026lt;input type='hidden' name='sBorrow' value=0 /\u0026gt;\n \u0026lt;/form\u0026gt;\u0026lt;/td\u0026gt;\u0026lt;/tr\u0026gt;\";\n $startrow++;\n //echo $row['education_level'];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand questions 2..\nAlso how to make my checkbox remains checked when the user searching for more data after check the checkbox (Livesearch Ajax). Should i use localStorage or SESSION to store the value up until the user refresh?\u003c/p\u003e","accepted_answer_id":"38649758","answer_count":"1","comment_count":"7","creation_date":"2016-07-29 02:38:51.757 UTC","last_activity_date":"2016-07-29 02:45:54.773 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6233513","post_type_id":"1","score":"0","tags":"javascript|php|jquery|ajax|checkbox","view_count":"43"} +{"id":"11190612","title":"simple attr_accesible in rails","body":"\u003cp\u003eI have a simple rails application were book belongs_to user and user has_many book. In the book model I have a filed for user which is the user_id field and I use devise for my current_user method. Now I want the current_user to add a new bood and I keep getting the error cannot mass-assign protected attributes : item, user. I have no idea were the item is coming from and do I have to include user into the list of attr_assible items. The problem is that I don't want the user attribute in the book to be massisined so people don't just try to hack and change the owner of the book. I am using rails 3.2.3\u003c/p\u003e","accepted_answer_id":"11190671","answer_count":"2","comment_count":"0","creation_date":"2012-06-25 13:53:23.533 UTC","favorite_count":"1","last_activity_date":"2012-06-25 13:56:54.117 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"655187","post_type_id":"1","score":"0","tags":"ruby-on-rails","view_count":"36"} +{"id":"46592138","title":"NoSuchMethodError using @Parcelize Annotation in Kotlin","body":"\u003cp\u003eI'm currently trying out the experimental (which might be why it's not working...) \u003ccode\u003e@Parcelize\u003c/code\u003e annotation to generate \u003ccode\u003eParcelable\u003c/code\u003e code. Most types seem to be working fine, but I'm having issues with \u003ccode\u003eSerializable\u003c/code\u003es throwing a \u003ccode\u003eNoSuchMethodError\u003c/code\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e 10-05 13:55:18.549 20808-20808/com.app E/AndroidRuntime: FATAL EXCEPTION: main\n Process: com.app, PID: 20808\n java.lang.NoSuchMethodError: No virtual method writeSerializable(Ljava/util/Date;)V in class Landroid/os/Parcel;\n or its super classes (declaration of 'android.os.Parcel' appears in /system/framework/framework.jar)\n at com.app.models.Job.writeToParcel(Job.kt)\n at android.os.Parcel.writeParcelable(Parcel.java:1496)\n at android.os.Parcel.writeValue(Parcel.java:1402)\n at android.os.Parcel.writeArrayMapInternal(Parcel.java:724)\n at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1408)\n at android.os.Bundle.writeToParcel(Bundle.java:1157)\n at android.os.Parcel.writeBundle(Parcel.java:764)\n at android.content.Intent.writeToParcel(Intent.java:8687)\n at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:3082)\n at android.app.Instrumentation.execStartActivity(Instrumentation.java:1518)\n at android.app.Activity.startActivityForResult(Activity.java:4225)\n at android.support.v4.app.BaseFragmentActivityApi16.startActivityForResult(BaseFragmentActivityApi16.java:54)\n at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:65)\n at android.app.Activity.startActivityForResult(Activity.java:4183)\n at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:711)\n at android.app.Activity.startActivity(Activity.java:4522)\n at android.app.Activity.startActivity(Activity.java:4490)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI know I could fix this by changing the Date objects to Strings, but would rather not. Has anyone else run into this issue that could provide a viable workaround other than using Strings?\u003c/p\u003e\n\n\u003cp\u003eIf needed, here's the implementation for reference:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@Parcelize\ndata class Job(val id: String,\n val description: String,\n val state: String,\n val job_type: String?,\n val close_on: Date?,\n val posted_on: Date?) : Parcelable\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"46592446","answer_count":"1","comment_count":"2","creation_date":"2017-10-05 18:05:41.307 UTC","last_activity_date":"2017-10-05 22:02:08.68 UTC","last_edit_date":"2017-10-05 22:02:08.68 UTC","last_editor_display_name":"","last_editor_user_id":"5108735","owner_display_name":"","owner_user_id":"1869968","post_type_id":"1","score":"5","tags":"android|kotlin|parcelable|nosuchmethoderror|kotlin-android-extensions","view_count":"166"} +{"id":"24031653","title":"how to stop user to download the current app","body":"\u003cp\u003eI have an app on the app store with version as 1.5\u003c/p\u003e\n\n\u003cp\u003eI update it to 1.6 and have some problems. The app with 1.6 is live.\u003c/p\u003e\n\n\u003cp\u003eWhat I want to do is revert app store to 1.5 and let users not to download 1.6\u003c/p\u003e\n\n\u003cp\u003eOR \u003c/p\u003e\n\n\u003cp\u003eDon't let user download 1.6 and I will fix those issue and update to 1.7 and I will allow user to download 1.7\u003c/p\u003e\n\n\u003cp\u003eIs there any way to get this done?\u003c/p\u003e","accepted_answer_id":"24031758","answer_count":"2","comment_count":"1","creation_date":"2014-06-04 07:38:39.65 UTC","last_activity_date":"2014-06-09 08:59:24.497 UTC","last_edit_date":"2014-06-09 08:59:24.497 UTC","last_editor_display_name":"","last_editor_user_id":"603977","owner_display_name":"","owner_user_id":"1066828","post_type_id":"1","score":"-2","tags":"ios|app-store","view_count":"103"} +{"id":"28689072","title":"RSelenium Open Method fails with error 10061","body":"\u003cp\u003eI'm trying to get RSelenium working for the first time. Here's my code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elibrary(RSelenium)\ncheckForServer()\nRSelenium::startServer()\nremDr \u0026lt;- remoteDriver()\nstartServer()\nremDr$open()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe return text (after the open method) is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[1] \"Connecting to remote server\"\n[[1]]\n[1] \"\u0026lt;!DOCTYPE html PUBLIC \\\"-//W3C//DTD XHTML 1.0 Strict//EN\\\" \\\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\\\"\u0026gt;\\r\\n\u0026lt;html xmlns=\\\"http://www.w3.org/1999/xhtml\\\" xml:lang=\\\"en\\\"\u0026gt;\\r\\n\u0026lt;head\u0026gt;\\r\\n \\r\\n\u0026lt;title\u0026gt;Error Message\u0026lt;/title\u0026gt;\\r\\n\u0026lt;meta http-equiv=\\\"content-type\\\" content=\\\"text/html; charset=utf-8\\\" /\u0026gt;\\r\\n\\r\\n\u0026lt;style\u0026gt;\\r\\nbody {\\r\\n\\t\\r\\n\\tbackground:#e5eaf5 url(/Wbo-FD9B7ED9-215B-4626-9B9E-D453142D7B18/bg.gif) top left repeat-x ;\\r\\n\\tmargin:0px 0px 0px 0px;\\r\\n\\tfont-family:Arial, Helvetica, sans-serif;\\r\\n\\tmin-width:1000px;\\r\\n\\tfont-size:12px;\\r\\n\\tcolor:#000000;\\r\\n\\tdirection:ltr;\\r\\n\\t}\\r\\nimg {border:none}\\r\\n\\r\\n\\r\\n\\t.main {\\r\\n\\t\\twidth:100%;\\r\\n\\t\\tbackground:url(/Wbo-FD9B7ED9-215B-4626-9B9E-D453142D7B18/topright.gif) top right no-repeat;\\r\\n\\t\\tmin-width:1000px;\\r\\n\\t\\tmin-height:400px;\\r\\n\\t\\tmargin-left:auto;\\r\\n\\t\\tmargin-right:auto;\\r\\n\\t\\ttext-align:left;\\r\\n\\t}\\r\\n\\t\\r\\n\\t.logo {float:left; height:103px; }\\r\\n\\t.sidetext {float:right; width:182px; height:52px; background:url(/Wbo-FD9B7ED9-215B-4626-9B9E-D453142D7B18/sidetext.png) top left; border:1px solid #2a2e31; margin-right:20px; margin-top:20px; padding:4px; }\\r\\n\\t.sidetextNone {visibility:hidden; }\\r\\n\\t\\r\\n\\t.whiteline {float:left; clear:both; font-size:20px; margin-left:47px; margin-top:17px; color:#ffffff; white-space:nowrap; }\\r\\n\\t.bold {font-weight:bold;}\\r\\n\\t\\r\\n\\t.maintext {float:left; margin-top:20px; clear:both; color:#000; margin-left:47px;}\\r\\n\\t\\r\\n\\t.color1 {color:#677183;}\\r\\n\\t\\r\\n\\tul {margin-top:0; padding-left:15px; padding-top:5px; padding-bottom:5px;}\\r\\n\\t\\r\\n\\tul li {list-style-image:url(/Wbo-FD9B7ED9-215B-4626-9B9E-D453142D7B18/bullet.gif)}\\r\\n\\tA {\\r\\n FONT-WEIGHT: bold; COLOR: #005a80;\\r\\n}\\r\\nA:hover {\\r\\n FONT-WEIGHT: bold;COLOR: #0d3372;\\r\\n}\\r\\n\u0026lt;/style\u0026gt;\\r\\n \\r\\n\u0026lt;/head\u0026gt;\\r\\n\u0026lt;body\u0026gt;\\r\\n\\t\u0026lt;div class=\\\"main\\\"\u0026gt;\\r\\n \u0026lt;div class=\\\"logo\\\"\u0026gt;\u0026lt;img src=\\\"/Wbo-FD9B7ED9-215B-4626-9B9E-D453142D7B18/logo.png\\\" alt=\\\"ForeFront\\\" /\u0026gt;\u0026lt;/div\u0026gt;\\r\\n \u0026lt;div class=\\\"whiteline\\\"\u0026gt;\u0026lt;td id=L_10061_2\u0026gt;\u0026lt;span class=\\\"bold\\\"\u0026gt;Network Access Message:\u0026lt;/span\u0026gt; The page cannot be displayed \u0026lt;/td\u0026gt;\u0026lt;/div\u0026gt;\\r\\n \u0026lt;div class=\\\"maintext\\\"\u0026gt;\\r\\n \u0026lt;td id=L_10061_3\u0026gt;\u0026lt;span class=\\\"bold color1\\\"\u0026gt;Explanation:\u0026lt;/span\u0026gt; The Web server refused the connection. \u0026lt;/td\u0026gt;\u0026lt;br /\u0026gt;\\r\\n\u0026lt;br /\u0026gt;\\r\\n\\r\\n\u0026lt;td id=L_10061_5\u0026gt;\u0026lt;span class=\\\"bold color1\\\"\u0026gt;Try the following:\u0026lt;/span\u0026gt;\u0026lt;/td\u0026gt;\u0026lt;br /\u0026gt;\\r\\n\\r\\n\u0026lt;ul\u0026gt;\\r\\n\u0026lt;li\u0026gt;\u0026lt;td id=L_10061_6\u0026gt;\u0026lt;span class=\\\"bold\\\"\u0026gt;Refresh page:\u0026lt;/span\u0026gt; Search for the page again by clicking the Refresh button. The timeout could have occurred due to Internet congestion. \u0026lt;/td\u0026gt;\u0026lt;/li\u0026gt;\\r\\n\u0026lt;li\u0026gt;\u0026lt;td id=L_10061_7\u0026gt;\u0026lt;span class=\\\"bold\\\"\u0026gt;Check spelling:\u0026lt;/span\u0026gt; Check that the Web page address is spelled correctly. The address may have been mistyped.\u0026lt;/td\u0026gt;\u0026lt;/li\u0026gt;\\r\\n\u0026lt;li\u0026gt;\u0026lt;td id=L_10061_8\u0026gt;\u0026lt;span class=\\\"bold\\\"\u0026gt;Access from a link:\u0026lt;/span\u0026gt; If there is a link to the page you are looking for, try accessing the page from that link. \u0026lt;/td\u0026gt;\u0026lt;/li\u0026gt;\\r\\n\u0026lt;li\u0026gt;\u0026lt;td id=L_10061_9\u0026gt;\u0026lt;span class=\\\"bold\\\"\u0026gt;Contact website:\u0026lt;/span\u0026gt;You may want to contact the website administrator to make sure the Web page still exists. You can do this by using the e-mail address or phone number listed on the website home page.\u0026lt;/td\u0026gt;\u0026lt;/li\u0026gt;\\r\\n\u0026lt;/ul\u0026gt;\\r\\n\u0026lt;br /\u0026gt;\\r\\n\\r\\n\u0026lt;td id=L_10061_10\u0026gt;\u0026lt;span\u0026gt;If you are still not able to view the requested page, try contacting your administrator or Helpdesk.\u0026lt;/span\u0026gt;\u0026lt;/td\u0026gt; \u0026lt;br /\u0026gt;\\r\\n\\r\\n\u0026lt;br /\u0026gt;\\r\\n\u0026lt;td id=L_10061_11\u0026gt;\u0026lt;span class=\\\"bold color1\\\"\u0026gt;Technical Information (for support personnel)\u0026lt;/span\u0026gt;\u0026lt;/td\u0026gt;\u0026lt;br /\u0026gt;\\r\\n\u0026lt;ul\u0026gt;\\r\\n\u0026lt;li\u0026gt;\u0026lt;td id=L_10061_12\u0026gt;\u0026lt;span class=\\\"bold\\\"\u0026gt;Error Code 10061:\u0026lt;/span\u0026gt; Connection refused\u0026lt;/td\u0026gt;\u0026lt;/li\u0026gt;\\r\\n\u0026lt;li\u0026gt;\u0026lt;td id=L_10061_13\u0026gt;\u0026lt;span class=\\\"bold\\\"\u0026gt;Background:\u0026lt;/span\u0026gt;The server you are attempting to access has refused the connection with the gateway. This usually results from trying to connect to a service that is inactive on the server.\u0026lt;/td\u0026gt;\u0026lt;/li\u0026gt;\\r\\n\u0026lt;li\u0026gt;\u0026lt;td id=L_10061_14\u0026gt;\u0026lt;span class=\\\"bold\\\"\u0026gt;Date:\u0026lt;/span\u0026gt;\u0026lt;/td\u0026gt; 24/02/2015 3:45:09 AM [GMT]\u0026lt;/li\u0026gt;\\r\\n\u0026lt;li\u0026gt;\u0026lt;td id=L_10061_15\u0026gt;\u0026lt;span class=\\\"bold\\\"\u0026gt;Server:\u0026lt;/span\u0026gt;\u0026lt;/td\u0026gt; MELDVTMG1.oceania.cshare.net \u0026lt;/li\u0026gt;\\r\\n\u0026lt;li\u0026gt;\u0026lt;td id=L_10061_16\u0026gt;\u0026lt;span class=\\\"bold\\\"\u0026gt;Source:\u0026lt;/span\u0026gt; Remote server \u0026lt;/td\u0026gt;\u0026lt;/li\u0026gt;\\r\\n\u0026lt;/ul\u0026gt;\\r\\n \u0026lt;/div\u0026gt;\\r\\n\u0026lt;/div\u0026gt;\\r\\n\u0026lt;/body\u0026gt;\\r\\n\u0026lt;/html\u0026gt;\\r\\n\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eExtracting some of the pertinent text I gather that\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eError number 10061 occurred, with associated text:\u003c/li\u003e\n\u003cli\u003eThe server you are attempting to access has refused the connection with the gateway. This usually results from trying to connect to a service that is inactive on the server\u003c/li\u003e\n\u003cli\u003eThe server in question is MELDVTMG1.oceania.cshare.net\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eThis is a server in my organisation. I'm running behind a firewall, using a proxy, but as I understand it Selenium doesn't need to go through the firewall, it's the browser that does that. I hope I'm right in saying this.\u003c/p\u003e\n\n\u003cp\u003eI've googled 'rselenium open method 10061' and various combinations with no luck.\u003c/p\u003e\n\n\u003cp\u003eI've also tried using phantomjs with the code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003erequire(RSelenium)\npJS \u0026lt;- phantom()\nSys.sleep(5) # give the binary a moment\nremDr \u0026lt;- remoteDriver(browserName = 'phantomjs')\nremDr$open()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI get the same error text returned. However if I run phantomjs directly form the command line with a command like \u003ccode\u003ephantomjs test.js\u003c/code\u003e where the \u003ccode\u003etest.js\u003c/code\u003e file is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar page = require('webpage').create();\npage.open('http://www.news.com.au/', function(status) {\n console.log(\"Status: \" + status);\n if(status === \"success\") {\n page.render('example.png');\n console.log('http://www.news.com.au/');\n }\n phantom.exit();\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e...then it return 'success', along with a snapshot of the site, which indicates to me that it can get through the firewall and that's not the problem.\u003c/p\u003e\n\n\u003cp\u003eAm I missing something obvious? Any pointers would be gratefully received.\u003c/p\u003e\n\n\u003cp\u003eI guess I should say why I'm trying to use RSelenium in case there are better approaches. Basically I want to go to a web page, fill in some drop downs and press a button which causes a file to be downloaded.\u003c/p\u003e\n\n\u003cp\u003eVersions installed are:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003ephantomjs v2.0\u003c/li\u003e\n\u003cli\u003eRSelenium v1.0\u003c/li\u003e\n\u003cli\u003eRStudio v0.98.1083\u003c/li\u003e\n\u003cli\u003eR v3.1.1 (64-bit)\u003c/li\u003e\n\u003cli\u003eWindows 7 (64-bit)\u003c/li\u003e\n\u003c/ul\u003e","answer_count":"0","comment_count":"10","creation_date":"2015-02-24 05:56:49.377 UTC","last_activity_date":"2015-02-24 05:56:49.377 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3137931","post_type_id":"1","score":"0","tags":"r","view_count":"202"} +{"id":"10778058","title":"Anti file deletion for multiplatform (Windows, Linux and OSX); is it possible?","body":"\u003cp\u003eI'm developing some software for data encryption in C. Here, I just want to ask whether there are any possibilities to make use of some techniques for anti data deletion \"without relying much on specific OS API\"? If your answer is that it \u003cem\u003eis\u003c/em\u003e possible, I would be happy if you can to tell how and give me a lot of explanation. Otherwise, if it is impossible, you can give me the answer \"It is impossible\" without much explanation.\u003c/p\u003e\n\n\u003cp\u003eThe reason why I do to ask is that, I anticipate if someday the attacker had already physical access to the machine, the anti-deletion by using dependent OS API will not work (for example, by using a very fast booting OS like Backtrack 5).\u003c/p\u003e","accepted_answer_id":"10778183","answer_count":"3","comment_count":"3","creation_date":"2012-05-27 23:48:21.833 UTC","last_activity_date":"2012-05-28 00:28:42.92 UTC","last_edit_date":"2012-05-28 00:14:59.447 UTC","last_editor_display_name":"","last_editor_user_id":"15168","owner_display_name":"","owner_user_id":"1309539","post_type_id":"1","score":"-3","tags":"c","view_count":"107"} +{"id":"34040964","title":"How to filter by id in a list with Sencha touch app","body":"\u003cp\u003eI have a list in Sencha Touch, and I need to get different records for each item list it is very important have in mind for each item list I have a button, showing in the inside of a modal window other list with the \"templates\" records.. (I will try to explain me with the code..)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e {\n \"id\" : \"0100144200\",\n \"address\" : \"hello street,Hamm\",\n \"openSurveys\" : 1,\n \"type\" : 0,\n \"withSurveys\" : true,\n \"templates\": {\n \"results\": [\n {\n \"id\": \"0000000772\",\n \"name\": \"TEST GENERAL AV 1\"\n },\n {\n \"id\": \"0000000799\",\n \"name\": \"TEST_TEMPLATE2\"\n }\n ]\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am receiving this object for each item list, and I need to include in a modal window data included in the templates object.. How to detect in the list id number and related templates?\u003c/p\u003e\n\n\u003cp\u003eThank you!!\u003c/p\u003e","accepted_answer_id":"34044714","answer_count":"1","comment_count":"0","creation_date":"2015-12-02 10:55:34.493 UTC","last_activity_date":"2015-12-02 15:39:39.287 UTC","last_edit_date":"2015-12-02 15:39:39.287 UTC","last_editor_display_name":"","last_editor_user_id":"2135255","owner_display_name":"","owner_user_id":"2135255","post_type_id":"1","score":"0","tags":"javascript|extjs|sencha-touch","view_count":"67"} +{"id":"28175875","title":"Is it possible to store a method in Android shared preference","body":"\u003cp\u003eHow to store a user defined method in shared preferences in android and how to load the data from that method in another activity\u003c/p\u003e","answer_count":"0","comment_count":"6","creation_date":"2015-01-27 16:59:55.19 UTC","last_activity_date":"2015-01-27 16:59:55.19 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4158813","post_type_id":"1","score":"0","tags":"android|android-activity|sharedpreferences","view_count":"33"} +{"id":"23645653","title":"statically linking c file with android bionic c library","body":"\u003cp\u003eI just wrote a small c file and its header file.\ndev_access.c and dev_access.h\u003c/p\u003e\n\n\u003cp\u003eI want to link it to the bionic library in android and create a statically/dynamically linked archive file.\u003c/p\u003e\n\n\u003cp\u003eMy files are in /home/preetam/mydev/\nThe android sources are in /home/preetam/android_source\u003c/p\u003e\n\n\u003cp\u003eThe following is my current makefile\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCROSS := /home/preetam/bin/CodeSourcery/arm2010/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi\nCC := $(CROSS)-gcc\nINC_DIR := /home/preetam/android_source/bionic/libc\nCFLAGS := -Wall -c -I$(INC_DIR)/include\n\nandroid_hal: dev_access.o\n ${CC} ${CFLAGS} dev_access.c -o dev_access.a\n\nclean:\n rm -f *.o dev_access.a\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am not sure whats going wrong but header files are not linking and some missing and redefinition errors are coming up.\nThe following is the Console output:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e/home/preetam/bin/CodeSourcery/arm2010/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi-gcc -c -Wall -I/home/preetam/android_source/bionic/libc/include -static -c -o dev_access.o dev_access.c\nIn file included from /home/preetam/android_source/bionic/libc/include/stdio.h:42,\n from dev_access.c:1:\n/home/preetam/android_source/bionic/libc/include/sys/_types.h:40: fatal error: machine/_types.h: No such file or directory\ncompilation terminated.\nmake: *** [dev_access.o] Error 1\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFirst of all, Is my Makefile correct?\nWhats the proper way to link your programs with bionic libc ?\nHow to make the final object an archive?\u003c/p\u003e","accepted_answer_id":"23648346","answer_count":"1","comment_count":"11","creation_date":"2014-05-14 04:29:44.59 UTC","last_activity_date":"2014-05-15 06:10:30.663 UTC","last_edit_date":"2014-05-14 05:11:13.293 UTC","last_editor_display_name":"","last_editor_user_id":"2079759","owner_display_name":"","owner_user_id":"2079759","post_type_id":"1","score":"3","tags":"android|c|makefile|bionic","view_count":"779"} +{"id":"47187306","title":"Upgrade from embedded jetty8 to embedded jetty9 without changing code?","body":"\u003cp\u003eI need to upgrade from embedded jetty8 to embedded jetty9 (9.4.7.v20170914 or even a little bit lower version 9.xx ) in maven project.\u003c/p\u003e\n\n\u003cp\u003eFirst I realized that there is no \u003ccode\u003eorg.eclipse.jetty.jetty-websocket\u003c/code\u003e in jetty9. \u003c/p\u003e\n\n\u003cp\u003eIn my current java code, there are some places to use \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport org.eclipse.jetty.websocket.WebSocket;\nimport org.eclipse.jetty.websocket.WebSocketHandler;\n\nimport org.eclipse.jetty.server.handler.GzipHandler;\nimport org.eclipse.jetty.server.nio.SelectChannelConnector;\nimport org.eclipse.jetty.server.ssl.SslSelectChannelConnector;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhich are not available in jetty9. \u003c/p\u003e\n\n\u003cp\u003eI googled it and it seems like I have to change my existing java code a lot to use jetty9. \u003c/p\u003e\n\n\u003cp\u003eIs there a way to upgrade jetty9 without much changing java code?\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-11-08 18:41:35.217 UTC","last_activity_date":"2017-11-08 18:41:35.217 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2761895","post_type_id":"1","score":"0","tags":"jetty-9","view_count":"14"} +{"id":"43586186","title":"implement ActionListener in the same class for three buttons","body":"\u003cp\u003eI have three buttons in a frame, two of which I want to edit a String with, which is a package public member in the main Class (Lab2TestDrive), something like\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public class Lab2TestDrive{\n...\nString cale;\n\npublic static main void(String[] args){\n JButton button1.. button2.. button3..\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCan I implement an ActionListener on Lab2TestDrive, and override the actionPerformed(...) method in there? But if I do that, I don't know how I would be able to know which button triggered the actionPerformed method.\u003c/p\u003e\n\n\u003cp\u003eI know I could make a separate class,\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class ButtonListener implements ActionListener {\n JButton button;\n ButtonListener(JButton button){\n this.button = button;\n }\n\n @Override\n public void actionPerformed(ActionEvent arg0) {\n if(button.getText().equals(\"Save\")){\n\n };\n\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut then I don't know how I could access the \"cale\" variable :(\u003c/p\u003e","accepted_answer_id":"43586296","answer_count":"1","comment_count":"1","creation_date":"2017-04-24 10:52:24.77 UTC","last_activity_date":"2017-04-24 10:58:45.46 UTC","last_edit_date":"2017-04-24 10:57:59.417 UTC","last_editor_display_name":"","last_editor_user_id":"3981920","owner_display_name":"","owner_user_id":"3981920","post_type_id":"1","score":"0","tags":"java|swing|jbutton|actionlistener","view_count":"45"} +{"id":"2062402","title":"Access Datagrid row on TemplateColumn button click","body":"\u003cp\u003eI am implementing a file upload tool using Silverlight. In this I can browse for files and when I select a file then it is bound to a datagrid. In the datagrid I have a template column with a button to delete the particular item from the datagrid and ItemSource of the datagrid which is a \u003ccode\u003eList\u0026lt;\u0026gt;\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eI have a class UploadedFiles as below.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class UploadedFiles\n{\n public FileInfo FileInf{get;set;}\n public int UniqueID{get;set;}\n public string FileName{get;set;}\n public string FileExtension{get;set;}\n public long FileSize{get;set;}\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am using a datagrid with a templatecolumn like below with ItemSource set as \u003ccode\u003eList\u0026lt;UploadedFiles\u0026gt;\u003c/code\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;data:DataGridTemplateColumn Width=\"100\"\u0026gt;\n \u0026lt;data:DataGridTemplateColumn.CellTemplate\u0026gt;\n \u0026lt;DataTemplate\u0026gt;\n \u0026lt;Button Click=\"btn_Click\" Content=\"Del\" Width=\"45\"/\u0026gt;\n \u0026lt;/DataTemplate\u0026gt;\n \u0026lt;/data:DataGridTemplateColumn.CellTemplate\u0026gt;\n \u0026lt;/data:DataGridTemplateColumn\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand the button click event handler is \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate void btn_Click(object sender, System.Windows.RoutedEventArgs e)\n{\n /* I need to access the particular list item based on the datagrid\n row in which the clicked button resides.*/\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI need to access the particular list item based on the datagrid row in which the clicked button resides and remove the item from the \u003ccode\u003eList\u0026lt;UploadedFiles\u0026gt;\u003c/code\u003e and rebind the datagrid.\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","accepted_answer_id":"2062552","answer_count":"1","comment_count":"0","creation_date":"2010-01-14 05:40:08.543 UTC","favorite_count":"1","last_activity_date":"2013-03-05 07:07:51.067 UTC","last_edit_date":"2010-01-14 05:45:28.8 UTC","last_editor_display_name":"","last_editor_user_id":"47738","owner_display_name":"","owner_user_id":"47738","post_type_id":"1","score":"2","tags":"silverlight|datagrid|datagridtemplatecolumn","view_count":"3094"} +{"id":"28584237","title":"Copy cell from on sheet to another, if other cell in row matches values","body":"\u003cp\u003eWhat I want, is to copy a cell(s) from one sheet to another, only if another cell in the same row (different column) have/has a particular value(s) in Google Sheets.\u003c/p\u003e\n\n\u003cp\u003eIdeally, I would like this to be live; if I add a row in the first sheet and the criterion matches, the second sheet will update too. Here's an example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSheet one\n\nColumn A | Column(s)… | Column D\n=================================\nHello | | Yes\nWorld! | | Yes\nFoo | | Maybe\nBar | |\n\nSheet two\n\nColumn A | Column(s)… | Column D\n=================================\nHello | |\nWorld! | |\nFoo | |\n | |\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo in this example, my criteria is that if the row's cell in \u003ccode\u003eColumn D\u003c/code\u003e equals either \u003ccode\u003eYes\u003c/code\u003e or \u003ccode\u003eMaybe\u003c/code\u003e, that row's cell in \u003ccode\u003eColumn A\u003c/code\u003e is copied into the second sheet.\u003c/p\u003e","accepted_answer_id":"28584620","answer_count":"2","comment_count":"1","creation_date":"2015-02-18 12:57:06.237 UTC","last_activity_date":"2015-10-10 07:03:02.013 UTC","last_edit_date":"2015-10-10 07:03:02.013 UTC","last_editor_display_name":"","last_editor_user_id":"1505120","owner_display_name":"","owner_user_id":"311403","post_type_id":"1","score":"1","tags":"copy|google-spreadsheet|spreadsheet","view_count":"3653"} +{"id":"15553449","title":"IIS 7.5 URL Rewrite 2.0 to HTML Page","body":"\u003cp\u003eI have the following rule:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;rewrite\u0026gt;\n \u0026lt;rules\u0026gt;\n \u0026lt;rule name=\"FlowURLs\"\u0026gt;\n \u0026lt;match url=\"^flows/[_0-9a-zA-Z-]+/[_0-9a-zA-Z-]+/([._0-9a-zA-Z-]+)\" /\u0026gt;\n \u0026lt;action type=\"Rewrite\" url=\"music.html?flow={R:1}\" /\u0026gt;\n \u0026lt;conditions logicalGrouping=\"MatchAny\"\u0026gt;\n \u0026lt;add input=\"{URL}\" pattern=\"^.*\\.(ashx|axd|css|gif|png|jpg|jpeg|js|flv|f4v|html)$\" negate=\"true\" /\u0026gt;\n \u0026lt;/conditions\u0026gt;\n \u0026lt;/rule\u0026gt;\n \u0026lt;/rules\u0026gt;\n \u0026lt;/rewrite\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat I am trying to do is if a url is incoming something like the following:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ehttp://localhost/flows/t/twit_nobone/twit_nobone1354334226132.mp3\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to rewrite it to: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ehttp://localhost/music.html?id=twit_nobone1354334226132.mp3\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe music.html resides in the root and it has a stylesheet, javascript and images. The problem I am seeing is that when it rewrites, no images, js or stylesheets are being displayed. When I inspect the resources, it looks like the links are now \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ehttp://localhost/flows/t/twit_nobone/twit_nobone1354334226132.mp3/demo.css\nhttp://localhost/flows/t/twit_nobone/twit_nobone1354334226132.mp3/images/screenshot.png\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003einstead of\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ehttp://localhost/demo.css\nhttp://localhost/images/screenshot.png\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat am I doing wrong? I also noticed that the url in the browser never changes to the rewritten one.\u003c/p\u003e","accepted_answer_id":"15553848","answer_count":"1","comment_count":"0","creation_date":"2013-03-21 16:50:58.743 UTC","favorite_count":"1","last_activity_date":"2013-03-21 17:17:07.29 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1177409","post_type_id":"1","score":"1","tags":"iis|url-rewriting|iis-7.5","view_count":"490"} +{"id":"33762354","title":"Auto/Manual Select Peers As Group Owner When Group Owner leaves the Group","body":"\u003cp\u003eHi i would like know if it is possible to automatically/manually select the other peers to become the Group Owner , once the Group owner decide to leave the group.\u003c/p\u003e\n\n\u003cp\u003eFor example:\u003c/p\u003e\n\n\u003cp\u003ePhone 1 , Phone 2 are both connected to Phone 3(Group Owner).\nPhone 3 leaves the Group.\u003c/p\u003e\n\n\u003cp\u003eEither Phone 1 or Phone 2 will now become the GO.\u003c/p\u003e\n\n\u003cp\u003eMy idea: Maybe when the Group owner leaves, we detect it by using OnDisconnect()? Then inside the function i do some code that will pass the value config.groupOwnerIntent =15; to the other peers? Hurmmm I really need help on this . Thank you very much.\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2015-11-17 16:38:52.103 UTC","last_activity_date":"2015-11-17 16:38:52.103 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4972250","post_type_id":"1","score":"1","tags":"android|wifi-direct","view_count":"53"} +{"id":"47050131","title":"AngularJS binding chokes on closing round bracket in JSON","body":"\u003cp\u003eI'm getting this error:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eError: [$parse:lexerr] Lexer Error: Unterminated quote ...\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003e.... when angular tries to bind some JSON to my view. This is because part of my json has a closing round bracket like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[{\"title\":\"(MyString)\"}]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is correctly formed in the JSON, however at some point when angular tries to bind the JSON, I get the error. It's like angular is interpreting the closing round bracket as JavaScript or something, so it fails to recognise any of the JSON after 'MyString', and sees the JSON as malformed. I've googled and looked at similar errors on StackOverflow, but can't see anything talking about issues with a round closing bracket in JSON causing problems with angular.\u003c/p\u003e\n\n\u003cp\u003eMy JSON defines geographic locations, and I suspect the issue may be occuring when angular tries to bind the locations in an ng-repeat directive like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div ng-repeat=\"loc in mapsCtrl.locations\"\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI tried using the ngSanitize module to sanitize the json within my controller javascript (I know that's for HTML sanitization, however I wondered if it might work - it didn't):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etitle: this.$sanitize(results.MapLocation[i].Title),\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI've also tried a Javascript replace:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etitle: results.MapLocation[i].Title.replace(\")\",\"\\)\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut for some reason (maybe because I'm using TypeScript which then gets transpiled?), the JSON looks exactly the same when I inspect in the Chrome debugger:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etitle: \"(MyString)\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo I then try a double escape:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etitle: results.MapLocation[i].Title.replace(\")\",\"\\\\)\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e... and my JSON in the debugger looks like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etitle : \"(MyString\\)\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e... but I get the same error. This looks like a bug in angular. I'm thinking maybe there's some specific Angular directive I need to use for the binding? Using 'ng-bind' instead of {{}} for the expression shouldn't make any difference, since ng-bind is just longhand for the curly brace syntax. I'd appreciate any advice or suggestions on any way to fix this issue.\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2017-11-01 07:30:50.957 UTC","last_activity_date":"2017-11-02 00:51:46.46 UTC","last_edit_date":"2017-11-01 23:00:24.3 UTC","last_editor_display_name":"","last_editor_user_id":"1549918","owner_display_name":"","owner_user_id":"1549918","post_type_id":"1","score":"3","tags":"javascript|angularjs|json|ng-map","view_count":"55"} +{"id":"42435472","title":"Iterate datastore in Sencha touch \u0026 edit record","body":"\u003cp\u003eI am using Sencha touch v 2.3.0 for my hybrid cordova app.\nHow can we loop through Sencha touch data store \u0026amp; update each record?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efor (var x = 0 ;x \u0026lt;listStore.data.length;x++){\n var record = listStore.getAt(x);\n console.log('iterate rec at index:'+x+ ' fav list name:'+record.get('favorite_name')+'orderInd:'+record.get('order_index'));\n record.set('order_index',x);\n record.dirty = true;\n listStore.sync();\n\n }); \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis will update 1st record only correct, after that when i update 2nd record, that still have reference to 1st record.Also i have applied sorting on data store with field order_index as ASC. This data store is used on list for which i have enabled drag \u0026amp; sort.I have to do this update ondragsort function\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eonDragSort:function(list, row, from, to) {\nvar listStore = Ext.getStore('FavoriteListStore');\n for (x = 0 ;x \u0026lt;listStore.data.length;x++){\n console.log('before drag fav list name:'+listStore.data.items[x].get('favorite_name')+'orderInd:'+listStore.data.items[x].get('order_index'));\n }\nfor (var x = 0 ;x \u0026lt;listStore.data.length;x++){\n var record = listStore.getAt(x);\n console.log('iterate rec at index:'+x+ ' fav list name:'+record.get('favorite_name')+'orderInd:'+record.get('order_index'));\n record.set('order_index',x);\n record.dirty = true;\n listStore.sync();\n\n });\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eInitial my favorite list store have following data\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ename:Steel order_index:0\nname:Sample Favorite List order_index:1\nname:Electrical Essentials order_index:2\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAbove data is shown on list,now when i drag third row on list to bring it to top.\nBelow is console when i try to set order_index by iteration\u003c/p\u003e\n\n\u003cp\u003ebefore drag fav list name:Electrical Essentials orderInd:2\nbefore drag fav list name:Steel orderInd:0\nbefore drag fav list name:Sample Favorite List orderInd:1\u003c/p\u003e\n\n\u003cp\u003eAfter setting order_index by iteration , below is data on data store while iteration\niterate rec at index:0 fav list name:Electrical EssentialsorderInd:2\niterate rec at index:1 fav list name:Electrical EssentialsorderInd:0\niterate rec at index:2 fav list name:Electrical EssentialsorderInd:1\u003c/p\u003e\n\n\u003cp\u003eI am confused on why record is not fetched correctly when i am doing iterate \u0026amp; updating orderInd.Intially before set , record where fetched correctly\u003c/p\u003e","answer_count":"0","comment_count":"4","creation_date":"2017-02-24 09:50:22.403 UTC","last_activity_date":"2017-02-26 14:57:36.097 UTC","last_edit_date":"2017-02-26 14:57:36.097 UTC","last_editor_display_name":"","last_editor_user_id":"442285","owner_display_name":"","owner_user_id":"442285","post_type_id":"1","score":"0","tags":"cordova|extjs|sencha-touch-2.3","view_count":"39"} +{"id":"35892999","title":"How to show bootstrap popover for invalid input?","body":"\u003cp\u003eI've some input boxes where if it's value is other than 1,I need to show a popover saying it is invalid for that particular input.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eMy code\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;br/\u0026gt;\n\u0026lt;br/\u0026gt;\n\u0026lt;br/\u0026gt;\n\u0026lt;input type=\"text\" class=\"check\" /\u0026gt;\n\u0026lt;input type=\"text\" class=\"check\" /\u0026gt;\n\u0026lt;input type=\"text\" class=\"check\" /\u0026gt;\n\u0026lt;input type=\"text\" class=\"check\" /\u0026gt;\n\u0026lt;input type=\"button\" id=\"Save\" value=\"Save\" /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eJavaScript\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(document).ready(function() {\n $(\"#Save\").click(function() {\n $(\".check\").each(function() {\n $val = $(this).val();\n if ($val != 1) { \n $(this).popover({\n content: \"Invalid\"\n });\n }\n })\n })\n})\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003ckbd\u003e\u003ca href=\"http://jsfiddle.net/iamraviteja/bqo5mdcz/2/\" rel=\"nofollow\"\u003e\u003cstrong\u003eLIVE DEMO\u003c/strong\u003e\u003c/a\u003e\u003c/kbd\u003e\u003c/p\u003e","accepted_answer_id":"35893084","answer_count":"2","comment_count":"0","creation_date":"2016-03-09 13:30:23.243 UTC","last_activity_date":"2016-03-09 13:36:25.103 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5416718","post_type_id":"1","score":"0","tags":"javascript|jquery|twitter-bootstrap|twitter-bootstrap-3|bootstrap-popover","view_count":"188"} +{"id":"35921957","title":"Calling activity method from FragmentPagerAdapter","body":"\u003cp\u003eMy \u003ccode\u003eMainActivity\u003c/code\u003e has a \u003ccode\u003edouble\u003c/code\u003e latitude value that I would like to pass to a fragment inside a \u003ccode\u003eFragmentPagerAdapter\u003c/code\u003e, so I created this getter method in \u003ccode\u003eMainActivity.java\u003c/code\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic double getLatitude() {\n return this.latitude;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow I am trying to pass this value to a fragment when I create it (the \u003ccode\u003egetItem()\u003c/code\u003e method is part of a \u003ccode\u003eFragmentPagerAdapter\u003c/code\u003e class):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public Fragment getItem(int position) {\n if (position == 0) {\n return new Fragment1();\n } else if (position == 1) {\n return new Fragment2();\n } else {\n Fragment3 fragment3 = new Fragment3();\n Bundle args = new Bundle();\n args.putDouble(fragment3.ARG_PARAM1, getActivity().getLatitude());\n fragment3.setArguments(args);\n return fragment3;\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, I get a compilation error that says \u003ccode\u003eError:(156, 68) error: cannot find symbol method getActivity()\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eHow can I get my main activity's \u003ccode\u003egetLatitude()\u003c/code\u003e when I create a new instance of a fragment?\u003c/p\u003e","accepted_answer_id":"35922151","answer_count":"3","comment_count":"0","creation_date":"2016-03-10 16:25:25.93 UTC","last_activity_date":"2016-03-11 04:42:33.787 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1301428","post_type_id":"1","score":"1","tags":"java|android|android-fragments","view_count":"553"} +{"id":"2724659","title":"Pass data between 2 dynamically loaded User control","body":"\u003cp\u003eI have a scenario where I dynamically load 2 user controls in a webform, and need them to interact together. Here's the code :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edefault.aspx.cs\nControlA cA = (ControlA)LoadControl(\"~/controlA.ascx\");\nControlB cB = (ControlB)LoadControl(\"~/controlB.ascx\");\nPage.Controls.Add(cA);\nPage.Controls.Add(cB);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow the thing is, controlB needs to pass a data to controlA. Data is not from an event (well part of). When user click on a link from controlB, we get data from a DB, and what I need to pass to controlA is the ID of the first data fetch from request. And of course, when user click on the link in controlB, page do a postback.\u003c/p\u003e\n\n\u003cp\u003eI looked at events \u0026amp; delegates, but I can't make it to work. Is it the right way to go ?\u003c/p\u003e\n\n\u003cp\u003eIf anyone could have a clue, it would be really appreciated !\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2010-04-27 20:06:31.26 UTC","last_activity_date":"2015-12-19 13:36:39.463 UTC","last_edit_date":"2015-12-19 13:36:39.463 UTC","last_editor_display_name":"","last_editor_user_id":"4370109","owner_display_name":"","owner_user_id":"170218","post_type_id":"1","score":"1","tags":"c#|user-controls|user","view_count":"865"} +{"id":"8335477","title":"removing autoreleased UIWebview results in crash","body":"\u003cp\u003eI have a view containing a subview which in turn contains a UIWebview.\u003c/p\u003e\n\n\u003cp\u003ethe subview is allocated and autoreleased\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etheController = [[[viewContainer alloc] initWithNibName:@\"viewContainer\" bundle:[NSBundle mainBundle]] autorelease];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe content for the webview is loaded onViewDidLoad in the subview.\u003c/p\u003e\n\n\u003cp\u003eI can remove this subview with no problem - as long as the app didn't go to the background before! The webview contains a link - when the user clicks on it, the app goes to the background and Safari opens the link. So far, so good. When I return to the app now and try to remove the subview containing the webview, I get this error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ebool _WebTryThreadLock(bool), 0x7f3e970: Tried to obtain the web lock from a thread other than the main thread or the web thread. This may be a result of calling to UIKit from a secondary thread. Crashing now...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e[Edit]\u003c/p\u003e\n\n\u003cp\u003eDidn't really find a solution, just a mere workaround (thanks to Jumhyn for the help!):\u003c/p\u003e\n\n\u003cp\u003eI added an NSNotification to the subview that holds the webview.\nWhen I get the applicationDidBecomeActive-Notification, I just use the same NSURLrequest again that I use in the viewDidLoadMethod and reload the content of the webview.\nNow I can safely remove the view without getting an error...\u003c/p\u003e\n\n\u003cp\u003eVery weird behaviour...\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2011-12-01 01:26:56.643 UTC","last_activity_date":"2011-12-01 02:45:56.547 UTC","last_edit_date":"2011-12-01 02:45:56.547 UTC","last_editor_display_name":"","last_editor_user_id":"424706","owner_display_name":"","owner_user_id":"424706","post_type_id":"1","score":"0","tags":"iphone|uiwebview","view_count":"218"} +{"id":"19787288","title":"Pointers: a query about pointers","body":"\u003cp\u003eI'm learning C and C#. I'm learning about pointers and don't know what it means to combine the indirection operator and the address operator. What does it mean to combine the two?\u003c/p\u003e\n\n\u003cp\u003eHere is an example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e int *p, *q;\n p = *\u0026amp;q;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"19787454","answer_count":"4","comment_count":"1","creation_date":"2013-11-05 10:53:59.207 UTC","last_activity_date":"2013-11-05 11:05:30.51 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1714241","post_type_id":"1","score":"0","tags":"c|pointers|expression|indirection|addressof","view_count":"60"} +{"id":"11164167","title":"PHPMailer attachment, doing it without a physical file","body":"\u003cp\u003eSo:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e// Setup mail class, recipients and body\n$mailer-\u0026gt;AddAttachment('/home/mywebsite/public_html/file.zip', 'file.zip');\nThe AddAttachment function has four arguments:\n\nAddAttachment(PATH_TO_FILE, FILENAME, ENCODING, HEADER_TYPE)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI used to use xmail() and when I added a attachment here, I passed the filename and the content, that should be in it.\u003c/p\u003e\n\n\u003cp\u003eLike this: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$xmail-\u0026gt;addAttachment('myamazingfile.pdf', $content);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow can I make it work the same way, so when i call \u003ccode\u003eAddAttachment()\u003c/code\u003e from the PHPmailer class, I can either pass the same or something like it, so I dont need to have a actual file on my server to send?\u003c/p\u003e","accepted_answer_id":"11164297","answer_count":"2","comment_count":"0","creation_date":"2012-06-22 21:09:48.563 UTC","favorite_count":"1","last_activity_date":"2015-09-26 01:37:17.513 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"267304","post_type_id":"1","score":"14","tags":"php|phpmailer","view_count":"13195"} +{"id":"33783694","title":"php in resultStr in callback jquery function, not working","body":"\u003cp\u003eI have a view, the controller renders the view sending some data, example $sizes.\nIn the view I have a jquery function that based on form post retrieves objects from database and returns a json response.\nin the callback function I append a resultStr so to update the view with the item I got from the database.\nthe problem was I am using laravel and blade and blade doesn't get parsed if the script is separated from the view.\nSo I thought, ok I will have the resultStr use plain php instead but it doesn't work either.\nFor example I put this code in the callback function:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eresultStr = resultStr +\n\n \"\u0026lt;?php \" +\n \"foreach ($possible_sizes as $size){\" +\n \"print(\\\" {$size[\\\"it\\\"]} \\\")}\" +\n \" ?\u0026gt;\";\n\n$(\"#results\").html(resultStr);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut then what I get in my div is not the data but this line:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div id=\"results\"\u0026gt;\n\n\u0026lt;!--?php foreach ($possible_sizes as $size){print(\" {$size[\"it\"]} \")} ?--\u0026gt;\n\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003equestion is: why?\u003c/p\u003e\n\n\u003cp\u003eexample of code in script.js\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e jQuery(function ($) {\n $(document).ready(function () {\n var form = $('form');\n form.submit(function (e) {\n e.preventDefault();\n $.ajax({\n url: form.prop('action'),\n type: 'post',\n dataType: 'json',\n data: form.serialize(),\n success: function (data) {\n\n var obj = (data);\n var resultStr = \"\";\n for (var i = 0; i \u0026lt; obj.length; i++) {\n\n resultStr = resultStr + \n \"string to be\" + \n \"inserted in the #results\" +\n \"div and containing php code\" +\n \"to be executed in the view\";\n\n\n }\n\n $(\"#results\").html(resultStr);\n\n }\n\n })\n });\n\n });\n });\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"17","creation_date":"2015-11-18 15:14:40.293 UTC","last_activity_date":"2015-11-18 16:29:44.067 UTC","last_edit_date":"2015-11-18 16:19:05.437 UTC","last_editor_display_name":"","last_editor_user_id":"4313232","owner_display_name":"","owner_user_id":"4313232","post_type_id":"1","score":"-1","tags":"php|jquery|laravel|view|callback","view_count":"40"} +{"id":"7559635","title":"Example of an elegant implementation of 'Defensive Copying' of a nullable java.util.Date in a JavaBean's getter/setter implementation?","body":"\u003cp\u003eIs there an elegant Java implementation of Joshua Bloch's \u003ca href=\"http://www.informit.com/articles/article.aspx?p=31551\u0026amp;seqNum=2\" rel=\"nofollow\"\u003edefensive copying\u003c/a\u003e techniques using the example below? The nullChecking is really the issue I think, but perhaps there is a much simpler way to achieve defensive copying.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public class Audit {\n private Date dateCompleted;\n ... \n public Audit() {\n super();\n }\n\n //defensive copy of dateCompleted\n public final Date getDateCompleted() {\n if (dateCompleted != null){\n return new Date(dateCompleted.getTime());\n }else{\n return null;\n }\n }\n\n public final void setDateCompleted(Date dateCompleted) {\n if (dateCompleted != null){\n this.dateCompleted = new Date(dateCompleted.getTime());\n }else{\n this.dateCompleted = null;\n }\n }\n ...\n } \n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"7559709","answer_count":"1","comment_count":"0","creation_date":"2011-09-26 18:36:15.807 UTC","last_activity_date":"2011-09-26 18:42:16.55 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"700","post_type_id":"1","score":"2","tags":"java|javabeans|effective-java","view_count":"522"} +{"id":"43373490","title":"How to deal with reversing an array when we do not want to change the position of special characters","body":"\u003cp\u003eI'm working on reversing a sentence. I'm able to do it. But I'm not sure, how to reverse the word without changing the special characters positions. I'm using regex but as soon as it finds the special characters it's stopping the reversal of the word. \u003c/p\u003e\n\n\u003cp\u003eFollowing is the code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eConsole.WriteLine(\"Enter:\");\nstring w = Console.ReadLine(); \nstring rw = String.Empty;\nString[] arr = w.Split(' ');\nvar regexItem = new Regex(\"^[a-zA-Z0-9]*$\");\nStringBuilder appendString = new StringBuilder();\nfor (int i = 0; i \u0026lt; arr.Length; i++)\n{\n char[] chararray = arr[i].ToCharArray();\n for (int j = chararray.Length - 1; j \u0026gt;= 0; j--)\n {\n\n if (regexItem.IsMatch(rw))\n{\n rw = appendString.Append(chararray[j]).ToString();\n}\n }\n sb.Append(' ');\n} \nConsole.WriteLine(rw);\nConsole.ReadLine();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eExample : Input\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eMarshall! Hello.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eExpected output\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003ellahsram! olleh.\u003c/p\u003e\n\u003c/blockquote\u003e","accepted_answer_id":"43373835","answer_count":"3","comment_count":"7","creation_date":"2017-04-12 15:14:28.6 UTC","last_activity_date":"2017-07-17 15:03:44.773 UTC","last_edit_date":"2017-07-17 15:03:44.773 UTC","last_editor_display_name":"","last_editor_user_id":"7158507","owner_display_name":"","owner_user_id":"7158507","post_type_id":"1","score":"0","tags":"c#","view_count":"339"} +{"id":"7538713","title":"UINavigationBar displays incorrectly when combine with UITabBarController","body":"\u003cp\u003eI'm trying to create Home Screen for UITabBarViewController with another UINavigationViewController and UIViewController Subclass.\u003c/p\u003e\n\n\u003cp\u003eIn application,There are:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003etwo Tab for loading NewsController and VideoController\u003c/li\u003e\n\u003cli\u003eHomeViewController that loads immediately when application finish launch.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eThis is my application shot screen. \u003c/p\u003e\n\n\u003cp\u003eHomeViewController\n\u003cimg src=\"https://i.stack.imgur.com/kqVLB.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eNavigationBar show a half \u003c/p\u003e\n\n\u003cp\u003eNewsViewController\n\u003cimg src=\"https://i.stack.imgur.com/nKDLn.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eThis is my code.\u003c/p\u003e\n\n\u003cp\u003e//In TabBarWithHomeDelegate.m\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e- (BOOL)application:(UIApplication *)application \ndidFinishLaunchingWithOptions:(NSDictionary *)launchOptions\n{\n\n homeViewController = [[HomeViewController alloc]init];\n\n UINavigationController *nav = [[UINavigationController alloc]init];\n\n nav.navigationItem.title = @\"Tab 1 Data\";\n [nav pushViewController:homeViewController animated:NO]; \n\n\n [self.tabBarController setSelectedViewController:nav];\n\n self.window.rootViewController = self.tabBarController;\n [self.window makeKeyAndVisible];\n return YES;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e//In NewsViewController.m for touching on home button\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e-(IBAction) homeButtonClick:(id)sender\n{\n TabBarWithHomeAppDelegate * appDelegate \n = [[UIApplication sharedApplication] delegate];\n\n UITabBarController * tabBarController = appDelegate.tabBarController;\n [tabBarController setSelectedViewController:nil];\n [tabBarController setSelectedViewController:appDelegate.homeViewController];\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn addition, I have attached source code. I'm will be grad if you see that and help me to solve this. In fact, I try to do it myself almost 6 hours.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://codesanook.com/code/TabBarWithHome.zip\" rel=\"nofollow noreferrer\"\u003elink to download source code.\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"7539791","answer_count":"2","comment_count":"0","creation_date":"2011-09-24 11:29:22.707 UTC","last_activity_date":"2011-09-24 15:00:48.393 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"147572","post_type_id":"1","score":"0","tags":"iphone|cocoa-touch|ios4|uinavigationcontroller|uitabbarcontroller","view_count":"199"} +{"id":"3671156","title":"Convert an expression tree for a c# query expression","body":"\u003cp\u003eI am having a problem converting this query via an expression tree:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eWageConstIn =\u0026gt; Convert.ToString(WageConstIn.Serialno).StartsWith(\"2800\")\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is my expression tree:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar searchTextExp = LinqExpression.Constant(\"2800\");\nvar parameterExp = LinqExpression.Parameter(typeof(WageConstInEntity), \"WageConstIn\");\nvar propertyExp = LinqExpression.Property(parameterExp, \"Serialno\");\nvar convertExpr = LinqExpression.Parameter(typeof(Convert), \"Convert\"); \nvar toStringExp = LinqExpression.Call(convertExpr, \"ToString\", new[] { typeof(decimal) }, new[] { propertyExp });\nvar startsWithExp = LinqExpression.Call(toStringExp, \"StartsWith\", null, new[] { searchTextExp });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am getting the following error:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e\"No method 'ToString' on type 'System.Convert' is compatible with the supplied arguments\"\u003c/p\u003e\n\u003c/blockquote\u003e","accepted_answer_id":"3684719","answer_count":"2","comment_count":"2","creation_date":"2010-09-08 19:17:15.21 UTC","last_activity_date":"2010-09-10 12:49:28.84 UTC","last_edit_date":"2010-09-08 19:41:29.55 UTC","last_editor_display_name":"","last_editor_user_id":"12971","owner_display_name":"","owner_user_id":"423940","post_type_id":"1","score":"0","tags":"c#|linq|expression-trees","view_count":"990"} +{"id":"27972283","title":"Tinyint in MySQL Results Returning Wrong Values","body":"\u003cp\u003eI have a table with about 50k records. Each record is associated with an activation code and a tinyint(1) that is either a 1 or a 0 depending on if it has been activated or not.\u003c/p\u003e\n\n\u003cp\u003eI wrote this script to search activation codes:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$count = 1;\nforeach ($array as $value) {\n\n try{\n $stmt = $db-\u0026gt;prepare(\"SELECT * FROM customers WHERE code = '$value'\");\n $stmt-\u0026gt;execute();\n $row = $stmt-\u0026gt;fetchAll();\n\n foreach ($row as $row1) {\n echo \"$count,{$row1['code']},{$row1['activated']} \u0026lt;br /\u0026gt;\";\n }\n\n }catch(PDOException $e){\n echo $e;\n }\n\n $count++;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt will print out results as such:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e263,GCTDA598149901,1 \n264,GCTDA363633527,1 \n265,GCTDA474011458,1 \n266,GCTDA610122649,1 \n267,GCTDA973129612,1 \n268,GCTDA472831092,1 \n269,GCTDA567914117,1 \n270,GCTDA763417638,1 \n271,GCTDA833541425,1 \n272,GCTDA556328307,1 \n273,GCTDA441015640,1 \n274,GCTDA266326284,1 \n275,GCTDA495338154,1 \n276,GCTDA320542455,1 \n277,GCTDA429649757,1 \n278,GCTDA468213166,1 \n279,GCTDA264634579,1 \n280,GCTDA842325439,1 \n281,GCTDA331321327,1 \n282,GCTDA280321014,1 \n283,GCTDA904841155,1 \n284,GCTDA728739105,1 \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAll of the tinyint's are returned as a 1 whether is it a 1 or a 0 in the database. I am truly at a loss right now on what is causing it. I hope someone can help.\u003c/p\u003e","accepted_answer_id":"27972654","answer_count":"1","comment_count":"14","creation_date":"2015-01-15 20:20:09.457 UTC","last_activity_date":"2015-01-15 20:45:01.58 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"528396","post_type_id":"1","score":"0","tags":"php|mysql|pdo|tinyint","view_count":"298"} +{"id":"47208312","title":"Firebase Cloud Messaging not working on IOS","body":"\u003cp\u003eSo I have been trying to figure this out for a while I have followed the set up guide a few times and I can't even get the push notifications sent form the firebase console to show up. I have Phone Auth set up and working, which required push notifications and APN set up, same as FCM. Here is my AppDelegate file:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e//\n// AppDelegate.swift\n// texter\n//\n// Created by Johnathan Saunders on 3/28/17.\n// Copyright © 2017 Johnathan Saunders. All rights reserved.\n//\nimport UIKit\nimport Firebase\n\nimport UserNotifications\n@UIApplicationMain\nclass AppDelegate: UIResponder, UIApplicationDelegate,MessagingDelegate {\n\n var window: UIWindow?\n let gcmMessageIDKey = \"gcm.message_id\"\n\n\n func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -\u0026gt; Bool {\n // Override point for customization after application launch.\n\n FirebaseApp.configure()\n\n // [START set_messaging_delegate]\n Messaging.messaging().delegate = self\n // [END set_messaging_delegate]\n // Register for remote notifications. This shows a permission dialog on first run, to\n // show the dialog at a more appropriate time move this registration accordingly.\n // [START register_for_notifications]\n if #available(iOS 10.0, *) {\n // For iOS 10 display notification (sent via APNS)\n UNUserNotificationCenter.current().delegate = self\n\n let authOptions: UNAuthorizationOptions = [.alert, .badge, .sound]\n UNUserNotificationCenter.current().requestAuthorization(\n options: authOptions,\n completionHandler: {_, _ in })\n } else {\n let settings: UIUserNotificationSettings =\n UIUserNotificationSettings(types: [.alert, .badge, .sound], categories: nil)\n application.registerUserNotificationSettings(settings)\n }\n\n application.registerForRemoteNotifications()\n let token = Messaging.messaging().fcmToken\n print(\"FCM token: \\(token ?? \"\")\")\n // [END register_for_notifications]\n\n return true\n }\n\n func applicationWillResignActive(_ application: UIApplication) {\n // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.\n // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.\n }\n\n func applicationDidEnterBackground(_ application: UIApplication) {\n // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.\n // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.\n }\n\n func applicationWillEnterForeground(_ application: UIApplication) {\n // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.\n }\n\n func applicationDidBecomeActive(_ application: UIApplication) {\n // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.\n }\n\n func applicationWillTerminate(_ application: UIApplication) {\n // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.\n }\n\n func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {\n // Pass device token to auth.\n let firebaseAuth = Auth.auth()\n\n //At development time we use .sandbox\n firebaseAuth.setAPNSToken(deviceToken, type: AuthAPNSTokenType.sandbox)\n print(\"APNs token retrieved: \\(deviceToken)\")\n InstanceID.instanceID().setAPNSToken(deviceToken, type: .prod)\n // With swizzling disabled you must set the APNs token here.\n Messaging.messaging().apnsToken = deviceToken\n //At time of production it will be set to .prod\n }\n\n\n //notifcation stuff\n\n // [START receive_message]\n func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any]) {\n // If you are receiving a notification message while your app is in the background,\n // this callback will not be fired till the user taps on the notification launching the application.\n // TODO: Handle data of notification\n // With swizzling disabled you must let Messaging know about the message, for Analytics\n Messaging.messaging().appDidReceiveMessage(userInfo)\n // Print message ID.\n if let messageID = userInfo[gcmMessageIDKey] {\n print(\"Message ID: \\(messageID)\")\n }\n\n // Print full message.\n print(userInfo)\n }\n\n func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any],\n fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -\u0026gt; Void) {\n // If you are receiving a notification message while your app is in the background,\n // this callback will not be fired till the user taps on the notification launching the application.\n // TODO: Handle data of notification\n // With swizzling disabled you must let Messaging know about the message, for Analytics\n Messaging.messaging().appDidReceiveMessage(userInfo)\n // Print message ID.\n if let messageID = userInfo[gcmMessageIDKey] {\n print(\"Message ID: \\(messageID)\")\n }\n\n // Print full message.\n print(userInfo)\n\n completionHandler(UIBackgroundFetchResult.newData)\n }\n // [END receive_message]\n func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {\n print(\"Unable to register for remote notifications: \\(error.localizedDescription)\")\n }\n\n\n\n // [END ios_10_message_handling]\n\n\n // [START refresh_token]\n func messaging(_ messaging: Messaging, didRefreshRegistrationToken fcmToken: String) {\n print(\"Firebase registration token: \\(fcmToken)\")\n\n // TODO: If necessary send token to application server.\n // Note: This callback is fired at each app startup and whenever a new token is generated.\n }\n // [END refresh_token]\n // [START ios_10_data_message]\n // Receive data messages on iOS 10+ directly from FCM (bypassing APNs) when the app is in the foreground.\n // To enable direct data messages, you can set Messaging.messaging().shouldEstablishDirectChannel to true.\n func messaging(_ messaging: Messaging, didReceive remoteMessage: MessagingRemoteMessage) {\n print(\"Received data message: \\(remoteMessage.appData)\")\n\n }\n // [END ios_10_data_message]\n\n func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String) {\n print(\"Firebase registration token: \\(fcmToken)\")\n\n // TODO: If necessary send token to application server.\n // Note: This callback is fired at each app startup and whenever a new token is generated.\n }\n\n\n}\n\n// [START ios_10_message_handling]\n@available(iOS 10, *)\nextension AppDelegate : UNUserNotificationCenterDelegate {\n\n // Receive displayed notifications for iOS 10 devices.\n func userNotificationCenter(_ center: UNUserNotificationCenter,\n willPresent notification: UNNotification,\n withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -\u0026gt; Void) {\n let userInfo = notification.request.content.userInfo\n\n // With swizzling disabled you must let Messaging know about the message, for Analytics\n // Messaging.messaging().appDidReceiveMessage(userInfo)\n // Print message ID.\n if let messageID = userInfo[gcmMessageIDKey] {\n print(\"Message ID: \\(messageID)\")\n }\n\n // Print full message.\n print(userInfo)\n\n // Change this to your preferred presentation option\n completionHandler([])\n }\n\n func userNotificationCenter(_ center: UNUserNotificationCenter,\n didReceive response: UNNotificationResponse,\n withCompletionHandler completionHandler: @escaping () -\u0026gt; Void) {\n let userInfo = response.notification.request.content.userInfo\n // Print message ID.\n if let messageID = userInfo[gcmMessageIDKey] {\n print(\"Message ID: \\(messageID)\")\n }\n\n // Print full message.\n print(userInfo)\n\n completionHandler()\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe certs and keys I downloaded/ generated are:\u003ca href=\"https://i.stack.imgur.com/KYdUr.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/KYdUr.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\nThe Certificates, Identifiers \u0026amp; Profiles section looks like this:\n\u003ca href=\"https://i.stack.imgur.com/obrCO.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/obrCO.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003ca href=\"https://i.stack.imgur.com/Gssjg.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/Gssjg.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003ca href=\"https://i.stack.imgur.com/28G9Y.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/28G9Y.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\nIn firebase's setting its looks like this:\u003ca href=\"https://i.stack.imgur.com/pe1DT.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/pe1DT.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-11-09 17:40:55.99 UTC","last_activity_date":"2017-11-10 12:16:17.513 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5545133","post_type_id":"1","score":"0","tags":"ios|swift|firebase|firebase-cloud-messaging","view_count":"106"} +{"id":"25206230","title":"Find a gem version via bundler","body":"\u003cp\u003eIs there a way we can find a Gem version via bundler ?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eFor eg\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$ bundle show capistrano \n/Users/ankitgupta/.rvm/gems/ruby-2.1.1/gems/capistrano-3.2.1\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis gives me the version, but i don't want to play with splitting and finding the value via last index. \u003c/p\u003e\n\n\u003cp\u003eI tried it this way\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ea = `bundle show capistrano`\nb = a.split(\"/\").last\nb.slice! (\"capistrano-\")\nputs b\n\n$3.2.1\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe above does my work, but is there a quick way to do it?\u003c/p\u003e","answer_count":"1","comment_count":"5","creation_date":"2014-08-08 14:49:26.307 UTC","last_activity_date":"2014-08-08 15:33:48.04 UTC","last_edit_date":"2014-08-08 14:59:47.943 UTC","last_editor_display_name":"","last_editor_user_id":"662425","owner_display_name":"","owner_user_id":"662425","post_type_id":"1","score":"0","tags":"ruby-on-rails|capistrano|bundler","view_count":"34"} +{"id":"15666686","title":"jQuery resizing images upon initial load of webpage","body":"\u003cp\u003eOk, Looking at this page in Google Chrome here on a MAC OSX: \u003ca href=\"http://opportunityfinance.net/Test/2013conf/index.html\" rel=\"nofollow noreferrer\"\u003ehttp://opportunityfinance.net/Test/2013conf/index.html\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eScrolling down to see the following:\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/joMAq.png\" alt=\"Initial Loading issue in Chrome\"\u003e\u003c/p\u003e\n\n\u003cp\u003eIf you resize the browser window, it than aligns correctly as in the following picture below:\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/4TEJS.png\" alt=\"What it Should Look Like and how it looks when resizing the browser window\"\u003e\u003c/p\u003e\n\n\u003cp\u003eSo, my question is how can I get the appearance in the 2nd pic upon initial loading of the page? Google Chrome initially sets the height of the \u003ccode\u003e\u0026lt;div class=\"gold\"\u0026gt;\u003c/code\u003e to 0px with the following code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ejQuery(document).ready(function($){\n\n var gold = $(\".gold\");\n\n $(window).bind(\"resize\", function(){\n gold.css({'height': gold.children(\":first\").children(\"img\").height()}); \n }).trigger(\"resize\");\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is the HTML that I'm using:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"gold\" style=\"width: 100%; position: relative; margin-top: 1em; margin-bottom: 1em;\"\u0026gt;\n \u0026lt;div style=\"position: absolute; bottom: 0px; right: 0px; width: 32%;\"\u0026gt;\n \u0026lt;img src=\"images/wellsfargo.png\" alt=\"Wells Fargo\" style=\"border: none; max-width: 100%;\"\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div style=\"float: left; width: 32%; bottom: 0px; left: 0px; position: absolute;\"\u0026gt;\n \u0026lt;img src=\"images/citi.png\" alt=\"Citi\" style=\"max-width: 100%; border: none;\"\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div style=\"margin: 0 auto; width: 34%; position: absolute; bottom: 0px; left: 0px; right: 0px;\"\u0026gt;\n \u0026lt;img src=\"images/gs10ksb.png\" alt=\"Goldman Sachs 10000 Small Businesses\" style=\"border: none; max-width: 100%;\"\u0026gt;\n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"7","creation_date":"2013-03-27 18:31:28.83 UTC","last_activity_date":"2013-03-27 18:40:32.77 UTC","last_edit_date":"2013-03-27 18:37:53.55 UTC","last_editor_display_name":"","last_editor_user_id":"1443501","owner_display_name":"","owner_user_id":"1443501","post_type_id":"1","score":"0","tags":"jquery|resize|margins","view_count":"131"} +{"id":"19743873","title":"Places API textSearch vs nearbySearch","body":"\u003cp\u003eHere I have a demo that use \u003ccode\u003enearbySearch\u003c/code\u003e to search for objects inside boxes (route boxer utility):\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://www.geocodezip.com/v3_SO_RouteBoxerPlaces.html\" rel=\"nofollow\"\u003ehttp://www.geocodezip.com/v3_SO_RouteBoxerPlaces.html\u003c/a\u003e\nCODE:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction findPlaces(boxes,searchIndex) {\n var request = {\n bounds: boxes[searchIndex],\n types: [\"gas_station\"]\n };\n // alert(request.bounds);\n service.radarSearch(request, function (results, status) {\n if (status != google.maps.places.PlacesServiceStatus.OK) {\n alert(\"Request[\"+searchIndex+\"] failed: \"+status);\n return;\n }\n // alert(results.length);\n document.getElementById('side_bar').innerHTML += \"bounds[\"+searchIndex+\"] returns \"+results.length+\" results\u0026lt;br\u0026gt;\"\n for (var i = 0, result; result = results[i]; i++) {\n var marker = createMarker(result);\n }\n searchIndex++;\n if (searchIndex \u0026lt; boxes.length) \n findPlaces(boxes,searchIndex);\n });\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow when I try to use \u003ccode\u003etextSearch\u003c/code\u003e instead \u003ccode\u003enearbySearch\u003c/code\u003e I see that code with textSearch and query search for objects outside boxes... \u003ca href=\"http://jsbin.com/ifUZIti/1/edit\" rel=\"nofollow\"\u003ehttp://jsbin.com/ifUZIti/1/edit\u003c/a\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction findPlaces(boxes,searchIndex) {\n var request = {\n bounds: boxes[searchIndex],\n query: 'gas station'\n };\n // alert(request.bounds);\n service.textSearch(request, function (results, status) {\n if (status != google.maps.places.PlacesServiceStatus.OK) {\n alert(\"Request[\"+searchIndex+\"] failed: \"+status);\n return;\n }\n // alert(results.length);\n document.getElementById('side_bar').innerHTML += \"bounds[\"+searchIndex+\"] returns \"+results.length+\" results\u0026lt;br\u0026gt;\"\n for (var i = 0, result; result = results[i]; i++) {\n var marker = createMarker(result);\n }\n searchIndex++;\n if (searchIndex \u0026lt; boxes.length) \n findPlaces(boxes,searchIndex);\n });\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat is difference beetween \u003ccode\u003etextSearch\u003c/code\u003e and \u003ccode\u003enearbySearch\u003c/code\u003e and WHY when I try to use textSearch code search and looking for objects outside defined boxes ? What is problem here?\nwith \u003ccode\u003enearbySearch\u003c/code\u003e all works fine but I can't use query with nearbySearch so I must use textSearch but with \u003ccode\u003etextSearch\u003c/code\u003e script search objects outside boxes ?\nHow I can solve this?\u003c/p\u003e","accepted_answer_id":"19782292","answer_count":"1","comment_count":"0","creation_date":"2013-11-02 16:05:33.833 UTC","last_activity_date":"2013-11-05 05:13:14.74 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2878339","post_type_id":"1","score":"1","tags":"javascript|google-maps|google-places-api|bounding-box","view_count":"1452"} +{"id":"10162477","title":"WPF Dispatcher.Run throws null exception on Win 7 64","body":"\u003cp\u003eI have the following code to create a new UI thread on a .NET 3.5 application. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e private void OnCreateNewWindow(object sender, RoutedEventArgs e)\n {\n var rect = this.RestoreBounds;\n double l = rect.Left;\n double wth = rect.Width;\n double t = rect.Top;\n double ht = rect.Height;\n var progressThread = new Thread(() =\u0026gt;\n {\n\n progressWindow = new ProgressWindow(Visibility.Collapsed) { Height = 50, Width = 50 };\n progressWindow.WindowStartupLocation = WindowStartupLocation.Manual;\n progressWindow.Left = l + (wth - progressWindow.Width) / 2;\n progressWindow.Top = t - 35 + (ht - progressWindow.Height) / 2;\n\n progressWindow.Show();\n progressWindow.Activate();\n Dispatcher.Run();\n });\n\n progressThread.SetApartmentState(ApartmentState.STA);\n progressThread.Start();\n } \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCrash is demonstrated here: \u003cimg src=\"https://i.stack.imgur.com/ZPZwv.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eThis works perfectly on 32 bit versions of Windows. The first time I run this program upon PC reboot on 64 bit Windows 7, I get a null exception, if run via Visual Studio or an application crash outside of Visual Studio.\u003c/p\u003e\n\n\u003cp\u003eException details is dry: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSystem.NullReferenceException was unhandled\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eStack trace is given below:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e [Managed to Native Transition] \n WindowsBase.dll!MS.Win32.HwndWrapper.DestroyWindow(object args) + 0xfc bytes \n WindowsBase.dll!MS.Win32.HwndWrapper.Dispose(bool disposing, bool isHwndBeingDestroyed) + 0xce bytes \n WindowsBase.dll!MS.Win32.HwndWrapper.Dispose() + 0x15 bytes \n PresentationCore.dll!System.Windows.Media.MediaContextNotificationWindow.DisposeNotificationWindow() + 0x22 bytes \n PresentationCore.dll!System.Windows.Media.MediaContext.Dispose() + 0xba bytes \n [Native to Managed Transition] \n [Managed to Native Transition] \n WindowsBase.dll!System.Windows.Threading.Dispatcher.ShutdownImplInSecurityContext(object state) + 0x47 bytes \n mscorlib.dll!System.Threading.ExecutionContext.runTryCode(object userData) + 0x178 bytes \n [Native to Managed Transition] \n [Managed to Native Transition] \n mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0x62 bytes \n WindowsBase.dll!System.Windows.Threading.Dispatcher.ShutdownImpl() + 0x87 bytes \n WindowsBase.dll!System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame frame) + 0x121 bytes \n\u0026gt; EMS.Controls.Dictionary.dll!EMS.Controls.Dictionary.Views.AuthenticateWindow.OnCreateNewWindow.AnonymousMethod() Line 56 + 0x5 bytes C#\n mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0x9b bytes \n mscorlib.dll!System.Threading.ThreadHelper.ThreadStart() + 0x4d bytes \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf I continue to run the program again, I get a message from the Program Compatibility Assitant, indicating that some compatibility settings have been applied. Next time I run the program I no longer get this exception. Anyone experienced this? \u003c/p\u003e","answer_count":"1","comment_count":"6","creation_date":"2012-04-15 13:32:32.937 UTC","last_activity_date":"2012-04-19 17:38:02.717 UTC","last_edit_date":"2012-04-16 15:17:07.76 UTC","last_editor_display_name":"","last_editor_user_id":"7116","owner_display_name":"","owner_user_id":"187279","post_type_id":"1","score":"3","tags":"c#|.net|wpf|windows-7-x64","view_count":"603"} +{"id":"4738209","title":"Python Twisted JSON RPC","body":"\u003cp\u003eCan anyone recommend some simple code to set up a simple JSON RPC client and server using twisted?\u003c/p\u003e\n\n\u003cp\u003eI found txJSON-RPC, but I was wondering if someone had some experience using some of these anc could recommend something.\u003c/p\u003e","accepted_answer_id":"4738563","answer_count":"5","comment_count":"0","creation_date":"2011-01-19 16:59:38.187 UTC","favorite_count":"11","last_activity_date":"2016-02-24 09:16:04.947 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"484444","post_type_id":"1","score":"18","tags":"python|twisted|rpc|json-rpc","view_count":"13258"} +{"id":"45260418","title":"2 side by side youtube videos bootstrap 3","body":"\u003cp\u003eI'm having a problem with my responsive embedded youtube where I have 2 videos side by side. It looks fine until the screen size is mobile. Instead of stacking on top of each other they size down to tiny boxes, like in this picture. \u003ca href=\"https://i.stack.imgur.com/4cxxs.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/4cxxs.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eHere is my page this is on \u003ca href=\"http://www.pscompetitiveedge.com/references.html\" rel=\"nofollow noreferrer\"\u003ehttp://www.pscompetitiveedge.com/references.html\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eHTML code for that top part of the page: \u003c/p\u003e\n\n\u003cp\u003e\u003cdiv class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\"\u003e\r\n\u003cdiv class=\"snippet-code\"\u003e\r\n\u003cpre class=\"snippet-code-html lang-html prettyprint-override\"\u003e\u003ccode\u003e\u0026lt;h1\u0026gt;References\u0026lt;/h1\u0026gt;\r\n\r\n\u0026lt;div class=\"row\"\u0026gt;\r\n\u0026lt;div class=\"col-sm-6\"\u0026gt;\r\n\u0026lt;div class=\"embed-responsive embed-responsive-16by9\"\u0026gt;\r\n \u0026lt;iframe class=\"embed-responsive-item\" src=\"https://www.youtube.com/embed/aaINOaWt938?rel=0?\"\u0026gt;\u0026lt;/iframe\u0026gt;\r\n\u0026lt;p\u0026gt;Click Above To View Testimonial Video!\u0026lt;/p\u0026gt;\r\n\u0026lt;/div\u0026gt;\r\n\u0026lt;/div\u0026gt;\r\n\r\n\u0026lt;div class=\"col-sm-6\"\u0026gt;\r\n\u0026lt;div class=\"embed-responsive embed-responsive-16by9\"\u0026gt;\r\n \u0026lt;iframe class=\"embed-responsive-item\" src=\"https://www.youtube.com/embed/e6UWqeLaMm4?rel=0?\"\u0026gt;\u0026lt;/iframe\u0026gt;\r\n\u0026lt;p\u0026gt;Click Above To View Peter In Seminar Action!\u0026lt;/p\u0026gt;\r\n\r\n\u0026lt;/div\u0026gt;\r\n\u0026lt;/div\u0026gt;\u0026lt;/div\u0026gt;\r\n\u0026lt;div class=\"clearfix\"\u0026gt;\u0026lt;/div\u0026gt;\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003c/p\u003e","accepted_answer_id":"45260449","answer_count":"3","comment_count":"1","creation_date":"2017-07-23 00:04:25.547 UTC","last_activity_date":"2017-07-23 06:18:15.01 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2238336","post_type_id":"1","score":"2","tags":"html|css|twitter-bootstrap|twitter-bootstrap-3","view_count":"141"} +{"id":"26315191","title":"Why destructor is called twice?","body":"\u003cp\u003eI have the following code: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;cstdio\u0026gt;\n#include \u0026lt;iostream\u0026gt;\nusing namespace std;\n\nclass A\n{\n int a, b;\npublic:\n A() : A(5, 7) {}\n A(int i, int j)\n {\n a = i;\n b = j;\n }\n A operator+(int x)\n {\n A temp;\n temp.a = a + x;\n temp.b = b + x;\n return temp;\n }\n ~A() { cout \u0026lt;\u0026lt; a \u0026lt;\u0026lt; \" \" \u0026lt;\u0026lt; b \u0026lt;\u0026lt; endl; }\n};\n\nint main()\n{\n A a1(10, 20), a2;\n a2 = a1 + 50;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOutput it shows: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e60 70\n60 70\n10 20\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe code works almost as expected. The problem is it prints the values of object \u003ccode\u003ea2\u003c/code\u003e twice... that means the destructor is called twice... but why it is called twice?\u003c/p\u003e","accepted_answer_id":"26315210","answer_count":"3","comment_count":"2","creation_date":"2014-10-11 13:27:09.713 UTC","favorite_count":"1","last_activity_date":"2014-10-11 16:22:28.057 UTC","last_edit_date":"2014-10-11 14:19:26.047 UTC","last_editor_display_name":"","last_editor_user_id":"183575","owner_display_name":"user4093373","post_type_id":"1","score":"5","tags":"c++|class|object|destructor","view_count":"239"} +{"id":"37843961","title":"Razor like intelliSense in custom razor-based template file","body":"\u003cp\u003eI am using \u003ca href=\"https://github.com/Antaris/RazorEngine/\" rel=\"nofollow\"\u003eRazor Engine\u003c/a\u003e, which is a library to render any any file using \u003ccode\u003erazor\u003c/code\u003e syntax, to render \u003cem\u003eMarkdown\u003c/em\u003e files with extension \u003ccode\u003ecsmd\u003c/code\u003e. So far everything is working like a charm but I would like to have \u003cem\u003eIntelliSense\u003c/em\u003e like on a regular \u003cem\u003eMVC\u003c/em\u003e \u003ccode\u003erazor\u003c/code\u003e file \u003ccode\u003e.cshtml\u003c/code\u003e. \u003c/p\u003e\n\n\u003cp\u003eSo my questions are:\u003c/p\u003e\n\n\u003cp\u003eCan I configure VS' \u003cem\u003eIntelliSense\u003c/em\u003e to this for me?\u003cbr\u003e\nCan I build a library (\u003ccode\u003enupkg\u003c/code\u003e)? In case the above is not possible.\u003cbr\u003e\nIs it too hard (or even possible) to make an extension \u003ccode\u003evsix\u003c/code\u003e to accomplish this? \u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2016-06-15 19:14:54.713 UTC","last_activity_date":"2016-06-15 19:39:42.157 UTC","last_edit_date":"2016-06-15 19:39:42.157 UTC","last_editor_display_name":"","last_editor_user_id":"1145114","owner_display_name":"","owner_user_id":"1145114","post_type_id":"1","score":"1","tags":"c#|visual-studio|razor|visual-studio-extensions","view_count":"47"} +{"id":"47047498","title":"Why this custom button is redrawing itself without invalidate","body":"\u003cp\u003eSo, I'm trying to learn how to create \u003ccode\u003ecustom views\u003c/code\u003e, and I learned that I should redraw the view after the desired changes using \u003ccode\u003einvalidate()\u003c/code\u003e method.\u003c/p\u003e\n\n\u003cp\u003eThis little program is one of the exercises in some website. It should be a standard button that contains a colored rectangle inside of it. And when we click the button, the rectangle changes color.\u003c/p\u003e\n\n\u003cp\u003eIt seems very logic, simple and it works very well. But when I wanted to play with it, and eliminate the \u003ccode\u003einvalidate()\u003c/code\u003e method in \u003ccode\u003eonTouchEvent()\u003c/code\u003e method, I was expecting that the colored rectangle won't change color after the click, but it worked as much well as with \u003ccode\u003einvalidate()\u003c/code\u003e !!\u003c/p\u003e\n\n\u003cp\u003eSo it seems the \u003ccode\u003einvalidate()\u003c/code\u003e method is useless here, and it confuses me and I want to understand why ? Thanks\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class ColorButton extends AppCompatButton {\n\n private TypedArray mCouleurs = null; // contains 4 colors\n private int position = 0;\n private Rect mRect = null;\n private Paint mPainter = new Paint(Paint.ANTI_ALIAS_FLAG);\n\n public ColorButton(Context context) {\n super(context);\n init();\n }\n\n public ColorButton(Context context, AttributeSet attrs) {\n super(context, attrs);\n init();\n }\n\n public ColorButton(Context context, AttributeSet attrs, int defStyleAttr) {\n super(context, attrs, defStyleAttr);\n init();\n }\n\n private void init() {\n Resources res = getResources();\n mCouleurs = res.obtainTypedArray(R.array.colors);\n setText(R.string.change_color);\n mRect = new Rect();\n mPainter.setColor(mCouleurs.getColor(position, -1));\n }\n\n @Override\n protected void onLayout(boolean changed, int left, int top, int right, int bottom) {\n\n if(changed) {\n mRect.left = Math.round(0.5f * getWidth() - 50);\n mRect.top = Math.round(0.75f * getHeight() - 50);\n mRect.right = Math.round(0.5f * getWidth() + 50);\n mRect.bottom = Math.round(0.75f * getHeight() + 50);\n }\n\n super.onLayout(changed, left, top, right, bottom);\n }\n\n @Override\n public boolean onTouchEvent(MotionEvent event) {\n\n if(event.getAction() == MotionEvent.ACTION_DOWN) {\n\n position++;\n position %= mCouleurs.length();\n\n mPainter.setColor(mCouleurs.getColor(position, -1));\n\n //invalidate();\n }\n\n return super.onTouchEvent(event);\n }\n\n @Override\n protected void onDraw(Canvas canvas) {\n\n canvas.drawRect(mRect, mPainter);\n\n super.onDraw(canvas);\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-11-01 02:50:16.157 UTC","last_activity_date":"2017-11-01 02:57:15.823 UTC","last_edit_date":"2017-11-01 02:57:15.823 UTC","last_editor_display_name":"","last_editor_user_id":"5527676","owner_display_name":"","owner_user_id":"8865750","post_type_id":"1","score":"0","tags":"android|android-view-invalidate","view_count":"21"} +{"id":"2984260","title":"Accessing Windows Server AppFabric caching from classic ASP application?","body":"\u003cp\u003eI am considering using Windows Server Appfabric for it caching functionality.\u003c/p\u003e\n\n\u003cp\u003eI have an existing classic ASP application that I want to rewrite in ASP.NET MVC. However, I want to be able to do this \"piecemeal\" i.e. a few pages at a time.\u003c/p\u003e\n\n\u003cp\u003eThe problem is session state between the ASP and ASP.Net MVC application. I could use a database but I would like to use Appfabric since it has good scalabilty, admin, etc.\u003c/p\u003e\n\n\u003cp\u003eMy question is: Does the Appfabric caching service/functionality have an API that I could wrap in .Net and expose to my classic ASP application as a com object?\u003c/p\u003e\n\n\u003cp\u003eI could then change all the Session and Application caching in the classic application to use the com object i.e. Appfabric. In this way I can share session state between ASP.Net MVC and classic ASP. I will have to test the performance penalty associated with interop as well.\u003c/p\u003e","answer_count":"2","comment_count":"7","creation_date":"2010-06-06 13:04:35.673 UTC","last_activity_date":"2013-04-24 20:02:31.993 UTC","last_edit_date":"2011-11-22 21:48:18.757 UTC","last_editor_display_name":"","last_editor_user_id":"698","owner_display_name":"","owner_user_id":"103557","post_type_id":"1","score":"2","tags":"asp.net|.net|asp-classic|appfabric","view_count":"700"} +{"id":"35110731","title":"Spring Data MongoDB @CreatedDate using Java 8 LocaDate Converter","body":"\u003cp\u003eI wan't to use java.util.LocalDate in my domain class that get persisted to MongoDB using Spring Data.\u003c/p\u003e\n\n\u003cp\u003eMy domain classes has this as parent :-\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic abstract class AuditableMongoEntity extends VersionAwareMongoEntity {\n\n /**\n * serialVersionUID\n */\n private static final long serialVersionUID = -67203638183725497L;\n\n @CreatedDate\n protected LocalDate dateCreated;\n\n @LastModifiedDate\n @JsonIgnore\n protected LocalDate lastUpdated;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy requirements:-\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003e'dateCreated' field should be saved as no. of days passed since epoch. My business does not need millisecs level of details and does not require hour/minute/sec infromation.\u003c/li\u003e\n\u003cli\u003eI also want to persist 'year','month','week' along with days for the dateCreated field and enable indexing on them.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eFor the first requirement I can register a custom \u003ccode\u003eConverter\u0026lt;LocalDate, Long\u0026gt;\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eHow should implement the second requirement?\u003c/p\u003e\n\n\u003cp\u003eSpring Boot version 1.3.x\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2016-01-31 05:40:40.027 UTC","last_activity_date":"2016-01-31 05:47:54.377 UTC","last_edit_date":"2016-01-31 05:47:54.377 UTC","last_editor_display_name":"","last_editor_user_id":"945034","owner_display_name":"","owner_user_id":"945034","post_type_id":"1","score":"1","tags":"java-8|spring-data-mongodb","view_count":"240"} +{"id":"22207274","title":"Separating requests to same page in load testing","body":"\u003cp\u003eI've recorded a web performance test in Visual Studio 2013 and then created a load test off of that.\u003c/p\u003e\n\n\u003cp\u003eIn the load test results, I want to differentiate between two requests to the same page (different form parameters passed in). How would I do that?\u003c/p\u003e\n\n\u003cp\u003eI'll try to illustrate the problem in screenshots:\u003c/p\u003e\n\n\u003cp\u003eHere's my web performance test:\n\u003cimg src=\"https://i.stack.imgur.com/BRhQW.jpg\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eAnd here are the load test results:\n\u003cimg src=\"https://i.stack.imgur.com/zGzv8.jpg\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eI want the Respond page to be shown as two separate entries in this results table. Any ideas?\u003c/p\u003e","accepted_answer_id":"22210801","answer_count":"1","comment_count":"2","creation_date":"2014-03-05 19:26:09.977 UTC","last_activity_date":"2014-03-05 22:30:09.333 UTC","last_edit_date":"2014-03-05 19:55:34.407 UTC","last_editor_display_name":"","last_editor_user_id":"32495","owner_display_name":"","owner_user_id":"32495","post_type_id":"1","score":"-1","tags":"asp.net|.net|performance-testing","view_count":"31"} +{"id":"42710028","title":"Neo4j-driver (official one) Modeling with nodejs (like Mongoose)?","body":"\u003cp\u003eI am trying to use Passport.js in conjunction with neo4j and nodejs using a tutorial with Mongo DB and it's node helper Mongoose. I have searched for a feature like this in the docs --\u003e \u003ca href=\"http://neo4j.com/docs/api/javascript-driver/current/\" rel=\"nofollow noreferrer\"\u003eLink to Docs\u003c/a\u003e, but I can't seem to find anything like that. I really like the ease of use with the official neo4j-driver, and was wondering if I can make models/functions similar to the way mongoose does. Any suggestions on how to achieve this? Or how to use passport without it? I am basically just trying to authenticate users before allowing access to my REST points.\u003c/p\u003e\n\n\u003cp\u003eAs I mentioned before, I have looked for something like this that is relevant but to the official driver, but no luck. I also couldn't find much on Stackoverflow about Neo4j in conjunction with nodejs and passport. \u003c/p\u003e\n\n\u003cp\u003eI am fairly new to Nodejs and web programming all together, so a nudge in the right direction would be great!\u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2017-03-10 04:06:05.707 UTC","last_activity_date":"2017-03-13 12:56:10.937 UTC","last_edit_date":"2017-03-13 12:56:10.937 UTC","last_editor_display_name":"","last_editor_user_id":"2111515","owner_display_name":"","owner_user_id":"7688077","post_type_id":"1","score":"0","tags":"javascript|node.js|neo4j","view_count":"41"} +{"id":"31991526","title":"MVC Html data attribute rendering difference","body":"\u003cp\u003eI have experienced a very strange issue which I cannot find the cause of.\u003c/p\u003e\n\n\u003cp\u003eIn my Asp.Net MVC app (.net4.0/MVC4) I am rending html data attributes within some html element to then be used within the JavaScript.\u003c/p\u003e\n\n\u003cp\u003eSo in the app I have a Model, e.g.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class MyModel{\n public bool MyFlag { get; set; }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am then passing this model through onto a simple MVC view page and rendering the boolean value into the html data attribute, e.g.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@model MyProject.MyModel\n\n\u0026lt;a href=\"#\" data-is-flagged=\"@Model.MyFlag\"\u0026gt;Click Me\u0026lt;/a\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow when running the project locally the html is rendered as:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;a href=\"#\" data-is-flagged=\"True\"\u0026gt;Click Me\u0026lt;/a\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever when running on the server, the html is rendered as:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;a href=\"#\" data-is-flagged=\"data-is-flagged\"\u0026gt;Click Me\u0026lt;/a\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAt first I thought that maybe the boolean was not being set somehow, so I added this to the element \u003ccode\u003eClick Me @Model.MyFlag\u003c/code\u003e which renders as \u003ccode\u003eClick Me True\u003c/code\u003e. Now I suspected that this has maybe something to do with Debug vs Release mode, however after playing about with this it made no difference.\u003c/p\u003e\n\n\u003cp\u003eMy fix to this was to change the code to output the boolean value as a string value, e.g. \u003ccode\u003edata-is-flagged=\"@Model.MyFlag.ToString()\"\u003c/code\u003e which then renders the same locally and on the server.\u003c/p\u003e\n\n\u003cp\u003eAny ideas what is the cause of this?\u003c/p\u003e","accepted_answer_id":"31992735","answer_count":"1","comment_count":"5","creation_date":"2015-08-13 14:46:15.117 UTC","favorite_count":"1","last_activity_date":"2015-08-13 15:48:46.423 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"177988","post_type_id":"1","score":"5","tags":"c#|asp.net|asp.net-mvc|asp.net-mvc-4","view_count":"442"} +{"id":"6841428","title":"how to save gmail emails accordingly in database","body":"\u003cp\u003ei want to have a script that will save gmail emails from an account in mysql db using php. Mails(both freshly new and reply ones) will be marked to be in the same category if they have the same subject. That is just the same way in gmail or yahoo mail.\u003c/p\u003e\n\n\u003cp\u003eSo far as I know gmail IMAP does not give the facility to track which are the reply mails.\u003c/p\u003e\n\n\u003cp\u003eWhich API or whatever should I use??\u003c/p\u003e\n\n\u003cp\u003eThe script will keep running.\u003c/p\u003e\n\n\u003cp\u003eDo I need to use scheduled task for that?\u003c/p\u003e","answer_count":"3","comment_count":"2","creation_date":"2011-07-27 08:25:20.697 UTC","last_activity_date":"2014-04-25 12:10:32.79 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"542925","post_type_id":"1","score":"0","tags":"php|mysql|gmail","view_count":"1461"} +{"id":"23635624","title":"RPI as a central server for co-located android devices","body":"\u003cp\u003eI would like to use a raspberry pi as a central server for an application I'm building. Basically, I want the raspberry Pi to act as a server which can be used by co-located mobile devices to communicate with each other. I'm trying to build a local access network, and there is no need for an Internet connection. I am going to build an application on Android to interface with the server.\u003c/p\u003e\n\n\u003cp\u003eI have considered using an ad-hoc network, however, I have found through the following (among others):\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003e\u003ca href=\"https://stackoverflow.com/questions/1932150/can-android-do-peer-to-peer-ad-hoc-networking\"\u003eCan\nAndroid do peer-to-peer ad-hoc networking?\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"http://forum.xda-developers.com/showthread.php?t=1718053\" rel=\"nofollow noreferrer\"\u003exda-developers\nthread\u003c/a\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003ethat Android does not play nicely with ad-hoc networks unless rooted. I am not in a position to root the cellphones, so what else could one do in this instance?\u003c/p\u003e\n\n\u003cp\u003eWhat is a replacement for an ad-hoc network that is compatible with android?\u003c/p\u003e","accepted_answer_id":"25590846","answer_count":"1","comment_count":"3","creation_date":"2014-05-13 15:34:50.177 UTC","favorite_count":"1","last_activity_date":"2014-08-31 09:57:33.93 UTC","last_edit_date":"2017-05-23 12:08:06.367 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"1984350","post_type_id":"1","score":"0","tags":"android|networking|raspberry-pi","view_count":"63"} +{"id":"22743449","title":"How to use ls command from module?","body":"\u003cp\u003eI want to run the commands like ls,cd,cat from my module.\nActually I want to run this command ls \u003e\u003e file.txt which makes a text file in that directory and save all the fle names in this text file...\nHow can I do this??\u003c/p\u003e","accepted_answer_id":"22743774","answer_count":"1","comment_count":"4","creation_date":"2014-03-30 11:31:28.383 UTC","last_activity_date":"2014-03-30 12:03:54.643 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3276511","post_type_id":"1","score":"1","tags":"linux|kernel","view_count":"79"} +{"id":"28011527","title":"How can I pool gradients in Theano?","body":"\u003cp\u003eI'm using Theano for the first time to build a large statistical model. I'm performing a kind of stochastic gradient descent, but for each sample in the minibatch I need to perform a sampling procedure to compute the gradient. Is there a way in Theano to pool the gradients while I perform the sampling procedure for each datapoint in a minibatch, and only afterward perform the gradient update? \u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-01-18 15:41:46.923 UTC","last_activity_date":"2015-01-21 23:41:44.45 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1382757","post_type_id":"1","score":"0","tags":"theano","view_count":"346"} +{"id":"33578755","title":"Multiple Queries same route endpoint in node express","body":"\u003cp\u003eI'm trying to make 2 queries for 2 different tables inside the same endpoint. I can do this for simple get queries, but not for more complex update/replace queries. Also I'm not sure how to properly handle errors in this case.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eBelow is what I tried:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction upvotePost(req,res,next){\n /*query 1*/\n r.table('posts').filter(function(post){\n return post('id').eq(someId);\n }).update(\n {\"upvotes\": r.row(\"upvotes\").add(1)}).run(req._rdbConn)\n /*query 2*/\n .then(function(){\n r.table('users').filter(r.row('login').eq(someUser))\n .update({upvotelist: r.row('upvotelist').changeAt(someId,1)})\n .run(req._rdbConn).then(function(result){\n res.send(JSON.stringify(result));\n })\n }).error(handleError(res))\n .finally(next);\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eRight now this returns a connection closed error.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-11-07 03:15:53.337 UTC","last_activity_date":"2015-11-27 13:59:04.783 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5174744","post_type_id":"1","score":"0","tags":"express|rethinkdb|rethinkdb-javascript","view_count":"202"} +{"id":"17522633","title":"Magento get product","body":"\u003cp\u003eI have a site into my Magento where I want to make a custom query.\nMy query is ok (I have tried it into phpmyadmin)\u003c/p\u003e\n\n\u003cp\u003eI have tried this code into my file .phtml\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\n// fetch write database connection that is used in Mage_Core module\n$db = Mage::getSingleton('core/resource')-\u0026gt;getConnection('core_read');\n$result = $db-\u0026gt;query(\"select * from catalog_product_flat_1 WHERE short_description LIKE '%\".$description_search.\"%' AND entity_id != \".$product_id.\" ;\");\n//After running check whether data is available or not\nif(!$result) {\n echo 'No data found';\n}\nelse\n{\n//Here we are fetching the data\n echo('\u0026lt;p\u0026gt;here '.$result-\u0026gt;fetchAll(PDO::FETCH_ASSOC).'\u0026lt;/p\u0026gt;');\n foreach ($result-\u0026gt;fetchAll() as $row)\n {\n echo ('\u0026lt;p\u0026gt;\u0026lt;br\u0026gt;Name: \u0026lt;/p\u0026gt;');\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eInto the foreach doesn't print anything and the fetchAll is empty.\nBut if I make:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar_dump($result);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWith this var_dump I have the object for example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eobject(Varien_Db_Statement_Pdo_Mysql)#631 (9) { [\"_fetchMode\":protected]=\u0026gt; int(2) [\"_stmt\":protected]=\u0026gt; object(PDOStatement)#572 (1) { [\"queryString\"]=\u0026gt; string(130) \"select * from catalog_product_flat_1 WHERE short_description LIKE '%Riferimento originale: TN-1700%' AND entity_id != 733536 ;\" } [\"_adapter\":protected]=\u0026gt; object(Varien_Db_Adapter_Pdo_Mysql)#14 (30) { [\"_defaultStmtClass\":protected]=\u0026gt; string(29) \"Varien_Db_Statement_Pdo_Mysql\" [\"_transactionLevel\":protected]=\u0026gt; int(0) [\"_connectionFlagsSet\":protected]=\u0026gt; bool(true) [\"_ddlCache\":protected]=\u0026gt; array(1) { [1]=\u0026gt; array(4) { [\"eav_attribute\"]=\u0026gt; array(17) { [\"attribute_id\"]=\u0026gt; array(14) { [\"SCHEMA_NAME\"]=\u0026gt; NULL....\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow can I retrieve correctly my product?\u003c/p\u003e","accepted_answer_id":"17523206","answer_count":"1","comment_count":"0","creation_date":"2013-07-08 09:01:19.27 UTC","last_activity_date":"2013-07-08 10:45:21.73 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1427138","post_type_id":"1","score":"0","tags":"php|magento","view_count":"261"} +{"id":"39078083","title":"Using mb_substr still breaks accent character at the end","body":"\u003cp\u003e\u003cstrong\u003eLogic\u003c/strong\u003e: I am getting username from DB and if it is greater than 30 in length then i show 30 characters with \"...\" appended at the end.\nCode is\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$username = htmlspecialchars($username);\nif(mb_strlen($username, 'utf-8')\u0026gt;30){\n $username_trimmed = mb_substr($username, 0, 30, 'utf-8').'...';\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand in my navivation I am just printing this \u003ccode\u003eusername\u003c/code\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;class=\"userName\"\u0026gt;Hello, \u0026lt;?php echo $username_trimmed; ?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy encoding in set as \u003ccode\u003eutf-8\u003c/code\u003e, and \u003ccode\u003embstring\u003c/code\u003e extension is enabled in php.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eOutput\u003c/strong\u003e of above code : It still breaks the accent character \u003ccode\u003eÉ\u003c/code\u003e because it is multi-byte character and it is getting cut the in the middle.\nActual word is \u003ccode\u003eMARCHÉS\u003c/code\u003e and output is:\u003cbr\u003e\n\u003ca href=\"https://i.stack.imgur.com/4rL4K.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/4rL4K.png\" alt=\"Erroneous output \"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eQuestion\u003c/strong\u003e what am I missing? \u003ccode\u003emb_substr\u003c/code\u003e should not consider it as a single character and should not stop it from breaking in the middle as it does?\u003c/p\u003e","accepted_answer_id":"39079396","answer_count":"2","comment_count":"2","creation_date":"2016-08-22 11:13:08.233 UTC","last_activity_date":"2016-08-22 13:08:07.203 UTC","last_edit_date":"2016-08-22 11:54:33.26 UTC","last_editor_display_name":"","last_editor_user_id":"1466583","owner_display_name":"","owner_user_id":"6743240","post_type_id":"1","score":"-1","tags":"php|utf-8","view_count":"86"} +{"id":"39624448","title":"Callee RC: NS_ERROR_FACTORY_NOT_REGISTERED 0x80040154","body":"\u003cp\u003eI have been running VirtualBox for a few months now and I recently updated El Capitan. After do so, the VirtualBox would no longer start. The error message that displayed was: \u003c/p\u003e\n\n\u003cp\u003e\"Callee RC: NS_ERROR_FACTORY_NOT_REGISTERED 0x80040154\". Does anyone have a solution to this problem?\u003c/p\u003e\n\n\u003cp\u003eThank you.\u003c/p\u003e","answer_count":"3","comment_count":"1","creation_date":"2016-09-21 18:55:56.117 UTC","last_activity_date":"2017-07-10 14:52:20.303 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6860244","post_type_id":"1","score":"-1","tags":"permissions|virtualbox|osx-elcapitan|tmp","view_count":"713"} +{"id":"4971262","title":"Joining tables using criteria and sqlProjection","body":"\u003cp\u003eI have the following function that builds a Hibernate Criteria to generate binned data:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate Criteria getCustomBinResultCriteriaSQL(double binSizeX, double binSizeY, String xVar, String yVar, String customBinQuery) {\n return createCriteria(Residue.class)\n .setProjection(Projections.projectionList()\n .add(Projections.sqlGroupProjection(\n \"floor(\" + xVar + \" / \" + binSizeX + \") * \" + binSizeX + \" as xBin, \" +\n \"floor(\" + yVar + \" / \" + binSizeY + \") * \" + binSizeY + \" as yBin, \" +\n \"CAST (\" + customBinQuery + \" AS DOUBLE PRECISION) as customBinResult\",\n \"xBin, yBin\",\n new String[] { \"xBin\", \"yBin\", \"customBinResult\" },\n new Type[] { Hibernate.DOUBLE, Hibernate.DOUBLE, Hibernate.DOUBLE })))\n .setResultTransformer(Transformers.aliasToBean(CustomBinResult.class));\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis all works pretty well for data within the same table (residue), but let's say my datastructure is like this:\u003c/p\u003e\n\n\u003cpre\u003e\npdbentry:\nid\npdbvar\n\nexpmethod:\nid\nexpvar\n\nresidue:\nid\nresvar\n\u003c/pre\u003e\n\n\u003cp\u003epdbentry has a one-to-one relation with expmethod, and a one-to-many relation with residue.\u003c/p\u003e\n\n\u003cp\u003eHow would I go about joining the residue table with expmethod, based on the criteria-builder above. So in other words: what do I need to add to the criteria to be able to have \"expvar\" as xVar?\u003c/p\u003e\n\n\u003cp\u003eI tried adding something like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e.setFetchMode(\"pdbentry\", FetchMode.JOIN);\n.setFetchMode(\"expmethod\", FetchMode.JOIN);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eat the end, but then I still couldn't put \"expvar\" nor \"expmethod.expvar\" as xVar.\u003c/p\u003e\n\n\u003cp\u003eAny ideas?\u003c/p\u003e","answer_count":"2","comment_count":"1","creation_date":"2011-02-11 16:05:17.1 UTC","favorite_count":"1","last_activity_date":"2012-01-10 11:15:47.537 UTC","last_edit_date":"2011-02-13 10:15:09.973 UTC","last_editor_display_name":"","last_editor_user_id":"192351","owner_display_name":"","owner_user_id":"192351","post_type_id":"1","score":"0","tags":"java|hibernate|join|criteria","view_count":"1813"} +{"id":"14270086","title":"Passing String to Fragment","body":"\u003cp\u003eI have an EditText view in my MainActivity that the user can input a url. This MainActivity also contains a fragment which will hold a WebView. \u003c/p\u003e\n\n\u003cp\u003eI have it set up so that when the fragment is displayed the url will load in the WebView. However I don't know how I can pass the String to the Fragment?\u003c/p\u003e\n\n\u003cp\u003eBelow is the Main Activity code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class MainActivity extends FragmentActivity {\n\nButton goBtn;\nEditText urlInput;\nString url;\n\n@Override\nprotected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n\n goBtn = (Button)findViewById(R.id.button1);\n urlInput = (EditText)findViewById(R.id.editText1);\n\n goBtn.setOnClickListener(new View.OnClickListener() {\n\n @Override\n public void onClick(View v) {\n url = \"http://\"+urlInput.getText().toString(); //THIS TO FRAGMENT!\n\n Toast.makeText(v.getContext(), \"Search:\" + url, Toast.LENGTH_SHORT).show();\n }\n });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand this is the fragment code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e WebView webDisplay;\nString url;\nAsyncHttpClient client;\n\n@Override\npublic View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.frag1_layout, container, false);\n urlDisplay = (TextView)v.findViewById(R.id.textView1);\n webDisplay = (WebView)v.findViewById(R.id.webView1);\n return v;\n}\n\n@Override\npublic void onActivityCreated(Bundle savedInstanceState) {\n super.onActivityCreated(savedInstanceState);\n //url = \"http://\"+this.getActivity() ???\n client = new AsyncHttpClient();\n client.get(url, new AsyncHttpResponseHandler(){\n\n @Override\n public void onSuccess(String response) {\n Toast.makeText(getActivity(), \"Success!\", Toast.LENGTH_SHORT).show();\n webDisplay.setWebViewClient(new WebViewClient() {\n public boolean shouldOverrideUrlLoading(WebView view, String url) {\n view.loadUrl(url);\n return true;\n }}); \n webDisplay.loadUrl(url);\n }\n });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe value I am concerned about it the String URL variable in MainActivity.java.\u003c/p\u003e\n\n\u003cp\u003eThe transaction of the fragments is controlled by a class TabFragment.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class TabFragment extends Fragment {\n\nprivate static final int TAB1_STATE = 0x1;\nprivate static final int TAB2_STATE = 0x2;\nprivate int mTabState;\n\n@Override\npublic View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_tab, container, false);\n //References to buttons in layout file\n Button tabBtn1 = (Button)v.findViewById(R.id.tabBtn1);\n Button tabBtn2 = (Button)v.findViewById(R.id.tabBtn2);\n\n //add listener to buttons\n tabBtn1.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View arg0) {\n //Action to perform when Tab 1 clicked...\n goToTab1View();\n\n }\n });\n\n tabBtn2.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n //Action to perform when Tab 2 clicked...\n goToTab2View();\n }\n });\n\n return v;\n\n}\n\n//Tab action functions.\nprotected void goToTab1View() {\n if(mTabState != TAB1_STATE){\n mTabState = TAB1_STATE;\n FragmentManager fm = getFragmentManager();\n if(fm!= null){\n //Perform fragment transaction\n FragmentTransaction ft = fm.beginTransaction();\n ft.replace(R.id.fragment_content, new FragTab1());\n ft.commit();\n }\n }\n}\n\nprotected void goToTab2View() {\n if(mTabState != TAB2_STATE){\n mTabState = TAB2_STATE;\n FragmentManager fm = getFragmentManager();\n if(fm!= null){\n //Perform fragment transaction\n FragmentTransaction ft = fm.beginTransaction();\n ft.replace(R.id.fragment_content, new FragTab2());\n ft.commit();\n }\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"14270352","answer_count":"2","comment_count":"0","creation_date":"2013-01-11 01:07:36.483 UTC","last_activity_date":"2013-01-11 01:45:31.673 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1732515","post_type_id":"1","score":"1","tags":"android|webview|fragment|android-view","view_count":"3044"} +{"id":"10132859","title":"JLabel setText is not working","body":"\u003cp\u003eI am trying to update JLabel by using setText() method. But I can't redraw JLabel. Do I have to use repaint() method to do that? I searched every forum but I can't find a solution. \u003c/p\u003e\n\n\u003cp\u003eHere is the part of code. I do not get any errors, but it is not updating JLabel.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic void actionPerformed(ActionEvent e) {\n fc = new JFileChooser();\n if(e.getSource() == addButton) {\n int returnVal = fc.showOpenDialog(Main.this);\n if (returnVal == JFileChooser.APPROVE_OPTION) {\n filesList = fc.getSelectedFiles();\n setFilesList(filesList);\n\n StringBuilder logString = new StringBuilder();\n logString.append(\"Files to Convert \" + \"\\n\");\n for(int i = 0; i \u0026lt; getFiles().length; i++) {\n logString.append(filesList[i].getAbsolutePath());\n }\n //JLabel log = new JLabel(); created above.\n log.setText(logString.toString());\n } else {\n //log.append(\"Open command cancelled by user.\" + newline);\n }\n //log.setCaretPosition(log.getDocument().getLength());\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"4","comment_count":"4","creation_date":"2012-04-12 22:35:29.237 UTC","last_activity_date":"2017-07-24 09:57:38.423 UTC","last_edit_date":"2017-07-24 09:57:38.423 UTC","last_editor_display_name":"","last_editor_user_id":"5292296","owner_display_name":"","owner_user_id":"982677","post_type_id":"1","score":"2","tags":"java|swing|user-interface|jlabel","view_count":"26755"} +{"id":"40554997","title":"c# printing a \"*\" char using entered coordinates with 2d array","body":"\u003cp\u003eI have been trying to do a task I recieved a few days earlier. Basically the task is a console application in C# :\u003c/p\u003e\n\n\u003cp\u003ePrompt the user for input of 2 coordinates in untill the word \"stop\" is entered. Once the word \"stop\" is hit, print a \"*\"(star char) at each of the input coordinates. The field where the coordinates are printed is 20x20. I have tried doing this, but to no avail. If somebody could help me out and show me how to store the input x,y into a 2d array, that'd be great :)\u003c/p\u003e\n\n\u003cp\u003eHow the application should work : \u003ca href=\"http://imgur.com/a/SnC1k\" rel=\"nofollow noreferrer\"\u003ehttp://imgur.com/a/SnC1k\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThe [0,5] [18,18]etc are the entered coordinates which are later on printed down below. The \"#\" chars dont need to be printed , they are here only to help with the understanding of the task.\u003c/p\u003e\n\n\u003cp\u003eHow I tried to do it but DIDN'T work :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enamespace ConsoleApplication1\n{ \nclass Program\n{\n static void Main(string[] args)\n {\n bool stopped = false;\n int x=0;\n int y=0;\n\n\n while (stopped)\n {\n string[,] coordinates = Console.ReadLine();\n string response = Console.ReadLine();\n response = response.ToLower();\n\n if (response == \"STOP\")\n stopped = true;\n else\n {\n string[] xy = coordinates.Split(',');\n x = int.Parse(xy[0]);\n y = int.Parse(xy[1]);\n\n Console.SetCursorPosition(x, y);\n Console.Write(\"*\");\n }\n\n\n\n\n\n\n }\n\n\n }\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe code I did just doesn't do it. It shows multiple errors that I do not know how to fix and the only thing I was able to do is get it to print a char immediately when I enter the first coordinates, instead of printing a char at every entered coordinate, AFTER the word STOP is hit.\u003c/p\u003e","answer_count":"3","comment_count":"3","creation_date":"2016-11-11 19:36:37.403 UTC","last_activity_date":"2016-11-11 20:14:37.36 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7145810","post_type_id":"1","score":"0","tags":"c#","view_count":"124"} +{"id":"10222216","title":"Implementing a simple proxy server using node.js","body":"\u003cp\u003eI'm trying to create a simple node.js proxy server for experimental purposes and I came up with this simple script:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar url = require(\"url\");\nvar http = require(\"http\");\nvar https = require(\"https\");\n\nhttp.createServer(function (request, response) {\n var path = url.parse(request.url).path;\n\n if (!path.indexOf(\"/resource/\")) {\n var protocol;\n path = path.slice(10);\n var location = url.parse(path);\n\n switch (location.protocol) {\n case \"http:\":\n protocol = http;\n break;\n case \"https:\":\n protocol = https;\n break;\n default:\n response.writeHead(400);\n response.end();\n return;\n }\n\n var options = {\n host: location.host,\n hostname: location.hostname,\n port: +location.port,\n method: request.method,\n path: location.path,\n headers: request.headers,\n auth: location.auth\n };\n\n var clientRequest = protocol.request(options, function (clientResponse) {\n response.writeHead(clientResponse.statusCode, clientResponse.headers);\n clientResponse.on(\"data\", response.write);\n clientResponse.on(\"end\", function () {\n response.addTrailers(clientResponse.trailers);\n response.end();\n });\n });\n\n request.on(\"data\", clientRequest.write);\n request.on(\"end\", clientRequest.end);\n } else {\n response.writeHead(404);\n response.end();\n }\n}).listen(8484);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI don't know where I'm going wrong but it gives me the following error when I try to load any page:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ehttp.js:645\n this._implicitHeader();\n ^\nTypeError: Object #\u0026lt;IncomingMessage\u0026gt; has no method '_implicitHeader'\n at IncomingMessage.\u0026lt;anonymous\u0026gt; (http.js:645:10)\n at IncomingMessage.emit (events.js:64:17)\n at HTTPParser.onMessageComplete (http.js:137:23)\n at Socket.ondata (http.js:1410:22)\n at TCP.onread (net.js:374:27)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI wonder what could the problem be. Debugging in node.js is so much more difficult than in Rhino. Any help will be greatly appreciated.\u003c/p\u003e","accepted_answer_id":"10223205","answer_count":"1","comment_count":"6","creation_date":"2012-04-19 05:35:22.83 UTC","favorite_count":"1","last_activity_date":"2012-04-19 07:08:09.503 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"783743","post_type_id":"1","score":"2","tags":"javascript|http|node.js|https|proxy-server","view_count":"2928"} +{"id":"38627066","title":"In R, how do I make an iterative calculation without using a loop?","body":"\u003cp\u003eHere is a simple example of one type of iterative calc:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evals \u0026lt;- data.frame( \"x\"=c( 14, 15, 12, 10, 17 ), \"ema\"=0 )\nvals$ema[1] \u0026lt;- vals$x[1]\nK \u0026lt;- 0.90\nfor( jj in 2:nrow( vals ) )\n vals$ema[jj] \u0026lt;- K * vals$ema[jj-1] + (1-K) * vals$x[jj]\n\nvals\n x ema\n1 14 14.0000\n2 15 14.1000\n3 12 13.8900\n4 10 13.5010\n5 17 13.8509\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe more involved examples use if...else to determine the next value:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efor( jj in 2:nrow( vals ) )\n if( K * vals$ema[jj-1] + (1-K) * vals$x[jj] \u0026lt; 5.0 )\n vals$ema[jj] \u0026lt;- 5.0\n else if( K * vals$ema[jj-1] + (1-K) * vals$x[jj] \u0026gt; 15.0 )\n vals$ema[jj] \u0026lt;- 15.0\n else\n vals$ema[jj] \u0026lt;- K * vals$ema[jj-1] + (1-K) * vals$x[jj]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am not sure if it would be more involved or not, but the decision can be based on the previous value as well:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eK1 \u0026lt;- 0.999\nK2 \u0026lt;- 0.95\nK3 \u0026lt;- 0.90\nfor( jj in 2:now( vals ) )\n if( vals$ema[jj-1] \u0026lt; 0.0 )\n vals$ema[jj] \u0026lt;- K1 * vals$ema[jj-1] + (1-K1) * vals$x[jj]\n else if( vals$ema[jj-1] \u0026gt; 100.0 )\n vals$ema[jj] \u0026lt;- K3 * vals$ema[jj-1] + (1-K3) * vals$x[jj]\n else\n vals$ema[jj] \u0026lt;- K2 * vals$ema[jj-1] + (1-K2) * vals$x[jj]\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"5","comment_count":"1","creation_date":"2016-07-28 04:23:25.353 UTC","last_activity_date":"2016-08-01 19:52:58.51 UTC","last_edit_date":"2016-07-31 03:23:43.78 UTC","last_editor_display_name":"","last_editor_user_id":"2137931","owner_display_name":"","owner_user_id":"2137931","post_type_id":"1","score":"0","tags":"r|loops|iteration|shift","view_count":"254"} +{"id":"6806068","title":"the type system does not tell the whole story due to \"exception\"","body":"\u003cp\u003eMy question should be somewhat vague and very superficial. Sorry. But I am wondering whether it is a bad style to use \"exception\". For example, in Ocaml, the exception does not appear as the .mli file. So it appears to me that \"exception\" is something that cannot be tracked by a type system. \u003c/p\u003e\n\n\u003cp\u003eSo my question in general is, is using exception a bad style because it hides information against the type system?\u003c/p\u003e\n\n\u003cp\u003eConcretely, I am trying to implement a type checker for an imperative language, say, Pascal. The essential judgment should have been of this signature, \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ewell-typed_1: environment -\u0026gt; statement -\u0026gt; unit\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut this seems to be insufficient because the environment would be modified due to a local variable declaration, thus a more reasonable interface for typechecker would be \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ewell-typed_2: environment -\u0026gt; statement -\u0026gt; environment\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAn alternative would be use the former one, well-typed_1, dealing with local variables declaration through an exception Var_declaration (e : environment) which returns the updated environment to the type checker for its other recursion. \u003c/p\u003e\n\n\u003cp\u003eSo, my question for this concrete example is , should I use the well-typed_1 + exception for variable declaration, or well-typed_2? \u003c/p\u003e\n\n\u003cp\u003eThe disadvantage of well-typed_2 seems to be that, for most statement there are no side effect with regard to environment of types, thus that signature of well-typed_2 seems to be a bit redundant. The disadvantage of well_typed_2 + exception seems to reveal a general issue: the the signature of well-typed_1 in does not tell the whole story. (it does not tell the potential exception)\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2011-07-24 09:39:29.09 UTC","last_activity_date":"2011-07-24 09:44:43.573 UTC","last_edit_date":"2011-07-24 09:44:43.573 UTC","last_editor_display_name":"","last_editor_user_id":"166749","owner_display_name":"","owner_user_id":"815653","post_type_id":"1","score":"1","tags":"exception|programming-languages|type-systems","view_count":"64"} +{"id":"21802756","title":"Why does git rm -rf not get rid of a folder with a submodule in it?","body":"\u003cp\u003eWhen I do \u003ccode\u003egit status\u003c/code\u003e this is what I see:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$ git status\n# On branch master\n# Your branch is ahead of 'github/master' by 1 commit.\n# (use \"git push\" to publish your local commits)\n#\n# Changes not staged for commit:\n# (use \"git add \u0026lt;file\u0026gt;...\" to update what will be committed)\n# (use \"git checkout -- \u0026lt;file\u0026gt;...\" to discard changes in working directory)\n# (commit or discard the untracked or modified content in submodules)\n#\n# modified: octopress (modified content, untracked content)\n#\nno changes added to commit (use \"git add\" and/or \"git commit -a\")\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I do \u003ccode\u003egit rm -rf octopress\u003c/code\u003e, this is what I see:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$ git rm -rf octopress\nerror: submodule 'octopress' (or one of its nested submodules) uses a .git directory\n(use 'rm -rf' if you really want to remove it including all of its history)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThoughts?\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2014-02-15 19:49:31.433 UTC","favorite_count":"2","last_activity_date":"2016-06-21 20:08:38.45 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"91970","post_type_id":"1","score":"4","tags":"git","view_count":"2412"} +{"id":"40028974","title":"Visual Studio variadic macro expansion yields unexpected results","body":"\u003cp\u003ecurrently I'm trying to compile some code with Visual Studio 2015 Service Pack 2 that makes use of the following macros not written by me:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#define REM(...) __VA_ARGS__\n#define EAT(...)\n\n// Retrieve the type\n#define TYPEOF(x) DETAIL_TYPEOF(DETAIL_TYPEOF_PROBE x,)\n#define DETAIL_TYPEOF(...) DETAIL_TYPEOF_HEAD(__VA_ARGS__)\n#define DETAIL_TYPEOF_HEAD( x , ... ) REM x\n#define DETAIL_TYPEOF_PROBE(...) (__VA_ARGS__),\n// Strip off the type\n#define STRIP(x) EAT x\n// Show the type without parenthesis\n#define PAIR(x) REM x\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSupposedly the TYPEOF macro would isolate the type of an expression.\nI have tried to invoke the TYPEOF macro with the following call:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eTYPEOF( (int) m ) c;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn theory, the result should be\u003c/p\u003e\n\n\u003cp\u003eint c;\u003c/p\u003e\n\n\u003cp\u003ebut instead the preprocessor outputs\u003c/p\u003e\n\n\u003cp\u003eint, m, c;\u003c/p\u003e\n\n\u003cp\u003eReplacing\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#define DETAIL_TYPEOF_HEAD(x, ...) REM x\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewith\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#define DETAIL_TYPEOF_HEAD( x , ... ) X = x and VA_ARGS = __VA_ARGS__\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eYields this output:\u003c/p\u003e\n\n\u003cp\u003eX = (int), m, and VA_ARGS = c;\u003c/p\u003e\n\n\u003cp\u003eIt seems that receiving the input (int), m, the DETAIL_TYPEOF_HEAD macro is unable to pick the first entry x from the variadic parameter list and instead puts the whole list into x.\u003c/p\u003e\n\n\u003cp\u003eDo you know this phenomenon? \u003c/p\u003e\n\n\u003cp\u003eRegards \u003c/p\u003e","answer_count":"1","comment_count":"4","creation_date":"2016-10-13 19:04:30.093 UTC","last_activity_date":"2016-10-14 09:01:44.193 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5024425","post_type_id":"1","score":"0","tags":"c++|visual-c++","view_count":"78"} +{"id":"23310198","title":"ValueError: The file could not be found with \u003cpipeline.storage.PipelineCachedStorage object\u003e","body":"\u003cp\u003eI'm trying to compile SASS and compress CSS files with \u003ca href=\"http://django-pipeline.readthedocs.org/en/latest/\" rel=\"nofollow noreferrer\"\u003e\u003cstrong\u003edjango pipeline\u003c/strong\u003e\u003c/a\u003e on \u003cem\u003eDjango 1.6.3\u003c/em\u003e, but I get the following error after visiting my site:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eValueError: The file 'css/test2.css' could not be found with \u0026lt;pipeline.storage.PipelineCachedStorage object at 0x0585DF50\u0026gt;.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI configured pipeline following the guide on \u003ca href=\"https://readthedocs.org/\" rel=\"nofollow noreferrer\"\u003ereadthedocs.org\u003c/a\u003e: I added pipeline to \u003ccode\u003eINSTALLED_APPS\u003c/code\u003e then I defined \u003ccode\u003eSTATIC_URL\u003c/code\u003e and \u003ccode\u003eSTATIC_ROOT\u003c/code\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSTATIC_URL = '/test/forum/skins/default/media/'\nSTATIC_ROOT = '/test/forum/skins/default/media/'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFolders tree:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003etest \n\n\u003cul\u003e\n\u003cli\u003eforum \n\n\u003cul\u003e\n\u003cli\u003eskins \n\n\u003cul\u003e\n\u003cli\u003edefault \n\n\u003cul\u003e\n\u003cli\u003e\u003cstrong\u003emedia\u003c/strong\u003e (static files) \n\n\u003cul\u003e\n\u003cli\u003ecss \u003c/li\u003e\n\u003cli\u003ejs \u003c/li\u003e\n\u003cli\u003eimages \u003c/li\u003e\n\u003c/ul\u003e\u003c/li\u003e\n\u003c/ul\u003e\u003c/li\u003e\n\u003cli\u003esite1 \u003c/li\u003e\n\u003cli\u003esite2 \u003c/li\u003e\n\u003cli\u003esite3 \u003c/li\u003e\n\u003c/ul\u003e\u003c/li\u003e\n\u003c/ul\u003e\u003c/li\u003e\n\u003c/ul\u003e\u003c/li\u003e\n\u003cli\u003eviews \u003c/li\u003e\n\u003cli\u003eutils \u003c/li\u003e\n\u003cli\u003esettings.py\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eI added \u003ccode\u003eSASSCompiler\u003c/code\u003e to \u003ccode\u003ePIPELINE_COMPILERS\u003c/code\u003e and then I added the path to the file to be compressed:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e# pipeline settings\nSTATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage'\nPIPELINE_COMPILERS = (\n 'pipeline.compilers.sass.SASSCompiler',\n)\nPIPELINE_CSS = {\n 'main': {\n 'source_filenames': (\n 'css/test.scss',\n ),\n 'output_filename': 'css/test2.css',\n },\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFinally I linked the css to my XHTML index:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{% load compressed %}\n\u0026lt;html xmlns=\"http://www.w3.org/1999/xhtml\"\u0026gt;\n \u0026lt;head\u0026gt;\n {% compressed_css 'main' %}\n \u0026lt;/head\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI do not understand what I did wrong. \nThanks for any help!\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003ch3\u003eUPDATE:\u003c/h3\u003e\n\n\u003cp\u003eWhen I run \u003ccode\u003ecollectstatic\u003c/code\u003e this copy the files from django and not from my project\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eF:\\DEV\\DJANGO\\apps\\test\u0026gt;python manage.py collectstatic\n\nYou have requested to collect static files at the destination\nlocation as specified in your settings:\n\n F:\\test\\forum\\skins\\default\\media\n\nThis will overwrite existing files!\nAre you sure you want to do this?\n\nType 'yes' to continue, or 'no' to cancel: yes\nCopying 'F:\\DEV\\DJANGO\\apps\\django\\django\\contrib\\admin\\static\\admin\\css\\base.\ncss'\nCopying 'F:\\DEV\\DJANGO\\apps\\django\\django\\contrib\\admin\\static\\admin\\css\\chang\nelists.css'\nCopying 'F:\\DEV\\DJANGO\\apps\\django\\django\\contrib\\admin\\static\\admin\\css\\dashb\noard.css'\nCopying 'F:\\DEV\\DJANGO\\apps\\django\\django\\contrib\\admin\\static\\admin\\css\\forms\n.css'\nCopying 'F:\\DEV\\DJANGO\\apps\\django\\django\\contrib\\admin\\static\\admin\\css\\ie.cs\ns'\n[etc .... ]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut the path \u003ccode\u003eF:\\test\\forum\\skins\\default\\media\u003c/code\u003e is wrong, my project is located \nin \u003ccode\u003eF:\\DEV\\DJANGO\\apps\\test\\forum\\skins\\default\\media\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eThen I tried to find the static file:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eF:\\DEV\\DJANGO\\apps\\test\u0026gt; python manage.py findstatic css/main.css\n\nNo matching file found for 'css/main.css'.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut the file exists.\u003c/p\u003e","accepted_answer_id":"23317512","answer_count":"1","comment_count":"5","creation_date":"2014-04-26 11:29:00.673 UTC","favorite_count":"2","last_activity_date":"2017-03-23 09:29:42.297 UTC","last_edit_date":"2017-03-23 09:29:42.297 UTC","last_editor_display_name":"","last_editor_user_id":"219519","owner_display_name":"","owner_user_id":"1994865","post_type_id":"1","score":"3","tags":"python|django","view_count":"2621"} +{"id":"45589772","title":"Error from the SQL syntax","body":"\u003cpre\u003e\u003ccode\u003eSELECT * FROM `111_dossier` AS d\nLEFT JOIN `008_vehicule` AS v\nLEFT JOIN `053_dates` AS da\nLEFT JOIN `descriptif` AS des\n\nWHERE (`d.site_gestion` = 57 OR `d.site_creation` = 57)\nAND `d.etat_dossier` IN(\"V\",\"W\")\nAND year(`da.date_entree`) \u0026gt;= 2014\nAND `v.marque` = \"Tesla\"\nAND `des.C4` LIKE %LONGERON% \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cem\u003e#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to\nuse near 'WHERE (\u003ccode\u003ed.site_gestion\u003c/code\u003e = 57 OR \u003ccode\u003ed.site_creation\u003c/code\u003e = 57)\n AND \u003ccode\u003ed.etat_dossier\u003c/code\u003e IN(' at line 6\u003c/em\u003e\u003c/p\u003e\n\n\u003cp\u003e*\u003c/p\u003e\n\n\u003cp\u003eI'm trying to run this request since 2 hours , can someone help me?\nSorry, I think that it's only a small error in the syntax but I'm a beginner. \u003c/p\u003e\n\n\u003cp\u003eSuggest the changes to be done.\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2017-08-09 11:46:31.83 UTC","last_activity_date":"2017-08-09 14:12:11.83 UTC","last_edit_date":"2017-08-09 14:12:11.83 UTC","last_editor_display_name":"","last_editor_user_id":"6656727","owner_display_name":"","owner_user_id":"8439530","post_type_id":"1","score":"0","tags":"mysql","view_count":"25"} +{"id":"43255732","title":"Pagination DataTable Full Number - No Ellipsis still not showing after initialize plugin","body":"\u003cp\u003eI'm new in using DataTables I have some problem when trying to use pagination. I have initialized plugin pagination but the pagination still doesn't showing on my table, but function like sort table and search I used work. Here is what i'm doing.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003egroupCategory = $('#groupCategory').DataTable({\n searching: true,\n responsive: true,\n \"bSortClasses\": true,\n \"scrollY\": \"470px\",\n \"sDom\": \"ti\",\n \"bPaginate\": true,\n \"pagingType\": \"full_numbers_no_ellipses\"\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd use it on my table by doing\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;table id=\"groupCategory\" class=\"table table-bordered table-hover\"\u0026gt;\n \u0026lt;thead\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;Group\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;Description\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;/thead\u0026gt;\n \u0026lt;tbody\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;Group 1\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;Placeholder 1\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;Group 2\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;Placeholder 2\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;Group 3\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;Placeholder 3\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;Group 4\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;Placeholder 4\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;Group 5\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;Placeholder 5\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;Group 6\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;Placeholder 6\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;Group 7\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;Placeholder 7\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;Group 8\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;Placeholder 8\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;Group 9\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;Placeholder 9\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;Group 1\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;Placeholder 1\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;Group 10\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;Placeholder 10\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;Group 11\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;Placeholder 11\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;Group 12\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;Placeholder 12\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;Group 13\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;Placeholder 13\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;Group 14\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;Placeholder 14\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;Group 15\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;Placeholder 15\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;Group 16\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;Placeholder 16\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;Group 17\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;Placeholder 17\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;Group 18\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;Placeholder 18\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;Group 19\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;Placeholder 19\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;Group 20\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;Placeholder 20\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;/tbody\u0026gt;\n\u0026lt;/table\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOn table information it show that table has data Showing 1 to 10 of 20 entries, but the pagination still not showing. I was declared on my html page\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;script src=\"https://code.jquery.com/jquery-1.12.4.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\n\u0026lt;script src=\"https://cdn.datatables.net/1.10.13/js/jquery.dataTables.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\n\u0026lt;script src=\"https://cdn.datatables.net/plug-ins/1.10.13/pagination/full_numbers_no_ellipses.js\"\u0026gt;\u0026lt;/script\u0026gt;\n\u0026lt;script src=\"https://cdn.datatables.net/1.10.13/js/dataTables.bootstrap.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003ePlease help me\u003c/strong\u003e to solve this\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-04-06 12:49:50.753 UTC","last_activity_date":"2017-04-07 01:56:47.19 UTC","last_edit_date":"2017-04-07 01:56:47.19 UTC","last_editor_display_name":"","last_editor_user_id":"3549014","owner_display_name":"","owner_user_id":"6260343","post_type_id":"1","score":"0","tags":"jquery|plugins|pagination|datatables","view_count":"44"} +{"id":"3008900","title":"How to organize xml data using equivalent to #region / #endregion (outlining) from C# .NET","body":"\u003cp\u003eI'd like to organize my XML data to be collapsable and expandable using a preprocessor command like the \u003ca href=\"http://msdn.microsoft.com/en-us/library/9a1ybwek%28VS.71%29.aspx\" rel=\"noreferrer\"\u003e#region/#endregion\u003c/a\u003e command in C#/.NET. I'm editing this file Visual Studio 2008. \u003c/p\u003e\n\n\u003cp\u003eDoes any such ability exist? I've googled to no avail. The closest I can come to so far is to expand and collapse the tags themselves, so I can collapse between \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;Data\u0026gt; \n(this is collapsed)\n\u0026lt;/Data\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"3046827","answer_count":"3","comment_count":"0","creation_date":"2010-06-09 18:52:11.847 UTC","last_activity_date":"2013-06-10 02:53:40.477 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"181211","post_type_id":"1","score":"7","tags":"c#|xml|visual-studio-2008|region","view_count":"6661"} +{"id":"31895820","title":"DataTables pagination doesn't seem to work with server side data","body":"\u003cp\u003eI do not understand why this pagination doesn't working: \u003cstrong\u003e\u003ca href=\"http://goo.gl/8jexmc\" rel=\"nofollow\"\u003ehttp://goo.gl/8jexmc\u003c/a\u003e\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e jQuery(function($) {\n $('#lista-contatti').DataTable({\n\n \"processing\": true,\n \"serverSide\": true,\n //\"info\": true,\n \"ajax\": {\n url: \"http://www.derattizzazione.info/test/ajax_datatable.cfm\",\n cache: false,\n },\n\n \"columns\": [\n { \"data\": \"id\" },\n { \"data\": \"ute_nominativo\" },\n { \"data\": \"ute_email\" },\n { \"data\": \"ute_data\" },\n { \"data\": \"ute_ip\" },\n { \"data\": \"ute_lista\"},\n { \"data\": \"azioni\" }\n ]\n\n });\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt \u003cstrong\u003eworks only the first page\u003c/strong\u003e, but do not load the next pages. I'm still missing something…\u003c/p\u003e","accepted_answer_id":"31896680","answer_count":"1","comment_count":"0","creation_date":"2015-08-08 15:56:25.67 UTC","last_activity_date":"2015-08-08 17:29:17.373 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1247090","post_type_id":"1","score":"1","tags":"jquery|datatables|datatables-1.10","view_count":"1609"} +{"id":"35763478","title":"MySQL inner join?","body":"\u003cp\u003eI have 3 tables (2 columns)such as\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etable s \nNUM GRADE\n1 A \n2 B \n3 C \n5 D \n\ntable p \nNUM GRADE\n1 B \n2 C \n2 D \n3 A \n\ntable g \nNUM GRADE\n1 A \n3 C \n3 B \n4 D\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to inner join them each other such (on s.NUM=p.NUM=g.NUM) as \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eNUM GRADE \n1 A \n1 B \n1 A \n2 B \n2 C \n2 D \n3 A \n3 C \n3 B \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat should I do?\u003c/p\u003e\n\n\u003cp\u003eThank you\u003c/p\u003e","accepted_answer_id":"35763508","answer_count":"1","comment_count":"0","creation_date":"2016-03-03 04:52:53.267 UTC","last_activity_date":"2016-03-03 05:02:46.177 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5975905","post_type_id":"1","score":"1","tags":"mysql|inner-join","view_count":"44"} +{"id":"20199149","title":"Import binascii Python 2.5.2","body":"\u003cp\u003eI'm trying an example almost straight out of the version 2.5.2 documentation for the Python Library Reference for the function \"a2b_base64()\" which is part of the \"binascii\" module. I am trying to convert a hex number to its binary value. Eventually I need to convert a whole hex file to binary. \u003c/p\u003e\n\n\u003cp\u003eThe function is techniclly for a string, but the error I'm getting says \"NameError : name 'a2b_base64' is not defined\". Any idea why this fails? I wish I could use a more mordern version of Python and avoid the a2b_base64() function, but can't. Thanks. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport binascii\nnum = a2b_base64(\"04\") \nprint num\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-11-25 17:16:11.973 UTC","last_activity_date":"2013-11-25 17:26:16.87 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2994541","post_type_id":"1","score":"1","tags":"python","view_count":"4991"} +{"id":"23460657","title":"CoreData migration in iOS 7","body":"\u003cp\u003eFinally got this migration working, it was a big pain.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://gist.github.com/a6delali/c61a25aa048b8f81fdef\" rel=\"nofollow\"\u003esource code\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eEverything works fine in iOS6 but in iOS7 app crash \u003c/p\u003e","accepted_answer_id":"23501863","answer_count":"1","comment_count":"2","creation_date":"2014-05-04 19:31:24.563 UTC","favorite_count":"1","last_activity_date":"2016-05-11 13:21:43.68 UTC","last_edit_date":"2016-05-11 13:21:43.68 UTC","last_editor_display_name":"user2119340","owner_display_name":"user2119340","post_type_id":"1","score":"1","tags":"xcode|core-data|ios7|core-data-migration","view_count":"953"} +{"id":"45907716","title":"Nesting components in Angular4 (RC5)","body":"\u003cp\u003eGetting into Angular and watching an outdated tutorial which is in fact for Angular2 (y, I know).\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eAngular4:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@NgModule({\n imports: [ BrowserModule ],\n declarations: [ AppComponent , MyChildComponent ],\n bootstrap: [ AppComponent ]\n})\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSeems that this is how you nest components now but isn't there a way to do it how it was done (or similarly) in Angular 2? As in you could import it in the now-deprecated 'directives' property DIRECTLY IN YOUR ROOT COMPONENT (found this really convenient for fast development).\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eAngular2:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@Component({\n selector: 'app-root',\n directives: [MyChildComponent]\n template: '\u0026lt;div\u0026gt;\u0026lt;ChildComponent\u0026gt;\u0026lt;/ChildComponent\u0026gt;\u0026lt;/div\u0026gt;'\n})\nexport class AppComponent {}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eEdit: Here's the MyChildComponent declaration (still part of Angular2):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@Component({\n selector: 'ChildComponent',\n template: '\u0026lt;h2\u0026gt;Child component\u0026lt;/h2\u0026gt;'\n})\nexport class MyChildComponent {}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNote: Omitted the import declarations\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2017-08-27 17:46:14.553 UTC","favorite_count":"1","last_activity_date":"2017-08-27 18:41:20.74 UTC","last_edit_date":"2017-08-27 18:41:20.74 UTC","last_editor_display_name":"","last_editor_user_id":"1263830","owner_display_name":"","owner_user_id":"1263830","post_type_id":"1","score":"1","tags":"angular|deprecated|angular2-directives|angular-components|angular-rc5","view_count":"149"} +{"id":"9228414","title":"Replace text in XamlPackage","body":"\u003cp\u003eI have some text in a RichTextBox. This text includes tags eg: [@TagName!]. I want to replace these tags with some data from a database without losing formatting (fonts, colors, image, etc). I've created a method:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e void ReplaceTagsWithData(FlowDocument doc)\n {\n FileStream fs = new FileStream(\"tmp.xml\", FileMode.Create);\n TextRange trTextRange = \n new TextRange(doc.ContentStart, doc.ContentEnd);\n\n trTextRange.Save(fs, DataFormats.Xaml);\n fs.Dispose();\n fs.Close();\n\n StreamReader sr = new StreamReader(\"tmp.xml\");\n\n string rtbContent = sr.ReadToEnd();\n\n MatchCollection mColl = \n Regex.Matches(rtbContent, \n string.Format(@\"\\{0}+[a-zA-Z]+{1}\", \n prefix, \n postfix));\n\n foreach (Match m in mColl)\n {\n string colname = \n m.Value.Substring(prefix.Length, \n (int)(m.Value.Length - (prefix.Length + postfix.Length)));\n\n rtbContent = rtbContent.Replace(m.Value.ToString(), \n dt.Rows[0][colname].ToString());\n }\n\n rtbEdit.Document = \n new FlowDocument(\n (Section)XamlReader.Load(\n XmlReader.Create(new StringReader(rtbContent))));\n sr.Dispose();\n sr.Close();\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt's quite good but it removes images from content. I know that I should use XamlPackage instead of Xaml but then I can't get it as a plain text. Is there any other solution for this?\u003c/p\u003e\n\n\u003cp\u003eThanks for answers. ;)\u003c/p\u003e\n\n\u003cp\u003e[EDIT: 13-02-2012 02:14(am)]\u003c/p\u003e\n\n\u003cp\u003eMy working solution:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e void ReplaceTagsWithData(RichTextBox rtb)\n{\n FlowDocument doc = rtb.Document;\n\n FileStream fs = new FileStream(\"tmp\", FileMode.Create);\n TextRange trTextRange = new TextRange(doc.ContentStart, doc.ContentEnd);\n trTextRange.Save(fs, DataFormats.Rtf);\n fs.Dispose();\n fs.Close();\n\n StreamReader sr = new StreamReader(\"tmp\");\n string rtbContent = sr.ReadToEnd();\n sr.Dispose();\n sr.Close();\n\n MatchCollection mColl = \n Regex.Matches(rtbContent, \n string.Format(@\"\\{0}+[a-zA-Z]+{1}\", \n prefix, \n postfix));\n\n foreach (Match m in mColl)\n {\n string colname = \n m.Value.Substring(prefix.Length, \n (int)(m.Value.Length - (prefix.Length + postfix.Length)));\n\n rtbContent = rtbContent.Replace(m.Value.ToString(), \n dt.Rows[0][colname].ToString());\n }\n MemoryStream stream = \n new MemoryStream(ASCIIEncoding.Default.GetBytes(rtbContent));\n rtb.SelectAll();\n rtb.Selection.Load(stream, DataFormats.Rtf);\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMaybe it's not the best but it's working correctly. \u003c/p\u003e\n\n\u003cp\u003eIt was solved. But I can't post solution because it is on company server which I can't access anymore.\u003c/p\u003e","answer_count":"4","comment_count":"3","creation_date":"2012-02-10 13:19:48.123 UTC","favorite_count":"4","last_activity_date":"2013-08-06 03:55:22.527 UTC","last_edit_date":"2013-06-21 10:58:09.383 UTC","last_editor_display_name":"","last_editor_user_id":"2006488","owner_display_name":"","owner_user_id":"1175181","post_type_id":"1","score":"41","tags":"c#|wpf|string|flowdocument","view_count":"1989"} +{"id":"14012309","title":"understanding c++11 rvalues, move semantics and performance","body":"\u003cblockquote\u003e\n \u003cp\u003e\u003cstrong\u003ePossible Duplicate:\u003c/strong\u003e\u003cbr\u003e\n \u003ca href=\"https://stackoverflow.com/questions/13857611/what-happens-if-i-return-literal-instead-of-declared-stdstring\"\u003eWhat happens if I return literal instead of declared std::string?\u003c/a\u003e \u003c/p\u003e\n\u003c/blockquote\u003e\n\n\n\n\u003cp\u003eConsider the following code\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e1| string getName () {\n2| return \"meme\";\n3| }\n4| \n5| string name = getName();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe function getName() returns a temporary object. In c++03, I understand the copy constructor of \"string\" gets called and the temporary object is destroyed. Actually it seems compiler (atleast in gcc 4.7) optimizes line 5 by not creating the object \"name\" but replacing it with the temporary object itself and not destroying the temporary object (I tried with a MyVector class; not std::string).\u003c/p\u003e\n\n\u003cp\u003eAs defined in C++11 standards,\u003cbr\u003e\n 1. Is getName() returning an rvalue?\u003cbr\u003e\n 2. In line 5 above, which constructor of string gets called (move or copy) ? Should I necessarily call std::move() for the move constructor to get called?\u003cbr\u003e\n 3. With move semantics, is it less efficient then the \"copy elision\" optimization provided by the compiler?\u003c/p\u003e","accepted_answer_id":"14012334","answer_count":"1","comment_count":"4","creation_date":"2012-12-23 15:45:04.117 UTC","favorite_count":"4","last_activity_date":"2012-12-26 16:51:05.203 UTC","last_edit_date":"2017-05-23 12:27:40.637 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"420996","post_type_id":"1","score":"11","tags":"c++|c++11","view_count":"386"} +{"id":"35731441","title":"Numeric expression in if condition of awk","body":"\u003cp\u003ePretty new to AWK programming. I have a file1 with entries as:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e15\u0026gt;000000513609200\u0026gt;000000513609200\u0026gt;B\u0026gt;I\u0026gt;0011\u0026gt;\u0026gt;238/PLMN/000100\u0026gt;File Ef141109.txt\u0026gt;0100-75607-16156-14 09-11-2014\n15\u0026gt;000000513609200\u0026gt;000000513609200\u0026gt;B\u0026gt;I\u0026gt;0011\u0026gt;Danske Politi\u0026gt;238/PLMN/000200\u0026gt;\u0026gt;0100-75607-16156-14 09-11-2014\n15\u0026gt;000050354428060\u0026gt;000050354428060\u0026gt;B\u0026gt;I\u0026gt;0011\u0026gt;Danske Politi\u0026gt;238/PLMN/000200\u0026gt;\u0026gt;4100-75607-01302-14 31-10-2014\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to write a awk script, where if 2nd field subtracted from 3rd field is a 0, then it prints field 2. Else if the (difference \u003e 0), then it prints all intermediate digits incremented by 1 starting from 2nd field ending at 3rd field. There will be no scenario where 3rd field is less than 2nd. So ignoring that condition.\u003c/p\u003e\n\n\u003cp\u003eI was doing something as:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e awk 'NR \u0026gt; 2 { print p } { p = $0 }' file1 | awk -F\"\u0026gt;\" '{if ($($3 - $2) == 0) print $2; else l = $($3 - $2); for(i=0;i\u0026lt;l;i++) print $2++; }'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e(( Someone told me awk is close to C in terms of syntax ))\u003c/p\u003e\n\n\u003cp\u003eBut from the output it looks to me that the String to numeric or numeric to string conversions are not taking place at right place at right time. Shouldn't it be taken care by AWK automatically ?\u003c/p\u003e\n\n\u003cp\u003eThe OUTPUT that I get:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e513609200\n513609201\n513609200\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhich is not quiet as expected. One evident issue is its ignoring the preceding 0s.\u003c/p\u003e\n\n\u003cp\u003eKindly help me modify the AWK script to get the desired result.\u003c/p\u003e\n\n\u003cp\u003eNOTE:\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eawk 'NR \u0026gt; 2 { print p } { p = $0 }' file1\u003c/code\u003e is just to remove the 1st and last entry in my original file1. So the part that needs to be fixed is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eawk -F\"\u0026gt;\" '{if ($($3 - $2) == 0) print $2; else l = $($3 - $2); for(i=0;i\u0026lt;l;i++) print $2++; }'\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"35731748","answer_count":"3","comment_count":"5","creation_date":"2016-03-01 19:13:39.39 UTC","last_activity_date":"2016-03-02 06:01:08.01 UTC","last_edit_date":"2016-03-01 19:42:21.85 UTC","last_editor_display_name":"","last_editor_user_id":"1072112","owner_display_name":"","owner_user_id":"540665","post_type_id":"1","score":"0","tags":"regex|linux|bash|shell|awk","view_count":"88"} +{"id":"2377493","title":"ASP.NET MVC - problem logically undertanding how to structure a report section","body":"\u003cp\u003eThe problem: Using ASp.NET MVC for reporting.\u003c/p\u003e\n\n\u003cp\u003eGiven:\n 1. A report that is tabular in output, so it can easiyl be represented by a class (static field list).\n 2. A filter mask containing halfa dozen or more possible conditions to apply to the data.\u003c/p\u003e\n\n\u003cp\u003eHow is the approach for the MVC file layout?\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eI would say one controller for the complete report.\u003c/li\u003e\n\u003cli\u003eBut how does the model look? One property with all the filter conditiond (or: a property per filter condition), one property with an enumeration of results?\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eI would also love to do a redirect when the search parameters change and would love to see the parameters as parameters (i.e. the URL ending in /Reports/Assets?From=...\u0026amp;To=...) so users can bookmark a specific favourite report or email the URL around.\u003c/p\u003e\n\n\u003cp\u003eHow to do? I have a lon gbackground in ASP.NET, but MVC somehow eludes me ;)\u003c/p\u003e","accepted_answer_id":"2377898","answer_count":"1","comment_count":"0","creation_date":"2010-03-04 07:25:00.543 UTC","last_activity_date":"2010-03-04 08:50:39.55 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"285465","post_type_id":"1","score":"0","tags":"asp.net-mvc","view_count":"107"} +{"id":"21129822","title":"OpenERP7.0 form_view_ref can't ref inherit view","body":"\u003cpre\u003e\u003ccode\u003e \u0026lt;field name=\"move_lines_qc\" context=\"{'zuhu_id': supplier_id, 'form_view_ref':'view_stock_qc_form', 'tree_view_ref':'view_jp_stock_qc_tree'}\" options='{\"reload_on_button\": true}'/\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe above records in my definition of view,\"form_view_ref\" need ref another view view_stock_qc_form, \u003c/p\u003e\n\n\u003cp\u003einheritance\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;record id=\"view_stock_qc_form\" model=\"ir.ui.view\"\u0026gt;\n \u0026lt;field name=\"name\"\u0026gt;jp.stock.qc.form\u0026lt;/field\u0026gt;\n \u0026lt;field name=\"model\"\u0026gt;jp.stock.qc\u0026lt;/field\u0026gt;\n \u0026lt;field name=\"inherit_id\" ref=\"view_jp_move_picking_form\"/\u0026gt;\n \u0026lt;field name=\"arch\" type=\"xml\"\u0026gt;\n \u0026lt;xpath expr=\"//field[@name='product_number']\" position=\"replace\"\u0026gt;\n \u0026lt;field name=\"product_number\" string=\"From\"/\u0026gt;\n \u0026lt;/xpath\u0026gt;\n \u0026lt;/field\u0026gt;\n \u0026lt;/record\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eno inheritance\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;record id=\"view_stock_qc_form\" model=\"ir.ui.view\"\u0026gt;\n \u0026lt;field name=\"name\"\u0026gt;jp.stock.qc.form\u0026lt;/field\u0026gt;\n \u0026lt;field name=\"model\"\u0026gt;jp.stock.qc\u0026lt;/field\u0026gt;\n \u0026lt;field name=\"arch\" type=\"xml\"\u0026gt;\n \u0026lt;form string=\"Stock Moves\" version=\"7.0\"\u0026gt;\n \u0026lt;header\u0026gt;\n \u0026lt;/header\u0026gt;\n \u0026lt;group\u0026gt;\n \u0026lt;group\u0026gt;\n \u0026lt;field name=\"product_id\" on_change=\"onchange_product_id(product_id)\" domain=\"[('zuhu_id','=',zuhu_id)]\" context=\"{'default_zuhu_id':zuhu_id}\" /\u0026gt;\n \u0026lt;field name=\"product_number\" /\u0026gt;\n \u0026lt;field name=\"specifications\" /\u0026gt;\n \u0026lt;field name=\"unqualified\" /\u0026gt;\n \u0026lt;field name=\"instruction\" /\u0026gt;\n \u0026lt;/group\u0026gt;\n \u0026lt;group\u0026gt;\n \u0026lt;field name=\"product_qty\"/\u0026gt;\n \u0026lt;field name=\"product_qty_fact\" /\u0026gt;\n \u0026lt;field name=\"product_uom\"/\u0026gt;\n \u0026lt;field name=\"create_date\" invisible=\"1\"/\u0026gt;\n \u0026lt;field name=\"date\"/\u0026gt;\n \u0026lt;/group\u0026gt;\n \u0026lt;/group\u0026gt;\n \u0026lt;/form\u0026gt;\n \u0026lt;/field\u0026gt;\n \u0026lt;/record\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf there is no inheritance, can be related.while, inheritance ,it ref the default.I want inherit , What should I do?\u003c/p\u003e","answer_count":"0","comment_count":"4","creation_date":"2014-01-15 05:35:22.67 UTC","last_activity_date":"2014-01-15 05:35:22.67 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3132013","post_type_id":"1","score":"0","tags":"python-2.7|inheritance|openerp-7","view_count":"180"} +{"id":"5729278","title":"Why shouldn't I use GC.Collect()","body":"\u003cp\u003eI am developing an application where I work with CertAdm.dll to make connections to a Certificate Authority. Sometimes I get the error \u003cstrong\u003e\"An attempt was made to open a Certification Authority database session, but there are already too many active sessions. The server may need to be configured to allow additional sessions.\"\u003c/strong\u003e \u003c/p\u003e\n\n\u003cp\u003eIf I configure my connection like the code below, I dont get the error and all works fine.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCERTADMINLib.ICertView2 cv2 = new CERTADMINLib.CCertViewClass();\n\ntry\n{\n cv2.OpenConnection(srtCAConfig);\n}\ncatch\n{\n GC.Collect();\n GC.WaitForPendingFinalizers();\n cv2.OpenConnection(srtCAConfig);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow what I am wondering about is that I have read a lot where people say you shouldn't use GC.Collect(). Why shouldn't I? It solves my problem?\u003c/p\u003e\n\n\u003cp\u003eAll help is very appreciated.\u003c/p\u003e","answer_count":"3","comment_count":"3","creation_date":"2011-04-20 11:07:30.763 UTC","favorite_count":"1","last_activity_date":"2013-06-05 13:33:25.453 UTC","last_edit_date":"2013-06-05 13:33:25.453 UTC","last_editor_display_name":"","last_editor_user_id":"548036","owner_display_name":"","owner_user_id":"717002","post_type_id":"1","score":"0","tags":"c#|.net|garbage-collection|certificate-authority","view_count":"915"} +{"id":"14111975","title":"PHP for loop return single value","body":"\u003cp\u003eI want to make the for loop to return a single value (TRUE/FALSE). But the code returns multiple value. Like TRUETRUETRUE. I understand the code but didn't have any idea to do it.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic function user_activation_check(){\n for($i=1;$i\u0026lt;5;$i++){\n $query = $this-\u0026gt;db-\u0026gt;query(\"SELECT group_info.member\".$i.\" FROM `group_info` INNER JOIN `user_student` ON group_info.member$i=user_student.email WHERE user_student.email=group_info.member$i\");\n if($query-\u0026gt;num_rows()==1){\n //return TRUE;\n echo\"true\";\n }else {\n //return FALSE;\n echo\"false\";\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHelp please.\u003c/p\u003e\n\n\u003cp\u003eUPDATE:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic function member_activation(){\n if($this-\u0026gt;model_users-\u0026gt;user_activation_check()){\n $this-\u0026gt;load-\u0026gt;view('v_confirm_group');\n }else echo \"Some members didn't activate their account.\";\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"14112330","answer_count":"3","comment_count":"6","creation_date":"2013-01-01 16:12:13.82 UTC","last_activity_date":"2013-01-01 16:59:24.22 UTC","last_edit_date":"2013-01-01 16:34:46.703 UTC","last_editor_display_name":"","last_editor_user_id":"1369057","owner_display_name":"","owner_user_id":"1369057","post_type_id":"1","score":"1","tags":"php|loops|for-loop|return-value","view_count":"1197"} +{"id":"1917991","title":"get word before a :- sign in a string with regex","body":"\u003cp\u003eI need to get the amount before a :- sign.\nSo the string would be: bla bla 120:-\u003c/p\u003e\n\n\u003cp\u003eAnd then store only 120 in a variable\u003c/p\u003e","accepted_answer_id":"1918002","answer_count":"2","comment_count":"0","creation_date":"2009-12-16 21:45:47.923 UTC","last_activity_date":"2009-12-16 21:50:38.82 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"228720","post_type_id":"1","score":"1","tags":"php|regex|string","view_count":"489"} +{"id":"23595569","title":"How to open pdf saved locally on windows server through hyperlink present inside a jsp page?","body":"\u003cp\u003eI have tried each and every post on stackoverflow but i am unable to open a pdf file neither in IE nor in mozilla firefox.I am new to JSP and servlets so i will be needing help with the code too.Please tell me a way to how to open pdf file saved locally on windows server through hyperlink present inside a jsp page?Write now the website is hosted using tomcat on windows server and client is that same server.\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2014-05-11 17:14:32.647 UTC","last_activity_date":"2014-05-11 17:48:07.38 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3626042","post_type_id":"1","score":"0","tags":"java|jsp|pdf","view_count":"811"} +{"id":"34374248","title":"Dashboard shows close to 100% CPU load, but actual usage is different","body":"\u003cp\u003eDuring peak hours of our service, I notice the CPU load goes up to 100%. However, when I SSH into the machine and use top or htop, I don't ever see the CPU usage go above 25%. This instance is a dedicated load balancer running HAProxy.\u003c/p\u003e\n\n\u003cp\u003eHere is a screenshot of the Dashboard: \u003ca href=\"https://gyazo.com/010715208f81ec97c1bc9b78123fe4d4\" rel=\"nofollow\"\u003ehttps://gyazo.com/010715208f81ec97c1bc9b78123fe4d4\u003c/a\u003e\nHere is a screenshot of \u003ccode\u003etop\u003c/code\u003e in the instance: \u003ca href=\"https://gyazo.com/afa7098331f7a3f66c018041b9be686d\" rel=\"nofollow\"\u003ehttps://gyazo.com/afa7098331f7a3f66c018041b9be686d\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eDuring these peak times, I noticed there are some latency and this is not caused by database or my other server instances as I checked their loads and were far below threshold. I was wondering if Compute Engine is throttling by mistaking it is at 100% CPU usage or something?\u003c/p\u003e\n\n\u003cp\u003eHas anyone had a similar experience?\u003c/p\u003e","answer_count":"0","comment_count":"4","creation_date":"2015-12-19 18:56:02.403 UTC","last_activity_date":"2015-12-19 18:56:02.403 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4726782","post_type_id":"1","score":"0","tags":"load-balancing|google-compute-engine|haproxy","view_count":"232"} +{"id":"19871119","title":"Error when Compiling Oracle Package Body","body":"\u003cp\u003eThe Package Specification succesfully Compiles with the message \"SPBomPackage Compiled\" But i have two errors when compiling the package body they are as follows, \"Error(17,6): PL/SQL: Statement ignored\" and \"Error(17,17): PLS-00302: component 'ITEM_ID' must be declared\" ,\n the package specification, package body, and the three tables im using that this package will use are pasted and formatted nicely for you to view at this link: \u003c/p\u003e","accepted_answer_id":"19872077","answer_count":"2","comment_count":"0","creation_date":"2013-11-09 01:03:20.807 UTC","last_activity_date":"2013-11-09 22:20:15.973 UTC","last_edit_date":"2013-11-09 22:20:15.973 UTC","last_editor_display_name":"","last_editor_user_id":"2970892","owner_display_name":"","owner_user_id":"2970892","post_type_id":"1","score":"0","tags":"database|oracle|package","view_count":"755"} +{"id":"25767200","title":"How to get all the variables that were added to any constraint in a Solver?","body":"\u003cp\u003eI am using Z3py and trying to get the set of all the variables in any constraint in a Solver. I can call \u003ccode\u003eSolver.assertions()\u003c/code\u003e to get an \u003ccode\u003eASTVector\u003c/code\u003e, then loop over this vector and get objects of type \u003ccode\u003eBoolRef\u003c/code\u003e, for example, but then I'm stuck. How can I recursively iterate over an assertion, a \u003ccode\u003eBoolRef\u003c/code\u003e instance for example, to get the individual variables?\u003c/p\u003e","accepted_answer_id":"26069649","answer_count":"1","comment_count":"1","creation_date":"2014-09-10 13:50:19.23 UTC","last_activity_date":"2014-09-26 23:22:10.003 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3816920","post_type_id":"1","score":"1","tags":"z3|z3py","view_count":"104"} +{"id":"39883080","title":"iis 7 Error 500 Internal Server Error","body":"\u003cp\u003eI have a php website whose server is iis 7. When the website is on a Server 2008 32-bit platform, the error is thrown. If I move the page to another directory, the error follows. Yet on my developmentserver, a 64 bit machine, with the very same code, there is no error. I am perplexed and looking for solutions.\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2016-10-05 20:26:17.22 UTC","last_activity_date":"2016-10-05 20:26:17.22 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5697042","post_type_id":"1","score":"0","tags":"php|iis-7|windows-server-2008","view_count":"99"} +{"id":"47590823","title":"create graph from data frame in r","body":"\u003cp\u003eI Have data frame representing a grn network.gene in column 1 is connected to gene in column 2 if column3 (link) is set to 1. I run this code but the resulting graph is not correct.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e x \u0026lt;- data.frame(\"g1\" = c(1,1,1,2,2,3), \"g2\" = c(2,3,4,3,4,4), \"link\" = c(1,0,1,1,0,0))\n g = graph_from_data_frame(x,x$link==1)\n tkplot(g)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ehow can get correct corresponding graph from this data frame?\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-12-01 09:58:04.767 UTC","last_activity_date":"2017-12-01 09:58:04.767 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"8927927","post_type_id":"1","score":"1","tags":"r|dataframe|networking|graph|igraph","view_count":"25"} +{"id":"21809812","title":"a simple excel command or a program that updates value?","body":"\u003cp\u003eI would like to beg for my stupidity, bear with me, I am very new!\u003c/p\u003e\n\n\u003cp\u003eI will try to make it as clear as possible. \u003c/p\u003e\n\n\u003cp\u003eI want to create a excel program or possibly just do it with excel, that I can use for my business.\u003c/p\u003e\n\n\u003cp\u003eLet's say I have a customer that prepaid $100. He purchased $3 the first day and $8 the next day. \u003c/p\u003e\n\n\u003cp\u003eI would have a value of $100. I subtract $3 then the $100 would become $97. Then subtract $8 so it would become $89. So basically, it keeps updates the amount.\u003c/p\u003e\n\n\u003cp\u003eI couldn't figure how to do this in excel. Is there a way to allow this in excel? or do I have to make a excel workbook or excel template using commands?\u003c/p\u003e\n\n\u003cp\u003eI would love to get help from professionals!\u003c/p\u003e","accepted_answer_id":"21810431","answer_count":"1","comment_count":"3","creation_date":"2014-02-16 10:09:19.333 UTC","last_activity_date":"2014-02-16 11:22:29.683 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3315616","post_type_id":"1","score":"0","tags":"excel|excel-vba|excel-formula","view_count":"41"} +{"id":"3994029","title":"calling C/C++ functions of a library compiled with g++, wthin a program compiled with gcc","body":"\u003cp\u003eI have a set of software library modules which are developed in c++. So, I use g++ to compile my software.\u003c/p\u003e\n\n\u003cp\u003eThis has to be used by various existing applications which are written in C and compiled with gcc.\u003c/p\u003e\n\n\u003cp\u003eWhen the other teams used g++ to compile their code, they started getting lot of compiler errors due to strict type checking rules of c++. This broke their applications. Worse still, they are using some 3rd party library code, which cannot be compiled using g++.\u003c/p\u003e\n\n\u003cp\u003eif they use gcc, then there are linker errors (unresolved symbols).\u003c/p\u003e\n\n\u003cp\u003eso, my question is...\n\"Is there a way for my library code to be linked with their applications, without changing the respective compilers? That is, i still have to use g++, since i use classes/objects heavily in my code, and they have no choice of using g++, which will break their application?\".\u003c/p\u003e\n\n\u003cp\u003eThank you for kind help.\u003c/p\u003e\n\n\u003cp\u003eregards,\nRavindra\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2010-10-22 05:04:37.707 UTC","last_activity_date":"2010-10-22 05:16:43.687 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"483820","post_type_id":"1","score":"2","tags":"gcc|g++","view_count":"998"} +{"id":"31450750","title":"Accordion in jQuery","body":"\u003cp\u003eHi I am working on an accordion I would like to know if there is a cleaner way of toggling the \"plus\" and \"minus\" signs. Bellow is the code and a link to a prototype.\u003c/p\u003e\n\n\u003cp\u003ejQuery\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(\".discount-wrapper h2\").on(\"click\", function() {\n $(this).children('.plus-sign').toggle();\n $(this).parent().children(\".discount-content-wrapper\").toggle('slow');\n $(this).children('.minus-sign').toggle();\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHTML\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"discount-wrapper\"\u0026gt;\n \u0026lt;h2\u0026gt;Accordion 3\u0026lt;i class=\"plus-sign\"\u0026gt;+\u0026lt;/i\u0026gt;\u0026lt;i class=\"minus-sign\" style=\"display:none;\"\u0026gt;-\u0026lt;/i\u0026gt;\u0026lt;/h2\u0026gt;\n \u0026lt;div class=\"discount-content-wrapper\"\u0026gt;\n \u0026lt;p\u0026gt;My content is here\u0026lt;/p\u0026gt;\n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u0026lt;div class=\"discount-wrapper\"\u0026gt;\n \u0026lt;h2\u0026gt;Accordion 3\u0026lt;i class=\"plus-sign\"\u0026gt;+\u0026lt;/i\u0026gt;\u0026lt;i class=\"minus-sign\" style=\"display:none;\"\u0026gt;-\u0026lt;/i\u0026gt;\u0026lt;/h2\u0026gt;\n \u0026lt;div class=\"discount-content-wrapper\"\u0026gt;\n \u0026lt;p\u0026gt;My content is here\u0026lt;/p\u0026gt;\n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003ca href=\"https://jsfiddle.net/ferrazzzZ/3c7qf3aa/2/\" rel=\"nofollow\"\u003ehttp://jsfiddle.net/\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"31451034","answer_count":"2","comment_count":"0","creation_date":"2015-07-16 09:45:17.893 UTC","last_activity_date":"2015-07-16 10:06:10.893 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3335000","post_type_id":"1","score":"0","tags":"jquery","view_count":"61"} +{"id":"32857652","title":"Jquery Slide function","body":"\u003cp\u003eI've been a little confused as how I'm supposed to connect my jquery to my page, and I'm still still relatively new to learning javascript/jquery. When I put the script in the head nothing happens when I click on the I have set up in my file below. But on my jfiddle it works fine. \u003c/p\u003e\n\n\u003cp\u003eI have a portion of my site where I want to have a mock iphone where people who visit the page can click on it.\u003c/p\u003e\n\n\u003cp\u003eI used this jfiddle I found on stack overflow:\n\u003ca href=\"https://stackoverflow.com/questions/15658858/how-to-make-div-slide-from-right-to-left\"\u003ehow to make div slide from right to left\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThere's a link that goes to jqueryui and shows the script for the slide effect there. Am I supposed to use this in the head?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;link rel=\"stylesheet\" href=\"//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css\"\u0026gt;\n \u0026lt;script src=\"//code.jquery.com/jquery-1.10.2.js\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;script src=\"//code.jquery.com/ui/1.11.4/jquery-ui.js\"\u0026gt;\u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is my jfiddle that I tweaked slightly as to what I'm looking to achieve:\n\u003ca href=\"http://jsfiddle.net/tokyothekid/weujtht5/\" rel=\"nofollow noreferrer\"\u003ehttp://jsfiddle.net/tokyothekid/weujtht5/\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eHere's my current code in the head:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;link rel=\"stylesheet\"href=\"//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css\"\u0026gt;\n \u0026lt;script src=\"//code.jquery.com/jquery-1.10.2.js\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;script src=\"//code.jquery.com/ui/1.11.4/jquery-ui.js\"\u0026gt;\u0026lt;/script\u0026gt;\n\n\n\u0026lt;script\u0026gt;\n$( document ).click(function() {\n $('#iphone-button1').click(function(){\n\n if ($('#iphone-panel2').is(':hidden')) {\n\n $('#iphone-panel2').show('slide',{direction:'right'},1000);\n } else {\n\n $('#iphone-panel2').hide('slide',{direction:'right'},1000);\n }\n});\n \u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is my html:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;div id=\"iphone-panel1\"\u0026gt;\n logo \n \u0026lt;a id=\"iphone-button1\"\u0026gt;start\u0026lt;/a\u0026gt;\n \u0026lt;/div\u0026gt;\n\u0026lt;div id=\"iphone-panel2\"\u0026gt;User Area\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy CSS:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#iphone-panel1{\n width:200px;\n height:200px;\n position:absolute;\n}\n\na {\n color: #000;\n cursor:pointer;\n display:block;\n}\n#iphone-panel2 {\n width: 200px;\n height: 200px;\n display: none;\n background: red;\n position:relative;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAppreciate all the help\u003c/p\u003e","answer_count":"0","comment_count":"4","creation_date":"2015-09-30 04:10:23.947 UTC","last_activity_date":"2015-09-30 04:10:23.947 UTC","last_edit_date":"2017-05-23 11:58:25.357 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"4648501","post_type_id":"1","score":"0","tags":"jquery|jquery-ui","view_count":"40"} +{"id":"19107683","title":"Speed up clojure startup time with nailgun","body":"\u003cp\u003eEvery now and then I think it would be nice to use \u003ccode\u003eclojure\u003c/code\u003e for \u003cem\u003eshell scripts\u003c/em\u003e, but a startup time of about 900ms is way too slow. I'd then \u003cstrike\u003egoogle\u003c/strike\u003e\u003ca href=\"https://startpage.com/\" rel=\"noreferrer\"\u003estartpage\u003c/a\u003e for \"nailgun clojure\", but the only results that show up are for special cases like vimclojure. That's when I, pretending not to have time, turn to more \u003ccode\u003eawk\u003c/code\u003eward languages that start up faster.\u003c/p\u003e\n\n\u003cp\u003eSo, how can \u003ccode\u003enailgun\u003c/code\u003e be used to speed up the startup time of clojure?\u003c/p\u003e","accepted_answer_id":"19107684","answer_count":"1","comment_count":"0","creation_date":"2013-10-01 03:57:07.067 UTC","favorite_count":"5","last_activity_date":"2013-11-27 05:18:15.487 UTC","last_edit_date":"2013-10-01 05:09:55.823 UTC","last_editor_display_name":"","last_editor_user_id":"709537","owner_display_name":"","owner_user_id":"709537","post_type_id":"1","score":"9","tags":"shell|clojure|startup|nailgun","view_count":"1839"} +{"id":"43608547","title":"Camera Calibration using OpenCV2 and Python 2.7 / cv2.findChessboardCorners","body":"\u003cp\u003eI am trying to do a multipectral camera calibration using \u003cstrong\u003eOpen Cv2\u003c/strong\u003e and \u003cstrong\u003ePython 2.7\u003c/strong\u003e, and the code is working well with the pictures that I have from the 3 monochrome sensors (RED, NIR, and GRE) and the RGB ones. The only pictures that are not working in the code are the pictures from the REG sensor (Red Green).\u003c/p\u003e\n\n\u003cp\u003eThe code \u003cstrong\u003ereads the pictures\u003c/strong\u003e, \u003cstrong\u003econverts them to gray\u003c/strong\u003e and then \u003cstrong\u003efinds the corners\u003c/strong\u003e, \u003cstrong\u003ethe SubPixels\u003c/strong\u003e, and finally producres a \u003cstrong\u003ecamera calibration matrix\u003c/strong\u003e. \u003c/p\u003e\n\n\u003cp\u003eI have built the code with multiple print in each part so that I will know which is the exact part that is not working, so I know that it is not working for the REG case in the \u003cstrong\u003ecv2.findChessboardCorners\u003c/strong\u003e line. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e ret, Bords_Trouves = cv2.findChessboardCorners(Images_en_gris, Lignes_et_Collones, None)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo my question is :\u003c/p\u003e\n\n\u003cp\u003eWhat's not working in the code ? Or is it a problem with the REG sensor pictures, I would have to try another approach to convert them to gray ? Or what ? \u003c/p\u003e\n\n\u003cp\u003eHere is all the code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e # -*- coding: utf-8 -*-\nimport numpy as np\nimport cv2\nimport glob\nimport math\nimport pickle\nimport matplotlib.pyplot as plt\n\n\ncritere = (cv2.TERM_CRITERIA_MAX_ITER | cv2.TERM_CRITERIA_COUNT, 10, 0.01)\n\nLignes = 13\nCollones = 13\nCollones_et_Lignes = (Collones, Lignes)\nLignes_et_Collones = (Lignes, Collones)\n\nPoints_Reels = np.zeros((Lignes*Collones, 3), np.float32)\nPoints_Reels[:, :2] = np.mgrid[0:Lignes, 0:Collones].T.reshape(-1, 2)\n\n# Préparer deux tableaux pour sauvegarder les points objet et points images de totues les images trouvées.\nTableau_points_reels = []\nTableau_points_imaginaires = []\n\n# Les photos du damier qu'on a pris pour le test\nSource = \"C:/Users/Mourad/Desktop/Calib1804/REG/\"\nMes_Images = glob.glob(Source + '*.TIF')\n\nprint \"les images ont bien étaient récupérées.\" if Mes_Images else \"PROBLEME: images non récupérés !! \"\n\nfor leo, fname in enumerate(Mes_Images):\n print(\"Image : \" + fname)\n #if leo \u0026gt; 10:\n # break\n image_originale = cv2.imread(fname)\n\n Images_en_gris = cv2.cvtColor(image_originale, cv2.COLOR_BGR2GRAY)\n\n print \"les images ont bien étaient transformés en gris.\" if Images_en_gris.all() else \"PROBLEME: images non transformés en gris!! \"\n\n ret, Bords_Trouves = cv2.findChessboardCorners(Images_en_gris, Lignes_et_Collones, None)\n\n print str(len(Bords_Trouves)) + \" Bords trouvés\" if ret else \"PROBLEME: Bords Non trouvés !!\"\n\n Tableau_points_reels.append(Points_Reels)\n\n PL = (11, 11)\n\n Plus_de_precision = cv2.cornerSubPix(Images_en_gris, Bords_Trouves[1], PL, (-1, -1), critere)\n\n\n print \"Sub pixels trouvées\" if Plus_de_precision else \"PROBLEME: Pas de sub pixels trouvées\"\n\n Tableau_points_imaginaires.append(Bords_Trouves)\n\n # far = cv2.drawChessboardCorners(image_originale, Lignes_et_Collones, Bords_Trouves, ret)\n\n #cv2.imshow(\"Bords trouvées déssinés sur l'image originale\", image_originale)\n #cv2.waitKey(500)\n #()\nprint \"Nombre de points réels trouvés: \" + str(len(Tableau_points_reels))\nprint \"Nombres de points imaginaires trouvés: \" + str(len(Tableau_points_imaginaires))\n\nh, w = Images_en_gris.shape[:2]\n\nderik, matrice, distortion, vecteur_de_rotation, vecteur_de_translation = cv2.calibrateCamera(Tableau_points_reels, Tableau_points_imaginaires, (w, h), None, None, flags=cv2.CALIB_RATIONAL_MODEL)\n\nprint \"La matrice de calibration est: \"\nprint matrice\nprint \"La distortion est egale a: \"\nprint distortion\nprint \"Le vecteur de rotation est egal a: \"\nprint vecteur_de_rotation\nprint \"Le vecteur de translation est egal a: \"\nprint vecteur_de_translation\n\nprint \"\\n La matrice de calibration trouvée et données récupérés\" if derik else \"PROBLEME: Pas de calibration\"\n\nnewcameramtx, roi = cv2.getOptimalNewCameraMatrix(matrice, distortion, (w, h), 1, (w, h))\n\n# undistortion\nImage_calibree = cv2.undistort(image_originale, matrice, distortion, None, newcameramtx)\n\nfgh = cv2.imread(\"C:/Users/Mourad/Desktop/Calib1804/RGB/IMG_700101_000800_0000_RGB.JPG\")\n\nh, w = fgh.shape[:2]\n\nx, y, w, h = roi\nImage_calibree = Image_calibree[y:y+h, x:x+w]\ncv2.imwrite('Desktop/imagecalibre.png', Image_calibree)\n\nplt.subplot(121), plt.imshow(fgh), plt.title('image originale')\nplt.subplot(122), plt.imshow(Image_calibree), plt.title('image calibree')\nplt.show()\n\nErreur_totale = 0\nfor i in xrange(len(Tableau_points_reels)):\n imgpoints2, _ = cv2.projectPoints(Tableau_points_reels[i], vecteur_de_rotation[i], vecteur_de_translation[i], matrice, distortion)\n Erreur = cv2.norm(Tableau_points_imaginaires[i], imgpoints2, cv2.NORM_L2)/len(imgpoints2)\n Erreur_totale += Erreur\n print \"Erreur totale: \", Erreur_totale/len(Tableau_points_reels)\n\ncv2.destroyAllWindows()\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-04-25 10:47:03.083 UTC","last_activity_date":"2017-10-10 14:58:57.647 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7851433","post_type_id":"1","score":"0","tags":"python-2.7|opencv","view_count":"78"} +{"id":"28904546","title":"XmlSerializer - There was an error reflecting type - error deserializing","body":"\u003cp\u003eI have an error when trying to deserialize an xml\nI have a set of classes that are prepared to receive this xml:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;raiz\u0026gt;\n \u0026lt;propiedad1\u0026gt;\n \u0026lt;p1\u0026gt;\u0026lt;/p1\u0026gt;\n \u0026lt;p2\u0026gt;\n \u0026lt;p21\u0026gt;\u0026lt;/p21\u0026gt;\n \u0026lt;p22\u0026gt;\u0026lt;/p22\u0026gt;\n \u0026lt;/p2\u0026gt;\n \u0026lt;/propiedad1\u0026gt;\n\u0026lt;/raiz\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut, if my code receives an XML that don't include tag then I get the following exception: \"There was an error reflecting type p2\"\u003c/p\u003e\n\n\u003cp\u003ethis is my code to deserialize:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar obj = new System.Xml.Serialization.XmlSerializer(typeof(Y));\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethanks in advance for your help\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2015-03-06 17:43:10.693 UTC","last_activity_date":"2015-03-06 17:43:10.693 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4176039","post_type_id":"1","score":"0","tags":"c#|xml|deserialization|xml-deserialization","view_count":"348"} +{"id":"35851598","title":"Finding the most repeated value for each associated attribute","body":"\u003cp\u003e\u003cbr\u003e\u003c/p\u003e\n\n\u003cp\u003eI'm practicing some SQL and I thought about the following problem:\u003c/p\u003e\n\n\u003cp\u003eFor each pub find the time when more people go.\nI have the following tables:\u003c/p\u003e\n\n\u003cpre\u003e\n GOESTO\nid_person id_pub time\n1 1 Daytime\n2 2 Night time\n3 3 All Day\n4 1 Daytime\n5 2 Night time\n6 1 All Day\n7 3 Daytime\n8 3 Night time\n9 3 Night time\n10 1 Night time\n\u003c/pre\u003e\n\n\u003cpre\u003e\n PUB\nid_pub pub_name cost\n1 pub1 123\n2 pub2 324\n3 pub3 345\n\n\u003c/pre\u003e\n\n\u003cp\u003eWhat I want to get is something like the following:\u003c/p\u003e\n\n\u003cpre\u003e\npub_name time\n\u003c/pre\u003e\n\n\u003cp\u003eI think I should use MAX and COUNT functions, but I'm not quite sure how should I do it. It should work in an Oracle database.\u003c/p\u003e\n\n\u003cp\u003eThank you!\u003c/p\u003e","accepted_answer_id":"35852549","answer_count":"1","comment_count":"1","creation_date":"2016-03-07 18:50:49.287 UTC","last_activity_date":"2016-03-07 19:47:39.56 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5431633","post_type_id":"1","score":"0","tags":"sql|oracle","view_count":"39"} +{"id":"7331630","title":"How can I make rails.js re-apply the same magic to new forms that are loaded dynamically?","body":"\u003cp\u003eFor my understanding rails.js do some magic to my forms (that have \":remote =\u003e true\") to transform them into ajax form once the page is loaded.\u003c/p\u003e\n\n\u003cp\u003eWhen one of these forms is submitted, it is replaced with a new form.\u003c/p\u003e\n\n\u003cp\u003eHow can I make rails.js re-apply the same magic to this new form?\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2011-09-07 09:34:04.717 UTC","last_activity_date":"2011-09-07 09:45:52.057 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"693271","post_type_id":"1","score":"0","tags":"ajax|ruby-on-rails-3|forms","view_count":"38"} +{"id":"38234081","title":"Run MochaJS before start node server automated","body":"\u003cp\u003eI am new to Mocha.js, but I did some test cases and I would like to run these tests before my server starts automatically.\u003c/p\u003e\n\n\u003cp\u003eFor example:\nnpm start\nThen all Mocha's tests run and if it passes the server starts, if not the server stops.\u003c/p\u003e\n\n\u003cp\u003eI am using Jenkins for automated deploy\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-07-06 21:29:19.83 UTC","last_activity_date":"2016-07-07 03:37:21.44 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6558144","post_type_id":"1","score":"0","tags":"node.js|express|jenkins|mocha","view_count":"88"} +{"id":"26197998","title":".htaccess url rewrite multiple directories to GET parameters","body":"\u003cp\u003eOk so I have a site that I want to write rewrite rules for. I don't have much experience with rewrites.\u003c/p\u003e\n\n\u003cp\u003eMy .htaccess is in /foo/, not the root. Here's what I want\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCase 1: example.com/foo/bar/ --\u0026gt; example.com/foo/includes/page.php?school=bar\u0026amp;id=\n\nCase 2: example.com/foo/bar/1 --\u0026gt; example.com/foo/includes/page.php?school=bar\u0026amp;id=1\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is what I have\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eRewriteEngine on\n\nRewriteRule ^(bar|baz)/(.*)$ ./includes/pages.php?school=$1\u0026amp;id=$2 [NC,L]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThere are only two possible values for school \u003ccode\u003ebar\u003c/code\u003e and \u003ccode\u003ebaz\u003c/code\u003e. The \u003ccode\u003eid\u003c/code\u003e can have any number of values.\nThe above code works in Case 2 but doesn't work in case 1. It seems to externally redirect in case 1 to different urls depending on if there is a trailing slash or not. No idea why. Any help would be greatly appreciated.\u003c/p\u003e","accepted_answer_id":"26201013","answer_count":"1","comment_count":"0","creation_date":"2014-10-04 23:03:22.163 UTC","last_activity_date":"2014-10-05 08:40:48.923 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"433905","post_type_id":"1","score":"0","tags":".htaccess|mod-rewrite|url-rewriting","view_count":"519"} +{"id":"46196398","title":"Does StringBuilder cache the resulting string upon ToString() call?","body":"\u003cp\u003eDoes StringBuilder cache the string upon ToString call? For example, will this create two different in-memory strings, or use just one:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar sb = new StringBuilder();\nsb.Append(\"foo\");\nsb.Append(\"bar\");\n\nvar str1 = sb.ToString();\nvar str2 = sb.ToString();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWill it cache its own result for consecutive read operations?\u003c/p\u003e","accepted_answer_id":"46196499","answer_count":"5","comment_count":"4","creation_date":"2017-09-13 11:29:59.567 UTC","last_activity_date":"2017-09-27 11:42:01.383 UTC","last_edit_date":"2017-09-13 11:33:49.403 UTC","last_editor_display_name":"","last_editor_user_id":"205233","owner_display_name":"","owner_user_id":"5639688","post_type_id":"1","score":"2","tags":"c#|caching","view_count":"78"} +{"id":"44376283","title":"Polynomial Support Vector Regression in Accord.Net","body":"\u003cp\u003eI'm trying to learn the framework (Accord) but the documentation often comes with broken pieces of code. \u003cbr\u003e \nI wanted something similar to \u003ca href=\"https://stackoverflow.com/questions/29684519/non-linear-support-vector-regression-with-c-sharp-and-accord-net\"\u003ethis\u003c/a\u003e.\u003c/p\u003e\n\n\u003cp\u003eI've tried different things and nothing seemed to work. Does anyone have a working non-lineal support vector regression example ?\u003cbr\u003e\nI also tried \u003ca href=\"https://github.com/accord-net/framework/wiki/Regression\" rel=\"nofollow noreferrer\"\u003ethe official example\u003c/a\u003e which doesn't seem to work either.\u003c/p\u003e","accepted_answer_id":"44989511","answer_count":"1","comment_count":"1","creation_date":"2017-06-05 19:27:34.413 UTC","last_activity_date":"2017-07-08 18:30:30.043 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7427821","post_type_id":"1","score":"1","tags":"c#|accord.net","view_count":"132"} +{"id":"5127325","title":"Linear Coding question","body":"\u003cp\u003eI am using Java to try to implement a simple linear code, expressed as \u003ccode\u003eF=SA\u003c/code\u003e where \u003ccode\u003eS\u003c/code\u003e is a matrix of random coefficients and \u003ccode\u003eA\u003c/code\u003e is a vector of original fragments (thus \u003ccode\u003ef = S multiply A\u003c/code\u003e). \u003c/p\u003e\n\n\u003cp\u003eI got the original fragments by splitting the file in n pieces and converting each piece to a stream of bytes. \u003c/p\u003e\n\n\u003cp\u003eExample: \u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003efile = 64 kb\u003c/li\u003e\n\u003cli\u003eeach original fragment = 1024 bytes\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eHow can I multiply the matrix with the \u003ccode\u003evector(k rows, 1 column)\u003c/code\u003e of original fragments?\u003c/p\u003e\n\n\u003cp\u003eI cannot express the 1024 bytes of the *i*th row for a single integer in the *i*th row.\u003cbr\u003e\nIf I make use of a matrix instead of vector will it remain correct? Thanks in advance.\u003c/p\u003e","answer_count":"2","comment_count":"5","creation_date":"2011-02-26 14:06:32.28 UTC","last_activity_date":"2011-06-27 13:02:42.103 UTC","last_edit_date":"2011-02-26 14:15:31.947 UTC","last_editor_display_name":"","last_editor_user_id":"47550","owner_display_name":"","owner_user_id":"635562","post_type_id":"1","score":"1","tags":"java|vector|matrix|linear","view_count":"259"} +{"id":"46733245","title":"Comparing number data in each key of a map to another numerial value","body":"\u003cp\u003eI have created a map which takes in as it's key various event numbers. Each event number then stores a series of numerical values (particle masses - DiLept_M) as its data. I want to iterate through each event number and find the particle mass for each key which is closest to another value. e.g \u003c/p\u003e\n\n\u003cp\u003e12345: 3098.5 3099.1 8097.3 4356.5\u003c/p\u003e\n\n\u003cp\u003eThe event number here is 12345 and the following numbers are all the particle masses. I want to store the event number and particle mass which is closet to 3096 in a new map. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e std::map\u0026lt; Int_t, std::vector\u0026lt;Double_t\u0026gt; \u0026gt; MapOfEventsAndMasses;\n\n for(int i=0; i\u0026lt;tree-\u0026gt;GetEntries();i++){ //loop through the data \n tree-\u0026gt;GetEntry(i);\n\n if(MapOfEventsAndMasses.find(event_number) == MapOfEventsAndMasses.end()){\n\n std::vector\u0026lt;Double_t\u0026gt; tempVec; \n tempVec.push_back(DiLept_M); \n }\n else{\n MapOfEventsAndMasses[event_number].push_back(DiLept_M);\n }\n\n\n\n std::map\u0026lt; Int_t, std::vector\u0026lt;Double_t\u0026gt; \u0026gt;::iterator Iter1; \n\n\n\n Iter1 = MapOfEventsAndMasses.begin(); \n\n\n std::map\u0026lt; Int_t, std::vector\u0026lt;Double_t\u0026gt; \u0026gt;::iterator Iter1_End;\n\n Iter1_End = MapOfEventsAndMasses.end(); \n\n for ( ; Iter1 != Iter1_End; Iter1++){ \n\nInt_t event_number = Iter1-\u0026gt;first; \n\nstd::vector\u0026lt;Double_t\u0026gt; DiLept_M = Iter1-\u0026gt;second; \n\n\n\n\n for( int j=0; j \u0026lt; DiLept_M.size(); i++){\n\n\n // NOT SURE WHAT TO DO HERE\n\n\n }\n\n } //Closing for loop\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"46736609","answer_count":"1","comment_count":"5","creation_date":"2017-10-13 15:26:18.193 UTC","last_activity_date":"2017-10-13 19:11:27.05 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6743779","post_type_id":"1","score":"0","tags":"c++|iterator|maps","view_count":"49"} +{"id":"2722528","title":"How can you determine installed versions of the glibc (etc.) libraries?","body":"\u003cp\u003eI'm working with an embedded Linux deployment and am using a cross compiler tool chain that doesn't compile I2C library function calls.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eHow do I determine the precise versions of the libraries on the system so that I may rebuild the tool chain?\u003c/strong\u003e \u003c/p\u003e\n\n\u003cp\u003eI don't intend to replace the libraries deployed, as I do know they work (including I2C), so I believe I need the following:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eBinutils version\u003c/li\u003e\n\u003cli\u003eGCC version\u003c/li\u003e\n\u003cli\u003eGLIBC\u003c/li\u003e\n\u003cli\u003eKernel (for the headers)\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eI think I can assume from the following that the binutils library is version 2.2.5. The kernel is modded for which I've the source.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eroot@dev-box /\u0026gt;ls /lib/ -al\ndrwxrwxrwx 3 root root 1024 Apr 27 09:44 .\ndrwxrwxrwx 14 root root 1024 Jan 1 1970 ..\n-rwxrwxrwx 1 root root 105379 Jan 1 1970 ld-2.2.5.so\nlrwxrwxrwx 1 root root 16 Jan 1 1970 ld-linux.so.2 -\u0026gt; /lib/ld-2.2.5.so\nlrwxrwxrwx 1 root root 16 Jan 1 1970 ld.so.1 -\u0026gt; /lib/ld-2.2.5.so\n-rwxrwxrwx 1 root root 1288601 Jan 1 1970 libc.so.6\n-rwxrwxrwx 1 root root 25441 Jan 1 1970 libcrypt.so.1\n-rwxrwxrwx 1 root root 14303 Jan 1 1970 libdl.so.2\n-rwxrwxrwx 1 root root 36800 Jan 1 1970 libgcc_s.so.1\n-rwxrwxrwx 1 root root 530401 Jan 1 1970 libm.so.6\n-rwxrwxrwx 1 root root 86626 Jan 1 1970 libnsl.so.1\n-rwxrwxrwx 1 root root 17533 Jan 1 1970 libnss_dns.so.2\n-rwxrwxrwx 1 root root 46324 Jan 1 1970 libnss_files.so.2\n-rwxrwxrwx 1 root root 98633 Jan 1 1970 libpthread.so.0\n-rwxrwxrwx 1 root root 69966 Jan 1 1970 libresolv.so.2\n-rwxrwxrwx 1 root root 12897 Jan 1 1970 libutil.so.1\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"2722682","answer_count":"2","comment_count":"0","creation_date":"2010-04-27 15:27:01.117 UTC","favorite_count":"1","last_activity_date":"2015-01-30 09:59:06.773 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"32836","post_type_id":"1","score":"4","tags":"linux|gcc|gnu|cross-compiling","view_count":"9309"} +{"id":"33862463","title":"How to obtain Android Studio 1.5 menu image code as PNG file","body":"\u003cp\u003eI see that menu image file is presented like this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"24dp\"\n android:height=\"24dp\"\n android:viewportHeight=\"24.0\"\n android:viewportWidth=\"24.0\"\u0026gt;\n \u0026lt;path\n android:fillColor=\"#FF000000\"\n android:pathData=\"M12,12m-3.2,0a3.2,3.2 0,1 1,6.4 0a3.2,3.2 0,1 1,-6.4 0\" /\u0026gt;\n \u0026lt;path\n android:fillColor=\"#FF000000\"\n android:pathData=\"M9,2L7.17,4H4c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2V6c0,-1.1 -0.9,-2 -2,-2h-3.17L15,2H9zm3,15c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5z\" /\u0026gt;\n\u0026lt;/vector\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/xEZg8.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/xEZg8.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI would like to know if there is any tool to convert \u003ccode\u003ePNG file\u003c/code\u003e to \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e android:pathData=\"M9,2L7.17,4H4c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2V6c0,-1.1 -0.9,-2 -2,-2h-3.17L15,2H9zm3,15c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5z\" /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand vise versa.\u003c/p\u003e","accepted_answer_id":"33862642","answer_count":"2","comment_count":"0","creation_date":"2015-11-23 01:30:01.737 UTC","last_activity_date":"2017-10-13 10:00:50.93 UTC","last_edit_date":"2015-11-23 01:38:13.673 UTC","last_editor_display_name":"","last_editor_user_id":"196919","owner_display_name":"","owner_user_id":"196919","post_type_id":"1","score":"2","tags":"android|image|android-studio","view_count":"630"} +{"id":"4561784","title":"How to check that a stored procedure with no return value has been executed?","body":"\u003cp\u003eI am executing a stored procedure that has no return value. How can I check that it has actually been executed? Here is the code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ethis.dbProviderFactory = DalFactory.GetFactory(this.adapterConfiguration);\nDbConnection dbConnection = dbProviderFactory.CreateConnection();\n\ndbConnection.ConnectionString = this.adapterConfiguration.DatabaseInformation.ExternalDatabaseInformation.connectionString;\ndbConnection.Open();\n\nDbCommand cmd = dbConnection.CreateCommand();\ncmd.CommandText = \"h_AS_SP_ResetUnfinishedJobs\";\ncmd.CommandType = CommandType.StoredProcedure;\ncmd.ExecuteNonQuery();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd here is the stored procedure:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eALTER PROCEDURE [dbo].[h_AS_SP_ResetUnfinishedJobs]\nAS\nBEGIN\n -- Delete all unfinished jobs where the force flag has not been set...\n DELETE FROM h_AS_mds_MetaDataStatus\n WHERE mds_status NOT IN (11,12) AND mds_force = 0\nEND\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"4561883","answer_count":"1","comment_count":"4","creation_date":"2010-12-30 10:21:54.547 UTC","favorite_count":"1","last_activity_date":"2010-12-30 10:40:25.973 UTC","last_edit_date":"2010-12-30 10:40:25.973 UTC","last_editor_display_name":"","last_editor_user_id":"510731","owner_display_name":"","owner_user_id":"510731","post_type_id":"1","score":"3","tags":"c#|sql-server|stored-procedures","view_count":"3953"} +{"id":"45611019","title":"Can we use the prolog in XML in capital?","body":"\u003cp\u003eI know that XML is case sensitive and when I wrote the prolog in capital it showed error but I want to make sure that I hit the right spot or I am wrong. \u003c/p\u003e","accepted_answer_id":"45611284","answer_count":"1","comment_count":"2","creation_date":"2017-08-10 10:21:21.237 UTC","last_activity_date":"2017-08-10 10:33:40.31 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7487705","post_type_id":"1","score":"0","tags":"xml","view_count":"8"} +{"id":"18048184","title":"looping through json and echo with php","body":"\u003cp\u003eI am working with a airline flight search and get the following output when I echo print_r($result).\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eUnirest\\HttpResponse Object\n(\n [code:Unirest\\HttpResponse:private] =\u0026gt; 200\n [raw_body:Unirest\\HttpResponse:private] =\u0026gt; {\"airTicketListResponse\":{\"customerSessionId\":\"1373316267\",\"currency\":\"USD\",\"routings\":[{\"key\":\"Xt4yT/xiADHlJY1rDoGfIW1oqil8CPCWFIlJLLRPgb8^vJwIcDs7qiScjgw^YEk5DvQVRZ1Ge1ut9cq4GDemu8aQQ1r4LqOr3z3asbm/3xcR9G4YzjkKns6CoqNxFEuO8rCrifO9GnKWSQaFrOWE/JRLlKewmNAAGIz41wbgI4BYVBeiWfbPO7v/EDI3y92fKShWVCKarRbMUq4KZ6p^i7ROySEM1S9Kw6pu7OXYgn9NUpIWd1ReV0X^32AROvy^uVtRFCYMKkplFEEEafGVivdQXwii7Be/6Hpmj71D4QKNZsoPzHqH9cehD6123fqhmCkVzSTED3z^B79K/o^3ezOaf73EgLLg8eVB7pqTTk0=\",\"mainAirlineCode\":\"DL\",\"mainAirlineName\":\"Delta Airlines\",\"totalPrice\":\"231.80\",\"adultBasePrice\":\"196.04\",\"adultTax\":\"35.76\",\"childBasePrice\":\"0\",\"childTax\":\"0\",\"lastTicketDate\":\"08/05/2013\",\"domesticTicket\":true,\"duration\":\"180\",\"tripTime\":\"180\",\"layover\":false,\"operatedBy\":false,\"overnightFlight\":false,\"overnightStay\":false,\"publishFare\":true,\"trips\":[{\"segments\":[{\"airlineCode\":\"DL\",\"airlineName\":\"Delta Airlines\",\"departureAirportCode\":\"PHX\",\"departureAirportName\":\"Sky Harbor International Airport\",\"departureTime\":\"11/22/2013 06:00\",\"arrivalAirportCode\":\"LAX\",\"arrivalAirportName\":\"Los Angeles International Airport\",\"arrivalTime\":\"11/22/2013 06:35\",\"stop\":0,\"duration\":95,\"codeShare\":\"\",\"cabin\":\"E\",\"aircraftCode\":\"Canadair RJ\",\"flightNumber\":\"4578\",\"departureCity\":\"Phoenix\",\"departureStateCode\":\"AZ\",\"departureCountryCode\":\"US\",\"departureCountryName\":\"United States\",\"arrivalCity\":\"Los Angeles\",\"arrivalStateCode\":\"CA\",\"arrivalCountryCode\":\"US\",\"arrivalCountryName\":\"United States\",\"BookingClass\":\"T\",\"MarriageGroup\":\"O\"}],\"duration\":\"95\",\"tripTime\":\"95\"},{\"segments\":[{\"airlineCode\":\"DL\",\"airlineName\":\"Delta Airlines\",\"departureAirportCode\":\"LAX\",\"departureAirportName\":\"Los Angeles International Airport\",\"departureTime\":\"12/22/2013 08:30\",\"arrivalAirportCode\":\"PHX\",\"arrivalAirportName\":\"Sky Harbor International Airport\",\"arrivalTime\":\"12/22/2013 10:55\",\"stop\":0,\"duration\":85,\"codeShare\":\"\",\"cabin\":\"E\",\"aircraftCode\":\"Canadair RJ\",\"flightNumber\":\"4793\",\"departureCity\":\"Los Angeles\",\"departureStateCode\":\"CA\",\"departureCountryCode\":\"US\",\"departureCountryName\":\"United States\",\"arrivalCity\":\"Phoenix\",\"arrivalStateCode\":\"AZ\",\"arrivalCountryCode\":\"US\",\"arrivalCountryName\":\"United States\",\"BookingClass\":\"X\",\"MarriageGroup\":\"O\"}],\"duration\":\"85\",\"tripTime\":\"85\"}]},\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow do I loop through this and echo out mainAirlineName and adultBasePrice for each item returned? I dont know if this is an array inside of an array or maybe I messed something up by print_r($result).\u003c/p\u003e","accepted_answer_id":"18048238","answer_count":"1","comment_count":"0","creation_date":"2013-08-04 22:22:22.413 UTC","last_activity_date":"2013-08-04 22:56:30.463 UTC","last_edit_date":"2013-08-04 22:56:30.463 UTC","last_editor_display_name":"","last_editor_user_id":"1552695","owner_display_name":"","owner_user_id":"1552695","post_type_id":"1","score":"-1","tags":"php|json","view_count":"92"} +{"id":"17613028","title":"How to parse json array without json object title in android?","body":"\u003cpre\u003e\u003ccode\u003e [\n {\n \"name\": \"The Universe \u0026amp; The Earth\"\n , \"imagename\": \"cat1.jpg\"\n , \"active\": \"Y\"\n , \"createdon\": \"1901-01-01\"\n , \"lastmodifiedon\": \"1901-01-01 00:00:00\"\n , \"description\": \"Knowledge of Earth location in the universe has been shaped by 400 years of telescopic observations, and has expanded radically in the last century.\\n\"\n , \"id\": \"1\"\n }\n , {\n \"name\": \"Life on Earth\"\n , \"imagename\": \"cat2.jpg\"\n , \"active\": \"Y\"\n , \"createdon\": \"1901-01-01\"\n , \"lastmodifiedon\": \"1901-01-01 00:00:00\"\n , \"description\": \"Over the last 3.7 billion years or so, living organisms on the Earth have diversified and adapted to almost every environment imaginable.\"\n , \"id\": \"2\"\n }\n]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is my json values. Now i want to parse and displayed in custom list view how can i\n do this? I followed \u003ca href=\"http://www.androidhive.info/2012/01/android-json-parsing-tutorial/\" rel=\"nofollow\"\u003ehttp://www.androidhive.info/2012/01/android-json-parsing-tutorial/\u003c/a\u003e this is link but can't be achieve. How can i do this? Can anybody tell me? Thanks in advance.\u003c/p\u003e","accepted_answer_id":"17613158","answer_count":"5","comment_count":"3","creation_date":"2013-07-12 10:38:07.28 UTC","favorite_count":"1","last_activity_date":"2013-07-24 11:14:10.45 UTC","last_edit_date":"2013-07-12 10:43:48.32 UTC","last_editor_display_name":"","last_editor_user_id":"588916","owner_display_name":"","owner_user_id":"1085216","post_type_id":"1","score":"0","tags":"android|json|http","view_count":"14532"} +{"id":"723375","title":"Properly loop through JSON with jQuery","body":"\u003cp\u003eI have the following JSON:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n \"status\" : \"success\",\n \"0\": { \n \"link\" : \"test1\",\n \"img\" : \"test2\",\n \"title\" : \"test3\"\n },\n \"1\":{\n \"link\" : \"test4\",\n \"img\" : \"test5\",\n \"title\" : \"test6\"\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eObviously 0 and 1 are objects themselves and I would like a proper way to loop through all data in this object, the 'status', '0', and '1'. What I have right now (and works) is below, I know there has to be a better method to see if the element is just one deep, such as 'status' or if it's an object, such as '0' and '1':\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e// Prints the link from '0' and '1'\n$.each(test, function(){\nif(this == '[object Object]')\n alert(this.link);\n});\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"723420","answer_count":"1","comment_count":"0","creation_date":"2009-04-06 21:47:16.943 UTC","favorite_count":"1","last_activity_date":"2009-04-17 11:17:45.65 UTC","last_edit_date":"2009-04-17 11:17:45.65 UTC","last_editor_display_name":"","last_editor_user_id":"1820","owner_display_name":"","owner_user_id":"87833","post_type_id":"1","score":"1","tags":"jquery|json","view_count":"1219"} +{"id":"44692977","title":"How can I create a process that starts other processes in c#?","body":"\u003cp\u003eI would like to create a process that has no purpose but running other processes. (Which will act as his child processes) \nThe child processes are \"real\" application like Notepad++, Adobe Photoshop, etc. \u003c/p\u003e\n\n\u003cp\u003eWhat I am trying to achieve is the ability to hold both processes, child and parent, as objects (System.Diagnostics) while having the flexibility of executing and killing whichever child process I choose to. \u003c/p\u003e","answer_count":"1","comment_count":"6","creation_date":"2017-06-22 07:33:43.34 UTC","last_activity_date":"2017-06-22 08:47:52.243 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1932113","post_type_id":"1","score":"-2","tags":"c#|process|parent-child","view_count":"36"} +{"id":"41359901","title":"Interpolation of a vector in MATLAB depending on changes in another vector","body":"\u003cp\u003eI have two column vectors 'A' and 'B'. The first column in both vectors is time.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eA =\n35.2985 5.7057\n35.2991 5.7098\n35.2997 5.6880\n35.3004 5.6739\n35.3010 5.7140\n35.3016 6.0141\n35.3022 6.3620\n35.3029 6.4793\n35.3035 6.4663\n35.3041 6.4665\n35.3047 6.4646\n35.3053 6.4844\n35.3060 6.4743\n35.3066 6.4865\n35.3072 6.4878\n35.3078 6.4975\n35.3085 6.4952\n35.3091 6.4958\n35.3097 6.4734\n35.3103 6.4082\n35.3109 6.3767\n35.3116 6.3786\n35.3122 6.3796\n35.3128 6.5867\n35.3134 7.0733\n35.3141 7.3427\n35.3147 7.3238\n35.3153 7.3093\n35.3159 7.3188\n35.3166 7.3436\n\nB =\n35.2985 1.0500\n35.3053 1.0600\n35.3085 1.0400\n35.3166 1.0700\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBy doing following plot\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eplotyy(A(:,1),Binter,A(:,1),A(:,2))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt is visible that 'A' has three different levels. For each level of 'A' there is correspond 'B' value. Now I required to get interpolated values of B(:,2) based on time A(:,1). 'Binter' is the column of length 'A'.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eBinter= interp1(B(:,1),B(:,2),A(:,1),'linear')\nBinter =\nNaN\n1.0509\n1.0518\n1.0527\n1.0537\n1.0546\n1.0555\n1.0564\n1.0573\n1.0582\n1.0591\n1.0597\n1.0558\n1.0519\n1.0481\n1.0442\n1.0403\n1.0421\n1.0444\n1.0468\n1.0491\n1.0514\n1.0537\n1.0560\n1.0583\n1.0606\n1.0629\n1.0652\n1.0675\n1.0698\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut I required to start to do only interpolation for the periond in which A(:,2) is changing rapidly [diff(A(:,2))\u003e=0.1]. The rest should not do any interpolation but consider the orginal values. The out put should be something like this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eRequired_Output =\n NaN\n1.0500\n1.0500\n1.0500\n1.0500\n1.0525\n1.0550\n1.0575\n1.0600\n1.0600\n1.0600\n1.0600\n1.0558\n1.0519\n1.0481\n1.0442\n1.0400\n1.0400\n1.0400\n1.0400\n1.0400\n1.0400\n1.0400\n1.0475\n1.0550\n1.0625\n1.0700\n1.0700\n1.0700\n1.0700\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn the 'Required_Output' there is no interpolation done for corresponding 'A(:,2)' when changes in 'A(:,2)' were smaller or only one point in 'B(:,2)' was available in the different levels of 'A(:,2)'. The single available point in 'B(:,2)'is taken without any interpolation.The interpolation started until changes 'A(:,2)' stays larger than defined or more than one point available in 'B(:,2)' for the different levels in 'A(:,2)'. \nThank you for your suggestion/expertise.\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2016-12-28 10:19:44.92 UTC","last_activity_date":"2017-01-09 09:06:42.73 UTC","last_edit_date":"2017-01-09 09:06:42.73 UTC","last_editor_display_name":"","last_editor_user_id":"1949014","owner_display_name":"","owner_user_id":"1949014","post_type_id":"1","score":"0","tags":"matlab|interpolation","view_count":"51"} +{"id":"34167732","title":"Pulling reports from Microsoft Sql server","body":"\u003cp\u003eI was wondering what is the process to be able to pull reports from a database. The company I work for uses EBIS which is a program for aviation repair stations. It stores everything to its own database on our server but the GUI doesn't really have good means to pull reports. I have some background in computers and have messed around with sql just as a hobby, so my company wants me to be the one to try and get these reports for them. I have access to the server through SSMS and can run queries on it. I just haven't had any experience pulling certain tables and export them to excel or just using SSMS for reporting. Any help would be appreciated.\u003c/p\u003e\n\n\u003cp\u003eThank you\u003c/p\u003e","accepted_answer_id":"34167991","answer_count":"2","comment_count":"1","creation_date":"2015-12-08 23:00:30.567 UTC","last_activity_date":"2015-12-08 23:22:19.627 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"860068","post_type_id":"1","score":"0","tags":"mysql|sql|sql-server|reporting|ssms","view_count":"246"} +{"id":"29864362","title":"Ajax to retrieve data from mySQL database and create a table","body":"\u003cp\u003eHello guys and sorry if this is a double post.\u003c/p\u003e\n\n\u003cp\u003eI have created a database that contains 4 values \u003ccode\u003eFLID\u003c/code\u003e, \u003ccode\u003eDEPID\u003c/code\u003e, \u003ccode\u003eARRID\u003c/code\u003e, \u003ccode\u003eDistance\u003c/code\u003e.\nI managed to use an Ajax method to display the data of one of the rows of the database:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php \n if( isset($_POST['DEPID']) === true \u0026amp;\u0026amp; empty($_POST['DEPID']) ===false){\n require'../db/connect.php';\n $query = mysql_query(\"\n SELECT `Flights`.`FLID`,`Flights`.`DEPID`,`Flights`.`ARRID`,`Flights`.`Distance`\n FROM `Flights` \n WHERE `Flights`.`DEPID` ='\".mysql_real_escape_string(trim($_POST['DEPID'])) .\"'\");\n\n\n echo(mysql_num_rows($query)!== 0) ? mysql_result($query, 0, 'FLID') : 'Departure Airport not found ';\n echo(mysql_num_rows($query)!== 0) ? mysql_result($query, 0, 'DEPID') : 'Departure Airport not found '; \n echo(mysql_num_rows($query)!== 0) ? mysql_result($query, 0, 'ARRID') : 'Departure Airport not found '; \n echo(mysql_num_rows($query)!== 0) ? mysql_result($query, 0, 'Distance') : 'Departure Airport not found '; \n }\n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy question is how to make this code retrieve all of the rows in the database that has the same \u003ccode\u003eDEPID\u003c/code\u003e and how to add the results to a table.\u003c/p\u003e\n\n\u003cp\u003eI have created the following code in an attempt to solve my problem and I have reached this point:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php \nif( isset($_POST['DEPID']) === true \u0026amp;\u0026amp; empty($_POST['DEPID']) ===false){\n require'../db/connect.php';\n $query = mysql_query(\"SELECT * FROM Flights WHERE DEPID ='DEPID'\"); \n $result = mysql_query($mysql_connect,$query) or die (\"Error\"); \n echo \"\u0026lt;table\u0026gt;\u0026lt;tr\u0026gt;\u0026lt;th\u0026gt;Flight ID\u0026lt;/th\u0026gt;\u0026lt;th\u0026gt;Departure Airport\u0026lt;/th\u0026gt;\u0026lt;th\u0026gt;Arrival Airport\u0026lt;/th\u0026gt;\u0026lt;th\u0026gt;Distance\u0026lt;/th\u0026gt;\u0026lt;/tr\u0026gt;\";\n\n while($row = mysql_fetch_array($result)) {\n echo \"\u0026lt;tr\u0026gt;\u0026lt;td\u0026gt;\" . $row['FLID'] . \"\u0026lt;/td\u0026gt;\u0026lt;td\u0026gt;\" . $row['DEPID'] . \"\u0026lt;/td\u0026gt;\u0026lt;td\u0026gt;\" . $row['ARRID'] . \"\u0026lt;/td\u0026gt;\u0026lt;td\u0026gt;\" . $row['Distance'] . \"\u0026lt;/td\u0026gt;\u0026lt;/tr\u0026gt;\";\n }\n echo \"\u0026lt;/table\u0026gt;\"; \n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow I have the problem that the code fails with this message:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e\u003cb\u003eWarning\u003c/b\u003e: mysql_query() expects parameter 2 to be resource, boolean given in \u003cb\u003e/home/ak118043/public_html/ajax/name.php\u003c/b\u003e on line \u003cb\u003e9\u003c/b\u003e\n Thanks in advance.\u003c/p\u003e\n\u003c/blockquote\u003e","answer_count":"2","comment_count":"1","creation_date":"2015-04-25 11:10:18.893 UTC","last_activity_date":"2015-09-25 15:02:23.913 UTC","last_edit_date":"2015-09-25 15:02:23.913 UTC","last_editor_display_name":"","last_editor_user_id":"989169","owner_display_name":"","owner_user_id":"2162916","post_type_id":"1","score":"1","tags":"php|mysql|ajax","view_count":"69"} +{"id":"8138416","title":"Server Control Auto Postback with form has _blank attribute","body":"\u003cp\u003eMy case is I have an asp.net page has a form \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;form id=\"form1\" runat=\"server\" target=\"_blank\"\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand a button redirect to another page and this page will open in a new window because of the target attribute of the form .\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;asp:Button ID=\"button1\" runat=\"server\" PostBackUrl=\"~/kindofpage.aspx\" Text=\"Generate\" /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand I have a dropdownlist has auto postback = true to post the past to fill another dropdownlist by selected data .\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;asp:dropdownliast id=\"Make\" name=\"Make\" runat=\"server\" autopostback=\"true\"\u0026gt;\u0026lt;/asp:dropdownlist\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethe question is : why when I select item from the auto postbacked dropdown an blank page opened ?\u003c/p\u003e\n\n\u003cp\u003eI need a way to post the page by the dropdownlist without openning a blank page .. \u003c/p\u003e\n\n\u003cp\u003eThank you,\u003c/p\u003e","answer_count":"4","comment_count":"0","creation_date":"2011-11-15 15:05:47.173 UTC","favorite_count":"1","last_activity_date":"2016-06-28 19:50:55.143 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"437176","post_type_id":"1","score":"1","tags":"asp.net|forms|autopostback","view_count":"994"} +{"id":"14859052","title":"Send a digitally signed mail with Joomla Mailer","body":"\u003cp\u003eI want send an email previosly signed with openssl_pkcs7_sign PHP function using the Joomla Mailer class.\u003c/p\u003e\n\n\u003cp\u003eAnyone know how can I do this?\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2013-02-13 17:11:24.287 UTC","favorite_count":"1","last_activity_date":"2013-03-27 13:08:41.197 UTC","last_edit_date":"2013-02-13 17:14:22.41 UTC","last_editor_display_name":"","last_editor_user_id":"1908677","owner_display_name":"","owner_user_id":"1996663","post_type_id":"1","score":"2","tags":"php|email|joomla","view_count":"128"} +{"id":"43810908","title":"Segmentation fault when releasing a string in C","body":"\u003cp\u003eI have a \"segmentation fault\" error when I try to free the allocated memory of the string pointed from \"new_job-\u003ejobs_adress\" . I've allocated enough memory for my string (even if I allocate far beyond from what I need, I still have this problem), But there is still this error. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;stdio.h\u0026gt;\n#include \u0026lt;stdlib.h\u0026gt;\n#include \u0026lt;string.h\u0026gt;\n\ntypedef struct job_t {\n pid_t pid;\n time_t creation_time;\n bool stop;\n bool foreground;\n char * jobs_adress;\n} Job;\n\nint main() {\n\n char * jobs_adress = \"string\";\n\n /* creating an object of \"Job\" Type */\n printf(\"another try\");\n Job * new_job = (Job*)malloc(sizeof(new_job));\n if(!new_job) {\n return;\n }\n\n /* allocating memory for a new string, and copies the old string\n into the new string*/\n\n int length2=strlen(jobs_adress);\n char * str2 = malloc(length2+1);\n strcpy(str2,jobs_adress);\n new_job-\u0026gt;jobs_adress=str2; \n\n new_job-\u0026gt;pid = 1;\n new_job-\u0026gt;creation_time = time(NULL);\n new_job-\u0026gt;stop=false;\n new_job-\u0026gt;foreground=true;\n\n free(new_job-\u0026gt;jobs_adress); // \u0026lt;=== the error is here\n\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"7","creation_date":"2017-05-05 17:42:09.837 UTC","last_activity_date":"2017-05-05 18:00:21.07 UTC","last_edit_date":"2017-05-05 18:00:21.07 UTC","last_editor_display_name":"","last_editor_user_id":"15168","owner_display_name":"","owner_user_id":"6142483","post_type_id":"1","score":"0","tags":"c|segmentation-fault|free","view_count":"69"} +{"id":"43096557","title":"Objective-c Sorting NSArray with alphanumeric strings in correct order","body":"\u003cp\u003eI have an array of strings that contain numbers i.e. \u003ccode\u003eShift 1 RT9909\u003c/code\u003e I sort the array as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eNSSet *forms = dataObject.rtForms;\n\nNSSortDescriptor *nameDescriptor = [NSSortDescriptor sortDescriptorWithKey:@\"type\" ascending:YES];\nNSArray *sorted = [forms sortedArrayUsingDescriptors:[NSArray arrayWithObject:nameDescriptor]];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis works fine while the number of elements is under 10. After this point \u003ccode\u003eShift 10 RT9909\u003c/code\u003e is placed in front \u003ccode\u003eShift 2 RT9909\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eSo my question is how can I sort the array so that \u003ccode\u003eShift 10 RT9909\u003c/code\u003e would follow \u003ccode\u003eShift 9 RT9909\u003c/code\u003e\u003c/p\u003e","accepted_answer_id":"43096808","answer_count":"1","comment_count":"2","creation_date":"2017-03-29 14:33:04.3 UTC","last_activity_date":"2017-03-29 14:43:45.997 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1636266","post_type_id":"1","score":"0","tags":"ios|objective-c|arrays|sorting","view_count":"91"} +{"id":"24067339","title":"Schemamigration: adding a simple Null field","body":"\u003cp\u003eOkay, so I had an app called locationmanager with a model that looks like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass Location(models.Model):\n region = models.ForeignKey(Region)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand I want to change it to this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass Location(models.Model):\n region = models.ForeignKey(Region, blank=True, null=True)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo I ran a schemamigration and received the following:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$ python manage.py schemamigration locationmanager --auto\n ? The field 'Location.region' does not have a default specified, yet is NOT NULL.\n ? Since you are making this field nullable, you MUST specify a default\n ? value to use for existing rows. Would you like to:\n ? 1. Quit now.\n ? 2. Specify a one-off value to use for existing columns now\n ? 3. Disable the backwards migration by raising an exception; you can edit the migration to fix it later\n ? Please select a choice: \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is confusing to me. And yes I have read the south docs.\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003e\u003cp\u003eFirstly, why is it saying \u003ccode\u003e'Location.region' does not have a default specified, yet is NOT NULL.\u003c/code\u003e The alterations I made to the field ARE making it the case that it is null, what gives? An explanation would be great.\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eWhy do I need to specify a default? Once I specify this default where does it live? In an SQL table? Does this matter if I have existing data or is this simply for the scheme itself?\u003c/p\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003e3.I sort of understand option 1,2 but what exactly would option 3 do? Why is it useful?\u003c/p\u003e\n\n\u003cp\u003eThank you tremendously.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-06-05 18:17:15.22 UTC","last_activity_date":"2014-06-05 18:23:37.19 UTC","last_edit_date":"2014-06-05 18:23:30.733 UTC","last_editor_display_name":"","last_editor_user_id":"3326189","owner_display_name":"","owner_user_id":"3326189","post_type_id":"1","score":"0","tags":"python|django|django-models|django-south","view_count":"86"} +{"id":"15980283","title":"Sed replace text","body":"\u003cp\u003eI need to replace text with single quotes with \u003ccode\u003esed\u003c/code\u003e and I can't get it to work. Here is my code; can you help me?\u003c/p\u003e\n\n\u003cp\u003eI have a text file with this format:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#sometext\n$configuration_TEstbk2_bk2_environment12 = 'lalala'\n$configuration_TEstbk2_bk2_envoronment12 = 'lalala1'\n$configuration_TEstbk2_bk2_staging12 = 'BACKUP 2'\n$configuration_waq4faw4f_q4fq4qg4f = 'r234rq43rq4rqr'\n$configuration_alice_StagingTEstBk_bk = 'testebk'\n$configuration_deployment_overlays_alice_TEStStngDir = 'some'\n$configuration_arefgqrqgrq_341q34tq34t = '134t135'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd I need to do something like: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esed s/$configuration_arefgqrqgrq_341q34tq34t ='134t135'/$configuration_arefgqrqgrq_341q34tq34t = 'NEWVALUE'/g \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have tried with many combinations with \u003ccode\u003esed\u003c/code\u003e but I can't find one that works.\u003c/p\u003e","answer_count":"5","comment_count":"1","creation_date":"2013-04-12 20:26:19.797 UTC","last_activity_date":"2013-04-13 07:39:22.857 UTC","last_edit_date":"2013-04-12 20:45:08.327 UTC","last_editor_display_name":"","last_editor_user_id":"15168","owner_display_name":"","owner_user_id":"2275908","post_type_id":"1","score":"0","tags":"sed","view_count":"581"} +{"id":"40826288","title":"Hide datagridview column but still access it value","body":"\u003cp\u003eThe below code is using the column that i want to be not visible which is [0]\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eLoadData();\nMessageBox.Show(p.AddNew());\ndgpay.DataSource = p.AllData();\np.Move2Last();\nShowData();\nfor (int i = 0; i \u0026lt; dgpay.Rows.Count; i++)\n{\n if (!dgpay.Rows[i].IsNewRow)\n {\n if (dgpay[0, i].Value.ToString() == txtpaymentid.Text)\n {\n dgpay.CurrentCell = dgpay.Rows[i].Cells[0];\n dgpay.Rows[i].Selected = true;\n }\n else\n {\n dgpay.Rows[i].Selected = false;\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen i tried to make \u003ccode\u003edgpay.Columns[0].Visible = false\u003c/code\u003e the above code wont run probably.\u003c/p\u003e\n\n\u003cp\u003eHow can i hide the column without affecting the code. \u003c/p\u003e","accepted_answer_id":"40826340","answer_count":"1","comment_count":"4","creation_date":"2016-11-27 06:15:00.22 UTC","last_activity_date":"2016-11-27 06:24:11.427 UTC","last_edit_date":"2016-11-27 06:22:24.93 UTC","last_editor_display_name":"","last_editor_user_id":"5691625","owner_display_name":"","owner_user_id":"5691625","post_type_id":"1","score":"1","tags":"c#|winforms|datagridview","view_count":"28"} +{"id":"31093626","title":"Is it possible to get the unique selector from an IWebElement (WebElement) in Selenium using C#","body":"\u003cp\u003etldr; version here: I would like to retrieve a unique selector, or create one, from an IWebElement. Is this possible?\u003c/p\u003e\n\n\u003cp\u003eI've got a testing framework where I've created actor classes for various elements such as an input box with a label. The class is generalized so that a person doesn't need to create a new \"click\" method each time an input with a label is encountered.\u003c/p\u003e\n\n\u003cp\u003eMy class has among its properties the IWebDriver and a few By selectors. Of course, when it needs to take an action, it combines the two into a sensible command. Here is a simple example for my class.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class InputActorClass\n{\n IWebDriver Driver {get; set;}\n By Input {get; set;}\n public InputActorClass(IWebDriver driver, By selector)\n {\n Driver = driver;\n Selector = selector;\n }\n public InputActorClass SelectCheckbox()\n {\n IWebElement actor = Driver.FindElement(Input);\n if (!actor.selected) { actor.click(); }\n return this;\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAs you can see, I just need to call SelectCheckbox and the class already knows the has the By selector object and the IWebDriver object.\u003c/p\u003e\n\n\u003cp\u003eHowever, I have come across a situation where I have to scan a list of input elements to find the one with the correct text. But the only way I can think to do that at the moment is to do the following:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic void SelectOption(string value)\n{\n By itemselectors = new ByChained(container, By.CssSelector(\"input\"));\n foreach (IWebElement el in driver.FindElements(itemselectors))\n {\n if (el.text.Equals(value))\n actor = new InputActorClass(driver, el.???);\n }\n actor.SelectCheckbox();\n // and do other stuff that the InputActorClass may provide.\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAn astute reader might suggest I use XPath to create my selector instead of going through the whole foreach loop. My problem is that these particular input elements are nested in various dynamically created categories and may have the same name between the categories. And, since it is dynamically created, I'm not guaranteed my desired element is in the same nth-child() location. \u003c/p\u003e\n\n\u003cp\u003eOf course, I may just have to break down and use XPath to select the category and the input element. I'm hoping there is a way to do what I'm asking.\u003c/p\u003e\n\n\u003cp\u003eHere's some html for example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;body\u0026gt;\n \u0026lt;div class=\"checkbox\"\u0026gt;\n \u0026lt;div\u0026gt;\n \u0026lt;input type=\"checkbox\"/\u0026gt;\n \u0026lt;label\u0026gt;My First Checkbox\u0026lt;/label\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div\u0026gt;\n \u0026lt;input type=\"checkbox\"/\u0026gt;\n \u0026lt;label\u0026gt;My Second Checkbox\u0026lt;/label\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n\u0026lt;/body\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere's some C# code that might iterate through the html:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCheckboxActorClass InputActor;\nforeach (IWebElement el in driver.FindElements(By.CssSelector(\".checkbox label\")))\n{\n if (el.Text.Equals(textToMatch))\n {\n By selector = el.GetUniqueSelector(); // this line is obviously not right. What *is* the correct solution?\n InputActor = new CheckboxActorClass(driver, new ByChained(selector, By.XPath(\"/../input\")));\n break;\n }\n}\n// Do stuff with the InputActor, like InputActor.Select();\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"2","creation_date":"2015-06-27 21:19:36.863 UTC","last_activity_date":"2015-06-30 02:28:28.883 UTC","last_edit_date":"2015-06-30 02:28:28.883 UTC","last_editor_display_name":"","last_editor_user_id":"571380","owner_display_name":"","owner_user_id":"571380","post_type_id":"1","score":"0","tags":"c#|selenium","view_count":"564"} +{"id":"32852761","title":"How to create polygon and calculate area of ocean within a circle on a map","body":"\u003cp\u003eI have a map with a circle drawn around a point. Part of the circle covers land and part of it covers ocean. I want to calculate the area of ocean within the circle, but I don't know how to create that polygon. The code for the map with the circle is\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elibrary(dismo)\nlibrary(scales)\nlibrary(rgeos)\n\nGI \u0026lt;- gmap(\"Grand Isle,Louisiana\", zoom = 7, scale = 2)\nd \u0026lt;- data.frame(lat = c(29.2278), lon = c(-90.0122))\ncoordinates(d) \u0026lt;- ~ lon + lat\nprojection(d) \u0026lt;- \"+init=epsg:4326\"\nd_mrc \u0026lt;- spTransform(d, CRS = CRS(projection(GI)))\nd_mrc_bff \u0026lt;- gBuffer(d_mrc, width = 100000)\n\nplot(GI)\nplot(d_mrc_bff, col = alpha(\"blue\", .35), add = TRUE)\npoints(d_mrc, cex = 2, pch = 20)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have looked into \u003ccode\u003emask\u003c/code\u003e{raster} and \u003ccode\u003elandmask\u003c/code\u003e{GSIF} functions, but I think in my case it won't work since I only want to mask the land within the circle, not on the entire map. Or I don't really need to mask it, but create the polygon with boundaries being the perimeter of the circle and the coastline.\nThank you for any suggestions!\u003c/p\u003e","accepted_answer_id":"32853318","answer_count":"1","comment_count":"2","creation_date":"2015-09-29 19:59:44.003 UTC","last_activity_date":"2015-09-29 20:51:24.05 UTC","last_edit_date":"2015-09-29 20:30:47.193 UTC","last_editor_display_name":"","last_editor_user_id":"980833","owner_display_name":"","owner_user_id":"3281487","post_type_id":"1","score":"1","tags":"r|geospatial","view_count":"113"} +{"id":"2400807","title":"Which Perl modules can be installed just by copying lib files?","body":"\u003cp\u003eI'm an absolute beginner at Perl, and am trying to use some non-core modules on my shared Linux web host. I have no command line access, only FTP.\u003c/p\u003e\n\n\u003cp\u003eHost admins will consider installing modules on request, but the ones I want to use are updated frequently (DateTime::TimeZone for example), and I'd prefer to have control over exactly which version I'm using.\u003c/p\u003e\n\n\u003cp\u003eBy experimentation, I've found some modules can be installed by copying files from the module's lib directory to a directory on the host, and using\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003euse lib \"local_path\";\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ein my script, i.e. no compiling is required to install (DateTime and DateTime::TimeZone again).\u003c/p\u003e\n\n\u003cp\u003eHow can I tell whether this is the case for a particular module? I realise I'll have to resolve dependencies myself.\u003c/p\u003e\n\n\u003cp\u003eAdditionally: if I wanted to be able to install any module, including those which require compiling, what would I be looking for in terms of hosting?\u003c/p\u003e\n\n\u003cp\u003eI'm guessing at the moment I share a VM with several others and the minimum provision I'd need would be a dedicated VM with shell access?\u003c/p\u003e","accepted_answer_id":"2401782","answer_count":"2","comment_count":"0","creation_date":"2010-03-08 11:07:31.45 UTC","favorite_count":"0","last_activity_date":"2010-03-08 17:28:01.08 UTC","last_edit_date":"2010-03-08 13:16:39.02 UTC","last_editor_display_name":"","last_editor_user_id":"84596","owner_display_name":"","owner_user_id":"84596","post_type_id":"1","score":"0","tags":"perl|perl-module","view_count":"305"} +{"id":"38830624","title":"boostrap menu active page dont show style","body":"\u003cp\u003eSo I want the active page to use same settings as the hover settings. No matter how I change the css I cant get it to work... long time since I've worked on this page tho so I might be missing some easy shit...\u003c/p\u003e\n\n\u003cp\u003eStyle.css before changes \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e.navbar-default .navbar-brand {\n color: #fff;\n border-left:solid;\n border-right:solid;\n border-top:none;\n border-bottom:none;\n border-color:#202020;\n border-width:0.1pt;\n }\n .navbar-default .navbar-brand:hover,\n .navbar-default .navbar-brand:focus {\n color: #fff;\n border-left:solid;\n border-right:solid;\n border-top:none;\n border-bottom:none;\n border-color:#707070;\n border-width:0.1pt;\n background: -webkit-linear-gradient(top, rgba(112, 112, 112, 1) 0%, rgba(0, 0, 0, 1) 100%);\n background: linear-gradient(to bottom, rgba(112, 112, 112, 1) 0%, #404040 20%);\n }\n .navbar-default {\n font-size: 14px;\n background-color: rgba(0, 0, 0, 1);\n background: -webkit-linear-gradient(top, rgba(112, 112, 112, 1) 0%, rgba(0, 0, 0, 1) 100%);\n background: linear-gradient(to bottom, rgba(112, 112, 112, 1) 0%, #202020 20%);\n border-width: 0px;\n border-radius: 0px;\n }\n .navbar-default .navbar-nav\u0026gt;li\u0026gt;a {\n color: #fff;\n background-color: rgba(0, 0, 0, 1);\n background: -webkit-linear-gradient(top, rgba(112, 112, 112, 1) 0%, rgba(0, 0, 0, 1) 100%);\n background: linear-gradient(to bottom, rgba(112, 112, 112, 1) 0%, #202020 20%);\n border-left:none;\n border-right:solid;\n border-top:none;\n border-bottom:none;\n border-color:#202020;\n border-width:0.1pt;\n }\n .navbar-default .navbar-nav\u0026gt;li\u0026gt;a:hover,\n .navbar-default .navbar-nav\u0026gt;li\u0026gt;a:focus {\n color: #fff;\n background-color: rgba(255, 255, 255, 1);\n background: -webkit-linear-gradient(top, rgba(112, 112, 112, 1) 0%, rgba(0, 0, 0, 1) 100%);\n background: linear-gradient(to bottom, rgba(112, 112, 112, 1) 0%, #404040 20%);\n border-left:solid;\n border-right:solid;\n border-top:none;\n border-bottom:none;\n border-color:#707070;\n border-width:0.1pt;\n }\n .navbar-default .navbar-nav\u0026gt;.active\u0026gt;a,\n .navbar-default .navbar-nav\u0026gt;.active\u0026gt;a:hover,\n .navbar-default .navbar-nav\u0026gt;.active\u0026gt;a:focus {\n color: #fff;\n background-color: rgba(231, 231, 231, 1);\n }\n .navbar-default .navbar-toggle {\n border-color: #ddd;\n }\n .navbar-default .navbar-toggle:hover,\n .navbar-default .navbar-toggle:focus {\n background-color: #ddd;\n }\n .navbar-default .navbar-toggle .icon-bar {\n background-color: #888;\n }\n .navbar-default .navbar-toggle:hover .icon-bar,\n .navbar-default .navbar-toggle:focus .icon-bar {\n background-color: #000000;\n }\n.navbar-default .navbar-right\u0026gt;li\u0026gt;a {\n border-left:solid;\nborder-width:0.1pt;\nborder-color:#202020;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMenu\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"navbar navbar-default navbar-top\" role=\"navigation\"\u0026gt;\n \u0026lt;div class=\"container\"\u0026gt;\n \u0026lt;div class=\"navbar-header\"\u0026gt;\n \u0026lt;button type=\"button\" class=\"navbar-toggle\" data-toggle=\"collapse\" data-target=\".navbar-collapse\"\u0026gt;\n \u0026lt;span class=\"icon-bar\"\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;span class=\"icon-bar\"\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;span class=\"icon-bar\"\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;/button\u0026gt;\n \u0026lt;a href=\"index.php\" class=\"navbar-brand\"\u0026gt;Per Källström\u0026lt;/a\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"navbar-collapse collapse\"\u0026gt;\n \u0026lt;ul class=\"nav navbar-nav\"\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#\"\u0026gt;Comming soon\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#\"\u0026gt;Comming soon\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"contact.php\" class=\"active\"\u0026gt;Contact\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n \u0026lt;ul class=\"nav navbar-nav navbar-right\"\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"admin.php\"\u0026gt;Admin\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"38839110","answer_count":"2","comment_count":"3","creation_date":"2016-08-08 13:33:36.72 UTC","last_activity_date":"2016-08-08 21:55:31.363 UTC","last_edit_date":"2016-08-08 13:34:33.453 UTC","last_editor_display_name":"","last_editor_user_id":"6280781","owner_display_name":"","owner_user_id":"5823813","post_type_id":"1","score":"-2","tags":"html|css|twitter-bootstrap|css3|twitter-bootstrap-3","view_count":"31"} +{"id":"18989535","title":"INSERT INTO fails if inserting a variable with the value of Null","body":"\u003cp\u003eThe SQL INSERT INTO will fail if the variable I am inserting has the value of Null.\u003c/p\u003e\n\n\u003cp\u003eThe variable costLab is Variant data type. The non-Null value would be Decimal.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edb.Execute (\"INSERT INTO budget \n(wbsid, category, capture_date, budget_date, budget_type, month_value) \" \u0026amp; _\n\"VALUES ('\" \u0026amp; wbsid \u0026amp; \"', 'Labor', #\" \u0026amp; importDate \u0026amp; \"#, \n#\" \u0026amp; monthDate \u0026amp; \"#, 'Forecast', \" \u0026amp; costLab \u0026amp; \");\")\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to insert Null if the code that sets costLab returns Null. But if a value is returned I want to insert that value. Obviously I could write an If statement that checks for null then insert \"Null\" directly but I wanted to know if there was a way without the If statement to insert Nulls via a variable.\u003c/p\u003e","accepted_answer_id":"18989726","answer_count":"2","comment_count":"0","creation_date":"2013-09-24 18:42:23.117 UTC","last_activity_date":"2013-09-24 19:02:30.51 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2565005","post_type_id":"1","score":"5","tags":"ms-access|ms-access-2007","view_count":"6014"} +{"id":"16991719","title":"How do I interpret these crash reports from iOS","body":"\u003cp\u003eHi I have had an iOS app in review, but it just got rejected... I have been trying to stimulate my ipad with iOS 6.1.3 to make it crash as described by apple: \u003c/p\u003e\n\n\u003cp\u003eYour app crashed when we tapped the action or option buttons.\u003c/p\u003e\n\n\u003cp\u003eBut im failing, can the exact procedure of the crash be read from the report below?\nIm suspecting they are doing something really crazy, can you tell me if the crash is network related? or if they have been pushing a certain button? I myself cant find enough information: \u003c/p\u003e\n\n\u003cp\u003eSymbolicated:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eException Type: EXC_CRASH (SIGABRT)\nException Codes: 0x0000000000000000, 0x0000000000000000\nCrashed Thread: 0\n\nLast Exception Backtrace:\n0 CoreFoundation 0x32b0629e __exceptionPreprocess + 158\n1 libobjc.A.dylib 0x3a9aa97a objc_exception_throw + 26\n2 CoreFoundation 0x32b061c0 +[NSException raise:format:] + 100\n3 UIKit 0x34aab56c -[UINib instantiateWithOwner:options:] + 1632\n4 UIKit 0x34aaab96 -[UIViewController _loadViewFromNibNamed:bundle:] + 230\n5 UIKit 0x349a3038 -[UIViewController loadView] + 88\n6 UIKit 0x3492d468 -[UIViewController loadViewIfRequired] + 64\n7 CodeFriend 0x0000fb14 -[ThemesPopOverViewController initWithNibName:bundle:] (ThemesPopOverViewController.m:24)\n8 CodeFriend 0x0000e21a -[AppDelegate settingAct:] (AppDelegate.m:127)\n9 UIKit 0x349f90c0 -[UIApplication sendAction:to:from:forEvent:] + 68\n10 UIKit 0x349f9072 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 26\n11 UIKit 0x349f9050 -[UIControl sendAction:to:forEvent:] + 40\n12 UIKit 0x349f8906 -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 498\n13 UIKit 0x349f8dfc -[UIControl touchesEnded:withEvent:] + 484\n14 UIKit 0x349215ec -[UIWindow _sendTouchesForEvent:] + 520\n15 UIKit 0x3490e7fc -[UIApplication sendEvent:] + 376\n16 UIKit 0x3490e116 _UIApplicationHandleEvent + 6150\n17 GraphicsServices 0x3660259e _PurpleEventCallback + 586\n18 GraphicsServices 0x366021ce PurpleEventCallback + 30\n19 CoreFoundation 0x32adb16e __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 30\n20 CoreFoundation 0x32adb112 __CFRunLoopDoSource1 + 134\n21 CoreFoundation 0x32ad9f94 __CFRunLoopRun + 1380\n22 CoreFoundation 0x32a4ceb8 CFRunLoopRunSpecific + 352\n23 CoreFoundation 0x32a4cd44 0x32a44000 + 36164\n24 GraphicsServices 0x366012e6 GSEventRunModal + 70\n25 UIKit 0x349622fc UIApplicationMain + 1116\n26 CodeFriend 0x0000d3b6 main (main.m:16)\n27 libdyld.dylib 0x3ade1b1c start + 0\n\n\nThread 0 name: Dispatch queue: com.apple.main-thread\nThread 0 Crashed:\n0 libsystem_kernel.dylib 0x3aea8350 __pthread_kill + 8\n1 libsystem_c.dylib 0x3ae1f11e pthread_kill + 54\n2 libsystem_c.dylib 0x3ae5b96e abort + 90\n3 libc++abi.dylib 0x3a3f9d4a abort_message + 70\n4 libc++abi.dylib 0x3a3f6ff4 default_terminate() + 20\n5 libobjc.A.dylib 0x3a9aaa74 _objc_terminate() + 144\n6 libc++abi.dylib 0x3a3f7078 safe_handler_caller(void (*)()) + 76\n7 libc++abi.dylib 0x3a3f7110 std::terminate() + 16\n8 libc++abi.dylib 0x3a3f8594 __cxa_rethrow + 84\n9 libobjc.A.dylib 0x3a9aa9cc objc_exception_rethrow + 8\n10 CoreFoundation 0x32a4cf1c CFRunLoopRunSpecific + 452\n11 CoreFoundation 0x32a4cd44 CFRunLoopRunInMode + 100\n12 GraphicsServices 0x366012e6 GSEventRunModal + 70\n13 UIKit 0x349622fc UIApplicationMain + 1116\n14 CodeFriend 0x0000d3b6 main (main.m:16)\n15 libdyld.dylib 0x3ade1b1c start + 0\n\nThread 1:\n0 libsystem_kernel.dylib 0x3aea8d98 __workq_kernreturn + 8\n1 libsystem_c.dylib 0x3adf6cf6 _pthread_workq_return + 14\n2 libsystem_c.dylib 0x3adf6a12 _pthread_wqthread + 362\n3 libsystem_c.dylib 0x3adf68a0 start_wqthread + 4\n\nThread 2 name: Dispatch queue: com.apple.libdispatch-manager\nThread 2:\n0 libsystem_kernel.dylib 0x3ae98648 kevent64 + 24\n1 libdispatch.dylib 0x3adc8974 _dispatch_mgr_invoke + 792\n2 libdispatch.dylib 0x3adc8654 _dispatch_mgr_thread$VARIANT$mp + 32\n\nThread 3:\n0 libsystem_kernel.dylib 0x3aea8d98 __workq_kernreturn + 8\n1 libsystem_c.dylib 0x3adf6cf6 _pthread_workq_return + 14\n2 libsystem_c.dylib 0x3adf6a12 _pthread_wqthread + 362\n3 libsystem_c.dylib 0x3adf68a0 start_wqthread + 4\n\nThread 4 name: WebThread\nThread 4:\n0 libsystem_kernel.dylib 0x3ae97eb4 mach_msg_trap + 20\n1 libsystem_kernel.dylib 0x3ae98048 mach_msg + 36\n2 CoreFoundation 0x32adb040 __CFRunLoopServiceMachPort + 124\n3 CoreFoundation 0x32ad9d9e __CFRunLoopRun + 878\n4 CoreFoundation 0x32a4ceb8 CFRunLoopRunSpecific + 352\n5 CoreFoundation 0x32a4cd44 CFRunLoopRunInMode + 100\n6 WebCore 0x38a3c500 RunWebThread(void*) + 440\n7 libsystem_c.dylib 0x3ae0130e _pthread_start + 306\n8 libsystem_c.dylib 0x3ae011d4 thread_start + 4\n\nThread 0 crashed with ARM Thread State (32-bit):\n r0: 0x00000000 r1: 0x00000000 r2: 0x00000000 r3: 0x3c99e534\n r4: 0x00000006 r5: 0x3c99eb88 r6: 0x1dda5554 r7: 0x2fdf7a14\n r8: 0x1dda5530 r9: 0x00000300 r10: 0x00000000 r11: 0x00000000\n ip: 0x00000148 sp: 0x2fdf7a08 lr: 0x3ae1f123 pc: 0x3aea8350\n cpsr: 0x00000010\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo moving on: The code used to initialize the ThemesPopOverViewController is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil\n\n {\n self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];\n if (self) {\n\n\n self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(20, 0, self.view.frame.size.width - 40, 350)];\n [self.tableView setBackgroundColor:[UIColor clearColor]];\n [self.tableView setDelegate:self];\n [self.tableView setDataSource:self];\n themes = [[NSArray alloc] initWithObjects:kRegexHighlightViewThemeArray];\n [self.view addSubview:self.tableView];\n int item = [themes indexOfObject:theDelegate.codeView.currentTheme];\n NSIndexPath *indexPath = [NSIndexPath indexPathForItem:item inSection:0];\n [self.tableView selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionNone];\n\n }\n\n return self;\n }\n\n - (void)viewDidLoad\n {\n [super viewDidLoad];\n\n // Do any additional setup after loading the view from its nib.\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI actually seems that even after the popover is removed from the view hierarchy the allocation done by the init method above occupies memory, it is ARC, do i need to set it to nil somewhere above removing the popover? So everytime the popover is pressed the memory allocations increase...\u003c/p\u003e","accepted_answer_id":"16992964","answer_count":"2","comment_count":"2","creation_date":"2013-06-07 19:36:06.847 UTC","last_activity_date":"2013-06-08 07:26:39.137 UTC","last_edit_date":"2013-06-08 07:26:39.137 UTC","last_editor_display_name":"","last_editor_user_id":"1641868","owner_display_name":"","owner_user_id":"1641868","post_type_id":"1","score":"1","tags":"ios|ipad|crash-reports","view_count":"321"} +{"id":"47227858","title":"Django admin :: I want to keep last selected value on adding another item","body":"\u003cp\u003eContext\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003ein django administration site\u003c/li\u003e\n\u003cli\u003eI am adding a new item in a model via \u003cem\u003eadd\u003c/em\u003e button \u003c/li\u003e\n\u003cli\u003ewhen the form is displayed, I have a \u003cstrong\u003edropDown\u003c/strong\u003e with some options to choose, I choose option B and I fill other fields to complete the form \u003c/li\u003e\n\u003cli\u003eI click on button \u003cem\u003esave and add another\u003c/em\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eWhen the new \"add form view\" is displayed \nI want my \u003cstrong\u003edropdown\u003c/strong\u003e to set on the last choice (B option) I selected before \u003c/p\u003e\n\n\u003cp\u003eWhat is your suggestion to implement that as simple is possible?\u003c/p\u003e\n\n\u003cp\u003eThank you\u003c/p\u003e","accepted_answer_id":"47231100","answer_count":"2","comment_count":"4","creation_date":"2017-11-10 17:05:35.467 UTC","last_activity_date":"2017-11-10 22:03:00.727 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2175449","post_type_id":"1","score":"2","tags":"django","view_count":"41"} +{"id":"41540411","title":"latex beamer footer alignment","body":"\u003cp\u003eHow can I add text line on left side and frame number on right side of footer in latex beamer presentation?\u003c/p\u003e\n\n\u003cp\u003eAlso, I need to exclude title page from this footer placement.\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2017-01-09 03:01:41.343 UTC","last_activity_date":"2017-01-12 04:17:34.447 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4545832","post_type_id":"1","score":"-1","tags":"latex","view_count":"136"} +{"id":"46666410","title":"language switcher not redirecting to proper url in Magento2","body":"\u003cp\u003ewe have multi-store site and in two languages 'arabic' and 'english'. \nWhen we are changing language its reloading page with below parameter -\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eCurrentPageUrl?___from_store=en_sa\u003c/code\u003e \u003c/p\u003e\n\n\u003cp\u003ei.e right.\u003c/p\u003e\n\n\u003cp\u003eBut after this when I am again changing language 'arabic' to 'english' then instead of changing parameter of vurrent url its not concatenating parameter to current url like - \u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eCurrentPageUrl?___from_store=en_sa?___from_store=ar_sa\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eCan you plz let me know, how to solve this issue? \u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-10-10 12:08:42.343 UTC","last_activity_date":"2017-10-10 12:08:42.343 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1109236","post_type_id":"1","score":"0","tags":"magento2|multilingual|multistore","view_count":"18"} +{"id":"4401553","title":"Using C++ struct with iPhone app","body":"\u003cp\u003eAs I heard it is possible to use C++ Code within an iPhone (Objective C) project, I want to use an encryption library which is written in C++. However, the library uses a C++ type struct which uses a constructor, that I can't get right.\u003c/p\u003e\n\n\u003cp\u003eThe Struct looks like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003estruct SBlock\n{\n //Constructors\n SBlock(unsigned int l=0, unsigned int r=0) : m_uil(l), m_uir(r) {}\n //Copy Constructor\n SBlock(const SBlock\u0026amp; roBlock) : m_uil(roBlock.m_uil), m_uir(roBlock.m_uir) {}\n SBlock\u0026amp; operator^=(SBlock\u0026amp; b) { m_uil ^= b.m_uil; m_uir ^= b.m_uir; return *this; }\n unsigned int m_uil, m_uir;\n};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003efull source is available here: \u003ca href=\"http://www.codeproject.com/KB/security/blowfish.aspx\" rel=\"nofollow\"\u003ehttp://www.codeproject.com/KB/security/blowfish.aspx\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003ewhat's the easiest way to get around that issue?\nI've read the article about using c++ code on apple's developer site, but that didn't help much. \u003c/p\u003e","accepted_answer_id":"4401580","answer_count":"2","comment_count":"0","creation_date":"2010-12-09 18:07:02.753 UTC","favorite_count":"1","last_activity_date":"2010-12-09 18:11:55.25 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"473950","post_type_id":"1","score":"3","tags":"iphone|c++|objective-c|constructor|struct","view_count":"413"} +{"id":"21101835","title":"Django retrieve most recent model per day for each item in a list of foreign keys","body":"\u003cp\u003eI'm looking for the most efficient way to do the following:\u003c/p\u003e\n\n\u003cp\u003eI have the following model:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass DataEntry(models.Model):\n signal_name = models.CharField(max_length=255)#FK to Signal.name without telling Django (or the database) the relationship (LONG STORY, OUT OF MY HANDS)\n timestamp = models.DateTimeField()\n value = models.FloatField()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have a list of signal names (strings) and a list of days. I need to retrieve the most recent DataEntry for each signal name in the signal list for each day in the list of days. Essentially...\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efor signal in signal_list:\n for day in day_list:\n next_day = day + timedelta(days=1)\n entry_list.append(DataEntry.objects\n .filter(timestamp__lt=next_day)\n .filter(signal_name=signal)\n .order_by(\"-timestamp\")[0])\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis seems like it would generate a TON of database calls. Is there any ORM trickery I can utilize to turn this into as few database calls as possible?\u003c/p\u003e","answer_count":"0","comment_count":"5","creation_date":"2014-01-13 21:34:36.193 UTC","last_activity_date":"2014-01-13 21:41:30.197 UTC","last_edit_date":"2014-01-13 21:41:30.197 UTC","last_editor_display_name":"","last_editor_user_id":"886877","owner_display_name":"","owner_user_id":"886877","post_type_id":"1","score":"2","tags":"python|django|orm","view_count":"100"} +{"id":"31824311","title":"Line-height was larger than paragraph","body":"\u003cp\u003eI set font to 200px and line height to 200px, when i set it I expected font height exactly 200px but it isnt :(, paragraf has height 200px, but font has 223px, can you tell my why?\u003c/p\u003e\n\n\u003cp\u003eHTML\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;p class=\"par\"\u0026gt;\nA\u0026lt;span id=\"why\"\u0026gt;Áj\u0026lt;/span\u0026gt;gxÁj\n\u0026lt;/p\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCSS\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ebody{font-size: 200px;font-family: Arial;line-height: 200px;}\n.par{background-color: rgba(0, 255, 0, 0.5);}\n#why{background-color: rgba(255, 0, 0, 0.5);}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003ca href=\"https://jsfiddle.net/0466uLkv/5/\" rel=\"nofollow\"\u003eFiddle link\u003c/a\u003e\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2015-08-05 05:48:12.893 UTC","last_activity_date":"2015-08-05 06:03:23.353 UTC","last_edit_date":"2015-08-05 06:03:23.353 UTC","last_editor_display_name":"","last_editor_user_id":"3243201","owner_display_name":"","owner_user_id":"5059321","post_type_id":"1","score":"0","tags":"html|css|html5","view_count":"62"} +{"id":"45881732","title":"Strip trailing decimal points from floats in pandas","body":"\u003cp\u003eAll columns in my dataset seem to be floats. \nSome contain values like like '20. ' or '11. ' \u003c/p\u003e\n\n\u003cp\u003eHow can I selectively and quickly remove the dot and space, without affecting the other values in the column, like '24.4' or '12.5'? \u003c/p\u003e\n\n\u003cp\u003eI have tried several solutions but none of them worked. \u003c/p\u003e\n\n\u003cp\u003eMy goal is to change, for example, '12. ' to '12', for each value in each cell where '. ' appears.\u003c/p\u003e","accepted_answer_id":"45881795","answer_count":"3","comment_count":"1","creation_date":"2017-08-25 12:43:41.99 UTC","last_activity_date":"2017-08-27 09:16:19.373 UTC","last_edit_date":"2017-08-25 13:28:56.843 UTC","last_editor_display_name":"","last_editor_user_id":"4909087","owner_display_name":"","owner_user_id":"5402142","post_type_id":"1","score":"-1","tags":"python|pandas|datagram","view_count":"165"} +{"id":"8400312","title":"Accessing raw request string from Flask app","body":"\u003cp\u003eIs it possible to access the raw, unparsed request data from within a Flask app?\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2011-12-06 13:01:29.7 UTC","favorite_count":"1","last_activity_date":"2014-11-24 13:52:36.8 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"311220","post_type_id":"1","score":"3","tags":"python|httprequest|flask","view_count":"1610"} +{"id":"25356703","title":"Tomcat connector architecture, thread pools and async servlets","body":"\u003cp\u003eI would like to understand Tomcat's thread model for BIO and NIO connectors. I am referencing the official Tomcat 7 documentaion for connectors which can be found \u003ca href=\"http://tomcat.apache.org/tomcat-7.0-doc/config/http.html\"\u003ehere\u003c/a\u003e. Based on it, this is what I have in doubt:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003cstrong\u003eacceptorThread(s)\u003c/strong\u003e : This is a single or at the most 2 threads (as mentioned in the doc) which is responsible only for accepting in-coming connections. This can be configured using \u003cem\u003eacceptorThreadCount\u003c/em\u003e, and it's suggested that more than two can be used for a multi-cpu machine - \n\u003cul\u003e\n\u003cli\u003ewhy is this ? \u003c/li\u003e\n\u003cli\u003eDoes this imply that the number of simultaneous open connections scales with the number of cpus versus the number of open file descriptors allowed on the server system ? \u003c/li\u003e\n\u003c/ul\u003e\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003emaxConnections(s)\u003c/strong\u003e : \n\u003cul\u003e\n\u003cli\u003eWhat is the relation between this setting and \u003cem\u003eacceptCount\u003c/em\u003e and the number of open file descriptors on the system. \u003c/li\u003e\n\u003cli\u003eWhy is the default value for this so much higher for the NIO connector ( \u003cem\u003e10000\u003c/em\u003e ) than for the BIO ( \u003cem\u003e= maxThreads\u003c/em\u003e ) ?\u003c/li\u003e\n\u003c/ul\u003e\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eacceptCount\u003c/strong\u003e : This is the queue for requests when all request processing threads are busy. \n\u003cul\u003e\n\u003cli\u003eWhen requests are put into this queue, is a file descriptor assigned to it as well ? Or is it only when a request is being actively processed, does it consume a file descriptor ?\u003c/li\u003e\n\u003c/ul\u003e\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003erequest processing threads\u003c/strong\u003e : The number of threads in this pool is configured by the \u003cem\u003emaxThreads\u003c/em\u003e and \u003cem\u003eminSpareThreads\u003c/em\u003e attributes. \n\u003cul\u003e\n\u003cli\u003eWhat is the relation between this thread pool and the \u003cem\u003eacceptorThreads\u003c/em\u003e ? Does the acceptor thread(s) spawn the threads in this pool ? \u003c/li\u003e\n\u003cli\u003eAs I understand, the NIO model is more efficient with the request processing threads than the BIO model. How does it achieve this efficiency ? \u003c/li\u003e\n\u003cli\u003eAs I've read in various sources, threads in the NIO model follow the \u003cem\u003ethread per request\u003c/em\u003e paradigm vs the \u003cem\u003ethread per connection\u003c/em\u003e paradigm of the BIO model. Also, in the NIO connector model, the actual request processing is delegated to a different, application monitored thread while the server's request processing thread is returned to the thread pool- free to accept more connections. \u003cstrong\u003eSo, does this imply that the benefit of the NIO model will only be apparent if the connections to the server are of the \u003cem\u003eHTTP Keep-Alive\u003c/em\u003e nature or if the application is using \u003cem\u003eServlet 3.0\u003c/em\u003e's asynchronous processing feature ?\u003c/strong\u003e \u003c/li\u003e\n\u003c/ul\u003e\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eServlet 3.0\u003c/strong\u003e : \n\u003cul\u003e\n\u003cli\u003eWhen using Servlet 3.0, what should be the size of the application servlet thread pool ( relative to the connector thread pool size ) to achieve optimum efficiency ? \u003c/li\u003e\n\u003cli\u003eWhen using the BIO model and this together, will there be any difference as to how requests are processed ( given that the connector threads will still be using the \u003cem\u003ethread per connection\u003c/em\u003e model ) ? \u003c/li\u003e\n\u003c/ul\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003e\u003cem\u003ePlease note: All discussion with respect to tomcat 7.\u003c/em\u003e\u003c/p\u003e","accepted_answer_id":"26812437","answer_count":"1","comment_count":"0","creation_date":"2014-08-18 05:13:11.153 UTC","favorite_count":"12","last_activity_date":"2015-12-09 15:56:58.237 UTC","last_edit_date":"2014-08-20 07:02:25.843 UTC","last_editor_display_name":"","last_editor_user_id":"1906572","owner_display_name":"","owner_user_id":"1906572","post_type_id":"1","score":"18","tags":"java|multithreading|tomcat|servlets|servlet-3.0","view_count":"4194"} +{"id":"10240980","title":"NullPointerException VideoView and MediaController on Fragment in android","body":"\u003cp\u003eI am developing Galaxy Tab 10.1 app by using honeycomb 3.1 and i have a videoview and mediacontroller in fragment on the right side. I defined VideoView and MediaController in Layout xml file and instantiate and manipulate them in the related java file.\u003c/p\u003e\n\n\u003cp\u003eAs you guys konw, in the java file, i set VideoView's controller to MediaController and set MediaController's media player to VideoView, i defined.\u003c/p\u003e\n\n\u003cp\u003eBelow is fragment layout xml file\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;LinearLayout\n android:layout_width=\"match_parent\"\n android:layout_height=\"match_parent\"\n android:orientation=\"vertical\" \u0026gt;\n\n \u0026lt;VideoView\n android:id=\"@+id/video\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"match_parent\" /\u0026gt;\n\n \u0026lt;MediaController\n android:id=\"@+id/controller\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\"\n android:layout_gravity=\"center_horizontal\" /\u0026gt;\n\u0026lt;/LinearLayout\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand java code file is below\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class ContentFragment extends Fragment {\n private VideoView mVideo;\n private MediaController mController;\n\n @Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.content, null);\n mVideo = (VideoView)view.findViewById(R.id.video);\n mController = (MediaController)view.findViewById(R.id.controller);\n mVideo.setMediaController(mController);\n mController.setMediaPlayer(mVideo);\n\n return view;\n }\n\n public void playVideo(String path) {\n mVideo.setVideoPath(path);\n mVideo.requestFocus();\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut while running this app, there occurs \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eNullPointerException with\n android.widget.MediaController.show(MediaController.java:305)\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI tried to solve this error a whole day but i can't get the reason why. actullay there isn't enought information for this.\nDose any body know what i did wrong? or have solutions?\nPlease let me know.\u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","accepted_answer_id":"10241331","answer_count":"2","comment_count":"0","creation_date":"2012-04-20 05:53:25.987 UTC","last_activity_date":"2016-03-25 13:14:34.53 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1343302","post_type_id":"1","score":"0","tags":"android|nullpointerexception|show|fragment|mediacontroller","view_count":"3452"} +{"id":"37290659","title":"Angular ng-style on body tag for different page backgrounds?","body":"\u003cp\u003eI am new to angular and ngroute and am trying to use ng-style to have a different image background for each page of a website. Currently it sets the background of all the site's pages, even when I have different controller scope image urls.\u003c/p\u003e\n\n\u003cp\u003eMy html is like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;body ng-controller=\"mainController\" ng-style=\"bodyStyles\"\u0026gt;\n...\n \u0026lt;div id=\"main\"\u0026gt;\n \u0026lt;div ng-view\u0026gt;\u0026lt;/div\u0026gt;\n\u0026lt;/body\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy script:\n var angVenture = angular.module('angVenture', ['ngRoute']);\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e// configure routes\nangVenture.config(function($routeProvider, $locationProvider) {\n $routeProvider\n\n // route for the index page\n .when('/home', {\n templateUrl : 'pages/home.html',\n controller : 'mainController'\n })\n\n // route for the about page\n .when('/about', {\n templateUrl : 'pages/about.html',\n controller : 'aboutController'\n })\n\n ... more routes..... \n\n// create the controller\nangVenture.controller('mainController', function($scope) {\n // create a message to display in our view\n $scope.message = 'home page';\n $scope.bodyStyles ={\n \"background\": \"url(../images/someimage.jpg) no-repeat center center fixed\", \n \"-webkit-background-size\": \"cover\",\n \"-moz-background-size\": \"cover\",\n \"-o-background-size\": \"cover\",\n \"background-size\": \"cover\"\n }\n});\n\nangVenture.controller('aboutController', function($scope) {\n $scope.message = 'another page.';\n});\n\n....more controllers for different pages...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWould I be better off going about doing this with ui-router?\u003c/p\u003e","accepted_answer_id":"37290712","answer_count":"2","comment_count":"0","creation_date":"2016-05-18 05:00:49.377 UTC","last_activity_date":"2016-05-18 05:15:06.71 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4810599","post_type_id":"1","score":"1","tags":"javascript|css|angularjs|ngroute|ng-style","view_count":"563"} +{"id":"3874677","title":"The number of processes a user is running using bash","body":"\u003cp\u003eI would like to know how I could get the number of processes for each user that is currently logged in.\u003c/p\u003e","accepted_answer_id":"3875588","answer_count":"8","comment_count":"0","creation_date":"2010-10-06 16:19:15.433 UTC","favorite_count":"1","last_activity_date":"2017-04-07 17:24:40.43 UTC","last_edit_date":"2016-10-15 19:37:55.217 UTC","last_editor_display_name":"","last_editor_user_id":"212378","owner_display_name":"","owner_user_id":"438171","post_type_id":"1","score":"8","tags":"linux|bash|scripting","view_count":"18671"} +{"id":"42715276","title":"elastic search aggregate doesn't return data","body":"\u003cp\u003eIt possible that aggregate function returns data instead of count?\u003c/p\u003e\n\n\u003cp\u003eRight now I get:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003earray (size=3)\n'doc_count_error_upper_bound' =\u0026gt; int 0\n'sum_other_doc_count' =\u0026gt; int 0\n'buckets' =\u0026gt; \narray (size=2)\n 0 =\u0026gt; \n array (size=2)\n 'key' =\u0026gt; int 15\n 'doc_count' =\u0026gt; int 2\n 1 =\u0026gt; \n array (size=2)\n 'key' =\u0026gt; int 14\n 'doc_count' =\u0026gt; int 1\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut this is useless cause I need the actual data that represents this doc_count of 2 and doc_count of 1\u003c/p\u003e\n\n\u003cp\u003eI'm using elastica.io\u003c/p\u003e","accepted_answer_id":"42716990","answer_count":"1","comment_count":"0","creation_date":"2017-03-10 09:51:33.833 UTC","last_activity_date":"2017-03-10 11:45:34.57 UTC","last_edit_date":"2017-03-10 10:34:35.667 UTC","last_editor_display_name":"","last_editor_user_id":"5759047","owner_display_name":"","owner_user_id":"5759047","post_type_id":"1","score":"0","tags":"php|elasticsearch|elastica","view_count":"39"} +{"id":"44647414","title":"Facebook Graph API Upgrade","body":"\u003cp\u003eI'm working on website that has an old facebook API implementation with Facebook SKD for PHP. I'm not able to update SDK to newer version since it requires PHP 5.4, this project works under 5.3 so I'm forced to use old one.\nI have access to API upgrade tool and it shows me a lot of methods that I should fix, for example GET /posts\nAssume I want upgrade to v2.4 and I use \u003ca href=\"https://developers.facebook.com/docs/graph-api/reference/v2.4/page/feed\" rel=\"nofollow noreferrer\"\u003elink\u003c/a\u003e to find out what changed in that request. What I found:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e\u003cstrong\u003eDeprecated Fields\u003c/strong\u003e\u003c/p\u003e\n \n \u003cp\u003eAs of April 18, 2017, the following parameters are no longer supported\n by Graph API versions 2.9 and higher. For versions 2.8 and lower, the\n parameters will continue working until July 17, 2017.\u003c/p\u003e\n \n \u003cp\u003eThe \u003cstrong\u003elink\u003c/strong\u003e field is still supported, but its sub-fields have been\n deprecated. \u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI feel myself so stupid but I can't realize \u003cstrong\u003ewhat should I use instead of \u003cem\u003elink\u003c/em\u003e field after it will be deprecated on 17th July\u003c/strong\u003e?\u003c/p\u003e","accepted_answer_id":"44648020","answer_count":"1","comment_count":"3","creation_date":"2017-06-20 08:10:54.43 UTC","last_activity_date":"2017-06-20 08:41:33.04 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"8186819","post_type_id":"1","score":"0","tags":"facebook|api|upgrade","view_count":"93"} +{"id":"16977098","title":"quartz threw an unhandled Exception: : java.lang.NullPointerException with JSF+EJB","body":"\u003cp\u003eI am using JSF and EJB in my project.\u003c/p\u003e\n\n\u003cp\u003eI have one functionality where i need to send the sms to some people for every 1 hour.\u003c/p\u003e\n\n\u003cp\u003eFor that i am getting the information(some persons) from the database to whom i need to send.\u003c/p\u003e\n\n\u003cp\u003eWhile retrieving from the database it is throwing the following exceptions.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e09:51:29,640 ERROR [org.quartz.core.JobRunShell] (DefaultQuartzScheduler_Worker-2) Job group1.job1 threw an unhandled Exception: : java.lang.NullPointerException\nat hms.general.SendSMSJob.execute(SendSMSJob.java:43) [classes:]\nat org.quartz.core.JobRunShell.run(JobRunShell.java:213) [quartz-all-2.1.7.jar:]\nat org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:557) [quartz-all-2.1.7.jar:]\n\n09:51:29,640 ERROR [org.quartz.core.ErrorLogger] (DefaultQuartzScheduler_Worker-2) Job (group1.job1 threw an exception.: org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: java.lang.NullPointerException]\nat org.quartz.core.JobRunShell.run(JobRunShell.java:224) [quartz-all-2.1.7.jar:]\nat org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:557) [quartz-all-2.1.7.jar:]\nCaused by: java.lang.NullPointerException\nat hms.general.SendSMSJob.execute(SendSMSJob.java:43) [classes:]\nat org.quartz.core.JobRunShell.run(JobRunShell.java:213) [quartz-all-2.1.7.jar:]\n... 1 more\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe following code is for scheduler\n package hms.general;\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport javax.faces.bean.ApplicationScoped;\nimport javax.faces.bean.ManagedBean;\n\nimport org.quartz.JobDetail;\nimport org.quartz.Scheduler;\nimport org.quartz.SchedulerException;\nimport org.quartz.Trigger;\nimport org.quartz.impl.StdSchedulerFactory;\n\n\n@ManagedBean(eager=true)\n@ApplicationScoped\npublic class ScheduleBean {\npublic ScheduleBean() {\n try{\n Scheduler scheduler = StdSchedulerFactory.getDefaultScheduler();\n scheduler.start();\n\n JobDetail job = org.quartz.JobBuilder.newJob(SendSMSJob.class).withIdentity(\"job1\",\"group1\").build();\n Trigger trigger = org.quartz.TriggerBuilder.newTrigger().withIdentity(\"trigger1\",\"group1\").startNow().withSchedule(org.quartz.SimpleScheduleBuilder.simpleSchedule().withIntervalInHours(1).repeatForever()).build();\n scheduler.scheduleJob(job,trigger);\n\n }\n catch(SchedulerException se){\n se.getMessage();\n }\n}\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCode for JobScheduler\n import hms.db.PatientRegEMRemote;\n import hms.db.Prescription;\n import hms.db.PrescriptionEMRemote;\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport java.util.List;\n\n\nimport javax.ejb.EJB;\n\nimport org.quartz.Job;\nimport org.quartz.JobExecutionContext;\nimport org.quartz.JobExecutionException;\n\npublic class SendSMSJob implements Job {\n\n@EJB(mappedName = \"java:global/Hms-Main/PatientRegEM!hms.db.PatientRegEMRemote\")\npublic PatientRegEMRemote patreg_r;\n\n@EJB(mappedName = \"java:global/Hms-Main/PrescriptionEM!hms.db.PrescriptionEMRemote\")\nprivate PrescriptionEMRemote prescription_r;\n\npublic static void main(String ar[]){\n SendSMSJob hj = new SendSMSJob();\n try {\n hj.execute(null);\n } catch (JobExecutionException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n}\n@Override\npublic void execute(JobExecutionContext arg0) throws JobExecutionException {\n System.out.println(arg0.getJobDetail());\n System.out.println(\"I am in execute method....\");\n // TODO Auto-generated method stub\n System.out.println(\"Im inside execute method\");\n String s=\"select p from prescription p where p.smsflag=1\";\n System.out.println(s);\n List\u0026lt;Prescription\u0026gt; pre=prescription_r.retrieveAll(s);\n System.out.println(\".........\");\n for (Prescription p : pre) {\n System.out.println(p.getAppointno());\n }\n}\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-06-07 05:51:27.36 UTC","last_activity_date":"2013-06-07 06:23:42.46 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2314868","post_type_id":"1","score":"1","tags":"jsf-2|ejb|quartz-scheduler","view_count":"3111"} +{"id":"7662408","title":"Instantiating a generic extension of an abstract class","body":"\u003cp\u003eTrying to write some generalised code for Genetic Algorithms and I have an abstract class Genotype as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic abstract class Genotype {\nprivate ArrayList\u0026lt;Gene\u0026gt; genotype = new ArrayList\u0026lt;Gene\u0026gt;();\n\n//...\n\npublic Genotype(ArrayList\u0026lt;Gene\u0026gt; genotype) {\n setGenotype(genotype);\n setGenotypeLength(genotype.size());\n}\n\npublic abstract Phenotype\u0026lt;Gene\u0026gt; getPhenotype();\n\npublic abstract void mutate();\n\n//...\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis class is intended to be extended and the subclass obviously provides the implementation of getPhenotype() and mutate(). However, I also have a second class that takes two Genotype objects as parameters and returns an ArrayList containing Genotype objects. Since I don't know the type of the extended Genotype objects at this point I need to use a generic parameter as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class Reproducer {\n\n//...\n\n private \u0026lt;G extends Genotype\u0026gt; ArrayList\u0026lt;Genotype\u0026gt; crossover(G parent1, G parent2) {\n ArrayList\u0026lt;Genotype\u0026gt; children = new ArrayList\u0026lt;Genotype\u0026gt;();\n\n ArrayList\u0026lt;Gene\u0026gt; genotypeOne = ArrayListCloner.cloneArrayList(parent1.getGenotype());\n ArrayList\u0026lt;Gene\u0026gt; genotypeTwo = ArrayListCloner.cloneArrayList(parent2.getGenotype());\n\n //one point crossover\n int p = gen.nextInt(genotypeOne.size());\n\n for (int i = 0; i \u0026lt; p; i++) {\n genotypeOne.set(i, genotypeOne.get(i));\n genotypeTwo.set(i, genotypeTwo.get(i));\n }\n for (int i = p; i \u0026lt; 10; i++) {\n genotypeOne.set(i, genotypeTwo.get(i));\n genotypeTwo.set(i, genotypeOne.get(i));\n }\n\n children.add(new G(genotypeOne)); //THROWS ERROR: Cannot instantiate the type G\n children.add(new G(genotypeTwo)); //THROWS ERROR: Cannot instantiate the type G\n\n return children;\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, since I need to return two objects of type G in an ArrayList I clearly have a problem where I can't instantiate the new Genotype objects because they're 1. generic types and presumably 2. abstract.\u003c/p\u003e\n\n\u003cp\u003eThis might be a bad way of going about things all together but if anyone has a solution that would be great. Thank you.\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2011-10-05 13:54:19.99 UTC","last_activity_date":"2011-10-25 16:37:12.99 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"536840","post_type_id":"1","score":"1","tags":"java|generics|parameters|abstract|instantiation","view_count":"1021"} +{"id":"44777887","title":"Mule Http basic authentication - set username in variable","body":"\u003cp\u003eI have implemented HTTP Basic Authentication for my mule flow application.\u003c/p\u003e\n\n\u003cp\u003eIt listens on HTTP and the URI is \u003ca href=\"http://localhost:8082/login\" rel=\"nofollow noreferrer\"\u003ehttp://localhost:8082/login\u003c/a\u003e.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;flow name=\"wsGetReport\"\u0026gt;\n \u0026lt;http:listener config-ref=\"HTTP_Listener_Configuration\" path=\"${wsPath}\" doc:name=\"HTTP\"/\u0026gt;\n \u0026lt;logger level=\"INFO\" message=\"## received\" doc:name=\"Logger\"/\u0026gt;\n \u0026lt;http:basic-security-filter realm=\"mule-realm\"/\u0026gt;\n \u0026lt;flow-ref name=\"doSubFlow\" doc:name=\"doSubFlow\"/\u0026gt; \n \u0026lt;logger level=\"INFO\" message=\"## passed security\" doc:name=\"Logger\"/\u0026gt;\n \u0026lt;http:static-resource-handler resourceBase=\"${app.home}/classes\" doc:name=\"HTTP Static Resource Handler\" defaultFile=\"index.html\"/\u0026gt;\n\u0026lt;/flow\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI would retrieve the username typed in the login by the user, and show it in the http Static resource (an html page).\u003c/p\u003e\n\n\u003cp\u003eHow can I store the username used in authentication?\u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","accepted_answer_id":"44786043","answer_count":"3","comment_count":"0","creation_date":"2017-06-27 10:24:09.49 UTC","last_activity_date":"2017-10-17 05:26:51.673 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"453712","post_type_id":"1","score":"2","tags":"mule|mule-studio|httplistener","view_count":"80"} +{"id":"40037267","title":"How to send -f parameter equivalent from swiftmail?","body":"\u003cp\u003eI am trying to migrate from PHP mail to SendGrid using swift mail. I am not able to understand \u003ccode\u003e-f email\u003c/code\u003e additional parameter.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003email($Email,$sub,$cont,$headers,'-f noreply@mydomain.com')\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am not sure what type of header is this. Should i send this as path_header?\u003c/p\u003e\n\n\u003cp\u003eI could not undersrtand the explanation of this \u003ca href=\"https://stackoverflow.com/questions/8306576/php-mail-what-does-f-do\"\u003ehere\u003c/a\u003e.\u003c/p\u003e","accepted_answer_id":"40045809","answer_count":"1","comment_count":"0","creation_date":"2016-10-14 07:22:37.177 UTC","last_activity_date":"2016-10-14 14:36:41.667 UTC","last_edit_date":"2017-05-23 11:48:21.67 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"3615478","post_type_id":"1","score":"1","tags":"php|sendgrid|swiftmailer","view_count":"28"} +{"id":"15564685","title":"Slf4j compatibility issues between solr and hadoop","body":"\u003cp\u003eI am using behemoth solr on hadoop, and I am getting a conflict in the slf4j versions. Solr 3.6.2 uses slf4j-api-1.6.1 and hadoop 1.0.4 has libraries for slf4j-api-1.4.3. Due to this, I am unable to run the behemoth solr jar file on hadoop. What is the best way to resolve this conflict? One option is replacing slf4j libraries in hadoop, but I am not willing to do that. Any solution will be greatly appreciated.\u003c/p\u003e","accepted_answer_id":"15565508","answer_count":"1","comment_count":"0","creation_date":"2013-03-22 07:08:49.06 UTC","last_activity_date":"2013-03-22 08:06:15.427 UTC","last_edit_date":"2013-03-22 07:25:53.167 UTC","last_editor_display_name":"","last_editor_user_id":"1330721","owner_display_name":"","owner_user_id":"1330721","post_type_id":"1","score":"1","tags":"hadoop|solr|slf4j|behemoth","view_count":"483"} +{"id":"47414590","title":"Unable to upload file (size greater than 50KB) using Jquery hosted on apache httpd server","body":"\u003cp\u003eScenarios:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eI am able to upload files successfully which are less then 50 kb.\u003c/li\u003e\n\u003cli\u003eAnything greater then 50 kb the request does not reach the server itself(My observation).\u003c/li\u003e\n\u003cli\u003eAll GET requests are working fine.\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eAny help would be appreciated.\u003c/p\u003e\n\n\u003cp\u003eThanks in advance.\u003c/p\u003e\n\n\u003cpre class=\"lang-js prettyprint-override\"\u003e\u003ccode\u003eangular.module('myApp', []).directive('ngFiles', ['$parse', function($parse) {\n function fn_link(scope, element, attrs) {\n var onChange = $parse(attrs.ngFiles);\n element.on('change', function(event) {\n onChange(scope, {\n $files: event.target.files\n });\n });\n };\n\n return {\n link: fn_link\n }\n}]).controller('myController', function($scope, $http) {\n var formdata = new FormData();\n $scope.getTheFiles = function($files) {\n angular.forEach($files, function(value, key) {\n formdata.append(key, value);\n });\n };\n\n // NOW UPLOAD THE FILES.\n $scope.uploadFiles = function() {\n var request = {\n method: 'POST',\n url: '/api/fileupload/',\n data: formdata,\n headers: {\n 'Content-Type': undefined\n }\n };\n\n // SEND THE FILES.\n $http(request).success(function(d) {\n // Some Logic\n }).catch(function(Object) {\n // Some Logic\n });\n }\n});\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"2","creation_date":"2017-11-21 13:42:10.84 UTC","last_activity_date":"2017-11-21 13:44:44.15 UTC","last_edit_date":"2017-11-21 13:44:44.15 UTC","last_editor_display_name":"","last_editor_user_id":"519413","owner_display_name":"","owner_user_id":"3412033","post_type_id":"1","score":"0","tags":"jquery","view_count":"13"} +{"id":"11263574","title":"Hashing functions with special characters?","body":"\u003cp\u003eMy application requires database to store username and password. To hash password I am looking for SHA 1 algorithm. Basically I need few special characters such as . , ! @ # $ % ^ \u0026amp; * ( ) along with A-Z , a-z, 0-9 etc in my hash. \n\u003cbr\u003e\nAny way to get them?\n\u003cbr\u003e\nlooking for php or javascript implementation.\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2012-06-29 14:23:51.79 UTC","last_activity_date":"2012-06-29 14:26:04.393 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1287487","post_type_id":"1","score":"0","tags":"hash|sha1","view_count":"837"} +{"id":"11221380","title":"how to deploy python webservice on apache","body":"\u003cp\u003eI'm a green hand in Python.I have got a simple webservice with python as following:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eenter code here\n\nimport soaplib\nfrom soaplib.core.service import rpc, DefinitionBase\nfrom soaplib.core.model.primitive import String, Integer\nfrom soaplib.core.server import wsgi\nfrom soaplib.core.model.clazz import Array\nfrom soaplib.core.service import soap\n\nclass HelloWorldService(DefinitionBase):\n\n @soap(String,Integer,_returns=Array(String))\n def say_hello(self,name,times):\n results = []\n for i in range(0,times):\n results.append('Hello, %s'%name)\n return results\nif __name__=='__main__':\n\n try:\n\n from wsgiref.simple_server import make_server\n soap_application = soaplib.core.Application([HelloWorldService], 'tns')\n wsgi_application = wsgi.Application(soap_application)\n server = make_server('10.44.138.231', 9999, wsgi_application)\n server.serve_forever()\n\n except ImportError:\n\n print \"Error: example server code requires Python \u0026gt;= 2.5\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eit's very fast when I access the service in localhost,but it will become very slow from the another host in local area network.\u003c/p\u003e\n\n\u003cp\u003eso I want to deploy this program in apache,but it seems hard,I search this in google for a long time and it makes me very tired now. who can give me a help,Thank you\u003c/p\u003e","accepted_answer_id":"11221874","answer_count":"2","comment_count":"1","creation_date":"2012-06-27 07:32:42.987 UTC","favorite_count":"3","last_activity_date":"2012-06-27 08:06:29.98 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1484808","post_type_id":"1","score":"2","tags":"python|web-services|apache","view_count":"3329"} +{"id":"18483497","title":"A relational query, not sure how to build it with EXISTS","body":"\u003cpre\u003e\u003ccode\u003ecarts\nid user_id\n\ncart_proucts\nid cart_id product_id price\n\nproducts\nmuch details about the product...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo this is some easier form of my table structure currently. I have a list of product Id, that I need to check against a User if he has them or not, I know that by looking at cart_products which a cart belongs to a user, as the relationship described above. If he has I should retrieve that \"User\" and information he contains. But I also need to check if the price range of the product, i.e. the product must not be lower than 500 for i.e. The price column in the cart_products...\u003c/p\u003e\n\n\u003cp\u003eHow can I easiest build this sql? I am thinking of JOINS and some use of EXISTS or IN perhaps?\u003c/p\u003e","answer_count":"2","comment_count":"1","creation_date":"2013-08-28 09:00:06.827 UTC","last_activity_date":"2013-08-28 12:41:29.713 UTC","last_edit_date":"2013-08-28 10:05:24.83 UTC","last_editor_display_name":"","last_editor_user_id":"1529673","owner_display_name":"","owner_user_id":"946126","post_type_id":"1","score":"0","tags":"mysql","view_count":"66"} +{"id":"24905967","title":"Stop armv7s support in app update","body":"\u003cp\u003ePreviously, our iOS app supported armv6, armv7 and armv7s architectures. In the new version that is not submitted yet we added some third-party libraries that support armv6 and armv7 only. So the whole project was forced to support only these two architectures. I understand that armv7s is a superset of armv7 and compatibility won't be affected but is it ok to submit the update that doesn't support armv7s anymore to the App Store? Maybe someone had the same experience? \nThanks in advance.\u003c/p\u003e","accepted_answer_id":"25013502","answer_count":"1","comment_count":"5","creation_date":"2014-07-23 08:51:29.203 UTC","last_activity_date":"2014-07-29 10:47:55.187 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1351468","post_type_id":"1","score":"0","tags":"ios|app-store|armv7","view_count":"87"} +{"id":"41184290","title":"open javafx window with it's relative path","body":"\u003cp\u003eI need to open a fxml window from a javafx controler\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eStage graphStage = new Stage();\n FXMLLoader loader = new FXMLLoader();\n fenetre = new File(\"../graph/graph.fxml\");\n if (!fenetre.exists()) {\n System.out.println(\"fichier inexistant\");\n } else {\n Pane rootGraph = loader.load(getClass().getResource(fenetre.getPath()).openStream());\n GraphController controller = (GraphController) loader.getController();\n controller.getSystemChoice(id);\n Scene sceneGraph = new Scene(rootGraph);\n sceneGraph.getStylesheets().add(getClass().getResource(\"myStyle.css\").toExternalForm());\n\n graphStage.setTitle(\"Graphe\");\n graphStage.setScene(sceneGraph);\n graphStage.show();\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethe code doesn't fincd the file, how to reach this file ?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003econtroler is on: cloud/composant/controler.java\nmy fxml is on: cloud/graph/graph.fxml\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"41184491","answer_count":"1","comment_count":"0","creation_date":"2016-12-16 12:20:26.823 UTC","last_activity_date":"2016-12-16 12:31:46.563 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7238297","post_type_id":"1","score":"0","tags":"javafx|path","view_count":"44"} +{"id":"47349838","title":"How to pass Excel Array Formula to VBA UDF?","body":"\u003cp\u003eI have already looked at a similar solution \u003ca href=\"https://stackoverflow.com/questions/10286182/vba-udf-handles-arrays-differently\"\u003ehere\u003c/a\u003e but somehow I still could not make my code work.\u003c/p\u003e\n\n\u003cp\u003eI want to pass an output of an Array Formula as Input to UDF, process it and return a single value from it. Say just add all items in an array and return the value as an example. My main question is how to pass an output of an Array Formula to UDF and process it inside the UDF.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e'Public Function Test1(ParamArray Parm1() As Variant) As Integer\n'Dim i, j\n'i = 0\n'For j = LBound(Parm1) To UBound(Parm1)\n'\n' i = i + Parm1(j)\n'\n'Next j\n'Test1 = i\n'End Function\n\nPublic Function Test1(Parm1 As Variant) As Integer\nDim i, j\nDim tmparray() As Variant\ntmparray = Parm1\nFor j = LBound(tmparray, 1) To UBound(tmparray, 2)\n i = i + tmparray(j)\nNext j\nTest1 = i \nEnd Function\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAbove commented code did not work. I tried to modify it by referring the mentioned solution as pasted just below it, but still I could not make it work.\u003c/p\u003e\n\n\u003cp\u003eIn Excel Spreadsheet I am passing \u003ccode\u003e{=Test1(ROW(C1:C4))}\u003c/code\u003e as an Array Formula to this but it returns #VALUE!\u003c/p\u003e\n\n\u003cp\u003eIn above code (The commented one) if I test and debug thru below sub it works fine but when called from an Excel Array Formula like \u003ccode\u003e{=Test1(ROW(C1:C4))}\u003c/code\u003eit returns #VALUE!\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSub check()\n\nj = Test1(1, 2)\n\nEnd Sub\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCould someone help me further please?\u003c/p\u003e","answer_count":"1","comment_count":"4","creation_date":"2017-11-17 11:40:27.287 UTC","last_activity_date":"2017-11-17 12:07:46.08 UTC","last_edit_date":"2017-11-17 11:59:08.627 UTC","last_editor_display_name":"","last_editor_user_id":"8621585","owner_display_name":"","owner_user_id":"8621585","post_type_id":"1","score":"0","tags":"arrays|excel-vba","view_count":"22"} +{"id":"23466597","title":"Scaling ImageButton basing on screen size","body":"\u003cp\u003eIn my application i can scaling an ImageView using this class\u003c/p\u003e\n\n\u003cp\u003e`public class resizeAvatar extends View {\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate final Drawable sfondoAvatar;\n\npublic resizeAvatar(Context context) {\n super(context);\n\n sfondoAvatar = context.getResources().getDrawable(R.drawable.main_voice);\n setBackgroundDrawable(sfondoAvatar);\n\n}\n\npublic resizeAvatar(Context context, AttributeSet attrs) {\n super(context, attrs);\n\n sfondoAvatar = context.getResources().getDrawable(R.drawable.main_voice);\n setBackgroundDrawable(sfondoAvatar);\n}\n\npublic resizeAvatar(Context context, AttributeSet attrs, int defStyle) {\n super(context, attrs, defStyle);\n\n sfondoAvatar = context.getResources().getDrawable(R.drawable.main_voice);\n setBackgroundDrawable(sfondoAvatar);\n}\n\n@Override\nprotected void onMeasure(int widthMeasureSpec,\n int heightMeasureSpec) {\n int width = MeasureSpec.getSize(widthMeasureSpec);\n int height = width * sfondoAvatar.getIntrinsicHeight() / sfondoAvatar.getIntrinsicWidth();\n setMeasuredDimension(width, height);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e}\n`\u003c/p\u003e\n\n\u003cp\u003eAnd writing in the layout: \u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003e\u0026lt;com.myapp.app.resizeAvatar\n android:id=\"@+id/mainvoice\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_margin=\"5dp\"\n android:layout_centerVertical=\"true\"/\u0026gt;\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eBut in this way i can't have the onClick event.. i need do the same but using an ImageButton.. Is there a way?\u003c/p\u003e","accepted_answer_id":"23468965","answer_count":"1","comment_count":"0","creation_date":"2014-05-05 06:56:48.59 UTC","last_activity_date":"2014-05-05 09:22:13.17 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2241116","post_type_id":"1","score":"2","tags":"java|android|image-scaling|autoscaling|android-imagebutton","view_count":"45"} +{"id":"43739052","title":"Android - Cannot get priority of IntentFilter","body":"\u003cp\u003eIn my program I search for packages that match a specific intent.\u003cbr\u003e\nFrom the list of ResolveInfo I get, I then try and order the packages according to the priority of their IntentFilter. But when I use the intentFilter.getPriority() method, it always returns 0, even though different priority values are used in the manifest of the targeted packages.\u003c/p\u003e\n\n\u003cp\u003eHere is an example of a Manifest:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;intent-filter\n priority='100'\u0026gt;\n \u0026lt;action\n name='com.gsma.services.nfc.action.TRANSACTION_EVENT'\u0026gt;\n \u0026lt;/action\u0026gt;\n \u0026lt;category\n name='android.intent.category.DEFAULT'\u0026gt;\n \u0026lt;/category\u0026gt;\n \u0026lt;data\n scheme='nfc'\n host='secure'\n pathPattern='/SIM.*/a0000005595000000000000052414431'\u0026gt;\n \u0026lt;/data\u0026gt;\n \u0026lt;/intent-filter\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd here is the code in which I retrieve the ResolveInfo and the priority:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eIntent gsmaIntent = new Intent(); \ngsmaIntent.setAction(\"com.gsma.services.nfc.action.TRANSACTION_EVENT\"); \ngsmaIntent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);\ngsmaIntent.setData(Uri.parse(\"nfc://secure:0/\"+ seName+\"/\"+ strAid));\n\nPackageManager pm = mContext.getPackageManager();\nList\u0026lt;ResolveInfo\u0026gt; resInfo = pm.queryIntentActivities(gsmaIntent,\nPackageManager.MATCH_DEFAULT_ONLY | PackageManager.GET_RESOLVED_FILTER);\n\n ...\n\nif ((resInfo != null) \u0026amp;\u0026amp; (resInfo.size() != 0))\n{\n for (ResolveInfo res : resInfo)\n {\n intentFilter = res.filter;\n\n if (intentFilter != null)\n {\n priority = intentFilter.getPriority();\n ...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eEDIT: Could it be that info is missing for the queryIntentActivities() call?\u003cbr\u003e\nOn my first trial I did not used the PackageManager.GET_RESOLVED_FILTER flag and hence did not get the IntentFilter data. Is there another flag to retrieve the priority value?\u003c/p\u003e\n\n\u003cp\u003eEDIT 2: If the above code cannot work, does anyone know another way to get the the priority value from an IntentFIlter?\u003c/p\u003e","answer_count":"0","comment_count":"4","creation_date":"2017-05-02 13:23:03.413 UTC","last_activity_date":"2017-05-03 06:01:19.947 UTC","last_edit_date":"2017-05-03 06:01:19.947 UTC","last_editor_display_name":"","last_editor_user_id":"2909967","owner_display_name":"","owner_user_id":"2909967","post_type_id":"1","score":"0","tags":"java|android|intentfilter","view_count":"81"} +{"id":"16451817","title":"Can you make a user-based search with Facebook API?","body":"\u003cp\u003eOn Facebook when you write something in the search box in the top.\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eLike 'Eric'\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eYou first get the results with your friends named Eric and further down you get people you might know with X mutual friends and some random people in the vicinity you might know.\u003c/p\u003e\n\n\u003cp\u003eIs it possible to make a similar search with the Facebook API?\u003c/p\u003e\n\n\u003cp\u003eI've tried:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ehttps://graph.facebook.com/search?q=eric\u0026amp;type=user\u0026amp;fields=id,name\u0026amp;access_token= (my token)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd thought if I added my access_token I would get a search like the one on Facebook. But I just get some random Eric's from all over the world.\u003c/p\u003e\n\n\u003cp\u003eI'm writing a simple web application and getting this search to work would be great! Thanks!\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-05-08 23:20:09.663 UTC","last_activity_date":"2014-05-15 07:22:45.837 UTC","last_edit_date":"2014-05-15 07:22:45.837 UTC","last_editor_display_name":"","last_editor_user_id":"188331","owner_display_name":"","owner_user_id":"2364262","post_type_id":"1","score":"1","tags":"facebook|api|search|user","view_count":"848"} +{"id":"35139908","title":"ask user name and check if length is between 3 and 256 characters","body":"\u003cp\u003eI'm new in coding and I'm trying to have the user input his name and if the user's name is not between 3 and 256, he have to re enter his name!\nHere's my code so far...\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic static void main(String[] args) {\n String userName = \"\"; \n do {\n System.out.print(\"Enter your name (between 3 and 256 characters) :\");\n Scanner name = new Scanner(System.in);\n userName = name.nextLine();\n\n if ((userName.length() \u0026lt; 3) \u0026amp;\u0026amp; (userName.length() \u0026gt; 256));\n System.out.println(\"the length is not good\");\n\n } while ((userName.length() \u0026lt; 3) \u0026amp;\u0026amp; (userName.length() \u0026gt; 256));\n\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"35139966","answer_count":"2","comment_count":"2","creation_date":"2016-02-01 20:41:18.753 UTC","last_activity_date":"2016-02-01 23:58:00.633 UTC","last_edit_date":"2016-02-01 23:58:00.633 UTC","last_editor_display_name":"user5679752","owner_display_name":"","owner_user_id":"5869684","post_type_id":"1","score":"0","tags":"java","view_count":"60"} +{"id":"34804039","title":"Android testing of the floating view","body":"\u003cp\u003eI add a floating view to the WindowManager, and make it movable around the screen, and i can perform click event when i click this view, everything works fine.\u003c/p\u003e\n\n\u003cp\u003eHowever, I don't know how to \u003cstrong\u003eaccess this view in espresso or UIAutomator\u003c/strong\u003e.\u003c/p\u003e\n\n\u003ch2\u003eAdd view to WindowManager\u003c/h2\u003e\n\n\u003cpre\u003e\u003ccode\u003efinal WindowManager.LayoutParams layoutParams = new WindowManager.LayoutParams(\n WindowManager.LayoutParams.MATCH_PARENT,\n WindowManager.LayoutParams.MATCH_PARENT,\n type,\n WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE\n | WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH\n | WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS,\n PixelFormat.TRANSLUCENT\n );\n\n ImageView floatingView = new ImageView(mContext);\n floatingView.setContentDescription(\"bugtags_fab_des_normal\");\n mWindowManager.addView(floatingView, layoutParams);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003ch2\u003eThe Floating View\u003c/h2\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003ethe white-blue icon in rect is the floating view i am talking about.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/NaKmL.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/NaKmL.png\" alt=\"floating-view\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003ch2\u003eQuestion\u003c/h2\u003e\n\n\u003cp\u003eThe floating view response a click event, and perform some task, now i want to do this in AndroidJunit test.\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eEspresso\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eI try Espresso, using onView method, but the test case:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eonView(withContentDescription(\"bugtags_fab_des_normal\")).perform(click());\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eGet:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eandroid.support.test.espresso.NoMatchingViewException: No views in hierarchy found matching: with content description: is \"bugtags_fab_des_normal\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cul\u003e\n\u003cli\u003eUIAutomator\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eI try UIAutomator Viewer, but i can't find the floatingView in view hierarchy.\u003c/p\u003e\n\n\u003ch2\u003eHow\u003c/h2\u003e\n\n\u003cp\u003eHow can i access this view in \u003cstrong\u003eespresso or uiautomator\u003c/strong\u003e and perform click to it?\u003c/p\u003e\n\n\u003ch2\u003eAppendix\u003c/h2\u003e\n\n\u003ch3\u003eTest Case\u003c/h3\u003e\n\n\u003cpre\u003e\u003ccode\u003e@Test\npublic void testInvoke() {\n onView(withContentDescription(\"bugtags_fab_des_normal\")).perform(click());\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003ch3\u003eOutput log\u003c/h3\u003e\n\n\u003cp\u003e\u003ca href=\"https://gist.github.com/kevinho/27d0bd891a331aa954bd\" rel=\"nofollow noreferrer\"\u003eoutput-log-gist\u003c/a\u003e\u003c/p\u003e\n\n\u003ch3\u003eBugtags.com\u003c/h3\u003e\n\n\u003cp\u003eActually, i am using a sdk called \u003ca href=\"https://github.com/bugtags/Bugtags-Android\" rel=\"nofollow noreferrer\"\u003ebugtags.com\u003c/a\u003e, it's a simple tool for app bug reporting and crash analysis.\u003c/p\u003e","accepted_answer_id":"34847364","answer_count":"2","comment_count":"3","creation_date":"2016-01-15 03:42:36.177 UTC","favorite_count":"2","last_activity_date":"2016-01-18 04:36:06.267 UTC","last_edit_date":"2016-01-18 04:36:06.267 UTC","last_editor_display_name":"","last_editor_user_id":"1755542","owner_display_name":"","owner_user_id":"1755542","post_type_id":"1","score":"3","tags":"android|android-testing|android-espresso|android-uiautomator","view_count":"626"} +{"id":"44592390","title":"How to add zoom effect to an activity?","body":"\u003cp\u003eHello i want to add zoom option to this activity. I tried few things but failed is anyone can help me please?\nI followed this tutoril and made this activity.\nHere is tutorial : \u003ca href=\"https://www.numetriclabz.com/android-image-slider-using-androidimageslider-library-tutorial/\" rel=\"nofollow noreferrer\"\u003etutorial\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eHere is my activity.java\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class activity extends AppCompatActivity {\nprivate SliderLayout mDemoSlider;\n\n@Override\nprotected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity);\n\n\n mDemoSlider = (SliderLayout) findViewById(slider);\n\n\n HashMap\u0026lt;String, Integer\u0026gt; file_maps = new HashMap\u0026lt;String, Integer\u0026gt;();\n file_maps.put(\"img1\", R.drawable.img1);\n file_maps.put(\"img12\", R.drawable.img2);\n\n\n for (String name : file_maps.keySet()) {\n TextSliderView textSliderView = new TextSliderView(this);\n // initialize a SliderLayout\n textSliderView\n .description(name)\n .image(file_maps.get(name))\n .setScaleType(BaseSliderView.ScaleType.Fit);\n\n\n mDemoSlider.addSlider(textSliderView);\n }\n mDemoSlider.setPresetTransformer(SliderLayout.Transformer.ZoomOutSlide);\n mDemoSlider.setPresetIndicator(SliderLayout.PresetIndicators.Center_Bottom);\n mDemoSlider.setCustomAnimation(new DescriptionAnimation());\n mDemoSlider.setDuration(4000);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e}\u003c/p\u003e\n\n\u003cp\u003eand here is my activity.xml\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;com.daimajia.slider.library.SliderLayout\n android:id=\"@+id/slider\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"match_parent\"\n android:clickable=\"true\"\n android:focusable=\"true\"\n android:onClick=\"onClickk\"/\u0026gt;\n\n\u0026lt;com.daimajia.slider.library.Indicators.PagerIndicator\n android:id=\"@+id/custom_indicator\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:gravity=\"center\"\n /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNoone knows?\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-06-16 14:59:02.927 UTC","last_activity_date":"2017-06-16 22:34:52.587 UTC","last_edit_date":"2017-06-16 22:34:52.587 UTC","last_editor_display_name":"","last_editor_user_id":"8144647","owner_display_name":"","owner_user_id":"8144647","post_type_id":"1","score":"0","tags":"java|android","view_count":"32"} +{"id":"28052243","title":"Interface can never instantiate in java,But What happened,when Interface is used return type","body":"\u003cp\u003eWe know,interface can never instantiate in java. We can, however, refer to an object that implements an interface by the type of the interface\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic interface A\n{\n}\npublic class B implements A\n{\n}\n\npublic static void main(String[] args)\n{\n A test = new B(); //upcating\n //A test = new A(); // wont compile\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut I have become confused when interface is used return type,such as\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eMethod of DriverManager class which return Connection object\u003cbr\u003e\n public static Connection getConnection(String url);\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cpre\u003e\u003ccode\u003eConnection con=DriverManager.getConnection(String url);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSame problem\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eMethod of Connection interface which return Statement object\u003cbr\u003e\n public Statement createStatement();\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cpre\u003e\u003ccode\u003eStatement stat=con.createStatement();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI cannot understand,what happened when interface is used return type.\nPlease help me by explain.\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","accepted_answer_id":"28052281","answer_count":"2","comment_count":"5","creation_date":"2015-01-20 18:07:50.147 UTC","last_activity_date":"2015-01-20 18:18:00.76 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4255980","post_type_id":"1","score":"1","tags":"java|jdbc|interface|instance","view_count":"127"} +{"id":"42399058","title":"Liquibase transaction demarcation","body":"\u003cp\u003eI have 2 examples of Liquibase changesets where the second statements are failing(trying to insert a record with existing primary key), but the first ones are successful:\u003c/p\u003e\n\n\u003cp\u003eFailing/no record in databasechangelog: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e--changeset yura:2\ninsert into test2 values (4, 'test4');\ninsert into test2 values (2, 'test2');\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ePartially written, no record in databasechangelogg:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e--changeset yura:2\ninsert into test2 values (4, 'test4');\nALTER TABLE test2 ADD name varchar(50);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I try to run those statements on MySql directly, the behaviour is consistent for both because MySql(InnoDB) will wrap every statement in a separate transaction.\nWhy is Liquibase not consistent?\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2017-02-22 18:03:44.377 UTC","last_activity_date":"2017-02-23 10:23:22.51 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4470135","post_type_id":"1","score":"0","tags":"java|mysql|innodb|liquibase","view_count":"67"} +{"id":"1607698","title":"CSS Problems - 960.gs","body":"\u003cp\u003eI've decided to let tables out of my Web UIs but I'm suddenly having lots of trouble with CSS.\u003c/p\u003e\n\n\u003cp\u003eI've hacked a little bit into \u003ca href=\"http://960.gs/\" rel=\"nofollow noreferrer\"\u003e960.gs\u003c/a\u003e and I've made my own grid with only 8 columns, here it is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e.grid {\n margin-left: auto;\n margin-right: auto;\n width: 960px;\n}\n.grid ._01,\n.grid ._02,\n.grid ._03,\n.grid ._04,\n.grid ._05,\n.grid ._06,\n.grid ._07,\n.grid ._08 {\n display: inline;\n float: left;\n margin: 10px;\n position: relative;\n}\n.grid ._01 {\n width: 100px;\n}\n.grid ._02 {\n width: 220px;\n}\n.grid ._03 {\n width: 340px;\n}\n.grid ._04 {\n width: 460px;\n}\n.grid ._05 {\n width: 580px;\n}\n.grid ._06 {\n width: 700px;\n}\n.grid ._07 {\n width: 820px;\n}\n.grid ._08 {\n width: 940px;\n}\n.grid .clear {\n clear: both;\n display: block;\n height: 0px;\n overflow: hidden;\n visibility: hidden;\n width: 0px;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd here is the HTML:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"grid\"\u0026gt;\n \u0026lt;div class=\"_05\"\u0026gt;\n \u0026lt;img src=\"../logo.png\" alt=\"\" width=\"450\" height=\"60\" vspace=\"50\" /\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"_03\" align=\"center\"\u0026gt;\n \u0026lt;form id=\"form1\" name=\"form1\" method=\"post\" action=\"\"\u0026gt;\n \u0026lt;p\u0026gt;\n \u0026lt;label\u0026gt;Email\n \u0026lt;input type=\"text\" name=\"textfield\" id=\"textfield\" style=\"margin-right: 0;\" /\u0026gt;\n \u0026lt;/label\u0026gt;\n \u0026lt;/p\u0026gt;\n \u0026lt;p\u0026gt;\n \u0026lt;label\u0026gt;Password\n \u0026lt;input type=\"text\" name=\"textfield2\" id=\"textfield2\" /\u0026gt;\n \u0026lt;/label\u0026gt;\n \u0026lt;/p\u0026gt;\n \u0026lt;/form\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"clear\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;div class=\"_05\"\u0026gt;\n \u0026lt;div class=\"box\"\u0026gt;\n \u0026lt;h2\u0026gt;grid, _05, box, h2\u0026lt;/h2\u0026gt;\n \u0026lt;div class=\"content\"\u0026gt;grid, _05, box, content\u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"_03\"\u0026gt;\n \u0026lt;div class=\"box green\"\u0026gt;\n \u0026lt;h2\u0026gt;grid, _03, box, h2\u0026lt;/h2\u0026gt;\n \u0026lt;div class=\"content\"\u0026gt;\n \u0026lt;p\u0026gt;grid\u0026lt;/p\u0026gt;\n \u0026lt;p\u0026gt;_03\u0026lt;/p\u0026gt;\n \u0026lt;p\u0026gt;box\u0026lt;/p\u0026gt;\n \u0026lt;p\u0026gt;content\u0026lt;/p\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"clear\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;div class=\"_05\"\u0026gt;\n \u0026lt;div class=\"box yellow\"\u0026gt;\n \u0026lt;h2\u0026gt;grid, _05, box, h2\u0026lt;/h2\u0026gt;\n \u0026lt;div class=\"content\"\u0026gt;grid, _05, box, content\u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"_03\"\u0026gt;\n \u0026lt;div class=\"box red\"\u0026gt;\n \u0026lt;h2\u0026gt;grid, _03, box, h2\u0026lt;/h2\u0026gt;\n \u0026lt;div class=\"content\"\u0026gt;\n \u0026lt;p\u0026gt;grid\u0026lt;/p\u0026gt;\n \u0026lt;p\u0026gt;_03\u0026lt;/p\u0026gt;\n \u0026lt;p\u0026gt;box\u0026lt;/p\u0026gt;\n \u0026lt;p\u0026gt;content\u0026lt;/p\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"clear\"\u0026gt;\u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eHow can I make this...\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://i33.tinypic.com/148md76.png\" rel=\"nofollow noreferrer\"\u003ebogus UI http://i33.tinypic.com/148md76.png\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eLook more like this?\u003c/strong\u003e Specially, how can I change the \u003cstrong\u003eposition of the yellow box\u003c/strong\u003e and the login form in the top?\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://i36.tinypic.com/2upptua.png\" rel=\"nofollow noreferrer\"\u003emockup UI http://i36.tinypic.com/2upptua.png\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThanks in advance for all your input!\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2009-10-22 14:37:42.567 UTC","favorite_count":"0","last_activity_date":"2010-07-22 03:13:49.147 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"89771","post_type_id":"1","score":"3","tags":"html|css","view_count":"2959"} +{"id":"19684989","title":"how to allow only one active session per user","body":"\u003cp\u003eI want to implement a code that enables only one session per user.\nI use asp.net with forms authentication .\u003c/p\u003e\n\n\u003cp\u003eI read this post:\n\u003ca href=\"https://stackoverflow.com/questions/2922502/limit-only-one-session-per-user-in-asp-net\"\u003eLimit only one session per user in ASP.NET\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003ebut I want to do the opposite, to disconnect all previous sessions.\u003c/p\u003e\n\n\u003cp\u003ehere is my code:\u003c/p\u003e\n\n\u003cblockquote\u003e\n\u003cpre\u003e\u003ccode\u003evoid Application_Start(object sender, EventArgs e) \n{\n Application[\"UsersLoggedIn\"] = new System.Collections.Generic.Dictionary\u0026lt;string, string\u0026gt;(); }\n\u003c/code\u003e\u003c/pre\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003ewhen user logs in, I insert a record : username, sessionID.\nif the username exists, I just update the sessionID\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e void Application_BeginRequest(object sender, EventArgs e)\n {\n System.Collections.Generic.Dictionary\u0026lt;string, string\u0026gt; d = HttpContext.Current.Application[\"UsersLoggedIn\"] as System.Collections.Generic.Dictionary\u0026lt;string, string\u0026gt;;\n if (d != null)\n {\n if (d.Count \u0026gt; 0)\n {\n string userName = HttpContext.Current.User.Identity.Name;\n if (!string.IsNullOrEmpty(userName))\n {\n if (d.ContainsKey(userName))\n {\n if (d[userName] != HttpContext.Current.Session.SessionID)\n {\n FormsAuthentication.SignOut();\n Session.Abandon();\n }\n }\n }\n}\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut I get empty HttpContext.Current.User.\nI tried also \"AuthenticatedRequest\", but then I get null Session.\u003c/p\u003e\n\n\u003cp\u003eany idea please?\u003c/p\u003e","accepted_answer_id":"19686194","answer_count":"2","comment_count":"0","creation_date":"2013-10-30 14:25:38.28 UTC","last_activity_date":"2013-10-30 15:59:00.177 UTC","last_edit_date":"2017-05-23 11:56:50.54 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"952162","post_type_id":"1","score":"2","tags":"c#|asp.net|session|login|global-asax","view_count":"1231"} +{"id":"1243898","title":"Cannot enable viewstate?","body":"\u003cp\u003eI have a web apllication with wizard control with 4 step index. Each having a dynamically editable grid which need to put only valid data \u0026amp; goto next.\u003c/p\u003e\n\n\u003cp\u003eIn one step which have 2 columns which are not require to be editable because it has set its value from previous field by calculation, done with javascript.\u003c/p\u003e\n\n\u003cp\u003eBut problem is that when we decalre these field as a enable false or read only mode then it works but can not able maintain state means its value goes off when we change the step index changed. (If that field are editable then it works ok.)\u003c/p\u003e\n\n\u003cp\u003eAlso I tried it by use of label field but the same thing happen when the step changes label can not maintan its state (its value clears when step changes). \u003c/p\u003e\n\n\u003cp\u003ePlease give me idea how to resolve this problem. Also each step has a dynamically created editable grid. \u003c/p\u003e\n\n\u003cp\u003eThanks \u0026amp; Regards,\n Girish\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2009-08-07 09:45:39.53 UTC","last_activity_date":"2011-03-21 19:17:56.78 UTC","last_edit_date":"2009-08-07 12:11:03.73 UTC","last_editor_display_name":"","last_editor_user_id":"21579","owner_display_name":"","owner_user_id":"136161","post_type_id":"1","score":"0","tags":"asp.net-2.0","view_count":"90"} +{"id":"5259031","title":"Displaying error messages in WebSeal","body":"\u003cp\u003eI have an application in webseal. The problem is that when an error (403 or 404) comes, the error pages of webseal are not being displayed.\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2011-03-10 11:26:46.363 UTC","favorite_count":"1","last_activity_date":"2017-07-06 13:36:45.14 UTC","last_edit_date":"2017-07-06 13:36:45.14 UTC","last_editor_display_name":"","last_editor_user_id":"1033581","owner_display_name":"","owner_user_id":"420613","post_type_id":"1","score":"1","tags":"java|webseal","view_count":"309"} +{"id":"37024926","title":"json schema validator throwing exception when empty array is present in response","body":"\u003cp\u003eI am getting following exception if I place dummy array. eg, in Security/RelatedSecurities/RelatedSecurities. I tried to build a json schema from the response where it is empty. But if I use json validator it gives sytax error \"array must have atleast one element\". So I used the dummy array elements. After that I do not get syntax error but the validation fails with following error. Actual not matching with expected.\nI will be happy to share the response and json schema if anyone is willing to help.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eat sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\nat sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)\nat sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)\nat java.lang.reflect.Constructor.newInstance(Constructor.java:526)\nat org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:80)\nat org.codehaus.groovy.reflection.CachedConstructor.doConstructorInvoke(CachedConstructor.java:74)\nat org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrap.callConstructor(ConstructorSite.java:84)\nat org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60)\nat org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:235)\nat org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:247)\nat com.jayway.restassured.internal.ResponseSpecificationImpl$HamcrestAssertionClosure.validate(ResponseSpecificationImpl.groovy:598)\nat com.jayway.restassured.internal.ResponseSpecificationImpl$HamcrestAssertionClosure$validate$1.call(Unknown Source)\nat org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)\nat org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)\nat org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)\nat com.jayway.restassured.internal.ResponseSpecificationImpl.validateResponseIfRequired(ResponseSpecificationImpl.groovy:760)\nat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)\nat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\nat java.lang.reflect.Method.invoke(Method.java:606)\nat org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:210)\nat org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:59)\nat org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52)\nat org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:154)\nat org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:166)\nat com.jayway.restassured.internal.ResponseSpecificationImpl.content(ResponseSpecificationImpl.groovy:92)\nat com.jayway.restassured.specification.ResponseSpecification$content$0.callCurrent(Unknown Source)\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"2","creation_date":"2016-05-04 10:22:17.83 UTC","last_activity_date":"2016-05-04 10:22:17.83 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3419588","post_type_id":"1","score":"0","tags":"jsonschema","view_count":"57"} +{"id":"43697257","title":"GT06 GPS Module TCP server in Python","body":"\u003cp\u003eI am using python socketserver module to develop the GT06 server. Which will respond to the GPS GT06 module. \u003c/p\u003e\n\n\u003cp\u003eI am getting the Login Message \u003ccode\u003e78 78 0d 01 03 58 73 50 70 57 91 97 00 11 ab 0d 0d 0a\u003c/code\u003e in HEX.\u003c/p\u003e\n\n\u003cp\u003eUpon receiving the value I am using \u003ccode\u003eencode('hex')\u003c/code\u003e so that I can parse the input and respond with appropriate Login Response:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass ThreadedTCPRequestHandler(SocketServer.BaseRequestHandler):\n\n def handle(self):\n data = self.request.recv(1024)\n cur_thread = threading.current_thread()\n time_rec = time.strftime(\"%b %d %Y %H:%M:%S\", time.gmtime(time.time()))\n print \"received data from client socket %s :%s\" % (time_rec, data.encode(\"hex\"))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I am sending the response first I generate the login response as \u003ccode\u003e78 78 05 01 00 11 c9 5d 0d 0a\u003c/code\u003e and then convert it to HEX values using \u003ccode\u003edecode('hex')\u003c/code\u003e and then send those value to GT06 terminal back:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elogin = LoginMessagePacket(gps_input=data.encode('hex'))\nresp = login.response()\nprint \"Sent to client: %s\" % login.response()\nself.request.sendall(resp)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003ccode\u003eLoginMessagePacket\u003c/code\u003e is the class which handles and parsing and validation of Login Message by terminal.\u003c/p\u003e\n\n\u003cp\u003eMy problem is even I am sending the response as per the protocol I am not getting the GPS data and terminal keep sending the login request packet. \u003c/p\u003e\n\n\u003cp\u003eP.S. I tested the AWS server if server is responding to the TCP request properly and I am sure server is sending the response. \u003c/p\u003e\n\n\u003cp\u003eAny help is much appreciated.\u003c/p\u003e\n\n\u003cp\u003eThanks in advance.\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-04-29 15:14:44.207 UTC","last_activity_date":"2017-09-23 20:03:13.527 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4393814","post_type_id":"1","score":"0","tags":"python|gps|tcp-ip|socketserver","view_count":"188"} +{"id":"24991837","title":"How to eliminate the use of this class variable","body":"\u003cp\u003eRuby 2.0.0, Rails 4.0.3, Windows 8.1 Update, PostgreSQL 9.3.3\u003c/p\u003e\n\n\u003cp\u003eI have built an XLog class that allows me to write records to PostgreSQL from within any controller in my application. However, it's built around the use of a class variable. I am wondering whether I can convert this to an instance variable.\u003c/p\u003e\n\n\u003cp\u003eIn the ApplicationController, I instantiate the class variable and write the first record:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e @@xaction = XLog.new\n @@xaction.info(\n controller: self.class.name,\n action: \"start\",\n status: \"success\"\n )\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAt any point in the application, I can reference @@xaction.info with a hash to log the success or failure of any transaction. It works...\u003c/p\u003e\n\n\u003cp\u003eXLog is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass XLog \u0026lt; ActiveRecord::Base\n def info hash\n logger.info \"XLog \" \u0026lt;\u0026lt; hash.collect { |key, value| \"#{key}: #{value}; \"}.join # map?\n XLog.create(\n controller: hash[:controller],\n associate: hash[:associate],\n proxy: hash[:proxy],\n object: hash[:object],\n value: hash[:value],\n action: hash[:action],\n status: hash[:status],\n message: hash[:message]\n )\n end\nend\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"24992275","answer_count":"2","comment_count":"0","creation_date":"2014-07-28 09:08:38.75 UTC","favorite_count":"1","last_activity_date":"2014-07-28 10:57:18.077 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1843663","post_type_id":"1","score":"0","tags":"ruby-on-rails|ruby|postgresql|logging","view_count":"61"} +{"id":"44321572","title":"How to keep the DropDown list opened after PostBack in ASP","body":"\u003cp\u003eI have a DropDown like below:-\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;telerik:RadComboBox ID=\"RadComboBox\" runat=\"server\" EmptyMessage=\"Select\" DataSourceID=\"SqlDataSource1\" DataTextField=\"name\" DataValueField=\"id\" ShowMoreResultsBox=\"true\" EnableVirtualScrolling=\"true\" HighlightTemplatedItems=\"true\" ItemsPerRequest=\"10\" \u0026gt;\n \u0026lt;HeaderTemplate\u0026gt;\n \u0026lt;table style=\"width: 500px\"\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td style=\"font-weight: bold; width: 400px\"\u0026gt;\u0026lt;asp:LinkButton ID=\"LinkButton1\" runat=\"server\" ReadOnly=\"true\" Font-Bold=\"true\" Text=\"Name\" OnClick=\"LB_Click\" \u0026gt;\u0026lt;/asp:LinkButton\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;td style=\"font-weight: bold; width: 100px\"\u0026gt;ID\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;/table\u0026gt;\n \u0026lt;/HeaderTemplate\u0026gt;\n \u0026lt;ItemTemplate\u0026gt;\n \u0026lt;table style=\"width: 500px\"\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td style=\"width: 400px\"\u0026gt;\u0026lt;%#DataBinder.Eval(Container.DataItem, \"name\")%\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;td style=\"width: 100px\"\u0026gt;\u0026lt;%#DataBinder.Eval(Container.DataItem, \"id\")%\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;/table\u0026gt;\n \u0026lt;/ItemTemplate\u0026gt;\n \u0026lt;/telerik:RadComboBox\u0026gt;\n \u0026lt;asp:SqlDataSource runat=\"server\" ID=\"SqlDataSource1\" ConnectionString=\"\u0026lt;%$ ConnectionStrings:SqlConnectionString %\u0026gt;\" ProviderName=\"System.Data.SqlClient\" SelectCommand=\"SELECT * FROM table1 order by name asc\" /\u0026gt; \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I run the application and click on the RadComboBox, then the DropDown \u003ccode\u003eList\u003c/code\u003e opens and shows the items in the DropDown list.\u003c/p\u003e\n\n\u003cp\u003eNow when I click \u003ccode\u003eLinkButton1\u003c/code\u003e (i.e \u003ccode\u003eName\u003c/code\u003e) there is a PostBack of the page, then the opened DropDown list closes automatically and again I have to click on my \u003ccode\u003eRadComboBox\u003c/code\u003e to open the DropDown list, \u003c/p\u003e\n\n\u003cp\u003eIs there a way to keep the DropDown list opened, after the postback of the page ?\u003c/p\u003e\n\n\u003cp\u003eCould anyone please help . ThankYou. \u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2017-06-02 05:41:23.637 UTC","last_activity_date":"2017-06-02 06:08:44.84 UTC","last_edit_date":"2017-06-02 06:08:44.84 UTC","last_editor_display_name":"","last_editor_user_id":"7952424","owner_display_name":"","owner_user_id":"7952424","post_type_id":"1","score":"0","tags":"javascript|asp.net|vb.net|drop-down-menu","view_count":"48"} +{"id":"34754589","title":"Retrieve Boolean value of 'isAVideo' Key in Parse","body":"\u003cp\u003eUsers of my app can upload images or videos. If the user uploads a video, a still image representation is also uploaded to the @\"images\" column in parse. Those files populate a Table View of still images. \nI created a third column to manage a boolean value indicating if the object isAVideo (True or False).\u003c/p\u003e\n\n\u003cp\u003eIn my Table View feedcell.m file I have a method to set the feed Item like so\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e- (void)setFeedItem:(PFObject *)feedItem\n{\nNSLog(@\"setting feed item\");\n_feedItem = feedItem;\n\nPFUser *user = [feedItem objectForKey:@\"user\"];\n[_usernameButton setTitle:user.username\n forState:UIControlStateNormal];\n\nPFQuery *query = [PFQuery queryWithClassName:@\"tfeed\"];\n\n[query getFirstObjectInBackgroundWithBlock:^(PFObject *object, NSError *error) {\n if (!object) {\n // Found nothing\n } else {\n BOOL isVideo = [[object objectForKey:@\"isAVideo\"]boolValue];\n if (isVideo == true) {\n NSLog(@\"Object is a VIDEO\");\n _pictureView.image = self.feedImage;\n // Create play button\n UIButton *playButton = [UIButton buttonWithType:UIButtonTypeCustom];\n [playButton addTarget:self\n action:@selector(playVideo:)\n forControlEvents:UIControlEventTouchUpInside];\n // Set the play image\n UIImage *playImage = [UIImage imageNamed:@\"playButtonImage.pgn\"];\n [playButton setImage:playImage forState:UIControlStateNormal];\n playButton.frame = CGRectMake(0, 0, 375, 375);\n [_pictureView addSubview:playButton];\n [_pictureView bringSubviewToFront:playButton];\n\n } else {\n NSLog(@\"Object is not a video\");\n _pictureView.image = self.feedImage;\n }\n }\n}];\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy goal is to add a play button when the object is a video, but the button is added to all objects regardless of it Bool value. \u003c/p\u003e\n\n\u003cp\u003eI think my query and/or conditional statement must be wrong.\u003c/p\u003e\n\n\u003cp\u003eEDIT: removed line: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[query whereKey:@\"isAVideo\" equalTo:[NSNumber numberWithBool:YES]];\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"4","creation_date":"2016-01-12 22:01:14.437 UTC","last_activity_date":"2016-01-12 22:40:50.783 UTC","last_edit_date":"2016-01-12 22:40:50.783 UTC","last_editor_display_name":"","last_editor_user_id":"4378949","owner_display_name":"","owner_user_id":"4378949","post_type_id":"1","score":"0","tags":"objective-c|uitableview|parse.com|uiimageview|avfoundation","view_count":"29"} +{"id":"22659126","title":"Setting near mode for depth cam in Kinect using OpenNI","body":"\u003cp\u003eI have been unable to find out how i can set the Kinect depth mode to near (40-300mm) using OpenNi. I am programming in C++ and would like to keep using the OpenNi libraries for retreiving the depth data, however i cannot find any property of setting that i should use for changing modes.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-03-26 11:09:56.12 UTC","favorite_count":"1","last_activity_date":"2017-04-19 15:49:35.387 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2028781","post_type_id":"1","score":"2","tags":"kinect|openni","view_count":"304"} +{"id":"9678364","title":"How to add arguments without key, to add only value to the body of ConnectionRequest","body":"\u003cp\u003eI want to add a Json object to ConnectionRequest as value without key. I know that if use standard addArgument(key,value) -\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eaddArgument(\"json\",\"{JsonObject}\")\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ein the body of request will be \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ejson={JsonObject}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut I need to add only JsonObject without key and \"=\" symbol.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{JsonObject}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs there any standard solution?\nOne more question Is there any class in Lwuit to create JsonObject similar to json.org.me\nThanks\u003c/p\u003e","accepted_answer_id":"9695760","answer_count":"1","comment_count":"0","creation_date":"2012-03-13 04:26:51.06 UTC","last_activity_date":"2012-03-14 04:04:09.97 UTC","last_edit_date":"2012-03-14 04:04:09.97 UTC","last_editor_display_name":"","last_editor_user_id":"756809","owner_display_name":"","owner_user_id":"1263443","post_type_id":"1","score":"0","tags":"lwuit|codenameone","view_count":"117"} +{"id":"40164982","title":"Sorting in ServiceNow - First by priority and then by updated Timestamp","body":"\u003cp\u003eIn a list view of the incident table in service now, I can easily sort by any given column. If I Filter my Incidents by priority and show only the \"high\" and \"very high\" open incidents I can sort that by priority. But unfortunately I didn't find a way to sort first by priority and then by updated. Meaning first I get the very high incidents ordered by the updated timestamp and then the high incidents by priority.\u003c/p\u003e\n\n\u003cp\u003eIs that possible to do? I would like to have this ordering in a report which I send out as .pdf.\u003c/p\u003e","accepted_answer_id":"40183795","answer_count":"1","comment_count":"0","creation_date":"2016-10-20 21:37:49.597 UTC","last_activity_date":"2016-10-21 19:04:08.94 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2508411","post_type_id":"1","score":"0","tags":"sorting|filter|servicenow","view_count":"46"} +{"id":"42396101","title":"App crashes when I try to switch from fragment to activity","body":"\u003cp\u003eI have 3 fragments in Main Activity and one of them has a button which I want to start Activity 2. I created interface in the third fragment and extended the Main Activity with it, but I cannot figure out why my app still crashes. I lost 2 days on that issue and its driving me nuts. My Activity 2 is declared in the Manifest file. Please help!!!\u003c/p\u003e\n\n\u003cp\u003eProfile.Fragment:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class ProfileFragment extends Fragment implements View.OnClickListener {\n\n private TextView tv_name,tv_email,tv_message;\n private SharedPreferences pref;\n private AppCompatButton btn_change_password,btn_logout, btn_ok;\n private EditText et_old_password,et_new_password;\n private AlertDialog dialog;\n private ProgressBar progress;\n\n public interface OnProfileListener{\n void onProfileButtonOkClicked();\n }\n\n private OnProfileListener mCallBack;\n\n @Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n\n View view = inflater.inflate(R.layout.fragment_profile,container,false);\n initViews(view);\n return view;\n\n }\n\n\n @Override\n public void onViewCreated(View view, Bundle savedInstanceState) {\n\n pref = getActivity().getPreferences(0);\n tv_name.setText(\"Здравей, \"+pref.getString(Constants.NAME,\"\")+\"!\");\n tv_email.setText(pref.getString(Constants.EMAIL,\"\"));\n btn_ok=(AppCompatButton)view.findViewById(R.id.btn_ok);\n btn_ok.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n mCallBack.onProfileButtonOkClicked();\n }\n });\n\n\n }\n\n//I have API16 and I cannot run my app with \n//onAttach(Context context) because it is supported by API\u0026gt;=23, \n//but Android deprecated API16, so that is why I use both Activity and Context\n\n @SuppressWarnings(\"deprecation\")\n @Override \n public void onAttach(Activity activity) {\n super.onAttach(activity);\n if (Build.VERSION.SDK_INT \u0026lt; Build.VERSION_CODES.LOLLIPOP_MR1) {\n if (activity instanceof OnProfileListener){\n mCallBack = (OnProfileListener) activity;\n } else {\n throw new RuntimeException(activity.toString()\n + \" must implement OnProfileListener\");\n }\n }}\n @TargetApi(23)\n @Override\n public void onAttach(Context context) {\n super.onAttach(context);\n if (context instanceof OnProfileListener) {\n mCallBack = (OnProfileListener) context;\n } else {\n throw new RuntimeException(context.toString()\n + \" must implement OnProfileListener\");\n }\n }\n\n...\n private void initViews(View view){\n\n tv_name = (TextView)view.findViewById(R.id.tv_name);\n tv_email = (TextView)view.findViewById(R.id.tv_email);\n btn_change_password = (AppCompatButton)view.findViewById(R.id.btn_chg_password);\n btn_logout = (AppCompatButton)view.findViewById(R.id.btn_logout);\n btn_ok=(AppCompatButton)view.findViewById(R.id.btn_ok);\n btn_change_password.setOnClickListener(this);\n btn_logout.setOnClickListener(this);\n\n\n }\n\n //Here I go to other fragment in Main Activity flawlessly, wish I could manage to go Activity2 with the same ease\n\n private void goToLogin(){\n\n Fragment login = new LoginFragment();\n FragmentTransaction ft = getFragmentManager().beginTransaction();\n ft.replace(R.id.fragment_frame,login);\n ft.commit();\n } \n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMainActivity.java:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport android.content.Intent;\nimport android.content.SharedPreferences;\nimport android.os.Bundle;\nimport android.support.v4.app.Fragment;\nimport android.support.v4.app.FragmentActivity;\nimport android.support.v4.app.FragmentTransaction;\n\npublic class MainActivity extends FragmentActivity implements\n ProfileFragment.OnProfileListener{\n\n private SharedPreferences pref;\n\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n pref = getPreferences(0);\n initFragment();\n onProfileButtonOkClicked();\n }\n @Override\n public void onProfileButtonOkClicked() {\n\n Intent intent=new Intent(this, Activity2.class);\n startActivity(intent);\n }\n\n private void initFragment(){\n Fragment fragment;\n if(pref.getBoolean(Constants.IS_LOGGED_IN,false)){\n fragment = new ProfileFragment();\n\n }else {\n fragment = new LoginFragment();\n }\n FragmentTransaction ft = getSupportFragmentManager().beginTransaction();\n ft.replace(R.id.fragment_frame,fragment);\n ft.commit();\n }\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"42398098","answer_count":"2","comment_count":"5","creation_date":"2017-02-22 15:46:29.98 UTC","last_activity_date":"2017-02-22 17:14:01.037 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6816631","post_type_id":"1","score":"0","tags":"java|android|performance|android-studio|android-fragments","view_count":"179"} +{"id":"13483430","title":"How to make rounded percentages add up to 100%","body":"\u003cp\u003eConsider the four percentages below, represented as \u003ccode\u003efloat\u003c/code\u003e numbers:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e 13.626332%\n 47.989636%\n 9.596008%\n 28.788024%\n -----------\n 100.000000%\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI need to represent these percentages as whole numbers. If I simply use \u003ccode\u003eMath.round()\u003c/code\u003e, I end up with a total of 101%. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e14 + 48 + 10 + 29 = 101\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf I use \u003ccode\u003eparseInt()\u003c/code\u003e, I end up with a total of 97%. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e13 + 47 + 9 + 28 = 97\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat's a good algorithm to represent any number of percentages as whole numbers while still maintaining a total of 100%?\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdit\u003c/strong\u003e: After reading some of the comments and answers, there are clearly many ways to go about solving this.\u003c/p\u003e\n\n\u003cp\u003eIn my mind, to remain true to the numbers, the \"right\" result is the one that minimizes the overall error, defined by how much error rounding would introduce relative to the actual value:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e value rounded error decision\n ----------------------------------------------------\n 13.626332 14 2.7% round up (14)\n 47.989636 48 0.0% round up (48)\n 9.596008 10 4.0% don't round up (9)\n 28.788024 29 2.7% round up (29)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn case of a tie (3.33, 3.33, 3.33) an arbitrary decision can be made (e.g. 3, 4, 3).\u003c/p\u003e","accepted_answer_id":"13485888","answer_count":"15","comment_count":"9","creation_date":"2012-11-20 22:38:55.757 UTC","favorite_count":"48","last_activity_date":"2017-09-13 22:34:47.657 UTC","last_edit_date":"2017-06-03 15:41:43.807 UTC","last_editor_display_name":"","last_editor_user_id":"6547518","owner_display_name":"","owner_user_id":"25842","post_type_id":"1","score":"121","tags":"algorithm|math|rounding|percentage","view_count":"55694"} +{"id":"46466617","title":"javascript: changing \"multiple\" attribute of the \"select\" element does not work","body":"\u003cp\u003eWindows 7 64 bit, Chrome version 61.0.3163.100\u003c/p\u003e\n\n\u003cp\u003eI have a html page with a listbox:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;select id='lst' multiple\u0026gt;...\u0026lt;/select\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI need to disable multiple items selection for this listbox.\nI have a javascript function with this code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elst = document.getElementById('lst');\nlst.multipe = false;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have checked in the debugger - the value changed to \"false\".\nBut in another function called \"onclick\", it is \"true\" again.\nAnd multiple items could be selected with [shift] or [ctrl] pressed.\u003c/p\u003e","accepted_answer_id":"46466781","answer_count":"2","comment_count":"1","creation_date":"2017-09-28 10:15:31.813 UTC","last_activity_date":"2017-09-28 10:25:54.29 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3565412","post_type_id":"1","score":"1","tags":"javascript|select","view_count":"24"} +{"id":"41525316","title":"Send command in Fiscal Epson tmT81 C#","body":"\u003cp\u003eI trying to print in a fiscal printer EPSON TMT81 i have example code in VB and i need to do the same in C#, im using EpsonFPHostControl. OCX 1.9\u003c/p\u003e\n\n\u003cp\u003eThe basic to work is sendcommand to the printer by COM port, i connect to the port with no problem but i cant send command by the port.\u003c/p\u003e\n\n\u003cp\u003eTo send commnad in VB the code is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e '*** PROBAR CONEXION CON IMPRESOR FISCAL ***\n '*** CHEQUEA ESTADO DE IMPRESOR FISCAL ***\n EpsonFPHostControl1.AddDataField (Chr$(\u0026amp;H0) \u0026amp; Chr$(\u0026amp;H1))\n EpsonFPHostControl1.AddDataField (Chr$(\u0026amp;H0) \u0026amp; Chr$(\u0026amp;H0))\n\n '*** ENVIA COMANDO FISCAL ***\n EpsonFPHostControl1.SendCommand\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIm trying to do the same in C#:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e //*** PROBAR CONEXION CON IMPRESOR FISCAL ***\n //*** CHEQUEA ESTADO DE IMPRESOR FISCAL ***\n EpsonFPHostControl1.AddDataField(\"H0H1\");\n EpsonFPHostControl1.AddDataField(\"H0H0\");\n\n //*** ENVIA COMANDO FISCAL ***\n EpsonFPHostControl1.SendCommand()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut it doesnt Work well :/, the fiscal printer receibe the command but return code 513 invalid frame of comand (frame de comando invalido)\u003c/p\u003e\n\n\u003cp\u003ei apreciate some help.\u003c/p\u003e","accepted_answer_id":"41525424","answer_count":"1","comment_count":"1","creation_date":"2017-01-07 19:03:14.96 UTC","last_activity_date":"2017-01-07 19:13:30.36 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6477361","post_type_id":"1","score":"0","tags":"c#|printing|epson|fiscal","view_count":"269"} +{"id":"5337364","title":"How do I convert config file to dict in Python?","body":"\u003cpre\u003e\u003ccode\u003eserver 192.168.10.10 443 {\n protocol TCP\n\n _server 192.168.10.1 443 {\n weight 1\n SSL_GET {\n url {\n path /\n }\n connect_timeout 3\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"2","creation_date":"2011-03-17 09:47:05.497 UTC","last_activity_date":"2011-03-17 15:52:24.913 UTC","last_edit_date":"2011-03-17 10:01:25.277 UTC","last_editor_display_name":"","last_editor_user_id":"216074","owner_display_name":"","owner_user_id":"664068","post_type_id":"1","score":"1","tags":"python","view_count":"218"} +{"id":"13544199","title":"Prevent user to go back, but filter is not working","body":"\u003cp\u003eI have a payment form. When user submit the form the payment process runs successfully, but clicking the back button brings user to same form. I want to expire the form after successful submission, to prevent user from multiple payment (in case user goes back and submit form).\nFollowing \u003ca href=\"https://stackoverflow.com/questions/4194207/prevent-user-from-going-back-to-the-previous-secured-page-after-logout\"\u003ePrevent user from going back\u003c/a\u003e tutorial, I added the filter but it's not working for me. What am I doing wrong? Here is what I added for filtering.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;filter\u0026gt;\n \u0026lt;filter-name\u0026gt;paymentFilter\u0026lt;/filter-name\u0026gt;\n \u0026lt;filter-class\u0026gt;path to PaymentFilter class\u0026lt;/filter-class\u0026gt;\n\u0026lt;/filter\u0026gt;\n\u0026lt;filter-mapping\u0026gt;\n \u0026lt;filter-name\u0026gt;paymentFilter\u0026lt;/filter-name\u0026gt;\n \u0026lt;url-pattern\u0026gt;/order/*/payment\u0026lt;/url-pattern\u0026gt;\n\u0026lt;/filter-mapping\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand my filter class is \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class PaymentFilter implements Filter {\n\n @Override\n public void init(FilterConfig filterConfig) throws ServletException {\n // TODO Auto-generated method stub \n }\n\n @Override\n public void doFilter(ServletRequest request, ServletResponse response,\n FilterChain chain) throws IOException, ServletException {\n\n HttpServletResponse httpServletResponse = (HttpServletResponse) response;\n httpServletResponse.setHeader(\"Cache-Control\", \"no-cache, no-store, must-revalidate\"); // HTTP 1.1.\n httpServletResponse.setHeader(\"Pragma\", \"no-cache\"); // HTTP 1.0.\n httpServletResponse.setDateHeader(\"Expires\", 0); // Proxies.\n System.out.println(\"In filter\"); \n }\n\n @Override\n public void destroy() {\n // TODO Auto-generated method stub \n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have added a \u003ccode\u003eSystem.out.println(\"In filter\")\u003c/code\u003e but I can't see its output (\"In filter\") on console after running the page.\u003c/p\u003e\n\n\u003cp\u003eWhen I use the URL pattern as \u003ccode\u003e/*\u003c/code\u003e the \u003ccode\u003eSystem.out\u003c/code\u003e prints on console,\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;url-pattern\u0026gt;/*\u0026lt;/url-pattern\u0026gt; (it works as expected)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut when I change the URL pattern to \u003ccode\u003e/order/*/payment\u003c/code\u003e (* is order id what changes for each order). then \u003ccode\u003eSystem.out\u003c/code\u003e does not print anything on console.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;url-pattern\u0026gt;/order/*/payment\u0026lt;/url-pattern\u0026gt; (it doesn't work)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am using spring mvc, apache, tomcat7.0\u003c/p\u003e","accepted_answer_id":"13718421","answer_count":"4","comment_count":"3","creation_date":"2012-11-24 18:25:04.11 UTC","last_activity_date":"2015-12-07 12:16:26.91 UTC","last_edit_date":"2017-05-23 12:31:07.827 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"743982","post_type_id":"1","score":"3","tags":"java|spring-mvc|back-button","view_count":"640"} +{"id":"31122261","title":"How to access Server side validation errors on Client side and change css class","body":"\u003cp\u003eI am workig on a MVC project which is using Jquery for client side validation, like below \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ejQuery.validator.defaults.highlight = function (element, errorClass, validClass) {\n if ($(element).attr('readonly')) {\n return;\n }\n element = this.findByName(element.name);\n element.parent()\n .addClass('invalid')\n .removeClass('valid');\n };\n jQuery.validator.defaults.unhighlight = function (element, errorClass, validClass) {\n\n element = this.findByName(element.name);\n element.parent()\n .removeClass('invalid')\n .addClass('valid');\n element.nextAll('.error').hide();\n };\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWith this way of validation we are showing error message which looks like this \u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/R4dXg.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eBut i have a model with a few fields which needs to be validated on the server side, so when i Post the Form i need to get the list of fields which failed validation on the server side and when i load the view again i need to change the css of the failed fields and show the error to the user, How can i do this?\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2015-06-29 17:47:42.053 UTC","last_activity_date":"2015-06-29 18:04:22.17 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2218571","post_type_id":"1","score":"0","tags":"javascript|jquery|html5|model-view-controller|unobtrusive-validation","view_count":"257"} +{"id":"41440706","title":"Upload image does not work in Android app but working in Postman Plugin in Codeigniter","body":"\u003cp\u003eI face the problem like as follow:\u003c/p\u003e\n\n\u003cp\u003eI develop API in codeigniter for upload image into specific folder of server. When i check in postman that works fine. But, when i check with android app that does not work fine. \u003c/p\u003e\n\n\u003cp\u003ePlease give me suggestion.\u003c/p\u003e\n\n\u003cp\u003eThanks in advance.\u003c/p\u003e\n\n\u003cp\u003eMy code as below:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic function updateimage_post() {\n if(!$this-\u0026gt;post('UserID')) {\n $status = [\n ['status' =\u0026gt; 400 , 'message' =\u0026gt; 'UserID is required.'],\n ];\n $this-\u0026gt;response($status, REST_Controller::HTTP_BAD_REQUEST);\n } else {\n $this-\u0026gt;db-\u0026gt;where(array('ID' =\u0026gt; $this-\u0026gt;post('UserID')));\n $db_result = $this-\u0026gt;db-\u0026gt;get('userregistration');\n\n if ($db_result \u0026amp;\u0026amp; $db_result-\u0026gt;num_rows() \u0026gt; 0) {\n if(isset($_FILES['ProfilePicture']['name'])) {\n $info = pathinfo($_FILES['ProfilePicture']['name']);\n $ext = $info['extension'];\n if (($ext == \"GIF\" || $ext == \"PNG\" || $ext == \"JPG\" || $ext == \"jpg\" || $ext == 'gif' || $ext == 'png' || $ext == 'jpeg') \u0026amp;\u0026amp; ($_FILES[\"ProfilePicture\"][\"type\"] == \"image/PNG\" || $_FILES[\"ProfilePicture\"][\"type\"] == \"image/GIF\" || $_FILES[\"ProfilePicture\"][\"type\"] == \"image/JPG\" || $_FILES[\"ProfilePicture\"][\"type\"] == \"image/jpg\" ||$_FILES[\"ProfilePicture\"][\"type\"] == \"image/jpeg\" || $_FILES[\"ProfilePicture\"][\"type\"] == 'image/gif' || $_FILES[\"ProfilePicture\"][\"type\"] == 'image/png') \u0026amp;\u0026amp; ($_FILES[\"ProfilePicture\"][\"size\"] \u0026lt; 30485760)) {\n $file = $info['filename'];\n $filename = 'frontuser' . '_' . uniqid() . '.' . $ext;\n $target = './uploads/frontusers/' . $filename;\n $file = $_FILES['ProfilePicture']['tmp_name'];\n if (move_uploaded_file($file, $target)) {\n $data = array(\n 'ProfilePicture' =\u0026gt; $filename,\n 'ModifiedOn' =\u0026gt; date('Y-m-d H:m:s'),\n );\n $result = $this-\u0026gt;db-\u0026gt;update('userregistration', $data, array('ID' =\u0026gt; $this-\u0026gt;post('UserID')));\n } else {\n $status = ['status' =\u0026gt; 201 , 'message' =\u0026gt; 'Image not uploaded.'];\n $this-\u0026gt;response($status, REST_Controller::HTTP_OK);\n }\n } else {\n $status = ['status' =\u0026gt; 201 , 'message' =\u0026gt; 'File is invalid.'];\n $this-\u0026gt;response($status, REST_Controller::HTTP_OK);\n }\n } else {\n $status = ['status' =\u0026gt; 201 , 'message' =\u0026gt; 'Please Select image.'];\n $this-\u0026gt;response($status, REST_Controller::HTTP_OK);\n }\n\n if($result) {\n $status = [\n 'status' =\u0026gt; 200,\n 'message' =\u0026gt; 'Profile Picture Update Successfully',\n ];\n } else {\n $status = [\n 'status' =\u0026gt; 201,\n 'message' =\u0026gt; 'Something went wrong !!',\n ];\n }\n $this-\u0026gt;set_response($status, REST_Controller::HTTP_OK);\n } else {\n $status = [\n 'status' =\u0026gt; 201,\n 'message' =\u0026gt; 'UserID does not exist !!',\n ];\n $this-\u0026gt;set_response($status, REST_Controller::HTTP_OK);\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"8","creation_date":"2017-01-03 09:54:14.363 UTC","last_activity_date":"2017-01-03 10:21:21.3 UTC","last_edit_date":"2017-01-03 10:21:21.3 UTC","last_editor_display_name":"","last_editor_user_id":"4380409","owner_display_name":"","owner_user_id":"6209010","post_type_id":"1","score":"1","tags":"php|android|api|codeigniter-3","view_count":"79"} +{"id":"26109070","title":"Auto create VPN account on CENTOS VPS server, with successful purchase of VPN subscription","body":"\u003cp\u003eI was wondering if anyone knows if this would be the correct approach for going about this process.\u003c/p\u003e\n\n\u003cp\u003eI am making a VPN service as a project to further my computer programming background and portfolio.\u003c/p\u003e\n\n\u003cp\u003eI was wondering, after a successful verification purchase for a VPN subscription on www.example.com, would the correct route to auto create the subscribers VPN account be to:\u003c/p\u003e\n\n\u003cp\u003eFire off a .sh (shell script) hosted on the server with PHP variables passed to the script for the $username \u0026amp; $password. Which in return will run on the server and create the subscribers access account.\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2014-09-29 21:17:18.48 UTC","last_activity_date":"2014-09-29 21:17:18.48 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4013153","post_type_id":"1","score":"1","tags":"php|linux|shell|centos|vpn","view_count":"78"} +{"id":"17970820","title":"Using Semantic merge as diff tool in Perforce","body":"\u003cp\u003eI'm trying to set up \u003ca href=\"http://www.semanticmerge.com/\" rel=\"nofollow noreferrer\"\u003eSemanticMerge\u003c/a\u003e as my diff tool for C# in Perforce.\u003c/p\u003e\n\n\u003cp\u003eI've configured perforce with the exe and with the arguments \u003ccode\u003e-s=%1 -d=%2 -l=csharp\u003c/code\u003e \u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/swP4P.png\" alt=\"diff tool settings\"\u003e\u003c/p\u003e\n\n\u003cp\u003eBut when I try to diff a C# file I receive the error: \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eCould not find file c:\\Program Files Perforce\\%1\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/FIMK3.png\" alt=\"error message\"\u003e\u003c/p\u003e\n\n\u003cp\u003eThe selected file is not in that location (nor is its filename %1)...\u003c/p\u003e\n\n\u003cp\u003eI am no doubt being slow and am trying to RTFM but am also hoping someone here can see what I'm missing\u003c/p\u003e","accepted_answer_id":"17975069","answer_count":"2","comment_count":"0","creation_date":"2013-07-31 12:46:19.27 UTC","favorite_count":"1","last_activity_date":"2017-09-18 09:21:56.953 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"222163","post_type_id":"1","score":"3","tags":"perforce|semantic-merge","view_count":"318"} +{"id":"41616197","title":"How to export configuration of maas (Metal as a service)","body":"\u003cp\u003eSince few days, i make some test of automatic tool deployement of Canonical: Maas. I think it's very prometise. But if I need to save my configuration, how I can make it ? And how I can import it ? By example, to make a migration from a maas1.9 to maas 2.0. I have see nothing on the internet, and the maas cli command \"maas user maas get-config\" doesn't help.\u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e\n\n\u003cp\u003eRegards.\u003c/p\u003e\n\n\u003cp\u003ejmc\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-01-12 14:55:02.703 UTC","last_activity_date":"2017-01-12 14:55:02.703 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5847158","post_type_id":"1","score":"0","tags":"deployment|cloud-bare-metal","view_count":"31"} +{"id":"10672127","title":"Stored Proc and WCF Data Services","body":"\u003cp\u003eI've got a WCF Data Service setup and can access the table data through the browser url.\u003c/p\u003e\n\n\u003cp\u003eHave created a simple Stored Proc which takes in a parameter and then returns some columns from various tables via Joins - how can I consume this?\u003c/p\u003e","accepted_answer_id":"10672485","answer_count":"1","comment_count":"0","creation_date":"2012-05-20 09:01:26.03 UTC","last_activity_date":"2012-05-20 10:16:37.577 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1084357","post_type_id":"1","score":"1","tags":"sql|wcf","view_count":"776"} +{"id":"34288412","title":"Why Should I provide an alternative style for 21 api knowing that AppCompat is made for compatibility","body":"\u003cp\u003eSome material design are only supported starting from android 21 API , so for this purpose we need to provide alternative styles that will work on devices running earlier version . (like they say in documentation ) .\u003c/p\u003e\n\n\u003cp\u003efor example :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eres/values/styles.xml\nres/values-v21/styles.xml\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThey also have mentioned V7 support library that includes Material design styles .\u003c/p\u003e\n\n\u003cp\u003eFrom here I am little bit confused !\nSuppose that my default theme extends from \u003ccode\u003eTheme.AppCompat\u003c/code\u003e .\u003c/p\u003e\n\n\u003cp\u003eWhy Should I provide an alternative style for 21 api knowing that \u003ccode\u003eTheme.AppCompat\u003c/code\u003e is made for compatibility ?\u003c/p\u003e","accepted_answer_id":"34289125","answer_count":"2","comment_count":"2","creation_date":"2015-12-15 11:46:35.233 UTC","favorite_count":"0","last_activity_date":"2015-12-16 02:46:24.97 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5409308","post_type_id":"1","score":"1","tags":"android|android-support-library|android-theme|android-styles","view_count":"132"} +{"id":"3661641","title":"len of varbinary","body":"\u003cp\u003ewould someone please explain why select len(0x0a000b) returns 3? does len count bytes? and why select left(0x0a000b, 1) returns nothing? i expected 0x0a (if len counts bytes)...\u003c/p\u003e\n\n\u003cp\u003ei am using mssql 2005\u003c/p\u003e\n\n\u003cp\u003ethanks\nkonstantin\u003c/p\u003e","accepted_answer_id":"3661701","answer_count":"3","comment_count":"0","creation_date":"2010-09-07 18:45:19.337 UTC","last_activity_date":"2010-09-07 21:22:54.53 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"410102","post_type_id":"1","score":"7","tags":"sql|sql-server-2005","view_count":"1075"} +{"id":"22424047","title":"how can ı add more button on my android application which already includes a scrollview?","body":"\u003cp\u003el have a android application that includes a xml file that includes a scrolview and ı added some buttons ın this layout and ı want to add more buttons (when ı add on graphical layout content get defaced ) but ı can t add more here is also my xml file\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;ScrollView xmlns:android=\"http://schemas.android.com/apk/res/android\"\nxmlns:tools=\"http://schemas.android.com/tools\"\nandroid:layout_width=\"match_parent\"\nandroid:layout_height=\"match_parent\"\ntools:context=\".DualarMainActivity\" \u0026gt;\n\n \u0026lt;RelativeLayout\n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\"\n android:background=\"@drawable/dualarbackround\"\n android:orientation=\"vertical\" \u0026gt;\n\n\u0026lt;Button\n android:id=\"@+id/button6\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_alignLeft=\"@+id/button5\"\n android:layout_alignRight=\"@+id/button2\"\n android:layout_below=\"@+id/button5\"\n android:layout_marginTop=\"20dp\"\n android:text=\"Button\" /\u0026gt;\n\n\u0026lt;Button\n android:id=\"@+id/button3\"\n android:layout_width=\"248dp\"\n android:layout_height=\"wrap_content\"\n android:layout_below=\"@+id/button2\"\n android:layout_centerHorizontal=\"true\"\n android:layout_marginTop=\"20dp\"\n android:text=\"Button\" /\u0026gt;\n\n\u0026lt;Button\n android:id=\"@+id/button2\"\n android:layout_width=\"250dp\"\n android:layout_height=\"wrap_content\"\n android:layout_alignLeft=\"@+id/button3\"\n android:layout_below=\"@+id/button1\"\n android:layout_marginTop=\"20dp\"\n android:text=\"Button\" /\u0026gt;\n\n\u0026lt;Button\n android:id=\"@+id/button1\"\n android:layout_width=\"250dp\"\n android:layout_height=\"wrap_content\"\n android:layout_alignParentTop=\"true\"\n android:layout_alignRight=\"@+id/button3\"\n android:layout_marginTop=\"240dp\"\n android:text=\"Button\" /\u0026gt;\n\n\u0026lt;Button\n android:id=\"@+id/button4\"\n android:layout_width=\"256dp\"\n android:layout_height=\"wrap_content\"\n android:layout_below=\"@+id/button3\"\n android:layout_centerHorizontal=\"true\"\n android:layout_marginTop=\"20dp\"\n android:text=\"Button\" /\u0026gt;\n\n\u0026lt;Button\n android:id=\"@+id/button5\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_alignLeft=\"@+id/button3\"\n android:layout_alignRight=\"@+id/button4\"\n android:layout_below=\"@+id/button4\"\n android:layout_marginTop=\"20dp\"\n android:text=\"Button\" /\u0026gt;\n\n\u0026lt;ImageView\n android:id=\"@+id/imageView1\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_alignParentLeft=\"true\"\n android:layout_alignParentTop=\"true\"\n android:src=\"@drawable/bismillah\" android:contentDescription=\"TODO\"/\u0026gt;\n\n\u0026lt;Button\n android:id=\"@+id/button7\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_alignLeft=\"@+id/button1\"\n android:layout_alignRight=\"@+id/button1\"\n android:layout_below=\"@+id/imageView1\"\n android:layout_marginTop=\"50dp\"\n android:text=\"Button\" /\u0026gt;\n\n\u0026lt;Button\n android:id=\"@+id/button8\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_alignBottom=\"@+id/button7\"\n android:layout_alignLeft=\"@+id/button4\"\n android:layout_alignRight=\"@+id/button7\"\n android:layout_marginBottom=\"65dp\"\n android:text=\"Button\" /\u0026gt;\n\n \u0026lt;/RelativeLayout\u0026gt;\n \u0026lt;/ScrollView\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"22458539","answer_count":"1","comment_count":"0","creation_date":"2014-03-15 12:53:09.007 UTC","last_activity_date":"2014-07-03 07:38:27.747 UTC","last_edit_date":"2014-07-03 07:38:27.747 UTC","last_editor_display_name":"","last_editor_user_id":"1367622","owner_display_name":"","owner_user_id":"3388310","post_type_id":"1","score":"2","tags":"android|xml|scrollview|mobile-application","view_count":"174"} +{"id":"46870035","title":"How can I define a composite key in serverless.yml for DynamoDB?","body":"\u003cp\u003eI am trying to define a dynamodb table that has a 3 column composite key. Is this possible?\u003c/p\u003e\n\n\u003cp\u003eI've seen examples and tutorials that have code like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eresources:\n Resources:\n TodosDynamoDbTable:\n Type: 'AWS::DynamoDB::Table'\n DeletionPolicy: Retain\n Properties:\n AttributeDefinitions:\n -\n AttributeName: id\n AttributeType: S\n KeySchema:\n -\n AttributeName: id\n KeyType: HASH\n ProvisionedThroughput:\n ReadCapacityUnits: 1\n WriteCapacityUnits: 1\n TableName: ${self:provider.environment.DYNAMODB_TABLE}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut that only has a single column and a single key. My table looks like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Properties:\n AttributeDefinitions:\n - AttributeName: id\n AttributeType: N\n - AttributeName: server\n AttributeType: S\n - AttributeName: room\n AttributeType: S\n - AttributeName: friendlyName\n AttributeType: S\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want a key on \u003ccode\u003eid\u003c/code\u003e, \u003ccode\u003eserver\u003c/code\u003e and \u003ccode\u003eroom\u003c/code\u003e. A user can be in multiple rooms on the same server and in multiple rooms on multiple servers. But, across the three keys, it will always be unique.\u003c/p\u003e\n\n\u003cp\u003eI don't know how to define the \u003ccode\u003eKeySchema\u003c/code\u003e part. Any help?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-10-22 02:49:41.34 UTC","last_activity_date":"2017-10-22 03:30:59.047 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"8813086","post_type_id":"1","score":"0","tags":"amazon-web-services|amazon-dynamodb|serverless-framework","view_count":"55"} +{"id":"3191110","title":"Bash equivalent to Python's string literal for utf string conversion","body":"\u003cp\u003eI'm writing a bash script that needs to parse html that includes special characters such as \u003ccode\u003e@!'ó\u003c/code\u003e. Currently I have the entire script running and it ignores or trips on these queries because they're returned from the server as decimal unicode like this: \u003ccode\u003e\u0026amp;#39;\u003c/code\u003e. I've figured out how to parse and convert to hexadecimal and load these into python to convert them back to their symbols and I am wondering if bash can do this final conversion natively. Simple example in python:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprint ur\"\\u0032\" ur\"\\u0033\" ur\"\\u0040\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eprints out\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e23@\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCan I achieve the same result in Bash? I've looked into iconv but I don't think it can do what I want, or more probably I just don't know how.\u003c/p\u003e\n\n\u003cp\u003eHere's some relevant information:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://docs.python.org/release/2.5.2/ref/strings.html\" rel=\"nofollow noreferrer\"\u003ePython String Literals\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://stackoverflow.com/questions/3045876/convert-hex-to-utf-in-python\"\u003eHex to UTF conversion in Python\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eAnd here are some examples of expected input-output.\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e\u003ccode\u003eLudwig van Beethoven - 5th Symphony and 6th Symphony \u0026amp;#39;\u0026amp;#39;Pastoral\u0026amp;#39;\u0026amp;#39; - Boston Symphony Orchestra - Charles Munch\u003c/code\u003e \u003c/p\u003e\n \n \u003cp\u003e\u003ccode\u003eLudwig van Beethoven - 5th Symphony and 6th Symphony ''Pastoral'' - Boston Symphony Orchestra - Charles Munch\u003c/code\u003e \u003c/p\u003e\n \n \u003cp\u003e\u003ccode\u003e\u0026amp;#1040;\u0026amp;#1083;\u0026amp;#1080;\u0026amp;#1089;\u0026amp;#1040; (Alisa) - \u0026amp;#1052;\u0026amp;#1099; \u0026amp;#1074;\u0026amp;#1084;\u0026amp;#1077;\u0026amp;#1089;\u0026amp;#1090;\u0026amp;#1077;. \u0026amp;#1061;\u0026amp;#1061; \u0026amp;#1083;\u0026amp;#1077;\u0026amp;#1090; (My vmeste XX let)\u003c/code\u003e \u003c/p\u003e\n \n \u003cp\u003e\u003ccode\u003eАлисА (Alisa) - Мы вместе. ХХ лет (My vmeste XX let)\u003c/code\u003e\u003c/p\u003e\n\u003c/blockquote\u003e","accepted_answer_id":"3192191","answer_count":"2","comment_count":"2","creation_date":"2010-07-07 00:20:29.45 UTC","favorite_count":"0","last_activity_date":"2012-11-16 19:29:58.24 UTC","last_edit_date":"2017-05-23 12:01:12.083 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"382775","post_type_id":"1","score":"1","tags":"python|bash|utf-8","view_count":"749"} +{"id":"42219510","title":"edGet the value of element inside ng-repeat dynamically","body":"\u003cp\u003eI am generating 10 elements using ng-repeat. \u003c/p\u003e\n\n\u003cp\u003ePlease help me to get the value of each span tag dynamically so that I can write conditions accordingly. \u003c/p\u003e\n\n\u003cp\u003eBelow is my html code. \u003c/p\u003e\n\n\u003cp\u003eI tried \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e $('span').attr('value');\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cdiv class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\"\u003e\r\n\u003cdiv class=\"snippet-code\"\u003e\r\n\u003cpre class=\"snippet-code-html lang-html prettyprint-override\"\u003e\u003ccode\u003e\u0026lt;span ng-repeat=\"n in [].constructor(7) track by $index\" class=\"dot\" value=\"{{$index+1}}\"\u0026gt;{{$index+1}}\u0026lt;/span\u0026gt;\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003c/p\u003e","accepted_answer_id":"42219771","answer_count":"1","comment_count":"4","creation_date":"2017-02-14 06:41:22.083 UTC","last_activity_date":"2017-02-14 07:52:09.643 UTC","last_edit_date":"2017-02-14 07:52:09.643 UTC","last_editor_display_name":"","last_editor_user_id":"6597281","owner_display_name":"","owner_user_id":"4536463","post_type_id":"1","score":"0","tags":"jquery|angularjs|angularjs-ng-repeat","view_count":"40"} +{"id":"26556288","title":"texture2d rectangle XNA wont initialize","body":"\u003cp\u003eI have a rather basic Texture2D name rect and I am just trying to initialize it. It tells me that a field initializer cannot reference the non-static field, method or property \"graphics\"\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public class Game1 : Microsoft.Xna.Framework.Game\n{\n GraphicsDeviceManager graphics;\n SpriteBatch spriteBatch;\n\n //my variables and stuff I delcare\n\n //texture we can render\n Texture2D myTexture;\n\n //set coords to draw the spirte\n Vector2 spritePos = new Vector2(300.0f, 330.0f);\n\n //some info about motion\n Vector2 spriteSpeed = new Vector2(0f, 0f);\n\n KeyboardState oldState;\n double boost = 15;\n\n //boost level rectange this is the issue below+\n Texture2D rect = new Texture2D(graphics.GraphicsDevice, 80, 30);\n\n public Game1()\n {\n graphics = new GraphicsDeviceManager(this);\n Content.RootDirectory = \"Content\";\n }\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"26556335","answer_count":"1","comment_count":"1","creation_date":"2014-10-24 21:07:06.167 UTC","last_activity_date":"2014-10-24 21:11:16.023 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3908256","post_type_id":"1","score":"0","tags":"c|xna","view_count":"49"} +{"id":"14032208","title":"ToList slow performance vs foreach slow performance","body":"\u003cp\u003eI am building program that use DataBase with 3 tables(Worker, Task, TaskStep)\nand i have a method that get date and build report for specific worker\nof the task and there steps for the specific day.\u003c/p\u003e\n\n\u003cp\u003eThe data base structure is as follow:\u003c/p\u003e\n\n\u003cp\u003eMySQL 5.2\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eWorker\u003c/code\u003e table columns:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eworkerID(VARCHAR(45)),\nname(VARCHAR(45)),\nage(int),\n...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003ccode\u003eTasks\u003c/code\u003e table columns:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eTaskID(VARCHAR(45)),\ndescription(VARCHAR(45)),\ndate(DATE),\n...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003ccode\u003eTaskSteps\u003c/code\u003e table columns:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eTaskStepID(VARCHAR(45)),\ndescription(VARCHAR(45)),\ndate(DATE),\n...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNo indexing on any table\u003c/p\u003e\n\n\u003cp\u003eThe problem is thats it is very very slow!! (~ 20 seconds)\u003c/p\u003e\n\n\u003cp\u003eHere is the code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eusing WorkerDailyReport = Dictionary\u0026lt;task, IEnumerable\u0026lt;taskStep\u0026gt;\u0026gt;;\n\nprivate void Buildreport(DateTime date)\n{\n var report = new WorkerDailyReport(); \n\n // Load from DB\n var sw = new Stopwatch();\n sw.Start();\n\n var startOfDay = date.Date;\n var endOfDay = startOfDay.AddDays(1);\n var db = new WorkEntities();\n\n const string workerID = \"80900855\";\n\n IEnumerable\u0026lt;task\u0026gt; _tasks = db.task\n .Where(ta =\u0026gt; ta.date \u0026gt;= startOfDay \u0026amp;\u0026amp;\n ta.date \u0026lt; endOfDay \u0026amp;\u0026amp;\n ta.workerID == workerID)\n .ToList();\n\n sw.Stop();\n Console.WriteLine(\"Load From DB time - \" + sw.Elapsed + \n \", Count - \" + _tasks.Count()); \n\n // Build the report\n sw.Restart();\n\n foreach (var t in _tasks)\n {\n var ts = db.taskStep.Where(s =\u0026gt; s.taskID == task.taskID);\n\n report.Add(t, ts);\n }\n\n sw.Stop();\n Console.WriteLine(\"Build report time - \" + sw.Elapsed);\n\n // Do somthing with the report\n foreach (var t in report)\n {\n sw.Restart();\n\n foreach (var subNode in t.Value)\n {\n // Do somthing..\n }\n\n Console.WriteLine(\"Do somthing time - \" + sw.Elapsed + \n \", Count - \" + t.Value.Count());\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAs u can see i put StopWatch in each part to check what take so long\nand this is the results:\u003c/p\u003e\n\n\u003cp\u003e1)\u003c/p\u003e\n\n\u003cp\u003eIf i run the code as above:\u003c/p\u003e\n\n\u003cp\u003eConsole:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eLoad From DB time - 00:00:00.0013774, Count - 577\n\nBuild report time - 00:00:03.6305722\n\nDo somthing time - 00:00:07.7573754, Count - 21\n\nDo somthing time - 00:00:08.2811928, Count - 11\n\nDo somthing time - 00:00:07.8715531, Count - 14\n\nDo somthing time - 00:00:08.0430597, Count - 0\n\nDo somthing time - 00:00:07.7867790, Count - 9\n\nDo somthing time - 00:00:07.3485209, Count - 39\n\n.........\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethe inner foreach run takes about 7-9!! Sec to run over no more then\n40 record.\u003c/p\u003e\n\n\u003cp\u003e2)\u003c/p\u003e\n\n\u003cp\u003eIf i change only one thing, Add .ToList() after the first query\nwhen i load the worker tasks from the Data Base it changes\neverithing.\u003c/p\u003e\n\n\u003cp\u003eConsole:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eLoad From DB time - 00:00:04.3568445, Count - 577\n\nBuild report time - 00:00:00.0018535\n\nDo somthing time - 00:00:00.0191099, Count - 21\n\nDo somthing time - 00:00:00.0144895, Count - 11\n\nDo somthing time - 00:00:00.0150208, Count - 14\n\nDo somthing time - 00:00:00.0179021, Count - 0\n\nDo somthing time - 00:00:00.0151372, Count - 9\n\nDo somthing time - 00:00:00.0155703, Count - 39\n\n.........\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow the load from DataBase takes lot more time, 4+ sec.\nBut the Built report time is about ~1ms \nAnd each inner foreach takes ~10ms\u003c/p\u003e\n\n\u003cp\u003eThe first way is imposible(577 * ~8 seconds) and the seconde option \nis also very slow and i cant see y.\u003c/p\u003e\n\n\u003cp\u003eAny idea what happening here? \u003c/p\u003e\n\n\u003cp\u003e1) Why the \u003ccode\u003eToList()\u003c/code\u003e so slow ?\u003c/p\u003e\n\n\u003cp\u003e2) Why without the \u003ccode\u003eToList()\u003c/code\u003e, The inner \u003ccode\u003eforeach\u003c/code\u003e and the Build report is slowing?\u003c/p\u003e\n\n\u003cp\u003eHow can i make it faster?\u003c/p\u003e\n\n\u003cp\u003ethnx.\u003c/p\u003e","answer_count":"3","comment_count":"4","creation_date":"2012-12-25 16:12:49.307 UTC","last_activity_date":"2013-12-19 07:07:53.4 UTC","last_edit_date":"2013-12-19 07:07:53.4 UTC","last_editor_display_name":"","last_editor_user_id":"842218","owner_display_name":"","owner_user_id":"1365625","post_type_id":"1","score":"2","tags":"performance|linq|c#-4.0|entity-framework-4|tolist","view_count":"3396"} +{"id":"16063518","title":"What does this statement mean in C#?","body":"\u003cp\u003eWhat does \u003ccode\u003eif ((a \u0026amp; b) == b)\u003c/code\u003e mean in the following code block?\u003c/p\u003e\n\n\u003cpre class=\"lang-cs prettyprint-override\"\u003e\u003ccode\u003eif ((e.Modifiers \u0026amp; Keys.Shift) == Keys.Shift)\n{\n lbl.Text += \"\\n\" + \"Shift was held down.\";\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhy is it not like this?\u003c/p\u003e\n\n\u003cpre class=\"lang-cs prettyprint-override\"\u003e\u003ccode\u003eif (e.Modifiers == Keys.Shift)\n{\n lbl.Text += \"\\n\" + \"Shift was held down.\";\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"16063748","answer_count":"8","comment_count":"2","creation_date":"2013-04-17 15:00:46.73 UTC","last_activity_date":"2013-04-18 15:03:41.293 UTC","last_edit_date":"2013-04-17 17:16:11.383 UTC","last_editor_display_name":"","last_editor_user_id":"682480","owner_display_name":"","owner_user_id":"2284963","post_type_id":"1","score":"11","tags":"c#|if-statement","view_count":"603"} +{"id":"35393765","title":"Convert log message timestamp to UTC before sroring it in Elasticsearch","body":"\u003cp\u003eI am collecting and parsing Tomcat access-log messages using Logstash, and am storing the parsed messages in Elasticsearch.\nI am using Kibana to display the log messges in Elasticsearch.\nCurrently I am using Elasticsearch 2.0.0, Logstash 2.0.0, and Kibana 4.2.1.\u003c/p\u003e\n\n\u003cp\u003eAn access-log line looks something like the following:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e02-08-2016 19:49:30.669 ip=11.22.333.444 status=200 tenant=908663983 user=0a4ac75477ed42cfb37dbc4e3f51b4d2 correlationId=RID-54082b02-4955-4ce9-866a-a92058297d81 request=\"GET /pwa/rest/908663983/rms/SampleDataDeployment HTTP/1.1\" userType=Apache-HttpClient requestInfo=- duration=4 bytes=2548 thread=http-nio-8080-exec-5 service=rms itemType=SampleDataDeployment itemOperation=READ dataLayer=MongoDB incomingItemCnt=0 outgoingItemCnt=7 \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe time displayed in the log file (ex. 02-08-2016 19:49:30.669) is in local time (not UTC!)\u003c/p\u003e\n\n\u003cp\u003eHere is how I parse the message line:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efilter {\n\n grok {\n match =\u0026gt; { \"message\" =\u0026gt; \"%{DATESTAMP:logTimestamp}\\s+\" }\n }\n\n kv {}\n\n mutate {\n convert =\u0026gt; { \"duration\" =\u0026gt; \"integer\" }\n convert =\u0026gt; { \"bytes\" =\u0026gt; \"integer\" }\n convert =\u0026gt; { \"status\" =\u0026gt; \"integer\" }\n convert =\u0026gt; { \"incomingItemCnt\" =\u0026gt; \"integer\" }\n convert =\u0026gt; { \"outgoingItemCnt\" =\u0026gt; \"integer\" }\n\n gsub =\u0026gt; [ \"message\", \"\\r\", \"\" ]\n }\n\n grok {\n match =\u0026gt; { \"request\" =\u0026gt; [ \"(?:%{WORD:method} %{NOTSPACE:request}(?: HTTP/%{NUMBER:httpVersion})?)\" ] }\n overwrite =\u0026gt; [ \"request\" ] \n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI would like Logstash to convert the time read from the log message ('logTimestamp' field) into UTC before storing it in Elasticsearch.\u003c/p\u003e\n\n\u003cp\u003eCan someone assist me with that please?\u003c/p\u003e\n\n\u003cp\u003e--\u003c/p\u003e\n\n\u003cp\u003eI have added the \u003cem\u003edate\u003c/em\u003e filter to my processing, but I had to add a \u003cem\u003etimezone\u003c/em\u003e.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e filter {\n grok {\n match =\u0026gt; { \"message\" =\u0026gt; \"%{DATESTAMP:logTimestamp}\\s+\" }\n }\n\n date {\n match =\u0026gt; [ \"logTimestamp\" , \"mm-dd-yyyy HH:mm:ss.SSS\" ]\n timezone =\u0026gt; \"Asia/Jerusalem\"\n target =\u0026gt; \"logTimestamp\"\n }\n\n ...\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs there a way to convert the date to UTC without supplying the local timezone, such that Logstash takes the timezone of the machine it is running on?\u003c/p\u003e\n\n\u003cp\u003eThe motivation behind this question is I would like to use the same configuration file in all my deployments, in various timezones.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-02-14 15:56:59.2 UTC","favorite_count":"0","last_activity_date":"2016-02-15 10:55:52.107 UTC","last_edit_date":"2016-02-15 10:55:52.107 UTC","last_editor_display_name":"","last_editor_user_id":"5524030","owner_display_name":"","owner_user_id":"5524030","post_type_id":"1","score":"1","tags":"elasticsearch|logstash|utc","view_count":"1032"} +{"id":"3173899","title":"Toggle element visibility via radio select","body":"\u003cp\u003eThis form has a hidden textara and a visible textbox. I would like to swap visibility of these elements if option \"D:\" is selected, but not sure how to correctly check which radio button is checked at any given time: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;script language=\"JavaScript\" type=\"text/javascript\"\u0026gt;\n\nfunction unhide(event) { \n event = event || window.event ;\n target = event.target || event.srcElement; \n if(target.value === \"D:\") {\n if(target.checked) {\n document.getElementByName('tarea').style.display=''; \n document.getElementByName('tbox').style.display='none'; \n }\n }else {\n if(target.checked) {\n document.getElementByName('tarea').style.display='none'; \n document.getElementByName('tbox').style.display=''; \n }\n } \n}\n\u0026lt;/script\u0026gt;\n\u0026lt;/head\u0026gt;\n\u0026lt;body\u0026gt;\n\u0026lt;form method=\"get\" action=\"/cgi-bin/form.cgi\" enctype=\"application/x-www-form-urlencoded\"\u0026gt;\n\u0026lt;input type=\"radio\" name=\"opttype\" value=\"A:\" onclick=\"unhide(event)\" /\u0026gt;A:\n\u0026lt;input type=\"radio\" name=\"opttype\" value=\"B:\" onclick=\"unhide(event)\" /\u0026gt;B:\n\u0026lt;input type=\"radio\" name=\"opttype\" value=\"C:\" checked=\"checked\" onclick=\"unhide(event)\" /\u0026gt;C:\n\u0026lt;input type=\"radio\" name=\"opttype\" value=\"D:\" onclick=\"unhide(event)\" /\u0026gt;D:\n\u0026lt;br\u0026gt;\u0026lt;input type=\"tbox\" name=\"event\" /\u0026gt;\n\u0026lt;br\u0026gt;\u0026lt;textarea name=\"tarea\" rows=\"8\" cols=\"80\" style=\"width:580;height:130;display:none;\"\u0026gt;\u0026lt;/textarea\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"3174156","answer_count":"4","comment_count":"0","creation_date":"2010-07-04 06:10:30.503 UTC","last_activity_date":"2010-07-04 08:20:04.6 UTC","last_edit_date":"2010-07-04 07:36:35.403 UTC","last_editor_display_name":"","last_editor_user_id":"126562","owner_display_name":"","owner_user_id":"196096","post_type_id":"1","score":"0","tags":"javascript|onclick","view_count":"1224"} +{"id":"47281777","title":"How to redirect all traffics to HTTPS only EXCEPT mobile and subdomains?","body":"\u003cp\u003eThe .htaccess file that I am using now is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#Force www:\nRewriteEngine On\n\nRewriteCond %{HTTP_USER_AGENT} \"!(android|blackberry|googlebot-mobile|iemobile|ipad|iphone|ipod|opera mobile|palmos|webos)\" [NC]\nRewriteCond %{HTTP_HOST} ^example\\.com [NC]\nRewriteRule ^$ http://www.example.com/ [L,R=302]\n\n\nRewriteCond %{HTTPS} off [OR]\nRewriteCond %{HTTP_HOST} !^www\\. [NC]\nRewriteCond %{HTTP_HOST} ^(?:www\\.)?(.+)$ [NC]\nRewriteRule ^ https://www.%1%{REQUEST_URI} [L,NE,R=301]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, when I tested using my mobile I found that it is redirecting to the https only and also while accessing any subdomains it redirects to the https.\u003c/p\u003e\n\n\u003cp\u003eAm I doing something wrong in my htaccess script?\u003c/p\u003e\n\n\u003cp\u003eThanks in advance.\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2017-11-14 09:15:56.563 UTC","last_activity_date":"2017-11-14 09:15:56.563 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3243499","post_type_id":"1","score":"0","tags":"apache|.htaccess|redirect|mod-rewrite","view_count":"16"} +{"id":"44615289","title":"Netty ByteBuf processing, decoders structure in the pipeline","body":"\u003cp\u003eMy server sends response to the client or forward the message to another client depends on message content.\nI need to use 8 bytes messages: 6 encrypted bytes between braces, for example: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e0x3C 0xE1 0xE2 0xE3 0xE04 0xE5 0xE6 0x3E\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhere 0x3C means \u0026lt; sign as an opening frame marker, and 0x3E means \u003e sign as closing frame marker. \u003c/p\u003e\n\n\u003cp\u003eIf internal 6 encrypted bytes (0xE1 0x02 0x03 0x04 0x05 0x06) are decrypted successfully, data contains same markers again:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e0x3C 0x3C 0x02 0x03 0x04 0x05 0x3E 0x3E\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo I get 4 bytes payload (0x02 0x03 0x04 0x05).\u003c/p\u003e\n\n\u003cp\u003eI have already written a FrameDecoder, but now I can't decide to strip the braces bytes or not:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eI want to write clean code, braces are only frame markers so they belong to FrameDecoder responsibility. This means for me FrameDecoder needs to strip them. But on forwarding, FrameEncoder needs to add them again (on reponse encoding too). I can simply write the closing marker into the buffer but I don't know how can I write single byte to the beginning of Bytebuf efficiently.\u003c/li\u003e\n\u003cli\u003eIf I do not strip markers, it looks not so clean solution, but I can forward the entire received Bytebuf (after encryption) or last handler can allocate 8 bytes for the entire Bytebuf on reponse sending.\u003c/li\u003e\n\u003c/ul\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-06-18 13:02:58.413 UTC","last_activity_date":"2017-06-20 07:23:34.603 UTC","last_edit_date":"2017-06-18 13:19:12.1 UTC","last_editor_display_name":"","last_editor_user_id":"7973330","owner_display_name":"","owner_user_id":"7973330","post_type_id":"1","score":"0","tags":"java|netty","view_count":"49"} +{"id":"4562801","title":"What is \"energy\" in image processing?","body":"\u003cp\u003eI've read across several Image Processing books and websites, but I'm still not sure the true definition of the term \"energy\" in Image Processing. I've found several definition but sometimes they just don't match. So to be sure...\u003c/p\u003e\n\n\u003cp\u003eWhen we say \"energy\" in Image processing, what are we implying?\u003c/p\u003e","accepted_answer_id":"4563626","answer_count":"13","comment_count":"2","creation_date":"2010-12-30 13:03:06.97 UTC","favorite_count":"9","last_activity_date":"2017-11-25 21:36:12.363 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"144201","post_type_id":"1","score":"16","tags":"image-processing|definition|energy","view_count":"22596"} +{"id":"44270191","title":"Why does the fallback font take precedence when the first one does not fail?","body":"\u003cp\u003eTo me, both of these h1 tags should render as Times, but the second one is rendering as Arial. I am using Chrome.\u003c/p\u003e\n\n\u003cp\u003eHTML:\u003c/p\u003e\n\n\u003cp\u003e\u003cdiv class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\"\u003e\r\n\u003cdiv class=\"snippet-code\"\u003e\r\n\u003cpre class=\"snippet-code-html lang-html prettyprint-override\"\u003e\u003ccode\u003e\u0026lt;html\u0026gt;\r\n\u0026lt;head\u0026gt;\u0026lt;/head\u0026gt;\r\n\u0026lt;body\u0026gt;\r\n\r\n\u0026lt;style type=\"text/css\"\u0026gt;\r\n @font-face {\r\n font-family: a;\r\n src: local(Times);\r\n }\r\n\u0026lt;/style\u0026gt;\r\n\u0026lt;h1 style=\"font-family: a;\"\u0026gt;1. This shows as Times\u0026lt;/h1\u0026gt;\r\n\r\n\u0026lt;style type=\"text/css\"\u0026gt;\r\n @font-face {\r\n font-family: b;\r\n src: local(Times);\r\n }\r\n\u0026lt;/style\u0026gt;\r\n\u0026lt;h1 style=\"font-family: b, Arial;\"\u0026gt;2. This should be Times too\u0026lt;/h1\u0026gt;\r\n\r\n\u0026lt;/body\u0026gt;\r\n\u0026lt;/html\u0026gt;\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003c/p\u003e\n\n\u003cp\u003eRendered in chrome: \n\u003ca href=\"https://i.stack.imgur.com/qzs2r.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/qzs2r.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2017-05-30 19:13:36.42 UTC","last_activity_date":"2017-05-30 19:13:36.42 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"992108","post_type_id":"1","score":"0","tags":"fonts|font-face|fallback|fontfamily","view_count":"20"} +{"id":"34676757","title":"Challenge with Cookie authentication in MVC and Web API","body":"\u003cp\u003eI am working on an enterprise application where I have 4 different Web API services for different clients. The total platform is governed by forms authentication. I came across a helpful link in doing this and implemented the solution as per the link \u003ca href=\"https://wesleycabus.be/2014/06/adding-an-mvc-layer-on-top-of-a-web-api-backend/\" rel=\"nofollow\"\u003ehttps://wesleycabus.be/2014/06/adding-an-mvc-layer-on-top-of-a-web-api-backend/\u003c/a\u003e .\u003c/p\u003e\n\n\u003cp\u003eI extended the above sample and wrote a new authentication service and issued the cookie and the token from the same, I have also observed that I am able to use the token from the authentication service to the service that is given in the demo, provided I gave the same machine key. But when ever I try to access a newly created service I am unable to access though all settings are intact.\u003c/p\u003e\n\n\u003cp\u003eI found this behavior very weird and compared the two projects. the only difference I see is the version of few nuget packages, other than that I don't see any configuration on code difference. Any help what might be the issues I am facing here. Thanks in advance.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eThe only difference i see is for the service that is not working the response headers are like this\u003c/strong\u003e \u003c/p\u003e\n\n\u003cp\u003eCache-Control:no-cache\nContent-Length:81\nContent-Type:application/xml; charset=utf-8\nDate:Fri, 08 Jan 2016 18:12:44 GMT\nExpires:-1\nPragma:no-cache\nServer:Microsoft-IIS/10.0\nWWW-Authenticate:Bearer\nX-AspNet-Version:4.0.30319\nX-Powered-By:ASP.NET\nX-SourceFiles:=?UTF-8?B?QzpcTWFjQm9vayBEYXRhXEFkaXR5YVxFQ0RQU291cmNlQ29kZVxPQlJGXFRlYW1QT0NzXEF1dGhlbnRpY2F0aW9uXE12Y092ZXJXZWJBcGlcQXV0aGVudGljYXRpb25TZXJ2aWNlXGFwaVx2YWx1ZXM=?=\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eFor the service that works the response headers are\u003c/strong\u003e \u003c/p\u003e\n\n\u003cp\u003eCache-Control:no-cache\nContent-Length:195\nContent-Type:application/xml; charset=utf-8\nDate:Fri, 08 Jan 2016 18:14:32 GMT\nExpires:-1\nPragma:no-cache\nServer:Microsoft-IIS/10.0\nX-AspNet-Version:4.0.30319\nX-Powered-By:ASP.NET\nX-SourceFiles:=?UTF-8?B?QzpcTWFjQm9vayBEYXRhXEFkaXR5YVxFQ0RQU291cmNlQ29kZVxPQlJGXFRlYW1QT0NzXEF1dGhlbnRpY2F0aW9uXE12Y092ZXJXZWJBcGlcTXlTZXJ2aWNlXGFwaVx2YWx1ZXM=?=\nRequest Headers\nview source\nAccept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,\u003cem\u003e/\u003c/em\u003e;q=0.8\nAccept-Encoding:gzip, deflate, sdch\nAccept-Language:en-US,en;q=0.8\nConnection:keep-alive\u003c/p\u003e\n\n\u003cp\u003ewonder what the bearer stands for in the response header.\u003c/p\u003e\n\n\u003cp\u003eNote: I am able to access the newly created services by passing the token in authentication header, I am unable to access it when I try doing it using a cookie.\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2016-01-08 12:05:47.673 UTC","last_activity_date":"2016-01-12 17:40:10.37 UTC","last_edit_date":"2016-01-08 18:21:59.03 UTC","last_editor_display_name":"","last_editor_user_id":"4784501","owner_display_name":"","owner_user_id":"4784501","post_type_id":"1","score":"-1","tags":"asp.net-mvc-4|authentication|cookies|asp.net-web-api|oauth","view_count":"283"} +{"id":"39411933","title":"Quaternion lerp back and forth","body":"\u003cp\u003eI want to \u003ccode\u003elerp\u003c/code\u003e along the Z axis forth and back the same amount to avoid spinning (as my \u003ccode\u003esprite\u003c/code\u003e is not a circular one). To do this I planned to random a \u003ccode\u003eforward angle\u003c/code\u003e, store it, \u003ccode\u003elerp\u003c/code\u003e to it then \u003ccode\u003elerp\u003c/code\u003e back with the same amount. However, this gives some weird popping as when the backwards rotations starts the starting angle wouldn't be the same, but it is. When I call it, I give it the same time to interpolate between. Some code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eIEnumerator LerpQuat(QuatLerpInput rotThis, float time, float leftBoundary, float rightBoundary)\n{\n /*\n * we want to rotate forward, then backward the same amount\n * to avoid spinning. we store the given value to both of these.\n */\n\n Transform stuffToRot = rotThis.godRayGO.transform;\n\n float lastTime = Time.realtimeSinceStartup;\n float timer = 0.0f;\n switch (rotThis.rotState)\n {\n case (QuatLerpInput.RotationStates.rotAway):\n rotThis.deltaRot = Random.Range(leftBoundary, rightBoundary);\n while (timer \u0026lt; time)\n {\n stuffToRot.rotation = Quaternion.Euler(stuffToRot.rotation.x, stuffToRot.rotation.y,\n Mathf.LerpAngle(rotThis.idleRot, rotThis.idleRot + rotThis.deltaRot, timer / time));\n timer += (Time.realtimeSinceStartup - lastTime);\n lastTime = Time.realtimeSinceStartup;\n yield return null;\n }\n rotThis.rotState = QuatLerpInput.RotationStates.setBack;\n break;\n case (QuatLerpInput.RotationStates.setBack):\n while (timer \u0026lt; time)\n {\n stuffToRot.rotation = Quaternion.Euler(stuffToRot.rotation.x, stuffToRot.rotation.y,\n Mathf.LerpAngle(rotThis.idleRot + rotThis.deltaRot, rotThis.idleRot, timer / time));\n timer += (Time.realtimeSinceStartup - lastTime);\n lastTime = Time.realtimeSinceStartup;\n yield return null;\n }\n rotThis.rotState = QuatLerpInput.RotationStates.rotAway;\n break;\n }\n\n}\npublic class QuatLerpInput\n{\n public GameObject godRayGO;\n public float deltaRot;\n public float idleRot;\n public enum RotationStates\n {\n rotAway, setBack\n }\n public RotationStates rotState = RotationStates.rotAway;\n public QuatLerpInput(GameObject godRayGO)\n {\n this.godRayGO = godRayGO;\n deltaRot = godRayGO.transform.rotation.z;\n idleRot = godRayGO.transform.rotation.z;\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eEdited \u003ccode\u003eswitch\u003c/code\u003e with Quaternions:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eswitch (rotThis.rotState)\n {\n case (QuatLerpInput.RotationStates.rotAway):\n rotThis.deltaRot = Random.Range(leftBoundary, rightBoundary);\n Quaternion destination = new Quaternion(rotThis.idleQuat.x, rotThis.idleQuat.y, rotThis.idleQuat.z + rotThis.deltaRot, 1.0f);\n rotThis.deltaQuat = destination;\n while (timer \u0026lt; time)\n {\n stuffToRot.rotation = Quaternion.Slerp(rotThis.idleQuat, rotThis.deltaQuat, timer/time);\n //stuffToRot.rotation = Quaternion.Euler(stuffToRot.rotation.x, stuffToRot.rotation.y,\n // Mathf.LerpAngle(rotThis.idleRot, rotThis.idleRot + rotThis.deltaRot, timer / time));\n timer += (Time.realtimeSinceStartup - lastTime);\n lastTime = Time.realtimeSinceStartup;\n\n yield return null;\n }\n rotThis.rotState = QuatLerpInput.RotationStates.setBack;\n break;\n case (QuatLerpInput.RotationStates.setBack):\n while (timer \u0026lt; time)\n {\n stuffToRot.rotation = Quaternion.Slerp(rotThis.deltaQuat, rotThis.idleQuat, timer / time);\n //stuffToRot.rotation = Quaternion.Euler(stuffToRot.rotation.x, stuffToRot.rotation.y,\n // Mathf.LerpAngle(rotThis.idleRot + rotThis.deltaRot, rotThis.idleRot, timer / time));\n timer += (Time.realtimeSinceStartup - lastTime);\n lastTime = Time.realtimeSinceStartup;\n\n yield return null;\n }\n rotThis.rotState = QuatLerpInput.RotationStates.rotAway;\n break;\n }\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"39419037","answer_count":"2","comment_count":"1","creation_date":"2016-09-09 12:45:28.657 UTC","last_activity_date":"2016-09-09 20:08:53.767 UTC","last_edit_date":"2016-09-09 17:17:25.873 UTC","last_editor_display_name":"","last_editor_user_id":"6207726","owner_display_name":"","owner_user_id":"6207726","post_type_id":"1","score":"0","tags":"c#|unity3d","view_count":"111"} +{"id":"29179258","title":"Why is my bash shell script working on v 3.2.5 and failing on 4.1.2?","body":"\u003cp\u003eMy bash shell script is working on Bash 3.2.5.\nI have an input file that contains the following content:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e1234567\n2345678\n3456789\n4567890\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand a bash shell script that has the following code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#!/bin/bash\ncontent=($(cat data.txt | awk {'print $1'}))\nfor (( i=0 ; i\u0026lt;${#content[@]} ; i++ ))\ndo\n if (( i==0 ))\n then\n ele=`echo ${content[$i]}`\n else\n ele=`echo \",\"${content[$i]}`\n fi\n all=`echo $all$ele`\ndone\n# should be a string of csv: works on bash 3.2.5 - fails on bash 4.1.2\necho $all\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen run with Bash 3.2.5 it outputs: (expected output; correct)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e1234567,2345678,3456789,4567890\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut when run with Bash 4.1.2 it outputs: (the last number in the file; not correct)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e,4567890\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhy is the same code failing in Bash 4.1.2?\u003c/p\u003e","accepted_answer_id":"29202562","answer_count":"4","comment_count":"7","creation_date":"2015-03-21 04:28:53.47 UTC","last_activity_date":"2015-03-23 02:46:35.337 UTC","last_edit_date":"2015-03-21 04:42:19.04 UTC","last_editor_display_name":"","last_editor_user_id":"15168","owner_display_name":"","owner_user_id":"1084593","post_type_id":"1","score":"0","tags":"arrays|linux|bash|shell","view_count":"363"} +{"id":"44470847","title":"Exception in thread \"main\" java.lang.NumberFormatException:","body":"\u003cp\u003eI am executing my code in java But I am getting number exception error everytime. Please help\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass TestClass {\npublic static void main(String args[]) throws IOException {\n BufferedReader inp = new BufferedReader (new InputStreamReader(System.in));\n String input = inp.readLine();\n //Scanner sc = new Scanner(System.in);\n StringTokenizer stk = new StringTokenizer(input);\n int n = Integer.parseInt(stk.nextToken());\n int q = Integer.parseInt(stk.nextToken());\n int [] arr = new int[n];\n int [] st = new int [n];\n for(int i =0;i\u0026lt;n;i++){\n arr[i] = Integer.parseInt(stk.nextToken());\n st[i] = fib(arr[i]);\n\n } \nwhile(q\u0026gt;0){\n int l = Integer.parseInt(stk.nextToken());\n int r = Integer.parseInt(stk.nextToken());\n System.out.println(gcd(st,l,r));\n q--;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am continuously getting error message:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eException in thread \"main\" java.lang.NumberFormatException: For input\n string: \"3 2\" at\n java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)\n at java.lang.Integer.parseInt(Integer.java:580) at\n java.lang.Integer.parseInt(Integer.java:615) at\n TestClass.main(Main.java:14)\u003c/p\u003e\n\u003c/blockquote\u003e","answer_count":"1","comment_count":"4","creation_date":"2017-06-10 07:40:59.973 UTC","last_activity_date":"2017-06-10 13:36:28.947 UTC","last_edit_date":"2017-06-10 09:05:23.7 UTC","last_editor_display_name":"","last_editor_user_id":"7098806","owner_display_name":"","owner_user_id":"8118771","post_type_id":"1","score":"1","tags":"java|parsing|exception|bufferedreader|parseint","view_count":"162"} +{"id":"42880601","title":"Identifying 'upstream' merge commits, not from within a fork","body":"\u003cp\u003eI am trying to identify pull request merge commits in the git history. \u003c/p\u003e\n\n\u003cp\u003eWe can normally use something like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003egit log --merges |grep 'Merge pull request'`\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, I am part of a distributed project with several repository forks, and have found that pull request merge commits that were part of the fork's development stream are polluting this output. This is even observed in Github's UI.\u003c/p\u003e\n\n\u003cp\u003eExample:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e18b389... Merge pull request #2222 from Fork/master \u0026lt;-- Fork/master to Upstream/master for feature X - Want.\nea3e5b... Merge pull request #12 from Fork/feature-x \u0026lt;-- Fork/feature-x to Fork/master - Dont want.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI would like to isolate only merge commits between forks and upstream, not between branches of forks or forks-of-a-fork. Is this possible?\u003c/p\u003e\n\n\u003cp\u003eMy actual goal is to be able to identify all pull request merge commit SHAs between a range of commits, but these errant commits pollute the results with references to unrelated PRs - there is no distinction between fork and upstream in the commit message.\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2017-03-18 22:24:02.343 UTC","favorite_count":"1","last_activity_date":"2017-03-19 10:23:51.71 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"61113","post_type_id":"1","score":"2","tags":"git|github","view_count":"30"} +{"id":"9276807","title":"What's the advantage of a Java-5 ThreadPoolExecutor over a Java-7 ForkJoinPool?","body":"\u003cp\u003eJava 5 has introduced support for asynchronous task execution by a thread pool in the form of the Executor framework, whose heart is the thread pool implemented by java.util.concurrent.ThreadPoolExecutor. Java 7 has added an alternative thread pool in the form of java.util.concurrent.ForkJoinPool.\u003c/p\u003e\n\n\u003cp\u003eLooking at their respective API, ForkJoinPool provides a superset of ThreadPoolExecutor's functionality in standard scenarios (though strictly speaking ThreadPoolExecutor offers more opportunities for tuning than ForkJoinPool). Adding to this the observation that \nfork/join tasks seem to be faster (possibly due to the work stealing scheduler), need definitely fewer threads (due to the non-blocking join operation), one might get the impression that ThreadPoolExecutor has been superseded by ForkJoinPool.\u003c/p\u003e\n\n\u003cp\u003eBut is this really correct? All the material I have read seems to sum up to a rather vague distinction between the two types of thread pools: \u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eForkJoinPool is for many, dependent, task-generated, short, hardly ever blocking (i.e. compute-intensive) tasks\u003c/li\u003e\n\u003cli\u003eThreadPoolExecutor is for few, independent, externally-generated, long, sometimes blocking tasks\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eIs this distinction correct at all? Can we say anything more specific about this?\u003c/p\u003e","accepted_answer_id":"10366441","answer_count":"4","comment_count":"0","creation_date":"2012-02-14 12:23:21.367 UTC","favorite_count":"13","last_activity_date":"2016-05-06 15:19:51.703 UTC","last_edit_date":"2016-01-18 13:23:27.393 UTC","last_editor_display_name":"","last_editor_user_id":"4999394","owner_display_name":"","owner_user_id":"1208965","post_type_id":"1","score":"31","tags":"java|parallel-processing|threadpool|threadpoolexecutor|forkjoinpool","view_count":"4181"} +{"id":"10883651","title":"How can I generate a new row out of two other rows in Postgres?","body":"\u003cp\u003eI have some data in a Postgres table that looks like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e1 apple datetime1\n2 orange datetime2\n3 apple datetime3\n4 orange datetime4\n5 apple datetime5\n6 orange datetime6\n.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe datetime is always in ascending order and the majority of times the apple rows are inserted first and orange second with some exceptions that I have to catch and eliminate.\u003c/p\u003e\n\n\u003cp\u003eWhat I practically need is a Postgres query that will pair apples and oranges only: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e1 apple datetime1 2 orange datetime2\n3 apple datetime3 4 orange datetime4\n5 apple datetime5 6 orange datetime6\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eApples should never be paired with other apples and oranges should never be paired with other oranges.\u003c/p\u003e\n\n\u003cp\u003eThere are couple of conditions:\u003c/p\u003e\n\n\u003cp\u003e1) In the newly generated rows apple should always be first and orange second.\u003c/p\u003e\n\n\u003cp\u003e2) Always pair apple and orange rows with the closest datetimes and ignore the other rows.\u003c/p\u003e\n\n\u003cp\u003eFor example if I have the original data looking like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e1 apple datetime1\n2 apple datetime2\n3 orange datetime3\n4 orange datetime4\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003epair \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e2 apple datetime2 3 orange datetime3\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand ignore rows\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e1 apple datetime1\n4 orange datetime4\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny ideas how to do this in Postgres?\u003c/p\u003e","accepted_answer_id":"10884184","answer_count":"4","comment_count":"5","creation_date":"2012-06-04 15:11:30.987 UTC","last_activity_date":"2012-06-04 16:10:20.237 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"509807","post_type_id":"1","score":"1","tags":"sql|postgresql","view_count":"131"} +{"id":"28719086","title":"How to generate multiple SVG's in a Meteor.js #each wrapper","body":"\u003cp\u003eHi there I currently have a template helper that returns me an array with various values used to generate different rows in a table in my HTML.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;template name=\"stop\"\u0026gt; \n {{#each thumb}}\n\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;\n \u0026lt;h2\u0026gt; Do you like this product? \u0026lt;/h2\u0026gt;\n \u0026lt;h2\u0026gt;{{text}}\u0026lt;/h2\u0026gt;\n \u0026lt;svg id=\"donutChart\"\u0026gt; \u0026lt;/svg\u0026gt;\n \u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n {{/each}}\n\n\u0026lt;/template\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt also contains a svg tag which I also want to generate a graph for each element generated as a table row and this is what the template helper looks like.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Template.stop.helpers({\n 'thumb': function(data) {\n var result = tweetImages.findOne();\n var newResult = [];\n for (var i = 0; i \u0026lt; result.data.length; i++) {\n newResult[i] = {\n data: result.data[i],\n text: result.text[i]\n };\n }\n console.log(newResult)\n return newResult;\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm trying to create a pie reactive pie chart for each element in the table however I don't seem to be able to access the svg in the stop template.\u003c/p\u003e\n\n\u003cp\u003eThe d3 code works fine outside that table but cant seem to be generated for each element of the table because it can't access the svg element.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eTemplate.donutChart.rendered = function() {\n\n//my d3 code is here\n\n\n\n //Width and height\n var w = 300;\n var h = 300;\n var center = w / 2;\n var outerRadius = w / 2;\n var innerRadius = 0;\n var radius = 150;\n var arc = d3.svg.arc()\n .innerRadius(40)\n .outerRadius(radius + 10 - 25);\n\n var pie = d3.layout.pie()\n .sort(null)\n .value(function(d) {\n return d.data;\n });\n\n\n //Create SVG element \n var svg = d3.select(\"#donutChart\")\n .attr(\"width\", w)\n .attr(\"height\", h)\n .attr(\"transform\", \"translate(\" + 200 + \",\" + 100 + \")\");\n\n // GROUP FOR CENTER TEXT\n var center_group = svg.append(\"svg:g\")\n .attr(\"class\", \"ctrGroup\")\n .attr(\"transform\", \"translate(\" + (w / 2) + \",\" + (h / 2) + \")\");\n\n // CENTER LABEL\n var pieLabel = center_group.append(\"svg:text\")\n .attr(\"dy\", \".35em\").attr(\"class\", \"chartLabel\")\n .attr(\"text-anchor\", \"middle\")\n .text(\"Clothes\")\n .attr(\"fill\", \"white\");\n\n\n Deps.autorun(function() {\n var modifier = {\n fields: {\n value: 1\n }\n };\n\n\n Deps.autorun(function() {\n\n var arcs = svg.selectAll(\"g.arc\")\n .data(pie(players))\n\n var arcOutter = d3.svg.arc()\n .innerRadius(outerRadius - 10)\n .outerRadius(outerRadius);\n\n var arcPhantom = d3.svg.arc()\n .innerRadius(-180)\n .outerRadius(outerRadius + 180);\n var newGroups =\n arcs\n .enter()\n .append(\"g\")\n .attr(\"class\", \"arc\")\n .attr(\"transform\", \"translate(\" + 150 + \",\" + 150 + \")\")\n\n //Set up outter arc groups\n var outterArcs = svg.selectAll(\"g.outter-arc\")\n .data(pie(players))\n .enter()\n .append(\"g\")\n .attr(\"class\", \"outter-arc\")\n .attr(\"transform\", \"translate(\" + 150 + \", \" + 150 + \")\");\n\n //Set up phantom arc groups\n var phantomArcs = svg.selectAll(\"g.phantom-arc\")\n .data(pie(players))\n .enter()\n .append(\"g\")\n .attr(\"class\", \"phantom-arc\")\n .attr(\"transform\", \"translate(\" + center + \", \" + center + \")\");\n\n\n outterArcs.append(\"path\")\n .attr(\"fill\", function(d, i) {\n return slickColor[i];\n })\n .attr(\"fill-opacity\", 0.85)\n .attr(\"d\", arcOutter).style('stroke', '#0ca7d2')\n .style('stroke-width', 2)\n\n\n //Draw phantom arc paths\n phantomArcs.append(\"path\")\n .attr(\"fill\", 'white')\n .attr(\"fill-opacity\", 0.1)\n .attr(\"d\", arcPhantom).style('stroke', '#0ca7d2')\n .style('stroke-width', 5);\n\n\n //Draw arc paths\n newGroups\n .append(\"path\")\n .attr(\"fill\", function(d, i) {\n return slickColor[i];\n })\n .attr(\"d\", arc);\n\n //Labels\n newGroups\n .append(\"text\")\n\n .attr(\"transform\", function(d) {\n return \"translate(\" + arc.centroid(d) + \")\";\n })\n .attr(\"text-anchor\", \"middle\")\n .text(function(d) {\n return d.value;\n })\n .style(\"font-size\", function(d) {\n return 24;\n })\n\n\n\n svg.selectAll(\"g.phantom-arc\")\n .transition()\n .select('path')\n .attrTween(\"d\", function(d) {\n this._current = this._current || d;\n var interpolate = d3.interpolate(this._current, d);\n this._current = interpolate(0);\n return function(t) {\n return arc(interpolate(t));\n };\n });\n\n\n arcs\n .transition()\n .select('path')\n .attrTween(\"d\", function(d) {\n this._current = this._current || d;\n var interpolate = d3.interpolate(this._current, d);\n this._current = interpolate(0);\n return function(t) {\n return arc(interpolate(t));\n };\n });\n\n arcs\n .transition()\n .select('text')\n .attr(\"transform\", function(d) {\n return \"translate(\" + arc.centroid(d) + \")\";\n })\n .text(function(d) {\n return d.value;\n })\n .attr(\"fill\", function(d, i) {\n return textColor[i];\n })\n\n arcs\n .exit()\n .remove();\n });\n\n });\n\n\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e}\u003c/p\u003e\n\n\u003cp\u003eI can't seem to find much information on using d3.js or SVG's within a templates #each wrapper. Any help would be truly appreciated.\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2015-02-25 12:30:08.1 UTC","last_activity_date":"2015-02-25 19:05:21.437 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3096348","post_type_id":"1","score":"1","tags":"javascript|html|templates|d3.js|meteor","view_count":"232"} +{"id":"1319230","title":"Assembly language tools and references","body":"\u003cp\u003eI used to do assembly language programming a while back, I was foolish enough to want to get back into it.\u003c/p\u003e\n\n\u003cp\u003eBack in the day, I used to compile asm code with MASM.EXE command line, writing code with no validation in a basic text editor.\u003c/p\u003e\n\n\u003cp\u003eWhat are the best tools in use today for writing in assembly?\u003c/p\u003e\n\n\u003cp\u003eWhat are some good quick references online?\u003c/p\u003e","accepted_answer_id":"1319240","answer_count":"2","comment_count":"1","creation_date":"2009-08-23 18:39:34.257 UTC","favorite_count":"1","last_activity_date":"2009-10-17 19:49:32.233 UTC","last_edit_date":"2009-10-17 19:49:32.233 UTC","last_editor_display_name":"","last_editor_user_id":"49246","owner_display_name":"","owner_user_id":"62923","post_type_id":"1","score":"3","tags":"assembly|masm","view_count":"1579"} +{"id":"37193072","title":"C# Mvc Generic Route using Slug","body":"\u003cp\u003eI'm trying to create a generic route to work with slugs, but I always got an error \u003c/p\u003e\n\n\u003cp\u003eThe idea is, instead of \u003cstrong\u003ewww.site.com/controller/action\u003c/strong\u003e I get in the url a friendly \u003cstrong\u003ewww.site.com/{slug}\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003ee.g. \u003cstrong\u003ewww.site.com/Home/Open\u003c/strong\u003e would be instead \u003cstrong\u003ewww.site.com/open-your-company\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eError\u003c/strong\u003e\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eserver error in '/' application The Resource cannot be found\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eIn my \u003cstrong\u003eGlobal.asax\u003c/strong\u003e I have\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic static void RegisterRoutes(RouteCollection routes)\n{\n //routes.Clear();\n routes.IgnoreRoute(\"{resource}.axd/{*pathInfo}\");\n\n routes.MapRoute(\"DefaultSlug\", \"{slug}\", new { controller = \"Home\", action = \"Open\", slug = \"\" });\n routes.MapRoute(\n name: \"Default\",\n url: \"{controller}/{action}/{id}\",\n defaults: new\n {\n area = \"\",\n controller = \"Home\",\n action = \"Index\",\n id = UrlParameter.Optional,\n slug = \"\"\n }\n );\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn one of my \u003ccode\u003ecshtml\u003c/code\u003e I have the following link (even when it's commented, there is still the same error).\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@Html.ActionLink(\"Open your company\", \"DefaultSlug\", new { controller = \"Home\", action = \"Open\", slug = \"open-your-company\" })\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eEDIT: HomeController\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic ActionResult Open() { \n return View(new HomeModel()); \n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"37193373","answer_count":"2","comment_count":"7","creation_date":"2016-05-12 16:54:21.98 UTC","last_activity_date":"2017-05-08 01:41:34.567 UTC","last_edit_date":"2016-05-12 18:43:07.387 UTC","last_editor_display_name":"","last_editor_user_id":"5233410","owner_display_name":"","owner_user_id":"662581","post_type_id":"1","score":"2","tags":"c#|asp.net-mvc|routes|slug","view_count":"557"} +{"id":"23687262","title":"FBSessionStateClosedLoginFailed on device","body":"\u003cp\u003eI have a facebook login on my iOS app. It's working on the simulator but when I try on my device it always fails with a \u003ccode\u003eFBSessionStateClosedLoginFailed\u003c/code\u003e status.\u003c/p\u003e\n\n\u003cp\u003eDo you have an idea about what can make this occurred ?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-05-15 19:41:48.38 UTC","last_activity_date":"2014-08-13 13:26:02.193 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"267075","post_type_id":"1","score":"1","tags":"ios|facebook|facebook-ios-sdk","view_count":"96"} +{"id":"12493451","title":"Find the PHP/HTML file containing DIV container shown in FireBug","body":"\u003cp\u003eI'm editing an existing template in Joomla and I need to change the menu icons text. In Joomla Administrator, I cannot find the place where I can do this. So, in FireBug I found DIV container that I was searching for. But if I change the text in FireBug, my changes are obviously not saved. Now very basic question is: how can I know the name of PHP or HTML file, where this DIV container is located? Or how can I save my changes?\u003c/p\u003e","accepted_answer_id":"12493619","answer_count":"5","comment_count":"0","creation_date":"2012-09-19 11:04:22.983 UTC","last_activity_date":"2015-07-02 13:16:25.103 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1157047","post_type_id":"1","score":"1","tags":"php|html|joomla|joomla2.5","view_count":"6682"} +{"id":"17155861","title":"Google App Engine: Endpoints authentication when custom auth or Open ID is used","body":"\u003cp\u003eI recently got started with Google App Engine. I intend to use Flask to serve web pages and the Endpoints API, preferably with the Endpoints-Proto-Datastore for everything else. \u003c/p\u003e\n\n\u003cp\u003eFrom the beginning, non-Google Authentication mechanisms on GAE seem like they need some work. I'd appreciate any light shed on issues I've found so far:\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eCustom Authentication\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eIf you can write an Open ID provider as part of the app, use something like Python-OpenID and also implement a consumer in the same workflow so it appears like regular login. This way it integrates nicely into what the GAE Users API provides.\nI'm guessing if this is done right, users.get_current_user() will work just fine.\u003c/p\u003e\n\n\u003cp\u003eIf you want to skip writing your own OpenID provider and instead write an email/password auth system using Flask-Login integrating with NDB, that should be alright too. However, one puzzling bit of info in the \u003ca href=\"https://developers.google.com/appengine/docs/python/users/userobjects\" rel=\"noreferrer\"\u003eGAE documentation\u003c/a\u003e says I can instantiate a user object like so: \u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003euser = users.User(\"XYZ@XYZ.com\")\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eHowever, (there is no \u003ccode\u003euser.put()\u003c/code\u003e method here) a \u003ccode\u003eusers.get_current_user()\u003c/code\u003e still returns None. So what would the use of constructing the user object ever be?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEndpoints Authorization\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eOn including a user=required in the method decorator for an Endpoint-Proto-Datastore rolled API, OAuth seems to work right away - all you have to do while testing it in the APIs explorer is to turn on the OAuth 2.0 switch and pick a valid Oauth 2.0 Scope. So does that mean that if we implement a OpenID provider that integrates with the Users API correctly, it won't be sufficient to use the OAuth magic of Endpoints API?\u003c/p\u003e\n\n\u003cp\u003eHere too, it seems like constructing a user object will not help satisfy the authentication requirement. \u003c/p\u003e\n\n\u003cp\u003eHow would custom authentication / another OpenID implementation work with Endpoint API authentication/authorization? \u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2013-06-17 20:06:01.287 UTC","favorite_count":"4","last_activity_date":"2013-06-25 15:41:56.163 UTC","last_edit_date":"2013-06-24 19:24:59.09 UTC","last_editor_display_name":"","last_editor_user_id":"2119570","owner_display_name":"","owner_user_id":"2494570","post_type_id":"1","score":"7","tags":"google-app-engine|oauth-2.0|openid|google-cloud-endpoints","view_count":"2097"} +{"id":"35028262","title":"How to hide status bar of a single view controller in iOS 9?","body":"\u003cp\u003eIn a ViewController, which I presented modally, I did this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eoverride func prefersStatusBarHidden() -\u0026gt; Bool {\n return true\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis used to work, but it no longer works. What's the best way to hide the status bar \u003cstrong\u003eonly\u003c/strong\u003e for this view controller?\u003c/p\u003e","answer_count":"9","comment_count":"2","creation_date":"2016-01-27 03:22:27.487 UTC","favorite_count":"4","last_activity_date":"2017-11-05 07:01:55.36 UTC","last_edit_date":"2016-01-27 03:25:41.013 UTC","last_editor_display_name":"","last_editor_user_id":"1402846","owner_display_name":"","owner_user_id":"179736","post_type_id":"1","score":"25","tags":"ios|swift","view_count":"21113"} +{"id":"34960833","title":"find specific array from database using mongoose","body":"\u003cp\u003eI have this JSON data in database\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[\n {\n\n \"total\": 30,\n \"List\": [\n { //data//\n }\n ]\n}\n]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI need to fetch the \u003ccode\u003eList\u003c/code\u003e array and skip the items in it, with a limit.\nHow to get the list array using mongoose query?\u003c/p\u003e","accepted_answer_id":"34961031","answer_count":"2","comment_count":"7","creation_date":"2016-01-23 07:28:21.757 UTC","last_activity_date":"2016-01-23 11:17:22.04 UTC","last_edit_date":"2016-01-23 11:17:22.04 UTC","last_editor_display_name":"","last_editor_user_id":"3049855","owner_display_name":"","owner_user_id":"3049855","post_type_id":"1","score":"0","tags":"node.js|mongodb|mongoose|pagination","view_count":"48"} +{"id":"26965361","title":"Restkit: How to define relationships for JSON object with dynamic keys?","body":"\u003cp\u003eI have a JSON object with dynamic keys something like\u003c/p\u003e\n\n\u003cp\u003ecarBrands:\u003c/p\u003e\n\n\u003cp\u003e{\n13950: {\nbrand_id: \"13950\",\nname: \"Toyota\",\ncountry: \"Japan\",\nretailer: \"\"\n},\n13633: {\nbrand_id: \"13633\",\nname: \"NISSAN\",\ncountry: \"JAPAN\",\nretailer: \"\"\n}\n}\u003c/p\u003e\n\n\u003cp\u003eThis need to be mapped with a normal JSON object.\u003c/p\u003e\n\n\u003cp\u003ecars:\u003c/p\u003e\n\n\u003cp\u003e{\n{id: \"xyz\"\nbrand_id: \"13950\",\nstatus: \"pending\",\nuser_id: \"user1\"\n},\n{id: \"ABC\",\nbrand_id: “13633”,\nstatus: \"Delivered\",\nuser_id: \"user2\"\n}\n}\u003c/p\u003e\n\n\u003cp\u003eHere is the code for the carBrands object.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eRKEntityMapping *carBrandsMapping = [RKEntityMapping mappingForEntityForName:@\"CarBrands\" inManagedObjectStore:managedObjectStore]; \ncarBrandsMapping.forceCollectionMapping = YES; \n[ carBrandsMapping addAttributeMappingFromKeyOfRepresentationToAttribute:@\"brand_id\"]; \ncarBrandsMapping.identificationAttributes = @[@\"brand_id\"]; \n[ carBrandsMapping addAttributeMappingsFromDictionary:@{@\"(brand_id).name\": @\"name\", \n@\"(brand_id).retailer\": @\"retailer\", \n@\"(brand_id).country\":@\"country\" \n}];\n\nRKResponseDescriptor *brandsRD = [RKResponseDescriptor responseDescriptorWithMapping:carBrandsMapping method:RKRequestMethodGET pathPattern:nil keyPath:@”brands” statusCodes:RKStatusCodeIndexSetForClass(RKStatusCodeClassSuccessful)];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFor the cars object,\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eRKEntityMapping *carsMapping = [RKEntityMapping mappingForEntityForName:@\"Cars\" inManagedObjectStore:managedObjectStore]; \ncarsMapping.identificationAttributes = @[@\"car_id\"]; \n[carsMapping addAttributeMappingsFromDictionary:@{@\"id\": @\"car_id\", \n@\"brand_id\": @\"brand_id\", \n@\"status\": @\"status\", \n@\"user_id\": @\"user_id\" \n}];\n\nRKResponseDescriptor *carsRD = [RKResponseDescriptor responseDescriptorWithMapping:carsMapping method:RKRequestMethodGET pathPattern:nil keyPath:@”cars” statusCodes:RKStatusCodeIndexSetForClass(RKStatusCodeClassSuccessful)];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI tried the following statements for defining relationships.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[carsMapping addConnectionForRelationship:@\"carBrands\" connectedBy:@\"brand_id\"];\n\n[carsMapping addPropertyMapping:[RKRelationshipMapping relationshipMappingFromKeyPath:@\"carBrands\" toKeyPath:@\"carsBrands\" withMapping:brandsMapping]];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy problem is when I fetch the 'Car' data using following statements, my relationship object 'carBrands' is nil. I also got the 'found unmappable content' error. How to resolve it?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[[RKObjectManager sharedManager] getObjectsAtPath:PATH_FOR_CAR parameters:nil success:^(RKObjectRequestOperation *operation, RKMappingResult *mappingResult) { \nself.carsArray = mappingResult.array;\nNSLog(@\"%@\",mappingResult.array);\n} failure:^(RKObjectRequestOperation *operation, NSError *error) {\nRKLogError(@\"Load failed with error: %@\", error);\n}];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eQuestion:\u003c/p\u003e\n\n\u003cp\u003eHow to define the relationship mapping, so that fetching 'Cars' entity will have the realtionship data 'carBrands' stored as faults and not nil?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@class CarBrands; \n@interface Cars: NSManagedObject \n@property (nonatomic, retain) NSString * car_id; \n@property (nonatomic, retain) NSString * brand_id; \n@property (nonatomic, retain) NSString * status; \n@property (nonatomic, retain) NSString * user_id; \n@property (nonatomic, retain) CarBrands *carBrands; \n@end\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThank you.\u003c/p\u003e","answer_count":"0","comment_count":"7","creation_date":"2014-11-17 04:07:20.293 UTC","last_activity_date":"2014-11-17 07:44:51.177 UTC","last_edit_date":"2014-11-17 07:44:51.177 UTC","last_editor_display_name":"","last_editor_user_id":"1578867","owner_display_name":"","owner_user_id":"1578867","post_type_id":"1","score":"1","tags":"ios|restkit|restkit-0.20","view_count":"95"} +{"id":"43598278","title":"How to force rendering while a pop-up menu is active in GLUT","body":"\u003cp\u003eI've noticed that if the a pop-up menu is active, the rendering process is frozen until I click on the menu. I've searched the problem and came up with this function\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003evoid glutMenuStatusFunc(void (*func)(int status, int x, int y);\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eWith these flags \u003ccode\u003eGLUT_MENU_IN_USE or GLUT_MENU_NOT_IN_USE\u003c/code\u003e, I can tell if the menu is active. What I'm trying to do is to force rendering while the menu is active. This is what I've done \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eint main(int argc, char **argv) \n{\n ...\n glutDisplayFunc(render);\n glutIdleFunc(glutIdle);\n glutMenuStatusFunc(MenuStatus);\n glutMainLoop();\n\n return 0;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand the \u003ccode\u003eMenuStatus\u003c/code\u003e is \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evoid MenuStatus(int status,int x, int y)\n{\n if ( status == GLUT_MENU_IN_USE )\n glutPostRedisplay();\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWith this solution \u003ccode\u003eglutPostRedisplay()\u003c/code\u003e is triggered once. If I run \u003ccode\u003ewhile()\u003c/code\u003e, the application will freeze. Any suggestions how to force rendering continuously while the a pop-up menu is active?\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2017-04-24 21:49:22.863 UTC","last_activity_date":"2017-04-24 22:08:50.76 UTC","last_edit_date":"2017-04-24 22:08:50.76 UTC","last_editor_display_name":"","last_editor_user_id":"1953533","owner_display_name":"","owner_user_id":"1953533","post_type_id":"1","score":"0","tags":"c++|opengl|glut","view_count":"43"} +{"id":"32731554","title":"Displaying a moveable character inside of a grid","body":"\u003cp\u003eI'm attempting to create an arena style game in the console but I need a little help. I've got the grid and I'm now able to move the player around but I don't think I'm doing it the best way that I could be. What would be a better way?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport subprocess as sp\nplyr_x, plyr_y = (9,5)\n\ndef create_board():\n board = []\n for _ in range(10):\n board.append(['-']*10)\n board[plyr_x][plyr_y] ='o'\n return board\n\ndef print_board(board):\n tmp = sp.call('clear')\n for row in board:\n print ' '.join(row)\n\nboard = create_board()\nprint_board(board)\nwhile True:\n direction = raw_input('Which way do you want to move? ')\n if direction == 'up':\n plyr_x += -1\n print_board(create_board())\n elif direction == 'down':\n plyr_x += 1\n print_board(create_board())\n elif direction == 'right':\n plyr_y += 1\n print_board(create_board())\n elif direction == 'left':\n plyr_y += -1\n print_board(create_board())\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"32731658","answer_count":"1","comment_count":"4","creation_date":"2015-09-23 05:23:16.65 UTC","last_activity_date":"2015-09-23 06:18:18.21 UTC","last_edit_date":"2015-09-23 06:18:18.21 UTC","last_editor_display_name":"","last_editor_user_id":"5245521","owner_display_name":"","owner_user_id":"5245521","post_type_id":"1","score":"-1","tags":"python|console","view_count":"557"} +{"id":"20330754","title":"QMessageBox class giving more results then required","body":"\u003cp\u003eI am using infinite while loop in my app from which i emitting a signal to call a slot in which dialog box is defined.\u003c/p\u003e\n\n\u003cp\u003eI am using msleep(5000) in my infinite loop.\u003c/p\u003e\n\n\u003cp\u003eProblem is when dialog box pops up first time and if i don't close it with in 5 seconds then another dialog box appears then another after 5 seconds and so on.\u003c/p\u003e\n\n\u003cp\u003eany help appreciated.\u003c/p\u003e","accepted_answer_id":"20351787","answer_count":"1","comment_count":"7","creation_date":"2013-12-02 14:33:14.403 UTC","last_activity_date":"2013-12-03 12:53:42.717 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2797900","post_type_id":"1","score":"0","tags":"qt","view_count":"45"} +{"id":"28417678","title":"Implement serialPort.write in Python","body":"\u003cp\u003eIn my javascript code I turn the \u003ccode\u003earudino\u003c/code\u003e lights on like following:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar serialport = require(\"serialport\");\nvar SerialPort = require(\"serialport\").SerialPort;\nserialPort.write(\"1\", function(err, results) \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow can I implement this method in Python?\u003c/p\u003e","accepted_answer_id":"28417819","answer_count":"1","comment_count":"0","creation_date":"2015-02-09 19:26:38.683 UTC","last_activity_date":"2015-02-10 01:27:41.63 UTC","last_edit_date":"2015-02-10 01:27:41.63 UTC","last_editor_display_name":"","last_editor_user_id":"4544313","owner_display_name":"","owner_user_id":"4544313","post_type_id":"1","score":"0","tags":"python|serial-port","view_count":"51"} +{"id":"24432292","title":"Where did I make a mistake in the Mergesort algorithm","body":"\u003cp\u003eI'm learning some algorithm and at the moment I try to implement Mergesort into Java. This is my code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class Mergesort {\n\n/**\n * @param args\n */\npublic static void main(String[] args) {\n int []a = {12,34,6543,3,6,45,23,677,56,67,3,4,54,5};\n sort(a);\n for(int i:a)\n {\n System.out.println(i);\n }\n\n}\nprivate static void merge(int[]a,int[]b,int[]c)\n{\n int i = 0, j = 0, k = 0; \n while((i \u0026lt; b.length) \u0026amp;\u0026amp; (j \u0026lt; c.length))\n {\n if(b[i] \u0026lt; c[j])\n {\n a[k++] = b[i++]; \n }\n else\n {\n a[k++] = c[j++];\n }\n\n while( i \u0026lt; b.length)\n {\n a[k++] = b[i++];\n }\n\n while( j \u0026lt; c.length)\n {\n a[k++] = c[j++];\n }\n }\n\n}\n\npublic static void sort (int[]a)\n{\n if(a.length \u0026gt; 1)\n {\n\n int m = a.length / 2;\n int[]b = new int[m];\n int[]c = new int[a.length-m];\n\n for(int i = 0; i \u0026lt; m; i++)\n {\n b[i] = a[i];\n }\n for(int i = m; i \u0026lt;a.length; i++ )\n {\n c[i-m] = a[i];\n }\n\n sort(b);\n sort(c);\n\n merge(a,b,c);\n }\n}\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is the output: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e6543\n6\n23\n45\n56\n677\n67\n4\n5\n54\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI copy this from a tutorial but I dont know where the mistake is. My second question is: \u003c/p\u003e\n\n\u003cp\u003eWhat does this mean: a[k++] == b[i++]; \u003c/p\u003e\n\n\u003cp\u003eI know that we are changing the value of a[k] ( k = position in a) to b[i] but why the ++? \u003c/p\u003e\n\n\u003cp\u003eI thought this mean that you are increasing the value by 1?\nThank you for reading.\u003c/p\u003e","accepted_answer_id":"24432934","answer_count":"2","comment_count":"5","creation_date":"2014-06-26 13:46:59.993 UTC","last_activity_date":"2014-06-26 14:16:44.21 UTC","last_edit_date":"2014-06-26 13:51:55.143 UTC","last_editor_display_name":"","last_editor_user_id":"193004","owner_display_name":"","owner_user_id":"3779568","post_type_id":"1","score":"0","tags":"java|algorithm","view_count":"60"} +{"id":"37410878","title":"The imageView in cells created by Xib will move a short distance when presented on screen","body":"\u003cp\u003e\u003ca href=\"http://i.stack.imgur.com/ZNUy5.png\" rel=\"nofollow\"\u003eenter image description here\u003c/a\u003eThis problem confuses me for a long time. I create cells by xib, and use autolayout to set its position. There is an imageView in the cell, I set the leading,trailing,top bottom of the imageView, There is no warnings on the constraints. \u003c/p\u003e\n\n\u003cp\u003eHowever, when the tableview shows on the screen, there is no problem on iPhone6, but strange move on iPhone5s and 6P. \u003cstrong\u003eFor 5s, the imageView shrink form 375 to 320; and for 6P, its width move from 375 to 414.\u003c/strong\u003e All the moves happened in less than 1 second, but users can find it obviously.\u003c/p\u003e\n\n\u003cp\u003eI tried to change the width of xib from 375 to 320, and it comes out that the move disappeared on 5s,but showed on 6 and 6p.And when I change xib width from 375 to 414, the move shows on 5s and 6.\u003cbr /\u003e\u003c/p\u003e\n\n\u003cp\u003eI don't know where the bug is, could anyone teach me, thank you so much!\u003c/p\u003e","answer_count":"2","comment_count":"3","creation_date":"2016-05-24 10:26:43.417 UTC","last_activity_date":"2016-05-24 11:53:12.277 UTC","last_edit_date":"2016-05-24 11:53:12.277 UTC","last_editor_display_name":"","last_editor_user_id":"6375502","owner_display_name":"","owner_user_id":"6375502","post_type_id":"1","score":"0","tags":"ios|objective-c|uitableview","view_count":"55"} +{"id":"18319997","title":"How to hide/show the content of a div with dynamic height?","body":"\u003cp\u003eI am trying to develop a small module (like the \u003ccode\u003ecollapse\u003c/code\u003e component of twitter bootstrap).\u003c/p\u003e\n\n\u003cp\u003eI don't know how to treat the content of the div which is growing up/down, it could take me many descriptions, nothing's better than an example: \u003ca href=\"http://jsfiddle.net/JjPcy/\" rel=\"nofollow\"\u003eCollapse deployment\u003c/a\u003e.\u003c/p\u003e\n\n\u003cp\u003eYou can see a \u003ccode\u003ediv.container\u003c/code\u003e which is the block destined to grow up/down.\nHere i declare \u003ccode\u003eheight: 50px\u003c/code\u003e to illustrate a state of the deployment.\u003c/p\u003e\n\n\u003cp\u003eIs there a way to hide the content (here a part of the text) that is out of the height of a parent div ?\u003c/p\u003e\n\n\u003cp\u003eI like the idea that we can access a content only by deploying another one, but i don't really don't understand how to make it happen properly in CSS.\u003c/p\u003e","accepted_answer_id":"18320153","answer_count":"3","comment_count":"0","creation_date":"2013-08-19 17:50:22.267 UTC","last_activity_date":"2013-08-19 18:29:21.013 UTC","last_edit_date":"2013-08-19 18:11:43.833 UTC","last_editor_display_name":"","last_editor_user_id":"1253652","owner_display_name":"","owner_user_id":"1255058","post_type_id":"1","score":"0","tags":"css|css3","view_count":"796"} +{"id":"13465657","title":"iText - add content to the bottom of an existing page","body":"\u003cp\u003eI want to add a piece of text to every page of a PDF file. \u003ca href=\"https://stackoverflow.com/questions/3335126/itext-add-content-to-existing-pdf-file\"\u003eThis answer in SO\u003c/a\u003e works fine. But, the text is added to the top of the page. I would like to add my text to the bottom of each page. How do I do this?\u003c/p\u003e\n\n\u003cp\u003eHere is the relevant part of the code.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e while (iteratorPDFReader.hasNext()) {\n PdfReader pdfReader = iteratorPDFReader.next();\n\n // Create a new page in the target for each source page.\n while (pageOfCurrentReaderPDF \u0026lt; pdfReader.getNumberOfPages()) {\n document.newPage();\n pageOfCurrentReaderPDF++;\n currentPageNumber++;\n page = writer.getImportedPage(pdfReader, pageOfCurrentReaderPDF);\n cb.addTemplate(page, 0, 0);\n\n document.add(new Paragraph(\"My Text here\")); //As per the SO answer\n\n }\n pageOfCurrentReaderPDF = 0;\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe code is part of a function which accepts a folder, reads the PDF files in it and merges them into one single file. So, I would like to add the text in the above loop itself, instead of iterating the file once again. \u003c/p\u003e","accepted_answer_id":"13468517","answer_count":"3","comment_count":"0","creation_date":"2012-11-20 02:16:14.823 UTC","last_activity_date":"2012-11-20 07:35:34.19 UTC","last_edit_date":"2017-05-23 12:22:11.77 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"1142004","post_type_id":"1","score":"0","tags":"java|itext","view_count":"11665"} +{"id":"45227829","title":"How can I validate a github branch name as a string parameter in jenkins parametrized job?","body":"\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/qdamm.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/qdamm.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eHow can I do some github branch name validation in jenkins? \u003c/p\u003e\n\n\u003cp\u003ebranch should contain only 26 alphanumeric characters and hyphens\nbranch should \u003cstrong\u003eNOT\u003c/strong\u003e begin with \u003cstrong\u003e\u003cem\u003ewww\u003c/em\u003e\u003c/strong\u003e, \u003cstrong\u003e\u003cem\u003eapi\u003c/em\u003e\u003c/strong\u003e or \u003cstrong\u003e\u003cem\u003eadmin\u003c/em\u003e\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eOne regex for this could be: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e^(?!www)(?!admin)(?!api)[a-zA-Z0-9.]{1,26}$\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy problem is that I want to do this validation when the job is run.\u003c/p\u003e\n\n\u003cp\u003eWhere should i put such regex validation for the branch name in jenkins? \u003c/p\u003e\n\n\u003cp\u003ePS: in the attached image, that branch for instance is an illegal branch name ... it breaks the validation rule because it starts with www.\u003c/p\u003e\n\n\u003cp\u003ethank you\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2017-07-21 02:01:53.547 UTC","favorite_count":"1","last_activity_date":"2017-07-21 04:44:02.763 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"779429","post_type_id":"1","score":"1","tags":"regex|validation|github|jenkins|branch","view_count":"71"} +{"id":"14915987","title":"All my fields have a prefix. How can I tell that to hibernate?","body":"\u003cp\u003eE.g. I have:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e @Column(name = \"username\")\n private String m_username;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNote that the @Column annotation only affects the database column name. \u003c/p\u003e\n\n\u003cp\u003eHibernate still thinks the name of the property is 'm_username'.\u003c/p\u003e\n\n\u003cp\u003eHow can I tell Hibernate that the property name is just 'username'?\u003c/p\u003e\n\n\u003cp\u003ePlease tell me there is a way to do this...\u003c/p\u003e\n\n\u003cp\u003eEdit: I removed the @AccessType annotation in my code example, as it is not relevant for this question.\u003c/p\u003e\n\n\u003cp\u003eUpdate: After switching everything to field access, this exception happens:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eorg.hibernate.QueryException: could not resolve property: username of: mypackage.model.User\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt happens here:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCriteria criteria = session.createCriteria(User.class);\ncriteria.add(Restrictions.eq(\"username\", username));\nUser result = (User) criteria.uniqueResult();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd the reason is most likely that hibernate only 'knows' of a property called 'm_username', while I think of it and program against a property named 'username'. Also note that my getters/setters are called: \"getUsername()\" and \"setUsername(String value)\" (automatically generated).\u003c/p\u003e","answer_count":"3","comment_count":"0","creation_date":"2013-02-16 22:48:55.967 UTC","last_activity_date":"2013-02-18 10:56:49.173 UTC","last_edit_date":"2013-02-18 10:56:49.173 UTC","last_editor_display_name":"","last_editor_user_id":"1124509","owner_display_name":"","owner_user_id":"1124509","post_type_id":"1","score":"0","tags":"java|hibernate|hibernate-annotations","view_count":"274"} +{"id":"42559585","title":"How can i eliminate underlines on non-linked urls?","body":"\u003cp\u003eI know outlook (word) adds tags to links, and I know there are a few ways via CSS to override this (both in the style tags in the header, and in the a href).\u003c/p\u003e\n\n\u003cp\u003eBut these tags are ignored, edited and/or just don't work.\u003c/p\u003e\n\n\u003cp\u003eIn this case, outlook and aol mail clients seem to add an underline in a url that is NOT wrapped in an href. \u003c/p\u003e\n\n\u003cp\u003eEven if I apply a SPAN tag, and declare text-decoration: none, the underline shows up.\u003c/p\u003e\n\n\u003cp\u003eAny suggestions how to eliminate this?\u003c/p\u003e","answer_count":"1","comment_count":"5","creation_date":"2017-03-02 15:34:38.44 UTC","last_activity_date":"2017-03-02 15:47:35.857 UTC","last_edit_date":"2017-03-02 15:47:35.857 UTC","last_editor_display_name":"","last_editor_user_id":"1860561","owner_display_name":"","owner_user_id":"7563519","post_type_id":"1","score":"0","tags":"css|underline","view_count":"40"} +{"id":"9887382","title":"SmartGwt - Excel like cell based focus in SmartGwt","body":"\u003cp\u003eI am trying to implement an MS-Excel like functionality in SmartGwt where i can navigate through various cells in a ListGrid using keyboard and edit cells individually.\u003c/p\u003e\n\n\u003cp\u003eCurrently it is only possible to navigate the grid at a row level, and all editable cells go into edit mode together. \u003c/p\u003e\n\n\u003cp\u003eWe have a grid that shows stock market data with fields for price, symbol etc. The last field is a button, and users want to navigate to this button using the arrow keys and press enter to execute a buy/sell order.\u003c/p\u003e\n\n\u003cp\u003eThanks for helping\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2012-03-27 10:05:19.94 UTC","last_activity_date":"2012-03-27 10:05:19.94 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"579705","post_type_id":"1","score":"1","tags":"smartgwt|smartclient","view_count":"312"} +{"id":"37938446","title":"What are the costs of using Redis channels over single Redis channel","body":"\u003cp\u003eI have some code which basically does this psudocode()\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eregisterCamera(id) {\n createRedisPubChannel(\"Camera_\"+id)\n}\n\ncameraDisconnect() {\n removeRedisSubChannel(\"Camera_\"+id)\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI then communicate with that camera through that channel and this allows me to have multiple engines.\u003c/p\u003e\n\n\u003cp\u003eI could also structure the code so that instead of creating a channel per camera. I could create one channel called \"cameraComms\" and make sure every message contains a camera id.\u003c/p\u003e\n\n\u003cp\u003eI wonder are there any performance advantages / disadvantages to either design pattern? \u003c/p\u003e\n\n\u003cp\u003eIf it helps I can have up to 200+ cameras registered per process, and communication is across 3 different boxes running 3 instances of Redis.\u003c/p\u003e\n\n\u003cp\u003eHelp/advice greatly appreciated.\u003c/p\u003e","accepted_answer_id":"37942303","answer_count":"1","comment_count":"0","creation_date":"2016-06-21 07:48:01.443 UTC","last_activity_date":"2016-06-21 10:45:37.497 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"346271","post_type_id":"1","score":"0","tags":"node.js|redis|redis-cluster|ioredis","view_count":"47"} +{"id":"32479558","title":"Swift : Disable FrontViewController when Rear is Displayed","body":"\u003cp\u003eI want to disable interaction with front view when left or right views are revealed. How to do this ?\u003c/p\u003e\n\n\u003cp\u003eAll the sources are written in objective-C \u003c/p\u003e\n\n\u003cp\u003efor example this one \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e - (void)revealController:(SWRevealViewController *)revealController willMoveToPosition:(FrontViewPosition)position\n{\n if(position == FrontViewPositionLeft) {\n self.view.userInteractionEnabled = YES;\n } else {\n self.view.userInteractionEnabled = NO;\n }\n}\n\n- (void)revealController:(SWRevealViewController *)revealController didMoveToPosition:(FrontViewPosition)position\n{\n if(position == FrontViewPositionLeft) {\n self.view.userInteractionEnabled = YES;\n } else {\n self.view.userInteractionEnabled = NO;\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eUpdate\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eThis is Front View Controller \ndidn't work either \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass Feed: UIViewController,SWRevealViewControllerDelegate {\n\n\n\n\n@IBOutlet var tableView: UITableView!\n\n@IBOutlet weak var menuButton:UIBarButtonItem!\n\noverride func viewDidLoad() {\n super.viewDidLoad()\n self.revealViewController().delegate = self\n\n\n if self.revealViewController() != nil {\n menuButton.target = self.revealViewController()\n menuButton.action = \"revealToggle:\"\n self.view.addGestureRecognizer(self.revealViewController().panGestureRecognizer())\n\n func revealController(revealController: SWRevealViewController!, willMoveToPosition position: FrontViewPosition)\n {\n if position == FrontViewPosition.Left // if it not statisfy try this --\u0026gt; if revealController.frontViewPosition == FrontViewPosition.Left\n {\n self.view.userInteractionEnabled = false\n }\n else\n {\n self.view.userInteractionEnabled = true\n }\n\n\n }\n\n fetchMessages()\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"32479742","answer_count":"3","comment_count":"3","creation_date":"2015-09-09 12:27:53.137 UTC","last_activity_date":"2016-05-20 10:43:44.533 UTC","last_edit_date":"2016-05-20 10:43:44.533 UTC","last_editor_display_name":"","last_editor_user_id":"2783370","owner_display_name":"","owner_user_id":"4783618","post_type_id":"1","score":"2","tags":"ios|objective-c|iphone|swift|swrevealviewcontroller","view_count":"1144"} +{"id":"27606798","title":"Inference not working","body":"\u003cp\u003eI'm relatively new to Drools. I have those rules :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport models.Demarche;\ndeclare IsMarque\n demarche : Demarche\nend \n\nrule \"Add type Marque taxe\"\nsalience 2\nno-loop true\nlock-on-active true\nwhen\n $d : Demarche( typeDemarche == \"Marque\" )\nthen\n modify($d){\n listTaxes.put(14, 1)\n }\n insert( new IsMarque( $d ) );\n System.out.println(\"infer marque\");\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003erule \"Add Marque Polynesie extention taxe\"\nno-loop true\nlock-on-active true\nwhen\n $d : Demarche( extPolynesie == true)\n IsMarque(demarche == $d)\nthen\n $d.listTaxes.put(17, 1);\n System.out.println(\"marque\");\nend\n\n\n\nrule \"Add Not Marque Polynesie extention taxe\"\nno-loop true\nlock-on-active true\nwhen\n $d : Demarche( extPolynesie == true)\n not(IsMarque(demarche == $d))\nthen\n\n System.out.println(\"not marque\");\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFor the rules 2 or 3, nothing happens. One of them should be true, but nothing is printed, as if the infered IsMarque cannot be evaluated. If I comment the IsMaqrue evaluation this is working, i can see the messages printed in the console.\nAny idea?\u003c/p\u003e","accepted_answer_id":"27618431","answer_count":"1","comment_count":"5","creation_date":"2014-12-22 16:41:49.303 UTC","last_activity_date":"2014-12-23 10:35:52.297 UTC","last_edit_date":"2014-12-23 10:35:52.297 UTC","last_editor_display_name":"","last_editor_user_id":"3492427","owner_display_name":"","owner_user_id":"3492427","post_type_id":"1","score":"0","tags":"drools|inference","view_count":"50"} +{"id":"42234100","title":"Oracle APEX Tabular form select list disable","body":"\u003cp\u003eUsing Oracle Apex 4.2\u003c/p\u003e\n\n\u003cp\u003eI have a tabular form where you can create a new row and can update existing data. I am having a problem with trying to disable or make items read only in a select list on the tabular form.\u003c/p\u003e\n\n\u003cp\u003eFor example, the select list has in it; \norange, green, blue, red\u003c/p\u003e\n\n\u003cp\u003eI want to be able to disable or read only the items blue and orange in the select list based on a value from another column. \u003c/p\u003e\n\n\u003cp\u003eAny help would be appreciated.\u003c/p\u003e","accepted_answer_id":"42243634","answer_count":"2","comment_count":"0","creation_date":"2017-02-14 18:56:35.057 UTC","favorite_count":"1","last_activity_date":"2017-02-16 18:38:16.677 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7564737","post_type_id":"1","score":"0","tags":"javascript|oracle-sqldeveloper|oracle-apex","view_count":"677"} +{"id":"28662086","title":"How to randomize the text in a label","body":"\u003cp\u003eHow to read a random line from a text file and change the text in the label to be that random line, then after a drag and drop which i have coded(below) the label will change the text. The language is c#. I am a beginner so i apologize if this is a stupid question.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate void txt_carbs_DragEnter(object sender, DragEventArgs e)\n {\n if (e.Data.GetDataPresent(DataFormats.Text))\n e.Effect = e.AllowedEffect;\n // check if the held data format is text\n // if it is text allow the effect \n else\n e.Effect = DragDropEffects.None;\n // if it is not text do nothing\n }\n\n private void txt_protien_DragEnter(object sender, DragEventArgs e)\n {\n if (e.Data.GetDataPresent(DataFormats.Text))\n e.Effect = e.AllowedEffect;\n // check if the held data format is text\n // if it is text allow the effect \n else\n e.Effect = DragDropEffects.None;\n // if it is not text do nothing\n }\n\n private void txt_fats_DragEnter(object sender, DragEventArgs e)\n {\n if (e.Data.GetDataPresent(DataFormats.Text))\n e.Effect = e.AllowedEffect;\n // check if the held data format is text\n // if it is text allow the effect \n else\n e.Effect = DragDropEffects.None;\n // if it is not text do nothing\n }\n\n private void txt_fats_DragDrop(object sender, DragEventArgs e)\n {\n txt_fats.Text += e.Data.GetData(DataFormats.Text).ToString();\n //add the text into the text box\n }\n\n private void txt_protien_DragDrop(object sender, DragEventArgs e)\n {\n txt_protien.Text += e.Data.GetData(DataFormats.Text).ToString();\n //add the text into the text box\n }\n\n private void txt_carbs_DragDrop(object sender, DragEventArgs e)\n {\n txt_carbs.Text += e.Data.GetData(DataFormats.Text).ToString();\n //add the text into the text box\n }\n\n private void lbl_term_MouseDown(object sender, MouseEventArgs e)\n {\n lbl_term.DoDragDrop(lbl_term.Text, DragDropEffects.Copy);\n // get the text from the label\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAlso this is how ive been changing the labels text however this isn't it isn't randomized \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eStreamReader score =\n new StreamReader(file_location);\n label10.Text = score.ReadLine();\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"28662146","answer_count":"1","comment_count":"0","creation_date":"2015-02-22 19:13:54.753 UTC","last_activity_date":"2015-02-22 19:19:08.737 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4430736","post_type_id":"1","score":"0","tags":"c#|random|label|text-files","view_count":"410"} +{"id":"28487633","title":"Changes to developer program: will email-address still be available to all developers?","body":"\u003cp\u003eI went through the description on changes and one thing is not clear to me:\u003c/p\u003e\n\n\u003cp\u003eOur app reads the email-address field for authenticated user (via \u003ccode\u003e/v1/people/~:(email-address)\u003c/code\u003e). That field is listed as a separate group, \"Email Fields\", in the \u003ca href=\"https://developer-programs.linkedin.com/documents/profile-fields\" rel=\"nofollow\"\u003eprofile fields doc\u003c/a\u003e, but it does not appear anywhere in \u003ca href=\"https://developer.linkedin.com/docs/fields\" rel=\"nofollow\"\u003eData Fields documentation\u003c/a\u003e. \u003c/p\u003e\n\n\u003cp\u003eHow or where can I check if that field is going to be available to all developers after May 12th?\u003c/p\u003e","accepted_answer_id":"28488456","answer_count":"1","comment_count":"3","creation_date":"2015-02-12 20:58:25.687 UTC","favorite_count":"1","last_activity_date":"2015-02-12 21:48:56.167 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2191732","post_type_id":"1","score":"3","tags":"linkedin","view_count":"82"} +{"id":"11140183","title":"setting Column width for Datatable primefaces","body":"\u003cp\u003eNeed some help in setting the column width for the datatable. However, the datatable width does not seem to be uniform.The width of the column in the datatable, seems to vary depending on the column header length. please refer the code below.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;p:column style=\"text-align: left; width:15px;\" \u0026gt;\n \u0026lt;f:facet name=\"header\"\u0026gt;\n \u0026lt;h:outputText id=\"SalesHistoryID\" value=\"View Sales History/Forecast\"/\u0026gt;\n \u0026lt;/f:facet\u0026gt;\n \u0026lt;h:commandLink id=\"ForecastID\" value=\"View\"/\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003c/p\u003e\n\n\u003cp\u003eIn the above case, the column header value length 'View Sales History/Forecast' seems to be large and hence the column width also seems to expand depending on the column header text value. Can you please let me know if there is any way to actually maintain uniformity in the column width and that not depend on the column header text value. \u003c/p\u003e\n\n\u003cp\u003eIn case if the column header text length is too large, is there a way to maintain uniformity in the column width ?? please Assist. Thanks in Advance\u003c/p\u003e","accepted_answer_id":"11141085","answer_count":"3","comment_count":"0","creation_date":"2012-06-21 14:16:55.78 UTC","last_activity_date":"2016-10-19 17:50:35.003 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1385883","post_type_id":"1","score":"4","tags":"jsf-2|primefaces","view_count":"42860"} +{"id":"40241930","title":"angular 2 visual studio 2015 startup, cannot restore package.json","body":"\u003cp\u003eI am trying to follow general vs2015 setup sequence. However when I get to the part where you need to restore the project packages on package.json (IE right click) , that option (Restore Packages) is not avail. ?? is there an option in VS that is disabled which prevents me from doing this?\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2016-10-25 13:54:37.05 UTC","last_activity_date":"2016-10-25 13:54:37.05 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2182570","post_type_id":"1","score":"0","tags":"angular|visual-studio-2015|quickstart","view_count":"126"} +{"id":"38831479","title":"Call report from C# class file","body":"\u003cp\u003eHow can I call an existing Crystal Report from my C# class file?\u003c/p\u003e\n\n\u003cp\u003eMy method in the class file has the parameter string \u003ccode\u003eCallCrystal(string num)\u003c/code\u003e. The report in is located in \u003ccode\u003eD:/Reports/EmployeDetails/\u003c/code\u003e which displays the employee detail by passing in string input.\u003c/p\u003e\n\n\u003cp\u003eThe method should send this string as a parameter (num) and call the report to crystal report.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-08-08 14:10:16.55 UTC","last_activity_date":"2016-08-10 16:05:30.667 UTC","last_edit_date":"2016-08-08 15:33:33.683 UTC","last_editor_display_name":"","last_editor_user_id":"1464444","owner_display_name":"","owner_user_id":"6414613","post_type_id":"1","score":"-3","tags":"c#|.net|oop|crystal-reports","view_count":"80"} +{"id":"30847286","title":"Table of Content printing correctly for PDF but not for RTF","body":"\u003cp\u003eI am working on a project where I need to create a PDF file and a RTF file, with a Table Of Content. I am doing this using MigraDoc + PdfSharp library for C#.\u003c/p\u003e\n\n\u003cp\u003eThe code for Table of content for both the files is :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic static void DefineTableOfContents(Document document)\n {\n Section section = document.LastSection;\n\n section.AddPageBreak();\n Paragraph paragraph = section.AddParagraph(\"Table of Contents\");\n paragraph.Format.Font.Size = 14;\n paragraph.Format.Font.Bold = true;\n paragraph.Format.SpaceAfter = 24;\n paragraph.Format.OutlineLevel = OutlineLevel.Level1;\n\n paragraph = section.AddParagraph(); \n paragraph.Style = \"TOC\";\n Hyperlink hyperlink = paragraph.AddHyperlink(\"ParaBookmark\");\n hyperlink.AddText(\"Paragraphs\\t\");\n hyperlink.AddPageRefField(\"ParaBookmark\");\n\n paragraph = section.AddParagraph();\n paragraph.Style = \"TOC\";\n hyperlink = paragraph.AddHyperlink(\"AJBookmark\");\n hyperlink.AddText(\"AJ\\t\");\n hyperlink.AddPageRefField(\"AJBookmark\");\n\n paragraph = section.AddParagraph();\n paragraph.Style = \"TOC\";\n hyperlink = paragraph.AddHyperlink(\"TablesBookmark\");\n hyperlink.AddText(\"Tables\\t\");\n hyperlink.AddPageRefField(\"TablesBookmark\");\n\n paragraph = section.AddParagraph();\n paragraph.Style = \"TOC\";\n hyperlink = paragraph.AddHyperlink(\"ChartsBookmark\"); \n hyperlink.AddText(\"Charts\\t\");\n hyperlink.AddPageRefField(\"ChartsBookmark\"); \n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFor Pdf, the code is working fine with all the page numbers appearing properly, but for the RTF file, we get an output like :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eTable of Contents\nParagraphs............................. \u0026lt; Please update this field. \u0026gt;\nAJ..................................... \u0026lt; Please update this field. \u0026gt;\nTables................................. \u0026lt; Please update this field. \u0026gt;\nCharts................................. \u0026lt; Please update this field. \u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAfter googling I came to understand that for the RTF's page numbers to appear on the TOC, we would have to update the whole document manually in MS Word, by using ctrl+A and then F9.\u003c/p\u003e\n\n\u003cp\u003eIs there any programmatic way so that I could get the correct table of content with page numbers for RTF, so that we don't need to update the document manually?\u003c/p\u003e","accepted_answer_id":"30847786","answer_count":"1","comment_count":"0","creation_date":"2015-06-15 14:06:57.327 UTC","last_activity_date":"2015-06-15 14:29:28.17 UTC","last_edit_date":"2015-06-15 14:13:03.99 UTC","last_editor_display_name":"","last_editor_user_id":"4648386","owner_display_name":"","owner_user_id":"4648386","post_type_id":"1","score":"3","tags":"c#|pdfsharp|migradoc","view_count":"373"} +{"id":"22041108","title":"XSLT2.0 transformation generating tags in multiple lines","body":"\u003cp\u003ei am getting the following output after running an xslt2.0 transformation.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;TAG mode=\"w\"\n name=\"x\"\n references=\"x\"\n size=\"5005\"\n type=\"string\"/\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI would like this to be dumped in a single line itself.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;TAG mode=\"w\" name=\"x\" references=\"x\" size=\"5005\" type=\"string\"/\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCode which breaks the line is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;xsl:output method=\"xml\" encoding=\"UTF-8\" byte-order-mark=\"no\" indent=\"yes\"/\u0026gt;\n\u0026lt;xsl:template name=\"agt:var1_function1\"\u0026gt;\n \u0026lt;xsl:param name=\"par0\" as=\"node()\"/\u0026gt;\n \u0026lt;TAG\u0026gt;\n \u0026lt;xsl:sequence select=\"($par0/@node(), $par0/node())\"/\u0026gt;\n \u0026lt;/TAG\u0026gt;\n\u0026lt;/xsl:template\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCan you please suggest me what i am doing wrong here and why this line is breaking into multiple lines?\u003c/p\u003e\n\n\u003cp\u003eBest Regards\nRajesh\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2014-02-26 12:16:40.853 UTC","last_activity_date":"2014-02-26 17:13:46.843 UTC","last_edit_date":"2014-02-26 12:22:35.633 UTC","last_editor_display_name":"","last_editor_user_id":"3355730","owner_display_name":"","owner_user_id":"3355730","post_type_id":"1","score":"0","tags":"xslt-2.0","view_count":"291"} +{"id":"10604652","title":"Issue with correctly displaying a USB Camera input to winforms picturebox","body":"\u003cp\u003eI have a USB videocamera that spits out 640x480 image data frames that I'd like to put in a winforms pictureBox. When I map the data onto the pictureBox using SetPixel the image looks fine, but SetPixel is crushingly slow, so I tried this instead:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e void CreateBitmap()\n {\n int width = bitmap.Width;\n int height = bitmap.Height;\n int n = 0;\n\n // copy normalized data into 1D array\n lock (imageDataLocker)\n {\n for (int i = 0; i \u0026lt; width; ++i)\n {\n for (int j = 0; j \u0026lt; height; ++j)\n {\n Color c = Colorizer.GetColor(imageData[i, j]);\n rgbValues[n] = c.R;\n rgbValues[n + 1] = c.G;\n rgbValues[n + 2] = c.B;\n n += 3;\n }\n }\n }\n\n // Copy image data into the bitmap\n Rectangle rect = new Rectangle(0, 0, width, height);\n BitmapData bitmapData = bitmap.LockBits(rect, ImageLockMode.WriteOnly, bitmap.PixelFormat);\n IntPtr ptr = bitmapData.Scan0;\n int bytes = rgbValues.Length;\n System.Runtime.InteropServices.Marshal.Copy(rgbValues, 0, ptr, bytes);\n bitmap.UnlockBits(bitmapData);\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhere rgbValues is a 1D byte array containing 3 bytes per pixel, imageData is a 2D int array supplied by the camera, and bitmap has a 24bppRgb format. I don't get any errors with this, but when I assign the bitmap to the BackgroundImage of my pictureBox there is a strange banding effect:\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/iPalJ.gif\" alt=\"WEbcam\"\u003e\u003c/p\u003e\n\n\u003cp\u003eWhat am I missing here?\u003c/p\u003e","accepted_answer_id":"10605293","answer_count":"1","comment_count":"7","creation_date":"2012-05-15 16:04:58.593 UTC","last_activity_date":"2012-05-15 16:45:38.613 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1395098","post_type_id":"1","score":"0","tags":"c#|winforms|webcam","view_count":"411"} +{"id":"29086878","title":"How to add more items to a navbar button","body":"\u003cp\u003eI'm a beginner at bootstrap. Please bear with me.\u003c/p\u003e\n\n\u003cp\u003eHow do I add more items to the button that appears on smaller screen sizes in the following code? Right now, the nav links are the content of the button. I would like to have more items that appear in the list when the button appears.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\"\u0026gt;\n \u0026lt;div class=\"container-fluid\"\u0026gt;\n \u0026lt;div class=\"navbar-header\"\u0026gt;\n \u0026lt;button type=\"button\" class=\"navbar-toggle\" data-toggle=\"collapse\" data-target=\".navbar-collapse\"\u0026gt;\n \u0026lt;span class=\"sr-only\"\u0026gt;Toggle Nav Bar\u0026lt;/span\u0026gt;\n \u0026lt;span class=\"icon-bar\"\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;span class=\"icon-bar\"\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;span class=\"icon-bar\"\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;/button\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"navbar-collapse collapse\"\u0026gt;\n \u0026lt;ul class=\"nav navbar-nav navbar-left\"\u0026gt;\n \u0026lt;li class=\"active\"\u0026gt;\u0026lt;a href=\"#\"\u0026gt;Home\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#\"\u0026gt;Emergency\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#\"\u0026gt;Contact\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#\"\u0026gt;Skip to Content\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n \u0026lt;/div\u0026gt;\n\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003c/p\u003e\n\n\u003cp\u003eThe fiddle is below:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://jsfiddle.net/2sf7p510/\" rel=\"nofollow\"\u003ehttp://jsfiddle.net/2sf7p510/\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThank you so much for your assistance.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eedit\u003c/strong\u003e - sorry, I gave the wrong jsfiddle link. Fixed now.\u003c/p\u003e","accepted_answer_id":"29087158","answer_count":"1","comment_count":"0","creation_date":"2015-03-16 21:02:27.777 UTC","favorite_count":"1","last_activity_date":"2015-03-16 21:40:53.767 UTC","last_edit_date":"2015-03-16 21:40:53.767 UTC","last_editor_display_name":"","last_editor_user_id":"4655520","owner_display_name":"","owner_user_id":"4655520","post_type_id":"1","score":"0","tags":"twitter-bootstrap","view_count":"187"} +{"id":"23714578","title":"Grid Scruffy products, leaping out of the area, css float: left:","body":"\u003cp\u003eI am creating a grid of products where they getting left aligned and always getting in this way: \u003ca href=\"http://i.imgur.com/dlUPvPf.jpg\" rel=\"nofollow\"\u003ehttp://i.imgur.com/dlUPvPf.jpg\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003ethis class would be in charge of organizing the product this way:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cblockquote\u003e\n \u003cp\u003e\u003cstrong\u003e.center_conteudo ul.Dot_ListaProdutosULClass li.Dot_ListaProdutosLIClass\u003c/strong\u003e {\u003c/p\u003e\n \n \u003cp\u003ewidth: 188px;\u003c/p\u003e\n \n \u003cp\u003emin-height: 218px;\u003c/p\u003e\n \n \u003cp\u003emargin: 0 12px 30px 0;\u003c/p\u003e\n \n \u003cp\u003efloat: left;\u003c/p\u003e\n \n \u003cp\u003ebackground: url(\"../imagens/produto_img_prateleira.png\") no-repeat 0px 125px;\u003c/p\u003e\n \n \u003cp\u003e}\u003c/p\u003e\n \u003c/blockquote\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eThe final form is getting that way\n\u003ca href=\"http://bit.ly/1nUyEJo\" rel=\"nofollow\"\u003ehttp://bit.ly/1nUyEJo\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eHELP-ME PLEASE! THANKS ;)\u003c/p\u003e","accepted_answer_id":"23714799","answer_count":"1","comment_count":"0","creation_date":"2014-05-17 18:10:57.57 UTC","last_activity_date":"2014-05-17 18:35:09.423 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3648171","post_type_id":"1","score":"0","tags":"html|css","view_count":"18"} +{"id":"21483100","title":"mod_security2 rules for WordPress","body":"\u003cp\u003eAre there any standard (?!) mod_security2 rules for servers with WordPress websites?\nI want to make clear that \u003cstrong\u003eI do not want to disable\u003c/strong\u003e mod_security2 (it exists for a good reason). I just want to make my life a little bit easier when working with WordPress installations.\u003c/p\u003e\n\n\u003cp\u003eI have read this \u003ca href=\"http://wpsecure.net/2012/01/using-mod_security-2-with-wordpress/\" rel=\"nofollow\"\u003ehttp://wpsecure.net/2012/01/using-mod_security-2-with-wordpress/\u003c/a\u003e but it would be great to hear more opinions from people already using \u003cstrong\u003emod_security2\u003c/strong\u003e \u0026amp; \u003cstrong\u003eWordPress\u003c/strong\u003e.\u003c/p\u003e\n\n\u003cp\u003eBecause I am no expert on this, is there any documentation to read on what exactly are the following...\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;LocationMatch \"/wp-admin/post.php\"\u0026gt;\n SecRuleRemoveById 300015 300016 300017 950907 950005 950006 960008 960011 960904 959006\n SecRuleRemoveById phpids-17\n SecRuleRemoveById phpids-20\n SecRuleRemoveById phpids-21\n SecRuleRemoveById phpids-30\n SecRuleRemoveById phpids-61\n\u0026lt;/LocationMatch\u0026gt;\n\n\u0026lt;LocationMatch \"/wp-admin/admin-ajax.php\"\u0026gt;\n SecRuleRemoveById 300015 300016 300017 950907 950005 950006 960008 960011 960904 959006\n SecRuleRemoveById phpids-17\n SecRuleRemoveById phpids-20\n SecRuleRemoveById phpids-21\n SecRuleRemoveById phpids-30\n SecRuleRemoveById phpids-61\n\u0026lt;/LocationMatch\u0026gt;\n\n\u0026lt;LocationMatch \"/wp-admin/page.php\"\u0026gt;\n SecRuleRemoveById 300015 300016 300017 950907 950005 950006 960008 960011 960904\n SecRuleRemoveById phpids-17\n SecRuleRemoveById phpids-20\n SecRuleRemoveById phpids-21\n SecRuleRemoveById phpids-30\n SecRuleRemoveById phpids-61\n\u0026lt;/LocationMatch\u0026gt;\n\n\u0026lt;LocationMatch \"/wp-admin/options.php\"\u0026gt;\n SecRuleRemoveById 300015 300016 300017 950907 950005 950006 960008 960011 960904 959006\n SecRuleRemoveById phpids-17\n SecRuleRemoveById phpids-20\n SecRuleRemoveById phpids-21\n SecRuleRemoveById phpids-30\n SecRuleRemoveById phpids-61\n\u0026lt;/LocationMatch\u0026gt;\n\n\u0026lt;LocationMatch \"/wp-admin/theme-editor.php\"\u0026gt;\n SecRuleRemoveById 300015 300016 300017 950907 950005 950006 960008 960011 960904 959006\n SecRuleRemoveById phpids-17\n SecRuleRemoveById phpids-20\n SecRuleRemoveById phpids-21\n SecRuleRemoveById phpids-30\n SecRuleRemoveById phpids-61\n\u0026lt;/LocationMatch\u0026gt;\n\n\u0026lt;LocationMatch \"/wp-content/plugins/\"\u0026gt;\n SecRuleRemoveById 300015 340151 1234234 340153 1234234 300016 300017 950907 950005 950006 960008 960011 960904 959006\n SecRuleRemoveById phpids-17\n SecRuleRemoveById phpids-20\n SecRuleRemoveById phpids-21\n SecRuleRemoveById phpids-30\n SecRuleRemoveById phpids-61\n\u0026lt;/LocationMatch\u0026gt;\n\n\u0026lt;LocationMatch \"/wp-includes/\"\u0026gt;\n SecRuleRemoveById 960010 960012 950006 959006\n SecRuleRemoveById phpids-17\n SecRuleRemoveById phpids-20\n SecRuleRemoveById phpids-21\n SecRuleRemoveById phpids-30\n SecRuleRemoveById phpids-61\n\u0026lt;/LocationMatch\u0026gt;\n\n\u0026lt;LocationMatch \"/wp-content/themes/\"\u0026gt;\n SecRuleRemoveById 340151 340153 1234234 950006 959006\n SecRuleRemoveById phpids-17\n SecRuleRemoveById phpids-20\n SecRuleRemoveById phpids-21\n SecRuleRemoveById phpids-30\n SecRuleRemoveById phpids-61\n\u0026lt;/LocationMatch\u0026gt;\n\n\u0026lt;LocationMatch \"/wp-cron.php\"\u0026gt;\n SecRuleRemoveById 960015\n\u0026lt;/LocationMatch\u0026gt;\n\n\u0026lt;LocationMatch \"/feed\"\u0026gt;\n SecRuleRemoveById 960015\n\u0026lt;/LocationMatch\u0026gt;\n\n\u0026lt;LocationMatch \"/category/feed\"\u0026gt;\n SecRuleRemoveById 960015\n\u0026lt;/LocationMatch\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThank you.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-01-31 14:59:48.85 UTC","last_activity_date":"2016-12-31 14:06:33.04 UTC","last_edit_date":"2014-01-31 15:07:37.11 UTC","last_editor_display_name":"","last_editor_user_id":"388382","owner_display_name":"","owner_user_id":"388382","post_type_id":"1","score":"3","tags":"wordpress|mod-security|mod-security2","view_count":"6206"} +{"id":"40236995","title":"Unit test context configuration spring","body":"\u003cp\u003eI am doing unit tests for a rest controller, which is only a small part of a bigger application.\u003cbr\u003e\nIdeally I would like to use a mocking framework to ensure that the test are unitary. I would mock the manager and the dao.\u003cbr\u003e\nHowever that would require to have different configurations for the rest controller class that make him use a different manager depending if we are in test context or in application context.\u003cbr\u003e\nThe mocks are defined in context-test.xml.\u003c/p\u003e\n\n\u003cp\u003eThis is what I have done so far :\u003cbr\u003e\n\u003cstrong\u003eTest RestController\u003c/strong\u003e \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@RunWith(SpringJUnit4ClassRunner.class)\n@SpringApplicationConfiguration(locations = \"classpath:/META-INF/spring/context-test.xml\")\n@WebIntegrationTest\npublic class MyRestControllerTest extends AbstractTransactionnalTest {\n\n @Autowired\n private IManager manager;\n\n @Test\n // my unit tests\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eRestController\u003c/strong\u003e \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@RestController\n@SpringApplicationConfiguration(locations = {\"classpath:/META-INF/spring/context-test.xml\",\n \"classpath:/META-INF/spring/context-application.xml\"})\n@RequestMapping(\"/me\")\nclass MyRestController {\n\n @Autowired\n private IManager manager;\n\n // Content of my controller\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe main issue with my solution so far :\u003cbr\u003e\n- I dont know how to tell the RestController wich context to use. (I only want to use one context at a time) \u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eIs there a better solution to do this ?\u003c/strong\u003e\u003c/p\u003e","accepted_answer_id":"40243382","answer_count":"2","comment_count":"3","creation_date":"2016-10-25 10:02:51.727 UTC","last_activity_date":"2016-10-25 15:01:54.893 UTC","last_edit_date":"2016-10-25 10:09:53.227 UTC","last_editor_display_name":"","last_editor_user_id":"6949983","owner_display_name":"","owner_user_id":"6949983","post_type_id":"1","score":"1","tags":"java|spring|unit-testing|configuration","view_count":"147"} +{"id":"35378535","title":"PHP Reload Nginx Failing","body":"\u003cp\u003eSo I am having a strange error, essentially I am trying to reload nginx via a php script.\u003c/p\u003e\n\n\u003cp\u003eI have coded and tried the following solution, but even it does not work.\u003c/p\u003e\n\n\u003cp\u003eWhich is extremely strange, it should just be logging in as root and have all of the root capabilities. \u003c/p\u003e\n\n\u003cp\u003eWhen I run service nginx reload from command line as root it works perfectly.\u003c/p\u003e\n\n\u003cp\u003eHere is the code\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\n\n\nini_set('include_path', '/myfolder');\ninclude('Net/SSH2.php');\n\n$ssh = new Net_SSH2('1.1.1.1');\nif (!$ssh-\u0026gt;login('root', 'foobar')) {\n exit('Login Failed');\n}\n\necho $ssh-\u0026gt;exec('service nginx reload');\n\n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"5","creation_date":"2016-02-13 10:08:24.613 UTC","last_activity_date":"2016-02-13 10:26:27.933 UTC","last_edit_date":"2016-02-13 10:26:27.933 UTC","last_editor_display_name":"","last_editor_user_id":"5788270","owner_display_name":"","owner_user_id":"5788270","post_type_id":"1","score":"1","tags":"php|nginx|ssh|debian","view_count":"84"} +{"id":"45105348","title":"Firebase cant add app","body":"\u003cp\u003eWhen trying to add a new ios app from console i keep getting this\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eThere was an unknown error while processing the request. Try again.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003e\u003ca href=\"https://console.firebase.google.com/u/1/project/hybrid-ios-app-factory/settings/general/ios:BerriesBagelsAndShakes\" rel=\"nofollow noreferrer\"\u003ehttps://console.firebase.google.com/u/1/project/hybrid-ios-app-factory/settings/general/ios:BerriesBagelsAndShakes\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003elooking at the network request looks like the error is coming from the below url\u003c/p\u003e\n\n\u003cp\u003ethe response from \n\u003ca href=\"https://mobilesdk-pa.clients6.google.com/v1/projects/147597417704/clients?key=AIzaSyDovLKo3djdRbs963vqKdbj-geRWyzMTrg\u0026amp;alt=json\" rel=\"nofollow noreferrer\"\u003ehttps://mobilesdk-pa.clients6.google.com/v1/projects/147597417704/clients?key=AIzaSyDovLKo3djdRbs963vqKdbj-geRWyzMTrg\u0026amp;alt=json\u003c/a\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n \"error\": {\n \"code\": 500,\n \"message\": \"Internal error encountered.\",\n \"status\": \"INTERNAL\"\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/axjXN.jpg\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/axjXN.jpg\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2017-07-14 14:24:49.963 UTC","last_activity_date":"2017-07-14 14:24:49.963 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1233313","post_type_id":"1","score":"0","tags":"firebase|firebase-cloud-messaging","view_count":"113"} +{"id":"33419364","title":"MongoDB: How to query between two hours?","body":"\u003cp\u003eI have a collection of restaurants that I would like to query if they are open or not. The query must work across day boundaries (For example 10:00am - 01:00am). Their hours of operation are not presently defined in the collection as of yet so I can set the schema based on the answers to this question.\u003c/p\u003e\n\n\u003cp\u003eBut for example, let's say I have a collection like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e [\n {\n \"name\": \"Pete's Bar\",\n \"hours\":\n {\n \"Sun\": {\n \"open\": \"0800\",\n \"close\": \"1800\"\n },\n \"Mon\": {\n \"open\": \"0800\",\n \"close\": \"1800\"\n },\n \"Tue\": {\n \"open\": \"0800\",\n \"close\": \"1800\"\n },\n \"Wed\": {\n \"open\": \"closed\",\n \"close\": \"closed\"\n },\n \"Thu\": {\n \"open\": \"0800\",\n \"close\": \"1800\"\n },\n \"Fri\": {\n \"open\": \"0800\",\n \"close\": \"0100\"\n },\n \"Sat\": {\n \"open\": \"0800\",\n \"close\": \"0100\"\n }\n }\n } \n] \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBased on the current time of day AND the day of week how would I query the database for all restaurants that are currently open? I currently just find all restaurants and do the logic in python. I would like to just have mongo do it if possible. AGAIN! The 'hours' schema can change to fit the answer.\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2015-10-29 16:11:46.94 UTC","last_activity_date":"2015-10-29 17:54:19.397 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1924325","post_type_id":"1","score":"2","tags":"python|mongodb","view_count":"94"} +{"id":"170786","title":"How to serialize SettingsContext and SettingsPropertyCollection","body":"\u003cp\u003eI need to serialize the System.Configuration.SettingsContext and System.Configuration.SettingsPropertyCollection types as i am implementing my own profile provider. Any suggestions on how to do it in the most simplest way.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2008-10-04 18:15:22.047 UTC","last_activity_date":"2008-10-05 14:01:19.283 UTC","last_edit_date":"2008-10-04 18:47:34.417 UTC","last_editor_display_name":"Addi","last_editor_user_id":"16439","owner_display_name":"Addi","owner_user_id":"16439","post_type_id":"1","score":"0","tags":"wcf|serialization|profile-provider","view_count":"1001"} +{"id":"26858563","title":"SonarQube create profile from web service","body":"\u003cp\u003eHow and which web service can I call to create a new profile in SonarQube? \u003c/p\u003e\n\n\u003cp\u003eI've checked both \u003ccode\u003eapi/profiles\u003c/code\u003e and \u003ccode\u003eapi/qualityprofiles\u003c/code\u003e but could not find it. I am using Sonarqube 4.4.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-11-11 06:02:06.063 UTC","last_activity_date":"2014-11-17 16:11:46.613 UTC","last_edit_date":"2014-11-17 16:06:00.523 UTC","last_editor_display_name":"","last_editor_user_id":"976155","owner_display_name":"","owner_user_id":"4144474","post_type_id":"1","score":"0","tags":"web-services|sonarqube","view_count":"75"} +{"id":"29026499","title":"How to get the points( Latitude and Longitude) between 2 points from google map in android?","body":"\u003cp\u003eI am working in android studio , and the user will select 2 end points on the map, How can I get the points between these 2 end points? so I can compare some points i have with these points??\u003c/p\u003e\n\n\u003cp\u003eAlso another Q. : I will save the location of the user,if I have points How to know the closest point to the user?\u003c/p\u003e\n\n\u003cp\u003eThank you.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-03-13 06:56:05.38 UTC","last_activity_date":"2015-03-13 08:31:12.787 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4666026","post_type_id":"1","score":"-2","tags":"java|android|google-maps|android-studio|google-api","view_count":"801"} +{"id":"9961127","title":"Error when connecting to mySQL db from Android","body":"\u003cp\u003eI've been \u003ca href=\"http://www.helloandroid.com/tutorials/connecting-mysql-database\" rel=\"nofollow\"\u003efollowing this tutorial\u003c/a\u003e. I've been very careful to follow the instructions exactly as given. Everything I've done is identical to what the person is doing, except that in my php file I give the my host, username, password, and database. In my database I've created the exact same table as in the tutorial (same field types names, everything. I ran the same script), and I have the exact same code in Eclipse. \u003c/p\u003e\n\n\u003cp\u003eHere is my code. It is identical to what is given but my HttpPost link is mine. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epackage com.heatscore.pregame;\n\nimport java.io.BufferedReader;\nimport java.io.InputStream;\nimport java.io.InputStreamReader;\nimport java.util.ArrayList;\n\nimport org.apache.http.HttpEntity;\nimport org.apache.http.HttpResponse;\nimport org.apache.http.NameValuePair;\nimport org.apache.http.client.HttpClient;\nimport org.apache.http.client.entity.UrlEncodedFormEntity;\nimport org.apache.http.client.methods.HttpPost;\nimport org.apache.http.impl.client.DefaultHttpClient;\nimport org.apache.http.message.BasicNameValuePair;\nimport org.json.JSONArray;\nimport org.json.JSONException;\nimport org.json.JSONObject;\n\nimport android.app.Activity;\nimport android.os.Bundle;\nimport android.util.Log;\n\npublic class AlertsActivity extends Activity\n{\n JSONArray jArray;\n String result = null;\n InputStream is = null;\n StringBuilder sb=null;\n\n\n public void onCreate(Bundle savedInstanceState) \n {\n super.onCreate(savedInstanceState);\n\n // Uses the scores xml layout\n setContentView(R.layout.alerts);\n\n String result = \"\";\n ArrayList\u0026lt;NameValuePair\u0026gt; nameValuePairs = new ArrayList\u0026lt;NameValuePair\u0026gt;();\n nameValuePairs.add(new BasicNameValuePair(\"year\",\"1980\"));\n\n //http post\n try\n {\n HttpClient httpclient = new DefaultHttpClient();\n HttpPost httppost = new HttpPost(\"http://\u0026lt;EXCLUDED FOR QUESTION\u0026gt;/getAllPeopleBornAfter.php\");\n httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));\n HttpResponse response = httpclient.execute(httppost); \n HttpEntity entity = response.getEntity();\n InputStream is = entity.getContent();\n }\n catch(Exception e)\n {\n Log.e(\"log_tag\", \"Error in http connection \"+e.toString());\n }\n\n //convert response to string\n try\n {\n BufferedReader reader = new BufferedReader(new InputStreamReader(is,\"iso-8859-1\"),8);\n StringBuilder sb = new StringBuilder();\n String line = null;\n while ((line = reader.readLine()) != null) \n {\n sb.append(line + \"\\n\");\n }\n is.close();\n\n result=sb.toString();\n }\n catch(Exception e)\n {\n Log.e(\"log_tag\", \"Error converting result \"+e.toString());\n }\n\n //parse json data\n try\n {\n JSONArray jArray = new JSONArray(result);\n for(int i=0;i\u0026lt;jArray.length();i++)\n {\n JSONObject json_data = jArray.getJSONObject(i);\n Log.i(\"log_tag\",\"id: \"+json_data.getInt(\"id\")+\n \", name: \"+json_data.getString(\"name\")+\n \", sex: \"+json_data.getInt(\"sex\")+\n \", birthyear: \"+json_data.getInt(\"birthyear\"));\n }\n }\n catch(JSONException e)\n {\n Log.e(\"log_tag\", \"Error parsing data \"+e.toString());\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eUnfortunately, when I run my app, the LogCat shows errors: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e04-01 00:01:18.483: E/log_tag(5218): Error converting result java.lang.NullPointerException\n04-01 00:01:18.483: E/log_tag(5218): Error parsing data org.json.JSONException: End of input at character 0 of \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI've also added the correct permissions to the manifest file. And yes, the line is after the application closing tag. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;uses-permission android:name=\"android.permission.INTERNET\"/\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI ping the host to make sure it was not a network issue. The results were successful. Additionally, I am runing the app on my phone, not emulator. The program does not crash, however the error is there in the log.\u003c/p\u003e\n\n\u003cp\u003eSo if almost everthing is identical to the example, then why is mine not working? Has anyone else had this issue and what did you do? Is there any way of figuring this out? \u003c/p\u003e","answer_count":"1","comment_count":"4","creation_date":"2012-04-01 01:17:34.247 UTC","last_activity_date":"2013-03-06 12:42:47.43 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"884625","post_type_id":"1","score":"1","tags":"php|android|mysql|json","view_count":"579"} +{"id":"24697368","title":"PowerShell Function Can-Ping doesn't return $True or $False with switch","body":"\u003cp\u003eI wrote a function to check if a client is online or offline, this works great! However, when I try to use the switch \u003ccode\u003e-Remember\u003c/code\u003e it doesn't iterate the scriptblock \u003ccode\u003e$PingCheck\u003c/code\u003e as desired because the test has already been done once, but it's not returning \u003ccode\u003e$true\u003c/code\u003e or \u003ccode\u003e$false\u003c/code\u003e either. \u003c/p\u003e\n\n\u003cp\u003eWhat would be the best way to have the function always output \u003ccode\u003e$true\u003c/code\u003e or \u003ccode\u003e$false\u003c/code\u003e but don't go through the script block on duplicates?\u003c/p\u003e\n\n\u003cp\u003eThank you for your help as always.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e# Function to check if $Server is online\nFunction Can-Ping ($Server,[switch]$SendMail,[switch]$Remember) {\n\n $PingCheck = {\n\n $Error.Clear()\n\n if (Test-Connection -ComputerName $Server -BufferSize 16 -Count 1 -ErrorAction 0 -quiet) { # ErrorAction 0 doesn't display error information when a ping is unsuccessful\n\n Write-Host \"$(Get-TimeStamp) $Server \u0026gt; Function Can-Ping: Ping test ok\" -ForegroundColor Gray; return $true\n } \n else {\n $Error.Clear()\n Write-Host \"$(Get-TimeStamp) $Server \u0026gt; Function Can-Ping: Ping test FAILED\" -ForegroundColor Gray\n\n Write-Host \"$(Get-TimeStamp) $Server \u0026gt; Function Can-Ping: Flushing DNS\" -ForegroundColor Gray\n ipconfig /flushdns | Out-Null\n\n Write-Host \"$(Get-TimeStamp) $Server \u0026gt; Function Can-Ping: Registering DNS\" -ForegroundColor Gray\n ipconfig /registerdns | Out-Null\n\n Write-Host \"$(Get-TimeStamp) $Server \u0026gt; Function Can-Ping: NSLookup for $Server\" -ForegroundColor Gray\n nslookup $Server | Out-Null # Surpressing error here is not possible unless using '2\u0026gt; $null', but if we do this, we don't get $true or $false for the function so '| Out-Null' is an obligation\n if (!$?) {\n Write-Host \"$(Get-TimeStamp) $Server \u0026gt; Function Can-Ping: NSlookup can't find the hostname, DNS issues or hostname incorrect?\" -ForegroundColor Yellow\n # Write-Host $Error -ForegroundColor Red\n if ($SendMail) {\n Send-Mail \"FAILED Ping test\" \"$(Get-TimeStamp) NSlookup can't find $Server, hostname incorrect or DNS issues?\" \"$error\"\n }\n $script:arrayCanPingError += \"ERROR | $(Get-TimeStamp) Ping test failed: NSlookup can't find $Server, hostname incorrect or DNS issues?`n$error\"\n $script:HTMLarrayCanPingError += \"ERROR | $(Get-TimeStamp) Ping test failed:\u0026lt;br\u0026gt;NSlookup can't find $Server, hostname incorrect or DNS issues?\u0026lt;br\u0026gt;$error\u0026lt;br\u0026gt;\"\n return $false\n }\n else {\n Write-Host \"$(Get-TimeStamp) $Server \u0026gt; Function Can-Ping: Re-pinging $Server\" -ForegroundColor Gray\n if (Test-Connection -ComputerName $Server -BufferSize 16 -Count 1 -ErrorAction 0 -Quiet) {\n Write-Host \"$(Get-TimeStamp) $Server \u0026gt; Function Can-Ping: Ping test ok, problem resolved\" -ForegroundColor Gray\n return $true\n }\n else {\n Write-Host \"$(Get-TimeStamp) $Server \u0026gt; Function Can-Ping: DNS Resolving is ok but can't connect, server offline?\" -ForegroundColor Yellow\n if ($SendMail) {\n Send-Mail \"FAILED Ping test\" \"$error\" \"DNS Resolving is ok but can't connect to $Server, server offline?\"\n } \n $script:arrayCanPingError += \"ERROR Ping test failed: DNS Resolving is ok but can't connect to $Server, server offline?`n$error\"\n $script:HTMLarrayCanPingError += \"ERROR Ping test failed: DNS Resolving is ok but can't connect to $Server, server offline?\u0026lt;br\u0026gt;$error\u0026lt;br\u0026gt;\"\n return $false\n }\n }\n }\n }\n\n # Call the scriptblock $PingAction every time, unless the switch $Remember is provided, than we only check each server once\n if ($Remember) {\n Write-Host \"$(Get-TimeStamp) $Server \u0026gt; Function Can-Ping: Switch '-Remember' detected\" -ForegroundColor Gray\n While ($tmpPingCheckServers -notcontains $Server) { \n \u0026amp;$PingCheck\n $script:tmpPingCheckServers = @($tmpPingCheckServers+$Server) #Script wide variable, othwerwise it stays empty when we leave the function / @ is used to store it as an Array (table) instaed of a string\n } \n } \n else {\n \u0026amp;$PingCheck\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-07-11 12:08:51.337 UTC","last_activity_date":"2014-07-11 13:30:39.403 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2304170","post_type_id":"1","score":"0","tags":"powershell","view_count":"639"} +{"id":"5703827","title":"Twitter Lists Widget Limits","body":"\u003cp\u003eIs there a way to increase the number of displayed tweets in the Twitter List Widget? The javascript code lets you set a max of 100 tweets but twitters api apparently limits it to 20 tweets. Is there a work-around or another way to accomplish this?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2011-04-18 13:46:09.16 UTC","last_activity_date":"2011-05-25 02:38:39.547 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"617165","post_type_id":"1","score":"1","tags":"javascript|jquery|twitter","view_count":"381"} +{"id":"47267464","title":"How to convert BGRA to RGBA in Xamarin.iOS?","body":"\u003cp\u003eI am using AVFoundation to get real-time frames from camera and display to the UrhoSharp.\u003c/p\u003e\n\n\u003cp\u003eHowever, seems the Texture2D in UrhoSharp is not support the BGRA from AVVideoOutput. So I want to convert the \"CVPixelBuffer\" to RGB format.\u003c/p\u003e\n\n\u003cp\u003eI found there is an API in vImage \"vImagePermuteChannels_ARGB8888\", which can convert the BGRA to ARGB but this is not provided by Xamarin.\u003c/p\u003e\n\n\u003cp\u003eSo how to solve this problem?\u003c/p\u003e","accepted_answer_id":"47272554","answer_count":"1","comment_count":"3","creation_date":"2017-11-13 15:08:44.24 UTC","last_activity_date":"2017-11-13 21:00:28.26 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5912317","post_type_id":"1","score":"1","tags":"c#|ios|xamarin|urhosharp","view_count":"54"} +{"id":"29365611","title":"Does running Valgrind slow down my application?","body":"\u003cp\u003eI simply want to keep track of how much memory various processes are using (different options can radically change the memory usage of this particular application). I don't like the various \"find the process pid and grok /proc/pid/smaps\" solutions described elsewhere...\u003c/p\u003e\n\n\u003cp\u003eIs there an alternative command to use that will just dump memory usage of a particular process? memusage?\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2015-03-31 09:49:54.243 UTC","last_activity_date":"2015-04-02 08:16:29.623 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1136257","post_type_id":"1","score":"-1","tags":"linux|memory|valgrind","view_count":"912"} +{"id":"33599367","title":"android home screen widget onReceive() call for custom intent","body":"\u003cp\u003eI am trying to create a home screen widget with 3 buttons. To test code, onReceive() I am calling same activities for time being.\nI am following below tutorials.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://www.byteslounge.com/tutorials/modal-popup-from-android-widget-example\" rel=\"nofollow\"\u003ehttp://www.byteslounge.com/tutorials/modal-popup-from-android-widget-example\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://www.javacodegeeks.com/2013/05/modal-dialog-popup-from-android-widget-example.html\" rel=\"nofollow\"\u003ehttp://www.javacodegeeks.com/2013/05/modal-dialog-popup-from-android-widget-example.html\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003ewhich are well explained for home screen widget for one Button. However, when I click on any button, onReceive() is not getting called. But onReceive() is called when adding widget to home screen or removing from but not button click.\u003c/p\u003e\n\n\u003cp\u003eI need to call different activity for different button. But onReceive() itself not getting called. Unable to figure where I am doing wrong even in debugging.\u003c/p\u003e\n\n\u003cp\u003eNothing is happening when I click on any button on home screen widget.\u003c/p\u003e\n\n\u003cp\u003eBelow is android manifest file\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;receiver\n android:name=\".MyWidgetProvider\" \u0026gt;\n \u0026lt;intent-filter\u0026gt;\n \u0026lt;action android:name=\"android.appwidget.action.APPWIDGET_UPDATE\" /\u0026gt;\n \u0026lt;action android:name=\"com.test.testapp1.action.HANDLE_1\" /\u0026gt;\n \u0026lt;action android:name=\"com.test.testapp1.action.HANDLE_2\" /\u0026gt;\n \u0026lt;action android:name=\"com.test.testapp1.action.HANDLE_3\" /\u0026gt;\n \u0026lt;/intent-filter\u0026gt; \u0026lt;meta-data\n android:name=\"android.appwidget.provider\"\n android:resource=\"@xml/tagit_widget_provider\" /\u0026gt;\n \u0026lt;/receiver\u0026gt;\n\u0026lt;/application\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBelow is MyWidgetProvider code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public class MyWidgetProvider extends AppWidgetProvider {\nprivate static final String ACTION_HANDLE_1 = \"com.test.testapp1.action.HANDLE_1\";\nprivate static final String ACTION_HANDLE_2 = \"com.test.testapp1.action.HANDLE_2\";\nprivate static final String ACTION_HANDLE_3 = \"com.test.testapp1.action.HANDLE_1\";\n\n@Override\npublic void onUpdate(Context context, AppWidgetManager appWidgetManager,\n int[] appWidgetIds) {\n for(int i = 0; i \u0026lt; appWidgetIds.length; i++) {\n int appid = appWidgetIds[i];\n Intent intent = new Intent(context, MainActivity.class);\n intent.setAction(ACTION_HANDLE_1);\n //PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, launchActivity, 0);\n PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);\n RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget_layout);\n\n views.setOnClickPendingIntent(R.id.widget_text1, pendingIntent);\n intent.setAction(ACTION_HANDLE_2);\n views.setOnClickPendingIntent(R.id.widget_text2, pendingIntent);\n\n intent.setAction(ACTION_HANDLE_3);\n views.setOnClickPendingIntent(R.id.widget_text3, pendingIntent);\n appWidgetManager.updateAppWidget(appid, views);\n }\n\n}\n\n@Override\npublic void onReceive(Context context, Intent intent) {\n\n if(intent.getAction().equals(ACTION_HANDLE_1)) {\n Intent intent1 = new Intent(context, HelpActivity.class);\n intent1.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n context.startActivity(intent1);\n\n } else if(intent.getAction().equals(ACTION_HANDLE_2)) {\n Intent intent1 = new Intent(context, HelpActivity.class);\n intent1.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n context.startActivity(intent1);\n\n } else if(intent.getAction().equals(ACTION_HANDLE_3)) {\n Intent intent1 = new Intent(context, HelpActivity.class);\n intent1.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n context.startActivity(intent1);\n\n }\n super.onReceive(context, intent);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e}\u003c/p\u003e\n\n\u003cp\u003eNo errors shown in logcat.\u003c/p\u003e\n\n\u003cp\u003e2nd issue is on android 5.0, widget is showing (both physical phone and emulator) but android 4.3 emulator, widget is not showing widget's selection.\u003c/p\u003e\n\n\u003cp\u003eunable to figure out where I am doing wrong.\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2015-11-08 21:43:40.347 UTC","last_activity_date":"2015-11-09 10:43:52.773 UTC","last_edit_date":"2015-11-09 10:43:52.773 UTC","last_editor_display_name":"","last_editor_user_id":"4051845","owner_display_name":"","owner_user_id":"4051845","post_type_id":"1","score":"0","tags":"android|widget|android-widget|appwidgetprovider","view_count":"340"} +{"id":"30970718","title":"C++: Communication with elevated child process on Windows","body":"\u003cp\u003eI'm having the following setup: The DLL I'm writing is loaded dynamically at runtime and offers some API-like functionality to the host application. The host application is not running with admin rights (and therefor my DLL isn't either).\u003c/p\u003e\n\n\u003cp\u003eSome tasks my DLL needs to fulfill need admin rights though, specifically I have to save and copy files to the program files folder.\u003c/p\u003e\n\n\u003cp\u003eMy current approach is to launch external applications via ShellExecute and the \"runas\" verb, which triggers the UAC prompt. This especially means that multiple subsequent actions triggered by the user will always result in an additional UAC prompt, which could be pretty annoying.\u003c/p\u003e\n\n\u003cp\u003eSo the idea would be to launch a separate, elevated process \u003cem\u003eonce\u003c/em\u003e, which then runs in the background and receives the respective commands and executes them. This brings me to my question: Which methods of communication are even possible between an unelevated process and its elevated child process? Access to stdin seems to be forbidden due to obvious security reasons, but what about named pipes or shared memory? Do the same restrictions apply?\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2015-06-22 00:33:18.5 UTC","favorite_count":"1","last_activity_date":"2015-06-22 00:33:18.5 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"792725","post_type_id":"1","score":"3","tags":"c++|windows|uac|inter-process-communicat","view_count":"129"} +{"id":"45991718","title":"Sass @if directive take multiple conditionals?","body":"\u003cp\u003eI'm writing a \u003ccode\u003e@mixin\u003c/code\u003e that handles both pseudo elements and classes. I essentially need my mixin to listen for \u003ccode\u003ebefore\u003c/code\u003e and \u003ccode\u003eafter\u003c/code\u003e and then do something different to what it would if it was a pseudo class. My current code is as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@mixin pseudo($elem) {\n @if $elem == \"before\" {\n // perform task\n } @else if $elem == \"after\" {\n // perform same task\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy question is \"Can the \u003ccode\u003e@if\u003c/code\u003e directive take two conditionals?\" Leaning on my JS knowledge, I am wondering if something like the following is possible so that I can remove the \u003ccode\u003e@else if\u003c/code\u003e from the statement:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@mixin pseudo($elem) {\n @if (($elem == \"before\") || ($elem == \"after\")) {\n // perform the one task\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks in advance.\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2017-09-01 00:13:05.28 UTC","last_activity_date":"2017-09-01 00:13:05.28 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3654415","post_type_id":"1","score":"0","tags":"css|if-statement|sass","view_count":"22"} +{"id":"14161727","title":"HLSL: Drawing a centered circle","body":"\u003cp\u003eI'm trying to write a post process shader that blurs the center of the screen and then gradually dies off.\u003c/p\u003e\n\n\u003cp\u003eThanks to some code posted on here I have an anti-aliased circle being blurred, but it is in the top left of the screen. The problem seems to be in my algorithm for calculating the circle:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efloat4 PS_GaussianBlur(float2 texCoord : TEXCOORD) : COLOR0\n{\nfloat4 insideColor = float4(0.0f, 0.0f, 0.0f, 0.0f);\nfloat4 outsideColor = tex2D(colorMap, texCoord);\n\n//Perform the blur:\nfor (int i = 0; i \u0026lt; KERNEL_SIZE; ++i)\n insideColor += tex2D(colorMap, texCoord + offsets[i]) * weights[i];\n\nfloat dist = (texCoord.x * texCoord.x) + (texCoord.y * texCoord.y);\nfloat distFromCenter = .5 - dist; // positive when inside the circle\nfloat thresholdWidth = 0.1; // a constant you'd tune to get the right level of softness\nfloat antialiasedCircle = saturate((distFromCenter / thresholdWidth) + 0.5);\nreturn lerp(outsideColor, insideColor, antialiasedCircle);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks in advance!\u003c/p\u003e","accepted_answer_id":"14168008","answer_count":"1","comment_count":"0","creation_date":"2013-01-04 17:18:26.197 UTC","favorite_count":"0","last_activity_date":"2013-01-05 02:38:41.01 UTC","last_edit_date":"2013-01-04 17:25:12.623 UTC","last_editor_display_name":"","last_editor_user_id":"1949273","owner_display_name":"","owner_user_id":"1949273","post_type_id":"1","score":"0","tags":"hlsl","view_count":"710"} +{"id":"34025912","title":"Time conversion Not working properly?","body":"\u003cp\u003eI am using the ionic time picker in my project. When I select the time picker it passes a value to the controller. For example when I select 09:00pm, the console shows 79200. If I select 07:00pm the console shows 68400. I want to convert the value to 12 hrs format. I have followed some steps, but it's not working for me.\u003c/p\u003e\n\n\u003cp\u003eMy code: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar a = new Date($scope.timePickerObject12Hour.inputEpochTime*1000);\nconsole.log(a);\nvar b = moment.utc(a).format(\"HH:mm\");\nconsole.log(b)\n$scope.timePickerObject12Hour.inputEpochTime = val;\nconsole.log(val);\n//var yourDateObject = new Date();\n\nvar selectedTime = new Date();\nvar amPmHour = $filter('date')(selectedTime, 'hh');\nconsole.log(amPmHour);\n$scope.time = $filter('date')(new Date(val*1000), 'hh:mma');\nconsole.log($scope.time);\nconsole.log('Selected epoch is : ', val, 'and the time is ', selectedTime.getUTCHours(), ':', selectedTime.getUTCMinutes(), 'in UTC');\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI tried the code above, but nothing is working. Below i have added my origional code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$scope.timePickerObject12Hour.inputEpochTime = val;\n console.log(val);\n console.log('Selected epoch is : ', val, 'and the time is ', selectedTime.getUTCHours(), ':', selectedTime.getUTCMinutes(), 'in UTC');\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003col\u003e\n\u003cli\u003eon the first console.log i am getting 68400,\u003c/li\u003e\n\u003cli\u003efor second console log I am getting 68400 and the time is 19:00 in UTC. How to convert 12 hr format for the selected time?\u003c/li\u003e\n\u003c/ol\u003e","accepted_answer_id":"34029117","answer_count":"2","comment_count":"1","creation_date":"2015-12-01 17:04:30.62 UTC","last_activity_date":"2015-12-01 20:03:45.497 UTC","last_edit_date":"2015-12-01 17:19:34.427 UTC","last_editor_display_name":"","last_editor_user_id":"5159481","owner_display_name":"user5503464","post_type_id":"1","score":"0","tags":"javascript|jquery|angularjs|ionic","view_count":"48"} +{"id":"41464216","title":"Database Not being created using Entity Framework","body":"\u003cp\u003eI am trying to create a Db using Entity Framework, when I run the program the DB is not being created, am I missing something as i have been dwelling with this problem for some time now.\u003c/p\u003e\n\n\u003cp\u003eCode below: \u003c/p\u003e\n\n\u003cp\u003eDatabase: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass SchoolEmployeesContext : DbContext\n{\n public SchoolEmployeesContext()\n : base(\"SchoolEmployeesDB\") { }\n\n public DbSet\u0026lt;Department\u0026gt; Departments { get; set; }\n public DbSet\u0026lt;Employee\u0026gt; Employees { get; set; }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eEmployee : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eabstract class Employee\n{\n public int EmployeeId { get; set; }\n public string EmployeeName { get; set; }\n public string EmployeeSurname { get; set; }\n public string Address { get; set; }\n public int Grade { get; set; }\n public double Salary { get; set; }\n public DateTime DateOfCommencement { get; set; }\n public string Username { get; set; }\n public string Password { get; set; }\n\n public Department DepartmentOfEmployee { get; set; }\n\n public Employee NewEmployee(Employee NewEmp)\n {\n return NewEmp;\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eDepartment : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass Department\n{\n public Department() { }\n\n public int DepartmentId { get; set; }\n public string DepartmentName { get; set; }\n public string Location { get; set; }\n\n public ICollection\u0026lt;Employee\u0026gt; EmployeesAtDepartment { get; set; }\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"13","creation_date":"2017-01-04 12:46:56.227 UTC","last_activity_date":"2017-01-04 13:24:00.02 UTC","last_edit_date":"2017-01-04 12:47:56.05 UTC","last_editor_display_name":"","last_editor_user_id":"134204","owner_display_name":"","owner_user_id":"6315295","post_type_id":"1","score":"0","tags":"c#|database|entity-framework","view_count":"43"} +{"id":"24174517","title":"Need assistance with a CSS grid","body":"\u003cp\u003eFound this grid online! And i've been trying to implement it into my code. However, I can't figure out the css, It's a total mess.\u003c/p\u003e\n\n\u003cp\u003eNeed some help decrypting it, into traditional CSS? \u003cstrong\u003eLike with braces? { }\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$color: #ebeced\n$gray: #dddddd\n\n*\n box-sizing: border-box\n \u0026amp;:before, \u0026amp;:after\n box-sizing: border-box\n\n=small\n @media only screen and (max-width: 766px)\n @content\n\n=foo\n +small\n width: 100%\n\n.row\n width: 100%\n max-width: 1020px\n margin: 0 auto\n clear:both\n overflow: hidden\n padding-top: 50px\n\n +small\n padding: 0 10px\n\n\n%flok\n min-height: 10px\n margin: 1.0416666666666665%\n float: left\n overflow: hidden\n // background: $color\n border: 4px solid $gray\n\n +small\n margin-left: 0\n margin-right: 0\n\n\n=col1 \n width: 6.25%\n @extend %flok\n +foo\n\n=col2\n width: 14.583333333333334%\n @extend %flok\n +foo\n\n=col3\n width: 22.916666666666664%\n @extend %flok\n +foo\n\n=col4\n width: 31.25%\n @extend %flok\n +foo\n\n=col5\n width: 39.58333333333333%\n @extend %flok\n +foo\n\n=col6\n width: 47.91666666666667%\n @extend %flok\n +foo\n\n=col7\n width: 56.25%\n @extend %flok\n +foo\n\n=col8\n width: 64.58333333333334%\n @extend %flok\n +foo\n\n=col9\n width: 72.91666666666666%\n @extend %flok\n +foo\n\n=col10\n width: 81.25%\n @extend %flok\n +foo\n\n=col11\n width: 89.58333333333334%\n @extend %flok\n +foo\n\n=col12\n width: 97.91666666666666%\n @extend %flok\n +foo\n\n// decorate\nbody\n text-align: center\n line-height: 2.5\n margin: 0\n padding: 0\n color: darken($gray, 10%)\n font-family: 'Open Sans', 'sans-serif'\n font-weight: 300\n\nh1\n text-align: center\n font-size: 45px\n line-height: 1.2\n padding: 45px 0 0\n color: darken($gray, 20%)\n\n.colon1\n +col1\n\n.colon2\n +col2\n\n.colon3\n +col3\n\n.colon4\n +col4\n\n.colon5\n +col5\n\n.colon6\n +col6\n\n.colon7\n +col7\n\n.colon8\n +col8\n\n.colon9\n +col9\n\n.colon10\n +col10\n\n.colon11\n +col11\n\n.colon12\n +col12\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cbr\u003e\n\u003cbr\u003e\n\u003ca href=\"http://cssdeck.com/labs/sexy-grid\" rel=\"nofollow\"\u003e\u003cstrong\u003eURL to CSSDeck\u003c/strong\u003e\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"24174564","answer_count":"1","comment_count":"0","creation_date":"2014-06-12 00:00:37.313 UTC","last_activity_date":"2014-06-12 00:05:17.047 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2253323","post_type_id":"1","score":"-2","tags":"css|css3","view_count":"48"} +{"id":"12285636","title":"Recovering css class name","body":"\u003cp\u003eHow can I recover a Css class that was add via JQuery in my \u003ccode\u003e\u0026lt;asp:TextBox\u0026gt;\u003c/code\u003e component ?\u003c/p\u003e\n\n\u003cp\u003eExample:\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eASPX\u003c/strong\u003e \u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003e\u0026lt;asp:TextBox ID='txtTest' runat='server' CssClass='inputText'\u0026gt;\u0026lt;/asp:TextBox\u0026gt;\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eJQUERY\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003e$('#txtTest').addClass('testClass');\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003ePage Renderized\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003e\u0026lt;input type='text' ID='txtTest' CssClass='inputText testClass' /\u0026gt;\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eCode Behind\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eHow can I recover the \u003ccode\u003etestClass\u003c/code\u003e that was add via Jquery in my \u003ccode\u003e\u0026lt;asp:TextBox\u0026gt;\u003c/code\u003e component ?\u003c/p\u003e\n\n\u003cp\u003eI tryied \u003ccode\u003ethis.txtTest.CssClass\u003c/code\u003e but return just \u003ccode\u003einputText\u003c/code\u003e class. \u003c/p\u003e","accepted_answer_id":"12285794","answer_count":"2","comment_count":"4","creation_date":"2012-09-05 16:14:33.69 UTC","last_activity_date":"2012-09-05 16:23:53.19 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"965769","post_type_id":"1","score":"0","tags":"c#","view_count":"69"} +{"id":"26163484","title":"Spring - accessing Model values in JSP which names contain \"-\" (minus sign)","body":"\u003cp\u003eI have a mapper, which maps some \u003ccode\u003eString\u003c/code\u003es to \u003ccode\u003eObject\u003c/code\u003es and then adds them to \u003ccode\u003eModelAndView\u003c/code\u003e. Now in JSP I want to use this values, for example:\u003cbr\u003e\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003cstrong\u003eJAVA\u003c/strong\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003e\u003ccode\u003eModelAndView model = new ModelAndView(\"sometemplate\");\nmodel.addObject(\"name-with-hyphens\", \"hello world\");\u003c/code\u003e\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003cstrong\u003eJSP\u003c/strong\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cpre class=\"lang-html prettyprint-override\"\u003e\u003ccode\u003e\u0026lt;input type=\"text\" name=\"foo\" class=\"input\" placeholder=\"bar\" value=\"${name-with-hyphens}\" /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, input field has value 0 but - and I checked - without hyphens/minus sign this would be empty and placeholder value would be visible. My guess is that this is interpreted as some mathematic operations; how can I make this work as intended?\u003cbr\u003e\u003cbr\u003e\nFor various reasons, things would be easier for me and my app if I could use hyphens, instead of other signs (less parsing and string operations in my code).\u003c/p\u003e","accepted_answer_id":"26164044","answer_count":"2","comment_count":"0","creation_date":"2014-10-02 14:49:52.67 UTC","last_activity_date":"2014-10-02 15:17:48.987 UTC","last_edit_date":"2014-10-02 14:55:45.537 UTC","last_editor_display_name":"","last_editor_user_id":"3739215","owner_display_name":"","owner_user_id":"3739215","post_type_id":"1","score":"0","tags":"java|spring|jsp","view_count":"386"} +{"id":"40572014","title":"Parent and child class construction","body":"\u003cp\u003eI was just checking to see if I was writing my code correctly, for this checking class, and sure enough the checking class was accessing Account correctly. I just had to initialize it correctly.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass Checking \u0026lt; Account\n\n def \n super\n end\n\n def balance()\n @balance = principal * (1 + interest_rate / 365) ** 365\n end\n\nend\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"5","creation_date":"2016-11-13 08:38:39.557 UTC","last_activity_date":"2016-11-14 23:26:15.85 UTC","last_edit_date":"2016-11-14 23:26:15.85 UTC","last_editor_display_name":"","last_editor_user_id":"7061729","owner_display_name":"","owner_user_id":"7061729","post_type_id":"1","score":"-4","tags":"ruby-on-rails|ruby","view_count":"101"} +{"id":"39816802","title":"Placing list manu items in one bootstrap line with seperators","body":"\u003cp\u003eI have some problems while building my bootstrap website. \nFirst of all, i have PSD whichc i have to make as a responsive bootstrap page, but while messing up with an right menu items it seems I've done something wrong. \n\u003ca href=\"http://i.stack.imgur.com/p12ST.png\" rel=\"nofollow\"\u003ethe menu I need\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eAnd this is what i have now:\n\u003ca href=\"http://i.stack.imgur.com/TozWY.png\" rel=\"nofollow\"\u003emenu I have now\u003c/a\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\"\u0026gt;\n \u0026lt;div class=\"container\"\u0026gt;\n \u0026lt;div class=\"navbar-header\"\u0026gt; \n \u0026lt;button type=\"button\" class=\"navbar-toggle\" data-toggle=\"collapse\" data-target=\".navbar-collapse\"\u0026gt;\n \u0026lt;span class=\"sr-only\"\u0026gt;Toggle navigation\u0026lt;/span\u0026gt;\n \u0026lt;span class=\"icon-bar\"\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;span class=\"icon-bar\"\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;span class=\"icon-bar\"\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;/button\u0026gt;\n \u0026lt;a class=\"navbar-brand href=\"index.html\"\u0026gt;\n \u0026lt;div class=\"logo\"\u0026gt;\n \u0026lt;img src=\"img/logo.png\" alt=\"Homepage\"\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/a\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"navbar-collapse collapse\"\u0026gt;\n \u0026lt;ul class=\"nav navbar-nav\"\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#\"\u0026gt;Find undervisning\u0026lt;/a\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#\"\u0026gt;Om os\u0026lt;/a\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#\"\u0026gt;Blog\u0026lt;/a\u0026gt;\n \u0026lt;/ul\u0026gt;\n \u0026lt;div class=\"divider\"\u0026gt;\n \u0026lt;ul class=\"nav navbar-nav navbar-right\"\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;button type=\"button\" class=\"btn btn-default\"\u0026gt;Support\u0026lt;/button\u0026gt;\u0026lt;/li\u0026gt;\u0026lt;/br\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;button type=\"button\" class=\"btn btn-default\"\u0026gt;Mail \u0026lt;span class=\"badge\"\u0026gt;5\u0026lt;/span\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n\n\n \u0026lt;/div\u0026gt; \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003c/p\u003e\n\n\u003cp\u003eSo, the thing is that:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eI don't know why, but menu hover does not do the job right. I included this in CSS \u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003e\u003cdiv class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\"\u003e\r\n\u003cdiv class=\"snippet-code\"\u003e\r\n\u003cpre class=\"snippet-code-css lang-css prettyprint-override\"\u003e\u003ccode\u003e.navbar-default .navbar-nav li a: hover {\r\ncolor:#0295d5;\r\n }\u003c/code\u003e\u003c/pre\u003e\r\n\u003cpre class=\"snippet-code-html lang-html prettyprint-override\"\u003e\u003ccode\u003e \u0026lt;div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\"\u0026gt;\r\n \u0026lt;div class=\"container\"\u0026gt;\r\n \u0026lt;div class=\"navbar-header\"\u0026gt; \r\n \u0026lt;button type=\"button\" class=\"navbar-toggle\" data-toggle=\"collapse\" data-target=\".navbar-collapse\"\u0026gt;\r\n \u0026lt;span class=\"sr-only\"\u0026gt;Toggle navigation\u0026lt;/span\u0026gt;\r\n \u0026lt;span class=\"icon-bar\"\u0026gt;\u0026lt;/span\u0026gt;\r\n \u0026lt;span class=\"icon-bar\"\u0026gt;\u0026lt;/span\u0026gt;\r\n \u0026lt;span class=\"icon-bar\"\u0026gt;\u0026lt;/span\u0026gt;\r\n \u0026lt;/button\u0026gt;\r\n \u0026lt;a class=\"navbar-brand href=\"index.html\"\u0026gt;\r\n \u0026lt;div class=\"logo\"\u0026gt;\r\n \u0026lt;img src=\"img/logo.png\" alt=\"Homepage\"\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;/a\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"navbar-collapse collapse\"\u0026gt;\r\n \u0026lt;ul class=\"nav navbar-nav\"\u0026gt;\r\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#\"\u0026gt;Find undervisning\u0026lt;/a\u0026gt;\r\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#\"\u0026gt;Om os\u0026lt;/a\u0026gt;\r\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#\"\u0026gt;Blog\u0026lt;/a\u0026gt;\r\n \u0026lt;/ul\u0026gt;\r\n \u0026lt;div class=\"divider\"\u0026gt;\r\n \u0026lt;ul class=\"nav navbar-nav navbar-right\"\u0026gt;\r\n \u0026lt;li\u0026gt;\u0026lt;button type=\"button\" class=\"btn btn-default\"\u0026gt;Support\u0026lt;/button\u0026gt;\u0026lt;/li\u0026gt;\u0026lt;/br\u0026gt;\r\n \u0026lt;li\u0026gt;\u0026lt;button type=\"button\" class=\"btn btn-default\"\u0026gt;Mail \u0026lt;span class=\"badge\"\u0026gt;5\u0026lt;/span\u0026gt;\u0026lt;/li\u0026gt;\r\n \u0026lt;/ul\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \r\n \r\n \u0026lt;/div\u0026gt; \r\n \u0026lt;/div\u0026gt;\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003c/p\u003e\n\n\u003col start=\"2\"\u003e\n\u003cli\u003eTake a look at that right side icons, I need to make them seperated with that vertical line\u003c/li\u003e\n\u003cli\u003eAnd is that Icon with badge possible to make!? (take a look at first header image.\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eBasically, I need to recreate this menu correctly in bootstrap 3 and make it responsive.\u003c/p\u003e","accepted_answer_id":"39816961","answer_count":"2","comment_count":"3","creation_date":"2016-10-02 12:04:06.733 UTC","last_activity_date":"2016-10-03 15:01:21.427 UTC","last_edit_date":"2016-10-02 12:18:25.577 UTC","last_editor_display_name":"","last_editor_user_id":"6030009","owner_display_name":"","owner_user_id":"6030009","post_type_id":"1","score":"0","tags":"jquery|html|css|twitter-bootstrap","view_count":"34"} +{"id":"18306964","title":"Jquery Autocomplete Search Box","body":"\u003cp\u003eI have an autocomplete JS script for search side of my website but I think something is missing;\u003c/p\u003e\n\n\u003cp\u003eOur alphabet has Ç, Ş, Ö, Ğ, Ü and İ letters, also auto-complete script can work with this letters but there is a problem. For example; I have 2 datas like *\u003cem\u003eÇi\u003c/em\u003e*çeksepeti and *\u003cem\u003eCi\u003c/em\u003e*dera and I wrote \"Çi\" on search input, system should just show me \"Çiçeksepeti\" but it shows \"Cicera\" too. I think it is not recognizing difference between Ç and C (Also it happens Ş and S, I and İ, U and Ü, O and Ö - shortly with all letters with dots)\u003c/p\u003e\n\n\u003cp\u003eYou can find my autocomplete.js file \u003ca href=\"http://birlikbilisim.net/jquery.autocomplete.js\" rel=\"nofollow\"\u003ehere\u003c/a\u003e; (Autocomplete - jQuery plugin 1.0.2)\u003c/p\u003e\n\n\u003cp\u003eThanks everyone for help!\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2013-08-19 05:35:51.303 UTC","last_activity_date":"2013-08-19 06:07:49.887 UTC","last_edit_date":"2013-08-19 06:02:08.02 UTC","last_editor_display_name":"","last_editor_user_id":"1933917","owner_display_name":"","owner_user_id":"1779448","post_type_id":"1","score":"1","tags":"jquery|search|autocomplete|jquery-autocomplete|jquery-ui-autocomplete","view_count":"633"} +{"id":"6950102","title":"Can't get decimals to display in text field for Rails 3","body":"\u003cp\u003eI have a brief question... pretty new to rails, and I was wondering if you could help me with an issue that I'm having in code. I have a set of input boxes (it's an online app that asks for revenues and expenses) where I would like to format the currency. I've been using the following line of code for other independent input boxes (text_fields) within the app, but for some reason, it wont work when i try to add it to the income statement fields\u003c/p\u003e\n\n\u003cp\u003ecode I have been using:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e= f.text_field :user_nummber, :value=\u0026gt;number_to_currency(f.object.user_number)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethe area of code i've been having issues with:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e = f.fields_for :income_statements do |ff|\n .section_total.income_statement{ :id =\u0026gt; \"income_statement_#{ff.object.year}\" }\n = ff.hidden_field :id\n = ff.hidden_field :year\n %h3.financials_year= ff.object.year\n\n .financials_data\n .section\n %h2.green_text Revenue\n %div{:class =\u0026gt; \"label_rightalign_investor field\"}\n = ff.label :net_sales\n = ff.text_field :net_sales, :value=\u0026gt;number_to_currency(ff.object.net_sales), :class =\u0026gt; 'add'\n %div{:class =\u0026gt; \"label_rightalign_investor field\"}\n = ff.label :interest_income\n = ff.text_field :interest_income, :value=\u0026gt;number_to_currency(ff.object.interest_income), :class =\u0026gt; 'add'\n %div{:class =\u0026gt; \"label_rightalign_investor field\", :style =\u0026gt; 'font-weight: bold' }\n = label_tag 'Total'\n = text_field_tag 'total_revenue', '', :class =\u0026gt; 'calculate add_total', :readonly =\u0026gt; true\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ePlease note that the final total_revenue field calculates the values with class:add (net sales \u0026amp; interest income)\u003c/p\u003e\n\n\u003cp\u003eAny help in what i'm doing wrong, and why my text_fields (input box) does not display values in the following format: $x,xxx.00 would be appreciated. \u003c/p\u003e\n\n\u003cp\u003eI sincerely thank you for your help and time! \u003c/p\u003e","answer_count":"1","comment_count":"5","creation_date":"2011-08-05 00:17:10.873 UTC","last_activity_date":"2011-08-05 05:59:46.76 UTC","last_edit_date":"2011-08-05 00:46:39.41 UTC","last_editor_display_name":"","last_editor_user_id":"707287","owner_display_name":"","owner_user_id":"707287","post_type_id":"1","score":"0","tags":"ruby-on-rails-3|textbox|currency|bigdecimal|number-to-currency","view_count":"2170"} +{"id":"41991085","title":"SQLConnection:System.NullReferenceException: Object reference not set to an instance of an object","body":"\u003cp\u003eI am trying to pass the SSIS connection string into a variable and then trying to read this connection .How ever, I am getting below mentioned error.\nSystem.NullReferenceException: Object reference not set to an instance of an object.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eDts.Variables[\"User::_Connvariable\"]:Data Source=00.000.0.00;User ID=aaaaaa;password=PASSWORD;Initial Catalog=test;Provider=SQL0000.1;Auto Translate=False\n\nstring acconnectionString = Dts.Variables[\"User::_Connvariable\"].Value.ToString();\n SqlConnection connection1 = new SqlConnection(acconnectionString);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eacconnectionString is assigned to correct value and i am reading it fine. But when I pass this to Sqlconnection, it throws above error. Can this be a access(connection)issues?\nI can access this database from Management studio.\nAny help is appreciated!\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2017-02-01 22:33:50.13 UTC","last_activity_date":"2017-02-01 22:33:50.13 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5304058","post_type_id":"1","score":"0","tags":"c#|visual-studio|ssis","view_count":"17"} +{"id":"6988656","title":"Configure Server Setting Issue in Flex 4.5","body":"\u003cp\u003eI am trying to Configure Server side Code in Flash Builder 4.5.I am Using LCDS 2.6.1.By clicking on validate configuration button I got message on top Only Life Cycle DataService 2.6 and higher are supported.I am using 2.6.1.still not able to figure out the issue.Please help.\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2011-08-08 21:11:49.26 UTC","last_activity_date":"2011-12-02 14:14:10.207 UTC","last_edit_date":"2011-09-30 12:23:48.84 UTC","last_editor_display_name":"","last_editor_user_id":"61679","owner_display_name":"","owner_user_id":"713872","post_type_id":"1","score":"0","tags":"flex|flex4.5|lcds","view_count":"156"} +{"id":"44905064","title":"UIBezierPath rounded corners in UIButton","body":"\u003cp\u003eI want to draw a tappable bubble shape around text. In order to do that I decided to add a shapelayer to UIButton like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e// Button also has this\nbubbleButton.contentEdgeInsets = UIEdgeInsets(top: 5, left: 10, bottom: 5, right: 10)\nbubbleButton.setTitle(\"Gutp\", for: .normal)\n\n// In my subclass of UIButton\noverride func layoutSubviews() {\n super.layoutSubviews()\n\n self.bubbleLayer?.removeFromSuperlayer()\n\n let maskLayer = CAShapeLayer.init()\n let bezierPath = UIBezierPath.init(roundedRect: self.bounds,\n byRoundingCorners: [.topRight, .topLeft, .bottomLeft],\n cornerRadii: CGSize(width: 20, height: 20))\n maskLayer.path = bezierPath.cgPath\n maskLayer.strokeColor = UIColor.red.cgColor\n maskLayer.lineWidth = 2\n maskLayer.fillColor = UIColor.clear.cgColor\n maskLayer.backgroundColor = UIColor.clear.cgColor\n maskLayer.isOpaque = false\n\n self.bubbleLayer = maskLayer\n\n if let layers = self.layer.sublayers {\n self.layer.insertSublayer(self.bubbleLayer!, at: UInt32(layers.count))\n } else {\n self.layer.addSublayer(self.bubbleLayer!)\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ePlease don't look at the performance at the moment. \u003c/p\u003e\n\n\u003cp\u003eI have 2 buttons like this added into a UIStackView.\u003c/p\u003e\n\n\u003cp\u003eI get an interesting artefact (a tail if one can say so) in some cases of text (usually when it is short) and a normal bubble in case of longer text:\u003ca href=\"https://i.stack.imgur.com/YCI6S.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/YCI6S.png\" alt=\"bezierpath-artefact\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eHow can I fix this? And why do I get such behavior?\u003c/p\u003e\n\n\u003cp\u003eEDIT: Linking other possibly related questions about broken cornerRadii parameter in bezierPathWithRoundedRect:byRoundingCorners:cornerRadii:. Maybe it will help someone with similar issues.\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003e\u003cp\u003e\u003ca href=\"https://stackoverflow.com/questions/18880919/why-is-cornerradii-parameter-of-cgsize-type-in-uibezierpath-bezierpathwithroun\"\u003eWhy is cornerRadii parameter of CGSize type in -[UIBezierPath bezierPathWithRoundedRect:byRoundingCorners:cornerRadii:]?\u003c/a\u003e\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003e\u003ca href=\"https://stackoverflow.com/questions/24936003/crazy-rounded-rect-uibezierpath-behavior-on-ios-7-what-is-the-deal\"\u003eCrazy rounded rect UIBezierPath behavior on iOS 7. What is the deal?\u003c/a\u003e\u003c/p\u003e\u003c/li\u003e\n\u003c/ol\u003e","accepted_answer_id":"44906270","answer_count":"1","comment_count":"2","creation_date":"2017-07-04 11:42:30 UTC","last_activity_date":"2017-07-04 12:52:53.607 UTC","last_edit_date":"2017-07-04 12:52:53.607 UTC","last_editor_display_name":"","last_editor_user_id":"8187134","owner_display_name":"","owner_user_id":"8187134","post_type_id":"1","score":"0","tags":"ios|swift|uibutton|uibezierpath","view_count":"132"} +{"id":"33328320","title":"Session data in SignalR: Where to store them?","body":"\u003cp\u003eLet's assume that I have a game which uses SignalR to share information between clients. In my Hub class I have a method called \"joinGame()\" which is called when some client wants to join. I need to add his ID to some array, to know that he has already joined the game. It doesn't need to be in database, because I need this information only during this session.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class GameHub : Hub\n{\n public List\u0026lt;int\u0026gt; Players = new List\u0026lt;int\u0026gt;();\n\n public void joinGame(int id) //player updates his position\n {\n Clients.All.newPlayer(id);\n Players.Add(id);\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis code won't work, because \"Players\" variable seems to be cleared every time I call \"joinGame()\" function.\u003c/p\u003e\n\n\u003cp\u003eHow can I do it properly?\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2015-10-25 09:49:54.937 UTC","last_activity_date":"2015-10-25 12:03:34.253 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1804027","post_type_id":"1","score":"0","tags":"c#|signalr|signalr-hub","view_count":"416"} +{"id":"40562138","title":"What is reason behind segmentation fault in this program?","body":"\u003cp\u003eI created a simple program to understand the behavior of pointers. I tried this program to understand the behavior of pointers, but it produces a segmentation fault.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include\u0026lt;stdio.h\u0026gt;\n\nint main()\n{\n int x =9;\n\n /* what is meaning of this line when \u0026amp; operator is not used*/\n int *pts = x;\n\n printf(\"%d\",*pts);\n return 0;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhy does the segmentation fault occur? I tried to know behavior of the program.\u003c/p\u003e","answer_count":"4","comment_count":"4","creation_date":"2016-11-12 10:59:46.27 UTC","favorite_count":"1","last_activity_date":"2016-11-12 11:34:27.72 UTC","last_edit_date":"2016-11-12 11:08:07.06 UTC","last_editor_display_name":"","last_editor_user_id":"52724","owner_display_name":"","owner_user_id":"7149467","post_type_id":"1","score":"-3","tags":"c++|c","view_count":"65"} +{"id":"3555193","title":"How to set a value to a javax.xml.ws.Holder?","body":"\u003cp\u003ewe are currently having problems with a JAX-WS implementation, particulary in getting a value returned by the service, which in our case is always null, although we give it a value.\u003c/p\u003e\n\n\u003cp\u003eSome code before more explanations of our problem :\u003c/p\u003e\n\n\u003cp\u003eHere is the signature of our operation :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@WebMethod(action = \"urn:genererEdition\")\npublic void genererEdition(\n @WebParam(name = \"requeteEdition\", targetNamespace = \"http://creditcgi.com/serviceeditique\", partName = \"requete\")\n RequeteEdition requete,\n @WebParam(name = \"reponseEdition\", targetNamespace = \"http://creditcgi.com/serviceeditique\", mode = WebParam.Mode.OUT, partName = \"reponse\")\n Holder\u0026lt;ReponseEdition\u0026gt; reponse,\n @WebParam(name = \"documentProduit\", targetNamespace = \"\", mode = WebParam.Mode.OUT, partName = \"documentProduit\")\n Holder\u0026lt;byte[]\u0026gt; documentProduit);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is our web service test case :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@Test\npublic void testCallGenererEdition() {\n RequeteEdition requete = new RequeteEdition();\n\n Holder\u0026lt;ReponseEdition\u0026gt; reponseHolder = new Holder\u0026lt;ReponseEdition\u0026gt;(new ReponseEdition());\n Holder\u0026lt;byte[]\u0026gt; documentHolder = new Holder\u0026lt;byte[]\u0026gt;(new byte[512]);\n\n editique.genererEdition(requete, reponseHolder, documentHolder);\n\n Assert.assertNotNull(reponseHolder.value);\n Assert.assertNotNull(reponseHolder.value.getCodeRetour());\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd finally, our WS implementation :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@Override\npublic void genererEdition(RequeteEdition requete,\n Holder\u0026lt;ReponseEdition\u0026gt; reponse, Holder\u0026lt;byte[]\u0026gt; documentProduit) {\n\n // if we do no instanciate ReponseEdition, we got a Null Pointer Exception\n reponse.value = new ReponseEdition();\n\n reponse.value.setCodeRetour(\"OK\");\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAs you can see with the test, we are always getting null. What do we do wrong for always having a null object returned in the reponse Holder ?\u003c/p\u003e\n\n\u003cp\u003eThank you in advance.\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2010-08-24 09:39:17.707 UTC","last_activity_date":"2012-10-14 01:38:50.713 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"108662","post_type_id":"1","score":"2","tags":"java|web-services|jax-ws","view_count":"15948"} +{"id":"34641305","title":"Is it possible to force JVM to check that every jar must be signed?","body":"\u003cp\u003eIs it possible to force JVM to check that every JAR that is been loaded on the classloader is signed?\u003c/p\u003e\n\n\u003cp\u003eThe behavior that I expect is that: if the signature is wrong or jar file is not signed, the JVM crashes, otherwise the program runs smoothly.\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2016-01-06 19:34:31.7 UTC","favorite_count":"1","last_activity_date":"2016-07-20 04:39:49.117 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1501876","post_type_id":"1","score":"2","tags":"java|security|jar|jvm|java-security","view_count":"379"} +{"id":"14133417","title":"How to stop scrolling of AChartEngine dynamic line graph along the y-axis?","body":"\u003cp\u003eI have set min max range for y-axis values but graph can scroll beyond those values which hampers the look and feel of graph. I wish to control/stop scrolling of graph along the y-axis. How can I do that?\u003c/p\u003e","accepted_answer_id":"14134114","answer_count":"3","comment_count":"5","creation_date":"2013-01-03 05:14:24.263 UTC","last_activity_date":"2014-07-16 14:39:54.19 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1685728","post_type_id":"1","score":"4","tags":"android|graph|charts|plot|achartengine","view_count":"3728"} +{"id":"24935676","title":"Writing xlsx with Apache SXSSF, can't read with XSSF","body":"\u003cp\u003eI have an application (Java) that takes in an xlsx file from an outside source, reads it with XSSF, and then spits out certain rows of that file based on some criteria and writes those rows to a new file generated via SXSSF. Those new files that are generated also get sent through the application to be read. The problem I'm having is that the XSSF parser is not seeing the contents of the new spreadsheets that are generated via SXSSF. If I open the file it looks fine - the data is there, and if I simply save it and then run it through the process again, XSSF will read it. I'm guessing maybe there's some type of file property that SXSSF isn't setting when it writes the file, which would prevent the parser from reading the spreadsheet? Any idea what could be causing this?\u003c/p\u003e\n\n\u003cp\u003eHere's the code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate SXSSFWorkbook wb = new SXSSFWorkbook(); \n\npublic void writeFile(String outputFile, ArrayList\u0026lt;List\u0026lt;? extends Object\u0026gt;\u0026gt; rows) throws IOException {\n Sheet sh = wb.createSheet(\"Sheet1\");\n int numRows = rows.size();\n for (int i = 0; i \u0026lt;= numRows; i++) {\n Row row = sh.createRow(i);\n for (int cellNum = 0; cellNum \u0026lt;= rows.get(i).size(); cellNum++) {\n Cell cell = row.createCell(cellNum);\n if (rows.get(i).get(cellNum) == null) {\n cell.setCellValue(\"\");\n } else {\n cell.setCellValue(rows.get(i).get(cellNum).toString());\n }\n }\n }\n FileOutputStream out = null;\n try {\n out = new FileOutputStream(outputFile);\n wb.write(out);\n wb.dispose();\n } catch (IOException e) {\n throw e;\n } finally {\n try {\n out.close();\n } catch (IOException e) {\n throw e;\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"4","creation_date":"2014-07-24 13:52:40.67 UTC","last_activity_date":"2014-07-24 14:16:39.973 UTC","last_edit_date":"2014-07-24 14:16:39.973 UTC","last_editor_display_name":"","last_editor_user_id":"2846941","owner_display_name":"","owner_user_id":"2846941","post_type_id":"1","score":"0","tags":"java|excel","view_count":"324"} +{"id":"34144418","title":"What is a SQL Query to return count of rows per attribute in a date range?","body":"\u003cp\u003eI have a table named \u003ccode\u003ePDA_COLLECTOR_SCCS\u003c/code\u003e in an Access database where I would like to query the number of rows per \u003ccode\u003eDistrict\u003c/code\u003e per \u003ccode\u003ePickupDate\u003c/code\u003e. \u003ccode\u003eDistrict\u003c/code\u003e is a string indicating the district of the client and the \u003ccode\u003ePickupDate\u003c/code\u003e is when the service order was completed. \u003ccode\u003ePickupDate\u003c/code\u003e is in \u003ccode\u003emm/d/yyyy\u003c/code\u003eformat. Starting with \u003ccode\u003e10/1/2007\u003c/code\u003e to \u003ccode\u003etoday\u003c/code\u003e. \u003c/p\u003e\n\n\u003cp\u003eFor instance, each month for each district should have an integer output, i.e. \u003ccode\u003eDistrictName, EV\u003c/code\u003e , \u003ccode\u003eDate Range 10/1/2007 - 10/31/2007\u003c/code\u003e, \u003ccode\u003eRowCount, 564\u003c/code\u003e \u003c/p\u003e\n\n\u003cp\u003eEDIT:\nIt is SQL Server 2008\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eSELECT District, Convert(date, PickupDate) As PickUpMonth, Count(*) As Row_Count\nFROM dbo.V_PickupAllColumns\nGROUP BY District, Convert(date, PickupDate)\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/Ow9zP.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/Ow9zP.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThis query returns the number of rows per day per district, how would I change this to return the number rows per month-to-month range, i.e. 10/1/2007-10/31/2007\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-12-07 22:22:40.893 UTC","last_activity_date":"2015-12-08 01:07:18.107 UTC","last_edit_date":"2015-12-07 23:18:17.57 UTC","last_editor_display_name":"","last_editor_user_id":"4913956","owner_display_name":"","owner_user_id":"4913956","post_type_id":"1","score":"0","tags":"sql-server|ms-access","view_count":"60"} +{"id":"26504755","title":"how to create a general pointer which can deal with int and double variables and avoid scoping issues?","body":"\u003cp\u003eI have some C code where I need to do some calculations with an array of data. The data can be either INT or DOUBLE. In order to deal with the different data types, I was thinking of using an \u003ccode\u003eif / else\u003c/code\u003e statement and define the pointer holding the data inside that statement:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e/* put values into M, depending on data type*/\nif (data_type == 2)\n{\n double *M; \n M = somefunction(DOUBLE);\n} else {\n unsigned int *M;\n M = somefunction(UINT16);\n}\n\n/* dummy code - usually I do some calculations on M which are data type independent */\nfor (i=0;i\u0026lt;(10);i++) {\n M[i]=0;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis leads to scoping problems because \u003ccode\u003eM\u003c/code\u003e is not defined outside the \u003ccode\u003eif / else\u003c/code\u003e construct:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e error: ‘M’ undeclared (first use in this function)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf I move the definition of \u003ccode\u003eM\u003c/code\u003e outside the \u003ccode\u003eif / else\u003c/code\u003e statement, the code will compile but \u003ccode\u003eM\u003c/code\u003e inside the \u003ccode\u003eif / else\u003c/code\u003e is a different \u003ccode\u003eM\u003c/code\u003e outside. \u003c/p\u003e\n\n\u003cp\u003eSo I can circumvent the problem by defining two pointers, one double and one int and check everywhere in my code which type I'm dealing with:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edouble *Mdouble; \nunsigned int *Mint;\n/* put values into M, depending on data type*/\nif (data_type == 2)\n{\n Mdouble = somefunction(DOUBLE);\n} else {\n Mint = somefunction(UINT16);\n}\n\n/* dummy code - usually I do some calculations on M which are data type independent */\nfor (i=0;i\u0026lt;(10);i++) {\n if (data_type == 2) {\n Mdouble[i]=0;\n } else {\n Mint[i]=0;\n } \n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo here's my question:\u003c/p\u003e\n\n\u003cp\u003eHow can I solve this problem where \u003ccode\u003eM\u003c/code\u003e is a double or int, depending on my incoming data? Could I solve this with some kind of pointer to a pointer work around? I don't want to write duplicate code for each case.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT\u003c/strong\u003e could \u003cstrong\u003etemplate functions\u003c/strong\u003e or \u003cstrong\u003eoverloading of functions\u003c/strong\u003e solve my problem? I'm flexible regarding a C / C++ specific solution\u003c/p\u003e","answer_count":"5","comment_count":"12","creation_date":"2014-10-22 09:50:58.397 UTC","last_activity_date":"2014-10-22 13:44:00.107 UTC","last_edit_date":"2014-10-22 10:48:13.51 UTC","last_editor_display_name":"","last_editor_user_id":"561766","owner_display_name":"","owner_user_id":"561766","post_type_id":"1","score":"0","tags":"c++|c|pointers","view_count":"122"} +{"id":"4057507","title":"App crashing when trying to create a TBXML object with this xml","body":"\u003cp\u003eI am trying to parse following xml using tbxml library - \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" encoding=\"UTF-8\"?\u0026gt;\n\u0026lt;REPLY replyCode=\"Success\" \u0026gt;\n\u0026lt;TRACK track_id=\"1302234\" track_mp3=\"74-Ruff_Ryders_feat_Sheek_Louch_and_Big_Pun_-_Piña_Colada.mp3\"\u0026gt;\u0026lt;/TRACK\u0026gt;\n\u0026lt;/REPLY\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut when I tried to create TBXML object the app is crashing I think this is because of some special chars in xml file (Piña).\u003c/p\u003e\n\n\u003cp\u003eAny idea on this?\u003c/p\u003e","accepted_answer_id":"4058544","answer_count":"1","comment_count":"0","creation_date":"2010-10-30 06:16:49.72 UTC","last_activity_date":"2010-10-30 11:47:13.237 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"303073","post_type_id":"1","score":"0","tags":"iphone","view_count":"160"} +{"id":"43881080","title":"How can I finish this JavaScript RockPaperScissors made with radiobuttons and a function? (Not homework)","body":"\u003cp\u003eI'm honestly curious because I'm able to make the RockPaperScissors game in javascript through prompts and numbers... but I now wanted to know how to do it with radiobuttons and using a function. Here's what I have so far but not sure where to begin with the logic.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eJavaScript\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction RPSGame()\n{\ncomp = Math.floor(Math.random()*3+1);\nif (RPS.radiobutton[0].checked == true) \u0026amp;\u0026amp; (comp === RPS.radiobutton[0])\n document.RPS.result.value = (\"A Tie!\");\n\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI assume I'll be using an IF ELSE nested loop like I have in just javascript prompts, but I'm not so adept in functions.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eHTML\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;form name = \"RPS\"\u0026gt;\n\u0026lt;p\u0026gt;Rock Paper Scissors \u0026lt;br\u0026gt;\n\u0026lt;input type = \"radio\" name=\"radiobutton\" value =\"1\"/\u0026gt;Rock \u0026lt;br\u0026gt;\n\u0026lt;input type = \"radio\" name=\"radiobutton\" value =\"2\"/\u0026gt;Paper \u0026lt;br\u0026gt;\n\u0026lt;input type = \"radio\" name=\"radiobutton\" value =\"3\"/\u0026gt;Scissors \u0026lt;br\u0026gt;\n\n\u0026lt;br\u0026gt;\n\u0026lt;input type = \"button\" name=\"Play\" value=\"Play\" onclick=\"RPSGame(RPS)\"/\u0026gt;\u0026lt;br\u0026gt; \u0026lt;br\u0026gt;\n\u0026lt;input type=\"button\" onclick=\"clearDoc();\" value=\"Clear\" /\u0026gt;\n\u0026lt;input type = \"text\" name =\"result\" size = \"8\"\u0026gt;\n\u0026lt;/p\u0026gt;\n\u0026lt;/form\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAgain this is not homework, I understand this is probably more of a tutorial-esque question. Thanks for any help.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-05-09 22:56:29.647 UTC","last_activity_date":"2017-05-10 00:55:42.673 UTC","last_edit_date":"2017-05-09 23:02:00.57 UTC","last_editor_display_name":"","last_editor_user_id":"7941951","owner_display_name":"","owner_user_id":"7941951","post_type_id":"1","score":"0","tags":"javascript|html|function|logic","view_count":"19"} +{"id":"15118380","title":"Image not changing in android app","body":"\u003cp\u003eI'm trying to change an image resource with .setImageResource(identifier) but it is not showing up when i'm using the variables i'm using right now. It will work when i fill in the name of the image by myself.\u003c/p\u003e\n\n\u003cp\u003eHere is the Index.java file:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e package com.example.whs;\n\nimport java.util.ArrayList;\nimport java.util.HashMap;\n\nimport android.app.Activity;\nimport android.content.Intent;\nimport android.os.Bundle;\nimport android.view.Menu;\nimport android.view.View;\nimport android.widget.AdapterView;\nimport android.widget.AdapterView.OnItemClickListener;\nimport android.widget.ListView;\n\npublic class Index extends Activity {\n\n public static final Object TITLE = \"title\";\n public static final Object SUBTITLE = \"subtitle\";\n public static final Object THUMBNAIL = \"thumbnail\";\n protected static final String POSITION = null;\n\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_index);\n\n buildMenu();\n }\n\n @Override\n public boolean onCreateOptionsMenu(Menu menu) {\n // Inflate the menu; this adds items to the action bar if it is present.\n getMenuInflater().inflate(R.menu.index, menu);\n return true;\n }\n\n //Builds the menu for listview\n public void buildMenu(){\n ArrayList\u0026lt;HashMap\u0026lt;String, String\u0026gt;\u0026gt; menu = new ArrayList\u0026lt;HashMap\u0026lt;String, String\u0026gt;\u0026gt;();\n //Arrays for info\n String[] menuTitleArray = {\"Updates\", \"Gallerij\"}; \n String[] menuSubtitleArray = {\"Bekijk updates\", \"Bekijk foto's en geef reacties\", \"Bekijk de updates\"};\n String[] menuThumbnailArray = {\"updates\", \"gallery\"};\n for(int i=0; i \u0026lt; menuTitleArray.length; i++){\n // Build Hashmap for the item\n HashMap\u0026lt;String, String\u0026gt; item = new HashMap\u0026lt;String, String\u0026gt;();\n item.put((String) TITLE, menuTitleArray[i]);\n item.put((String) SUBTITLE, menuSubtitleArray[i]);\n item.put((String) THUMBNAIL, menuThumbnailArray[i]);\n menu.add(item);\n }\n\n\n // Add adapter to the list\n MenuAdapter adapter = new MenuAdapter(this, menu);\n ListView list = (ListView)findViewById(R.id.list);\n list.setAdapter(adapter);\n\n\n\n // Initialize the click event\n list.setOnItemClickListener(new OnItemClickListener(){\n @Override\n public void onItemClick(AdapterView\u0026lt;?\u0026gt; parent, View view, int position, long id){\n switch(position){\n case 0:\n Intent intent = new Intent(Index.this, Updates.class);\n startActivity(intent);\n }\n }\n });\n\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ehere is the MenuAdapter.java file:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epackage com.example.whs;\n\nimport java.util.ArrayList;\nimport java.util.HashMap;\n\nimport android.app.Activity;\nimport android.graphics.drawable.Drawable;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.BaseAdapter;\nimport android.widget.ImageView;\nimport android.widget.TextView;\n\npublic class MenuAdapter extends BaseAdapter{\n // Define variables\n ArrayList\u0026lt;HashMap\u0026lt;String, String\u0026gt;\u0026gt; data;\n Activity activity;\n private LayoutInflater inflater=null;\n\n public MenuAdapter(Activity a, ArrayList\u0026lt;HashMap\u0026lt;String, String\u0026gt;\u0026gt; d) {\n activity = a;\n data = d;\n inflater = LayoutInflater.from (a);\n }\n\n @Override\n public int getCount() {\n return data.size();\n }\n\n @Override\n public Object getItem(int position) {\n // TODO Auto-generated method stub\n return position;\n }\n\n @Override\n public long getItemId(int position) {\n // TODO Auto-generated method stub\n return position;\n }\n\n @Override\n public View getView(int position, View convertView, ViewGroup parent) {\n View vi=convertView;\n if(convertView==null)\n vi = inflater.inflate(R.layout.list_row, null); \n vi.setBackgroundResource(activity.getResources().getIdentifier(\"list_selector\", \"drawable\", Index.class.getPackage().getName()));\n // Focus on the parts that have to be changed\n TextView title = (TextView)vi.findViewById(R.id.title); // title\n TextView subtitle = (TextView)vi.findViewById(R.id.subtitle); // subtitle\n ImageView thumb_image=(ImageView)vi.findViewById(R.id.list_image); // thumb image\n\n // Get the info from the hashmap with the arraylist position\n HashMap\u0026lt;String, String\u0026gt; item = new HashMap\u0026lt;String, String\u0026gt;();\n item = data.get(position);\n String name = (String) Index.THUMBNAIL;\n // Look for the image\n int identifier = activity.getResources().getIdentifier(name, \"drawable\", Index.class.getPackage().getName());\n\n // Setting all values in listview\n title.setText(item.get(Index.TITLE));\n subtitle.setText(item.get(Index.SUBTITLE));\n thumb_image.setImageResource(identifier);\n return vi;\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs there a way how to fix this?\u003c/p\u003e","accepted_answer_id":"15118889","answer_count":"1","comment_count":"5","creation_date":"2013-02-27 17:27:47.273 UTC","last_activity_date":"2013-02-27 17:53:08.607 UTC","last_edit_date":"2013-02-27 17:36:27.7 UTC","last_editor_display_name":"user2108957","owner_display_name":"user2108957","post_type_id":"1","score":"1","tags":"android|image|adapter","view_count":"209"} +{"id":"7767622","title":"Debugging amf remote calls (from flex 4) in PHP Eclipse","body":"\u003cp\u003eI have installed and setup xdebug to debug php application. However I was wonder is it possible to debug the remote calls? I am using amfphp, I want to put break points and debug the code when the flex application calls the service. Is it possible? how to do it? Or Is there any way to simulate remote call called from flex 4 withing eclipse?\u003c/p\u003e\n\n\u003cp\u003eThanks in Advance\u003c/p\u003e\n\n\u003cp\u003e[edit]\nI have used xdebug pugin for firefox and chrome extension but both seems not working after I have installed them. Basically there is no hint/clue/document explaining how to use them, sadly. Can any one help?\u003c/p\u003e","accepted_answer_id":"7776365","answer_count":"1","comment_count":"0","creation_date":"2011-10-14 12:32:03.903 UTC","last_activity_date":"2011-10-15 07:05:28.043 UTC","last_edit_date":"2011-10-15 06:56:45.377 UTC","last_editor_display_name":"","last_editor_user_id":"310967","owner_display_name":"","owner_user_id":"310967","post_type_id":"1","score":"0","tags":"eclipse|flex4|xdebug|amfphp","view_count":"592"} +{"id":"27654990","title":"how to get folder name in this","body":"\u003cp\u003ehello every ine in this i get file name and i crate hyperlink on it but foldername is missing to further action my code is \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;script type=\"text/javascript\"\u0026gt;\n$(document).ready(function(){\nvar files=\u0026lt;?php echo json_encode($files);?\u0026gt;;\nvar file_tree=build_file_tree(files);\nfile_tree.appendTo('#files');\n\nfunction build_file_tree(files){\n var tree=$('\u0026lt;ul\u0026gt;');\n for(x in files){\n\n if(typeof files[x]==\"object\"){\n var span=$('\u0026lt;span\u0026gt;').html(x).appendTo(\n $('\u0026lt;li\u0026gt;').appendTo(tree).addClass('folder')\n );\n\n var subtree=build_file_tree(files[x]).hide();\n span.after(subtree);\n span.click(function(){\n\n $(this).parent().find('ul:first').toggle();\n });\n\n }else{\n $('\u0026lt;li\u0026gt;').html('\u0026lt;a href=\"/admin/appearance/?theme='+tree+'\u0026amp;file='+files[x]+'\"\u0026gt;'+files[x]+'\u0026lt;/a\u0026gt;').appendTo(tree).addClass('file');\n }\n }\n\n return tree;\n\n}\n\n} );\n\n\u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ei want folder name after theme=\u003c/p\u003e","answer_count":"1","comment_count":"4","creation_date":"2014-12-26 09:02:13.577 UTC","last_activity_date":"2014-12-26 10:06:16.65 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4226258","post_type_id":"1","score":"0","tags":"php|jquery","view_count":"64"} +{"id":"30842530","title":"MultiMatch query with Nest and Field Suffix","body":"\u003cp\u003eUsing Elasticsearch I have a field with a suffix - string field with a .english suffix with an english analyser on it as shown in the following mapping\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e...\n\"valueString\": {\n \"type\": \"string\",\n \"fields\": {\n \"english\": {\n \"type\": \"string\",\n \"analyzer\": \"english\"\n }\n }\n}\n...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe following query snippet won't compile because \u003ccode\u003eValueString\u003c/code\u003e has no \u003ccode\u003eEnglish\u003c/code\u003e property.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e...\nsh =\u0026gt; sh\n .Nested(n =\u0026gt; n\n .Path(p =\u0026gt; p.ScreenData)\n .Query(nq =\u0026gt; nq\n .MultiMatch(mm =\u0026gt; mm\n .Query(searchPhrase)\n .OnFields(\n f =\u0026gt; f.ScreenData.First().ValueString,\n f =\u0026gt; f.ScreenData.First().ValueString.english)\n .Type(TextQueryType.BestFields)\n )\n )\n )...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs there a way to strongly type the suffix at query time in NEST or do I have to use magic strings?\u003c/p\u003e","accepted_answer_id":"30843154","answer_count":"1","comment_count":"0","creation_date":"2015-06-15 10:11:22.09 UTC","last_activity_date":"2015-06-15 10:43:10.693 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"565804","post_type_id":"1","score":"1","tags":"c#|elasticsearch|nest","view_count":"1188"} +{"id":"40569198","title":"How to store database into struct using swift3?","body":"\u003cp\u003eI have a function to get the database and return it in MutableArray, now I need the database to be in a struct.\u003c/p\u003e\n\n\u003cp\u003eDo I need to get the MutableArray into struct or should I get the data straight into the struct?\u003c/p\u003e\n\n\u003cp\u003eI have no idea how to approach this or how to store the database into struct \u003c/p\u003e\n\n\u003cp\u003eMy code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass CrimesInfo: NSObject {\n\nvar name: String = String()\nvar detail: String = String()\nvar time: String = String()\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe function:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunc getAllCrimesData() -\u0026gt; NSMutableArray {\n sharedInstance.database!.open()\n let resultSet: FMResultSet! = sharedInstance.database!.executeQuery(\"SELECT * FROM CrimeTable\", withArgumentsIn: nil)\n let marrCrimesInfo : NSMutableArray = NSMutableArray()\n if (resultSet != nil) {\n while resultSet.next() {\n let crimesInfo : CrimesInfo = CrimesInfo()\n crimesInfo.name = resultSet.string(forColumn: \"Name\")\n crimesInfo.detail = resultSet.string(forColumn: \"Detail\")\n crimesInfo.time = resultSet.string(forColumn: \"Time\")\n marrCrimesInfo.add(crimesInfo)\n }\n }\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"40569688","answer_count":"1","comment_count":"0","creation_date":"2016-11-13 00:20:57.203 UTC","last_activity_date":"2016-11-13 01:51:07.483 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6705849","post_type_id":"1","score":"0","tags":"ios|swift3","view_count":"170"} +{"id":"38263373","title":"To_Date, To_Char in oracle","body":"\u003cp\u003eMy Query for on oracle DB is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT NBR, START_TIME,END_TIME, BYTES_DATA\nFROM TABLE_NAME Partition (P201607)\nWHERE BYTES_DATA \u0026lt;\u0026gt; 0 AND NBR LIKE '%29320319%'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand results in:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eNBR START_TIME END_TIME BYTES_DATA \n1029320319 2016-07-01 00:15:51 2016-07-01 00:22:44 158014048\n1029320319 2016-07-01 00:22:51 2016-07-01 01:22:51 616324863 \n1029320319 2016-07-01 01:22:51 2016-07-01 01:55:15 431354240 \n1029320319 2016-07-01 01:55:22 2016-07-01 02:53:45 1040869155 \n1029320319 2016-07-01 02:53:52 2016-07-01 03:53:52 40615861 \n1029320319 2016-07-04 07:22:05 2016-07-04 07:22:05 4911\n1029320319 2016-07-05 06:42:56 2016-07-05 07:42:56 58271774\n1029320319 2016-07-05 07:42:56 2016-07-05 07:42:56 173\n1029320319 2016-07-08 07:47:01 2016-07-08 07:47:01 105995\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut I would like to filter these output based on Time. How can I get all records during this month(07) or last 7 days where the start_time and end_time is between 06:30:00 and 07:59:59? \u003c/p\u003e","accepted_answer_id":"38284821","answer_count":"1","comment_count":"0","creation_date":"2016-07-08 09:34:30.6 UTC","last_activity_date":"2016-07-09 18:10:40.19 UTC","last_edit_date":"2016-07-08 09:38:09.347 UTC","last_editor_display_name":"","last_editor_user_id":"164909","owner_display_name":"","owner_user_id":"6509716","post_type_id":"1","score":"0","tags":"oracle-sqldeveloper","view_count":"91"} +{"id":"38844041","title":"Web scrape password protected website but there are errors","body":"\u003cp\u003eI am trying to scrape data from the member directory of a website (\"members.dublinchamber.ie\"). I have tried using the 'rvest' but I got the data from the login page even after entering the login details. The code is as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elibrary(rvest)\nurl \u0026lt;- \"members.dublinchamber.ie/login.aspx\"\npgsession \u0026lt;- html_session(url) \npgform \u0026lt;- html_form(pgsession)[[2]]\nfilled_form \u0026lt;- set_values(pgform,\n \"Username\" = \"username\",\n \"Password\" = \"password\")\nsubmit_form(pgsession, filled_form)\nmemberlist \u0026lt;- jump_to(pgsession,'members.dublinchamber.ie/directory/profile.aspx?compid=50333')\npage \u0026lt;- read_html(memberlist)\nusernames \u0026lt;- html_nodes(x = page, css = 'css of required data')\ndata_usernames \u0026lt;- data.frame(html_text(usernames, trim = TRUE),stringsAsFactors = FALSE)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI also used RCurl and again I'm getting data from the login page. The RCurl code is as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elibrary(RCurl)\ncurl = getCurlHandle()\ncurlSetOpt(cookiejar = 'cookies.txt', followlocation = TRUE, autoreferer = TRUE, curl = curl)\nhtml \u0026lt;- getURL('http://members.dublinchamber.ie/login.aspx', curl = curl)\nviewstate \u0026lt;- as.character(sub('.*id=\"__VIEWSTATE\" value=['142555296'].*', '\\\\1', html))\nparams \u0026lt;- list(\n 'ctl00$ContentPlaceHolder1$ExistingMembersLogin1$username'= 'username',\n 'ctl00$ContentPlaceHolder1$ExistingMembersLogin1$password'= 'pass',\n 'ctl00$ContentPlaceHolder1$ExistingMembersLogin1$btnSubmit'= 'login',\n '__VIEWSTATE' = viewstate\n)\nhtml = postForm('http://members.dublinchamber.ie/login.aspx', .params = params, curl = curl)\n grep('Logout', html)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThere are 3 URL's actually:\n1) members.dublinchamber.ie/directory/default.aspx(has the names of all industry and it is required to click on any industry)\n2) members.dublinchamber.ie/directory/default.aspx?industryVal=AdvMarPubrel (the advmarpubrel is just a small string which is generated as i clicked that industry)\n3) members.dublinchamber.ie/directory/profile.aspx?compid=19399 (this has the profile information of a specific company which i clicked in the previous page)\u003c/p\u003e\n\n\u003cp\u003ei want to scrape data which should give me industry name, list of companies in each industry and their details which are present as a table in the 3rd URL above.\nI am new here and also to R, webscrape. Please don't mind if the question was lengthy or not that clear.\u003c/p\u003e","answer_count":"0","comment_count":"6","creation_date":"2016-08-09 06:54:49.677 UTC","last_activity_date":"2016-08-09 06:54:49.677 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6694101","post_type_id":"1","score":"0","tags":"r|web-scraping|password-protection","view_count":"212"} +{"id":"26361624","title":"How do I use forward declared datamembers in a function template? (C++)","body":"\u003cp\u003eSo I have a Class in which I use datamembers of forward declared classes. Now I need a function template for my class but function templates need to be implemented in the header file so I cant acces my members. How can i work around this?\u003c/p\u003e\n\n\u003cp\u003eHere is some of my code\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass Cell;\nclass Node;\n\n\nclass Wall : public WallAttributes\n{\npublic:\n ///\n virtual ~Wall() {}\n\nprivate:\n Cell* m_c1; ///\u0026lt;\n Cell* m_c2; ///\u0026lt;\n Node* m_n1; ///\u0026lt;\n Node* m_n2; ///\u0026lt;\n unsigned int m_wall_index; ///\u0026lt;\n\nprivate:\n mutable double m_length; ///\u0026lt; Length is tracked lazily.\n mutable bool m_length_dirty; ///\u0026lt; Marks length dirty.\n\nprivate:\n friend class cereal::access;\n template\u0026lt;class Archive\u0026gt;\n void save(Archive \u0026amp; archive) const\n {\n archive(m_c1-\u0026gt;GetIndex());\n archive(m_c2-\u0026gt;GetIndex());\n archive(m_n1-\u0026gt;GetIndex());\n archive(m_n2-\u0026gt;GetIndex());\n archive(m_wall_index);\n archive(m_length);\n archive(m_length_dirty);\n }\n\n template\u0026lt;class Archive\u0026gt;\n void load(Archive \u0026amp; archive)\n {\n //Todo\n }\n\n};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhich gives the error: Invalid use of incomplete type Cell\u003c/p\u003e","accepted_answer_id":"26362627","answer_count":"2","comment_count":"5","creation_date":"2014-10-14 13:06:36.413 UTC","last_activity_date":"2014-10-14 13:53:21.763 UTC","last_edit_date":"2014-10-14 13:28:29.88 UTC","last_editor_display_name":"","last_editor_user_id":"4095830","owner_display_name":"","owner_user_id":"2443088","post_type_id":"1","score":"0","tags":"c++|templates","view_count":"98"} +{"id":"39732641","title":"Background Color for row in NSOutlineView","body":"\u003cp\u003eHow do I set the background color for 1 particular row in an NSOutlineView? I have tried this with no luck:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunc outlineView(_ outlineView: NSOutlineView, rowViewForItem item: Any) -\u0026gt; NSTableRowView? {\n let newRow = NSTableRowView()\n newRow.backgroundColor = NSColor.red\n return newRow\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-09-27 19:17:41.277 UTC","last_activity_date":"2017-06-24 23:42:22.603 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1007895","post_type_id":"1","score":"1","tags":"swift|osx|nsoutlineview","view_count":"102"} +{"id":"18419233","title":"MySql 24 hours intervals select","body":"\u003cp\u003eI need to group rows from a table by 24 hours intervals as below\u003c/p\u003e\n\n\u003cp\u003e// SELECT count(user_id), DATE(created) as day FROM table GROUP BY day //\u003c/p\u003e\n\n\u003cp\u003eSELECT * FROM table GROUP BY DATE(created)\u003c/p\u003e\n\n\u003cp\u003ebut i need the selection to be made by 24 hours intervals starting at 12:00:00 not 00:00:00\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","accepted_answer_id":"18419728","answer_count":"1","comment_count":"8","creation_date":"2013-08-24 13:44:46.693 UTC","last_activity_date":"2013-08-24 17:53:28.953 UTC","last_edit_date":"2013-08-24 15:02:17.563 UTC","last_editor_display_name":"","last_editor_user_id":"1938683","owner_display_name":"","owner_user_id":"1938683","post_type_id":"1","score":"0","tags":"mysql|select|intervals","view_count":"755"} +{"id":"35127910","title":"How to convert Mat to byte array in android opencv?","body":"\u003cp\u003eStep 1: I was converted Mat to byte array using below method\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eMatOfByte matOfByte = new MatOfByte();\n Imgcodecs.imencode(\".png\", mRgba, matOfByte); \n byteArray = matOfByte.toArray();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eits efficiently converted byte array values. But when i calculate time taken for this method is 100 - 200ms and above. \u003c/p\u003e\n\n\u003cp\u003eStep2: I did one sample in Opencv Facedetection, i pass a byte array value to native i have FPS count is 1.314. \u003c/p\u003e\n\n\u003cp\u003eStep3: Before that for my analyse I didn't call native just i return a same capture Mat i have FPS count 13 to 18 frames per second.\u003c/p\u003e\n\n\u003cp\u003eStep4: Problem i found is Mat to Byte array conversion it takes more time to convert so i didn't get any improvements in FPS.\u003c/p\u003e\n\n\u003cp\u003eStep5: I change conversion method \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ebyte[] return_buff = new byte[(int) (mRgba.total() * \n mRgba.channels())];\nmRgba.get(0, 0, return_buff);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethis method cannot take more time to convert but when i was Pass a byte array to native, channels value changed to 1 and image not found. \u003c/p\u003e\n\n\u003cp\u003eIs there any other solution to convert byte array, please justify me, thank you\u003c/p\u003e","answer_count":"0","comment_count":"6","creation_date":"2016-02-01 10:15:05.903 UTC","last_activity_date":"2016-02-01 10:15:05.903 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1485254","post_type_id":"1","score":"0","tags":"android|opencv|mat","view_count":"1639"} +{"id":"47546679","title":"Modules with database connections objects and related functions","body":"\u003cp\u003eThis is a question about the design of my application. \u003c/p\u003e\n\n\u003cp\u003eThe application mainly runs \"jobs\" that read data from different databases or files, does some transformations and joins, and writes this data to other files and databases.\u003c/p\u003e\n\n\u003cp\u003eMy idea is to have a module for each database source system. The database connection would be a global variable in each module. The rest of the module would have functions that pull data from the database, do some transformations and return a pandas data frame, abstracting the data processing under a nice label. e.g.:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#data source hr_db_system module \n\nimport pyodbc\nimport pandas as pd\nconnection=pyodbc.connect('connection_string')\n\ndef left_employees():\n df=pd.read_sql(\"SELECT employee_id, name,department FROM employees\",connection)\n df=df[df.employee_id\u0026lt;4000] #business logic\n return df\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe jobs themselves woudl import the data source modules as needed and database connections would never explicitly be closed and would would rely on the garbage collector doing this. e.g.:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#example job module \n\nimport hr_db_system\n\ndf=hr_db_system.left_employees()\ndf=df[df.department=='accounts'] # some job specific business logic\nsave_to_file('some_path',df)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs this a good design? Is there a common design pattern for these kind of applications? Are there any obvious pitfalls? Is there an issue no closing connections?\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-11-29 06:49:46.087 UTC","last_activity_date":"2017-11-29 06:49:46.087 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"8243305","post_type_id":"1","score":"0","tags":"python","view_count":"12"} +{"id":"10358313","title":"How do I search multiple mySQL tables to find one specific row?","body":"\u003cp\u003eI have three tables: adapters, connectors, components\u003cbr\u003e\nI need to be able to search them all to find a corresponding Part Number (part_num)\u003cbr\u003e\nThe part number is unique so I don't have to worry about multiple entries.\u003c/p\u003e\n\n\u003cp\u003eI use GET to find the part number in the URL, set it to $num, and then do the SELECT\u003c/p\u003e\n\n\u003cp\u003eWhat I've found is that I should use UNION, however the three tables have different columns and it gives me an error when trying to do the select. In the example below \u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://stackoverflow.com/questions/558283/how-do-i-find-all-references-from-other-tables-to-a-specific-row\"\u003eUsing UNION to find references from other tables\u003c/a\u003e \u003c/p\u003e\n\n\u003cp\u003eThis is my code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eif(isset($_GET['num'])) {\n$num = $_GET['num'];\n\n$result = mysql_query(\"SELECT * FROM connectors WHERE part_num = '$num' UNION SELECT * FROM adapters WHERE part_num = '$num' UNION SELECT * FROM components WHERE part_num = '$num'\"); }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny help would be appreciated, so thanks in advance SO =) \u003c/p\u003e","accepted_answer_id":"10358395","answer_count":"3","comment_count":"0","creation_date":"2012-04-27 21:50:16.037 UTC","last_activity_date":"2012-04-27 22:57:43.463 UTC","last_edit_date":"2017-05-23 11:55:55.287 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"1362016","post_type_id":"1","score":"3","tags":"php|mysql","view_count":"174"} +{"id":"32556174","title":"go rpc, http or websockets,which is fastest for transferring many small pieces of data, repeatedly, from one server to another","body":"\u003cp\u003e\u003cstrong\u003eBackground\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI'm experimenting creating a memory + cpu profiler in go, and wish to transfer the information quickly, maybe every second, from the program/service being profiled to a server which will do all of the heavy lifting by saving the data to a database and/or serving it via http to a site; this will reduce the load on the program being profiled for more accurate measurements. It will be small pieces of data being transferred. I know there are some libraries out there already, but like I said, experimenting.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eTransfer Content Type\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI have not decided on a concrete transfer type but looks like JSON for HTTP or Websockets and just the Struct for RPC (if I've done my research correctly)\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eSummary\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI will likely try each just to see for myself, but have little experience using RPC and Websockets and would like some opinions or recommendations on which may be faster or more suitable for what I'm trying to do:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eHTTP\u003c/li\u003e\n\u003cli\u003eRPC\u003c/li\u003e\n\u003cli\u003eWebsockets\u003c/li\u003e\n\u003cli\u003eAnything else I'm not thinking about\u003c/li\u003e\n\u003c/ul\u003e","accepted_answer_id":"32563983","answer_count":"1","comment_count":"3","creation_date":"2015-09-14 01:29:13.38 UTC","last_activity_date":"2015-09-14 12:22:32.01 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3158232","post_type_id":"1","score":"1","tags":"performance|http|go|websocket|rpc","view_count":"372"} +{"id":"24058169","title":"Is it possible to jump to an outer \"case\" statement from a nested one?","body":"\u003cp\u003eHere below is a simple example of how to handle unexpected errors:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etry {\n // some code that may throw an exception...\n} catch {\n case e: MyException =\u0026gt; e.errorCode match {\n case Some(ErrorCodes.ERROR_ONE) =\u0026gt; println(\"error 1\")\n case Some(ErrorCodes.ERROR_TWO) =\u0026gt; println(\"error 2\")\n case _ =\u0026gt; println(\"unhandled error\")\n }\n case _ =\u0026gt; println(\"unhandled error\")\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAs you can see in the code above, both the top level \u003ccode\u003ecase\u003c/code\u003e on the exceptions and the nested \u003ccode\u003ecase\u003c/code\u003e on the error codes end in a kind of \u003cem\u003ecatch all\u003c/em\u003e to handle unexpected errors. The code works... but I'm wondering whether there is a more elegant way that let me avoid the repetition and have just one \u003cem\u003ecatch all\u003c/em\u003e statement [i.e. \u003ccode\u003eprintln(\"unhandled error\")\u003c/code\u003e]:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etry {\n // some code that may throw an exception...\n} catch {\n case e: MyException =\u0026gt; e.errorCode match {\n case Some(ErrorCodes.ERROR_ONE) =\u0026gt; println(\"error 1\")\n case Some(ErrorCodes.ERROR_TWO) =\u0026gt; println(\"error 2\")\n // case _ =\u0026gt; println(\"unhandled error\")\n // is it possible to jump to the outer *catch all* statement?\n }\n case _ =\u0026gt; println(\"unhandled error\")\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","accepted_answer_id":"24060532","answer_count":"1","comment_count":"1","creation_date":"2014-06-05 10:47:39.287 UTC","last_activity_date":"2014-06-05 12:42:02.58 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"278659","post_type_id":"1","score":"3","tags":"scala","view_count":"126"} +{"id":"39869672","title":"How to name a module without conflict with variable name?","body":"\u003cp\u003eI found sometime it's difficult to name a module without conflicting with a variable name latter. For example, I have a following class:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass Petition(object):\n def __init__(self, signature_count_requirement):\n self._signature_count_requirement = signature_count_requirement\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand a following function:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef check_if_someone_can_sponsor_a_petition(someone):\n pass\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eso it's nature to write code like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eif check_if_someone_can_sponsor_a_petition(a):\n petition = Petition(3)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThen I want to put the function and the \u003ccode\u003ePetition\u003c/code\u003e class into a module. Now what should I call the module? It seems nature to name the module \u003ccode\u003epetition\u003c/code\u003e. However it's very easy to conflict with variable names latter like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport petition\nif petition.check_if_someone_can_sponsor_a_petition(a):\n petition = petition.Petition(3) # this is ugly.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe \u003ccode\u003edatetime\u003c/code\u003e module could be a better(worse?) example. When came across with name \u003ccode\u003edatetime\u003c/code\u003e in code, I often had to make sure it's the module or the class name or someone's variable name.\u003c/p\u003e\n\n\u003cp\u003eIs there any good conventions about how to name a module to avoid conflict with a variable name latter?\u003c/p\u003e","answer_count":"4","comment_count":"6","creation_date":"2016-10-05 09:03:28.787 UTC","last_activity_date":"2016-10-05 09:38:00.527 UTC","last_edit_date":"2016-10-05 09:09:27.447 UTC","last_editor_display_name":"","last_editor_user_id":"355230","owner_display_name":"","owner_user_id":"308587","post_type_id":"1","score":"1","tags":"python","view_count":"251"} +{"id":"31535913","title":"How to use trigger mysql for filter","body":"\u003cp\u003eI have a code trigger before insert in MySQLfor filter data but it doesn't work. This is the logical of my code, if new.suhu_udara \u003e 30 and new.suhu_udara - old.suhu_udara \u0026lt;10 then set new.suhu_udara = null \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eUSE `cuaca_maritim`;\nDELIMITER $$\nDROP TRIGGER IF EXISTS cuaca_maritim.filter$$\nUSE `cuaca_maritim`$$\nCREATE DEFINER=`root`@`localhost` TRIGGER `filter` BEFORE INSERT ON data_cuaca` FOR EACH ROW\nif( new.suhu_udara \u0026lt; 21.5 or new.kelembaban_udara \u0026lt; 22 or new.tekanan_udara \u0026lt; 1002.4) then\nSet new.suhu_udara = null ;\nelseif ( new.suhu_udara \u0026gt; 37.6 or new.kelembaban_udara \u0026gt; 100 or new.tekanan_udara \u0026gt;1018.9 or new.kecepatan_angin \u0026gt; 44) then\nSet new.kelembaban_udara = null ;\nend if$$\nDELIMITER ;\nUSE `cuaca_maritim`;\n\nDELIMITER $$\n\nDROP TRIGGER IF EXISTS cuaca_maritim.data_cuaca_AFTER_UPDATE$$\nUSE `cuaca_maritim`$$\nCREATE DEFINER = CURRENT_USER TRIGGER `cuaca_maritim`.`data_cuaca_AFTER_UPDATE` AFTER UPDATE ON `data_cuaca` FOR EACH ROW\nif ( old.suhu_udara - new.suhu_udara \u0026gt; 10) then \nset new.suhu_udara=null ;\nend if\n $$\nDELIMITER ;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCan you help mex this code? thank you\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2015-07-21 10:00:05.347 UTC","last_activity_date":"2015-07-21 10:17:03.497 UTC","last_edit_date":"2015-07-21 10:17:03.497 UTC","last_editor_display_name":"","last_editor_user_id":"4771450","owner_display_name":"","owner_user_id":"4771450","post_type_id":"1","score":"0","tags":"mysql","view_count":"84"} +{"id":"7011153","title":"Remove DTD from XML SSIS","body":"\u003cp\u003eHi all im struggling with this one. Ive got a foreach loop that will loop over a folder that contains xml files that i want to import there data into a database. The problem is the xml files have a dtd, theres nothing i can do to prevent this from being attached to the xml file. So i need some way of removing the dtd. Ive searched google and various forums and come up blank. Just wondered if anyone has any ideas?\u003c/p\u003e","accepted_answer_id":"7023685","answer_count":"2","comment_count":"0","creation_date":"2011-08-10 12:59:57.647 UTC","favorite_count":"0","last_activity_date":"2011-08-11 09:34:29.157 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"838656","post_type_id":"1","score":"0","tags":"ssis|dtd","view_count":"1757"} +{"id":"28110595","title":"Assign MPI Processes to Nodes","body":"\u003cp\u003eI have an MPI program that uses a master process and multiple worker processes. I want to have the master process running on a single compute node alone, while the worker processes run on another node. The worker processes should be assigned by socket (for example as it is done with the \u003ccode\u003e--map-by-socket\u003c/code\u003e option). Is there any option to assign the master process and the working processes to different nodes or to assign it manually, by consulting the rank maybe?\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","accepted_answer_id":"28120421","answer_count":"2","comment_count":"0","creation_date":"2015-01-23 13:05:01.14 UTC","last_activity_date":"2015-01-23 23:31:42.183 UTC","last_edit_date":"2015-01-23 15:26:24.907 UTC","last_editor_display_name":"","last_editor_user_id":"491687","owner_display_name":"","owner_user_id":"3523344","post_type_id":"1","score":"1","tags":"mpi|openmpi","view_count":"548"} +{"id":"31506045","title":"XML documentation for doc generators bloats files","body":"\u003cp\u003eI'm using Doxygen to generate documentation based on the XML commenting on my source files. The problem I have though is the amount of bloat in the file. There's more comments than there are actual lines of code.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eusing System;\nusing System.Diagnostics;\nusing System.Threading;\nusing System.Threading.Tasks;\n\n/// \u0026lt;summary\u0026gt;\n/// \u0026lt;para\u0026gt;\n/// The Engine Timer allows for starting a timer that will execute a callback at a given interval.\n/// \u0026lt;/para\u0026gt;\n/// \u0026lt;para\u0026gt;\n/// The timer may fire:\n/// - infinitely at the given interval\n/// - fire once\n/// - fire _n_ number of times.\n/// \u0026lt;/para\u0026gt;\n/// \u0026lt;para\u0026gt;\n/// The Engine Timer will stop its self when it is disposed of.\n/// \u0026lt;/para\u0026gt;\n/// \u0026lt;para\u0026gt;\n/// The Timer requires you to provide it an instance that will have an operation performed against it.\n/// The callback will be given the generic instance at each interval fired.\n/// \u0026lt;/para\u0026gt;\n/// \u0026lt;para\u0026gt;\n/// In the following example, the timer is given an instance of an IPlayer. \n/// It starts the timer off with a 30 second delay before firing the callback for the first time.\n/// It tells the timer to fire every 60 seconds with 0 as the number of times to fire. When 0 is provided, it will run infinitely.\n/// Lastly, it is given a callback, which will save the player every 60 seconds.\n/// @code\n/// var timer = new EngineTimer\u0026lt;IPlayer\u0026gt;(new DefaultPlayer());\n/// timer.StartAsync(30000, 6000, 0, (player, timer) =\u0026gt; player.Save());\n/// @endcode\n/// \u0026lt;/para\u0026gt;\n/// \u0026lt;/summary\u0026gt;\n/// \u0026lt;typeparam name=\"T\"\u0026gt;The type that will be provided when the timer callback is invoked.\u0026lt;/typeparam\u0026gt;\npublic sealed class EngineTimer\u0026lt;T\u0026gt; : CancellationTokenSource, IDisposable\n{\n /// \u0026lt;summary\u0026gt;\n /// The timer task\n /// \u0026lt;/summary\u0026gt;\n private Task timerTask;\n\n /// \u0026lt;summary\u0026gt;\n /// How many times we have fired the timer thus far.\n /// \u0026lt;/summary\u0026gt;\n private long fireCount = 0;\n\n /// \u0026lt;summary\u0026gt;\n /// Initializes a new instance of the \u0026lt;see cref=\"EngineTimer{T}\"/\u0026gt; class.\n /// \u0026lt;/summary\u0026gt;\n /// \u0026lt;param name=\"callback\"\u0026gt;The callback.\u0026lt;/param\u0026gt;\n /// \u0026lt;param name=\"state\"\u0026gt;The state.\u0026lt;/param\u0026gt;\n public EngineTimer(T state)\n {\n this.StateData = state;\n }\n\n /// \u0026lt;summary\u0026gt;\n /// Gets the object that was provided to the timer when it was instanced.\n /// This object will be provided to the callback at each interval when fired.\n /// \u0026lt;/summary\u0026gt;\n public T StateData { get; private set; }\n\n /// \u0026lt;summary\u0026gt;\n /// Gets a value indicating whether the engine timer is currently running.\n /// \u0026lt;/summary\u0026gt;\n public bool IsRunning { get; private set; }\n\n /// \u0026lt;summary\u0026gt;\n /// \u0026lt;para\u0026gt;\n /// Starts the timer, firing a synchronous callback at each interval specified until `numberOfFires` has been reached.\n /// If `numberOfFires` is 0, then the callback will be called indefinitely until the timer is manually stopped.\n /// \u0026lt;/para\u0026gt;\n /// \u0026lt;para\u0026gt;\n /// The following example shows how to start a timer, providing it a callback.\n /// \u0026lt;/para\u0026gt;\n /// @code\n /// var timer = new EngineTimer\u0026lt;IPlayer\u0026gt;(new DefaultPlayer());\n /// double startDelay = TimeSpan.FromSeconds(30).TotalMilliseconds;\n /// double interval = TimeSpan.FromMinutes(10).TotalMilliseconds;\n /// int numberOfFires = 0;\n /// \n /// timer.Start(\n /// startDelay, \n /// interval, \n /// numberOfFires, \n /// (player, timer) =\u0026gt; player.Save());\n /// @endcode\n /// \u0026lt;/summary\u0026gt;\n /// \u0026lt;param name=\"startDelay\"\u0026gt;\n /// \u0026lt;para\u0026gt;\n /// The `startDelay` is used to specify how much time must pass before the timer can invoke the callback for the first time.\n /// If 0 is provided, then the callback will be invoked immediately upon starting the timer.\n /// \u0026lt;/para\u0026gt;\n /// \u0026lt;para\u0026gt;\n /// The `startDelay` is measured in milliseconds.\n /// \u0026lt;/para\u0026gt;\n /// \u0026lt;/param\u0026gt;\n /// \u0026lt;param name=\"interval\"\u0026gt;The interval in milliseconds.\u0026lt;/param\u0026gt;\n /// \u0026lt;param name=\"numberOfFires\"\u0026gt;Specifies the number of times to invoke the timer callback when the interval is reached. Set to 0 for infinite.\u0026lt;/param\u0026gt;\n public void Start(double startDelay, double interval, int numberOfFires, Action\u0026lt;T, EngineTimer\u0026lt;T\u0026gt;\u0026gt; callback)\n {\n this.IsRunning = true;\n\n this.timerTask = Task\n .Delay(TimeSpan.FromMilliseconds(startDelay), this.Token)\n .ContinueWith(\n (task, state) =\u0026gt; RunTimer(task, (Tuple\u0026lt;Action\u0026lt;T, EngineTimer\u0026lt;T\u0026gt;\u0026gt;, T\u0026gt;)state, interval, numberOfFires),\n Tuple.Create(callback, this.StateData),\n CancellationToken.None,\n TaskContinuationOptions.ExecuteSynchronously | TaskContinuationOptions.OnlyOnRanToCompletion,\n TaskScheduler.Default);\n }\n\n /// \u0026lt;summary\u0026gt;\n /// Starts the specified start delay.\n /// \u0026lt;/summary\u0026gt;\n /// \u0026lt;param name=\"startDelay\"\u0026gt;The start delay in milliseconds.\u0026lt;/param\u0026gt;\n /// \u0026lt;param name=\"interval\"\u0026gt;The interval in milliseconds.\u0026lt;/param\u0026gt;\n /// \u0026lt;param name=\"numberOfFires\"\u0026gt;Specifies the number of times to invoke the timer callback when the interval is reached. Set to 0 for infinite.\u0026lt;/param\u0026gt;\n public void StartAsync(double startDelay, double interval, int numberOfFires, Func\u0026lt;T, EngineTimer\u0026lt;T\u0026gt;, Task\u0026gt; callback)\n {\n this.IsRunning = true;\n\n this.timerTask = Task\n .Delay(TimeSpan.FromMilliseconds(startDelay), this.Token)\n .ContinueWith(\n async (task, state) =\u0026gt; await RunTimerAsync(task, (Tuple\u0026lt;Func\u0026lt;T, EngineTimer\u0026lt;T\u0026gt;, Task\u0026gt;, T\u0026gt;)state, interval, numberOfFires),\n Tuple.Create(callback, this.StateData),\n CancellationToken.None,\n TaskContinuationOptions.ExecuteSynchronously | TaskContinuationOptions.OnlyOnRanToCompletion,\n TaskScheduler.Default);\n }\n\n /// \u0026lt;summary\u0026gt;\n /// Stops the timer for this instance.\n /// Stopping the timer will not dispose of the EngineTimer, allowing you to restart the timer if you need to.\n /// \u0026lt;/summary\u0026gt;\n public void Stop()\n {\n if (!this.IsCancellationRequested)\n {\n this.Cancel();\n } \n this.IsRunning = false;\n }\n\n /// \u0026lt;summary\u0026gt;\n /// Stops the timer and releases the unmanaged resources used by the \u0026lt;see cref=\"T:System.Threading.CancellationTokenSource\" /\u0026gt; class and optionally releases the managed resources.\n /// \u0026lt;/summary\u0026gt;\n /// \u0026lt;param name=\"disposing\"\u0026gt;true to release both managed and unmanaged resources; false to release only unmanaged resources.\u0026lt;/param\u0026gt;\n protected override void Dispose(bool disposing)\n {\n if (disposing)\n {\n this.IsRunning = false;\n this.Cancel();\n }\n\n base.Dispose(disposing);\n }\n\n private async Task RunTimer(Task task, Tuple\u0026lt;Action\u0026lt;T, EngineTimer\u0026lt;T\u0026gt;\u0026gt;, T\u0026gt; state, double interval, int numberOfFires)\n {\n while (!this.IsCancellationRequested)\n {\n // Only increment if we are supposed to.\n if (numberOfFires \u0026gt; 0)\n {\n this.fireCount++;\n }\n\n state.Item1(state.Item2, this);\n await PerformTimerCancellationCheck(interval, numberOfFires);\n }\n }\n\n private async Task RunTimerAsync(Task task, Tuple\u0026lt;Func\u0026lt;T, EngineTimer\u0026lt;T\u0026gt;, Task\u0026gt;, T\u0026gt; state, double interval, int numberOfFires)\n {\n while (!this.IsCancellationRequested)\n {\n // Only increment if we are supposed to.\n if (numberOfFires \u0026gt; 0)\n {\n this.fireCount++;\n }\n\n await state.Item1(state.Item2, this);\n await PerformTimerCancellationCheck(interval, numberOfFires);\n }\n }\n\n private async Task PerformTimerCancellationCheck(double interval, int numberOfFires)\n {\n // If we have reached our fire count, stop. If set to 0 then we fire until manually stopped.\n if (numberOfFires \u0026gt; 0 \u0026amp;\u0026amp; this.fireCount \u0026gt;= numberOfFires)\n {\n this.Stop();\n }\n\n await Task.Delay(TimeSpan.FromMilliseconds(interval), this.Token).ConfigureAwait(false);\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCan you move the documentation in to different files, leaving just the API usage XML documentation on the members, while more exhaustive documentation (with source examples) exist elsewhere. With the more exhaustive documentation being what is generated while maintaining its relationship to the class on the generated documentation?\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2015-07-19 21:20:48.17 UTC","last_activity_date":"2015-07-19 21:20:48.17 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1815321","post_type_id":"1","score":"0","tags":"c#|xml|doxygen|documentation-generation","view_count":"42"} +{"id":"38366822","title":"Regular expression for finding strings containing only white space","body":"\u003cp\u003eHi I have tried the following and it seems not working. Can you explain me why ?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class Solution {\npublic static void main(String[] args) {\n String abc =\" \";\n String regx = \".*[^\\\\s].*\";\n if (abc.matches(regx)) {\n System.out.println(\"true\");\n } else {\n System.out.println(\"false\");\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e}\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eI have tried another case \u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class Solution {\npublic static void main(String[] args) {\n String abc =\" \";\n String regx = \".*[^\\\\s].*\";\n Pattern r = Pattern.compile(regx);\n Matcher m = r.matcher(abc);\n if (m.find()) {\n System.out.println(true);\n } else {\n System.out.println(false);\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eI have given abc = \" \",abc = \" \". in all the case i am getting false as output.I dont understand why ?\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","answer_count":"0","comment_count":"5","creation_date":"2016-07-14 06:19:02.067 UTC","last_activity_date":"2016-07-14 06:19:02.067 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3843853","post_type_id":"1","score":"0","tags":"java|regex","view_count":"35"} +{"id":"41759604","title":"Android wifimanager enable network seems to enable wrong network","body":"\u003cp\u003eI have made an android app which on startup gets the current wifi network and connects to a different one. At least that is what it is supposed to do:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ewifiInfo = wifiManager.getConnectionInfo();\nOldNetworkID = wifiInfo.getNetworkId(); //save current network\nWDTNetworkID = wifiManager.addNetwork(wificonfiguration); //add new network\nwifiManager.disconnect();\nwifiManager.enableNetwork(WDTNetworkID, true); //enable new network and disable all others\nwifiManager.reconnect();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I debug I can see \u003ccode\u003ewificonfiguration\u003c/code\u003e contains the right SSID (the SSID of the new network).\u003c/p\u003e\n\n\u003cp\u003eAfter \u003ccode\u003eaddNetwork()\u003c/code\u003e I see that \u003ccode\u003ewifiManager.getConfiguredNetworks()\u003c/code\u003e contains this new network with the right SSID and the same networkID as \u003ccode\u003eWDTNetworkID\u003c/code\u003e. At this point the network is enabled.\u003c/p\u003e\n\n\u003cp\u003eBut after \u003ccode\u003eenableNetwork()\u003c/code\u003e instead of \u003ccode\u003eWDTNetworkID\u003c/code\u003e enabled and the rest disabled I see that \u003ccode\u003eOldNetworkID\u003c/code\u003e is enabled and the rest is disabled.\u003c/p\u003e\n\n\u003cp\u003eAm I doing something wrong?\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/FioZC.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/FioZC.png\" alt=\"This is what it looks like\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI have added a picture of a couple of watches while debugging.\nYou can see here that the old network is enabled and the rest is disabled.\u003c/p\u003e","accepted_answer_id":"41762741","answer_count":"1","comment_count":"0","creation_date":"2017-01-20 08:57:15.437 UTC","last_activity_date":"2017-01-20 11:35:18.94 UTC","last_edit_date":"2017-01-20 09:04:14.98 UTC","last_editor_display_name":"","last_editor_user_id":"7307021","owner_display_name":"","owner_user_id":"7307021","post_type_id":"1","score":"0","tags":"java|android|wifimanager","view_count":"175"} +{"id":"44830655","title":"Stata: How can I select a time interval around an event?","body":"\u003cp\u003eI have a .dta file with this variables:\nDate, Time, event, ....other variables.... \u003c/p\u003e\n\n\u003cp\u003eThe variable event assumes value=1 for the whole duration of the event otherwise assumes value =.\u003c/p\u003e\n\n\u003cp\u003eThe .dta file could have more than 1 event. \u003c/p\u003e\n\n\u003cp\u003eI want to keep the event and a temporal window of 10 minutes before and 10 minutes after the event.\u003c/p\u003e\n\n\u003cp\u003eThanks to all\u003c/p\u003e\n\n\u003cp\u003eEdit: In the picture there is an example of the data, I want to keep the event (when the variable event=1), 10 minutes before line 17467 and 10 minutes after line 17471 and drop the other observations \u003ca href=\"https://i.stack.imgur.com/vRYpG.png\" rel=\"nofollow noreferrer\"\u003ePicture_of_data\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eExample of dataset \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003einput str11 datel str15 timel int a double b int c double time float(hours minutes event)\n\"23-FEB-2006\" \"10:14:57.837759\"     . 45.04 2 36897837 10 14 .\n\"23-FEB-2006\" \"10:14:57.990093\"   100     . . 36897990 10 14 .\n\"23-FEB-2006\" \"10:14:57.993023\"   100     . . 36897993 10 14 .\n\"23-FEB-2006\" \"10:14:57.993023\"  1800     . . 36897993 10 14 .\n\"23-FEB-2006\" \"10:14:58.133639\"     . 45.04 1 36898133 10 14 .\n\"23-FEB-2006\" \"10:15:01.773054\"     . 45.04 1 36901773 10 15 .\n\"23-FEB-2006\" \"10:15:01.776960\"     . 45.04 1 36901776 10 15 .\n\"23-FEB-2006\" \"10:15:02.776896\"     . 45.04 3 36902776 10 15 .\n\"23-FEB-2006\" \"10:15:07.482650\"     . 45.04 5 36907482 10 15 .\n\"23-FEB-2006\" \"10:15:07.885944\"     . 45.04 3 36907885 10 15 .\n\"23-FEB-2006\" \"10:15:09.550877\"     . 45.04 7 36909550 10 15 .\n\"23-FEB-2006\" \"10:15:22.151906\"   100     . . 36922151 10 15 1\n\"23-FEB-2006\" \"10:15:22.155812\"   100     . . 36922155 10 15 1\n\"23-FEB-2006\" \"10:15:22.155812\"  1200     . . 36922155 10 15 1\n\"23-FEB-2006\" \"10:15:22.155812\"   300     . . 36922155 10 15 1\n\"23-FEB-2006\" \"10:15:22.155812\"   100     . . 36922155 10 15 1\n\"23-FEB-2006\" \"10:15:22.642109\"   200     . . 36922642 10 15 .\n\"23-FEB-2006\" \"10:15:22.832527\"   100     . . 36922832 10 15 .\n\"23-FEB-2006\" \"10:15:22.990720\"     . 45.04 3 36922990 10 15 .\n\"23-FEB-2006\" \"10:15:23.311988\"     . 45.04 1 36923311 10 15 .\n\"23-FEB-2006\" \"10:15:23.319800\"     . 45.05 3 36923319 10 15 .\n\"23-FEB-2006\" \"10:15:23.331518\"     .  45.1 1 36923331 10 15 .\n\"23-FEB-2006\" \"10:15:23.335424\"     . 45.11 1 36923335 10 15 .\n\"23-FEB-2006\" \"10:15:23.335424\"     . 45.11 2 36923335 10 15 .\n\"23-FEB-2006\" \"10:15:23.336401\"     .  45.1 1 36923336 10 15 .\n\"23-FEB-2006\" \"10:15:23.336401\"     .  45.1 1 36923336 10 15 .\n\"23-FEB-2006\" \"10:15:23.336401\"     .  45.1 1 36923336 10 15 .\n\"23-FEB-2006\" \"10:15:23.336401\"     .  45.1 1 36923336 10 15 .\n\"23-FEB-2006\" \"10:15:23.336401\"     .  45.1 1 36923336 10 15 .\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSolved here: \u003ca href=\"https://www.statalist.org/forums/forum/general-stata-discussion/general/1399901-how-can-i-keep-a-time-interval-around-an-event\" rel=\"nofollow noreferrer\"\u003ehttps://www.statalist.org/forums/forum/general-stata-discussion/general/1399901-how-can-i-keep-a-time-interval-around-an-event\u003c/a\u003e\u003c/p\u003e","answer_count":"0","comment_count":"4","creation_date":"2017-06-29 16:34:36.547 UTC","last_activity_date":"2017-07-02 11:52:56.403 UTC","last_edit_date":"2017-07-02 11:52:56.403 UTC","last_editor_display_name":"","last_editor_user_id":"8232961","owner_display_name":"","owner_user_id":"8232961","post_type_id":"1","score":"0","tags":"time|time-series|stata","view_count":"63"} +{"id":"17321632","title":"How to edit column in Sql Server table?","body":"\u003cp\u003eHow can I edit one of columns in a SQL server table ?\u003cbr\u003e\nI want to change the type of one of columns from n var char (50) to n var char (100). When I do it, this error appears :\u003cbr\u003e\n\u003cstrong\u003esaving changes is not permitted.\u003c/strong\u003e\u003cbr\u003e\nhow can I do it?\u003c/p\u003e","accepted_answer_id":"17321699","answer_count":"1","comment_count":"2","creation_date":"2013-06-26 13:38:05.49 UTC","last_activity_date":"2013-06-26 13:41:44.76 UTC","last_edit_date":"2013-06-26 13:41:44.76 UTC","last_editor_display_name":"","last_editor_user_id":"425003","owner_display_name":"","owner_user_id":"2517651","post_type_id":"1","score":"0","tags":"sql-server","view_count":"315"} +{"id":"8559043","title":"How to share the same variable between modules?","body":"\u003cp\u003eI'm using Node.JS with Express.js and I need to share a variable between modules, I have to do that because this variable is a pool of mysql connections, This pool creates 3 Mysql connections at the start of Node.js and then I would like that the other modules will use those connections without recreate other pools.\u003c/p\u003e\n\n\u003cp\u003eIs this possible?\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","accepted_answer_id":"8559126","answer_count":"1","comment_count":"0","creation_date":"2011-12-19 09:05:32.38 UTC","favorite_count":"3","last_activity_date":"2011-12-19 09:11:45.3 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"887651","post_type_id":"1","score":"7","tags":"node.js|express","view_count":"2513"} +{"id":"24791385","title":"DFP ads not showing on ajaxified website","body":"\u003cp\u003eI used the Browser State/ajaxify gist (\u003ca href=\"https://github.com/browserstate\" rel=\"nofollow\"\u003ehttps://github.com/browserstate\u003c/a\u003e) on a Wordpress-based website to dynamically load content. The problem I'm running into is that now my Google DFP ads aren't loading when the content is dynamically loaded. \u003c/p\u003e\n\n\u003cp\u003eThe ads worked normally before, so I'm not sure exactly what the issue is. Am I overlooking something simple, or are there extra steps that need to be taken?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-07-16 21:48:44.187 UTC","last_activity_date":"2014-08-12 14:58:23.57 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3846847","post_type_id":"1","score":"0","tags":"wordpress|google-dfp|ajaxify","view_count":"137"} +{"id":"33768447","title":"Incorrect number of bindings supplied python","body":"\u003cp\u003eI'm executing the following query in sqllite\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eidP = cur.execute('SELECT id from profs where name = ?',name)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have a database table like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e| id | name |\n| 1 | xxxxxx |\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut I got an error : Incorrect number of bindings supplied. The current statement uses 1, and there are 6 supplied.\u003c/p\u003e\n\n\u003cp\u003eI think that the string 'xxxxxx' is seen as six individual characters.\u003c/p\u003e","accepted_answer_id":"33768486","answer_count":"2","comment_count":"0","creation_date":"2015-11-17 22:38:59.177 UTC","last_activity_date":"2015-11-17 23:23:33.48 UTC","last_edit_date":"2015-11-17 23:11:37.997 UTC","last_editor_display_name":"","last_editor_user_id":"2990008","owner_display_name":"","owner_user_id":"5574149","post_type_id":"1","score":"1","tags":"python|sqlite","view_count":"44"} +{"id":"39574222","title":"xpath cant select only one html tag","body":"\u003cp\u003eI am trying to get some data from a website, but when i use the following code it's return all of the matched elements, i want to return only 1st match! I've tried extract_first but it returned none!\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e# -*- coding: utf-8 -*-\nimport scrapy\nfrom gumtree.items import GumtreeItem\n\n\n\nclass FlatSpider(scrapy.Spider):\n name = \"flat\"\n allowed_domains = [\"gumtree.com\"]\n start_urls = (\n 'https://www.gumtree.com/flats-for-sale',\n )\n\n def parse(self, response):\n item = GumtreeItem()\n item['title'] = response.xpath('//*[@class=\"listing-title\"][1]/text()').extract()\n return item\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow to select only one element with xpath selector ? \u003c/p\u003e","accepted_answer_id":"39574339","answer_count":"2","comment_count":"0","creation_date":"2016-09-19 13:18:20.28 UTC","last_activity_date":"2016-09-22 18:36:35.86 UTC","last_edit_date":"2016-09-19 13:24:58.857 UTC","last_editor_display_name":"","last_editor_user_id":"771848","owner_display_name":"","owner_user_id":"6570112","post_type_id":"1","score":"1","tags":"python|python-3.x|xpath|web-scraping|scrapy","view_count":"48"} +{"id":"341477","title":"Generic Generics in Managed C++","body":"\u003cp\u003eI want to create a \u003cstrong\u003eList\u003c/strong\u003e of \u003cstrong\u003eKeyValuePair\u003c/strong\u003es in a managed C++ project. Here is the syntax I'm using\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eList\u0026lt;KeyValuePair\u0026lt;String^, String^\u0026gt;^\u0026gt;^ thing;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut I'm getting the following error:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eerror C3225: generic type argument for 'T' cannot be 'System::Collections::Generic::KeyValuePair ^', it must be a value type or a handle to a reference type\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI basically want to do this (C#)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eList\u0026lt;KeyValuePair\u0026lt;string, string\u0026gt;\u0026gt; thing;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut in managed C++. Oh and in .Net 2.0. Any takers?\u003c/p\u003e","accepted_answer_id":"341694","answer_count":"2","comment_count":"0","creation_date":"2008-12-04 17:40:58.63 UTC","last_activity_date":"2008-12-04 19:02:23.07 UTC","last_editor_display_name":"","owner_display_name":"brian","owner_user_id":"2831","post_type_id":"1","score":"2","tags":".net|generics|.net-2.0|managed-c++","view_count":"4607"} +{"id":"35100129","title":"How to get a nested document as object in mongoosastic","body":"\u003cp\u003ei have a nodejs server with mongoosastic an try to get a nested search result as objects instead of only the indexes. \u003c/p\u003e\n\n\u003cp\u003ethats my code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003erequire('../server/serverInit');\n\n\nvar elasticsearch = require('elasticsearch');\nvar esclient = new elasticsearch.Client({\n host: 'localhost:9200',\n log: 'trace'\n});\n\n\nvar Schema = mongoose.Schema;\nvar mongoosastic = require('mongoosastic');\n\nvar elasticsearch = require('elasticsearch');\nvar esclient = new elasticsearch.Client({\n host: '127.0.0.1:9200',\n log: 'trace'\n});\nglobal.DBModel = {};\n/**\n * StoreSchema\n * @type type\n */\n\nvar storeSchema = global.mongoose.Schema({\n Name: {type: String, es_indexed: true},\n Email: {type: String, es_indexed: true},\n .....\n _articles: {type: [articleSchema],\n es_indexed: true,\n es_type: 'nested',\n es_include_in_parent: true}\n});\n\n/**\n * ArtikelSchema\n * @type Schema\n */\n\nvar articleSchema = new Schema({ \n Name: {type: String, es_indexed: true},\n Kategorie: String,\n ....\n _stores: {type: [storeSchema],\n es_indexed: true,\n es_type: 'nested',\n es_include_in_parent: true}\n});\n\nstoreSchema.plugin(mongoosastic, {\n esClient: esclient\n});\narticleSchema.plugin(mongoosastic, {\n esClient: esclient\n});\nglobal.DBModel.Artikel = global.mongoose.model('Artikel', articleSchema);\n\nglobal.DBModel.Store = global.mongoose.model('Store', storeSchema);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhen i now fire a search from the route \"/search\" which have this example code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eglobal.DBModel.Artikel.search({\n query_string: {\n query: \"*\"\n }\n }, {\n hydrate: true\n }, function (err, results) {\n if (err)\n return res.send(500, {error: err});\n res.send(results);\n }); \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ei get this result:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e...\n {\n \"_id\": \"56ab6b15352a43725a21bc92\",\n \"stores\": [\n \"56ab6b03352a43725a21bc91\"\n ],\n \"Name\": \"daaadd\",\n \"ArtikelNummer\": \"232\",\n \"__v\": 0,\n \"_stores\": []\n }\n ]\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow i can get directly a object instead of the id \"56ab6b03352a43725a21bc91\"? \u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-01-30 09:33:13.4 UTC","last_activity_date":"2016-04-23 17:28:07.41 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4884035","post_type_id":"1","score":"0","tags":"node.js|mongodb|elasticsearch|mongoose|mongoosastic","view_count":"595"} +{"id":"6481429","title":"find index of element in a list using recursion","body":"\u003cpre\u003e\u003ccode\u003edef index(L,v)\n ''' Return index of value v in L '''\n pass\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI need help with implementing this function using recursion.\nReally new to recursion stuffs so any advices would help.!\u003c/p\u003e\n\n\u003cp\u003eNote that \u003ccode\u003eL\u003c/code\u003e is a list. \u003ccode\u003ev\u003c/code\u003e is a value.\u003c/p\u003e","answer_count":"7","comment_count":"3","creation_date":"2011-06-26 00:44:42.44 UTC","last_activity_date":"2011-06-26 01:43:03.01 UTC","last_edit_date":"2011-06-26 00:49:32.357 UTC","last_editor_display_name":"","last_editor_user_id":"396183","owner_display_name":"","owner_user_id":"815528","post_type_id":"1","score":"0","tags":"python","view_count":"5478"} +{"id":"15201945","title":"xml querying with variable","body":"\u003cp\u003eI am trying to pass the xpath as parameter to the query. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e declare @test as nvarchar(1000) = '(ns1:Book/Authors)[1]'\n ;with XMLNAMESPACES ('MyNameSpace:V1' as ns1)\n select \n b.XmlData.value(\n '@test'\n , 'nvarchar(100)') as QueriedData \n from Books b\n where b.BookID = '1'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe above statement gave the following error. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eXQuery [Books.XmlData.value()]: Top-level attribute nodes are not supported\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eTried it as @test, instead of '@test'. And got the following error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eThe argument 1 of the XML data type method \"value\" must be a string literal.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eTried it using 'sql:variable(@test)' and get this error: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eXQuery [Books.XmlData.value()]: A string literal was expected\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eTried it as 'sql:variable(\"@test\")' and it shows the value in @test as QueriedData, which is wrong \u003c/p\u003e\n\n\u003cp\u003ePlease tell me what am I missing here\u003c/p\u003e","accepted_answer_id":"15203967","answer_count":"1","comment_count":"1","creation_date":"2013-03-04 12:46:28.233 UTC","last_activity_date":"2013-03-04 14:47:07.283 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2081289","post_type_id":"1","score":"0","tags":"sql-server|xml","view_count":"1860"} +{"id":"7279001","title":"Loading large data","body":"\u003cp\u003eI hava a datatable with large amount of data (250K).\u003cbr\u003e\nI have used DevExpress component and nhibernate.\u003cbr\u003e\nIn devexpress components is server mode, but it does not suit me because I am using nHibernate.\u003cbr\u003e\nIn the table is many column as well. And 5 relation tables which displays together with main table (250K records).\n What a best way to advise me to achieve the goal?\u003cbr\u003e\nThanks and sorry for my English.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT:\u003c/strong\u003e\u003cbr\u003e\nHow to implement loading data with small portions?\u003c/p\u003e","accepted_answer_id":"7279537","answer_count":"2","comment_count":"1","creation_date":"2011-09-02 03:40:26.237 UTC","last_activity_date":"2011-09-02 05:59:19.53 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"348173","post_type_id":"1","score":"1","tags":"c#|nhibernate|devexpress","view_count":"477"} +{"id":"42118172","title":"How to show a form using Yii2 framwork?","body":"\u003cp\u003eI'm trying to make a simple form using yii2 framework.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/BVk01.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/BVk01.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThis code is in backend/controller/PostController.php :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\nnamespace backend\\controllers;\nuse yii\\web\\Controller;\nuse Yii;\nuse backend\\models\\PostForm;\nclass PostController extends Controller\n{\n public function actionIndex()\n {\n return $this-\u0026gt;render('index');\n }\n public function actionNew()\n {\n $model = new PostForm;\n if($model -\u0026gt; load( Yii::$app -\u0026gt; request-\u0026gt;post() ) \u0026amp;\u0026amp; $model -\u0026gt; validate())\n {\n return $this -\u0026gt; render ('_show' , ['model' , $model]);\n }else\n {\n return $this-\u0026gt;render('_form' , ['model'=\u0026gt;$model]);\n }\n }\n}\n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis one is in backend/models/PostForm.php :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\nnamespace backend\\models; \nuse yii\\base\\Model;\nclass PostForm extends Model\n{\npublic $title;\npublic $content;\npublic $date_add;\npublic function rules()\n{\n return [\n [['title','content','date_add'], 'required '],\n ['date_add' , 'integer']\n ];\n}\n}\n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand this is in backend/views/post/_form.php:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\nuse yii\\widgets\\ActiveForm;\nuse yii\\helpers\\Html;\n?\u0026gt;\n\u0026lt;?php $form = ActiveForm::begin(); ?\u0026gt;\n\u0026lt;? $form -\u0026gt; field($model , 'title') ; ?\u0026gt;\n\u0026lt;? $form -\u0026gt; field($model , 'content') ; ?\u0026gt;\n\u0026lt;? $form -\u0026gt; field($model , 'date_add') ; ?\u0026gt;\n\u0026lt;? Html::submitButton('submit'); ?\u0026gt;\n\u0026lt;?php ActiveForm::end(); ?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut when I type backend.projectname.loc/post/new in my browser the page is shown like this image:\u003c/p\u003e\n\n\u003cp\u003euupload.ir/files/e6xf_screenshot_from_2017-02-08_19:32:15.png\u003c/p\u003e\n\n\u003cp\u003eHow can I fix this?\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2017-02-08 16:12:21.413 UTC","last_activity_date":"2017-02-10 10:34:17.447 UTC","last_edit_date":"2017-02-10 10:34:17.447 UTC","last_editor_display_name":"","last_editor_user_id":"472495","owner_display_name":"","owner_user_id":"7462084","post_type_id":"1","score":"0","tags":"php|forms|yii2|apache2|web-deployment","view_count":"139"} +{"id":"11889562","title":"WebView with BuiltInZoomControls throwing Exceptions and crashing","body":"\u003cp\u003eI am using a WebView with BuiltInZoomControls enabled. I can view the data in WebView properly and also i can use the zoom controls to zoom it. But when i click back to move to previous screen i get Exception and app crashes. ( Other thing it works properly if i don't use zoom controls. i mean zoom controls are enabled in WebView but i have not used, just viewed the WebView content and clicked back.)\u003c/p\u003e\n\n\u003cp\u003eWebView:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emWebView.getSettings().setBuiltInZoomControls(true);\nmWebView.getSettings().setJavaScriptEnabled(true);\nmWebView.getSettings().setPluginsEnabled(true);\nmWebView.getSettings().setDomStorageEnabled(true);\nmWebView.getSettings().setSupportZoom(true);\nmWebView.getSettings().setPluginState(PluginState.ON);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eExceptions:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eActivity com.web.ui.DetailActivity has leaked window android.widget.ZoomButtonsController$Container@4110c4e0 that was originally added here\n.....\n\nFATAL EXCEPTION: main\nE/AndroidRuntime(670): java.lang.IllegalArgumentException: Receiver not registered: android.widget.ZoomButtonsController$1@4110c2d0\n\n....\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd onDestroy of Activity i am also adding this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emWebView.getSettings().setBuiltInZoomControls(false);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny idea what could be the issue. Need help.\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","answer_count":"4","comment_count":"2","creation_date":"2012-08-09 18:17:59.397 UTC","favorite_count":"3","last_activity_date":"2015-02-11 13:11:55.207 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"304107","post_type_id":"1","score":"6","tags":"android|android-webview","view_count":"4352"} +{"id":"19942374","title":"How to display a label when a checkbox is selected in jquery?","body":"\u003cp\u003eI have a checkbox column in a table, and the checkbox tag holds the id of the table cell. When a checkbox is selected, I want the name of the user to be displayed next to the checkbox. The user's name is contained in a label tag that also holds the id of the table cell.\u003c/p\u003e\n\n\u003cp\u003eI have this working, but only when the page is refreshed (so that the value of the userid is being pulled from the database). How do I display the user's name the FIRST time the box is selected? I suspect this needs to be done in jquery, in the function that is handling the checkbox click.\u003c/p\u003e\n\n\u003cp\u003eI have a show/hide for the label tag (for the user's name), and I believe I can put something in this section that puts the value of the user's name into the label?\u003c/p\u003e\n\n\u003cp\u003eIn the database, the value of the checkbox is ReviewedFlg, and the value of the user's name is ReviewedUser.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction reviewchk() {\n var tid = $(this).attr('id');\n var ident = tid.split(\"-\");\n var tabnum = ident[1];\n var ind = tabnum-1;\n var aPos = oTable[ind].fnGetPosition(this);\n var selrow = oTable[ind].fnGetData(aPos[0]);\n var stnum = selrow[0]; //store\n var supnum = selrow[2]; //supplier number\n var invnum = selrow[4]; //invoice number\n var column = aPos[1];\n var usr = ident[3];\n var tdid = ident[2].substring(2);\n var rvalue = 0;\n\n if($(this).find('input:checked').attr('checked')==='checked') {\n rvalue = 1;\n $('#lblchk-'+tabnum+'-'+tdid).show();\n } else { \n rvalue = 0; \n $('#lblchk-'+tabnum+'-'+tdid).hide();\n } \n $.ajax({\n type: 'POST',\n url: 'edit_errorcode.php',\n async: false,\n data: {\n stnum: stnum,\n supnum: supnum,\n invnum: $(invnum).text(),\n all: 'one',\n value: rvalue,\n column: column,\n user: usr\n }\n }); \n\n};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd HTML/PHP:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$reviewcheck = sprintf(\n '\u0026lt;input %s class=\"chkbx\" name=\"reviewchk%s\" id=\"reviewchk-%s-td%s\" type=\"checkbox\"/\u0026gt;\u0026lt;label id=\"lblchk-%s-%s\" class=\"lblchk\"\u0026gt;\u0026amp;nbsp%s\u0026lt;/label\u0026gt;', \n (trim($r['ReviewedFlg'])==='1' ? 'checked=checked' :''),\n $id,\n $id,\n $tdid,\n $id,\n $tdid,\n (trim($r['ReviewedFlg'])==='1' ? $r['ReviewedUser'] :'')\n);\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"19957821","answer_count":"1","comment_count":"0","creation_date":"2013-11-12 23:46:26.163 UTC","last_activity_date":"2013-11-13 15:31:29.863 UTC","last_edit_date":"2013-11-12 23:51:19.51 UTC","last_editor_display_name":"","last_editor_user_id":"2168947","owner_display_name":"","owner_user_id":"2359687","post_type_id":"1","score":"0","tags":"php|jquery","view_count":"80"} +{"id":"10885077","title":"Where can I store this property for use by Maven and Java?","body":"\u003cp\u003eI'm using Maven 3.0.3 and Java 6. I want to put a WSDL URL property somewhere that both the Maven build process can acccess and my runtime Java code (I'm building a Maven JAR project) can also access. How would I structure/configure this? In my runtime Java code, I have something like\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eString wsdlUrl = getProperty(\"wsdl.url\");\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand in Maven, I want to access the WSDL URL in a plugin like so ...\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;plugin\u0026gt;\n \u0026lt;groupId\u0026gt;org.codehaus.mojo\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;jaxws-maven-plugin\u0026lt;/artifactId\u0026gt;\n \u0026lt;executions\u0026gt;\n \u0026lt;execution\u0026gt;\n \u0026lt;goals\u0026gt;\n \u0026lt;goal\u0026gt;wsimport\u0026lt;/goal\u0026gt;\n \u0026lt;/goals\u0026gt;\n \u0026lt;configuration\u0026gt;\n \u0026lt;wsdlUrls\u0026gt;\n \u0026lt;wsdlUrl\u0026gt;${wsdl.url}\u0026lt;/wsdlUrl\u0026gt;\n \u0026lt;/wsdlUrls\u0026gt;\n \u0026lt;sourceDestDir\u0026gt;${basedir}/src/main/java\u0026lt;/sourceDestDir\u0026gt;\n \u0026lt;packageName\u0026gt;org.myco.bsorg\u0026lt;/packageName\u0026gt;\n \u0026lt;/configuration\u0026gt;\n \u0026lt;/execution\u0026gt;\n \u0026lt;/executions\u0026gt;\n \u0026lt;/plugin\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"10887032","answer_count":"3","comment_count":"0","creation_date":"2012-06-04 16:56:42.607 UTC","favorite_count":"2","last_activity_date":"2012-06-04 19:38:30.883 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1423967","post_type_id":"1","score":"4","tags":"java|maven|properties","view_count":"3595"} +{"id":"30347728","title":"Disabling XDebug on Primary Vagrant","body":"\u003cp\u003eIs there any simple/correct way to disable Xdebug in a \u003ca href=\"https://github.com/ChrisWiegman/Primary-Vagrant\" rel=\"nofollow noreferrer\"\u003ePrimary Vagrant\u003c/a\u003e box?\u003c/p\u003e\n\n\u003cp\u003eI tried setting the \u003ca href=\"https://stackoverflow.com/questions/8754826/how-to-disable-xdebug\"\u003exdebug PHP.ini vars\u003c/a\u003e in the /manifests/custom/php.pp puppet file, with no luck. Also commenting the xdebug lines in /manifests/init.pp with no luck either. \u003c/p\u003e\n\n\u003cp\u003eAny other suggestion?\u003c/p\u003e","accepted_answer_id":"36095414","answer_count":"1","comment_count":"0","creation_date":"2015-05-20 11:00:09.557 UTC","last_activity_date":"2016-03-18 22:39:54.843 UTC","last_edit_date":"2017-05-23 12:33:45.133 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"3480821","post_type_id":"1","score":"0","tags":"vagrant|puppet|xdebug","view_count":"453"} +{"id":"6306982","title":"Input mask is not firing in asp.net","body":"\u003cp\u003ei have input mask set for each textbox that is not firing.\u003c/p\u003e\n\n\u003cp\u003ebut script javascript is firing fine.\u003c/p\u003e\n\n\u003cp\u003ecode is copy pasted from another page of same website and page which get copied is working fine\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2011-06-10 13:25:59.683 UTC","last_activity_date":"2011-06-10 13:43:07 UTC","last_edit_date":"2011-06-10 13:43:07 UTC","last_editor_display_name":"","last_editor_user_id":"41956","owner_display_name":"","owner_user_id":"764785","post_type_id":"1","score":"-2","tags":"c#|javascript|.net|asp.net","view_count":"1300"} +{"id":"30776925","title":"Combine js files from different directories via config using grunt","body":"\u003cp\u003eI'm using grunt and sass and I'm looking for a sass-like feature to import any JS file I like to and combine them to 1 file via some config depending on the directory I am in.\u003c/p\u003e\n\n\u003cp\u003eExample directories:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003estartpage\n file1.js\n file2.js\n importjs.json\npage1\n file3.js\n file4.js\n importjs.json\nglobal\n global1.js\n global2.js\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eEach directory besides global is one being used by a single page. Global includes js files used on multiple pages.\u003c/p\u003e\n\n\u003cp\u003eRight now grunt is only combining the js files within a directory. Means file1.js and file2.js is getting combined to startpage.js.\u003c/p\u003e\n\n\u003cp\u003eWhat I want is to have a json/txt/whatever file for each directory to specify the files which I want in my startpage.js.\u003c/p\u003e\n\n\u003cp\u003eLike file1.js, global2.js and page1/file4.js\u003c/p\u003e\n\n\u003cp\u003eIs there a way to accomplish this using grunt? It can also be 1 single config file with an array where I can specify the js files I need for each site. Those files need to be combined and minified. \u003c/p\u003e","accepted_answer_id":"30777462","answer_count":"1","comment_count":"0","creation_date":"2015-06-11 09:34:23.93 UTC","last_activity_date":"2015-06-11 10:02:04.42 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1876473","post_type_id":"1","score":"0","tags":"javascript|gruntjs|npm|minify","view_count":"46"} +{"id":"12677704","title":"Mirror bash shell on smartphone for Rails debugging","body":"\u003cp\u003eI have several shell instances active while working on a Rails app (server, vim, app root shell, etc). I would like to make use of the idle smartphone I have sitting next to my computer, that also has a good SSH client on it. Is there a way I can mirror the output of one of my local machine shells on a remote terminal so that I can quickly monitor when I hit a \u003ccode\u003edebugger\u003c/code\u003e line in my app?\u003c/p\u003e","accepted_answer_id":"12677781","answer_count":"1","comment_count":"0","creation_date":"2012-10-01 16:58:59.633 UTC","favorite_count":"1","last_activity_date":"2012-10-01 17:06:04.843 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1668057","post_type_id":"1","score":"1","tags":"bash|ssh|mirroring","view_count":"102"} +{"id":"17786187","title":"plotting annual time series with pretty labels","body":"\u003cp\u003eI have (macroeconomic) annual data from the \"Penn World Tables\". I'm having problems with the date labels. As you can see below, the dates are expressed as decimals. I've made several attempts to fix it, but failed repeatedly: I turn to you for help.\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/6Ig4b.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eThis occurs, I think, because the \"dates\" (whole numbers like 2000, 2001, etc.) are treated as \u003ccode\u003enumeric\u003c/code\u003e rather than as \u003ccode\u003edates\u003c/code\u003e. \u003cstrong\u003eMy main problem, therefore, is to fix the date format inside the dataframe for easy plotting.\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eIf pwt indicates the name of my dataframe, and year indicates the column that stores the \"dates\", this is what I've tried, with no success:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epwt$year \u0026lt;- strptime(pwt$year, format = \"%Y\")\npwt$year \u0026lt;- as.Date(as.character(pwt$year), format(\"%Y\"), origin = \"1970-01-01\")\npwt$year \u0026lt;- as.Date(pwt$year, format='%Y-01-01', origin = \"1970-01-01\")\npwt$year \u0026lt;- as.yearmon(pwt$year) # requires zoo package\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eReproducible Code\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eLet me now present the data. I will show you steps that should recreate the data.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e### Define directories\n if(.Platform$OS.type == \"windows\"){\n currentdir \u0026lt;- \"c:/R/pwt\"\n } else {\n currentdir \u0026lt;- \"~/R/pwt\"}\n setwd(currentdir)\n\n# download and save data in current directory\ndownload.file(\"http://www.rug.nl/research/GGDC/data/pwt/V80/pwt80.xlsx\", \"pwt80.xlsx\", mode=\"wb\")\n# **Edit** binary mode \"wb\" needed!\n\n# convert and save the data sheet in csv format\nlibrary(gdata)\ninstallXLSXsupport() # support for xlsx format\nDataSheet \u0026lt;- read.xls(\"pwt80.xlsx\", sheet=\"Data\") # load the Data sheet only\nwrite.csv(DataSheet, file=paste(\"pwt80\", \"csv\", sep=\".\"), row.names=FALSE)\n\n# read pwt80.csv data stored in current directory\npwt80 \u0026lt;- read.csv(paste(currentdir, \"pwt80.csv\", sep=\"/\"))\n\n# use -subset- to get specifc countries and variables.\ncountries \u0026lt;- c(\"ESP\", \"ITA\")\nvariables \u0026lt;- c(\"country\", \"countrycode\", \"year\", \"rgdpo\", \"pop\")\npwt \u0026lt;- subset(#\n pwt80\n , countrycode %in% countries\n , select = variables\n)#\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am now interested in plotting the GDP per Capita for the above subsample of countries. So here is some code that intends to do that.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e# Plot data with qplot\nlibrary(ggplot2)\nqp \u0026lt;- qplot(#\n year\n , rgdpo/pop\n , data = subset(pwt80, countrycode %in% countries)\n , geom = \"line\"\n , group = countrycode\n , color = as.factor(countrycode)\n)#\nqp \u0026lt;- qp + \n xlab(\"\") + \n ylab(\"Real GDP Per Capita (international $, 2005 prices, chain)\") + \n theme(legend.title = element_blank()) + \n coord_trans(y = \"log10\")\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eDates look okay at this point, but things start to go wrong when I \"zoom\" with xlim and ylim:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eqp \u0026lt;- qp + xlim(2000,2010) + ylim(22000,35000)\nqp\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe same problem exists if I use ggplot instead of qplot.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e# Plot data with ggplot\nggp \u0026lt;- ggplot(pwt,aes(x=year,y=rgdpo/pop,color=as.factor(countrycode),group=countrycode)) + \n geom_line() \nggp \u0026lt;- ggp + \n xlab(\"\") + \n ylab(\"Real GDP Per Capita (international $, 2005 prices, chain)\") + \n theme(legend.title = element_blank()) + \n coord_trans(y = \"log10\")\nggp\n\nggp \u0026lt;- ggp + xlim(2000,2010) + ylim(22000,35000)\nggp\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT:\u003c/strong\u003e Removed question related to \u003ccode\u003exts\u003c/code\u003e objects. Removed the \u003ccode\u003edput()\u003c/code\u003e to shorten question.\u003c/p\u003e","accepted_answer_id":"17786485","answer_count":"1","comment_count":"0","creation_date":"2013-07-22 11:16:45.087 UTC","last_activity_date":"2013-07-22 17:31:24.537 UTC","last_edit_date":"2013-07-22 17:31:24.537 UTC","last_editor_display_name":"","last_editor_user_id":"1457380","owner_display_name":"","owner_user_id":"1457380","post_type_id":"1","score":"0","tags":"r|ggplot2","view_count":"1448"} +{"id":"32072316","title":"JavaFX wizard for configurations?","body":"\u003cp\u003eI searched in internet for wizard with many steps or many pages but couldn't find a good one.\u003c/p\u003e\n\n\u003cp\u003eBasically looking for a wizard with many levels (atleast 6) example: \u003ca href=\"http://www.java2s.com/Code/Java/Swing-Components/DynamicWizardDialog.htm\" rel=\"nofollow\"\u003ehttp://www.java2s.com/Code/Java/Swing-Components/DynamicWizardDialog.htm\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003ecould someone help me with a good example or snippet to build a good wizard for providing the user to create configurations required for the application? \u003c/p\u003e\n\n\u003cp\u003eexample,\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eLevel 1. DB connection details\nLevel 2. FTP server details\nLevel 3. Directory Mapping details\nLevel 4. Third Party Server details\n...\n...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAlso, i would like to save each level to each configuration file or appending to a single configuration xml for further modifications.\u003c/p\u003e\n\n\u003cp\u003ePlease help me with your thoughts/suggestions.\u003c/p\u003e","answer_count":"1","comment_count":"5","creation_date":"2015-08-18 12:22:27.26 UTC","last_activity_date":"2015-08-19 08:02:36.307 UTC","last_edit_date":"2015-08-18 12:54:48.997 UTC","last_editor_display_name":"","last_editor_user_id":"4021676","owner_display_name":"","owner_user_id":"5146676","post_type_id":"1","score":"0","tags":"java","view_count":"85"} +{"id":"37158093","title":"How to overwrite files in rails using custom generators","body":"\u003cp\u003eI have a custom generator called Datatable, and the file structure is like this :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e lib/generators/datatable/templates\n lib/generators/datatable/templates/datatables.rb\n/lib/generators/datatable/datatable_generator.rb\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThese are my folder structure and my datatable_generator.rb contain :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e class DatatableGenerator \u0026lt; ::Rails::Generators::Base\n desc 'Creates a *_datatable model in the app/datatables directory.'\n source_root File.expand_path('../templates', __FILE__)\n # argument :name, :type =\u0026gt; :string\n argument :name, :type =\u0026gt; :string\n argument :name1, type: :array, default: [], banner: \"action\"\n def generate_datatable\n file_prefix = set_filename(name)\n @datatable_name = set_datatable_name(name)\n template 'datatable.rb', File.join(\n 'app/datatables', \"#{file_prefix}_datatable.rb\"\n )\n copy_file \"stylesheet.css\", \"public/stylesheets/#{file_name}.css\"\n template \"layout.html.erb\", \"app/views/#{file_name}s/index.html.erb\"\n end\n\n private\n def file_name\n name.underscore\n end\n def set_filename(name)\n name.include?('_') ? name : name.to_s.underscore\n end\n\n def set_datatable_name(name)\n name.include?('_') ? build_name(name) : capitalize(name)\n end\n\n def build_name(name)\n pieces = name.split('_')\n pieces.map(\u0026amp;:titleize).join\n end\n\n def capitalize(name)\n return name if name[0] == name[0].upcase\n name.capitalize\n end\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am trying to find a way by which I need to change the index action of a controller for example I am generating datatable for demo for that I will run this command generate datatable Demo cbc cbdd cbse here demo is a scaffold and in its index action I need to override only index action where I want this :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e def index\n@dis_additive_frequencies = DisAdditiveFrequency.all\n end\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eto be like this :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef index\n respond_to do |format|\n format.html\n format.json { render json:DisAdditiveFrequencieDatatable.new(view_context) }\n end\n end\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs there any method by which I can only edit index action of certain file .\u003c/p\u003e","accepted_answer_id":"37163658","answer_count":"1","comment_count":"0","creation_date":"2016-05-11 09:15:32.173 UTC","last_activity_date":"2016-05-11 13:07:33.87 UTC","last_editor_display_name":"","owner_display_name":"user5236484","post_type_id":"1","score":"0","tags":"ruby-on-rails-4|generator","view_count":"116"} +{"id":"41233504","title":"Why are some images in Bootstrap rows appearing in a checkered pattern?","body":"\u003cp\u003eI am doing a products page using Bootstrap and most of the images appear fine, but the last line on the two bottom rows checker in a smaller screen size.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/E3ONS.jpg\" rel=\"nofollow noreferrer\"\u003eTo let you know what I mean I've included an image here.\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eHere is the code of one of the rows that are not working right:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class= \"row\"\u0026gt;\n\n \u0026lt;div class=\"col-sm-6 col-md-3\"\u0026gt;\n\n \u0026lt;img src=\"images/seasonal_1.jpg\"\u0026gt;\n\n \u0026lt;/div\u0026gt;\n\n \u0026lt;div class=\"col-sm-6 col-md-3\"\u0026gt;\n\n \u0026lt;img src=\"images/seasonal_2.jpg\"\u0026gt;\n\n \u0026lt;/div\u0026gt;\n\n \u0026lt;div class=\"col-sm-6 col-md-3\"\u0026gt;\n\n \u0026lt;img src=\"images/seasonal_3.jpg\"\u0026gt;\n\n \u0026lt;/div\u0026gt;\n\n \u0026lt;div class=\"col-sm-6 col-md-3\"\u0026gt;\n\n \u0026lt;img src=\"images/seasonal_4.jpg\"\u0026gt;\n\n \u0026lt;/div\u0026gt;\n\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-12-20 01:16:20.937 UTC","last_activity_date":"2016-12-20 02:22:18.047 UTC","last_edit_date":"2016-12-20 02:22:18.047 UTC","last_editor_display_name":"","last_editor_user_id":"3155639","owner_display_name":"","owner_user_id":"7076893","post_type_id":"1","score":"0","tags":"html5|twitter-bootstrap|rows","view_count":"25"} +{"id":"2567885","title":"Help with understanding generic relations in Django (and usage in Admin)","body":"\u003cp\u003eI'm building a CMS for my company's website (I've looked at the existing Django solutions and want something that's much slimmer/simpler, and that handles our situation specifically.. Plus, I'd like to learn this stuff better). I'm having trouble wrapping my head around generic relations.\u003c/p\u003e\n\n\u003cp\u003eI have a \u003ccode\u003ePage\u003c/code\u003e model, a \u003ccode\u003eSoftwareModule\u003c/code\u003e model, and some other models that define content on our website, each with their \u003ccode\u003eget_absolute_url()\u003c/code\u003e defined. I'd like for my users to be able to assign any \u003ccode\u003ePage\u003c/code\u003e instance a list of objects, of any type, including other page instances. This list will become that \u003ccode\u003ePage\u003c/code\u003e instance's sub-menu.\u003c/p\u003e\n\n\u003cp\u003eI've tried the following:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass Page(models.Model):\n body = models.TextField()\n links = generic.GenericRelation(\"LinkedItem\")\n\n @models.permalink\n def get_absolute_url(self):\n # returns the right URL\n\nclass LinkedItem(models.Model):\n content_type = models.ForeignKey(ContentType)\n object_id = models.PositiveIntegerField()\n content_object = generic.GenericForeignKey('content_type', 'object_id')\n\n title = models.CharField(max_length=100)\n\n def __unicode__(self):\n return self.title\n\nclass SoftwareModule(models.Model):\n name = models.CharField(max_length=100)\n description = models.TextField()\n\n def __unicode__(self):\n return self.name\n\n @models.permalink\n def get_absolute_url(self):\n # returns the right URL\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis gets me a generic relation with an API to do \u003ccode\u003epage_instance.links.all()\u003c/code\u003e. We're on our way. What I'm not sure how to pull off, is on the page instance's change form, how to create the relationship between that page, and any other extant object in the database. My desired end result: to render the following in a template:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;ul\u0026gt;\n{% for link in page.links.all %}\n \u0026lt;li\u0026gt;\u0026lt;a href='{{ link.content_object.get_absolute_url() }}'\u0026gt;{{ link.title }}\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n{% endfor%}\n\u0026lt;/ul\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eObviously, there's something I'm unaware of or mis-understanding, but I feel like I'm, treading into that area where I don't know what I don't know. What am I missing?\u003c/p\u003e","accepted_answer_id":"2568795","answer_count":"3","comment_count":"0","creation_date":"2010-04-02 16:45:29.56 UTC","last_activity_date":"2010-04-02 19:45:20.813 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3912","post_type_id":"1","score":"0","tags":"django|generic-relations","view_count":"801"} +{"id":"38513358","title":"Load CKEDITOR in angular 2","body":"\u003cp\u003eAlright, for the life of me I can't figure out how to load CKEDITOR in angular 2. \u003c/p\u003e\n\n\u003cp\u003eI have ran \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\"typings install dt~ckeditor --global --save\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eckeditor is located at /lib/ckeditor/ckeditor.js so in my system.config.js in the map section I have:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\"CKEDITOR\": 'lib/ckeditor/ckeditor.js'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003enow I can't figure out how to import this into an angular 2 component.\u003c/p\u003e\n\n\u003cp\u003eI have added a refence tag (/// \u0026lt;reference...\u0026gt;) and the didn't work. I am totally stuck\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eHere is my system.config.js\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e /**\n * System configuration for Angular 2 samples\n * Adjust as necessary for your application needs.\n */\n(function(global) {\n // map tells the System loader where to look for things\n var map = {\n 'app': 'app', // 'dist',\n '@angular': 'node_modules/@angular',\n 'angular2-in-memory-web-api': 'node_modules/angular2-in-memory-web-api',\n 'rxjs': 'node_modules/rxjs',\n 'moment': 'node_modules/moment/moment.js',\n 'ckeditor' : 'node_modules/ckeditor'\n };\n // packages tells the System loader how to load when no filename and/or no extension\n var packages = {\n 'app': { main: 'main.js', defaultExtension: 'js' },\n 'rxjs': { defaultExtension: 'js' },\n 'angular2-in-memory-web-api': { main: 'index.js', defaultExtension: 'js' },\n 'ckeditor': { main:'ckeditor.js', defaultExtension:'js' },\n };\n var ngPackageNames = [\n 'common',\n 'compiler',\n 'core',\n 'forms',\n 'http',\n 'platform-browser',\n 'platform-browser-dynamic',\n 'router',\n 'router-deprecated',\n 'upgrade'\n ];\n // Individual files (~300 requests):\n function packIndex(pkgName) {\n packages['@angular/'+pkgName] = { main: 'index.js', defaultExtension: 'js' };\n }\n // Bundled (~40 requests):\n function packUmd(pkgName) {\n packages['@angular/'+pkgName] = { main: '/bundles/' + pkgName + '.umd.js', defaultExtension: 'js' };\n }\n // Most environments should use UMD; some (Karma) need the individual index files\n var setPackageConfig = System.packageWithIndex ? packIndex : packUmd;\n // Add package entries for angular packages\n ngPackageNames.forEach(setPackageConfig);\n var config = {\n map: map,\n packages: packages\n };\n System.config(config);\n})(this);\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"1","creation_date":"2016-07-21 20:02:06.96 UTC","favorite_count":"1","last_activity_date":"2016-07-22 20:03:41.157 UTC","last_edit_date":"2016-07-22 20:03:41.157 UTC","last_editor_display_name":"","last_editor_user_id":"1112812","owner_display_name":"","owner_user_id":"1112812","post_type_id":"1","score":"0","tags":"javascript|typescript|angular|systemjs","view_count":"2261"} +{"id":"13982834","title":"Undefined reference to Destructor","body":"\u003cp\u003eI have written some code in c++ but when I try to compile, I get a very strange error that I should not have. Here is my code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;iostream\u0026gt;\nusing namespace std;\n#include \"articles.h\"\nint main() {\n // Création des articles\n const Stylo s1 (\"s1\", \"Stylo jade\", \"Watertruc\", 500, \"Noir\");\n const Ramette r1 (\"r1\", \"Ramette haute qualité\", \"Clairefont\", 95, 80);\n // Création des lots (10 % de réduction)\n const Lot l1 (\"l1\", s1, 5, 10);\n cout \u0026lt;\u0026lt; s1 \u0026lt;\u0026lt; \"\\n\" \u0026lt;\u0026lt; r1 \u0026lt;\u0026lt; \"\\n\" \u0026lt;\u0026lt; l1 \u0026lt;\u0026lt; \"\\n\";\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003earticles.h\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#ifndef ARTICLES_H\n#define ARTICLES_H\nusing namespace std;\n#include \u0026lt;string\u0026gt;\n#include \u0026lt;iostream\u0026gt;\n\n\n\n\n\nclass Article\n{\n public:\n string getReference() const ;\n virtual string getDescriptif() const;\n virtual double getPU() const;\n string getMarque() const;\n virtual void Afficher(ostream\u0026amp;) const;\n ~Article();\n\n protected:\n Article(string);\n string reference;\n private:\n\n};\n//ostream\u0026amp; operator\u0026lt;\u0026lt;(ostream\u0026amp; os, const Article\u0026amp; art);\n\nclass ArticleUnitaire : public Article {\n public:\n ArticleUnitaire(string);\n ArticleUnitaire(string, string, string, double);\n string getMarque() const;\n void setMarque(string\u0026amp;);\n double getPU() const;\n void setPU(double\u0026amp;);\n void setDescriptif(string\u0026amp;);\n string getDescriptif() const;\n virtual void Afficher(ostream\u0026amp;) const;\n ~ArticleUnitaire();\n\n protected:\n string marque;\n double pu;\n string descriptif;\n private:\n\n};\ninline ostream\u0026amp; operator\u0026lt;\u0026lt;(ostream\u0026amp; os, const Article\u0026amp; art) {\n art.Afficher(os);\n return os;\n}\n\n\n\nclass Stylo : public ArticleUnitaire {\n public:\n Stylo(string, string, string, double, string);\n virtual void Afficher(ostream\u0026amp;) const;\n string getCouleur() const;\n ~Stylo();\n protected:\n private:\n string couleur;\n\n};\n\nclass Ramette : public ArticleUnitaire {\n public:\n Ramette(string, string, string, double, int);\n virtual void Afficher(ostream\u0026amp;) const;\n int getGrammage() const;\n ~Ramette();\n protected:\n private:\n int grammage;\n};\n\nclass Lot : public Article {\n public:\n Lot(string, Article, int, int);\n double getPU() const;\n string getDescriptif() const;\n string getMarque() const;\n int getNbArticles() const;\n void setNbArticles(int\u0026amp;);\n int getPourcentage() const;\n void setPourcentage(int\u0026amp;);\n Article getArticle() const;\n void setArticle(Article\u0026amp;);\n virtual void Afficher(ostream\u0026amp;) const;\n ~Lot();\n\n\n protected:\n private:\n int nb;\n int pourcentage;\n Article art;\n};\n\n\n#endif // ARTICLES_H\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003earticles.cc\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eusing namespace std;\n#include \u0026lt;typeinfo\u0026gt;\n#include \u0026lt;string\u0026gt;\n#include \u0026lt;sstream\u0026gt;\n#include \"articles.h\"\n\n/* Article */\n\nArticle::Article(string ref) : reference(ref) {};\n\nstring Article::getReference() const {\n return reference;\n}\n\n\nstring Article::getMarque() const {\n return \"Sans marque\";\n}\n\nvoid Article::Afficher(ostream\u0026amp; os) const {\n os \u0026lt;\u0026lt; \" : reference = \" \u0026lt;\u0026lt; getReference() \u0026lt;\u0026lt; \" ; descriptif = \" \u0026lt;\u0026lt; getDescriptif() \u0026lt;\u0026lt; \" ; marque = \" \u0026lt;\u0026lt; getMarque() \u0026lt;\u0026lt; \" ; PU = \" \u0026lt;\u0026lt; getPU();\n}\n\nArticle::~Article() {};\n\n\n/* Article Unitaire */\n\nArticleUnitaire::ArticleUnitaire(string r) : Article(r) {};\n\nArticleUnitaire::ArticleUnitaire(string r, string d, string m, double p) : Article(r), marque(m), descriptif(d), pu(p) {};\n\nstring ArticleUnitaire::getMarque() const {\n return marque;\n}\n\nvoid ArticleUnitaire::setMarque(string\u0026amp; m) {\n marque = m;\n}\n\ndouble ArticleUnitaire::getPU() const {\n return pu;\n}\n\nvoid ArticleUnitaire::setPU(double\u0026amp; p) {\n pu = p;\n}\n\nvoid ArticleUnitaire::setDescriptif(string\u0026amp; d) {\n descriptif = d;\n}\n\nstring ArticleUnitaire::getDescriptif() const {\n return descriptif;\n}\n\nArticleUnitaire::~ArticleUnitaire() {};\n\n/* Stylo */\n\nStylo::Stylo(string r, string d, string m, double p, string c) : ArticleUnitaire(r,d,m,p), couleur(c) {};\n\nstring Stylo::getCouleur() const {\n return couleur;\n}\nvoid Stylo::Afficher(ostream\u0026amp; os) const {\n Article::Afficher(os);Lot\n os \u0026lt;\u0026lt; \" ; couleur = \" \u0026lt;\u0026lt; getCouleur();\n}\n\nStylo::~Stylo() {};\n\n/* Ramette */ \nRamette::Ramette(string r, string d, string m, double p, int g) : ArticleUnitaire(r,d,m,p), grammage(g) {};\n\nint Ramette::getGrammage() const {\n return grammage;\n}\n\nvoid Ramette::Afficher(ostream\u0026amp; os) const {\n Article::Afficher(os);\n os \u0026lt;\u0026lt; \" ; grammage = \" \u0026lt;\u0026lt; getGrammage();\n}\n\nRamette::~Ramette() {};\n\n/* Lot */\n\nLot::Lot(string r, Article a, int n, int p) : Article(r), art(a), nb(n), pourcentage(p) {};\n\ndouble Lot::getPU() const {\n return nb * art.getPU() * (100 - pourcentage) / 100;\n}\n\nstring Lot::getDescriptif() const {\n stringstream sstm;\n sstm \u0026lt;\u0026lt; \"Lot de\" \u0026lt;\u0026lt; nb \u0026lt;\u0026lt; \" *\" \u0026lt;\u0026lt; art.getDescriptif() \u0026lt;\u0026lt; \"* \";\n return sstm.str();\n}\n\nstring Lot::getMarque() const {\n return art.getMarque();\n}\n\nint Lot::getNbArticles() const {\n return nb;\n}\n\nvoid Lot::setNbArticles(int\u0026amp; nbArticles) {\n nb = nbArticles;\n}\n\nint Lot::getPourcentage() const {\n return pourcentage;\n}\n\nvoid Lot::setPourcentage(int\u0026amp; p) {\n pourcentage = p;\n}\n\nArticle Lot::getArticle() const {\n return art;\n}\n\nvoid Lot::setArticle(Article\u0026amp; a) {\n art = a;\n}\n\nvoid Lot::Afficher(ostream\u0026amp; os) const {\n Article::Afficher(os);\n os \u0026lt;\u0026lt; \" ;reduction = \" \u0026lt;\u0026lt; getPourcentage() \u0026lt;\u0026lt; \" ; compose de \" \u0026lt;\u0026lt; getNbArticles() \u0026lt;\u0026lt; \" [\" \u0026lt;\u0026lt; art \u0026lt;\u0026lt; \" ]\";\n}\n\nLot::~Lot() {};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhen I compile:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eg++ -Wall testArticles.cc\n/tmp/ccwWjTWv.o: In function `main':\ntestArticles.cc:(.text+0xe8): undefined reference to `Stylo::Stylo(std::string, std::string, std::string, double, std::string)'\ntestArticles.cc:(.text+0x218): undefined reference to `Ramette::Ramette(std::string, std::string, std::string, double, int)'\ntestArticles.cc:(.text+0x2da): undefined reference to `Lot::Lot(std::string, Article, int, int)'\ntestArticles.cc:(.text+0x307): undefined reference to `Article::~Article()'\ntestArticles.cc:(.text+0x36f): undefined reference to `Lot::~Lot()'\ntestArticles.cc:(.text+0x37b): undefined reference to `Ramette::~Ramette()'\ntestArticles.cc:(.text+0x387): undefined reference to `Stylo::~Stylo()'\ntestArticles.cc:(.text+0x3b4): undefined reference to `Stylo::~Stylo()'\ntestArticles.cc:(.text+0x3e8): undefined reference to `Stylo::~Stylo()'\ntestArticles.cc:(.text+0x41c): undefined reference to `Stylo::~Stylo()'\ntestArticles.cc:(.text+0x450): undefined reference to `Stylo::~Stylo()'\ntestArticles.cc:(.text+0x48c): undefined reference to `Ramette::~Ramette()'\ntestArticles.cc:(.text+0x4c0): undefined reference to `Ramette::~Ramette()'\ntestArticles.cc:(.text+0x4f4): undefined reference to `Ramette::~Ramette()'\ntestArticles.cc:(.text+0x533): undefined reference to `Lot::~Lot()'\ntestArticles.cc:(.text+0x556): undefined reference to `Article::~Article()'\ntestArticles.cc:(.text+0x56a): undefined reference to `Lot::~Lot()'\ntestArticles.cc:(.text+0x57e): undefined reference to `Lot::~Lot()'\ntestArticles.cc:(.text+0x58f): undefined reference to `Ramette::~Ramette()'\ntestArticles.cc:(.text+0x5a0): undefined reference to `Stylo::~Stylo()'\n/tmp/ccwWjTWv.o: In function `Article::Article(Article const\u0026amp;)':\ntestArticles.cc:(.text._ZN7ArticleC2ERKS_[_ZN7ArticleC5ERKS_]+0x17): undefined reference to `vtable for Article'\ncollect2: error: ld returned 1 exit status\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI went online on every possible website, and everybody says the same thing: it looks like I messed up the #include(s). But I have been very carefull, I am sure that it is about something stupid and minor, but it's been 6 hours and I am starting to give up. It is very weird.\u003c/p\u003e","answer_count":"3","comment_count":"10","creation_date":"2012-12-21 00:53:28.953 UTC","last_activity_date":"2012-12-21 01:03:55.067 UTC","last_edit_date":"2012-12-21 00:54:43.257 UTC","last_editor_display_name":"","last_editor_user_id":"1440565","owner_display_name":"","owner_user_id":"1819412","post_type_id":"1","score":"3","tags":"c++|reference|include|undefined|destructor","view_count":"8920"} +{"id":"37830195","title":"Fastest way to get a row using TableAdapter","body":"\u003cp\u003eFrom my TableAdapter SELECT statement, I do a\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eSELECT StudentID FROM dbo.Student WHERE Email = @Email\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eAnd in my .vb code, I call the function out and do a for each loop like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eDim myStudentID As Integer\n\nDim myTable = StudentTableAdapter1.GetStudentID(\"myEmail@mail.com\")\nFor Each myRow As DataRow In myTable.Rows\n myStudentID = myRow.Item(\"StudentID\")\n MessageBox.Show(myStudentID)\nNext\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever I wish to shorten this further. Is there a way to get the row faster?\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2016-06-15 08:36:41.233 UTC","last_activity_date":"2016-06-15 11:20:43.74 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3649364","post_type_id":"1","score":"0","tags":"sql|sql-server|vb.net|datarow|tableadapter","view_count":"36"} +{"id":"28924319","title":"Code example POJO and DTO","body":"\u003cp\u003eI don't understand the difference between POJO and DTO in Java. I have read the article here: \u003ca href=\"https://stackoverflow.com/questions/1425302/what-is-the-difference-between-pojo-plain-old-java-object-and-dto-data-transf\"\u003eWhat is the Difference Between POJO (Plain Old Java Object) and DTO (Data Transfer Object)?\u003c/a\u003e . But I still don't understand the code implementation between them, what makes them different. Can you give the code example for each of them? Thank you so much before!\u003c/p\u003e","answer_count":"3","comment_count":"0","creation_date":"2015-03-08 08:00:07.067 UTC","favorite_count":"2","last_activity_date":"2015-03-08 08:12:31.05 UTC","last_edit_date":"2017-05-23 12:14:57.453 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"4468740","post_type_id":"1","score":"1","tags":"java|dto|pojo","view_count":"612"} +{"id":"45713706","title":"Include bootstrap features into a custom vuejs component","body":"\u003cp\u003eI'm asked to add a new html page to a \u003ca href=\"/questions/tagged/vuejs\" class=\"post-tag\" title=\"show questions tagged \u0026#39;vuejs\u0026#39;\" rel=\"tag\"\u003evuejs\u003c/a\u003e project. This page is already fully developed and is based on \u003ca href=\"/questions/tagged/jquery\" class=\"post-tag\" title=\"show questions tagged \u0026#39;jquery\u0026#39;\" rel=\"tag\"\u003ejquery\u003c/a\u003e and some \u003ca href=\"/questions/tagged/twitter-bootstrap\" class=\"post-tag\" title=\"show questions tagged \u0026#39;twitter-bootstrap\u0026#39;\" rel=\"tag\"\u003etwitter-bootstrap\u003c/a\u003e features.\u003c/p\u003e\n\n\u003cp\u003eI've created a new component.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003enewPage.vue\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;template\u0026gt;\n \u0026lt;div id=\"my-new-page\"\u0026gt;\n ...\n \u0026lt;/div\u0026gt;\n\u0026lt;/template\u0026gt;\n\n\u0026lt;style src=\"path/to/_bootstrap.scss\" lang=\"scss\" scoped\u0026gt;\u0026lt;/style\u0026gt;\n\u0026lt;style src=\"path/to/font-awesome.scss\" lang=\"scss\" scoped\u0026gt;\u0026lt;/style\u0026gt;\n\u0026lt;style src=\"path/to/animate.css\" scoped\u0026gt;\u0026lt;/style\u0026gt;\n\u0026lt;style src=\"path/to/custom/css.css\" scoped\u0026gt;\u0026lt;/style\u0026gt;\n\n\n\u0026lt;script src=\"path/to/custom/js.js\"\u0026gt;\u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003ejs.js\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e import jQuery from 'jquery';\n // Same error even with window.$ = window.jQuery = jQuery;\n import collapse from 'path/to/bootstrap/feature/collapse.js\";\n\n export default {\n created() {\n runjQuery(jQuery);\n },\n };\n\n function runjQuery($) {\n // here is how I thought integrate the jquery script of the new html page\n $(function () {\n ....\n $('#navbar').collapse('hide');\n });\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut this obviously does not work because \u003ccode\u003ecollapse.js\u003c/code\u003e cannot access \u003ccode\u003ejQuery\u003c/code\u003e and I get this error\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eUncaught ReferenceError: jQuery is not defined\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow do I fix this problem?\u003c/p\u003e\n\n\u003cp\u003eGiven that I don't want (if possible) to add bootstrap and jquery globally to my project because this will surely breaks here and there in my other components?\u003c/p\u003e","accepted_answer_id":"45715207","answer_count":"2","comment_count":"4","creation_date":"2017-08-16 12:35:40.567 UTC","last_activity_date":"2017-08-16 13:40:09.953 UTC","last_edit_date":"2017-08-16 12:44:00.5 UTC","last_editor_display_name":"","last_editor_user_id":"1507546","owner_display_name":"","owner_user_id":"1507546","post_type_id":"1","score":"0","tags":"javascript|jquery|twitter-bootstrap|vue.js","view_count":"80"} +{"id":"14306200","title":"updating Rails fixtures during tests","body":"\u003cp\u003eI have a functional test in Rails (it's a Redmine plugin) which is causing me problems:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efixtures :settings\n\ntest 'error is shown on issues#show when issue custom field is not set up' do\n setting = settings(:release_notes)\n setting.value = setting.value.\n update('issue_required_field_id' =\u0026gt; 'garbage')\n #setting.save!\n\n get :show, :id =\u0026gt; '1'\n\n assert_response :success\n assert_select 'div.flash.error',\n :text =\u0026gt; I18n.t(:failed_find_issue_custom_field)\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe Setting model has fields \u003ccode\u003ename\u003c/code\u003e and \u003ccode\u003evalue\u003c/code\u003e; in this particular setting, the value is a hash which is serialised. One of the keys in this hash is \u003ccode\u003eissue_required_field_id\u003c/code\u003e, which is used to find a particular \u003ccode\u003eIssueCustomField\u003c/code\u003e during the show action. If there is no custom field with this ID (which there shouldn't be, because I've set it to the string 'garbage') then it should render a div.flash.error explaining what's happened.\u003c/p\u003e\n\n\u003cp\u003eUnfortunately when \u003ccode\u003esetting.save!\u003c/code\u003e is commented out, the test fails because the Setting doesn't appear to have been updated -- the working value for that setting (as appears in settings.yml) is used, and the 'div.flash.error' doesn't appear. If I uncomment it, this test passes, but others fail because the change isn't rolled back at the end of the test.\u003c/p\u003e\n\n\u003cp\u003eIs there a way of modifying a fixture like this so that any changes are rolled back at the end of the test?\u003c/p\u003e\n\n\u003cp\u003eNote: \u003ccode\u003eself.use_transactional_fixtures\u003c/code\u003e is definitely set to true in \u003ccode\u003eActiveSupport::TestCase\u003c/code\u003e (and this test case is an \u003ccode\u003eActionController::TestCase\u003c/code\u003e, which is a subclass)\u003c/p\u003e","accepted_answer_id":"15813279","answer_count":"1","comment_count":"0","creation_date":"2013-01-13 17:34:27.51 UTC","last_activity_date":"2013-04-04 13:53:40.37 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1434220","post_type_id":"1","score":"0","tags":"ruby-on-rails|redmine|redmine-plugins","view_count":"168"} +{"id":"5771277","title":"Which Path should i take when making a 2D iPhone game?","body":"\u003cp\u003eI have been looking into Open GL ES, Quartz 2D, a framework called cocos2D and I am not sure what would be the best direction to move forward in when making a 2D game. I am planning on making a pretty simple not to intense game and I am new to game development but not to iphone development. \u003c/p\u003e\n\n\u003cp\u003eWhich would be the easiest to learn? Which one would give the best performance ?\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","accepted_answer_id":"5817524","answer_count":"2","comment_count":"0","creation_date":"2011-04-24 15:04:43.387 UTC","last_activity_date":"2011-04-28 11:00:34.01 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"579072","post_type_id":"1","score":"1","tags":"iphone","view_count":"99"} +{"id":"24067042","title":"Adding a Hyperlink to each of WordPress' Simplicity-Lite featured-box element","body":"\u003cp\u003eI'm building a site for one of my very first clients using \u003ca href=\"http://wordpress.org/themes/simplicity-lite\" rel=\"nofollow\"\u003eWordpress' Simplicity-Lite Theme.\u003c/a\u003e\nI'd like to alter the theme somehow so as to hyperlink my images in the featured-boxes position (Right below the slideshowshow) to open up a page in the same window. \nThe problem is that the images are automatically generated/fetched by a PHP script that picks them up from the media gallery and so one script does it all for all the eight images. \nI want to make each of these images as fetched by PHP link to its own page to add interactivity to my site but I've tried several things including advice that I've received here before but all in vain both in the style.css and the featured-box.php files.\u003cbr\u003e\nBelow is a section of the PHP script in the featured-box.php file that fetches the 8 images and places them in the featured-boxes positions:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div id=\"featured-boxs\"\u0026gt;\n\u0026lt;?php foreach (range(1,8) as $fboxn) { ?\u0026gt;\n\u0026lt;span class=\"featured-box\"\u0026gt; \n\u0026lt;img class=\"box-image\" src=\"\u0026lt;?php echo of_get_option('featured-image' . $fboxn, get_template_directory_uri() . '/images/featured-image' . $fboxn . '.png') ?\u0026gt;\"/\u0026gt;\n\u0026lt;h3\u0026gt;\u0026lt;?php echo of_get_option('featured-title' . $fboxn, 'Simplicity Theme for Small Business'); ?\u0026gt;\u0026lt;/h3\u0026gt;\n\u0026lt;div class=\"content-ver-sep\"\u0026gt;\u0026lt;/div\u0026gt;\u0026lt;br /\u0026gt;\n\u0026lt;p\u0026gt;\u0026lt;?php echo of_get_option('featured-description' . $fboxn , 'The Color changing options of Simplicity will give the WordPress Driven Site an attractive look. Simplicity is super elegant and Professional Responsive Theme which will create the business widely expressed.'); ?\u0026gt;\u0026lt;/p\u0026gt;\n\u0026lt;/span\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is the code in the style.css file that renders the images:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#featured-boxs{padding:0 0 10px;display:block; margin: 0 -30px; text-align:center;}\n.featured-box{width:210px;margin:0 15px 10px; display:inline-block; text-align:left; vertical-align:top;}\n\n.featured-box h3{font-family:Verdana, Geneva, sans-serif;font-weight:100;font- size:15px;color:#555555;}\n#featured-boxs h2{font-family:Verdana, Geneva, sans-serif;font-weight:100;font- size:19px;color:#555555;}\n.featured-box-first{padding:20px 0;width:210px;margin:0;}\n#featured-boxs img.box-image{border:3px solid #EEEEEE;width:202px;height:100px;}\n#featured-boxs img.box-image:hover{box-shadow:0 0 11px 0px #555555;}\n#featured-boxs img.box-icon{width:50px;height:50px;}\nh3.featured-box2{width:140px;float:right;}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"5","creation_date":"2014-06-05 18:02:00.473 UTC","last_activity_date":"2014-06-05 18:02:00.473 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3701993","post_type_id":"1","score":"0","tags":"php|html|css|wordpress","view_count":"109"} +{"id":"46013711","title":"Node.js server stops responding until control c is pressed, works for a while afterwards then repeats this, how can I stop this?","body":"\u003cp\u003eI created a node.js server that runs on AWS EC2 windows server 2016 and is run through cmd, it is used for register, sign in, (connected with a mysql database that is run on the same server) and streaming music.\u003c/p\u003e\n\n\u003cp\u003eThis has occurred when signing in and when trying to stream music, it has basically occurred in both get and post, so I don't think that is the cause. \u003c/p\u003e\n\n\u003cp\u003ethe code in question: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar express = require('express');\nvar jwt = require('jsonwebtoken');\nvar mysql = require('mysql');\nvar randtoken = require('rand-token');\nvar fs = require('fs');\n\nconst app = express();\n\nvar con = mysql.createConnection({\n host: \"localhost\",\n user: \"philip\",\n password: \"blockchain\",\n database: \"blockchainDB\"\n});\n\napp.post('/api/login', function(req, res){\n\n var sql = 'SELECT * FROM users WHERE username = ? AND password = ?';\n var valP = req.headers[\"username\"];\n var valU = req.headers[\"password\"];\n console.log('name: ' + valP, ' pass: ' + valU);\n\n con.query(sql, [valP, valU], function (err, result) {\n if (err) res.json({result: 'Something went wrong (error)'});\n if(result[0] == undefined) res.json({Login: 'Failed!'});\n else{\n console.log(result[0].name);\n const user = { id: result[0].name };\n const token = jwt.sign({ user }, 'blockchain');\n res.json({\n login: 'Success!',\n token: token,\n user: result[0].name\n });\n }\n });\n});\n\napp.post('/api/register', function(req, res){\n //auth user\n var hash = randtoken.generate(16);\n var sql = 'INSERT INTO users (user_id, name, surname, email, dateOfBirth, password,username,cellphone,isActivated,emailHash) VALUES ?';\n var val = [[\n req.headers[\"id\"],\n req.headers[\"fname\"],\n req.headers[\"lname\"],\n req.headers[\"email\"],\n req.headers[\"birthdate\"],\n req.headers[\"password\"],\n req.headers[\"username\"],\n req.headers[\"cellphone\"],\n 0,\n hash\n ]];\n\n con.query(sql, [val], function (err, result) {\n if (err) res.json({\n registered: 'failed',\n error: err\n });\n console.log('inserted val: ' + val);\n var link = hash;\n var emailAddress = req.headers['email'];\n var email = require('./app/email')(link,emailAddress);\n res.json({\n registered: 'Success!'\n });\n });\n});\n\napp.get('/api/protected', ensureToken, function(req, res){\n jwt.verify(req.token, 'blockchain', function(err, data){\n if(err){\n res.sendStatus(403);\n }\n else {\n var sql = 'SELECT name, surname FROM users WHERE NOT name IS NULL;';\n con.query(sql, function (err, result, fields, rows){\n if (err) res.json({\n result: err\n });\n res.json({\n result: result\n });\n });\n }\n })\n});\n\napp.get('/music', function(req,res){\n\n var songName = req.query.song;\n var songAlbum = req.query.album;\n var songArtist = req.query.artist;\n var file = __dirname + '/music/' + songArtist + '/' + songAlbum + '/' + songName + '.mp3';\n fs.exists(file,function(exists){\n if(exists)\n {\n var rstream = fs.createReadStream(file);\n rstream.pipe(res);\n }\n else\n {\n res.send(\"Its a 404\");\n res.end();\n }\n\n });\n});\n\n\nfunction ensureToken(req, res, next){\n const bearerHeader = req.headers[\"authentication\"];\n if(typeof bearerHeader !== 'undefined'){\n const bearer = bearerHeader.split(\" \");\n const bearerToken = bearer[1];\n req.token = bearerToken;\n next();\n }\n else {\n res.sendStatus(403);\n }\n}\n\napp.listen(8080, function(){\n console.log('App is listening on port 8080!');\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt works perfectly fine when, as stated above, and it seems to happen at totally random times, I'm still fairly new to node.js, so any help would be much appreciated. \u003c/p\u003e","answer_count":"0","comment_count":"7","creation_date":"2017-09-02 12:20:32.607 UTC","last_activity_date":"2017-09-02 12:20:32.607 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2890149","post_type_id":"1","score":"0","tags":"javascript|mysql|node.js|amazon-web-services","view_count":"25"} +{"id":"15627364","title":"Does tinyMCE link list need to be generated by an external file","body":"\u003cp\u003eI'm trying to populate a link list in tinyMCE, but the values need to change depending on what the user has inputted in some other form fields. An array is already getting populated on the page that contains these value so wondered if it's possible to use this instead of populating with the external file like described here:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://www.tinymce.com/wiki.php/Configuration:external_link_list_url\" rel=\"nofollow\"\u003ehttp://www.tinymce.com/wiki.php/Configuration:external_link_list_url\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eEDIT\u003c/p\u003e\n\n\u003cp\u003eSo is there an alternative to 'external_link_list_url'. Say for example 'external_link_list_var'\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etinyMCE.init({\n ...\n external_link_list_url : \"myexternallist.js\"\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ei'd have\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etinyMCE.init({\n ...\n external_link_list_var : SomeVar\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf not i guess one way to do it would be to pass the values via a query string to a php file.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-03-26 00:36:39.017 UTC","last_activity_date":"2013-03-26 10:19:08.417 UTC","last_edit_date":"2013-03-26 10:19:08.417 UTC","last_editor_display_name":"","last_editor_user_id":"940861","owner_display_name":"","owner_user_id":"940861","post_type_id":"1","score":"2","tags":"javascript|tinymce","view_count":"644"} +{"id":"24276600","title":"What is the equivalent of BluetoothSocket for iOS?","body":"\u003cp\u003eI would like to transfer files between my bluetooth device and iphone.\nIs there something similar to \u003ca href=\"http://developer.android.com/reference/android/bluetooth/BluetoothSocket.html\" rel=\"nofollow\"\u003eandroid.bluetooth.BluetoothSocket\u003c/a\u003e on the iOS platform?\u003c/p\u003e\n\n\u003cp\u003eSome code samples on connecting to the bluetooth socket will be greatly appreciated.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-06-18 03:30:25.957 UTC","favorite_count":"1","last_activity_date":"2014-06-18 09:16:44.843 UTC","last_edit_date":"2014-06-18 09:16:44.843 UTC","last_editor_display_name":"","last_editor_user_id":"949714","owner_display_name":"","owner_user_id":"731998","post_type_id":"1","score":"2","tags":"android|ios|bluetooth","view_count":"1553"} +{"id":"35186011","title":"How to get records that must match multiple values from same column field in Crystal Reports","body":"\u003cp\u003eI am running Crystal Reports version XI. I have a table \"PatientRecords\", which has the following columns name, dob, health programs, address etc. I want to return all the patient's names where health programs they only have APS or they have APS and TCS. A patient may appear multiple times in the table with different health programs. All the possible health programs are APS, TCS, SELF and/or SPARK. \u003c/p\u003e\n\n\u003cp\u003eIn crystal reports record formula, i tried to type:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{PatientRecords.coverage} = \"APS\" or\n({PatientRecords.coverage} = \"APS\" and {PatientRecords.coverage}=\"TCS\")\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis gives me only people with APS only programs but it doesn't return any patients that have both APS and TCS. How do I get Crystal Reports to return the correct data?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSample data: \n John Smith, 03-21-1976, APS, 123 Test Way, Visit 1\n Jane Murai, 02-15-1965, TCS, 2312 Apple Way, Visit 1\n Richard Sams, 05-30-1985, APS, 33 Bans Way, Visit 1\n John Smith, 03-21-1976, TCS, 123 Test Way, Visit 2\n Jane Murai, 02-15-1965, APS, 2312 Apple Way, Visit 2\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo each patient visit is a record and each record can have different coverages, either APS, TCS, SELF or SPARK. So a person can appear MULTIPLE times, but with different coverages.\u003c/p\u003e","answer_count":"2","comment_count":"1","creation_date":"2016-02-03 19:31:35.307 UTC","last_activity_date":"2016-02-04 06:06:44.85 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1339817","post_type_id":"1","score":"0","tags":"crystal-reports|crystal-reports-xi","view_count":"618"} +{"id":"30438887","title":"Load content into tab at runtime on click using QTabWidget","body":"\u003cp\u003eSo I have this code in a file \u003ccode\u003eAnalysisDisplays.cpp\u003c/code\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evoid AnalysisDisplays::showAnalysisDisplays(QWidget *parent) {\n\n QMainWindow *mw = new QMainWindow(parent);\n\n mw-\u0026gt;setWindowTitle(\"Equity Strategy Analysis\");\n mw-\u0026gt;setMinimumSize(750, 700);\n\n QTabWidget *tabw = new QTabWidget(mw);\n mw-\u0026gt;setCentralWidget(tabw);\n\n for (QListWidgetItem *wi: listItems) {\n if (wi-\u0026gt;checkState()) {\n std::string eqType = wi-\u0026gt;text().toStdString();\n\n DisplayAnalysis *dw = new DisplayAnalysis();\n\n displays[currentDisplayId] = dw;\n\n //Add this tab to tab widget\n tabw-\u0026gt;addTab(dw, eqType.c_str());\n\n dw-\u0026gt;setDisplayId(currentDisplayId);\n currentDisplayId++;\n\n //dw-\u0026gt;displayAnalysis(parseCSV-\u0026gt;getDataForEquityType(eqType));\n }\n }\n\n //Show the main window\n mw-\u0026gt;show();\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe issue is that we may create many tabs which is super slow. The commented out line is what I want to run at runtime. The issue is I am currently making a QMainWindow and a QTabWidget and forgetting about it. I need to somehow hook an event to the QTabWidget so whenever a tab object (DisplayAnalysis) \u003ccode\u003edw\u003c/code\u003e is clicked, it will call \u003ccode\u003edw-\u0026gt;displayAnalysis(parseCSV-\u0026gt;getDataForEquityType(eqType));\u003c/code\u003e where eqType is the title of the tab. This will result in the tab content being populated.\u003c/p\u003e\n\n\u003cp\u003eThere can be multiple windows open that call \u003ccode\u003eshowAnalysisDisplays\u003c/code\u003e and they may contain different number of tabs. So each window has its own \u003ccode\u003eQMainWindow\u003c/code\u003e and \u003ccode\u003eQTabWidget\u003c/code\u003e but the \u003ccode\u003eparseCSV\u003c/code\u003e pointer remains the same.\u003c/p\u003e\n\n\u003cp\u003eSo how can I hook an event to each tab like this, taking into account that there may be multiple windows open which need to load content at runtime when a tab is clicked?\u003c/p\u003e","accepted_answer_id":"30439551","answer_count":"1","comment_count":"1","creation_date":"2015-05-25 12:56:04.197 UTC","last_activity_date":"2015-05-25 14:25:44.497 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1800854","post_type_id":"1","score":"1","tags":"c++|qt|qtabwidget","view_count":"151"} +{"id":"37291889","title":"NodeJs deployment on remote server","body":"\u003cp\u003eI've an existing NodeJS application developed and the builds are running on Jenkins . Can anyone help me know on how to deploy the application on remote server and how the packaging is done for node js.\u003c/p\u003e\n\n\u003cp\u003eI've a requirement for automated deployment for node js application . So want to know the tools and process to do deployment . how to move forward after jenkins build .\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-05-18 06:31:27.733 UTC","last_activity_date":"2016-05-18 06:43:02.777 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6315510","post_type_id":"1","score":"0","tags":"node.js|jenkins|deployment","view_count":"497"} +{"id":"44806362","title":"Protobuf serialization length differs when using different values for field","body":"\u003cp\u003eMy Protobuf message consists of 3 doubles\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esyntax = \"proto3\";\n\nmessage TestMessage{\n double input = 1;\n double output = 2;\n double info = 3;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I set these values to\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etest.set_input(2.3456);\ntest.set_output(5.4321);\ntest.set_info(5.0);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethe serialized message looks like\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e00000000 09 16 fb cb ee c9 c3 02 40 11 0a 68 22 6c 78 ba |........@..h\"lx.|\n00000010 15 40 19 |.@.|\n00000013\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhen using \u003ccode\u003etest.serializeToArray\u003c/code\u003e and could not be deserialized successfully by a go program using the same protobuf message. When trying to read it from a c++ program I got a 0 as info, so the message seems to be corrupted.\u003c/p\u003e\n\n\u003cp\u003eWhen using \u003ccode\u003etest.serializeToOstream\u003c/code\u003e I got this message, which could be deserialized successfully by both go and c++ programs.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e00000000 09 16 fb cb ee c9 c3 02 40 11 0a 68 22 6c 78 ba |........@..h\"lx.|\n00000010 15 40 19 00 00 00 00 00 00 14 40 |.@........@|\n0000001b\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen setting the values to\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etest.set_input(2.3456);\ntest.set_output(5.4321);\ntest.set_info(5.5678);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethe serialized messages, both produced by \u003ccode\u003etest.serializeToArray\u003c/code\u003e and \u003ccode\u003etest.serializeToOstream\u003c/code\u003e look like\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e00000000 09 16 fb cb ee c9 c3 02 40 11 0a 68 22 6c 78 ba |........@..h\"lx.|\n00000010 15 40 19 da ac fa 5c 6d 45 16 40 |.@....\\mE.@|\n0000001b\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand could be successfully read by my go and cpp program.\u003c/p\u003e\n\n\u003cp\u003eWhat am I missing here? Why is \u003ccode\u003eserializeToArray\u003c/code\u003e not working in the first case?\u003c/p\u003e\n\n\u003cp\u003eEDIT:\nAs it turns out, serializeToString works fine, too.\u003c/p\u003e\n\n\u003cp\u003eHere the code I used for the comparison:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efile_a.open(FILEPATH_A);\nfile_b.open(FILEPATH_B);\n\ntest.set_input(2.3456);\ntest.set_output(5.4321);\ntest.set_info(5.0);\n\n//serializeToArray\nint size = test.ByteSize();\nchar *buffer = (char*) malloc(size);\ntest.SerializeToArray(buffer, size);\nfile_a \u0026lt;\u0026lt; buffer;\n\n//serializeToString\nstd::string buf;\ntest.SerializeToString(\u0026amp;buf);\nfile_b \u0026lt;\u0026lt; buf;\n\nfile_a.close();\nfile_b.close();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhy does serializeToArray not work as expected?\u003c/p\u003e\n\n\u003cp\u003eEDIT2:\u003c/p\u003e\n\n\u003cp\u003eWhen using \u003ccode\u003efile_b \u0026lt;\u0026lt; buf.data()\u003c/code\u003e instead of \u003ccode\u003efile_b \u0026lt;\u0026lt; buf.data()\u003c/code\u003e, the data gets corrupted as well, but why?\u003c/p\u003e","accepted_answer_id":"44807928","answer_count":"1","comment_count":"5","creation_date":"2017-06-28 15:08:31.853 UTC","last_activity_date":"2017-06-28 16:24:11.633 UTC","last_edit_date":"2017-06-28 16:10:01.587 UTC","last_editor_display_name":"","last_editor_user_id":"2715675","owner_display_name":"","owner_user_id":"2715675","post_type_id":"1","score":"1","tags":"c++|serialization|go|protocol-buffers","view_count":"69"} +{"id":"7144857","title":"How to get list of search results of location like in google maps","body":"\u003cp\u003eI am developing an application in which when the I enters an address ,I fetch latitude and longitude of that address and drop the pin.\nBut what I want is like I enter any business or address then a list of that search comes in google maps and multiple pins are dropped for that address.\nI also want this feature to get include in my app but when I pass my address only one location comes not a list like it comes in google maps.\nPlease help me if anybody knows how google maps searches a couple of locations for that address\u003c/p\u003e\n\n\u003cp\u003eex:- caribou coffee, chapel hil\u003c/p\u003e\n\n\u003cp\u003eAny suggestion will be highly appreciated\nThanks in advance!\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2011-08-22 08:34:55.01 UTC","last_activity_date":"2011-08-22 10:42:31.967 UTC","last_edit_date":"2011-08-22 10:06:25.06 UTC","last_editor_display_name":"","last_editor_user_id":"633676","owner_display_name":"","owner_user_id":"633676","post_type_id":"1","score":"0","tags":"iphone|objective-c|google-maps|mkmapview","view_count":"584"} +{"id":"46070532","title":"Toolbar title is not displaying","body":"\u003cp\u003eToolbar title is not showing in both cases either collapsed or not. Below is my layout\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" encoding=\"utf-8\"?\u0026gt;\n\u0026lt;android.support.design.widget.CoordinatorLayout\n xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n xmlns:tools=\"http://schemas.android.com/tools\"\n android:id=\"@+id/coordinatorLayout\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"match_parent\"\n android:fitsSystemWindows=\"true\"\u0026gt;\n\n \u0026lt;android.support.design.widget.AppBarLayout\n android:id=\"@+id/appBarLayout\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\"\n android:theme=\"@style/ThemeOverlay.AppCompat.Dark.ActionBar\"\n android:background=\"@android:color/transparent\"\n android:fitsSystemWindows=\"true\"\u0026gt;\n\n \u0026lt;android.support.design.widget.CollapsingToolbarLayout\n android:id=\"@+id/collapsing_toolbar\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"@dimen/collapsing_toolbar_height\"\n app:layout_scrollFlags=\"scroll|exitUntilCollapsed\"\n app:contentScrim=\"?attr/colorPrimary\"\n app:expandedTitleTextAppearance=\"@android:color/transparent\"\n android:fitsSystemWindows=\"true\"\u0026gt;\n\n \u0026lt;ImageView\n android:id=\"@+id/header_image\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"@dimen/collapsing_toolbar_height\"\n android:scaleType=\"centerCrop\"\n android:fitsSystemWindows=\"true\"\n android:contentDescription=\"@string/app_name\"\n android:src=\"@mipmap/ic_launcher\"\n app:layout_collapseMode=\"parallax\"/\u0026gt;\n\n \u0026lt;android.support.v7.widget.Toolbar\n android:id=\"@+id/toolbar\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"?attr/actionBarSize\"\n app:popupTheme=\"@style/ThemeOverlay.AppCompat.Light\"\n android:title=\"@string/app_name\"\n app:layout_collapseMode=\"pin\" /\u0026gt;\n\n \u0026lt;/android.support.design.widget.CollapsingToolbarLayout\u0026gt;\n\n \u0026lt;/android.support.design.widget.AppBarLayout\u0026gt;\n\n\n\n \u0026lt;android.support.v4.widget.NestedScrollView\n android:id=\"@+id/scroll\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\"\n android:clipToPadding=\"false\"\n android:layout_marginBottom=\"100dp\"\n app:layout_behavior=\"@string/appbar_scrolling_view_behavior\"\u0026gt;\n\n \u0026lt;RelativeLayout\n android:id=\"@+id/rlMain\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"match_parent\"\u0026gt;\n\n \u0026lt;FrameLayout\n android:id=\"@+id/container\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\"\u0026gt;\u0026lt;/FrameLayout\u0026gt;\n\n\n \u0026lt;/RelativeLayout\u0026gt;\n\n\n\n \u0026lt;/android.support.v4.widget.NestedScrollView\u0026gt;\n\n \u0026lt;RelativeLayout\n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\"\u0026gt;\n \u0026lt;android.support.design.widget.BottomNavigationView\n android:id=\"@+id/bottom_navigation\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\"\n android:layout_alignParentBottom=\"true\"\n app:itemBackground=\"@color/faint_black\"\n app:itemIconTint=\"@color/white\"\n app:itemTextColor=\"@color/menu_item_color_change\"\n app:menu=\"@menu/menu\" /\u0026gt;\n \u0026lt;/RelativeLayout\u0026gt;\n\n\n\n\n\u0026lt;/android.support.design.widget.CoordinatorLayout \u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"5","comment_count":"0","creation_date":"2017-09-06 08:40:16.61 UTC","last_activity_date":"2017-09-06 10:01:21.997 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4390557","post_type_id":"1","score":"1","tags":"android|android-toolbar|android-coordinatorlayout|android-appbarlayout|android-collapsingtoolbar","view_count":"137"} +{"id":"403481","title":"What is a good vector library for Cocoa or Cocoa-touch?","body":"\u003cp\u003eI'm looking for a good vector library for displaying animated graphics on the iPhone. Something that could possibly display SVG. Anyone have any ideas or insights?\u003c/p\u003e","accepted_answer_id":"403787","answer_count":"6","comment_count":"0","creation_date":"2008-12-31 17:01:16.54 UTC","favorite_count":"4","last_activity_date":"2013-02-12 22:41:40.883 UTC","last_edit_date":"2009-01-01 13:15:58.223 UTC","last_editor_display_name":"Ben Gottlieb","last_editor_user_id":"6694","owner_display_name":"Tim","owner_user_id":"387361","post_type_id":"1","score":"2","tags":"iphone|cocoa-touch|vector-graphics","view_count":"5266"} +{"id":"10210062","title":"Compare 2 files and remove any lines in file2 when they match values found in file1","body":"\u003cp\u003eI have two files. i am trying to remove any lines in file2 when they match values found in file1. One file has a listing like so:\u003c/p\u003e\n\n\u003cp\u003eFile1\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eZNI008\nZNI009\nZNI010\nZNI011\nZNI012\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e... over 19463 lines \u003c/p\u003e\n\n\u003cp\u003eThe second file includes lines that match the items listed in first:\nFile2\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecopy /Y \\\\server\\foldername\\version\\20050001_ZNI008_162635.xml \\\\server\\foldername\\version\\folder\\\ncopy /Y \\\\server\\foldername\\version\\20050001_ZNI010_162635.xml \\\\server\\foldername\\version\\folder\\\ncopy /Y \\\\server\\foldername\\version\\20050001_ZNI012_162635.xml \\\\server\\foldername\\version\\folder\\\ncopy /Y \\\\server\\foldername\\version\\20050001_ZNI009_162635.xml \\\\server\\foldername\\version\\folder\\\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e... continues listing until line 51360 \u003c/p\u003e\n\n\u003cp\u003eWhat I've tried so far:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003egrep -v -i -f file1.txt file2.txt \u0026gt; f3.txt\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003edoes not produce any output to \u003ccode\u003ef3.txt\u003c/code\u003e or remove any lines. I verified by running\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ewc -l file2.txt\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand the result is\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e51360 file2.txt\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI believe the reason is that there are no exact matches. When I run the following it shows nothing\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecomm -1 -2 file1.txt file2.txt\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eRunning \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e( tr '\\0' '\\n' \u0026lt; file1.txt; tr '\\0' '\\n' \u0026lt; file2.txt ) | sort | uniq -c | egrep -v '^ +1'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eshows only one match, even though I can clearly see there is more than one match.\u003c/p\u003e\n\n\u003cp\u003eAlternatively putting all the data into one file and running the following:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003egrep -Ev \"$(cat file1.txt)\" 1\u0026gt;LinesRemoved.log\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003esays argument has too many lines to process.\u003c/p\u003e\n\n\u003cp\u003eI need to remove lines matching the items in file1 from file2.\u003c/p\u003e\n\n\u003cp\u003ei am also trying this in python: \n `\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e #!/usr/bin/python\ns = set()\n\n# load each line of file1 into memory as elements of a set, 's'\nf1 = open(\"file1.txt\", \"r\")\nfor line in f1:\n s.add(line.strip())\nf1.close()\n\n# open file2 and split each line on \"_\" separator,\n# second field contains the value ZNIxxx\nf2 = open(\"file2.txt\", \"r\")\nfor line in f2:\n if line[0:4] == \"copy\":\n fields = line.split(\"_\")\n # check if the field exists in the set 's'\n if fields[1] not in s:\n match = line\n else:\n match = 0\n else:\n if match:\n print match, line,\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e`\u003c/p\u003e\n\n\u003cp\u003eit is not working well.. as im getting \n'Traceback (most recent call last):\n File \"./test.py\", line 14, in ?\n if fields[1] not in s:\nIndexError: list index out of range'\u003c/p\u003e","answer_count":"4","comment_count":"5","creation_date":"2012-04-18 13:09:23.05 UTC","last_activity_date":"2012-04-18 22:16:04.05 UTC","last_edit_date":"2012-04-18 14:41:58.337 UTC","last_editor_display_name":"","last_editor_user_id":"1341344","owner_display_name":"","owner_user_id":"1341344","post_type_id":"1","score":"1","tags":"python|bash|sed|awk|grep","view_count":"2851"} +{"id":"6705429","title":"Wake up a QThread that is in sleep?","body":"\u003cp\u003eHow can I wake up a QThread when it is sleeping?\u003c/p\u003e\n\n\u003cp\u003eI have a thread that is running in the background and now and then wakes up and does some small stuff, however if I would like to stop that thread in a controlled manner I have to wait for him to wake up by him self in order to make him quit. And since he is sleeping quite long this can be quite annoying.\u003c/p\u003e\n\n\u003cp\u003eHere is a little example code that show the basic problem.\u003c/p\u003e\n\n\u003cp\u003eLet's start with the thread that in this example sleeps for 5 seconds and then just prints a dot.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;QDebug\u0026gt;\n#include \"TestThread.h\"\n\nvoid TestThread::run()\n{\n running = true;\n while(running == true)\n {\n qDebug() \u0026lt;\u0026lt; \".\";\n QThread::sleep(5);\n }\n qDebug() \u0026lt;\u0026lt; \"Exit\";\n}\n\nvoid TestThread::stop()\n{\n running = false;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThen we have the main that starts the thread and then kills him.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;QDebug\u0026gt;\n#include \"TestThread.h\"\n\nint main(int argc, char *argv[])\n{\n qDebug() \u0026lt;\u0026lt; \"Start test:\";\n TestThread *tt = new TestThread();\n\n tt-\u0026gt;start();\n sleep(2);\n tt-\u0026gt;stop();\n tt-\u0026gt;wait();\n\n delete tt; \n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe problem is that the tt-\u003ewait(); must wait the 5s that the thread is sleeping.\nCan I just call something like a \"wakeup from sleep\" so he can continue.\u003c/p\u003e\n\n\u003cp\u003eOr is there a better way to do this? \u003c/p\u003e\n\n\u003cp\u003e/Thanks\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003e\u003cstrong\u003eUpdate\u003c/strong\u003e I got it working with a QMutex and the tryLock:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;QDebug\u0026gt;\n#include \"TestThread.h\"\n\nQMutex sleepMutex; \n\nvoid TestThread::run()\n{\n qDebug() \u0026lt;\u0026lt; \"Begin\";\n //1. Start to lock\n sleepMutex.lock(); \n //2. Then since it is locked, we can't lock it again\n // so we timeout now and then.\n while( !sleepMutex.tryLock(5000) )\n {\n qDebug() \u0026lt;\u0026lt; \".\";\n }\n //4. And then we cleanup and unlock the lock from tryLock.\n sleepMutex.unlock();\n qDebug() \u0026lt;\u0026lt; \"Exit\";\n}\n\nvoid TestThread::stop()\n{\n //3. Then we unlock and allow the tryLock \n // to lock it and doing so return true to the while \n // so it stops.\n sleepMutex.unlock();\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut would it be better to use the QWaitCondition? Or is it the same?\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003e\u003cstrong\u003eUpdate\u003c/strong\u003e: The QMutex breaks if it is not the same tread that starts and stop him, \nso here is a try with QWaitCondition.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;QDebug\u0026gt;\n#include \u0026lt;QWaitCondition\u0026gt;\n#include \"TestThread.h\"\n\nQMutex sleepMutex; \n\nvoid TestThread::run()\n{\n qDebug() \u0026lt;\u0026lt; \"Begin\";\n\n running = true;\n sleepMutex.lock(); \n while( !waitcondition.wait(\u0026amp;sleepMutex, 5000) \u0026amp;\u0026amp; running == true )\n {\n qDebug() \u0026lt;\u0026lt; \".\";\n }\n qDebug() \u0026lt;\u0026lt; \"Exit\";\n}\n\nvoid TestThread::stop()\n{\n running = false;\n waitcondition.wakeAll();\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"6705470","answer_count":"2","comment_count":"0","creation_date":"2011-07-15 10:03:32.973 UTC","favorite_count":"1","last_activity_date":"2014-04-03 18:17:25.407 UTC","last_edit_date":"2011-07-15 11:56:01.973 UTC","last_editor_display_name":"","last_editor_user_id":"51425","owner_display_name":"","owner_user_id":"51425","post_type_id":"1","score":"7","tags":"c++|qt|qthread","view_count":"4518"} +{"id":"39648773","title":"Secrecy of Firebase Cloud Messaging Server Key","body":"\u003cp\u003eI'm developing a smart home app that communicates with the smart home system on the local network (or via VPN). I would like to integrate with Firebase Cloud Messaging and would need a server. It's a free app that I don't make any money off, so I don't want to have a server to maintain and keep an eye on.\u003c/p\u003e\n\n\u003cp\u003eI'm thinking that the I could make the server available open-source on GitHub. I want the setup of the server to be as easy as doing a clone and running a single command. That leads me to the question: \u003cstrong\u003eCan I leave my server key for the project in a public repos for others to use or what kind of abuse would that open for?\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI see they (naturally) tell you to keep the server key a secret at \u003ca href=\"https://firebase.google.com/docs/cloud-messaging/server#role\" rel=\"nofollow\"\u003ehttps://firebase.google.com/docs/cloud-messaging/server#role\u003c/a\u003e , but I'm wondering if that would be the case for me when it's okay for others to have their own instance of the server on their LAN where their own devices registers.\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2016-09-22 20:59:02.227 UTC","favorite_count":"2","last_activity_date":"2016-09-25 02:57:02.647 UTC","last_edit_date":"2016-09-23 00:53:20.027 UTC","last_editor_display_name":"","last_editor_user_id":"4625829","owner_display_name":"","owner_user_id":"467650","post_type_id":"1","score":"0","tags":"android|security|firebase-cloud-messaging","view_count":"60"} +{"id":"13403363","title":"How to verify a login using MySqli","body":"\u003cp\u003eI'm trying to create a simple login with php and mysqli but keep receiving the error:\nFatal error: Call to a member function prepare() on a non-object in C:\\wamp\\www\\web2\\database.php on line 107\u003c/p\u003e\n\n\u003cp\u003edatabase.php\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;?php\nclass Database \n{ \n public $server = \"localhost\";\n public $database = \"database\"; \n public $user = \"root\"; \n public $password = \"\"; \n public $row;\n public $result;\n public $sqlExtra = \" ORDER BY firstname ASC\";\n public $dbLocalHost;\n\n\n\n\n\n //call connection method upon constructing \n public function __construct(){\n $this-\u0026gt;createConnection(); \n }\n\n //connection to the database\n public function createConnection() \n { \n $this-\u0026gt;dbLocalhost = new mysqli($this-\u0026gt;server, $this-\u0026gt;user, $this-\u0026gt;password, $this-\u0026gt;database)\n or die(\"could not connect:\");\n\n\n //mysql_select_db($this-\u0026gt;database)\n //\n // or die(\"Could not find the database: \".mysql_error());\n\n\n\n } \n\n\n\n function verifyLogin($email, $password) {\n\n $query = \"SELECT *\n FROM admint\n WHERE email = ?\n AND password = ?\n LIMIT 1\";\n\n 107. $statement = $this-\u0026gt;dbLocalHost-\u0026gt;prepare($query);\n if($statement) {\n $statement-\u0026gt;bind_param('ss', $email, $password);\n $statement-\u0026gt;execute();\n\n if($statement-\u0026gt;fetch()) {\n $statement-\u0026gt;close();\n return true; \n }\n else {\n return false;\n }\n }\n\n }\n\n function addElement($table, $firstName, $lastName, $email, $mobile, $password,\n $faculty, $campus) {\n\n\n\n $query = \"INSERT INTO $table (first_name, last_name, email, mobile, password, faculty, campus_location) \n VALUES('$firstName', '$lastName','$email','$mobile',\n '$password','$faculty','$campus');\";\n\n if($this-\u0026gt;connection-\u0026gt;query($query)) {\n header('location: regConfirm.php'); \n }\n\n }\n\n\n} \n\n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003elogin.php\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;?php\nsession_start();\n\nrequire_once 'admin.php';\n$admin = new Admin();\n\nif(isset($_GET['status']) \u0026amp;\u0026amp; $_GET['status'] == 'loggedout') {\n $admin-\u0026gt;logOut(); \n}\n\n\nif($_POST \u0026amp;\u0026amp; !empty($_POST['email']) \u0026amp;\u0026amp; !empty($_POST['password'])) {\n\n $valid = $admin-\u0026gt;validateUser($_POST['email'], $_POST['password']);\n\n if($valid) {\n header(\"location: index.php\"); \n }\n}\n?\u0026gt;\n\n\u0026lt;!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"\u0026gt;\n\u0026lt;html xmlns=\"http://www.w3.org/1999/xhtml\"\u0026gt;\n\u0026lt;head\u0026gt;\n\u0026lt;meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /\u0026gt;\n\u0026lt;title\u0026gt;Login\u0026lt;/title\u0026gt;\n\u0026lt;/head\u0026gt;\n\n\u0026lt;body\u0026gt;\n\u0026lt;div id=\"login\"\u0026gt;\n \u0026lt;form method=\"post\" action=\"\"\u0026gt;\n \u0026lt;h1\u0026gt;Admin Login\u0026lt;/h1\u0026gt;\n \u0026lt;p\u0026gt;\n Email: \n \u0026lt;input type=\"email\" name=\"email\" /\u0026gt;\n \u0026lt;/p\u0026gt;\n\n \u0026lt;p\u0026gt;\n Password: \n \u0026lt;input type=\"password\" name=\"password\" /\u0026gt;\n \u0026lt;/p\u0026gt;\n\n \u0026lt;p\u0026gt;\n \u0026lt;input type=\"submit\" value=\"Login\" name=\"Submit\" /\u0026gt;\n \u0026lt;/p\u0026gt;\n\n \u0026lt;/form\u0026gt;\n\n\u0026lt;/div\u0026gt;\n\n\u0026lt;/body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eadmin.php\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;?php\n\n/*\n * To change this template, choose Tools | Templates\n * and open the template in the editor.\n */\n\n/**\n * Description of admin\n *\n * @author Matt\n */\nrequire 'database.php';\nclass admin {\n\n function logOut() {\n if(isset($_SESSION['status'])) {\n unset($_SESSION['status']);\n\n if(isset($_COOKIE[session_name()])) {\n setcookie(session_name(), '', time() - 1000);\n session_destroy(); \n }\n }\n }\n\n function validateUser($email, $password) {\n $db = new Database();\n\n $verified = $db-\u0026gt;verifyLogin($email, $password);\n\n if($verified) {\n $_SESSION['status'] = 'authorised';\n //header(\"location: index.php\");\n return true; \n }\n else {\n return false; \n }\n }\n\n function confirmAdmin() {\n session_start();\n if($_SESSION['status'] != 'authorised')\n header(\"location: login.php\"); \n }\n}\n\n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003esorry to be a bother, thanks.\u003c/p\u003e","accepted_answer_id":"13403552","answer_count":"2","comment_count":"2","creation_date":"2012-11-15 17:55:54.943 UTC","last_activity_date":"2012-11-15 18:08:35.103 UTC","last_edit_date":"2012-11-15 18:05:13.627 UTC","last_editor_display_name":"","last_editor_user_id":"1816869","owner_display_name":"","owner_user_id":"1816869","post_type_id":"1","score":"0","tags":"php|mysqli","view_count":"1209"} +{"id":"39166210","title":"Z3 Output of get-value","body":"\u003cp\u003eI have a problem with the generation of model values through get-value.\nIf I try to get the value of an array, I will get a value\ncontaining internal z3 constants which are not printed. I know that\nget-model would print those constants but I would like to stick\nto using get-value.\u003c/p\u003e\n\n\u003cp\u003eHere is an example (I tried it on rise4fun):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e(declare-const b (Array Int Int))\n(declare-const a (Array Int Int))\n(assert (= (store a 1 2) b))\n(check-sat)\n(get-value (b a))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ereturns:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esat ((b (_ as-array k!1)) (a (_ as-array k!0)))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe output with get-model is the following:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esat (model (define-fun b () (Array Int Int) (_ as-array k!1)) (define-fun a () (Array Int Int) (_ as-array k!0)) (define-fun k!0 ((x!1 Int)) Int 0) (define-fun k!1 ((x!1 Int)) Int (ite (= x!1 1) 2 0)) )\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt contains the value of k!0 and k!1. Is it possible to substitute these in the values for a and b ?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-08-26 12:20:11.697 UTC","last_activity_date":"2016-08-26 12:42:20.837 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6761153","post_type_id":"1","score":"0","tags":"z3","view_count":"158"} +{"id":"30042724","title":"need Help dokan and c# creating virtual disk","body":"\u003cp\u003eI want to create virtual disk using c# and dokan and I need code hint or api for or I want to know how to work with them because when I search on google I didn,t to find and result\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-05-05 01:18:34.647 UTC","last_activity_date":"2015-05-24 08:15:18.553 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4864443","post_type_id":"1","score":"-1","tags":"c#|virtual|dokan|virtual-disk","view_count":"416"} +{"id":"12065522","title":"ModX: Resource alias not automatically inserting slash in URL","body":"\u003cp\u003eA weird one: I have a site using ModX and this morning when I went to preview a page after editing a got and error. It seems that ModX is no longer placing the \u003ccode\u003e/\u003c/code\u003e before the Resource Alias.\u003c/p\u003e\n\n\u003cp\u003eThus my URL becomes \u003ccode\u003emysite.comabout-us\u003c/code\u003e instead of \u003ccode\u003emysite.com/about-us\u003c/code\u003e and doesnt work\u003c/p\u003e\n\n\u003cp\u003ePutting in the slash manually has no effect as ModX removes it on save.\u003c/p\u003e\n\n\u003cp\u003eIm running Revo 2.1.3\u003c/p\u003e\n\n\u003cp\u003eWould anyone know how to fix this? Thanks\u003c/p\u003e\n\n\u003cp\u003eEDIT: \nDid some more testing and discovered this also occurs when I turn FURLs off\u003c/p\u003e","accepted_answer_id":"12065899","answer_count":"1","comment_count":"0","creation_date":"2012-08-22 02:14:58.407 UTC","favorite_count":"1","last_activity_date":"2012-08-22 03:19:27.667 UTC","last_edit_date":"2012-08-22 03:13:10.4 UTC","last_editor_display_name":"","last_editor_user_id":"1433268","owner_display_name":"","owner_user_id":"1433268","post_type_id":"1","score":"0","tags":"url|alias|modx|modx-revolution","view_count":"601"} +{"id":"11117465","title":"memcpy + pointers + java","body":"\u003cp\u003eI have seen there is no question that specifically reply to this combination of parameters:\u003c/p\u003e\n\n\u003cp\u003eJava + memcpy + pointers.\u003c/p\u003e\n\n\u003cp\u003eMy background of C/C++ is probably biasing me.\nIn C++ I can do this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ememcpy (Destination, Source, length_data);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand Destination and Source can be just two memory locations.\nIs there a way to do it in Java with arrays of primitive types?\u003c/p\u003e\n\n\u003cp\u003eAll the realizations of\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eArrays.copyOf\nArrays.copyOfRange\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eare basically doing half the job. In the sense that, you can specify the amount of data or a given range, but all of them give back one Array, they do not modify an existing one.\u003c/p\u003e\n\n\u003cp\u003eThanks in advance.\u003c/p\u003e","accepted_answer_id":"11117504","answer_count":"3","comment_count":"3","creation_date":"2012-06-20 10:20:10.747 UTC","last_activity_date":"2012-06-20 10:32:41.3 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1442007","post_type_id":"1","score":"2","tags":"java|arrays|memcpy","view_count":"1325"} +{"id":"9783795","title":"jQuery UI slider doesn't show","body":"\u003cp\u003eI have installed the jQuery UI slider, but it doesn't show in my code. I don't see what I'm doing wrong.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;!DOCTYPE html\u0026gt;\n\u0026lt;html\u0026gt;\n\u0026lt;head\u0026gt;\n \u0026lt;meta charset=\"utf-8\" /\u0026gt;\n \u0026lt;title\u0026gt;Home Page\u0026lt;/title\u0026gt;\n \u0026lt;link href=\"/Content/Site.css\" rel=\"stylesheet\" type=\"text/css\" /\u0026gt;\n \u0026lt;script src=\"/Scripts/jquery-1.7.1.min.js\" type=\"text/javascript\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;script src=\"/Scripts/jquery-ui-1.8.18.min.js\" type=\"text/javascript\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;script src=\"/Scripts/modernizr-2.5.3.js\" type=\"text/javascript\"\u0026gt;\u0026lt;/script\u0026gt;\n\n\u0026lt;/head\u0026gt;\n\u0026lt;body\u0026gt;\n \u0026lt;div class=\"page\"\u0026gt;\n \u0026lt;section id=\"main\"\u0026gt;\n \u0026lt;link href=\"/Content/themes/base/jquery.ui.slider.css\" rel=\"stylesheet\" type=\"text/css\" /\u0026gt;\n \u0026lt;script type=\"text/javascript\"\u0026gt;\n\n\n\n $(function () {\n ...\n $(\"#bwvolume\").slider({\n value: 0,\n min: 0,\n max: 2500,\n step: 100,\n slide: function (event, ui) {\n $(\"#spanbwvolume\").val(\"$\" + ui.value);\n }\n });\n $(\"#spanbwvolume\").val(\"$\" + $(\"#bwvolume\").slider(\"value\"));\n });\n \u0026lt;/script\u0026gt;\n ...\n \u0026lt;tr class=\"format\"\u0026gt;\n \u0026lt;td width=\"150\" valign=\"top\" class=\"tdlabelNoSize\"\u0026gt;Volumes monochrome:\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\n \u0026lt;div id=\"bwvolume\"\u0026gt;\u0026lt;/div\u0026gt;(\u0026lt;span id=\"spanbwvolume\"\u0026gt;\u0026lt;/span\u0026gt;)\n \u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n\n ...\n\u0026lt;/body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThere is some space allocated in the browser. But the slider doesn't show. My code is based on \u003ca href=\"http://jqueryui.com/demos/slider/#steps\" rel=\"nofollow\"\u003ehttp://jqueryui.com/demos/slider/#steps\u003c/a\u003e.\u003c/p\u003e\n\n\u003cp\u003eThis is what I see in FireBug:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;tr class=\"format\"\u0026gt;\n\u0026lt;td class=\"tdlabelNoSize\" width=\"150\" valign=\"top\"\u0026gt;Volumes monochrome:\u0026lt;/td\u0026gt;\n\u0026lt;td\u0026gt;\n\u0026lt;div id=\"bwvolume\" class=\"ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all\"\u0026gt;slider=Object { element={...}, options={...}, _keySliding=false, meer...}\n\u0026lt;a class=\"ui-slider-handle ui-state-default ui-corner-all\" href=\"#\" style=\"left: 0%;\"\u0026gt;\u0026lt;/a\u0026gt;index.uiSliderHandle=0\n\u0026lt;/div\u0026gt;\n(\n\u0026lt;span id=\"spanbwvolume\"\u0026gt;\u0026lt;/span\u0026gt;\n)\n\u0026lt;/td\u0026gt;\n\u0026lt;/tr\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFireBug doesn't report any errors.\u003c/p\u003e\n\n\u003cp\u003eDo I miss something like images or something? On the same page I'm using also jQuery UI Selectable (not shown in code) and this is working fine.\u003c/p\u003e","accepted_answer_id":"9784126","answer_count":"1","comment_count":"0","creation_date":"2012-03-20 08:56:41.99 UTC","last_activity_date":"2012-03-20 09:23:57.303 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1087273","post_type_id":"1","score":"0","tags":"jquery-ui|uislider","view_count":"3966"} +{"id":"36581909","title":"Create histogram of count frequencies in ggplot2","body":"\u003cp\u003eLet's say I have the following data frame:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ed = data.frame(letter = c(\n 'a', 'a', 'a', \n 'b', 'b', 'b', \n 'c',\n 'd', 'd', 'd', 'd',\n 'e', 'e', \n 'f', 'f', 'f', 'f', 'f', 'f', 'f',\n 'g'))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow can I use \u003ccode\u003eggplot2\u003c/code\u003e to make a histogram that does not count how many times a given letter occurs, but rather counts the number of times a given letter frequency occurs? In this example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etable(d$letter)\n\na b c d e f g \n3 3 1 4 2 7 1 \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003etwo letters (c and g) occur once, one letter (e) occurs twice, two letters occur three times, etc. Such that you can make a figure equivalent to the base plot:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ehist(table(d$letter), right = F, breaks = 6)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/drEY8.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/drEY8.png\" alt=\"base histogram\"\u003e\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"36582210","answer_count":"1","comment_count":"0","creation_date":"2016-04-12 19:04:47.06 UTC","last_activity_date":"2016-04-12 19:31:24.803 UTC","last_edit_date":"2016-04-12 19:26:06.02 UTC","last_editor_display_name":"","last_editor_user_id":"3159635","owner_display_name":"","owner_user_id":"3990506","post_type_id":"1","score":"3","tags":"r|ggplot2|histogram","view_count":"1016"} +{"id":"30508241","title":"I am getting rendering error in the latest android studio when trying to view the preview of an activity","body":"\u003cp\u003eRendering Problems The following classes could not be instantiated:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eandroid.support.v7.internal.widget.ActionBarOverlayLayout (Open\n Class, Show Exception, Clear Cache)\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eWhat can be done to solve this? I can't get any preview for my XML coding.\u003c/p\u003e","accepted_answer_id":"30512081","answer_count":"3","comment_count":"3","creation_date":"2015-05-28 13:39:21.29 UTC","last_activity_date":"2015-05-28 16:35:42.01 UTC","last_edit_date":"2015-05-28 15:53:10.803 UTC","last_editor_display_name":"","last_editor_user_id":"4945101","owner_display_name":"","owner_user_id":"4945101","post_type_id":"1","score":"4","tags":"android|android-studio","view_count":"121"} +{"id":"19299356","title":"How can I push a div inside the profoundgrid \"responsive fluid\" style to the right?","body":"\u003cp\u003eI'm using the profound grid framework to build responsive fluid grid layout. Basically what I want to achieve is to create a layout containing 6 colums of which the menu container is on the left with 1 column width and the content is on the right with 5 columns width. Inside the content I have a nested grid that is also fluid.\u003c/p\u003e\n\n\u003cp\u003eI have the grid working as the responsive fluid example which can be found here: \u003ca href=\"http://www.profoundgrid.com/examples/fluidresponsive.html\" rel=\"nofollow\"\u003ehttp://www.profoundgrid.com/examples/fluidresponsive.html\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThe scss code I have looks like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#row{\n div{@include column(6);}\n .col1{@include column(2);}\n .col5{@include column(10);}\n @include generate_grid_positions(div, 1);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe HTML looks like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;article id=\"row\"\u0026gt;\n \u0026lt;div id=\"menuContainer\" class=\"col1\"\u0026gt;Menu \u0026lt;br /\u0026gt;menu \u0026lt;br /\u0026gt;menu\u0026lt;/div\u0026gt;\n \u0026lt;div id=\"contentContainer\" class=\"col5\"\u0026gt;\n \u0026lt;div id=\"projectContainer\"\u0026gt;\n \u0026lt;div class=\"project\"\u0026gt;project1\u0026lt;/div\u0026gt;\n \u0026lt;div class=\"project\"\u0026gt;project2\u0026lt;/div\u0026gt;\n \u0026lt;div class=\"project\"\u0026gt;project3\u0026lt;/div\u0026gt;\n \u0026lt;div class=\"project\"\u0026gt;project1\u0026lt;/div\u0026gt;\n \u0026lt;div class=\"project\"\u0026gt;project2\u0026lt;/div\u0026gt;\n \u0026lt;div class=\"project\"\u0026gt;project3\u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div id=\"socialContainer\"\u0026gt;sadfgsdfg\u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/article\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat I have right now is a fluid responsive grid, but both divs get stacked upon eachother. I would like to know how to push the content 2 columns to the right.\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2013-10-10 14:59:55.51 UTC","last_activity_date":"2016-02-15 19:36:13.777 UTC","last_edit_date":"2016-02-15 19:36:13.777 UTC","last_editor_display_name":"","last_editor_user_id":"1946501","owner_display_name":"","owner_user_id":"1274398","post_type_id":"1","score":"0","tags":"html|css|responsive-design|fluid-layout|profound-grid","view_count":"508"} +{"id":"2725037","title":"How to know the classes of a package in java?","body":"\u003cblockquote\u003e\n \u003cp\u003e\u003cstrong\u003ePossible Duplicate:\u003c/strong\u003e\u003cbr\u003e\n \u003ca href=\"https://stackoverflow.com/questions/520328/can-you-find-all-classes-in-a-package-using-reflection\"\u003eCan you find all classes in a package using reflection?\u003c/a\u003e \u003c/p\u003e\n\u003c/blockquote\u003e\n\n\n\n\u003cp\u003esuppose I've a package name as string:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eString pkgName = \"com.forat.web.servlets\";\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow to know the types in this package?\u003c/p\u003e","answer_count":"4","comment_count":"1","creation_date":"2010-04-27 20:53:13.83 UTC","favorite_count":"0","last_activity_date":"2010-04-27 21:28:14.313 UTC","last_edit_date":"2017-05-23 10:33:15.25 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"171950","post_type_id":"1","score":"1","tags":"java|reflection","view_count":"464"} +{"id":"46719493","title":"Disabling specific interrupts on an ATtiny84a programmed using Arduino as an ISP?","body":"\u003cp\u003eI am programming an ATtiny84a using Arduino as the in-serial programmer. I am currently using two interrupt vectors: \u003ccode\u003eINT0_vect\u003c/code\u003e and \u003ccode\u003eTIM1_OVF_vect\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eDuring my \u003ccode\u003evoid loop()\u003c/code\u003e code, I would like to disable the 16-bit timer overflow interrupt. Would the following be the correct way of doing it?\u003c/p\u003e\n\n\u003cpre class=\"lang-cpp prettyprint-override\"\u003e\u003ccode\u003evoid setup() {\n ...\n bitSet(TIMSK1, TOIE1);\n ...\n}\n\nvoid loop() {\n ...\n bitClear(TIMSK1, TOIE1);\n ...\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf I am not mistaken, the mask register \u003ccode\u003eTIMSK1\u003c/code\u003e bit \u003cstrong\u003e0\u003c/strong\u003e toggles the on/off status of the timer overflow interrupt, so simply clearing the respective bit will disable the interrupt, right? If not, is there a way to do it?\u003c/p\u003e\n\n\u003cp\u003eDatasheet for reference: \u003ca href=\"http://ww1.microchip.com/downloads/en/DeviceDoc/doc8006.pdf\" rel=\"nofollow noreferrer\"\u003ehttp://ww1.microchip.com/downloads/en/DeviceDoc/doc8006.pdf\u003c/a\u003e\u003c/p\u003e","answer_count":"0","comment_count":"4","creation_date":"2017-10-12 21:56:18.897 UTC","last_activity_date":"2017-10-13 03:04:37.557 UTC","last_edit_date":"2017-10-13 03:04:37.557 UTC","last_editor_display_name":"","last_editor_user_id":"794749","owner_display_name":"","owner_user_id":"6539923","post_type_id":"1","score":"0","tags":"timer|arduino|interrupt|attiny","view_count":"23"} +{"id":"9192620","title":"Editing a Perforce label's description through a script","body":"\u003cp\u003eI want to modify an existing Perforce label using a script that I can invoke automatically. Currently I know how to do it using the text editor option:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ep4 label \u0026lt;label-name\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis opens up a temporary file in my default text editor, I can then enter a description, save the file and close - updates the label successfully.\u003c/p\u003e\n\n\u003cp\u003eHowever, I want to be able to do this automatically using a script. I will have variables that can be used to form my description.\u003c/p\u003e\n\n\u003cp\u003eI can use either a shell script or a bat script (on Windows but have \u003ca href=\"http://www.cygwin.com/\" rel=\"nofollow\"\u003eCygwin\u003c/a\u003e).\u003c/p\u003e\n\n\u003cp\u003ePerforce command line documentation on labels can be found \u003ca href=\"http://www.perforce.com/perforce/doc.current/manuals/cmdref/label.html\" rel=\"nofollow\"\u003ehere\u003c/a\u003e, but it's not helping me.\u003c/p\u003e\n\n\u003cp\u003eAny ideas?\u003c/p\u003e","accepted_answer_id":"9194610","answer_count":"2","comment_count":"0","creation_date":"2012-02-08 11:42:10.477 UTC","last_activity_date":"2015-02-03 19:01:59.833 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"124426","post_type_id":"1","score":"3","tags":"shell|command-line|perforce","view_count":"1134"} +{"id":"443245","title":"How do I get the workbench window to open a modal dialog in an Eclipse based project?","body":"\u003cp\u003eIn order to open a modal dialog, you need to pass a parent window, and pass the necessary flags for the dialog to be modal of course.\u003c/p\u003e\n\n\u003cp\u003eDepending on where you are in the eclipse infrastructure, finding this parent window is not always easy.\u003c/p\u003e\n\n\u003cp\u003eHow can the parent window be accessed?\u003c/p\u003e","accepted_answer_id":"443263","answer_count":"3","comment_count":"0","creation_date":"2009-01-14 14:55:57.14 UTC","favorite_count":"3","last_activity_date":"2016-06-14 15:28:53.83 UTC","last_edit_date":"2009-01-14 15:37:39.21 UTC","last_editor_display_name":"Tirno","last_editor_user_id":"9886","owner_display_name":"Tirno","owner_user_id":"9886","post_type_id":"1","score":"16","tags":"eclipse|eclipse-plugin|eclipse-rcp|eclipse-pde","view_count":"20628"} +{"id":"15674547","title":"jQuery: Animate Knob inside FineUploader callback","body":"\u003cp\u003eI'm using jQuery libs FineUploader \u0026amp; Knob for a faux circular loading effect.\u003c/p\u003e\n\n\u003cp\u003eMy current code is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e $('.dial').val(0).trigger('change').delay(2000);\n var myKnob = $(\".dial\").knob({\n 'min': 0,\n 'max': 100,\n 'readOnly': true,\n 'width': 90,\n 'height': 90,\n 'fgColor': \"47CBFF\",\n 'dynamicDraw': true,\n 'thickness': 0.3,\n 'tickColorizeValues': true,\n 'skin': 'tron'\n })\n $('.dial').knob();\n $('#uploader-div').fineUploader({\n request: {\n endpoint: \"/updateavatar\",\n paramsInBody: true\n },\n debug: true,\n template: '\u0026lt;div class=\"qq-uploader\"\u0026gt;' + '\u0026lt;pre class=\"qq-upload-drop-area\"\u0026gt;\u0026lt;span\u0026gt;{dragZoneText}\u0026lt;/span\u0026gt;\u0026lt;/pre\u0026gt;' + '\u0026lt;div class=\"qq-upload-button btn btn-success\"\u0026gt;{uploadButtonText}\u0026lt;/div\u0026gt;' + '\u0026lt;span class=\"qq-drop-processing\"\u0026gt;\u0026lt;span\u0026gt;{dropProcessingText}\u0026lt;/span\u0026gt;\u0026lt;span class=\"qq-drop-processing-spinner\"\u0026gt;\u0026lt;/span\u0026gt;\u0026lt;/span\u0026gt;' + '\u0026lt;ul class=\"qq-upload-list\"\u0026gt;\u0026lt;/ul\u0026gt;' + '\u0026lt;/div\u0026gt;',\n }).on('submit', function (event, id, name, responseJSON) {\n $('.qq-uploader').css({\n 'background': 'rgba(0,0,0,.3'\n });\n $('canvas').fadeIn();\n $({\n value: 0\n }).animate({\n value: 75\n }, {\n duration: 3000,\n easing: 'swing',\n step: function () {\n $('.dial').val(Math.ceil(this.value)).trigger('change');\n }\n });\n }).on('complete', function (event, id, name, responseJSON) {\n $({\n value: 75\n }).animate({\n value: 100\n }, {\n duration: 1000,\n easing: 'swing',\n step: function () {\n $('.dial').val(Math.ceil(this.value)).trigger('change');\n }\n });\n $('canvas').fadeOut();\n var image = $('#profile-pic img').attr('src');\n $('#profile-pic img').fadeOut(function () {\n $(this).attr('src', image).fadeIn('slow')\n });\n });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eThe problem\u003c/strong\u003e is that the \"complete\" function will run before the 'loader' is finished animating the 75%.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eI want\u003c/strong\u003e the \"complete\" callback to wait until the animation finishes...\u003c/p\u003e\n\n\u003cp\u003e\u003cem\u003eAs a bonus\u003c/em\u003e, I would like the animation to actually take the correct valums fineuploader percentage so I don't have to fake it!\u003c/p\u003e\n\n\u003cp\u003eCan I help you understand better? Let me know!\u003c/p\u003e","accepted_answer_id":"15674883","answer_count":"2","comment_count":"0","creation_date":"2013-03-28 04:55:56.477 UTC","last_activity_date":"2013-03-28 16:38:48.29 UTC","last_edit_date":"2013-03-28 16:38:48.29 UTC","last_editor_display_name":"","last_editor_user_id":"168868","owner_display_name":"","owner_user_id":"103753","post_type_id":"1","score":"0","tags":"jquery|callback|jquery-animate|fine-uploader|jquery-knob","view_count":"572"} +{"id":"19126314","title":"MVC 4 Error 404 on Created View","body":"\u003cp\u003eI have this controller:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[Authorize]\npublic class CheckoutController : Controller\n{\n\n ShoppingCartContext storeDB = new ShoppingCartContext();\n const string PromoCode = \"FREE\";\n\n [HttpPost]\n public ActionResult AddressAndPayment(FormCollection values)\n {\n var order = new Order();\n TryUpdateModel(order);\n\n try\n {\n if (string.Equals(values[\"PromoCode\"], PromoCode,\n StringComparison.OrdinalIgnoreCase) == false)\n {\n return View(order);\n }\n else\n {\n order.Username = User.Identity.Name;\n order.OrderDate = DateTime.Now;\n\n //Save Order\n storeDB.Orders.Add(order);\n storeDB.SaveChanges();\n //Process the order\n var cart = Models.ShoppingCart.GetCart(this.HttpContext);\n cart.CreateOrder(order);\n\n return RedirectToAction(\"Complete\",\n new { id = order.OrderId });\n }\n }\n catch\n {\n //Invalid - redisplay with errors\n return View(order);\n }\n }\n\n public ActionResult Complete(int id)\n {\n // Validate customer owns this order\n bool isValid = storeDB.Orders.Any(\n o =\u0026gt; o.OrderId == id \u0026amp;\u0026amp;\n o.Username == User.Identity.Name);\n\n if (isValid)\n {\n return View(id);\n }\n else\n {\n return View(\"Error\");\n }\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd I have created a View called \u003ccode\u003eAddressAndPayment\u003c/code\u003e under \u003ccode\u003eCheckout\u003c/code\u003e, so it goes to \u003ccode\u003elocalhost/Checkout/AddressAndPayment\u003c/code\u003e but I only get a 404 error, even if I right click on the View and click on view in Page Inspector. I don't know why its not even showing the view when it is created.\u003c/p\u003e","accepted_answer_id":"19126378","answer_count":"1","comment_count":"1","creation_date":"2013-10-01 21:30:24.273 UTC","last_activity_date":"2013-10-01 21:40:58.487 UTC","last_edit_date":"2013-10-01 21:40:58.487 UTC","last_editor_display_name":"","last_editor_user_id":"1039608","owner_display_name":"","owner_user_id":"2836577","post_type_id":"1","score":"1","tags":"c#|asp.net-mvc|asp.net-mvc-4","view_count":"2660"} +{"id":"11370860","title":"Capitalize the first letter of every word in a filename or directory in Shell","body":"\u003cp\u003eI'm trying to write a shell command where I can specify a directory, and then every file and directory inside will have the first letter of every word capitalized. So \u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003e/doCumenTS/tesT.txt\u003c/code\u003e \u003c/p\u003e\n\n\u003cp\u003eshould change to \u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003e/DoCumenTS/TesT.txt\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eI'm thinking it should start like\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efor i in directory do\ntr something_goes_here\ndone\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe problem I can't figure out is how to only do the first letter. I've made a script that uppercase the whole file name, but I can't figure out how to only get the first letter of every word.\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","answer_count":"5","comment_count":"2","creation_date":"2012-07-06 23:21:35.753 UTC","favorite_count":"2","last_activity_date":"2014-06-18 13:24:48.977 UTC","last_edit_date":"2012-07-06 23:22:26.487 UTC","last_editor_display_name":"","last_editor_user_id":"1209279","owner_display_name":"","owner_user_id":"1507982","post_type_id":"1","score":"8","tags":"bash|shell|unix","view_count":"9726"} +{"id":"363325","title":"Nesting SAX ContentHandlers","body":"\u003cp\u003eI would like to parse a document using SAX, and create a subdocument from some of the elements, while processing others purely with SAX. So, given this document:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;DOC\u0026gt;\n \u0026lt;small\u0026gt;\n \u0026lt;element /\u0026gt;\n \u0026lt;/small\u0026gt;\n \u0026lt;entries\u0026gt;\n \u0026lt;!-- thousands here --\u0026gt;\n \u0026lt;/entries\u0026gt;\n \u0026lt;/DOC\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI would like to parse the DOC and DOC/entries elements using the SAX ContentHandler, but when I hit \u003ccode\u003e\u0026lt;small\u0026gt;\u003c/code\u003e I want to create a new document containing just the \u003ccode\u003e\u0026lt;small\u0026gt;\u003c/code\u003e and its children.\u003c/p\u003e\n\n\u003cp\u003eIs there an easy way to do this, or do I have to build the DOM myself, by hand?\u003c/p\u003e","accepted_answer_id":"363636","answer_count":"3","comment_count":"0","creation_date":"2008-12-12 16:41:58.97 UTC","last_activity_date":"2011-04-18 19:57:01.427 UTC","last_editor_display_name":"","owner_display_name":"Chris R","owner_user_id":"23309","post_type_id":"1","score":"1","tags":"java|xml|dom|parsing|sax","view_count":"662"} +{"id":"42159456","title":"double free or corruption(fasttop)","body":"\u003cp\u003eHello guys I have an array resizing function like this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eint\nadd_time_element (time_t *array, time_t element, size_t *size)\n{\n if (NULL == array)\n {\n return STATUS_FAIL;\n }\n\n int status = STATUS_SUCCESS;\n time_t *tmp = NULL;\n size_t local_size;\n\n (*size)++;\n local_size = *size;\n\n printf (\"Local size %lu\\n\", local_size);\n\n tmp = realloc (array, local_size * sizeof (time_t));\n if (NULL == tmp)\n {\n status = STATUS_FAIL; \n }\n else \n {\n array = tmp;\n }\n\n if (STATUS_FAIL == status)\n { \n (*size)--;\n }\n else\n {\n array[local_size - ONE] = element;\n }\n\n return status; \n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am calling this function like this..\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e time_t *dates = NULL;\n dates = malloc (ONE);\n for (slot_index = ZERO; slot_index \u0026lt; data_provider-\u0026gt;n_slots; slot_index++)\n {\n printf (\"Testing\\n\");\n /*slot = data_provider-\u0026gt;slots[slot_index];\n date = get_date (slot-\u0026gt;start_time);*/\n date += ONE; \n if (STATUS_FAIL == add_unique_time_element (dates, date, \u0026amp;n_dates))\n {\n free (dates);\n dates = NULL; \n return STATUS_FAIL;\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am getting the double free(fasttop) error in realloc function..\u003c/p\u003e\n\n\u003cp\u003eAnd valgrind analysis report says\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eInvalid free() / delete / delete[] / realloc()\n==22491== at 0x4C2DD9F: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)\n==22491== by 0x402BA3: add_time_element (array_util.c:353)\n==22491== by 0x402C6C: add_unique_time_element (array_util.c:399)\n==22491== by 0x401F92: create_dates (data_provider.c:283)\n==22491== by 0x401D7D: create_data_provider_file (data_provider.c:174)\n==22491== by 0x4075CC: main (data_provider_test.c:13)\n==22491== Address 0x5b63170 is 0 bytes inside a block of size 1 free'd\n==22491== at 0x4C2DD9F: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)\n==22491== by 0x402BA3: add_time_element (array_util.c:353)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ePlease help.\u003c/p\u003e","accepted_answer_id":"42159512","answer_count":"1","comment_count":"0","creation_date":"2017-02-10 12:30:08.843 UTC","last_activity_date":"2017-02-10 12:33:19.033 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6552957","post_type_id":"1","score":"1","tags":"c|memory-management","view_count":"79"} +{"id":"5167659","title":"Javascript Variable Scope","body":"\u003cp\u003eI'm having issues with a javascript global variable (called TimeStamp) not being defined onload...at least I think that's the problem.\u003c/p\u003e\n\n\u003cp\u003eI start with this, defining TimeStamp.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e $(document).ready(function(){\n // AddTest();\n var TimeStamp = null;\n waitForMsg();\n });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e...waitForMsg then runs using TimeStamp and updated it on successful completion of the ajax call. At least that's the idea, but at the moment nothing runs because \"TimeStamp is not defined\"...even though I defined it earlier! (urgh).\u003c/p\u003e\n\n\u003cp\u003eIf I re-define Timestamp within waitForMsg it just gets reset instead of using the updated value from the successfull ajax function.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e function waitForMsg(){\n\n\n $.ajax({\n type: \"POST\",\n url: \"backend.php\",\n async: true,\n cache: false,\n timeout:50000, /* Timeout in ms */\n data: \"TimeStamp=\" + TimeStamp,\n success: function(data){\n\n var json = eval('(' + data + ')');\n\n $('#TextHistory :last-child').after('\u0026lt;p\u0026gt;' + json['msg'] + '\u0026lt;/p\u0026gt;');\n\n\n TimeStamp = json['timestamp'];\n\n\n setTimeout(\n 'waitForMsg()', /* Request next message */\n 1000 /* ..after 1 seconds */\n );\n },\n error: function(XMLHttpRequest, textStatus, errorThrown){\n\n $('#TextHistory :last-child').after('\u0026lt;p\u0026gt;' + errorThrown + '\u0026lt;/p\u0026gt;');\n\n setTimeout(\n 'waitForMsg()', /* Try again after.. */\n \"15000\"); /* milliseconds (15seconds) */\n },\n });\n};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAs always any help is greatly appreciated.\u003c/p\u003e\n\n\u003cp\u003eDan.\u003c/p\u003e","accepted_answer_id":"5167721","answer_count":"3","comment_count":"0","creation_date":"2011-03-02 12:46:17.347 UTC","last_activity_date":"2011-03-02 13:03:03.26 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"569243","post_type_id":"1","score":"2","tags":"javascript|variables|jquery|scope","view_count":"876"} +{"id":"10070107","title":"I want to convert vb this code","body":"\u003cp\u003eI want to convert vb this code\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\n// Where the file is going to be placed\n$target_path = \"uploads/\";\n\n/* Add the original filename to our target path.\nResult is \"uploads/filename.extension\" */\n$target_path = $target_path . basename( $_FILES['uploadedfile']['name']); \n\nif(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {\n echo \"The file \". basename( $_FILES['uploadedfile']['name']).\n \" has been uploaded\";\n} else{\n echo \"There was an error uploading the file, please try again!\";\n echo \"filename: \" . basename( $_FILES['uploadedfile']['name']);\n echo \"target_path: \" .$target_path;\n}\n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eplease explain your scenario more clearly.\u003c/p\u003e","accepted_answer_id":"10070236","answer_count":"1","comment_count":"3","creation_date":"2012-04-09 07:13:25.54 UTC","last_activity_date":"2012-04-10 01:58:25.947 UTC","last_edit_date":"2012-04-10 01:58:25.947 UTC","last_editor_display_name":"","last_editor_user_id":"3043","owner_display_name":"","owner_user_id":"1047165","post_type_id":"1","score":"-4","tags":"php|asp.net|vb.net","view_count":"131"} +{"id":"16582646","title":"waypoints between one terminal to another terminal required","body":"\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/Uq9ue.png\" alt=\"waypoints between munich and room required\"\u003e\u003c/p\u003e\n\n\u003cp\u003ehi i am writing a google map api code by which i am getting waypoints between origin to destination,code works fine it's give only those waypoints which has terminal (in below image marked as ire ,re , ice, cnl) .As you see there is lots of distance between 'cnl' and point 'B'. so i want more waypoints between 'CNL' and 'B'. can anybody tell me how i can get this?\u003c/p\u003e\n\n\u003cp\u003ei am using this request\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e var request = {\n origin: start,\n destination: end,\n travelMode: google.maps.TravelMode.TRANSIT \n };\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand this thing for showing waypoints.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e for (var j = 0; j \u0026lt; myRoute.legs.length; j++) {\n for (var i = 0; i \u0026lt; myRoute.legs[j].steps.length; i++) {\n path=path+myRoute.legs[j].steps[i].start_point+\"|\";\n }\n }\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"1","creation_date":"2013-05-16 08:35:40.13 UTC","last_activity_date":"2013-05-16 12:29:19.58 UTC","last_edit_date":"2013-05-16 12:29:19.58 UTC","last_editor_display_name":"","last_editor_user_id":"1210329","owner_display_name":"","owner_user_id":"1871819","post_type_id":"1","score":"0","tags":"google-maps|google-maps-api-3","view_count":"115"} +{"id":"12122678","title":"Configure Group Policy","body":"\u003cp\u003eI'm a programmer, which to write my first program, i already write it... and now I'm providing user interface and the side things which i wish to do automatically instead of making user to do all of them manually...\u003c/p\u003e\n\n\u003cp\u003eThe problem i have is to Configure Group Policy, i find some of codes but I'm unable to understand them...\u003c/p\u003e\n\n\u003cp\u003ewhat i now looking for is any class library or code i can use them to do these changes...\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://www.watchdirectory.net/wdhelp/plugins/wdopAuditInfoConf.html\" rel=\"nofollow\"\u003ehttp://www.watchdirectory.net/wdhelp/plugins/wdopAuditInfoConf.html\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e...through C#\u003c/p\u003e\n\n\u003cp\u003eplease if you reference to a code, provide a sample usage, because i also find many codes, which i didn't know how to use, and mostly i didn't know what kinda value i should pass to them... :|\u003c/p\u003e\n\n\u003cp\u003eThank you,\nHassan F.\u003c/p\u003e","accepted_answer_id":"12124033","answer_count":"1","comment_count":"2","creation_date":"2012-08-25 14:06:52.183 UTC","last_activity_date":"2012-08-25 17:11:16.5 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1260751","post_type_id":"1","score":"-1","tags":"c#|.net-2.0|group-policy","view_count":"1024"} +{"id":"11070396","title":"How to create general lists / template lists in C#","body":"\u003cp\u003eI have one main class with several inherited members who all overload the same Draw method of the parent class, but have different Initialize methods. Is it somehow possible to use the same list type for every inherited class, and thus be able to iterate through the Draw-methods? I am pretty sure you can do this with templates in C++, but can't seem to find a way to do it in C#. Here is an example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass MainMenu : ExpandingWindow{\n Init(A,B)\n Draw(D)\n}\n\nclass SideMenu : ExpandingWindow{\n Init(A,B,C)\n Draw(D)\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to be able to do:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e WindowList List\u0026lt;ExpandingWindow\u0026gt;\n\n WindowList.Add(new MainMenu)\n WindowList.Add(new SideMenu)\n\n WindowList[0].Initialize(A,B)\n WindowLIst[1].Initialize(A,B,C)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e for each window in WindowList{\n window.Draw(D)\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am pretty sure I'm missing something here. I do not have to do it in this exact manner, I am rather looking for general way of handling these situations well.\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","accepted_answer_id":"11070415","answer_count":"3","comment_count":"0","creation_date":"2012-06-17 09:48:17.097 UTC","last_activity_date":"2012-06-17 10:14:59.543 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1461602","post_type_id":"1","score":"3","tags":"c#|.net|xna-4.0","view_count":"917"} +{"id":"15609999","title":"Chrome extenssion: Getting URL domain name","body":"\u003cp\u003eI am new to chrome-extension development and just read a sample \"hello world\" example.\nAdvancing, I would like to create a chrome-extension, which gets and pops the URL name to be accessed, on a pop-up window. How will I do this? I think this is more related to javascript coding, but still, how will I accomplish this?\u003c/p\u003e\n\n\u003cp\u003eThanks in advance!\u003c/p\u003e","answer_count":"0","comment_count":"4","creation_date":"2013-03-25 07:49:46.44 UTC","last_activity_date":"2013-03-28 08:57:26.94 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"568865","post_type_id":"1","score":"0","tags":"javascript|google-chrome-extension","view_count":"58"} +{"id":"38222433","title":"Getting error while sorting records in descending order by Id with orderby clause in Angular js","body":"\u003cp\u003eI am trying to display my records in descending order of my \u003ccode\u003eId\u003c/code\u003e property.\u003c/p\u003e\n\n\u003cp\u003eBut getting error below in browser console:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e[orderBy:notarray] Expected array but received:\n {\"name\":\"Abc\",\"EmailId\":\"Abc@yahoo.com\",\"Salary\":4000}\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eThis is my code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;table\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td ng-repeat=\"item in User \" ng-if=\"$odd\" \u0026gt;\n \u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;/table\u0026gt;\n\n \u0026lt;table\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td ng-repeat=\"item in User \" ng-if=\"$even\" \u0026gt;\n \u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;/table\u0026gt;\n\n\n \u0026lt;tr ng-repeat=\"item in User | orderBy: '-Id' \"\u0026gt;\n \u0026lt;/td\u0026gt;\n\n function Displaydata() {\n MyService.getList().then(\n function (data) {\n $scope.User = data\n }, function (reason) {\n })\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eJson Output:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e [\n {\n \"Id\":5,\n \"name\": \"Abc\",\n \"EmailId\": \"Abc@yaoo.com\",\n \"Salary\" : 4000\n },\n {\n \"Id\":11,\n \"name\": \"YYY\",\n \"EmailId\": \"Abc@yaoo.com\",\n \"Salary\" : 4000\n },\n {\n \"Id\":7,\n \"name\": \"III\",\n \"EmailId\": \"Abc@yaoo.com\",\n \"Salary\" : 4000\n },\n {'\n \"Id\":3,\n \"name\": \"WWW\",\n \"EmailId\":\"Abc@yaoo.com\",\n \"Salary\" : 4000\n }\n ]\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"13","creation_date":"2016-07-06 11:01:46.877 UTC","last_activity_date":"2017-11-26 22:34:54.683 UTC","last_edit_date":"2017-11-26 22:34:54.683 UTC","last_editor_display_name":"","last_editor_user_id":"472495","owner_display_name":"","owner_user_id":"4927379","post_type_id":"1","score":"1","tags":"javascript|angularjs|angularjs-ng-repeat|angularjs-filter","view_count":"81"} +{"id":"27592739","title":"Issue setting up the development environment for ProjectTango developemnt Device","body":"\u003cp\u003eI have a Project Tango development Kit. I am interested in working on the depth data from the sensors.\nI have ADB setup on my machine. But the Eclipse android emulator doesn't detect the Tango Development tablet.\u003c/p\u003e\n\n\u003cp\u003eCan anyone suggest me how to set things up for the device!.\u003c/p\u003e\n\n\u003cp\u003eThank you in advance.\u003c/p\u003e","answer_count":"4","comment_count":"0","creation_date":"2014-12-21 19:06:50.787 UTC","last_activity_date":"2016-10-08 13:47:03.627 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4383253","post_type_id":"1","score":"3","tags":"google-project-tango","view_count":"2472"} +{"id":"35450686","title":"Mongoose plugin to assign extra data to a field but not saving to database","body":"\u003cp\u003eI am trying to write a plugin that should return extra data by setting on a field \u003ccode\u003etags\u003c/code\u003e already saved to model instead of saving set data on \u003ccode\u003etags\u003c/code\u003e to database and return.\nHere is plugin code.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emodule.exports = function samTagsPlugin(schema, options) {\n schema.post('init', function () {\n document.set('tags', ['a', 'b', 'c']);\n });\n};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut, the \u003ccode\u003etags\u003c/code\u003e field is saved to mongodb with the values \u003ccode\u003e['a', 'b', 'c']\u003c/code\u003e. Is there any way I can just assign dynamic value to \u003ccode\u003etags\u003c/code\u003e and mongoose do not save the provided value to database?\nMongoose version I am using is \u003ccode\u003e3.8.x\u003c/code\u003e.\u003c/p\u003e","accepted_answer_id":"35455742","answer_count":"1","comment_count":"4","creation_date":"2016-02-17 07:47:09.353 UTC","last_activity_date":"2016-02-17 11:43:13.473 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"898153","post_type_id":"1","score":"1","tags":"node.js|mongodb|mongoose","view_count":"49"} +{"id":"7129452","title":"How to know if DB exists from within Rake task","body":"\u003cp\u003eHow do i find out if the database exists from within a rake task?\u003c/p\u003e\n\n\u003cp\u003ethat is, i'd like to do something like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e task :drop_and_create =\u0026gt; :environment do\n Rails.env = \"development\"\n if (db_exists?)\n Rake::Task[\"db:drop\"].invoke\n end\n Rake::Task[\"db:create\"].invoke\n #more stuff...\n end\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ehow do i write the db_exists? condition?\u003c/p\u003e","answer_count":"2","comment_count":"1","creation_date":"2011-08-20 03:32:46.337 UTC","last_activity_date":"2011-08-20 03:39:24.433 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"487906","post_type_id":"1","score":"2","tags":"ruby-on-rails|ruby-on-rails-3|rake","view_count":"1518"} +{"id":"37125437","title":"SQL Server Mgmt Studio shows \"invalid column name\" when listing columns?","body":"\u003cp\u003eI'm used to scripting in Python or Matlab, and my first couple hours with SQL have been infuriating. I would like to make a list of columns appear on the screen in any way, shape, or form; but when I use commands like\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eselect * \nfrom \"2Second Log.dbo.TagTable.Columns\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI keep getting the error:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eInvalid column name '[the first column in my table]'.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eeven though I never explicitly asked for [the first column in my table], it found it for me. How can you correctly identify the first column name, and then still claim it's invalid!? Babies will be strangled.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/FJBXo.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/FJBXo.png\" alt=\"My data structure, query, and the error message.\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThis db was generated by Allen Bradley's FactoryTalk software. What I would really like to do is produce an actual list of \"TagName\" strings...but I get the same error when I try that. If there were a way to actually double click the table and open it up and look at it (like in Matlab), that would be ideal.\u003c/p\u003e","accepted_answer_id":"37125730","answer_count":"2","comment_count":"1","creation_date":"2016-05-09 21:05:33.97 UTC","last_activity_date":"2016-05-09 21:43:21.133 UTC","last_edit_date":"2016-05-09 21:25:02.727 UTC","last_editor_display_name":"","last_editor_user_id":"5004117","owner_display_name":"","owner_user_id":"5004117","post_type_id":"1","score":"1","tags":"sql-server|select|ssms","view_count":"362"} +{"id":"14126825","title":"Xcode 4: Missing File's Owner with Storyboard?","body":"\u003cp\u003eI started a new project under Xcode 4.5. I accepted the default wizard settings, which included a storyboard.\u003c/p\u003e\n\n\u003cp\u003eI went to make connections and the File's Owner is missing.\u003c/p\u003e\n\n\u003cp\u003eI'm not sure what I did to end up in this configuration. As far as UI components, I added a scroll view in place of the original view. I had some trouble with Vertical Constraints, but I did not do anything drastic.\u003c/p\u003e\n\n\u003cp\u003eI tried to Google for the issue, but only got back two results: \u003ca href=\"http://www.google.com/#q=xcode+4+%22missing+file+owner+%22\" rel=\"nofollow noreferrer\"\u003ehttp://www.google.com/#q=xcode+4+%22missing+file+owner+%22\u003c/a\u003e.\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/IxsJN.png\" alt=\"Xcode 4 and Missing File\u0026#39;s owner\"\u003e\u003c/p\u003e\n\n\u003cp\u003eHow does one go about adding a file's owner to a storyboard.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eUPDATE\u003c/strong\u003e: For others who find this Stack Overflow article, its time to do Apple App's 101 again: \u003ca href=\"http://developer.apple.com/library/ios/#documentation/iphone/conceptual/iPhone101/Articles/00_Introduction.html\" rel=\"nofollow noreferrer\"\u003eCreating Your First iOS App\u003c/a\u003e. It looks like Hillegass and LeMarche have not yet caught up with the 6.0 SDK. There are no books on Amazon as of January, 2013.\u003c/p\u003e","accepted_answer_id":"14126887","answer_count":"3","comment_count":"0","creation_date":"2013-01-02 17:57:54.397 UTC","favorite_count":"1","last_activity_date":"2013-09-25 16:41:54.853 UTC","last_edit_date":"2013-01-03 12:13:18.24 UTC","last_editor_display_name":"","last_editor_user_id":"608639","owner_display_name":"","owner_user_id":"608639","post_type_id":"1","score":"2","tags":"iphone|ios|xcode|storyboard|uiapplicationdelegate","view_count":"11276"} +{"id":"9227303","title":"Jquery Event Calendar with tool tip","body":"\u003cp\u003eCan somebody suggest me a good jquery calender with tooltip.\u003c/p\u003e","accepted_answer_id":"9227319","answer_count":"1","comment_count":"3","creation_date":"2012-02-10 11:49:00.23 UTC","favorite_count":"1","last_activity_date":"2012-02-10 11:50:38.653 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1049442","post_type_id":"1","score":"1","tags":"jquery|jquery-ui|calendar|tooltip","view_count":"781"} +{"id":"31372560","title":"Fetch data from Google Analytics API","body":"\u003cp\u003e\u003cstrong\u003eWhat I Want:\u003c/strong\u003e The website should show the analytics data without Authorization.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eWhat I Did:\u003c/strong\u003e I have a app on google app engine and enabled API and created service account which gave a json file.\u003c/p\u003e\n\n\u003cp\u003eI tried to do same as: \u003ca href=\"https://ga-dev-tools.appspot.com/embed-api/custom-components/\" rel=\"nofollow\"\u003ehttps://ga-dev-tools.appspot.com/embed-api/custom-components/\u003c/a\u003e but didn't succeed.\u003c/p\u003e\n\n\u003cp\u003eThen I came across this issue: \u003ca href=\"http://code.google.com/p/analytics-issues/issues/detail?id=496\" rel=\"nofollow\"\u003ehttp://code.google.com/p/analytics-issues/issues/detail?id=496\u003c/a\u003e and changed my code as this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;!DOCTYPE html\u0026gt;\n\u0026lt;html\u0026gt;\n\u0026lt;head\u0026gt;\n \u0026lt;title\u0026gt;Embed API Demo\u0026lt;/title\u0026gt;\n\u0026lt;/head\u0026gt;\n\u0026lt;body\u0026gt;\n\n\u0026lt;!-- Step 1: Create the containing elements. --\u0026gt;\n\n\u0026lt;section id=\"auth-button\"\u0026gt;\u0026lt;/section\u0026gt;\n\u0026lt;section id=\"view-selector\"\u0026gt;\u0026lt;/section\u0026gt;\n\u0026lt;section id=\"timeline\"\u0026gt;\u0026lt;/section\u0026gt;\n\n\u0026lt;!-- Step 2: Load the library. --\u0026gt;\n\n\u0026lt;script\u0026gt;\n(function(w,d,s,g,js,fjs){\n g=w.gapi||(w.gapi={});g.analytics={q:[],ready:function(cb){this.q.push(cb)}};\n js=d.createElement(s);fjs=d.getElementsByTagName(s)[0];\n js.src='https://apis.google.com/js/platform.js';\n fjs.parentNode.insertBefore(js,fjs);js.onload=function(){g.load('analytics')};\n}(window,document,'script'));\n\u0026lt;/script\u0026gt;\n\n\u0026lt;script\u0026gt;\ngapi.analytics.ready(function() {\n\n // Step 3: Authorize the user.\n\n\n gapi.analytics.auth.authorize({\n serverAuth: '\u0026lt;server auth key\u0026gt;' \n });\n\n // Step 4: Create the view selector.\n\n var viewSelector = new gapi.analytics.ViewSelector({\n container: 'view-selector'\n });\n\n // Step 5: Create the timeline chart.\n\n var timeline = new gapi.analytics.googleCharts.DataChart({\n reportType: 'ga',\n query: {\n 'dimensions': 'ga:date',\n 'metrics': 'ga:sessions',\n 'start-date': '30daysAgo',\n 'end-date': 'yesterday',\n },\n chart: {\n type: 'LINE',\n container: 'timeline'\n }\n });\n\n // YOU MUST CALL THIS MANUALLY HERE INSTEAD OF WAITING FOR CALLBACK\n viewSelector.execute();\n\n // Step 6: Hook up the components to work together.\n\n gapi.analytics.auth.on('success', function(response) {\n viewSelector.execute();\n });\n\n viewSelector.on('change', function(ids) {\n var newIds = {\n query: {\n ids: ids\n }\n }\n timeline.set(newIds).execute();\n });\n});\n\u0026lt;/script\u0026gt;\n\u0026lt;/body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI tried seeing couple of documents to get \u003cstrong\u003eserver auth key\u003c/strong\u003e, but I failed getting it.\u003c/p\u003e\n\n\u003cp\u003eCan anyone help in setting the server auth key and by this will my purpose of displaying charts without authentication will resolved?\u003c/p\u003e\n\n\u003cp\u003eThanks,\nSharad Soni\u003c/p\u003e","accepted_answer_id":"31377143","answer_count":"1","comment_count":"1","creation_date":"2015-07-12 21:02:19.493 UTC","last_activity_date":"2015-07-13 06:58:06.647 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2303050","post_type_id":"1","score":"1","tags":"google-app-engine|google-analytics","view_count":"261"} +{"id":"10593967","title":"Error with bat file token or for loop: not recognized as an internal or external command, operable program or batch file","body":"\u003cp\u003eNeed Windows .bat file tech support. \nI am having trouble running Win 7 bat files which loop through tokens and variables. The script below works on my wifes PC, and should on all PCs, but does not on mine.\u003c/p\u003e\n\n\u003cp\u003e** I am running Windows 7 in VMWare off my Mac.\u003c/p\u003e\n\n\u003cp\u003eThe file is located at the root of c:\u003c/p\u003e\n\n\u003cp\u003eThis short little script, and any others like it with tokens gives me errors ( I copied the script below out of the .bat file ):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esetLocal ENABLEDELAYEDEXPANSION\nset SCHEMA_one= first\nset SCHEMA_two= second\nset SCHEMA_three= third\n\n@ECHO ON\nFOR /F \"tokens=2* delims=_=\" %%A IN ('set SCHEMA_') DO (\n echo \"looping through \" %%A\n)\nendLocal\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI get the following error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eC:\\\u0026gt;FOR /F \"tokens=2* delims=_=\" %A IN ('set SCHEMA_') DO (echo \"looping through \" %A ) \n'set SCHEMA_' is not recognized as an internal or external command, operable program or batch file.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIdeas???\u003c/p\u003e\n\n\u003cp\u003eMany thanks in advance. I have been stuck for hours and hours...\u003c/p\u003e","accepted_answer_id":"10612077","answer_count":"2","comment_count":"0","creation_date":"2012-05-15 03:56:50.153 UTC","last_activity_date":"2012-05-16 06:34:52.93 UTC","last_edit_date":"2012-05-15 07:12:47.36 UTC","last_editor_display_name":"","last_editor_user_id":"297408","owner_display_name":"","owner_user_id":"1030509","post_type_id":"1","score":"0","tags":"windows|loops|batch-file","view_count":"1143"} +{"id":"42180061","title":"How to get an analyzed term from a TokenStream in Lucene.NET 4.8","body":"\u003cp\u003eI am using the following lines of code to extract an analyzed term from a TokenStream in Lucene.NET 4.8 but getting runtime errors.\n\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar analyzer = new StandardAnalyzer(LuceneVersion.LUCENE_48);\nTokenStream tokenStream = analyzer.TokenStream(null, new StringReader(\"myterm\"));\n\ntokenStream.Reset();\nwhile (tokenStream.IncrementToken())\n{\n var termAttr = tokenStream.GetAttribute\u0026lt;ITermAttribute\u0026gt;();\n var analyzedTerm = termAttr.Term;\n}\ntokenStream.End();\ntokenStream.Dispose();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eException thrown: \u003cstrong\u003eAn unhandled exception of type 'System.ArgumentException' occurred in Lucene.Net.dll\u003c/strong\u003e and \u003cstrong\u003eAdditional information: this AttributeSource does not have the attribute 'ITermAttribute'\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI´ve used the same approach in other versions of Lucene.NET which works fine.\u003c/p\u003e\n\n\u003cp\u003eLucene.NET 3.0.3\n\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar analyser = new StandardAnalyzer(Version.LUCENE_30);\nvar tokenStream = analyzer.TokenStream(null, new StringReader(\"myterm\"));\n\ntokenStream.Reset();\nwhile (tokenStream.IncrementToken())\n{\n var termAttr = tokenStream.GetAttribute\u0026lt;ITermAttribute\u0026gt;();\n var analyzedTerm = termAttr.Term;\n}\ntokenStream.End();\ntokenStream.Dispose();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eLucene.NET 2.9.4.1\n\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar analyser = new StandardAnalyzer(Version.LUCENE_29);\nvar tokenStream = analyser.TokenStream(null, new StringReader(\"myterm\"));\n\ntokenStream.Reset();\nwhile (tokenStream.IncrementToken())\n{\n var termAttr = tokenStream.GetAttribute(typeof(TermAttribute));\n var analyzedTerm = termAttr.ToString();\n}\ntokenStream.End();\ntokenStream.Close();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnyone who has done this in Lucene.NET 4.8?\u003c/p\u003e","answer_count":"0","comment_count":"4","creation_date":"2017-02-11 19:08:47.19 UTC","last_activity_date":"2017-02-11 19:08:47.19 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"368748","post_type_id":"1","score":"0","tags":"c#|lucene|lucene.net","view_count":"220"} +{"id":"36899975","title":"QTP I want to split that number into 13","body":"\u003cp\u003ebelow number has length of 39, I want to divide that to length 13 and Want to get that values. So I should get 3 values like A =0001098600250, b = 0001098600602, c=0001098600763. Can you please help me regarding this. 000109860025000010986006020001098600763\u003c/p\u003e","answer_count":"3","comment_count":"0","creation_date":"2016-04-27 20:12:50.147 UTC","last_activity_date":"2016-04-28 10:41:19.897 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2825360","post_type_id":"1","score":"0","tags":"split|qtp|hp-uft","view_count":"72"} +{"id":"36687415","title":"SSRS / MDX - Extra row for reversal charge","body":"\u003cp\u003eI have a financial report in SSRS that runs off an MDX query. The report is run, exported to Excel, then loaded into a financial system, like SAP.\u003c/p\u003e\n\n\u003cp\u003eI need to include a \"reversal\" row, for charges that fall in a certain category. For example (below) for anything with a \"Type\" of \"Product Freight\", I also want to include an EXTRA row, with a NEGATIVE value, essentially reversing the charge in the report.\u003c/p\u003e\n\n\u003cp\u003eThis:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e| Charge | Account | Type | Invoice | GST |\n|------------------|---------|-----------------|---------|-----|\n| Apple | 123 | Product | $100 | $10 |\n| Banana | 123 | Product | $200 | $20 |\n| Orange | 456 | Product | $150 | $15 |\n| Orange (Freight) | 456 | Product Freight | $50 | 0 |\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWould become this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e| Charge | Account | Type | Invoice | GST |\n|------------------|---------|-----------------|---------|-----|\n| Apple | 123 | Product | $100 | $10 |\n| Banana | 123 | Product | $200 | $20 |\n| Orange | 456 | Product | $150 | $15 |\n| Orange | 456 | Product Freight | $50 | 0 |\n| Orange (Freight) | 456 | Product Freight | ($50) | 0 |\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eUPDATE\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eThis is a simple version of the MDX query:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eWITH MEMBER measures.[Charge] AS\n [Charge].[Charge All].CurrentMember .member_name\n\nMEMBER measures.[Account] AS\n [Account].[Account All].CurrentMember .member_name\n\nMEMBER measures.[ChargeType] AS\n [Charge Type].[Charge Type Group].CurrentMember .member_name\n\nMEMBER measures.[GST] AS\n ( [Charge Type].[Charge Type Class].\u0026amp;[GST], measures.[value] )\n\nMEMBER measures.[InvExcGST] AS\n measures.[Value] - measures.[GST]\n\nSELECT\n{ \nmeasures.[Charge], \nmeasures.[Account], \nmeasures.[ChargeType], \nmeasures.[InvExcGST], \nmeasures.[GST] \n} \nON 0,\n\nNON EMPTY \n[Charge].[Charge All].[All].Children * \n[Account].[Account all].[all].Children * \n[Charge Type].[Charge Type Group].[All].Children \nHAVING measures.[Value] \u0026lt;\u0026gt; 0 \nON 1\n\nFROM CubeName\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"2","creation_date":"2016-04-18 07:07:42.543 UTC","favorite_count":"1","last_activity_date":"2016-05-10 17:53:56.673 UTC","last_edit_date":"2016-04-19 22:35:24.157 UTC","last_editor_display_name":"","last_editor_user_id":"4242867","owner_display_name":"","owner_user_id":"4242867","post_type_id":"1","score":"1","tags":"excel|reporting-services|mdx|financial","view_count":"27"} +{"id":"21425672","title":"How can validate either one of the textfields to be filled in Yii","body":"\u003cp\u003eI'm new to Yii framework. Now in my form I have two fields FirstName and LastName.\nI want to validate such that either of the two is filled. i.e not both should be empty.\nSuppose the user leaves both the fields empty it should not allow submit. The user should atleast enter any of these fields.\u003cbr\u003e\n\u003cstrong\u003eRules\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic function rules()\n {\n return array(\n\n array('Firstname,Lastname, email, subject, body', 'required'),\n array('email', 'email'),\n array('verifyCode', 'captcha', 'allowEmpty'=\u0026gt;!CCaptcha::checkRequirements()),\n );\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow can I do this?\u003c/p\u003e","accepted_answer_id":"21426746","answer_count":"3","comment_count":"0","creation_date":"2014-01-29 08:25:23.35 UTC","last_activity_date":"2014-01-30 04:22:06.16 UTC","last_edit_date":"2014-01-29 08:34:52.98 UTC","last_editor_display_name":"","last_editor_user_id":"3004356","owner_display_name":"","owner_user_id":"3004356","post_type_id":"1","score":"1","tags":"php|yii","view_count":"250"} +{"id":"14207972","title":"the type or namespace name 'Management' does not exist in the namespace 'MicrosoftSqlServer' are you missing an assembly reference","body":"\u003cp\u003eI am using:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eusing Microsoft.SqlServer.Management.Smo;\nusing Microsoft.SqlServer.Management.Common;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am using the above namespaces for restore database from \u003ccode\u003ec# window form\u003c/code\u003e, but the compiler tell me \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eThe type or namespace name 'Management' does not exist in the\n namespace 'MicrosoftSqlServer' are you missing an assembly reference\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eAnd I follow some advice from Google, found the \u003ccode\u003eDLL\u003c/code\u003e in \u003ccode\u003eC:\\Program Files\\Microsoft SQL Server\\100\\SDK\\Assemblies\u003c/code\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eMicrosoft.SqlServer.Smo.dll;\nMicrosoft.SqlServer.ConnectionInfo.dll\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand I copy them and paste them to all the location in my project, but I still have error message from compiler.\u003c/p\u003e\n\n\u003cp\u003eCould anyone where I can put the reference to?\u003c/p\u003e","answer_count":"2","comment_count":"1","creation_date":"2013-01-08 03:55:41.273 UTC","favorite_count":"1","last_activity_date":"2016-05-23 21:08:31.01 UTC","last_edit_date":"2015-05-26 06:34:23.797 UTC","last_editor_display_name":"","last_editor_user_id":"1080354","owner_display_name":"","owner_user_id":"1899678","post_type_id":"1","score":"5","tags":"c#|.net","view_count":"6782"} +{"id":"39426283","title":"Different solutions while integrating stiff equation","body":"\u003cp\u003eI am trying to integrate Rosenzweig-MacArthur model (equations) using Backward Differentiation Method using CVODE in C for stiff equations. I have to specify tolerance value for integration. Depending on the tolerance value I give, I get different solutions. I am not able to see which one is the correct solution. Can you please tell me what should (criteria for choosing) the tolerance value be?\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2016-09-10 12:56:22.987 UTC","last_activity_date":"2016-09-10 12:56:22.987 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6462453","post_type_id":"1","score":"0","tags":"c|differential-equations","view_count":"32"} +{"id":"38416782","title":"JavaScript: Displaying and updating text arrays","body":"\u003cp\u003eTrying to put a paragraph together on canvas with JavaScript from multiple user specified variables. I start off with...\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction special01() {\n //clean slate \n ctxx.clearRect(0, 0, ctx.width, ctx.height);\n\n //navigations important\n drawNav();\n\n //lets begin\n\n var newSlate = \"You're feeling colorChoice today!\";\n document.getElementById(\"displayed\").innerHTML = \n newSlate;\n if (user.color == 'blue') {\n var array = newSlate.replace(\"colorChoice\", \"blue\")\n }\n else if (user.color == 'red') {\n etc..etc..\n };\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI seem to be forgetting something, and being just a hobbyist, I'm not sure what. Essentially I'm just trying to replace \u003ccode\u003ecolorChoice\u003c/code\u003e with \u003ccode\u003eblue\u003c/code\u003e when \u003ccode\u003eblue\u003c/code\u003e has been selected by the user. The selection and \u003ccode\u003euser.color\u003c/code\u003e is updating correctly when selected.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-07-17 00:15:01.05 UTC","last_activity_date":"2016-07-17 00:46:34.173 UTC","last_edit_date":"2016-07-17 00:46:34.173 UTC","last_editor_display_name":"","last_editor_user_id":"6145796","owner_display_name":"","owner_user_id":"6598779","post_type_id":"1","score":"0","tags":"javascript|html","view_count":"31"} +{"id":"20593618","title":"Send data to com port virtually","body":"\u003cp\u003eI'm writing a Mathlab programe for get input from a serial port. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eserPort = serial('COM5','BaudRate', 57600);\nfopen(serPort);\n.....\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow i want to check this programe with virtual com port(COM5) and sent data to the port virtually. \nCan someone suggest a software to do this. \n(Everything is in the same computer)\u003c/p\u003e","accepted_answer_id":"20593708","answer_count":"1","comment_count":"0","creation_date":"2013-12-15 10:43:42.69 UTC","favorite_count":"1","last_activity_date":"2013-12-15 10:55:37.85 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3001352","post_type_id":"1","score":"3","tags":"windows|serial-communication","view_count":"69"} +{"id":"29229374","title":"Screen.Cursor in Firemonkey","body":"\u003cp\u003eIn Delphi 6, I could change the Mouse Cursor for all forms using \u003ccode\u003eScreen.Cursor\u003c/code\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprocedure TForm1.Button1Click(Sender: TObject);\nbegin\n Screen.Cursor := crHourglass;\nend;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am searching the equivalent in Firemonkey.\u003c/p\u003e\n\n\u003cp\u003eFollowing function does not work:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprocedure SetCursor(ACursor: TCursor);\nvar\n CS: IFMXCursorService;\nbegin\n if TPlatformServices.Current.SupportsPlatformService(IFMXCursorService) then\n begin\n CS := TPlatformServices.Current.GetPlatformService(IFMXCursorService) as IFMXCursorService;\n end;\n if Assigned(CS) then\n begin\n CS.SetCursor(ACursor);\n end;\nend;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I insert a \u003ccode\u003eSleep(2000);\u003c/code\u003e at the end of the procedure, I can see the cursor for 2 seconds. But the Interface probably gets freed and therefore, the cursor gets automatically resetted at the end of the procedure. I also tried to define \u003ccode\u003eCS\u003c/code\u003e as a global variable, and add \u003ccode\u003eCS._AddRef\u003c/code\u003e at the end of the procedure to prevent the Interface to be freed. But it did not help either.\u003c/p\u003e\n\n\u003cp\u003eFollowing code does work, but will only work for the main form:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprocedure TForm1.Button1Click(Sender: TObject);\nbegin\n Application.MainForm.Cursor := crHourGlass;\nend;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSince I want to change the cursor for all forms, I would need to iterate through all forms, but then the rollback to the previous cursors is tricky, as I need to know the previous cursor for every form.\u003c/p\u003e\n\n\u003cp\u003eMy intention:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprocedure TForm1.Button1Click(Sender: TObject);\nvar\n prevCursor: TCursor;\nbegin\n prevCursor := GetCursor;\n SetCursor(crHourglass); // for all forms\n try\n Work;\n finally\n SetCursor(prevCursor);\n end;\nend;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"0","creation_date":"2015-03-24 09:46:56.24 UTC","favorite_count":"1","last_activity_date":"2015-03-24 19:50:44.737 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"488539","post_type_id":"1","score":"5","tags":"delphi|firemonkey","view_count":"3075"} +{"id":"23450664","title":"Comparing histograms without white color included OpenCV","body":"\u003cp\u003eIs there a way that compares histograms but for example white color to be excluded and so white color doesn't affect onto the comparison. \u003c/p\u003e","accepted_answer_id":"23453884","answer_count":"1","comment_count":"0","creation_date":"2014-05-03 22:54:17.09 UTC","last_activity_date":"2014-05-04 07:51:29.447 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3577807","post_type_id":"1","score":"0","tags":"opencv|image-processing|filter|comparison|histogram","view_count":"516"} +{"id":"25080057","title":"MongoDB extension is not working in Wamp","body":"\u003cp\u003eI want to use MongoDB in my Symfony2 project. I added in composer.json (required section)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \"doctrine/mongodb\": \"1.2.*@dev\",\n \"doctrine/mongodb-odm\": \"1.0.*@dev\",\n \"doctrine/mongodb-odm-bundle\": \"3.0.*@dev\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut when I updated composer, an error occurred\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eProblem 1\n- Installation request for doctrine/mongodb 1.2.*@dev -\u0026gt; satisfiable by doctrine/mongodb[1.2.x-dev].\n- doctrine/mongodb 1.2.x-dev requires ext-mongo \u0026gt;=1.2.12,\u0026lt;1.6-dev -\u0026gt; the requested PHP extension mongo is missing from your system.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am using Wamp and I added (as indicated in \u003ca href=\"https://stackoverflow.com/questions/13523109/php-startup-mongo-unable-to-initialize-module\"\u003ethis\u003c/a\u003e post) php_mongo.dll in the ext directory. phpinfo() function indicates that Mongo is available\nWhen I press the Wamp button, \"php_mongo\" extension appears.\nHowever, when I execute \u003ccode\u003ephp -m\u003c/code\u003e, mongo extension isn't listed.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eC:\\wamp\\www\u0026gt;php --ini\nConfiguration File (php.ini) Path: C:\\Windows\nLoaded Configuration File: C:\\wamp\\bin\\php\\php5.4.16\\php.ini\nScan for additional .ini files in: (none)\nAdditional .ini files parsed: (none)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI don't have any file like php.ini in the C:\\Windows directory.\u003c/p\u003e","accepted_answer_id":"25096499","answer_count":"1","comment_count":"1","creation_date":"2014-08-01 12:14:56.403 UTC","last_activity_date":"2014-08-02 15:17:26.42 UTC","last_edit_date":"2017-05-23 10:30:05.69 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"1960671","post_type_id":"1","score":"0","tags":"php|mongodb|symfony|module|wamp","view_count":"459"} +{"id":"3154284","title":"How often to call DataContext.SubmitChanges() for a large number of inserts?","body":"\u003cp\u003eHow many \u003ccode\u003eInsertOnSubmit\u003c/code\u003e should I call before calling \u003ccode\u003eSubmitChanges\u003c/code\u003e? I'm adding data from a web service that can return tens of thousands of records one record at a time. The wrapper class around the web service exposes the records a an \u003ccode\u003eIEnumberable\u003c/code\u003e collection to hide an elaborate chunking mechanism.\u003c/p\u003e\n\n\u003cp\u003eAre there guidelines on how many inserts I should accumulate before submitting them?\u003c/p\u003e","accepted_answer_id":"3156793","answer_count":"4","comment_count":"1","creation_date":"2010-07-01 00:00:53.233 UTC","last_activity_date":"2013-08-12 18:26:46.98 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"150058","post_type_id":"1","score":"0","tags":"c#|.net|linq-to-sql|submitchanges","view_count":"2456"} +{"id":"43222578","title":"How to turn on the visibility of a \u003ca\u003e which is on the master page from code behind file?","body":"\u003cp\u003eHere is the snippet of the code inside my master page.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;section id=\"login\"\u0026gt;\n \u0026lt;asp:LoginView runat=\"server\" ViewStateMode=\"Disabled\"\u0026gt;\n \u0026lt;AnonymousTemplate\u0026gt;\n \u0026lt;ul\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a id=\"loginLink\" runat=\"server\" href=\"~/Login.aspx\"\u0026gt;Log in\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a id=\"logoutLink\" runat=\"server\" href=\"#\" visible=\"false\"\u0026gt;Logout\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n \u0026lt;/AnonymousTemplate\u0026gt;\n \u0026lt;/asp:LoginView\u0026gt;\n\u0026lt;/section\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI would like to turn on the visibility of hyperlink with the id of \u003ccode\u003e#logoutlink\u003c/code\u003e from one of my pages' code behind file. I tried this way but didn't work.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprotected void Page_Load(object sender, EventArgs e)\n{\n HyperLink x = (HyperLink)Master.FindControl(\"logoutLink\");\n x.Visible = true;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny help would be appreciated.\u003c/p\u003e","accepted_answer_id":"43223131","answer_count":"1","comment_count":"3","creation_date":"2017-04-05 05:32:23.85 UTC","last_activity_date":"2017-04-05 06:10:31.657 UTC","last_edit_date":"2017-04-05 05:56:14.873 UTC","last_editor_display_name":"","last_editor_user_id":"107625","owner_display_name":"","owner_user_id":"4067954","post_type_id":"1","score":"0","tags":"asp.net|master-pages","view_count":"37"} +{"id":"11364329","title":"How do I combine these two tables so I have one which displays both State and Zip code?","body":"\u003cp\u003eI have two queries that find both the Zip codes, and the States for all the respondents in our database. Here they are\u003c/p\u003e\n\n\u003cp\u003eFor ZIP code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eselect top 100 S.ID as SurveyID, S.SID, S.SurveyNumber, S.ABCSurveyName, SE.RespondentID, Q.name as QuestionName, rp.Condition as ZipCode\nfrom Surveys S \n join Sessions SE \n on S.id = SE.SurveyID \n join RespondentProfiles rp\n on RP.RespondentID = SE.RespondentID\n join Questions Q \n on Q.ID = rp.QuestionID\nwhere q.name = 'ZIP'\n and S.ID = 13900\n and Q.LK_RecordStatusID = 1\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFor state:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eselect VW.ID as SurveyID, VW.SID, SurveyNumber, ABCSurveyName, RespondentID, VW.Name as QuestionName, st.Code as State\nfrom (\n select top 100 S.ID, S.SID, S.SurveyNumber, S.ABCSurveyName, SE.RespondentID, Q.name, rp.Condition \n from Surveys S \n join Sessions SE \n on S.id = SE.SurveyID \n join RespondentProfiles rp\n on RP.RespondentID = SE.RespondentID\n join Questions Q \n on Q.ID = rp.QuestionID\n where S.ID = 13900\n and q.name = 'STATE'\n and Q.LK_RecordStatusID = 1\n\n) VW\n join LK_States st\n on st.ID = vw.Condition\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis works, but I'd like to have them all in one table, i.e. Zip Code and State.\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e\n\n\u003cp\u003equestions schema:\u003c/p\u003e\n\n\u003cp\u003eColumn_name Type Computed Length Prec Scale Nullable \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eTrimTrailingBlanks FixedLenNullInSource Collation\nID int no 4 10 0 no (n/a) (n/a) NULL\nSID nvarchar no 128 yes (n/a) (n/a) SQL_Latin1_General_CP1_CI_AS\nName nvarchar no 64 yes (n/a) (n/a) SQL_Latin1_General_CP1_CI_AS\nQuestionIdentifier nvarchar no 128 yes (n/a) (n/a) SQL_Latin1_General_CP1_CI_AS\nParentID int no 4 10 0 yes (n/a) (n/a) NULL\nLK_QuestionTypeID int no 4 10 0 yes (n/a) (n/a) NULL\nLK_QuestionCategoryID int no 4 10 0 yes (n/a) (n/a) NULL\nLK_IndustryID int no 4 10 0 yes (n/a) (n/a) NULL\nOptionMask nvarchar no 512 yes (n/a) (n/a) SQL_Latin1_General_CP1_CI_AS\nMetaTags ntext no 16 yes (n/a) (n/a) SQL_Latin1_General_CP1_CI_AS\nOrder int no 4 10 0 yes (n/a) (n/a) NULL\nRows int no 4 10 0 yes (n/a) (n/a) NULL\nColumns int no 4 10 0 yes (n/a) (n/a) NULL\nIsDisplay bit no 1 yes (n/a) (n/a) NULL\nAnswerLifespan int no 4 10 0 yes (n/a) (n/a) NULL\nCreateUserID int no 4 10 0 yes (n/a) (n/a) NULL\nCreateDate datetime no 8 yes (n/a) (n/a) NULL\nUpdateUserID int no 4 10 0 yes (n/a) (n/a) NULL\nUpdateDate datetime no 8 yes (n/a) (n/a) NULL\nLK_RecordStatusID bit no 1 yes (n/a) (n/a) NULL\nLK_QuestionClassID int no 4 10 0 yes (n/a) (n/a) NULL\nLK_QuestionVisibilityID int no 4 10 0 yes (n/a) (n/a) NULL\nDisplayLK_QuestionTypeID int no 4 10 0 yes (n/a) (n/a) NULL\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"11364954","answer_count":"2","comment_count":"7","creation_date":"2012-07-06 14:37:43.897 UTC","last_activity_date":"2012-07-06 21:28:08.443 UTC","last_edit_date":"2012-07-06 21:28:08.443 UTC","last_editor_display_name":"","last_editor_user_id":"763029","owner_display_name":"","owner_user_id":"763029","post_type_id":"1","score":"0","tags":"sql|sql-server|query-optimization","view_count":"113"} +{"id":"31174727","title":"I am writing a script to embed Youtube or vimeo videos into magento product page","body":"\u003cp\u003eYoutube embed code has letters and vimeo embed code has numbers example v?cVxmbd5 and Vimeo is like Vimeo.com/6847539 . I am writing a script to pull the end of embed strings with letters to match it with top iframe and pull end of embed strings with no letters to match with bottom iframe. \u003c/p\u003e\n\n\u003cp\u003eThis script is supposed to embed videos into a video tab on the product view page. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\n$_product = $this-\u0026gt;getProduct();\nif ($_product-\u0026gt;getVideo())\n$videos = explode(', ', $_product-\u0026gt;getVideo());\n\nforeach ($videos as $video) {\n\nif (ctype_digit($video)) {\necho \"\u0026lt;iframe width = '560' height = '315' style = 'max-width:100%;' src = 'https://player.vimeo.com/video/\" . $video . \"' frameborder = '0' allowfullscreen\u0026gt;\u0026lt;/iframe\u0026gt;\";\n} else {\n\n\n echo \"\u0026lt;iframe width = '560' height = '315' style = 'max-width:100%;' src = 'http://www.youtube.com/embed/\" . $video . \"' frameborder = '0' allowfullscreen\u0026gt;\u0026lt;/iframe\u0026gt;\";\n\n}\n}\n\n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"4","creation_date":"2015-07-02 02:33:07.253 UTC","favorite_count":"2","last_activity_date":"2015-07-03 14:44:33.65 UTC","last_edit_date":"2015-07-03 14:44:33.65 UTC","last_editor_display_name":"","last_editor_user_id":"4676766","owner_display_name":"","owner_user_id":"4676766","post_type_id":"1","score":"1","tags":"php|magento|if-statement","view_count":"260"} +{"id":"32801188","title":"How do I show my database data into TableView?","body":"\u003cp\u003eI am trying to show my database data into TableView. I have a database named info and there is two columns '\u003cstrong\u003efname\u003c/strong\u003e' and '\u003cstrong\u003elname\u003c/strong\u003e' into the table '\u003cstrong\u003edata\u003c/strong\u003e'. I am trying to show the data into tableview format. I've tried the following code-\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epackage imran.jfx.application;\n\nimport java.net.URL;\nimport java.sql.Connection;\nimport java.sql.DriverManager;\nimport java.sql.PreparedStatement;\nimport java.sql.ResultSet;\nimport java.sql.SQLException;\nimport java.util.ResourceBundle;\n\nimport javafx.event.ActionEvent;\nimport javafx.fxml.FXML;\nimport javafx.fxml.Initializable;\nimport javafx.scene.control.TableColumn;\n\npublic class Controller implements Initializable {\n\n @FXML\n private TableView\u0026lt;?\u0026gt; dataView;\n\n @FXML\n private TableColumn\u0026lt;?, ?\u0026gt; english;\n\n @FXML\n private TableColumn\u0026lt;?, ?\u0026gt; bangla;\n\n @FXML\n private Button getData;\n\n ResultSet result;\n PreparedStatement doQuery;\n Connection conn;\n String query;\n\n @Override\n public void initialize(URL location, ResourceBundle resources) {\n try {\n Class.forName(\"org.sqlite.JDBC\");\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n }\n String url = \"jdbc:sqlite::resource:database/info.db\";\n try {\n conn = DriverManager.getConnection(url);\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }\n\n @FXML\n void showData(ActionEvent event) throws SQLException {\n query=\"select fname,lname from data\";\n\n ResultSet result = conn.createStatement().executeQuery(query);\n\n while (result.next()) \n { \n //Can't understand how should I write here to show the data\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow should I do it?\u003c/p\u003e","answer_count":"0","comment_count":"7","creation_date":"2015-09-26 19:36:45.357 UTC","last_activity_date":"2015-09-26 20:13:27.143 UTC","last_edit_date":"2015-09-26 20:13:27.143 UTC","last_editor_display_name":"","last_editor_user_id":"3989705","owner_display_name":"","owner_user_id":"3989705","post_type_id":"1","score":"0","tags":"java|javafx|javafx-2|javafx-8","view_count":"66"} +{"id":"12995919","title":"cPanel Cron Job Run PHP File","body":"\u003cp\u003eI am trying to get my cronjob to work in cPanel.\u003c/p\u003e\n\n\u003cp\u003eI want to run the PHP file located at \u003ccode\u003ehttp://www.mydomain.com/path/cron-job.php\u003c/code\u003e\u003cbr\u003e\nBut it have to include \u003ccode\u003e?code=something\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eSo it would be this: \u003ccode\u003ehttp://www.mydomain.com/path/cron-job.php?code=something\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eI tried using the following commands:\n\u003ccode\u003ephp -q /home/mydomain/public_html/path/cron-jpb.php?code=something \u0026gt;/dev/null\u003c/code\u003e\u003cbr\u003e\nand\u003cbr\u003e\n\u003ccode\u003e/usr/bin/php -q /home/mydomain/public_html/path/cron-jpb.php?code=something \u0026gt;/dev/null\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eBut all without luck.. Any ideas what could be wrong?\u003c/p\u003e","accepted_answer_id":"12998874","answer_count":"1","comment_count":"0","creation_date":"2012-10-21 07:39:05.02 UTC","last_activity_date":"2012-10-21 14:43:39.873 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1735817","post_type_id":"1","score":"0","tags":"cron|cpanel","view_count":"705"} +{"id":"16287127","title":"Can I use a combo box to change the voice of my speech synthesizer to one of the system TTS voices?","body":"\u003cp\u003eI would like to have a combo box on my form which allows the user to select the voice which they would like to use. How can I implement such a feature?\u003c/p\u003e\n\n\u003cp\u003eCurrently, my form consists of four buttons and a combo box. The code behind the buttons and the synthesizer is as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate void button1_Click(object sender, EventArgs e)\n {\n reader.Dispose();\n if (Basic_Word_Processor.Instance.richTextBoxPrintCtrl1.Text != \"\")\n {\n reader = new SpeechSynthesizer();\n reader.SpeakAsync(Basic_Word_Processor.Instance.richTextBoxPrintCtrl1.Text)\n button2.Enabled = true;\n button4.Enabled = true;\n reader.SpeakCompleted += new EventHandler\u0026lt;SpeakCompletedEventArgs\u0026gt;(reader_SpeakCompleted);\n }\n else\n {\n MessageBox.Show(\"Please insert text before launching Text to Speech.\", \"Error\", MessageBoxButtons.OK, MessageBoxIcon.Error);\n }\n }\n void reader_SpeakCompleted(object sender, SpeakCompletedEventArgs e)\n {\n button2.Enabled = false;\n button3.Enabled = false;\n button4.Enabled = false;\n }\n private void button2_Click(object sender, EventArgs e)\n {\n if (reader != null)\n {\n if (reader.State == SynthesizerState.Speaking)\n {\n reader.Pause();\n button3.Enabled = true;\n }\nprivate void button3_Click(object sender, EventArgs e)\n {\n if (reader != null)\n {\n if (reader.State == SynthesizerState.Paused)\n {\n reader.Resume();\n }\n button3.Enabled = false;\n }\n }\n\n\n private void button4_Click(object sender, EventArgs e)\n {\n if (reader != null)\n {\n reader.Dispose();\n button2.Enabled = false;\n button3.Enabled = false;\n button4.Enabled = false;\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI would like to populate a combo box with a list of currently installed voices, which, when the user clicks one, reads the text from richTextBoxPrintCtrl1 in the selected voice. Currently, the synthesizer works, but I would like to add this feature to my Text to Speech feature.\u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-04-29 19:56:14.153 UTC","favorite_count":"1","last_activity_date":"2013-09-20 11:56:37.46 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2259739","post_type_id":"1","score":"1","tags":"c#|.net-4.0|text-to-speech|speech-synthesis","view_count":"999"} +{"id":"13184154","title":"django admin registering dynamic model from action","body":"\u003cp\u003eI have strange problem. In admin.py I can say:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eadmin.site.register(MyModel)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand this is obviously fine. Now I want this model to be loaded automatically as an result of user action:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef user_action_from_admin_panel(......):\n .....\n admin.site.register(MyModel)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMyModel class gets shows up in the admin as plain text without links.\nAny ideas to solve this?\u003c/p\u003e","answer_count":"4","comment_count":"6","creation_date":"2012-11-01 19:29:18.38 UTC","favorite_count":"0","last_activity_date":"2015-04-14 12:40:36.81 UTC","last_edit_date":"2015-04-14 12:36:03.233 UTC","last_editor_display_name":"","last_editor_user_id":"2698552","owner_display_name":"","owner_user_id":"114561","post_type_id":"1","score":"2","tags":"python|django|dynamic|django-models|django-admin","view_count":"653"} +{"id":"44940712","title":"No 'seek_preroll' and 'codec_delay' in audio header","body":"\u003cp\u003eWhen SB_API_VERSION is not less than SB_AUDIO_SPECIFIC_CONFIG_AS_POINTER, 'codec private' for Opus has been passed to starboard.\u003c/p\u003e\n\n\u003cp\u003eBut I am not very sure whether the audio sample was preprocessed with 'codec delay' and 'seek preroll', is it unnecessary for audio decoder to use those?\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2017-07-06 05:49:37.563 UTC","last_activity_date":"2017-07-10 12:31:32.52 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"8062660","post_type_id":"1","score":"0","tags":"cobalt","view_count":"64"} +{"id":"11055124","title":"Using Intersect I'm getting a Local sequence cannot be used in LINQ to SQL implementations of query operators except the Contains operator","body":"\u003cp\u003eI'm using a Linq to SQL query to provide a list of search term matches against a database field. The search terms are an in memory string array. Specifically, I'm using an \"intersect\" within the Linq query, comparing the search terms with a database field \"Description\". In the below code, the description field is iss.description. The description field is separated into an array within the Linq query and the intersect is used to compare the search terms and description term to keep all of the comparing and conditions within the Linq query so that the database is not taxed. In my research, trying o overcome the problem, I have found that the use of an in-memory, or \"local\" sequence is not supported. I have also tried a few suggestions during my research, like using \"AsEnumerable\" or \"AsQueryable\" without success.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esearchText = searchText.ToUpper();\nvar searchTerms = searchText.Split(' ');\n\nvar issuesList1 = (\n from iss in DatabaseConnection.CustomerIssues\n\n let desc = iss.Description.ToUpper().Split(' ')\n let count = desc.Intersect(searchTerms).Count()\n where desc.Intersect(searchTerms).Count() \u0026gt; 0\n\n join stoi in DatabaseConnection.SolutionToIssues on iss.IssueID equals stoi.IssueID into stoiToiss\n from stTois in stoiToiss.DefaultIfEmpty()\n join solJoin in DatabaseConnection.Solutions on stTois.SolutionID equals solJoin.SolutionID into solutionJoin\n from solution in solutionJoin.DefaultIfEmpty()\n select new IssuesAndSolutions\n {\n IssueID = iss.IssueID,\n IssueDesc = iss.Description,\n SearchHits = count,\n SolutionDesc = (solution.Description == null)? \"No Solutions\":solution.Description,\n SolutionID = (solution.SolutionID == null) ? 0 : solution.SolutionID,\n SolutionToIssueID = (stTois.SolutionToIssueID == null) ? 0 : stTois.SolutionToIssueID,\n Successful = (stTois.Successful == null)? false : stTois.Successful\n }).ToList();\n ...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe only way I have been successful is to create two queries and calling a method as shown below, but this requires the Linq Query to return all of the matching results (with the number of hits for search terms in the description) including the non-matched records and provide an in-memory List\u0026lt;\u003e and then use another Linq Query to filter out the non-matched records.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic static int CountHits(string[] searchTerms, string Description)\n {\n int hits = 0;\n foreach (string item in searchTerms)\n {\n if (Description.ToUpper().Contains(item.Trim().ToUpper())) hits++;\n } \n return hits;\n }\n public static List\u0026lt;IssuesAndSolutions\u0026gt; SearchIssuesAndSolutions(string searchText)\n {\n using (BYCNCDatabaseDataContext DatabaseConnection = new BYCNCDatabaseDataContext())\n {\n searchText = searchText.ToUpper();\n var searchTerms = searchText.Split(' ');\n\n var issuesList1 = (\n from iss in DatabaseConnection.CustomerIssues\n join stoi in DatabaseConnection.SolutionToIssues on iss.IssueID equals stoi.IssueID into stoiToiss\n from stTois in stoiToiss.DefaultIfEmpty()\n join solJoin in DatabaseConnection.Solutions on stTois.SolutionID equals solJoin.SolutionID into solutionJoin\n from solution in solutionJoin.DefaultIfEmpty()\n select new IssuesAndSolutions\n {\n IssueID = iss.IssueID,\n IssueDesc = iss.Description,\n SearchHits = CountHits(searchTerms, iss.Description),\n SolutionDesc = (solution.Description == null)? \"No Solutions\":solution.Description,\n SolutionID = (solution.SolutionID == null) ? 0 : solution.SolutionID,\n SolutionToIssueID = (stTois.SolutionToIssueID == null) ? 0 : stTois.SolutionToIssueID,\n Successful = (stTois.Successful == null)? false : stTois.Successful\n }).ToList();\n\n var issuesList = (\n from iss in issuesList1\n where iss.SearchHits \u0026gt; 0\n select iss).ToList();\n ...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI would be comfortable with two Linq Queries, but with the first Linq Query only returning the matched records and then maybe using a second, maybe lambda expression to order them, but my trials have not been successful.\u003c/p\u003e\n\n\u003cp\u003eAny help would be most appreciated.\u003c/p\u003e","accepted_answer_id":"11061291","answer_count":"1","comment_count":"5","creation_date":"2012-06-15 16:59:36.557 UTC","last_activity_date":"2012-06-16 06:13:33.577 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1459234","post_type_id":"1","score":"1","tags":"c#|linq-to-sql|sequence|local|intersect","view_count":"391"} +{"id":"7582368","title":"\"Edit profile\" form is not populated using FOSUserBundle","body":"\u003cp\u003eI have User entity with properties like name, address, and I want these fields to be editable on \"edit profile\" page. Sounds easy, but I couldn't make it work following official documentation. My form is not populated with the User data, though I have configured services (form type, form handler).\u003c/p\u003e\n\n\u003cp\u003eI suppose that it might be because \u003ccode\u003e$this-\u0026gt;form-\u0026gt;getData()\u003c/code\u003e should get \u003ccode\u003eCheckPassword\u003c/code\u003e object, but I pass User entity to it (function \u003ccode\u003eprocess()\u003c/code\u003e in \u003ccode\u003eProfileFormHandler.php\u003c/code\u003e). Or not ?\u003c/p\u003e\n\n\u003cp\u003eHow to populate form with User data?\u003c/p\u003e\n\n\u003cp\u003eAll related files are here - \u003ca href=\"http://www.pastie.org/2604806\" rel=\"nofollow\"\u003ehttp://www.pastie.org/2604806\u003c/a\u003e\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2011-09-28 11:15:27.583 UTC","favorite_count":"0","last_activity_date":"2012-08-24 08:56:22.3 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"550451","post_type_id":"1","score":"0","tags":"forms|symfony","view_count":"833"} +{"id":"16514224","title":"Explain structure of site.categories","body":"\u003cp\u003eJekyll supplies a \u003ccode\u003esite.categories\u003c/code\u003e variable that is accessible to liquid templates. In my site I currently have two categories with one post each. From looking at the jekyll bootstrap \u003ccode\u003ecategories.html\u003c/code\u003e I know:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{% for category in site.categories %}\n {{ category[0] }}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI know this renders to the category's name. However if I also do:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e {% for item in category %}\n {{ item }}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt seems category has two items: its name and the post. This makes no sense to me. \u003ccode\u003ecategory[0]\u003c/code\u003e is \u003ccode\u003ename\u003c/code\u003e and then an array of posts starts at index 1? Why does this make sense? I wonder if this comes from Ruby somehow, but I don't know Ruby. (Since Jekyll is written in Ruby I'm adding this tag, since I suspect much of the syntax is derivative.)\u003c/p\u003e\n\n\u003cp\u003eHow do I determine the structure of \u003ccode\u003esite.categories\u003c/code\u003e? I don't know how to debug this and don't understand liquid syntax well enough to know why this behavior makes sense.\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2013-05-13 02:51:29.05 UTC","favorite_count":"1","last_activity_date":"2013-05-13 13:21:32.113 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1339987","post_type_id":"1","score":"0","tags":"ruby|jekyll|liquid","view_count":"113"} +{"id":"20625674","title":"Multiple ids and an unique name","body":"\u003cp\u003eI am very new in Ruby and JavaScript, so I not sure about what I am doing. I have a dropdown box that I would like to show by unique name. \u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eI use JavaScript(CoffeeScript) to get the results with JSON\u003c/li\u003e\n\u003cli\u003eI created a method to show by unique name (It is working)\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eMy problem is how can I get both ids? When I select a object the value is the id, and the text method is the name. For example, if I have 3 objects with the same name, I need to get three ids. Now, I am getting just one.\u003c/p\u003e\n\n\u003cp\u003eIs there another way to do it? Thanks a lot!\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eTABLE OBJECTS\n\nID\nNAME (I have duplicates in name)\nMODEL\n\nUNIQUE INDEX (NAME, MODEL)\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"20625726","answer_count":"1","comment_count":"2","creation_date":"2013-12-17 03:59:31.19 UTC","last_activity_date":"2013-12-17 04:05:12.407 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2812886","post_type_id":"1","score":"1","tags":"javascript|json|ruby-on-rails-3.2|coffeescript","view_count":"54"} +{"id":"17009603","title":"Java Inheritance Query","body":"\u003cp\u003eSay I have two classes where SubClass inherits from (extends) SuperClass.\u003c/p\u003e\n\n\u003cp\u003eWhat is the difference between:\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eSuperClass obj1 = new SubClass();\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eand:\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eSubClass obj2 = new SubClass();\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eBoth will look to the constructor of the Superclass and initialise it (the correct one, obviously). Both have access to the superclass implementations. But one is (as far as I am aware) a subclass wrapped in a superclass (the first example) and the other is a subclass object (the second example).\u003c/p\u003e\n\n\u003cp\u003eHow will this effect the way code is run and interpreted?\u003c/p\u003e\n\n\u003cp\u003eWhat are the real world issues that a developer needs to be aware of regarding how these two objects differ?\u003c/p\u003e\n\n\u003cp\u003eThanks in advance for any help!\u003c/p\u003e","accepted_answer_id":"17009722","answer_count":"3","comment_count":"1","creation_date":"2013-06-09 12:28:39.16 UTC","last_activity_date":"2013-06-09 13:03:23.733 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1360809","post_type_id":"1","score":"1","tags":"java|inheritance","view_count":"59"} +{"id":"30044560","title":"how to enable and disable the button's one \u0026 another in oracle forms 10g","body":"\u003cp\u003eI have create,save,update and delete button's in a form. At first only create button must be enabled and all other buttons disabled, once we create a record, then the save button is enabled. The update and delete button is enabled after we click on save button.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-05-05 04:55:13.983 UTC","last_activity_date":"2017-01-31 08:49:03.48 UTC","last_edit_date":"2015-05-05 08:55:09.977 UTC","last_editor_display_name":"","last_editor_user_id":"687887","owner_display_name":"","owner_user_id":"2071291","post_type_id":"1","score":"0","tags":"oracle|oracleforms","view_count":"6492"} +{"id":"31022245","title":"Push failed in clion","body":"\u003cp\u003eI make c++ project and add it to GitHub but when I try to push I get that error what is the problem here?\u003c/p\u003e\n\n\u003cp\u003e**Note: I create the repo in GitHub first then push to it.\u003c/p\u003e\n\n\u003cp\u003ebut if I choose share to GitHub at first everything works very well.\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/caPmF.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2015-06-24 09:04:05.727 UTC","last_activity_date":"2015-06-24 09:22:35.183 UTC","last_edit_date":"2015-06-24 09:22:35.183 UTC","last_editor_display_name":"","last_editor_user_id":"3998402","owner_display_name":"","owner_user_id":"3998402","post_type_id":"1","score":"0","tags":"git|github|clion","view_count":"323"} +{"id":"33735326","title":"How is this program still taking method copy in the stack even after the StackOverflowError?","body":"\u003cp\u003eIf in the try block, the recursive calling of \u003ccode\u003emain\u003c/code\u003e method gives StackOverflowError then how is the copies of method test still being put on the stack?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass CatchError\n{\n static void test()\n {\n System.out.println(\"test\");\n }\n public static void main(String[] args)\n {\n try\n {\n main(null);\n }\n catch(Throwable ex)\n {\n System.out.println(\"Stack Overflow Error\");\n for(int i=0;i\u0026lt;10;i++)\n {\n test();\n }\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"1","creation_date":"2015-11-16 12:24:08.467 UTC","last_activity_date":"2015-11-16 15:14:16.89 UTC","last_edit_date":"2015-11-16 15:14:16.89 UTC","last_editor_display_name":"","last_editor_user_id":"2499035","owner_display_name":"","owner_user_id":"3450970","post_type_id":"1","score":"-2","tags":"java|exception|stack","view_count":"41"} +{"id":"9044928","title":"How to alert vibrate loop with 10 seconds on Blackberry?","body":"\u003cp\u003eI have a screen. I want alert vibrate with 10th seconds, 20th seconds, 30th seconds....\nHow can I do that ?\nThanks for reading\u003c/p\u003e","accepted_answer_id":"9046248","answer_count":"2","comment_count":"0","creation_date":"2012-01-28 11:32:24.917 UTC","last_activity_date":"2012-01-30 12:43:09.27 UTC","last_edit_date":"2012-01-30 12:43:09.27 UTC","last_editor_display_name":"","last_editor_user_id":"865466","owner_display_name":"","owner_user_id":"969844","post_type_id":"1","score":"2","tags":"blackberry","view_count":"225"} +{"id":"42115235","title":"JQuery change CSS property of two div's","body":"\u003cp\u003eI have two \u003ccode\u003ediv\u003c/code\u003e's in my HTML \u003ccode\u003emodal-footer\u003c/code\u003e \u0026amp; \u003ccode\u003emodal-header\u003c/code\u003e and I want to change the background color of these by clicking a switch. \u003c/p\u003e\n\n\u003cp\u003eI got the switch from a ww3schools tutorial \u003ca href=\"http://www.w3schools.com/howto/howto_css_switch.asp\" rel=\"nofollow noreferrer\"\u003ehere\u003c/a\u003e and I want the background color to change, when I switch it.\u003c/p\u003e\n\n\u003cp\u003eHTML of the switch: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;label class=\"switch\"\u0026gt;\n \u0026lt;input type=\"checkbox\"\u0026gt;\n \u0026lt;div class=\"slider round\"\u0026gt;\u0026lt;/div\u0026gt;\n\u0026lt;/label\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI already tried something like \u003ca href=\"http://pastebin.com/qgkfRMX4\" rel=\"nofollow noreferrer\"\u003ethis\u003c/a\u003e but it didn't work.\nAnyone have a solution for that?\u003c/p\u003e","accepted_answer_id":"42115544","answer_count":"5","comment_count":"3","creation_date":"2017-02-08 14:04:00.597 UTC","last_activity_date":"2017-02-08 15:29:18.47 UTC","last_edit_date":"2017-02-08 14:08:23.147 UTC","last_editor_display_name":"","last_editor_user_id":"2181514","owner_display_name":"","owner_user_id":"7174784","post_type_id":"1","score":"0","tags":"jquery|html|css","view_count":"65"} +{"id":"39612957","title":"Hive connectivity error in Pentaho DI","body":"\u003cp\u003eI am getting a below error while I am trying to do a test connection on hive localhost in pentaho di.\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eError connecting to database [HiveConn] : \n org.pentaho.di.core.exception.KettleDatabaseException: Error occurred while \u003e trying to connect to the database\u003c/p\u003e\n \n \u003cp\u003eError connecting to database: (using class \n org.apache.hadoop.hive.jdbc.HiveDriver) loader constraint violation: loader \u003e (instance of java/net/URLClassLoader) previously initiated loading for a \n different type with name \"org/apache/thrift/protocol/TProtocol\"\u003c/p\u003e\n \n \u003cp\u003eorg.pentaho.di.core.exception.KettleDatabaseException: \n Error occurred while trying to connect to the database\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003ePlease let me know what could be the reason.\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2016-09-21 09:44:17.167 UTC","last_activity_date":"2016-09-21 09:44:17.167 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1076774","post_type_id":"1","score":"0","tags":"hadoop|hive|hiveql|pentaho-data-integration","view_count":"26"} +{"id":"21983170","title":"90th percentile latency of memcached","body":"\u003cp\u003eI'm running the memaslap client from libmemcached 1.0.16 to benchmark memcached-1.4.15 and I want to get the 90th percentile latency.\u003c/p\u003e\n\n\u003cp\u003eIs there a good way to get it from memaslap? \u003c/p\u003e\n\n\u003cp\u003eOr are there other benchmark tools that make it easier to extract the 90th percentile latency?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-02-24 09:05:56.05 UTC","favorite_count":"1","last_activity_date":"2014-02-27 10:10:42.47 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1117810","post_type_id":"1","score":"0","tags":"memcached|libmemcached","view_count":"531"} +{"id":"7502739","title":"Magento - Fatal error: spl_autoload() after adding to cart.","body":"\u003cp\u003eI have just started experiencing this problem:\nThe site is fine until I add something to my cart at which point I start to receive the following error at the bottom of the page:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eFatal error: spl_autoload() [\u0026lt;a href=’function.spl-autoload’\u0026gt;function.spl-autoload\u0026lt;/a\u0026gt;]: Class Mage could not be loaded in /blah/blah/app/code/core/Mage/Core/functions.php on line 244\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe logged in user also gets logged out and they can not log back in again.\u003c/p\u003e\n\n\u003cp\u003eI’ve seen a couple of forum posts that talk about this possibly being a problem with memory but my hosts (Rackspace) assure me that the memory is fine (i’ve got 16GB of RAM).\u003c/p\u003e\n\n\u003cp\u003eSo I’m stuck.\u003c/p\u003e\n\n\u003cp\u003eI don't think I've changed any code to cause this. But I'm not sure.\u003c/p\u003e\n\n\u003cp\u003eThanks! \u003c/p\u003e","accepted_answer_id":"7527993","answer_count":"2","comment_count":"3","creation_date":"2011-09-21 15:47:13.933 UTC","last_activity_date":"2012-10-21 07:39:03.777 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"491055","post_type_id":"1","score":"0","tags":"magento","view_count":"2157"} +{"id":"12780135","title":"How to insert already displayed div in print function","body":"\u003cp\u003eHow can I insert div that is already shown on web page in the print function.\u003c/p\u003e\n\n\u003cp\u003eThis is the function:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction printHTML(input){\n var iframe = document.createElement(\"iframe\");\n document.body.appendChild(iframe);\n\n iframe.contentWindow.document.write(input);\n iframe.contentWindow.print();\n document.body.removeChild(iframe); \n}\n\nprintHTML('\u0026lt;h1\u0026gt;Test!\u0026lt;/h1\u0026gt;');\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut I need to put inside something that is already shown on the webpage\u003c/p\u003e","accepted_answer_id":"12780352","answer_count":"2","comment_count":"0","creation_date":"2012-10-08 10:45:56.477 UTC","last_activity_date":"2012-10-08 11:00:24.51 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1182591","post_type_id":"1","score":"0","tags":"javascript|html|printing","view_count":"142"} +{"id":"14558450","title":"Why IDE-specific project files are ignored in Git?","body":"\u003cp\u003eI have seen that a number of projects posted on Github feature a \u003ccode\u003e.gitignore\u003c/code\u003e file explicitly excluding control files related to the IDE. These control files are widely used to define the project and its dependencies. These can be \u003ccode\u003e.sln\u003c/code\u003e for .NET or \u003ccode\u003e.project\u003c/code\u003e for Eclipse.\u003c/p\u003e\n\n\u003cp\u003eI want to ask why is this practice widely applied or considered a good practice, considering that I agree that achieving IDE-neutrality (don't bind developers to a specific IDE) is a good principle, in general.\u003c/p\u003e\n\n\u003cp\u003eOn the contrary, these control files often dictate project dependencies, configuration or compilation variables in multiple configurations (this is the case of the \u003ccode\u003e.csproj\u003c/code\u003e files for example).\u003c/p\u003e\n\n\u003cp\u003eI have seen a large number of open source projects ignoring Eclipse files, however it has been impossible to me so far to set up a development environment without the project files (even if I create a project from existing code, or create a new project and import the code, I always get plenties of compilation errors).\u003c/p\u003e\n\n\u003cp\u003eIf the project files were present in repositories it would be vry simple to set up a development environment with \"download the code, import the project and voilà compile the source\" but it would obviously bind developer to a specific IDE (and that's not funny).\u003c/p\u003e\n\n\u003cp\u003eStandardizing or migrating project files is out of the scope of the question.\u003c/p\u003e\n\n\u003cp\u003eSo, from an external contributor's point of view, how does one build up a working and compiling project environment for a project of which he downloaded the source code from Github? (after cloning all submodules, if needed)\u003c/p\u003e\n\n\u003cp\u003eJust to pick \u003cstrong\u003eone\u003c/strong\u003e example project I would like to import into Eclipse, analyse and slightly modify, \u003ca href=\"https://github.com/mitreid-connect/OpenID-Connect-Java-Spring-Server\" rel=\"nofollow\"\u003ehere\u003c/a\u003e it is.\u003c/p\u003e","accepted_answer_id":"14561265","answer_count":"3","comment_count":"0","creation_date":"2013-01-28 08:51:21.61 UTC","last_activity_date":"2013-01-28 11:42:13.11 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"471213","post_type_id":"1","score":"3","tags":"git|github|ide","view_count":"926"} +{"id":"8833847","title":"Adaptive html layout using only CSS","body":"\u003cp\u003eI think this is my second post regarding Adaptive HTML/CSS layout. I got a helpful answer in my previous post where I implemented the adaptive layout, which was more straight where I need to remove the float and place the containers one below another. \u003c/p\u003e\n\n\u003cp\u003eThis time I have got some what complex design. Let me show the designs how it should be looking in Landscape and Portrait modes.\u003c/p\u003e\n\n\u003cp\u003eLandscape Design:\u003cimg src=\"https://i.stack.imgur.com/DngO4.jpg\" alt=\"Landscape\"\u003e\u003c/p\u003e\n\n\u003cp\u003eIn the portrait mode that is if the width is less than 1024px then the design should be looking like this\u003c/p\u003e\n\n\u003cp\u003ePortrait Design:\u003cimg src=\"https://i.stack.imgur.com/nin8W.jpg\" alt=\"portrait\"\u003e!\u003c/p\u003e\n\n\u003cp\u003eWould be helpful if someone guides me how to approach this design. In case if some more information is required then please feel free to ask\u003c/p\u003e\n\n\u003cp\u003eThanks \nRaaks\u003c/p\u003e","accepted_answer_id":"8838049","answer_count":"1","comment_count":"4","creation_date":"2012-01-12 10:52:12.027 UTC","favorite_count":"0","last_activity_date":"2012-01-12 15:55:36.71 UTC","last_edit_date":"2012-01-12 12:43:56.803 UTC","last_editor_display_name":"","last_editor_user_id":"809901","owner_display_name":"","owner_user_id":"809901","post_type_id":"1","score":"1","tags":"html|css|layout","view_count":"944"} +{"id":"24324705","title":"How to select from unknown number of databases?","body":"\u003cp\u003eI want to show a customer a history of their total orders across multiple 'vendors'. Each vendor has a separate database in SQL server to store their own orders.\u003c/p\u003e\n\n\u003cp\u003eIn my database I only know which vendors the user is signed up with. So my sequence needs to go like this:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eGet all the VendorIDs that the user is signed up with.\u003c/li\u003e\n\u003cli\u003eGo to the Vendor table and get their server + database name\u003c/li\u003e\n\u003cli\u003ePerform a select statement that gets all orders from each Order table in each of the Vendor databases that the user is signed up to.\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cblockquote\u003e\n\u003cpre\u003e\u003ccode\u003eDECLARE @UserID int = 999\n\nSELECT Count(OrderNumber) AS 'Orders'\n\nFROM\n--- Need some kind of loop here?\n[VendorServer].[VendorDB].[OrderTable] o1\n\nWHERE \no1.UserID = @UserID\n\u003c/code\u003e\u003c/pre\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eHow would I get the aggregate of the total number of orders this customer made when their orders are spread across multiple databases?\u003c/p\u003e\n\n\u003cp\u003eThe User may be signed up to over 100 vendors. So it has to query across 100 databases. This is an extreme example but its possible.\u003c/p\u003e","accepted_answer_id":"24325030","answer_count":"2","comment_count":"4","creation_date":"2014-06-20 10:01:56.77 UTC","last_activity_date":"2014-06-27 08:23:50.553 UTC","last_edit_date":"2014-06-20 10:23:08.823 UTC","last_editor_display_name":"","last_editor_user_id":"1774037","owner_display_name":"","owner_user_id":"1774037","post_type_id":"1","score":"0","tags":"sql|sql-server","view_count":"58"} +{"id":"35110167","title":"LibGdx texture drawn as inverse of what #getTextureData gives","body":"\u003cp\u003eI've been trying to resolve this issue I have been having with displaying a texture correctly on my libgdx desktop program.\u003c/p\u003e\n\n\u003cp\u003eI have an Orthographic camera with which when I set as:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecamera.setOrtho(false);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI get this image:\n\u003ca href=\"https://i.stack.imgur.com/s9G5D.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/s9G5D.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eAnd when I set it as:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecamera.setOrtho(true);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI get this image:\n\u003ca href=\"https://i.stack.imgur.com/VeMq6.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/VeMq6.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThe red image is drawn with a SpriteBatch:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ebatch.draw(texture, x, y, width, height);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhile the white image is drawn from individual points plotted based on if their alpha value was 1.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eTextureData td = texture.getTextureData();\ntd.prepare;\nPixmap map = td.consumePixmap();\nfor (int i = 0; i \u0026lt; map.getWidth(); i++)\n for (int j = 0; j \u0026lt; map.getHeight(); j++)\n if (new Color(map.getPixel(i, j)).a == 1)\n points.add(new Point(i, j));\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAbove is the code used to get all the non-transparent pixels.\nThey are displayed as the white image, and seem to be the inverse of the original texture.\u003c/p\u003e\n\n\u003cp\u003eHowever, the points plotted and the image itself is always an inverse of one another.\u003c/p\u003e\n\n\u003cp\u003eIs there any way of resolving this issue?\u003c/p\u003e\n\n\u003cp\u003eThank you.\u003c/p\u003e\n\n\u003cp\u003ePS: I've tried multiple ways of trying to fix this:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eUsing Sprites and flipping them\u003c/li\u003e\n\u003cli\u003eUsing TextureRegions and flipping them\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eAbsolutely nothing seems to work.\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2016-01-31 03:58:16.527 UTC","favorite_count":"0","last_activity_date":"2016-01-31 20:08:02.9 UTC","last_edit_date":"2016-01-31 20:08:02.9 UTC","last_editor_display_name":"","last_editor_user_id":"3326720","owner_display_name":"","owner_user_id":"3326720","post_type_id":"1","score":"0","tags":"java|opengl|libgdx|textures","view_count":"94"} +{"id":"14353202","title":"Prompt width and height of image being uploaded","body":"\u003cp\u003eI am looking for some method to prompt the width and height of the image being uploaded using an asp file upload control. Following is the code I am using to prompt message for file size. I just want to add the width and height of the image being uploaded using that upload control. Please take a note that I can't use javascript DOM here like \u003ccode\u003eimg.clientWidth\u003c/code\u003e as there is no such html object to call it. \u003c/p\u003e\n\n\u003cp\u003eHere's the JS Code \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(document).ready(function () {\n $(\"#\u0026lt;%= fupNewImage.ClientID %\u0026gt;\").bind(\"change\", function () {\n var fSize = ((this.files[0].size) / 1024).toFixed(2);\n if (fSize \u0026lt;= 200) {\n $(\"#fupSize\").html('Good file size: ' + fSize + \" kb Width=? and Height=?\" ); // ? denotes the actual value to be put.\n }\n //---------More cases\n });\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-01-16 07:23:04.767 UTC","last_activity_date":"2013-01-16 07:42:26.127 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1584140","post_type_id":"1","score":"0","tags":"javascript|jquery|asp.net|file-upload","view_count":"492"} +{"id":"43048414","title":"My android app loads successfully but shuts downs immedaitely","body":"\u003cp\u003eI'm using the Android NDK to port my C++ game over to mobile. I've debugged all the code successfully using ndk-build. And I've all successfully run ant-debug. I then installed the app onto my android device and the compiler said it was a success. However when I press the icon on my android screen, the app loads a black surface onto the screen and then shuts down after about 1 second. Could anybody suggest what might be the problem here? Has anybody experienced anything similar? I would like to know which area to start looking for the bug.\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2017-03-27 13:56:15.477 UTC","last_activity_date":"2017-03-27 14:24:29.887 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7757722","post_type_id":"1","score":"-2","tags":"android|c++|ant|opengl-es|android-ndk","view_count":"45"} +{"id":"11622966","title":"PHP taking the value from only one key in an array","body":"\u003cp\u003eHey guys so I have an array like\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eArray ( \n [more] =\u0026gt; 1 \n [routingTable] =\u0026gt; Array ( \n [0] =\u0026gt; Array ( \n [ip] =\u0026gt;fcca:948b:3c04:f481:e678:8539:a57e:197a \n [link] =\u0026gt; 90731030 \n [path] =\u0026gt; 0000.0000.271a.c907 \n [isDct] =\u0026gt; 1 \n ) \n [1] =\u0026gt; Array (\n [ip] =\u0026gt; fc1c:fc12:2735:0c17:c864:5273:c66e:558f \n [link] =\u0026gt; 74624930 \n [path] =\u0026gt; 0000.0000.006e.c907 \n [isDct] =\u0026gt; 1 \n ) \n [2] =\u0026gt; Array ( \n [ip] =\u0026gt; fcf3:2015:05f7:e2d8:39e8:51ca:1cd5:b29b \n [link] =\u0026gt; 188709805 \n [path] =\u0026gt; 0000.0000.2ab6.c387 \n [isDct] =\u0026gt; 1 \n ) \n [3] =\u0026gt; Array ( [ip] =\u0026gt; fcf6:28f2:3522:8ad0:57ad:cc26:0a6e:27a3 [link] =\u0026gt; 7331630 [path] =\u0026gt; 0000.001c.4fca.4387 [isDct] =\u0026gt; 1 ) [4] =\u0026gt; Array ( [ip] =\u0026gt; fc99:02f4:7795:c86c:36bd:63ae:cf49:d459 [link] =\u0026gt; 188709805 [path] =\u0026gt; 0000.0000.0006.4387 [isDct] =\u0026gt; 1 ) [5] =\u0026gt; Array ( [ip] =\u0026gt; fcf3:ca3a:d5a9:3552:7e71:afa7:e87c:f1ce [link] =\u0026gt; 188709805 [path] =\u0026gt; 0000.0000.0006.c387 [isDct] =\u0026gt; 1 ) [6] =\u0026gt; Array ( [ip] =\u0026gt; fc93:e5b5:7cde:7983:f50c:fe31:106b:1f88 [link] =\u0026gt; 87509810 [path] =\u0026gt; 0000.0000.004e.c387 [isDct] =\u0026gt; 1 ) [7] =\u0026gt; Array ( [ip] =\u0026gt; fcd4:1dc1:cc08:c97d:85e2:6cad:eab8:0864 [link] =\u0026gt; 188709805 [path] =\u0026gt; 0000.0000.0056.c387 [isDct] =\u0026gt; 1 ) [8] =\u0026gt; Array ( [ip] =\u0026gt; fce8:78b3:fa72:84a6:f737:e85f:7525:46a3 [link] =\u0026gt; 188709805 [path] =\u0026gt; 0000.0000.0076.c387 [isDct] =\u0026gt; 1 ) [9] =\u0026gt; Array ( [ip] =\u0026gt; fc19:e2db:7977:6d2c:15ce:4363:19cc:6bd6 [link] =\u0026gt; 127238194 [path] =\u0026gt; 0000.0000.01e1.0387 [isDct] =\u0026gt; 1 ) [10] =\u0026gt; Array ( [ip] =\u0026gt; fc1b:7538:824d:ccf2:f5da:96eb:a04a:f6e4 [link] =\u0026gt; 188709805 [path] =\u0026gt; 0000.0000.036a.4387 [isDct] =\u0026gt; 1 ) [11] =\u0026gt; Array ( [ip] =\u0026gt; fc1f:8b91:f3e8:73b9:c46f:ed52:d09f:1c81 [link] =\u0026gt; 188709805 [path] =\u0026gt; 0000.0000.029a.4387 [isDct] =\u0026gt; 1 ) [12] =\u0026gt; Array ( [ip] =\u0026gt; fcf6:28f2:3522:8ad0:57ad:cc26:0a6e:27a3 [link] =\u0026gt; 188709805 [path] =\u0026gt; 0000.0000.0000.4607 [isDct] =\u0026gt; 1 ) [13] =\u0026gt; Array ( [ip] =\u0026gt; fcf6:28f2:3522:8ad0:57ad:cc26:0a6e:27a3 [link] =\u0026gt; 279709270 [path] =\u0026gt; 0000.0000.0000.43c3 [isDct] =\u0026gt; 1 ) [14] =\u0026gt; Array ( [ip] =\u0026gt; fcc7:3fc5:d3f2:f66e:ec97:25e3:4a3d:948c [link] =\u0026gt; 188709805 [path] =\u0026gt; 0000.0000.0000.4387 [isDct] =\u0026gt; 1 ) [15] =\u0026gt; Array ( [ip] =\u0026gt; fcca:948b:3c04:f481:e678:8539:a57e:197a [link] =\u0026gt; 278098660 [path] =\u0026gt; 0000.0138.cfe9.c383 [isDct] =\u0026gt; 1 ) [16] =\u0026gt; Array ( [ip] =\u0026gt; fcf6:28f2:3522:8ad0:57ad:cc26:0a6e:27a3 [link] =\u0026gt; 9158 [path] =\u0026gt; 0000.0000.02f8.c087 [isDct] =\u0026gt; 1 ) [17] =\u0026gt; Array ( [ip] =\u0026gt; fc3a:956e:4b69:1c1e:5ebc:11a5:3e71:3e7e [link] =\u0026gt; 0 [path] =\u0026gt; 0000.0000.0348.c087 [isDct] =\u0026gt; 1 ) [18] =\u0026gt; Array ( [ip] =\u0026gt; fc93:e5b5:7cde:7983:f50c:fe31:106b:1f88 [link] =\u0026gt; 107374000 [path] =\u0026gt; 0000.0000.02ad.8087 [isDct] =\u0026gt; 1 ) [19] =\u0026gt; Array ( [ip] =\u0026gt; fc76:582b:9762:fcb6:1459:9564:f934:e02d [link] =\u0026gt; 177703971 [path] =\u0026gt; 0000.0095.8ea9.c4c7 [isDct] =\u0026gt; 1 ) [20] =\u0026gt; Array ( [ip] =\u0026gt; fc41:bcf4:4c13:5cc6:d96d:aadc:74c2:df2a [link] =\u0026gt; 177703970 [path] =\u0026gt; 0000.008b.8ea9.c4c7 [isDct] =\u0026gt; 1 ) [21] =\u0026gt; Array ( [ip] =\u0026gt; fce9:df87:2170:6a3d:e0d4:67a5:c82d:1bc0 [link] =\u0026gt; 177703970 [path] =\u0026gt; 0000.008d.0ea9.c4c7 [isDct] =\u0026gt; 1 ) [22] =\u0026gt; Array ( [ip] =\u0026gt; fc56:926d:c133:bc89:e6eb:640c:aa4e:0cb2 [link] =\u0026gt; 774372 [path] =\u0026gt; 0000.0092.0ea9.c4c7 [isDct] =\u0026gt; 1 ) [23] =\u0026gt; Array ( [ip] =\u0026gt; fcd9:c8a0:c35c:ba2e:e3de:b497:8706:2aab [link] =\u0026gt; 99320952 [path] =\u0026gt; 0000.008e.0ea9.c4c7 [isDct] =\u0026gt; 1 ) [24] =\u0026gt; Array ( [ip] =\u0026gt; fcac:541e:9c5c:9ddc:f648:962a:2892:e33e [link] =\u0026gt; 0 [path] =\u0026gt; 0000.0086.8ea9.c4c7 [isDct] =\u0026gt; 1 ) [25] =\u0026gt; Array ( [ip] =\u0026gt; fcd4:1dc1:cc08:c97d:85e2:6cad:eab8:0864 [link] =\u0026gt; 188709805 [path] =\u0026gt; 0000.0083.8ea9.c4c7 [isDct] =\u0026gt; 1 ) [26] =\u0026gt; Array ( [ip] =\u0026gt; fc36:4345:785d:cbe6:fc6d:5d61:507a:d721 [link] =\u0026gt; 25769760 [path] =\u0026gt; 0000.008f.0ea9.c4c7 [isDct] =\u0026gt; 1 ) [27] =\u0026gt; Array ( [ip] =\u0026gt; fca5:372b:57be:78aa:e490:6b0f:da2a:c882 [link] =\u0026gt; 43486470 [path] =\u0026gt; 0000.0094.0ea9.c4c7 [isDct] =\u0026gt; 1 ) [28] =\u0026gt; Array ( [ip] =\u0026gt; fc73:81dc:9b2e:3095:cd37:0214:114e:d27f [link] =\u0026gt; 0 [path] =\u0026gt; 0000.049c.46a4.8047 [isDct] =\u0026gt; 1 ) [29] =\u0026gt; Array ( [ip] =\u0026gt; fc30:5b55:a53d:c456:3c3d:da26:4759:3cbc [link] =\u0026gt; 132321905 [path] =\u0026gt; 0000.0091.0ea9.c4c7 [isDct] =\u0026gt; 1 ) [30] =\u0026gt; Array ( [ip] =\u0026gt; fccf:3418:31dd:4126:c23a:1d73:4a2c:15e5 [link] =\u0026gt; 774372 [path] =\u0026gt; 0000.0097.0ea9.c4c7 [isDct] =\u0026gt; 1 ) [31] =\u0026gt; Array ( [ip] =\u0026gt; fc05:2d70:2146:9298:73b9:14fb:d7a9:633a [link] =\u0026gt; 257697600 [path] =\u0026gt; 0000.0000.0007.4483 [isDct] =\u0026gt; 1 ) [32] =\u0026gt; Array ( [ip] =\u0026gt; fcf3:2015:05f7:e2d8:39e8:51ca:1cd5:b29b [link] =\u0026gt; 257697600 [path] =\u0026gt; 0000.0000.026b.4483 [isDct] =\u0026gt; 1 ) [33] =\u0026gt; Array ( [ip] =\u0026gt; fcd6:b2a5:e3cc:d78d:fc69:a90f:4bf7:4a02 [link] =\u0026gt; 264676910 [path] =\u0026gt; 0000.0000.0006.c483 [isDct] =\u0026gt; 1 ) [34] =\u0026gt; Array ( [ip] =\u0026gt; fccc:3ddb:f184:ee46:ae1a:f2a4:4f79:1ee7 [link] =\u0026gt; 34930104 [path] =\u0026gt; 0000.0000.02fa.c483 [isDct] =\u0026gt; 1 ) [35] =\u0026gt; Array ( [ip] =\u0026gt; fc98:82c4:0fca:f53e:2132:426a:c879:083c [link] =\u0026gt; 159987260 [path] =\u0026gt; 0000.0000.039a.c483 [isDct] =\u0026gt; 1 ) [36] =\u0026gt; Array ( [ip] =\u0026gt; fcf6:28f2:3522:8ad0:57ad:cc26:0a6e:27a3 [link] =\u0026gt; 7046418 [path] =\u0026gt; 0000.0000.038a.c483 [isDct] =\u0026gt; 1 ) [37] =\u0026gt; Array ( [ip] =\u0026gt; fce8:78b3:fa72:84a6:f737:e85f:7525:46a3 [link] =\u0026gt; 221190440 [path] =\u0026gt; 0000.0000.02ca.c483 [isDct] =\u0026gt; 1 ) [38] =\u0026gt; Array ( [ip] =\u0026gt; fcc7:3fc5:d3f2:f66e:ec97:25e3:4a3d:948c [link] =\u0026gt; 190857286 [path] =\u0026gt; 0000.0000.02ea.c483 [isDct] =\u0026gt; 1 ) [39] =\u0026gt; Array ( [ip] =\u0026gt; fc5d:baa5:61fc:6ffd:9554:67f0:e290:7535 [link] =\u0026gt; 190857285 [path] =\u0026gt; 0000.0000.021a.c483 [isDct] =\u0026gt; 1 ) [40] =\u0026gt; Array ( [ip] =\u0026gt; fcd9:c8a0:c35c:ba2e:e3de:b497:8706:2aab [link] =\u0026gt; 190857285 [path] =\u0026gt; 0000.0000.03ca.c483 [isDct] =\u0026gt; 1 ) [41] =\u0026gt; Array ( [ip] =\u0026gt; fcd4:1dc1:cc08:c97d:85e2:6cad:eab8:0864 [link] =\u0026gt; 264676910 [path] =\u0026gt; 0000.0000.027a.c483 [isDct] =\u0026gt; 1 ) [42] =\u0026gt; Array ( [ip] =\u0026gt; fc38:4c2c:1a8f:3981:f2e7:c2b9:6870:6e84 [link] =\u0026gt; 4294960 [path] =\u0026gt; 0000.0002.aa0b.c007 [isDct] =\u0026gt; 1 ) [43] =\u0026gt; Array ( [ip] =\u0026gt; fcd9:6fcc:642c:c70d:5ff2:63c3:8ead:c9ad [link] =\u0026gt; 0 [path] =\u0026gt; 0000.0000.0c7b.c007 [isDct] =\u0026gt; 1 ) [44] =\u0026gt; Array ( [ip] =\u0026gt; fc5b:0934:7fce:3885:7fe7:ab23:8743:3e14 [link] =\u0026gt; 124285405 [path] =\u0026gt; 0000.001a.df21.8047 [isDct] =\u0026gt; 1 ) [45] =\u0026gt; Array ( [ip] =\u0026gt; fcf6:28f2:3522:8ad0:57ad:cc26:0a6e:27a3 [link] =\u0026gt; 147102381 [path] =\u0026gt; 0000.0000.30be.c907 [isDct] =\u0026gt; 1 ) [46] =\u0026gt; Array ( [ip] =\u0026gt; fcf3:2015:05f7:e2d8:39e8:51ca:1cd5:b29b [link] =\u0026gt; 32212200 [path] =\u0026gt; 0000.0154.a496.c387 [isDct] =\u0026gt; 1 ) [47] =\u0026gt; Array ( [ip] =\u0026gt; fc97:d627:b1b6:3021:7b55:1ea3:1b3b:75a5 [link] =\u0026gt; 188709805 [path] =\u0026gt; 0000.0000.02eb.c007 [isDct] =\u0026gt; 1 ) [48] =\u0026gt; Array ( [ip] =\u0026gt; fccc:3ddb:f184:ee46:ae1a:f2a4:4f79:1ee7 [link] =\u0026gt; 26843500 [path] =\u0026gt; 0000.0000.0329.8007 [isDct] =\u0026gt; 1 ) [49] =\u0026gt; Array ( [ip] =\u0026gt; fcca:948b:3c04:f481:e678:8539:a57e:197a [link] =\u0026gt; 188709805 [path] =\u0026gt; 0000.0000.03e9.8007 [isDct] =\u0026gt; 1 ) [50] =\u0026gt; Array ( [ip] =\u0026gt; fce1:b388:04e8:c4ff:654a:3e62:2c68:77ee [link] =\u0026gt; 44560210 [path] =\u0026gt; 0000.0000.2ea9.8007 [isDct] =\u0026gt; 1 ) [51] =\u0026gt; Array ( [ip] =\u0026gt; fc3a:2804:615a:b34f:abfe:c7d5:65d6:f50c [link] =\u0026gt; 135291240 [path] =\u0026gt; 0000.0000.36a9.8007 [isDct] =\u0026gt; 1 ) [52] =\u0026gt; Array ( [ip] =\u0026gt; fcd5:c432:affb:7e77:a754:74e0:5e98:12d3 [link] =\u0026gt; 148176120 [path] =\u0026gt; 0000.0000.32a9.8007 [isDct] =\u0026gt; 1 ) [53] =\u0026gt; Array ( [ip] =\u0026gt; fc37:acb2:544b:ed86:8b8d:9945:add7:b119 [link] =\u0026gt; 142807420 [path] =\u0026gt; 0000.0000.26a9.8007 [isDct] =\u0026gt; 1 ) [54] =\u0026gt; Array ( [ip] =\u0026gt; fc38:4c2c:1a8f:3981:f2e7:c2b9:6870:6e84 [link] =\u0026gt; 188709805 [path] =\u0026gt; 0000.0000.2aa9.8007 [isDct] =\u0026gt; 1 ) [55] =\u0026gt; Array ( [ip] =\u0026gt; fc93:e5b5:7cde:7983:f50c:fe31:106b:1f88 [link] =\u0026gt; 18186471 [path] =\u0026gt; 0000.0000.33e9.8007 [isDct] =\u0026gt; 1 ) [56] =\u0026gt; Array ( [ip] =\u0026gt; fc09:c762:d144:4e53:bb79:372c:28dd:2cd6 [link] =\u0026gt; 166966572 [path] =\u0026gt; 0000.0000.1549.8007 [isDct] =\u0026gt; 1 ) [57] =\u0026gt; Array ( [ip] =\u0026gt; fcbd:9678:6e2c:568e:ea0d:6cc0:69f1:9996 [link] =\u0026gt; 123480101 [path] =\u0026gt; 0000.0001.fde9.8007 [isDct] =\u0026gt; 1 ) [58] =\u0026gt; Array ( [ip] =\u0026gt; fcef:c7a9:792a:45b3:741f:59aa:9adf:4081 [link] =\u0026gt; 81335805 [path] =\u0026gt; 0000.0000.18c7.8043 [isDct] =\u0026gt; 1 ) [59] =\u0026gt; Array ( [ip] =\u0026gt; fcb4:baa6:ca46:5255:8514:53da:28dc:1337 [link] =\u0026gt; 44560210 [path] =\u0026gt; 0000.0000.2aa9.c787 [isDct] =\u0026gt; 1 ) [60] =\u0026gt; Array ( [ip] =\u0026gt; fcef:c7a9:792a:45b3:741f:59aa:9adf:4081 [link] =\u0026gt; 137438720 [path] =\u0026gt; 0000.0001.8ca9.c787 [isDct] =\u0026gt; 1 ) [61] =\u0026gt; Array ( [ip] =\u0026gt; fc74:b146:a580:2be9:6285:7af3:6a56:2b7b [link] =\u0026gt; 0 [path] =\u0026gt; 0000.000a.22c7.8043 [isDct] =\u0026gt; 1 ) [62] =\u0026gt; Array ( [ip] =\u0026gt; fc00:9846:1c48:9a10:9c1b:3bbc:2322:face [link] =\u0026gt; 52613260 [path] =\u0026gt; 0000.0001.94a9.c787 [isDct] =\u0026gt; 1 ) [63] =\u0026gt; Array ( [ip] =\u0026gt; fc13:6176:aaca:8c7f:9f55:924f:26b3:4b14 [link] =\u0026gt; 1 [path] =\u0026gt; 0000.0000.32b6.8043 [isDct] =\u0026gt; 1 ) [64] =\u0026gt; Array ( [ip] =\u0026gt; fc2c:700f:63fa:2eb1:c360:059d:9b3e:1703 [link] =\u0026gt; 188709805 [path] =\u0026gt; 0000.0000.0034.81c7 [isDct] =\u0026gt; 1 ) [65] =\u0026gt; Array ( [ip] =\u0026gt; fc85:f077:1447:a03e:bae3:30b2:1e87:63b3 [link] =\u0026gt; 2147480 [path] =\u0026gt; 0000.0037.2a0b.c007 [isDct] =\u0026gt; 1 ) [66] =\u0026gt; Array ( [ip] =\u0026gt; fc2c:700f:63fa:2eb1:c360:059d:9b3e:1703 [link] =\u0026gt; 188709805 [path] =\u0026gt; 0000.0000.348e.c087 [isDct] =\u0026gt; 1 ) [67] =\u0026gt; Array ( [ip] =\u0026gt; fcd4:1dc1:cc08:c97d:85e2:6cad:eab8:0864 [link] =\u0026gt; 188709805 [path] =\u0026gt; 0000.0000.004e.c087 [isDct] =\u0026gt; 1 ) [68] =\u0026gt; Array ( [ip] =\u0026gt; fc7e:854a:b6fe:440b:965d:e487:58fb:5701 [link] =\u0026gt; 185220150 [path] =\u0026gt; 0000.0000.298e.c087 [isDct] =\u0026gt; 1 ) [69] =\u0026gt; Array ( [ip] =\u0026gt; fc9a:8c7e:a05f:62c0:4872:a860:0610:2e4b [link] =\u0026gt; 61203180 [path] =\u0026gt; 0000.0000.318e.c087 [isDct] =\u0026gt; 1 ) [70] =\u0026gt; Array ( [ip] =\u0026gt; fc99:02f4:7795:c86c:36bd:63ae:cf49:d459 [link] =\u0026gt; 294649 [path] =\u0026gt; 0000.0000.0056.c087 [isDct] =\u0026gt; 1 ) [71] =\u0026gt; Array ( [ip] =\u0026gt; fcf1:b5d5:d0b4:c390:9db2:3f5e:d2d2:bff2 [link] =\u0026gt; 294649 [path] =\u0026gt; 0000.0000.2196.c087 [isDct] =\u0026gt; 1 ) [72] =\u0026gt; Array ( [ip] =\u0026gt; fc58:7ce1:b011:920f:5ac7:98dd:e3c4:0c81 [link] =\u0026gt; 294650 [path] =\u0026gt; 0000.0000.3296.c087 [isDct] =\u0026gt; 1 ) [73] =\u0026gt; Array ( [ip] =\u0026gt; fcac:541e:9c5c:9ddc:f648:962a:2892:e33e [link] =\u0026gt; 0 [path] =\u0026gt; 0000.0000.2b96.c087 [isDct] =\u0026gt; 1 ) [74] =\u0026gt; Array ( [ip] =\u0026gt; fca6:83a5:de61:21da:9f57:b943:c039:ffde [link] =\u0026gt; 188709805 [path] =\u0026gt; 0000.0000.0005.ca47 [isDct] =\u0026gt; 1 ) [75] =\u0026gt; Array ( [ip] =\u0026gt; fc2c:700f:63fa:2eb1:c360:059d:9b3e:1703 [link] =\u0026gt; 0 [path] =\u0026gt; 0000.0000.03b8.c087 [isDct] =\u0026gt; 1 ) [76] =\u0026gt; Array ( [ip] =\u0026gt; fc99:02f4:7795:c86c:36bd:63ae:cf49:d459 [link] =\u0026gt; 124553840 [path] =\u0026gt; 0000.0001.7140.c707 [isDct] =\u0026gt; 1 ) [77] =\u0026gt; Array ( [ip] =\u0026gt; fc3a:956e:4b69:1c1e:5ebc:11a5:3e71:3e7e [link] =\u0026gt; 107374000 [path] =\u0026gt; 0000.00d2.7140.c707 [isDct] =\u0026gt; 1 ) [78] =\u0026gt; Array ( [ip] =\u0026gt; fc72:6c3b:8c74:68a7:d8c3:b4e0:6cbd:9588 [link] =\u0026gt; 100394690 [path] =\u0026gt; 0000.008a.7140.c707 [isDct] =\u0026gt; 1 ) [79] =\u0026gt; Array ( [ip] =\u0026gt; fcf1:b5d5:d0b4:c390:9db2:3f5e:d2d2:bff2 [link] =\u0026gt; 0 [path] =\u0026gt; 0000.0086.7140.c707 [isDct] =\u0026gt; 1 ) [80] =\u0026gt; Array ( [ip] =\u0026gt; fc58:7ce1:b011:920f:5ac7:98dd:e3c4:0c81 [link] =\u0026gt; 124553841 [path] =\u0026gt; 0000.00ca.7140.c707 [isDct] =\u0026gt; 1 ) [81] =\u0026gt; Array ( [ip] =\u0026gt; fcac:541e:9c5c:9ddc:f648:962a:2892:e33e [link] =\u0026gt; 0 [path] =\u0026gt; 0000.00ae.7140.c707 [isDct] =\u0026gt; 1 ) [82] =\u0026gt; Array ( [ip] =\u0026gt; fce1:3a9f:4546:e9e5:6646:88f9:1b18:8d18 [link] =\u0026gt; 83214850 [path] =\u0026gt; 0000.00aa.7140.c707 [isDct] =\u0026gt; 1 ) [83] =\u0026gt; Array ( [ip] =\u0026gt; fcfc:89e0:da25:3e98:23be:bc9a:4114:48d5 [link] =\u0026gt; 1 [path] =\u0026gt; 0000.00c6.7140.c707 [isDct] =\u0026gt; 1 ) [84] =\u0026gt; Array ( [ip] =\u0026gt; fc9a:62c1:75d2:b027:ca9d:9278:4a22:bc37 [link] =\u0026gt; 120795750 [path] =\u0026gt; 0000.00a2.7140.c707 [isDct] =\u0026gt; 1 ) [85] =\u0026gt; Array ( [ip] =\u0026gt; fc90:8f10:9ca3:12a1:ab12:c98d:0680:d915 [link] =\u0026gt; 122406360 [path] =\u0026gt; 0000.00b6.7140.c707 [isDct] =\u0026gt; 1 ) [86] =\u0026gt; Array ( [ip] =\u0026gt; fcc7:3fc5:d3f2:f66e:ec97:25e3:4a3d:948c [link] =\u0026gt; 0 [path] =\u0026gt; 0000.00ba.7140.c707 [isDct] =\u0026gt; 1 ) [87] =\u0026gt; Array ( [ip] =\u0026gt; fc8f:aa30:3bba:8b3e:12fd:44a5:0322:77ff [link] =\u0026gt; 79456760 [path] =\u0026gt; 0000.000b.2071.4a03 [isDct] =\u0026gt; 1 ) [88] =\u0026gt; Array ( [ip] =\u0026gt; fcf6:28f2:3522:8ad0:57ad:cc26:0a6e:27a3 [link] =\u0026gt; 113816440 [path] =\u0026gt; 0000.0001.c4fa.c907 [isDct] =\u0026gt; 1 ) [89] =\u0026gt; Array ( [ip] =\u0026gt; fc74:b146:a580:2be9:62 [isDct] =\u0026gt; 1 ) ) [isDct] =\u0026gt; 1 ) \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd I need to just grab out all the ip's (the values of the key \"ip\") and place them into a normal array like ips[]\u003c/p\u003e\n\n\u003cp\u003eIve tried a few things, but It's been so long since I've used php that it's not coming,\nAny help is great!\u003c/p\u003e","accepted_answer_id":"11622975","answer_count":"2","comment_count":"0","creation_date":"2012-07-24 01:42:28.83 UTC","last_activity_date":"2012-07-24 02:03:59.167 UTC","last_edit_date":"2012-07-24 01:55:08.247 UTC","last_editor_display_name":"","last_editor_user_id":"290221","owner_display_name":"","owner_user_id":"1284959","post_type_id":"1","score":"1","tags":"php|arrays|multidimensional-array","view_count":"258"} +{"id":"18364754","title":"Creating a normal class with injections from Spring","body":"\u003cp\u003eWell, I have a normal class (LovHelper) that is responsible for doing some utils tasks. When i say \u003cstrong\u003enormal class\u003c/strong\u003e is because LovHelper.java don't have @Component, @Service or @Repository annotation. \u003c/p\u003e\n\n\u003cp\u003eInside of this \"normal class\" i wanna inject a bean from spring, but the bean is always null. Look my Class LovHelper.java bellow:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epackage br.com.odontonew.helper; \n\nimport java.util.HashMap; \nimport java.util.List; \nimport java.util.Map; \n\nimport org.springframework.beans.factory.annotation.Autowired; \nimport org.springframework.stereotype.Component; \n\nimport br.com.odontonew.bean.Lov; \nimport br.com.odontonew.dao.BasicDAO; \n\npublic class LovHelper { \n\n @Autowired \n private BasicDAO dao; \n\n private static LovHelper instance; \n\n\n private LovHelper(){ \n\n } \n\n public static LovHelper getInstance(){ \n if (instance == null) \n instance = new LovHelper(); \n\n return instance; \n } \n\n\n public Lov getLovByCodigo(Class lovClass, String codigo){ \n Map\u0026lt;String,Object\u0026gt; map = new HashMap\u0026lt;String,Object\u0026gt;(); \n map.put(\"codigo\", codigo); \n List\u0026lt;Lov\u0026gt; lovs = (List\u0026lt;Lov\u0026gt;)dao.findByQuery(\"SELECT c FROM \"+lovClass.getName()+\" c WHERE c.codigo = :codigo\", map); \n if (lovs.size() == 1) \n return lovs.get(0); \n else \n return null; \n } \n\n\n /*Getters and Setters*/ \n public BasicDAO getDao() { \n return dao; \n } \n\n public void setDao(BasicDAO dao) { \n this.dao = dao; \n } \n\n} \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo, in another class i just call: LovHelper.getInstance().getLovByCodigo(param1, param2). But i always get a NullPointerException because the bean \"dao\" within LovHelper is NULL. \u003c/p\u003e\n\n\u003cp\u003eAfter think a little i decided to change my LovHelper.java (using singleton pattern) to a Bean for Spring inject, then I put @Component annotation and remove all singleton pattern the was developed. \nAnd in another class i inject \"lovHelper\" and use like this: lovHelper.getLovByCodigo(param1, param2). This second solution works fine, but the first not.\u003c/p\u003e\n\n\u003cp\u003eFinally, my doubt is: Why the original code (as posted) don't works.\u003c/p\u003e","answer_count":"2","comment_count":"2","creation_date":"2013-08-21 18:10:13.343 UTC","favorite_count":"0","last_activity_date":"2016-09-13 21:22:25.803 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2410547","post_type_id":"1","score":"1","tags":"java|spring","view_count":"2401"} +{"id":"29959953","title":"This is googles standard code for getting current location of user on map but on some PC it shows incorrect results. what could be the reason?","body":"\u003cp\u003eThe code given below is the google's standard code for getting the current geolocation. This code works fine on my android mobile device but it shows my current location to Pune (841 kilometres from my current location), when I accessed the web page from my PC. On one of my friends pc it shows correct location while incorrect location on another friend's PC. Can any one tell why this code shows correct current location on some PC while incorrect on some other? \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;!DOCTYPE html\u0026gt;\n \u0026lt;html\u0026gt;\n \u0026lt;head\u0026gt;\n \u0026lt;title\u0026gt;Geolocation\u0026lt;/title\u0026gt;\n \u0026lt;meta name=\"viewport\" content=\"initial-scale=1.0, user-scalable=no\"\u0026gt;\n \u0026lt;meta charset=\"utf-8\"\u0026gt;\n \u0026lt;style\u0026gt;\n html, body, #map-canvas {\n height: 100%;\n margin: 0px;\n padding: 0px\n }\n \u0026lt;/style\u0026gt;\n \u0026lt;script src=\"https://maps.googleapis.com/maps/api/js?v=3.exp\u0026amp;signed_in=true\"\u0026gt;\u0026lt;/script\u0026gt;\n\n \u0026lt;script\u0026gt;\n // Note: This example requires that you consent to location sharing when\n // prompted by your browser. If you see a blank space instead of the map, this\n // is probably because you have denied permission for location sharing.\n\n var map;\n\n function initialize() {\n var mapOptions = {\n zoom: 6\n };\n map = new google.maps.Map(document.getElementById('map-canvas'),\n mapOptions);\n\n // Try HTML5 geolocation\n if(navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var pos = new google.maps.LatLng(position.coords.latitude,\n position.coords.longitude);\n\n var infowindow = new google.maps.InfoWindow({\n map: map,\n position: pos,\n content: 'Location found using HTML5.'\n });\n\n map.setCenter(pos);\n }, function() {\n handleNoGeolocation(true);\n });\n } else {\n // Browser doesn't support Geolocation\n handleNoGeolocation(false);\n }\n }\n\n function handleNoGeolocation(errorFlag) {\n if (errorFlag) {\n var content = 'Error: The Geolocation service failed.';\n } else {\n var content = 'Error: Your browser doesn\\'t support geolocation.';\n }\n\n var options = {\n map: map,\n position: new google.maps.LatLng(60, 105),\n content: content\n };\n\n var infowindow = new google.maps.InfoWindow(options);\n map.setCenter(options.position);\n }\n\n google.maps.event.addDomListener(window, 'load', initialize);\n\n \u0026lt;/script\u0026gt;\n \u0026lt;/head\u0026gt;\n \u0026lt;body\u0026gt;\n \u0026lt;div id=\"map-canvas\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;/body\u0026gt;\n \u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"29960123","answer_count":"2","comment_count":"2","creation_date":"2015-04-30 05:48:58.253 UTC","last_activity_date":"2015-04-30 06:40:04.21 UTC","last_edit_date":"2015-04-30 06:40:04.21 UTC","last_editor_display_name":"","last_editor_user_id":"4831567","owner_display_name":"","owner_user_id":"4847173","post_type_id":"1","score":"-1","tags":"javascript|html5|google-maps|geolocation","view_count":"96"} +{"id":"45176315","title":"WordPress query posts on scroll laggy/skips","body":"\u003cp\u003eI have a website that on the homepage contains images/sliders standard page content etc. Once the page loads, it scrolls nice and smoothly. But I have a section about half way down that queries and displays WordPress Posts (see code below). When I view it in Google Chrome, while scrolling in that section, the website becomes laggy/skips and doesn't smoothy scroll like the rest of the home page. \u003c/p\u003e\n\n\u003cp\u003eIs there a way or something to include that will have WordPress query the posts faster or better or is there another reason as to why scrolling in that section becomes laggy? \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\n $temp = $wp_query; \n $wp_query= null;\n $wp_query = new WP_Query(); \n $wp_query-\u0026gt;query('no_found_rows=true\u0026amp;showposts=6\u0026amp;post_status=publish' . '\u0026amp;paged='.$paged);\n while ($wp_query-\u0026gt;have_posts()) : $wp_query-\u0026gt;the_post(); ?\u0026gt;\n \u0026lt;div class=\"newspagearticle full\"\u0026gt;\n \u0026lt;div class=\"newsthumb\"\u0026gt;\n \u0026lt;?php the_post_thumbnail( 'category-thumb' ); ?\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"homenewsheader\"\u0026gt;\n \u0026lt;div class=\"newsdate\"\u0026gt;\n \u0026lt;div\u0026gt;\u0026lt;?php the_time('M') ?\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;?php the_time('d'); ?\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;h2\u0026gt;\n \u0026lt;a class=\"readmore\" href=\"\u0026lt;?php the_permalink() ?\u0026gt;\"\u0026gt;\n \u0026lt;?php\n $thetitle = $post-\u0026gt;post_title; /* or you can use get_the_title() */\n $getlength = strlen($thetitle);\n $thelength = 200;\n echo substr($thetitle, 0, $thelength);\n if ($getlength \u0026gt; $thelength) echo \"...\";\n ?\u0026gt;\n \u0026lt;/a\u0026gt;\n \u0026lt;/h2\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div style=\"clear:both;\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;?php the_excerpt(); ?\u0026gt;\n \u0026lt;/div\u0026gt;\u0026lt;!-- /newspagearticle --\u0026gt;\n \u0026lt;?php endwhile; ?\u0026gt;\n \u0026lt;?php wp_reset_postdata(); ?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"3","creation_date":"2017-07-18 20:18:14.81 UTC","last_activity_date":"2017-07-18 20:18:14.81 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5623324","post_type_id":"1","score":"0","tags":"php|jquery|wordpress|performance","view_count":"25"} +{"id":"21685537","title":"codeigniter tank_auth unable to view default forms","body":"\u003cp\u003eFirst time posting here love the site.\u003c/p\u003e\n\n\u003cp\u003eSo I started using CodeIgniter and wanted to add acl to my site. \nsearched and read a lot and decide to go with tank auth.\u003c/p\u003e\n\n\u003cp\u003eusing:\ncodeigniter 2.1.4\u003c/p\u003e\n\n\u003cp\u003etank auth master\u003c/p\u003e\n\n\u003cp\u003eIIS\u003c/p\u003e\n\n\u003cp\u003eDownload everything ran the scripts connected to the db and nothing...\u003c/p\u003e\n\n\u003cp\u003eI can't view the \u003ccode\u003eregister_form.php\u003c/code\u003e in the view/auth folder or any view for that matter, all i get is a blank page no errors or anything. i assume its a problem with the routing i tried a 100 different stuff and was unable to get any thing beside a blank page.\u003c/p\u003e\n\n\u003cp\u003eany ideas how to solve this? \u003c/p\u003e\n\n\u003cp\u003eyour help would be most appreciated.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$route['default_controller'] = 'auth/view';\n$route['404_override'] = '';\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eedit:\nwhat have i dont so far....\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003e\u003cp\u003eso i change the route to this:\n$route['default_controller'] = 'auth/login';\n$route['404_override'] = '';\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eenable all logging nothing shows there\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003emade sure im in develoment mode\nstill nothing blank page\u003c/p\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003e\u003cem\u003e\u003cstrong\u003eedit:\u003c/em\u003e\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eso sloved the problem it was with the database load ($this-\u0026gt;ci-\u0026gt;load-\u0026gt;database();)\nno error were showen only thing in log of CI was (Database Driver Class Initialized)\nproblem was that php 5.5 doesnt come enable , need to enable it.\nlocate the php.ini (cmd-\u0026gt;run c:\\php\\php.exe --ini for location)\nedit the next stuff in file:\nextension=php_mysql.dll\nextension=php_mysqli.dll\nextension_dir = \"C:\\PHP\\ext\"\n\nthen make sure that in apachee httd.conf u have it ponted to the location of the right php.ini\nPHPIniDir \"C:\\php\\PHP.ini\"\n\nhopes this help some one in the future :)\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"22258900","answer_count":"3","comment_count":"2","creation_date":"2014-02-10 18:54:42.527 UTC","favorite_count":"1","last_activity_date":"2014-03-07 19:21:50.35 UTC","last_edit_date":"2014-03-07 19:20:22.39 UTC","last_editor_display_name":"","last_editor_user_id":"3294177","owner_display_name":"","owner_user_id":"3294177","post_type_id":"1","score":"0","tags":"php|codeigniter|tankauth","view_count":"92"} +{"id":"14868874","title":"Achieving rotation of logs based on size and time for the same log file using log4j.xml","body":"\u003cp\u003eTried following to achieve rotation based on size as well as time within the same configuration applicable to a single log file\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://www.mailinglistarchive.com/html/log4j-user@logging.apache.org/2008-07/msg00355.html\" rel=\"nofollow\"\u003ehttp://www.mailinglistarchive.com/html/log4j-user@logging.apache.org/2008-07/msg00355.html\u003c/a\u003e\n but the rotation based on size is not happening.Tried setting the size to 3KB. Could you please let me know if i have to correct anything.\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2013-02-14 06:19:19.253 UTC","last_activity_date":"2013-02-14 06:19:19.253 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1935991","post_type_id":"1","score":"0","tags":"log4j","view_count":"228"} +{"id":"3881557","title":"Inserting JSON in DataTable in Google Visualisation","body":"\u003cp\u003eI read that JSON can be inserted into a datatable. However, its done \nin JS on the HTML page (if memory serves right). I am using the GWT- \nvisualisation driver as given \u003ca href=\"http://code.google.com/p/gwt-google-apis/wiki/VisualizationGettingStarted\" rel=\"nofollow\"\u003ehere\u003c/a\u003e, and the only methods to add a row are not \ndesigned with JSON in mind. Is there any work-able solution? I am \ntrying to make a Stacked Column Chart. \nThanks.\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2010-10-07 12:22:06.513 UTC","favorite_count":"2","last_activity_date":"2011-08-13 05:08:54.62 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"174936","post_type_id":"1","score":"0","tags":"gwt|google-visualization","view_count":"862"} +{"id":"27913545","title":"Matlab: Indexing multidimensional array with a matrix","body":"\u003cp\u003eI have a three dimensional matrix named \u003ci\u003eSpr\u003c/i\u003e of size \u003ci\u003e5x5x500\u003c/i\u003e. The last dimension represents individuals while the first two dimensions refer to states. Hence, for each individual, I am storing a 5x5 matrix of transition probabilities from state i to state j. For instance, the last individual's transition probabilities are:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSpr( : , : , 500)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eans =\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e0.1386 0.3768 0.2286 0.1871 0.0688\n0.1456 0.3959 0.2401 0.1966 0.0218\n0.1475 0.4011 0.2433 0.1992 0.0090\n0.1486 0.4039 0.2450 0.2006 0.0020\n 0 1.0000 0 0 0\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI would like to access the three dimensional matrix Spr with the first index being provided by a 500x1 matrix S which stores in which state the specific individual is currently in. Hence, my final result would be a 1x5x500 matrix. For instance, if the 500th individual is currently in state S(i)=2 the corresponding row for this individual would correspond to:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSpr(S(i),:,i)\n\n0.1456 0.3959 0.2401 0.1966 0.0218 \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow can I do that without using loops?\u003c/p\u003e\n\n\u003cp\u003eI've tried using the \u003ci\u003esub2ind\u003c/i\u003e function in Matlab but it doesn't work as it requires all the indexes be integers and essentially my second index is the character \u003ci\u003e\":\" \u003c/i\u003e.\u003c/p\u003e","accepted_answer_id":"27913772","answer_count":"1","comment_count":"0","creation_date":"2015-01-13 01:16:11.793 UTC","last_activity_date":"2016-03-07 13:25:27.887 UTC","last_edit_date":"2016-03-07 13:25:27.887 UTC","last_editor_display_name":"","last_editor_user_id":"2732801","owner_display_name":"","owner_user_id":"1179242","post_type_id":"1","score":"0","tags":"arrays|matlab|multidimensional-array|indexing|vectorization","view_count":"85"} +{"id":"17082876","title":"make popup always visible devexpress lookup edit","body":"\u003cp\u003eI'm using a dev express lookup edit in a winforms application.Is it possible to make the popup of the lookup edit always visible ? \u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2013-06-13 08:48:54.913 UTC","last_activity_date":"2013-06-13 09:51:31.793 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2164476","post_type_id":"1","score":"-4","tags":"c#|.net|winforms|devexpress","view_count":"1419"} +{"id":"5449567","title":"is the autocomplete property, a standard html property?","body":"\u003cp\u003eI want to understand that \"autocomplete\" is a standard property or not?!\nlike this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;input type=\"password\" autocomplete=\"off\" /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand can i use this in FF,IE,Opera,....?\nif yes,which browsers and which version of those support that?\nis it a browser cross property?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eRegards.\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eSam\u003c/strong\u003e\u003c/p\u003e","accepted_answer_id":"5449602","answer_count":"2","comment_count":"0","creation_date":"2011-03-27 13:41:35.063 UTC","last_activity_date":"2011-03-27 13:47:26.53 UTC","last_edit_date":"2011-03-27 13:43:50.61 UTC","last_editor_display_name":"","last_editor_user_id":"21234","owner_display_name":"","owner_user_id":"678955","post_type_id":"1","score":"0","tags":"html|browser|autocomplete","view_count":"317"} +{"id":"29899684","title":"OpenGL changing color of generated texture","body":"\u003cp\u003eI'm creating a sheet of characters and symbols from a font file, which works fine, except on the generated sheet all the pixels are black (with varying alpha). I would prefer them to be white so I can apply color multiplication and have different colored text. I realize that I can simply invert the color in the fragment shader, but I want to reuse the same shader for all my GUI elements.\u003c/p\u003e\n\n\u003cp\u003eI'm following this tutorial: \u003ca href=\"http://en.wikibooks.org/wiki/OpenGL_Programming/Modern_OpenGL_Tutorial_Text_Rendering_02\" rel=\"nofollow\"\u003ehttp://en.wikibooks.org/wiki/OpenGL_Programming/Modern_OpenGL_Tutorial_Text_Rendering_02\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eHere's a snippet:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e// Create map texture\nglActiveTexture(GL_TEXTURE0);\nglGenTextures(1, \u0026amp;map);\nglBindTexture(GL_TEXTURE_2D, map);\nglTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, mapWidth, mapHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);\nglPixelStorei(GL_UNPACK_ALIGNMENT, 1);\nglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);\nglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);\n\n// Draw bitmaps onto map\nfor (uint i = start; i \u0026lt; end; i++) {\n charInfo curChar = character[i];\n\n if (FT_Load_Char(face, i, FT_LOAD_RENDER)) {\n cout \u0026lt;\u0026lt; \"Loading character \" \u0026lt;\u0026lt; (char)i \u0026lt;\u0026lt; \" failed!\" \u0026lt;\u0026lt; endl;\n continue;\n }\n\n glTexSubImage2D(GL_TEXTURE_2D, 0, curChar.mapX, 0, curChar.width, curChar.height, GL_ALPHA, GL_UNSIGNED_BYTE, glyph-\u0026gt;bitmap.buffer);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe buffer of each glyph contains values of 0-255 for the alpha of the pixels. My question is, how do I generate white colored pixels instead of black? Is there a setting for this? (I've tried some blend modes but without success)\u003c/p\u003e","accepted_answer_id":"29900173","answer_count":"1","comment_count":"0","creation_date":"2015-04-27 15:19:45.677 UTC","last_activity_date":"2015-04-27 15:41:04.943 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2229164","post_type_id":"1","score":"0","tags":"c++|opengl|fonts","view_count":"245"} +{"id":"22536678","title":"How to get button id from table in jquery?","body":"\u003cp\u003eButtons added into table then table appended into divinfo div tag. I used the below loop the alert shows [object HTML TableElement]. Help me to get button id from TableElement or get all controls from the item which included in alert.\u003c/p\u003e\n\n\u003cp\u003evar children1 = $('#divinfo').children();\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(children1).each(function (index, item) {\n if (index == 0) {\n alert(item);\n }\n\n});\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"0","creation_date":"2014-03-20 14:51:30.09 UTC","last_activity_date":"2014-03-20 14:56:39.06 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"418373","post_type_id":"1","score":"0","tags":"jquery","view_count":"22"} +{"id":"27097711","title":"Count multiple colors in multiple excel files vba","body":"\u003cp\u003eI have a multiple excel in a folder which has Yellow and red color filled in some cells\u003c/p\u003e\n\n\u003cp\u003eI need a excel log which will generate the file name count of yellow filed in each excel corresponding to that\u003c/p\u003e\n\n\u003cp\u003eeg:\u003c/p\u003e\n\n\u003cp\u003eFilename Yellow Red\u003c/p\u003e\n\n\u003cp\u003e1.xlsx 13 14\n2.xlsx 5 10\u003c/p\u003e\n\n\u003cp\u003ecan anyone help me.\u003c/p\u003e","accepted_answer_id":"27109273","answer_count":"1","comment_count":"2","creation_date":"2014-11-24 04:07:03.487 UTC","last_activity_date":"2015-10-13 05:36:22.903 UTC","last_edit_date":"2015-02-09 21:33:27.253 UTC","last_editor_display_name":"","last_editor_user_id":"1505120","owner_display_name":"","owner_user_id":"1124938","post_type_id":"1","score":"-2","tags":"excel|vba|excel-vba","view_count":"55"} +{"id":"11811045","title":"How to add JComponent to JPanel after JPanel has been add to JFrame","body":"\u003cp\u003eOnce a \u003ccode\u003eJPanel\u003c/code\u003e has been instantiated and added to a visible \u003ccode\u003eJFrame\u003c/code\u003e, how do I add a new \u003ccode\u003eJComponent\u003c/code\u003e to it \u003cem\u003eand\u003c/em\u003e update the display to show said new \u003ccode\u003eJComponent\u003c/code\u003e?\u003c/p\u003e\n\n\u003cp\u003eOriginal Question:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eHow to add \u003ccode\u003eJComponent\u003c/code\u003e to \u003ccode\u003eJPanel\u003c/code\u003e after \u003ccode\u003eJPanel\u003c/code\u003e has been added to a \u003ccode\u003eJFrame\u003c/code\u003e. I think I may have to extend \u003ccode\u003eJPanel\u003c/code\u003e and possibly override \u003ccode\u003epaintComponent()\u003c/code\u003e.\u003c/p\u003e\n\u003c/blockquote\u003e","accepted_answer_id":"11811096","answer_count":"2","comment_count":"7","creation_date":"2012-08-04 18:25:46.557 UTC","last_activity_date":"2015-08-13 20:51:05.623 UTC","last_edit_date":"2015-08-13 20:51:05.623 UTC","last_editor_display_name":"user4996976","owner_display_name":"","owner_user_id":"1031394","post_type_id":"1","score":"-1","tags":"java|swing|jpanel|jcomponent","view_count":"1721"} +{"id":"40768497","title":"Condition evaluating unexpectedly","body":"\u003cp\u003ei am trying to write a simple bash script for a custom screensaver, i want simple to go the screen black if in idle, and go back to normal if not.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#!/bin/bash\n#sets display gamma very low, for screensaver purposes\n\n\nidle=false\nidle_after=3000 #in milliseconds\n\nwhile true; do\n\n#if system is idle\nif [[ idle_now=$(xprintidle) -gt \"$idle_after\" \u0026amp;\u0026amp; \"$idle\"=false ]] ;then\n\necho \"1\"\n\n `xrandr --output HDMI-0 --brightness 0.01`\n idle=true\n\nfi\n\nif [[ idle_now=$(xprintidle) -lt \"$idle_after\" \u0026amp;\u0026amp; \"$idle\"=true ]] ; then\necho \"2\"\n `xrandr --output HDMI-0 --brightness 1` #set screen back to normal\n exit\nfi\n\n\ndone\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ei really don't know why the second if query gets executed first.\ni thought the idle variable is initialized \"false\" at startup \ncan someone explain this to me ? and if someone has improvements to give on my approach i 'would very appreciate that , thanks\u003c/p\u003e","accepted_answer_id":"40771967","answer_count":"1","comment_count":"2","creation_date":"2016-11-23 15:36:46.653 UTC","last_activity_date":"2016-11-23 18:48:11.547 UTC","last_edit_date":"2016-11-23 15:47:51.947 UTC","last_editor_display_name":"","last_editor_user_id":"1126841","owner_display_name":"","owner_user_id":"5356132","post_type_id":"1","score":"0","tags":"bash|shell","view_count":"57"} +{"id":"39811618","title":"How to draw a triangle with border with Java Graphics","body":"\u003cp\u003eI'm trying to draw a triangle with a border using the \u003ccode\u003eGraphics.drawPolygon()\u003c/code\u003e method\u003c/p\u003e\n\n\u003cp\u003eThe triangle is properly drawn, but how can I calculate the 3 points of the border?\u003c/p\u003e\n\n\u003cp\u003eI already did it with a circle, but I can't seem to find a solution for triangle.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eA requirement of the instructor as that it cannot use \u003ccode\u003eGraphics2D\u003c/code\u003e.\u003c/strong\u003e \u003c/p\u003e\n\n\u003cp\u003eMy code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eif (xPoints != null \u0026amp;\u0026amp; yPoints != null) {\n int[] nXPoints = new int[] { xPoints[0] - borderThickness, xPoints[1] - borderThickness,\n xPoints[2] - borderThickness };\n int[] nYPoints = new int[] { yPoints[0] - borderThickness, yPoints[1] - borderThickness,\n yPoints[2] - borderThickness };\n\n g.setColor(borderColor);\n g.fillPolygon(nXPoints, nYPoints, 3);\n\n g.setColor(fillColor);\n g.fillPolygon(xPoints, yPoints, 3);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdit:\u003c/strong\u003e\n\u003cstrong\u003eExpected result\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/aGF4S.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/aGF4S.png\" alt=\"Expected result\"\u003e\u003c/a\u003e\u003c/p\u003e","answer_count":"1","comment_count":"10","creation_date":"2016-10-01 21:27:41 UTC","last_activity_date":"2016-10-02 16:09:16.657 UTC","last_edit_date":"2016-10-02 15:31:15.267 UTC","last_editor_display_name":"","last_editor_user_id":"418556","owner_display_name":"","owner_user_id":"4864104","post_type_id":"1","score":"-1","tags":"java|swing|graphics|jpanel|jcomponent","view_count":"455"} +{"id":"6629979","title":"What does the -ObjC linker flag do?","body":"\u003cp\u003eSimple question.\nMight have been answered before but was unable to get a exact answer.\u003c/p\u003e\n\n\u003cp\u003eRight now, I have an app that works with and without the linker flag. However, without the linker flag, I get a very different behaviour when adding data to a view.\u003c/p\u003e\n\n\u003cp\u003eThanks guys!\u003c/p\u003e","accepted_answer_id":"6630019","answer_count":"1","comment_count":"1","creation_date":"2011-07-08 20:13:26.653 UTC","favorite_count":"28","last_activity_date":"2017-04-28 17:44:12.82 UTC","last_edit_date":"2013-01-04 13:17:57.967 UTC","last_editor_display_name":"","last_editor_user_id":"671858","owner_display_name":"","owner_user_id":"701069","post_type_id":"1","score":"125","tags":"iphone|objective-c|ios|compiler-construction","view_count":"28385"} +{"id":"29379755","title":"Casting a (ptr to const ) to (ptr to uint8)","body":"\u003cp\u003eIs there a way in \"C\" to cast a (ptr to const structure ) to (ptr to uint8) \u003cbr\u003e\u003c/p\u003e\n\n\u003cp\u003ethe following function expects (ptr to uint8)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ememcopy( (uint8 *) destination, (uint8 *) source , uint16 _size);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe function intends to copy the buffer of type ((ptr to const)) to another buffer \u003c/p\u003e\n\n\u003cp\u003ei'm aware in C++ i may use const_cast to cast away (remove) constness or volatility. but how about C ?\u003c/p\u003e\n\n\u003cp\u003ethe current case is as follow:\nsay i have a structure main_S\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003estruct main_S {\nstrcut1 xxxx1\nstrcut2 xxxx2\nstrcut3 xxxx3\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethe pointer to the main_S strcut is (ptrcnst_Main) and it's a pointer to const.\u003c/p\u003e\n\n\u003cp\u003ei need to copy the 2nd element (xxxx2) of the main_S \nso i'll do the following\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003estrcut2 dest;\nmemcopy( (uint8 *) \u0026amp;destination, (uint8 *) ptrcnst_Main-\u0026gt;xxxx2 , SizeOf(strcut2));\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut this never works. and i keep having error that i cant cast ptr const to ptr-uint8\u003c/p\u003e","accepted_answer_id":"29380224","answer_count":"2","comment_count":"12","creation_date":"2015-03-31 22:34:41.24 UTC","last_activity_date":"2015-03-31 23:32:56.107 UTC","last_edit_date":"2015-03-31 23:16:05.903 UTC","last_editor_display_name":"","last_editor_user_id":"2397434","owner_display_name":"","owner_user_id":"2397434","post_type_id":"1","score":"0","tags":"c|embedded","view_count":"272"} +{"id":"37098814","title":"URL path for css background wont work in meteor template","body":"\u003cp\u003eI am making a web application that uses meteor js as a framework. In it I have a template with some html elements and then a style tag that changes the background of an html element in the template. I set up some code that makes the template display for every document in a mongo database I set up with meteor, and as soon as I did this the url for the background change in the css wont register anymore. It will work if I put in a color like \"black\" but if I give it a specific path like /images/image.jpg it will not work, even though this used to work just fine. \u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2016-05-08 10:32:42.813 UTC","last_activity_date":"2016-05-08 11:48:08.497 UTC","last_edit_date":"2016-05-08 11:48:08.497 UTC","last_editor_display_name":"","last_editor_user_id":"6124406","owner_display_name":"","owner_user_id":"5728727","post_type_id":"1","score":"0","tags":"html|css|mongodb|meteor","view_count":"101"} +{"id":"11268785","title":"server.sh gives me following error Exception\"main\" java.lang.NoClassDefFoundError:","body":"\u003cp\u003ei am trying to start the \"Program D\" from the terminal,\u003cbr\u003e\ncommand in terminal \"sh server.sh\" gives me following error \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eStarting Alicebot Program D. Exception in thread \"main\"\njava.lang.NoClassDefFoundError: org/alicebot/server/net/AliceServer\nCaused by: java.lang.ClassNotFoundException:\norg.alicebot.server.net.AliceServer at\njava.net.URLClassLoader$1.run(URLClassLoader.java:202) at\njava.security.AccessController.doPrivileged(Native Method) at\njava.net.URLClassLoader.findClass(URLClassLoader.java:190) at\njava.lang.ClassLoader.loadClass(ClassLoader.java:306) at\nsun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at\njava.lang.ClassLoader.loadClass(ClassLoader.java:247)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy Server.sh file \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eALICE_HOME=.SERVLET_LIB=lib/servlet.jar\nALICE_LIB=lib/aliceserver.jar\nJS_LIB=lib/js.jar\n\n# Set SQL_LIB to the location of your database driver.\nSQL_LIB=lib/mysql_comp.jar\n\n# These are for Jetty; you will want to change these if you are using a different http server.\n HTTP_SERVER_LIBS=lib/org.mortbay.jetty.jar:lib/javax.xml.jaxp.jar:lib/org.apache.crimson.jar\n\nPROGRAMD_CLASSPATH=$SERVLET_LIB:$ALICE_LIB:$JS_LIB:$SQL_LIB:$HTTP_SERVER_LIBS\njava -classpath $PROGRAMD_CLASSPATH -Xms64m -Xmx64m org.alicebot.server.net.AliceServer $1\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"11269033","answer_count":"1","comment_count":"3","creation_date":"2012-06-29 20:52:17.13 UTC","last_activity_date":"2012-06-29 21:12:44.937 UTC","last_edit_date":"2012-06-29 20:53:49.59 UTC","last_editor_display_name":"","last_editor_user_id":"275567","owner_display_name":"","owner_user_id":"1492134","post_type_id":"1","score":"0","tags":"java|exception","view_count":"351"} +{"id":"18298693","title":"(MongoDB) database structure for Q\u0026Answer website","body":"\u003cp\u003eI'm trying to make a website similar to Yahoo \u0026amp; Answer or StackOverflow (different category, no competition), and I'm stuck at this point, I'll really appreciate any guidance from you guys as I'm very new to MongoDB.\u003c/p\u003e\n\n\u003cp\u003eI'm using Express framework on Node.js and MongoDB by the way.\u003c/p\u003e\n\n\u003cp\u003eThe problem is to find the most efficient way to structure the database for users and questions/answers data.\u003c/p\u003e\n\n\u003cp\u003eCurrently, there is a Questions model, inside there's a document for each category. Each document contains the question itself, the answers, and other info as described below:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emath{\n OpenQuestions{\n 'x+2=5, whats x?' : {\n asker: 'peter',\n likes: 12,\n answers: {\n 'x is 3' : {\n answerer: 'john',\n likes: 25\n },\n 'x is 2' : {\n answerer: 'MATHSUX',\n likes: 0\n } \n }\n }\n }\n ClosedQuestions{\n //same as OpenQuestions\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn this way it's very easy to display the questions as we can easily retrieve questions based on the object's creation time and fetch them accordingly on the main question page. \u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eHowever\u003c/strong\u003e, if an user wants to see the questions he has asked, the only way I can think of is going through each \u003ccode\u003esubject.OpenQuestions.QuestionItSelf.asker\u003c/code\u003e, and check if it's the user himself, then fetch all the object matches for this username, it would be an immense calculation. I'm sure there exists a much better way, what do you all think?\u003c/p\u003e","answer_count":"2","comment_count":"1","creation_date":"2013-08-18 11:43:28.03 UTC","favorite_count":"1","last_activity_date":"2017-08-01 11:50:44.57 UTC","last_edit_date":"2017-09-22 17:57:57.377 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"2567834","post_type_id":"1","score":"0","tags":"javascript|node.js|mongodb|mongoose|database","view_count":"104"} +{"id":"46117651","title":"Get result before end of function node","body":"\u003cp\u003eI can't reach my value until my function is ending.. I tried callbacks but it seems to doesn't work.. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eexports.helloHttp = function helloHttp (req, res) {\n var url = \"https://api.coindesk.com/v1/bpi/currentprice.json\";\n var btcValue\n require('https').get(url, function(res, btcValue){\n var body = '';\n\n res.on('data', function(chunk){\n body += chunk;\n });\n\n res.on('end', function(){\n btcValue = JSON.parse(body);\n callback(btcValue);\n });\n }).on('error', function(e){\n console.log(\"Got an error: \", e);\n });\n console.log(\"Got a respons \", btcValue);\n res.setHeader('Content-Type', 'application/json'); \n res.send(JSON.stringify({ \"speech\": response, \"displayText\": response \n }));\n};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks a lot in advance\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2017-09-08 13:29:33.147 UTC","last_activity_date":"2017-09-09 20:06:17.663 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6451172","post_type_id":"1","score":"0","tags":"node.js|asynchronous","view_count":"21"} +{"id":"13887438","title":"perl negative look behind with groupings","body":"\u003cp\u003eI have a problem trying to get a certain match to work with negative look behind\u003c/p\u003e\n\n\u003cp\u003eexample\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@list = qw( apple banana cherry); \n$comb_tlist = join (\"|\", @list);\n$string1 = \"include $(dir)/apple\";\n$string2 = \"#include $(dir)/apple\";\n\nif( $string1 =~ /^(?\u0026lt;!#).*($comb_tlist)/) #matching regex I tried, works kinda\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe array holds a set of variables that is matched against the string. \u003c/p\u003e\n\n\u003cp\u003eI need the regex to match $string1, but not $string2.\nIt matches $string1, but it ALSO matches $string2. Can anyone tell me what I am attempting wrong here. Thanks!\u003c/p\u003e","answer_count":"4","comment_count":"2","creation_date":"2012-12-14 23:01:54.673 UTC","last_activity_date":"2012-12-14 23:43:21.903 UTC","last_edit_date":"2012-12-14 23:43:21.903 UTC","last_editor_display_name":"","last_editor_user_id":"725418","owner_display_name":"","owner_user_id":"1539348","post_type_id":"1","score":"1","tags":"regex|perl|grouping","view_count":"205"} +{"id":"12070906","title":"Why does SQL Server say \"Starting Up Database\" in the event log, twice per second?","body":"\u003cp\u003eI have a SQL Server [2012 Express with Advanced Services] database, with not much in it. I'm developing an application using EF Code First, and since my model is still in a state of flux, the database is getting dropped and re-created several times per day.\u003c/p\u003e\n\n\u003cp\u003eThis morning, my application failed to connect to the database the first time I ran it. On investigation, it seems that the database is in \"Recovery Pending\" mode. \u003c/p\u003e\n\n\u003cp\u003eLooking in the event log, I can see that SQL Server has logged:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eStarting up database (my database)\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003e...roughly twice per second all night long. (The event log filled up, so I can't see beyond yesterday evening).\u003c/p\u003e\n\n\u003cp\u003eThose \"information\" log entries stop at about 6am this morning, and are immediately followed by an \"error\" log entry saying:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eThere is insufficient memory in resource pool 'internal' to run this query\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eWhat the heck happened to my database?\u003c/p\u003e\n\n\u003cp\u003eNote: it's just possible that I left my web application running in \"debug\" mode overnight - although without anyone \"driving\" it I can't imagine that there would be much database traffic, if any.\u003c/p\u003e\n\n\u003cp\u003eIt's also worth mentioning that I have a full-text catalog in the database (though as I say, there's hardly any actual content in the DB at present).\u003c/p\u003e\n\n\u003cp\u003eI have to say, this is worrying - I would \u003cem\u003enot\u003c/em\u003e be happy if this were to happen to my production database!\u003c/p\u003e","accepted_answer_id":"12072995","answer_count":"3","comment_count":"9","creation_date":"2012-08-22 10:13:41.467 UTC","favorite_count":"6","last_activity_date":"2014-10-03 18:53:05.68 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"98422","post_type_id":"1","score":"15","tags":"sql-server|sql-server-2012","view_count":"27633"} +{"id":"19867353","title":"Best way to export a Python sqlite table to .csv file","body":"\u003cp\u003eI have a simple single table in Python 2.7 sqllite. I just want to port the table to a external .csv file. \u003c/p\u003e\n\n\u003cp\u003eBeen reading a few tutorials and they are writing gobs and gobs of code to do this. \u003c/p\u003e\n\n\u003cp\u003eSeems like this would be a simple method to call up the table ('Select * FROM Table') and save it to .csv.\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2013-11-08 19:46:29.627 UTC","last_activity_date":"2013-11-08 21:06:30.78 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1447543","post_type_id":"1","score":"0","tags":"python|sqlite|csv","view_count":"2483"} +{"id":"2006646","title":"AppStore submission using non English main language","body":"\u003cp\u003eI use French as my main language for submission on the AppStore.\nI used to add English as a second language but I discovered that many stores with their own language (Germany, Italy, Spain, China, and so on) don't use my English localization but my French main language to display my apps !\nDo I need to add English localization in all available languages ? It's a bit painful and a lot of work to do.\nI could make my main language as English but French is not listed in the other localization languages, so it's not a solution.\u003c/p\u003e\n\n\u003cp\u003eIs there anybody with the same issue and perhaps a good (lazy) solution ?\u003c/p\u003e\n\n\u003cp\u003eThanks. \u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2010-01-05 14:34:25.66 UTC","favorite_count":"0","last_activity_date":"2010-01-05 15:43:21.993 UTC","last_edit_date":"2010-01-05 14:45:39.33 UTC","last_editor_display_name":"","last_editor_user_id":"331215","owner_display_name":"","owner_user_id":"331215","post_type_id":"1","score":"1","tags":"localization|app-store","view_count":"1798"} +{"id":"24313271","title":"Display property differences for inline-*something*","body":"\u003cp\u003eI noticed that people covered specifics of some display properties in a 1 on 1 comparison, but there are quite a few that have not been covered in illustrating the differences. Could someone explain the differences between the various inline-\u003cem\u003esomething\u003c/em\u003e display tags?\u003c/p\u003e\n\n\u003cp\u003eEDIT: A more elaborated definition over places like w3schools would do wonders.\u003c/p\u003e","accepted_answer_id":"24313727","answer_count":"1","comment_count":"0","creation_date":"2014-06-19 17:54:34.537 UTC","favorite_count":"2","last_activity_date":"2014-06-19 18:21:46.637 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3081102","post_type_id":"1","score":"1","tags":"css","view_count":"4375"} +{"id":"17106784","title":"XSD extend restricted type","body":"\u003cp\u003eCan you have an allready restricted type and then derive from this type by extension and add elements that do not fit to a base type?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;xsd:complexType name=\"absHcontainerType\"\u0026gt;\n \u0026lt;xsd:complexContent\u0026gt;\n \u0026lt;xsd:restriction base=\"e:urContentType\"\u0026gt;\n \u0026lt;xsd:sequence\u0026gt;\n \u0026lt;xsd:element ref=\"e:absMcontainer\" minOccurs=\"0\"\n maxOccurs=\"1\" /\u0026gt;\n \u0026lt;xsd:element ref=\"e:absHtitle\" minOccurs=\"1\" maxOccurs=\"unbounded\" /\u0026gt;\n \u0026lt;xsd:choice minOccurs=\"1\" maxOccurs=\"unbounded\"\u0026gt;\n \u0026lt;xsd:element ref=\"e:absMcontainer\" /\u0026gt;\n \u0026lt;xsd:element ref=\"e:absHcontainer\" /\u0026gt;\n \u0026lt;xsd:element ref=\"e:absContainer\" /\u0026gt;\n \u0026lt;/xsd:choice\u0026gt;\n \u0026lt;/xsd:sequence\u0026gt;\n \u0026lt;xsd:attributeGroup ref=\"e:typehcontainer\" /\u0026gt;\n \u0026lt;xsd:attributeGroup ref=\"e:anyattr\" /\u0026gt;\n \u0026lt;/xsd:restriction\u0026gt;\n \u0026lt;/xsd:complexContent\u0026gt;\n\u0026lt;/xsd:complexType\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd then derive this like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;xsd:complexType name=\"absHcontainerType2\"\u0026gt;\n \u0026lt;xsd:complexContent\u0026gt;\n \u0026lt;xsd:extension base=\"absHcontainerType\"\u0026gt;\n \u0026lt;xs:sequence\u0026gt; \n \u0026lt;xs:element name=\"xy\" type=\"xs:string\"/\u0026gt; \n \u0026lt;xs:element name=\"xyz\" type=\"xs:string\"/\u0026gt; \n \u0026lt;/xs:sequence\u0026gt;\n \u0026lt;/xs:extension\u0026gt; \n \u0026lt;/xsd:complexContent\u0026gt;\n\u0026lt;/xsd:complexType\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-06-14 10:50:32.087 UTC","last_activity_date":"2013-06-20 12:20:02.25 UTC","last_edit_date":"2013-06-20 12:20:02.25 UTC","last_editor_display_name":"","last_editor_user_id":"1145923","owner_display_name":"","owner_user_id":"1145923","post_type_id":"1","score":"0","tags":"xsd","view_count":"61"} +{"id":"35007051","title":"How to set background image for a link?","body":"\u003cp\u003eThe code below is a link which has a class through which I want to add a background image. I am not able to display background image however same code sets background color correctly so what I am missing here? I don't want to use \u003ccode\u003e\u0026lt;img\u0026gt;\u003c/code\u003e tag inside link because I want to change background image on hover.\u003c/p\u003e\n\n\u003cp\u003e\u003cdiv class=\"snippet\" data-lang=\"js\" data-hide=\"false\"\u003e\r\n\u003cdiv class=\"snippet-code\"\u003e\r\n\u003cpre class=\"snippet-code-css lang-css prettyprint-override\"\u003e\u003ccode\u003e.dropbtn{background: url(http://images.freeimages.com/images/previews/356/cubes-1425949.jpg) 50px 50px no-repeat;}\u003c/code\u003e\u003c/pre\u003e\r\n\u003cpre class=\"snippet-code-html lang-html prettyprint-override\"\u003e\u003ccode\u003e\u0026lt;a class=\"dropbtn\"\u0026gt;image\u0026lt;/a\u0026gt;\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003c/p\u003e","accepted_answer_id":"35059769","answer_count":"4","comment_count":"0","creation_date":"2016-01-26 04:26:25.41 UTC","last_activity_date":"2016-01-28 11:06:58.607 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5444416","post_type_id":"1","score":"0","tags":"html|css","view_count":"73"} +{"id":"39881647","title":"XBox GPU Does not appear in C++ AMP accelerator list","body":"\u003cp\u003eI'm using C++ AMP on XBox, but when I try to select the GPU as the default accelerator, it does not come up in the list. This is the code I'm using for finding the available accelerators:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003estd::vector\u0026lt;accelerator\u0026gt; accs = accelerator::get_all();\n// Use all accelerators but the CPU\nfor (int i = 0; i \u0026lt; accs.size(); i++)\n{\n std::wcout \u0026lt;\u0026lt; \"Using accelerator \" \u0026lt;\u0026lt; i + 1 \u0026lt;\u0026lt; \" of \" \u0026lt;\u0026lt; accs.size() \u0026lt;\u0026lt; \" - \"\n \u0026lt;\u0026lt; accs[i].description \u0026lt;\u0026lt; \" @ \" \u0026lt;\u0026lt; accs[i].device_path \u0026lt;\u0026lt; \"\\n\";\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm only getting \u003ccode\u003eMicrosoft Basic Render Driver\u003c/code\u003e and \u003ccode\u003eCPU Accelerator\u003c/code\u003e. Both run my code ~5 times slower than what I get on the PC.\u003c/p\u003e\n\n\u003cp\u003eWhy doesn't the GPU appear in the accelerator list? Is it disabled somehow?\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2016-10-05 18:54:51.52 UTC","last_activity_date":"2016-10-05 18:54:51.52 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"328059","post_type_id":"1","score":"1","tags":"c++|xbox|c++-amp|xbox-one","view_count":"76"} +{"id":"6460264","title":"Crystal Reports Runtime for VS on Windows 7 Throws an Error","body":"\u003cp\u003eIt seems to be working fine on my development machine, or the Windows XP test machines, but I'm running into problems on the Windows 7 test machines.\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/NC4dL.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eAfter that, I get a normal crash error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e************** Exception Text **************\nSystem.InvalidOperationException: An error occurred creating the form. See\nException.InnerException for details. The error is: The type initializer for\n'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception. ---\u0026gt; \nSystem.TypeInitializationException: The type initializer for \n'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception. ---\u0026gt; \nCrystalDecisions.CrystalReports.Engine.LoadSaveReportException: An error has occurred while \nattempting to load the Crystal Reports runtime.\n\nEither the Crystal Reports registry key permissions are insufficient or the Crystal Reports runtime is not installed correctly.\n\nPlease install the appropriate Crystal Reports redistributable (CRRedist*.msi) containing the correct version of the Crystal Reports runtime (x86, x64, or Itanium) required. Please go to http://www.businessobjects.com/support for more information.\n at CrystalDecisions.CrystalReports.Engine.ReportDocument.CheckForCrystalReportsRuntime()\n at CrystalDecisions.CrystalReports.Engine.ReportDocument..cctor()\n --- End of inner exception stack trace ---\n at CrystalDecisions.CrystalReports.Engine.ReportDocument..ctor()\n at CrystalDecisions.CrystalReports.Engine.ReportClass..ctor()\n at Processing.LogTag..ctor()\n at Processing.frmPrint.InitializeComponent()\n at Processing.frmPrint..ctor()\n --- End of inner exception stack trace ---\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eTheir website is of course a nightmare to find anything...\u003c/p\u003e\n\n\u003cp\u003eNote: It is Windows 7 64bit, but I'm already running the program in 32bit mode.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eUpdate:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eSo I figured out that crystal reports has an issue where the x64 version doesn't have any initializers, and so trying to initialize it in my program is causing an error.\u003cbr\u003e\nI have verified that if I uninstall the x64 version, and install the x86 32bit version, the program works fine. I've read that some people had sucess just running the program in 32bit mode, but for whatever reason that didn't work for me. \u003c/p\u003e\n\n\u003cp\u003eI'm leaving the question open for a little bit, in hopes that someone has figured out how to get it to initialize the 64 bit version, because that's what automatically installs from the click once setup.\u003c/p\u003e","accepted_answer_id":"6790426","answer_count":"4","comment_count":"0","creation_date":"2011-06-23 20:30:19.82 UTC","favorite_count":"2","last_activity_date":"2014-03-17 12:42:30.183 UTC","last_edit_date":"2011-06-24 13:01:57.813 UTC","last_editor_display_name":"","last_editor_user_id":"356438","owner_display_name":"","owner_user_id":"356438","post_type_id":"1","score":"5","tags":"visual-studio|crystal-reports","view_count":"42772"} +{"id":"43698137","title":"2D: Find the angle between mouse position and gameObject","body":"\u003cp\u003eI have a beer bottle positioned at top of a glass at 90%. I want to rotate it around its Pivot which is at the top. In order to do so i'm trying to find the angle between the the mouseposition(mp) and the bottle and rotate ti by it.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/27Mye.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/27Mye.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThe center of rotation is the current position of the GameObject since the Pivot of the sprite is at the top. I tried to find two Vectors one being the vector from mp to center of rotation and the other one being the position of the bottle. Then i used: gameObject.transform.Rotate(Vector3.Forward, Vector3.Angle(v2,v1)).\u003c/p\u003e\n\n\u003cp\u003eThe result its not what i expected of course. I'm new to this game math, i'd appreciate an explanation.\u003c/p\u003e\n\n\u003cp\u003e(Its an android game and i intend to drag the bottle up and down from 90 to 180 degrees).\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-04-29 16:45:06.293 UTC","last_activity_date":"2017-05-03 15:07:15.04 UTC","last_edit_date":"2017-04-29 17:57:15.167 UTC","last_editor_display_name":"","last_editor_user_id":"787480","owner_display_name":"","owner_user_id":"4369885","post_type_id":"1","score":"0","tags":"rotation|angle|unity2d","view_count":"40"} +{"id":"8954932","title":"Asp.net Application throwing System.OutOfMemoryException in Windows server 2003","body":"\u003cp\u003eI am using Neo load to test the performance of my ASP.NET 2.0 application. The application works fine until the memory of the w3wp.exe process reaches about 800000K and then it starts throwing System.OutOfMemoryException. The ASP.NET application is hosted in Windows server 2003 SP2 machine and the machine has 4GB of RAM. How can i get to know the reason for this error.\u003c/p\u003e","accepted_answer_id":"8956039","answer_count":"1","comment_count":"0","creation_date":"2012-01-21 17:14:22.823 UTC","last_activity_date":"2012-01-21 19:34:02.893 UTC","last_edit_date":"2012-01-21 17:21:43.997 UTC","last_editor_display_name":"","last_editor_user_id":"76337","owner_display_name":"","owner_user_id":"146852","post_type_id":"1","score":"0","tags":"asp.net","view_count":"1607"} +{"id":"2993509","title":"How to enumerate strings in a string resources file?","body":"\u003cp\u003eI have a resources file called string.xml in res/valus directory\u003c/p\u003e\n\n\u003cp\u003ethe file has many string resources\u003c/p\u003e\n\n\u003cp\u003ehow can I obtain these items in an array from code ?\u003c/p\u003e\n\n\u003cp\u003eI tried\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eField[] x=R.string.class.getFields();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut it does not work.\u003c/p\u003e\n\n\u003cp\u003ethanks\u003c/p\u003e","accepted_answer_id":"2993869","answer_count":"2","comment_count":"4","creation_date":"2010-06-07 22:03:32.243 UTC","last_activity_date":"2012-08-11 04:46:31.663 UTC","last_edit_date":"2010-06-07 22:51:08.907 UTC","last_editor_display_name":"","last_editor_user_id":"235123","owner_display_name":"","owner_user_id":"235123","post_type_id":"1","score":"1","tags":"android","view_count":"742"} +{"id":"42782610","title":"Uncaught ReferenceError: vm is not defined vue.js 2.0","body":"\u003cp\u003eI am using \u003cstrong\u003eVue 2.0\u003c/strong\u003e and I have an error \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e(Uncaught ReferenceError: vm is not defined) \u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003ewhen i use \u003ccode\u003evm.$data\u003c/code\u003e or any other in console to check the properties. I have latest version of vue.js 2.2.4.\u003c/p\u003e","answer_count":"2","comment_count":"1","creation_date":"2017-03-14 09:50:42.227 UTC","last_activity_date":"2017-11-07 06:30:44.47 UTC","last_edit_date":"2017-11-07 06:30:44.47 UTC","last_editor_display_name":"","last_editor_user_id":"3094731","owner_display_name":"","owner_user_id":"3423920","post_type_id":"1","score":"0","tags":"vuejs2","view_count":"1841"} +{"id":"31510397","title":"How to invoke diffrent jquery for a partial form in Rails?","body":"\u003cp\u003eI need to invoke different jquerys for different methods in a partial form. \u003c/p\u003e\n\n\u003cp\u003eI need to hide a certain block if an \"edit\" method is called _form(partial form) but I need to make it visible for a \"new\" method. \u003c/p\u003e\n\n\u003cp\u003eHere is the jquery part,\n \u003ccode\u003e$('.deact').hide();\u003c/code\u003e\u003c/p\u003e","accepted_answer_id":"31510435","answer_count":"1","comment_count":"0","creation_date":"2015-07-20 06:56:27.76 UTC","favorite_count":"1","last_activity_date":"2015-07-20 06:59:37.06 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1373197","post_type_id":"1","score":"0","tags":"ruby-on-rails|ruby-on-rails-3|ruby-on-rails-4","view_count":"16"} +{"id":"21506503","title":"Detect if UIImage is blurry","body":"\u003cp\u003eIs there any way to detect if an image is blurry? My use case is that I require users to upload very clear images. Would be nice to force them to retake a blurry image.\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2014-02-02 03:01:51.553 UTC","last_activity_date":"2014-02-02 03:41:45.623 UTC","last_edit_date":"2014-02-02 03:29:35.11 UTC","last_editor_display_name":"","last_editor_user_id":"603977","owner_display_name":"","owner_user_id":"729996","post_type_id":"1","score":"0","tags":"ios|image|cocoa-touch|image-processing|uiimage","view_count":"64"} +{"id":"13321836","title":"Unexpected new line Javascript/Smarty","body":"\u003cp\u003eI'm developing a Prestashop website, and I'm getting a \"SyntaxError: unterminated string literal\" javascript error.\nThe problem is when I get an address, this works nice:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e,\"address1\":\"Pza libertad\"\n,\"address2\":\"4\u0026amp;ordm; 3\u0026amp;ordf;\"\n,\"postcode\":\"08905\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe problem comes here:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e ,\"address1\":\"Plaza libertad 3\"\n ,\"address2\":\"\n4\u0026amp;ordm;3\u0026amp;ordf;\"\n ,\"postcode\":\"08905\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis code is generated like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{foreach from=$type.formated_fields_values key=pattern_name item=field_name name=inv_loop}\n{if !$smarty.foreach.inv_loop.first},{/if}\"{$pattern_name}\":\"{$field_name|escape:'htmlall':'UTF-8'}\"\n{/foreach}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn the database, the two \"address2\" looks the same.\u003c/p\u003e\n\n\u003cp\u003eAny ideas?\u003c/p\u003e","answer_count":"0","comment_count":"5","creation_date":"2012-11-10 11:58:47.137 UTC","last_activity_date":"2012-11-10 12:17:33.943 UTC","last_edit_date":"2012-11-10 12:17:33.943 UTC","last_editor_display_name":"","last_editor_user_id":"569101","owner_display_name":"","owner_user_id":"1814402","post_type_id":"1","score":"1","tags":"javascript|smarty|prestashop","view_count":"457"} +{"id":"18551087","title":"Cannot get image when uploading to Facebook","body":"\u003cp\u003eIm trying to upload to a facebook fan page album. I have permissions and the access token (I can post to the wall). \u003c/p\u003e\n\n\u003cp\u003eThis is my code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$img = realpath('/var/www/publish_facebook/images/corn.jpg');\n\n$args = array(\n 'message' =\u0026gt; 'testing',\n 'source' =\u0026gt; '@' . $img,\n 'aid' =\u0026gt; $album_id,\n 'no_story' =\u0026gt; 1,\n 'access_token' =\u0026gt; $fanpage_token\n );\n\ntry\n{\n var_dump($args);\n $photo = $facebook-\u0026gt;api($album_id . '/photos', 'post', $args);\n} \ncatch (FacebookApiException $e) \n{\n return 'Error facebookservice'.$e;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd I get the error:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eError facebookserviceOAuthException: (#324) Requires upload file\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eWhen I remove the \u003ccode\u003e@\u003c/code\u003e before the image path I get the same error. If I use \u003ccode\u003esource\u003c/code\u003e or \u003ccode\u003eimage\u003c/code\u003e as the parameter, I still get the same error. The \u003ccode\u003evar_dump\u003c/code\u003e result is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003earray(5) { [\"message\"]=\u0026gt; string(7) \n \"testing\" [\"source\"]=\u0026gt; string(68) \"@http://www.blog.webintelligence.ie/publish_facebook/images/corn.jpg\" \n [\"aid\"]=\u0026gt; string(15) \"531304096943185\" \n [\"no_story\"]=\u0026gt; int(1) \n [\"access_token\"]=\u0026gt; string(198) \u0026lt;page access token\u0026gt;\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny ideas? \u003c/p\u003e","accepted_answer_id":"18552192","answer_count":"1","comment_count":"5","creation_date":"2013-08-31 17:47:12.433 UTC","last_activity_date":"2013-09-01 19:57:55.687 UTC","last_edit_date":"2013-09-01 19:57:55.687 UTC","last_editor_display_name":"","last_editor_user_id":"1343690","owner_display_name":"","owner_user_id":"1716672","post_type_id":"1","score":"0","tags":"php|facebook|facebook-graph-api|facebook-php-sdk","view_count":"93"} +{"id":"46034792","title":"Kotlin function syntax","body":"\u003cp\u003eI'm doing the Kotlin Koans tests in order to familiarise myself with Kotlin. In a certain test I have to override the \u003ccode\u003ecompareTo\u003c/code\u003e method. In the first case everything work as intended\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edata class MyDate(val year: Int, val month: Int, val dayOfMonth: Int) {\n\n operator fun compareTo(other: MyDate)= when {\n year != other.year -\u0026gt; year - other.year\n month != other.month -\u0026gt; month - other.month\n else -\u0026gt; dayOfMonth - other.dayOfMonth\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow in the second case where I'm writing the \u003ccode\u003ecompareTo\u003c/code\u003e a little bit differently I get a ton of compilation errors. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edata class MyDate(val year: Int, val month: Int, val dayOfMonth: Int) {\n\n\n operator fun compareTo(other: MyDate){\n\n when {\n year != other.year -\u0026gt; return year - other.year\n month != other.month -\u0026gt; return month - other.month\n else -\u0026gt; return dayOfMonth - other.dayOfMonth\n }\n }\n\n\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFirst of all, at the operator keyword, I get an error:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e'operator' modifier is inapplicable on this function: must return Int\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eand in the returns I get\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eType mismatch: inferred type is Int but Unit was expected\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI cannot understand why these errors occur since the first implementation returns the same \u003ccode\u003eInt\u003c/code\u003es\u003c/p\u003e","accepted_answer_id":"46034849","answer_count":"3","comment_count":"0","creation_date":"2017-09-04 10:09:31.027 UTC","last_activity_date":"2017-09-06 19:26:17.75 UTC","last_edit_date":"2017-09-06 19:20:56.827 UTC","last_editor_display_name":"","last_editor_user_id":"3533380","owner_display_name":"","owner_user_id":"1514105","post_type_id":"1","score":"0","tags":"kotlin","view_count":"132"} +{"id":"6584952","title":"Path to *.dll files in app.config","body":"\u003cp\u003eHow can I define the path to *.dll files in .NET application in app.config file?\nMy application use *.dll files stored in another computer in local network. Copying these *.dll to my machine isn't good way.\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2011-07-05 15:12:05.77 UTC","last_activity_date":"2011-07-05 15:18:20.127 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"829977","post_type_id":"1","score":"0","tags":".net|app-config","view_count":"381"} +{"id":"33514318","title":"How can I make an HTML5 Video popup to fit the center of any screen?","body":"\u003cp\u003eI want to make an html5 video fit any size of the screen, if it's a iMac huge screen or if it's a phone, I want it to be responsive.\u003c/p\u003e\n\n\u003cp\u003e1) If it's a 4:3 monitor, it should show blank spaces (black bars) above and below video\u003c/p\u003e\n\n\u003cp\u003e2) If it's a super wide screen it should fit the height but show blank spaces left and right\u003c/p\u003e\n\n\u003cp\u003e3) Same with mobile, if it's portrait or landscape position\u003c/p\u003e\n\n\u003cp\u003eThis is my HTML\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"video-container\"\u0026gt; \u0026lt;!-- background darkener --\u0026gt;\n \u0026lt;video controls\u0026gt;\n \u0026lt;source src=\"img/vid.mp4\" type=\"video/mp4\"\u0026gt;\n \u0026lt;/video\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCSS:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e.video-container {\n position: fixed; \n top: 0; left: 0;\n width: 100%;\n height: 100%;\n background: rgba(0,0,0,0.9);\n}\n\n.video-container video {\n /* Here is what I want to know how to make it fit the way we want */\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI don't mind using jQuery if more real time calculations are needed!\nThanks beforehand\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2015-11-04 05:26:45.337 UTC","last_activity_date":"2016-05-12 06:43:30.253 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5228999","post_type_id":"1","score":"0","tags":"css|html5|video","view_count":"557"} +{"id":"8980969","title":"Use Orca to remove assembly from installer","body":"\u003cp\u003eI have a Visual Studio setup project that is built using Team Build. It has an extremely annoying habit of adding a duplicate assembly to the installer for an assembly that is already included in the installer as a project output. I am constantly having to check that the duplicate is \u003cem\u003eexcluded\u003c/em\u003e from the setup project but frequently the output from Team Build still includes the duplicate assembly. If this occurs, the install will fail with a message that it cannot write the duplicate to disk, because it has already just written the correct one and hasn't yet released the file handle.\u003c/p\u003e\n\n\u003cp\u003eI assume it is possible with Orca to remove the duplicate assembly from the installer which I'm contemplating doing in order to maintain a reasonable accord with the guy who has to run the installer. What do I need to do to remove an assembly from the installer?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2012-01-24 01:19:43.113 UTC","last_activity_date":"2012-01-25 17:44:26.893 UTC","last_edit_date":"2012-01-25 17:44:26.893 UTC","last_editor_display_name":"","last_editor_user_id":"132599","owner_display_name":"","owner_user_id":"132599","post_type_id":"1","score":"0","tags":"orca","view_count":"297"} +{"id":"38906893","title":"SQL Server, C# and iTextSharp. Whats best way to join pdfs","body":"\u003cp\u003eI have a sql server db. In there are many, many rows. Each row has a column that contains a stored pdf.\u003cbr\u003e\nThe db is a gig in size. So we can expect roughly half that size is due to the pdfs.\u003cbr\u003e\nnow I have a requirement to join all those pdf's ... into 1 pdf. Don't ask why. \nCan you suggest the best way forward and which component will be best suited for this job. There are many answers available: \u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://stackoverflow.com/questions/4607217/how-can-i-join-two-pdfs-using-itextsharp\"\u003eHow can I join two PDF\u0026#39;s using iTextSharp?\u003c/a\u003e\u003cbr\u003e\n\u003ca href=\"https://stackoverflow.com/questions/8385690/merge-memorystreams-to-one-itext-document\"\u003eMerge memorystreams to one itext document\u003c/a\u003e\u003cbr\u003e\n\u003ca href=\"https://stackoverflow.com/questions/15925616/how-to-merge-multiple-pdf-files-generated-in-run-time\"\u003eHow to merge multiple pdf files (generated in run time)?\u003c/a\u003e \u003c/p\u003e\n\n\u003cp\u003eas to how to join two (or more pdfs). But what I'm asking for is in terms of performance. We literally dealing with around 50 000 pdfs that need to be merged into 1 almighty pdf\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003e[Edit Solution] Brought time to merge 1000 pdfs from 4m30s to 21s\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic void MergePDFs(string targetPDF, string sourceDir)\n {\n using (FileStream stream = new FileStream(targetPDF, FileMode.Create))\n {\n var files = Directory.GetFiles(sourceDir);\n\n Document pdfDoc = new Document(PageSize.A4);\n PdfCopy pdf = new PdfCopy(pdfDoc, stream);\n pdfDoc.Open();\n\n Console.WriteLine(\"Merging files count: \" + files.Length);\n int i = 1;\n var watch = System.Diagnostics.Stopwatch.StartNew();\n foreach (string file in files)\n {\n Console.WriteLine(i + \". Adding: \" + file);\n pdf.AddDocument(new PdfReader(file));\n i++;\n }\n\n if (pdfDoc != null)\n pdfDoc.Close();\n\n watch.Stop();\n var elapsedMs = watch.ElapsedMilliseconds;\n MessageBox.Show(elapsedMs.ToString());\n }\n }\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"38923176","answer_count":"1","comment_count":"3","creation_date":"2016-08-11 22:11:10.22 UTC","last_activity_date":"2016-08-13 08:05:36.54 UTC","last_edit_date":"2017-05-23 12:14:47.643 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"531984","post_type_id":"1","score":"0","tags":"c#|sql-server|pdf|itext","view_count":"81"} +{"id":"21295215","title":"I would like to create a batch script to run an already made bat script, delay for a few seconds and then type some commands","body":"\u003cp\u003e\u003cbr\u003e\nNeed some help with this one (I'm new to batch scripting). So here's the problem:\u003cbr\u003e\u003c/p\u003e\n\n\u003cp\u003eI have a batch file called connection.bat:\u003cbr\u003e\n - it connects to a network WiiU console, but it takes a few seconds to load the environment\u003cbr\u003e\n - after it loads, it looks something like this:\u003cbr\u003e\n @userid:\u003cbr\u003e\n - that's when you can type some specific console commands (install and run mostly)\u003c/p\u003e\n\n\u003cp\u003eI want to make a batch file that does the following:\u003cbr\u003e\n1. runs connection.bat\u003cbr\u003e\n2. waits for it to finish loading the environment\u003cbr\u003e\n3. and then type the install command\u003cbr\u003e\u003c/p\u003e\n\n\u003cp\u003eI tried doing it this way:\u003cbr\u003e\n\u003ccode\u003e\ncd C:\\test\\connection.bat install -1 10.xx.xx.xx testupload.pkg\n\u003c/code\u003e\u003cbr\u003e\nbut it doesn't work, because it needs to connect first to the console\u003c/p\u003e\n\n\u003cp\u003eIs there a way to do this?\u003c/p\u003e","answer_count":"1","comment_count":"5","creation_date":"2014-01-22 22:18:58.203 UTC","last_activity_date":"2014-01-26 23:46:53.027 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2572036","post_type_id":"1","score":"0","tags":"windows|batch-file|cmd","view_count":"181"} +{"id":"37142566","title":"Quartz Scheduler not working in OpenShift","body":"\u003cp\u003eI have pushed the quartz scheduler configuration to OpenShift application that was working on local Tomcat server. I have verified that its reading from the quartz.properties file from main/resources folder. Here is the logs and the code. I changed the schedule of the job to fire after a few minutes i push the code.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic void contextInitialized(ServletContextEvent sce) {\n try {\n // Setup the Job class and the Job group\n JobDetail job = newJob(DailyUpdates.class).withIdentity(\"CronQuartzJob\", \"Group\").build();\n\n // Create a Trigger that fires every 10 minutes.\n Trigger trigger = newTrigger()\n .withIdentity(\"TriggerName\", \"Group\")\n .withSchedule(CronScheduleBuilder.dailyAtHourAndMinute(8, 55))\n .withSchedule(CronScheduleBuilder.dailyAtHourAndMinute(18, 0))\n .build();\n\n // Setup the Job and Trigger with Scheduler \u0026amp; schedule jobs\n scheduler = new StdSchedulerFactory().getScheduler();\n scheduler.start();\n scheduler.scheduleJob(job, trigger);\n } catch (SchedulerException ex) {\n logger.error(ex);\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eLog file says:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e2016-05-10 08:52:54 INFO QuartzScheduler:240 - Quartz Scheduler v.2.2.3 created.\n2016-05-10 08:52:54 INFO QuartzScheduler:2311 - JobFactory set to: org.quartz.simpl.SimpleJobFactory@8c6fdb\n2016-05-10 08:52:54 INFO RAMJobStore:155 - RAMJobStore initialized.\n2016-05-10 08:52:54 INFO QuartzScheduler:305 - Scheduler meta-data: Quartz Scheduler (v2.2.3) 'CustomQuartzScheduler' with instanceId 'NON_CLUSTERED'\n Scheduler class: 'org.quartz.core.QuartzScheduler' - running locally.\n NOT STARTED.\n Currently in standby mode.\n Number of jobs executed: 0\n Using thread pool 'org.quartz.simpl.SimpleThreadPool' - with 5 threads.\n Using job-store 'org.quartz.simpl.RAMJobStore' - which does not support persistence. and is not clustered.\n\n2016-05-10 08:52:54 INFO StdSchedulerFactory:1327 - Quartz scheduler 'CustomQuartzScheduler' initialized from default resource file in Quartz package: 'quartz.properties'\n2016-05-10 08:52:54 INFO StdSchedulerFactory:1331 - Quartz scheduler version: 2.2.3\n2016-05-10 08:52:54 INFO QuartzScheduler:575 - Scheduler CustomQuartzScheduler_$_NON_CLUSTERED started.\n2016-05-10 08:52:54 DEBUG QuartzSchedulerThread:276 - batch acquisition of 0 triggers\n2016-05-10 08:52:54 DEBUG QuartzSchedulerThread:276 - batch acquisition of 0 triggers\n2016-05-10 08:53:18 DEBUG QuartzSchedulerThread:276 - batch acquisition of 0 triggers\n2016-05-10 08:53:46 DEBUG QuartzSchedulerThread:276 - batch acquisition of 0 triggers\n2016-05-10 08:54:41 DEBUG QuartzSchedulerThread:276 - batch acquisition of 0 triggers\n2016-05-10 08:55:05 DEBUG QuartzSchedulerThread:276 - batch acquisition of 0 triggers\n2016-05-10 08:55:31 DEBUG QuartzSchedulerThread:276 - batch acquisition of 0 triggers\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd the properties file:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eorg.quartz.scheduler.skipUpdateCheck = true\norg.quartz.scheduler.instanceName = CustomQuartzScheduler\norg.quartz.scheduler.jobFactory.class = org.quartz.simpl.SimpleJobFactory\norg.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool\norg.quartz.threadPool.threadCount = 5\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-05-10 15:15:34.98 UTC","last_activity_date":"2016-05-16 21:09:37.397 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1899630","post_type_id":"1","score":"0","tags":"openshift|quartz-scheduler","view_count":"165"} +{"id":"26007787","title":"How to avoid too many joins?","body":"\u003cp\u003eI would like your help to discuss how would I avoid too many joins using a generic approach. Is there a general rule for this? \u003c/p\u003e\n\n\u003cp\u003eCurrently, I have a very complex query that is joining 11 tables and the performance is very poor (even with indexes and updated statistics). Using the Entity Framework Profiler, I've received the suggestion to reduce the number of joins and, instead, perform several separate queries: \u003ca href=\"http://hibernatingrhinos.com/products/EFProf/learn/alert/TooManyJoins\" rel=\"nofollow\"\u003elink\u003c/a\u003e.\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eEach join requires the database to perform additional work, and the\n complexity and cost of the query grows rapidly with each additional\n join. While relational database are optimized for handling joins, it\n is often more efficient to perform several separate queries instead of\n a single query with several joins in it.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eHow should I modify the following example to achieve a better performance?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eselect *\nfrom Blogs blog0_\n inner join Posts posts1_\n on blog0_.Id = posts1_.BlogId\n inner join Comments comments2_\n on posts1_.Id = comments2_.PostId\n inner join Users user3_\n on posts1_.UserId = user3_.Id\n inner join UsersBlogs users4_\n on blog0_.Id = users4_.BlogId\n inner join Users user5_\n on users4_.UserId = user5_.Id\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"7","creation_date":"2014-09-24 02:57:34.077 UTC","last_activity_date":"2016-08-22 10:14:22.7 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4048851","post_type_id":"1","score":"2","tags":"sql|sql-server|join|query-tuning","view_count":"3273"} +{"id":"20582707","title":"python.h not fond when trying to install gevent-socketio","body":"\u003cp\u003ehere is my error when I try to install gevent-socketio\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eInstalling collected packages: gevent, greenlet\n Running setup.py install for gevent\n building 'gevent.core' extension\n gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes \u003e-fPIC -DLIBEV_EMBED=1 -DEV_COMMON= -DEV_CHECK_ENABLE=0 -DEV_CLEANUP_ENABLE=0 \u003e-DEV_EMBED_ENABLE=0 -DEV_PERIODIC_ENABLE=0 -Ibuild/temp.linux-x86_64-2.7/libev -Ilibev \u003e-I/usr/include/python2.7 -c gevent/gevent.core.c -o build/temp.linux-x86_64-2.7/gevent/gevent.core.o\n gevent/gevent.core.c:17:20: fatal error: Python.h: No such file or directory\n compilation terminated.\n error: command 'gcc' failed with exit status 1\n Complete output from command /usr/bin/python -c \"import setuptools;\u003cstrong\u003efile\u003c/strong\u003e='/var/www/bleu/build/gevent/setup.py';exec(compile(open(\u003cstrong\u003efile\u003c/strong\u003e).read().replace('\\r\\n', '\\n'), \u003cstrong\u003efile\u003c/strong\u003e, 'exec'))\" install --single-version-externally-managed --record /tmp/pip-_kv6Fy-record/install-record.txt:\n running install\u003c/p\u003e\n \n \u003cp\u003erunning build\u003c/p\u003e\n \n \u003cp\u003erunning build_py\u003c/p\u003e\n \n \u003cp\u003erunning build_ext\u003c/p\u003e\n \n \u003cp\u003ebuilding 'gevent.core' extension\u003c/p\u003e\n \n \u003cp\u003egcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC \u003e -DLIBEV_EMBED=1 -DEV_COMMON= -DEV_CHECK_ENABLE=0 -DEV_CLEANUP_ENABLE=0 -DEV_EMBED_ENABLE=0 -DEV_PERIODIC_ENABLE=0 -Ibuild/temp.linux-x86_64-2.7/libev -Ilibev -I/usr/include/python2.7 -c gevent/gevent.core.c -o build/temp.linux-x86_64-2.7/gevent/gevent.core.o\u003c/p\u003e\n \n \u003cp\u003egevent/gevent.core.c:17:20: fatal error: Python.h: No such file or directory\u003c/p\u003e\n \n \u003cp\u003ecompilation terminated.\u003c/p\u003e\n \n \u003cp\u003eerror: command 'gcc' failed with exit status 1\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eHave you an idea how i can fix this?\u003c/p\u003e","accepted_answer_id":"20582718","answer_count":"1","comment_count":"0","creation_date":"2013-12-14 11:28:00.613 UTC","favorite_count":"1","last_activity_date":"2013-12-14 11:29:27.807 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3102030","post_type_id":"1","score":"8","tags":"python|django|gevent-socketio","view_count":"3207"} +{"id":"42174119","title":"How to check gravity flags in a custom Android View?","body":"\u003cp\u003e\u003cstrong\u003eThe problem\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI have a custom Android view in which I want get the user set gravity in order to layout the content in \u003ccode\u003eonDraw\u003c/code\u003e. Here is a simplified version that I am using in \u003ccode\u003eonDraw\u003c/code\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e// check gravity\nif ((mGravity \u0026amp; Gravity.CENTER_VERTICAL) == Gravity.CENTER_VERTICAL) {\n // draw the content centered vertically\n} else if ((mGravity \u0026amp; Gravity.BOTTOM) == Gravity.BOTTOM) {\n // draw the content at the bottom\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhere \u003ccode\u003emGravity\u003c/code\u003e is obtained from the xml attributes (\u003ca href=\"https://stackoverflow.com/a/42173923/3681880\"\u003elike this\u003c/a\u003e). \u003c/p\u003e\n\n\u003cp\u003eIf I set the gravity to \u003ccode\u003eGravity.CENTER_VERTICAL\u003c/code\u003e it works fine. But I was surprised to find that if I set it to \u003ccode\u003eGravity.BOTTOM\u003c/code\u003e, the \u003ccode\u003eGravity.CENTER_VERTICAL\u003c/code\u003e check is still true!\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eWhy is this happening?\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI had to look at the binary values to see why:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eBinary: \u003ccode\u003e0001 0000\u003c/code\u003e, \u003ca href=\"https://developer.android.com/reference/android/view/Gravity.html#CENTER_VERTICAL\" rel=\"nofollow noreferrer\"\u003e\u003ccode\u003eGravity.CENTER_VERTICAL\u003c/code\u003e\u003c/a\u003e: Constant Value: 16 (0x00000010)\u003c/li\u003e\n\u003cli\u003eBinary: \u003ccode\u003e0101 0000\u003c/code\u003e, \u003ca href=\"https://developer.android.com/reference/android/view/Gravity.html#BOTTOM\" rel=\"nofollow noreferrer\"\u003e\u003ccode\u003eGravity.BOTTOM\u003c/code\u003e\u003c/a\u003e: Constant Value: 80 (0x00000050)\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eThus, when I do \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emGravity = Gravity.BOTTOM;\n(mGravity \u0026amp; Gravity.CENTER_VERTICAL) == Gravity.CENTER_VERTICAL\n// (0101 \u0026amp; 0001) == 0001\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI get a false positive.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eWhat do I do?\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eSo how am I supposed to check the gravity flags?\u003c/p\u003e\n\n\u003cp\u003eI could do something like \u003ccode\u003eif (mGravity == Gravity.CENTER_VERTICAL)\u003c/code\u003e, but then I would only get an exact match. If the user set gravity to something like \u003ccode\u003ecenter_vertical|right\u003c/code\u003e then it would fail.\u003c/p\u003e","accepted_answer_id":"42314138","answer_count":"2","comment_count":"0","creation_date":"2017-02-11 09:05:57.97 UTC","favorite_count":"2","last_activity_date":"2017-06-27 11:45:32.52 UTC","last_edit_date":"2017-06-27 11:45:32.52 UTC","last_editor_display_name":"","last_editor_user_id":"1083957","owner_display_name":"","owner_user_id":"3681880","post_type_id":"1","score":"13","tags":"java|android|android-layout|flags|android-gravity","view_count":"624"} +{"id":"2662108","title":"Image Gallery with JQuery Lightbox","body":"\u003cp\u003eI've used the JQuery lightbox on a couple of websites, by having a gallery of thumbnails and the thumbnails as links to the bigger photos.\u003c/p\u003e\n\n\u003cp\u003eMy question is, using lightbox - can I make it so that I have a thumbnail image that when clicked takes you to a folder with a few pictures to cycle through, rather than just linking to one photo like below?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;a href=\"Images/Gallery/Box1.jpg\" class=\"lightbox\"\u0026gt;\n \u0026lt;asp:Image runat=\"server\" ImageUrl=\"~/Images/Box1.jpg\" Width=\"120\" Height=\"88\"/\u0026gt;\n\u0026lt;/a\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn the gallery folder there are two images - Box1.jpg and Box2.jpg, but I only want a link to Box1.jpg on the page and still be able to flick through box images using lightbox.\u003c/p\u003e\n\n\u003cp\u003eI am using this lightbox: \u003ca href=\"http://leandrovieira.com/projects/jquery/lightbox/\" rel=\"nofollow noreferrer\"\u003ehttp://leandrovieira.com/projects/jquery/lightbox/\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eIs this possible?\u003c/p\u003e","accepted_answer_id":"2672268","answer_count":"2","comment_count":"0","creation_date":"2010-04-18 11:49:51.163 UTC","last_activity_date":"2010-04-20 03:03:33.873 UTC","last_edit_date":"2010-04-18 12:48:42.567 UTC","last_editor_display_name":"","last_editor_user_id":"279906","owner_display_name":"","owner_user_id":"279906","post_type_id":"1","score":"3","tags":"javascript|jquery|lightbox","view_count":"2194"} +{"id":"4318143","title":"Rails Resources are giving me headache","body":"\u003cp\u003eI am a .NET developer moving to Ruby on Rails. I have been programming in ASP.NET MVC and now trying to apply the same concepts to Rails. I created index action and now when I say home/index it automatically redirects me the \"show\" action which does not exists. My routes.rb file has this particular line: \u003c/p\u003e\n\n\u003cp\u003eresources :home \u003c/p\u003e\n\n\u003cp\u003ehome is the home_controller. \u003c/p\u003e\n\n\u003cp\u003eWhat am I doing wrong?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass HomeController \u0026lt; ApplicationController\n\n def show\n\n end\n\n # show all the articles \n def index\n\n @articles = Array.new[Article.new,Article.new,Article.new]\n\n respond_to do |format|\n format.html \n format.xml { render :xml =\u0026gt; @articles }\n end\n\n end\n\n def new \n @article = Article.new\n\n respond_to do |format|\n\n format.html \n format.xml { render :xml =\u0026gt; @article }\n\n end\n\n end\n\n\n\n def create\n\n @article = Article.new(params[:post]);\n\n if @article.save \n\n format.html { redirect_to(@post,\n :notice =\u0026gt; 'Post was successfully created.') }\n\n end\n\n\n end\n\n def confirm \n end\n\nend\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"4318789","answer_count":"1","comment_count":"2","creation_date":"2010-11-30 20:18:28.343 UTC","last_activity_date":"2010-11-30 21:21:16.47 UTC","last_edit_date":"2010-11-30 20:33:27.453 UTC","last_editor_display_name":"","last_editor_user_id":"525682","owner_display_name":"","owner_user_id":"525682","post_type_id":"1","score":"1","tags":"ruby-on-rails","view_count":"93"} +{"id":"4078448","title":"Args for sb-ext:run-program","body":"\u003cp\u003eCan someone tell me exactly what the args argument should look like for \u003ca href=\"http://www.sbcl.org/manual/#Running-external-programs\" rel=\"nofollow\"\u003esb-ext:run-program\u003c/a\u003e?\u003c/p\u003e\n\n\u003cp\u003eIf I do this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e(sb-ext:run-program \"C:/Program Files/iTunes/iTunes.exe\" \n \"C:/lispbox-0.7/opus.mid\")\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI get this error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edebugger invoked on a TYPE-ERROR:\n The value \"C:/lispbox-0.7/opus.mid\" is not of type LIST.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, if I do this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e(sb-ext:run-program \"C:/Program Files/iTunes/iTunes.exe\" \n (list \"C:\\lispbox-0.7\\opus.mid\"))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eiTunes opens, but the MIDI file doesn't play, even though this invocation from the Windows command prompt works just fine:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eU:\\\u0026gt;\"C:\\Program Files\\iTunes\\iTunes.exe\" C:\\lispbox-0.7\\opus.mid\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNote that this (with forward slashes):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCL-USER\u0026gt; (sb-ext:run-program \"C:/Program Files/iTunes/iTunes.exe\" \n (list \"C:/lispbox-0.7/opus.mid\"))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ehas the same effect: iTunes opens, but the file is not played.\u003c/p\u003e","accepted_answer_id":"4078490","answer_count":"1","comment_count":"0","creation_date":"2010-11-02 14:03:41.62 UTC","last_activity_date":"2010-11-02 14:59:38.103 UTC","last_edit_date":"2010-11-02 14:55:39.68 UTC","last_editor_display_name":"","last_editor_user_id":"7648","owner_display_name":"","owner_user_id":"7648","post_type_id":"1","score":"3","tags":"common-lisp|sbcl","view_count":"1167"} +{"id":"9959799","title":"PL/SQL: re-write SELECT statement using IN parameter in stored procedure","body":"\u003cp\u003eSuppose I have an Oracle 11.2 database containing the following table:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eTABLE: SURVEY\n\nPARAMETER MALE FEMALE \n--------------------------\nSAMPLE_SIZE 102 95\nAVG_WEIGHT 170 120\nAVG_HEIGHT 5.9 5.4\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere's an example minimal PL/SQL stored procedure that selects the average weight of males and places it (e.g. 170) into variable \u003ccode\u003ev_stat\u003c/code\u003e. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ePROCEDURE get_stat (gender IN VARCHAR2) \nAS\n v_stat number;\nBEGIN\n SELECT male INTO v_stat FROM survey WHERE parameter = 'avg_weight';\nEND get_stat;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNotice the IN parameter \u003ccode\u003egender\u003c/code\u003e doesn't do anything here. What I want is to pass in variable \u003ccode\u003egender\u003c/code\u003e, which may equal either 'male' or 'female', and use \u003ccode\u003egender\u003c/code\u003e somehow in the SELECT statement (instead of 'male'). The goal is to pass in \u003ccode\u003egender\u003c/code\u003e as a variable that may be used to return, for example, the average weight of, either male or female, as defined by \u003ccode\u003egender\u003c/code\u003e. \u003c/p\u003e\n\n\u003cp\u003eI know I can probably use an IF/THEN/ELSE statement with two separate SELECT statements, but I wondered if there was an elegant way to use just one SELECT statement by changing 'male' in the above SELECT statement to something else?\u003c/p\u003e\n\n\u003cp\u003eNote that this is a re-do of my previous question here \u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://stackoverflow.com/questions/9957984/how-to-programmatically-set-table-name-in-pl-sql\"\u003eHow to programmatically set table name in PL/SQL?\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003ethat was (rightly) criticized for not being a realistic question. \u003c/p\u003e","accepted_answer_id":"9959896","answer_count":"3","comment_count":"0","creation_date":"2012-03-31 21:23:13.42 UTC","last_activity_date":"2012-03-31 21:36:02.883 UTC","last_edit_date":"2017-05-23 11:52:01.083 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"431080","post_type_id":"1","score":"2","tags":"oracle|plsql","view_count":"12559"} +{"id":"29053974","title":"How to write a unit test for a Spring Boot Controller endpoint","body":"\u003cp\u003eI have a sample Spring Boot app with the following \u003c/p\u003e\n\n\u003cp\u003eBoot main class\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@SpringBootApplication\npublic class DemoApplication {\n\n public static void main(String[] args) {\n SpringApplication.run(DemoApplication.class, args);\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eController\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@RestController\n@EnableAutoConfiguration\npublic class HelloWorld {\n @RequestMapping(\"/\")\n String gethelloWorld() {\n return \"Hello World!\";\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat's the easiest way to write a unit test for the controller? I tried the following but it complains about failing to autowire WebApplicationContext\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@RunWith(SpringJUnit4ClassRunner.class)\n@SpringApplicationConfiguration(classes = DemoApplication.class)\npublic class DemoApplicationTests {\n\n final String BASE_URL = \"http://localhost:8080/\";\n\n @Autowired\n private WebApplicationContext wac;\n\n private MockMvc mockMvc;\n\n @Before\n public void setup() {\n this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build();\n }\n\n @Test\n public void testSayHelloWorld() throws Exception{\n\n this.mockMvc.perform(get(\"/\")\n .accept(MediaType.parseMediaType(\"application/json;charset=UTF-8\")))\n .andExpect(status().isOk())\n .andExpect(content().contentType(\"application/json\"));\n }\n\n @Test\n public void contextLoads() {\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"29054326","answer_count":"5","comment_count":"1","creation_date":"2015-03-14 20:43:39.957 UTC","favorite_count":"16","last_activity_date":"2017-11-30 08:29:02.63 UTC","last_edit_date":"2016-10-26 09:59:48.76 UTC","last_editor_display_name":"","last_editor_user_id":"3506427","owner_display_name":"","owner_user_id":"1324816","post_type_id":"1","score":"47","tags":"java|unit-testing|junit|spring-boot|spring-test-mvc","view_count":"68378"} +{"id":"43276276","title":"Swift 3 - How to remove all Subviews from Superview as well as Array","body":"\u003cp\u003eI currently have a double for-loop that creates an X by Y grid of UIView CGRect squares. The loop also adds each UIView/Square of the grid to a 2D array allowing me to access each Cell of the grid and alter color/positioning by the index values of the loop.\u003c/p\u003e\n\n\u003cp\u003eThe loop seems to work fine and displays the Cells/Squares perfectly, however after a while I want to remove all of the squares and also empty the array (but not entirely delete) to make room for a new next grid (which may be of a different size). I created a function to remove all the views from the superview.\u003c/p\u003e\n\n\u003cp\u003eThis is how I am creating each \"Cell\" of the grid and placing each into the 2D array:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elet xStart = Int(size.width/2/2) - ((gridSizeX * gridScale)/2)\nlet yStart = Int(size.height/2/2) - ((gridSizeY * gridScale)/2)\n\nlet cell : UIView!\ncell = UIView(frame: CGRect(x: xStart + (xPos * gridScale), y:yStart + (yPos * gridScale), width:gridScale, height:gridScale))\n\ncell.layer.borderWidth = 1\ncell.layer.borderColor = UIColor(red:0.00, green:0.00, blue:0.00, alpha:0.02).cgColor\ncell.backgroundColor = UIColor(red:1.00, green:1.00, blue:1.00, alpha:0)\n\ncell.tag = 100\n\nself.view?.addSubview(cell)\n\ngridArray[xPos][yPos] = cell\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe 2D array is being created on application load like so:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003egridArray = Array(repeating: Array(repeating: nil, count: gridSizeY), count: gridSizeX)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have tried to search for a solution to remove the UIViews from the superview however all answers from other Questions don't seem to work for me. I have tried to add \u003ccode\u003ecell.tag = 100\u003c/code\u003e to each UIView and then remove all UIViews with the Tag Value of 100 like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efor subview in (self.view?.subviews)! {\n if (subview.tag == 100) {\n subview.removeFromSuperview()\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever no luck. I have also tried to use this method: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eself.view?.subviews.forEach({\n $0.removeConstraints($0.constraints)\n $0.removeFromSuperview()\n})\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe main differences I notice in my code compared to other peoples answers is that I have \"?\" and \"!\" at places in the code. I researched about what they mean and understood most of it however I still do not know how to fix my code because if it, and feel as though that is the issue. All I know is that the attempts to remove the UIViews from the superview does not work, and without the \"?\" and \"!\"s the code doesn't run at all.\u003c/p\u003e","answer_count":"2","comment_count":"2","creation_date":"2017-04-07 10:50:52.263 UTC","last_activity_date":"2017-04-07 15:18:37.527 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7359668","post_type_id":"1","score":"2","tags":"ios|arrays|swift|uiview","view_count":"1871"} +{"id":"1220030","title":"mysql fetching only one field","body":"\u003cp\u003eIs there an easy method to extract only one field. For instance:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$sql = \"SELECT field1 FROM table\";\n$res = mysql_query($sql) or die(mysql_error());\n$arr = mysql_fetch_assoc($res);\n$field1 = $arr['field1'];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy feeling says this could be done much easier.\u003c/p\u003e","accepted_answer_id":"1220076","answer_count":"3","comment_count":"0","creation_date":"2009-08-02 22:26:00.187 UTC","last_activity_date":"2009-08-02 22:56:01.22 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"149277","post_type_id":"1","score":"2","tags":"php|mysql","view_count":"3217"} +{"id":"32367907","title":"Imageoverlay state lost when using BringToFront() : leaflet","body":"\u003cp\u003e\u003cstrong\u003eIntroduction\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI am working with leaflet api, to create an application which uses two imageoverlays(added to map).\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eProblem\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eAs i loaded two imageoverlays to map with fixed bounds.\nNow i am have put the controls to toggle the imageoverlays i.e next and previous\u003c/p\u003e\n\n\u003cp\u003eI've used function bringToFront(); behind these controls....\u003c/p\u003e\n\n\u003cp\u003eBut when i draw something like rectangle and toggle the imageoverlay, then the shapes drawn on image or points will be lost or i guess loses their appearance...i dont now how to solve this.....\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003ePart of Script which has the incomplete implementation\u003c/strong\u003e \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar map = L.map('map', {\n minZoom: 1,\n maxZoom: 4,\n center: [0, 0],\n zoom: 0,\n crs: L.CRS.Simple\n });\n\n // dimensions of the image\n var w = 3200,\n h = 1900,\n url = 'assets/img/isbimg.jpg';\n url1 = 'assets/img/fjmap.png';\n // calculate the edges of the image, in coordinate space\n var southWest = map.unproject([0, h], map.getMaxZoom() - 1);\n var northEast = map.unproject([w, 0], map.getMaxZoom() - 1);\n var bounds = new L.LatLngBounds(southWest, northEast);\n\n var featureGroup = L.featureGroup().addTo(map);\n\n var drawControl = new L.Control.Draw({\n edit: {\n featureGroup: featureGroup\n },\n draw: {\n polygon: true,\n polyline: true,\n rectangle: true,\n circle: true,\n marker: true\n }\n }).addTo(map);\n\n\n map.on('draw:created', showPolygonArea);\n map.on('draw:edited', showPolygonAreaEdited);\n // add the image overlay,\n // so that it covers the entire map\n\n var iii = L.imageOverlay(url1, bounds);\n var jjj = L.imageOverlay(url, bounds);\n var ggg = iii.addTo(map);\n var hhh = jjj.addTo(map);\n\n jjj.addTo(map);\n $('#layerControl').on('click', function layerControl() {\n ggg.bringToFront();\n return this;\n });\n\n $('#layerControl2').on('click', function layerControl2() {\n hhh.bringToFront();\n return this;\n });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eI know, i havent saved the drawn vector or state of imageoverlay which\n creates problem, is there any method to solve this problem or with\n setting id to imageoverlay ???\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eIf someone have idea about it please do help, any kind of help or reference will be appreciated .... thanks for your time\u003c/p\u003e","accepted_answer_id":"32369249","answer_count":"1","comment_count":"0","creation_date":"2015-09-03 05:53:59.603 UTC","last_activity_date":"2015-09-03 07:17:01.127 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4042016","post_type_id":"1","score":"1","tags":"javascript|jquery|leaflet|angular-leaflet-directive|dc.leaflet.js","view_count":"112"} +{"id":"7000532","title":"Close child dialogs when closing the parent","body":"\u003cp\u003eI'm writing a Windows shell extension in C# using \u003ca href=\"http://www.ssware.com/ezshell/ezshell.htm\" rel=\"nofollow noreferrer\"\u003eEZShellExtensions.NET\u003c/a\u003e. \u003c/p\u003e\n\n\u003cp\u003eI contribute a context menu that shows dialogs.\u003c/p\u003e\n\n\u003cp\u003eSuppose that I show an Explorer window (A). Then I use the context menu to show non modal window (B).\u003c/p\u003e\n\n\u003cp\u003eIn Windows XP and Windows Vista, when I close A, B is closed (I want this behavior). However, in Windows 7, when I close A, B is not closed but it doesn't respond to events. My questions are:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eDo you know why Windows 7 manage the showed form as a child form?\u003c/li\u003e\n\u003cli\u003eIs there a way to maintain the message loop if I close A?\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT\u003c/strong\u003e: If I set A as owner of B, when I close A, B is also closed. But it creates a \u003ca href=\"https://stackoverflow.com/questions/7008411/how-to-completely-bring-to-front-a-winform-when-activated\"\u003enew issue\u003c/a\u003e. B is always over A.\u003c/p\u003e","accepted_answer_id":"7022735","answer_count":"1","comment_count":"0","creation_date":"2011-08-09 17:51:12.897 UTC","last_activity_date":"2011-08-11 08:11:10.813 UTC","last_edit_date":"2017-05-23 12:19:51.48 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"402081","post_type_id":"1","score":"6","tags":"c#|.net|winforms|shell-extensions","view_count":"1075"} +{"id":"34694700","title":"want to delete debug level logs (log4j)","body":"\u003cp\u003eI am new in log4j.I am stuck in log4j log level.My case is that i have created web service server where i print the soap request and response .Although i got the soap ui request and response in trace level ,but my question is that i want to delete all the debug level logs but my request print in trace level which is above the debug level.if i take \u003ccode\u003erootLogger=trace\u003c/code\u003e ,then only i see the soap request and response and debug level logs. but if i use other level as rootLogger ,then i could not see trace level logs.I want to remove debug level logs and retain trace level..\u003c/p\u003e\n\n\u003cp\u003eMy Log4j.properties :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elog4j.rootCategory=Trace, stdout\nlog4j.logger.org.springframework.ws.server.MessageTracing.sent=TRACE\nlog4j.logger.org.springframework.ws.server.MessageTracing.received=TRACE\nlog4j.appender.stdout=org.apache.log4j.ConsoleAppender\nlog4j.appender.stdout.layout=org.apache.log4j.PatternLayout\nlog4j.appender.stdout.layout.ConversionPattern=%p [%c{3}] %m%n\n\n\n\nLOGS :\nDEBUG [javaguys.webservices.UserServiceEndpoints] dafa\n\nDEBUG [method.jaxb.XmlRootElementPayloadMethodProcessor] Marshalling [com.javaguys.webservices.getuserservices.GetUserResponse@39178c5c] to response payload\n\nDEBUG [endpoint.interceptor.PayloadLoggingInterceptor] Response: \u0026lt;ns3:GetUserResponse xmlns:ns3=\"http://com/javaguys/webservices/getUserServices\" xmlns:ns2=\"http://user.javaguys.blog.com\"\u0026gt;\u0026lt;ns3:userDetails\u0026gt;\u0026lt;ns2:UserId\u0026gt;1\u0026lt;/ns2:UserId\u0026gt;\u0026lt;ns2:UserName\u0026gt;ashish\u0026lt;/ns2:UserName\u0026gt;\u0026lt;ns2:UserGender\u0026gt;M\u0026lt;/ns2:UserGender\u0026gt;\u0026lt;ns2:UserStatus\u0026gt;True\u0026lt;/ns2:UserStatus\u0026gt;\u0026lt;/ns3:userDetails\u0026gt;\u0026lt;/ns3:GetUserResponse\u0026gt;\n\nDEBUG [endpoint.interceptor.PayloadValidatingInterceptor] Response message validated\nTRACE [server.MessageTracing.sent] Sent response [\u0026lt;SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\"\u0026gt;\u0026lt;SOAP-ENV:Header/\u0026gt;\u0026lt;SOAP-ENV:Body\u0026gt;\u0026lt;ns3:GetUserResponse xmlns:ns2=\"http://user.javaguys.blog.com\" xmlns:ns3=\"http://com/javaguys/webservices/getUserServices\"\u0026gt;\u0026lt;ns3:userDetails\u0026gt;\u0026lt;ns2:UserId\u0026gt;1\u0026lt;/ns2:UserId\u0026gt;\u0026lt;ns2:UserName\u0026gt;ashish\u0026lt;/ns2:UserName\u0026gt;\u0026lt;ns2:UserGender\u0026gt;M\u0026lt;/ns2:UserGender\u0026gt;\u0026lt;ns2:UserStatus\u0026gt;True\u0026lt;/ns2:UserStatus\u0026gt;\u0026lt;/ns3:userDetails\u0026gt;\u0026lt;/ns3:GetUserResponse\u0026gt;\u0026lt;/SOAP-ENV:Body\u0026gt;\u0026lt;/SOAP-ENV:Envelope\u0026gt;] for request [\u0026lt;soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:get=\"http://com/javaguys/webservices/getUserServices\"\u0026gt;\n \u0026lt;soapenv:Header/\u0026gt;\n \u0026lt;soapenv:Body\u0026gt;\n \u0026lt;get:GetUserRequest\u0026gt;\n \u0026lt;get:userId\u0026gt;1\u0026lt;/get:userId\u0026gt;\n \u0026lt;/get:GetUserRequest\u0026gt;\n \u0026lt;/soapenv:Body\u0026gt;\n\u0026lt;/soapenv:Envelope\u0026gt;]\n\nDEBUG [transport.http.MessageDispatcherServlet] Successfully completed request\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs there any way to remove debug level logs?\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2016-01-09 14:32:29.017 UTC","last_activity_date":"2016-01-09 16:06:22.28 UTC","last_edit_date":"2016-01-09 16:06:22.28 UTC","last_editor_display_name":"","last_editor_user_id":"1196778","owner_display_name":"","owner_user_id":"5766967","post_type_id":"1","score":"0","tags":"java|log4j","view_count":"44"} +{"id":"35270254","title":"How best to open the desired controller via 3D Touch?","body":"\u003cp\u003eI want to ask about the proper implementation of 3D Touch. For example there UIViewController, which loads different from each other depending on the data being openly application. If as usual, it shows the same data, if in 3D Touch, then the other. I've done through \u003ccode\u003eNSUserDefaults\u003c/code\u003e kept to a variable, that is, if the normal start is false, if in 3D Touch true. I do more with \u003ccode\u003eNSNotificationCenter\u003c/code\u003e. It all worked, but it is not the correct implementation of this task. How best do I do that?\u003c/p\u003e","accepted_answer_id":"36369215","answer_count":"1","comment_count":"1","creation_date":"2016-02-08 12:58:12.42 UTC","favorite_count":"3","last_activity_date":"2016-04-02 04:31:49.253 UTC","last_edit_date":"2016-02-08 13:19:04.347 UTC","last_editor_display_name":"","last_editor_user_id":"4981515","owner_display_name":"","owner_user_id":"4981515","post_type_id":"1","score":"2","tags":"ios|3d|swift2|3dtouch","view_count":"75"} +{"id":"20411535","title":"How can libusbx drivers be installed automatically along with the application using an installer?","body":"\u003cp\u003eI have written an application for a device and I used the \u003ca href=\"http://libusbx.org/\" rel=\"nofollow\"\u003elibusbx\u003c/a\u003e library. I had to install the WinUSB driver using Zadig to run my application. Now, I am deploying my application using the \u003ca href=\"http://en.wikipedia.org/wiki/Inno_Setup\" rel=\"nofollow\"\u003eInno Setup\u003c/a\u003e installer. How can I automatically install the WinUSB driver for the libusbx library?\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2013-12-05 21:51:11.167 UTC","favorite_count":"1","last_activity_date":"2013-12-14 17:15:40.557 UTC","last_edit_date":"2013-12-14 17:15:40.557 UTC","last_editor_display_name":"","last_editor_user_id":"63550","owner_display_name":"","owner_user_id":"1204105","post_type_id":"1","score":"2","tags":"windows|driver|inno-setup|libusb-1.0|winusb","view_count":"227"} +{"id":"12477300","title":"consuming sequence generated by IEnumerable","body":"\u003cp\u003eI would like to use an \u003ccode\u003eIEnumerable\u003c/code\u003e to generate a sequence of values -- specifically, a list of Excel-like column headers.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate IEnumerable\u0026lt;string\u0026gt; EnumerateSymbolNames()\n{\n foreach (var sym in _symbols)\n {\n yield return sym;\n }\n\n foreach (var sym1 in _symbols)\n {\n foreach (var sym2 in _symbols)\n {\n yield return sym1 + sym2;\n }\n }\n\n yield break;\n}\nprivate readonly string[] _symbols = new string[] { \"A\", \"B\", \"C\", ...};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis works fine if I fetch the values from a \u003ccode\u003eforeach\u003c/code\u003e loop. But what I want is to use the iterator block as a state machine and fetch the next available column header in response to a user action. And this -- consuming the generated values -- is where I've run into trouble.\u003c/p\u003e\n\n\u003cp\u003eSo far I've tried \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ereturn EnumerateSymbolNames().Take(1).FirstOrDefault();\n\nreturn EnumerateSymbolNames().Take(1).SingleOrDefault();\n\nreturn EnumerateSymbolNames().FirstOrDefault();\n\nvar enumerator = EnumerateSymbolNames().GetEnumerator();\nenumerator.MoveNext();\nreturn enumerator.Current;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e... but none of these have worked. (All repeatedly return \"A\".)\nBased on the responses to \u003ca href=\"https://stackoverflow.com/questions/2248985/using-ienumerable-without-foreach-loop\"\u003ethis question\u003c/a\u003e, I'm wondering what I want is even possible -- although several of the responses to that post suggest techniques similar to my last one.\u003c/p\u003e\n\n\u003cp\u003eAnd no, this is \u003cem\u003enot\u003c/em\u003e a homework assignment :)\u003c/p\u003e","accepted_answer_id":"12477389","answer_count":"3","comment_count":"1","creation_date":"2012-09-18 12:45:02.857 UTC","last_activity_date":"2012-09-29 16:14:14.037 UTC","last_edit_date":"2017-05-23 12:12:14.94 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"654199","post_type_id":"1","score":"2","tags":"c#|yield-return","view_count":"449"} +{"id":"46645065","title":"Transform several XML elements, identified by their attributes, into a complex one","body":"\u003cp\u003eI am quite new to XSLT so I could be missing something really obvious.\u003c/p\u003e\n\n\u003cp\u003eI have a source XML in this format:\u003c/p\u003e\n\n\u003cp\u003eSource:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" encoding=\"UTF-8\"?\u0026gt;\n\u0026lt;variables id=\"simulation\"\u0026gt;\n \u0026lt;variable id=\"Code\"\u0026gt;75\u0026lt;/variable\u0026gt;\n \u0026lt;variable id=\"Type\"\u0026gt;Varial\u0026lt;/variable\u0026gt;\n \u0026lt;variable id=\"owner\"\u0026gt;Jeremy\u0026lt;/variable\u0026gt;\n\u0026lt;/variables\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to process it in order to look like this:\u003c/p\u003e\n\n\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;Envelope\u0026gt;\n \u0026lt;Code\u0026gt;75\u0026lt;/Code\u0026gt;\n \u0026lt;Type\u0026gt;Varial\u0026lt;/Type\u0026gt;\n \u0026lt;Owner\u0026gt;Jeremy\u0026lt;/Owner\u0026gt;\n\u0026lt;/Envelope\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI tried using xsl:variable to hold the value of \n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;xsl:variable\nselect=\"\u0026lt;xsl:template match=\"variable[@id='Code']\" name=\"varcode\"\u0026gt;\"\u0026gt;\n\u0026lt;/xsl:variable\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eUsing online tools to validate and test the XSLT I have not succeeded in my task.\u003c/p\u003e\n\n\u003cp\u003eThis is my XSLT so far that is able to grab the value of the first element:\u003c/p\u003e\n\n\u003cp\u003e\n\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;xsl:template match=\"variable[@id='Code']\" name=\"varcode\"\u0026gt;\n\u0026lt;Envelope\u0026gt;\n \u0026lt;Code\u0026gt;\u0026lt;xsl:value-of select=\".\"/\u0026gt;\u0026lt;/Code\u0026gt;\n \u0026lt;Type\u0026gt;\u0026lt;/Type\u0026gt;\n \u0026lt;Owner\u0026gt;\u0026lt;/Owner\u0026gt;\n\u0026lt;/Envelope\u0026gt;\n\u0026lt;/xsl:template\u0026gt;\n\u0026lt;/xsl:stylesheet\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCan anyone help me getting the values of the remaining ones?\nThanks\u003c/p\u003e","accepted_answer_id":"46645358","answer_count":"2","comment_count":"0","creation_date":"2017-10-09 11:10:56.073 UTC","last_activity_date":"2017-10-09 11:28:31.333 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1298004","post_type_id":"1","score":"0","tags":"xml|xslt","view_count":"23"} +{"id":"41145368","title":"Encode/decode string with quotation marks","body":"\u003cp\u003eI can't properly encode and decode a string that contains single and double quotation marks. Note: I need to show quotation marks. \u003c/p\u003e\n\n\u003cp\u003eI saved following string in a txt file. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eHere’s their mantra: “Eat less and exercise more. The secret to weight loss is energy balance. There are no good or bad calories. It’s all about moderation.” \n\nwith open (\"file.txt\", \"r\") as myfile:\n data = myfile.read()\n myfile.close()\n\nprint data\nthe result:\n∩╗┐\nHereΓÇÖs their mantra: ΓÇ£Eat less and exercise more. The secret to weight loss is energy balance. There are no good or bad calories. ItΓÇÖs all about moderation.ΓÇ¥ \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI can fully omit quotation marks, but I need to show them \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprint data.decode('ascii', 'ignore') \n\nHeres their mantra: Eat less and exercise more. The secret to weight loss is energy balance. There are no good or bad calories. Its all about moderation.\n\nprint json.dumps(data)\n\n\"\\ufeff\\nHere\\u2019s their mantra: \\u201cEat less and exercise more. The secret to weight loss is energy balance. There are no good or bad calories. It\\u2019s all about moderation.\\u201d \"\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"6","creation_date":"2016-12-14 14:43:54.253 UTC","last_activity_date":"2016-12-14 15:17:25.627 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5194792","post_type_id":"1","score":"-1","tags":"python","view_count":"260"} +{"id":"21703601","title":"URL rewrite and redirect between hosts","body":"\u003cp\u003eI have the following rewrite rule to redirect any conetnt from a host, hostA.com to the home page of a new host, hostB.com. \u003cem\u003eI also want to browser url to change to www.HostB.com\u003c/em\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;rewrite\u0026gt;\n \u0026lt;rules\u0026gt;\n \u0026lt;rule name=\"301 redirect entire site\" stopProcessing=\"true\"\u0026gt;\n \u0026lt;match url=\"^hostA(.*)$\" /\u0026gt;\n \u0026lt;action type=\"Redirect\" redirectType=\"Permanent\" url=\"http://www.hostB.com\" appendQueryString=\"true\" /\u0026gt;\n \u0026lt;/rule\u0026gt;\n \u0026lt;/rules\u0026gt;\n \u0026lt;/rewrite\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut that does not work. How can I fix this please.\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2014-02-11 13:45:14.28 UTC","last_activity_date":"2014-02-11 14:03:44.157 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"807223","post_type_id":"1","score":"0","tags":"iis|url-rewriting|host|url-redirection","view_count":"81"} +{"id":"32870388","title":"How to use the elements of an array on another function?","body":"\u003cp\u003eI need to make a game for my programming class and part of it envolves shuffling some cards (represented by numbers) and then showing them on another function. \u003c/p\u003e\n\n\u003cp\u003eSince the cards are then distributed into two arrays I need to access those values on the show function.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eint deck_shuffle()\n{\n int deck[] {1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,5,5,5,5,6,6,6,6,7,8,9,10};\n srand(time(0));\n\n\nrandom_shuffle(\u0026amp;deck[0], \u0026amp;deck[28]);\n int player1_hand[] {deck[0], deck[1], deck[2]};\n int player2_hand[] {deck[3], deck[4], deck[5]}\n}\n\n\n\nvoid show_cards()\n{\ncout \u0026lt;\u0026lt;\"PLAYER 1 HAND\" \u0026lt;\u0026lt; endl ;\n\n\ncout\u0026lt;\u0026lt; player1_hand[0] \u0026lt;\u0026lt; endl ;\ncout\u0026lt;\u0026lt; player1_hand[1] \u0026lt;\u0026lt; endl;\ncout\u0026lt;\u0026lt; player1_hand[2] \u0026lt;\u0026lt; endl;\n\ncout \u0026lt;\u0026lt;\"PLAYER 2 HAND\" \u0026lt;\u0026lt; endl ;\n\ncout\u0026lt;\u0026lt; player2_hand[0] \u0026lt;\u0026lt; endl;\ncout\u0026lt;\u0026lt; player2_hand[1] \u0026lt;\u0026lt; endl;\ncout\u0026lt;\u0026lt; player2_hand[2] \u0026lt;\u0026lt; endl;\n\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow can I use the values of the arrays \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eint player1_hand[]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eint player2_hand[]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOn the function:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evoid show_cards()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e??\nThanks in advance!\u003c/p\u003e","answer_count":"0","comment_count":"5","creation_date":"2015-09-30 15:44:25.32 UTC","last_activity_date":"2015-09-30 15:47:46.207 UTC","last_edit_date":"2015-09-30 15:47:46.207 UTC","last_editor_display_name":"","last_editor_user_id":"312962","owner_display_name":"","owner_user_id":"5393865","post_type_id":"1","score":"0","tags":"c++|arrays","view_count":"51"} +{"id":"23202041","title":"Bootstrap's dropdown menu doesn't work","body":"\u003cp\u003eI've already included bootstrap-dropdown.js but don't know why it doesn't work.\u003c/p\u003e\n\n\u003cp\u003eHere is my code, everything is the same as the code in document page.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;!DOCTYPE html\u0026gt;\n\u0026lt;html\u0026gt;\n\u0026lt;head\u0026gt;\n\u0026lt;meta charset=\"utf-8\"\u0026gt;\n\u0026lt;link href=\"css/bootstrap.min.css\" rel=\"stylesheet\"\u0026gt;\n\u0026lt;script src=\"//ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\n\u0026lt;script src=\"js/bootstrap.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\n\u0026lt;script type=\"text/javascript\" src=\"http://twitter.github.io/bootstrap/assets/js/bootstrap-dropdown.js\"\u0026gt;\u0026lt;/script\u0026gt;\n\u0026lt;title\u0026gt;Lorem Ipsum\u0026lt;/title\u0026gt;\n\u0026lt;/head\u0026gt;\n\u0026lt;body\u0026gt;\n\u0026lt;div class=\"row\"\u0026gt;\n \u0026lt;div class=\"container\"\u0026gt;\n \u0026lt;div class=\"col-md-5\"\u0026gt;\u0026lt;h1\u0026gt;Lorem Ipsum\u0026lt;/h1\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\n\u0026lt;br\u0026gt;\n\n\u0026lt;div class=\"row\"\u0026gt;\n \u0026lt;div class=\"container\"\u0026gt;\n \u0026lt;div class=\"col-md-12\"\u0026gt;\n \u0026lt;nav class=\"navbar navbar-default\" role=\"navigation\"\u0026gt;\n \u0026lt;div class=\"container-fluid\"\u0026gt;\n \u0026lt;!-- Brand and toggle get grouped for better mobile display --\u0026gt;\n \u0026lt;div class=\"navbar-header\"\u0026gt;\n \u0026lt;button type=\"button\" class=\"navbar-toggle\" data-toggle=\"collapse\" data-target=\"#bs-example-navbar-collapse-1\"\u0026gt;\n \u0026lt;span class=\"sr-only\"\u0026gt;Toggle navigation\u0026lt;/span\u0026gt;\n \u0026lt;span class=\"icon-bar\"\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;span class=\"icon-bar\"\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;span class=\"icon-bar\"\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;/button\u0026gt;\n \u0026lt;a class=\"navbar-brand\" href=\"#\"\u0026gt;Brand\u0026lt;/a\u0026gt;\n \u0026lt;/div\u0026gt;\n\n \u0026lt;!-- Collect the nav links, forms, and other content for toggling --\u0026gt;\n \u0026lt;div class=\"collapse navbar-collapse\" id=\"bs-example-navbar-collapse-1\"\u0026gt;\n \u0026lt;ul class=\"nav navbar-nav\"\u0026gt;\n \u0026lt;li class=\"active\"\u0026gt;\u0026lt;a href=\"#\"\u0026gt;Link\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#\"\u0026gt;Link\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li class=\"dropdown\"\u0026gt;\n \u0026lt;a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\"\u0026gt;Dropdown \u0026lt;b class=\"caret\"\u0026gt;\u0026lt;/b\u0026gt;\u0026lt;/a\u0026gt;\n \u0026lt;ul class=\"dropdown-menu\"\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a data-toggle=\"dropdown\" href=\"#\"\u0026gt;Action\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a data-toggle=\"dropdown\" href=\"#\"\u0026gt;Another action\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a data-toggle=\"dropdown\" href=\"#\"\u0026gt;Something else here\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n \u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n \u0026lt;form class=\"navbar-form navbar-left\" role=\"search\"\u0026gt;\n \u0026lt;div class=\"form-group\"\u0026gt;\n \u0026lt;input type=\"text\" class=\"form-control\" placeholder=\"Search\"\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;button type=\"submit\" class=\"btn btn-default\"\u0026gt;Submit\u0026lt;/button\u0026gt;\n \u0026lt;/form\u0026gt;\n \u0026lt;ul class=\"nav navbar-nav navbar-right\"\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#\"\u0026gt;Link\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li class=\"dropdown\"\u0026gt;\n \u0026lt;a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\"\u0026gt;Dropdown \u0026lt;b class=\"caret\"\u0026gt;\u0026lt;/b\u0026gt;\u0026lt;/a\u0026gt;\n \u0026lt;ul class=\"dropdown-menu\"\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#\"\u0026gt;Action\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#\"\u0026gt;Another action\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#\"\u0026gt;Something else here\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li class=\"divider\"\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#\"\u0026gt;Separated link\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n \u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n \u0026lt;/div\u0026gt;\u0026lt;!-- /.navbar-collapse --\u0026gt;\n \u0026lt;/div\u0026gt;\u0026lt;!-- /.container-fluid --\u0026gt;\n \u0026lt;/nav\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\n \u003c/p\u003e\n\n\u003cp\u003ePS. I've search in docs. It told me that I've to download dropdown.js but don't see any download button.\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2014-04-21 17:06:34.877 UTC","last_activity_date":"2014-04-21 17:23:10.63 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3480543","post_type_id":"1","score":"0","tags":"html|twitter-bootstrap|twitter-bootstrap-3","view_count":"2902"} +{"id":"8573942","title":"What is the difference between Version and 'Runtime Version' in .Net?","body":"\u003cp\u003eWhen I open the properties window of one of the referenced dlls in my project in Visual Studio I see a Version and also a runtime version .\u003c/p\u003e\n\n\u003cp\u003eActually it is Rhino.Mocks library I am checking. And I see \u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eRuntime Version : v2.0.50727\u003c/li\u003e\n\u003cli\u003eVersion : 3.6.0.0\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eWhat is the difference? (Does it mean I am not able to use 3.6.0.0 of the Rhino Mocks?)\u003c/p\u003e","accepted_answer_id":"8573972","answer_count":"1","comment_count":"3","creation_date":"2011-12-20 10:21:37.197 UTC","favorite_count":"4","last_activity_date":"2011-12-20 11:22:16.96 UTC","last_edit_date":"2011-12-20 11:22:16.96 UTC","last_editor_display_name":"","last_editor_user_id":"959045","owner_display_name":"","owner_user_id":"136141","post_type_id":"1","score":"33","tags":".net|runtime|version|rhino-mocks|.net-assembly","view_count":"9579"} +{"id":"32114974","title":"how can I redesign the \"Editing: Video\" page of Open Edx","body":"\u003cp\u003eHello guys currently I am working on open edx I am very new to the Open edx.\nI have configured the open edx but I need to do some programmatical changes and I am not very much aware about the environment on which the open edx has made.I need to change the below page\n\u003ca href=\"https://i.stack.imgur.com/DyTED.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/DyTED.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI am not able to find this page.\nany help would be appriciated thank you.\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2015-08-20 09:48:48.903 UTC","last_activity_date":"2015-08-20 09:48:48.903 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4481829","post_type_id":"1","score":"0","tags":"openedx","view_count":"46"} +{"id":"9306585","title":"Retrieve current userid from C# web services","body":"\u003cp\u003eI need to create a C# 3.0 Web service which is capable to retrieve (only) the userid of the CALLER in an intranet environment. I realise I could possibly pass the information from the caller program but in my case it is not feasible. The Web service is going to be consumed by a Windows app (Infopath 2003 to be precise)..and retrieve the userid from my Windows app is not practical in this circumstances. \u003c/p\u003e\n\n\u003cp\u003eIs that achievable? The IIS (hosted in windows 2003 standard server) uses windows authentication. I have tried a few things using WindowsIdentity but it only works for localhost.\u003c/p\u003e","accepted_answer_id":"9306687","answer_count":"1","comment_count":"1","creation_date":"2012-02-16 06:30:24.183 UTC","last_activity_date":"2012-02-16 06:41:17.777 UTC","last_edit_date":"2012-02-16 06:38:06.583 UTC","last_editor_display_name":"","last_editor_user_id":"76337","owner_display_name":"","owner_user_id":"1193911","post_type_id":"1","score":"1","tags":"web-services|c#-3.0|networkcredentials","view_count":"161"} +{"id":"6874294","title":"Finding the value of the reference name to R","body":"\u003cp\u003eI am doing some debugging in my application, mainly loading custom styles from styles.xml when my custom view is given a \u003ccode\u003estyle=\"@styles/CustomStyle\"\u003c/code\u003e, and attributes such as \u003ccode\u003ecustom:attribute=\"custom value\"\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eI looked into the \u003ccode\u003eTextView\u003c/code\u003e source to see how Android loads styles/attributes and I am mimicking that. However I am not being passed any of my R.styleables through some of the calls to my constructors and so I am trying to peek in there to see which resources are coming in.\u003c/p\u003e\n\n\u003cp\u003eI am using \u003ccode\u003eobtainStyledAttributes()\u003c/code\u003e to load these key/value pairs into a \u003ccode\u003eTypedArray\u003c/code\u003e, however I am wondering if there is an easy way to convert the \u003ccode\u003eR.styleable.CustomWidget_customAttribute\u003c/code\u003e from the \u003ccode\u003eint\u003c/code\u003e that \u003ccode\u003eR\u003c/code\u003e reads, to its referenced name.\u003c/p\u003e\n\n\u003cp\u003eIn essence, I want LogCat to say, \"We've been given R.styleable.xxx\" and not \"We've been given 1487214712442\"\u003c/p\u003e","accepted_answer_id":"6874379","answer_count":"2","comment_count":"0","creation_date":"2011-07-29 13:58:21.75 UTC","last_activity_date":"2011-07-29 14:06:24.79 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"559850","post_type_id":"1","score":"1","tags":"android|android-layout|android-xml","view_count":"103"} +{"id":"14979309","title":"Moving data from production db to datawarehouse (SQL Server)","body":"\u003cp\u003eWe are developing a reporting module for our software, and because of this we need to move some data from the system's production db into a datawarehouse db which will be used as the datasource for the reports (SQL Server reporting).\u003c/p\u003e\n\n\u003cp\u003eThe schema in the production DB is quite old, so once we have data in the DW DB, we will need some additional fields (for example, calculating a correct datetime colum out of the prod db's 'date' and 'time' integer columns. (Don't ask, it's old.)\u003c/p\u003e\n\n\u003cp\u003eWe are discussing internally how to do this in an efficient manner. Right now, it is implemented in a fugly SSIS job that basically tears down the entire DW DB every night and builds it up again from the prod db, doing data transformations as it goes. This doesn't scale very well.\u003c/p\u003e\n\n\u003cp\u003eI've been looking into using \"newer\" technologies, like for example SQL Server replication to move data in a more granular fashion.\u003c/p\u003e\n\n\u003cp\u003eMy questions about this is:\n-With replication the \"move data\" part is obviously solved, but not the data transform part. I know I can create update triggers on the DW DB, but all table-related triggers seem to be wiped whenever I do a reinitialize on the subscription, which makes it hard to set up.\u003c/p\u003e\n\n\u003cp\u003eI'm not looking for an exact answer here, more a hint on which direction to take this. Sorry if the question is a bit blurry.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eupdate:\u003c/strong\u003e\nthanks for the good points below. This is software we're selling to customers, so I'm a big fan of having as few as possible \"config items\" for the customer to set up and maintain. The SSIS package as it stands today is one more \"item\" for the customer to keep tabs on, along with its schedules. \u003c/p\u003e\n\n\u003cp\u003eReplication intriguied me because it completely abscracts the whole CRUD \"dilemma\" when moving data, but you may be right - SSIS would still be better, as long as the SSIS logic is created a bit smarter than today. \u003c/p\u003e\n\n\u003cp\u003eData might be quite large tho, so wiping and reimporting everything like we do today is definetely a problem that needs adressing\n.\u003c/p\u003e","answer_count":"2","comment_count":"1","creation_date":"2013-02-20 11:57:33.89 UTC","last_activity_date":"2013-02-20 21:36:09.74 UTC","last_edit_date":"2013-02-20 15:25:49.72 UTC","last_editor_display_name":"","last_editor_user_id":"82834","owner_display_name":"","owner_user_id":"82834","post_type_id":"1","score":"2","tags":"sql|sql-server|tsql|ssis","view_count":"1213"} +{"id":"23690691","title":"Creating an Arc3D object in Java","body":"\u003cp\u003eI will be working with an application that will use 3D graphics in Java and I am pretty sure we'll need an arc object in 3D. I've seen some proposed methods on how to do that, one of which entailed creating an Arc2D object and then rotating it in 3D. Not quite sure how to do that because I couldn't find how to rotate a plane in Java 3D, but I imagine I need to use the \u003ccode\u003ejavax.media.j3d.J3DGraphics2D\u003c/code\u003e object.\u003c/p\u003e\n\n\u003cp\u003eRegardless, I am wondering if it is worth my time to create an Arc3D object. It will make everyone's life much easier, it makes more sense to simply have an arc in 3D than create an entire drawing plane and then rotating it, and overall it would be a contribution to Java programmers. \u003c/p\u003e\n\n\u003cp\u003eMy questions are, from your experience, how long does it take to create a new class that works in an existing API? and where would I start? I tried looking at the \u003ccode\u003eGraphics\u003c/code\u003e, \u003ccode\u003eGraphics2D\u003c/code\u003e, and \u003ccode\u003eArc2D\u003c/code\u003e documentations and couldn't find where the actual drawing takes place so I can see how to do the same in 3D.\u003c/p\u003e\n\n\u003cp\u003eAny help?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-05-16 00:11:53.837 UTC","last_activity_date":"2014-05-16 13:22:23.147 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"336893","post_type_id":"1","score":"0","tags":"java|graphics|3d","view_count":"77"} +{"id":"26533343","title":"integrate devise_invitable with angular js in rails4","body":"\u003cp\u003eAs the question I ask, now I can easily use devise_invitable module in rails app. However, it is hard to migrate to angular js.\nI'm trying to use $http.post with url '/users/invitation.json' to trigger the invitation on the server side.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$scope.inviteUser = -\u0026gt;\n $http.post('/users/invitation.json',\n email: $scope.email\n).success (data) -\u0026gt;\n _log \"successful\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe log file shows that \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eStarted POST \"/users/invitation.json\" for 127.0.0.1 at 2014-10-24 03:48:49 +1100\nProcessing by Devise::InvitationsController#create as JSON\nParameters: {\"email\"=\u0026gt;\"sample@mail.com\", \"invitation\"=\u0026gt;{\"email\"=\u0026gt;\"sample@mail.com\"}}\nUser Load (0.3ms) SELECT \"users\".* FROM \"users\" WHERE \"users\".\"id\" = 1 ORDER BY \"users\".\"id\" ASC LIMIT 1\nCompleted 422 Unprocessable Entity in 3ms (Views: 0.1ms | ActiveRecord: 0.3ms)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI can figure out that the problem could be the credential. The params apparently miss \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\"authenticity_token\"=\u0026gt;\"MEAh9r7vD8cUxXQH9+qnjykHKV8OeC+fvuNW6Whsewg=\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut don't know how to fix it. In plain rails app, every thing goes well. I can post email to user_invitation_path to invite new user.\nAnd I'm really new to angular js, could any one help me on it?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-10-23 16:56:59.657 UTC","favorite_count":"1","last_activity_date":"2014-10-24 07:02:23.3 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3625741","post_type_id":"1","score":"2","tags":"ruby-on-rails|angularjs|devise-invitable","view_count":"235"} +{"id":"2630360","title":"VB.NET ASP.NET Web Application woes (VS 2008)","body":"\u003cp\u003eI am making my first web application with ASP.NET and I am having a rough time. I have previously created the application I am working on as a Windows Form application and it works great, but I am having problems with the HTML side of things in the web application. My issues are pretty minor, but very annoying. I have worked with websites before and CSS, but as far as I can tell I do not have direct access to a CSS when creating a web application in VS 2008. \u003cstrong\u003eMy biggest issue is the positioning of components that I have dragged onto the \"Default.aspx\" form.\u003c/strong\u003e For instance, how am I supposed to float a panel next to another one if I don't have a CSS, or how am I to correctly position a label?\u003c/p\u003e","accepted_answer_id":"2630420","answer_count":"2","comment_count":"0","creation_date":"2010-04-13 14:33:06.84 UTC","last_activity_date":"2010-04-13 23:38:10.48 UTC","last_edit_date":"2010-04-13 23:38:10.48 UTC","last_editor_display_name":"","last_editor_user_id":"97890","owner_display_name":"","owner_user_id":"288341","post_type_id":"1","score":"1","tags":".net|asp.net|vb.net|visual-studio-2008|webforms","view_count":"349"} +{"id":"33372743","title":"perl how to finish the script by 'cd $newdir'","body":"\u003cp\u003eI have a perl script that creates a directory \u003ccode\u003e$newdir\u003c/code\u003e based on some input passed as a parameter, and I would like the script to finish it's execution by doing:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecd $newdir\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo that the next command in bash Linux 64bit (here \u003ccode\u003eprogram2\u003c/code\u003e) is executed from the \u003ccode\u003e$newdir\u003c/code\u003e working directory.\u003c/p\u003e\n\n\u003cp\u003eE.g.:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eperl $HOME/import_script.pl -i someparameter \u0026amp;\u0026amp; $HOME/program2 .\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"33372854","answer_count":"2","comment_count":"0","creation_date":"2015-10-27 16:00:02.503 UTC","last_activity_date":"2015-10-27 23:42:46.333 UTC","last_edit_date":"2015-10-27 16:21:52.88 UTC","last_editor_display_name":"","last_editor_user_id":"719016","owner_display_name":"","owner_user_id":"719016","post_type_id":"1","score":"1","tags":"bash|perl","view_count":"55"} +{"id":"9705052","title":"jquery hint disappears when i click submit","body":"\u003cp\u003ewhen user1 and user2 do not select anything from radio box the jquery validation triggers but removes the jquery hint from the 'fav food' textbox. how do i prevent this?\u003c/p\u003e\n\n\u003cp\u003eworking example: \u003ca href=\"http://jsfiddle.net/NevcG/1/\" rel=\"nofollow\"\u003ehttp://jsfiddle.net/NevcG/1/\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"9705113","answer_count":"1","comment_count":"2","creation_date":"2012-03-14 15:37:24.343 UTC","last_activity_date":"2012-03-14 15:48:19.17 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1195339","post_type_id":"1","score":"0","tags":"javascript|jquery","view_count":"104"} +{"id":"26449721","title":"NullPointerException at the call of getDefaultSharedPreference","body":"\u003cp\u003eThis is what I've declared in my ContactActivity class \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efinal SharedPreferences exceptionPrefs = PreferenceManager.getDefaultSharedPreferences(this);\nexceptionPrefs.edit().putString(\"Exceptions\", TextUtils.join(\",\", exceptions)).apply();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn a different class (which is not an activity. It extends \u003ccode\u003eBroadcastReceiver\u003c/code\u003e), on trying to get the stored values from \u003ccode\u003eSharedPreference\u003c/code\u003e I'm using this within \u003ccode\u003eonReceive()\u003c/code\u003e -\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSharedPreferences exceptionPositionPrefs = PreferenceManager.getDefaultSharedPreferences(new ContactActivity().getContext());\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThat very line throws a NullPointerException.\u003c/p\u003e\n\n\u003cp\u003eAlso, I must add that onReceive contains of another SharedPreferences object, which receives values from my \u003ccode\u003eMainActivity\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eHere's the LogCat.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e10-19 15:49:03.628: E/AndroidRuntime(24226): FATAL EXCEPTION: main\n10-19 15:49:03.628: E/AndroidRuntime(24226): java.lang.RuntimeException: Unable to start receiver com.scimet.admin.driveon.RejectCall: java.lang.NullPointerException\n10-19 15:49:03.628: E/AndroidRuntime(24226): at android.app.ActivityThread.handleReceiver(ActivityThread.java:2146)\n10-19 15:49:03.628: E/AndroidRuntime(24226): at android.app.ActivityThread.access$1500(ActivityThread.java:127)\n10-19 15:49:03.628: E/AndroidRuntime(24226): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1208)\n10-19 15:49:03.628: E/AndroidRuntime(24226): at android.os.Handler.dispatchMessage(Handler.java:99)\n10-19 15:49:03.628: E/AndroidRuntime(24226): at android.os.Looper.loop(Looper.java:137)\n10-19 15:49:03.628: E/AndroidRuntime(24226): at android.app.ActivityThread.main(ActivityThread.java:4441)\n10-19 15:49:03.628: E/AndroidRuntime(24226): at java.lang.reflect.Method.invokeNative(Native Method)\n10-19 15:49:03.628: E/AndroidRuntime(24226): at java.lang.reflect.Method.invoke(Method.java:511)\n10-19 15:49:03.628: E/AndroidRuntime(24226): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)\n10-19 15:49:03.628: E/AndroidRuntime(24226): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)\n10-19 15:49:03.628: E/AndroidRuntime(24226): at dalvik.system.NativeStart.main(Native Method)\n10-19 15:49:03.628: E/AndroidRuntime(24226): Caused by: java.lang.NullPointerException\n10-19 15:49:03.628: E/AndroidRuntime(24226): at android.preference.PreferenceManager.getDefaultSharedPreferencesName(PreferenceManager.java:371)\n10-19 15:49:03.628: E/AndroidRuntime(24226): at android.preference.PreferenceManager.getDefaultSharedPreferences(PreferenceManager.java:366)\n10-19 15:49:03.628: E/AndroidRuntime(24226): at com.scimet.admin.driveon.RejectCall.onReceive(RejectCall.java:36)\n10-19 15:49:03.628: E/AndroidRuntime(24226): at android.app.ActivityThread.handleReceiver(ActivityThread.java:2139)\n10-19 15:49:03.628: E/AndroidRuntime(24226): ... 10 more\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"26450200","answer_count":"2","comment_count":"2","creation_date":"2014-10-19 10:47:59.407 UTC","last_activity_date":"2014-10-19 11:57:55.78 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2530836","post_type_id":"1","score":"0","tags":"java|android|nullpointerexception","view_count":"250"} +{"id":"39943200","title":"Accessing localserver through Android","body":"\u003cp\u003eI have this code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e @Override\npublic void onCreate(Bundle savedInstanceState) {\n try {\n super.onCreate(savedInstanceState);\n InetAddress ip;\n mWebview = new WebView(this);\n mWebview.getSettings().setJavaScriptEnabled(true);\n final Activity activity = this;\n String ipv4add;\n mWebview.setWebViewClient(new WebViewClient() {\n public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {\n Toast.makeText(activity, description, Toast.LENGTH_SHORT).show();\n }\n });\n ip = InetAddress.getLocalHost();\n ipv4add = ip.getHostAddress().toString();\n System.out.println(ipv4add);\n mWebview .loadUrl(ipv4add+\"/Lab4/Task1/index.php\");\n mWebview.getSettings().setLoadsImagesAutomatically(true);\n mWebview.getSettings().setJavaScriptEnabled(true);\n mWebview.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);\n setContentView(mWebview );\n } catch (UnknownHostException e) {\n e.printStackTrace();\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo what it does exactly is first: it should get the server ip that the phone is supposed to be connected to, then after that it will be inserted into the URL so that the phone can connect to the localserver and access my php files. However, when I launch this into my android phone it just crashes. Why does it do so? Hoping you guys can help me solve this. \u003c/p\u003e","answer_count":"1","comment_count":"6","creation_date":"2016-10-09 11:43:13.583 UTC","last_activity_date":"2016-10-09 12:05:14.87 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5935386","post_type_id":"1","score":"1","tags":"php|android|android-studio|localserver","view_count":"21"} +{"id":"29222603","title":"Shiny slider restrict reaction to releasing left mouse button","body":"\u003cp\u003eI am using a Shiny application in which it may take some time to set a slider to the right value.\u003c/p\u003e\n\n\u003cp\u003eSo while trying to set the slider to the right value (and not releasing my left mouse button!) the (i.e. my local) server observed several new values and reacts accordingly.\u003c/p\u003e\n\n\u003cp\u003eAs the response of my server on any new value may take a few seconds I would be pleased if I could either:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003epostpone signalling the server till the release of the left mouse button, or\u003c/li\u003e\n\u003cli\u003eat the server side, abort any earlier responses if it receive a new value\u003c/li\u003e\n\u003c/ul\u003e","answer_count":"0","comment_count":"0","creation_date":"2015-03-23 23:54:23.437 UTC","favorite_count":"1","last_activity_date":"2015-03-23 23:54:23.437 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3385704","post_type_id":"1","score":"4","tags":"r|slider|shiny","view_count":"70"} +{"id":"27239214","title":"GtkLabel is not wrapping after updating its content","body":"\u003cp\u003ehere is the code i am using :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e messageCrypte= gtk_label_new(\"\");\n gtk_widget_set_size_request(messageCrypte, 400, 100);\n gtk_label_set_line_wrap(GTK_LABEL(messageCrypte), TRUE);\n gtk_grid_attach(GTK_GRID(cryptTab), messageCrypte, 0, ++i, 2, 1);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhen i initialize the label manually by passing a string to the gtk_label_new , the text is wrapped , \nbut when updating the GtkLabel , it increment the window size to the infinite without wrapping,\u003c/p\u003e\n\n\u003cp\u003efrom the docs :\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eNote that setting line wrapping to TRUE does not make the label wrap\n at its parent container’s width, because GTK+ widgets conceptually\n can’t make their requisition depend on the parent container’s size.\n For a label that wraps at a specific position, set the label’s width\n using gtk_widget_set_size_request().\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003ei did what it is said but no results !\u003c/p\u003e","accepted_answer_id":"27282957","answer_count":"1","comment_count":"4","creation_date":"2014-12-01 23:21:49.56 UTC","last_activity_date":"2014-12-03 22:34:32.85 UTC","last_edit_date":"2014-12-02 17:21:53.24 UTC","last_editor_display_name":"","last_editor_user_id":"4043486","owner_display_name":"","owner_user_id":"4043486","post_type_id":"1","score":"0","tags":"gtk|gtk3","view_count":"59"} +{"id":"21448145","title":"Customer Data Account using Intuit","body":"\u003cp\u003eI am trying to use Customer Data Account API though php. i have fetched all accounts by passing this for demo account such as 100000 cc-Bank account but its on Intuit.\u003c/p\u003e\n\n\u003cp\u003e\n \n \n Banking Userid\n demo\n \n \n Banking Password\n go\n \n \n\u003c/p\u003e\n\n\u003cp\u003ei want to get fetch Api url data of fetched account at client side by php i have found missing OAuth-\u003efetch method i have made it.But its not working at my side.\u003c/p\u003e\n\n\u003cp\u003ei have also followed \u003ca href=\"https://github.com/jrconlin/oauthsimple\" rel=\"nofollow\"\u003ehttps://github.com/jrconlin/oauthsimple\u003c/a\u003e but its only working for to get Institutions details and list. \u003c/p\u003e\n\n\u003cp\u003eIf anybody has an idea please help me out. \u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-01-30 04:58:07.57 UTC","last_activity_date":"2014-03-02 13:36:52.213 UTC","last_edit_date":"2014-03-02 13:36:52.213 UTC","last_editor_display_name":"","last_editor_user_id":"2140489","owner_display_name":"","owner_user_id":"3228017","post_type_id":"1","score":"0","tags":"php|jquery|ruby-on-rails-3|intuit-partner-platform|customer-account-data-api","view_count":"148"} +{"id":"2243339","title":"Trying to set selected value of DropDown in Javascript with encoded value","body":"\u003cp\u003eI have a dropdown which lists heights, like this:\u003c/p\u003e\n\n\u003cp\u003e5' 9\"\u003cbr/\u003e\n5' 10\"\u003cbr/\u003e\n5' 11\"\u003cbr/\u003e\n6' 0\"\u003cbr/\u003e\u003c/p\u003e\n\n\u003cp\u003eEtc.\u003c/p\u003e\n\n\u003cp\u003eWhen I view source, it looks like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;option value=\"5' 9\u0026amp;quot;\"\u0026gt;5' 9\u0026amp;quot;\u0026lt;/option\u0026gt;\n\u0026lt;option value=\"5' 10\u0026amp;quot;\"\u0026gt;5' 10\u0026amp;quot;\u0026lt;/option\u0026gt;\n\u0026lt;option value=\"5' 11\u0026amp;quot;\"\u0026gt;5' 11\u0026amp;quot;\u0026lt;/option\u0026gt;\n\u0026lt;option value=\"6' 0\u0026amp;quot;\"\u0026gt;6' 0\u0026amp;quot;\u0026lt;/option\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow can I set the selected value of my dropdown box via Javascript when those characters are in there?\u003c/p\u003e\n\n\u003cp\u003eI tried:\u003c/p\u003e\n\n\u003cp\u003edocument.GetElementById(\"myDDL\").value = '5\\' 11\\\"';\u003c/p\u003e\n\n\u003cp\u003eHowever that is not working and I'm just taking stabs in the dark.\u003c/p\u003e\n\n\u003cp\u003eThank you!\u003c/p\u003e","accepted_answer_id":"2243359","answer_count":"3","comment_count":"0","creation_date":"2010-02-11 09:11:22.297 UTC","last_activity_date":"2012-12-07 07:55:27.8 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"53885","post_type_id":"1","score":"0","tags":"javascript","view_count":"10392"} +{"id":"47402619","title":"Nested index in Lua: a['0'].b['0']?","body":"\u003cp\u003eI'd like to implement some Lua data structure to achieve the following syntax:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003e\u003ccode\u003eunits\u003c/code\u003e -\u003e returns a table of units.\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eunits[0]\u003c/code\u003e -\u003e returns a number.\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eunits[0].properties\u003c/code\u003e -\u003e returns a table of properties.\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eunits[0].properties[0]\u003c/code\u003e -\u003e return the property of units[0], which is also a number.\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eThe first 2 steps are trivial given a number indexed table.\nBut can I achieve all 4 requirements at the same time?\u003c/p\u003e\n\n\u003cp\u003eI was thinking about creating \u003ccode\u003eunits\u003c/code\u003e with customized \u003ccode\u003e__index\u003c/code\u003e metamethod. Is it the right direction?\u003c/p\u003e","answer_count":"1","comment_count":"5","creation_date":"2017-11-20 23:07:42.16 UTC","last_activity_date":"2017-11-21 21:15:21.37 UTC","last_edit_date":"2017-11-20 23:36:39.457 UTC","last_editor_display_name":"","last_editor_user_id":"2157214","owner_display_name":"","owner_user_id":"2157214","post_type_id":"1","score":"3","tags":"lua","view_count":"65"} +{"id":"2446692","title":"Firefox conditional comments CSS","body":"\u003cp\u003eI'm trying to position a button. I want it to be above the \"Gå Videre\" button on the page, it works in Safari and Chrome but not IE or FF. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#cartUpdate {\n position:absolute;\n width:160px;\n height:30px;\n left:580px;\n bottom:50px;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e {capture assign=\"cartUpdate\"}\n\n \u0026lt;div id=\"cartUpdate\"\u0026gt;\u0026lt;!--\u0026lt;input type=\"submit\" class=\"submit\" value=\"{tn _update}\" /\u0026gt;--\u0026gt;\n \u0026lt;button type=\"submit\" class=\"submit\" id=\"oppdatersubmit\" name=\"saveFields\" title=\"Oppdater\" value=\"\"\u0026gt;\u0026amp;nbsp;\u0026lt;/button\u0026gt; \u0026lt;/div\u0026gt;\n {/capture}\n {assign var=\"cartUpdate\" value=$cartUpdate|@str_split:10000}\n {php}$GLOBALS['cartUpdate'] = $this-\u0026gt;get_template_vars('cartUpdate'); $this-\u0026gt;assign_by_ref('GLOBALS', $GLOBALS);{/php}\n\n {form action=\"controller=order action=update\" method=\"POST\" enctype=\"multipart/form-data\" handle=$form id=\"cartItems\"}\n\nCONTENT\n\n\n{/form}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCan be seen live at www.euroworker.no/order (put something in the basket first (Kjøp and Handlevogn)\u003c/p\u003e\n\n\u003cp\u003eEDIT: Just noticed my backend editor has stopped updating the .tpl file.. Might have something to do with it, no updates have been made for hours according to what's on the FTP. Just one thing after another... \u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","accepted_answer_id":"2446737","answer_count":"4","comment_count":"7","creation_date":"2010-03-15 11:27:09.217 UTC","favorite_count":"1","last_activity_date":"2014-08-30 22:33:11.83 UTC","last_edit_date":"2014-08-30 22:33:11.83 UTC","last_editor_display_name":"","last_editor_user_id":"3366929","owner_display_name":"","owner_user_id":"287047","post_type_id":"1","score":"2","tags":"css|firefox","view_count":"3988"} +{"id":"43632695","title":"how to decodeBitmap with excat size of uri?","body":"\u003cp\u003eI had an uri created from local resources ,now i need to decode bitmap from uri.\u003c/p\u003e\n\n\u003cp\u003eIf i create an bitmap from drawable ,getting width as 108 ,but the same with creating bitmap from inputstram pointed to uri,getting as 36.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e is = this.getContentResolver().openInputStream(uri);\n BitmapFactory.Options opts = new BitmapFactory.Options();\n bitmap = BitmapFactory.decodeStream(is, null, opts);\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-04-26 11:19:21.187 UTC","last_activity_date":"2017-04-26 11:19:21.187 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7596535","post_type_id":"1","score":"0","tags":"stream|uri|drawable","view_count":"5"} +{"id":"20083015","title":"d3js: supply a function to tickPadding","body":"\u003cp\u003eSay I have \u003ca href=\"http://jsfiddle.net/6XPpe/2/\" rel=\"nofollow\"\u003ea graph where the x-axis tick labels are very long strings\u003c/a\u003e, and so I want to alternate the tick padding (the vertical distance between the text and the x-axis) so that the tick labels don't overlap.\u003c/p\u003e\n\n\u003cp\u003eI know this can be achieved post-rendering by selecting the tick elements and applying a transform attribute. But I'd like to do:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar xAxis = d3.svg.axis()\n.scale(x0)\n.orient(\"bottom\")\n.tickSize(0)\n.tickPadding(function(i) {\n // some logic here to determine the alternating-height strategy by index, e.g.\n return i % 2 ? 20 : 30;\n });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis doesn't work in d3 as-is -- the documentation (\u003ca href=\"https://github.com/mbostock/d3/wiki/SVG-Axes#wiki-tickPadding\" rel=\"nofollow\"\u003ehttps://github.com/mbostock/d3/wiki/SVG-Axes#wiki-tickPadding\u003c/a\u003e) says that tickPadding just takes the number of pixels. Is there a better way to do this? Monkey patch d3's axis.tickPadding function to take a function or a number, then apply the function when drawing the ticks?\u003c/p\u003e","accepted_answer_id":"20085394","answer_count":"3","comment_count":"0","creation_date":"2013-11-19 22:02:54.003 UTC","last_activity_date":"2014-01-27 21:20:09.677 UTC","last_edit_date":"2013-11-19 23:24:56.223 UTC","last_editor_display_name":"","last_editor_user_id":"941238","owner_display_name":"","owner_user_id":"941238","post_type_id":"1","score":"1","tags":"javascript|svg|d3.js","view_count":"2426"} +{"id":"22958170","title":"absurdly slow running rspec test","body":"\u003cp\u003eI have this very simple and short test which takes a 80 seconds to run, any advice on speed it up?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003erequire 'spec_helper'\n\ndescribe \"Battles\" do\nlet(:character) { (FactoryGirl.create :character) }\n\n describe \"Battle button\" do\n it \"redirects to battle screen\" do\n character.init(\"fighter\")\n click(\"Battle\")\n expect(page).to have_content character.name\n\n end\n end\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eGemfile\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esource 'https://rubygems.org'\nruby '2.0.0'\ngem 'pg', '0.15.1'\n\ngem 'rails', '4.0.2'\ngem 'bcrypt-ruby', '~\u0026gt; 3.1.2'\ngem 'twitter-bootstrap-rails'\ngem 'therubyracer'\ngem 'devise'\ngem 'less-rails'\ngem 'will_paginate', '~\u0026gt; 3.0'\ngem 'heroku'\n\ngroup :development, :test do\n gem 'rspec-rails', '2.13.1'\n gem 'better_errors'\n gem 'binding_of_caller'\n gem 'factory_girl'\n gem 'guard-rspec'\n gem 'guard-spork'\n gem 'capybara', '2.1.0'\n gem 'factory_girl_rails', :require =\u0026gt; false\n gem 'spork-rails'\nend\n\ngroup :test do \n gem 'selenium-webdriver', '2.35.1'\n\nend\n\ngroup :production do\n gem 'rails_12factor', group: :production\nend\n\n#gem 'sass-rails', '4.0.1'\ngem 'uglifier', '2.1.1'\ngem 'coffee-rails', '4.0.1'\ngem 'jquery-rails', '3.0.4'\ngem 'turbolinks', '1.1.1'\ngem 'jbuilder', '1.0.2'\n\ngroup :doc do\n gem 'sdoc', '0.3.20', require: false\nend\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"1","creation_date":"2014-04-09 09:25:08.007 UTC","favorite_count":"1","last_activity_date":"2016-08-18 05:43:41.093 UTC","last_edit_date":"2014-04-11 17:30:57.623 UTC","last_editor_display_name":"","last_editor_user_id":"2938939","owner_display_name":"","owner_user_id":"2938939","post_type_id":"1","score":"0","tags":"ruby-on-rails|rspec","view_count":"131"} +{"id":"14170424","title":"sqlite3 order by takes time","body":"\u003cp\u003eI have tables in sqlite3 db that are located on memory mapped partition. I have select statement that looks like this with this query plan:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esqlite3\u0026gt; EXPLAIN QUERY PLAN SELECT sst.prefix, 0 AS pb, sst.rate, \nsst.rate_n, sst.interval_1, sst.interval_n\nFROM sch AS sst\nWHERE\nsst.i_workbook_id = 989 AND \nsst.prefix IN ('', '1', '19', '191', '1919', '19198') AND \nsst.activation_date \u0026lt;= DATETIME('now') AND \n(sst.expiration_date \u0026gt; DATETIME('now') OR sst.expiration_date IS NULL) AND\nsst.start_time \u0026lt;= TIME('now') AND \nsst.end_time \u0026gt;= TIME('now');\n\n\n0|0|0|SCAN TABLE sch AS sst (~185 rows)\n0|0|0|EXECUTE LIST SUBQUERY 1\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow if I add order by then his query plan hit the main tables twice and takes 4 times longer than earlier while tables is having 1.3 million rows but filtered rows are only two.\u003c/p\u003e\n\n\u003cp\u003eHere is the new query plan:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esqlite3\u0026gt; EXPLAIN QUERY PLAN SELECT sst.prefix, 0 AS pb, sst.rate, \nsst.rate_n, sst.interval_1, sst.interval_n\nFROM sch AS sst\nWHERE\nsst.i_workbook_id = 989 AND \nsst.prefix IN ('', '1', '19', '191', '1919', '19198') AND \nsst.activation_date \u0026lt;= DATETIME('now') AND \n(sst.expiration_date \u0026gt; DATETIME('now') OR sst.expiration_date IS NULL) AND\nsst.start_time \u0026lt;= TIME('now') AND \nsst.end_time \u0026gt;= TIME('now') order by sst.prefix; \n\n0|0|0|EXECUTE LIST SUBQUERY 1\n0|0|0|SEARCH TABLE sch AS sst USING AUTOMATIC COVERING INDEX (i_workbook_id=?) (~7 rows)\n0|0|0|EXECUTE LIST SUBQUERY 1\n0|0|0|SEARCH TABLE sch AS sst USING AUTOMATIC COVERING INDEX (i_workbook_id=?) (~7 rows)\n0|0|0|EXECUTE LIST SUBQUERY 1\n0|0|0|USE TEMP B-TREE FOR ORDER BY\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny ideas? What am I doing wrong?\u003c/p\u003e","accepted_answer_id":"14170830","answer_count":"1","comment_count":"0","creation_date":"2013-01-05 09:27:58.283 UTC","last_activity_date":"2013-01-05 10:20:39.247 UTC","last_edit_date":"2013-01-05 09:31:11.737 UTC","last_editor_display_name":"","last_editor_user_id":"502381","owner_display_name":"","owner_user_id":"1436658","post_type_id":"1","score":"1","tags":"python|sql|select|sqlite3|sql-order-by","view_count":"131"} +{"id":"17125184","title":"Link to external pdf that changes file name weekly","body":"\u003cp\u003eI need to link to an external site in my drop down menu that hosts a pdf that changes file name every Friday. I had previously asked this question but I am a beginner to php so I am having a tough time implementing it. Any help would be greatly appreciated.\u003c/p\u003e\n\n\u003cp\u003eEx.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ewww.extranet.frostyacres.com/portal_resources/1/Market Report 05-24-13.pdf\nwww.extranet.frostyacres.com/portal_resources/1/Market Report 05-31-13.pdf\nwww.extranet.frostyacres.com/portal_resources/1/Market Report 06-07-13.pdf\nwww.extranet.frostyacres.com/portal_resources/1/Market Report 06-14-13.pdf\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have tried to use this in a drop down menu in an html file, not sure if thats possible.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$startingDate = strtotime('2013-06-07');\necho '\u0026lt;a href=\"https://www.extranet.frostyacres.com/portal_resources/1/Market Report ' . date('m-d-y', $startingDate) . '.pdf\"\u0026gt;Market Reports\u0026lt;/a\u0026gt;';\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e?\u003c/p\u003e","accepted_answer_id":"17125371","answer_count":"2","comment_count":"9","creation_date":"2013-06-15 15:28:59.223 UTC","last_activity_date":"2013-06-15 22:04:33.777 UTC","last_edit_date":"2013-06-15 15:36:00.7 UTC","last_editor_display_name":"","last_editor_user_id":"2276514","owner_display_name":"","owner_user_id":"2276514","post_type_id":"1","score":"-2","tags":"php","view_count":"80"} +{"id":"24656146","title":"Creating App Package through Command Line in WinRT","body":"\u003cp\u003eHow can I create, WinRT App package through command line. What i am trying to achieve is, By executing a .BAT file i need to build and create app package of my windows 8 application(.sln). I build the source code using msbuild command. But i don't know how to create app package using command. Anyone please help \u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-07-09 14:15:56.973 UTC","last_activity_date":"2014-07-17 14:45:59.153 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"958941","post_type_id":"1","score":"1","tags":"batch-file|command-line|windows-8|windows-runtime","view_count":"194"} +{"id":"38765432","title":"How to connect flash[:notice] in ruby module?","body":"\u003cp\u003eI have module mangopay_helper.rb\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emodule MangoPayHelper\n\n def transfer_to_contractor(contract, client, contractor) \n amount = contract.amount * 0,1.to_i\n begin\n MangoPay::Transfer.create({\n Tag: \"#{contract.id} + #{contract.title}\",\n AuthorId: client.mangopay_id,\n DebitedFunds: {Currency: \"EUR\", Amount: contract.amount},\n Fees: { Currency: 'EUR', Amount: amount},\n DebitedWalletId: client.wallet_id,\n CreditedWalletId: contractor.wallet_id\n })\n rescue MangoPay::ResponseError =\u0026gt; e \n flash[:notice] = \" Code: #{ e['Code'] } Message: #{ e['Message'] }\"\n end \n end\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn action of controller I call \u003ccode\u003eMangoPayHelper.transfer_to_contractor\u003c/code\u003e . \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eError: undefined local variable or method `flash' for MangoPayHelper:Module\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow can I connect flash in ruby module?\u003c/p\u003e","accepted_answer_id":"38767797","answer_count":"2","comment_count":"3","creation_date":"2016-08-04 10:56:38.3 UTC","last_activity_date":"2016-08-04 12:48:18.643 UTC","last_edit_date":"2016-08-04 11:56:08.557 UTC","last_editor_display_name":"","last_editor_user_id":"4029561","owner_display_name":"","owner_user_id":"784880","post_type_id":"1","score":"-1","tags":"ruby-on-rails|ruby","view_count":"41"} +{"id":"41387753","title":"Cannot load hidden content in div on click of image","body":"\u003chr\u003e\n\n\u003cp\u003eI'm trying to hide content until clicked on the image and load the content related to that image.\u003c/p\u003e\n\n\u003cp\u003eMy code looks like so:\u003c/p\u003e\n\n\u003cp\u003ehtml:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"projects\"\u0026gt;\n \u0026lt;h2\u0026gt;Newest Projects\u0026lt;/h2\u0026gt;\n \u0026lt;p\u0026gt;Here are some of my newest works.\u0026lt;/p\u0026gt;\n \u0026lt;div class=\"project-image\"\u0026gt;\n \u0026lt;div class=\"overlay\"\u0026gt;\n \u0026lt;p\u0026gt;\u0026amp;Design\u0026lt;/p\u0026gt;\n \u0026lt;p\u0026gt;Development\u0026lt;/p\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;img src=\"images/anddesignedit.png\" data-id=\"design\"\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"project-image\"\u0026gt;\n \u0026lt;div class=\"overlay\"\u0026gt;\n \u0026lt;p\u0026gt;Roberts Landscaping\u0026lt;/p\u0026gt;\n \u0026lt;p\u0026gt;Design and Development\u0026lt;/p\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;img src=\"images/landscapinglogo.png\" data-id=\"landscaping\"\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"project-image\"\u0026gt;\n \u0026lt;div class=\"overlay\"\u0026gt;\n \u0026lt;p\u0026gt;Cuda\u0026lt;/p\u0026gt;\n \u0026lt;p\u0026gt;Development\u0026lt;/p\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;img src=\"images/cudalogo.png\" data-id=\"cuda\"\u0026gt;\n \u0026lt;/div\u0026gt;\n\n \u0026lt;div class=\"clicked-content\"\u0026gt;\n \u0026lt;div id=\"design\" class=\"hideDivs\"\u0026gt;\n \u0026lt;h3\u0026gt;\u0026amp;Design\u0026lt;/h3\u0026gt;\n \u0026lt;p\u0026gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent hendrerit elit vitae luctus gravida. Duis nisl urna, egestas id lectus quis, suscipit sagittis ante. Aenean sed massa magna. Nunc et bibendum nibh. Morbi ut eros diam. Donec quam ipsum, imperdiet ultricies tristique at, gravida finibus erat. Integer laoreet volutpat sagittis. Donec pretium, lacus a ullamcorper dapibus, massa neque fermentum augue, eget convallis tortor orci nec nisl\u0026lt;/p\u0026gt;\n \u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003c/p\u003e\n\n\u003cp\u003escript code looks like so:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e $(\"img\").on('click',function(){\n var hello = $(this).attr('data-id');\n $('.hideDivs').hide();\n $('#'+hello).show();\n }); \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI do have a .hideDiv class in my css as display: none.\u003c/p\u003e\n\n\u003cp\u003eHelp please!\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDITED:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eSo i've tried both of the ways commented so far but they don't seem to be working for me. Could it perhaps be because I have an overlay on the image? I've tried targeting the actual div element instead however, I still can't get it to load the content.\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2016-12-29 21:57:55.35 UTC","last_activity_date":"2016-12-29 22:50:11.69 UTC","last_edit_date":"2016-12-29 22:50:11.69 UTC","last_editor_display_name":"","last_editor_user_id":"6054764","owner_display_name":"","owner_user_id":"6054764","post_type_id":"1","score":"0","tags":"jquery|css|hide|hidden","view_count":"25"} +{"id":"36949796","title":"Type Incompatibility","body":"\u003cp\u003eI'm trying to create a method that returns the mode of an array (I'm not asking how to make the method and would rather you not give me any ideas. For those of you who keep criticizing my questions for being repeats of others, I know that the answer is already on this website. That's not the question). I made a method, in a class called BasicMathMethods, called getTotal:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic static int getTotal(double[] a, int b)\n{\n int count = 0;\n int Element;\n for(Element = 0; Element \u0026lt; a.length; Element++)\n {\n if(a[b] == a[Element])\n {\n count++;\n }\n }\n return count;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd I tried to use this method in my mode method:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public static double Mode(double[] a)\n{\n for(int element = 0; element \u0026lt; a.length; element++)\n {\n int[] largest = BasicMathMethods.getTotal(a, element);// gets the count of each element\n Arrays.sort(largest);\n if(BasicMathMethods.getTotal(a, element) == largest.length)\n return a[element];\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, my compiler (which is Blue J by the way) says \"Incompatible types: int cannot be converted to int[]\", and highlights (a, element). I don't understand the error. I don't see where I am trying to convert int[] to int. Could anyone tell me what the error is and explain?\u003c/p\u003e","accepted_answer_id":"36949914","answer_count":"2","comment_count":"5","creation_date":"2016-04-30 01:39:53.05 UTC","last_activity_date":"2016-04-30 02:01:34.61 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6031385","post_type_id":"1","score":"-3","tags":"java","view_count":"30"} +{"id":"8415167","title":"Seeking solution for locating value between worksheets in unknown column","body":"\u003cp\u003eI'm looking for an elegant solution to a formula for the following criteria:\u003c/p\u003e\n\n\u003cp\u003e\u003cem\u003eLocation: Sheet2, ColumnB (row 2 onwards, the formula will be dragged down)\u003c/em\u003e\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003ehighlight/ select value in ColumnA, same row \u003c/li\u003e\n\u003cli\u003esearch for selected value in Sheet1, ColumnA\u003c/li\u003e\n\u003cli\u003ereturn the value in Column(?), same row as the selected value was located in ColumnA, Sheet1\u003c/li\u003e\n\u003cli\u003eIf no value is found, return 0 (zero)\u003c/li\u003e\n\u003cli\u003e(?) can be determined by matching the value in B$1 (Sheet2, fixed value), with a value somewhere in rowK in Sheet1\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eThe following is a code that does the job, but I think it's quite inefficient, especially as this code is being used across thousands of cells. It is also difficult for my less-experienced collegaue to follow (this code is taken from cell B5 in Sheet2):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e=IF(ISNA\n (INDEX\n ('Sheet1'!$A:$HZ,\n MATCH($A5),'Sheet1'!$A:$A,0),\n MATCH(B$1,'Sheet1'!$22:$22,0))\n )\n ,,\n (INDEX\n ('Sheet1'!$A:$HZ,\n MATCH($A5),'Sheet1'!$A:$A,0),\n MATCH(B$1,'Sheet1'!$22:$22,0))\n )\n )\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAs always, any help would be much appreciated.\u003c/p\u003e\n\n\u003cp\u003eRegards,\nChris\u003c/p\u003e","accepted_answer_id":"8533667","answer_count":"2","comment_count":"2","creation_date":"2011-12-07 12:15:07.577 UTC","last_activity_date":"2011-12-16 11:41:04.807 UTC","last_edit_date":"2011-12-07 13:20:42.893 UTC","last_editor_display_name":"","last_editor_user_id":"1083815","owner_display_name":"","owner_user_id":"1083815","post_type_id":"1","score":"0","tags":"excel|excel-formula","view_count":"203"} +{"id":"33017295","title":"SMTP Script for Google Mail","body":"\u003cp\u003eI have got the below script from this \u003ca href=\"http://www.andrehonsberg.com/article/php-command-line-smtp-email-sender-for-gmail-using-pear\" rel=\"nofollow\"\u003elink\u003c/a\u003e. My Website is running with Digital Ocean hosting and I am unable to send a mail. \nCan you please help me out to work. Also, How do I get to know \nthe actual mail failure ?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#!/usr/bin/php\n\u0026lt;?php\n\nif (PHP_SAPI !== 'cli') exit;\nif (count($argv) \u0026lt; 4) {\n echo 'Usage: ' . basename($_SERVER['PHP_SELF']) . ' \u0026lt;recipient1#recipient2#...\u0026gt; \"\u0026lt;subject\u0026gt;\" \u0026lt;\"msg\" or file\u0026gt;'.\"\\n\";\n exit;\n}\n\nrequire_once \"Mail.php\";\n\n$from = \"xxx@gmail.com\";\n$aRecipients = (strpos($argv[1], '#')) ? explode('#', $argv[1]) : array($argv[1]);\n$to = '';\nforeach ($aRecipients as $recipient) $to .= \"{$recipient},\";\n$to = rtrim($to, ',');\n$subject = $argv[2];\n$body = '';\nif (file_exists($argv[3])) {\n echo \"[+] Delivering file {$argv[3]} to {$to}\\n\";\n $body = file_get_contents($argv[3]); \n} else {\n $length = strlen($argv[3]);\n echo \"[+] Delivering text with length of {$length} to {$to}\\n\";\n $body = \"{$argv[3]}\";\n}\n\n$host = gethostbyname('smtp.gmail.com'); \n$port = 465; \n$username = \"xxxx@gmail.com\";\n$password = \"xxx\";\n\n$headers = array(\n 'From' =\u0026gt; $from,\n 'To' =\u0026gt; $to,\n 'Subject' =\u0026gt; $subject\n);\n\n$smtp =\u0026amp; Mail::factory('smtp',\n array(\n 'host' =\u0026gt; $host,\n 'port' =\u0026gt; $port,\n 'debug' =\u0026gt; true, // set to true if u want to see what happens in the background\n 'auth' =\u0026gt; true,\n 'username' =\u0026gt; $username,\n 'password' =\u0026gt; $password\n )\n);\n\n$smtp-\u0026gt;send($to, $headers, $body);\necho \"[+] Mail sent :)\\n\";\n\n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"6","creation_date":"2015-10-08 13:29:26.26 UTC","last_activity_date":"2015-10-08 13:38:05.65 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1764882","post_type_id":"1","score":"0","tags":"php|wordpress|email|smtp|gmail","view_count":"178"} +{"id":"31234196","title":"How to highlight a div when a fullcalendar event is dragged to it?","body":"\u003cp\u003eI am working with the \u003ca href=\"https://bootstraphunter.com/smartadmin-product.php\" rel=\"nofollow\"\u003eSmart Admin Theme\u003c/a\u003e and I have installed a trash icon in the Theme's calender.\u003c/p\u003e\n\n\u003cp\u003eCSS:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e.fc-view\n{\n width: 100%;\n overflow: visible;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHTML:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"well well-sm\" id=\"deleteEventsDiv\"\u0026gt;\n \u0026lt;legend\u0026gt;\n Delete Events\n \u0026lt;/legend\u0026gt;\n \u0026lt;img src=\"/img/avatars/cal-trash.png\"\u0026gt;\n \u0026lt;div class=\"note\"\u0026gt;\n \u0026lt;strong\u0026gt;Note:\u0026lt;/strong\u0026gt; Drag and drop events here to delete them\n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eJavascript (eventDragStop method from fullcalendar itself):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eeventDragStop: function( event, jsEvent, ui, view, removeEvents ) {\n // This condition makes it easier to test if the event is over the trash can using Jquery\n if($('div#deleteEventsDiv').is(':hover')){\n // Confirmation popup\n $.SmartMessageBox({\n title : \"Delete Event?\",\n content : 'Are you sure you want to remove this event from the calender?',\n buttons : '[No][Yes]'\n }, function(ButtonPressed) {\n if (ButtonPressed === \"Yes\") {\n\n // You can change the URL and other details to your liking.\n // On success a small box notification will fire\n $.ajax({\n url: '/events/' + event.id,\n type: 'DELETE',\n success: function(request) {\n $.smallBox({\n title : \"Deleting Event\",\n content : \"Event Deleted\",\n color : \"#659265\",\n iconSmall : \"fa fa-check fa-2x fadeInRight animated\",\n timeout : 4000\n });\n $('#calendar').fullCalendar('removeEvents', event.id);\n }\n });\n }\n });\n }\n},\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is working fine. When a user hovers over the trash can div on the event of drag stop, a confirmation popup comes up and the ajax call is fired on 'Yes'.\u003c/p\u003e\n\n\u003cp\u003eNow I want to highlight the div when the mouse is over with the event. So I used the \u003ccode\u003eeventDragStart\u003c/code\u003e method like so:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eeventDragStart: function( event, jsEvent, ui, view ) {\n $('div#deleteEventsDiv').mouseover(function(e){\n $(this).css({'background-color': '#A90329'});\n\n $('div#deleteEventsDiv').mouseout(function(){\n $(this).css({'background-color': 'white'});\n });\n });\n},\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut whenever I hover the event on the div it turns red for just a fraction of a second before it turns back white. Why is this happening? And how do I correct this?\u003c/p\u003e\n\n\u003cp\u003eIf I remove the \u003ccode\u003emouseout\u003c/code\u003e callback, it turns red fine. What is the way around this?\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2015-07-05 19:29:14.997 UTC","last_activity_date":"2015-07-05 19:29:14.997 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2730064","post_type_id":"1","score":"1","tags":"javascript|jquery|html|css|fullcalendar","view_count":"533"} +{"id":"33569130","title":"Hive: Not in subquery join","body":"\u003cp\u003eI'm looking for a way to select all values from one table which do no exits in other table. This needs to be done on two variables, not one.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eselect * from tb1 \nwhere tb1.id1 not in (select id1 from tb2) \nand tb1.id2 not in (select id2 from tb2)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI cannot use subquery. It needs to be done using joins only.\u003c/p\u003e\n\n\u003cp\u003eI tried this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eselect * from tb1 full join tb2 on\ntb1.id1=tb2.id1 and tb1.id2=tb2.id2\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis works fine with one variable in condition, but not two. \nPlease suggest some resolution.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-11-06 14:33:20.757 UTC","last_activity_date":"2015-11-06 16:02:58.953 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5533873","post_type_id":"1","score":"0","tags":"join|hive|subquery","view_count":"63"} +{"id":"42713637","title":"How to filter an array of objects using AngularJS?","body":"\u003cp\u003e\u003cstrong\u003eBackground\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI've been teaching myself AngularJS this past week. I created a basic application that gets Twitch data for each Twitch channel and creates an array of \"channel\" objects that holds the following properties; name, logo url, streaming (yes or no), and channel url. So far I've used Angular to print each channel object by its properties to a table using the ng-repeat directive (love that feature). \u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eProblem/ Question\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI want to be able to sort the list of objects in the table whenever a user clicks the online and offline buttons thus filtering the channels by its \"streaming\" property. Unfortunately, I can't seem to figure out how to filter the channels by its property. Can anyone help? \u003c/p\u003e\n\n\u003cp\u003eHTML\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;div ng-controller=\"MainController\" \u0026gt;\n \u0026lt;div class=\"container\" id=\"test\"\u0026gt;\n \u0026lt;div class=\"row\"\u0026gt;\n \u0026lt;header\u0026gt;\n \u0026lt;ul id=\"mainMenu\"\u0026gt;\n \u0026lt;li class=\"activeMenu\" ng-click=\"filterGo('streaming')\"\u0026gt;All\u0026lt;/li\u0026gt;\n \u0026lt;li ng-click=\"filterGo('streaming')\"\u0026gt;Online\u0026lt;/li\u0026gt;\n \u0026lt;li ng-click=\"filterGo('streaming')\"\u0026gt;Offline\u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n \u0026lt;/header\u0026gt;\n \u0026lt;div class=\"center-block\" \u0026gt;\n \u0026lt;table class=\"table table-hover\" \u0026gt;\n \u0026lt;thead\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;th class=\"text-center\"\u0026gt;Logo\u0026lt;/th\u0026gt;\n \u0026lt;th class=\"text-center\"\u0026gt;Channel\u0026lt;/th\u0026gt;\n \u0026lt;th class=\"text-center\"\u0026gt;Online\u0026lt;/th\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;/thead\u0026gt;\n \u0026lt;tbody\u0026gt;\n \u0026lt;tr ng-repeat=\"channel in twitchChannels | filter:filtered\" ng-click=\"setSelected();\"\u0026gt;\n \u0026lt;td \u0026gt;\u0026lt;img id=\"size\" ng-src=\"{{ channel.logo }}\"\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;td \u0026gt;{{ channel.user }}\u0026lt;/td\u0026gt;\n \u0026lt;td \u0026gt;{{ channel.streaming }}\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;/tbody\u0026gt;\n \u0026lt;/table\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eJS\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar arr = [\"ESL_SC2\", \"OgamingSC2\", \"cretetion\", \"freecodecamp\", \"habathcx\", \"RobotCaleb\", \"noobs2ninjas\"];\nvar channels = [];\nvar count = 0;\nvar online = \"\";\n\n// channel object \nfunction Channel(user, name, logo, streaming) {\n this.user = user;\n this.name = name;\n this.logo = logo;\n this.streaming = streaming;\n this.url = \"https://www.twitch.tv/\" + this.name;\n}\n\nvar app = angular.module('myApp', []);\n\n\napp.controller('MainController', function($scope, $http, $window) { \n // loops through array of channels \n for (var i = 0; i \u0026lt; arr.length; i++) {\n\n (function(i) { \n\n $http.get(\"https://wind-bow.gomix.me/twitch-api/users/\" + arr[i]).success(function(data) {\n\n var channel = data.display_name;\n var name = data.name;\n var logo = data.logo;\n\n $http.get(\"https://wind-bow.gomix.me/twitch-api/streams/\" + arr[i]).success(function(json) {\n var streaming = (json.stream === null) ? false : true;\n if(streaming) {\n online = \"YES\";\n channels[count] = new Channel(channel, name, logo, online);\n } else {\n online = \"NO\";\n channels[count] = new Channel(channel, name, logo, online);\n }\n count++;\n });\n });\n })(i);\n }\n\n $scope.twitchChannels = channels;\n\n // if channel row is clicked take user to url \n $scope.setSelected = function() {\n $scope.selected = this.channel.url;\n $window.open($scope.selected);\n };\n\n // Need help here! \n $scope.filterGo = function(x) { \n $scope.filtered = x;\n }\n\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is the a link for reference:\u003ca href=\"http://codepen.io/bryanpleblanc/pen/jBBmgN\" rel=\"nofollow noreferrer\"\u003ehttp://codepen.io/bryanpleblanc/pen/jBBmgN\u003c/a\u003e \u003c/p\u003e","answer_count":"2","comment_count":"2","creation_date":"2017-03-10 08:28:17.543 UTC","last_activity_date":"2017-03-10 08:44:11.167 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7688814","post_type_id":"1","score":"1","tags":"javascript|html|angularjs","view_count":"54"} +{"id":"40171725","title":"INFORMIX: UPDATE with ALIAS?","body":"\u003cpre\u003e\u003ccode\u003eupdate prpcopycoins a set a.comtype=(\n select b.comtype from prpcopycoins b where b.policyno=a.policyno and b.serialno=a.serialno and b.applyno[1]='E')\nwhere a.applyno in ('1461F00001', '1461F00002');\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm trying to update several rows of table \u003ccode\u003eprpcopycoins\u003c/code\u003e with values from other rows of the same table. The above code got a syntax error because of the alias represented. How to correct it?\u003c/p\u003e\n\n\u003cp\u003eI'm using 'IBM Informix Dynamic Server Version 11.50.FC8W4'.\u003c/p\u003e","accepted_answer_id":"40175320","answer_count":"1","comment_count":"0","creation_date":"2016-10-21 08:23:57.027 UTC","favorite_count":"1","last_activity_date":"2016-10-21 17:24:36.147 UTC","last_edit_date":"2016-10-21 17:24:36.147 UTC","last_editor_display_name":"","last_editor_user_id":"15168","owner_display_name":"","owner_user_id":"6944177","post_type_id":"1","score":"1","tags":"sql|alias|informix","view_count":"59"} +{"id":"35659359","title":"R creating a new column for a dataframe based on existing column using R","body":"\u003cp\u003ei am working with R and here is my dataframe\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eDied.At \u0026lt;- c(22,40,72,41)\nWriter.At \u0026lt;- c(16, 18, 36, 36)\nFirst.Name \u0026lt;- c(\"John\", \"John\", \"Walt\", \"Walt\")\nSecond.Name \u0026lt;- c(\"Doe\", \"Poe\", \"Whitman\", \"Austen\")\nSex \u0026lt;- c(\"MALE\", \"MALE\", \"MALE\", \"MALE\")\n\nwriters_df \u0026lt;- data.frame(Died.At, Writer.At, First.Name, Second.Name, Sex)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ei want to add a new column called id according to the name, so john and walt in this case, i know i can easily do this by \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eid\u0026lt;-c(\"1\",\"1\",\"2\",\"2\")\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut i have a large data set to deal with , also, the name will not appear again afterwards, so there will not be anymore john after walt, can anyone help me with this please\u003c/p\u003e","accepted_answer_id":"35659414","answer_count":"1","comment_count":"0","creation_date":"2016-02-26 18:44:10.363 UTC","last_activity_date":"2016-02-26 18:51:38.967 UTC","last_edit_date":"2016-02-26 18:47:48.95 UTC","last_editor_display_name":"","last_editor_user_id":"5843051","owner_display_name":"","owner_user_id":"5843051","post_type_id":"1","score":"1","tags":"r","view_count":"84"} +{"id":"3406839","title":"Running a standalone Hadoop application on multiple CPU cores","body":"\u003cp\u003eMy team built a Java application using the Hadoop libraries to transform a bunch of input files into useful output.\nGiven the current load a single multicore server will do fine for the coming year or so. We do not (yet) have the need to go for a multiserver Hadoop cluster, yet we chose to start this project \"being prepared\".\u003c/p\u003e\n\n\u003cp\u003eWhen I run this app on the command-line (or in eclipse or netbeans) I have not yet been able to convince it to use more that one map and/or reduce thread at a time.\nGiven the fact that the tool is very CPU intensive this \"single threadedness\" is my current bottleneck.\u003c/p\u003e\n\n\u003cp\u003eWhen running it in the netbeans profiler I do see that the app starts several threads for various purposes, but only a single map/reduce is running at the same moment.\u003c/p\u003e\n\n\u003cp\u003eThe input data consists of several input files so Hadoop should at least be able to run 1 thread per input file at the same time for the map phase.\u003c/p\u003e\n\n\u003cp\u003eWhat do I do to at least have 2 or even 4 active threads running (which should be possible for most of the processing time of this application)?\u003c/p\u003e\n\n\u003cp\u003eI'm expecting this to be something very silly that I've overlooked.\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003eI just found this: \u003ca href=\"https://issues.apache.org/jira/browse/MAPREDUCE-1367\" rel=\"nofollow noreferrer\"\u003ehttps://issues.apache.org/jira/browse/MAPREDUCE-1367\u003c/a\u003e \nThis implements the feature I was looking for in Hadoop 0.21\nIt introduces the flag mapreduce.local.map.tasks.maximum to control it.\u003c/p\u003e\n\n\u003cp\u003eFor now I've also found the solution described \u003ca href=\"https://stackoverflow.com/questions/3546025/is-it-possible-to-run-hadoop-in-pseudo-distributed-operation-without-hdfs\"\u003ehere in this question\u003c/a\u003e. \u003c/p\u003e","accepted_answer_id":"3408928","answer_count":"4","comment_count":"0","creation_date":"2010-08-04 15:02:15.2 UTC","favorite_count":"2","last_activity_date":"2012-05-09 07:17:00.253 UTC","last_edit_date":"2017-05-23 11:53:51.473 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"114196","post_type_id":"1","score":"7","tags":"java|multithreading|command-line|hadoop|mapreduce","view_count":"7256"} +{"id":"8112867","title":"How to compile Scala source code into .Net","body":"\u003cp\u003eI create a scala source file \u003ccode\u003etest.scala\u003c/code\u003e: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e// the source code in test.scala\nimport System.Console\nobject TestMain extends Application {\n override def main(args: Array[String]) = {\n Console.WriteLine(\"Hello .NET World!\")\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNot that I import the \u003ccode\u003eSystem.Console\u003c/code\u003e which is from the .Net library.\u003c/p\u003e\n\n\u003cp\u003eBefore compiling, I download a \u003ccode\u003escala-msil\u003c/code\u003e package from \u003ca href=\"http://www.scala-lang.org/downloads/packages/scala-msil-2.8.1.final.sbp\" rel=\"nofollow noreferrer\"\u003ehttp://www.scala-lang.org/downloads/packages/scala-msil-2.8.1.final.sbp\u003c/a\u003e and then install it by \u003ccode\u003esbaz install -f scala-msil-2.8.1.final.sbp\u003c/code\u003e. \u003c/p\u003e\n\n\u003cp\u003eAfter that, some scripts, such as \u003ccode\u003escalac-net.bat\u003c/code\u003e used to compile *.scala to *.msil, is created in %SCALA_HOME%\\bin and dlls, such as \u003ccode\u003emicrolib.dll\u003c/code\u003e, \u003ccode\u003epredef.dll\u003c/code\u003e and \u003ccode\u003escalaruntime.dll\u003c/code\u003e, in %SCALA_HOME%. Unfortunately I got the error when \u003ccode\u003escalac-net test.scala\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/jYaMZ.jpg\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eCan anyone give me a suggestion ??\u003c/p\u003e\n\n\u003cp\u003ePS: My scala version is 2.8.1\u003c/p\u003e","accepted_answer_id":"8126950","answer_count":"1","comment_count":"0","creation_date":"2011-11-13 16:17:20.703 UTC","last_activity_date":"2011-11-14 19:28:52.07 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"351545","post_type_id":"1","score":"3","tags":".net|scala|compiler-construction","view_count":"602"} +{"id":"43346105","title":"Trigger compiled but on firing gets ORA-01722 error","body":"\u003cpre\u003e\u003ccode\u003eCREATE OR REPLACE TRIGGER ABC_TEST_TRIG \nBEFORE UPDATE ON ABC_TEST \nFOR EACH ROW \nDECLARE\nNAME_CH VARCHAR2(25);\nNUM_CH NUMBER(5);\nBEGIN \n--SELECT NAME,NUM INTO NAME_CH, NUM_CH FROM ABC_TEST WHERE NAME ='KUNAL';\n\n INSERT INTO ABC_NEW (NEW_NAME,OLD_NAME,NEW_NUM,OLD_NUM)\n VALUES(':NEW.NEW_NAME',':OLD.NAME',':NEW.NEW_NUM',':OLD.NUM') ;\nEND; \n/\n\nUPDATE ABC_TEST SET NAME ='KUSH' , NUM=90 WHERE NAME = 'KUNAL';\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eerror:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eUPDATE ABC_TEST SET NAME ='KUSH' , NUM=90 WHERE NAME = 'KUNAL'\nError report -\nSQL Error: ORA-01722: invalid number\nORA-06512: at \"APPSREAD.ABC_TEST_TRIG\", line 7\nORA-04088: error during execution of trigger 'APPSREAD.ABC_TEST_TRIG'\n01722. 00000 - \"invalid number\"\n*Cause: The specified number was invalid.\n*Action: Specify a valid number.\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-04-11 12:35:45.483 UTC","last_activity_date":"2017-04-11 12:46:45.86 UTC","last_edit_date":"2017-04-11 12:46:45.86 UTC","last_editor_display_name":"","last_editor_user_id":"266304","owner_display_name":"","owner_user_id":"7850686","post_type_id":"1","score":"-1","tags":"oracle|triggers","view_count":"43"} +{"id":"16837107","title":"$ rails db fails with error, but database is working fine","body":"\u003cp\u003eMy Rails 3.2 app is using a PostgreSQL database. It's working great locally. I can migrate and interact with the application through the browser or irb.\u003c/p\u003e\n\n\u003cp\u003eHowever when I run \u003ccode\u003e$ rails db\u003c/code\u003e, I get an error: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epsql: could not connect to server: No such file or directory\n Is the server running locally and accepting\n connections on Unix domain socket \"/tmp/.s.PGSQL.5432\"?\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy Postgres socket is actually located at: \u003ccode\u003e/var/pgsql_socket/.s.PGSQL.5432\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eSo how can I tell rails to look for it there when I use \u003ccode\u003e$ rails db\u003c/code\u003e\u003c/p\u003e","answer_count":"0","comment_count":"5","creation_date":"2013-05-30 13:09:11.78 UTC","favorite_count":"1","last_activity_date":"2013-06-17 08:47:02.21 UTC","last_edit_date":"2013-06-17 08:47:02.21 UTC","last_editor_display_name":"","last_editor_user_id":"1599619","owner_display_name":"","owner_user_id":"138601","post_type_id":"1","score":"0","tags":"ruby-on-rails|ruby|ruby-on-rails-3|sockets|rails-postgresql","view_count":"77"} +{"id":"39233253","title":"Why isn't the document with an exact match the first result in a Retrieve and Rank Solr query?","body":"\u003cp\u003eWe have taken a large quantity of documents, broken them up into segments (\"answer units\") using Watson's \u003cem\u003eDocument Conversion\u003c/em\u003e service, and added them to a Retrieve and Rank Solr collection. If I run a query against the collection using a copy/paste of text (maybe 150 words) from one of the answer units, Retrieve and Rank will return a bunch of documents, and (as expected) the results include the answer unit from which the query text was copied.\nHowever, that answer unit is not the very top result; it is usually 7 or 8 documents from the top. If I surround the query text with quotes, then Solr rightfully considers that a phrase and returns only that single answer unit.\nWithout the quotes though, shouldn't the document with the exact wording in the query still be the top document in the results?\u003c/p\u003e","accepted_answer_id":"39252843","answer_count":"1","comment_count":"1","creation_date":"2016-08-30 17:03:52.893 UTC","last_activity_date":"2016-09-02 04:39:58 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5074657","post_type_id":"1","score":"0","tags":"solr|ibm-watson-cognitive|retrieve-and-rank","view_count":"103"} +{"id":"17738802","title":"how to deploy Jsp Project In tomcat server","body":"\u003cp\u003eI have Successfuly Deploy my Jsp Project On Tomcat Server in Windows . But when i send my Project to main server (we don't have Full access of Client Tomcat server They Gave me FTP for send ) so Using File Zila i am sending My Project to client server then file deployed But only client side code run please check this [\u003ca href=\"http://www.incometaxindiapr.gov.in/incometaxindiacr/cbdt-cir-not/Home.jsp\" rel=\"nofollow\"\u003ehttp://www.incometaxindiapr.gov.in/incometaxindiacr/cbdt-cir-not/Home.jsp\u003c/a\u003e ] when i try to serch any thing from serch Box then Project gives org.apache.jasper.JasperException: Unable to compile class for JSP: Exception . please help me. \u003c/p\u003e\n\n\u003cp\u003eNOTE: CLIENT have Linux server in that install Tomcat Server . \u003c/p\u003e","answer_count":"1","comment_count":"9","creation_date":"2013-07-19 05:37:59.527 UTC","last_activity_date":"2013-07-19 06:06:30.84 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2598161","post_type_id":"1","score":"-1","tags":"java|jsp|tomcat","view_count":"1116"} +{"id":"13523095","title":"magento add multiple products to cart from wishlist through check box","body":"\u003cp\u003e\u003cstrong\u003eScenario:\u003c/strong\u003e\u003cbr\u003e Want to add multiple products to cart from wishlist through check box, such that the selected products along with their quantity are transferred to cart and the selected items are removed from the wishlist table.\u003cbr\u003e\nReferred many blogs.\u003cbr\u003e\nI tried to implement it by (applying) adding related-products javascript (logic).\u003cbr\u003eBut still not getting.\u003cbr\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003e[updated]\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eThis is the checkbox column (time being hard code)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;input type=\"checkbox\" class=\"checkbox related-checkbox\" id=\"related-checkbox7\" name=\"related_products[]\" value=\"7\"\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAdded Javascript for this part:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;script type=\"text/javascript\"\u0026gt;\n //\u0026lt;![CDATA[\n $$('.related-checkbox').each(function(elem){\n Event.observe(elem, 'click', addRelatedToProduct)\n });\n\n var relatedProductsCheckFlag = false;\n function selectAllRelated(txt){\n if (relatedProductsCheckFlag == false) {\n $$('.related-checkbox').each(function(elem){\n elem.checked = true;\n });\n relatedProductsCheckFlag = true;\n txt.innerHTML=\"unselect all\";\n } else {\n $$('.related-checkbox').each(function(elem){\n elem.checked = false;\n });\n relatedProductsCheckFlag = false;\n txt.innerHTML=\"select all\";\n }\n addRelatedToProduct();\n }\n\n function addRelatedToProduct(){\n var checkboxes = $$('.related-checkbox');\n var values = [];\n for(var i=0;i\u0026lt;checkboxes.length;i++){\n if(checkboxes[i].checked) values.push(checkboxes[i].value);\n }\n if($('related-products-field')){\n $('related-products-field').value = values.join(',');\n }\n }\n //]]\u0026gt;\n \u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eAdd to cart\u003c/strong\u003e\u003cbr\u003e \u003ccode\u003e\u0026lt;button type=\"button\" title=\"Add to Cart\" class=\"button btn-cart\" onclick=\"productAddToCartForm.submit(this)\"\u0026gt;\u0026lt;span\u0026gt;\u0026lt;span\u0026gt;Add to Cart\u0026lt;/span\u0026gt;\u0026lt;/span\u0026gt;\u0026lt;/button\u0026gt;\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eAnd javascript for this part:\u003cbr\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;script type=\"text/javascript\"\u0026gt;\n //\u0026lt;![CDATA[\n var productAddToCartForm = new VarienForm('product_addtocart_form');\n productAddToCartForm.submit = function(button, url) {\n if (this.validator.validate()) {\n var form = this.form;\n var oldUrl = form.action;\n\n if (url) {\n form.action = url;\n }\n var e = null;\n try {\n this.form.submit();\n } catch (e) {\n }\n this.form.action = oldUrl;\n if (e) {\n throw e;\n }\n\n if (button \u0026amp;\u0026amp; button != 'undefined') {\n button.disabled = true;\n }\n }\n }.bind(productAddToCartForm);\n\n productAddToCartForm.submitLight = function(button, url){\n if(this.validator) {\n var nv = Validation.methods;\n delete Validation.methods['required-entry'];\n delete Validation.methods['validate-one-required'];\n delete Validation.methods['validate-one-required-by-name'];\n // Remove custom datetime validators\n for (var methodName in Validation.methods) {\n if (methodName.match(/^validate-datetime-.*/i)) {\n delete Validation.methods[methodName];\n }\n }\n\n if (this.validator.validate()) {\n if (url) {\n this.form.action = url;\n }\n this.form.submit();\n }\n Object.extend(Validation.methods, nv);\n }\n }.bind(productAddToCartForm);\n //]]\u0026gt;\n \u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks in advance\u003c/p\u003e","accepted_answer_id":"13679169","answer_count":"1","comment_count":"2","creation_date":"2012-11-23 04:26:17.083 UTC","last_activity_date":"2014-04-10 11:51:16.67 UTC","last_edit_date":"2012-11-23 04:38:46.187 UTC","last_editor_display_name":"","last_editor_user_id":"1803011","owner_display_name":"","owner_user_id":"1803011","post_type_id":"1","score":"1","tags":"javascript|magento|cart","view_count":"4110"} +{"id":"9974255","title":"Logging in an application with different social networks","body":"\u003cp\u003eI am being approached by a client who (among other things) wants to implement social network login to his application in addition to his/her API, aiming at Facebook, twitter, and FourSquare. My client is setting up a web service.\u003c/p\u003e\n\n\u003cp\u003eIs there any 3rd party Library that will help for this? I know that for Facebook there exists the Facebook connect framework, but what about Twitter API and foursquare? Is there any decent iOS library for those? (for twitter, MGtwitterEngine seems a bit old, not having an update for over a year). I need to support iOS versions 4.3+, so Apple's twitter integration is not an option.\u003c/p\u003e\n\n\u003cp\u003eIn addition, the web server's native HTTP API is based on tokens (login with the valid credentials, receiving a token, and make further requests to the server using HTTP with the token as a parameter). Will he need to do some extra work for supporting tokens received from Facebook, twitter, or anything else apart from the token from his own service during the login process?\u003c/p\u003e\n\n\u003cp\u003eThank you in advance.\u003c/p\u003e","accepted_answer_id":"13540279","answer_count":"1","comment_count":"0","creation_date":"2012-04-02 09:53:32.173 UTC","last_activity_date":"2012-11-24 10:19:43.77 UTC","last_edit_date":"2012-04-02 09:55:22.533 UTC","last_editor_display_name":"","last_editor_user_id":"714965","owner_display_name":"","owner_user_id":"737457","post_type_id":"1","score":"0","tags":"ios|facebook|twitter|social","view_count":"297"} +{"id":"21314413","title":"Reuse a TcpClient in c#","body":"\u003cp\u003eWe have a device that accepts ascii messages over a wireless network, and then responds with a value and I have successfully implemented this in a Windows Forms 2010 solution in c#.\u003c/p\u003e\n\n\u003cp\u003eI wrote this as a test solution to prove the technology and the actual calls to the device will be made on a Motorola MC55 handheld device.\u003c/p\u003e\n\n\u003cp\u003eI have now written an additional test solution in Visual Studio 2008 and installed this onto a device, but the connection to the TcpClient takes around 30 seconds every time its called on the mobile device, where as on the windows solution it's almost instant.\u003c/p\u003e\n\n\u003cp\u003eThis is far too slow, so I have started looking at reusing the TcpClient, but not had any success and wondered if anyone else has had similar issues and to ask how they got around it, or if anyone can offer any advice on how to reuse a TcpClient so I don't have to create a new one every time I want to make my call.\u003c/p\u003e\n\n\u003cp\u003eThe code for the connection is shown below...\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public static string GetValueFromDevice(string deviceIPAddress, int devicePort, string messageSentToDevice)\n {\n string returnValue = \"\";\n\n try\n {\n TcpClient client = new TcpClient(deviceIPAddress, devicePort);\n\n byte[] inData = System.Text.Encoding.ASCII.GetBytes(messageSentToDevice);\n NetworkStream stream = client.GetStream();\n stream.Write(inData, 0, inData.Length);\n\n byte[] outData = new Byte[256];\n int bytes = stream.Read(outData, 0, outData.Length);\n returnValue = System.Text.Encoding.ASCII.GetString(outData, 0, bytes);\n\n stream.Close();\n client.Close();\n }\n catch (Exception ex)\n {\n returnValue = ex.Message;\n }\n\n return returnValue;\n }\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"21314497","answer_count":"2","comment_count":"0","creation_date":"2014-01-23 16:50:09.153 UTC","last_activity_date":"2014-01-24 09:35:55.843 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"564297","post_type_id":"1","score":"0","tags":"c#|performance|windows-mobile|tcpclient|reusability","view_count":"2014"} +{"id":"29139179","title":"AFNetworking: secure handshake no longer works after certificate renewal","body":"\u003cp\u003eMy app uses AFNetworking.\u003c/p\u003e\n\n\u003cp\u003eWhat type of certificate extension does AFNetworking look for?\nI was given a .crt file by GeoTrust but I have read \u003ca href=\"http://initwithfunk.com/blog/2014/03/12/afnetworking-ssl-pinning-with-self-signed-certificates/\" rel=\"nofollow noreferrer\"\u003ehere\u003c/a\u003e that AFNetworking specifically looks for .cer files. \u003c/p\u003e\n\n\u003cp\u003eI ask because my https in a browser works fine with my new certificate chain, and using a tool called SSLDetective I can see that the whole chain is trusted, but for some reason my app no longer accepts the bundle for a trusted handshake. Any other time I had issues, SSLDetective showed me that a part of the chain was not trusted. In this case, I can't seem to find anything wrong. Not much changed in my ssl certificate configuration other than overwriting the old key and crt files with the new files with the exact same name. Help is appreciated. Thanks!\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI now know for sure that AFNetworking does use and automatically detects .cer files in the app bundle. I also know that the certificate attached in the bundle must match the same public key as the certificate on my web server. With public key pinning, AFNetworking simply extracts the public key from the local certificate and compares it to the one on the server. If the one on the server matches, it uses the server's certificate.\u003c/p\u003e\n\n\u003cp\u003eIn my case, in the beginning, the keys did not match, but now I made sure that they do. The chain is still trusted and good according to SSLDetective. I downloaded a .cer version of the certificate from the server using SSLDetective and attached it to my app bundle. However, now that I know for sure the public keys match as well, I still can't seem to get a secure handshake. This question is somewhat related to the question asked \u003ca href=\"https://stackoverflow.com/questions/29156170/how-to-create-cer-file-for-afnetworking-to-be-used-in-ios-app-bundle\"\u003ehere\u003c/a\u003e.\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2015-03-19 07:29:48.1 UTC","last_activity_date":"2015-03-20 17:12:43.24 UTC","last_edit_date":"2017-05-23 12:22:07.887 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"4015994","post_type_id":"1","score":"1","tags":"ios|ssl|ssl-certificate|afnetworking","view_count":"108"} +{"id":"45649267","title":"Using Numpy arrays for looping","body":"\u003cp\u003eHow would one go about converting \u003ccode\u003ep = img.ptr\u0026lt;uchar\u0026gt;(row);\u003c/code\u003e which is written using OpenCV in C++, into OpenCV's Python bindings?\u003c/p\u003e\n\n\u003cp\u003eFrom what I understand, since images are represented as NumPy arrays in OpenCV Python - does this mean that it could be represented as \u003ccode\u003ep = img[row, 0, :]\u003c/code\u003e or perhaps \u003ccode\u003ep = img[row, 0]\u003c/code\u003e for a grayscale image?\u003c/p\u003e\n\n\u003cp\u003eThis construction of \u003ccode\u003ep\u003c/code\u003e is in a for loop, and it is in order to facilitate looping through every pixel row by row. \u003c/p\u003e\n\n\u003cp\u003eI tried a simple for loop to loop through every pixel in the image, but I also need to implement functionality such as blanking out a given row after looping through it. \u003c/p\u003e\n\n\u003cp\u003eIf I can understand what \u003ccode\u003ep\u003c/code\u003e would translate into in Python, I am confident it can be done easily. I looked at solutions that involved linking Python code with C++ files, but I am a beginner and want to keep things simple. \u003c/p\u003e\n\n\u003cp\u003eI was also considering using SKImage, would anyone recommend that library?\nThanks\u003c/p\u003e","answer_count":"0","comment_count":"4","creation_date":"2017-08-12 10:38:16.447 UTC","last_activity_date":"2017-08-13 11:32:26.05 UTC","last_edit_date":"2017-08-13 11:32:26.05 UTC","last_editor_display_name":"","last_editor_user_id":"4685767","owner_display_name":"","owner_user_id":"4685767","post_type_id":"1","score":"1","tags":"python|opencv|numpy|scikit-image","view_count":"46"} +{"id":"4570561","title":"Coercing a LINQ result list of KeyValuePair into a Dictionary - Missing the Concept","body":"\u003cp\u003eI wanted to write this LINQ statement:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eDictionary\u0026lt;int, ItemBO\u0026gt; result = ( Dictionary\u0026lt;int, ItemBO\u0026gt; )\n ( from item in originalResults where item.Value.SomeCriteria == true\n select item );\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003ccode\u003eoriginalResults\u003c/code\u003e is of type \u003ccode\u003eDictionary\u0026lt;int, ItemBO\u0026gt;\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eI get that \u003ccode\u003eitem\u003c/code\u003e is of type \u003ccode\u003eKeyValuePair\u0026lt;int, ItemBO\u0026gt;\u003c/code\u003e, but would have thought that the cast from a list of that type to a Dictionary of that type would have been... er... \"Natural\".\u003c/p\u003e\n\n\u003cp\u003eInstead, to get the compiler to shut up, I needed to write this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eDictionary\u0026lt;int, ItemBO\u0026gt; result = \n ( from item in originalResults where item.Value.SomeCriteria == true\n select item.Value ).ToDictionary( GetItemKey );\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhich, although not entirely counter-intuitive, suggests that a lot of unnecessary work unpackaging and repackaging the Dictionary is going on under the covers. Is there a better solution? Is there a concept I'm missing out on?\u003c/p\u003e","accepted_answer_id":"4570577","answer_count":"4","comment_count":"0","creation_date":"2010-12-31 14:18:41.06 UTC","favorite_count":"1","last_activity_date":"2010-12-31 14:46:53.8 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"35142","post_type_id":"1","score":"6","tags":"c#|linq|list|dictionary","view_count":"1037"} +{"id":"45259574","title":"Pairwise list modification in Haskell","body":"\u003cp\u003eI want to write a \u003ccode\u003emodifyList\u003c/code\u003e function which takes a list of data structures, modifies them using a function \u003ccode\u003emodify\u003c/code\u003e and return that modified list.\nThe problem I’m having is, that my \u003ccode\u003emodify\u003c/code\u003e function takes pairs of elements from a list and applies changes to both elements.\u003c/p\u003e\n\n\u003cp\u003eThis is my (simplified) code so far:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport qualified Data.Vector as V\nimport Data.List\n\ndata Structure = Structure{ factor :: Double\n , position :: V.Vector Double\n } deriving (Show)\n\n-- Calculates a factor with values from both structures\ncalculateFactor :: (Structure, Structure) -\u0026gt; Double\ncalculateFactor (p, q) = (factor p) + (factor q) -- This calculation is simplified \n\nmodify :: (Structure, Structure) -\u0026gt; (Structure, Structure)\nmodify (a, b) = ( a { position = V.map (+ structureFactor) (position a) }\n , b { position = V.map (subtract structureFactor) (position b) })\n where structureFactor = calculateFactor(a,b)\n\nmodifyList :: [Structure] -\u0026gt; [Structure]\nmodifyList l = [ ??? | (p, q) \u0026lt;- (map (modify) pairs)] -- What do I need to do here?\n where pairs = [(x, y) | (x:ys) \u0026lt;- tails l, y \u0026lt;- ys]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow can I make these modifications so that subsequent function calls can work with the updated values?\u003c/p\u003e\n\n\u003cp\u003eAs an example, I define some data like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ep = Structure 2 (V.replicate 3 1.0)\nq = Structure 3 (V.replicate 3 1.0)\nu = Structure 4 (V.replicate 3 1.0)\nlist = [p, q, u]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow \u003ccode\u003emodifyList list\u003c/code\u003e should call \u003ccode\u003emodify\u003c/code\u003e for each element pair in my list: \u003ccode\u003e(p, q) (p, u) (q, u)\u003c/code\u003e which gives me a result list of pairs:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[(Structure {factor = 2.0, position = [6.0,6.0,6.0]}, -- Modified p\n Structure {factor = 3.0, position = [-4.0,-4.0,-4.0]}), -- Modified q\n (Structure {factor = 2.0, position = [7.0,7.0,7.0]}, -- Also modified p\n Structure {factor = 4.0, position = [-5.0,-5.0,-5.0]}), -- Modified u\n (Structure {factor = 3.0, position = [8.0,8.0,8.0]}, -- Also q\n Structure {factor = 4.0, position = [-6.0,-6.0,-6.0]})] -- Also u\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut what I actually want to end up with is the same list with \u003ccode\u003e[p, q, u]\u003c/code\u003e where \u003ccode\u003ep\u003c/code\u003e has \u003ccode\u003eposition = [12.0, 12.0, 12.0]\u003c/code\u003e as if I had manually called \u003ccode\u003ep' = fst(modify (p, q))\u003c/code\u003e and then call \u003ccode\u003ep = fst(modify(p', u))\u003c/code\u003e to give the original \u003ccode\u003eposition p\u003c/code\u003e a \u003cem\u003enew\u003c/em\u003e value. Respectively \u003ccode\u003eq\u003c/code\u003e should have \u003ccode\u003eposition = [3.0, 3.0, 3.0]\u003c/code\u003e and \u003ccode\u003eu\u003c/code\u003e, \u003ccode\u003eposition = [-12.0, -12.0, -12.0]\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eA pseudocode for an imperative language could look like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eStructure = {Double factor, Vector position};\nStructure[] list = {p, q, u};\nfor i = 0; i \u0026lt; list.length; i++;\n for j = i+1; j \u0026lt; list.length; j++;\n structureFactor = calculateFactor(list[i], list[j]);\n //Destructive updates\n list[i].position += structureFactor; //Add factor to each vector value\n list[j].position -= structureFactor;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI've tried experimenting with Mutable Vectors but failed trying to include these in my data structure, since my understanding of Haskell is too basic and I'm not even sure if this approach makes sense.\u003c/p\u003e\n\n\u003cp\u003eIs there any easy way to do this?\u003c/p\u003e","answer_count":"1","comment_count":"8","creation_date":"2017-07-22 21:55:53.49 UTC","last_activity_date":"2017-07-26 22:45:09.643 UTC","last_edit_date":"2017-07-26 17:35:20.553 UTC","last_editor_display_name":"","last_editor_user_id":"7580760","owner_display_name":"","owner_user_id":"7580760","post_type_id":"1","score":"0","tags":"haskell","view_count":"139"} +{"id":"13069315","title":"How to retry transaction after a deadlock using Doctrine?","body":"\u003cp\u003eI am writing a PHP function which store/updates large sets of data into a table and that may cause a deadlock. I tried investigating how to retry a failed transaction with Doctrine but sadly could not find any info online. I eventually wrote the following code\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e $retry = 0;\n $done = false;\n while (!$done and $retry \u0026lt; 3) {\n try {\n\n $this-\u0026gt;entityManager-\u0026gt;flush();\n $done = true;\n\n } catch (\\Exception $e) {\n sleep(1);\n\n $retry++;\n }\n }\n\n if ($retry == 3) {\n throw new Exception(\n \"[Exception: MySQL Deadlock] Too many people accessing the server at the same time. Try again in few minutes\"\n );\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eMy question:\u003c/strong\u003e is there a chance this approach will insert duplicates in the database? if so, how can I force Doctrine to roll back the transactions?\u003c/p\u003e","accepted_answer_id":"13150683","answer_count":"3","comment_count":"0","creation_date":"2012-10-25 13:08:42.883 UTC","favorite_count":"1","last_activity_date":"2017-06-29 09:53:33.787 UTC","last_edit_date":"2012-10-29 09:20:16.893 UTC","last_editor_display_name":"","last_editor_user_id":"569101","owner_display_name":"","owner_user_id":"495416","post_type_id":"1","score":"6","tags":"php|mysql|database|doctrine2|deadlock","view_count":"6501"} +{"id":"45024905","title":"Fabric JS set backgroundImage from fabric object","body":"\u003cp\u003eI want to create an artboard like sketch's artboard in fabric canvas elemet\nlike this:\u003c/p\u003e\n\n\u003cp\u003e\u003cdiv class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\"\u003e\r\n\u003cdiv class=\"snippet-code\"\u003e\r\n\u003cpre class=\"snippet-code-js lang-js prettyprint-override\"\u003e\u003ccode\u003elet app = new Vue({\r\n el: '#app',\r\n computed: {\r\n canvasSize() {\r\n let VM = this\r\n let el, width, height\r\n el = VM.$refs.canvasBoxWrap\r\n width = el.clientWidth\r\n height = el.clientHeight\r\n return { width, height }\r\n }\r\n },\r\n data: {\r\n dSize: ''\r\n },\r\n mounted() {\r\n let VM = this\r\n \r\n VM.dSize = VM.canvasSize\r\n\r\n\r\n let fabricCanvasInit = () =\u0026gt; {\r\n let canvas = new fabric.Canvas(VM.$refs.facanvas , {\r\n enableRetinaScaling: true\r\n })\r\n canvas.set({\r\n 'enableRetinaScaling': true,\r\n 'backgroundColor': '#dddddd'\r\n })\r\n canvas.setWidth( VM.canvasSize.width)\r\n canvas.setHeight(VM.canvasSize.width / 16 * 9)\r\n // canvas.set('enableRetinaScaling', true)\r\n // canvas.set('backgroundColor' , '#dddddd')\r\n\r\n let artBoard = new fabric.Rect({\r\n stroke: '#000',\r\n strokeWidth:1,\r\n fill: 'rgba(255,255,255,1)',\r\n width: VM.canvasSize.width - 80,\r\n height: VM.canvasSize.width / 16 * 9 - 80\r\n ,\r\n shadow : {\r\n color: 'rgba(0,0,0,0.5)',\r\n blur: 20,\r\n offsetX: 0,\r\n offsetY: 10,\r\n opacity: 0.6,\r\n fillShadow: true\r\n }\r\n })\r\n\r\n canvas.add(artBoard)\r\n canvas.artBoard = artBoard\r\n canvas.artBoard.center()\r\n canvas.artBoard.set({\r\n 'selectable' : false\r\n })\r\n canvas.renderAll()\r\n console.log( canvas );\r\n }\r\n\r\n fabricCanvasInit()\r\n }\r\n})\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003c/p\u003e\n\n\u003cp\u003ebut in this demo, the \"artboard\" was created by a fabric rect object.\n When I change other object , like 'sendToBack()', I will reset the \"artboard\" object sendToBack() \nI want add the rect with shadow like fabricCanvas.setBackgroundImage(...)\nhow to do that?\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://jsfiddle.net/evolutionjay/6Ly3p5dd\" rel=\"nofollow noreferrer\"\u003ejsfiddle.net demo\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"45027221","answer_count":"1","comment_count":"0","creation_date":"2017-07-11 03:33:17.807 UTC","last_activity_date":"2017-07-11 06:45:50.447 UTC","last_edit_date":"2017-07-11 03:40:30.517 UTC","last_editor_display_name":"","last_editor_user_id":"8286875","owner_display_name":"","owner_user_id":"8286875","post_type_id":"1","score":"0","tags":"fabricjs","view_count":"106"} +{"id":"5680358","title":"Event listener not working - proper placement or syntax?","body":"\u003cp\u003eIn a Flash object I have an item (called widgit1) that I'm trying to attach an event listener to. I just want Flash to execute a JavaScript alert though no matter where I place it on the time line, regardless of which layer and regardless of what syntax I've found none of the many MANY combinations I have tried have worked.\u003c/p\u003e\n\n\u003cp\u003eHere is the ActionScript I have...\u003c/p\u003e\n\n\u003cp\u003ewidgit1.addEventListener(MouseEvent.mouseOver,ohhai);\u003c/p\u003e\n\n\u003cp\u003efunction ohhai() {getURL(\"javascript:alert('oh hai!')\");}\u003c/p\u003e","answer_count":"2","comment_count":"1","creation_date":"2011-04-15 17:36:28.07 UTC","last_activity_date":"2011-04-15 18:09:58.077 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"606371","post_type_id":"1","score":"0","tags":"flash|addeventlistener","view_count":"425"} +{"id":"44200518","title":"How to do right relationships between objects Django","body":"\u003cp\u003eI have two models: Category and Item. Item can have 2 or more categories so I need to have a relationship on categories(maybe one-to-many) from the item I create. But, I also need to fetch that items related to a category(or categories), maybe like this:\n\u003ccode\u003ehttp://example.com/api/items?category_id=5\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eCan anyone advice how can I achieve that? Thanks.\u003c/p\u003e","accepted_answer_id":"44200765","answer_count":"3","comment_count":"0","creation_date":"2017-05-26 11:31:21.837 UTC","last_activity_date":"2017-05-26 12:00:32.85 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3071148","post_type_id":"1","score":"0","tags":"python|django|django-rest-framework","view_count":"44"} +{"id":"20368557","title":"Why doesn't getActivity() on a listfragment work when ran from a dialogfragment","body":"\u003cp\u003eMy ListFragment is in a viewpager and the actionbar has a button that opens a dialogfragment. Then I'm trying to call a function with non-static methods to update my simple adapter from that dialogfragment like this:\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eMyDialogFragment.java\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic Dialog onCreateDialog(Bundle savedInstanceState) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n builder.setTitle(R.string.dialogtitle);\n builder.setSingleChoiceItems(R.array.items, indx, new DialogInterface.OnClickListener() {\n\nMyListFragment updateItems = new MyListFragment(); \n\n public void onClick(DialogInterface dialog, int id) {\n updateItems.updater();\n dialog.dismiss();\n ...\n}\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eMyListFragment.java\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic void updater(){\n ArrayList\u0026lt;Map\u0026lt;String, String\u0026gt;\u0026gt; list = buildData();\n\nString[] from = { \"name\", \"address\", \"postalcode\", \"item\", \"item2\", \"item3\" };\nint[] to = { R.id.title, R.id.address, R.id.postalcode, R.id.item1, R.id.imageView1, R.id.item3 };\n\nListAdapter adapter = new SimpleAdapter(getActivity(), list,\n R.layout.rowlayout, from, to);\nsetListAdapter(adapter); \n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003ccode\u003eListAdapter adapter = new SimpleAdapter(getActivity(), list, R.layout.rowlayout, from, to)\u003c/code\u003e line gives me null pointer exception. \u003c/p\u003e\n\n\u003cp\u003eFragment should be attached since I tried the lifecycle of that fragment by adding \u003ccode\u003eSystem.out.println(\"onAttach\")\u003c/code\u003e (or onResume and etc.) to every step to make sure that the status of the fragment isn't changed when the dialog box is opened.\u003c/p\u003e\n\n\u003cp\u003eI also added a button to that listfragment to do \u003ccode\u003e\"updater();\"\u003c/code\u003e and it works as supposed to.\u003c/p\u003e\n\n\u003cp\u003eAny good ideas why this doesn't work when run from a different fragment?\u003c/p\u003e\n\n\u003cp\u003eThank you for your help!\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eManaged to get rid of the null pointer exception by adding\n \u003ccode\u003eContext context;\u003c/code\u003e to the start of the ListFragment and \u003ccode\u003econtext = getActivity();\u003c/code\u003e to the onCreate method and using that context instead of getActivity on the updater function. I added a couple of System.out.printlns to that function which are printed out just fine, but the listview itself still isn't updated. Can't understand why because the fragment as I know seems to be active (or attached) and the function works fine when ran from the fragment itself.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-12-04 06:28:51.67 UTC","last_activity_date":"2013-12-04 13:57:25.8 UTC","last_edit_date":"2013-12-04 13:57:25.8 UTC","last_editor_display_name":"","last_editor_user_id":"3060529","owner_display_name":"","owner_user_id":"3060529","post_type_id":"1","score":"1","tags":"java|android|android-fragments","view_count":"211"} +{"id":"28627129","title":"AngularJS - 2 selects for a range of years. Options in second one have to be greater or equal than first one selected","body":"\u003cp\u003eI have 2 selects where I need to choose a range of years. The year of the second select has to be greater or equal than the first one. So if I select a year in the first select, the second select should change and show just the years greater or equal than the year selected in the first select.\u003c/p\u003e\n\n\u003cp\u003eThis is what I have right now:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div ng-app=\"\"\u0026gt;\n \u0026lt;div ng-controller=\"appCtrl\"\u0026gt;\n \u0026lt;select id=\"id_year_1\"\u0026gt;\n \u0026lt;option ng-repeat=\"year in years1 | filter:dateRangeFilter1\" value=\"{{year}}\"\u0026gt;{{year}}\u0026lt;/option\u0026gt;\n \u0026lt;/select\u0026gt;\n \u0026lt;select id=\"id_year_2\"\u0026gt;\n \u0026lt;option ng-repeat=\"year in years2 | filter:dateRangeFilter2\" value=\"{{year}}\"\u0026gt;{{year}}\u0026lt;/option\u0026gt;\n \u0026lt;/select\u0026gt; \n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\n\nangular.module('app', ['ngResource'])\n\nfunction appCtrl($scope) {\n var years = [2010, 2011, 2012];\n $scope.years1 = years;\n $scope.years2 = years;\n $scope.year1 = years[0];\n $scope.year2 = years[years.length - 1];\n\n $scope.$watch('years1', function(value, oldValue) {\n $scope.dateRangeFilter2 = function (value) {\n return value \u0026gt;= $scope.year2;\n };\n });\n $scope.$watch('years2', function(value, oldValue) {\n $scope.dateRangeFilter1 = function (value) {\n return value \u0026lt;= $scope.year1;\n };\n });\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have it also in this fiddle: \u003ca href=\"http://jsfiddle.net/d3sb4hky/\" rel=\"nofollow\"\u003ehttp://jsfiddle.net/d3sb4hky/\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","accepted_answer_id":"28627462","answer_count":"2","comment_count":"0","creation_date":"2015-02-20 10:48:36.583 UTC","favorite_count":"1","last_activity_date":"2015-02-20 11:10:44.637 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3652062","post_type_id":"1","score":"1","tags":"angularjs|angularjs-filter|angularjs-watch","view_count":"611"} +{"id":"43121527","title":"Filter using HBase REST API","body":"\u003cp\u003eDoes anyone know anything about the HBase REST API? Im currently writing a program which inserts and reads from HBase using curl commands. When trying to read I use the curl get command, e.g. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecurl -X GET 'http://server:9090/test/Row-1/Action:ActionType/' -h 'Accept:application/json'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis returns the column Action:ActionType from Row-1. If I want to do the equivalent of a WHERE clause using the GET command I am stuck however. Im not sure its even possible? If I want to find all records where Action:ActionType =1 for example.\nHelp is appreciated!\u003c/p\u003e","accepted_answer_id":"43189118","answer_count":"1","comment_count":"0","creation_date":"2017-03-30 15:00:19.4 UTC","favorite_count":"1","last_activity_date":"2017-04-03 15:54:33.75 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2925636","post_type_id":"1","score":"3","tags":"rest|curl|hbase","view_count":"714"} +{"id":"29602898","title":"How can prevent show a view in custom cursor adapter without re query","body":"\u003cp\u003eI Use custom cusrsor adapter for ListView.\u003c/p\u003e\n\n\u003cp\u003eI want known how can prevent show a view (row) without using changeCursor, swapCursor or requery.(only local)\u003c/p\u003e\n\n\u003cp\u003eFor example: if(mylist.contains(position)) skip row;\u003c/p\u003e\n\n\u003cp\u003ePlease help me, Thanks so much\u003c/p\u003e","answer_count":"1","comment_count":"11","creation_date":"2015-04-13 10:15:30.44 UTC","last_activity_date":"2015-04-13 10:40:56.083 UTC","last_edit_date":"2015-04-13 10:21:57.023 UTC","last_editor_display_name":"","last_editor_user_id":"4509464","owner_display_name":"","owner_user_id":"4509464","post_type_id":"1","score":"-2","tags":"android|android-cursoradapter","view_count":"279"} +{"id":"2969157","title":"Adding bibliography to appendices in latex","body":"\u003cp\u003eI am writing my thesis and i am using the chapterbib option, while it makes beautiful bibliographies for my chapters, i can't get it to do the same thing for my appendices\u003c/p\u003e\n\n\u003cp\u003epremable:\u003c/p\u003e\n\n\u003cp\u003e\\documentclass[pdftex, 11pt, onecolumn, openany]{report}\u003cbr\u003e\n \\usepackage{amsmath}\u003cbr\u003e\n\\usepackage[pdftex]{graphicx}\u003cbr\u003e\n\\usepackage{appendix}\u003cbr\u003e\n\\usepackage[sectionbib]{chapterbib}\u003cbr\u003e\n\\usepackage{chapterbib}\u003c/p\u003e\n\n\u003cp\u003e\\begin{document}\u003cbr\u003e\n...\u003cbr\u003e\n\\include{background}\u003cbr\u003e\n\\include{ATRPcomp}\u003cbr\u003e\n\\include{CCTcomp} \n\\appendix\u003cbr\u003e\n\\include{AppCCT}\u003cbr\u003e\n\\end{document} \u003c/p\u003e\n\n\u003cp\u003ein each of my chapter sections and appendix I have:\u003c/p\u003e\n\n\u003cp\u003e\\chapter{Compartmentalization in Catalytic Chain Transfer}\u003cbr\u003e\n...\u003cbr\u003e\n\\bibliography{references} \u003c/p\u003e\n\n\u003cp\u003eDoes the chapterbib work also for appendices or is there another option that will help it?\u003c/p\u003e\n\n\u003cp\u003eThank you!!!!!!\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2010-06-03 19:34:40.45 UTC","last_activity_date":"2010-06-04 07:58:17.393 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"357852","post_type_id":"1","score":"1","tags":"latex|pdflatex","view_count":"1958"} +{"id":"5511223","title":"ExtJs: Search / Filter within a ComboBox","body":"\u003cp\u003eI've the following problem / question in ExtJs 2.3:\u003c/p\u003e\n\n\u003cp\u003eI'd like to do a search within a combobox.\nI'll give you an example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eExt.comboData.names = [['Peter', 'Paul', 'Amanda']];\n\nvar store = new Ext.data.SimpleStore({\n fields: ['name'],\n data: Ext.comboData.names\n});\n\n\nvar combo = new Ext.form.ComboBox({\n name: '...',\n id: '...',\n store: store,\n displayField: 'name',\n typeAhead: true,\n mode: 'local',\n forceSelection: false,\n triggerAction: 'all',\n emptyText: '-',\n selectOnFocus: true,\n applyTo: '...',\n hiddenName: '...', \n valueField: 'name'\n enableKeyEvents: true,\n lastQuery: '',\n listeners: {\n 'keyup': function() {\n this.store.filter('name', this.getRawValue(), true, false);\n }\n }\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I would type in an 'a', there only should be 'Paul' and 'Amanda' in the \"dropdown\". So in other words I'm looking for a solution to filter the data not only by the entries' first letter, but maybe by using something like a regular expression (?) (like in SQL ... LIKE '%a%')...I also would need type of \"onKeyDown\"-event for my comboBox in order to filter the results on every single letter I add.\nHow can I do that? Any ideas?\u003c/p\u003e\n\n\u003cp\u003eTanks a lot in advance :)\u003c/p\u003e\n\n\u003cp\u003eSchildi\u003c/p\u003e\n\n\u003cp\u003ePS: Unfortunately I have to use my current version of ExtJs (2.3), so if there's a solution for my problem just in later versions, I would have to look for an other way...\u003c/p\u003e","answer_count":"7","comment_count":"0","creation_date":"2011-04-01 09:00:49.82 UTC","favorite_count":"2","last_activity_date":"2016-08-02 09:52:25.143 UTC","last_edit_date":"2011-04-01 12:08:28.773 UTC","last_editor_display_name":"","last_editor_user_id":"687277","owner_display_name":"","owner_user_id":"687277","post_type_id":"1","score":"3","tags":"extjs|combobox|filter","view_count":"35473"} +{"id":"32034980","title":"Email sending control","body":"\u003cp\u003eI would like to implement email sending with my own mail server.\u003c/p\u003e\n\n\u003cp\u003eIs there any java script control/library that available that has similar functionality to gmail sending popup.\u003cbr\u003e\nIt shoudl be pretty somple including multiple recipients, subject, body text and send button.\u003c/p\u003e\n\n\u003cp\u003eOf course i can implement all this functionality by myself but maybe someone out there already did something similar.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/Cu62s.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/Cu62s.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"33196822","answer_count":"1","comment_count":"0","creation_date":"2015-08-16 12:18:25.193 UTC","last_activity_date":"2015-10-18 10:22:42.227 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"870599","post_type_id":"1","score":"0","tags":"javascript|gmail","view_count":"18"} +{"id":"42560585","title":"How do I center text in the Tkinter Text widget?","body":"\u003cp\u003eI am learning python and I'm completing mini projects. I've made an 8-ball program and it is almost done. One thing that is annoying me is that the text output to the user is not centred. \u003c/p\u003e\n\n\u003cp\u003eHow do I do this? I've tried the following but still no luck.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eT1.tag_configure(\"center\", justify='center')\nT1.tag_add(\"center\", 1.0, \"end\")\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy code is \u003ca href=\"http://pastebin.com/S7pEXYtC\" rel=\"nofollow noreferrer\"\u003ehere\u003c/a\u003e. Thanks for your help!\u003c/p\u003e","answer_count":"2","comment_count":"3","creation_date":"2017-03-02 16:20:45.233 UTC","last_activity_date":"2017-03-02 17:10:06.117 UTC","last_edit_date":"2017-03-02 16:44:05.857 UTC","last_editor_display_name":"","last_editor_user_id":"7432","owner_display_name":"","owner_user_id":"6480616","post_type_id":"1","score":"0","tags":"python|tkinter","view_count":"1585"} +{"id":"13988452","title":"Remove all HTML with Jsoup but keep the lines","body":"\u003cp\u003eI have a \u003ccode\u003eString\u003c/code\u003e which contains some of the content of an e-mail, I want to remove all the HTML coding from this \u003ccode\u003eString\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eThis is my code at the moment:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic static String html2text(String html) {\n\n Document document = Jsoup.parse(html);\n document = new Cleaner(Whitelist.basic()).clean(document);\n document.outputSettings().escapeMode(EscapeMode.xhtml);\n document.outputSettings().charset(\"UTF-8\");\n html = document.body().html();\n\n html = html.replaceAll(\"\u0026lt;br /\u0026gt;\", \"\");\n\n splittedStr = html.split(\"Geachte heer/mevrouw,\");\n\n html = splittedStr[1];\n\n html = \"Geachte heer/mevrouw,\"+html;\n\n return html;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis method removes all HTML, keeps lines and most of the layout. But it will also return some \u003ccode\u003e\u0026amp;amp;\u003c/code\u003e and \u003ccode\u003enbsp;\u003c/code\u003e tags, which aren't completely removed. See the output below, as you can see there are still some tags and even parts of it in the \u003ccode\u003eString\u003c/code\u003e. How do I get rid of these?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e  Loonheffingen       \u0026amp;amp;n= bsp; Naam\n nr         in administratie         \u0026amp;amp;nbs= p;           meldingen\n  nummer\n\n 1          \u0026amp;amp;n= bsp;            = ;     0            \u0026amp;amp;= nbsp;           \u0026amp;amp;nbs= p;           1\n      123456789L01\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdit:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;span style=\"color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif\"\u0026gt;De afgekeurde meldingen zijn opgenomen in de bijlage: Afgekeurde meldingen.\u0026lt;/span\u0026gt;\u0026lt;br style=\"color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif\"\u0026gt;\n\n\u0026lt;span style=\"color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif\"\u0026gt;Wilt u zo spoedig mogelijk zorgdragen dat deze\u0026lt;/span\u0026gt;\u0026lt;br style=\"color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif\"\u0026gt;\n\u0026lt;span style=\"color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif\"\u0026gt;meldingen gecorrigeerd worden aangeleverd?\u0026lt;/span\u0026gt;\u0026lt;br style=\"color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif\"\u0026gt;\n\u0026lt;span style=\"color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif\"\u0026gt;mer\u0026lt;/span\u0026gt;\u0026lt;br style=\"color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif\"\u0026gt;\n\u0026lt;span style=\"color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif\"\u0026gt;Volg \u0026amp;nbsp; \u0026amp;nbsp; Aantal verwerkt \u0026amp;nbsp; \u0026amp;nbsp; \u0026amp;nbsp; \u0026amp;nbsp; \u0026amp;nbsp;Aantal afgekeurde\u0026lt;/span\u0026gt;\u0026lt;br style=\"color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif\"\u0026gt;\n\u0026lt;span style=\"color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif\"\u0026gt;\u0026amp;nbsp;Loonheffingen \u0026amp;nbsp; \u0026amp;nbsp; \u0026amp;nbsp; \u0026amp;nbsp; Naam\u0026lt;/span\u0026gt;\u0026lt;br style=\"color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif\"\u0026gt;\n\u0026lt;span style=\"color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif\"\u0026gt;nr \u0026amp;nbsp; \u0026amp;nbsp; \u0026amp;nbsp; \u0026amp;nbsp; in administratie \u0026amp;nbsp; \u0026amp;nbsp; \u0026amp;nbsp; \u0026amp;nbsp; \u0026amp;nbsp; \u0026amp;nbsp; \u0026amp;nbsp; \u0026amp;nbsp; \u0026amp;nbsp; \u0026amp;nbsp; meldingen\u0026lt;/span\u0026gt;\u0026lt;br style=\"color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif\"\u0026gt;\n\u0026lt;span style=\"color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif\"\u0026gt;\u0026amp;nbsp;nummer\u0026lt;/span\u0026gt;\u0026lt;br style=\"color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif\"\u0026gt;\n\u0026lt;br style=\"color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif\"\u0026gt;\u0026lt;span style=\"color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif\"\u0026gt;1 \u0026amp;nbsp; \u0026amp;nbsp; \u0026amp;nbsp; \u0026amp;nbsp; \u0026amp;nbsp; \u0026amp;nbsp; \u0026amp;nbsp; \u0026amp;nbsp; \u0026amp;nbsp; \u0026amp;nbsp; \u0026amp;nbsp; \u0026amp;nbsp; \u0026amp;nbsp; \u0026amp;nbsp;0 \u0026amp;nbsp; \u0026amp;nbsp; \u0026amp;nbsp; \u0026amp;nbsp; \u0026amp;nbsp; \u0026amp;nbsp; \u0026amp;nbsp; \u0026amp;nbsp; \u0026amp;nbsp; \u0026amp;nbsp; \u0026amp;nbsp; \u0026amp;nbsp; \u0026amp;nbsp; \u0026amp;nbsp; \u0026amp;nbsp; \u0026amp;nbsp; \u0026amp;nbsp; \u0026amp;nbsp;1\u0026lt;/span\u0026gt;\u0026lt;br style=\"color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif\"\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is a part of the HTML I am trying to parse. I want to remove all the HTML, but keep the layout of the original e-mail.\u003c/p\u003e\n\n\u003cp\u003eAny help is appreciated, \u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eSolved\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Document xmlDoc = Jsoup.parse(file, \"\", Parser.xmlParser());\n Elements spans= xmlDoc.select(\"span\");\n\n for (Element link : spans) {\n String html = textPlus(link);\n System.out.println(html);\n }\n\n\n public static String textPlus(Element elem) {\n List\u0026lt;TextNode\u0026gt; textNodes = elem.textNodes();\n if (textNodes.isEmpty()) {\n return \"\";\n }\n\n StringBuilder result = new StringBuilder();\n // start at the first text node\n Node currentNode = textNodes.get(0);\n while (currentNode != null) {\n // append deep text of all subsequent nodes\n if (currentNode instanceof TextNode) {\n TextNode currentText = (TextNode) currentNode;\n result.append(currentText.text());\n } else if (currentNode instanceof Element) {\n Element currentElement = (Element) currentNode;\n result.append(currentElement.text());\n }\n currentNode = currentNode.nextSibling();\n }\n return result.toString();\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCode was provided as an answer on \u003ca href=\"https://stackoverflow.com/questions/13042367/get-the-text-in-anchors-within-text-nodes\"\u003ethis\u003c/a\u003e question.\u003c/p\u003e","accepted_answer_id":"13988832","answer_count":"1","comment_count":"0","creation_date":"2012-12-21 10:34:49.86 UTC","last_activity_date":"2012-12-22 21:40:01.117 UTC","last_edit_date":"2017-05-23 11:56:41.913 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"975468","post_type_id":"1","score":"2","tags":"java|html|regex|jsoup","view_count":"2136"} +{"id":"20940079","title":"OOP C# - Design pattern for MMO mechanics simulator","body":"\u003cp\u003eI've been working on a simulator for FFXIV;\u003c/p\u003e\n\n\u003cp\u003eI keep getting really close to finishing, then I get walled into an object access issue that doesn't let me access the stats of the main player. My project can be found at: \u003ca href=\"https://github.com/eein/chocobro\" rel=\"nofollow\"\u003ehttps://github.com/eein/chocobro\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThere's plenty of things i can optimize, I know. :P\u003c/p\u003e\n\n\u003cp\u003eBasically i'm kind of brute-force winging it to have objects gain access to the objects they need, but i'm looking for the right way to do things.\u003c/p\u003e\n\n\u003cp\u003eI'm going to start rewriting it so don't clutch too hard to the example code but its there to see the issue i'm having. :(\u003c/p\u003e\n\n\u003cp\u003eIdeally in the next attempt, this is what i'd like to do:\nStart with a player class that contains all of the informatin about the player object (in the future, i'd like to create multiples for full group simulation).\u003c/p\u003e\n\n\u003cp\u003eSomething like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eint main(){\nPlayer p = new Player();\n\npublic void setJob()\n{\n if (job == \"bard\"){ Player p = new Bard(); }\n if (job == \"warrior\"){ Player p = new Warrior(); }\n}\n\npublic class Player \n{\n private string name {get;set;}\n private string job {get;set;}\n private string STR;\n private string DEX;\n private string VIT; \n //etc..\n\n public virtual void rotation()\n {\n } \n}\n\n//I want to make the program a bit modular for jobs (roles/classes)\n//So.. \n\npublic class Bard : Player\n{\n public override void rotation()\n {\n heavyshot.execute(); \n //etc.\n }\n\n Ability heavyshot = new Heavyshot();\n\n public class Heavyshot : Ability \n {\n public Heavyshot() \n {\n name = \"Heavy Shot\";\n potency = 150;\n dotPotency = 0;\n recastTime = 2.5;\n TPcost = 60;\n animationDelay = 0.8;\n abilityType = \"Weaponskill\";\n castTime = 0.0;\n duration = 0.0;\n }\n\n public override void impact() \n {\n //add heavier shot buff activation here\n base.impact(); \n }\n }\n}\n\npublic class Ability{\npublic int cooldown;\npublic int cost;\n\npublic virtual void impact()\n{\n public virtual void impact() \n {\n //Deal some damage.\n // !! - the key problem is here, i want to initiate a roll to compare to the players CRIT rating versus the roll to determine the bonus damage. But I can't access the initiated players crit from here. The rating may change depending on abilities used so I can't create a new object. I know i need an object reference but I can't figure it out...\n log(time.ToString(\"F2\") + \" - \" + name + \n \" Deals \" + potency + \n \" Potency Damage. Next ability at: \" + nextability);\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm probably not being too clear, but basically I want to be able to access the player's crit from ability, and i'm assuming ability can't be set up this way in order for it to work. Does anyone have a good idea what kind of design pattern I should be using so that the virtual functions in ability can access the parent classes players stats?\u003c/p\u003e\n\n\u003cp\u003eIdeally, I want the bard class to contain all of the abilities and stat updates pertaining to the bard job, once bard inherits player and the object is changed to reference the Bard object, how do I make it so abilities created by the Ability class dont need an object reference to the parent at the time of creation when accessing that function.\u003c/p\u003e\n\n\u003cp\u003eI'm confusing myself, but many thanks to whoever understands my gibberish and can help!\u003c/p\u003e","accepted_answer_id":"20940745","answer_count":"2","comment_count":"0","creation_date":"2014-01-05 22:32:08.717 UTC","favorite_count":"1","last_activity_date":"2014-01-06 00:47:00.34 UTC","last_edit_date":"2014-01-05 23:25:58.173 UTC","last_editor_display_name":"","last_editor_user_id":"548036","owner_display_name":"","owner_user_id":"3163596","post_type_id":"1","score":"0","tags":"c#|mmo","view_count":"266"} +{"id":"20160419","title":"Best structure setup to resize tool using kineticjs","body":"\u003cp\u003eI am making a drawing/designing tool in canvas using kineticjs library.\u003c/p\u003e\n\n\u003cp\u003eI can't figure out which is the best way for the objects structure order (groups, shapes, layers). \nI need to resize an object with dragging the selection nodes. \u003c/p\u003e\n\n\u003cp\u003eHere is what I have tried so far and the problem with it:\n\u003cimg src=\"https://i.stack.imgur.com/xpjLR.gif\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eI have the rectangle (grey fill, black border) as the object I need to resize and I have the 8 selection nodes (brown rectangles). The problem with this setup is that rectangle needs to be draggable but the selection nodes must be positioned in the same time with the rectangle. So I have put all these in a single layer. The problem is that only layer can be draggable, not groups and shapes, so when I press the selection node to resize, it acts like I am dragging the whole layer.\u003c/p\u003e\n\n\u003cp\u003eWhat do you suggest, what setup should I use? \nThanks!\u003c/p\u003e","accepted_answer_id":"20164382","answer_count":"2","comment_count":"1","creation_date":"2013-11-23 08:50:27.553 UTC","favorite_count":"1","last_activity_date":"2014-06-12 08:23:49.703 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"281005","post_type_id":"1","score":"3","tags":"drag-and-drop|resize|html5-canvas|kineticjs","view_count":"1416"} +{"id":"38229141","title":"Sigabrt error xcode, and viewcontrollers","body":"\u003cp\u003eIm not going to post my code because i dont think that its an error with that but im going to ask some question about viewcontrollers because i think my lack of understanding of them is what is causing it.\u003c/p\u003e\n\n\u003cp\u003eSo i have a multipage registration page in my app, the first page asks for email the second page is name and so on. I get this error when trying to present the same view controller across all the pages.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eAttempt to present \u0026lt;Safisa.RegPageViewController: 0x7f9c085e4130\u0026gt; on \n\u0026lt;Safisa.RegPageViewController: 0x7f9c0a23a920\u0026gt; which is already \npresenting \u0026lt;UIAlertController: 0x7f9c0842b0b0\u0026gt;\n2016-07-06 11:23:14.820 Safisa[6027:265977] *** Terminating app due to \nuncaught exception 'NSUnknownKeyException', reason: \n'[\u0026lt;Safisa.RegPageViewController 0x7f9c0a278f00\u0026gt; \nsetValue:forUndefinedKey:]: this class is not key value coding-\ncompliant for the key passwordRegButton.'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI also get an error that is Thread 1: signal Sigabrt for the pre built class \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass AppDelegate: UIResponder, UIApplicationDelegate {\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny tips on how i can fix this guys?\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2016-07-06 16:33:12.953 UTC","last_activity_date":"2016-07-06 16:33:12.953 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5565756","post_type_id":"1","score":"0","tags":"ios|xcode|uiviewcontroller|sigabrt","view_count":"130"} +{"id":"17349492","title":"Which association to use in this has_many with three resources in Rails?","body":"\u003cp\u003eI have the following resources:\u003c/p\u003e\n\n\u003cp\u003e-\u003e Corporation has_many companies \u003cbr\u003e\n-\u003e Company belongs_to corporation \u003cbr\u003e\n-\u003e Company has_many state (so, the same company can be in many states) \u003cbr\u003e\n-\u003e State has_many companies \u003cbr\u003e\u003c/p\u003e\n\n\u003cp\u003eMy problem here is that a Company have the following attributes: name and description.\u003c/p\u003e\n\n\u003cp\u003eThere is also a phone number for a company, but that phone number varies depending on the state where the company is located.\u003c/p\u003e\n\n\u003cp\u003eHere is how I see it from a table point of view:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eStates\nid\nname\n\nCorporation\nid\nname\n\nCompany\nid\nname\n\nCompany_states\nid\ncompany_id\nstate_id\nphone_number\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow should I set the associations to acomplish this? Thanks.\u003c/p\u003e","accepted_answer_id":"17349647","answer_count":"1","comment_count":"0","creation_date":"2013-06-27 17:21:40.1 UTC","last_activity_date":"2013-06-27 17:29:10.517 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1196150","post_type_id":"1","score":"0","tags":"ruby-on-rails|associations","view_count":"25"} +{"id":"45453228","title":"RealmConfiguration in other class","body":"\u003cp\u003eI am having trouble in opening and writing realm files in my android code.\u003c/p\u003e\n\n\u003cp\u003eBelow is example code.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class FirstActivity extends AppCompatActivity {\n\n protected void onCreate(Bundle savedInstanceState) {\n\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_first);\n\n RealmConfiguration realmA = new RealmConfiguration.Builder()\n .name(\"A.realm\")\n .schemaVersion(1)\n .build();\n\n RealmConfiguration realmB = new RealmConfiguration.Builder()\n .name(\"B.realm\")\n .schemaVersion(25)\n .build();\n\n Realm.init(this);\n\n Realm realm_A = Realm.getInstance(realmA);\n // Do some jobs with realm_A\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI make two configuration named realmA and realmB for example instance. But, \u003cstrong\u003eI want to open them in another activity\u003c/strong\u003e, named \u003ccode\u003eSecondActivity\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eI know \u003ccode\u003eRealm.getDefaultInstance()\u003c/code\u003e but, there is two configuration so, I cannot use \u003ccode\u003eRealm.setDefaultInstance()\u003c/code\u003e\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003eYou can say that declare realmA and realmB in \u003ccode\u003eSecondActivity\u003c/code\u003e. But, the problem is that I should modify RealmConfiguration every time after modifying schema like updating schemaVersion 1 to 2 etc. And that bother me.. :( (If there are tons of activities, I should modify tons of it..)\u003c/p\u003e\n\n\u003cp\u003eIs there any good way to use RealmConfiguration in other class?\u003c/p\u003e","accepted_answer_id":"45453777","answer_count":"1","comment_count":"0","creation_date":"2017-08-02 06:38:14.58 UTC","last_activity_date":"2017-08-02 07:38:17.15 UTC","last_edit_date":"2017-08-02 06:57:05 UTC","last_editor_display_name":"","last_editor_user_id":"7105963","owner_display_name":"","owner_user_id":"7105963","post_type_id":"1","score":"0","tags":"android|realm","view_count":"44"} +{"id":"26376627","title":"java cannot handle a 32 bit number","body":"\u003cp\u003eI am trying to assign 4294967295 to a long. That is (2^32-1)\njava(netbeans) gives the following error message\n\"integer number too large\"\u003c/p\u003e\n\n\u003cp\u003ein fact I tried to figure out the largest number that an int can handle(did it manually by hand)\nand found that it is 2147483647 (of course as obvious it is 2^31-1)\u003c/p\u003e\n\n\u003cp\u003eBut surprisingly I found out that even the long type cannot handle a number larger than that.\nIsn't there any difference between int and long?java doc says long is 64 bit\u003c/p\u003e\n\n\u003cp\u003eAm I missing something?\u003c/p\u003e","accepted_answer_id":"26376650","answer_count":"3","comment_count":"0","creation_date":"2014-10-15 07:16:24.447 UTC","last_activity_date":"2017-09-27 09:56:38.497 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1760907","post_type_id":"1","score":"2","tags":"java|types|int|long-integer","view_count":"335"} +{"id":"26597612","title":"How does a Web browser differentiate between HTML5 and HTML4?","body":"\u003cp\u003eHow does a Web browser differentiate between HTML5 and HTML4?\u003c/p\u003e","accepted_answer_id":"26597849","answer_count":"1","comment_count":"10","creation_date":"2014-10-27 22:02:37.597 UTC","last_activity_date":"2014-10-27 22:20:22.757 UTC","last_edit_date":"2014-10-27 22:05:57.68 UTC","last_editor_display_name":"","last_editor_user_id":"981922","owner_display_name":"","owner_user_id":"1534549","post_type_id":"1","score":"3","tags":"html5|browser|html4","view_count":"857"} +{"id":"23015042","title":"INVALID_USERID error code when trying to retrieve recipient view using REST API","body":"\u003cp\u003eI am trying to retrieve the recipient view for an envelope using the REST API, and I am getting the INVALID_USERID error code in my response.\u003c/p\u003e\n\n\u003cp\u003eRequest:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ePOST https://demo.docusign.net/restapi/v2/accounts/\u0026lt;redacted\u0026gt;/envelopes/\u0026lt;redacted\u0026gt;/views/recipient HTTP/1.1\nAuthorization: bearer \u0026lt;redacted\u0026gt;\nContent-Type: application/json\nHost: demo.docusign.net\nContent-Length: 124\nExpect: 100-continue\n\n{\"authenticationMethod\":\"userId\",\"clientUserId\":\"2\",\"returnUrl\":\"\u0026lt;redacted\u0026gt;\",\"userId\":\"1\"}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eResponse:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eHTTP/1.1 400 Bad Request\nCache-Control: no-cache\nContent-Length: 70\nContent-Type: application/json; charset=utf-8\nDate: Fri, 11 Apr 2014 13:48:42 GMT\nStrict-Transport-Security: max-age=7776000; includeSubDomains\n\n{\n \"errorCode\": \"INVALID_USERID\",\n \"message\": \"Invalid UserId.\"\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAs you can see, I am trying to authenticate the recipient view request using the option to provide the clientUserId and userId (since they are an embedded signer) sent in original POST to create the envelope as opposed to using the email/username method. The API documentation does not indicate what authenticationMethod value to use to indicate that I am doing this; it only lists that \"email\" should be used for the email/username method. Therefore, I'm making my best guess and using \"userId\" for that value.\u003c/p\u003e\n\n\u003cp\u003eI have verified that the clientUserId and userId (recipientId from the envelope request) match what I'm sending in here.\u003c/p\u003e\n\n\u003cp\u003eEnvelope Request:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ePOST https://demo.docusign.net/restapi/v2/accounts/\u0026lt;redacted\u0026gt;/envelopes HTTP/1.1\nAuthorization: bearer \u0026lt;redacted\u0026gt;\nContent-Type: multipart/form-data; boundary=\"AAA\"\nHost: demo.docusign.net\nContent-Length: 309312\nExpect: 100-continue\nConnection: Keep-Alive\n\n--AAA\nContent-Type: application/json; charset=utf-8\nContent-Disposition: form-data\n\n{\"documents\":[{\"name\":\"EOS.pdf\",\"documentId\":\"1\",\"order\":1}],\"emailBlurb\":null,\"emailSubject\":\"Subject\",\"recipients\":{\"signers\":[{**\"clientUserId\":\"2\"**,\"email\":\"asdf@asdf.com\",**\"recipientId\":\"1\"**,\"Name\":\"John Doe\",\"Tabs\":{\"signHereTabs\":[{\"anchorString\":\"Anchor\",\"anchorIgnoreIfNotPresent\":true,\"anchorUnits\":null,\"anchorXOffset\":-10,\"anchorYOffset\":-15}]}}]},\"status\":\"sent\"}\n--AAA\nContent-Type: application/pdf\nContent-Disposition: file; filename=EOS.pdf; documentid=1\n\n\u0026lt;snip\u0026gt;\n\n--AAA--\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs there anything I need to do to the request to get it to submit correctly?\u003c/p\u003e","accepted_answer_id":"23015745","answer_count":"1","comment_count":"0","creation_date":"2014-04-11 14:11:58.14 UTC","favorite_count":"1","last_activity_date":"2014-04-11 16:36:26.483 UTC","last_edit_date":"2014-04-11 14:16:50.343 UTC","last_editor_display_name":"","last_editor_user_id":"1021970","owner_display_name":"","owner_user_id":"2005951","post_type_id":"1","score":"0","tags":"rest|docusignapi","view_count":"303"} +{"id":"33487287","title":"Script to remove letters","body":"\u003cp\u003eI need an Excel VB script to remove all letter a-z A-z and () from cell.\u003c/p\u003e\n\n\u003cp\u003eI want to keep all numbers and periods (.).\u003c/p\u003e\n\n\u003cp\u003eFor example SDF dsfsd dfS SD ( dfd ))) sdf 2.1 mg uf g will become 2.1\u003c/p\u003e\n\n\u003cp\u003eThis is what I have but it is not working:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eFunction strClean(strtoclean)\nDim objRegExp, outputStr\nSet objRegExp = New Regexp\nobjRegExp.IgnoreCase = True\nobjRegExp.Global = True\nobjRegExp.Pattern = \"(([0-9]).)\"\noutputStr = objRegExp.Replace(strtoclean, \"-\")\nobjRegExp.Pattern = \"\\-+\"\noutputStr = objRegExp.Replace(outputStr, \"-\")\nstrClean = outputStr\nEnd Function\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"7","creation_date":"2015-11-02 21:27:27.667 UTC","last_activity_date":"2015-11-03 01:00:14.977 UTC","last_edit_date":"2015-11-03 01:00:14.977 UTC","last_editor_display_name":"","last_editor_user_id":"2143004","owner_display_name":"","owner_user_id":"1568666","post_type_id":"1","score":"-4","tags":"excel|excel-vba","view_count":"63"} +{"id":"27346312","title":"netbeans jar build file not opening","body":"\u003cp\u003eI have build my project using OpenCV. When I run my project through netbeans it runs fine.. but when I create its jar file via \u003ccode\u003eClean and Build\u003c/code\u003e it doesn't open. \nit displays a message in output screen when it is build that is..\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e To run this application from the command line without Ant, try:\n java -jar \"C:\\Users\\Rafi Abro\\Documents\\NetBeansProjects\\WebCam\\dist\\WebCam.jar\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI also tried to open my project through this command..\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e java -jar WebCam.jar\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut it displayed error below:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Exception in thread \"main\" java.lang.UnsatisfiedLinkError: no opencv_java2410 in\n java.library.path\n at java.lang.ClassLoader.loadLibrary(Unknown Source)\n at java.lang.Runtime.loadLibrary0(Unknown Source)\n at java.lang.System.loadLibrary(Unknown Source)\n at javaanpr.Main.main(Main.java:154)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eplease can anyone help me through out this problem.. \u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","accepted_answer_id":"27381683","answer_count":"1","comment_count":"8","creation_date":"2014-12-07 18:37:23.25 UTC","favorite_count":"1","last_activity_date":"2014-12-09 14:45:19.313 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2698010","post_type_id":"1","score":"3","tags":"java|opencv|netbeans","view_count":"520"} +{"id":"1477765","title":"Expression blend photoshop effects","body":"\u003cp\u003eI'm new to using blend, I've discovered when I import my photoshop file blend takes my effects away. Can anyone tell me why blend doesn't recognize my effects?\u003c/p\u003e","accepted_answer_id":"1478495","answer_count":"1","comment_count":"0","creation_date":"2009-09-25 14:52:20.6 UTC","last_activity_date":"2017-11-01 12:35:12.103 UTC","last_edit_date":"2017-11-01 12:35:12.103 UTC","last_editor_display_name":"","last_editor_user_id":"1000551","owner_display_name":"","owner_user_id":"169254","post_type_id":"1","score":"1","tags":"silverlight|import|photoshop|expression-blend","view_count":"1111"} +{"id":"38059680","title":"createsample.exe crashes every time","body":"\u003cp\u003eHi I am trying to create samples using opencv_createsamples.exe but it crashes every time. I've checked different builds, opencv2 and opencv3. I don't know how to overcome this. My command looks like this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eopencv_createsamples.exe -img C:/Users/dpach/Pictures/Interfejsy/img/1.jpg -maxxangle 15 -maxyangle 15 -maxzangle 1 -w 80 -h 40 -vec test.vec -bgtresh 0 -bgcolor 0 -show\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe windows to show samples is opening but after that I receive info that program is not responding. Any ideas ?\u003c/p\u003e\n\n\u003cp\u003e// EDIT\nI've tried to start it from a pseudo unix bash and I receive then \u003ccode\u003eSegmentation fault\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003e// EDIT2\nIt crush after that \u003ccode\u003eCreate training samples from single image applying distortions...\u003c/code\u003e\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2016-06-27 17:17:46.277 UTC","last_activity_date":"2016-06-27 17:24:29.007 UTC","last_edit_date":"2016-06-27 17:24:29.007 UTC","last_editor_display_name":"","last_editor_user_id":"825493","owner_display_name":"","owner_user_id":"825493","post_type_id":"1","score":"1","tags":"opencv|opencv3.0|createsamples","view_count":"70"} +{"id":"25984122","title":"javascript recursive function - not understanding what is going on","body":"\u003cp\u003eI was reading javascript documentation on 'functions' and came across this code that I am not following how it's working step by step, specifically the inner recursive function.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction factorial(n){\n if ((n == 0) || (n == 1))\n return 1;\n else\n return (n * factorial(n - 1));\n}\n\nvar a, b, c, d, e;\na = factorial(1); // a gets the value 1\nb = factorial(2); // b gets the value 2\nc = factorial(3); // c gets the value 6\nd = factorial(4); // d gets the value 24\ne = factorial(5); // e gets the value 120\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am not following the logic beyond the first if statement. Could someone spell it out. I have already ran the code and works just as specified.\u003c/p\u003e","accepted_answer_id":"25984204","answer_count":"2","comment_count":"2","creation_date":"2014-09-22 22:36:59.04 UTC","last_activity_date":"2014-09-22 22:58:13.577 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1798677","post_type_id":"1","score":"0","tags":"javascript|recursion","view_count":"38"} +{"id":"45617854","title":"Textarea maxlength and SQL Server nvarchar does not match with breakline","body":"\u003cp\u003eI set attribute maxlength of textarea as 10 and I set \u003ccode\u003envarchar(10)\u003c/code\u003e for a column in a table. I am using SQL Server 2014.\u003c/p\u003e\n\n\u003cp\u003eThe problem is when I type enter, textarea will count length as 1 but SQL Server count it as 2. \u003c/p\u003e\n\n\u003cp\u003eWhen I type enter 10 times and then I save the textarea value in database, it throws error \"truncated\".\u003c/p\u003e\n\n\u003cp\u003eWhat should I do in this situation? How can I set maxlength of textarea and set length of nvarchar in database?\u003c/p\u003e\n\n\u003cp\u003eShould I modify string in server before saving to database?\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2017-08-10 15:28:07.543 UTC","last_activity_date":"2017-08-10 15:43:15.993 UTC","last_edit_date":"2017-08-10 15:43:15.993 UTC","last_editor_display_name":"","last_editor_user_id":"3079975","owner_display_name":"","owner_user_id":"3079975","post_type_id":"1","score":"0","tags":"sql-server|textarea|line-breaks|maxlength|nvarchar","view_count":"23"} +{"id":"26054207","title":"Indicating a matrix element of an image by a color","body":"\u003cp\u003eI am trying to attach a color code to a specific element of a matrix. But unable to do so. Specifying the color should surface in the new image.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eI=imread('1.tif')\nJ=rgb2gray(I)\nM=imresize(J,[156 156])\nH=imread(M,M(120,134),'red')\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eKindly help. Thanks in advance.\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2014-09-26 07:25:41.787 UTC","last_activity_date":"2014-09-26 07:25:41.787 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4053821","post_type_id":"1","score":"0","tags":"matlab|image-processing","view_count":"35"} +{"id":"22555374","title":"android - java - WeakReferences with an ArrayList?","body":"\u003cp\u003eI know that with a \u003ccode\u003eWeakReference\u003c/code\u003e, if I make a \u003ccode\u003eWeakReference\u003c/code\u003e to something that unless there's a direct reference to it that it will be Garbage Collected with the next GC cycle. My question becomes, what if I make an \u003ccode\u003eArrayList\u003c/code\u003e of \u003ccode\u003eWeakReference\u003c/code\u003es?\u003c/p\u003e\n\n\u003cp\u003eFor example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eArrayList\u0026lt;WeakReference\u0026lt;String\u0026gt;\u0026gt; exArrayList;\nexArrayList = new ArrayList\u0026lt;WeakReference\u0026lt;String\u0026gt;\u0026gt;();\nexArrayList.add(new WeakReference\u0026lt;String\u0026gt;(\"Hello\"));\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI can now access the data with \u003ccode\u003eexArrayList.get(0).get()\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eMy question becomes: This is \u003ccode\u003eWeakReference\u003c/code\u003e data, will the data located at \u003ccode\u003eexArrayList.get(0)\u003c/code\u003e be GC'd with the next GC cycle? (even IF I don't make another direct reference to it) or will this particular reference stick around until the \u003ccode\u003earraylist\u003c/code\u003e is emptied? (eg: \u003ccode\u003eexArrayList.clear();\u003c/code\u003e).\u003c/p\u003e\n\n\u003cp\u003eIf this is a duplicate I haven't found it with my keywords in google.\u003c/p\u003e","accepted_answer_id":"22555511","answer_count":"3","comment_count":"0","creation_date":"2014-03-21 09:52:13.503 UTC","favorite_count":"2","last_activity_date":"2017-03-22 20:15:06.9 UTC","last_edit_date":"2014-12-11 11:25:25.45 UTC","last_editor_display_name":"","last_editor_user_id":"1820501","owner_display_name":"","owner_user_id":"2495477","post_type_id":"1","score":"8","tags":"java|android|arraylist|garbage-collection|weak-references","view_count":"7725"} +{"id":"35485448","title":"Creating a recursive BuildUpAll method in a base class not filling out all the dependency properties","body":"\u003cp\u003eI am using Unity for my dependency injection and have a rather large class structure with each level inheriting from a base class. For various reasons I am using the dependency properties feature of Unity and am trying to create a single method that will go down through the structure and build up all the objects without me having to manually manage that code anymore. My base class looks like this so far\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class Base\n{\n [Dependency]\n public IEventAggregator EventAggregator { get; set; }\n\n [Dependency]\n public ILoggerFacade LoggerFacade { get; set; }\n\n public void BuildUpDependencies(IUnityContainer container)\n {\n var currentType = this.GetType();\n\n container.BuildUp(this);\n\n PropertyInfo[] properties = currentType.GetProperties();\n\n foreach (var propertyInfo in properties)\n {\n var propertyType = propertyInfo.PropertyType;\n\n\n // if property type is part go one level further down unless it has an attribute of GetValidationMessagesIgnore\n if (TypeContainsBaseType(propertyType, typeof(Base)))\n {\n ((Base)propertyInfo.GetValue(this)).BuildUpDependencies(container);\n }\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis works great for building up the 2 dependencies that are inherited by all the classes, this does not build up any dependencies that are not in the base class though. i.e.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class InterestingClass : Base\n{\n [Dependency]\n public IRegionManager RegionManager { get; set; }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ein this case the InterestingClass would have the 2 base dependencies built up, but the RegionManager would remain null.\u003c/p\u003e\n\n\u003cp\u003eI believe it is because in the BuildUpDependencies method the 'this' that is being passed is of type Base and not of type InterestingClass but I am not sure how to ensure the derived class type is passed to the BuildUp method. Is there an easier way to do this? How can I pass the correct type to BuildUp to get it to BuildUp all the correct dependencies?\u003c/p\u003e","accepted_answer_id":"35486225","answer_count":"1","comment_count":"0","creation_date":"2016-02-18 15:21:33.12 UTC","last_activity_date":"2016-02-18 15:55:09.32 UTC","last_edit_date":"2016-02-18 15:53:26.947 UTC","last_editor_display_name":"","last_editor_user_id":"455492","owner_display_name":"","owner_user_id":"455492","post_type_id":"1","score":"1","tags":"c#|unity-container","view_count":"47"} +{"id":"21583493","title":"Rewrite Rule - Remove numbers after forward slash","body":"\u003cp\u003eI have a bunch of 404 links, close to 500 resulting from a link looking like:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://www.domain.com/component/k2/item/192-file-sharing-options-to-consider.html\" rel=\"nofollow\"\u003ehttp://www.domain.com/component/k2/item/192-file-sharing-options-to-consider.html\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThe link needs to be shown as follows, except the ID 192 and portion after is an ALIAS for a blog item.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://www.domain.com/component/k2/item/file-sharing-options-to-consider.html\" rel=\"nofollow\"\u003ehttp://www.domain.com/component/k2/item/file-sharing-options-to-consider.html\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eWe essentially need to remove the '192-' from the link, and have this happen to all blog links (the number can be anything from 1, 2, or 3 digits)\u003c/p\u003e\n\n\u003cp\u003eI've tried something of this sorts\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e RewriteCond /component/k2/item/\n RewriteRule ^([0-9]+)$ /component/k2/item/$1\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI know this may not be proper, but I am slowly trying to learn how this all works.\u003c/p\u003e\n\n\u003cp\u003eAlso /component/k2/item/ can be found as /blog/item/ in some links\u003c/p\u003e\n\n\u003cp\u003eUpdated for htaccess:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e ##\n # @version $Id: htaccess.txt 21064 2011-04-03 22:12:19Z dextercowley $\n # @package Joomla\n # @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.\n # @license http://www.gnu.org/copyleft/gpl.html GNU/GPL\n # Joomla! is Free Software\n ##\n\n\n #####################################################\n # READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE\n #\n # The line just below this section: 'Options +FollowSymLinks' may cause problems\n # with some server configurations. It is required for use of mod_rewrite, but may already\n # be set by your server administrator in a way that dissallows changing it in\n # your .htaccess file. If using it causes your server to error out, comment it out (add # to\n # beginning of line), reload your site in your browser and test your sef url's. If they work,\n # it has been set by your server administrator and you do not need it set here.\n #\n #####################################################\n\n ## Can be commented out if causes errors, see notes above.\n Options +FollowSymLinks\n\n #\n # mod_rewrite in use\n\n RewriteEngine On\n\n ########## Begin - Rewrite rules to block out some common exploits\n ## If you experience problems on your site block out the operations listed below\n ## This attempts to block the most common type of exploit `attempts` to Joomla!\n #\n ## Deny access to extension xml files (uncomment out to activate)\n #\u0026lt;Files ~ \"\\.xml$\"\u0026gt;\n #Order allow,deny\n #Deny from all\n #Satisfy all\n #\u0026lt;/Files\u0026gt;\n ## End of deny access to extension xml files\n # Block out any script trying to set a mosConfig value through the URL\n RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\\%3D) [OR]\n # Block out any script trying to base64_encode data within the URL\n RewriteCond %{QUERY_STRING} base64_encode[^(]*\\([^)]*\\) [OR]\n # Block out any script that includes a \u0026lt;script\u0026gt; tag in URL\n RewriteCond %{QUERY_STRING} (\u0026lt;|%3C)([^s]*s)+cript.*(\u0026gt;|%3E) [NC,OR]\n # Block out any script trying to set a PHP GLOBALS variable via URL\n RewriteCond %{QUERY_STRING} GLOBALS(=|\\[|\\%[0-9A-Z]{0,2}) [OR]\n # Block out any script trying to modify a _REQUEST variable via URL\n RewriteCond %{QUERY_STRING} _REQUEST(=|\\[|\\%[0-9A-Z]{0,2})\n # Return 403 Forbidden header and show the content of the root homepage\n RewriteRule .* index.php [F]\n #\n ########## End - Rewrite rules to block out some common exploits\n\n\n ########## Begin - Custom redirects\n #\n # If you need to redirect some pages, or set a canonical non-www to\n # www redirect (or vice versa), place that code here. Ensure those\n # redirects use the correct RewriteRule syntax and the [R=301,L] flags.\n #\n #K2 to new blog plugin redirect\n\n #Strips blog ID- from URL and rewrites to blog/item\n RewriteRule ^(component/k2/item)/[0-9]+-(.+)$ /$1/$2 [L,NC]\n Redirect /component/k2/item/ http://www.managemyitinc.com/blog/item/\n\n redirect 301 /blog/entry/ http://www.managemyitinc.com/blog/item/\n redirect 301 /blog/categories/listings/ http://www.managemyitinc.com /blog/categories/categories/listings/\n\n #Non www to www\n RewriteCond %{HTTP_HOST} ^managemyitinc.com$\n RewriteRule (.*) http://www.managemyitinc.com/$1 [R=301,L] \n\n ########## End - Custom redirects\n\n\n # Uncomment following line if your webserver's URL\n # is not directly related to physical file paths.\n # Update Your Joomla! Directory (just / for root)\n\n # RewriteBase /\n\n\n ########## Begin - Joomla! core SEF Section\n #\n RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]\n #\n # If the requested path and file is not /index.php and the request\n # has not already been internally rewritten to the index.php script\n RewriteCond %{REQUEST_URI} !^/index\\.php\n # and the request is for root, or for an extensionless URL, or the\n # requested URL ends with one of the listed extensions\n RewriteCond %{REQUEST_URI} (/[^.]*|\\.(php|html?|feed|pdf|raw))$ [NC]\n # and the requested path and file doesn't directly match a physical file\n RewriteCond %{REQUEST_FILENAME} !-f\n # and the requested path and file doesn't directly match a physical folder\n RewriteCond %{REQUEST_FILENAME} !-d\n # internally rewrite the request to the index.php script\n RewriteRule .* index.php [L]\n #\n ########## End - Joomla! core SEF Section\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"21583543","answer_count":"1","comment_count":"0","creation_date":"2014-02-05 16:55:49.66 UTC","last_activity_date":"2014-02-05 17:16:23.973 UTC","last_edit_date":"2014-02-05 17:16:23.973 UTC","last_editor_display_name":"","last_editor_user_id":"1890315","owner_display_name":"","owner_user_id":"1890315","post_type_id":"1","score":"1","tags":".htaccess|rewrite","view_count":"803"} +{"id":"12612752","title":"How do you add GPUImage to an iOS project?","body":"\u003cp\u003eI am trying to make a camera/photo app that will add a filter on an image. I have heard of Brad Larson's GPUImage and so I downloaded it and tried to manipulate it to be more familiar with the code.\u003c/p\u003e\n\n\u003cp\u003eNow, I made a new project in Xcode and added it on my frameworks, but i don't have any idea how to use it on a new project.\u003c/p\u003e\n\n\u003cp\u003eHow can I properly use GPUImage in my new project?\u003c/p\u003e","accepted_answer_id":"12641025","answer_count":"3","comment_count":"1","creation_date":"2012-09-27 01:19:26.327 UTC","favorite_count":"1","last_activity_date":"2015-08-20 05:43:08.9 UTC","last_edit_date":"2012-09-28 13:32:58.893 UTC","last_editor_display_name":"","last_editor_user_id":"19679","owner_display_name":"","owner_user_id":"1676707","post_type_id":"1","score":"5","tags":"objective-c|ios|gpuimage","view_count":"11150"} +{"id":"3985828","title":"Calculating Timespan using asp.net","body":"\u003cblockquote\u003e\n \u003cp\u003e\u003cstrong\u003ePossible Duplicate:\u003c/strong\u003e\u003cbr\u003e\n \u003ca href=\"https://stackoverflow.com/questions/11/how-do-i-calculate-relative-time\"\u003eHow do I calculate relative time?\u003c/a\u003e \u003c/p\u003e\n\u003c/blockquote\u003e\n\n\n\n\u003cp\u003eI would like to use asp.net c# to calculate the timespan for when a file was uploaded. Example, if i uploaded a file two weeks ago my text will say 'uploaded 2 weeks ago' or if i have upload a file 4 month's ago my text will say 'uploaded 4 months ago'\u003c/p\u003e\n\n\u003cp\u003eCan anyone please give me some tips on how i can go about this.\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2010-10-21 09:04:09.433 UTC","last_activity_date":"2010-10-21 09:13:50.767 UTC","last_edit_date":"2017-05-23 10:24:12.543 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"439525","post_type_id":"1","score":"2","tags":"c#|asp.net|.net-3.5","view_count":"2243"} +{"id":"27783554","title":"MSSQL subquery result to show and calculate","body":"\u003cp\u003eI need show a subquery result and use this same result to calculate other value, is possible set this value in a variable in MS SQL 2008 or something like this?\nexemple:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT\n @test = (SELECT COUNT(*) FROM [tableTest] WHERE [tableTest].[columnA] = [tableA].[columnA]) as 'Counter'\n , (@test * 50) as 'Calc'\n , [tableA].[columnA]\nFROM tableA\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"27783708","answer_count":"4","comment_count":"0","creation_date":"2015-01-05 16:18:38.39 UTC","last_activity_date":"2015-01-05 17:32:24.483 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3465907","post_type_id":"1","score":"-1","tags":"sql-server|subquery","view_count":"95"} +{"id":"41459329","title":"intel xdk browsertab - fails","body":"\u003cp\u003eOur main project relies heavily on popups. Now it must come into an \"app-wrapper\" for android and ios. Besides the popups it runs well on mobile devices.\nThe popups must open inside the app and not in main browser. They must also open separately from 'opener' - opener must persist until the popup is closed.\u003c/p\u003e\n\n\u003cp\u003eI am using intel XDK. Inappbrowser is installed as normal plugin, browsertabs is installed as third-party plugin from npm repository.\u003c/p\u003e\n\n\u003cp\u003eSolutions that work partially are:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eiframe - displays content, does not help to manage popups and is not recognized by humans as something \"different\" from the main app.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://cordova.apache.org/docs/en/3.0.0/cordova/inappbrowser/inappbrowser.html\" rel=\"nofollow noreferrer\"\u003einappbrowser\u003c/a\u003e delivers best results, but pop-ups are opened in same \"window\", which is not intended (they should open in something tab-like).\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eboth methods work:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003ecordova.InAppBrowser.open('\u003ca href=\"https://www.google.com\" rel=\"nofollow noreferrer\"\u003ehttps://www.google.com\u003c/a\u003e', '_blank');\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eand\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003ewindow.open('\u003ca href=\"https://www.google.com\" rel=\"nofollow noreferrer\"\u003ehttps://www.google.com\u003c/a\u003e', '_blank')\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eThe inappbrowser has an extension: \u003ca href=\"https://www.npmjs.com/package/cordova-plugin-browsertab\" rel=\"nofollow noreferrer\"\u003ebrowsertab\u003c/a\u003e. This would (probably) solve all our issues, however, I cannot get it to work properly. \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003ecordova.plugins.inappbrowsertab.openUrl('\u003ca href=\"https://www.google.com\" rel=\"nofollow noreferrer\"\u003ehttps://www.google.com\u003c/a\u003e');\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003edoes not give any results. The browsertabs is in the plugins folder of the project.\u003c/p\u003e\n\n\u003cp\u003eIf this info is not enough - tell me what I else is needed. I hope there is a solution.\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-01-04 08:31:28.697 UTC","last_activity_date":"2017-01-04 08:31:28.697 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1947239","post_type_id":"1","score":"0","tags":"node.js|cordova|intel|inappbrowser","view_count":"18"} +{"id":"24977375","title":"JTextArea.append() taking a few seconds","body":"\u003cp\u003eI know this is a dumb question, but I'm not sure what I can do. \nMy program is to simply send a message through some servers. My program also has a \"console\", which is just a JTextArea, to let the user know what's going on. For some weird reason, calling the append() method takes a few seconds. In fact, it doesn't actually append until the message has been sent through the servers. That's where I'm lost. At the same time I append, I also use System.out.println() to log, and the log is printed instantly in the console, whereas appending the JTextArea does not. The only reason I came up with was that maybe the gui thread is different than an action thread. I send this message at a click of a JButton:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esubmit.addActionListener(new ActionListener() {\n\n @Override\n public void actionPerformed(ActionEvent arg0) {\n console.append(\"Sending POST to GCM\\n\");\n System.out.println((String) textField.getSelectedItem());\n\n String apiKey = \"...\";\n Content content;\n\n try {\n content = createContent(\"test\");\n POST2GCM.post(apiKey, content);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAs you see, I append, then log. My log shows up instantly, but the append() doesn't show up until the POST2GCM.post(apiKey, content) method has ran.\u003c/p\u003e\n\n\u003cp\u003eCan someone explain why this is, and if there is any workaround?\u003c/p\u003e","accepted_answer_id":"24977385","answer_count":"1","comment_count":"0","creation_date":"2014-07-27 02:32:20.197 UTC","last_activity_date":"2014-07-27 02:34:32.387 UTC","last_edit_date":"2014-07-27 02:34:32.387 UTC","last_editor_display_name":"","last_editor_user_id":"522444","owner_display_name":"","owner_user_id":"2082169","post_type_id":"1","score":"1","tags":"java|swing|jframe|jtextarea","view_count":"51"} +{"id":"43500696","title":"Is there a word or term that encompasses all of \"Language\", \"Library\", \"Framework\", \"Platform\" etc.?","body":"\u003cp\u003eI'm trying to find a succinct word that describes all of these things used in software development (mostly for a resume but also for categorical purposes of a bunch of textbooks/resources I'm trying to organize). Pretty much just a word for something that is used as a part of your code/software. Could optionally also include development \"tools\" like IDEs, compilers, build automation, debuggers, etc.\u003c/p\u003e\n\n\u003cp\u003eSo it would be used to describe any of these: JavaScript (language), jQuery (library), Express.js (framework), Node.js (platform)\u003c/p\u003e\n\n\u003cp\u003e\"Technologies\" is sometimes used but I don't think it's a good choice. What else could you call them? Modules? Artifacts? Resources? \u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-04-19 16:00:24.043 UTC","last_activity_date":"2017-04-19 16:00:24.043 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7537545","post_type_id":"1","score":"1","tags":"documentation|terminology|term|vocabulary|branding","view_count":"16"} +{"id":"15258299","title":"Preload next and previous pages and fade in on cursor keys","body":"\u003cp\u003eI am seeing many websites implementing seamless browsing between pages and I am wanting to implement this on a number of my sites. I am using WordPress, but that doesn't really affect this as such. I've never gone down the route of using Javascript to load new pages so this is new terratory for me. However I believe HTML5 does have page preloading capabilities.\u003c/p\u003e\n\n\u003cp\u003eI am looking for the first page to fade in from a blank screen and preload the previous and next pages. The next or previous page will fade (or slide) in seamlessly having previously been preloaded when the visitor...\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eClicks on the prev or next links\u003c/li\u003e\n\u003cli\u003ePresses the left or right arrow keys\u003c/li\u003e\n\u003cli\u003eif on a tablet, mobile or other touch device swipe left or right\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eThe address bar should also show the next/previous page's url once loaded and browser history updated.\u003c/p\u003e\n\n\u003cp\u003eThe best implementation of this that I have seen is The Next Web- \u003ca href=\"http://thenextweb.com/\" rel=\"nofollow\"\u003ehttp://thenextweb.com/\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://thenextweb.com/voice/2012/10/31/welcome-to-the-next-web-reader-edition/\" rel=\"nofollow\"\u003eOn their announcement page\u003c/a\u003e they talked about this feature... \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eThanks to the brilliance of HTML5, readers can now browse the website\n with fewer refreshes and near instant switching between articles. Try\n it out, click the next button on this article or use…\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI don't want to reinvent the wheel. Is there a jQuery plugin or an easy way for me to achieve the above? \u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2013-03-06 21:20:27.017 UTC","last_activity_date":"2013-03-06 21:20:27.017 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"244825","post_type_id":"1","score":"0","tags":"jquery|html5","view_count":"167"} +{"id":"23537621","title":"Unable to to set the italic property of the font class","body":"\u003cp\u003eI have this code written under a command button, the sheet is protected. The command button acts as a reset button and deletes data from many cells and changes font property. Here is the code:\nThe ranges that I am changing using this button are already added to exception\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eRange(\"C10:c18\") = \"\"\nRange(\"C20:c24\") = \"\"\nRange(\"c5:c6\") = \"_\"\nRange(\"c11:c12\") = \"Optional\"\nWith Range(\"c11:c12\")\n With .Font\n .Italic = True '\"Line 1\"\n .ColorIndex = 48 '\"Line 2\" \n End With\nEnd With\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt throws the VBA Error: Unable to to set the italic property of the font class for line 1 and\u003c/p\u003e\n\n\u003cp\u003eApplication defined or object defined error for line 2\u003c/p\u003e","accepted_answer_id":"23537698","answer_count":"1","comment_count":"1","creation_date":"2014-05-08 09:19:13.087 UTC","last_activity_date":"2014-05-08 09:22:39.037 UTC","last_edit_date":"2014-05-08 09:19:32.107 UTC","last_editor_display_name":"","last_editor_user_id":"3067523","owner_display_name":"","owner_user_id":"3355501","post_type_id":"1","score":"1","tags":"excel|vba|excel-vba","view_count":"602"} +{"id":"39842158","title":"Is there anyway to link to your homepage without the index (somesite.com vs somesite.com/index)?","body":"\u003cp\u003eI uploaded a site, and I'm trying to get the links to redirect to somesite.com instead of somesite.com/index. I've tried putting blank spaces, but it seems to stay on the current page. Is there anyway to accomplish this without putting the full URL? \u003c/p\u003e","accepted_answer_id":"39842323","answer_count":"1","comment_count":"2","creation_date":"2016-10-03 23:49:17.407 UTC","favorite_count":"1","last_activity_date":"2016-10-04 00:11:16.8 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6407868","post_type_id":"1","score":"1","tags":"html","view_count":"49"} +{"id":"30553346","title":"Python - where to initialize a player inventory?","body":"\u003cp\u003eI'm having a bit of a problem in python. It's not with the syntax or anything like that but, I am making a text rpg. I have a save/load feature within the game using pickle. It works just fine. But the problem is when I load the game, the inventory variable is set back to what I defined it as in the \u003cstrong\u003einit\u003c/strong\u003e of the main class. its like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e class Main():\n def __init__(self):\n self.inventory = []\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand the load command is in the main class as well. But for some reason when I load the variables with pickle, it resets the inventory to whatever it is set as in the main class. How can I stop this?\u003c/p\u003e","answer_count":"0","comment_count":"5","creation_date":"2015-05-31 02:48:00.597 UTC","last_activity_date":"2015-05-31 02:48:00.597 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4957596","post_type_id":"1","score":"0","tags":"python|pickle","view_count":"46"} +{"id":"39507424","title":"ViewController with several behaviour models","body":"\u003cp\u003eAssume I have two viewcontrollers. On the first viewcontroller I need to select one of N options and depending on this option second viewcontroller has a different behaviour. In practice I can call same methods, but with different implementations, but I don't want to pass argument (enum) describing the current mode of viewcontroller in every method or making a switch everytime. What is the most relevant design solution for this case?\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2016-09-15 09:23:07.93 UTC","last_activity_date":"2016-09-15 11:24:28.9 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4113768","post_type_id":"1","score":"1","tags":"ios|design|architecture","view_count":"27"} +{"id":"37723325","title":"2d heat equation : TDMA solver","body":"\u003cp\u003eI am trying to solve a 2d transient heat equation using the 2d TDMA solver. However, i found difficulties in defining the field of temperature and implementing the solver.\nI used the following code (LBL function: line by line method) but it didn't work.\u003c/p\u003e\n\n\u003cp\u003eThank you in advance for your help.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evoid LBL (int n, int m, int n1, int m1,int m2,\n double dt, double dx, double dy,\n vector \u0026lt;double\u0026gt; \u0026amp;x, vector\u0026lt;double\u0026gt; \u0026amp;y,\n vector\u0026lt; vector\u0026lt;double\u0026gt; \u0026gt; \u0026amp;aw,\n vector\u0026lt; vector\u0026lt;double\u0026gt; \u0026gt; \u0026amp;b,\n vector\u0026lt; vector\u0026lt;double\u0026gt; \u0026gt; \u0026amp;ap,\n vector\u0026lt; vector\u0026lt;double\u0026gt; \u0026gt; \u0026amp;ae,\n vector\u0026lt; vector\u0026lt;double\u0026gt; \u0026gt; \u0026amp;an,\n vector\u0026lt; vector\u0026lt;double\u0026gt; \u0026gt; \u0026amp;as,\n vector\u0026lt; vector\u0026lt;double\u0026gt; \u0026gt; \u0026amp;ap0,\n vector\u0026lt; vector\u0026lt;double\u0026gt; \u0026gt; \u0026amp;P,\n vector\u0026lt; vector\u0026lt;double\u0026gt; \u0026gt; \u0026amp;Q,\n vector\u0026lt; vector\u0026lt;double\u0026gt; \u0026gt; \u0026amp;Td,\n vector\u0026lt; vector\u0026lt;double\u0026gt; \u0026gt; \u0026amp;d,\n vector\u0026lt; vector\u0026lt;double\u0026gt; \u0026gt; \u0026amp;T0)\n{\n double ERROR;\n double t=0;\n double r[n][m];\n\n for(int j=0; j\u0026lt;m; j++)\n {\n for(int i=0;i\u0026lt;n;i++)\n {\n d[i][j] =Tin;\n r[i][j]=Tin;\n T0[i][j]=Tin;\n }\n }\n\n int s=0;\n mi =100000;\n while (t\u0026lt;tm)\n {\n cout \u0026lt;\u0026lt; \" \\n t=\" \u0026lt;\u0026lt; t\u0026lt;\u0026lt;endl;\n /****************calculation of dij****************/\n bi(t,n,m,dx,dy,dt,ap0,T0,b);\n do\n {\n for (int j=0; j\u0026lt;m; j++)\n {\n for (int i=0; i\u0026lt;n; i++)\n {\n d[i][j] = an[i][j] * r[i][j+1] + as[i][j] * r[i][j-1] + b[i][j];\n }\n }\n\n MAXI= fabs(d[0][0]-r[0][0])/d[0][0];\n for ( int j =0; j \u0026lt; m; j++)\n {\n for(int i= 0; i\u0026lt;n; i++)\n {\n ERROR=fabs(d[i][j]-r[i][j])/d[i][j];\n if (MAXI \u0026lt; ERROR) MAXI =ERROR;\n\n }\n }\n cout \u0026lt;\u0026lt; \" \\n MAXI=\" \u0026lt;\u0026lt; MAXI\u0026lt;\u0026lt;endl;\n for ( int j =0; j \u0026lt; m; j++)\n {\n for(int i= 0; i\u0026lt;n; i++)\n {\n r[i][j]=d[i][j];\n }\n }\n\n s++;\n } while (MAXI\u0026gt;eps \u0026amp;\u0026amp; s\u0026lt;mi );\n\n /***********calculation tdma******************/\n for (int j=0; j\u0026lt;m; j++)\n {\n P[0][j]=ae[0][j]/ap[0][j];\n }\n for (int j=0; j\u0026lt;m; j++)\n {\n Q[0][j]=d[0][j]/ap[0][j];\n }\n\n for (int j=0; j\u0026lt;m; j++)\n {\n for(int i=1; i\u0026lt;n; i++)\n {\n P[i][j]=an[i][j]/(ap[i][j]- (aw[i][j]*P[i-1][j]));\n Q[i][j]= (d[i][j] + (aw[i][j]*Q[i-1][j]) ) / (ap[i][j]-(aw[i][j]*P[i-1][j]));\n }\n }\n\n for(int j =0; j\u0026lt;m; j++)\n {\n Td[n-1][j]=Q[n-1][j];\n }\n\n for(int j =0;j\u0026lt;m;j++)\n {\n for (int i=n-2; i\u0026gt;=0; i--)\n {\n Td[i][j]=P[i][j]*Td[i+1][j] + Q[i][j];\n }\n }\n\n for (int j=0; j\u0026lt;m; j++)\n {\n for (int i =0; i\u0026lt;n; i++)\n {\n T0[i][j] =Td[i][j];\n }\n }\n\n t+=dt;\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"5","creation_date":"2016-06-09 10:25:03.48 UTC","favorite_count":"1","last_activity_date":"2016-06-09 12:20:20.223 UTC","last_edit_date":"2016-06-09 12:20:20.223 UTC","last_editor_display_name":"","last_editor_user_id":"3233921","owner_display_name":"","owner_user_id":"6314122","post_type_id":"1","score":"0","tags":"c++|solver","view_count":"326"} +{"id":"37663548","title":"Center unknown (responsive) number of images that are floated","body":"\u003cp\u003eI am creating a list of employees, with their photos in a grid format (5 wide). As the number of employees fluctuates I need to be able to center floated elements that don't fill a whole row, without using a containing div for each row. I really feel like it's unlikely I'm the first to want to do this and is struggling, but every solution I've found is to create a container, or some suggest the \u003ccode\u003einline-block\u003c/code\u003e solution, however these images need to be flush, and as they are \u003ccode\u003e% width\u003c/code\u003e on some browsers some space can be visible between them, even with the \u003ccode\u003emargin-right: -4px\u003c/code\u003e solution; this is why I am depending on floats. Thanks!\u003c/p\u003e\n\n\u003cp\u003eWhat I have\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://pasteboard.co/1u9iCIRy.jpg\" rel=\"nofollow\"\u003ehttp://pasteboard.co/1u9iCIRy.jpg\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eWhat I want\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://pasteboard.co/1u9lKgCh.jpg\" rel=\"nofollow\"\u003ehttp://pasteboard.co/1u9lKgCh.jpg\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"37663791","answer_count":"2","comment_count":"5","creation_date":"2016-06-06 17:32:35.76 UTC","last_activity_date":"2016-06-06 17:54:33.697 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6194665","post_type_id":"1","score":"-1","tags":"css","view_count":"22"} +{"id":"47475585","title":"Checking that user input is an int (python)","body":"\u003cp\u003eHave been stuck on this for about an hour. Currently trying to teach myself Programming using Python. I am using a textbook for the programming stuff which walks me through pseudocode and then I attempt to convert this into python to learn the syntax. While to program runs and adds as it is supposed to, it will not print what I want it to if the user enters anything but an integer.\u003c/p\u003e\n\n\u003cp\u003ePseudocode I am looking at:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e1 Declare Count As Integer \n2 Declare Sum As Integer \n3 Declare Number As Float \n4 Set Sum = 0 \n5 For (Count = 1; Count \u0026lt;=10; Count++) \n6 Write “Enter an integer: “ \n7 Input Number \n8 If Number != Int(Number) Then\n9 Write “Your entry is not an integer.” \n10 Write “The summation has ended.” \n11 Exit For \n12 Else \n13 Set Sum = Sum + Number \n14 End If \n15 End For \n16 Write “The sum of your numbers is: “ + Sum\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is the code i have written to this point:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esum = 0\nfor count in range(0, 10):\n number = int(input(\"Write an integer: \"))\n if number != int(number):\n print (\"Your entry is not an integer.\")\n print (\"The summation has ended.\")\n break\n else:\n sum = sum + number\n continue\nprint(\"The sum of your numbers is: \" + str(sum))\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"47475641","answer_count":"2","comment_count":"2","creation_date":"2017-11-24 14:46:38.64 UTC","favorite_count":"1","last_activity_date":"2017-11-24 21:27:58.567 UTC","last_edit_date":"2017-11-24 21:27:58.567 UTC","last_editor_display_name":"","last_editor_user_id":"4889267","owner_display_name":"","owner_user_id":"9003974","post_type_id":"1","score":"2","tags":"python|python-3.x|loops","view_count":"38"} +{"id":"5332715","title":"How do I render a Dundas bar chart from most to least?","body":"\u003cp\u003eHow does one order the bar chart series to render from most to least? Ordering the data before binding does not seem to help.\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/rCKab.png\" alt=\"bar chart that that is rendering least to most\"\u003e\u003c/p\u003e\n\n\u003cp\u003eMy code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003echart.Series.Add(\"port\");\nchart.Series[\"port\"].Type = SeriesChartType.Bar;\nchart.Series[\"port\"][\"PointWidth\"] = \"0.6\";\nchart.Series[\"port\"][\"BarLabelStyle\"] = \"Center\";\nchart.Series[\"port\"].ShowLabelAsValue = true;\nchart.Series[\"port\"].Points.DataBind(myData, \"Key\", \"Value\", \"Label=Value{p2}\");\nchart.Series[\"port\"].BorderStyle = ChartDashStyle.Solid;\nchart.Series[\"port\"].BorderColor = Color.White;\nchart.Series[\"port\"].BorderWidth = 1;\nchart.Series[\"port\"].ShowLabelAsValue = true;\nchart.Series[\"port\"].Font = myfont;\n\nchart.ChartAreas.Add(\"Default\");\nchart.ChartAreas[\"Default\"].BackColor = Color.Transparent;\nforeach (var axis in chart.ChartAreas[\"Default\"].Axes)\n{\n axis.LabelStyle.Font = myfont;\n axis.MajorGrid.Enabled = false;\n}\nchart.ChartAreas[\"Default\"].AxisX.Interval = 1;\nchart.ChartAreas[\"Default\"].AxisY.LabelStyle.Format = \"p0\";\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"5367297","answer_count":"1","comment_count":"2","creation_date":"2011-03-16 22:39:56.023 UTC","last_activity_date":"2011-03-20 07:39:36.313 UTC","last_edit_date":"2011-03-18 14:59:32.11 UTC","last_editor_display_name":"","last_editor_user_id":"8088","owner_display_name":"","owner_user_id":"8088","post_type_id":"1","score":"0","tags":"mschart|dundas","view_count":"1247"} +{"id":"28891750","title":"android sqlite foreign key update fails","body":"\u003cp\u003eI wonder if someone has stumbled upon strange behavior of sqlite foreign keys.\u003c/p\u003e\n\n\u003cp\u003eMy problems occurs when I update a key variant (parcours_id) that points to another tables primary key parcours (eid) and is declared a foreign key. \u003c/p\u003e\n\n\u003cp\u003eThe involved tables are: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCREATE TABLE parcours(\n eid character varying(36) PRIMARY KEY,\n name character varying(50),\n comment text,\n location_id character varying(36),\n owner_id character varying(36),\n change_id integer NOT NULL,\n change_flag smallint NOT NULL DEFAULT 1,\n CONSTRAINT fk_location_id FOREIGN KEY (location_id)\n REFERENCES location (eid) \n ON UPDATE CASCADE \n ON DELETE RESTRICT\n)\n\n\n\nCREATE TABLE variant (\n eid character varying(36) PRIMARY KEY,\n parcours_id character varying(36) NOT NULL,\n name character varying(50),\n comment text,\n created TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,\n active smallint NOT NULL DEFAULT 1,\n selected smallint NOT NULL DEFAULT 0,\n tgt_count integer NOT NULL,\n owner_id character varying(36) \n DEFAULT '687baa6e-556f-43f2-897a-f1dfb371541a',\n change_id integer NOT NULL,\n change_flag smallint NOT NULL DEFAULT 1,\n CONSTRAINT fk_parcours_id FOREIGN KEY (parcours_id)\n REFERENCES parcours (eid) \n ON UPDATE CASCADE \n ON DELETE RESTRICT \n)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe foreign key relationship from of variant( parcours_id ) to parcours( eid ) works perfectly on insert but fails on update with \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eandroid.database.sqlite.SQLiteException: foreign key mismatch: , while compiling: UPDATE variant SET parcours_id=?,name=?,comment=?,created=?,active=?,selected=?,tgt_count=?,owner_id=?,change_id=?,change_flag=? WHERE eid=?\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow this problem is slightly philosophical because at this point I do not need to update the key variant (parcours_id) because it has not changed. I decided to implement the update funtion only once allways updating all fields except for the primary key. Generally I do not expect the problematic value to ever change so I could just leave it out of the update. \u003c/p\u003e\n\n\u003cp\u003eIt looks to me like my implemention is ok, because if I disable foreign keys on the database without changing anything else it works, the foreign key is updated correctly and the integrity of the database is intact after the update. \u003c/p\u003e\n\n\u003cp\u003eTo me this proves that the problem is not caused by my implementation but seems to be a general misunderstanding of how sqlite handles foreigng key updates. \u003c/p\u003e\n\n\u003cp\u003eAny suggestions ?\u003c/p\u003e\n\n\u003cp\u003eEDIT:\nAfter removing the key variant( parcours_id) from the update I still get an SQLITE exception: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eandroid.database.sqlite.SQLiteConstraintException: error code 19: constraint failed\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe SQL Statement is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eUPDATE variant SET name=?,comment=?,created=?,active=?,selected=?,tgt_count=?,owner_id=?,change_id=?,change_flag=? WHERE eid=?\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-03-06 03:07:27.987 UTC","last_activity_date":"2015-03-06 07:28:46.84 UTC","last_edit_date":"2015-03-06 03:30:40.11 UTC","last_editor_display_name":"","last_editor_user_id":"4608865","owner_display_name":"","owner_user_id":"4608865","post_type_id":"1","score":"1","tags":"android|database|sqlite","view_count":"621"} +{"id":"36981089","title":"Users cannot update/install my app from Google Play(error -505)!","body":"\u003cp\u003eI uploaded an update to Google Play and it seems many people cannot update or reinstall. When they try to update, they get error something with number \u003ccode\u003e4\u003c/code\u003e, if they try to clean install it, they get error \u003ccode\u003e-505\u003c/code\u003e. I just tried it on emulator and it worked fine, what the heck? Many people report an error. What is wrong?\u003c/p\u003e","answer_count":"2","comment_count":"3","creation_date":"2016-05-02 11:13:54.287 UTC","last_activity_date":"2016-05-02 11:35:46.973 UTC","last_edit_date":"2016-05-02 11:17:04.197 UTC","last_editor_display_name":"","last_editor_user_id":"1711809","owner_display_name":"","owner_user_id":"1711809","post_type_id":"1","score":"0","tags":"android|google-play|apk|updates","view_count":"533"} +{"id":"39377809","title":"How to integrate Mustache template engine into Phalcon PHP application?","body":"\u003cp\u003eHow to integrate Mustache template engine into Phalcon PHP 3 application to use it instead of built-in volt?\u003c/p\u003e","accepted_answer_id":"39383644","answer_count":"2","comment_count":"0","creation_date":"2016-09-07 19:37:58.727 UTC","last_activity_date":"2016-09-08 08:05:09.193 UTC","last_edit_date":"2016-09-08 08:05:09.193 UTC","last_editor_display_name":"","last_editor_user_id":"905439","owner_display_name":"","owner_user_id":"905439","post_type_id":"1","score":"0","tags":"mustache|phalcon","view_count":"67"} +{"id":"8439438","title":"TTURLNavigation: Is it efficient?","body":"\u003cp\u003eSo I'm having a hard time wrapping my head around TTURLNavigation from the three20 framework. \u003c/p\u003e\n\n\u003cp\u003eAre the views being pushed onto a stack? I don't understand how one could just jump around an application without pushing and poping. I feel like if i just keep jumping to urls I am constantly pushing views onto my stack. \u003c/p\u003e\n\n\u003cp\u003eHow exactly does TTURLNavigation accomplish this. \u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2011-12-09 00:04:04.507 UTC","last_activity_date":"2011-12-09 00:04:04.507 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"373722","post_type_id":"1","score":"1","tags":"iphone|ios|three20","view_count":"34"} +{"id":"32017321","title":"My mail server using IRedMail (postfix, dovecot, etc.) is only sending and receiving local emails?","body":"\u003cp\u003eI recently set up a mail server using IRedMail on a home server running Debian 8, using OpenLDAP, nginx in the installer. We got everything set up and configured to where we can access our mail server with roundcube (which I can access through mail.sterango.com) and Thunderbird and login to accounts just fine. We can send emails to and from accounts that are on the domain (seb@sterango.com can send and receive from postmaster@smail.sterango.com), but I am not able to send or recieve email with either of these accounts from outside sources such as my gmail account.\nHere is my main.cf\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e# See /usr/share/postfix/main.cf.dist for a commented, more complete version\n\n\n# Debian specific: Specifying a file name will cause the first\n# line of that file to be used as the name. The Debian default\n# is /etc/mailname.\n#myorigin = /etc/mailname\n\nsmtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)\nbiff = no\n\n# appending .domain is the MUA's job.\nappend_dot_mydomain = no\n\n# Uncomment the next line to generate \"delayed mail\" warnings\n#delay_warning_time = 4h\n\nreadme_directory = no\n\n# TLS parameters\nsmtpd_tls_cert_file = /etc/ssl/certs/iRedMail.crt\nsmtpd_tls_key_file = /etc/ssl/private/iRedMail.key\nsmtpd_use_tls=yes\nsmtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache\nsmtp_tls_session_cache_database = btree:${data_directory}/smtp_scache\n\n# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for\n# information on enabling SSL in the smtp client.\n\nsmtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination\nmyhostname = mail.sterango.com\nalias_maps = hash:/etc/postfix/aliases\nalias_database = hash:/etc/postfix/aliases\nmyorigin = mail.sterango.com\nmydestination = \nrelayhost = \nmynetworks = 127.0.0.1\nmailbox_command = /usr/lib/dovecot/deliver\nmailbox_size_limit = 0\nrecipient_delimiter = +\ninet_interfaces = loopback-only\ntransport_maps = proxy:mysql:/etc/postfix/mysql/transport_maps_user.cf, proxy:mysql:/etc/postfix/mysql/transport_maps_domain.cf\ninet_protocols = ipv4\nvirtual_alias_domains = \nmydomain = mail.sterango.com\nallow_percent_hack = no\nswap_bangpath = no\nmynetworks_style = host\nsmtpd_data_restrictions = reject_unauth_pipelining\nsmtpd_reject_unlisted_recipient = yes\nsmtpd_reject_unlisted_sender = yes\nsmtpd_tls_protocols = !SSLv2 !SSLv3\nsmtp_tls_protocols = !SSLv2 !SSLv3\nlmtp_tls_protocols = !SSLv2 !SSLv3\nsmtpd_tls_mandatory_protocols = !SSLv2 !SSLv3\nsmtp_tls_mandatory_protocols = !SSLv2 !SSLv3\nlmtp_tls_mandatory_protocols = !SSLv2 !SSLv3\nsmtpd_tls_mandatory_exclude_ciphers = aNULL, eNULL, EXPORT, DES, RC4, MD5, PSK, aECDH, EDH-DSS-DES-CBC3-SHA, EDH-RSA-DES-CDC3-SHA, KRB5-DE5, CBC3-SHA\nsmtpd_tls_dh1024_param_file = /etc/ssl/dhparams.pem\nsmtp_tls_security_level = may\nsmtp_tls_CAfile = $smtpd_tls_CAfile\nsmtp_tls_loglevel = 0\nsmtp_tls_note_starttls_offer = yes\nsmtpd_sender_restrictions = reject_unknown_sender_domain, reject_non_fqdn_sender, reject_unlisted_sender, permit_mynetworks, reject_sender_login_mismatch, permit_sasl_authenticated\ndelay_warning_time = 0h\nmaximal_queue_lifetime = 4h\nbounce_queue_lifetime = 4h\nproxy_read_maps = $canonical_maps $lmtp_generic_maps $local_recipient_maps $mydestination $mynetworks $recipient_bcc_maps $recipient_canonical_maps $relay_domains $relay_recipient_maps $relocated_maps $sender_bcc_maps $sender_canonical_maps $smtp_generic_maps $smtpd_sender_login_maps $transport_maps $virtual_alias_domains $virtual_alias_maps $virtual_mailbox_domains $virtual_mailbox_maps $smtpd_sender_restrictions\nsmtp_data_init_timeout = 240s\nsmtp_data_xfer_timeout = 600s\nsmtpd_helo_required = yes\nsmtpd_helo_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_non_fqdn_helo_hostname, reject_invalid_helo_hostname, check_helo_access pcre:/etc/postfix/helo_access.pcre\nqueue_run_delay = 300s\nminimal_backoff_time = 300s\nmaximal_backoff_time = 4000s\nenable_original_recipient = no\ndisable_vrfy_command = yes\nhome_mailbox = Maildir/\nallow_min_user = no\nmessage_size_limit = 15728640\nvirtual_minimum_uid = 2000\nvirtual_uid_maps = static:2000\nvirtual_gid_maps = static:2000\nvirtual_mailbox_base = /var/vmail\nvirtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql/virtual_mailbox_domains.cf\nvirtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql/virtual_mailbox_maps.cf\nvirtual_alias_maps = proxy:mysql:/etc/postfix/mysql/virtual_alias_maps.cf, proxy:mysql:/etc/postfix/mysql/domain_alias_maps.cf, proxy:mysql:/etc/postfix/mysql/catchall_maps.cf, proxy:mysql:/etc/postfix/mysql/domain_alias_catchall_maps.cf\nsender_bcc_maps = proxy:mysql:/etc/postfix/mysql/sender_bcc_maps_user.cf, proxy:mysql:/etc/postfix/mysql/sender_bcc_maps_domain.cf\nrecipient_bcc_maps = proxy:mysql:/etc/postfix/mysql/recipient_bcc_maps_user.cf, proxy:mysql:/etc/postfix/mysql/recipient_bcc_maps_domain.cf\nrelay_domains = $mydestination, proxy:mysql:/etc/postfix/mysql/relay_domains.cf\nsmtpd_sender_login_maps = proxy:mysql:/etc/postfix/mysql/sender_login_maps.cf\nsmtpd_sasl_auth_enable = yes\nsmtpd_sasl_local_domain = \nbroken_sasl_auth_clients = yes\nsmtpd_sasl_security_options = noanonymous\nsmtpd_tls_auth_only = yes\nsmtpd_recipient_restrictions = reject_unknown_recipient_domain, reject_non_fqdn_recipient, reject_unlisted_recipient, check_policy_service inet:127.0.0.1:7777, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination\nsmtpd_tls_security_level = may\nsmtpd_tls_loglevel = 0\nsmtpd_tls_CAfile = /etc/ssl/certs/iRedMail.crt\ntls_random_source = dev:/dev/urandom\nvirtual_transport = dovecot\ndovecot_destination_recipient_limit = 1\nsmtpd_sasl_type = dovecot\nsmtpd_sasl_path = private/dovecot-auth\ncontent_filter = smtp-amavis:[127.0.0.1]:10024\nsmtp-amavis_destination_recipient_limit = 1\ndefault_transport = smtp\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAlso here are my DNS records: \u003ca href=\"http://i.imgur.com/gR2LAIZ.png\" rel=\"nofollow\"\u003ehttp://i.imgur.com/gR2LAIZ.png\u003c/a\u003e\nShould the A one point to a local IP like that? \nI will also gladly post any logs or files. Thanks!\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-08-14 19:20:15.813 UTC","last_activity_date":"2016-10-06 14:39:10.17 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5113523","post_type_id":"1","score":"-1","tags":"email|nginx|dns|debian|postfix-mta","view_count":"1287"} +{"id":"20824901","title":"GridView: getCheckedItemPositions() return no values or wrong values","body":"\u003cp\u003eI implemented a gallery with a Grid View that includes check boxes but i have problems with getCheckedItemPositions() method. \u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003e(1)\u003c/strong\u003e If i launch the Activity with GridView, select some items and ask which items have been selected, the method getCheckedItemPositions() doesn't return any value. \u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003e(2)\u003c/strong\u003e If i launch another Activity, i return to Activity with the GridView and ask what items have been selected, the method getCheckedItemPositions() returns wrong values .\u003c/p\u003e\n\n\u003cp\u003eI think first of all that the implementation of getView() is wrong, for (1) probably the GridView doesn't know which items are selected. I have no ideas for the (2) instead. \u003c/p\u003e\n\n\u003cp\u003eHere the code:\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eGalleryFragment getCheckedItemOnGridView()\u003c/strong\u003e: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate void getCheckedItemOnGridView() {\n if(D) Log.d(TAG, \"getCheckedItemOnGridView(): called\");\n SparseBooleanArray checkedItemPositions = mGalleryGridView.getCheckedItemPositions();\n for (int i=0 ; i\u0026lt;checkedItemPositions.size() ; i++) {\n if(D) Log.d(TAG, \"checkedItemPositions : \" + checkedItemPositions.valueAt(i) + \" index \" + checkedItemPositions.keyAt(i));\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eAdapter extends BaseAdapter getView():\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate SparseBooleanArray checked;\n\npublic View getView(final int position, View convertView, ViewGroup parent) {\n if(D) Log.d(TAG, \"Called: getView\");\n ViewHolder holder;\n\n if (convertView == null) {\n convertView = mLayoutInflater.inflate(R.layout.listitem_gallery, null);\n\n holder = new ViewHolder();\n holder.thumbnailView = (ImageView) convertView.findViewById(R.id.imageview_thumbnail);\n holder.checkBoxView = (CheckBox) convertView.findViewById(R.id.checkbox);\n\n holder.checkBoxView.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n if (((CheckBox) view).isChecked()) {\n checked.put((Integer) view.getTag(), true);\n\n } else {\n checked.put((Integer) view.getTag(), false);\n }\n }\n });\n\n convertView.setTag(holder);\n } else {\n holder = (ViewHolder) convertView.getTag();\n }\n\n BitmapFileImageLoader bitmapLoader = new BitmapFileImageLoader();\n bitmapLoader.loadBitmap(getItem(position), holder.thumbnailView);\n\n holder.checkBoxView.setTag(position);\n holder.checkBoxView.setChecked(checked.get(position));\n\n return convertView;\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"20829571","answer_count":"2","comment_count":"1","creation_date":"2013-12-29 11:54:58.817 UTC","favorite_count":"1","last_activity_date":"2013-12-29 20:12:08.897 UTC","last_editor_display_name":"","owner_display_name":"user2523485","post_type_id":"1","score":"1","tags":"android|gridview|checkbox","view_count":"974"} +{"id":"3354626","title":"Metal shading (like silver) on iphone opengl?","body":"\u003cp\u003eDoes anyone know a tutorial hat explains how to shade an object to look like \nsilver metal? (on iphone)?\nMaybe starting with a spere like in this:\n\u003ca href=\"http://iphonedevelopment.blogspot.com/2009/05/opengl-es-from-ground-up-part-5-living.html\" rel=\"nofollow noreferrer\"\u003ehttp://iphonedevelopment.blogspot.com/2009/05/opengl-es-from-ground-up-part-5-living.html\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eOr can this not be accomplished without the new shaders in 2.0?\u003c/p\u003e\n\n\u003cp\u003eThanks\nSebastian \u003c/p\u003e","accepted_answer_id":"3403856","answer_count":"2","comment_count":"0","creation_date":"2010-07-28 15:41:21.453 UTC","last_activity_date":"2010-08-04 08:35:38.66 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"134213","post_type_id":"1","score":"0","tags":"iphone|opengl-es","view_count":"909"} +{"id":"1185117","title":"Should I use thread local storage for variables that only exist in a {class,method}?","body":"\u003cp\u003eI am implementing a relatively simple thread pool with Python's \u003ccode\u003eQueue.Queue\u003c/code\u003e class. I have one producer class that contains the \u003ccode\u003eQueue\u003c/code\u003e instance along with some convenience methods, along with a consumer class that subclasses \u003ccode\u003ethreading.Thread\u003c/code\u003e. I instantiate that object for every thread I want in my pool (\"worker threads,\" I think they're called) based on an integer.\u003c/p\u003e\n\n\u003cp\u003eEach worker thread takes \u003ccode\u003eflag, data\u003c/code\u003e off the queue, processes it using its own database connection, and places the GUID of the row onto a list so that the producer class knows when a job is done.\u003c/p\u003e\n\n\u003cp\u003eWhile I'm aware that other modules implement the functionality I'm coding, the reason I'm coding this is to gain a better understanding of how Python threading works. This brings me to my question.\u003c/p\u003e\n\n\u003cp\u003eIf I store anything in a function's namespace or in the class's \u003ccode\u003e__dict__\u003c/code\u003e object, will it be thread safe?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass Consumer(threading.Thread):\n def __init__(self, producer, db_filename):\n self.producer = producer\n self.conn = sqlite3.connect(db_filename) # Is this var thread safe?\n def run(self):\n flag, data = self.producer.queue.get()\n\n while flag != 'stop':\n # Do stuff with data; Is `data` thread safe?\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am thinking that both would be thread safe, here's my rationale:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eEach time a class is instantiated, a new \u003ccode\u003e__dict__\u003c/code\u003e gets created. Under the scenario I outline above, I don't think any other object would have a reference to this object. (Now, perhaps the situation might get more complicated if I used \u003ccode\u003ejoin()\u003c/code\u003e functionality, but I'm not...)\u003c/li\u003e\n\u003cli\u003eEach time a function gets called, it creates its own name space which exists for the lifetime of the function. I'm not making any of my variables \u003ccode\u003eglobal\u003c/code\u003e, so I don't understand how any other object would have a reference to a function variable.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003e\u003ca href=\"https://stackoverflow.com/questions/104983/please-explain-thread-local-storage-for-python\"\u003eThis post\u003c/a\u003e addresses my question somewhat, but is still a little abstract for me.\u003c/p\u003e\n\n\u003cp\u003eThanks in advance for clearing this up for me.\u003c/p\u003e","answer_count":"3","comment_count":"0","creation_date":"2009-07-26 17:53:08.107 UTC","favorite_count":"1","last_activity_date":"2013-02-19 23:27:37.597 UTC","last_edit_date":"2017-05-23 12:14:20.03 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"145350","post_type_id":"1","score":"4","tags":"python|concurrency|namespaces|multithreading","view_count":"1449"} +{"id":"29648424","title":"remove session in javascript and jquery","body":"\u003cp\u003ewe all know that we can set and get \u003ccode\u003esession\u003c/code\u003e using javascript like below:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esession.setItem(\"name\", \"value\"); \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003esession.getItem(\"name\");\u003c/p\u003e\n\n\u003cp\u003eI need to know how to destroy particular and all session variable in javascript.\u003c/p\u003e\n\n\u003cp\u003eI used \u003ca href=\"https://www.google.co.in/?gfe_rd=cr\u0026amp;ei=kUAuVb6AGLHv8wfjy4CgCQ\u0026amp;gws_rd=ssl#q=destroy%20session%20variable%20in%20javascript\" rel=\"nofollow\"\u003egoogle\u003c/a\u003e but I'm unable to get exactly what I need. Please help me to find the solution. jQuery answers are also welcome (without plugin)\u003c/p\u003e\n\n\u003cp\u003eThank you in advance\u003c/p\u003e","accepted_answer_id":"29648548","answer_count":"2","comment_count":"1","creation_date":"2015-04-15 10:58:49.057 UTC","last_activity_date":"2015-04-15 11:29:34.083 UTC","last_edit_date":"2015-04-15 11:20:50.353 UTC","last_editor_display_name":"","last_editor_user_id":"3256749","owner_display_name":"","owner_user_id":"3256749","post_type_id":"1","score":"-2","tags":"javascript|jquery|html5|session","view_count":"18792"} +{"id":"43224131","title":"Ignore all .axd file from MVC routing","body":"\u003cp\u003eIn my application, Both mvc and web form is present. \u003c/p\u003e\n\n\u003cp\u003eBut when I open any \u003ccode\u003e.aspx\u003c/code\u003e page then in \u003ccode\u003eApplication_Error\u003c/code\u003e error is thrown.\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eThe controller for path '/WebResource.axd' was not found or does not implement IController.\u003c/p\u003e\n \n \u003cp\u003eThe controller for path '/ScriptResource.axd' was not found or does\n not implement IController.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI tried all these method, but none of them is working.\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003cp\u003eAdded at top in RegisterRoutes method.\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eroutes.IgnoreRoute(\"{resource}.axd/{*pathInfo}\");\n routes.IgnoreRoute(\"{*allaspx}\", new { allaspx = @\".*\\.aspx(/.*)?\" });\u003c/code\u003e\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eCreate a FileTypeConstraint class to check file ext.\u003c/p\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003e.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class FileTypeConstraint : IRouteConstraint\n {\n private readonly string[] MatchingFileTypes;\n\n public FileTypeConstraint(string matchingFileType)\n {\n MatchingFileTypes = new[] { matchingFileType };\n }\n\n public FileTypeConstraint(string[] matchingFileTypes)\n {\n MatchingFileTypes = matchingFileTypes;\n }\n\n public bool Match(HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection)\n {\n if (values[\"url\"] != null)\n {\n string path = values[\"url\"].ToString();\n return MatchingFileTypes.Any(x =\u0026gt; path.ToLower().EndsWith(x, StringComparison.CurrentCultureIgnoreCase));\n }\n else\n {\n return false;\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd added this line at top and bottom both \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e routes.MapRoute(\n \"Defaultaxd\",\n \"{*url}\",\n new { controller = \"Home\", action = \"Index\", id = UrlParameter.Optional },\n new { myCustomConstraint = new FileTypeConstraint(new[] { \"axd\" }) }\n );\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eTried all these links.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://stackoverflow.com/questions/1666211/httphandlers-with-asp-net-mvc\"\u003eHttpHandlers with ASP.NET MVC\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://stackoverflow.com/questions/1609726/asp-net-mvc-routing-issue\"\u003eASP.NET MVC routing issue?\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://stackoverflow.com/questions/2500750/using-url-routing-for-web-forms-and-stoproutinghandler-for-favicon\"\u003eUsing URL Routing for Web Forms and StopRoutingHandler for Favicon\u003c/a\u003e\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2017-04-05 07:05:39.503 UTC","last_activity_date":"2017-04-05 07:05:39.503 UTC","last_edit_date":"2017-05-23 11:46:25.623 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"2465787","post_type_id":"1","score":"0","tags":"c#|asp.net|asp.net-mvc|asp.net-mvc-routing","view_count":"110"} +{"id":"27867716","title":"Jquery - settimeout","body":"\u003cp\u003eI have a jquery function that i need to delay 1 second.\nI've searched here, and I need to use the settimeout function which I have no idea how to put in the jquery.\u003c/p\u003e\n\n\u003cp\u003eHere's my code: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;script type=\"text/javascript\"\u0026gt;\njQuery(document).ready(function() {\n jQuery('.animacao').addClass(\"hidden\").viewportChecker({\n classToAdd: 'visible animated fadeInDown', // Class to add to the elements when they are visible\n offset: 100 \n }); \n}); \n\u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCan someone help me, please?\u003c/p\u003e","accepted_answer_id":"27867778","answer_count":"1","comment_count":"2","creation_date":"2015-01-09 19:24:51.613 UTC","last_activity_date":"2015-01-09 19:28:20.04 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4378831","post_type_id":"1","score":"-2","tags":"jquery|settimeout","view_count":"246"} +{"id":"46134100","title":"How to set the size of a QCheckBox's indicator?","body":"\u003cp\u003eThis code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eQCheckBox* selection = new QCheckBox(backgroundEditor);\nselection-\u0026gt;setGeometry(\n 0 , //Left\n 0 , //Top\n buttonHeight , //Width\n buttonHeight //Height\n );\nselection-\u0026gt;setStyleSheet(QString(\n \"background-color: white;\"\n \" color: black;\"\n \"QCheckBox::indicator \"\n \"{\"\n \" width: %1px;\"\n \" height: %1px;\"\n \"}\"\n ).arg(buttonHeight));\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eproduces:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/jWeuY.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/jWeuY.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThe white area has the correct geometry, but I want the indicator box (and thus the click-target) to fill it. How do I do that?\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003eA bit of experimenting shows that the color specification wipes out the size. Removing it makes the size correct, but of course the colors are wrong. How can I have both?\u003c/p\u003e","accepted_answer_id":"46163040","answer_count":"2","comment_count":"0","creation_date":"2017-09-09 18:56:17.643 UTC","last_activity_date":"2017-09-22 12:04:55.913 UTC","last_edit_date":"2017-09-22 12:04:55.913 UTC","last_editor_display_name":"","last_editor_user_id":"5068056","owner_display_name":"","owner_user_id":"3491308","post_type_id":"1","score":"0","tags":"c++|css|qt|user-interface","view_count":"53"} +{"id":"14209761","title":"Do mobile webkit browsers have a rounding issue in JS?","body":"\u003cp\u003eI'm trying to debug an issue with some javascript slider code on mobile browsers. It appears to be a rounding error which only occurs on mobile devices. The following code will work fine on the desktop (e.g. Chrome) but the increase button fails to work on higher values on the slider when viewed in Webkit on a smartphone e.g. iPhone iOS 5/6, Samsung S2 ICS.\u003c/p\u003e\n\n\u003cp\u003eTry this \u003ca href=\"http://jsfiddle.net/codecowboy/mLpfu/8/\" rel=\"nofollow\"\u003ehttp://jsfiddle.net/codecowboy/mLpfu/\u003c/a\u003e. Click the 'debug on mobile' button - its directly adjacent to the Run button top left (you need to be logged in to see this button). Enter the url generated into a browser on a smartphone (preferably a webkit browser on iPhone / Android).\u003c/p\u003e\n\n\u003cp\u003eDrag the slider to say 265, hit increase. Some values will let you hit increase, some won't. The higher the value, the worse the problem gets.\u003c/p\u003e\n\n\u003cp\u003eThe code is using jQuery and the noUISlider plugin. The button click code is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar btnIncrease= document.getElementById(\"increase\");\n btnIncrease.addEventListener('click',function(e) {\n\n var slider = $(\"#noUiSlider\");\n console.log(e);\n var value = slider.noUiSlider('value')[1]; //the 'value' method returns an array.\n console.log('value pre move '+value);\n value = value+1;\n slider.noUiSlider(\"move\", { knob : 0, to: parseInt(value,10) });\n\n console.log(slider.noUiSlider('value')[1]);\n\n\n });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCan anyone explain what is causing this? Could this be a Big / Little Endian issue? Or a bug in jQuery?\u003c/p\u003e\n\n\u003cp\u003eThe above code calls the nouislider plugin, source here:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e(function( $ ){\n\n$.fn.noUiSlider = function( method, options ) {\n\n function neg(a){ return a\u0026lt;0; }\n function abs(a){ return Math.abs(a); }\n function roundTo(a,b) { return Math.round(a / b) * b; }\n function dup(a){ return jQuery.extend(true, {}, a); }\n\n var defaults, methods, helpers, options = options||[], functions, touch = ('ontouchstart' in document.documentElement);\n\n defaults = {\n\n /*\n * {handles} Specifies the number of handles. (init)\n * [INT] 1, 2\n */\n 'handles' : 2,\n /*\n * {connect} Whether to connect the middle bar to the handles. (init)\n * [MIXED] \"upper\", \"lower\", false, true\n */\n 'connect' : true,\n /*\n * {scale}; The values represented by the slider handles. (init,move,value)\n * [ARRAY] [-+x,\u0026gt;x]\n */\n 'scale' : [0,100],\n /*\n * {start} The starting positions for the handles, mapped to {scale}. (init)\n * [ARRAY][INT] [y\u0026gt;={scale[0]}, y=\u0026lt;{scale[1]}], integer in range.\n */\n 'start' : [25,75],\n /*\n * {to} The position to move a handle to. (move)\n * [INT] Any, but will be corrected to match z \u0026gt; {scale[0]} || _l, z \u0026lt; {scale[1]} || _u\n */\n 'to' : 0,\n /*\n * {handle} The handle to move. (move)\n * [MIXED] 0,1,\"lower\",\"upper\"\n */\n 'handle' : 0,\n /*\n * {change} The function to be called on every change. (init)\n * [FUNCTION] param [STRING]'move type'\n */\n 'change' : '',\n /*\n * {end} The function when a handle is no longer being changed. (init)\n * [FUNCTION] param [STRING]'move type'\n */\n 'end' : '',\n /*\n * {step} Whether, and at what intervals, the slider should snap to a new position. Adheres to {scale} (init)\n * [MIXED] \u0026lt;x, FALSE\n */\n 'step' : false,\n /*\n * {save} Whether a scale give to a function should become the default for the slider it is called on. (move,value)\n * [BOOLEAN] true, false\n */\n 'save' : false,\n /*\n * {click} Whether the slider moves by clicking the bar\n * [BOOLEAN] true, false\n */\n 'click' : true\n\n };\n\n helpers = {\n\n scale: function( a, b, c ){ \n var d = b[0],e = b[1];\n if(neg(d)){\n a=a+abs(d);\n e=e+abs(d);\n } else {\n a=a-d;\n e=e-d;\n }\n return (a*c)/e;\n },\n deScale: function( a, b, c ){\n var d = b[0],e = b[1];\n e = neg(d) ? e + abs(d) : e - d;\n return ((a*e)/c) + d; \n },\n connect: function( api ){\n\n if(api.connect){\n\n if(api.handles.length\u0026gt;1){\n api.connect.css({'left':api.low.left(),'right':(api.slider.innerWidth()-api.up.left())});\n } else {\n api.low ? api.connect.css({'left':api.low.left(),'right':0}) : api.connect.css({'left':0,'right':(api.slider.innerWidth()-api.up.left())});\n }\n\n }\n\n },\n left: function(){\n return parseFloat($(this).css('left'));\n },\n call: function( f, t, n ){\n if ( typeof(f) == \"function\" ){ f.call(t, n) }\n },\n bounce: function( api, n, c, handle ){\n\n var go = false;\n\n if( handle.is( api.up ) ){\n\n if( api.low \u0026amp;\u0026amp; n \u0026lt; api.low.left() ){\n\n n = api.low.left();\n go=true;\n\n }\n\n } else {\n\n if( api.up \u0026amp;\u0026amp; n \u0026gt; api.up.left() ){\n\n n = api.up.left();\n go=true;\n\n }\n\n }\n\n if ( n \u0026gt; api.slider.innerWidth() ){\n\n n = api.slider.innerWidth()\n\n go=true;\n\n } else if( n \u0026lt; 0 ){\n\n n = 0;\n go=true;\n\n }\n\n return [n,go];\n\n }\n\n };\n\n methods = {\n\n init: function(){\n\n return this.each( function(){\n\n /* variables */\n\n var s, slider, api;\n\n /* fill them */\n\n slider = $(this).css('position','relative');\n api = new Object();\n\n api.options = $.extend( defaults, options );\n s = api.options;\n\n typeof s.start == 'object' ? 1 : s.start=[s.start];\n\n /* Available elements */\n\n api.slider = slider;\n api.low = $('\u0026lt;div class=\"noUi-handle noUi-lowerHandle\"\u0026gt;\u0026lt;div\u0026gt;\u0026lt;/div\u0026gt;\u0026lt;/div\u0026gt;');\n api.up = $('\u0026lt;div class=\"noUi-handle noUi-upperHandle\"\u0026gt;\u0026lt;div\u0026gt;\u0026lt;/div\u0026gt;\u0026lt;/div\u0026gt;');\n api.connect = $('\u0026lt;div class=\"noUi-midBar\"\u0026gt;\u0026lt;/div\u0026gt;');\n\n /* Append the middle bar */\n\n s.connect ? api.connect.appendTo(api.slider) : api.connect = false;\n\n /* Append the handles */\n\n // legacy rename\n if(s.knobs){\n s.handles=s.knobs;\n }\n\n if ( s.handles === 1 ){\n\n /*\n This always looks weird:\n Connect=lower, means activate upper, because the bar connects to 0.\n */\n\n if ( s.connect === true || s.connect === 'lower' ){\n\n api.low = false;\n api.up = api.up.appendTo(api.slider);\n api.handles = [api.up];\n\n } else if ( s.connect === 'upper' || !s.connect ) {\n\n api.low = api.low.prependTo(api.slider);\n api.up = false;\n api.handles = [api.low];\n\n }\n\n } else {\n\n api.low = api.low.prependTo(api.slider);\n api.up = api.up.appendTo(api.slider);\n api.handles = [api.low, api.up];\n\n }\n\n if(api.low){ api.low.left = helpers.left; }\n if(api.up){ api.up.left = helpers.left; }\n\n api.slider.children().css('position','absolute');\n\n $.each( api.handles, function( index ){\n\n $(this).css({\n 'left' : helpers.scale(s.start[index],api.options.scale,api.slider.innerWidth()),\n 'zIndex' : index + 1\n }).children().bind(touch?'touchstart.noUi':'mousedown.noUi',functions.start);\n\n });\n\n if(s.click){\n api.slider.click(functions.click).find('*:not(.noUi-midBar)').click(functions.flse);\n }\n\n helpers.connect(api);\n\n /* expose */\n api.options=s;\n api.slider.data('api',api);\n\n });\n\n },\n move: function(){\n\n var api, bounce, to, handle, scale;\n\n api = dup($(this).data('api'));\n api.options = $.extend( api.options, options );\n\n // rename legacy 'knob'\n if(api.options.knob){\n api.options.handle = api.options.knob;\n }\n\n // flatten out the legacy 'lower/upper' options\n handle = api.options.handle;\n handle = api.handles[handle == 'lower' || handle == 0 || typeof handle == 'undefined' ? 0 : 1];\n bounce = helpers.bounce(api, helpers.scale(api.options.to, api.options.scale, api.slider.innerWidth()), handle.left(), handle);\n\n handle.css('left',bounce[0]);\n\n if( (handle.is(api.up) \u0026amp;\u0026amp; handle.left() == 0) || (handle.is(api.low) \u0026amp;\u0026amp; handle.left() == api.slider.innerWidth()) ){\n handle.css('zIndex',parseInt(handle.css('zIndex'))+2);\n }\n\n if(options.save===true){\n api.options.scale = options.scale;\n $(this).data('api',api);\n }\n\n helpers.connect(api);\n helpers.call(api.options.change, api.slider, 'move');\n helpers.call(api.options.end, api.slider, 'move');\n\n },\n value: function(){\n\n var val1, val2, api;\n\n api = dup($(this).data('api'));\n api.options = $.extend( api.options, options );\n\n val1 = api.low ? Math.round(helpers.deScale(api.low.left(), api.options.scale, api.slider.innerWidth())) : false;\n val2 = api.up ? Math.round(helpers.deScale(api.up.left(), api.options.scale, api.slider.innerWidth())) : false;\n\n if(options.save){\n api.options.scale = options.scale;\n $(this).data('api',api);\n }\n\n return [val1,val2];\n\n },\n api: function(){\n return $(this).data('api');\n },\n disable: function(){\n return this.each( function(){\n $(this).addClass('disabled');\n });\n },\n enable: function(){\n return this.each( function(){\n $(this).removeClass('disabled');\n });\n }\n\n },\n\n functions = {\n\n start: function( e ){\n\n if(! $(this).parent().parent().hasClass('disabled') ){\n\n e.preventDefault();\n $('body').bind( 'selectstart.noUi' , functions.flse);\n $(this).addClass('noUi-activeHandle');\n\n $(document).bind(touch?'touchmove.noUi':'mousemove.noUi', functions.move);\n\n touch?$(this).bind('touchend.noUi',functions.end):$(document).bind('mouseup.noUi', functions.end);\n\n }\n\n },\n move: function( e ){\n\n var a,b,h,api,go = false,handle,bounce;\n\n h = $('.noUi-activeHandle');\n api = h.parent().parent().data('api');\n handle = h.parent().is(api.low) ? api.low : api.up;\n a = e.pageX - Math.round( api.slider.offset().left );\n\n // if there is no pageX on the event, it is probably touch, so get it there.\n if(isNaN(a)){\n a = e.originalEvent.touches[0].pageX - Math.round( api.slider.offset().left );\n }\n\n // a = p.nw == New position \n // b = p.cur == Old position\n\n b = handle.left();\n bounce = helpers.bounce(api, a, b, handle);\n a = bounce[0];\n go = bounce[1];\n\n if ( api.options.step \u0026amp;\u0026amp; !go){\n\n // get values from options\n var v1 = api.options.scale[0], v2 = api.options.scale[1];\n\n // convert values to [0-X\u0026gt;0] range\n // edge case: both values negative;\n if( neg(v2) ){ \n v2 = abs( v1 - v2 );\n v1 = 0;\n }\n // handle all values\n v2 = ( v2 + ( -1 * v1 ) );\n\n // converts step to the new range\n var con = helpers.scale( api.options.step, [0,v2], api.slider.innerWidth() );\n\n // if the current movement is bigger than step, set to step.\n if ( Math.abs( b - a ) \u0026gt;= con ){\n a = a \u0026lt; b ? b-con : b+con;\n go = true;\n }\n\n } else {\n go = true;\n }\n\n if(a===b){\n go=false;\n }\n\n if(go){\n\n handle.css('left',a);\n if( (handle.is(api.up) \u0026amp;\u0026amp; handle.left() == 0) || (handle.is(api.low) \u0026amp;\u0026amp; handle.left() == api.slider.innerWidth()) ){\n handle.css('zIndex',parseInt(handle.css('zIndex'))+2);\n }\n helpers.connect(api);\n helpers.call(api.options.change, api.slider, 'slide');\n\n }\n\n },\n end: function(){\n\n var handle, api;\n\n handle = $('.noUi-activeHandle');\n api = handle.parent().parent().data('api');\n\n $(document).add('body').add(handle.removeClass('noUi-activeHandle').parent()).unbind('.noUi');\n\n helpers.call(api.options.end, api.slider, 'slide');\n\n },\n click: function( e ){\n\n if(! $(this).hasClass('disabled') ){\n\n var api = $(this).data('api');\n var s = api.options;\n var c = e.pageX - api.slider.offset().left;\n\n c = s.step ? roundTo(c,helpers.scale( s.step, s.scale, api.slider.innerWidth() )) : c;\n\n if( api.low \u0026amp;\u0026amp; api.up ){\n c \u0026lt; ((api.low.left()+api.up.left())/2) ? api.low.css(\"left\", c) : api.up.css(\"left\", c);\n } else {\n api.handles[0].css('left',c);\n }\n\n helpers.connect(api);\n helpers.call(s.change, api.slider, 'click');\n helpers.call(s.end, api.slider, 'click');\n\n }\n\n },\n flse: function(){\n return false;\n }\n\n }\n\n if ( methods[method] ) {\n return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 ));\n } else if ( typeof method === 'object' || ! method ) {\n return methods.init.apply( this, arguments );\n } else {\n $.error( 'No such method: ' + method );\n }\n\n};\n\n})( jQuery );\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"3","creation_date":"2013-01-08 06:59:24.01 UTC","last_activity_date":"2013-01-16 22:06:13.367 UTC","last_edit_date":"2013-01-08 11:41:18.17 UTC","last_editor_display_name":"","last_editor_user_id":"69346","owner_display_name":"","owner_user_id":"69346","post_type_id":"1","score":"2","tags":"javascript|jquery|mobile|webkit|rounding","view_count":"555"} +{"id":"12512724","title":"Test smell.... is this good practise?","body":"\u003cp\u003eI have two tests they are exactly the same... barring two things, they call two separate service calls.. hence when im using mockito i have two seperate expectation and verify lines...\u003c/p\u003e\n\n\u003cp\u003ethis is what i have done:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@test\nTestA {\n baseTest(\"player\");\n}\n\n@test\nTestB {\n baseTest(\"member\");\n\n}\n\nBaseTest(type type) {\n ....\n .....\n if type(player) {\n Mockito.when(player service call)\n }\n else {\n Mockito.when(member service call)\n }\n\n // make the call in code\n\n //verify\n\n if(player) {\n verify player specific service call...\n }\n else {\n\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI think the above is a test smell... just doesnt feel right...\u003c/p\u003e\n\n\u003cp\u003eIs there a better way then placing an If statement in my baste test?\u003c/p\u003e","accepted_answer_id":"12512959","answer_count":"4","comment_count":"4","creation_date":"2012-09-20 12:37:06.037 UTC","last_activity_date":"2012-09-20 19:05:22.473 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1555190","post_type_id":"1","score":"1","tags":"java|junit4|mockito|spring-test|spring-test-mvc","view_count":"174"} +{"id":"13442789","title":"How can i show multi checkbox on datagridview","body":"\u003cp\u003ei need show multi checkbox on datagridview.\u003c/p\u003e\n\n\u003cp\u003ei have 4 checkbox when select 2 checkbox it's show 2 checkbox on datagridview.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEx 2 checkbox.\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eCheckBox missShw\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e0001\n0002\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eCheckBox leaveFull\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e0003\n0004\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ei'm First select CheckBox missShw and CheckBox leaveFull it's output.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e0003\n0004\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOR\ni'm First select CheckBox leaveFull and CheckBox missShw it's output.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e0001\n0002\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003ei need output when 2 checkbox.\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e0001\n0002\n0003\n0004\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003enow, i'm select 2 checkbox, so it's show all data to datagridview \u003cstrong\u003ebut it's don't show all data\u003c/strong\u003e.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eThis code:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic void missShw() \n {\n SqlConnection conn = new SqlConnection(appConn);\n string sql = \"SELECT [filesTA].EmpNo,[Employee].Title + ' ' + [Employee].[First Name] + ' ' + [Employee].[Last Name] as 'FullName',[filesTA].ChkDate\"\n + \",Convert(nvarchar(5),[filesTA].ChkIn,108) as 'ChkIn',Convert(nvarchar(5),[filesTA].ChkOut,108) as 'ChkOut\"\n + \",[filesTA].LateMin\"\n + \" From [WebSP].[dbo].[filesTA] inner join [WebSP].[dbo].[Employee] on [Employee].EmployeeNo=[filesTA].EmpNo INNER JOIN [WebSP].[dbo].[CompanyData] On [CompanyData].Company = [Employee].Company\"\n + \" WHERE [filesTA].ChkDate ='\" + dateTimePicker.Value.ToString(\"yyyy-MM-dd\") + \"'\"\n + \" and [Employee].Section = '\" + cbSection.SelectedValue + \"'\"\n + \" and [Employee].Team = '\" + cbTeam.SelectedValue + \"'\"\n + \" and [filesTA].ErrorCode = '2'\";\n\n da = new SqlDataAdapter(sql, Conn);\n DataSet ds = new DataSet();\n da.Fill(ds);\n Conn.Close();\n\n dgvShow.DataSource = ds.Tables[0];\n }\n\npublic void leaveFull()\n {\n SqlConnection conn = new SqlConnection(appConn);\n string sql = \"SELECT [filesTA].EmpNo,[Employee].Title + ' ' + [Employee].[First Name] + ' ' + [Employee].[Last Name] as 'FullName',[filesTA].ChkDate\"\n + \",Convert(nvarchar(5),[filesTA].ChkIn,108) as 'ChkIn',Convert(nvarchar(5),[filesTA].ChkOut,108) as 'ChkOut\"\n + \",[filesTA].LateMin\"\n + \" From [WebSP].[dbo].[filesTA] inner join [WebSP].[dbo].[Employee] on [Employee].EmployeeNo=[filesTA].EmpNo INNER JOIN [WebSP].[dbo].[CompanyData] On [CompanyData].Company = [Employee].Company\"\n + \" WHERE [filesTA].ChkDate ='\" + dateTimePicker.Value.ToString(\"yyyy-MM-dd\") + \"'\"\n + \" and [Employee].Section = '\" + cbSection.SelectedValue + \"'\"\n + \" and [Employee].Team = '\" + cbTeam.SelectedValue + \"'\"\n + \" and [filesTA].ErrorCode = '3'\";\n\n da = new SqlDataAdapter(sql, Conn);\n DataSet ds = new DataSet();\n da.Fill(ds);\n Conn.Close();\n\n dgvShow.DataSource = ds.Tables[0];\n }\n\n//missShw()\n private void checkBox4_CheckedChanged(object sender, EventArgs e)\n {\n if (checkBox4.Checked == true)\n {\n missShw(); \n }\n }\n\n//leaveFull()\n private void checkBox3_CheckedChanged(object sender, EventArgs e)\n {\n if (checkBox3.Checked == true)\n {\n leaveFull(); \n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks for your time. :)\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2012-11-18 17:47:27.17 UTC","last_activity_date":"2012-11-19 01:12:10.193 UTC","last_edit_date":"2012-11-19 01:12:10.193 UTC","last_editor_display_name":"","last_editor_user_id":"1556907","owner_display_name":"","owner_user_id":"1556907","post_type_id":"1","score":"0","tags":"c#|sql-server|visual-studio-2008|if-statement|checkbox","view_count":"380"} +{"id":"29712105","title":"'[AUTHENTICATIONFAILED] Invalid credentials (Failure)' error for gmail.readonly, gmail.modify etc. scopes","body":"\u003cp\u003eI am getting the error mentioned in the title for \u003ccode\u003egmail.readonly\u003c/code\u003e, \u003ccode\u003egmail.modify\u003c/code\u003e and all other scopes except for full account access scope (\u003ca href=\"https://mail.google.com/\" rel=\"nofollow\"\u003ehttps://mail.google.com/\u003c/a\u003e). Here is what I am trying to do. \u003c/p\u003e\n\n\u003cp\u003eI have a \u003ccode\u003edjango-allauth\u003c/code\u003e setup to get offline access tokens (OAUTH2 bearer token and refresh tokens). I am using this token to fetch emails using python's imaplib. It works when I specify full account access scope but doesn't work for \u003ccode\u003egmail.readonly\u003c/code\u003e scope. And I don't need the full access as I just want to fetch the emails using \u003ccode\u003eimaplib\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://developers.google.com/gmail/api/auth/scopes\" rel=\"nofollow\"\u003eReference Link\u003c/a\u003e \u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2015-04-18 02:06:18.527 UTC","last_activity_date":"2015-04-20 23:46:12.193 UTC","last_edit_date":"2015-04-20 23:46:12.193 UTC","last_editor_display_name":"","last_editor_user_id":"3758997","owner_display_name":"","owner_user_id":"1396720","post_type_id":"1","score":"3","tags":"python-3.x|google-oauth|gmail-api|django-allauth|imaplib","view_count":"760"} +{"id":"13519547","title":"how to force close wifi and data roaming","body":"\u003cp\u003eI want to manually close wifi and data roaming in android. After finishing with processing some data i want to enable it back. How can i do this programatically?\u003c/p\u003e\n\n\u003cp\u003eI only find this howto but is not working in my android 4.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://stackoverflow.com/questions/11060414/how-do-i-program-android-to-look-for-a-particular-network\"\u003eHow do I program android to look for a particular network?\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"13519613","answer_count":"1","comment_count":"0","creation_date":"2012-11-22 20:24:27.683 UTC","favorite_count":"1","last_activity_date":"2012-11-22 20:30:21.647 UTC","last_edit_date":"2017-05-23 10:24:43.4 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"919023","post_type_id":"1","score":"1","tags":"android","view_count":"470"} +{"id":"17185152","title":"return enum name base value","body":"\u003cp\u003eI have a enum\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic enum citys\n{\n a=1,\n b=1,\n c=1,\n d=2,\n e=2,\n f=2,\n};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd I want return \u003ccode\u003eName\u003c/code\u003e base on value.For example, in \u003ccode\u003eforeach return Enum.GetNames\u003c/code\u003e that \u003ccode\u003eValue =1\u003c/code\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e result --\u0026gt; a,b,c\n foreach return Enum.GetNames that Value =2\n result --\u0026gt; d,e,f\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks for your help.\u003c/p\u003e","accepted_answer_id":"17185285","answer_count":"1","comment_count":"0","creation_date":"2013-06-19 07:20:47.913 UTC","last_activity_date":"2013-06-19 07:31:34.693 UTC","last_edit_date":"2013-06-19 07:23:02.497 UTC","last_editor_display_name":"","last_editor_user_id":"1163607","owner_display_name":"","owner_user_id":"2447878","post_type_id":"1","score":"2","tags":"c#|asp.net|foreach|enums","view_count":"112"} +{"id":"16486696","title":"jQuery UI autocomplete(Combobox) button alignment","body":"\u003cp\u003eI have jQuery UI autocomplete combo boxes(\u003ca href=\"http://jqueryui.com/autocomplete/#combobox\" rel=\"nofollow\"\u003ehttp://jqueryui.com/autocomplete/#combobox\u003c/a\u003e) in a tabular form.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;tbody\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;select id=\"someSelect\"\u0026gt;\u0026lt;option....\u0026gt;\u0026lt;/select\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;....\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;....\u0026lt;/td\u0026gt;{*n}\n \u0026lt;/tr\u0026gt;\n\u0026lt;/tbody\u0026gt;\n\u0026lt;script\u0026gt;\n $('select#someSelect').combobox();\n\u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eEach row gets several TD elements not more than 6 including the combo boxes. \u003c/p\u003e\n\n\u003cp\u003eThe issue is that the button next to input field moves below to the input box when the window size changes by its content size dynamically.\u003c/p\u003e\n\n\u003cp\u003eAfter calling .combobox() on a select box:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;td\u0026gt;\n \u0026lt;select name=\"select1\" id=\"ma1\" style=\"display: none;\"\u0026gt;\n \u0026lt;option value=\"0\"\u0026gt;Select Attribute\u0026lt;/option\u0026gt;\n \u0026lt;option value=\"ContactFirstName\"\u0026gt;ContactFirstName\u0026lt;/option\u0026gt;\n \u0026lt;/select\u0026gt;\n \u0026lt;input class=\"ui-autocomplete-input ui-widget ui-widget-content ui-corner-left\" autocomplete=\"off\" role=\"textbox\" aria-autocomplete=\"list\" aria-haspopup=\"true\"\u0026gt;\n \u0026lt;button type=\"button\" tabindex=\"-1\" title=\"Show All Items\" class=\"ui-button ui-widget ui-state-default ui-button-icon-only ui-corner-right ui-button-icon\" role=\"button\" aria-disabled=\"false\"\u0026gt;\n \u0026lt;span class=\"ui-button-icon-primary ui-icon ui-icon-triangle-1-s\"\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;span class=\"ui-button-text\"\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;/button\u0026gt;\n\u0026lt;/td\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf I shrink the window horizontally, the button next to input field goes under the text box.\u003c/p\u003e\n\n\u003cp\u003eHow can I force the button stick next to input box no matter what the window size is?\u003c/p\u003e","accepted_answer_id":"16487893","answer_count":"1","comment_count":"1","creation_date":"2013-05-10 16:23:43.6 UTC","last_activity_date":"2013-05-10 17:36:39.97 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"623413","post_type_id":"1","score":"1","tags":"jquery|html|css|jquery-ui|combobox","view_count":"753"} +{"id":"16058909","title":"jquery effects not visible in php if \"echo\" is used for output","body":"\u003cp\u003eim having small image gallery that uses fancybox. So on each image there is a hover and popup effect. Below is my code\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"one-third column hover\"\u0026gt;\n \u0026lt;a href=\"large/28crowview_ld.jpg\" class=\"image-box\"\u0026gt;\n \u0026lt;div class=\"photo\"\u0026gt;\n \u0026lt;span class=\"text\"\u0026gt;\u0026lt;span class=\"anchor\"\u0026gt;\u0026lt;/span\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;/div\u0026gt; \n \u0026lt;img src=\"large/28crowview_ld.jpg\" height=\"170px\" width=\"260px\"/\u0026gt; \n \u0026lt;/a\u0026gt; \n \u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethe above code works perfectly.\u003c/p\u003e\n\n\u003cp\u003ebut im using a ajax controller that returns the above code using an echo\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e echo '\u0026lt;div class=\"one-third column hover\"\u0026gt;\n \u0026lt;a href=\"large/28crowview_ld.jpg\" class=\"image-box\"\u0026gt;\n \u0026lt;div class=\"photo\"\u0026gt;\n \u0026lt;span class=\"text\"\u0026gt;\u0026lt;span class=\"anchor\"\u0026gt;\u0026lt;/span\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;/div\u0026gt; \n \u0026lt;img src=\"large/28crowview_ld.jpg\" height=\"170px\" width=\"260px\"/\u0026gt; \n \u0026lt;/a\u0026gt; \n \u0026lt;/div\u0026gt;';\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut when i use the echo tag the images are displayed but non of the hover effects are visible. it was very odd. and i also noticed the same issue on my social bar.\u003c/p\u003e\n\n\u003cp\u003eIt works perfectly when i use it in a html view. But when i echo, i see the code in the source but the icons are not visible\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eecho '\u0026lt;div class=\"supersocialshare\" data-networks=\"facebook,google,twitter,linkedin,pinterest\" data-url=\"'.$share.'\" data-orientation=\"line\"\u0026gt;\u0026lt;/div\u0026gt;';\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eall the images are placed correctly, no js conflicts.\u003c/p\u003e\n\n\u003cp\u003eBelow is the java script im using\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;script type=\"text/javascript\"\u0026gt;\n$(document).ready(function() {\n\n var track_click = 0; //track user click on \"load more\" button, righ now it is 0 click\n\n var total_pages = \u0026lt;?php echo $total_pages; ?\u0026gt;;\n $('#results').load(\"\u0026lt;?php echo base_url() ?\u0026gt;fetch_pages\", {'page':track_click}, function() {track_click++;}); //initial data to load\n\n $(\".load_more\").click(function (e) { //user clicks on button\n\n $(this).hide(); //hide load more button on click\n $('.animation_image').show(); //show loading image\n\n if(track_click \u0026lt;= total_pages) //make sure user clicks are still less than total pages\n {\n //post page number and load returned data into result element\n $.post('\u0026lt;?php echo base_url() ?\u0026gt;fetch_pages',{'page': track_click}, function(data) {\n\n $(\".load_more\").show(); //bring back load more button\n\n $(\"#results\").append(data); //append data received from server\n\n //scroll page to button element\n $(\"html, body\").animate({scrollTop: $(\"#load_more_button\").offset().top}, 500);\n\n //hide loading image\n $('.animation_image').hide(); //hide loading image once data is received\n\n track_click++; //user click increment on load button\n\n }).fail(function(xhr, ajaxOptions, thrownError) { \n alert(thrownError); //alert any HTTP error\n $(\".load_more\").show(); //bring back load more button\n $('.animation_image').hide(); //hide loading image once data is received\n });\n\n\n if(track_click \u0026gt;= total_pages-1)\n {\n //reached end of the page yet? disable load button\n $(\".load_more\").attr(\"disabled\", \"disabled\");\n }\n }\n\n });\n});\n\u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003einside fetch_pages\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e $page_number = filter_var($this-\u0026gt;input-\u0026gt;post('page'), FILTER_SANITIZE_NUMBER_INT, FILTER_FLAG_STRIP_HIGH);\n\n //throw HTTP error if page number is not valid\n if(!is_numeric($page_number)){\n header('HTTP/1.1 500 Invalid page number!');\n exit();\n }\n\n $item_per_page = 5;\n\n //get current starting point of records\n $position = ($page_number * $item_per_page);\n\n $cottages = $this-\u0026gt;properties-\u0026gt;getstuff($sub_location,$position, $item_per_page);\n\n foreach ($props as $cots):\n\n echo'\u0026lt;div class=\"container section\" id=\"'.$cots[\"id\"].'\"\u0026gt;\n \u0026lt;div class=\"one-third column hover\"\u0026gt;\n \u0026lt;a href=\"'.$cots[\"image_url\"].'\" class=\"image-box\"\u0026gt;\n \u0026lt;div class=\"photo\"\u0026gt;\n \u0026lt;span class=\"text\"\u0026gt;\u0026lt;span class=\"anchor\"\u0026gt;\u0026lt;/span\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;/div\u0026gt; \n \u0026lt;img src=\"'.$cots[\"image_url\"].'\" height=\"170px\" width=\"260px\"/\u0026gt;\n\n \u0026lt;/a\u0026gt; \n\n \u0026lt;/div\u0026gt;';\n endforeach;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIm building this project using codeigniter, php and jquery. Any help will be appreciated.\u003c/p\u003e","answer_count":"3","comment_count":"9","creation_date":"2013-04-17 11:32:28.447 UTC","favorite_count":"1","last_activity_date":"2013-04-17 12:18:12.213 UTC","last_edit_date":"2013-04-17 11:56:05.91 UTC","last_editor_display_name":"","last_editor_user_id":"255118","owner_display_name":"","owner_user_id":"255118","post_type_id":"1","score":"0","tags":"php|jquery|ajax","view_count":"337"} +{"id":"33001797","title":"Groovy - Stored procedures that returns an OracleTypes.ARRAY","body":"\u003cp\u003eI have an issue with Groovy SQL while calling a Stored procedure which returns OracleTypes.ARRAY as output parameter.\u003c/p\u003e\n\n\u003ch1\u003eJava Code (Working fine):\u003c/h1\u003e\n\n\u003cpre\u003e\u003ccode\u003ecallableStatement.registerOutParameter(37, OracleTypes.ARRAY, DEVICE_RAW_DATA_ARRAY);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOracleTypes.ARRAY registerOutParameter was configured in JDBC(callableStatement), it was working fine.\n where as calling the same Stored procedure from Groovy SQL i am getting the following exception \"java.sql.SQLException: ORA-03115: unsupported network datatype or representation\"\u003c/p\u003e\n\n\u003ch1\u003eGroovy Code:\u003c/h1\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport groovy.sql.Sql\n\ndef sqlStr = \"{call prometheus.PKG_Device_FP_TLDID.SP_Save_Device_FP_Get_TLDID(?,?,?,?,?,?)}\"\n\ndef params = [ ID_IN,\n Request_ID_IN, \n Session_ID_IN, \n Sql.NUMERIC, \n Sql.VARCHAR, \n Sql.ARRAY // ARRAY Type output parameter -- Here I am getting Exception \"java.sql.SQLException: ORA-03115: unsupported network datatype or representation\" //\n\n]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI tried with different DATA TYPES LIKE Sql.ARRAY // OracleTypes.ARRAY // Sql.OracleTypes.ARRAY and other types.\u003c/p\u003e\n\n\u003cp\u003eCould you please suggest me the equivalent DATA TYPE for the OracleTypes.ARRAY in Groovy SQL.\u003c/p\u003e\n\n\u003cp\u003eThank you !!\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2015-10-07 20:24:02.58 UTC","last_activity_date":"2015-10-07 22:52:16.267 UTC","last_edit_date":"2015-10-07 22:52:16.267 UTC","last_editor_display_name":"","last_editor_user_id":"4803725","owner_display_name":"","owner_user_id":"4803725","post_type_id":"1","score":"1","tags":"groovy-sql","view_count":"43"} +{"id":"33468718","title":"What is the correct way to load CSS staticfiles using npm and Django?","body":"\u003cp\u003eI want to load my static css files (e.g., Bootstrap) from my node_modules directory, like so:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{% load staticfiles %}\n\u0026lt;link rel=\"stylesheet\" href=\"{% static 'bootstrap/dist/css/bootstrap.min.css' %}\" /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I put \u003ccode\u003e.../node_modules/\u003c/code\u003e in my \u003ccode\u003eSTATICFILES_DIRS\u003c/code\u003e setting, this works. However, it also adds an absolutely massive number of files to my \u003ccode\u003e/static/\u003c/code\u003e folder - mostly \u003ccode\u003edevDependencies\u003c/code\u003e that I don't need access to on the frontend.\u003c/p\u003e\n\n\u003cp\u003eWhat is the best practice for including certain static assets via npm, but not including everything from \u003ccode\u003enode_modules\u003c/code\u003e in my \u003ccode\u003e/static/\u003c/code\u003e folder?\u003c/p\u003e\n\n\u003cp\u003eOr, is it fine to include so many extraneous files and that's the best solution?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-11-02 00:02:11.547 UTC","last_activity_date":"2016-12-17 18:30:14.17 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2532070","post_type_id":"1","score":"4","tags":"django|django-staticfiles","view_count":"594"} +{"id":"41732054","title":"Create a two column layout with a vertically expanding container","body":"\u003cp\u003eI would like to create a two column layout (CSS only, no javascript).\u003c/p\u003e\n\n\u003cp\u003eThere are a few requirements that make this complicated:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eContainer starts with a specific height (e.g. \u003ccode\u003e200px\u003c/code\u003e)\u003c/li\u003e\n\u003cli\u003eThere are two columns\u003c/li\u003e\n\u003cli\u003eItems fill Column 1, then if more space is needed fill Column 2.\u003c/li\u003e\n\u003cli\u003eIf Column 1 \u0026amp; Column 2 are full, then expand the height of the container.\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eDetailed example \u003ca href=\"http://codepen.io/donpinkus/pen/VPPrab?editors=1100\" rel=\"nofollow noreferrer\"\u003ehere\u003c/a\u003e.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eBad\u003c/strong\u003e\n\u003ca href=\"https://i.stack.imgur.com/gsL0y.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/gsL0y.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eGood\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eElements first fill Column 1:\n\u003ca href=\"https://i.stack.imgur.com/njfil.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/njfil.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eNext, elements fill Column 2:\n\u003ca href=\"https://i.stack.imgur.com/J64lt.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/J64lt.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eWhen the container's minimum height is reached, the container expands and elements reflow between the two columns:\n\u003ca href=\"https://i.stack.imgur.com/Lu49J.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/Lu49J.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2017-01-19 00:57:54.263 UTC","last_activity_date":"2017-01-19 01:39:09.14 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1001938","post_type_id":"1","score":"4","tags":"css|css3|flexbox","view_count":"207"} +{"id":"18420211","title":"Creating a proc entry under an existing entry","body":"\u003cp\u003eMy kernel module would create an entry under an existing proc entry, e.g \u003ccode\u003e/proc/sys\u003c/code\u003e,\u003c/p\u003e\n\n\u003cp\u003eSo the ordinary call to \u003ccode\u003eproc_create\u003c/code\u003e fails.\u003c/p\u003e\n\n\u003cp\u003eThen I try to see if there's a function to obtain the right \u003ccode\u003eparent node\u003c/code\u003e, by checking proc_fs.h, but to no avail.\u003c/p\u003e\n\n\u003cp\u003eWhat should I do now?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-08-24 15:35:11.913 UTC","last_activity_date":"2013-09-19 06:31:44.03 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"614944","post_type_id":"1","score":"0","tags":"linux|kernel|procfs","view_count":"892"} +{"id":"32707633","title":"a day counter in android","body":"\u003cp\u003ei need to know how set up a counter in android witch is shown in an activity the counter is like this:\nit will start when the user first install the application and it will be automatically increment by the days for EX in if the user install the application monday then Wednesday the counter will be equal to 2 with the possibility to reset it to 0 when the user want\nand it will increment even if the user are not using the application\nthank in advance\u003c/p\u003e","accepted_answer_id":"32707743","answer_count":"1","comment_count":"0","creation_date":"2015-09-22 02:55:15.183 UTC","last_activity_date":"2015-09-22 03:09:31.507 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5360033","post_type_id":"1","score":"0","tags":"java|android|counter","view_count":"109"} +{"id":"43134132","title":"Unable to use database properties file in JavaLite","body":"\u003cp\u003eCould not load database properties file. \u003c/p\u003e\n\n\u003cp\u003eI have my \u003ccode\u003edatabase.properties\u003c/code\u003e file in class path resources folder and I have configured \u003ccode\u003eactivejdbc.properties\u003c/code\u003e at root of \u003ccode\u003eclasspathenv.connections.file=MyProject/src/main/resources/database.properties\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eI am using mvn to run my app:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emvn process-classes\n\nmvn activejdbc-instrumentation:instrument\n\nmvn package\n\nmvn compile exec:java\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I run the app with \u003ccode\u003eBase.open()\u003c/code\u003e, I get error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eorg.javalite.activejdbc.DBException: Could not find configuration in a property file for environment: development. Are you sure you have a database.properties file configured?\n at org.javalite.activejdbc.DB.open(DB.java:151)\n at org.javalite.activejdbc.Base.open(Base.java:52)\n at com.soul.seeker.Application.lambda$main$0(Application.java:52)\n at spark.FilterImpl$1.handle(FilterImpl.java:62)\n at spark.http.matching.BeforeFilters.execute(BeforeFilters.java:48)\n at spark.http.matching.MatcherFilter.doFilter(MatcherFilter.java:129)\n at spark.embeddedserver.jetty.JettyHandler.doHandle(JettyHandler.java:50)\n at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:189)\n at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)\n at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:119)\n at org.eclipse.jetty.server.Server.handle(Server.java:517)\n at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:308)\n at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:242)\n at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:261)\n at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)\n at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:75)\n at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:213)\n at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:147)\n at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)\n at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eupdate:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eRunning the sample from javalite github is working fine, however, changing this with \u003ca href=\"http://sparkjava.com/documentation.html#routes\" rel=\"nofollow noreferrer\"\u003espark routing\u003c/a\u003e, its throwing error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eget(\"/role_on_login\", (req, res) -\u0026gt; {\n Base.open();\n\n Person director = new Person(\"Stephen Spielberg\");\n director.saveIt();\n\n director.add(new Movie(\"Saving private Ryan\", 1998));\n director.add(new Movie(\"Jaws\", 1982));\n List data = director.getAll(Movie.class);\n Base.close();\n\n return data;\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eError:\u003c/strong\u003e \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[qtp1213754379-16] WARN org.eclipse.jetty.server.HttpChannel - //localhost:4567/role_on_login\norg.javalite.activejdbc.DBException: there is no connection 'default' on this thread, are you sure you opened it?\n at org.javalite.activejdbc.DB.connection(DB.java:754)\n at org.javalite.activejdbc.DB.createStreamingPreparedStatement(DB.java:521)\n at org.javalite.activejdbc.DB.find(DB.java:512)\n at org.javalite.activejdbc.LazyList.hydrate(LazyList.java:329)\n at org.javalite.activejdbc.AbstractLazyList.toString(AbstractLazyList.java:190)\n at spark.serialization.DefaultSerializer.process(DefaultSerializer.java:38)\n at spark.serialization.Serializer.processElement(Serializer.java:49)\n at spark.serialization.Serializer.processElement(Serializer.java:52)\n at spark.serialization.Serializer.processElement(Serializer.java:52)\n at spark.serialization.SerializerChain.process(SerializerChain.java:53)\n at spark.http.matching.Body.serializeTo(Body.java:72)\n at spark.http.matching.MatcherFilter.doFilter(MatcherFilter.java:189)\n at spark.embeddedserver.jetty.JettyHandler.doHandle(JettyHandler.java:50)\n at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:189)\n at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)\n at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:119)\n at org.eclipse.jetty.server.Server.handle(Server.java:517)\n at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:308)\n at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:242)\n at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:261)\n at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)\n at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:75)\n at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:213)\n at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:147)\n at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)\n at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)\n at java.lang.Thread.run(Unknown Source)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo seems like a thread issue where javalite \u003ccode\u003eBase.open()\u003c/code\u003e creates a thread named \"default\" and spark is not able comprehend the thread with name \"default\"\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2017-03-31 06:43:45.573 UTC","last_activity_date":"2017-04-14 19:53:19.853 UTC","last_edit_date":"2017-04-14 06:53:00.077 UTC","last_editor_display_name":"","last_editor_user_id":"1800583","owner_display_name":"","owner_user_id":"1800583","post_type_id":"1","score":"0","tags":"java|spark-java|activejdbc|javalite","view_count":"186"} +{"id":"4872237","title":"Can my program use Indy 10 at a customer site if I wrote it to use Indy 9?","body":"\u003cp\u003eI have written a program in Delphi 7 (includes a ModBus component that uses Indy). On my machine it uses Indy 9 and works fine. It communicates well with other machines via a ModBus protocol. However, when the program is run on a different machine, I get a CPU 90-100% load. Unfortunately this machine is not in my office but \"on the other side of the world\". How can I find out whether this machine is using Indy 9 or Indy 10? And, further, If it is running Indy 10, could that be the problem or is this very unlikely?\u003c/p\u003e","answer_count":"5","comment_count":"2","creation_date":"2011-02-02 08:33:17.59 UTC","last_activity_date":"2012-02-19 21:21:29.267 UTC","last_edit_date":"2011-02-02 16:16:05.067 UTC","last_editor_display_name":"","last_editor_user_id":"33732","owner_display_name":"","owner_user_id":"599670","post_type_id":"1","score":"1","tags":"delphi|debugging|indy10|modbus|indy-9","view_count":"400"} +{"id":"32031929","title":"Implementing write(), _write() or _write_r() with Newlib?","body":"\u003cp\u003eI am trying to retarget \u003ccode\u003eprintf()\u003c/code\u003e function for STM32F411RET microcontroller in ARM GCC toolchain environment which uses Newlib for standard C library.\u003c/p\u003e\n\n\u003cp\u003eWhen I search for how to retarget \u003ccode\u003eprintf()\u003c/code\u003e, many people says I need to implement \u003ccode\u003e_write()\u003c/code\u003e or \u003ccode\u003e_write_r()\u003c/code\u003e. And it seems both working.\u003c/p\u003e\n\n\u003cp\u003eBut I still have questions about them:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003e\u003cp\u003eWhen I look through the \u003ca href=\"https://sourceware.org/newlib/\" rel=\"nofollow\"\u003edocument of Newlib\u003c/a\u003e, it says I can implement \u003ccode\u003ewrite()\u003c/code\u003e to output files, but it doesn't look working. It looks like we can implement \u003ccode\u003e_write()\u003c/code\u003e but this function never be mentioned in the document. What happend to \u003ccode\u003ewrite()\u003c/code\u003e? does an underscore make anything different?\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eIn which situation \u003ccode\u003e_write_r()\u003c/code\u003e is preferable than \u003ccode\u003e_wirte()\u003c/code\u003e? I don't understand the concept of reenterncy in C. Any examples?\u003c/p\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eThanks for reading this.\u003c/p\u003e","accepted_answer_id":"32175840","answer_count":"1","comment_count":"5","creation_date":"2015-08-16 04:50:06.087 UTC","favorite_count":"1","last_activity_date":"2015-08-24 06:37:41.913 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4661625","post_type_id":"1","score":"2","tags":"c|gcc|arm|embedded|newlib","view_count":"2377"} +{"id":"8825217","title":"Get html background image object on client side","body":"\u003cp\u003eBackground:\nI wrote an website that is used to create wiring diagrams where the user drags a product from a list onto a div and the product appears. The product is a div with a class named the title of the product, and the image is in the class' background-image property. \u003c/p\u003e\n\n\u003cp\u003eProblem:\nI am now trying to implement a 'save as image' function. I am iterating through the div's and grabbing the url of the background image and using the url as the source of the image:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e var image = new Image();\n image.onload = function () {\n context.drawImage(image, parseInt(left), parseInt(top));\n };\n image.src = $(this).css('background-image').replace(/\"/g, \"\").replace(/url\\(|\\)$/ig, \"\");\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAfter this I am converting the image to a png and displaying it.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar img = canvas.toDataURL('image/png');\ndocument.write('\u0026lt;img src=\"' + img + '\"/\u0026gt;');\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe result is a blank image.\u003c/p\u003e\n\n\u003cp\u003eWhat I have tried:\nI suspect that my issue is that I am supplying the formatted url to the image source, and the browser is getting the image from the server again. This round trip is happening slower than the code. I confirmed this by separating the code blocks into separate functions and triggered them separately, one drawing the canvas, and one converting and displaying the image. Each function is triggered by separate buttons. This does work, so the added delay in-between functions allows the images to load.\u003c/p\u003e\n\n\u003cp\u003eQuestion:\nI think I am going about retrieving the image object incorrectly. How can I retrieve the cached image object that is the background image of the div. The image is in the client, and for the life of me, I cannot find anything online of retrieving this object. I am thinking it is stupid simple.\nThanks for any assistance.\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2012-01-11 19:11:07.323 UTC","last_activity_date":"2012-01-11 20:35:36.313 UTC","last_edit_date":"2012-01-11 20:35:36.313 UTC","last_editor_display_name":"","last_editor_user_id":"1130908","owner_display_name":"","owner_user_id":"1130908","post_type_id":"1","score":"0","tags":"javascript|html5|canvas|background-image","view_count":"668"} +{"id":"44372754","title":"Can data between android devices be sent just using the phone operating company?","body":"\u003cp\u003eBy using just the phone operating company I'm meaning a situation like this:\u003c/p\u003e\n\n\u003cp\u003eWhen you do a phone call, it looks like the only action that happens is \"only\" the phone call being received by the phone operating company and then it redirects the phone call to the called number so the communication can be stablished.\u003c/p\u003e\n\n\u003cp\u003eI think something similar should be possible with sent data, you just send the data with a format that indicates in a similar way that it's trying to connect with another phone, expect it to be received by the phone operating company and have it delivered to that phone.\u003c/p\u003e\n\n\u003cp\u003eI know technologies are far from being the same but I think that the comparison still applies.\u003c/p\u003e\n\n\u003cp\u003eFrom what I've read here it looks like it's not possible to do something like that, whatever the case you are going to need a server on the internet that deals with that be it directly or indirectly. Looks like my best option would be using something like PubNub, anyway it looks that it hasn't been explicitly determined that something like that cannot be done, also answers related to sending data between devices were a bit old, so just in case I'd like to know if that's possible.\u003c/p\u003e\n\n\u003cp\u003eThanks for your time.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-06-05 15:51:39.187 UTC","last_activity_date":"2017-06-06 11:35:55.92 UTC","last_edit_date":"2017-06-05 16:24:32.61 UTC","last_editor_display_name":"","last_editor_user_id":"2638180","owner_display_name":"","owner_user_id":"2638180","post_type_id":"1","score":"1","tags":"android|telecommunication","view_count":"35"} +{"id":"39956500","title":"Use of user input date in a calculated field","body":"\u003cp\u003eI'm trying to count how many records, in a query, have a date iqual ou superior to the one entered by end user, in a text box on that same form.\nThe query field to test is [ABERTO EM] and the text box with a user date is [tbDesde].\u003c/p\u003e\n\n\u003cp\u003eThis formula doesn't work:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e=Count(IIf([ABERTO EM]\u0026gt;[tbDesde];1;Null))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis one, with fixed date, works:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e=Count(IIf([ABERTO EM]\u0026gt;#01-07-2016#;1;Null))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eChanging it to \"=[tbDesde]\" I get the value in [tbDesde]; the same with \"=DateValue([tbDesde])\" (the first seems to return text,with left alignment, the second a date with right alignment).\u003c/p\u003e\n\n\u003cp\u003eCan someone help me on this?\u003c/p\u003e","answer_count":"0","comment_count":"4","creation_date":"2016-10-10 10:45:52.457 UTC","last_activity_date":"2016-10-10 10:45:52.457 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6948648","post_type_id":"1","score":"0","tags":"ms-access","view_count":"35"} +{"id":"9853273","title":"How to resize the image to be uploaded in JSP to a fix resolution?","body":"\u003cp\u003eI am uploading images for my site , I want every image uploaded to the server be of constant size.\nSo, when I display them from server to my site they can be uploaded quickly and the images use less server space.\u003c/p\u003e\n\n\u003cp\u003ecode I am using to upload image using JSP.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elogo_name = System.currentTimeMillis() + \".png\";\n File uploadedFile = new File(\"/www/static.appcanvas.com/\"+logo_name);\n item.write(uploadedFile);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny related articles , some hints will be of great help\u003c/p\u003e","accepted_answer_id":"9854247","answer_count":"1","comment_count":"3","creation_date":"2012-03-24 16:18:27.73 UTC","last_activity_date":"2012-03-24 18:17:41.03 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1212834","post_type_id":"1","score":"0","tags":"image|jsp","view_count":"3031"} +{"id":"2386415","title":"deployment to another server","body":"\u003cp\u003eHow to deploy the SSIS package to another server ? What are the steps to be done for deployment in an another server ?\u003c/p\u003e","accepted_answer_id":"2387432","answer_count":"1","comment_count":"1","creation_date":"2010-03-05 11:46:59.88 UTC","last_activity_date":"2010-03-05 14:34:46.373 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"270852","post_type_id":"1","score":"1","tags":"ssis","view_count":"57"} +{"id":"16328875","title":"How to find out what view a touch event ended at?","body":"\u003cp\u003eI wish to drag a UIImage on to one of several UIButtons and have it repositioned based on which button I drag it to.\u003c/p\u003e\n\n\u003cp\u003eThe problem I've ran in to is that UITouch only records the view where my touch began, I'd like to access the view my touch ends at. How can I do this?\u003c/p\u003e\n\n\u003cp\u003eCode:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e-(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event\n{\n UITouch *touch = [touches anyObject];\n CGPoint location = [touch locationInView:self.view];\n\n dealerBtnOrigin = [touch locationInView:self.view];\n\n //NSLog(@\"%u %u\",touch.view.tag, ((UIView *)[dealerBtns objectAtIndex:[table getButtonSeat]]).tag);\n //CHECK TO SEE WHICH BUTTON WAS TOUCHED\n if (touch.view == ((UIView *)[dealerBtns objectAtIndex:[table getButtonSeat]]))\n {\n ((UIView *)[dealerBtns objectAtIndex:[table getButtonSeat]]).center = location;\n }\n}\n\n-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event\n{\n UITouch *touch = [touches anyObject];\n CGPoint location = [touch locationInView:self.view];\n\n\n if (touch.view == ((UIView *)[dealerBtns objectAtIndex:[table getButtonSeat]]))\n {\n ((UIView *)[dealerBtns objectAtIndex:[table getButtonSeat]]).center = location;\n }\n}\n\n-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event\n{\n UITouch *touch = [touches anyObject];\n CGPoint location = [touch locationInView:self.view];\n UIView *endView = [self.view hitTest:location withEvent:nil];\n\n if (touch.view == ((UIView *)[dealerBtns objectAtIndex:[table getButtonSeat]]))\n {\n NSLog(@\"%u %u\",endView.tag, touch.view.tag);\n if([buttons containsObject:(UIButton *)endView])\n {\n [[dealerBtns objectAtIndex:[table getButtonSeat]] setHidden:YES];\n [table passButton:touch.view.tag];\n [[dealerBtns objectAtIndex: touch.view.tag] setHidden:NO];\n }\n ((UIView *)[dealerBtns objectAtIndex:[table getButtonSeat]]).center = dealerBtnOrigin;\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"16329436","answer_count":"4","comment_count":"1","creation_date":"2013-05-02 01:15:24.61 UTC","favorite_count":"4","last_activity_date":"2016-03-14 19:36:58.993 UTC","last_edit_date":"2014-12-18 07:00:52.627 UTC","last_editor_display_name":"","last_editor_user_id":"457406","owner_display_name":"","owner_user_id":"957245","post_type_id":"1","score":"16","tags":"ios|objective-c|touch|uitouch","view_count":"21003"} +{"id":"44420327","title":"PHP HTML table retrieve multiple data in one \u003ctd\u003e tag","body":"\u003cp\u003eI'm trying to generate a list from database in a HTML table just like image below;\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/61XLl.png\" rel=\"nofollow noreferrer\"\u003ehttps://i.stack.imgur.com/61XLl.png\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eAnd here's what i did;\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/lLsvF.png\" rel=\"nofollow noreferrer\"\u003ehttps://i.stack.imgur.com/lLsvF.png\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eAnd the code;\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;table cellpadding=\"3\" border=\"1\" style=\"width:100%;margin-top:30px; margin-bottom:50px; font-size:12px\"\u0026gt;\n \u0026lt;thead\u0026gt; \n \u0026lt;tr\u0026gt;\n \u0026lt;th\u0026gt;KURSUS\u0026lt;/th\u0026gt;\n \u0026lt;th rowspan=\"2\"\u0026gt;NAMA PENSYARAH\u0026lt;/th\u0026gt;\n \u0026lt;th rowspan=\"2\"\u0026gt;NO. SIRI\u0026lt;/th\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;th\u0026gt;NAMA\u0026lt;/th\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;/thead\u0026gt;\n \u0026lt;tbody align=\"center\"\u0026gt;\n \u0026lt;?php\n if($numrow\u0026gt;0)\n {\n while($row = $select-\u0026gt;fetch_assoc()){\n\n $code=explode(\"/\",$row['po_code']);\n $list=$connect-\u0026gt;query(\"SELECT * FROM polist WHERE polist_poid='\".$row['po_id'].\"' ORDER BY polist_bil ASC\");\n ?\u0026gt;\n\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;?php echo $row['po_name']; ?\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;?php while($rowlist = $list-\u0026gt;fetch_assoc()){ \n\n $name=$connect-\u0026gt;query(\"SELECT * FROM user WHERE user_id='\".$rowlist['polist_userid'].\"'\");\n $rowname=$name-\u0026gt;fetch_array();?\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;?php echo $rowname['user_name']; ?\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;?php echo $code[0].\"/PO/\".$code[1].\" - \".$rowlist['polist_bil']; ?\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;?php } ?\u0026gt;\n \u0026lt;/tr\u0026gt;\n\n \u0026lt;?php\n }\n }\n ?\u0026gt;\n \u0026lt;/tbody\u0026gt;\n\u0026lt;/table\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHelp me. Thank you in advance :)\u003c/p\u003e","accepted_answer_id":"44420746","answer_count":"2","comment_count":"0","creation_date":"2017-06-07 18:34:26.073 UTC","last_activity_date":"2017-06-07 18:57:56.72 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7545694","post_type_id":"1","score":"0","tags":"php|html|mysql","view_count":"76"} +{"id":"17807600","title":"Check php array elements in spesific range","body":"\u003cp\u003eI can check if some integer value (which comes from user input, and thus should be filtered) is in specific range like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\n $size=50;\n var_dump(in_array($size,range(1,100)));\n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhich will echo true if the size in range 1 to 100. Of course the other method is using filters:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\n $size=50;\n $int_options = array(\"options\"=\u0026gt;\n array(\"min_range\"=\u0026gt;0, \"max_range\"=\u0026gt;256));\n var_dump(filter_var($size, FILTER_VALIDATE_INT, $int_options));\n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut, what if I need to know if the elements of an array are in this range?(and probably remove those not) What is the best practice, considering the performance and memory usage. I prefer to use php functions instead of writing mine.\u003c/p\u003e","accepted_answer_id":"17807721","answer_count":"2","comment_count":"2","creation_date":"2013-07-23 10:29:07.84 UTC","last_activity_date":"2013-07-23 10:37:29.74 UTC","last_edit_date":"2013-07-23 10:37:29.74 UTC","last_editor_display_name":"","last_editor_user_id":"5104596","owner_display_name":"","owner_user_id":"5104596","post_type_id":"1","score":"1","tags":"php|arrays|filter|integer|range","view_count":"1566"} +{"id":"9474395","title":"How to break up a paragraph by sentences in Python","body":"\u003cp\u003eI need to parse sentences from a paragraph in Python. Is there an existing package to do this, or should I be trying to use regex here?\u003c/p\u003e","accepted_answer_id":"9474645","answer_count":"2","comment_count":"5","creation_date":"2012-02-28 00:06:14.607 UTC","favorite_count":"4","last_activity_date":"2016-10-28 19:39:06.177 UTC","last_edit_date":"2014-09-08 04:13:22.297 UTC","last_editor_display_name":"","last_editor_user_id":"527702","owner_display_name":"","owner_user_id":"651174","post_type_id":"1","score":"7","tags":"python|regex|text-segmentation","view_count":"12422"} +{"id":"47189704","title":"Creating child objects on basis created parent object in java","body":"\u003cp\u003eI'm learning java design patterns and I wonder if I can apply some with following problem. I have class Solider and some child classes, for example: General and Sergeant. I'm creating Solider object and in runtime I want to change this object to General or Sergeant object, or create new Sergeant or General object using created earlier Solider object:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Solider s = new Solider(...);\n .....\n if (generalCondition) {\n General g = createGeneralFromSolider(s);\n //or better:\n //General g = promoteSoliderToGeneral(s);\n } else if (sergeantCondition) {\n Sergeant sr = createSergeantFromSolider(s);\n //or better:\n //Sergeant sr = promoteSoliderToSergeant(s);\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFirstly I decided to create additional constructor in General/Sergeant Class:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eClass General extends Solider {\n General(Solider s, Map\u0026lt;String, String\u0026gt; generalSpecificParams) {\n //first we are going to copy all solider params to general params (bad idea if we have a lot of params)\n this.setParamX(s.getParamX());\n ....\n //then we can assign the rest of general-specific params\n this.setGeneralSpecificParams(generalSpecificParams);\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand use it in methods createGeneralFromSolider but I'm not sure if it is elegant way. Main disadvantage is that I create new object, so after calling createGeneralFromSolider I have 2 object in memory. I would rather have one object in memory: General/Sergeant promoted from Solider (object General/Sergeant which earlier was the Solider object). I wonder if I can use some design patter to resolve it. I remember that in C++ there has been something like copying constructors which copying all params from one object to another by assigning all params, one after another. In Java I didn't hear about anything similar.\u003c/p\u003e","accepted_answer_id":"47190072","answer_count":"4","comment_count":"1","creation_date":"2017-11-08 21:06:59.533 UTC","last_activity_date":"2017-11-09 09:47:19.75 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7154018","post_type_id":"1","score":"0","tags":"java|design-patterns","view_count":"62"} +{"id":"4506704","title":"How to disable line buffering of input in xterm from program?","body":"\u003cp\u003eIe, how to get keystrokes send directly to my program without waiting for the user to press enter. Basicly I'm trying get something like curses's \u003ccode\u003ecbreak()\u003c/code\u003e call. (But I can't use curses due a couple of bugs/misfeatures that I haven't been able to work around.) This seems like something that should just be a trival escape sequence, but I haven't been able find anything.\u003c/p\u003e","accepted_answer_id":"4506801","answer_count":"2","comment_count":"0","creation_date":"2010-12-22 06:25:28.043 UTC","last_activity_date":"2010-12-22 06:54:00.01 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"163349","post_type_id":"1","score":"0","tags":"c|input|buffering|xterm","view_count":"1118"} +{"id":"29750307","title":"R - Change default argument of nested function call","body":"\u003cp\u003eI am trying to configure \u003ccode\u003eupdateR()\u003c/code\u003e from the package \u003ccode\u003einstallr\u003c/code\u003e to use my company's internal CRAN to make upgrading easier for end users. \u003ccode\u003eupdateR()\u003c/code\u003e makes use of another function, \u003ccode\u003echeck.for.updates.R()\u003c/code\u003e to determine if a newer version exists. \u003ccode\u003echeck.for.updates.R()\u003c/code\u003e has an argument, \u003ccode\u003epage_with_download_url=\"http://cran.rstudio.com/bin/windows/base/\"\u003c/code\u003e that I want to set to \u003ccode\u003e\"http://internal/cran/bin/windows/base/\"\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eI used \u003ccode\u003eformals(check.for.updates.R)$page_with_download_url = \"http://lnxaws01/cran/bin/windows/base/\"\u003c/code\u003e to try and set the default argument.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eformals(check.for.updates.R)\n#\u0026gt;$notify_user\n#\u0026gt;[1] TRUE\n#\u0026gt;\n#\u0026gt;$use_GUI\n#\u0026gt;[1] TRUE\n#\u0026gt;\n#\u0026gt;$page_with_download_url\n#\u0026gt;[1] \"http://internal/cran/bin/windows/base/\"\n#\u0026gt;\n#\u0026gt;$pat\n#\u0026gt;[1] \"R-[0-9.]+-win\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo, that seems to have worked. Check that it's actually working:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003echeck.for.updates.R(use.GUI=F)\n#\u0026gt;No need to update. You are using the latest R version: \n R version 3.1.3 (2015-03-09)[1] FALSE\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNote - at the time of posting this, R 3.2.0 has just been released, our internal CRAN is still running 3.1.3 so this is the correct response.\u003c/p\u003e\n\n\u003cp\u003eHowever, \u003ccode\u003eupdateR()\u003c/code\u003e continues to check the RStudio CRAN and ends up thinking there's a new package available.\u003c/p\u003e\n\n\u003cp\u003eWith the \u003ccode\u003eDefaults\u003c/code\u003e package removed from CRAN (and maybe it wouldn't have helped anyway) how can I change the default argument value for a function nested inside another function?\u003c/p\u003e","accepted_answer_id":"29750851","answer_count":"1","comment_count":"0","creation_date":"2015-04-20 14:12:41.853 UTC","last_activity_date":"2015-04-20 14:36:22.997 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2890590","post_type_id":"1","score":"1","tags":"r","view_count":"78"} +{"id":"11372364","title":"Does Azure WritePages for an existing blob works on Storage Emulator","body":"\u003cp\u003eI have an already existing page blob on my Storage Emulator. Now I'm trying to write some more bytes to it using WritePages but it doesn't seem to work. Does Storage Emulator support that or am I doing something wrong maybe?\u003c/p\u003e\n\n\u003cp\u003eHere's how I'm trying to do it.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e var account = CloudStorageAccount.Parse(\"UseDevelopmentStorage=true\");\n\n var blobClient = account.CreateCloudBlobClient();\n\n var blobContainer = blobClient.GetContainerReference(\"mycontainer\");\n blobContainer.CreateIfNotExist();\n blobContainer.SetPermissions(new BlobContainerPermissions() { PublicAccess = BlobContainerPublicAccessType.Blob });\n\n var pageBlob = blobContainer.GetPageBlobReference(\"filepage.txt\");\n pageBlob.FetchAttributes();\n\n byte[] data = File.ReadAllBytes(@\"C:\\Temp\\moretext.txt\");\n Array.Resize(ref data, 512);\n\n pageBlob.WritePages(new MemoryStream(data), 0);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","accepted_answer_id":"11402730","answer_count":"1","comment_count":"0","creation_date":"2012-07-07 04:56:11.823 UTC","last_activity_date":"2012-07-09 20:36:52.843 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"197464","post_type_id":"1","score":"0","tags":".net|azure|cloud|azure-storage-blobs","view_count":"267"} +{"id":"40375217","title":"Chart.js - cannot fetch result from MySQL via PHP","body":"\u003cp\u003eI am trying to populate a chart via the ChartJS plugin with data from my MySQL database, but while doing so I am running into a \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003emysqli_fetch_assoc(): Couldn't fetch mysqli_result in ...\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eerror.Since I am using json_encode I tried to adjust the fetch array but cant seem to figure this one out.\u003c/p\u003e\n\n\u003cp\u003eAny help would be much appreciated.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;div class=\"box-body\"\u0026gt;\n \u0026lt;div class=\"chart\"\u0026gt;\n\n \u0026lt;canvas id=\"canvas_bar\" style=\"height:250px\"\u0026gt;\u0026lt;/canvas\u0026gt;\n\n \u0026lt;?php\n // Start MySQLi connection\n $db = new MySQLi($dbhost,$dbuser,$dbpass,$dbname);\n if ($db-\u0026gt;connect_errno) { echo \"Failed to connect to MySQL: (\" . $db-\u0026gt;connect_errno . \") \" . $db-\u0026gt;connect_error; }\n\n // count all records per month\n $sql = \"SELECT LOWER(MONTHNAME(mod_date)) AS mdate, count(*) AS cnt FROM qci_modreport GROUP BY LOWER(MONTHNAME(mod_date))\";\n\n if (!($result)) {\n print \"ERROR, something wrong with the query.\";\n } else {\n $output = array();\n\n while ($row = mysqli_fetch_assoc($result)) {\n $output[$row['mdate']] = $row['cnt'];\n }\n print (json_encode($output));\n }\n ?\u0026gt;\n\n \u0026lt;!-- chartJS 1.0.1--\u0026gt;\n \u0026lt;!-- \u0026lt;script src=\"./plugins/chartjs/Chart.js\"\u0026gt;\u0026lt;/script\u0026gt; --\u0026gt;\n \u0026lt;script src=\"../../plugins/chartjs/Chart.min.js\"\u0026gt;\u0026lt;/script\u0026gt; \n \u0026lt;script\u0026gt;\n var barChartData = {\n labels: \u0026lt;?php echo json_encode(array_keys($output)); ?\u0026gt;,\n datasets: [\n {\n fillColor: \"#03586A\", //rgba(151,187,205,0.5)\n strokeColor: \"#03586A\", //rgba(151,187,205,0.8)\n highlightFill: \"#066477\", //rgba(151,187,205,0.75)\n highlightStroke: \"#066477\", //rgba(151,187,205,1)\n data: \u0026lt;?php echo json_encode(array_values($output)); ?\u0026gt;\n }]\n };\n $(document).ready(function () {\n new Chart($(\"#canvas_bar\").get(0).getContext(\"2d\")).Bar(barChartData, {\n tooltipFillColor: \"rgba(51, 51, 51, 0.55)\",\n responsive: true,\n barDatasetSpacing: 6,\n barValueSpacing: 5\n });\n });\n\n\n\n \u0026lt;/script\u0026gt;\n\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;!-- /.box-body --\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"40375307","answer_count":"1","comment_count":"3","creation_date":"2016-11-02 08:16:31.413 UTC","favorite_count":"1","last_activity_date":"2016-11-02 09:14:46.603 UTC","last_edit_date":"2016-11-02 09:14:46.603 UTC","last_editor_display_name":"","last_editor_user_id":"2681133","owner_display_name":"","owner_user_id":"2681133","post_type_id":"1","score":"2","tags":"javascript|php|mysql|chart.js","view_count":"170"} +{"id":"25017320","title":"Rails CSV import failing with optional columns","body":"\u003cp\u003eI'm importing a csv file with product info into a rails 4 app. I have four image fields in the csv. If some products have less than 4 images, the file doesn't load. \u003c/p\u003e\n\n\u003cp\u003eHere is my import code in the model:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef self.import(file, userid)\n\n CSV.foreach(file.path, headers: true) do |row|\n\n listing_hash = {:name =\u0026gt; row['Name'], :description =\u0026gt; row['Description'], \n :price =\u0026gt; row['Price'], :category =\u0026gt; row['Category'], :inventory =\u0026gt; row['Inventory'],\n :image =\u0026gt; URI.parse(row['Image']), :image2 =\u0026gt; URI.parse(row['Image2']),\n :image3 =\u0026gt; URI.parse(row['Image3']), :image4 =\u0026gt; URI.parse(row['Image4']),\n :userid =\u0026gt; userid}\n\n listing = Listing.where(name: listing_hash[\"name\"]) \n\n if listing.count == 1 \n listing.first.update_attributes(listing_hash)\n else\n Listing.create!(listing_hash)\n end # end if !product.nil?\n end # end CSV.foreach\nend # end self.import(file)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy validates statement in the model doesn't require even a single image.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evalidates :name, :description, :price, :inventory, :category, presence: true\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow do I fix it so that the csv imports even if a product doesn't have all 4 images?\u003c/p\u003e","accepted_answer_id":"25045580","answer_count":"1","comment_count":"4","creation_date":"2014-07-29 14:03:41.067 UTC","favorite_count":"1","last_activity_date":"2014-07-30 19:43:16.353 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3749901","post_type_id":"1","score":"0","tags":"ruby-on-rails|csv","view_count":"436"} +{"id":"16832317","title":"How to Change iframe every 10 sec","body":"\u003cp\u003eHow to change iframe every 15seconds. I have wat to show content inside an iframe. I want to show it on a single box approximately of 310px in width. Please give me detailed code because I am total newbie to javascript. Thanks in advance.\u003c/p\u003e","accepted_answer_id":"16832417","answer_count":"1","comment_count":"5","creation_date":"2013-05-30 09:21:46.563 UTC","last_activity_date":"2013-05-30 09:34:21.407 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2435845","post_type_id":"1","score":"-10","tags":"javascript|iframe","view_count":"323"} +{"id":"33064132","title":"How to store current audio information in bottom panel (AVAudioPlayer, Swift)","body":"\u003cp\u003eI'm playing audio using AVPlayer but when it's playing there is no any information about it in bottom ios panel\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/F87Zc.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/F87Zc.png\" alt=\"\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eSo how can I add information about my audio here and synchronize system volume level with my UISlider in app which changed volume? Also it's very important to make play and pause buttons on locked screen but I don't know how to do this. I don't know obj-c too that's why some examples on stack is unuseable for me.\u003c/p\u003e","accepted_answer_id":"33064307","answer_count":"1","comment_count":"3","creation_date":"2015-10-11 10:54:10.46 UTC","last_activity_date":"2015-10-11 11:12:24.797 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5164739","post_type_id":"1","score":"0","tags":"swift|audio|ios9|avplayer|avaudiosession","view_count":"397"} +{"id":"42020274","title":"Extracting string based object from array","body":"\u003cp\u003eI have any \u003ccode\u003eNSarray\u003c/code\u003e of \u003ccode\u003eNSString\u003c/code\u003e objects.\u003c/p\u003e\n\n\u003cp\u003eI want to extract those string which only contains character or character\u0026amp;numeric from it.\u003c/p\u003e\n\n\u003cp\u003eFor example: \"D6,Bombay.Hello”\" is valid whereas “123456.123,56” is invalid.\u003c/p\u003e\n\n\u003cp\u003ePlease help if anyone have idea.\u003c/p\u003e","accepted_answer_id":"42020576","answer_count":"2","comment_count":"3","creation_date":"2017-02-03 08:55:30.727 UTC","last_activity_date":"2017-02-03 11:38:12.247 UTC","last_edit_date":"2017-02-03 11:38:12.247 UTC","last_editor_display_name":"","last_editor_user_id":"545650","owner_display_name":"","owner_user_id":"5238800","post_type_id":"1","score":"0","tags":"ios|objective-c","view_count":"60"} +{"id":"45197200","title":"duplicate views in view hierarchy testing using espresso with react native","body":"\u003cp\u003eI'm trying to run tests I've created in espresso to test a react native app. I'm trying to target particular buttons to be clicked using AccessibilityLabels, which are successfully appearing as content-descriptions and are being targeted by espresso. The problem is, I'm getting errors because espresso thinks they are duplicate views, however, they only appear in my react native code once. I am using a common button component in react native. Any ideas whats causing this?\u003c/p\u003e\n\n\u003cp\u003eThe error is below: id 47 and 76 are the duplicated views\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e android.support.test.espresso.AmbiguousViewMatcherException: '(with content description: is \"LOG IN\" and is displayed on the screen to the user)' matches multiple views in the hierarchy.\nProblem views are marked with '****MATCHES****' below.\n\nView Hierarchy:\n+\u0026gt;DecorView{id=-1, visibility=VISIBLE, width=1080, height=1920, has-focus=false, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=3}\n|\n+-\u0026gt;LinearLayout{id=-1, visibility=VISIBLE, width=1080, height=1794, has-focus=false, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=2}\n|\n+--\u0026gt;ViewStub{id=16909295, res-name=action_mode_bar_stub, visibility=GONE, width=0, height=0, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=true, is-selected=false, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0}\n|\n+--\u0026gt;FrameLayout{id=16908290, res-name=content, visibility=VISIBLE, width=1080, height=1731, has-focus=false, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=63.0, child-count=1}\n|\n+---\u0026gt;ReactRootView{id=1, visibility=VISIBLE, width=1080, height=1731, has-focus=false, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=1}\n|\n+----\u0026gt;ReactViewGroup{id=10, visibility=VISIBLE, width=1080, height=1731, has-focus=false, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=1}\n|\n+-----\u0026gt;ReactViewGroup{id=14, visibility=VISIBLE, width=1080, height=1731, has-focus=false, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=1}\n|\n+------\u0026gt;ReactViewGroup{id=15, visibility=VISIBLE, width=1080, height=1731, has-focus=false, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=2}\n|\n+-------\u0026gt;ReactViewGroup{id=18, visibility=VISIBLE, width=1080, height=1731, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=1}\n|\n+--------\u0026gt;ReactViewGroup{id=19, visibility=VISIBLE, width=1080, height=1731, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=1}\n|\n+---------\u0026gt;ReactImageView{id=22, visibility=VISIBLE, width=788, height=263, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, root-is-layout-requested=false, has-input-connection=false, x=146.0, y=734.0}\n|\n+-------\u0026gt;ReactViewGroup{id=24, visibility=VISIBLE, width=1080, height=1731, has-focus=false, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=1}\n|\n+--------\u0026gt;ReactViewGroup{id=25, visibility=VISIBLE, width=1080, height=1731, has-focus=false, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=2}\n|\n+---------\u0026gt;ReactViewGroup{id=28, visibility=VISIBLE, width=1080, height=1731, has-focus=false, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=1}\n|\n+----------\u0026gt;ReactViewGroup{id=32, visibility=VISIBLE, width=1080, height=1731, has-focus=false, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=8}\n|\n+-----------\u0026gt;ReactImageView{id=35, visibility=VISIBLE, width=1080, height=447, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=-79.0}\n|\n+-----------\u0026gt;ReactViewGroup{id=36, visibility=VISIBLE, width=1080, height=0, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=-158.0, child-count=0}\n|\n+-----------\u0026gt;ReactViewGroup{id=37, visibility=VISIBLE, width=1080, height=157, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=-158.0, child-count=0}\n|\n+-----------\u0026gt;ReactImageView{id=40, visibility=VISIBLE, width=788, height=262, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, root-is-layout-requested=false, has-input-connection=false, x=146.0, y=457.0}\n|\n+-----------\u0026gt;ReactTextView{id=43, visibility=VISIBLE, width=1027, height=155, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, root-is-layout-requested=false, has-input-connection=false, x=26.0, y=853.0, text=The easy way to organise parties, events, share pictures and memories with friends, family and groups., input-type=0, ime-target=false, has-links=false}\n|\n+-----------\u0026gt;ReactViewGroup{id=47, desc=LOG IN, visibility=VISIBLE, width=975, height=174, has-focus=false, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=true, is-layout-requested=false, is-selected=false, root-is-layout-requested=false, has-input-connection=false, x=53.0, y=1148.0, child-count=1} ****MATCHES****\n|\n+------------\u0026gt;ReactTextView{id=48, visibility=VISIBLE, width=150, height=65, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, root-is-layout-requested=false, has-input-connection=false, x=413.0, y=54.0, text=LOG IN, input-type=0, ime-target=false, has-links=false}\n|\n+-----------\u0026gt;ReactTextView{id=52, visibility=VISIBLE, width=56, height=57, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, root-is-layout-requested=false, has-input-connection=false, x=512.0, y=1355.0, text=OR, input-type=0, ime-target=false, has-links=false}\n|\n+-----------\u0026gt;ReactViewGroup{id=54, desc=SIGN UP, visibility=VISIBLE, width=975, height=173, has-focus=false, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=true, is-layout-requested=false, is-selected=false, root-is-layout-requested=false, has-input-connection=false, x=53.0, y=1453.0, child-count=1}\n|\n+------------\u0026gt;ReactTextView{id=55, visibility=VISIBLE, width=182, height=65, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, root-is-layout-requested=false, has-input-connection=false, x=397.0, y=54.0, text=SIGN UP, input-type=0, ime-target=false, has-links=false}\n|\n+---------\u0026gt;ReactViewGroup{id=57, visibility=VISIBLE, width=1080, height=1731, has-focus=false, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=1}\n|\n+----------\u0026gt;ReactViewGroup{id=60, visibility=VISIBLE, width=1080, height=1731, has-focus=false, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=8}\n|\n+-----------\u0026gt;ReactImageView{id=64, visibility=VISIBLE, width=1080, height=447, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=-79.0}\n|\n+-----------\u0026gt;ReactViewGroup{id=65, visibility=VISIBLE, width=1080, height=0, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=-158.0, child-count=0}\n|\n+-----------\u0026gt;ReactViewGroup{id=66, visibility=VISIBLE, width=1080, height=157, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=-158.0, child-count=0}\n|\n+-----------\u0026gt;ReactImageView{id=69, visibility=VISIBLE, width=788, height=262, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, root-is-layout-requested=false, has-input-connection=false, x=146.0, y=457.0}\n|\n+-----------\u0026gt;ReactTextView{id=72, visibility=VISIBLE, width=1027, height=155, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, root-is-layout-requested=false, has-input-connection=false, x=26.0, y=853.0, text=The easy way to organise parties, events, share pictures and memories with friends, family and groups., input-type=0, ime-target=false, has-links=false}\n|\n\n// this is the same as id=47\n+-----------\u0026gt;ReactViewGroup{id=76, desc=LOG IN, visibility=VISIBLE, width=975, height=174, has-focus=false, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=true, is-layout-requested=false, is-selected=false, root-is-layout-requested=false, has-input-connection=false, x=53.0, y=1148.0, child-count=1} ****MATCHES****\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-07-19 17:23:47.257 UTC","last_activity_date":"2017-07-19 17:23:47.257 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3461638","post_type_id":"1","score":"0","tags":"android|react-native|automated-tests|espresso","view_count":"26"} +{"id":"6869841","title":"Zend framework identical validator does not work","body":"\u003cp\u003eI have a problem with identical validator of zend framework. I have two elements (password and verify password) and wanna make sure they are identical. But identical validator does not work for me. The tokens are always not match: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass Form_MemberRegisterationForm extends Zend_Form\n{\n public function init()\n { \n $password = $this-\u0026gt;createElement('password', 'password1');\n $password-\u0026gt;setLabel('Password:');\n $password-\u0026gt;setRequired(TRUE);\n $password-\u0026gt;setAttrib('size', 30);\n $password-\u0026gt;setErrorMessages(array (\"isEmpty\" =\u0026gt; \"Invalid Password!\" ));\n $this-\u0026gt;addElement($password);\n // \n $confirmPswd = $this-\u0026gt;createElement('password', \n 'confirmPassword');\n $confirmPswd-\u0026gt;setLabel('Verify password:');\n $confirmPswd-\u0026gt;setAttrib('size', 30);\n $confirmPswd-\u0026gt;addValidator('identical', false, \n array ('token' =\u0026gt; 'password1' ));\n\n $this-\u0026gt;addElement($confirmPswd);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat I am doing wrong?\u003c/p\u003e","accepted_answer_id":"6869960","answer_count":"3","comment_count":"0","creation_date":"2011-07-29 07:21:21.41 UTC","last_activity_date":"2011-08-01 06:44:47.583 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"275221","post_type_id":"1","score":"3","tags":"zend-framework|passwords","view_count":"2798"} +{"id":"41147569","title":"Wordpress: need to add post-specific code to avoid appearing in index and homepage","body":"\u003cp\u003eI'm new to this but I'm trying to add some Wordpress code for ACF that works in one theme to another theme that is set-up slightly differently. \u003c/p\u003e\n\n\u003cp\u003eThe code adds repeating list items to the post using the ACF plugin. \u003c/p\u003e\n\n\u003cp\u003eThe new theme uses a single part - content.php to generate output for both the index pages and the singular post page. On the previous theme there was single.php which as its name suggests contained the single post code ao I just dropped the code in there without issue and it didn't effect the index pages. \u003c/p\u003e\n\n\u003cp\u003eThe bit of content.php on the new theme I need to edit looks like this...\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;div class=\"entry-content\"\u0026gt;\n \u0026lt;?php\n\n // On archive views, display post thumbnail, if available, and excerpt.\n if ( ! is_singular() ) {\n\n if ( has_post_thumbnail() ) { ?\u0026gt;\n\n \u0026lt;a href=\"\u0026lt;?php the_permalink(); ?\u0026gt;\" title=\"\u0026lt;?php printf( esc_attr__( 'Link to %s', 'alienship' ), the_title_attribute( 'echo=0' ) ); ?\u0026gt;\"\u0026gt;\n \u0026lt;?php echo get_the_post_thumbnail( $post-\u0026gt;ID, 'thumbnail', array( 'class' =\u0026gt; 'alignleft', 'title' =\u0026gt; \"\" ) ); ?\u0026gt;\n \u0026lt;/a\u0026gt;\n \u0026lt;?php\n } // has_post_thumbnail()\n\n the_excerpt();\n\n } // if ( ! is_singular() )\n\n // On singular views, display post thumbnails in the post body if it's not big enough to be a header image\n else {\n $header_image = alienship_get_header_image( get_the_ID() );\n if ( has_post_thumbnail() \u0026amp;\u0026amp; 'yes' != $header_image['featured'] ) { ?\u0026gt;\n\n \u0026lt;a href=\"\u0026lt;?php the_permalink(); ?\u0026gt;\" title=\"\u0026lt;?php printf( esc_attr__( 'Link to %s', 'alienship' ), the_title_attribute( 'echo=0' ) ); ?\u0026gt;\"\u0026gt;\n \u0026lt;?php echo get_the_post_thumbnail( $post-\u0026gt;ID, 'medium', array( 'class' =\u0026gt; 'alignright', 'title' =\u0026gt; \"\" ) ); ?\u0026gt;\n \u0026lt;/a\u0026gt;\n \u0026lt;?php\n }\n\n the_content();\n }\n\n wp_link_pages(); ?\u0026gt;\n\u0026lt;/div\u0026gt;\u0026lt;!-- .entry-content --\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI need my code to appear below the_content and above wp_link_pages\u003c/p\u003e\n\n\u003cp\u003eProblem is my code starts of with its own If statement. See below: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;!-- List Stuff Starts --\u0026gt;\n\n \u0026lt;?php if( have_rows('list_items') ): ?\u0026gt;\n\n\n\n \u0026lt;?php while( have_rows('list_items') ): the_row(); \n\n // vars\n $item_name = get_sub_field('item_name');\n $item_image = get_sub_field('item_image');\n $item_meta1_label = get_sub_field('item_meta_1_label');\n $item_meta1_content = get_sub_field('item_meta_1_content');\n $item_content = get_sub_field('item_content');\n $item_price = get_sub_field('item_price');\n $item_old_price = get_sub_field('item_old_price');\n $item_url = get_sub_field('item_url');\n ?\u0026gt;\n\n \u0026lt;div class=\"row blog-list-row\"\u0026gt;\n \u0026lt;?php if($item_url): ?\u0026gt;\n \u0026lt;div class=\"col-sm-4 mobile-center mobile-padding\"\u0026gt;\n \u0026lt;a href=\"\u0026lt;?php echo $item_url; ?\u0026gt;\" onclick=\"__gaTracker('send', 'event', 'outbound-list-image', '\u0026lt;?php echo $item_url; ?\u0026gt;', 'List Item Link');\" alt=\"\u0026lt;?php echo $item_name; ?\u0026gt;\" target=\"_blank\"\u0026gt;\u0026lt;img class=\"bloglistimage\" src=\"\u0026lt;?php echo $item_image['url']; ?\u0026gt;\" alt=\"\u0026lt;?php echo $item_name; ?\u0026gt;\" /\u0026gt;\u0026lt;/a\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;?php else: ?\u0026gt; \n \u0026lt;div class=\"col-sm-4 mobile-center mobile-padding\"\u0026gt; \u0026lt;img class=\"bloglistimage\" alt=\"\u0026lt;?php echo $item_name; ?\u0026gt;\" src=\"\u0026lt;?php echo $item_image['url']; ?\u0026gt;\" /\u0026gt; \u0026lt;/div\u0026gt;\n \u0026lt;?php endif; ?\u0026gt; \n\n\u0026lt;div class=\"col-sm-8\"\u0026gt;\n \u0026lt;?php if( $item_name ): ?\u0026gt;\n \u0026lt;h3 class=\"nmt pull-left\"\u0026gt;\u0026lt;?php echo $item_name; ?\u0026gt;\u0026lt;/h3\u0026gt;\n \u0026lt;?php endif; ?\u0026gt;\n \u0026lt;div class=\"clearing\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;?php if( $item_price ): ?\u0026gt;\n \u0026lt;p class=\"bloglist-price\"\u0026gt;\u0026lt;span class=\"blogpricelabel\"\u0026gt;Price: \u0026lt;/span\u0026gt;\u0026lt;span class=\"blogpriceprice\"\u0026gt;£\u0026lt;?php echo number_format((float)$item_price, 2, '.', ''); ?\u0026gt;\u0026lt;/span\u0026gt;\u0026lt;/p\u0026gt;\n \u0026lt;?php endif; ?\u0026gt;\n\n \u0026lt;?php if( $item_old_price ): ?\u0026gt;\n \u0026lt;p class=\"old-price\"\u0026gt;\u0026lt;span class=\"blogpricelabel\"\u0026gt;Was: \u0026lt;/span\u0026gt;\u0026lt;span style=\"text-decoration: line-through;font-size: 0.9em;\" class=\"bloglist-oldprice\"\u0026gt;£\u0026lt;?php echo number_format((float)$item_old_price, 2, '.', ''); ?\u0026gt;\u0026lt;/span\u0026gt;\u0026lt;/p\u0026gt;\n \u0026lt;?php endif; ?\u0026gt;\n\n \u0026lt;?php if( $item_meta1_label ): ?\u0026gt;\n \u0026lt;p class=\"bloglist-meta\"\u0026gt;\u0026lt;span class=\"blogmetalabel\"\u0026gt;\u0026lt;?php echo $item_meta1_label; ?\u0026gt;\u0026amp;nbsp;\u0026lt;/span\u0026gt;\u0026lt;span class=\"blogmetacontent\"\u0026gt;\u0026lt;?php echo $item_meta1_content; ?\u0026gt;\u0026lt;/span\u0026gt;\u0026lt;/p\u0026gt;\n \u0026lt;?php endif; ?\u0026gt;\n\n \u0026lt;span class=\"item-copy\"\u0026gt;\u0026lt;?php echo $item_content; ?\u0026gt;\u0026lt;/span\u0026gt;\n\n\n\n \u0026lt;?php if( $item_url ): ?\u0026gt;\n\n \u0026lt;a class=\"btn btn-xs btn-default pull-right\" href=\"\u0026lt;?php echo $item_url ?\u0026gt;\" onclick=\"__gaTracker('send', 'event', 'outbound-list-button', '\u0026lt;?php echo $item_url; ?\u0026gt;', 'List Item Button');\"\u0026gt;\u0026lt;span class=\"button-text\"\u0026gt;Find Out More...\u0026lt;/span\u0026gt;\u0026lt;/a\u0026gt; \n\n \u0026lt;?php endif; ?\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n\n \u0026lt;?php endwhile; ?\u0026gt;\n\n\n\n \u0026lt;?php endif; ?\u0026gt;\n\n \u0026lt;!-- List Stuff Ends --\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAt the moment my code works on the post page, but it also outputs the custom fields below the headline, thumbnail and excerpt on the index and home pages. I just want the code to appear on the single post page, I'm guessing by placing it within the Else part of the code. \u003c/p\u003e\n\n\u003cp\u003eBut when I just drop it in the blog page breaks. I know it's a question of syntax and ensuring the right {} are in the right place, but I'm struggling to get them in the right place and the right order. \u003c/p\u003e\n\n\u003cp\u003eAny help, guidance or pointers gratefully received. Cheers....\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-12-14 16:31:11.747 UTC","last_activity_date":"2016-12-14 19:00:36.55 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7297639","post_type_id":"1","score":"0","tags":"php|wordpress|wordpress-theming","view_count":"19"} +{"id":"45626446","title":"When Ignite allocated next memory segment?","body":"\u003cp\u003eI use embedded apache ignite in spring.\u003cbr\u003e\nOnce I test stress test, TPS is temporarily drop down when appearing below log. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ea.i.i.p.impl.PageMemoryNoStoreImpl : Allocted next memory segment [plcName=default, chunkSize=422.2MB\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI guess the memory configuration is needed.\u003cbr\u003e\nso I configure systemCacheMaxSize and systemCacheInitialSize, but not changed \u003c/p\u003e\n\n\u003cp\u003eMy application is need stable tps guarantee. \u003c/p\u003e\n\n\u003cp\u003eHow can I fix it? \u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-08-11 03:21:31.9 UTC","last_activity_date":"2017-08-11 04:09:20.937 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"8392616","post_type_id":"1","score":"0","tags":"ignite","view_count":"26"} +{"id":"10661623","title":"Download iPhone backups from iCloud","body":"\u003cp\u003eDoes anyone know of a way to programmatically download iPhone / iPad backups from iCloud?\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2012-05-19 01:38:31.163 UTC","favorite_count":"2","last_activity_date":"2014-07-02 03:36:26.45 UTC","last_edit_date":"2012-05-19 01:45:40.877 UTC","last_editor_display_name":"","last_editor_user_id":"189950","owner_display_name":"","owner_user_id":"196918","post_type_id":"1","score":"3","tags":"icloud|icloud-api","view_count":"5210"} +{"id":"11992827","title":"SQLite 3 insert. Database is not changed even if insert doesn't fail","body":"\u003cp\u003eafter an update , my sqlite database, is not changed.\nAll seems fine, no error message and I'm able to print out\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e int rows= sqlite3_changes(database); \n NSLog(@\"rows %d\" , rows);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethe number of rows updated. Nevertheless if I read the table (from sqlite console pointing to the Library folder where I copied the file. But even if I read it with a new objective-c method)\nafter updating it is like no update was run.\u003c/p\u003e\n\n\u003cp\u003eHere is my full method. I've tried even a sql insert but with the same problem.\nHave you got any idea about what I could try or what is the problem?\u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e -(void)saveBookmark:(FfBookmark *) bookmark {\n\nint resconn = sqlite3_open([pathDB UTF8String], \u0026amp;database);\n\nif (resconn == SQLITE_OK) {\n\n NSString * query = @\"update bookmarks set position=? \";\n const char * sqlStatement = [query UTF8String];\n\n sqlite3_stmt * compiledStatement;\n\n if (sqlite3_prepare_v2(database, sqlStatement, -1 , \u0026amp;compiledStatement, NULL) == SQLITE_OK) {\n\n sqlite3_bind_int(compiledStatement, 1, bookmark.position);\n\n\n\n } \n\n if (!sqlite3_step(compiledStatement) == SQLITE_DONE) {\n\n NSLog(@\"Error @%\" , sqlite3_errmsg(database));\n }\n int rows= sqlite3_changes(database);\n\n NSLog(@\"rows %d\" , rows);\n\n\nsqlite3_finalize(compiledStatement);\n\n\n}\n\n\nsqlite3_close(database);\n\n }\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"3","creation_date":"2012-08-16 17:56:11.35 UTC","last_activity_date":"2012-08-16 17:56:11.35 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1278333","post_type_id":"1","score":"0","tags":"ios|sqlite","view_count":"324"} +{"id":"40282451","title":"How to insert an item into an array using REST and node","body":"\u003cp\u003eI'm using node to store items in a Firebase database, using a REST API. What I don't understand is how to append an item in an array. So for instance to append new items to the database I'm using PATCH:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003econst https = require('https');\nvar patchData = '{\"thing\":\"value\"}';\n\nvar options = {\n host: 'mydatabase.firebaseio.com',\n path: '/items.json',\n method: 'PATCH',\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n 'Content-Length': Buffer.byteLength(patchData)\n }\n};\n\nvar req = https.request(options, function(res) {\n res.setEncoding('utf8');\n res.on('data', function (chunk) {\n console.log('Body: ' + chunk);\n });\n res.on('end', function() {\n //do end clean up\n });\n});\n\nreq.on(\"error\", function(e) {\n console.log('problem with request: ', e.message);\n});\n\n//write data to request body\nreq.write(patchData);\nreq.end();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI can append or replace objects no problem and get a structure like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n \"items\": {\n \"thing1\": \"value1\",\n \"thing2\": \"value2\",\n \"thing3\": \"value3\"\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe structure I want is this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n \"items\": [{\"thing1\": \"value1\"},\n {\"thing2\": \"value2\"},\n {\"thing3\": \"value3\"}]\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAs each item is roughly a collection of the same sort of thing, and not attributes of the items objects.\u003c/p\u003e\n\n\u003cp\u003eEither I'm missing something simple, or the entire array needs to be first read, then appended to in node, and rewritten back to Firebase in one go, but that seems incredibly inefficient. How do I get the second structure?\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2016-10-27 10:37:09.913 UTC","last_activity_date":"2016-10-27 10:37:09.913 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4126167","post_type_id":"1","score":"0","tags":"javascript|arrays|node.js|rest","view_count":"36"} +{"id":"19157567","title":"customize sidebar widget container items","body":"\u003cp\u003eI developed a custom theme and register_sidebar in function.php to show menus on sidebar using Custom Menu (widget).\nThen create a menu through Appearance-\u003e Menu and set it in Widget's Sidebar area by using Custom Menu\nNow I need to add an extra link for login page. This link \u003cli\u003e should use extra class , which all other links/menu aren't using.\nI added extra link through Appearance-\u003e Menu but please help me to know how can I add a class for only that extra link (login)\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-10-03 11:06:10.32 UTC","last_activity_date":"2013-10-03 11:19:38.297 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2842302","post_type_id":"1","score":"0","tags":"wordpress|widget|sidebar|menu-items","view_count":"458"} +{"id":"11255072","title":"How to stash form data in order to show confirmation page before submission","body":"\u003cp\u003eI have a multipart form that is very long and includes file input fields. My client would like for the user to be able to review the data they have entered before sending the data along to the remote server. The currently working implementation simply takes the form data and submits it to the external web service. Since there is already a large amount of validation and SOAP request boilerplate written, I'm simply dropping in a controller action between them. So, all I need to do is take the form data supplied to the \"Review\" action and send it along to the \"Submit\" action.\u003c/p\u003e\n\n\u003ch2\u003eHere is the flow of the controllers and views involved so far:\u003c/h2\u003e\n\n\u003cul\u003e\n\u003cli\u003eThe form is rendered, user enters data, hits \"continue\"\u003c/li\u003e\n\u003cli\u003eForm is validated, then form data is sent to \"review\" page\u003c/li\u003e\n\u003cli\u003eAction for view page creates \u003ccode\u003eparams[:clean]\u003c/code\u003e and populates it with human-readable form data\u003c/li\u003e\n\u003cli\u003eView displays table with option | data, with a \"Submit\" button at the bottom\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003ch2\u003eWhat I've tried so far:\u003c/h2\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003ccode\u003esession[:form_data] = params\u003c/code\u003e this causes the \"cannot dump File\" error\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003ch2\u003eConsidered but would rather avoid if possible:\u003c/h2\u003e\n\n\u003cul\u003e\n\u003cli\u003eCreating another form on \"Review\" view that is populated from params and POSTs to the submit url \u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eOf note is that the uploaded files are not being handled by the application. The client's SOAP architecture handles everything - I just need to have a page that holds onto form data, then passes it along in the event that the customer is satisfied.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2012-06-29 01:41:32.413 UTC","last_activity_date":"2012-06-29 22:14:03.163 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1381304","post_type_id":"1","score":"1","tags":"ruby-on-rails|forms|file|post|upload","view_count":"228"} +{"id":"34724275","title":"Yii2 Gridview DropDownList Filter with multiple select","body":"\u003cp\u003ePlease help me to solve the following issue. \u003c/p\u003e\n\n\u003cp\u003eI have a page with data that displayed with gridview. There is a column 'status'. I need dropdown filter by this column value.\u003c/p\u003e\n\n\u003cp\u003eFor my column in grid view I set the following filter value:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e'filter' =\u0026gt; Html::activeDropDownList($searchModel, 'status', \n Accounts::getStatusList(), ['class' =\u0026gt; 'form-control', 'multiple' =\u0026gt; true]),\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eDropdown filter correctly display. But no matter how many options I choose, a search model gets an array with only one value .\u003c/p\u003e\n\n\u003cp\u003eI've tried many ways for this but doesn't find any solution. Thanks.\u003c/p\u003e","answer_count":"2","comment_count":"4","creation_date":"2016-01-11 14:47:03.17 UTC","last_activity_date":"2017-03-25 17:08:59.293 UTC","last_edit_date":"2016-01-11 15:16:43.923 UTC","last_editor_display_name":"","last_editor_user_id":"3522312","owner_display_name":"","owner_user_id":"5614804","post_type_id":"1","score":"0","tags":"filter|yii2","view_count":"2070"} +{"id":"5981208","title":"Access objects parent from after_save block","body":"\u003cp\u003eHere is my model: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass Why \u0026lt; ActiveRecord::Base\n belongs_to :story\n after_save :complete\n\n private\n def complete\n self.story.update_attributes(:completed =\u0026gt; true)\n end\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand controller code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass WhiesController \u0026lt; ApplicationController\n\n def index\n @whies = Why.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml =\u0026gt; @whies }\n end\n end\n\n def show\n @why = Why.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml =\u0026gt; @why }\n end\n end\n\n def new\n @why = Why.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml =\u0026gt; @why }\n end\n end\n\n def create\n @story = Story.find(params[:story_id])\n @why = @story.build_why(params[:why])\n\n respond_to do |format|\n if @why.save\n format.html { redirect_to story_path(@why.story) }\n format.xml { render :xml =\u0026gt; @why, :status =\u0026gt; :created, :location =\u0026gt; @why }\n else\n format.html { render :action =\u0026gt; \"new\" }\n format.xml { render :xml =\u0026gt; @why.errors, :status =\u0026gt; :unprocessable_entity }\n end\n end\n end\n\n def destroy\n @why = Why.find(params[:id])\n @why.destroy\n\n respond_to do |format|\n format.html { redirect_to(whies_url) }\n format.xml { head :ok }\n end\n end\n\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI get an \u003ccode\u003eThe error occurred while evaluating nil.update_attributes\u003c/code\u003e error coming from the complete after_save method. Can anyone suggest what the problem is, or a workaround?\u003c/p\u003e","accepted_answer_id":"5981334","answer_count":"2","comment_count":"0","creation_date":"2011-05-12 16:24:23.493 UTC","last_activity_date":"2011-05-12 17:29:39.147 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"599970","post_type_id":"1","score":"1","tags":"ruby-on-rails","view_count":"414"} +{"id":"38718701","title":"How to count the number of elements (\u003cul\u003e) in a HTML string using Ruby RegEx","body":"\u003cp\u003eIf you had a HTML string in ruby, does anyone know the RegEx I would use to count the number of tags in that string? This is just a string in the rails database. Many thanks\u003c/p\u003e","answer_count":"2","comment_count":"1","creation_date":"2016-08-02 11:05:07.313 UTC","last_activity_date":"2016-08-02 11:09:24.043 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5715232","post_type_id":"1","score":"1","tags":"html|ruby|regex","view_count":"56"} +{"id":"41816831","title":"WTForms Select Field Throws a 400 error when submitted","body":"\u003cp\u003eI'm using a WTForm \u003ca href=\"http://wtforms.simplecodes.com/docs/0.6.1/fields.html#wtforms.fields.SelectField\" rel=\"nofollow noreferrer\"\u003eSelectField\u003c/a\u003e to send data via a post request. \u003c/p\u003e\n\n\u003cp\u003eHowever, whenever I attempt to submit the form I receive a 400 error (\"Bad Request, The browser (or proxy) sent a request that this server could not understand.\"). I have a text field form that is built roughly the same way and works perfectly fine so I'm not sure why this form isn't working. I have read through the docs and searched for an answer but cannot seem to crack this one. Here's the structure:\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eforms.py\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eNote: \u003ccode\u003eCATEGORIES\u003c/code\u003e is a dict that holds the key, value pairs that will be used in the select field. I order them first to ensure they are passed in the same way every time\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efrom config import CATEGORIES\n\ncategories = { v:k for k,v in CATEGORIES.items()}\nordered_categories = collections.OrderedDict(sorted(categories.items())).items()\n\nCHOICES = [x for x in ordered_categories]\n\n\nclass SearchForm(FlaskForm):\n choices = CHOICES\n input_category = SelectField('input_category', choices=choices)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eviews.py\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efrom .forms import CHOICES, SearchForm\n\n@app.route('/index', methods=['GET', 'POST'])\ndef index():\n category_search_form = SearchForm()\n\n if category_search_form.validate_on_submit():\n # The code doesn't make it here due to the 400 error\n selection = dict(CHOICES).get(category_search_form.input_category.data)\n return render_template(\u0026lt;template args are here based on selection\u0026gt;)\n\n return render_template(\n 'index.html',\n title='Home',\n category_search_form=category_search_form,\n ua_id=UA_TRACKING_ID,\n contact_us_form=contact_us_form)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eindex.html w/ Jinja2 template\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;form action=\"\" method=\"post\" name=\"category\"\u0026gt;\n {{ category_search_form.hidden_tag() }}\n \u0026lt;div class=\"select-form\"\u0026gt;\n {{ category_search_form.input_category() }}\n {% for error in category_search_form.input_category.errors %}\n \u0026lt;span class=\"form-error\"\u0026gt;* {{ error }}\u0026lt;/span\u0026gt;\n {% endfor %}\n \u0026lt;/div\u0026gt;\n \u0026lt;ul class=\"actions\"\u0026gt;\n \u0026lt;li class=\"form-search-button\"\u0026gt;\n \u0026lt;input type=\"submit\" value=\"Search\" name=\"category-search-button\" class=\"special\" /\u0026gt;\n \u0026lt;/li\u0026gt;\n \u0026lt;li class=\"form-search-button\"\u0026gt;\n \u0026lt;input type=\"submit\" value=\"Random Search\" name=\"category-search-button\" class=\"special\" /\u0026gt;\n \u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n\u0026lt;/form\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny help would be much appreciated.\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2017-01-23 22:29:54.617 UTC","last_activity_date":"2017-01-23 22:29:54.617 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4942372","post_type_id":"1","score":"0","tags":"python|flask|jinja2|wtforms|flask-wtforms","view_count":"59"} +{"id":"26561957","title":"Get mysql value into php variable","body":"\u003cp\u003eI have a site set up with a mysql DB that stores user data. The database structure looks like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etable = users\n\ncolumns = Id : username : email : password : active \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eUnder the column \u003ccode\u003eactive\u003c/code\u003e the value is 1 for active and 0 for deactive \u003c/p\u003e\n\n\u003cp\u003eWhen a user pays for my site, the \u003ccode\u003eactive\u003c/code\u003e value changes from 0 to 1. \u003c/p\u003e\n\n\u003cp\u003eI want to show now if a user has paid or not at the user profile.\u003c/p\u003e\n\n\u003cp\u003eHow can I query the database to get the value of the \u003ccode\u003eactive\u003c/code\u003e column based on the \u003ccode\u003eusername\u003c/code\u003e and save it as a variable to use later in the script? \u003c/p\u003e","accepted_answer_id":"26562006","answer_count":"1","comment_count":"0","creation_date":"2014-10-25 11:40:33.637 UTC","last_activity_date":"2014-10-28 15:07:53.41 UTC","last_edit_date":"2014-10-28 15:07:53.41 UTC","last_editor_display_name":"","last_editor_user_id":"2025928","owner_display_name":"","owner_user_id":"3902783","post_type_id":"1","score":"0","tags":"php|mysql|usersession","view_count":"1610"} +{"id":"29002654","title":"Oracle ADF: How to enable a user to Stay Logged In","body":"\u003cp\u003eI am developing a web application using Oracle ADF. In my web application user has to log in to access web application. Application is working fine. Now I need to enable a feature like once a user has logged In and due to some reasons he closed a tab not the browser. So whenever he try to access the same application he do not need to login again. Since browser has not closed the user has to be automatically logged in.\u003c/p\u003e\n\n\u003cp\u003eFor this I googled a lot and got information that we can achieve this using browser cache and servlet filters. I got information from \u003ca href=\"https://stackoverflow.com/questions/5082846/java-ee-6-how-to-implement-stay-logged-in-when-user-login-in-to-the-web-appli\"\u003eThis Stackoverflow question\u003c/a\u003e. But I don't know how to implement Filters and all in Oracle ADF web application. Please help on this.\u003c/p\u003e\n\n\u003cp\u003eThanks in advance.\u003c/p\u003e","accepted_answer_id":"29004226","answer_count":"1","comment_count":"0","creation_date":"2015-03-12 05:43:11.233 UTC","last_activity_date":"2015-03-12 07:39:46.467 UTC","last_edit_date":"2017-05-23 11:43:22.443 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"2771888","post_type_id":"1","score":"0","tags":"java|java-ee|jsf-2.2|oracle-adf","view_count":"330"} +{"id":"38535702","title":"onEdit() stopped working?","body":"\u003cp\u003eSo I have a Google sheet where, when a user enters a number of an item, it will output a description and price. I actually have 50 sheets (one for each state in the US) that are all almost exactly the same, but put out slightly different prices because state taxes vary from state to state.\u003c/p\u003e\n\n\u003cp\u003eI used onEdit() to have my sheet work and it was working fine until I changed where the source for information came from. Originally in my sheet, I had another page with all the item information so that a simple Vlookup could do most of the work except calculate the item's price (this is what my code was doing, using the info page that was in the sheet to calculate a price). \u003c/p\u003e\n\n\u003cp\u003eHowever, when an edit needs to be made to an item, I want to make it so that we only have to update one \"master\" sheet, and make a call by openByUrl(...) instead of going to all 50 sheets and copy pasting the information. I tried implementing this in a sheet, and now it doesn't work when I edit, but it does work when I manually go into script editor and press run. What gives?\u003c/p\u003e\n\n\u003cp\u003eEDIT: Here's the code requested.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction onEdit(d) {\n itemPriceSetup();\n}\n\n// Runs the actual program.\nfunction itemPriceSetup() {\n\n // Grabs and stores the sheet where a customer places an item number and where the code will output the price to.\n var orderSheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(\"Item Sale Doc\");\n var orderSheetArray = orderSheet.getSheetValues(1, 1, 34, 8);\n\n // Grabs and stores the sheet that has the information on the item.\n //***var infoSheet = SpreadsheetApp.openByUrl('link to info');\n var infoSheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(\"sheet with info\");\n var infoSheetArray = infoSheet.getSheetValues(1, 1, infoSheet.getLastRow(), 10);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo the code with the three asterisks is what I want to use, but causes my the program to not work - that is, it onEdit() won't run (I have it commented out so the code will run - the line below it is the one I'm trying to replace). If I were to go through the debugger with the line un-commented, it actually works.\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2016-07-22 21:46:22.883 UTC","favorite_count":"1","last_activity_date":"2016-07-28 01:24:49.643 UTC","last_edit_date":"2016-07-28 01:24:49.643 UTC","last_editor_display_name":"","last_editor_user_id":"1595451","owner_display_name":"","owner_user_id":"4339558","post_type_id":"1","score":"1","tags":"google-apps-script|google-spreadsheet|user-input","view_count":"768"} +{"id":"24854600","title":"Android AsyncTask Hangs using Parse SDK","body":"\u003cp\u003eHere is a video of the problem\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://www.youtube.com/watch?v=GsTVruQaxqs\u0026amp;feature=youtu.be\" rel=\"nofollow\"\u003ehttp://www.youtube.com/watch?v=GsTVruQaxqs\u0026amp;feature=youtu.be\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eParse.com is our backend and when the user goes to the search activity, I use an asyncTask to download the data from parse.\u003c/p\u003e\n\n\u003cp\u003eIf the user hits the right combination of buttons, in this case the back button at the right time, then the next time the user goes to the search activity the async tasks will either enter the doInbackground method and hang, or they will not enter at all and the spinner shows indefinitely. Caching does not fix the problem, neither does Pinning the query. If I hit back at the wrong time and try to reload, eventually ill get this behavior.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efinal ParseQuery\u0026lt;ParseObject\u0026gt; query = new ParseQuery\u0026lt;ParseObject\u0026gt;(\n \"UploadedGear\");\n\n final ParseQuery\u0026lt;ParseObject\u0026gt; query2 = new ParseQuery\u0026lt;ParseObject\u0026gt;(\n \"Experiences\");\n\n query.whereEqualTo(\"status\", \"active\")\n .whereEqualTo(\"searchCities\", mCity.trim())\n .setLimit(2)\n .setSkip(gearSkip);\n\n query2.whereEqualTo(\"status\", \"active\")\n .whereEqualTo(\"searchCities\", mCity.trim())\n .setLimit(2)\n .setSkip(expSkip);\n\n Log.e(\"query task \", \"executing\");\n\n ((DiscoverActivity) getActivity()).addDownloadTask(downloadAction);\n ((DiscoverActivity) getActivity()).addQuery(query);\n ((DiscoverActivity) getActivity()).addQuery(query2);\n\n\n\n\n query.findInBackground(new FindCallback\u0026lt;ParseObject\u0026gt;() {\n @Override\n public void done(final List\u0026lt;ParseObject\u0026gt; objs, ParseException e) {\n\n\n if (e != null)\n query.cancel();\n\n\n ParseObject.unpinAllInBackground(\"GEAR_RESULTS\", objs, new DeleteCallback() {\n public void done(ParseException e) {\n if (e != null) {\n return;\n }\n\n ParseObject.pinAllInBackground(\"GEAR_RESULTS\", objs);\n }\n });\n\n\n for (ParseObject country : objs) {\n\n Log.e(\"gear size\", new Integer(objs.size()).toString());\n\n\n UploadedGear map = new UploadedGear();\n map.setPrice((String) country.get(\"Price\"));\n map.setTitle((String) country.get(\"title\"));\n map.setCity((String) country.get(\"City\"));\n map.setActivityType((String) country.get(\"activity\"));\n map.setDesc((String) country.get(\"description\"));\n map.setObjectId(country.getObjectId());\n ParseQuery\u0026lt;ParseUser\u0026gt; userQuery = ParseUser.getQuery();\n ParseUser pointer = (ParseUser) country.get(\"Owner\");\n map.setOwnerId(pointer.getObjectId());\n userQuery.whereEqualTo(\"objectId\", pointer.getObjectId());\n\n map.setOwnerDisplayName(\"\");\n map.setOwnerUrl(\"\");\n ParseFile bum = (ParseFile) country.get(\"icon\");\n map.setImage(bum.getUrl());\n results.add(map);\n }\n\n\n if (getActivity() != null) {\n //ela.setNotifyOnChange(true);\n\n EndlessListAdapter el = (EndlessListAdapter) stv.getAdapter();\n\n\n if (el != null) {\n\n for (UserContent item : results) {\n\n\n synchronized (el) {\n ((UserContent) item).getActivityType();\n if (!el.contains((UserContent) item) \u0026amp;\u0026amp; (((UserContent) item).getActivityType().equals(mActivity) || mActivity.equalsIgnoreCase(\"all\"))) {\n el.add(item);\n if ((UserContent) item instanceof Experience)\n expSkip += 1;\n else\n gearSkip += 1;\n el.notifyDataSetChanged();\n }\n }\n }\n isLoading = false;\n\n\n ((DiscoverActivity) getActivity()).setInitializing(false);\n\n\n if (mFooter == null) {\n mFooter = new ListViewFooter(getActivity());\n }\n\n\n if (results.isEmpty()) {\n\n //set Empty View\n if (noGearAvailable == true) {\n hideFooter();\n hideBar();\n }\n loadingComplete = true;\n hideFooter();\n } else {\n\n }\n\n\n\n }\n }\n }\n });\n\n //query2.setCachePolicy(ParseQuery.CachePolicy.NETWORK_ELSE_CACHE);\n\n query2.findInBackground(new FindCallback\u0026lt;ParseObject\u0026gt;() {\n\n\n @Override\n public void done(final List\u0026lt;ParseObject\u0026gt; exps, ParseException e) {\n\n\n ParseObject.unpinAllInBackground(\"EXPERIENCES_RESULTS\", exps, new DeleteCallback() {\n public void done(ParseException e) {\n if (e != null) {\n return;\n }\n\n // Add the latest results for this query to the cache.\n ParseObject.pinAllInBackground(\"EXPERIENCES_RESULTS\", exps);\n }\n });\n\n\n hideBar();\n\n Log.e(\"experience size\", new Integer(exps.size()).toString());\n\n for (ParseObject experience : exps) {\n Experience exp = new Experience();\n\n\n exp.setImage((String) experience.get(\"mainImg\"));\n exp.setActivityType((String) experience.get(\"activity\"));\n exp.setObjectId(experience.getObjectId());\n ArrayList\u0026lt;String\u0026gt; stringValues = (ArrayList\u0026lt;String\u0026gt;) experience.get(\"searchCities\");\n exp.setCity(new String(stringValues.get(0)));\n exp.setTitle((String) experience.get(\"title\"));\n exp.setDesc((String) experience.get(\"about\"));\n exp.setPrice(\"10\");\n\n\n ParseUser pointer = (ParseUser) experience.get(\"Guide\");\n exp.setOwnerId(pointer.getObjectId());\n\n\n exp.setOwnerUrl(\"\");\n exp.setOwnerDisplayName(\"\");\n results.add(exp);\n }\n\n if (getActivity() != null) {\n //ela.setNotifyOnChange(true);\n\n EndlessListAdapter el = (EndlessListAdapter) stv.getAdapter();\n\n\n if (el != null) {\n\n for (UserContent item : results) {\n\n synchronized (el) {\n ((UserContent) item).getActivityType();\n if (!el.contains((UserContent) item) \u0026amp;\u0026amp; (((UserContent) item).getActivityType().equals(mActivity) || mActivity.equalsIgnoreCase(\"all\"))) {\n el.add(item);\n if ((UserContent) item instanceof Experience)\n expSkip += 1;\n else\n gearSkip += 1;\n el.notifyDataSetChanged();\n }\n }\n }\n // flag the loading is finished\n isLoading = false;\n\n\n ((DiscoverActivity) getActivity()).setInitializing(false);\n\n\n if (mFooter == null) {\n mFooter = new ListViewFooter(getActivity());\n }\n\n\n if (results.isEmpty()) {\n\n //set Empty View\n if (noGearAvailable == true) {\n hideFooter();\n hideBar();\n }\n loadingComplete = true;\n hideFooter();\n } else {\n\n }\n\n }\n }\n\n\n }\n });\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"2","creation_date":"2014-07-20 20:27:49.53 UTC","favorite_count":"2","last_activity_date":"2015-06-30 11:16:20.207 UTC","last_edit_date":"2014-07-20 21:40:40.043 UTC","last_editor_display_name":"","last_editor_user_id":"1166449","owner_display_name":"","owner_user_id":"1166449","post_type_id":"1","score":"3","tags":"android|android-asynctask|parse.com","view_count":"417"} +{"id":"27305433","title":"XML Parse Error - Extra Content at end of document","body":"\u003cp\u003eI've been following a tutorial to create an XML Page using PHP. Below is the code.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?\nheader('Content-type: text/xml');\n\nmysql_connect('localhost','root','admin');\nmysql_select_db('test');\n\n$sql = \"Select * from `books`\";\n$q = mysql_query($sql) or die(mysql_error());\n\n\n$dom = new DOMDocument();\n\n$datas = $dom-\u0026gt;createElement('datas');\n$dom-\u0026gt;appendChild($datas);\n\nwhile($r = mysql_fetch_array($q)){\n $id = $dom-\u0026gt;createElement('id');\n $idText = $dom-\u0026gt;createTextNode($r['id']);\n $id-\u0026gt;appendChild($idText);\n\n $title = $dom-\u0026gt;createElement('title');\n $titleText = $dom-\u0026gt;createTextNode($r['title']);\n $title-\u0026gt;appendChild($titleText);\n\n $author = $dom-\u0026gt;createElement('author');\n $authorText = $dom-\u0026gt;createTextNode($r['author']);\n $author-\u0026gt;appendChild($authorText);\n\n $book = $dom-\u0026gt;createElement('book');\n $book-\u0026gt;appendChild($id);\n $book-\u0026gt;appendChild($title);\n $book-\u0026gt;appendChild($author);\n\n $datas-\u0026gt;appendChild($book);\n\n}\n\n\n$xmlString = $dom-\u0026gt;saveXML();\necho $xmlString;\n\n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut for some reason when I run this I get an error which is - \"error on line 5 at column 1: Extra content at the end of the document\"\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2014-12-04 22:30:47.57 UTC","last_activity_date":"2014-12-04 22:30:47.57 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1849663","post_type_id":"1","score":"0","tags":"php|xml","view_count":"407"} +{"id":"25893938","title":"Cell References in Cube Formula - Excel PowerPivot","body":"\u003cp\u003eI'm looking to run a \u003ccode\u003eCUBEVALUE\u003c/code\u003e formula with member expressions based on the contents of multiple different cells. For this example i have 2 cells with a value for REGION in:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eI15: Border\nI16: Midlands\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI can reference one cell successfully using a cube value formula:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e=CUBEVALUE(\"PowerPivot Data\",\"[Measures].[Sum of WEIGHTED_IMPRESSIONS]\",\"[pvtBASE].[REGION].\u0026amp;[\"\u0026amp;I$15\u0026amp;\"]\")\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCouldn't find a way within \u003ccode\u003eCUBEVALUE\u003c/code\u003e alone to replicate this result to reference both \u003ccode\u003eI15\u003c/code\u003e and \u003ccode\u003eI16\u003c/code\u003e so tried with a \u003ccode\u003eCUBESET\u003c/code\u003e then referencing the \u003ccode\u003eCUBESET\u003c/code\u003e in a later \u003ccode\u003eCUBEVALUE\u003c/code\u003e formula:\u003c/p\u003e\n\n\u003cp\u003eFor the \u003ccode\u003eCUBESET\u003c/code\u003e, this formula works:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e=CUBESET(\"PowerPivot Data\",{\"[pvtBASE].[REGION].\u0026amp;[Midlands]\",\"[pvtBASE].[REGION].\u0026amp;[Border]\"})\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis formula works:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e=CUBESET(\"PowerPivot Data\",\"[pvtBASE].[REGION].\u0026amp;[\"\u0026amp;I15\u0026amp;\"]\")\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut for some reason this doesn't:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e=CUBESET(\"PowerPivot Data\",{\"[pvtBASE].[REGION].\u0026amp;[\"\u0026amp;I15\u0026amp;\"]\",\"[pvtBASE].[REGION].\u0026amp;[\"\u0026amp;I16\u0026amp;\"]\"})\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eDoes anyone know how to fix the final \u003ccode\u003eCUBESET\u003c/code\u003e formula or if perhaps there is another way of fitting multiple members and cell references into a \u003ccode\u003eCUBEVALUE\u003c/code\u003e formula. \u003c/p\u003e\n\n\u003cp\u003eFeels like i'm close but then again I might not be!\u003c/p\u003e\n\n\u003cp\u003eCheers\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-09-17 14:55:42.357 UTC","last_activity_date":"2014-09-19 20:00:52.87 UTC","last_edit_date":"2014-09-17 15:27:52.067 UTC","last_editor_display_name":"","last_editor_user_id":"3975214","owner_display_name":"","owner_user_id":"4050943","post_type_id":"1","score":"2","tags":"cube|powerpivot","view_count":"2489"} +{"id":"11515934","title":"AsyncTaskLoader onLoadFinished with a pending task and config change","body":"\u003cp\u003eI'm trying to use an \u003ccode\u003eAsyncTaskLoader\u003c/code\u003e to load data in the background to populate a detail view in response to a list item being chosen. I've gotten it mostly working but I'm still having one issue. If I choose a second item in the list and then rotate the device \u003cem\u003ebefore the load for the first selected item has completed\u003c/em\u003e, then the \u003ccode\u003eonLoadFinished()\u003c/code\u003e call is reporting to the activity being stopped rather than the new activity. This works fine when choosing just a single item and then rotating.\u003c/p\u003e\n\n\u003cp\u003eHere is the code I'm using. Activity:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic final class DemoActivity extends Activity\n implements NumberListFragment.RowTappedListener,\n LoaderManager.LoaderCallbacks\u0026lt;String\u0026gt; {\n\n private static final AtomicInteger activityCounter = new AtomicInteger(0);\n\n private int myActivityId;\n\n private ResultFragment resultFragment;\n\n private Integer selectedNumber;\n\n @Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n myActivityId = activityCounter.incrementAndGet();\n Log.d(\"DemoActivity\", \"onCreate for \" + myActivityId);\n\n setContentView(R.layout.demo);\n\n resultFragment = (ResultFragment) getFragmentManager().findFragmentById(R.id.result_fragment);\n\n getLoaderManager().initLoader(0, null, this);\n\n }\n\n @Override\n protected void onDestroy() {\n super.onDestroy();\n Log.d(\"DemoActivity\", \"onDestroy for \" + myActivityId);\n }\n\n @Override\n public void onRowTapped(Integer number) {\n selectedNumber = number;\n resultFragment.setResultText(\"Fetching details for item \" + number + \"...\");\n getLoaderManager().restartLoader(0, null, this);\n }\n\n @Override\n public Loader\u0026lt;String\u0026gt; onCreateLoader(int id, Bundle args) {\n return new ResultLoader(this, selectedNumber);\n }\n\n @Override\n public void onLoadFinished(Loader\u0026lt;String\u0026gt; loader, String data) {\n Log.d(\"DemoActivity\", \"onLoadFinished reporting to activity \" + myActivityId);\n resultFragment.setResultText(data);\n }\n\n @Override\n public void onLoaderReset(Loader\u0026lt;String\u0026gt; loader) {\n\n }\n\n static final class ResultLoader extends AsyncTaskLoader\u0026lt;String\u0026gt; {\n\n private static final Random random = new Random();\n\n private final Integer number;\n\n private String result;\n\n ResultLoader(Context context, Integer number) {\n super(context);\n this.number = number;\n }\n\n @Override\n public String loadInBackground() {\n // Simulate expensive Web call\n try {\n Thread.sleep(5000);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n return \"Item \" + number + \" - Price: $\" + random.nextInt(500) + \".00, Number in stock: \" + random.nextInt(10000);\n }\n\n @Override\n public void deliverResult(String data) {\n if (isReset()) {\n // An async query came in while the loader is stopped\n return;\n }\n\n result = data;\n\n if (isStarted()) {\n super.deliverResult(data);\n }\n }\n\n @Override\n protected void onStartLoading() {\n if (result != null) {\n deliverResult(result);\n }\n\n // Only do a load if we have a source to load from\n if (number != null) {\n forceLoad();\n }\n }\n\n @Override\n protected void onStopLoading() {\n // Attempt to cancel the current load task if possible.\n cancelLoad();\n }\n\n @Override\n protected void onReset() {\n super.onReset();\n\n // Ensure the loader is stopped\n onStopLoading();\n\n result = null;\n }\n\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eList fragment:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic final class NumberListFragment extends ListFragment {\n\n interface RowTappedListener {\n\n void onRowTapped(Integer number);\n\n }\n\n private RowTappedListener rowTappedListener;\n\n @Override\n public void onAttach(Activity activity) {\n super.onAttach(activity);\n\n rowTappedListener = (RowTappedListener) activity;\n }\n\n @Override\n public void onActivityCreated(Bundle savedInstanceState) {\n super.onActivityCreated(savedInstanceState);\n\n ArrayAdapter\u0026lt;Integer\u0026gt; adapter = new ArrayAdapter\u0026lt;Integer\u0026gt;(getActivity(),\n R.layout.simple_list_item_1,\n Arrays.asList(1, 2, 3, 4, 5, 6));\n setListAdapter(adapter);\n\n }\n\n @Override\n public void onListItemClick(ListView l, View v, int position, long id) {\n ArrayAdapter\u0026lt;Integer\u0026gt; adapter = (ArrayAdapter\u0026lt;Integer\u0026gt;) getListAdapter();\n rowTappedListener.onRowTapped(adapter.getItem(position));\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eResult fragment:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic final class ResultFragment extends Fragment {\n\n private TextView resultLabel;\n\n @Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View root = inflater.inflate(R.layout.result_fragment, container, false);\n\n resultLabel = (TextView) root.findViewById(R.id.result_label);\n if (savedInstanceState != null) {\n resultLabel.setText(savedInstanceState.getString(\"labelText\", \"\"));\n }\n\n return root;\n }\n\n @Override\n public void onSaveInstanceState(Bundle outState) {\n super.onSaveInstanceState(outState);\n\n outState.putString(\"labelText\", resultLabel.getText().toString());\n }\n\n void setResultText(String resultText) {\n resultLabel.setText(resultText);\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI've been able to get this working using plain \u003ccode\u003eAsyncTask\u003c/code\u003es but I'm trying to learn more about \u003ccode\u003eLoader\u003c/code\u003es since they handle the configuration changes automatically.\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT\u003c/strong\u003e: I think I may have tracked down the issue by looking at the source for \u003ca href=\"http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.0.3_r1/android/app/LoaderManager.java?av=f#552\"\u003eLoaderManager\u003c/a\u003e. When \u003ccode\u003einitLoader\u003c/code\u003e is called after the configuration change, the \u003ccode\u003eLoaderInfo\u003c/code\u003e object has its \u003ccode\u003emCallbacks\u003c/code\u003e field updated with the new activity as the implementation of \u003ccode\u003eLoaderCallbacks\u003c/code\u003e, as I would expect.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic \u0026lt;D\u0026gt; Loader\u0026lt;D\u0026gt; initLoader(int id, Bundle args, LoaderManager.LoaderCallbacks\u0026lt;D\u0026gt; callback) {\n if (mCreatingLoader) {\n throw new IllegalStateException(\"Called while creating a loader\");\n }\n\n LoaderInfo info = mLoaders.get(id);\n\n if (DEBUG) Log.v(TAG, \"initLoader in \" + this + \": args=\" + args);\n\n if (info == null) {\n // Loader doesn't already exist; create.\n info = createAndInstallLoader(id, args, (LoaderManager.LoaderCallbacks\u0026lt;Object\u0026gt;)callback);\n if (DEBUG) Log.v(TAG, \" Created new loader \" + info);\n } else {\n if (DEBUG) Log.v(TAG, \" Re-using existing loader \" + info);\n info.mCallbacks = (LoaderManager.LoaderCallbacks\u0026lt;Object\u0026gt;)callback;\n }\n\n if (info.mHaveData \u0026amp;\u0026amp; mStarted) {\n // If the loader has already generated its data, report it now.\n info.callOnLoadFinished(info.mLoader, info.mData);\n }\n\n return (Loader\u0026lt;D\u0026gt;)info.mLoader;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, when there is a pending loader, the main \u003ccode\u003eLoaderInfo\u003c/code\u003e object also has an \u003ccode\u003emPendingLoader\u003c/code\u003e field with a reference to a \u003ccode\u003eLoaderCallbacks\u003c/code\u003e as well, and this object is never updated with the new activity in the \u003ccode\u003emCallbacks\u003c/code\u003e field. I would expect to see the code look like this instead:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e// This line was already there\ninfo.mCallbacks = (LoaderManager.LoaderCallbacks\u0026lt;Object\u0026gt;)callback;\n// This line is not currently there\ninfo.mPendingLoader.mCallbacks = (LoaderManager.LoaderCallbacks\u0026lt;Object\u0026gt;)callback;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt appears to be because of this that the pending loader calls \u003ccode\u003eonLoadFinished\u003c/code\u003e on the old activity instance. If I breakpoint in this method and make the call that I feel is missing using the debugger, everything works as I expect.\u003c/p\u003e\n\n\u003cp\u003eThe new question is: Have I found a bug, or is this the expected behavior?\u003c/p\u003e","answer_count":"4","comment_count":"14","creation_date":"2012-07-17 04:15:59.85 UTC","favorite_count":"7","last_activity_date":"2014-04-23 21:28:50.293 UTC","last_edit_date":"2012-07-18 03:48:43.677 UTC","last_editor_display_name":"","last_editor_user_id":"278897","owner_display_name":"","owner_user_id":"278897","post_type_id":"1","score":"24","tags":"android|android-loadermanager|asynctaskloader|android-loader","view_count":"6034"} +{"id":"13877297","title":"import org.jsoup.* not working","body":"\u003cp\u003eI try to make a java app using Jsoup.\u003c/p\u003e\n\n\u003cp\u003eInstead of using \u003c/p\u003e\n\n\u003cp\u003e(A)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport org.jsoup.Jsoup;\nimport org.jsoup.helper.Validate;\nimport org.jsoup.helper.Validate;\nimport org.jsoup.nodes.Document;\nimport org.jsoup.nodes.Element;\nimport org.jsoup.select.Elements;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to use \u003c/p\u003e\n\n\u003cp\u003e(B)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport org.jsoup.*;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e(A) is working but (B) is not...\u003c/p\u003e\n\n\u003cp\u003eI am using IntelliJ and imported the dependencies...\nWhy is this not working ?\u003c/p\u003e","accepted_answer_id":"13877410","answer_count":"1","comment_count":"1","creation_date":"2012-12-14 10:56:16.47 UTC","favorite_count":"1","last_activity_date":"2012-12-14 11:04:55.803 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1790983","post_type_id":"1","score":"0","tags":"java|import|jsoup","view_count":"6319"} +{"id":"36389990","title":"Reverse string (irvine)","body":"\u003cp\u003eI am supposed to take a string that is at least 50 characters long using letter numbers and symbols and reverse it in assembler for a class. He gave us this piece of code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003estring1 BYTE \"abcdefghijklmnopqurstuvwxyz\",10,13,0\nstring2 BYTE 50 DUP(?),10,13,0\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWe are also not allowed to us stacks or string functions. \u003c/p\u003e\n\n\u003cp\u003eI think I get the logic to use but I need help with the syntax for it. I think we are supposed to get the number of characters in the string and then using loops we reverse them.\u003c/p\u003e\n\n\u003cp\u003eHere is what I have so far but I am getting error 2022 in line 15 saying that operands must be the same size.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e TITLE masm Template (main.asm)\n; Description:reserve string code\n; \n; Revision date:4/3/16\n\nINCLUDE Irvine32.inc\n.data\nstring1 BYTE \"abcdefghijklmnopqrstuvwsyzABCDEFGHIJKLMNOPQRSTUVWSYZ123!@#\",10,13,0\nstring2 BYTE 58 DUP(?),10,13,0\ncount dw 13\n.code\n\nmain PROC\n mov ax, @data\n mov ds,ax\n mov es,ax\n mov cx,count ;cx=58\n mov sI,0\n mov di,0\n add di,count ;\n dec di\n\nagain: mov al,string1[si]\n mov string2[di],al;\n inc si\n dec di\n loop again\n call WriteString\n\n\n exit\nmain ENDP\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWe are using visual studio 2013 for compiling \u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://www.youtube.com/watch?v=aOheFNXcIRI\" rel=\"nofollow\"\u003ehere is the video I used to get this far\u003c/a\u003e\u003c/p\u003e","answer_count":"0","comment_count":"6","creation_date":"2016-04-03 19:18:47.73 UTC","last_activity_date":"2016-04-04 07:22:24.42 UTC","last_edit_date":"2016-04-04 07:22:24.42 UTC","last_editor_display_name":"","last_editor_user_id":"3857942","owner_display_name":"","owner_user_id":"6153010","post_type_id":"1","score":"0","tags":"assembly|x86|reverse|masm|irvine32","view_count":"242"} +{"id":"24447203","title":"Jenkins: how can I clean the workspace except the vagrant directory?","body":"\u003cp\u003eI have the following setup:\u003c/p\u003e\n\n\u003cp\u003eI use the \u003ca href=\"https://wiki.jenkins-ci.org/display/JENKINS/Workspace+Cleanup+Plugin\" rel=\"nofollow\"\u003eworkspace cleanup plugin\u003c/a\u003e in Jenkins to clean my workspace before each build. During my build-process I also trigger a \u003ccode\u003evagrant up\u003c/code\u003e to setup a VM for phpunit tests:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$ vagrant up\n$ ./runtest.sh\n$ vagrant suspend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow when I re-build the project, the VM gets build as a new one instead of just resuming the previous one. I guess this is because of the cleanup plugin removing the \u003ccode\u003e.vagrant\u003c/code\u003e-directory, therefore making Vagrant think it should build a new machine instead of just resuming the previous one.\u003c/p\u003e\n\n\u003cp\u003eNow I have configured the plugin to exclude the following patterns and I have the \u003cem\u003e'Apply pattern also on directories'\u003c/em\u003e-checkbox also checked:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e**/*.vagrant\n.vagrant\n.vagrant/\n./.vagrant\n./.vagrant/\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut still the \u003ccode\u003e.vagrant\u003c/code\u003e-directory gets deleted from the workspace on each new build, spawning a brand new VM each time...\u003c/p\u003e\n\n\u003cp\u003eDoes anyone know how I can exclude the \u003ccode\u003e.vagrant\u003c/code\u003e-directory from the workspace cleanup plugin?\u003c/p\u003e","accepted_answer_id":"24491642","answer_count":"2","comment_count":"0","creation_date":"2014-06-27 08:21:39.93 UTC","favorite_count":"1","last_activity_date":"2014-06-30 13:48:12.2 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1471590","post_type_id":"1","score":"2","tags":"jenkins|vagrant","view_count":"1974"} +{"id":"27662721","title":"Removing a menu from a wxPython MenuBar","body":"\u003cp\u003eI have created a MenuBar and appended a number of Menu objects to it.\u003c/p\u003e\n\n\u003cp\u003eI now want to remove one of the menus, having only reference to the Menu object appended, and not knowing or caring about the positioning and labeling of the menus.\u003c/p\u003e\n\n\u003cp\u003eThis seems like a trivial thing to do, but the API does not seem built to handle it; all methods are based on positions and labels. \u003c/p\u003e\n\n\u003cp\u003eThere exists a MenuBar.Remove() method, but it takes the position as argument. No method takes a menu and returns its position.\u003c/p\u003e\n\n\u003cp\u003eThe Detach() methods on Menus and MenuBars are undocumented and apparently do nothing.\u003c/p\u003e\n\n\u003cp\u003eI am sure this is a dumb question and that the solution is obvious, given that no one I could find have asked it before, but the solution eludes me.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-12-26 22:42:46.25 UTC","last_activity_date":"2015-01-05 06:31:55.023 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3478688","post_type_id":"1","score":"0","tags":"python|wxpython|menubar","view_count":"262"} +{"id":"47344309","title":"Why cant my mobile recognize a valid answer delimited by: response validation \u003eregular expression \u003ematches","body":"\u003cp\u003eI'm sorry, English is not my first language, I'll try to make myself clear.\u003c/p\u003e\n\n\u003cp\u003eI have a field for email, if the email entered matches with one of my list you may continue. So, I restricted the field as shown in the image.\u003c/p\u003e\n\n\u003cp\u003eresponse validation :\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/a27J9.jpg\" alt=\"response validation\"\u003e\u003c/p\u003e\n\n\u003cp\u003eEvery Email from my list is in the restriction separated by \"|\" as follows:\u003c/p\u003e\n\n\u003cblockquote class=\"spoiler\"\u003e\n \u003cp\u003e gchimail@yahoo.com.mx|timail2@hotmail.com|alemail@hotmail.com|ale_gmail@hotmail.com|almajimal@hotmail.com....etc...\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eIt works perfectly in any computer, but it fails in SOME MOBILES, so they cannot access the Form from their devices.\u003c/p\u003e\n\n\u003cp\u003eDo you have any clue of what might be going on with those mobiles???\nI really need to solve this, we use this form weekly.\u003c/p\u003e\n\n\u003cp\u003eThanks in advance.\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2017-11-17 06:09:46.64 UTC","favorite_count":"1","last_activity_date":"2017-11-17 07:25:12.843 UTC","last_edit_date":"2017-11-17 07:25:12.843 UTC","last_editor_display_name":"","last_editor_user_id":"8404453","owner_display_name":"","owner_user_id":"8955816","post_type_id":"1","score":"0","tags":"regex|validation|mobile|google-form|smartphone","view_count":"35"} +{"id":"23276605","title":"Full HD realtime encoding filter for DirectShow","body":"\u003cp\u003eI want to capture 1080p video from a webcam and mix it in a muxer with sound. Full HD-Videos take 17,4Gb/min which is too much for me. Is there a good (free) filter to encode this in realtime?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-04-24 18:10:16.01 UTC","last_activity_date":"2014-05-25 12:45:42.793 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"516389","post_type_id":"1","score":"0","tags":"directshow|video-capture|video-processing|video-encoding","view_count":"180"} +{"id":"35568345","title":"Is it possible to authenticate to Azure Service Management API (i.e. classic) with tokens, not certificates?","body":"\u003cp\u003eI've spent days trying every possible combination of tricks and code that I can to drive the Azure Service Management API using a token, not a certificate.\u003c/p\u003e\n\n\u003cp\u003eIt is even possible to do so?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n \"defaultEnv\": \"dev\",\n \"envs\": {\n \"dev\": {\n \"tenant\": \"redacted.onmicrosoft.com\",\n \"clientId\": \"redacted\",\n \"clientSecret\": \"redacted\",\n \"resource\": \"https://management.core.windows.net/\",\n \"endpoint\": \"\"\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI successfully get an access token from Azure AD using the above parameters.\u003c/p\u003e\n\n\u003cp\u003eI put the access token into a tiny bit of Python:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etoken = 'redacted'\nheaders = {\n \"Authorization\": \"Bearer {}\".format(token),\n \"x-ms-version\": \"2015-04-01\",\n}\n\nurl = 'https://management.core.windows.net/{}/services/images?api-version=2015-04-01'.format(subscription_id)\nr = requests.get(url, headers=headers)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe final error that I have given up on is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ehttps://management.core.windows.net/REDACTEDSUBSCRIPTIONID/services/images?api-version=2015-04-01\n\u0026lt;Error xmlns=\"http://schemas.microsoft.com/windowsazure\" xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\"\u0026gt;\u0026lt;Code\u0026gt;ForbiddenError\u0026lt;/Code\u0026gt;\u0026lt;Message\u0026gt;The server failed to authenticate the request. Verify that the certificate is valid and is associated with this subscription.\u0026lt;/Message\u0026gt;\u0026lt;/Error\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"6","creation_date":"2016-02-23 03:35:54.913 UTC","favorite_count":"2","last_activity_date":"2016-02-23 07:55:10.747 UTC","last_edit_date":"2016-02-23 03:48:14.397 UTC","last_editor_display_name":"","last_editor_user_id":"627492","owner_display_name":"","owner_user_id":"627492","post_type_id":"1","score":"1","tags":"azure","view_count":"195"} +{"id":"44239280","title":"Why may a mongoose document not get saved?","body":"\u003cp\u003eI've been using the following middleware for sometime, then suddenly it stops saving new docs. Further explanation in the comments\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar body = req.body;\n\nnew ordersModel (body).save(function(err, newOrder, rowCount) {\n if (err) throw err;\n console.log(rowCount) // logs 1\n\n updateEstimatedTime(newOrder); /* updateEstimatedTime runs but inside\n it, trying to find this document newOrder returns null,\n meaning it was never saved */\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf I try something like\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar pleaseWork = new ordersModel (body);\nconsole.log(pleaseWork) // it dumps a loaded mongoose object\npleaseWork.save(function(err, newOrder, rowCount) { \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo why doesn't it get persisted? I also tried reloading the server several times with this at the top just in case I was getting collections loaded during server setup\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eordersModel.find({}, 'customer', function (err, docs) {\n if (err) throw err;\n console.log(docs)\n}) \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut it just returns the documents that existed before this fault began. I've triple checked the model name, it's the same all over the script. What could the code be lacking?\nI have seen some examples online also that suggested something in the region of\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar pleaseWork = new ordersModel ();\npleaseWork.foo = body.foo;\npleaseWork.bar = body.bar;\npleaseWork.john = body.john;\n\nconsole.log(pleaseWork) // dumps a loaded mongoose object\npleaseWork.save(function(err, newOrder, rowCount) { \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow, this is not feasible for me; the ordersModel table has more than 10 columns-- dropping the body object in the model's constructor is sane enough and worked the last time the program was run.\u003c/p\u003e\n\n\u003cp\u003eAlthough I don't think it's necessary but if you need to see my model, I can make that available. Also the full server code in case you need to deploy and test.\u003c/p\u003e","answer_count":"1","comment_count":"4","creation_date":"2017-05-29 09:41:10.22 UTC","last_activity_date":"2017-05-29 10:27:57.003 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4678871","post_type_id":"1","score":"0","tags":"node.js|mongodb|mongoose","view_count":"23"} +{"id":"6710423","title":"Programming in VBA in Excel 2003","body":"\u003cp\u003eI'm new to the visual basics language and would like some help in writing some codes. So I'm trying to write a program that imports data from a spreadsheet and shifts current data over. So I have a spreadsheet file with 3 sheets. I would first delete the data in the third and last sheet, then cut and copy the data from the second sheet over to the third sheet and the first to the second. and then prompt the user to select a data file to import to the first sheet. How do I go about doing this ????\nThanks\u003c/p\u003e","accepted_answer_id":"6717686","answer_count":"2","comment_count":"2","creation_date":"2011-07-15 16:46:54.563 UTC","last_activity_date":"2015-09-15 02:56:24.187 UTC","last_edit_date":"2015-09-15 02:56:24.187 UTC","last_editor_display_name":"","last_editor_user_id":"1505120","owner_display_name":"","owner_user_id":"846835","post_type_id":"1","score":"0","tags":"excel|vba|import|shift","view_count":"278"} +{"id":"34187216","title":"Manual Slideshow","body":"\u003cp\u003eI was working on my website and I want this div that contains images inside of an unordered list and two divs to show one picture at a time when either their left or right div is clicked, you know sort of like a manual slide show. I think I am having a problem with the z-index because for some reason I do not think that I am allowed to click on the divs. Or it could be my JQuery. Please take a look and help me out.\u003c/p\u003e\n\n\u003cp\u003eHTML:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div id=\"bottomLeft\"\u0026gt;\n \u0026lt;ul\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;img src=\"image/10pc.jpg\" /\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;img src=\"slideImages/chicken0.jpg\" /\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;img src=\"slideImages/chicken1.jpg\" /\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;img src=\"slideImages/chicken2.jpg\" /\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n \u0026lt;div id=\"leftArrow\"\u0026gt;left\u0026lt;/div\u0026gt;\n \u0026lt;div id=\"rightArrow\"\u0026gt;right\u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eJavascript:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$('#rightArrow').click(function() {\n $('#bottomLeft li[visibility=\"visible\"]').attr(\"visibility\",\"hidden\").next.attr(\"visibility\",\"visible\");\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCSS:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#bottomLeft{\n float: left;\n width: 50%;\n height: 25.9em;\n /*background-color: limegreen;*/\n top:0;\n /*background-image: url(image/10pc.jpg);*/\n position:relative;\n z-index: -1;\n}\n#bottomLeft ul li img{\n width: 100%;\n height: 25.9em;\n position: absolute;\n z-index: -5;\n}\n#bottomLeft ul li{\n text-decoration:none;\n margin: 0;\n padding: 0;\n}\n#bottomLeft ul{\n list-style-type:none;\n margin: 0;\n padding: 0;\n z-index: -5;\n}\n#bottomLeft ul li:not(:first-child){\n visibility:hidden;\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"0","creation_date":"2015-12-09 19:19:40.71 UTC","last_activity_date":"2015-12-09 23:05:20.957 UTC","last_edit_date":"2015-12-09 23:05:20.957 UTC","last_editor_display_name":"","last_editor_user_id":"2627246","owner_display_name":"","owner_user_id":"5064056","post_type_id":"1","score":"1","tags":"javascript|jquery|html|css","view_count":"37"} +{"id":"40278166","title":"Rocket.chat - login via Rest API - 401","body":"\u003cp\u003eI'm trying to login to my Rocket.chat app on localhost via API.\u003cbr\u003e\nWhen I'm sending POST to \u003ca href=\"http://localhost:3000/api/login\" rel=\"nofollow\"\u003ehttp://localhost:3000/api/login\u003c/a\u003e with data: \u003ccode\u003e{\"user\":\"myusername\",\"password\":\"mypassword\"}\u003c/code\u003e\u003cbr\u003e\nI'm getting response 401 with status error, no matter if used xhr request, axios or jquery ajax.\u003cbr\u003e\u003cbr\u003e\nBUT when I send the same data with python virtualenv or curl, the response is 200 and status success.\u003cbr\u003e\nWhat am I doing wrong? Why POST fails when sending with javascript and passes when sending with python or curl?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar xhr = new XMLHttpRequest();\n xhr.open(\"POST\", 'http://localhost:3000/api/login/', true);\n xhr.send(JSON.stringify({\n user: \"myusername\",\n password: \"mypassword\"\n}));\n// result: {status: \"error\", message: \"Unauthorized\"}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm sending login request with no header, because:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003exhr.setRequestHeader('Content-Type', 'application/json');\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ereturns 500\n\u003cbr\u003e\u003cbr\u003e\nHere are request details from Chrome:\u003cbr\u003e\n\u003ca href=\"https://i.stack.imgur.com/REfR8.png\" rel=\"nofollow\"\u003e\u003cimg src=\"https://i.stack.imgur.com/REfR8.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"40282189","answer_count":"2","comment_count":"0","creation_date":"2016-10-27 06:59:52.497 UTC","last_activity_date":"2016-10-27 13:02:33.087 UTC","last_edit_date":"2016-10-27 10:51:25.093 UTC","last_editor_display_name":"","last_editor_user_id":"5089906","owner_display_name":"","owner_user_id":"5089906","post_type_id":"1","score":"1","tags":"xmlhttprequest|rocket.chat","view_count":"617"} +{"id":"29806449","title":"NSSecureCoding in Swift (Facebook SDK)","body":"\u003cp\u003eI am trying to translate a Objective-C piece of code into Swift code.\u003c/p\u003e\n\n\u003cp\u003eObjective-C:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#import \"SUCacheItem.h\"\n\n#define SUCACHEITEM_TOKEN_KEY @\"token\"\n#define SUCACHEITEM_PROFILE_KEY @\"profile\"\n\n@implementation SUCacheItem\n\n+ (BOOL)supportsSecureCoding\n{\nreturn YES;\n}\n\n- (id)initWithCoder:(NSCoder *)aDecoder\n{\nSUCacheItem *item = [[SUCacheItem alloc] init];\nitem.profile = [aDecoder decodeObjectOfClass:[FBSDKProfile class] forKey:SUCACHEITEM_PROFILE_KEY];\nitem.token = [aDecoder decodeObjectOfClass:[FBSDKAccessToken class] forKey:SUCACHEITEM_TOKEN_KEY];\nreturn item;\n}\n\n- (void)encodeWithCoder:(NSCoder *)aCoder\n{\n[aCoder encodeObject:self.profile forKey:SUCACHEITEM_PROFILE_KEY];\n[aCoder encodeObject:self.token forKey:SUCACHEITEM_TOKEN_KEY];\n}\n\n@end\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI translated this piece of code into this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass CacheItem: NSObject, NSSecureCoding {\n\nlet CACHEITEM_TOKEN_KEY = \"token\"\nlet CACHEITEM_PROFILE_KEY = \"profile\"\nvar profile: AnyObject\nvar token: AnyObject\n\nfunc supportsSecureCoding() -\u0026gt; Bool {\n return true\n}\n\nrequired init(coder aDecoder: NSCoder) {\n var item = CacheItem(coder: aDecoder)\n item.profile = aDecoder.decodeObjectOfClass(FBSDKProfile.self, forKey: CACHEITEM_PROFILE_KEY)!\n item.token = aDecoder.decodeObjectOfClass(FBSDKAccessToken.self, forKey: CACHEITEM_TOKEN_KEY)!\n}\n\n\nfunc encodeWithCoder(aCoder: NSCoder) {\n aCoder.encodeObject(self.profile, forKey: CACHEITEM_PROFILE_KEY)\n aCoder.encodeObject(self.token, forKey: CACHEITEM_TOKEN_KEY)\n} \n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is giving me an error: Type 'CacheItem' does not conform to protocol 'NSSecureCoding'\u003c/p\u003e\n\n\u003cp\u003eWhat am I missing here?\u003c/p\u003e\n\n\u003cp\u003eThanks in advance!\u003c/p\u003e","accepted_answer_id":"29807426","answer_count":"1","comment_count":"0","creation_date":"2015-04-22 18:51:46.927 UTC","last_activity_date":"2015-04-22 19:47:51.32 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3357690","post_type_id":"1","score":"0","tags":"ios|facebook|swift|nssecurecoding","view_count":"661"} +{"id":"12161184","title":"How to provide external link using echo in php?","body":"\u003cp\u003eI am trying to store some link in database, for example \u003ccode\u003ewww.google.com\u003c/code\u003e. Lets say after pulling the value from database I stored it in \u003ccode\u003e$url\u003c/code\u003e. Now, I am trying to set the link by doing \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eecho \"\u0026lt;a href=$url\u0026gt;link\u0026lt;/a\u0026gt;\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow, the problem - whenever I click on the link the links goes to \u003ccode\u003ewww.mydomain.com/www.google.com\u003c/code\u003e\u003c/p\u003e","accepted_answer_id":"12161207","answer_count":"2","comment_count":"0","creation_date":"2012-08-28 14:12:06.22 UTC","last_activity_date":"2012-08-28 15:56:25.207 UTC","last_edit_date":"2012-08-28 14:14:49.337 UTC","last_editor_display_name":"","last_editor_user_id":"1499781","owner_display_name":"","owner_user_id":"1535300","post_type_id":"1","score":"1","tags":"php|sql|echo","view_count":"1074"} +{"id":"23552322","title":"Doctrine 1.2 - Accessors not working as expected","body":"\u003cp\u003eI generated model files successfully, but for some reason I cannot call on known record attributes as if they had concrete accessors, even though I should be able to so via Doctrine_Record::__call(). I checked the \u003ca href=\"http://docs.doctrine-project.org/projects/doctrine1/en/latest/en/manual/yaml-schema-files.html\" rel=\"nofollow\"\u003edoctrine manual\u003c/a\u003e for build options but did not see anything relevant to my problem.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$conns['core_rw'] = Doctrine_Manager::connection('mysql://ccast:@127.0.0.1/core', 'core_rw');\n\nDoctrine_Core::generateModelsFromDb('/path/to/lib/Hobis/App/Model', array_keys($conns),\n array(\n 'baseClassPrefix' =\u0026gt; 'Base_', \n 'baseClassesDirectory' =\u0026gt; 'Base',\n 'classPrefix' =\u0026gt; 'Hobis_App_Model_',\n 'classPrefixFiles' =\u0026gt; false,\n 'generateBaseClasses' =\u0026gt; true,\n 'generateTableClasses' =\u0026gt; true\n )\n);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAfter models were generated, I tried this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$conns['core_rw'] = Doctrine_Manager::connection('mysql://ccast:@127.0.0.1/core', 'core_rw');\n\n$widget = Hobis_App_Model_WidgetTable::getInstance()-\u0026gt;findOneById(1337);\n\n// Works\nvar_dump($widget-\u0026gt;get('id'));\n\n// Does not work\nvar_dump($widget-\u0026gt;getId());\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"0","creation_date":"2014-05-08 20:53:08.703 UTC","last_activity_date":"2014-05-08 20:53:08.703 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"529967","post_type_id":"1","score":"1","tags":"php|doctrine|doctrine-1.2","view_count":"35"} +{"id":"43832473","title":"Using 'Protocol' as a concrete type conforming to protocol 'Protocol' is not supported","body":"\u003cp\u003eI have the following swift code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprotocol Animal {\nvar name: String { get }\n}\n\nstruct Bird: Animal {\n var name: String\n var canEat: [Animal]\n}\n\nstruct Mammal: Animal {\n var name: String\n}\n\nextension Array where Element: Animal {\n func mammalsEatenByBirds() -\u0026gt; [Mammal] {\n var eatenMammals: [Mammal] = []\n self.forEach { animal in\n if let bird = animal as? Bird {\n bird.canEat.forEach { eatenAnimal in\n if let eatenMammal = eatenAnimal as? Mammal {\n eatenMammals.append(eatenMammal)\n } else if let eatenBird = eatenAnimal as? Bird {\n let innerMammals = eatenBird.canEat.mammalsEatenByBirds()\n eatenMammals.append(contentsOf: innerMammals)\n }\n }\n }\n }\n return eatenMammals\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe compiler does not let me compile complaining:\n\u003cstrong\u003eUsing 'Animal' as a concrete type conforming to protocol 'Animal' is not supported\u003c/strong\u003e at the point where I recursively call the function \u003cstrong\u003emammalsEatenByBirds()\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI have seen some other answers but could not relate my problem to any of those.\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2017-05-07 14:08:28.567 UTC","favorite_count":"1","last_activity_date":"2017-05-07 18:54:24.203 UTC","last_edit_date":"2017-05-07 18:54:24.203 UTC","last_editor_display_name":"","last_editor_user_id":"2976878","owner_display_name":"","owner_user_id":"4442322","post_type_id":"1","score":"4","tags":"swift|protocols|extension-methods","view_count":"852"} +{"id":"5811611","title":"Objective-C, global variables and threads","body":"\u003cp\u003eI've made several Objective-C class files. Two of them had the same name for a global variable. When the program was running a thread from one file but was also accessing code from the other file on another thread, the thread seemed to get confused on what global variable belongs to it.\u003c/p\u003e\n\n\u003cp\u003eIs this a true issue or was my code wrong? I seem to have fixed it by changing the variable name.\u003c/p\u003e","accepted_answer_id":"5811715","answer_count":"1","comment_count":"2","creation_date":"2011-04-27 22:54:38.667 UTC","last_activity_date":"2011-04-27 23:11:02.623 UTC","last_edit_date":"2011-04-27 23:11:02.623 UTC","last_editor_display_name":"","last_editor_user_id":"92529","owner_display_name":"","owner_user_id":"238411","post_type_id":"1","score":"0","tags":"objective-c|thread-safety|global-variables","view_count":"521"} +{"id":"254047","title":"How to create HTTP 301 redirect from Stellent (Oracle UCM) script","body":"\u003cp\u003eIs it possible to send a HTTP response with a permanent redirect from a Stellent (now called Oracle UCM) website? We're using version 7.5.2 with iDoc script.\u003c/p\u003e\n\n\u003cp\u003eWe can use the iDoc function setHttpHeader() to send the Location HTTP header, but how to send the HTTP response code 301, to signal the permanent redirect to the browser?\u003c/p\u003e","accepted_answer_id":"3232309","answer_count":"4","comment_count":"0","creation_date":"2008-10-31 16:09:38.833 UTC","last_activity_date":"2016-01-04 14:50:31.91 UTC","last_edit_date":"2009-05-01 06:22:26.573 UTC","last_editor_display_name":"","last_editor_user_id":"70157","owner_display_name":"Kwebble","owner_user_id":"4167","post_type_id":"1","score":"1","tags":"http-headers|oracle-ucm|idoc|stellent","view_count":"1326"} +{"id":"19265541","title":"How to apply css with jquery outside from iframe","body":"\u003cp\u003eI am using iframe popup and i want to change something outside of iframe with jquery from iframe ?\u003c/p\u003e\n\n\u003cp\u003ethis need to be done with jquery.\u003c/p\u003e\n\n\u003cp\u003ecode like this \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;iframe\u0026gt; \u0026lt;div id=\"change\"\u0026gt;Change css\u0026lt;/div\u0026gt; \u0026lt;/iframe\u0026gt;\n\u0026lt;div class=\"outer-div\"\u0026gt; Text goes here \u0026lt;/div\u0026gt;\n\n\u0026lt;script\u0026gt;\n$(\"#change\").live('click', function(){\n $('#outer-div').css('display','none');\n});\n\u0026lt;script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ei want to hide of outer div click on iframe inner div\u003c/p\u003e\n\n\u003cp\u003ethanks\nSimranjeet singh\u003c/p\u003e","answer_count":"1","comment_count":"4","creation_date":"2013-10-09 07:19:20.073 UTC","last_activity_date":"2013-10-09 08:33:33.337 UTC","last_edit_date":"2013-10-09 08:33:33.337 UTC","last_editor_display_name":"","last_editor_user_id":"2772774","owner_display_name":"","owner_user_id":"2772774","post_type_id":"1","score":"0","tags":"javascript|jquery|css|iframe|popup","view_count":"906"} +{"id":"20005358","title":"what is android /dev/input/eventX file used for?","body":"\u003cp\u003eDo these file represent all the sensors in a device ? I have a rot access on my android device but when I try to open these files I see that they are empty, my filer browser tells that these files have been modified a few seconds before I browse this directory\u003c/p\u003e","accepted_answer_id":"20005849","answer_count":"1","comment_count":"0","creation_date":"2013-11-15 16:06:15.597 UTC","favorite_count":"0","last_activity_date":"2013-11-15 18:17:28.677 UTC","last_edit_date":"2013-11-15 16:11:53.423 UTC","last_editor_display_name":"","last_editor_user_id":"1227842","owner_display_name":"","owner_user_id":"1227842","post_type_id":"1","score":"1","tags":"android|android-sensors","view_count":"1189"} +{"id":"5680693","title":"Duplicate Data invalid identifier","body":"\u003cp\u003eMy query is showing all possible combinations of results for this query when i use query builder. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eselect \n \"PURCHASEDETAIL\".\"PMID\" as \"PMID\",\n \"PURCHASEDETAIL\".\"CUSTOMER_ID\" as \"CUSTOMERID\",\n \"PRODUCT\".\"DESCRIPTION\" as \"DESCRIPTION\",\n \"PRODUCT\".\"PRICE\" as \"PRICE\",\n \"PURCHASEDETAIL\".\"QUANTITY\" as \"QUANTITY\",\n \"SUPPLIER\".\"SUPPLIER_NAME\" as \"SUPPLIER_NAME\",\n \"PURCHASEMASTER\".\"PURCHASE_DATE_TIME\" as \"PURCHASE_DATE_TIME\" \n from \n \"SUPPLIER\"\n left join product\n ON supplier.supplierid = product.supplierid\n left join purchasemaster\n on purchasemaster.customerid = purchasedetail.customerid\n left join purchasedetail\n on purchasedetail.pmid = purchasemaster.pmid\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I enter the above info to pull info from 4 table I get the below error. \u003c/p\u003e\n\n\u003cp\u003eORA-00904: \"PURCHASEDETAIL\".\"CUSTOMER_ID\": invalid identifier\u003c/p\u003e\n\n\u003cp\u003eAny ideas why? \u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2011-04-15 18:10:28.27 UTC","last_activity_date":"2011-04-15 19:02:45.2 UTC","last_edit_date":"2011-04-15 18:18:32.567 UTC","last_editor_display_name":"","last_editor_user_id":"649922","owner_display_name":"","owner_user_id":"710272","post_type_id":"1","score":"2","tags":"sql|identifier","view_count":"472"} +{"id":"38355305","title":"UWP buttons inside Listview items","body":"\u003cp\u003eI'm working on my first UWP app and I want create a UI like this \u003cimg src=\"https://i.stack.imgur.com/24q7g.png\" alt=\"\"\u003e. For each list item (project) there'll be a set of buttons. For certain list items(projects) some of these buttons will be disabled some times. So I need to disable and change the image for such button in those list items(projects).\u003c/p\u003e\n\n\u003cp\u003eI tried to implement it using a list view like this. But I am not sure how I can enable/disable some of those buttons depending on the condition.\u003c/p\u003e\n\n\u003cp\u003eTried adding a DataContextChanged event and trying to access the buttons there. But not sure how I can access those buttons.\u003c/p\u003e\n\n\u003cp\u003ePlease let me know whether the following approach is correct or is there a better way to do what I am trying to achieve in the above image.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;ListView x:Name=\"stepsListView\" Margin=\"10,0,0,0\" RequestedTheme=\"Dark\" FontSize=\"24\" Background=\"{StaticResource procedure_app_white}\" Foreground=\"Black\" BorderThickness=\"1.5\" BorderBrush=\"Transparent\" ItemsSource=\"{Binding projectList}\" HorizontalAlignment=\"Left\"\u0026gt;\n \u0026lt;ListView.ItemContainerStyle\u0026gt;\n \u0026lt;Style TargetType=\"ListViewItem\"\u0026gt;\n \u0026lt;Setter Property=\"HorizontalContentAlignment\" Value=\"Stretch\"/\u0026gt;\n \u0026lt;/Style\u0026gt;\n \u0026lt;/ListView.ItemContainerStyle\u0026gt;\n\n \u0026lt;!-- Item --\u0026gt;\n \u0026lt;ListView.ItemTemplate\u0026gt;\n \u0026lt;DataTemplate\u0026gt;\n \u0026lt;Border BorderThickness=\"0,0,0,1\" BorderBrush=\"#c0c0c0\"\u0026gt;\n \u0026lt;Grid Width=\"auto\" HorizontalAlignment=\"Stretch\" DataContextChanged=\"Grid_DataContextChanged\" \u0026gt;\n \u0026lt;Grid.RowDefinitions\u0026gt;\n \u0026lt;RowDefinition Height=\"*\"/\u0026gt;\n \u0026lt;RowDefinition Height=\"50\"/\u0026gt;\n \u0026lt;/Grid.RowDefinitions\u0026gt;\n \u0026lt;Grid.ColumnDefinitions\u0026gt;\n \u0026lt;ColumnDefinition Width=\"*\"/\u0026gt;\n \u0026lt;ColumnDefinition Width=\"100\"/\u0026gt;\n \u0026lt;ColumnDefinition Width=\"100\"/\u0026gt;\n \u0026lt;ColumnDefinition Width=\"100\"/\u0026gt;\n \u0026lt;ColumnDefinition Width=\"100\"/\u0026gt;\n \u0026lt;ColumnDefinition Width=\"100\"/\u0026gt;\n \u0026lt;ColumnDefinition Width=\"100\"/\u0026gt;\n \u0026lt;/Grid.ColumnDefinitions\u0026gt;\n \u0026lt;TextBlock VerticalAlignment=\"Center\" FontSize=\"30\" Grid.Row=\"0\" Grid.ColumnSpan=\"7\" Text=\"{Binding projectName}\" Foreground=\"{StaticResource procedure_app_orange_text }\" /\u0026gt;\n\n \u0026lt;Button x:Name=\"warningButton\" Width=\"40\" Height=\"40\" Grid.Column=\"1\" Grid.Row=\"1\" Tag=\"{Binding projectId}\" Click=\"warningButtonClick\" Foreground=\"{StaticResource procedure_app_orange_text }\"\u0026gt;\n \u0026lt;Button.Background\u0026gt;\n \u0026lt;ImageBrush ImageSource=\"Asset/step_ncwr.png\"\u0026gt;\n \u0026lt;/ImageBrush\u0026gt;\n \u0026lt;/Button.Background\u0026gt;\n \u0026lt;/Button\u0026gt;\n \u0026lt;Button x:Name=\"commentButton\" Width=\"40\" Height=\"40\" Grid.Column=\"2\" Grid.Row=\"1\" Tag=\"{Binding projectId}\" Click=\"CommentButtonClick\" Foreground=\"{StaticResource procedure_app_orange_text }\" IsTapEnabled=\"True\"\u0026gt;\n \u0026lt;Button.Background\u0026gt;\n \u0026lt;ImageBrush ImageSource=\"Asset/step_comment.png\"\u0026gt;\n \u0026lt;/ImageBrush\u0026gt;\n \u0026lt;/Button.Background\u0026gt;\n \u0026lt;/Button\u0026gt;\n \u0026lt;Button x:Name=\"imageButton\" Width=\"40\" Height=\"40\" Grid.Column=\"3\" Grid.Row=\"1\" Tag=\"{Binding projectId}\" Click=\"ImageButtonClick\" Foreground=\"{StaticResource procedure_app_orange_text }\"\u0026gt;\n \u0026lt;Button.Background\u0026gt;\n \u0026lt;ImageBrush ImageSource=\"Asset/step_image.png\"\u0026gt;\n \u0026lt;/ImageBrush\u0026gt;\n \u0026lt;/Button.Background\u0026gt;\n \u0026lt;/Button\u0026gt;\n \u0026lt;/Grid\u0026gt;\n \u0026lt;/Border\u0026gt;\n \u0026lt;/DataTemplate\u0026gt;\n \u0026lt;/ListView.ItemTemplate\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"38355645","answer_count":"1","comment_count":"0","creation_date":"2016-07-13 15:00:41.6 UTC","last_activity_date":"2016-12-30 20:29:42.457 UTC","last_edit_date":"2016-12-30 20:29:42.457 UTC","last_editor_display_name":"","last_editor_user_id":"4906107","owner_display_name":"","owner_user_id":"1692096","post_type_id":"1","score":"2","tags":"c#|xaml|listview|uwp|uwp-xaml","view_count":"2294"} +{"id":"39974193","title":"Template Parse Error ngFor, FormArray","body":"\u003cp\u003eI am building dynamic objects using ReactiveFormsModule. My main module is \u003cstrong\u003eapp\u003c/strong\u003e. Then I have a sub-module \u003cstrong\u003econfig\u003c/strong\u003e. this component has \u003cstrong\u003eObjectConfigComponent\u003c/strong\u003e and \u003cstrong\u003eFieldConfigComponent\u003c/strong\u003e.\u003c/p\u003e\n\n\u003cp\u003eI built using reference \u003ca href=\"https://scotch.io/tutorials/how-to-build-nested-model-driven-forms-in-angular-2\" rel=\"nofollow\"\u003ehere\u003c/a\u003e\nThe plunker mentioned in the article seems to work. I haven't been able to run mine. \u003c/p\u003e\n\n\u003cp\u003eHere is my code.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eexport class CompositeObject {\n public fields: Field[];\n}\n\nexport class Field {\n public name: string;\n public datatype: DataType;\n}\n\nexport enum DataType {\n string = 1,\n number,\n date\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eObjectConfigComponent\u003c/strong\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport { Component, OnInit } from '@angular/core';\nimport { CompositeObject } from './../../models/compositeobject';\nimport { Validators, FormGroup, FormArray, FormBuilder } from '@angular/forms';\n\n@Component({\n selector: 'objectconfig',\n templateUrl: 'objectconfig.component.html'\n})\nexport class ObjectConfigComponent implements OnInit {\n public myForm: FormGroup;\n constructor(private _formbuilder: FormBuilder) { }\n\n public ngOnInit() {\n this.myForm = this._formbuilder.group({\n fields: this._formbuilder.array([\n this.initField(),\n ])\n });\n }\n\n public save(model: CompositeObject ) {\n console.log(model);\n }\n\n private initField() {\n // initialize our address\n return this._formbuilder.group({\n name: ['', Validators.required],\n datatype: ['string', Validators.required]\n });\n }\n\n private addField() {\n // add address to the list\n const control = \u0026lt;FormArray\u0026gt;this.myForm.controls['fields'];\n control.push(this.initField());\n }\n\n private removeField(i: number) {\n // remove address from the list\n const control = \u0026lt;FormArray\u0026gt;this.myForm.controls['fields'];\n control.removeAt(i);\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eHTML\u003c/strong\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"row\"\u0026gt;\n \u0026lt;div class=\"well bs-component\"\u0026gt;\n \u0026lt;form [formGroup]=\"myForm\" novalidate (ngSubmit)=\"save(myForm)\"\u0026gt;\n \u0026lt;!--fields--\u0026gt;\n \u0026lt;div formArrayName=\"fields\"\u0026gt;\n \u0026lt;div *ngFor=\"let field of myForm.controls.fields.controls; let i=index\"\u0026gt;\n \u0026lt;div [formGroupName]=\"i\"\u0026gt;\n \u0026lt;fieldform [group]=\"myForm.controls.fields.controls[i]\"\u0026gt;\u0026lt;/fieldform\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"form-group\"\u0026gt;\n \u0026lt;div class=\"col-lg-10 col-lg-offset-2\"\u0026gt;\n \u0026lt;button class=\"btn btn-link\" (click)=\"addField()\"\u0026gt;Add another attribute\u0026lt;/button\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"form-group\"\u0026gt;\n \u0026lt;div class=\"col-lg-10 col-lg-offset-2\"\u0026gt;\n \u0026lt;button type=\"reset\" class=\"btn btn-default\"\u0026gt;Cancel\u0026lt;/button\u0026gt;\n \u0026lt;button type=\"submit\" class=\"btn btn-primary\"\u0026gt;Submit\u0026lt;/button\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/form\u0026gt;\n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eFieldFormComponent\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport { Component, OnInit, Input } from '@angular/core';\nimport { FormGroup } from '@angular/forms';\n@Component({\n selector: 'fieldform',\n templateUrl: 'fieldform.component.html'\n})\nexport class FieldFormComponent implements OnInit {\n @Input('group')\n public fieldForm: FormGroup;\n constructor() { }\n\n ngOnInit() { }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eHTML\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div [formGroup]=\"fieldForm\"\u0026gt;\n \u0026lt;!-- Angular assigns array index as group name by default 0, 1, 2, ... --\u0026gt;\n \u0026lt;div class=\"form-group\"\u0026gt;\n \u0026lt;!--name--\u0026gt;\n \u0026lt;label class=\"col-lg-2 control-label\"\u0026gt;Attribute\u0026lt;/label\u0026gt;\n \u0026lt;div class=\"col-lg-4\"\u0026gt;\n \u0026lt;input class=\"form-control\" id=\"inputName-{{i}}\" type=\"text\" formControlName=\"name\"\u0026gt;\n \u0026lt;!--display error message if street is not valid--\u0026gt;\n \u0026lt;small [hidden]=\"fieldForm.controls.name.valid\"\u0026gt;\n name is required\n \u0026lt;/small\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;!--datatype--\u0026gt;\n \u0026lt;div class=\"col-lg-4\"\u0026gt;\n \u0026lt;select class=\"form-control\" formControlName=\"datatype\"\u0026gt;\n \u0026lt;option\u0026gt;string\u0026lt;/option\u0026gt;\n \u0026lt;option\u0026gt;number\u0026lt;/option\u0026gt;\n \u0026lt;option\u0026gt;date\u0026lt;/option\u0026gt;\n \u0026lt;/select\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am getting the following error:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eError: Uncaught (in promise): Error: Template parse errors: Can't bind\n to 'ngForOf' since it isn't a known property of 'div'. (\"\n \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;div formArrayName=\"fields\"\u0026gt;\n\n \u0026lt;div [ERROR -\u0026gt;]*ngFor=\"let field of myForm.controls.fields.controls; let i=index\"\u0026gt;\n\n \u0026lt;div [formGr\"): ObjectConfigComponent@5:21 Property binding ngForOf not used by any directive on an embedded\n\u003c/code\u003e\u003c/pre\u003e\n \n \u003cp\u003etemplate. Make sure that the property name is spelled correctly and\n all directives are listed in the \"directives\" section. (\"\n \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;div formArrayName=\"fields\"\u0026gt;\n\n [ERROR -\u0026gt;]\u0026lt;div *ngFor=\"let field of myForm.controls.fields.controls; let i=index\"\u0026gt;\n\n \u0026lt;div [f\"): ObjectConfigComponent@5:16\n\u003c/code\u003e\u003c/pre\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eWhat am I doing wrong. \u003c/p\u003e","accepted_answer_id":"39974240","answer_count":"1","comment_count":"0","creation_date":"2016-10-11 09:26:30.807 UTC","last_activity_date":"2017-08-25 09:11:40.14 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1124913","post_type_id":"1","score":"2","tags":"angular|webpack|ngfor","view_count":"985"} +{"id":"9317345","title":"Proper GROUP BY syntax","body":"\u003cp\u003eI'm fairly proficient in mySQL and MSSQL, but I'm just getting started with postgres. I'm sure this is a simple issue, so to be brief:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSQL error:\n\nERROR: column \"incidents.open_date\" must appear in the GROUP BY clause or be used in an aggregate function\n\nIn statement:\nSELECT date(open_date), COUNT(*)\nFROM incidents\nGROUP BY 1\nORDER BY open_date\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe type for \u003ccode\u003eopen_date\u003c/code\u003e is \u003ccode\u003etimestamp with time zone\u003c/code\u003e, and I get the same results if I use \u003ccode\u003eGROUP BY date(open_date)\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eI've tried going over the postgres docs and some examples online, but everything seems to indicate that this should be valid.\u003c/p\u003e","accepted_answer_id":"9317381","answer_count":"2","comment_count":"0","creation_date":"2012-02-16 18:57:14.287 UTC","last_activity_date":"2012-02-16 19:03:27.137 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1064767","post_type_id":"1","score":"1","tags":"postgresql","view_count":"1948"} +{"id":"27236539","title":"What about Data.Attoparsec.ByteString.Lazy.Char8?","body":"\u003cp\u003eAttoparsec has modules specialized for Strict/Lazy, ByteString/Text, Char8 (ascii)/Char. But it doesn't have all the combinations.\u003c/p\u003e\n\n\u003cp\u003eI think \u003ccode\u003eData.Attoparsec.ByteString.Lazy.Char8\u003c/code\u003e which isn't provided would be particularly convenient for grinding through large reports which tend to be encoded as ascii.\u003c/p\u003e\n\n\u003cp\u003eDo you know why it doesn't exist?\u003c/p\u003e","answer_count":"0","comment_count":"4","creation_date":"2014-12-01 20:17:59.847 UTC","last_activity_date":"2014-12-01 20:17:59.847 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"914859","post_type_id":"1","score":"1","tags":"haskell|attoparsec","view_count":"149"} +{"id":"23054680","title":"Finding the indices of the rows where there are non-zero entries in a sparse csc_matrix","body":"\u003cp\u003eI have a numpy array, X:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etype(X)\n\u0026gt;\u0026gt;\u0026gt; \u0026lt;class 'scipy.sparse.csc.csc_matrix'\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am interested in finding the indices of the rows where there are non-zero entries, in the 0th column. I tried:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003egetcol = X.getcol(0)\nprint getcol\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhich gives me:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e(0, 0) 1\n(2, 0) 1\n(5, 0) 10\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is great, but what I want is a vector that has \u003ccode\u003e0, 2, 5\u003c/code\u003e in it. \u003c/p\u003e\n\n\u003cp\u003eHow do I get the indices I'm looking for?\u003c/p\u003e\n\n\u003cp\u003eThanks for the help.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-04-14 07:46:29.903 UTC","last_activity_date":"2014-04-14 19:59:46.43 UTC","last_edit_date":"2014-04-14 11:48:17.67 UTC","last_editor_display_name":"","last_editor_user_id":"832621","owner_display_name":"","owner_user_id":"2822004","post_type_id":"1","score":"4","tags":"python|numpy|scipy|sparse-matrix","view_count":"997"} +{"id":"16362892","title":"CSS id selector doesn't applied to a component inside jsf page","body":"\u003cp\u003eI have these css file with an id selector as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#globalFilter {\nmargin-left: 995px;\nmargin-top:-30px;\nwidth:320px;\nheight:20px;\nfont-size: 11px;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand the component with the mentioned id is as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;p:inputText id=\"globalFilter\" value=\"Search\" /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand it's inside a called \u003ccode\u003enotifybar\u003c/code\u003e, the problem is that the properties in the selector doesn't applied on the component when the page is rendered\u003c/p\u003e\n\n\u003cp\u003eNote: the css file is loaded successfully and the component with id=\"globalFilter\" exists in the view source mode\u003c/p\u003e\n\n\u003cp\u003ealso these class selector doesn't applied to another component inside the page:\u003c/p\u003e\n\n\u003cp\u003eselector:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e.underlineOnHover{\ntext-decoration: underline;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ecomponent:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;h:outputLink id=\"notify\"styleClass=\"underlineOnHover\"\u0026gt;\n \u0026lt;h:outputText value=\"notifications\" /\u0026gt;\n \u0026lt;/h:outputLink\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ealso these is the generated html for the \u003ccode\u003e\u0026lt;p:inputText id=\"globalFilter\"\u0026gt;\u003c/code\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;input id=\"globalFilter\" name=\"globalFilter\" type=\"text\" value=\"Search\" class=\"ui-inputfield ui-inputtext ui-widget ui-state-default ui-corner-all\" /\u0026gt;\u0026lt;script id=\"globalFilter_s\" type=\"text/javascript\"\u0026gt;PrimeFaces.cw('InputText','widget_globalFilter',{id:'globalFilter'});\u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"16363003","answer_count":"1","comment_count":"4","creation_date":"2013-05-03 15:48:24.467 UTC","last_activity_date":"2013-05-03 17:27:06.433 UTC","last_edit_date":"2013-05-03 17:27:06.433 UTC","last_editor_display_name":"","last_editor_user_id":"813159","owner_display_name":"","owner_user_id":"813159","post_type_id":"1","score":"0","tags":"css|jsf|jsf-2","view_count":"735"} +{"id":"18473582","title":"setting maven archetype using eclipse GUI","body":"\u003cp\u003eI am using\u003ca href=\"http://www.mkyong.com/spring/maven-spring-hibernate-mysql-example/\" rel=\"nofollow noreferrer\"\u003e this tutorial\u003c/a\u003e to build a first spring application using hibernate, eclipse, tomcat, and MySQL. At step 2 of the tutorial, the following instructions are given: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCreate a quick project file structure with Maven command ‘mvn archetype:generate‘.\nConvert it to Eclipse project (mvn eclipse:eclipse) and import it into Eclipse IDE.\n\nE:\\workspace\u0026gt;mvn archetype:generate\n[INFO] Scanning for projects...\n...\nChoose a number: \n(1/2/3....) 15: : 15\n...\nDefine value for groupId: : com.mkyong.common\nDefine value for artifactId: : HibernateExample\nDefine value for version: 1.0-SNAPSHOT: :\nDefine value for package: com.mkyong.common: : com.mkyong.common\n[INFO] OldArchetype created in dir: E:\\workspace\\HibernateExample\n[INFO] ------------------------------------------------------------------------\n[INFO] BUILD SUCCESSFUL\n[INFO] ------------------------------------------------------------------------\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to use eclipse's GUI interface to do the same thing, without having to resort to the command line. I have the m2e and m2e-wtp plugins installed with eclipse kepler and the springsource tool suite. \u003c/p\u003e\n\n\u003cp\u003eCan anyone show me how to use the eclipse GUI to Create a project file structure with Maven archetype, convert it to Eclipse project, and import it into Eclipse IDE?\u003c/p\u003e\n\n\u003cp\u003eWhen I type in File --\u003e New Project... --\u003e Maven Project , I get the following dialog box, which does not clearly show how to choose an archetype: \u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://s16.postimg.org/ovtrk9l8l/newmaven.gif\"\u003e \u003c/p\u003e\n\n\u003chr\u003e\n\n\u003ch2\u003eEDIT:\u003c/h2\u003e\n\n\u003cp\u003eAfter the great suggestion in an answer below, I still need to know which archetype to choose in eclipse for the specific tutorial to which I am linking above. The clues that I see in the code are pick a number...15 , oldarchetype, and 1.0 SNAPSHOT but these clues do not mesh with the eclipse gui options. Can anyone show me which archetype to choose from among the options that the eclipse gui gives?\u003c/p\u003e","accepted_answer_id":"18473643","answer_count":"1","comment_count":"3","creation_date":"2013-08-27 19:08:54.76 UTC","last_activity_date":"2013-08-27 19:50:03.65 UTC","last_edit_date":"2017-02-08 14:43:57.557 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"807797","post_type_id":"1","score":"1","tags":"java|eclipse|spring|maven|spring-mvc","view_count":"4475"} +{"id":"37369028","title":"Firebase Analytics on Android TV","body":"\u003cp\u003eDoes the \u003ca href=\"https://firebase.google.com/docs/analytics/\" rel=\"nofollow\"\u003eFirebase Analytics\u003c/a\u003e work on Android TV? I think it requires Google Play Services but they are not available for Android TV. If not, any suggested alternatives?\u003c/p\u003e","accepted_answer_id":"37370135","answer_count":"1","comment_count":"0","creation_date":"2016-05-21 23:26:31.11 UTC","last_activity_date":"2016-05-22 03:07:54.027 UTC","last_edit_date":"2016-05-22 00:24:01.6 UTC","last_editor_display_name":"","last_editor_user_id":"209103","owner_display_name":"","owner_user_id":"2456568","post_type_id":"1","score":"2","tags":"firebase|analytics|android-tv|firebase-analytics","view_count":"241"} +{"id":"5014496","title":"3 linkbuttons one event handler","body":"\u003cp\u003eI am a beginner in asp.net, I've done my research but not very clear.\u003c/p\u003e\n\n\u003cp\u003eI have 3 links lkn1,2,3\u003c/p\u003e\n\n\u003cp\u003eBasically, I am looking at something like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprotected void lnkBtn_Click(object sender,EventArgs e)\n{\n LinkButton lnkRes = sender as LinkButton;\n string text = lnkRes.Text.Trim();\n string sql = \"\"\n if(text.ToUpper() == \"INBOX\")\n {\n sql = \"SELECT * FROM InboxTbl where receiver_id = \"helloworld\";\n }\n else if(text.ToUpper() == \"DRAFT\")\n {\n sql = \"SELECT * FROM Inbox where sender_id=\"HelloWorld\";\n }\n else if(text.ToUpper() == \"SENT\")\n {\n sql = \"SELECT * FROM Inbox where sender_id=\"HelloWorld\";\n }\n if(sql != \"\")\n {\n SqlDataAdapter adp = new SqlDataAdapter(sql,ConnectionString);\n DataSet ds = new DataSet();\n adp.Fill(ds,\"tbl\");\n GridView1.DataSource = ds.Tables[\"tbl\"].DefaultView;\n GridView1.DataBind();\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow do I write this code and where should I write it, so that depending on the text of the linkbutton, the respective sql statement is executed?\u003c/p\u003e\n\n\u003cp\u003eIf this has anything to do with event handling.. 3links one event.. pls send me some links I could read and understand\u003c/p\u003e","accepted_answer_id":"5014664","answer_count":"4","comment_count":"2","creation_date":"2011-02-16 09:10:17.173 UTC","last_activity_date":"2011-02-16 09:36:32.147 UTC","last_edit_date":"2011-02-16 09:17:05.523 UTC","last_editor_display_name":"","last_editor_user_id":"7872","owner_display_name":"","owner_user_id":"575219","post_type_id":"1","score":"1","tags":"asp.net|linkbutton","view_count":"480"} +{"id":"12919988","title":"Design pattern to truncate a large object graph","body":"\u003cp\u003eUsing Java, I have a very large object graph where an object is associated with many other objects each of which is associated with yet many other objects. Most of the time I just need a sub-graph to pass on to a method or send across a network.\u003c/p\u003e\n\n\u003cp\u003eIs there a recommended design pattern so I can truncate this large object graph at many points in the graph. One way would be provide NULL as reference at all points of truncation. I'd appreciate any other ideas.\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","answer_count":"3","comment_count":"4","creation_date":"2012-10-16 17:09:21.397 UTC","favorite_count":"1","last_activity_date":"2012-10-16 17:30:00.177 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1370089","post_type_id":"1","score":"4","tags":"java|object|graph","view_count":"378"} +{"id":"41018405","title":"Stanford NLP NER Time tag not working","body":"\u003cp\u003eMy input sentence is this \u003ccode\u003eLet's meet on wednesday at 9:00AM.\u003c/code\u003e Now while checking the NER tagging with \u003ccode\u003eclassifier\u003c/code\u003e \u003ccode\u003eenglish.muc.7class.distsim.crf.ser.gz\u003c/code\u003e here \u003ca href=\"http://nlp.stanford.edu:8080/ner/process\" rel=\"nofollow noreferrer\"\u003ehttp://nlp.stanford.edu:8080/ner/process\u003c/a\u003e I am getting perfect tagging for \u003ccode\u003ewednesday\u003c/code\u003e as \u003ccode\u003eDate\u003c/code\u003e and \u003ccode\u003e9:00AM\u003c/code\u003e for \u003ccode\u003eTime\u003c/code\u003e. \u003c/p\u003e\n\n\u003cp\u003eBut when I am checking the same in my python application below code snippet \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efrom nltk.tag import StanfordNERTagger\nst = StanfordNERTagger('/stanford-ner-2015-12-09/classifiers/english.muc.7class.distsim.crf.ser.gz')\ntext=\"Let's meet on wednesday at 09:00am.\"\ntokenized_text = word_tokenize(text)\nclassified_text = st.tag(tokenized_text)\nprint(classified_text)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIts tagging \u003ccode\u003e9:00AM\u003c/code\u003e as \u003ccode\u003eO\u003c/code\u003e .Here is the complete o/p\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[('Let', 'O'), (\"'s\", 'O'), ('meet', 'O'), ('on', 'O'), ('wednesday', 'DATE'), ('at', 'O'), ('09:00am', 'O'), ('.', 'O')]\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"0","creation_date":"2016-12-07 13:10:28.977 UTC","last_activity_date":"2016-12-07 13:33:47.123 UTC","last_edit_date":"2016-12-07 13:33:47.123 UTC","last_editor_display_name":"","last_editor_user_id":"2079875","owner_display_name":"","owner_user_id":"2079875","post_type_id":"1","score":"1","tags":"python|stanford-nlp","view_count":"70"} +{"id":"8451284","title":"What is the name of this kind of route?","body":"\u003cp\u003eI was just reading through \u003ca href=\"http://techbehindtech.com/category/clojure/\" rel=\"nofollow\"\u003ea Compojure tutorial\u003c/a\u003e and saw this route example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e(GET \"/addresses/:id\" [id] (json-response (address/find id)))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI was wondering what is a proper official name for the kind of route where the part of path is the parameter, rather than an actual HTTP parameter (GET or POST)\u003c/p\u003e\n\n\u003cp\u003eI know what it does. I'd like to know what is its name. The best I could think of is friendly URL, although that is quite vague.\u003c/p\u003e","accepted_answer_id":"8459026","answer_count":"1","comment_count":"0","creation_date":"2011-12-09 20:24:18.967 UTC","last_activity_date":"2011-12-10 18:58:39.23 UTC","last_edit_date":"2011-12-09 20:39:48.803 UTC","last_editor_display_name":"","last_editor_user_id":"506721","owner_display_name":"","owner_user_id":"506721","post_type_id":"1","score":"1","tags":"clojure|compojure|ring","view_count":"104"} +{"id":"27073384","title":"How to change source-ip(tcp) in Java","body":"\u003cp\u003eIs it possible to change TCP header in Java?\nIf it's possible, is there any [Change Header] method?\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2014-11-22 02:26:18.13 UTC","last_activity_date":"2015-10-31 12:48:21.893 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3312583","post_type_id":"1","score":"0","tags":"java|tcp","view_count":"849"} +{"id":"8863269","title":"How do I verify reference count in ARC mode?","body":"\u003cp\u003eI used to verify that some of my variables had the expected retain count using [myVar retainCount] under the debugger, especially for var that did not have a custom dealloc.\u003c/p\u003e\n\n\u003cp\u003eHow do you do this in ARC mode? How do you ensure that there are no memory leaks?\u003c/p\u003e\n\n\u003cp\u003eNote: I understand that ARC should handle this for me, but life is far from being perfect, and in real life you have objects that are sometimes allocated by third party libraries (using retain?) and never deallocated.\u003c/p\u003e\n\n\u003cp\u003eImage that I do this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eMyObj *myObj=[[MyObj alloc] init];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethen I call\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[somethingElse doSomethingWithMyObj:myObj];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand later, I do\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emyObj=NULL;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf my program is working fine, my expectation is that myObj is being destroyed, but it appears not to be the case...\u003c/p\u003e\n\n\u003cp\u003eSo how can I track this, especially if somethingElse is not managed by me?\u003c/p\u003e\n\n\u003cp\u003eNow, about the tools: it seems extremely hard to run memory tools on my mac (with 5 Meg) without rebooting the mac and starting from scratch. This is really annoying! Instruments keep crashing even before the program has started, so is there an alterante solution?\u003c/p\u003e","accepted_answer_id":"8963645","answer_count":"8","comment_count":"7","creation_date":"2012-01-14 15:47:16.667 UTC","favorite_count":"20","last_activity_date":"2015-10-24 11:29:15.033 UTC","last_edit_date":"2013-03-13 20:41:02.727 UTC","last_editor_display_name":"","last_editor_user_id":"970132","owner_display_name":"","owner_user_id":"217756","post_type_id":"1","score":"32","tags":"iphone|ios|automatic-ref-counting","view_count":"27321"} +{"id":"19159716","title":"What does IE8 not understand about this CSS?","body":"\u003cp\u003eWhat does IE8 not understand about this CSS?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e.menu_links_hfp.block-type-navigation ul.menu li.current_page_item \u0026gt; ul.sub-menu,\n.menu_links_hfp.block-type-navigation ul.menu li.current-menu-item \u0026gt; ul.sub-menu,\n.menu_links_hfp.block-type-navigation ul.menu li.current_page_parent \u0026gt; ul.sub-menu\n{\ndisplay: block !important;\nposition: relative !important;\nleft: auto !important;\nvisibility: visible !important;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have a CSS problem with the left menu in IE8 in this page when hovering on this Wordpress site:\nedit: here is the orig url \u003ca href=\"http://www.wpcollege.nl/mytestpage/\" rel=\"nofollow\"\u003ehttp://www.wpcollege.nl/mytestpage/\u003c/a\u003e (hover over submenu item in the left menu in ie8 and see what happens)\u003c/p\u003e\n\n\u003cp\u003eWhat happens is that on a hover, things get messed up and it floats out to the right side of the parent. In ie8+, chrome, firefox no problems. \u003c/p\u003e\n\n\u003cp\u003eDo I have to add statements with :hover for ie8 only? I can add body class .ie8 to target ie8 only.\u003c/p\u003e\n\n\u003cp\u003eAny help much much appreciated. I am stuck ! Regards,\u003c/p\u003e","accepted_answer_id":"19160932","answer_count":"2","comment_count":"2","creation_date":"2013-10-03 12:51:49.683 UTC","last_activity_date":"2013-10-03 14:06:35.77 UTC","last_edit_date":"2013-10-03 13:11:18.09 UTC","last_editor_display_name":"","last_editor_user_id":"2842524","owner_display_name":"","owner_user_id":"2842524","post_type_id":"1","score":"0","tags":"css|wordpress|internet-explorer-8|submenu","view_count":"133"} +{"id":"40396856","title":"Downcasting a pointer to member function","body":"\u003cp\u003eI'd like to downcast a pointer to a member function, where the base class is inherited virtually. This leads to an error at compile time.\u003c/p\u003e\n\n\u003cp\u003eIn my application, I have a collection of several objects (e.g. \u003ccode\u003eD1\u003c/code\u003e, \u003ccode\u003eD2\u003c/code\u003e), that have a common base class \u003ccode\u003eB\u003c/code\u003e. They are held together and kept track of by means of a \u003ccode\u003estd::vector\u0026lt;B*\u0026gt;\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eThe derived objects introduce \u003ccode\u003edouble\u003c/code\u003e-returning functions that need to be called on a regular basis. The base class keeps track of these functions by means of a \u003ccode\u003estd::vector\u0026lt;double(B::*)(void)\u0026gt;\u003c/code\u003e. The whole chain is utilized in the second to last line of the main function.\u003c/p\u003e\n\n\u003cp\u003eTherefore, I needed to cast the function pointers when adding them to the vector, as is done in the constructor of the derived classes \u003ccode\u003eD1\u003c/code\u003e and \u003ccode\u003eD2\u003c/code\u003e. his is successful in case of \u003ccode\u003eD1\u003c/code\u003e, but not in case of \u003ccode\u003eD2\u003c/code\u003e, as \u003ccode\u003eB\u003c/code\u003e is a virtual base of \u003ccode\u003eD2\u003c/code\u003e. As I learned, a static cast does not work in this case (error message 1), because the deriving classes \u003ccode\u003eD21\u003c/code\u003e and \u003ccode\u003eD22\u003c/code\u003e only have a pointer to the instance of \u003ccode\u003eB\u003c/code\u003e. However, a dynamic_cast also leads to an error at compile time (error message 2), saying that the target is not of pointer type.\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e\u003cstrong\u003eerror message 1\u003c/strong\u003e: error: pointer to member conversion via virtual base 'B' v.push_back(static_cast(\u0026amp;D2::f2));\u003c/p\u003e\n \n \u003cp\u003e\u003cstrong\u003eerror message 2\u003c/strong\u003e: error: cannot dynamic_cast '\u0026amp;D2::f2' (of type 'double (class D2::\u003cem\u003e)()') to type 'double (class B::\u003c/em\u003e)()' (target is not pointer or reference)\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI'd like to know how, if at all, I can perform the desired cast. If not I'd like to know why such a thing is not possible.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdit: Some background:\u003c/strong\u003e I integrate a system of ordinary differential equations numerically. The derived classes represent the individual equations of the system, and each derived class computes its own state. By collecting the classes in the vector \u003ccode\u003eo\u003c/code\u003e, I can quickly modify the system of equations. The vector \u003ccode\u003ev\u003c/code\u003e in the base class is needed for output purposes. During integration, each subsystem also takes care of its own output through the base class. The diamond arose because I separated two often used pieces of code into two individual classes.\u003c/p\u003e\n\n\u003cp\u003eArguably, there are other ways to design the class hierarchy, and there are other ways to achieve my goal (in this case I made the function \u003ccode\u003ep\u003c/code\u003e in \u003ccode\u003eB\u003c/code\u003e virtual, and re-implemented it in the deriving classes). However, I could not fathom why the cast failed, so I asked the question.\u003c/p\u003e\n\n\u003cp\u003eMWE:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e #include \u0026lt;vector\u0026gt;\n #include \u0026lt;algorithm\u0026gt;\n #include \u0026lt;iostream\u0026gt;\n\n // Base class\n class B {\n protected:\n std::vector\u0026lt;double(B::*)(void)\u0026gt; v;\n public:\n void p ( void )\n {for_each(v.begin(), v.end(), [this] (double (B::*f) (void)) {std::cerr \u0026lt;\u0026lt; (this-\u0026gt;*f)() \u0026lt;\u0026lt; std::endl;});};\n };\n\n // Normal inheritance\n class D1: public B\n {public:\n double f1 ( void ) { return 1; }\n D1() { v.push_back(static_cast\u0026lt;double(B::*)(void)\u0026gt;(\u0026amp;D1::f1));} // Casting is successful here.\n };\n\n // Setting up 'the diamond'\n class D21: virtual public B {};\n class D22: virtual public B {};\n class D2: public D21, public D22\n {public:\n double f2 ( void ) { return 2; }\n D2() { v.push_back(dynamic_cast\u0026lt;double(B::*)(void)\u0026gt;(\u0026amp;D2::f2)); } // How to cast here?\n };\n\n int main ()\n {\n // Vector holding the classes together\n std::vector\u0026lt;B*\u0026gt; o;\n\n // Set up the system\n D1 d1;\n D2 d2;\n o.push_back(\u0026amp;d1);\n o.push_back(\u0026amp;d2);\n\n // Derived functions are called\n for_each(o.begin(),o.end(),[] (B *o) {o-\u0026gt;p();});\n\n return 0;\n }\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"40397643","answer_count":"1","comment_count":"4","creation_date":"2016-11-03 08:31:16.51 UTC","favorite_count":"1","last_activity_date":"2016-11-03 09:15:04.867 UTC","last_edit_date":"2016-11-03 08:52:22.67 UTC","last_editor_display_name":"","last_editor_user_id":"2463056","owner_display_name":"","owner_user_id":"2463056","post_type_id":"1","score":"0","tags":"c++|casting|member-function-pointers","view_count":"122"} +{"id":"40489796","title":"Calling Script Remotely Does Not Work","body":"\u003cp\u003eI can run this script perfectly on my SharePoint server, and the user's profile picture gets updated: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[Reflection.Assembly]::LoadWithPartialName(\"Microsoft.SharePoint\")\n[Reflection.Assembly]::LoadWithPartialName(\"Microsoft.Office.Server\")\n\n$siteurl = \"http://SHAREPOINTSITE/\"\ntry {\n $site = New-Object Microsoft.SharePoint.SPSite($siteurl)\n} catch { \n New-Item -ItemType File -Path C:\\Users\\admin\\Desktop -Name ERROR1.txt -Value $_.Exception.Message -Force\n}\ntry {\n $context = [Microsoft.Office.Server.ServerContext]::GetContext($site)\n} catch { \n New-Item -ItemType File -Path C:\\Users\\admin\\Desktop -Name ERROR2.txt -Value $_.Exception.Message -Force\n}\n\n#This gets the User Profile Manager which is what we want to get hold of the users\n$upm = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($context)\n$user = \"DOMAIN\\user.name\"\n\n#Put it in a loop for iterating for all users\nif ($upm.UserExists($user)) {\n try {\n $profile = $upm.GetUserProfile($user)\n $profile[\"PictureURL\"].Value = \"\\\\Sharepoint\\C$\\Users\\admin\\Desktop\\1.jpg\";\n $profile.Commit();\n } catch {\n New-Item -ItemType File -Path C:\\Users\\admin\\Desktop -Name ERROR3.txt -Value $_.Exception.Message -Force\n }\n}\n\nNew-Item -ItemType File -Path C:\\Users\\admin\\Desktop -Name HELLO.txt -Force\n\n$site.Dispose()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut when I run it from a remote PowerShell session, I am getting some weird errors: \u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eERROR1.txt\u003c/strong\u003e\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eException calling \".ctor\" with \"1\" argument(s): \"The Web application at \u003ca href=\"http://SHAREPOINTSITE/\" rel=\"nofollow noreferrer\"\u003ehttp://SHAREPOINTSITE/\u003c/a\u003e could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application.\"\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003e\u003cstrong\u003eERROR2.txt\u003c/strong\u003e\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eMultiple ambiguous overloads found for \"GetContext\" and the argument count: \"1\".\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI have checked all of the possibilities \u003ca href=\"https://blogs.technet.microsoft.com/stefan_gossner/2011/09/18/common-issue-new-spsite-api-call-returns-the-web-application-at-httpserverport-could-not-be-found/\" rel=\"nofollow noreferrer\"\u003ehere\u003c/a\u003e, but still seeing this issue. \u003c/p\u003e\n\n\u003cp\u003eThis is how I call the above script from the remote machine: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$spfarm = \"DOMAIN\\admin.username\"\n$spfarmpw = ConvertTo-SecureString \"password123\" -AsPlainText -Force\n\n$cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $spfarm,$spfarmpw\n$session = New-PSSession SharePoint -Authentication Default -Credential $cred\n\nInvoke-Command -Session $session -FilePath \"\\\\SharePoint\\C$\\Users\\admin\\Desktop\\testremote.ps1\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have tried calling this in a few different ways (e.g. hosting the script on my machine or hosting it on the SharePoint server, as well as using relative paths to call the script), but I always see these errors.\u003c/p\u003e\n\n\u003cp\u003eCan anyone please help me understand why this doesn't work when calling it from a remote PC? The script is clearly being called (\u003ccode\u003eHELLO.txt\u003c/code\u003e always gets created), but the SharePoint profile picture never gets updated - even though that script definitely should work.\u003c/p\u003e\n\n\u003cp\u003eAny help or guidance is much appreciated\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003e\u003cstrong\u003enslookup\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enslookup SHAREPOINTSITE\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eOutput\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eServer: dc1.domain.co.uk\nAddress: xx.xx.x.xx\n\nName: sharepoint.domain.co.uk\nAddress: yy.yy.y.yy\nAliases: SHAREPOINTSITE.domain.co.uk \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhere \u003ccode\u003eyy.yy.y.yy\u003c/code\u003e is the correct IP (it's the same address I see when executing \u003ccode\u003eping SHAREPOINTSITE\u003c/code\u003e)\u003c/p\u003e","answer_count":"1","comment_count":"8","creation_date":"2016-11-08 14:45:04.163 UTC","last_activity_date":"2017-02-01 20:08:55.453 UTC","last_edit_date":"2016-11-08 15:29:27.657 UTC","last_editor_display_name":"","last_editor_user_id":"4671754","owner_display_name":"","owner_user_id":"4671754","post_type_id":"1","score":"0","tags":"powershell|sharepoint|sharepoint-2013","view_count":"107"} +{"id":"19432870","title":"Running C# sample code in command line","body":"\u003cp\u003eNewb question here: I'm trying to run this sample c# code from \u003ca href=\"https://developer.leapmotion.com/documentation/Languages/CSharpandUnity/Guides/Sample_CSharp_Tutorial.html\" rel=\"nofollow\"\u003ehttps://developer.leapmotion.com/documentation/Languages/CSharpandUnity/Guides/Sample_CSharp_Tutorial.html\u003c/a\u003e for the Leap Motion. \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eRunning the sample\u003c/p\u003e\n \n \u003cp\u003eTo run the sample application:\u003c/p\u003e\n \n \u003cp\u003eCompile the sample application: On Windows, make sure that Sample.cs\n and either LeapCSharp.NET3.5.dll or LeapCSharp.NET4.0.dll are in the\n current directory. Run the following command in a command-line prompt\n (using the proper library reference for the .NET framework you are\n using): csc /reference:LeapCSharp.NET4.0.dll /platform:x86 /target:exe\n Sample.cs Note: use the \u003ccode\u003ecsc\u003c/code\u003e compiler from the appropriate version\n of the .NET framework.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eHow do I figure out what .NET framework I have?\u003c/p\u003e\n\n\u003cp\u003eHow do I make sure that Sample.cs and either LeapCSharp.NET3.5.dll or LeapCSharp.NET4.0.dll are in the current directory? This simply mean to put this folders in my CD right? Then execute: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecsc /reference:LeapCSharp.NET4.0.dll /platform:x86 /target:exe\nSample.cs\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCan someone translate what each segment in that line actually means? \u003c/p\u003e","accepted_answer_id":"19432977","answer_count":"1","comment_count":"1","creation_date":"2013-10-17 16:59:27.473 UTC","last_activity_date":"2013-11-06 23:04:43.727 UTC","last_edit_date":"2013-11-06 23:04:43.727 UTC","last_editor_display_name":"","last_editor_user_id":"472495","owner_display_name":"","owner_user_id":"1836539","post_type_id":"1","score":"0","tags":"c#|windows|dll|command-line|leap-motion","view_count":"420"} +{"id":"41010607","title":"Android add text in background border image","body":"\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/WSXjp.png\" alt=\"how to put text in border\"\u003e\u003c/p\u003e\n\n\u003cp\u003eHow can i add text over the border in android\u003c/p\u003e\n\n\u003cp\u003eSome think like this\n\u003ca href=\"https://stackoverflow.com/questions/7731310/text-in-border-css-html\"\u003eText in Border CSS HTML\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"41011117","answer_count":"2","comment_count":"7","creation_date":"2016-12-07 06:13:38.16 UTC","last_activity_date":"2016-12-07 06:50:00.95 UTC","last_edit_date":"2017-05-23 10:30:33.593 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"7229040","post_type_id":"1","score":"0","tags":"android","view_count":"98"} +{"id":"45216448","title":"Cookies not setting from CORS request","body":"\u003cp\u003eI am sending a login POST request from Angular's $http service and it is successfully creating a session in my database. But, the cookies are not setting in my browser and it seems to be a CORS issue. Here is my code in Node.js/Express and AngularJS:\u003c/p\u003e\n\n\u003ch2\u003eBACKEND\u003c/h2\u003e\n\n\u003ch3\u003eAPP.JS\u003c/h3\u003e\n\n\u003cpre\u003e\u003ccode\u003evar cors = require('cors');\napp.use(cors());\napp.use(session({\n secret: 'A_SECRET',\n resave: false,\n saveUninitialized: false,\n store: sessionStore,\n cookie: {\n secure: false,\n path: '/',\n domain: 'http://localhost:8000',\n maxAge: 1000 * 60 * 24\n }\n}))\napiRoutes.post('/login',(req,res,next) =\u0026gt; {\n res.header('Access-Control-Allow-Credentials', true);\n res.header('Access-Control-Allow-Origin', req.headers.origin);\n res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE');\n res.header('Access-Control-Allow-Headers', 'X-Requested-With, X-HTTP-Method-Override, Content-Type, Accept, x-access-token, host, connection, content-length, origin, user-agent, referer, accept-encoding, accept-language');\n /* ACTUAL LOGIN CODE FUNCTIONAL AND OMITTED */\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003ch2\u003eANGULAR\u003c/h2\u003e\n\n\u003cp\u003eI have set \u003ccode\u003e$httpProvider.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';\u003c/code\u003e as per other SO questions about CORS\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-07-20 13:38:54.763 UTC","last_activity_date":"2017-07-20 13:38:54.763 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6548265","post_type_id":"1","score":"0","tags":"angularjs|http|express|cookies|cors","view_count":"119"} +{"id":"7338733","title":"C# SqlCommand bytes transferred size","body":"\u003cp\u003eI am writing a Sql client in C#, and would like to be able to track the data usage of Sql commands at a single point. From what I can tell, there is no simple way to do this. \u003c/p\u003e\n\n\u003cp\u003eMy function to get the data back from the SqlCommand looks something like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate static void ExecuteReaderCallback(IAsyncResult async)\n{\n DBReqWrapper RequestObject = (DBReqWrapper)async.AsyncState;\n SqlDataReader ResponseReader = command.EndExecuteReader(async);\n if (ResponseReader.HasRows)\n {\n while (ResponseReader.Read())\n {\n object[] NewResponse = new object[ResponseReader.FieldCount];\n ResponseReader.GetValues(NewResponse);\n\n // Processing omitted\n }\n }\n\n ResponseReader.Close();\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat I don't think will work:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eSerializing the data to find out the size. Too slow, especially for large requests.\u003c/li\u003e\n\u003cli\u003esizeof. We are dealing with objects of unknown type.\u003c/li\u003e\n\u003cli\u003eMarshal.sizeof. We are dealing with managed objects.\u003c/li\u003e\n\u003cli\u003eChecking the application total memory. This is a multi-threaded application that will have many concurrent requests being processed and memory totals will be unreliable.\u003c/li\u003e\n\u003cli\u003eSqlDataReader::GetBytes(). This command is only valid for a subset of types.\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eAny help is appreciated, thanks!\u003c/p\u003e","accepted_answer_id":"7339121","answer_count":"1","comment_count":"1","creation_date":"2011-09-07 18:28:56.283 UTC","last_activity_date":"2011-09-07 18:59:51.68 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"216269","post_type_id":"1","score":"2","tags":"c#|sql","view_count":"217"} +{"id":"46572480","title":"Data migration Mongo + Mongoose / sequelize + postgres","body":"\u003cp\u003eI'm trying to migrate data from MongoDB to Postgres. Already have models and other stuff. Using ORM Sequelize. \u003c/p\u003e\n\n\u003cp\u003eI'm new with this and want know how to make data migration when i have \u003ccode\u003e.json/.bson\u003c/code\u003e formats (dump from mongo)\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-10-04 19:12:09.133 UTC","last_activity_date":"2017-10-04 19:12:09.133 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7134112","post_type_id":"1","score":"0","tags":"javascript|mongodb|postgresql|sequelize.js","view_count":"15"} +{"id":"43806980","title":"jQuery disable textbox input for type number","body":"\u003cp\u003eI have a HTML markup which looks like following:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;input type=\"number\" step=\"0.1\" min=\"0\" max=\"100\" value=\"1\" class=\"form-control breakEvenInput\" style=\"width:150px\" /\u0026gt;\u0026lt;br /\u0026gt;\n \u0026lt;button type=\"submit\" class=\"btn btn-primary saveBreakEven\"\u0026gt;Save\u0026lt;/button\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAs you can see the input is of type \"number\"... What I was thinking (if it's possible) to do here is to disable the end user so that he/she is not able to input anything into the textbox, but rather enable the user just to have that side scrool up/down arrows that he gets when browser renders the HTML input as type of \"number\".\u003c/p\u003e\n\n\u003cp\u003eI've tried to add \"disabled\" or \"readonly\" properties to HTML input but that didn't give me the desired result. When I do it like that then the entire textbox is disabled...\u003c/p\u003e\n\n\u003cp\u003eI was thinking that this might be done somehow via jQuery? Can someone help me out ?\u003c/p\u003e\n\n\u003cp\u003eP.S. So i'd like to disable the input into the textbox via keyboard, but still leave the up/down arrows in textbox for the user to change the value, so that the user can't enter anything they want , let's say 99999999999 number.. ?\u003c/p\u003e","answer_count":"3","comment_count":"2","creation_date":"2017-05-05 14:01:00.43 UTC","last_activity_date":"2017-05-05 16:00:27.187 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6400908","post_type_id":"1","score":"0","tags":"javascript|c#|jquery|html|asp.net","view_count":"86"} +{"id":"9387196","title":"C# simple custom encrypting","body":"\u003cp\u003eI'm making a simple custom encrypting in C#.NET, the encryption passes succesfully, but the decrypting goes wrong. The algorithm is very intuitive, but I don't know why it's decrypted wrong.\nHere is my code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e private void button1_Click(object sender, RoutedEventArgs e)\n {\n //Encrypting \n byte[] initial_text_bytes = Encoding.UTF8.GetBytes(initial_text_tb.Text);\n byte[] secret_word_bytes = Encoding.UTF8.GetBytes(secret_word_tb.Text);\n byte[] encrypted_bytes = new byte[initial_text_bytes.Length];\n\n\n\n\n int secret_word_index = 0;\n for (int i=0; i \u0026lt; initial_text_bytes.Length; i++)\n {\n if (secret_word_index == secret_word_bytes.Length)\n {\n secret_word_index = 0;\n }\n encrypted_bytes[i] = (byte)(initial_text_bytes[i] + initial_text_bytes[secret_word_index]);\n secret_word_index++;\n }\n\n\n\n // String s = Encoding.UTF8.GetString(encrypted_bytes);\n //new String(Encoding.UTF8.GetChars(encrypted_bytes));\n\n text_criptat_tb.Text = Convert.ToBase64String(encrypted_bytes);\n\n\n }\n\n private void button2_Click(object sender, RoutedEventArgs e)\n {\n //Decrypting\n byte[] initial_text_bytes = Encoding.UTF8.GetBytes(text_criptat_tb.Text);\n byte[] secret_word_bytes = Encoding.UTF8.GetBytes(secret_word_tb.Text);\n byte[] encrypted_bytes = new byte[initial_text_bytes.Length];\n\n int secret_word_index = 0;\n for (int i = 0; i \u0026lt; initial_text_bytes.Length; i++)\n {\n if (secret_word_index == secret_word_bytes.Length)\n {\n secret_word_index = 0;\n }\n encrypted_bytes[i] = (byte)(initial_text_bytes[i] - initial_text_bytes[secret_word_index]);\n secret_word_index++;\n }\n // String s = new String(Encoding.UTF8.GetChars(encrypted_bytes));\n\n initial_text_tb.Text = Convert.ToBase64String(encrypted_bytes);\n\n\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd this is what I get when I encrypt:\n\u003cimg src=\"https://i.stack.imgur.com/VExC1.png\" alt=\"After encrypting\"\u003e\nAnd this is when I decrypt:\n\u003cimg src=\"https://i.stack.imgur.com/jYzXY.png\" alt=\"After decrypting\"\u003e\nThanks\u003c/p\u003e","accepted_answer_id":"9387320","answer_count":"1","comment_count":"3","creation_date":"2012-02-21 23:56:49.533 UTC","favorite_count":"1","last_activity_date":"2012-02-22 00:11:07.943 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"867437","post_type_id":"1","score":"1","tags":"c#|encryption","view_count":"2355"} +{"id":"18395722","title":"why does sometimes a browser's URL end with '#'","body":"\u003cp\u003eafter several requests, sometimes a URL on the browser becomes:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://abc.org/#\" rel=\"nofollow\"\u003ehttp://abc.org/#\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003edoes anyone know the reason?\u003c/p\u003e","accepted_answer_id":"18395769","answer_count":"7","comment_count":"0","creation_date":"2013-08-23 05:55:18.353 UTC","last_activity_date":"2013-08-23 06:00:53.08 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"934373","post_type_id":"1","score":"0","tags":"web-applications","view_count":"157"} +{"id":"26205200","title":"Adding a animal/dog/cat to a animal list results in NullReferenceException?","body":"\u003cp\u003eI have two subclasses of animal (dog which has a last walk date as extra value and cat which has a bad habbit as a extra value) in the code below i create either a cat or a dog\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enamespace AnimalShelter\n{\npublic partial class AdministrationForm : Form\n{\n\n private Animal animal;\n private Administration admin;\n\n\n\n /// \u0026lt;summary\u0026gt;\n /// Creates the form for doing adminstrative tasks\n /// \u0026lt;/summary\u0026gt;\n public AdministrationForm()\n {\n InitializeComponent();\n animalTypeComboBox.SelectedIndex = 0;\n animal = null;\n }\n\n /// \u0026lt;summary\u0026gt;\n /// Create an Animal object and store it in the administration.\n /// If \"Dog\" is selected in the animalTypeCombobox then a Dog object should be created.\n /// If \"Cat\" is selected in the animalTypeCombobox then a Cat object should be created.\n /// \u0026lt;/summary\u0026gt;\n /// \u0026lt;param name=\"sender\"\u0026gt;\u0026lt;/param\u0026gt;\n /// \u0026lt;param name=\"e\"\u0026gt;\u0026lt;/param\u0026gt;\n\n private void createAnimalButton_Click(object sender, EventArgs e)\n { \n\n\n if(animalTypeComboBox.SelectedItem == \"Dog\")\n {\n SimpleDate dateBirth = new SimpleDate(ttbdateBirth.Value.Day,\n ttbdateBirth.Value.Month,\n ttbdateBirth.Value.Year);\n SimpleDate dateLast1 = new SimpleDate(dateLast.Value.Day,\n dateLast.Value.Month,\n dateLast.Value.Year);\n Animal animal = new Dog(\n Convert.ToString(tbId.Text),\n dateBirth,\n tbName.Text,\n dateLast1\n );\n admin.Add(animal);\n\n }\n\n if (animalTypeComboBox.SelectedItem == \"Cat\")\n {\n SimpleDate dateBirth = new SimpleDate(ttbdateBirth.Value.Day,\n ttbdateBirth.Value.Month,\n ttbdateBirth.Value.Year);\n Animal animal = new Cat(\n Convert.ToString(tbId.Text),\n dateBirth,\n tbName.Text,\n tbBad.Text);\n admin.Add(animal);\n\n }\n\n\n\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eafter this is created i send this to an administration class which is suposed to add this dog or cat to an animal list however as mentioned in the title i get the NullReference error.\nthe class that is supposed to add the cat or dog is as follows\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enamespace AnimalShelter\n{\nclass Administration\n{\n\n private List\u0026lt;Animal\u0026gt; animals;\n\n public List\u0026lt;Animal\u0026gt; Animals { get { return new List\u0026lt;Animal\u0026gt;(animals); } }\n public Administration ()\n {\n animals = new List\u0026lt;Animal\u0026gt;();\n }\n\n public bool Add(Animal animal)\n { \n foreach (Animal dog in animals)\n {\n if(animal.ChipRegistrationNumber == dog.ChipRegistrationNumber)\n {\n System.Windows.Forms.MessageBox.Show(\"dog already added\");\n break;\n\n }\n\n\n\n}\n foreach (Animal cat in animals)\n {\n if(animal.ChipRegistrationNumber == cat.ChipRegistrationNumber)\n {\n System.Windows.Forms.MessageBox.Show(\"dog already added\");\n break;\n }\n }\n\n return true;\n\n\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow my question is what am i doing wrong and how could i fix this so that i am able to add a cat or dog to the list.\u003c/p\u003e","accepted_answer_id":"26205253","answer_count":"1","comment_count":"2","creation_date":"2014-10-05 17:21:08.363 UTC","favorite_count":"1","last_activity_date":"2014-10-05 17:28:14.283 UTC","last_edit_date":"2014-10-05 17:24:29.06 UTC","last_editor_display_name":"","last_editor_user_id":"608639","owner_display_name":"","owner_user_id":"2263341","post_type_id":"1","score":"1","tags":"c#|nullreferenceexception","view_count":"96"} +{"id":"42751654","title":"Delete File based on DateCreated or filename which consist of date","body":"\u003cp\u003eI have to delete data based on its filename. This is what the files look like:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eNostro_BO_FCC_130317.csv [130317 is a created date]\u003cbr\u003e\n Nostro_BO_FCC_120317.csv\u003cbr\u003e\n Nostro_BO_FCC_110317.csv\u003cbr\u003e\n Nostro_BO_FCC_100317.csv\u003cbr\u003e\n Nostro_BO_FCC_090317.csv \u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eand this is where the data located: \u003ccode\u003eD:\\BDI\\CTS\\Data\\Nostro\\BO FCC\\\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eI have developed VBScript to delete the file but it does not work at all. All I want is to delete the file which below 2 days since current date (13/03/2017).\u003c/p\u003e\n\n\u003cp\u003eThis is my VBScript:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eDim infolder\nDim ad, intcount, i, str, Postdate, Uploaddate, fileExists, ExpireDate\nDim sql_query, rs, rsU\nDim ObjFSO, objFile, OFile, OfPath, osf, MM, DD \n\nSet ad = CreateObject(\"ADODB.Connection\")\nad.Provider = \"sqloledb\"\n\nIf Len(Month(varDate)) = 1 then\n MM = \"0\" \u0026amp; Month(varDate)\nElse\n MM = Month(varDate)\nEnd If\n\nIf Len(Day(varDate)) = 1 then\n DD = \"0\" \u0026amp; Day(varDate)\nElse\n DD = Day(varDate)\nEnd If\n\nPostDate = Year(varDate) \u0026amp; MM \u0026amp; DD\nUploaddate = DD \u0026amp; MM \u0026amp; Right(Year(varDate), 2)\nExpireDate = CDate(DD) \u0026lt; Date - 1 \u0026amp; MM \u0026amp; Right(Year(varDate), 2)\n\nad.CursorLocation = 3\nad.Open propstr\n\nSet osf = CreateObject(\"Scripting.FileSystemObject\")\nOfPath = \"D:\\BDI\\CTS\\Data\\Nostro\\BO FCC\\\"\n\n'this below my logic steven\nSet infolder = osf.GetFolder(OfPath)\nSet OFile = Nothing\n\nfileExists = True\nfullfilename = \"Nostro_BO_FCC_\"\u0026amp; Uploaddate \u0026amp;\".csv\"\n\n'create file if not exits and delete if exits then create again\nIf Not osf.FileExists(OFPath \u0026amp; fullfilename) Then\n Set OFile = osf.CreateTextFile(OFPath \u0026amp; fullfilename, True)\n Set OFile = Nothing\nEnd If\n\nFor Each file In infolder.Files\n If DateDiff(\"d\", file.DateCreated, Date) \u0026lt; Date -2 Then\n ' oFSO.DeleteFile(oFile) \n 'If osf.FileExists(OfPath \u0026amp; \"Nostro_BO_FCC_\" \u0026amp; ExpireDate \u0026amp; \".csv\") Then\n 'osf.DeleteFile OfPath \u0026amp; \"Nostro_BO_FCC_\" \u0026amp; ExpireDate \u0026amp; \".csv\"\n file.Delete(True)\n End If\nNext\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-03-12 18:51:39.07 UTC","favorite_count":"1","last_activity_date":"2017-03-13 11:57:12.633 UTC","last_edit_date":"2017-03-12 19:34:39.037 UTC","last_editor_display_name":"","last_editor_user_id":"1630171","owner_display_name":"","owner_user_id":"7172393","post_type_id":"1","score":"0","tags":"vbscript|scripting","view_count":"30"} +{"id":"28744790","title":"How to add/change django template folder on per-request basis?","body":"\u003cp\u003eWe've just started the complete redesign of our project's HTML pages (responsive layout and stuff) and all we need to change is \u003cem\u003etemplates\u003c/em\u003e and static (css and some js). \u003cstrong\u003eViews ain't gonna change at all.\u003c/strong\u003e\nI want to create all the new templates in another folder next to existing old one, e.g. \"new templates\", so when the work is complete we can just change our TEMPLATE_DIRS setting and that's it.\u003c/p\u003e\n\n\u003cp\u003eBut obviously we want to let our users (for the first couple of weeks after deploying it) choose if they want to try the new version or stay with the old one. Ok, that's simple - I ask a user and put his answer into his session:\n\u003ccode\u003erequest.session['new_design'] = True\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eAnd now in some custom middleware it would be nice to write something like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eif request.session.get('new_design', False):\n settings['TEMPLATE_DIRS'] = (MY_NEW_TEMPLATE_DIR, ) + settings['TEMPLATE_DIRS']\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo when it comes to template loading in whatever view, my brand new templates folder will be searched first.\n\u003cstrong\u003eBut I know I just can't modify settings on the fly\u003c/strong\u003e!\u003c/p\u003e\n\n\u003cp\u003e\u003cem\u003eIs there any other way to archive same results?\u003c/em\u003e\nI thought about subclassing filesystem.Loader... But how can I make it aware of current request/session contents?\nAny other suggestions?\u003c/p\u003e\n\n\u003cp\u003eUPD: I forgot to mention: subdomains are already used for city selection e.g. la.domain.tld would represent only objects available for LA users. So adding a fourth subdomain isn't that great.\u003c/p\u003e\n\n\u003cp\u003eps And once again just to make it clear: the main goal is \u003cstrong\u003enot\u003c/strong\u003e to touch any view!\u003c/p\u003e","accepted_answer_id":"28746634","answer_count":"1","comment_count":"2","creation_date":"2015-02-26 14:18:32.193 UTC","last_activity_date":"2015-02-26 19:19:15.58 UTC","last_edit_date":"2015-02-26 19:19:15.58 UTC","last_editor_display_name":"","last_editor_user_id":"4610416","owner_display_name":"","owner_user_id":"4610416","post_type_id":"1","score":"2","tags":"django|django-templates|django-middleware","view_count":"368"} +{"id":"22586891","title":"How to un-indent code using the Ace editor on koding.com?","body":"\u003cp\u003eindent code using the Ace editor on koding.com? \u003c/p\u003e\n\n\u003cp\u003eWith Sublime you can do \u003ckbd\u003eCommand\u003c/kbd\u003e-\u003ckbd\u003e]\u003c/kbd\u003e , but I can't find an equivalent on koding.com. Please don't reply with code because I'm not asking how to configure an Ace editor. I am asking how to use the Ace editor that appears on koding.com. \u003c/p\u003e","accepted_answer_id":"22586907","answer_count":"1","comment_count":"0","creation_date":"2014-03-23 03:55:34.54 UTC","last_activity_date":"2016-04-08 01:29:58.69 UTC","last_edit_date":"2016-04-08 01:29:58.69 UTC","last_editor_display_name":"","last_editor_user_id":"3646475","owner_display_name":"","owner_user_id":"1194050","post_type_id":"1","score":"0","tags":"ace-editor","view_count":"281"} +{"id":"21615376","title":"Main user for app - best implementation","body":"\u003cp\u003eI'm creating an app, it is looks like Twitter app, UITabBarController + UINavigationController.\u003c/p\u003e\n\n\u003cp\u003eIn my app i need to have one main user (e.g. \u003cstrong\u003eYOU\u003c/strong\u003e) and other users, \u003cstrong\u003eYOU\u003c/strong\u003e and users sharing same structure i.e. class.\u003c/p\u003e\n\n\u003cp\u003eWith bunch of ordinary users i don't see a problem - you creating user object, using it, ARC doing its job. \u003c/p\u003e\n\n\u003cp\u003eMy question is: what is best way to save \u003cstrong\u003eYOUrs\u003c/strong\u003e data, access or pass it between tabs(and tabs can be selected in no particular order).\u003c/p\u003e\n\n\u003cp\u003eI already read many q\u0026amp;a about this topic, and I can use:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eglobal var;\u003c/li\u003e\n\u003cli\u003eclass method (+);\u003c/li\u003e\n\u003cli\u003esingleton;\u003c/li\u003e\n\u003cli\u003eNSUserDefaults;\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003ebut, i don't think i really know right and \u003cstrong\u003eBEST\u003c/strong\u003e answer.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdit:\u003c/strong\u003e\nSorry if i wrote unclear, i'll try to explain better. \nWhen you start app, you need to login, after login you can talk to other users, make tasks for them etc.\nThere is really \u003cstrong\u003eone user\u003c/strong\u003e i want to store data for, because when i switch between tabs i need to know my id and other things. But other users i talk to is actually the same in terms of class design. They all need to have name, avatar, email, etc.\u003c/p\u003e","accepted_answer_id":"21625469","answer_count":"1","comment_count":"3","creation_date":"2014-02-06 22:24:22.04 UTC","last_activity_date":"2014-02-08 11:45:04.083 UTC","last_edit_date":"2014-02-07 07:37:34.78 UTC","last_editor_display_name":"","last_editor_user_id":"274390","owner_display_name":"","owner_user_id":"274390","post_type_id":"1","score":"-4","tags":"ios|objective-c|singleton|uitabbarcontroller","view_count":"56"} +{"id":"20840357","title":"Execute jar file using hadoop","body":"\u003cp\u003eI want to execute a jar file which works fine upon executing from command line:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ejava -Xmx3g -jar jarname.jar -T class_name_in_jar -R filename1 -I filename2 -known filename3 -o filename4\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAbove command executes *class_name_in_jar* by taking input filename1, filename2 and filename3. it will generate output in filename4.\u003c/p\u003e\n\n\u003cp\u003eHere is my map reduce program:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport java.io.IOException;\n import java.util.*;\n import org.apache.hadoop.fs.Path;\n import org.apache.hadoop.conf.*;\n import org.apache.hadoop.io.*;\n import org.apache.hadoop.mapred.*;\n import org.apache.hadoop.util.*;\n\n public class GatkWordCount {\n\n public static class Reduce extends MapReduceBase implements Reducer\u0026lt;Text, IntWritable, Text, IntWritable\u0026gt; {\n public void reduce(Text key, Iterator\u0026lt;IntWritable\u0026gt; values, OutputCollector\u0026lt;Text, IntWritable\u0026gt; output, Reporter reporter) throws IOException {\n String find_targets_cmd = \"java -Xmx3g -jar \u0026lt;jarname\u0026gt;.jar -T \u0026lt;class name in jar\u0026gt; -R \u0026lt;filename1\u0026gt; -I \u0026lt;filename2\u0026gt; -known \u0026lt;filename3\u0026gt; -o \u0026lt;filename4\u0026gt;\";\n\n exceptionOnError(execAndReconnect(find_targets_cmd));\n }\n }\n\n public static int execAndReconnect(String cmd) throws IOException {\n Process p = Runtime.getRuntime().exec(cmd);\n p.waitFor();\n return p.exitValue();\n }\n\n public static void exceptionOnError(int errorCode) throws IOException{\n if(0 != errorCode)\n throw new IOException(String.valueOf(errorCode));\n }\n\n public static void main(String[] args) throws Exception {\n JobConf conf = new JobConf(GatkWordCount.class);\n conf.setJobName(\"GatkWordCount\");\n\n conf.setOutputKeyClass(Text.class);\n conf.setOutputValueClass(IntWritable.class);\n\n conf.setReducerClass(Reduce.class);\n\n conf.setInputFormat(TextInputFormat.class);\n conf.setOutputFormat(TextOutputFormat.class);\n\n FileInputFormat.setInputPaths(conf, new Path(args[0]));\n FileOutputFormat.setOutputPath(conf, new Path(args[1]));\n\n JobClient.runJob(conf);\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003chr\u003e\n\n\u003cp\u003eIn \u003ccode\u003eHDFS\u003c/code\u003e, I have put all the required input files.\nI have executed below command:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e enter code herehadoop/bin/hadoop jar gatkword.jar GatkWordCount /user/hduser/gatkinput/gatkinput/group.bam /user/hduser/gatkword2\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBelow is the error message am getting after executing above command:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e13/12/29 17:58:59 WARN mapred.JobClient: Use GenericOptionsParser for parsing the arguments. Applications should implement Tool for the same.\n13/12/29 17:58:59 INFO util.NativeCodeLoader: Loaded the native-hadoop library\n13/12/29 17:58:59 WARN snappy.LoadSnappy: Snappy native library not loaded\n13/12/29 17:58:59 INFO mapred.FileInputFormat: Total input paths to process : 1\n13/12/29 17:58:59 INFO mapred.JobClient: Running job: job_201312261425_0013\n13/12/29 17:59:00 INFO mapred.JobClient: map 0% reduce 0%\n13/12/29 17:59:06 INFO mapred.JobClient: Task Id : attempt_201312261425_0013_m_000000_0, Status : FAILED\njava.io.IOException: Type mismatch in key from map: expected org.apache.hadoop.io.Text, recieved org.apache.hadoop.io.LongWritable\n at org.apache.hadoop.mapred.MapTask$MapOutputBuffer.collect(MapTask.java:1014)\n at org.apache.hadoop.mapred.MapTask$OldOutputCollector.collect(MapTask.java:592)\n at org.apache.hadoop.mapred.lib.IdentityMapper.map(IdentityMapper.java:38)\n at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:50)\n at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:436)\n at org.apache.hadoop.mapred.MapTask.run(MapTask.java:372)\n at org.apache.hadoop.mapred.Child$4.run(Child.java:255)\n at java.security.AccessController.doPrivileged(Native Method)\n at javax.security.auth.Subject.doAs(Subject.java:415)\n at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1136)\n at org.apache.hadoop.mapred.Child.main(Child.java:249)\n\n13/12/29 17:59:06 INFO mapred.JobClient: Task Id : attempt_201312261425_0013_m_000001_0, Status : FAILED\njava.io.IOException: Type mismatch in key from map: expected org.apache.hadoop.io.Text, recieved org.apache.hadoop.io.LongWritable\n at org.apache.hadoop.mapred.MapTask$MapOutputBuffer.collect(MapTask.java:1014)\n at org.apache.hadoop.mapred.MapTask$OldOutputCollector.collect(MapTask.java:592)\n at org.apache.hadoop.mapred.lib.IdentityMapper.map(IdentityMapper.java:38)\n at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:50)\n at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:436)\n at org.apache.hadoop.mapred.MapTask.run(MapTask.java:372)\n at org.apache.hadoop.mapred.Child$4.run(Child.java:255)\n at java.security.AccessController.doPrivileged(Native Method)\n at javax.security.auth.Subject.doAs(Subject.java:415)\n at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1136)\n at org.apache.hadoop.mapred.Child.main(Child.java:249)\n\n13/12/29 17:59:11 INFO mapred.JobClient: Task Id : attempt_201312261425_0013_m_000000_1, Status : FAILED\njava.io.IOException: Type mismatch in key from map: expected org.apache.hadoop.io.Text, recieved org.apache.hadoop.io.LongWritable\n at org.apache.hadoop.mapred.MapTask$MapOutputBuffer.collect(MapTask.java:1014)\n at org.apache.hadoop.mapred.MapTask$OldOutputCollector.collect(MapTask.java:592)\n at org.apache.hadoop.mapred.lib.IdentityMapper.map(IdentityMapper.java:38)\n at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:50)\n at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:436)\n at org.apache.hadoop.mapred.MapTask.run(MapTask.java:372)\n at org.apache.hadoop.mapred.Child$4.run(Child.java:255)\n at java.security.AccessController.doPrivileged(Native Method)\n at javax.security.auth.Subject.doAs(Subject.java:415)\n at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1136)\n at org.apache.hadoop.mapred.Child.main(Child.java:249)\n\n13/12/29 17:59:11 INFO mapred.JobClient: Task Id : attempt_201312261425_0013_m_000001_1, Status : FAILED\njava.io.IOException: Type mismatch in key from map: expected org.apache.hadoop.io.Text, recieved org.apache.hadoop.io.LongWritable\n at org.apache.hadoop.mapred.MapTask$MapOutputBuffer.collect(MapTask.java:1014)\n at org.apache.hadoop.mapred.MapTask$OldOutputCollector.collect(MapTask.java:592)\n at org.apache.hadoop.mapred.lib.IdentityMapper.map(IdentityMapper.java:38)\n at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:50)\n at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:436)\n at org.apache.hadoop.mapred.MapTask.run(MapTask.java:372)\n at org.apache.hadoop.mapred.Child$4.run(Child.java:255)\n at java.security.AccessController.doPrivileged(Native Method)\n at javax.security.auth.Subject.doAs(Subject.java:415)\n at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1136)\n at org.apache.hadoop.mapred.Child.main(Child.java:249)\n\n13/12/29 17:59:17 INFO mapred.JobClient: Task Id : attempt_201312261425_0013_m_000000_2, Status : FAILED\njava.io.IOException: Type mismatch in key from map: expected org.apache.hadoop.io.Text, recieved org.apache.hadoop.io.LongWritable\n at org.apache.hadoop.mapred.MapTask$MapOutputBuffer.collect(MapTask.java:1014)\n at org.apache.hadoop.mapred.MapTask$OldOutputCollector.collect(MapTask.java:592)\n at org.apache.hadoop.mapred.lib.IdentityMapper.map(IdentityMapper.java:38)\n at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:50)\n at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:436)\n at org.apache.hadoop.mapred.MapTask.run(MapTask.java:372)\n at org.apache.hadoop.mapred.Child$4.run(Child.java:255)\n at java.security.AccessController.doPrivileged(Native Method)\n at javax.security.auth.Subject.doAs(Subject.java:415)\n at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1136)\n at org.apache.hadoop.mapred.Child.main(Child.java:249)\n\n13/12/29 17:59:17 INFO mapred.JobClient: Task Id : attempt_201312261425_0013_m_000001_2, Status : FAILED\njava.io.IOException: Type mismatch in key from map: expected org.apache.hadoop.io.Text, recieved org.apache.hadoop.io.LongWritable\n at org.apache.hadoop.mapred.MapTask$MapOutputBuffer.collect(MapTask.java:1014)\n at org.apache.hadoop.mapred.MapTask$OldOutputCollector.collect(MapTask.java:592)\n at org.apache.hadoop.mapred.lib.IdentityMapper.map(IdentityMapper.java:38)\n at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:50)\n at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:436)\n at org.apache.hadoop.mapred.MapTask.run(MapTask.java:372)\n at org.apache.hadoop.mapred.Child$4.run(Child.java:255)\n at java.security.AccessController.doPrivileged(Native Method)\n at javax.security.auth.Subject.doAs(Subject.java:415)\n at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1136)\n at org.apache.hadoop.mapred.Child.main(Child.java:249)\n\n13/12/29 17:59:22 INFO mapred.JobClient: Job complete: job_201312261425_0013\n13/12/29 17:59:22 INFO mapred.JobClient: Counters: 7\n13/12/29 17:59:22 INFO mapred.JobClient: Job Counters \n13/12/29 17:59:22 INFO mapred.JobClient: SLOTS_MILLIS_MAPS=42572\n13/12/29 17:59:22 INFO mapred.JobClient: Total time spent by all reduces waiting after reserving slots (ms)=0\n13/12/29 17:59:22 INFO mapred.JobClient: Total time spent by all maps waiting after reserving slots (ms)=0\n13/12/29 17:59:22 INFO mapred.JobClient: Launched map tasks=8\n13/12/29 17:59:22 INFO mapred.JobClient: Data-local map tasks=8\n13/12/29 17:59:22 INFO mapred.JobClient: SLOTS_MILLIS_REDUCES=0\n13/12/29 17:59:22 INFO mapred.JobClient: Failed map tasks=1\n13/12/29 17:59:22 INFO mapred.JobClient: Job Failed: # of failed Map Tasks exceeded allowed limit. FailedCount: 1. LastFailedTask: task_201312261425_0013_m_000000\nException in thread \"main\" java.io.IOException: Job failed!\n at org.apache.hadoop.mapred.JobClient.runJob(JobClient.java:1327)\n at GatkWordCount.main(GatkWordCount.java:51)\n at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)\n at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n at java.lang.reflect.Method.invoke(Method.java:601)\n at org.apache.hadoop.util.RunJar.main(RunJar.java:156)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ePlease suggest what needs to be change in my code in order to execute it properly. Thanks for your help.\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2013-12-30 13:16:31.563 UTC","last_activity_date":"2014-01-02 11:58:45.317 UTC","last_edit_date":"2014-01-02 10:37:02.367 UTC","last_editor_display_name":"","last_editor_user_id":"3146435","owner_display_name":"","owner_user_id":"3146435","post_type_id":"1","score":"0","tags":"hadoop|mapreduce","view_count":"825"} +{"id":"27166855","title":"Using PyCharm Professional and Vagrant, how do I run a Django server?","body":"\u003cp\u003eI have set up already my configuration so that it will run the server remotely. When I click run, I see the command used:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003essh://vagrant@localhost:2222/usr/bin/python -u \"C:/Users/MyName/ProjectName/config/manage.py\" runserver localhost:8080\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e(I've replaced the directory names for anonymity reasons).\u003c/p\u003e\n\n\u003cp\u003eWhen I do run this, It fails (obviously) because it's using a windows path to my manage.py\nSpecifically the error I get is\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e`/usr/bin/python: can't open file 'C:/Users/MyName/judgeapps/config/manage.py': [Errno 2] No such file or directory\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat I can't figure out after extensive googling, is how to force django to use a path on my vagrant machine. How can I go about doing this?\u003c/p\u003e","accepted_answer_id":"27166947","answer_count":"1","comment_count":"0","creation_date":"2014-11-27 09:14:27.55 UTC","favorite_count":"4","last_activity_date":"2014-11-27 09:58:55.803 UTC","last_edit_date":"2014-11-27 09:39:05.893 UTC","last_editor_display_name":"","last_editor_user_id":"1318181","owner_display_name":"","owner_user_id":"3286955","post_type_id":"1","score":"4","tags":"python|django|vagrant|pycharm","view_count":"3347"} +{"id":"28861732","title":"Best practices for field names in ElasticSearch","body":"\u003cp\u003eI'm looking at simple ways of defining, in Java, some lightweight service and data access layers on top of ElasticSearch. My POJO data objects will naturally have property names in camelCase, but I'm wondering if I should use camelCase for the field names in the ElasticSearch type mappings. In the data repository world, and in particular in traditional RDBMS, field names are definitely not camel cased. If I'm not mistaken, there seems to be a trend in the NoSql world to use underscores in field names, e.g. first_name. Is this a common practice for ElasticSearch ?\nIf so, does this mean I have to configure a Jackson based conversion service that is able to map back and forth between the camelCase and underscored field names ?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-03-04 18:08:39.68 UTC","favorite_count":"2","last_activity_date":"2015-03-05 03:16:56.85 UTC","last_edit_date":"2015-03-05 03:16:56.85 UTC","last_editor_display_name":"","last_editor_user_id":"1797393","owner_display_name":"","owner_user_id":"269418","post_type_id":"1","score":"4","tags":"java|elasticsearch|naming-conventions","view_count":"2283"} +{"id":"4638709","title":"Best approach to dynamically filter .Net objects","body":"\u003cp\u003eThe project I'm working currently on has a way to define a filter on objects from a database.\u003cbr\u003e\nThis filter is a pretty straightforward class containing criteria that will be combined to produce a SQL \u003ccode\u003ewhere\u003c/code\u003e clause. \u003c/p\u003e\n\n\u003cp\u003eThe goal now is to use this class to filter .Net objects as well. So for example the filter might specify that the title property of the object that it is applied to must contain some user-defined string.\u003c/p\u003e\n\n\u003cp\u003eWhat are ways to approach this problem? What should the filter return instead of the sql where-clause and how can it be applied to the object? I've been think about this for hours and don´t yet have even a slight idea how to solve this. Been thinking about reflection, dynamic code execution, building expressions but still haven´t found a starting point.\u003c/p\u003e","accepted_answer_id":"4638736","answer_count":"2","comment_count":"4","creation_date":"2011-01-09 10:35:58.653 UTC","last_activity_date":"2011-01-09 11:08:08.72 UTC","last_edit_date":"2011-01-09 11:08:08.72 UTC","last_editor_display_name":"","last_editor_user_id":"1060","owner_display_name":"","owner_user_id":"568697","post_type_id":"1","score":"2","tags":"c#|design|dynamic|filtering","view_count":"930"} +{"id":"18994357","title":"Android: Custom Surface View crashing upon orientation change","body":"\u003cp\u003eI was reading \u003ca href=\"http://android-er.blogspot.com/2010/05/another-exercise-of-surfaceview-in.html\" rel=\"nofollow\"\u003ethis tutorial\u003c/a\u003e on how to use a custom surface view class in an XML layout and when I ran the code, the app crashed when my phone's orientation changed. I've noticed a lot of examples involving custom threads and surface view subclasses crashing when the orientation changes, does anybody have any idea why this is happening?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e09-25 18:19:40.639: E/Trace(4982): error opening trace file: No such file or directory (2)\n09-25 18:19:40.639: D/ActivityThread(4982): setTargetHeapUtilization:0.25\n09-25 18:19:40.639: D/ActivityThread(4982): setTargetHeapIdealFree:8388608\n09-25 18:19:40.639: D/ActivityThread(4982): setTargetHeapConcurrentStart:2097152\n09-25 18:19:40.959: D/libEGL(4982): loaded /system/lib/egl/libEGL_adreno200.so\n09-25 18:19:40.979: D/libEGL(4982): loaded /system/lib/egl/libGLESv1_CM_adreno200.so\n09-25 18:19:40.979: D/libEGL(4982): loaded /system/lib/egl/libGLESv2_adreno200.so\n09-25 18:19:41.049: I/Adreno200-EGLSUB(4982): \u0026lt;ConfigWindowMatch:2087\u0026gt;: Format RGBA_8888.\n09-25 18:19:41.099: E/(4982): \u0026lt;s3dReadConfigFile:75\u0026gt;: Can't open file for reading\n09-25 18:19:41.099: E/(4982): \u0026lt;s3dReadConfigFile:75\u0026gt;: Can't open file for reading\n09-25 18:19:41.099: D/OpenGLRenderer(4982): Enabling debug mode 0\n09-25 18:19:58.127: W/dalvikvm(4982): threadid=11: thread exiting with uncaught exception (group=0x40d46438)\n09-25 18:19:58.147: E/AndroidRuntime(4982): FATAL EXCEPTION: Thread-156822\n09-25 18:19:58.147: E/AndroidRuntime(4982): java.lang.NullPointerException\n09-25 18:19:58.147: E/AndroidRuntime(4982): at com.example.practicesurface.MySurfaceView.onDraw(MySurfaceView.java:129)\n09-25 18:19:58.147: E/AndroidRuntime(4982): at com.example.practicesurface.MySurfaceView$MySurfaceThread.run(MySurfaceView.java:39)\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"18994627","answer_count":"1","comment_count":"0","creation_date":"2013-09-25 00:37:44.067 UTC","last_activity_date":"2013-09-26 01:22:34.247 UTC","last_edit_date":"2013-09-26 01:22:34.247 UTC","last_editor_display_name":"user2563044","owner_display_name":"user2563044","post_type_id":"1","score":"0","tags":"android|xml|surfaceview","view_count":"449"} +{"id":"300472","title":"What does the gnuwin32 program: [.exe do?","body":"\u003cp\u003eLooking in the gnuwin32/bin directory, there is an odd-looking program file named \u003ccode\u003e[.exe\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eI couldn't find it in the documentation, gnuwin32.sourceforge.net or in a google search, so I ran it and got:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$ [\n[: missing `]'\n$\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eso I gave it ] as a parameter and got\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$ [ ]\n\n$\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt didn't complain, so I assumed it was on the right track. I tried:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$ [ hello ]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eagain, no complaints. so I tried an arithmetic expression:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$ [ 1 + 1 ]\n[: +: binary operator expected\n$\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI tried a bunch of different combinations, including prefix \u0026amp; postfix notation but nothing seemed to work. What does this thing do?\u003c/p\u003e","accepted_answer_id":"300508","answer_count":"3","comment_count":"0","creation_date":"2008-11-18 22:58:56.793 UTC","last_activity_date":"2008-11-19 10:50:50.71 UTC","last_editor_display_name":"","owner_display_name":"Ferruccio","owner_user_id":"4086","post_type_id":"1","score":"3","tags":"gnu|gnuwin32","view_count":"890"} +{"id":"7953192","title":"long running process interlock","body":"\u003cp\u003eI'm creating a webservice+servicebus project where user can do something like \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic void ExecuteLongProcess(DateTime fromDate,string aggregateId){}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis method immediately returns but send over the bus a request for the operation.\u003c/p\u003e\n\n\u003cp\u003eMy problems starts when multiple user ask for the long process over the same aggregateId when another one is already running.\u003c/p\u003e\n\n\u003cp\u003eThe solution i'm thinking about is a Task that runs continuosly and look in a \u003ccode\u003eQueue\u0026lt;LongProcessTask\u0026gt;\u003c/code\u003e for a operation that must be executed so I run only one process a time or a future implementation will be multiple process if different aggregateId.\u003c/p\u003e\n\n\u003cp\u003eThis way I don't overlap long running process over the same aggregate.\u003c/p\u003e\n\n\u003cp\u003eOther ideas?\u003c/p\u003e","answer_count":"2","comment_count":"1","creation_date":"2011-10-31 11:39:10.987 UTC","last_activity_date":"2011-11-03 10:06:38.287 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"78484","post_type_id":"1","score":"0","tags":"c#|servicebus|long-running-processes","view_count":"208"} +{"id":"28100307","title":"How to use Grails Message code tag with Angular JS","body":"\u003cp\u003eI have a custom directive that loads .GSP template i.e.\u003c/p\u003e\n\n\u003cp\u003eIn my directive I have \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etemplate: '/view/pages/dummy.gsp'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn dummy.gsp, \u003c/p\u003e\n\n\u003cp\u003eI have a checkbox like below: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;input type=\"checkbox\" name=\"orangeFruit\"\u0026gt; Orange \u0026lt;/input\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow here instead of using the hardcoded Orange I want to use something like this :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div ng-repeat=\"thisfruit in fruits\"\u0026gt;\n\u0026lt;input type=\"checkbox\" name=\"{{thisfruit}}chkbox\"\u0026gt;\n ${message(code:'label.{{thisfruit}}')}\n\u0026lt;/input\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAbove snippet is of my angular template where I am iterating through list of fruits and putting checkboxes for each one of them.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efruits:[\"orange\",\"apple\",\"banana\"] is the angular JSON object.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhere {{thisfruit}} is Javascript object and has the value orange. \u003c/p\u003e\n\n\u003cp\u003eBelow is how my messages.properties file looks like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elabel.orange=Orange\nlabel.apple=Apple\nlabel.banana=Banana\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I run the above message code it always gives me \"label.orange\" instead of \"orange\". I have this key in my messages.properties file so it should find it. \nwhen I replace \u003ccode\u003elabel.{{thisfruit}}\u003c/code\u003e with the \u003ccode\u003elabel.orange\u003c/code\u003e it gives the correct value. \u003c/p\u003e\n\n\u003cp\u003eAny help is appreciated!\u003c/p\u003e","accepted_answer_id":"28140024","answer_count":"1","comment_count":"2","creation_date":"2015-01-22 23:06:05.73 UTC","last_activity_date":"2015-01-25 19:37:37.063 UTC","last_edit_date":"2015-01-25 19:37:37.063 UTC","last_editor_display_name":"","last_editor_user_id":"2405040","owner_display_name":"","owner_user_id":"901151","post_type_id":"1","score":"0","tags":"angularjs|grails|gsp","view_count":"416"} +{"id":"31048575","title":"Use a filter statement in JSON call on Web API with Entity framework","body":"\u003cp\u003eWe got a Web API webservice with entity framework and accept JSON calls.\u003c/p\u003e\n\n\u003cp\u003eWe have a call named: GetResidents which lists all residents. We would like to have an extra parameter (hash) which allows the caller to filter the results on the server.\u003c/p\u003e\n\n\u003cp\u003eLike this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\"filter\":{\n \"and\":{\n \"age\":{\n \"less_than\":80,\n \"greater_than\":60\n }\n },\n {\n \"active\":{\n \"eq\":true\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn RoR in the past I've used this gem which works great: \u003ca href=\"https://github.com/QutBioacoustics/baw-server/wiki/Rails-API-Spec:-Filtering\" rel=\"nofollow\"\u003ehttps://github.com/QutBioacoustics/baw-server/wiki/Rails-API-Spec:-Filtering\u003c/a\u003e Does something similar exist in WebAPI?\u003c/p\u003e\n\n\u003cp\u003eThanks for any feedback.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-06-25 11:04:57.05 UTC","favorite_count":"1","last_activity_date":"2015-06-25 13:07:19.5 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1610548","post_type_id":"1","score":"1","tags":"entity-framework|asp.net-web-api","view_count":"73"} +{"id":"11879462","title":"MySQL Previous week","body":"\u003cp\u003eI want to retrieve data from last week and 15 weeks back.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eNote:\u003c/strong\u003e Only the same weekday 15 weeks back, not all data inbetween. For example, I want data every Thursday 15 weeks back.\u003c/p\u003e\n\n\u003cp\u003eThis is a simplification of my MySQL table with desired result.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eStation | Type | Date | Value\n5 2 2012-08-02 3\n5 2 2012-07-26 5\n5 2 2012-07-19 1\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe way I do it today is via PHP:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$dates = \"(\";\nfor($j=1; $j\u0026lt;=15; $j++) { // 15 weeks back, same weekday\n$dates .= \"'\" . date(\"Y-m-d\", strtotime(\"-{$j} week\")) . \"', \";\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThen i append this to a MySQL query using \" SELECT * FROM \u003ccode\u003eblabla\u003c/code\u003e WHERE \u003ccode\u003edate\u003c/code\u003e IN $dates\", however this is not a good solution. So how can i pick dates 15 weeks back using pure MYSQL?\u003c/p\u003e","answer_count":"4","comment_count":"0","creation_date":"2012-08-09 08:27:59.95 UTC","last_activity_date":"2012-08-09 09:05:35.53 UTC","last_edit_date":"2012-08-09 08:43:19.583 UTC","last_editor_display_name":"","last_editor_user_id":"1407830","owner_display_name":"","owner_user_id":"1407830","post_type_id":"1","score":"0","tags":"php|mysql","view_count":"150"} +{"id":"26935299","title":"How do I use the TextAnalysis API on Mashape with Swift?","body":"\u003cp\u003eI am new to Swift and would like to convert the following Objective-C code to Swift:\u003c/p\u003e\n\n\u003cp\u003e(Obviously there is no unirest library for swift.)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e// These code snippets use an open-source library. http://unirest.io/objective-c\nNSDictionary *headers = @{@\"X-Mashape-Key\": @\"Ia8030aCGGmshlLqLozAf9XERsUQp12ChEhjsnU5MERfwzB07J\", @\"Content-Type\": @\"application/x-www-form-urlencoded\"};\nNSDictionary *parameters = @{@\"text\": @\"这是中文分词测试\"};\nUNIUrlConnection *asyncConnection = [[UNIRest post:^(UNISimpleRequest *request) {\n [request setUrl:@\"https://textanalysis.p.mashape.com/segmenter\"];\n [request setHeaders:headers];\n [request setParameters:parameters];\n}] asJsonAsync:^(UNIHTTPJsonResponse *response, NSError *error) {\n NSInteger code = response.code;\n NSDictionary *responseHeaders = response.headers;\n UNIJsonNode *body = response.body;\n NSData *rawBody = response.rawBody;\n}];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is what Mashape shows as the expected response headers:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eConnection: keep-alive\nContent-Length: 70\nContent-Type: application/json\nDate: Thu, 13 Nov 2014 11:11:17 GMT\nServer: Mashape/5.0.5\nX-Ratelimit-Requests-Limit: 1000\nX-Ratelimit-Requests-Remaining: 992\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is what Mashape says is the the expected response body:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n \"result\": \"这 是 中文 分词 测试\"\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow can I get these results in the playground, repl, and/or an xcode project?\u003c/p\u003e","accepted_answer_id":"26962859","answer_count":"1","comment_count":"2","creation_date":"2014-11-14 17:09:15.383 UTC","last_activity_date":"2014-11-16 22:35:33.473 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"538034","post_type_id":"1","score":"-1","tags":"objective-c|swift|mashape","view_count":"356"} +{"id":"6973847","title":"Python regex to PHP?","body":"\u003cp\u003eI'm trying to convert a Python script into PHP.\u003c/p\u003e\n\n\u003cp\u003eThe following 2 regular expressions work in Python:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e'/\\*\\*([\\w\\n\\(\\)\\[\\]\\.\\*\\'\\\"\\-#|,@{}_\u0026lt;\u0026gt;=:/ ]+?)\\*/'\n'(?:\\* ([\\w\\d\\(\\),\\.\\'\\\"\\-\\:#|/ ]+)|(?\u0026lt;= @)(\\w+)(?: (.+))?)'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e...however, if I try to run them in PHP I get:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eWarning: preg_match_all() [function.preg-match-all]: Unknown modifier ']'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow come?\u003c/p\u003e","accepted_answer_id":"6973880","answer_count":"2","comment_count":"1","creation_date":"2011-08-07 15:55:20.257 UTC","last_activity_date":"2011-08-07 16:00:26.03 UTC","last_edit_date":"2011-08-07 15:57:48.573 UTC","last_editor_display_name":"","last_editor_user_id":"20670","owner_display_name":"","owner_user_id":"882885","post_type_id":"1","score":"3","tags":"php|python|regex","view_count":"767"} +{"id":"18274549","title":"Rails + Filepicker - how to create a thumbnail?","body":"\u003cp\u003eI am using Filepicker for upload and it's working quite well. Now I would need to extend functionality about creating thumbnails.\u003c/p\u003e\n\n\u003cp\u003eI am not really sure how it's working exactly, but when I upload an image, I get an URL (for example \u003ca href=\"https://www.filepicker.io/api/file/WenvMkJjRpOeE6RIw3Vo%20-%20the%20original%20size%20https://www.filepicker.io/api/file/WenvMkJjRpOeE6RIw3Vo/convert?w=650\" rel=\"nofollow\"\u003ehttps://www.filepicker.io/api/file/WenvMkJjRpOeE6RIw3Vo\u003c/a\u003e).\u003c/p\u003e\n\n\u003cp\u003eWhen I add some parameters to this URL, like \u003ca href=\"https://www.filepicker.io/api/file/WenvMkJjRpOeE6RIw3Vo/convert?w=650\" rel=\"nofollow\"\u003ehttps://www.filepicker.io/api/file/WenvMkJjRpOeE6RIw3Vo/convert?w=650\u003c/a\u003e, the displayed image is resized.\u003c/p\u003e\n\n\u003cp\u003eBut how to set up resizing of an image while upload? I am familiar with Paperclip, where I set dimensions of all thumbnails and everything is created within the upload.\u003c/p\u003e\n\n\u003cp\u003eHow it works with FilePicker?\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2013-08-16 13:31:04.527 UTC","last_activity_date":"2013-08-16 13:40:57.02 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"984621","post_type_id":"1","score":"1","tags":"ruby-on-rails|ruby|upload|filepicker.io|filepicker","view_count":"276"} +{"id":"30603060","title":"PHP passing boolean to ArrayObject for inner comparison","body":"\u003cp\u003eIs there a way to access the details of a boolean passed to an ArrayObject for comparison with each element of an array?\u003c/p\u003e\n\n\u003cp\u003eI've begun work on a dataframe for PHP and seem to have hit a glass ceiling with this one.\u003c/p\u003e\n\n\u003cp\u003eSample code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\n\nclass DataFrame extends ArrayObject {\n public function offsetGet($key) {\n if (is_bool($key)) {\n echo \"Passed a boolean: {$key}\\n\";\n } else {\n echo \"Comparing: {$key}\\n\";\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eJust a simple case with the code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$df = new DataFrame();\n$df['hello'] = 'world';\n$df[$df['hello'] == 'world'];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewill output (for any non-null, non-false, non-zero comparison):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eComparing: hello\nPassed a boolean:\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eotherwise:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eComparing: hello\nPassed a boolean: 1\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eEither way I have no access to the comparison with this approach.\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003eIs there an interface I can implement in order to gain access to boolean comparison methods or is something like this out of reach of PHP? Either way this is just sugar for a number of other approaches that can be taken, it would just be a shame to not have classic dataframe syntax.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-06-02 17:46:13.37 UTC","last_activity_date":"2015-06-02 18:50:00.65 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3817771","post_type_id":"1","score":"0","tags":"php|dataframe","view_count":"32"} +{"id":"22388446","title":"jQuery - Traversing through list elements to get nested elements and attributes","body":"\u003cp\u003eI have posted the following generated html where I need to select specific elements from.\nFor example I need to access and get the values of href in all cases as well as src and alt attributes of img element.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;ul id=\"query\" class=\"clicked inline\"\u0026gt;\n \u0026lt;li\u0026gt;\n \u0026lt;a class=\"filterterm\" href=\"#\"\u0026gt;×\u0026lt;/a\u0026gt;\n \u0026lt;span class=\"term\"\u0026gt;design\u0026lt;/span\u0026gt;\n \u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\n \u0026lt;a class=\"filterterm\" href=\"http://www.askgraphics.com/\"\u0026gt;×\u0026lt;/a\u0026gt;\n \u0026lt;span class=\"bingresult\"\u0026gt;Website design, Blog design and Web..\u0026lt;/span\u0026gt;\n \u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\n \u0026lt;a class=\"filterterm\" href=\"http://www.askgraphics.com\"\u0026gt;\n \u0026lt;img class=\"imgresult\" width=\"60px\" border=\"1px\" height=\"60px\" src=\"http://farm8.staticflickr.com/7423/13129389874_a07ced37ee_t.jpg\" alt=\"Image\"\u0026gt;\n \u0026lt;/a\u0026gt;\n \u0026lt;span class=\"imageterm\"\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;/li\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI've tried with a code like the following but no success\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e ('ul#query \u0026gt; li \u0026gt; .term').each(function(i,data){\n console.log(\" Term Data\"+data.text()); \n });\n\n });\n $('ul#query \u0026gt; li \u0026gt; img \u0026gt; .imgresult').each(function(i,data){\n console.log(\" Image Data\"+data);\n });\n\n });\n $('ul#query \u0026gt; li \u0026gt; .linkresult').each(function(i,data){\n console.log(\" Link Data\"+data.text()); \n });\n\n });\n $('ul#query \u0026gt; li \u0026gt; img \u0026gt; .videoresult').each(function(i,data){\n console.log(\" Video Data\"+data); \n\n });\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"2","creation_date":"2014-03-13 19:02:53.513 UTC","last_activity_date":"2014-03-13 19:48:06.88 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2008973","post_type_id":"1","score":"0","tags":"jquery|html|dom","view_count":"74"} +{"id":"44743472","title":"Unable to connect to WSGI daemon process mod_wsgi in Centos7 with Cpanel/WHM","body":"\u003cp\u003eI'm with a problem while deploying \u003ccode\u003eDjango\u003c/code\u003e in my VPS with \u003ccode\u003eCentos 7.3\u003c/code\u003e and WHM. It seems to work, except for a socket problem with \u003ccode\u003emod_wsgi\u003c/code\u003e.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[Sun Jun 25 00:37:03.254774 2017] [wsgi:error] [pid 29756] (13)Permission denied: [client 66.249.83.220:35523] mod_wsgi (pid=29756): Unable to connect to WSGI daemon process 'brunamaiahair.com.br' on '/var/run/apache2/wsgi.721.27.1.sock' as user with uid=1004.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI read to insert \u003cstrong\u003eWSGISocketPrefix\u003c/strong\u003e as a directive, so I edited \u003ccode\u003ehttpd.conf\u003c/code\u003e and put:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eWSGISocketPrefix /var/run/apache2/wsgi\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut I'm receiving the same error. Here is the log with the modified \u003ccode\u003ehttpd.conf\u003c/code\u003e after an Apache restart:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[Sat Jun 24 21:10:56.084269 2017] [mpm_prefork:notice] [pid 721] AH00163: Apache/2.4.25 (cPanel) OpenSSL/1.0.2k mod_bwlimited/1.4 mod_wsgi/4.5.7 Python/2.7 configured -- resuming normal operations\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is my \u003ccode\u003eVirtualHost\u003c/code\u003e configuration:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eWSGIDaemonProcess brunamaiahair.com.br socket-user=#1004 python-path=/home/bmhair/public_html/django/framework:/home/bmhair/public_html/django/denv/lib/python2.7/site-packages\n\nWSGIProcessGroup brunamaiahair.com.br\n\nWSGIScriptAlias / /home/bmhair/public_html/django/framework/framework/wsgi.py\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-06-25 05:25:18.6 UTC","last_activity_date":"2017-06-29 07:46:26.617 UTC","last_edit_date":"2017-06-25 16:24:41.52 UTC","last_editor_display_name":"","last_editor_user_id":"1394697","owner_display_name":"","owner_user_id":"6063646","post_type_id":"1","score":"1","tags":"django|apache|sockets|mod-wsgi|whm","view_count":"109"} +{"id":"34345553","title":"Need Help Calculating a Point in Java in 3d Space","body":"\u003cp\u003eI am building a model of a person in Java. I am having a bit of trouble getting the arms to function the way I need them to.\u003c/p\u003e\n\n\u003cp\u003eThe arms connect to the body using the following function\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic void PseudoChild(ModelRenderer Parent, float ParentLength, ModelRenderer Child){\n\nfloat X = ParentLength * MathHelper.sin(Parent.rotateAngleX) * MathHelper.sin(Parent.rotateAngleY);\nfloat Y = ParentLength * MathHelper.cos(Parent.rotateAngleX);\nfloat Z = ParentLength * MathHelper.sin(Parent.rotateAngleX) * MathHelper.cos(Parent.rotateAngleY);\n\nChild.rotationPointX = X + Parent.rotationPointX;\nChild.rotationPointY = Y + Parent.rotationPointY;\nChild.rotationPointZ = Z + Parent.rotationPointZ;\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis function uses the Body's X and Y rotation angles to calculate where to place the arms at the shoulders. But in order to place the forearms at the end of the upper arms I need to be able to account for the x,y \u0026amp; z rotation angles.\u003c/p\u003e\n\n\u003cp\u003eI have the length of the arm, the pitch yaw and roll of the arm, how do I calculate where to place the forearm?\u003c/p\u003e\n\n\u003cp\u003eThank you,\u003c/p\u003e","answer_count":"0","comment_count":"4","creation_date":"2015-12-17 22:33:25.513 UTC","favorite_count":"1","last_activity_date":"2015-12-17 22:33:25.513 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5671593","post_type_id":"1","score":"1","tags":"java|trigonometry","view_count":"44"} +{"id":"18519028","title":"Native php way to use ldap extended operations?","body":"\u003cp\u003eOther than using perl or command line scripts is there a native php way to call ldap's extended operations?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-08-29 18:59:36.063 UTC","last_activity_date":"2013-08-30 07:42:16.427 UTC","last_edit_date":"2013-08-30 07:30:00.677 UTC","last_editor_display_name":"","last_editor_user_id":"810802","owner_display_name":"","owner_user_id":"886399","post_type_id":"1","score":"3","tags":"php|ldap","view_count":"318"} +{"id":"24929341","title":"Fiji: imglib2 FFT algorithm explanation","body":"\u003cp\u003eI've already worked with FourierTransform and FFTConvolution classes, I've also studied their codes in order to adapt them to my program, anyway I still have some doubts about those classes and I hope you can help me! \u003c/p\u003e\n\n\u003cp\u003eFirst, dimensions of the output resulting from the FourierTransform and those of the fftKernel in the FFTConvolution class differ from those of the input images, why? Why, for example, if I transform a 256x256 image I get back a 281x560 spectrum?\u003c/p\u003e\n\n\u003cp\u003eSecondly, trying to find out an answer to the first doubt I have, I find out that the spectrum dimensions are calculated by using the package edu.mines.jtk.dsp and in particular the classes FftReal/FftComplex, both based on the Pfacc class. Comments to the Pfacc class said that this class implements the PFA algorithm for the FFT computation, so my second doubt is this: do the FourierTransform and FFTConvolution classes implement the PFA algorithm? \u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-07-24 08:58:59.277 UTC","favorite_count":"0","last_activity_date":"2014-07-25 12:14:28.067 UTC","last_edit_date":"2014-07-25 12:14:28.067 UTC","last_editor_display_name":"","last_editor_user_id":"3008214","owner_display_name":"","owner_user_id":"3008214","post_type_id":"1","score":"0","tags":"java|image-processing|fft|imagej|prime-factoring","view_count":"192"} +{"id":"26014831","title":"Did Ruby break backward compatibility with the release 2.1.3 around if-else expressions?","body":"\u003cp\u003eI recently upgraded to Ruby 2.1.3 and to my surprise I started getting some syntax errors. The smallest instance of the problem can be seen here:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{blah: if true then :bleh end}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhich in Ruby 2.1.2 produces:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e =\u0026gt; {:blah=\u0026gt;:bleh}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhile in 2.1.3 produces:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSyntaxError: (irb):1: syntax error, unexpected modifier_if\n{blah: if true then :bleh end}\n ^\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eA more realistic example would be:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{blah: bleh\n blih: if false\n blah\n elsif true\n bloh\n else\n bluh\n end}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e(yes, it's not very common to write code like that, I know, but I got used to that in Haskell and I think it makes for very concise and readable code).\u003c/p\u003e\n\n\u003cp\u003eDid Ruby 2.1.3 break backward compatibility here? If so, this should be a bug according to the rules of semantic versioning, right?\u003c/p\u003e\n\n\u003cp\u003eOr was unknowingly I abusing a bug of the parser that got patched?\u003c/p\u003e\n\n\u003cp\u003eIs there some (other) way of writing if-conditions as expressions?\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2014-09-24 10:40:23.767 UTC","last_activity_date":"2014-09-24 12:20:27.423 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6068","post_type_id":"1","score":"3","tags":"ruby|ruby-2.1.3","view_count":"376"} +{"id":"25952898","title":"Change height of Support Action Bar","body":"\u003cp\u003eI'm using the \u003ccode\u003eV7 support library\u003c/code\u003e and I would like to change the \u003cstrong\u003eheight\u003c/strong\u003e of action bars in certain activities only.\u003c/p\u003e\n\n\u003cp\u003eThis is my \u003ccode\u003estyles.xml\u003c/code\u003e : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;resources\u0026gt;\n \u0026lt;style name=\"AppBaseTheme\" parent=\"Theme.AppCompat.Light\"\u0026gt;\u0026lt;/style\u0026gt;\n\n \u0026lt;!-- Application theme. --\u0026gt;\n \u0026lt;style name=\"AppTheme\" parent=\"AppBaseTheme\"\u0026gt;\u0026lt;/style\u0026gt;\n\n \u0026lt;!-- here --\u0026gt;\n \u0026lt;style name=\"Double_Action_Bar\" parent=\"AppTheme\"\u0026gt;\n \u0026lt;item name=\"actionBarStyle\"\u0026gt;@style/Double_Action_Bar_Style\u0026lt;/item\u0026gt;\n \u0026lt;/style\u0026gt;\n\n \u0026lt;style name=\"Double_Action_Bar_Style\" parent=\"Theme.AppCompat.Light.DarkActionBar\"\u0026gt;\n \u0026lt;item name=\"height\"\u0026gt;@dimen/abc_action_bar_double_height\u0026lt;/item\u0026gt;\n \u0026lt;item name=\"android:height\"\u0026gt;@dimen/abc_action_bar_double_height\u0026lt;/item\u0026gt;\n \u0026lt;/style\u0026gt;\n\u0026lt;/resources\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhere :\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003e@dimen/abc_action_bar_double_height == 2 * @dimen/abc_action_bar_default_height\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eon my manifest file I'm including it like :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;application\n android:name=\"com.myapp.App\"\n android:allowBackup=\"true\"\n android:icon=\"@drawable/ic_launcher\"\n android:label=\"@string/app_name\"\n android:theme=\"@style/AppTheme\" \u0026gt;\n\n \u0026lt;activity\n android:name=\".Splash\"\n android:label=\"@string/app_name\"\n android:theme=\"@style/Theme.AppCompat.Light.NoActionBar\" \u0026gt;\n \u0026lt;intent-filter\u0026gt;\n \u0026lt;action android:name=\"android.intent.action.MAIN\" /\u0026gt;\n\n \u0026lt;category android:name=\"android.intent.category.LAUNCHER\" /\u0026gt;\n \u0026lt;/intent-filter\u0026gt;\n \u0026lt;/activity\u0026gt;\n \u0026lt;activity\n android:name=\".Home\"\n android:label=\"\"\n android:theme=\"@style/Double_Action_Bar\" /\u0026gt; \u0026lt;!-- here --\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut looks like \u003ccode\u003e.Home\u003c/code\u003e's actionbar is not altered. \u003c/p\u003e\n\n\u003cp\u003eHow can I edit the ActionBar height with \u003ccode\u003eAppCompat\u003c/code\u003e ? Any help would be very appreciated :)\u003c/p\u003e\n\n\u003cp\u003eThank you.\u003c/p\u003e","answer_count":"2","comment_count":"2","creation_date":"2014-09-20 20:14:18.55 UTC","favorite_count":"1","last_activity_date":"2015-01-24 12:28:42.377 UTC","last_edit_date":"2014-09-20 21:47:12.687 UTC","last_editor_display_name":"","last_editor_user_id":"1079425","owner_display_name":"","owner_user_id":"1079425","post_type_id":"1","score":"0","tags":"android|android-actionbar|appcompat","view_count":"1410"} +{"id":"24621715","title":"Removing Class from all children except clicked child on ng-click in Angular","body":"\u003cp\u003eI have a simple list item being parsed with ng-repeat:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;ul\u0026gt;\n \u0026lt;li ng-repeat=\"item in items\" class=\"commonClass\" ng-class=\"{'on': on_var}\" ng-click=\"on_var=!on_var\"\u0026gt; \n {{item.name}} \n \u0026lt;li\u0026gt;\n\u0026lt;/ul\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eclicking on a list-item will add the class name 'on' as expected. but I want to remove all other 'on' classes as soon as you click on another list-item and only add it to the one clicked. I come from a jQuery background and I am new to angular. All I want to do is something like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(\"li.commanClass\").click(function(){ \n $(\"li.commonClass\").removeClass('on');\n $(this).addClass('on');\n})\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to know what is the \"angular way\" of achieving this result\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://jsfiddle.net/du7aN/\" rel=\"nofollow\"\u003ejsfiddle\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","accepted_answer_id":"24622044","answer_count":"4","comment_count":"0","creation_date":"2014-07-07 23:53:11.02 UTC","favorite_count":"2","last_activity_date":"2017-05-09 03:53:57.543 UTC","last_edit_date":"2015-05-11 17:06:55.917 UTC","last_editor_display_name":"","last_editor_user_id":"1464112","owner_display_name":"","owner_user_id":"1352485","post_type_id":"1","score":"3","tags":"angularjs|angularjs-ng-repeat|angularjs-ng-click|ng-class","view_count":"6000"} +{"id":"35804096","title":"Android: ContextMenu but not taking up the whole window","body":"\u003cp\u003eI was searching for a way to create a pop up when i long click an \u003ccode\u003eImageView\u003c/code\u003e, and i've seen many answers of \u003ccode\u003eContextMenu\u003c/code\u003e but what i saw from \u003ccode\u003eContextMenu\u003c/code\u003e is that it takes the whole window, is there a way to achieve something like \u003ca href=\"https://i.stack.imgur.com/mxWel.png\" rel=\"nofollow noreferrer\"\u003ethis\u003c/a\u003e? a small list of options? \u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/mxWel.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/mxWel.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2016-03-04 19:05:13.673 UTC","last_activity_date":"2016-03-04 19:14:37.887 UTC","last_edit_date":"2016-03-04 19:10:37.377 UTC","last_editor_display_name":"","last_editor_user_id":"1770868","owner_display_name":"","owner_user_id":"5938872","post_type_id":"1","score":"0","tags":"android","view_count":"25"} +{"id":"35394967","title":"deleting the data both from the table and the parse data source using swift","body":"\u003cp\u003eHi there I've been trying to create a parse connected to do list . And the part that bothers me is when I want to remove an element from a table and I want the same Object get deleted in the database . The problem is I can delete any object in the simulator but it deletes the very next object from the database instead of the one that was triggered . \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eoverride func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) {\n if (editingStyle == UITableViewCellEditingStyle.Delete){\n\n LM.myList.removeAtIndex(indexPath.row)\n let myQuery = PFQuery(className: \"list\")\n myQuery.findObjectsInBackgroundWithBlock({ (Objects , error ) -\u0026gt; Void in\n if (error != nil){\n print(\"Error was Found\")\n }else if let Object = Objects {\n for MyObject in Object {\n if (MyObject[\"title\"] as! String == LM.myList[indexPath.row].title \u0026amp;\u0026amp; MyObject[\"desc\"] as! String == LM.myList[indexPath.row].Description)\n\n {\n //print(LM.myList[indexPath.row ].Description)\n //print(LM.myList[indexPath.row ].title)\n //print(MyObject[\"title\"] as! String)\n //print(MyObject[\"desc\"] as! String)\n MyObject.deleteInBackground()\n MyObject.saveInBackground()\n\n }\n }\n }\n }\n\n )\n\n tableView.deleteRowsAtIndexPaths( [indexPath] , withRowAnimation: UITableViewRowAnimation.Automatic)\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks in advance :) \u003c/p\u003e","accepted_answer_id":"35395116","answer_count":"1","comment_count":"0","creation_date":"2016-02-14 17:42:58.133 UTC","last_activity_date":"2016-02-14 17:56:25.88 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5558973","post_type_id":"1","score":"0","tags":"swift|uitableview|parse.com|delete-row","view_count":"29"} +{"id":"24498686","title":"Android - scroll activity background image while scrolling listview","body":"\u003cp\u003eI want to create an activity with a listview and a background image that is automatically moved vertically when the user scrolls down the listview (the image should scroll slower than the list view), something like yahoo weather app.\u003c/p\u003e\n\n\u003cp\u003eI was wondering if there is an existing code/library that does this well (good code wrapping, setting the image bigger that the screen, improvements on usage so that OutOfMemory should't happen etc).\u003c/p\u003e","accepted_answer_id":"24526345","answer_count":"1","comment_count":"2","creation_date":"2014-06-30 20:48:07.663 UTC","favorite_count":"2","last_activity_date":"2014-07-03 16:12:04.653 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1215791","post_type_id":"1","score":"2","tags":"android|listview|scroll|background-image","view_count":"2018"} +{"id":"34256154","title":"How does \u003c\u003e work in SQL?","body":"\u003cp\u003eI have a mock exam and one of the questions is \u003c/p\u003e\n\n\u003cp\u003eWhich supplier name has not shipped a red part? \u003c/p\u003e\n\n\u003cp\u003eThe Database schema is as follows \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Supplier (SupplierName, City) \n Part(PartName, Color, Weight) \n Shipment(SupplierName, PartName, Date) \n Shipment(SupplierName) is a F.K. onto Supplier(SupplierName) \n Shipment(PartName) is a F.K. onto Part(PartName)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe query I have come up with is\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT S.SupplierName\nFROM Supplier as S\nJOIN Shipment as SH on S.SupplierName = SH.SupplierName\nJOIN Part as P on SH.PartName = P.PartName\nWHERE P.Color \u0026lt;\u0026gt; 'Red'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy question is, am I using \u0026lt;\u003e the right way?\u003c/p\u003e","accepted_answer_id":"34256173","answer_count":"1","comment_count":"0","creation_date":"2015-12-13 20:48:16.137 UTC","last_activity_date":"2015-12-13 20:50:18.293 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1314413","post_type_id":"1","score":"1","tags":"sql","view_count":"56"} +{"id":"25791271","title":"How to print the full PHP code generated right before compile (after includes and requires)?","body":"\u003cp\u003eIs there a way to print full php (in php) code after includes and requires?\u003c/p\u003e\n\n\u003cp\u003eFor example I have 3 files.\u003c/p\u003e\n\n\u003cp\u003eFile \u003ccode\u003ebasic.php\u003c/code\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php echo 2; include 'basic2.php'; ?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFile \u003ccode\u003ebasic2.php\u003c/code\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php echo 3; ?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand the main file \u003ccode\u003emain_file.php\u003c/code\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php echo 1; include 'basic.php'; echo 4; ?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI would like to get the full code that would be about to be compiled, the result would be something like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php echo 1; ?\u0026gt;\u0026lt;?php echo 2; ?\u0026gt;\u0026lt;?php echo 3; ?\u0026gt;\u0026lt;?php echo 4; ?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs that possible?\u003c/p\u003e","answer_count":"0","comment_count":"6","creation_date":"2014-09-11 15:19:38.047 UTC","last_activity_date":"2015-08-18 18:10:52.09 UTC","last_edit_date":"2015-08-18 18:10:52.09 UTC","last_editor_display_name":"","last_editor_user_id":"1677912","owner_display_name":"","owner_user_id":"668138","post_type_id":"1","score":"1","tags":"php|php-include","view_count":"77"} +{"id":"8309801","title":"Bit Shift Large Binary File?","body":"\u003cp\u003eWhat is the best or recommended method for bit shifting a large amount of binary data in C? I have a 200K binary file and I want to left, then right shift the entire lot.\u003c/p\u003e","accepted_answer_id":"8309859","answer_count":"1","comment_count":"8","creation_date":"2011-11-29 11:14:36.743 UTC","last_activity_date":"2011-11-29 11:33:15.137 UTC","last_edit_date":"2011-11-29 11:16:40.167 UTC","last_editor_display_name":"","last_editor_user_id":"596219","owner_display_name":"","owner_user_id":"1068477","post_type_id":"1","score":"2","tags":"c|binary|bit|bit-shift","view_count":"924"} +{"id":"11983141","title":"PHP convert deep array","body":"\u003cblockquote\u003e\n \u003cp\u003e\u003cstrong\u003ePossible Duplicate:\u003c/strong\u003e\u003cbr\u003e\n \u003ca href=\"https://stackoverflow.com/questions/7854940/php-walk-through-multidimensional-array-while-preserving-keys\"\u003ePHP Walk through multidimensional array while preserving keys\u003c/a\u003e \u003c/p\u003e\n\u003c/blockquote\u003e\n\n\n\n\u003cp\u003eI have a deep array like this one:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003earray {\n [\"key1\"] =\u0026gt; \"A\"\n [\"key2\"] =\u0026gt; \"B\"\n [\"key3\"] =\u0026gt; array {\n [\"subkey1\"] =\u0026gt; \"C\"\n [\"subkey2\"] =\u0026gt; array {\n [\"subsubkey1\"] =\u0026gt; \"D\"\n }\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI don't know how deep this array will get.\nNow I want to convert it to an array that looks like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003earray {\n array {\n [\"key1\"] =\u0026gt; \"A\"\n [\"key2\"] =\u0026gt; \"B\"\n [\"key3.subkey1\"] =\u0026gt; \"C\"\n [\"key3.subkey2.subsubkey1\"] = \u0026gt; \"D\"\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow would I do that? I guess it needs a recursion?\u003c/p\u003e","accepted_answer_id":"11983219","answer_count":"2","comment_count":"6","creation_date":"2012-08-16 08:17:41.483 UTC","last_activity_date":"2012-08-16 08:30:04.59 UTC","last_edit_date":"2017-05-23 12:27:34.98 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"848685","post_type_id":"1","score":"0","tags":"php|arrays|recursion","view_count":"243"} +{"id":"36365979","title":"Google Maps Geocoding AJAX using a variable as the URL","body":"\u003cpre\u003e\u003ccode\u003e $('form').submit(function(event){\n event.preventDefault();\n var userData = \"https://maps.googleapis.com/maps/api/geocode/json?address=\"+$('input#city').val()+\"\u0026amp;key=MY_API_KEY\";\n console.log(userData);\n $.ajax({\n type: \"GET\",\n url : userData, \n success: function(data){\n $.each(data['results'][0]['address_components'], function(key, value) {\n if(value[\"types\"][0] == \"postal_code\"){\n $('.alert-success').fadeIn(2000).html('Post/ZIP Code: '+value[\"long_name\"]);\n }\n });\n }\n })\n });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo, I have this code, above, which is currently returning no error nor any results as desired.\u003c/p\u003e\n\n\u003cp\u003eIt works fine as long as I put the entire '\u003ca href=\"https://maps.googleapis.com/maps/api/geocode/json?address=\" rel=\"nofollow\"\u003ehttps://maps.googleapis.com/maps/api/geocode/json?address=\u003c/a\u003e\"\"\u0026amp;key=\"\"' string in the \u003ccode\u003eurl: \"\",\u003c/code\u003e section of the ajax, but when trying to pass my variable in it doesn't want to do anything.\u003c/p\u003e\n\n\u003cp\u003eFrom what I've found variables should pass through easily enough into the ajax call so I'm kind of lost.\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2016-04-01 21:17:40.727 UTC","last_activity_date":"2016-04-01 23:19:33.047 UTC","last_edit_date":"2016-04-01 22:11:48.59 UTC","last_editor_display_name":"","last_editor_user_id":"1210329","owner_display_name":"","owner_user_id":"2723138","post_type_id":"1","score":"-1","tags":"javascript|jquery|ajax|google-maps","view_count":"301"} +{"id":"16000954","title":"Keep a Session alive after PayPal payment","body":"\u003cp\u003eI create PHP session for storing the user email in 'submit.php' where before redirecting to paypal I register that user information into a database using MySQL. This is the code for creating the session in 'submit.php':\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esession_start();\n$_SESSION['user-email']=$email;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo now the user pays at PayPal successfully and goes to 'thankyou.php' and I want to update my database saying the user paid and calling the PHP session:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esession_start();\n $email = $_SESSION['user-email'];\n $con = mysql_connect(\"host.host.com\",\"root\",\"password\");\n if (!$con) { die('Could not connect: ' . mysql_error()); }\n mysql_select_db(\"somedatabase\", $con);\n\n $sql=\"UPDATE myTable SET status=1 WHERE email='$email'\";\n if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); }\n mysql_close($con);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs the $_SESSION['user-email']; still alive at this point? Do I have any error? Why do you think my code is not working properly?\u003c/p\u003e\n\n\u003cp\u003eThanks in advance\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2013-04-14 15:45:50.24 UTC","last_activity_date":"2013-04-14 15:45:50.24 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2255164","post_type_id":"1","score":"0","tags":"php|mysql|session","view_count":"243"} +{"id":"25648283","title":"Getting MSOL users through REST API for Sharepoint","body":"\u003cp\u003eI'm looking for a REST call to get all MS-Online users.\u003c/p\u003e\n\n\u003cp\u003eI am able to get these users through the following Powershell command\u003c/p\u003e\n\n\u003cp\u003eGet-MSOLUser -All \u003c/p\u003e\n\n\u003cp\u003eI am currently using \u003ccode\u003ehttp://{siteurl}/_api/web/siteusers\u003c/code\u003e call to fetch users, but this doesn't return all users that I get using Powershell.\u003c/p\u003e\n\n\u003cp\u003eIs there a way I could get all those users?\u003c/p\u003e\n\n\u003cp\u003e\u003cb\u003e NOTE: \u003c/b\u003e One thing that I have noted is that \u003ci\u003e/siteusers\u003c/i\u003e call doesn't return those users who haven't created a personal site(Onedrive) or in other words, returns only those users who have a \u003ci\u003e/personal/user_name_domain_com\u003c/i\u003e site.\u003c/p\u003e\n\n\u003cp\u003eCould this be the reason why \u003ci\u003e/siteusers\u003c/i\u003e call is not returning this data while Powershell is?\u003c/p\u003e","accepted_answer_id":"25658661","answer_count":"1","comment_count":"0","creation_date":"2014-09-03 15:30:25.047 UTC","favorite_count":"0","last_activity_date":"2014-10-10 14:29:35.197 UTC","last_edit_date":"2014-10-10 14:29:35.197 UTC","last_editor_display_name":"","last_editor_user_id":"3500696","owner_display_name":"","owner_user_id":"3500696","post_type_id":"1","score":"0","tags":"sharepoint|ms-office|sharepoint-2013|office365|azure-active-directory","view_count":"381"} +{"id":"55693","title":"How do you use FogBugz with an Agile methodology?","body":"\u003cp\u003e\"Evidence-based scheduling\" in FogBugz is interesting, but how do I use it w/ an Agile methodology?\u003c/p\u003e","accepted_answer_id":"57335","answer_count":"4","comment_count":"0","creation_date":"2008-09-11 02:29:25.413 UTC","favorite_count":"7","last_activity_date":"2011-05-17 18:44:19.167 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4792","post_type_id":"1","score":"19","tags":"agile|fogbugz|schedule","view_count":"6427"} +{"id":"29364264","title":"Creating a search text box in an Access 2013 Navigation Subform","body":"\u003cp\u003eI created a search text box in Access 2013 that works as in should in the form. When I moved the form to the Navigation form it stopped working. I receive the following error: \"The action or method is invalid because the form or report isn't bound to a table or query.\" I have changed the condition in the Embedded Macro to read as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[conLastName] Like \"*\" \u0026amp; [Forms]![frmNavigation]![NavigationSubform].[Form]![TxtSearchContacts] \u0026amp; \"*\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have also tried:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[conLastName] Like \"*\" \u0026amp; [Forms]![frmNavigation].[NavigationSubform].[Form]![TxtSearchContacts] \u0026amp; \"*\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[conLastName] Like \"*\" \u0026amp; [Forms]![frmNavigation]![NavigationSubform]![Form]![TxtSearchContacts] \u0026amp; \"*\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny and all insight would be greatly appreciated. I have spent well over two hours beating my head against the wall on this one. Thank you. ~Christa\u003c/p\u003e","answer_count":"0","comment_count":"5","creation_date":"2015-03-31 08:43:31.23 UTC","last_activity_date":"2015-03-31 08:47:48.567 UTC","last_edit_date":"2015-03-31 08:47:48.567 UTC","last_editor_display_name":"","last_editor_user_id":"1116757","owner_display_name":"","owner_user_id":"4733040","post_type_id":"1","score":"0","tags":"forms|ms-access|subform","view_count":"867"} +{"id":"19930720","title":"How do I add media Queries into Jquery","body":"\u003cp\u003eIs it possible to add media jquery's into your jquery code? \u003c/p\u003e\n\n\u003cp\u003eI need to reduce \"slideWidth: 83,\" when my screen hits a size of 800px;\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(document).ready(function(){\n $('.slider4').bxSlider({\n slideWidth: 83,\n minSlides: 2,\n maxSlides: 9,\n moveSlides: 1,\n slideMargin: 15\n });\n});\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"4","comment_count":"0","creation_date":"2013-11-12 13:39:44.403 UTC","last_activity_date":"2013-11-12 13:56:28.513 UTC","last_edit_date":"2013-11-12 13:41:41.633 UTC","last_editor_display_name":"","last_editor_user_id":"637853","owner_display_name":"","owner_user_id":"2965875","post_type_id":"1","score":"3","tags":"javascript|jquery","view_count":"3492"} +{"id":"46459345","title":"Injecting a spinner inside a fullcalendar table cell","body":"\u003cp\u003eI have a fullcalendar in my fiddle \u003ca href=\"http://jsfiddle.net/rbynbu4z/4/\" rel=\"nofollow noreferrer\"\u003ehere\u003c/a\u003e that displays events as a number inside each days cell. Is it possible, when triggering the day click or the event item click, to replace the number with a spinner. Then when I finish pulling the event data and displaying, etc, etc I put the number back and hide the spinner?\u003c/p\u003e\n\n\u003cp\u003eUpdate! - I can change the value of the cell event item to a spinner when I click on the item inside the cell like this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eeventLimitClick: function (cellInfo, jsEvent) {\n var eventValue = $(cellInfo.moreEl).html();\n $(cellInfo.moreEl).html('\u0026lt;i class=\"fa fa-circle-o-notch fa-spin fa-fw\"\u0026gt;\u0026lt;/i\u0026gt;');\n },\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eUpdate! - I got the day click to show a spinner\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edayClick: function (date, jsEvent, view) {\n var elementValue = $(jsEvent.target).text();\n $(jsEvent.target).html('\u0026lt;div\u0026gt;\u0026lt;a class=\"fc-more\"\u0026gt;\u0026lt;i class=\"fa fa-circle-o-notch fa-spin fa-fw\"\u0026gt;\u0026lt;/i\u0026gt;\u0026lt;/a\u0026gt;\u0026lt;/div\u0026gt;');\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut I'm having a harder time changing it when I trigger a day click. 'this' in the callback, which is a 'td' element, is for a different table then the one used for the event item value. If I can just figure out how to change the element holding the value from a dayclick I'll be good to go! Or if I can trigger a eventLimitClick from a day click I'll accept that!! Is that possible?\u003c/p\u003e\n\n\u003cp\u003eHere is some code below\u003c/p\u003e\n\n\u003cp\u003e\u003cdiv class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\"\u003e\r\n\u003cdiv class=\"snippet-code\"\u003e\r\n\u003cpre class=\"snippet-code-js lang-js prettyprint-override\"\u003e\u003ccode\u003e$('#calendar').fullCalendar({\r\nheader: {\r\n left: 'prev,next today',\r\n center: 'title',\r\n right: ''\r\n},\r\n//defaultDate: '2014-06-12',\r\ndefaultView: 'basicWeek',\r\neditable: false,\r\nheight: 174,\r\neventLimit: 1,\r\neventLimitText: function(numEvents) {\r\n return numEvents;\r\n},\r\neventLimitClick: function (cellInfo, jsEvent) {\r\n},\r\ndayClick: function(date, jsEvent, view) {\r\n\r\n},\r\nevents: [{\r\n title: 'Event',\r\n start: '2017-09-28'\r\n },\r\n {\r\n title: 'Event',\r\n start: '2017-09-28'\r\n }\r\n]\r\n});\r\n\r\n});\u003c/code\u003e\u003c/pre\u003e\r\n\u003cpre class=\"snippet-code-css lang-css prettyprint-override\"\u003e\u003ccode\u003etd.fc-more-cell {\r\n text-align: center;\r\n font-size: 2.3em;\r\n}\r\n\r\n.fc-row .fc-content-skeleton,\r\n.fc-row .fc-content-skeleton td,\r\n.fc-row .fc-content-skeleton table,\r\n.fc-row .fc-content-skeleton tr {\r\n height: 100%;\r\n vertical-align: middle;\r\n}\r\n\r\n.fc-row .fc-content-skeleton td div {\r\n display: inline-block;\r\n line-height: 100%;\r\n}\u003c/code\u003e\u003c/pre\u003e\r\n\u003cpre class=\"snippet-code-html lang-html prettyprint-override\"\u003e\u003ccode\u003e\u0026lt;div id='calendar'\u0026gt;\u0026lt;/div\u0026gt;\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-09-28 00:59:18.04 UTC","favorite_count":"1","last_activity_date":"2017-09-28 07:16:18.143 UTC","last_edit_date":"2017-09-28 07:15:55.02 UTC","last_editor_display_name":"","last_editor_user_id":"1186050","owner_display_name":"","owner_user_id":"1186050","post_type_id":"1","score":"0","tags":"jquery|html|css|twitter-bootstrap|fullcalendar","view_count":"56"} +{"id":"6422909","title":"Workaround for click() not working in HtmlUnitDriver in Fitnesse?","body":"\u003cp\u003eI have a jUnit test running a Fitnesse test that tests some web pages. When in development mode, I use the FirefoxDriver and all tests run great, with web pages popping up as expected.\u003c/p\u003e\n\n\u003cp\u003eWhen I try to run the test in an automated mode, i.e. using Maven, the tests fail miserably. Do any of you have any suggestions of what might be wrong or a workaround?\u003c/p\u003e\n\n\u003cp\u003eThe relevant code:\u003cbr\u003e\n- The web page: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;form method=\"get\" action=\"/someAction.do\" name=\"my_form\"\u0026gt; \n \u0026lt;input id=\"fetch_new_submit\" class=\"ui-button ui-widget ui-state-default ui-corner-all\" type=\"submit\" onclick=\"showWaitMsg()\" value=\"Fetch new orders\" role=\"button\"\u0026gt; \n \u0026lt;/form\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003cp\u003eThe fixturecode:\u003cbr\u003e\n class SomeFixture...\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic boolean pressSubmitButton(String buttonText) {\ntry {\n List\u0026lt;WebElement\u0026gt; buttons = getWebDriver().findElements(By.tagName(\"input\"));\n for (WebElement button : buttons) {\n if (button.getAttribute(\"value\").equals(buttonText)) {\n System.out.println(\"found button '\" + button.getAttribute(\"value\") + \"'.\");\n button.click(); //HERE\n return true;\n }\n }\n} catch (Exception e) {\n LOG.debug(\"Some error occured, e);\n return false;\n}\nLOG.debug(\"Did not find the button\");\nreturn false;\n}\n\u003c/code\u003e\u003c/pre\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eNote:\u003cbr\u003e\n- getWebDriver() returning FirefoxDriver works fine.\u003cbr\u003e\n- getWebDriver returning new HtmlUnitDriver(true) i.e. with javascript enabled, ignores the button.click() at HERE. Button.submit() is also ignored here and button.sendKeys(\"\\n\") throws an element 'not enabled'-error.\u003cbr\u003e\n- we use version 2.0rc2\u003c/p\u003e\n\n\u003cp\u003eOur automated tests can't use FirefoxDriver. Are there any known workarounds for this issue?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2011-06-21 09:11:26.307 UTC","last_activity_date":"2011-10-24 11:00:02.93 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"808117","post_type_id":"1","score":"1","tags":"java|firefox|click|htmlunit|fitnesse","view_count":"2109"} +{"id":"15786761","title":"Can't get prebuild hooks to work in Trigger.io","body":"\u003cp\u003eI'm keen to use coffeescript within Trigger.io and to do so I am following the details as described at \u003ca href=\"http://docs.trigger.io/en/latest/tools/hooks.html\" rel=\"nofollow\"\u003ehttp://docs.trigger.io/en/latest/tools/hooks.html\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI've placed my coffeescript.js file in the hooks/prebuild directory as required but the build now fails. I've commented out everything in the coffeescript.js file to ensure it's not the file's contents. \u003c/p\u003e\n\n\u003cp\u003eIt detects the coffeescript.js file in the prebuild directory as shown in the log output but then it can't find some file. Anyone else have this problem? I'm using version 1.4 of the Trigger Toolkit.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[INFO] Running (node) hook: coffeescript.js\n[DEBUG] Running: 'node' '/Users/Will/forge-workspace/alpha-timing/hooks/prebuild/coffeescript.js' 'ios'\n[ERROR] [Errno 2] No such file or directory\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"1","creation_date":"2013-04-03 11:59:26.063 UTC","last_activity_date":"2013-04-07 17:24:56.5 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1447194","post_type_id":"1","score":"4","tags":"coffeescript|trigger.io","view_count":"187"} +{"id":"10571476","title":"What modifications could you make to a graph to allow Dijkstra's algorithm to work on it?","body":"\u003cp\u003eSo I've been thinking, without resorting to another algorithm, what modifications could you make to a graph to allow Dijkstra's algorithm to work on it, and still get the correct answer at the end of the day? If it's even possible at all?\u003c/p\u003e\n\n\u003cp\u003eI first thought of adding a constant equal to the most negative weight to all weights, but I found that that will mess up everthing and change the original single source path.\u003c/p\u003e\n\n\u003cp\u003eThen, I thought of traversing through the graph, putting all weights that are less than zero into an array or somwthing of the sort and then multiplying it by -1. I think his would work (disregarding running time constraints) but maybe I'm looking at the wrong way.\u003c/p\u003e\n\n\u003cp\u003eEDIT:\nAnother idea. How about permanently setting all negative weights to infinity. that way ensuring that they are ignored?\u003c/p\u003e\n\n\u003cp\u003eSo I just want to hear some opinions on this; what do you guys think?\u003c/p\u003e","accepted_answer_id":"10571719","answer_count":"1","comment_count":"2","creation_date":"2012-05-13 11:50:30.257 UTC","last_activity_date":"2012-05-13 12:28:54.823 UTC","last_edit_date":"2012-05-13 12:13:56.163 UTC","last_editor_display_name":"","last_editor_user_id":"1270698","owner_display_name":"","owner_user_id":"1270698","post_type_id":"1","score":"0","tags":"algorithm|graph|shortest-path|dijkstra","view_count":"501"} +{"id":"43672479","title":"can't pass this using arrow function in react?","body":"\u003cp\u003eI got undefined value passing \u003cstrong\u003ee\u003c/strong\u003e using arrow function\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;input type=\"checkbox\" onChange={e=\u0026gt; this.handleCheck(this, 123)} /\u0026gt;\n\nhandleCheck = (e, number) =\u0026gt; {\nconsole.log(number) //123\nconsole.log(e.target.checked) //undefined\nconsole.log(e.target) //undefined\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat's wrong?\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2017-04-28 05:18:33.137 UTC","last_activity_date":"2017-04-28 06:04:36.423 UTC","last_edit_date":"2017-04-28 05:22:14.087 UTC","last_editor_display_name":"","last_editor_user_id":"5087125","owner_display_name":"","owner_user_id":"7934660","post_type_id":"1","score":"0","tags":"javascript","view_count":"55"} +{"id":"40727887","title":"Python, inputting a command into an open CMD","body":"\u003cp\u003eI am attempting to create a program which will read an email, depending on the email's contents it will run a command. I have got the e-mail section working, all I need to know is how I would input this into a CMD that is already running.\u003c/p\u003e\n\n\u003cp\u003eIf anyone can link me to a similar question or answer my question I would be very grateful.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-11-21 19:28:24.56 UTC","last_activity_date":"2016-11-21 19:39:55.173 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6468474","post_type_id":"1","score":"0","tags":"python-3.x|cmd","view_count":"19"} +{"id":"46040029","title":"Sentient Captive Portal - Force open Browser on (CNA) iOS/Android - Nginx ? - Embedded","body":"\u003cp\u003eI have an issue, I want to do a kind of sentient captive portal on my intel edison.\u003c/p\u003e\n\n\u003cp\u003eI made an arcade games (on nodeJS) on my intel edison (raspberry like). I would like to play with my smartphone (iOS or android).\u003c/p\u003e\n\n\u003cp\u003eI would like friends could play easily on it. I would like made something like \"free hotspot wifi\", a captive portal but not complex with authentification.\u003c/p\u003e\n\n\u003cp\u003eIf it's not possible maybe i could just raise a popup when i'm connecting to network to say how to reach the local website !\u003c/p\u003e\n\n\u003cp\u003eEDIT:\u003c/p\u003e\n\n\u003cp\u003eI found something with nginx, I configure it, I can now show a welcome page, but this welcome page is not automaticaly showed.\u003c/p\u003e\n\n\u003cp\u003eEDIT 2:\u003c/p\u003e\n\n\u003cp\u003eI read apple should connect to \"captive.apple.com\" ?\nI added a line on /etc/hosts:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e127.0.0.1 captive.apple.com\n127.0.0.1 www.airport.us\n127.0.0.1 airport.us\n127.0.0.1 www.thinkdifferent.us\n127.0.0.1 thinkdifferent.us\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003emy 127.0.0.1:80 links to index of nginx (just for try)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;HTML\u0026gt;\u0026lt;HEAD\u0026gt;\u0026lt;TITLE\u0026gt;Success\u0026lt;/TITLE\u0026gt;\u0026lt;/HEAD\u0026gt;\u0026lt;BODY\u0026gt;Success\u0026lt;/BODY\u0026gt;\u0026lt;/HTML\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eDoesn't works ...\u003c/p\u003e\n\n\u003cp\u003eEDIT 3:\u003c/p\u003e\n\n\u003cp\u003eI don't provide Internet and I don't want to\u003c/p\u003e\n\n\u003cp\u003eEDIT 4:\u003c/p\u003e\n\n\u003cp\u003emy nginx.conf\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e ... server {\n listen 80;\n server_name localhost;\n\n #charset koi8-r;\n\n #access_log logs/host.access.log main;\n\n location / {\n root /var/www/localhost/html;\n index index.html index.htm;\n } ...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003emy dnsmask.conf\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elog-facility=/var/log/dnsmasq.log\naddress=/#/10.0.0.1\ninterface=wlan0\n#dhcp-range=10.0.0.10,10.0.0.250,12h\nno-resolv\nlog-queries\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have a dhcp server already.\nAll my smartphones can connect into and get an IP.\u003c/p\u003e\n\n\u003cp\u003eI can't raise my welcome page when I 'm connected to Wifi\u003c/p\u003e\n\n\u003cp\u003eEDIT 4:\u003c/p\u003e\n\n\u003cp\u003eHow to trigger CNA on ios ?\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-09-04 15:18:17.037 UTC","favorite_count":"1","last_activity_date":"2017-09-05 10:59:04.847 UTC","last_edit_date":"2017-09-05 10:59:04.847 UTC","last_editor_display_name":"","last_editor_user_id":"3864493","owner_display_name":"","owner_user_id":"3864493","post_type_id":"1","score":"0","tags":"ios|nginx|wifi|intel-edison|captiveportal","view_count":"127"} +{"id":"34042117","title":"devise rails current_user vs user_signed_in?","body":"\u003cp\u003eI am using Devise on Rails 4.1\nMy question is regarding the helpers and how they relate to sessions.\ncurrent_user : tells you if there is a user session available for the user.\nuser_signed_in: tells you if the user is authenticated.\u003c/p\u003e\n\n\u003cp\u003eI cannot understand how a there can be a current_user if the user_signed_in? is false?\u003c/p\u003e\n\n\u003cp\u003eWhat is the difference between the two methods, and how does it relate to sessions.\u003c/p\u003e\n\n\u003cp\u003eTHanks.\nRichard Madson\u003c/p\u003e","accepted_answer_id":"34042478","answer_count":"2","comment_count":"0","creation_date":"2015-12-02 11:54:53.043 UTC","last_activity_date":"2015-12-02 14:46:19.13 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2076066","post_type_id":"1","score":"1","tags":"ruby-on-rails|devise","view_count":"4233"} +{"id":"39022520","title":"How to setup authentication on jenkins","body":"\u003cp\u003eI installed jenkins on a CentOS system. Now I am able to open the jenkins web page on localhost:8080. I want to add a login required for accessing this url. I enabled security on 'Configure Global Security' page then set 'Unix user/group database' under 'Security Realm'. In Authorization part, I set 'Logged-in users can do anything'. By doing this configuration, only logged in user can do build and modification on jobs. But there is a problem that users can still read all the jobs information without log in. How can I prevent anonymous users to access my jenkins web page?\u003c/p\u003e","accepted_answer_id":"39022679","answer_count":"1","comment_count":"0","creation_date":"2016-08-18 15:47:43.797 UTC","last_activity_date":"2016-08-18 15:55:30.473 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5421539","post_type_id":"1","score":"1","tags":"jenkins","view_count":"104"} +{"id":"34142664","title":"Ignore an untracked file without changing .gitignore","body":"\u003cp\u003eI want to ignore one specific untracked/new file without having to edit the .gitignore file for the repo. We'll call it \u003ccode\u003esrc/foo.xml\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eI have tried:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003egit update-index --assume-unchanged src/foo.xml\ngit update-index --skip-worktree src/foo.xml\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBoth of which told me \u003ccode\u003eFatal: Unable to mark file src/foo.xml\u003c/code\u003e, which I'm guessing is because it's not tracked in the first place.\u003c/p\u003e\n\n\u003cp\u003eI also tried adding \u003ccode\u003esrc/foo.xml\u003c/code\u003e to .git/info/exclude. When that didn't work, I tried changing it to \u003ccode\u003e/src/foo.xml\u003c/code\u003e, then \u003ccode\u003eC:/work/myproject/src/foo.xml\u003c/code\u003e, neither of which worked.\u003c/p\u003e\n\n\u003cp\u003eIn all cases, if I do \u003ccode\u003egit status\u003c/code\u003e, foo.xml still shows up as an untracked file to be added.\u003c/p\u003e\n\n\u003cp\u003eIf I add \u003ccode\u003esrc/foo.xml\u003c/code\u003e to the .gitignore file, it gets ignored as expected, but then I'm changing .gitignore which is exactly what I'm trying to avoid.\u003c/p\u003e","accepted_answer_id":"34143448","answer_count":"1","comment_count":"4","creation_date":"2015-12-07 20:33:18.02 UTC","last_activity_date":"2015-12-07 21:20:09.15 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1021426","post_type_id":"1","score":"0","tags":"git|gitignore","view_count":"54"} +{"id":"40964363","title":"Getting null point exceptions when using methods in other activites - android","body":"\u003cp\u003eSo I am trying to access a method in another activity, basically to check if there's new data in the chat and if there is, it shows a toast. But I'm getting an error whenever I try to use this, or Activity.this in any function. If I try to use context, it works but rest all functions start giving null.\u003c/p\u003e\n\n\u003cp\u003eHere's what I did\u003c/p\u003e\n\n\u003cp\u003eDoTheTask.class \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eChat c = new Chat();\nc.Mymethod(\"true\",id);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eChat.class\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic void Mymethod(String fd, String id)\n {\n if(fd.equals(\"true\")){\n Toast.makeText(this,\"Chat is open\", Toast.LENGTH_LONG).show();\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere the \"this\" inside toast is giving NPE, I passed context with the method but I want to use this because I have many other functions required which work only with this or activity.this and not context (they give errors)\u003c/p\u003e","answer_count":"0","comment_count":"4","creation_date":"2016-12-04 22:19:02.063 UTC","last_activity_date":"2016-12-04 22:19:02.063 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6539593","post_type_id":"1","score":"0","tags":"java|android|methods","view_count":"9"} +{"id":"24067509","title":"Killing an intent for a closed source application","body":"\u003cp\u003eI'm a new Android programmer and I've been trying to develop an app that utilizes Google Voice Search's voice to text capabilities, calling it using an implicit intent. That's the part that works. However, I'm looking to only have GVS run for a set amount of time, so I've been looking for a way to kill the application. \u003c/p\u003e\n\n\u003cp\u003eI have tried:\nFinish() from several places in the program. If I could get some way to call GVS' finish() command, this would be ideal.\u003c/p\u003e\n\n\u003cp\u003eandroid.os.Process.killProcess(android.os.Process.myPid()) works, but it kills the entire app, which I don't want.\u003c/p\u003e\n\n\u003cp\u003eI am looking for:\nA way to kill the Google Voice Search app used in my program without killing the entire application. The only solution I have right now is to make an Activity that starts GVS and then kill that when I need GVS stopped, but that seems pointlessly messy. Anyone have a better solution?\u003c/p\u003e\n\n\u003cp\u003eEdit: I am not having trouble with the service itself. My intent and GVS are working perfectly. What I'm trying to do is interrupt the service so that, if I'm continually toggling the service back on whenever it turns off, I'll be able to stop the program after an amount of time. If I could terminate the process midway through, I'd be quite happy.\u003c/p\u003e\n\n\u003cp\u003eEdit2: I may have found a workaround for my issue in simply not refreshing the service when a timer is up.\u003c/p\u003e","answer_count":"0","comment_count":"6","creation_date":"2014-06-05 18:26:10.033 UTC","last_activity_date":"2017-02-17 20:46:32.293 UTC","last_edit_date":"2017-02-17 20:46:32.293 UTC","last_editor_display_name":"","last_editor_user_id":"472495","owner_display_name":"","owner_user_id":"3712392","post_type_id":"1","score":"2","tags":"android|android-intent|google-voice-search","view_count":"101"} +{"id":"20244029","title":"SIGSEGV SEGV_ACCERR Error - no method from app referenced","body":"\u003cp\u003eThere is no method from my app referenced in this crash report, and I have not been able to reproduce it. Several of my users are having the same crash. I can't find any tableview cells with a scrollview or any place where I use a spring. Where could this crash be coming from?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eIncident Identifier: 748D4582-3868-42BD-BF98-B3B47895954D\nCrashReporter Key: F7F44964-E877-4C7A-881C-91EBC4261080\nHardware Model: iPhone5,1\nProcess: MyApp [2415]\nPath: /Users/USER/MyApp.app/MyApp\nIdentifier: com.mycom.myapp\nVersion: 1.5.1\nCode Type: ARM\nParent Process: launchd [1]\n\nDate/Time: 2013-11-21 05:30:47 +0000\nOS Version: iPhone OS 7.0.4 (11B554a)\nReport Version: 104\n\nException Type: SIGSEGV\nException Codes: SEGV_ACCERR at 0x5000000c\nCrashed Thread: 0\n\nThread 0 Crashed:\n0 libobjc.A.dylib 0x3921fb66 objc_msgSend + 5\n1 UIKit 0x3177e315 -[UITableView _createPreparedCellForGlobalRow:withIndexPath:] + 409\n2 UIKit 0x317266cd -[UITableView _updateVisibleCellsNow:] + 1800\n3 UIKit 0x31719f75 -[UITableView _visibleCells] + 24\n4 UIKit 0x31783f13 -[UITableView indexPathForCell:] + 26\n5 UIKit 0x31782289 -[UITableViewCell _canDoSeparatorLayout] + 64\n6 UIKit 0x31781e19 -[UITableViewCell _updateSeparatorContent] + 56\n7 UIKit 0x31844a3b -[UITableViewCell _updateViewsForDeleteButton] + 218\n8 UIKit 0x3171c673 -[UITableViewCellScrollView setContentOffset:] + 186\n9 UIKit 0x31880561 __43-[UITableViewCell _animateSwipeCancelation]_block_invoke + 81\n10 UIKit 0x31681113 +[UIView _setupAnimationWithDuration:delay:view:options:factory:animations:start:animationStateGenerator:completion:] + 490\n11 UIKit 0x317a66ef +[UIView _animateUsing WithDuration:delay:options:mass:stiffness:damping:initialVelocity:animations:start:completion:] + 166\n12 UIKit 0x317a663f +[UIView _animateUsingSpringWithDuration:delay:options:mass:stiffness:damping:initialVelocity:animations:completion:] + 90\n13 UIKit 0x318804bf -[UITableViewCell _animateSwipeCancelation] + 278\n14 UIKit 0x31850639 -[UITableView _endSwipeToDeleteRowDidDelete:] + 216\n15 UIKit 0x31901873 -[UITableView willMoveToSuperview:] + 62\n16 UIKit 0x318e1913 __UIViewWillBeRemovedFromSuperview + 151\n17 UIKit 0x3164a091 -[UIView removeFromSuperview] + 56\n18 UIKit 0x3171e431 -[UIScrollView removeFromSuperview] + 64\n19 UIKit 0x3164c9b3 -[UIView dealloc] + 366\n20 libobjc.A.dylib 0x39221023 (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 359\n21 CoreFoundation 0x2edfb1c9 _CFAutoreleasePoolPop + 16\n22 CoreFoundation 0x2ee90e83 __CFRunLoopRun + 1315\n23 CoreFoundation 0x2edfb471 CFRunLoopRunSpecific + 524\n24 CoreFoundation 0x2edfb253 CFRunLoopRunInMode + 106\n25 GraphicsServices 0x33b352eb GSEventRunModal + 138\n26 UIKit 0x316b0845 UIApplicationMain + 1136\n27 MyApp 0x000e810b main (main.m:5)\n28 libdyld.dylib 0x3971dab7 start + 3\n\nThread 1:\n0 libsystem_kernel.dylib 0x397c1838 kevent64 + 24\n1 libdispatch.dylib 0x3970a623 _dispatch_mgr_thread + 39\n\nThread 2:\n0 libsystem_kernel.dylib 0x397d4c7c __workq_kernreturn + 8\n1 libsystem_pthread.dylib 0x39838cc4 start_wqthread + 8\n\nThread 3:\n0 libsystem_kernel.dylib 0x397d4c7c __workq_kernreturn + 8\n1 libsystem_pthread.dylib 0x39838cc4 start_wqthread + 8\n\nThread 4:\n0 libsystem_kernel.dylib 0x397d4c7c __workq_kernreturn + 8\n1 libsystem_pthread.dylib 0x39838cc4 start_wqthread + 8\n\nThread 5:\n0 libsystem_kernel.dylib 0x397c1a84 mach_msg_trap + 20\n1 CoreFoundation 0x2ee92559 __CFRunLoopServiceMachPort + 157\n2 CoreFoundation 0x2ee90c79 __CFRunLoopRun + 793\n3 CoreFoundation 0x2edfb471 CFRunLoopRunSpecific + 524\n4 CoreFoundation 0x2ee3f0db CFRunLoopRun + 98\n5 CoreMotion 0x2f4b3369 CLSF_thorntonUpdate_6x6 + 57225\n6 libsystem_pthread.dylib 0x3983ac5d _pthread_body + 141\n7 libsystem_pthread.dylib 0x3983abcf _pthread_start + 102\n8 libsystem_pthread.dylib 0x39838cd0 thread_start + 8\n\nThread 0 crashed with ARM Thread State:\n pc: 0x3921fb66 r7: 0x27d21618 sp: 0x27d215f4 r0: 0x17f82270 \n r1: 0x31c343d7 r2: 0x189d9e00 r3: 0x17d46730 r4: 0x189d9e00 \n r5: 0x00000338 r6: 0x17e0e340 r8: 0x39e43294 r9: 0x50000000 \n r10: 0x17d46730 r11: 0x000001d0 ip: 0x39d3e220 lr: 0x3177e315 \n cpsr: 0x20000030 \n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"20245244","answer_count":"1","comment_count":"0","creation_date":"2013-11-27 13:39:01.897 UTC","favorite_count":"1","last_activity_date":"2013-11-27 14:36:45.237 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"477641","post_type_id":"1","score":"6","tags":"ios|objective-c|crash|sigsegv","view_count":"10914"} +{"id":"4256833","title":"Pool/Billiards trig","body":"\u003cp\u003eok i am trying to get a pool game going in c#/java.\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003ccode\u003estart\u003c/code\u003e = back of pool cue(x,y)\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eend\u003c/code\u003e = front of pool cue(x,y)\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003ecircles\u003c/code\u003e = list of balls (x,y,r)\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eSo every time you move your mouse I update \u003ccode\u003estart\u003c/code\u003e, \u003ccode\u003eend\u003c/code\u003e and then I loop through `circles check if it intersects. Then this is my problem I need to figure out what will happen with ball if I hit it at the intersection point( will it go right up down).\u003c/p\u003e\n\n\u003cp\u003eHow will I do this. I looked at some examples on google but could only find example where they did it with vector and that way over my head....\u003c/p\u003e\n\n\u003cp\u003emy first thought was get the angle of the pool cue and from the circle mid point draw a line the same angle but for some reason that is wrong. It might be my \u003ccode\u003eGetEnd\u003c/code\u003e function\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public Point GetEnd(Point start, double angle, int len)\n {\n double y = start.Y + (len * Math.Sin(angle));\n double x = start.X + (len * Math.Cos(angle));\n\n return new Point((int)x, (int)y);\n }\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"4257401","answer_count":"1","comment_count":"3","creation_date":"2010-11-23 14:13:05.677 UTC","last_activity_date":"2010-11-23 15:06:00.04 UTC","last_edit_date":"2010-11-23 14:50:33.27 UTC","last_editor_display_name":"","last_editor_user_id":"106955","owner_display_name":"","owner_user_id":"106955","post_type_id":"1","score":"1","tags":"c#|java|trigonometry","view_count":"888"} +{"id":"45882528","title":"How to select all children (any level) and parents of a certain element with jQuery","body":"\u003cp\u003eI have an element \u003ccode\u003e#xxx\u003c/code\u003e and I have to select all children (any level) and all parent of this element. I dont want to select the element itself.\u003c/p\u003e\n\n\u003cp\u003eSo far I've been using this jquery code but I am pretty sure there must be a way to make this more efficiently (maybe using addBack):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(\"#xxx\").find(\"*\").add($(\"#xxx\").parents())\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eDo you suggest any other alternative that does not make use of \u003ccode\u003eadd()\u003c/code\u003e cause I think this selector is not efficient cause it queries internally again the #xxx. I think using \u003ccode\u003eaddBack()\u003c/code\u003e would be nicer cause it does not cause another search for the element #xxx. \u003c/p\u003e","accepted_answer_id":"45884380","answer_count":"1","comment_count":"6","creation_date":"2017-08-25 13:26:52.347 UTC","last_activity_date":"2017-08-25 15:06:07.527 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2934699","post_type_id":"1","score":"1","tags":"javascript|jquery","view_count":"44"} +{"id":"46582196","title":"(InvalidChangeBatch) when calling the ChangeResourceRecordSets operation - using boto3 to update resource record","body":"\u003cp\u003eI am trying to update a number of \u003ccode\u003eCNAME\u003c/code\u003e records to \u003ccode\u003eA\u003c/code\u003e hosted on Route53 using boto3, here is my function:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef change_resource_record(domain, zone_id, hosted_zone_id, balancer_id):\n print(domain, zone_id, hosted_zone_id, balancer_id)\n client.change_resource_record_sets(\n HostedZoneId=zone_id,\n ChangeBatch={\n \"Comment\": \"Automatic DNS update\",\n \"Changes\": [\n {\n \"Action\": \"UPSERT\",\n \"ResourceRecordSet\": {\n \"Name\": domain,\n \"Type\": \"A\",\n \"AliasTarget\": {\n \"HostedZoneId\": hosted_zone_id,\n \"DNSName\": balancer_id,\n \"EvaluateTargetHealth\": False\n }\n }\n },\n ]\n }\n )\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI get this error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eTraceback (most recent call last):\n File \"load_balancer.py\", line 138, in \u0026lt;module\u0026gt;\n get_balancer(domain)\n File \"load_balancer.py\", line 135, in get_balancer\n change_resource_record(domain, zone_id, hosted_zone_id, balancer_id)\n File \"load_balancer.py\", line 116, in change_resource_record\n \"EvaluateTargetHealth\": False\n File \"C:\\Python36\\lib\\site-packages\\botocore\\client.py\", line 312, in _api_call\n return self._make_api_call(operation_name, kwargs)\n File \"C:\\Python36\\lib\\site-packages\\botocore\\client.py\", line 601, in _make_api_call\n raise error_class(parsed_response, operation_name)\nbotocore.errorfactory.InvalidChangeBatch: An error occurred (InvalidChangeBatch) when calling the ChangeResourceRecordSets operation: RRSet of type A with DNS name suffix.domain.tld. is not permitted because a conflicting RRSet of type CNAME with the same DNS name already exists in zone domain.tld.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat is the correct way to update the record, should I delete the entry and then re-create it?\u003c/p\u003e\n\n\u003cp\u003eAny advice is much appreciated.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-10-05 09:29:13.823 UTC","last_activity_date":"2017-10-05 09:37:16.94 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"477340","post_type_id":"1","score":"0","tags":"python|python-3.x|boto3|amazon-route53","view_count":"49"} +{"id":"14289263","title":"Checking for duplicate username","body":"\u003cp\u003eI am doing a registration page, for my mobile app, and want to check for duplicate usernames entered by the user/client\u003c/p\u003e\n\n\u003cp\u003eI have a button on the page that when clicked, checks availability of the username. However I would like to also incorporate that automatically, if not already done so, when the client clicks submit/go to step 3, \nI want to perform the check for duplicate usernames using Ajax and if there exists a duplicate, then refresh the SAME page with the error message for duplication, else proceed to step 3.\u003c/p\u003e\n\n\u003cp\u003eIn my HTML file I have some js that does the following:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(\"#check-username\").click(function() {\n(...this works as I am able to click the CHECK button\nand see if the username exists)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have another js file, that is sourced in my HTML that does the following:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esubmitHandler : function() {\n $(\"#reg1\").hide();\n $(\"span#step\").html(\"2\");\n $(\"#check-username\").click;\n $(\"#reg3\").show();\n scrollTop();\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I click on Go to next step which is reg3, It does not do the validation for check-username. Is my method/syntax for calling check-username correct?\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2013-01-12 01:29:35.357 UTC","last_activity_date":"2013-01-12 05:47:57.42 UTC","last_edit_date":"2013-01-12 05:47:57.42 UTC","last_editor_display_name":"","last_editor_user_id":"249624","owner_display_name":"","owner_user_id":"1971376","post_type_id":"1","score":"0","tags":"javascript|jquery|ajax","view_count":"712"} +{"id":"7718565","title":"Reload specific page whenever it is visited?","body":"\u003cp\u003eI am trying to figure out the best way to reload a specific page when using the back button in xcode. Here is what I have right now\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e-(IBAction)backButton {\n [webView goBack];\n [webView reload];\n\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAll I want to have happen, is instead of refreshing every page when tapping the back button, I only want my local html to be refreshed, so something like\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e -(IBAction)backButton {\n [webView goBack];\n if (\"url matches localHTML\"){\n [webView reload];\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe localHTML that I want refreshed is only the homepage. I know the solution wouldn't be as simple as above, but I'm just trying to show you what I'm looking for. Thanks for your help.\u003c/p\u003e","accepted_answer_id":"7720434","answer_count":"1","comment_count":"2","creation_date":"2011-10-10 20:55:12.117 UTC","last_activity_date":"2011-10-11 01:19:00.647 UTC","last_edit_date":"2011-10-11 00:38:09.313 UTC","last_editor_display_name":"","last_editor_user_id":"873546","owner_display_name":"","owner_user_id":"873546","post_type_id":"1","score":"0","tags":"iphone|xcode|uiwebview|refresh|back","view_count":"428"} +{"id":"31139429","title":"TCPDF: PDF page size too big","body":"\u003cp\u003eI've set the 'PDF_PAGE_FORMAT' to A4, but every time I generate the PDF it's about 10 cm wider and 6 cm too big in height.\nThis issue also persists when I try to enter custom values, it creates a page that's bigger than I want it to be.\u003c/p\u003e\n\n\u003cp\u003eI have no idea where to look. I am trying to create an a4 sized pdf with an full a4 sized image on it, that's all. This is what I have so far.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003erequire_once('tcpdf_include.php');\n\n// create new PDF document\n$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);\n\n// set document information\n$pdf-\u0026gt;SetCreator(PDF_CREATOR);\n$pdf-\u0026gt;SetAuthor('Ernst Jacobs');\n$pdf-\u0026gt;SetTitle('TechniekMuseum HEIM Certificate');\n\n// set margins\n$pdf-\u0026gt;SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);\n$pdf-\u0026gt;SetHeaderMargin(PDF_MARGIN_HEADER);\n$pdf-\u0026gt;SetFooterMargin(PDF_MARGIN_FOOTER);\n\n// set image scale factor\n//$pdf-\u0026gt;setImageScale(PDF_IMAGE_SCALE_RATIO);\n$pdf-\u0026gt;setImageScale(1.53);\n\n// set JPEG quality\n$pdf-\u0026gt;setJPEGQuality(100);\n\n// ---------------------------------------------------------\n\n$pdf-\u0026gt;SetPrintHeader(false);\n$pdf-\u0026gt;SetPrintFooter(false);\n\n// add a page\n$pdf-\u0026gt;AddPage();\n\n$pdf-\u0026gt;Image('images/cert_rd_em.jpg');\n\n\n// ---------------------------------------------------------\n\n//Close and output PDF document\n$pdf-\u0026gt;Output($_SERVER['DOCUMENT_ROOT'].'tcpdf/examples/saves/certificate.pdf', 'I');\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"0","creation_date":"2015-06-30 13:20:36.27 UTC","last_activity_date":"2015-06-30 13:20:36.27 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1219075","post_type_id":"1","score":"1","tags":"pdf|tcpdf","view_count":"206"} +{"id":"39166571","title":"Executing wrong relationship vlaue in $args in wp_Query?","body":"\u003cp\u003ei am trying to fetch data form database for my custom plugin and post type. my query arguments should be like \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$args = array(\n 'post_type' =\u0026gt; 'products',\n 'post_status'=\u0026gt; 'publish',\n 'meta_query' =\u0026gt; array(\n 'relation' =\u0026gt; 'OR',\n array( 'key'=\u0026gt;'product_commercial',\n 'value'=\u0026gt;'on',\n 'compare'=\u0026gt;'=' \n ), \n array( 'key'=\u0026gt;'product_exterior',\n 'value'=\u0026gt;'on',\n 'compare'=\u0026gt;'=' \n )\n )\n);\n$search_query = new WP_Query( $args );\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut i am trying to add meta key values dynamically like :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$inner_arrays=array();\n$count = 0;\nforeach($values as $value){\nif($value){\n\n $inner_arrays[$count]['key'] .= $value;\n $inner_arrays[$count]['value'] .= 'on';\n $inner_arrays[$count]['compare'] .= '=';\n $count++;\n}\n}\n\n $args = array(\n 'post_type' =\u0026gt; 'products',\n 'post_status'=\u0026gt; 'publish',\n 'meta_query' =\u0026gt; array(\n 'relation' =\u0026gt; 'OR',\n $inner_arrays\n)\n);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e//values are some random values (say fetched from db).\u003c/p\u003e\n\n\u003cp\u003eNow when i print the query using \u003ccode\u003eecho \"\u0026lt;pre\u0026gt;Last SQL-Query: {$search_query-\u0026gt;request}\".'\u0026lt;br/\u0026gt;';\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eit displays\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Last SQL-Query: SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts INNER JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id ) INNER JOIN wp_postmeta AS mt1 ON ( wp_posts.ID = mt1.post_id ) INNER JOIN wp_postmeta AS mt2 ON ( wp_posts.ID = mt2.post_id ) WHERE 1=1 AND ( \n ( \n ( wp_postmeta.meta_key = 'product_commercial' AND CAST(wp_postmeta.meta_value AS CHAR) = 'on' ) \n **AND** \n ( mt1.meta_key = 'product_framed' AND CAST(mt1.meta_value AS CHAR) = 'on' ) \n **AND** \n ( mt2.meta_key = 'product_horizontal' AND CAST(mt2.meta_value AS CHAR) = 'on' )\n )\n) AND wp_posts.post_type = 'products' AND ((wp_posts.post_status = 'publish')) GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT 0, 10\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ePROBLEM: i am using \" \u003cstrong\u003erelation =\u003e OR\u003c/strong\u003e \", but getting \"\u003cstrong\u003eAND\u003c/strong\u003e\" in sql query. Where i am doing wrong?\u003c/p\u003e","accepted_answer_id":"39166976","answer_count":"1","comment_count":"0","creation_date":"2016-08-26 12:38:44.127 UTC","last_activity_date":"2016-08-26 13:01:14.7 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4148431","post_type_id":"1","score":"0","tags":"php|mysql|wordpress","view_count":"45"} +{"id":"5532038","title":"End user wants to add languages dynamically to his website","body":"\u003cp\u003eWe have to build an event registration website for our client in ASP.NET using C#.\nOne of the requirements is that the client wants to add new foreign languages to his website himself using en excel file. I know how to make a website multilingual in Visual Studio, but I have no idea how to generate a resource file based on an excel file in code.\nI also noticed VS generates a second file called Resource.en.designer.cs but I can't find any documentation how to generate that file either.\u003c/p\u003e\n\n\u003cp\u003ebtw, the enduser is anything but IT-related. He knows his way around excel though (obviously).\u003c/p\u003e\n\n\u003cp\u003eAny help is appreciated!\u003c/p\u003e\n\n\u003cp\u003eYoeri\u003c/p\u003e\n\n\u003cp\u003eEDIT:\n!Robert Levy Provided a good method!\nHOW TO:\u003c/p\u003e\n\n\u003cp\u003eSTEP 1:\nRead the excel file (using an OleDBAdapter was the best method for me, as you can use column headers etc)\nWrite the language to a txt file in this format:\nKEY=TRANSLATION\nno spaces or anything else\u003c/p\u003e\n\n\u003cp\u003eSTEP 2:\nLocate ResGen.exe on your computer (it comes with Visual Studio, so look somewhere like c:\\program files\\visual studio\\sdk... however I found it @ C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\Bin\\ResGen.exe)\u003c/p\u003e\n\n\u003cp\u003eSTEP 3:\u003c/p\u003e\n\n\u003cp\u003eInvoke the exe with Process.Start(\"resgen.exe\")\n\u003cem\u003ehint: use ProcesStartInfo for easy argument and preferences settings\u003c/em\u003e\u003c/p\u003e\n\n\u003cp\u003e(STEP 4:)\u003c/p\u003e\n\n\u003cp\u003eMove the file to your desired location (I find the App_GlobalResources works perfectly)\u003c/p\u003e\n\n\u003cp\u003eSTEP 5:\u003c/p\u003e\n\n\u003cp\u003eSet the user currentUIculture to your desired culture!\u003c/p\u003e","accepted_answer_id":"5532275","answer_count":"3","comment_count":"1","creation_date":"2011-04-03 19:50:30 UTC","favorite_count":"4","last_activity_date":"2011-04-25 11:47:55.24 UTC","last_edit_date":"2011-04-25 11:47:55.24 UTC","last_editor_display_name":"","last_editor_user_id":"690178","owner_display_name":"","owner_user_id":"690178","post_type_id":"1","score":"5","tags":"c#|asp.net-mvc-3|dynamic|localization|razor","view_count":"427"} +{"id":"16258755","title":"Visual Studio 2012 - Add multiple items on same writeline","body":"\u003cp\u003eOkay, so what i\"m doing is creating a word file with my application with my labels and \u003ccode\u003etextboxes\u003c/code\u003e to create a receipt. In my word file, I am trying to write what is in a first name \u003ccode\u003elabel\u003c/code\u003e beside what is in a last name \u003ccode\u003elabel\u003c/code\u003e. \u003c/p\u003e\n\n\u003cp\u003eHere is the code I have, but I just seem to be missing something, because the word file keeps putting a huge gap between the first name and last name. I'm sure it's a very simple fix, but Google doesn't seem to be helping with what I am trying to describe.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprintFile.WriteLine(\"Name: \" \u0026amp; vbTab \u0026amp; FirstNameTextBox.Text + LastNameTextBox.Text)\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"1","creation_date":"2013-04-28 01:53:36.397 UTC","last_activity_date":"2013-04-28 02:05:04.617 UTC","last_edit_date":"2013-04-28 02:04:55.633 UTC","last_editor_display_name":"","last_editor_user_id":"625952","owner_display_name":"","owner_user_id":"2296878","post_type_id":"1","score":"0","tags":"vba|visual-studio-2012","view_count":"80"} +{"id":"45799204","title":"Conditional Rendering a route","body":"\u003cp\u003eI am trying to render a route/component when two state are true, like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{!this.state.loading \u0026amp;\u0026amp; this.state.geocodeResults ?\n \u0026lt;Route path='/cost' component={(props) =\u0026gt; \u0026lt;CostContainer {...props} address={this.state.address}/\u0026gt;}/\u0026gt; : null }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd I have other routes defined in a route.js file:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eexport default (\n \u0026lt;BrowserRouter\u0026gt;\n \u0026lt;MainLayout\u0026gt;\n \u0026lt;Route exact path='/' component={Search} /\u0026gt;\n \u0026lt;Route exact path='/form' component={Form} /\u0026gt;\n \u0026lt;/MainLayout\u0026gt;\n \u0026lt;/BrowserRouter\u0026gt;\n);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut the component dont render and all I get is null, I am using react router dom v4. Am I using it the wrong way? \u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2017-08-21 14:08:05.337 UTC","last_activity_date":"2017-08-21 14:08:05.337 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"592638","post_type_id":"1","score":"0","tags":"javascript|react-router-v4|react-router-dom","view_count":"39"} +{"id":"30404305","title":"Why is the `Arr-Disable-Session-Affinity` header coming through on my Azure Web App (WebSite)?","body":"\u003cp\u003eFollowing the procedure in \u003ca href=\"http://azure.microsoft.com/blog/2013/11/18/disabling-arrs-instance-affinity-in-windows-azure-web-sites/\" rel=\"noreferrer\"\u003ethis article\u003c/a\u003e I disabled the ARR Affinity cookie on my Azure Web App with this header in my responses:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eArr-Disable-Session-Affinity: True\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt \u003cem\u003edoes\u003c/em\u003e remove the cookie, which is very much a good thing. But, the header itself is still coming through. This header doesn't really hurt anything, but according to that same doc it shouldn't be there:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eIf you add the Arr-Disable-Session-Affinity header to disable the affinity cookie, ARR will not set the cookie, but \u003cstrong\u003eit will also remove the Arr-Disable-Session-Affinity header itself,\u003c/strong\u003e so if your process is working correctly, you will see neither.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eSo...how do I get it to remove the header, too?\u003c/p\u003e","answer_count":"2","comment_count":"5","creation_date":"2015-05-22 19:15:00.793 UTC","favorite_count":"1","last_activity_date":"2015-08-23 08:28:02.59 UTC","last_edit_date":"2015-05-26 01:43:54.59 UTC","last_editor_display_name":"","last_editor_user_id":"29","owner_display_name":"","owner_user_id":"29","post_type_id":"1","score":"7","tags":"azure|azure-web-sites","view_count":"1610"} +{"id":"1596301","title":"Why doesn't .NET have a bidirectional enumerator?","body":"\u003cp\u003eIt's been asked a couple of times on SO how you can implement a bidirectional enumerator (\u003ca href=\"https://stackoverflow.com/questions/191788/two-directional-list-enumerator-in-net\"\u003ehere\u003c/a\u003e, \u003ca href=\"https://stackoverflow.com/questions/451099/implementing-a-bidirectional-enumerator-in-c\"\u003ehere\u003c/a\u003e). My question is not \u003cem\u003ehow\u003c/em\u003e (which is trivial for most cases), but \u003cem\u003ewhy\u003c/em\u003e no such type exists in the .NET platform.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic interface IBidirectionalEnumerator\u0026lt;T\u0026gt; : IEnumerator\u0026lt;T\u0026gt;\n{\n bool MovePrev();\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eObviously, there are many collection types which can't implement this, as \u003ccode\u003eMoveNext()\u003c/code\u003e is destructive or changes the state of the underlying collection. But conversely, many types \u003cem\u003ecan\u003c/em\u003e implement this trivially (\u003ccode\u003eList\u003c/code\u003e, \u003ccode\u003eIList\u003c/code\u003e, \u003ccode\u003eLinkedList\u003c/code\u003e, \u003ccode\u003earray\u003c/code\u003e).\u003c/p\u003e\n\n\u003cp\u003eWhy does no such type exist?\u003c/p\u003e","accepted_answer_id":"1596358","answer_count":"6","comment_count":"5","creation_date":"2009-10-20 17:59:22.277 UTC","favorite_count":"1","last_activity_date":"2013-03-02 19:31:55.26 UTC","last_edit_date":"2017-05-23 12:22:59.84 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"8078","post_type_id":"1","score":"9","tags":"c#|.net|ienumerator|enumerators","view_count":"1653"} +{"id":"16241112","title":"Conditional jQuery plugin call","body":"\u003cp\u003eIt might be a stupid question but I am not very up to date with some JavaScript techniques and I am wondering which would be the way to deal with jQuery plugins and their respective calls. \u003c/p\u003e\n\n\u003cp\u003eIf I am calling a plugin in a JavaScript file when I am not actually importing it, I get an error like this:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eUncaught TypeError: Object [object Object] has no method 'tipsy' \u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eIs there any way to avoid these kind of errors in the case I don't want to use the plugin even I am calling it?\u003c/p\u003e\n\n\u003cp\u003eIn many cases I am using one only \u003ccode\u003e.js\u003c/code\u003e file in which I call many jQuery plugins but in some pages they are used and the elements or selectors they are using, they don't either exist. \u003c/p\u003e\n\n\u003cp\u003eI conditionally load or not the plugins depending on whether I am gonna use them or not, but my own \u003ccode\u003e.js\u003c/code\u003e file still having calls to them. (like if they were not used functions inside a JS file)\u003c/p\u003e\n\n\u003cp\u003eI have done it sometimes checking if the selector exist and then calling the pluging:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eif($('.listWrap').length){\n //call the the plugin\n $('.listWrap').tipsy(....); \n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut it doesn't look too good and can become bigger when using many plugins with many different selectors.\u003c/p\u003e\n\n\u003cp\u003eWhich is the correct way to deal with this? Thanks.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-04-26 16:29:28.18 UTC","last_activity_date":"2013-04-26 16:37:55.863 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1081396","post_type_id":"1","score":"0","tags":"jquery|jquery-plugins|javascript","view_count":"68"} +{"id":"12454644","title":"Android RatingBar - a complete mess","body":"\u003cp\u003eI know this is going to sound ranty, but it just feels like Android's UI components and behaviours are off the wall sometimes.\u003c/p\u003e\n\n\u003cp\u003eConsider the following XML:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\nandroid:layout_width=\"fill_parent\"\nandroid:layout_height=\"wrap_content\"\nandroid:orientation=\"horizontal\" \u0026gt;\n\n \u0026lt;RatingBar\n android:id=\"@+id/ratingBar1\"\n android:style=\"@android:style/Widget.Holo.Light.RatingBar.Small\"\n android:progress=\"3\"\n android:max=\"5\"\n android:numStars = \"5\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\" /\u0026gt;\n\n\n\u0026lt;/LinearLayout\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eScreenshots of how that would look on different device sizes:\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/toiAv.png\" alt=\"Nexus S rating bar\"\u003e\nNexus S rating bar\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/uDXRs.png\" alt=\"Tablet rating bar\"\u003e\nTablet rating bar\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/0IowB.png\" alt=\"Small Device rating bar\"\u003e\nSmall Device rating bar\u003c/p\u003e\n\n\u003cp\u003eEven though it's only in the preview tool, I can confirm that's actually how it looks on the devices.\u003c/p\u003e\n\n\u003cp\u003eThe small device behaviour is maddening. How does a RatingBar that specifies 5 stars only get 3 displayed, why not scale down the stars to fit in the window? \u003c/p\u003e\n\n\u003cp\u003eThinking the wrap_content width was the issue, I switched to layout_width=\"fill_parent\" and that didn't change the look on a small device, but it completely messed up on Tablets (so much for \"numStars\" of 5):\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/t0mEv.png\" alt=\"Tablet with fill_parent for width\"\u003e\u003c/p\u003e\n\n\u003cp\u003eMy question is, is there a way to get proper behaviour for the RatingBar in terms of sizing? You would think the numStars or max would be sufficient but it's completely arbitrary. When the RatingBar is stretched so that it draws more stars, it adds stars and see how with a progress of 3, it draws it according to the number of stars displayed? It doesn't make sense not to adhere to numStars!\u003c/p\u003e\n\n\u003cp\u003eIf there is no way to get logical performance from the RatingBar, are there any alternatives including 3rd party widgets? If not, I guess I could always draw 5 ImageViews and just rig it to perform accordingly.\u003c/p\u003e\n\n\u003cp\u003e(Keep in mind all this behaviour was exhibited with just one RatingBar in the layout - forget trying to size with other widgets/components, or utilizing your own styles. I know it's been done, but why is this the default behavior?)\u003c/p\u003e","accepted_answer_id":"38749855","answer_count":"1","comment_count":"4","creation_date":"2012-09-17 07:15:55.733 UTC","favorite_count":"4","last_activity_date":"2016-08-20 04:51:02.94 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1176436","post_type_id":"1","score":"6","tags":"android|android-layout|android-ui","view_count":"1605"} +{"id":"30272311","title":"Objective-C to Swift: NSScreen","body":"\u003cp\u003eI'm learning Swift. As a test, I'm translating some of my old Objective-C programs to swift. But I have a crazy error: In Objective-C I have the following code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e- (CGSize)makeSizeFromCentimetersWidth: (CGFloat)width andY: (CGFloat)height {\n\n NSScreen *screen = [NSScreen mainScreen];\n NSDictionary *description = [screen deviceDescription];\n NSSize displayPixelSize = [[description objectForKey:NSDeviceSize] sizeValue];\n CGSize displayPhysicalSize = CGDisplayScreenSize([[description objectForKey:@\"NSScreenNumber\"] unsignedIntValue]);\n\n CGFloat resolution = (displayPixelSize.width / displayPhysicalSize.width) * 25.4f;\n CGFloat pixelsWidth = 0.394 * width * resolution;\n CGFloat pixelsHeight = 0.394 * height * resolution;\n\n return CGSizeMake(pixelsWidth, pixelsHeight);\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn swift I have translated to this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunc makeSizeFromCentimeters(width: CGFloat, height: CGFloat) -\u0026gt; CGSize {\n\n var screen: NSScreen = NSScreen.mainScreen()!\n\n var description: NSDictionary = screen.deviceDescription\n var displayPixelSize: NSSize = description.objectForKey(NSDeviceSize)!.sizeValue\n var displayPhysicalSize: CGSize = CGDisplayScreenSize(description.objectForKey(\"NSScreenNumber\")!.unsignedIntValue)\n var resolution = (displayPixelSize.width / displayPhysicalSize.width) * 25.4\n\n var pixelsWidth: CGFloat = 0.394 * width * resolution\n var pixelsHeight: CGFloat = 0.394 * height * resolution\n\n return CGSizeMake(pixelsWidth, pixelsHeight)\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn Objective-C the code does what it should: Calculate a size from centimeters to pixels, to give out (in my case) an NSImageView with exactly the size of the given centimeters. But in Swift, the returned size, is always 0:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eNSLog(\"%f\", makeSizeFromCentimeters(2, height: 2).width)\nNSLog(\"%f\", makeSizeFromCentimeters(2, height: 2).height)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs there an translating error? Which variable is 0? (No idea why it should be 0 if it's not caused by a variable).\u003c/p\u003e\n\n\u003cp\u003eThank you for your help!\u003c/p\u003e","answer_count":"0","comment_count":"5","creation_date":"2015-05-16 05:50:56.533 UTC","last_activity_date":"2015-05-16 05:50:56.533 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4561066","post_type_id":"1","score":"1","tags":"objective-c|xcode|swift|cocoa","view_count":"414"} +{"id":"26383778","title":"Spread load evenly by using ‘H * * * *’ rather than ‘5 * * * *’","body":"\u003cp\u003eWhen setting up how Jenkins shoul pull changes from subversion\nI tried checked Poll SCM and set schedule to \u003ccode\u003e5 * * * *\u003c/code\u003e, I get the following warning\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eSpread load evenly by using ‘H * * * *’ rather than ‘5 * * * *’\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI'm not sure what H means in this context and why I should use that.\u003c/p\u003e","accepted_answer_id":"26384110","answer_count":"2","comment_count":"0","creation_date":"2014-10-15 13:25:53.357 UTC","favorite_count":"4","last_activity_date":"2016-02-23 00:26:01.353 UTC","last_edit_date":"2014-10-15 14:20:42.387 UTC","last_editor_display_name":"","last_editor_user_id":"1324345","owner_display_name":"","owner_user_id":"2098749","post_type_id":"1","score":"48","tags":"jenkins|build|continuous-integration","view_count":"17801"} +{"id":"45384429","title":"How to execute a python script in a different directory?","body":"\u003cp\u003e\u003cstrong\u003eSolved\u003c/strong\u003e see my answer below for anyone who might find this helpful.\u003c/p\u003e\n\n\u003cp\u003eI have two scripts a.py and b.py.\nIn my current directory \"C:\\Users\\MyName\\Desktop\\MAIN\", I run \u003e python a.py.\u003c/p\u003e\n\n\u003cp\u003eThe first script, a.py runs in my current directory, does something to a bunch of files and creates a new directory (testA) with the edited versions of those files which are simultaneously moved into that new directory. Then I need to run b.py for the files in testA.\u003c/p\u003e\n\n\u003cp\u003eAs a beginner, I would just copy and paste my b.py script into testA and execute the command again \"\u003e python b.py\", which runs some commands on those new files and creates another folder (testB) with those edited files.\u003c/p\u003e\n\n\u003cp\u003eI am trying to eliminate the hassle of waiting for a.py to finish, move into that new directory, paste b.py, and then run b.py. I am trying to write a bash script that executes these scripts while maintaining my hierarchy of directories.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#!/usr/bin/env bash\n python a.py \u0026amp;\u0026amp; python b.py\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eScript a.py runs smoothly, but b.py does not execute at all. There are no error messages coming up about b.py failing, I just think it cannot execute because once a.py is done, b.py does not exist in that NEW directory.\nIs there a small script I can add within b.py that moves it into the new directory? I actually tried changing b.py directory paths as well but it did not work.\u003c/p\u003e\n\n\u003cp\u003eFor example in b.py:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emydir = os.getcwd() # would be the same path as a.py\nmydir_new = os.chdir(mydir+\"\\\\testA\")\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI changed mydirs to mydir_new in all instances within b.py, but that also made no difference...I also don't know how to move a script into a new directory within bash.\u003c/p\u003e\n\n\u003cp\u003eAs a little flowchart of the folders:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eMAIN # main folder with unedited files and both a.py and b.py scripts\n|\n| (execute a.py)\n|\n--------testA # first folder created with first edits of files\n |\n | (execute b.py)\n |\n --------------testB # final folder created with final edits of files\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eTLDR: How do I execute a.py and b.py from the main test folder (bash script style?), if b.py relies on files created and stored in testA. Normally I copy and paste b.py into testA, then run b.py - but now I have 200+ files so copying and pasting is a waste of time.\u003c/p\u003e","accepted_answer_id":"45384591","answer_count":"4","comment_count":"3","creation_date":"2017-07-29 01:40:16.607 UTC","last_activity_date":"2017-07-29 03:14:13.3 UTC","last_edit_date":"2017-07-29 02:15:17.083 UTC","last_editor_display_name":"","last_editor_user_id":"7811354","owner_display_name":"","owner_user_id":"7811354","post_type_id":"1","score":"0","tags":"python|bash|python-2.7","view_count":"997"} +{"id":"28818868","title":"When packet drop occurs in a link with VoIP and TCP working concurrently?","body":"\u003cp\u003eLet's assume TCP Reno version\u003c/p\u003e\n\n\u003cp\u003eI have this situation: a VoIP (UDP) stream and a TCP session on the same host.\nLet's say at t=10s the TCP opens the session with the TCP receiver (another host), they exchanges the max window during the \u003cstrong\u003e3-way handshake\u003c/strong\u003e and then they start the stream with the \u003cstrong\u003eslow start\u003c/strong\u003e approach.\u003c/p\u003e\n\n\u003cp\u003eAt t=25s, a VoIP stream starts. Since it's an UDP stream, the aim is to saturate the receiver. Not having any congestion control, it should be bursting packets as much as it can.\u003c/p\u003e\n\n\u003cp\u003eSince there is this concurrency in the same channel and we are assuming that in the topology of the network no router goes down etc (so no anomalies), my question is:\n\u003cstrong\u003eIs there any way for achieve packet loss for the VoIP stream?\u003c/strong\u003e \u003c/p\u003e\n\n\u003cp\u003eI was thinking that since VoIP is sensible to jitter, and the slow-start approach of TCP is not really slow, the packet loss could be achieved because the routers queues add variation of delay and they are \"flooded\" by the TCP early packets.\u003c/p\u003e\n\n\u003cp\u003eIs there any other reason?\u003c/p\u003e","accepted_answer_id":"28819659","answer_count":"1","comment_count":"0","creation_date":"2015-03-02 20:27:16.403 UTC","last_activity_date":"2015-03-03 18:22:25.523 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3058020","post_type_id":"1","score":"0","tags":"networking|tcp|udp|voip|packet-loss","view_count":"84"} +{"id":"40426867","title":"How can I get all triples contained in a SPARUL INSERT Data statement without writing my own parser?","body":"\u003cp\u003eI'm searching for a method to extract all triples that are contained in a SPARQL Update \u003ccode\u003eINSERT DATA\u003c/code\u003e string. Of course it would be possible to write an own parser for \u003ccode\u003eINSERT DATA\u003c/code\u003e statements but if possible, I want to avoid that. \u003c/p\u003e\n\n\u003cp\u003eFor example, there could be an update that looks similar to this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eInsert Data {\n\u0026lt;http://test.com/example/book1\u0026gt; \u0026lt;http://test.com/example/hasTitle\u0026gt; \u0026lt;http://test.com/TestTitle1\u0026gt; . \n\u0026lt;http://test.com/example/book2\u0026gt; \u0026lt;http://test.com/example/hasTitle\u0026gt; \u0026lt;http://test.com/example/TestTitle2\u0026gt; .\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs there a library that delivers subject, predicate, and object for those two triples? My overall goal is to have an \u003ccode\u003eArrayList\u003c/code\u003e that contains the triples. In the best case, the method should also work with prefixes.\u003c/p\u003e\n\n\u003cp\u003eThank you in advance.\u003c/p\u003e","accepted_answer_id":"40429752","answer_count":"1","comment_count":"2","creation_date":"2016-11-04 15:50:58.393 UTC","last_activity_date":"2016-11-04 18:40:43.137 UTC","last_edit_date":"2016-11-04 18:39:49.623 UTC","last_editor_display_name":"","last_editor_user_id":"241164","owner_display_name":"","owner_user_id":"4026654","post_type_id":"1","score":"0","tags":"java|sparql|ontology","view_count":"27"} +{"id":"35845508","title":"Password protect specific pretty URLs in .htaccess","body":"\u003cp\u003eI need to password protect many pretty URLs in \u003ccode\u003e.htaccess\u003c/code\u003e via \u003ccode\u003e.htpasswd\u003c/code\u003e. But I want different user/login for each of the many protected pretty URLs (and a general login for pages not specifically protected).\u003c/p\u003e\n\n\u003cp\u003eSo, for example, I'd like to protect: \u003c/p\u003e\n\n\u003cp\u003eWith a specific user/password:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ehttp://www.example.com/pretty/url\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWith another user/password:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ehttp://www.example.com/pretty/link\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWith a generic user/password (all of the others)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ehttp://www.example.com/pretty/generic\nhttp://www.example.com/pretty/all\nhttp://www.example.com/pretty/\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI was trying to use the code from \u003ca href=\"https://stackoverflow.com/questions/14603568/password-protect-a-specific-url\"\u003ethis answer\u003c/a\u003e, which I found the most fitting to my needs: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e# Do the regex check against the URI here, if match, set the \"require_auth\" var\nSetEnvIf Request_URI ^/pretty/url require_auth=true\n\n# Auth stuff\nAuthUserFile /var/www/htpasswd\nAuthName \"Password Protected\"\nAuthType Basic\n\n# Setup a deny/allow\nOrder Deny,Allow\n# Deny from everyone\nDeny from all\n# except if either of these are satisfied\nSatisfy any\n# 1. a valid authenticated user\nRequire valid-user\n# or 2. the \"require_auth\" var is NOT set\nAllow from env=!require_auth\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt works very well with a single pretty URL. But I wasn't able to find a way to adapt this to many URLs each of them with a different user via \u003ccode\u003ehtpasswd\u003c/code\u003e. \u003c/p\u003e","answer_count":"1","comment_count":"11","creation_date":"2016-03-07 13:51:54.537 UTC","last_activity_date":"2016-03-07 14:09:25.557 UTC","last_edit_date":"2017-05-23 11:59:44.71 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"1284186","post_type_id":"1","score":"0","tags":"apache|.htaccess|.htpasswd","view_count":"316"} +{"id":"41555268","title":"Xcode is not pulling the new files from git","body":"\u003cp\u003eI have my project in git and we are 2 programmers working in the project. User B using (xcode 8.2.1) added some files and pushed to remote.\nUser A using (xcode 8.0) also added some files committed changes clicked to pull it went through with out any messages, but the new files created by user B are not pulled. \nUser A tried to push and this message shows up: \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e\"The local repository is out of date. Make sure all changes have been pulled from remote repository and try again\"\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eHow can I fix this problem?\u003c/p\u003e","accepted_answer_id":"41555556","answer_count":"1","comment_count":"1","creation_date":"2017-01-09 19:15:22.3 UTC","last_activity_date":"2017-01-10 01:48:43.407 UTC","last_edit_date":"2017-01-10 01:48:43.407 UTC","last_editor_display_name":"","last_editor_user_id":"563394","owner_display_name":"","owner_user_id":"3126427","post_type_id":"1","score":"0","tags":"xcode|git","view_count":"261"} +{"id":"2796550","title":"JavaScript: Given an offset and substring length in an HTML string, what is the parent node?","body":"\u003cp\u003eMy current project requires locating an array of strings within an element's text content, then wrapping those matching strings in \u003ccode\u003e\u0026lt;a\u0026gt;\u003c/code\u003e elements using JavaScript (requirements simplified here for clarity). I need to avoid jQuery if at all possible - at least including the full library.\u003c/p\u003e\n\n\u003cp\u003eFor example, given this block of HTML:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div\u0026gt;\n \u0026lt;p\u0026gt;This is a paragraph of text used as an example in this Stack Overflow\n question.\u0026lt;/p\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand this array of strings to match:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e['paragraph', 'example']\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI would need to arrive at this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div\u0026gt;\n \u0026lt;p\u0026gt;This is a \u0026lt;a href=\"http://www.example.com/\"\u0026gt;paragraph\u0026lt;/a\u0026gt; of text used\n as an \u0026lt;a href=\"http://www.example.com/\"\u0026gt;example\u0026lt;/a\u0026gt; in this Stack\n Overflow question.\u0026lt;/p\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI've arrived at a solution to this by using the \u003ccode\u003einnerHTML()\u003c/code\u003e method and some string manipulation - basically using the offsets (via \u003ccode\u003eindexOf()\u003c/code\u003e) and lengths of the strings in the array to break the HTML string apart at the appropriate character offsets and insert \u003ccode\u003e\u0026lt;a href=\"http://www.example.com/\"\u0026gt;\u003c/code\u003e and \u003ccode\u003e\u0026lt;/a\u0026gt;\u003c/code\u003e tags where needed.\u003c/p\u003e\n\n\u003cp\u003eHowever, an additional requirement has me stumped. I'm not allowed to wrap any matched strings in \u003ccode\u003e\u0026lt;a\u0026gt;\u003c/code\u003e elements if they're already in one, or if they're a descendant of a heading element (\u003ccode\u003e\u0026lt;h1\u0026gt;\u003c/code\u003e to \u003ccode\u003e\u0026lt;h6\u0026gt;\u003c/code\u003e).\u003c/p\u003e\n\n\u003cp\u003eSo, given the same array of strings above and this block of HTML (the term matching has to be case-insensitive, by the way):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div\u0026gt;\n \u0026lt;h1\u0026gt;Example\u0026lt;/a\u0026gt;\n \u0026lt;p\u0026gt;This is a \u0026lt;a href=\"http://www.example.com/\"\u0026gt;paragraph of text\u0026lt;/a\u0026gt; used\n as an example in this Stack Overflow question.\u0026lt;/p\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI would need to disregard both the occurrence of \"Example\" in the \u003ccode\u003e\u0026lt;h1\u0026gt;\u003c/code\u003e element, and the \"paragraph\" in \u003ccode\u003e\u0026lt;a href=\"http://www.example.com/\"\u0026gt;paragraph of text\u0026lt;/a\u0026gt;\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eThis suggests to me that I have to determine which node each matched string is in, and then traverse its ancestors until I hit \u003ccode\u003e\u0026lt;body\u0026gt;\u003c/code\u003e, checking to see if I encounter a \u003ccode\u003e\u0026lt;a\u0026gt;\u003c/code\u003e or \u003ccode\u003e\u0026lt;h_\u0026gt;\u003c/code\u003e node along the way.\u003c/p\u003e\n\n\u003cp\u003eFirstly, does this sound reasonable? Is there a simpler or more obvious approach that I've failed to consider? It doesn't seem like regular expressions or another string-based comparison to find bounding tags would be robust - I'm thinking of issues like self-closing elements, irregularly nested tags, etc. There's also \u003ca href=\"https://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454\"\u003ethis\u003c/a\u003e...\u003c/p\u003e\n\n\u003cp\u003eSecondly, is this possible, and if so, how would I approach it?\u003c/p\u003e","accepted_answer_id":"2796702","answer_count":"2","comment_count":"0","creation_date":"2010-05-09 04:02:28.62 UTC","last_activity_date":"2010-05-09 05:24:00.62 UTC","last_edit_date":"2017-05-23 10:33:16.693 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"167911","post_type_id":"1","score":"4","tags":"javascript|regex|string","view_count":"683"} +{"id":"15084171","title":"Does SQL INSERT involve any read/write lock?","body":"\u003cp\u003eThis is an extremely simple question, but i really can't find any useful answer on Google.\u003c/p\u003e\n\n\u003cp\u003eI've been reading that there's a READ LOCK on SELECT, and WRITE LOCK on UPDATE statements. However, i'm trying to find out if there's any kind of LOCK when we INSERT into a table?\u003c/p\u003e\n\n\u003cp\u003eThe assumption is that the table is using InnoDB as the engine.\u003c/p\u003e","answer_count":"3","comment_count":"0","creation_date":"2013-02-26 08:03:03.67 UTC","favorite_count":"1","last_activity_date":"2013-02-26 08:24:53.377 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1140233","post_type_id":"1","score":"0","tags":"mysql|insert|locking","view_count":"194"} +{"id":"26347938","title":"Implementations of the «syntax» flex using tools flex and bison","body":"\u003cp\u003eI'm having problems with the subject. I need to implement the syntax tools flex. For this I wrote Context-free grammar. Here is a sample of the kind of examples that I should be able to handle:\u003c/p\u003e\n\n\u003cp\u003e№1:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eRname 0|1\nString1 {Rname}{Rname}*(111)\nString2 {Rname}{Rname}*(000)\n%%\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e№2:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e%%\nRname 0|1\nString1 {Rname}{Rname}*(111)\nString2 {Rname}{Rname}*(000)\n%%\n{String1} {return 1;}\n{String2} {return 1;}\n%%\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e№3:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eName [a-zA-Z][a-zA-Z0-9]*\nWords [a-zA-Z0-9]*\n%%\n{Identifier} {return AP_Name;}\n{Words} {return AP_Words;}\n%%\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe most complex example, which takes into account all of the options:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eA \"abc\" | \"cba\"\nB \"qwe\"\nC 111\nD rty* | rty+\nE ({C | D})*\n%%\n{String1} {return 1;}\n{String2} {return 1;}\n\n{A} {return AP_A;}\n{B} {return AP_B;}\n{C} {return AP_C;}\n{D} {return AP_D;}\n{E} {return AP_E;}\n%%\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have a file for flex as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e%option noyywrap\n%option yylineno\n%option never-interactive\n%{\n#include \u0026lt;stdio.h\u0026gt;\n#include \"bison.tab.h\"\n%}\n\n%%\n[a-zA-Z][a-zA-Z0-9]* {return AP_Name;}\n[a-zA-Z0-9]* {return AP_Words;}\n\n\\( {return AP_Bracket_open1;}\n\\) {return AP_Bracket_close1;}\n\n\\[ {return AP_Bracket_open2;}\n\\] {return AP_Bracket_close2;}\n\n\\{ {return AP_Bracket_open3;}\n\\} {return AP_Bracket_close3;}\n\n\\+ {return AP_Plus;}\n\\* {return AP_Multiply;}\n\\ '|' {return AP_Or;}\n'%%' {return AP_Percentage;}\n\\; {return AP_Semicolon;}\n\\- {return AP_Dash;}\n\\\" {return AP_Quote;}\n%%\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd there is a file for bison as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e%{\n#include \u0026lt;stdio.h\u0026gt;\nextern int yylineno;\nvoid yyerror(char const *msg)\n{\n fprintf(stderr, \"%d: %s\\n\", yylineno, msg);\n}\nint yyparse();\n#define YYPRINT(file, type, value) fprintf(file, \"%d\", value);\n%}\n%token AP_Name\n%token AP_Words\n%token AP_Bracket_open1\n%token AP_Bracket_close1\n%token AP_Bracket_open2\n%token AP_Bracket_close2\n%token AP_Bracket_open3\n%token AP_Bracket_close3\n%token AP_Plus\n%token AP_Multiply\n%token AP_Or\n%token AP_Percentage\n%token AP_Semicolon\n%token AP_Dash\n%token AP_Quote\n%%\nS : Block1 AP_Percentage Block2 AP_Percentage;\n\nIdentifier : AP_Name | AP_Words;\n\nBlock1 : AP_Name Patern Block1 | ;\nPatern : Regex | Regex Patern;\n\nRegex : Value Plurality /* abc* */ /* abc+ */\n | AP_Bracket_open1 Value AP_Bracket_close1 Plurality /* [abc] */ /* [abc]* */ /* [abc]+ */\n | AP_Bracket_open2 Value AP_Bracket_close2 Plurality /* (abc) */ /* (abc)* */ /* (abc)+ */\n | AP_Bracket_open3 Value AP_Bracket_close3 Plurality; /* {abc} */ /* {abc}* */ /* {abc}+ */\n\nPlurality : AP_Plus | AP_Multiply |; /* + * */\n\nValue : Identifier /* abc */\n | AP_Quote Identifier AP_Quote /* \"abc\" */\n | Identifier AP_Or Identifier /* abc | cba*/\n | Identifier AP_Dash Identifier; /*abc - cba*/\n\nBlock2 : AP_Bracket_open3 Identifier AP_Bracket_close3 /* {abc} */\n | AP_Bracket_open3 Identifier AP_Bracket_close3 AP_Bracket_open3 Identifier AP_Bracket_close3 /* {abc}{abc} */\n |\n ;\n%%\nextern FILE *yyin;\nint main()\n{\n yydebug=1;\n yyin = fopen(\"test.txt\",\"r\");\n if (yyparse() != 0)\n return 0;\n else\n {\n printf(\"Success\\n\");\n return 0;\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAt work I use the following set of parameters:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eflex lex.l\nbison bison.y -d -t\ncc lex.yy.c bison.tab.c bison.tab.h\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow I'm trying to process my first example, and at the end I have the following error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eReducing stack by rule 4 (line 31):\n $1 = token AP_Name (0)\n $2 = nterm Patern ()\n $3 = nterm Block1 ()\n-\u0026gt; $$ = nterm Block1 ()\nStack now 0\nEntering state 3\nNow at end of input.\n1: syntax error\nError: popping nterm Block1 ()\nStack now 0\nCleanup: discarding lookahead token $end (0)\nStack now 0\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eDo I understand correctly that the bison want to read the end of the file, it see the end of the file and at the same time off with an error that the end of the file read failed? \nGrammar itself is not yet unfinished (not sure I know how to finish it), but I want it work at least at this stage.\u003cbr\u003e\nAnd sorry for my English.\u003c/p\u003e\n\n\u003ch1\u003eUPD:\u003c/h1\u003e\n\n\u003cp\u003eI found a rule that resulted in an error - it Block1: AP_Name Patern Block1 |;\nWhen I try to rewrite the grammar, I got this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e%token AP_Name\n%token AP_Word\n%token AP_Percentage\n%token AP_Plus\n%token AP_Or\n%token AP_Multiply\n%token AP_Bracket_open1\n%token AP_Bracket_close1\n%token AP_Bracket_open2\n%token AP_Bracket_close2\n%token AP_Bracket_open3\n%token AP_Bracket_close3\n%token AP_Dash\n%token AP_Quote\n%%\nS : Block1 AP_Percentage Block2 AP_Percentage;\n\nIdentifier : AP_Word | AP_Name;\n\nBlock1 : AP_Name Regex Block1 | ;\n\nRegex : BracketO Regex\n | Identifier AP_Or Regex /* a|b */\n | Identifier Regex\n | Identifier Plurality Regex /* abc+ or abc* */\n | AP_Quote Identifier AP_Quote /* \"abc\" */\n |\n ;\n\nBracketO : AP_Bracket_open1 Class BracketC Plurality BracketO /* (abc) */\n | AP_Bracket_open2 Class BracketC Plurality BracketO /* [abc] */\n | AP_Bracket_open3 AP_Name AP_Bracket_close3 Plurality BracketO /* {abc} */\n |\n ;\n\nBracketC : AP_Dash Class BracketC /* [a-b] */\n | AP_Or Class BracketC /* [a|b] or (a|b) */\n | AP_Bracket_close1 /* ((abc)) */\n | AP_Bracket_close2; /* [[abc]] */\n\nPlurality : AP_Multiply | AP_Plus | ; /* * + */\n\nClass : Identifier | BracketO; /* ({Rname}) */\n\nBlock2 : AP_Bracket_open3 Identifier AP_Bracket_close3 /* {abc} */\n | AP_Bracket_open3 Identifier AP_Bracket_close3 AP_Bracket_open3 Identifier AP_Bracket_close3 /* {abc} {cba} */\n |\n ;\n%%\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI don’t like it, BUT it works whit 36 conflict shift/reduce. (this is what I wrote in the comment)\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2014-10-13 19:58:11.19 UTC","last_activity_date":"2014-12-23 16:40:42.2 UTC","last_edit_date":"2014-10-14 19:48:56.527 UTC","last_editor_display_name":"","last_editor_user_id":"4138840","owner_display_name":"","owner_user_id":"4138840","post_type_id":"1","score":"1","tags":"bison|yacc|flex-lexer|lex","view_count":"123"} +{"id":"8747025","title":"Xcode add search to root view in splitviewcontroller","body":"\u003cp\u003eI have a nib structure as shown in this image:\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/HRc4M.png\" alt=\"nib\"\u003e\u003c/p\u003e\n\n\u003cp\u003eIs there a way to add a Search bar in the Root VC? When I try to drag one in, it doesn't seem to like it... \u003c/p\u003e","accepted_answer_id":"8747156","answer_count":"1","comment_count":"0","creation_date":"2012-01-05 17:39:05.33 UTC","last_activity_date":"2012-01-05 17:47:42.28 UTC","last_edit_date":"2012-01-05 17:42:35.817 UTC","last_editor_display_name":"","last_editor_user_id":"253056","owner_display_name":"","owner_user_id":"542019","post_type_id":"1","score":"0","tags":"xcode|xcode4|ios5|uisplitviewcontroller|uisearchbar","view_count":"544"} +{"id":"37285708","title":"Iteratively Creating Pandas Panel and Joining/Adding/Concatenating each iteration to Panel being Iteratively Created?","body":"\u003cp\u003eThe other post I saw related to this topic involved using HDFStore which threw me off - I apologize if this is a redundant post. \nLet's say I have a list N of SQL type queries I would like to perform, where each output produces an individual panel. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eN = [get_something(), get_something_else()...]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eA single instance of run_query(get_something()) produces a panel that looks like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e_panel = run_query(get_something())\n\n\u0026lt;class 'pandas.core.panel.Panel'\u0026gt;\nDimensions: 1 (items) x 36 (major_axis) x 283 (minor_axis)\nItems axis: shares_outstanding to shares_outstanding\nMajor_axis axis: 2015-07-30 00:00:00+00:00 to 2015-10-07 00:00:00+00:00\nMinor_axis axis: Equity(2 [AA]) to Equity(49463 [KLDX])\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I try to iteratively build a panel using join or add, I get a variety of errors or blank output..\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efor item in N:\n _panel.join(run_query(item))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI guess what I am looking to do is to create and append to a panel just like a list.\u003c/p\u003e","answer_count":"0","comment_count":"5","creation_date":"2016-05-17 20:28:39.067 UTC","favorite_count":"0","last_activity_date":"2016-05-17 20:32:28.107 UTC","last_edit_date":"2016-05-17 20:32:28.107 UTC","last_editor_display_name":"","last_editor_user_id":"190597","owner_display_name":"","owner_user_id":"5960761","post_type_id":"1","score":"0","tags":"python|pandas|join|add|panel","view_count":"49"} +{"id":"22312180","title":"Unity parenting and deparenting game objects","body":"\u003cp\u003eI'm currently implementing a wall climbing system into my 2D game and I'm stuck on a few of the trickier parts. \u003c/p\u003e\n\n\u003cp\u003eMy thinking is that I would have my player parent to the wall object when it collides with the 2D collider attached. When the player collides with the wall, the player becomes a child of that wall and is limited to only moving up and down on the wall. When the player jumps, or reaches the top, they are no longer a child of the wall. But the player has the ability to jump on any point onto the wall they land on and stays at that point. \u003c/p\u003e\n\n\u003cp\u003eRight now I have the parenting part worked out with the following code (this code is attached to the player):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evoid OnCollisionEnter2D(Collision2D collision)\n{\n if(collision.gameObject.tag == \"Wall\")\n {\n this.transform.parent = collision.transform;\n Debug.Log(\"hit a wall\");\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe two areas I'm struggling with are de parenting my player from the wall and having the player still to the position on the wall where they land. \u003c/p\u003e\n\n\u003cp\u003eWith the first part (de-parenting) I believe I'll need to make use of the following code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evoid OnCollisionExit2D(Collision2D collision)\n{\n\n if(collision.gameObject.tag == null)\n {\n this.transform.parent = null;\n Debug.Log(\"not hitting anythin\");\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, when I run this, my player doesn't deparent right away. Am I doing it correctly? \u003c/p\u003e\n\n\u003cp\u003eI'm also clueless as to how to begin my other problem of having the player stick to the part of the wall they connect with. Can someone please help me with my issues?\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2014-03-10 21:56:23.973 UTC","last_activity_date":"2016-01-03 16:07:01.627 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1170993","post_type_id":"1","score":"0","tags":"c#|unity3d","view_count":"1233"} +{"id":"13675113","title":"Given the angle and x, how can I find Y?","body":"\u003cp\u003eGiven the angle and x, how can I find Y? For example, if angle = 45 and x = 480, y = 480. How can I compute this?\u003c/p\u003e","accepted_answer_id":"13675155","answer_count":"1","comment_count":"0","creation_date":"2012-12-02 23:24:29.91 UTC","last_activity_date":"2012-12-03 03:29:24.34 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"982270","post_type_id":"1","score":"-2","tags":"math|trigonometry","view_count":"1212"} +{"id":"19177839","title":"background connection through service","body":"\u003cp\u003ebecause of my inexperience in Android, I can no longer continue with programming, I have a application with a fragment and a tab, in the settings where you set the ip address and port, will be the way and the application begins to send data in the background, but every time I change tab must send certain data, I can not create the service that will allow me this. Can you help?\nPS: the connection is via socket\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2013-10-04 09:31:10.613 UTC","last_activity_date":"2013-10-04 09:37:59.55 UTC","last_edit_date":"2013-10-04 09:37:59.55 UTC","last_editor_display_name":"","last_editor_user_id":"1846558","owner_display_name":"","owner_user_id":"2699088","post_type_id":"1","score":"0","tags":"android|sockets|service|fragment","view_count":"52"} +{"id":"39430322","title":"get element in recursive function","body":"\u003cp\u003eI am trying to use protractor to get text from several pages, however the recursion seems not working...\u003c/p\u003e\n\n\u003cp\u003eThe idea is:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003egetText() from elements with the same \"name\"\u003c/li\u003e\n\u003cli\u003epush the text into an array\u003c/li\u003e\n\u003cli\u003ebrowser.wait until the push is completed, and then check if the next page button is enable.\u003c/li\u003e\n\u003cli\u003eIf enabled, go to the next page, and call the function again (keep pushing text in the next page to the array).\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eThe codes are (coffeescript):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e # define function getMyList\n getMyList = (CL, CLTemp) -\u0026gt;\n console.log \"In function\"\n tabs = element.all(By.css \"[name='some selector']\").map((elm) -\u0026gt; elm.getText())\n tabs.then((text) -\u0026gt; \n CL.push text\n return)\n\n browser.wait(-\u0026gt;\n CL.length != CLTemp.length).then -\u0026gt;\n console.log CL.length\n nextPage = element(By.css \"[title='Next Page']\")\n # hasClass is a function determining if the button is enabled or not\n return hasClass(\"[title='Next Page']\", 'disabled').then (class_found) -\u0026gt;\n if class_found\n console.log CL\n return CL\n else\n console.log \"Enabled\"\n CLTemp = CL\n # scroll down to the button\n browser.executeScript(\"arguments[0].scrollIntoView();\", nextPage.getWebElement()).then -\u0026gt;\n nextPageGo = element(By.css \"[title='Next Page'] span[class=ng-binding]\")\n nextPageGo.click().then -\u0026gt; \n getMyList (CL, CLTemp)\n return\n return\n return\n\n\n # Run the function. myList = [] and myListTemp = []\n getMyList (myList, myListTemp)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe results print:\u003c/p\u003e\n\n\u003cblockquote\u003e\n\u003cpre\u003e\u003ccode\u003eIn function\n1\nEnabled\nIn function\n\u003c/code\u003e\u003c/pre\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eMeaning it can run to the first recursion (i.e., goes to the next page), but stops at getting text of second page?\u003c/p\u003e\n\n\u003cp\u003eI've scratched my head for two days but still cannot figure out why the recursion is not working... \u003c/p\u003e\n\n\u003cp\u003eI am new to protractor. It will be great if I can get some hints!! Thank you very much.\u003c/p\u003e","answer_count":"0","comment_count":"8","creation_date":"2016-09-10 20:29:08.867 UTC","favorite_count":"1","last_activity_date":"2016-09-11 02:15:30.953 UTC","last_edit_date":"2016-09-11 02:15:30.953 UTC","last_editor_display_name":"","last_editor_user_id":"6802619","owner_display_name":"","owner_user_id":"6802619","post_type_id":"1","score":"1","tags":"javascript|recursion|coffeescript|protractor","view_count":"203"} +{"id":"28030598","title":"Composer custom repositories local AND remote","body":"\u003cp\u003eWe are using custom repositories that are not held on Packagist, and thus need to use composer's \"repositories\" key:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n \"type\": \"vcs\",\n \"url\": \"https://github.com/name/repo\"\n},\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever we also want to develop these locally before pushing them to GitHub\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n \"type\": \"vcs\",\n \"url\": \"/path/to/repo\"\n},\n{\n \"type\": \"vcs\",\n \"url\": \"https://github.com/name/repo\"\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever if a new user downloads the repo and just wants to use from GitHub (maybe they won't be developing locally) they get a big red error:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e[InvalidArgumentException]\u003cbr\u003e\n No driver found to handle VCS repository /path/to/dir\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eIs there a way that composer can tolerate this and just move down to the next line where it will find the repo?\u003c/p\u003e","accepted_answer_id":"28032691","answer_count":"1","comment_count":"0","creation_date":"2015-01-19 17:44:38.16 UTC","last_activity_date":"2016-07-27 10:19:01.38 UTC","last_edit_date":"2016-07-27 10:19:01.38 UTC","last_editor_display_name":"","last_editor_user_id":"4846659","owner_display_name":"","owner_user_id":"518703","post_type_id":"1","score":"0","tags":"composer-php|build-tools","view_count":"1196"} +{"id":"8978706","title":"Filtering DropDownList would not work","body":"\u003cp\u003eI have several DropDownList in my website, and they are filtering each other.\u003c/p\u003e\n\n\u003cp\u003eSo, I have a school, based on that I have classes, and inside of that classes I have students. Each one has its own table on the DB, and it's generated from a table that has all the IDs.\u003c/p\u003e\n\n\u003cp\u003eI dont know why, but I can filter the classes from the school, but the students DropdownList wouldn't be affected by the filter.\u003c/p\u003e\n\n\u003cp\u003eThis is my code :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;li\u0026gt;School \u0026lt;/li\u0026gt;\n\u0026lt;li\u0026gt;\n \u0026lt;asp:DropDownList ID=\"SchoolBox\" runat=\"server\" AutoPostBack=\"True\" \n DataSourceID=\"DropDownlistSchool\" DataTextField=\"SchoolName\" \n DataValueField=\"ID\"\u0026gt;\n \u0026lt;/asp:DropDownList\u0026gt; \n \u0026lt;asp:SqlDataSource ID=\"DropDownlistSchool\" runat=\"server\" \n ConnectionString=\"\u0026lt;%$ ConnectionStrings:DanielConnectionString %\u0026gt;\" \n SelectCommand=\"SELECT [SchoolName], [ID] FROM [Schools]\"\u0026gt;\n \u0026lt;/asp:SqlDataSource\u0026gt;\n\u0026lt;/li\u0026gt;\n\u0026lt;li\u0026gt;Class\u0026lt;/li\u0026gt;\n\u0026lt;li\u0026gt;\n \u0026lt;asp:DropDownList ID=\"ClassBox\" runat=\"server\" AutoPostBack=\"True\" \n DataSourceID=\"Class2\" DataTextField=\"ClassName\" DataValueField=\"ID\"\u0026gt;\n \u0026lt;/asp:DropDownList\u0026gt;\n\n \u0026lt;asp:SqlDataSource ID=\"Class2\" runat=\"server\" \n ConnectionString=\"\u0026lt;%$ ConnectionStrings:DanielConnectionString %\u0026gt;\" \n SelectCommand=\"SELECT * FROM [Class] WHERE ([SchoolID] = @SchoolID)\"\u0026gt;\n \u0026lt;SelectParameters\u0026gt;\n \u0026lt;asp:ControlParameter ControlID=\"SchoolBox\" Name=\"SchoolID\" \n PropertyName=\"SelectedValue\" Type=\"Int32\" /\u0026gt;\n \u0026lt;/SelectParameters\u0026gt;\n \u0026lt;/asp:SqlDataSource\u0026gt;\n\n\u0026lt;/li\u0026gt;\n\u0026lt;li\u0026gt;Student\u0026lt;/li\u0026gt;\n\u0026lt;li\u0026gt;\n \u0026lt;asp:DropDownList ID=\"StudentBox\" runat=\"server\" AutoPostBack=\"True\" \n DataSourceID=\"Student\" DataTextField=\"Username\" DataValueField=\"ID\"\u0026gt;\n \u0026lt;/asp:DropDownList\u0026gt;\n \u0026lt;asp:SqlDataSource ID=\"Student\" runat=\"server\" \n ConnectionString=\"\u0026lt;%$ ConnectionStrings:DanielConnectionString %\u0026gt;\" \n\n SelectCommand=\"SELECT * FROM [Users] WHERE (([ClassID] = @ClassID) AND ([SchoolID] = @SchoolID))\"\u0026gt;\n \u0026lt;SelectParameters\u0026gt;\n \u0026lt;asp:ControlParameter ControlID=\"ClassBox\" Name=\"ClassID\" \n PropertyName=\"SelectedValue\" Type=\"Int32\" /\u0026gt;\n \u0026lt;asp:ControlParameter ControlID=\"SchoolBox\" Name=\"SchoolID\" \n PropertyName=\"SelectedValue\" Type=\"Int32\" /\u0026gt;\n \u0026lt;/SelectParameters\u0026gt;\n \u0026lt;/asp:SqlDataSource\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"8980414","answer_count":"3","comment_count":"4","creation_date":"2012-01-23 21:17:10.047 UTC","favorite_count":"0","last_activity_date":"2012-04-17 17:21:00.21 UTC","last_edit_date":"2012-01-23 21:48:24.203 UTC","last_editor_display_name":"","last_editor_user_id":"782754","owner_display_name":"","owner_user_id":"1054375","post_type_id":"1","score":"2","tags":"asp.net|sql-server","view_count":"705"} +{"id":"26816770","title":"Append to XML structure in python","body":"\u003cp\u003eI would like to change/add a custom subelement to an xml which was generated by my script.\u003c/p\u003e\n\n\u003cp\u003eThe top element is AAA:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etop = Element('AAA')\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe collected_lines looks like this: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[['TY', ' RPRT'], ['A1', ' Peter'], ['T3', ' Something'], ['ER', ' ']]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThen I enumerate all lines one-by-one and create a SubElement for \u003ccode\u003etop\u003c/code\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efor line in enumerate(collected_lines):\n child = SubElement(top, line[0])\n child.text = line[1]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOutput:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" ?\u0026gt;\n\u0026lt;AAA\u0026gt;\n \u0026lt;TY\u0026gt; RPRT\u0026lt;/TY\u0026gt;\n \u0026lt;A1\u0026gt; Peter\u0026lt;/A1\u0026gt;\n \u0026lt;T3\u0026gt; Something\u0026lt;/T3\u0026gt;\n \u0026lt;ER\u0026gt; \u0026lt;/ER\u0026gt;\n \u0026lt;TY\u0026gt; RPRT2\u0026lt;/TY\u0026gt;\n \u0026lt;A1\u0026gt; Peter\u0026lt;/A1\u0026gt;\n \u0026lt;T3\u0026gt; Something2\u0026lt;/T3\u0026gt;\n \u0026lt;ER\u0026gt; \u0026lt;/ER\u0026gt;\n \u0026lt;TY\u0026gt; RPRT2\u0026lt;/TY\u0026gt;\n \u0026lt;A1\u0026gt; Peter\u0026lt;/A1\u0026gt;\n \u0026lt;T3\u0026gt; Something2\u0026lt;/T3\u0026gt;\n \u0026lt;ER\u0026gt; \u0026lt;/ER\u0026gt;\n\u0026lt;/AAA\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd I would like to add \u003ccode\u003e\u0026lt;ART\u0026gt;\u003c/code\u003e element to the \u003ccode\u003etop\u003c/code\u003e element and then print the xml like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" ?\u0026gt;\n\u0026lt;AAA\u0026gt;\n \u0026lt;ART\u0026gt;\n \u0026lt;TY\u0026gt; RPRT\u0026lt;/TY\u0026gt;\n \u0026lt;A1\u0026gt; Peter\u0026lt;/A1\u0026gt;\n \u0026lt;T3\u0026gt; Something\u0026lt;/T3\u0026gt;\n \u0026lt;ER\u0026gt; \u0026lt;/ER\u0026gt;\n \u0026lt;/ART\u0026gt;\n \u0026lt;ART\u0026gt;\n \u0026lt;TY\u0026gt; RPRT2\u0026lt;/TY\u0026gt;\n \u0026lt;A1\u0026gt; Peter\u0026lt;/A1\u0026gt;\n \u0026lt;T3\u0026gt; Something2\u0026lt;/T3\u0026gt;\n \u0026lt;ER\u0026gt; \u0026lt;/ER\u0026gt;\n \u0026lt;/ART\u0026gt;\n \u0026lt;ART\u0026gt;\n \u0026lt;TY\u0026gt; RPRT2\u0026lt;/TY\u0026gt;\n \u0026lt;A1\u0026gt; Peter\u0026lt;/A1\u0026gt;\n \u0026lt;T3\u0026gt; Something2\u0026lt;/T3\n \u0026lt;/ART\u0026gt;\n\u0026lt;/AAA\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm tried to do it with an if statemant. Like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eif \"TY\" in line:\n \"append somehow before TY element, \u0026lt;ART\u0026gt;\"\nif \"ER\" in line:\n \"append somehow after ER element, \u0026lt;/ART\u0026gt;\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs there a simple way to solve this?\u003c/p\u003e","accepted_answer_id":"26816923","answer_count":"1","comment_count":"0","creation_date":"2014-11-08 11:44:53.14 UTC","last_activity_date":"2015-02-10 23:28:41.183 UTC","last_edit_date":"2015-02-10 23:28:41.183 UTC","last_editor_display_name":"user4228556","last_editor_user_id":"3204551","owner_display_name":"user4228556","post_type_id":"1","score":"1","tags":"python|xml","view_count":"47"} +{"id":"23839867","title":"How to configure Windows Azure as an Identity Provider with Oauth 2.0","body":"\u003cp\u003eI want to use Azure as an identity provider for a third party service provider(SP). My question is\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003e\u003cp\u003eHow can I generate the client ID and Client secret with respect to the SP. (Please note that my SP is not an application, but another IDP which will be an SP to Azure since the scenario I'm try out is Multi Factor Authentication )\u003c/p\u003e\n\n\u003cp\u003ewebapp ----\u003e Third party IDP(Acts as a SP to Azure) ------\u003e Windows Azure\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eHow can I get the public key of Azure? \u003c/p\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eAny help appreciated. \u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-05-23 23:50:27.89 UTC","favorite_count":"1","last_activity_date":"2014-05-25 01:22:05.147 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1247219","post_type_id":"1","score":"2","tags":"azure|oauth-2.0|azure-active-directory","view_count":"6435"} +{"id":"1415113","title":"Suggestions on storing passwords in database","body":"\u003cp\u003eHere's the situation - its a bit different from the other database/password questions on StackOverflow.com\u003c/p\u003e\n\n\u003cp\u003eI've got two sets of users. One are the \"primary\" users. The others are the \"secondary\" users. Every one has a login/password to my site (say mysite.com - that isn't important).\u003c/p\u003e\n\n\u003cp\u003eBackground: Primary users have access to a third site (say www.something.com/PrimaryUser1). Every secondary user \"belongs\" to a primary user and wants access to a subpart of that other site (say www.something.com/PrimaryUser1/SecondaryUser1).\u003c/p\u003e\n\n\u003cp\u003eAt mysite.com, the primary users have to provide their credentials to me which they use to access www.something.com/PrimaryUser1, and they specify which \"subparts\" the secondary users of their choice get get access to. \u003c/p\u003e\n\n\u003cp\u003eMysite.com helps manage the sub-access of the secondary users to the primary user's site. The secondary users can't \"see\" their primary user's password, but through my site, they can access the \"subparts\" of the other site - but ONLY to their restricted subpart.\u003c/p\u003e\n\n\u003cp\u003eIn a crude way, I'm implementing OAuth (or something like that).\u003c/p\u003e\n\n\u003cp\u003eThe question here is - how should I be storing the primary user's credentials to the other site? The key point here is that mysite.com uses these credentials to provide access to the secondary users, so it MUST be able to read it. However, I want to store it in such a way, that the primary users are reassured that I (as the site owner) cannot read their credentials.\u003c/p\u003e\n\n\u003cp\u003eI suppose this is more of a theoretical approach question. Is there anything in the world of cryptography that can help me with this?\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003eText added:\u003c/p\u003e\n\n\u003cp\u003eSince most ppl are completely missing the question, here's attempt #2 at explaining it.\u003c/p\u003e\n\n\u003cp\u003ePrimaryUser1 has a username/password to www.something.com/PrimaryUser1Site\u003c/p\u003e\n\n\u003cp\u003eHe wishes to give sub-access to two people- SecondaryUser1 and SecondaryUser2 to the folders- www.something.com/PrimaryUser1Site/SecondaryUser1 and www.something.com/PrimaryUser1Site/SecondaryUser2\u003c/p\u003e\n\n\u003cp\u003eMysite.com takes care of this sub-user management, so PrimaryUser1 goes there and provides his credentials to Mysite.com. MySite.com internally uses the credentials provided by PrimaryUser1 to give subusers limited access. Now, SecondaryUser1 and SecondaryUser2 can access their respective folders on www.something.com/PrimaryUser1Site through the MySite.com\u003c/p\u003e\n\n\u003cp\u003eNOW, the question arises, how should I store the credentials that PrimaryUser1 has provided?\u003c/p\u003e","accepted_answer_id":"1415580","answer_count":"8","comment_count":"0","creation_date":"2009-09-12 13:23:57.417 UTC","last_activity_date":"2009-09-18 01:32:27.783 UTC","last_edit_date":"2009-09-12 16:18:52.413 UTC","last_editor_display_name":"","last_editor_user_id":"135152","owner_display_name":"","owner_user_id":"128500","post_type_id":"1","score":"0","tags":"sql|encryption|cryptography|oauth|passwords","view_count":"547"} +{"id":"46401366","title":"ggplot2 bar chart sign on y-axis","body":"\u003cp\u003eI have the following data :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emydata \u0026lt;- data.frame(x = c(\"UK1\", \"UK2\", \"UK3\", \"UK4\", \"UK5\", \"UK6\", \"UK7\"), \n n = c(50, 55, 58, 64, 14, 18, 45), \n F = c(-6, 17, 26, -37, 44, -22, 15), \n z = c(\"a\", \"a\", \"b\", \"a\" , \"b\", \"b\", \"a\"))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to create a ggplot (bar chart) of column x (x axis) against column n (y-axis) colour split by column z. The tricky part is I want to bar chart to be going up the way if the value in F is positive and down the way if negative. Is this possible with ggplot?\u003c/p\u003e","accepted_answer_id":"46404776","answer_count":"3","comment_count":"1","creation_date":"2017-09-25 09:03:25.39 UTC","last_activity_date":"2017-09-25 12:03:25.09 UTC","last_edit_date":"2017-09-25 12:03:25.09 UTC","last_editor_display_name":"","last_editor_user_id":"1286528","owner_display_name":"","owner_user_id":"8491385","post_type_id":"1","score":"2","tags":"r|ggplot2|bar-chart","view_count":"69"} +{"id":"16172355","title":"apex retrieve default item value","body":"\u003cp\u003eIs it possible to get default item value using plsql? I have a validation and in case it fails I want to reset item to its default value.\nI tried using \u003ccode\u003eapex_util.set_session_state('P_ITEM_NAME', null)\u003c/code\u003e but that did not have any noticeable effect.\u003c/p\u003e\n\n\u003cp\u003eHow can default item be retrieved or item itself be reset?\u003c/p\u003e","answer_count":"3","comment_count":"0","creation_date":"2013-04-23 14:44:30.737 UTC","last_activity_date":"2013-04-25 07:15:15.15 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"471149","post_type_id":"1","score":"1","tags":"oracle|oracle11g|oracle-apex","view_count":"2139"} +{"id":"24925727","title":"What is the bundle seed id for an iOS app?","body":"\u003cp\u003eIn order to share keychain information between applications, we needed to setup a shared keychain access group.\nBefore the sharing would work correctly, both apps needed to have provisioning based on the same bundle seed ID.\nI wants to know what is that seed id is it same as app id or different ?\u003c/p\u003e\n\n\u003cp\u003eTwo share keychain information my both apps should be on the appstore. Because I just make an sample project to check sharing of keychain information. Is it possible to do that without publishing it to Appstore?\u003c/p\u003e\n\n\u003cp\u003eNote :- My bundle id is just \"com.comapny_name.myapp\" and in Itunes connect I am able to see only my app id - (10 digit number) and bundle id which is same as I mentioned above.\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2014-07-24 05:25:51.307 UTC","favorite_count":"1","last_activity_date":"2014-08-26 17:57:52.917 UTC","last_edit_date":"2014-08-26 17:28:05.99 UTC","last_editor_display_name":"","last_editor_user_id":"1257001","owner_display_name":"","owner_user_id":"1257001","post_type_id":"1","score":"4","tags":"ios|app-store|itunesconnect|keychain|keychainitemwrapper","view_count":"4300"} +{"id":"23219351","title":"php - array - Illegal string offset","body":"\u003cp\u003eI am trying to display single value from array of values.\nIf I use \u003ccode\u003eprint_r($arr)\u003c/code\u003e it shows this values \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n \"a\": 14,\n \"b\": 3,\n \"c\": 61200,\n \"d\": [\n \"2014-04-22 12:00:06\",\n \"2014-04-23 12:00:06\",\n \"2014-04-24 12:00:06\"\n ]\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut when I tried to use \u003ccode\u003eecho $arr-\u0026gt;a\u003c/code\u003e and \u003ccode\u003e$arr['a']\u003c/code\u003e.\nIt shows \u003ccode\u003eillegal string offset 'a'\u003c/code\u003e.\nHow to get single value from array of values?\u003c/p\u003e","accepted_answer_id":"23219416","answer_count":"5","comment_count":"1","creation_date":"2014-04-22 12:18:20.22 UTC","last_activity_date":"2014-04-22 13:10:05.307 UTC","last_edit_date":"2014-04-22 12:20:23.367 UTC","last_editor_display_name":"","last_editor_user_id":"2893413","owner_display_name":"","owner_user_id":"2990754","post_type_id":"1","score":"0","tags":"php|arrays","view_count":"86"} +{"id":"15330945","title":"Display jQuery dialog before posting form to action method","body":"\u003cp\u003eI have a basic form. When the user submits a form, I'd like a jQuery dialog to display that asks the user if they're sure they want to continue.\u003c/p\u003e\n\n\u003cp\u003eHere's what I have:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;script type=\"text/javascript\"\u0026gt;\n $(document).ready(function () {\n $(\"#dialog-confirm\").dialog({\n autoOpen: false,\n modal: true,\n buttons: {\n \"Continue\": function () {\n // continue and post data to action method\n },\n \"Cancel\": function () {\n // close dialog and do nothing\n }\n }\n });\n }); \n\u0026lt;/script\u0026gt;\n\n@using (Html.BeginForm(\"Index\", \"Members\", FormMethod.Get))\n{\n Name: @Html.TextBox(\"searchName\")\n \u0026lt;input value=\"Submit\" type=\"submit\" /\u0026gt;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut I don't know how to hook the dialog into the form submission. Does anyone know how to do that?\u003c/p\u003e","accepted_answer_id":"15331032","answer_count":"4","comment_count":"0","creation_date":"2013-03-11 03:54:30.773 UTC","last_activity_date":"2013-04-04 17:51:06.757 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"295302","post_type_id":"1","score":"1","tags":"jquery|asp.net|asp.net-mvc","view_count":"1633"} +{"id":"40546813","title":"Does background thread run on lower priority than foreground thread?","body":"\u003cp\u003eDoes background thread run on lower priority than foreground thread even though their \u003ccode\u003eThread.Priority\u003c/code\u003e is set to same value?\u003c/p\u003e\n\n\u003cp\u003eConsider code below: -\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eThread threadFG = new Thread(MyMethod);//foreground thread\n\nThread threadBG = new Thread(MyMethod);//background thread\nthreadBG.IsBackground = true;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWill there be a difference in performance? Note that I am using default priority for both the threads.\u003c/p\u003e\n\n\u003cp\u003eLot many articles on web including MSDN say that background thread will automatically destroy on application exit which is not the case with foreground thread. Lot many questions on StackOverflow say the same. But I do not found a resource that talk about performance difference between two.\u003c/p\u003e\n\n\u003cp\u003eJust because background thread, will that thread run slower than foreground thread?\u003c/p\u003e","accepted_answer_id":"40547111","answer_count":"1","comment_count":"2","creation_date":"2016-11-11 11:15:29.15 UTC","last_activity_date":"2016-11-11 11:32:31.537 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5779732","post_type_id":"1","score":"0","tags":"c#|.net|multithreading","view_count":"216"} +{"id":"7004576","title":"Can I send a SelectList through the UIHint Control Parameters?","body":"\u003cp\u003eCan I send a SelectList through a Data Annotation? Something like...\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[UIHint(\"DropDownList\", \"\", new SelectList(new[] {\"one\",\"two\",\"three\"}))]\npublic virtual int? OptionID { get; set; }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI don't understand the syntax but this seems possible. If so, how do I access it from an editor template?\u003c/p\u003e\n\n\u003cp\u003eIf not, how could I dynamically send a SelectList to a DropDownList Editor Template? I specifically would like to avoid making a separate template for every SelectList - I have too many of them. Thanks\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT:\u003c/strong\u003e I'm working on the second option (Reflection) because I thought it might be more direct than overriding that 15-syllable monster, the DataAnnotationsModelMetadataProvider.\u003c/p\u003e","accepted_answer_id":"7004688","answer_count":"1","comment_count":"0","creation_date":"2011-08-10 00:18:29.103 UTC","favorite_count":"1","last_activity_date":"2011-08-10 13:11:31.583 UTC","last_edit_date":"2011-08-10 13:11:31.583 UTC","last_editor_display_name":"","last_editor_user_id":"850990","owner_display_name":"","owner_user_id":"850990","post_type_id":"1","score":"1","tags":"asp.net-mvc|asp.net-mvc-3|data-annotations|selectlist|mvc-editor-templates","view_count":"2942"} +{"id":"39681136","title":"JavaScript convert not safe integer in scientific notation to string","body":"\u003cp\u003eI have one API for generate a random map tileset with a Erlang server, with safe integer JavaScript can request to API good but the problem is when is more than \u003ccode\u003eNumber.MAX_SAFE_INTEGER\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eThen, in the server I haven't the integer becuse JavaScript send \u003ccode\u003e1e+21\u003c/code\u003e number in scientific notation, not \u003ccode\u003e999999999999999999999\u003c/code\u003e and I need the number like string not in scientific notation.\u003c/p\u003e\n\n\u003cp\u003eHow can I get a string like \u003ccode\u003e\"999999999999999999999\"\u003c/code\u003e in JavaScript for send to API that and not scientific notation string? Exists a library for arbitrary long numbers in JavaScript small only for the number? The umber is a X and Y number of position and need the correct position, and not is good a big library because need good performance for render the map in ms, is for a game in browser, not for astronomy calc.\u003c/p\u003e","accepted_answer_id":"39732627","answer_count":"3","comment_count":"19","creation_date":"2016-09-24 21:28:08.88 UTC","last_activity_date":"2016-09-27 19:16:11.787 UTC","last_edit_date":"2016-09-24 22:12:35.653 UTC","last_editor_display_name":"","last_editor_user_id":"2006656","owner_display_name":"","owner_user_id":"2006656","post_type_id":"1","score":"-1","tags":"javascript","view_count":"113"} +{"id":"35828936","title":"Bootstrap dropdown-menu is not working","body":"\u003cp\u003eHello my bootstrap \u003ccode\u003enav\u003c/code\u003e is not dropping down into different sections like I've seen it in examples on multiple sites. I've tried moving things around but to no avail. I feel like I'm missing something very simple though so any input would be much obliged :D\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;!DOCTYPE html\u0026gt;\n\u0026lt;html\u0026gt;\n\n\u0026lt;head\u0026gt;\n \u0026lt;link rel=\"stylesheet\" type=\"text/css\" href=\"/styles/style.css\"\u0026gt;\n \u0026lt;link rel=stylesheet type=\"text/css\" href=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css\"\u0026gt;\n \u0026lt;title\u0026gt;Personal Portfolio\u0026lt;/title\u0026gt;\n\u0026lt;/head\u0026gt;\n\n\u0026lt;body\u0026gt;\n\n \u0026lt;nav class=\"navbar navbar-inverse\"\u0026gt;\n \u0026lt;div class=\"container\"\u0026gt;\n \u0026lt;div class=\"navbar-header\"\u0026gt;\n \u0026lt;a class=\"navbar-brand\" href=\"#\"\u0026gt;WebSiteName\u0026lt;/a\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;ul class=\"nav navbar-nav\"\u0026gt;\n \u0026lt;li class=\"active\"\u0026gt;\u0026lt;a href=\"#\"\u0026gt;Home\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li class=\"dropdown\"\u0026gt;\n \u0026lt;a class=\"dropdown-toggle\" data-toggle=\"dropdown\" href=\"#\"\u0026gt;Page 1\n \u0026lt;span class=\"caret\"\u0026gt;\u0026lt;/span\u0026gt;\u0026lt;/a\u0026gt;\n \u0026lt;ul class=\"dropdown-menu\"\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#\"\u0026gt;Page 1-1\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#\"\u0026gt;Page 1-2\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#\"\u0026gt;Page 1-3\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n \u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#\"\u0026gt;Page 2\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#\"\u0026gt;Page 3\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/nav\u0026gt;\n\n \u0026lt;footer\u0026gt;\n \u0026lt;/footer\u0026gt;\n\n\u0026lt;/body\u0026gt;\n\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAN EXAMPLE :D\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://jsfiddle.net/pajdnLwv/\" rel=\"nofollow\"\u003ehttps://jsfiddle.net/pajdnLwv/\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"35829059","answer_count":"3","comment_count":"2","creation_date":"2016-03-06 15:46:13.7 UTC","favorite_count":"0","last_activity_date":"2017-09-04 18:52:41.087 UTC","last_edit_date":"2016-03-06 15:50:24.643 UTC","last_editor_display_name":"","last_editor_user_id":"5701828","owner_display_name":"","owner_user_id":"5701828","post_type_id":"1","score":"0","tags":"html|twitter-bootstrap","view_count":"3127"} +{"id":"6707669","title":"Unique id for user account in a machine(system user account)?","body":"\u003cp\u003eThere are various ways to identify a system's unique id using Mac address, CPU id, motherboard id etc.\u003c/p\u003e\n\n\u003cp\u003eBut is there any unique id to identify system's user account other than hostname or username?\u003c/p\u003e\n\n\u003cp\u003eAnd the same or equivalent identifier needs to be available in windows,ubuntu and mac osx.\u003c/p\u003e\n\n\u003cp\u003e-mathan\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2011-07-15 13:24:59.653 UTC","last_activity_date":"2011-07-16 07:30:20.923 UTC","last_edit_date":"2011-07-16 07:26:43.223 UTC","last_editor_display_name":"","last_editor_user_id":"846522","owner_display_name":"","owner_user_id":"846522","post_type_id":"1","score":"0","tags":"cpu|uniqueidentifier|mac-address","view_count":"176"} +{"id":"8040068","title":"Error Retrieving Large Report from SSRS","body":"\u003cp\u003eI've got an SSRS report that I am trying to load into a ReportViewer control via a .NET webservice, like so:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e // CR8720 DT 10/20/10 10 VVVIMP: The report is dynmically created w/o using the RDL file.\n MemoryStream ms = HtmlStatement.GetReport(uxStatementText.Text, uxStatementName.Text, uxStatementCode.Text);\n uxReportViewer.ServerReport.LoadReportDefinition(ms);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis report can be filtered using search criteria on my ASP.NET page, or the criteria can be left blank and an entire report can be returned. The problem is, when the search criteria is left blank, I get this error message, and no report is returned: \"The report definition is not valid. Details: The element 'Paragraphs' in namespace 'http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition' has incomplete content. List of possible elements expected: 'Paragraph' in namespace 'http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition'. (rsInvalidReportDefinition)\". The report works fine if I filter it, so I'm thinking that it just may be too large for the webservice to return, and part of it is getting truncated (hence the error message). Is that correct? If so, how would I fix this?\u003c/p\u003e","accepted_answer_id":"8040251","answer_count":"1","comment_count":"0","creation_date":"2011-11-07 17:20:26.637 UTC","last_activity_date":"2011-11-07 17:33:51.54 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"131848","post_type_id":"1","score":"1","tags":"c#|asp.net|web-services|reporting-services","view_count":"796"} +{"id":"187633","title":"What are the reasons for these 2 error messages?","body":"\u003cp\u003eFirst of all, I'd like to say that this site is great!\u003c/p\u003e\n\n\u003cp\u003eMy question is, what are the reasons for the following 2 error messages?\u003c/p\u003e\n\n\u003cp\u003e1) In VB.NET (I know this is a C# forum but my next question is from C# experience), property evaluation failed (I do this when putting a watch on an exception variable).\u003c/p\u003e\n\n\u003cp\u003e2) In C#, method or class (Can't remember which) does not have a constructor. I think I got this with HttpContext or HttpApplication, which is a class if I remember correctly? Pretty sure it is as it has its own properties and methods.\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","answer_count":"3","comment_count":"5","creation_date":"2008-10-09 14:57:56.56 UTC","last_activity_date":"2008-10-13 12:23:32.303 UTC","last_edit_date":"2008-10-09 15:01:01.05 UTC","last_editor_display_name":"Gamecat","last_editor_user_id":"18061","owner_display_name":"GSS","post_type_id":"1","score":"0","tags":"c#|vb.net","view_count":"558"} +{"id":"10432641","title":"Browser detection using Zend Framework or Javascript","body":"\u003cp\u003eI am creating an application that requires the ability to upload large files. I have chosen to use the \u003ca href=\"https://developer.mozilla.org/en/XMLHttpRequest/FormData\" rel=\"nofollow\"\u003eFormData\u003c/a\u003e object as using this I can report back to the user the progress. \u003c/p\u003e\n\n\u003cp\u003eNot surprisingly IE doesn't support this so I am having to fall back to Flash. What is the best way of detecting for IE 7/8/9+ using Zend Framework? I am loading in the other assets as per needed via the indexAction method in each controller. For example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic function indexAction()\n{\n $this-\u0026gt;view-\u0026gt;stepnumber = 1;\n $this-\u0026gt;view-\u0026gt;stepintro = 'Upload your photo.';\n $this-\u0026gt;view-\u0026gt;headScript()-\u0026gt;appendFile($this-\u0026gt;view-\u0026gt;baseUrl().'/assets/js/fileuploader.js');\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow, in one of my pages I have already done some form of browser detection (for some \u003ccode\u003ecanvas\u003c/code\u003e work):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic function indexAction()\n{\n\n $u_agent = $_SERVER['HTTP_USER_AGENT'];\n\n $this-\u0026gt;view-\u0026gt;stepnumber = 5;\n $this-\u0026gt;view-\u0026gt;stepintro = 'Select your cut out detail.';\n\n if(preg_match('/MSIE/i', $u_agent)) {\n $this-\u0026gt;view-\u0026gt;headScript()-\u0026gt;appendFile($this-\u0026gt;view-\u0026gt;baseUrl().'/assets/js/excanvas.js');\n } else {\n $this-\u0026gt;view-\u0026gt;headScript()-\u0026gt;appendFile($this-\u0026gt;view-\u0026gt;baseUrl().'/assets/js/mootools/mootools-canvas-lib/mcl-min.js');\n } \n\n $this-\u0026gt;view-\u0026gt;headScript()-\u0026gt;appendFile($this-\u0026gt;view-\u0026gt;baseUrl().'/assets/js/frank/pentool.js');\n\n $image = $this-\u0026gt;uploadsDb-\u0026gt;getImage(); \n\n $data = $this-\u0026gt;nodedataDb-\u0026gt;getNodedata($image-\u0026gt;id);\n\n $this-\u0026gt;view-\u0026gt;image = $image;\n $this-\u0026gt;view-\u0026gt;nodeData = $data;\n\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am not too sold on this method though, I would rather check using Javascript as this would be more futureproof (I think). But how would I go about using Javasript within my ZF layout.phtml so I'm only loading the Javascript that I require? Cutting down on calls to the server.\u003c/p\u003e\n\n\u003cp\u003eAny help is much appreciated.\u003c/p\u003e\n\n\u003cp\u003eSOLUTION:\u003c/p\u003e\n\n\u003cp\u003eI have decided to use YepNope:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eyepnope({ \n test : \"FormData\" in window,\n yep : 'normal.js', \n nope : 'flashupload.js' \n}); \n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"6","creation_date":"2012-05-03 13:41:29.033 UTC","last_activity_date":"2015-01-27 14:11:24.443 UTC","last_edit_date":"2012-05-03 15:45:01.19 UTC","last_editor_display_name":"","last_editor_user_id":"387761","owner_display_name":"","owner_user_id":"387761","post_type_id":"1","score":"2","tags":"php|javascript|zend-framework|mootools|cross-browser","view_count":"1219"} +{"id":"11811485","title":"as3 removeChild method in game giving problems","body":"\u003cp\u003eI have seen many questions on removeChild.\u003c/p\u003e\n\n\u003cp\u003eI've got an invaders type game, where bricks are falling from top, and you have to destroy them with a ball that keeps bouncing around.\u003c/p\u003e\n\n\u003cp\u003eWhen I want to remove the brick (referencing it with an array in a for loop), I randomly get the exception error (like many others) that the object must be a child of the caller.\u003c/p\u003e\n\n\u003cp\u003eThis was a solution:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eif (this.parent != null)\n{\nthis.parent.removeChild(this);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e-- that is in my case, called from within the class of the target object (the brick).\u003c/p\u003e\n\n\u003cp\u003eBUT the thing is.. if this.parent really IS null\nthe brick just stays there! (when it should have been removed)\u003c/p\u003e","answer_count":"1","comment_count":"6","creation_date":"2012-08-04 19:40:43.31 UTC","last_activity_date":"2012-08-09 14:25:36.463 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1576523","post_type_id":"1","score":"0","tags":"actionscript-3|actionscript|removechild","view_count":"434"} +{"id":"46494950","title":"How to set up Accept-Encoding to gzip in Python client?","body":"\u003cp\u003eThis is probably a very newbie question, but I'm reading \u003ca href=\"http://docs.python-requests.org/en/master/user/quickstart/\" rel=\"nofollow noreferrer\"\u003eHTTP Request\u003c/a\u003e library and I need to write a code that will make a request to a server and asks for gzip compression (since the server supports gzip compression). \u003c/p\u003e\n\n\u003cp\u003eFor instance, I have:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport requests\n\nr = requests.get('some_url')\nr.json()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI know it has something to do with sending \u003ccode\u003eAccept-Encoding: gzip\u003c/code\u003e in the header of the HTTP request, but I'm not sure how to do that. \u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2017-09-29 18:29:08.253 UTC","last_activity_date":"2017-09-29 18:34:20.197 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5963271","post_type_id":"1","score":"0","tags":"python|http|gzip","view_count":"57"} +{"id":"40425113","title":"Multiples of a number using Haskell","body":"\u003cp\u003eI have wrote the following function for finding the multiples of an input number.\nWhen I try to give negative numbers the output is only positive list.How can I modify my code to allow negative numbers to be listed in the output?\u003c/p\u003e\n\n\u003cp\u003eMy Try :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emultiples n = if n\u0026lt;0 then result1 else result2\nwhere\n result1 = [x | x \u0026lt;- [0..], x `mod` (-n) == 0] \n result2 = [x | x \u0026lt;- [0..], x `mod` n == 0]\n\n Input : take 5 $ multiples (-3)\n Output: [0,3,6,9,12]\n Expected Output: [0,-3,-6,-9,-12]\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"40425399","answer_count":"2","comment_count":"2","creation_date":"2016-11-04 14:25:39.62 UTC","last_activity_date":"2016-11-08 20:14:01.677 UTC","last_edit_date":"2016-11-08 20:14:01.677 UTC","last_editor_display_name":"","last_editor_user_id":"371753","owner_display_name":"","owner_user_id":"7115486","post_type_id":"1","score":"0","tags":"haskell|functional-programming","view_count":"68"} +{"id":"32992774","title":"iOS simulaotr version","body":"\u003cp\u003eI tried Appium iOS tutorial (\u003ca href=\"http://appium.io/slate/en/tutorial/ios.html?java#\" rel=\"nofollow\"\u003ehttp://appium.io/slate/en/tutorial/ios.html?java#\u003c/a\u003e) and ran the example successfully. I noticed the UICatalog6.1.app runs on iOS simulator with title \"iPhone 6/iOS 8.2\" on the top of the simulator. However the title is \"iPhone 6/iOS 9.0\" when I run the app developed by myself from Xcode. I am wondering which part controls to use different version of iOS simulator?\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","accepted_answer_id":"32992923","answer_count":"1","comment_count":"0","creation_date":"2015-10-07 12:54:18.88 UTC","last_activity_date":"2015-10-07 13:00:47.467 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1443721","post_type_id":"1","score":"0","tags":"ios|iphone|xcode|ios-simulator","view_count":"51"} +{"id":"13354899","title":"Require.js and Zend Framework","body":"\u003cp\u003eWhat is best way for including Require.js in Zend Framework? My current way of calling js files in zend framework are as follow :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php echo $this-\u0026gt;jQuery()-\u0026gt;setLocalPath($this-\u0026gt;path('js/jquery/jquery-1.7.1.min.js'))\n -\u0026gt;enable()\n -\u0026gt;setUiLocalPath($this-\u0026gt;path('js/jquery/jquery-ui-1.8.16.custom.min.js'))\n -\u0026gt;uiEnable()\n -\u0026gt;addStylesheet($this-\u0026gt;path('css/jquery/jquery-ui-1.8.16.custom.css'));\n\n echo $this-\u0026gt;headScript()-\u0026gt;appendFile($this-\u0026gt;path('js/jquery.tipTip.js'))\n\n -\u0026gt;appendFile($this-\u0026gt;path('js/customScripts/facebook.js'))\n -\u0026gt;appendFile($this-\u0026gt;path('js/facebook/jquery.facebook.multifriend.select.js'))\n -\u0026gt;appendFile($this-\u0026gt;path('js/customScripts/logindialog.js'))\n -\u0026gt;appendFile($this-\u0026gt;path('js/customScripts/globalFunctions.js'))\n -\u0026gt;appendFile($this-\u0026gt;path('js/kendo.web.min.js'))\n -\u0026gt;appendFile($this-\u0026gt;path('js/customScripts/fancyAlert.js'))\n -\u0026gt;appendFile($this-\u0026gt;path('js/inc/jquery.mousewheel.min.js'))\n -\u0026gt;appendFile($this-\u0026gt;path('js/pagination-jq.js'))\n\n\n -\u0026gt;appendFile($this-\u0026gt;path('js/jquery.tools.min.js'))\n -\u0026gt;appendFile($this-\u0026gt;path('js/fancybox/jquery.fancybox-1.3.4.pack.js'))\n -\u0026gt;appendFile($this-\u0026gt;path('js/jq-history/scripts/jquery.history.min.js'));\n\n ?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"1","creation_date":"2012-11-13 02:45:33.973 UTC","favorite_count":"1","last_activity_date":"2015-01-30 11:48:20.847 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1471938","post_type_id":"1","score":"1","tags":"php|jquery|zend-framework|requirejs","view_count":"1030"} +{"id":"41205240","title":"Angular2 - how to setup radio button option to use a dynamic value","body":"\u003cp\u003eI have a \u003ccode\u003eProposal\u003c/code\u003e component where the user selects a value from a radio button:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public salutations = [\n { value: 0, display: 'Mr \u0026amp; Mrs' },\n { value: 1, display: 'Mrs' },\n { value: 2, display: 'Ms'},\n { value: 3, display: 'Mr'},\n { value: 4, display: 'proposal.first_name'}\n ];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn each case, the selected option is stored in the \u003ccode\u003eProposal.greeting\u003c/code\u003e field. I don't store the value, but the actual display property.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;div *ngFor=\"let salutation of salutations\"\u0026gt;\n \u0026lt;label\u0026gt;\n \u0026lt;input type=\"radio\" name=\"salutation\" [(ngModel)]=\"proposal.salutation\" \n [value]=\"salutation.display\"\u0026gt; \u0026lt;!-- we DO NOT want to store the integer value --\u0026gt;\n {{salutation.display}}\n \u0026lt;/label\u0026gt;\n \u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAs you can see, when the user selects option 4, the intention is to store the actual name of the proposer (proposal.first_name).\u003c/p\u003e\n\n\u003cp\u003eThis is because later I have a view that looks like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;p\u0026gt;Dear {{proposal.greeting}} {{proposal.last_name}},\u0026lt;/p\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo how can I make that option 4 dynamic (so that when selected it stores the first_name and not the string 'proposal.first_name').\u003c/p\u003e","accepted_answer_id":"41205773","answer_count":"1","comment_count":"0","creation_date":"2016-12-18 03:37:18.953 UTC","last_activity_date":"2016-12-18 05:30:32.5 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1028679","post_type_id":"1","score":"1","tags":"angular|radio-button|angular2-template","view_count":"172"} +{"id":"27479648","title":"window size is not working","body":"\u003cp\u003ehere is my code\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction openWin() {\n\n var height = screen.availHeight;\n var width = screen.availWidth ;\n\n var mainWin = window\n .open(\n \"terms.do\",\n \"mainApplicationWindow\",\n \"width=\"\n + width\n + \",height=\"\n + height\n + \",fullscreen=yes,top=0,left=0,location=no,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes\");\n\n mainWin.focus();\n\n\n}.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt should open a window with width and height of maximum but for some odd reason its opening a window with a same width and height of parent window . \u003ca href=\"https://stackoverflow.com/questions/10297168/how-to-open-maximized-window-with-javascript\"\u003ethis\u003c/a\u003e post shows similar problem but in my case it does not work what am I doing wrong \u003c/p\u003e","accepted_answer_id":"27479946","answer_count":"1","comment_count":"5","creation_date":"2014-12-15 08:02:41.36 UTC","last_activity_date":"2014-12-15 09:04:09.233 UTC","last_edit_date":"2017-05-23 12:08:59.34 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"2732297","post_type_id":"1","score":"-2","tags":"javascript|html","view_count":"88"} +{"id":"15971208","title":"Weird behaviour due to data loss from sqlite database on iPhone","body":"\u003cp\u003eI have a phonegap app which runs on both Android and iOS.\u003c/p\u003e\n\n\u003cp\u003eI am facing a weird problem. My app is password protected, and only after entering the correct password, the user is logged in. Also, the app has multiple screens.\u003c/p\u003e\n\n\u003cp\u003eSuppose I am on a particular screen (after logging in), and switch off the device (with the app still running), switch on the device back and launch my application. It starts back from the screen which was visible on Android but on iOS, nothing shows up, just a white screen.\u003c/p\u003e\n\n\u003cp\u003eAfter some debugging, i found out that log-in credentials were there in sqlite3 database on Android and not on iOS. Why is that ?\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2013-04-12 12:17:29.823 UTC","last_activity_date":"2013-04-12 12:45:39.687 UTC","last_edit_date":"2013-04-12 12:45:39.687 UTC","last_editor_display_name":"","last_editor_user_id":"617044","owner_display_name":"","owner_user_id":"1711346","post_type_id":"1","score":"1","tags":"ios|cordova|sqlite3","view_count":"71"} +{"id":"20443722","title":"Combining Jquery and Javascript function","body":"\u003cp\u003eThis is a relatively novice question. I have the following jQuery function:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(function () \n {\n $.ajax({ \n url: 'testapi.php', \n data: \"query=\"+queryType,\n dataType: 'json', \n success: function(data) \n {\n var id = data[0];\n $('#'+divID).html(id); \n }\n });\n }); \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm looking to name and parameterize the function so that I can call it repeatedly (with the parameters queryType and divID which are already included in the code). I've tried unsuccessfully multiple times. Would anyone have any insight?\u003c/p\u003e","accepted_answer_id":"20443766","answer_count":"4","comment_count":"1","creation_date":"2013-12-07 16:32:15.97 UTC","last_activity_date":"2013-12-09 09:34:43.103 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3077968","post_type_id":"1","score":"0","tags":"javascript|jquery","view_count":"95"} +{"id":"7052159","title":"Segfault when using std::set of pointers... can anyone explain this?","body":"\u003cp\u003eIn my game I created a base class called Entity which I store in a set for processing. All my game objects derive from this class, and I have no problem adding the derived pointer types to the set in my initialization function. \u003c/p\u003e\n\n\u003cp\u003eThe problem lies in adding new elements from \u003cem\u003ewithin\u003c/em\u003e an Entity's \u003ccode\u003eStep()\u003c/code\u003e function. Now, before I get too far into it I'll show you some simplified code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass GameState\n{\n public:\n GameState();\n ~GameState();\n ...\n set\u0026lt;Entity*\u0026gt; entities;\n void Add(Entity* e);\n void Remove(Entity* e);\n protected:\n set\u0026lt;Entity*\u0026gt; added, removed;\n};\n\nclass Entity\n{\n public:\n Entity();\n Entity(GameState* parent);\n virtual ~Entity();\n virtual void Step(const sf::Input\u0026amp; input);\n ...\n virtual void Destroy();\n protected:\n GameState* game;\n};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe functions Add and Remove in GameState simply add the argument \u003cem\u003ee\u003c/em\u003e to the \u003ccode\u003eadded\u003c/code\u003e and \u003ccode\u003eremoved\u003c/code\u003e sets respectively. In the main loop (elsewhere in GameState), I move the elements from \u003ccode\u003eadded\u003c/code\u003e to \u003ccode\u003eentities\u003c/code\u003e before processing and after processing I remove elements from \u003ccode\u003eremoved\u003c/code\u003e from \u003ccode\u003eentities\u003c/code\u003e. This ensures that \u003ccode\u003eentities\u003c/code\u003e is not modified during iteration. \u003c/p\u003e\n\n\u003cp\u003eThe Add/Remove functions are very simple:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evoid GameState::Add(Entity* e)\n{\n added.insert(e);\n}\n\nvoid GameState::Remove(Entity* e)\n{\n removed.insert(e);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eEvery derived Entity is passed a pointer to GameState in it's constructor that it keeps as \u003ccode\u003egame\u003c/code\u003e. So theoretically from the Step function I should be able to Add and Remove entities with a simple call like \u003ccode\u003egame-\u0026gt;Remove(this);\u003c/code\u003e, but instead I get a segfault. After a night of googling and coming up with nothing, I was able to work around (part of) the problem by implementing \u003ccode\u003eEntity::Destroy()\u003c/code\u003e like so:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evoid Entity::Destroy()\n{\n game-\u0026gt;Remove(this);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo my first question is: Why does \u003ccode\u003ethis\u003c/code\u003e work when I'm in the base class but not in the derived class?\u003c/p\u003e\n\n\u003cp\u003eEven more puzzling to me is \u003ccode\u003eAdd()\u003c/code\u003e. Why does \u003ccode\u003eAdd(new Explosion(16,16,this))\u003c/code\u003e work in GameState but \u003ccode\u003egame-\u0026gt;Add(new Explosion(16,16,game))\u003c/code\u003e doesn't work inside my object?\u003c/p\u003e\n\n\u003cp\u003eI ran it through gdb and it tells me:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eProgram received signal SIGSEGV, Segmentation fault.\nAt c:/program files (x86)/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/include/c++/bits/stl_tree.h:482\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe code that throws the error is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e_Link_type\n _M_begin()\n { return static_cast\u0026lt;_Link_type\u0026gt;(this-\u0026gt;_M_impl._M_header._M_parent); } //this line\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo to sum it up I have no idea why my pointers break the STL... and I get that grave feeling that I'm missing something very basic and its causing all these headaches. Can anyone give me advice?\u003c/p\u003e","accepted_answer_id":"7052234","answer_count":"1","comment_count":"5","creation_date":"2011-08-13 17:34:53.883 UTC","favorite_count":"1","last_activity_date":"2011-08-13 17:50:56.583 UTC","last_edit_date":"2011-08-13 17:41:44.05 UTC","last_editor_display_name":"","last_editor_user_id":"893201","owner_display_name":"","owner_user_id":"893201","post_type_id":"1","score":"2","tags":"c++|inheritance|pointers|segmentation-fault","view_count":"654"} +{"id":"9804714","title":"Joomla caching error messages","body":"\u003cp\u003eOK, so because my Joomla 1.5 site is insanely inefficient, I've had to resort to caching in an attempt to keep the thing up and running. First, I enabled module-level caching, which had a slight benefit, but not quite enough. So I then enabled page-level caching. Performance is now much better, but there are a few associated problems, the main one being caching of error messages.\u003c/p\u003e\n\n\u003cp\u003eI cannot quite believe that Joomla would cache pages with error messages, but that does appear to be happening. Still, I have a whole bunch of extensions installed, so I'm not quite ready to blame core Joomla just yet. But, having looked at the code, as far as I can tell, there is no provision to not cache error messages. I've determined that errors are stored in the session, then displayed on a page via JDocumentRendererMessage. But I cannot see anything in any of the caching code (plugin, cache.php, etc.) that looks remotely like \"if (messages are in the message queue) don't cache the page;\"\u003c/p\u003e\n\n\u003cp\u003eIs anyone else familiar with this problem?\u003c/p\u003e","accepted_answer_id":"11298496","answer_count":"1","comment_count":"2","creation_date":"2012-03-21 12:35:25.35 UTC","last_activity_date":"2012-07-02 17:38:36.633 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5058","post_type_id":"1","score":"0","tags":"caching|joomla|joomla1.5","view_count":"581"} +{"id":"43590808","title":"Incompatible units: 'rem' and 'px' - Bootstrap 4 and Laravel Mix","body":"\u003cp\u003eI just installed a fresh Laravel 5.4, and bootstrap 4 alpha 6. Laravel mix wont compile SASS:\nHere is one error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Module build failed: ModuleBuildError: Module build failed: \n$input-height: (($font-size-base * $input-line-height) + ($input-padding-y * 2)) !default;\n ^\n Incompatible units: 'rem' and 'px'.\n in /Volumes/HDD/nicolae/Dev/htdocs/test/node_modules/bootstrap/scss/_variables.scss (line 444, column 34)\n at runLoaders (/Volumes/HDD/nicolae/Dev/htdocs/test/node_modules/webpack/lib/NormalModule.js:192:19)\n at /Volumes/HDD/nicolae/Dev/htdocs/test/node_modules/loader-runner/lib/LoaderRunner.js:364:11\n at /Volumes/HDD/nicolae/Dev/htdocs/test/node_modules/loader-runner/lib/LoaderRunner.js:230:18\n at context.callback (/Volumes/HDD/nicolae/Dev/htdocs/test/node_modules/loader-runner/lib/LoaderRunner.js:111:13)\n at Object.asyncSassJobQueue.push [as callback] (/Volumes/HDD/nicolae/Dev/htdocs/test/node_modules/sass-loader/lib/loader.js:57:13)\n at Object.\u0026lt;anonymous\u0026gt; (/Volumes/HDD/nicolae/Dev/htdocs/test/node_modules/sass-loader/node_modules/async/dist/async.js:2262:31)\n at apply (/Volumes/HDD/nicolae/Dev/htdocs/test/node_modules/sass-loader/node_modules/async/dist/async.js:20:25)\n at Object.\u0026lt;anonymous\u0026gt; (/Volumes/HDD/nicolae/Dev/htdocs/test/node_modules/sass-loader/node_modules/async/dist/async.js:56:12)\n at Object.callback (/Volumes/HDD/nicolae/Dev/htdocs/test/node_modules/sass-loader/node_modules/async/dist/async.js:944:16)\n at options.error (/Volumes/HDD/nicolae/Dev/htdocs/test/node_modules/node-sass/lib/index.js:294:32)\n\n @ multi ./resources/assets/js/app.js ./resources/assets/sass/app.scss\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSomeone passed this? And how?\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2017-04-24 14:28:01.38 UTC","favorite_count":"1","last_activity_date":"2017-07-18 17:51:26.983 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4273925","post_type_id":"1","score":"7","tags":"laravel|webpack|bootstrap-4|bootstrap-sass","view_count":"4165"} +{"id":"44781725","title":"Better Method to Create a file using Innert html","body":"\u003cp\u003eIn this project i creating a new file when user submit the forum . The file contain the html structure inside the \u003ccode\u003e#main\u003c/code\u003e div . Please see my code\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php \nif(ISSET($_POST['submit'])){\n $myfile = fopen($_POST['user_name'].\".html\", \"w\") or die(\"Unable to open file!\");\n $txt = $_POST['inner_html'];\n fwrite($myfile, $txt);\n fclose($myfile);\n\n}\n\n?\u0026gt;\n\n\u0026lt;script src=\"https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\n\u0026lt;div id=\"main\"\u0026gt;\n \u0026lt;div class=\"new-classs\" style=\"color:green;width:100px\"\u0026gt;\n \u0026lt;img src=\"tst.jpg\" /\u0026gt;\n \u0026lt;span\u0026gt;Content of #main div goes here\u0026lt;/span\u0026gt;\n \u0026lt;/div\u0026gt; \n\u0026lt;/div\u0026gt;\n\n\u0026lt;form method=\"post\" action=\"\"\u0026gt;\n \u0026lt;input type=\"text\" name=\"user_name\" class=\"user_name\" required\u0026gt;\n \u0026lt;input type=\"hidden\" name=\"inner_html\" class=\"inner_html\"\u0026gt;\n \u0026lt;input type=\"submit\" value=\"submit\" name=\"submit\" class=\"submit\"\u0026gt;\n\u0026lt;/form\u0026gt;\n\n\u0026lt;script\u0026gt;\n $('.submit').on(\"click\",function(e){\n $(\".inner_html\").val($(\"#main\").html());\n\n});\n\u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am using \u003cstrong\u003ephp\u003c/strong\u003e and \u003cstrong\u003eJquery\u003c/strong\u003e for this purpose . \u003c/p\u003e\n\n\u003cp\u003eBut here what is the problem is some time \u003ccode\u003e#main div\u003c/code\u003e contain too much inner html . \u003c/p\u003e\n\n\u003cp\u003eSo it will be a problem when passing as \u003ccode\u003e$_POST\u003c/code\u003e ? \u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003e$_POST\u003c/code\u003e will restrict the value if it exceed some amount? \u003c/p\u003e\n\n\u003cp\u003eIs there any alternate or good method to solve this problem ? \u003c/p\u003e","answer_count":"1","comment_count":"6","creation_date":"2017-06-27 13:35:54.943 UTC","last_activity_date":"2017-06-27 14:16:23.95 UTC","last_edit_date":"2017-06-27 13:39:29.487 UTC","last_editor_display_name":"","last_editor_user_id":"1415724","owner_display_name":"","owner_user_id":"7850364","post_type_id":"1","score":"0","tags":"javascript|php|jquery|html","view_count":"47"} +{"id":"2473683","title":"Intercept and ignore keyboard event in Windows 7 32bit","body":"\u003cp\u003eMy hardware has a problem, from time to time it's sending a \"keydown\" followed by a \"keyup\" event:\u003c/p\u003e\n\n\u003cp\u003ekeydown: None LButton, OemClear 255\u003c/p\u003e\n\n\u003cp\u003ekeyup: None LButton, OemClear 255\u003c/p\u003e\n\n\u003cp\u003ekeydown: None LButton, OemClear 255\u003c/p\u003e\n\n\u003cp\u003ekeyup: None LButton, OemClear 255\u003c/p\u003e\n\n\u003cp\u003eIt goes like this, every 1 or 2 seconds, forever, in Windows.\u003c/p\u003e\n\n\u003cp\u003eIn general it doesn't affect most of the applications, because this key is not printable. I think it's a special function key, like a media key or something. It doesn't do anything.\u003c/p\u003e\n\n\u003cp\u003eBut, in some applications that LISTEN to keydown and keyup, I get unexpected behaviour.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eQuestion\u003c/strong\u003e: is there a way to intercept these 2 keyboard events in Windows (for all applications \u0026amp; for Windows itself) and make the OS ignore them?\u003c/p\u003e\n\n\u003cp\u003eThis is really important to me, if you can think of any solution, I'd be forever thankful.\u003c/p\u003e","accepted_answer_id":"2473721","answer_count":"1","comment_count":"0","creation_date":"2010-03-18 22:09:52.3 UTC","favorite_count":"2","last_activity_date":"2010-03-19 00:38:10.043 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"296963","post_type_id":"1","score":"1","tags":"windows|winapi|keyboard|driver|device-driver","view_count":"782"} +{"id":"33426405","title":"Unfortunately app has stopped After adding an image on the splash.xml","body":"\u003cp\u003eI've edited the splash.xml file I get the \"Unfortunately app has stopped\" error when i try to run the app.\u003c/p\u003e\n\n\u003cp\u003eThere was 2 images on this splash.xml file before I've edit it (when the app was working) \u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eFirstly I've added my new image to the drawable folder (where the first 2 image are) \u003c/li\u003e\n\u003cli\u003eand then I've used the Eclipse graphical layout to delete the 2 images and to add my new image \u003c/li\u003e\n\u003cli\u003ethen I've saved the file and I had cleaned the project then I've run it and I've get the error\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eI've tried to re-run Eclipse and the emulator but the same problem \u003c/p\u003e\n\n\u003cp\u003eHere is the original splash.xml file:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" encoding=\"utf-8\"?\u0026gt;\n\u0026lt;RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\nxmlns:ads=\"http://schemas.android.com/apk/res-auto\"\nandroid:layout_width=\"fill_parent\"\nandroid:layout_height=\"fill_parent\"\nandroid:background=\"@color/main_bg\"\nandroid:gravity=\"center\" \u0026gt;\n\n\u0026lt;ImageView\n android:id=\"@+id/imageView1\"\n android:layout_width=\"180.0dip\"\n android:layout_height=\"180.0dip\"\n android:layout_below=\"@+id/imageView2\"\n android:layout_centerHorizontal=\"true\"\n android:src=\"@drawable/iconmain\" \n android:contentDescription=\"@string/app_name\"/\u0026gt;\n\n\u0026lt;ImageView\n android:id=\"@+id/imageView2\"\n android:layout_width=\"180.0dip\"\n android:layout_height=\"105.0dip\"\n android:layout_alignLeft=\"@+id/imageView1\"\n android:layout_alignParentTop=\"true\"\n android:layout_marginTop=\"14.0dip\"\n android:src=\"@drawable/title\" \n android:contentDescription=\"@string/app_name\"/\u0026gt;\n\n\u0026lt;/RelativeLayout\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd here's the modified version:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" encoding=\"utf-8\"?\u0026gt;\n\u0026lt;RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\nxmlns:ads=\"http://schemas.android.com/apk/res-auto\"\nandroid:layout_width=\"fill_parent\"\nandroid:layout_height=\"fill_parent\"\nandroid:background=\"@color/main_bg\"\nandroid:gravity=\"center\" \u0026gt;\n\n\u0026lt;ImageView\n android:id=\"@+id/imageView1\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_centerHorizontal=\"true\"\n android:layout_centerVertical=\"true\"\n android:src=\"@drawable/applogofull\"/\u0026gt;\n\n\u0026lt;/RelativeLayout\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd here is the LogCat:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e 10-30 06:11:11.840: I/art(1961): Debugger is active\n10-30 06:11:11.999: I/System.out(1961): Debugger has connected\n10-30 06:11:11.999: I/System.out(1961): waiting for debugger to settle...\n10-30 06:11:12.203: I/System.out(1961): waiting for debugger to settle...\n10-30 06:11:12.403: I/System.out(1961): waiting for debugger to settle...\n10-30 06:11:12.603: I/System.out(1961): waiting for debugger to settle...\n10-30 06:11:12.803: I/System.out(1961): waiting for debugger to settle...\n10-30 06:11:13.004: I/System.out(1961): waiting for debugger to settle...\n10-30 06:11:13.204: I/System.out(1961): waiting for debugger to settle...\n10-30 06:11:13.404: I/System.out(1961): waiting for debugger to settle...\n10-30 06:11:13.605: I/System.out(1961): waiting for debugger to settle...\n10-30 06:11:13.805: I/System.out(1961): waiting for debugger to settle...\n10-30 06:11:14.006: I/System.out(1961): debugger has settled (1485)\n10-30 06:11:14.554: I/art(1961): Alloc sticky concurrent mark sweep GC freed 1724(90KB) AllocSpace objects, 0(0B) LOS objects, 26% free, 22MB/30MB, paused 289us total 37.744ms\n10-30 06:11:14.560: I/art(1961): Alloc partial concurrent mark sweep GC freed 65(15KB) AllocSpace objects, 0(0B) LOS objects, 40% free, 22MB/36MB, paused 491us total 5.432ms\n10-30 06:11:14.569: I/art(1961): Alloc concurrent mark sweep GC freed 17(12KB) AllocSpace objects, 0(0B) LOS objects, 39% free, 22MB/36MB, paused 402us total 9.377ms\n10-30 06:11:14.570: I/art(1961): Forcing collection of SoftReferences for 462MB allocation\n10-30 06:11:14.582: I/art(1961): Alloc concurrent mark sweep GC freed 11(344B) AllocSpace objects, 0(0B) LOS objects, 39% free, 22MB/36MB, paused 2.325ms total 12.381ms\n10-30 06:11:14.582: E/art(1961): Throwing OutOfMemoryError \"Failed to allocate a 485258948 byte allocation with 15447336 free bytes and 73MB until OOM\"\n10-30 06:11:14.600: I/art(1961): Alloc concurrent mark sweep GC freed 3(96B) AllocSpace objects, 0(0B) LOS objects, 39% free, 22MB/36MB, paused 1.374ms total 10.202ms\n10-30 06:11:14.600: I/art(1961): Forcing collection of SoftReferences for 462MB allocation\n10-30 06:11:14.609: I/art(1961): Alloc concurrent mark sweep GC freed 3(96B) AllocSpace objects, 0(0B) LOS objects, 39% free, 22MB/36MB, paused 788us total 8.989ms\n10-30 06:11:14.610: E/art(1961): Throwing OutOfMemoryError \"Failed to allocate a 485258948 byte allocation with 15447336 free bytes and 73MB until OOM\"\n10-30 06:11:14.610: D/skia(1961): --- allocation failed for scaled bitmap\n10-30 06:11:14.613: D/AndroidRuntime(1961): Shutting down VM\n10-30 06:11:14.619: E/AndroidRuntime(1961): FATAL EXCEPTION: main\n10-30 06:11:14.619: E/AndroidRuntime(1961): Process: com.AbdellahASKI.SoundQuiz, PID: 1961\n10-30 06:11:14.619: E/AndroidRuntime(1961): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.AbdellahASKI.SoundQuiz/com.AbdellahASKI.SoundQuiz.SplashActivity}: android.view.InflateException: Binary XML file line #9: Error inflating class android.widget.ImageView\n10-30 06:11:14.619: E/AndroidRuntime(1961): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2325)\n10-30 06:11:14.619: E/AndroidRuntime(1961): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)\n10-30 06:11:14.619: E/AndroidRuntime(1961): at android.app.ActivityThread.access$800(ActivityThread.java:151)\n10-30 06:11:14.619: E/AndroidRuntime(1961): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)\n10-30 06:11:14.619: E/AndroidRuntime(1961): at android.os.Handler.dispatchMessage(Handler.java:102)\n10-30 06:11:14.619: E/AndroidRuntime(1961): at android.os.Looper.loop(Looper.java:135)\n10-30 06:11:14.619: E/AndroidRuntime(1961): at android.app.ActivityThread.main(ActivityThread.java:5254)\n10-30 06:11:14.619: E/AndroidRuntime(1961): at java.lang.reflect.Method.invoke(Native Method)\n10-30 06:11:14.619: E/AndroidRuntime(1961): at java.lang.reflect.Method.invoke(Method.java:372)\n10-30 06:11:14.619: E/AndroidRuntime(1961): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)\n10-30 06:11:14.619: E/AndroidRuntime(1961): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)\n10-30 06:11:14.619: E/AndroidRuntime(1961): Caused by: android.view.InflateException: Binary XML file line #9: Error inflating class android.widget.ImageView\n10-30 06:11:14.619: E/AndroidRuntime(1961): at android.view.LayoutInflater.createView(LayoutInflater.java:633)\n10-30 06:11:14.619: E/AndroidRuntime(1961): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:55)\n10-30 06:11:14.619: E/AndroidRuntime(1961): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:682)\n10-30 06:11:14.619: E/AndroidRuntime(1961): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:741)\n10-30 06:11:14.619: E/AndroidRuntime(1961): at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)\n10-30 06:11:14.619: E/AndroidRuntime(1961): at android.view.LayoutInflater.inflate(LayoutInflater.java:504)\n10-30 06:11:14.619: E/AndroidRuntime(1961): at android.view.LayoutInflater.inflate(LayoutInflater.java:414)\n10-30 06:11:14.619: E/AndroidRuntime(1961): at android.view.LayoutInflater.inflate(LayoutInflater.java:365)\n10-30 06:11:14.619: E/AndroidRuntime(1961): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:378)\n10-30 06:11:14.619: E/AndroidRuntime(1961): at android.app.Activity.setContentView(Activity.java:2145)\n10-30 06:11:14.619: E/AndroidRuntime(1961): at com.AbdellahASKI.SoundQuiz.SplashActivity.onCreate(SplashActivity.java:20)\n10-30 06:11:14.619: E/AndroidRuntime(1961): at android.app.Activity.performCreate(Activity.java:5990)\n10-30 06:11:14.619: E/AndroidRuntime(1961): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)\n10-30 06:11:14.619: E/AndroidRuntime(1961): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)\n10-30 06:11:14.619: E/AndroidRuntime(1961): ... 10 more\n10-30 06:11:14.619: E/AndroidRuntime(1961): Caused by: java.lang.reflect.InvocationTargetException\n10-30 06:11:14.619: E/AndroidRuntime(1961): at java.lang.reflect.Constructor.newInstance(Native Method)\n10-30 06:11:14.619: E/AndroidRuntime(1961): at java.lang.reflect.Constructor.newInstance(Constructor.java:288)\n10-30 06:11:14.619: E/AndroidRuntime(1961): at android.view.LayoutInflater.createView(LayoutInflater.java:607)\n10-30 06:11:14.619: E/AndroidRuntime(1961): ... 23 more\n10-30 06:11:14.619: E/AndroidRuntime(1961): Caused by: java.lang.OutOfMemoryError: Failed to allocate a 485258948 byte allocation with 15447336 free bytes and 73MB until OOM\n10-30 06:11:14.619: E/AndroidRuntime(1961): at dalvik.system.VMRuntime.newNonMovableArray(Native Method)\n10-30 06:11:14.619: E/AndroidRuntime(1961): at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)\n10-30 06:11:14.619: E/AndroidRuntime(1961): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:609)\n10-30 06:11:14.619: E/AndroidRuntime(1961): at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:444)\n10-30 06:11:14.619: E/AndroidRuntime(1961): at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:988)\n10-30 06:11:14.619: E/AndroidRuntime(1961): at android.content.res.Resources.loadDrawableForCookie(Resources.java:2474)\n10-30 06:11:14.619: E/AndroidRuntime(1961): at android.content.res.Resources.loadDrawable(Resources.java:2381)\n10-30 06:11:14.619: E/AndroidRuntime(1961): at android.content.res.TypedArray.getDrawable(TypedArray.java:749)\n10-30 06:11:14.619: E/AndroidRuntime(1961): at android.widget.ImageView.\u0026lt;init\u0026gt;(ImageView.java:146)\n10-30 06:11:14.619: E/AndroidRuntime(1961): at android.widget.ImageView.\u0026lt;init\u0026gt;(ImageView.java:135)\n10-30 06:11:14.619: E/AndroidRuntime(1961): at android.widget.ImageView.\u0026lt;init\u0026gt;(ImageView.java:131)\n10-30 06:11:14.619: E/AndroidRuntime(1961): ... 26 more\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks guys for the help but when i optimized the Image and I tried to run the app I get another error on the console (the last line is red):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[2015-10-30 13:50:45 - SoundQuiz] Dx Uncaught translation error: java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: GC overhead limit exceeded \n[2015-10-30 13:50:45 - SoundQuiz] Dx 1 error; aborting \n[2015-10-30 13:50:45 - SoundQuiz] Conversion to Dalvik format failed with error 1\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"6","creation_date":"2015-10-29 23:27:23.5 UTC","favorite_count":"1","last_activity_date":"2015-10-30 20:20:54.213 UTC","last_edit_date":"2015-10-30 20:20:54.213 UTC","last_editor_display_name":"","last_editor_user_id":"5063276","owner_display_name":"","owner_user_id":"5063276","post_type_id":"1","score":"0","tags":"java|android|xml|eclipse","view_count":"697"} +{"id":"42142610","title":"How to save mongoose data after PATCH?","body":"\u003cp\u003eMy Feathers.js app has a questionnaire and I'm trying to save the results for each input. Here is my client-side code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$.ajax({\n url: \"/answer\",\n type: \"PATCH\",\n data: newAnswer,\n success: function () {\n console.log(\"Answer submitted!\");\n },\n error: function () {\n console.log(\"Error submitting answer.\");\n }\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd here is my server-side code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eapp.patch(\"/answer\", (req, res) =\u0026gt; {\n users.patch(user[0]._id, req.body);\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCurrently, only the last input is saved. What am I doing wrong?\u003c/p\u003e\n\n\u003cp\u003eEDIT: Here is my schema\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eanswers: {\n yourOrganization: {\n page1: {\n idOfParameterInClient: response\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe \u003ccode\u003eidOfParameterInClient\u003c/code\u003e and the \u003ccode\u003eresponse\u003c/code\u003e are dynamic. In \u003ccode\u003epage1\u003c/code\u003e, there are a number of key/value pairs. How do I keep them?\u003c/p\u003e","accepted_answer_id":"42146550","answer_count":"2","comment_count":"2","creation_date":"2017-02-09 17:01:41.893 UTC","last_activity_date":"2017-02-09 22:38:08.15 UTC","last_edit_date":"2017-02-09 17:53:45.1 UTC","last_editor_display_name":"","last_editor_user_id":"1167646","owner_display_name":"","owner_user_id":"1167646","post_type_id":"1","score":"0","tags":"mongodb|express|mongoose|feathersjs","view_count":"95"} +{"id":"26166349","title":"Implementing Swift's NSObjectProtocol's hash generates warnings in Objective-C","body":"\u003cp\u003eThe Swift protocol \u003ccode\u003eNSObjectProtocol\u003c/code\u003e defines \u003ccode\u003ehash\u003c/code\u003e as a property returning an \u003ccode\u003eInt\u003c/code\u003e. The Objective-C protocol \u003ccode\u003eNSObject\u003c/code\u003e defines \u003ccode\u003ehash\u003c/code\u003e as a property of type \u003ccode\u003eNSUInteger\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eSince \u003ccode\u003eNSUInteger\u003c/code\u003e is an unsigned integer, and \u003ccode\u003eInt\u003c/code\u003e is a signed integer, these types are not compatible. As a result, the generated Objective-C header for any Swift object conforming to \u003ccode\u003eNSObjectProtocol\u003c/code\u003e generates warnings of the form: \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e\"Property type 'NSInteger\" (aka 'int') is incompatible with type 'NSUInteger' (aka 'unsigned int') inherited from 'NSObject'.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eIs there a way to define a Swift object so that it does not produce these warnings? (As goes without saying, I do not want to manually tweak the generated headers with pragmas.)\u003c/p\u003e\n\n\u003cp\u003eSeparately, is hash even required? API documentation says it's available up to iOS7.1, but it's not marked as optional, so I'm confused.\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2014-10-02 17:37:30.303 UTC","last_activity_date":"2014-10-02 20:38:25.25 UTC","last_edit_date":"2014-10-02 20:38:25.25 UTC","last_editor_display_name":"","last_editor_user_id":"577888","owner_display_name":"","owner_user_id":"577888","post_type_id":"1","score":"1","tags":"objective-c|swift","view_count":"185"} +{"id":"41274757","title":"Why is my Git pre-commit hook not running in GitKraken","body":"\u003cp\u003eI'm trying to enforce Git Flow on a Git repository. I used the following hook to try to prevent commits to the \u003ccode\u003emaster\u003c/code\u003e and \u003ccode\u003edevelop\u003c/code\u003e branches. Contents of \u003ccode\u003e.git/hooks/pre-commit\u003c/code\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#!/bin/bash\nif test $(git rev-parse --abbrev-ref HEAD) = \"master\" ; then \n echo \"Cannot commit on master\"\n exit 1\nfi\nif test $(git rev-parse --abbrev-ref HEAD) = \"develop\" ; then \n echo \"Cannot commit on develop\"\n exit 1\nfi\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I test commits to these branches in GitKraken the commits are allowed. I made the Git was on the path and that the file showed as executable.\u003c/p\u003e","accepted_answer_id":"41274792","answer_count":"2","comment_count":"0","creation_date":"2016-12-22 02:04:24.45 UTC","favorite_count":"1","last_activity_date":"2017-04-05 00:07:35.907 UTC","last_edit_date":"2016-12-22 02:11:05.833 UTC","last_editor_display_name":"","last_editor_user_id":"7328235","owner_display_name":"","owner_user_id":"7328235","post_type_id":"1","score":"3","tags":"git|gitkraken","view_count":"1003"} +{"id":"38022254","title":"Webpack modulesDirectories config","body":"\u003cp\u003eI am trying to configure modulesDirectories so that \u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003e@import \"~react-toolbox/lib/commons\";\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eworks.\u003c/p\u003e\n\n\u003cp\u003eThis is what I have right no for resolve.modulesDirectories:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e resolve: {\n extensions: ['', '.css', '.scss', '.js', '.json'],\n modulesDirectories: [\n 'node_modules'\n ]\n },\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am presently getting this error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eERROR in ./~/css-loader!./~/sass-loader!./src/components/course/style.scss\nModule build failed: File to import not found or unreadable: ~react-toolbox/lib/commons\nParent style sheet: stdin (1:1)\n @ ./src/components/course/style.scss 4:14-128 13:2-17:4 14:20-134\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat am I doing wrong?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-06-24 21:18:01.623 UTC","last_activity_date":"2016-06-25 04:47:31.417 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5252715","post_type_id":"1","score":"0","tags":"webpack","view_count":"452"} +{"id":"17048017","title":"StorageFile WriteAsync opperation is too slow on large files (WinRT)","body":"\u003cp\u003eI've found a strange behaviour of a StorageFile WriteAsync opperation. When I create large file (aprox 4gb) and then try to write at the end of this file Write Async operation takes very long time. Looks like it fills the gap between begin and write positions. Anyway Proccess Manager shows high disk usage. Is it WinRT problem or am I doing something wrong? How to fix it? \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e const long FILE_SIZE = 4294967296;\n var folderPicker = new FolderPicker();\n folderPicker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary;\n folderPicker.FileTypeFilter.Add(\"*\");\n var folder = await folderPicker.PickSingleFolderAsync();\n\n var file = await folder.CreateFileAsync(\"1.iso\", CreationCollisionOption.ReplaceExisting);\n using (var stream = await file.OpenAsync(FileAccessMode.ReadWrite))\n {\n stream.Size = FILE_SIZE; // size 4 Gb\n\n var buffer = new byte[1]; // create one byte buffer\n buffer[0] = 0xFF;\n\n stream.Seek(FILE_SIZE - 10); // seek almost at the and position\n await stream.WriteAsync(buffer.AsBuffer()).AsTask(); // write operation takes a lot of time\n\n await stream.FlushAsync();\n }\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"4","creation_date":"2013-06-11 15:29:07.16 UTC","last_activity_date":"2013-06-11 15:29:07.16 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"986772","post_type_id":"1","score":"0","tags":"windows-runtime|winrt-async","view_count":"391"} +{"id":"2954922","title":"Binding DataTable To GridView, But No Rows In GridViewRowCollection Despite GridView Population?","body":"\u003cp\u003eProblem: I've coded a GridView in the markup in a page. I have coded a DataTable in the code-behind that takes data from a collection of custom objects. I then bind that DataTable to the GridView. (Specific problem mentioned a couple code-snippets below.)\u003c/p\u003e\n\n\u003cp\u003eGridView Markup:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;asp:GridView ID=\"gvCart\" runat=\"server\" CssClass=\"pList\" AutoGenerateColumns=\"false\" DataKeyNames=\"ProductID\"\u0026gt;\n \u0026lt;Columns\u0026gt;\n \u0026lt;asp:BoundField DataField=\"ProductID\" HeaderText=\"ProductID\" /\u0026gt;\n \u0026lt;asp:BoundField DataField=\"Name\" HeaderText=\"ProductName\" /\u0026gt;\n \u0026lt;asp:ImageField DataImageUrlField=\"Thumbnail\" HeaderText=\"Thumbnail\"\u0026gt;\u0026lt;/asp:ImageField\u0026gt;\n \u0026lt;asp:BoundField DataField=\"Unit Price\" HeaderText=\"Unit Price\" /\u0026gt;\n \u0026lt;asp:TemplateField HeaderText=\"Quantity\"\u0026gt;\n \u0026lt;ItemTemplate\u0026gt;\n \u0026lt;asp:TextBox ID=\"Quantity\" runat=\"server\" Text=\"\u0026lt;%# Bind('Quantity') %\u0026gt;\" Width=\"25px\"\u0026gt;\u0026lt;/asp:TextBox\u0026gt;\n \u0026lt;/ItemTemplate\u0026gt;\n \u0026lt;/asp:TemplateField\u0026gt;\n \u0026lt;asp:BoundField DataField=\"Total Price\" HeaderText=\"Total Price\" /\u0026gt;\n \u0026lt;/Columns\u0026gt;\n \u0026lt;/asp:GridView\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eDataTable Code-Behind:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate void View(List\u0026lt;OrderItem\u0026gt; cart)\n {\n DataSet ds = new DataSet();\n DataTable dt = ds.Tables.Add(\"Cart\");\n\n if (cart != null)\n {\n dt.Columns.Add(\"ProductID\");\n dt.Columns.Add(\"Name\");\n dt.Columns.Add(\"Thumbnail\");\n dt.Columns.Add(\"Unit Price\");\n dt.Columns.Add(\"Quantity\");\n dt.Columns.Add(\"Total Price\");\n\n foreach (OrderItem item in cart)\n {\n DataRow dr = dt.NewRow();\n\n dr[\"ProductID\"] = item.productId.ToString();\n dr[\"Name\"] = item.productName;\n dr[\"Thumbnail\"] = ResolveUrl(item.productThumbnail);\n dr[\"Unit Price\"] = \"$\" + item.productPrice.ToString();\n dr[\"Quantity\"] = item.productQuantity.ToString();\n dr[\"Total Price\"] = \"$\" + (item.productPrice * item.productQuantity).ToString();\n\n dt.Rows.Add(dr);\n }\n\n gvCart.DataSource = dt;\n gvCart.DataBind();\n gvCart.Width = 500;\n\n for (int counter = 0; counter \u0026lt; gvCart.Rows.Count; counter++)\n {\n gvCart.Rows[counter].Cells.Add(Common.createCell(\"\u0026lt;a href='cart.aspx?action=update\u0026amp;prodId=\" +\n gvCart.Rows[counter].Cells[0].Text + \"'\u0026gt;Update\u0026lt;/a\u0026gt;\u0026lt;br /\u0026gt;\u0026lt;a href='cart.aspx?action='action=remove\u0026amp;prodId=\" +\n gvCart.Rows[counter].Cells[0].Text + \"/\u0026gt;Remove\u0026lt;/a\u0026gt;\"));\n }\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eError occurs below in the foreach - \u003cstrong\u003ethe GridViewRowCollection is empty!\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate void Update(string prodId)\n {\n List\u0026lt;OrderItem\u0026gt; cart = (List\u0026lt;OrderItem\u0026gt;)Session[\"cart\"];\n int uQty = 0;\n\n foreach (GridViewRow gvr in gvCart.Rows)\n {\n if (gvr.RowType == DataControlRowType.DataRow)\n {\n if (gvr.Cells[0].Text == prodId)\n {\n uQty = int.Parse(((TextBox)gvr.Cells[4].FindControl(\"Quantity\")).Text);\n }\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eGoal: I'm basically trying to find a way to update the data in my GridView (and more importantly my cart Session object) without having to do everything else I've seen online such as utilizing OnRowUpdate, etc. Could someone please tell me why gvCart.Rows is empty and/or how I could accomplish my goal without utilizing OnRowUpdate, etc.? When I execute this code, the GridView gets populated but for some reason I can't access any of its rows in the code-behind.\u003c/p\u003e","accepted_answer_id":"2968107","answer_count":"4","comment_count":"0","creation_date":"2010-06-02 04:00:04.497 UTC","favorite_count":"2","last_activity_date":"2012-11-17 16:13:03.76 UTC","last_edit_date":"2010-06-02 04:46:13.153 UTC","last_editor_display_name":"","last_editor_user_id":"319470","owner_display_name":"","owner_user_id":"319470","post_type_id":"1","score":"1","tags":"c#|asp.net|gridview|datatable","view_count":"25110"} +{"id":"25120182","title":"Trigger Failing when calling Stored Procedure","body":"\u003cp\u003eI am truly hoping someone can help me out...\u003c/p\u003e\n\n\u003cp\u003eI have a trigger to handle the insert of a new record to a table. This trigger, as you will see below, inserts a record into another table, which in turns executes a trigger on that table, that calls a stored procedure (I tried to do it within the trigger itself, but it failed and was difficult to test where it was failing, so I moved it into its own little unit.) \u003c/p\u003e\n\n\u003cp\u003eWithin the stored procedure, there is a call to extract information from the Active Directory database (ADSI) and update the newly inserted record. However, this is where it fails when called by the trigger. When I call it by simply executing it, and passing along the record to be updated, it works great... Can anyone point me in the right direction? Please!!!\u003c/p\u003e\n\n\u003cp\u003eTrigger #1 in YYY\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eUSE [YYY]\nGO\n/****** Object: Trigger [dbo].[NewCustodian] Script Date: 08/04/2014 09:38:11 ******/\nSET ANSI_NULLS ON\nGO\nSET QUOTED_IDENTIFIER ON\nGO\nALTER TRIGGER [dbo].[NewCustodian]\nON [YYY].[dbo].[Custodians]\nAFTER INSERT\nAS BEGIN\n SET NOCOUNT ON;\n\n DECLARE @CaseID varchar(20);\n DECLARE DBcursor CURSOR FOR \n SELECT [XXX].[dbo].[tblCase].CaseID from [XXX].[dbo].[tblCase] Where [XXX].[dbo].[tblCase].SQLSVR_Case_ID = 'YYY';\n Open DBcursor; FETCH DBCursor into @CaseID;\n CLOSE DBcursor; DEALLOCATE DBcursor;\n\n DECLARE @NAME varchar(255);\n DECLARE @TAG varchar(255);\n\n SELECT @NAME = name FROM inserted;\n SELECT @TAG = tag FROM inserted;\n\n IF NOT EXISTS (Select eID from [XXX].[dbo].[tblNames] \n WHERE eID = @TAG and CaseID = @CaseID)\n BEGIN\n INSERT INTO [XXX].[dbo].[tblNames] (CaseID, Name, eID) \n Values (@CaseID, @NAME, @Tag);\n END\nEND\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eTrigger #2 in XXX\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eUSE [XXX]\nGO\n/****** Object: Trigger [dbo].[tblNames_New] Script Date: 08/04/2014 08:56:43 ******/\nSET ANSI_NULLS ON\nGO\nSET QUOTED_IDENTIFIER ON\nGO\n-- =============================================\n-- Author: \n-- Create date: \n-- Description: \n-- =============================================\nALTER TRIGGER [dbo].[tblNames_New]\nON [XXX].[dbo].[tblNames]\nAFTER INSERT\n\nAS BEGIN\n\n SET NOCOUNT ON;\n\nDECLARE @NamesID varchar(10)\nDECLARE @TAG varchar(10);\nDECLARE @return_value int\n\nSELECT @NamesID = namesID FROM inserted\n\nEXEC dbo.UpdateNames @NamesID;\nEnd\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eStored procedure:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eUSE [XXX]\nGO\n/****** Object: StoredProcedure [dbo].[UpdateNames] Script Date: 08/04/2014 08:14:52 ******/\nSET ANSI_NULLS ON\nGO\nSET QUOTED_IDENTIFIER ON\nGO\n-- =============================================\n-- Author: \n-- Create date: \n-- Description: \n-- =============================================\nALTER PROCEDURE [dbo].[UpdateNames] \n @NamesID int \nAS\nBEGIN\n SET FMTONLY OFF;\n SET NOCOUNT ON;\n\n DECLARE @eID varchar(10);\n DECLARE @TAG varchar(10);\n DECLARE @SQL nvarchar(555);\n DECLARE @DBresults as table (\n eID nvarchar(100),\n mobile nvarchar(100),\n mail nvarchar(100),\n phone nvarchar(100),\n name nvarchar(50),\n legacyExchangeDN nvarchar(100),\n Title nvarchar(100),\n homeDirectory nvarchar(100));\n DECLARE @mobile nvarchar(100)\n DECLARE @mail nvarchar(100)\n DECLARE @phone nvarchar(100) = 'Error'\n DECLARE @name nvarchar(100)\n DECLARE @legacyExchangeDN nvarchar(100)\n DECLARE @Title nvarchar(100) = 'Error'\n DECLARE @homeDirectory nvarchar(100)\n\n SET @eID = (Select eID from [XXX].[dbo].[tblNames] Where NamesID = @NamesID)\n\n SET @SQL = N'SELECT * FROM OpenQuery ( ADSI, ''SELECT homeDirectory,Title,legacyExchangeDN,displayName, telephoneNumber, mail, mobile,samAccountName\n FROM ''''LDAP://domain.com''''\n WHERE objectClass = ''''User'''' and samAccountName = ''''' + @eID+ ''''''') As tblADSI'\n\n INSERT INTO @DBresults \n EXEC sp_executesql @SQL\n\n DECLARE DBcursor CURSOR FOR \n SELECT * from @DBresults;\n Open DBcursor; FETCH DBCursor into @eID, @mobile, @mail, @phone, @Name, @legacyExchangeDN, @Title, @homeDirectory;\n CLOSE DBcursor; DEALLOCATE DBcursor;\n\n UPDATE XXX.dbo.tblNames\n SET Job_Title = @Title,\n Phone = @Phone\n Where NamesID = @NamesID;\nEND\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"4","creation_date":"2014-08-04 13:45:46.547 UTC","last_activity_date":"2014-08-07 05:10:48.683 UTC","last_edit_date":"2014-08-04 14:05:21.423 UTC","last_editor_display_name":"","last_editor_user_id":"13302","owner_display_name":"","owner_user_id":"3892962","post_type_id":"1","score":"0","tags":"sql|sql-server|stored-procedures","view_count":"605"} +{"id":"30459897","title":"How turn on GPS programmatically in my android application?","body":"\u003cp\u003eIf we use this code we see a message: \u003cstrong\u003esearching for GPS\u003c/strong\u003e. However, the \u003cstrong\u003eGPS\u003c/strong\u003e symbol is merely shown; \u003cstrong\u003eGPS\u003c/strong\u003e doesn't actually work:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprotected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n\n Intent intent = new Intent(\"android.location.GPS_ENABLED_CHANGE\");\n intent.putExtra(\"enabled\", true);\n this.sendBroadcast(intent); \n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhy isn't it working ? And how to make it work correctly ?\u003c/p\u003e","answer_count":"1","comment_count":"5","creation_date":"2015-05-26 13:24:37.253 UTC","favorite_count":"1","last_activity_date":"2015-05-27 06:52:41.743 UTC","last_edit_date":"2015-05-26 15:34:10.177 UTC","last_editor_display_name":"","last_editor_user_id":"3287204","owner_display_name":"","owner_user_id":"3578377","post_type_id":"1","score":"1","tags":"android|android-intent|gps|android-broadcast","view_count":"3270"} +{"id":"3046797","title":"Using EclipseLink","body":"\u003cp\u003eI am still new to Java and Eclipse and I'm trying to get my application to connect to a database. I think I want to use EclipseLink, but all of the documentation on the matter assumes you already know everything there is to know about everything.\u003c/p\u003e\n\n\u003cp\u003eI keep getting linked back to this tutorial: \u003ca href=\"http://www.vogella.de/articles/JavaPersistenceAPI/article.html\" rel=\"noreferrer\"\u003ehttp://www.vogella.de/articles/JavaPersistenceAPI/article.html\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eBut it's basically useless because it doesn't tell you HOW to do anything. For the Installation section, it tells you to download EclipseLink and gives you a link to the download page, but doesn't tell you what to do with it after you download. The download page doesn't either. I used the \"Install new software\" option in Eclipse to install EclipseLink into Eclipse, but it gave me like 4 different options, none of which are explained anywhere. It gave me options JPA, MOXy, SDO, etc, but I don't know which one I need. I just installed them all. Everything on the web assumes you are already a Java guru and things that are second nature to Java devs are never explained, so it's very frustrating for someone trying to learn.\u003c/p\u003e\n\n\u003cp\u003eSo how do I install and USE EclipseLink in my project and what do I need to do to connect it to a Microsoft SQL server? Again, I am new to all of this so I have no clue what to do. Thanks for the help.\u003c/p\u003e","accepted_answer_id":"3046986","answer_count":"3","comment_count":"0","creation_date":"2010-06-15 15:49:39.887 UTC","favorite_count":"4","last_activity_date":"2014-02-02 18:17:31.097 UTC","last_edit_date":"2010-06-16 09:48:48.217 UTC","last_editor_display_name":"","last_editor_user_id":"70604","owner_display_name":"","owner_user_id":"156588","post_type_id":"1","score":"11","tags":"java|jpa|eclipselink","view_count":"18116"} +{"id":"37809594","title":"ASP.NET MVC - Html.Action returns List\u003cstring\u003e, how to show the list correctly in view?","body":"\u003cp\u003eThe view has already other ActionResult and a model, but in one part of the view I need some results and I use Html.Action which returns List.\u003c/p\u003e\n\n\u003cp\u003eIt can be compiled and the outputs are like:\u003c/p\u003e\n\n\u003cp\u003eSystem.Collections.Generic.List`1[System.String];\u003c/p\u003e\n\n\u003cp\u003eHow can I show correctly the value of the strings?\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2016-06-14 10:36:35.66 UTC","last_activity_date":"2016-06-14 11:44:43.743 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5618385","post_type_id":"1","score":"-3","tags":"asp.net|asp.net-mvc","view_count":"125"} +{"id":"23749226","title":"NoneType Error: Python Doubly Linked List","body":"\u003cp\u003eGetting caught up in a solution to NoneType errors stemming from using my functions add and append in the below code to an empty Double_list class object. Best way to avoid?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass Dbl_Node:\n\n def __init__(self, data):\n self.data = data\n self.next = None\n self.prev = None\n\nclass Double_list:\n\n def __init__(self): # Creates initial list w/ head and tail as None\n self.head = None\n self.tail = None\n\n def add(self, item): # adds node to beginning/head of list\n temp = self.head\n self.head = Dbl_Node(item)\n temp.prev = self.head\n self.head.next = temp\n\n def append(self, item): # adds node to end/tail of list\n temp = self.tail\n self.tail = Dbl_Node(item)\n self.tail.prev = temp\n temp.next = self.tail\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"3","creation_date":"2014-05-20 00:31:07.55 UTC","last_activity_date":"2014-05-20 02:38:36.887 UTC","last_edit_date":"2014-05-20 00:50:07.25 UTC","last_editor_display_name":"user849425","owner_display_name":"","owner_user_id":"3290553","post_type_id":"1","score":"0","tags":"python|linked-list|nonetype","view_count":"310"} +{"id":"21430559","title":"Confirm multiple emails with devise","body":"\u003cp\u003eI am using rails+devise. I want the user to be able to confirm multiple e-mails (the app would send for each address a mail with a \"confirm\" link, and then the user have one or many confirmed mails). It is possible to confirm one with :confirmable (doc :\n\u003ca href=\"http://rubydoc.info/github/plataformatec/devise/master/Devise/Models/Confirmable\" rel=\"nofollow\"\u003ehttp://rubydoc.info/github/plataformatec/devise/master/Devise/Models/Confirmable\u003c/a\u003e )\u003c/p\u003e\n\n\u003cp\u003eI thought that i could play with\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e- (Object) resend_confirmation_instructions\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eby changing the address but this is not the best solution.\nIs there a solution with devise or do i have to implement this specific functionnality?\u003c/p\u003e","accepted_answer_id":"21430729","answer_count":"1","comment_count":"0","creation_date":"2014-01-29 12:02:37.193 UTC","last_activity_date":"2014-01-29 12:10:15.697 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1348593","post_type_id":"1","score":"0","tags":"ruby-on-rails|devise|confirmation-email","view_count":"233"} +{"id":"44676279","title":"Spring oauth2 only GET works","body":"\u003cp\u003eI have a working Spring oauth2 authorization server and resource server and they work great when it comes down to downloading information. For example a list of users. When I do a POST or a PUT request I get the following message:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eFull authentication is required to access this resource\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is my configuration:\u003c/p\u003e\n\n\u003cp\u003eMy authorization server has this configuration:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@Override\npublic void configure(ClientDetailsServiceConfigurer clients) throws Exception {\n clients.inMemory().withClient(\"myClient\")\n .secret(\"mySecret\")\n .accessTokenValiditySeconds(expiration)\n .scopes(\"read\", \"write\")\n .authorizedGrantTypes(\"authorization_code\", \"refresh_token\", \"password\")\n .resourceIds(OAuth2ResourceServerConfig.RESOURCE_ID);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy controller has this above each method:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@PreAuthorize(\"isAuthenticated()\")\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt works with GET methods however none of the POST or PUT requests are authorized even though the configuration is the same for all methods.\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-06-21 12:34:17.753 UTC","last_activity_date":"2017-06-21 12:34:17.753 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4614579","post_type_id":"1","score":"0","tags":"spring|spring-security-oauth2","view_count":"9"} +{"id":"5406507","title":"How to add a large file to a resource in c# project?","body":"\u003cp\u003eI was making a program that compiles a c# script to create an EXE application using Microsoft.CSharp.CSharpCodeProvider. In the process of making the EXE, it embeds a file programatically and the EXE reads that resource when it's executed on a later process. When I'm trying to add a large file and compiles it, the compiler throws an error like \"Unable to add resource. Insufficient memory\" or something like that. Is there any way to add a large file in a c# project resource?\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2011-03-23 14:10:18.027 UTC","last_activity_date":"2011-03-23 14:49:20.843 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"673117","post_type_id":"1","score":"2","tags":"c#|embedded-resource","view_count":"851"} +{"id":"40303944","title":"Storm can't find jar class path in my own jar","body":"\u003cp\u003eWhile trying to learn how to use storm. I decided to compile my own instance of the well known WordCount Topology to see how it is done. The code is 100% identical to the example's one. (\u003ca href=\"https://github.com/apache/storm/blob/master/examples/storm-starter/src/jvm/org/apache/storm/starter/WordCountTopology.java\" rel=\"nofollow\"\u003ehttps://github.com/apache/storm/blob/master/examples/storm-starter/src/jvm/org/apache/storm/starter/WordCountTopology.java\u003c/a\u003e)\u003c/p\u003e\n\n\u003cp\u003eHowever whenever I try to run the jar I get the error saying I could not find or load the main class. I can run the default example jar that comes bundled with storm with no problems (like in bellow), so it shouldn't be a calling syntax problem. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ebin/storm jar lib/\"name\".jar \"classpath\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMaven creates the jar with no problem, initially I assumed I wasn't excluding the storm dependency properly in the pom file but It should be like this, right?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;dependencies\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;org.apache.storm\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;storm-core\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;1.0.2\u0026lt;/version\u0026gt;\n \u0026lt;scope\u0026gt;provided\u0026lt;/scope\u0026gt;\n \u0026lt;/dependency\u0026gt;\n\u0026lt;/dependencies\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is perhaps is a vague question, but to be honest not sure where to tackle it since the code is the same, so generating a successful jar shouldn't be an issue, right?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-10-28 11:18:41.787 UTC","last_activity_date":"2016-10-28 16:13:44.08 UTC","last_edit_date":"2016-10-28 11:32:52.33 UTC","last_editor_display_name":"","last_editor_user_id":"697110","owner_display_name":"","owner_user_id":"697110","post_type_id":"1","score":"0","tags":"maven|jar|apache-storm","view_count":"81"} +{"id":"1415356","title":"Flex spacing inside vbox, hbox","body":"\u003cp\u003echildren inside hbox and vbox have spacing between them,\u003c/p\u003e\n\n\u003cp\u003ehow do you remove this empty space?\u003c/p\u003e\n\n\u003cp\u003eI need to have 0 space between child elements of a hbox or vbox\u003c/p\u003e","accepted_answer_id":"1415371","answer_count":"2","comment_count":"0","creation_date":"2009-09-12 15:19:32.13 UTC","favorite_count":"1","last_activity_date":"2015-12-02 19:13:16.88 UTC","last_edit_date":"2015-12-02 19:13:16.88 UTC","last_editor_display_name":"","last_editor_user_id":"2577734","owner_display_name":"","owner_user_id":"112100","post_type_id":"1","score":"5","tags":"flex|layout|containers","view_count":"8788"} +{"id":"43101808","title":"C# xml file creation adding same attribute both of child and parent nodes","body":"\u003cp\u003eI am using c# to create a xml file, however I got some problem.\nI would like to have both of parent and child nodes with a same attribute. But only one of those nodes has the attribute, even though I appended both of those.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003ewhat I expected:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;request\u0026gt;\n \u0026lt;transaction transactionId:\"123\"\u0026gt;\n \u0026lt;transactionDetail transactionId:\"123\"\u0026gt;\u0026lt;/transactionDetail\u0026gt;\n \u0026lt;/transaction\u0026gt;\n\u0026lt;/request\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003ewhat I got:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;request\u0026gt;\n \u0026lt;transaction\u0026gt;\n \u0026lt;transactionDetail transactionId:\"123\"\u0026gt;\u0026lt;/transactionDetail\u0026gt;\n \u0026lt;/transaction\u0026gt;\n\u0026lt;/request\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eor \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;request\u0026gt;\n \u0026lt;transaction transactionId:\"123\"\u0026gt;\n \u0026lt;transactionDetail\u0026gt;\u0026lt;/transactionDetail\u0026gt;\n \u0026lt;/transaction\u0026gt;\n\u0026lt;/request\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is depends on the order that I write code (The node I append later has attribute). Could you please help me out to find what's causing this problem?\u003c/p\u003e\n\n\u003cp\u003eAlso, I just wonder:\u003c/p\u003e\n\n\u003cp\u003eDoes the order of appending (both of .AppendChild() \u0026amp; .Append() ) matter?\u003c/p\u003e\n\n\u003cp\u003eCan't I reuse attributes which are already appended in other nodes?\u003c/p\u003e\n\n\u003cp\u003eThe following is the function to create xml file:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic ActionResult createXMLFile() {\n\n XmlDocument xmlFile = new XmlDocument();\n\n XmlNode request = xmlFile.CreateElement(\"request\");\n XmlNode transaction= xmlFile.CreateElement(\"transaction\");\n XmlNode transactionDetail= xmlFile.CreateElement(\"transactionDetail\");\n\n\n XmlAttribute transactionId= xmlFile.CreateAttribute(\"transactionId\");\n transactionId.Value = \"123\";\n\n transaction.Attributes.Append(transactionId);\n transactionDetail.Attributes.Append(transactionId);\n\n xmlFile.AppendChild(request);\n request.AppendChild(transaction);\n transaction.AppendChild(transactionDetail);\n\n string path =\"somepath\";\n\n xmlFile.Save(path);\n\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThank you for reading my question. :)\u003c/p\u003e","accepted_answer_id":"43110864","answer_count":"1","comment_count":"3","creation_date":"2017-03-29 18:51:05.28 UTC","last_activity_date":"2017-03-30 07:09:23.037 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7565718","post_type_id":"1","score":"0","tags":"c#|xml","view_count":"34"} +{"id":"20460967","title":"ERROR: Schema \"x\" does not exist","body":"\u003cp\u003eI'm attempting to select the users from a 'users' table that have the most occurrences of their 'order_id' property in the 'shipments' table. This is what I've tried:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT users.first_name, users.email, shipments.count(order_id) \n FROM users, shipments\n WHERE shipments.order_id = users.current_order_id\n GROUP by shipments.order_id\n ORDER by shipments.count(order_id) DESC\n LIMIT 25\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut I'm getting an error of:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eERROR: schema \"shipments\" does not exist\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny ideas?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-12-09 00:11:34.4 UTC","last_activity_date":"2013-12-09 00:13:59.673 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"296435","post_type_id":"1","score":"2","tags":"sql|postgresql","view_count":"2996"} +{"id":"35574557","title":"Yii2: Show and filter relational table in gridview","body":"\u003cp\u003eI have two tables: people \u0026amp; categories\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003ePeople\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e- id\n- name\n- ...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eCategories\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e- id\n- name\n- description\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd another table with the relation between both as one person can have multiple categories assigned:\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003ePeopleCategoriesAssn\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e- peopleID\n- categoryID\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI can show the categories IDs in my gridview (views/people/index.php) with:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?= GridView::widget([\n 'dataProvider' =\u0026gt; $dataProvider,\n 'filterModel' =\u0026gt; $searchModel,\n 'columns' =\u0026gt; [\n ...,\n [\n 'label' =\u0026gt; 'Category',\n 'value' =\u0026gt; function ($data) {\n $output = '';\n foreach($data-\u0026gt;peopleCategoriesAssns as $request) {\n $output .= $request-\u0026gt;talentCategoryID.'\u0026lt;br\u0026gt;';\n }\n return $output;\n },\n ],\n ...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhich uses this from models/People.php\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic function getPeopleCategoriesAssns() \n{ \n return $this-\u0026gt;hasMany(PeopleCategoriesAssn::className(), ['peopleID' =\u0026gt; 'id']); \n} \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow could I show the categories names instead of the categoies IDs within the gridview and also, what should i do at /models/PeopleSearch.php in order to allow search/filter on that field?\u003c/p\u003e\n\n\u003cp\u003eThank you in advance,\u003c/p\u003e","accepted_answer_id":"35575349","answer_count":"2","comment_count":"1","creation_date":"2016-02-23 10:11:42.107 UTC","favorite_count":"1","last_activity_date":"2016-02-23 12:34:45.953 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1823209","post_type_id":"1","score":"0","tags":"php|yii2","view_count":"443"} +{"id":"5763625","title":"Issue releasing data with core-data (CFDATA keep growing)","body":"\u003cp\u003eI have a memory problem with data-core. In a view controller I load an image (data) from a NSManagedObject, then display it, and next go to the next page to load another image, and so on.\nThe problem is that I can't release the data, in allocation tool keeps in CFDATA(store). Here is part of the code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e ComicImage *cimg = [page getImageData];\n\n\n NSData *data=cimg.imageData ;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eComicImage is a NSManagedObject, getImageData returns the ComicImage with the image to display.\u003c/p\u003e\n\n\u003cp\u003eReleasing data deletes the image in core-data, and I can't load it again (crash). I have tried refreshObject:mergeChanges, but no result; [context reset] crashes the app.\nAny idea?\nThanks.\u003c/p\u003e","answer_count":"3","comment_count":"2","creation_date":"2011-04-23 10:17:12.64 UTC","last_activity_date":"2012-01-01 15:15:03.24 UTC","last_edit_date":"2012-01-01 15:09:10.79 UTC","last_editor_display_name":"","last_editor_user_id":"431053","owner_display_name":"","owner_user_id":"721639","post_type_id":"1","score":"0","tags":"core-data|memory-management|allocation|nsmanagedobject","view_count":"939"} +{"id":"42204526","title":"How bandwidth works in terms of API calls","body":"\u003cp\u003eI want to know the relationship between bandwidth and API calls. Will the bandwidth on client side matters here or bandwidth on Server matters ?\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-02-13 12:51:43.707 UTC","last_activity_date":"2017-02-13 12:51:43.707 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6349233","post_type_id":"1","score":"1","tags":"api|hosting|web-hosting|bandwidth|throughput","view_count":"35"} +{"id":"23178860","title":"ImageView pinch to zoom, which is inside image flipper","body":"\u003cp\u003eI am working on application in android, which displays some preset images in image view inside the Flipper. I want to implement the zoom to this image views, on pinch zoom.I have implemented the flipper and swipe movemet to change the imageview on swipe gestures. I want to now implement the pinch to zoom.\nHeres the xml for activity.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;?xml version=\"1.0\" encoding=\"utf-8\"?\u0026gt;\n \u0026lt;RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:background=\"#ffffffff\"\n android:orientation=\"vertical\" \u0026gt;\n\n \u0026lt;ViewFlipper\n android:id=\"@+id/view_flipper\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\" \u0026gt;\n\n \u0026lt;RelativeLayout\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\" \u0026gt;\n\n \u0026lt;TextView\n android:id=\"@+id/textView1\"\n style=\"@style/ImageTitle\"\n android:layout_height=\"wrap_content\"\n android:text=\"Alto 800\" /\u0026gt;\n\n \u0026lt;ImageView\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_centerHorizontal=\"true\"\n android:layout_centerVertical=\"true\"\n android:layout_gravity=\"center\"\n android:adjustViewBounds=\"true\"\n android:scaleType=\"matrix\"\n android:src=\"@drawable/alto800\" /\u0026gt;\n\n \u0026lt;/RelativeLayout\u0026gt;\n\n \u0026lt;RelativeLayout\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\" \u0026gt;\n\n \u0026lt;ImageView\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_centerHorizontal=\"true\"\n android:layout_centerVertical=\"true\"\n android:layout_gravity=\"center\"\n android:adjustViewBounds=\"true\"\n android:scaleType=\"matrix\"\n android:src=\"@drawable/cheveroletbeat\" /\u0026gt;\n\n \u0026lt;TextView\n style=\"@style/ImageTitle\"\n android:text=\"Cheverolet Beat\" /\u0026gt;\n \u0026lt;/RelativeLayout\u0026gt;\n \u0026lt;/ViewFlipper\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHeres the java code which Implemented\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public class MainActivity extends Activity {\n\n private static final int SWIPE_MIN_DISTANCE = 120;\n private static final int SWIPE_THRESHOLD_VELOCITY = 200;\n private ViewFlipper mViewFlipper;\n private Context mContext;\n public MediaPlayer mp ;\n @SuppressWarnings(\"deprecation\")\n private final GestureDetector detector = new GestureDetector(\n new SwipeGestureDetector());\n\n int flag = 1;\n\n\n @Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.main);\n mp = MediaPlayer.create(getBaseContext(), R.raw.funtime);\n mp.setLooping(true);\n mp.start();\n\n mContext = this;\n\n mViewFlipper = (ViewFlipper) this.findViewById(R.id.view_flipper);\n mViewFlipper.setOnTouchListener(new OnTouchListener() {\n @Override\n public boolean onTouch(final View view, final MotionEvent event) {\n detector.onTouchEvent(event);\n return true;\n }\n });\n }@Override\n public void onDestroy()\n {\n super.onDestroy();\n mp.stop();\n }\n\n class SwipeGestureDetector extends SimpleOnGestureListener implements\n OnGestureListener {\n\n @Override\n public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,\n float velocityY) {\n\n try {\n // right to left swipe\n if (e1.getX() - e2.getX() \u0026gt; SWIPE_MIN_DISTANCE\n \u0026amp;\u0026amp; Math.abs(velocityX) \u0026gt; SWIPE_THRESHOLD_VELOCITY) {\n mViewFlipper.setInAnimation(AnimationUtils.loadAnimation(\n mContext, R.anim.right_in));\n mViewFlipper.setOutAnimation(AnimationUtils.loadAnimation(\n mContext, R.anim.left_out));\n mViewFlipper.showNext();\n MediaPlayer mediaPlayer = MediaPlayer.create(\n getBaseContext(), R.raw.vroom);\n mediaPlayer.start();\n return true;\n } else if (e2.getX() - e1.getX() \u0026gt; SWIPE_MIN_DISTANCE\n \u0026amp;\u0026amp; Math.abs(velocityX) \u0026gt; SWIPE_THRESHOLD_VELOCITY) {\n mViewFlipper.setInAnimation(AnimationUtils.loadAnimation(\n mContext, R.anim.left_in));\n mViewFlipper.setOutAnimation(AnimationUtils.loadAnimation(\n mContext, R.anim.right_out));\n\n mViewFlipper.showPrevious();\n MediaPlayer mediaPlayer = MediaPlayer.create(\n getBaseContext(), R.raw.vroom);\n mediaPlayer.start();\n return true;\n }\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return false;\n }\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ePlease guide me on pinch to zoom part here.\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2014-04-20 05:37:48.823 UTC","last_activity_date":"2014-04-20 05:37:48.823 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2978612","post_type_id":"1","score":"1","tags":"android|android-imageview","view_count":"659"} +{"id":"3150770","title":"SharePoint Silverlight Image viewer (AG_E_Network_Error)","body":"\u003cp\u003eMy application is a Silverlight Image viewer that displays images from Sharepoint using the Silverlight Image control (by setting the source propery). My app displays the first image and i can use navigation buttons to go forward and backward.\u003c/p\u003e\n\n\u003cp\u003eEverything is working fine, however after a certain amount of images (always the same amout for the same folder (probably when reaching the same download limit) i start getting the AG_E_Network_Error and the images can no more get loaded.\u003c/p\u003e\n\n\u003cp\u003eI can then no longer display any image (always the same error) until i refresh the application.\u003c/p\u003e\n\n\u003cp\u003eAny help pleaaaaase? any limit on downloading in a silverlight app?\u003c/p\u003e\n\n\u003cp\u003eGuys, please Help, it's urgent...any ideas?\u003c/p\u003e","accepted_answer_id":"3194468","answer_count":"1","comment_count":"0","creation_date":"2010-06-30 15:30:16.39 UTC","last_activity_date":"2010-07-07 12:04:30.153 UTC","last_edit_date":"2010-07-01 07:10:50.793 UTC","last_editor_display_name":"","last_editor_user_id":"186361","owner_display_name":"","owner_user_id":"186361","post_type_id":"1","score":"0","tags":"silverlight-3.0|imaging","view_count":"380"} +{"id":"40790997","title":"Rails JSON_API create Book with list of Genres","body":"\u003cp\u003eI'm trying to write my test to ensure creating a new \u003ccode\u003ebook\u003c/code\u003e with \u003ccode\u003egenres\u003c/code\u003e assigned to it works.\u003c/p\u003e\n\n\u003cp\u003eI am using Active Model Serializer with the JSON_API structure (\u003ca href=\"http://jsonapi.org/\" rel=\"nofollow noreferrer\"\u003ehttp://jsonapi.org/\u003c/a\u003e)\u003c/p\u003e\n\n\u003ch2\u003eBook Model File\u003c/h2\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass Book \u0026lt; ApplicationRecord\n belongs_to :author, class_name: \"User\"\n has_and_belongs_to_many :genres\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003ch2\u003eGenre Model File\u003c/h2\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass Genre \u0026lt; ApplicationRecord\n has_and_belongs_to_many :books\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003ch2\u003eBook Serializer file\u003c/h2\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass BookSerializer \u0026lt; ActiveModel::Serializer\n attributes :id, :title, :adult_content, :published\n\n belongs_to :author\n has_many :genres\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003ch2\u003eTest Sample Data\u003c/h2\u003e\n\n\u003cpre\u003e\u003ccode\u003edef setup\n ...\n @fantasy = genres(:fantasy)\n\n @newbook = {\n title: \"Three Little Pigs\",\n adult_content: false,\n author_id: @jim.id,\n published: false,\n genres: [{title: 'Fantasy'}]\n }\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003ch2\u003eTest Method\u003c/h2\u003e\n\n\u003cpre\u003e\u003ccode\u003etest \"book create - should create a new book\" do\n post books_path, params: @newbook, headers: user_authenticated_header(@jim)\n assert_response :created\n json = JSON.parse(response.body)\n puts \"json = #{json}\"\n assert_equal \"Three Little Pigs\", json['data']['attributes']['title']\n genre_data = json['data']['relationships']['genres']['data']\n\n puts \"genre_data = #{genre_data.count}\"\n assert_equal \"Fantasy\", genre_data\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003ch2\u003eBook Strong Params\u003c/h2\u003e\n\n\u003cpre\u003e\u003ccode\u003edef book_params\n params.permit(:title, :adult_content, :published, :author_id, :genres)\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003ch2\u003eTest Result (console response)\u003c/h2\u003e\n\n\u003cpre\u003e\u003ccode\u003e# Running:\n\n......................................................json = {\"data\"=\u0026gt;{\"id\"=\u0026gt;\"1018350796\", \"type\"=\u0026gt;\"books\", \"attributes\"=\u0026gt;{\"title\"=\u0026gt;\"Three Little Pigs\", \"adult-content\"=\u0026gt;false, \"published\"=\u0026gt;false}, \"relationships\"=\u0026gt;{\"author\"=\u0026gt;{\"data\"=\u0026gt;{\"id\"=\u0026gt;\"1027431151\", \"type\"=\u0026gt;\"users\"}}, \"genres\"=\u0026gt;{\"data\"=\u0026gt;[]}}}}\ngenre_data = 0\nF\n\nFailure:\nBooksControllerTest#test_book_create_-_should_create_a_new_book [/Users/warlock/App_Projects/Raven Quill/Source Code/Rails/raven-quill-api/test/controllers/books_controller_test.rb:60]:\nExpected: \"Fantasy\"\n Actual: []\n\n\nbin/rails test test/controllers/books_controller_test.rb:51\n\n\n\nFinished in 1.071044s, 51.3518 runs/s, 65.3568 assertions/s.\n\n55 runs, 70 assertions, 1 failures, 0 errors, 0 skips\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAs you can see from my JSON console log, it appears my genres are not being set(need to scroll to the right in the test output above). \u003c/p\u003e\n\n\u003cp\u003ePlease ignore this line:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eassert_equal \"Fantasy\", genre_data\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI know that's wrong. At the moment, the json is showing \u003ccode\u003egenre =\u0026gt; {data: []}\u003c/code\u003e (empty array), that's the thing I'm trying to solve at the moment.\u003c/p\u003e\n\n\u003cp\u003eHow do I go about creating a book with genres in this case, any ideas? :D\u003c/p\u003e","accepted_answer_id":"40791468","answer_count":"1","comment_count":"0","creation_date":"2016-11-24 16:21:05.893 UTC","last_activity_date":"2016-11-24 16:50:58.203 UTC","last_edit_date":"2016-11-24 16:40:34.593 UTC","last_editor_display_name":"","last_editor_user_id":"860967","owner_display_name":"","owner_user_id":"860967","post_type_id":"1","score":"1","tags":"ruby-on-rails|json-api","view_count":"40"} +{"id":"35719767","title":"Why I can't center the components horizontally in the div?","body":"\u003cp\u003eI have block and inside the blocks, there are three boxes. The CSS is \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e.blocks {\n display: block;\n margin: 0 auto;\n width: 60%;\n height: 350px; \n}\n\n\n.box1, .box2, .box3 {\n\n width: 33.333%;\n height: 300px;\n vertical-align: top;\n display: inline-block;\n zoom: 1;\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn the box, there is an image and a text. I want them centered horizontally.\nSo I did as\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e.box1, .box2, .box3 {\n\n width: 33.333%;\n height: 300px;\n vertical-align: top;\n display: inline-block;\n zoom: 1;\n margin-left: auto;\n margin-right: auto;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut they are not centered. As shown in the image.\n\u003ca href=\"https://i.stack.imgur.com/hOMAN.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/hOMAN.png\" alt=\"img\"\u003e\u003c/a\u003e\nMy HTML is \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"blocks\"\u0026gt;\n \u0026lt;div class=\"col-sm-4 col-xs-4 box1\" style=\"background-color:lavender;\"\u0026gt;\n \u0026lt;!-- One image and text here --\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"col-sm-4 col-xs-4 box2\" style=\"background-color:lavenderblush;\"\u0026gt;\n \u0026lt;!-- One image and text here --\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"col-sm-4 col-xs-4 box3\" style=\"background-color:lavender;\"\u0026gt;\n \u0026lt;!-- One image and text here --\u0026gt;\n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow to center the components horizontally in the div?\u003c/p\u003e","accepted_answer_id":"35720031","answer_count":"4","comment_count":"3","creation_date":"2016-03-01 09:58:21.107 UTC","last_activity_date":"2016-03-01 10:19:39.903 UTC","last_edit_date":"2016-03-01 10:00:15.377 UTC","last_editor_display_name":"","last_editor_user_id":"310726","owner_display_name":"","owner_user_id":"2467772","post_type_id":"1","score":"0","tags":"html|css","view_count":"57"} +{"id":"35169854","title":"Map value to item from list and add the new value to the same list C#","body":"\u003cp\u003eI have an Array of colors viz. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar colorPallete = new string[]{color1, color2, color3, color4, color5};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI also have a list of objects which contains an ID.\neg. \u003ccode\u003evar previousList\u0026lt;MyModel\u0026gt; = new List\u0026lt;MyModel\u0026gt;();\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eMyModel.cs\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class MyModel()\n{\n public int ID {get; set;}\npublic string Class{get; set;}\npublic string Name {get; set;}\npublic string Color {get; set;}\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to assign the objects with same ID with a certain color. And then add the assigned color as a new value to the list.\u003c/p\u003e\n\n\u003cp\u003efor eg:\u003c/p\u003e\n\n\u003cp\u003ePrevious list :-\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e ID :1\n Name: abc\n Class: Senior\n\n ID :2\n Name: xyz\n Class: Medium\n\n ID :3\n Name: pqr\n Class: junior\n\n ID :1\n Name: mno\n Class: junior\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNew List :-\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e ID :1\n Name: abc\n Class: Senior\n Color :color1\n\n ID :2\n Name: xyz\n Class: Medium\n Color :color2\n\n ID :3\n Name: pqr\n Class: junior\n Color :color3\n\n ID :1\n Name: mno\n Class: junior\n Color :color1\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"35178190","answer_count":"3","comment_count":"0","creation_date":"2016-02-03 06:20:31.947 UTC","last_activity_date":"2016-02-04 10:17:41.56 UTC","last_edit_date":"2016-02-03 11:08:37.993 UTC","last_editor_display_name":"","last_editor_user_id":"5163129","owner_display_name":"","owner_user_id":"5163129","post_type_id":"1","score":"1","tags":"c#|list|dictionary","view_count":"62"} +{"id":"30043956","title":"Internal compiler error in condition with bool property","body":"\u003cp\u003elately I have been faced with a strange problem that a simple source did not want to compile. I was looking for solutions (and cause) in many sites but without good effects (except bugs reports but I have not found there direct cause ).\u003c/p\u003e\n\n\u003cp\u003eBelow I present simple code to reproduce that situation:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003estruct Foo {\n Foo() : m_x( true ) {}\n __property bool x = { read=m_x };\n\n private:\n bool m_x;\n};\n\ntemplate\u0026lt;typename T\u0026gt;\nstruct TMyPointer {\n T * m_ptr;\n TMyPointer( T * ptr ) : m_ptr( ptr ) {}\n ~TMyPointer()\n {\n delete m_ptr;\n }\n\n T * operator-\u0026gt;() const\n {\n return Get();\n }\n\n T * Get() const\n {\n if( m_ptr == NULL )\n ; // some error handling\n\n return m_ptr;\n }\n};\n\nint _tmain(int argc, _TCHAR* argv[])\n{\n TMyPointer\u0026lt;Foo\u0026gt; bar( new Foo );\n\n if( bar-\u0026gt;x \u0026amp;\u0026amp; 1 == 1 ) ; // Failed\n if( 1 == 1 \u0026amp;\u0026amp; bar-\u0026gt;x ) ; // OK\n if( !!bar-\u0026gt;x \u0026amp;\u0026amp; 1 == 1 ) ; // OK\n if( bar-\u0026gt;x == true \u0026amp;\u0026amp; 1 == 1 ) ; // OK\n if( (bar-\u0026gt;x) \u0026amp;\u0026amp; 1 == 1 ) ; // OK\n\n return 0;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCompiler has failed to compile first condition inside main function. What stranger compilation of other equivalent conditions is finished successfully.\u003c/p\u003e\n\n\u003cp\u003eThat's behavior I have only during release compilation. To reproduce I have used Embarcadero® C++Builder® XE5 Version 19.0.13476.4176\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eError message: [bcc32 Fatal Error] File1.cpp(43): F1004 Internal\n compiler error at 0x14470090 with base 0x14410000\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eAnybody knows what is the problematic in above example? Maybe usage templates with properties mechanism is the cause?\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2015-05-05 03:50:48.717 UTC","last_activity_date":"2015-05-05 03:51:45.517 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4864488","post_type_id":"1","score":"2","tags":"c++|c++builder|c++builder-xe5","view_count":"402"} +{"id":"14655639","title":"Assigning a lambda expression causes it to not be executed later?","body":"\u003cp\u003eI seem to be having trouble executing a lambda expression that I've previously assigned to a variable. Here's a small C# example program I've put together:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class Program\n{\n public static void Main(string[] args)\n {\n int[] notOrdered = { 3, 2, 5, 8, 1, 4, 7, 9, 6 };\n Print(notOrdered);\n\n IEnumerable\u0026lt;int\u0026gt; ascOrdered = Order(notOrdered, true);\n Print(ascOrdered);\n\n IEnumerable\u0026lt;int\u0026gt; descOrdered = Order(notOrdered, false);\n Print(descOrdered);\n }\n\n static IEnumerable\u0026lt;T\u0026gt; Order\u0026lt;T\u0026gt;(IEnumerable\u0026lt;T\u0026gt; enumerables, bool ascending)\n {\n Expression\u0026lt;Func\u0026lt;T, object\u0026gt;\u0026gt; selector = (z) =\u0026gt; z; // simple for demo purposes; pretend it's complex\n if (ascending)\n return enumerables.OrderBy(z =\u0026gt; selector);\n else\n return enumerables.OrderByDescending(z =\u0026gt; selector);\n }\n\n static void Print\u0026lt;T\u0026gt;(IEnumerable\u0026lt;T\u0026gt; enumerables)\n {\n foreach(T enumerable in enumerables)\n Console.Write(enumerable.ToString() + \" \");\n Console.WriteLine();\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want it to produce this output:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e3 2 5 8 1 4 7 9 6\u003c/p\u003e\n \n \u003cp\u003e1 2 3 4 5 6 7 8 9\u003c/p\u003e\n \n \u003cp\u003e9 8 7 6 5 4 3 2 1\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eBut, confusingly, it produces this output:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e3 2 5 8 1 4 7 9 6\u003c/p\u003e\n \n \u003cp\u003e3 2 5 8 1 4 7 9 6\u003c/p\u003e\n \n \u003cp\u003e3 2 5 8 1 4 7 9 6\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eBasically, I just want to be able to pass the same expression to the two different ordering operations without having to type it out twice, hence why I assign it to \u003ccode\u003eselector\u003c/code\u003e beforehand. I have a real-world use case where the lambda expression is really long/messy and I don't want to duplicate the mess, I'd rather just refer to a variable like I have here.\u003c/p\u003e\n\n\u003cp\u003eSo, a) what is causing the current output? b) how can I get the output that I want?\u003c/p\u003e","accepted_answer_id":"14655699","answer_count":"3","comment_count":"5","creation_date":"2013-02-01 21:51:07.793 UTC","favorite_count":"3","last_activity_date":"2013-02-01 22:11:54.353 UTC","last_edit_date":"2013-02-01 22:11:54.353 UTC","last_editor_display_name":"","last_editor_user_id":"963396","owner_display_name":"","owner_user_id":"963396","post_type_id":"1","score":"5","tags":"c#|.net|linq|lambda|linq-expressions","view_count":"168"} +{"id":"15991564","title":"How to compile this hello world OS?","body":"\u003cp\u003eI am trying to experiment with the \u003ca href=\"http://www.acm.uiuc.edu/sigops/roll_your_own/1.helloworld.html\" rel=\"nofollow\"\u003ehelloWorld OS\u003c/a\u003e. I followed the instructions given but cannot make \u003ccode\u003emain.c\u003c/code\u003e. I looked in the make file and it refrences \u003ccode\u003e./bootmaker\u003c/code\u003e which is not in the folder they say to download. It looks as if it's a script that they ran but I do not know how to get it or create it. Where can I get \u003ccode\u003e./bootmaker\u003c/code\u003e or are there programs that will do the same job as it that I can use instead?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eUpdate\u003c/strong\u003e\u003cbr\u003e\nI'd like to add that this was a classic case of not fully reading the documentation provided to me which caused my confusion and I apollogize for the bad post.\u003c/p\u003e","accepted_answer_id":"15992453","answer_count":"1","comment_count":"1","creation_date":"2013-04-13 18:49:10.017 UTC","last_activity_date":"2014-09-30 17:06:35.69 UTC","last_edit_date":"2014-09-30 17:06:35.69 UTC","last_editor_display_name":"","last_editor_user_id":"2278110","owner_display_name":"","owner_user_id":"2278110","post_type_id":"1","score":"-2","tags":"c|operating-system|boot","view_count":"324"} +{"id":"5680838","title":"ASP.net Page Life Cycle Problem","body":"\u003cp\u003eI understand the ASP.net Page Life Cycle, I get that when I click a button, it first reloads the page then it executes the code behind for my button. My question is how do I get it so that I can set something before this process happens. I am trying to pass a variable that the button has been clicked, but because of the page life cycle it never receives this. What can I do so that I can determine that this button has been clicked maybe I am over-thinking this, or even under-thinking.\u003c/p\u003e\n\n\u003cp\u003ePage Load:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e ImageButton btn = (ImageButton)(Page.FindControl(\"displayYImgBtn\"));\n if (btn != null)\n {\n string state = btn.CommandArgument;\n if (state == \"true\")\n {\n search();\n btn.CommandArgument = \"false\";\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eButton:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e ImageButton btn = (ImageButton)(sender);\n btn.CommandArgument = \"true\";\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"5681131","answer_count":"4","comment_count":"3","creation_date":"2011-04-15 18:26:10.7 UTC","last_activity_date":"2011-04-15 19:00:47.47 UTC","last_edit_date":"2011-04-15 18:46:39.607 UTC","last_editor_display_name":"","last_editor_user_id":"595208","owner_display_name":"","owner_user_id":"595208","post_type_id":"1","score":"0","tags":"c#|asp.net|postback|page-lifecycle","view_count":"1822"} +{"id":"43751590","title":"groovy script to remove users from jenkins project role alone?","body":"\u003cp\u003e\u003cdiv class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\"\u003e\r\n\u003cdiv class=\"snippet-code\"\u003e\r\n\u003cpre class=\"snippet-code-html lang-html prettyprint-override\"\u003e\u003ccode\u003eimport hudson.security.*\r\n import jenkins.security.*\r\n import jenkins.model.Jenkins\r\n\r\n def sids = Jenkins.instance.authorizationStrategy.getAllSIDs()\r\n return sids\r\n\r\nIn the Build Section;\r\n\r\n def removeAMP(Job jobName, user ) {\r\n println jobName.name.center(80,'-')\r\n \r\n def authorizationMatrixProperty = jobName.getProperty(AuthorizationMatrixProperty.class)\r\n Map\u0026lt;Permission,Set\u0026lt;String\u0026gt;\u0026gt; Permissions = authorizationMatrixProperty.getGrantedPermissions()\r\n println \"Permission Map Before: \" + Permissions + cr\r\n println \"Permission Values: \" + Permissions.values() + cr\r\n \r\n for (Set\u0026lt;String\u0026gt; permissionUsers:Permissions.values()) {\r\n permissionUsers.remove(user) \r\n }\r\n println \"Permission Map After: \" + Permissions + cr\r\n jobName.save();\r\n }\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003c/p\u003e\n\n\u003cp\u003eI created a job in jenkins with \"Execute system grrovy script\" for removing users from project role not from jenkins global role.with following scripts,but am getting error as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eERROR: Build step failed with exception\norg.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:\nScript1.groovy: 10: unable to resolve class Job \n @ line 10, column 19.\n def removeAMP(Job jobName, user ) {\n ^\n\n1 error\n\nat org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:302)\nat org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:861)\nat org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:550)\nat org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:499)\nat groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:302)\nat groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:281)\nat groovy.lang.GroovyShell.parseClass(GroovyShell.java:731)\nat groovy.lang.GroovyShell.parse(GroovyShell.java:743)\nat groovy.lang.GroovyShell.parse(GroovyShell.java:723)\nat groovy.lang.GroovyShell.evaluate(GroovyShell.java:680)\nat groovy.lang.GroovyShell.evaluate(GroovyShell.java:666)\nat hudson.plugins.groovy.SystemGroovy.perform(SystemGroovy.java:81)\nat hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)\nat hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782)\nat hudson.model.Build$BuildExecution.build(Build.java:205)\nat hudson.model.Build$BuildExecution.doRun(Build.java:162)\nat hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)\nat hudson.model.Run.execute(Run.java:1738)\nat hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)\nat hudson.model.ResourceController.execute(ResourceController.java:98)\nat hudson.model.Executor.run(Executor.java:410)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBuild step 'Execute system Groovy script' marked build as failure\nFinished: FAILURE\u003c/p\u003e\n\n\u003cp\u003ePlease help me with correct script.Thanks in advance\nAshif\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-05-03 05:15:29.793 UTC","last_activity_date":"2017-05-03 07:11:16.39 UTC","last_edit_date":"2017-05-03 07:11:16.39 UTC","last_editor_display_name":"","last_editor_user_id":"673282","owner_display_name":"","owner_user_id":"7755279","post_type_id":"1","score":"0","tags":"jenkins|groovy","view_count":"140"} +{"id":"7143242","title":"Is there a CSS selector for an IMG which has been constrained by max-width or max-height?","body":"\u003cp\u003eIf I define the following CSS rule:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimg {\n max-width: 200px;\n max-height: 200px;\n border: 1px solid black;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs there a pure-CSS way of detecting those image objects that would have been larger without the size constraints? Something that semantically matches:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimg:resized {\n border-color: green;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003chr\u003e\n\n\u003cp\u003eAlternatively: is there a way of only detecting large images in the first place? For example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimg {\n border: 1px solid black;\n}\nimg[width\u0026gt;200px], img[height\u0026gt;200px] {\n max-width: 200px;\n max-height: 200px;\n border-color: green;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","accepted_answer_id":"7143264","answer_count":"1","comment_count":"3","creation_date":"2011-08-22 04:40:35.067 UTC","favorite_count":"1","last_activity_date":"2011-08-22 04:46:46.823 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"765382","post_type_id":"1","score":"4","tags":"css|css3|css-selectors","view_count":"2033"} +{"id":"42415504","title":"Order By in @Query select not working","body":"\u003cp\u003eI have this Query in my JPA repository - and it works EXCEPT the \" order by \" part. Am i doing this wrong ? is it different in hql ?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@Query(value = \"select wm.WagerIdentification, wm.BoardNumber, wm.MarkSequenceNumber, wm.MarkNumber,\" +\n \" pt.CouponTypeIdentification, pt.WagerBoardQuickPickMarksBoard \" +\n \"from WagerBoard wb \" +\n \"inner join wb.listOfWagerMarks wm \" +\n \"inner join wb.poolgameTransaction pt \" +\n \"where wb.WagerIdentification = wm.WagerIdentification and wb.BoardNumber = wm.BoardNumber and wb.GameIdentification = wm.GameIdentification and wm.meta_IsCurrent = 1 \" +\n \"and wb.TransactionIdentification = pt.TransactionIdentification and pt.meta_IsCurrent = 1 \" +\n \"and wb.meta_IsCurrent = 1 order by wm.WagerIdentification asc, wm.BoardNumber asc, wm.MarkNumber asc\")\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"42419546","answer_count":"1","comment_count":"5","creation_date":"2017-02-23 12:15:04.1 UTC","favorite_count":"1","last_activity_date":"2017-02-23 15:12:08.467 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5903934","post_type_id":"1","score":"-1","tags":"java|hibernate|jpa|spring-boot","view_count":"105"} +{"id":"40304575","title":"$and not returning any value mongodb","body":"\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/3m4Qu.png\" rel=\"nofollow\"\u003eHere is the Screenshot of what i have tried\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://docs.mongodb.com/manual/reference/operator/query/and/#examples\" rel=\"nofollow\"\u003ehttps://docs.mongodb.com/manual/reference/operator/query/and/#examples\u003c/a\u003e\nthe documentation which i referred but not working.\u003c/p\u003e\n\n\u003cp\u003ei tried running the same operations on online terminal too of tutorialspoint, its leading to the same results.\u003c/p\u003e\n\n\u003cp\u003eIs there anything wrong that i am doing? because according to the documentation of version 3.2.x , the $or operation which is given there, i am performing the same and its working,but $and is not working.\u003c/p\u003e\n\n\u003cp\u003emy mongodb version is 3.2.10\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2016-10-28 11:56:55.97 UTC","last_activity_date":"2016-10-28 12:12:46.463 UTC","last_edit_date":"2016-10-28 12:05:56.93 UTC","last_editor_display_name":"","last_editor_user_id":"6710750","owner_display_name":"","owner_user_id":"6710750","post_type_id":"1","score":"0","tags":"mongodb","view_count":"19"} +{"id":"18355655","title":"ComponentOne Combobox Interactions MVVM","body":"\u003cp\u003eI am working with ComponentOne WPF Controls with MVVM Pattern.\u003c/p\u003e\n\n\u003cp\u003eI have the following in my ViewModel:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public ICommand ClientsEnter\n {\n get\n {\n if (this.m_ClientsEnter == null)\n {\n this.m_ClientsEnter = new DelegateCommand\u0026lt;string\u0026gt;(ClientsLostFocusExecute, ClientsLostFocusCanExecute);\n }\n return m_ClientsEnter;\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd an observable collection :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public ObservableCollection\u0026lt;Client\u0026gt; Clients\n {\n get { return m_Clients; }\n set\n {\n m_Clients = value;\n RaisePropertyChanged(\"Clients\");\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ein Xaml I have Added A ComponentOne Combo Box where I can enter \u003ccode\u003eClientName\u003c/code\u003e Or \u003ccode\u003eID\u003c/code\u003e and press enter to fire Event to execute \u003ccode\u003eClientsEnter\u003c/code\u003e Command:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;Custom1:C1ComboBox Grid.Row=\"2\" Grid.Column=\"1\" Height=\"24\" Name=\"cmbClients\" HorizontalAlignment=\"Left\" VerticalAlignment=\"Center\"\n ItemsSource=\"{Binding Clients, Mode=OneWay}\" SelectedValuePath=\"ClientID\" DisplayMemberPath=\"NameE\" IsEditable=\"True\"\n Text=\"Enter Client Name Or ID\" SelectedValue=\"{Binding Path=Filter.ClientID, Mode=TwoWay}\" MinWidth=\"150\" Margin=\"0,2\" Width=\"189\"\u0026gt;\n \u0026lt;i:Interaction.Triggers\u0026gt;\n \u0026lt;ei:KeyTrigger Key=\"Tab\" FiredOn=\"KeyUp\" ActiveOnFocus=\"True\" SourceName=\"cmbClients\"\u0026gt;\n \u0026lt;i:InvokeCommandAction Command=\"{Binding ClientsEnter, Mode=OneWay}\" CommandParameter=\"{Binding Text,ElementName=cmbClients}\" CommandName=\"KeyDown\"/\u0026gt;\n \u0026lt;/ei:KeyTrigger\u0026gt;\n \u0026lt;/i:Interaction.Triggers\u0026gt;\n \u0026lt;/Custom1:C1ComboBox\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI need to know why it doesn't work, after pressing enter the \u003ccode\u003eclientID\u003c/code\u003e Disappears and nothing happens. Even the \u003ccode\u003etext=\"Enter Client Name Or ID\"\u003c/code\u003e doesn't appear! Any ideas?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-08-21 11:01:07.343 UTC","last_activity_date":"2013-08-24 00:16:45.027 UTC","last_edit_date":"2013-08-21 11:24:36.83 UTC","last_editor_display_name":"","last_editor_user_id":"1187493","owner_display_name":"","owner_user_id":"1695291","post_type_id":"1","score":"0","tags":"mvvm|wpf-controls|wpf-4.0|componentone","view_count":"315"} +{"id":"10076233","title":"reusing the same table across several views in rails","body":"\u003cp\u003eJust learning rails and looking for best practices help. I have the same data table that is reused across several different views (index, search results) for my controller. In an attempt to keep it DRY I have the table code in a helper method using html\u0026lt;\u0026lt; for table HTML.\u003c/p\u003e\n\n\u003cp\u003eI realize that now I've pulled a chunk of my HTML into the controller which I'm not a big fan of. How is this situation of having a chunk of HTML you plan to reuse across several views handled best?\u003c/p\u003e\n\n\u003cp\u003eThanks! \u003c/p\u003e","accepted_answer_id":"10076286","answer_count":"1","comment_count":"1","creation_date":"2012-04-09 16:21:52.63 UTC","last_activity_date":"2012-04-09 16:26:09.647 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1133424","post_type_id":"1","score":"0","tags":"ruby-on-rails|ruby-on-rails-3","view_count":"136"} +{"id":"43317006","title":"Why Quartz 2.* does not cleanup indexes in Postgres database?","body":"\u003cp\u003eI use Quartz 2.* in cluster mode. Quartz uses Postgres database for clustering feature. Database size grows as the Java application works. The only reason for this growing is that Quartz does not cleanup it's indexes on tables:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003equartz.qrtz_triggers\nquartz.qrtz_cron_triggers\nquartz.qrtz_fired_triggers\nquartz.qrtz_scheduler_state\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOne week of application working increases database by ~500 MiB. I have 5 microservices which use Quartz, so the whole database grows by 5*500 MiB each week.\u003c/p\u003e\n\n\u003cp\u003eThen I need to execute manually:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eREINDEX TABLE quartz.qrtz_cron_triggers;\nREINDEX TABLE quartz.qrtz_fired_triggers;\nREINDEX TABLE quartz.qrtz_triggers;\nREINDEX TABLE quartz.qrtz_scheduler_state;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd after it the database's size becomes adequate.\u003c/p\u003e\n\n\u003cp\u003eIs it normal?\u003c/p\u003e\n\n\u003cp\u003eHow to configure Quartz/Postgres to cleanup it's stuff atomatically?\u003c/p\u003e","accepted_answer_id":"43859152","answer_count":"1","comment_count":"9","creation_date":"2017-04-10 07:18:38.27 UTC","favorite_count":"1","last_activity_date":"2017-05-09 00:28:02.18 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3046683","post_type_id":"1","score":"2","tags":"java|postgresql|indexing|quartz-scheduler","view_count":"127"} +{"id":"15403093","title":"How do I acces/open a default application in different devices","body":"\u003cp\u003eI am currently working on a \u003cstrong\u003eLauncher Activity\u003c/strong\u003e(min SDK version:7), and stumbled upon a serious issue. Is there any \u003cstrong\u003eEFFICIENT METHOD\u003c/strong\u003e by which I could access/open a \u003cstrong\u003eDefault App\u003c/strong\u003e (like the dialer, browser, sms conversation list, email client, system settings,etc),which are commonly found in different devices(like \u003cstrong\u003e\u003cem\u003eSamsung\u003c/em\u003e\u003c/strong\u003e, \u003cstrong\u003e\u003cem\u003eHTC\u003c/em\u003e\u003c/strong\u003e, \u003cstrong\u003e\u003cem\u003eSony\u003c/em\u003e\u003c/strong\u003e, \u003cstrong\u003e\u003cem\u003eLG\u003c/em\u003e\u003c/strong\u003e, \u003cstrong\u003e\u003cem\u003eMotorola\u003c/em\u003e\u003c/strong\u003e, etc), but have different package names.\u003c/p\u003e\n\n\u003cp\u003eI know that I can access them by calling an intent, For example I could open the \u003cstrong\u003e\u003cem\u003eDefault SMS Client\u003c/em\u003e\u003c/strong\u003e like so:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eIntent intent = new Intent(\"android.intent.action.MAIN\");\n intent.setComponent(new ComponentName(\"com.android.mms\",\"com.android.mms.ui.ConversationList\"));\n startActivity(intent);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut the package name differs when it comes to different manufactures(like the ones mention above)\nie in the case of opening the \u003cstrong\u003e\u003cem\u003esms client of motorola devices\u003c/em\u003e\u003c/strong\u003e the code changes so:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eIntent moto_intent = new Intent(\"android.intent.action.MAIN\");\n intent.setComponent(new ComponentName(\"com.motorola.blur.conversations\",\"com.motorola.blur.conversations.ui.ConversationList\"));\n startActivity(moto_intent);\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-03-14 07:01:23.863 UTC","favorite_count":"1","last_activity_date":"2013-03-14 07:22:18.927 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2168527","post_type_id":"1","score":"0","tags":"android","view_count":"150"} +{"id":"28267868","title":"WPF - How to bind elements in separate xmal files?","body":"\u003cp\u003eI have a MainWindow.xmal which has two TabItems:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;TabItem Header=\"Config\" ... /\u0026gt;\n\u0026lt;TabItem Header=\"Results\" ... /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have a separated Config.xaml file for the Config TabItem which has a ListBox:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;ListBox Name=\"UrlConfig\" ... /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have another separated Results.xaml file for the Results TabItem which has a TaxtBlock:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;TextBlock Name=\"Url\" .../\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe problem is that I'd like to bind the selected value in the ListBox to the TextBlock. How can I do that? Please help :)\u003c/p\u003e","accepted_answer_id":"28362757","answer_count":"2","comment_count":"0","creation_date":"2015-02-01 21:04:32.453 UTC","last_activity_date":"2015-02-09 12:10:36.07 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3103185","post_type_id":"1","score":"1","tags":"c#|wpf|xaml|data-binding","view_count":"380"} +{"id":"39895451","title":"javascript format issues with ()","body":"\u003cp\u003ei got a little code but it doesnt work. i think i have an error with the ( ) cause there are too many x)\u003c/p\u003e\n\n\u003cp\u003ecode:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eif (structure == null) {\n console.log('so far so good: ');\n if (_.sum(Game.getObjectById(57 f5db55fc5a39220c785df5).store) \u0026lt; Game.getObjectById(57 f5db55fc5a39220c785df5).storeCapacity) {\n if (creep.transfer(Game.getObjectById(57 f5db55fc5a39220c785df5), RESOURCE_ENERGY, creep.energy) == ERR_NOT_IN_RANGE) {\n // move towards it\n creep.moveTo(Game.getObjectById(57 f5db55fc5a39220c785df5));\n }\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eanyone can understand what went wrong here? :p\u003c/p\u003e","accepted_answer_id":"39895533","answer_count":"2","comment_count":"3","creation_date":"2016-10-06 12:01:50.96 UTC","last_activity_date":"2016-10-06 12:35:16.4 UTC","last_edit_date":"2016-10-06 12:35:16.4 UTC","last_editor_display_name":"","last_editor_user_id":"6285410","owner_display_name":"","owner_user_id":"3220962","post_type_id":"1","score":"-2","tags":"javascript","view_count":"43"} +{"id":"26098382","title":"How can I pass a parameter to the parent's constructor from the main constructor?","body":"\u003cp\u003eI have these models:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass Content_model extends MY_Model{\n\n public function __construct()\n {\n $test='main_content';\n parent::__construct($test); \n }\n}\n\nclass MY_Model extends CI_Model {\n\n public function __construct($recived_parameter) {\n parent::__construct ();\n // do something with $recived_parameter\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to pass the argument \u003ccode\u003e$test\u003c/code\u003e to MY_Model's construct, but nothing seems to be recived. Any ideas?\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2014-09-29 11:03:51.207 UTC","last_activity_date":"2014-09-29 12:40:09.82 UTC","last_edit_date":"2014-09-29 12:40:09.82 UTC","last_editor_display_name":"","last_editor_user_id":"84631","owner_display_name":"","owner_user_id":"2110973","post_type_id":"1","score":"1","tags":"php|codeigniter","view_count":"56"} +{"id":"7375857","title":"Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed","body":"\u003cp\u003eI've attempted to add a \"service based data base\" (.mdf) to a project in an asp .net application. From there I've proceeded attempted to create an entity framework model file (.edmx).\u003c/p\u003e\n\n\u003cp\u003eWhen doing so I get the error: \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eAn error occurred while connecting to the database. The database might be unavailable. An exception of type 'System.Data.SqlClient.SqlException' occurred. The error message is: 'Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.'.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI've got SQL Server 2008 R2 Express edition installed on my machine.\u003c/p\u003e\n\n\u003cp\u003eAny ideas would be most appreciated.\u003c/p\u003e","answer_count":"3","comment_count":"3","creation_date":"2011-09-11 02:01:45.707 UTC","favorite_count":"2","last_activity_date":"2014-12-04 19:17:03.71 UTC","last_edit_date":"2013-12-08 20:34:25.347 UTC","last_editor_display_name":"","last_editor_user_id":"1726308","owner_display_name":"","owner_user_id":"590088","post_type_id":"1","score":"18","tags":"asp.net|sql-server-express","view_count":"41327"} +{"id":"31017640","title":"JQuery function is not being called","body":"\u003cp\u003eBelow is my HTML code to handle, on click of \u003ccode\u003eid\u003c/code\u003e, it has to call javascript function \u003ccode\u003eviewLineActionURL\u003c/code\u003e and then to controller. Both of the alerts are coming, but still it is not calling the controller \u003ccode\u003emodifyLine\u003c/code\u003e method. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;script\u0026gt;\nvar viewLineActionURL;\n$(document).ready(function() {\nviewLineActionURL = function(obj) {\n alert('view*' + obj + '*'); \n $(\"#formname\").attr(\"action\",obj); // To Controller\n alert('false..'); \n }; \n}); \n\u0026lt;/script\u0026gt; \n\n\n\u0026lt;table class=\"tg\" id=\"pResultsjoin\"\u0026gt;\n \u0026lt;thead align=\"left\"\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;th class=\"tg\"\u0026gt;\u0026lt;input type=\"checkbox\" id=\"all\" disabled=\"disabled\" onclick=\"toggle(this);\" /\u0026gt;\u0026lt;/th\u0026gt;\n \u0026lt;th class=\"tg\"\u0026gt;Person Id#\u0026lt;/th\u0026gt;\n \u0026lt;th class=\"tg\"\u0026gt;Age\u0026lt;/th\u0026gt; \n \u0026lt;/tr\u0026gt;\n \u0026lt;/thead\u0026gt;\n \u0026lt;tbody align=\"left\"\u0026gt;\n \u0026lt;tr th:each=\"map : ${list}\"\u0026gt;\n \u0026lt;td class=\"tg bg\"\u0026gt;\u0026lt;input type=\"checkbox\" class=\"checkboxclass\" name=\"check\" th:value=\"${map['PID']}\" /\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;td class=\"tg bg em\" th:id=\"${map['PID']}\" th:name=\"${map['PID']}\" th:text=\"${map['PID']}\" th:onclick=\"'javascript:viewLineActionURL(\\'' + @{/LineController/modifyLine} + '\\')'\" \u0026gt;\u0026lt;/td\u0026gt; \n \u0026lt;td class=\"tg bg\" th:text=\"${map['AGE']}\"\u0026gt;\u0026lt;/td\u0026gt; \n \u0026lt;/tr\u0026gt;\n \u0026lt;/tbody\u0026gt;\n\u0026lt;/table\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut I have this below similar code working:\u003c/p\u003e\n\n\u003cp\u003eButton:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;input type=\"submit\" value=\"Modify\" class=\"btn btn-primary\" id=\"modifyLine\" th:onclick=\"'javascript:modifyLineActionURL(\\'' + @{/LineController/modifyLine} + '\\')'\" /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eJavascript:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emodifyLineActionURL = function(obj) { \n if ($('.checkboxclass:checked').length == 1) { \n $(\"#formname\").attr(\"action\",obj);\n } else if ($('.checkboxclass:checked').length \u0026gt; 1) { \n alert('Please select only one quotation line');\n } else { \n alert('Please select a quotation line');\n }\n };\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCan anyone help on this issue\u003c/p\u003e","answer_count":"0","comment_count":"8","creation_date":"2015-06-24 04:29:42.567 UTC","last_activity_date":"2015-06-24 05:38:32.877 UTC","last_edit_date":"2015-06-24 05:38:32.877 UTC","last_editor_display_name":"","last_editor_user_id":"4887857","owner_display_name":"","owner_user_id":"4887857","post_type_id":"1","score":"1","tags":"javascript|jquery|html5|thymeleaf","view_count":"73"} +{"id":"26778835","title":"Use a transparent button in TableView cells on Android","body":"\u003cp\u003ePlease take a look at the following layout. This layout is used in a TableView and is applied in each row. The question is why the button in each tablerow is only clickable in the upper half of the tableviewcell when transparency is applied.\nWithout transparency the button fills up the correct amount of space.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" encoding=\"utf-8\"?\u0026gt;\n\u0026lt;RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"match_parent\"\n android:paddingBottom=\"10dp\"\n android:paddingTop=\"10dp\" \u0026gt;\n\n \u0026lt;ImageButton\n android:id=\"@+id/btnSelect\"\n android:layout_width=\"40dp\"\n android:layout_height=\"wrap_content\"\n android:layout_alignParentLeft=\"true\"\n android:layout_centerVertical=\"true\"\n android:background=\"@color/white\"\n android:contentDescription=\"Geselecteerde rekening\"\n android:src=\"@drawable/checkbox_akkoord_uit\" /\u0026gt;\n\n \u0026lt;ImageView\n android:id=\"@+id/imgPhoto\"\n android:layout_width=\"40dp\"\n android:layout_height=\"40dp\"\n android:layout_alignBottom=\"@+id/btnSelect\"\n android:layout_marginLeft=\"4dp\"\n android:layout_centerVertical=\"true\"\n android:layout_toRightOf=\"@+id/btnSelect\"\n android:scaleType=\"fitCenter\"\n android:src=\"@drawable/icon_foto\" /\u0026gt;\n\n \u0026lt;ImageView\n android:id=\"@+id/imgPencil\"\n android:layout_width=\"40dp\"\n android:layout_height=\"40dp\"\n android:layout_alignBottom=\"@+id/btnSelect\"\n android:layout_marginLeft=\"4dp\"\n android:layout_centerVertical=\"true\"\n android:layout_toRightOf=\"@+id/btnSelect\"\n android:src=\"@drawable/potlood\" /\u0026gt;\n\n \u0026lt;ImageView\n android:id=\"@+id/ivDrag\"\n android:layout_width=\"20dp\"\n android:layout_height=\"20dp\"\n android:layout_alignParentRight=\"true\"\n android:layout_marginRight=\"@dimen/activity_horizontal_margin\"\n android:layout_centerVertical=\"true\"\n android:src=\"@drawable/settings\" /\u0026gt;\n\n \u0026lt;LinearLayout\n android:id=\"@+id/linearLayout1\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_alignParentTop=\"true\"\n android:layout_marginLeft=\"8dip\"\n android:layout_toLeftOf=\"@+id/ivDrag\"\n android:layout_toRightOf=\"@+id/imgPhoto\"\n android:orientation=\"vertical\" \u0026gt;\n\n \u0026lt;TextView\n android:id=\"@+id/txtDescription\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:ellipsize=\"end\"\n android:maxLines=\"1\"\n android:text=\"Medium Text Medium Text\"\n android:textAppearance=\"?android:attr/textAppearanceMedium\"\n android:textColor=\"@color/green\"\n android:textSize=\"@dimen/text_size_1\" /\u0026gt;\n\n \u0026lt;TextView\n android:id=\"@+id/txtProductname\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:ellipsize=\"end\"\n android:maxLines=\"1\"\n android:text=\"Small Text\"\n android:textAppearance=\"?android:attr/textAppearanceSmall\"\n android:textColor=\"@color/green\"\n android:textSize=\"@dimen/text_size_2\" /\u0026gt;\n\n \u0026lt;TextView\n android:id=\"@+id/txtAccountnumber\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:ellipsize=\"end\"\n android:maxLines=\"1\"\n android:text=\"Medium Text\"\n android:textAppearance=\"?android:attr/textAppearanceMedium\"\n android:textColor=\"@color/green\"\n android:textSize=\"@dimen/text_size_3\" /\u0026gt;\n \u0026lt;/LinearLayout\u0026gt;\n\n\u0026lt;Button\n android:id=\"@+id/btnModify\"\n android:background=\"@android:color/transparent\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"fill_parent\"\n android:layout_toRightOf=\"@+id/btnSelect\"\n android:layout_toLeftOf=\"@+id/ivDrag\" /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003c/p\u003e\n\n\u003cp\u003eAny help is greatly appreciated!\nRegards, Raoul\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-11-06 11:53:11.327 UTC","last_activity_date":"2014-11-11 12:48:24.603 UTC","last_edit_date":"2014-11-06 13:57:23.8 UTC","last_editor_display_name":"","last_editor_user_id":"4222726","owner_display_name":"","owner_user_id":"4222726","post_type_id":"1","score":"0","tags":"android|button|alpha-transparency","view_count":"63"} +{"id":"24762920","title":"T-SQL in PHP with PDO","body":"\u003cp\u003eI'm using php with the PDO sqlsrv driver to connect to an Azure SQL database. Mostly it's working fine until I tried to use the t-SQL convert function in my sql statement.\u003c/p\u003e\n\n\u003cp\u003e\u003cem\u003eTo be clear about what I'm asking\u003c/em\u003e: Why does this t-SQL not work in my PDO statement. Is this a limitation on using PDO with sqlsrv? \u003c/p\u003e\n\n\u003cp\u003eThis statment works fine:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\"SELECT Courses.courseName, Classes.classID, Classes.classStartDate, Classes.classEndDate, Classes.classStartTime ,Classes.classEndTime, Classes.location, Classes.classType, Courses.courseInfoLink \n FROM Classes \n JOIN Courses\n ON Courses.courseID = Classes.courseID \n JOIN ClassRegistration \n ON Classes.classID = ClassRegistration.classID \n JOIN Employees ON \n ClassRegistration.employeeID = Employees.employeeID \n WHERE Employees.employeeID = {$employeeID} AND ClassRegistration.isCompleted = 0 AND Classes.classStartDate \u0026gt; GETDATE()\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis statment does not (though it does work in the Azure SQL management portal so I know it's valid T-SQL):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \"SELECT Courses.courseName, Classes.classID, Classes.classStartDate, Classes.classEndDate, convert(nvarchar(MAX),Classes.classStartTime, 0)+' - '+convert(nvarchar(MAX),Classes.classEndTime,0), Classes.location, Classes.classType, Courses.courseInfoLink \n FROM Classes \n JOIN Courses\n ON Courses.courseID = Classes.courseID \n JOIN ClassRegistration \n ON Classes.classID = ClassRegistration.classID \n JOIN Employees ON \n ClassRegistration.employeeID = Employees.employeeID \n WHERE Employees.employeeID = {$employeeID} AND ClassRegistration.isCompleted = 0 AND Classes.classStartDate \u0026gt; GETDATE()\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I use that statement I get an error message: \"PHP Fatal error: Cannot access empty property in .../db.php on line 44\"\u003c/p\u003e\n\n\u003cp\u003eLine 44 is \"$this-\u003e_results = $this-\u003e_query-\u003efetchAll(PDO::FETCH_OBJ);\" from the query() function below\u003c/p\u003e\n\n\u003cp\u003eIf it helps to see how this is being used then here's my related code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic function query($sql, $params = array()) {\n $this-\u0026gt; _error = false;\n if($this-\u0026gt;_query = $this-\u0026gt;_pdo-\u0026gt;prepare($sql)) {\n $x=1;\n if(count($params)) {\n foreach ($params as $param) {\n $this-\u0026gt;_query-\u0026gt;bindValue($x, $param);\n $x++;\n }\n }\n if($this-\u0026gt;_query-\u0026gt;execute()) {\n $this-\u0026gt;_results = $this-\u0026gt;_query-\u0026gt;fetchAll(PDO::FETCH_OBJ);\n $this-\u0026gt;_count = $this-\u0026gt;_query-\u0026gt;rowCount();\n\n }\n else {\n $this-\u0026gt;_error = TRUE;\n\n }\n }\n\n return $this;\n }\n\n public function getUpcomingClasses () {\n\n $employeeID = $this-\u0026gt;_employeeID;\n\n\n $sql = \"SELECT Courses.courseName, Classes.classID, Classes.classStartDate, Classes.classEndDate, convert(nvarchar(MAX),Classes.classStartTime, 0)+' - '+convert(nvarchar(MAX),Classes.classEndTime,0), Classes.location, Classes.classType, Courses.courseInfoLink \n FROM Classes \n JOIN Courses\n ON Courses.courseID = Classes.courseID \n JOIN ClassRegistration \n ON Classes.classID = ClassRegistration.classID \n JOIN Employees ON \n ClassRegistration.employeeID = Employees.employeeID \n WHERE Employees.employeeID = {$employeeID} AND ClassRegistration.isCompleted = 0 AND Classes.classStartDate \u0026gt; GETDATE()\";\n\n $x= 0;\n foreach ($this-\u0026gt;_db-\u0026gt;query($sql)-\u0026gt;results() as $results) {\n $classes[$x] = $results; \n $x++;\n }\n\n return $classes;\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e**** this was marked as a possible duplicate of how to get an error out of PDO. Not really sure that applies. Though that might help, it's not the cause of the issue. As the real question here is \"Is this a limitation on using PDO with sqlsrv?\"\u003c/p\u003e\n\n\u003cp\u003eI'm always up for anything that might help so I added \u003ccode\u003e$this -\u0026gt;_pdo-\u0026gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\u003c/code\u003e to my PDO and then modified my code with a try catch in the query() function as below:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etry { \n $this-\u0026gt;_query-\u0026gt;execute();\n\n }\n catch (PDOException $e) {\n $this-\u0026gt;_error = \"Error: \" . $e-\u0026gt;getMessage() . \"\u0026lt;br /\u0026gt;\\n\";\n}\n }\n\n return $this;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI then modified my foreach loop to simply to return my error (I just have an error() function that returns $this-\u003e_error in my class that's running the queries: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eecho $this-\u0026gt;_db-\u0026gt;query($sql)-\u0026gt;error()\" \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhich returned blank. So dumped it with: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar_dump($this-\u0026gt;_db-\u0026gt;query($sql)-\u0026gt;error());\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhich returned \"bool(false)\". Since I set my error property to false when I initialize it, it would seem that it's not catching any specific error, correct?\u003c/p\u003e\n\n\u003cp\u003e\u003cem\u003e*\u003c/em\u003e another update.\nI created a stored procedure and tried to execute that, but got the same result.\u003cbr\u003e\nHowever I then changed my PDO query to Fetch an array (FETCH_ASSOC) instead of FETCH_OBJ and it's returning the array (both as I originally posted it and as a stored procedure). I can't find any documentation on this that would say why I couldn't fetch it as an object, so I would still appreciate any insight. thanks\u003c/p\u003e","accepted_answer_id":"24764920","answer_count":"1","comment_count":"2","creation_date":"2014-07-15 16:00:39.387 UTC","last_activity_date":"2014-07-15 18:19:16.663 UTC","last_edit_date":"2014-07-15 17:31:44.2 UTC","last_editor_display_name":"","last_editor_user_id":"942847","owner_display_name":"","owner_user_id":"942847","post_type_id":"1","score":"0","tags":"php|sql|azure|pdo","view_count":"512"} +{"id":"36018858","title":"CSS Make Scrollbar Go On Top of Div Instead of Making it Smaller","body":"\u003cp\u003eI'm trying to style a div very exactly, but the scrollbar is getting in the way. The div has a padding-right of 20px. When the scrollbar is present on the right-hand side, it squishes the div.\u003c/p\u003e\n\n\u003cp\u003eInstead, I want the scrollbar to take up some of the padding space. Is this possible with CSS styling (not Javascript checking and manipulation)?\u003c/p\u003e\n\n\u003cp\u003eEDIT: Some things I cannot do:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eUse JavaScript to check whether or not the scrollbar is present.\u003c/li\u003e\n\u003cli\u003eSet a fixed width for the div.\u003c/li\u003e\n\u003c/ol\u003e","accepted_answer_id":"36019466","answer_count":"1","comment_count":"1","creation_date":"2016-03-15 18:06:35.013 UTC","last_activity_date":"2016-03-15 18:39:10.2 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2247416","post_type_id":"1","score":"-1","tags":"html|css|scrollbar","view_count":"119"} +{"id":"24278159","title":"Ajax call succeeds, but has an undefined issue","body":"\u003cp\u003ePlease take a look at the \u003ca href=\"http://jsfiddle.net/9mwCG/38/\" rel=\"nofollow\"\u003eFiddle Example\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eCan anyone tell me why there is an \"undefined\" text appended to the div element \u003ccode\u003e#tablearea\u003c/code\u003e even though the Ajax request is successfully completed?\u003c/p\u003e\n\n\u003cp\u003eJSON:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[{\"title\":\"A\",\"nation\":\"Germany,Japan\",\"city\":\"Hamburg,Toyko\",\"Name\":\"John,Peter,Tom\"},{\"title\":\"B\",\"nation\":\"Japan,Italy\",\"city\":\"Toyko\",\"Name\":\"Adam,Tom\"},{\"title\":\"C\",\"nation\":\"Germany\",\"city\":\"Berlin,Hamburg\",\"Name\":\"Mary,Tom\"}]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ejQuery:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e $.ajax({\n url: \"https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20json%20where%20url%20%3D%22http%3A%2F%2Fgoo.gl%2FRgDyl4%22\u0026amp;format=json\u0026amp;diagnostics=true\u0026amp;callback=\",\n success: function (data) {\n var item_html;\n item_html += \"\u0026lt;table\u0026gt;\u0026lt;thead\u0026gt;\u0026lt;tr\u0026gt;\u0026lt;th\u0026gt;\u0026lt;/th\u0026gt;\"; \n $(data.query.results.json.json).each(function (index, item) {\n var title = item.title;\n item_html += '\u0026lt;th\u0026gt;'+title+'\u0026lt;/th\u0026gt;';\n });\n item_html += \"\u0026lt;/tr\u0026gt;\u0026lt;/thead\u0026gt;\u0026lt;tbody\u0026gt;\u0026lt;tr\u0026gt;\u0026lt;td\u0026gt;Germany\u0026lt;/td\u0026gt;\";\n $(data.query.results.json.json).each(function (index, item) {\n var nations = item.nation.replace(/ /g,'').split(\",\");\n console.log(nations);\n if ($.inArray('Germany', nations) \u0026lt; 0)\n {\n item_html += \"\u0026lt;td\u0026gt;No\u0026lt;/td\u0026gt;\";\n }else{\n item_html += \"\u0026lt;td\u0026gt;Yes\u0026lt;/td\u0026gt;\";\n }\n }); \n\n item_html += \"\u0026lt;/tr\u0026gt;\u0026lt;td\u0026gt;Berlin\u0026lt;/td\u0026gt;\";\n\n $(data.query.results.json.json).each(function (index, item) {\n var citys = item.city.replace(/ /g,'').split(\",\");\n if ($.inArray('Berlin', citys) \u0026lt; 0)\n {\n item_html += \"\u0026lt;td\u0026gt;No\u0026lt;/td\u0026gt;\";\n }else\n {\n item_html += \"\u0026lt;td\u0026gt;Yes\u0026lt;/td\u0026gt;\";\n }\n\n });\n\n item_html += \"\u0026lt;/tr\u0026gt;\u0026lt;td\u0026gt;Peter\u0026lt;/td\u0026gt;\";\n\n $(data.query.results.json.json).each(function (index, item) {\n var names = item.Name.replace(/ /g,'').split(\",\");\n if ($.inArray('Peter', names) \u0026lt; 0)\n {\n item_html += \"\u0026lt;td\u0026gt;No\u0026lt;/td\u0026gt;\";\n }else\n {\n item_html += \"\u0026lt;td\u0026gt;Yes\u0026lt;/td\u0026gt;\";\n }\n\n });\n\n item_html += \"\u0026lt;/tr\u0026gt;\u0026lt;/tbody\u0026gt;\u0026lt;/table\u0026gt;\";\n\n $('#tablearea').append(item_html);\n\n }\n });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHTML:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div id=\"tablearea\"\u0026gt;\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eReturned Results:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div id=\"tablearea\"\u0026gt; \nundefined\n\u0026lt;table\u0026gt;\n\u0026lt;thead\u0026gt;\n\u0026lt;tr\u0026gt;\n\u0026lt;th\u0026gt;\u0026lt;/th\u0026gt;\n\u0026lt;th\u0026gt;A\u0026lt;/th\u0026gt;\n\u0026lt;th\u0026gt;B\u0026lt;/th\u0026gt;\n\u0026lt;th\u0026gt;C\u0026lt;/th\u0026gt;\n\u0026lt;/tr\u0026gt;\n\u0026lt;/thead\u0026gt;\n\u0026lt;tbody\u0026gt;\n\u0026lt;tr\u0026gt;\n\u0026lt;td\u0026gt;Germany\u0026lt;/td\u0026gt;\n\u0026lt;td\u0026gt;Yes\u0026lt;/td\u0026gt;\n\u0026lt;td\u0026gt;No\u0026lt;/td\u0026gt;\n\u0026lt;td\u0026gt;Yes\u0026lt;/td\u0026gt;\n\u0026lt;/tr\u0026gt;\n\u0026lt;tr\u0026gt;\n\u0026lt;td\u0026gt;Berlin\u0026lt;/td\u0026gt;\n\u0026lt;td\u0026gt;No\u0026lt;/td\u0026gt;\n\u0026lt;td\u0026gt;No\u0026lt;/td\u0026gt;\n\u0026lt;td\u0026gt;Yes\u0026lt;/td\u0026gt;\n\u0026lt;/tr\u0026gt;\n\u0026lt;tr\u0026gt;\n\u0026lt;td\u0026gt;Peter\u0026lt;/td\u0026gt;\n\u0026lt;td\u0026gt;Yes\u0026lt;/td\u0026gt;\n\u0026lt;td\u0026gt;No\u0026lt;/td\u0026gt;\n\u0026lt;td\u0026gt;No\u0026lt;/td\u0026gt;\n\u0026lt;/tr\u0026gt;\n\u0026lt;/tbody\u0026gt;\n\u0026lt;/table\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"24278195","answer_count":"3","comment_count":"1","creation_date":"2014-06-18 06:07:35.853 UTC","last_activity_date":"2014-06-18 06:40:36.337 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2598292","post_type_id":"1","score":"0","tags":"javascript|jquery|html|ajax","view_count":"52"} +{"id":"3922908","title":"Changing ContentTemplate based on ListBox selection","body":"\u003cp\u003eI have a Listbox and a Border in a StackPanel similar to the following:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;StackPanel Orientation=\"Horizontal\"\u0026gt;\n \u0026lt;ListBox\u0026gt;\n \u0026lt;ListBoxItem Content=\"People\"/\u0026gt;\n \u0026lt;ListBoxItem Content=\"Animals\"/\u0026gt;\n \u0026lt;ListBoxItem Content=\"Cars\"/\u0026gt;\n \u0026lt;/ListBox\u0026gt;\n \u0026lt;Border Width=\"200\u0026gt;\n \u0026lt;ContentPresenter/\u0026gt;\n \u0026lt;/Border\u0026gt;\n\u0026lt;/StackPanel\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen selecting an item in the listbox I would like to change the content in the ContentPresenter accordingly e.g. selecting People would change the template to display a series of input fields related to people where as selecting Animals would display a series of fields related to Animals etc. - the behavior of this would be akin to a TabControl.\u003c/p\u003e\n\n\u003cp\u003eI think I can achieve this with a DataTrigger which changes the DataTemplate in the Border but I'm not sure how to achieve this.\u003c/p\u003e\n\n\u003cp\u003eAny pointers?\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","accepted_answer_id":"3925239","answer_count":"1","comment_count":"0","creation_date":"2010-10-13 10:58:56.753 UTC","favorite_count":"2","last_activity_date":"2010-10-13 15:20:22.853 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"276327","post_type_id":"1","score":"4","tags":"wpf|contenttemplateselector","view_count":"3992"} +{"id":"15792230","title":"How to use WTForms' TableWidget?","body":"\u003cp\u003eI want to use WTForms to render a form in a table. It seems like the \u003ca href=\"http://wtforms.simplecodes.com/docs/0.6/widgets.html\" rel=\"nofollow\"\u003eTableWidget\u003c/a\u003e will do the trick, but the only way I can get this to work is as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efrom wtforms import Form, TextField, widgets\n\nclass User(Form):\n user = TextField('User')\n email = TextField('Password')\n\n widget = widgets.TableWidget(with_table_tag=False)\n\nuser = User()\nprint user.widget(user)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis seems weird (the \u003ccode\u003eprint user.widget(user)\u003c/code\u003e part) According to the documentation, I ought to be able to say:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass User(Form):\n user = TextField('User', widget=widgets.TableWidget)\n email = TextField('Password', widget=widgets.TableWidget)\n\nuser = User()\nfor form_field in user:\n print form_field\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, this returns \u003ccode\u003eTypeError: __str__ returned non-string (type TableWidget)\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eWhen I replace user, email with:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003euser = TextField('User')\nemail = TextField('Password')\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThen of course the WTForms rendering works as expected.\u003c/p\u003e\n\n\u003cp\u003eHow does this work?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-04-03 15:58:24.663 UTC","favorite_count":"2","last_activity_date":"2014-05-24 21:05:44.723 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3788","post_type_id":"1","score":"4","tags":"python|wtforms","view_count":"1082"} +{"id":"27180257","title":"How to include asp.net mvc \"Sections\" in bundles","body":"\u003cp\u003eI have in my page various sections of scripts because i like to keep my html and javascript in the same file.How can i include the \"Section scripts in the bundle\"?\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2014-11-28 00:10:10.09 UTC","last_activity_date":"2014-11-28 00:10:10.09 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2983305","post_type_id":"1","score":"0","tags":"asp.net-mvc|bundling-and-minification","view_count":"87"} +{"id":"35693372","title":"How to add allow punctuation with sql","body":"\u003cp\u003eI am receiving a syntax error when typing punctuation into my website form such as ' or \u0026amp;. I am using the below code on the page when receiving this error. What am I missing or doing wrong that will fix this issue?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$name=$_REQUEST[\"title\"];\n$stdate=$_REQUEST[\"sdate\"];\n$endate=$_REQUEST[\"edate\"];\n$staddr=$_REQUEST[\"staddr\"];\n$addr2=$_REQUEST[\"staddr2\"];\n$city=$_REQUEST[\"city\"];\n$state=$_REQUEST[\"state\"];\n$zip=$_REQUEST[\"zip\"];\n$desc=$_REQUEST[\"desc\"];\n$file=$_REQUEST['photo'];\n$link=$_REQUEST[\"link\"];\n$user=$_REQUEST[\"user\"];\n/***************** DELETE QUERY ****************************/\n$date2 = date('Y-m-d');\n$qry = \"DELETE FROM table WHERE STR_TO_DATE(`endate`, '%Y-%m-%d') \u0026lt; '\".$date2.\"'\";\n$del = mysql_query($qry); \n$query = \"INSERT INTO table (fname,stdate,endate,addr1,addr2,city,state,zip,name,size,type,content,link,description,user) VALUES('\" . mysql_real_escape_string($name) . \"','$stdate','$endate','\" . mysql_real_escape_string($staddr) . \"','\" . mysql_real_escape_string($addr2) . \"','$city','$state','$zip','\".str_replace(' ','',$name).\"-\".$stdate.\"-\".$file.\".png','0',' ',' ','\" . mysql_real_escape_string($link).\"','\" . mysql_real_escape_string($desc) . \"','$user')\";\n\n$q2=mysql_query($query) or die('Error, query failed'. mysql_error());\nif($q2) {\necho \"ok\"; \n} else {\necho \"error \".$query.mysql_error();\n} \n\n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe issue stems from the query line\u003c/p\u003e","answer_count":"0","comment_count":"6","creation_date":"2016-02-29 06:40:00.557 UTC","last_activity_date":"2016-02-29 06:40:00.557 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2512412","post_type_id":"1","score":"1","tags":"html|mysql|sql|syntax|punctuation","view_count":"45"} +{"id":"36247156","title":"How to Call Background Fetch Completion Handler Properly","body":"\u003cp\u003eCurrently, I am using an API (PowerAPI) in which the \"authenticate\" function is called and then once the user's data has been processed, a notification is sent out. This authenticate function needs to be called as a background fetch. My question is whether my current way of calling the completion handler is even calling the completion handler and if there is a better way?\u003c/p\u003e\n\n\u003cp\u003eCurrently this is in my app delegate class:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elet api = PowerAPI.sharedInstance\nvar completionHandler: ((UIBackgroundFetchResult) -\u0026gt; Void)? = nil\nfunc application(application: UIApplication, performFetchWithCompletionHandler completionHandler: (UIBackgroundFetchResult) -\u0026gt; Void) {\n print(\"BG fetch start\")\n NSNotificationCenter.defaultCenter().addObserver(self, selector: \"handleTranscript:\", name:\"transcript_parsed\", object: nil)\n self.completionHandler = completionHandler\n api.authenticate(\"server.com\", username: \"User\", password: \"password\", fetchTranscript: true)\n}\nfunc handleTranscript(notification : NSNotification){\n print(\"BG fetch finit\")\n completionHandler!(UIBackgroundFetchResult.NewData)\n print(api.studentInformation)\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe API is a singleton type object.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT:\u003c/strong\u003e The PowerAPI object is a class I wrote to download student data from a server and parse it. The \"transcript_parsed\" notification is a notification generated from within the PowerAPI directly after the \"transcript_fetched\" notification is sent out in the following asynchronous code (Also within PowerAPI):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e let task = session.dataTaskWithRequest(request) {\n (let data, let response, let error) in\n guard let _:NSData = data, let _:NSURLResponse = response where error == nil else {\n print(\"error\")\n return\n }\n switch notificationID {\n case \"authentication_finished\":\n //NSString(data: data!, encoding: NSUTF8StringEncoding)! //used to return data from authentication\n let success = self.parse(data!) //notification object is true if success\n NSNotificationCenter.defaultCenter().postNotificationName(notificationID, object: success)\n case \"transcript_fetched\":\n NSNotificationCenter.defaultCenter().postNotificationName(notificationID, object: data)\n default:\n break\n }\n }\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"4","creation_date":"2016-03-27 12:10:14.403 UTC","last_activity_date":"2016-03-27 14:40:19.413 UTC","last_edit_date":"2016-03-27 14:40:19.413 UTC","last_editor_display_name":"","last_editor_user_id":"3274871","owner_display_name":"","owner_user_id":"3274871","post_type_id":"1","score":"0","tags":"ios|swift|background-fetch","view_count":"534"} +{"id":"23119506","title":"Use Powershell to run Psexec command","body":"\u003cp\u003eFirst post so please don't hurt me. I've searched around but can't seem to find a way to do what I want. I've made a script that copies a folder I have to numerous computers at \\$computer\\c$. In these folders is a batch file that runs an .exe. What I want to do is have Powershell pull from the same computers.txt that I used to copy the folder and then use psexec to run the batch file. I could do this all manually but scripting it seems to be a problem, here's what I thought would work but apparently not.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e $computers = gc \"C:\\scripts\\computers.txt\"\n\nforeach ($computer in $computers) {\nif (test-Connection -Cn $computer -quiet) {\n cd C:\\pstools\n psexec \\\\%computer cmd\n C:\\Folder\\install.bat\"\n} else {\n \"$computer is not online\"\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e}\u003c/p\u003e","accepted_answer_id":"23120034","answer_count":"4","comment_count":"3","creation_date":"2014-04-16 20:28:28.037 UTC","favorite_count":"4","last_activity_date":"2016-01-19 21:24:49.643 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3542845","post_type_id":"1","score":"5","tags":"batch-file|powershell|psexec","view_count":"44226"} +{"id":"41982850","title":"Adding argument (post_status) to the loop","body":"\u003cp\u003eI'm helping my collegue with his wordpress site. The case is pretty simple: add an attribute (post_status =\u003e \"future\") to the loop. The only issue is that I cannot find where I should do that (as i dont see any proper wp_query() statement to do that. Please take a look on the template file:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\n/**\n * Render the blog layouts.\n *\n * @author ThemeFusion\n * @package Avada/Templates\n * @version 1.0\n */\n\n// Do not allow directly accessing this file.\nif ( ! defined( 'ABSPATH' ) ) { exit( 'Direct script access denied.' ); }\n\nglobal $wp_query;\n\n// Set the correct post container layout classes.\n$blog_layout = avada_get_blog_layout();\n$post_class = 'fusion-post-' . $blog_layout;\n\n$container_class = 'fusion-blog-layout-' . $blog_layout . ' ';\nif ( 'grid' == $blog_layout ) {\n $container_class = 'fusion-blog-layout-' . $blog_layout . ' fusion-blog-layout-' . $blog_layout . '-' . Avada()-\u0026gt;settings-\u0026gt;get( 'blog_grid_columns' ) . ' isotope ';\n}\n\n// Set class for scrolling type.\nif ( Avada()-\u0026gt;settings-\u0026gt;get( 'blog_pagination_type' ) == 'Infinite Scroll' ||\n Avada()-\u0026gt;settings-\u0026gt;get( 'blog_pagination_type' ) == 'load_more_button'\n) {\n $container_class .= 'fusion-blog-infinite fusion-posts-container-infinite ';\n} else {\n $container_class .= 'fusion-blog-pagination ';\n}\n\nif ( ! Avada()-\u0026gt;settings-\u0026gt;get( 'featured_images' ) ) {\n $container_class .= 'fusion-blog-no-images ';\n}\n\n// Add the timeline icon.\nif ( 'timeline' == $blog_layout ) {\n echo '\u0026lt;div class=\"fusion-timeline-icon\"\u0026gt;\u0026lt;i class=\"fusion-icon-bubbles\"\u0026gt;\u0026lt;/i\u0026gt;\u0026lt;/div\u0026gt;';\n}\n\nif ( is_search() \u0026amp;\u0026amp;\n Avada()-\u0026gt;settings-\u0026gt;get( 'search_results_per_page' )\n) {\n $number_of_pages = ceil( $wp_query-\u0026gt;found_posts / Avada()-\u0026gt;settings-\u0026gt;get( 'search_results_per_page' ) );\n} else {\n $number_of_pages = $wp_query-\u0026gt;max_num_pages;\n}\n\necho '\u0026lt;div id=\"posts-container\" class=\"' . $container_class . 'fusion-blog-archive fusion-clearfix\" data-pages=\"' . $number_of_pages . '\"\u0026gt;';\n\nif ( 'timeline' == $blog_layout ) {\n // Initialize the time stamps for timeline month/year check.\n $post_count = 1;\n $prev_post_timestamp = null;\n $prev_post_month = null;\n $prev_post_year = null;\n $first_timeline_loop = false;\n\n // Add the container that holds the actual timeline line.\n echo '\u0026lt;div class=\"fusion-timeline-line\"\u0026gt;\u0026lt;/div\u0026gt;';\n}\n\n // Start the main loop.\nwhile ( have_posts() ) : the_post();\n // Set the time stamps for timeline month/year check.\n $alignment_class = '';\n if ( 'timeline' == $blog_layout ) {\n $post_timestamp = get_the_time( 'U' );\n $post_month = date( 'n', $post_timestamp );\n $post_year = get_the_date( 'Y' );\n $current_date = get_the_date( 'Y-n' );\n\n // Set the correct column class for every post.\n if ( $post_count % 2 ) {\n $alignment_class = 'fusion-left-column';\n } else {\n $alignment_class = 'fusion-right-column';\n }\n\n // Set the timeline month label.\n if ( $prev_post_month != $post_month || $prev_post_year != $post_year ) {\n\n if ( $post_count \u0026gt; 1 ) {\n echo '\u0026lt;/div\u0026gt;';\n }\n echo '\u0026lt;h3 class=\"fusion-timeline-date\"\u0026gt;' . get_the_date( Avada()-\u0026gt;settings-\u0026gt;get( 'timeline_date_format' ) ) . '\u0026lt;/h3\u0026gt;';\n echo '\u0026lt;div class=\"fusion-collapse-month\"\u0026gt;';\n }\n }\n\n // Set the has-post-thumbnail if a video is used. This is needed if no featured image is present.\n $thumb_class = '';\n if ( get_post_meta( get_the_ID(), 'pyre_video', true ) ) {\n $thumb_class = ' has-post-thumbnail';\n }\n\n $post_classes = $post_class . ' ' . $alignment_class . ' ' . $thumb_class . ' post fusion-clearfix';\n ob_start();\n post_class( $post_classes );\n $post_classes = ob_get_clean();\n\n echo '\u0026lt;article id=\"post-' . get_the_ID() . '\" ' . $post_classes . '\u0026gt;';\n // Add an additional wrapper for grid layout border.\n if ( 'grid' == $blog_layout ) {\n echo '\u0026lt;div class=\"fusion-post-wrapper\"\u0026gt;';\n }\n\n // Get featured images for all but large-alternate layout.\n if ( ( ( is_search() \u0026amp;\u0026amp; Avada()-\u0026gt;settings-\u0026gt;get( 'search_featured_images' ) ) || ( ! is_search() \u0026amp;\u0026amp; Avada()-\u0026gt;settings-\u0026gt;get( 'featured_images' ) ) ) \u0026amp;\u0026amp; 'large-alternate' == $blog_layout ) {\n get_template_part( 'new-slideshow' );\n }\n\n // Get the post date and format box for alternate layouts.\n if ( 'large-alternate' == $blog_layout || 'medium-alternate' == $blog_layout ) {\n echo '\u0026lt;div class=\"fusion-date-and-formats\"\u0026gt;';\n\n /**\n * The avada_blog_post_date_adn_format hook.\n *\n * @hooked avada_render_blog_post_date - 10 (outputs the HTML for the date box).\n * @hooked avada_render_blog_post_format - 15 (outputs the HTML for the post format box).\n */\n do_action( 'avada_blog_post_date_and_format' );\n\n echo '\u0026lt;/div\u0026gt;';\n }\n\n // Get featured images for all but large-alternate layout.\n if ( ( ( is_search() \u0026amp;\u0026amp; Avada()-\u0026gt;settings-\u0026gt;get( 'search_featured_images' ) ) || ( ! is_search() \u0026amp;\u0026amp; Avada()-\u0026gt;settings-\u0026gt;get( 'featured_images' ) ) ) \u0026amp;\u0026amp; 'large-alternate' != $blog_layout ) {\n get_template_part( 'new-slideshow' );\n }\n\n // The post-content-wrapper is only needed for grid and timeline.\n if ( 'grid' == $blog_layout || 'timeline' == $blog_layout ) {\n echo '\u0026lt;div class=\"fusion-post-content-wrapper\"\u0026gt;';\n }\n\n // Add the circles for timeline layout.\n if ( 'timeline' == $blog_layout ) {\n echo '\u0026lt;div class=\"fusion-timeline-circle\"\u0026gt;\u0026lt;/div\u0026gt;';\n echo '\u0026lt;div class=\"fusion-timeline-arrow\"\u0026gt;\u0026lt;/div\u0026gt;';\n }\n\n echo '\u0026lt;div class=\"fusion-post-content post-content\"\u0026gt;';\n\n // Render the post title.\n echo avada_render_post_title( get_the_ID() );\n\n\n $categories = get_the_category(get_the_ID());\n $separator = ', ';\n $output = '';\n $numItems = count($categories);\n $i = 0;\n if($categories){\n foreach($categories as $category) {\n $output .= '\u0026lt;a href=\"'.get_category_link( $category-\u0026gt;term_id ).'\" title=\"' . esc_attr( sprintf( __( \"View all posts in %s\" ), $category-\u0026gt;name ) ) . '\"\u0026gt;'.$category-\u0026gt;cat_name.'\u0026lt;/a\u0026gt;';\n if(++$i !== $numItems) {\n $output .= $separator;\n }\n }\n } \n\n echo ( '\u0026lt;div class=\"lista-koncert-podtytul\"\u0026gt;' . $output . '\u0026lt;/div\u0026gt;' ); \n\n // Render post meta for grid and timeline layouts.\n if ( 'grid' == $blog_layout || 'timeline' == $blog_layout ) {\n echo avada_render_post_metadata( 'grid_timeline' );\n\n if ( ( Avada()-\u0026gt;settings-\u0026gt;get( 'post_meta' ) \u0026amp;\u0026amp; ( Avada()-\u0026gt;settings-\u0026gt;get( 'post_meta_author' ) || Avada()-\u0026gt;settings-\u0026gt;get( 'post_meta_date' ) || Avada()-\u0026gt;settings-\u0026gt;get( 'post_meta_cats' ) || Avada()-\u0026gt;settings-\u0026gt;get( 'post_meta_tags' ) || Avada()-\u0026gt;settings-\u0026gt;get( 'post_meta_comments' ) || Avada()-\u0026gt;settings-\u0026gt;get( 'post_meta_read' ) ) ) \u0026amp;\u0026amp; 0 \u0026lt; Avada()-\u0026gt;settings-\u0026gt;get( 'excerpt_length_blog' ) ) {\n echo '\u0026lt;div class=\"fusion-content-sep\"\u0026gt;\u0026lt;/div\u0026gt;';\n }\n // Render post meta for alternate layouts.\n } elseif ( 'large-alternate' == $blog_layout || 'medium-alternate' == $blog_layout ) {\n echo avada_render_post_metadata( 'alternate' );\n }\n\n echo '\u0026lt;div class=\"fusion-post-content-container\"\u0026gt;';\n\n /**\n * The avada_blog_post_content hook.\n *\n * @hooked avada_render_blog_post_content - 10 (outputs the post content wrapped with a container).\n */\n do_action( 'avada_blog_post_content' );\n\n echo '\u0026lt;a href=\"' . get_post_permalink(get_the_ID()) . '\"\u0026gt;Zobacz więcej \u0026amp;gt;\u0026lt;/a\u0026gt;';\n\n echo '\u0026lt;/div\u0026gt;';\n echo '\u0026lt;/div\u0026gt;'; // End post-content.\n\n if ( 'medium' == $blog_layout || 'medium-alternate' == $blog_layout ) {\n echo '\u0026lt;div class=\"fusion-clearfix\"\u0026gt;\u0026lt;/div\u0026gt;';\n }\n\n // Render post meta data according to layout.\n if ( ( Avada()-\u0026gt;settings-\u0026gt;get( 'post_meta' ) \u0026amp;\u0026amp; ( Avada()-\u0026gt;settings-\u0026gt;get( 'post_meta_author' ) || Avada()-\u0026gt;settings-\u0026gt;get( 'post_meta_date' ) || Avada()-\u0026gt;settings-\u0026gt;get( 'post_meta_cats' ) || Avada()-\u0026gt;settings-\u0026gt;get( 'post_meta_tags' ) || Avada()-\u0026gt;settings-\u0026gt;get( 'post_meta_comments' ) || Avada()-\u0026gt;settings-\u0026gt;get( 'post_meta_read' ) ) ) ) {\n echo '\u0026lt;div class=\"fusion-meta-info\"\u0026gt;';\n if ( 'grid' == $blog_layout || 'timeline' == $blog_layout ) {\n // Render read more for grid/timeline layouts.\n echo '\u0026lt;div class=\"fusion-alignleft\"\u0026gt;';\n if ( Avada()-\u0026gt;settings-\u0026gt;get( 'post_meta_read' ) ) {\n $link_target = '';\n if ( fusion_get_page_option( 'link_icon_target', get_the_ID() ) == 'yes' ||\n fusion_get_page_option( 'post_links_target', get_the_ID() ) == 'yes' ) {\n $link_target = ' target=\"_blank\" rel=\"noopener noreferrer\"';\n }\n echo '\u0026lt;a href=\"' . get_permalink() . '\" class=\"fusion-read-more\"' . $link_target . '\u0026gt;' . apply_filters( 'avada_blog_read_more_link', esc_attr__( 'Read More', 'Avada' ) ) . '\u0026lt;/a\u0026gt;';\n }\n echo '\u0026lt;/div\u0026gt;';\n\n // Render comments for grid/timeline layouts.\n echo '\u0026lt;div class=\"fusion-alignright\"\u0026gt;';\n if ( Avada()-\u0026gt;settings-\u0026gt;get( 'post_meta_comments' ) ) {\n if ( ! post_password_required( get_the_ID() ) ) {\n comments_popup_link( '\u0026lt;i class=\"fusion-icon-bubbles\"\u0026gt;\u0026lt;/i\u0026gt;\u0026amp;nbsp;0', '\u0026lt;i class=\"fusion-icon-bubbles\"\u0026gt;\u0026lt;/i\u0026gt;\u0026amp;nbsp;' . __( '1', 'Avada' ), '\u0026lt;i class=\"fusion-icon-bubbles\"\u0026gt;\u0026lt;/i\u0026gt;\u0026amp;nbsp;%' );\n } else {\n echo '\u0026lt;i class=\"fusion-icon-bubbles\"\u0026gt;\u0026lt;/i\u0026gt;\u0026amp;nbsp;' . esc_attr__( 'Protected', 'Avada' );\n }\n }\n\n echo '\u0026lt;/div\u0026gt;';\n } else {\n // Render all meta data for medium and large layouts.\n if ( 'large' == $blog_layout || 'medium' == $blog_layout ) {\n echo avada_render_post_metadata( 'standard' );\n }\n\n // Render read more for medium/large and medium/large alternate layouts.\n echo '\u0026lt;div class=\"fusion-alignright\"\u0026gt;';\n if ( Avada()-\u0026gt;settings-\u0026gt;get( 'post_meta_read' ) ) {\n $link_target = '';\n if ( fusion_get_page_option( 'link_icon_target', get_the_ID() ) == 'yes' ||\n fusion_get_page_option( 'post_links_target', get_the_ID() ) == 'yes' ) {\n $link_target = ' target=\"_blank\" rel=\"noopener noreferrer\"';\n }\n echo '\u0026lt;a href=\"' . get_permalink() . '\" class=\"fusion-read-more\"' . $link_target . '\u0026gt;' . apply_filters( 'avada_read_more_name', esc_attr__( 'Read More', 'Avada' ) ) . '\u0026lt;/a\u0026gt;';\n }\n echo '\u0026lt;/div\u0026gt;';\n }\n echo '\u0026lt;/div\u0026gt;'; // End meta-info.\n }\n if ( 'grid' == $blog_layout || 'timeline' == $blog_layout ) {\n echo '\u0026lt;/div\u0026gt;'; // End post-content-wrapper.\n }\n if ( 'grid' == $blog_layout ) {\n echo '\u0026lt;/div\u0026gt;'; // End post-wrapper.\n }\n echo '\u0026lt;/article\u0026gt;'; // End post.\n\n // Adjust the timestamp settings for next loop.\n if ( 'timeline' == $blog_layout ) {\n $prev_post_timestamp = $post_timestamp;\n $prev_post_month = $post_month;\n $prev_post_year = $post_year;\n $post_count++;\n }\nendwhile; // End have_posts().\n\nif ( 'timeline' == $blog_layout \u0026amp;\u0026amp; 1 \u0026lt; $post_count ) {\n echo '\u0026lt;/div\u0026gt;';\n}\necho '\u0026lt;/div\u0026gt;'; // End posts-container.\n\n// If infinite scroll with \"load more\" button is used.\nif ( Avada()-\u0026gt;settings-\u0026gt;get( 'blog_pagination_type' ) == 'load_more_button' ) {\n echo '\u0026lt;div class=\"fusion-load-more-button fusion-blog-button fusion-clearfix\"\u0026gt;' . apply_filters( 'avada_load_more_posts_name', esc_attr__( 'Load More Posts', 'Avada' ) ) . '\u0026lt;/div\u0026gt;';\n}\n\n// Get the pagination.\nfusion_pagination( $pages = '', $range = 2 );\n\nwp_reset_query();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ein this case - which part of template i should edit? seriously have no clue where...\u003c/p\u003e","accepted_answer_id":"41983013","answer_count":"1","comment_count":"0","creation_date":"2017-02-01 14:57:49.73 UTC","last_activity_date":"2017-02-01 15:05:34.67 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1282022","post_type_id":"1","score":"1","tags":"php|loops|arguments","view_count":"76"} +{"id":"20273557","title":"Make a MySQL Connection Over a Proxy","body":"\u003cp\u003eWe have a Python script that writes values to a local database. We need to move this database to a remote host that requires the connection come from a white-listed IP address, which we have to set and forget.\u003c/p\u003e\n\n\u003cp\u003eOur solution is to use the proxy from another part of the Python sctipt (HTTP GET for something else). However, the MySQLDB library doesn't seem to allow for a proxy connection with authentication.\u003c/p\u003e\n\n\u003cp\u003eOur question... Are there any other librarys available, or perhaps another library or a MySQL solution to achieve this?\u003c/p\u003e\n\n\u003cp\u003eWe found \u003ca href=\"https://stackoverflow.com/questions/10383540/connect-to-database-via-proxy-a-python-script\"\u003ethis\u003c/a\u003e but it's not much to go on, and doesn't seem to work. Note we can't use a system wide proxy.\u003c/p\u003e\n\n\u003cp\u003eTLDR: How can you connect to a MySQL Database via a proxy to solve a problem of needing to be connected through a static IP?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-11-28 19:27:43.677 UTC","favorite_count":"1","last_activity_date":"2013-11-28 20:13:07.137 UTC","last_edit_date":"2017-05-23 12:08:10.717 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"1901781","post_type_id":"1","score":"1","tags":"python|mysql|proxy","view_count":"933"} +{"id":"44301010","title":"Finding all edge types in a graph. Tree, Forward, Backward or Cross edges","body":"\u003cp\u003eI spent several hours looking for a pseudocode that would compute the edge types in a graph. I couldn't find a complete version so I wrote a new one. I will share it as a reply to this post, so others can reach it if needed.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-06-01 07:20:31.103 UTC","last_activity_date":"2017-06-01 07:20:31.103 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1826857","post_type_id":"1","score":"-2","tags":"graph|pseudocode|edge","view_count":"20"} +{"id":"15992519","title":"hashmap using a \"employee class\" as the value","body":"\u003cp\u003eI created a \u003ccode\u003eHashMap\u003c/code\u003e where the keys are \u003ccode\u003eIntegers\u003c/code\u003e and the values are of the \u003ccode\u003eEmployee\u003c/code\u003e class. \u003ccode\u003eEmployee\u003c/code\u003e contains the employee's first name, last name and address. I am having issues with printing out the values. Here is what i tried.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eemployees.put(5, e1);\n\nString test=employees.get(5).toString();\nSystem.out.println(employees.toString());\nSystem.out.println(test);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eoutput:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{5=identitymanagement.Employee@6da264f1}\nidentitymanagement.Employee@6da264f1\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat am I doing wrong?\u003c/p\u003e","answer_count":"2","comment_count":"7","creation_date":"2013-04-13 20:24:26.79 UTC","last_activity_date":"2013-04-13 21:30:07.433 UTC","last_edit_date":"2013-04-13 21:30:07.433 UTC","last_editor_display_name":"","last_editor_user_id":"1622894","owner_display_name":"","owner_user_id":"2205217","post_type_id":"1","score":"-1","tags":"java","view_count":"1813"} +{"id":"5879707","title":"Elegant way to compare the content of JARs (to find new classes and methods)","body":"\u003cp\u003eYes, the Internet says - \"unzip them all, decompile and compare the code with some tool (total comander, WinCompare, meld(linux), whatever...) The reason why I need a tool to generate difference report automatically from Fodler1 and Folder2 is simple - there are too much JARs in these Folders and I need to compare these folders (with next version of Jars) say 1 time in a month. So, I really do not want to do it manually at all!\u003c/p\u003e\n\n\u003cp\u003eLet's see what I've got so far:\u003c/p\u003e\n\n\u003cp\u003e1) I can find all JARs in each Folder:) \u003c/p\u003e\n\n\u003cp\u003e2) I can get the list of classes from each JAR: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate static void AddAllClassesFromJAR(JarInputStream jarFile,\n ArrayList\u0026lt;String\u0026gt; classes) throws IOException {\n JarEntry jarEntry = null;\n while (true) {\n jarEntry = jarFile.getNextJarEntry();\n if (jarEntry == null) {\n break;\n }\n if (jarEntry.getName().endsWith(\".class\")) {\n classes.add(jarEntry.getName());\n }\n }\n}\n\n public static List\u0026lt;String\u0026gt; getClasseNamesInPackage(String jarName) {\n ArrayList\u0026lt;String\u0026gt; classes = new ArrayList\u0026lt;String\u0026gt;();\n try {\n JarInputStream jarFile = new JarInputStream(new FileInputStream(jarName));\n AddAllClassesFromJAR(jarFile, classes);\n } catch (Exception e) {\n e.printStackTrace();\n }\n return classes;\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e3) There is Reflection in Java (Core Java 2 Volume I - Fundamentals, Example 5-5), so I can get the list of methods from one class once I know its name.\u003c/p\u003e\n\n\u003cp\u003eIn order to do that I need to make an instance of each class, the problem is how can I make the instance of each Class which I got from each JAR file?\nNow I'm loading each JAR:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eloader_left = new JarClassLoader(\"left/1.jar\");\n\npublic class JarClassLoader extends URLClassLoader {\n public JarClassLoader( URL url ) {\n super( new URL[]{url} );\n }\n\n public JarClassLoader( String urlString ) throws MalformedURLException {\n this( new URL( \"jar:file://\" + urlString + \"!/\" ) );\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNo exceptions, but I can not find any resource in it, trying to load the class like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass_left = loader_left.loadClass(\"level1.level2.class1\");\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd getting \"java.lang.ClassNotFoundException\".\u003c/p\u003e\n\n\u003cp\u003eAny glue where is the problem? (class name is verified. it is hardcoded just for testing, ideally it should get it from the list of the classes)\u003c/p\u003e\n\n\u003cp\u003eSecond question: since most of the classes in Folder1 and Folder2 will be same, what will happen if I load the same class second time (from Fodler2)?\u003c/p\u003e","accepted_answer_id":"5879960","answer_count":"2","comment_count":"1","creation_date":"2011-05-04 07:03:34.03 UTC","favorite_count":"2","last_activity_date":"2012-04-19 20:51:23.08 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"524785","post_type_id":"1","score":"5","tags":"java|jar|classloader","view_count":"1702"} +{"id":"42180450","title":"Add foreign key to table after migration has been run in laravel","body":"\u003cp\u003eI have the following migration in my laravel migrations folder that i have already run:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\n\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migrations\\Migration;\n\nclass CreateAdminTable extends Migration\n{\n /**\n * Run the migrations.\n *\n * @return void\n */\n public function up() {\n Schema::create('Admin' , function($table){\n $table-\u0026gt;increments('id');\n $table-\u0026gt;mediumText('title');\n $table-\u0026gt;text('blog_content');\n $table-\u0026gt;char('tag' , 15);\n });\n }\n /**\n * Reverse the migrations.\n *\n * @return void\n */\n public function down() {\n Schema::drop('Admin');\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe above migration is for my \u003ccode\u003eadmin\u003c/code\u003e table, what i would really like to do is add a foreign key in my \u003ccode\u003eadmin\u003c/code\u003e table that is associated with my \u003ccode\u003etags\u003c/code\u003e table. something like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e $table-\u0026gt;foreign('tag')-\u0026gt;references('tag')-\u0026gt;on('tags'); \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow do i do this now that i have already run my migration ??\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT::\u003c/strong\u003e I tried the follow:\u003c/p\u003e\n\n\u003cp\u003eSTEP 1 : deleted the \u003ccode\u003etag\u003c/code\u003e column from the \u003ccode\u003eadmin\u003c/code\u003e table from phpMyAdmin.\u003c/p\u003e\n\n\u003cp\u003eSTEP 2: Tried running the following migration:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\n\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migrations\\Migration;\n\nclass AddForeignKeyTagsColumn extends Migration\n{\n /**\n * Run the migrations.\n *\n * @return void\n */\n public function up()\n {\n Schema::table('Admin', function (Blueprint $table) {\n $table-\u0026gt;char('tag' , 15)-\u0026gt;after('slug');\n $table-\u0026gt;foreign('tag')-\u0026gt;references('tag')-\u0026gt;on('tags');\n });\n }\n\n /**\n * Reverse the migrations.\n *\n * @return void\n */\n public function down()\n {\n // Schema::drop('Admin');\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut i get the following error:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/5u6Zi.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/5u6Zi.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eWhy is the foreign key unable to be created ??\u003c/p\u003e\n\n\u003cp\u003eThank you.\u003c/p\u003e","accepted_answer_id":"42180523","answer_count":"2","comment_count":"2","creation_date":"2017-02-11 19:46:06.8 UTC","last_activity_date":"2017-02-12 09:34:01.447 UTC","last_edit_date":"2017-02-11 20:07:27.38 UTC","last_editor_display_name":"","last_editor_user_id":"4381665","owner_display_name":"","owner_user_id":"4381665","post_type_id":"1","score":"-1","tags":"php|laravel|laravel-5","view_count":"133"} +{"id":"29594178","title":"how to sort two strings with a 4-digit number(year) inside?","body":"\u003cp\u003ei want to sort two statments year wise so that 1920's statment comes first and then 1930's statment .\u003c/p\u003e\n\n\u003cp\u003eFirst i explode the two strings by (.) and then i used natsort to sort them by year..but it didnt worked. what i have done so far is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\n\n$strn=\"The Muslim League slowly rose to mass popularity in the **1930s** amid fears of under-representation and neglect of Muslims in politics.The largely non-violent independence struggle led by the Indian Congress engaged millions of protesters in mass campaigns of civil disobedience in the **1920s**\";\n\n$result = explode('.',$strn);\nnatsort($result);\n\necho $result[0];\n\necho $result[1];\n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"29594218","answer_count":"1","comment_count":"0","creation_date":"2015-04-12 20:17:51.69 UTC","last_activity_date":"2015-04-12 20:25:01.177 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4555501","post_type_id":"1","score":"1","tags":"php|sorting","view_count":"30"} +{"id":"11872543","title":"Preventing TlbImp from generating interop assemblies for referenced type libraries","body":"\u003cp\u003eI'm generating interop assemblies using \u003ccode\u003eTlbImp\u003c/code\u003e. Several of my type libraries reference a single core type library.\u003c/p\u003e\n\n\u003cp\u003eWhen I run \u003ccode\u003eTlbImp\u003c/code\u003e against \u003ccode\u003eFirst.dll\u003c/code\u003e I get \u003ccode\u003eInterop.First.dll\u003c/code\u003e and \u003ccode\u003eInterop.Core.dll\u003c/code\u003e. The problem is that when I run it again, against \u003ccode\u003eSecond.dll\u003c/code\u003e, \u003ccode\u003eTlbImp\u003c/code\u003e tries to generate \u003ccode\u003eInterop.Core.dll\u003c/code\u003e again, resulting in the error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eTlbImp : error TI0000 : System.ApplicationException - The assembly for referenced\ntype library, 'Core', will not be imported since it would overwrite existing file\n'Core.dll'.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow can I tell \u003ccode\u003eTlbImp\u003c/code\u003e not to generate interops for referenced assemblies?\u003c/p\u003e","accepted_answer_id":"11872544","answer_count":"1","comment_count":"0","creation_date":"2012-08-08 20:21:43.947 UTC","last_activity_date":"2012-08-08 20:21:43.947 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"111327","post_type_id":"1","score":"0","tags":"tlbimp","view_count":"1199"} +{"id":"40866740","title":"Qt QSharedMemory and QDataStream","body":"\u003cp\u003eI want to make shared memory using QSharedMemory.\nSo, I am trying to read/write my custom classes using QDataStream.\nBut I do not know how to override double pointer(float **).\u003c/p\u003e\n\n\u003cp\u003e(The reason I use double pointers is because of opencv cv::Mat, If there is a better way than what I want, please recommend it)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass ObservationData\n{\nprivate:\n int m_nCameras;\n cv::Mat** m_matDBRGB;\n cv::Mat* m_matQueryRGB;\n\n unsigned char** dbRGB;\n unsigned char* queryRGB;\n\n int row, col;\n int m_recogIdx;\n\npublic:\n ObservationData();\n ~ObservationData();\n\n void setNumCameras(const int nCameras);\n int getNumCameras() const;\n\n void setDB_RGB(const unsigned char** rgb);\n unsigned char** getDB_RGB() const;\n\n void setQuery_RGB(const unsigned char* rgb);\n unsigned char* getQuery_RGB() const;\n\n void setRow(const int row);\n void setCol(const int col);\n\n int getRow() const;\n int getCol() const;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand cpp file:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evoid ObservationData::setNumCameras(const int nCameras)\n{\n this-\u0026gt;m_nCameras = nCameras;\n}\n\nint ObservationData::getNumCameras() const\n{\n return this-\u0026gt;m_nCameras;\n}\n\nvoid ObservationData::setDB_RGB(const unsigned char** rgb)\n{\n std::memcpy(this-\u0026gt;dbRGB, rgb,\n sizeof(unsigned char)\n * this-\u0026gt;row * this-\u0026gt;col * 3 * this-\u0026gt;m_nCameras\n );\n}\n\nunsigned char** ObservationData::getDB_RGB() const\n{\n return this-\u0026gt;dbRGB;\n}\n\nvoid ObservationData::setQuery_RGB(const unsigned char* rgb)\n{\n std::memcpy(this-\u0026gt;queryRGB, rgb,\n sizeof(unsigned char)\n * this-\u0026gt;row * this-\u0026gt;col * 3\n );\n}\n\nunsigned char* ObservationData::getQuery_RGB() const\n{\n return this-\u0026gt;queryRGB;\n}\n\nvoid ObservationData::setRow(const int row)\n{\n this-\u0026gt;row = row;\n}\n\nvoid ObservationData::setCol(const int col)\n{\n this-\u0026gt;col = col;\n}\n\nint ObservationData::getRow() const\n{\n return this-\u0026gt;row;\n}\nint ObservationData::getCol() const\n{\n return this-\u0026gt;col;\n}\n\nQDataStream \u0026amp;operator\u0026lt;\u0026lt;(QDataStream \u0026amp;out, const ObservationData \u0026amp;ob)\n{\n out \u0026lt;\u0026lt; ob.getDB_RGB() \u0026lt;\u0026lt; ob.getQuery_RGB();\n\n return out;\n}\n\nQDataStream \u0026amp;operator\u0026gt;\u0026gt;(QDataStream \u0026amp;in, ObservationData \u0026amp;ob)\n{\n unsigned char** dbRGB;\n unsigned char* queryRGB;\n //in \u0026gt;\u0026gt; dbRGB \u0026gt;\u0026gt; queryRGB; ///// ERROR\n\n ob.setDB_RGB(dbRGB);\n ob.setQuery_RGB(queryRGB);\n\n return in;\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"40894081","answer_count":"1","comment_count":"0","creation_date":"2016-11-29 13:09:36.477 UTC","last_activity_date":"2016-11-30 17:01:12.207 UTC","last_edit_date":"2016-11-30 01:52:15.503 UTC","last_editor_display_name":"","last_editor_user_id":"6445248","owner_display_name":"","owner_user_id":"6445248","post_type_id":"1","score":"0","tags":"c++|qt|opencv|qdatastream|qsharedmemory","view_count":"67"} +{"id":"10684534","title":"OK to use same event listener in dom ready and window load for jQuery?","body":"\u003cp\u003eIve used when a select list's option is changed as an event listener, with something like this: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$('#mySelect').change(function() {\n functionToRun();\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs it OK to use the event listener more than once? So something like below. I know for this exact example it makes no sense, but for more complicated code with conditionals at work it would be easier for me to maintain my code if I used the event listener twice. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$('#mySelect').change(function() {\n functionToRun();\n});\n\n//other code\n\n$('#mySelect').change(function() {\n functionToRunTwo();\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAlso, I have some code that runs on dom ready and some that runs on window load. Is it OK to use the same event listener in both instances? \u003c/p\u003e","accepted_answer_id":"10684617","answer_count":"2","comment_count":"1","creation_date":"2012-05-21 11:39:04.107 UTC","last_activity_date":"2012-05-21 11:54:21.15 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"467875","post_type_id":"1","score":"0","tags":"jquery","view_count":"117"} +{"id":"17316328","title":"Default Table Model in JavaFX","body":"\u003cp\u003eI have encountered some problem when trying to select single row from table view in JavaFX.\u003c/p\u003e\n\n\u003cp\u003eHere is how I populate my table with data from database:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic void populateCategoryTable() {\n data = FXCollections.observableArrayList();\n try {\n db.getConnection();\n String sql = \"SELECT * FROM sm_category\";\n ResultSet rs = null;\n // Call readRequest to get the result\n rs = db.readRequest(sql);\n\n while (rs.next()) {\n ObservableList\u0026lt;String\u0026gt; row = FXCollections.observableArrayList();\n //All the rows are added here dynamically \n row.add(rs.getString(\"categoryID\"));\n data.add(row);\n }\n viewCategory.setItems(data);\n rs.close();\n } catch (SQLException ex) {\n ex.printStackTrace();\n System.out.println(\"Error SQL!!!\");\n System.exit(0);\n }\n\n TableColumn id = new TableColumn(\"ID\");\n id.setVisible(false);\n id.setCellValueFactory(new Callback\u0026lt;TableColumn.CellDataFeatures\u0026lt;ObservableList, String\u0026gt;, ObservableValue\u0026lt;String\u0026gt;\u0026gt;() {\n public ObservableValue\u0026lt;String\u0026gt; call(TableColumn.CellDataFeatures\u0026lt;ObservableList, String\u0026gt; param) {\n return new SimpleStringProperty(param.getValue().get(0).toString());\n }\n });\n\n viewCategory.getColumns().addAll(id);\n\n TableView.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); //Error here\n TableView.TableViewSelectionModel selectionModel = viewCategory.getSelectionModel();\n ObservableList selectedCells = selectionModel.getSelectedCells();\n TablePosition tablePosition = (TablePosition) selectedCells.get(0);\n int row = tablePosition.getRow(); // yields the row that the currently selected cell is in\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, when I tried to insert the setSelectionMode code, there is an error. It tells me that \u003cstrong\u003ecannot find symbol\n symbol: method setSelectionMode(int)\n location: class TableView\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI remember when I did table in JavaSwing, I used this to set a model for table: DefaultTableModel tableModel = (DefaultTableModel) jTable.getModel();\u003c/p\u003e\n\n\u003cp\u003eHowever, I cannot do this in javaFX. Anybody could help me fix this?\u003c/p\u003e\n\n\u003cp\u003eThanks in advance.\u003c/p\u003e","accepted_answer_id":"17317467","answer_count":"1","comment_count":"0","creation_date":"2013-06-26 09:28:50.43 UTC","last_activity_date":"2013-06-26 11:23:46.887 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2424370","post_type_id":"1","score":"1","tags":"java|javafx|tableview|defaulttablemodel","view_count":"2486"} +{"id":"29171007","title":"htaccess - redirect subdomain to another URL and mask it","body":"\u003cp\u003eI would like all requests to \u003cbr/\u003e\n\"forum.maximumtrainer.com\" to be redirect to \u003cbr/\u003e\n\"\u003ca href=\"http://maximumtrainer.com:4567/\" rel=\"nofollow\"\u003ehttp://maximumtrainer.com:4567/\u003c/a\u003e\"\nWhere my actual forum is hosted.\u003c/p\u003e\n\n\u003cp\u003eI have tried a lot of htaccess code but without success.\nI can do a normal redirect fine, but I would like the URL to always stay \"forum.maximumtrainer.com/...\" instead of changing to \"maximumtrainer.com:4567/..\"\u003c/p\u003e\n\n\u003cp\u003eHere is my current htaccess file (first Rule is for the forum)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eRewriteEngine on\n\n#Just do a normal redirect, not hiding the new URL\nRewriteCond %{HTTP_HOST} ^forum.maximumtrainer.com$ [NC]\nRewriteRule ^(.*)$ http://maximumtrainer.com:4567%{REQUEST_URI} [R=301,NC,L]\n\nRewriteCond %{HTTPS} !=on\nRewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]\n\nRewriteBase /\nRewriteCond %{REQUEST_FILENAME} !-f\nRewriteCond %{REQUEST_FILENAME} !-d\nRewriteRule ^(.*)$ index.php?/$1 [L]\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"29171668","answer_count":"1","comment_count":"0","creation_date":"2015-03-20 16:06:58.38 UTC","last_activity_date":"2015-10-13 07:36:03.81 UTC","last_edit_date":"2015-03-20 16:16:10.59 UTC","last_editor_display_name":"","last_editor_user_id":"3233551","owner_display_name":"","owner_user_id":"3233551","post_type_id":"1","score":"0","tags":"apache|.htaccess","view_count":"1362"} +{"id":"46443795","title":"How to use nosetest to find coverage of non-tested Python files?","body":"\u003cp\u003eThe \u003ccode\u003enosetests\u003c/code\u003e tool for Python testing has an option \u003ccode\u003e--cover-inclusive\u003c/code\u003e to include all files to be able to discover holes in testing (see \u003ca href=\"http://nose.readthedocs.io/en/latest/plugins/cover.html#cover-code-coverage\" rel=\"nofollow noreferrer\"\u003edocumentation\u003c/a\u003e). However, it does not seem to work properly: it does not display files with 0% coverage at all, whereas just running the \u003ccode\u003ecoverage\u003c/code\u003e tool instead of \u003ccode\u003enosetests\u003c/code\u003e does do the job.\u003c/p\u003e\n\n\u003cp\u003eHere is a minimal example folder structure to reproduce the issue:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e__init__.py\nfoobar/__init__.py\nfoobar/foo.py # Has one function\nfoobar/bar.py # Has one function\ntest_bar.py # Tests only the function in foobar/bar.py\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen running this with \u003ccode\u003enosetests\u003c/code\u003e I get the following result:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$ nosetests --cover-package=foobar --with-coverage --cover-inclusive\nName Stmts Miss Cover\n----------------------------------------\nfoobar/__init__.py 0 0 100%\nfoobar/bar.py 2 0 100%\n----------------------------------------\nTOTAL 2 0 100%\n----------------------------------------------------------------------\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis does not display the missing tests for \u003ccode\u003efoobar/foo.py\u003c/code\u003e. However, running \u003ccode\u003ecoverage\u003c/code\u003e directly does do the job:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$ coverage run --source=. --omit=test* -m unittest discover \u0026amp;\u0026amp; coverage report\nName Stmts Miss Cover\n----------------------------------------\n__init__.py 0 0 100%\nfoobar/__init__.py 0 0 100%\nfoobar/bar.py 2 0 100%\nfoobar/foo.py 2 2 0%\n----------------------------------------\nTOTAL 4 2 50%\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis behavior of \u003ccode\u003enosetests\u003c/code\u003e doesn't change when removing the \u003ccode\u003e--cover-inclusive\u003c/code\u003e option. The only way I've found to include \u003ccode\u003efoobar/foo.py\u003c/code\u003e is to set \u003ccode\u003e--cover-package=.\u003c/code\u003e, but that then displays all other files from includes as well.\u003c/p\u003e\n\n\u003cp\u003eIs this \u003ccode\u003e--cover-inclusive\u003c/code\u003e option broken or am I doing something wrong? How do I get the same output as shown above from \u003ccode\u003ecoverage run\u003c/code\u003e but then with \u003ccode\u003enosetests\u003c/code\u003e?\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2017-09-27 09:07:05.947 UTC","last_activity_date":"2017-09-27 09:07:05.947 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4807429","post_type_id":"1","score":"0","tags":"python|nose|coverage.py","view_count":"20"} +{"id":"23331658","title":"Should i make a rpm or deb package or use the Qt Installer Framework","body":"\u003cp\u003eI want to deploy my app cross platform for linux i am confused,\nShould i build separate packages for Redhat and Debian or use an installer script like Qt Installer Framework\u003c/p\u003e","accepted_answer_id":"23331819","answer_count":"1","comment_count":"0","creation_date":"2014-04-28 02:36:47.81 UTC","last_activity_date":"2014-04-28 02:57:40.087 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3507781","post_type_id":"1","score":"1","tags":"qt|deployment|installer|cross-platform|rpmbuild","view_count":"112"} +{"id":"13632437","title":"virtualenv in python2.5.2","body":"\u003cp\u003eI'm really new to Linux environment and I'm trying to use \u003ccode\u003evirtualenv\u003c/code\u003e\nI have CentOS 5.8 running and at first it had Python 2.4 so I upgraded it to 2.5.2 \nBut now when I run \u003ccode\u003evirtualenv /test/a\u003c/code\u003e it still gives a error as: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eError: None\nError: this script requires Python 2.5 or greater\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny help to solve this problem is really appreciated.\u003c/p\u003e\n\n\u003cp\u003eNote: I installed python using: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ewget http://www.python.org/ftp/python/2.5.2/Python-2.5.2.tgz\ntar fxz Python-2.5.2.tgz\ncd Python-2.5.2\n./configure\nmake\nmake install\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI installed virtualenv before the upgrade using:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eyum install gcc python-virtualenv mysql-devel screen\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\"which userenv\" says \u003ccode\u003e/usr/bin/virtualenv\u003c/code\u003e\u003c/p\u003e","accepted_answer_id":"13748757","answer_count":"1","comment_count":"9","creation_date":"2012-11-29 18:36:40.81 UTC","favorite_count":"1","last_activity_date":"2012-12-06 17:04:09.85 UTC","last_edit_date":"2012-11-29 18:43:22.07 UTC","last_editor_display_name":"","last_editor_user_id":"1050156","owner_display_name":"","owner_user_id":"1050156","post_type_id":"1","score":"0","tags":"python|linux|bash|centos|package-managers","view_count":"805"} +{"id":"21573999","title":"Two Chronometer view in a single Activity","body":"\u003cp\u003eWhen I try to add two chronometers in the same activity, they always show the same time.\u003c/p\u003e\n\n\u003cp\u003eI am trying to implement a board game like chess and keep the time of players. So initially one chronometer runs and the other one waits, when one chronometer stops the other one starts. \u003c/p\u003e\n\n\u003cp\u003eBut for example, when chrono1 shows 00:15 and chrono2 shows 00:00 if I stop chrono1 and start chrono2, it jumps to 00:15 and resumes from there while it is supposed to start from 00:00.\u003c/p\u003e\n\n\u003cp\u003eI use the following code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eChronometer player1Chrono = (Chronometer)findViewById(R.id.player1Chrono);\nChronometer player2Chrono = (Chronometer)findViewById(R.id.player2Chrono);\nplayer1Chrono.start();\n...\n//when player 1 makes a move\nplayer2Chrono.start();\nplayer1Chrono.stop();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny idea how to solve this?\u003c/p\u003e","accepted_answer_id":"21574087","answer_count":"1","comment_count":"2","creation_date":"2014-02-05 10:02:04.32 UTC","last_activity_date":"2014-02-05 10:05:29.777 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1419582","post_type_id":"1","score":"0","tags":"android|chronometer","view_count":"308"} +{"id":"35251318","title":"V8 compiler errors","body":"\u003cp\u003eI recently managed to generate the visual studio project file for V8, but it doesn't compile\u003c/p\u003e\n\n\u003cp\u003eWhen I compile the \u003ccode\u003eAll\u003c/code\u003e solution it spends maybe ~10 minutes compiling and then presents me with a bunch of error (at least in Release mode, 35 to be exact).\u003c/p\u003e\n\n\u003cp\u003eExample:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eMSB6006 \"cmd.exe\" exited with code 1. js2c\nC1083 Cannot open source file: '..\\..\\build\\Release\\obj\\global_intermediate\\experimental-libraries.cc': No such file or directory v8_nosnapshot\nC1083 Cannot open source file: '..\\..\\build\\Release\\obj\\global_intermediate\\extras-libraries.cc': No such file or directory v8_nosnapshot \nC1083 Cannot open source file: '..\\..\\build\\Release\\obj\\global_intermediate\\libraries.cc': No such file or directory v8_nosnapshot\nC1083 Cannot open source file: '..\\..\\build\\Release\\obj\\global_intermediate\\experimental-extras-libraries.cc': No such file or directory v8_nosnapshot\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhy isn't it compiling correctly?\u003c/p\u003e","answer_count":"2","comment_count":"5","creation_date":"2016-02-07 08:25:18.89 UTC","last_activity_date":"2016-03-22 23:27:49.747 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5539085","post_type_id":"1","score":"0","tags":"c++|compiler-errors|v8|embedded-v8","view_count":"199"} +{"id":"15094535","title":"Application crashing on Surface table but not on normal desktop","body":"\u003cp\u003eI am developing a multitouch application for Microsoft Surface Table (now called PixelSense). Sometimes I am getting a strange exception when I run the application at the Surface Table, but never at my desktop computer. It happens right after I have started the application and entering the SurfaceWindow - but not always...\u003c/p\u003e\n\n\u003cp\u003eThe exception:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eObject reference not set to an instance of an object.;; \n at System.Windows.Input.StylusDevice.ChangeStylusOver(IInputElement stylusOver)\n at System.Windows.Input.StylusLogic.SelectStylusDevice(StylusDevice stylusDevice, IInputElement newOver, Boolean updateOver)\n at System.Windows.Input.StylusLogic.PreNotifyInput(Object sender, NotifyInputEventArgs e)\n at System.Windows.Input.InputManager.ProcessStagingArea()\n at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)\n at System.Windows.Input.StylusLogic.InputManagerProcessInput(Object oInput)\n at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)\n at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)\n at System.Windows.Threading.DispatcherOperation.InvokeImpl()\n at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)\n at System.Threading.ExecutionContext.runTryCode(Object userData)\n at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)\n at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)\n at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)\n at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)\n at System.Windows.Threading.DispatcherOperation.Invoke()\n at System.Windows.Threading.Dispatcher.ProcessQueue()\n at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean\u0026amp; handled)\n at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean\u0026amp; handled)\n at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)\n at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)\n at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)\n at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)\n at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)\n at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG\u0026amp; msg)\n at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)\n at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)\n at System.Windows.Application.RunDispatcher(Object ignore)\n at System.Windows.Application.RunInternal(Window window)\n at System.Windows.Application.Run(Window window)\n at System.Windows.Application.Run()\n at Client.App.Main() in C:\\WorkingFolders\\CAD\\CAD\\src\\trunk\\ClientServer\\CADClient\\obj\\x86\\Debug\\App.g.cs:line 0\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnyone has an idea why?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-02-26 16:41:41.4 UTC","last_activity_date":"2014-06-20 22:31:35.073 UTC","last_edit_date":"2014-06-20 22:31:35.073 UTC","last_editor_display_name":"","last_editor_user_id":"64046","owner_display_name":"","owner_user_id":"419529","post_type_id":"1","score":"1","tags":"c#|wpf|pixelsense","view_count":"286"} +{"id":"32151213","title":"While in a Array","body":"\u003cp\u003ehope someone can help me.\nI try to write a Import Script for Articles in my Shopsystem.\u003c/p\u003e\n\n\u003cp\u003eFor this edit the basic Code from the Wiki of the Shopsystem.\u003c/p\u003e\n\n\u003cp\u003eHere look\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$updateArticle = array(\n 'configuratorSet' =\u0026gt; array(\n 'groups' =\u0026gt; array(\n array(\n 'name' =\u0026gt; 'Farben',\n 'options' =\u0026gt; $farbenarray\n ),\n array(\n 'name' =\u0026gt; 'Größe',\n 'options' =\u0026gt; $sizearray\n ),\n )\n ),\n 'taxId' =\u0026gt; 1,\n 'variants' =\u0026gt; array(\n array(\n 'isMain' =\u0026gt; true,\n 'number' =\u0026gt; 'turn',\n 'inStock' =\u0026gt; 15,\n 'additionaltext' =\u0026gt; 'L / Black',\n 'configuratorOptions' =\u0026gt; array(\n array('group' =\u0026gt; 'Size', 'option' =\u0026gt; 'L'),\n array('group' =\u0026gt; 'Color', 'option' =\u0026gt; 'Black'),\n ),\n 'prices' =\u0026gt; array(\n array(\n 'customerGroupKey' =\u0026gt; 'EK',\n 'price' =\u0026gt; 1999,\n ),\n )\n ),\n array(\n 'isMain' =\u0026gt; false,\n 'number' =\u0026gt; 'turn.1',\n 'inStock' =\u0026gt; 15,\n 'additionnaltext' =\u0026gt; 'S / Black',\n 'configuratorOptions' =\u0026gt; array(\n array('group' =\u0026gt; 'Size', 'option' =\u0026gt; 'S'),\n array('group' =\u0026gt; 'Color', 'option' =\u0026gt; 'Black'),\n ),\n 'prices' =\u0026gt; array(\n array(\n 'customerGroupKey' =\u0026gt; 'EK',\n 'price' =\u0026gt; 999,\n ),\n )\n ),\n array(\n 'isMain' =\u0026gt; false,\n 'number' =\u0026gt; 'turn.2',\n 'inStock' =\u0026gt; 15,\n 'additionnaltext' =\u0026gt; 'S / Red',\n 'configuratorOptions' =\u0026gt; array(\n array('group' =\u0026gt; 'Size', 'option' =\u0026gt; 'S'),\n array('group' =\u0026gt; 'Color', 'option' =\u0026gt; 'Red'),\n ),\n 'prices' =\u0026gt; array(\n array(\n 'customerGroupKey' =\u0026gt; 'EK',\n 'price' =\u0026gt; 999,\n ),\n )\n ),\n array(\n 'isMain' =\u0026gt; false,\n 'number' =\u0026gt; 'turn.3',\n 'inStock' =\u0026gt; 15,\n 'additionnaltext' =\u0026gt; 'XL / Red',\n 'configuratorOptions' =\u0026gt; array(\n array('group' =\u0026gt; 'Size', 'option' =\u0026gt; 'XL'),\n array('group' =\u0026gt; 'Color', 'option' =\u0026gt; 'Red'),\n ),\n 'prices' =\u0026gt; array(\n array(\n 'customerGroupKey' =\u0026gt; 'EK',\n 'price' =\u0026gt; 999,\n ),\n )\n )\n )\n);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow i wan't to replace all the Variant Array with a While request.\u003c/p\u003e\n\n\u003cp\u003eReplace all like this \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003earray(\n 'isMain' =\u0026gt; true,\n 'number' =\u0026gt; 'turn',\n 'inStock' =\u0026gt; 15,\n 'additionaltext' =\u0026gt; 'L / Black',\n 'configuratorOptions' =\u0026gt; array(\n array('group' =\u0026gt; 'Size', 'option' =\u0026gt; 'L'),\n array('group' =\u0026gt; 'Color', 'option' =\u0026gt; 'Black'),\n ),\n 'prices' =\u0026gt; array(\n array(\n 'customerGroupKey' =\u0026gt; 'EK',\n 'price' =\u0026gt; 1999,\n ),\n )\n ),\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWith a like a request like that ( i know thats don't work but i hope you understand what i like to do)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eif ($resultat = $db-\u0026gt;query('SELECT * FROM cache_article ORDER by id WHERE artikelnummer = \"'.$herstellernummer.'\"')) {\n while($daten = $resultat-\u0026gt;fetch_object() ){\n\n\n// WHILE THE ARRAY CODES\n\n\n\n\n\n\n\narray(\n 'isMain' =\u0026gt; true,\n 'number' =\u0026gt; $daten-\u0026gt;artikelnummer,\n 'inStock' =\u0026gt; 1,\n 'additionaltext' =\u0026gt; ''.$daten-\u0026gt;size.' / '.$daten-\u0026gt;color.'',\n 'configuratorOptions' =\u0026gt; array(\n array('group' =\u0026gt; 'Size', 'option' =\u0026gt; $daten-\u0026gt;size),\n array('group' =\u0026gt; 'Color', 'option' =\u0026gt; $daten-\u0026gt;color),\n ),\n 'prices' =\u0026gt; array(\n array(\n 'customerGroupKey' =\u0026gt; 'EK',\n 'price' =\u0026gt; $daten-\u0026gt;price,\n ),\n )\n ),\n\n\n\n\n\n\n\n// END THE ARRAY Codes\n\n\n}\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow i can do that correct so that works?\nPlease give me a Example for the request and how i can integrate that.\u003c/p\u003e\n\n\u003cp\u003eSorry for my bad english! -.-\u003c/p\u003e\n\n\u003cp\u003eThank You\u003c/p\u003e","answer_count":"2","comment_count":"3","creation_date":"2015-08-22 00:51:42.457 UTC","last_activity_date":"2015-08-22 13:00:24.117 UTC","last_edit_date":"2015-08-22 01:10:56.793 UTC","last_editor_display_name":"","last_editor_user_id":"5251219","owner_display_name":"","owner_user_id":"5251219","post_type_id":"1","score":"0","tags":"php|arrays|while-loop","view_count":"68"} +{"id":"16263379","title":"Sending multiple query results to res.render() using node-mysql and mysql-queue","body":"\u003cp\u003eI [new to \u003ccode\u003enode.js\u003c/code\u003e and programming in general] have two \u003ccode\u003emysql\u003c/code\u003e query results (member info and list of workshops that members can attend) and need to send them to \u003ccode\u003eres.render()\u003c/code\u003e to be presented in \u003ccode\u003e.jade\u003c/code\u003e template (Member edit page).\u003c/p\u003e\n\n\u003cp\u003eTo do this I'm using \u003ccode\u003enode-mysql\u003c/code\u003e and \u003ccode\u003emysql-queue\u003c/code\u003e modules. Problem is I don't know how to pass callback function to render the response before \u003ccode\u003equeue.execute()\u003c/code\u003e finishes so I made workaround and put first two queries in the queue (mysql-queue feature), executed the queue, and afterwards added third \"\u003cstrong\u003edummy query\u003c/strong\u003e\" which has callback function that renders the template. \u003c/p\u003e\n\n\u003cp\u003eMy question is can I use this workaround and what would be the proper way to this using this modules?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eexports.memberEdit = function (req, res) {\n\n var q = connection.createQueue();\n\n var membersResults,\n htmlDateSigned,\n htmlBirthDate,\n servicesResults;\n\n q.query(\"SELECT * FROM members WHERE id= ?;\", req.id, function (err, results) {\n console.log(\"Članovi: \" + results[0]);\n membersResults = results[0];\n htmlDateSigned = dater.convertDate(results[0].dateSigned);\n htmlBirthDate = dater.convertDate(results[0].birthDate);\n });\n\n q.query(\"SELECT * FROM services\", function (err, results) {\n console.log(\"Services: \" + results);\n servicesResults = results;\n });\n\n q.execute();\n\n // dummy query that processes response after all queries and callback execute \n // before execute() statement\n q.query(\"SELECT 1\", function (err,result) {\n res.render('memberEdit', { title: 'Edit member', \n query:membersResults, \n dateSigned:htmlDateSigned, \n birthDate:htmlBirthDate,\n services:servicesResults }); \n})\n};\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"16263856","answer_count":"1","comment_count":"0","creation_date":"2013-04-28 13:33:29.01 UTC","last_activity_date":"2013-04-28 14:38:01.263 UTC","last_edit_date":"2013-04-28 13:51:16.773 UTC","last_editor_display_name":"","last_editor_user_id":"109825","owner_display_name":"","owner_user_id":"1795440","post_type_id":"1","score":"1","tags":"node.js|node-mysql","view_count":"1444"} +{"id":"16122409","title":"UIScrollView content changing its origin point","body":"\u003cp\u003eI'm new on iOS Development and I already searched Google many times but didn't find a solution to my problem.\u003c/p\u003e\n\n\u003cp\u003eI have a \u003ccode\u003eUITabBar\u003c/code\u003e that has two tabs. The first one shows a \u003ccode\u003eScrollView\u003c/code\u003e with some \u003ccode\u003eUIViews\u003c/code\u003e in it.\u003cbr\u003e\nIf I scroll the content (the \u003ccode\u003eUIViews\u003c/code\u003e), then change to the second tab and change back to the first tab, the \u003ccode\u003eUIViews\u003c/code\u003e get its origin point changed.\u003c/p\u003e\n\n\u003cp\u003eI'm using \u003ccode\u003eNSLog()\u003c/code\u003e to show the origin point of the \u003ccode\u003eUIViews\u003c/code\u003e in the \u003ccode\u003eviewDidAppear\u003c/code\u003e method of my \u003ccode\u003eUIViewController\u003c/code\u003e.\u003cbr\u003e\nWhen the view appear the first time, the origin point of the \u003ccode\u003eUIView\u003c/code\u003e is \u003ccode\u003e(0,0)\u003c/code\u003e. After changing the tab and changing back to the first tab, the origin point is set to \u003ccode\u003e(0,-XXX)\u003c/code\u003e where \u003ccode\u003eXXX\u003c/code\u003e is negative and varies depending on how much I have scrolled the content initially.\u003c/p\u003e\n\n\u003cp\u003eCan anyone help me, please?\u003c/p\u003e","accepted_answer_id":"16126845","answer_count":"2","comment_count":"1","creation_date":"2013-04-20 16:07:26.857 UTC","last_activity_date":"2013-04-21 00:46:52.73 UTC","last_edit_date":"2013-04-20 22:11:05.15 UTC","last_editor_display_name":"","last_editor_user_id":"1489885","owner_display_name":"","owner_user_id":"2302487","post_type_id":"1","score":"0","tags":"objective-c|uiview|uiscrollview","view_count":"617"} +{"id":"45125357","title":"Nodejs automatically shuts after running for some time","body":"\u003cp\u003eMy environment is ubuntu 16.04 with npm 5.0.0 and node 8.0.0 installed. I created an express application and started it with nohup npm start \u0026amp; in the application root directory. However, a couple of minutes later the app became unreachable and the process was lost. I tried restarting several time but the process always automatically exits. How can I start a long-running nodejs app?\u003c/p\u003e","answer_count":"1","comment_count":"4","creation_date":"2017-07-16 05:29:59.993 UTC","last_activity_date":"2017-07-16 06:52:26.057 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1033138","post_type_id":"1","score":"1","tags":"node.js","view_count":"38"} +{"id":"19400119","title":"Using 'jms.useAsyncSend=true' for some messages and verfying it in the consumer side","body":"\u003cp\u003eWe are using the embedded activemq broker within Fuse ESB (7.1.0) with consumers co-located .\u003c/p\u003e\n\n\u003cp\u003eThe producer client is deployed on a remote GlassFish server. It uses activeMQ resource adapter (5.6.0) along with spring jms template. The client publish messages to different queues. I want some of the messages (going to a given queue) to use jms.useAsyncSend=true where as the other messages should use the default. I see below options\u003c/p\u003e\n\n\u003cp\u003e1) I can't append the the option 'jms.useAsyncSend=true' in the resource adapter URL because that will enforce it for all messages.\u003c/p\u003e\n\n\u003cp\u003e2) The JNDI look-up for the connection factory is returning an instance of 'org.apache.activemq.ra.ActiveMQConnectionFactory'. I was actually expecting an instance of org.apache.activemq.ActiveMQConnectionFactory, which would have allowed me to use setUseAsyncSend() for the corresponding jmsTemplate. So I can't use this option as well.\u003c/p\u003e\n\n\u003cp\u003e3) I have multiple connection factories configured under the GlassFish connectors (one for each queue). I am trying to pass the property 'jms.useAsyncSend=true' as an additional property to a particular connection factory. I am expecting this to be used only for the connections created in that particular connection pool. Now, having done this I want to verify if it really worked.\u003c/p\u003e\n\n\u003cp\u003eQuestion 1) Is there a way where I can check in the consumer side if the property 'useAsyncSend' was set in an inbound message? This is to verify what I have done at producer side has actually worked. Note that I am using camel-context to route messages to the end consumers. Is there a way to check this within the came-context? is there a header or any such thing corresponding to this?\u003c/p\u003e\n\n\u003cp\u003eQuestion 2) Is there a better way to set 'useAsyncSend' in the producer side where one resource adapter is used for sending messages to different queues with different values for 'useAsyncSend'.\u003c/p\u003e\n\n\u003cp\u003eI understand that 'useAsyncSend' is an activeMQ specific configuration hence not available in jmstemplate interface\u003c/p\u003e\n\n\u003cp\u003eAppreciate any help on this.\u003c/p\u003e\n\n\u003cp\u003ethanks\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-10-16 09:46:29.697 UTC","last_activity_date":"2014-03-21 20:38:02.35 UTC","last_edit_date":"2014-03-21 20:38:02.35 UTC","last_editor_display_name":"","last_editor_user_id":"2011748","owner_display_name":"","owner_user_id":"2121413","post_type_id":"1","score":"0","tags":"glassfish|apache-camel|activemq|fuseesb","view_count":"519"} +{"id":"19709015","title":"Why does this Jasmine test fail occasionally in Firefox","body":"\u003cp\u003eEDIT: I changed my \u003ccode\u003econsole.log\u003c/code\u003e to an \u003ccode\u003ealert\u003c/code\u003e and found the property: \u003ccode\u003egetInterface\u003c/code\u003e. \u003c/p\u003e\n\n\u003cp\u003eWe have an environmental integrity test that ensures that our code does not introduce unwanted global variables. Before running our code, we create a \"copy\" of the \u003ccode\u003ewindow\u003c/code\u003e object:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar testingWindow = {};\nfor (var x in window) {\n if (window.hasOwnProperty(x)) {\n testingWindow[x] = true;\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd then after running our code, we run this test:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edescribe('After the program has run', function() {\n it('no new global variables have been introduced', function() {\n for (var x in window) {\n if (window.hasOwnProperty(x)) {\n if (!testingWindow[x]) {\n console.log(x);\n }\n expect(testingWindow[x]).not.toBe(undefined);\n expect(window.hasOwnProperty(x)).toBe(true);\n }\n }\n });\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis test passes in all browsers except Firefox. Even more odd, I have never seen the test fail with the \u003ccode\u003econsole\u003c/code\u003e open, so any attempt to \"see\" the error has been futile. Any help is appreciated.\u003c/p\u003e\n\n\u003cp\u003eThanks in advance.\u003c/p\u003e","accepted_answer_id":"19709794","answer_count":"1","comment_count":"0","creation_date":"2013-10-31 14:21:12.95 UTC","last_activity_date":"2013-10-31 14:54:55.19 UTC","last_edit_date":"2013-10-31 14:32:32.063 UTC","last_editor_display_name":"","last_editor_user_id":"1830334","owner_display_name":"","owner_user_id":"1830334","post_type_id":"1","score":"1","tags":"javascript|unit-testing|firefox|global-variables|jasmine","view_count":"230"} +{"id":"37803003","title":"How to implement the state value function?","body":"\u003cp\u003eI'm watching the Berkely CS 294 course about Deep Reinforcement Learning. However, I meet some troubles on the assignment. I tried to implement the equation below. I think it is quite simple but I failed to obtain the expected result as showed in the comments. There must be something that I misunderstood. Details are shown in the code below. Can anyone help?\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://quicklatex.com/cache3/4b/ql_a4e0ff64c86ce8e3e60f94cfb9fc4b4b_l3.png\" rel=\"nofollow noreferrer\"\u003estate value function http://quicklatex.com/cache3/4b/ql_a4e0ff64c86ce8e3e60f94cfb9fc4b4b_l3.png\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eHere is my code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef compute_vpi(pi, P, R, gamma):\n \"\"\"\n :param pi: a deterministic policy (1D array: S -\u0026gt; A)\n :param P: the transition probabilities (3D array: S*A*S -\u0026gt; R)\n :param R: the reward function (3D array: S*A*S -\u0026gt; R)\n :param gamma: the discount factor (scalar)\n :return: vpi, the state-value function for the policy pi\n \"\"\"\n nS = P.shape[0]\n # YOUR CODE HERE\n ############## Here is what I wrote ######################\n vpi = np.zeros([nS,])\n for i in range(nS):\n for j in range(nS):\n vpi[i] += P[i, pi[i], j] * (R[i, pi[i], j] + gamma*vpi[j])\n ##########################################################\n # raise NotImplementedError()\n assert vpi.shape == (nS,)\n return vpi\n\n\npi0 = np.zeros(nS,dtype='i')\ncompute_vpi(pi0, P_rand, R_rand, gamma)\n\n# Expected output:\n# array([ 5.206217 , 5.15900351, 5.01725926, 4.76913715, 5.03154609,\n# 5.06171323, 4.97964471, 5.28555573, 5.13320501, 5.08988046])\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat I got:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003earray([ 0.61825794, 0.67755819, 0.60497582, 0.30181986, 0.67560153,\n 0.88691815, 0.73629922, 1.09325453, 1.15480849, 1.21112992])\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSome Init code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enr.seed(0) # seed random number generator\nnS = 10\nnA = 2\n# nS: number of states\n# nA: number of actions\nR_rand = nr.rand(nS, nA, nS) # reward function\n# R[i,j,k] := R(s=i, a=j, s'=k), \n# i.e., the dimensions are (current state, action, next state)\nP_rand = nr.rand(nS, nA, nS) \n# P[i,j,k] := P(s'=k | s=i, a=j)\n# i.e., dimensions are (current state, action, next state)\n\nP_rand /= P_rand.sum(axis=2,keepdims=True) # normalize conditional probabilities\ngamma = 0.90\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"37824823","answer_count":"1","comment_count":"5","creation_date":"2016-06-14 04:27:33.67 UTC","favorite_count":"1","last_activity_date":"2016-06-15 02:11:11.817 UTC","last_edit_date":"2016-06-15 02:11:11.817 UTC","last_editor_display_name":"","last_editor_user_id":"15168","owner_display_name":"","owner_user_id":"4968861","post_type_id":"1","score":"1","tags":"python|reinforcement-learning","view_count":"181"} +{"id":"32342486","title":"AVAudioRecorder swift 2","body":"\u003cp\u003eI had my \u003ccode\u003eAVAudioRecorder\u003c/code\u003e working, but since upgrading to swift 2, I can't seem to figure out how to configure it correctly. I keep getting an error saying the \u003ccode\u003eAVAudioRecorder\u003c/code\u003e initializer cannot be invoked, but the parameters I'm providing look correct to me. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar recordSettings = [AVSampleRateKey : NSNumber(float: Float(44100.0)),\n AVFormatIDKey : NSNumber(int: Int32(kAudioFormatMPEG4AAC)),\n AVNumberOfChannelsKey : NSNumber(int: 1),\n AVEncoderAudioQualityKey : NSNumber(int: Int32(AVAudioQuality.Medium.rawValue))]\n\n\nvar recordingURL: NSURL? = nil\nvar audioRecorder:AVAudioRecorder!\n\n\nfunc directoryURL() -\u0026gt; NSURL? {\n\n let fileManager = NSFileManager.defaultManager()\n let urls = fileManager.URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask)\n let documentDirectory = urls[0] as NSURL\n let soundURL = documentDirectory.URLByAppendingPathComponent(\"sound.m4a\")\n return soundURL \n}\n\n@IBAction func recordPressed(sender: AnyObject) {\n\n let audioSession: AVAudioSession = AVAudioSession.sharedInstance()\n\n do {\n try audioSession.setCategory(AVAudioSessionCategoryPlayAndRecord)\n } catch _ {\n }\n\n do {\n try audioSession.setActive(true)\n } catch _ {\n }\n\n var error: NSError?\n\n audioRecorder = AVAudioRecorder(URL: recordingURL, settings: recordSettings, error: \u0026amp;error)\n\n if let e = error {\n\n print(e.localizedDescription, terminator: \"\")\n }\n else\n {\n audioRecorder.record()\n self.stopButton.enabled = true\n self.playButton.enabled = false\n self.recordButton.enabled = false\n\n }\n\n\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"32343080","answer_count":"1","comment_count":"2","creation_date":"2015-09-01 23:38:23.183 UTC","favorite_count":"6","last_activity_date":"2017-02-28 02:27:11.577 UTC","last_edit_date":"2015-09-02 01:06:16.07 UTC","last_editor_display_name":"","last_editor_user_id":"1925859","owner_display_name":"","owner_user_id":"1925859","post_type_id":"1","score":"12","tags":"ios|swift2|avaudiorecorder","view_count":"5377"} +{"id":"36829864","title":"Sorting command line arguments in C","body":"\u003cp\u003eI need to create a program that sorts command line strings. (Example output under code)\nThis is the code I have so far: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;stdio.h\u0026gt;\n#include \u0026lt;stdlib.h\u0026gt;\n#include \u0026lt;string.h\u0026gt;\n\nint stringcomp (const void * x, const void * y); \n\nint main(int argc, char *argv[]){ \nint i,j;\nint k = 1;\nchar strings[argc-1][20]; \n\nstrcpy(strings[0], argv[1]);\nfor(i=2; i\u0026lt; argc-1; i++){ \n strcat(strings[k],argv[i]);\n k++;\n}\nqsort(strings, argc, 20, stringcomp);\nfor(j=0 ; j \u0026lt; argc-1; j++){ \n printf(\"%s \", strings[j]); \n} \nreturn 0; \n}\n\nint stringcomp (const void *x, const void *y) { \nreturn (*(char*)x -*(char*)y); \n} \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is what I type into the command line:\n./inOrder hello darkness my old friend \u003c/p\u003e\n\n\u003cp\u003eThis is what I should get:\ndarkness friend hello my old\u003c/p\u003e\n\n\u003cp\u003eBut this is what I keep getting:\n?darkness ?old ]@my \u003c/p\u003e\n\n\u003cp\u003eWhat am I doing wrong?\u003c/p\u003e","accepted_answer_id":"36830106","answer_count":"2","comment_count":"4","creation_date":"2016-04-24 22:59:30.217 UTC","favorite_count":"0","last_activity_date":"2016-04-25 01:09:50.373 UTC","last_editor_display_name":"","owner_display_name":"user5020223","post_type_id":"1","score":"0","tags":"c","view_count":"733"} +{"id":"30763834","title":"Java (Bukkit) how to acces to the Config with out this?","body":"\u003cp\u003eI have two classes \"main\" for commands and more and \"events\" for events and now\nI want to make that the event \"PlayerdeathEvent\" teleport me to a point and the cordinates from the point are saved in a config now i test this:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003e\u003cp\u003eI made it in the event class\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic void lbbkampfrespawn()\n{\n\nFileConfiguration cfg = this.getConfig();\n\n{\n String world = cfg.getString(\"LBBsetkampfrespawn1.world\");\n double x = cfg.getDouble(\"LBBsetkampfrespawn1.x\");\n double y = cfg.getDouble(\"LBBsetkampfrespawn1.y\");\n double z = cfg.getDouble(\"LBBsetkampfrespawn1.z\");\n double yaw = cfg.getDouble(\"LBBsetkampfrespawn1.yaw\");\n double pitch = cfg.getDouble(\"LBBsetkampfrespawn1.pitch\");\n Location loc = new Location(Bukkit.getWorld(world), x, y, z);\n loc.setYaw((float) yaw);\n loc.setPitch((float) pitch);\n p1.teleport(loc);\n}\n{\n\n String world = cfg.getString(\"LBBsetkampfrespawn2.world\");\n double x = cfg.getDouble(\"LBBsetkampfrespawn2.x\");\n double y = cfg.getDouble(\"LBBsetkampfrespawn2.y\");\n double z = cfg.getDouble(\"LBBsetkampfrespawn2.z\");\n double yaw = cfg.getDouble(\"LBBsetkampfrespawn2.yaw\");\n double pitch = cfg.getDouble(\"LBBsetkampfrespawn2.pitch\");\n Location loc = new Location(Bukkit.getWorld(world), x, y, z);\n loc.setYaw((float) yaw);\n loc.setPitch((float) pitch);\n p2.teleport(loc);\n}\n\n\n\n}\n\n\n}\n\u003c/code\u003e\u003c/pre\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eProblem :\nthe dont know about \u003ccode\u003e\"getConfig()\"\u003c/code\u003e eclipse said me to crathe the method \u003ccode\u003egetConfig()\u003c/code\u003e\u003c/p\u003e\n\n\u003col start=\"2\"\u003e\n\u003cli\u003e\u003cp\u003ei made it in the main class with static\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic static void lbbkampfrespawn()\n {\n\nFileConfiguration cfg = this.getConfig();\n\n{\n String world = cfg.getString(\"LBBsetkampfrespawn1.world\");\n double x = cfg.getDouble(\"LBBsetkampfrespawn1.x\");\n double y = cfg.getDouble(\"LBBsetkampfrespawn1.y\");\n double z = cfg.getDouble(\"LBBsetkampfrespawn1.z\");\n double yaw = cfg.getDouble(\"LBBsetkampfrespawn1.yaw\");\n double pitch = cfg.getDouble(\"LBBsetkampfrespawn1.pitch\");\n Location loc = new Location(Bukkit.getWorld(world), x, y, z);\n loc.setYaw((float) yaw);\n loc.setPitch((float) pitch);\n p1.teleport(loc);\n}\n{\n\n String world = cfg.getString(\"LBBsetkampfrespawn2.world\");\n double x = cfg.getDouble(\"LBBsetkampfrespawn2.x\");\n double y = cfg.getDouble(\"LBBsetkampfrespawn2.y\");\n double z = cfg.getDouble(\"LBBsetkampfrespawn2.z\");\n double yaw = cfg.getDouble(\"LBBsetkampfrespawn2.yaw\");\n double pitch = cfg.getDouble(\"LBBsetkampfrespawn2.pitch\");\n Location loc = new Location(Bukkit.getWorld(world), x, y, z);\n loc.setYaw((float) yaw);\n loc.setPitch((float) pitch);\n p2.teleport(loc);\n}\n\n\n\n}\n\u003c/code\u003e\u003c/pre\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eProblem : I dont can uset this. in static\u003c/p\u003e\n\n\u003cp\u003eWhat I have to do thanks for your help ! \u003c/p\u003e\n\n\u003cp\u003eWhen you need more from the cod please send what. \u003c/p\u003e\n\n\u003cp\u003eThanks. Sry for the spelling\u003c/p\u003e","accepted_answer_id":"30765481","answer_count":"1","comment_count":"0","creation_date":"2015-06-10 17:56:19.12 UTC","last_activity_date":"2015-06-12 05:24:51.3 UTC","last_edit_date":"2015-06-10 18:32:39.373 UTC","last_editor_display_name":"","last_editor_user_id":"1472416","owner_display_name":"","owner_user_id":"4954271","post_type_id":"1","score":"0","tags":"java|config|bukkit","view_count":"798"} +{"id":"43400410","title":"angular2 error message never disappears","body":"\u003cp\u003eI have a dynamically generated table with select controls on every row.\nEach row is validated against a custom validator.\u003c/p\u003e\n\n\u003cp\u003eThe validator is hit and works ok. \u003c/p\u003e\n\n\u003cp\u003eWhen it comes to display the error message according to the result of the validator I cant figure out the exact expression. At the moment ERROR message is always displayed.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/2a3u8.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/2a3u8.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI even deleted all validation logic to return null at all times.Still no luck\nkind regards.\u003c/p\u003e\n\n\u003cp\u003eTemplate:\u003c/p\u003e\n\n\n\n\u003cpre class=\"lang-html prettyprint-override\"\u003e\u003ccode\u003e\u0026lt;tr *ngFor=\"let kredi of krediList ; let i=index\" [attr.rowindex]=\"i\"\u0026gt;\n \u0026lt;td\u0026gt;{{kredi?.erkenkapamatutari | number : '1.2-2' }} TL\u0026lt;/td\u0026gt;\n \u0026lt;td *ngIf=\"this.krediHesaplaAktif===true\"\u0026gt; \n \u0026lt;select [(ngModel)]=\"kredi.talepedilenmahsuptipi\" class=\"form-control input-xs\" name=\"mahsuptipleriselect{{i}}\" [krediTuruMahsupValidator]=\"validateKrediTuruMahsup(i)\"\u0026gt; \n \u0026lt;option *ngFor=\"let m of mahsupTurleri\" [ngValue]=\"m.id\" [selected]=\"kredi.talepedilenmahsuptipi == m.id\" \u0026gt;\n {{m.name}}\n \u0026lt;/option\u0026gt;\n \u0026lt;/select\u0026gt;\n \u0026lt;p style=\"color: red\" *ngIf=\"!validateKrediTuruMahsup.valid\" class=\"text-danger\"\u0026gt; ERROR MESSAGE\u0026lt;/p\u0026gt;\n \u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;button type=\"button\" class=\"btn btn-danger btn-sm\" (click)=\"taksitGoruntuleClicked(i)\"\u0026gt;Taksitleri Gör\u0026lt;/button\u0026gt;\u0026lt;/td\u0026gt;\n\u0026lt;/tr\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eValidation:\u003c/p\u003e\n\n\u003cpre class=\"lang-html prettyprint-override\"\u003e\u003ccode\u003evalidateKrediTuruMahsup(selectedIndex: number) { \n return \u0026lt;ValidatorFn\u0026gt;((control: FormControl) =\u0026gt; {\n\n return null; \n });\n }\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-04-13 19:36:33.91 UTC","last_activity_date":"2017-04-13 21:09:29.247 UTC","last_edit_date":"2017-04-13 21:09:29.247 UTC","last_editor_display_name":"","last_editor_user_id":"6294072","owner_display_name":"","owner_user_id":"5081388","post_type_id":"1","score":"1","tags":"validation|angular|typescript","view_count":"39"} +{"id":"37391421","title":"Selecting external device with DirectoryChooser","body":"\u003cp\u003eIs there a way of making external devices appear on the JavaFx DirectoryChooser's dialog box?\nIf not, are there any alternatives?\u003c/p\u003e\n\n\u003cp\u003eWhat I need to do is copy/paste files from a pc to a directory in a android phone's sdcard through a java application. \nSince I'm using javaFx I tried selecting the destination folder with a DirectoryChooser but it doesn't appear to detect the device.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-05-23 12:47:06.463 UTC","last_activity_date":"2016-07-12 09:07:31.773 UTC","last_edit_date":"2016-05-23 16:20:49.81 UTC","last_editor_display_name":"","last_editor_user_id":"4709138","owner_display_name":"","owner_user_id":"4709138","post_type_id":"1","score":"1","tags":"java|javafx|external|filechooser","view_count":"199"} +{"id":"31636107","title":"Django send_mail returns SMTPConnectError","body":"\u003cp\u003eI am trying to send an email using Django send_email, smtp and gmail. However, the code returns SMTPConnectError (-1, b\")\u003c/p\u003e\n\n\u003cp\u003eMy settings.py file:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eALLOWED_HOSTS = []\nDEFAULT_FROM_EMAIL = 'mygmailid'\nSERVER_EMAIL = 'mygmailid'\nEMAIL_USE_TLS = True\nEMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'\nEMAIL_HOST = 'smtp.gmail.com'\nEMAIL_HOST_USER = 'mygmailid'\nEMAIL_HOST_PASSWORD = 'myPassword'\nEMAIL_PORT = 587\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy views.py file:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efrom django.http import HttpResponse\nfrom django.core.mail import send_mail\nfrom smtplib import SMTPConnectError\n#rest of the code in between\n....\ntry:\n send_mail('testmail', 'test content', settings.EMAIL_HOST_USER, ['arkaghosh024@gmail.com', fail_silently=False])\nexcept SMTPConnectError as e:\n return HttpResponse(e)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe traceback:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eTraceback (most recent call last):\nFile \"\u0026lt;console\u0026gt;\", line 1, in \u0026lt;module\u0026gt;\nFile \"C:\\Python34\\lib\\site-packages\\django-1.8.2- py3.4.egg\\django\\core\\mail\\__\ninit__.py\", line 62, in send_mail\nreturn mail.send()\nFile \"C:\\Python34\\lib\\site-packages\\django-1.8.2- py3.4.egg\\django\\core\\mail\\me\nssage.py\", line 303, in send\nreturn self.get_connection(fail_silently).send_messages([self])\nFile \"C:\\Python34\\lib\\site-packages\\django-1.8.2-py3.4.egg\\django\\core\\mail\\ba\nckends\\smtp.py\", line 100, in send_messages\nnew_conn_created = self.open()\nFile \"C:\\Python34\\lib\\site-packages\\django-1.8.2-py3.4.egg\\django\\core\\mail\\ba\nckends\\smtp.py\", line 58, in open\nself.connection = connection_class(self.host, self.port, **connection_params\n)\nFile \"C:\\Python34\\lib\\smtplib.py\", line 244, in __init__\nraise SMTPConnectError(code, msg)\nsmtplib.SMTPConnectError: (-1, b\")\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I change the EMAIL_BACKEND to:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eEMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eit works fine. Also, it doesn't show the error when I use dummy backend.\u003c/p\u003e\n\n\u003cp\u003eI have tried using SSL instead of TLS, allowed less secure apps in gmail, turned off firewall and also tried other stackoverflow posts related to sending email via django but nothing worked. I don't know what the error is. Please help me. Thanks in advance.\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2015-07-26 10:51:02.78 UTC","favorite_count":"2","last_activity_date":"2015-08-04 16:31:23.22 UTC","last_edit_date":"2015-08-04 16:31:23.22 UTC","last_editor_display_name":"","last_editor_user_id":"5157204","owner_display_name":"","owner_user_id":"5157204","post_type_id":"1","score":"4","tags":"python|django|email|smtplib","view_count":"395"} +{"id":"23316375","title":"How to make a form on the homepage redirect back instead of to it's own view","body":"\u003cp\u003eI'm new to Rails and still learning my way around it, I have a form and I only want the user to be able to access the home page. When you press the save button, it redirects to the view page \u003ccode\u003ememos\u003c/code\u003e when I want it to redirect back to the homepage.\u003c/p\u003e\n\n\u003cp\u003eI tried something like this: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef create\n @memo = current_user.memos.build(memo_params)\n\n if @memo.save\n flash[:success] = \"Memo created!\"\n redirect_to root_url\n else\n @feed_items = []\n flash.keep[:notice] = \"no.\"\n render 'new'\n end\n end\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy form looks like this, although I don't think it's anything here.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;%= form_for(@memo) do |f| %\u0026gt;\n \u0026lt;div class=\"field\"\u0026gt;\n \u0026lt;%= f.text_area :info, placeholder: \"Title\" %\u0026gt;\n \u0026lt;/div\u0026gt; \n \u0026lt;div class=\"field\"\u0026gt;\n \u0026lt;%= f.text_area :link, placeholder: \"Paste link\" %\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;%= f.submit \"save\", class: \"memo-post-button\" %\u0026gt;\n\u0026lt;% end %\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI can't figure out what it is that isn't redirecting back to the homepage. I'm getting the error message on the \u003ccode\u003ememos\u003c/code\u003e page, but I want those to display on the homepage.\u003c/p\u003e","answer_count":"3","comment_count":"2","creation_date":"2014-04-26 20:50:37.72 UTC","favorite_count":"1","last_activity_date":"2014-04-27 19:33:39.32 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1212958","post_type_id":"1","score":"1","tags":"ruby-on-rails|ruby|redirect|ruby-on-rails-4","view_count":"79"} +{"id":"18030869","title":"how to upload big file by block use node js","body":"\u003cp\u003eI want to upload a big file by using node js,but the node js using aync mode,How do I upload the big file by block.My code looks like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e var i = 0;\nwhile(i \u0026lt; myObj.filesize){\n fs.readSync(in_fd, buf, 0, myObj.blockSize, null);\n i += myObj.blockSize;\n sendfile(buf); //the sendfile send data in aync mode\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-08-03 08:24:03.253 UTC","last_activity_date":"2013-08-03 09:29:47.267 UTC","last_edit_date":"2013-08-03 08:31:12.53 UTC","last_editor_display_name":"","last_editor_user_id":"11095","owner_display_name":"","owner_user_id":"2151287","post_type_id":"1","score":"0","tags":"javascript|node.js","view_count":"96"} +{"id":"44193164","title":"How to make a zoom window when taped in swift 3?","body":"\u003cp\u003eI have been looking for days how to make appear a small window in screen showing in zoom what is under the finger, so you can move the finger around viewing whats under it.\u003c/p\u003e\n\n\u003cp\u003eYou can see this feature for example in scanner applications, when you are cutting the margins with precision.\nSorry there is no code , honestly i have been doing the home work but does not know how to start coding this. thanks. \nhere is an example.\u003cbr\u003e\n\u003ca href=\"https://i.stack.imgur.com/rosMU.jpg\" rel=\"nofollow noreferrer\"\u003escreen shot from scanner app. the circle shows in zoomed view what is under the finger, who is in the rigt corner of the picture!! \u003c/a\u003e\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-05-26 03:31:55.607 UTC","last_activity_date":"2017-06-02 05:28:02.24 UTC","last_edit_date":"2017-05-26 06:55:57.39 UTC","last_editor_display_name":"","last_editor_user_id":"6064629","owner_display_name":"","owner_user_id":"8062862","post_type_id":"1","score":"1","tags":"ios|swift","view_count":"50"} +{"id":"36436357","title":"Why Is it Impossible to Have a Noiseless Channel in Real Life","body":"\u003cp\u003eI'm in the middle of a course on networking and communications. So far I found the physical layer of communication the most interesting. There's one thing that bothers me though. Why is it impossible to have a noiseless channel?? \u003c/p\u003e\n\n\u003cp\u003eWhen the Nyquist channel capacity was discussed, it was emphasized strongly that no such thing as a noiseless channel actually exists. But isn't it possible to remove all sources of noise so that noise is pretty much negligible? \u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2016-04-05 20:25:05.24 UTC","last_activity_date":"2016-04-05 20:25:05.24 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5145132","post_type_id":"1","score":"0","tags":"networking|tcp-ip|channel|nyquist","view_count":"68"} +{"id":"16794016","title":"Change WCF Response encoding","body":"\u003cp\u003eI have a WCF service who must now send data in this encoding : iso-8859-1.\u003c/p\u003e\n\n\u003cp\u003eI tried to change IIS configguration or add globalization balise in the config but the response of the service is always on UTF-8.\u003c/p\u003e\n\n\u003cp\u003eCan somebody help me ?\u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2013-05-28 13:58:20.343 UTC","last_activity_date":"2013-06-05 08:51:39.317 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"909156","post_type_id":"1","score":"1","tags":"c#|wcf|rest|encoding|iso-8859-1","view_count":"3949"} +{"id":"41565171","title":"how to remove key when the value is empty in json","body":"\u003cp\u003eI want to remove key when value is null in JSON for example (using JAVA)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\"attributes\": {\n \"csapDescriptionOfNart\": {\n \"values\": []\n },\n \"cpimCustomerWishDateOfDelivery\": {\n \"alias\": \"Customer Wish Date Of Delivery\",\n \"values\": [{\n \"value\": \"12/21/2016\",\n \"source\": \"SAP\",\n \"locale\": \"en-us\"\n }]\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn this csapDescriptionOfNart has to removed\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\"attributes\": {\n \"cpimCustomerWishDateOfDelivery\": {\n \"alias\": \"Customer Wish Date Of Delivery\",\n \"values\": [{\n \"value\": \"12/21/2016\",\n \"source\": \"SAP\",\n \"locale\": \"en-us\"\n }]\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"5","creation_date":"2017-01-10 09:17:41.827 UTC","last_activity_date":"2017-01-10 09:17:41.827 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5316658","post_type_id":"1","score":"1","tags":"json","view_count":"41"} +{"id":"42456198","title":"how to display instant output in gridivew for every loop in asp.net C#","body":"\u003cp\u003eI am collecting the number of system details and their availability in grid view, using the FOR loop for doing the same. Do I have any option of updating grid once each loop completes (every iteration of FOR loop)? \u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003egvReport -\u0026gt; Grid View\u003c/code\u003e, which am using here\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efor (int i = 0; i \u0026lt; table.Rows.Count; i++)\n\n{\n RfcDestinationManager.RegisterDestinationConfiguration(sapcfg);\n RfcDestination dest = RfcDestinationManager.GetDestination(table.Rows[i][\"host\"].ToString() + \",\" + table.Rows[i][\"SID\"].ToString() + \",\" + table.Rows[i][\"Client\"].ToString() + \",\" + table.Rows[i][\"InsNo\"].ToString());\n\n if (dest != null)\n {\n result = true\n dest.Ping();\n }\n\n if (result == true) \n {\n gvReport.Rows[i].Cells[1].BackColor = Color.Green; \n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks in advance :)\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-02-25 12:43:11.433 UTC","last_activity_date":"2017-02-25 13:20:35.893 UTC","last_edit_date":"2017-02-25 13:20:35.893 UTC","last_editor_display_name":"","last_editor_user_id":"7310344","owner_display_name":"","owner_user_id":"3392297","post_type_id":"1","score":"1","tags":"c#|asp.net|sql-server-2008-r2|sap-connector","view_count":"38"} +{"id":"46366521","title":"Scala: Will None.method result in error","body":"\u003cp\u003eLet us say a method \u003ccode\u003emethod1(\"abc\")\u003c/code\u003e returns \u003ccode\u003eSome()\u003c/code\u003e.\nWhat happens when the return value of \u003ccode\u003emethod1(\"abc\")\u003c/code\u003e is \u003ccode\u003eNone\u003c/code\u003e and I perform \u003ccode\u003emethod1(\"abc\").method\u003c/code\u003e on it? \u003c/p\u003e\n\n\u003cp\u003eI have'nt installed scala nor intend to anytime soon. I was browsing through some blogs on scala and this question popped up. Web search did not give concrete answers.\u003c/p\u003e","accepted_answer_id":"46366611","answer_count":"2","comment_count":"7","creation_date":"2017-09-22 13:57:14.49 UTC","last_activity_date":"2017-09-22 19:34:30.973 UTC","last_edit_date":"2017-09-22 19:34:30.973 UTC","last_editor_display_name":"","last_editor_user_id":"1248505","owner_display_name":"","owner_user_id":"1248505","post_type_id":"1","score":"-2","tags":"scala","view_count":"51"} +{"id":"30737345","title":"Using StringIO , no keyword arguments","body":"\u003cp\u003eI am attempting to read in a csv file using read_csv. I am very confused, since the code works when one types in the csv manually.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efrom six.moves import cStringIO as StringIO\n\nCompanies=\"\"\"\nTop, Equipment, Users, Neither \nCompany 1, 0, 0, 43\nCompany 2, 0, 0, 32\nCompany 3, 1, 3, 20\nCompany 4, 9, 3, 9\nCompany 5, 8, 7, 3\nCompany 6, 2, 7, 8\nCompany 7, 5, 2, 1\nCompany 8, 1, 4, 1\nCompany 9, 5, 1, 0\nCompany 10, 1, 1, 3\nCompany 11, 2, 2, 0\nCompany 12, 0, 1, 1\nCompany 13, 2, 0, 0\nCompany 14, 1, 0, 0\nCompany 15, 1, 0, 0\nCompany 16, 0, 1, 0\n\"\"\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eUsing:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edf = pd.read_csv(StringIO(Companies),\n skiprows=1,\n skipinitialspace=True,\n engine='python')\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e^^ The above works!\u003c/p\u003e\n\n\u003cp\u003eHowever, when I try to read the data from a separate csv,I keep getting errors. \u003c/p\u003e\n\n\u003cp\u003eI tried:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edf = pd.read_csv(StringIO('MYDATA.csv', nrows=17, skiprows=1,skipinitialspace=True, delimiter=','))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand got the error TypeError: StringIO() takes no keyword arguments\nOriginally I got the error TypeError: Must be Convertible to a buffer, not DataFrame, but I can't remember how I got rid of that error. \u003c/p\u003e\n\n\u003cp\u003eI looked up the StringIO documentation and other sites including:\n\u003ca href=\"https://newcircle.com/bookshelf/python_fundamentals_tutorial/working_with_files\" rel=\"nofollow\"\u003ehttps://newcircle.com/bookshelf/python_fundamentals_tutorial/working_with_files\u003c/a\u003e but I'm stuck! \u003c/p\u003e","accepted_answer_id":"30737388","answer_count":"1","comment_count":"0","creation_date":"2015-06-09 16:06:56.62 UTC","last_activity_date":"2015-06-09 16:23:22.02 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4945793","post_type_id":"1","score":"0","tags":"python|csv|typeerror|bokeh|stringio","view_count":"80"} +{"id":"23576281","title":"Subsetting a List in R where not a value","body":"\u003cp\u003eI'm having trouble \"filtering\" a list in R because I don't have specific parameters. The function i've created will evaluate 4000 html strings and \"decide\" if it is a valid or not address: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eTree\u0026lt;-lapply(TreeList,ValURL)\n#Returns a list with \"Error\" or a html string in each element (about 4000 elements total). \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to create a subset of the Tree list with only the elements that are NOT \"Error\".I'm used to SQL, so it would be something like: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT * FROM Tree WHERE Column1!=\"Error\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eObviously it's different in R but I can't seem to get it. I've been trying (to no avail):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Tree$\"Error\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHelp!\u003c/p\u003e","accepted_answer_id":"23576356","answer_count":"1","comment_count":"4","creation_date":"2014-05-10 01:37:52.55 UTC","last_activity_date":"2014-05-10 02:35:29.69 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2823721","post_type_id":"1","score":"-2","tags":"r|list|subset","view_count":"64"} +{"id":"23961473","title":"Two fullscreen windows on two different monitors","body":"\u003cp\u003eFor a project of mine I want to open two fullscreen windows on two different monitors. I use ChangeDisplaySettingsEx() to make each monitor switch to the resolution I need (currently, each monitor is switched to 640x480). Then I want to open a WS_POPUP window that covers the whole screen on each monitor. To make sure that the window stays up front, I also set the WS_EX_TOPMOST flag.\u003c/p\u003e\n\n\u003cp\u003eThis is all working fine as long as only a single monitor is concerned. Once I try to open a second fullscreen window on the other monitor, my window on the first monitor of course loses its focus and suddenly appears behind other windows which looks really ugly because we're in 640x480 now. This behaviour is of course logical because there can be only one topmost window but how am I supposed to use two fullscreen windows on two different monitors then? I'd somehow need to force \u003cem\u003eboth\u003c/em\u003e windows to stay up front and cover all the other windows behind them. \u003c/p\u003e\n\n\u003cp\u003eIs there a clean way to implement such a thing or is this not possible at all without resorting to hacky not-so-sure-whether-it-will-work-in-newer-or-older-Windows-versions approaches?\u003c/p\u003e\n\n\u003cp\u003eThanks! \u003c/p\u003e","answer_count":"2","comment_count":"8","creation_date":"2014-05-30 18:47:49.88 UTC","last_activity_date":"2014-05-30 20:06:02.113 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1197719","post_type_id":"1","score":"1","tags":"c|windows|winapi","view_count":"99"} +{"id":"2769110","title":"How to quickly search an array of objects in Objective-C","body":"\u003cp\u003eIs there a way in Objective-C to search an array of objects by the contained object's properties if the properties are of type string?\u003c/p\u003e\n\n\u003cp\u003eFor instance, I have an NSArray of Person objects. Person has two properties, NSString *firstName and NSString *lastName.\u003c/p\u003e\n\n\u003cp\u003eWhat's the best way to search through the array to find everyone who matches 'Ken' anywhere in the firstName OR lastName properties?\u003c/p\u003e","accepted_answer_id":"2769167","answer_count":"4","comment_count":"0","creation_date":"2010-05-04 21:30:34.197 UTC","favorite_count":"2","last_activity_date":"2016-05-02 10:44:34.627 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"175836","post_type_id":"1","score":"11","tags":"objective-c|cocoa|search","view_count":"16812"} +{"id":"24962562","title":"Inputting a file in R without setwd()","body":"\u003cp\u003eI'm trying to input a text file into R using grep and using setwd() (I can use other methods, I'm not sure what, I'm only starting to learn R). \u003c/p\u003e\n\n\u003cp\u003eI'm writing a json template for a third-party server that runs a docker image as an env but currently there is a bug that can't change the working directory. Is there another way to get this file?\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2014-07-25 18:47:42.093 UTC","last_activity_date":"2014-07-25 19:01:59.167 UTC","last_edit_date":"2014-07-25 18:50:49.257 UTC","last_editor_display_name":"","last_editor_user_id":"1086688","owner_display_name":"","owner_user_id":"3877302","post_type_id":"1","score":"-2","tags":"json|r|docker|setwd","view_count":"100"} +{"id":"996041","title":"Deleting duplicate lines in a file using Java","body":"\u003cp\u003eAs part of a project I'm working on, I'd like to clean up a file I generate of duplicate line entries. These duplicates often won't occur near each other, however. I came up with a method of doing so in Java (which basically made a copy of the file, then used a nested while-statement to compare each line in one file with the rest of the other). The problem, is that my generated file is pretty big and text heavy (about 225k lines of text, and around 40 megs). I estimate my current process to take 63 hours! This is definitely not acceptable.\u003c/p\u003e\n\n\u003cp\u003eI need an integrated solution for this, however. Preferably in Java. Any ideas? Thanks!\u003c/p\u003e","accepted_answer_id":"996057","answer_count":"14","comment_count":"1","creation_date":"2009-06-15 13:14:40.153 UTC","favorite_count":"5","last_activity_date":"2016-08-10 06:38:10.117 UTC","last_edit_date":"2016-04-10 13:51:44.903 UTC","last_editor_display_name":"","last_editor_user_id":"57695","owner_display_name":"","owner_user_id":"107092","post_type_id":"1","score":"22","tags":"java|file|text|file-io|duplicates","view_count":"36330"} +{"id":"43456396","title":"cant send journal logs to different file using rsyslogng","body":"\u003cp\u003eI have a task of sending logs from journal logs to a different file using the rsyslogng package.\u003c/p\u003e\n\n\u003cp\u003eI tried google but could not get clear details on this. Can any one help me on this\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-04-17 17:33:02.967 UTC","last_activity_date":"2017-04-17 17:33:02.967 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4810669","post_type_id":"1","score":"0","tags":"rsyslog","view_count":"7"} +{"id":"17316687","title":"Django: accessing raw urls of form media in templates","body":"\u003cp\u003e\u003ccode\u003e{{ form.media.js }}\u003c/code\u003e and \u003ccode\u003e{{ form.media.css }}\u003c/code\u003e are great to easily include media in Django templates.\u003c/p\u003e\n\n\u003cp\u003eMy problem is that I would like to get access to the raw urls (without \u003ccode\u003e\u0026lt;\\script type=\"text/javascript\" src=\"raw_url\"\u0026gt;\u0026lt;\\/script\u0026gt;\u003c/code\u003e) of these media (to include them using \u003ccode\u003eheadjs\u003c/code\u003e).\u003c/p\u003e\n\n\u003cp\u003eI'd like to achieve something like that:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;script\u0026gt;\n{% for script in form.media.js %}\n head.js(\"{{ script.raw_url }}\");\n{% endfor %}\n\u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"17317396","answer_count":"1","comment_count":"5","creation_date":"2013-06-26 09:44:38.4 UTC","last_activity_date":"2013-06-26 10:17:40.127 UTC","last_edit_date":"2013-06-26 09:57:08.703 UTC","last_editor_display_name":"","last_editor_user_id":"1685973","owner_display_name":"","owner_user_id":"1685973","post_type_id":"1","score":"0","tags":"python|django|django-forms|django-templates","view_count":"269"} +{"id":"7551390","title":"Is it okay to allow objects to be stored in each other depending on loading order?","body":"\u003cp\u003eI have an object that represent's a User's account on my site, and a separate object that acts as an attachment to the main account object and extends the user's ability to operate some major functionality on the site - a full functioning storefront.\u003c/p\u003e\n\n\u003cp\u003eI have been representing the relationship as so:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eClass Account {\n $id\n $store // this is the store object\n $email\n $password\n $status\n\n get_store() // loads the store\n}\n\nClass Store {\n $id // unique store id\n $store_name\n $store_info\n\n post_item()\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo far, this has been working great, but when I search or aggregate stores this way, it requires me to go through the Account object to get to the store.\u003c/p\u003e\n\n\u003cp\u003eI would like to cut the process in half by being able to also get to the account object through the store.\u003c/p\u003e\n\n\u003cp\u003eDoes it create a problem to ALSO allow an $account object to be stored in the $store object, just in case I want to load it the other way around? \u003c/p\u003e\n\n\u003cp\u003eAn example of allowing for this bi-directional loading would be as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eClass Account {\n $id\n $store // this is the store object\n $email\n $password\n $status\n\n get_store() // loads the store\n}\n\nClass Store {\n $id\n $account // this is the account object\n $store_name\n $store_info\n\n get_account() // loads the account\n post_item()\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"7551515","answer_count":"1","comment_count":"0","creation_date":"2011-09-26 06:35:37.507 UTC","last_activity_date":"2011-09-26 06:49:28.303 UTC","last_edit_date":"2011-09-26 06:47:00.007 UTC","last_editor_display_name":"","last_editor_user_id":"54408","owner_display_name":"","owner_user_id":"54408","post_type_id":"1","score":"1","tags":"php|oop","view_count":"25"} +{"id":"23155497","title":"Why does chrooted PHP (FPM) have problems with DNS when a chrooted shell does not?","body":"\u003ch3\u003eWhat I want to do:\u003c/h3\u003e\n\n\u003cp\u003eGet Nginx to serve PHP files through FastCGI (FPM) from within a chroot jail created using debootstrap.\u003c/p\u003e\n\n\u003ch3\u003eThe problem:\u003c/h3\u003e\n\n\u003cp\u003eEvery function that resolves hostnames to IP addresses fails with \u003ccode\u003ephp_network_getaddresses: getaddrinfo failed: Name or service not known\u003c/code\u003e. What's so odd about this is that there's no problem resolving hostnames from a chrooted shell. \u003c/p\u003e\n\n\u003ch3\u003eWhat I did so far:\u003c/h3\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003cp\u003eI disabled the firewall outside the jail.\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eI copied \u003cem\u003e/etc/resolv.conf\u003c/em\u003e, \u003cem\u003e/etc/nsswitch.conf\u003c/em\u003e and some other files (\u003ca href=\"http://forum.nginx.org/read.php?3,212362,212373#msg-212373\" rel=\"nofollow\" title=\"Nginx Forum\"\u003ewhich I found here\u003c/a\u003e) into the jail. \u003cstrong\u003e(All of which were already there thanks to Debootstrap, but I replaced them anyways!)\u003c/strong\u003e\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eI added \u003ccode\u003enameserver 8.8.8.8\u003c/code\u003e and \u003ccode\u003enameserver 8.8.4.4\u003c/code\u003e to \u003cem\u003e/etc/resolv.conf\u003c/em\u003e. \u003cstrong\u003e(I haven't done this before, because the nameservers were properly provided by the DHCP server!)\u003c/strong\u003e\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eI added \u003ccode\u003edomain localhost\u003c/code\u003e\u003csup\u003e1\u003c/sup\u003e to \u003cem\u003e/etc/resolv.conf\u003c/em\u003e and \u003ccode\u003e127.0.0.1 localhost\u003c/code\u003e\u003csup\u003e1\u003c/sup\u003e to \u003cem\u003e/etc/hosts\u003c/em\u003e.\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eI installed a nameserver inside the jail.\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eI installed a nameserver outside the jail \u003cem\u003e(oops)\u003c/em\u003e.\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eI mounted \u003cem\u003e/proc\u003c/em\u003e inside the jail.\u003c/p\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eNeedless to say that nothing actually fixed the problem, so please help me.\u003c/p\u003e\n\n\u003ch3\u003eAll the steps needed to reproduce this:\u003c/h3\u003e\n\n\u003col\u003e\n\u003cli\u003e\u003cp\u003eInstall Debian Wheezy from \u003cem\u003edebian-7.4.0-amd64-netinst.iso\u003c/em\u003e and use the default settings for everything except for \u003cem\u003eSoftware selection\u003c/em\u003e, leave only \u003cem\u003eStandard system\u003c/em\u003e checked there.\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eRealize that not picking a less distant mirror was a mistake.\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003evi /etc/apt/sources.list\u003c/code\u003e and made the file look like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edeb http://ftp.de.debian.org/debian/ wheezy main contrib non-free\ndeb-src http://ftp.de.debian.org/debian/ wheezy main contrib non-free\n\ndeb http://security.debian.org/ wheezy/updates main\ndeb-src http://security.debian.org/ wheezy/updates main\n\ndeb http://ftp.de.debian.org/debian/ wheezy-updates main\ndeb-src http://ftp.de.debian.org/debian/ wheezy-updates main\n\u003c/code\u003e\u003c/pre\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eMake sure everything is up to date prior to installing Debootstrap, Nginx and PHP-FPM.\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eaptitude update \u0026amp;\u0026amp; aptitude -y full-upgrade\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eaptitude -y install debootstrap nginx php5-fpm\u003c/code\u003e\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eUse Debootstrap to create the chroot jail for the website.\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003edebootstrap wheezy /srv/localhost http://ftp.de.debian.org/debian/\u003c/code\u003e\u003csup\u003e1\u003c/sup\u003e\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eCreate a directory called \u003cem\u003ewww\u003c/em\u003e with a test file inside the previously created jail and make \u003cem\u003ewww-data\u003c/em\u003e the owner.\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003emkdir /srv/localhost/srv/www\u003c/code\u003e\u003csup\u003e1\u003c/sup\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eecho \"\u0026lt;?php fsockopen('ftp.de.debian.org'); ?\u0026gt;\" \u0026gt; /srv/localhost/srv/www/index.php\u003c/code\u003e\u003csup\u003e1\u003c/sup\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003echown -R 33:33 /srv/localhost/srv/www\u003c/code\u003e\u003csup\u003e1\u003c/sup\u003e\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eConfigure and enable the site.\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003evi /etc/nginx/sites-available/localhost\u003c/code\u003e\u003csup\u003e1\u003c/sup\u003e and made the file look like this\u003csup\u003e1\u003c/sup\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eserver {\n listen 127.0.0.1:80;\n\n server_name localhost;\n\n root /srv/localhost/srv/www;\n index index.html index.htm index.php;\n\n location ~ \\.php$ {\n try_files $uri =404;\n fastcgi_pass unix:/var/run/localhost.sock;\n fastcgi_index index.php;\n fastcgi_param SCRIPT_FILENAME /www/$fastcgi_script_name;\n include fastcgi_params;\n }\n\n location / {\n try_files $uri $uri/ /index.html;\n }\n\n location ~* \\.(jpg|jpeg|gif|png|css|js|ico)$ {\n access_log off;\n }\n\n location = /favicon.ico {\n log_not_found off;\n }\n\n location ~ /\\. {\n deny all;\n access_log off;\n log_not_found off;\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003ccode\u003eln -s /etc/nginx/sites-available/localhost /etc/nginx/sites-enabled/\u003c/code\u003e\u003csup\u003e1\u003c/sup\u003e\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eMake slight adjustments to the FastCGI parameters provided by Nginx.\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003evi /etc/nginx/fastcgi_params\u003c/code\u003e and made the file look like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efastcgi_param QUERY_STRING $query_string;\nfastcgi_param REQUEST_METHOD $request_method;\nfastcgi_param CONTENT_TYPE $content_type;\nfastcgi_param CONTENT_LENGTH $content_length;\n\nfastcgi_param SCRIPT_NAME $fastcgi_script_name;\nfastcgi_param REQUEST_URI $request_uri;\nfastcgi_param DOCUMENT_URI $document_uri;\nfastcgi_param DOCUMENT_ROOT $document_root;\nfastcgi_param SERVER_PROTOCOL $server_protocol;\nfastcgi_param HTTPS $https if_not_empty;\n\nfastcgi_param GATEWAY_INTERFACE CGI/1.1;\nfastcgi_param SERVER_SOFTWARE nginx/$nginx_version;\n\nfastcgi_param REMOTE_ADDR $remote_addr;\nfastcgi_param REMOTE_PORT $remote_port;\nfastcgi_param SERVER_ADDR $server_addr;\nfastcgi_param SERVER_PORT $server_port;\nfastcgi_param SERVER_NAME $server_name;\n\n# PHP only, required if PHP was built with --enable-force-cgi-redirect\nfastcgi_param REDIRECT_STATUS 200;\n\u003c/code\u003e\u003c/pre\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eCreate a PHP-FPM pool(?) for the site.\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003evi /etc/php5/fpm/pool.d/localhost.conf\u003c/code\u003e\u003csup\u003e1\u003c/sup\u003e and made the file look like this\u003csup\u003e1\u003c/sup\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[localhost]\n\nuser = www-data\ngroup = www-data\n\nlisten = /var/run/localhost.sock\nlisten.allowed_clients = 127.0.0.1\n\npm = ondemand\npm.max_children = 5\npm.process_idle_timeout = 300s\npm.max_requests = 500\n\n;access.log = log/$pool.access.log\n;access.format = \"%R - %u %t \\\"%m %r\\\" %s\"\n\nchroot = /srv/localhost/srv\nchdir = /\n\n;catch_workers_output = yes\n\n;security.limit_extensions = .php .php3 .php4 .php5\n\nphp_flag[display_errors] = on\nphp_admin_flag[log_errors] = on\nphp_admin_value[error_log] = /var/log/php.log\nphp_admin_value[memory_limit] = 32M\nphp_admin_value[session.save_path] = /tmp\n\n\nenv[HOSTNAME] = $HOSTNAME\nenv[PATH] = /usr/local/bin:/usr/bin:/bin\nenv[TMP] = /tmp\nenv[TMPDIR] = /tmp\nenv[TEMP] = /tmp\n\u003c/code\u003e\u003c/pre\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eRemove Nginx and PHP-FPM configuration examples.\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003erm /etc/nginx/sites-enabled/default /etc/php5/fpm/pool.d/wwww.conf\u003c/code\u003e\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eRestart the PHP-FPM and the Nginx service.\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eservice php5-fpm restart \u0026amp;\u0026amp; service nginx restart\u003c/code\u003e\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eInspect the output.\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003ewget -qO- http://localhost\u003c/code\u003e\u003csup\u003e1\u003c/sup\u003e prints:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;br /\u0026gt;\n\u0026lt;b\u0026gt;Warning\u0026lt;/b\u0026gt;: fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in \u0026lt;b\u0026gt;/www/index.php\u0026lt;/b\u0026gt; on line \u0026lt;b\u0026gt;1\u0026lt;/b\u0026gt;\u0026lt;br /\u0026gt;\n\u0026lt;br /\u0026gt;\n\u0026lt;b\u0026gt;Warning\u0026lt;/b\u0026gt;: fsockopen(): unable to connect to ftp.de.debian.org:80:-1 (php_network_getaddresses: getaddrinfo failed: Name or service not known) in \u0026lt;b\u0026gt;/www/index.php\u0026lt;/b\u0026gt; on line \u0026lt;b\u0026gt;1\u0026lt;/b\u0026gt;\u0026lt;br /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eChroot into the jail, just to see that there's no problem with resolving hostnames\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003echroot /srv/localhost/\u003c/code\u003e\u003csup\u003e1\u003c/sup\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eping -c1 ftp.de.debian.org\u003c/code\u003e prints:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ePING ftp.de.debian.org (141.76.2.4) 56(84) bytes of data.\n64 bytes from ftp.de.debian.org (141.76.2.4): icmp_req=1 ttl=56 time=15.1 ms\n\n--- ftp.de.debian.org ping statistics ---\n1 packets transmitted, 1 received, 0% packet loss, time 0ms\nrtt min/avg/max/mdev = 15.137/15.137/15.137/0.000 ms\n\u003c/code\u003e\u003c/pre\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003chr\u003e\n\n\u003cp\u003e\u003csup\u003e1\u003c/sup\u003e All occurrences of my actual domain have been replaced with localhost and those of my actual IP address with 127.0.0.1.\u003c/p\u003e\n\n\u003cp\u003e\u003csup\u003e2\u003c/sup\u003e I've exported the Oracle\u0026reg; VirtualBox appliance and uploaded it on \u003ca href=\"https://mega.co.nz/#!YNsRwLbB!pav8BwhXgb-aJwibrcYeCJI8XRptOMVKg5ADs5_i2c8\" rel=\"nofollow\" title=\"Click here to Download the VM I used to reproduce this problem.\"\u003eMega.co.nz\u003c/a\u003e (root password is \u003cem\u003epassword\u003c/em\u003e) for everyone who's really, really eager to help me here.\u003c/p\u003e","accepted_answer_id":"23197601","answer_count":"1","comment_count":"0","creation_date":"2014-04-18 13:48:17.583 UTC","favorite_count":"1","last_activity_date":"2015-10-31 23:36:47.157 UTC","last_edit_date":"2015-10-31 23:36:47.157 UTC","last_editor_display_name":"","last_editor_user_id":"3204551","owner_display_name":"","owner_user_id":"3118225","post_type_id":"1","score":"-1","tags":"php|linux|web-services|networking|nginx","view_count":"1590"} +{"id":"40495576","title":"Codeigniter libraries and AJAX","body":"\u003cp\u003eI'm working with codeigniter, and I'm trying to make a simple login.\nI'm trying to send an ajax request into one of my libraries files (User.php).\nInside the user.php I've got the 'Login' method. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public function login($data){\n $this-\u0026gt;CI-\u0026gt;load-\u0026gt;model('School_model');\n $logged = $this-\u0026gt;CI-\u0026gt;School_model-\u0026gt;login($data['name'], $data['pass']);\n if (!empty($logged)){\n $role = $this-\u0026gt;CI-\u0026gt;School_model-\u0026gt;role($logged-\u0026gt;role);\n $sesData = [\n 'success'=\u0026gt;'success',\n 'username'=\u0026gt;$logged-\u0026gt;name,\n 'role'=\u0026gt;$role,\n 'logged'=\u0026gt;TRUE\n ];\n $this-\u0026gt;CI-\u0026gt;session-\u0026gt;set_userdata($sesData);\n }\n else{\n header('HTTP/1.1 500 Bad Reuqest');\n header('Content-Type: application/json; charset=UTF-8');\n die(\"Incorrect name or password\");\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere's my Ajax call, but i don't know how do i reach to this file, so i'm missing the URL. (my base URL is \u003ca href=\"http://localhost/school/\" rel=\"nofollow noreferrer\"\u003ehttp://localhost/school/\u003c/a\u003e)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e $('.sub').on('click', function() {\n $.ajax({\n //what should i put here?\n url: 'http://localhost/school/libraries/user',\n type: 'POST',\n //sending login information\n data: getInputs()\n })\n .done(function(data) {\n console.log('Logged in!');\n })\n .fail(function(reqObj, textStatus, errorThrown ) {\n $('.error').html(reqObj.responseText);\n });\n });\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"7","creation_date":"2016-11-08 20:12:06.58 UTC","last_activity_date":"2016-11-08 20:37:18.913 UTC","last_edit_date":"2016-11-08 20:37:18.913 UTC","last_editor_display_name":"","last_editor_user_id":"5490517","owner_display_name":"","owner_user_id":"5490517","post_type_id":"1","score":"0","tags":"php|jquery|ajax|codeigniter","view_count":"141"} +{"id":"7756777","title":"How can I set an oracle procedure's parameter default to the result of a select?","body":"\u003cp\u003eI have an oracle Procedure and I want to set the default parameter to the result of a select statement such as below.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprocedure foo( startID number : = max(x.id) from xtable x )\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut the code above is illegal syntax.\u003c/p\u003e","accepted_answer_id":"7756893","answer_count":"1","comment_count":"0","creation_date":"2011-10-13 15:43:48.083 UTC","favorite_count":"1","last_activity_date":"2011-10-13 15:53:21.633 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"587836","post_type_id":"1","score":"2","tags":"oracle|stored-procedures|procedure","view_count":"12942"} +{"id":"4436896","title":"Will Android receivers unregister automatically on application exit?","body":"\u003cp\u003eWhen my Android application needs to register a receiver, I've been registering in \u003ccode\u003eActivity.onCreate()\u003c/code\u003e and unregistering in \u003ccode\u003eActivity.onDestroy()\u003c/code\u003e (I think I'm supposed to be using \u003ccode\u003eonPause()\u003c/code\u003e and \u003ccode\u003eonResume()\u003c/code\u003e instead, but that's not really the point):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class Foo extends Activity {\n private Receiver bar = null;\n\n @Override public void onCreate(Bundle bundle) {\n this.registerReceiver(this.bar = new Receiver(), new IntentFilter());\n }\n\n @Override public void onDestroy(Bundle bundle) {\n this.unregisterReceiver(this.bar);\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs unregistering the receiver actually necessary, or will the framework handle it when my application exits?\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2010-12-14 07:39:51.557 UTC","last_activity_date":"2010-12-14 10:00:59.72 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"309308","post_type_id":"1","score":"0","tags":"android|android-activity|receiver","view_count":"1270"} +{"id":"21095959","title":"BlueJ: Create object via codepad that'll appear in Object Bench?","body":"\u003cp\u003eI'm a complete beginner at programming and am starting off with Java in BlueJ.\u003cbr\u003e\nI was trying to create a new object by typing a code line like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eClassName ClassName1 = new ClassName();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhich indeed does create a new object but the newly created object does not appear in Object Bench.\u003cbr\u003e\nIt seems to be running in the background somewhere.\u003c/p\u003e\n\n\u003cp\u003eWhereas it would appear in Object Bench, if I create a new object via right-click on the class.\u003c/p\u003e\n\n\u003cp\u003eBut is there a way to create new object so that it also does via code?\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2014-01-13 16:12:07.4 UTC","last_activity_date":"2014-01-14 23:16:43.013 UTC","last_edit_date":"2014-01-13 16:30:36.103 UTC","last_editor_display_name":"","last_editor_user_id":"2857130","owner_display_name":"","owner_user_id":"3190915","post_type_id":"1","score":"0","tags":"java|object|bluej","view_count":"1421"} +{"id":"44760571","title":"Format decimal number to 4 or 2 decimal places by removing zeros in the end","body":"\u003cp\u003eWhat I need to do is very simple: format number to 4 decimals (or 2 if it has 00 in the end)\u003c/p\u003e\n\n\u003cp\u003eI have numbers for example and their result:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003e15.2000 ---\u003e 15.20\u003c/li\u003e\n\u003cli\u003e15.6565 ---\u003e 15.6565\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eLet's say:\u003ccode\u003e$number = 15.2000\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eAnd I could use function\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enumber_format($number, 4)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut then I would get a result: 15.2000 instead of 15.20\u003c/p\u003e\n\n\u003cp\u003eIf I would use function\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enumber_format($number, 2)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethen I would get a result 15.65 instead of 15.6565\u003c/p\u003e\n\n\u003cp\u003eHow do I make it to remove trailing zeros after decimals?\u003c/p\u003e","accepted_answer_id":"44760659","answer_count":"1","comment_count":"0","creation_date":"2017-06-26 13:10:44.753 UTC","last_activity_date":"2017-06-26 13:18:10.31 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4308444","post_type_id":"1","score":"0","tags":"php","view_count":"26"} +{"id":"9700344","title":"T-SQL RAISERROR WITH NOWAIT Only Printing One Character Instead Of Whole String","body":"\u003cp\u003eI've got several T-SQL Stored Procedures, where I am using RAISERROR with a Severity parameter of 0 to print progress messages to the output window. I am already using WITH NOWAIT to ensure the messages get printed immediately.\u003c/p\u003e\n\n\u003cp\u003eHowever, no matter what string i pass to RAISERROR, only the first character is being printed to the screen.\u003c/p\u003e\n\n\u003cp\u003eFor example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eRAISERROR('Profiles Complete', 0, 1) WITH NOWAIT\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eonly prints a single 'P' to the screen.\u003c/p\u003e\n\n\u003cp\u003eDoes anybody know why this is or how I can fix it?\u003c/p\u003e\n\n\u003cp\u003eThanks very much,\u003c/p\u003e\n\n\u003cp\u003eMartyn.\u003c/p\u003e","accepted_answer_id":"9771702","answer_count":"1","comment_count":"4","creation_date":"2012-03-14 10:41:54.523 UTC","last_activity_date":"2012-03-19 14:11:06.197 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"403424","post_type_id":"1","score":"2","tags":"tsql|sql-server-2008-r2","view_count":"1510"} +{"id":"35930582","title":"Clustering Circular area with different angles","body":"\u003cp\u003eLet's say that I have a circular area and n objects deployed randomly in this area. I want to divide the circle into K groups from position of center such that objects in same area treated as member of same group. Moreover, K person assigned to visit K groups from the position of circle center (Specifically, one person for one group). Now, I want to group such a way that, traveling distance of a person for each group close to each other.\u003c/p\u003e\n\n\u003cp\u003eIf objects are deployed uniformly, it's very easy. Only divide the area into equal angles gives me the desired results. But, for random deployment of objects, I could not divide the circular area (specifically, could not fix the angle) which gives me traveling distance for each person in each group which is close to each other\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2016-03-11 01:23:39.223 UTC","last_activity_date":"2016-03-11 11:56:58.343 UTC","last_edit_date":"2016-03-11 07:40:25.84 UTC","last_editor_display_name":"","last_editor_user_id":"815724","owner_display_name":"","owner_user_id":"5185546","post_type_id":"1","score":"0","tags":"algorithm|random|cluster-analysis|distance","view_count":"80"} +{"id":"9964028","title":"Is this some genius thing or simple just bad code?","body":"\u003cp\u003eThis is a code snippet I found in an open source Java templating project.\u003c/p\u003e\n\n\u003cp\u003eDoes anyone have a clue what this construct may be good for?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e final public Expression Expression() throws ParseException {\n Expression exp;\n exp = OrExpression();\n {if (true) return exp;}\n throw new Error(\"Missing return statement in function\");\n }\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"9965133","answer_count":"2","comment_count":"6","creation_date":"2012-04-01 11:33:22.397 UTC","last_activity_date":"2016-01-04 02:42:15.183 UTC","last_edit_date":"2016-01-04 02:42:15.183 UTC","last_editor_display_name":"","last_editor_user_id":"4639281","owner_display_name":"","owner_user_id":"685422","post_type_id":"1","score":"1","tags":"java|template-engine","view_count":"209"} +{"id":"28776108","title":"How to implement Post/Redirect/Get in django pagination?","body":"\u003cp\u003eI have a view that filters out results for a posted search form: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef profile_advanced_search(request):\n args = {}\n if request.method == \"POST\":\n form = AdvancedSearchForm(request.POST)\n qs=[]\n if form.is_valid():\n cd = form.cleaned_data\n\n s_country=cd['country']\n s_province=cd['province']\n s_city = cd['city']\n\n if s_country: qs.append(Q(country__icontains = s_country)) \n if s_province: qs.append( Q(province__icontains=s_province)) \n if s_city: qs.append( Q(city__icontains=s_city))\n\n\n\n f = None\n for q in qs:\n if f is None: \n f=q \n\n else: f \u0026amp;=q\n list = UserProfile.objects.filter(f).order_by('-created_at') \n\n\n else:\n form = AdvancedSearchForm()\n list = UserProfile.objects.all().order_by('-created_at')\n\n paginator = Paginator(list,10) \n page= request.GET.get('page')\n try:\n results = paginator.page(page)\n except PageNotAnInteger:\n results = paginator.page(1) \n\n except EmptyPage:\n results = paginator.page(paginator.num_pages) \n\n args.update(csrf(request)) \n args['form'] = form \n args['results'] = results\n return render_to_response('userprofile/advanced_search.html', args,\n context_instance=RequestContext(request)) \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethe urls.py part is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eurl(r'^search/$', 'userprofile.views.profile_advanced_search'),\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe template is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;form action=\"/search/\" method=\"post\"\u0026gt;{% csrf_token %}\n\n \u0026lt;ul class=\"list-unstyled\"\u0026gt;\n\n \u0026lt;li\u0026gt;\u0026lt;h3\u0026gt;Country\u0026lt;/h3\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;{{form.country}}\u0026lt;/li\u0026gt;\u0026lt;br\u0026gt; \n \u0026lt;h4\u0026gt;Province\u0026lt;/h4\u0026gt;\n \u0026lt;li\u0026gt;{{form.province}}\u0026lt;/li\u0026gt;\n \u0026lt;h4\u0026gt;City\u0026lt;/h4\u0026gt;\n \u0026lt;li\u0026gt;{{form.city}}\u0026lt;/li\u0026gt;\n\n\n \u0026lt;/ul\u0026gt;\n\n \u0026lt;input type=\"submit\" name=\"submit\" value=\"search\" /\u0026gt;\n\n \u0026lt;/form\u0026gt;\n Search Results:\n {% for p in results %}\n\n \u0026lt;div\"\u0026gt;\n \u0026lt;div\u0026gt;\n \u0026lt;br\u0026gt;\n \u0026lt;strong\u0026gt;\u0026lt;a href=\"/profile/{{p.username}}\" \u0026gt;{{p.username}}\u0026lt;/a\u0026gt;\u0026lt;/strong\u0026gt;\n {{p.country}} \u0026lt;br\u0026gt;\n {{p.province}} \u0026lt;br\u0026gt;\n {{p.city}} \u0026lt;br\u0026gt;\n\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n {% endfor %}\n\n\n\n \u0026lt;div\u0026gt;\n \u0026lt;div class=\"pagination\"\u0026gt;\n {% if results.has_previous %}\n \u0026lt;a href=\"?page={{ results.previous_page_number }}\"\u0026gt; \u0026lt;\u0026lt; Prev \u0026lt;/a\u0026gt;\u0026amp;nbsp;\u0026amp;nbsp\n {% endif %}\n\n {% if results.has_next %}\n \u0026lt;a href=\"?page={{ results.next_page_number }}\"\u0026gt; Next \u0026gt;\u0026gt; \u0026lt;/a\u0026gt;\n {% endif %}\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n\n \u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThese work fine for the first page, but to deal with the later pages, it is \u003ca href=\"https://stackoverflow.com/questions/28751000/django-pagination-in-filtered-search-post-results/28751546#28751546\"\u003esuggested\u003c/a\u003e that I need to implement Post/Redirect/Get .\u003c/p\u003e\n\n\u003cp\u003eHowever I have had difficulty to make such views/template/urls to deal with GET pages regarding that all of the search parameters are arbitrary. So I appreciate a complete solution. \u003c/p\u003e","accepted_answer_id":"28777251","answer_count":"1","comment_count":"1","creation_date":"2015-02-27 23:31:10.977 UTC","last_activity_date":"2016-06-15 07:36:24.843 UTC","last_edit_date":"2017-05-23 12:10:53.853 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"727695","post_type_id":"1","score":"1","tags":"django|django-templates|django-views","view_count":"962"} +{"id":"14992984","title":"SQL to MapReduce: where clause with a select statement","body":"\u003cp\u003eHow could i translate an sql query to mongodb map reduce when the \u003cstrong\u003e\u003cem\u003ewhere\u003c/em\u003e\u003c/strong\u003e clause constains a select statement?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eFor example\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eselect\n sum(l_extendedprice) / 7.0 as avg_yearly\nfrom \n lineitem, \n part\nwhere \n p_partkey = l_partkey\n and p_brand = 'Brand#23'\n and p_container = 'MED BOX'\n and l_quantity \u0026lt; (\n select\n 0.2 * avg(l_quantity)\n from \n lineitem\n where \n l_partkey = p_partkey\n );\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI've tried this mapreduce, but seemingly it did not work.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edb.runCommand({\n mapreduce: \"lineitem\",\n query: {\n \"partsupp.ps_partkey.p_brand\": \"Brand#23\",\n \"partsupp.ps_partkey.p_container\": \"MED BOX\"\n },\n map: function() {\n var data = {l_extendedprice: 0, l_quantity:0, total_l_quantity: 0 };\n\n data.l_extendedprice = this.l_extendedprice;\n data.l_quantity = this.l_quantity;\n data.total_l_quantity = 1;\n\n emit(\"avg_yearly\", data);\n },\n reduce: function(key, values) {\n var data = {l_extendedprice: 0, l_quantity:0, total_l_quantity: 0 };\n var sum_l_quantity = 0;\n\n /*sum the l_quantity and total_l_quantity*/\n for (var i = 0; i \u0026lt; values.length; i++) {\n sum_l_quantity += values[i].l_quantity;\n data.total_l_quantity += values[i].total_l_quantity;\n }\n\n /*calculate the average l_quantity and multiply*/\n var avg_l_quantity = 0.2 * (sum_l_quantity / data.total_l_quantity);\n\n /*sum l_extendedprice and divide */ \n for (var i = 0; i \u0026lt; values.length; i++) {\n if( values[i].l_quantity \u0026lt; avg_l_quantity ) {\n data.l_extendedprice += values[i].l_extendedprice;\n }\n }\n data.l_extendedprice = data.l_extendedprice / 7.0;\n\n return data;\n },\n out: 'query017'\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHas another way to do it? Is it possible to do it in the query clause of mapreduce? Or i only had mistaked in my code?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eThe schema\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n \"_id\" : ObjectId(\"511b7d1b3daee1b1446ecdfe\"),\n \"l_quantity\" : 17,\n \"l_extendedprice\" : 21168.23,\n \"l_discount\" : 0.04,\n \"l_shipdate\" : ISODate(\"1996-03-13T03:00:00Z\"),\n \"l_commitdate\" : ISODate(\"1996-02-12T03:00:00Z\"),\n \"l_receiptdate\" : ISODate(\"1996-03-22T03:00:00Z\"),\n \"l_shipmode\" : \"TRUCK\",\n \"l_comment\" : \"blithely regular ideas caj\",\n \"partsupp\" : {\n \"ps_availqty\" : 6157,\n \"ps_supplycost\" : 719.17,\n \"ps_partkey\" : {\n \"p_partkey\" : NumberLong(155190),\n \"p_name\" : \"slate lavender tan lime lawn\",\n \"p_mfgr\" : \"Manufacturer#4\",\n \"p_brand\" : \"Brand#44\",\n \"p_type\" : \"PROMO BRUSHED NICKEL\",\n \"p_size\" : 9,\n \"p_container\" : \"JUMBO JAR\",\n \"p_retailprice\" : 1245.19,\n \"p_comment\" : \"regular, final dol\"\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"4","creation_date":"2013-02-21 01:16:12.643 UTC","last_activity_date":"2013-02-21 10:13:35.727 UTC","last_edit_date":"2013-02-21 10:13:35.727 UTC","last_editor_display_name":"","last_editor_user_id":"491637","owner_display_name":"","owner_user_id":"491637","post_type_id":"1","score":"0","tags":"mongodb|mapreduce","view_count":"581"} +{"id":"43636513","title":"while running my android project i m getting a null pointer exception error.the detailed description is given below","body":"\u003cp\u003ewhile running my android project I m getting an error which does not allow me to upload images from the gallery, I hope that this error is causing the problem but I m not sure, please help get rid of this error.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esetActionBar();\nscrollView.setVerticalScrollBarEnabled(false);\nregionSpinnerSetup();\ncategorySpinnerSetup();\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"3","creation_date":"2017-04-26 14:04:31.607 UTC","last_activity_date":"2017-04-28 17:39:14.317 UTC","last_edit_date":"2017-04-28 17:39:14.317 UTC","last_editor_display_name":"","last_editor_user_id":"986846","owner_display_name":"","owner_user_id":"7919211","post_type_id":"1","score":"0","tags":"android","view_count":"26"} +{"id":"13886339","title":"Detect 3 fingers on screen that don't move from original position iOS","body":"\u003cp\u003eMy app needs to be able to detect if the user placed 3 fingers anywhere on the screen so that it can call a method while the 3 fingers have not moved from the original position. This is my first time using multitouch in an app so can someone let me know the best way to approach this?\u003c/p\u003e","accepted_answer_id":"13886369","answer_count":"1","comment_count":"0","creation_date":"2012-12-14 21:15:02.677 UTC","last_activity_date":"2012-12-14 21:17:53.947 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"896334","post_type_id":"1","score":"0","tags":"objective-c|ios|multi-touch","view_count":"111"} +{"id":"45686940","title":"C - fopen_s cannot write to a file made by CreateFile","body":"\u003cp\u003eI have a main.c function and a subfunction that is called within it. In the subfunction I have used \u003ccode\u003eCreateFile\u003c/code\u003e to make a file. I then use \u003ccode\u003eCloseHandle\u003c/code\u003e to close the handle to that file. When I use \u003ccode\u003efopen_s\u003c/code\u003e after that (within the subfunction) it works with both read and write modes. But if I use \u003ccode\u003efopen_s\u003c/code\u003e in the main function afterwards, I can only open with read access, or else I get error code 13 - permission denied. The parameters of my CreateFile function are as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ehAppend = CreateFile(centralDataFilepath, // open central data file\n FILE_APPEND_DATA, // open for writing\n FILE_SHARE_READ|FILE_SHARE_WRITE, // allow multiple readers\n NULL, // no security\n OPEN_ALWAYS, // open or create\n FILE_ATTRIBUTE_NORMAL, // normal file\n NULL); // no attr. template\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd I use \u003ccode\u003efopen_s\u003c/code\u003e as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eFILE *f2;\nerrno_t errorCode3 = 0;\nerrorCode3 = fopen_s(\u0026amp;f2, centralDataFilepath, \"a+\");\nfclose(f2);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI don't actually know if CreateFile has anything to do with this, it seems like the permission of the file changes after I exit the subfunction? I need to be able to write to this file, would anyone know why I am getting this permission denied error, and how to fix it?\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2017-08-15 05:28:39.287 UTC","last_activity_date":"2017-08-15 08:19:20.09 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5607016","post_type_id":"1","score":"0","tags":"c|fopen|createfile","view_count":"68"} +{"id":"29086942","title":"Ruby on Rails choosing wrong controller action","body":"\u003cp\u003eToday I came across some strange (and very inconvenient) Ruby on Rails behavior that even persistent combing of the net did not yield a satisfying answer to.\nNote: I translated the method and route names to be easier to read in English, and hope I did not introduce any inconsistencies.\u003c/p\u003e\n\n\u003ch1\u003eSituation\u003c/h1\u003e\n\n\u003ch2\u003eEnvironment\u003c/h2\u003e\n\n\u003cp\u003eRuby on Rails 4.2.0 executing under Ruby 2.0 (also tested under Ruby 2.2.0)\u003c/p\u003e\n\n\u003ch2\u003eRelevant Code\u003c/h2\u003e\n\n\u003cp\u003econsider a controller with these actions, among others:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass AssignmentsController \u0026lt; ApplicationController\n def update\n ...\n end\n\n def takeover_confirmation\n ...\n end\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003ch2\u003eroutes.rb\u003c/h2\u003e\n\n\u003cp\u003eSince I use a lot of manually defined routes, I did \u003cem\u003enot\u003c/em\u003e use resources in routes.rb. The routes in question are defined as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e...\npost 'assignments/:id' =\u0026gt; 'assignments#update', as: 'assignment'\npost 'assignments/takeover_confirmation' =\u0026gt; 'assignments#takeover_confirmation'\n...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe relevant output of \u003ccode\u003erake routes\u003c/code\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eassignment POST /assignments/:id(.:format) assignments#update\nassignments_takeover_confirmation POST /assignments/takeover_confirmation(.:format) assignments#takeover_confirmation\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003ch2\u003eProblem\u003c/h2\u003e\n\n\u003cp\u003eWhen I do a POST to the \u003ccode\u003eassignments_takeover_confirmation_path\u003c/code\u003e, rails routes it to the \u003ccode\u003eupdate\u003c/code\u003e method instead. Server log:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eStarted POST \"/assignments/takeover_confirmation\" for ::1 at ...\nProcessing by AssignmentsController#update as HTML\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003ch2\u003eMitigation\u003c/h2\u003e\n\n\u003cp\u003eIf I put the \u003ccode\u003eupdate\u003c/code\u003e route definition \u003cem\u003eafter\u003c/em\u003e the \u003ccode\u003etakeover_confirmation\u003c/code\u003e one, it works as intended (didn't check a POST to \u003ccode\u003eupdate\u003c/code\u003e though).\u003c/p\u003e\n\n\u003cp\u003eFurthermore, after writing all this I found out I used the wrong request type for the \u003ccode\u003eupdate\u003c/code\u003e method in routes.rb (POST instead of PATCH). Doing this in routes.rb does indeed solve my problem:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epatch 'assignments/:id' =\u0026gt; 'assignments#update', as: 'assignment'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, even when defining it as POST, Rails should not direct a POST request to the existing path \"/assignments/takeover_confirmation\" to a completely different action, should it?\nI fear the next time I use two POST routes for the same controller it will do the same thing again.\u003c/p\u003e\n\n\u003cp\u003eIt seems I have a severe misconception of Rails routing, but cannot lay my finger on it...\u003c/p\u003e\n\n\u003ch1\u003eEdit: Solution\u003c/h1\u003e\n\n\u003cp\u003eAs katafrakt explained, the above request to \u003ccode\u003e/assignments/takeover_confirmation\u003c/code\u003e matched the route \u003ccode\u003eassignments/:id\u003c/code\u003e because Rails interpreted the \"takeover_confirmation\" part as string and used it for the :id parameter. Thus, this is perfectly expected behavior.\u003c/p\u003e\n\n\u003ch2\u003eWorking Example\u003c/h2\u003e\n\n\u003cp\u003eFor the sake of completeness, here is a working (if minimalistic) route-definition that does as it should, inspired by Chris's comment:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e resources :assignments do\n collection do\n post 'takeover_confirmation'\n end\n end\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn this example, only my manually created route is explicitly defined. The routes for update, show, etc. (that I defined manually at first) are now implicitly defined by \u003ccode\u003eresources: :assignments\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eCorresponding excerpt from \u003ccode\u003erake routes\u003c/code\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e...\ntakeover_confirmation_assignments POST /assignments/takeover_confirmation(.:format) assignments#takeover_confirmation\n...\nassignment GET /assignments/:id(.:format) assignments#show\n PATCH /assignments/:id(.:format) assignments#update\n PUT /assignments/:id(.:format) assignments#update\n DELETE /assignments/:id(.:format) assignments#destroy\n....\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks for the help!\u003c/p\u003e","accepted_answer_id":"29087387","answer_count":"1","comment_count":"3","creation_date":"2015-03-16 21:06:19.847 UTC","last_activity_date":"2015-10-30 10:28:00.963 UTC","last_edit_date":"2015-03-16 22:13:54.437 UTC","last_editor_display_name":"","last_editor_user_id":"4678067","owner_display_name":"","owner_user_id":"4678067","post_type_id":"1","score":"4","tags":"ruby-on-rails-4|rails-routing","view_count":"1531"} +{"id":"12227348","title":"How do I use pipe several times?","body":"\u003cp\u003eI tried to do it with function:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efilter-root () {\necho $1 | perl -pe 's/ /\\n/g' | perl -pe 's/.*(emacs|libreoffice|autokey|bkubuntu).*//' | perl -pe 's/^\\n//'\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut it doesn't work:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$ myList=`git ls-files`\n$ filter-root myList\nmyList\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"12227437","answer_count":"2","comment_count":"0","creation_date":"2012-09-01 11:30:41.983 UTC","last_activity_date":"2012-09-01 11:53:46.943 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"788700","post_type_id":"1","score":"0","tags":"bash|pipe","view_count":"105"} +{"id":"1560188","title":"php dynamic checkboxes","body":"\u003cp\u003eCurrently I have a form that submits an image with textfields such as\ntitle, description and another field that autoincrements for imageID, another\narea for the actual file , called vfile, and *** another part that has\n3 checkboxes and a text field.\nEverything works fine, and this is what it does. Submits the data to a database so that it can pull the information to a page on the website.\nThe only part I am trying to update is:\nThe 3 checkboxes and the textfield.\nLets say the first checkbox reads: Apples\nThe second : Oranges\nThe Third: Grapes\nAnd in the other category is a blank textfield that if you add something, it would add it to a category called \"Other\".\u003c/p\u003e\n\n\u003cp\u003eSo the database design has 4 fields: 1 - apples, 2 - oranges, 3 - grapes, 4 - other.\u003c/p\u003e\n\n\u003cp\u003eWhen I click a checkbox, it would add checked to the database under the correct one, either apples, oranges, or grapes.\nIf I add a field to the textbox such as: Bannanas, then it would add \"Bannanas\" to the database field vother and show that in the database.\u003c/p\u003e\n\n\u003cp\u003eThis is all fine, but what if the next picture has all 4 items, plus another one? Such as if the next picture had Apples, Oranges, Grapes, Bannanas, and Plums?\u003c/p\u003e\n\n\u003cp\u003eHow could I have the \"Bannanas\" other category, change into a checkbox category that could be chosen for the next pics when I go to the add images page next time. \nSo that when I go to the second picture to submit, it would give me the option of not just 3 checkboxes, but 4 checkboxes now, that I could check the first 4, \"Apples, Oranges, Grapes, Bannanas\" and then put Plums in the other category.\u003c/p\u003e\n\n\u003cp\u003eBasically upon submit it takes what is in the other feild and addes a new category to the database, which is then displayed in the array of checkbox choices and it is removed from the Other Category now, for it is a checkbox. (thus it would not want the value left in the old field, for it would keep creating the same category over and rewriting the old data possibly.\u003c/p\u003e\n\n\u003cp\u003eAnyway, any suggestions?\nThanks in advance. \u003c/p\u003e","answer_count":"3","comment_count":"1","creation_date":"2009-10-13 13:15:23.28 UTC","favorite_count":"0","last_activity_date":"2009-10-13 16:16:14.177 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"162735","post_type_id":"1","score":"1","tags":"php|sql","view_count":"378"} +{"id":"43264773","title":"PIL: DLL load failed: specified procedure could not be found","body":"\u003cp\u003eI've been beginning to work with images in Python and I wanted to start using PIL (Pillow). To install it, I ran \u003ccode\u003epip install Pillow\u003c/code\u003e. When installing, PIL was not previously installed. I also tried uninstalling it and reinstalling it, as well as using \u003ccode\u003epip3 install Pillow\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eWhen I run it in Python, my first line is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eFile \"C:\\Program Files\\Python36\\lib\\site-packages\\PIL\\Image.py\", line 56, in \u0026lt;module\u0026gt;\nfrom . import _imaging as core\nImportError: DLL load failed: The specified procedure could not be found.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI checked the directory, and the file _imaging.cp36-win_amd64.pyd is present under the PIL folder.\u003c/p\u003e\n\n\u003cp\u003eWhy is this happening if the needed DLL is there? How can I fix it?\u003c/p\u003e","accepted_answer_id":"43294088","answer_count":"5","comment_count":"5","creation_date":"2017-04-06 20:01:17.05 UTC","favorite_count":"2","last_activity_date":"2017-05-01 16:58:01.777 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4780330","post_type_id":"1","score":"9","tags":"python|python-imaging-library|pillow","view_count":"6589"} +{"id":"17143021","title":"How to install properly the latest version of CoffeeScript on Ubuntu (12.04)","body":"\u003cp\u003eHow to install step by step the latest version of CoffeeScript on Ubuntu 12.04.\u003c/p\u003e\n\n\u003cp\u003eThe current version of CoffeeScript is 1.6.3\u003c/p\u003e\n\n\u003cp\u003eAny comments are be very useful.\u003c/p\u003e","accepted_answer_id":"17145118","answer_count":"3","comment_count":"0","creation_date":"2013-06-17 08:11:35.667 UTC","favorite_count":"2","last_activity_date":"2015-12-07 05:40:01.553 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1977012","post_type_id":"1","score":"7","tags":"javascript|node.js|coffeescript|ubuntu-12.04|npm","view_count":"9881"} +{"id":"17825941","title":"Changing the rate at which a method is called","body":"\u003cp\u003eI'm still new to Objective C, and I feel this might be a probably a basic concept I don't know. \u003c/p\u003e\n\n\u003cp\u003eI'm working with OpenGL and I have the method GLKView of the viewcontroller, is called when \"the view needs to be updated\". From this method, I call another method, but I don't want the second method to be called at a rate that I specify. \u003c/p\u003e\n\n\u003cp\u003eHow would I go about accomplishing this? I understand that viewcontroller.preferredFramesPerSecond can be set, but I only want this ONE specific method to work on a different timer..\u003c/p\u003e\n\n\u003cp\u003eIs this even the right way of going about this?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-07-24 05:33:26.31 UTC","last_activity_date":"2013-07-24 07:28:25.687 UTC","last_edit_date":"2013-07-24 06:13:18.51 UTC","last_editor_display_name":"","last_editor_user_id":"72882","owner_display_name":"","owner_user_id":"2577959","post_type_id":"1","score":"0","tags":"iphone|objective-c|opengl-es","view_count":"64"} +{"id":"10663571","title":"How can I make one language to other language font converter Using javascript?","body":"\u003cp\u003eI want to make a converter using javascript which will convert one font to other. \nExample: If I type \"A\" to a form then the other font will display \"আ\".\u003c/p\u003e","answer_count":"2","comment_count":"4","creation_date":"2012-05-19 08:17:12.8 UTC","last_activity_date":"2012-05-19 08:35:42.113 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1404820","post_type_id":"1","score":"-1","tags":"javascript|html","view_count":"198"} +{"id":"40970898","title":"Assigning a Target for UISegmentedControl Swift 3","body":"\u003cp\u003eI have a \u003ccode\u003eUISegmentedControl\u003c/code\u003e that aims to toggle between 3 types of map views \"Standard\", \".Hybrid\", and \"Satellite\". I am getting the following error on the line \".addTarget\" Line.\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e\"Editor placeholder in source file\"\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cpre\u003e\u003ccode\u003e let segmentedControl = UISegmentedControl(items: [\"Standard\", \"Hybrid\", \"Satellite\"])\n segmentedControl.backgroundColor = UIColor.white.withAlphaComponent(0.5)\n segmentedControl.selectedSegmentIndex = 0\n\n // EVENT LISTENER FOR SEGMENT CONTROL\n segmentedControl.addTarget(self, action: \"mapTypeChanged:\", for: .valueChanged)\n\n func mapTypeChanged(segControl: UISegmentedControl){\n switch segControl.selectedSegmentIndex{\n case 0:\n mapView.mapType = .standard\n case 1:\n mapView.mapType = .hybrid\n case 2:\n mapView.mapType = .satellite\n default:\n break\n }\n\n }\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"0","creation_date":"2016-12-05 09:24:16.063 UTC","last_activity_date":"2016-12-05 09:35:37.633 UTC","last_edit_date":"2016-12-05 09:35:37.633 UTC","last_editor_display_name":"","last_editor_user_id":"5044042","owner_display_name":"","owner_user_id":"4650787","post_type_id":"1","score":"-1","tags":"swift3","view_count":"1858"} +{"id":"40786247","title":"Share session between multiple WKWebView","body":"\u003cp\u003eI need to implement billing logic. It does a few redirects and then opens the new frame in the new window – that's how it works on the web-browser.\u003c/p\u003e\n\n\u003cp\u003eI'm showing the billing frame in the WKWebView. I catch the moment when it wants to open the new frame (navigationAction.targetFrame.isNil) and ask webView to load new request. New frame is loading, but some redirects aren't happening and billing shows me an error. Looks like the session is lost.\u003c/p\u003e\n\n\u003cp\u003eI tried another way: load new request in the new webView. When I initialize the webView I pass the processPull from the previous one, following this article: \u003ca href=\"https://github.com/ShingoFukuyama/WKWebViewTips#cookie-sharing-between-multiple-wkwebviews\" rel=\"nofollow noreferrer\"\u003ehttps://github.com/ShingoFukuyama/WKWebViewTips#cookie-sharing-between-multiple-wkwebviews\u003c/a\u003e Problem wasn't solve.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elazy var webView: WKWebView = { [unowned self] in\n let preferences = WKPreferences()\n preferences.javaScriptEnabled = true\n preferences.javaScriptCanOpenWindowsAutomatically = true\n\n let configuration = WKWebViewConfiguration()\n configuration.preferences = preferences\n\n let webView = WKWebView(frame: CGRect.zero, configuration: configuration)\n webView.navigationDelegate = self\n webView.UIDelegate = self\n webView.estimatedProgress\n webView.scrollView.backgroundColor = UIColor.binomoDarkGrey()\n self.view.addSubview(webView)\n webView.snp_makeConstraints { [unowned self] (make) in\n make.edges.equalTo(self.view)\n }\n\n return webView\n}()\n\n// MARK: WKNavigationDelegate\n\nfunc webView(webView: WKWebView, decidePolicyForNavigationAction navigationAction: WKNavigationAction, decisionHandler: (WKNavigationActionPolicy) -\u0026gt; Void) {\n if navigationAction.targetFrame.isNil {\n decisionHandler(.Cancel)\n webView.loadRequest(navigationAction.request)\n } else {\n decisionHandler(.Allow)\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"2","creation_date":"2016-11-24 12:18:29.933 UTC","last_activity_date":"2017-05-06 08:48:42.5 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1292399","post_type_id":"1","score":"0","tags":"ios|swift|wkwebview|wkwebviewconfiguration","view_count":"689"} +{"id":"21071691","title":"how to pass parameters to Bash getopts using a custom variable as opposed to ${1}, ${2} etc","body":"\u003cp\u003eI want to specify parameters (options and arguments) in a Bash variable and to pass that variable to \u003ccode\u003egetopts\u003c/code\u003e for parsing instead of the usual variables \u003ccode\u003e${1}\u003c/code\u003e, \u003ccode\u003e${2}\u003c/code\u003e etc. I am not sure how to do this. Often in \u003ca href=\"http://ss64.com/bash/getopts.html\" rel=\"nofollow\"\u003edocumentation for \u003ccode\u003egetopts\u003c/code\u003e\u003c/a\u003e, the \u003ccode\u003egetopts\u003c/code\u003e syntax is described as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSyntax\n getopts optstring name [args]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI know that \u003ccode\u003eoptstring\u003c/code\u003e represents instructions for \u003ccode\u003egetopts\u003c/code\u003e on how to parse parameters and \u003ccode\u003ename\u003c/code\u003e is a variable that is to store current information under consideration by \u003ccode\u003egetopts\u003c/code\u003e (such as the value of an option's argument), but I do not know what \u003ccode\u003e[args]\u003c/code\u003e is intended to be. Is it a way to pass parameters to \u003ccode\u003egetopts\u003c/code\u003e without using the standard command line variables? If it is, how could I use this facility? If it is not, what would be a good way to pass arguments stored in, say, a space-delimited Bash variable to \u003ccode\u003egetopts\u003c/code\u003e? Thanks!\u003c/p\u003e","accepted_answer_id":"21071733","answer_count":"1","comment_count":"0","creation_date":"2014-01-12 05:37:31.793 UTC","last_activity_date":"2014-01-12 06:05:30.847 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1556092","post_type_id":"1","score":"0","tags":"bash|parameters|arguments|options|getopts","view_count":"605"} +{"id":"31260263","title":"WPF : Binding to a listbox, special behavior when nothing is selected","body":"\u003cp\u003eI have a window with a listbox, and a usercontrol details 'view' that is bound to the selected item of the listbox. By default, nothing is selected in the listbox (this is default behavior as far as I know, nothing special here). \u003c/p\u003e\n\n\u003cp\u003eWhat I'd like to do is have some sort of message appear (instead of, but in the same place as the details view) when nothing is selected in the Listbox. \u003c/p\u003e\n\n\u003cp\u003eHere is the code, I've been trying to condense this as small as I can and so have removed most of the MVVM/ ViewModel /NotifyPropertyChanged stuff. \u003c/p\u003e\n\n\u003cp\u003eI'll start with the window :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;Grid\u0026gt;\n \u0026lt;Grid.ColumnDefinitions\u0026gt;\n \u0026lt;ColumnDefinition\u0026gt;\u0026lt;/ColumnDefinition\u0026gt;\n \u0026lt;ColumnDefinition\u0026gt;\u0026lt;/ColumnDefinition\u0026gt;\n \u0026lt;/Grid.ColumnDefinitions\u0026gt;\n \u0026lt;ListBox Grid.Column=\"0\" Name=\"ListList\"\u0026gt;\u0026lt;/ListBox\u0026gt;\n \u0026lt;view:BoundItem Grid.Column=\"1\" DataContext=\"{Binding ElementName=ListList, Path=SelectedItem}\" \u0026gt;\u0026lt;/view:BoundItem\u0026gt; \n\u0026lt;/Grid\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe item that gets bound to does nothing more than echo some properties : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;Grid\u0026gt;\n \u0026lt;StackPanel Orientation=\"Vertical\"\u0026gt;\n \u0026lt;TextBox Text=\"{Binding Foo, Mode=OneWay}\"\u0026gt;\u0026lt;/TextBox\u0026gt;\n \u0026lt;TextBox Text=\"{Binding Bar, Mode=OneWay}\"\u0026gt;\u0026lt;/TextBox\u0026gt;\n \u0026lt;TextBox Text=\"{Binding Baz, Mode=OneWay}\"\u0026gt;\u0026lt;/TextBox\u0026gt;\n \u0026lt;/StackPanel\u0026gt;\n\u0026lt;/Grid\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd I'm setting populating the listbox and defining a dataitem all in one go : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e /// \u0026lt;summary\u0026gt;\n/// Interaction logic for ListBoxSelectedItemBinding.xaml\n/// \u0026lt;/summary\u0026gt;\npublic partial class ListBoxSelectedItemBinding : Window\n{\n public ListBoxSelectedItemBinding()\n {\n InitializeComponent();\n this.ListList.Items.Add(new ListBoxData());\n this.ListList.Items.Add(new ListBoxData());\n this.ListList.Items.Add(new ListBoxData());\n\n }\n}\n\npublic class ListBoxData\n{\n public string Foo\n {\n get\n {\n return \"Foo\";\n }\n }\n\n public string Bar\n {\n get\n {\n return \"FooBar\";\n }\n }\n\n public string Baz\n {\n get\n {\n return \"FooBarBaz\";\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen the app starts up, nothing is selected, and I see the listbox on the Left, and 3 empty textboxes on the right. Once I select something, the three textboxes get populated. \u003c/p\u003e\n\n\u003cp\u003eWhat I'd like is to just hide the completely until something gets selected. I think I can give a default item to bind to with Binding TargetNullValue or FallBackValue - That isn't quite what I am looking for. More so, I'm looking to entirely hide the and replace it with something else (suppose a button, just to give an idea). \u003c/p\u003e\n\n\u003cp\u003eI don't think there is anything at all complicated here. I've searched for answers, but am just swamped with slightly related subjects on listbox binding, selected item, etc. \u003c/p\u003e","accepted_answer_id":"31260835","answer_count":"1","comment_count":"0","creation_date":"2015-07-07 05:17:23.313 UTC","last_activity_date":"2015-07-07 05:57:34.967 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1318005","post_type_id":"1","score":"0","tags":"wpf|listbox","view_count":"106"} +{"id":"37787749","title":"How to retrieve Date and Time from SOAP Response?","body":"\u003cp\u003eI am getting proper SOAP response from the endpoint, but how can I get the date and time from SOAP Response by when the service was hit?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esoapRequest = createSoapMessage(wsRequestString);\nsoapConnFactory = SOAPConnectionFactory.newInstance();\nsoapConnection = soapConnFactory.createConnection();\nURL endPoint = new URL(URL);\nsoapResponse = soapConnection.call(soapRequest, endPoint);\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"0","creation_date":"2016-06-13 10:46:36.637 UTC","last_activity_date":"2016-06-13 14:37:06.45 UTC","last_edit_date":"2016-06-13 10:48:18.037 UTC","last_editor_display_name":"","last_editor_user_id":"982149","owner_display_name":"","owner_user_id":"5972267","post_type_id":"1","score":"1","tags":"java|soap","view_count":"71"} +{"id":"29364250","title":"angularJS: how to specify DOM elements (selectors)?","body":"\u003cp\u003eGenerally, the question is: \u003cstrong\u003ehow to use DOM selectors in AngularJS\u003c/strong\u003e?\u003c/p\u003e\n\n\u003cp\u003eMore deeply: what is the recommended way to specify a DOM element, where some action should be done? Let's say, I've got a plugin or a component that does some magical stuff (animations, executes a flow, embeds something, etc.) and \u003cstrong\u003eI need to decide where it will happen in the runtime\u003c/strong\u003e?\u003c/p\u003e\n\n\u003cp\u003eI'll compare it with Backbone. Angular is more declarative, whereas Backbone is imperative. In Backbone there is jQuery (or sth alternative), each Backbone.View has \u003ccode\u003eel.$\u003c/code\u003e, which is a jQuery selector engine that is bound not to global DOM, but to the View's sub-DOM tree. This is faster (no need to search elements globally), easier to maintain (won't find any DOM element outside the View) and convenient. I can pass the selector, such as \u003ccode\u003e#id\u003c/code\u003e or \u003ccode\u003e.class\u003c/code\u003e during runtime. And execute or open something manually, because \u003cstrong\u003eBackbone is imperative\u003c/strong\u003e.\u003c/p\u003e\n\n\u003cp\u003eNow how about angular? Let's say I want to start a big and complex user-interface process: it consists of few forms and few views, navigated forward step by step, and eventually finished with ending view (job successful or sth alike). When one view is finished, it is reloaded (overlay/spinner) and another is loaded. I want to embed it into a specified DOM element, but I would like to define it during runtime, not to embed it as angular attribute. How does that conform to \u003cem\u003eangular philosophy\u003c/em\u003e?\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2015-03-31 08:42:46.623 UTC","last_activity_date":"2015-03-31 08:42:46.623 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"769384","post_type_id":"1","score":"0","tags":"javascript|angularjs|dom|jquery-selectors","view_count":"111"} +{"id":"41755622","title":"Google Sheets / Count instances in only odd rows of an array","body":"\u003cp\u003eI've been going around and around on this one.\u003c/p\u003e\n\n\u003cp\u003eI have an array that consists of one type of thing (like a header) on the odd rows and then the data on the even rows. Here's a 4x4 cell example (which really contains 8 headers and 8 data elements):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e A B C D\n +---------------------------------------------------\n1| *Red *Blue Blue Blue\n2| Robin Sparrow Oriole Blue Jay\n3| *Blue Blue-xx *Red Red\n4| Thrush Barred Owl Red Hawk Eagle \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm looking for a way to count only the \u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eodd-row \"blues\" and \"reds\" (in two separate formulae)\u003c/li\u003e\n\u003cli\u003ethat do NOT have as asterisk\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eIt needs to be NOT tripped up by:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eThe additional \"-xx\" in B3.\u003c/li\u003e\n\u003cli\u003eThe presence of the strings \"blue\" or \"red\" in non-header even cells (D2=\"BLUE jay\"; B4=\"barRED owl\"; C4=\"RED hawk\")\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eAssume I already know through other methods that there were 5 blue and 3 red header values to begin with, all of which started with an asterisk. I would prefer for the solution to involve counting only those cells that have no asterisk, but because of the assumption I stated, it's ok for the solution to count only those that DO have an asterisk and then subtract.\u003c/p\u003e\n\n\u003cp\u003eThus the \"blue\" formula should report that there are 3 odd-row \"blues\" without asterisks (C1, D1, B3).\u003c/p\u003e\n\n\u003cp\u003eThe \"red\" formula should report that there are 2 odd-row \"reds\" without an asterisk (A1, C3).\u003c/p\u003e\n\n\u003cp\u003eCurrently, I have in place this ugly thing:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e=if({Five original blues})-(COUNTIF($A$1:$B$1,\"blue\")+countif($A$3:$B$3,\"blue\"))\u0026gt;0,{Five original blues}-(countif($A$1:$B$1,\"blue\")+countif($A$3:$B$3,\"blue\")),\"Zero\")\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOr, parsing it out, if (5 - ((blues on line 1)+(blues on line 3)) is positive, then display that number. If it's not positive, write out the word zero.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e=if(\n {Five original blues}) - \n (COUNTIF($A$1:$B$1,\"blue\")+COUNTIF($A$3:$B$3,\"blue\"))\n \u0026gt;0\n ,\n {Five original blues} -\n (COUNTIF($A$1:$B$1,\"blue\")+COUNTIF($A$3:$B$3,\"blue\"))\n ,\n \"Zero\"\n )\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOutput with this is three, as expected.\u003c/p\u003e\n\n\u003cp\u003eThis isn't a terrible solution for my 8 data points with two header rows, but I expect to have at least ten header rows and this does not scale very well.\u003c/p\u003e\n\n\u003cp\u003eI keep trying various things like\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e - (if(isodd(row(A1:B4)) . . . \n - countif(A1:B4,and(isodd(row(A1:B4)),find(\"blue\",A1:B4) ...\n - arrayformula ...?\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut haven't figured it out yet.\u003c/p\u003e\n\n\u003cp\u003eThanks in advance!\u003c/p\u003e","accepted_answer_id":"41816491","answer_count":"2","comment_count":"0","creation_date":"2017-01-20 03:30:21.503 UTC","last_activity_date":"2017-01-23 22:02:00.923 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3040148","post_type_id":"1","score":"0","tags":"arrays|count|google-spreadsheet|row|instances","view_count":"50"} +{"id":"45878045","title":"Excel VBA set variable over multiple workbooks","body":"\u003cp\u003eI am working on a standard \"book 1, sheet1\" workbook, will rename when I am done.\u003c/p\u003e\n\n\u003cp\u003eI have a master workbook, the sheet in this workbook will have information typed up by the user. The information is 3 parts: a user ID, location of a picture, save location.\u003c/p\u003e\n\n\u003cp\u003ethis is the current codes i have that are working.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSub Export_To_PDF()\n\nDim WBName, filepath, Filepth As String\nWBName = ActiveWorkbook.Name\n\nFilepth = Workbooks(\"Book1.xlsx\").Sheets(\"Sheet1\").Range(\"B4\").Value\n\nfilepath = Filepth \u0026amp; \"\\\" \u0026amp; WBName \u0026amp; \".pdf\"\n\nActiveSheet.ExportAsFixedFormat _\nType:=xlTypePDF, _\nFilename:=filepath, _\nQuality:=xlQualityMinimum, IncludeDocProperties:=True, _\nIgnorePrintAreas:=False, OpenAfterPublish:=False\n\nEnd Sub\n\nSub Macro1()\n\n\nSheets(\"Balancing Summary\").Select\nRange(\"E24\").Select\nActiveCell.FormulaR1C1 = \"A1111\"\nRange(\"E26\").Select\nActiveSheet.Pictures.Insert(\"C:\\Users\\a1111\\Music\\ThePicture.jpg\").Select\nChDir \"C:\\Users\\a1111\\Documents\\Done\"\n\nCall Export_To_PDF\n\nEnd Sub\n\nSub DoAll()\n\nWorkbooks(\"Book1.xlsx\").Activate\n\nDim wbkX As Workbook\nFor Each wbkX In Application.Workbooks\nwbkX.Activate \nCall Macro1\nNext wbkX\n\nEnd Sub\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe code takes the address typed in Cell B4 and saves the document there. i need the same to be done for the picture. the address for the picture will be typed in Book1, Sheet 1, B3. i need the below line to not have the address but refer to the specific cell in that book and sheet when the macro is run.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eActiveSheet.Pictures.Insert(\"C:\\Users\\a1111\\Music\\ThePicture.jpg\").Select\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethere will be multiple workbooks and sheets open, so it has to specify the correct workbook and sheet.\u003c/p\u003e\n\n\u003cp\u003ei need it done similarly to the below line\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eFilepth = Workbooks(\"Book1.xlsx\").Sheets(\"Sheet1\").Range(\"B4\").Value\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"45883049","answer_count":"2","comment_count":"4","creation_date":"2017-08-25 09:09:31.037 UTC","favorite_count":"0","last_activity_date":"2017-08-25 13:57:28.007 UTC","last_edit_date":"2017-08-25 13:34:58.8 UTC","last_editor_display_name":"","last_editor_user_id":"1955214","owner_display_name":"","owner_user_id":"1955214","post_type_id":"1","score":"-1","tags":"excel-vba|variables","view_count":"38"} +{"id":"6762251","title":"Trouble synchronously receiving messages from Queue in Websphere 6.1","body":"\u003cp\u003eI have trouble developing JMS application with Websphere 6.1.0.33 with EJB 3.0 FP.\u003c/p\u003e\n\n\u003cp\u003eApplication has two queues - RequestQueue and ResponseQueue. \nAn MDB is attached to RequestQueue to process messages via Session bean and to post responses in ResponseQueue.\nServlet is used as a testing client. It has two options - to send a request to RequestQueue and to synchronously receive response via MessageConsumer.receiveNoWait.\nThe problem is that receiveNoWait always return null - even if there are messages is queue (i can see 'em through AdminConsole). MessageConsumer.receive blocks forever.\nMoreover, if I attach MDB to listen to ResponseQueue, it will work ok and receive all the responses.\u003c/p\u003e\n\n\u003cp\u003eSIB is used as the messaging engine, there are two destinations linked to queues.\nFor each MDB there is an Activation Specification configured.\u003c/p\u003e\n\n\u003cp\u003eI double-checked all bindings and still can't see the problem.\u003c/p\u003e\n\n\u003cp\u003eSpecifying trace as in \u003ca href=\"http://www-01.ibm.com/support/docview.wss?uid=swg21199176\" rel=\"nofollow\"\u003ehttp://www-01.ibm.com/support/docview.wss?uid=swg21199176\u003c/a\u003e gives no useful data.\u003c/p\u003e\n\n\u003cp\u003eMaybe I left out some configuration component?\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2011-07-20 12:53:59.82 UTC","last_activity_date":"2011-07-22 07:19:59.64 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"853937","post_type_id":"1","score":"0","tags":"java|jms|websphere","view_count":"379"} +{"id":"40765819","title":"Linker errors when using Boost Unique pointer with Boost Bind and Boost Function","body":"\u003cp\u003eUsing Boost Bind with a Boost Unique Pointer and Boost Function I am receiving linker errors depending on how I pass a callback to the receiving function.\u003cbr\u003e\nIf I create a Boost Function member variable by binding a callback containing a boost unique pointer param and pass this onto the receiving function, this results in linker errors when attempting to use the unique pointer when the callback is invoked.\u003c/p\u003e\n\n\u003cp\u003eIf I perform the bind in place when calling the receiving function I do not get the linker errors and the code behaves as expected.\u003c/p\u003e\n\n\u003cp\u003eSample code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass test\n{\npublic:\n test() : callback_(boost::bind(\u0026amp;test::callback, this, _1, _2))\n\n void start()\n {\n // using boost function pointer,\n // this fails with linker errors\n accept(callback_); // (Method 1)\n\n // using in place bind\n // this is OK\n accept(boost::bind(\u0026amp;test::callback, this, _1, _2)); // (Method 2)\n }\n\n void callback(BOOST_RV_REF(boost::movelib::unique_ptr\u0026lt;message\u0026gt;) message,\n int version)\n {\n // attempting to use message if implemented as (Method 1) will result in linker errors\n\n message-\u0026gt;get_body(); // If I comment out this line then both methods compile and link???\n }\n\n boost::function\n \u0026lt; void ( BOOST_RV_REF(boost::movelib::unique_ptr \u0026lt; message \u0026gt;) message,\n int version) \u0026gt; callback_;\n\n};\n\n\nclass callback_tester\n{\n callback_tester(){};\n\n void accept(boost::function\n \u0026lt; void ( BOOST_RV_REF(boost::movelib::unique_ptr \u0026lt; message \u0026gt;) message,\n int version) callback)\n {\n // Assignment to local member variable is fine here so we\n // can invoke the callback at a later stage.\n test_callback_ = callback; \n\n test_callback_(boost::move(message_), version_);\n }\n\n\n // define handler to store and invoke test callback\n boost::function\n \u0026lt; void ( BOOST_RV_REF(boost::movelib::unique_ptr \u0026lt; message \u0026gt;) message,\n int version) \u0026gt; test_callback_;\n boost::movelib::unique_ptr\u0026lt;message\u0026gt; message_;\n int version_;\n};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSome of the linker errors are as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eError: symbol `_ZN5boost8functionIFvRKNS_6system10error_codeERNS_2rvINS_7movelib10unique_ptrIN5cayan3hal7network10tcp_socketENS6_14default_deleteISB_EEEEEEEED2Ev' is already defined\nError: symbol `_ZN5boost9function2IvRKNS_6system10error_codeERNS_2rvINS_7movelib10unique_ptrIN5cayan3hal7network10tcp_socketENS6_14default_deleteISB_EEEEEEED2Ev' is already defined\nError: symbol `_ZNSt15binary_functionIRKN5boost6system10error_codeERNS0_2rvINS0_7movelib10unique_ptrIN5cayan3hal7network10tcp_socketENS6_14default_deleteISB_EEEEEEvEC2Ev' is already defined\n...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCan anyone tell me what the difference in the two methods is and why the linker errors only appear when attempting to access the unique pointer when Method 1 is used?\u003c/p\u003e\n\n\u003cp\u003eI have come across some information that the callback should be CopyConstructible to use with boost::function. But if that is true I would have expected both methods to bind and pass a callback containing a unique pointer to fail.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-11-23 13:27:38.167 UTC","last_activity_date":"2016-11-23 14:41:13.937 UTC","last_edit_date":"2016-11-23 14:26:07.36 UTC","last_editor_display_name":"","last_editor_user_id":"7199743","owner_display_name":"","owner_user_id":"7199743","post_type_id":"1","score":"0","tags":"c++|boost|unique-ptr|boost-bind|boost-function","view_count":"57"} +{"id":"22015376","title":"How to port existing Windows Store Application to Windows8 Mobile App ?","body":"\u003cp\u003eWe have existing Windows Store application which is developed using C# and XAML. We want to port the same to Windows 8 Mobile application. Is there any Guidelines available for this ?\u003c/p\u003e","answer_count":"3","comment_count":"0","creation_date":"2014-02-25 13:16:15.907 UTC","last_activity_date":"2014-03-07 03:12:50.897 UTC","last_edit_date":"2014-03-07 03:12:50.897 UTC","last_editor_display_name":"","last_editor_user_id":"3330969","owner_display_name":"","owner_user_id":"3350042","post_type_id":"1","score":"0","tags":"c#|xaml|windows-phone-8|winrt-xaml","view_count":"126"} +{"id":"43237989","title":"Numbering/sequencing sets with same column values [R]","body":"\u003cp\u003eExactly the same as this question (\u003ca href=\"https://stackoverflow.com/questions/20570717/numbering-sequencing-sets-of-same-column-values\"\u003eNumbering/sequencing sets of same column values\u003c/a\u003e) but using R instead of Excel.\u003c/p\u003e\n\n\u003cp\u003eHow can I create a \"count\" column to sequentially count the occurrence of a name in a cell, based on its previous occurances.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCol1 Col2\nAndy 1\nChad 1\nBill 1 \nAndy 2\nBill 2\nBill 3\nChad 2\nBill 4\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm using R because my dataset is so large, I cannot use Excel. I've previously used this formula:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e=COUNTIF($A$1:A1, A1)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo, how would I port that to R?\u003c/p\u003e\n\n\u003cp\u003eThanks,\u003c/p\u003e","answer_count":"0","comment_count":"7","creation_date":"2017-04-05 17:35:09.38 UTC","last_activity_date":"2017-04-05 17:35:09.38 UTC","last_edit_date":"2017-05-23 11:54:25.343 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"3470746","post_type_id":"1","score":"0","tags":"r|count","view_count":"22"} +{"id":"12287639","title":"|= operator in java (Android)","body":"\u003cblockquote\u003e\n \u003cp\u003e\u003cstrong\u003ePossible Duplicate:\u003c/strong\u003e\u003cbr\u003e\n \u003ca href=\"https://stackoverflow.com/questions/1956160/good-tutorials-on-bitwise-operations-in-java\"\u003eGood tutorials on Bitwise operations in Java\u003c/a\u003e \u003c/p\u003e\n\u003c/blockquote\u003e\n\n\n\n\u003cp\u003eWhat does |= in java do?\u003c/p\u003e\n\n\u003cp\u003eI am developing an app which uses a notification. I saw at \u003ca href=\"http://developer.android.com/guide/topics/ui/notifiers/notifications.html#Sound\" rel=\"nofollow noreferrer\"\u003ehttp://developer.android.com/guide/topics/ui/notifiers/notifications.html#Sound\u003c/a\u003e that they are using the |=. Used in the following line:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enotification.defaults |= Notification.DEFAULT_SOUND;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat does the |= do?\u003c/p\u003e","accepted_answer_id":"12287662","answer_count":"8","comment_count":"3","creation_date":"2012-09-05 18:29:51.46 UTC","last_activity_date":"2012-09-05 18:57:05.583 UTC","last_edit_date":"2017-05-23 11:59:58.68 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"1092519","post_type_id":"1","score":"2","tags":"java|android|notifications","view_count":"3562"} +{"id":"6569089","title":"Understanding .NET Application Memory Size","body":"\u003cp\u003eAn application I'm working on takes 338MB private bytes and 780MB virtual bytes right after startup.\nI'm trying to understand what takes all this memory. Hopefully after understanding that I'll be able to reduce it's size.\nThis is a 32bit C# application, numbers above were taken while it is running in Windows7 64bit.\u003c/p\u003e\n\n\u003cp\u003eOpening a dump with windbg shows that the heap size is 47MB.\nThe total external library files size that the application is loading is 60MB.\u003c/p\u003e\n\n\u003cp\u003eAn empty c# application takes only 10MB so what can cause my application to reach 338MB private bytes?\nAnd why windows7 allocates 780MB virtual memory?\u003c/p\u003e\n\n\u003cp\u003eAny directions will help.\u003c/p\u003e","accepted_answer_id":"6639870","answer_count":"1","comment_count":"6","creation_date":"2011-07-04 08:34:31.16 UTC","favorite_count":"2","last_activity_date":"2011-07-10 07:37:40.953 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"394646","post_type_id":"1","score":"6","tags":"c#|.net|windows|memory|clr","view_count":"1399"} +{"id":"38029054","title":"View style change when add them with button","body":"\u003cp\u003eI have create a block xml:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://i.stack.imgur.com/tcmrC.png\" rel=\"nofollow\"\u003exml block\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI want add this block when the user click the botton. \u003c/p\u003e\n\n\u003cp\u003eThe java code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate Button add_Link;\n\n@Override\nprotected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_ip);\n\n final LinearLayout myContainer = (LinearLayout) findViewById(R.id.my_container); //layout presente nell'mainLayout\n add_Link = (Button) findViewById(R.id.button_add_link);\n add_Link.setOnClickListener(new OnClickListener() {\n //al click del bottone vengono inseriti nuovi campi per l'inserimento di un ulteriore link\n @Override\n public void onClick(View v) {\n ViewGroup new_block = (ViewGroup) LayoutInflater.from(getApplicationContext()).inflate(R.layout.layout_block, myContainer, false);\n myContainer.addView(new_block);\n\n }\n });\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut on the hardware device and the emulator this is display:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://i.stack.imgur.com/bX36u.png\" rel=\"nofollow\"\u003eResult\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThe first block isn't create with button but is already present in the file XML R.layout.activity_ip while the second block is create with the button.\nThe problem is obvius... Why when add the block with button the style of my view change? I want all the same.\nThank for your help.\u003c/p\u003e\n\n\u003cp\u003eEDIT:\u003c/p\u003e\n\n\u003cp\u003eI tried to create a simple EditText in the onCreate method and not in onClick and the EditText has white background with underscore...The problem probably is in Button.\u003c/p\u003e","accepted_answer_id":"38151742","answer_count":"1","comment_count":"0","creation_date":"2016-06-25 13:31:18.947 UTC","favorite_count":"0","last_activity_date":"2016-07-01 18:20:18.357 UTC","last_edit_date":"2016-06-25 14:02:06.967 UTC","last_editor_display_name":"","last_editor_user_id":"6317008","owner_display_name":"","owner_user_id":"6317008","post_type_id":"1","score":"0","tags":"xml|android-studio","view_count":"16"} +{"id":"34125627","title":"Embedding query parameters in Wordpress urls with Nginx","body":"\u003cp\u003eI'm extending our Wordpress site to render pages that aren't coming from the database. We want those pages to have pretty URLs, without parameters in the URL.\u003c/p\u003e\n\n\u003cp\u003eImagine we're selling apples: I'd like the URL to be \u003ccode\u003ehttp://myfictionalstore.com/apple/golden-delicious\u003c/code\u003e or \u003ccode\u003ehttp://myfictionalstore.com/apple/granny-smith\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003e\u003cem\u003eI can't make this style of URL work.\u003c/em\u003e\u003c/p\u003e\n\n\u003cp\u003eUnder the hood, we can pass a URL to the page template that fetches apple related information from an API, so we can happily render a page like this:\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003ehttp://myfictionalstore.com/apple/?apple=granny-smith\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eI've told WordPress about my new Query var:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction add_query_vars($aVars) {\n$aVars[] = \"apple\";\n return $aVars;\n}\n\nadd_filter('query_vars', 'add_query_vars');\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd in the template, I can happily use that:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$apple_key = get_query_var( 'apple', 'rotten' ) ;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat I can't do is configure Nginx to make an internal redirect so it can render the pretty URL. Even though it works above, this Nginx config doesn't:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elocation ~ /apple/([^/]+)/? {\n try_files /dev/null /index.php?pagename=apple\u0026amp;apple=$1;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThat config returns a 404 when I try and query one of the pretty URLs. I \u003cem\u003ecan\u003c/em\u003e query just using WordPress query variables:\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003ehttp://myfictionalstore.com/index.php?pagename=apple\u0026amp;apple=orange-pippin\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eBut for whatever reason, that doesn't work as an internal redirect. I can use \u003ccode\u003ephpinfo()\u003c/code\u003e to prove that the params are making it to WordPress:\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eQUERY_STRING pagename=apple\u0026amp;apple=braeburn\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eSo perhaps:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eWordPress isn't liking something about the request environment?\u003c/li\u003e\n\u003cli\u003eNginx isn't handling the internal redirect properly?\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eThe wall has a dent, and my forehead is bleeding.\u003c/p\u003e\n\n\u003cp\u003e\u003cem\u003eUpdate:\u003c/em\u003e\u003c/p\u003e\n\n\u003cp\u003eThanks to Richard, this made it work:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e location ~ /apple/([^/]+)/? {\n fastcgi_pass unix:/var/run/hhvm/hhvm.sock;\n include /etc/nginx/fastcgi_params;\n fastcgi_param SCRIPT_FILENAME /var/www/index.php;\n fastcgi_param REQUEST_URI /index.php;\n fastcgi_param QUERY_STRING page_id=12345\u0026amp;apple=$1\u0026amp;;\n fastcgi_pass_request_headers off;\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThere was an issue loading the page via the Wordpress page_name, so I ended up changing my query slightly; that was a step forward, then removing the original request headers made it all go. Thanks!\u003c/p\u003e","accepted_answer_id":"34130026","answer_count":"1","comment_count":"0","creation_date":"2015-12-07 02:45:15.583 UTC","last_activity_date":"2015-12-09 23:14:30.153 UTC","last_edit_date":"2015-12-09 23:14:30.153 UTC","last_editor_display_name":"","last_editor_user_id":"9727","owner_display_name":"","owner_user_id":"9727","post_type_id":"1","score":"1","tags":"php|wordpress|nginx","view_count":"182"} +{"id":"329918","title":"How to paste CSV data to Windows Clipboard with C#","body":"\u003ch2\u003eWhat I'm trying to accomplish\u003c/h2\u003e\n\n\u003cul\u003e\n\u003cli\u003eMy app generates some tabular data\u003c/li\u003e\n\u003cli\u003eI want the user to be able to launch Excel and click \"paste\" to place the data as cells in Excel\u003c/li\u003e\n\u003cli\u003eWindows accepts a format called \"CommaSeparatedValue\" that is used with it's APIs so this seems possible\u003c/li\u003e\n\u003cli\u003ePutting raw text on the clipboard works, but trying to use this format does not\u003c/li\u003e\n\u003cli\u003eNOTE: I can correctly retrieve CSV data from the clipboard, my problem is about pasting CSV data to the clipboard.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003ch2\u003eWhat I have tried that isn't working\u003c/h2\u003e\n\n\u003cp\u003eClipboard.SetText()\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSystem.Windows.Forms.Clipboard.SetText( \n \"1,2,3,4\\n5,6,7,8\", \n System.Windows.Forms.TextDataFormat.CommaSeparatedValue\n );\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eClipboard.SetData()\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSystem.Windows.Forms.Clipboard.SetData(\n System.Windows.Forms.DataFormats.CommaSeparatedValue,\n \"1,2,3,4\\n5,6,7,8\", \n );\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn both cases something is placed on the clipboard, but when pasted into Excel it shows up as one cell of garbarge text: \"–§žý;pC¦yVk²ˆû\"\u003c/p\u003e\n\n\u003ch2\u003eUpdate 1: Workaround using SetText()\u003c/h2\u003e\n\n\u003cp\u003eAs BFree's answer shows \u003cstrong\u003eSetText\u003c/strong\u003e with \u003cstrong\u003eTextDataFormat\u003c/strong\u003e serves as a workaround\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSystem.Windows.Forms.Clipboard.SetText( \n \"1\\t2\\t3\\t4\\n5\\t6\\t7\\t8\", \n System.Windows.Forms.TextDataFormat.Text\n );\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have tried this and confirm that now pasting into Excel and Word works correctly. In each case it pastes as a table with cells instead of plaintext.\u003c/p\u003e\n\n\u003cp\u003eStill curious why CommaSeparatedValue is \u003cem\u003enot\u003c/em\u003e working.\u003c/p\u003e","accepted_answer_id":"369219","answer_count":"3","comment_count":"0","creation_date":"2008-12-01 03:05:40.13 UTC","favorite_count":"8","last_activity_date":"2008-12-15 18:09:17.15 UTC","last_edit_date":"2008-12-01 06:06:24.68 UTC","last_editor_display_name":"","last_editor_user_id":"13477","owner_display_name":"","owner_user_id":"13477","post_type_id":"1","score":"26","tags":"c#|windows|csv|clipboard|paste","view_count":"17193"} +{"id":"9038265","title":"Communication exception in WCF","body":"\u003cp\u003eI have WCF services hosted on development and production servers. In one scenario, I get the following exception on PROD servers, but not on the DEV server for the same input from client. \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eAn error occurred while receiving the HTTP response to\n \u003cem\u003e.com/abc.svc\"\u003ehttp://\u003c/em\u003e.com/abc.svc. This could be due to the service endpoint\n binding not using the HTTP protocol. This could also be due to an HTTP\n request context being aborted by the server\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eThe inner exceptions are as follows:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eThe underlying connection was closed an unexpected error occurred\n on a receive.\u003c/p\u003e\n \n \u003cp\u003eUnable to read data from the transport connection: An existing\n connection was forcibly closed by the remote host.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eThe WCF service returns a typed datatable and the service is able to serve requests in other cases.\u003c/p\u003e\n\n\u003cp\u003eThe buffer limits and timeout limits for bindings are set to high values and the exception occurs before the timeout value.\u003c/p\u003e\n\n\u003cp\u003eThe service trace logs generated on the server show the expected response message (around 300 records in data table) being built and message being closed. In other cases we have response containing more than 300 records where it is successful on PROD servers.\u003c/p\u003e\n\n\u003cp\u003eThe request executes for around 5-6 mins on the production server when we get the above exception thrown to client.\u003c/p\u003e\n\n\u003cp\u003ePlease suggest what could be the root cause of this exception.\u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","answer_count":"0","comment_count":"8","creation_date":"2012-01-27 18:31:53.247 UTC","last_activity_date":"2012-01-27 19:44:15.68 UTC","last_edit_date":"2012-01-27 19:44:15.68 UTC","last_editor_display_name":"","last_editor_user_id":"13302","owner_display_name":"","owner_user_id":"1174134","post_type_id":"1","score":"0","tags":"wcf","view_count":"475"} +{"id":"31103858","title":"Run an activity on application start to fetch data from the internet","body":"\u003cp\u003eI'm new to Android development and I'm trying to get a Thread running on the background when I start my application.\u003c/p\u003e\n\n\u003cp\u003eThe main focus here is that the new thread is going to fetch data from a PHP page that I have and save it to a list and afterwards save that to a XML file which I can access from everywhere on the application.\u003c/p\u003e\n\n\u003cp\u003eI have a new Activity with the code already prepared, but if I use a normal Thread like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enew Thread(new System.Threading.ThreadStart(() =\u0026gt;\n {\n StartActivity(typeof(FetchData));\n })).Start();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eit won't work as intended to. I'm running this code on the MainActivity and it starts the activity and the application doesn't show me the MainActivity layout until I press back on the phone.\u003c/p\u003e\n\n\u003cp\u003eCan someone help me? Thank you in advance.\u003c/p\u003e","accepted_answer_id":"31111118","answer_count":"1","comment_count":"2","creation_date":"2015-06-28 19:26:14.923 UTC","last_activity_date":"2015-06-29 08:32:40.29 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4664536","post_type_id":"1","score":"0","tags":"c#|android|multithreading|xamarin","view_count":"190"} +{"id":"12522999","title":"Gestures on a UICollectionViewCell; what to do with the result?","body":"\u003cp\u003eI'm currently working on a project for an iPad app. The main screen is a \u003ccode\u003eUICollectionView\u003c/code\u003e with \u003ccode\u003eAlbumCell\u003c/code\u003e's, a subclass of \u003ccode\u003eUICollectionViewCell\u003c/code\u003e. Now I wanted to add an \u003ccode\u003eUILongPressGestureRecognizer\u003c/code\u003e to pop up an \u003ccode\u003eUIActionSheet\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eFirst I tried that in the \u003ccode\u003eUICollectionViewController\u003c/code\u003e, but I figured that that isn't the right place to add those. So my best guess is adding the gesture in the \u003ccode\u003eAlbumCell\u003c/code\u003e class? Then probably adding itself as delegate, so it catches it's own gestures.\u003c/p\u003e\n\n\u003cp\u003eIs this a good approach so far?\u003c/p\u003e\n\n\u003cp\u003eAfter I catch the gesture, I should show the \u003ccode\u003eUIActionSheet\u003c/code\u003e. Now I open it in the \u003ccode\u003eUICollectionViewController\u003c/code\u003e when the user selects a cell while in editing mode. But should I call a method on the \u003ccode\u003eUICollectionViewController\u003c/code\u003e to open it, like I do now? Or should the cell handle it's own \u003ccode\u003eUIActionSheet\u003c/code\u003e?\u003c/p\u003e\n\n\u003cp\u003eEventually I got to let the \u003ccode\u003eUICollectionViewController\u003c/code\u003e what to do, might be to let him open the \u003ccode\u003eUIActionSheet\u003c/code\u003e, or handle accordingly to the result of it. How should the \u003ccode\u003eAlbumCell\u003c/code\u003e \"communicate\" with it?\u003c/p\u003e\n\n\u003cp\u003eIt's something I've been struggling with multiple times, not just in this use case. Is the approach close, or should I handle those actions totally different?\u003c/p\u003e","accepted_answer_id":"12529681","answer_count":"1","comment_count":"7","creation_date":"2012-09-21 01:04:31.703 UTC","favorite_count":"2","last_activity_date":"2012-09-21 11:31:53.017 UTC","last_edit_date":"2012-09-21 01:17:00.77 UTC","last_editor_display_name":"","last_editor_user_id":"412916","owner_display_name":"","owner_user_id":"340621","post_type_id":"1","score":"7","tags":"objective-c|ios6|uicollectionview","view_count":"3538"} +{"id":"31506861","title":"How to enable scrollbar for only last section in fullpage.js?","body":"\u003cp\u003eHow do I enable a scrollbar for only the last section in \u003ccode\u003efullpage.js\u003c/code\u003e?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eI tried this:\u003c/strong\u003e \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(\"#section3\").fullpage({\n scrollBar: true,\n fitToSection: false,\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut it won't work.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-07-19 23:04:53.55 UTC","last_activity_date":"2015-07-22 09:42:00.69 UTC","last_edit_date":"2015-07-22 09:42:00.69 UTC","last_editor_display_name":"","last_editor_user_id":"1695458","owner_display_name":"","owner_user_id":"5130104","post_type_id":"1","score":"0","tags":"jquery|html|css|fullpage.js","view_count":"559"} +{"id":"10405043","title":"How do I modify the shebang line in a Perl or shell script?","body":"\u003cp\u003eI have lots of Perl scripts that need to be updated to a consistent version required and have various versions and flags currently. All of these statements lie in the first line of the script. I have not had much luck here, obviously trying to use sed but is there something better?\u003c/p\u003e\n\n\u003cp\u003eExample line that needs to be edited\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e #!/opt/local/bin/perl5\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI tried a bash script as follows, but it does not work for me.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#!/bin/bash\necho \"Changing Perl headers in the following...\" \nfor file in $(ls $1*.pl)\ndo\n echo $file\n sed 's/#!\\/opt\\/local/bin\\/perl5/#![PERL5]/' $file \u0026gt; /dev/null\n# Perl Version: PERL5\ndone\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny help from someone experienced with sed would be great! Thanks!\u003c/p\u003e","answer_count":"4","comment_count":"1","creation_date":"2012-05-01 22:05:53.55 UTC","last_activity_date":"2014-01-06 13:51:21.523 UTC","last_edit_date":"2012-05-02 10:52:27.99 UTC","last_editor_display_name":"","last_editor_user_id":"123109","owner_display_name":"","owner_user_id":"1022397","post_type_id":"1","score":"2","tags":"linux|perl|search|scripting|replace","view_count":"1062"} +{"id":"27958487","title":"android pdf from http stream","body":"\u003cp\u003eIs is possible to open PDF from a stream (https:\\serever\\res\\pedstream) in android web view or even in the pdf viewer installed in android device?\u003c/p\u003e\n\n\u003cp\u003eMy point is event if the PDF viewer is not installed in the device we should be able to open it in webview component. And to view the PDF without downloading the file locally.\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2015-01-15 07:21:53.493 UTC","last_activity_date":"2015-01-15 07:21:53.493 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"867662","post_type_id":"1","score":"1","tags":"android|pdf|stream","view_count":"472"} +{"id":"18519456","title":"How do you convert an Object to an Object Array?","body":"\u003cp\u003eI am doing a cross thread update (probably in the wrong way but I'm not super concerned about doing it the right way, right now).\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate: System:: Void doUpdate() {\n cout \u0026lt;\u0026lt; \"RUNNING\";\n array\u0026lt;Object^\u0026gt;^ args = gcnew array\u0026lt;Object^\u0026gt;(1);\n array\u0026lt;Object^\u0026gt;^ inArgs = gcnew array\u0026lt;Object^\u0026gt;(2);\n inArgs[0] = 123;\n inArgs[1] = \"Hi\";\n args[0] = inArgs;\n this-\u0026gt;Invoke(updateDel, args);\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis successfully calls:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate: System::Void crossThreadUpdate(Object obj) {\n /* obj is an object array in the debugger but i can't access it programatically */\n this-\u0026gt;progressBar1-\u0026gt;Value = 99; // this works\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eLike I said, I'm not trying to learn everything about Visual C++/CLI right now. I just need this simple task to work.\u003c/p\u003e","answer_count":"0","comment_count":"4","creation_date":"2013-08-29 19:26:16.513 UTC","last_activity_date":"2013-08-29 19:26:16.513 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1873073","post_type_id":"1","score":"0","tags":"visual-c++","view_count":"69"} +{"id":"30096223","title":"Build issue in maven project on adding jasper-report dependency","body":"\u003cp\u003eIn my Spring based Camel maven project on adding the following dependency for Jasper reports , I am facing issue while project build.\u003c/p\u003e\n\n\u003cp\u003eJasper Dependency:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;net.sf.jasperreports\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;jasperreports\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;6.0.4\u0026lt;/version\u0026gt;\n \u0026lt;/dependency\u0026gt; \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBelow is the stack trace for the exception:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener\norg.apache.camel.RuntimeCamelException: org.apache.camel.FailedToCreateRouteException: Failed to create route route1 at: \u0026gt;\u0026gt;\u0026gt; RestBinding \u0026lt;\u0026lt;\u0026lt; in route: Route(route1)[[From[rest:post:/request:/addMultiple?inType=j... because of Error creating bean with name 'org.apache.camel.component.jackson.JacksonDataFormat': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.camel.component.jackson.JacksonDataFormat]: Constructor threw exception; nested exception is java.lang.NoSuchMethodError: com.fasterxml.jackson.core.JsonFactory.requiresPropertyOrdering()Z\n at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1556)\n at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:123)\n at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:332)\n at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:151)\n at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:128)\n at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:331)\n at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:773)\n at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:483)\n at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)\n at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)\n at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)\n at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939)\n at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434)\n at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)\n at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)\n at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)\n at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)\n at java.util.concurrent.FutureTask.run(Unknown Source)\n at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)\n at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)\n at java.lang.Thread.run(Unknown Source)\nCaused by: org.apache.camel.FailedToCreateRouteException: Failed to create route route1 at: \u0026gt;\u0026gt;\u0026gt; RestBinding \u0026lt;\u0026lt;\u0026lt; in route: Route(route1)[[From[rest:post:/request:/addMultiple?inType=j... because of Error creating bean with name 'org.apache.camel.component.jackson.JacksonDataFormat': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.camel.component.jackson.JacksonDataFormat]: Constructor threw exception; nested exception is java.lang.NoSuchMethodError: com.fasterxml.jackson.core.JsonFactory.requiresPropertyOrdering()Z\n at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:1028)\n at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:185)\n at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:841)\n at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:2895)\n at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:2618)\n at org.apache.camel.impl.DefaultCamelContext.access$000(DefaultCamelContext.java:167)\n at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2467)\n at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2463)\n at org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:2486)\n at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:2463)\n at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)\n at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:2432)\n at org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:255)\n at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:121)\n ... 19 more\nCaused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.camel.component.jackson.JacksonDataFormat': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.camel.component.jackson.JacksonDataFormat]: Constructor threw exception; nested exception is java.lang.NoSuchMethodError: com.fasterxml.jackson.core.JsonFactory.requiresPropertyOrdering()Z\n at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:278)\n at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1133)\n at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1036)\n at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:505)\n at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)\n at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:342)\n at org.apache.camel.spring.spi.SpringInjector.newInstance(SpringInjector.java:39)\n at org.apache.camel.impl.DefaultDataFormatResolver.resolveDataFormat(DefaultDataFormatResolver.java:57)\n at org.apache.camel.impl.DefaultCamelContext.resolveDataFormat(DefaultCamelContext.java:3561)\n at org.apache.camel.model.rest.RestBindingDefinition.createProcessor(RestBindingDefinition.java:109)\n at org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:505)\n at org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:217)\n at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:1025)\n ... 32 more\nCaused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.camel.component.jackson.JacksonDataFormat]: Constructor threw exception; nested exception is java.lang.NoSuchMethodError: com.fasterxml.jackson.core.JsonFactory.requiresPropertyOrdering()Z\n at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:163)\n at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:122)\n at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:270)\n ... 44 more\nCaused by: java.lang.NoSuchMethodError: com.fasterxml.jackson.core.JsonFactory.requiresPropertyOrdering()Z\n at com.fasterxml.jackson.databind.ObjectMapper.\u0026lt;init\u0026gt;(ObjectMapper.java:458)\n at com.fasterxml.jackson.databind.ObjectMapper.\u0026lt;init\u0026gt;(ObjectMapper.java:379)\n at org.apache.camel.component.jackson.JacksonDataFormat.\u0026lt;init\u0026gt;(JacksonDataFormat.java:109)\n at org.apache.camel.component.jackson.JacksonDataFormat.\u0026lt;init\u0026gt;(JacksonDataFormat.java:96)\n at org.apache.camel.component.jackson.JacksonDataFormat.\u0026lt;init\u0026gt;(JacksonDataFormat.java:84)\n at org.apache.camel.component.jackson.JacksonDataFormat.\u0026lt;init\u0026gt;(JacksonDataFormat.java:74)\n at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\n at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)\n at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)\n at java.lang.reflect.Constructor.newInstance(Unknown Source)\n at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147)\n ... 46 more\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI think the supporting jackson dependencies for the jasper reports are conflicting with previous dependencies.\u003c/p\u003e\n\n\u003cp\u003eBelow is the Dependency Hierarchy of pom.xml for jasper report.\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/JRox4.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eHowever if i remove the dependency for the jasper report then it is working fine.\u003c/p\u003e\n\n\u003cp\u003eI am not able to sort it out exactly.\u003c/p\u003e","accepted_answer_id":"30096401","answer_count":"1","comment_count":"0","creation_date":"2015-05-07 08:51:27.333 UTC","last_activity_date":"2016-06-02 15:32:19.213 UTC","last_edit_date":"2015-05-07 09:02:23.2 UTC","last_editor_display_name":"","last_editor_user_id":"4432567","owner_display_name":"","owner_user_id":"4432567","post_type_id":"1","score":"1","tags":"java|spring|maven|pom.xml","view_count":"483"} +{"id":"44274663","title":"Display search results on new page","body":"\u003cp\u003eI have a Wordpress page I'm working on with a search function that pulls from a database hosted on Amazon AWS.\u003c/p\u003e\n\n\u003cp\u003eWhen searching, I can pull the data just fine, but the results display below the search bar.\u003cbr\u003e\nI'd like the results to display on its own separate page.\u003c/p\u003e\n\n\u003cp\u003eI've tried several suggestions using previously asked questions, though nothing worked.\u003c/p\u003e\n\n\u003cp\u003eHere is my code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\n/* Template Name: Database */\n?\u0026gt;\n\n\u0026lt;?php\nglobal $query_string;\n\n$query_args = explode(\"\u0026amp;\", $query_string);\n$search_query = array();\n\nif( strlen($query_string) \u0026gt; 0 ) {\n foreach($query_args as $key =\u0026gt; $string) {\n $query_split = explode(\"=\", $string);\n $search_query[$query_split[0]] = urldecode($query_split[1]);\n } // foreach\n} //if\n\n$search = new WP_Query($search_query);\n?\u0026gt;\n\n\n\u0026lt;?php get_header(); ?\u0026gt;\n\u0026lt;?php get_footer(); ?\u0026gt;\n\n\u0026lt;?php\n$db_hostname = 'xxxxxxxxxxxxxxx';\n$db_username = 'xxxxxxxxxxxxxxx';\n$db_password = 'xxxxxxxxxxxxxxx';\n$db_database = 'xxxxxxxxxxxxxxx';\n\n$con = mysql_connect($db_hostname,$db_username,$db_password);\nif (!$con){\n die('404 Could not connect to server: ' . mysql_error());\n}\n\nmysql_select_db($db_database, $con);\n\n global $sf_options;\n $sidebar_config = $sf_options['archive_sidebar_config'];\n $left_sidebar = $sf_options['archive_sidebar_left'];\n $right_sidebar = $sf_options['archive_sidebar_right'];\n $blog_type = $sf_options['archive_display_type'];\n\n if ( $blog_type == \"masonry\" || $blog_type == \"masonry-fw\" ) {\n global $sf_include_imagesLoaded;\n $sf_include_imagesLoaded = true;\n }\n?\u0026gt;\n\n\u0026lt;div class=\"container-fluid\"\u0026gt;\n \u0026lt;center\u0026gt;\n \u0026lt;form role=\"\" method=\"get\" \u0026gt;\n \u0026lt;p style=\"color: #fff;\"\u0026gt;Search products and services for your business. We make it easier\u0026lt;br /\u0026gt;to manage your business operations and make informed purchasing decisions.\u0026lt;/p\u0026gt;\n \u0026lt;input type=\"text\" name=\"term\" placeholder=\"Start typing to find a product or business\"/\u0026gt;\n \u0026lt;span\u0026gt;\u0026lt;input type=\"submit\" value=\"\" class=\"btn btn-default\" /\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;/form\u0026gt;\n \u0026lt;/center\u0026gt;\n\u0026lt;/div\u0026gt;\n\n\u0026lt;?php\nif (!empty($_REQUEST['term'])) {\n\n $term = mysql_real_escape_string($_REQUEST['term']);\n\n $sql = \"SELECT * FROM wpfr_listing WHERE Description LIKE '%\".$term.\"%'\";\n $r_query = mysql_query($sql);\n\n while ($row = mysql_fetch_array($r_query)){\n\n echo '\u0026lt;br /\u0026gt; Company: ' .$row['title'];\n echo '\u0026lt;br /\u0026gt; Certs: '.$row['certs'];\n echo '\u0026lt;br /\u0026gt; Certifier: '.$row['certifier'];\n echo '\u0026lt;br /\u0026gt; Address: '.$row['address'];\n echo '\u0026lt;br /\u0026gt; Country: '.$row['country'];\n echo '\u0026lt;br /\u0026gt; State: '.$row['state'];\n echo '\u0026lt;br /\u0026gt; City: '.$row['city'];\n }\n\n}\n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny help provided is much appreciated.\u003c/p\u003e","accepted_answer_id":"44274843","answer_count":"2","comment_count":"3","creation_date":"2017-05-31 02:26:39.13 UTC","last_activity_date":"2017-05-31 02:52:16.65 UTC","last_edit_date":"2017-05-31 02:43:31.72 UTC","last_editor_display_name":"","last_editor_user_id":"2159528","owner_display_name":"","owner_user_id":"8089375","post_type_id":"1","score":"0","tags":"php|wordpress|search","view_count":"32"} +{"id":"34891863","title":"Replace dynamically created image for new image from input","body":"\u003cp\u003eI'm supposed to display an image after the user inserts its URL. It works fine on the first click, but instead of replacing the previous image with the new URL when the user input a new one, it just creates a new image below the previous.\u003c/p\u003e\n\n\u003cp\u003eThat's my function so far:\u003c/p\u003e\n\n\u003cp\u003eHTML:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;p id=\"tt\"\u0026gt;Display an image using the image's URL\u0026lt;/p\u0026gt;\n\u0026lt;label\u0026gt;URL:\n \u0026lt;textarea rows=\"1\" cols=\"40\" placeholder=\"Image URL\" id=\"url\"\u0026gt;\u0026lt;/textarea\u0026gt;\n\u0026lt;/label\u0026gt;\u0026lt;br\u0026gt;\n\u0026lt;label\u0026gt;Caption:\n \u0026lt;textarea rows=\"1\" cols=\"40\" placeholder=\"Image caption\" id=\"caption\"\u0026gt;\u0026lt;/textarea\u0026gt;\n\u0026lt;/label\u0026gt;\u0026lt;br\u0026gt;\n\u0026lt;button id=\"btn\"\u0026gt;Add Image\u0026lt;/button\u0026gt;\n\u0026lt;br\u0026gt;\n\u0026lt;div id=\"imgDiv\"\u0026gt;\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eJS:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar getBtn = document.getElementById(\"btn\");\ngetBtn.addEventListener('click', function() {\n var figure = document.createElement(\"figure\");\n var image = document.createElement(\"IMG\");\n var figcaption = document.createElement(\"figcaption\");\n //attributing the input value in the first textarea as source for the image to be displayed\n var url = document.getElementById(\"url\").value;\n image.src = url;\n image.height = \"200\";\n image.id = \"newImage\";\n figure.appendChild(image);\n //making the image a link to its url\n var a = document.createElement(\"a\");\n a.href = url;\n a.appendChild(image);\n figure.appendChild(a);\n //creating a Node and setting the input value from the second textarea as caption\n var caption = document.getElementById(\"caption\").value;\n var text = document.createTextNode(caption);\n document.getElementById(\"imgDiv\").appendChild(figure);\n figure.appendChild(figcaption);\n figcaption.appendChild(text);\n document.getElementById(\"menu\").add(option);\n //clear textarea after submitting url and caption\n document.getElementById(\"url\").value = \"\";\n document.getElementById(\"caption\").value = \"\";\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eEDIT - JSFiddle: \u003ca href=\"https://jsfiddle.net/hpnLycer/4/\" rel=\"nofollow\"\u003ehttps://jsfiddle.net/hpnLycer/4/\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eCan someone give me a hint how to solve this?\nI tried understanding by reading \"similar\" questions, but I didn't find any that would solve my case. \u003c/p\u003e\n\n\u003cp\u003eThank you anyway.\u003c/p\u003e","answer_count":"1","comment_count":"5","creation_date":"2016-01-20 04:57:19.413 UTC","last_activity_date":"2016-01-20 06:23:32.02 UTC","last_edit_date":"2016-01-20 06:23:32.02 UTC","last_editor_display_name":"","last_editor_user_id":"5504790","owner_display_name":"","owner_user_id":"5504790","post_type_id":"1","score":"1","tags":"javascript|dynamically-generated","view_count":"136"} +{"id":"19770338","title":"how do i set a value of a multiple \u003cselect\u003e tag from the database","body":"\u003cp\u003ei am selecting an entry from the database to be edited on php/html. i can call the values of a table from the database and put it in a multiple tag.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$job_exp_tags = $row[16];//value from another table\n$job_tags = explode(',',$job_exp_tags);//array to be put \"selected\" on the multiple select tag\n\n$sql_2 = \"SELECT _id, job_name from job_tags\";\n\n $sel_2 = mysql_query($sql_2);\n\n $array = array();\n\n while($row_new = mysql_fetch_assoc($sel_2)){\n\n $array[] = $row_new;\n\n\n }\n\u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;Job Experience:\u0026lt;br\u0026gt;\n (Hold ctrl to select multiple)\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;select name = 'job_tags[]' multiple\u0026gt;\n \u0026lt;?php\n\n foreach($array as $value){ ?\u0026gt;\n\n \u0026lt;option value ='\u0026lt;?php echo $value['_id']; ?\u0026gt;'\u0026gt; \u0026lt;?php echo $value['job_name']; ?\u0026gt; \u0026lt;/option\u0026gt;\n\n \u0026lt;?php\n\n }\n ?\u0026gt;\n \u0026lt;/select\u0026gt; \u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003emy problem is how can i put selected values to it from the explode statement\u003c/p\u003e\n\n\u003cp\u003eedit:\u003c/p\u003e\n\n\u003cp\u003ei've solved the problem, thanks anyway guys!\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;option value =\"\u0026lt;?php echo $value['_id']; ?\u0026gt;\" \u0026lt;?php echo in_array($value['_id'], $job_tags) ? 'selected=\"true\"' : null; ?\u0026gt;\u0026gt;\u0026lt;?php echo $value['job_name']; ?\u0026gt;\u0026lt;/option\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"3","creation_date":"2013-11-04 14:51:15.967 UTC","last_activity_date":"2013-11-05 02:01:27.52 UTC","last_edit_date":"2013-11-05 02:01:27.52 UTC","last_editor_display_name":"","last_editor_user_id":"2091217","owner_display_name":"","owner_user_id":"2091217","post_type_id":"1","score":"-1","tags":"php|html|mysql","view_count":"1136"} +{"id":"44887209","title":"How to get the average absolute frequency per hour for each group?","body":"\u003cp\u003eI have the following dataframe:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edf =\n Id Datetime\n 1 2017-03-02 18:06:20\n 1 2017-03-02 18:05:10\n 1 2017-04-01 18:04:09\n 1 2017-03-02 19:06:50\n 1 2017-04-01 19:07:22\n 2 2017-03-03 18:09:15\n 2 2017-05-03 19:07:05\n 2 2017-05-03 20:19:08\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to know the average absolute frequency per hour for each \u003ccode\u003eID\u003c/code\u003e. In other words, I need to calculate the absolute frequency of \u003ccode\u003eID\u003c/code\u003e per hours, averaged over days and months. The expected result is this one:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eID HOUR FREQ\n1 18 1.5\n1 19 1\n1 20 0\n2 18 1\n2 19 1\n2 20 1\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFor example, in case of \u003ccode\u003eID\u003c/code\u003e equal to 1, there are 2 entries at 18 for the dates \u003ccode\u003e2017-03-02\u003c/code\u003e, and 1 entry at 18 for the date \u003ccode\u003e2017-04-01\u003c/code\u003e. Therefore \u003ccode\u003eFREQ\u003c/code\u003e is equal to \u003ccode\u003e1.5\u003c/code\u003e for \u003ccode\u003eHOUR\u003c/code\u003e=18 and \u003ccode\u003eID\u003c/code\u003e=1.\u003c/p\u003e\n\n\u003cp\u003eI have this code, but \u003ccode\u003eresult\u003c/code\u003e does not get created properly:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edf[\"Hour\"] = df[\"Datetimr\"].apply(lambda x: x.hour)\nresult = df.groupby([\"Id\",\"Hour\"]).agg({'Hour':'size'}).reset_index()\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"44888637","answer_count":"3","comment_count":"3","creation_date":"2017-07-03 13:47:04.617 UTC","favorite_count":"1","last_activity_date":"2017-07-03 14:52:44.427 UTC","last_edit_date":"2017-07-03 14:20:51.333 UTC","last_editor_display_name":"","last_editor_user_id":"7316807","owner_display_name":"","owner_user_id":"7316807","post_type_id":"1","score":"0","tags":"python|pandas","view_count":"61"} +{"id":"18840901","title":"Unable to use a wildcard in map","body":"\u003cp\u003eI wonder, why doesn't this work due to the error\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eobject ws1 {\n class MyClass(a: Long)\n val biList = List(BigInt(1), BigInt(2))\n val mcList = biList map { new MyClass(_.longValue) } // error\n //val mcList = biList map { x =\u0026gt; new MyClass(x.longValue) } // ok\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eof\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emissing parameter type for expanded function ((x$1) =\u0026gt; x$1.longValue)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eor more precisely\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etype mismatch: found ws1.MyClass, required scala.math.BigInt =\u0026gt; ?\nmissing parameter type for expanded function ((x$1) =\u0026gt; x$1.longValue)\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-09-17 03:34:23.24 UTC","last_activity_date":"2013-09-17 04:11:04.53 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1708058","post_type_id":"1","score":"0","tags":"scala","view_count":"95"} +{"id":"20145624","title":"How to get only the first few matches of mysql SELECT Statement","body":"\u003cblockquote\u003e\n\u003cpre\u003e\u003ccode\u003e if(strcmp($sort,\"popular\") == 0){\n \"SELECT * FROM projects WHERE project_id IN ($idResults) ORDER BY rating\";\n }\n\u003c/code\u003e\u003c/pre\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI first selected the projects by genres the resulting IDs are in $idResults, then i want them all sorted by rating.\nIt may be a very long list of results, so now my question is how can i adjust the SELECT so that I only get the first say 7 results(at the next call from 7 to 14, etc)\u003c/p\u003e\n\n\u003cp\u003eThanks in advance ;)\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003eI now tried, \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e$query = \"SELECT * FROM projects WHERE project_id IN \".implode(',',$idResults).\" ORDER BY rating LIMIT \".$count.\", 7\";\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003ecause I got a php error, that there is an array to string conversion, so i added a \",\" after each element in the array and imploded it to a string.\u003c/p\u003e\n\n\u003cp\u003ebut if i continue doing:\u003c/p\u003e\n\n\u003cblockquote\u003e\n\u003cpre\u003e\u003ccode\u003e $result = $this-\u0026gt;dbc-\u0026gt;query($query);\n $resultLines = array();\n while($row = $result-\u0026gt;fetch_array(MYSQLI_BOTH)){\n $resultLines[] = $row;\n }\n return resultLines;\n\u003c/code\u003e\u003c/pre\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003ei get an error:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eFatal error: Call to a member function fetch_array() on a non-object in \u003cstrong\u003e\u003cem\u003e*\u003c/em\u003e\u003c/strong\u003e on line 66\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eso i suspect something is still wrong in my query, but i cant figure out what.\u003c/p\u003e","accepted_answer_id":"20145675","answer_count":"1","comment_count":"2","creation_date":"2013-11-22 13:04:00.5 UTC","last_activity_date":"2013-11-24 19:23:10.57 UTC","last_edit_date":"2013-11-24 19:23:10.57 UTC","last_editor_display_name":"","last_editor_user_id":"19679","owner_display_name":"","owner_user_id":"3021791","post_type_id":"1","score":"1","tags":"mysql|select","view_count":"68"} +{"id":"46503324","title":"Getting unexpected results from Spark sql Windows Functions","body":"\u003cp\u003eIt seems like Spark sql Window function does not working properly .\nI am running a spark job in Hadoop Cluster where a HDFS block size is 128 MB and \nSpark Version 1.5 CDH 5.5 \u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eMy requirement:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eIf there are multiple records with same data_rfe_id then take the single record as per maximum seq_id and maxiumum service_id\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI see that in raw data there are some records with same data_rfe_id and same seq_id so hence, I applied row_number using Window function so that I can filter the records with row_num === 1\u003c/p\u003e\n\n\u003cp\u003eBut it seems its not working when have huge datasets. I see that same rowNumber is applied . \u003c/p\u003e\n\n\u003cp\u003eWhy is it happening like this? \u003c/p\u003e\n\n\u003cp\u003eDo I need to reshuffle before I apply window function on dataframe? \u003c/p\u003e\n\n\u003cp\u003eI am expecting a unique rank number to each data_rfe_id\u003c/p\u003e\n\n\u003cp\u003eI want to use Window Function only to achieve this .\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e import org.apache.spark.sql.expressions.Window\n import org.apache.spark.sql.functions.rowNumber\n .....\n\nscala\u0026gt; df.printSchema\nroot\n |-- transitional_key: string (nullable = true)\n |-- seq_id: string (nullable = true)\n |-- data_rfe_id: string (nullable = true)\n |-- service_id: string (nullable = true)\n |-- event_start_date_time: string (nullable = true)\n |-- event_id: string (nullable = true)\n\n\n val windowFunction = Window.partitionBy(df(\"data_rfe_id\")).orderBy(df(\"seq_id\").desc,df(\"service_id\").desc)\n val rankDF =df.withColumn(\"row_num\",rowNumber.over(windowFunction))\n rankDF.select(\"data_rfe_id\",\"seq_id\",\"service_id\",\"row_num\").show(200,false)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eExpected result :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e +------------------------------------+-----------------+-----------+-------+\n |data_rfe_id |seq_id |service_id|row_num|\n +------------------------------------+-----------------+-----------+-------+\n |9ih67fshs-de11-4f80-a66d-b52a12c14b0e|1695826 |4039 |1 |\n |9ih67fshs-de11-4f80-a66d-b52a12c14b0e|1695821 |3356 |2 |\n |9ih67fshs-de11-4f80-a66d-b52a12c14b0e|1695802 |1857 |3 |\n |23sds222-9669-429e-a95b-bc984ccf0fb0 |1695541 |2156 |1 |\n |23sds222-9669-429e-a95b-bc984ccf0fb0 |1695541 |2103 |2 |\n |23sds222-9669-429e-a95b-bc984ccf0fb0 |1695541 |2083 |3 |\n |23sds222-9669-429e-a95b-bc984ccf0fb0 |1695541 |2082 |4 |\n |23sds222-9669-429e-a95b-bc984ccf0fb0 |1695541 |2076 |5 |\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eActual Result I got as per above code :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e +------------------------------------+-----------------+-----------+-------+\n |data_rfe_id |seq_id |service_id|row_num|\n +------------------------------------+-----------------+-----------+-------+\n |9ih67fshs-de11-4f80-a66d-b52a12c14b0e|1695826 |4039 |1 |\n |9ih67fshs-de11-4f80-a66d-b52a12c14b0e|1695821 |3356 |1 |\n |9ih67fshs-de11-4f80-a66d-b52a12c14b0e|1695802 |1857 |1 |\n |23sds222-9669-429e-a95b-bc984ccf0fb0 |1695541 |2156 |1 |\n |23sds222-9669-429e-a95b-bc984ccf0fb0 |1695541 |2103 |1 |\n |23sds222-9669-429e-a95b-bc984ccf0fb0 |1695541 |2083 |1 |\n |23sds222-9669-429e-a95b-bc984ccf0fb0 |1695541 |2082 |1 |\n |23sds222-9669-429e-a95b-bc984ccf0fb0 |1695541 |2076 |1 |\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCould someone explain me why I am getting these unexpected results? and How do I resolve that ?\u003c/p\u003e","accepted_answer_id":"46505596","answer_count":"1","comment_count":"1","creation_date":"2017-09-30 13:48:45.567 UTC","last_activity_date":"2017-09-30 18:04:17.473 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3240790","post_type_id":"1","score":"0","tags":"apache-spark|apache-spark-sql","view_count":"34"} +{"id":"10233437","title":"jQuery Errors / Page Hangs in IE 8","body":"\u003cp\u003ejQuery is causing my pages to hang in IE8 and also seems to be causing some other errors.\u003c/p\u003e\n\n\u003cp\u003eThe page in question is:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://www.yogahunter.com/\" rel=\"nofollow\"\u003ehttp://www.yogahunter.com/\u003c/a\u003e\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eIt hangs while loading in IE8. I am getting the error:\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003edocument.body is null or not an object jquery-1.3.2.min.js, line 19 character 23004\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI am pretty sure that it is the jQuery because if I delete the call to jQuery, the page loads quickly. But once I put the call to jQuery back in, it hangs on load.\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eAlso, when I am navigating away from certain pages, I get another error (which I think is related to google maps). The error is:\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eObject expected awareness-center-11.htm, line 38 character 1\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eYou will see this error go to:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://www.yogahunter.com/detail/awareness-center-11.htm\" rel=\"nofollow\"\u003ehttp://www.yogahunter.com/detail/awareness-center-11.htm\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eand then navigate to a different page on the site.\u003c/p\u003e\n\n\u003cp\u003eAny help you can provide would be greatly appreciated.\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2012-04-19 17:26:03.967 UTC","last_activity_date":"2012-04-20 10:11:16.31 UTC","last_edit_date":"2012-04-20 10:11:16.31 UTC","last_editor_display_name":"","last_editor_user_id":"1134091","owner_display_name":"","owner_user_id":"1344629","post_type_id":"1","score":"-1","tags":"jquery|internet-explorer-8","view_count":"798"} +{"id":"6597382","title":"Better way of grouping rows by the latest entry within a group using LINQ","body":"\u003cp\u003eSay I have a table with 3 cols: ActionId, uid \u0026amp; created.\u003c/p\u003e\n\n\u003cp\u003eI want to group actions by the uid, but every time a new action is inserted into a group (by uid), it will push the group upto the top, and individual rows within that group ordered.\u003c/p\u003e\n\n\u003cp\u003eThis is what I came up with in SQL:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eselect * from actions as a\ninner join \n( \n select aa.[uid], MAX(aa.[created]) as maxcreated \n from actions as aa\n group by aa.[uid]\n) as a2 on a2.uid = a.uid\norder by a2.maxcreated desc, a.created desc\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs there a better way to achieve this in SQL, and also then how to do this in LINQ?\u003c/p\u003e","accepted_answer_id":"6597514","answer_count":"2","comment_count":"2","creation_date":"2011-07-06 13:41:31.66 UTC","last_activity_date":"2011-07-06 14:55:21.063 UTC","last_edit_date":"2011-07-06 13:43:58.93 UTC","last_editor_display_name":"","last_editor_user_id":"410636","owner_display_name":"","owner_user_id":"306098","post_type_id":"1","score":"0","tags":"sql|linq|tsql","view_count":"54"} +{"id":"43030420","title":"Block Incoming calls in android without single ring","body":"\u003cp\u003eThough this code i am able to block incoming calls but problems it rings for fraction of seconds before disconnection of time how can i directly disconnect phone without single ringing. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class IncomingCallsReceiver extends BroadcastReceiver {\nprivate Context context;\nprivate static int CALLSHIELD_ID = 1982;\nprivate static final String TAG = \"Phone call\";\nprivate ITelephony telephonyService;\n\n@Override\npublic void onReceive(Context context, Intent intent) {\n Log.i(\"Log\",\"coming\");\n this.context = context;\n String state = intent.getStringExtra(TelephonyManager.EXTRA_STATE);\n if (state.equals(TelephonyManager.EXTRA_STATE_RINGING)) {\n TelephonyManager telephony = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);\n Bundle bundle = intent.getExtras();\n String incomingNumber = bundle.getString(\"incoming_number\");\n Cursor cursor;\n if (G.savePreferences.getString(\"modef\", \"0\").equals(\"0\")) {\n switch (G.savePreferences.getString(\"mode\", \"2\")) {\n case \"0\":\n break;\n case \"1\":\n try {\n Class c = Class.forName(telephony.getClass().getName());\n Method m = c.getDeclaredMethod(\"getITelephony\");\n m.setAccessible(true);\n telephonyService = (ITelephony) m.invoke(telephony);\n telephonyService.endCall();\n G.lDbHeper.setlog(incomingNumber, time(), date());\n if (G.savePreferences.getString(\"notification\", \"false\") == \"true\") {\n showNotification(incomingNumber);\n }\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n break;\n }\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-03-26 15:05:02.52 UTC","favorite_count":"1","last_activity_date":"2017-03-26 15:05:02.52 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7517273","post_type_id":"1","score":"1","tags":"java|android","view_count":"143"} +{"id":"27554159","title":"How to add new row on click winforms","body":"\u003cp\u003eI have a winforms application that I am developing, I have hit a dead end. What I am trying to do is on each \"click\", add a new row to my \u003ccode\u003eDataTable\u003c/code\u003e with the values input in the form. This \u003ccode\u003eDatatable\u003c/code\u003e is the DataSource for my \u003ccode\u003eDataGridView\u003c/code\u003e. Can someone point me in the right direction on how this can be achieved.\u003c/p\u003e\n\n\u003cp\u003eArticles I looked at:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://stackoverflow.com/questions/15965043/how-to-add-rows-to-datagridview-winforms\"\u003eHow to add new row to datatable gridview\u003c/a\u003e \u003c/p\u003e\n\n\u003cp\u003eMy code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate void btnAdd_Click(object sender, EventArgs e)\n {\n //inserting into order table\n DataTable dt = new DataTable();\n\n string articleId = cmbArticle.Text;\n string productDescription = txtDesc.Text;\n string type = txtType.Text;\n string materialType = txtMaterial.Text;\n string size = cmbSizes.Text;\n string quantity = txtQuantity.Text;\n\n try\n {\n dt.Columns.Add(\"Article\");\n dt.Columns.Add(\"Description\");\n dt.Columns.Add(\"Type\");\n dt.Columns.Add(\"Material\");\n dt.Columns.Add(\"Size\");\n dt.Columns.Add(\"Quantity\");\n dt.Columns.Add(\"DateTime\");\n\n DataRow dr = dt.NewRow();\n //addrows\n dr[\"Article\"] = articleId;\n dr[\"Description\"] = productDescription;\n dr[\"type\"] = type;\n dr[\"Material\"] = materialType;\n dr[\"Size\"] = size;\n dr[\"Quantity\"] = quantity;\n\n dt.Rows.Add(dr);\n\n dgvView.DataSource = dt;\n }\n catch (Exception ex)\n {\n\n }\n }\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"27554226","answer_count":"1","comment_count":"5","creation_date":"2014-12-18 19:25:11.283 UTC","last_activity_date":"2014-12-18 19:31:30.107 UTC","last_edit_date":"2017-05-23 12:12:48.943 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"4375561","post_type_id":"1","score":"0","tags":"c#|winforms|datagridview|datatable","view_count":"1816"} +{"id":"8747560","title":"How to create an object from a single item from an xml file using linq?","body":"\u003cp\u003eBasically I have a single element inside of an xml file where I store settings for my application. This element mirrors a class that I have built. What I'm trying to do using LINQ, is select that single element, and then store the values stored inside of that element into an instance of my class in a single statement.\u003c/p\u003e\n\n\u003cp\u003eRight now I'm selecting the element seperately and then storing the values from that element into the different properties. Of course this turns into about six seperate statements. Is it possible to do this in a single statement?\u003c/p\u003e","accepted_answer_id":"8747617","answer_count":"2","comment_count":"0","creation_date":"2012-01-05 18:14:32.11 UTC","favorite_count":"2","last_activity_date":"2012-01-05 18:18:38.557 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"200015","post_type_id":"1","score":"0","tags":"c#|xml|linq|linq-to-xml","view_count":"82"} +{"id":"35603627","title":"How compiler handles int, char etc ?","body":"\u003cp\u003eI have wrote a simple C Code \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;stdio.h\u0026gt;\nint main(){\nint a;\na=10;\nprintf(\"%d\", a);\nreturn 0;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAfter running it, with \u003ccode\u003egcc -Wall -std=c11 -pedantic-errors\u003c/code\u003e, obviously it won't give any error.\nbut when i remove the first line that is\u003cbr\u003e\n\u003ccode\u003e#include \u0026lt;stdio.h\u0026gt;\u003c/code\u003e\u003cbr\u003e\nit gives only one simple error :-\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e In function 'main': \n 5:2: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] \n printf(\"%d\", a); \n ^ \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is beacuse, we are just simply calling \u003ccode\u003eprintf()\u003c/code\u003e function which is defined in header file \u003ccode\u003estdio.h\u003c/code\u003e\u003cbr\u003e\nMy question is, why we get error in \u003ccode\u003eprintf()\u003c/code\u003e function only ?\u003cbr\u003e\nhow the compiler is understanding that what is \u003ccode\u003ereturn 0\u003c/code\u003e and what is \u003ccode\u003eint\u003c/code\u003e and what is \u003ccode\u003emain()\u003c/code\u003e ? why not any errors in these \u003ccode\u003ekeywords\u003c/code\u003e ?\u003c/p\u003e\n\n\u003cp\u003eTill now, I have used \u003ccode\u003egcc -E cfile.c\u003c/code\u003e to generate the output after preprocessing stage. and it is not replacing int with any other keyword or code.\u003c/p\u003e\n\n\u003cp\u003eOkay, \u003ccode\u003eint\u003c/code\u003e is a datatype we know, but how does compiler knows ?\nwhere it is defined or in other words where they have told the compiler, How to work with \u003ccode\u003eint\u003c/code\u003e \u003ccode\u003echar\u003c/code\u003e and other datatypes ?\u003c/p\u003e","answer_count":"2","comment_count":"12","creation_date":"2016-02-24 13:32:04.807 UTC","last_activity_date":"2016-02-26 11:19:58.187 UTC","last_edit_date":"2016-02-24 13:35:12.247 UTC","last_editor_display_name":"","last_editor_user_id":"5940391","owner_display_name":"","owner_user_id":"5940391","post_type_id":"1","score":"-16","tags":"c|gcc","view_count":"129"} +{"id":"15626707","title":"c++ inheritance overload member","body":"\u003cp\u003eI have two classes A, B where B inherits A. I have two structs C, D, where D inherits C. A instantiates a number of structs C as members. How can I achieve that B instantiates members of struct D instead of C?\nI could of course add D as a new member to B but then B would also allocate memory for C, which would be wastefull.\u003c/p\u003e","accepted_answer_id":"15626727","answer_count":"1","comment_count":"1","creation_date":"2013-03-25 23:26:13.983 UTC","last_activity_date":"2013-03-26 00:22:36.02 UTC","last_edit_date":"2013-03-26 00:22:36.02 UTC","last_editor_display_name":"","last_editor_user_id":"423491","owner_display_name":"","owner_user_id":"1376008","post_type_id":"1","score":"-1","tags":"c++|inheritance|struct","view_count":"57"} +{"id":"4805514","title":"MySQL Workbench EER diagram creation","body":"\u003cp\u003eThere are two issues here regarding MySQL Workbench.\u003c/p\u003e\n\n\u003cp\u003eIs there a way to update an existing EER diagram with newly created DB tables, so that the EER diagrams automatically reflects the new tables AND their relationships.\u003c/p\u003e\n\n\u003cp\u003eOR\u003c/p\u003e\n\n\u003cp\u003eIs there a way to auto create the relationships between the table while creating a new EER diagram from an existing database?\u003c/p\u003e\n\n\u003cp\u003eI have about 70 tables in an existing database. So creating the relationship links between every table might be quite time consuming and not very productive.\u003c/p\u003e\n\n\u003cp\u003eIf none of the above is possible, is there any tool out there which would allow me to create an EER diagram with all the relationship paths in place with in the diagram from an existing database.\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2011-01-26 14:16:29.783 UTC","favorite_count":"0","last_activity_date":"2015-02-20 16:48:16.48 UTC","last_edit_date":"2015-02-20 16:48:16.48 UTC","last_editor_display_name":"","last_editor_user_id":"488195","owner_display_name":"","owner_user_id":"387290","post_type_id":"1","score":"2","tags":"mysql|mysql-workbench|eer-model","view_count":"6942"} +{"id":"32181308","title":"Swift 2.0 beta Dictionary extension","body":"\u003cp\u003eTrying to create an immutable Dictionary. The idea is to have immutable arrays of keys and values each and then pass them to a\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eDictionary constructor: let dict = Dictionary(aStringArray, aSameLengthDoubleArray)\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eThe following code however gives a compile time error.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eextension Dictionary {\n init\u0026lt;T:Hashable,U\u0026gt;(keys: [T], values: [U]) {\n self.init()\n for (index, key) in keys.enumerate() {\n self[key] = values[index]\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eError: \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eerror:\n cannot subscript a value of type 'Dictionary' with an\n index of type 'T' self[key] = values[index]\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eCan someone throw some light on this?\u003c/p\u003e","accepted_answer_id":"32181629","answer_count":"1","comment_count":"0","creation_date":"2015-08-24 11:34:12.51 UTC","favorite_count":"1","last_activity_date":"2015-08-24 12:32:30.053 UTC","last_edit_date":"2015-08-24 11:57:22.313 UTC","last_editor_display_name":"","last_editor_user_id":"2227743","owner_display_name":"","owner_user_id":"5260036","post_type_id":"1","score":"2","tags":"ios|osx|swift|generics|swift2","view_count":"367"} +{"id":"15917759","title":"Auto hiding vertical scrollbars using css overflow","body":"\u003cp\u003eI came across a problem using css overflow for autohiding the vertical scrollbar. I read in a few articles to use css hover pseudo class to achieve this behaviour and the good thing is I am successful to some extent.\u003c/p\u003e\n\n\u003cp\u003eI used both 'scroll' and 'auto' for the overflow-y property. With scroll it works like a charm, but with 'scroll' the problem is even if there is no need to show the scrollbar, it is visible which I feel 'auto' does very well.\u003c/p\u003e\n\n\u003cp\u003eBut again with 'auto' the problem is there is a 16px(I assume) gap at the right side. Probably it the width of the scrollbar. I wanted the full width. I used a background to explain my problem.\u003c/p\u003e\n\n\u003cp\u003eHere is the fiddle. \u003ca href=\"http://jsfiddle.net/9scJE/\"\u003ehttp://jsfiddle.net/9scJE/\u003c/a\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ediv.autoscroll {\n height: 200px;\n width: 400px;\n overflow: hidden;\n border: 1px solid #444;\n margin: 3em;\n}\n\ndiv.autoscroll:hover {\n /* overflow-y: scroll; */\n overflow-y: auto;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAppreciate any help.\u003c/p\u003e","accepted_answer_id":"15917893","answer_count":"3","comment_count":"0","creation_date":"2013-04-10 05:35:59.22 UTC","favorite_count":"3","last_activity_date":"2013-04-10 05:47:37.653 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"503133","post_type_id":"1","score":"12","tags":"css","view_count":"25954"} +{"id":"11670297","title":"SQL Query for CMMS program (\u003c NOVICE)","body":"\u003cp\u003eBackground: I am using a program called Maintenance connection (if that helps), and it has a module that allows me to view reports based on criteria, and most times I just choose the report I want and it does everything for me. However it also allows you to use SQL to run custom reports. It is formated different in that I don't just have a huge place to write code. It gives me a text box; one each for FROM, JOIN, WHERE, \u0026amp; GROUP. Now I have a working code that gives me everything I want except I need to add/join an extra table and hope someone can help.\u003c/p\u003e\n\n\u003cp\u003eMy current code is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eFROM: FROM SUR_Response\n\nJOIN: inner join sur_survey on sur_survey.Survey_id = sur_response.survey_id \nLEFT OUTER JOIN WO ON WO.WOPK = SUR_Response.wopk \nleft join sur_response_answer on sur_response_answer.response_id = sur_response.response_id\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI need to join the table (Sur_item_answer) column (Sur_item_answer.answer_text). The problem I am running into is this table is text while the other ones are either int or varchar. This is all for getting results from customer surveys and the first questions (sur_item_answer) are multiple choice where you check a circle next to the best choice, and the (sur_response_answer) are open ended. I need to somehow get these into the same query.\u003c/p\u003e\n\n\u003cp\u003eI know this is alot of info, and probably still isn't enough to help much but thanks for any attempts in advanced. Getting desperate at this point.\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2012-07-26 13:23:52.983 UTC","last_activity_date":"2012-07-26 13:26:41.47 UTC","last_edit_date":"2012-07-26 13:26:41.47 UTC","last_editor_display_name":"","last_editor_user_id":"52598","owner_display_name":"","owner_user_id":"1518362","post_type_id":"1","score":"0","tags":"sql","view_count":"93"} +{"id":"43793270","title":"Swift/XCode - Check value of JSON Data And Determine Output","body":"\u003cp\u003eI am currently working on a small project. I am trying to do the following, in essence:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eCheck the value of a certain key i.e. \"color\" \u003c/li\u003e\n\u003cli\u003eDepending on the value of this key, I wish to display a certain\nimage from my assets folder.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eHow can I do this?\u003c/p\u003e\n\n\u003cp\u003eExample:\u003c/p\u003e\n\n\u003cp\u003eif the \u003ccode\u003ecolor\u003c/code\u003e key is equal to \u003ccode\u003egreen\u003c/code\u003e, display a green image within the \u003ccode\u003eUIImageView\u003c/code\u003e from my \u003ccode\u003eAssets\u003c/code\u003e folder.\u003c/p\u003e\n\n\u003cp\u003eHope someone can help me :).\u003c/p\u003e","answer_count":"1","comment_count":"4","creation_date":"2017-05-04 21:44:41.023 UTC","last_activity_date":"2017-05-05 15:38:26.383 UTC","last_edit_date":"2017-05-04 21:50:52.183 UTC","last_editor_display_name":"","last_editor_user_id":"484304","owner_display_name":"","owner_user_id":"7965635","post_type_id":"1","score":"-1","tags":"ios|json","view_count":"38"} +{"id":"7710224","title":"How to add Windows Authentication to a WCF application","body":"\u003cp\u003eI am currently working on a WCF project in C#. I am quite new to the whole .NET area as I am usually doing Java, so please allow me a simple question:\u003c/p\u003e\n\n\u003cp\u003eHow can I make my application ask for credentials (HTTP Digest/Basic) that uses Windows Password? I tried googling a lot but many information are misleading.\u003c/p\u003e\n\n\u003cp\u003eThis his how my web.config currently looks:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\"?\u0026gt;\n\u0026lt;configuration\u0026gt;\n\n \u0026lt;system.web\u0026gt;\n \u0026lt;compilation debug=\"true\" targetFramework=\"4.0\" /\u0026gt;\n \u0026lt;/system.web\u0026gt;\n\n \u0026lt;system.webServer\u0026gt;\n \u0026lt;modules runAllManagedModulesForAllRequests=\"true\"\u0026gt;\n \u0026lt;add name=\"UrlRoutingModule\" type=\"System.Web.Routing.UrlRoutingModule, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\" /\u0026gt;\n \u0026lt;/modules\u0026gt;\n \u0026lt;/system.webServer\u0026gt;\n\n \u0026lt;system.serviceModel\u0026gt;\n \u0026lt;serviceHostingEnvironment aspNetCompatibilityEnabled=\"true\"/\u0026gt;\n \u0026lt;standardEndpoints\u0026gt;\n \u0026lt;webHttpEndpoint\u0026gt;\n \u0026lt;standardEndpoint name=\"\" helpEnabled=\"true\" automaticFormatSelectionEnabled=\"true\"\u0026gt;\n \u0026lt;/standardEndpoint\u0026gt;\n \u0026lt;/webHttpEndpoint\u0026gt;\n \u0026lt;/standardEndpoints\u0026gt;\n \u0026lt;/system.serviceModel\u0026gt;\n\n\u0026lt;/configuration\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"7711040","answer_count":"1","comment_count":"0","creation_date":"2011-10-10 08:30:21.9 UTC","last_activity_date":"2011-10-10 09:49:11.997 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"164165","post_type_id":"1","score":"2","tags":"c#|.net|wcf","view_count":"142"} +{"id":"30203241","title":"Until Loop not working as expected","body":"\u003cp\u003eI'm currently learning Linux and as an homework, we have to create a few basic shell scripts. Nothing especially complicated but this one is giving me headaches. Here's my code :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e until [ \"$toPrint\" == 'fin' ]\n do\n echo \"Enter file name to print out :\" ; read toPrint\n sh ./afficher.sh \"$toPrint\"\n done\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBasically, I have another script called afficher.sh (I'm french so don't mind the french language used) and it reads whatever file name it gets as a parameter. However, the moment I type \"fin\", everything is supposed to stop except it still tries to print the file called \"fin\". I read a bit about the until loop on Internet and once it becomes True, it should stop, which is not my case...\u003c/p\u003e","accepted_answer_id":"30203493","answer_count":"2","comment_count":"2","creation_date":"2015-05-12 23:39:53.003 UTC","last_activity_date":"2015-05-13 01:02:49.07 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4893522","post_type_id":"1","score":"0","tags":"linux|bash|shell|debian","view_count":"40"} +{"id":"32682122","title":"How to remove shadow behind popovers on iOS 9?","body":"\u003cp\u003eIn iOS 8, popovers had no shadow. Now in iOS 9, there is a very heavy and far reaching shadow that can look less than desirable on pure white backgrounds. How can that shadow be removed, and instead add a thin light gray line around the popover? Or at least reduced or made lighter.\u003c/p\u003e\n\n\u003cp\u003eThis occurs when showing action sheets, presenting a view controller using the \u003ccode\u003e.Popover\u003c/code\u003e \u003ccode\u003eUIModalPresentationStyle\u003c/code\u003e, and perhaps in other contexts.\u003c/p\u003e\n\n\u003cp\u003ePopover segue:\n\u003ca href=\"https://i.stack.imgur.com/XkMZ8.png\" rel=\"noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/XkMZ8.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eAction sheet:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eUIActionSheet(title: \"Title\", delegate: nil, cancelButtonTitle: \"Cancel\", destructiveButtonTitle: \"Destroy\").showInView(sender as! UIView)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/l5lwN.png\" rel=\"noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/l5lwN.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"36831840","answer_count":"1","comment_count":"3","creation_date":"2015-09-20 17:16:02.06 UTC","favorite_count":"1","last_activity_date":"2016-04-25 04:03:25.577 UTC","last_edit_date":"2015-09-20 17:21:33.523 UTC","last_editor_display_name":"","last_editor_user_id":"1795356","owner_display_name":"","owner_user_id":"1795356","post_type_id":"1","score":"7","tags":"ios|uipopovercontroller|popover|ios9","view_count":"2454"} +{"id":"23715565","title":"How to write large result into a file in Java","body":"\u003cp\u003eI want to generate some data and write them into a file. The size of these data is larger than the capacity of memory. Which way should I use to write these data?\u003c/p\u003e\n\n\u003cp\u003eNow I am using this way:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eBufferedWriter output = new BufferedWriter(new OutputStreamWriter(\n new FileOutputStream(fileName), \"utf-8\"\n ));\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI don't know if it works when the data is very large, and if there is other way with better performance.\u003c/p\u003e\n\n\u003cp\u003eAlso, the encoding must be \"utf-8\".\u003c/p\u003e","accepted_answer_id":"23715854","answer_count":"2","comment_count":"5","creation_date":"2014-05-17 20:02:49.94 UTC","last_activity_date":"2014-05-17 20:36:42.27 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2640886","post_type_id":"1","score":"1","tags":"java","view_count":"68"} +{"id":"45649987","title":"std::Future_error when using std::promise","body":"\u003cp\u003eI'm trying to make a video player. I have added a thread to time how long a video should be show on the screen. I'm trying to decode the video and update window in the main thread; the second thread will get the packets, see how long the packet should be displayed, and send the packet to main thread then wait for time to elapse.\u003c/p\u003e\n\n\u003cp\u003eFor some reason I get this error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eterminate called after throwing an instance of 'std::future_error'\n what(): std::future_error: No associated state\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat's causing the error?\u003c/p\u003e\n\n\u003cp\u003eMy Code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eextern \"C\"{\n //FFmpeg libraries\n #include \u0026lt;libavcodec/avcodec.h\u0026gt;\n #include \u0026lt;libavformat/avformat.h\u0026gt;\n #include \u0026lt;libswscale/swscale.h\u0026gt;\n\n //SDL2 libraries\n #include \u0026lt;SDL2/SDL.h\u0026gt;\n}\n// compatibility with newer API\n#if LIBAVCODEC_VERSION_INT \u0026lt; AV_VERSION_INT(55,28,1)\n#define av_frame_alloc avcodec_alloc_frame\n#define av_frame_free avcodec_free_frame\n#endif\n\n//C++ libraries\n#include \u0026lt;memory\u0026gt;\n#include \u0026lt;stdio.h\u0026gt;\n#include \u0026lt;iostream\u0026gt;\n#include \u0026lt;chrono\u0026gt;\n#include \u0026lt;thread\u0026gt;\n#include \u0026lt;mutex\u0026gt;\n#include \u0026lt;condition_variable\u0026gt;\n#include \u0026lt;future\u0026gt;\n\n\ntypedef struct PacketQueue {\n AVPacketList *first_pkt, *last_pkt;\n} PacketQueue;\n\nstd::atomic\u0026lt;bool\u0026gt; quitting;\nstd::mutex mutex;\nstd::condition_variable convar;\n\nint packet_queue_put(PacketQueue *q, AVPacket *pkt){\n AVPacketList *pkt1;\n if(av_dup_packet(pkt) \u0026lt; 0){\n return -1;\n }\n pkt1 = (AVPacketList*) av_malloc(sizeof(AVPacketList));\n if(!pkt1){\n return -1;\n }\n pkt1-\u0026gt;pkt = *pkt;\n pkt1-\u0026gt;next = NULL;\n\n std::lock_guard\u0026lt;std::mutex\u0026gt; lock(mutex);\n\n if (!q-\u0026gt;last_pkt){\n q-\u0026gt;first_pkt = pkt1;\n }else{\n q-\u0026gt;last_pkt-\u0026gt;next = pkt1;\n }\n q-\u0026gt;last_pkt = pkt1;\n convar.notify_all();\n return 0;\n}\n\nstatic int packet_queue_get(PacketQueue *q, AVPacket *pkt){\n AVPacketList *pkt1;\n int ret;\n\n std::unique_lock\u0026lt;std::mutex\u0026gt; lk(mutex);\n while(1){\n if(quitting){\n ret = -1;\n break;\n }\n\n pkt1 = q-\u0026gt;first_pkt;\n if(pkt1){\n q-\u0026gt;first_pkt = pkt1-\u0026gt;next;\n if(!q-\u0026gt;first_pkt){\n q-\u0026gt;last_pkt = NULL;\n }\n *pkt = pkt1-\u0026gt;pkt;\n av_free(pkt1);\n ret = 1;\n break;\n }else {\n convar.wait_for(lk, std::chrono::milliseconds(1));\n }\n }\n return ret;\n}\n\nvoid videoTimerFunc(AVRational time_base, PacketQueue* videoq, std::promise\u0026lt;AVPacket\u0026gt; prms){\n AVPacket pkt;\n int64_t last_pts = 0;\n int64_t frameDelay;\n AVRational microseconds = {1, 1000000};\n\n while(!quitting){\n // Getting packet and check if there are more packets\n if(!packet_queue_get(videoq, \u0026amp;pkt)){\n // Close programme\n quitting = true;\n }else {\n // Send packet and create timer\n frameDelay = av_rescale_q(pkt.dts, time_base, microseconds) - last_pts;\n last_pts = av_rescale_q(pkt.dts, time_base, microseconds);\n prms.set_value(pkt);\n\n std::this_thread::sleep_for(std::chrono::microseconds(frameDelay));\n }\n }\n}\n\nint main(int argc, char *argv[]){\nAVFormatContext* FormatCtx = nullptr;\nAVCodecContext* CodecCtxOrig = nullptr;\nAVCodecContext* CodecCtx = nullptr;\nAVCodec* Codec = nullptr;\nint videoStream;\nAVFrame* Frame = nullptr;\nAVPacket packet;\nstruct SwsContext* SwsCtx = nullptr;\n\nPacketQueue videoq;\nstd::promise\u0026lt;AVPacket\u0026gt; pktprms;\nstd::future\u0026lt;AVPacket\u0026gt; pktftr = pktprms.get_future();\nint frameFinished;\nint64_t lastPTS;\n\nSDL_Event event;\nSDL_Window* screen;\nSDL_Renderer* renderer;\nSDL_Texture* texture;\nstd::shared_ptr\u0026lt;Uint8\u0026gt; yPlane, uPlane, vPlane;\nint uvPitch;\n\nif (argc != 2) {\n fprintf(stderr, \"Usage: %s \u0026lt;file\u0026gt;\\n\", argv[0]);\n return -1;\n}\n\n// Register all formats and codecs\nav_register_all();\n\n// Initialise SDL2\nif (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER)) {\n fprintf(stderr, \"Couldn't initialise SDL - %s\\n\", SDL_GetError());\n return -1;\n}\n\n// Setting things up\nquitting = false;\nmemset(\u0026amp;videoq, 0, sizeof(PacketQueue));\n\n// Open video file\nif(avformat_open_input(\u0026amp;FormatCtx, argv[1], NULL, NULL) != 0){\n fprintf(stderr, \"Couldn't open file\\n\"); \n return -1; // Couldn't open file\n}\n\n// Retrieve stream information\nif(avformat_find_stream_info(FormatCtx, NULL) \u0026lt; 0){\n fprintf(stderr, \"Couldn't find stream information\\n\");\n\n // Close the video file\n avformat_close_input(\u0026amp;FormatCtx);\n\n return -1; // Couldn't find stream information\n}\n\n// Find the video stream\nvideoStream = av_find_best_stream(FormatCtx, AVMEDIA_TYPE_VIDEO, -1, -1, NULL, 0);\nif(videoStream \u0026lt; 0){\n fprintf(stderr, \"Couldn't find video stream\\n\");\n\n // Close the video file\n avformat_close_input(\u0026amp;FormatCtx);\n\n return -1; // Didn't find a video stream\n}\n\n// Get a pointer to the codec context for the video stream\nCodecCtxOrig = FormatCtx-\u0026gt;streams[videoStream]-\u0026gt;codec;\n\n// Find the decoder for the video stream\nCodec = avcodec_find_decoder(CodecCtxOrig-\u0026gt;codec_id);\nif(Codec == NULL){\n fprintf(stderr, \"Unsupported codec\\n\");\n\n // Close the codec\n avcodec_close(CodecCtxOrig);\n\n // Close the video file\n avformat_close_input(\u0026amp;FormatCtx);\n\n return -1; // Codec not found\n}\n\n// Copy context\nCodecCtx = avcodec_alloc_context3(Codec);\nif(avcodec_copy_context(CodecCtx, CodecCtxOrig) != 0){\n fprintf(stderr, \"Couldn't copy codec context\");\n\n // Close the codec\n avcodec_close(CodecCtxOrig);\n\n // Close the video file\n avformat_close_input(\u0026amp;FormatCtx);\n\n return -1; // Error copying codec context\n}\n\n// Open codec\nif(avcodec_open2(CodecCtx, Codec, NULL) \u0026lt; 0){\n fprintf(stderr, \"Couldn't open codec\\n\");\n\n // Close the codec\n avcodec_close(CodecCtx);\n avcodec_close(CodecCtxOrig);\n\n // Close the video file\n avformat_close_input(\u0026amp;FormatCtx);\n return -1; // Could not open codec\n}\n\n// Allocate video frame\nFrame = av_frame_alloc();\n\n// Make a screen to put our video\nscreen = SDL_CreateWindow(\"Video Player\", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, CodecCtx-\u0026gt;width, CodecCtx-\u0026gt;height, 0);\nif(!screen){\n fprintf(stderr, \"SDL: could not create window - exiting\\n\");\n quitting = true;\n\n // Clean up SDL2\n SDL_Quit();\n\n // Free the YUV frame\n av_frame_free(\u0026amp;Frame);\n\n // Close the codec\n avcodec_close(CodecCtx);\n avcodec_close(CodecCtxOrig);\n\n // Close the video file\n avformat_close_input(\u0026amp;FormatCtx);\n\n return -1;\n}\n\nrenderer = SDL_CreateRenderer(screen, -1, 0);\nif(!renderer){\n fprintf(stderr, \"SDL: could not create renderer - exiting\\n\");\n quitting = true;\n\n // Clean up SDL2\n SDL_DestroyWindow(screen);\n SDL_Quit();\n\n // Free the YUV frame\n av_frame_free(\u0026amp;Frame);\n\n // Close the codec\n avcodec_close(CodecCtx);\n avcodec_close(CodecCtxOrig);\n\n // Close the video file\n avformat_close_input(\u0026amp;FormatCtx);\n return -1;\n}\n\n// Allocate a place to put our YUV image on that screen\ntexture = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_YV12, SDL_TEXTUREACCESS_STREAMING, CodecCtx-\u0026gt;width, CodecCtx-\u0026gt;height);\nif(!texture){\n fprintf(stderr, \"SDL: could not create texture - exiting\\n\");\n quitting = true;\n\n // Clean up SDL2\n SDL_DestroyRenderer(renderer);\n SDL_DestroyWindow(screen);\n SDL_Quit();\n\n // Free the YUV frame\n av_frame_free(\u0026amp;Frame);\n\n // Close the codec\n avcodec_close(CodecCtx);\n avcodec_close(CodecCtxOrig);\n\n // Close the video file\n avformat_close_input(\u0026amp;FormatCtx);\n return -1;\n}\n\n// Initialise SWS context for software scaling\nSwsCtx = sws_getContext(CodecCtx-\u0026gt;width, CodecCtx-\u0026gt;height, CodecCtx-\u0026gt;pix_fmt,\n CodecCtx-\u0026gt;width, CodecCtx-\u0026gt;height, PIX_FMT_YUV420P, SWS_BILINEAR, NULL, NULL, NULL);\nif(!SwsCtx){\n fprintf(stderr, \"Couldn't create sws context\\n\");\n quitting = true;\n\n // Clean up SDL2\n SDL_DestroyTexture(texture);\n SDL_DestroyRenderer(renderer);\n SDL_DestroyWindow(screen);\n SDL_Quit();\n\n // Free the YUV frame\n av_frame_free(\u0026amp;Frame);\n\n // Close the codec\n avcodec_close(CodecCtx);\n avcodec_close(CodecCtxOrig);\n\n // Close the video file\n avformat_close_input(\u0026amp;FormatCtx);\n return -1;\n}\n\n// set up YV12 pixel array (12 bits per pixel)\nyPlane = std::shared_ptr\u0026lt;Uint8\u0026gt;((Uint8 *)::operator new (CodecCtx-\u0026gt;width * CodecCtx-\u0026gt;height, std::nothrow));\nuPlane = std::shared_ptr\u0026lt;Uint8\u0026gt;((Uint8 *)::operator new (CodecCtx-\u0026gt;width * CodecCtx-\u0026gt;height / 4, std::nothrow));\nvPlane = std::shared_ptr\u0026lt;Uint8\u0026gt;((Uint8 *)::operator new (CodecCtx-\u0026gt;width * CodecCtx-\u0026gt;height / 4, std::nothrow));\nuvPitch = CodecCtx-\u0026gt;width / 2;\n\nif (!yPlane || !uPlane || !vPlane) {\n fprintf(stderr, \"Could not allocate pixel buffers - exiting\\n\");\n quitting = true;\n\n // Clean up SDL2\n SDL_DestroyTexture(texture);\n SDL_DestroyRenderer(renderer);\n SDL_DestroyWindow(screen);\n SDL_Quit();\n\n // Free the YUV frame\n av_frame_free(\u0026amp;Frame);\n\n // Close the codec\n avcodec_close(CodecCtx);\n avcodec_close(CodecCtxOrig);\n\n // Close the video file\n avformat_close_input(\u0026amp;FormatCtx);\n return -1;\n}\n\nstd::thread videoTimerThread(videoTimerFunc, FormatCtx-\u0026gt;streams[videoStream]-\u0026gt;time_base, \u0026amp;videoq, std::move(pktprms));\n\nwhile (!quitting) {\n // Check for more packets\n if(av_read_frame(FormatCtx, \u0026amp;packet) \u0026gt;= 0){\n // Check what stream it belongs to\n if (packet.stream_index == videoStream) {\n packet_queue_put(\u0026amp;videoq, \u0026amp;packet);\n }else{\n // Free the packet that was allocated by av_read_frame\n av_free_packet(\u0026amp;packet);\n }\n }\n\n // Check if its time to update\n if(pktftr.wait_for(std::chrono::milliseconds(1)) == std::future_status::ready){\n // Getting packet\n packet = pktftr.get();\n\n // Decode video frame\n avcodec_decode_video2(CodecCtx, Frame, \u0026amp;frameFinished, \u0026amp;packet);\n\n // Did we get a video frame?\n if (frameFinished) {\n AVPicture pict;\n pict.data[0] = yPlane.get();\n pict.data[1] = uPlane.get();\n pict.data[2] = vPlane.get();\n pict.linesize[0] = CodecCtx-\u0026gt;width;\n pict.linesize[1] = uvPitch;\n pict.linesize[2] = uvPitch;\n\n // Convert the image into YUV format that SDL uses\n sws_scale(SwsCtx, (uint8_t const * const *) Frame-\u0026gt;data, Frame-\u0026gt;linesize, 0, CodecCtx-\u0026gt;height, pict.data, pict.linesize);\n\n SDL_UpdateYUVTexture(texture, NULL, yPlane.get(), CodecCtx-\u0026gt;width, uPlane.get(), uvPitch, vPlane.get(), uvPitch);\n\n SDL_RenderClear(renderer);\n SDL_RenderCopy(renderer, texture, NULL, NULL);\n SDL_RenderPresent(renderer);\n }\n // Free the packet that was allocated by av_read_frame\n av_free_packet(\u0026amp;packet);\n }\n\n SDL_PollEvent(\u0026amp;event);\n switch (event.type) {\n case SDL_QUIT:\n quitting = true;\n break;\n default:\n break;\n }\n}\n\nvideoTimerThread.join();\n\n//SDL2 clean up\nSDL_DestroyTexture(texture);\nSDL_DestroyRenderer(renderer);\nSDL_DestroyWindow(screen);\nSDL_Quit();\n\n// Free the YUV frame\nav_frame_free(\u0026amp;Frame);\n\n// Free Sws\nsws_freeContext(SwsCtx);\n\n// Close the codec\navcodec_close(CodecCtx);\navcodec_close(CodecCtxOrig);\n\n// Close the video file\navformat_close_input(\u0026amp;FormatCtx);\n\nreturn 0;\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"45899239","answer_count":"1","comment_count":"6","creation_date":"2017-08-12 11:57:36.32 UTC","last_activity_date":"2017-08-26 20:05:58.03 UTC","last_edit_date":"2017-08-12 14:48:13.503 UTC","last_editor_display_name":"","last_editor_user_id":"8359251","owner_display_name":"","owner_user_id":"8359251","post_type_id":"1","score":"1","tags":"multithreading|c++11|promise|std-future","view_count":"48"} +{"id":"9078594","title":"ASP.NET changing controls order in div","body":"\u003cp\u003eI have two controls in div wrapped into update panel. My code requires for user to be able to change position of second control left,top,right,bottom from first controls point of view. I was thinking of adding a MultiView and adding 4 Views but controls can't have same ID in views and that is essential for my code functionality.\u003c/p\u003e\n\n\u003cp\u003eWhat would be best approach here?\u003c/p\u003e","accepted_answer_id":"9080854","answer_count":"1","comment_count":"4","creation_date":"2012-01-31 11:17:30.907 UTC","last_activity_date":"2012-01-31 14:04:55.24 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1010609","post_type_id":"1","score":"1","tags":"c#|asp.net","view_count":"1491"} +{"id":"17343396","title":"jquery form submit using ajax","body":"\u003cp\u003eI want to submit my form using ajax. \u003c/p\u003e\n\n\u003cp\u003eBelow is my code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(\"#loginForm\").submit(function() {\nvar url = \u0026lt;url\u0026gt;;\n$.ajax({\n type: \"POST\",\n url: url,\n data: $(\"#loginForm\").serialize(), // serializes the form's elements.\n success: function(data)\n {\n if(data == '0'){ \n $(\"#loginErr\").show();\n return false;\n }\n else if(data == '1')\n return true;\n }\n });\n return false;\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to get my form submitted if ajax response is 1. but irrespective of data value, form is not getting submitted. Its always getting return value false. I have checked it reaches to else if condition, but execution is not stopped on return.\u003c/p\u003e\n\n\u003cp\u003eHow can I submit my form? I want to refresh my page.\u003c/p\u003e","answer_count":"3","comment_count":"8","creation_date":"2013-06-27 12:37:07.58 UTC","last_activity_date":"2013-06-28 05:21:31.467 UTC","last_edit_date":"2013-06-27 12:44:59.17 UTC","last_editor_display_name":"","last_editor_user_id":"1525585","owner_display_name":"","owner_user_id":"1525585","post_type_id":"1","score":"0","tags":"jquery|ajax|forms","view_count":"270"} +{"id":"15589101","title":"What is wrong with this Reversed String code (C)","body":"\u003cp\u003eThis is a code to return a reversed String like \"ABC\" returns \"CBA\", but it returns this \"CBA═²²²²ß♣Y*\u0026amp;s\".\nWhat is wrong?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003echar* inv(char* C)\n{\n int lenght = strLenght(C)-1;\n int idx=0;\n\n char* tempStr = (char*)malloc(lenght+2);\n for (;lenght\u0026gt;=0;lenght--,idx++)\n {\n tempStr[idx] = C[lenght];\n }\n return tempStr;\n}\nint strLenght(char* str)\n{\n int lenght=0;\n while(str[lenght] != '\\0')\n lenght++;\n return lenght;\n}\n\nint main(int argc, char *argv[])\n{\n char* st= \"ABC\";\n char* sr = inv(st);\n printf(\"%s\",sr);\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"15589115","answer_count":"3","comment_count":"3","creation_date":"2013-03-23 16:23:33.263 UTC","last_activity_date":"2013-03-23 16:44:39.467 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1136614","post_type_id":"1","score":"1","tags":"c|malloc","view_count":"546"} +{"id":"44373210","title":"polymer-cli - getting \"Can’t find variable: babelHelpers\" when I set compile to true","body":"\u003cp\u003eI use Polymer 2.0 and my build setting is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\"builds\": [\n{\n \"name\": \"bundled\",\n \"bundle\": true,\n \"js\": { \"compile\": true},\n \"css\": { \"minify\": true },\n \"html\": { \"minify\": true }\n}]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI get \"Can’t find variable: babelHelpers\" error after build.\u003c/p\u003e\n\n\u003cp\u003eThe Polymer CLI version that I use is 1.1.0.\u003c/p\u003e\n\n\u003cp\u003eEDIT: I was using polymer-cli locally. After installing latest polymer-cli globally, now I get “Constructor requires ‘new’ operator” on safari and “Failed to construct ‘HTMLElement’: Please use the ‘new’ operator, this DOM object constructor cannot be called as a function.” on chrome.\u003c/p\u003e\n\n\u003cp\u003eEDIT2: used webcomponents-loader.js instead of webcomponents-lite.js and my problem solved.\u003c/p\u003e","answer_count":"1","comment_count":"5","creation_date":"2017-06-05 16:15:54.39 UTC","last_activity_date":"2017-06-08 23:14:32.937 UTC","last_edit_date":"2017-06-06 14:20:47.087 UTC","last_editor_display_name":"","last_editor_user_id":"1733926","owner_display_name":"","owner_user_id":"1733926","post_type_id":"1","score":"2","tags":"polymer-2.x|polymer-cli","view_count":"121"} +{"id":"41205998","title":"Automap multiple databases with Flask-SQLAlchemy","body":"\u003cp\u003eI have an app currently working fine Automapping one database, but I need to access another database now as well. I tried to follow the Flask-SQLAlchemy documentation here: \u003ca href=\"http://flask-sqlalchemy.pocoo.org/2.1/binds/\" rel=\"nofollow noreferrer\"\u003ehttp://flask-sqlalchemy.pocoo.org/2.1/binds/\u003c/a\u003e, but it doesn't seem to work with the automap_base. \u003c/p\u003e\n\n\u003cp\u003eThe only changes I made were creating \u003ccode\u003eSQLALCHEMY_BINDS\u003c/code\u003e and adding the \u003ccode\u003e__bind_key__\u003c/code\u003e in \u003cstrong\u003emodels.py\u003c/strong\u003e. The error I get is \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esqlalchemy.exc.ArgumentError: Mapper Mapper|Table2|table2 could not assemble any primary key columns for mapped table 'table2'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, both tables have a primary key column, and if I get rid of \u003ccode\u003eSQLALCHEMY_BINDS\u003c/code\u003e, set the URI to that of \u003ccode\u003edb2\u003c/code\u003e, and only have \u003ccode\u003etable2\u003c/code\u003e in \u003cstrong\u003emodels.py\u003c/strong\u003e, everything works fine.\u003c/p\u003e\n\n\u003cp\u003eI'm clearly doing something wrong, but I have no idea what it is. It looks like Flask is still looking for \u003ccode\u003etable2\u003c/code\u003e in \u003ccode\u003edb1\u003c/code\u003e. I think my problem is that some change needs to be made to \u003cstrong\u003e__init__.py\u003c/strong\u003e as well, but I don't know what that would be.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003econfig.py\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSQLALCHEMY_DATABASE_URI = 'mysql://user@host/db1'\nSQLALCHEMY_BINDS = {\n 'otherDB': 'mysql://user@host/db2',\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003e__init__.py\u003c/strong\u003e \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efrom flask import Flask\nfrom flask_sqlalchemy import SQLAlchemy\nfrom sqlalchemy.ext.automap import automap_base\n\napp = Flask(__name__)\napp.config.from_object('config')\n\ndb = SQLAlchemy(app)\ndb.Model = automap_base(db.Model)\nfrom app import models\ndb.Model.prepare(db.engine, reflect=True)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003emodels.py\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass Table1(db.Model):\n __tablename__ = 'table1'\n\nclass Table2(db.Model):\n __bind_key__ = 'otherDB'\n __tablename__ = 'table2'\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"41209723","answer_count":"1","comment_count":"0","creation_date":"2016-12-18 06:19:42.757 UTC","favorite_count":"2","last_activity_date":"2016-12-18 15:10:36.82 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3945830","post_type_id":"1","score":"0","tags":"sqlalchemy|flask-sqlalchemy","view_count":"539"} +{"id":"28626204","title":"Mean by levels of factor in R, append as new column","body":"\u003cp\u003eI have what I fear may be a simple problem, to which I almost have the solution (indeed, I do have a solution, but it's clumsy).\u003c/p\u003e\n\n\u003cp\u003eI have a data frame as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ename replicate value\nA 1 0.9\nA 2 1\nB 1 0.8\nB 2 0.81\nC 1 0.7\nC 2 0.9\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat I would like to do is compute the mean of 'value', by 'name', and append the results to a new column as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ename replicate value meanbyname\nA 1 0.9 0.95\nA 2 1 0.95\nB 1 0.8 0.805\nB 2 0.81 0.805\nC 1 0.7 0.8\nC 2 0.9 0.8\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI can calculate the means in any of the following ways:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ea\u0026lt;-aggregate(value~name, data=test, FUN=function(x) c(mean=mean(x),count=length(x)))\nb\u0026lt;-aggregate(test$value~test$name, FUN=mean)\nc\u0026lt;-tapply(test$value, test$name, mean)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut I cannot append them easily to the data frame as they are the wrong length.\u003c/p\u003e\n\n\u003cp\u003eI could then do this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e test$meanbyname\u0026lt;-rep(c, each=2)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis seems close, by gives an error as object 'a' seems to only be two columns wide:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e test$meanbyname\u0026lt;-rep(a$value.mean, each=a$value.count)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'd like a way of automating the process so it will work if there are, for example, three replicates of name=A and only one of name=B. Could there be a one line solution which is more generalisable?\u003c/p\u003e\n\n\u003cp\u003eThank you all in advance for your help.\u003c/p\u003e","accepted_answer_id":"28626246","answer_count":"1","comment_count":"0","creation_date":"2015-02-20 10:01:56.007 UTC","last_activity_date":"2015-02-20 10:03:54.163 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2932942","post_type_id":"1","score":"0","tags":"r|apply|mean","view_count":"615"} +{"id":"12598863","title":"Convert Date to string using PHP","body":"\u003cp\u003eI have date \u003ccode\u003e2012/09/26\u003c/code\u003e. I want to convert it to string using PHP.How do I fix this.Anyone help me please,Thanks.\u003c/p\u003e","accepted_answer_id":"12598952","answer_count":"3","comment_count":"5","creation_date":"2012-09-26 09:42:13.35 UTC","last_activity_date":"2012-09-26 10:02:51.523 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1684604","post_type_id":"1","score":"-1","tags":"php|datetime","view_count":"19622"} +{"id":"30774049","title":"Is it possible to get vector font representation from local fonts in JavaScript?","body":"\u003cp\u003eIs there any way to get vector representation for user-provided font? I mean, if a user has some non-standard font installed on his system, I am able to \u003ca href=\"https://stackoverflow.com/questions/3228223/how-to-find-out-all-installed-fonts-on-user-machine\"\u003edetect that font\u003c/a\u003e, I can draw it to off-screen canvas and get raster font representation.\u003c/p\u003e\n\n\u003cp\u003eI searched for a long time, but couldn't find any way to get vector representation for such font - there are always those \"security restrictions\". Is there some way to do it from JavaScript (maybe even with small Flash app)?\u003c/p\u003e\n\n\u003cp\u003e\u003cem\u003eUpdate:\u003c/em\u003e\u003c/p\u003e\n\n\u003cp\u003eWhy would I need such a thing? The reason is that the app I am building works a lot like an svg editor, allowing a person to create various documents right in his browser. But I also provide facilities for PDF output and saving the edited in some intermediate format, so later the user can continue editing (possibly on another machine).\u003c/p\u003e\n\n\u003cp\u003ePDF carries all it's fonts right inside the file, so if user specifies some font that is only installed on his machine, I need to get that font specification and embed it into PDF file. If I get raster font representation, the quality will suffer - and since the documents are intended for printing, quality is paramount.\u003c/p\u003e\n\n\u003cp\u003eSame argument goes for save files - since user can transfer them to another machine with another set of fonts, I need to carry non-standard fonts inside the file.\u003c/p\u003e","answer_count":"0","comment_count":"12","creation_date":"2015-06-11 07:14:34.19 UTC","last_activity_date":"2015-06-12 07:01:17.073 UTC","last_edit_date":"2017-05-23 11:43:40.35 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"486057","post_type_id":"1","score":"0","tags":"javascript|flash|fonts","view_count":"57"} +{"id":"39074173","title":"Cannot receive the http status code 413 for CORS","body":"\u003cp\u003eI have this web application where the web services are hosted on Amazon API gateway \u0026amp; the client application is hosted on cloudefront site. The services are CORS enabled. For any error such as http 500, 401, 403 I am able to receive the http status from the jqxhr object using \u003ccode\u003estatus\u003c/code\u003e property. But it seem that for http status 413 i am getting status 0 in the code. \u003c/p\u003e\n\n\u003cp\u003eI have also noticed that http status 413 can be received if the request is made with in the server. But only for cross domain ajax, the status 413 is received as status 0.\u003c/p\u003e\n\n\u003cp\u003eIs there any way to handle http status 413 for cross domain ajax request.\u003c/p\u003e\n\n\u003cp\u003eJust brevity, consider the following code block, for http status 500, 401 the error callback log's out 500 or 401. But for 413 it displays 0. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e $.ajax({\n url: 'URL to AWS API Gateway',\n success: function(d){\n console.log(d);\n },\n error: function(a){\n console.log( a.status );\n }\n });\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-08-22 08:02:57.247 UTC","last_activity_date":"2016-08-22 14:03:00.507 UTC","last_edit_date":"2016-08-22 08:11:52.993 UTC","last_editor_display_name":"","last_editor_user_id":"4093700","owner_display_name":"","owner_user_id":"4093700","post_type_id":"1","score":"2","tags":"javascript|jquery|ajax|http|backbone.js","view_count":"203"} +{"id":"15604056","title":"Joomla 2.5 How many possible categories","body":"\u003cp\u003eI googled but could only find answers for the max amount of articles.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eQuestion: short Version:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eHow many possible categories (with subcategories) can Joomla 2.5 handle on a shared host. Which problems do I have to expect?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eQuestion: long Version:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI m building an website for architects. The content structure looks like this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eHOUSES\n Architect A\n Project 1\n Project 2\n ...\n\n Architect B\n Project 1\n Project 2\n ...\n\nPlaces\n Architect C\n Project 1\n Project 2\n ...\n\n Architect D\n Project 1\n Project 2\n ...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd so on. The most obvious would be to have HOUSES and PLACES as Categories. Architect A, Architect B ... as subcategories and the Projects as articles. This would on the one hand keep the ability to use Joomlas Blog View etc. and not use third party CCK extensions but on the other hand this would probably cause 300 and more categories.\u003c/p\u003e\n\n\u003cp\u003eThanks for your always great input,\u003c/p\u003e\n\n\u003cp\u003eTony \u003c/p\u003e","accepted_answer_id":"15605240","answer_count":"3","comment_count":"0","creation_date":"2013-03-24 21:10:52.21 UTC","last_activity_date":"2013-07-20 20:00:43.553 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1474777","post_type_id":"1","score":"0","tags":"joomla|categories|max","view_count":"433"} +{"id":"15549678","title":"what does it mean when an exception properly handled by the UI thread causes the Windows Form application to quietly exit?","body":"\u003cp\u003eMy understanding is that in a windows forms application if the UI thread throws an exception and it is not handled by user code the application will crash in a manner that is obvious to the user. (A message will appear on the screen indicating that the application has crashed, or the window will freeze, or both)\u003c/p\u003e\n\n\u003cp\u003eNow consider the following code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etry\n{\n PerformAsyncOperation();\n while(!async_op_complete)\n {\n Application.DoEvents();\n }\n}\ncatch\n{\n Print(\"exception\");\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy undestanding is that because a windows form has a synchronization context, the async operation (and I'm not talking about .net 4.5, by the way) won't be performed until control leaves the event handler procedure. Once that happens the async code will run, inside the UI thread. If that code were to throw an exception then it wouldn't be caught by the try-catch statement surrounding the call to the async method, since control will have already left that try-catch statement by the time the exception is thrown.\u003c/p\u003e\n\n\u003cp\u003eBut in cases such as the one above, the fact that we are looping means that control remains inside the UI thread, and the fact that we are calling Application.DoEvents() inside the loop means that the async operation is performed \"asynchronously\" inside the UI thread. And because that loop takes place inside the try clause then any exception thrown by the async method will be caught by the corresponding catch clause. (At least this is the behavior I have observed.)\u003c/p\u003e\n\n\u003cp\u003eThat said,\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003e\u003cp\u003eIs it ever a good idea to call Application.DoEvents() inside a loop in order to keep the UI responsive while waiting for an async operation to complete before moving on to doing more work inside the same UI thread?\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eEven if it's not a good idea to call Application.DoEvents() inside a loop, why does the application quietly exit (no window freezes, no error messages) after the catch clause handles the exception thrown by PerformAsyncOperation()?\u003c/p\u003e\u003c/li\u003e\n\u003c/ol\u003e","accepted_answer_id":"15552135","answer_count":"1","comment_count":"1","creation_date":"2013-03-21 14:01:40.103 UTC","last_activity_date":"2013-03-21 15:49:27.54 UTC","last_edit_date":"2013-03-21 14:14:14.857 UTC","last_editor_display_name":"","last_editor_user_id":"2127424","owner_display_name":"","owner_user_id":"2127424","post_type_id":"1","score":"0","tags":".net|winforms|exception|asynchronous|ui-thread","view_count":"119"} +{"id":"44410141","title":"How can I write to firebase from Matlab using curl?","body":"\u003cp\u003eI want to write some data from Matlab to firebase. Basically, I want a code that uses curl that runs the Matlab code and write the values back on firebase. I tried this example \u003ca href=\"https://stackoverflow.com/questions/35793426/firebase-how-to-write-using-curl/35802613\"\u003eFirebase - How to write using curl?\u003c/a\u003e and it works for writing specific things, what I want is compiling the Matlab code and send these values to firebase. How can I do so?\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-06-07 10:31:01.23 UTC","last_activity_date":"2017-06-07 10:36:49.783 UTC","last_edit_date":"2017-06-07 10:36:49.783 UTC","last_editor_display_name":"","last_editor_user_id":"5996134","owner_display_name":"","owner_user_id":"8124896","post_type_id":"1","score":"0","tags":"matlab|curl|firebase","view_count":"43"} +{"id":"9969839","title":"How to make GPS function work?","body":"\u003cp\u003eI'm new at Eclipse and the Android applications making so here comes a very rookie question. How can I make this function work properly? I have just copy \u003e paste it to my \u003ccode\u003epublic class nowActivity extends Activity {\u003c/code\u003e and fixed the errors that accord. The function is as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epackage weather.right;\n\nimport weather.right.now.R;\nimport android.app.Activity;\nimport android.app.AlertDialog;\nimport android.content.DialogInterface;\nimport android.content.Intent;\nimport android.location.LocationManager;\nimport android.net.Uri;\nimport android.os.Bundle;\nimport android.view.View;\nimport android.widget.TextView;\nimport android.widget.Toast;\n\npublic class nowActivity extends Activity {\n /** Called when the activity is first created. */\n @Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.main);\n\n super.onCreate(savedInstanceState);\n setContentView(R.layout.main);\n LocationManager locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);\n\n if (locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)){\n Toast.makeText(this, \"GPS is Enabled in your devide\", Toast.LENGTH_SHORT).show();\n }else{\n showGPSDisabledAlertToUser();\n }\n }\n\n public void goToSo(View view) {\n goToUrl(\"http://erik-edgren.nu/weather\");\n }\n\n private void goToUrl(String url) {\n Uri uriUrl = Uri.parse(url);\n Intent launchBrowser = new Intent(Intent.ACTION_VIEW, uriUrl);\n startActivity(launchBrowser);\n }\n\n private void showGPSDisabledAlertToUser(){\n AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);\n alertDialogBuilder.setMessage(\"GPS is disabled in your device. Would you like to enable it?\")\n .setCancelable(false)\n .setPositiveButton(\"Goto Settings Page To Enable GPS\",\n new DialogInterface.OnClickListener(){\n public void onClick(DialogInterface dialog, int id){\n Intent callGPSSettingIntent = new Intent(\n android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS);\n startActivity(callGPSSettingIntent);\n }\n });\n alertDialogBuilder.setNegativeButton(\"Cancel\",\n new DialogInterface.OnClickListener(){\n public void onClick(DialogInterface dialog, int id){\n dialog.cancel();\n }\n });\n AlertDialog alert = alertDialogBuilder.create();\n alert.show();\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks in advance.\u003c/p\u003e","accepted_answer_id":"9969862","answer_count":"1","comment_count":"0","creation_date":"2012-04-02 01:13:05.01 UTC","last_activity_date":"2012-04-02 01:45:40.413 UTC","last_edit_date":"2012-04-02 01:45:40.413 UTC","last_editor_display_name":"","last_editor_user_id":"718990","owner_display_name":"","owner_user_id":"718990","post_type_id":"1","score":"0","tags":"android|eclipse|gps","view_count":"568"} +{"id":"24430015","title":"CodeIgniter - flash session deleting all session","body":"\u003cp\u003eI am using flash data for success/error messages.\u003c/p\u003e\n\n\u003cp\u003eI am experiencing issue: after I set flashdata - all session data are deleted but only in few controlers, in other controlers it is working properly.\u003c/p\u003e\n\n\u003cp\u003eCotroller 1: (function whre it is working OK)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic function vymazat($id)\n {\n if(!is_numeric($id)) redirect();\n\n $this-\u0026gt;admin_model-\u0026gt;delete_coupon($id);\n $this-\u0026gt;session-\u0026gt;set_flashdata('success', 'Kupón bol úspešne vymazaný');\n redirect('admin/kupony/zobrazit');\n\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eController 2: (function where it is not working)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic function vymazat($id)\n{\n if(!is_numeric($id)) redirect();\n\n $this-\u0026gt;admin_model-\u0026gt;delete_order($id);\n $this-\u0026gt;session-\u0026gt;set_flashdata('success', 'Kupón bol pridaný');\n redirect('admin/objednavky/zobrazit');\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks for any help\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2014-06-26 12:01:48.723 UTC","last_activity_date":"2014-06-26 15:15:17.503 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2231512","post_type_id":"1","score":"0","tags":"php|codeigniter","view_count":"76"} +{"id":"17292521","title":"Gem to track user activity in ruby on rails?","body":"\u003cp\u003eI am looking for a gem which should able track all user activities in detail without any manual work. It should work just by adding Include/require in models/controllers etc. Which should support rails 2.3.4 and ruby 1.9.3. Ex. like John created document with name XYZ 2 minutes ego. etc\u003c/p\u003e","answer_count":"2","comment_count":"4","creation_date":"2013-06-25 08:24:59.347 UTC","last_activity_date":"2014-10-25 08:01:28.103 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2374626","post_type_id":"1","score":"1","tags":"ruby-on-rails","view_count":"1065"} +{"id":"27333311","title":"Will two relaxed writes to the same location in different threads always be seen in the same order by other threads?","body":"\u003cp\u003eOn the x86 architecture, stores to the same memory location have a total order, e.g., see \u003ca href=\"http://youtu.be/WUfvvFD5tAA?t=19m58s\"\u003ethis video\u003c/a\u003e. What are the guarantees in the C++11 memory model?\u003c/p\u003e\n\n\u003cp\u003eMore precisely, in\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e-- Initially --\nstd::atomic\u0026lt;int\u0026gt; x{0};\n\n-- Thread 1 --\nx.store(1, std::memory_order_release);\n\n-- Thread 2 --\nx.store(2, std::memory_order_release);\n\n-- Thread 3 --\nint r1 = x.load(std::memory_order_acquire);\nint r2 = x.load(std::memory_order_acquire);\n\n-- Thread 4 --\nint r3 = x.load(std::memory_order_acquire);\nint r4 = x.load(std::memory_order_acquire);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewould the outcome \u003ccode\u003er1==1, r2==2, r3==2, r4==1\u003c/code\u003e be allowed (on some architecture other than x86)? What if I were to replace all \u003ccode\u003ememory_order\u003c/code\u003e's by \u003ccode\u003estd::memory_order_relaxed\u003c/code\u003e?\u003c/p\u003e","accepted_answer_id":"27333661","answer_count":"2","comment_count":"0","creation_date":"2014-12-06 15:43:14.683 UTC","favorite_count":"4","last_activity_date":"2014-12-06 16:20:00.827 UTC","last_edit_date":"2014-12-06 15:49:24.113 UTC","last_editor_display_name":"","last_editor_user_id":"1171688","owner_display_name":"","owner_user_id":"1171688","post_type_id":"1","score":"11","tags":"c++|c++11|concurrency|memory-model|stdatomic","view_count":"265"} +{"id":"7866401","title":"Functional tests, jQuery and assert_select_jquery","body":"\u003cp\u003eInside my app I'm using a jQuery plugin, FullCalendar - it is a jQuery calendar that looks like Google Calendar.\u003c/p\u003e\n\n\u003cp\u003eI would like to write a functional test (CalendarControllerTest \u0026lt; ActionController::TestCase) that tests the calendar is being displayed (CalendarController#index).\u003c/p\u003e\n\n\u003cp\u003eThat would be easy if the calendar was regular HTML, instead it is written in JavaScript so inside my HTML page I have:\u003c/p\u003e\n\n\n\n\u003cpre class=\"lang-html prettyprint-override\"\u003e\u003ccode\u003e\u0026lt;script src=\"fullcalendar.js\" type=\"text/javascript\"\u0026gt;\u0026lt;/script\u0026gt;\n\u0026lt;script src=\"calendar.js\" type=\"text/javascript\"\u0026gt;\u0026lt;/script\u0026gt;\n[...]\n\u0026lt;div id=\"calendar\"\u0026gt;\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eInside calendar.js (scaffolding from Rails 3.1 - CalendarController + calendar.js + calendar.css + CalendarControllerTest) I load FullCalendar:\u003c/p\u003e\n\n\n\n\u003cpre class=\"lang-js prettyprint-override\"\u003e\u003ccode\u003e$('#calendar').fullCalendar();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThus inside my functional test (CalendarControllerTest) this won't work:\u003c/p\u003e\n\n\n\n\u003cpre class=\"lang-rb prettyprint-override\"\u003e\u003ccode\u003e# Checks \u0026lt;div class=\"fc-content\"\u0026gt; is present i.e the calendar is being displayed\nassert_select '.fc-content', count: 1\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI tried to use assert_select_jquery without success:\u003c/p\u003e\n\n\n\n\u003cpre class=\"lang-rb prettyprint-override\"\u003e\u003ccode\u003eassert_select_jquery :html, '#calendar' do\n assert_select '.fc-content', count: 1\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI know about Webrat/Capybara but from what I see it is used for integration tests not functional tests.\u003c/p\u003e\n\n\u003cp\u003eHow would you do that?\u003c/p\u003e","accepted_answer_id":"9310531","answer_count":"1","comment_count":"0","creation_date":"2011-10-23 13:25:59.583 UTC","last_activity_date":"2012-02-16 11:31:05.093 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"990356","post_type_id":"1","score":"1","tags":"ruby-on-rails-3.1","view_count":"645"} +{"id":"42684604","title":"PreEmptive Protection Dotfuscator exe files","body":"\u003cp\u003eWhat is Map.Xml and Dotfuscator1.Xml files of PreEmptive Protection Dotfuscator exe file. Should I keep them for some reason or maybe it is needed for project exe file assembly? \u003c/p\u003e","accepted_answer_id":"42698046","answer_count":"1","comment_count":"0","creation_date":"2017-03-09 00:38:42.06 UTC","favorite_count":"2","last_activity_date":"2017-03-09 14:35:09.933 UTC","last_editor_display_name":"","owner_display_name":"user7248941","post_type_id":"1","score":"2","tags":"exe|executable|dotfuscator","view_count":"112"} +{"id":"35125643","title":"express response.render not work with ng-model","body":"\u003cp\u003eI want use ng-model to bind data sent from res.render(\"sub view path\", data), but it doesn't work! \u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003econtroller\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$state.go(\"elements.editElement\"\n , {\n \"elementId\": elementId,\n \"programId\": newVal,\n \"elementTypeId\": elementTypeId\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eState provider\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e.state('elements.editElement', {\n url: '/:elementTypeId/:elementId/:programId', \n views: {\n 'add@elements': {\n templateUrl: \n 'api/elements/editElement?elementTypeId=' + params.elementTypeId + '\u0026amp;elementId=' + params.elementId + '\u0026amp;programId=' + params.programId \n ,controller: 'elementCtrl'\n }\n }\n })\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003erender code\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar elementType = {eType: \"1\", Name:\"n1\", Family:\"f1\"}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003erender code\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003erouter.get('/definations/addPerson', function (req, res) { \n res.render('partials/sharedElements', elementType)\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003ejade\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ediv\n .row\n | Name\n input#Name(name=\"Name\" type=\"text\" ng-model=\"Name\")\n .row\n | Family\n input#Family(name=\"Family\" type=\"text\" ng-model=\"Family\")\n .row\n button(type=\"button\" name=\"btnSave\" ng-click=\"saveElement(#{eType})\") Save\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAfter rendering inputs are empty! However, when I set the value with \u003ccode\u003e#{}\u003c/code\u003e it works! for example : \u003ccode\u003evalue=\"#{Family}\"\u003c/code\u003e without ng-model. What's the problem here?\u003c/p\u003e\n\n\u003cp\u003eAfter render the html code is like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div id=\"ddd\" ui-view=\"add\" class=\"col-lg-7 col-md-5 col-sm-7 ng-scope\"\u0026gt;\n \u0026lt;div class=\"ng-scope\"\u0026gt;\u0026lt;div class=\"row\"\u0026gt;Name\n \u0026lt;input id=\"Name\" name=\"Name\" type=\"text\" ng-model=\"Name\" class=\"ng-pristine ng-valid ng-touched\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;div class=\"row\"\u0026gt;Family \u0026lt;input id=\"Family\" name=\"Family\" type=\"text\" ng-model=\"Family\" class=\"ng-pristine ng-untouched ng-valid\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;div class=\"row\"\u0026gt;\u0026lt;button type=\"button\" name=\"btnSave\" ng-click=\"saveElement(1)\"\u0026gt;Save\u0026lt;/button\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAdditional information: I use angular-ui to call the route.\u003c/p\u003e","answer_count":"0","comment_count":"8","creation_date":"2016-02-01 08:07:37.58 UTC","last_activity_date":"2016-02-01 08:59:43.597 UTC","last_edit_date":"2016-02-01 08:59:43.597 UTC","last_editor_display_name":"","last_editor_user_id":"4164585","owner_display_name":"","owner_user_id":"4164585","post_type_id":"1","score":"0","tags":"javascript|angularjs|node.js|express|pug","view_count":"62"} +{"id":"21125868","title":"Why does the singularity markup simply disappear from my .scss file?","body":"\u003cp\u003eI'm 3 days new to singularity and for the past 2 days have had the issue where only my singularity (\u003ccode\u003e$grids\u003c/code\u003e and \u003ccode\u003e$gutters\u003c/code\u003e) markup disappears from my .scss file. \u003c/p\u003e\n\n\u003cp\u003eI know that the markup has compiled because the grids and gutters are present and functional even though no longer present in the .scss.\u003c/p\u003e\n\n\u003cp\u003eThe most bizarre (possibly telling) part to the story is that commented singularity markup has never disappeared.\u003c/p\u003e\n\n\u003cp\u003eAnyone else experience this? Anyone have a solution?\u003c/p\u003e\n\n\u003cp\u003eosx 10.9.1/bbedit 10.5.7/compass (0.12.2)/sass (3.2.13)/singularitygs (1.1.2)\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-01-14 23:00:03.32 UTC","last_activity_date":"2014-01-16 13:51:45.38 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"682876","post_type_id":"1","score":"0","tags":"singularitygs","view_count":"28"} +{"id":"21114510","title":"Python - Reference Redirected Folder","body":"\u003cp\u003eDownloaded files location from Google Chrome is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\\\\WALL-E\\RedirectedFolders\\myname\\My Documents\\Downloads\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow do I reference this?\u003c/p\u003e\n\n\u003cp\u003eI cannot reference this in normal way like you do C: Drive.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epath='C:\\\\...'\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"21116187","answer_count":"2","comment_count":"0","creation_date":"2014-01-14 13:16:04.89 UTC","last_activity_date":"2014-01-14 18:47:53.353 UTC","last_edit_date":"2014-01-14 18:47:53.353 UTC","last_editor_display_name":"","last_editor_user_id":"168868","owner_display_name":"","owner_user_id":"2347337","post_type_id":"1","score":"0","tags":"python|windows|python-3.x|filepath","view_count":"66"} +{"id":"36661208","title":"Python regular expression match in html file","body":"\u003cp\u003eI am trying to match inside an html file. This is the html:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;td\u0026gt;\n\u0026lt;b\u0026gt;BBcode\u0026lt;/b\u0026gt;\u0026lt;br /\u0026gt;\n\u0026lt;textarea onclick='this.select();' style='width:300px; height:200px;' /\u0026gt;\n[URL=http://someimage.com/LwraZS1] [IMG]http://t1.someimage.com/LwraZS1.jpg[/IMG][ [/URL] [URL=http://someimage.com/CDnuiST] [IMG]http://t1.someimage.com/CDnuiST.jpg[/IMG] [/URL] [URL=http://someimage.com/Y0oZKPb][IMG]http://t1.someimage.com/Y0oZKPb.jpg[/IMG][/URL] [URL=http://someimage.com/W2RMAOR][IMG]http://t1.someimage.com/W2RMAOR.jpg[/IMG][/URL] [URL=http://someimage.com/5e5AYUz][IMG]http://t1.someimage.com/5e5AYUz.jpg[/IMG][/URL] [URL=http://someimage.com/EWDQErN][IMG]http://t1.someimage.com/EWDQErN.jpg[/IMG][/URL]\n\u0026lt;/textarea\u0026gt;\n\u0026lt;/td\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to extract all the BB code from [ to ] included. \u003c/p\u003e\n\n\u003cp\u003eAnd this is my code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport re\nx = open('/xxx/xxx/file.html', 'r').read\ny = re.compile(r\"\"\"\u0026lt;td\u0026gt; \u0026lt;b\u0026gt;BBcode\u0026lt;/b\u0026gt;\u0026lt;br /\u0026gt;\u0026lt;textarea onclick='this.select();' style='width:300px; height:200px;' /\u0026gt;. (. *) \u0026lt;/textarea\u0026gt; \u0026lt;/td\u0026gt;\"\"\") \nz = y.search(str(x())\nprint z \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut when i run this i get None object... Where is the mistake? \u003c/p\u003e","accepted_answer_id":"36665729","answer_count":"3","comment_count":"3","creation_date":"2016-04-16 07:03:43.99 UTC","last_activity_date":"2016-04-16 17:35:10.643 UTC","last_edit_date":"2016-04-16 17:35:10.643 UTC","last_editor_display_name":"","last_editor_user_id":"20938","owner_display_name":"","owner_user_id":"6208392","post_type_id":"1","score":"2","tags":"python|html|regex","view_count":"132"} +{"id":"25037509","title":"Java System.arraycopy resizes destination to source size?","body":"\u003cp\u003eHi I am trying to use System.arraycopy to copy a smaller array to a bigger one. This does work, but the destination is auto-resized to the source dimension. \u003c/p\u003e\n\n\u003cp\u003eI have to copy together a table for printing data. I want to copy 3 columns from table A into table C and than in a second step table B's 4th column als 4th column in C. The number of rows are in all cases the same. This idea fails because array copy seems to enforce the source dimensionality on the destination. This is kind of unexpected.\u003c/p\u003e\n\n\u003cp\u003eI do not want to iterate as this will take a long time if I use production-size data (\u003e1 million or more rows)). I thought arracopy would be nice and fast solution.... any work arounds?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public class Test {\n\n public static void main(String[] args) {\n Integer[][] s = new Integer[2][2];\n\n Integer[][] d = new Integer[3][3];\n\n System.out.println(d.length + \" \" + d[0].length);\n\n System.arraycopy(s, 0, d, 0, 2);\n\n System.out.println(d.length + \" \" + d[0].length);\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is how I call the API, anything wrong or is this resize avoidable?\u003c/p\u003e","accepted_answer_id":"25038675","answer_count":"2","comment_count":"2","creation_date":"2014-07-30 13:00:47.52 UTC","last_activity_date":"2014-07-31 10:56:41.403 UTC","last_edit_date":"2014-07-30 14:53:51.663 UTC","last_editor_display_name":"","last_editor_user_id":"1430550","owner_display_name":"","owner_user_id":"1430550","post_type_id":"1","score":"0","tags":"java|memory","view_count":"349"} +{"id":"47318935","title":"Program not exiting a while loop","body":"\u003cp\u003eI have a program that has two teams of characters \"battling each other\".\nThe two teams have to be set up in a queue like ADTs using linked lists which I believe I have set up correctly. The question I have is in my \u003ccode\u003efight()\u003c/code\u003e function.\nThere are while loops that check if one of the teams is empty like so\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ewhile(team1.isEmpty() == false \u0026amp;\u0026amp; team2.isEmpty() == false)\n{\n //Calls the attack functions in order of one team then the other\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe attack functions mentioned above look like this except vice versa for when team 2 is attacking. The important parts are that the \u003ccode\u003eremoveFront()\u003c/code\u003e function is called in this function which \"should\" remove the character that lost from its team and once this is done enough times, the team should be empty and thus the while loop in the \u003ccode\u003efight()\u003c/code\u003e function should be exited and the program should continue.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eint team1attack()\n{\n //Player 1 gets to attack\n attackVal = team1.attack();\n defendVal = team2.defend();\n dmg = attackVal - defendVal;\n if(dmg \u0026gt; 0)\n //Have the strength of the defending fighter change\n team2.setStrength(team2.getStrength()-dmg);\n\n //Check for death of combantant 2\n team2.hogwarts();\n if(team2.getStrength() \u0026lt;= 0)\n {\n winnerName = team1.getName();\n //Then the fighter at the head of team 2 has lost and must be removed from team 2 and added to the loserPile on top of the pile\n loserName = team2.getName();\n loserType = team2.getType();\n team2.removeFront();\n losers.addTop(loserType, loserName);\n //Also need to move the fighter at the top of team one to the back of the queue and heal it\n team1.moveToBack();\n team1Points++;\n if(team2.isEmpty() == false)\n {\n return 1;\n }\n\n else if(team2.isEmpty() == true)\n { \n return 2;\n }\n }\n else\n {\n return 0;\n }\n\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'll also include my \u003ccode\u003eremoveFront()\u003c/code\u003e function from the Team class in case the problem is in there\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evoid Team::removeFront()\n{\n TeamNode *nodePtr = nullptr;\n //Need to remove the first node from the queue\n //Start by taking the node at the head and removing it from the chain\n if(isEmpty())\n return;\n else\n nodePtr = head;\n head = head-\u0026gt;next;\n delete nodePtr;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy main concern with this is just figuring out why the while loop in the fight function won't exit. I can post the entire code of the fight function if that would be helpful.\u003c/p\u003e","answer_count":"0","comment_count":"4","creation_date":"2017-11-15 23:14:59.777 UTC","last_activity_date":"2017-11-15 23:55:53.237 UTC","last_edit_date":"2017-11-15 23:55:53.237 UTC","last_editor_display_name":"","last_editor_user_id":"7572026","owner_display_name":"","owner_user_id":"8877616","post_type_id":"1","score":"-1","tags":"c++|while-loop|linked-list|queue","view_count":"34"} +{"id":"37051737","title":"Record audio from an audio stream","body":"\u003cp\u003eI'm building an app that plays audio streams. Below is the code I have.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass ViewController: UIViewController {\n\n private var player: AVPlayer!\n private var kvoContext: UInt8 = 1\n\n override func viewDidLoad() {\n super.viewDidLoad()\n\n // Streaming\n let streamURL = NSURL(string: \"http://adsl.ranfm.lk/\")!\n player = AVPlayer(URL: streamURL)\n }\n\n @IBAction func didTapPlayButton(sender: UIButton) {\n NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(playerDidReachEnd(_:)), name: AVPlayerItemDidPlayToEndTimeNotification, object: nil)\n player.addObserver(self, forKeyPath: \"status\", options: NSKeyValueObservingOptions.New, context: \u0026amp;kvoContext)\n\n player.play()\n }\n\n override func observeValueForKeyPath(keyPath: String?, ofObject object: AnyObject?, change: [String : AnyObject]?, context: UnsafeMutablePointer\u0026lt;Void\u0026gt;) {\n if context == \u0026amp;kvoContext {\n print(\"Change at \\(keyPath) for \\(object)\")\n }\n\n if player.status == .Failed {\n print(\"AVPlayer Failed\")\n }\n\n if player.status == .ReadyToPlay {\n print(\"Ready to play\")\n player.play()\n }\n\n if player.status == .Unknown {\n print(\"AVPlayer Unknown\")\n }\n }\n\n func playerDidReachEnd(notification: NSNotification) {\n print(\"Reached the end of file\")\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis plays the stream successfully. Now I want to add the ability to record the audio from this stream.\u003c/p\u003e\n\n\u003cp\u003eBased on what I could find, the \u003ccode\u003eAVAudioRecorder\u003c/code\u003e class is only for recording audio through the microphone. Is there a way to record audio from a stream?\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2016-05-05 13:20:33.127 UTC","last_activity_date":"2016-05-05 13:20:33.127 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1077789","post_type_id":"1","score":"1","tags":"ios|swift|audio|avfoundation|avaudiorecorder","view_count":"111"} +{"id":"10567748","title":"Binary Search Tree formula for the number of structurally different trees that can exist with nodes that have either 0 or 1 children","body":"\u003cp\u003eI am trying to write a formula to find: \u003c/p\u003e\n\n\u003cp\u003e\"The number of structurally different binary trees that can exist with nodes that have either 0 or 1 children\". \u003c/p\u003e\n\n\u003cp\u003eHow would I go about doing this?\u003c/p\u003e","accepted_answer_id":"10567861","answer_count":"1","comment_count":"2","creation_date":"2012-05-12 22:07:35.267 UTC","last_activity_date":"2012-05-12 22:25:49.537 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1391566","post_type_id":"1","score":"-1","tags":"binary-search-tree","view_count":"710"} +{"id":"38396982","title":"Carousel transitioning affects footer links?","body":"\u003cp\u003eI'm at a lost with this one and was wondering if anyone else has had this issue before?\u003c/p\u003e\n\n\u003cp\u003eIf you scroll to the bottom, you'll see the carousel I'm talking about and if you wait till it transitions, or click on one of the indicators, it'll cause the links in the footer to become active temporarily.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://libre.colonization.co/\" rel=\"nofollow\"\u003ehttp://libre.colonization.co/\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"38397187","answer_count":"1","comment_count":"0","creation_date":"2016-07-15 13:10:15.003 UTC","last_activity_date":"2016-07-15 13:19:03.38 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2484090","post_type_id":"1","score":"2","tags":"html|css|twitter-bootstrap|carousel","view_count":"22"} +{"id":"40853618","title":"What errors get detected in \"build\" in Android Studio - role of Gradle","body":"\u003cp\u003eI'm transitioning over from Eclipse to Android Studio and I find that I'm still confused about the different components of Android Studio regarding detecting errors. I have a project with about 20 Java files and 30 XML files. I recently ran a clean and build and got \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eGradle build finished with 5 error(s) in 13s 397 ms\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eTwo XML files were indicated and in both of them there was whitespace in front of the first element with an error saying ...\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eXml declaration should precede all document content\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eSo I fixed those and ran the build again with no errors.\u003c/p\u003e\n\n\u003cp\u003eI then ran Lint and found \u003cstrong\u003e8 more XML files with errors\u003c/strong\u003e (NB, errors, not warning) saying \"\u003cem\u003eElement selector doesn't have required attribute:layout_height\u003c/em\u003e \". This error was apparently due to these files being in a layout folder instead of a drawable folder, although why that didn't cause problems in Eclipse is unclear.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eMy Questions\u003c/strong\u003e: \u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eWhy does Gradle Build only detect \u003cem\u003esome\u003c/em\u003e errors, but other have\nto be found via lint?\u003c/li\u003e\n\u003cli\u003eWhat categories of errors will be found via Gradle Build?\u003c/li\u003e\n\u003cli\u003eHow hard is it to add something to the Gradle Build script to find\n\u003cem\u003eall\u003c/em\u003e errors?\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdit:\u003c/strong\u003e actually this is also true for regular Java files - I'll get \"0 errors\" in the Gradle build and then I'll step into a source file in the debugger and see 4 errors from Lint.\u003c/p\u003e","accepted_answer_id":"40899970","answer_count":"1","comment_count":"1","creation_date":"2016-11-28 21:14:04.09 UTC","last_activity_date":"2016-11-30 23:31:55.323 UTC","last_edit_date":"2016-11-30 22:33:40.08 UTC","last_editor_display_name":"","last_editor_user_id":"316117","owner_display_name":"","owner_user_id":"316117","post_type_id":"1","score":"9","tags":"android|xml|android-studio|gradle","view_count":"423"} +{"id":"7239290","title":"using mysql string functions","body":"\u003cp\u003eI have a table with following Data in a table \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eabcd \nabcd , pgw \nABcd , Pgw\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want output as \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eAbcd\nAbcd , Pgw\nAbcd , Pgw\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethe First letter in capitals and letter after ',' in capital.\u003c/p\u003e","answer_count":"3","comment_count":"6","creation_date":"2011-08-30 06:04:49.363 UTC","last_activity_date":"2011-08-30 07:05:42.973 UTC","last_edit_date":"2011-08-30 06:07:34.027 UTC","last_editor_display_name":"","last_editor_user_id":"546999","owner_display_name":"","owner_user_id":"792290","post_type_id":"1","score":"0","tags":"mysql","view_count":"170"} +{"id":"9557712","title":"Get values from object through class","body":"\u003cpre\u003e\u003ccode\u003epublic class BlockType\n{\n public static BlockType Dirt_Block = new Block(\"Blah! values here\");\n}\n\npublic struct Block\n{\n public static string Value;\n\n public Block(string value)\n {\n value = value;\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs there any way I can get the value from DirtBlock? BlockType.Dirt_Block.Value Dosent work, Im not sure if this is possible, if not any ways to get the same result? (Theres more values, but I shortened it for size) Btw, Im accessing BlockType.Dirt.value from anouther class. I only want to get one value out of it though\u003c/p\u003e","accepted_answer_id":"9559811","answer_count":"4","comment_count":"2","creation_date":"2012-03-04 18:38:55.84 UTC","last_activity_date":"2012-03-06 00:22:45.29 UTC","last_edit_date":"2012-03-04 18:54:26.733 UTC","last_editor_display_name":"","last_editor_user_id":"1141063","owner_display_name":"","owner_user_id":"1218281","post_type_id":"1","score":"0","tags":"c#|class|static|xna","view_count":"223"} +{"id":"36683546","title":"How do I embed/isolate JS components (Google Maps) in an Angular2 app?","body":"\u003cp\u003eWhile attempting to embed a Google Maps (API v3) widget inside an Angular2 app, I discovered that there's a click/drag error that disturbs me. \u003c/p\u003e\n\n\u003cp\u003eI want to know if there's a good way I can embed the Google Map component it is isolated from Angular. Based on the stacktrace (below), it looks like Google Maps reaches an unexpected condition after Zone attempts to invoke a task. \u003c/p\u003e\n\n\u003cp\u003eSimple Plunkr example (runnable): \u003ca href=\"https://plnkr.co/edit/Tg3zwphygrgLUG5mq8Cc\" rel=\"nofollow\"\u003ehttps://plnkr.co/edit/Tg3zwphygrgLUG5mq8Cc\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eBacktrace after each bug click (in README.md):\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e- Angular: angular2-polyfills.js:324 Uncaught TypeError: Cannot read property 'Ra' of null\n- Google Maps: _.r.jl @ common.js:244\n- Google Maps: _.J.trigger @ js?key=NICE_TRY_HACKERS\u0026amp;callback=initMap:103\n- Google Maps: fx @ common.js:190\n- Google Maps: (anonymous function) @ common.js:189\n- Google Maps: _.J.trigger @ js?key=NICE_TRY_HACKERS\u0026amp;callback=initMap:103\n- Google Maps: _.r.Mm @ common.js:257_.r.Kn @ common.js:231\n- Angular: ZoneDelegate.invokeTask @ angular2-polyfills.js:423\n- Angular: Zone.runTask @ angular2-polyfills.js:320\n- Angular: ZoneTask.invoke @ angular2-polyfills.js:490\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eHTML (index.html):\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;!--\n Google Maps alongside Angular2\n =======================================\n See README.md\n --\u0026gt;\n \u0026lt;html\u0026gt;\n \u0026lt;head\u0026gt;\n \u0026lt;title\u0026gt;Angular 2 QuickStart\u0026lt;/title\u0026gt;\n \u0026lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"\u0026gt;\n\n \u0026lt;!-- 1. (Angular2) Load libraries --\u0026gt;\n \u0026lt;!-- IE required polyfills, in this exact order --\u0026gt;\n \u0026lt;script src=\"https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.35.0/es6-shim.js\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;script src=\"https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.26/system-polyfills.js\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;script src=\"https://cdnjs.cloudflare.com/ajax/libs/angular.js/2.0.0-beta.15/angular2-polyfills.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;script src=\"https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.26/system.src.js\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;script src=\"https://npmcdn.com/rxjs@5.0.0-beta.2/bundles/Rx.js\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;script src=\"https://cdnjs.cloudflare.com/ajax/libs/angular.js/2.0.0-beta.15/angular2.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\n\n \u0026lt;!-- 2. (Angular2) Configure SystemJS --\u0026gt;\n \u0026lt;script\u0026gt;\n System.import('main.js').then(null, console.error.bind(console));\n \u0026lt;/script\u0026gt;\n\n \u0026lt;/head\u0026gt;\n\n \u0026lt;!-- 3. (Angular2) Display the application --\u0026gt;\n \u0026lt;body\u0026gt;\n \u0026lt;my-app\u0026gt;Loading...\u0026lt;/my-app\u0026gt;\n\n \u0026lt;!-- 4. GOOGLE MAPS START, source: https://developers.google.com/maps/documentation/javascript/tutorial#The_Hello_World_of_Google_Maps_v3--\u0026gt;\n\n \u0026lt;style\u0026gt;\n html, body, #map {\n height: 100%;\n margin: 0;\n padding: 0;\n }\n \u0026lt;/style\u0026gt;\n\n \u0026lt;div id=\"map\"\u0026gt;\u0026lt;/div\u0026gt; \u0026lt;!-- Google Map goes here --\u0026gt;\n\n \u0026lt;script\u0026gt;\n var map;\n function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: -34.397, lng: 150.644},\n zoom: 8\n });\n }\n \u0026lt;/script\u0026gt;\n\n \u0026lt;script src=\"https://maps.googleapis.com/maps/api/js?key=NOTHING_TO_SEE_HERE\u0026amp;callback=initMap\" async defer\u0026gt;\u0026lt;/script\u0026gt;\n\n \u0026lt;!-- GOOGLE MAPS END --\u0026gt;\n\n \u0026lt;/body\u0026gt;\n \u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eAngular2 Bare-Bones App (main.ts)\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport {bootstrap} from 'angular2/platform/browser';\nimport {Component} from 'angular2/core';\n\n// Create Angular component\n@Component({\n selector: 'my-app',\n template: '\u0026lt;h1\u0026gt;My First Angular 2 App\u0026lt;/h1\u0026gt;'\n})\nexport class AppComponent { }\n\n// Bootstrap the component\nbootstrap(AppComponent);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eObservations:\u003c/strong\u003e \u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eEvery click triggers an error\u003c/li\u003e\n\u003cli\u003eError seems to be non-critical, but best not to proceed on shaky ground\u003c/li\u003e\n\u003cli\u003eStacktrace suggests Google Maps (_.r.jl @ common.js:244) is surprised by a task invoked by Angular2's Zone (ZoneDelegate.invokeTask @ angular2-polyfills.js)\u003c/li\u003e\n\u003cli\u003eThe widget works in a bare-bones app, but complains in Angular\u003c/li\u003e\n\u003c/ul\u003e","accepted_answer_id":"36704415","answer_count":"1","comment_count":"0","creation_date":"2016-04-17 23:59:16.657 UTC","last_activity_date":"2016-04-18 21:15:35.087 UTC","last_edit_date":"2016-04-18 00:44:23.843 UTC","last_editor_display_name":"","last_editor_user_id":"3945392","owner_display_name":"","owner_user_id":"122961","post_type_id":"1","score":"2","tags":"google-maps|google-maps-api-3|angular|zonejs","view_count":"351"} +{"id":"12776763","title":"How to maintain the state of a particular button in a UITableView (i.e. stop overwriting an image)","body":"\u003cp\u003eI have an iPhone app problem that's been bugging me for a few days and it really doesn't seem like it should be this difficult so I'm sure I'm missing something obvious. I have researched plenty of forum discussions on \"similar\" topics but nothing that actually addresses this issue, specifically.\u003c/p\u003e\n\n\u003cp\u003eTo be clear, if there is some piece of documentation or some other source that I should research, please point me in the right direction.\u003c/p\u003e\n\n\u003cp\u003eHere goes...\u003c/p\u003e\n\n\u003cp\u003eI have a list of items that I display to the user within a table (uitableview). The cell (uitableviewcell) for each item is custom and contains two image buttons(uibuttons: green and red). As expected, for each item in the the table, the user can click any of the buttons. Based on a parameter called monitoringRequestType for a button, the button calls a separate process to update the server. If the state is \"Approved\",the image changes to 'alreadyapproved' and 'reject' respectively. So when I click on the red button, server updates the state to \"Rejected\" and image then changes to 'approve' and 'alreadyrejected'. \nSimple, right?\u003c/p\u003e\n\n\u003cp\u003eSo, here is the issue:\u003c/p\u003e\n\n\u003cp\u003eOn clicking the reject button, the 'approve' image comes on top of the 'alreadyapproved' image (so both images can be seen) while 'alreadyrejected' image works fine.For brevity, I am only including the relevant code here (hopefully formatted properly):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCellForRow:\nif(indexPath.section==0){\n NSDictionary *dict=[saveJson objectAtIndex:indexPath.row];\n NSString* sMonitoringType = [dict valueForKey:@\"monitoringType\"];\n UIButton *button1= [[UIButton alloc] initWithFrame:CGRectMake(230,10,40,40)];\n UIButton *button2= [[UIButton alloc] initWithFrame:CGRectMake(280,10,40,40)];\n if([sMonitoringType compare:@\"Pending\"] == NSOrderedSame){\n [button1 setImage:[UIImage imageNamed:@\"approve\"] \n forState:UIControlStateNormal];\n [button1 addTarget:self\n action:@selector(greenButtonPressed:withEvent:) \n forControlEvents:UIControlEventTouchUpInside];\n button1.tag= indexPath.row; \n [button2 setImage:[UIImage imageNamed:@\"reject\"]\n forState:UIControlStateNormal];\n [button2 addTarget:self\n action:@selector(redButtonPressed:withEvent:) \n forControlEvents:UIControlEventTouchUpInside];\n button2.tag= indexPath.row; \n } else if([sMonitoringType compare:@\"Approved\"] == NSOrderedSame){\n [button1 setImage:[UIImage imageNamed:@\"alreadyapproved\"] \n forState:UIControlStateNormal];\n [button2 setImage:[UIImage imageNamed:@\"reject\"]\n forState:UIControlStateNormal];\n [button2 addTarget:self\n action:@selector(redButtonPressed:withEvent:) \n forControlEvents:UIControlEventTouchUpInside];\n button2.tag= indexPath.row;\n } else if([sMonitoringType compare:@\"Rejected\"] == NSOrderedSame){\n [button1 setImage:[UIImage imageNamed:@\"approve\"] \n forState:UIControlStateNormal];\n [button2 setImage:[UIImage imageNamed:@\"alreadyrejected\"] \n forState:UIControlStateNormal];\n [button1 addTarget:self\n action:@selector(greenButtonPressed:withEvent:) \n forControlEvents:UIControlEventTouchUpInside];\n button1.tag= indexPath.row;\n }\n [cell addSubview:button1];\n [cell addSubview:button2];\n [button1 release];\n [button2 release];\n}\nreturn cell;\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"12776898","answer_count":"1","comment_count":"0","creation_date":"2012-10-08 07:00:53.47 UTC","last_activity_date":"2012-10-08 08:45:44.61 UTC","last_edit_date":"2012-10-08 07:04:56.6 UTC","last_editor_display_name":"","last_editor_user_id":"1723493","owner_display_name":"","owner_user_id":"1727927","post_type_id":"1","score":"3","tags":"iphone|objective-c|ios|uitableview|uibutton","view_count":"326"} +{"id":"41987499","title":"TextArea LTR/RTL","body":"\u003cp\u003eI have a simple html textarea, the body has RTL style and so textarea inherits the style from body. So the problem is following.\u003c/p\u003e\n\n\u003cp\u003eProblem:\nI have to display the following text into text area using $(\"#myTextArea\").val(\"text from an ajax result comes here\").\u003c/p\u003e\n\n\u003cp\u003eThe text is following,\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eپاکستان کا کل رقبہ 796096-0-0 مربع کلو میٹرز ہے۔\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand the rest of the text is similar and takes several lines. Now the number in the Urdu text is actually 796096-0-0 but it is displayed reverse. There are several such numbers throughout the text. Please tell me a way that I could display the numbers as LTR and the rest of the text as RTL as usual.\u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","answer_count":"3","comment_count":"0","creation_date":"2017-02-01 18:56:05.897 UTC","last_activity_date":"2017-06-06 20:21:57.057 UTC","last_edit_date":"2017-06-06 20:21:57.057 UTC","last_editor_display_name":"","last_editor_user_id":"1959732","owner_display_name":"","owner_user_id":"3710908","post_type_id":"1","score":"1","tags":"html|textarea|right-to-left|urdu","view_count":"216"} +{"id":"12941475","title":"Matlab - change dotted line to solid","body":"\u003cp\u003eHow do I chage my dotted line in plot??? I know it is done like this \u003ccode\u003eplot(x, y, '-')\u003c/code\u003e but even if I put it in there I get dotted line\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enaj_cas = 0;\nuhol_deg = -5;\nv = 20;\ng = 9.80665;\n\nwhile uhol_deg \u0026lt; 85\n uhol_deg = uhol_deg + 10;\n uhol_rad = degtorad(uhol_deg);\n\n for t = 0:.1:5\n x = v * t * cos(uhol_rad);\n y = v * t * sin(uhol_rad) - 0.5 * g * t^2;\n axis([0 50 0 25])\n subplot(211);\n plot(x, y)\n hold on\n end\nend\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"4","creation_date":"2012-10-17 19:03:30.387 UTC","last_activity_date":"2012-10-17 19:30:03.26 UTC","last_edit_date":"2012-10-17 19:15:35.277 UTC","last_editor_display_name":"","last_editor_user_id":"1644189","owner_display_name":"","owner_user_id":"1453846","post_type_id":"1","score":"0","tags":"matlab|plot|line|dotted-line","view_count":"1480"} +{"id":"30377871","title":"google analytics is showing an odd page on my site","body":"\u003cp\u003eWe pushed a small UI change to the site last night. The google analytics code is in the header and has not been touched at all (entire header for the site and all the pages have not been touched at all)\u003c/p\u003e\n\n\u003cp\u003eSince the change, we are seeing a lot of hits logged to the page \"/site/loading\" which is not a page on our site. Even when we visit the site to test, we are occasionally seeing the active page show up as \"/site/loading\" instead of \"/\" or the specific page we are visiting. The pages are loading fine and the site is working fine. The error is happening somewhat randomly. Occasionally when someone visits the home page, it shows up as \"/site/loading\" and occasionally shows up correctly as \"/\"\u003c/p\u003e\n\n\u003cp\u003eUnclear why this is happening or what we might have done to trigger this changed behavior. Until yesterday, our tracking seemed fairly accurate. \u003c/p\u003e\n\n\u003cp\u003eAppreciate any ideas or suggestions\u003c/p\u003e","accepted_answer_id":"30378438","answer_count":"2","comment_count":"4","creation_date":"2015-05-21 15:18:37.307 UTC","last_activity_date":"2015-05-21 15:45:44.71 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4592011","post_type_id":"1","score":"0","tags":"php|google-analytics","view_count":"44"} +{"id":"33584184","title":"Change marker position - ui-gmap-google-map","body":"\u003cp\u003eI have problem with marker in ui-gmap-google-map. I want change position my marker but when I selected other city my marker doesn't wants change position. \nCan anybody help?\u003c/p\u003e\n\n\u003cp\u003eContoller\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e setListeners = () -\u0026gt; \n $scope.$watch('selectedField.id', (val) -\u0026gt;\n if val \n $scope.marker = {\n id: 0,\n coords: {\n latitude: val.marker.latitude\n longitude: val.marker.longitude\n },\n }\n , true)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eView\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;ui-select ng-model=\"selectedField.id\" theme=\"select2\"\u0026gt;\n \u0026lt;ui-select-match\u0026gt;\n \u0026lt;span ng-bind=\"$select.selected.street\"\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;/ui-select-match\u0026gt;\n \u0026lt;ui-select-choices repeat=\"item in (fieldsList | filter: $select.search)\"\u0026gt;\n \u0026lt;span ng-bind=\"item.street\"\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;/ui-select-choices\u0026gt;\n\u0026lt;/ui-select\u0026gt;\n\n...\n\n\u0026lt;ui-gmap-google-map center='map.center' zoom='map.zoom'\u0026gt;\n \u0026lt;ui-gmap-marker\n idKey='marker.id'\n coords='marker.coords'\n options='marker.options'\n \u0026gt;\n \u0026lt;/ui-gmap-marker\u0026gt;\n\u0026lt;/ui-gmap-google-map\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"2","creation_date":"2015-11-07 15:02:30.163 UTC","last_activity_date":"2015-11-07 15:02:30.163 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3439445","post_type_id":"1","score":"1","tags":"angularjs|google-maps","view_count":"306"} +{"id":"18684243","title":"View returning null","body":"\u003cp\u003eOutline of my code is :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class MainActivity extends Activity {\nClient client;\nMyImageView iv;\nBitmap b;\n@Override\nprotected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n MyImageView iv = new MyImageView(this);\n Bitmap bMap = BitmapFactory.decodeResource(getResources(), R.drawable.untitled);\n iv=(MyImageView)findViewById(R.id.ImageView1);}\n iv.setImageBitmap(bMap);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eXML\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" encoding=\"utf-8\"?\u0026gt;\n\u0026lt;LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\nandroid:id=\"@+id/parent\"\nandroid:layout_width=\"fill_parent\"\nandroid:layout_height=\"fill_parent\"\nandroid:orientation=\"vertical\" \u0026gt;\n\u0026lt;com.example.zooming.MyImageView\n android:id=\"@+id/ImageView1\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"match_parent\"\n android:layout_gravity=\"center\"\n android:adjustViewBounds=\"true\"\n android:clickable=\"true\"\n android:scaleType=\"matrix\" /\u0026gt;\n\u0026lt;/LinearLayout\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMyImgaeView.java\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eMyImageView extends View {\n public MyImageView(Context ct){\n super(ct);\n //some other works\n gestureDetector = new GestureDetector(new MyGestureDetector());\n new ConnectTask().execute(\"\");\n }\n //Other code\n class MyGestureDetector extends SimpleOnGestureListener {\n @Override\n public boolean onDoubleTap(MotionEvent event) { \n iv=(MyImageView)findViewById(R.id.ImageView1);\n Bitmap bMap = BitmapFactory.decodeResource(getResources(), R.drawable.sample);\n iv.setImageBitmap(bMap);\n return true;\n }\n\n }\n class connectTask extends AsyncTask\u0026lt;String,Bitmap,Bitmap\u0026gt; \n {\n @Override\n protected Bitmap doInBackground(String... message) {\n //some code to get the bitmap\n publishProgress(mybitmap);\n return null;\n }\n\n @Override\n public void onProgressUpdate(Bitmap... values) {\n super.onProgressUpdate(values);\n iv=(MyImageView)findViewById(R.id.ImageView1);\n if(iv==null)\n Log.i(\"Exception\",ex.toString());\n iv.setImageBitmap(values[0]);\n }\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eiv is always returning null in ConnectTask(AsynTask) while its working fine in MyGestureDetector...why? also when i am making the ConnectTask the inner class of MainActivity then its working fine...!!\u003c/p\u003e","accepted_answer_id":"18684995","answer_count":"2","comment_count":"9","creation_date":"2013-09-08 13:31:11.473 UTC","last_activity_date":"2013-09-08 15:00:50.493 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2671932","post_type_id":"1","score":"0","tags":"android|view|android-asynctask","view_count":"92"} +{"id":"13082942","title":"Could not align social buttons horizontally","body":"\u003cp\u003eFirst of all, and before someone closes this question as \"exact copy\", I searched the site for and answer and couldn't find any which could help :)\u003c/p\u003e\n\n\u003cp\u003eI have a web page which has a social bar looks kinda like \u003ca href=\"http://twitter.github.com/bootstrap/\" rel=\"nofollow noreferrer\"\u003eBootstrap\u003c/a\u003e social bar in their front page. My site uses \u003ca href=\"http://twitter.github.com/bootstrap/\" rel=\"nofollow noreferrer\"\u003eBootstrap\u003c/a\u003e as the site template.\u003c/p\u003e\n\n\u003cp\u003eMy problem with social buttons. I added Google+, Twitter and Facebook button and now I'm struggling in aligning correctly... thanks to Facebook button.\u003c/p\u003e\n\n\u003cp\u003eThe code I'm using is exactly the same official code from the 3 social networks and I placed each button in an \u003ccode\u003e\u0026lt;li\u0026gt;\u003c/code\u003e of a \u003ccode\u003e\u0026lt;ul\u0026gt;\u003c/code\u003e (again, refer to \u003ca href=\"http://twitter.github.com/bootstrap/\" rel=\"nofollow noreferrer\"\u003eBootstrap\u003c/a\u003e front page for an example). Note: I added some background colour and some padding for make things clear.\u003c/p\u003e\n\n\u003cp\u003eThe result of that is the image you see below (screen-shot from IE). Google+ and Twitter play nicely while Facebook makes things hard... or is it the opposite?\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/Li1IW.png\" alt=\"Social buttons\"\u003e\u003c/p\u003e\n\n\u003cp\u003eIt's the same behaviour in all browsers I used for testing (IE, Firefox, Chrome and Opera)\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eUPDATE\u003c/strong\u003e: Visit this \u003ca href=\"http://jsfiddle.net/FYCMb/\" rel=\"nofollow noreferrer\"\u003eFiddle\u003c/a\u003e to see an example.\u003c/p\u003e","accepted_answer_id":"13084474","answer_count":"1","comment_count":"2","creation_date":"2012-10-26 07:52:41.07 UTC","favorite_count":"1","last_activity_date":"2012-10-26 09:41:16.933 UTC","last_edit_date":"2012-10-26 09:27:58.64 UTC","last_editor_display_name":"","last_editor_user_id":"121097","owner_display_name":"","owner_user_id":"121097","post_type_id":"1","score":"0","tags":"twitter-bootstrap|facebook-like|google-plus-one","view_count":"2155"} +{"id":"10009858","title":"How can I Hide XML Fields And Reuse that file for Another Activity?","body":"\u003cp\u003eI want hide some fields in existed XML and use that XML as Input for Another Activity \u003c/p\u003e\n\n\u003cp\u003eThanks in Advance.....\u003c/p\u003e","accepted_answer_id":"10010223","answer_count":"1","comment_count":"5","creation_date":"2012-04-04 11:06:21.32 UTC","last_activity_date":"2012-04-04 11:31:51.523 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1208536","post_type_id":"1","score":"-1","tags":"android|xml|reusability","view_count":"464"} +{"id":"18785168","title":"cmake: check if file exists at build time rather than during cmake configuration","body":"\u003cp\u003eI have a custom build command that needs to check if a certain file exists. I tried using\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eIF(EXISTS \"/the/file\")\n...\nELSE()\n...\nENDIF()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut that test is only evaluated one; when cmake is first run. I need it to perform the test every time a make is done. What's the method to check at make-time? Thanks.\u003c/p\u003e","accepted_answer_id":"18800704","answer_count":"1","comment_count":"1","creation_date":"2013-09-13 11:25:26.587 UTC","favorite_count":"1","last_activity_date":"2013-09-14 10:20:36.25 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"811244","post_type_id":"1","score":"1","tags":"file|cmake|exists","view_count":"4017"} +{"id":"5126017","title":"verify creation of database objects such as triggers, procedures , permissions","body":"\u003cp\u003eI am creating triggers \u0026amp; procedures on a table from a winform application which uses sql server 2005 express. \u003c/p\u003e\n\n\u003cp\u003eI want that when the user clicks the create trigger/procedure button, then it creates both the objects \u0026amp; displays on a new Form that triggers \u0026amp; procedures are created with the names and tables on which they are created. \u003c/p\u003e\n\n\u003cp\u003eI mean that how do i verify that the objects are created. i want to verify and show it to the user that the objects are created on the so and so table. \u003c/p\u003e","accepted_answer_id":"5126037","answer_count":"1","comment_count":"0","creation_date":"2011-02-26 09:07:29.943 UTC","last_activity_date":"2011-02-26 09:11:10.667 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"613929","post_type_id":"1","score":"0","tags":"sql|database|object|verification|creation","view_count":"201"} +{"id":"39189210","title":"Solr indixing large content website","body":"\u003cp\u003eI am using Solr 5.2 , I have a website with large content (bilingual), that needs to be indexed for search functionality, I need to index some meta data about each content (category, title, date,..), and I also need to index the content of the webpage, based on your knowledge and experience, is it correct to copy all the fields in a single field, and use this field for search, I am doing the following now\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;fieldType name=\"compound_text\" class=\"solr.TextField\" positionIncrementGap=\"100\" multiValued=\"true\"\u0026gt;\n \u0026lt;analyzer\u0026gt;\n \u0026lt;tokenizer class=\"solr.StandardTokenizerFactory\"/\u0026gt;\n \u0026lt;filter class=\"solr.StopFilterFactory\" words=\"lang/stopwords_en.txt\" ignoreCase=\"true\"/\u0026gt;\n \u0026lt;filter class=\"solr.StopFilterFactory\" words=\"lang/stopwords_ar.txt\" ignoreCase=\"true\"/\u0026gt;\n \u0026lt;filter class=\"solr.ArabicNormalizationFilterFactory\"/\u0026gt;\n \u0026lt;filter class=\"solr.LowerCaseFilterFactory\"/\u0026gt;\n \u0026lt;/analyzer\u0026gt; \n\u0026lt;/fieldType\u0026gt;\n\u0026lt;field name=\"compound_text_field\" type=\"compound_text\" multiValued=\"true\" indexed=\"true\" stored=\"true\"/\u0026gt; \n\u0026lt;field name=\"author_name\" type=\"strings\" indexed=\"false\" stored=\"false\"/\u0026gt;\n\u0026lt;field name=\"category\" type=\"strings\" indexed=\"false\" stored=\"true\"/\u0026gt;\n\u0026lt;field name=\"content_ar\" type=\"strings\" indexed=\"false\" stored=\"true\"/\u0026gt;\n\u0026lt;field name=\"content_en\" type=\"strings\" indexed=\"false\" stored=\"true\"/\u0026gt;\n\u0026lt;field name=\"content_title\" type=\"compound_text\" indexed=\"true\" stored=\"true\" multiValued=\"true\"/\u0026gt;\n\u0026lt;field name=\"publish_date\" type=\"tdate\"/\u0026gt;\n\u0026lt;copyField source=\"content_ar\" dest=\"compound_text_field\"/\u0026gt;\n\u0026lt;copyField source=\"content_en\" dest=\"compound_text_field\"/\u0026gt;\n\u0026lt;copyField source=\"content_title\" dest=\"compound_text_field\"/\u0026gt;\n\u0026lt;copyField source=\"source\" dest=\"compound_text_field\"/\u0026gt;\n\u0026lt;copyField source=\"category\" dest=\"compound_text_field\"/\u0026gt;\n\u0026lt;copyField source=\"author_name\" dest=\"compound_text_field\"/\u0026gt; \n\u0026lt;fieldType name=\"text_suggest\" class=\"solr.TextField\" positionIncrementGap=\"100\"\u0026gt;\n \u0026lt;analyzer\u0026gt;\n \u0026lt;tokenizer class=\"solr.StandardTokenizerFactory\"/\u0026gt;\n \u0026lt;filter class=\"solr.ArabicNormalizationFilterFactory\"/\u0026gt;\n \u0026lt;filter class=\"solr.LowerCaseFilterFactory\"/\u0026gt;\n \u0026lt;/analyzer\u0026gt;\n\u0026lt;/fieldType\u0026gt;\n\u0026lt;field name=\"text_suggest_field\" type=\"text_suggest\" indexed=\"true\" stored=\"true\"/\u0026gt;\n\u0026lt;copyField source=\"content_title\" dest=\"text_suggest_field\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"1","creation_date":"2016-08-28 08:06:19.747 UTC","last_activity_date":"2016-08-29 06:42:35.7 UTC","last_edit_date":"2016-08-28 08:17:43.583 UTC","last_editor_display_name":"","last_editor_user_id":"1711804","owner_display_name":"","owner_user_id":"1711804","post_type_id":"1","score":"0","tags":"solr|full-text-search","view_count":"46"} +{"id":"22345927","title":"Duplicate Symbol Error for architecture i386?","body":"\u003cp\u003eI am getting following error while build app.\u003c/p\u003e\n\n\u003cp\u003eI have checked the following things but still error not gone\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e1. file exists twice.\n2. Import \".m\" intead of .h\n3. `File missing`\n4. Duplicate function\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny other thing too check?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e duplicate symbol _downloadCompleted in:\n /Xcode/DerivedData/WAI2go-ckzrqcnbjsisokcplqkvzwxhclrg/Build/Intermediates/WAI2go.build/Debug-iphonesimulator/WAI2go.build/Objects-normal/i386/Middleware.o\n Xcode/DerivedData/WAI2go-ckzrqcnbjsisokcplqkvzwxhclrg/Build/Intermediates/WAI2go.build/Debug-iphonesimulator/WAI2go.build/Objects-normal/i386/ZipArchive.o\nduplicate symbol _onDownloadCompleted in:\n Developer/Xcode/DerivedData/WAI2go-ckzrqcnbjsisokcplqkvzwxhclrg/Build/Intermediates/WAI2go.build/Debug-iphonesimulator/WAI2go.build/Objects-normal/i386/Middleware.o\n Library/Developer/Xcode/DerivedData/WAI2go-ckzrqcnbjsisokcplqkvzwxhclrg/Build/Intermediates/WAI2go.build/Debug-iphonesimulator/WAI2go.build/Objects-normal/i386/ZipArchive.o\nduplicate symbol _onImageDownloadCompleted in:\n Developer/Xcode/DerivedData/WAI2go-ckzrqcnbjsisokcplqkvzwxhclrg/Build/Intermediates/WAI2go.build/Debug-iphonesimulator/WAI2go.build/Objects-normal/i386/Middleware.o\n Developer/Xcode/DerivedData/WAI2go-ckzrqcnbjsisokcplqkvzwxhclrg/Build/Intermediates/WAI2go.build/Debug-iphonesimulator/WAI2go.build/Objects-normal/i386/ZipArchive.o\nld: 3 duplicate symbols for architecture i386\nclang: error: linker command failed with exit code 1 (use -v to see invocation)\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"22346760","answer_count":"2","comment_count":"7","creation_date":"2014-03-12 08:33:34.163 UTC","last_activity_date":"2014-03-12 09:14:33.273 UTC","last_edit_date":"2014-03-12 08:38:34.84 UTC","last_editor_display_name":"","last_editor_user_id":"2401215","owner_display_name":"","owner_user_id":"2401215","post_type_id":"1","score":"0","tags":"ios|xcode","view_count":"125"} +{"id":"27378714","title":"clearTextField() is not working in UIAutomator","body":"\u003cp\u003ei am new bee to uiautomator and when i am trying to clear the text field text with clearTextField() its not at all clearing. Can some one guide me how can i do this.\u003c/p\u003e\n\n\u003cp\u003etried in this way also \u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003ewhile(!\"\".equals(obj.getText())\nobj.clearTextField();\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eThanks in advance.\u003c/p\u003e","answer_count":"2","comment_count":"2","creation_date":"2014-12-09 12:14:09.707 UTC","last_activity_date":"2015-09-02 15:24:40.723 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1097774","post_type_id":"1","score":"1","tags":"uiautomator|android-uiautomator","view_count":"662"} +{"id":"29162338","title":"Access violation error while creating linked list","body":"\u003cp\u003eTrying to create Lined List. I am having problem in the \u003ccode\u003edeleteNode\u003c/code\u003e function created in LinkedList.cpp file. Experiencing given error \u003c/p\u003e\n\n\u003cp\u003eUnhandled exception at 0x00D04C3C in LinkedList.exe: 0xC0000005: Access violation reading location 0x00000004.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprevious-\u0026gt;link = temp-\u0026gt;link;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eLinkedList.h file\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass Node\n{\npublic:\n int data;\n Node *link;\n};\nclass LList\n{\nprivate:\nNode *Head, *Tail;\n//void recursiveTraverse(Node *);\npublic:\n LList();\n ~LList();\n void create();\n Node *getNode();\n void append(Node *);\n void insert(Node *, int);\n void rtraverse();\n void deleteNode(int);\n void display();\n};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eLinkedList.cpp\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e #include \"stdafx.h\"\n#include \"LinkedList.h\"\n#include \u0026lt;iostream\u0026gt;\nusing namespace std;\nLList::LList()\n{\n Head = nullptr; Tail = nullptr;\n}\nLList::~LList()\n{\n Node *Temp;\n while (Head != nullptr)\n {\n Temp = Head;\n Head = Head-\u0026gt;link;\n delete Temp;\n }\n}\nvoid LList::create()\n{\n char choice;\n Node *newNode = nullptr;\n\n while (5)\n {\n cout \u0026lt;\u0026lt; \"Enter Data in the List (Enter N to cancel) \";\n cin \u0026gt;\u0026gt; choice;\n if (choice == 'n' || choice == 'N')\n {\n break;\n }\n newNode = getNode();\n append(newNode);\n\n }\n\n}\n\nNode *LList::getNode()\n{\n Node *temp = new Node;\n //cout \u0026lt;\u0026lt; \"Enter Data in the List\";\n cin \u0026gt;\u0026gt; temp-\u0026gt;data;\n temp-\u0026gt;link = nullptr;\n return temp;\n}\nvoid LList::append(Node *temp)\n{\n if (Head == nullptr)\n {\n Head = temp;\n Tail = temp;\n }\n else\n {\n Tail-\u0026gt;link = temp;\n Tail = temp;\n }\n}\nvoid LList::display()\n{\n Node *temp = Head;\n if (temp == nullptr)\n {\n cout \u0026lt;\u0026lt; \"No Item in the List\" \u0026lt;\u0026lt; endl;\n }\n else\n {\n while (temp != nullptr)\n {\n cout \u0026lt;\u0026lt; temp-\u0026gt;data \u0026lt;\u0026lt; \"\\t\";\n temp = temp-\u0026gt;link;\n }\n cout \u0026lt;\u0026lt; endl;\n }\n}\nvoid LList::insert(Node *newNode, int position)\n{\n int count = 0; Node *temp, *previous = nullptr;\n temp = Head;\n if (temp == nullptr)\n {\n Head = newNode;\n Tail = newNode;\n }\n else\n {\n while (temp == nullptr || count \u0026lt; position)\n {\n count++;\n previous = temp;\n temp = temp-\u0026gt;link;\n }\n previous-\u0026gt;link = newNode;\n newNode-\u0026gt;link = temp; \n }\n\n}\nvoid LList::deleteNode(int position)\n{\n int count = 1; Node * temp, *previous = nullptr;\n temp = Head;\n if (temp == nullptr)\n {\n cout \u0026lt;\u0026lt; \"No Data to delete.\" \u0026lt;\u0026lt; endl;\n }\n else\n {\n while (count \u0026lt;= position + 1)\n {\n if (position == count + 1)\n {\n count++;\n previous = temp;\n previous-\u0026gt;link = temp-\u0026gt;link;\n }\n else if (count == position + 1)\n {\n count++;\n previous-\u0026gt;link = temp-\u0026gt;link;\n }\n count++;\n temp = temp-\u0026gt;link;\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMain.cpp goes here\u003c/p\u003e","accepted_answer_id":"29162470","answer_count":"2","comment_count":"0","creation_date":"2015-03-20 08:31:21.953 UTC","favorite_count":"0","last_activity_date":"2015-03-20 09:06:55.647 UTC","last_edit_date":"2015-03-20 09:06:55.647 UTC","last_editor_display_name":"","last_editor_user_id":"3358570","owner_display_name":"","owner_user_id":"3358570","post_type_id":"1","score":"-1","tags":"c++|class|visual-c++|linked-list","view_count":"137"} +{"id":"4953892","title":"versioning of the content","body":"\u003cp\u003eI am developing a PHP/mysql package to add/edit questionnaire.. I want some pakage to save the versions of edits of questions and rollback to previous version. can anyone suggest such package..?\u003c/p\u003e","accepted_answer_id":"4953939","answer_count":"1","comment_count":"0","creation_date":"2011-02-10 05:59:56 UTC","last_activity_date":"2011-02-10 06:20:37.377 UTC","last_edit_date":"2011-02-10 06:20:37.377 UTC","last_editor_display_name":"","last_editor_user_id":"435962","owner_display_name":"","owner_user_id":"435962","post_type_id":"1","score":"1","tags":"php|versioning","view_count":"179"} +{"id":"2230244","title":"Python, next iteration of the loop over a loop","body":"\u003cp\u003eI need to get the next item of the first loop given certain condition, but the condition is in the inner loop. Is there a shorter way to do it than this? (test code)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e ok = 0\n for x in range(0,10):\n if ok == 1:\n ok = 0\n continue\n for y in range(0,20): \n if y == 5:\n ok = 1\n continue\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat about in this situation?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efor attribute in object1.__dict__:\n object2 = self.getobject()\n if object2 is not None:\n for attribute2 in object2: \n if attribute1 == attribute2:\n # Do something\n #Need the next item of the outer loop\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe second example shows better my current situation. I dont want to post the original code because it's in spanish. object1 and object2 are 2 very different objects, one is of object-relational mapping nature and the other is a webcontrol. But 2 of their attributes have the same values in certain situations, and I need to jump to the next item of the outer loop.\u003c/p\u003e","accepted_answer_id":"2230304","answer_count":"5","comment_count":"1","creation_date":"2010-02-09 15:38:58.95 UTC","favorite_count":"2","last_activity_date":"2016-08-04 16:20:13.26 UTC","last_edit_date":"2016-08-04 16:20:13.26 UTC","last_editor_display_name":"","last_editor_user_id":"197283","owner_display_name":"","owner_user_id":"197283","post_type_id":"1","score":"10","tags":"python","view_count":"21396"} +{"id":"39498177","title":"Hive User Impersonation for Sentry","body":"\u003cp\u003eI was reading on that for while using sentry you must disable hive user impersonation.\u003c/p\u003e\n\n\u003cp\u003eIs it necessary to disable to impersonation? If Yes is there any other way to impersonate hive user with sentry enabled?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-09-14 19:25:47.277 UTC","last_activity_date":"2016-09-16 07:07:46.103 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4456534","post_type_id":"1","score":"1","tags":"hadoop|hive|cloudera|cloudera-sentry","view_count":"535"} +{"id":"14325175","title":"Does Titanium Studio have an \"Immediate Window\"?","body":"\u003cp\u003eI'm new to Titanium Studio and am wondering, does it had an equivalent to Visual Studio's \"Immediate Window,\" so that I can do runtime execution of random statements and the like? Thanks!\u003c/p\u003e\n\n\u003cp\u003eNathan\u003c/p\u003e","accepted_answer_id":"14364707","answer_count":"1","comment_count":"1","creation_date":"2013-01-14 19:25:09.193 UTC","last_activity_date":"2013-01-16 17:57:27.443 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1399272","post_type_id":"1","score":"0","tags":"titanium","view_count":"73"} +{"id":"11741575","title":"Android app + webserver API using Federated login or OpenID (WITHOUT GAE)","body":"\u003cp\u003eI have an Android app that needs to upload data to an API (API will then save data in MySQL DB). I would like to use a Federated login (Google) or OpenID authentication procedure so that user does not need to register email + password for my app, but rather can use Google (or other account) that is saved in \u003ccode\u003eAccountManager\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eUp until early this year, the solution was using GAE, as per Nick Johnson's famous recipe. But since Google started charging for the use of GAE, this is not a viable solution anymore. \u003cem\u003ePLEASE DO NOT RECOMMEND USE OF GAE\u003c/em\u003e.\u003c/p\u003e\n\n\u003cp\u003eHas anyone ever managed to solve the problem of authenticating with Federated Login OR OpenID and then getting authorization on a third-party (your) webserver API?\u003c/p\u003e\n\n\u003cp\u003eNOTE: OAuth would be a straightforward solution for authorization except that it would rely on interacting (in a trusted manner) with a previously authenticated consumer, which is not the case when you authenticate the app user (on the mobile) using FedLogin or OpenID. OAuth works if my app (mobile + webserver) authenticates user (and I store login + password — which is EXACTLY what I am trying to avoid), but not if Google (or FB) do this for you.\u003c/p\u003e","answer_count":"1","comment_count":"4","creation_date":"2012-07-31 13:45:09.093 UTC","favorite_count":"1","last_activity_date":"2012-08-06 02:57:44.497 UTC","last_edit_date":"2012-07-31 15:49:04.87 UTC","last_editor_display_name":"","last_editor_user_id":"1559448","owner_display_name":"","owner_user_id":"1166727","post_type_id":"1","score":"2","tags":"android|api|oauth|openid|federated-identity","view_count":"936"} +{"id":"10635810","title":"how to clone an object in android?","body":"\u003cp\u003eSorry for a novice question, but what would be the best way to copy/clone an object in java/android?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003erlBodyDataObj rlbo = bdoTable.get(name);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eright now code assigns an object from a hashTable, yet I need to get a clone of it, so that I'd be able to use it multiple times.\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","accepted_answer_id":"10635930","answer_count":"4","comment_count":"5","creation_date":"2012-05-17 12:32:04.907 UTC","favorite_count":"1","last_activity_date":"2017-04-14 17:04:35.607 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"296516","post_type_id":"1","score":"8","tags":"java|android","view_count":"22436"} +{"id":"20887590","title":"Using $(warning) inside Android.mk shows a false error in Eclipse. How can I fix this?","body":"\u003cp\u003eI'm working on an Android project, using the Eclipse ADT environment provided by Google. This project has a somewhat complex \u003ccode\u003eAndroid.mk\u003c/code\u003e file, that can be easily misconfigured.\nIn order to ensure correct build flow and output warning and diagnostic messages to the console output, I rely on the \u003ccode\u003e$warning()\u003c/code\u003e command. \u003c/p\u003e\n\n\u003cp\u003eThe \u003ccode\u003e$warning()\u003c/code\u003e commands are working fine, with the expected output being shown in the Build console; however, the Eclipse IDE is flagging the lines where I invoke the \u003ccode\u003e$warning()\u003c/code\u003e commands as having errors. These errors are propagating hierarchically to the Project Explorer Navigation window, where the \u003ccode\u003eAndroid.mk\u003c/code\u003e and the \u003ccode\u003ejni\u003c/code\u003e folder are also shown as having errors.\u003c/p\u003e\n\n\u003cp\u003eHere is an example of a command that triggers an error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(warning value of BUILD_CONFIG IS '$(BUILD_CONFIG)')\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eAlthough everything is working as expected, I'm being a little pedantic and would like to remove these false errors from the IDE. Is this possible?\u003c/strong\u003e \u003c/p\u003e","accepted_answer_id":"20894041","answer_count":"1","comment_count":"1","creation_date":"2014-01-02 16:48:22.79 UTC","last_activity_date":"2014-01-02 23:43:07.367 UTC","last_editor_display_name":"","owner_display_name":"user1222021","post_type_id":"1","score":"2","tags":"android|android-ndk|eclipse-adt|ndk-build|android.mk","view_count":"1930"} +{"id":"4173643","title":"jquery selected value in drop down","body":"\u003cp\u003eI have a drop down. How do I get the selected option, not the value but \u003ccode\u003einnerHTML\u003c/code\u003e. I want \u003ccode\u003eCO\u003c/code\u003e from the example. This \u003ccode\u003ealert($('#mydropdown').val());\u003c/code\u003e gives me the value \u003ccode\u003e1\u003c/code\u003e but I dont want that. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;select name='mydropdown' id='dd'\u0026gt;\n\u0026lt;option value=1 selected\u0026gt;CO\u0026lt;/option\u0026gt;\n\u0026lt;option value=2\u0026gt;CA\u0026lt;/option\u0026gt;\n\n\u0026lt;option value=3\u0026gt;TX\u0026lt;/option\u0026gt;\n\n\u0026lt;/select\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"4173655","answer_count":"2","comment_count":"0","creation_date":"2010-11-13 16:59:43.02 UTC","favorite_count":"1","last_activity_date":"2012-01-15 08:55:24.303 UTC","last_edit_date":"2012-01-15 08:55:24.303 UTC","last_editor_display_name":"","last_editor_user_id":"918414","owner_display_name":"","owner_user_id":"295189","post_type_id":"1","score":"2","tags":"jquery|jquery-ui","view_count":"5736"} +{"id":"17554555","title":"How to display all attributes of model subclass on first initialization?","body":"\u003cp\u003e\u003cstrong\u003eProblem\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eWhen a child model is initialized for the \u003cstrong\u003efirst time\u003c/strong\u003e, only defaults of the child are set as attributes. \u003c/p\u003e\n\n\u003cp\u003eWhen a second(and all subsequent) child is being initialized, the attributes of child display defaults of child and it's parent.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://jsfiddle.net/Rusln/HMLcj/\" rel=\"nofollow\"\u003e\u003cstrong\u003eFiddle\u003c/strong\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar Parent = Backbone.Model.extend({\n defaults: {\n name: \"john\",\n lname: \"smith\",\n age: 30,\n language: \"english\",\n location: \"belgium\"\n }\n});\n\nvar Child = Parent.extend({\n defaults: {\n hobby: \"doing nothing\",\n age: 24,\n occupation: \"student\"\n },\n initialize: function () {\n this.constructor.__super__.initialize.apply(this, arguments);\n _.defaults(this.defaults, this.constructor.__super__.defaults);\n console.log(this.attributes); \n }\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eattributes of child initialized for the first time : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e var child1 = new Child();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003echild1.attributes :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e hobby: \"doing nothing\"\n age: 24\n occupation: \"student\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eattributes of same Child class, initialized for the second time: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar child2 = new Child();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003echild2 attributes:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eage: 24\nhobby: \"doing nothing\"\nlanguage: \"english\"\nlname: \"smith\"\nlocation: \"belgium\"\nname: \"john\"\noccupation: \"student\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eQuestion\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eWhy are not \u003cem\u003eall\u003c/em\u003e defaults(child's and parent's) are being set as attributes when a child model is initialized for the first time ? \u003c/p\u003e\n\n\u003cp\u003eBecause i've to display a \u003ccode\u003eBackbone.Collection\u003c/code\u003e inside a \u003ccode\u003e\u0026lt;ul\u0026gt;\u003c/code\u003e and every model's attributes are configurable through a html form inside each \u003ccode\u003e\u0026lt;li\u0026gt;\u003c/code\u003e. But because of this problem, i can't get to all attributes of the first model in the collection. \u003c/p\u003e","accepted_answer_id":"17554672","answer_count":"1","comment_count":"0","creation_date":"2013-07-09 17:29:28.91 UTC","last_activity_date":"2013-07-09 17:41:06.723 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2050459","post_type_id":"1","score":"0","tags":"backbone.js","view_count":"55"} +{"id":"40127350","title":"NetworkX: how to properly create a dictionary of edge lengths?","body":"\u003cp\u003eSay I have a regular grid network made of \u003ccode\u003e10x10\u003c/code\u003e nodes which I create like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport networkx as nx\nfrom pylab import *\nimport matplotlib.pyplot as plt\n%pylab inline\n\nncols=10 \n\nN=10 #Nodes per side\nG=nx.grid_2d_graph(N,N)\nlabels = dict( ((i,j), i + (N-1-j) * N ) for i, j in G.nodes() )\nnx.relabel_nodes(G,labels,False)\ninds=labels.keys()\nvals=labels.values()\ninds=[(N-j-1,N-i-1) for i,j in inds]\nposk=dict(zip(vals,inds))\nnx.draw_networkx(G, pos=posk, with_labels=True, node_size = 150, node_color='blue',font_size=10)\nplt.axis('off')\nplt.title('Grid')\nplt.show()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow say I want to create a dictionary which stores, for each edge, its length. This is the intended outcome:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ed={(0,1): 3.4, (0,2): 1.7, ...}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd this is how I try to get to that point:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efrom math import sqrt\n\nlengths={G.edges(): math.sqrt((x-a)**2 + (y-b)**2) for (x,y),(a,b) in G.edges()}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut there clearly is something wrong as I get the following error message:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e---------------------------------------------------------------------------\nTypeError Traceback (most recent call last)\n\u0026lt;ipython-input-7-c73c212f0d7f\u0026gt; in \u0026lt;module\u0026gt;()\n 2 from math import sqrt\n 3 \n----\u0026gt; 4 lengths={G.edges(): math.sqrt((x-a)**2 + (y-b)**2) for (x,y),(a,b) in G.edges()}\n 5 \n 6 \n\n\u0026lt;ipython-input-7-c73c212f0d7f\u0026gt; in \u0026lt;dictcomp\u0026gt;(***failed resolving arguments***)\n 2 from math import sqrt\n 3 \n----\u0026gt; 4 lengths={G.edges(): math.sqrt((x-a)**2 + (y-b)**2) for (x,y),(a,b) in G.edges()}\n 5 \n 6 \n\nTypeError: 'int' object is not iterable\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eWhat am I missing?\u003c/strong\u003e\u003c/p\u003e","accepted_answer_id":"40127920","answer_count":"1","comment_count":"0","creation_date":"2016-10-19 09:26:42.347 UTC","last_activity_date":"2016-10-19 09:53:04.607 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5110870","post_type_id":"1","score":"0","tags":"python|dictionary|networkx","view_count":"75"} +{"id":"19447095","title":"Csv file to an array","body":"\u003cp\u003eI have a csv file which contains the following values:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e18/10/2013, news item 1\n18/10/2013, news item 2\n17/10/2013, news item 3\n16/10/2013, news item 4\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow do I go about putting this into an array in JavaScript, ordered by date?\u003c/p\u003e\n\n\u003cp\u003eOnce I have got it into an array, I also need to get the text values.\u003c/p\u003e\n\n\u003cp\u003eSo far I have something like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eFunction readTextFile(){\n\nvar rawFile = new XMLhttpRequest();\nVar myArray;\n\nrawFile.open(\"GET\", csvfile, true);\nrawFile.onreadystatechange = function(){\n\nif(rawFile.readyState === 4){\n if(rawFile.Status === 200 || rawFile.Status === 0)\n{\n\n}\n}\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSorry if the text above is not formatted properly, I am posting from my phone. thanks\u003c/p\u003e","answer_count":"2","comment_count":"1","creation_date":"2013-10-18 10:13:05.733 UTC","last_activity_date":"2013-10-18 14:01:26.593 UTC","last_edit_date":"2013-10-18 10:14:15.3 UTC","last_editor_display_name":"","last_editor_user_id":"16076","owner_display_name":"","owner_user_id":"485341","post_type_id":"1","score":"0","tags":"javascript|csv","view_count":"337"} +{"id":"10884008","title":"Border color order","body":"\u003cp\u003eI have a table with every border set to 1px width solid.\nI want the top, left and bottom border to be black, and the right border to be white.\nSo, i used this css code\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eborder-right-color: white; \nborder-left-color: black; \nborder-top-color: black; \nborder-bottom-color: black; \nborder: solid 1px;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe problem comes in IE9, where the top right corner pixel will be white, but the bottom right corner will be black.\u003c/p\u003e\n\n\u003cp\u003eI suspect the problem comes form the way IE9 reorganize the style, because when i look at the css of my table in the developper tools console, it is ordered like this :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eborder-top-color: black;\nborder-right-color: white; \nborder-bottom-color: black; \nborder-left-color: black; \nborder-top-width: 1px;\nborder-right-width: 1px;\nborder-bottom-width: 1px;\nborder-left-width: 1px;\nborder-top-style: solid;\nborder-right-style: solid;\nborder-bottom-style: solid;\nborder-left-style: solid;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis let me think that, maybe, the order used to defined colors makes it so the top border is colored black, then the right border is colored white (overwritting the top right corner), then the bottom border is colored black (overwritting the bottom right corner) and finnaly the left border is colored left.\u003c/p\u003e\n\n\u003cp\u003eThe thing is that, on a white background, the top and bottom borders do not appear to be the same length (by one pixel). It may not be much, but I need those two borders to fit with other lines on my page.\u003c/p\u003e\n\n\u003cp\u003eSo, how could i fix this? Is it really about the order the borders are colored, and if it is, how could I change that?\u003c/p\u003e","accepted_answer_id":"10884349","answer_count":"3","comment_count":"0","creation_date":"2012-06-04 15:36:46.067 UTC","favorite_count":"3","last_activity_date":"2012-06-04 18:13:29.447 UTC","last_edit_date":"2012-06-04 15:37:56.793 UTC","last_editor_display_name":"","last_editor_user_id":"30433","owner_display_name":"","owner_user_id":"1145827","post_type_id":"1","score":"9","tags":"html|css","view_count":"4858"} +{"id":"20240214","title":"Using pattern in Shell Parameter Expansion","body":"\u003cp\u003eI am reading a page and trying to extract some data from it. I am interested in using bash and after going through few links, i came to know that 'Shell Parameter Expansion' might help however, i am finding difficulty using it in my script. I know that using \u003cem\u003esed\u003c/em\u003e might be easier but just for my knowledge i want to know how can i achieve this in \u003cem\u003ebash\u003c/em\u003e.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eshopt -s extglob\n\nstr='My work\u0026lt;/u\u0026gt;\u0026lt;br /\u0026gt;\u0026lt;span style=\"color: rgb(34,34,34);\"\u0026gt;\u0026lt;/span\u0026gt;\u0026lt;span\u0026gt;abc-X7-27ABC | \u0026lt;/span\u0026gt;\u0026lt;span style=\"color: rgb(34,34,34);\"\u0026gt;build'\necho \"${str//\u0026lt;.*\u0026gt;/|}\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want my output to be like this: \u003ccode\u003eMy work|abc-X7-27ABC |build\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eI thought of checking whether it accepts only word instead of pattern and it seems to be working with words.\u003c/p\u003e\n\n\u003cp\u003eFor instance,\u003cbr\u003e\n\u003ccode\u003eecho \"${str//span style/|}\"\u003c/code\u003e works but\u003cbr\u003e\n\u003ccode\u003eecho \"${str//span.*style/|}\"\u003c/code\u003e doesn't\u003c/p\u003e\n\n\u003cp\u003eOn the other hand, i saw in one of the link that it \u003cem\u003edoes\u003c/em\u003e accept pattern. I am confused why it's not working with the patern i am using above.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://stackoverflow.com/questions/18791351/how-to-make-sed-do-non-greedy-match\"\u003eHow to make sed do non-greedy match?\u003c/a\u003e\n(User konsolebox's solution)\u003c/p\u003e","accepted_answer_id":"20240449","answer_count":"2","comment_count":"2","creation_date":"2013-11-27 10:43:02.167 UTC","last_activity_date":"2013-11-27 14:00:10.723 UTC","last_edit_date":"2017-05-23 12:05:05.733 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"361089","post_type_id":"1","score":"3","tags":"bash","view_count":"144"} +{"id":"24649195","title":"What is difference between char and varchar","body":"\u003cpre\u003e\u003ccode\u003eCREATE TABLE IF NOT EXISTS `test` (\n `id` bigint(20) NOT NULL AUTO_INCREMENT,\n `country` varchar(5) NOT NULL,\n `state` char(5) NOT NULL,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI tried following query to insert data\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eINSERT INTO `test`.`test` (`id` ,`country` ,`state`)\nVALUES (NULL , 'south-india', 'Gujarat');\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I execute above query It will shows following warning\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eWarning: #1265 Data truncated for column 'country' at row 1\nWarning: #1265 Data truncated for column 'state' at row 1\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI found \u003ca href=\"https://stackoverflow.com/questions/1885630/whats-the-difference-between-varchar-and-char\"\u003e\u003cstrong\u003eReference\u003c/strong\u003e\u003c/a\u003e that VARCHAR is variable-length.CHAR is fixed length.\u003c/p\u003e\n\n\u003cp\u003eThen what you mean by \u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eVARCHAR is variable-length.\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eCHAR is fixed length.\u003c/strong\u003e\u003c/p\u003e","accepted_answer_id":"24649290","answer_count":"3","comment_count":"7","creation_date":"2014-07-09 08:51:00.537 UTC","last_activity_date":"2014-07-09 09:10:53.927 UTC","last_edit_date":"2017-05-23 11:57:51.743 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"2893413","post_type_id":"1","score":"-1","tags":"mysql","view_count":"249"} +{"id":"34902217","title":"Plotting on the video (Matlab)","body":"\u003cp\u003eI'd like to have a plot on my frame sequence in Matlab environment. For example, I have a specific value for each frame and I want to see its plot \u003cstrong\u003eon the input video\u003c/strong\u003e, let's say at the bottom. The values will be in a specific range. \u003c/p\u003e\n\n\u003cp\u003eIn summary, I need to see the plot on the video, which will be updated frame by frame. \u003c/p\u003e\n\n\u003cp\u003eAny ideas will be very helpful. Thanks in advance!\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2016-01-20 14:05:18.047 UTC","last_activity_date":"2016-01-20 15:47:17.53 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1939417","post_type_id":"1","score":"0","tags":"matlab|video|plot","view_count":"46"} +{"id":"42373189","title":"Preload or not preload?","body":"\u003cp\u003eI'm making a puzzle game, where I use few types of sprites many times. So I have a question about the game performance. Which is better, to create the sprite in \u003ccode\u003efor/in\u003c/code\u003e loop later in \u003ccode\u003esetup()\u003c/code\u003e method, or to preload the sprite in initializer of class, and then just copy the sprite in \u003ccode\u003esetup()\u003c/code\u003e? For example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunc setup() {\n for i in 0...10 {\n let sprite = SKSpriteNode(imageNamed: \"FirstSpriteName\")\n sprite.position = etc...\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eor preload the sprite when I initialize the class: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elet firstSprite = SKSpriteNode(imageNamed: \"FirstSpriteName\")\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand later in the \u003ccode\u003esetup()\u003c/code\u003e func: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunc setup() {\n for i in 0...10 {\n let sprite = firstSprite.copy()\n sprite.position = etc...\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"42373281","answer_count":"1","comment_count":"0","creation_date":"2017-02-21 16:45:31.29 UTC","last_activity_date":"2017-02-21 16:55:32.767 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4360150","post_type_id":"1","score":"0","tags":"swift|performance|sprite-kit|skspritenode","view_count":"55"} +{"id":"43292240","title":"Does append() create a copy of the arguments or append the actual argument's reference to the list?","body":"\u003cp\u003eWhen I run \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ex = [0, 1]\ny = [2, 3]\nx.append(y)\nx[2][1] = 4\nprint y\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eit prints out\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[2, 4]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo, basically, is it appending the reference of the argument to the list? not a copy that is totally unrelated to the argument?\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2017-04-08 09:14:35.207 UTC","last_activity_date":"2017-04-08 09:16:41.633 UTC","last_edit_date":"2017-04-08 09:15:14.573 UTC","last_editor_display_name":"","last_editor_user_id":"100297","owner_display_name":"","owner_user_id":"6915916","post_type_id":"1","score":"0","tags":"python|append","view_count":"323"} +{"id":"43999377","title":"Python cannot find package setuptools","body":"\u003cp\u003eI get the error\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCould not import setuptools which is required to install from a source distribution.\nTraceback (most recent call last):\nFile \"/home/comp1/anaconda3/lib/python3.5/site-packages/pip/req/req_install.py\", line 387, in setup_py\nimport setuptools # noqa\nFile \"/home/comp1/anaconda3/lib/python3.5/site-packages/setuptools/__init__.py\", line 10, in \u0026lt;module\u0026gt;\nfrom setuptools.extern.six.moves import filter, filterfalse, map\nImportError: No module named 'setuptools.extern.six'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eeven though the same code runs perfectly on a variety of our computers. I do have setuptools installed. I also tried to remove and reinstall it. \u003c/p\u003e\n\n\u003cp\u003eEDIT: For some reason, now it works. I don't think we can call it solved, because I did not do anything, but I also don't have the issue anymore. \u003c/p\u003e","answer_count":"1","comment_count":"4","creation_date":"2017-05-16 10:49:14.817 UTC","last_activity_date":"2017-05-16 11:59:10.423 UTC","last_edit_date":"2017-05-16 11:59:10.423 UTC","last_editor_display_name":"","last_editor_user_id":"5016028","owner_display_name":"","owner_user_id":"5016028","post_type_id":"1","score":"0","tags":"python|packages|setuptools","view_count":"149"} +{"id":"14106246","title":"How can I parse an empty element with tinyxml2?","body":"\u003cp\u003eUsing tinyXml2, I can parse \u003cpre\u003e\u0026lt;MSG_TIME\u0026gt;2010-07-01 14:28:20\u0026lt;/MSG_TIME\u0026gt;\u003c/pre\u003e just fine, but \u003cpre\u003e\u0026lt;MSG_TIME\u0026gt;\u0026lt;/MSG_TIME\u0026gt;\u003c/pre\u003e and \u003cpre\u003e\u0026lt;MSG_TIME/\u0026gt;\u003c/pre\u003e both throw exceptions in C++ when those are perfectly valid XML (to my knowledge). Does anyone have a fix or suggestion for this? I do not control the source of this XML, and I need to be error tolerant.\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2012-12-31 21:37:53.933 UTC","last_activity_date":"2015-03-21 18:16:22.82 UTC","last_edit_date":"2015-03-21 18:16:22.82 UTC","last_editor_display_name":"","last_editor_user_id":"3102264","owner_display_name":"","owner_user_id":"1467685","post_type_id":"1","score":"2","tags":"c++|tinyxml2","view_count":"744"} +{"id":"4373420","title":"How to print in iOS 4.2?","body":"\u003cp\u003eI want to integrate the print functionality in my app.\u003c/p\u003e\n\n\u003cp\u003eThe document I want to print will be in .doc or .txt format.\nI am not very experienced in iPhone development yet, so finding it difficult to implement it by following the Apple documentation.\u003c/p\u003e\n\n\u003cp\u003eIf someone could help me by posting some sample code, will be a great help.\u003c/p\u003e","accepted_answer_id":"4373866","answer_count":"3","comment_count":"1","creation_date":"2010-12-07 04:33:37.34 UTC","favorite_count":"21","last_activity_date":"2016-07-02 14:23:15.413 UTC","last_edit_date":"2016-07-02 14:23:15.413 UTC","last_editor_display_name":"","last_editor_user_id":"359307","owner_display_name":"","owner_user_id":"386236","post_type_id":"1","score":"23","tags":"iphone|cocoa-touch|ipad|printing|ios-4.2","view_count":"13740"} +{"id":"42726835","title":"Collection View Xcode Swift 3 padding and spacing","body":"\u003cp\u003eI have this code for a collection view:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elet sectionInsets = UIEdgeInsets(top: 50.0, left: 1.0, bottom: 1.0, right: 1.0)\nfileprivate let itemsPerRow: CGFloat = 3\n\nvar items = [\"1\", \"2\", \"3\"]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI use this code in sizeforitemAt:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e//2\n let paddingSpace = sectionInsets.left * (itemsPerRow + 1)\n let availableWidth = view.frame.width - paddingSpace\n let widthPerItem = availableWidth / itemsPerRow\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever it skips cells and leaves them blank. What I'm looking for is 3 cells per row with 50 padding on top and 1,1,1 on left right and bottom. Can anyone please help me?\u003c/p\u003e\n\n\u003cp\u003eDenis\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-03-10 20:04:44.627 UTC","last_activity_date":"2017-03-10 20:48:12.38 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7237391","post_type_id":"1","score":"0","tags":"xcode|swift3|collectionview","view_count":"101"} +{"id":"10402059","title":"using dapper to replace a fully fledged OR/M","body":"\u003cp\u003eI'm really impressed by Dapper micro OR/M, I really would like to use it as a side by side companion of some fully fledged OR/M, and my be evantually in place of it. I did not figure out anyway if there is some strategy to deserialize a hierarchy from db: for example the returned object for a recordset row would depend on a field ( the so called 'discriminator' in NH for example ). Furthermore the hierarchy can split more table via a join, so the type that represent the row will depend on the existence of the record in the other table. Having a hierarchy represented by a mixture of the two strategy above would be something that NH for example does not support, but that exist in the 'relational life'. So the questions:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003edoes Dapper handle such a scenario ?\u003c/li\u003e\n\u003cli\u003edoes this scenario wanish the Dapper efforts in term of performance ?\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eAnother topic is caching. Dapper cache for queries is a little to much aggressive, wouldn't be better to have some \"session like context\" and have a query cache for each session, or would this again offend the main Dapper motivations ?\u003c/p\u003e","accepted_answer_id":"10510699","answer_count":"1","comment_count":"0","creation_date":"2012-05-01 18:04:36.663 UTC","favorite_count":"1","last_activity_date":"2012-05-09 06:13:59.283 UTC","last_edit_date":"2012-05-03 20:34:21.093 UTC","last_editor_display_name":"","last_editor_user_id":"566608","owner_display_name":"","owner_user_id":"566608","post_type_id":"1","score":"6","tags":"c#|orm|dapper","view_count":"823"} +{"id":"16778920","title":"Angular equivalent to Backbone collection.get","body":"\u003cp\u003eBackbone has great methods for extracting and updating individual models (single datasets) which are part of a collection (array of objects).\u003c/p\u003e\n\n\u003cp\u003eI'm just learning Angular at the moment, and am being blown away by the binding, filtering and templating (much prefer to underscore). It makes light work of many tasks.\u003c/p\u003e\n\n\u003cp\u003eI'm struggling though, to find a simple way to pull a single object out of an array of objects. From what I've read on-line, my options are to use a filter on ng-repeat (which seems a bit odd as I'm not \"repeating\" anything, or to pull in jquery and use $.grep. Another way might be to build my own filter or to write something in raw javascript.\u003c/p\u003e\n\n\u003cp\u003eWhich way would you use to pull a single object out of an array? Bear in mind that in Backbone, each object in a collection has a unique 'id' property, and I'm using the same paradigm with my business data in Angular. I'd rather not pull in jquery or underscore just to do that.\u003c/p\u003e\n\n\u003cp\u003eApologies if an Angular method exists - I find the documentation a bit tricky to navigate. If it does, then please give an example of it in use. Many thanks.\u003c/p\u003e","accepted_answer_id":"16779254","answer_count":"3","comment_count":"2","creation_date":"2013-05-27 18:49:59.473 UTC","last_activity_date":"2014-05-05 13:48:06.44 UTC","last_edit_date":"2013-05-28 11:07:27.067 UTC","last_editor_display_name":"","last_editor_user_id":"2298108","owner_display_name":"","owner_user_id":"2298108","post_type_id":"1","score":"1","tags":"javascript|angularjs","view_count":"1812"} +{"id":"39614938","title":"Why do we need TensorFlow tf.Graph?","body":"\u003cp\u003eWhat is the purpose of:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ewith tf.Graph().as_default()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have some tensorflow code that uses the above.\nHowever, the code has only one graph, so why do we need this?\u003c/p\u003e","accepted_answer_id":"39616491","answer_count":"2","comment_count":"0","creation_date":"2016-09-21 11:11:28.577 UTC","favorite_count":"3","last_activity_date":"2016-09-21 16:38:33.967 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6857504","post_type_id":"1","score":"15","tags":"tensorflow","view_count":"2304"} +{"id":"36071613","title":"hide #dialog ui , when clicked outside ,example checked. pls","body":"\u003cpre\u003e\u003ccode\u003e$(function() {\n $( \"#dialog\" ).dialog({\n autoOpen: false,\n show: {\n effect: \"blind\",\n duration: 2000\n },\n hide: {\n effect: \"explode\",\n duration: 500\n }\n });\n$( \"#opener\" ).click(function() {\n $( \"#dialog\" ).dialog( \"open\" );\n });\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"4","creation_date":"2016-03-17 21:01:18.167 UTC","last_activity_date":"2016-03-17 21:14:14.63 UTC","last_edit_date":"2016-03-17 21:06:27.633 UTC","last_editor_display_name":"","last_editor_user_id":"2913306","owner_display_name":"","owner_user_id":"6079401","post_type_id":"1","score":"-2","tags":"javascript|jquery","view_count":"40"} +{"id":"31403791","title":"how to replace image of imageview in lollipop?","body":"\u003cp\u003eHere i am facing a problem regarding android v5(lollipop). The common method\nImageview.setImageResource(//id) happily work with below android v5(lollipop), but not work in lollipop, so please suggest me your knowledge regarding this\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2015-07-14 10:14:40.367 UTC","last_activity_date":"2015-07-14 11:17:30.643 UTC","last_edit_date":"2015-07-14 11:17:30.643 UTC","last_editor_display_name":"","last_editor_user_id":"5105785","owner_display_name":"","owner_user_id":"5018136","post_type_id":"1","score":"-2","tags":"android|android-layout","view_count":"82"} +{"id":"46780421","title":"Nested table with table-layout: fixed affecting parent table","body":"\u003cp\u003eI'm giving my \u003cem\u003enested\u003c/em\u003e table (within a \u003ccode\u003e\u0026lt;td\u0026gt;\u003c/code\u003e element) the style \u003ccode\u003etable-layout: fixed\u003c/code\u003e. For some reason, this is affecting my \u003cem\u003eparent\u003c/em\u003e table as well:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/kuatx.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/kuatx.png\" alt=\"Screenshot without table-layout: fixed\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/SLze2.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/SLze2.png\" alt=\"Screenshot with table-layout: fixed\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eDemo:\u003c/p\u003e\n\n\u003cp\u003e\u003cdiv class=\"snippet\" data-lang=\"js\" data-hide=\"true\" data-console=\"true\" data-babel=\"false\"\u003e\r\n\u003cdiv class=\"snippet-code snippet-currently-hidden\"\u003e\r\n\u003cpre class=\"snippet-code-js lang-js prettyprint-override\"\u003e\u003ccode\u003edocument.getElementById('set-fixed').addEventListener('click', function() {\r\n document.getElementById('result').innerHTML = (\r\n document.getElementById('nested').classList.toggle('fixed')\r\n ? 'fixed'\r\n : 'not fixed'\r\n )\r\n})\u003c/code\u003e\u003c/pre\u003e\r\n\u003cpre class=\"snippet-code-css lang-css prettyprint-override\"\u003e\u003ccode\u003etable {\r\n border-collapse: collapse;\r\n}\r\n\r\nth, td {\r\n border: 1px solid black;\r\n padding: 2px;\r\n}\r\n\r\ntable.fixed {\r\n table-layout: fixed;\r\n}\u003c/code\u003e\u003c/pre\u003e\r\n\u003cpre class=\"snippet-code-html lang-html prettyprint-override\"\u003e\u003ccode\u003e\u0026lt;p\u0026gt;Set nested table's style \u0026lt;code\u0026gt;table-layout: fixed\u0026lt;/code\u0026gt;: \u0026lt;button id=\"set-fixed\"\u0026gt;Toggle\u0026lt;/button\u0026gt; (current: \u0026lt;span id='result'\u0026gt;not fixed\u0026lt;/span\u0026gt;)\u0026lt;/p\u0026gt;\r\n\u0026lt;table width=\"100%\"\u0026gt;\r\n \u0026lt;tr\u0026gt;\r\n \u0026lt;th\u0026gt;Name\u0026lt;/th\u0026gt;\r\n \u0026lt;th\u0026gt;Description\u0026lt;/th\u0026gt;\r\n \u0026lt;th\u0026gt;Column 3\u0026lt;/th\u0026gt;\r\n \u0026lt;th\u0026gt;Column 4\u0026lt;/th\u0026gt;\r\n \u0026lt;/tr\u0026gt;\r\n \u0026lt;tr\u0026gt;\r\n \u0026lt;td colspan=\"4\"\u0026gt;\r\n \u0026lt;table id='nested' width=\"100%\"\u0026gt;\r\n \u0026lt;tr\u0026gt;\r\n \u0026lt;td\u0026gt;Foo\u0026lt;/td\u0026gt;\r\n \u0026lt;td\u0026gt;Baaaaaaar!\u0026lt;/td\u0026gt;\r\n \u0026lt;td\u0026gt;Baz\u0026lt;/td\u0026gt;\r\n \u0026lt;/tr\u0026gt;\r\n \u0026lt;/table\u0026gt;\r\n \u0026lt;/td\u0026gt;\r\n \u0026lt;/tr\u0026gt;\r\n \u0026lt;tr\u0026gt;\r\n \u0026lt;td\u0026gt;Taco\u0026lt;/td\u0026gt;\r\n \u0026lt;td\u0026gt;Beautiful, cheesy, and delicious.\u0026lt;/td\u0026gt;\r\n \u0026lt;td\u0026gt;A\u0026lt;/td\u0026gt;\r\n \u0026lt;td\u0026gt;B\u0026lt;/td\u0026gt;\r\n \u0026lt;/tr\u0026gt;\r\n \u0026lt;tr\u0026gt;\r\n \u0026lt;td\u0026gt;Marshmallow\u0026lt;/td\u0026gt;\r\n \u0026lt;td\u0026gt;Too sweet for my tastes!\u0026lt;/td\u0026gt;\r\n \u0026lt;td\u0026gt;A\u0026lt;/td\u0026gt;\r\n \u0026lt;td\u0026gt;B\u0026lt;/td\u0026gt;\r\n \u0026lt;/tr\u0026gt;\r\n\u0026lt;/table\u0026gt;\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003c/p\u003e\n\n\u003cp\u003eIs this a bug with Firefox, or intentional (according to the relevant official spec)? What can I do to make my nested table's layout fixed without affecting my parent table?\u003c/p\u003e","answer_count":"0","comment_count":"4","creation_date":"2017-10-16 23:29:52.493 UTC","last_activity_date":"2017-10-16 23:29:52.493 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4633828","post_type_id":"1","score":"2","tags":"html|css|html-table","view_count":"25"} +{"id":"7328351","title":"jquery toggle open all div on one click","body":"\u003cp\u003ePlease take a look at below codes, for whatever reason I am unable to open one div only when I click on the edit link, it opens all divs when I click the edit link. This is what I have:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e( function($) {\n $(document).ready(function() {\n // hides the slickbox as soon as the DOM is ready\n $('.slickbox').hide(); \n // toggles the slickbox on clicking the noted link \n $('.slick-toggle').click(function() {\n $('.slickbox').toggle(400);\n return false;\n });\n });\n} ) ( jQuery );\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is the HTML part:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;li id=\"list_47\"\u0026gt;\n\u0026lt;div\u0026gt;\n \u0026lt;div id=\"row\"\u0026gt;\n \u0026lt;div class=\"title id=\"bannerid59\"\u0026gt;\u0026lt;img src=\"banner_45_10.jpg\" /\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;div class=\"action\"\u0026gt;\u0026lt;a href=\"#\" class=\".slick-toggle\"\u0026gt;Edit\u0026lt;/a\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div id=\"row-right\"\u0026gt;\n \u0026lt;span class=\"small\"\u0026gt;Sort Order: 2\u0026lt;/span\u0026gt;\u0026lt;br\u0026gt;\n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u0026lt;div class=\"slickbox\"\u0026gt;blah blah box 1\u0026lt;/div\u0026gt;\n\u0026lt;/li\u0026gt;\n\n\u0026lt;li id=\"list_48\"\u0026gt;\n\u0026lt;div\u0026gt;\n \u0026lt;div id=\"row\"\u0026gt;\n \u0026lt;div class=\"title id=\"bannerid60\"\u0026gt;\u0026lt;img src=\"banner_45_11.jpg\" /\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;div class=\"action\"\u0026gt;\u0026lt;a href=\"#\" class=\".slick-toggle\"\u0026gt;Edit\u0026lt;/a\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div id=\"row-right\"\u0026gt;\n \u0026lt;span class=\"small\"\u0026gt;Sort Order: 2\u0026lt;/span\u0026gt;\u0026lt;br\u0026gt;\n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u0026lt;div class=\"slickbox\"\u0026gt;blah blah box 2\u0026lt;/div\u0026gt;\n\u0026lt;/li\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have looked through other examples or solutions with no luck (such as replacing $('.slickbox').toggle(400); with $(this).next(\".slickbox\").slideToggle(400);)\u003c/p\u003e\n\n\u003cp\u003eAny pointer is greatly appreciated. thanks. \u003c/p\u003e","accepted_answer_id":"7328400","answer_count":"4","comment_count":"0","creation_date":"2011-09-07 02:43:58.077 UTC","last_activity_date":"2011-09-07 02:53:48.787 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"837836","post_type_id":"1","score":"0","tags":"jquery|toggle","view_count":"1404"} +{"id":"30525678","title":"ng-click not working inside the ng-repeat","body":"\u003cp\u003e\u003cem\u003eI'am trying to display the products based on the brands but ng-click inside ng-repeat not working.\nBut ng-click outside the ng-repeat working fine.\u003cstrong\u003eIs there any conflict inside ng-repeat...?\u003c/em\u003e\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eModule\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar myApp = angular.module('myapplication', ['ngRoute', 'ngResource','uiSlider']); \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eMy View\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;a style=\"cursor:pointer\" ng-click=\"Brandfilters = ''\"\u0026gt;All Brands\u0026lt;/a\u0026gt;\n\n\u0026lt;div class=\"list-group-item\" ng-repeat=\"product in products | unique: 'brand'\" \u0026gt;\n \u0026lt;a style=\"cursor:pointer\" ng-click=\"Brandfilters='{{product.brand}}'\"\u0026gt;{{product.brand}}\u0026lt;/a\u0026gt;\n\u0026lt;/div\u0026gt; \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eMy Controller\u003c/strong\u003e \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emyApp.controller(\"StoreListCtr\", ['$scope', '$http', '$resource', '$location', \n function($scope, $http, $resource, $location) {\n\n $scope.products = Products.query();\n $scope.Brandfilters = null;\n $scope.lower_price = 100;\n $scope.upper_price = 500;\n\n $scope.priceRange = function(products) {\n return (products['cost'] \u0026gt;= $scope.lower_price \n \u0026amp;\u0026amp; products['cost'] \u0026lt;=$scope.upper_price);\n };\n}]) \n\u003c/code\u003e\u003c/pre\u003e","answer_count":"4","comment_count":"6","creation_date":"2015-05-29 09:14:18.36 UTC","last_activity_date":"2015-06-01 07:31:11.397 UTC","last_edit_date":"2015-05-29 10:03:46.59 UTC","last_editor_display_name":"","last_editor_user_id":"1449181","owner_display_name":"","owner_user_id":"4920274","post_type_id":"1","score":"0","tags":"angularjs|angularjs-scope|angularjs-ng-repeat","view_count":"453"} +{"id":"26120839","title":"Mininet uses openvSwitch?","body":"\u003cp\u003eI am new to Mininet and openvSwitch. \u003c/p\u003e\n\n\u003cp\u003eI know that mininet creates a virtual network using my pc resources.\u003c/p\u003e\n\n\u003cp\u003eAnd I know that openvSwitch creates virtual switches.\u003c/p\u003e\n\n\u003cp\u003eBut I couldn't understand if mininet uses virtual switches created by openvSwitch to create the virtual network.\u003c/p\u003e","accepted_answer_id":"26747022","answer_count":"1","comment_count":"0","creation_date":"2014-09-30 12:26:47.413 UTC","favorite_count":"4","last_activity_date":"2014-11-04 23:26:15.17 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2941390","post_type_id":"1","score":"0","tags":"mininet|openvswitch","view_count":"4521"} +{"id":"47532686","title":"How to disable or enable view if toggle is on and off in pbrevalviewController","body":"\u003cp\u003eIn a PBRevealViewController, how to disable user interaction of view when view toggle is on and enable when toggle is off?\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2017-11-28 13:23:51.813 UTC","last_activity_date":"2017-11-28 15:05:43.35 UTC","last_edit_date":"2017-11-28 15:05:43.35 UTC","last_editor_display_name":"","last_editor_user_id":"1226963","owner_display_name":"","owner_user_id":"8819505","post_type_id":"1","score":"-4","tags":"ios","view_count":"19"} +{"id":"42592185","title":"lex parser not displaying hex correctly","body":"\u003cp\u003eI'm trying to identify a hex number from a parsed text file and everything is about 99% accurate however I keep having an issue with this certain instance 0xa98h. whenever it finds this line it will output 0xa98 instead of ignoring it altogether since it is not valid. I've tried so many variations to this code and have yet to find a way to exclude that issue.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[-]?[0][x|X][0-9A-F]+ {cout \u0026lt;\u0026lt; yytext \u0026lt;\u0026lt; \" Number\" \u0026lt;\u0026lt; endl; }\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"1","creation_date":"2017-03-04 04:42:32.97 UTC","last_activity_date":"2017-03-04 20:40:14.647 UTC","last_edit_date":"2017-03-04 20:40:14.647 UTC","last_editor_display_name":"","last_editor_user_id":"1566221","owner_display_name":"","owner_user_id":"4656232","post_type_id":"1","score":"0","tags":"parsing|flex-lexer|lex","view_count":"19"} +{"id":"11988835","title":"Using C++ together with OpenGL in Xcode","body":"\u003cp\u003eMy goal is to develop a cross-plattform based application in C++ and OpenGL.\u003c/p\u003e\n\n\u003cp\u003eSince I am using a Macbook Pro, its natural IDE is Xcode, so I would like to use it. I've successfully compiled pure C++ code in Xcode, by using the Command Line tool as a template for the projects.\u003c/p\u003e\n\n\u003cp\u003eMy question is how can I compile OpenGL code without messing with Cocoa and Objective-C. The main reason behind this is that since I want to deploy cross-plattform applications, I want to stick to C++ as much as possible.\u003c/p\u003e\n\n\u003cp\u003eWhile this is true, It wouldn't be that much of a problem if I necessary had to use a little of Objective-C and Cocoa. But I would like to get my main project code in C++ and the less possible amount of Objective-C/Cocoa, understanding by \"main project code\" the code specific to my application, such as my classes, objects, and stuff related to the aim of the application, ie. , the main body of the code.\u003c/p\u003e\n\n\u003cp\u003eIf using C++/OpenGL without messing with Obj-C/Cocoa is not worth in terms of complexity, then the question could be reformulated as simply what is the way to compile simple OpenGL code in Xcode?\u003c/p\u003e","accepted_answer_id":"11991396","answer_count":"3","comment_count":"0","creation_date":"2012-08-16 13:59:32.447 UTC","favorite_count":"1","last_activity_date":"2012-08-16 16:45:43.697 UTC","last_edit_date":"2012-08-16 14:27:33.843 UTC","last_editor_display_name":"","last_editor_user_id":"44729","owner_display_name":"","owner_user_id":"948470","post_type_id":"1","score":"2","tags":"c++|objective-c|xcode|opengl|xcode4","view_count":"950"} +{"id":"25521814","title":"What are external entities and notations in DTD?","body":"\u003cp\u003eI have been reading about these topics in W3C Recommendation and Wikipedia. I am not sure if I have fully understood them. Could someone explain clearly to me what external entities and notations are in DTD? What are their uses exactly?\u003c/p\u003e\n\n\u003cp\u003eHere are some examples of external entity declarations:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;!ENTITY open-hatch SYSTEM \n \"http://www.textuality.com/boilerplate/OpenHatch.xml\"\u0026gt;\n\u0026lt;!ENTITY open-hatch PUBLIC \n \"-//Textuality//TEXT Standard open-hatch boilerplate//EN\"\n \"http://www.textuality.com/boilerplate/OpenHatch.xml\"\u0026gt;\n\u0026lt;!ENTITY hatch-pic SYSTEM \n \"../grafix/OpenHatch.gif\"\n NDATA gif \u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCorrect me if I am wrong. A general, internal entity replaces the entity name (\u0026ent;) in the document body with the string declared. Does an external entity replaces the entity name with the entire content of an external document?\u003c/p\u003e","accepted_answer_id":"25530862","answer_count":"1","comment_count":"0","creation_date":"2014-08-27 07:58:05.233 UTC","last_activity_date":"2014-08-31 08:45:12.603 UTC","last_edit_date":"2014-08-31 08:45:12.603 UTC","last_editor_display_name":"","last_editor_user_id":"1033612","owner_display_name":"","owner_user_id":"2691226","post_type_id":"1","score":"2","tags":"xml|declaration|dtd|w3c","view_count":"499"} +{"id":"19136927","title":"Encryption with RSA Algorithm-letter 'w','x','y','z'","body":"\u003cp\u003eI have been writing code for RSA Algorithm. It works well but, but unfortunately it showed wrong answer for small 'w','z','x','y'.\u003c/p\u003e\n\n\u003cp\u003eMy encryption algorithm is simple. With two distinct prime number and 'e' I generate the public key, then by generating 'd' I created the private key. Then with the BIGMOD(fast exponentiation) algorithm I just calculate the modulus part to encrypt \u0026amp; decrypt. Here's my code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include\u0026lt;stdio.h\u0026gt;\n#include\u0026lt;string.h\u0026gt;\n\nlong long int square(long long int a);\nlong long int BigMod(int M,int E,int N);\nvoid encrypt(int l,int E,int N);\nvoid decrypt(int E,int N );\n\nint main()\n{\n main_RSA();\n return 0;\n}\n\nvoid main_RSA()\n{\n\n int p,q;\n printf(\"Write two distinct Prime number separated by space:\");\n scanf(\"%d %d\",\u0026amp;p,\u0026amp;q);\n int n=p*q;\n int phi=(p-1)*(q-1);\n int e;\n printf(\"Enter a prime number 'e' as GCD(e,(P-1)*(Q-1)) : \");\n scanf(\"%d\",\u0026amp;e);\n printf(\"public key( e , n ) : ( %d %d )\\n\",e,n);\n int d,RES=-1;\n for(d=1;;d++){\n RES=(d*e)%phi;\n if(RES==1)break;\n }\n printf(\"Private Key( d,n ) : ( %d %d )\\n\",d,n);\n printf(\"Please input your string : \");\n char arr[1000000];\n fflush(stdin);\n gets(arr);\n int i;\n FILE *fp=fopen(\"RSAlog.dll\",\"w\");\n fclose(fp);\n for(i=0;arr[i];i++){\n int ASCII=arr[i];\n encrypt(ASCII,e,n);\n }\n printf(\"\\n\");\n FILE *fpp=fopen(\"RSAlog.dll\",\"a\");\n fprintf(fp,\"-1\");\n fclose(fpp);\n decrypt(d,n);\n}\nlong long int BigMod(int b,int p,int m) //b^p%m=?\n{\n if(p==0)return 1;\n else if(p%2==0)return square(BigMod(b,p/2,m))%m;\n else return ((b % m) * BigMod(b,p-1,m)) % m;\n\n}\n\nlong long int square(long long a)\n{\n return a*a;\n}\n\nvoid encrypt(int m ,int e,int n){\n FILE *fp;\n fp=fopen(\"RSAlog.dll\",\"a\");\n int c=BigMod(m,e,n);\n printf(\"%d \",c) ;\n fprintf(fp,\"%d \",c);\n fclose(fp);\n}\n\nvoid decrypt(int d,int n){\n FILE *fp;\n fp=fopen(\"RSAlog.dll\",\"r\");\n while(1){\n int c;\n fscanf(fp,\"%d\",\u0026amp;c);\n //printf(\"%d \",c);\n if(c==-1)break;\n int m=BigMod(c,d,n);\n printf(\"%c\",m);\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOutput:\u003c/p\u003e\n\n\u003cpre class=\"lang-none prettyprint-override\"\u003e\u003ccode\u003eWrite two distinct Prime number separated by space:7 17\nEnter a prime number 'e' as GCD(e,(P-1)*(Q-1)) : 5\npublic key( e , n ) : ( 5 119 )\nPrivate Key( d,n ) : ( 77 119 )\nPlease input your string : the quick brown fox runs over the lazy dog\n114 83 33 2 78 87 56 29 116 2 98 88 76 0 94 2 51 76 1 2 88 87 94 47 2 76 118 33 88 2 114 83 33 2 75 20 5 32 2 53 76 52\nthe quick bro n fo☺ runs over the la♥☻ dog\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCan anybody help me? \u003c/p\u003e","accepted_answer_id":"19137106","answer_count":"1","comment_count":"0","creation_date":"2013-10-02 12:30:32.98 UTC","favorite_count":"2","last_activity_date":"2013-10-02 12:45:56.58 UTC","last_edit_date":"2013-10-02 12:37:43.447 UTC","last_editor_display_name":"","last_editor_user_id":"474189","owner_display_name":"","owner_user_id":"2762666","post_type_id":"1","score":"3","tags":"c|encryption|cryptography|rsa","view_count":"5625"} +{"id":"35539269","title":"How specify Ajax jquery url path if all codes in one file","body":"\u003cp\u003eI have issue with specifying the Ajax jQuery url path. I have one function contains all Html markup codes, php sned mail codes and Ajax jQuery code as follow\u003c/p\u003e\n\n\u003cp\u003eHow i can specify \u003ccode\u003eurl\u003c/code\u003e property in ajax code?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eInfo:\u003c/strong\u003e i use wordpress theme and this function within my plugin directory\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\n function bsncontact() {\n\n //All php codes here\n?\u0026gt;\n \u0026lt;form id=\"ajax-contact\" class=\"navbar-form\" action=\"\" method=\"POST\"\u0026gt;\n \u0026lt;!-- other html markup codes --\u0026gt;\n \u0026lt;/form\u0026gt;\n \u0026lt;script type=\"text/javascript\"\u0026gt;\n jQuery(function(){\n jQuery.ajax({\n type: 'POST',\n url: '',\n data: \"name=\" + name + \"\u0026amp;email=\" + email + \"\u0026amp;subject=\" + subject + \"\u0026amp;message=\" + message,\n success: function(text) {\n\n }\n });\n });\n \u0026lt;/script\u0026gt;\n\u0026lt;?php\n}\n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"35554190","answer_count":"3","comment_count":"2","creation_date":"2016-02-21 17:17:11.09 UTC","last_activity_date":"2016-02-22 12:52:33.41 UTC","last_edit_date":"2016-02-22 12:52:33.41 UTC","last_editor_display_name":"","last_editor_user_id":"2728870","owner_display_name":"","owner_user_id":"2728870","post_type_id":"1","score":"2","tags":"php|ajax|wordpress","view_count":"354"} +{"id":"36902202","title":"How to pass special char to perl script?","body":"\u003cp\u003e1) In php user enter: query like \u003ccode\u003e'%key%'\u003c/code\u003e or query like \u003ccode\u003e'%door%'\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003e2) I am calling perl script as \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eob_start();\npassthru(\"perl -w search.pl 'query');\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e3) In the perl if i print\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprint \"query: $ARGV[0]\\n\"; \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e4) It prints as \nquery like \u003ccode\u003e^m'%key%'^M\u003c/code\u003e or query like \u003ccode\u003e^m'%door%'^M\u003c/code\u003e \u003c/p\u003e\n\n\u003cp\u003eAny suggestions to print as user entered value.\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2016-04-27 22:40:28.47 UTC","last_activity_date":"2016-04-27 22:53:55.05 UTC","last_edit_date":"2016-04-27 22:46:15.4 UTC","last_editor_display_name":"","last_editor_user_id":"797495","owner_display_name":"","owner_user_id":"2683054","post_type_id":"1","score":"0","tags":"php|regex|perl","view_count":"58"} +{"id":"41463965","title":"BOM being added to any return or die response","body":"\u003cp\u003eI'm using jQuery to retrieve a json response from an endpoint \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edie(json_encode(array('success' =\u0026gt; 3, 'message' =\u0026gt; 'You must use at least 1 credit or more.')));\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhenever I check the JSON response received in chrome developer tools I'm getting a red dot showing \\ufeff is being added before the json response. I've encoded the PHP file with UTF-8 in Notepad++ however it still adds the BOM character infront of any response. If I return anything or change the die it will still show the BOM character in the response. \u003c/p\u003e\n\n\u003cp\u003eI've tried the same file on my localhost and it works absolutely fine however on the server it adds the character.\u003c/p\u003e\n\n\u003cp\u003eI'm at a loss as to what's causing the issue, any help would be greatly appreciated.\u003c/p\u003e","accepted_answer_id":"41464730","answer_count":"2","comment_count":"2","creation_date":"2017-01-04 12:34:32.053 UTC","last_activity_date":"2017-03-06 10:05:51.493 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6038911","post_type_id":"1","score":"0","tags":"php|json|byte-order-mark","view_count":"238"} +{"id":"42290665","title":"Check if .ISO is already mounted in powershell, if not then mount","body":"\u003cp\u003eI have an ISO file that I copied off of an old game disk. But in order for me to play the game, I have to mount the ISO. \nI wrote a small Batch file that runs the \u003ccode\u003e.ps1\u003c/code\u003e PowerShell file to mount the ISO and then runs the EXE to start the game after it has been mounted. My problem is, if I run the script more than once it will mount the ISO again. \u003c/p\u003e\n\n\u003cp\u003eI want to check if the ISO is attached, mount it if it is not, or run the EXE if it is.\u003c/p\u003e\n\n\u003cp\u003eHere's what I have to mount the ISO: \u003cbr/\u003e\nBatch.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eECHO \"Mounting Stunt Track Driver\"\n\n@ECHO off\n\nPowershell.exe -executionpolicy remotesigned \n-File \"C:\\Users\\Allen\\Documents\\Games\\Hot Wheels Stunt Track \nDriver\\setup\\hot98\\mount.ps1\"\n\nstart /d \"C:\\Users\\Allen\\Documents\\Games\\Hot Wheels Stunt Track \nDriver\\setup\\hot98\" stunt.exe\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ePowerShell\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#mounts the image\nMount-DiskImage -ImagePath \"C:\\Users\\Allen\\Documents\\Games\\Hot Wheels Stunt \nTrack Driver\\setup\\hot98\\HotwheelsStuntTrack.iso\"\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"0","creation_date":"2017-02-17 06:14:45.48 UTC","last_activity_date":"2017-02-17 17:47:29.707 UTC","last_edit_date":"2017-02-17 17:47:29.707 UTC","last_editor_display_name":"","last_editor_user_id":"881229","owner_display_name":"","owner_user_id":"7578944","post_type_id":"1","score":"1","tags":"powershell|batch-file","view_count":"242"} +{"id":"31928117","title":"CSS property so that the text inside \u003cdiv\u003e element does not extend outside of background of \u003cdiv\u003e","body":"\u003cp\u003eWhat can I add to CSS property so that the text inside the div element does not extend out of my background color? I'm guessing that because the actual width of the div element is width of full page, so I will have to shrink my div element.\u003c/p\u003e\n\n\u003cp\u003ePlease see example here\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://jsfiddle.net/u5128tv7/\" rel=\"nofollow\"\u003eexample\u003c/a\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"test\"\u0026gt;sadfssdfjklsdfjklsdfsdfksdfkhsdfksdfkhsdfkhsdkhfsdhkfksdhkhsdfkhsdk\u0026lt;/div\u0026gt;\n\n.test {\nbackground: grey;\nwidth: 400px;\nheight: 100px;\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"31928200","answer_count":"4","comment_count":"1","creation_date":"2015-08-10 20:01:20.07 UTC","favorite_count":"0","last_activity_date":"2015-08-10 20:22:20.777 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4852194","post_type_id":"1","score":"4","tags":"css","view_count":"91"} +{"id":"33471081","title":"How to know if user is logged with google or facebook using passport.js?","body":"\u003cp\u003eIt easy to find if user is logged in. But how can I check if user is logged with specific oauth client?. ex. Google or Facebook \u003c/p\u003e","accepted_answer_id":"33471118","answer_count":"1","comment_count":"0","creation_date":"2015-11-02 05:02:58.93 UTC","last_activity_date":"2015-11-02 05:07:16.7 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5514464","post_type_id":"1","score":"1","tags":"passport.js|passport-facebook|passport-google-oauth","view_count":"130"} +{"id":"41941442","title":"D3js v4: scaleOrdinal does not have the rangePoints()","body":"\u003cp\u003eI'm migrating the parallel coordinates source code \u003ca href=\"https://bl.ocks.org/jasondavies/1341281\" rel=\"noreferrer\"\u003ehere\u003c/a\u003e to the newest d3js version (d3js 4.5.0). I'm stuck to this line:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar x = d3.scale.ordinal().rangePoints([0, width], 1) \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt seems that in d3js v4 the \u003ccode\u003erangePoints\u003c/code\u003e function does not exist anymore. I can change to d3.\u003ca href=\"https://github.com/d3/d3-scale/blob/master/src/ordinal.js\" rel=\"noreferrer\"\u003escaleOrdinal\u003c/a\u003e(), but it has only the \u003ccode\u003erange\u003c/code\u003e function, not the \u003ccode\u003erangePoints\u003c/code\u003e function. Any clue on for this?\u003c/p\u003e","accepted_answer_id":"41945740","answer_count":"1","comment_count":"0","creation_date":"2017-01-30 17:03:17.557 UTC","favorite_count":"2","last_activity_date":"2017-01-31 02:45:13.433 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5586341","post_type_id":"1","score":"7","tags":"d3.js","view_count":"2034"} +{"id":"32758327","title":"In AngularJS, Is there a global way to check if any $timeout is pending?","body":"\u003cp\u003eI am using Protractor to test my code written in AngularJS\u003c/p\u003e\n\n\u003cp\u003eProbably there is some $timeout running in my AngularJS code which is making Protractor wait too long until it times out and gives error. But I am not able to figure out where in my code I am doing a continuous timeout/polling. Might be some library I am using but not sure.\u003c/p\u003e\n\n\u003cp\u003eIs there a global way to check in Angular how many timeouts are pending overall?\u003c/p\u003e\n\n\u003cp\u003eI am getting this error:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eUncaught exception: Timed out waiting for Protractor to synchronize\n with the page after 10 seconds. Please see\n \u003ca href=\"https://github.com/angular/protractor/blob/master/docs/faq.md\" rel=\"nofollow\"\u003ehttps://github.com/angular/protractor/blob/master/docs/faq.md\u003c/a\u003e\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI have also tried increasing default timeout of page load from 10secs to upto 60secs which is way more than enough for my page to load. But still no success.\u003c/p\u003e\n\n\u003cp\u003eThis also brings me to another question: What are the advantages of using $timeout over the normal setTimeout in javascript\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2015-09-24 09:50:48.353 UTC","favorite_count":"1","last_activity_date":"2015-09-24 10:06:41.55 UTC","last_edit_date":"2015-09-24 10:06:41.55 UTC","last_editor_display_name":"","last_editor_user_id":"2279116","owner_display_name":"","owner_user_id":"2279116","post_type_id":"1","score":"1","tags":"javascript|angularjs|testing|timeout|protractor","view_count":"133"} +{"id":"5350410","title":"Silverlight RadGridView refresh","body":"\u003cp\u003eI'm deleting a user from my GridView, but when I delete it. I first need to refresh my page to see the result. \u003c/p\u003e\n\n\u003cp\u003eAnybody any idea?\u003c/p\u003e\n\n\u003cp\u003eThis is where I try to rebind the datasource\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eif (e.PropertyName == \"deleted\")\n {\n RadGridView1.ItemsSource = null;\n RadGridView1.DataContext = null;\n RadGridView1.DataContext = _viewModel;\n _viewModel.GetCovrUsers();\n\n\n RadGridView1.ItemsSource = _viewModel.CovrUsers;\n this._viewModel.PropertyChanged -= _viewModel_PropertyChanged;\n\n }\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"1","creation_date":"2011-03-18 10:03:20.523 UTC","last_activity_date":"2012-09-12 05:18:25.417 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"653589","post_type_id":"1","score":"1","tags":"silverlight|refresh|radgridview","view_count":"1721"} +{"id":"25987935","title":"merge same array index according to key and build a new array","body":"\u003cp\u003eI am trying to merge array index such as\u003cbr\u003e\n011,021,031, 012,022,032, 013,023,033, 014,024,034 .\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$temp = array();\nforeach($samplearray as $key =\u0026gt; $val){\n foreach($val as $key1 =\u0026gt; $val1){\n //what should logic here \n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003esample array\u003c/strong\u003e \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$samplearray = array ( \"AA\" =\u0026gt; array ( 0 =\u0026gt; array ( \"created by\" =\u0026gt; \"011\",\n \"date\" =\u0026gt; \"12-03-14\",\n \"time\" =\u0026gt; \"12.00 pm\"\n ),\n 1 =\u0026gt; array ( \"created by\" =\u0026gt; \"012\",\n \"date\" =\u0026gt; \"12-03-14\",\n \"time\" =\u0026gt; \"12.00 pm\"\n ),\n 2 =\u0026gt; array ( \"created by\" =\u0026gt; \"013\",\n \"date\" =\u0026gt; \"12-03-14\",\n \"time\" =\u0026gt; \"12.00 pm\"\n ),\n 3 =\u0026gt; array ( \"created by\" =\u0026gt; \"014\",\n \"date\" =\u0026gt; \"12-03-14\",\n \"time\" =\u0026gt; \"12.00 pm\"\n ) \n ),\n \"BB\" =\u0026gt; array ( 0 =\u0026gt; array ( \"created by\" =\u0026gt; \"021\",\n \"date\" =\u0026gt; \"12-03-14\",\n \"time\" =\u0026gt; \"12.00 pm\"\n ),\n 1 =\u0026gt; array ( \"created by\" =\u0026gt; \"022\",\n \"date\" =\u0026gt; \"12-03-14\",\n \"time\" =\u0026gt; \"12.00 pm\"\n ),\n 2 =\u0026gt; array ( \"created by\" =\u0026gt; \"023\",\n \"date\" =\u0026gt; \"12-03-14\",\n \"time\" =\u0026gt; \"12.00 pm\"\n ),\n 3 =\u0026gt; array ( \"created by\" =\u0026gt; \"024\",\n \"date\" =\u0026gt; \"12-03-14\",\n \"time\" =\u0026gt; \"12.00 pm\"\n ) \n ),\n \"CC\" =\u0026gt; array ( 0 =\u0026gt; array ( \"created by\" =\u0026gt; \"031\",\n \"date\" =\u0026gt; \"12-03-14\",\n \"time\" =\u0026gt; \"12.00 pm\"\n ),\n 1 =\u0026gt; array ( \"created by\" =\u0026gt; \"032\",\n \"date\" =\u0026gt; \"12-03-14\",\n \"time\" =\u0026gt; \"12.00 pm\"\n ),\n 2 =\u0026gt; array ( \"created by\" =\u0026gt; \"033\",\n \"date\" =\u0026gt; \"12-03-14\",\n \"time\" =\u0026gt; \"12.00 pm\"\n ),\n 3 =\u0026gt; array ( \"created by\" =\u0026gt; \"034\",\n \"date\" =\u0026gt; \"12-03-14\",\n \"time\" =\u0026gt; \"12.00 pm\"\n ) \n )\n );\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eRequired output\u003c/strong\u003e \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$newArray = array ( 0 =\u0026gt; array ( \"created by\" =\u0026gt; \"011\",\n \"date\" =\u0026gt; \"12-03-14\",\n \"time\" =\u0026gt; \"12.00 pm\"\n ),\n 1 =\u0026gt; array ( \"created by\" =\u0026gt; \"021\",\n \"date\" =\u0026gt; \"12-03-14\",\n \"time\" =\u0026gt; \"12.00 pm\"\n ),\n 2 =\u0026gt; array ( \"created by\" =\u0026gt; \"031\",\n \"date\" =\u0026gt; \"12-03-14\",\n \"time\" =\u0026gt; \"12.00 pm\"\n ),\n 3 =\u0026gt; array ( \"created by\" =\u0026gt; \"012\",\n \"date\" =\u0026gt; \"12-03-14\",\n \"time\" =\u0026gt; \"12.00 pm\"\n ), \n 4 =\u0026gt; array ( \"created by\" =\u0026gt; \"022\",\n \"date\" =\u0026gt; \"12-03-14\",\n \"time\" =\u0026gt; \"12.00 pm\"\n ),\n 5 =\u0026gt; array ( \"created by\" =\u0026gt; \"032\",\n \"date\" =\u0026gt; \"12-03-14\",\n \"time\" =\u0026gt; \"12.00 pm\"\n ),\n 6 =\u0026gt; array ( \"created by\" =\u0026gt; \"013\",\n \"date\" =\u0026gt; \"12-03-14\",\n \"time\" =\u0026gt; \"12.00 pm\"\n ),\n 7 =\u0026gt; array ( \"created by\" =\u0026gt; \"023\",\n \"date\" =\u0026gt; \"12-03-14\",\n \"time\" =\u0026gt; \"12.00 pm\"\n ),\n 8 =\u0026gt; array ( \"created by\" =\u0026gt; \"033\",\n \"date\" =\u0026gt; \"12-03-14\",\n \"time\" =\u0026gt; \"12.00 pm\"\n ),\n 9 =\u0026gt; array ( \"created by\" =\u0026gt; \"014\",\n \"date\" =\u0026gt; \"12-03-14\",\n \"time\" =\u0026gt; \"12.00 pm\"\n ),\n 10 =\u0026gt; array ( \"created by\" =\u0026gt; \"024\",\n \"date\" =\u0026gt; \"12-03-14\",\n \"time\" =\u0026gt; \"12.00 pm\"\n ),\n 11 =\u0026gt; array ( \"created by\" =\u0026gt; \"034\",\n \"date\" =\u0026gt; \"12-03-14\",\n \"time\" =\u0026gt; \"12.00 pm\"\n ), \n );\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"25988044","answer_count":"2","comment_count":"0","creation_date":"2014-09-23 06:04:04.477 UTC","last_activity_date":"2014-09-23 06:41:50.503 UTC","last_edit_date":"2014-09-23 06:32:20.057 UTC","last_editor_display_name":"","last_editor_user_id":"1868277","owner_display_name":"","owner_user_id":"1868277","post_type_id":"1","score":"1","tags":"php|arrays|php-5.5","view_count":"54"} +{"id":"7287060","title":"Sandboxing my App with Scripting Bridge to send email","body":"\u003cp\u003eI'm using a scripting bridge for sending mails from my Mac App. Now I need to sandbox the app and sending mails is not longer working while sandboxing is enabled.\u003c/p\u003e\n\n\u003cp\u003eDoes anybody know how to fix that?\u003c/p\u003e\n\n\u003cp\u003eThanks,\nAndreas\u003c/p\u003e\n\n\u003cp\u003eCode: \n` \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e/* create a Scripting Bridge object for talking to the Mail application */\n MailApplication *mail = [SBApplication applicationWithBundleIdentifier:@\"com.apple.Mail\"];\n\n\n/* create a new outgoing message object */\nMailOutgoingMessage *emailMessage =\n[[[mail classForScriptingClass:@\"outgoing message\"] alloc]\n initWithProperties:\n [NSDictionary dictionaryWithObjectsAndKeys:\n [self.subjectField stringValue], @\"subject\",\n [[self.messageContent textStorage] string], @\"content\",\n nil]];\n\n/* add the object to the mail app */\n[[mail outgoingMessages] addObject: emailMessage];\n...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e`\u003c/p\u003e","answer_count":"4","comment_count":"1","creation_date":"2011-09-02 17:21:46.523 UTC","favorite_count":"1","last_activity_date":"2014-04-22 00:13:23.2 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"347741","post_type_id":"1","score":"5","tags":"objective-c|cocoa|sandbox","view_count":"1758"} +{"id":"26822669","title":"Bootstrap 3.0.3: dropdown menu-items not clickable on mobile","body":"\u003cp\u003eOn my \u003ca href=\"http://www.huystemoock.nl\" rel=\"nofollow\"\u003ewebsite\u003c/a\u003e the links in the dropdown menu's are not working on mobile devices (Android ánd iOS). That means that when I click on a menu item on desktop, it works fine, and when I click the same item on my iPod touch it just closes the dropdown and does nothing. The parent items function well.\u003c/p\u003e\n\n\u003cp\u003eFor example: when I press 'Activiteiten' and then press 'Wandelroute', nothing happens on mobile. When I draw my window (on desktop) at a width of 320px (like the width of a mobile device) the menu just works. I doubt whether my code causes the problem or the mobile device does.\u003c/p\u003e\n\n\u003cp\u003eWhat I've tried so far:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eI've put jQuery and Bootstrap in the right order;\u003c/li\u003e\n\u003cli\u003eIncluded bootstrap-dropdown.js;\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eIncluded the following code:\u003c/p\u003e\n\n\u003cp\u003e.dropdown-backdrop \n{ position: static; }\u003c/p\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eAnd then there's that other strange thing. On \u003ca href=\"http://www.huystemoock.nl/vrienden\" rel=\"nofollow\"\u003ethis\u003c/a\u003e page of the same website, the menu functions okay on mobile devices. I've got absolutely no idea what's different on that page compared to the other ones.\u003c/p\u003e\n\n\u003cp\u003eI'm using Joomla 3.x, jQuery 1.11.1 and Bootstrap 3.0.3.\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2014-11-08 22:12:50.753 UTC","last_activity_date":"2014-11-09 16:15:18.81 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2513335","post_type_id":"1","score":"1","tags":"jquery|twitter-bootstrap|drop-down-menu|joomla|joomla3.0","view_count":"536"} +{"id":"24349063","title":"Entity Framework Include Record with certain value in a Navigation Property","body":"\u003cp\u003eI am using Entity Framework 6 Code First and I'm configuring the mapping of my domain model with Fluent API. I don't see how to create a navigation properties for a Table which is a little tricky.\nI have several objects which can make noise, I would like to record that noise in a NoiseRecord Table.\u003c/p\u003e\n\n\u003cp\u003eI need some kind of conditional mapping, something like that :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emodelBuilder.Entity\u0026lt;NoiseRecord\u0026gt;().HasRequired(n=\u0026gt;n.Origine.OrigineType()==\"Car\").WithMany(c=\u0026gt;c.NoiseRecords);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThat would be the mapping of the Car Navigation Property to avoid that, for example, it includes record related to Planes.\u003c/p\u003e\n\n\u003cp\u003eHere is my code\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic interface INoisy\n{\n int ID {get; set;}\n string OriginType()\n ...\n //And other useful things not related to persistence\n}\n\n\npublic class Car : INoisy\n{\n ...\n ICollection\u0026lt;NoiseRecord\u0026gt; NoiseRecords { get; set; }\n string OrigineType()\n {\n return \"Car\";\n }\n}\n\npublic class Plane : INoisy\n{\n ...\n ICollection\u0026lt;NoiseRecord\u0026gt; NoiseRecords {get; set;}\n string OrigineType()\n {\n return \"Plane\";\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd a couple of other classes implement INoisy also.\nBelow is the NoiseRecord Table.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class NoiseRecord\n{\n public int RecordID {get; set;}\n public INoisy NoiseOrigine {get; set;}\n public double NoiseMagnitude {get; set;}\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm looking for a way to achieve that with Fluent API.\u003c/p\u003e\n\n\u003cp\u003eThank you !\u003c/p\u003e","accepted_answer_id":"24349978","answer_count":"1","comment_count":"0","creation_date":"2014-06-22 07:31:01.75 UTC","last_activity_date":"2014-06-22 09:37:14.18 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2497244","post_type_id":"1","score":"0","tags":"c#|entity-framework|ef-code-first|fluent","view_count":"578"} +{"id":"45984862","title":"Index into NumPy array ignoring NaNs in the indexing array","body":"\u003cp\u003eI have an array of zeros \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003earr = np.zeros([5,5])\narray([[ 0., 0., 0., 0., 0.],\n [ 0., 0., 0., 0., 0.],\n [ 0., 0., 0., 0., 0.],\n [ 0., 0., 0., 0., 0.],\n [ 0., 0., 0., 0., 0.]])\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to assign values based on index so I did this .\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eout = np.array([[nan,2.,4.,1.,1.],[nan,3.,4.,4.,4.]])\n\narr[out[0].astype(int),np.arange(len(out[0]))] = 1\narr[out[1].astype(int),np.arange(len(out[1]))] = 1\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAssignment works fine if there is 0 instead of nan. \u003c/p\u003e\n\n\u003cp\u003eHow can I skip assignment in case of nan? and Is it possible to assign values at once from a multidimensional index array rather than using for loop ? \u003c/p\u003e","accepted_answer_id":"45985035","answer_count":"1","comment_count":"0","creation_date":"2017-08-31 15:15:04.637 UTC","last_activity_date":"2017-08-31 16:47:32.053 UTC","last_edit_date":"2017-08-31 16:42:42.657 UTC","last_editor_display_name":"","last_editor_user_id":"3293881","owner_display_name":"","owner_user_id":"4800652","post_type_id":"1","score":"1","tags":"python|numpy","view_count":"42"} +{"id":"43579001","title":"C strlen using pointers","body":"\u003cp\u003eI have seen the standard implementation of strlen using pointer as:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eint strlen(char * s) {\n char *p = s;\n while (*p!='\\0')\n p++;\n return p-s;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI get this works, but when I tried to do this using 3 more ways (learning pointer arithmetic right now), I would want to know whats wrong with them?\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003e\u003cp\u003eThis is somewhat similar to what the book does. Is this wrong?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eint strlen(char * s) {\n char *p = s;\n while (*p)\n p++;\n return p-s;\n}\n\u003c/code\u003e\u003c/pre\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eI though it would be wrong if I pass an empty string but still gives me 0, kinda confusing since p is pre increment: (and now its returning me 5)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eint strlen(char * s) {\n char *p = s;\n while (*++p)\n ;\n return p-s;\n}\n\u003c/code\u003e\u003c/pre\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eFigured this out, does the post increment and returns +1 on it.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eint strlen(char * s) {\n char *p = s;\n while (*p++)\n ;\n return p-s;\n}\n\u003c/code\u003e\u003c/pre\u003e\u003c/li\u003e\n\u003c/ol\u003e","accepted_answer_id":"43579183","answer_count":"3","comment_count":"0","creation_date":"2017-04-24 02:48:17.997 UTC","favorite_count":"0","last_activity_date":"2017-04-24 09:43:29.717 UTC","last_edit_date":"2017-04-24 09:43:29.717 UTC","last_editor_display_name":"","last_editor_user_id":"694733","owner_display_name":"","owner_user_id":"7703770","post_type_id":"1","score":"1","tags":"c","view_count":"485"} +{"id":"8534602","title":"Creating Purchase Info Record in SAP","body":"\u003cp\u003eI am trying to create a Purchase Info Record (ME11) in SAP using the below JCo code:\u003c/p\u003e\n\n\u003cp\u003eIt executes without fail and throws no error, but i am not able to get the newly created info record in SAP. In ME13 it says info record not found. Can i know what am i missing?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eIFunctionTemplate ft1 = mRepository.getFunctionTemplate(\"ZME_INITIALIZE_INFORECORD\");\n JCO.Function function1 = ft1.getFunction();\n mConnection.execute(function1);\n\n IFunctionTemplate ft = mRepository.getFunctionTemplate(\"ZME_DIRECT_INPUT_INFORECORD\");\n JCO.Function function = ft.getFunction();\n JCO.ParameterList importparams =function.getImportParameterList();\n\n // Setting HeadData Structure Information\n JCO.Structure headStructure = importparams.getStructure(\"I_EINA\");\n //headStructure.setValue(\"105\",\"MANDT\");\n //headStructure.setValue(\"5300259768\", \"INFNR\");\n headStructure.setValue(\"MYPART0006\", \"MATNR\"); \n //headStructure.setValue(\"MYPART0006\", \"IDNLF\");\n headStructure.setValue(\"100002\",\"LIFNR\");\n headStructure.setValue(\"10000\",\"MATKL\");\n headStructure.setValue(\"KGS\",\"MEINS\");\n headStructure.setValue(\"1\",\"UMREZ\");\n headStructure.setValue(\"1\",\"UMREN\");\n headStructure.setValue(\"SG\",\"URZLA\");\n headStructure.setValue(\"KGS\",\"LMEIN\");\n //headStructure.setValue(\"0000005300259768\",\"URZZT\");\n\n JCO.Structure headStructure1 = importparams.getStructure(\"O_EINA\");\n //headStructure1.setValue(\"105\",\"MANDT\");\n //headStructure1.setValue(\"5300259768\", \"INFNR\");\n headStructure1.setValue(\"MYPART0006\", \"MATNR\"); \n //headStructure1.setValue(\"MYPART0006\", \"IDNLF\");\n headStructure1.setValue(\"100002\",\"LIFNR\");\n headStructure1.setValue(\"10000\",\"MATKL\");\n headStructure1.setValue(\"KGS\",\"MEINS\");\n headStructure1.setValue(\"1\",\"UMREZ\");\n headStructure1.setValue(\"1\",\"UMREN\");\n headStructure1.setValue(\"SG\",\"URZLA\");\n headStructure1.setValue(\"KGS\",\"LMEIN\");\n\n //headStructure1.setValue(\"0000005300259768\",\"URZZT\");\n System.out.println(\"General Data Set\");\n\n JCO.Structure purchaseDataStructure = importparams.getStructure(\"I_EINE\");\n //purchaseDataStructure.setValue(\"105\",\"MANDT\");\n //purchaseDataStructure.setValue(\"5300259768\", \"INFNR\");\n purchaseDataStructure.setValue(\"1000\",\"EKORG\");\n purchaseDataStructure.setValue(\"1000\", \"WERKS\");\n purchaseDataStructure.setValue(\"003\",\"EKGRP\");\n purchaseDataStructure.setValue(\"USD\",\"WAERS\");\n purchaseDataStructure.setValue(\"3\",\"APLFZ\");\n purchaseDataStructure.setValue(\"1\",\"PEINH\");\n purchaseDataStructure.setValue(\"1\",\"BPUMZ\");\n purchaseDataStructure.setValue(\"1\",\"BPUMN\");\n purchaseDataStructure.setValue(\"1000\",\"EFFPR\"); \n purchaseDataStructure.setValue(\"0001\",\"BSTAE\"); \n purchaseDataStructure.setValue(\"100000\",\"NETPR\");\n purchaseDataStructure.setValue(\"X\",\"KZABS\");\n\n JCO.Structure purchaseDataStructure1 = importparams.getStructure(\"O_EINE\");\n //purchaseDataStructure1.setValue(\"105\",\"MANDT\");\n //purchaseDataStructure1.setValue(\"5300259768\", \"INFNR\");\n purchaseDataStructure1.setValue(\"1000\",\"EKORG\");\n purchaseDataStructure1.setValue(\"1000\", \"WERKS\");\n purchaseDataStructure1.setValue(\"003\",\"EKGRP\");\n purchaseDataStructure1.setValue(\"USD\",\"WAERS\");\n purchaseDataStructure1.setValue(\"3\",\"APLFZ\");\n purchaseDataStructure1.setValue(\"1\",\"PEINH\");\n purchaseDataStructure1.setValue(\"1\",\"BPUMZ\");\n purchaseDataStructure1.setValue(\"1\",\"BPUMN\");\n purchaseDataStructure1.setValue(\"1000\",\"EFFPR\"); \n purchaseDataStructure1.setValue(\"0001\",\"BSTAE\"); \n purchaseDataStructure1.setValue(\"100000\",\"NETPR\");\n purchaseDataStructure1.setValue(\"X\",\"KZABS\");\n\n mConnection.execute(function);\n\n IFunctionTemplate ft2 = mRepository.getFunctionTemplate(\"ZME_POST_INFORECORD\");\n JCO.Function function2 = ft2.getFunction();\n\n JCO.ParameterList importparams2 =function2.getImportParameterList();\n importparams2.setValue(\"MYPART0006\", \"I_MATNR\");\n importparams2.setValue(\"MYPART0006\", \"O_MATNR\");\n mConnection.execute(function2);\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"1","creation_date":"2011-12-16 13:06:06.41 UTC","last_activity_date":"2015-12-29 23:49:53.08 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"495680","post_type_id":"1","score":"0","tags":"java|sap|jco|bapi","view_count":"976"} +{"id":"22921112","title":"Returning a value of a high order function doesn't","body":"\u003cp\u003eI have the following:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef retSomething(x: Int): Int =\u0026gt; Int = x*x\n\nassert(retSomething(5)(5) == 25)\nassert(retSomething(1)(1) == 1)\nassert(retSomething(1)(0) == 0)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut the assertions fail. Surely that is correct, but it says implementation is missing when running it.\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2014-04-07 19:17:03.677 UTC","last_activity_date":"2014-04-08 13:02:02.583 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"540909","post_type_id":"1","score":"-1","tags":"scala","view_count":"51"} +{"id":"19162775","title":"Change an element css while hovering on another element in css?","body":"\u003cp\u003eIs there any way to change an element's css while focusing or hovering on one of it's children? \u003c/p\u003e\n\n\u003cp\u003eEx: while I move my mouse on A, B's background color changes.\nif B is a descendant A, it is possible.\u003c/p\u003e\n\n\u003cp\u003e--A\u003cbr\u003e\n-----B\u003c/p\u003e\n\n\u003cp\u003eusing \u003ccode\u003e#A:hover #B { background-color: blue }\u003c/code\u003e \u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003e\u003ca href=\"http://codepen.io/anon/pen/lpaHB\" rel=\"nofollow\"\u003eDEMO\u003c/a\u003e\u003c/strong\u003e\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003ein sibling: \u003c/p\u003e\n\n\u003cp\u003e---A\u003cbr\u003e\n---B\u003c/p\u003e\n\n\u003cp\u003eIt is : \u003ccode\u003e#A:hover ~ #B { background-color: blue; }\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003e\u003ca href=\"http://codepen.io/anon/pen/KJDhy\" rel=\"nofollow\"\u003eDEMO\u003c/a\u003e\u003c/strong\u003e\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003eassume B is a descendant of A.\u003cbr\u003e\n\u003cstrong\u003ewhat if I want to change #A background, while I am hovering on B. how could it be?\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e--A\u003cbr\u003e\n-----B\u003c/p\u003e","accepted_answer_id":"19162902","answer_count":"2","comment_count":"9","creation_date":"2013-10-03 15:10:38.26 UTC","favorite_count":"2","last_activity_date":"2016-08-29 20:34:29.073 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"884588","post_type_id":"1","score":"2","tags":"html|css","view_count":"3842"} +{"id":"16579674","title":"Using Spritesheets in Tkinter","body":"\u003cp\u003eI'm writing a GUI in Python's Tkinter, and I can't find how to use the canvas's create_image method to only draw a single sprite from a spritesheet. Thanks in advance to anyone who can tell me what I need to do for this!\u003c/p\u003e","answer_count":"2","comment_count":"1","creation_date":"2013-05-16 05:36:09.647 UTC","last_activity_date":"2015-06-14 14:14:54.54 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2180654","post_type_id":"1","score":"4","tags":"python|tkinter|sprite-sheet","view_count":"2376"} +{"id":"11419244","title":"How can one combine overriding with stackable traits in Scala?","body":"\u003cp\u003eIn Swing and Wicket applications it is normal to override methods in classes that are provided by the framework. For example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eval form = new Form(\"form\") {\n override def onSubmit() { println(\"Form was submitted\") }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhere for the example Form can be defined as:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eabstract class Form(id: String) {\n def onSubmit()\n def error(msg: String) { println(msg) }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMany form implementation need error handling. For this I created a stackable trait:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etrait FormErrorHandler extends Form {\n abstract override def onSubmit() {\n try super.onSubmit()\n catch { case e: Exception =\u0026gt; error(\"error during submit \" + e.getMessage) }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf I now try to combine this I get compiler errors:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eval form = new Form(\"form\") {\n override def onSubmit() { println(\"Form was submitted\") }\n} with FormErrorHandler // DOES NOT COMPILE\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI worked around it with:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass MyForm extends Form(\"form\") {\n override def onSubmit() { println(\"Form was submitted\") }\n}\nval form = new MyForm with FormErrorHandler\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut it just doesn't read as well; I have to name a class that is normally anonymous.\u003c/p\u003e\n\n\u003cp\u003eAny suggestions to make this look nice?\nWould the syntax construct I tried make sense for a future Scala version?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2012-07-10 18:05:25.777 UTC","favorite_count":"0","last_activity_date":"2012-07-10 18:18:31.99 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1262728","post_type_id":"1","score":"1","tags":"scala|inheritance|traits","view_count":"312"} +{"id":"23127237","title":"How get Vertical Button view from xml","body":"\u003cp\u003eI want create a Button in Vertically.May be we can by extending a button and re-render(rotate) the canvas to vertical we can get the custom Button. But i need it from xml.check the graphical representation.i need a button like this.\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/Kci11.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e","answer_count":"1","comment_count":"4","creation_date":"2014-04-17 07:36:06.753 UTC","favorite_count":"1","last_activity_date":"2014-04-17 09:38:27.203 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2198267","post_type_id":"1","score":"1","tags":"android|android-layout|android-fragments|android-listview","view_count":"279"} +{"id":"46561079","title":"Jaeger standarlone without docker","body":"\u003cp\u003eCannot find any information if Jaeger can be executed without docker?\nDoes a standalone jar exist, or will there be a release in the future for Jaeger like Zipkin has ?\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-10-04 09:09:44.143 UTC","last_activity_date":"2017-10-04 09:09:44.143 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"209334","post_type_id":"1","score":"0","tags":"jaeger","view_count":"6"} +{"id":"32490667","title":"ArrayList becoming huge in program to guess number between 1000-9999","body":"\u003cp\u003eThe program guesses a number between 1000-9999 and the user says how many numbers of the guess are the right number and in the right spot (but only inputs the amount of correct numbers). However, every time I try it, I get a huge list of duplicates but only one entry of the correct number. How would I go about making sure there are no duplicates in my ArrayList? I'd prefer being pointed in the right direction and not just given the answer, thanks! Here is my code (main method was written by my professor and I shouldn't need to change it):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport java.util.ArrayList;\nimport java.util.Random;\nimport javax.swing.JOptionPane;\n\npublic class GuessingGame {\n\n public int numGuesses = 0;\n public ArrayList\u0026lt;Integer\u0026gt; numbers = new ArrayList\u0026lt;Integer\u0026gt;();\n public int guess;\n\n public GuessingGame ( ) {\n for (int i = 1000; i \u0026lt; 10000; i++) {\n numbers.add(i);\n }\n //populating numbers ArrayList\n\n }\n\n public int myGuessIs() {\n numGuesses++;\n //increases number of guesses\n int tempIndex = (int) (Math.random() * numbers.size());\n int myguess = numbers.get(tempIndex);\n //creates a new guess\n guess = myguess;\n //sets global variable\n return myguess;\n }\n\n public int totalNumGuesses() {\n return numGuesses;\n //returns guesses needed to reach solution\n }\n\n public void updateMyGuess(int nmatches) {\n ArrayList\u0026lt;Integer\u0026gt; temp = new ArrayList\u0026lt;Integer\u0026gt;();\n ArrayList\u0026lt;Integer\u0026gt; temp2 = new ArrayList\u0026lt;Integer\u0026gt;();\n int first = guess/1000;\n int second = (guess/100)%10;\n int third = (guess/10)%10;\n int fourth = guess%10;\n //variables for each digit of guess\n if (nmatches == 1) {\n for (int i = 0; i \u0026lt; numbers.size(); i++) {\n if (numbers.get(i)/1000 == first) temp.add(numbers.get(i));\n if ((numbers.get(i)/100)%10 == second) temp.add(numbers.get(i));\n if ((numbers.get(i)/10)%10 == third) temp.add(numbers.get(i));\n if (numbers.get(i)%10 == fourth) temp.add(numbers.get(i));\n }\n numbers.clear();\n numbers.addAll(temp);\n }else if (nmatches == 2) {\n for (int i = 0; i \u0026lt; numbers.size(); i++) {\n if (numbers.get(i)/1000 == first \u0026amp;\u0026amp;\n (numbers.get(i)/100)%10 == second) temp.add(numbers.get(i));\n if (numbers.get(i)/1000 == first \u0026amp;\u0026amp;\n (numbers.get(i)/10)%10 == third) temp.add(numbers.get(i));\n if (numbers.get(i)/1000 == first \u0026amp;\u0026amp;\n numbers.get(i)%10 == fourth) temp.add(numbers.get(i));\n if ((numbers.get(i)/100)%10 == second \u0026amp;\u0026amp;\n (numbers.get(i)/10)%10 == third) temp.add(numbers.get(i));\n if ((numbers.get(i)/100)%10 == second \u0026amp;\u0026amp;\n numbers.get(i)%10 == fourth) temp.add(numbers.get(i));\n if ((numbers.get(i)/10)%10 == third \u0026amp;\u0026amp;\n numbers.get(i)%10 == fourth) temp.add(numbers.get(i));\n }\n numbers.clear();\n numbers.addAll(temp);\n }else if (nmatches == 3) {\n for (int i = 0; i \u0026lt; numbers.size(); i++) {\n if (numbers.get(i)/1000 == first \u0026amp;\u0026amp; (numbers.get(i)/100)%10 == second\n \u0026amp;\u0026amp; (numbers.get(i)/10)%10 == third) temp.add(numbers.get(i));\n if (numbers.get(i)/1000 == first \u0026amp;\u0026amp; (numbers.get(i)/10)%10 == third\n \u0026amp;\u0026amp; numbers.get(i)%10 == fourth) temp.add(numbers.get(i));\n if ((numbers.get(i)/100)%10 == second \u0026amp;\u0026amp; (numbers.get(i)/10)%10 == third\n \u0026amp;\u0026amp; numbers.get(i)%10 == fourth) temp.add(numbers.get(i));\n }\n numbers.clear();\n numbers.addAll(temp);\n }else {\n for (int i = 0; i \u0026lt; numbers.size(); i++) {\n if (numbers.get(i)/1000 == first) temp2.add(numbers.get(i));\n if ((numbers.get(i)/100)%10 == second) temp2.add(numbers.get(i));\n if ((numbers.get(i)/10)%10 == third) temp2.add(numbers.get(i));\n if (numbers.get(i)%10 == fourth) temp2.add(numbers.get(i));\n }\n numbers.removeAll(temp2);\n }\n //creates new smaller ArrayList with better guesses\n //sets numbers as the smaller list\n //update the guess based on the number of matching digits claimed by the user\n for (int i = 0; i \u0026lt; numbers.size(); i++) {\n System.out.println(numbers.get(i) + \" \" + i);\n } //troubleshooting\n\n }\n\n public static void main(String[] args) {\n\n\n\n GuessingGame gamer = new GuessingGame( );\n\n JOptionPane.showMessageDialog(null, \"Think of a number between 1000 and 9999.\\n Click OK when you are ready...\", \"Let's play a game\", JOptionPane.INFORMATION_MESSAGE);\n int numMatches = 0;\n int myguess = 0;\n\n do {\n myguess = gamer.myGuessIs();\n if (myguess == -1) {\n JOptionPane.showMessageDialog(null, \"I don't think your number exists.\\n I could be wrong though...\", \"Mistake\", JOptionPane.INFORMATION_MESSAGE);\n System.exit(0);\n }\n String userInput = JOptionPane.showInputDialog(\"I guess your number is \" + myguess + \". How many digits did I guess correctly?\");\n // quit if the user input nothing (such as pressed ESC)\n if (userInput == null)\n System.exit(0);\n // parse user input, pop up a warning message if the input is invalid\n try {\n numMatches = Integer.parseInt(userInput.trim());\n }\n catch(Exception exception) {\n JOptionPane.showMessageDialog(null, \"Your input is invalid. Please enter a number between 0 and 4\", \"Warning\", JOptionPane.WARNING_MESSAGE);\n numMatches = 0;\n }\n // the number of matches must be between 0 and 4\n if (numMatches \u0026lt; 0 || numMatches \u0026gt; 4) {\n JOptionPane.showMessageDialog(null, \"Your input is invalid. Please enter a number between 0 and 4\", \"Warning\", JOptionPane.WARNING_MESSAGE);\n numMatches = 0;\n }\n if (numMatches == 4)\n break;\n // update based on user input\n gamer.updateMyGuess(numMatches);\n\n } while (true);\n\n // the game ends when the user says all 4 digits are correct\n System.out.println(\"Aha, I got it, your number is \" + myguess + \".\");\n System.out.println(\"I did it in \" + gamer.totalNumGuesses() + \" turns.\");\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"2","creation_date":"2015-09-09 23:24:34.033 UTC","favorite_count":"1","last_activity_date":"2015-09-10 01:24:13.293 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4692055","post_type_id":"1","score":"1","tags":"java|arraylist","view_count":"381"} +{"id":"36594039","title":"Instantiate a prefab in a function with unity","body":"\u003cp\u003eI'm trying to \u003cstrong\u003einstantiate some prefabs in my scene\u003c/strong\u003e, I'm forced to do it in a function (not main thread) because I instantiate a prefab \u003cstrong\u003eonly when I receive some data throught an TCP protocol\u003c/strong\u003e.\u003c/p\u003e\n\n\u003cp\u003eRight now, I'm \u003cem\u003ejust testing with a cube prefab\u003c/em\u003e, but it's not working :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e private void addAircraft(Plane plane)\n {\n listPlane.Add(plane);\n //THIS 2 LINES ARE THE PROBLEM\n GameObject cube = Instantiate(Resources.Load(\"Cube\", typeof(GameObject))) as GameObject;\n cube.transform.position = new Vector3((float)plane.X, 0, (float)plane.Y);\n //\n planeId_Object_Dictionnary.Add(plane.Flight, cube);\n Debug.Log(\"Plane \" + plane.Flight + \" is added\");\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt return me the \u003cstrong\u003eerror\u003c/strong\u003e : \u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eLoad can only be called from the main thread.\nConstructors and field initializers will be executed from the loading thread when loading a scene.\nDon't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function.\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eEven if, a lot of people have encounterd this problem, I can't find a solution that allows me to instantiate my prefab in a function.\u003c/p\u003e","accepted_answer_id":"36595325","answer_count":"1","comment_count":"2","creation_date":"2016-04-13 09:23:47.907 UTC","last_activity_date":"2016-04-14 11:16:38.76 UTC","last_edit_date":"2016-04-14 11:16:38.76 UTC","last_editor_display_name":"","last_editor_user_id":"6198684","owner_display_name":"","owner_user_id":"2812789","post_type_id":"1","score":"1","tags":"c#|unity3d|thread-safety|unityscript|unity5","view_count":"194"} +{"id":"10969393","title":"how to convert Htmlnode of HtmlAgilityPack to webbrowser HtmlElement","body":"\u003cp\u003eI was creating a application that automatically inserts data into html input tags.\nI have xPath for specific tag like '/html/body/form/div/div[2]/div/div/input' and I managed to get HtmlNode with the help of HtmlAgilityPack\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar documentAsIHtmlDocument3 = (mshtml.IHTMLDocument3)webBrowser.Document.DomDocument;\nStringReader sr = new StringReader(documentAsIHtmlDocument3.documentElement.outerHTML);\nhtmlDocument.Load(sr);\n if (htmlDocument.DocumentNode != null)\n {\n HtmlNode currentNode = htmlDocument.DocumentNode.SelectSingleNode(xPath);\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow i need to somehow select HtmlElement from Webbrowser.Document which corresponds to current HtmlNode . Can somebody help me with that?\u003c/p\u003e\n\n\u003cp\u003eBTW: I am not creating any spamming bot.\u003c/p\u003e\n\n\u003cp\u003eHi everyone again. I found solution with recursion, lots of if statements and no htmlagilitypack, but unfortunately i can't post it right now. It seems that i don't have enough reputation.\u003c/p\u003e\n\n\u003cp\u003eStill, if it doesn't make too much effort, can you please tell me how to solve this problem with htmlagilitypack, because my code seems really nasty.\u003c/p\u003e","answer_count":"2","comment_count":"2","creation_date":"2012-06-10 14:14:34.143 UTC","favorite_count":"1","last_activity_date":"2013-02-27 20:35:02.837 UTC","last_edit_date":"2013-02-27 20:35:02.837 UTC","last_editor_display_name":"","last_editor_user_id":"918414","owner_display_name":"","owner_user_id":"1322188","post_type_id":"1","score":"2","tags":"c#|html-agility-pack","view_count":"5590"} +{"id":"32934869","title":"ui-router: trying to reload page with no params","body":"\u003cp\u003eI'm encountering a reload problem with ui-router.\u003c/p\u003e\n\n\u003cp\u003eMy navbar links to a submitForm page:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;a ui-sref=\".submitForm\"\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003esubmitForm can also take parameters, if someone is trying to edit a previously created form. The navbar should always link to a no parameters version. \u003c/p\u003e\n\n\u003cp\u003eHowever, if I'm on a version with parameters, then the navbar just reloads the page with the same parameters. \u003c/p\u003e\n\n\u003cp\u003eAny idea why or how I can fix this? Thanks!\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2015-10-04 15:00:53.18 UTC","last_activity_date":"2015-10-04 15:00:53.18 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3527354","post_type_id":"1","score":"0","tags":"angularjs|angular-ui-router","view_count":"23"} +{"id":"11920629","title":"PHP image and link convertor function","body":"\u003cp\u003ei am relatively new to PHP and i need a function that converts all URLs to clickable links and any URL that has an image extension (i.e. jpg, png, gif) to an image.\u003c/p\u003e\n\n\u003cp\u003eSo what i have so far is\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e function linkandimage($str) {\n $return = preg_replace('@(https?://([-\\w\\.]+[-\\w])+(:\\d+)?(/([\\w/_\\.#-]*(\\?\\S+)?[^\\.\\s])?)?)@', '\u0026lt;a href=\"$1\" target=\"_blank\"\u0026gt;$1\u0026lt;/a\u0026gt;', $str);\n return $return;\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis works find with links, but i haven't gotten a solution for images. Any help would be great,\u003c/p\u003e\n\n\u003cp\u003ethanks\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2012-08-12 07:57:02.763 UTC","last_activity_date":"2012-08-12 08:00:47.087 UTC","last_editor_display_name":"","owner_display_name":"user1310420","post_type_id":"1","score":"0","tags":"php","view_count":"60"} +{"id":"44333014","title":"JSF checkbox value not sent to bean","body":"\u003cp\u003eWhile the view can get all values from the bean, when a checkbox (\u003ccode\u003eh:selectBooleanCheckbox\u003c/code\u003e) is toggled the bean is not updated. The \u003ccode\u003esetSelected()\u003c/code\u003e method in \u003ccode\u003eItem\u003c/code\u003e is never called from the view.\u003c/p\u003e\n\n\u003cp\u003eI've tried changing the scope of the bean to application, using a map instead of a value for the selected property and a foolish attempt at writing my own ajax javascript function.\u003c/p\u003e\n\n\u003cp\u003eThe application I'm working with is a bit legacy so I'm using Tomcat 6, JSF 1.2 and Richfaces 3.3.3.Final.\u003c/p\u003e\n\n\u003cp\u003eIt seems like it should be simple, I think I'm missing something obvious, but I've been at this for two days and can't figure out why the bean isn't updated.\u003c/p\u003e\n\n\u003cp\u003eMy view is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \n\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"\u0026gt;\n\u0026lt;html xmlns=\"http://www.w3.org/1999/xhtml\"\n xmlns:ui=\"http://java.sun.com/jsf/facelets\"\n xmlns:h=\"http://java.sun.com/jsf/html\"\n xmlns:f=\"http://java.sun.com/jsf/core\"\n xmlns:c=\"http://java.sun.com/jstl/core\"\n xmlns:fn=\"http://java.sun.com/jsp/jstl/functions\"\n xmlns:a4j=\"http://richfaces.org/a4j\"\n xmlns:rich=\"http://richfaces.org/rich\"\u0026gt;\n\u0026lt;head\u0026gt;\n\u0026lt;title\u0026gt;JSF\u0026lt;/title\u0026gt;\n\u0026lt;/head\u0026gt;\n \u0026lt;body\u0026gt;\n \u0026lt;h:form id=\"tableForm\"\u0026gt;\n \u0026lt;rich:dataTable id=\"table\" value=\"#{managedBean}\" var=\"item\" width=\"100%\"\u0026gt;\n \u0026lt;rich:column label=\"Select\" align=\"center\" width=\"40px\" \u0026gt;\n \u0026lt;f:facet name=\"header\"\u0026gt;\n \u0026lt;h:outputText value=\"Select\" /\u0026gt;\n \u0026lt;/f:facet\u0026gt;\n \u0026lt;h:selectBooleanCheckbox value=\"#{item.selected}\" \u0026gt;\n \u0026lt;a4j:support execute=\"@this\" event=\"onclick\" ajaxSingle=\"true\"/\u0026gt;\n \u0026lt;/h:selectBooleanCheckbox\u0026gt;\n \u0026lt;/rich:column\u0026gt;\n \u0026lt;rich:column label=\"Name\" align=\"center\" width=\"40px\"\u0026gt;\n \u0026lt;f:facet name=\"header\"\u0026gt;\n \u0026lt;h:outputText value=\"Name\" /\u0026gt;\n \u0026lt;/f:facet\u0026gt;\n \u0026lt;h:outputText value=\"#{item.name}\" /\u0026gt;\n \u0026lt;/rich:column\u0026gt;\n \u0026lt;/rich:dataTable\u0026gt;\n \u0026lt;/h:form\u0026gt;\n \u0026lt;/body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have a managed bean ItemBean in session scope:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport org.richfaces.model.ExtendedTableDataModel;\npublic class ItemBean extends ExtendedTableDataModel\u0026lt;Item\u0026gt;{\n public ItemBean() {super(new ItemProvider());}\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eItemProvider is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport org.richfaces.model.DataProvider;\n\npublic class ItemProvider implements DataProvider\u0026lt;Item\u0026gt;{\n\n private List\u0026lt;Item\u0026gt; items = new ArrayList\u0026lt;Item\u0026gt;();\n\n public ItemProvider(){\n for(int i = 0; i \u0026lt; 10; i++){\n items.add(new Item(i, \"Item \"+i));\n }\n }\n\n public Item getItemByKey(Object key) {return items.get((Integer)key);}\n\n public List\u0026lt;Item\u0026gt; getItemsByRange(int fromIndex, int toIndex) {\n return new ArrayList\u0026lt;Item\u0026gt;(items.subList(fromIndex, toIndex));\n }\n\n public Object getKey(Item arg0) {return arg0.getId();}\n\n public int getRowCount() {return items.size();}\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand Items are:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class Item {\n private final int id;\n private final String name;\n private boolean selected;\n\n public Item(int id, String name) {\n this.id = id;\n this.name = name;\n selected = false;\n }\n\n public int getId(){\n return id;\n }\n\n public String getName(){\n return name;\n }\n\n public boolean isSelected(){\n return selected;\n }\n\n public void setSelected(boolean selected){\n this.selected = selected;\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"44520666","answer_count":"2","comment_count":"0","creation_date":"2017-06-02 15:56:33.41 UTC","last_activity_date":"2017-06-13 11:47:52.893 UTC","last_edit_date":"2017-06-03 16:46:05.163 UTC","last_editor_display_name":"","last_editor_user_id":"157882","owner_display_name":"","owner_user_id":"7264777","post_type_id":"1","score":"0","tags":"jsf|richfaces|javabeans","view_count":"102"} +{"id":"44170062","title":"How to read the content of the text file and keep adding the output to another string in different iteration","body":"\u003cp\u003eThis is my code :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eFile file = new File(ReadTextFile.class.getClassLoader().getResource(\"file/Url.txt\").getFile());\nScanner in = new Scanner(file); \n\nif (file.exists()) {\n while (in.hasNext()) {//in.hasNext()\n postFixString = in.next();\n }\n}\nin.close();\nString newFormedUrl = url + postFixString; \nreturn newFormedUrl;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe file contents are:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ehello\ngoodbye\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eQuestion: I have to modify the above code so that the contents of the file are read one line at a time . How to achieve that? \u003c/p\u003e\n\n\u003cp\u003eEDIT: The contents of the file are not to be concatenated toghter. The method have to read one line at a time ,return that and then the content has to get appeneded to another string.\u003c/p\u003e\n\n\u003cp\u003eeg: \nfile content are:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e/hello\n/goodbye\n\n1.first time the program run ,return /hello, which gets appended to another \n string and is displayed to the user.\n2.If user select \"ok\" \n3.Go back to #1 and display the next string which is /goodbye.\n4. Keep iterating till the end of file.\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"4","comment_count":"1","creation_date":"2017-05-24 23:30:57.823 UTC","last_activity_date":"2017-07-26 12:39:11.987 UTC","last_edit_date":"2017-05-25 17:09:19.907 UTC","last_editor_display_name":"","last_editor_user_id":"4817108","owner_display_name":"","owner_user_id":"4817108","post_type_id":"1","score":"-1","tags":"java","view_count":"79"} +{"id":"39895352","title":"Is MongoDB conditional aggregation available in Meteor 1.4.x ?","body":"\u003cp\u003eI'm trying to publish certain fields to a page based on a parameter of a document in a mongo collection. This is from the MongoDB manual: \u003ca href=\"https://docs.mongodb.com/manual/reference/operator/aggregation/cond/\" rel=\"nofollow\"\u003ehttps://docs.mongodb.com/manual/reference/operator/aggregation/cond/\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eDoes Meteor support conditional aggregation?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e return Cases.find({\n subscribers: { $in: [this.userId] }\n }, {\n fields: { $cond: [ { $eq: ['classified', true] } , Cases.privateFields, Cases.publicFields ] }\n });\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-10-06 11:56:00.29 UTC","last_activity_date":"2016-10-06 13:10:49.67 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4342507","post_type_id":"1","score":"1","tags":"javascript|mongodb|meteor","view_count":"74"} +{"id":"12916663","title":"Proper way to update a value when a object of another model is saved","body":"\u003cp\u003eI'd like to update the value of balance of people that are involved in a transaction (creditor and debitors) as soon as I save the transaction (from admin). Here's my models:\u003c/p\u003e\n\n\u003cpre class=\"lang-py prettyprint-override\"\u003e\u003ccode\u003e#models.py\nclass Person(models.Model):\n first_name = models.CharField(max_length = 30) \n last_name = models.CharField(max_length = 30) \n phone_number = models.CharField(max_length = 30) \n email = models.EmailField('e-mail')\n balance = models.DecimalField(max_digits = 5, decimal_places = 2)\n\nclass Transaction(models.Model):\n creditor = models.ForeignKey(Person,related_name = 'creditor')\n debtors = models.ManyToManyField(Person, related_name = 'debtors')\n value = models.DecimalField(max_digits = 5, decimal_places = 2)\n split = models.BooleanField()\n date = models.DateField()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere's what I thought about, but I only works when the transaction is beeing changed (does not work for the first time save):\u003c/p\u003e\n\n\u003cpre class=\"lang-py prettyprint-override\"\u003e\u003ccode\u003e#admin.py\nclass PersonAdmin(admin.ModelAdmin):\n list_display = ('first_name','last_name','balance')\n\nclass TransactionAdmin(admin.ModelAdmin):\n list_display = ('creditor','value','date')\n list_filter = ('date',)\n date_hierarchy = 'date'\n ordering = ('-date',)\n filter_horizontal = ('debtors',)\n\n def save_model(self,request,obj,form,change):\n obj.save()\n if obj.split:\n split_value = obj.value/(obj.debtors.all().count()+1)\n for debtor in obj.debtors.all():\n p = Person.objects.get(id = debtor.id)\n p.balance = p.balance - split_value\n p.save()\n p = Person.objects.get(id = obj.creditor.id)\n p.balance = p.balance + (obj.debtors.all().count())*split_value \n p.save()\n\nadmin.site.register(Person,PersonAdmin)\nadmin.site.register(Transaction,TransactionAdmin)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm new to Django and really confused about the proper way of doing this. I'd appreciate any help on this.\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2012-10-16 14:14:16 UTC","last_activity_date":"2012-10-16 23:37:46.037 UTC","last_edit_date":"2012-10-16 23:37:46.037 UTC","last_editor_display_name":"","last_editor_user_id":"822023","owner_display_name":"","owner_user_id":"822023","post_type_id":"1","score":"1","tags":"python|django|many-to-many|signals|admin","view_count":"89"} +{"id":"33424457","title":"How to develop a custom shipping module for a new carrier in Netsuite?","body":"\u003cp\u003eI'm interested in developing a custom plugin for a new carrier. I see Netsuite offers UPS, FedEx, USPS, Endecia, etc. I found this page on Netsuite (\u003ca href=\"http://www.netsuite.com/portal/developers/dev-resources.shtml\" rel=\"nofollow\"\u003ehttp://www.netsuite.com/portal/developers/dev-resources.shtml\u003c/a\u003e) but it's not very clear how a developer like me can go about developing this. Does Netsuite even let outside developers create their own shipping modules? I'm interested in developing my own tax module as well one day.\u003c/p\u003e","accepted_answer_id":"33431506","answer_count":"2","comment_count":"0","creation_date":"2015-10-29 20:57:39.27 UTC","favorite_count":"1","last_activity_date":"2016-04-13 13:53:11.993 UTC","last_edit_date":"2015-12-18 23:44:46.853 UTC","last_editor_display_name":"","last_editor_user_id":"3817145","owner_display_name":"","owner_user_id":"1842204","post_type_id":"1","score":"0","tags":"netsuite|shipping|fedex|ups|usps","view_count":"282"} +{"id":"17241917","title":"Is there a multilingual temporal expression tagger that can run on Hadoop?","body":"\u003cp\u003eI need to extract dates from lots of text. The more languages the better; English,Spanish, and Portuguese at a minimum. Does such a tool exist? In Java and Mavenized? Here's what I've found:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003ca href=\"http://code.google.com/p/heideltime/\" rel=\"nofollow\"\u003ehttp://code.google.com/p/heideltime/\u003c/a\u003e many languages and an impressive online demo, but requires some odd external dependencies that I suspect will make cluster deployment hard/impossible\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"http://nlp.stanford.edu/software/sutime.shtml\" rel=\"nofollow\"\u003ehttp://nlp.stanford.edu/software/sutime.shtml\u003c/a\u003e Well documented, but English only. Easy to train?\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"http://natty.joestelmach.com/\" rel=\"nofollow\"\u003ehttp://natty.joestelmach.com/\u003c/a\u003e English only\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/samtingleff/jchronic\" rel=\"nofollow\"\u003ehttps://github.com/samtingleff/jchronic\u003c/a\u003e English only \u003c/li\u003e\n\u003cli\u003e\u003ca href=\"http://code.google.com/p/nltk/source/browse/trunk/nltk_contrib/nltk_contrib/timex.py\" rel=\"nofollow\"\u003ehttp://code.google.com/p/nltk/source/browse/trunk/nltk_contrib/nltk_contrib/timex.py\u003c/a\u003e English only\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eWhere else should I look?\u003c/p\u003e","answer_count":"2","comment_count":"4","creation_date":"2013-06-21 18:23:23.523 UTC","favorite_count":"1","last_activity_date":"2013-08-26 19:38:07.66 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"424631","post_type_id":"1","score":"0","tags":"java|datetime|hadoop|nlp|stanford-nlp","view_count":"511"} +{"id":"25273255","title":"Is there a way to get superscripts to show up in highchart exports","body":"\u003cp\u003eI'm using the sup tag in various places on a Highcharts chart, however I noticed that the superscripts do not display at all when performing an export to any of the supported formats.\u003c/p\u003e\n\n\u003cp\u003eHere's a fiddle that shows the problem:\n\u003ca href=\"http://jsfiddle.net/u7gqgybj/1/\" rel=\"nofollow\"\u003ehttp://jsfiddle.net/u7gqgybj/1/\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eIt displays as expected when viewing the page, but when you export to say \"PNG\" the superscript goes away.\u003c/p\u003e\n\n\u003cp\u003eThe word \"true\" in the title should be superscript.\u003c/p\u003e\n\n\u003cp\u003eIn addition to I've tried a CSS approach and that also doesn't display correctly upon export\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;span style=\"vertical-align:super;font-size:0.83em;\"\u0026gt;foo\u0026lt;/span\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny insight would be appreciated.\u003c/p\u003e","accepted_answer_id":"25273709","answer_count":"1","comment_count":"0","creation_date":"2014-08-12 20:10:47.15 UTC","last_activity_date":"2014-08-12 20:42:56.03 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1775114","post_type_id":"1","score":"2","tags":"highcharts","view_count":"571"} +{"id":"31583683","title":"I get null values while adding on the same index of an array","body":"\u003cp\u003eHey i was trying to recognize numbers from a string and convert them into a String array, but with this code what i get is:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eIE: [null1, null2, exc..]\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI dont know how to take out this null value.\u003cbr\u003e\nI also would like to find a way to do this, without an array, because i should increase its length manually.\u003c/p\u003e\n\n\u003cp\u003eAny tips? Thanks!\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class ProvaToArray {\n public static void main(String[] x) {\n String s = \"1-2-3-4-lorem23ip567um1\";\n String[] ris = toArray(s);\n System.out.println(Arrays.toString(ris)); //should printout [1, 2, 3, 4, 23, 567, 1]\n }\n\n public static String[] toArray(String s){\n String[] l = new String[10];\n int count = 0;\n for(int i = 0; i \u0026lt; s.length() - 1; i++){\n if(estNumber(s.charAt(i) + \"\")){\n l[count] += \"\" + s.charAt(i);\n if(!estNumber(s.charAt(i+1) + \"\")){\n count++;\n }\n }\n if(i+1 == s.length()-1){\n if(estNumber(s.charAt(i+1) + \"\")){\n l[count] = \"\" + s.charAt(i+1);\n }\n }\n }\n return l;\n }\n\n public static boolean estNumber(String i){\n if(i.matches(\"^-?\\\\d+$\"))\n return true;\n else\n return false;\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-07-23 09:43:31.147 UTC","last_activity_date":"2015-07-23 16:47:44.643 UTC","last_edit_date":"2015-07-23 09:50:59.98 UTC","last_editor_display_name":"","last_editor_user_id":"4112664","owner_display_name":"","owner_user_id":"5147398","post_type_id":"1","score":"1","tags":"java|arrays|indexing","view_count":"40"} +{"id":"17485154","title":"MVC4 Razor : HTTPPost and Dictionary","body":"\u003cp\u003eI'm trying to send via httppost a model that contains a dictionnary but that disctionnary is always null... \nHere is my model :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class RoomListModel\n {\n public Dictionary\u0026lt;PersonModel, List\u0026lt;LocationModel\u0026gt;\u0026gt; list { get; set; }\n public String mess { get; set; }\n public RoomListModel(Dictionary\u0026lt;PersonModel, List\u0026lt;LocationModel\u0026gt;\u0026gt; list, String mess)\n {\n this.mess = mess;\n this.list = list;\n }\n\n public RoomListModel()\n {\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn a first view, that kind of model is correctly filled and displayed (i've done some tests). Then I try to send it filled from a view to my controller. Here is my view :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@for (int i = 0; i \u0026lt; Model.list.Count(); i++) {\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;\n @Html.EditorFor(m =\u0026gt; m.list.ElementAt(i).Key.isSelected)\n \u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\n @Html.DisplayFor(m =\u0026gt; m.list.ElementAt(i).Key.login)\n @Html.HiddenFor(m =\u0026gt; m.list.ElementAt(i).Key.login)\n \u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\n @Html.DisplayFor(m =\u0026gt; m.list.ElementAt(i).Key.role)\n @Html.HiddenFor(m =\u0026gt; m.list.ElementAt(i).Key.role)\n \u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\n @for (int j = 0; j \u0026lt; Model.list.ElementAt(i).Value.Count(); j++)\n {\n @Html.EditorFor( m =\u0026gt; m.list.ElementAt(i).Value.ElementAt(j).isSelected )\n @Html.DisplayFor( m =\u0026gt; m.list.ElementAt(i).Value.ElementAt(j).id )\n @Html.HiddenFor( m =\u0026gt; m.list.ElementAt(i).Value.ElementAt(j).id )\n @Html.HiddenFor( m =\u0026gt; m.list.ElementAt(i).Value.ElementAt(j).name)\u0026lt;br /\u0026gt;\n }\n \u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut when that form is send, i've got a nullReferenceException :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[HttpPost]\n public ActionResult CreateInventory(RoomListModel mod)\n {\n int nbPer = 0;\n foreach (var per in mod.list)\n {\n if (per.Key.isSelected)\n {\n nbPer++;\n }\n }\n if (nbPer == 0)\n { ...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOn mod.list.\u003c/p\u003e\n\n\u003cp\u003eCould you please tell me what's wrong with my code ? Is it because of the Dictionnary object ? Thanks !\u003c/p\u003e","answer_count":"0","comment_count":"4","creation_date":"2013-07-05 09:09:34.15 UTC","last_activity_date":"2013-07-05 09:09:34.15 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1372320","post_type_id":"1","score":"0","tags":"c#|asp.net-mvc-4|razor|http-post","view_count":"341"} +{"id":"19653139","title":"How to monitor Tuxedo via mib","body":"\u003cp\u003eCurrently I am tring to write a program to monitor Tuxedo. from the official documents, I found MIB is suitable for writting program to monitor it. I have read a quite lot of document of here \u003ca href=\"http://docs.oracle.com/cd/E13203_01/tuxedo/tux90/rf5/rf5.htm#998207\" rel=\"nofollow\"\u003ehttp://docs.oracle.com/cd/E13203_01/tuxedo/tux90/rf5/rf5.htm#998207\u003c/a\u003e. Although there are so many instructions of very class, there is no any guide to tell me how to use it from the beginning. I have tried to search on github however unfortuanately there is no any code relating to tuxedo mib. Does any one have some good sample code? \u003c/p\u003e\n\n\u003cp\u003eThanks a lot. \u003c/p\u003e","accepted_answer_id":"21217568","answer_count":"2","comment_count":"0","creation_date":"2013-10-29 08:29:52.957 UTC","favorite_count":"1","last_activity_date":"2015-04-07 22:21:26.717 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2559256","post_type_id":"1","score":"0","tags":"c|monitoring|mib|tuxedo","view_count":"616"} +{"id":"45478454","title":"Qt : Write in file","body":"\u003cp\u003eI'm learning how QT is working. I have this little code :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eQApplication app(argc, argv);\nQWidget fenetre;\nfenetre.setFixedWidth(400);\nfenetre.setFixedHeight(400);\n\nQPushButton *bouton = new QPushButton(\"Quit\", \u0026amp;fenetre);\nbouton-\u0026gt;setFixedHeight(50);\nbouton-\u0026gt;setFixedWidth(100);\nbouton-\u0026gt;move(170,310);\n\n\nQLabel *label = new QLabel(\"Something\", \u0026amp;fenetre);\nlabel-\u0026gt;move(30,200);\nQLineEdit *line = new QLineEdit(\u0026amp;fenetre);\nline-\u0026gt;move(200,200);\n\nQWidget::connect(bouton, SIGNAL(clicked()),qApp, SLOT(quit()));\n\nfenetre.show();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm wondering how could I put the content of \u003ccode\u003eQLineEdit\u003c/code\u003e label in a file (.txt) continuously.\nThe goal is to keep what the user put in the \u003ccode\u003eQLineEdit\u003c/code\u003e box in a text file when the program is finished.\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","answer_count":"3","comment_count":"7","creation_date":"2017-08-03 08:11:26.113 UTC","last_activity_date":"2017-08-03 09:35:27.9 UTC","last_edit_date":"2017-08-03 08:20:02.167 UTC","last_editor_display_name":"","last_editor_user_id":"6622587","owner_display_name":"","owner_user_id":"8410171","post_type_id":"1","score":"1","tags":"c++|qt","view_count":"183"} +{"id":"31101156","title":"Connect to Cloud Bigtable from Google App Engine","body":"\u003cp\u003eIt appears that I cannot create a connection from Java class running on AppEngine.\u003c/p\u003e\n\n\u003cp\u003eI use the following library/dependency:\u003c/p\u003e\n\n\u003cpre class=\"lang-xml prettyprint-override\"\u003e\u003ccode\u003e\u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;com.google.cloud.bigtable\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;bigtable-hbase-1.1\u0026lt;/artifactId\u0026gt;\n \u0026lt;version\u0026gt;0.1.9\u0026lt;/version\u0026gt;\n\u0026lt;/dependency\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd the following lines of code:\u003c/p\u003e\n\n\u003cpre class=\"lang-java prettyprint-override\"\u003e\u003ccode\u003eimport org.apache.hadoop.hbase.client.ConnectionFactory;\nimport org.apache.hadoop.hbase.*;\nConfiguration conf = HBaseConfiguration.create();\nconnection = ConnectionFactory.createConnection(conf);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt appears that the \u003ccode\u003eConnectionFactory.createConnection()\u003c/code\u003e method tries to use a restricted class.\u003c/p\u003e\n\n\u003cp\u003eCould you help us in explaining how we can use this on GAE?\u003c/p\u003e\n\n\u003cp\u003eI get the following error when running locally on devserver:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Caused by: java.lang.NoClassDefFoundError: java.lang.management.ManagementFactory is a restricted class. Please see the Google App Engine developer's guide for more details.\n at com.google.appengine.tools.development.agent.runtime.Runtime.reject(Runtime.java:52)\n at org.apache.hadoop.util.ReflectionUtils.\u0026lt;clinit\u0026gt;(ReflectionUtils.java:137)\n at java.lang.Class.forName0(Native Method)\n at java.lang.Class.forName(Class.java:191)\n at com.google.appengine.tools.development.agent.runtime.RuntimeHelper.checkRestricted(RuntimeHelper.java:70)\n at com.google.appengine.tools.development.agent.runtime.Runtime.checkRestricted(Runtime.java:65)\n at org.apache.hadoop.hbase.security.UserProvider.instantiate(UserProvider.java:45)\n at org.apache.hadoop.hbase.client.ConnectionFactory.createConnection(ConnectionFactory.java:214)\n at org.apache.hadoop.hbase.client.ConnectionFactory.createConnection(ConnectionFactory.java:119)\n at org.energyworx.datastore.BigTableTSStorage.\u0026lt;init\u0026gt;(BigTableTSStorage.java:104)\n at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\n at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)\n at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)\n at java.lang.reflect.Constructor.newInstance(Constructor.java:526)\n at java.lang.Class.newInstance(Class.java:379)\n at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:373)\n ... 71 more\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-06-28 14:54:06.763 UTC","last_activity_date":"2016-05-26 19:27:56.33 UTC","last_edit_date":"2016-02-20 03:02:44.89 UTC","last_editor_display_name":"","last_editor_user_id":"3618671","owner_display_name":"","owner_user_id":"5058389","post_type_id":"1","score":"1","tags":"google-app-engine|google-cloud-bigtable","view_count":"458"} +{"id":"43882329","title":"Module within imported package is not visible until explicitly imported","body":"\u003cp\u003eI have a problem I have come across a few times with various packages. I import the package as a whole and try to access a module, but it is apparently not there. However once I explicitly import it separately, it's available back in my original imported namespace. What's happening here? \u003c/p\u003e\n\n\u003cp\u003eExample below:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport email\nprint(email.policy)\nAttributeError: 'module' object has no attribute 'policy'\n\nfrom email import policy\nprint(email.policy)\n\u0026lt;module 'email.policy' from 'C:\\\\Anaconda3\\\\lib\\\\email\\\\policy.py'\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"43882390","answer_count":"1","comment_count":"0","creation_date":"2017-05-10 01:45:04.34 UTC","last_activity_date":"2017-05-10 01:52:46.75 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4294553","post_type_id":"1","score":"0","tags":"python|packages|python-import","view_count":"57"} +{"id":"25331907","title":"First- and last-child in bootstrap/sass not working","body":"\u003cp\u003eI am having trouble using the first- and last-child pseudo classes in my Bootstrap/Sass code. Basically, I am looking to create a whole bunch of blank space above/below the first and last header only. Compass is running, and it's not giving me an error, but when I hard refresh my page in the browser nothing changes. Here is my code, CSS first: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$headings-small-color: black;\n\n@import \"bootstrap-compass\";\n@import \"bootstrap-variables\";\n@import \"bootstrap\";\n\nh1 {\n font-family: 'Almendra SC', serif;\n}\n\nh1:first-child, h1:last-child {\n margin-top: 200 px;\n}\n\nsmall {\n font-family: 'Fanwood text', serif;\n\n}\n\n\n\u0026lt;!DOCTYPE html\u0026gt;\n\u0026lt;html lang=\"en\"\u0026gt;\n\n \u0026lt;head\u0026gt;\n \u0026lt;title\u0026gt;Cat Graveyard\u0026lt;/title\u0026gt;\n \u0026lt;meta charset=\"utf-8\"\u0026gt;\n \u0026lt;meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"\u0026gt;\n \u0026lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"\u0026gt;\n \u0026lt;link href=\"stylesheets/styles.css\" rel=\"stylesheet\"\u0026gt;\n \u0026lt;link href='http://fonts.googleapis.com/css?family=Fanwood+Text|Almendra+SC' rel='stylesheet' type='text/css'\u0026gt;\n \u0026lt;/head\u0026gt;\n\n \u0026lt;body\u0026gt;\n\n \u0026lt;img src=\"Cat_graveyard_cover2.jpg\" class=\"img-responsive\" alt=\"Cover image\"\u0026gt;\n\n \u0026lt;div class=\"container-fluid\"\u0026gt;\n \u0026lt;div class=\"row\"\u0026gt;\n \u0026lt;div class=\"col-sm-8 col-md-offset-2\"\u0026gt;\n \u0026lt;h1\u0026gt;Here Lieth \u0026lt;small\u0026gt;the poor victims of two notorious whiskered criminals.\u0026lt;/small\u0026gt;\u0026lt;/h1\u0026gt;\n \u0026lt;h1\u0026gt;Warning: \u0026lt;small\u0026gt;Graphic images of mangled inanimate objects below.\u0026lt;/small\u0026gt;\u0026lt;/h1\u0026gt;\n \u0026lt;h1\u0026gt;Viewer Discretion \u0026lt;small\u0026gt; is advised for sensitive stuffed animals.\u0026lt;/small\u0026gt;\u0026lt;/h1\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n\n\n \u0026lt;script src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;script src=\"js/bootstrap.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;/body\u0026gt;\n\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI do realize that the more appropriate \"Sassy\" way would be to use a variable for these pseudo classes (and if you would like to give me an example, that'd be okay with me!), but right now my goal is just to get it to work. \u003c/p\u003e\n\n\u003cp\u003eI'm assuming my issue has to do with specificity re: Bootstrap. I'm at a loss of how to fix this, however. In the CSS generated by Compass, the CSS I wrote for the pseudo classes appear last. But, when I \"inspect element\" in the browser it shows the bootstrap CSS overriding the CSS I wrote. \u003c/p\u003e\n\n\u003cp\u003eIDK what to do at this point, any insight would be greatly appreciated! \u003c/p\u003e","accepted_answer_id":"25333151","answer_count":"1","comment_count":"0","creation_date":"2014-08-15 18:18:58.877 UTC","last_activity_date":"2015-08-19 07:44:41.557 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3657228","post_type_id":"1","score":"0","tags":"html|css|twitter-bootstrap|compass-sass|pseudo-class","view_count":"3702"} +{"id":"36600511","title":"randomize observations by groups (blocks)","body":"\u003cp\u003eI have a data frame with \u003ccode\u003eI\u003c/code\u003e obsevations, and each observation belongs to one of \u003ccode\u003eg\u003c/code\u003e categories. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eset.seed(9782)\nI \u0026lt;- 500\ng \u0026lt;- 10\nlibrary(dplyr)\n\nanon_id \u0026lt;- function(n = 1, lenght = 12) {\n randomString \u0026lt;- c(1:n)\n for (i in 1:n)\n {\n randomString[i] \u0026lt;- paste(sample(c(0:9, letters, LETTERS),\n lenght, replace = TRUE),\n collapse = \"\")\n }\n return(randomString)\n}\n\ndf \u0026lt;- data.frame(id = anon_id(n = I, lenght = 16),\n group = sample(1:g, I, T))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to randomly assign each observation to one of \u003ccode\u003eJ\u003c/code\u003e \"urns\", given some vector of probabilities \u003ccode\u003ep\u003c/code\u003e. That is the probability of being assign to urn J=1 is p[1]. The added complexity is that I want to do this block by block.\u003c/p\u003e\n\n\u003cp\u003eIf I ignore the blocks, I can do this easily:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eJ \u0026lt;- 3\np \u0026lt;- c(0.25, 0.5, 0.25)\ndf1 \u0026lt;- df %\u0026gt;% mutate(urn = sample(x = c(1:J), size = I, replace = T, prob = p))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI thought about this method to do it by \"block\"\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e# Block randomization\nrandomize_block \u0026lt;- function(g) {\n df1 \u0026lt;- df %\u0026gt;% filter(group==g) \n size \u0026lt;- nrow(df1)\n df1 \u0026lt;- df1 %\u0026gt;% mutate(urn = sample(x = c(1:J), \n size = size, \n replace = T, \n prob = p))\n return(df1)\n\n}\n\ndf2 \u0026lt;- lapply(1:g, randomize_block)\ndf2 \u0026lt;- data.table::rbindlist(df2)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs there a better way?\u003c/p\u003e","accepted_answer_id":"36600984","answer_count":"2","comment_count":"4","creation_date":"2016-04-13 13:50:30.87 UTC","last_activity_date":"2016-04-13 14:19:39.033 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1800784","post_type_id":"1","score":"0","tags":"r|dplyr","view_count":"66"} +{"id":"44893203","title":"STM32F103C8T6 doesn't work after reset button","body":"\u003cp\u003eI have \"Minimum System Development Board for ARM Microcontroller – STM32F103C8T6\" with ST-LINK V2.\nThis is the main code followed by linker-script then startup: \u003c/p\u003e\n\n\u003cp\u003e1) main:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@@@ Directives\n .thumb @ (same as saying '.code 16')\n .syntax unified\n .cpu cortex-m3\n .fpu softvfp\n .include \"stm32f103.i\"\n .section .text\n .org 0x00\n .global main\n\n .equ GPIOC_CRL ,GPIOC_BASE\n .equ GPIOC_CRH ,GPIOC_BASE + 0x04\n .equ GPIOC_ODR ,GPIOC_BASE + 0x0C\n .equ RCC_APB2ENR ,RCC_BASE + 0x14 \n .equ LEDDELAY ,800000\n\nmain: \n @@ Enable the Port C peripheral clock \n ldr r6, = RCC_APB2ENR\n mov r0, RCC_APB2ENR_IOPCEN\n str r0, [r6]\n\n @@ Set the config and mode bits for Port C bin 15 so it will\n @@ be a push-pull output (up to 50 MHz)\n @@ to '0011'.\n\n ldr r6, = GPIOC_CRH\n ldr r0, = 0x34444444\n str r0, [r6]\n\n @@ Load R2 and R3 with the \"on\" and \"off\" constants\n mov r2, 0x8000 @ value to turn on LED\n mov r3, 0x0 @ value to turn off LED\n\n ldr r6, = GPIOC_ODR @ point to Port C output data register\n\nloop:\n str r2, [r6] @ clear Port C, pin 15, turning on LED\n ldr r1, = LEDDELAY\ndelay1:\n subs r1, 1\n bne delay1\n\n str r3, [r6] @ set Port C, pin 15, turning off LED\n ldr r1, = LEDDELAY\ndelay2:\n subs r1, 1\n bne delay2\n\n b loop @ continue forever\n\n\n @@st-flash write forth.bin 0x08000000\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e2) linker:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e/*\n*****************************************************************************\n**\n\n** File : LinkerScript.ld\n**\n** Abstract : Linker script for STM32F103C8Tx Device with\n** 64KByte FLASH, 20KByte RAM\n**\n** Set heap size, stack size and stack location according\n** to application requirements.\n**\n** Set memory bank area and size if external memory is used.\n**\n** Target : STMicroelectronics STM32\n**\n**\n** Distribution: The file is distributed as is, without any warranty\n** of any kind.\n */\nOUTPUT_FORMAT(\"elf32-littlearm\", \"elf32-bigarm\", \"elf32-littlearm\")\nOUTPUT_ARCH(arm)\n/* Entry Point */\nENTRY(Reset_Handler)\n\n/* Specify the memory areas */\nMEMORY\n{\n FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 64K\n RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 20K\n}\n/* The size of the stack used by the application. NOTE: you need to adjust */\nSTACK_SIZE = 256;\n\n/* The size of the heap used by the application. NOTE: you need to adjust */\nHEAP_SIZE = 0;\n\nSECTIONS\n{\n .isr_vector : { /* the vector table goes FIRST into FLASH */\n KEEP(*(.isr_vector)) /* vector table */\n . = ALIGN(4);\n } \u0026gt;FLASH\n\n .text : { /* code and constants */\n . = ALIGN(4);\n *(.text) /* .text sections (code) */\n *(.text*) /* .text* sections (code) */\n *(.rodata) /* .rodata sections (constants, strings, etc.) */\n *(.rodata*) /* .rodata* sections (constants, strings, etc.) */\n\n KEEP (*(.init))\n KEEP (*(.fini))\n\n . = ALIGN(4);\n } \u0026gt;FLASH\n\n .preinit_array : {\n PROVIDE_HIDDEN (__preinit_array_start = .);\n KEEP (*(.preinit_array*))\n PROVIDE_HIDDEN (__preinit_array_end = .);\n } \u0026gt;FLASH\n\n .init_array : {\n PROVIDE_HIDDEN (__init_array_start = .);\n KEEP (*(SORT(.init_array.*)))\n KEEP (*(.init_array*))\n PROVIDE_HIDDEN (__init_array_end = .);\n } \u0026gt;FLASH\n\n .fini_array : {\n PROVIDE_HIDDEN (__fini_array_start = .);\n KEEP (*(.fini_array*))\n KEEP (*(SORT(.fini_array.*)))\n PROVIDE_HIDDEN (__fini_array_end = .);\n } \u0026gt;FLASH\n\n _etext = .; /* global symbols at end of code */\n\n .stack : {\n __stack_start__ = .;\n . = . + STACK_SIZE;\n . = ALIGN(4);\n __stack_end__ = .;\n } \u0026gt;RAM\n\n .data : AT (_etext) {\n __data_load = LOADADDR (.data);\n __data_start = .;\n *(.data) /* .data sections */\n *(.data*) /* .data* sections */\n . = ALIGN(4);\n __data_end__ = .;\n _edata = __data_end__;\n } \u0026gt;RAM\n\n .bss : {\n __bss_start__ = .;\n *(.bss)\n *(.bss*)\n *(COMMON)\n . = ALIGN(4);\n _ebss = .; /* define a global symbol at bss end */\n __bss_end__ = .;\n } \u0026gt;RAM\n\n PROVIDE ( end = _ebss );\n PROVIDE ( _end = _ebss );\n PROVIDE ( __end__ = _ebss );\n\n .heap : {\n __heap_start__ = .;\n . = . + HEAP_SIZE;\n . = ALIGN(4);\n __heap_end__ = .;\n } \u0026gt;RAM\n\n /* Remove information from the standard libraries \n /DISCARD/ : {\n libc.a ( * )\n libm.a ( * )\n libgcc.a ( * )\n }\n /*.ARM.attributes 0 : { *(.ARM.attributes) }*/\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e3) startup:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e /**\n *************** (C) COPYRIGHT 2016 STMicroelectronics ************************\n * @file startup_stm32f103xb.s\n * @author MCD Application Team\n * @version V4.1.0\n * @date 29-April-2016\n * @brief STM32F103xB Devices vector table for Atollic toolchain.\n * This module performs:\n * - Set the initial SP\n * - Set the initial PC == Reset_Handler,\n * - Set the vector table entries with the exceptions ISR address\n * - Configure the clock system \n * - Branches to main in the C library (which eventually\n * calls main()).\n * After Reset the Cortex-M3 processor is in Thread mode,\n * priority is Privileged, and the Stack is set to Main.\n ******************************************************************************\n */\n\n .syntax unified\n .cpu cortex-m3\n .fpu softvfp\n .thumb\n .global __stack_start__\n .global __stack_end__\n .global g_pfnVectors\n .global Default_Handler\n\n /* start address for the initialization values of the .data section.\n defined in linker script */\n .word __data_load\n /* start address for the .data section. defined in linker script */\n .word __data_start\n /* end address for the .data section. defined in linker script */\n .word __data_end__\n /* start address for the .bss section. defined in linker script */\n .word __bss_start__\n /* end address for the .bss section. defined in linker script */\n .word __bss_end__\n\n .equ BootRAM, 0xF108F85F\n /**\n * @brief This is the code that gets called when the processor first\n * starts execution following a reset event. Only the absolutely\n * necessary set is performed, after which the application\n * supplied main() routine is called.\n * @param None\n * @retval : None\n */\n\n .section .text.Reset_Handler\n .weak Reset_Handler\n .type Reset_Handler, %function\n Reset_Handler:\n\n /* Copy the data segment initializers from flash to SRAM */\n movs r1, #0\n b LoopCopyDataInit\n\n CopyDataInit:\n ldr r3, =__data_load\n ldr r3, [r3, r1]\n str r3, [r0, r1]\n adds r1, r1, #4\n\n LoopCopyDataInit:\n ldr r0, =__data_start\n ldr r3, =__data_end__\n adds r2, r0, r1\n cmp r2, r3\n bcc CopyDataInit\n ldr r2, =__bss_start__\n b LoopFillZerobss\n /* Zero fill the bss segment. */\n FillZerobss:\n movs r3, #0\n str r3, [r2], #4\n\n LoopFillZerobss:\n ldr r3, =__bss_end__\n cmp r2, r3\n bcc FillZerobss\n\n /* Call the clock system intitialization function.*/\n /*bl SystemInit*/\n /* Call static constructors */\n /*bl __libc_init_array*/\n /* Call the application's entry point.*/\n bl main\n bx lr\n .size Reset_Handler, .-Reset_Handler\n\n /**\n * @brief This is the code that gets called when the processor receives an\n * unexpected interrupt. This simply enters an infinite loop, preserving\n * the system state for examination by a debugger.\n *\n * @param None\n * @retval : None\n */\n .section .text.Default_Handler,\"ax\",%progbits\n Default_Handler:\n Infinite_Loop:\n b Infinite_Loop\n .size Default_Handler, .-Default_Handler\n /******************************************************************************\n *\n * The minimal vector table for a Cortex M3. Note that the proper constructs\n * must be placed on this to ensure that it ends up at physical address\n * 0x0000.0000.\n *\n ******************************************************************************/\n .section .isr_vector,\"a\",%progbits\n .type g_pfnVectors, %object\n .size g_pfnVectors, .-g_pfnVectors\n\n\n g_pfnVectors:\n\n .word __stack_end__\n .word Reset_Handler\n .word NMI_Handler\n .word HardFault_Handler\n .word MemManage_Handler\n .word BusFault_Handler\n .word UsageFault_Handler\n .word 0\n .word 0\n .word 0\n .word 0\n .word SVC_Handler\n .word DebugMon_Handler\n .word 0\n .word PendSV_Handler\n .word SysTick_Handler\n .word WWDG_IRQHandler\n .word PVD_IRQHandler\n .word TAMPER_IRQHandler\n .word RTC_IRQHandler\n .word FLASH_IRQHandler\n .word RCC_IRQHandler\n .word EXTI0_IRQHandler\n .word EXTI1_IRQHandler\n .word EXTI2_IRQHandler\n .word EXTI3_IRQHandler\n .word EXTI4_IRQHandler\n .word DMA1_Channel1_IRQHandler\n .word DMA1_Channel2_IRQHandler\n .word DMA1_Channel3_IRQHandler\n .word DMA1_Channel4_IRQHandler\n .word DMA1_Channel5_IRQHandler\n .word DMA1_Channel6_IRQHandler\n .word DMA1_Channel7_IRQHandler\n .word ADC1_2_IRQHandler\n .word USB_HP_CAN1_TX_IRQHandler\n .word USB_LP_CAN1_RX0_IRQHandler\n .word CAN1_RX1_IRQHandler\n .word CAN1_SCE_IRQHandler\n .word EXTI9_5_IRQHandler\n .word TIM1_BRK_IRQHandler\n .word TIM1_UP_IRQHandler\n .word TIM1_TRG_COM_IRQHandler\n .word TIM1_CC_IRQHandler\n .word TIM2_IRQHandler\n .word TIM3_IRQHandler\n .word TIM4_IRQHandler\n .word I2C1_EV_IRQHandler\n .word I2C1_ER_IRQHandler\n .word I2C2_EV_IRQHandler\n .word I2C2_ER_IRQHandler\n .word SPI1_IRQHandler\n .word SPI2_IRQHandler\n .word USART1_IRQHandler\n .word USART2_IRQHandler\n .word USART3_IRQHandler\n .word EXTI15_10_IRQHandler\n .word RTC_Alarm_IRQHandler\n .word USBWakeUp_IRQHandler\n .word 0\n .word 0\n .word 0\n .word 0\n .word 0\n .word 0\n .word 0\n .word BootRAM /* @0x108. This is for boot in RAM mode for\n STM32F10x Medium Density devices. */\n\n /*******************************************************************************\n *\n * Provide weak aliases for each Exception handler to the Default_Handler.\n * As they are weak aliases, any function with the same name will override\n * this definition.\n *\n *******************************************************************************/\n\n .weak NMI_Handler\n .thumb_set NMI_Handler,Default_Handler\n\n .weak HardFault_Handler\n .thumb_set HardFault_Handler,Default_Handler\n\n .weak MemManage_Handler\n .thumb_set MemManage_Handler,Default_Handler\n\n .weak BusFault_Handler\n .thumb_set BusFault_Handler,Default_Handler\n\n .weak UsageFault_Handler\n .thumb_set UsageFault_Handler,Default_Handler\n\n .weak SVC_Handler\n .thumb_set SVC_Handler,Default_Handler\n\n .weak DebugMon_Handler\n .thumb_set DebugMon_Handler,Default_Handler\n\n .weak PendSV_Handler\n .thumb_set PendSV_Handler,Default_Handler\n\n .weak SysTick_Handler\n .thumb_set SysTick_Handler,Default_Handler\n\n .weak WWDG_IRQHandler\n .thumb_set WWDG_IRQHandler,Default_Handler\n\n .weak PVD_IRQHandler\n .thumb_set PVD_IRQHandler,Default_Handler\n\n .weak TAMPER_IRQHandler\n .thumb_set TAMPER_IRQHandler,Default_Handler\n\n .weak RTC_IRQHandler\n .thumb_set RTC_IRQHandler,Default_Handler\n\n .weak FLASH_IRQHandler\n .thumb_set FLASH_IRQHandler,Default_Handler\n\n .weak RCC_IRQHandler\n .thumb_set RCC_IRQHandler,Default_Handler\n\n .weak EXTI0_IRQHandler\n .thumb_set EXTI0_IRQHandler,Default_Handler\n\n .weak EXTI1_IRQHandler\n .thumb_set EXTI1_IRQHandler,Default_Handler\n\n .weak EXTI2_IRQHandler\n .thumb_set EXTI2_IRQHandler,Default_Handler\n\n .weak EXTI3_IRQHandler\n .thumb_set EXTI3_IRQHandler,Default_Handler\n\n .weak EXTI4_IRQHandler\n .thumb_set EXTI4_IRQHandler,Default_Handler\n\n .weak DMA1_Channel1_IRQHandler\n .thumb_set DMA1_Channel1_IRQHandler,Default_Handler\n\n .weak DMA1_Channel2_IRQHandler\n .thumb_set DMA1_Channel2_IRQHandler,Default_Handler\n\n .weak DMA1_Channel3_IRQHandler\n .thumb_set DMA1_Channel3_IRQHandler,Default_Handler\n\n .weak DMA1_Channel4_IRQHandler\n .thumb_set DMA1_Channel4_IRQHandler,Default_Handler\n\n .weak DMA1_Channel5_IRQHandler\n .thumb_set DMA1_Channel5_IRQHandler,Default_Handler\n\n .weak DMA1_Channel6_IRQHandler\n .thumb_set DMA1_Channel6_IRQHandler,Default_Handler\n\n .weak DMA1_Channel7_IRQHandler\n .thumb_set DMA1_Channel7_IRQHandler,Default_Handler\n\n .weak ADC1_2_IRQHandler\n .thumb_set ADC1_2_IRQHandler,Default_Handler\n\n .weak USB_HP_CAN1_TX_IRQHandler\n .thumb_set USB_HP_CAN1_TX_IRQHandler,Default_Handler\n\n .weak USB_LP_CAN1_RX0_IRQHandler\n .thumb_set USB_LP_CAN1_RX0_IRQHandler,Default_Handler\n\n .weak CAN1_RX1_IRQHandler\n .thumb_set CAN1_RX1_IRQHandler,Default_Handler\n\n .weak CAN1_SCE_IRQHandler\n .thumb_set CAN1_SCE_IRQHandler,Default_Handler\n\n .weak EXTI9_5_IRQHandler\n .thumb_set EXTI9_5_IRQHandler,Default_Handler\n\n .weak TIM1_BRK_IRQHandler\n .thumb_set TIM1_BRK_IRQHandler,Default_Handler\n\n .weak TIM1_UP_IRQHandler\n .thumb_set TIM1_UP_IRQHandler,Default_Handler\n\n .weak TIM1_TRG_COM_IRQHandler\n .thumb_set TIM1_TRG_COM_IRQHandler,Default_Handler\n\n .weak TIM1_CC_IRQHandler\n .thumb_set TIM1_CC_IRQHandler,Default_Handler\n\n .weak TIM2_IRQHandler\n .thumb_set TIM2_IRQHandler,Default_Handler\n\n .weak TIM3_IRQHandler\n .thumb_set TIM3_IRQHandler,Default_Handler\n\n .weak TIM4_IRQHandler\n .thumb_set TIM4_IRQHandler,Default_Handler\n\n .weak I2C1_EV_IRQHandler\n .thumb_set I2C1_EV_IRQHandler,Default_Handler\n\n .weak I2C1_ER_IRQHandler\n .thumb_set I2C1_ER_IRQHandler,Default_Handler\n\n .weak I2C2_EV_IRQHandler\n .thumb_set I2C2_EV_IRQHandler,Default_Handler\n\n .weak I2C2_ER_IRQHandler\n .thumb_set I2C2_ER_IRQHandler,Default_Handler\n\n .weak SPI1_IRQHandler\n .thumb_set SPI1_IRQHandler,Default_Handler\n\n .weak SPI2_IRQHandler\n .thumb_set SPI2_IRQHandler,Default_Handler\n\n .weak USART1_IRQHandler\n .thumb_set USART1_IRQHandler,Default_Handler\n\n .weak USART2_IRQHandler\n .thumb_set USART2_IRQHandler,Default_Handler\n\n .weak USART3_IRQHandler\n .thumb_set USART3_IRQHandler,Default_Handler\n\n .weak EXTI15_10_IRQHandler\n .thumb_set EXTI15_10_IRQHandler,Default_Handler\n\n .weak RTC_Alarm_IRQHandler\n .thumb_set RTC_Alarm_IRQHandler,Default_Handler\n\n .weak USBWakeUp_IRQHandler\n .thumb_set USBWakeUp_IRQHandler,Default_Handler\n\n .align\n /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I try to flash this code with\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003est-flash write main.bin 0x08000000\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI get the following :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003est-flash 1.3.1\n2017-07-03T21:42:39 INFO src/common.c: Loading device parameters....\n2017-07-03T21:42:39 INFO src/common.c: Device connected is: F1 Medium-density device, id 0x20036410\n2017-07-03T21:42:39 INFO src/common.c: SRAM size: 0x5000 bytes (20 KiB), Flash: 0x20000 bytes (128 KiB) in pages of 1024 bytes\n2017-07-03T21:42:39 INFO src/common.c: Attempting to write 420 (0x1a4) bytes to stm32 address: 134217728 (0x8000000)\nFlash page at addr: 0x08000000 erased\n2017-07-03T21:42:40 INFO src/common.c: Finished erasing 1 pages of 1024 (0x400) bytes\n2017-07-03T21:42:40 INFO src/common.c: Starting Flash write for VL/F0/F3 core id\n2017-07-03T21:42:40 INFO src/flash_loader.c: Successfully loaded flash loader in sram\n0/0 pages written\n2017-07-03T21:42:40 INFO src/common.c: Starting verification of write complete\n2017-07-03T21:42:40 INFO src/common.c: Flash written and verified! jolly good!\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand the LED doesn't flash, but when I first upload any code using ARDUINO IDE(for this board) then I run the prevouis command, the led starts blinking, but if I pushed the reset button or unplug then plug st-link agian the LED stop blinking.\u003c/p\u003e\n\n\u003cp\u003eSo I think the problem is with my linker or the startup code, but I don't know where it is.\u003c/p\u003e\n\n\u003cp\u003eWhat is wrong with startup code or linker script?\u003c/p\u003e\n\n\u003cp\u003e----- EDIT -----\u003c/p\u003e\n\n\u003cp\u003eresult of disassembly:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003earm-none-eabi-objdump -D main.elf \u003e dump.S\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cpre\u003e\u003ccode\u003emain.elf: file format elf32-littlearm\n\n\nDisassembly of section .isr_vector:\n\n08000000 \u0026lt;g_pfnVectors\u0026gt;:\n 8000000: 20005000 andcs r5, r0, r0\n 8000004: 08000165 stmdaeq r0, {r0, r2, r5, r6, r8}\n 8000008: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 800000c: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 8000010: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 8000014: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 8000018: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n ...\n 800002c: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 8000030: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 8000034: 00000000 andeq r0, r0, r0\n 8000038: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 800003c: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 8000040: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 8000044: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 8000048: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 800004c: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 8000050: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 8000054: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 8000058: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 800005c: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 8000060: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 8000064: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 8000068: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 800006c: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 8000070: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 8000074: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 8000078: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 800007c: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 8000080: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 8000084: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 8000088: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 800008c: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 8000090: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 8000094: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 8000098: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 800009c: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 80000a0: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 80000a4: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 80000a8: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 80000ac: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 80000b0: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 80000b4: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 80000b8: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 80000bc: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 80000c0: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 80000c4: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 80000c8: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 80000cc: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 80000d0: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 80000d4: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 80000d8: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 80000dc: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 80000e0: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 80000e4: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n 80000e8: 080001a5 stmdaeq r0, {r0, r2, r5, r7, r8}\n ...\n 8000108: f108f85f ; \u0026lt;UNDEFINED\u0026gt; instruction: 0xf108f85f\n\nDisassembly of section .text:\n\n08000110 \u0026lt;main\u0026gt;:\n 8000110: 4e0a ldr r6, [pc, #40] ; (800013c \u0026lt;delay2+0x8\u0026gt;)\n 8000112: f04f 0010 mov.w r0, #16\n 8000116: 6030 str r0, [r6, #0]\n 8000118: 4e09 ldr r6, [pc, #36] ; (8000140 \u0026lt;delay2+0xc\u0026gt;)\n 800011a: 480a ldr r0, [pc, #40] ; (8000144 \u0026lt;delay2+0x10\u0026gt;)\n 800011c: 6030 str r0, [r6, #0]\n 800011e: f44f 4200 mov.w r2, #32768 ; 0x8000\n 8000122: f04f 0300 mov.w r3, #0\n 8000126: 4e08 ldr r6, [pc, #32] ; (8000148 \u0026lt;delay2+0x14\u0026gt;)\n\n08000128 \u0026lt;loop\u0026gt;:\n 8000128: 6032 str r2, [r6, #0]\n 800012a: 4908 ldr r1, [pc, #32] ; (800014c \u0026lt;delay2+0x18\u0026gt;)\n\n0800012c \u0026lt;delay1\u0026gt;:\n 800012c: 3901 subs r1, #1\n 800012e: d1fd bne.n 800012c \u0026lt;delay1\u0026gt;\n 8000130: 6033 str r3, [r6, #0]\n 8000132: 4906 ldr r1, [pc, #24] ; (800014c \u0026lt;delay2+0x18\u0026gt;)\n\n08000134 \u0026lt;delay2\u0026gt;:\n 8000134: 3901 subs r1, #1\n 8000136: d1fd bne.n 8000134 \u0026lt;delay2\u0026gt;\n 8000138: e7f6 b.n 8000128 \u0026lt;loop\u0026gt;\n 800013a: bf00 nop\n 800013c: 40021014 andmi r1, r2, r4, lsl r0\n 8000140: 40011004 andmi r1, r1, r4\n 8000144: 34444444 strbcc r4, [r4], #-1092 ; 0xfffffbbc\n 8000148: 4001100c andmi r1, r1, ip\n 800014c: 000c3500 andeq r3, ip, r0, lsl #10\n 8000150: 080001a8 stmdaeq r0, {r3, r5, r7, r8}\n 8000154: 20005000 andcs r5, r0, r0\n 8000158: 20005000 andcs r5, r0, r0\n 800015c: 20005000 andcs r5, r0, r0\n 8000160: 20005000 andcs r5, r0, r0\n\n08000164 \u0026lt;Reset_Handler\u0026gt;:\n 8000164: 2100 movs r1, #0\n 8000166: e003 b.n 8000170 \u0026lt;LoopCopyDataInit\u0026gt;\n\n08000168 \u0026lt;CopyDataInit\u0026gt;:\n 8000168: 4b09 ldr r3, [pc, #36] ; (8000190 \u0026lt;LoopFillZerobss+0xc\u0026gt;)\n 800016a: 585b ldr r3, [r3, r1]\n 800016c: 5043 str r3, [r0, r1]\n 800016e: 3104 adds r1, #4\n\n08000170 \u0026lt;LoopCopyDataInit\u0026gt;:\n 8000170: 4808 ldr r0, [pc, #32] ; (8000194 \u0026lt;LoopFillZerobss+0x10\u0026gt;)\n 8000172: 4b09 ldr r3, [pc, #36] ; (8000198 \u0026lt;LoopFillZerobss+0x14\u0026gt;)\n 8000174: 1842 adds r2, r0, r1\n 8000176: 429a cmp r2, r3\n 8000178: d3f6 bcc.n 8000168 \u0026lt;CopyDataInit\u0026gt;\n 800017a: 4a08 ldr r2, [pc, #32] ; (800019c \u0026lt;LoopFillZerobss+0x18\u0026gt;)\n 800017c: e002 b.n 8000184 \u0026lt;LoopFillZerobss\u0026gt;\n\n0800017e \u0026lt;FillZerobss\u0026gt;:\n 800017e: 2300 movs r3, #0\n 8000180: f842 3b04 str.w r3, [r2], #4\n\n08000184 \u0026lt;LoopFillZerobss\u0026gt;:\n 8000184: 4b06 ldr r3, [pc, #24] ; (80001a0 \u0026lt;LoopFillZerobss+0x1c\u0026gt;)\n 8000186: 429a cmp r2, r3\n 8000188: d3f9 bcc.n 800017e \u0026lt;FillZerobss\u0026gt;\n 800018a: f7ff ffc1 bl 8000110 \u0026lt;main\u0026gt;\n 800018e: 4770 bx lr\n 8000190: 080001a8 stmdaeq r0, {r3, r5, r7, r8}\n 8000194: 20005000 andcs r5, r0, r0\n 8000198: 20005000 andcs r5, r0, r0\n 800019c: 20005000 andcs r5, r0, r0\n 80001a0: 20005000 andcs r5, r0, r0\n\n080001a4 \u0026lt;ADC1_2_IRQHandler\u0026gt;:\n 80001a4: e7fe b.n 80001a4 \u0026lt;ADC1_2_IRQHandler\u0026gt;\n ...\n\nDisassembly of section .stack:\n\n20000000 \u0026lt;__stack_start__\u0026gt;:\n ...\n\nDisassembly of section .ARM.attributes:\n\n00000000 \u0026lt;.ARM.attributes\u0026gt;:\n 0: 00002041 andeq r2, r0, r1, asr #32\n 4: 61656100 cmnvs r5, r0, lsl #2\n 8: 01006962 tsteq r0, r2, ror #18\n c: 00000016 andeq r0, r0, r6, lsl r0\n 10: 726f4305 rsbvc r4, pc, #335544320 ; 0x14000000\n 14: 2d786574 cfldr64cs mvdx6, [r8, #-464]! ; 0xfffffe30\n 18: 0600334d streq r3, [r0], -sp, asr #6\n 1c: 094d070a stmdbeq sp, {r1, r3, r8, r9, sl}^\n 20: Address 0x0000000000000020 is out of bounds.\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"44895337","answer_count":"1","comment_count":"3","creation_date":"2017-07-03 20:07:11.87 UTC","favorite_count":"1","last_activity_date":"2017-07-04 05:19:10.39 UTC","last_edit_date":"2017-07-04 05:19:10.39 UTC","last_editor_display_name":"","last_editor_user_id":"5556374","owner_display_name":"","owner_user_id":"5556374","post_type_id":"1","score":"1","tags":"arm|startup|stm32|linker-scripts|gnu-toolchain","view_count":"110"} +{"id":"26766941","title":"Update field in Object array in Meteor (mongoDB)","body":"\u003cp\u003eI have the following document:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n \"gameName\":\"Shooter\",\n \"details\":[\n {\n \"submitted\":1415215991387,\n \"author\":\"XYZ\",\n \"subPlayer\":{\n \"members\":{\n \"squad1\":[\n {\n \"username\":\"John\",\n \"deaths\":0\n }\n ]\n },\n \"gameSlug\":\"0-shooter\"\n }\n }\n ],\n \"userId\":\"foL9NpoZFq9AYmXyj\",\n \"author\":\"Peter\",\n \"submitted\":1415215991608,\n \"lastModified\":1415215991608,\n \"participants\":[\n \"CXRR4sGf5AdvSjdgc\",\n \"foL9NpoZFq9AYmXyj\"\n ],\n \"slug\":\"1-shooterConv\",\n \"_id\":\"p2QQ4TBwidjeZX6YS\"\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e... and the following Meteor method:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eMeteor.methods({\n updateDeaths: function(gameSlug, user, squad) {\n Stats.update({details.subPlayer.gameSlug: gameSlug}, ...}); // ???\n }\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy goal is to update the field \u003ccode\u003edeaths\u003c/code\u003e. The method has the argument \u003ccode\u003euser\u003c/code\u003e which is the user object (username = \u003ccode\u003euser.username\u003c/code\u003e). Furthermore, the argument \u003ccode\u003esquad\u003c/code\u003e is the squad name as string, e.g. \u003ccode\u003esquad1\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eHow can I do this?\u003c/p\u003e\n\n\u003cp\u003eAny help would be greatly appreciated.\u003c/p\u003e","accepted_answer_id":"26767891","answer_count":"1","comment_count":"0","creation_date":"2014-11-05 20:55:43.567 UTC","last_activity_date":"2014-11-06 20:04:38.093 UTC","last_edit_date":"2014-11-05 22:38:58.123 UTC","last_editor_display_name":"","last_editor_user_id":"1269037","owner_display_name":"","owner_user_id":"3475602","post_type_id":"1","score":"0","tags":"javascript|mongodb|meteor","view_count":"845"} +{"id":"25154685","title":"How do I write this SQL query using Linq/LAMBDA (with inner and left outer join)?","body":"\u003cpre\u003e\u003ccode\u003e SELECT * FROM paquet_esc PE\n INNER JOIN depot D \n ON PE.id_paquet_esc = D.paquet_esc_id\n INNER JOIN fichier_esc FE \n ON D.fichier_id = FE.id_fichier\n INNER JOIN engin EN \n ON FE.engin_id = EN.id_engin\n LEFT OUTER JOIN reception R \n ON FE.id_fichier = R.fichier_id\n LEFT OUTER JOIN traitement T \n ON FE.id_fichier = T.fichier_id\n LEFT OUTER JOIN code_erreur_traitement CET \n ON T.code_erreur_id = CET.id_code_erreur\n LEFT OUTER JOIN integration I \n ON FE.id_fichier = I.fichier_id\n LEFT OUTER JOIN envoi EI \n ON FE.id_fichier = EI.fichier_id \n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"2","creation_date":"2014-08-06 07:35:10.85 UTC","last_activity_date":"2014-08-06 07:51:17.137 UTC","last_edit_date":"2014-08-06 07:38:09.77 UTC","last_editor_display_name":"","last_editor_user_id":"1100080","owner_display_name":"","owner_user_id":"3066993","post_type_id":"1","score":"-1","tags":"c#|sql|linq|outer-join","view_count":"180"} +{"id":"40444953","title":"Pivot table and Dates","body":"\u003cp\u003eI am a newbie, and I am sort of a enthusiastic learner, a beginner who is making many mistakes. On my pivot table which is picking up two years worth of dates, I am keen to only choose the first two most recent dates, rather than using a slicer. I have tried to make it a little bit dynamic, but I am constantly getting error messages, \u003c/p\u003e\n\n\u003cp\u003eI was trying to have cells in my spreadsheet which is from date and a two date, or a code that picks the first two most recent dates. I really want the code to work and pulling my hair out, as I have few other pivot tables. Every time I put the cell reference in between, where the dates are I keep getting coding errors.\u003c/p\u003e\n\n\u003cp\u003eI want the pivot items more dynamic as like before, I will try to add a validation on the date from and date to make it lot more dynamic. \u003c/p\u003e\n\n\u003cp\u003eI want the pivot items to be x first date and y as the second date referring to two cells on the sheet, which I can amend on the sheet, and another code that just picks the first two most recent dates.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSub DateSlection ()\n\n With ActiveSheet\n.PivotTables(\"PivotTable4\").PivotFields(\"Date\")\n .PivotItems(\"11/2/2016\").Visible = True\n .PivotItems(\"10/26/2016\").Visible = True\n End With\n End Sub\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ekind regards \u003c/p\u003e\n\n\u003cp\u003eAli\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2016-11-06 00:58:00.273 UTC","last_activity_date":"2016-11-07 09:02:09.3 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3287522","post_type_id":"1","score":"0","tags":"excel|vba|pivot|pivot-table","view_count":"82"} +{"id":"1642413","title":"Why do so many apps/frameworks keep their configuration files in an un-executed format?","body":"\u003cp\u003eMany frameworks keep their configuration files in a language different from the rest of the program. Eg, Appengine keeps the configuration in yaml format. to compare, DJango settings.py is a python module. There are many disadvantages I can see with this.\u003c/p\u003e\n\n\u003cp\u003eIf its in same language as rest of the program, I can\u003c/p\u003e\n\n\u003cp\u003eDo interesting things in the configuration file.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e MEDIA_DIR = os.path.join(os.path.dir(__file__), 'media')\n #Or whaever the correct cals are, you get the idea.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cul\u003e\n\u003cli\u003eDon't have to learn a new(admittedly lightweight) format\u003c/li\u003e\n\u003cli\u003eMy tools work as expected with it.\u003c/li\u003e\n\u003cli\u003eI can just do \u003ccode\u003eimport conf\u003c/code\u003e etc.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eI can see the advantages if it were a heavyweight language like C/C++ etc, but for python why does it make sense. It just seems like taking away power without adding any benefits.\u003c/p\u003e","accepted_answer_id":"1642424","answer_count":"5","comment_count":"0","creation_date":"2009-10-29 09:01:19.607 UTC","last_activity_date":"2009-10-29 15:11:48.06 UTC","last_edit_date":"2009-10-29 09:14:23.927 UTC","last_editor_display_name":"","last_editor_user_id":"114917","owner_display_name":"","owner_user_id":"121793","post_type_id":"1","score":"2","tags":"python|configuration|settings|yaml","view_count":"534"} +{"id":"21629430","title":"0.0 value when data pass over from First Activity to Next(Android)","body":"\u003cp\u003ei wanted to pass my distance and duration over to the next page, but the result display is 0.0 for both\u003c/p\u003e\n\n\u003cp\u003efirst Activity\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e btnStop.setOnClickListener(new OnClickListener() \n {\n @Override\n public void onClick(View v) {\n startButtonClicked=false;\n startDistance=false;\n Double value=Double.valueOf(distance.getText().toString());\n Double durationValue=time;\n Intent intent = new Intent(MainActivity.this, FinishActivity.class);\n\n intent.putExtra(\"dist\", value);\n intent.putExtra(\"time\",durationValue);\n startActivity(intent);\n finish();\n }\n });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eat the Activity where it display\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_finish);\n Bundle extras = getIntent().getExtras();\n if (extras != null) \n {\n Double value = extras.getDouble(\"dist\");\n Double durationValue = extras.getDouble(\"time\");\n displayDistance=(TextView)findViewById(R.id.finishDistance);\n displayDistance.setText(\"Distance: \" + value);\n\n displayDuration=(TextView)findViewById(R.id.finishDuration);\n displayDuration.setText(\"Duration: \" + durationValue);\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethe app crash after i presses stopped\u003c/p\u003e\n\n\u003cp\u003ehere is my full Java code for the first Activity(second just display them). in case you all want to see how i get them\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class MainActivity extends FragmentActivity implements LocationListener{\n\nprotected LocationManager locationManager;\nprivate GoogleMap googleMap;\nButton btnStartMove,btnPause,btnResume,btnStop;\nstatic double n=0;\nLong s1,r1;\ndouble dis=0.0;\nThread t1;\nEditText userNumberInput;\nboolean bool=false;\nint count=0;\n\ndouble speed = 1.6;\ndouble lat1,lon1,lat2,lon2,lat3,lon3,lat4,lon4;\ndouble dist = 0;\nTextView distance;\nButton btnDuration;\nfloat[] result;\nprivate static final long MINIMUM_DISTANCE_CHANGE_FOR_UPDATES =1; // in Meters\nprivate static final long MINIMUM_TIME_BETWEEN_UPDATES = 4000; //in milliseconds\nboolean startDistance = false;\nboolean startButtonClicked = false;\n\nMyCount counter;\nint timer = 0;\n@Override\nprotected void onCreate(Bundle savedInstanceState) {\n\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n\n locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);\n locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,MINIMUM_TIME_BETWEEN_UPDATES,MINIMUM_DISTANCE_CHANGE_FOR_UPDATES, this);\n if(isGooglePlay())\n {\n setUpMapIfNeeded();\n }\n distance=(TextView)findViewById(R.id.Distance);\n btnDuration=(Button)findViewById(R.id.Duration);\n btnStartMove=(Button)findViewById(R.id.Start);//start moving\n btnStop=(Button)findViewById(R.id.Stop);\n\n //prepare distance...........\n Log.d(\"GPS Enabled\", \"GPS Enabled\"); \n Criteria criteria = new Criteria();\n criteria.setAccuracy(Criteria.ACCURACY_FINE);\n String provider = locationManager.getBestProvider(criteria, true);\n Location location=locationManager.getLastKnownLocation(provider);\n\n btnStartMove.setOnClickListener(new OnClickListener() \n {\n @Override\n public void onClick(View v) {\n\n Log.d(\"GPS Enabled\", \"GPS Enabled\"); \n Criteria criteria = new Criteria();\n criteria.setAccuracy(Criteria.ACCURACY_FINE);\n String provider = locationManager.getBestProvider(criteria, true);\n Location location=locationManager.getLastKnownLocation(provider);\n lat3 = location.getLatitude();\n lon3 = location.getLongitude();\n startButtonClicked=true;\n counter= new MyCount(30000,1000);\n counter.start();\n Toast.makeText(MainActivity.this,\n \"start is true\", \n Toast.LENGTH_LONG).show();\n }\n });\n btnStop.setOnClickListener(new OnClickListener() \n {\n @Override\n public void onClick(View v) {\n startButtonClicked=false;\n startDistance=false;\n //String dis = (String) distance.getText();\n //Double dd = Double.parseDouble(dis);\n Intent intent = new Intent(MainActivity.this, FinishActivity.class);\n //DecimalFormat df = new DecimalFormat(\"#.##\");\n //dist=(df.format(dd);\n intent.putExtra(\"dist\",\"value\");\n //intent.putExtra(\"speed\",\"speedValue\");\n intent.putExtra(\"time\",\"durationValue\");\n startActivity(intent);\n finish();\n }\n });\n\n btnDuration.setOnClickListener(new OnClickListener() \n {\n @Override\n public void onClick(View v) {\n if(startButtonClicked=true) \n {\n double time=n*30+r1;\n Toast.makeText(MainActivity.this,\"Speed(m/s) :\"+String.valueOf(dist/time)+\"Duration :\"+String.valueOf(time),Toast.LENGTH_LONG).show();\n } \n }\n });\n\n if(location!= null)\n {\n //Display current location in Toast\n String message = String.format(\n \"Current Location \\n Longitude: %1$s \\n Latitude: %2$s\",\n location.getLongitude(), location.getLatitude()\n );\n Toast.makeText(MainActivity.this, message,\n Toast.LENGTH_LONG).show();\n\n //Display current location in textview \n //latitude.setText(\"Current Latitude: \" + String.valueOf(location.getLatitude())); \n //longitude.setText(\"Current Longitude: \" + String.valueOf(location.getLongitude()));\n }\n else if(location == null)\n {\n Toast.makeText(MainActivity.this,\n \"Location is null\", \n Toast.LENGTH_LONG).show();\n }\n\n\n}\nprivate void setUpMapIfNeeded() {\n\n if(googleMap == null)\n {\n Toast.makeText(MainActivity.this, \"Getting map\",\n Toast.LENGTH_LONG).show();\n googleMap =((SupportMapFragment)getSupportFragmentManager().findFragmentById(R.id.displayMap)).getMap();\n\n if(googleMap != null)\n {\n setUpMap();\n }\n }a\n\n}\n\nprivate void setUpMap() \n{\n //Enable MyLocation Layer of Google Map\n googleMap.setMyLocationEnabled(true);\n\n //Get locationManager object from System Service LOCATION_SERVICE\n //LocationManager locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);\n\n //Create a criteria object to retrieve provider\n Criteria criteria = new Criteria();\n criteria.setAccuracy(Criteria.ACCURACY_FINE);\n //Get the name of the best provider\n String provider = locationManager.getBestProvider(criteria, true);\n if(provider == null)\n {\n onProviderDisabled(provider);\n }\n //set map type\n googleMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);\n //Get current location\n Location myLocation = locationManager.getLastKnownLocation(provider);\n if(myLocation != null)\n {\n onLocationChanged(myLocation);\n } \n locationManager.requestLocationUpdates(provider, 0, 0, this);\n}\n\nprivate boolean isGooglePlay() \n{\n int status = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);\n\n if (status == ConnectionResult.SUCCESS)\n {\n\n Toast.makeText(MainActivity.this, \"Google Play Services is available\",\n Toast.LENGTH_LONG).show();\n return(true);\n }\n else\n {\n GooglePlayServicesUtil.getErrorDialog(status, this, 10).show();\n\n }\n return (false);\n\n }\n\n@Override\npublic void onLocationChanged(Location myLocation) {\n System.out.println(\"speed \" + myLocation.getSpeed());\n\n //show location on map.................\n //Get latitude of the current location\n double latitude = myLocation.getLatitude();\n //Get longitude of the current location\n double longitude = myLocation.getLongitude();\n //Create a LatLng object for the current location\n LatLng latLng = new LatLng(latitude, longitude);\n //Show the current location in Google Map\n googleMap.moveCamera(CameraUpdateFactory.newLatLng(latLng));\n //Zoom in the Google Map\n googleMap.animateCamera(CameraUpdateFactory.zoomTo(20));\n googleMap.addMarker(new MarkerOptions().position(new LatLng(latitude, longitude)).title(\"You are here!\"));\n\n //show distance............................\n if(startDistance == true)\n {\n\n Toast.makeText(MainActivity.this,\n \"Location has changed\", \n Toast.LENGTH_LONG).show();\n if(myLocation != null)\n {\n //latitude.setText(\"Current Latitude: \" + String.valueOf(loc2.getLatitude())); \n //longitude.setText(\"Current Longitude: \" + String.valueOf(loc2.getLongitude()));\n float[] results = new float[1]; \n Location.distanceBetween(lat3, lon3, myLocation.getLatitude(), myLocation.getLongitude(), results);\n System.out.println(\"Distance is: \" + results[0]); \n\n dist += results[0]; \n DecimalFormat df = new DecimalFormat(\"#.##\"); // adjust this as appropriate\n if(count==1)\n {\n distance.setText(df.format(dist) + \"meters\");\n }\n lat3=myLocation.getLatitude();\n lon3=myLocation.getLongitude();\n count=1;\n }\n\n }\n if(startButtonClicked == true)\n {\n startDistance=true;\n }\n\n //}\n\n\n}\n\n@Override\npublic void onProviderDisabled(String provider) {\n Toast.makeText(MainActivity.this,\n \"Provider disabled by the user. GPS turned off\",\n Toast.LENGTH_LONG).show();\n}\n\n@Override\npublic void onProviderEnabled(String provider) {\n Toast.makeText(MainActivity.this,\n \"Provider enabled by the user. GPS turned on\",\n Toast.LENGTH_LONG).show();\n}\n\n@Override\npublic void onStatusChanged(String provider, int status, Bundle extras) {\n Toast.makeText(MainActivity.this, \"Provider status changed\",\n Toast.LENGTH_LONG).show();\n}\n@Override\nprotected void onPause() {\nsuper.onPause();\nlocationManager.removeUpdates(this);\n}\n@Override\nprotected void onResume() {\n super.onResume();\n locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,MINIMUM_TIME_BETWEEN_UPDATES,MINIMUM_DISTANCE_CHANGE_FOR_UPDATES, this);\n}\npublic class MyCount extends CountDownTimer{\n public MyCount(long millisInFuture, long countDownInterval) {\n super(millisInFuture, countDownInterval);\n }\n @Override\n public void onFinish() {\n counter= new MyCount(30000,1000);\n counter.start();\n n=n+1;\n }\n @Override\n public void onTick(long millisUntilFinished) {\n s1=millisUntilFinished;\n r1=(30000-s1)/1000;\n //e1.setText(String.valueOf(r1));\n\n\n }\n}}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"0","creation_date":"2014-02-07 13:47:56.42 UTC","last_activity_date":"2014-02-08 04:54:59.077 UTC","last_edit_date":"2014-02-08 04:54:59.077 UTC","last_editor_display_name":"","last_editor_user_id":"3196446","owner_display_name":"","owner_user_id":"3196446","post_type_id":"1","score":"-1","tags":"android|android-intent","view_count":"122"} +{"id":"35807819","title":"Qplot line color and legend aesthetic","body":"\u003cp\u003eI wanted to change the legend and line colors in this qplot.\u003ca href=\"https://i.stack.imgur.com/P6uiT.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/P6uiT.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eHere is my data\u003c/p\u003e\n\n\u003cp\u003e\u003cdiv class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"false\" data-babel=\"false\"\u003e\r\n\u003cdiv class=\"snippet-code\"\u003e\r\n\u003cpre class=\"snippet-code-js lang-js prettyprint-override\"\u003e\u003ccode\u003e n.clusters mean.cluster mean.bucket variable value\r\n1 3 21.64790 21.49858 sd.cluster 5.643380\r\n2 5 21.63516 21.54975 sd.cluster 4.369756\r\n3 7 21.55446 21.49889 sd.cluster 3.643280\r\n4 9 21.59585 21.57022 sd.cluster 3.237870\r\n5 11 21.63110 21.58452 sd.cluster 3.012060\r\n6 13 21.55224 21.56104 sd.cluster 2.643777\r\n7 3 21.64790 21.49858 sd.bucket 5.648886\r\n8 5 21.63516 21.54975 sd.bucket 4.397690\r\n9 7 21.55446 21.49889 sd.bucket 3.654752\r\n10 9 21.59585 21.57022 sd.bucket 3.262954\r\n11 11 21.63110 21.58452 sd.bucket 3.023834\r\n12 13 21.55224 21.56104 sd.bucket 2.716441\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003c/p\u003e\n\n\u003cp\u003eAnd here is the code I used\u003c/p\u003e\n\n\u003cp\u003e\u003cdiv class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"false\" data-babel=\"false\"\u003e\r\n\u003cdiv class=\"snippet-code\"\u003e\r\n\u003cpre class=\"snippet-code-js lang-js prettyprint-override\"\u003e\u003ccode\u003eqplot(n.clusters, value, data = mu.est.summary.long,colour = variable, geom = c(\"point\", \"line\"))+\r\n theme_bw() +\r\n scale_x_continuous(breaks = seq(1,13,2)) +\r\n geom_point(aes(n.clusters, value), colour = \"black\", size=3.5) + \r\n geom_line(size=1)+\r\n labs(x = \"Number of cluster\",\r\n y = \"Value\",\r\n variable = \"Standard deviation(sd)\")\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003c/p\u003e\n\n\u003cp\u003eThe legend title code line \u003ccode\u003elabs(variable = \"Standard deviation(sd)\")\u003c/code\u003e didn't work and R didn't report any error. How do I fix it?\u003c/p\u003e\n\n\u003cp\u003eI can color the dot on the line in black but that didn't change the legend. How do I make the legend change?\u003c/p\u003e\n\n\u003cp\u003eI tried to change the line color with \u003ccode\u003egeom_line(colour = c(\"red\",\"yellow\"), size=1)\u003c/code\u003e but that didn't work. How do I fix it?\u003c/p\u003e\n\n\u003cp\u003eSorry for so many questions and thanks for any help.\u003c/p\u003e","accepted_answer_id":"35807950","answer_count":"1","comment_count":"0","creation_date":"2016-03-04 23:17:13.233 UTC","last_activity_date":"2016-03-05 00:02:57.283 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4044223","post_type_id":"1","score":"0","tags":"r|ggplot2","view_count":"74"} +{"id":"22925270","title":"Get Text from div dropdown","body":"\u003cp\u003eI have this:\u003c/p\u003e\n\n\u003cp\u003ephp\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div id=\"moneda\"\u0026gt;\n\u0026lt;?php echo $settings['currency_sign'];\n?\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e(you can edit with Dropdown \u003ca href=\"http://i.imgur.com/vtu6pRd.png\" rel=\"nofollow\"\u003ehttps://code.google.com/p/jquery-in-place-editor/\u003c/a\u003e)\njs\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(\"#moneda\").change(function(){\nalert($(this).val());\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ealert($(this).val()); (Get text in the dropdown NOT WORKING)\u003c/p\u003e\n\n\u003cp\u003ethanks\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://i.imgur.com/vtu6pRd.png\" rel=\"nofollow\"\u003eactual alert from get in js\u003c/a\u003e\u003c/p\u003e","answer_count":"0","comment_count":"4","creation_date":"2014-04-08 00:05:59.853 UTC","last_activity_date":"2014-04-08 00:05:59.853 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"937339","post_type_id":"1","score":"0","tags":"jquery","view_count":"16"} +{"id":"3753157","title":"Why can't I call `history` from within Ruby?","body":"\u003cp\u003eI can run Bash shell commands from with a Ruby program or irb using backticks (and %x(), system, etc). But that does not work with history for some reason.\u003c/p\u003e\n\n\u003cp\u003eFor example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ejones$ irb --simple-prompt\n\u0026gt;\u0026gt; `whoami`\n=\u0026gt; \"jones\\n\"\n\u0026gt;\u0026gt; `history`\n(irb):2: command not found: history\n=\u0026gt; \"\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFrom within a Ruby program it produces this error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31: command not found: history\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn bash itself, those commands work fine\u003c/p\u003e\n\n\u003cp\u003eIt's not that the Ruby call is invoking a new shell - it simply does not find that command...\u003c/p\u003e\n\n\u003cp\u003eAnyone know why? I'm stumped...\u003c/p\u003e","accepted_answer_id":"3753305","answer_count":"3","comment_count":"0","creation_date":"2010-09-20 15:52:21.337 UTC","last_activity_date":"2010-09-20 16:08:20.733 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"290665","post_type_id":"1","score":"3","tags":"ruby|bash|history","view_count":"573"} +{"id":"35633857","title":"Sql function that should error but instead creates successfully","body":"\u003cp\u003eI'm debugging a larger script and narrowed it down to the fact that a function is being created when it should error.\u003c/p\u003e\n\n\u003cp\u003eI tested the following function which SHOULD fail:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCREATE FUNCTION ShouldFail( @x INT )\nRETURNS int\nAS\nBEGIN \nDECLARE @i INT\n\nSELECT @i = id FROM dbo.IDontExist\nRETURN @i\nEND\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eInstead the creation succeeds. Any ideas why?\u003c/p\u003e","accepted_answer_id":"35633971","answer_count":"1","comment_count":"0","creation_date":"2016-02-25 17:11:33.167 UTC","last_activity_date":"2016-02-25 17:16:58.187 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2362927","post_type_id":"1","score":"0","tags":"sql|compiler-errors|syntax-error","view_count":"13"} +{"id":"31685470","title":"autocomplete menu not visible in jqgrid in a Bootstrap tab","body":"\u003cp\u003eJQuery 2.1.1, Bootstrap 3.0.3 and JQGrid 4.8.2\u003c/p\u003e\n\n\u003cp\u003eI have a jqgrid that is included on a page that utilizes Bootstrap tabs. One of the columns uses autocomplete to provide options for inline editing. The function fires and retrieves the data but the autocomplete menu is not visible. If I run my code outside of the Bootstrap tab, the menu appears correctly. I've tried playing around with the z-index of ui-autocomplete and tab-pane but nothing has worked. Any suggestions?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;style\u0026gt;\n.ui-autocomplete { font-size: 11px; position: absolute; cursor: default;z-index:1000 !important;}\n\u0026lt;/style\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is a snippet grid definition:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar myGrid = jQuery(\"#payments\").jqGrid({\n datatype: \"local\",\n data: myData,\n editurl: 'clientArray',\n onSelectRow: editRow,\n colModel: [\n { label: 'Payment ID', name: 'PaymentID', key: true, width: 75 },\n { label: 'Country', name: 'Country', \n width: 100 ,\n editable: true,\n edittype: \"text\",\n editoptions: {\n dataInit: function (element) {\n window.setTimeout(function () {\n $(element).autocomplete({\n id: 'AutoComplete',\n source: [\"United States of America\", \"Germany\", \"Sweden\", \"Greece\" ],\n minLength: 2,\n autoFocus: true\n });\n }, 100);\n }\n }\n },\n ....\n ],\n viewrecords: true,\n width: 1000,\n height: 250,\n subGrid: true, \n subGridRowExpanded: showChildGrid, \n pager: jQuery('#report_pager')\n });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is a the tab that contains the grid:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e...\n\u0026lt;div class=\"tab-pane\" id=\"spendT\"\u0026gt;\n \u0026lt;div class=\"col-sm-12\"\u0026gt;\n \u0026lt;fieldset class=\"well the-fieldset\" \u0026gt;\n \u0026lt;legend class=\"the-legend\"\u0026gt;Spend\u0026lt;/legend\u0026gt;\n \u0026lt;br\u0026gt;\n \u0026lt;div class=\"report_Tbl\" id=\"report_Tbl\" style=\"text-align:left;padding:2px;\"\u0026gt;\n \u0026lt;div id=\"report_pager\" class=\"scroll\" style=\"text-align:left;\"\u0026gt; \u0026lt;/div\u0026gt;\n \u0026lt;table id=\"payments\" class=\"scroll\" \u0026gt;\u0026lt;/table\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/fieldset\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"3","creation_date":"2015-07-28 19:31:16.023 UTC","last_activity_date":"2015-07-28 19:31:16.023 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2754423","post_type_id":"1","score":"0","tags":"jquery|css|twitter-bootstrap|jqgrid|jquery-autocomplete","view_count":"301"} +{"id":"15777824","title":"Can't set cookies in Laravel 4","body":"\u003cp\u003eI'm using the latest version of Laravel 4 and I can't set cookies:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eRoute::get('cookietest', function()\n{\n Cookie::forever('forever', 'Success');\n $forever = Cookie::get('forever');\n Cookie::make('temporary', 'Victory', 5);\n $temporary = Cookie::get('temporary');\n return View::make('cookietest', array('forever' =\u0026gt; $forever, 'temporary' =\u0026gt; $temporary, 'variableTest' =\u0026gt; 'works'));\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eView script:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@extends('layouts.master')\n\n@section('content')\n Forever cookie: {{ $forever }} \u0026lt;br /\u0026gt;\n Temporary cookie: {{ $temporary }} \u0026lt;br /\u0026gt;\n Variable test: {{ $variableTest }}\n@stop\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eYields:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eForever cookie: \nTemporary cookie: \nVariable test: works\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt doesn't matter if I refresh the page or create the cookies in one route and try to access them in another. I can confirm that no cookies are being set with the above operation. The cookies 'laravel_payload' and 'laravel_session' as well as 'remember_[HASH]' do exist and I can set cookies with regular PHP using setcookie.\u003c/p\u003e\n\n\u003cp\u003eNo errors are thrown or logged anywhere that I can find. I'm running Linux Mint locally and Debian on my server, both with nginx and I have the same problem in both places.\u003c/p\u003e","accepted_answer_id":"15807337","answer_count":"3","comment_count":"0","creation_date":"2013-04-03 02:23:36.167 UTC","favorite_count":"1","last_activity_date":"2014-10-27 09:18:26.517 UTC","last_edit_date":"2013-04-11 12:00:05.307 UTC","last_editor_display_name":"","last_editor_user_id":"1269513","owner_display_name":"","owner_user_id":"301168","post_type_id":"1","score":"5","tags":"cookies|laravel|laravel-4","view_count":"19456"} +{"id":"26659457","title":"Spring ApplicationContext closed before bean invoked","body":"\u003cp\u003eIn my Spring app I noticed strange behavior of Spring (or Eclipse). It confused me. ApplicationContext surrounded with try/catch to be sure is closed after done in finally block. But in Eclipse console I saw that it closed before bean invoked.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class Main {\n\n public static void main(String[] args) {\n\n ApplicationContext context = null;\n try {\n context = new ClassPathXmlApplicationContext(new String[] { \"beans-annot.xml\" });\n Launcher launcher = (Launcher) context.getBean(\"launcher\");\n\n System.out.println(launcher);\n launcher.invokeBean();\n } catch (BeansException e) {\n e.printStackTrace();\n } finally {\n if(context != null)\n ((AbstractApplicationContext) context).close();\n }\n }\n}\n\n@Component\npublic class Bean {\n public void invoke(){\n System.out.println(\"invoke bean\");\n }\n}\n@Component\npublic class Launcher {\n\n @Autowired\n public Bean bean;\n\n //setter\n\n public void invokeBean(){\n bean.invoke();\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebeans-annot.xml\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" encoding=\"UTF-8\"?\u0026gt;\n\n\u0026lt;beans xmlns=\"http://www.springframework.org/schema/beans\"\n xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:context=\"http://www.springframework.org/schema/context\"\n xmlns:aop=\"http://www.springframework.org/schema/aop\"\n xsi:schemaLocation=\"http://www.springframework.org/schema/beans\n http://www.springframework.org/schema/beans/spring-beans-3.0.xsd\n http://www.springframework.org/schema/aop\n http://www.springframework.org/schema/aop/spring-aop-3.0.xsd\n http://www.springframework.org/schema/context\n http://www.springframework.org/schema/context/spring-context-3.0.xsd\"\u0026gt;\n\n \u0026lt;context:component-scan base-package=\"my.ioc\" /\u0026gt;\n \u0026lt;context:annotation-config /\u0026gt;\n\n\u0026lt;/beans\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn Eclipse console output:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[INFO] --- exec-maven-plugin:1.2.1:java (default-cli) @ IoC ---\nокт 30, 2014 8:52:56 PM org.springframework.context.support.ClassPathXmlApplicationContext prepareRefresh\nINFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@6e4e4adb: startup date [Thu Oct 30 20:52:56 FET 2014]; root of context hierarchy\nокт 30, 2014 8:52:56 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions\nINFO: Loading XML bean definitions from class path resource [beans-annot.xml]\nmy.ioc.Launcher@2b7f535d\nокт 30, 2014 8:52:56 PM org.springframework.context.support.ClassPathXmlApplicationContext doClose\nINFO: Closing org.springframework.context.support.ClassPathXmlApplicationContext@6e4e4adb: startup date [Thu Oct 30 20:52:56 FET 2014]; root of context hierarchy\ninvoke bean\n[INFO] ------------------------------------------------------------------------\n[INFO] BUILD SUCCESS\n[INFO] ------------------------------------------------------------------------\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAs you can see doClose method init before Bean, why? I think that it's Eclipse or maven plugin error... Project was build with exec-maven-plugin.\u003c/p\u003e","accepted_answer_id":"26664212","answer_count":"1","comment_count":"7","creation_date":"2014-10-30 17:23:06.413 UTC","last_activity_date":"2014-10-30 22:10:18.693 UTC","last_edit_date":"2014-10-30 18:51:02.787 UTC","last_editor_display_name":"","last_editor_user_id":"3157816","owner_display_name":"","owner_user_id":"3157816","post_type_id":"1","score":"0","tags":"java|eclipse|spring|maven","view_count":"1648"} +{"id":"11693748","title":"java getRuntime().exec() not working?","body":"\u003cp\u003eBasically, when I type these commands in \nthe terminal by hand, the sift program works and writes a .key file, but when I try to call it from my program, nothing is written. \u003c/p\u003e\n\n\u003cp\u003eAm I using the exec() method correctly? I have looked through the API and I can't seem to spot where I went wrong.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic static void main(String[] args) throws IOException, InterruptedException\n{ \n //Task 1: create .key file for the input file\n String[] arr = new String[3];\n arr[0] = \"\\\"C:/Users/Wesley/Documents/cv/final project/ObjectRecognition/sift/siftWin32.exe\\\"\";\n arr[1] = \"\u0026lt;\\\"C:/Users/Wesley/Documents/cv/final project/ObjectRecognition/sift/cover_actual.pgm\\\"\";\n arr[2] = \"\u0026gt;\\\"C:/Users/Wesley/Documents/cv/final project/ObjectRecognition/sift/keys/cover_actual.key\\\"\";\n\n String command = (arr[0]+\" \"+arr[1]+\" \"+arr[2]);\n\n Process p=Runtime.getRuntime().exec(command); \n p.waitFor(); \n BufferedReader reader=new BufferedReader(new InputStreamReader(p.getInputStream())); \n String line=reader.readLine(); \n\n while(line!=null) \n { \n System.out.println(line); \n line=reader.readLine(); \n } \n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"11693878","answer_count":"5","comment_count":"3","creation_date":"2012-07-27 18:38:13.303 UTC","favorite_count":"1","last_activity_date":"2014-02-07 10:45:01.047 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1526984","post_type_id":"1","score":"1","tags":"java|runtime|exec","view_count":"9051"} +{"id":"39713125","title":"Pre-Computing Nested Data Set MongoDB","body":"\u003cp\u003eI am implementing an application where I need to pre-compute some stats and using \u003ccode\u003eaggregation\u003c/code\u003e to show computed results through APIs. \u003c/p\u003e\n\n\u003cp\u003eI store all data set on unit day computation. Means for one day, I compute all stats and store those in one MongoDB document. So far linear structure of computing works. \u003c/p\u003e\n\n\u003cp\u003eNow I have following complex scenario where multiple inter-related items are encountered. Look at the sample data\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edata = [\n {id: 1 , date: '29-08-2016', service: 'Good', text: 'R1', categories: ['10-20', 'Male', 'Speed', 'Service']},\n {id: 2 , date: '29-08-2016', service: 'Good', text: 'R2', categories: ['51+', 'Female', 'Strength', 'Service']},\n {id: 3 , date: '29-08-2016', service: 'Good', text: 'R3', categories: ['21-50', 'Male', 'Speed']},\n {id: 4 , date: '29-08-2016', service: 'Bad', text: 'R4', categories: ['10-20', 'Female', 'Flexibility']},\n {id: 5 , date: '29-08-2016', service: 'Bad', text: 'R5', categories: ['21-50', 'Female']}\n]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo I compute linear information from above data set into a MongoDB document: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n date: '29-08-2016',\n total: 5, \n sub_total: {\n 'Good': 3,\n 'Bad': 2\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow I need to pre-compute count of categories as well. As I do: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n date: '29-08-2016',\n total: 5, \n sub_total: {\n 'Good': 3,\n 'Bad': 2\n },\n categories: {\n '10-20': 2,\n '21-50': 1,\n '51+': 1,\n 'Male': 2,\n 'Female': 3,\n 'Service': 2,\n 'Speed': 2,\n 'Flexibility': 1,\n 'Strength': 1,\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis structure also work if I need to know individual category information. But it gets more complex when I have questions like this: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCount of Speed and Service for Female having age 10-20\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI can't figure out a json structure which can help to answer above questions and using mongodb aggregations. \u003c/p\u003e\n\n\u003cp\u003eAny suggestions. \u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2016-09-26 22:03:38.16 UTC","last_activity_date":"2017-07-23 02:06:30.437 UTC","last_edit_date":"2017-09-22 18:01:22.247 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"534329","post_type_id":"1","score":"1","tags":"mongodb|database|nosql","view_count":"27"} +{"id":"22112538","title":"evaluate string with array php","body":"\u003cp\u003eI have a string like\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \"subscription link :%list:subscription%\n unsubscription link :%list:unsubscription%\n ------- etc\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAND\u003c/p\u003e\n\n\u003cp\u003eI have an array like\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e $variables['list']['subscription']='example.com/sub';\n $variables['list']['unsubscription']='example.com/unsub';\n ----------etc.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI need to replace %list:subscription% with $variables['list']['subscription'],And so on\nhere \u003ccode\u003elist\u003c/code\u003e is first index and \u003ccode\u003esubscription\u003c/code\u003e is the second index from $variable\n.Is possible to use \u003ccode\u003eeval()\u003c/code\u003e for this? I don't have any idea to do this,please help me\u003c/p\u003e","accepted_answer_id":"22112599","answer_count":"3","comment_count":"0","creation_date":"2014-03-01 09:27:55.217 UTC","last_activity_date":"2014-03-01 10:02:39.727 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1682826","post_type_id":"1","score":"0","tags":"php|arrays|string|eval","view_count":"95"} +{"id":"8201393","title":"How do I shutdown my PC with Win32 API in C?","body":"\u003cp\u003eI need a way using the Win32 API to force shutdown my machine.\u003c/p\u003e\n\n\u003cp\u003eI am currently using Windows 7 but O'd really like if the code would work for Vista and XP.\u003c/p\u003e","accepted_answer_id":"8201410","answer_count":"1","comment_count":"0","creation_date":"2011-11-20 12:12:31.933 UTC","favorite_count":"1","last_activity_date":"2013-10-21 10:41:41.377 UTC","last_edit_date":"2011-11-20 12:20:36.777 UTC","last_editor_display_name":"","last_editor_user_id":"635608","owner_display_name":"","owner_user_id":"628445","post_type_id":"1","score":"4","tags":"c|winapi","view_count":"4919"} +{"id":"28457642","title":"Checking an Excel document into SharePoint programattically hangs","body":"\u003cp\u003eSalutations-\u003c/p\u003e\n\n\u003cp\u003eI've been working on a PowerShell script, with the intent of refreshing a excel document's SQL data daily via task scheduler. The excel document is hosted on SharePoint. I've (after much, much trial and error) gotten it to work up until the checkin part.\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eBasically, Task Scheduler fires the PowerShell script daily. \u003c/li\u003e\n\u003cli\u003eThe script creates an excel COM object.\u003c/li\u003e\n\u003cli\u003eIt verifies it can checkout the document, then does so if able. \u003c/li\u003e\n\u003cli\u003eIt then performs the refresh. \u003c/li\u003e\n\u003cli\u003eFinally, it attempts to checkin the document. At this point, it just \nhands and nothing happens. I should note this ONLY happens when the \nscript is run via task scheduler, and 'whether user is logged in or \nnot' is selected. If run from the PowerShell cmd line or the\noption 'user must be logged in' is checked, everything performs\nfine.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eCouple important notes-\nThe account is a service account user, although we granted it local login during testing. It has GOT to be unattended in practice though.\nI followed the instructions for folders on this page-\n\u003ca href=\"https://social.technet.microsoft.com/Forums/en-US/aede572b-4c1f-4729-bc9d-899fed5fad02/run-powershell-script-as-scheduled-task-that-uses-excel-com-object?forum=winserverpowershell\" rel=\"nofollow\"\u003ehttps://social.technet.microsoft.com/Forums/en-US/aede572b-4c1f-4729-bc9d-899fed5fad02/run-powershell-script-as-scheduled-task-that-uses-excel-com-object?forum=winserverpowershell\u003c/a\u003e\nIt is worth noting I also had to set permissions on the folders mentioned a few posts past the initial comment. I STRONGLY suspect my current issue is similar/related- but it must not be these folders because I have pretty open permissions here.\u003c/p\u003e\n\n\u003cp\u003eI had to remove 'enhanced IE security' as this is a server box and PowerShell couldn't initially 'see' the SharePoint site.\u003c/p\u003e\n\n\u003cp\u003eI've checked the event log- the office log is apparently operational, but there is no popup at the time of checkin apparently.\u003c/p\u003e\n\n\u003cp\u003eI've set and verified COM permission settings, although it is possible I missed something here. Excel wasn't listed in the APP list but adding the user to the call privileges moved me forward on the task.\u003c/p\u003e\n\n\u003cp\u003eI'm pretty sure this doesn't happen if I run it as a dev administrator.\u003c/p\u003e\n\n\u003cp\u003eCYA-\nI'm aware MS doesn't endorse the above, but I'm also aware people get it to work.\nPowerpivot for SharePoint is not really an option at this time.\nThis is like my third question ever (I normally bang my head against the wall until I get it, but I'm getting a bit bloody here for 'just' a PowerShell script. Please bear with me if I'm over/under wordy :)\u003c/p\u003e\n\n\u003cp\u003eTruncated script below- (removed try/catch and debug messages. If you want the cleaned full let me know, I'd love to save someone the trouble I had.)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$i = \"http://supersecretintranetsite/excelwithsqldatacon.xlsx\"\n\n\n# Creating the excel COM Object \n$Excel = New-Object -ComObject Excel.Application; \n\nStart-Sleep -s 5\n# Setting up Excel to run without UI and without alerts\n$Excel.DisplayAlerts = $false \n$Excel.ScreenUpdating = $false \n$Excel.Visible = $false \n$Excel.UserControl = $false \n$Excel.Interactive = $false\n\n\nIf ($Excel.workbooks.CanCheckOut($i))\n{\n\n # Opening the workbook, can be local path or SharePoint URL\n $Workbook = $Excel.workbooks.Open($i); \n\n # Perform the check out\n $Workbook = $Excel.workbooks.CheckOut($i) \n $Workbook = $Excel.workbooks.Open($i);\n\n Start-Sleep -s 15\n\n # Calling the refresh\n $Workbook.RefreshAll();\n\n # Forces a hold until all Refreshing is done\n $Excel.CalculateUntilAsyncQueriesDone()\n\n # Saving and closing the workbook\n # $Workbook.Save() #- this hangs too\n Start-Sleep -s 15\n # THIS HANGS\n $Workbook.CheckInWithVersion();\n\n Start-Sleep -sec 5\n\n #Release Workbook\n [System.Runtime.Interopservices.Marshal]::ReleaseComObject($Workbook)\n} \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e$Excel.quit(); \u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-02-11 15:07:33.57 UTC","last_activity_date":"2015-02-12 19:59:27.073 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4555232","post_type_id":"1","score":"1","tags":"excel|powershell|sharepoint","view_count":"796"} +{"id":"28839832","title":"How can I obtain URI components using angular.js","body":"\u003cp\u003eHow can I get URI components in AngularJS? For example I have \u003ca href=\"http://domain.com/photo/1\" rel=\"nofollow\"\u003ehttp://domain.com/photo/1\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eSo how can I get that second segment (=1) to a variable in angular? Thank you.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-03-03 19:00:51.453 UTC","last_activity_date":"2015-07-13 00:37:29.547 UTC","last_edit_date":"2015-05-04 14:11:54.697 UTC","last_editor_display_name":"user2258887","owner_display_name":"","owner_user_id":"2343907","post_type_id":"1","score":"1","tags":"javascript|angularjs|url|uri|segment","view_count":"933"} +{"id":"36906569","title":"How to write Like query in Linq to Entities","body":"\u003cp\u003ei tried the following code...\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic ActionResult Search(string query)\n {\n using (DbAccess db=new DbAccess())\n {\n List\u0026lt;Student\u0026gt; studentsList = db.Students.Where(m=\u0026gt;m.name.Contains(\"d\")==query).ToList();\n return View(studentsList); \n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut if i use \"Contains\" then it gives me error..\nplease help\u003c/p\u003e","answer_count":"2","comment_count":"2","creation_date":"2016-04-28 06:10:10.033 UTC","last_activity_date":"2016-04-28 07:14:03.87 UTC","last_edit_date":"2016-04-28 07:14:03.87 UTC","last_editor_display_name":"","last_editor_user_id":"166476","owner_display_name":"","owner_user_id":"4396004","post_type_id":"1","score":"1","tags":"asp.net-mvc-5|linq-to-entities","view_count":"233"} +{"id":"30976425","title":"How to filter through a table using ng-repeat checkboxes with Angularjs","body":"\u003cp\u003eOnce upon a time this was working but somehow it's broken. I want to be able to produce checkboxes using ng-repeat to get as many checkboxes as required based on stored data and use these to filter through a table produced. \u003c/p\u003e\n\n\u003cp\u003eAdditionally I don't want identical values for the checkboxes to be repeated.\u003c/p\u003e\n\n\u003cp\u003eI have made a plnkr with the code.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"row\"\u0026gt;\n \u0026lt;label data-ng-repeat=\"x in projects\"\u0026gt;\n \u0026lt;input\n type=\"checkbox\"\n data-ng-true-value=\"{{x.b}}\"\n data-ng-false-value=''\n ng-model=\"quer[queryBy]\" /\u0026gt;\n {{x.b}}\n \u0026lt;/label\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003ca href=\"http://plnkr.co/edit/RBjSNweUskAtLUH3Ss6r?p=preview\" rel=\"nofollow\"\u003ehttp://plnkr.co/edit/RBjSNweUskAtLUH3Ss6r?p=preview\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eSo in summary.\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003e\u003cp\u003eCheckboxes to filter \u003ccode\u003eRef\u003c/code\u003e.\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eCheckboxes to be unique.\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eCheckboxes to be made based off \u003ccode\u003eng-repeat\u003c/code\u003e using \u003ccode\u003eRef\u003c/code\u003e.\u003c/p\u003e\u003c/li\u003e\n\u003c/ol\u003e","accepted_answer_id":"30977408","answer_count":"2","comment_count":"0","creation_date":"2015-06-22 09:28:45.743 UTC","last_activity_date":"2015-06-23 13:43:39.143 UTC","last_edit_date":"2015-06-22 09:53:43.92 UTC","last_editor_display_name":"","last_editor_user_id":"2173016","owner_display_name":"","owner_user_id":"4572435","post_type_id":"1","score":"3","tags":"javascript|angularjs|checkbox|filter|angularjs-ng-repeat","view_count":"4343"} +{"id":"6918989","title":"How to get the _locale variable inside in a Symfony layout?","body":"\u003cp\u003eI'm working with Symfony 2 on a site which having 2 languages,\nand I want to change patterns of my routes depending on user locale language !\u003c/p\u003e\n\n\u003cp\u003eExample:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003euser_login_en:\n pattern: /en/user/login.html\n defaults: { _controller: SfErrorsAppBundle:User:login, _locale: en }\n\nuser_login_fr:\n pattern: /fr/utilisateur/connexion.html\n defaults: { _controller: SfErrorsAppBundle:User:login, _locale: fr}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eInside a template, this is not difficult, i just have to pass the $this-\u003eget('session')-\u003egetLocale() from the controller to the template...\u003c/p\u003e\n\n\u003cp\u003eTo work, I have to call my routes:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$router-\u0026gt;generate('user_login_'.$locale, array());\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut inside my layouts, I have of course a menu, and sidebars, which have links... So I want to get the locale variable to use it ! So my question is simple: how to get this variable inside a \"layout\" template ? Otherwise, have you got any idea to change the pattern depending on the language ?\u003c/p\u003e\n\n\u003cp\u003eThe reasons are that I want beautiful routes for all users, whether they're english or french... And also for a SEO reason !\u003c/p\u003e","accepted_answer_id":"7441612","answer_count":"4","comment_count":"0","creation_date":"2011-08-02 21:39:02.35 UTC","favorite_count":"6","last_activity_date":"2014-10-23 10:08:06.49 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"875519","post_type_id":"1","score":"48","tags":"templates|layout|routing|translation|symfony","view_count":"55052"} +{"id":"16429301","title":"When is persistence.xml necessary for Play 2.1.1 Java? Entities don't persist in a many-to-one relationship","body":"\u003cp\u003eIn my program, I have a Task model with a \u003ccode\u003eallDates\u003c/code\u003e field, which is a collection of all the Dates that task occurs on. My goal is to make a calendar manager that allows users to input tasks that repeat on certain days.\u003c/p\u003e\n\n\u003cp\u003eIn Tasks, I defined a OneToMany relation between a task and its dates in \u003ca href=\"https://github.com/six5532one/calpractice2/blob/repeatingEvents/app/models/Task.java\" rel=\"nofollow noreferrer\"\u003eline 34\u003c/a\u003e. To treat the elements of \u003ccode\u003eallDates\u003c/code\u003e as an entity, I wrapped each date in a DateHelper model that is another Ebean entity.\u003c/p\u003e\n\n\u003cp\u003eRight before I save the Task, my console output indicates someTask.allDates.size() is accurate and a number greater than one. After I save the task, however:\u003c/p\u003e\n\n\u003cp\u003e1) I query DateHelpers in \u003ca href=\"https://github.com/six5532one/calpractice2/blob/repeatingEvents/app/models/Task.java\" rel=\"nofollow noreferrer\"\u003eline 194\u003c/a\u003e for all DateHelper instances for a given task, and the server only returns the first DateHelper that was added to someTask.allDates, rather than returning the same number of DateHelpers that was added to the task before I saved.\u003c/p\u003e\n\n\u003cp\u003e2) someTask.allDates.size() also returns 1, and the only element in allDates is the first DateHelper I added before saving the task.\u003c/p\u003e\n\n\u003cp\u003eI read \u003ca href=\"https://stackoverflow.com/questions/6257284/play-framework-jpa-how-to-implement-one-to-many-relationship\"\u003ehere\u003c/a\u003e and \u003ca href=\"http://www.playframework.com/documentation/2.1.1/JavaJPA\" rel=\"nofollow noreferrer\"\u003ehere\u003c/a\u003e that Play developers should modify a persistence.xml file to integrate with JPA. Do I need to do this if I am importing ebean? Also, my program successfully maps one User to many Tasks, so I am confused about why the OneToMany mapping does not work for one Task to many TaskHelpers.\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2013-05-07 22:03:27.13 UTC","last_activity_date":"2013-05-07 22:07:39.947 UTC","last_edit_date":"2017-05-23 12:28:09.877 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"1644251","post_type_id":"1","score":"1","tags":"java|playframework|playframework-2.1|persistence.xml","view_count":"213"} +{"id":"11545975","title":"can't see asp.net gridview on page load","body":"\u003cp\u003eI have a gridview that won't show on page load. The gridview is inside of some asp:Panels which are inside of an update panel. I stepped through the code, so I know the gridview has rows of data. If I move the gridview outside of the panels and update panels, then it will show up with data. Does anybody know why it doesn't work as it sits below, inside of the panels and update panels? \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;%@ Page Language=\"VB\" AutoEventWireup=\"false\" EnableEventValidation=\"false\" MasterPageFile=\"~/CTPublic.master\" CodeFile=\"Tank.aspx.vb\" Inherits=\"CargoTank_Internal_Tank\" %\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div style=\"padding-top:9px; width:100%; min-width:800px; \" \u0026gt;\n \u0026lt;asp:UpdatePanel ID=\"udpTank\" runat=\"server\" \u0026gt;\n \u0026lt;ContentTemplate\u0026gt;\n \u0026lt;ajaxToolkit:RoundedCornersExtender runat=\"server\" BorderColor=\"#3260a0\" Corners=\"All\" Radius=\"5\" Color=\"#98B9C9\" TargetControlID=\"pnlTank\" ID=\"ajRCEpnlTank\" \u0026gt;\u0026lt;/ajaxToolkit:RoundedCornersExtender\u0026gt;\n\n \u0026lt;asp:Panel runat=\"server\" BackColor=\"#ecece7\" Width=\"95%\" ID=\"pnlTank\" \u0026gt;\n\n \u0026lt;div \u0026gt;\n \u0026lt;div style=\"float:left; width:70%; background-color:#98B9C9; height:19px;\"\u0026gt;Tanks\u0026lt;/div\u0026gt;\n \u0026lt;div style=\"float:right; width:30%; height:19px;background-color:#98B9C9; text-align:right\"\u0026gt;\n \u0026lt;asp:Button ID=\"btnAddNewTank\" style=\"background:transparent; border:0px;\" runat=\"server\" Font-Underline=\"true\" size=\"1\" Font-Bold=true text=\"Add New\" /\u0026gt; \n\n \u0026lt;/div\u0026gt; \n \u0026lt;div style=\"padding-top:19px;\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt; \n \u0026lt;div style=\"width:100%;\"\u0026gt;\n \u0026lt;table width=\"100%\"\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td colspan=\"6\" class=\"tdheaderbar\"\u0026gt;Search Tanks\n \u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;CT #\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;asp:TextBox runat=\"server\" ID=\"txtCTNumber\" \u0026gt;\u0026lt;/asp:TextBox\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;Serial #\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;asp:TextBox runat=\"server\" ID=\"txtSerialNumber\" MaxLength=\"17\"\u0026gt;\u0026lt;/asp:TextBox\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;City\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;asp:TextBox runat=\"server\" ID=\"txtCity\"\u0026gt;\u0026lt;/asp:TextBox\u0026gt;\u0026lt;/td\u0026gt;\n\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;Capacity\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;asp:TextBox runat=\"server\" ID=\"txtCapacity\"\u0026gt;\u0026lt;/asp:TextBox\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;Unit #\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;asp:TextBox runat=\"server\" ID=\"txtUnitNumber\"\u0026gt;\u0026lt;/asp:TextBox\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;License State\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;asp:DropDownList EnableViewState=\"true\" runat=\"server\" ID=\"ddlState\" DataSourceID=\"linqStates\" \n Width=\"156px\" DataTextField=\"StateText\" DataValueField=\"StateID\"\u0026gt;\u0026lt;/asp:DropDownList\u0026gt;\n \u0026lt;asp:LinqDataSource ID=\"linqStates\" runat=\"server\" \n ContextTypeName=\"DataClassesDataContext\" TableName=\"States\"\u0026gt;\n \u0026lt;/asp:LinqDataSource\u0026gt;\n \u0026lt;/td\u0026gt;\n\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;Tank Type\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\n \u0026lt;asp:DropDownList runat=\"server\" ID=\"ddlTankType\" Width=\"156px\"\n \u0026gt;\u0026lt;/asp:DropDownList\u0026gt;\n\n \u0026lt;/td\u0026gt; \n \u0026lt;td\u0026gt;Compartment\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;asp:TextBox runat=\"server\" ID=\"txtCompartment\"\u0026gt;\u0026lt;/asp:TextBox\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;License #\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;asp:TextBox runat=\"server\" ID=\"txtLicenseNumber\"\u0026gt;\u0026lt;/asp:TextBox\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;Manufacturer\u0026lt;/td\u0026gt;\n \u0026lt;td colspan=\"2\"\u0026gt;\n \u0026lt;asp:DropDownList runat=\"server\" ID=\"ddlManufacturer\" \n \u0026gt;\u0026lt;/asp:DropDownList\u0026gt;\n\n \u0026lt;/td\u0026gt; \n\n\n \u0026lt;td\u0026gt;\u0026lt;asp:CheckBox runat=\"server\" ID=\"chkNoLogIn\" Text=\"No Log In Associated\" /\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;/td\u0026gt; \u0026lt;td\u0026gt;\u0026lt;/td\u0026gt; \n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\u0026lt;td\u0026gt;Company\u0026lt;/td\u0026gt;\n \u0026lt;td colspan=\"5\"\u0026gt; \u0026lt;asp:DropDownList runat=\"server\" ID=\"ddlCompany\" \u0026gt;\u0026lt;/asp:DropDownList\u0026gt;\u0026lt;/td\u0026gt; \n \u0026lt;/tr\u0026gt; \n \u0026lt;tr\u0026gt;\n \u0026lt;td colspan=\"3\"\u0026gt;\n \u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;asp:Button runat=\"server\" ID=\"btnSearch\" Text=\"Search\" /\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;/table\u0026gt;\n \u0026lt;/div\u0026gt;\n\n \u0026lt;/asp:Panel\u0026gt;\n \u0026lt;/ContentTemplate\u0026gt;\n \u0026lt;Triggers\u0026gt;\n \u0026lt;asp:AsyncPostBackTrigger ControlID=\"btnSearch\" EventName=\"Click\" /\u0026gt;\n \u0026lt;/Triggers\u0026gt; \n \u0026lt;/asp:UpdatePanel\u0026gt;\n \u0026lt;br /\u0026gt;\n\n \u0026lt;div style=\"padding-top:9px; width:100%; \" id=\"divTankDetail\" runat=\"server\"\u0026gt;\n \u0026lt;asp:UpdatePanel ID=\"updTankDetail\" runat=\"server\" \u0026gt;\n \u0026lt;ContentTemplate\u0026gt;\n \u0026lt;ajaxToolkit:DropShadowExtender runat=\"server\" ID=\"dsetank\" TargetControlID=\"pnlTankDetail\" TrackPosition=\"true\" BehaviorID=\"pnlTankDetailHeader\"\u0026gt;\u0026lt;/ajaxToolkit:DropShadowExtender\u0026gt;\n \u0026lt;ajaxToolkit:DragPanelExtender runat=\"server\" ID=\"dpeTankDetail\" TargetControlID=\"pnlTankDetail\" DragHandleID=\"pnlTankDetailHeader\"\u0026gt;\u0026lt;/ajaxToolkit:DragPanelExtender\u0026gt;\n \u0026lt;asp:Panel CssClass=\"TankpopupPosition\" BackColor=\"LightBlue\" Visible=\"false\" runat=\"server\" BorderColor=\"#3260a0\" BorderWidth=\"2px\" Width=\"801px\" ID=\"pnlTankDetail\" \u0026gt;\n \u0026lt;asp:Panel runat=\"server\" BorderColor=\"#3260a0\" BorderWidth=\"1px\" Width=\"800px\" ID=\"pnlTankDetailHeader\"\u0026gt;\n \u0026lt;div \u0026gt;\n \u0026lt;div style=\"float:left; width:90%; background-color:#98B9C9; height:19px;\"\u0026gt;Tank Detail\u0026lt;/div\u0026gt;\n \u0026lt;div style=\"float:right; width:10%; border-right-width:2px; border-width:1px; border-color:#3260a0; height:19px;background-color:#98B9C9; text-align:right\"\u0026gt;\n \u0026lt;asp:Button ID=\"btnClose\" style=\"background:transparent; border:0px;\" runat=\"server\" size=\"1\" Font-Bold=true text=\"X\" /\u0026gt;\u0026amp;nbsp;\n \u0026lt;/div\u0026gt; \n\n \u0026lt;div style=\"padding-top:19px;\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt; \n \u0026lt;/asp:Panel\u0026gt;\n \u0026lt;asp:Panel runat=\"server\" Width=\"800px\" ID=\"pnlTankDetailBody\"\u0026gt;\n \u0026lt;div id=\"divTankDetailbody\" runat=\"server\" style=\"width:100%\" \u0026gt;\n \u0026lt;br /\u0026gt;\n \u0026lt;table width=\"100%\"\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;CT #\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;asp:TextBox TabIndex=\"10\" runat=\"server\" BorderStyle=\"Inset\" BorderColor=\"White\" BorderWidth=\"2px\" BackColor=\"Transparent\" ID=\"txtCTNum\" ReadOnly=\"true\" \u0026gt;\u0026lt;/asp:TextBox\u0026gt;\n \u0026lt;asp:Label ID=\"lblCTNumber\" runat=\"server\" Text=\"*\"\u0026gt;\u0026lt;/asp:Label\u0026gt;\u0026amp;nbsp\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;Serial #\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;asp:TextBox TabIndex=\"14\" runat=\"server\" BorderStyle=\"Inset\" BorderColor=\"White\" BorderWidth=\"2px\" ID=\"txtSeriaNum\" MaxLength=\"17\"\u0026gt;\u0026lt;/asp:TextBox\u0026gt;\n \u0026lt;asp:Label ID=\"lblSerialNumber\" runat=\"server\" Text=\"*\"\u0026gt;\u0026lt;/asp:Label\u0026gt;\u0026amp;nbsp\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;City\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;asp:TextBox runat=\"server\" TabIndex=\"18\" BorderStyle=\"Inset\" BorderColor=\"White\" BorderWidth=\"2px\" ID=\"txtOrignatedCity\"\u0026gt;\u0026lt;/asp:TextBox\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;Capacity\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;asp:TextBox TabIndex=\"11\" runat=\"server\" BorderStyle=\"Inset\" BorderColor=\"White\" BorderWidth=\"2px\" ID=\"txtTanktCapacity\"\u0026gt;\u0026lt;/asp:TextBox\u0026gt;\n \u0026lt;asp:Label ID=\"lblCapacity\" runat=\"server\" Text=\"*\"\u0026gt;\u0026lt;/asp:Label\u0026gt;\u0026amp;nbsp\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;Compartment\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;asp:TextBox runat=\"server\" TabIndex=\"15\" ID=\"txtCompartment2\" BorderStyle=\"Inset\" BorderColor=\"White\" BorderWidth=\"2px\"\u0026gt;\u0026lt;/asp:TextBox\u0026gt;\n \u0026lt;asp:Label ID=\"lblCompartment\" runat=\"server\" Text=\"*\"\u0026gt;\u0026lt;/asp:Label\u0026gt;\u0026amp;nbsp\u0026lt;/td\u0026gt;\n\n \u0026lt;td\u0026gt;License #\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;asp:TextBox runat=\"server\" BorderStyle=\"Inset\" TabIndex=\"19\" BorderColor=\"White\" BorderWidth=\"2px\" ID=\"txtLicenseNum\"\u0026gt;\u0026lt;/asp:TextBox\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;Tank Type\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\n \u0026lt;asp:DropDownList runat=\"server\" TabIndex=\"12\" ID=\"ddlTankType2\" Width=\"156px\" \n DataTextField=\"TankTypeName\" \n DataValueField=\"TankTypeName\"\u0026gt;\u0026lt;/asp:DropDownList\u0026gt;\u0026lt;asp:Label ID=\"lblTankType\" runat=\"server\" Text=\"*\"\u0026gt;\u0026lt;/asp:Label\u0026gt;\u0026amp;nbsp\n \u0026lt;/td\u0026gt; \n \u0026lt;td\u0026gt;Unit #\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;asp:TextBox runat=\"server\" TabIndex=\"16\" BorderStyle=\"Inset\" BorderColor=\"White\" BorderWidth=\"2px\" ID=\"txtUnitNum\"\u0026gt;\u0026lt;/asp:TextBox\u0026gt;\u0026lt;/td\u0026gt;\n\n \u0026lt;td\u0026gt;License State\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt; \n \u0026lt;asp:DropDownList EnableViewState=\"true\" Width=\"156px\" TabIndex=\"20\" runat=\"server\" ID=\"ddlLicenseState\" DataSourceID=\"linqStates\" \n DataTextField=\"StateText\" DataValueField=\"StateID\"\u0026gt;\u0026lt;/asp:DropDownList\u0026gt; \n\n\n \u0026lt;asp:LinqDataSource ID=\"LinqDataSource1\" runat=\"server\" \n ContextTypeName=\"DataClassesDataContext\" TableName=\"States\"\u0026gt;\n \u0026lt;/asp:LinqDataSource\u0026gt;\n \u0026lt;/td\u0026gt;\n\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;Manufacturer\u0026lt;/td\u0026gt;\n \u0026lt;td colspan=\"1\"\u0026gt;\n \u0026lt;asp:DropDownList runat=\"server\" TabIndex=\"13\" ID=\"ddlManufacturer2\" \n \u0026gt;\n \u0026lt;/asp:DropDownList\u0026gt;\u0026lt;asp:Label ID=\"lblManufacturer\" runat=\"server\" Text=\"*\"\u0026gt;\u0026lt;/asp:Label\u0026gt;\u0026amp;nbsp\n \u0026lt;/td\u0026gt; \n \u0026lt;td\u0026gt;Company\u0026lt;/td\u0026gt;\n \u0026lt;td colspan=\"3\"\u0026gt; \u0026lt;asp:DropDownList runat=\"server\" TabIndex=\"17\" ID=\"ddlCompany2\" \u0026gt;\u0026lt;/asp:DropDownList\u0026gt;\u0026lt;asp:Label ID=\"lblCompany2\" runat=\"server\" Text=\"*\"\u0026gt;\u0026lt;/asp:Label\u0026gt;\u0026lt;/td\u0026gt; \n\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td colspan=\"6\" align=\"center\"\u0026gt;\u0026lt;br /\u0026gt;\n \u0026lt;asp:Label ID=\"lblChangeOwnership\" Font-Size=\"Medium\" runat=\"server\"\u0026gt;\u0026lt;/asp:Label\u0026gt;\n \u0026lt;br /\u0026gt;\n \u0026lt;asp:CheckBox ID=\"chkChangeOwnership\" runat=\"server\" Text=\"Changing ownership\" ForeColor=\"Red\" Font-Bold=\"true\" /\u0026gt;\n \u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td colspan=\"6\" align=\"center\"\u0026gt;\n \u0026lt;br /\u0026gt;\n \u0026lt;asp:Button runat=\"server\" ID=\"btnAdd\" TabIndex=\"21\" Text=\"Add\" Width=\"60px\" /\u0026gt; \n \u0026lt;asp:Button runat=\"server\" ID=\"btnUpdate\" TabIndex=\"22\" Text=\"Update\" Width=\"60px\" /\u0026gt; \n \u0026lt;asp:Button runat=\"server\" ID=\"btnChangeOnwership\" TabIndex=\"23\" Text=\"Change\" Width=\"60px\" /\u0026gt; \n \u0026lt;asp:Button runat=\"server\" ID=\"btnCancel\" TabIndex=\"24\" Text=\"Cancel\" Width=\"60px\" /\u0026gt;\n \u0026lt;br /\u0026gt;\u0026lt;br /\u0026gt;\n \u0026lt;asp:GridView ID=\"grdTanks\" runat=\"server\" AllowPaging=\"True\" \n AutoGenerateColumns=\"False\" BackColor=\"Transparent\" GridLines=\"None\" \n PagerSettings-Mode=\"NumericFirstLast\" PageSize=\"10\" \n RowStyle-HorizontalAlign=\"left\" Width=\"100%\"\u0026gt;\n \u0026lt;AlternatingRowStyle CssClass=\"alternateItemStyle\" /\u0026gt;\n \u0026lt;HeaderStyle CssClass=\"headerStyle\" /\u0026gt;\n \u0026lt;PagerSettings Mode=\"NumericFirstLast\" /\u0026gt;\n \u0026lt;RowStyle CssClass=\"itemStyle\" /\u0026gt;\n \u0026lt;Columns\u0026gt;\n \u0026lt;asp:BoundField DataField=\"CargoTankID\" HeaderText=\"CT #\" InsertVisible=\"False\" \n ReadOnly=\"True\" SortExpression=\"CargoTankID\" /\u0026gt;\n \u0026lt;asp:BoundField DataField=\"CompanyID\" HeaderText=\"CompanyID\" \n SortExpression=\"CompanyID\" Visible=\"false\" /\u0026gt;\n \u0026lt;asp:BoundField DataField=\"OriginatedCity\" HeaderText=\"OriginatedCity\" \n SortExpression=\"OriginatedCity\" Visible=\"false\" /\u0026gt;\n \u0026lt;asp:BoundField DataField=\"LicenseNumber\" HeaderText=\"LicenseNumber\" \n SortExpression=\"LicenseNumber\" Visible=\"false\" /\u0026gt;\n \u0026lt;asp:BoundField DataField=\"LicenseState\" HeaderText=\"LicenseState\" \n SortExpression=\"LicenseState\" Visible=\"false\" /\u0026gt;\n \u0026lt;asp:BoundField DataField=\"UnitNumber\" HeaderText=\"Unit Number\" \n SortExpression=\"UnitNumber\" Visible=\"false\" /\u0026gt;\n \u0026lt;asp:TemplateField HeaderText=\"Company\"\u0026gt;\n \u0026lt;ItemTemplate\u0026gt;\n \u0026lt;%#DisplayCompanyName(Eval(\"CompanyID\"))%\u0026gt;\n \u0026lt;/ItemTemplate\u0026gt;\n \u0026lt;/asp:TemplateField\u0026gt;\n \u0026lt;asp:BoundField DataField=\"SerialNumber\" HeaderText=\"Serial Number\" \n SortExpression=\"SerialNumber\" /\u0026gt;\n \u0026lt;asp:BoundField DataField=\"Capacity\" HeaderText=\"Capacity\" \n SortExpression=\"Capacity\" /\u0026gt;\n \u0026lt;asp:TemplateField HeaderText=\"Manufacturer\"\u0026gt;\n \u0026lt;ItemTemplate\u0026gt;\n \u0026lt;%#DisplayManufacturer(Eval(\"ManufacturerID\"))%\u0026gt;\n \u0026lt;/ItemTemplate\u0026gt;\n \u0026lt;/asp:TemplateField\u0026gt;\n \u0026lt;asp:BoundField DataField=\"TankType\" HeaderText=\"Tank Type\" \n SortExpression=\"TankType\" Visible=\"false\" /\u0026gt;\n \u0026lt;asp:BoundField DataField=\"Compartment\" HeaderText=\"Compartment\" \n SortExpression=\"Compartment\" Visible=\"false\" /\u0026gt;\n \u0026lt;asp:BoundField DataField=\"DecalID\" HeaderText=\"DecalID\" \n SortExpression=\"DecalID\" Visible=\"false\" /\u0026gt;\n \u0026lt;asp:TemplateField HeaderText=\"Decal Status\"\u0026gt;\n \u0026lt;ItemTemplate\u0026gt;\n \u0026lt;%#DisplayTestLink(Eval(\"CargoTankID\"))%\u0026gt;\n \u0026lt;/ItemTemplate\u0026gt;\n \u0026lt;/asp:TemplateField\u0026gt;\n \u0026lt;/Columns\u0026gt;\n \u0026lt;/asp:GridView\u0026gt;\n \u0026lt;/td\u0026gt;\n\n \u0026lt;/tr\u0026gt;\n \u0026lt;/table\u0026gt;\n\n \u0026lt;/div\u0026gt;\n \u0026lt;/asp:Panel\u0026gt;\n \u0026lt;/asp:Panel\u0026gt;\n \u0026lt;/ContentTemplate\u0026gt;\n \u0026lt;Triggers\u0026gt;\n \u0026lt;asp:AsyncPostBackTrigger ControlID=\"btnSearch\" EventName=\"Click\" /\u0026gt;\n\n \u0026lt;/Triggers\u0026gt; \n \u0026lt;/asp:UpdatePanel\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003c/p\u003e\n\n\u003cp\u003eHere is my code behind:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load\n If Not Page.IsPostBack Then\n If (Me.Page.User.Identity.IsAuthenticated) Then\n Dim db As DataClassesDataContext = New DataClassesDataContext()\n\n Dim tanks = From t In db.CT_Tanks _\n Select t\n\n Me.grdTanks.DataSource = tanks\n Me.grdTanks.DataBind()\n\n Dim tanktype = (From t In db.CT_TankTypes _\n Select t).ToList\n\n ddlTankType.DataSource = tanktype\n ddlTankType.DataTextField = \"TankTypeName\"\n ddlTankType.DataValueField = \"TankTypeName\"\n ddlTankType.DataBind()\n ddlTankType.Items.Insert(0, \"-- Select a Type --\")\n ddlTankType2.DataSource = tanktype\n ddlTankType2.DataTextField = \"TankTypeName\"\n ddlTankType2.DataValueField = \"TankTypeName\"\n ddlTankType2.DataBind()\n ddlTankType2.Items.Insert(0, \"-- Select a Type --\")\n\n Dim manufacturer = (From m In db.CT_Manufacturers _\n Select m).ToList\n\n ddlManufacturer.DataSource = manufacturer\n ddlManufacturer.DataTextField = \"ManufacturerName\"\n ddlManufacturer.DataValueField = \"ManufacturerID\"\n ddlManufacturer.DataBind()\n ddlManufacturer.Items.Insert(0, \"-- Select a Manufacturer --\")\n\n ddlManufacturer2.DataSource = manufacturer\n ddlManufacturer2.DataTextField = \"ManufacturerName\"\n ddlManufacturer2.DataValueField = \"ManufacturerID\"\n ddlManufacturer2.DataBind()\n ddlManufacturer2.Items.Insert(0, \"-- Select a Manufacturer --\")\n\n Dim companies = (From c In db.CT_Companies _\n Where c.IsOwner = True _\n Select c Order By c.CompanyName Ascending).ToList\n\n ddlCompany.DataSource = companies\n ddlCompany.DataTextField = \"CompanyName\"\n ddlCompany.DataValueField = \"CompanyID\"\n ddlCompany.DataBind()\n ddlCompany.Items.Insert(0, \"-- Select a Company --\")\n\n ddlCompany2.DataSource = companies\n ddlCompany2.DataTextField = \"CompanyName\"\n ddlCompany2.DataValueField = \"CompanyID\"\n ddlCompany2.DataBind()\n ddlCompany2.Items.Insert(0, \"-- Select a Company --\")\n\n End If\n End If\n\nEnd Sub\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"4","comment_count":"4","creation_date":"2012-07-18 16:22:50.09 UTC","last_activity_date":"2014-01-09 02:19:11.88 UTC","last_edit_date":"2012-07-18 16:49:43.187 UTC","last_editor_display_name":"","last_editor_user_id":"1202606","owner_display_name":"","owner_user_id":"1202606","post_type_id":"1","score":"0","tags":"asp.net","view_count":"3947"} +{"id":"19168489","title":"HTTPS Force Redirect not working in Wordpress","body":"\u003cp\u003eMy Wordpress directory is at www.example.com/blog\u003c/p\u003e\n\n\u003cp\u003eI recently changed my entire site to force HTTPS. So my .htaccess file in /blog/ looks like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;IfModule mod_rewrite.c\u0026gt;\nRewriteEngine On\nRewriteBase /blog/\nRewriteRule ^index\\.php$ - [L]\nRewriteCond %{REQUEST_FILENAME} !-f\nRewriteCond %{REQUEST_FILENAME} !-d\nRewriteRule . /blog/index.php [L]\n\u0026lt;/IfModule\u0026gt;\n\nRewriteEngine on\nRewriteCond %{HTTPS} off\nRewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI also changed the site URL in Wordpress settings to be HTTPS.\u003c/p\u003e\n\n\u003cp\u003eThis works perfectly in the homepage, but in any post pages, the end user is able to change to non-secure HTTP, by changing the URL and pressing enter.\u003c/p\u003e\n\n\u003cp\u003eFor example, they can type directly: \u003ca href=\"http://www.example.com/blog/post-1/\" rel=\"nofollow noreferrer\"\u003ehttp://www.example.com/blog/post-1/\u003c/a\u003e and it will load as HTTP.\u003c/p\u003e\n\n\u003cp\u003eWhat is wrong with my .htaccess file? Where is the loose end?\u003c/p\u003e","accepted_answer_id":"19168616","answer_count":"2","comment_count":"0","creation_date":"2013-10-03 20:17:20.84 UTC","favorite_count":"9","last_activity_date":"2016-12-31 08:21:31.553 UTC","last_edit_date":"2016-12-31 08:21:31.553 UTC","last_editor_display_name":"","last_editor_user_id":"1033581","owner_display_name":"","owner_user_id":"2011972","post_type_id":"1","score":"12","tags":"wordpress|apache|.htaccess|mod-rewrite|redirect","view_count":"8382"} +{"id":"28858501","title":"How to print errors while streaming with tweepy in python?","body":"\u003cp\u003eI am a Python newbie and am trying to print error messages when using Tweepy to stream tweets. I used an endless loop in my streaming code because it generates InComplete Read errors otherwise. My aim is to print all the error messages I get while continuing to stream tweets, so that I am aware of errors other than the InComplete Read errors. \u003c/p\u003e\n\n\u003cp\u003eMy streamListerner is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e# Code from http://badhessian.org/2012/10/collecting-real-time-twitter-data- with-the-streaming-api/ with minor modifications\nimport json, time, sys\nfrom tweepy import StreamListener\n\n# create an instance of a tweepy StreamListener to handle the incoming data. \nclass SListener(StreamListener):\n\n def __init__(self, fprefix = 'streamer'):\n # self.api = api or API()\n self.counter = 0\n self.fprefix = fprefix\n self.output = open('../Dissertation/stream_3_data/' + fprefix + '.' + time.strftime('%Y%m%d-%H%M%S') + '.json', 'w')\n self.delout = open('delete.txt', 'a')\n\n def on_data(self, data):\n\n if 'in_reply_to_status' in data:\n self.on_status(data)\n elif 'delete' in data:\n delete = json.loads(data)['delete']['status']\n if self.on_delete(delete['id'], delete['user_id']) is False:\n return False\n elif 'limit' in data:\n if self.on_limit(json.loads(data)['limit']['track']) is False:\n return False\n elif 'warning' in data:\n warning = json.loads(data)['warnings']\n print warning['message']\n return False\n\n def on_status(self, status):\n self.output.write(status)\n\n self.counter += 1\n\n if self.counter \u0026gt;= 5000: # New file is started every 5,000 tweets, tagged with prefix and a timestamp.\n self.output.close()\n self.output = open('../Dissertation/stream_3_data/' + self.fprefix + '.' \n + time.strftime('%Y%m%d-%H%M%S') + '.json', 'w')\n self.counter = 0\n\n return\n\n def on_delete(self, status_id, user_id):\n self.delout.write( str(status_id) + \"\\n\")\n return\n\n def on_limit(self, track):\n sys.stderr.write(track + \"\\n\")\n return\n\n def on_error(self, status_code):\n sys.stderr.write('Error: ' + str(status_code) + \"\\n\")\n return True # Don't kill the stream\n\n def on_timeout(self):\n sys.stderr.write(\"Timeout, sleeping for 60 seconds...\\n\")\n time.sleep(60)\n return True # Don't kill the stream\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe part that seems to generate problems is when I try to use the streamlistener:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etwitter_api = tweepy_oauth()\nQ = \"twitter.com\"\n\nlocations = [101.615161,3.08115,101.753663,3.167507,\n 115.421372,39.43277,117.501099,41.05999,\n 120.858322,30.69094,121.9733,31.86889]\n\n# Create a streaming API and set a timeout value of 60 seconds.\nstreaming_api = tweepy.streaming.Stream(twitter_api, SListener(), timeout=60)\n\n# Used infinite loop from https://github.com/ryanmcgrath/twython/issues/288 cause \n# I kept getting InComplete Read Error. Probably due to high volumes of tweets being sent to me at once\n\n#Endless loop\nwhile True: \n try: \n streaming_api.filter(follow=None, track=None, locations=locations, stall_warnings=True)\n except:\n e = sys.exc_info()[0] #Get exception info\n print 'ERROR:',e #Print exception info\n continue\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy code does run and works, but I encounter the following error occasionally, which stops my entire stream:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e---------------------------------------------------------------------------\nIOError Traceback (most recent call last)\n\u0026lt;ipython-input-4-fb45fa5d8307\u0026gt; in \u0026lt;module\u0026gt;()\n 34 streaming_api.filter(follow=None, track=None, locations=locations, stall_warnings=True)\n 35 except:\n 36 e = sys.exc_info()[0] #Get exception info\n ---\u0026gt; 37 print 'ERROR:',e #Print exception info\n 38 continue\n\n IOError: [Errno 22] Invalid argument\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe timing when the error appears is inconsistent - it ranges from 1h into the stream to an entire day into the stream. \u003c/p\u003e\n\n\u003cp\u003eI concluded that the issue is with the print statement because I replaced line 37 with \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprint 'Error'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand the same error message appears. I am not sure how to proceed when even the basic print statement does not work - any help would be great.\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2015-03-04 15:37:41.957 UTC","last_activity_date":"2015-03-04 15:37:41.957 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4632696","post_type_id":"1","score":"2","tags":"python|twitter|tweepy|ioerror","view_count":"619"} +{"id":"13204736","title":"Solr searching within a dictionary file","body":"\u003cp\u003eI was wondering if there is something out of the box from Solr which would allow me to search within a dictinary file (containing words and phrases) to returning all the phrases that contains my search terms.\u003c/p\u003e\n\n\u003cp\u003eFor example, my dictionary file could have:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ered car\nblue bike\nbig bike tires\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I search 'bike', I expect to see \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eblue bike\nbig bike tires\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd when I search 'big tires', i expect to see \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ebig bike tires\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs there anything from Solr that could support this? I was looking into the SpellCheckComponent but it would only support prefix searches.\u003c/p\u003e\n\n\u003cp\u003eBasically, I would like to achieve solr searches (token searching) but against a dictionary file (this same file would also be used for autosuggest).\u003c/p\u003e\n\n\u003cp\u003eAny advice or direction would be appreciated.\u003c/p\u003e","accepted_answer_id":"13212232","answer_count":"1","comment_count":"0","creation_date":"2012-11-03 00:12:01.037 UTC","favorite_count":"1","last_activity_date":"2012-11-03 18:33:07.613 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1757622","post_type_id":"1","score":"0","tags":"search|dictionary|solr","view_count":"174"} +{"id":"43847031","title":"How can I use material-ripple to create a button-like component?","body":"\u003cp\u003eI want to create a button-like component with ripple animation and it looks like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div\u0026gt;Button\u0026lt;/div\u0026gt; \n\u0026lt;material-ripple\u0026gt;\u0026lt;/material-ripple\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn the past, this works fine because when I click on this custom element, I actually clicks on \u003ccode\u003ematerial-ripple\u003c/code\u003e and the click event bubbles to the host element. \u003c/p\u003e\n\n\u003cp\u003eAs of angular_components 0.5.1, \u003ccode\u003ematerial-ripple\u003c/code\u003e shows a centered ripple on keypress. This is different from clicking because the event target is the host element itself and not the ripple component. \u003c/p\u003e\n\n\u003cp\u003eIs there a way that I can pass a keypress event down to the \u003ccode\u003ematerial-ripple\u003c/code\u003e, so that the ripple animation would be played? Or is there a way to play the animation programmatically?\u003c/p\u003e","accepted_answer_id":"43854832","answer_count":"1","comment_count":"0","creation_date":"2017-05-08 11:56:25.05 UTC","last_activity_date":"2017-05-08 18:29:05.74 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7149207","post_type_id":"1","score":"2","tags":"dart|angular-dart","view_count":"70"} +{"id":"10065568","title":"How to sum up based on a Tuples first elem?","body":"\u003cp\u003eI have a 3-tuple list like the following [I added line breaks for readability]:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e(2, 127, 3)\n(12156, 127, 3)\n(4409, 127, 2) \u0026lt;-- 4409 occurs 2x\n(1312, 127, 12) \u0026lt;-- 1312 occurs 3x\n\n(4409, 128, 1) \u0026lt;-- \n(12864, 128, 1)\n(1312, 128, 1) \u0026lt;-- \n(2664, 128, 2)\n\n(12865, 129, 1)\n(183, 129, 1)\n(12866, 129, 2)\n(1312, 129, 10) \u0026lt;--\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to sum up based on the first entry. The first entry should be unique.\u003c/p\u003e\n\n\u003cp\u003eThe result should look like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e(2, 127, 3)\n(12156, 127, 3)\n(4409, 127, 3) \u0026lt;- new sum = 3\n(1312, 127, 23) \u0026lt;- new sum = 23\n\n(12864, 128, 1)\n(2664, 128, 2)\n\n(12865, 129, 1)\n(183, 129, 1)\n(12866, 129, 2)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow can I achieve this in Scala?\u003c/p\u003e","accepted_answer_id":"10065627","answer_count":"3","comment_count":"1","creation_date":"2012-04-08 19:06:00.127 UTC","last_activity_date":"2012-04-09 10:02:57.667 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1243091","post_type_id":"1","score":"5","tags":"scala|tuples","view_count":"2279"} +{"id":"21306945","title":"how we can shift X and Y axis to center in Bubble chart (JQPlot)","body":"\u003cp\u003eI am trying to shift bubble chart X and Y axis to the center. I am unable to find the exact configuration.\u003c/p\u003e\n\n\u003cp\u003eCurrently i am getting the graph as shown below\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/qAIKO.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eI want to get it as shown below\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/4mMRy.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eplease help me out\u003c/p\u003e","accepted_answer_id":"21370449","answer_count":"2","comment_count":"0","creation_date":"2014-01-23 11:32:31.49 UTC","last_activity_date":"2014-11-10 18:03:16.347 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1400091","post_type_id":"1","score":"0","tags":"jquery|css|jqplot","view_count":"654"} +{"id":"12262483","title":"Throwing exception in @Before, catching in @AfterThrowing","body":"\u003cp\u003eI created a @Before Advice that throws an exception and tried to catch it in another @AfterThrowing, but it does not work.\u003c/p\u003e\n\n\u003cp\u003eIf the exception is not thrown in the advice, but directly in the method, it works.\u003c/p\u003e\n\n\u003cp\u003eIf it is thrown in the advice, the @AfterThrowing is not executed.\u003c/p\u003e\n\n\u003cp\u003eWhy does it behave like that?\u003c/p\u003e","accepted_answer_id":"12263149","answer_count":"2","comment_count":"1","creation_date":"2012-09-04 11:22:14.497 UTC","last_activity_date":"2012-09-04 12:07:18.483 UTC","last_edit_date":"2012-09-04 11:28:18.05 UTC","last_editor_display_name":"","last_editor_user_id":"1350869","owner_display_name":"","owner_user_id":"1111681","post_type_id":"1","score":"1","tags":"java|spring|aspectj|aspect","view_count":"861"} +{"id":"46124045","title":"WordPress Website is generating random Advertisements in new tab","body":"\u003cp\u003eI am facing a problem with my website \u003ca href=\"https://konhost.com\" rel=\"nofollow noreferrer\"\u003ehttps://konhost.com\u003c/a\u003e, whenever I open my website in a new tab or new window and click on it for the first time then it opens a new window with an advertisement. \u003c/p\u003e\n\n\u003cp\u003eI have also scaned my website with virustotal.com and this comes out:\u003c/p\u003e\n\n\u003cp\u003eaccept-ranges: bytes\u003cbr\u003e\nage: 0\u003cbr\u003e\ncache-control: no-store, no-cache, must-revalidate\u003cbr\u003e\nconnection: keep-alive\u003cbr\u003e\ncontent-type: text/html; charset=UTF-8\u003cbr\u003e\ndate: Fri, 08 Sep 2017 19:25:49 GMT\u003cbr\u003e\nexpires: Thu, 19 Nov 1981 08:52:00 GMT\u003cbr\u003e\npragma: no-cache\u003cbr\u003e\nset-cookie: PHPSESSID=0t51snf947vas0a2ifsq8v4590; path=/\u003cbr\u003e\ntransfer-encoding: chunked\u003cbr\u003e\nvary: Accept-Encoding\u003cbr\u003e\nx-cache: MISS\u003cbr\u003e\nx-varnish: 184009294\u003cbr\u003e\u003c/p\u003e\n\n\u003cp\u003eBut I am still not sure what to do and how to fix this problem. Any help will be really appreciated.\u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","answer_count":"0","comment_count":"4","creation_date":"2017-09-08 20:25:05.993 UTC","last_activity_date":"2017-09-08 20:25:05.993 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7777821","post_type_id":"1","score":"1","tags":"php|wordpress|security|cookies|header","view_count":"31"} +{"id":"12532736","title":"How to convert \"Fri Sep 21 15:23:59 CEST 2012\" to \"2012-09-21T15:23:59\" in Java?","body":"\u003cp\u003eI want to convert the date string \"Fri Sep 21 15:23:59 CEST 2012\" to \"2012-09-21T15:23:59\" in Java.\nI tried this with SimpleDateFormat and the following code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etry {\n String dateString = \"Fri Sep 21 15:23:59 CEST 2012\";\n SimpleDateFormat input = new SimpleDateFormat(\"EEE MM dd HH:mm:ss z YYYY\");\n SimpleDateFormat output = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss\");\n\n Date date = input.parse(dateString);\n System.out.println(output.format(date)); \n} catch (ParseException e) {\n e.printStackTrace();\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut the input parsing gives me a java.text.ParseException. I have read the documetation at \u003ca href=\"http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html\" rel=\"nofollow\"\u003ehttp://docs.oracle.com/javase/1.4.2/docs/api/java/text/SimpleDateFormat.html\u003c/a\u003e, but I am not able to find the error.\u003c/p\u003e\n\n\u003cp\u003eWhich format string solves the input parsing of this string?\u003c/p\u003e","accepted_answer_id":"12532754","answer_count":"3","comment_count":"1","creation_date":"2012-09-21 14:40:27.913 UTC","last_activity_date":"2017-04-19 23:16:38.123 UTC","last_edit_date":"2013-11-24 04:58:14.783 UTC","last_editor_display_name":"","last_editor_user_id":"1102512","owner_display_name":"","owner_user_id":"1677648","post_type_id":"1","score":"3","tags":"java|datetime","view_count":"201"} +{"id":"37210917","title":"Sum of Each Branch in a Binary Search Tree","body":"\u003cp\u003eMy assignment is to find the sum of all nodes on each branch in a binary search tree using recursion, and compare them to a user input value. If the user input value matches a sum of one of the branches, the function should return true. \u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/S6Vre.jpg\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/S6Vre.jpg\" alt=\"binary search tree\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eIn other words, the sum of 32+24+21+14=91. The sum of 32+24+28+25=109. The sum of 32+24+28+31=115 etc. I have tried many different methods, but cant seem to figure out how to traverse each branch accurately. So far I have only been able to traverse and find the sum of the left-most branch. \u003c/p\u003e\n\n\u003cp\u003eI am using the method of subtracting each node from the user input value. If the value reaches 0 at a Leaf-node, then clearly the user-input matches the node-sum of that branch on the tree.\u003c/p\u003e\n\n\u003cp\u003eThe particular points of difficulty for me are when the branch diverges, such as at the node [24] and [28]. I clearly am getting something very simple wrong, but I cant figure it out.\u003c/p\u003e\n\n\u003cp\u003eBelow is the condensed code I've written so far, in the form of two companion methods (also required for the assignment).\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic:\nbool findBranchSum1(int value) throw (InvalidTreeArgument) {\n if (root == nullptr)\n throw InvalidTreeArgument();\n return(findBranchSum(root, value));\n}\n\nprivate:\nbool findBranchSum(NodePtr node, int value) throw (InvalidTreeArgument)\n{\n bool result = false;\n if (root == nullptr)\n throw InvalidTreeArgument();\n\n value -= node-\u0026gt;getElement(); //subtract current node from user-input value. \n\n cout \u0026lt;\u0026lt; \"Current Value = \" \u0026lt;\u0026lt; value \u0026lt;\u0026lt; endl; //help track value changes\n\n if (node-\u0026gt;getLeftSide() == nullptr \u0026amp;\u0026amp; node-\u0026gt;getRightSide() == nullptr)\n {\n if (value == 0)\n {\n result = true;\n return(true);\n }\n else\n return(false);\n }\n else\n {\n if (node-\u0026gt;getLeftSide() != nullptr)\n {\n node = node-\u0026gt;getLeftSide(); //advance to next Left node\n result = findBranchSum(node, value); //recursive call using new node\n }\n if (node-\u0026gt;getRightSide() != nullptr)\n {\n node = node-\u0026gt;getRightSide(); //advance to next Right node\n result = findBranchSum(node, value); //recursive call using new node\n }\n return(result);\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat am I doing wrong, and how can I fix my code to find the sum of each branch on the tree? Thank you in advance. I apologize for any errors in my format, or missing information. \u003c/p\u003e","answer_count":"2","comment_count":"1","creation_date":"2016-05-13 13:08:21.46 UTC","last_activity_date":"2016-05-13 21:19:13.957 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4808582","post_type_id":"1","score":"0","tags":"c++|algorithm|data-structures|binary-tree|binary-search-tree","view_count":"200"} +{"id":"37972709","title":"Using golang couchbase community sdk with MutateIn","body":"\u003cp\u003eWhen I'm using MutateIn function I always get \"No access.\" error\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunc (s *service) UserUpdateAvatar(avatarLink string) error {\n key := \"profile::1\"\n var user User\n _, _ = s.profileBucket.Get(key, \u0026amp;user)\n logrus.Println(user) // printing the user as expected\n logrus.Println(avatarLink) // printing the avatarLink as expected\n mtinb := s.profileBucket.MutateIn(key, 0, 0).Upsert(\"avatarUrl\", avatarLink, true)\n _, err := mtinb.Execute() // throughs \"No access.\" error\n if err != nil {\n logrus.Println(err)\n }\n return nil\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm using go version 1.6, couchbase community 4.0.0\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-06-22 15:41:18.703 UTC","last_activity_date":"2016-07-07 20:04:19.537 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2326568","post_type_id":"1","score":"1","tags":"go|couchbase","view_count":"40"} +{"id":"9516764","title":"Does List.subList keep a reference to the original list?","body":"\u003cp\u003eIf I have a variable\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eLinkedList list\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand repeatedly do the following to extract the tail of 'list'\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e// Some operation that adds elements to 'list'\n// max_size = some constant\nlist = (LinkedList) list.subList(list.size()-max_size, list.size());\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003edo I end up with a lot of references to the 'previous' list?\u003c/p\u003e\n\n\u003cp\u003eSo basically what I'm trying to do here is to remove an initial segment of the list.\u003c/p\u003e\n\n\u003cp\u003eIs there a better way to remove an initial segment of a LinkedList? I think the data structure of LinkedList should allow linear time (linear in the size of the initial segment to be removed) operation.\u003c/p\u003e","accepted_answer_id":"9516822","answer_count":"4","comment_count":"0","creation_date":"2012-03-01 13:07:19.733 UTC","last_activity_date":"2012-03-01 13:16:41.287 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"842860","post_type_id":"1","score":"1","tags":"java","view_count":"2730"} +{"id":"11255988","title":"Continuous scrolling of UILabel like marquee","body":"\u003cp\u003eFollowing is my code to scroll the UILabel horizontal such that it appears as the marquee effect. But the animation starts with the label in center and scrolls till its width and again stats from the center. I want continuous scrolling like marquee from left to right.Can any body help me please.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e-(void)loadLabel{\n\n if (messageView) {\n [messageView removeFromSuperview];\n }\n\n NSString *theMessage = text;\n messageSize = [theMessage sizeWithFont:font];\n messageView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, messageSize.width, 916)]; //x,y,width,height\n [messageView setClipsToBounds:NO]; // With This you prevent the animation to be drawn outside the bounds.\n [self.view addSubview:messageView];\n lblTime = [[RRSGlowLabel alloc] initWithFrame:CGRectMake(0, 0, messageSize.width, 916)]; //x,y,width,height\n [lblTime setBackgroundColor:[UIColor yellowColor]];\n lblTime.font = font;\n [lblTime setText:theMessage];\n lblTime.glowOffset = CGSizeMake(0.0, 0.0);\n lblTime.glowAmount = 90.0;\n lblTime.glowColor = color;\n [lblTime setClipsToBounds:NO];\n [lblTime setTextColor:color];\n [lblTime setTextAlignment:UITextAlignmentLeft];\n lblTime.frame = messageView.bounds ; //x,y,width,height\n [messageView addSubview:lblTime];\n\n [UIView beginAnimations:nil context:NULL];\n [UIView setAnimationDuration:speed];\n\n [UIView setAnimationRepeatCount:HUGE_VALF];\n [UIView setAnimationTransition:UIViewAnimationTransitionNone forView:messageView cache:YES];\n lblTime.frame = CGRectMake(-messageSize.width, 45, messageSize.width, 916); //x,y,width,height\n [UIView commitAnimations];\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"0","creation_date":"2012-06-29 04:16:20.357 UTC","favorite_count":"7","last_activity_date":"2014-01-14 10:20:04.49 UTC","last_edit_date":"2012-10-30 07:09:05.5 UTC","last_editor_display_name":"","last_editor_user_id":"219922","owner_display_name":"","owner_user_id":"983666","post_type_id":"1","score":"10","tags":"objective-c|ios|cocoa-touch|uilabel|marquee","view_count":"15093"} +{"id":"2778711","title":"TFS 2008 Build and deploy to Inetpub web folder","body":"\u003cp\u003eI have TFS2008 and have a build running, however, I want to automate the deployment of the build folder and place the build into the inetpub folder it belongs to.\u003c/p\u003e\n\n\u003cp\u003eI.E.:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eRun Build\u003c/li\u003e\n\u003cli\u003eAfter Build, automatically place the new built solution into Inetpub/wwwroot/websitefolder\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eI have tried xcopy, robocopy and synctoy 2.1 and I cannot get any of them to work.\u003c/p\u003e\n\n\u003cp\u003e(xcopy use)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;Exec Command=\"xcopy $(DropLocation)\\$(BuildNumber)\\Debug\\_PublishedWebsites\\IPAMIntranet C:\\Inetpub\\wwwroot\\IPAMOnlineSystem.Test /E \" /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e(robocopy use)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;Exec Command=\"ROBOCOPY $(DropLocation)\\$(BuildNumber)\\Debug\\_PublishedWebsites\\IPAMIntranet C:\\Inetpub\\wwwroot\\IPAMOnlineSystem.Test /S /XJ /B /R:5\" /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e(synctoy 2.1 use)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;Exec Command=\"SyncToyCmd.exe -RIPAMBuildProjectDeploy\" /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCan anyone at all please help me with this dilemna?\u003c/p\u003e\n\n\u003cp\u003eThank you in advance\u003c/p\u003e","accepted_answer_id":"2816378","answer_count":"1","comment_count":"0","creation_date":"2010-05-06 05:40:59.123 UTC","last_activity_date":"2011-02-18 21:27:22.69 UTC","last_edit_date":"2010-05-06 05:58:19.713 UTC","last_editor_display_name":"","last_editor_user_id":"173923","owner_display_name":"","owner_user_id":"173923","post_type_id":"1","score":"0","tags":"build|automation|deployment|tfs2008","view_count":"350"} +{"id":"794255","title":"How do you use the Immediate Window in Visual Studio?","body":"\u003cp\u003eThe Immediate Window is an immensely useful tool for debugging applications. It can be used to execute code statements that are valid in the context of a break point and inspect values. I also use it to type code snippets to learn language features.\u003c/p\u003e\n\n\u003cp\u003eHow do you use the Immediate Window?\u003c/p\u003e","accepted_answer_id":"1361136","answer_count":"4","comment_count":"2","creation_date":"2009-04-27 16:25:32.18 UTC","favorite_count":"52","last_activity_date":"2017-11-22 07:56:32.83 UTC","last_edit_date":"2017-02-27 19:05:47.157 UTC","last_editor_display_name":"","last_editor_user_id":"3063884","owner_display_name":"","owner_user_id":"41410","post_type_id":"1","score":"102","tags":"visual-studio|debugging|immediate-window","view_count":"84296"} +{"id":"32766515","title":"Restrict access to all URIs except several, Spring security","body":"\u003cp\u003eI would like to restrict the access to all URIs except several ones. \u003c/p\u003e\n\n\u003cp\u003eThe following URIs can be access freely: \u003ccode\u003e\"/\", \"/login\", \"/register\"\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eAny others can be accessed by passing authenticated procedure. \u003c/p\u003e\n\n\u003cp\u003eHere is the code that has to restrict access to all URIs except the \u003ccode\u003e\"/\", \"/login\", \"/register\"\u003c/code\u003e (I have found it on StackOverflow):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e @Configuration\n@EnableWebSecurity\npublic class SecurityContextConfiguration extends WebSecurityConfigurerAdapter {\n @Autowired\n private UserDetailsImpl userDetailsService;\n\n @Autowired\n public void configure(AuthenticationManagerBuilder auth) throws Exception {\n auth\n .userDetailsService(userDetailsService)\n .passwordEncoder(getBCryptPasswordEncoder());\n }\n\n @Override\n protected void configure(HttpSecurity http) throws Exception {\n http.csrf()\n .disable()\n .authorizeRequests()\n .antMatchers(\"/resources/**\", \"/**\").permitAll()\n .and();\n\n http.formLogin()\n .loginPage(\"/login\")\n .loginProcessingUrl(\"/j_spring_security_check\")\n .usernameParameter(\"j_username\")\n .passwordParameter(\"j_password\")\n .permitAll().defaultSuccessUrl(\"/dashboard\");\n\n http.logout()\n .permitAll()\n .logoutUrl(\"/logout\")\n .logoutSuccessUrl(\"/\")\n .invalidateHttpSession(true);\n\n http.authorizeRequests()\n .antMatchers(\"/\", \"/login\", \"/register\").permitAll()\n .antMatchers(\"/**\").authenticated();\n }\n\n @Bean\n public BCryptPasswordEncoder getBCryptPasswordEncoder(){\n return new BCryptPasswordEncoder();\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe issue is that when I generate get request (i.e. click on the following link \u003ccode\u003e\u0026lt;a href=\"/register\"\u0026gt;Register\u0026lt;/a\u0026gt;\u003c/code\u003e) the login page is being displayed. However, it should simply display the registration JSP page. \u003c/p\u003e\n\n\u003cp\u003eWhat did I make wrong? And how can I properly restrict access to all URIs except the several ones?\u003c/p\u003e\n\n\u003cp\u003ePart from my auth controller: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@RequestMapping(value = \"/register\", method = RequestMethod.GET)\n public String displayRegistrationForm(Model model) {\n model.addAttribute(\"user\", new Customer());\n return \"register\";\n }\n\n @RequestMapping(value = \"/register\", method = RequestMethod.POST)\n public String processUserRegistration(@Valid @ModelAttribute(\"user\") Customer customer,\n BindingResult result,\n Model model) {\n\n if (result.hasErrors()) {\n return \"register\";\n }\n if (customerRepository.checkIfEmailExistsInDatabase(customer.getEmail())) {\n result.rejectValue(\"email\", \"email_exist\", \"Email is in DB\");\n return \"register\";\n }\n if (customerRepository.checkIfLoginExistsInDb(customer)) {\n result.rejectValue(\"login\", \"login_exists\", \"Login is in DB\");\n return \"register\";\n }\n customer.setPassword(bCryptPasswordEncoder.encode(customer.getPassword()));\n customerRepository.insert(customer);\n model.addAttribute(\"user\", customer);\n if (customer.getCustomerType().getTypeName().equals(\"BUSINESS\")) {\n model.addAttribute(\"gasstation\", new GasStation());\n return \"redirect:add_gasstation\";\n } else {\n model.addAttribute(\"vehicle\", new Vehicle());\n return \"redirect:add_vehicle\";\n }\n }\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"7","creation_date":"2015-09-24 16:31:37.87 UTC","favorite_count":"1","last_activity_date":"2015-09-24 17:36:59.633 UTC","last_edit_date":"2015-09-24 17:36:59.633 UTC","last_editor_display_name":"","last_editor_user_id":"1146365","owner_display_name":"","owner_user_id":"1146365","post_type_id":"1","score":"1","tags":"java|spring|spring-mvc|spring-security","view_count":"137"} +{"id":"38770023","title":"Elements in footer different with firefox and chrome","body":"\u003cp\u003eSo I noticed something weird when testing website in different browsers. In Firefox element and h3 heading are on same line, but in Chrome element is under the border and not in line with title element.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;footer class=\"main-footer\"\u0026gt;\n \u0026lt;h3\u0026gt;Author1\u0026lt;a href=\"#home\" class=\"foot-nav\"\u0026gt;BACK TO TOP\u0026lt;/a\u0026gt;\u0026lt;/h3\u0026gt; \n\u0026lt;/footer\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCSS:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e .main-footer a {\n text-decoration: none;\n font-size: .75em;\n float: right;\n color: #626262;\n padding-top: 3px;\n margin-top: -38px;\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/OEsvN.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/OEsvN.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/YGihO.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/YGihO.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2016-08-04 14:20:13.197 UTC","last_activity_date":"2016-08-04 14:29:27.38 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6219543","post_type_id":"1","score":"0","tags":"html|css","view_count":"44"} +{"id":"22777906","title":"username and password not working in wkhtmltopdf application","body":"\u003cp\u003eI need to convert a HTML URL to pdf format using \u003ca href=\"http://code.google.com/p/wkhtmltopdf/\" rel=\"nofollow\"\u003ewkhtmltopdf\u003c/a\u003e tool on terminal.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e $ wkhtmltopdf --username 'arya_normal2' --password '1' http://localhost:8000/employee/arya_normal2-no-emp-code/certificates/53/show/ localhost.pdf\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIts not getting authenticated/logined when hitting url. Its giving simple login pdf page.\u003c/p\u003e\n\n\u003cp\u003eI have checked with my google account , its showing login page in pdf.\u003c/p\u003e\n\n\u003cp\u003eHave anyone used username and password in wkhtmltopdf? Help me if I have given wrong command line arguments.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eModified command line Arguments :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e wkhtmltopdf --cookie 'csrftoken' 'JuQUFr9KLUdZLMAjLn3d8yakd6HOshTN' --cookie 'sessionid' 'xy3yacbe3nq1sbbtstkxfp34ah3imcmg' --post username 'arya_normal2' --post password '1' http://localhost:8000/employee/arya_normal2-no-emp-code/certificates/all/ sample2.pdf\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow following error is coming : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eInternal Server Error: /employee/arya_normal2-no-emp-code/certificates/all/\nTraceback (most recent call last):\n File \"/home/nirmal/venvs/nuvologistics/local/lib/python2.7/site-packages/django/core/handlers/base.py\", line 107, in get_response\n response = middleware_method(request, callback, callback_args, callback_kwargs)\n File \"/home/nirmal/venvs/nuvologistics/local/lib/python2.7/site-packages/django/middleware/csrf.py\", line 170, in process_view\n request_csrf_token = request.POST.get('csrfmiddlewaretoken', '')\n File \"/home/nirmal/venvs/nuvologistics/local/lib/python2.7/site-packages/django/core/handlers/wsgi.py\", line 146, in _get_post\n self._load_post_and_files()\n File \"/home/nirmal/venvs/nuvologistics/local/lib/python2.7/site-packages/django/http/request.py\", line 219, in _load_post_and_files\n self._post, self._files = self.parse_file_upload(self.META, data)\n File \"/home/nirmal/venvs/nuvologistics/local/lib/python2.7/site-packages/django/http/request.py\", line 183, in parse_file_upload\n parser = MultiPartParser(META, post_data, self.upload_handlers, self.encoding)\n File \"/home/nirmal/venvs/nuvologistics/local/lib/python2.7/site-packages/django/http/multipartparser.py\", line 70, in __init__\n raise MultiPartParserError('Invalid boundary in multipart: %s' % boundary)\nMultiPartParserError: Invalid boundary in multipart: None\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eLogin form :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;form action=\"\" method=\"post\" enctype=\"multipart/form-data\" boundary=0xKhTmLbOuNdArY\u0026gt;\n {% csrf_token %}\n\n \u0026lt;input name=\"username\" type=\"text\" placeholder=\"Email-address\" id=\"email\"\u0026gt;\u0026lt;br\u0026gt;\n \u0026lt;input name=\"password\" type=\"password\" placeholder=\"Password\" id=\"password\"\u0026gt;\u0026lt;br\u0026gt;\n \u0026lt;input type=\"checkbox\" id=\"remember\" value=\"Remember Me\" \u0026gt;\u0026amp;nbsp; \u0026lt;span\u0026gt;Remember Me\u0026lt;/span\u0026gt;\n \u0026lt;a id=\"forget\"\u0026gt;Forgot your Password?\u0026lt;/a\u0026gt;\u0026lt;br\u0026gt;\n {% if error %}\n \u0026lt;i class=\"icon-warning\"\u0026gt;\u0026lt;/i\u0026gt;\u0026lt;span class=\"error\"\u0026gt;The username or password you entered is incorrect.\u0026lt;/span\u0026gt;\n {% endif %}\n \u0026lt;input type=\"submit\" value=\"LOGIN\" id=\"login\"\u0026gt;\n \u0026lt;/form\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-04-01 05:57:27.733 UTC","favorite_count":"1","last_activity_date":"2016-05-10 19:08:12.1 UTC","last_edit_date":"2014-04-01 09:12:16.63 UTC","last_editor_display_name":"","last_editor_user_id":"1106366","owner_display_name":"","owner_user_id":"1106366","post_type_id":"1","score":"1","tags":"django-forms|wkhtmltopdf|html-to-pdf","view_count":"611"} +{"id":"43412417","title":"fseek() and ftell() fail in a loop","body":"\u003cp\u003eI need to loop trough a directory, \u003ccode\u003edata\u003c/code\u003e and read each file, that meets certain conditions, in a string and do something with it. For some reason it fails after the \u003ccode\u003efseek\u003c/code\u003e call (the output is only the name of the first file in the directory).\u003c/p\u003e\n\n\u003cp\u003eAny idea what am I doing wrong?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;stdio.h\u0026gt;\n#include \u0026lt;stdlib.h\u0026gt;\n#include \u0026lt;dirent.h\u0026gt;\n#include \u0026lt;string.h\u0026gt;\n\nvoid doAlgorithm(char *input) {\n printf(\"%s\\n\", input);\n}\n\nint main(int argc, char** argv) {\n struct dirent *dir;\n DIR *d = opendir(\"data\");\n FILE *file;\n while ((dir = readdir(d)) != NULL) {\n if (strlen(dir-\u0026gt;d_name) \u0026gt; 6 \u0026amp;\u0026amp; dir-\u0026gt;d_name[6] == 'i') {\n printf(\"Filename: %s\\n\", dir-\u0026gt;d_name);\n file = fopen(dir-\u0026gt;d_name, \"r\");\n fseek(file, 0, SEEK_END);\n long length = ftell(file);\n fseek(file, 0, SEEK_SET);\n printf(\", Filesize: %ld\\n\", length);\n\n char *buffer = malloc(length + 1);\n fread(buffer, 1, length, file);\n buffer[length] = '\\0';\n\n fclose(file);\n doAlgorithm(buffer);\n }\n }\n closedir(d);\n return (EXIT_SUCCESS);\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"43413230","answer_count":"1","comment_count":"7","creation_date":"2017-04-14 13:21:44.177 UTC","last_activity_date":"2017-04-14 14:16:47.767 UTC","last_edit_date":"2017-04-14 13:49:23.25 UTC","last_editor_display_name":"","last_editor_user_id":"7622347","owner_display_name":"","owner_user_id":"7622347","post_type_id":"1","score":"0","tags":"c|file|fread|fseek|ftell","view_count":"89"} +{"id":"14832319","title":"Post to several friend's timeline via FaceBook feed dialog","body":"\u003cp\u003eSince request \"id/feed\" was deprecated, I'm trying to implement Facebook feed dialog to post to user's friends timelines. \u003c/p\u003e\n\n\u003cp\u003eI found in documentation parameter \"to\", where I can define ID of the user post to.\u003c/p\u003e\n\n\u003cp\u003eBut if I want to post one message to several friends, how can I do that? \u003c/p\u003e\n\n\u003cp\u003eI'm trying to use something like \"user_id_1,user_id_2,user_id_3\" but it does not work.\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2013-02-12 12:13:08.23 UTC","favorite_count":"1","last_activity_date":"2013-02-12 12:13:08.23 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1233682","post_type_id":"1","score":"2","tags":"android|facebook","view_count":"665"} +{"id":"6181051","title":"BLOB in MySQL with DataSet in C#","body":"\u003cp\u003eI would like to insert a PDF file in a MySQL database, in a \u003ca href=\"http://en.wikipedia.org/wiki/Binary_large_object\" rel=\"nofollow\"\u003eblob\u003c/a\u003e.\u003c/p\u003e\n\n\u003cp\u003eHere is the code I'm using to insert (I use a WebService and a DataSet):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eFileStream fs = new FileStream(fileName, FileMode.OpenOrCreate, FileAccess.Read);\n\nbyte[] MyData = new byte[fs.Length];\nfs.Read(MyData, 0, System.Convert.ToInt32(fs.Length));\n\nfs.Close();\n\nthis._requete = \"INSERT INTO stage_abstract(etuid, anac, pdf)\n VALUES (\" + 6 + \", \" + 2009 + \", \\\"\" + MyData + \"\\\")\";\n\nint suc = 0;\nusing (this._ds)\n{\n suc = this._dbo.InsertUpdateDelete(ws, this._requete);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I want to get and create the original file with which is in my blob, it seems to work well. But when I want to open my new PDF file, Adobe indicates that the file is not supported or is corrupted ...\u003c/p\u003e\n\n\u003cp\u003eHere is the code I'm using to get information from my blob. I receive informations in a DataSet (\u003ccode\u003e_ds\u003c/code\u003e):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ethis._requete = \"SELECT stage_abstract.pdf as pdf\n FROM stage_abstract\n WHERE stage_abstract.etuid = \" + 6 + \"\n AND stage_abstract.anac = \" + 2009;\n\nusing (this._ds)\n{\n this._ds = this._dbo.select(this.ws, this._requete);\n}\n\nbyte[] MyData = (byte[]) this._ds.Tables[0].Rows[0][\"pdf\"];\nint ArraySize = new int();\nArraySize = MyData.GetUpperBound(0);\n\nFileStream fs = new FileStream(@\"C:\\essairecup.pdf\"\n , FileMode.OpenOrCreate, FileAccess.Write);\nfs.Write(MyData, 0, ArraySize);\nfs.Close();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow do I fix this problem? I think the problem is where I insert, because I can see \u003ccode\u003e13o\u003c/code\u003e in my blob.\u003c/p\u003e","accepted_answer_id":"6194521","answer_count":"1","comment_count":"1","creation_date":"2011-05-30 21:54:41.957 UTC","last_activity_date":"2011-06-11 13:52:24.96 UTC","last_edit_date":"2011-06-11 13:52:24.96 UTC","last_editor_display_name":"","last_editor_user_id":"63550","owner_display_name":"","owner_user_id":"645582","post_type_id":"1","score":"4","tags":"c#|.net|mysql|dataset|blob","view_count":"4084"} +{"id":"5408157","title":"Does every new view need a new layoutparams?","body":"\u003cp\u003eSo let's say that I want to create multiple TextViews programatically inside a relative layout. It looks like with each new TextView I also have to create a new LayoutParams like so:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eRelativeLayout.LayoutParams p = new RelativeLayout.LayoutParams(\n ViewGroup.LayoutParams.WRAP_CONTENT,\n ViewGroup.LayoutParams.WRAP_CONTENT);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThen I add whatever rules I want using:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ep.addrule(...,...);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt seems that I cannot use this single LayoutParams to set the rules for multiple TextViews. Is this a true statement?\u003c/p\u003e\n\n\u003cp\u003eThanks,\u003c/p\u003e","accepted_answer_id":"5408407","answer_count":"3","comment_count":"0","creation_date":"2011-03-23 16:03:36.683 UTC","last_activity_date":"2014-05-15 09:41:55.157 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"425962","post_type_id":"1","score":"7","tags":"android","view_count":"3117"} +{"id":"39378924","title":"Need recommendations of an exception tracking system","body":"\u003cp\u003eWe need a recommendation for tracking exceptions in our web app. Our front-end is using Angular 1 or 2, back-end is using ColdFusion. We found \u003ca href=\"https://bugsnag.com/\" rel=\"nofollow\"\u003eBugSnag\u003c/a\u003e, but this company cannot do annual billing. \u003c/p\u003e\n\n\u003cp\u003eDoes anyone know any other similar product?\u003c/p\u003e\n\n\u003cp\u003eThanks a lot!\u003c/p\u003e","accepted_answer_id":"39379950","answer_count":"1","comment_count":"1","creation_date":"2016-09-07 21:00:55.14 UTC","last_activity_date":"2016-09-07 22:30:09.297 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3771992","post_type_id":"1","score":"-4","tags":"angularjs|exception|angular|exception-handling|coldfusion","view_count":"53"} +{"id":"25356075","title":"-(void) loadView with NSMutableArray","body":"\u003cpre\u003e\u003ccode\u003e- (void)loadView \n{\n [super loadView];\n arrayOfImages = [[NSMutableArray alloc]initWithObjects:@\"11.jpg\",@\"22.jpg\",@\"33.jpg\", nil]; \n UIImageView *awesomeView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];\n [awesomeView setImage :[UIImage imageNamed:[arrayOfImages objectAtIndex:0]]];\n awesomeView.contentMode = UIViewContentModeScaleAspectFit;\n [self.view addSubview:awesomeView]; \n NSLog(@\"%@\",[arrayOfImages objectAtIndex:0]);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I put the \u003ccode\u003eNSMutableArray\u003c/code\u003e in \u003ccode\u003e-(void)viewDidLoad\u003c/code\u003e, \u003ccode\u003eUIImageView\u003c/code\u003e displays nothing and \u003ccode\u003eNSLog\u003c/code\u003e shows NULL. Why is that?\u003c/p\u003e\n\n\u003cp\u003eps. NSMutableArray worked perfectly in \u003ccode\u003e-(void)loadView\u003c/code\u003e. I've declared NSMutableArray *arrayOfImage in @interface .h file\u003c/p\u003e","accepted_answer_id":"25357722","answer_count":"2","comment_count":"6","creation_date":"2014-08-18 03:47:45.783 UTC","last_activity_date":"2014-08-18 08:06:29.06 UTC","last_edit_date":"2014-08-18 08:06:29.06 UTC","last_editor_display_name":"","last_editor_user_id":"3920843","owner_display_name":"","owner_user_id":"3920843","post_type_id":"1","score":"0","tags":"ios|objective-c|loadview","view_count":"104"} +{"id":"13286859","title":"Initializing std::vector of structs","body":"\u003cp\u003eI wish to add a bunch of objects of this type to a std::vector.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etypedef struct \n{\n int handle;\n} Handle;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHandle is defined within a C API header which I am unable to change.\u003c/p\u003e\n\n\u003cp\u003eI'm doing this at the moment but am wondering if it can be done as a one-liner.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eHandle handle1 = {12};\nHandle handle2 = {13};\nstd::vector\u0026lt;Handle\u0026gt; handles = boost::assign::list_of(handle1)(handle2);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI using a C++98 compiler.\u003c/p\u003e","accepted_answer_id":"13286921","answer_count":"1","comment_count":"0","creation_date":"2012-11-08 10:10:13.407 UTC","last_activity_date":"2012-11-08 10:13:18.78 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"607846","post_type_id":"1","score":"1","tags":"c++|boost|c++98","view_count":"182"} +{"id":"12628912","title":"JQuery load dilemma","body":"\u003cp\u003eI'm using JQuery.load() to pull a file into a document that I want to appear in all of the html files in a website. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(function() {\n$('#footer_include').load('../includes/footer.txt');\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThat works great for root documents, but as soon as I go into a new folder and deeper it needs a separate variation on the same to load. For example...\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(function() {\n$('#footer_include').load('../../includes/footer.txt');\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs there a better solution to this that would work for all files? I tried \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e./includes/footer.txt\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethinking it would go back to the root folder but that didn't work. I'm using php so maybe php include would be the way to go?\u003c/p\u003e\n\n\u003cp\u003eAny help is appreciated.\u003c/p\u003e","accepted_answer_id":"12628965","answer_count":"1","comment_count":"4","creation_date":"2012-09-27 19:43:24.167 UTC","last_activity_date":"2012-09-27 19:46:45.163 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"997907","post_type_id":"1","score":"0","tags":"jquery","view_count":"30"} +{"id":"19843825","title":"scala syntax understanding _* and type*","body":"\u003cp\u003eI am having some difficulty in understanding this syntax:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e(as: List[A]) =\u0026gt; val h = insert(e, as: _*)}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef insert(h: H, as: A*): H = as.foldLeft(h)((hh, a) =\u0026gt; insert(a, hh))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat do \u003ccode\u003e_*\u003c/code\u003e and \u003ccode\u003eA*\u003c/code\u003e mean?\u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","accepted_answer_id":"19843968","answer_count":"2","comment_count":"0","creation_date":"2013-11-07 18:30:21.29 UTC","last_activity_date":"2013-11-07 18:55:36.56 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2848616","post_type_id":"1","score":"0","tags":"scala","view_count":"53"} +{"id":"17842681","title":"Slow Insert Time With Composite Primary Key in Cassandra","body":"\u003cp\u003eI have been working with Cassandra and I have hit a bit of a stumbling block. For how I need to search on data I found that a Composite primary key works great for what I need but the insert times for the record in this Column Family go to the dogs with it and I am not entirely sure why. \u003c/p\u003e\n\n\u003cp\u003eTable Definition:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCREATE TABLE exampletable (\nclientid int,\nfilledday int,\nfilledtime bigint,\nid uuid,\n...etc...\nPRIMARY KEY (clientid, filledday, filledtime, id)\n);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eclientid = The internal id of the client. filledday = The number of days since 1/1/1900. filledtime = The number of ticks of the day at which the record was recived. id = A Guid.\u003c/p\u003e\n\n\u003cp\u003eThe day and time structure exists because I need to be able to filter by day easily and quickly.\u003c/p\u003e\n\n\u003cp\u003eI know Cassandra stores Column Families with composite primary keys quite differently. From what I understand it will store the everything as new columns off of a base row of the main component of the primary key. Is that the reason the inserts would be slow? When I say slow I mean that if I just have a primary key on id the insert will take ~200 milliseconds and with the composite primary key (or any subset of it, I tried just clientid and id to the same effect) it will take upwards of 32 seconds for 1000 records. The Select times are faster out of the composite key table since I have to apply secondary indexes and use 'ALLOW FILTERING' in order to get the proper records back with the standard key table (I know I could do this in code but the concern is that I am dealing with some massive data sets and that will not always be practical or possible). \u003c/p\u003e\n\n\u003cp\u003eAm I declaring the Column Family or the Primary Key wrong for what I am trying to do? With all the unlisted, non-primary key columns the table is 37 columns wide, would that be the problem? I am quite stumped at this point. I have not be able to really find anything about others having similar problems. \u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-07-24 19:02:59.507 UTC","last_activity_date":"2013-07-25 11:13:23.943 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1634416","post_type_id":"1","score":"0","tags":"c#|cassandra","view_count":"444"} +{"id":"37232597","title":"Get pandoc to generate PDF with sans-serif font family","body":"\u003cp\u003eI'm trying to use pandoc to generate a PDF from Markdown source. I'd like the output to use only sans-serif fonts. Input:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e# Hello\n\nThis is a test.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCommand line:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epandoc -o output.pdf input.md --variable=fontfamily:arev\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI get a fine-looking PDF, but the text is serif. Output:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/EN0th.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/EN0th.png\" alt=\"Screenshot of PDF generated from Markdown source with pandoc showing serif fonts\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI tried many different command lines, but the font (family) never changes.\u003c/p\u003e\n\n\u003cp\u003eI'm using Ubuntu 14.04. I installed pandoc via apt-get.\u003c/p\u003e","accepted_answer_id":"37325770","answer_count":"1","comment_count":"0","creation_date":"2016-05-14 22:36:24.59 UTC","favorite_count":"1","last_activity_date":"2017-11-01 11:22:02.8 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"156060","post_type_id":"1","score":"2","tags":"markdown|pandoc|pdflatex","view_count":"905"} +{"id":"43160148","title":"store multiple values of custom field from menu section in joomla","body":"\u003cp\u003eI have created a custom component in joomla. I have created custom field in my view layout there is loading my custom categories (image).Everything us working fine but i am unable to store in database. How i store in database. Please see below image and code. \u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/XFVaL.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/XFVaL.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eMy Custom Field Type.\n \u0026lt;field name=\"category[]\" type=\"categoryname\" label=\"Select categories\" required=\"true\" description=\"Select categories\" /\u0026gt;\n\n\n\ndefined('_JEXEC') OR die('Restricted Area');\n\njimport('joomla.form.formfield');\n\nclass JFormFieldCategoryName extends JFormField { \n protected $type = 'categoryname';\n\n function getInput() { \n\n $key = ($this-\u0026gt;element['key_field'] ? $this-\u0026gt;element['key_field'] : 'value');\n $val = ($this-\u0026gt;element['value_field'] ? $this-\u0026gt;element['value_field'] : $this-\u0026gt;name);\n $categories=\"\";\n $dbo = \u0026amp; JFactory :: getDBO();\n $q=\"SELECT * FROM `#__custom_categories` WHERE `parent_id` = 0 ORDER BY `#__vikrentitems_categories`.`name` ASC;\";\n $dbo-\u0026gt;setQuery($q);\n $dbo-\u0026gt;Query($q);\n if ($dbo-\u0026gt;getNumRows() \u0026gt; 0) {\n $allvric=$dbo-\u0026gt;loadAssocList();\n foreach($allvric as $vric) {\n $categories.='\u0026lt;option value=\"'.$vric['id'].'\"'.($this-\u0026gt;value == $vric['id'] ? \" selected=\\\"selected\\\"\" : \"\").'\u0026gt;'.$vric['name'].'\u0026lt;/option\u0026gt;';\n $qone=\"SELECT * FROM `#__custom_categories` WHERE `parent_id` = \".$vric['id'].\" ORDER BY `#__custom_categories`.`name` ASC;\";\n $dbo-\u0026gt;setQuery($qone);\n $getchildCat = $dbo-\u0026gt;loadObjectList();\n if(!empty($getchildCat))\n {\n foreach($getchildCat as $getchildCats) {\n $categories.='\u0026lt;option value=\"'.$getchildCats-\u0026gt;id.'\"'.($this-\u0026gt;value == $getchildCats-\u0026gt;id ? \" selected=\\\"selected\\\"\" : \"\").'\u0026gt; - '.$getchildCats-\u0026gt;name.'\u0026lt;/option\u0026gt;';\n $qtwo=\"SELECT * FROM `#__custom_categories` WHERE `parent_id` = \".$getchildCats-\u0026gt;id.\" ORDER BY `#__custom_categories`.`name` ASC;\";\n $dbo-\u0026gt;setQuery($qtwo);\n $getsubchildCat = $dbo-\u0026gt;loadObjectList();\n if(!empty($getsubchildCat))\n {\n foreach($getsubchildCat as $getsubchildCats) {\n $categories.='\u0026lt;option value=\"'.$getsubchildCats-\u0026gt;id.'\"'.($this-\u0026gt;value == $getsubchildCats-\u0026gt;id ? \" selected=\\\"selected\\\"\" : \"\").'\u0026gt; - - '.$getsubchildCats-\u0026gt;name.'\u0026lt;/option\u0026gt;';\n }\n }\n }\n }\n }\n }\n $html = '\u0026lt;select multiple class=\"inputbox\" name=\"jform[request][category][]\" \u0026gt;';\n $html .= '\u0026lt;option value=\"\"\u0026gt;All Categories\u0026lt;/option\u0026gt;';\n $html .= $categories;\n $html .='\u0026lt;/select\u0026gt;';\n return $html;\n }\n}\n\n\n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is not store in database. can you please help me. How i store.\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-04-01 17:50:33.047 UTC","last_activity_date":"2017-04-01 17:50:33.047 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"998983","post_type_id":"1","score":"0","tags":"joomla|store|joomla3.0|custom-fields","view_count":"22"} +{"id":"34872806","title":"EntityFramework Parameter value is out of range","body":"\u003cp\u003eDespite of all already read answers, cannot deal with \u003cstrong\u003eDecimal\u003c/strong\u003e and EF.\nI've a SQLServer 2012 table (\u003cem\u003eTraffico\u003c/em\u003e) who defines this field:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[traffico_out] [decimal](30, 10) NULL\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf I test with this simple query:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eUPDATE dbo.Traffico\nSET traffico_out=55534448359.141929\nWHERE id=10;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAll works fine and the decimal value is stored.\u003c/p\u003e\n\n\u003cp\u003eI've to deploy an ASP.NET MVC 4 application using Entity Framework 6, \u003cstrong\u003eDatabase First\u003c/strong\u003e approach.\nI've generated the model starting from existing table.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eContext\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic partial class PeeringEntities : DbContext\n{\n\n public PeeringEntities()\n : base(\"name=PeeringEntities\")\n {\n }\n\n protected override void OnModelCreating(DbModelBuilder modelBuilder)\n {\n throw new UnintentionalCodeFirstException();\n }\n\n public virtual DbSet\u0026lt;Traffico\u0026gt; Traffico { get; set; }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eTable entity\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic partial class Traffico\n{\n public int id { get; private set; }\n public Nullable\u0026lt;decimal\u0026gt; traffico_out { get; set; }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDMX\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;EntityType Name=\"Traffico\"\u0026gt;\n \u0026lt;Property Name=\"id\" Type=\"int\" StoreGeneratedPattern=\"Computed\" Nullable=\"false\" /\u0026gt;\n \u0026lt;Property Name=\"traffico_out\" Type=\"decimal\" Precision=\"30\" Scale=\"10\" /\u0026gt;\n\u0026lt;/EntityType\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAll the code ablove has been auto-generated.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eException\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eWhen I attempt to add a new record to '\u003cem\u003eTraffico\u003c/em\u003e' table, I get an out of range error. In my Controller (where \u003cem\u003edb\u003c/em\u003e is DbContext):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eTraffico _new_item = new Traffico();\n_new_item.traffico_out = 5283148511.91876M;\ndb.Traffico.Add(_new_item);\ndb.SaveChanges();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAt SaveChanges time I got a DbUpdateException:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eInnerException: An error occurred while updating the entries. See the inner exception for details.\nInnerException -\u0026gt; InnerException: {\"Parameter value '5283148511,91876' is out of range.\"}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat I'm doing wrong?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT\u003c/strong\u003e\nLooking at my output directory I've found three files that are generated from my EDMX:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003e.csdl \u003c/li\u003e\n\u003cli\u003e.msl \u003c/li\u003e\n\u003cli\u003e.ssdl\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eDespite of edmx precision and scale, I've found in the .ssdl:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;Property Name=\"traffico_out\" Type=\"decimal\" Precision=\"12\" Scale=\"5\" /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow I'm really confused: how can I change this?\u003c/p\u003e","answer_count":"1","comment_count":"4","creation_date":"2016-01-19 09:19:31.88 UTC","favorite_count":"1","last_activity_date":"2016-01-19 11:40:00.527 UTC","last_edit_date":"2016-01-19 10:04:53.227 UTC","last_editor_display_name":"","last_editor_user_id":"520032","owner_display_name":"","owner_user_id":"520032","post_type_id":"1","score":"0","tags":"c#|asp.net|sql-server|asp.net-mvc|entity-framework","view_count":"742"} +{"id":"34577196","title":"Requesting guidance in creating custom SeekBar in Android. (like shown in the image)","body":"\u003cp\u003eI have a task to create a SeekBar looking like this:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/hjZPD.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/hjZPD.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eMy question is: How to segment the seekbar like that? I have made custom seekbars before, but I don't know how to segment the bar like that, with lines extending beyond the seekbar's height.\u003c/p\u003e\n\n\u003cp\u003eI have stumbled across a library, the ComboSeekBar, but it doesn't help much.\u003c/p\u003e\n\n\u003cp\u003eThanks in advance to anyone willing to help!\u003c/p\u003e\n\n\u003cp\u003eCheers!\u003c/p\u003e","accepted_answer_id":"34577430","answer_count":"2","comment_count":"1","creation_date":"2016-01-03 13:49:15.743 UTC","last_activity_date":"2016-01-03 15:35:16 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4161064","post_type_id":"1","score":"5","tags":"java|android|seekbar|android-seekbar","view_count":"1102"} +{"id":"8419401","title":"Python defaultdict and lambda","body":"\u003cp\u003eIn someone else's code I read the following two lines:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ex = defaultdict(lambda: 0)\ny = defaultdict(lambda: defaultdict(lambda: 0))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAs the argument of defaultdict is a default factory, I think the first line means that when I call x[k] for a nonexistent key k (such as a statement like v=x[k]), the key-value pair (k,0) will be automatically added to the dictionary, as if the statement x[k]=0 is first executed. Am I correct?\u003c/p\u003e\n\n\u003cp\u003eAnd what about y? It seems that the default factory will create a defaultdict with default 0. But what does that mean concretely? I tried to play around with it in Python shell, but couldn't figure out what it is exactly.\u003c/p\u003e","accepted_answer_id":"8419427","answer_count":"4","comment_count":"0","creation_date":"2011-12-07 17:06:43.993 UTC","favorite_count":"15","last_activity_date":"2015-01-13 08:43:53.2 UTC","last_edit_date":"2011-12-07 17:13:11.447 UTC","last_editor_display_name":"","last_editor_user_id":"166749","owner_display_name":"","owner_user_id":"740006","post_type_id":"1","score":"33","tags":"python|collections|defaultdict","view_count":"25426"} +{"id":"20792683","title":"fixed banners right and left overlap","body":"\u003cp\u003eI am trying to add side banners 160X600 that remain fixed with scrolling but my problem when i make the two divs position fixed they overlap although there is float left and right this problem is fixed when specifying position absolute to make it clear this my html \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"addsright\"\u0026gt;content\u0026lt;/div\u0026gt;\u0026lt;div class=\"adds\"\u0026gt;content\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethis my css\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e.adds{position:fixed;float:left;margin-left:0px;margin-top:60px;z-index:1000;}.addsright{position:fixed;float:right;margin-right:0px;margin-top:60px;z-index:1000;}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"20792844","answer_count":"1","comment_count":"1","creation_date":"2013-12-26 23:34:24.6 UTC","last_activity_date":"2013-12-26 23:53:51.36 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2489785","post_type_id":"1","score":"0","tags":"html|css","view_count":"862"} +{"id":"31218110","title":"How to solve Unknown layer type in Caffe IOS.?","body":"\u003cp\u003e1.I download source from \u003ca href=\"https://github.com/aleph7/caffe/\" rel=\"nofollow noreferrer\"\u003ehttps://github.com/aleph7/caffe/\u003c/a\u003e and builded the caffe as static library for IOS and IPhone.\n2.Created sample demo code and Linked Caffe static lib(.a) and execute the code.\n3.Now I got Run time error\u003c/p\u003e\n\n\u003cp\u003eF0519 14:54:12.494139 14504 layer_factory.hpp:77] Check failed: registry.count(t ype) == 1 (0 vs. 1) Unknown layer type: Convolution (known types: MemoryData)\u003c/p\u003e\n\n\u003cp\u003e4.I searched a lot and found one solution from below link\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://stackoverflow.com/questions/30325108/caffe-layer-creation-failure\"\u003eCaffe layer creation failure\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e5.If I create dynamic library instead of static library. It will work.\u003c/p\u003e\n\n\u003cp\u003e6.I tried to convert static library into Dynamic library.I got Error on Xcode that is cannot open the project I referred below link.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://stackoverflow.com/questions/1349115/how-do-i-change-an-existing-xcode-target-from-dynamic-to-static\"\u003eHow do I change an existing XCode target from dynamic to static?\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eCan you help how to solve this..?\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2015-07-04 07:24:05.243 UTC","last_activity_date":"2017-02-07 16:22:21.74 UTC","last_edit_date":"2017-05-23 11:53:26.26 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"3132189","post_type_id":"1","score":"1","tags":"ios|iphone|static|caffe","view_count":"495"} +{"id":"42807090","title":"Specify my own execution plan for query","body":"\u003cp\u003eLets say I know a lot about the distribution of my data, and therefore know the optimal execution plan for a query. \u003c/p\u003e\n\n\u003cp\u003eIs there a way to specify my own execution plan, fully circumventing table statistics and the optimizer?\u003c/p\u003e","accepted_answer_id":"42807414","answer_count":"1","comment_count":"0","creation_date":"2017-03-15 10:30:06.43 UTC","last_activity_date":"2017-03-15 10:42:33.67 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3867787","post_type_id":"1","score":"2","tags":"sql|database|performance|sybase-ase|sql-execution-plan","view_count":"31"} +{"id":"14778192","title":"how to curry a method with one parameter","body":"\u003cp\u003ehere is my code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef f x\n x\nend\n\ng = method(:f).to_proc.curry.(123)\n\np g\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want \u003ccode\u003eg\u003c/code\u003e to be a callable that takes no parameters and applies \u003ccode\u003e123\u003c/code\u003e to \u003ccode\u003ef\u003c/code\u003e. Instead, \u003ccode\u003eg\u003c/code\u003e contains the result of the application.\u003c/p\u003e\n\n\u003cp\u003eAm I doing it the complicated way?\u003c/p\u003e\n\n\u003cp\u003eEDIT: yes, \u003ccode\u003eg = lambda {f 123}\u003c/code\u003e works, but I am asking how to curry \u003ccode\u003ef\u003c/code\u003e.\u003c/p\u003e","accepted_answer_id":"14778422","answer_count":"2","comment_count":"1","creation_date":"2013-02-08 17:36:51.393 UTC","favorite_count":"1","last_activity_date":"2016-12-06 22:42:43.633 UTC","last_edit_date":"2013-02-08 17:42:17.467 UTC","last_editor_display_name":"","last_editor_user_id":"410102","owner_display_name":"","owner_user_id":"410102","post_type_id":"1","score":"1","tags":"ruby","view_count":"165"} +{"id":"109280","title":"In ASP.NET how you get the physcial file path when HttpContext.Current is NULL?","body":"\u003cp\u003eI'm working with DotNetNuke's scheduler to schedule tasks and I'm looking to get the physical file path of a email template that I created. The problem is that HttpContext is NULL because the scheduled task is on a different thread and there is not http request. How would you go about getting the file's physical path?\u003c/p\u003e","accepted_answer_id":"114967","answer_count":"5","comment_count":"0","creation_date":"2008-09-20 20:29:47.65 UTC","favorite_count":"1","last_activity_date":"2008-09-25 13:46:57.53 UTC","last_editor_display_name":"","owner_display_name":"John","owner_user_id":"19490","post_type_id":"1","score":"7","tags":".net|asp.net|dotnetnuke|scheduler|server.mappath","view_count":"7458"} +{"id":"7933604","title":"Append tag to end of URL on form select","body":"\u003cp\u003eI have this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;select onchange=\"window.open(this.options[this.selectedIndex].value,'_top')\"\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow do I change so that instead it appends the 'value' to the end of the url?\u003c/p\u003e","accepted_answer_id":"7933664","answer_count":"1","comment_count":"0","creation_date":"2011-10-28 18:58:36.37 UTC","last_activity_date":"2011-10-28 19:05:57.85 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1018958","post_type_id":"1","score":"0","tags":"javascript|html|forms","view_count":"122"} +{"id":"30624566","title":"Change default font of the app","body":"\u003cp\u003eI am working on an android project and I want to change default font for all the app, not just a single TextView or button.\u003c/p\u003e\n\n\u003cp\u003eMy custom font is stored as \u003ccode\u003eassets/fonts/font.ttf\u003c/code\u003e\u003c/p\u003e","accepted_answer_id":"30625446","answer_count":"3","comment_count":"0","creation_date":"2015-06-03 15:33:13.793 UTC","last_activity_date":"2015-06-09 10:25:07.34 UTC","last_edit_date":"2015-06-09 10:25:07.34 UTC","last_editor_display_name":"","last_editor_user_id":"825508","owner_display_name":"user4606472","post_type_id":"1","score":"0","tags":"android|fonts","view_count":"1966"} +{"id":"9706225","title":"How does an Entry\u003cK,V\u003e array in java work?","body":"\u003cblockquote\u003e\n \u003cp\u003e\u003cstrong\u003ePossible Duplicate:\u003c/strong\u003e\u003cbr\u003e\n \u003ca href=\"https://stackoverflow.com/questions/7131652/generic-array-creation-error\"\u003eGeneric array creation error\u003c/a\u003e \u003c/p\u003e\n\u003c/blockquote\u003e\n\n\n\n\u003cp\u003eI'm working on an assignment that deals with an Entry array. I figured out how to create it, but I'm not fully understanding how it works. Why is it that when creating the new Entry array, I don't need to specify the K,V type? If you guys could provide some insight as to how it functions, I would greatly appreciate it.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate Entry\u0026lt;K,V\u0026gt;[] data;\n\n\ndata = new Entry[4096];\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"9707120","answer_count":"2","comment_count":"2","creation_date":"2012-03-14 16:43:31.647 UTC","favorite_count":"1","last_activity_date":"2012-03-14 19:49:22.613 UTC","last_edit_date":"2017-05-23 12:06:10.76 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"1241786","post_type_id":"1","score":"2","tags":"java|generics|data-structures","view_count":"354"} +{"id":"14801468","title":"Vim won't properly indent Python code when using the = command","body":"\u003cp\u003eWhen I use the = command to indent an entire Python file or a section it won't properly indent it. Here's my vimrc:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eset nocompatible\nsyntax on\nset ruler\nset tabstop=2\nset softtabstop=2\nset shiftwidth=2\nset expandtab\nset smarttab\nset hlsearch\nset incsearch\nset ignorecase\nset autoindent\n\" turn on line numbers:\nset number\n\" Toggle line numbers and fold column for easy copying:\nnnoremap \u0026lt;F2\u0026gt; :set nonumber!\u0026lt;CR\u0026gt;:set foldcolumn=0\u0026lt;CR\u0026gt;\nnnoremap \u0026lt;F4\u0026gt; :set nospell!\u0026lt;CR\u0026gt;\nnnoremap \u0026lt;F3\u0026gt; :set invpaste paste?\u0026lt;Enter\u0026gt;\nimap \u0026lt;F3\u0026gt; \u0026lt;C-O\u0026gt;\u0026lt;F3\u0026gt;\nset pastetoggle=\u0026lt;F3\u0026gt;\n\nfiletype on\nfiletype plugin indent on\nfiletype plugin on\n\n\" Execute file being edited with \u0026lt;Shift\u0026gt; + e:\nmap \u0026lt;buffer\u0026gt; \u0026lt;S-e\u0026gt; :w\u0026lt;CR\u0026gt;:!/usr/bin/env python % \u0026lt;CR\u0026gt;\nlet g:solarized_termcolors=256\nset background=dark\ncolorscheme solarized \n\"set spell spelllang=en_us\n\nset backspace=indent,eol,start\nautocmd FileType python set complete+=k~/.vim/syntax/python.vim isk+=.,(\nautocmd VimEnter * NERDTree\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAlso when I loop through my python files using w or b for instance, or when deleting it won't delete properly. For instance it will not stop on the . or ( when deleting a work before them and will even delete these.\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2013-02-10 19:05:46.64 UTC","favorite_count":"1","last_activity_date":"2013-03-04 20:23:34.727 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"478108","post_type_id":"1","score":"3","tags":"python|vim","view_count":"374"} +{"id":"9391330","title":"Activity with a visible software keyboard","body":"\u003cp\u003eI've seen some similar questions here but haven't found what I was really looking for. I need to create a simple activity where the user must enter a number and return it to the main activity. The layout should contain only an edit text on the upper half of the screen and a software keyboard on the lower half of the screen. The activity should finish when the Done key is pressed on the keyboard. Will appreciate any links or code snippets to help resolve this issue. \u003c/p\u003e","accepted_answer_id":"9392211","answer_count":"1","comment_count":"3","creation_date":"2012-02-22 08:22:50.723 UTC","last_activity_date":"2012-02-22 09:32:15.607 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"543539","post_type_id":"1","score":"4","tags":"android|android-activity|android-softkeyboard|visible","view_count":"180"} +{"id":"26348334","title":"Spring project deploy on real server","body":"\u003cp\u003eI have a Spring MVC project running locally on tomcat right now. What I need to do to be able to run it on my linux server? How can I deploy it? Before I used firezilla(running usual jars) to connect to server using ssh. Please help me by writing easy steps on how to run web application on server, thank you.\u003c/p\u003e","accepted_answer_id":"26351065","answer_count":"1","comment_count":"0","creation_date":"2014-10-13 20:27:09.61 UTC","last_activity_date":"2014-10-14 00:49:56.673 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3902438","post_type_id":"1","score":"-3","tags":"java|spring|spring-mvc","view_count":"778"} +{"id":"29273317","title":"I cannot find out how to do this anywere in my book","body":"\u003cp\u003eHow do I create a style rule that sets the font color to white in older browsers, and to white with 50% opacity in newer browsers?\u003c/p\u003e","accepted_answer_id":"29273348","answer_count":"1","comment_count":"0","creation_date":"2015-03-26 07:48:22.11 UTC","last_activity_date":"2015-03-26 07:50:19.967 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4466075","post_type_id":"1","score":"0","tags":"css","view_count":"17"} +{"id":"15271747","title":"Django 1.5. 'url' requires a non-empty first argument. The syntax changed in Django 1.5","body":"\u003cp\u003eIf I try:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ehref=\"{% url post_content product_id=p.id %}\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have this error:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e'url' requires a non-empty first argument. The syntax changed in\n Django 1.5, see the docs.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eHow to change it?\u003c/p\u003e","accepted_answer_id":"15271822","answer_count":"1","comment_count":"1","creation_date":"2013-03-07 12:51:47.453 UTC","favorite_count":"1","last_activity_date":"2013-03-07 12:55:25.477 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1432745","post_type_id":"1","score":"5","tags":"django","view_count":"7332"} +{"id":"44530504","title":"Password confirmation in Rails 5","body":"\u003cp\u003eThis is my view:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;%=form_for [:admin, @user] do |f|%\u0026gt;\n\n \u0026lt;ul\u0026gt;\n \u0026lt;% @user.errors.full_messages.each do |msg| %\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;%= msg %\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;% end %\u0026gt;\n \u0026lt;/ul\u0026gt;\n\n \u0026lt;%=f.label :name %\u0026gt;\n \u0026lt;%=f.text_field :name %\u0026gt;\n\n\n \u0026lt;%=f.label :email %\u0026gt;\n \u0026lt;%=f.text_field :email %\u0026gt;\n\n \u0026lt;%=f.label :password %\u0026gt;\n \u0026lt;%=f.password_field :password %\u0026gt;\n\n \u0026lt;%=f.label :password_confirmation %\u0026gt;\n \u0026lt;%=f.password_field :password_confirmation%\u0026gt;\n\n \u0026lt;%=f.submit \"Submit\" %\u0026gt;\n\u0026lt;%end%\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eController code for adding user:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef create\n @user = User.new(user_params)\n\n if @user.save\n redirect_to admin_users_path\n else\n render 'new'\n end\nend\n\nprivate\ndef user_params\n params.require(:user).permit(:name, :email, :password)\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThese are validations in the model:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evalidates :name, presence: true\nvalidates :email, presence: true\nvalidates :password, presence: true\nvalidates :password, confirmation: { case_sensitive: true }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut \u003ccode\u003econfirmation password\u003c/code\u003e doesn't work. \u003c/p\u003e\n\n\u003cp\u003eValidation works for all (they are required) form elements, except second password input - \u003ccode\u003epassword_confirmation\u003c/code\u003e which can be different from first password input. \u003c/p\u003e\n\n\u003cp\u003eUser is added to the database even if second password input is empty, because in the validation rules, there is no rule for that .\u003c/p\u003e\n\n\u003cp\u003eWhat am I doing wrong ?\u003c/p\u003e","accepted_answer_id":"44531266","answer_count":"2","comment_count":"2","creation_date":"2017-06-13 20:01:57.163 UTC","last_activity_date":"2017-06-13 20:48:48.137 UTC","last_edit_date":"2017-06-13 20:46:05.297 UTC","last_editor_display_name":"","last_editor_user_id":"5849229","owner_display_name":"","owner_user_id":"5849229","post_type_id":"1","score":"2","tags":"ruby-on-rails|ruby-on-rails-5","view_count":"315"} +{"id":"5884585","title":"What's the minimum set of tools I need to open Windows Azure samples shipped by Microsoft?","body":"\u003cp\u003eI wanted to try open \"Hello World\" from \u003ca href=\"http://msdn.microsoft.com/en-us/library/gg432966.aspx\" rel=\"noreferrer\"\u003ehere\u003c/a\u003e. I already had Visual Studio 2010 installed. I went \u003ca href=\"http://www.microsoft.com/downloads/en/details.aspx?FamilyID=7a1089b6-4050-4307-86c4-9dadaa5ed018\" rel=\"noreferrer\"\u003ehere\u003c/a\u003e and downloaded \u003ccode\u003eWindowsAzureSDK-x86.exe\u003c/code\u003e and installed the SDK. \u003c/p\u003e\n\n\u003cp\u003eYet when I double click the .sln in the sample Visual Studio opens the .csproj (the project with web role) just fine but complains it can't open the .ccproj file because \u003cem\u003eits project type is not supported by this version of the application\u003c/em\u003e.\u003c/p\u003e\n\n\u003cp\u003eWhat else do I have to install so that I can open that .ccproj project file?\u003c/p\u003e","accepted_answer_id":"5907313","answer_count":"2","comment_count":"0","creation_date":"2011-05-04 13:59:05.047 UTC","favorite_count":"2","last_activity_date":"2011-05-06 05:52:02.443 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"57428","post_type_id":"1","score":"5","tags":"visual-studio|visual-studio-2010|azure|cloud","view_count":"2157"} +{"id":"15703176","title":"k-Travelling Salesman optimization","body":"\u003cp\u003eGiven a weighted graph which current I have more than 100 nodes. The question is then how to find shortest tour through an array of nodes (10 nodes for instances) which belongs to the built graph. The question seems similar to traveling salesman problem but it's not.\u003c/p\u003e\n\n\u003cp\u003eMy current solution is quite straightforward\nStep 1: Build a new graph from array of 10 nodes which I have to construct tour from\nStep 2: Use Dijkstra to find distance between nodes and connect all the vertices in the graph\nStep 3: Now it simply turns into traveling salesman problem\u003c/p\u003e\n\n\u003cp\u003eEasy. However, step 2 complexity is O(n^2) since I have to find shortest path (which Dijkstra having polynomial complexity) for all combination of nodes of new graph. \u003c/p\u003e\n\n\u003cp\u003eHow can I make my algorithm faster? Best case being I can eliminate the bottleneck of having to find shortest distance for every pair combinations of nodes in my new graph.\u003c/p\u003e","accepted_answer_id":"15703354","answer_count":"1","comment_count":"0","creation_date":"2013-03-29 12:23:45.823 UTC","favorite_count":"1","last_activity_date":"2013-03-29 12:39:21.537 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"483253","post_type_id":"1","score":"-1","tags":"algorithm","view_count":"152"} +{"id":"39019909","title":"How to convert string from [object HTMLDocument] in android or java","body":"\u003cp\u003eI am developing a customized gecko powered android browser. I want to print the source code in console.\u003c/p\u003e\n\n\u003cp\u003eWhen I try to print it shows \u003ccode\u003e[object HTMLDocument]\u003c/code\u003e. \u003c/p\u003e\n\n\u003cp\u003eThe code is given below :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e function onPageLoad(event) {\n // the target is an HTMLDocument\n let contentDocument = event.target;\n let browser = BrowserApp.getBrowserForDocument(contentDocument);\n console.log(\"Page loaded: \" + browser.contentTitle);\n console.log(\"Page loaded content: \" + browser.contentDocument);\n\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe output is Page loaded content: \u003ccode\u003e[object HTMLDocument]\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eI want to print the source code in \u003ccode\u003e[object HTMLDocument]\u003c/code\u003e.\u003c/p\u003e","answer_count":"4","comment_count":"0","creation_date":"2016-08-18 13:47:38.407 UTC","last_activity_date":"2016-08-23 09:17:09.81 UTC","last_edit_date":"2016-08-18 14:19:25.283 UTC","last_editor_display_name":"","last_editor_user_id":"4823977","owner_display_name":"","owner_user_id":"6649153","post_type_id":"1","score":"1","tags":"javascript|java|android|gecko|html-rendering","view_count":"459"} +{"id":"46271798","title":"I have inserted items to mongodb collection but i cant render items from mongodb collection to ejs file","body":"\u003cp\u003eI have inserted items to MongoDB collection but I can't render items from MongoDB collection to an \u003ccode\u003e.ejs\u003c/code\u003e file.\u003c/p\u003e\n\n\u003cp\u003e\u003cdiv class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\"\u003e\r\n\u003cdiv class=\"snippet-code\"\u003e\r\n\u003cpre class=\"snippet-code-js lang-js prettyprint-override\"\u003e\u003ccode\u003evar express = require('express');\r\nvar router = express.Router();\r\nvar mongo = require('mongodb');\r\nvar bodyParser = require('body-parser');\r\nvar ejs = require('ejs');\r\nvar express = require('express');\r\nvar expressValidator = require('express-validator');\r\nvar app = express();\r\napp.set('views',__dirname+'/views');\r\napp.set('view engine','ejs');\r\napp.use(bodyParser.urlencoded({extended:true}));\r\nvar path =require('path');\r\n\r\ndb = new mongo.Db('shopping',new mongo.Server(\"127.0.0.1\", 27017, {}), {});\r\n\r\napp.get('/',function(req, res) {\r\n res.render('index.ejs');\r\n});\r\n\r\napp.post('/insert',function(req, res) {\r\n db.open(function(err, db) {\r\n db.collection('shopping_list',function(err, collection) {\r\n doc = {\r\n item: req.body.item,\r\n quantity: req.body.quan\r\n };\r\n collection.insert(doc, function() {\r\n res.send('successfull');\r\n });\r\n });\r\n });\r\n});\r\n\r\nvar server = app.listen(8000, function() {\r\n var host = server.address().address\r\n var port = server.address().port\r\n console.log(\"listening at http://%s:%s\", host, port);\r\n})\u003c/code\u003e\u003c/pre\u003e\r\n\u003cpre class=\"snippet-code-html lang-html prettyprint-override\"\u003e\u003ccode\u003e\u0026lt;!DOCTYPE html\u0026gt;\r\n\u0026lt;html\u0026gt;\r\n\u0026lt;head\u0026gt;\r\n \u0026lt;title\u0026gt;shopping\u0026lt;/title\u0026gt;\r\n \u0026lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"\u0026gt;\r\n \u0026lt;link rel=\"stylesheet\" href=\"css/bootstrap.min.css\"\u0026gt;\r\n\u0026lt;/head\u0026gt;\r\n\r\n\u0026lt;style type=\"text/css\"\u0026gt;\r\nh1 {\r\n text-align: center;\r\n font-family: sans-serif;\r\n}\r\n.container {\r\n border: 1px solid black;\r\n margin-top: 50px;\r\n padding:20px;\r\n width:750px;\r\n margin-left: 300px;\r\n}\r\n\u0026lt;/style\u0026gt;\r\n\r\n\u0026lt;body\u0026gt;\r\n\u0026lt;form action=\"/insert\" method=\"POST\"\u0026gt;\r\n \u0026lt;h1\u0026gt; Shopping List \u0026lt;/h1\u0026gt;\r\n \u0026lt;div class=\"container\"\u0026gt;\r\n \u0026lt;div class=\"row\"\u0026gt;\r\n \u0026lt;div class=\"col-md-4\"\u0026gt;\r\n \u0026lt;label style=\"margin-left: 20px;\"\u0026gt;Shopping item\u0026lt;/label\u0026gt;\u0026amp;emsp;\u0026amp;emsp;\u0026amp;emsp;\u0026amp;emsp;\u0026amp;emsp;\u0026amp;emsp;\u0026amp;emsp;\u0026amp;emsp;\u0026amp;emsp;\u0026amp;emsp;\u0026amp;emsp;\u0026amp;emsp;\r\n \u0026lt;label\u0026gt;Quantity\u0026lt;/label\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"row\"\u0026gt;\r\n \u0026lt;div class=\"col-md-8\"\u0026gt;\r\n \u0026lt;input type=\"text\" id=\"item\" name=\"item\"/\u0026gt;\u0026amp;emsp;\u0026amp;emsp;\u0026amp;emsp;\u0026amp;emsp;\r\n \u0026lt;input type=\"text\" id=\"quan\" name=\"quan\"/\u0026gt;\u0026amp;emsp;\u0026amp;emsp;\u0026amp;emsp;\u0026amp;emsp;\r\n \u0026lt;input type=\"submit\" value=\"Add item\" style=\"background-color: #a3a3c2; color:white; width:170px;\" /\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"row\"\u0026gt;\r\n \u0026lt;div class=\"col-md-10\"\u0026gt;\r\n \u0026lt;template name=\"list_items\"\u0026gt;\r\n \u0026lt;ol\u0026gt;\r\n {{#each all_items}}\r\n \u0026lt;li\u0026gt;{{this}}\u0026lt;/li\u0026gt;\r\n {{/each}}\r\n \u0026lt;/ol\u0026gt;\r\n \u0026lt;/template\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n\u0026lt;/form\u0026gt;\r\n\r\n\u0026lt;script\u0026gt;\r\nfunction show_items() {\r\n jQuery.get('http://127.0.0.1:5000/api/v2/items', function(data) {\r\n var i, html;\r\n html = '\u0026lt;ul\u0026gt;';\r\n console.log(data);\r\n for (i = 0; i \u0026lt; data[\"items\"].length; i++) {\r\n html += '\u0026lt;li\u0026gt;' + data[\"items\"][i][\"text\"] + '\u0026lt;button class=\"delete\" data-id=\"' + data[\"items\"][i][\"_id\"][\"$oid\"] + '\"\u0026gt;Delete\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;';\r\n }\r\n html += '\u0026lt;/ul\u0026gt;';\r\n $(\"#items\").html(html);\r\n $(\".delete\").click(delete_item);\r\n });\r\n}\r\n\u0026lt;/script\u0026gt;\r\n\u0026lt;/body\u0026gt;\r\n\u0026lt;/html\u0026gt;\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003c/p\u003e\n\n\u003cp\u003eI have inserted items to a MongoDB collection but I can't render items from the collection to an \u003ccode\u003e.ejs\u003c/code\u003e file. I want to render items to the same page where I had inserted the items.\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-09-18 04:49:33.307 UTC","last_activity_date":"2017-09-20 05:13:33.627 UTC","last_edit_date":"2017-09-20 05:13:33.627 UTC","last_editor_display_name":"","last_editor_user_id":"954312","owner_display_name":"","owner_user_id":"8590206","post_type_id":"1","score":"0","tags":"javascript|html|css","view_count":"19"} +{"id":"15207998","title":"Do you need a license to develop a windows phone and blackberry application?","body":"\u003cp\u003eDo I need to pay for a license to be able to debug an application \u003cstrong\u003eon the device\u003c/strong\u003e on these 2 types of phones?\u003c/p\u003e\n\n\u003cp\u003eI only own an iOS license which someone needs to have to be able to debug on the phone and not only in the simulator.\u003c/p\u003e\n\n\u003cp\u003eWhat about Windows Phone and blackberry? And if I am able to debug/develop on the phone without a license, would I be able to test push notification, which in the end is what I want to do?\u003c/p\u003e","answer_count":"1","comment_count":"9","creation_date":"2013-03-04 18:03:42.52 UTC","last_activity_date":"2014-01-28 00:50:26.37 UTC","last_edit_date":"2014-01-28 00:50:26.37 UTC","last_editor_display_name":"","last_editor_user_id":"881229","owner_display_name":"user1498477","post_type_id":"1","score":"5","tags":"windows-phone-7|windows-phone-8|blackberry","view_count":"929"} +{"id":"44490353","title":"Using BeautifulSoup, how can I target specific items in a paragraph?","body":"\u003cp\u003eI am having some issues pulling the correct information that I need from this page: \u003ca href=\"http://www.chronicle.com/article/Major-Private-Gifts-to-Higher/128264\" rel=\"nofollow noreferrer\"\u003ehttp://www.chronicle.com/article/Major-Private-Gifts-to-Higher/128264\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eIdeally, I would like to get the names of the school and the value gifted to each school.\u003c/p\u003e\n\n\u003cp\u003eFor e.g.: \n\"\u003cstrong\u003eCalifornia Institute of Technology:\u003c/strong\u003e from Gordon and Betty Moore and the Gordon and Betty Moore Foundation, $600 million, consisting of $300 million over 5 years and $300 million over 10 years; cash and stock; 2001*\"\u003c/p\u003e\n\n\u003cp\u003eThe ideal output would be:\nCalifornia Institute of Technology, $600 million\u003c/p\u003e\n\n\u003cp\u003e(separated by comma)\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-06-12 01:46:36.42 UTC","last_activity_date":"2017-06-12 02:27:29.74 UTC","last_edit_date":"2017-06-12 02:04:47.703 UTC","last_editor_display_name":"","last_editor_user_id":"4872718","owner_display_name":"","owner_user_id":"4872718","post_type_id":"1","score":"0","tags":"python-3.x|beautifulsoup","view_count":"17"} +{"id":"35011675","title":"Extract/Refactor/Wrap assert statements into separate function","body":"\u003cp\u003eDoes it make sense to wrap assert statements into a separate function? Something like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef main1(x):\n assert 5 \u0026lt;= x \u0026lt;= 10, \"value {} not in range [{},{}]\".format(x,5,10)\n pass # do something \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003evs\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef assert_range(x,a,b):\n assert a \u0026lt;= x \u0026lt;= b, \"value {} not in range [{},{}]\".format(x,a,b)\n\ndef main2(x):\n assert_range(x,5,10)\n pass # do something \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAs far as I know assert statements are removed in optimized compilation. What will happen to my \u003ccode\u003eassert_range\u003c/code\u003e function? Will the call to the (now empty) function remain, or is that also optimized away?\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2016-01-26 10:27:07.32 UTC","last_activity_date":"2016-01-26 10:27:07.32 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"523144","post_type_id":"1","score":"0","tags":"python|assert","view_count":"35"} +{"id":"8653758","title":"Android update information from database","body":"\u003cp\u003eI'm working on Android project where I'm collecting some information from web server. Everytime the application starts I'm downloading JSON data and reenter the information in database. I have this scenario :\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eApplication starts, I'm deleting all data in sqlite database and\ninsert it again (that's needed if there are some changes in json\ndata).\u003c/li\u003e\n\u003cli\u003eWhile I'm downloading the new json user can't see any information because I've already delete it. He can see periodically when the single items are downloaded and insert in database.\u003c/li\u003e\n\u003cli\u003eAfter whole process is done and everything is downloaded and insert user can see all the new available information.\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eSo I need an idea how to do this thing: When I start downloading the data from json when app starts user must be available to see the old info. When I'm ready with all the information and everything is downloaded, the whole JSON I have to delete/update/insert the new data and everything must happen so quick that the user must don't notice that.\u003c/p\u003e\n\n\u003cp\u003eAny idea how can I do this?\u003c/p\u003e\n\n\u003cp\u003eThanks in advance!\u003c/p\u003e","accepted_answer_id":"8654095","answer_count":"2","comment_count":"0","creation_date":"2011-12-28 08:55:24.027 UTC","favorite_count":"2","last_activity_date":"2011-12-28 09:32:23.877 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"917586","post_type_id":"1","score":"0","tags":"android|json|sqlite","view_count":"535"} +{"id":"31906906","title":"Appcelerator Studio does nothing","body":"\u003cp\u003e3 issues !!!\u003c/p\u003e\n\n\u003cp\u003eSometimes, it has java.lang.NullPointerException\u003c/p\u003e\n\n\u003cp\u003eWindows 8.1 (64 bit)\njdk1.7.0_80 (32 bit)\u003c/p\u003e\n\n\u003cp\u003eStudio start. But File \u003e New \u003e Mobile App Project does nothing.\u003c/p\u003e\n\n\u003cp\u003eAndroid Studio working perfectly fine. From Appcelerator, Preferences \u003e Studio \u003e Platforms \u003e Android \u003e Android SDK Home\u003c/p\u003e\n\n\u003cp\u003ePoint to either Appcelerator SDK folder C:\\android-sdk-win or \u003c/p\u003e\n\n\u003cp\u003eAndroid SDK folder C:\\Users\\test\\dev\\Android\\sdk\u003c/p\u003e\n\n\u003cp\u003eNone of those work. Which mean, it cannot change SDK folder !!!\u003c/p\u003e","answer_count":"1","comment_count":"4","creation_date":"2015-08-09 17:28:28.157 UTC","last_activity_date":"2017-02-27 10:02:24.443 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1830489","post_type_id":"1","score":"0","tags":"appcelerator","view_count":"82"} +{"id":"7591096","title":"Zend subform view script render","body":"\u003cp\u003eI would rather not deal with decorators as my form design is not exactly straight forward, but i would like to keep the functionality of validating the forms. \u003c/p\u003e\n\n\u003cp\u003eSo i have it set up where sub forms are working correctly, but when i try to style it manually in my viewscript i get the name without the parent. I've seen other posts that are similar, but i haven't found a solution.\u003c/p\u003e\n\n\u003cp\u003eExample:\u003c/p\u003e\n\n\u003cp\u003eThis is in my view script\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003e\u0026lt;?php echo $this-\u0026gt;form-\u0026gt;username-\u0026gt;renderViewHelper();?\u0026gt;\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eI then get\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003e\u0026lt;input type=\"text\" value=\"\" id=\"username\" name=\"username\"\u0026gt;\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eWhen rendered. It should be\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003e\u0026lt;input type=\"text\" value=\"\" id=\"form1-username\" name=\"form1[username]\"\u0026gt;\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eHow do i get that form1 portion?\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003ch1\u003eEdit\u003c/h1\u003e\n\n\u003cp\u003eOk, so i found one way.\u003c/p\u003e\n\n\u003cp\u003eBy using belongTo, it works:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e $form1-\u0026gt;addElements(array(\n new Zend_Form_Element_Text('username', array(\n 'belongsTo' =\u0026gt; 'form1',\n 'required' =\u0026gt; true,\n 'label' =\u0026gt; 'Username:',\n 'filters' =\u0026gt; array('StringTrim', 'StringToLower'),\n 'validators' =\u0026gt; array(\n 'Alnum',\n array('Regex',\n false,\n array('/^[a-z][a-z0-9]{2,}$/'))\n )\n ))\n ));\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs there a better way to do this or is this the only way?\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003ch1\u003eEdit2\u003c/h1\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic function prepareSubForm($spec){\n if (is_string($spec)) {\n $subForm = $this-\u0026gt;{$spec};\n } elseif ($spec instanceof Zend_Form_SubForm) {\n $subForm = $spec;\n } else {\n throw new Exception('Invalid argument passed to ' .\n __FUNCTION__ . '()');\n }\n $this-\u0026gt;setSubFormDecorators($subForm)\n -\u0026gt;addSubmitButton($subForm)\n -\u0026gt;addSubFormActions($subForm);\n return $subForm;\n}\n\npublic function setSubFormDecorators(Zend_Form_SubForm $subForm){\n $subForm-\u0026gt;setDecorators(array(\n 'FormElements', \\\\\u0026lt;--- I tried to change this to PrepareElements before.\n array('HtmlTag', array('tag' =\u0026gt; 'dl',\n 'class' =\u0026gt; 'zend_form')),\n 'Form',\n ));\n return $this;\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"7591271","answer_count":"1","comment_count":"6","creation_date":"2011-09-29 00:11:49.523 UTC","last_activity_date":"2011-09-29 06:26:05.773 UTC","last_edit_date":"2011-09-29 00:32:09.623 UTC","last_editor_display_name":"","last_editor_user_id":"447191","owner_display_name":"","owner_user_id":"447191","post_type_id":"1","score":"4","tags":"html|forms|zend-framework","view_count":"1718"} +{"id":"31023731","title":"iOS9 multitasking in split view - notification when another app opens keyboard","body":"\u003cp\u003eMy app receives UIKeyboardDidShowNotification and related notifications when it's the focused app. But if another app is focused in the split multitasking view, it no longer receives it. I was testing this in simulator since my physical device don't support split view.\u003c/p\u003e\n\n\u003cp\u003eIs this a known simulator bug? Am I missing some configuration options? Does it work as expected on iPad Air 2?\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2015-06-24 10:08:32.627 UTC","last_activity_date":"2015-06-24 18:07:43.543 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"47124","post_type_id":"1","score":"1","tags":"ios|ipad|ios-simulator|ios9","view_count":"1061"} +{"id":"26736498","title":"Algorithm, that removes duplicates from array doesn't work","body":"\u003cp\u003eI have an char array, that has some duplicate values:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eA B C D E F E A\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd this is my algorithm to remove the duplicate values:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003echar array[20] = {'A', 'B', 'C', 'D', 'E', 'F', 'E', 'A'};\nint length = 8;\n\n for (int i = 0; i \u0026lt; length; i++)\n {\n for (int j = i + 1; j \u0026lt; length - 1; j++)\n {\n if (array[i] == array[j])\n {\n array[j] = array[j + 1];\n length--;\n }\n }\n }\n\nEXPECTED OUTPUT: A B C D E F\nOUTPUT: A B C D E F A\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have tried to run this algorithm on papers, it seems okay when I do this in writing, however it doesn't work in my application.\u003c/p\u003e","accepted_answer_id":"26739703","answer_count":"5","comment_count":"5","creation_date":"2014-11-04 13:36:11.98 UTC","last_activity_date":"2014-11-04 16:06:58.907 UTC","last_edit_date":"2014-11-04 13:51:40.72 UTC","last_editor_display_name":"","last_editor_user_id":"2037603","owner_display_name":"","owner_user_id":"2037603","post_type_id":"1","score":"1","tags":"c++|arrays|algorithm","view_count":"126"} +{"id":"27418770","title":"how to get paragraph response from search in lucene?","body":"\u003cp\u003eI've made a search component in my application with lucene. everything works fine, Indexing, highlighting ,etc. I need now to return a paragraph as my search response and not just limit the result to \"fragmentSize\" in SimpleSpanFragmenter method.there is part of my code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSimpleHTMLFormatter formatter = new SimpleHTMLFormatter(\"\u0026lt;span class='highlight'\u0026gt;\", \"\u0026lt;/span\u0026gt;\");\nQueryScorer scorer = new QueryScorer(query, NodeDocument.TEXT_FIELD);\nHighlighter highlighter = new Highlighter(formatter, scorer);\nhighlighter.setTextFragmenter(new SimpleSpanFragmenter(scorer, MAX_FRAGMENT_LEN));\nString excerpt = highlighter.getBestFragment(analyzer, Document.MESSAGE_FIELD, nForumPost.getMessage());\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis code returns \"MAX_FRAGMENT_LEN\" which I've set to 256. but its not my ideal. I want to get a paragraph which contains my search word in query.\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2014-12-11 08:53:31.963 UTC","last_activity_date":"2014-12-11 09:32:06.863 UTC","last_edit_date":"2014-12-11 09:32:06.863 UTC","last_editor_display_name":"","last_editor_user_id":"916225","owner_display_name":"","owner_user_id":"2867123","post_type_id":"1","score":"3","tags":"java|html|lucene|paragraph|lucene-highlighter","view_count":"226"} +{"id":"43000744","title":"Partial Views with different model in Asp.net MVC","body":"\u003cp\u003ei have two class as below\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eModel:- \n\n public class RegisterViewModel\n {\n public string Email { get; set; } \n public AddressPropertyVM AddressProperty { get; set; }\n }\n\n public class AddressPropertyVM\n {\n public string StreetNo { get; set; } \n }\nMain Form\n@model Application.Models.RegisterViewModel\n{\n @Html.TextBoxFor(m =\u0026gt; m.Email)\n @Html.TextBoxFor(m =\u0026gt; m.FirstName)\n\n @Html.Partial(\"_AddressPropertyPartial\",Model.AddressProperty)\n\n \u0026lt;button type=\"submit\"\u0026gt;Register\u0026lt;/button\u0026gt;\n\n}\n\nPartial View Form\n@model Application.Models.AddressPropertyVM\n{\n @Html.TextBoxFor(m =\u0026gt; m.StreetNo)\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am creating asp.net mvc application.\u003c/p\u003e\n\n\u003cp\u003eI have create a partial view for AddressPropertyVM.\u003c/p\u003e\n\n\u003cp\u003ebut we i post form(main form) at that time data of AddressProperty is null.\u003c/p\u003e","accepted_answer_id":"43001451","answer_count":"1","comment_count":"2","creation_date":"2017-03-24 13:27:00.943 UTC","last_activity_date":"2017-03-24 22:32:32.963 UTC","last_edit_date":"2017-03-24 22:32:32.963 UTC","last_editor_display_name":"","last_editor_user_id":"3559349","owner_display_name":"","owner_user_id":"4485538","post_type_id":"1","score":"1","tags":"asp.net-mvc-4|partial-views|asp.net-mvc-partialview","view_count":"868"} +{"id":"24458243","title":"Vertically align sans-serif font precisely at changing font-size","body":"\u003cp\u003eMy problem is an extension to the problem I stated already in an earlier problem, see here \u003ca href=\"https://stackoverflow.com/questions/24444495/vertically-align-sans-serif-font-precisely-using-jquery-css\"\u003eVertically align sans-serif font precisely using jquery/css\u003c/a\u003e. \u003c/p\u003e\n\n\u003cp\u003eIn a nutshell: I want to align two divs with text, one above the other, in order to always align the beginning of the A (basically the lower left point of the A) with the H (the left vertical line of the H)? An idea of what i'm trying to achieve: \u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.imgur.com/xyn5UDZ.png\" alt=\"\"\u003e\u003c/p\u003e\n\n\u003cp\u003eThe top div has a varying font-size and I want to align the lower div according to the font. The reason is that I scale my font size according to the window size.\u003c/p\u003e\n\n\u003cp\u003eA \u003ca href=\"http://jsfiddle.net/ksuTQ/6/\" rel=\"nofollow noreferrer\"\u003edemo on jfiddle \u003c/a\u003e. \u003c/p\u003e\n\n\u003cp\u003eHTML\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div id=\"Hideheader\" class=\"Header\" style=\"position: absolute;font-size:40pt;padding:0px;visibility: hidden;width:auto;height:auto;\"\u0026gt;HEADER\u0026lt;/div\u0026gt;\n\u0026lt;div id=\"header\" class=\"Header\"\u0026gt;HEADER\u0026lt;/div\u0026gt;\n\u0026lt;div id=\"menubar\" class=\"menubar\"\u0026gt;\n \u0026lt;div class=\"menubutton_left\"\u0026gt;\u0026lt;a href=\"#\" id=\"WorkButton\"\u0026gt;A\u0026lt;/a\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"menubutton_middle\"\u0026gt;\u0026lt;a href=\"#\" id=\"AboutButton\"\u0026gt;B\u0026lt;/a\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"menubutton_right\"\u0026gt;\u0026lt;a href=\"#\" id=\"ContactButton\"\u0026gt;C\u0026lt;/a\u0026gt;\n \u0026lt;/div\u0026gt; \u0026lt;span class=\"stretch\"\u0026gt;\u0026lt;/span\u0026gt;\n\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCSS\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ediv.Header {\n font-family:sans-serif;\n text-align:justify;\n white-space: nowrap;\n}\ndiv.menubar {\n text-align: justify;\n -ms-text-justify: distribute-all-lines;\n text-justify: distribute-all-lines;\n margin-bottom: 0px;\n position: relative;\n}\ndiv.menubutton_left, div.menubutton_middle, div.menubutton_right {\n vertical-align: top;\n display: inline-block;\n *display: inline;\n zoom: 1;\n width:60px;\n}\ndiv.menubutton_left {\n margin-left:12px;\n}\ndiv.menubutton_middle {\n text-align: center;\n}\ndiv.menubutton_right {\n text-align: right;\n}\n.stretch {\n border: 2px dashed #444;\n width: 100%;\n display: inline-block;\n font-size: 0;\n line-height: 0\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eJSCRIPT\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eresizeHead(\"#Hideheader\", \"#header\");\n\n$(window).resize(function() {\n resizeHead(\"#Hideheader\", \"#header\");\n});\n\nfunction resizeHead(p1, p2) {\n var fontsize = parseFloat($(p1).css(\"font-size\"));\n var spacing = parseFloat($(p1).css(\"letter-spacing\"));\n var initWidth = $(p1).width();\n initWidth = initWidth - spacing;\n var outWidth = $(p2).width();\n\n var s = outWidth / initWidth;\n s = fontsize * s;\n $(p2).css({\n \"font-size\": s\n });\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eTry resizing your browser window. I becomes especially apparent for smaller end of font sizes\u003c/p\u003e","accepted_answer_id":"24458596","answer_count":"2","comment_count":"0","creation_date":"2014-06-27 18:03:35.877 UTC","last_activity_date":"2014-06-27 20:03:42.197 UTC","last_edit_date":"2017-05-23 12:01:19.097 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"2110265","post_type_id":"1","score":"1","tags":"javascript|jquery|html|css|fonts","view_count":"219"} +{"id":"18972245","title":"Segmentation fault when using fscanf, trouble debugging after using valgrind","body":"\u003cp\u003eI've cut out the code that works so the code below is not a whole program but the problematic part.\u003c/p\u003e\n\n\u003cp\u003eI get a segmentation fault on the fscanf line below. I added the character width for each variable to try and fix it so I don't understand why it would seg fault.\u003c/p\u003e\n\n\u003cp\u003eI read from a CSV file into an array of structs.\u003c/p\u003e\n\n\u003cp\u003eMy main is just this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;stdio.h\u0026gt;\n#include \u0026lt;stdlib.h\u0026gt;\n\nmain()\n{\n menu();\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThen menu.c :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;stdio.h\u0026gt;\n#include \u0026lt;stdlib.h\u0026gt;\n#include \"DatabaseOps.h\"\n#include \"menu.h\"\n#define SIZE 1000 //max size assumed to be 1000\nvoid menu()\n{\n int j, lastID; //keeping track of id numbers used\n\n Person* persons;\n persons = (Person*)malloc(SIZE * sizeof(Person)); /*declaring array of person structs on the heap*/\n\n for(j = 0; j \u0026lt; SIZE; j++) /*initialise all IDs to -1*/\n {\n persons[j].ID = -1;\n }\n\n int option = 1;\n while (option!=7)\n {\n printf(\"1. Load Database\\n\");\n scanf(\"%d\", \u0026amp;option);\n\n switch (option)\n {\n case 1:\n printf(\"\\nLoading Database\\n\\n\");\n lastID = loadDb(persons);\n break;\n\n default:\n printf(\"Invalid choice, please try again\\n\\n\");\n break;\n }\n }\n} \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ePersons is defined in menu.h like so:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etypedef struct Person\n {\n int ID;\n int salary;\n int deleted;\n char salutation[4];\n char firstName[21];\n char surName[31];\n char job[16];\n } Person;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd then the DatabaseOps.c file that causes the error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;stdio.h\u0026gt;\n#include \u0026lt;stdlib.h\u0026gt;\n#include \u0026lt;string.h\u0026gt;\n#include \"DatabaseOps.h\"\n#include \"menu.h\"\n\nint loadDb(Person *inPersons) //function reads csv file into an array of Employee structs\n {\n int i, newID = 0; /*declaring lastID counter to keep track of the last employee ID so that I can increment it when creating a new employee*/\n\n char* fileName = malloc( 100 * sizeof( char ));\n printf(\"Enter name of CSV file: \");\n scanf(\"%99s\", fileName);\n\n FILE* f = fopen(fileName, \"r\");\n\n if(f==NULL) /*If the file doesn't exist, return to menu*/\n {\n printf(\"Error: could not open file\\n\");\n }\n\n else\n { /*the fscanf function uses grouping by commas to seperate the CSV values - [^,]*/\n while(fscanf(f, \"%d,%3[^,],%20[^,],%30[^,],%15[^,],%d,%d\", \u0026amp;inPersons[i].ID, inPersons[i].salutation, inPersons[i].firstName, inPersons[i].surName, inPersons[i].job, \u0026amp;inPersons[i].salary, \u0026amp;inPersons[i].deleted)!=EOF)\n {\n newID = inPersons[i].ID; //Keeping track of the last used ID\n i++;\n }\n }\n fclose(f);\n\n return newID;\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eValgrind gives me this error, which I'm not sure how to interpret:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e==19378== Use of uninitialised value of size 4\n==19378== at 0x405A215: _IO_vfscanf (in /lib/libc-2.12.so)\n==19378== by 0x4067368: __isoc99_fscanf (in /lib/libc-2.12.so)\n==19378== by 0x80486E5: loadDb (DatabaseOps.c:25)\n==19378== by 0x80485B5: menu (menu.c:29)\n==19378== by 0x804852E: main (main.c:6)\n==19378== \n==19378== Invalid write of size 4\n==19378== at 0x405A215: _IO_vfscanf (in /lib/libc-2.12.so)\n==19378== by 0x4067368: __isoc99_fscanf (in /lib/libc-2.12.so)\n==19378== by 0x80486E5: loadDb (DatabaseOps.c:25)\n==19378== by 0x80485B5: menu (menu.c:29)\n==19378== by 0x804852E: main (main.c:6)\n==19378== Address 0x9acac288 is not stack'd, malloc'd or (recently) free'd\n==19378== \n==19378== \n==19378== Process terminating with default action of signal 11 (SIGSEGV)\n==19378== Access not within mapped region at address 0x9ACAC288\n==19378== at 0x405A215: _IO_vfscanf (in /lib/libc-2.12.so)\n==19378== by 0x4067368: __isoc99_fscanf (in /lib/libc-2.12.so)\n==19378== by 0x80486E5: loadDb (DatabaseOps.c:25)\n==19378== by 0x80485B5: menu (menu.c:29)\n==19378== by 0x804852E: main (main.c:6)\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"18972332","answer_count":"1","comment_count":"0","creation_date":"2013-09-24 02:56:39.077 UTC","last_activity_date":"2013-09-24 03:10:32.777 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2368481","post_type_id":"1","score":"1","tags":"c|segmentation-fault|valgrind","view_count":"1655"} +{"id":"13799988","title":"Sencha Touch dynamically use of stores with mvc?","body":"\u003cp\u003eso here is the problem, I use MVC and I have several stores that I declared on app.js. \u003c/p\u003e\n\n\u003cp\u003eBut now I need to do a login validation, and only load the stores after I get the response from the server, but if leave the declaration in app.js when the app loads it automatically loads all the stores.\u003c/p\u003e\n\n\u003cp\u003eHere is what my app is going needs to do:\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eLoginView\u003c/code\u003e make the validation, if validation is successful it changes the view to \u003ccode\u003eListView\u003c/code\u003e, this view has a list that loads data from a store and this view can create other views with other lists.\u003c/p\u003e\n\n\u003cp\u003eI tried to require the stores in the \u003ccode\u003eListView\u003c/code\u003e, but it throws errors \u003ccode\u003ecannot call method getCount of null\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eWhat can I do to make it work. Thanks for the help.\u003c/p\u003e\n\n\u003cp\u003eHere is some code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eExt.define(\"App.view.Listview\", {\nextend: 'Ext.Container',\nxtype: 'listview',\n\nrequires: ['App.view.Listviewdetails',\n 'App.view.Filtros.FiltroJanelaPrincipal.Janelafiltrotiempoview',\n 'App.view.Menuview',\n 'App.view.Resultadopesquisaview',\n 'App.view.Pesquisaview',\n 'App.view.Maisinfousuarioview',\n 'Ext.Label',\n 'Ext.field.Search',\n 'App.store.Tiempos',\n 'App.store.Empresas',\n 'App.store.Produtos',\n 'App.store.Usuarios',\n 'App.store.FiltrosEvento',\n 'App.store.Historicos',\n 'App.store.Pesquisas'\n],\n\nconfig: {\n id: 'listView',\n layout: 'card',\n items: {\n layout: 'vbox',\n id: 'listaEventos',\n items: [\n {\n xtype: 'list',\n id: 'listaTiempos',\n flex: 6,\n emptyText: 'Empty',\n store: 'Tiempos',\n itemTpl: '{dataTermino} {descricaoPrevia}'\n }\n ]\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand one of the stores:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eExt.define(\"App.store.Tiempos\",{\nextend: 'Ext.data.Store',\n\nconfig: {\n model: 'App.model.Tiempo',\n autoLoad: true,\n proxy: 'searchProxy'\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e});\u003c/p\u003e","accepted_answer_id":"13800624","answer_count":"1","comment_count":"0","creation_date":"2012-12-10 11:22:45.63 UTC","last_activity_date":"2012-12-10 12:06:59.453 UTC","last_edit_date":"2012-12-10 11:33:51.77 UTC","last_editor_display_name":"","last_editor_user_id":"1553563","owner_display_name":"","owner_user_id":"1802827","post_type_id":"1","score":"0","tags":"model-view-controller|sencha-touch|data-stores","view_count":"491"} +{"id":"25122036","title":"File.read returning nil","body":"\u003cp\u003eI created a file in ruby and saved some hashes in it. When I read the file, I get nil. Here is the code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emy_hash = Hash.new\nfile = File.open(\"my_file.json\", \"w\")\n\nmy_hash[\"test_key\"] = \"0.1\"\nfile.write(my_hash.to_json)\n\nfile_read = File.read(\"my_file.json\")\np file_read // This prints nil\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I open the file, I see \u003ccode\u003e{\"test_key\":\"0.1\"}\u003c/code\u003e \u003c/p\u003e\n\n\u003cp\u003eAm I missing something here?\u003c/p\u003e","accepted_answer_id":"25122094","answer_count":"2","comment_count":"0","creation_date":"2014-08-04 15:18:23.56 UTC","last_activity_date":"2014-08-04 15:23:22.567 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"697033","post_type_id":"1","score":"2","tags":"ruby-on-rails|ruby|json|file","view_count":"543"} +{"id":"38094991","title":"can't load an array to ngTable","body":"\u003cp\u003eI tried to write a small and simple ngTable demo, but got a problem:\u003c/p\u003e\n\n\u003cp\u003eWhen I try to put an array to ngTable, the browser shows only the head line of the table, but not data. the result is in screenshot:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/TqIex.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/TqIex.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eAll the code are in \u003ca href=\"http://plnkr.co/edit/snsYWG?p=preview\" rel=\"nofollow noreferrer\"\u003eplunker\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eHere is the \"data\":\u003c/p\u003e\n\n\u003cp\u003e\u003cdiv class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\"\u003e\r\n\u003cdiv class=\"snippet-code\"\u003e\r\n\u003cpre class=\"snippet-code-js lang-js prettyprint-override\"\u003e\u003ccode\u003e var books = [\r\n {\r\n \"name\": \"Html from start to give up\",\r\n \"price\": 2,\r\n \"comment\": \"An awesome book to be a pillow\",\r\n \"available\": true\r\n },\r\n {\r\n \"name\": \"AngularJS from start to give up\",\r\n \"price\": 2,\r\n \"comment\": \"Too hard to be a pillow\",\r\n \"available\": false\r\n }];\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003c/p\u003e\n\n\u003cp\u003eand here is the way i created a ngTable\u003c/p\u003e\n\n\u003cp\u003e\u003cdiv class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\"\u003e\r\n\u003cdiv class=\"snippet-code\"\u003e\r\n\u003cpre class=\"snippet-code-js lang-js prettyprint-override\"\u003e\u003ccode\u003evm.bookTable = createTable(books);\r\n \r\nvar initpageSize = Number(localStorage.getItem('page_size') || 20);\r\n vm.pageSize = initpageSize;\r\n vm.pageSizes = [10,20,30,50,100];\r\n \r\n function createTable(data){\r\n var initParams = {\r\n sorting: {name: \"asc\"},\r\n count: vm.pageSize\r\n };\r\n var initSettings = {\r\n counts: [],\r\n paginationMaxBlocks: 13,\r\n paginationMinBlocks: 2,\r\n dataset: data\r\n };\r\n return new NgTableParams(initParams, initSettings);\r\n \r\n }\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003c/p\u003e\n\n\u003cp\u003eand here is part of the html:\u003c/p\u003e\n\n\u003cp\u003e\u003cdiv class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\"\u003e\r\n\u003cdiv class=\"snippet-code\"\u003e\r\n\u003cpre class=\"snippet-code-html lang-html prettyprint-override\"\u003e\u003ccode\u003e\u0026lt;body ng-controller=\"myController as vm\"\u0026gt;\r\n \u0026lt;div\u0026gt;\r\n \u0026lt;table ng-table= \"vm.bookTable\" \r\n class = \"table\" \r\n show-filter=\"true\"\u0026gt;\r\n \u0026lt;tr ng-repeat=\"row in $data\"\u0026gt;\r\n \u0026lt;td title = \"'name'\" filter=\"{name: 'text'}\" sortable=\"'name'\"\u0026gt;\r\n {{row.name}} \r\n \u0026lt;/td\u0026gt;\r\n \u0026lt;td title = \"'price'\" filter=\"{price: 'number'}\" sortable=\"'price'\"\u0026gt;\r\n {{row.price}}\r\n \u0026lt;/td\u0026gt;\r\n \u0026lt;td title = \"'comment'\" filter=\"{comment: 'number'}\" sortable=\"'comment'\"\u0026gt;\r\n {{row.count}}\r\n \u0026lt;/td\u0026gt;\r\n \r\n \u0026lt;/tr\u0026gt;\r\n \r\n \u0026lt;/table\u0026gt;\r\n \r\n \u0026lt;/div\u0026gt;\r\n \r\n \r\n \u0026lt;p\u0026gt;Hello {{vm.name}}!\u0026lt;/p\u0026gt;\r\n \u0026lt;/body\u0026gt;\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-06-29 09:05:58.62 UTC","favorite_count":"1","last_activity_date":"2016-06-29 09:20:41.01 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4157701","post_type_id":"1","score":"0","tags":"javascript|angularjs|ngtable","view_count":"51"} +{"id":"28193796","title":"mvc data annotation to restrict user to not allow only numeric numbers and special characters","body":"\u003cp\u003ei am trying to validate the input of a user to insert only alphanumeric characters including special characters like .,_ white space.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ePoint 1. the user cant insert only special characters like @@@@@@@ or .........\nPoint 2. or any numeric numbers like 2222222.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eit should be any valid format like. \u003ccode\u003e\"hi i am asking a question on stack overflow.this is my 11th attempt. \"\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003ei tried these expressions but its not let me restrict user like point 1 and pont 2 ,please help.\u003c/p\u003e\n\n\u003cp\u003ehere is my code\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[RegularExpression(@\"^([a-zA-Z0-9 \\.\\\u0026amp;\\'\\-]+)$\", ErrorMessage = \"Invalid User Name\")]\n public string UserName { get; set; }\n [Required]\n [StringLength(250, MinimumLength = 5, ErrorMessage = \"User Description must have minimum 5 and maximum 250 characters.\")]\n [RegularExpression(@\"^[^\u0026lt;\u0026gt;!@#%/?*]+$\", ErrorMessage = \"Invalid User Description\")]\n public string Description { get; set; }\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"28193844","answer_count":"2","comment_count":"0","creation_date":"2015-01-28 13:44:24.183 UTC","last_activity_date":"2015-01-28 13:53:43.873 UTC","last_editor_display_name":"","owner_display_name":"user3548608","post_type_id":"1","score":"1","tags":"regex|asp.net-mvc-4|data-annotations","view_count":"2579"} +{"id":"25713896","title":"jQuery event firing twice","body":"\u003cp\u003eI am using a notification plugin \u003ca href=\"http://pjdietz.com/jquery-plugins/freeow/\" rel=\"nofollow\"\u003ehttp://pjdietz.com/jquery-plugins/freeow/\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003etogether with the chosen plugin \u003ca href=\"http://harvesthq.github.io/chosen/\" rel=\"nofollow\"\u003ehttp://harvesthq.github.io/chosen/\u003c/a\u003e. When a user selects more than 1 item in a list, this fires an event to display an alert or in this case, the freeow notification. \u003c/p\u003e\n\n\u003cp\u003eThis works well up until I click the notification to close and when the notification displays again, there are 2 notifications instead of 1. \u003c/p\u003e\n\n\u003cp\u003eI think this is referred to as bubbling and would appreciate any help as I am fairly new to jQuery and need help to find a solution. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(function () {\n $(\"#box_frtv\").chosen({\n width: \"250px\",\n max_selected_options: 1\n });\n\n $(\"#box_frtv\").bind(\"chosen:maxselected\", function () {\n $(\"#boxerror\").freeow(\"error\", \"sample test message. Thank you.\", {\n classes: [\"gray\", \"error\"],\n autoHide: true\n });\n });\n});\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"25714206","answer_count":"2","comment_count":"2","creation_date":"2014-09-07 19:22:38.61 UTC","last_activity_date":"2014-09-07 20:08:54.72 UTC","last_edit_date":"2014-09-07 19:26:41.257 UTC","last_editor_display_name":"","last_editor_user_id":"1055987","owner_display_name":"","owner_user_id":"1532468","post_type_id":"1","score":"2","tags":"javascript|jquery","view_count":"155"} +{"id":"30028685","title":"vertical-align:baseline outer element strange height","body":"\u003cp\u003ehere is the html code below:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"container\"\u0026gt;\n no Text\n \u0026lt;span class=\"base\"\u0026gt;baseline align\u0026lt;/span\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ecss code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ediv {\n font-size: 20px;\n line-height: 100px;\n outline: 1px solid red;\n}\nspan {\n font-size: 40px;\n display: inline-block;\n background: wheat;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003emy question is why the height of the container element is 107px,not 110px.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003econtainerHeight = lineHeight + (spanFont - divFont)/2 = 100px + 10px = 110px\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003cp\u003eis there any wrong with my calulation?\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003ehere is the fiddle:\u003ca href=\"https://jsfiddle.net/zhouxiaoping/46wuvm3x/3/\" rel=\"nofollow\"\u003ehttps://jsfiddle.net/zhouxiaoping/46wuvm3x/3/\u003c/a\u003e\u003c/p\u003e\u003c/li\u003e\n\u003c/ul\u003e","accepted_answer_id":"30031715","answer_count":"1","comment_count":"0","creation_date":"2015-05-04 11:11:51.597 UTC","last_activity_date":"2015-05-04 13:58:22.163 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3822732","post_type_id":"1","score":"3","tags":"html|css","view_count":"48"} +{"id":"42574667","title":"What is a simple example of a working XSUB / XPUB proxy in zeromq","body":"\u003cp\u003eI have a follow-up to \u003ca href=\"https://stackoverflow.com/questions/18570810/how-to-implement-pub-sub-network-with-a-proxy-by-using-xpub-and-xsub-in-zeromqc\"\u003eHow to implement Pub-Sub Network with a Proxy by using XPUB and XSUB in ZeroMQ(C++)?\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThat question requested a C++ proxy using XSUB and XPUB. The answer given is essentially the proxy main() function quoted below.\u003c/p\u003e\n\n\u003cp\u003eI extended this proxy to a full working example including a publisher and subscriber. The catch is that my code only works with dealer / router options (as shown in comments below). With the actual (uncommented) XPUB / XSUB options below, subscribers don't get messages. What's going wrong? Is there a tweak to get messages to arrive?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eProxy\u003c/strong\u003e not working with XPUB/XSUB (working dealer / router in comments)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;zmq.hpp\u0026gt;\n\nint main(int argc, char* argv[]) {\n zmq::context_t ctx(1);\n zmq::socket_t frontend(ctx, /*ZMQ_ROUTER*/ ZMQ_XSUB);\n zmq::socket_t backend(ctx, /*ZMQ_DEALER*/ ZMQ_XPUB);\n frontend.bind(\"tcp://*:5570\");\n backend.bind(\"tcp://*:5571\");\n zmq::proxy(frontend, backend, nullptr);\n return 0;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eSubscriber\u003c/strong\u003e not working with ZMQ_SUB (working dealer / router option in comments)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;iostream\u0026gt;\n#include \u0026lt;zmq.hpp\u0026gt;\n\nstd::string GetStringFromMessage(const zmq::message_t\u0026amp; msg) {\n char* tmp = new char[msg.size()+1];\n memcpy(tmp,msg.data(),msg.size());\n tmp[msg.size()] = '\\0';\n std::string rval(tmp);\n delete[] tmp;\n return rval;\n}\n\nint main(int argc, char* argv[]) {\n zmq::context_t ctx(1);\n zmq::socket_t socket(ctx, /*ZMQ_DEALER*/ ZMQ_SUB);\n socket.connect(\"tcp://localhost:5571\");\n while (true) {\n zmq::message_t identity;\n zmq::message_t message;\n socket.recv(\u0026amp;identity);\n socket.recv(\u0026amp;message);\n std::string identityStr(GetStringFromMessage(identity));\n std::string messageStr(GetStringFromMessage(message));\n std::cout \u0026lt;\u0026lt; \"Identity: \" \u0026lt;\u0026lt; identityStr \u0026lt;\u0026lt; std::endl;\n std::cout \u0026lt;\u0026lt; \"Message: \" \u0026lt;\u0026lt; messageStr \u0026lt;\u0026lt; std::endl;\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003ePublisher\u003c/strong\u003e not working with ZMQ_PUB (working dealer / router option in comments)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;unistd.h\u0026gt;\n#include \u0026lt;sstream\u0026gt;\n#include \u0026lt;zmq.hpp\u0026gt;\n\nint main (int argc, char* argv[])\n{\n // Context\n zmq::context_t ctx(1);\n\n // Create a socket and set its identity attribute\n zmq::socket_t socket(ctx, /*ZMQ_DEALER*/ ZMQ_PUB);\n char identity[10] = {};\n sprintf(identity, \"%d\", getpid());\n socket.setsockopt(ZMQ_IDENTITY, identity, strlen(identity));\n socket.connect(\"tcp://localhost:5570\");\n\n // Send some messages\n unsigned int counter = 0;\n while (true) {\n std::ostringstream ss;\n ss \u0026lt;\u0026lt; \"Message #\" \u0026lt;\u0026lt; counter \u0026lt;\u0026lt; \" from PID \" \u0026lt;\u0026lt; getpid();\n socket.send(ss.str().c_str(),ss.str().length());\n counter++;\n sleep(1);\n }\n return 0;\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"4","creation_date":"2017-03-03 09:07:18.033 UTC","last_activity_date":"2017-03-03 09:07:18.033 UTC","last_edit_date":"2017-05-23 12:25:48.28 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"7651436","post_type_id":"1","score":"1","tags":"c++|zeromq","view_count":"400"} +{"id":"45787301","title":"Map function in react (err: TypeError: e.map is not a function)","body":"\u003cp\u003eI want to render items from props, I can do it with initial state, but not with response from server. My render function : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e const { data } = this.props;\n return (\n \u0026lt;div \u0026gt;\n {data.map((item, index) =\u0026gt;\n \u0026lt;div key={index} className=\"row\"\u0026gt;\n \u0026lt;span data = { data } className=\"number col-4 col-md-8\"\u0026gt;{item._id}\u0026lt;/span\u0026gt;\n \u0026lt;span data = { data } className=\"date col-4 col-md-2\"\u0026gt;{item.date}\u0026lt;/span\u0026gt;\n \u0026lt;span data = { data } className=\"tag col-4 col-md-2\"\u0026gt;{item.tag}\u0026lt;/span\u0026gt;\n \u0026lt;div className=\"col-md-12 \"\u0026gt;\n {item.text}\n \u0026lt;/div\u0026gt; \n \u0026lt;/div\u0026gt;\n )}\n \u0026lt;/div\u0026gt;\n )\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI get this mistake : \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eTypeError: e.map is not a function\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eresponse : Object {data: Array(12), status: 200, statusText: \"OK\", headers: Object, config: Object…}\u003c/p\u003e","answer_count":"4","comment_count":"2","creation_date":"2017-08-20 22:23:17.807 UTC","last_activity_date":"2017-08-21 04:22:31.493 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6811424","post_type_id":"1","score":"0","tags":"javascript|arrays|reactjs|object|map-function","view_count":"127"} +{"id":"10146906","title":"Placing a call to onDestroy() inside onPause(): good idea to guarantee activity destruction?","body":"\u003cp\u003eI have an activity that gets launched in singleinstance mode. It only serves a purpose when invoked, and none whatsoever afterwards.\u003c/p\u003e\n\n\u003cp\u003eNow of course I have it rigged so theoretically speaking the user can't leave the activity without terminating it. That said, I know apps that allow to bypass this sort of behaviour, such as clutchpad. \u003c/p\u003e\n\n\u003cp\u003eQuestion: if I wanted to make really, really sure my activity died upon moving away from it (ie, if it fell in the backstack), is it save/recommended to call onDestroy within onPause, or is it a bad idea.\u003c/p\u003e\n\n\u003cp\u003eIf a bad idea, then what is the correct way of achieving this?\u003c/p\u003e\n\n\u003cp\u003eThank you!\u003c/p\u003e","accepted_answer_id":"10146997","answer_count":"1","comment_count":"0","creation_date":"2012-04-13 19:11:30.163 UTC","last_activity_date":"2012-04-13 19:22:25.417 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"821423","post_type_id":"1","score":"1","tags":"android","view_count":"713"} +{"id":"18259120","title":"Rails Console Inserting Data into a Record","body":"\u003cp\u003eThis is what I did \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCustomer.all\n\n Customer Load (0.6ms) SELECT \"customers\".* FROM \"customers\"\n =\u0026gt; #\u0026lt;ActiveRecord::Relation [#\u0026lt;Customer id: 1, name: \"Judy Ngai\", created_at: \"2013-08-13 18:50:02\", updated_at: \"2013-08-13 18:50:02\", phone_number: nil\u0026gt;]\u0026gt; \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethen \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ejudy = Customer.find(1) \ninsertdata = judy.phone_number = \"1234567890\"\ninsertdata.save!\nor \ninsertdata.save\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003egives me \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eNoMethodError: undefined method `save' for \"6265607524\":String\nNoMethodError: undefined method `save!' for \"6265607524\":String\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat should I do? \u003c/p\u003e","accepted_answer_id":"18259155","answer_count":"2","comment_count":"0","creation_date":"2013-08-15 18:21:17.44 UTC","last_activity_date":"2013-08-15 18:48:24.757 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1336855","post_type_id":"1","score":"1","tags":"ruby-on-rails","view_count":"2574"} +{"id":"47051611","title":"Call OnChangeEvent Method HTML Component in Tapestry","body":"\u003cp\u003eI have html component in my Tapestry \u003ccode\u003e.tml\u003c/code\u003e\u003cbr\u003e\n\u003ccode\u003e\u0026lt;input type=\"checkbox\" id=\"myCheckbox\" ...\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eHow to create the \u003ccode\u003eonChangeEvent\u003c/code\u003e method of this component in \u003ccode\u003e.java\u003c/code\u003e\nThanks.\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-11-01 09:19:53.08 UTC","last_activity_date":"2017-11-01 09:19:53.08 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"8443113","post_type_id":"1","score":"0","tags":"tapestry","view_count":"10"} +{"id":"18125163","title":"Object insert issue in JavaScript array","body":"\u003cp\u003eI have a JavaScript array like below:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[\n {type: 'text', name: 'title', id: 'title', placeholder: 'Type here'},\n {type: 'textarea', name: 'description', id: 'description', placeholder: 'Type here'}\n]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow I want to inset \u003ccode\u003e{type: 'text', name: 'age', id: 'age', placeholder: 'Type here'}\u003c/code\u003e after first object. So my final result set will be looks like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[\n {type: 'text', name: 'title', id: 'title', placeholder: 'Type here'},\n {type: 'text', name: 'age', id: 'age', placeholder: 'Type here'}\n {type: 'textarea', name: 'description', id: 'description', placeholder: 'Type here'}\n]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want in plain JavaScript or jQuery!\u003c/p\u003e","accepted_answer_id":"18125228","answer_count":"3","comment_count":"2","creation_date":"2013-08-08 11:45:11.683 UTC","favorite_count":"1","last_activity_date":"2016-11-19 07:41:39.14 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2345960","post_type_id":"1","score":"3","tags":"javascript|jquery|arrays|insert|indexing","view_count":"270"} +{"id":"46540144","title":"Powershell XML content manipulation","body":"\u003cp\u003eI have an XML file with several entries using same keys and values handling credentials with PowerShell, constructed by \u003ccode\u003eExplort-Clixml\u003c/code\u003e. An example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;Objs Version=\"1.1.0.1\" xmlns=\"http://schemas.microsoft.com/powershell/2004/04\"\u0026gt;\n \u0026lt;Obj RefId=\"0\"\u0026gt;\n \u0026lt;TN RefId=\"0\"\u0026gt;\n \u0026lt;T\u0026gt;System.Collections.Hashtable\u0026lt;/T\u0026gt;\n \u0026lt;T\u0026gt;System.Object\u0026lt;/T\u0026gt;\n \u0026lt;/TN\u0026gt;\n \u0026lt;DCT\u0026gt;\n \u0026lt;En\u0026gt;\n \u0026lt;S N=\"Key\"\u0026gt;fabrikam\u0026lt;/S\u0026gt;\n \u0026lt;Obj N=\"Value\" RefId=\"1\"\u0026gt;\n \u0026lt;TN RefId=\"1\"\u0026gt;\n \u0026lt;T\u0026gt;System.Management.Automation.PSCredential\u0026lt;/T\u0026gt;\n \u0026lt;T\u0026gt;System.Object\u0026lt;/T\u0026gt;\n \u0026lt;/TN\u0026gt;\n \u0026lt;Props\u0026gt;\n \u0026lt;S N=\"UserName\"\u0026gt;admin@fabrikam.com\u0026lt;/S\u0026gt;\n \u0026lt;SS N=\"Password\"\u0026gt;01000000...\u0026lt;/SS\u0026gt;\n \u0026lt;/Props\u0026gt;\n \u0026lt;/Obj\u0026gt;\n \u0026lt;/En\u0026gt;\n \u0026lt;En\u0026gt;\n \u0026lt;S N=\"Key\"\u0026gt;contoso\u0026lt;/S\u0026gt;\n \u0026lt;Obj N=\"Value\" RefId=\"2\"\u0026gt;\n \u0026lt;TNRef RefId=\"1\" /\u0026gt;\n \u0026lt;Props\u0026gt;\n \u0026lt;S N=\"UserName\"\u0026gt;admin@contoso.com\u0026lt;/S\u0026gt;\n \u0026lt;SS N=\"Password\"\u0026gt;01000000...\u0026lt;/SS\u0026gt;\n \u0026lt;/Props\u0026gt;\n \u0026lt;/Obj\u0026gt;\n \u0026lt;/En\u0026gt;\n \u0026lt;En\u0026gt;\n \u0026lt;S N=\"Key\"\u0026gt;adatum\u0026lt;/S\u0026gt;\n \u0026lt;Obj N=\"Value\" RefId=\"3\"\u0026gt;\n \u0026lt;TNRef RefId=\"1\" /\u0026gt;\n \u0026lt;Props\u0026gt;\n \u0026lt;S N=\"UserName\"\u0026gt;admin@adatum.com\u0026lt;/S\u0026gt;\n \u0026lt;SS N=\"Password\"\u0026gt;01000000...\u0026lt;/SS\u0026gt;\n \u0026lt;/Props\u0026gt;\n \u0026lt;/Obj\u0026gt;\n \u0026lt;/En\u0026gt;\n \u0026lt;/DCT\u0026gt;\n \u0026lt;/Obj\u0026gt;\n\u0026lt;/Objs\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe same \u003ccode\u003eExport-Clixml\u003c/code\u003e handles adding new entries to the list (as hashtables), but I'm struggling when I'd have to modify entries I already have.\u003c/p\u003e\n\n\u003cp\u003e1) If I specify to delete an item named \u003ccode\u003econtoso\u003c/code\u003e, what is the best way to seek, select and remove everything from that \u003ccode\u003e\u0026lt;En\u0026gt;\u003c/code\u003e entirely?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$xml = [xml](Get-Content file.xml)\n$xml.SelectNodes(\"//Objs/Obj/DCT/En\")\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e... yields nothing at all, whereas\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$xml.Objs.Obj.DCT.En.s\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eworks perfect and returns the list of entries by their name. I would need to remove an entire \u003ccode\u003e\u0026lt;En\u0026gt;\u003c/code\u003e element per given value for \u003ccode\u003e\u0026lt;S N=\"Key\"\u0026gt;...\u0026lt;/S\u0026gt;\u003c/code\u003e. Trying to catch the correct entry with\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$xml.Objs.Obj.DCT.En.ChildNodes | ? { '#text' -contains 'contoso' }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ereturns nothing.\u003c/p\u003e\n\n\u003cp\u003e2) \u003ccode\u003eRefId\u003c/code\u003e value in \u003ccode\u003eObj\u003c/code\u003e is an auto incremented number. If I remove \u003ccode\u003econtoso\u003c/code\u003e between the other two entries, what would be the best way to seek and replace the value of \u003ccode\u003eRefId\u003c/code\u003e in \u003ccode\u003efabrikam\u003c/code\u003e and \u003ccode\u003eadatum\u003c/code\u003e so they're in order (1,2) again? A noteworthy point here is that \u003cem\u003eonly\u003c/em\u003e the first \u003ccode\u003e\u0026lt;En\u0026gt;\u003c/code\u003e in the list has sub-elements for \u003ccode\u003e\u0026lt;TN RefId\u0026gt;\u003c/code\u003e element, the others do not.\u003c/p\u003e","answer_count":"0","comment_count":"21","creation_date":"2017-10-03 08:21:09.477 UTC","last_activity_date":"2017-10-03 12:12:33.167 UTC","last_edit_date":"2017-10-03 12:12:33.167 UTC","last_editor_display_name":"","last_editor_user_id":"2511543","owner_display_name":"","owner_user_id":"2511543","post_type_id":"1","score":"0","tags":"regex|xml|powershell","view_count":"69"} +{"id":"20428885","title":"Selecting from p:dataTable list and show details to another p:dataTable list","body":"\u003cp\u003eI have a \u003ccode\u003etable\u003c/code\u003e showing \u003ccode\u003elist\u003c/code\u003e from a \u003ccode\u003ebean\u003c/code\u003e. When I click one of the \u003ccode\u003erows\u003c/code\u003e, I want to view details from another bean list what would I write to value to second detail \u003ccode\u003edatatable list\u003c/code\u003e ?\u003c/p\u003e\n\n\u003cp\u003eLet say I have a \u003ccode\u003ebean\u003c/code\u003e of list students \u003ccode\u003edatatable\u003c/code\u003e containing name, surname and numbers, when I click a row, on the second \u003ccode\u003edatatable\u003c/code\u003e there is a \u003ccode\u003ebean list\u003c/code\u003e of \u003ccode\u003estudent\u003c/code\u003e's \u003ccode\u003eaddress\u003c/code\u003e, \u003ccode\u003ecity\u003c/code\u003e and \u003ccode\u003ecountry\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eNow I can \u003ccode\u003eSystem.out.print\u003c/code\u003e the \u003ccode\u003eadress detail\u003c/code\u003e of \u003ccode\u003estudent\u003c/code\u003e when I click to \u003ccode\u003erow\u003c/code\u003e in student table but I can't show it on \u003ccode\u003edatatable\u003c/code\u003e \u003c/p\u003e\n\n\u003cp\u003eI'm asking how I can take the values to a \u003ccode\u003edatatable\u003c/code\u003e, what will be the value in \u003ccode\u003edatatable\u003c/code\u003e?\nThanks for your help\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" encoding=\"UTF-8\"?\u0026gt;\n\u0026lt;!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \n\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"\u0026gt;\n\u0026lt;html xmlns=\"http://www.w3.org/1999/xhtml\"\n xmlns:h=\"http://java.sun.com/jsf/html\"\n xmlns:f=\"http://java.sun.com/jsf/core\"\n xmlns:p=\"http://primefaces.org/ui\"\u0026gt;\n\u0026lt;h:head\u0026gt;\u0026lt;/h:head\u0026gt;\n\u0026lt;h:body\u0026gt;\n \u0026lt;f:view\u0026gt;\n \u0026lt;h:form id=\"form\"\u0026gt;\n \u0026lt;p:dataTable id=\"users\" var=\"user\" value=\"#{userOS.osList}\"\n paginator=\"true\" rows=\"10\" rowKey=\"#{user.kisiid}\"\n selection=\"#{userOS.selectedOS}\" selectionMode=\"single\"\u0026gt;\n \u0026lt;f:facet name=\"header\"\u0026gt; \n Kullanıcı detaylarını görmek için view butonuna tıklayınız\n \u0026lt;/f:facet\u0026gt;\n \u0026lt;p:ajax event=\"rowSelect\" listener=\"#{userOS.onRowSelect}\" update=\":form:display\"\n oncomplete=\"userDialog\" /\u0026gt;\n\n \u0026lt;p:column headerText=\"Student No\" sortBy=\"ogrencino\"\n filterBy=\"ogrencino\" id=\"ogrencino\"\u0026gt;\n \u0026lt;h:outputText value=\"#{user.ogrencino}\" /\u0026gt;\n \u0026lt;f:param name=\"kid\" value=\"#{userOS.osList.rowIndex}\" /\u0026gt;\n \u0026lt;/p:column\u0026gt;\n\n \u0026lt;p:column headerText=\"Name\" sortBy=\"ad\" filterBy=\"ad\" id=\"ad\"\u0026gt;\n \u0026lt;h:outputText value=\"#{user.ad}\" /\u0026gt;\n \u0026lt;/p:column\u0026gt;\n \u0026lt;p:column headerText=\"Surname\" sortBy=\"soyad\" filterBy=\"soyad\"\n id=\"soyad\"\u0026gt;\n \u0026lt;h:outputText value=\"#{user.soyad}\" /\u0026gt;\n \u0026lt;/p:column\u0026gt;\n \u0026lt;p:column headerText=\"Faculty\" sortBy=\"altbirim.ad\"\n filterBy=\"altbirim.ad\" id=\"altbirim\"\u0026gt;\n \u0026lt;h:outputText value=\"#{user.altbirim.ad}\" /\u0026gt;\n \u0026lt;/p:column\u0026gt;\n \u0026lt;p:column headerText=\"Department\" sortBy=\"bolum.ad\"\n filterBy=\"bolum.ad\" id=\"bolum\"\u0026gt;\n \u0026lt;h:outputText value=\"#{user.bolum.ad}\" /\u0026gt;\n \u0026lt;/p:column\u0026gt;\n \u0026lt;p:column headerText=\"Status\" sortBy=\"ogrencidurum.ad\"\n filterBy=\"ogrencidurum.ad\" id=\"ogrencidurum\"\u0026gt;\n \u0026lt;h:outputText value=\"#{user.ogrencidurum.ad}\" /\u0026gt;\n \u0026lt;/p:column\u0026gt;\n\n \u0026lt;f:facet name=\"footer\"\u0026gt;\n \u0026lt;/f:facet\u0026gt;\n \u0026lt;/p:dataTable\u0026gt;\n\n \u0026lt;p:panel id=\"dialog\" header=\"User Detail\" widgetVar=\"userDialog\"\u0026gt;\n\n \u0026lt;h:panelGrid id=\"panelgrid\" columns=\"2\" cellpadding=\"4\"\u0026gt;\n \u0026lt;p:dataTable id=\"display\" var=\"adres\" value=\"#{userOS.adresList}\"\u0026gt;\n \u0026lt;p:column headerText=\"Adres Tipi\"\u0026gt;\n \u0026lt;h:outputText value=\"#{adres.AddressType}\" /\u0026gt;\n \u0026lt;/p:column\u0026gt;\n \u0026lt;p:column headerText=\"Adres\"\u0026gt;\n \u0026lt;h:outputText value=\"#{adres.Address}\" /\u0026gt;\n \u0026lt;/p:column\u0026gt;\n \u0026lt;p:column headerText=\"İl\"\u0026gt;\n \u0026lt;h:outputText value=\"#{adres.City}\" /\u0026gt;\n \u0026lt;/p:column\u0026gt;\n \u0026lt;p:column headerText=\"Ülke\"\u0026gt;\n \u0026lt;h:outputText value=\"#{adres.Country}\" /\u0026gt;\n \u0026lt;/p:column\u0026gt;\n \u0026lt;/p:dataTable\u0026gt;\n \u0026lt;/h:panelGrid\u0026gt;\n\n \u0026lt;/p:panel\u0026gt;\n\n\n \u0026lt;/h:form\u0026gt;\n \u0026lt;/f:view\u0026gt;\n\u0026lt;/h:body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd \u003ccode\u003eKisiInfoProcess.java\u003c/code\u003e code :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epackage com.revir.process;\n\nimport java.io.Serializable;\nimport java.util.ArrayList;\nimport java.util.Collection;\nimport java.util.Iterator;\nimport java.util.List;\n\nimport javax.faces.application.FacesMessage;\nimport javax.faces.bean.ManagedBean;\nimport javax.faces.bean.SessionScoped;\nimport javax.faces.context.FacesContext;\n\nimport org.hibernate.Session;\nimport org.hibernate.Transaction;\nimport org.primefaces.event.SelectEvent;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\nimport com.revir.managed.bean.AddressBean;\nimport com.revir.managed.bean.OgrenimSureciBean;\nimport com.revir.domain.Adres;\nimport com.revir.domain.AdresDAO;\nimport com.revir.domain.Kisi;\nimport com.revir.domain.KisiDAO;\nimport com.revir.domain.Kisiadresi;\nimport com.revir.domain.Ogrenimsureci;\nimport com.revir.domain.OgrenimsureciDAO;\nimport com.revir.domain.Ulke;\nimport com.revir.process.KisiInfoProcess;\n\n@ManagedBean(name = \"userOS\")\n@SessionScoped\npublic class KisiInfoProcess implements Serializable {\n\n /**\n * \n */\n private static final long serialVersionUID = 1L;\n\n private static final Logger log = LoggerFactory\n .getLogger(KisiInfoProcess.class);\n\n private List\u0026lt;OgrenimSureciBean\u0026gt; osList;\n\n private List\u0026lt;AddressBean\u0026gt; adresList;\n\n private List\u0026lt;AddressBean\u0026gt; adresListesi;\n\n public List\u0026lt;AddressBean\u0026gt; getAdresListesi() {\n return adresListesi;\n }\n\n public void setAdresListesi(List\u0026lt;AddressBean\u0026gt; adresListesi) {\n this.adresListesi = adresListesi;\n }\n\n private OgrenimSureciBean selectedOS;\n\n private AddressBean selectedAdres;\n\n public OgrenimSureciBean getSelectedOS() {\n return selectedOS;\n }\n\n public void setSelectedOS(OgrenimSureciBean selectedOS) {\n this.selectedOS = selectedOS;\n }\n\n public AddressBean getSelectedAdres() {\n return selectedAdres;\n }\n\n public void setSelectedAdres(AddressBean selectedAdres) {\n this.selectedAdres = selectedAdres;\n }\n\n public List\u0026lt;OgrenimSureciBean\u0026gt; getOsList() {\n OgrenimsureciDAO ogrenimsureciDAO = new OgrenimsureciDAO();\n\n List\u0026lt;OgrenimSureciBean\u0026gt; osList = new ArrayList\u0026lt;OgrenimSureciBean\u0026gt;();\n\n for (Iterator i = ogrenimsureciDAO.findByMezunOgrenciler((short) 8)\n .iterator(); i.hasNext();) {\n Ogrenimsureci og = (Ogrenimsureci) i.next();\n OgrenimSureciBean osBean = new OgrenimSureciBean();\n\n osBean.setBolum(og.getBolum());\n osBean.setAd(og.getKisiByKisiid().getAd());\n osBean.setSoyad(og.getKisiByKisiid().getSoyad());\n osBean.setAltbirim(og.getAltbirim());\n osBean.setOgrencino(og.getOgrencino());\n osBean.setKisiid(og.getKisiByKisiid().getKisiid());\n osBean.setOgrencidurum(og.getOgrencidurum());\n\n osList.add(osBean);\n System.out.println(\"osBean : \" + osBean.toString());\n\n }\n return osList;\n }\n\n public void setOsList(List\u0026lt;OgrenimSureciBean\u0026gt; osList) {\n this.osList = osList;\n }\n\n public void onRowSelect(SelectEvent event) {\n\n System.out.println(\"On Row Select Metodu çalıştı\");\n\n try {\n getAdresList();\n } catch (Exception e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n\n }\n\n public List\u0026lt;AddressBean\u0026gt; getAdresList() throws Exception {\n\n if (getSelectedOS() != null) {\n log.debug(\"PersonalInfoProcess - getAddressInfo - Start\");\n List\u0026lt;AddressBean\u0026gt; adresList = new ArrayList\u0026lt;AddressBean\u0026gt;();\n\n KisiDAO kisiDAO = new KisiDAO();\n AdresDAO adresDAO = new AdresDAO();\n\n Long kisiid = getSelectedOS().getKisiid();\n System.out.println(\"kisiid :\" + kisiid);\n Kisi kisi = kisiDAO.findById(kisiid);\n\n for (Iterator i = kisi.getKisiadresis().iterator(); i.hasNext();) {\n\n Kisiadresi kisiAdresi = (Kisiadresi) i.next();\n System.out.println(\"i :\" + i);\n Adres tmpAdres = adresDAO.findById(kisiAdresi.getId()\n .getAdresid());\n\n if (tmpAdres != null) {\n AddressBean address = new AddressBean(kisiid);\n\n if (tmpAdres.getAdresturu() == null) {\n address.setAddressType(null);\n } else {\n address.setAddressType(tmpAdres.getAdresturu().getAd());\n System.out.println(\"Adres Türü:\" +tmpAdres.getAdresturu().getAd());\n }\n\n address.setAddress(tmpAdres.getAdres());\n System.out.println(\"Şehir:\" +tmpAdres.getAdres());\n\n if (tmpAdres.getIl() == null) {\n address.setCity(null);\n } else {\n address.setCity(tmpAdres.getIl().getAd());\n System.out.println(\"Şehir:\" +tmpAdres.getIl().getAd());\n }\n\n if (tmpAdres.getUlke() == null) {\n address.setCountry(null);\n } else {\n address.setCountry(tmpAdres.getUlke().getAd());\n System.out.println(\"Ülke:\" +tmpAdres.getUlke().getAd());\n }\n\n adresList.add(address);\n\n System.out.println(\"adres\" + address);\n System.out.println(\"adreslist\" + adresList);\n }\n\n log.debug(\"PersonalInfoProcess - getAddressInfo - End / Returning\");\n }\n }\n return adresList;\n }\n\n public void setAdresList(List\u0026lt;AddressBean\u0026gt; adresList) {\n this.adresList = adresList;\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"3","creation_date":"2013-12-06 16:30:57.407 UTC","last_activity_date":"2016-10-26 10:05:21.777 UTC","last_edit_date":"2016-10-26 10:05:21.777 UTC","last_editor_display_name":"","last_editor_user_id":"4478047","owner_display_name":"","owner_user_id":"3070277","post_type_id":"1","score":"1","tags":"jsf|jsf-2|primefaces","view_count":"724"} +{"id":"38386109","title":"How to expand to Labels having height in ratio 2:1?","body":"\u003cp\u003eI'm new to xcode storyboard. I have a viewcontroller that contain two label of same width, but \u003ccode\u003elabel 1\u003c/code\u003e is 80px in height and \u003ccode\u003elabel 2\u003c/code\u003e is 40px in height. \u003c/p\u003e\n\n\u003cp\u003eI want those two labels to auto expand in height depending on whether they are displayed in horizontal or vertical size class, but I want \u003ccode\u003elabel 1\u003c/code\u003e and \u003ccode\u003elabel 2\u003c/code\u003e to keep their height ratio of \u003ccode\u003e2:1\u003c/code\u003e. \u003c/p\u003e\n\n\u003cp\u003eI know the steps to take if I wan't both labels to be the same height (control drag from one label to another, click equal height, and go to size inspector and set their content hugging priority to 200) , but I don't know the steps to take when I want the labels' height ratio to be \u003ccode\u003e2:1\u003c/code\u003e and to auto expand in height depending on whether it is displayed horizontally or vertically.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/vUuC3.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/vUuC3.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI want the two labels to expand, not the numbers below the labels\u003c/p\u003e","accepted_answer_id":"38387114","answer_count":"3","comment_count":"6","creation_date":"2016-07-15 00:21:46.04 UTC","last_activity_date":"2016-12-19 10:21:38.05 UTC","last_edit_date":"2016-12-19 10:21:38.05 UTC","last_editor_display_name":"","last_editor_user_id":"2227743","owner_display_name":"","owner_user_id":"5581182","post_type_id":"1","score":"1","tags":"ios|xcode|storyboard|uilabel","view_count":"82"} +{"id":"33663801","title":"How do I customize default error message from spring @Valid validation?","body":"\u003cp\u003eDTO:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class User {\n\n @NotNull\n private String name;\n\n @NotNull\n private String password;\n\n //..\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eController:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@RequestMapping(value = \"/user\", method = RequestMethod.POST)\npublic ResponseEntity\u0026lt;String\u0026gt; saveUser(@Valid @RequestBody User user) {\n //..\n return new ResponseEntity\u0026lt;\u0026gt;(HttpStatus.OK);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eDefault json error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\"timestamp\":1417379464584,\"status\":400,\"error\":\"Bad Request\",\"exception\":\"org.springframework.web.bind.MethodArgumentNotValidException\",\"message\":\"Validation failed for argument at index 0 in method: public org.springframework.http.ResponseEntity\u0026lt;demo.User\u0026gt; demo.UserController.saveUser(demo.User), with 2 error(s): [Field error in object 'user' on field 'name': rejected value [null]; codes [NotNull.user.name,NotNull.name,NotNull.java.lang.String,NotNull]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [user.name,name]; arguments []; default message [name]]; default message [may not be null]],\"path\":\"/user\"}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI would like to have my custom json for each error occured. How do I accomplish that?\u003c/p\u003e","accepted_answer_id":"33664636","answer_count":"4","comment_count":"0","creation_date":"2015-11-12 03:15:01.167 UTC","favorite_count":"5","last_activity_date":"2017-04-06 16:25:11.81 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5470370","post_type_id":"1","score":"10","tags":"json|spring","view_count":"10444"} +{"id":"42739440","title":"@PostConstruct not called in my jsf page","body":"\u003cp\u003eI have seen many questions around the same topic but none of them helped. In fact I am beginning learning primefaces.\u003c/p\u003e\n\n\u003cp\u003eHere is my \u003cstrong\u003exhtml\u003c/strong\u003e page (template):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version='1.0' encoding='UTF-8' ?\u0026gt;\n\u0026lt;!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"\u0026gt;\n\u0026lt;html xmlns=\"http://www.w3.org/1999/xhtml\"\n xmlns:ui=\"http://xmlns.jcp.org/jsf/facelets\"\n xmlns:h=\"http://xmlns.jcp.org/jsf/html\"\n xmlns:p=\"http://primefaces.org/ui\"\n xmlns:f=\"http://xmlns.jcp.org/jsf/core\"\u0026gt;\n \u0026lt;f:view contentType=\"text/html\" locale=\"en\"\u0026gt;\n \u0026lt;h:head\u0026gt;\n \u0026lt;title\u0026gt;\u0026lt;ui:insert name=\"title\"\u0026gt;Master Data\u0026lt;/ui:insert\u0026gt;\u0026lt;/title\u0026gt;\n \u0026lt;h:outputStylesheet library=\"css\" name=\"layout.css\"/\u0026gt;\n \u0026lt;h:outputStylesheet library=\"css\" name=\"jsfcrud.css\"/\u0026gt;\n \u0026lt;h:outputScript library=\"js\" name=\"jsfcrud.js\"/\u0026gt;\n \u0026lt;/h:head\u0026gt;\n \u0026lt;h:body\u0026gt;\n \u0026lt;p:growl id=\"growl\" life=\"3000\" /\u0026gt;\n \u0026lt;h:panelGroup layout=\"block\" styleClass=\"slogan\"\u0026gt;\n \u0026lt;h:outputText value=\"Master Data Web module for single line v 1.0\"/\u0026gt;\n \u0026lt;/h:panelGroup\u0026gt;\n \u0026lt;h:form id=\"mainForm\" prependId=\"false\"\u0026gt;\n \u0026lt;h:panelGrid columns=\"2\" columnClasses=\"chaptersMenuColumn,chaptersContentColumn\"\u0026gt;\n\n \u0026lt;h:form\u0026gt;\n \u0026lt;f:ajax render=\":content\"\u0026gt;\n \u0026lt;p:menu\u0026gt;\n \u0026lt;p:submenu label=\"Master Data Sections\"\u0026gt;\n \u0026lt;p:menuitem value=\"KPI\" action=\"#{KpiBean.setPage('create')}\" /\u0026gt;\n \u0026lt;p:menuitem value=\"Queues\" url=\"\"/\u0026gt;\n \u0026lt;p:menuitem value=\"Causes\" url=\"\"/\u0026gt;\n \u0026lt;p:menuitem value=\"SubCauses\" url=\"\"/\u0026gt;\n \u0026lt;/p:submenu\u0026gt;\n \u0026lt;/p:menu\u0026gt; \n \u0026lt;/f:ajax\u0026gt;\n \u0026lt;/h:form\u0026gt;\n\n \u0026lt;h:panelGroup id=\"content\" layout=\"block\"\u0026gt;\n \u0026lt;ui:include src = \"../views/#{KpiBean.page}.xhtml\"/\u0026gt;\n \u0026lt;/h:panelGroup\u0026gt;\n \u0026lt;/h:panelGrid\u0026gt;\n \u0026lt;/h:form\u0026gt;\n \u0026lt;/h:body\u0026gt;\n \u0026lt;/f:view\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd here my Bean:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@Named\n@SessionScoped\npublic class KpiBean implements Serializable {\n\n private String page= \"View\";\n\n @PostConstruct\n public void init() {\n page = \"View\"; // Default include.\n }\n\n public String getPage() {\n return page;\n }\n\n public void setPage(String page) {\n this.page = page;\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I launch my Glassfish server and deploy the build I get that error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ejavax.faces.view.facelets.TagAttributeException: /templates/template.xhtml @47,78 \u0026lt;ui:include src=\"../views/#{KpiBean.page}.xhtml\"\u0026gt; Invalid path : ../views/.xhtml\n\n at com.sun.faces.facelets.tag.ui.IncludeHandler.apply(IncludeHandler.java:129)\n\n at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"42739497","answer_count":"1","comment_count":"0","creation_date":"2017-03-11 19:13:34.52 UTC","last_activity_date":"2017-03-11 19:19:23.04 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1807373","post_type_id":"1","score":"-2","tags":"java|jsf|primefaces|jsf-2","view_count":"220"} +{"id":"35312030","title":"Undefined property in an \"hasOne\" relation","body":"\u003cp\u003eI tried a lot of possibilities and I have all the time the same error.\u003c/p\u003e\n\n\u003cp\u003eMaybe you should help me... Hope so! I am working on Laravel 4.2\u003c/p\u003e\n\n\u003cp\u003eI have two tables :\u003c/p\u003e\n\n\u003cp\u003eusers :\u003c/p\u003e\n\n\u003cp\u003e$table-\u003eincrements('id');\n $table-\u003estring('email', 50);\n...\u003c/p\u003e\n\n\u003cp\u003eaccount :\u003c/p\u003e\n\n\u003cp\u003e$table-\u003eincrements('id');\n $table-\u003einteger('user_id')-\u003eunsigned();\u003c/p\u003e\n\n\u003cp\u003eI have 2 models :\u003c/p\u003e\n\n\u003cp\u003eUser :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic function account()\n {\n return $this-\u0026gt;hasOne('Account', 'id','user_id');\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAccount :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic function user()\n {\n return $this-\u0026gt;belongsTo('User', 'id');\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow I would like to get the user_id in the account table by the relationship :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$userId = Auth::id();\n$account = User::find($userId)-\u0026gt;Account()-\u0026gt;user_id;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI get this error : ErrorException\nUndefined property: Illuminate\\Database\\Eloquent\\Relations\\HasOne::$user_id\u003c/p\u003e\n\n\u003cp\u003eCould you help me?\u003c/p\u003e\n\n\u003cp\u003eThank you in advance.\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2016-02-10 10:02:37.513 UTC","last_activity_date":"2017-01-11 21:04:56.057 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4266404","post_type_id":"1","score":"0","tags":"laravel-4|eloquent|one-to-one","view_count":"984"} +{"id":"43122509","title":"Applying JsonDictionary attribute to dictionary","body":"\u003cp\u003eIf I try to add the JsonDictionary attribute to a .net Dictionary(Of Integer, MyClass), the compiler tells me, that the attribute could not be applied. Why is this?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;JsonDictionary()\u0026gt;\nPublic ReadOnly Property monatswerte As Dictionary(Of Integer, MyClass)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI basically couldn't find any examples of how to use the JsonDictionary online.\u003c/p\u003e","answer_count":"2","comment_count":"2","creation_date":"2017-03-30 15:45:21.483 UTC","last_activity_date":"2017-10-15 16:31:16.667 UTC","last_edit_date":"2017-03-30 18:36:26.767 UTC","last_editor_display_name":"","last_editor_user_id":"3744182","owner_display_name":"","owner_user_id":"3254598","post_type_id":"1","score":"1","tags":"c#|.net|vb.net|json.net","view_count":"162"} +{"id":"41965355","title":"VSCode debugging of Electron Main Process bundled with Webpack 2","body":"\u003cp\u003eMy Electron main process is written with TypeScript and bundled Webpack 2.\u003c/p\u003e\n\n\u003cp\u003eTranspilation is done through \u003ccode\u003ets-loader\u003c/code\u003e and \u003ccode\u003ebabel-loader\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eDevelopment mode starts \u003ccode\u003ewebpack --watch\u003c/code\u003e with the \u003ca href=\"https://github.com/Black-Monolith/SuperNova/blob/f65db6384a18245273b13b4041a8c2f2ab5c8aac/webpack/targets/webpack.main.js\" rel=\"nofollow noreferrer\"\u003emain process configuration\u003c/a\u003e.\u003c/p\u003e\n\n\u003ch1\u003eProblem\u003c/h1\u003e\n\n\u003cp\u003eI cannot debug the main process using VSCode debugger.\u003c/p\u003e\n\n\u003cp\u003eAdding a breakpoint in the entry point \u003ccode\u003esrc/main/index.ts\u003c/code\u003e does not have any effect.\u003c/p\u003e\n\n\u003ch1\u003eConfiguration\u003c/h1\u003e\n\n\u003ch3\u003e\u003ca href=\"https://github.com/Black-Monolith/SuperNova/blob/f65db6384a18245273b13b4041a8c2f2ab5c8aac/.vscode/launch.json\" rel=\"nofollow noreferrer\"\u003e\u003ccode\u003e.vscode/launch.js\u003c/code\u003e\u003c/a\u003e\u003c/h3\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n \"configurations\": [\n {\n \"name\": \"Debug Main Process\",\n \"type\": \"node\",\n \"request\": \"launch\",\n \"cwd\": \"${workspaceRoot}\",\n \"runtimeExecutable\": \"${workspaceRoot}/node_modules/.bin/electron\",\n \"runtimeArgs\": [\n \"${workspaceRoot}\",\n \"--remote-debugging-port=9222\"\n ],\n \"sourceMaps\": true\n }\n ]\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003ch3\u003e\u003ca href=\"https://github.com/Black-Monolith/SuperNova/blob/f65db6384a18245273b13b4041a8c2f2ab5c8aac/webpack/targets/webpack.main.js\" rel=\"nofollow noreferrer\"\u003e\u003ccode\u003ewebpack.development.js\u003c/code\u003e\u003c/a\u003e\u003c/h3\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n target: 'electron',\n devtool: 'source-map',\n\n entry: {\n main: join(__dirname, 'src/main/index')\n },\n\n output: {\n path: join(__dirname, 'app'),\n filename: '[name].js'\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"41969144","answer_count":"2","comment_count":"0","creation_date":"2017-01-31 18:53:53.863 UTC","last_activity_date":"2017-02-01 12:37:23.303 UTC","last_edit_date":"2017-02-01 12:37:23.303 UTC","last_editor_display_name":"","last_editor_user_id":"1914206","owner_display_name":"","owner_user_id":"1914206","post_type_id":"1","score":"2","tags":"debugging|typescript|webpack|visual-studio-code|electron","view_count":"503"} +{"id":"30910780","title":"HTML/CSS need disable margin","body":"\u003cp\u003eI spent almost half hour by searching where to disable margin for submenu. Here is an examples. \n\u003cimg src=\"https://i.stack.imgur.com/YCq6d.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eI did margin for menu links, and submenu have been affected too. BUT i dont need that. SO i cant find where to change submenu margin to be zero. You can find website in\u003c/p\u003e","accepted_answer_id":"30910827","answer_count":"5","comment_count":"1","creation_date":"2015-06-18 08:55:55.287 UTC","last_activity_date":"2015-06-18 09:14:22.023 UTC","last_edit_date":"2015-06-18 09:11:23.83 UTC","last_editor_display_name":"","last_editor_user_id":"4825782","owner_display_name":"","owner_user_id":"4825782","post_type_id":"1","score":"0","tags":"html|css","view_count":"38"} +{"id":"13441918","title":"Can one class implement both subject and observer sections of the observer design pattern?","body":"\u003cp\u003eI'm designing an enemy framework for java and working with observer. I'm wondering if it is possible | worth the effort to have one class implement both observer and subject in java?\u003c/p\u003e\n\n\u003cp\u003eI want to have an enemy interface which implements both subject and observer so that the enemies within a certain distance of each other can alert each other if a player or enemy is sighted.\u003c/p\u003e\n\n\u003cp\u003eIs there a better pattern to use here? \u003c/p\u003e","accepted_answer_id":"13442142","answer_count":"1","comment_count":"0","creation_date":"2012-11-18 16:15:59.743 UTC","favorite_count":"0","last_activity_date":"2012-11-18 16:43:16.337 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1336484","post_type_id":"1","score":"1","tags":"java|observer-pattern","view_count":"638"} +{"id":"25719468","title":"Retrieve group of varbinary images in MVC","body":"\u003cp\u003eI have images stored in a \u003ccode\u003evarbinary\u003c/code\u003e column in my database in ASP.NET MVC. I tried to retrieve them using a foreach loop. \u003c/p\u003e\n\n\u003cp\u003eI have written content in controller like this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e {\n db = new VideoContext();\n ViewData[\"VideoMenu\"] = db.VideosMaster.ToList();\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand try to display it in view like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eforeach (var v in (IEnumerable\u0026lt;VideoJug.Models.VideosMaster\u0026gt;)ViewData[\"VideoMenu\"])\n{\n \u0026lt;img src=\"@String.Format(\"data:image/jpg;base64,{0}\", \n Convert.ToBase64String(v.VideoThumbnail));\" width=\"100\" height=\"100\" /\u0026gt;\n} \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut I'm getting an error:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eValue cannot be null.Parameter name: inArray\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eCould anyone help me with this?\u003c/p\u003e","accepted_answer_id":"25721183","answer_count":"1","comment_count":"0","creation_date":"2014-09-08 07:40:45.077 UTC","favorite_count":"0","last_activity_date":"2014-09-08 09:33:22.457 UTC","last_edit_date":"2014-09-08 07:56:41.11 UTC","last_editor_display_name":"","last_editor_user_id":"13302","owner_display_name":"","owner_user_id":"4018304","post_type_id":"1","score":"0","tags":"asp.net-mvc|model-view-controller|binary","view_count":"623"} +{"id":"37599629","title":"I want to create C# Web App which can create excel report from different SQL database only in one click.is there any good suggestion?","body":"\u003cp\u003eI want to create C# Web App which can create excel report from different SQL database only in one click.is there any good suggestion? \u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-06-02 18:32:19.903 UTC","last_activity_date":"2016-06-03 05:34:09.293 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6273732","post_type_id":"1","score":"0","tags":"c#|sql|asp.net|asp.net-mvc|web","view_count":"53"} +{"id":"44944192","title":"m2e Embedded Runtime: Global Settings File read from wrong location","body":"\u003cp\u003eIn Eclipse, I have configured a global settings file under \u003ccode\u003ePreferences \u0026gt; Maven \u0026gt; User Settings \u0026gt; Global Settings\u003c/code\u003e. This file contains a mirror configuration for repositories.\u003c/p\u003e\n\n\u003cp\u003eWhen Eclipse attempts to download dependencies, the settings in this file are used. When starting a maven build via \u003ccode\u003eRun As \u0026gt; Maven build\u003c/code\u003e, dependency resolution errors occur. When starting a Maven runtime outside from Eclipse, everything works as expected.\u003c/p\u003e\n\n\u003cp\u003eI enabled debug output and found the following line when starting a Maven build inside eclipse.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[DEBUG] Reading global settings from EMBEDDED\\conf\\settings.xml\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eWhy is the configured global config file not used when starting a build in Eclipse?\u003c/strong\u003e What confuses me especially is Eclipse does use these settings when downloading dependencies in the workspace.\u003c/p\u003e\n\n\u003cp\u003eInterestingly, a configured user settings file \u003cem\u003eis\u003c/em\u003e used when starting a build from within Eclipse. \u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-07-06 08:56:56.207 UTC","last_activity_date":"2017-07-06 08:56:56.207 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7677308","post_type_id":"1","score":"1","tags":"eclipse|maven|m2e","view_count":"57"} +{"id":"12707902","title":"Having trouble converting from string to LPCTSTR","body":"\u003cp\u003eI am trying to put some text in a Static Text widget, like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003em_StartupTime.SetWindowText(someStringVariable);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd get an error:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e'CWnd::SetWindowTextA' : cannot convert parameter 1 from 'std::string' to 'LPCTSTR'\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI have tried using the \u003ccode\u003ec.str()\u003c/code\u003e method, but when I do, the program compiles fine, but crashes at run-time, throwing an error:\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/dnQVG.jpg\" alt=\"The error\"\u003e\u003c/p\u003e\n\n\u003cp\u003eSo I'm figuring out if the problem is related to the conversion, or anything other than that?\u003c/p\u003e\n\n\u003cp\u003eUsing CString doesn't solve the problem, and I have tried switching from Unicode charcter set to Multi-Byte, with no success. Oh, I am developing in MFC.\u003c/p\u003e\n\n\u003cp\u003eEDIT: Found a solution! I used the CString class.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003estring a = \"smth\";\nCString str(a.c_str());\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"12710669","answer_count":"2","comment_count":"5","creation_date":"2012-10-03 11:51:46.367 UTC","last_activity_date":"2012-10-21 11:36:55.337 UTC","last_edit_date":"2012-10-21 11:36:55.337 UTC","last_editor_display_name":"","last_editor_user_id":"904365","owner_display_name":"","owner_user_id":"1258091","post_type_id":"1","score":"0","tags":"c++|string|mfc","view_count":"1924"} +{"id":"20693212","title":"why wont this program terminate?","body":"\u003cp\u003eI am trying to teach myself python and have no experience write code. For my first attempt I am trying to write a program that applies the snowball principle to debt reduction, but also adds in an extra set amount each payment. I can get the first debt to clear(it goes to a negative but it exits the loop). My second step wont exit the loop and I have looked at topics that dealt with nested loops but they did not help. Could someone please show me where I went wrong? \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#Temp fixed number for testing use rawinput for actual program.\n\n#name the debt\ndebt1 = \"CC A\"\n#currnet balnace\nbalance1 = float(5000)\n#APR\nannualInterestRate1 = float(.1499)\n#Currnet Monthly Payment\nminMonthlyPayment1 = float(200)\n# Exta Payment\nboosterPayment = float(337)\n\nprint \"The balance on \",debt1,\" is \",balance1\n\ndebt2 = \"CC B\"\nbalance2 = float(1000)\nannualInterestRate2 = float(.1499)\nminMonthlyPayment2 = float(200)\n\nprint \"The balance on \",debt2,\" is \",balance2\n\ndebt3 = \"ICCU\"\nbalance3 = float(6000)\nannualInterestRate3 = float(.0879)\nminMonthlyPayment3 = float(130)\n\nprint \"The balance on \",debt3,\" is \",balance3\n\ndebt4 = \"Car\"\nbalance4 = float(8000)\nannualInterestRate4 = float(.0699)\nminMonthlyPayment4 = float(200)\n\nprint \"The balance on \",debt4,\" is \",balance4\n\ndebt5 = \"Truck\"\nbalance5 = float(15000)\nannualInterestRate5 = float(.0439)\nminMonthlyPayment5 = float(333)\n\n#nubmer of payments made durning the debt reduction. Used as the index.\nnumPay = 0\nsave = 0\n\n#For Debt1 with an APR greater then 0\nintPayment1 = round(balance1*(annualInterestRate1/12),2)\n\nwhile balance1 \u0026gt;= 0:\n #payment with intrest\n payment1 = minMonthlyPayment1 - intPayment1 + boosterPayment\n #subtact payment from balance\n balance1 -= payment1\n #count Number of payments\n numPay += 1\nprint numPay\nprint balance1\n\n#For Debt2 with an APR greater then 0\n\n#Figures monthly charge based on given APR\nintPayment2 = round(balance2*(annualInterestRate2/12),2)\n#Monthly payment minus intrest\nstandPay2 = minMonthlyPayment2 - intPayment2\n\nwhile balance2 \u0026gt;= 0:\n #payment while debt1 is being paid\n\n #need a way to pay the payments while the other debt is being figured\n backPay = numPay\n while backPay \u0026gt;= 0:\n balance2 -= standPay2\n backPay += 1\n #payment with intrest takes 100 away for savings\n payment2 = minMonthlyPayment2 - intPayment2 + (boosterPayment-100)\n #subtact payment from balance\n balance2 -= payment2\n #count Number of payments\n numPay += 1\n #keep track of how much is going to savings\n save += 100\nprint numPay\nprint balance1\nprint save\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"20693310","answer_count":"1","comment_count":"3","creation_date":"2013-12-19 22:48:41.54 UTC","last_activity_date":"2013-12-19 22:55:20.493 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3120881","post_type_id":"1","score":"0","tags":"python|loops|while-loop|terminate","view_count":"70"} +{"id":"16386590","title":"OpenCSV Get Value from last row and specific column","body":"\u003cp\u003eI am trying to get the values from the second last row and third column in a semicolon separated file. I can't seat to get the values from the second last row and the third column. \u003c/p\u003e\n\n\u003cp\u003eI have searched for a method to achieve this but it has been fruitless. I would greatly appreciate if someone could point me in the right direction with an example.\u003c/p\u003e\n\n\u003cp\u003eThis is the code I have so far:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate static void readmyfile() throws IOException {\n\n String csvFilename = \"C:/test.csv\";\n\n CSVReader reader = new CSVReader(new FileReader(csvFilename),';', '\\'', 1);\n String[] nextLine;\n\n int rowNumber=-1;\n\n nextLine=reader.readNext();\n while (nextLine!=null){\n rowNumber++;\n\n String speed = nextLine[rowNumber];\n System.out.println(speed);\n nextLine=reader.readNext();\n\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy file is formatted like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eNumber; ID; NUM; Counter; Time\n1;CCF;9999;1;18:07:05\n1;CC8;8888;1;18:07:15\n1;CC1;8888;1;18:07:15\n1;DC7;1111;1;18:07:15\nDate:;01/01/2000; Read:;5; on:;01.05; off:;02.04\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"16386693","answer_count":"1","comment_count":"0","creation_date":"2013-05-05 16:22:57.043 UTC","last_activity_date":"2013-05-06 00:12:52.653 UTC","last_edit_date":"2013-05-05 16:45:15.24 UTC","last_editor_display_name":"","last_editor_user_id":"1677125","owner_display_name":"","owner_user_id":"2352274","post_type_id":"1","score":"0","tags":"java|row|semicolon|opencsv","view_count":"3075"} +{"id":"46113256","title":"jquery validator - required fields not working?","body":"\u003cp\u003eThis is my code:\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eHTML\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;form class=\"myForm\" method=\"post\" action=\"/\" \u0026gt;\n \u0026lt;input type=\"text\" name=\"number\" class=\"form-control\"\u0026gt;\n \u0026lt;input type=\"text\" name=\"amount\" class=\"form-control send\"\u0026gt;\n \u0026lt;input type=\"text\" name=\"operator\" class=\"form-control send\"\u0026gt;\n \u0026lt;input type=\"submit\" value=\"Submit\" /\u0026gt;\n\u0026lt;/form\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eJquery validator:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(document).ready(function () {\n$(\"#myForm\").validate({\n debug: true,\n groups: { // consolidate messages into one\n names: \"amount operator\"\n },\n rules: {\n number:\"required\",\n amount: {\n require_from_group: [1, \".send\"]\n },\n operator: {\n require_from_group: [1, \".send\"]\n }\n\n },\n messages: {\n number: \"required.\"\n\n }\n\n });\n jQuery.extend(jQuery.validator.messages, {\n require_from_group: jQuery.format(\"amount or bundle should be filled\")\n });\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eproblem\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eHere \u003cstrong\u003enumber required\u003c/strong\u003e is not working after groups is added.\n\u003cstrong\u003eif groups removed its working.\u003c/strong\u003e\u003c/p\u003e","accepted_answer_id":"46118857","answer_count":"2","comment_count":"1","creation_date":"2017-09-08 09:34:48.077 UTC","last_activity_date":"2017-09-08 20:29:47.64 UTC","last_edit_date":"2017-09-08 14:33:30.887 UTC","last_editor_display_name":"","last_editor_user_id":"594235","owner_display_name":"","owner_user_id":"6310042","post_type_id":"1","score":"0","tags":"jquery|jquery-validate","view_count":"112"} +{"id":"44308208","title":"BsonSerializer.Deserialize\u003cT\u003e(bsonDocument) - Id field of child object causes exception","body":"\u003cp\u003eI have a class A and a class B and C\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class A \n{ \n public string Id {get;set;}\n public List\u0026lt;B\u0026gt; Children {get;set;}\n}\npublic class B\n{\n public string Id {get;set;}\n public string Foo {get;set;}\n public double Bar {get;set;}\n}\npublic class C \n{\n public string Id {get;set;}\n //This property will hold a serialized version of Class A.\n //The scenario requirement is that it can hold any arbitrary BsonDocument of different types\n public BsonDocument Properties {get;set;} \n}\n\nvar instanceOfClassC = collection.Find(...).First();\n\nvar data = BsonSerializer.Deserialize\u0026lt;A\u0026gt;(instanceOfClassC.Properties);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis last line causes the exception bellow.\nIf I add ignore BsonElement to the Id property of class B it works fine.\nBut I need that Id property!\u003c/p\u003e\n\n\u003cp\u003eException:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eAn unhandled exception of type 'System.FormatException' occurred in MongoDB.Bson.dll\u003c/p\u003e\n \n \u003cp\u003eAdditional information: An error occurred while deserializing the Children property of class NameSpace.A: Element 'Id' does not match any field or property of class NameSpace.B.\u003c/p\u003e\n \n \u003cp\u003eAn unhandled exception of type 'System.FormatException' occurred in MongoDB.Bson.dll\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eThe problem seems to be that the property B.Id is actually stored as \"Id\" in MongoDb since it's \"serialized\" to a BsonDocument before storage. The same pattern otherwise always works perfect, but than MongoDb will transform Id =\u003e _id at write time.\u003c/p\u003e\n\n\u003cp\u003eRequirement: class C.Properties contains arbitrary kinds of other valid class types and cannot be changed to type A in class declaration. It works smooth - except that nested Id property!\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eUpdate:\u003c/strong\u003e Found a brutal hack solution: Rename all \"Id\" properties in the BsonDocument to \"_id\" before shipping of to MongoDb. Then deserialization works as expected. I do this with string replace of a json \njson.Replace(\"\\\"Id\\\"\", \"\\\"_id\\\"\")\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eAnyone has a better solution?\u003c/strong\u003e\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-06-01 12:58:29.297 UTC","last_activity_date":"2017-06-13 10:00:17.51 UTC","last_edit_date":"2017-06-01 13:27:43.433 UTC","last_editor_display_name":"","last_editor_user_id":"203300","owner_display_name":"","owner_user_id":"203300","post_type_id":"1","score":"0","tags":"c#|mongodb|deserialization|mongodb-.net-driver|bson","view_count":"211"} +{"id":"44932881","title":"React Native Expo make call, send SMS or Email","body":"\u003cp\u003eHow can I make calls or send SMS and Email messages with React Native Expo framework?\u003c/p\u003e\n\n\u003cp\u003eI am contemplating between using Expo or not and one of the concerns - support of some third-party libs. Typically with react native you would use well written \u003ca href=\"https://github.com/anarchicknight/react-native-communications\" rel=\"nofollow noreferrer\"\u003eCommunications library\u003c/a\u003e. Can I use it with Expo project or I should use something else?\u003c/p\u003e","accepted_answer_id":"44933103","answer_count":"1","comment_count":"0","creation_date":"2017-07-05 17:48:25.437 UTC","last_activity_date":"2017-07-05 18:03:13.947 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2061604","post_type_id":"1","score":"0","tags":"reactjs|react-native|expo","view_count":"452"} +{"id":"26556970","title":"File Reading Failing","body":"\u003cp\u003eThe script is being ran on the android OS at the moment.\u003c/p\u003e\n\n\u003cp\u003eGlobals File\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e///Store Global Variables\nvar Globals = {\n Storage: window.localStorage,\n OfflineMode: false,\n GetSettingsString : function()\n {\n return JSON.stringify(Settings);\n },\n\n SetSettings : function(str)\n {\n try\n {\n Settings = JSON.parse(str);\n\n if(Settings.Id != 0)\n VelocityMeetings.app.navigate(\"scan/\", { root: true });\n }\n catch(e)\n {\n alert(e);\n Globals.SetSettings();\n }\n },\n ///Experimentation Function\n SetSettings: function () {\n //Settings = JSON.parse(str);\n\n Settings.OfflineMode = false,\n Settings.Username = \"mager1794\",\n Settings.Password = \"mn1apwfm\",\n Settings.Id = 0;\n\n alert(\"Values Set Manually\");\n\n //VelocityMeetings.app.navigate(\"scan/\", { root: true });\n },\n\n Init: function () {\n // this.SetSettings(/*FileStream.ReadFile(\"settings.dat\")*/);\n alert(\"test2\");\n this.SetSettings(FileStream.ReadFile(\"settings.dat\"));\n alert(\"test3\");\n\n },\n\n Save: function () {\n FileStream.WriteFile(\"settings.dat\", GetSettingsString());\n }\n\n };\n\ndocument.addEventListener(\"deviceready\", ondeviceReady(), false);\n\n\n\n // Cordova is ready to be used!\n//\nfunction ondeviceReady() {\n alert(\"test\");\n Globals.Init();\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFileSystem File\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar FileStream = {\n\n WriteFile: function (filename, objtoWrite) {\n\n _filename = filename;\n _dataobj = objtoWrite;\n window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, _gotFSWrite, fail);\n },\n\n WriteFile: function (filename, objtoWrite, type) {\n\n _filename = filename;\n _dataobj = objtoWrite;\n _type = type;\n window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, _gotFSWrite, fail);\n },\n\n ReadFile: function (filename) {\n alert(\"ReadFile Called\");\n _filename = filename;\n window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, _gotFSRead, fail);\n\n return _dataread;\n },\n\n _dataread: null,\n _dataobj: null,\n _type : \"WRITE\",\n _filename: \"\",\n _gotFileWriter: function (writer) {\n writer.onwrite = function (evt) {\n _isBusy = false;\n };\n if(_type==\"WRITE\")\n writer.write(_dataobj);\n if (_type == \"APPEND\")\n {\n writer.seek(writer.length);\n writer.write(_dataobj);\n }\n writer.abort();\n },\n\n _gotFSWrite: function (fileSystem) {\n fileSystem.root.getFile(_filename, { create: true }, _gotFileEntryWrite, fail);\n },\n _gotFileEntryWrite: function (fileEntry) {\n fileEntry.createWriter(_gotFileWriter, fail);\n },\n _gotFSRead: function (fileSystem) {\n alert(\"gotFSRead Called\");\n fileSystem.root.getFile(_filename, { create: true }, _gotFileEntryRead, fail);\n },\n _gotFileEntryRead: function (fileEntry) {\n alert(\"gotFileEntryRead Called\");\n fileEntry.file(_gotFileRead, fail);\n },\n _gotFileRead: function (file) {\n alert(\"gotFileRead Called\");\n var reader = new FileReader();\n reader.onloadend = function (evt) {\n _dataread = evt.target.result;\n };\n reader.readAsText(file);\n\n },\n _fail: function (error) {\n throw \"File Failed\";\n\n }\n};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethe GotFSRead function is never being reached and I cannot figure out why, I've placed in the alerts just so I can watch as it progressed through the functions. Additionally, can you store a callback in a variable? because it seems that the read file function is going to need a callback in order to successfully receive the data.\u003c/p\u003e","accepted_answer_id":"26559838","answer_count":"1","comment_count":"0","creation_date":"2014-10-24 22:03:30.86 UTC","last_activity_date":"2014-10-25 06:18:58.28 UTC","last_edit_date":"2014-10-24 22:12:19.057 UTC","last_editor_display_name":"","last_editor_user_id":"4143794","owner_display_name":"","owner_user_id":"4143794","post_type_id":"1","score":"0","tags":"javascript|file|cordova","view_count":"36"} +{"id":"40105047","title":"Setup and configuration of Titan for a Spark cluster and Cassandra","body":"\u003cp\u003eThere are already several questions on the aurelius mailing list as well as here on stackoverflow about specific problems with configuring Titan to get it working with Spark. But what is missing in my opinion is a high-level description of a simple setup that uses Titan and Spark.\u003c/p\u003e\n\n\u003cp\u003eWhat I am looking for is a somewhat minimal setup that uses recommended settings. For example for Cassandra, the replication factor should be 3 and a dedicated datacenter should be used for analytics.\u003c/p\u003e\n\n\u003cp\u003eFrom the information I found in the documentation of Spark, Titan, and Cassandra, such a minimal setup could look like this:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eReal-time processing DC: 3 Nodes with Titan + Cassandra (RF: 3)\u003c/li\u003e\n\u003cli\u003eAnalytics DC: 1 Spark master + 3 Spark slaves with Cassandra (RF: 3)\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eSome questions I have about that setup and Titan + Spark in general:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eIs that setup correct?\u003c/li\u003e\n\u003cli\u003eShould Titan also be installed on the 3 Spark slave nodes and / or the Spark master?\u003c/li\u003e\n\u003cli\u003eIs there another setup that you would use instead?\u003c/li\u003e\n\u003cli\u003eWill the Spark slaves only read data from the analytics DC and ideally even from Cassandra on the same node?\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eMaybe someone can even share a config file that supports such a setup (or a better one).\u003c/p\u003e","accepted_answer_id":"40180104","answer_count":"1","comment_count":"0","creation_date":"2016-10-18 09:53:46.92 UTC","favorite_count":"1","last_activity_date":"2016-10-21 15:10:20.143 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6753576","post_type_id":"1","score":"4","tags":"apache-spark|cassandra|titan|tinkerpop|tinkerpop3","view_count":"432"} +{"id":"27486966","title":"How can I use the Clojurescript cljs.core.PersistentQueue queue?","body":"\u003cp\u003eI can't seem to find any documentation on the Clojurescript cljs.core.PersistentQueue. Should I be using it at all? Or should I be using another method of making a Clojurescript queue?\u003c/p\u003e\n\n\u003ch2\u003eUpdate\u003c/h2\u003e\n\n\u003cp\u003eIn the meantime I am using channels, \u003ccode\u003e(\u0026lt;!, (\u0026gt;!\u003c/code\u003e and go blocks and this seems to do the trick\u003c/p\u003e","accepted_answer_id":"27585782","answer_count":"2","comment_count":"0","creation_date":"2014-12-15 15:05:38.027 UTC","favorite_count":"2","last_activity_date":"2015-06-02 15:24:04.23 UTC","last_edit_date":"2014-12-18 12:25:56.237 UTC","last_editor_display_name":"","last_editor_user_id":"190822","owner_display_name":"","owner_user_id":"190822","post_type_id":"1","score":"6","tags":"clojurescript","view_count":"766"} +{"id":"33015658","title":"Can I alter multiple illustrator ai-files to svg files and preserve the layers?","body":"\u003cp\u003eI have multiple .ai-files prepared in adobe illustrator CS3. I would like to transform all of these .ai-files in one go to .svg-files - but preserve the layering I originally had in the .ai-files?\u003c/p\u003e\n\n\u003cp\u003eI can easily open my .ai-files in Adobe Illustrator and export them individually from within Adobe Illustrator to an .svg-format. But this will take quite some time to do on more than one hundred .ai-files.\u003c/p\u003e\n\n\u003cp\u003eI have no issues opening an .ai-file from a .svg-file reading software, such as InkScape. But I can see that all the layers in the original .ai-files have been fused in to a single layer in InkScape. \u003c/p\u003e\n\n\u003cp\u003eI don't want to manually open every single .ai-file from within an .svg-reading software and manually pick and move elements to new layers. This will take an eternity to do on all my .ai-files.\nMany of my .ai-files have quite a lot of layers.\u003c/p\u003e\n\n\u003cp\u003eI am pretty sure there isn't a question like this on StackFolder. The majority of the questions appear to go in the opposite direction from svg to ai files.\nBut please redirect me to a different post if I have overlooked something.\u003c/p\u003e\n\n\u003cp\u003eThanks in advance for your help on this\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-10-08 12:21:03.083 UTC","last_activity_date":"2015-10-19 23:24:33.293 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5423045","post_type_id":"1","score":"1","tags":"svg|adobe-illustrator","view_count":"49"} +{"id":"39091868","title":"Quit function is not working in pygame","body":"\u003cp\u003eI want the system to exit when I click the \"x\" on the window of pygame. I want to be able to call the \u003ccode\u003equit_game\u003c/code\u003e function whenever I need to. So if the user does quit, it actually quits. I have tried \u003ccode\u003esys exit\u003c/code\u003e and \u003ccode\u003epygame.quit()\u003c/code\u003e, but I haven't been able to successfully implement those. Right now I just have the quit function built into the intro screen. I am using python 3.4.3. Here is the code.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport math\nimport random\nimport time\nimport pygame\nimport sys\nimport glob\npygame.init()\nmove=0\nFPS=60\nblue=(0,0,255)\nwhite=(255,255,255)\nblack=(0,0,0)\ngreen=(0,155,0)\ndisplay_width=800\ndisplay_height=600\ngamedisplay=pygame.display.set_mode((display_width,display_height))\npygame.display.set_caption('Stacker')\nclock=pygame.time.Clock()\nspeed=2\nsmallfont=pygame.font.SysFont(\"Arial\",int(display_width/32))\nmediumfont=pygame.font.SysFont(\"Arial\",int(display_width/16))\nlargefont=pygame.font.SysFont(\"Arial\",int(display_width/10))\ngamedisplay.fill(green)\nblock=display_height/12\npygame.display.update()\ndef quit_game():\n for event in pygame.event.get():\n if event.type == pygame.QUIT:\n pygame.quit()\n sys.exit()\n quit()\ndef intro_screen():\n welcome_message = mediumfont.render(str(\"Welcome to Stacker!!!\"), True,black)\n gamedisplay.blit(welcome_message,(display_width/4,display_height/40))\n how_to_play_1=smallfont.render(str(\"Your goal is to get to the major prize bar\"),True,black)\n gamedisplay.blit(how_to_play_1,(display_width/3.619909502,display_height/2))\n how_to_play=smallfont.render(str(\"Press the space bar to stop the shape\"),True,black)\n gamedisplay.blit(how_to_play,(display_width/3.48583878,display_height/(12/7)))\n quit_game()\n pygame.display.update()\ndef middle_block():\n pygame.draw.rect(gamedisplay, blue,(display_width/(32/15),display_height-block,block,block))\n pygame.display.update()\ndef left_block():\n pygame.draw.rect(gamedisplay, blue,(display_width/(32/13),display_height-block,block,block))\n pygame.display.update()\ndef right_block():\n pygame.draw.rect(gamedisplay, blue,(display_width/(32/17),display_height-block,block,block))\n pygame.display.update()\ndef major_screen():\n major_message = mediumfont.render(str(\"Major Prize Here!\"), True,black)\n gamedisplay.blit(major_message,(display_width/(10/3),display_height/40))\n pygame.display.update()\nintro_screen()\npygame.time.delay(8000)\ngamedisplay.fill(green)\nmajor_screen()\npygame.draw.rect(gamedisplay, blue,(display_width-display_width,display_height/8,display_width,display_height/60))\npygame.draw.rect(gamedisplay, blue,(display_width-display_width,display_height/2.4,display_width,display_height/60))\nmiddle_block()\nleft_block()\nright_block()\npygame.display.update()\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"39111443","answer_count":"1","comment_count":"0","creation_date":"2016-08-23 03:29:23.84 UTC","last_activity_date":"2016-08-23 22:08:52.21 UTC","last_edit_date":"2016-08-23 03:38:43.43 UTC","last_editor_display_name":"","last_editor_user_id":"5623385","owner_display_name":"","owner_user_id":"6728482","post_type_id":"1","score":"0","tags":"python-3.x","view_count":"279"} +{"id":"47313121","title":"HKObjectQuery completion handler only triggered when watch is active?","body":"\u003cp\u003eWith the code below I am querying for \u003ccode\u003edistanceWalkingAndRunning\u003c/code\u003e samples on the Apple Watch, which I want to return to me (i.e. the completion handler getting called in real time as the user is moving), however, in testing...when I move, the completion handler isn't called, it's only called when I raise my wrist and activate the watch? I want this data collecting in the background if possible. The query is triggered when the workout starts, none of this is tied to the \u003ccode\u003eawake\u003c/code\u003e or \u003ccode\u003ewillActivate\u003c/code\u003e functions? \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunc startWalkingRunningQuery(from startDate: Date, updateHandler: @escaping ([HKQuantitySample]) -\u0026gt; Void) {\n let typeIdentifier = HKQuantityTypeIdentifier.distanceWalkingRunning\n startQuery(ofType: typeIdentifier, from: startDate) { _, samples, _, _, error in\n guard let quantitySamples = samples as? [HKQuantitySample] else {\n print(\"Distance walking running query failed with error: \\(String(describing: error))\")\n return\n }\n\n updateHandler(quantitySamples)\n\n }\n }\n\n //Generic helper function \n private func startQuery(ofType type: HKQuantityTypeIdentifier, from startDate: Date, handler: @escaping\n (HKAnchoredObjectQuery, [HKSample]?, [HKDeletedObject]?, HKQueryAnchor?, Error?) -\u0026gt; Void) {\n let datePredicate = HKQuery.predicateForSamples(withStart: startDate, end: nil, options: .strictStartDate)\n let devicePredicate = HKQuery.predicateForObjects(from: [HKDevice.local()])\n let queryPredicate = NSCompoundPredicate(andPredicateWithSubpredicates:[datePredicate, devicePredicate])\n\n let quantityType = HKObjectType.quantityType(forIdentifier: type)!\n\n let query = HKAnchoredObjectQuery(type: quantityType, predicate: queryPredicate, anchor: nil,\n limit: HKObjectQueryNoLimit, resultsHandler: handler)\n query.updateHandler = handler\n healthStore.execute(query)\n\n activeDataQueries.append(query)\n }\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"2","creation_date":"2017-11-15 16:55:19.313 UTC","last_activity_date":"2017-11-15 17:28:35.94 UTC","last_edit_date":"2017-11-15 17:28:35.94 UTC","last_editor_display_name":"","last_editor_user_id":"4625622","owner_display_name":"","owner_user_id":"4625622","post_type_id":"1","score":"0","tags":"ios|swift|apple-watch|health-kit","view_count":"15"} +{"id":"21321450","title":"Add color to .obj in ThreeJS","body":"\u003cp\u003eI am new to ThreeJS and have a simple question. I have the following code that will work properly, but I cannot add color to my .obj. The short and narrow of it is that I designed a game controller in Solidworks 2012, then I exported the CAD file as a .stl. I then used MeshLab to export the .stl as a .obj. Now I use the .obj in ThreeJS and it works, but I cannot for the life of me get color added to the .obj. Here is the code\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;!DOCTYPE html\u0026gt;\n\u0026lt;html lang=\"en\"\u0026gt;\n \u0026lt;head\u0026gt;\n \u0026lt;title\u0026gt;three.js webgl - loaders - vtk loader\u0026lt;/title\u0026gt;\n \u0026lt;meta charset=\"utf-8\"\u0026gt;\n \u0026lt;meta name=\"viewport\" content=\"width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0\"\u0026gt;\n \u0026lt;style\u0026gt;\n body {\n font-family: Monospace;\n background-color: #000;\n color: #fff;\n margin: 0px;\n overflow: hidden;\n }\n #info {\n color: #fff;\n position: absolute;\n top: 10px;\n width: 100%;\n text-align: center;\n z-index: 100;\n display:block;\n }\n #info a, .button { color: #f00; font-weight: bold; text-decoration: underline; cursor: pointer }\n \u0026lt;/style\u0026gt;\n \u0026lt;/head\u0026gt;\n\n \u0026lt;body\u0026gt;\n \u0026lt;div id=\"info\"\u0026gt;\n \u0026lt;a href=\"\" target=\"_blank\"\u0026gt;three.js\u0026lt;/a\u0026gt; -\n vtk format loader test -\n model from \u0026lt;a href=\"\" target=\"_blank\"\u0026gt;The GeorgiaTech Lagre Geometric Model Archive\u0026lt;/a\u0026gt;,\n \u0026lt;/div\u0026gt;\n\n \u0026lt;script src=\"three.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\n\n \u0026lt;script src=\"TrackballControls.js\"\u0026gt;\u0026lt;/script\u0026gt;\n\n \u0026lt;script src=\"OBJLoader.js\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;script src=\"BinaryLoader.js\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;script src=\"Detector.js\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;script src=\"stats.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\n\n \u0026lt;script\u0026gt;\n\n if ( ! Detector.webgl ) Detector.addGetWebGLMessage();\n\n var container, stats;\n\n var camera, controls, scene, renderer;\n\n var cross;\n\n init();\n animate();\n\n function init() {\n\n camera = new THREE.PerspectiveCamera( 60, window.innerWidth / window.innerHeight, 0.01, 1e10 );\n camera.position.z = 200;\n camera.position.y = 200;\n\n controls = new THREE.TrackballControls( camera );\n\n controls.rotateSpeed = 5.0;\n controls.zoomSpeed = 5;\n controls.panSpeed = 2;\n\n controls.noZoom = false;\n controls.noPan = false;\n\n controls.staticMoving = true;\n controls.dynamicDampingFactor = 0.3;\n\n scene = new THREE.Scene();\n\n scene.add( camera );\n\n // light\n\n var dirLight = new THREE.DirectionalLight( 0xffffff );\n dirLight.position.set( 20, 20, 100 ).normalize();\n\n camera.add( dirLight );\n camera.add( dirLight.target );\n\n // texture\n\n var manager = new THREE.LoadingManager();\n manager.onProgress = function ( item, loaded, total ) {\n\n console.log( item, loaded, total );\n\n };\n\n var texture = new THREE.Texture();\n\n var loader = new THREE.ImageLoader( manager );\n loader.load( 'bigthumbnail.jpg', function ( image ) {\n\n texture.image = image;\n texture.needsUpdate = true;\n\n } );\n\n var loader = new THREE.OBJLoader()\n loader.load( 'Gamepad.obj', function ( object ) {\n\n object.position.y = 0;\n scene.add( object ); \n\n } );\n // renderer\n\n renderer = new THREE.WebGLRenderer( { antialias: false } );\n renderer.setSize( window.innerWidth, window.innerHeight );\n\n container = document.createElement( 'div' );\n document.body.appendChild( container );\n container.appendChild( renderer.domElement );\n\n stats = new Stats();\n stats.domElement.style.position = 'absolute';\n stats.domElement.style.top = '0px';\n container.appendChild( stats.domElement );\n\n //\n\n window.addEventListener( 'resize', onWindowResize, false );\n\n }\n\n function onWindowResize() {\n\n camera.aspect = window.innerWidth / window.innerHeight;\n camera.updateProjectionMatrix();\n\n renderer.setSize( window.innerWidth, window.innerHeight );\n\n controls.handleResize();\n\n }\n\n function animate() {\n\n requestAnimationFrame( animate );\n\n controls.update();\n renderer.render( scene, camera );\n\n stats.update();\n\n }\n\n \u0026lt;/script\u0026gt;\n\n \u0026lt;/body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have poured through the threejs.org website and looked at most of the examples. All of the examples that use complex colors use .bin files or .js files. So I downloaded Python 2.7.6, installed it and ran convert_obj_three.py. This generated a .js file, but I'm not sure it is correctly formatted. Unfortunately, The output that convert_obj_three.py gave me is too large to post. My Second question is which file format is best for complex coloring, like chrome blue? .bin, .js or can I use .obj? If using a .js is the best way to go then how can I reliably convert the .obj file to .js? By the way, I tried using the .js that was created by convert_obj_three.py, but the webpage is blank all the time. Seems I cannot load the .js using THREE.JSONLoader().\u003c/p\u003e\n\n\u003cp\u003eThanks in advance. \u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2014-01-23 23:25:41.387 UTC","favorite_count":"2","last_activity_date":"2014-01-24 18:08:50.053 UTC","last_edit_date":"2014-01-24 05:51:39.863 UTC","last_editor_display_name":"","last_editor_user_id":"168868","owner_display_name":"","owner_user_id":"3229941","post_type_id":"1","score":"3","tags":"three.js|.obj","view_count":"3119"} +{"id":"4227670","title":"VB.NET WPF NullReference Exception","body":"\u003cp\u003eI have a TreeView with a parent node and two children node. Each of the nodes contain a checkbox stored in a TreeViewItem. I want the two children node checkboxes to be set to IsChecked=true when the user checks the parent node and I want the two children node checkboxes to be IsChecked=false when the user unchecks the parent node.\u003c/p\u003e\n\n\u003cp\u003eI have a for loop in which the child node checkboxes are stored in a list. The parent node checkbox check/uncheck event should iterate through the child node checkbox list but I am having a problem aceess the list. For some reason the list equals \"nothing\" in the parent node check/uncheck event. Can anyone explain how I should be accessing that list?\u003c/p\u003e\n\n\u003cp\u003eHere's My Code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ePublic Class Question\n\nDim childCheckbox As CheckBox\nDim childCheckboxes() As CheckBox\n\nPublic Sub Window_Loaded(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles MyBase.Loaded\n\n Dim parentCheckbox = New CheckBox\n Dim parentNode = New TreeViewItem\n\n parentCheckbox.Uid = \"All Sites\"\n\n AddHandler parentCheckbox.Checked, AddressOf chkbox_AllChecked\n AddHandler parentCheckbox.Unchecked, AddressOf chkbox_AllUnchecked\n\n parentCheckbox.Content = \"All Sites\"\n parentNode.Header = parentCheckbox\n\n For Each osite In sites\n\n Dim childNode = New TreeViewItem\n Dim childCheckbox = New CheckBox\n\n AddHandler childCheckbox.Checked, AddressOf chkbox_Checked\n AddHandler childCheckbox.Unchecked, AddressOf chkbox_Unchecked\n\n childCheckbox.Uid = osite.SiteName.ToString\n\n childCheckbox.Content = osite.SiteName.ToString\n childNode.Header = childCheckbox\n parentNode.Items.Add(childNode)\n\n 'Add all childCheckbox to an array for use by parentChildbox methods to check/uncheck all\n childCheckboxes(i) = childCheckbox\n\n i += 1\n\n Next\n TreeView1.Items.Add(parentNode)\n\n\n End Sub\n\nPrivate Sub chkbox_AllChecked(ByVal sender As Object, ByVal e As RoutedEventArgs)\n Dim chk = DirectCast(sender, CheckBox)\n\n 'MessageBox.Show(chk.Uid.ToString)\n\n\n 'This part doesn't work. \n For Each child In childCheckboxes\n child.IsChecked = True\n Next\n\n End Sub\n\nPrivate Sub chkbox_Checked(ByVal sender As Object, ByVal e As RoutedEventArgs)\n Dim chk = DirectCast(sender, CheckBox)\n\n 'MessageBox.Show(\"Check!\")\n MessageBox.Show(chk.Uid.ToString)\n\nEnd Sub\n\nPrivate Sub chkbox_Unchecked(ByVal sender As Object, ByVal e As RoutedEventArgs)\n Dim chk = DirectCast(sender, CheckBox)\n\n 'MessageBox.Show(\"Uncheck!\")\n MessageBox.Show(chk.Uid.ToString)\n\nEnd Sub\n\nEnd Class\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks for the help!\u003c/p\u003e","accepted_answer_id":"4227740","answer_count":"1","comment_count":"0","creation_date":"2010-11-19 17:26:47.47 UTC","last_activity_date":"2010-11-19 17:34:19.733 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"441625","post_type_id":"1","score":"0","tags":"wpf|vb.net","view_count":"402"} +{"id":"15222596","title":"BitmapImage from file PixelFormat is always bgr32","body":"\u003cp\u003eI am loading an image from file with this code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eBitmapImage BitmapImg = null;\nBitmapImg = new BitmapImage();\nBitmapImg.BeginInit();\nBitmapImg.UriSource = new Uri(imagePath);\nBitmapImg.CacheOption = BitmapCacheOption.OnLoad;\nBitmapImg.CreateOptions = BitmapCreateOptions.IgnoreImageCache;\nBitmapImg.EndInit();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt works as expected except for the fact that no matter what kind of image I'm loading (24bit RGB, 8bit grey, 12bit grey,...), after .EndInit() the BitmapImage always has as Format bgr32. I know there have been discussions on the net, but I have not found any solution for this problem. \nDoes anyone of you know if it has been solved yet?\u003c/p\u003e\n\n\u003cp\u003eThanks,\u003c/p\u003e\n\n\u003cp\u003etabina\u003c/p\u003e","accepted_answer_id":"15228818","answer_count":"1","comment_count":"1","creation_date":"2013-03-05 11:26:22.943 UTC","last_activity_date":"2013-03-05 16:18:07.753 UTC","last_edit_date":"2013-03-05 12:33:24.207 UTC","last_editor_display_name":"","last_editor_user_id":"1210977","owner_display_name":"","owner_user_id":"1210977","post_type_id":"1","score":"2","tags":"wpf|bitmapimage|pixelformat","view_count":"1983"} +{"id":"25380778","title":"How to find the sum of values of a column in a ListView","body":"\u003cp\u003eI am Using vb 2008 with mysql express 2005\ni have a viewlist box with some data like\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e========================================================\nproduct id product name product rate\n========================================================\n\n12 ANYONE 50\n12 ANYONE 100\n\n========================================================\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to \u003ccode\u003eadd(sum)\u003c/code\u003e all of data given in PRODUCT RATE means column3\u003cbr\u003e\nthen sum will be shown in an text box\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2014-08-19 10:10:48.56 UTC","last_activity_date":"2014-08-19 10:33:56.397 UTC","last_edit_date":"2014-08-19 10:33:56.397 UTC","last_editor_display_name":"","last_editor_user_id":"2416510","owner_display_name":"","owner_user_id":"3955821","post_type_id":"1","score":"1","tags":"mysql|vb.net|sum|add","view_count":"365"} +{"id":"12944233","title":"Do I need any kind of java installation on a webserver that hosts java applets?","body":"\u003cp\u003eA webserver hosting java applets doesn't necessarily need java installed on it, right?\nIt's the clients computer that views the applets that needs a java jre installation or similar?\nOr do I get this wrong?\nThanks!\u003c/p\u003e","accepted_answer_id":"12944247","answer_count":"2","comment_count":"0","creation_date":"2012-10-17 22:13:05 UTC","last_activity_date":"2012-10-17 22:16:06.73 UTC","last_edit_date":"2012-10-17 22:16:06.73 UTC","last_editor_display_name":"","last_editor_user_id":"231917","owner_display_name":"","owner_user_id":"589290","post_type_id":"1","score":"1","tags":"applet|webserver|java","view_count":"231"} +{"id":"19656908","title":"Move element with responsive CSS in GWT","body":"\u003cp\u003eI have three elements like this in GWT:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eHorizontalPanel picturePanel = new HorizontalPanel();\npicturePanel.setStylePrimaryName(\"picturePanel\");\nimage.setStylePrimaryName(\"picture\");\nleftArrow.setStylePrimaryName(\"arrow-left\");\nrightArrow.setStylePrimaryName(\"arrow-right\");\npicturePanel.add(leftArrow);\npicturePanel.add(image);\npicturePanel.add(rightArrow);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhich currently becomes the following structure after the GWT compilation:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;table class=\"picture-container\"\u0026gt;\n ...\n \u0026lt;td align=\"left\" style=\"vertical-align: top;\"\u0026gt;\n \u0026lt;img class=\"arrow-left\" src=\"../images/icons/left2.svg\"\u0026gt;\u0026lt;/img\u0026gt;\n \u0026lt;/td\u0026gt;\n \u0026lt;td align=\"left\" style=\"vertical-align: top;\"\u0026gt;\n \u0026lt;img class=\"picture mission-picture\" src=\"../pictures/d5edc879-fe9b-4980-92e3-9bb4ac020abb.jpg\"\u0026gt;\u0026lt;/img\u0026gt;\n \u0026lt;/td\u0026gt;\n \u0026lt;td align=\"left\" style=\"vertical-align: top;\"\u0026gt;\n \u0026lt;img class=\"arrow-right\" src=\"../images/icons/right2.svg\"\u0026gt;\u0026lt;/img\u0026gt;\n \u0026lt;/td\u0026gt;\n\u0026lt;/table\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis HTML structure might very well(hopefully) be changed in the next version of GWT. To the question, \u003cstrong\u003eis it possible to write CSS for this (without caring about the current HTML structure) so that the arrow-left and arrow-right will appear centered underneath the image, instead of on the sides?\u003c/strong\u003e Note that the size of the picture is dynamic. I preferably don't want to change the GWT code as the CSS code is to be used only when the page gets smaller than a certain width, like \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@media only screen and (max-width: 420px) {\n .arrow-left{}\n .arrow-right{}\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eUpdate:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI've tried a different approach by having a ResizeHandler in the GWT code that moves the arrows to a different panel underneath the image once the width becomes smaller than 420px. It works, but I think it would be a lot more efficient and handy to have it in the CSS. This solution feels a bit like an ugly hack and it makes me sad.\u003c/p\u003e\n\n\u003cp\u003eHere is a jsfiddle where you can try the described the problem: \u003ca href=\"http://jsfiddle.net/YZSAr/\" rel=\"nofollow\"\u003ehttp://jsfiddle.net/YZSAr/\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"19719134","answer_count":"3","comment_count":"0","creation_date":"2013-10-29 11:24:27.807 UTC","last_activity_date":"2013-11-01 00:48:33.493 UTC","last_edit_date":"2013-10-31 23:41:15.957 UTC","last_editor_display_name":"","last_editor_user_id":"789545","owner_display_name":"","owner_user_id":"789545","post_type_id":"1","score":"4","tags":"html5|css3|gwt","view_count":"788"} +{"id":"16689495","title":"Android Global Data Binding","body":"\u003cp\u003eCan anybody give me a suggestion for android data binding.\u003cbr/\u003e\nI want my android application view components tied to a global data model.\u003cbr/\u003e\nThis data model might be setted in Application object in application loading phase. \u003cbr/\u003e\nAnd later, once this data modal be modified, can appear in application immediately.\u003cbr/\u003e\u003c/p\u003e","answer_count":"2","comment_count":"2","creation_date":"2013-05-22 10:31:40.973 UTC","last_activity_date":"2015-10-12 10:24:16.913 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1919653","post_type_id":"1","score":"2","tags":"android|data-binding","view_count":"241"} +{"id":"29490552","title":"redirect output file from one python script as input file in another python script","body":"\u003cp\u003eI wrote a python script for file manipulations, Since I don't know the way to redirect output file from one python script as input file in another python script, I have to run both the scripts separately. I want to learn as to how to pass on the output file from one script as input file for another script. Can someone please guide me regarding this query?\u003c/p\u003e","answer_count":"1","comment_count":"5","creation_date":"2015-04-07 11:31:08.873 UTC","last_activity_date":"2015-04-07 11:39:36.997 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4274179","post_type_id":"1","score":"-1","tags":"python|redirect|file-io","view_count":"475"} +{"id":"20663908","title":"FOR XML multiple control by attribute in tree concept","body":"\u003cp\u003eI want to figure out one issue.\u003c/p\u003e\n\n\u003cp\u003eI already had question about simple ordering issue but I want to order more detail.\ncheck below this link : \n\u003ca href=\"https://stackoverflow.com/questions/20613146/sql-server-for-xml-sorting-control-by-attribute\"\u003eSQL Server : FOR XML sorting control by attribute\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI made a example case. \u003c/p\u003e\n\n\u003cp\u003eSQL Query.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eselect (\n select '123' AS '@id', ( \n select \n (\n select 'test' AS '@testid' , '20' AS '@order'\n FOR XML path ('tree') , TYPE\n ),\n (\n select 'test2' AS '@testid' , '30' AS '@order'\n FOR XML path ('tree-order') , TYPE\n ),\n (\n select 'test' AS '@testid' , '10' AS '@order'\n FOR XML path ('tree') , TYPE\n )\n FOR XML path ('Node') , TYPE\n )\n FOR XML path ('Sample') , TYPE\n ),\n (select '456' AS '@id', ( \n select \n (\n select 'test' AS '@testid' , '20' AS '@order'\n FOR XML path ('tree') , TYPE\n ),\n (\n select 'test2' AS '@testid' , '30' AS '@order'\n FOR XML path ('tree-order') , TYPE\n ),\n (\n select 'test' AS '@testid' , '10' AS '@order'\n FOR XML path ('tree') , TYPE\n )\n FOR XML path ('Node') , TYPE\n )\n FOR XML path ('Sample') , TYPE)\nFOR XML path ('Main') , TYPE\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eResult : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;Main\u0026gt;\n \u0026lt;Sample id=\"123\"\u0026gt;\n \u0026lt;Node\u0026gt;\n \u0026lt;tree testid=\"test\" order=\"20\" /\u0026gt;\n \u0026lt;tree-order testid=\"test2\" order=\"30\" /\u0026gt;\n \u0026lt;tree testid=\"test\" order=\"10\" /\u0026gt;\n \u0026lt;/Node\u0026gt;\n \u0026lt;/Sample\u0026gt;\n \u0026lt;Sample id=\"456\"\u0026gt;\n \u0026lt;Node\u0026gt;\n \u0026lt;tree testid=\"test\" order=\"20\" /\u0026gt;\n \u0026lt;tree-order testid=\"test2\" order=\"30\" /\u0026gt;\n \u0026lt;tree testid=\"test\" order=\"10\" /\u0026gt;\n \u0026lt;/Node\u0026gt;\n \u0026lt;/Sample\u0026gt;\n\u0026lt;/Main\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eExpected result : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;Main\u0026gt;\n \u0026lt;Sample id=\"123\"\u0026gt;\n \u0026lt;Node\u0026gt;\n \u0026lt;tree testid=\"test\" order=\"10\" /\u0026gt;\n \u0026lt;tree testid=\"test\" order=\"20\" /\u0026gt;\n \u0026lt;tree-order testid=\"test2\" order=\"30\" /\u0026gt;\n \u0026lt;/Node\u0026gt;\n \u0026lt;/Sample\u0026gt;\n \u0026lt;Sample id=\"456\"\u0026gt;\n \u0026lt;Node\u0026gt;\n \u0026lt;tree testid=\"test\" order=\"10\" /\u0026gt;\n \u0026lt;tree testid=\"test\" order=\"20\" /\u0026gt;\n \u0026lt;tree-order testid=\"test2\" order=\"30\" /\u0026gt;\n \u0026lt;/Node\u0026gt;\n \u0026lt;/Sample\u0026gt;\n\u0026lt;/Main\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003efinal result : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;Main\u0026gt;\n \u0026lt;Sample id=\"123\"\u0026gt;\n \u0026lt;Node\u0026gt;\n \u0026lt;tree testid=\"test\" /\u0026gt;\n \u0026lt;tree testid=\"test\" /\u0026gt;\n \u0026lt;tree-order testid=\"test2\" /\u0026gt;\n \u0026lt;/Node\u0026gt;\n \u0026lt;/Sample\u0026gt;\n \u0026lt;Sample id=\"456\"\u0026gt;\n \u0026lt;Node\u0026gt;\n \u0026lt;tree testid=\"test\" /\u0026gt;\n \u0026lt;tree testid=\"test\" /\u0026gt;\n \u0026lt;tree-order testid=\"test2\" /\u0026gt;\n \u0026lt;/Node\u0026gt;\n \u0026lt;/Sample\u0026gt;\n\u0026lt;/Main\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThat's order by tree-order.\u003c/p\u003e\n\n\u003cp\u003efinally I don't want to show order information in attribute \u003c/p\u003e\n\n\u003cp\u003eAny one has great Idea?\u003c/p\u003e\n\n\u003cp\u003eThank you for everybody who interesting to this.\u003c/p\u003e\n\n\u003cp\u003eUpdated ----------------------------------------\u003c/p\u003e\n\n\u003cp\u003eThank you every body finally I solved problem as below about order by and remove attribute issue : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edeclare @resultData xml = (select @data.query('\n element Main {\n for $s in Main/Sample\n return element Sample {\n $s/@*,\n for $n in $s/Node\n return element Node {\n for $i in $n/* \n order by $i/@order\n return $i \n }\n } \n }'));\n\n SET @resultData.modify('delete (Main/Sample/Node/tree/@order)');\n SET @resultData.modify('delete (Main/Sample/Node/tree-order/@order)');\n\n select @resultData\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"20664129","answer_count":"2","comment_count":"0","creation_date":"2013-12-18 16:53:21.693 UTC","last_activity_date":"2013-12-18 21:58:26.39 UTC","last_edit_date":"2017-05-23 10:32:19.447 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"2979548","post_type_id":"1","score":"0","tags":"sql|sql-server|xml|xquery|sqlxml","view_count":"104"} +{"id":"6049522","title":"Windows Service installation - current directory","body":"\u003cp\u003ethis question is related to my \u003ca href=\"https://stackoverflow.com/questions/6043663/windows-service-how-to-make-name-configurable\"\u003eprevious one\u003c/a\u003e . I've written a service in C# and I need to make it's name dynamic and load the name from configuration file. The problem is that current directory while the service installer is invoked is the net framework 4 directory instead of the one that my assembly sits in.\u003c/p\u003e\n\n\u003cp\u003eUsing the line (which helps with the same problem, but while the service is already running)\n\u003ccode\u003eSystem.IO.Directory.SetCurrentDirectory(System.AppDomain.CurrentDomain.BaseDirectory);\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003esets the directory to\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eC:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhich was also the initial value.\u003c/p\u003e\n\n\u003cp\u003eHow to get the right path?\u003c/p\u003e","accepted_answer_id":"6049673","answer_count":"3","comment_count":"1","creation_date":"2011-05-18 18:42:35.803 UTC","last_activity_date":"2011-05-18 19:19:21.563 UTC","last_edit_date":"2017-05-23 12:30:20.733 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"195711","post_type_id":"1","score":"0","tags":"c#|windows-services","view_count":"4344"} +{"id":"10751437","title":"XML validation fails on attributes","body":"\u003cp\u003eI've some problem validating an xml against a schema that i defined. The weird thing is that the validation fails only if I use the default namespace \u003ccode\u003exmlns=\"http://retis.sssup.it/duck-lab\"\u003c/code\u003e while it works like a charm if I define it like \u003ccode\u003exmlns:dl=\"http://retis.sssup.it/duck-lab\"\u003c/code\u003e. \u003c/p\u003e\n\n\u003cp\u003eWhen I use the empty namespace the validation fails only on the attributes with the following messages:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecvc-complex-type.3.2.2: Attribute 'data_len' is not allowed to appear in element 'data'. \ncvc-complex-type.4: Attribute 'data_len' must appear on element 'data'.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eVALID XML:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;dl:duck xmlns:dl=\"http://retis.sssup.it/duck-lab\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n xsi:schemaLocation=\"http://retis.sssup.it/duck-lab ../duck.xsd \"\u0026gt;\n...\n \u0026lt;dl:data dl:data_len=\"1\" dl:data_name=\"name uint\" dl:data_type=\"uint16\" dl:endianess=\"big-endian\"/\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eINVALID XML:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;duck xmlns=\"http://retis.sssup.it/duck-lab\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n xsi:schemaLocation=\"http://retis.sssup.it/duck-lab ../duck.xsd \"\u0026gt;\n...\n \u0026lt;data data_len=\"1\" data_name=\"name uint\" data_type=\"uint16\" endianess=\"big-endian\"/\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003e--EDIT--\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eDUCK.XSD\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;schema xmlns=\"http://www.w3.org/2001/XMLSchema\" targetNamespace=\"http://retis.sssup.it/duck-lab\"\n xmlns:dl=\"http://retis.sssup.it/duck-lab\" elementFormDefault=\"qualified\"\u0026gt;\n\n \u0026lt;include schemaLocation=\"datatypes.xsd\"/\u0026gt;\n \u0026lt;include schemaLocation=\"duck_message.xsd\"/\u0026gt;\n\n \u0026lt;complexType name=\"DuckDefinitionType\" block=\"#all\" final=\"#all\"\u0026gt;\n \u0026lt;sequence\u0026gt;\n \u0026lt;element type=\"dl:MessageType\" name=\"message_description\" form=\"qualified\"/\u0026gt;\n \u0026lt;/sequence\u0026gt;\n \u0026lt;/complexType\u0026gt;\n\n \u0026lt;element name=\"duck\" type=\"dl:DuckDefinitionType\" /\u0026gt;\n\n\u0026lt;/schema\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eDATATYPES.XSD\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;schema xmlns=\"http://www.w3.org/2001/XMLSchema\" targetNamespace=\"http://retis.sssup.it/duck-lab\"\n xmlns:dl=\"http://retis.sssup.it/duck-lab\" elementFormDefault=\"qualified\"\u0026gt;\n \u0026lt;attribute name=\"data_name\" type=\"string\"/\u0026gt;\n \u0026lt;attribute name=\"data_len\" type=\"nonNegativeInteger\"/\u0026gt;\n \u0026lt;attribute name=\"data_type\" type=\"string\"/\u0026gt;\n \u0026lt;attribute name=\"endianess\" type=\"string\"/\u0026gt;\n \u0026lt;element name=\"data\"\u0026gt;\n \u0026lt;complexType\u0026gt;\n \u0026lt;attribute ref=\"dl:data_name\" use=\"required\"/\u0026gt;\n \u0026lt;attribute ref=\"dl:data_len\" use=\"required\"/\u0026gt;\n \u0026lt;attribute ref=\"dl:data_type\" use=\"required\"/\u0026gt;\n \u0026lt;attribute ref=\"dl:endianess\" use=\"required\"/\u0026gt;\n \u0026lt;/complexType\u0026gt;\n \u0026lt;/element\u0026gt;\n\u0026lt;/schema\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eDUCK_MESSAGE.XSD\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;schema xmlns=\"http://www.w3.org/2001/XMLSchema\" targetNamespace=\"http://retis.sssup.it/duck-lab\"\n xmlns:dl=\"http://retis.sssup.it/duck-lab\" elementFormDefault=\"qualified\"\u0026gt;\n\n \u0026lt;include schemaLocation=\"datatypes.xsd\"\u0026gt;\u0026lt;/include\u0026gt;\n \u0026lt;complexType name=\"MessageType\"\u0026gt;\n \u0026lt;sequence maxOccurs=\"unbounded\"\u0026gt;\n \u0026lt;element ref=\"dl:data\"\u0026gt;\u0026lt;/element\u0026gt;\n \u0026lt;/sequence\u0026gt; \n \u0026lt;/complexType\u0026gt;\n\u0026lt;/schema\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eObviously I can bypass the problem defining a non empty namespace, but I would like to understand what's wrong.\u003c/p\u003e\n\n\u003cp\u003eThanks a lot.\u003c/p\u003e","accepted_answer_id":"10756677","answer_count":"1","comment_count":"2","creation_date":"2012-05-25 08:58:46.263 UTC","last_activity_date":"2012-05-25 14:55:50.35 UTC","last_edit_date":"2012-05-25 14:26:47.027 UTC","last_editor_display_name":"","last_editor_user_id":"302798","owner_display_name":"","owner_user_id":"302798","post_type_id":"1","score":"2","tags":"xml|validation|xsd|xerces","view_count":"7760"} +{"id":"13223464","title":"error \"main cannot be resolved or is not a field \"","body":"\u003cp\u003e\"MAIN CANNOT RESOLOVED OR NOT IN A FIELD\" \nIt gives error in mainactivity at setcontentview \"main cannot be resolved or not in field.\u003cbr\u003e\nThis is my code plz help me as i got tired to find a way out plz reomove this error\n \"this is my mainactivity\"\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epackage com.exampl.goglemaps;\n\nimport android.os.Bundle;\nimport com.exampl.goglemaps.R;\nimport com.google.android.maps.MapActivity;\nimport com.google.android.maps.MapView;\n\npublic class MainActivity extends MapActivity {\n\n @Override\n public void onCreate(Bundle savedInstanceState) {\n\n super.onCreate(savedInstanceState);\n setContentView(R.layout.main);\n\n //fetch the map view from the layout\n MapView mapView = (MapView) findViewById(R.id.mapview);\n\n //make available zoom controls\n mapView.setBuiltInZoomControls(true);\n }\n\n @Override\n protected boolean isRouteDisplayed() {\n\n return false;\n\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003emy manfiestfile\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" encoding=\"utf-8\"?\u0026gt;\n\u0026lt;manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\npackage=\"com.exampl.goglemaps\"\n android:versionCode=\"1\"\n android:versionName=\"1.0\" \u0026gt;\n\n \u0026lt;uses-sdk android:minSdkVersion=\"14\" /\u0026gt;\n\n \u0026lt;uses-permission android:name=\"android.permission.INTERNET\"/\u0026gt;\n\n \u0026lt;application\n android:icon=\"@drawable/ic_launcher\"\n android:label=\"@string/app_name\" \u0026gt;\n \u0026lt;activity\n android:name=\".MainActivity\"\n android:label=\"@string/app_name\" \u0026gt;\n \u0026lt;intent-filter\u0026gt;\n \u0026lt;action android:name=\"android.intent.action.MAIN\" /\u0026gt;\n\n \u0026lt;category android:name=\"android.intent.category.LAUNCHER\" /\u0026gt;\n \u0026lt;/intent-filter\u0026gt;\n \u0026lt;/activity\u0026gt;\n \u0026lt;uses-library android:name=\"com.google.android.maps\" /\u0026gt;\n \u0026lt;/application\u0026gt;\n\u0026lt;/manifest\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand that is my xml\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" encoding=\"utf-8\"?\u0026gt;\n\u0026lt;LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:layout_width=\"fill_parent\"\n android:layout_height=\"fill_parent\"\n android:orientation=\"vertical\" \u0026gt;\n\n \u0026lt;com.google.android.maps.MapView\n android:id=\"@+id/mapview\"\n android:layout_width=\"fill_parent\"\n android:layout_height=\"fill_parent\"\n android:apiKey=\"Your Google Maps API key\"\n android:clickable=\"true\" /\u0026gt;\n\u0026lt;/LinearLayout\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003ethis call a error in mainactivity in setContentView(R.layout.main); saying that \"main cannot not be resoloved or in not a field\"\u003c/strong\u003e i have searched almost every foroum but failed to get through this, plz help me out to solve this error.\u003c/p\u003e\n\n\u003ch1\u003eHeading\u003c/h1\u003e\n\n\u003cp\u003eTHANKs in Advance\u003c/p\u003e","accepted_answer_id":"13223493","answer_count":"2","comment_count":"1","creation_date":"2012-11-04 22:11:50.4 UTC","favorite_count":"1","last_activity_date":"2013-11-19 07:28:56.833 UTC","last_edit_date":"2012-11-04 22:16:56.03 UTC","last_editor_display_name":"","last_editor_user_id":"1397268","owner_display_name":"","owner_user_id":"1796974","post_type_id":"1","score":"2","tags":"java|android|google-maps-api-3|syntax-error","view_count":"2443"} +{"id":"37939030","title":"Webpack file loade not displaying icon images on the browser","body":"\u003cp\u003eWell since my webpack expercise is not so good I having problem getting some icons to display on the browser. My setup looks like this on webpack:\n\u003cdiv class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\"\u003e\r\n\u003cdiv class=\"snippet-code\"\u003e\r\n\u003cpre class=\"snippet-code-html lang-html prettyprint-override\"\u003e\u003ccode\u003e {\r\n test: /\\.(ttf|eot|woff|woff2)$/,\r\n exclude: /node_modules/,\r\n loader: 'url?limit=100000?name=fonts/[name].[ext]',\r\n },\r\n {\r\n test: /\\.(jpg|png|svg)$/,\r\n exclude: /node_modules/,\r\n loader: 'url?limit=100000',\r\n },\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003c/p\u003e\n\n\u003cp\u003eThe icons I have are located here:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/S8CFA.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/S8CFA.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2016-06-21 08:16:37.87 UTC","last_activity_date":"2016-06-21 08:17:48.987 UTC","last_edit_date":"2016-06-21 08:17:48.987 UTC","last_editor_display_name":"","last_editor_user_id":"4484822","owner_display_name":"","owner_user_id":"2812982","post_type_id":"1","score":"1","tags":"javascript|reactjs|webpack","view_count":"26"} +{"id":"498580","title":"iPhone Development - Keyboard does not automatically adjust when taking input using TextField placed in a TableView","body":"\u003cp\u003eI just downloaded 2.2.1 and i've seen that my input view does not adjust itself when an input field (NSTextField) is selected. Earlier the view was adjusting itself w.r.t keyboard.\u003c/p\u003e\n\n\u003cp\u003eI was using 2.1. How can i achieve the same effect?\u003c/p\u003e","accepted_answer_id":"2597995","answer_count":"1","comment_count":"0","creation_date":"2009-01-31 09:42:19.627 UTC","last_activity_date":"2010-04-08 06:32:33.723 UTC","last_editor_display_name":"","owner_display_name":"Mustafa","owner_user_id":"49739","post_type_id":"1","score":"0","tags":"iphone|uitableview|keyboard|adjustment","view_count":"871"} +{"id":"14439650","title":"YouTube IFrame API generates mixed content warning with HTTPS + HTML5","body":"\u003cp\u003eWhen I embed youtube on an HTTPS page using the iframe api in HTML5 mode , it still pulls the actual stream using HTTP, which generates a mixed content warning. Is this usecase properly supported?\u003c/p\u003e\n\n\u003cp\u003eI found \u003ca href=\"https://groups.google.com/forum/?fromgroups=#!topic/youtube-api-gdata/ABLHg5kUUgA\" rel=\"nofollow noreferrer\"\u003ethis discussion\u003c/a\u003e from 2011 which suggests it wasn't. However I just tried accessing the CDN server using HTTPS and it works - kind of - but it returns the wrong certificate (google.com instead of something for youtube.com).\u003c/p\u003e\n\n\u003cp\u003eHas anyone managed to embed a video on a HTTPS page using the IFRAME API in HTML5 without triggering a mixed content warning (ie. the lock with the yellow warning sign in Chrome)?\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","answer_count":"2","comment_count":"2","creation_date":"2013-01-21 13:24:07.6 UTC","favorite_count":"2","last_activity_date":"2016-02-06 10:39:26.517 UTC","last_edit_date":"2016-02-06 10:39:26.517 UTC","last_editor_display_name":"","last_editor_user_id":"1584250","owner_display_name":"","owner_user_id":"1265","post_type_id":"1","score":"13","tags":"ssl|https|youtube-api|youtube-iframe-api","view_count":"3552"} +{"id":"34942737","title":"Convert Array to JSON string php","body":"\u003cp\u003eI have an array like this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$prebook=array(\n 'sourceCity'=\u0026gt;$_POST['source'], \n 'destinationCity'=\u0026gt;$_POST['dest'],\n 'doj'=\u0026gt;$_POST['doj'],\n 'routeScheduleId'=\u0026gt;$_POST['routeid'],\n 'boardingPoint'=\u0026gt;array(\n 'id'=\u0026gt;$id,\n 'location'=\u0026gt;$location,\n 'time'=\u0026gt;$time\n ), \n 'customerName'=\u0026gt;$_POST['fname'],\n 'customerLastName'=\u0026gt;$_POST['lname'],\n 'customerEmail'=\u0026gt;$_POST['email'],\n 'customerPhone'=\u0026gt;$_POST['mobileno'],\n 'emergencyPhNumber'=\u0026gt;$_POST['emc-number'],\n 'customerAddress'=\u0026gt;$_POST['address'],\n 'blockSeatPaxDetails'=\u0026gt;array(array(\n 'age'=\u0026gt;$_POST['age'][$key],\n 'name'=\u0026gt;$value,\n 'seatNbr'=\u0026gt;$_POST['seat-no'][$key],\n 'Sex'=\u0026gt;$_POST['gender'.$no],\n 'fare'=\u0026gt;$_POST['base-fare'][$key],\n 'totalFareWithTaxes'=\u0026gt;$_POST['amount'][$key],\n 'ladiesSeat'=\u0026gt;$ladies,\n 'lastName'=\u0026gt;$_POST['plname'][$key],\n 'mobile'=\u0026gt;$_POST['mobileno'],\n 'title'=\u0026gt;'Mr',\n 'email'=\u0026gt;$_POST['email'],\n 'idType'=\u0026gt;$_POST['idtype'],\n 'idNumber'=\u0026gt;$_POST['id-number'],\n 'nameOnId'=\u0026gt;$value,\n 'primary'=\u0026gt;true,\n 'ac'=\u0026gt;$ac,\n 'sleeper'=\u0026gt;$sleeper\n )),\n 'inventoryType'=\u0026gt;$_POST['invtype'] \n )\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFrom this i want to get Json string look like this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eapiBlockTicketRequest:{\"sourceCity\":\"Hyderabad\",\"destinationCity\":\"Bangalore\",\"doj\":\"2016-01-22\",\"routeScheduleId\":\"6717\",\"boardingPoint\":{\"id\":\"2889\",\"location\":\"Mettuguda,Opp. Mettuguda Church\",\"time\":\"04:50PM\"},\"customerName\":\"jj\",\"customerLastName\":\"jjj\",\"customerEmail\":\"shamonsha665@gmail.com\",\"customerPhone\":\"7779\",\"emergencyPhNumber\":\"7878\",\"customerAddress\":\"gjgj\",\"blockSeatPaxDetails\":[{\"age\":\"22\",\"name\":\"hjhj\",\"seatNbr\":\"G4\",\"Sex\":\"F\",\"fare\":\"900\",\"totalFareWithTaxes\":\"945\",\"ladiesSeat\":false,\"lastName\":\"hjhj\",\"mobile\":\"7779\",\"title\":\"Mr\",\"email\":\"shamonsha665@gmail.com\",\"idType\":\"Aadhar Card\",\"idNumber\":\"jkjk\",\"nameOnId\":\"hjhj\",\"primary\":true,\"ac\":false,\"sleeper\":false}],\"inventoryType\":\"0\"}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is my code\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$data =json_encode($prebook);\n$json='apiBlockTicketRequest:'.$data;\necho $json;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut when i Validate the JSON string using \u003ca href=\"https://jsonformatter.curiousconcept.com/\" rel=\"nofollow\"\u003ethis\u003c/a\u003e I will get the following error\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eExpecting object or array, not string.[Code 1, Structure 1]\u003c/p\u003e\n \n \u003cp\u003eError:Strings should be wrapped in double quotes.\u003c/p\u003e\n\u003c/blockquote\u003e","accepted_answer_id":"34942843","answer_count":"1","comment_count":"7","creation_date":"2016-01-22 09:04:55.15 UTC","last_activity_date":"2016-01-22 09:12:23.147 UTC","last_edit_date":"2016-01-22 09:08:53.68 UTC","last_editor_display_name":"","last_editor_user_id":"4225893","owner_display_name":"","owner_user_id":"4225893","post_type_id":"1","score":"-1","tags":"php|arrays|json","view_count":"3407"} +{"id":"35565482","title":"Wowza Cloud - CORS (hls.js)","body":"\u003cp\u003eI'm trying to get a stream running into a website using hls.js from the wowza cloud, but keep getting a CORS error. I know I need to change the headers on the streaming server, but where do I do that using the Wowza Cloud? All documentation only shows how to change it on the Wowza Engine.\u003c/p\u003e\n\n\u003cp\u003eThanks!\nDavid\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2016-02-22 22:47:09.017 UTC","last_activity_date":"2016-12-20 23:50:01.323 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5622517","post_type_id":"1","score":"0","tags":"cors|cross-domain|wowza|hls|wowza-transcoder","view_count":"662"} +{"id":"31264924","title":"Concatenating value to a command line","body":"\u003cp\u003eI am making a program that uses the rasidal command to connect to a VPN server. Obviously this requires a login and this is stored in a notepad file.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eProcess.Start(\"rasdial.exe\", \"\"\"VPN Connection\"\" HardcodedUSERNAME HardCodedPassword\")\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis seems to work fine, however when I read this information from a notepad file and write it to the screen they are still exactly the same. Why is it that the login could be incorrect. \u003c/p\u003e\n\n\u003cp\u003eAll I am doing is\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eProcess.Start(\"rasdial.exe\", \"\"\"VPN Connection\"\" \u0026amp; Info\")\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-07-07 09:35:17.997 UTC","favorite_count":"1","last_activity_date":"2015-07-07 10:01:40.233 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5078142","post_type_id":"1","score":"0","tags":"vb.net","view_count":"29"} +{"id":"43206551","title":"Drawing ROC from the given classifier","body":"\u003cp\u003eI have a classifier with the below quality information, but I don't have any data:\u003c/p\u003e\n\n\u003cp\u003eTP :325/TN :200/FP :275/FN :200\u003c/p\u003e\n\n\u003cp\u003eIs there any solution that assists me to find regression model based on above information. I need to draw ROC.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-04-04 11:55:32.05 UTC","last_activity_date":"2017-04-04 12:04:07.443 UTC","last_edit_date":"2017-04-04 12:01:08.793 UTC","last_editor_display_name":"","last_editor_user_id":"6836777","owner_display_name":"","owner_user_id":"6836777","post_type_id":"1","score":"-2","tags":"r","view_count":"21"} +{"id":"47520455","title":"Stuck on a basic Lua writeInteger function","body":"\u003cp\u003eI am a newcomer to coding in general and I want to learn basic Lua scripting for my own hobby.\nAfter working on a Lua script, the syntax all seems to be without error but I have come across one issue that I don't understand, I broke it down to this basic function:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{$lua}\n ID1 = \"10\"\n ID2 = \"0\"\n\nif (ID1 ~= nil and ID1 == \"10\") then\n writeInteger(ID2,\"25\")\n end\n\nprint(ID2)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe issue is that the writeInteger does not seem to work at all, ID2 remains at value \"0\" while it should become \"25\".\nAny help would be greatly appreciated.\u003c/p\u003e","answer_count":"2","comment_count":"4","creation_date":"2017-11-27 21:53:58.42 UTC","last_activity_date":"2017-11-30 15:37:20.887 UTC","last_edit_date":"2017-11-28 00:06:21.357 UTC","last_editor_display_name":"","last_editor_user_id":"2420301","owner_display_name":"","owner_user_id":"9017043","post_type_id":"1","score":"-1","tags":"lua","view_count":"72"} +{"id":"20303363","title":"Query results with the highest number","body":"\u003cp\u003eI wrote the following query that counts the \"type\" of subscription for each customer and displays the subscription name along with the number of customers associated with it. It works.\u003c/p\u003e\n\n\u003cp\u003eFor example:\u003c/p\u003e\n\n\u003cp\u003eSubscription A = 200 customers\nSubscription B = 57\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eselect \n subscription_name, count(subscription_name) as Num_of_Customers \nfrom \n subscription\n join customer on subscription.subscription_number=customer.subscription_number\ngroup by subscription_name;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat I can't figure out is how to display \"ONLY\" the subscription name that has the highest number of customers. \u003c/p\u003e\n\n\u003cp\u003eI would greatly appreciate your advice. Thanks.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-11-30 17:29:49.86 UTC","last_activity_date":"2013-12-01 19:48:52.51 UTC","last_edit_date":"2013-11-30 17:31:46.953 UTC","last_editor_display_name":"","last_editor_user_id":"1143825","owner_display_name":"","owner_user_id":"3052350","post_type_id":"1","score":"2","tags":"sql","view_count":"55"} +{"id":"25973307","title":"How does one set the stop word list on an App Engine Cloud SQL database using InnoDb?","body":"\u003cp\u003eI am using the MySQL 5.6 version of Cloud SQL on App Engine using InnoDB.\u003c/p\u003e\n\n\u003cp\u003eI want to enable full text search queries, but for my application it is essential to change the stop word list. Normally in MySQL this is possible by creating a table with the stop word list and using the \u003ccode\u003einnodb_ft_server_stopword_table\u003c/code\u003e config setting. See \u003ca href=\"http://dev.mysql.com/doc/refman/5.6/en/fulltext-stopwords.html\" rel=\"nofollow\"\u003efulltext-stopwords\u003c/a\u003e.\u003c/p\u003e\n\n\u003cp\u003eHow can this be done on Google Cloud SQL?\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","accepted_answer_id":"25980706","answer_count":"1","comment_count":"3","creation_date":"2014-09-22 11:43:21.09 UTC","last_activity_date":"2014-09-22 18:21:31.62 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2010061","post_type_id":"1","score":"0","tags":"google-app-engine|full-text-search|innodb|google-cloud-sql","view_count":"193"} +{"id":"47174538","title":"call read_text or read_multiple_texts function for multiple cID","body":"\u003cp\u003eI`ve been searching last days for how to call function read_text for multiple cID.Does anybody know how to do this for the code below: ? Thank you for your support.Now it works only when : cID = 'GRUN'. cObject = 'MATERIAL' and lTDNAME = lMVKE-MATNR. in know that function read_text can be called multiple times. Please provide an example if you know.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edata: it_MVKE type standard table of MVKE initial size 0.\n\ndata: lMVKE like MVKE, lMAKT like MAKT, lT002 like T002 ,\"lSTXL like STXL,\n lTDNAME like THEAD-TDNAME,\"text header\n\n it_TLINE type standard table of TLINE,\n wa_TLINE type TLINE, lText type string.\n\ntypes: begin of i_Report,\n MATNR(18) type c,\n MAKTX like MAKT-MAKTX,\n VKORG(5) type c,\n VTWEG(5) type c,\n SPRAS(2) type c,\n Text type string,\n \"tdid type c,\n end of i_Report.\n\ndata: wa_Report type i_Report,\n it_Report type standard table of i_Report initial size 0.\ndata: cObject(10) type c, cID(4) type c.\n\ntypes: begin of cids,\n cid(4) type c,\n cobject(10) type c,\n end of cids.\n\ndata: wa_cids type cids.\ndata: it_cids type standard table of cids.\n\nwa_cids-cid = 'GRUN'.\nwa_cids-cobject = 'MATERIAL'.\n\nappend wa_cids to it_cids.\n\n\n\n IF cID = '0001'. cObject = 'MVKE'.\n select * from MVKE into table it_MVKE\n where MATNR in Material.\" AND\n VKORG IN UnitLog.\n\n ELSE.\n select MATNR from MARA into corresponding fields of table it_MVKE\n where MATNR in Material order by MATNR.\n cID = 'PRUE'. cObject = 'MATERIAL'. \"Text verificare\n\n\n select MATNR from MARA into corresponding fields of table it_MVKE\n##too_many_itab_fields\n where MATNR in Material order by MATNR.\n cID = 'GRUN'. cObject = 'MATERIAL'. \"Basic View Text -text date principale \"\n\nendif.\n\nwa_Report-MATNR = 'MATNR'.\nwa_Report-MAKTX = 'MAKTX'.\nwa_Report-VKORG = 'VKORG'.\nwa_Report-VTWEG = 'VTWEG'.\nwa_Report-SPRAS = 'SPRAS'.\nwa_Report-Text = 'Text'.\nappend wa_Report to it_Report.\n\n\n\n\n\"https://archive.sap.com/discussions/thread/2084953\nloop at it_MVKE into lMVKE.\n if cID = '0001'. cObject = 'MVKE'.\n \"concatenate lMVKE-MATNR lMVKE-VKORG lMVKE-VTWEG into lTDNAME.\n else.\n lTDNAME = lMVKE-MATNR.\n endif.\n select spras from T002 into lT002. \"where WERKS in Unitlog.\"SPRAS in s_SPRAS.\n\n\nloop at it_cids into wa_cids.\n\n cID = 'GRUN'. cObject = 'MATERIAL'. \"Basic View Text -text date principale \n\n CALL FUNCTION 'READ_TEXT'\n EXPORTING\n CLIENT = SY-MANDT\n ID = cID\n LANGUAGE = lT002-SPRAS\n NAME = lTDNAME\n OBJECT = cObject\n TABLES\n LINES = it_TLINE\n EXCEPTIONS\n ID = 1\n OTHERS = 8.\n\nENDLOOP.\n\n IF SY-SUBRC EQ 0.\n select single * from MAKT into lMAKT where MATNR eq lMVKE-MATNR.\n select single * from MAKT into lMAKT where MATNR eq lMVKE-MATNR\n and SPRAS eq lT002-SPRAS. \"p_SPRAS.\n\n wa_Report-MATNR = lMVKE-MATNR.\n wa_Report-MAKTX = lMAKT-MAKTX.\n wa_Report-VKORG = lMVKE-VKORG.\n wa_Report-VTWEG = lMVKE-VTWEG.\n wa_Report-SPRAS = lT002-SPRAS. \"p_SPRAS.\n \"wa_report-tdid = lSTXL-tdid.\n LOOP AT it_TLINE INTO wa_TLINE.\n wa_Report-TEXT = wa_TLINE-TDLINE.\n append wa_Report to it_Report.\n ENDLOOP.\n ENDIF.\n \"endselect.\nendloop.\nloop at it_Report into wa_Report.\n write: / wa_Report-MATNR, wa_Report-MAKTX,\n wa_Report-VKORG, wa_Report-VTWEG, wa_Report-SPRAS, wa_Report-Text. \nendloop.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/ZIqGu.jpg\" rel=\"nofollow noreferrer\"\u003ePlease click here for Output photo:\u003c/a\u003e\u003c/p\u003e","answer_count":"0","comment_count":"13","creation_date":"2017-11-08 08:10:09.927 UTC","last_activity_date":"2017-11-13 06:03:42.047 UTC","last_edit_date":"2017-11-13 06:03:42.047 UTC","last_editor_display_name":"","last_editor_user_id":"8756987","owner_display_name":"","owner_user_id":"8756987","post_type_id":"1","score":"-3","tags":"sap|abap","view_count":"91"} +{"id":"11074961","title":"Building modules with linux kernel for custom flavor","body":"\u003cp\u003eI followed the instructions given in the link: \u003ca href=\"http://blog.avirtualhome.com/how-to-compile-a-new-ubuntu-11-04-natty-kernel/\" rel=\"nofollow\"\u003ehttp://blog.avirtualhome.com/how-to-compile-a-new-ubuntu-11-04-natty-kernel/\u003c/a\u003e for building a custom kernel and booting it. Everything works fine, except that when building it, I used the option skipmodule=true (as given in this link), so I guess the modules are not built for this kernel. So I have two questions:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eHow do I build only the modules for my flavor, now that I have the rest of the kernel built? 'make modules' will build it for generic flavor only, if I'm not wrong.\u003c/li\u003e\n\u003cli\u003eAlso does it require me to build the entire kernel source, 'fakeroot debian/rules binary-i5' (i5 is my custom falvor), each time I make a change to one of my modules?\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","accepted_answer_id":"11075932","answer_count":"1","comment_count":"3","creation_date":"2012-06-17 21:33:29.767 UTC","favorite_count":"1","last_activity_date":"2012-06-18 21:28:19.107 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"621136","post_type_id":"1","score":"0","tags":"operating-system|linux-kernel|kernel","view_count":"522"} +{"id":"7659144","title":"Is there any way to check if pointer is dangling?","body":"\u003cp\u003eI have a code where I use a pointer to access some datablock. In some rare cases, a few members of the datablock are empty, and as a result the pointer becomes dangling. In fact, I get the correct pointer but the program crashes when trying to do something with the pointer.\u003c/p\u003e\n\n\u003cp\u003eThe usual advice would be to avoid this type of usage. But sadly, the framework I use requires that I use this type of data access methods.\u003c/p\u003e\n\n\u003cp\u003eIs there a way I can \"check\" if the pointer is invalid before doing any operation with it? Checking that the pointer is not equal to NULL did not work, obviously. I also tried this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etry\n{\n CString csClassName = typeid(*pMyPointer).name(); // Check error condition\n // The line below fails due to dangling pointer (data block is not valid).\n hr = pMyPointer-\u0026gt;MyPointerMethod(); \n}\ncatch(bad_typeid)\n{\n return E_FAIL;\n}\ncatch(...)\n{\n return E_FAIL;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs it the correct way?\u003c/p\u003e","answer_count":"4","comment_count":"0","creation_date":"2011-10-05 09:24:16.713 UTC","favorite_count":"1","last_activity_date":"2017-08-03 14:57:46.73 UTC","last_edit_date":"2017-08-03 14:57:46.73 UTC","last_editor_display_name":"","last_editor_user_id":"2157640","owner_display_name":"","owner_user_id":"651141","post_type_id":"1","score":"8","tags":"c++|pointers|mfc|dangling-pointer","view_count":"4217"} +{"id":"13028500","title":"NSLocalizedStringFromTableInBundle : not getting values for key","body":"\u003cp\u003eI am not able to get \u003ccode\u003evalues\u003c/code\u003e for \u003ccode\u003ekeys\u003c/code\u003e from the \u003ccode\u003eInfoPlist\u003c/code\u003e.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elabel.text = NSLocalizedStringFromTableInBundle(@\"keyone\", \n nil, \n AppDelegateObj.langBundle, nil));\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn the \u003ccode\u003eInfoPlist.strings\u003c/code\u003e there is a value\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\"keyone\" = \"value one\";\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I am running my app it is showing \u003ccode\u003eUILabel\u003c/code\u003e value as \u003cstrong\u003ekeyone\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eWhy?\u003c/p\u003e","accepted_answer_id":"13028701","answer_count":"1","comment_count":"0","creation_date":"2012-10-23 10:34:18.283 UTC","last_activity_date":"2014-03-02 01:32:22.243 UTC","last_edit_date":"2014-03-02 01:32:22.243 UTC","last_editor_display_name":"","last_editor_user_id":"1552748","owner_display_name":"","owner_user_id":"1702515","post_type_id":"1","score":"3","tags":"ios|iphone|nslocalizedstring|localizable.strings","view_count":"4081"} +{"id":"42361352","title":"office web apps server 2013 - Got an server error when open /op/generate.aspx","body":"\u003cp\u003eI set up an office web apps server 2013 in windows server 2012 R2, it is good to open this link \u003ccode\u003ehttp://localhost/hosting/discovery\u003c/code\u003e, means the office web apss server 2013 is running well.\u003c/p\u003e\n\n\u003cp\u003eBut when I tried to open this link \u003ccode\u003ehttp://localhost/op/generate.aspx\u003c/code\u003e, it gives an error : \u003ccode\u003eA big red X\u003c/code\u003e, server error sorry for the mistake. We have recorded an error for the server administrator. \u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/wUAKM.jpg\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/wUAKM.jpg\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI was looking for some blogs, somesay that is causing by logging in the website with the system account, but I dont know what is the system account, and is that logging means the iis service?\u003c/p\u003e\n\n\u003cp\u003eI am not use WOPI and sharepoint, what I want is only use office web apps server 2013 to provide view \u0026amp; edit doc and docx files in browser.\u003c/p\u003e\n\n\u003cp\u003ePlease help, thanks!\u003c/p\u003e\n\n\u003cp\u003ePS. If the question not meet the requirement, comment it, I will edit it.\u003c/p\u003e\n\n\u003cp\u003eeidt 1 :\u003c/p\u003e\n\n\u003cp\u003eI had solve this problem, I had installed AD and OWA in one server.\u003c/p\u003e\n\n\u003cp\u003eInstall them in different server will ok.\u003c/p\u003e\n\n\u003cp\u003eBut there is another problem : \u003c/p\u003e\n\n\u003cp\u003eWhen open a word file, It gave an alert:\u003c/p\u003e\n\n\u003cp\u003eMicrosoft Word Web App\u003c/p\u003e\n\n\u003cp\u003esorry, some problem had appeared, cant open this file.\u003c/p\u003e\n\n\u003cp\u003eHow to fix this ...\u003c/p\u003e\n\n\u003cp\u003eupdate :\u003c/p\u003e\n\n\u003cp\u003eI finally solved it by changing another server to install OWA.\u003c/p\u003e","accepted_answer_id":"42479242","answer_count":"1","comment_count":"0","creation_date":"2017-02-21 07:42:13.437 UTC","last_activity_date":"2017-11-29 07:47:50.293 UTC","last_edit_date":"2017-11-29 07:47:50.293 UTC","last_editor_display_name":"","last_editor_user_id":"5333071","owner_display_name":"","owner_user_id":"5333071","post_type_id":"1","score":"0","tags":"ms-office|ms-wopi","view_count":"212"} +{"id":"4753037","title":"Formatting Countup Timer Javascript","body":"\u003cp\u003eI am using the following code to display a count up clock\nThe Minutes and Seconds are formatting fine, but Hours are being show as a negative number eg \"-238\"\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;script language=\"javascript\" type=\"text/javascript\"\u0026gt;\n var startTime = new Date(2011,01,21,08,55, 0)\n\n $(document).ready(function () {\n setTimeout(updateClock, 1000);\n });\n function updateClock() {\n var timeField = $(\".timeSince\");\n var currentTime = new Date();\n var difference = currentTime - startTime;\n timeField.html(MillisecondsToDuration(difference));\n setTimeout(updateClock, 1000);\n }\n function MillisecondsToDuration(n) { \n var hms = \"\"; \n\n var dtm = new Date(); \n dtm.setTime(n); \n var h = \"000\" + Math.floor(n / 3600000); \n var m = \"0\" + dtm.getMinutes(); \n var s = \"0\" + dtm.getSeconds(); \n\n\n hms = h.substr(h.length-4) + \" hours, \" + m.substr(m.length-2) + \" mins, \"; \n hms += s.substr(s.length-2) + \" secs\";\n return hms; \n } \n \u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2011-01-20 21:50:34.29 UTC","favorite_count":"1","last_activity_date":"2016-12-29 12:32:22.563 UTC","last_edit_date":"2016-12-29 12:32:22.563 UTC","last_editor_display_name":"","last_editor_user_id":"1033581","owner_display_name":"","owner_user_id":"374745","post_type_id":"1","score":"0","tags":"javascript|time","view_count":"642"} +{"id":"31840176","title":"Changing language on the fly in swift","body":"\u003cp\u003eNow I know that apple does not recommend this.\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eIn general, you should not change the iOS system language (via use of the AppleLanguages pref key) from within your application. This goes against the basic iOS user model for switching languages in the Settings app, and also uses a preference key that is not documented, meaning that at some point in the future, the key name could change, which would break your application.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eHowever, this is an application that changing the language on the fly makes sense, just trust me on that. I also know this question was asked here: \u003ca href=\"https://stackoverflow.com/questions/5109245/changing-language-on-the-fly-in-running-ios-iphone-app\"\u003eChanging language on the fly, in running iOS, programmatically\u003c/a\u003e. This however is getting old and I was wondering if there are any newer, better, or easier ways to do this. Currently in my app, I have a language choosing screen. Clicking on of the buttons in this view calls the following function with the language the button is associated with: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e func changeLang(language: String) {\n\n if language != (currentLang as! String?)! {\n func handleCancel(alertView: UIAlertAction!)\n {\n\n }\n var alert = UIAlertController(title: NSLocalizedString(\"language\", comment: \"Language\"), message: NSLocalizedString(\"languageWarning\", comment: \"Warn User of Language Change Different Than Defaults\"), preferredStyle: UIAlertControllerStyle.Alert)\n\n alert.addAction(UIAlertAction(title: \"Cancel\", style: UIAlertActionStyle.Cancel, handler:handleCancel))\n alert.addAction(UIAlertAction(title: \"Yes\", style: UIAlertActionStyle.Default, handler:{ (UIAlertAction) in\n\n NSUserDefaults.standardUserDefaults().setObject([language], forKey: \"AppleLanguages\")\n NSUserDefaults.standardUserDefaults().synchronize()\n println(self.currentLang)\n\n let alert = UIAlertView()\n alert.title = NSLocalizedString(\"language\", comment: \"Sign In Failed\")\n alert.message = NSLocalizedString(\"languageChangeNotification\", comment: \"Notify of language change\")\n alert.addButtonWithTitle(NSLocalizedString(\"ok\", comment: \"Okay\"))\n alert.show()\n\n self.performSegueWithIdentifier(\"welcome\", sender: AnyObject?())\n\n\n }))\n self.presentViewController(alert, animated: true, completion: {\n })\n } else {\n self.performSegueWithIdentifier(\"welcome\", sender: AnyObject?())\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eExample:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@IBAction func english(sender: UIButton) {\n changeLang(\"en\")\n\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf the user picks a language different than their own, they get a confirmation alert, and then are requested to restart there device. This is what I want to change. It appears that this section of NSUSerDefaults is not synchronized until the app restarts. Evidence:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elet currentLang: AnyObject? = NSLocale.preferredLanguages()[0]\nprintln(currentLang)\n// Prints english\nchangeLang(\"zh-Hans\")\nprintln(currentLang)\n// Prints english still until restart \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe current internationalization system apple has is great, and I plan on using it. However, how can I change the language on the fly, maybe by forcing an update on the NSUSerDefaults?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdit:\u003c/strong\u003e I recommend using this \u003ca href=\"https://github.com/marmelroy/Localize-Swift\" rel=\"nofollow noreferrer\"\u003elibrary\u003c/a\u003e to do this now. Best of luck!\u003c/p\u003e","accepted_answer_id":"31887430","answer_count":"2","comment_count":"0","creation_date":"2015-08-05 18:31:06.98 UTC","favorite_count":"6","last_activity_date":"2016-09-29 06:45:17.68 UTC","last_edit_date":"2017-05-23 12:18:10.873 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"5030164","post_type_id":"1","score":"9","tags":"ios|iphone|swift|internationalization|nsuserdefaults","view_count":"12358"} +{"id":"30076266","title":"Boostrap Datepicker performance issue on large number of date input items","body":"\u003cp\u003eI need to initialize large number of dynamically created \u003ccode\u003edatepicker\u003c/code\u003e input in UI but I only got bad performance and even crashing of browsers. I dynamically create more than 10 input field (10 to 100), and after that I call initialization of plugin. In that moment everything start lagging and even crashing. \u003c/p\u003e\n\n\u003cp\u003eI'm using this bootstrap plugin \u003ca href=\"https://github.com/eternicode/bootstrap-datepicker\" rel=\"nofollow\"\u003ebootstrap-datepicker\u003c/a\u003e\nDoes anybody have some idea how to make this to work fine. Maybe some idea from different approach. \u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-05-06 12:07:11.697 UTC","last_activity_date":"2015-05-06 13:11:44.413 UTC","last_edit_date":"2015-05-06 13:11:44.413 UTC","last_editor_display_name":"","last_editor_user_id":"3965631","owner_display_name":"","owner_user_id":"1827768","post_type_id":"1","score":"3","tags":"javascript|jquery|twitter-bootstrap|bootstrap-datepicker","view_count":"167"} +{"id":"22446768","title":"Child view controller in UICollectionViewCell","body":"\u003cp\u003eSuppose I want to achieve Pinterest's pin page, like this one:\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/oqe3m.png\" alt=\"pinterest\"\u003e\u003c/p\u003e\n\n\u003cp\u003eThis is my approach:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003emake a \u003ccode\u003eUICollectionViewController\u003c/code\u003e, pin's page is a \u003ccode\u003eUICollectionViewCell\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003ecell is make of two components: pin info child vc \u0026amp;\u0026amp; waterfall child vc\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eThen comes the problem: How can I reuse child view controller?\u003c/p\u003e\n\n\u003cp\u003eSome pseudo code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath\n{\n UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@\"Cell\" forIndexPath:indexPath];\n Pin *pin = self.dataSource[indexPath.row];\n // i have to create a new childVC, based on different indexPath.\n UITableViewController *pinInfoViewController = [[pinInfoViewController alloc] initWithPin:pin];\n [cell updatePinViewWithPin:pin];\n [self addChildViewController:pinInfoViewController];\n\n // Add waterfall view controller\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eEvery time this method is called, a new child view controller will be created, is it ok, or how to improve it?\u003c/p\u003e","accepted_answer_id":"22447269","answer_count":"3","comment_count":"0","creation_date":"2014-03-17 04:06:06.673 UTC","favorite_count":"3","last_activity_date":"2015-09-24 21:10:40.013 UTC","last_edit_date":"2014-03-17 04:18:34.323 UTC","last_editor_display_name":"","last_editor_user_id":"3215948","owner_display_name":"","owner_user_id":"94962","post_type_id":"1","score":"6","tags":"ios|objective-c|uicollectionview|childviewcontroller","view_count":"4202"} +{"id":"40049192","title":"C# - Using Linq to SQL with XML Serialization","body":"\u003cp\u003eThere is something i don't quite understand when using Linq to SQL and XML serialization on \u003cstrong\u003esome\u003c/strong\u003e of my object's properties.\u003c/p\u003e\n\n\u003cp\u003eRegularly i'd create my tables, and then use Linq to SQL to generate all my classes. But now since i serialize some of my classes properties, when creating the database tables, i define these properties as varchar (for the XML string) instead of the actual type that they are. So the auto-generated classes are created with string typed properties instead of the actual classes.\u003c/p\u003e\n\n\u003cp\u003eIs there a way to tell Linq to apply my de/serialization automatically when inserting/fetching objects from the database? And keep the original type for my serialized properties in the Linq auto-generated classes?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eA Class for example\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eNotice that classBProp is of type ClassB.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass ClassA\n{\n private string name;\n public string Name\n {\n get { return name; }\n set { name = value; }\n }\n\n private ClassB classBProp; // \u0026lt;-- This is something i'm serializing\n public ClassB ClassBProp\n {\n get { return classBProp; }\n set { classBProp = value; }\n }\n\n public ClassA()\n {\n classBProp = new ClassB();\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eThe table for the class\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eHere ClassBProp is of type varchar. So Linq to SQL generates the class with a string property.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCREATE TABLE [dbo].[ClassA] (\n[Id] INT NOT NULL,\n[Name] VARCHAR (50) NULL,\n[ClassBProp] VARCHAR (MAX) NULL,\nPRIMARY KEY CLUSTERED ([Id] ASC)\n);\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"40049529","answer_count":"1","comment_count":"0","creation_date":"2016-10-14 17:49:10.517 UTC","last_activity_date":"2016-10-14 21:28:29.577 UTC","last_edit_date":"2016-10-14 21:28:29.577 UTC","last_editor_display_name":"","last_editor_user_id":"1568438","owner_display_name":"","owner_user_id":"1568438","post_type_id":"1","score":"0","tags":"c#|xml|serialization|linq-to-sql|xml-serialization","view_count":"155"} +{"id":"35745718","title":"Directx application commercial distribution","body":"\u003cp\u003eCan I distribute any Directx based application commercially? Do I need to get any permission from Microsoft? Actually I'm developing a software such like \"Rendering Engine\". But I don't know much about the EULA.\nI also have the same issue with OPENGL and Metal.\nNote: I'm not using Visual Studio for the development.\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2016-03-02 11:19:06.91 UTC","last_activity_date":"2016-03-03 04:59:47.987 UTC","last_edit_date":"2016-03-02 11:24:20.1 UTC","last_editor_display_name":"","last_editor_user_id":"5676367","owner_display_name":"","owner_user_id":"5676367","post_type_id":"1","score":"0","tags":"opengl|directx|metal|commercial-application","view_count":"62"} +{"id":"30011399","title":"initializing view holder for array list row widgets - is my approach wrong?","body":"\u003cp\u003eI'm adding view holder to the row of \u003ccode\u003eListView\u003c/code\u003e to store widgets. Here is how I do it:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic View getView(int position, View row, ViewGroup parent) {\n // Check if an existing view is being reused, otherwise inflate the view\n if (row == null) {\n row = LayoutInflater.from(getContext()).inflate(R.layout.articles_list_row, parent, false);\n row.setTag(R.id.articles_list_row_widgets_holder, new TextListRowHolder(row));\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm also reading a book where an author initializes it like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eViewHolder holder=(ViewHolder)row.getTag();\nif (holder==null) {\n holder=new ViewHolder(row);\n row.setTag(holder);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is the quote from the book:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eIf the call to getTag() on the row returns null, we know we need to\n create a new ViewHolder, which we then attach to the row via setTag()\n for later reuse.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eIs my approach wrong? I assume that if row is null then there is no holder attached, and if the row is already created than the holder is already attached.\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2015-05-03 07:38:32.357 UTC","last_activity_date":"2015-05-03 08:06:56.983 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2545680","post_type_id":"1","score":"-1","tags":"android","view_count":"91"} +{"id":"24219690","title":"inline namespace and extension namespace","body":"\u003cp\u003eI read the section about namespace definition. Clause 7.3.1 of N3797 said:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eThe inline keyword may be used on an extension-namespace-definition\n only if it was previously used on the original-namespace-definition\n for that namespace.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eConsider the following code snippet:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enamespace M\n{\n int h;\n}\n\ninline namespace M\n{\n int j = 6;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt compiled successful both with the \u003ccode\u003e-std=c++11\u003c/code\u003e and without that option. Can you explain that behavior? Is it a \u003ccode\u003eg++\u003c/code\u003e bug?\u003c/p\u003e","accepted_answer_id":"24220589","answer_count":"1","comment_count":"0","creation_date":"2014-06-14 11:59:41.217 UTC","favorite_count":"1","last_activity_date":"2014-06-14 14:18:06.88 UTC","last_editor_display_name":"","owner_display_name":"user2953119","post_type_id":"1","score":"5","tags":"c++|namespaces|g++|inline","view_count":"274"} +{"id":"5216959","title":"HTML CSS Problem","body":"\u003cp\u003eplease check this URL.\n\u003ca href=\"http://works.ebexsoft.com/destin/\" rel=\"nofollow\"\u003ehttp://works.ebexsoft.com/destin/\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThere is an unexpected margin/padding in the bottom. I have used css like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@charset \"utf-8\";\nbody{margin:0; color:#232323; padding:0; background: #FDF8E4 url(images/bg.jpg) repeat-x;}\n* {margin:0; padding:0}\nhtml, body {margin: 0; padding: 0:}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut the space is not removing. What can I do? Please help.\u003c/p\u003e","accepted_answer_id":"5217029","answer_count":"3","comment_count":"0","creation_date":"2011-03-07 07:26:09.093 UTC","last_activity_date":"2011-03-07 07:36:24.867 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"431472","post_type_id":"1","score":"0","tags":"html|css","view_count":"54"} +{"id":"41825999","title":"Registration Error running code with Liquid-XML Lib","body":"\u003cp\u003eI have a problem running my Liquid-XML Project on production machine. The liquid xml license is ok. I recreated the class lib with liquid xml studio but no changes at the error front.\u003c/p\u003e\n\n\u003cp\u003ecmd line gives me these informations:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eAusnahmefehler: System.TypeInitializationException: Der\n Typeninitialisierer für \"myLib.Registration\" hat eine Ausnahme\n verursacht. \n ---\u003e System.ArgumentException: Ein Element mit dem gleichen Schlüssel wurde bereits hinzugefügt. bei\n System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value,\n Boolean add) bei myLib.Registration.RegisterLicense() in\n [PATH]\\coding\\my.xsd.Output\\SourceCodeVBNet\\Enumerations.vb:Zeile 53.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eLine 53 is the license register code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eLiquidTechnologies.Runtime.Net45.XmlObjectBase.Register(\"company xyz\", \"my.xsd\",\"somecharshere\")\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny ideas?\u003c/p\u003e","accepted_answer_id":"41829936","answer_count":"1","comment_count":"0","creation_date":"2017-01-24 10:39:04.63 UTC","last_activity_date":"2017-01-24 13:50:28.907 UTC","last_edit_date":"2017-01-24 11:16:55.39 UTC","last_editor_display_name":"","last_editor_user_id":"5088142","owner_display_name":"","owner_user_id":"7462304","post_type_id":"1","score":"0","tags":"liquid-xml","view_count":"44"} +{"id":"12415026","title":"Relationship between struct s { T0 t0; T1 t1; ... } and std::tuple\u003cT0,T1,...\u003e t","body":"\u003cp\u003eIn particular if Tj are built-in types or pointers to built-in types does anyone know of a compiler that does not lay out the memory so \u003ccode\u003eoffsetof(s, tj) != \u0026amp;get\u0026lt;j\u0026gt;(t) - \u0026amp;get\u0026lt;0\u0026gt;(t)\u003c/code\u003e?\u003c/p\u003e","answer_count":"1","comment_count":"5","creation_date":"2012-09-13 21:25:37.65 UTC","last_activity_date":"2012-09-13 23:12:31.667 UTC","last_edit_date":"2012-09-13 22:14:09.887 UTC","last_editor_display_name":"","last_editor_user_id":"596781","owner_display_name":"","owner_user_id":"394744","post_type_id":"1","score":"-1","tags":"c++|c++11|tuples","view_count":"124"} +{"id":"7584918","title":"Dependant Observable Array in Knockout JS","body":"\u003cp\u003eI have started to play around with knockoutjs and do some simple binding/dependant binding.\nMy goal is to have 1 \u003ccode\u003e\u0026lt;select\u0026gt;\u003c/code\u003e list populated based on the value of another \u003ccode\u003e\u0026lt;select\u0026gt;\u003c/code\u003e list. Both are being loaded from an ajax call to my asp.net webservice.\u003c/p\u003e\n\n\u003cp\u003eSo I have two \u003ccode\u003e\u0026lt;select\u0026gt;\u003c/code\u003e lists\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;select id=\"make\" data-bind=\"options: availableMakes, value: selectedMake, optionsText: 'text', optionsCaption: 'Choose a make'\"\u0026gt;\u0026lt;/select\u0026gt;\n\u0026lt;select id=\"model\" data-bind=\"options: availableModels, value: selectedModel, optionsText: 'text', optionsCaption: 'Choose a model'\"\u0026gt;\u0026lt;/select\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThen my javascript looks like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(function () {\n\n // creating the model\n var option = function (text, value) {\n this.text = text;\n this.value = value;\n }\n\n // creating the view model\n var searchModel = {\n availableMakes: ko.observableArray([]),\n availableModels: ko.observableArray([]),\n selectedMake: ko.observable(),\n selectedModel: ko.observable()\n }\n\n // adding in a dependentObservable to update the Models based on the selected Make\n searchModel.UpdateModels = ko.dependentObservable(function () {\n var theMake = searchModel.selectedMake() ? searchModel.selectedMake().text : '';\n if (theMake != '') {\n $.ajax({\n url: \"/data/service/auction.asmx/GetModels\",\n type: 'GET',\n contentType: \"application/json; charset=utf-8\",\n data: '{make:\"' + theMake + '\"}',\n success: function (data) {\n var makes = (typeof data.d) == 'string' ? eval('(' + data.d + ')') : data.d;\n var mappedModels = $.map(makes, function (item) {\n return new option(item.text, item.value);\n });\n searchModel.availableModels(mappedModels);\n },\n dataType: \"json\"\n });\n }\n else {\n searchModel.availableModels([]);\n }\n return null;\n }, searchModel);\n\n // binding the view model\n ko.applyBindings(searchModel);\n\n // loading in all the makes\n $.ajax({\n url: \"/data/service/auction.asmx/GetMakes\",\n type: 'GET',\n contentType: \"application/json; charset=utf-8\",\n data: '',\n success: function (data) {\n var makes = (typeof data.d) == 'string' ? eval('(' + data.d + ')') : data.d;\n var mappedMakes = $.map(makes, function (item) {\n return new option(item.text, item.value);\n });\n searchModel.availableMakes(mappedMakes);\n },\n dataType: \"json\"\n });\n\n });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCurrently this works as expected, but I think that I am doing this wrong as the code looks pretty long, and I could do this without using knockoutjs in less code.\nAlso the way that I am loading up the \u003ccode\u003eavailableModels\u003c/code\u003e is obviously not correct because I am using a dependentObsevable called \u003ccode\u003eUpdateModels\u003c/code\u003e which I added in order to load up the \u003ccode\u003eavailableModels\u003c/code\u003e based on the value of \u003ccode\u003eselectedMake().text\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eI hope this makes sense and you can point out an improved version of this? Or tell me simply \u003cstrong\u003eHow do I reload the Models based on the Make selection?\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eMany Thanks,\u003c/p\u003e","accepted_answer_id":"7585595","answer_count":"2","comment_count":"0","creation_date":"2011-09-28 14:34:26.963 UTC","last_activity_date":"2011-12-30 01:59:45.693 UTC","last_edit_date":"2011-10-04 20:36:23.26 UTC","last_editor_display_name":"","last_editor_user_id":"29","owner_display_name":"","owner_user_id":"177988","post_type_id":"1","score":"1","tags":"jquery|knockout.js|ko.dependentobservable|ko.observablearray","view_count":"4741"} +{"id":"20116746","title":"Value INSERT of type java.lang.String cannot be converted to JSONArray Android push notification","body":"\u003cp\u003eI am implementing gcm push notification. When the device is registered for the first time i get a warning Value INSERT of type java.lang.String cannot be converted to JSONArray \n shown in the log.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprotected JSONArray doInBackground(Void... params) {\n try {\n HttpClient httpclient = new DefaultHttpClient();\n HttpPost httppost = new HttpPost(\"....registration?devicefamily=android\");\n\n // Add your data\n httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));\n\n // Execute HTTP Post Request\n HttpResponse response = httpclient.execute(httppost);\n\n BufferedReader reader = new BufferedReader(new InputStreamReader(response.getEntity().getContent(), \"iso-8859-1\"), 8);\n StringBuilder sb = new StringBuilder();\n sb.append(reader.readLine() + \"\\n\");\n String line = \"0\";\n while ((line = reader.readLine()) != null) {\n sb.append(line + \"\\n\");\n }\n reader.close();\n String result11 = sb.toString();\n\n System.out.println(\"URL RETURN \"+result11);\n\n // parsing data\n return new JSONArray(result11);\n } catch (Exception e) {\n e.printStackTrace();\n return null;\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eLogcat:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e11-21 13:13:27.360: W/System.err(25760): org.json.JSONException: Value INSERT of type java.lang.String cannot be converted to JSONArray\n11-21 13:13:27.360: W/System.err(25760): at org.json.JSON.typeMismatch(JSON.java:111)\n11-21 13:13:27.360: W/System.err(25760): at org.json.JSONArray.\u0026lt;init\u0026gt;(JSONArray.java:91)\n11-21 13:13:27.360: W/System.err(25760): at org.json.JSONArray.\u0026lt;init\u0026gt;(JSONArray.java:103)\n11-21 13:13:27.360: W/System.err(25760): at packageutil.FetchTask.doInBackground(FetchTask.java:44)\n11-21 13:13:27.365: W/System.err(25760): at packageutil.FetchTask.doInBackground(FetchTask.java:1)\n11-21 13:13:27.365: W/System.err(25760): at android.os.AsyncTask$2.call(AsyncTask.java:287)\n11-21 13:13:27.365: W/System.err(25760): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)\n11-21 13:13:27.365: W/System.err(25760): at java.util.concurrent.FutureTask.run(FutureTask.java:137)\n11-21 13:13:27.365: W/System.err(25760): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)\n11-21 13:13:27.365: W/System.err(25760): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)\n11-21 13:13:27.365: W/System.err(25760): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)\n11-21 13:13:27.365: W/System.err(25760): at java.lang.Thread.run(Thread.java:856)\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"4","creation_date":"2013-11-21 09:17:37.81 UTC","last_activity_date":"2013-11-21 09:30:38.463 UTC","last_edit_date":"2013-11-21 09:30:38.463 UTC","last_editor_display_name":"","last_editor_user_id":"1839336","owner_display_name":"","owner_user_id":"1846616","post_type_id":"1","score":"0","tags":"android|json|google-cloud-messaging","view_count":"438"} +{"id":"16375072","title":"Unable to find ant program","body":"\u003cp\u003eI am an experienced (but retired) Windows software developer, with more years experience than I care to admit, developing in C++, C#, VB and Java. I therefore decided to have a crack at Android development. My development machine is a Windows 7 box. My IDE of choice would be Microsoft Visual Studio but, for now, I am happy doing hand editing and launching tools from the command line.\u003c/p\u003e\n\n\u003cp\u003eI started by downloading the Android SDK and various additional items it suggested. I then started working my way through the tutorial at developer.android.com/training/basics/firstapp. Android list targets gave me a couple of choices (Android 4.2.2 and Google APIs:17). I then did Android create project from the command line and that appeared to do its stuff, creating MyFirstApp in my development folder. I then ran Android avd and created an emulator. I also added the android SDK's tools and platform-tools to my path. So far so good.\u003c/p\u003e\n\n\u003cp\u003eI fell at the next hurdle. The tutorial told me to change to the root folder of my project and run ant debug. At this point, Windows reports:\n 'ant' is not recognized as an internal or external command,\n operable program or batch file.\u003c/p\u003e\n\n\u003cp\u003eI've searched around for ant.exe without success. Did I miss installing something or did I miss a vital step in the set-up? Any advice for this very green newbie would be greatly appreciated.\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2013-05-04 13:56:39.33 UTC","last_activity_date":"2013-05-04 14:08:48.77 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2349906","post_type_id":"1","score":"-3","tags":"ant","view_count":"143"} +{"id":"16555502","title":"Why does the sequence of parameters matter in SQL","body":"\u003cp\u003eI think this is entry-level, but I haven't googled any answer out..\u003c/p\u003e\n\n\u003cp\u003eWhen building queries, do we have to use the :1, :2... stuff in an absolute sequence? From my tests, it seems yes. But doesn't calling stmt-\u003esetXXX(n, val) just set the nth parameter in the statement with val? How is it implemented?\u003c/p\u003e\n\n\u003cp\u003ePlease see my example below:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e if (bNewContent) //new\n {\n sql = \"BEGIN PackProductManagement.procAddOTTContent(:1, :2, :3, :4, :5, :6, :7); END; \";\n }\n else //update\n {\n sql = \"UPDATE OTT_Content SET ContentID = :1, ContentType = :2, FingerPrint = :3, IsHighLevelSafe = :4, \";\n sql += \"OutProtection = :5, OfflinePlayback = :6, ModifyTime = sysdate \";\n sql += \"WHERE ContentID = :1\";\n }\n try\n {\n OpenStatement(sql);\n stmt-\u0026gt;setString(1, ac-\u0026gt;ContentDesc.ContentID);\n stmt-\u0026gt;setUInt(2, ac-\u0026gt;ContentDesc.ContentType);\n stmt-\u0026gt;setUInt(3, ac-\u0026gt;ContentDesc.FingerPrint);\n stmt-\u0026gt;setUInt(4, ac-\u0026gt;ContentDesc.HighLevelSafe);\n stmt-\u0026gt;setUInt(5, ac-\u0026gt;ContentDesc.OutputProtection);\n stmt-\u0026gt;setUInt(6, ac-\u0026gt;ContentDesc.OfflinePlayback);\n if (bNewContent)\n {\n stmt-\u0026gt;setUInt(7, 0); //only used if new\n }\n stmt-\u0026gt;execute();\n\n CloseStatement(true);\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn this example, \u003ccode\u003ebNewContent\u003c/code\u003e is always FALSE, so we're always running the update statement. The above query works OK. But if I change the update query like below (removed \u003ccode\u003eContentID = :1,\u003c/code\u003e at the beginning of the update statement), I'll get an ORA-01722 INVALID_NUMBER. Why can't I do :2:3:4:5:6:1? If setXXX is implemented like a queue, why the above :1:2:3:4:5:6:1 work??\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esql = \"UPDATE OTT_Content SET ContentType = :2, FingerPrint = :3, IsHighLevelSafe = :4, \";\nsql += \"OutProtection = :5, OfflinePlayback = :6, ModifyTime = sysdate \";\nsql += \"WHERE ContentID = :1\";\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks in advance!\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdited:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eTest results below: (based on ZZa's answer)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esql = \"UPDATE OTT_Content SET ContentID = :x ContentType = :x, FingerPrint = :x, IsHighLevelSafe = :x, \";\nsql += \"OutProtection = :x, OfflinePlayback = :x, ModifyTime = sysdate \";\nsql += \"WHERE ContentID = :x\";\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAbove code doesn't work with 6 parameters.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esql = \"UPDATE OTT_Content SET ContentID = :1 ContentType = :x, FingerPrint = :x, IsHighLevelSafe = :x, \";\nsql += \"OutProtection = :x, OfflinePlayback = :x, ModifyTime = sysdate \";\nsql += \"WHERE ContentID = :1\";\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAbove code works with 6 parameters.\u003c/p\u003e","accepted_answer_id":"16560379","answer_count":"2","comment_count":"7","creation_date":"2013-05-15 01:49:45.29 UTC","last_activity_date":"2013-05-15 09:07:48.43 UTC","last_edit_date":"2013-05-15 09:07:48.43 UTC","last_editor_display_name":"","last_editor_user_id":"1338884","owner_display_name":"","owner_user_id":"1338884","post_type_id":"1","score":"3","tags":"sql|oracle","view_count":"534"} +{"id":"27247672","title":"White Background on the whole website length","body":"\u003cp\u003eI have a display problem in my web site content.\nI am creating a website and it displays well on the browser (width 100%) But when I resize the browser screen and I made a transition to the right with the bottom scroll bar a white background appeared. \nI'm not using the responsive technique.\nI work with a fixed container width (width: 1170px; margin: 0 auto;)\u003c/p\u003e\n\n\u003cp\u003ethe website: \u003ca href=\"http://www.lemediterranee.com.tn/medet/\" rel=\"nofollow\"\u003ehttp://www.lemediterranee.com.tn/medet/\u003c/a\u003e\u003c/p\u003e","answer_count":"3","comment_count":"2","creation_date":"2014-12-02 10:56:27.06 UTC","last_activity_date":"2014-12-02 11:13:50.443 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3809251","post_type_id":"1","score":"-1","tags":"html|css","view_count":"59"} +{"id":"37980000","title":"Prevent printing spaces in C# TextBox","body":"\u003cp\u003eI want to make a TextBox that doesn't allow entering spaces. I disabled typing spaces with the keyboard:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evoid textBox_KeyPress(object sender, KeyPressEventArgs e)\n{\n if (e.KeyChar == (char)Keys.Space)\n {\n e.Handled = true;\n } \n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut if the user copies a string with spaces like \"Hello world\", he can paste it into the TextBox and there will be spaces in it.\u003c/p\u003e","answer_count":"3","comment_count":"2","creation_date":"2016-06-22 23:46:27.56 UTC","last_activity_date":"2016-06-23 12:30:49.317 UTC","last_edit_date":"2016-06-23 12:30:49.317 UTC","last_editor_display_name":"","last_editor_user_id":"23528","owner_display_name":"","owner_user_id":"6484212","post_type_id":"1","score":"1","tags":"c#|winforms|textbox","view_count":"79"} +{"id":"20780309","title":"Unexpected behaviour of pre increment operator in C","body":"\u003cpre\u003e\u003ccode\u003e #include \u0026lt;stdio.h\u0026gt;\n void main()\n {\n int i = -3, j=2, k=0, m;\n m= ++i|| ++j \u0026amp;\u0026amp; ++k; \n printf(\"%d%d%d%d\", i, j, k, m);\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf we see order of evaluation in \u003ccode\u003e++i|| ++j \u0026amp;\u0026amp; ++k;\u003c/code\u003e we will come up with evaluation of \u003ccode\u003e++j \u0026amp;\u0026amp; ++k\u003c/code\u003e at first it will increment value of j and k and it will evaluate as 1 after that \n\u003ccode\u003e++i || 1\u003c/code\u003e will evaluate which will increment value of i and assign 1 to m so output should be \u003ccode\u003e-2 3 1 1\u003c/code\u003e but it's giving output \u003ccode\u003e-2 2 0 1\u003c/code\u003e I think i am missing some concept here.\u003c/p\u003e","accepted_answer_id":"20780336","answer_count":"4","comment_count":"1","creation_date":"2013-12-26 06:38:18.62 UTC","last_activity_date":"2013-12-26 09:24:10.077 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"430803","post_type_id":"1","score":"0","tags":"c","view_count":"72"} +{"id":"20607479","title":"change text in listbox without changing values","body":"\u003cp\u003ei have a listbox that adds the ids from a dictionary to the listbox but i need it to display the name and not the id but the value of the item has to be the id is there any way to do this heres the code i use\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public static Dictionary\u0026lt;int, CardInfos\u0026gt; CardDataeff = new Dictionary\u0026lt;int, CardInfos\u0026gt;();\n\n\n private void textBox2_TextChanged(object sender, EventArgs e)\n {\n lock (Searchlock)\n {\n if (textBox2.Text == \"\")\n {\n listBox2.Items.Clear();\n return;\n }\n if (textBox2.Text != \"Search\")\n {\n listBox2.Items.Clear();\n foreach (int card in CardDataeff.Keys)\n {\n if (CardDataeff[card].Id.ToString().ToLower().StartsWith(textBox2.Text.ToLower()) ||\n CardDataeff[card].Name.ToLower().Contains(textBox2.Text.ToLower()))\n {\n listBox2.Items.Add(CardDataeff[card].Id.ToString());\n }\n }\n }\n }\n }\n\n public void listBox2_DrawItem(object sender, DrawItemEventArgs e)\n {\n e.DrawBackground();\n\n bool selected = ((e.State \u0026amp; DrawItemState.Selected) == DrawItemState.Selected);\n\n int index = e.Index;\n if (index \u0026gt;= 0 \u0026amp;\u0026amp; index \u0026lt; listBox2.Items.Count)\n {\n string text = listBox2.Items[index].ToString();\n Graphics g = e.Graphics;\n\n CardInfos card = CardDataeff[Int32.Parse(text)];\n\n g.FillRectangle((selected) ? new SolidBrush(Color.Blue) : new SolidBrush(Color.White), e.Bounds);\n\n // Print text\n g.DrawString((card.Name == \"\" ? card.Id.ToString() : card.Name), e.Font, (selected) ? Brushes.White : Brushes.Black,\n listBox2.GetItemRectangle(index).Location);\n }\n\n e.DrawFocusRectangle();\n }\n\n private bool LoadCard(int cardid)\n {\n if (!CardDataeff.ContainsKey(cardid))\n {\n return false;\n }\n\n CardInfos info = CardDataeff[cardid];\n\n if (!string.IsNullOrEmpty(this.richTextBox1.Text))\n {\n if (MessageBox.Show(\"do you want to save? \", \"Prompt\", MessageBoxButtons.YesNoCancel) == DialogResult.Yes)\n {\n if (string.IsNullOrEmpty(this.filePath))\n {\n this.saveFileDialog1.InitialDirectory = this.scriptFolderPath;\n this.saveFileDialog1.FileName = this.getFileName();\n if (this.saveFileDialog1.ShowDialog() != DialogResult.OK)\n this.saveFile(this.saveFileDialog1.FileName);\n }\n else\n {\n this.saveFile(this.filePath);\n }\n } \n }\n this.openFile(cdbdir + \"\\\\script\\\\c\" + cardid + \".lua\");\n return true;\n }\n\n\n private void listBox2_DoubleClick(object sender, EventArgs e)\n {\n ListBox list = (ListBox)sender;\n if (list.SelectedIndex \u0026gt;= 0)\n {\n LoadCard(Int32.Parse(list.SelectedItem.ToString()));\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ei included all code that i think is necessary\u003c/p\u003e","accepted_answer_id":"20607636","answer_count":"2","comment_count":"0","creation_date":"2013-12-16 09:36:35.317 UTC","last_activity_date":"2013-12-16 10:23:04.023 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2551972","post_type_id":"1","score":"0","tags":"c#|listbox","view_count":"233"} +{"id":"44044924","title":"node-forever seems not working as I expected","body":"\u003cpre\u003e\u003ccode\u003e// test.js\n\nvar util = require('util');\n\nsetTimeout(function () {\n util.puts('Throwing error now.');\n throw new Error('User generated fault.');\n}, 200);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003ccode\u003e$ forever start -l ./forever.log -o output.log -e err.log -m 5 -a start test.js\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eI run the above command, and get:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ewarn: --minUptime not set. Defaulting to: 1000ms\nwarn: --spinSleepTime not set. Your script will exit if it does not stay up for at least 1000ms\ninfo: Forever processing file: test_debug.js\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI expect to get 5 error log, but actually I just get one in the err.log. It seems test.js just run one time other than 5 times.\u003c/p\u003e\n\n\u003cp\u003eThanks a lot~\u003c/p\u003e","accepted_answer_id":"44047093","answer_count":"1","comment_count":"0","creation_date":"2017-05-18 10:12:53.26 UTC","last_activity_date":"2017-05-22 00:58:43.433 UTC","last_edit_date":"2017-05-22 00:58:43.433 UTC","last_editor_display_name":"","last_editor_user_id":"8030299","owner_display_name":"","owner_user_id":"8030299","post_type_id":"1","score":"1","tags":"node.js|forever","view_count":"53"} +{"id":"8952739","title":"Show presentation timer on only one of two cloned displays","body":"\u003cp\u003eIs is possible to show an application on only one display, if the display is cloned? My goal is to develop a timer that is shown on the laptop display during a presentation but not on the projector.\u003c/p\u003e\n\n\u003cp\u003eI'm looking for something like windows' \"Identify displays\" feature, which displays numbers 1 and 2 on the different displays, even in cloned mode.\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdit\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI discovered a \u003ca href=\"https://stackoverflow.com/questions/3776752/c-sharp-identfiy-screens-number\"\u003epossible duplicate\u003c/a\u003e to this question. The accepted answer in this case was to use \u003ccode\u003eScreens.AllScreens\u003c/code\u003e to discover the number of screens. This is not enough in my case. A comment on the accepted answer links to a thread about \u003ca href=\"https://stackoverflow.com/questions/1536141/how-to-draw-directly-on-the-windows-desktop-c\"\u003edirectly painting on the desktop\u003c/a\u003e. I tried this with the following code, but the text appeared on both displays. The code to get the Hdc of the input is from an article about \u003ca href=\"http://www.codeproject.com/Articles/9741/Screen-Captures-Window-Captures-and-Window-Icon-Ca\" rel=\"nofollow noreferrer\"\u003escreen captures\u003c/a\u003e. I'm not sure what to set for the other parameters (they are IntPtr.Zero in the article)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[DllImport(\"gdi32.dll\")]\nstatic extern IntPtr CreateDC(IntPtr lpszDriver, string lpszDevice, IntPtr lpszOutput, IntPtr lpszInitData);\n\n[DllImport(\"gdi32.dll\")]\nstatic extern IntPtr DeleteDC(IntPtr hdc);\n\nprivate void PaintOnDesktop(string stringToPrint, Font font, Brush brush, PointF position) {\n string deviceName = Screen.AllScreens[0].DeviceName;\n IntPtr targetHdc = CreateDC(IntPtr.Zero, deviceName, IntPtr.Zero, IntPtr.Zero);\n using (Graphics g = Graphics.FromHdc(targetHdc)) {\n g.DrawString(stringToPrint, font, brush, position);\n }\n DeleteDC(targetHdc);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdit 2\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eApparently there is no way to do this in C#, so I changed the C# tag to device driver.\u003c/p\u003e","accepted_answer_id":"9144173","answer_count":"1","comment_count":"3","creation_date":"2012-01-21 11:49:26.54 UTC","favorite_count":"2","last_activity_date":"2012-06-06 09:32:45.953 UTC","last_edit_date":"2017-05-23 10:29:58.003 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"892961","post_type_id":"1","score":"3","tags":"device-driver|presentation|multiple-monitors","view_count":"181"} +{"id":"23542327","title":"EF - Create missing SQL Table/Object from Entity Object","body":"\u003cp\u003eIs there any function in the .NET Entity Framework, that can create missing SQL table. Or stored procedure or any other SQL Object? \u003c/p\u003e\n\n\u003cp\u003eHave do some research and did not found anything yet.\u003c/p\u003e","accepted_answer_id":"23544302","answer_count":"1","comment_count":"2","creation_date":"2014-05-08 12:53:27.267 UTC","last_activity_date":"2016-03-09 06:28:17.79 UTC","last_edit_date":"2016-03-09 06:28:17.79 UTC","last_editor_display_name":"","last_editor_user_id":"13302","owner_display_name":"","owner_user_id":"1186073","post_type_id":"1","score":"0","tags":"sql|.net|entity-framework","view_count":"36"} +{"id":"32163439","title":"How to add button in manifest xml","body":"\u003cp\u003eI want to add a button with link into my Joomla module/plugin config area.\u003c/p\u003e\n\n\u003cp\u003eGiven image have some form field but I want to add one more option as a button . when user click that button then they go to to another link.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/vPPA3.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/vPPA3.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2015-08-23 05:19:58.243 UTC","last_activity_date":"2015-10-08 15:55:53.727 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5184568","post_type_id":"1","score":"1","tags":"xml|joomla|joomla3.0|joomla-extensions","view_count":"203"} +{"id":"10302092","title":"How to extract all footnotes from a MS Word file?","body":"\u003cp\u003eIs there a generic (Macro, XML Parser, ...) way to extract all footnotes in a MS Word file and also keep the corresponding number from the original text?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2012-04-24 16:31:39.613 UTC","last_activity_date":"2012-04-24 17:20:33.93 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"22470","post_type_id":"1","score":"1","tags":"ms-word|text-extraction|footnotes","view_count":"1804"} +{"id":"32769190","title":"Save XML into list or array?","body":"\u003cp\u003eWe have a 600K-line XML file with tons of data. Of all the data, what I need to read are the nodes \u003ccode\u003e\u0026lt;mv\u0026gt;\u003c/code\u003e, and the way to know which \u003ccode\u003e\u0026lt;mv\u0026gt;\u003c/code\u003e I want to read is because it has an element \u003ccode\u003e\u0026lt;mod\u0026gt;\u003c/code\u003e inside with text that begins with \u003cem\u003e\"ValueAssigned=1, Function=1, Id=\"\u003c/em\u003e\u003c/p\u003e\n\n\u003cp\u003eThis is not a complete XML string by any means, but this would be \u003cem\u003esome sort\u003c/em\u003e of example.\u003c/p\u003e\n\n\u003cp\u003eThe end result would be to match each \u003ccode\u003eId\u003c/code\u003e with its values in \u003ccode\u003e\u0026lt;t\u0026gt;\u003c/code\u003e.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;mv\u0026gt;\n\u0026lt;mod\u0026gt;ValueAssigned=1, Function=1, Id=1\u0026lt;/mod\u0026gt;\n\u0026lt;t\u0026gt;123\u0026lt;/t\u0026gt;\n\u0026lt;t\u0026gt;20\u0026lt;/t\u0026gt;\n\u0026lt;t\u0026gt;10\u0026lt;/t\u0026gt;\n\u0026lt;t\u0026gt;40\u0026lt;/t\u0026gt;\n\u0026lt;/mv\u0026gt;\n\u0026lt;mv\u0026gt;\n\u0026lt;mod\u0026gt;ValueAssigned=1, Function=1, Id=2\u0026lt;/mod\u0026gt;\n\u0026lt;t\u0026gt;300\u0026lt;/t\u0026gt;\n\u0026lt;t\u0026gt;21\u0026lt;/t\u0026gt;\n\u0026lt;t\u0026gt;56\u0026lt;/t\u0026gt;\n\u0026lt;t\u0026gt;30\u0026lt;/t\u0026gt;\n\u0026lt;/mv\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe result would be to save this into a table. I don't need help saving the data into the table, but I do need help trying to save all those sections into some type of list:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eID Value\n1 123\n1 20\n1 10\n1 40\n2 300\n2 21\n2 56\n2 30\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI was thinking of something like this, but I haven't tried it yet:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003estring textToFind = \"ValueAssigned=1, Function=1, Id=\";\nIEnumerable\u0026lt;XElement\u0026gt; query1 = doc.Descendants(\"mod\").Where(c =\u0026gt; c.Value == TextToFind).Ancestors(\"mv\");\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2015-09-24 19:15:12.66 UTC","last_activity_date":"2015-09-24 19:53:11.027 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4191466","post_type_id":"1","score":"0","tags":"c#|.net|xml|linq|c#-4.0","view_count":"103"} +{"id":"35591494","title":"How can I do multi-dimensional matrix multiplication?","body":"\u003cp\u003eI have an array (A) 3500x7500x10.\u003c/p\u003e\n\n\u003cp\u003eAnd a matrix (B) 3500x7500.\u003c/p\u003e\n\n\u003cp\u003eSo I want to do element-by-element multiplication B with each of the 10 pages of A.\u003c/p\u003e\n\n\u003cp\u003eObviously, this doesn't work.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eA = A(:,:,:).*B;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI know how to do it in a loop, but is there is a vectorized way of doing it?\u003c/p\u003e","answer_count":"0","comment_count":"5","creation_date":"2016-02-24 01:16:04.71 UTC","last_activity_date":"2016-02-24 01:16:04.71 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3942806","post_type_id":"1","score":"0","tags":"matlab","view_count":"30"} +{"id":"43886544","title":"Google login page - Sign in to continue to companyName","body":"\u003cp\u003eI have modified the user agent to be able to login to Google. When the user tries to login, he sees the following screen:\n\u003ca href=\"https://i.stack.imgur.com/mog6D.jpg\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/mog6D.jpg\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThe company name I hid is clickable. Upon clicking it, there pops a small dialogue box with some \u003cem\u003eDeveloper Info\u003c/em\u003e.\u003c/p\u003e\n\n\u003cp\u003e1) Is there any way to disable that link?\u003c/p\u003e\n\n\u003cp\u003e2) If not, is it possible to modify the text inside the dialogue box? Because currently, personal email id of a developer is displayed which we don't want.\u003c/p\u003e\n\n\u003cp\u003eAny help or relevant link would be appreciated. \u003c/p\u003e\n\n\u003cp\u003eEDIT:\n\u003ca href=\"https://i.stack.imgur.com/97tke.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/97tke.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eJust like \u003cstrong\u003eYouTube\u003c/strong\u003e is disabled, I want my company's name to be disabled as well..\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2017-05-10 07:53:45.917 UTC","last_activity_date":"2017-05-12 09:21:10.01 UTC","last_edit_date":"2017-05-10 12:43:59.683 UTC","last_editor_display_name":"","last_editor_user_id":"2899485","owner_display_name":"","owner_user_id":"2899485","post_type_id":"1","score":"1","tags":"ios|google-api|google-oauth|google-signin|google-developers-console","view_count":"103"} +{"id":"7263050","title":"Django: how do I include the same field multiple times in a Django form?","body":"\u003cp\u003eI've got a basic friend invite form in my Django app that looks like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass FriendInviteForm(forms.Form):\n email = forms.EmailField()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt works perfectly when a user is inviting a single person, but I'd like to allow the user to invite as many of their friends as they'd like. The implementation I am trying to build would be to display the form with 3 email fields, and allow the user to dynamically add more fields on the client side using jQuery. \u003c/p\u003e\n\n\u003cp\u003eWhat is the best way to handle the creation of such a form, and how would I process the email fields in my view? Can I still use Django's built in forms for this?\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","accepted_answer_id":"7263561","answer_count":"2","comment_count":"0","creation_date":"2011-08-31 20:35:17.32 UTC","last_activity_date":"2013-07-24 13:35:01.81 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"783017","post_type_id":"1","score":"3","tags":"django|django-forms","view_count":"2205"} +{"id":"30969209","title":"Pointer to function taking abstract parameter","body":"\u003cp\u003eLet A be an abstract class in C++:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e// legal\nclass A {\n virtual void m() = 0;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt is illegal, of course, to define a variable whose type is an abstract class:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eA a; // illegal\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIndeed, \u003ccode\u003eclang\u003c/code\u003e 3.6.0 complains thus:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ewat.cc:5:3: error: variable type 'A' is an abstract class\nA a;\n ^\nwat.cc:2:16: note: unimplemented pure virtual method 'm' in 'A'\n virtual void m() = 0;\n ^\n1 error generated.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eLikewise, it is illegal to define a function with a parameter whose type is an abstract class:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evoid f(A a) {} // illegal\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIndeed, \u003ccode\u003eclang\u003c/code\u003e complains thus:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ewat.cc:5:10: error: parameter type 'A' is an abstract class\nvoid f(A a) {}\n ^\nwat.cc:2:16: note: unimplemented pure virtual method 'm' in 'A'\n virtual void m() = 0;\n ^\n1 error generated.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOn the other hand, it is legal, of course, to define a variable whose type is a pointer to values of an abstract class:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eA * a_ptr; // legal\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eEven if that class never had any base classes defined, the type \u003ccode\u003eA *\u003c/code\u003e has at least one value, \u003ccode\u003enullptr\u003c/code\u003e, so it is always possible to use such a variable in a type-correct way, even if it’s probably not very useful unless \u003ccode\u003eA\u003c/code\u003e at some point gets some concrete subclasses:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ea_ptr = nullptr; // legal\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ePresumably, this reasoning applies to \u003cem\u003eany\u003c/em\u003e pointer type.\u003c/p\u003e\n\n\u003cp\u003eLikewise, it is legal to define a function taking a parameter whose type is a pointer to values of an abstract class:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evoid f(A * a) {} // legal\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eLikewise, it is legal to define a function taking a parameter whose type is a pointer to functions taking a parameter whose type is a pointer to values of an abstract class:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evoid f(void (* g)(A *)) {} // legal\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBoth of these functions, of course, can be called legally:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ef(nullptr); // legal\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ePresumably, the specific type of the function parameter is irrelevant to the correctness of the type as long as it’s a pointer type. That call to \u003ccode\u003ef\u003c/code\u003e should be legal in either case. In terms of type theory, well-formed pointer types are always legal and \u003ccode\u003enullptr\u003c/code\u003e always inhabits them. By this reasoning, this definition should be presumed legal:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evoid f(void (* g)(A)) {}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003ccode\u003ef\u003c/code\u003e is a function that takes a parameter whose type is a pointer to functions that take a parameter whose type is a value of the abstract class A.\u003c/p\u003e\n\n\u003cp\u003eIndeed, the only possible value for that parameter is \u003ccode\u003enullptr\u003c/code\u003e, since no actual function can take a parameter whose type is an abstract class.\u003c/p\u003e\n\n\u003cp\u003eIs this legal per the C++ standard?\u003c/p\u003e\n\n\u003cp\u003eClang complains:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ewat.cc:5:20: error: parameter type 'A' is an abstract class\nvoid f(void (* g)(A)) {}\n ^\nwat.cc:2:16: note: unimplemented pure virtual method 'm' in 'A'\n virtual void m() = 0;\n ^\n1 error generated.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eGCC doesn’t.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eUpdate\u003c/strong\u003e: This question was correctly answered, but the question itself is wrong in stating Clang accepts that function. Both GCC and Clang yield similar errors with this code. However, Clang accepts such functions \u003cstrong\u003eif they are member functions\u003c/strong\u003e. This works:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;iostream\u0026gt;\n\nstruct A {\n virtual ~A() = 0;\n};\n\nstruct B {\n void f(void (*g)(A)) {\n std::cout \u0026lt;\u0026lt; \"Works!\" \u0026lt;\u0026lt; std::endl;\n }\n};\n\nint main() {\n B().f(nullptr);\n return 0;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis seems to be simply a bug in Clang, though. According to the language in the section of the standard cited in the accepted answer, this code should be rejected.\u003c/p\u003e","accepted_answer_id":"30969314","answer_count":"1","comment_count":"1","creation_date":"2015-06-21 20:50:51.07 UTC","favorite_count":"1","last_activity_date":"2015-06-21 23:36:58.86 UTC","last_edit_date":"2015-06-21 23:36:58.86 UTC","last_editor_display_name":"","last_editor_user_id":"1392731","owner_display_name":"","owner_user_id":"1392731","post_type_id":"1","score":"0","tags":"c++|abstract-class|function-pointers","view_count":"77"} +{"id":"36668486","title":"White space when hide bottom bar on push","body":"\u003cp\u003eI have a tabBarController and when I push a view controller I am hiding the bottom bar to not show the tabBar in the second view controller. The problem is that I see a white space for a moment. \u003c/p\u003e\n\n\u003cp\u003eThis is de code I am using to push the view controller\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eVerResultadoViewController *controller = (VerResultadoViewController *)[self.storyboard instantiateViewControllerWithIdentifier:@\"ver_resultado\"];\ncontroller.hidesBottomBarWhenPushed = YES ;\n[self.navigationController pushViewController:controller animated:YES];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is the white space:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/BK45D.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/BK45D.png\" alt=\"White space\"\u003e\u003c/a\u003e\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-04-16 19:07:37.673 UTC","last_activity_date":"2016-04-16 19:18:11.333 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2533783","post_type_id":"1","score":"0","tags":"ios|xcode|storyboard","view_count":"151"} +{"id":"16892970","title":"Highcharts spacing issue on xAxis in column chart","body":"\u003cp\u003eWhen I create a simple column chart with at least 2 datapoints there is annoying spacing as you can see in the jsfiddle. The width of the spacing scales with the smallest distance between two datapoints. I can't find any other options besides the one I've already set (min, max, minRange) to prevent the spacing.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(function () {\n$('#container').highcharts({\n chart: { \n type: 'column'\n },\n xAxis: {\n tickInterval: 1,\n min: 0,\n max: 23,\n minRange: 23\n }, \n series: [{\n data:[[0,10], [23,10]]\n }]\n});\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003ca href=\"http://jsfiddle.net/f5JUU/2/\" rel=\"nofollow\"\u003ehttp://jsfiddle.net/f5JUU/2/\u003c/a\u003e (Big spacing)\u003cbr\u003e\n\u003ca href=\"http://jsfiddle.net/f5JUU/3/\" rel=\"nofollow\"\u003ehttp://jsfiddle.net/f5JUU/3/\u003c/a\u003e (No spacing. This is how the other Jsfiddle should look like too...)\u003c/p\u003e","accepted_answer_id":"16901437","answer_count":"2","comment_count":"3","creation_date":"2013-06-03 08:46:19.173 UTC","favorite_count":"1","last_activity_date":"2013-06-03 16:27:20.593 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1897078","post_type_id":"1","score":"0","tags":"javascript|highcharts","view_count":"1468"} +{"id":"8704264","title":"What is with GWT and external libraries?","body":"\u003cp\u003eI am making a GWT application that involves users being able to upload files. My question is...\u003c/p\u003e\n\n\u003cp\u003eWhat is wrong with GWT?? It seems like every time I try to include a jar file in my project, it doesn't like it. I am using Eclipse. Everything compiles fine, but during runtime, UmbrellaExceptions happen, which get traced back to some ClassNotFoundException eventually (relating to whatever new jarrified class I just tried to use).\u003c/p\u003e\n\n\u003cp\u003eI read something about this somewhere else, but I can't remember exactly what the deal is; for whatever reason GWT just isn't compatible with some libraries..? Like java.io, for example. Pretty much everything in that package causes this to happen. Like, I can't even use FileNotFoundException for simple File I/O.\u003c/p\u003e\n\n\u003cp\u003eAgain, just to clarify: everything imports and compiles fine, but GWT doesn't want to load certain classes for some reason.\u003c/p\u003e\n\n\u003cp\u003eMy latest problem is trying to use Apache's Tika stuff for file validation. Attempting to instantiate any of their classes such as\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eMetadata metadata = new Metadata();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ecauses\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ejava.lang.ClassNotFoundException: org.apache.tika.metadata.Metadata\nat com.google.gwt.dev.shell.CompilingClassLoader.findClass(CompilingClassLoader.java:1061)\nat java.lang.ClassLoader.loadClass(Unknown Source)\nat java.lang.ClassLoader.loadClass(Unknown Source)\nat gwtupload.client.Uploader$10.onSubmit(Uploader.java:454)\nat com.google.gwt.user.client.ui.FormPanel$SubmitEvent.dispatch(FormPanel.java:178)\nat com.google.gwt.user.client.ui.FormPanel$SubmitEvent.dispatch(FormPanel.java:1)\nat com.google.gwt.event.shared.GwtEvent.dispatch(GwtEvent.java:1)\nat com.google.web.bindery.event.shared.EventBus.dispatchEvent(EventBus.java:40)\nat com.google.web.bindery.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:193)\nat com.google.web.bindery.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java:88)\nat com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:127)\nat com.google.gwt.user.client.ui.Widget.fireEvent(Widget.java:129)\nat com.google.gwt.user.client.ui.FormPanel.fireSubmitEvent(FormPanel.java:618)\nat com.google.gwt.user.client.ui.FormPanel.submit(FormPanel.java:556)\nat gwtupload.client.Uploader.submit(Uploader.java:1051)\nat gwtupload.client.SingleUploader$1.onClick(SingleUploader.java:141)\nat com.google.gwt.event.dom.client.ClickEvent.dispatch(ClickEvent.java:54)\nat com.google.gwt.event.dom.client.ClickEvent.dispatch(ClickEvent.java:1)\nat com.google.gwt.event.shared.GwtEvent.dispatch(GwtEvent.java:1)\nat com.google.web.bindery.event.shared.EventBus.dispatchEvent(EventBus.java:40)\nat com.google.web.bindery.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:193)\nat com.google.web.bindery.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java:88)\nat com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:127)\nat com.google.gwt.user.client.ui.Widget.fireEvent(Widget.java:129)\nat com.google.gwt.event.dom.client.DomEvent.fireNativeEvent(DomEvent.java:116)\nat com.google.gwt.user.client.ui.Widget.onBrowserEvent(Widget.java:177)\nat com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1351)\nat com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1307)\nat sun.reflect.GeneratedMethodAccessor33.invoke(Unknown Source)\nat sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)\nat java.lang.reflect.Method.invoke(Unknown Source)\nat com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)\nat com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)\nat com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)\nat com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:337)\nat com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:218)\nat com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)\nat com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)\nat com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)\nat com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)\nat com.google.gwt.core.client.impl.Impl.apply(Impl.java)\nat com.google.gwt.core.client.impl.Impl.entry0(Impl.java:213)\nat sun.reflect.GeneratedMethodAccessor27.invoke(Unknown Source)\nat sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)\nat java.lang.reflect.Method.invoke(Unknown Source)\nat com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)\nat com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)\nat com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)\nat com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:292)\nat com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:546)\nat com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363)\nat java.lang.Thread.run(Unknown Source)\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"8705568","answer_count":"2","comment_count":"1","creation_date":"2012-01-02 18:51:04.42 UTC","last_activity_date":"2012-01-02 21:33:30.42 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"974081","post_type_id":"1","score":"-1","tags":"java|eclipse|gwt","view_count":"1363"} +{"id":"33218159","title":"Passing Data Between Two NSOperations","body":"\u003cp\u003eI watched with a great attention the WWDC 2015 sessions about \u003ca href=\"https://developer.apple.com/videos/play/wwdc2015-226/\" rel=\"nofollow\"\u003eAdvanced NSOperations\u003c/a\u003e and I played a little bit with the \u003ca href=\"https://developer.apple.com/sample-code/wwdc/2015/downloads/Advanced-NSOperations.zip\" rel=\"nofollow\"\u003eexample code\u003c/a\u003e.\u003c/p\u003e\n\n\u003cp\u003eThe provided abstraction are really great, but there is something I may did not really good understand.\u003c/p\u003e\n\n\u003cp\u003eI would like to pass result data between two consequent Operation subclasses without using a MOC.\u003c/p\u003e\n\n\u003cp\u003eImagine I have a \u003ccode\u003eAPIQueryOperation\u003c/code\u003e which has a \u003ccode\u003eNSData?\u003c/code\u003e property and a second operation \u003ccode\u003eParseJSONOperation\u003c/code\u003e consuming this property. How do I provide this \u003ccode\u003eNSData?\u003c/code\u003e intance to the second operation ?\u003c/p\u003e\n\n\u003cp\u003eI tried something like this :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003equeryOperation = APIQueryOperation(request: registerAPICall) \nparseOperation = ParseJSONOperation(data: queryOperation.responseData) \nparseOperation.addDependency(queryOperation) \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut when I enter in the \u003ccode\u003eexecute\u003c/code\u003e method of the \u003ccode\u003eParseJSONOperation\u003c/code\u003e the instance in not the same as the same as in the initialiser.\u003c/p\u003e\n\n\u003cp\u003eWhat did I do wrong ?\u003c/p\u003e","accepted_answer_id":"33219080","answer_count":"1","comment_count":"5","creation_date":"2015-10-19 15:21:00.657 UTC","favorite_count":"3","last_activity_date":"2015-10-21 11:37:46.543 UTC","last_edit_date":"2015-10-21 09:52:22.763 UTC","last_editor_display_name":"","last_editor_user_id":"1652402","owner_display_name":"","owner_user_id":"856142","post_type_id":"1","score":"1","tags":"swift|nsoperation","view_count":"923"} +{"id":"11696943","title":"iPhone programming-- UIView elements appear to be ignoring Hidden=NO calls","body":"\u003cp\u003eUsing XCode 4.4 and Mountain Lion,\u003c/p\u003e\n\n\u003cp\u003eI have a UIImageView, and on that view, I have a UIProgressView and a UIButton. When the app starts, the progress view and button are both hidden, as set in the storyboard. I then try to unhide them, first the progress bar when I'm doing something, and then the button when I'm done. I have called, for both items,\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[self.view bringSubviewToFront:saveToCameraRoll];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eto try to put them in front of the UIView.\u003c/p\u003e\n\n\u003cp\u003eProblem is, when I programmatically try to unhide them, it doesn't work. I can call:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprogressBar.hidden = NO;\n[self.view bringSubviewToFront:progressBar];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd that does nothing.\u003c/p\u003e\n\n\u003cp\u003eSo then I tried to set everything as \u003cem\u003evisibile\u003c/em\u003e in the storyboard and then programmatically set everything to be invisible once the controller loads. No deal; now my calls to hidden = YES seem to be ignored.\u003c/p\u003e\n\n\u003cp\u003eI then removed all actual programming, so that hitting buttons should just cause the button and progress bar to appear, reasoning that maybe the main thread was getting starved and couldn't update.\u003c/p\u003e\n\n\u003cp\u003eHow can I force elements to pay attention to being hidden?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT\u003c/strong\u003e: I've now also tried programmatically modifying the alpha from 1 to 0. No change. It's like everything I'm doing is getting ignored. I made these items via the ctrl-drag method into the @interface section of the .m file; maybe I don't have some more delegates or interfaces or whatever hooked up?\u003c/p\u003e","accepted_answer_id":"11697094","answer_count":"2","comment_count":"4","creation_date":"2012-07-27 23:39:29.8 UTC","last_activity_date":"2012-08-06 07:02:49.507 UTC","last_edit_date":"2012-07-27 23:47:50.857 UTC","last_editor_display_name":"","last_editor_user_id":"21981","owner_display_name":"","owner_user_id":"21981","post_type_id":"1","score":"1","tags":"iphone|ios|uiview","view_count":"2412"} +{"id":"2163440","title":"Problems with ASP.NET and custom events","body":"\u003cp\u003eI have a problem when handling the ReceiveCompleted event of a MessageQueue in ASP.NET.\nIt catches it successfully, but every changes applied to the Controls of the page have no effect.\u003c/p\u003e\n\n\u003cp\u003eThis is what I've got:\u003c/p\u003e\n\n\u003ch1\u003e.ASPX\u003c/h1\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;asp:UpdatePanel ID=\"UpdatePanel1\" runat=\"server\" UpdateMode=\"Conditional\" ChildrenAsTriggers=\"False\"\u0026gt;\n \u0026lt;ContentTemplate\u0026gt;\n \u0026lt;asp:Label ID=\"Label1\" runat=\"server\" Text=\"Label\"\u0026gt;\u0026lt;/asp:Label\u0026gt;\n \u0026lt;br /\u0026gt;\n \u0026lt;asp:Label ID=\"Label2\" runat=\"server\" Text=\"Label\"\u0026gt;\u0026lt;/asp:Label\u0026gt;\n \u0026lt;/ContentTemplate\u0026gt;\n\u0026lt;/asp:UpdatePanel\u0026gt;\n\n\u0026lt;asp:Timer ID=\"Timer1\" runat=\"server\" Interval=\"3000\" ontick=\"Timer1_Tick\"\u0026gt;\n\u0026lt;/asp:Timer\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003ch1\u003e.CS\u003c/h1\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate static System.Messaging.MessageQueue queue;\nprivate static String messageContent;\n\nprotected override void OnInit(EventArgs e)\n{\n base.OnInit(e);\n queue = new MessageQueue(@\".\\Private$\\MyQueue\");\n queue.ReceiveCompleted += new ReceiveCompletedEventHandler(mq_ReceiveCompleted);\n queue.BeginReceive();\n}\n\n\nprotected void mq_ReceiveCompleted(object sender, System.Messaging.ReceiveCompletedEventArgs e)\n{\n\n System.Messaging.Message message = queue.EndReceive(e.AsyncResult);\n message.Formatter = new System.Messaging.XmlMessageFormatter(new string[] { \"System.String,mscorlib\" });\n\n Label1.Text = message.Body.ToString(); //Has no effect. The value updates without problem, but doesn't persist after finishing this method. And the Page doesn't refresh with this new value.\n Label2.Text = DateTime.Now.ToString(); //Has no effect too.\n Timer1.Interval = 99999; //And this one the same, no effect.\n messageContent = message.Body.ToString(); //.. But the value stored in this variable does persist\n\n queue.BeginReceive();\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI don't why it fails updating those vars. It may be any nonesense, but I'm new to ASP.NET, so any clue will be welcome.\u003c/p\u003e\n\n\u003cp\u003eThanks in advance!\u003c/p\u003e\n\n\u003cp\u003ePablo\u003c/p\u003e","accepted_answer_id":"2177262","answer_count":"3","comment_count":"2","creation_date":"2010-01-29 16:42:59.44 UTC","last_activity_date":"2010-02-01 14:19:48.597 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"261977","post_type_id":"1","score":"0","tags":"asp.net|msmq|custom-event|custom-events","view_count":"258"} +{"id":"47246981","title":"Play several videos using AVPlayer in a view","body":"\u003cp\u003eI have an \u003ccode\u003eUIView\u003c/code\u003e which contains some some texts and views. in each view I need to play a video with \u003ccode\u003eAVPlayer\u003c/code\u003e , but my problem is only the first view shows the video :\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/zAYVq.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/zAYVq.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eHere is my code :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunc playVideo(name:String , onView:UIView) {\n\n let path = Bundle.main.path(forResource: name, ofType: \"mp4\")\n let videoURL = URL(fileURLWithPath: path!)\n let player = AVPlayer(url: videoURL)\n let playerLayer = AVPlayerLayer(player: player)\n playerLayer.frame = onView.frame\n playerLayer.videoGravity = AVLayerVideoGravity.resizeAspectFill\n onView.layer.addSublayer(playerLayer)\n player.play()\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eUsing the function :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eoverride func viewDidLoad() {\n super.viewDidLoad()\n\n//ScrollView\n scrollView.contentSize = menuView.frame.size\n scrollView.addSubview(menuView)\n\n//Play videos \n playVideo(name: \"pizza\", onView: videoView1)\n playVideo(name: \"salad\", onView: videoView2)\n playVideo(name: \"fries\", onView: videoView3)\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhen I run the app video only play in \u003ccode\u003evideoView1\u003c/code\u003e , any suggestion why this happens ?\n I also put my code in \u003ccode\u003eviewWillAppear\u003c/code\u003e , \u003ccode\u003eviewDidLayoutSubviews\u003c/code\u003e\u003c/p\u003e","accepted_answer_id":"47302932","answer_count":"2","comment_count":"0","creation_date":"2017-11-12 08:43:12.987 UTC","last_activity_date":"2017-11-15 08:48:24.557 UTC","last_edit_date":"2017-11-15 08:48:24.557 UTC","last_editor_display_name":"","last_editor_user_id":"319097","owner_display_name":"","owner_user_id":"319097","post_type_id":"1","score":"0","tags":"ios|swift|uiview|uiscrollview|avplayer","view_count":"37"} +{"id":"10083089","title":"Sql Query to group the data from two tables","body":"\u003cp\u003eI have two tables \u003ccode\u003eDepartment\u003c/code\u003e and \u003ccode\u003eEmployee\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eDepartment\u003c/strong\u003e table looks like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e ID DeptName\n 1 IT\n 2 CSE\n 3 ECE\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eEmployee\u003c/strong\u003e table :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e ID DeptID EmployeeName Salary\n 1 1 John 10000\n 2 1 Bob 15000\n 3 2 Akon 12000\n 4 2 Smith 20000\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow I want to group the data in such a way that I get the following results which include these columns :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e ID DeptName Employee \n 1 IT John,10000\n Bob,15000\n\n 2 CSE Akon,12000\n Smith,20000\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCan we do something like this using SQL group functions or any other way?\u003c/p\u003e\n\n\u003cp\u003ePlease help me.\u003c/p\u003e\n\n\u003cp\u003eThanks,\nRajbir\u003c/p\u003e","accepted_answer_id":"10083217","answer_count":"1","comment_count":"2","creation_date":"2012-04-10 04:24:54.25 UTC","last_activity_date":"2012-04-10 05:27:05.973 UTC","last_edit_date":"2012-04-10 05:27:05.973 UTC","last_editor_display_name":"","last_editor_user_id":"13302","owner_display_name":"","owner_user_id":"1123948","post_type_id":"1","score":"0","tags":"asp.net|sql-server-2008","view_count":"460"} +{"id":"16662620","title":"\"execution_count\" error when running a job on a remote IPython cluster","body":"\u003cp\u003eI am running an IPython cluster (SSH) on a remote Linux machine, and I am using Mac OS X with IPython to use that cluster. In IPython on Mac I write:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efrom IPython.parallel import Client\nc = Client('~/ipcontroller-client.json', sshserver=\"me@remote_linux_machine\")\ndview=c[:]\ndview.scatter('m', arange(100))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhere \u003ccode\u003e'~/ipcontroller-client.json'\u003c/code\u003e is the file copied from \u003ccode\u003eremote_linux_machine\u003c/code\u003e. Everything works up to this point.\u003c/p\u003e\n\n\u003cp\u003eWhen I try to use parallel magic \u003ccode\u003e%px\u003c/code\u003e I get an error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/IPython/parallel/client/client.pyc\nin __init__(self, msg_id, content, metadata)\n 80 self.msg_id = msg_id\n 81 self._content = content\n---\u0026gt; 82 self.execution_count = content['execution_count']\n 83 self.metadata = metadata\n 84 \n\nKeyError: 'execution_count'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSame idea, but when I run the cluster on \u003cem\u003elocalhost\u003c/em\u003e it works perfectly.\u003c/p\u003e\n\n\u003cp\u003eShould parallel magic work at all for remote SSH cluster case?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-05-21 05:19:21.877 UTC","last_activity_date":"2013-05-22 20:37:52.403 UTC","last_edit_date":"2013-05-21 14:31:47.92 UTC","last_editor_display_name":"","last_editor_user_id":"2022086","owner_display_name":"","owner_user_id":"1362239","post_type_id":"1","score":"1","tags":"python|ssh|ipython|ipython-parallel","view_count":"416"} +{"id":"31790616","title":"number of rows in section, how to set this value after a parse query in the cell for row at index path function","body":"\u003cp\u003eSo i need some help with controlling my code flow, i'm trying to make a list display cells that i query from my parse server, however i do not know the amount of cells until i make the query in \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunc tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -\u0026gt; UITableViewCell\n//Query goes here {rowCount = queryResult.count}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have tried to create a global variable that will take the object count, but have no success since i have to set the value to something beforehand, like this: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar rowcount = 0\n\nfunc tableView(tableView: UITableView, numberOfRowsInSection section: Int) -\u0026gt; Int { \n\n\n\n return rowCount\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny good example on how to control this so that i get the right amount of rows from the query? \u003c/p\u003e\n\n\u003cp\u003eI did not find any similar question on Stack, thanks in advance!\u003c/p\u003e","accepted_answer_id":"31790756","answer_count":"2","comment_count":"2","creation_date":"2015-08-03 15:01:10.753 UTC","last_activity_date":"2015-08-03 20:20:47.653 UTC","last_edit_date":"2015-08-03 15:18:41.5 UTC","last_editor_display_name":"","last_editor_user_id":"1566221","owner_display_name":"","owner_user_id":"5107526","post_type_id":"1","score":"-1","tags":"swift|uitableview|parse.com","view_count":"1259"} +{"id":"29436962","title":"Dynamically looping through URL parameters","body":"\u003cp\u003eI'm trying to write a bit of code that will loop through URL parameters that start with the word 'layer' followed by 1,2,3, etc. For example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ehttp://example.cfm?numLayers=2\u0026amp;layer1=somevalue,123\u0026amp;layer2=someothervalue,456\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe number of layers in the URL will be different each time. \u003c/p\u003e\n\n\u003cp\u003eThis is my code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;cfif isDefined(\"url.numLayers\") AND url.numLayers gt 0\u0026gt;\n \u0026lt;cfset session.structLayers = structNew() /\u0026gt;\n \u0026lt;cfloop index=\"index\" from=\"1\" to=\"#url.numCustom#\"\u0026gt;\n \u0026lt;cfset layerElement = evaluate(url.layer#index#) /\u0026gt;\u0026lt;!--- This is where I'm having trouble ---\u0026gt;\n \u0026lt;cfset arrLayerElement = listToArray(layerElement)\u0026gt;\n \u0026lt;structInsert(session.structLayers, arrLayerElement[1], arrLayerElement[2])]\u0026gt;\n \u0026lt;/cfloop\u0026gt;\n\u0026lt;/cfif\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm getting an 'Invalid CFML construct error' on the line marked above. I'm not doing this right. \u003c/p\u003e","accepted_answer_id":"29437123","answer_count":"3","comment_count":"2","creation_date":"2015-04-03 17:29:03.08 UTC","last_activity_date":"2015-04-07 06:20:42.007 UTC","last_edit_date":"2015-04-06 17:55:52.973 UTC","last_editor_display_name":"","last_editor_user_id":"3524344","owner_display_name":"","owner_user_id":"1447849","post_type_id":"1","score":"4","tags":"coldfusion","view_count":"412"} +{"id":"8421986","title":"I can not access my git project via Eclipse, after commit","body":"\u003cp\u003eI am new to github and I'm doing a project which is hosted on github.\u003c/p\u003e\n\n\u003cp\u003eBut at the last(perhaps before) commit I made ​​a mistake.\u003c/p\u003e\n\n\u003cp\u003eAnd now I can not access all my files via Eclipse..\nI can not figure out where this problem is!!\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eThis my project from Eclipse\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://i.stack.imgur.com/qbru7.png\" rel=\"nofollow\"\u003ehttp://i.stack.imgur.com/qbru7.png\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eHere is a .rar file of the project:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://s000.tinyupload.com/index.php?file_id=01777472951924421639\u0026amp;gk=hotel\" rel=\"nofollow\"\u003ehttp://s000.tinyupload.com/index.php?file_id=01777472951924421639\u0026amp;gk=hotel\u003c/a\u003e\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2011-12-07 20:21:56.67 UTC","last_activity_date":"2011-12-07 21:53:16.667 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1406605","post_type_id":"1","score":"0","tags":"android|eclipse|git|github","view_count":"256"} +{"id":"35234739","title":"Spring Boot - \"Path index.html does not start with a \"/\" character\"","body":"\u003cp\u003eI am learning spring-boot and AngularJS, using Eclipse as an IDE, and Tomcat 8.0.30 (64 bits) as the container, running inside Eclipse. It is a Maven project.\u003c/p\u003e\n\n\u003cp\u003eAlthough the application is very basic and silly, I am getting an error when accessing the application via browser. The problem is, if I don't enter the URL with a slash (/) in the end, I got an error. The server logs throws this:\u003c/p\u003e\n\n\u003cp\u003eUrl \u003ca href=\"http://localhost:8080/app\" rel=\"nofollow\"\u003ehttp://localhost:8080/app\u003c/a\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ejava.lang.IllegalArgumentException: Path index.html does not start with a \"/\" character\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, if I enter the url like \u003ca href=\"http://localhost:8080/app/\" rel=\"nofollow\"\u003ehttp://localhost:8080/app/\u003c/a\u003e then the application runs fine.\u003c/p\u003e\n\n\u003cp\u003eAs you may know, spring-boot applications don't rely on \u003cem\u003eweb.xml\u003c/em\u003e. In fact, spring-boot loads \u003cem\u003eindex.html\u003c/em\u003e as the welcome page, or it is supposed to.\u003c/p\u003e\n\n\u003cp\u003eI ran the application outside Eclipse, by deploying to a Tomcat container. I got a 404 without the slash, and with the slash, it works fine. By running in self-contained mode (embeeded Tomcat) it works just fine.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eWhy the application does not redirect to index.html without the slash in the end?\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eYou can find the entire application here (I am tagged it):\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://github.com/ajkret/spring-boot-sample/tree/slash-problem\" rel=\"nofollow\"\u003ehttps://github.com/ajkret/spring-boot-sample/tree/slash-problem\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eHere is my Application.java\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@SpringBootApplication\n@ComponentScan(basePackages = { \"br.com.cinq.greet\" })\n@EnableAutoConfiguration\npublic class Application extends SpringBootServletInitializer {\n\n @Override\n protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {\n return application.sources(Application.class);\n }\n\n public static void main(String[] args) {\n new Application().configure(new SpringApplicationBuilder(Application.class)).run(args);\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere my ResourceConfig, for Jersey.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@Configuration\n@ApplicationPath(\"rest\")\npublic class Config extends ResourceConfig {\n\n public Config() {\n register(GreetResource.class);\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is the GreetResource, a typical Jersey Resource:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@Path(\"/greet\")\npublic class GreetResource {\n Logger logger = LoggerFactory.getLogger(GreetResource.class);\n\n // For now, store the information on a bean, in memory\n @Autowired\n Greet greet;\n\n @GET\n @Produces(MediaType.APPLICATION_JSON)\n public Response greet() {\n logger.debug(\"Received GET requisition\");\n return Response.ok().entity(greet).build();\n }\n\n @POST\n @Consumes(MediaType.APPLICATION_JSON)\n public Response greet(Greet greet) {\n try {\n this.greet.setMessage(greet.getMessage());\n logger.info(\"Greeting message updated {}\",this.greet.getMessage());\n } catch (Exception e) {\n logger.error(\"An exception occurred during Greet message update\", e);\n return Response.status(Status.INTERNAL_SERVER_ERROR).entity(\"exception\").build();\n }\n\n return Response.ok().build();\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThat is it, all Java classes that may interfere with the process are here. \u003c/p\u003e\n\n\u003cp\u003eHere are the dependencies for the POM:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;dependencies\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;org.springframework.boot\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;spring-boot-starter-web\u0026lt;/artifactId\u0026gt;\n \u0026lt;/dependency\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;org.springframework.boot\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;spring-boot-starter-jersey\u0026lt;/artifactId\u0026gt;\n \u0026lt;/dependency\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;org.springframework.boot\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;spring-boot-starter-test\u0026lt;/artifactId\u0026gt;\n \u0026lt;scope\u0026gt;test\u0026lt;/scope\u0026gt;\n \u0026lt;/dependency\u0026gt;\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;org.slf4j\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;slf4j-api\u0026lt;/artifactId\u0026gt;\n \u0026lt;/dependency\u0026gt;\n\n \u0026lt;dependency\u0026gt;\n \u0026lt;groupId\u0026gt;ch.qos.logback\u0026lt;/groupId\u0026gt;\n \u0026lt;artifactId\u0026gt;logback-classic\u0026lt;/artifactId\u0026gt;\n \u0026lt;/dependency\u0026gt;\n\n\u0026lt;/dependencies\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003chr\u003e\n\n\u003cp\u003e\u003cstrong\u003e\u003cem\u003eUPDATE\u003c/em\u003e\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI've installed Tomcat 8.0.24, and the problem was solved, apparently. \u003c/p\u003e\n\n\u003cp\u003eAre there new rules, RFCs, something new I don't know about the slash?\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2016-02-05 22:36:08.903 UTC","last_activity_date":"2016-02-10 11:09:43.603 UTC","last_edit_date":"2016-02-10 11:09:43.603 UTC","last_editor_display_name":"","last_editor_user_id":"2315849","owner_display_name":"","owner_user_id":"2315849","post_type_id":"1","score":"1","tags":"java|angularjs|maven|spring-boot|tomcat8","view_count":"407"} +{"id":"43671412","title":"How to add rowspan with dynamic table values in this html table?","body":"\u003cp\u003eI have an AJAX that append \u003ccode\u003etr\u003c/code\u003e to a table. The number of \u003ccode\u003etr\u003c/code\u003e appended to the table is varies depend on the data returned. This is my AJAX: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esuccess : function(data)\n{\n var tableData,t1,t2,t3,t4,t5,t6,t7;\n var no = 1;\n\n $.each(data.result_brg, function(index, rows_minta) {\n t1 = \"\u0026lt;tr\u0026gt;\u0026lt;td\u0026gt;\u0026lt;font size='1'\u0026gt;\"+ no++ +\"\u0026lt;/font\u0026gt;\u0026lt;/td\u0026gt;\";\n t2 = \"\u0026lt;td align='left'\u0026gt;\u0026lt;font size='1'\u0026gt;\"+ rows_minta.NamaOutlet +\"\u0026lt;/font\u0026gt;\u0026lt;/td\u0026gt;\";\n t3 = \"\u0026lt;td class='barang' style='text-align:left; vertical-align:middle'\u0026gt;\"+ rows_minta.NamaBarang +\"\u0026lt;/td\u0026gt;\";\n t4 = \"\u0026lt;td class='j_minta' style='text-align:right; vertical-align:middle'\u0026gt;\"+ rows_minta.jumlah_minta +\"\u0026lt;/td\u0026gt;\";\n t5 = \"\u0026lt;td\u0026gt;\u0026lt;/td\u0026gt;\";\n t6 = \"\u0026lt;td class='satuan' style='text-align:left; vertical-align:middle'\u0026gt;\"+ rows_minta.Satuan +\"\u0026lt;/td\u0026gt;\";\n t7 = \"\u0026lt;td\u0026gt;\u0026lt;/td\u0026gt;\u0026lt;/tr\u0026gt;\";\n\n tableData += t1+t2+t3+t4+t5+t6+t7;\n\n $('#tbl_content tbody tr').remove();\n $('#tbl_content tbody').append(tableData);\n });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is the table displayed: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eNo outlet item stock type unit invoice_no\n1 outlet A Book 45 \n2 outlet A Pen 24 \n3 outlet A Pencil 87\n4 outlet A Ruler 96\n5 outlet B Bag 57\n6 outlet B Shirt 32\n7 outlet C SSD 64\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe Table I'm looking for:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eNo outlet item stock type unit invoice_no\n1 Book 45 \n2 Pen 24 \n outlet A \n3 Pencil 87\n4 Ruler 96\n5 Bag 57\n outlet B\n6 Shirt 32\n7 outlet C SSD 64\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNote: The first column is should be \u003ccode\u003ecentered\u003c/code\u003e (valign=middle and text_align=center)\u003c/p\u003e","accepted_answer_id":"43671591","answer_count":"1","comment_count":"0","creation_date":"2017-04-28 03:19:15.383 UTC","last_activity_date":"2017-04-28 05:14:50.903 UTC","last_edit_date":"2017-04-28 03:50:38.863 UTC","last_editor_display_name":"","last_editor_user_id":"7192587","owner_display_name":"","owner_user_id":"7192587","post_type_id":"1","score":"0","tags":"javascript|php|jquery|html|ajax","view_count":"117"} +{"id":"25060899","title":"Custom html with download data button in Shiny","body":"\u003cp\u003eI'm wondering how to make the Shiny \u003ccode\u003edownloadHandler\u003c/code\u003e work with a custom html UI.\u003c/p\u003e\n\n\u003cp\u003eIn my \u003ccode\u003eindex.html\u003c/code\u003e I have the following:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;a id=\"downloadproject\" class=\"shiny-download-link shiny-bound-output\"\u0026gt;export\u0026lt;/a\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd in the \u003ccode\u003eserver.R\u003c/code\u003e I have:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eoutput$downloadproject \u0026lt;- downloadHandler(\n filename = \"test.csv\",\n content = function(file) {\n test_data \u0026lt;- c(1,2,3,4,5,6,7)\n write.csv(test_data, file)\n }\n )\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, I can't get it working. I've noticed inspecting the source on the demo page: \u003ca href=\"http://shiny.rstudio.com/gallery/file-download.html\" rel=\"noreferrer\"\u003ehttp://shiny.rstudio.com/gallery/file-download.html\u003c/a\u003e that the link there points to a resource:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;a id=\"downloadData\" class=\"btn shiny-download-link shiny-bound-output\" href=\"session/58c63083742fd00d75ac37732eb224bc/download/downloadData?w=299e8cd2e7b56a2507a31ddbe72446fd2ce5d51f5940ea0a\" target=\"_blank\"\u0026gt;\n \u0026lt;i class=\"fa fa-download\"\u0026gt;\u0026lt;/i\u0026gt;\n Download\n\u0026lt;/a\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, I guess that this it to be set by the \u003ccode\u003edownloadHandler\u003c/code\u003e from the server side. My a-tag in however does not get any href at all. Is what I'm looking to do even possible? Am I'm making some mistake here? Any ideas on how to fix this would be much appreciated.\u003c/p\u003e","answer_count":"2","comment_count":"1","creation_date":"2014-07-31 14:02:15.713 UTC","favorite_count":"3","last_activity_date":"2014-12-30 00:32:30.577 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1412088","post_type_id":"1","score":"5","tags":"html|r|download|shiny","view_count":"1326"} +{"id":"24865452","title":"SQL count specific items for a cutomer","body":"\u003cp\u003eI need to render the following table in order to now how many burgers a customer has payed\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eCustomer | Burger 1 Quantity | Burger 2 Quantity|\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI have two tables :\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003ecustomer table : with CustomerID, Name\u003c/li\u003e\n\u003cli\u003eTransaction order : with TransactionOrderID CustomerID and BurgerCode\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eI have 6 burger code, for each one I need to add a column, what is the best way to do that?\u003c/p\u003e","accepted_answer_id":"24865548","answer_count":"1","comment_count":"3","creation_date":"2014-07-21 12:45:44.69 UTC","last_activity_date":"2014-07-21 12:55:31.277 UTC","last_edit_date":"2014-07-21 12:50:07.41 UTC","last_editor_display_name":"","last_editor_user_id":"1750719","owner_display_name":"","owner_user_id":"526622","post_type_id":"1","score":"-1","tags":"sql|sql-server","view_count":"44"} +{"id":"30174480","title":"LISP Concatenate variable name with a string","body":"\u003cp\u003eI am wondering if i can do something like this in Lisp : \u003c/p\u003e\n\n\u003cp\u003eI need to declare n variables . So they will be n1,n2,n3...etc\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e(dotimes (i n) (setq (+ 'n i))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs it possible ?\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2015-05-11 17:58:20.137 UTC","last_activity_date":"2015-05-11 19:58:21.01 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4239608","post_type_id":"1","score":"0","tags":"lisp","view_count":"126"} +{"id":"26773671","title":"Can i use episerver CMS as identity provider for SSO using SAML?","body":"\u003cp\u003eI need to do SSO between episerver CMS and Liferay CMS using SAML. I know that LifeRay can act both as Service Provider as well as Identity Provider. I want to know that can Episerver CMS also act as Identity provider as well as service provider?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-11-06 07:11:08.347 UTC","favorite_count":"1","last_activity_date":"2014-11-16 21:20:58.277 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3222244","post_type_id":"1","score":"1","tags":"episerver|episerver-7","view_count":"340"} +{"id":"19485582","title":"Sorting Gridview not working with Linq","body":"\u003cp\u003eHi and thanks in advance,\u003c/p\u003e\n\n\u003cp\u003eI am trying to sort a gridview with linq and nothing is happening. I am not getting an error, but no sorting is happening in the view either. I am also using firebug for debugging as well.\u003c/p\u003e\n\n\u003cp\u003easp:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;asp:GridView ID=\"GridViewRangeSetup\" runat=\"server\" AllowSorting=\"True\" OnSorting=\"Gridview_Sort\"\n PagerStyle-Mode=\"NumericPages\" AutoGenerateColumns=\"false\" Width=\"100%\" CssClass=\"gridView\"\n OnPageIndexChanging=\"GridViewRangeSetup_PageIndexChanging\" AllowPaging=\"True\"\n PageSize=\"20\" DataKeyNames=\"RangeId\" OnRowCommand=\"GridViewRangeSetup_RowCommand\"\n OnRowEditing=\"GridViewRangeSetup_RowEditing\" OnRowCancelingEdit=\"GridViewRangeSetup_CancelEditRow\"\n OnRowUpdating=\"GridViewRangeSetup_UpdateRow\" OnRowDataBound=\"GridViewRangeSetup_RowDataBound\"\u0026gt;\n \u0026lt;RowStyle CssClass=\"rowStyle\"\u0026gt;\u0026lt;/RowStyle\u0026gt;\n \u0026lt;HeaderStyle CssClass=\"headerBar\" ForeColor=\"#ffffff\"\u0026gt;\u0026lt;/HeaderStyle\u0026gt;\n \u0026lt;AlternatingRowStyle CssClass=\"altRow\" /\u0026gt;\n \u0026lt;Columns\u0026gt;\n \u0026lt;asp:TemplateField HeaderText=\"Edit\" HeaderStyle-Width=\"5%\" HeaderStyle-ForeColor=\"#f2f2f2\"\n HeaderStyle-Font-Bold=\"false\" HeaderStyle-Font-Size=\"Small\"\u0026gt;\n \u0026lt;ItemTemplate\u0026gt;\n \u0026lt;asp:ImageButton ID=\"imgEdit\" runat=\"server\" ImageUrl=\"~/images/icon_edit.png\" CausesValidation=\"false\"\n CommandArgument='\u0026lt;%#Eval(\"RangeId\") %\u0026gt;' CommandName=\"Edit\" /\u0026gt;\n \u0026lt;/ItemTemplate\u0026gt;\n \u0026lt;EditItemTemplate\u0026gt;\n \u0026lt;asp:ImageButton ID=\"imgUpdate\" runat=\"server\" ImageUrl=\"~/images/icon_update.png\"\n CausesValidation=\"false\" CommandArgument='\u0026lt;%#Eval(\"RangeId\") %\u0026gt;' CommandName=\"Update\" /\u0026gt;\n \u0026lt;asp:ImageButton ID=\"ImageCancel\" runat=\"server\" ImageUrl=\"~/images/icon_cancel.png\"\n CausesValidation=\"false\" CommandArgument='\u0026lt;%#Eval(\"RangeId\") %\u0026gt;' CommandName=\"Cancel\" /\u0026gt;\n \u0026lt;/EditItemTemplate\u0026gt;\n \u0026lt;HeaderStyle Font-Bold=\"False\" Font-Size=\"Small\" ForeColor=\"#F2F2F2\" Width=\"5%\" /\u0026gt;\n \u0026lt;/asp:TemplateField\u0026gt;\n \u0026lt;asp:TemplateField HeaderText=\"Delete\" HeaderStyle-Width=\"3%\" HeaderStyle-ForeColor=\"#f2f2f2\"\n HeaderStyle-Font-Bold=\"false\" HeaderStyle-Font-Size=\"Small\"\u0026gt;\n \u0026lt;ItemTemplate\u0026gt;\n \u0026lt;asp:ImageButton ID=\"imgDelete\" runat=\"server\" CausesValidation=\"false\" OnClientClick=\"return DeleleAlert();\"\n CommandArgument='\u0026lt;%#Eval(\"RangeId\") %\u0026gt;' CommandName=\"Remove\" ImageUrl=\"~/images/icon_delete.png\" /\u0026gt;\n \u0026lt;/ItemTemplate\u0026gt;\n \u0026lt;HeaderStyle Font-Bold=\"False\" Font-Size=\"Small\" ForeColor=\"#F2F2F2\" Width=\"3%\" /\u0026gt;\n \u0026lt;/asp:TemplateField\u0026gt;\n \u0026lt;asp:TemplateField HeaderText=\"Description\" SortExpression=\"Description\"\u0026gt;\n \u0026lt;EditItemTemplate\u0026gt;\n \u0026lt;asp:TextBox ID=\"txtDescription\" runat=\"server\" CssClass=\"textbox\" Text='\u0026lt;%# Eval(\"Description\") %\u0026gt;'\u0026gt;\u0026lt;/asp:TextBox\u0026gt;\n \u0026lt;/EditItemTemplate\u0026gt;\n \u0026lt;ItemTemplate\u0026gt;\n \u0026lt;asp:Label ID=\"lblDescription\" runat=\"server\" Text='\u0026lt;%# Eval(\"Description\") %\u0026gt;'\u0026gt;\u0026lt;/asp:Label\u0026gt;\n \u0026lt;/ItemTemplate\u0026gt;\n \u0026lt;/asp:TemplateField\u0026gt;\n \u0026lt;asp:TemplateField HeaderText=\"Country\" SortExpression=\"Country.CountryName\"\u0026gt;\n \u0026lt;EditItemTemplate\u0026gt;\n \u0026lt;asp:DropDownList ID=\"ddlCountry\" runat=\"server\" CssClass=\"dropdown\" AutoPostBack=\"True\"\n AppendDataBoundItems=\"true\" DataTextField=\"CountryName\" DataValueField=\"CountryId\"\u0026gt;\n \u0026lt;/asp:DropDownList\u0026gt;\n \u0026lt;/EditItemTemplate\u0026gt;\n \u0026lt;ItemTemplate\u0026gt;\n \u0026lt;asp:Label ID=\"lblCountry\" runat=\"server\" Text='\u0026lt;%# Bind(\"CountryName\") %\u0026gt;'\u0026gt;\u0026lt;/asp:Label\u0026gt;\n \u0026lt;/ItemTemplate\u0026gt;\n \u0026lt;/asp:TemplateField\u0026gt;\n \u0026lt;asp:TemplateField HeaderText=\"State/Province\" SortExpression=\"GeographicRegion.RegionName\"\u0026gt;\n \u0026lt;EditItemTemplate\u0026gt;\n \u0026lt;asp:DropDownList ID=\"ddlRegion\" runat=\"server\" CssClass=\"dropdown\" AutoPostBack=\"True\"\n AppendDataBoundItems=\"true\" DataTextField=\"RegionName\" DataValueField=\"GeographicRegionId\"\u0026gt;\n \u0026lt;/asp:DropDownList\u0026gt;\n \u0026lt;/EditItemTemplate\u0026gt;\n \u0026lt;ItemTemplate\u0026gt;\n \u0026lt;asp:Label ID=\"lblRegion\" runat=\"server\" Text='\u0026lt;%# Bind(\"RegionName\") %\u0026gt;'\u0026gt;\u0026lt;/asp:Label\u0026gt;\n \u0026lt;/ItemTemplate\u0026gt;\n \u0026lt;/asp:TemplateField\u0026gt;\n \u0026lt;asp:TemplateField HeaderText=\"Base/Facility\" SortExpression=\"Base.BaseName\"\u0026gt;\n \u0026lt;EditItemTemplate\u0026gt;\n \u0026lt;asp:DropDownList ID=\"ddlFacility\" runat=\"server\" CssClass=\"dropdown\" AutoPostBack=\"True\"\n AppendDataBoundItems=\"true\" DataTextField=\"BaseName\" DataValueField=\"BaseId\"\u0026gt;\n \u0026lt;/asp:DropDownList\u0026gt;\n \u0026lt;/EditItemTemplate\u0026gt;\n \u0026lt;ItemTemplate\u0026gt;\n \u0026lt;asp:Label ID=\"lblFacility\" runat=\"server\" Text='\u0026lt;%# Bind(\"BaseName\") %\u0026gt;'\u0026gt;\u0026lt;/asp:Label\u0026gt;\n \u0026lt;/ItemTemplate\u0026gt;\n \u0026lt;/asp:TemplateField\u0026gt;\n \u0026lt;asp:TemplateField HeaderText=\"Map Name\" SortExpression=\"RangeMap.MapName\"\u0026gt;\n \u0026lt;EditItemTemplate\u0026gt;\n \u0026lt;asp:TextBox ID=\"txtMapName\" runat=\"server\" CssClass=\"textbox\" Text='\u0026lt;%# Eval(\"MapName\") %\u0026gt;'\u0026gt;\u0026lt;/asp:TextBox\u0026gt;\n \u0026lt;/EditItemTemplate\u0026gt;\n \u0026lt;ItemTemplate\u0026gt;\n \u0026lt;asp:Label ID=\"lblMapName\" runat=\"server\" Text='\u0026lt;%# Eval(\"MapName\") %\u0026gt;'\u0026gt;\u0026lt;/asp:Label\u0026gt;\n \u0026lt;/ItemTemplate\u0026gt;\n \u0026lt;/asp:TemplateField\u0026gt;\n \u0026lt;asp:TemplateField HeaderText=\"Map\"\u0026gt;\n \u0026lt;HeaderStyle HorizontalAlign=\"center\" /\u0026gt;\n \u0026lt;ItemTemplate\u0026gt;\n \u0026lt;asp:HyperLink ID=\"HyperLink_Map1\" runat=\"server\" NavigateUrl='\u0026lt;%# DataBinder.Eval(Container.DataItem,\"MapPath\") %\u0026gt;'\n Text=\"\"\u0026gt;\n \u0026lt;asp:Image ID=\"Image1\" runat=\"server\" ImageUrl='\u0026lt;%# DataBinder.Eval(Container.DataItem,\"MapPath\") %\u0026gt;'\n Width=\"50px\" Height=\"50px\" /\u0026gt;\n \u0026lt;/asp:HyperLink\u0026gt;\n \u0026lt;/ItemTemplate\u0026gt;\n \u0026lt;/asp:TemplateField\u0026gt;\n \u0026lt;asp:TemplateField HeaderText=\"Low Latitude\" SortExpression=\"RangeMap.LowLat\"\u0026gt;\n \u0026lt;EditItemTemplate\u0026gt;\n \u0026lt;asp:TextBox ID=\"txtLowLat\" runat=\"server\" CssClass=\"textbox\" Text='\u0026lt;%# Eval(\"LowLat\") %\u0026gt;'\u0026gt;\u0026lt;/asp:TextBox\u0026gt;\n \u0026lt;/EditItemTemplate\u0026gt;\n \u0026lt;ItemTemplate\u0026gt;\n \u0026lt;asp:Label ID=\"lblLowLat\" runat=\"server\" Text='\u0026lt;%# Eval(\"LowLat\") %\u0026gt;'\u0026gt;\u0026lt;/asp:Label\u0026gt;\n \u0026lt;/ItemTemplate\u0026gt;\n \u0026lt;/asp:TemplateField\u0026gt;\n \u0026lt;asp:TemplateField HeaderText=\"Low Longitude\" SortExpression=\"RangeMap.LowLong\"\u0026gt;\n \u0026lt;EditItemTemplate\u0026gt;\n \u0026lt;asp:TextBox ID=\"txtLowLong\" runat=\"server\" CssClass=\"textbox\" Text='\u0026lt;%# Eval(\"LowLong\") %\u0026gt;'\u0026gt;\u0026lt;/asp:TextBox\u0026gt;\n \u0026lt;/EditItemTemplate\u0026gt;\n \u0026lt;ItemTemplate\u0026gt;\n \u0026lt;asp:Label ID=\"lblLowLong\" runat=\"server\" Text='\u0026lt;%# Eval(\"LowLong\") %\u0026gt;'\u0026gt;\u0026lt;/asp:Label\u0026gt;\n \u0026lt;/ItemTemplate\u0026gt;\n \u0026lt;/asp:TemplateField\u0026gt;\n \u0026lt;asp:TemplateField HeaderText=\"High Latitude\" SortExpression=\"RangeMap.HighLat\"\u0026gt;\n \u0026lt;EditItemTemplate\u0026gt;\n \u0026lt;asp:TextBox ID=\"txtHighLat\" runat=\"server\" CssClass=\"textbox\" Text='\u0026lt;%# Eval(\"HighLat\") %\u0026gt;'\u0026gt;\u0026lt;/asp:TextBox\u0026gt;\n \u0026lt;/EditItemTemplate\u0026gt;\n \u0026lt;ItemTemplate\u0026gt;\n \u0026lt;asp:Label ID=\"lblHighLat\" runat=\"server\" Text='\u0026lt;%# Eval(\"HighLat\") %\u0026gt;'\u0026gt;\u0026lt;/asp:Label\u0026gt;\n \u0026lt;/ItemTemplate\u0026gt;\n \u0026lt;/asp:TemplateField\u0026gt;\n \u0026lt;asp:TemplateField HeaderText=\"High Longitude\" SortExpression=\"RangeMap.HighLong\"\u0026gt;\n \u0026lt;EditItemTemplate\u0026gt;\n \u0026lt;asp:TextBox ID=\"txtHighLong\" runat=\"server\" CssClass=\"textbox\" Text='\u0026lt;%# Eval(\"HighLong\") %\u0026gt;'\u0026gt;\u0026lt;/asp:TextBox\u0026gt;\n \u0026lt;/EditItemTemplate\u0026gt;\n \u0026lt;ItemTemplate\u0026gt;\n \u0026lt;asp:Label ID=\"lblHighLong\" runat=\"server\" Text='\u0026lt;%# Eval(\"HighLong\") %\u0026gt;'\u0026gt;\u0026lt;/asp:Label\u0026gt;\n \u0026lt;/ItemTemplate\u0026gt;\n \u0026lt;/asp:TemplateField\u0026gt;\n \u0026lt;asp:TemplateField HeaderText=\"Status\"\u0026gt;\n \u0026lt;ItemTemplate\u0026gt;\n \u0026lt;asp:Button ID=\"RangeSetup_Status\" CssClass=\"page-btn blue\" CausesValidation=\"false\"\n CommandArgument='\u0026lt;%#Eval(\"RangeId\") %\u0026gt; ' runat=\"server\" Text=\"Status\" OnClick=\"btnRangeStatus_Click\"\u0026gt;\n \u0026lt;/asp:Button\u0026gt;\n \u0026lt;/ItemTemplate\u0026gt;\n \u0026lt;/asp:TemplateField\u0026gt;\n \u0026lt;/Columns\u0026gt;\n \u0026lt;/asp:GridView\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ec#\u003c/p\u003e\n\n\u003cp\u003eprotected void Gridview_Sort(object sender, GridViewSortEventArgs e)\n {\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e //Label2.Text = e.SortExpression + \" \" + ConvertSortDirectionToSql(e.SortDirection);\n WISSModel.WISSEntities context = new WISSModel.WISSEntities();\n\n\n String column = e.SortExpression;\n\n IQueryable\u0026lt;dynamic\u0026gt; sortedGridview = ConvertSortDirectionToSql(e.SortDirection) == \"ASC\" ?\n (from r in context.Ranges.AsEnumerable()\n where r.isDeleted == false\n orderby typeof(WISSModel.Range).GetProperty(column).GetValue(r, null) ascending\n select new\n {\n r.RangeId,\n r.Description,\n r.Country.CountryName,\n r.GeographicRegion.RegionName,\n r.Base.BaseName,\n r.RangeMap.MapName,\n r.RangeMap.MapPath,\n r.RangeMap.LowLat,\n r.RangeMap.LowLong,\n r.RangeMap.HighLat,\n r.RangeMap.HighLong\n }).AsQueryable\u0026lt;dynamic\u0026gt;() :\n (from r in context.Ranges.AsEnumerable()\n where r.isDeleted == false\n orderby typeof(WISSModel.Range).GetProperty(column).GetValue(r, null) descending\n select new\n {\n r.RangeId,\n r.Description,\n r.Country.CountryName,\n r.GeographicRegion.RegionName,\n r.Base.BaseName,\n r.RangeMap.MapName,\n r.RangeMap.MapPath,\n r.RangeMap.LowLat,\n r.RangeMap.LowLong,\n r.RangeMap.HighLat,\n r.RangeMap.HighLong\n }).AsQueryable\u0026lt;dynamic\u0026gt;();\n\n //var sortedGridview = context.Ranges.Where(\"it.isDeleted == false\").OrderBy(column);\n\n GridViewRangeSetup.DataSource = sortedGridview.ToList();\n\n //var test = sortedGridview.ToList();\n\n //System.Diagnostics.Debugger.Break();\n\n GridViewRangeSetup.DataBind();\n\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"19746486","answer_count":"2","comment_count":"0","creation_date":"2013-10-21 02:57:47.237 UTC","last_activity_date":"2013-11-02 20:24:30.76 UTC","last_edit_date":"2013-10-23 10:22:12.863 UTC","last_editor_display_name":"","last_editor_user_id":"2846370","owner_display_name":"","owner_user_id":"2846370","post_type_id":"1","score":"1","tags":"c#|asp.net|c#-4.0|linq-to-entities|gridview-sorting","view_count":"722"} +{"id":"19889270","title":"Power 3.3v board using analog pin","body":"\u003cp\u003eWhat would be the reasons not to use one of the analog pins, set at 3.3v, to power a child board running at 3.3v?\u003c/p\u003e\n\n\u003cp\u003eI suspect this is bad, but can't figure out why...\u003c/p\u003e\n\n\u003cp\u003eObviously I'm using a nano board that doesn't have a 3.3v pin...\u003c/p\u003e","accepted_answer_id":"19890818","answer_count":"2","comment_count":"0","creation_date":"2013-11-10 11:39:50.43 UTC","last_activity_date":"2016-11-23 05:27:39.62 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"896567","post_type_id":"1","score":"3","tags":"arduino","view_count":"4412"} +{"id":"35753951","title":"Manually register a user in Laravel","body":"\u003cp\u003eIs it possible to manually register a user (with artisan?) rather than via the auth registration page?\u003c/p\u003e\n\n\u003cp\u003eI only need a handful of user accounts and wondered if there's a way to create these without having to set up the registration controllers and views.\u003c/p\u003e","accepted_answer_id":"35754495","answer_count":"4","comment_count":"1","creation_date":"2016-03-02 17:18:24.357 UTC","favorite_count":"4","last_activity_date":"2017-09-26 20:58:29.293 UTC","last_edit_date":"2016-03-02 17:32:30.237 UTC","last_editor_display_name":"","last_editor_user_id":"2094178","owner_display_name":"","owner_user_id":"1990849","post_type_id":"1","score":"10","tags":"php|laravel|laravel-5|laravel-5.2","view_count":"7437"} +{"id":"14047896","title":"Date(value) and new Date(value)","body":"\u003cblockquote\u003e\n \u003cp\u003e\u003cstrong\u003ePossible Duplicate:\u003c/strong\u003e\u003cbr\u003e\n \u003ca href=\"https://stackoverflow.com/questions/3505693/difference-between-datedatestring-and-new-datedatestring\"\u003eDifference between Date(dateString) and new Date(dateString)\u003c/a\u003e \u003c/p\u003e\n\u003c/blockquote\u003e\n\n\n\n\u003cp\u003eWhat is the difference between\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eDate(1356567322705)\n\"Thu Dec 27 2012 03:13:37 GMT+0300 (Kaliningrad Standard Time)\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enew Date(1356567322705)\nThu Dec 27 2012 03:15:22 GMT+0300 (Kaliningrad Standard Time)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand why there is a gap of about 2 minutes?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2012-12-27 00:16:51.137 UTC","favorite_count":"1","last_activity_date":"2012-12-27 00:18:36.567 UTC","last_edit_date":"2017-05-23 12:04:32.633 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"377133","post_type_id":"1","score":"0","tags":"javascript|date","view_count":"456"} +{"id":"18192990","title":"Using a $.get() in .Net MVC without a controller","body":"\u003cp\u003eIn .Net MVC if I'm using the JQuery \u003ccode\u003e.get()\u003c/code\u003e method to grab a file from the server would I still need to write up a \u003ccode\u003eRenderAction\u003c/code\u003e on a controller method to display its contents? Example JQuery: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction RenderPartialView(view, contentcontainer, maskcontainer, params) {\n $.get(view, params, function (data) {\n $(\"#\" + contentcontainer).html(data);\n $(maskcontainer).unmask();\n });\n}\n\n function displayExpandedView() {\n $('.expand-btn').on('click', function () {\n $(\".expanded-view\").modal();\n RenderPartialView(\"../some_dir/SomeView\", \"expanded-view\", \"#expanded-view\", null);\n })\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo when I run the displayExpandedView() function I want to fill a div that is acting as a modal with the contents of the SomeView file. When I currently try to do this with in my application the server responds back with a 404 error saying the file cannot be found, even thought he path to it is correct. Using this method would I still need to have a controller return \u003ccode\u003ePartialView()\u003c/code\u003e? I was under the impression I would not. \u003c/p\u003e","accepted_answer_id":"18193170","answer_count":"2","comment_count":"6","creation_date":"2013-08-12 17:24:19.207 UTC","last_activity_date":"2013-08-12 17:35:23.25 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1211604","post_type_id":"1","score":"0","tags":"jquery|asp.net-mvc|asp.net-mvc-4","view_count":"179"} +{"id":"2951872","title":"How can i design a DB where the user can define the fields and types of a detail table in a M-D relationship?","body":"\u003cp\u003eMy application has one table called 'events' and each event has approx 30 standard fields, but also user defined fields that could be any name or type, in an 'eventdata' table. Users can define these event data tables, by specifying x number of fields (either text/double/datetime/boolean) and the names of these fields. This 'eventdata' (table) can be different for each 'event'.\u003c/p\u003e\n\n\u003cp\u003eMy current approach is to create a lookup table for the definitions. So if i need to query all 'event' and 'eventdata' per record, i do so in a M-D relaitionship using two queries (i.e. select * from events, then for each record in 'events', select * from 'some table').\u003c/p\u003e\n\n\u003cp\u003eIs there a better approach to doing this? I have implemented this so far, but most of my queries require two distinct calls to the DB - i cannot simply join my master 'events' table with different 'eventdata' tables for each record in in 'events'.\u003c/p\u003e\n\n\u003cp\u003eI guess my main question is: can i join my master table with different detail tables for each record? \u003c/p\u003e\n\n\u003cp\u003eE.g. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT E.*, E.Tablename \nFROM events E \nLEFT JOIN 'E.tablename' T ON E._ID = T.ID\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf not, is there a better way to design my database considering i have no idea on how many user defined fields there may be and what type they will be. \u003c/p\u003e","accepted_answer_id":"2952354","answer_count":"6","comment_count":"1","creation_date":"2010-06-01 17:23:24.013 UTC","favorite_count":"2","last_activity_date":"2010-06-01 18:58:35.77 UTC","last_edit_date":"2010-06-01 17:27:00.933 UTC","last_editor_display_name":"","last_editor_user_id":"13302","owner_display_name":"","owner_user_id":"355657","post_type_id":"1","score":"2","tags":"sql|join","view_count":"333"} +{"id":"27792835","title":"PHP: How to display date time in following format (2015-01-05T06:27:50.000Z )?","body":"\u003cp\u003eI want to show the datetime in the following format \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e2015-01-05T06:27:50.000Z \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow I can achieve this ? \u003c/p\u003e","accepted_answer_id":"27792899","answer_count":"2","comment_count":"0","creation_date":"2015-01-06 05:53:37.707 UTC","last_activity_date":"2016-08-03 21:11:53.967 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1216451","post_type_id":"1","score":"4","tags":"php|datetime","view_count":"682"} +{"id":"13393287","title":"Visual Studio 2010 runs awful - can't find solution","body":"\u003cp\u003eI have a problem with my Visual Studio 2010 Professional - I'm working on a project at work, and everything in VS runs slow (maybe except IntelliSense). I know that start-up times usually are quite bad, and I can live with that.\u003c/p\u003e\n\n\u003cp\u003eBut building a medium sized solution (7 projects, a few hundred files) takes from 3 to even 10 minutes... After building the solution VS says that it's ready, but I have to wait for the localhost to respond up to 5 minutes... That's up to 15 minutes in total!\nTo keep things short: \u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eafter turning on everything I still have at least 1Gb of free RAM (4 total) and only 20-25% of processor usage\u003c/li\u003e\n\u003cli\u003eI have uninstalled every plugin\u003c/li\u003e\n\u003cli\u003eThe project builds and works fine on my teammate's computer\u003c/li\u003e\n\u003cli\u003eThe project works and builds even better when I work on a server using my computer and a virtual desktop\u003c/li\u003e\n\u003cli\u003eMy computer works just fine\u003c/li\u003e\n\u003cli\u003eI have just finished the painful re-installation of VS (after removing VS cleaning it's leftovers - or so I think)\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eEDIT: After cleaning up my solution my build times are blazing fast! :) Plus, I was able to find out that I have some kind of problem with my processor, which didn't show up in the process manager until now... Anyway, I think my problem has been solved somehow...\nTHANK YOU!\u003c/p\u003e","accepted_answer_id":"13393348","answer_count":"5","comment_count":"11","creation_date":"2012-11-15 07:44:12.497 UTC","last_activity_date":"2012-11-15 08:52:20.78 UTC","last_edit_date":"2012-11-15 08:52:20.78 UTC","last_editor_display_name":"","last_editor_user_id":"1152125","owner_display_name":"","owner_user_id":"1152125","post_type_id":"1","score":"1","tags":"c#|visual-studio-2010","view_count":"447"} +{"id":"10805278","title":"Joining Lists using Linq returns different result than corresponding SQL query?","body":"\u003cp\u003eI have 2 tables\u003c/p\u003e\n\n\u003cp\u003eTableA:\u003c/p\u003e\n\n\u003cpre class=\"lang-none prettyprint-override\"\u003e\u003ccode\u003eTableAID int,\nCol1 varchar(8)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eTableB:\u003c/p\u003e\n\n\u003cpre class=\"lang-none prettyprint-override\"\u003e\u003ccode\u003eTableBID int\nCol1 char(8),\nCol2 varchar(40)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I run a SQL query on the 2 tables it returns the following number of rows\u003c/p\u003e\n\n\u003cpre class=\"lang-sql prettyprint-override\"\u003e\u003ccode\u003eSELECT * FROM tableA (7200 rows)\nselect * FROM tableB (28030 rows)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen joined on col1 and selects the data it returns the following number of rows\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eselect DISTINCT a.Col1,b.Col2 FROM tableA a\njoin tableB b on a.Col1=b.Col1 (6578 rows)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe above 2 tables on different databases so I created 2 EF models and retried the data separately and tried to join them in the code using linq with the following function. Surprisingly it returns 2886 records instead of 6578 records. Am I doing something wrong?\nThe individual lists seems to return the correct data but when I join them SQL query and linq query differs in the number of records.\u003c/p\u003e\n\n\u003cp\u003eAny help on this greatly appreciated.\u003c/p\u003e\n\n\n\n\u003cpre\u003e\u003ccode\u003e// This function is returning 2886 records \npublic List\u0026lt;tableC_POCO_Object\u0026gt; Get_TableC() \n{\n IEnumerable\u0026lt;tableC_POCO_Object\u0026gt; result = null;\n List\u0026lt;TableA\u0026gt; tableA_POCO_Object = Get_TableA(); // Returns 7200 records\n List\u0026lt;TableB\u0026gt; tableB_POCO_Object = Get_TableB(); // Returns 28030 records\n result = from tbla in tableA_POCO_Object\n join tblb in tableB_POCO_Object on tbla.Col1 equals tblb.Col1\n select new tableC_POCO_Object \n {\n Col1 = tblb.Col1,\n Col2 = tbla.Col2\n };\n return result.Distinct().ToList();\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"3","comment_count":"8","creation_date":"2012-05-29 19:17:20.24 UTC","last_activity_date":"2014-07-03 10:03:26.47 UTC","last_edit_date":"2014-07-03 10:03:26.47 UTC","last_editor_display_name":"","last_editor_user_id":"759866","owner_display_name":"","owner_user_id":"1424482","post_type_id":"1","score":"1","tags":"c#","view_count":"582"} +{"id":"11085394","title":"CustomControl with shapes","body":"\u003cp\u003eI would like to create a custom control in order to display a pie chart.\nI have a PieSlice class (which I got from the WinRT toolkit project) :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class PieSlice : Path\n{\n #region StartAngle\n public static readonly DependencyProperty StartAngleProperty =\n DependencyProperty.Register(\n \"StartAngle\",\n typeof(double),\n typeof(PieSlice),\n new PropertyMetadata(\n 0d,\n new PropertyChangedCallback(OnStartAngleChanged)));\n\n public double StartAngle\n {\n get { return (double)GetValue(StartAngleProperty); }\n set { SetValue(StartAngleProperty, value); }\n }\n\n private static void OnStartAngleChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)\n {\n var target = (PieSlice)sender;\n var oldStartAngle = (double)e.OldValue;\n var newStartAngle = (double)e.NewValue;\n target.OnStartAngleChanged(oldStartAngle, newStartAngle);\n }\n\n private void OnStartAngleChanged(double oldStartAngle, double newStartAngle)\n {\n UpdatePath();\n }\n #endregion\n\n #region EndAngle\n public static readonly DependencyProperty EndAngleProperty =\n DependencyProperty.Register(\n \"EndAngle\",\n typeof(double),\n typeof(PieSlice),\n new PropertyMetadata(\n 0d,\n new PropertyChangedCallback(OnEndAngleChanged)));\n\n public double EndAngle\n {\n get { return (double)GetValue(EndAngleProperty); }\n set { SetValue(EndAngleProperty, value); }\n }\n\n private static void OnEndAngleChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)\n {\n var target = (PieSlice)sender;\n var oldEndAngle = (double)e.OldValue;\n var newEndAngle = (double)e.NewValue;\n target.OnEndAngleChanged(oldEndAngle, newEndAngle);\n }\n\n private void OnEndAngleChanged(double oldEndAngle, double newEndAngle)\n {\n UpdatePath();\n }\n #endregion\n\n #region Radius\n public static readonly DependencyProperty RadiusProperty =\n DependencyProperty.Register(\n \"Radius\",\n typeof(double),\n typeof(PieSlice),\n new PropertyMetadata(\n 0d,\n new PropertyChangedCallback(OnRadiusChanged)));\n\n public double Radius\n {\n get { return (double)GetValue(RadiusProperty); }\n set { SetValue(RadiusProperty, value); }\n }\n\n private static void OnRadiusChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)\n {\n var target = (PieSlice)sender;\n var oldRadius = (double)e.OldValue;\n var newRadius = (double)e.NewValue;\n target.OnRadiusChanged(oldRadius, newRadius);\n }\n\n private void OnRadiusChanged(double oldRadius, double newRadius)\n {\n this.Width = this.Height = 2 * Radius;\n UpdatePath();\n }\n #endregion\n\n private void UpdatePath()\n {\n var pathGeometry = new PathGeometry();\n var pathFigure = new PathFigure();\n pathFigure.StartPoint = new Point(Radius, Radius);\n pathFigure.IsClosed = true;\n\n // Starting Point\n var lineSegment = \n new LineSegment \n {\n Point = new Point(\n Radius + Math.Sin(StartAngle * Math.PI / 180) * Radius,\n Radius - Math.Cos(StartAngle * Math.PI / 180) * Radius)\n };\n\n // Arc\n var arcSegment = new ArcSegment();\n arcSegment.IsLargeArc = (EndAngle - StartAngle) \u0026gt;= 180.0;\n arcSegment.Point =\n new Point(\n Radius + Math.Sin(EndAngle * Math.PI / 180) * Radius,\n Radius - Math.Cos(EndAngle * Math.PI / 180) * Radius);\n arcSegment.Size = new Size(Radius, Radius);\n arcSegment.SweepDirection = SweepDirection.Clockwise;\n pathFigure.Segments.Add(lineSegment);\n pathFigure.Segments.Add(arcSegment);\n pathGeometry.Figures.Add(pathFigure);\n this.Data = pathGeometry;\n this.InvalidateArrange();\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd now I am trying to create a control which can contains multiple pie slices\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class Pie : Control\n{\n #region Items Source\n public static readonly DependencyProperty ItemsSourceProperty =\n DependencyProperty.Register(\n \"ItemsSource\",\n typeof(IEnumerable),\n typeof(Pie),\n new PropertyMetadata(\n null,\n new PropertyChangedCallback(OnItemsSourceChanged)));\n\n public IEnumerable ItemsSource\n {\n get { return (IEnumerable)GetValue(ItemsSourceProperty); }\n set { SetValue(ItemsSourceProperty, value); }\n }\n\n private static void OnItemsSourceChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)\n {\n var target = (Pie)sender;\n var oldItemsSource = (IEnumerable)e.OldValue;\n var newItemsSource = (IEnumerable)e.NewValue;\n target.OnItemsSourceChanged(oldItemsSource, newItemsSource);\n }\n\n private void OnItemsSourceChanged(IEnumerable oldItemsSource, IEnumerable newItemsSource)\n {\n UpdatePieSlices();\n }\n #endregion\n\n public Pie()\n {\n this.DefaultStyleKey = typeof(Pie);\n }\n\n private void UpdatePieSlices()\n {\n double startAngle = 0;\n foreach (KeyValuePair\u0026lt;string, double\u0026gt; item in ItemsSource)\n {\n PieSlice slice = new PieSlice() \n { \n Fill = new SolidColorBrush(Colors.Red), \n Radius = 100, StartAngle = startAngle, \n EndAngle = (item.Value / 100.0) * 360 \n };\n startAngle = (item.Value / 100.0) * 360;\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe ItemsSource is a collection of \u003ccode\u003eKeyValuePair\u0026lt;string, int\u0026gt;\u003c/code\u003e which represents the name of the slice and the percentage. I would like to display the slices but I have no idea how...\u003c/p\u003e\n\n\u003cp\u003eEDIT :\u003c/p\u003e\n\n\u003cp\u003eI have tried this but it doesn't work\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;Style TargetType=\"control:Pie\"\u0026gt;\n \u0026lt;Setter Property=\"Template\"\u0026gt;\n \u0026lt;Setter.Value\u0026gt;\n \u0026lt;ControlTemplate TargetType=\"control:Pie\"\u0026gt;\n \u0026lt;Border\n Background=\"{TemplateBinding Background}\"\n BorderBrush=\"{TemplateBinding BorderBrush}\"\n BorderThickness=\"{TemplateBinding BorderThickness}\"\u0026gt;\n\n \u0026lt;ItemsControl\n AutomationProperties.AutomationId=\"ItemGridView\"\n AutomationProperties.Name=\"Grouped Items\"\n ItemsSource=\"{Binding Path=ItemsSource}\"\u0026gt;\n\n \u0026lt;ItemsControl.ItemTemplate\u0026gt;\n \u0026lt;DataTemplate\u0026gt;\n \u0026lt;ContentControl Content=\"{Binding}\"/\u0026gt;\n \u0026lt;/DataTemplate\u0026gt;\n \u0026lt;/ItemsControl.ItemTemplate\u0026gt;\n \u0026lt;ItemsControl.ItemsPanel\u0026gt;\n \u0026lt;ItemsPanelTemplate\u0026gt;\n \u0026lt;Grid\u0026gt;\u0026lt;/Grid\u0026gt;\n \u0026lt;/ItemsPanelTemplate\u0026gt;\n \u0026lt;/ItemsControl.ItemsPanel\u0026gt;\n \u0026lt;/ItemsControl\u0026gt;\n \u0026lt;/Border\u0026gt;\n \u0026lt;/ControlTemplate\u0026gt;\n \u0026lt;/Setter.Value\u0026gt;\n \u0026lt;/Setter\u0026gt;\n \u0026lt;/Style\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"11085524","answer_count":"1","comment_count":"0","creation_date":"2012-06-18 14:52:33.04 UTC","last_activity_date":"2012-06-18 15:33:10.963 UTC","last_edit_date":"2012-06-18 15:33:10.963 UTC","last_editor_display_name":"","last_editor_user_id":"478016","owner_display_name":"","owner_user_id":"478016","post_type_id":"1","score":"0","tags":"c#|custom-controls|microsoft-metro","view_count":"492"} +{"id":"47303815","title":"Navbar growing wider than bootstrap column width","body":"\u003cp\u003eI am trying to position \u003ccode\u003enavbar\u003c/code\u003e fixed to the left-hand side of the screen effectively in a \u003ccode\u003esidebar\u003c/code\u003e with the rest of the page content rendering to the right.\u003c/p\u003e\n\n\u003cp\u003eCurrently, I have tried to split the page into two using bootstrap columns like so:\u003c/p\u003e\n\n\u003cp\u003e\u003cdiv class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\"\u003e\r\n\u003cdiv class=\"snippet-code\"\u003e\r\n\u003cpre class=\"snippet-code-css lang-css prettyprint-override\"\u003e\u003ccode\u003ehtml,\r\nbody {\r\n padding: 0;\r\n margin: 0;\r\n height: 100%;\r\n}\r\n\r\n\r\n/********************************************\r\n* *\r\n* *\r\n* WRAPPERS *\r\n* *\r\n* *\r\n********************************************/\r\n\r\n#sidebarWrapper {\r\n height: 100%;\r\n -moz-transition: all 0.5s ease;\r\n -o-transition: all 0.5s ease;\r\n -webkit-transition: all 0.5s ease;\r\n transition: all 0.5s ease;\r\n background-color: red;\r\n overflow-x: hidden;\r\n overflow-y: auto;\r\n transition: all 0.5s ease;\r\n}\r\n\r\n\r\n/********************************************\r\n* *\r\n* *\r\n* SIDEBAR NAV STYLE *\r\n* *\r\n* *\r\n********************************************/\r\n\r\n.sidebar-nav {\r\n margin: 0;\r\n padding: 0;\r\n top: 0;\r\n list-style: none;\r\n position: absolute;\r\n}\r\n\r\n.sidebar-nav\u0026gt;li {\r\n display: inline-block;\r\n line-height: 20px;\r\n position: relative;\r\n width: 100%;\r\n}\r\n\r\n\r\n/********************************************\r\n* *\r\n* *\r\n* DIV STYLE *\r\n* *\r\n* *\r\n********************************************/\r\n\r\n.container-fluid {\r\n height: 100%;\r\n}\r\n\r\n.container-fluid h1 {\r\n padding: 0;\r\n margin: 0;\r\n}\r\n\r\n\r\n/********************************************\r\n* *\r\n* *\r\n* PAGE BODY STYLE *\r\n* *\r\n* *\r\n********************************************/\r\n\r\n.header {\r\n height: 10%;\r\n background-color: yellow;\r\n}\r\n\r\n.contentBody {\r\n height: 80%;\r\n background-color: green;\r\n}\r\n\r\n.footer {\r\n height: 10%;\r\n background-color: blue;\r\n}\u003c/code\u003e\u003c/pre\u003e\r\n\u003cpre class=\"snippet-code-html lang-html prettyprint-override\"\u003e\u003ccode\u003e\u0026lt;link href=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css\" rel=\"stylesheet\"/\u0026gt;\r\n\u0026lt;div class=\"container-fluid\"\u0026gt;\r\n \u0026lt;div class=\"row\"\u0026gt;\r\n \u0026lt;div class=\"col-lg-2\"\u0026gt;\r\n \u0026lt;nav class=\"navbar navbar-inverse navbar-fixed-top\" role=\"navigation\" id=\"sidebarWrapper\"\u0026gt;\r\n \u0026lt;ul class=\"nav sidebar-nav\"\u0026gt;\r\n \u0026lt;li\u0026gt;\r\n \u0026lt;a class=\"firstChild\" href=\"/\"\u0026gt;Dashboard\u0026lt;/a\u0026gt;\r\n \u0026lt;/li\u0026gt;\r\n \u0026lt;/ul\u0026gt;\r\n \u0026lt;/nav\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"col-lg-10\"\u0026gt;\r\n \u0026lt;div class=\"header\"\u0026gt;\r\n \u0026lt;h1\u0026gt;Header\u0026lt;/h1\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"contentBody\"\u0026gt;\r\n \u0026lt;h1\u0026gt;Content\u0026lt;/h1\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"footer\"\u0026gt;\r\n \u0026lt;h1\u0026gt;Footer\u0026lt;/h1\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n\u0026lt;/div\u0026gt;\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003c/p\u003e\n\n\u003cp\u003eHowever, as you can see from the snippet my \u003ccode\u003enavbar\u003c/code\u003e seems to brute force over any bootstrap column restrictions and takes the width of the whole page.\u003c/p\u003e\n\n\u003cp\u003eHow can I prevent it from doing so, so that it takes 100% of the width of the bootstrap column but no more and no less?\u003c/p\u003e","accepted_answer_id":"47304821","answer_count":"3","comment_count":"4","creation_date":"2017-11-15 09:35:18.47 UTC","last_activity_date":"2017-11-15 11:19:47.49 UTC","last_edit_date":"2017-11-15 10:40:14.92 UTC","last_editor_display_name":"","last_editor_user_id":"8040185","owner_display_name":"","owner_user_id":"2676167","post_type_id":"1","score":"0","tags":"html|css|twitter-bootstrap","view_count":"51"} +{"id":"34480603","title":"Calling an instance method in designated initializer of a Swift class","body":"\u003cp\u003eIn Swift programming language, it is mandatory that \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e“A designated initializer must ensure that all of the properties introduced by its class are initialized before it delegates up to a superclass initializer.” \u003ca href=\"https://stackoverflow.com/a/24021346/2431329\"\u003esource of quote from another s/o\u003c/a\u003e\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eOtherwise, an error similar to the following would be displayed \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eProperty 'self.baz' not initialized at super.init call\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI would like to implement the following Objective-C code in Swift:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@interface FooBar : NSObject\n\n@property (nonatomic, readonly) NSString *baz;\n\n@end\n\n@implementataion FooBar\n\n@synthesize baz = _baz;\n\n- (instancetype)initWithString:(NSString *)string {\n self = [super init];\n if (self) {\n _baz = [self parseString:string];\n }\n return self;\n}\n\n- (NSString *)parseString:(NSString *)string {\n // Perform something on the original string\n return ...;\n}\n\n@end\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe following implementation would have thrown a compiler error as described above:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass FooBar: NSObject {\n let baz: NSString?\n\n init(string: NSString?) {\n super.init()\n baz = parseString(string)\n }\n\n private func parseString(string: NSString?) -\u0026gt; NSString? {\n // Perform something on the original string\n return ...;\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd if I did the following, I would get an error that says \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eUse of self in method call 'parseString' before super.init initialises self\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass FooBar: NSObject {\n let baz: NSString?\n\n init(string: NSString?) {\n baz = parseString(string)\n super.init()\n }\n\n private func parseString(string: NSString?) -\u0026gt; NSString? {\n // Perform something on the original string\n return string;\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo my solution, presently, is to use a private class method:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass FooBar: NSObject {\n let baz: NSString?\n\n init(string: NSString?) {\n baz = FooBar.parseString(string)\n super.init()\n }\n\n private class func parseString(string: NSString?) -\u0026gt; NSString? {\n // Perform something on the original string\n return ...;\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy question is whether there is a better way to achieve the same or is private class method the best approach?\u003c/p\u003e","accepted_answer_id":"34480729","answer_count":"1","comment_count":"0","creation_date":"2015-12-27 12:57:25.49 UTC","last_activity_date":"2015-12-27 17:08:22.797 UTC","last_edit_date":"2017-05-23 12:31:24.183 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"2431329","post_type_id":"1","score":"2","tags":"objective-c|swift|designated-initializer|code-migration","view_count":"89"} +{"id":"34901501","title":"Change drop folder of Visual Studio Team Services / Visual Studio Online Build to Assembly Version","body":"\u003cp\u003eI want my Visual Studio Team Services Build to use the Assembly Version of my Executable. Is there any simple way to achieve that?\u003c/p\u003e\n\n\u003cp\u003eI know it is possible to pass parameters into the build process, but how can i define a parameter in one step and consume it later ?\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2016-01-20 13:34:19.287 UTC","last_activity_date":"2017-03-16 19:09:54.313 UTC","last_edit_date":"2016-02-19 13:08:53.913 UTC","last_editor_display_name":"","last_editor_user_id":"736079","owner_display_name":"","owner_user_id":"2250672","post_type_id":"1","score":"0","tags":"build|msbuild|vsts","view_count":"233"} +{"id":"12118135","title":"aptana javascript code assistance (Some code assistances are missing)","body":"\u003cp\u003eI'm currently learning and playing around with javascript on Aptana 3 IDE. I love Aptana's code completion and template features of it but I'm having trouble with getting full code assistance for my javascript development. For instance, if I have a new Image instance like\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar imgSprite = new Image();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand if I call it by saying imgSprite, it wouldn't suggest me code suggestion for like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimgSprite.addEventListener('load', loadImage, false);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut it does suggest me code suggestions including \u003ccode\u003eimgSprite.src\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eSo are there any extensions or plugin that I can install to get all those code assistance features working in my Aptana 3 IDE? or perhaps you can suggest me other IDE with all these features embedded? Thanks\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2012-08-25 00:11:37.963 UTC","favorite_count":"1","last_activity_date":"2012-12-09 13:43:58.637 UTC","last_edit_date":"2012-12-09 13:43:58.637 UTC","last_editor_display_name":"user1889380","owner_display_name":"","owner_user_id":"1065129","post_type_id":"1","score":"2","tags":"php|javascript|html|html5|aptana","view_count":"145"} +{"id":"24221641","title":"Possible to create custom urls with RESTful routing in Laravel 4","body":"\u003cp\u003eIs it possible to have custom urls without renaming controller methods when using RESTful routing with \u003ccode\u003eRoute::controller\u003c/code\u003e?\u003c/p\u003e\n\n\u003cp\u003eWith \u003ccode\u003eRoute::controller('users', 'UsersController');\u003c/code\u003e I want the url to be \u003ccode\u003eusers/registration\u003c/code\u003e instead of \u003ccode\u003eusers/create\u003c/code\u003e without renaming \u003ccode\u003egetCreate\u003c/code\u003e method in \u003ccode\u003eUsersController\u003c/code\u003e.\u003c/p\u003e","accepted_answer_id":"24229199","answer_count":"1","comment_count":"0","creation_date":"2014-06-14 15:51:06.997 UTC","last_activity_date":"2014-06-15 12:07:31.717 UTC","last_edit_date":"2014-06-15 12:07:31.717 UTC","last_editor_display_name":"","last_editor_user_id":"1083422","owner_display_name":"","owner_user_id":"1158168","post_type_id":"1","score":"0","tags":"laravel-4|routing|custom-url","view_count":"732"} +{"id":"15139635","title":"tastypie: filter many to many tables with multiple, ANDed values","body":"\u003cp\u003eI have two tables (Movie and Genre) that are connected with a many to many relation using a crosstable (MovieGenre).\u003c/p\u003e\n\n\u003cp\u003eMy models.py file looks like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass Genre( models.Model ):\n\n sName = models.CharField( max_length=176)\n [ .. ]\n\nclass Movie( models.Model ):\n\n sTitle = models.CharField( max_length=176)\n genre = models.ManyToManyField( Genre )\n [ .. ]\n\nclass MovieGenre( models.Model ):\n\n idMovie = models.ForeignKey( Movie )\n idGenre = models.ForeignKey( Genre )\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to use tastypie to filter all movies of certain genres. E.g. show me all movies that are of genre Action, Thriller and SciFi.\u003c/p\u003e\n\n\u003cp\u003eMy api.py looks like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass GenreResource(ModelResource):\n class Meta:\n queryset = Genre.objects.all()\n resource_name = 'genre'\n always_return_data = True\n include_resource_uri = False\n excludes = ['dtCreated', 'dtModified' ]\n authorization= Authorization()\n authentication = SessionAuthentication()\n filtering = {\n \"id\" : ALL,\n }\n\n\nclass MovieResource(ModelResource):\n genre = fields.ManyToManyField( 'app.api.GenreResource', 'genre', full=True )\n class Meta:\n queryset = Movie.objects.all()\n resource_name = 'movie'\n authorization= Authorization()\n authentication = SessionAuthentication()\n always_return_data = True\n include_resource_uri = False\n excludes = ['dtCreated', 'dtModified' ]\n filtering = {\n \"sTitle\" : ALL,\n \"genre\" : ALL_WITH_RELATIONS,\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy test data:\nTwo movies (with genre ids)\nMatrix (1 \u0026amp; 3 )\nBlade Runner (1 \u0026amp; 2 )\u003c/p\u003e\n\n\u003cp\u003eFirst I make a query on the title, as expected below query returns 1 result (namely Matrix):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e http://localhost:8000/api/v1/movie/?format=json\u0026amp;sTitle__icontains=a\u0026amp;sTitle__icontains=x\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, I get three results with the URL that should query the related genre table (two times Matrix and once Blade Runner) with this query:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e http://localhost:8000/api/v1/movie/?format=json\u0026amp;genre__id__in=3\u0026amp;genre__id__in=1\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI would expect to get back only Matrix\u003c/p\u003e\n\n\u003cp\u003eI also tried to override apply_filters like so: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef apply_filters(self, request, applicable_filters):\n oList = super(ModelResource, self).apply_filters(request, applicable_filters)\n loQ = [Q(**{'sTitle__icontains': 'a'}), Q(**{'sTitle__icontains': 'x'})]\n # works as intended: one result\n loQ = [Q(**{'genre__id__in': '3'}) ]\n # results in one result (Matrix)\n\n loQ = [Q(**{'genre__id__in': '1'}), Q(**{'genre__id__in': '3'}) ]\n # results in no results!\n\n loQ = [Q(**{'genre__id__in': [ 1, 3]}) ]\n # results in two results Matrix and Blade Runner which is OK since obviously ORed\n oFilter = reduce( operator.and_, loQ )\n oList = oList.filter( oFilter ).distinct()\n return oList\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny idea to make this work? \u003c/p\u003e\n\n\u003cp\u003eThanks for any idea...\u003c/p\u003e","accepted_answer_id":"15140946","answer_count":"1","comment_count":"1","creation_date":"2013-02-28 15:41:23.443 UTC","last_activity_date":"2013-02-28 16:43:40.977 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"463676","post_type_id":"1","score":"1","tags":"django|filter|tastypie|relation|m2m","view_count":"1348"} +{"id":"17558093","title":"Search Outlook contacts by email using AppleScript and mdfind","body":"\u003cp\u003eIs there a more-efficient way to determine if a contact doesn't exist than this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eset theAddress to \"foo@bar.com\"\n\nset found to false\n\nrepeat with aContact in contacts\n\n if email addresses of aContact contains theAddress then\n set found to true\n exit repeat\n end if\n\nend repeat\n\nif not found then\n ...\nend if\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis will create a new contact if it isn't found (and return \u003ccode\u003etrue\u003c/code\u003e):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eset found to open contact email address \"foo@bar.com\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e** edit **\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://stackoverflow.com/questions/18859148/search-outlook-contacts-by-category\"\u003eSearch Outlook contacts by category\u003c/a\u003e suggests that I should be able to do this using a Spotlight query:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e-- the address to be found\nset theEmailAddress to \"foobar@acme.com\"\n\n-- search identity folder\nset currentIdentityFolder to quoted form of POSIX path of (current identity folder as string)\n\n--perform Spotlight query\nset theContacts to words of (do shell script \"mdfind -onlyin \" \u0026amp; currentIdentityFolder \u0026amp; \" 'kMDItemContentType == com.microsoft.outlook14.contact \u0026amp;\u0026amp; [metadata element that represents an email address] == \" \u0026amp; theEmailAddress \u0026amp; \"' | xargs -I % mdls -name com_microsoft_outlook_recordID '%' | cut -d'=' -f2 | sort -u | paste -s -\")\n\n-- process results\n...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat is the metadata element that represents a contact's email address?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-07-09 21:00:35.087 UTC","last_activity_date":"2016-04-19 03:47:54.303 UTC","last_edit_date":"2017-05-23 12:16:00.48 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"134367","post_type_id":"1","score":"1","tags":"osx|applescript|spotlight|outlook-2011","view_count":"510"} +{"id":"37236790","title":"Regex for matching some characters that should be left out later","body":"\u003cp\u003eI will try to explain my situation with an example, consider the following string:\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003e03 - The-Basics-of-Querying-the-Dom.mov\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eI need to remove all \u003ccode\u003e-\u003c/code\u003es (hyphens) excluding the one after the digits. In other words, all \u003cem\u003ehyphens\u003c/em\u003e in between the words.\u003c/p\u003e\n\n\u003cp\u003eThis is the REGEX I created: \u003ccode\u003e/([^\\s])\\-/\u003c/code\u003e. But the problem is, when I try to replace, the character before the space is also removed.\u003c/p\u003e\n\n\u003cp\u003eFollowing the result I am aiming for:\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003e03 - The Basics of Querying the Dom.mov\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eThink, I can use something like exclude groups? I tried to use \u003ccode\u003e?:\u003c/code\u003e \u0026amp; \u003ccode\u003e?!\u003c/code\u003e in the capture group to avoid it from being matched, but didn't give any positive results.\u003c/p\u003e","accepted_answer_id":"37236852","answer_count":"2","comment_count":"4","creation_date":"2016-05-15 09:49:01.73 UTC","last_activity_date":"2016-05-15 09:55:44.243 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2602869","post_type_id":"1","score":"0","tags":"regex|pcre","view_count":"36"} +{"id":"41163298","title":"Chronos setting environment variable leads to error","body":"\u003cp\u003eI tried this both on the chronos config and in my job definition:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \"environmentVariables\": [\n {\n \"name\": \"DOCKER_API_VERSION\",\n \"value\": \"$(docker version --format '{{.Server.Version}}')\"\n }\n ],\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt always fails with:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edocker: Error response from daemon: 404 page not found.\nSee 'docker run --help'.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe reason I'm trying to set that variable is because I'm running docker in docker and the client docker API sometimes has a different version than the server docker version and it has to be started with the \u003ccode\u003eDOCKER_API_VERSION\u003c/code\u003e env set in order to work.\u003c/p\u003e\n\n\u003cp\u003eI'm suspecting it's because of the computed value being set instead of a string value.\u003c/p\u003e\n\n\u003cp\u003eIn the logs I can see it runs as supposed and I don't know why it crashes to be honest:\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003edocker run ... -e DOCKER_API_VERSION=$(docker version --format '{{.Server.Version}}') ...\u003c/code\u003e\u003c/p\u003e","answer_count":"0","comment_count":"4","creation_date":"2016-12-15 11:40:57.23 UTC","last_activity_date":"2016-12-15 11:40:57.23 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1515697","post_type_id":"1","score":"0","tags":"mesos|dcos|mesos-chronos","view_count":"88"} +{"id":"45445531","title":"Java : How to include a .properties file that is outside of jar into classpath?","body":"\u003cp\u003eWe would like to keep the .properties file out of the jar so that we can change the properties used in a module and we do not have to re-install the module.\u003c/p\u003e\n\n\u003cp\u003eBefore Java 8, we used to run a script and include the .properties file in the way below and it worked. But since when we updated to Java 8 , this way of including .properties file in classpath is not working, means java program fails not finding the .properties file.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eMy script to run the java project:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e/usr/java/latest/bin/java -d64 -Xms1G -Xmx16G -XX:MaxPermSize=128m -XX:-UseGCOverheadLimit -cp \"/online/sand/lib/client-api-1.0.0.jar:/online/sand/oap_pub/lib/*:/online/sand/oap/oap_dw/run/client_api/application.properties\" team.online.client.api.MasterProcessor | tee -a client_api.log\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWe are using Sping context to pick up the properties file this way:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;util:properties id=\"app_props\"\n location=\"classpath*:/application.properties\" /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThen a property in that appilcation.properties files is being used ( in many different files) this way:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@Value( \"#{app_props[\\\"SERVICE_PATH_GET_METADATA\\\"]?:''}\" )\nprivate String metadataServicePath;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eLooking for a way to keep the.properties file out of the jar and in classpath so that Spring context finds that file.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eIs their any other way than using ? We need to keep the properties file excluded from jar\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass.getClassLoader( ).getResourceAsStream( \"application.properties\" );\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks in advance. \u003c/p\u003e","accepted_answer_id":"45515147","answer_count":"2","comment_count":"0","creation_date":"2017-08-01 18:47:09.35 UTC","last_activity_date":"2017-08-18 17:22:53.367 UTC","last_edit_date":"2017-08-18 17:22:53.367 UTC","last_editor_display_name":"","last_editor_user_id":"923988","owner_display_name":"","owner_user_id":"923988","post_type_id":"1","score":"0","tags":"java|spring|classpath","view_count":"215"} +{"id":"6424898","title":"Is it possible to use Aero Peek for MDI children within a winforms application?","body":"\u003cp\u003eI've seen from the \u003ca href=\"http://archive.msdn.microsoft.com/WindowsAPICodePack\" rel=\"noreferrer\"\u003eWindows API Code Pack\u003c/a\u003e that it is possible to enable custom glass in a winforms application, but I've been unable to ascertain how to get child windows to show as separte thumbnails for aero peek (in much the same manner that IE displays the contents of its tabs as separate windows)\u003c/p\u003e\n\n\u003cp\u003eIs it possible to do this from a Winforms application, or will it involve lots of P/Invoke voodoo?\u003c/p\u003e","accepted_answer_id":"6427378","answer_count":"1","comment_count":"0","creation_date":"2011-06-21 12:01:51.193 UTC","favorite_count":"1","last_activity_date":"2011-06-21 14:56:39.707 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"50447","post_type_id":"1","score":"5","tags":"c#|winforms|windows-7|aero-peek","view_count":"552"} +{"id":"3968350","title":"Resetting animation in Android without starting it","body":"\u003cp\u003eI have an \u003ccode\u003eAnimationDrawable\u003c/code\u003e that is running. How to stop \u0026amp; reset it so that it does not start again until \u003ccode\u003estart()\u003c/code\u003e is called? Calling \u003ccode\u003esetVisible(true, true)\u003c/code\u003e resets it, but also immediately starts animation, and I'd like to avoid it.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2010-10-19 12:36:05.277 UTC","last_activity_date":"2011-08-02 15:05:45.177 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6533","post_type_id":"1","score":"2","tags":"android","view_count":"292"} +{"id":"3088779","title":"Android - How to display an ImageView as a header in a listactivity?","body":"\u003cp\u003eI'm trying to display an image before the list in a listactivity. \u003c/p\u003e\n\n\u003cp\u003eIf I put an ImageView before the ListView, then only the list is displayed... still quite an android n00b so any pointers appreciated :)\u003c/p\u003e\n\n\u003cp\u003eHeres my main.xml which lays out the list activity:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" encoding=\"utf-8\"?\u0026gt;\n\u0026lt;LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\" \n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\u0026gt;\n\n \u0026lt;ImageView android:id=\"@+id/header\"\n android:src=\"@drawable/header\"\n android:layout_width=\"fill_parent\"\n android:layout_height=\"wrap_content\"\n android:layout_gravity=\"top\"\n android:scaleType=\"fitStart\"\n /\u0026gt;\n\n \u0026lt;ListView android:id=\"@+id/android:list\" \n android:layout_width=\"fill_parent\" \n android:layout_height=\"wrap_content\"\n android:scaleType=\"fitEnd\"\n /\u0026gt;\n\u0026lt;/LinearLayout\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"3088798","answer_count":"1","comment_count":"0","creation_date":"2010-06-21 21:56:03.1 UTC","last_activity_date":"2010-06-21 21:58:08.383 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"62709","post_type_id":"1","score":"0","tags":"android|imageview|listactivity","view_count":"1410"} +{"id":"47598735","title":"How to avoid `require` and Access the controller of the parent component in transclusion","body":"\u003cp\u003eI'm trying to build a form component that receives an object as input and use the template defined into the object to ng-include the right template to render the form defined in the model.\u003c/p\u003e\n\n\u003cp\u003eThe problem I have is the object might be defined in the above component. For example this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;somecomponent\u0026gt;\n \u0026lt;formx object=\"$ctrl.settings\"\u0026gt;\u0026lt;/formx\u0026gt;\n \u0026lt;/somecomponent\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eUnfortunately, it doesn't seem to work. From what I read the transcluded block should be using the scope of the above controller. Is there a way to access the scope of the component \u003ccode\u003esomecomponent\u003c/code\u003e?\u003c/p\u003e\n\n\u003cp\u003eBy the way, what I'm looking for is to do the same as:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;div ng-controller=\"SomeController as ctrl\"\u0026gt;\n \u0026lt;formx object=\"ctrl.settings\"\u0026gt;\u0026lt;/formx\u0026gt;\n \u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut instead of using a plain controller I'd like to use a component without using an explicit require as the parent component might be different from time to time.\u003c/p\u003e","accepted_answer_id":"47604772","answer_count":"1","comment_count":"2","creation_date":"2017-12-01 17:41:58.88 UTC","favorite_count":"1","last_activity_date":"2017-12-02 05:06:17.247 UTC","last_edit_date":"2017-12-02 05:06:17.247 UTC","last_editor_display_name":"","last_editor_user_id":"5535245","owner_display_name":"","owner_user_id":"54606","post_type_id":"1","score":"1","tags":"angularjs|angularjs-ng-transclude","view_count":"28"} +{"id":"26508803","title":"How to make RuboCop inspect a file in a folder that starts with dot","body":"\u003cp\u003eI want to run \u003ca href=\"https://github.com/bbatsov/rubocop\" rel=\"nofollow\"\u003eRuboCop\u003c/a\u003e for \u003ca href=\"https://github.com/wikimedia/VisualEditor\" rel=\"nofollow\"\u003eVisualEditor\u003c/a\u003e repository. At the moment, the only Ruby file I could find in the repository is \u003ca href=\"https://github.com/wikimedia/VisualEditor/search?utf8=%E2%9C%93\u0026amp;q=in%3Apath%20rb\" rel=\"nofollow\"\u003e.docs/CustomTags.rb\u003c/a\u003e.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$ find . | grep rb\n./.docs/CustomTags.rb\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf I run only \u003ccode\u003erubocop\u003c/code\u003e, it does not find any files:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$ rubocop\nInspecting 0 files\n0 files inspected, no offenses detected\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI guess it ignores files in folders that start with dot (\u003ccode\u003e.docs\u003c/code\u003e).\u003c/p\u003e\n\n\u003cp\u003eRuboCop documentation on \u003ca href=\"https://github.com/bbatsov/rubocop#includingexcluding-files\" rel=\"nofollow\"\u003eincluding files\u003c/a\u003e says:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eIf you'd like it to check other files you'll need to manually pass\n them in, or to add entries for them under AllCops/Include.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eIf I provide path to the file from the command line, RuboCop finds the file:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$ rubocop .docs/CustomTags.rb \nInspecting 1 file\nW\n(...)\n1 file inspected, 26 offenses detected\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOur continuous integration just runs \u003ccode\u003erubocop\u003c/code\u003e for the repository, so I can not provide path to the file from the command line. I have to use \u003ccode\u003eAllCops/Include\u003c/code\u003e, but I can not figure out how to do it.\u003c/p\u003e\n\n\u003cp\u003eIf I create a \u003ccode\u003e.rubocop.yml\u003c/code\u003e in the root of the repository:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eAllCops:\n Include:\n - '.docs/CustomTags.rb'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand run Rubocop, it does not find the file:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$ rubocop\nInspecting 0 files\n0 files inspected, no offenses detected\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have tried several variations of the \u003ccode\u003e.rubocop.yml\u003c/code\u003e file, including:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eAllCops:\n Include:\n - '**/CustomTags.rb'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eAllCops:\n Include:\n - '.docs/**/*'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut none of them are finding the file.\u003c/p\u003e","accepted_answer_id":"26738319","answer_count":"1","comment_count":"1","creation_date":"2014-10-22 13:38:22.537 UTC","last_activity_date":"2014-11-04 14:59:35.867 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"17469","post_type_id":"1","score":"1","tags":"ruby|rubocop","view_count":"530"} +{"id":"4992677","title":"Creating CSS at rules (@rules) on the fly in Javascript","body":"\u003cp\u003eI'm creating CSS animations on the fly, so I need to insert a CSS timing function into my document. As in:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@-webkit-keyframes slide \n{\n from {\n -webkit-transform: translateX(-100px) translateY(-100px);\n -webkit-animation-timing-function: ease-in;\n }\n\n 33% {\n -webkit-transform: translateX(-100px) translateY(-50px);\n -webkit-animation-timing-function: linear;\n }\n\n 66% {\n -webkit-transform: translateX(-50px) translateY(0px);\n -webkit-animation-timing-function: linear;\n }\n\n\n to {\n -webkit-transform: translateX(0px) translateY(0px);\n -webkit-animation-timing-function: ease-out;\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny idea how to pull this off (the insertion) using Javascript? I can add regular classes without any trouble, but this seems to be a special case.\u003c/p\u003e","accepted_answer_id":"4992819","answer_count":"1","comment_count":"0","creation_date":"2011-02-14 13:27:54.88 UTC","last_activity_date":"2011-02-14 13:41:01.373 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"27214","post_type_id":"1","score":"2","tags":"javascript|css","view_count":"996"} +{"id":"37057383","title":"How to simplify complicated if then conditions?","body":"\u003cp\u003eI have a situation where I have to exclude an ever growing list of conditions in an if statement that started out rather simple\u003c/p\u003e\n\n\u003cp\u003eI've thought of looping an list/array and I use RegEx when possible.\u003c/p\u003e\n\n\u003cp\u003eI would just like to know what others have done to try and simplify these situations.\u003c/p\u003e\n\n\u003cp\u003ehere's a quick example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eif (!DataField.Contains(strText) \u0026amp; (strOtherText.IndexOf(strFindThis) \u0026lt; 0) || Regex.isMatch(strWithLetters, @\"[A-Z]\"))\n{\n //Do things;\n}\nelse\n{\n //Do Other Things;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eStill learning the RegEx but I'm working on it\u003c/p\u003e\n\n\u003cp\u003eSo far it's been strings of several words or simply certain characters.\u003c/p\u003e\n\n\u003cp\u003eFor example:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003e\"#, \u0026amp;, ^, @, and more..\"\u003c/li\u003e\n\u003cli\u003e\"Form 9999-99 invalid client name\"\u003c/li\u003e\n\u003cli\u003eCan't start with \"https\" or \"http\"\u003c/li\u003e\n\u003cli\u003eIn some case if it contains a string like \"Error Code\" then it would be saved in an alternate file instead of simply being ignored for processing\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eI have 23 of these so far\u003c/p\u003e","accepted_answer_id":"37058909","answer_count":"3","comment_count":"7","creation_date":"2016-05-05 18:07:37.787 UTC","last_activity_date":"2016-05-05 19:36:22.747 UTC","last_edit_date":"2016-05-05 18:28:04.073 UTC","last_editor_display_name":"","last_editor_user_id":"4831894","owner_display_name":"","owner_user_id":"4831894","post_type_id":"1","score":"-1","tags":"c#|.net|regex|multiple-conditions","view_count":"94"} +{"id":"12483828","title":"Flash AS3 - Colorized username list box different colors","body":"\u003cp\u003eI have found several tutorials regarding CellRenderer that will change an entire list or selected item, but Im not all that good with AS3 yet and need some help. I am loading a userlist from an xml file. Everything loads fine and well, but what Im looking to do is actually colorize it by the group.\u003c/p\u003e\n\n\u003cp\u003eAgain, it loads to the list just fine, what I am looking to do is in the loop that adds them from the xml file, if its admin make it red font, green font for mod, black for member.\u003c/p\u003e\n\n\u003cp\u003eAny help please?\u003c/p\u003e","accepted_answer_id":"12486081","answer_count":"1","comment_count":"1","creation_date":"2012-09-18 19:38:12.453 UTC","last_activity_date":"2012-09-18 22:37:10.343 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1681298","post_type_id":"1","score":"1","tags":"actionscript-3|flash|list","view_count":"1163"} +{"id":"26532178","title":"MySQL query combining several tables","body":"\u003ch2\u003eBackground\u003c/h2\u003e\n\n\u003cp\u003eIn order to obtain data for my thesis I have to work with a large, fairly\ncomplicated MySQL database, containing several tables and hundreds of GBs of\ndata. Unfortunately, I am new to SQL, and can't really figure out how to\nextract the data that I need.\u003c/p\u003e\n\n\u003ch2\u003eDatabase\u003c/h2\u003e\n\n\u003cp\u003eThe database consists of several tables that I want to combine. Here are the\nrelevant parts of it:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026gt; show tables;\n+---------------------------+\n| Tables_in_database |\n+---------------------------+\n| Build |\n| Build_has_ModuleRevisions |\n| Configuration |\n| ModuleRevisions |\n| Modules |\n| Product |\n| TestCase |\n| TestCaseResult |\n+---------------------------+\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe tables are linked together in the following manner\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eProduct ---(1:n)--\u0026gt; Configurations ---(1:n)--\u0026gt; Build\n\nBuild ---(1:n)--\u0026gt; Build_has_ModuleRevisions ---(n:1)--\u0026gt; ModuleRevision ---(n:1)--\u0026gt; Modules\n\nBuild ---(1:n)--\u0026gt; TestCaseResult ---(n:1)--\u0026gt; TestCase\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe contents of the tables are\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026gt; describe Product;\n+---------+--------------+------+-----+---------+----------------+\n| Field | Type | Null | Key | Default | Extra |\n+---------+--------------+------+-----+---------+----------------+\n| id | int(11) | NO | PRI | NULL | auto_increment |\n| name | varchar(255) | NO | UNI | NULL | |\n+---------+--------------+------+-----+---------+----------------+\n\n\n\u0026gt; describe Configuration;\n+------------+--------------+------+-----+---------+----------------+\n| Field | Type | Null | Key | Default | Extra |\n+------------+--------------+------+-----+---------+----------------+\n| id | int(11) | NO | PRI | NULL | auto_increment |\n| Product_id | int(11) | YES | MUL | NULL | |\n| name | varchar(255) | NO | UNI | NULL | |\n+------------+--------------+------+-----+---------+----------------+\n\n\n\u0026gt; describe Build;\n+------------------+--------------+------+-----+---------+----------------+\n| Field | Type | Null | Key | Default | Extra |\n+------------------+--------------+------+-----+---------+----------------+\n| id | int(11) | NO | PRI | NULL | auto_increment |\n| Configuration_id | int(11) | NO | MUL | NULL | |\n| build_number | int(11) | NO | MUL | NULL | |\n| build_id | varchar(32) | NO | MUL | NULL | |\n| test_status | varchar(255) | NO | | | |\n| start_time | datetime | YES | MUL | NULL | |\n| end_time | datetime | YES | MUL | NULL | |\n+------------------+--------------+------+-----+---------+----------------+\n\n\n\u0026gt; describe Build_has_ModuleRevisions;\n+-------------------+----------+------+-----+---------+----------------+\n| Field | Type | Null | Key | Default | Extra |\n+-------------------+----------+------+-----+---------+----------------+\n| id | int(11) | NO | PRI | NULL | auto_increment |\n| Build_id | int(11) | NO | MUL | NULL | |\n| ModuleRevision_id | int(11) | NO | MUL | NULL | |\n+-------------------+----------+------+-----+---------+----------------+\n\n\n\u0026gt; describe ModuleRevisions;\n+-----------+--------------+------+-----+---------+----------------+\n| Field | Type | Null | Key | Default | Extra |\n+-----------+--------------+------+-----+---------+----------------+\n| id | int(11) | NO | PRI | NULL | auto_increment |\n| Module_id | int(11) | NO | MUL | NULL | |\n| tag | varchar(255) | NO | MUL | | |\n| revision | varchar(255) | NO | MUL | | |\n+-----------+--------------+------+-----+---------+----------------+\n\n\n\u0026gt; describe Modules;\n+---------+--------------+------+-----+---------+----------------+\n| Field | Type | Null | Key | Default | Extra |\n+---------+--------------+------+-----+---------+----------------+\n| id | int(11) | NO | PRI | NULL | auto_increment |\n| name | varchar(255) | NO | UNI | NULL | |\n+---------+--------------+------+-----+---------+----------------+\n\n\n\u0026gt; describe TestCase;\n+--------------+--------------+------+-----+---------+----------------+\n| Field | Type | Null | Key | Default | Extra |\n+--------------+--------------+------+-----+---------+----------------+\n| id | int(11) | NO | PRI | NULL | auto_increment |\n| TestSuite_id | int(11) | NO | MUL | NULL | |\n| classname | varchar(255) | NO | MUL | NULL | |\n| name | varchar(255) | NO | MUL | NULL | |\n| testtype | varchar(255) | NO | MUL | NULL | |\n+--------------+--------------+------+-----+---------+----------------+\n\n\n\u0026gt; describe TestCaseResult;\n+-------------+--------------+------+-----+---------+----------------+\n| Field | Type | Null | Key | Default | Extra |\n+-------------+--------------+------+-----+---------+----------------+\n| id | int(11) | NO | PRI | NULL | auto_increment |\n| Build_id | int(11) | NO | MUL | NULL | |\n| TestCase_id | int(11) | NO | MUL | NULL | |\n| status | varchar(255) | NO | MUL | NULL | |\n| start_time | datetime | YES | MUL | NULL | |\n| end_time | datetime | YES | MUL | NULL | |\n+-------------+--------------+------+-----+---------+----------------+\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAs you can see the tables are linked with \u003ccode\u003e*_id\u003c/code\u003e fields. E.g. \u003ccode\u003eTestCaseResult\u003c/code\u003e\nis linked to a \u003ccode\u003eBuild\u003c/code\u003e by the \u003ccode\u003eBuild_id field\u003c/code\u003e, and to a \u003ccode\u003eTestCase\u003c/code\u003e by the\n\u003ccode\u003eTestCase_id\u003c/code\u003e field.\u003c/p\u003e\n\n\u003ch2\u003eProblem Desciption\u003c/h2\u003e\n\n\u003cp\u003eNow to my problem. Given a specific \u003ccode\u003eConfiguration.name\u003c/code\u003e and \u003ccode\u003eProduct.name\u003c/code\u003e as\ninput, I need to find all modules+revisions and failed testcases, for every\n\u003ccode\u003eBuild\u003c/code\u003e, sorted by \u003ccode\u003eBuild.start_time\u003c/code\u003e.\u003c/p\u003e\n\n\u003ch2\u003eWhat I Have Tried\u003c/h2\u003e\n\n\u003cp\u003eThe following query gives me all the \u003ccode\u003eBuild\u003c/code\u003es given a \u003ccode\u003eConfiguration.name\u003c/code\u003e of\n\u003ccode\u003econfig1\u003c/code\u003e and a \u003ccode\u003eProduct.name\u003c/code\u003e of \u003ccode\u003eproduct1\u003c/code\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT\n *\nFROM\n `database`.`Build` AS b\n JOIN\n Configuration AS c ON c.id = b.Configuration_id\n JOIN\n Product as p ON p.id = c.Product_id\nWHERE\n c.name = 'config1'\n AND p.name = 'product1'\nORDER BY b.start_time;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis doesn't even solve half of my problem, though. Now, for \u003cem\u003eevery build\u003c/em\u003e I\nneed to\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eFind \u003cem\u003eall\u003c/em\u003e \u003ccode\u003eModules\u003c/code\u003e linked to the \u003ccode\u003eBuild\u003c/code\u003e\n\n\u003cul\u003e\n\u003cli\u003eExtract the \u003ccode\u003eModules.name\u003c/code\u003e field\u003c/li\u003e\n\u003cli\u003eExtract the \u003ccode\u003eModuleRevision.revision\u003c/code\u003e field\u003c/li\u003e\n\u003c/ul\u003e\u003c/li\u003e\n\u003cli\u003eFind \u003cem\u003eall\u003c/em\u003e \u003ccode\u003eTestCase\u003c/code\u003es linked to the \u003ccode\u003eBuild\u003c/code\u003e\n\n\u003cul\u003e\n\u003cli\u003eWhere \u003ccode\u003eTestCaseResult.status = 'failure'\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003eExtract the \u003ccode\u003eTestCase.name\u003c/code\u003e field linked to the \u003ccode\u003eTestCaseResult\u003c/code\u003e\u003c/li\u003e\n\u003c/ul\u003e\u003c/li\u003e\n\u003cli\u003eAssociate the \u003ccode\u003eBuild\u003c/code\u003e with the extracted module name+revisions and testcase\nnames\u003c/li\u003e\n\u003cli\u003ePresent the data ordered by \u003ccode\u003eBuild.start_time\u003c/code\u003e so that I can perform\nanalyses on it.\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eIn other words, of all the data available, I am only interested in linking the\nfields \u003ccode\u003eModules.name\u003c/code\u003e, \u003ccode\u003eModuleRevision.revision\u003c/code\u003e, \u003ccode\u003eTestCaseResult.status\u003c/code\u003e, and\n\u003ccode\u003eTestCaseResult.name\u003c/code\u003e to a particular \u003ccode\u003eBuild\u003c/code\u003e, order this by \u003ccode\u003eBuild.start_time\u003c/code\u003e\nand then output this to a Python program I have written.\u003c/p\u003e\n\n\u003cp\u003eThe end result should be something similar to\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eBuild Build.start_time Modules+Revisions Failed tests\n 1 20140301 [(mod1, rev1), (mod2... etc] [test1, test2, ...]\n 2 20140401 [(mod1, rev2), (mod2... etc] [test1, test2, ...]\n 3 20140402 [(mod3, rev1), (mod2... etc] [test1, test2, ...]\n 4 20140403 [(mod1, rev3), (mod2... etc] [test1, test2, ...]\n 5 20140505 [(mod5, rev2), (mod2... etc] [test1, test2, ...]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003ch2\u003eMy question\u003c/h2\u003e\n\n\u003cp\u003eIs there a good (and preferrably efficient) SQL query that can extract and\npresent the data that I need?\u003c/p\u003e\n\n\u003cp\u003eIf not, I am totally okay with extracting one or several supersets/subsets of\nthe data in order to parse it with Python if necessary. But how do I extract\nthe desired data?\u003c/p\u003e","accepted_answer_id":"26532450","answer_count":"1","comment_count":"2","creation_date":"2014-10-23 15:53:40.98 UTC","favorite_count":"0","last_activity_date":"2017-03-16 16:46:49.89 UTC","last_edit_date":"2017-03-16 16:46:49.89 UTC","last_editor_display_name":"","last_editor_user_id":"4370109","owner_display_name":"","owner_user_id":"955014","post_type_id":"1","score":"2","tags":"python|mysql|database","view_count":"57"} +{"id":"40099181","title":"IFERROR INDEX/MATCH formula having application-defined or object-defined error","body":"\u003cp\u003eI am trying to create a macro allowing me to autofill data from another workbook using INDEX MATCH. I have used the exact code for another formula and it works but when i simply replace for formula in the code below, it gives me a \"application-defined or object-defined error\"\u003c/p\u003e\n\n\u003cp\u003eBelow is my code. The formula in question starts after \u003ccode\u003e.formula\u003c/code\u003e. The rest of the code exists for me to autofill empty cells and it has already worked with another macro.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSub FillOrderType() \nDim LR As Long\nLR = ActiveSheet.UsedRange.Find(\"*\", SearchDirection:=xlPrevious,\nSearchOrder:=xlByRows).Row\nWith Range(\"H2:H\" \u0026amp; LR)\nWith .SpecialCells(xlCellTypeBlanks)\n.Formula = \"=IFERROR(INDEX('C:\\Users\\wwxuan\\Desktop\\KPI OUTBOUND 23.08.16\\[KPI Outbound - ( Aug ) Rev5.xlsx]EXP'!N:N, MATCH(G:G,'C:\\Users\\wwxuan\\Desktop\\KPI OUTBOUND 23.08.16\\[KPI Outbound - ( Aug ) Rev5.xlsx]EXP'!L:L,0)), IFERROR(INDEX('C:\\Users\\wwxuan\\Desktop\\KPI OUTBOUND 23.08.16\\[KPI Outbound - ( Aug ) Rev5.xlsx]AOG'!N:N,MATCH(G:G,'C:\\Users\\wwxuan\\Desktop\\KPI OUTBOUND 23.08.16\\[KPI Outbound - ( Aug ) Rev5.xlsx]AOG'!L:L,0)),IFERROR(INDEX('C:\\Users\\wwxuan\\Desktop\\KPI OUTBOUND 23.08.16\\[KPI Outbound - ( Aug ) Rev5.xlsx]SCHED'!M:M,MATCH(G:G,'C:\\Users\\wwxuan\\Desktop\\KPI OUTBOUND 23.08.16\\[KPI Outbound - ( Aug ) Rev5.xlsx]SCHED'!K:K,0)),\"\")))\"\nEnd With\n.Value = .Value\nEnd With\n\nEnd Sub\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny help identifying the problem would be greatly appreciated. And I apologise for the long formula, I have tried to wrap it by using \u003ccode\u003e_\u003c/code\u003e but it just didn't work.\u003c/p\u003e\n\n\u003cp\u003eEDIT:\u003c/p\u003e\n\n\u003cp\u003eI believe that the issue lies solely on the formula itself since it highlights whenever I try debugging\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e=IFERROR(INDEX('C:\\Users\\wwxuan\\Desktop\\KPI OUTBOUND 23.08.16\\[KPI Outbound - ( Aug ) Rev5.xlsx]EXP'!N:N, MATCH(G:G,'C:\\Users\\wwxuan\\Desktop\\KPI OUTBOUND 23.08.16\\[KPI Outbound - ( Aug ) Rev5.xlsx]EXP'!L:L,0)), IFERROR(INDEX('C:\\Users\\wwxuan\\Desktop\\KPI OUTBOUND 23.08.16\\[KPI Outbound - ( Aug ) Rev5.xlsx]AOG'!N:N,MATCH(G:G,'C:\\Users\\wwxuan\\Desktop\\KPI OUTBOUND 23.08.16\\[KPI Outbound - ( Aug ) Rev5.xlsx]AOG'!L:L,0)),IFERROR(INDEX('C:\\Users\\wwxuan\\Desktop\\KPI OUTBOUND 23.08.16\\[KPI Outbound - ( Aug ) Rev5.xlsx]SCHED'!M:M,MATCH(G:G,'C:\\Users\\wwxuan\\Desktop\\KPI OUTBOUND 23.08.16\\[KPI Outbound - ( Aug ) Rev5.xlsx]SCHED'!K:K,0)),\"\")))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut I have little clue on how to convert it into VBA code. In the formula, the value i want lies in different worksheets in another workbook and I use IFERROR and INDEX MATCH to get the values I want.\u003c/p\u003e","accepted_answer_id":"40108856","answer_count":"1","comment_count":"7","creation_date":"2016-10-18 03:48:04.1 UTC","last_activity_date":"2016-10-18 12:53:47.927 UTC","last_edit_date":"2016-10-18 06:35:32.297 UTC","last_editor_display_name":"","last_editor_user_id":"6783766","owner_display_name":"","owner_user_id":"6783766","post_type_id":"1","score":"0","tags":"excel|vba|formula|autofill","view_count":"55"} +{"id":"31228956","title":"tkinter: How can I get the users choice of filetype in the asksaveasfilename-dialog?","body":"\u003cp\u003ecurrently, I'm programming a GUI, which should allow the user to save a file and select the filetype (lets say: jpg, bmp). I'm using tkinter with Python 3.4.\u003c/p\u003e\n\n\u003cp\u003eUnfortunately, I am unable figure out, which filetype the user has selected: I'm using the asksaveasfilename-dialog and all I can get is the path:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efrom tkinter import filedialog\npath = filedialog.asksaveasfilename(filetypes = [('Bitmap', '.bmp'),('jpg', '.jpg')])\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI can try to extract the extension from the path, but that can leed to unexpected behaviour:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eif the user doesn't provide the extension in the filename but selects the filetype, \"path\" doesn't contain any extension\u003c/li\u003e\n\u003cli\u003eif the user first decides to use the filename \"example.bmp\" but afterwards selects jpg as filetype, the extension is not updatet (as it normally is in window). So \"path\" will still be: C:\\ ... \\example.bmp \u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eIs there a way to get the filetype, that the user selected?\nIs there any other way around?\u003c/p\u003e","answer_count":"1","comment_count":"8","creation_date":"2015-07-05 09:32:06.61 UTC","favorite_count":"0","last_activity_date":"2017-07-18 08:25:46.697 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5082048","post_type_id":"1","score":"2","tags":"python|tkinter","view_count":"318"} +{"id":"24731435","title":"Googlemaps v3 groundoverlays loop","body":"\u003cp\u003eI wrote a script to load weather 10 radar maps into an array and want to display an animation on a Google map or the last image.\nMy idea was to display one image and clear it after a delay, and go to the next one.\nI can't figure out why the following code fails... Any guess ?\u003c/p\u003e\n\n\u003cp\u003eMy test page : \u003ca href=\"http://www.egloff.eu/rsmaptest/rsmap.php\" rel=\"nofollow\"\u003ehttp://www.egloff.eu/rsmaptest/rsmap.php\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eMy code :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction nextRadarMap() {\n // delete overlays\n deleteOverlays();\n // push the new images into an array of overlays\n for (i = 0; i \u0026lt; 10; i++) {\n radarMap = new google.maps.GroundOverlay(images[i], boundaries, {\n clickable: false\n });\n imagesArray.push(radarMap);\n }\n // choose to display fixed or animated image \n if (animToggle == true) {\n l = imagesArray.length;\n for (i = 0; i \u0026lt; l; i++) {\n imagesArray[i].setMap(map);\n // erase previous image. use of modulus to foolproof when i=0\n //setTimeout( function() {imagesArray[(i+l-1)%l].setMap(null)},500);\n setTimeout(function () {\n clearOverlays()\n }, 500);\n }\n } else {\n // display most recent image\n imagesArray[0].setMap(map);\n }\n}\n\n// Removes the overlays from the map, but keeps them in the array\nfunction clearOverlays() {\nif (imagesArray) {\n// for (i in imagesArray) {\n for (i=0; i\u0026lt;imagesArray.length; i++) {\n imagesArray[i].setMap(null);\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"24948516","answer_count":"1","comment_count":"8","creation_date":"2014-07-14 07:21:11.507 UTC","last_activity_date":"2014-07-25 05:15:50.693 UTC","last_edit_date":"2014-07-15 04:32:03.44 UTC","last_editor_display_name":"","last_editor_user_id":"3821402","owner_display_name":"","owner_user_id":"3821402","post_type_id":"1","score":"1","tags":"javascript|arrays|google-maps-api-3","view_count":"118"} +{"id":"44747479","title":"For loop: save results of function in separate vector for each i","body":"\u003cp\u003eI have a dataframe with two columns. One for mean, one for std. deviation.\nI'd like to run a for loop and safe the results of\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ernorm(1000,dataframe[i,1],dataframe[i,2])\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ein a vector with associated i in the name. \u003c/p\u003e\n\n\u003cp\u003eLike: vector_i, vector_i+1, vector_i+2.....\u003c/p\u003e\n\n\u003cp\u003eAny idea?\u003c/p\u003e","answer_count":"2","comment_count":"6","creation_date":"2017-06-25 14:47:12.587 UTC","last_activity_date":"2017-06-27 16:51:46.38 UTC","last_edit_date":"2017-06-25 15:09:17.197 UTC","last_editor_display_name":"","last_editor_user_id":"712649","owner_display_name":"","owner_user_id":"8211707","post_type_id":"1","score":"0","tags":"r|for-loop","view_count":"52"} +{"id":"21075835","title":"mod_rewrite - exclude urls","body":"\u003cp\u003eI need a mod_rewrite to redirect all \u003ccode\u003ehttp\u003c/code\u003e requests to \u003ccode\u003ehttps\u003c/code\u003e, but I want do exclude some URLs\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e# force https\nRewriteCond %{HTTPS} off\nRewriteCond %{HTTP_HOST} ^secure\\. [NC]\nRewriteCond %{REQUEST_URI} !gateway_callback [NC]\nRewriteRule ^. https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,QSA]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAll URLs which match \u003ccode\u003egateway_callback\u003c/code\u003e must be excluded\u003c/p\u003e\n\n\u003cp\u003eThis URL should not be redirected, but it does!?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ehttp://secure.localhost/da/gateway_callback/29/\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHave tried to flush DNS cache in the browser, but the URL is still redirected to \u003ccode\u003ehttps\u003c/code\u003e\u003c/p\u003e","accepted_answer_id":"21402116","answer_count":"2","comment_count":"3","creation_date":"2014-01-12 14:31:24.57 UTC","last_activity_date":"2014-01-30 20:23:04.947 UTC","last_edit_date":"2014-01-27 22:26:31.613 UTC","last_editor_display_name":"","last_editor_user_id":"555222","owner_display_name":"","owner_user_id":"555222","post_type_id":"1","score":"6","tags":"apache|mod-rewrite","view_count":"6203"} +{"id":"37110832","title":"Where is the error in my Conditional Statement (PHP)?","body":"\u003cp\u003e\u003cstrong\u003eThe challenge is:\u003c/strong\u003e \u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eIf n is odd, print \"Weird\".\u003c/li\u003e\n\u003cli\u003eIf n is even and in the inclusive range of 2 to 5, print \"Not Weird\".\u003c/li\u003e\n\u003cli\u003eIf n is even and in the inclusive range of 6 to 20, print \"Weird\".\u003c/li\u003e\n\u003cli\u003eIf n is even and greater than 20, print \"Not Weird\".\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003e\u003cstrong\u003eAnd My Code is:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\n$N=5;\n\nif($N%2==0 \u0026amp;\u0026amp; $N\u0026gt;20){\n echo \"Not Weird\";\n}else{\n echo \"Weird\";\n}\n?\u0026gt; \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eAnd the problem is:\u003c/strong\u003e \u003c/p\u003e\n\n\u003cp\u003eWhen I rut it locally it's okay. But when I submit it to \u003cstrong\u003e\u003ca href=\"https://www.hackerrank.com/challenges/30-conditional-statements?h_r=next-challenge\u0026amp;h_v=zen\" rel=\"nofollow\"\u003eHackerRank\u003c/a\u003e\u003c/strong\u003e then it fails their test when comes to \u003ccode\u003e$N=5;\u003c/code\u003e case. Do I have any problems in my conditional according to the challenge?\u003c/p\u003e","accepted_answer_id":"37111060","answer_count":"2","comment_count":"7","creation_date":"2016-05-09 08:19:58.193 UTC","favorite_count":"0","last_activity_date":"2016-05-09 08:51:23.433 UTC","last_edit_date":"2016-05-09 08:29:54.25 UTC","last_editor_display_name":"","last_editor_user_id":"3919155","owner_display_name":"","owner_user_id":"5256582","post_type_id":"1","score":"-2","tags":"php|if-statement|condition","view_count":"59"} +{"id":"24973913","title":"How can I import python libraries with .pyx and .c files without installing on the computer?","body":"\u003cp\u003eI am writing code for a number of other people, none of whom are particularly computer savvy. I installed python 2.7 for all of them, but I really do not want to have to install anything else. \u003c/p\u003e\n\n\u003cp\u003eTo get around installing every library that I wanted to use, I've simply been including the library source code in the same folder as my project source code. Python automatically searches for the necessary files in the working directory, and all goes well.\u003c/p\u003e\n\n\u003cp\u003eThe problem came when I tried to install pandas. Pandas is a library that includes .pyx and .c files that are compiled on install. I cannot just include these files in with my source code, because they are not in the proper form.\u003c/p\u003e\n\n\u003cp\u003eHow can I either compile these on launch or pre-compile them for ease of transfer? (And the kicker, I need a solution that works cross platform--I work on Windows 7, my colleagues work on OSX.)\u003c/p\u003e\n\n\u003cp\u003eThank you in advance.\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2014-07-26 17:57:52.393 UTC","last_activity_date":"2014-07-26 17:57:52.393 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3880274","post_type_id":"1","score":"1","tags":"python|pandas|install","view_count":"92"} +{"id":"14041109","title":"how to recognise a zebra crossing from top view using opencv?","body":"\u003cp\u003eyou can get all the details about the problem from this pdf document: www.shaastra.org/2013/media/events/70/Tab/422/Modern_Warfare_ps_v1.pdf\u003c/p\u003e\n\n\u003cp\u003ehow to recognize a zebra crossing from top view using opencv ?? \nit is not a straight zebra crossing it has some twists and turns\ni have some ideas,\n1. parallel line detection but the available techniques only works to find straight parallel not the ones that has curve in it.\n2. template matching to match a template of back to back white and black stripes but it becomes tedious since i cant find any pattern matching techniques with scaling and rotation.\u003c/p\u003e\n\n\u003cp\u003ein fact a idea on any single part of the problem will be so helpful!!\nit is driving me crazy someone please help!!!!\nany help is appreciated \nthanks in advance ....\u003c/p\u003e\n\n\u003cp\u003eNOTE:\n the zebra crossing i am talking about has the inside lines perpendicular to the border lines, just like a normal zebra crossing. only difference is that the path has curves like a river \u003c/p\u003e","answer_count":"2","comment_count":"2","creation_date":"2012-12-26 13:14:16.62 UTC","favorite_count":"1","last_activity_date":"2012-12-26 16:19:54.337 UTC","last_edit_date":"2012-12-26 16:19:54.337 UTC","last_editor_display_name":"","last_editor_user_id":"1929880","owner_display_name":"","owner_user_id":"1929880","post_type_id":"1","score":"0","tags":"opencv|computer-vision|robotics","view_count":"1142"} +{"id":"12709374","title":"Android Spinner look and feel like ICS","body":"\u003cp\u003eI like the look and feel of the Spinner in Android ICS. I support a minimum of android 2.1 so i want the Spinner to have an ICS look on the Android 2.1. Is this possible.\u003c/p\u003e\n\n\u003cp\u003eKind Regards,\u003c/p\u003e","accepted_answer_id":"12709434","answer_count":"2","comment_count":"1","creation_date":"2012-10-03 13:19:13.17 UTC","last_activity_date":"2013-06-04 10:17:38.213 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"365019","post_type_id":"1","score":"1","tags":"android","view_count":"1475"} +{"id":"10548317","title":"Append JavaScript or StyleSheet from View_Helpers called inside a Layout","body":"\u003cp\u003eis it possible to make it happen?\nMy view helper works fine if in a view that was a result of a controll. But I would like to have some dinamic layout, for example, to render a jquery menu according to the state I'm in.\u003c/p\u003e\n\n\u003cp\u003eIf I call the helper from layout headScript never happens to echo the appendScript command I did inside the helper.\u003c/p\u003e\n\n\u003cp\u003ethanks!\u003c/p\u003e","accepted_answer_id":"10548955","answer_count":"2","comment_count":"1","creation_date":"2012-05-11 08:52:30.46 UTC","last_activity_date":"2012-05-11 09:39:11.597 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"137149","post_type_id":"1","score":"0","tags":"zend-framework","view_count":"210"} +{"id":"41539015","title":"AngularJS 1.6 Routing","body":"\u003cp\u003eI'm setting up my routing for a AngularJS v1.6 app, but I am running into a slight problem.\u003c/p\u003e\n\n\u003cp\u003eI am getting the following error, and I can't seem to figure out what is wrong. I hope you guys can shed some light into my error. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eUncaught Error: [$injector:modulerr] \u0026lt;http://errors.angularjs.org/1.6.1/$injector/modulerr?p0=app\u0026amp;p1=Error%3A%20%…ogleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.6.1%2Fangular.min.js%3A21%3A332\u0026gt;)\n at angular.js:38\n at angular.js:4759\n at q (angular.js:357)\n at g (angular.js:4720)\n at eb (angular.js:4642)\n at c (angular.js:1838)\n at Mc (angular.js:1859)\n at pe (angular.js:1744)\n at angular.js:32977\n at HTMLDocument.b (angular.js:3314)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBelow is my code:\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eapp.js;\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e(function () {\n \"use strict\";\n\n angular.module(\"app\", [\n \"ngRoute\",\n \"app.home\",\n \"app.products\",\n \"app.contact\"\n ])\n\n .config(function ($routeProvider) {\n\n $routeProvider\n .when(\"/\",\n {\n controller: \"homeController\",\n templateUrl: \"app/components/home/home.html\"\n })\n .when(\"/products\",\n {\n controller: \"productsController\",\n templateUrl: \"app/components/products/products.html\"\n })\n .when(\"/contact\",\n {\n controller: \"contactController\",\n templateUrl: \"app/components/contact/contact.html\"\n });\n });\n\n})();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is one of my controller (All 3 are the same) ...\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e(function() {\n \"use strict\";\n\n angular\n .module(\"app.home\", [])\n .controller(\"homeController\", homeController);\n\n function homeController() {\n this.helloWorld = \"Hello World\";\n }\n\n});\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"3","comment_count":"1","creation_date":"2017-01-08 23:23:04.87 UTC","last_activity_date":"2017-02-01 12:35:09.577 UTC","last_edit_date":"2017-01-25 12:59:50.153 UTC","last_editor_display_name":"","last_editor_user_id":"4927984","owner_display_name":"","owner_user_id":"6144648","post_type_id":"1","score":"0","tags":"angularjs|routing|angularjs-1.6","view_count":"2897"} +{"id":"43060555","title":"Simple email regex, make sure user includes dot domain?","body":"\u003cp\u003eI don't mess around with Regex too much but have been able to get this one online. \u003ccode\u003e/.+@.+/\u003c/code\u003e. This will return true with both \u003ccode\u003ejoe@joe\u003c/code\u003e and \u003ccode\u003ejoe@joe.com\u003c/code\u003e. I want to make it so a user must supply a domain extension otherwise I want it to fail, I presume this is quite simple but I just can't figure it out. I've tried \u003ccode\u003e/.+@.+.\\S/\u003c/code\u003e but that didn't work. Any help would be great, thanks!\u003c/p\u003e\n\n\u003cp\u003eThis will be used in both PHP and javascript. The current one works in both, the new will need to also.\u003c/p\u003e","accepted_answer_id":"43060601","answer_count":"5","comment_count":"2","creation_date":"2017-03-28 04:17:26.897 UTC","last_activity_date":"2017-03-28 06:24:14.947 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3418376","post_type_id":"1","score":"1","tags":"javascript|php|jquery|regex","view_count":"209"} +{"id":"43756272","title":"How to store output of os.system() in a variable","body":"\u003cp\u003eI wrote a small code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport os\nos.system('users')\nos.system('w')\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis prints \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eubuntu\n 09:27:25 up 9 days, 21:23, 1 user, load average: 0.00, 0.00, 0.00\nUSER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT\nubuntu pts/0 42.99.164.66 09:06 5.00s 0.10s 0.00s sh -c w\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut when i try :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport os\nfrom pyslack import SlackClient\n\nuser_name = os.system('users')\nlogin_details = os.system('w')\n\nprint user_name\nprint login_details\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt has the following output:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eubuntu\n 09:28:32 up 9 days, 21:24, 1 user, load average: 0.00, 0.00, 0.00\nUSER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT\nubuntu pts/0 42.99.164.66 09:06 0.00s 0.11s 0.00s w\n0\n0\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow i am not sure why i am not able to store the result in the varible , i.e why is it printing 0 ? And what should be the correct way to get rid of it?\u003c/p\u003e","answer_count":"3","comment_count":"1","creation_date":"2017-05-03 09:34:02.273 UTC","last_activity_date":"2017-05-03 10:10:13.087 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4482582","post_type_id":"1","score":"1","tags":"python|os.system","view_count":"2270"} +{"id":"38536686","title":"Android Studio Gradle Option Error","body":"\u003cp\u003eWhen I went to re-sync my project to gradle, the option is grayed out. Why is this? How can I prevent this? I have tried opening new projects and the option is grayed out there as well. Additionally it worked earlier in the day.\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2016-07-22 23:42:13.587 UTC","last_activity_date":"2016-07-22 23:42:13.587 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6502286","post_type_id":"1","score":"0","tags":"android|android-gradle","view_count":"30"} +{"id":"42739649","title":"Firefox and owl carousel issue","body":"\u003cp\u003eI'm not 100% sure if this is the correct spot to post this question. \nIn a website I'm using \u003ccode\u003eowl carousel 2\u003c/code\u003e. This plugin works perfectly however I noticed a weird issue in FireFox. \u003c/p\u003e\n\n\u003cp\u003eIt looks like either owl-carousel or Firefox adds black lines around an owl-item. \nThis only happens (as far I can see) on 4k screens. \u003c/p\u003e\n\n\u003cp\u003eDoes anybody experienced the same issue? Does anybody know what that can be and how to fix that? \u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/C8m0l.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/C8m0l.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\nThis has probably something to do with 3d rendering??\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-03-11 19:30:50.597 UTC","last_activity_date":"2017-03-11 19:30:50.597 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1420771","post_type_id":"1","score":"0","tags":"jquery|firefox|owl-carousel","view_count":"294"} +{"id":"5151116","title":"Split Screen In Two (Horizontally or Vertically)","body":"\u003cp\u003eI am trying to build a screen that is split down the middle horizontally when in landscape and vertically when in portrait. I have tried the below, but it does not work like I was expecting. Any help would be greatly appreciated!\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" encoding=\"utf-8\"?\u0026gt;\n\u0026lt;LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:orientation=\"horizontal\" android:layout_width=\"fill_parent\"\n android:layout_height=\"fill_parent\"\u0026gt;\n \u0026lt;LinearLayout android:layout_width=\"wrap_content\"\n android:layout_height=\"fill_parent\" android:layout_gravity=\"left\"\n android:orientation=\"horizontal\"\u0026gt;\n \u0026lt;ListView android:layout_width=\"fill_parent\" android:id=\"@+id/lvChoices\"\n android:layout_gravity=\"left\" android:layout_height=\"fill_parent\" /\u0026gt;\n \u0026lt;/LinearLayout\u0026gt;\n \u0026lt;LinearLayout android:layout_width=\"fill_parent\"\n android:layout_height=\"fill_parent\" android:orientation=\"horizontal\"\u0026gt;\n \u0026lt;ListView android:layout_width=\"fill_parent\" android:id=\"@+id/lvOptions\"\n android:layout_gravity=\"right\" android:layout_height=\"fill_parent\" /\u0026gt;\n \u0026lt;/LinearLayout\u0026gt;\n\u0026lt;/LinearLayout\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"5151133","answer_count":"1","comment_count":"0","creation_date":"2011-03-01 06:10:19.86 UTC","last_activity_date":"2011-03-01 06:26:33.117 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"194261","post_type_id":"1","score":"1","tags":"android|android-layout","view_count":"7975"} +{"id":"37436238","title":"SelectedItem binding stops working when using custom DataTemplate on Listbox","body":"\u003cp\u003eI've got a simple \u003ccode\u003eListBox\u003c/code\u003e which entries are bound from an \u003ccode\u003eObservableCollection\u0026lt;T\u0026gt;\u003c/code\u003e inside the view model. Additionally, I got a binding to a \u003cem\u003eSelectedItem\u003c/em\u003e property.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;ListBox ItemsSource=\"{Binding Entries}\" SelectedItem=\"{Binding SelectedEntry}\" /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFor some requirements I need to modify the actual list box items, so I made a custom \u003ccode\u003eDataTemplate\u003c/code\u003e like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;DataTemplate\u0026gt;\n \u0026lt;ListBoxItem ... /\u0026gt;\n\u0026lt;/DataTemplate\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, as soon as the \u003ccode\u003eDataTemplate\u003c/code\u003e is there, the \u003cem\u003eSelectedItem\u003c/em\u003e binding stops working. It just doesn't fire at all, no matter what I do. If I take the whole \u003ccode\u003eDataTemplate\u003c/code\u003e away, it starts working again. Since I've got a custom \u003ccode\u003eListBoxItem\u003c/code\u003e, do I have to somehow bind itself to the \u003ccode\u003eSelectedItem\u003c/code\u003e property of the \u003ccode\u003eListBox\u003c/code\u003e? Or am I simply missing something here?\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003ch3\u003eFull Code\u003c/h3\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;ListBox x:Name=\"Entries\" ItemsSource=\"{Binding Entries}\" Grid.Column=\"1\" Margin=\"5, 5, 0, 5\" SelectedItem=\"{Binding SelectedEntry}\" \u0026gt;\n \u0026lt;ListBox.ItemContainerStyle\u0026gt;\n \u0026lt;Style TargetType=\"ListBoxItem\"\u0026gt;\n \u0026lt;Setter Property=\"Height\" Value=\"5\" /\u0026gt;\n \u0026lt;Setter Property=\"Margin\" Value=\"0\" /\u0026gt;\n \u0026lt;Setter Property=\"Padding\" Value=\"0\" /\u0026gt;\n \u0026lt;Setter Property=\"BorderThickness\" Value=\"0\" /\u0026gt;\n \u0026lt;Setter Property=\"HorizontalContentAlignment\" Value=\"Stretch\" /\u0026gt;\n \u0026lt;/Style\u0026gt;\n \u0026lt;/ListBox.ItemContainerStyle\u0026gt;\n \u0026lt;ListBox.ItemTemplate\u0026gt;\n \u0026lt;DataTemplate\u0026gt;\n \u0026lt;ListBoxItem Background=\"{Binding EntryColor}\" \n ToolTipService.InitialShowDelay=\"0\" \n ToolTip=\"{Binding SequenceNumber, StringFormat=Sequence {0:D12}}\" /\u0026gt;\n \u0026lt;/DataTemplate\u0026gt;\n \u0026lt;/ListBox.ItemTemplate\u0026gt;\n \u0026lt;/ListBox\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"1","creation_date":"2016-05-25 11:48:42.407 UTC","last_activity_date":"2016-05-25 21:56:09.59 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5071571","post_type_id":"1","score":"1","tags":"c#|wpf|mvvm|listbox|caliburn.micro","view_count":"168"} +{"id":"19273860","title":"How to center text in a div element?","body":"\u003cp\u003eI'm trying to create square element, that will have text centered both vertically and horizontally. Additionally, the whole area of the square should be a link. This is my HTML:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"w1h1 medium\"\u0026gt;\n \u0026lt;a class=\"userLink\" target=\"_blank\" href=\"Fancybox.aspx\"\u0026gt;\n \u0026lt;table style=\"width: 100%; height: 100%\"\u0026gt;\n \u0026lt;tr style=\"vertical-align: central\"\u0026gt;\n \u0026lt;td style=\"text-align: center; font-weight: bold;\"\u0026gt;\n text in the middle \n \u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;/table\u0026gt;\n \u0026lt;/a\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd this is my CSS:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ediv.w1h1 {\n width: 150px;\n height: 150px;\n}\n\n.medium {\n background-color: #06849b;\n color: white;\n font-family: sans-serif;\n}\n\na.userLink\n{\n width: 150px;\n height: 150px;\n display: table;\n color: #FFFFFF;\n text-decoration: none;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt works in Chrome and Firefox, but not in Internet Explorer. In IE the text is at the top of the square, not in the middle. Can you help me with this?\u003c/p\u003e\n\n\u003cp\u003eI just created playground here: \u003ca href=\"http://jsfiddle.net/Tschareck/yfnnm/\" rel=\"nofollow noreferrer\"\u003ehttp://jsfiddle.net/Tschareck/yfnnm/\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"19274171","answer_count":"7","comment_count":"2","creation_date":"2013-10-09 13:44:26.55 UTC","favorite_count":"1","last_activity_date":"2017-08-20 18:08:55.383 UTC","last_edit_date":"2017-08-20 18:08:55.383 UTC","last_editor_display_name":"","last_editor_user_id":"3257186","owner_display_name":"","owner_user_id":"1145368","post_type_id":"1","score":"7","tags":"html|css","view_count":"54056"} +{"id":"1945238","title":"dynamically create a class without a namespace","body":"\u003cp\u003eI am trying to dynamically create a class using the eval method. It is working fine except for one small problem. As my code shows I am creating the Browser class inside the BrowserFactory class. When I do this the Browser class has an added namespace of BrowserFactory. Is there anyway to evaluate the Browser class from a string without the BrowserFactory namespace being attached?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\nclass BrowserFactory\n def self.create_browser(browser)\n super_class = nil\n case browser\n when 'IE'\n require 'watir'\n super_class = 'Watir::IE'\n when 'celerity'\n require 'celerity'\n super_class = 'Celerity::Browser'\n end\n\n raise StandardError.new(\"Browser '#{browser}' is not currentlys supported\") if super_class.nil?\n\n eval \u0026#60;\u0026#60;EOS\nclass Browser \u0026#60; #{super_class}\ninclude Singleton\ninclude BrowserModification\nend\nEOS\n\n return Browser.instance\n end\n\nend\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"1947256","answer_count":"3","comment_count":"0","creation_date":"2009-12-22 09:39:48.2 UTC","favorite_count":"3","last_activity_date":"2010-05-23 14:21:04.97 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5004","post_type_id":"1","score":"1","tags":"ruby|metaprogramming|eval","view_count":"325"} +{"id":"13517161","title":"Search and replace with shell script","body":"\u003cp\u003eI need a shell script to find and replace text that would go like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eFor each line in a file\n find equation mark \"=\"\n remove everything up to the equation mark on that line and replace it with the string cuts[Counter] where Counter counts how many times such substitutions have been made.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCould anybody help me out with getting started with a script like that?\u003c/p\u003e","accepted_answer_id":"13517225","answer_count":"3","comment_count":"0","creation_date":"2012-11-22 16:56:04.923 UTC","favorite_count":"1","last_activity_date":"2012-11-23 06:10:57.24 UTC","last_edit_date":"2012-11-22 17:05:59.43 UTC","last_editor_display_name":"","last_editor_user_id":"1066031","owner_display_name":"","owner_user_id":"1557956","post_type_id":"1","score":"1","tags":"bash|shell|sed|awk","view_count":"443"} +{"id":"41220179","title":"Jekyll: Include Menu at different levels makes problems","body":"\u003cp\u003eI include an overall menu with jekyll at different pages.\u003c/p\u003e\n\n\u003cp\u003eSo this menu is for example included in index.html but also at deeper levels like \u003ccode\u003e/portfolios/someportfolio.html\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eNow the issue is that the menu links do not work at deeper levels.\nThey include the submenu path like \u003ccode\u003e.../\u0026lt;b\u0026gt;portfolios\u0026lt;/b\u0026gt;/menuitem.html\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eWhat can I do to address this?\u003c/p\u003e","accepted_answer_id":"41230032","answer_count":"1","comment_count":"1","creation_date":"2016-12-19 10:09:52.533 UTC","last_activity_date":"2016-12-19 23:42:57.83 UTC","last_edit_date":"2016-12-19 11:26:47.6 UTC","last_editor_display_name":"","last_editor_user_id":"6612932","owner_display_name":"","owner_user_id":"2656732","post_type_id":"1","score":"1","tags":"jekyll|liquid","view_count":"41"} +{"id":"6115718","title":"why multiple background images does not work for IE?","body":"\u003cp\u003eI have this code which works nice in Chrome and Firefox, but on IE only the second background image appears... Do you know why?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e $('input[type=button]').click(function() {\n //search for the button\n var button = document.getElementsByName(\"contactme\");\n //change the image\n button[0].style.background = \"url(http://www.restorationsos.com/imgs/loader.gif) no-repeat, url('http://www.restorationsos.com/imgs/btnBG.gif') repeat-x\";\n //change the text\n button[0].value = \"We Are Connecting You...\";\n button[0].style.textAlign = \"right\";\n button[0].style.color = \"#ea2400\";\n //disable the button\n button[0].disabled = true;\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eLive: \u003ca href=\"http://jsfiddle.net/cristiboariu/pUeue/21/\" rel=\"nofollow\"\u003ehttp://jsfiddle.net/cristiboariu/pUeue/21/\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"6115751","answer_count":"2","comment_count":"2","creation_date":"2011-05-24 19:22:03.493 UTC","last_activity_date":"2011-05-24 19:24:49.78 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"174349","post_type_id":"1","score":"0","tags":"javascript|css","view_count":"460"} +{"id":"25205947","title":"Google Analytics - Track users questionnaire scores","body":"\u003cp\u003eI'm building a questionnaire where the user completes a set of multiple choice questions which eventually scores them into one of three categorises - low/medium/high.\u003c/p\u003e\n\n\u003cp\u003eA click event on a 'Get score' button stores the user score into a js variable.\u003c/p\u003e\n\n\u003cp\u003eIs there anyway i can track (using google analytics) how many users scored under each of these categories? Would i need to use custom variables for this?\u003c/p\u003e\n\n\u003cp\u003eSami.\u003c/p\u003e","accepted_answer_id":"25209235","answer_count":"1","comment_count":"0","creation_date":"2014-08-08 14:34:55.627 UTC","favorite_count":"1","last_activity_date":"2014-08-11 21:30:02.133 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1574676","post_type_id":"1","score":"1","tags":"javascript|variables|google-analytics|analytics","view_count":"231"} +{"id":"26382989","title":"OpenJDK Client VM - Cannot allocate memory","body":"\u003cp\u003eI am running Hadoop map reduce job on a cluster. \nI am getting this error. \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eOpenJDK Client VM warning: INFO: os::commit_memory(0x79f20000, 104861696, 0) failed; error='Cannot allocate memory' (errno=12) \u003c/p\u003e\n \n \u003cp\u003eThere is insufficient memory for the Java Runtime Environment to continue. \u003c/p\u003e\n \n \u003cp\u003eNative memory allocation (malloc) failed to allocate 104861696 bytes for committing reserved memory.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003ewhat to do ?\u003c/p\u003e","answer_count":"3","comment_count":"0","creation_date":"2014-10-15 12:45:19.533 UTC","last_activity_date":"2017-07-22 23:35:54.043 UTC","last_edit_date":"2015-06-12 09:18:25.673 UTC","last_editor_display_name":"","last_editor_user_id":"317266","owner_display_name":"","owner_user_id":"4001057","post_type_id":"1","score":"3","tags":"java|hadoop|memory|mapreduce|jvm","view_count":"4861"} +{"id":"42677443","title":"Force iOS Device to Download App","body":"\u003cp\u003eI wonder if it is possible to force an iOS Device to download an app.\u003c/p\u003e\n\n\u003cp\u003eI have a 1 Year Apple Developer Account and i can create Profiles.\u003c/p\u003e\n\n\u003cp\u003eI heard that if Users install your Profile Configuration you can do some actions.\nNow i thought instead of connecting a Device over USB to PC and Load an IPA to the Device , to Force a Device UDID (with a Installed Profile) to download an App without having it to be connected to pc\u003c/p\u003e","accepted_answer_id":"42678763","answer_count":"1","comment_count":"2","creation_date":"2017-03-08 17:02:39.903 UTC","last_activity_date":"2017-03-08 18:09:15.357 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4590135","post_type_id":"1","score":"0","tags":"ios|iphone|apple-developer","view_count":"308"} +{"id":"21948197","title":"PHP breaking URL by encoding ampersand","body":"\u003cp\u003eI'm debugging a site where this code is intended to display in image:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;a href=\"\u0026lt;?=$auction_link;?\u0026gt;\"\u0026gt;\u0026lt;img src=\"\u0026lt;? echo ((!empty($main_image)) ? 'thumbnail.php?pic=' . $main_image . '\u0026amp;w=' . $layout['hpfeat_width'] . '\u0026amp;sq=Y' : 'themes/' . $setts['default_theme'] . '/img/system/noimg.gif');?\u0026gt;\" border=\"0\" alt=\"\u0026lt;?=$item_details[$counter]['name'];?\u0026gt;\"\u0026gt;\u0026lt;/a\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNo image is displayed, evidently because the href value is being converted to:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ethumbnail.php?pic=uplimg/img_A_100430_b93204949c62ffba35eb62f1b94b93c4.jpg\u0026amp;amp;w=0\u0026amp;amp;sq=Y\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen it should be:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ethumbnail.php?pic=uplimg/img_A_100430_b93204949c62ffba35eb62f1b94b93c4.jpg\u0026amp;w=250\u0026amp;sq=Y\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNote the \u003ccode\u003e\u0026amp;amp;\u003c/code\u003e where the \u0026amp; should be in two places. Is there anyway to stop the encoding?\u003c/p\u003e\n\n\u003cp\u003eThanks - Joe \u003c/p\u003e","answer_count":"3","comment_count":"2","creation_date":"2014-02-22 01:03:15.443 UTC","favorite_count":"1","last_activity_date":"2015-08-10 16:23:42.95 UTC","last_edit_date":"2014-02-22 01:04:53.813 UTC","last_editor_display_name":"","last_editor_user_id":"1353011","owner_display_name":"","owner_user_id":"1286623","post_type_id":"1","score":"0","tags":"php|url|encode","view_count":"956"} +{"id":"45425066","title":"tableview header moves down when reloading. Swift -iOS","body":"\u003cp\u003eI am using a Tabbarcontroller with navigation bar.\nThere are two ViewControllers in the Tabbarcontroller.\nThere is a search bar and below it i display a table.\nThis table is grouped normally. It displays date based grouped customCellA, and the date is my header.\nWhen searching I clear the header height (to zero) and and display a single section. This section contains search result displayed in customCellB.\u003c/p\u003e\n\n\u003cp\u003eAll the above ui have been created in storyboard\u003c/p\u003e\n\n\u003cp\u003eWhen I switch between tabbars and come back to this viewController. The gap between the search bar (which includes header) and the first cell group seems to increase. \u003c/p\u003e\n\n\u003cp\u003eI tried different options like (mostly in viewwillappear)\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eCalling reloadData() twice\u003c/li\u003e\n\u003cli\u003ecalling tableView.layoutSubviews()\u003c/li\u003e\n\u003cli\u003eautomaticallyAdjustsScrollViewInsets\u003c/li\u003e\n\u003cli\u003econtentOffset\u003c/li\u003e\n\u003cli\u003eedgesForExtendedLayout\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eShould i use them in viewdidlayoutsubviews...?\u003c/p\u003e\n\n\u003cp\u003eI Used folllowin links\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003ca href=\"https://stackoverflow.com/questions/37206807/swift-ios-9-section-header-change-position-after-reload-data\"\u003eSwift ios 9: Section header change position after reload data\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://stackoverflow.com/questions/19173630/ios-7-custom-tableview-is-under-tabbar\"\u003eiOS 7 Custom TableView Is Under TabBar\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://stackoverflow.com/questions/41392421/swift-tableview-scrolls-under-navigation-bar-but-over-status-bar\"\u003eSwift: Tableview scrolls under navigation bar but over status bar?\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003eand more\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eNothing seems to work. I am not sure where i am going wrong.\nI am using swift3 and xcode 8.3.X\u003c/p\u003e\n\n\u003cp\u003eI am unable to show the error here as its official project.\nPlease suggest a possible solution. \u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2017-07-31 20:50:37.547 UTC","last_activity_date":"2017-07-31 21:04:28.643 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6635028","post_type_id":"1","score":"0","tags":"ios|swift|xcode|swift3|storyboard","view_count":"160"} +{"id":"12170141","title":"Real time communication","body":"\u003cp\u003eI have the same dilemma as the one who posted this topic, \u003ca href=\"https://stackoverflow.com/questions/2760446/real-time-communication-with-wcf/12170119#12170119\"\u003eReal-time communication with WCF\u003c/a\u003e\nexcept that my problem is not about games programming. I would like to know what's the best method to use to be able to have a real time communication in between two windows applications (server-client). I am using visual c++/c# to date and i would like to be able to display all the Feeds that are being received by my server to the client in real time.\u003c/p\u003e\n\n\u003cp\u003eI have started trying to use .NET remoting but in my continuous research, it appears that it will use SOAP-http, and might affect the speed of the communication. My server and client will communicate using the internet and .NET remoting does not permit the use of TCP Channel when communicating in between a firewall or the internet.\u003c/p\u003e\n\n\u003cp\u003eYour inputs will be greatly appreciated.\u003c/p\u003e","answer_count":"2","comment_count":"5","creation_date":"2012-08-29 02:33:58.463 UTC","favorite_count":"3","last_activity_date":"2013-08-02 16:27:36.277 UTC","last_edit_date":"2017-05-23 12:20:10.193 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"1631864","post_type_id":"1","score":"3","tags":"c#|.net|visual-c++","view_count":"1094"} +{"id":"30453667","title":"Sorting on associated domain objects with DetachedCriteria","body":"\u003cp\u003eHaving such a domain model:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epackage com\nclass Bar {\n String barName\n} \n\npackage com\nclass Foo {\n\n static belongsTo = [bar: Bar]\n\n String fooName\n Integer fooAge\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm able to construct following criteria, some context:(\u003ca href=\"https://stackoverflow.com/questions/7862077/grails-list-gsp-gsortablecolumn-being-able-to-sort-on-associated-domain-obje\"\u003egrails list.gsp / g:sortableColumn: being able to sort on associated domain objects\u003c/a\u003e):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e params.sort = 'bar.barName'\n def foos = Foo.createCriteria().list(params){\n gt 'fooAge', 10\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut when using DetachedCriteria it fails:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e params.sort = 'bar.barName'\n def foos = new DetachedCriteria(Foo).build {\n gt 'fooAge', 10\n }.list(params)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eexception:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecould not resolve property: bar.barName of: com.Foo. Stacktrace follows:\nMessage: could not resolve property: bar.barName of: com.Foo\n Line | Method\n-\u0026gt;\u0026gt; 87 | initialize in grails.gorm.PagedResultList\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \n| 50 | getTotalCount in ''\n| 26 | $tt__index . in com.FooController$$EPB9xU8u\n| 198 | doFilter in grails.plugin.cache.web.filter.PageFragmentCachingFilter\n| 63 | doFilter . . in grails.plugin.cache.web.filter.AbstractFilter\n| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor\n| 615 | run . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker\n^ 745 | run in java.lang.Thread\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs there a way around this?\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2015-05-26 08:42:33.33 UTC","last_activity_date":"2015-05-26 08:42:33.33 UTC","last_edit_date":"2017-05-23 12:30:07.947 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"1788766","post_type_id":"1","score":"0","tags":"grails|gorm","view_count":"88"} +{"id":"15399331","title":"how to take complete control of zend2 form styling?","body":"\u003cp\u003eI was following this guide (\u003ca href=\"http://framework.zend.com/manual/2.0/en/user-guide/forms-and-actions.html\" rel=\"nofollow\"\u003ehttp://framework.zend.com/manual/2.0/en/user-guide/forms-and-actions.html\u003c/a\u003e) and the \"zend\" way of writing form fields is something like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e $this-\u0026gt;add(array(\n 'name' =\u0026gt; 'title',\n 'attributes' =\u0026gt; array(\n 'type' =\u0026gt; 'text',\n ),\n 'options' =\u0026gt; array(\n 'label' =\u0026gt; 'Title',\n ),\n ));\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe resulting HTML is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;label\u0026gt;\n\u0026lt;span\u0026gt;Surname/Faculty\u0026lt;/span\u0026gt;\n\u0026lt;input type=\"text\" value=\"\" name=\"title\"\u0026gt;\n\u0026lt;/label\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI can supply \"class\" parameter to the form field but supplying \"class\" to the label does nothing. I also want to include a \"br\" tag at the end of the \"label\" tag.\u003c/p\u003e\n\n\u003cp\u003eany ideas on how to make it work? I've looked at recent examples and tutorials (seems decorators have been phased out of zend2?) but I can't find what I'm looking for. thanks\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-03-14 00:55:28.66 UTC","last_activity_date":"2013-04-02 15:09:00.763 UTC","last_edit_date":"2013-04-02 15:09:00.763 UTC","last_editor_display_name":"","last_editor_user_id":"1258925","owner_display_name":"","owner_user_id":"1790598","post_type_id":"1","score":"1","tags":"php|zend-framework2|zend-form","view_count":"182"} +{"id":"32699197","title":"GCC option to specify the filename which is being compiled","body":"\u003cp\u003eAssume there are 3 files which I need to compile, a.cpp, b.cpp and c.cpp.\nWhen I compile the above 3 files using microsoft compiler, the compiler outputs the file name which it completed compiling.\u003c/p\u003e\n\n\u003cp\u003eex: cl a.cpp b.cpp c.cpp \u003c/p\u003e\n\n\u003cp\u003ea.cpp\u003c/p\u003e\n\n\u003cp\u003eb.cpp\u003c/p\u003e\n\n\u003cp\u003ec.cpp\u003c/p\u003e\n\n\u003cp\u003eBut GCC compiler doesnot output the filename which it completed compiling.\u003c/p\u003e\n\n\u003cp\u003eex: g++ a.cpp b.cpp c.cpp\u003c/p\u003e\n\n\u003cp\u003e//no output is shown.\u003c/p\u003e\n\n\u003cp\u003eIs there any option in GCC and clang which will show the filename after the compilation of it.\u003c/p\u003e\n\n\u003cp\u003eSorry for the terrible english.\nAlso I don't need any suggestions about achieving the desired result using make files. \u003c/p\u003e\n\n\u003cp\u003eThanks inadvance \u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2015-09-21 15:35:01.4 UTC","last_activity_date":"2015-09-21 15:40:33.43 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5358795","post_type_id":"1","score":"0","tags":"gcc|llvm-gcc","view_count":"135"} +{"id":"23722579","title":"JetBrains IntelliJ IDEA SVN SSH configuration","body":"\u003cp\u003eI am trying to configure my JetBrains IntelliJ IDEA to integrate with SVN\u003c/p\u003e\n\n\u003cp\u003eI need to put in the authentication realm,\u003c/p\u003e\n\n\u003cp\u003eI already put it once, but I misspelled one letter, and now it wont let me change it\u003c/p\u003e\n\n\u003cp\u003ealso I need to put in SSH credentials\u003c/p\u003e\n\n\u003cp\u003eif I create a new repository and try to checkout my project to that repository it asks me for username and password with no option to enter ssh credentials\u003c/p\u003e\n\n\u003cp\u003ehow do I fix this ?\u003c/p\u003e\n\n\u003cp\u003eI tried looking on the jetbrains man pages, but nothing I can find there \u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2014-05-18 13:43:17.763 UTC","last_activity_date":"2014-06-25 16:04:22.38 UTC","last_edit_date":"2014-05-24 16:07:08.257 UTC","last_editor_display_name":"","last_editor_user_id":"145757","owner_display_name":"","owner_user_id":"2136812","post_type_id":"1","score":"2","tags":"svn|ssh|intellij-idea|jetbrains","view_count":"1683"} +{"id":"17019680","title":"how to call on resume when activity is destroyed?","body":"\u003cp\u003eI have activity A which creates list view and has \u003ccode\u003eonResume\u003c/code\u003e action to update adapter.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprotected void onResume() {\n super.onResume();\n ma.notifyDataSetChanged();\n Log.d(\"resumed\",\"true\");\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAlso I have activity B. How can I call A's \u003ccode\u003eonResume\u003c/code\u003e, when B is destroyed or it pressed \u003ccode\u003eback\u003c/code\u003e from activity B?\u003c/p\u003e","accepted_answer_id":"17019716","answer_count":"1","comment_count":"0","creation_date":"2013-06-10 08:25:30.083 UTC","last_activity_date":"2013-06-10 08:34:10.98 UTC","last_edit_date":"2013-06-10 08:34:10.98 UTC","last_editor_display_name":"","last_editor_user_id":"1551603","owner_display_name":"","owner_user_id":"1551603","post_type_id":"1","score":"0","tags":"android|android-activity|onresume","view_count":"241"} +{"id":"9864255","title":"How to get the value of a drop down selected value with the parent as the selected element in jQuery","body":"\u003cp\u003eHistory:\u003c/p\u003e\n\n\u003cp\u003eI'm using the children method because I'll be looping through \u003ccode\u003ediv\u003c/code\u003es that have content in them that is dynamically generated by the user, so there's no way of me knowing how many divs there will be. If there is another method I should be using, by all means, show me :)\u003c/p\u003e\n\n\u003cp\u003eI'm having trouble here using the following code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(\"[name = listItem]\").each( function (){\nvar z = $(this).children(\"[name='dropDown'] option:selected\").val();\nalert(z);\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn this example the output would be an alert box with:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eundefined\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt's strange because this way bellow works fine!\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar z = $(\"[name='dropDown'] option:selected\").val();\nalert(z);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethe output for this would be the appropriate value:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e1\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003efor the \u003ccode\u003echildren()\u003c/code\u003e method, I thought you could use the standard selector syntax. What do you think?\u003c/p\u003e","accepted_answer_id":"9864314","answer_count":"1","comment_count":"1","creation_date":"2012-03-25 21:29:31.767 UTC","last_activity_date":"2012-03-25 21:39:10.26 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"789757","post_type_id":"1","score":"0","tags":"jquery|select|parent","view_count":"527"} +{"id":"42726812","title":"SQL Azure DMV Reset","body":"\u003cp\u003eI was looking at a custom database for a client today and in looking at the usual DMV's for query stats ie. \nSELECT *\nFROM sys.dm_exec_query_stats AS s \nCROSS APPLY sys.dm_exec_sql_text(plan_handle) AS q\u003c/p\u003e\n\n\u003cp\u003eI had a number of queries with thousands of executions. When I went to look at high execution sp's I got 0 rows. I looked at high-read sp's and got 0 rows. I then went and looked at my original high execution queries and noticed the results had changed and my highest executions were suddenly ~500. I then re-ran the sp queries and got some results, most with 1 execution. From my understanding the only thing that clears these are service/server restart and DBCC FREExxx() commands being run. Is there something else in the Azure environment that would cause this? Would low memory force these to clear out? I wouldn't expect that to be the case as I would expect to still see something in the results as it cycles but maybe there is something I'm missing. Open to any thoughts on this as I have spent most of my days on-prem. \u003c/p\u003e\n\n\u003cp\u003eI did read this article but I wasn't sure if Azure just randomly moves machines or if that applied.\n\u003ca href=\"https://stackoverflow.com/questions/15201581/sql-azure-online-management-portal-what-causes-the-query-performance-run-cou/15218709#15218709\"\u003eSQL Azure Online Management Portal - What causes the \u0026#39;Query Performance\u0026#39; Run Count to reset to zero?\u003c/a\u003e\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-03-10 20:03:33.967 UTC","last_activity_date":"2017-03-10 20:03:33.967 UTC","last_edit_date":"2017-05-23 12:17:14.827 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"7692250","post_type_id":"1","score":"0","tags":"sql|azure|dmv","view_count":"25"} +{"id":"39925701","title":"How to delete all schedules in node-schedule?","body":"\u003cp\u003eI see from \u003ca href=\"https://github.com/node-schedule/node-schedule\" rel=\"nofollow\"\u003edocs\u003c/a\u003e you can delete one by one by name for example ... \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar schedule = require('node-schedule');\n\n // sample announcement\n\n var rule = new schedule.RecurrenceRule();\n rule.dayOfWeek = [1, 2, 3, 4, 5];\n rule.minute = 50;\n rule.hour = 12;\n\n var message = schedule.scheduleJob(\"AnnouncementOne\", rule, function() {\n // make my announcement\n})\n\nAnnouncementOne.cancel();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut I would like code to get all scheduled jobs and then loop through them to delete each one. I think the following gets all the jobs ...\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar jobList = schedule.scheduledJobs;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhich outputs following to console ...\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{ 'AnnouncementOne':\n Job {\n job: [Function],\n callback: false,\n name: 'AnnouncementOne',\n trackInvocation: [Function],\n stopTrackingInvocation: [Function],\n triggeredJobs: [Function],\n setTriggeredJobs: [Function],\n cancel: [Function],\n cancelNext: [Function],\n reschedule: [Function],\n nextInvocation: [Function],\n pendingInvocations: [Function] },\n 'AnnouncementTwo':\n Job {\n job: [Function],\n callback: false,\n name: 'AnnouncementTwo',\n trackInvocation: [Function],\n stopTrackingInvocation: [Function],\n triggeredJobs: [Function],\n setTriggeredJobs: [Function],\n cancel: [Function],\n cancelNext: [Function],\n reschedule: [Function],\n nextInvocation: [Function],\n pendingInvocations: [Function] } }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ehow do I loop through jobList to delete each job?\u003c/p\u003e\n\n\u003cp\u003eAlternative Code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar jobList = schedule.scheduledJobs;\n\nfor(jobName in jobList){\n var job = 'jobList.' + jobName;\n eval(job+'.cancel()');\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"39926055","answer_count":"1","comment_count":"0","creation_date":"2016-10-07 20:57:50.227 UTC","last_activity_date":"2016-10-09 10:15:45.7 UTC","last_edit_date":"2016-10-08 20:37:30.29 UTC","last_editor_display_name":"","last_editor_user_id":"2780335","owner_display_name":"","owner_user_id":"2780335","post_type_id":"1","score":"0","tags":"javascript|node.js|scheduled-tasks","view_count":"672"} +{"id":"6310240","title":"Switching sheets in Excel VBA","body":"\u003cp\u003eI'm currently doing this \u003ccode\u003eSheets(\"Sheet2\").Range(\"A1\").Value = 35\u003c/code\u003e, but I want to a way to do just this \u003ccode\u003eRange(\"A1\").Value = 35\u003c/code\u003e, by switching the sheet on a separate line before. I tried \u003ccode\u003eSheets(\"Sheet2\").Select\u003c/code\u003e, but that only switches the sheet it displays at the end to sheet 2.\u003c/p\u003e","accepted_answer_id":"6313631","answer_count":"2","comment_count":"0","creation_date":"2011-06-10 17:52:47.917 UTC","last_activity_date":"2015-05-25 13:30:56.14 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"759705","post_type_id":"1","score":"-2","tags":"excel|vba","view_count":"58882"} +{"id":"32331866","title":"Transactions in Informix dbaccess here document approach","body":"\u003cp\u003eI am writing a shell script that invokes dbaccess.\u003c/p\u003e\n\n\u003cp\u003eI would like to begin a transaction, do some stuff (e.g. call some procedures) and then make a decision and either commit or rollback the current work. Is this possible?\u003c/p\u003e\n\n\u003cp\u003eHere's an example of what I am trying to accomplish\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#!/bin/bash\n\nv_value\n\ndbaccess $DB - \u0026lt;\u0026lt; SQL\n\nunload to \"abc.csv\"\nselect value from table1 where id=1;\nSQL\n\nIFS=$'|' arr=( $(awk -F, -v OFS='\\n' '{$1=$1}1' abc.csv) )\nv_value=${arr[0]}\n\ndbaccess $DB - \u0026lt;\u0026lt; SQL\n\nbegin;\n\nexecute procedure progname();\n\n-- here check everything is ok (e.g. using the previously retrieved $v_value) and either commit or rollback\n-- commit|rollback\nSQL\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"32335613","answer_count":"2","comment_count":"0","creation_date":"2015-09-01 12:37:54.46 UTC","last_activity_date":"2015-09-03 12:25:14.807 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"574016","post_type_id":"1","score":"1","tags":"informix|dbaccess","view_count":"525"} +{"id":"19779647","title":"C# Displaying a Class Variable that is stored in an Array","body":"\u003cp\u003eI will try to simplify this down as much as I can to make this as understandable as I can.\nI have created various classes (to be known as \u003cstrong\u003ePerson1\u003c/strong\u003e, \u003cstrong\u003ePerson2\u003c/strong\u003e and \u003cstrong\u003ePerson3\u003c/strong\u003e)\neach of which has their own variables (examples being \u003cstrong\u003eName\u003c/strong\u003e, \u003cstrong\u003eAge\u003c/strong\u003e and \u003cstrong\u003eID\u003c/strong\u003e).\nI created a one dimesional array which will be called \u003cstrong\u003ePeopleArray\u003c/strong\u003e with a maximum amount of 10 entries held in the array, each of these hold an instance of one of the Classes.\u003c/p\u003e\n\n\u003cp\u003eNote: when the form is loaded entries are made into the array and assigns values to each of the appropriate variables\u003c/p\u003e\n\n\u003cp\u003eI then created a Listbox called \u003cstrong\u003eListOfPeople\u003c/strong\u003e which allows the user to select from the entries in the array.\nWhat I want to do is take one of the Variables from the appropriate Classes and display the value held by it in a label.\u003c/p\u003e\n\n\u003cp\u003eFor this lets say I have in the Array at position [0], the entry is of the Person1 Class and I want to find the value of the \"Name\" variable.\nWhat would be the code to display that in a label.\n\"Label.Text = \"\u003c/p\u003e\n\n\u003cp\u003eNote: what I would want the code to do however is account for whichever entry is selected, a method in the form of my previous example will suffice and I will work from there.\u003c/p\u003e\n\n\u003cp\u003eAny help you can give is much appriciated. Thank You\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2013-11-05 00:04:50.243 UTC","last_activity_date":"2013-11-05 02:18:52.49 UTC","last_edit_date":"2013-11-05 00:28:49.237 UTC","last_editor_display_name":"","last_editor_user_id":"2954443","owner_display_name":"","owner_user_id":"2954443","post_type_id":"1","score":"-2","tags":"c#|arrays|class|listbox","view_count":"109"} +{"id":"18032609","title":"Center align a column in twitter bootstrap","body":"\u003cp\u003eI've started learning Bootstrap. My question is how to center align a column horizontally, bootstrap contains 12 column layout, there is no middle number. To be more clear if it was 11 column layout, the middle number would have been 6 (5 columns left, 1 column middle, 5 columns right)\u003c/p\u003e","accepted_answer_id":"20704343","answer_count":"4","comment_count":"1","creation_date":"2013-08-03 11:55:33.913 UTC","favorite_count":"9","last_activity_date":"2016-03-04 06:44:27.28 UTC","last_edit_date":"2016-03-04 06:44:27.28 UTC","last_editor_display_name":"","last_editor_user_id":"2640537","owner_display_name":"","owner_user_id":"2640537","post_type_id":"1","score":"46","tags":"twitter-bootstrap|alignment","view_count":"162276"} +{"id":"27306320","title":"Y-position issue with rect while ceating 1 SVG element per div with JQuerySVG and Raphael.js","body":"\u003cp\u003eWell, since someone downvoted this instead of trying to ask for a change, I am going to change up my question to better make sense.\u003c/p\u003e\n\n\u003cp\u003eso here are some pics of what's going on.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://imageshack.com/a/img633/2685/7UYA8e.png\" rel=\"nofollow noreferrer\"\u003ehttp://imageshack.com/a/img633/2685/7UYA8e.png\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://imageshack.com/a/img905/8505/u0gI9U.png\" rel=\"nofollow noreferrer\"\u003ehttp://imageshack.com/a/img905/8505/u0gI9U.png\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://imageshack.com/a/img538/7152/gV5jd9.png\" rel=\"nofollow noreferrer\"\u003ehttp://imageshack.com/a/img538/7152/gV5jd9.png\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eBasically I am trying to use SVG to create rectangles as well as images and then manipulate them with the DOM and do things like drag.\u003c/p\u003e\n\n\u003cp\u003eInstead of having 1 SVG Root or w/e you want to call it, I have multiple ones, as in 1 SVG per div.\u003c/p\u003e\n\n\u003cp\u003eOn Raphael when I went from 1 \"paper\" to multiple ones(it seemed like doing document.create(div) was causing issues as well and that an already created div worked). I get what is going on with JQuery SVG when \"configure({height})\" is set, which is the positions of my objects are messed up at lower amounts i.e., if my height is 1 it will be messed up, but if it's 100 it will be in place. It will mess up by going to positions farther down the page than it should, which can be seen in the images above.\u003c/p\u003e\n\n\u003cp\u003eIf I have 1 paper in Raphael this doesn't happen, as well as if configure is off in JquerySVG; however if Configure is off, at some point (which can be seen in Image 1) I get my rectangles cut off, because my viewport isn't correct (thus needing configure to BE ON).\u003c/p\u003e\n\n\u003cp\u003eRaphael doesn't seem to have this cut off issue, which seems to be from what I gather from here \u003ca href=\"http://tutorials.jenkov.com/svg/svg-viewport-view-box.html\" rel=\"nofollow noreferrer\"\u003ehttp://tutorials.jenkov.com/svg/svg-viewport-view-box.html\u003c/a\u003e\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eThe second example has preserveAspectRatio set to xMinYMin slice. That will preserve aspect ratio, but scale the view box according to the larger aspect ratio (the x-axis with ratio 2), resulting in an image too big to fit within the viewport. The image is said to be \"sliced\".\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eIf anyone has any recommendations on what I might be doing wrong I would appreciate it, but I'm not sure why I am having these issues.\u003c/p\u003e\n\n\u003cp\u003eI hope the pics suffice, because this is very annoying and I just want to know how to do what I need to without having issues....\u003c/p\u003e\n\n\u003cp\u003eMy code\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e var scale = ....\n for(var i = 0; i \u0026lt; total; i++)\n {\n var face = document.createElement(\"div\");\n\n face.id = 'face'+i; \n\n\n document.getElementById('plan').appendChild(face);\n\n $('#face'+i).svg();\n\n var faceE = $('#face'+i).svg('get'); \n\n\n // faceE.configure({width: w*scale, height: h*scale}, true); \n\n faceE.rect(0,0,w*scale,\n h*scale,{fill:'black', stroke: \n 'red', strokeWidth: 0.3*scale});\n\n $( '#face'+i ).draggable({ snap: true});\n\n $('#face'+i).css({position:\"absolute\", left: x*scale, top:y*scale, width: w*scale, height:h*scale}); \n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'll try to make a fiddle later and hopefully I can get some results. is JQuery SVG part of Fiddle or do I need to do something special for it?\u003c/p\u003e","accepted_answer_id":"27339725","answer_count":"1","comment_count":"3","creation_date":"2014-12-04 23:43:11.343 UTC","last_activity_date":"2014-12-07 04:46:57.877 UTC","last_edit_date":"2014-12-05 22:24:24.84 UTC","last_editor_display_name":"","last_editor_user_id":"3599960","owner_display_name":"","owner_user_id":"3599960","post_type_id":"1","score":"0","tags":"jquery|svg|raphael|jquery-svg","view_count":"222"} +{"id":"27857648","title":"Issue with Camera on certain devices","body":"\u003cp\u003ei have some sort of a \u003ccode\u003eLauncherApp\u003c/code\u003e(start other apps easy from my app). On some devices i mentioned that the \u003ccode\u003eCamera\u003c/code\u003e is not in the \u003ccode\u003ePackageManager\u003c/code\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eList\u0026lt;ApplicationInfo\u0026gt; appInfo = pm.getInstalledApplications(PackageManager.GET_META_DATA);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is because on this Devices the \u003ccode\u003eCamera\u003c/code\u003e is not an Application, but an Activity in the \u003ccode\u003eGallery\u003c/code\u003e-Application!\u003c/p\u003e\n\n\u003cp\u003eThe Problem is that my whole logic is based on \u003ccode\u003eApplicationInfos\u003c/code\u003e and not \u003ccode\u003eActivityInfos\u003c/code\u003e!\u003c/p\u003e\n\n\u003cp\u003eI managed to get the ActivityInfo of the Camera via an intent:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eIntent camera = new Intent(android.provider.MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA);\ncamera.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\nActivityInfo actInfoCamera = camera.resolveActivityInfo(getPackageManager(), 0);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003enow with \u003ccode\u003eactInfoCamera\u003c/code\u003e i can retrieve the icon of the camera and the Label. Which is all i need. But again my whole program is now based on \u003ccode\u003eApplicationInfo\u003c/code\u003e. So i would need to cast or transform the \u003ccode\u003eActivityInfo\u003c/code\u003e into an \u003ccode\u003eApplicationInfo\u003c/code\u003e(For sorting, retrieving Icons and labels and so on).\u003c/p\u003e\n\n\u003cp\u003eWhen i try so with:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eactInfoCamera.applicationInfo;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ei am back at the beginning, the \u003ccode\u003eApplicationInfo\u003c/code\u003e now has again the icon of the \u003ccode\u003eGallery\u003c/code\u003e and the Label \u003ccode\u003eGallery\u003c/code\u003e... or when i try that:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eApplicationInfo appInfoCamera = (ApplicationInfo) actInfoCamera;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eit doesn't work cast from \u003ccode\u003eActivityInfo\u003c/code\u003e to \u003ccode\u003eApplicationInfo\u003c/code\u003e is not possible..\u003c/p\u003e\n\n\u003cp\u003eSo i got \u003cstrong\u003etwo questions:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003e1)\u003c/strong\u003e Is there a way to determine if the camera on that device is an single application or an activity within the Gallery application. Because i don't want to add two times the same camera application in my list in my app. Also please notice that it is possible that the user have some other camera apps which includes \"camera\" in their packagenames. I'm afraid it isn't that easy...\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003e2)\u003c/strong\u003e How do i get the \u003ccode\u003eactivity\u003c/code\u003e of my \u003ccode\u003ecamera\u003c/code\u003e within the \u003ccode\u003egallery\u003c/code\u003e package as an \u003ccode\u003eApplicationInfo\u003c/code\u003e to accomplish an easy way of implementing in my whole logic.\u003c/p\u003e\n\n\u003cp\u003eAny help is greatly appreciated.\u003c/p\u003e\n\n\u003cp\u003eThanks in advance!\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2015-01-09 09:39:53.91 UTC","last_activity_date":"2015-01-09 09:47:14.57 UTC","last_edit_date":"2015-01-09 09:47:14.57 UTC","last_editor_display_name":"","last_editor_user_id":"4269268","owner_display_name":"","owner_user_id":"4269268","post_type_id":"1","score":"1","tags":"android|camera","view_count":"26"} +{"id":"10582861","title":"Package execution failed using DTEXEC /SQ","body":"\u003cp\u003eI have deployed a package through SQL Server Deployment to a Custom Folder \"Folder1\" under MSDB. The execution failed using DTEXEC. What is the correct syntax using DTEXEC ?\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2012-05-14 11:57:56.6 UTC","last_activity_date":"2012-05-14 12:06:55.377 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"270852","post_type_id":"1","score":"0","tags":"ssis","view_count":"537"} +{"id":"44054887","title":"EF 6 Code First - Schema is not valid type not available","body":"\u003cp\u003eI did some refactoring to a code base, and created an abstract class \u003ccode\u003eSlottedHardware\u003c/code\u003e that held some common properties that other classes should use.\u003c/p\u003e\n\n\u003cp\u003eHowever, I am now getting the error:\n \u003ccode\u003eSchema specified is not valid. Errors: The relationship 'MyProject.Models.NetworkDevice_Slots' was not loaded because the type 'MyProject.Models.Models.NetworkDevice' is not available.\u003c/code\u003e \u003c/p\u003e\n\n\u003cp\u003ewhen trying to create the database by setting my DbContext ctor to \u003ccode\u003eDatabase.SetInitializer\u0026lt;MyDbContext\u0026gt;(new CreateDatabaseIfNotExists\u0026lt;MyDbContext\u0026gt;());\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eI have been at this for hours, and would really appreciate if someone can lend a helping hand. Here are some of the entity classes, as well as the Fluent API mapping:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic abstract class EntityBase\n{\n [DatabaseGenerated(DatabaseGeneratedOption.Identity)]\n public int Id { get; set; }\n}\n\npublic abstract class SlottedHardware : EntityBase\n{\n public int MaxSlots { get; set; }\n\n public virtual ICollection\u0026lt;Slot\u0026gt; Slots { get; set; }\n}\n\npublic class Slot : EntityBase\n{\n public string SlotIdentifier { get; set; }\n public List\u0026lt;Card\u0026gt; CompatibleCards { get; set; } = new List\u0026lt;Card\u0026gt;();\n public State State { get; set; }\n public virtual NetworkDevice NetworkDevice { get; set; }\n}\n\npublic class NetworkDevice : SlottedHardware\n{\n public string Vendor { get; set; }\n public string Model { get; set; }\n public List\u0026lt;UnpublishedConfig\u0026gt; UnpublishedConfigs { get; set; }\n public List\u0026lt;PublishedConfig\u0026gt; PublishedConfigs { get; set; }\n public State State { get; set; }\n\n /*** Constructors ***/\n\n public NetworkDevice()\n {\n MaxSlots = 0;\n Slots = new List\u0026lt;Slot\u0026gt;();\n UnpublishedConfigs = new List\u0026lt;UnpublishedConfig\u0026gt;();\n PublishedConfigs = new List\u0026lt;PublishedConfig\u0026gt;();\n }\n\n public NetworkDevice(string vendor, string model, int maxSlots) : this()\n {\n Vendor = vendor;\n Model = model;\n if(maxSlots \u0026gt; 0)\n {\n MaxSlots = maxSlots;\n }\n\n }\n}\n\nprotected override void OnModelCreating(DbModelBuilder modelBuilder)\n{\n // NetworkDevice entity\n modelBuilder.Entity\u0026lt;NetworkDevice\u0026gt;().Map(m =\u0026gt;\n {\n m.MapInheritedProperties();\n m.ToTable(\"NetworkDevices\");\n });\n modelBuilder.Entity\u0026lt;NetworkDevice\u0026gt;().HasKey(t =\u0026gt; t.Id);\n modelBuilder.Entity\u0026lt;NetworkDevice\u0026gt;().\n HasMany(t =\u0026gt; t.Slots).\n WithOptional(t =\u0026gt; t.NetworkDevice);\n modelBuilder.Entity\u0026lt;NetworkDevice\u0026gt;().\n HasMany(t =\u0026gt; t.PublishedConfigs).\n WithMany();\n modelBuilder.Entity\u0026lt;NetworkDevice\u0026gt;().\n HasMany(t =\u0026gt; t.UnpublishedConfigs).\n WithMany();\n modelBuilder.Entity\u0026lt;NetworkDevice\u0026gt;().Property(t =\u0026gt; t.MaxSlots).IsRequired();\n modelBuilder.Entity\u0026lt;NetworkDevice\u0026gt;().Property(t =\u0026gt; t.Model).IsRequired();\n\n // Slot entity\n modelBuilder.Entity\u0026lt;Slot\u0026gt;().Map(m =\u0026gt;\n {\n m.MapInheritedProperties();\n m.ToTable(\"Slots\");\n });\n modelBuilder.Entity\u0026lt;Slot\u0026gt;().HasKey(t =\u0026gt; t.Id);\n modelBuilder.Entity\u0026lt;Slot\u0026gt;().HasOptional(t =\u0026gt; t.NetworkDevice).WithMany(x =\u0026gt; x.Slots);\n modelBuilder.Entity\u0026lt;Slot\u0026gt;().HasMany(t =\u0026gt; t.CompatibleCards).WithMany(x =\u0026gt; x.Slots);\n modelBuilder.Entity\u0026lt;Slot\u0026gt;().Property(t =\u0026gt; t.SlotIdentifier).IsRequired();\n modelBuilder.Entity\u0026lt;Slot\u0026gt;().Ignore(t =\u0026gt; t.Card);\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"2","creation_date":"2017-05-18 17:59:50.72 UTC","last_activity_date":"2017-05-18 17:59:50.72 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2659189","post_type_id":"1","score":"0","tags":"c#|entity-framework","view_count":"25"} +{"id":"20058581","title":"asp:Button and asp:LinkButton and asp:Button submitting on enter in Chrome","body":"\u003cp\u003eIn Internet Explorer if I hit enter in the TextBox P it submits the Form using the onclick event of LoginButton. \u003c/p\u003e\n\n\u003cp\u003eThis is what I want to happen. \u003c/p\u003e\n\n\u003cp\u003eIn Google Chrome if I hit enter it submits the form with the onclick of Button1. \u003c/p\u003e\n\n\u003cp\u003eThis is not what I want to happen. \u003c/p\u003e\n\n\u003cp\u003eButton1 is actually not visible on the form under normal circumstances. It is made visible under certain circumstances to do a different task then login. \u003c/p\u003e\n\n\u003cp\u003eHow can I force this, browser independently, to always use LoginButton onclick when someone presses enter? \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;asp:TextBox ID=\"P\" runat=\"server\" TextMode=\"Password\" Width=\"150\"\u0026gt;\u0026lt;/asp:TextBox\u0026gt;\n\u0026lt;asp:LinkButton CssClass=\"button\" ID=\"LoginButton\" \nrunat=\"server\" CommandName=\"Login\" Text=\"Log In\" ValidationGroup=\"Login1\"\nonclick=\"LoginButton_Click\" /\u0026gt;\n\n\u0026lt;asp:Button \n ID=\"Button1\" runat=\"server\"\n Text=\"Submit\" onclick=\"Button1_Click\" /\u0026gt; \n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"20073754","answer_count":"3","comment_count":"0","creation_date":"2013-11-18 21:44:19.973 UTC","last_activity_date":"2013-11-19 14:09:56.06 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2907463","post_type_id":"1","score":"0","tags":"c#|asp.net|google-chrome|asplinkbutton|aspbutton","view_count":"2331"} +{"id":"8508399","title":"OS X: Make failing due to space in path","body":"\u003cp\u003eI'm trying to install the FFI gem. The native extensions are not building. THe problem is in the make. If I so it manually, here's what I see:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eRossRankins-MacBook-Pro:libffi Ross$ make\nmake \"AR_FLAGS=\" \"CC_FOR_BUILD=\" \"CFLAGS=-g -O2\" \"CXXFLAGS=\" \"CFLAGS_FOR_BUILD=\" \"CFLAGS_FOR_TARGET=\" \"INSTALL=/usr/bin/install -c\" \"INSTALL_DATA=/usr/bin/install -c -m 644\" \"INSTALL_PROGRAM=/usr/bin/install -c\" \"INSTALL_SCRIPT=/usr/bin/install -c\" \"JC1FLAGS=\" \"LDFLAGS=\" \"LIBCFLAGS=\" \"LIBCFLAGS_FOR_TARGET=\" \"MAKE=make\" \"MAKEINFO=/bin/sh \"/Volumes/Macintosh HD/Users/Ross/.rvm/gems/ruby-1.9.2-p180/gems/ffi-1.0.11/ext/ffi_c/libffi/missing\" --run makeinfo \" \"PICFLAG=\" \"PICFLAG_FOR_TARGET=\" \"RUNTESTFLAGS=\" \"SHELL=/bin/sh\" \"exec_prefix=/usr/local\" \"infodir=/usr/local/share/info\" \"libdir=/usr/local/lib\" \"prefix=/usr/local\" \"AR=ar\" \"AS=as\" \"CC=gcc\" \"CXX=g++\" \"LD=/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld\" \"NM=/usr/bin/nm\" \"RANLIB=ranlib\" \"DESTDIR=\" all-recursive\nmake[1]: *** No rule to make target `HD/Users/Ross/.rvm/gems/ruby-1.9.2-p180/gems/ffi-1.0.11/ext/ffi_c/libffi/missing --run makeinfo '. Stop.\nmake: *** [all] Error 2\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAs you can see it's truncating the Macintosh HD part of the path. I tried running the full command above but editing the path, and its not helping... Ideas?\u003c/p\u003e","accepted_answer_id":"8508480","answer_count":"1","comment_count":"2","creation_date":"2011-12-14 16:54:25.833 UTC","last_activity_date":"2011-12-14 16:59:11.36 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"182505","post_type_id":"1","score":"0","tags":"osx|makefile|install|ffi","view_count":"718"} +{"id":"40743876","title":"TypeError: Cannot read property \"source\" from undefined. (line 7, file \"Code\")","body":"\u003cp\u003eI am having an issue in Google Sheets \n TypeError: Cannot read property \"source\" from undefined. (line 7, file \"Code\")\nWhen Running the following Code Please Help\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction onEdit(event)\n{ \n var timezone = \"GMT-5\";\n var timestamp_format = \"MM-dd-yyyy-hh-mm-ss\"; \n var updateColName = \"Ticket#\";\n var timeStampColName = \"TimeComplete\";\n var sheet = event.source.getSheetByName('InAndOut');\n\n\n var actRng = event.source.getActiveRange();\n var editColumn = actRng.getColumn();\n var index = actRng.getRowIndex();\n var headers = sheet.getRange(1, 1, 1, sheet.getLastColumn()).getValues();\n var dateCol = headers[0].indexOf(timeStampColName);\n var updateCol = headers[0].indexOf(updateColName); updateCol = updateCol+1;\n if (dateCol \u0026gt; -1 \u0026amp;\u0026amp; index \u0026gt; 1 \u0026amp;\u0026amp; editColumn == updateCol) { // only timestamp if 'Last Updated' header exists, but not in the header row itself!\n var cell = sheet.getRange(index, dateCol + 1);\n var date = Utilities.formatDate(new Date(), timezone, timestamp_format);\n cell.setValue(date);\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"0","creation_date":"2016-11-22 14:01:30.777 UTC","favorite_count":"1","last_activity_date":"2016-11-22 15:57:38.813 UTC","last_edit_date":"2016-11-22 15:04:12.11 UTC","last_editor_display_name":"","last_editor_user_id":"5372400","owner_display_name":"","owner_user_id":"7194847","post_type_id":"1","score":"2","tags":"google-apps-script|google-spreadsheet|runtime-error","view_count":"2505"} +{"id":"1654017","title":"How to expose IFrame's DOM using jQuery?","body":"\u003cp\u003eI have a prototype representing a particual IFrame. That prototype have a function called GoToUrl(...) that opens the given url within the IFrame.\u003c/p\u003e\n\n\u003cp\u003eMy question is: How do I create an \"InternalDOM\" property and make this property refer to the \"window\" object (the root DOM object) of the IFrame inside? In such way that: If my IFrame exposes a page which has an object X in it's \"window\" object I could do:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eMyFrameObject.GoToUrl(pageXurl);\nMyFrameObject.InternalDOM.X\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny help would be appreciated.\u003c/p\u003e\n\n\u003cp\u003ePS: I would accept answers not necessarily related to jQuery but I would prefer a jQuery solution.\u003c/p\u003e","accepted_answer_id":"1654262","answer_count":"3","comment_count":"0","creation_date":"2009-10-31 10:40:41.13 UTC","favorite_count":"20","last_activity_date":"2014-08-16 18:57:20.957 UTC","last_edit_date":"2011-12-29 17:11:44.51 UTC","last_editor_display_name":"","last_editor_user_id":"938089","owner_display_name":"","owner_user_id":"192729","post_type_id":"1","score":"33","tags":"javascript|jquery|dom","view_count":"74261"} +{"id":"23848224","title":"Faster way to multiplication in data frame","body":"\u003cp\u003eI have a data frame (name t) like this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eID N com_a com_b com_c\nA 3 1 0 0\nA 5 0 1 0\nB 1 1 0 0\nB 1 0 1 0\nB 4 0 0 1\nB 4 1 0 0 \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have try to do \u003ccode\u003ecom_a*N com_b*N com_c*N\u003c/code\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eID N com_a com_b com_c com_a_N com_b_N com_c_N\nA 3 1 0 0 3 0 0\nA 5 0 1 0 0 5 0\nB 1 1 0 0 1 0 0\nB 1 0 1 0 0 1 0\nB 4 0 0 1 0 0 4 \nB 4 1 0 0 4 0 0\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI use \u003ccode\u003efor\u003c/code\u003e-function, but it need many time how do i do the fast in the big data\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efor (i in 1:dim(t)[1]){\n t$com_a_N[i]=t$com_a[i]*t$N[i]\n t$com_b_N[i]=t$com_b[i]*t$N[i]\n t$com_c_N[i]=t$com_c[i]*t$N[i]\n }\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"23848235","answer_count":"5","comment_count":"7","creation_date":"2014-05-24 18:12:49.753 UTC","last_activity_date":"2014-05-24 22:53:34.303 UTC","last_edit_date":"2014-05-24 18:14:47.813 UTC","last_editor_display_name":"","last_editor_user_id":"190277","owner_display_name":"","owner_user_id":"2302498","post_type_id":"1","score":"1","tags":"r","view_count":"281"} +{"id":"5574270","title":"JBOSS 5 and Spring 3 Validation Annotations","body":"\u003cp\u003eI have been trying to set up Spring 3 annotation-based validation, guided by \u003ca href=\"http://static.springsource.org/spring/docs/3.0.0.RC3/spring-framework-reference/html/ch05s07.html\" rel=\"nofollow\"\u003ehttp://static.springsource.org/spring/docs/3.0.0.RC3/spring-framework-reference/html/ch05s07.html\u003c/a\u003e. I am using JBOSS 5.0.1 server; however, upon invoking the @Valid annotation from the Controller. I received errors and found out it will require javax.validation.*;\u003c/p\u003e\n\n\u003cp\u003eUpon adding the validation-api-1.0.0.GA.jar (for javax.validation.*), I received complaints about it requiring Hibernate Validator 4+, which in turn requires Hibernate 3.5+. Finally, I discovered that JBOSS 5 does not support Hibernate 3.5+ because it uses JPA-2 and JBOSS 5 is tightly coupled to JPA-1. \u003c/p\u003e\n\n\u003cp\u003eAt this point, my brain hurts.\u003c/p\u003e\n\n\u003cp\u003eDoes anyone have a successful example of using Spring 3 annotation-based validation under JBOSS 5?\u003c/p\u003e","accepted_answer_id":"5590445","answer_count":"2","comment_count":"1","creation_date":"2011-04-06 23:41:46.467 UTC","last_activity_date":"2011-04-08 04:29:09.55 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"327978","post_type_id":"1","score":"0","tags":"spring|validation|jboss|annotations","view_count":"1030"} +{"id":"7408441","title":"Utilising the SelectorProviderButton with facebook/twitter in DotNetOpenAuth 4.0 CTP","body":"\u003cp\u003eI'm trying to get my head round using DotNetOpenAuth and whilst I have had a certain amount of success following the source from the nerddiner project, I have hit some snags.\u003c/p\u003e\n\n\u003cp\u003eBy the looks of things \u003ca href=\"https://stackoverflow.com/questions/4821747/facebook-twitter-with-dotnetopenauth\"\u003esee here\u003c/a\u003e, though it appears that the version used in nerddinner (3.4.6.10357) nor the one on Nuget (3.4.7.11121) will not allow me to use Facebook or Twitters implementation. This is a bit of a killer blow for me using it.\u003c/p\u003e\n\n\u003cp\u003eI have found a sample using the OAuth 2.0 CTP \u003ca href=\"http://visualstudiogallery.msdn.microsoft.com/fe61654a-e420-4012-affb-04a0607fb10b\" rel=\"nofollow noreferrer\"\u003ehere\u003c/a\u003e but that does not use the same ajax system as the nerddinner sample utilising the \u003ccode\u003eSelectorProviderButton\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eDoes anybody have an example of the two methods working together? I'm finding it very difficult to get any decent information.\u003c/p\u003e","accepted_answer_id":"7425830","answer_count":"1","comment_count":"0","creation_date":"2011-09-13 21:02:17.23 UTC","last_activity_date":"2011-09-15 04:23:39.777 UTC","last_edit_date":"2017-05-23 10:34:29.843 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"427899","post_type_id":"1","score":"1","tags":"asp.net-mvc|c#-4.0|dotnetopenauth","view_count":"262"} +{"id":"17086955","title":"PagerAdapter/ViewPager related OutOfMemoryError","body":"\u003cp\u003eI have extended the PagerAdapter class to create a custom adapter. In a strange way it behaves differently on different devices. For example on an Android 4.0.3 tablet, the viewpager tries to instantiate all the items which causes the OutOfMemoryError. However it works fine on an Android 4.2.2 phone.\u003c/p\u003e\n\n\u003cp\u003eBelow you can find related parts of the pager adapter.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@Override\npublic Object instantiateItem(ViewGroup container, int position) {\n\n View page = page = viewRenderer.getView(context, position);;\n ((ViewPager)container).addView(page, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));\n return page;\n}\n\n@Override\npublic void destroyItem(ViewGroup container, int position, Object object) {\n View view = (View) object;\n container.removeView(view);\n view = null;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf you have any suggestions, it will be really helpful. Thanks in advance.\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2013-06-13 12:21:02.107 UTC","last_activity_date":"2013-06-13 12:21:02.107 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1008734","post_type_id":"1","score":"0","tags":"android|android-viewpager|android-pageradapter","view_count":"170"} +{"id":"5369964","title":"Zend_Acl find all inherited roles","body":"\u003cp\u003eI got chain of roles:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eacl.roles.guest = null\nacl.roles.member = \"guest\"\nacl.roles.admin = \"member\"\nacl.roles.owner = \"admin\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ein .....Controller/Action/Helper/Acl.php I have stored _acl object\u003c/p\u003e\n\n\u003cp\u003eIs it a way to get list of my role and parents ?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$this-\u0026gt;_acl-\u0026gt;getParents ( 'admin' )\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eshould return\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eadmin, member, guest\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eas array, or string (eg comma delimited) \u003c/p\u003e","accepted_answer_id":"5370017","answer_count":"1","comment_count":"0","creation_date":"2011-03-20 16:59:45.727 UTC","favorite_count":"1","last_activity_date":"2011-03-20 18:24:52.71 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"367878","post_type_id":"1","score":"5","tags":"php|zend-framework|inheritance|roles|zend-acl","view_count":"2591"} +{"id":"10350404","title":"eclipse state saving","body":"\u003cp\u003eIs there any thing in \u003cstrong\u003eeclipse\u003c/strong\u003e like \u003cstrong\u003esave stage\u003c/strong\u003e of code or pointout that this is last stable stage and if no luck of doing some RND then we can move back to previous stage on single click?\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2012-04-27 12:11:46.76 UTC","last_activity_date":"2012-04-27 12:11:46.76 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1230360","post_type_id":"1","score":"0","tags":"eclipse","view_count":"64"} +{"id":"29746087","title":"write header information for csv string which should go as attachment to infopath form using javascript","body":"\u003cp\u003eI am trying to achieve the functionality of converting a string to base64 encoded binary format where the encoded part needs to send to InfoPath form to display as an attachment for an attachment control in InfoPath form.\u003c/p\u003e\n\n\u003cp\u003eso my data will be in this format \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\"header1,header2,header3,..\n value1,value2,value3,..\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut the InfoPath form actual format contains below format of data \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\"filename.csvheader1,header2,header3,..\n value1,value2,value3,..\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eso my challenge here to achieve the encoded string along with the file name attached in the encoded string.\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2015-04-20 11:04:02.447 UTC","favorite_count":"1","last_activity_date":"2015-04-20 11:04:02.447 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2630375","post_type_id":"1","score":"1","tags":"javascript|csv|infopath","view_count":"32"} +{"id":"21278072","title":"Hibernate's like or ilike restrictions and German umlauts","body":"\u003cp\u003eI noticied that non of hibernate's \u003ccode\u003eilike\u003c/code\u003e queries works with German umlauts such as ü, ö etc... As far as I understand it is a MySQL's issue.\u003c/p\u003e\n\n\u003cp\u003eI searched for the solutions and it seems there are only two:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eReplace all the umlautes with the appropriate character sets. For\nexample, \u003ccode\u003eü\u003c/code\u003e with \u003ccode\u003eue\u003c/code\u003e etc...\u003c/li\u003e\n\u003cli\u003eSemi-solution because I don't know how to implement it with hibernate described \u003ca href=\"https://stackoverflow.com/a/2607164/705869\"\u003ehere\u003c/a\u003e and \u003ca href=\"https://stackoverflow.com/a/11761321/705869\"\u003ehere\u003c/a\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eSo the questions are: what is the better way and how to implement #2 with hibernate?\u003c/p\u003e\n\n\u003cp\u003eThank you in advance\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2014-01-22 08:46:15.73 UTC","favorite_count":"1","last_activity_date":"2014-01-22 18:55:10.907 UTC","last_edit_date":"2017-05-23 12:21:00.003 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"705869","post_type_id":"1","score":"2","tags":"java|mysql|hibernate|utf-8","view_count":"239"} +{"id":"18227759","title":"Liferay: No Layout exists with the primary key 0","body":"\u003cp\u003eI am having troubles with my Liferay-Portal after I included a function to generate the friendly URL. This is the function:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#set ($layoutLocalService = $serviceLocator.findService(\"com.liferay.portal.service.LayoutLocalService\"))\n#set ($layoutId = $getterUtil.getLong($image-link.getData()))\n#set ($themeDisplay = $request.get('theme-display'))\n#set ($currentPlid = $getterUtil.getLong($themeDisplay.get('plid')))\n#set ($currentLayout = $layoutLocalService.getLayout($currentPlid))\n#set ($layout = $layoutLocalService.getLayout($getterUtil.getLong($groupId), $currentLayout.isPrivateLayout(), $layoutId))\n#set( $friendlyUrl = $layout.getFriendlyURL().replace(\"/\", \"\") )\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAfter a successful deployment, while surfing over the website my console outputs this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e09:15:26,279 ERROR [http-bio-8080-exec-83][LiferayMethodExceptionEventHandler:33] com.liferay.portal.NoSuchLayoutException: No Layout exists with the primary key 0\ncom.liferay.portal.NoSuchLayoutException: No Layout exists with the primary key 0\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eHow do I get the layoutID of the current page and not of that image link?\u003c/strong\u003e\u003c/p\u003e","accepted_answer_id":"18336308","answer_count":"1","comment_count":"4","creation_date":"2013-08-14 09:21:35.957 UTC","last_activity_date":"2013-08-20 13:27:24.877 UTC","last_edit_date":"2013-08-20 10:24:56.35 UTC","last_editor_display_name":"","last_editor_user_id":"1005033","owner_display_name":"","owner_user_id":"1005033","post_type_id":"1","score":"1","tags":"java|content-management-system|liferay|velocity|portal","view_count":"3036"} +{"id":"29056332","title":"CAShapeLayer’s strokeEnd doesn’t animate","body":"\u003cp\u003eThis is the code I’m using to animate my \u003ccode\u003eCAShapeLayer\u003c/code\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e_progressBarLayer.strokeEnd = CGFloat(_progressToDrawForProgress(progress))\n\nlet progressAnimation = CABasicAnimation(keyPath: \"strokeEnd\")\nprogressAnimation.duration = CFTimeInterval(1.0)\nprogressAnimation.fromValue = CGFloat(self.progress)\nprogressAnimation.toValue = _progressBarLayer.strokeEnd\nprogressAnimation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseIn)\n\n_progressBarLayer.addAnimation(progressAnimation, forKey: \"progressAnimation\")\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI’ve tested using the delegate to see if the animation plays, and it does. Logging start and stop in the right place.\u003c/p\u003e\n\n\u003cp\u003eThis code is in a \u003ccode\u003esetProgress(progress: CGFloat, animated: Bool)\u003c/code\u003e function and runs if animated is true.\u003c/p\u003e\n\n\u003cp\u003eIs there anything glaringly obvious here?\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2015-03-15 01:39:49.947 UTC","last_activity_date":"2015-03-17 17:27:28.793 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1735584","post_type_id":"1","score":"1","tags":"ios|animation|cabasicanimation|cashapelayer","view_count":"478"} +{"id":"25335143","title":"bashrc environment variables not working with Rails app","body":"\u003cp\u003eI have setup variables in my ~/.bashrc file that I would like to use with my Rails app. The problem is Rails will not recognize these variables.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003ebashrc:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eexport MYSQL_DB_USERNAME=admin\nexport MYSQL_DB_PASSWORD=testing123\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eRails app - database.yml\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e username: \u0026lt;%= ENV[\"MYSQL_DB_USERNAME\"] %\u0026gt;\n password: \u0026lt;%= ENV[\"MYSQL_DB_PASSWORD\"] %\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf I go into the rails console and type:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eENV[\"MYSQL_DB_USERNAME\"]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI get back: \u003ccode\u003e\u0026lt;= nil\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eI've reloaded my bashrc file and restarted the terminal. Neither worked. Why won't Rails read these variables from the bashrc file?\u003c/p\u003e\n\n\u003cp\u003e(I am using RVM for ruby version management, in case that matters).\u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","answer_count":"2","comment_count":"9","creation_date":"2014-08-15 22:33:03.937 UTC","favorite_count":"1","last_activity_date":"2015-10-08 11:06:13.073 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3806947","post_type_id":"1","score":"1","tags":"ruby-on-rails|bash|ruby-on-rails-4","view_count":"2287"} +{"id":"38308305","title":"How to convert html file to chm format using c#?","body":"\u003cp\u003eI have thousands of HTML files and I want to convert these files to \nchm extension.\u003c/p\u003e\n\n\u003cp\u003ePlease any way to convert HTML file to chm format using c#.\u003c/p\u003e\n\n\u003cp\u003ethanks.\u003c/p\u003e","accepted_answer_id":"38415755","answer_count":"1","comment_count":"4","creation_date":"2016-07-11 13:31:11.29 UTC","last_activity_date":"2016-07-16 21:21:33.707 UTC","last_edit_date":"2016-07-11 13:35:17.11 UTC","last_editor_display_name":"","last_editor_user_id":"105466","owner_display_name":"","owner_user_id":"2516820","post_type_id":"1","score":"-4","tags":"c#|html|chm","view_count":"249"} +{"id":"36613140","title":"Error in NV's implement for glClearNamedFramebufferfi","body":"\u003cp\u003eI run across a bug when using OpenGL 4.5 DSA functions, on nvidia's GTX760M\nThese are three pieces of code:\n1. the old fashion\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eglClear(GL_DEPTH_BUFFER_BIT);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e2. the modern fashion\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eglBindFramebuffer(GL_DRAW_BUFFER, 0);\nglClearBufferfi(GL_DEPTH_STENCIL, 0, 1.f, 0);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e3.the dsa fashion\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eglClearNamedFramebufferfi(0, GL_DEPTH_STENCIL, 1.f, 0);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut only the first and the second code work. So is this a bug or my mistake?\u003c/p\u003e","accepted_answer_id":"36647789","answer_count":"1","comment_count":"2","creation_date":"2016-04-14 03:04:45.15 UTC","favorite_count":"0","last_activity_date":"2016-04-15 12:56:40.003 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4949154","post_type_id":"1","score":"1","tags":"opengl|driver|nvidia|graphic|opengl-4","view_count":"30"} +{"id":"6264134","title":"What thread calls the completed event handler on silverlight WCF calls?","body":"\u003cp\u003eAssume that I have Silverlight app doing a call to a WCF service:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evoid DoStuff()\n{\n MyProxy proxy = new MyProxy();\n proxy.DoStuffCompleted += DoStuffCompleted;\n proxy.DoStuffAsync();\n}\n\nvoid DoStuffCompleted(object sender, DoStuffCompletedEventArgs e)\n{\n // Handle the result.\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003ccode\u003eDoStuff\u003c/code\u003e is called by the UI thread. What thread will eventually call the \u003ccode\u003eDoStuffCompleted\u003c/code\u003e method? If I invoke two async calls at the same time, is there a possibility that both the completed events are fired simultaneously, on different threads?\u003c/p\u003e","accepted_answer_id":"6271189","answer_count":"3","comment_count":"1","creation_date":"2011-06-07 10:51:19.857 UTC","favorite_count":"2","last_activity_date":"2011-06-07 20:41:37.507 UTC","last_edit_date":"2011-06-07 14:55:53.223 UTC","last_editor_display_name":"","last_editor_user_id":"696631","owner_display_name":"","owner_user_id":"280222","post_type_id":"1","score":"5","tags":"c#|.net|multithreading|silverlight|wcf","view_count":"2303"} +{"id":"3361529","title":"some questions on migrating ASP.NET 1.1 application to 3.5","body":"\u003cp\u003eI need to migrate a ASP.NET application from 1.1 to 3.5. I have gone through the answers on this forum already, but still have some questions\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003e\u003cp\u003eshould I convert the application from 1.1 to 3.5 directly? OR convert it to 2.0 first and then to 3.5 and the reasons for doing so.\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eIs there any article that walks through the whole conversion process from 1.1 to 3.5 with solutions for any typical issues encountered during the conversion process?\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eIs it possible to convert a ASP.NET 1.1 project to ASP.NET 2.0 using VS2008 OR do I need to use VS2005 IDE for doing so?\u003c/p\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eThanks in advance for your help.\u003c/p\u003e","accepted_answer_id":"3361834","answer_count":"3","comment_count":"0","creation_date":"2010-07-29 10:28:35.213 UTC","favorite_count":"1","last_activity_date":"2010-07-29 11:16:34.54 UTC","last_edit_date":"2010-07-29 11:00:30.807 UTC","last_editor_display_name":"","last_editor_user_id":"217992","owner_display_name":"","owner_user_id":"217992","post_type_id":"1","score":"2","tags":"asp.net|.net-3.5|migration|.net-1.1","view_count":"1144"} +{"id":"27464495","title":"sql, keep only max value and delete others","body":"\u003cp\u003eI have this sort of table :\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003e\u003cstrong\u003e-id | name | memo\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e-1 | Gotham | s1ep1\u003c/p\u003e\n\n\u003cp\u003e-2 | Gotham | s1ep3\u003c/p\u003e\n\n\u003cp\u003e-3 | Gotham | s1ep5\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003eI would like to keep the entry with the max(memo) and delete others, so just keep the third one (ep5).\u003c/p\u003e\n\n\u003cp\u003eI can retrieve the result of all max(memo) group by name like this :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e SELECT id,max(memo) FROM `reminder` group by name\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut I don't find the proper way to delete others, even looking at similar topics.\u003c/p\u003e\n\n\u003cp\u003eI expected something like \"\u003cem\u003edelete every entries that are not in my selection\u003c/em\u003e\".\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e delete from reminder where not exists (SELECT id,max(memo) FROM `reminder` group by name)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut it doesn't work, \"\u003cem\u003eYou can't specify target table 'reminder' for update in FROM clause\u003c/em\u003e\". I must do it badly. Thanks for help.\u003c/p\u003e","accepted_answer_id":"27464549","answer_count":"1","comment_count":"0","creation_date":"2014-12-13 22:53:45.957 UTC","last_activity_date":"2014-12-13 23:09:36.57 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3266239","post_type_id":"1","score":"0","tags":"mysql|sql|max|delete-row","view_count":"880"} +{"id":"4056863","title":"Best way to detect and store path combinations for analysing purpose later","body":"\u003cp\u003eI am searching for ideas/examples on how to store path patterns from users - with the goal of analysing their behaviours and optimizing on \"most used path\" when we can detect them somehow.\u003c/p\u003e\n\n\u003cp\u003eEg. which action do they do after what, so that we later on can check to see if certain actions are done over and over again - therefore developing a shortcut or assembling some of the actions into a combined multiaction.\u003c/p\u003e\n\n\u003cp\u003eMy first guess would be some sort of \"simple log\", perhaps stored in some SQL-manner, where we can keep each action as an index and then just record everything.\u003c/p\u003e\n\n\u003cp\u003eProblem is that the path/action might be dynamically changed - even while logging - so we need to be able to take care of this fact too, when looking for patterns later.\u003c/p\u003e\n\n\u003cp\u003eWould you log everthing \"bigtime\" first and then POST-process every bit of details after some time or do you have great experience with other tactics? \u003c/p\u003e\n\n\u003cp\u003eMy worry is that this is going to take up space, BIG TIME while logging 1000 users each day for a month or more.\u003c/p\u003e\n\n\u003cp\u003eHope this makes sense and I am curious to see if anyone can provide sample code, pseudocode or perhaps links to something usefull.\u003c/p\u003e\n\n\u003cp\u003eOur tools will be C#, SQL-database, XML and .NET 3.5 - clients could also get .NET 4.0 if needed.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003ePatterns examples as we expect them\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e...\nUser #1001: A-B-A-A-A-B-C-E-F-G-H-A-A-A-C-B-A\nUser #1002: B-A-A-B-C-E-F\nUser #1003: F-B-B-A-E-C-A-A-A \nUser #1002: C-E-F\n...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eetc. no real way to know what they do next nor how many they will use, how often they will do it.\u003c/p\u003e\n\n\u003cp\u003eA secondary goal, if possible, if we later on add a new \"action\" called G (just sample to illustrate, there will be hundreds of actions) how could we detect these new behaviours influence on the previous patterns.\u003c/p\u003e\n\n\u003cp\u003eTo explain it better, my thought here would be some way to detect \"patterns within patterns\", sort of like how compressions work, so that \"repeative patterns\" are spottet. We dont know how long these patterns might be, nor how often they might come. How do we break this down into \"small bits and pieces\" - whats the best approach you think?\u003c/p\u003e","accepted_answer_id":"4070504","answer_count":"2","comment_count":"0","creation_date":"2010-10-30 01:27:52.05 UTC","last_activity_date":"2010-11-05 12:14:11.203 UTC","last_edit_date":"2010-11-05 12:14:11.203 UTC","last_editor_display_name":"","last_editor_user_id":"108056","owner_display_name":"","owner_user_id":"108056","post_type_id":"1","score":"0","tags":"path|storage|design-patterns|pattern-recognition","view_count":"44"} +{"id":"7421791","title":"A programming challenge with Mathematica","body":"\u003cp\u003eI am interfacing an external program with Mathematica. I am creating an input file for the external program. Its about converting geometry data from a Mathematica generated graphics into a predefined format. Here is an example Geometry.\u003c/p\u003e\n\n\u003ch2\u003eFigure 1\u003c/h2\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/c7g79.png\" alt=\"Figure 1\"\u003e\u003c/p\u003e\n\n\u003cp\u003eThe geometry can be described in many ways in Mathematica. One laborious way is the following.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edat={{1.,-1.,0.},{0.,-1.,0.5},{0.,-1.,-0.5},{1.,-0.3333,0.},{0.,-0.3333,0.5},\n{0.,-0.3333,-0.5},{1.,0.3333,0.},{0.,0.3333,0.5},{0.,0.3333,-0.5},{1.,1.,0.},\n{0.,1.,0.5},{0.,1.,-0.5},{10.,-1.,0.},{10.,-0.3333,0.},{10.,0.3333,0.},{10.,1.,0.}};\n\nShow[ListPointPlot3D[dat,PlotStyle-\u0026gt;{{Red,PointSize[Large]}}],Graphics3D[{Opacity[.8],\nCyan,GraphicsComplex[dat,Polygon[{{1,2,5,4},{1,3,6,4},{2,3,6,5},{4,5,8,7},{4,6,9,7},\n{5,6,9,8},{7,8,11,10},{7,9,12,10},{8,9,12,11},{1,2,3},{10,12,11},{1,4,14,13},\n{4,7,15,14},{7,10,16,15}}]]}],AspectRatio-\u0026gt;GoldenRatio]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis generates the required 3D geometry in \u003ccode\u003eGraphicsComplex\u003c/code\u003e format of MMA.\n\u003cimg src=\"https://i.stack.imgur.com/sJ5Gw.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eThis geometry is described as the following \u003cstrong\u003einput file\u003c/strong\u003e for my external program.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e# GEOMETRY\n# x y z [m]\nNODES 16\n1. -1. 0.\n0. -1. 0.5\n0. -1. -0.5\n1. -0.3333 0.\n0. -0.3333 0.50. -0.3333 -0.5\n1. 0.3333 0.\n0. 0.3333 0.5\n0. 0.3333 -0.5\n1. 1. 0.\n0. 1. 0.5\n0. 1. -0.5\n10. -1. 0.\n10. -0.3333 0.\n10. 0.3333 0.\n10. 1. -0.\n# type node_id1 node_id2 node_id3 node_id4 elem_id1 elem_id2 elem_id3 elem_id4\nPANELS 14\n1 1 4 5 2 4 2 10 0\n1 2 5 6 3 1 5 3 10\n1 3 6 4 1 2 6 10 0\n1 4 7 8 5 7 5 1 0\n1 5 8 9 6 4 8 6 2\n1 6 9 7 4 5 9 3 0\n1 7 10 11 8 8 4 11 0\n1 8 11 12 9 7 9 5 11\n1 9 12 10 7 8 6 11 0\n2 1 2 3 1 2 3\n2 10 12 11 9 8 7\n10 4 1 13 14 1 3\n10 7 4 14 15 4 6\n10 10 7 15 16 7 9\n# end of input file\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow the description I have from the documentation of this external program is pretty short. I am quoting it here.\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003col\u003e\n\u003cli\u003eFirst keyword \u003cstrong\u003eNODES\u003c/strong\u003e states total number of\nnodes. After this line there should be no comment or empty lines. Next lines consist of\nthree values x, y and z node coordinates and number of lines must be the same as number\nof nodes.\u003c/li\u003e\n\u003cli\u003eNext keyword is \u003cstrong\u003ePANEL\u003c/strong\u003e and states how many panels we have. After that we have lines\ndefining each panel. First integer defines panel type\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eID 1\u003c/strong\u003e – \u003cem\u003equadrilateral panel\u003c/em\u003e - is defined by four nodes and four neighboring panels.\nNeighboring panels are panels that share same sides (pair of nodes) and is needed for\nvelocity and pressure calculation (methods 1 and 2). Missing neighbors (for example for\npanels near the trailing edge) are filled with value 0 (see \u003cstrong\u003eFigure 1\u003c/strong\u003e).\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eID 2\u003c/strong\u003e – \u003cem\u003etriangular panel\u003c/em\u003e – is defined by three nodes and three neighboring panels.\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eID 10\u003c/strong\u003e – \u003cem\u003ewake panel\u003c/em\u003e – is quadrilateral panel defined with four nodes and with two\n(neighboring) panels which are located on the trailing edge (panels to which wake panel is\napplying Kutta condition).\u003c/li\u003e\n\u003cli\u003ePanel types 1 and 2 must be defined before type 10 in input file.\nImportant to notice is the surface normal; order of nodes defining panels should be\ncounter clockwise. By the right-hand rule if fingers are bended to follow numbering,\nthumb will show normal vector that should point “outwards” geometry.\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003chr\u003e\n\n\u003ch1\u003eChallenge!!\u003c/h1\u003e\n\n\u003cp\u003eWe are given with a 3D CAD model in a file called \u003ca href=\"http://www.mediafire.com/?5d2qy1hify9vsn4\" rel=\"nofollow noreferrer\"\u003eOne.obj\u003c/a\u003e and it is exported fine in MMA.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecd = Import[\"One.obj\"]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe output is a MMA \u003ccode\u003eGraphics3D\u003c/code\u003e object\n\u003cimg src=\"https://i.stack.imgur.com/gulFy.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eNow I can get easily access the geometry data as MMA internally reads them.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{ver1, pol1} = cd[[1]][[2]] /. GraphicsComplex -\u0026gt; List;\nMyPol = pol1 // First // First;\nGraphics3D[GraphicsComplex[ver1,MyPol],Axes-\u0026gt; True]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/0UdiM.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eHow we can use the vertices and polygon information contained in \u003ccode\u003ever1\u003c/code\u003e and \u003ccode\u003epol1\u003c/code\u003e and write them in a text file as described in the input file example above. In this case we will only have \u003cstrong\u003eID2\u003c/strong\u003e type (triangular) panels.\u003c/li\u003e\n\u003cli\u003eUsing the Mathematica triangulation how to find the surface area of this 3D object. Is there any inbuilt function that can compute surface area in MMA?\u003c/li\u003e\n\u003cli\u003eNo need to create the wake panel or \u003cstrong\u003eID10\u003c/strong\u003e type elements right now. A input file with only triangular elements will be fine.\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003chr\u003e\n\n\u003cp\u003eSorry for such a long post but its a puzzle that I am trying to solve for a long time. Hope some of you expert may have the right insight to crack it.\u003c/p\u003e\n\n\u003cp\u003eBR\u003c/p\u003e","accepted_answer_id":"7422821","answer_count":"1","comment_count":"4","creation_date":"2011-09-14 19:21:12.07 UTC","favorite_count":"1","last_activity_date":"2011-09-15 20:35:31.37 UTC","last_edit_date":"2011-09-14 20:16:18.067 UTC","last_editor_display_name":"","last_editor_user_id":"782363","owner_display_name":"","owner_user_id":"782363","post_type_id":"1","score":"1","tags":"input|geometry|wolfram-mathematica|computational-geometry|cad","view_count":"544"} +{"id":"27240107","title":"Mobile Services: How to handle the case where your query string is too long?","body":"\u003cp\u003eWith Azure Mobile Services Offline Support I'm issuing a PullAsync query like so:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e// This list contains 53 emails\nvar deviceContactEmails = new List\u0026lt;string\u0026gt; { \"derek@gmail.com\", \"sarah@gmail.com\", ... };\nvar query = _userTable.Where(x =\u0026gt; deviceContactEmails.Contains(x.Email));\nawait _userTable.PullAsync(query);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe Mobile Services SDK translates query into a URL encoded GET request with a filter like so (this was a list of 60 emails used for the Contains but I cut out a lot of the middle for brevity):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ehttps://rememberwhen.azure-mobile.net/tables/User?$filter=((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((email%20eq%20'carlin_jmecwrv_stulberg%40tfbnw.net')%20or%20(email%20eq%20'carlin_jmecwrv_stulberg%40tfbnw.net'))%20or%20(email%20eq%20'carlin_jmecwrv_stulberg%40tfbnw.net'))%20eq%20'carlin_jmecwrv_stulberg%40tfbnw.net'))%20or%20(email%20eq%20'carlin_jmecwrv_stulberg%40tfbnw.net'))\u0026amp;$skip=0\u0026amp;$top=50\u0026amp;__includeDeleted=true\u0026amp;__systemproperties=__createdAt%2C__version\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe problem is that if deviceContactEmails is too long, the service will complain about the query string length. Trying to filter on this many items in the URL is a problem, so I need to filter by passing the items in the body of the request with JSON or some other way. \u003c/p\u003e\n\n\u003cp\u003eSo I guess the question is: How do I correctly set this up using the Mobile Service SDK with offline support so I can avoid exceeding the limit on the query string length in the URL encoded request?\u003c/p\u003e","answer_count":"1","comment_count":"4","creation_date":"2014-12-02 00:55:16.577 UTC","last_activity_date":"2014-12-02 19:37:36.42 UTC","last_edit_date":"2014-12-02 18:45:20.55 UTC","last_editor_display_name":"","last_editor_user_id":"567677","owner_display_name":"","owner_user_id":"567677","post_type_id":"1","score":"0","tags":"c#|azure|azure-mobile-services|offline-mode","view_count":"227"} +{"id":"11354482","title":"ListViewItem cannot be selected","body":"\u003cp\u003eI have a checkable item in my list view \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class CheckableMessageOut extends RelativeLayout implements Checkable{\n public CheckableMessageOut(Context context) {\n super(context);\n }\n\n public CheckableMessageOut(Context context, AttributeSet attrs) {\n super(context, attrs);\n }\n\n LinearLayout wrapper;\n private boolean checked = false;\n\n @Override\n public void setChecked(boolean b) {\n if (checked!=b){\n if (b){\n wrapper.setBackgroundResource(R.drawable.label_msg_out_selected);\n } else {\n wrapper.setBackgroundResource(R.drawable.label_msg_out);\n }\n }\n checked = b;\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI use it like this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;ru.kurganec.vk.messenger.ui.helper.CheckableMessageOut xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:layout_width=\"fill_parent\"\n android:layout_height=\"wrap_content\"\n\n \u0026gt;\n \u0026lt;LinearLayout\n android:id=\"@+id/wrapper\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_alignParentRight=\"true\"\n android:background=\"@drawable/label_msg_out\"\n android:orientation=\"vertical\"\u0026gt;\n \u0026lt;TextView\n android:id=\"@+id/text_msg\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n\n android:text=\"ad\"\n\n /\u0026gt;\n \u0026lt;LinearLayout\n android:id=\"@+id/list_attach\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_gravity=\"right\"\n android:orientation=\"vertical\"\u0026gt;\n \u0026lt;/LinearLayout\u0026gt;\n \u0026lt;/LinearLayout\u0026gt;\n\n \u0026lt;TextView\n android:id=\"@+id/text_date\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_toLeftOf=\"@id/wrapper\"\n\n android:text=\"06.06\"/\u0026gt;\n\n\u0026lt;/ru.kurganec.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003evk.messenger.ui.helper.CheckableMessageOut\u003e\u003c/p\u003e\n\n\u003cp\u003esometimes i add some views programmatically to the @id/list_attach and then something strage happens. I cannot select the item with attached view.\u003c/p\u003e\n\n\u003cp\u003eWhole It looks like this.\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/UjRbB.png\" alt=\"Message with photo cannot be selected but others(without photos) can be selected\"\u003e\u003c/p\u003e\n\n\u003cp\u003eby saying selected i mean checked.\nI set this field mList.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);\u003c/p\u003e\n\n\u003cp\u003eWhy can't i select the itemss?\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003eUPDATE\u003c/p\u003e\n\n\u003cp\u003eFragment class \u003ca href=\"http://pastebin.com/BZRhahbi\" rel=\"nofollow noreferrer\"\u003ehttp://pastebin.com/BZRhahbi\u003c/a\u003e this is the main part of my app , so it looks like \"god class\" antipattern\u003c/p\u003e\n\n\u003cp\u003eAdapter class \u003ca href=\"http://pastebin.com/Av7ntUmG\" rel=\"nofollow noreferrer\"\u003ehttp://pastebin.com/Av7ntUmG\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eAdapter's item class \u003ca href=\"http://pastebin.com/MdYc7Ksw\" rel=\"nofollow noreferrer\"\u003ehttp://pastebin.com/MdYc7Ksw\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"11427216","answer_count":"3","comment_count":"2","creation_date":"2012-07-06 00:46:16.43 UTC","last_activity_date":"2012-07-11 07:00:41.067 UTC","last_edit_date":"2012-07-06 01:41:39.743 UTC","last_editor_display_name":"","last_editor_user_id":"1321940","owner_display_name":"","owner_user_id":"1321940","post_type_id":"1","score":"-3","tags":"android|listview","view_count":"375"} +{"id":"30645751","title":"API Testing Using SoapUI vs Postman vs Runscope","body":"\u003cp\u003eI'm new to using applications to test backend APIs. I've always just manually tested using the front-end applications. What I would like to do is to use an app that is designed specifically for backend API testing. So far, I've been directed to SoapUI, Postman, and Runscope. But I'm at a loss as I am more of a test analyst than I am a programmer, despite having experience automated testing in Selenium with JavaScript, Python and Ruby. Any suggestions? Thoughts? Warnings?\u003c/p\u003e\n\n\u003cp\u003e(I posted this to the QA page, too, so sorry for the duplicate question)\u003c/p\u003e","answer_count":"2","comment_count":"2","creation_date":"2015-06-04 13:54:39.017 UTC","favorite_count":"2","last_activity_date":"2017-01-05 06:53:44.55 UTC","last_edit_date":"2015-06-04 13:59:58.567 UTC","last_editor_display_name":"","last_editor_user_id":"4142943","owner_display_name":"","owner_user_id":"4142943","post_type_id":"1","score":"7","tags":"automated-tests|soapui|postman|web-api-testing|runscope","view_count":"10670"} +{"id":"41619070","title":"Remove information from Reports and Metrics generated in Testlink","body":"\u003cp\u003eI need to customize the reports generated in Reports and Metrics in Testlink. What I want to do is remove the Execution Type and Estimated exec. Duration (min) of the \"Test Report\" and \"Test Plan Report\"\u003c/p\u003e\n\n\u003cp\u003eSince:\u003c/p\u003e\n\n\u003cp\u003eTestlink is GPL, its repository is available for download and changes. The reports in question are generated by the files:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003cp\u003eTestlink / dev / apps / testlink-1.9.15 / lib / results /\nprintDocOptions.php\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eTest Report: localhost/testlink/lib/results/printDocument.php?level=testsuite\u0026amp;id=30\u0026amp;type=testplan\u0026amp;docTestPlanId=2\u0026amp;format=0\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eTest Plan Report: localhost/testlink/lib/results/printDocument.php?level=testsuite\u0026amp;id=30\u0026amp;type=testreport\u0026amp;docTestPlanId=2\u0026amp;format=0\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eTestlink / dev / apps / testlink-1.9.15 / lib /\nresults / testlink-1.9.15 / lib / results / printDocument.php\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003eAnd your requires ();\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003e\u003cstrong\u003eI would like to remove from the report the information that is circled in red in the image:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eDrive public image: \u003ca href=\"https://drive.google.com/file/d/0B4B3pCn0kyxOMXF0ZXB2c3I4a28/view?usp=sharing\" rel=\"nofollow noreferrer\"\u003ehttps://drive.google.com/file/d/0B4B3pCn0kyxOMXF0ZXB2c3I4a28/view?usp=sharing\u003c/a\u003e\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-01-12 17:08:44.463 UTC","last_activity_date":"2017-01-12 17:08:44.463 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6496005","post_type_id":"1","score":"0","tags":"php|report|customization|testlink","view_count":"29"} +{"id":"13814085","title":"is there something wrong with the iteration of my array?","body":"\u003cp\u003eit's says that there's no error but the array doesn't have any elements in it\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eNSMutableArray *validMoves = [[NSMutableArray alloc]init];\n\nfor (int i = 0; i \u0026lt; 100; i++)\n{\n [validMoves removeAllObjects];\n\n for (TileClass *tilearray in tiles ) \n {\n if ([self blankTile:tilearray] != NONE) \n {\n [validMoves addObject:tilearray];\n }\n\n }\n if (validMoves.count \u0026gt; 0) \n {\n NSInteger pick = arc4random_uniform(validMoves.count);\n [self movePiece:(TileClass *)[validMoves objectAtIndex:pick] withAnimation:NO];\n } \n else \n {\n NSLog(@\"no value\");\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"14","creation_date":"2012-12-11 05:18:01.41 UTC","favorite_count":"1","last_activity_date":"2012-12-11 08:11:18.5 UTC","last_edit_date":"2012-12-11 05:43:13.017 UTC","last_editor_display_name":"","last_editor_user_id":"1434338","owner_display_name":"","owner_user_id":"1884698","post_type_id":"1","score":"0","tags":"objective-c|xcode","view_count":"71"} +{"id":"9807536","title":"MOXy JAXB: how to map several XML tag elements to the same JAVA bean property","body":"\u003cp\u003eI am trying to unmarshall an XML file using MOXy JAXB. I have a set of classes, already generated, and I am using Xpath to map every XML element I need into my model.\u003c/p\u003e\n\n\u003cp\u003eI have an XML file like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" encoding=\"UTF-8\"?\u0026gt;\n\u0026lt;fe:Facturae xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\"\n xmlns:fe=\"http://www.facturae.es/Facturae/2009/v3.2/Facturae\"\u0026gt;\n \u0026lt;Parties\u0026gt;\n \u0026lt;SellerParty\u0026gt;\n \u0026lt;LegalEntity\u0026gt;\n \u0026lt;CorporateName\u0026gt;Company Comp SA\u0026lt;/CorporateName\u0026gt;\n \u0026lt;TradeName\u0026gt;Comp\u0026lt;/TradeName\u0026gt;\n \u0026lt;ContactDetails\u0026gt;\n \u0026lt;Telephone\u0026gt;917776665\u0026lt;/Telephone\u0026gt;\n \u0026lt;TeleFax\u0026gt;917776666\u0026lt;/TeleFax\u0026gt;\n \u0026lt;WebAddress\u0026gt;www.facturae.es\u0026lt;/WebAddress\u0026gt;\n \u0026lt;ElectronicMail\u0026gt;facturae@mityc.es\u0026lt;/ElectronicMail\u0026gt;\n \u0026lt;ContactPersons\u0026gt;Fernando\u0026lt;/ContactPersons\u0026gt;\n \u0026lt;CnoCnae\u0026gt;28000\u0026lt;/CnoCnae\u0026gt;\n \u0026lt;INETownCode\u0026gt;2134AAB\u0026lt;/INETownCode\u0026gt;\n \u0026lt;AdditionalContactDetails\u0026gt;Otros datos\u0026lt;/AdditionalContactDetails\u0026gt;\n \u0026lt;/ContactDetails\u0026gt;\n \u0026lt;/LegalEntity\u0026gt;\n \u0026lt;/SellerParty\u0026gt;\n \u0026lt;BuyerParty\u0026gt;\n \u0026lt;Individual\u0026gt;\n \u0026lt;Name\u0026gt;Juana\u0026lt;/Name\u0026gt;\n \u0026lt;FirstSurname\u0026gt;Mauriño\u0026lt;/FirstSurname\u0026gt;\n \u0026lt;OverseasAddress\u0026gt;\n \u0026lt;Address\u0026gt;Juncal 1315\u0026lt;/Address\u0026gt;\n \u0026lt;PostCodeAndTown\u0026gt;00000 Buenos Aires\u0026lt;/PostCodeAndTown\u0026gt;\n \u0026lt;Province\u0026gt;Capital Federal\u0026lt;/Province\u0026gt;\n \u0026lt;CountryCode\u0026gt;ARG\u0026lt;/CountryCode\u0026gt;\n \u0026lt;/OverseasAddress\u0026gt;\n \u0026lt;ContactDetails\u0026gt;\n \u0026lt;Telephone\u0026gt;00547775554\u0026lt;/Telephone\u0026gt;\n \u0026lt;TeleFax\u0026gt;00547775555\u0026lt;/TeleFax\u0026gt;\n \u0026lt;/ContactDetails\u0026gt;\n \u0026lt;/Individual\u0026gt;\n \u0026lt;/BuyerParty\u0026gt;\n \u0026lt;/Parties\u0026gt;\n\u0026lt;/fe:Facturae\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThen I have my model:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@XmlRootElement(namespace=\"http://www.facturae.es/Facturae/2009/v3.2/Facturae\", name=\"Facturae\")\npublic class Facturae implements BaseObject, SecuredObject, CreationDataAware {\n @XmlPath(\"Parties/SellerParty\")\n private Party sellerParty;\n\n @XmlPath(\"Parties/BuyerParty\")\n private Party buyerParty;\n}\n\npublic class Party implements BaseObject, SecuredObject, CreationDataAware {\n@XmlPath(\"LegalEntity/ContactDetails\")\n private ContactDetails contactDetails;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAs you can see, \u003ccode\u003e\u0026lt;ContactDetails\u0026gt;\u0026lt;/ContactDetails\u0026gt;\u003c/code\u003e is present in \u003ccode\u003e\u0026lt;SellerParty\u0026gt;\u0026lt;/SellerParty\u0026gt;\u003c/code\u003e and \u003ccode\u003e\u0026lt;BuyerParty\u0026gt;\u0026lt;/BuyerParty\u0026gt;\u003c/code\u003e but this two tags share the same JAVA object (Party). With the previous mapping (@XmlPath(\"LegalEntity/ContactDetails\")) I can pass correctly the ContactDetails info in SellerParty, but I want also to pass the ContactDetails in \u003ccode\u003e\u0026lt;BuyerParty\u0026gt;\u003c/code\u003e at the same time.\u003c/p\u003e\n\n\u003cp\u003eI was trying something like that:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@XmlPaths(value = { @XmlPath(\"LegalEntity/ContactDetails\"),@XmlPath(\"Individual/ContactDetails\") })\n private ContactDetails contactDetails;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut it doesn't work.\u003c/p\u003e\n\n\u003cp\u003eCan you guys give me a hand?\u003c/p\u003e\n\n\u003cp\u003eThank you very much.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2012-03-21 15:20:06.62 UTC","last_activity_date":"2012-03-21 17:50:33.817 UTC","last_edit_date":"2012-03-21 15:43:37.31 UTC","last_editor_display_name":"","last_editor_user_id":"383861","owner_display_name":"","owner_user_id":"1281500","post_type_id":"1","score":"1","tags":"jaxb|eclipselink|moxy","view_count":"571"} +{"id":"2762250","title":"Nullable\u003cT\u003e as a parameter","body":"\u003cp\u003eI alredy have this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic static object GetDBValue(object ObjectEvaluated)\n {\n if (ObjectEvaluated == null)\n return DBNull.Value;\n else\n return ObjectEvaluated;\n }\nused like:\n\n List\u0026lt;SqlParameter\u0026gt; Params = new List\u0026lt;SqlParameter\u0026gt;();\n Params.Add(new SqlParameter(\"@EntityType\", GetDBValue(EntityType)));\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow i wanted to keep the same interface but extend that to use it with nullable\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public static object GetDBValue(int? ObjectEvaluated)\n {\n if (ObjectEvaluated.HasValue)\n return ObjectEvaluated.Value;\n else\n return DBNull.Value;\n }\n\n public static object GetDBValue(DateTime? ObjectEvaluated)\n {...}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut i want only 1 function GetDBValue for nullables. How do I do that and keep the call as is is? Is that possible at all?\u003c/p\u003e\n\n\u003cp\u003eI can make it work like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public static object GetDBValue\u0026lt;T\u0026gt;(Nullable\u0026lt;T\u0026gt; ObjectEvaluated) where T : struct\n {\n if (ObjectEvaluated.HasValue)\n return ObjectEvaluated.Value;\n else\n return DBNull.Value;\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut the call changes to:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eParams.Add(new SqlParameter(\"@EntityID \", GetDBValue\u0026lt;int\u0026gt;(EntityID)));\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"2762275","answer_count":"3","comment_count":"0","creation_date":"2010-05-04 01:25:44.64 UTC","last_activity_date":"2010-05-04 04:18:23.71 UTC","last_edit_date":"2010-05-04 01:29:07.57 UTC","last_editor_display_name":"","last_editor_user_id":"65611","owner_display_name":"","owner_user_id":"331940","post_type_id":"1","score":"1","tags":"c#|generics|nullable","view_count":"1619"} +{"id":"20212173","title":"Implementing PHP Activerecord in self made MVC Framework","body":"\u003cp\u003eI'm trying to implement a PHPActiveRecord for my own tiny PHP MVC Framework. But it only work for several table, and won't work for other table. \nOK, my MVC structure like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eindex.php\n - assets\n - config/\n - core/\n - Bootstrap.php\n - Controller.php\n - Model.php \n - View.php\n - etc\n - libs/\n - php-activerecord/\n - ActiveRecord.php\n - others\n - app/\n - activerecords/\n - controllers/\n - models/\n - views/\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow i implement Activerecord is like this:\u003c/p\u003e\n\n\u003cp\u003eModel.php\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass Model\n{\n function __construct()\n {\n require_once 'libs/php-activerecord/ActiveRecord.php';\n\n ActiveRecord\\Config::initialize(function($cfg)\n { \n $cfg-\u0026gt;set_model_directory('app/activerecords');\n $cfg-\u0026gt;set_connections(array(\n 'development' =\u0026gt; 'mysql://root:@localhost/db_name'));\n });\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFor Example, I have 2 table, cities and laboratories. \nThe problem is when retrieving data from cities, it works well, but when retrieving data from laboratories it got an error : \"call to undefined method Laboratory::find\"\u003c/p\u003e\n\n\u003cp\u003eHere is the codes:\nTable Cities\u003c/p\u003e\n\n\u003cp\u003eLocation : activerecords/City.php\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass City extends ActiveRecord\\Model\n{\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eTable Laboratories\u003c/p\u003e\n\n\u003cp\u003eLocation : activerecords/Laboratory.php\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e class Laboratory extends ActiveRecord\\Model\n {\n\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIndex Controller\u003c/p\u003e\n\n\u003cp\u003eLocation : controllers/indexController.php\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass Index extends Controller\n{\n function __construct()\n {\n parent::__construct();\n Session::init();\n }\n\n function index()\n {\n $this-\u0026gt;view-\u0026gt;cityLists = $this-\u0026gt;model-\u0026gt;getCityLists();\n $this-\u0026gt;view-\u0026gt;laboratoryLists = $this-\u0026gt;model-\u0026gt;getLaboratoryLists();\n $this-\u0026gt;view-\u0026gt;render('home/index'); \n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eModel\u003c/p\u003e\n\n\u003cp\u003eLocation : models/indexModel.php\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass indexModel extends Model\n{\n function __construct()\n {\n parent::__construct();\n }\n\n function getLaboratoryLists()\n {\n return Laboratory::find('all');\n }\n\n function getCityLists()\n {\n return City::find('all');\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eViews\u003c/p\u003e\n\n\u003cp\u003eLocation : views/home/index.php\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eforeach($this-\u0026gt;cityLists as $key){\n echo $key-\u0026gt;id.' - '.$key-\u0026gt;name;\n}\n\nforeach($this-\u0026gt;laboratoryLists as $key){\n echo $key-\u0026gt;id.' - '.$key-\u0026gt;name;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn the browser, the list of Cities is can be loaded, but it can load the data from table laboratories.\u003cbr\u003e\nThe browser says: \"call to undefined method Laboratory::find\"\u003c/p\u003e\n\n\u003cp\u003eCan someone tell me whats wrong with my codes? is this because of the conventions of PHPActiveRecord or other?\u003c/p\u003e\n\n\u003cp\u003eThanks Before... and sory for my poor english..\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2013-11-26 08:47:26.057 UTC","favorite_count":"1","last_activity_date":"2013-11-26 09:06:11.847 UTC","last_edit_date":"2013-11-26 09:06:11.847 UTC","last_editor_display_name":"","last_editor_user_id":"727208","owner_display_name":"","owner_user_id":"1598501","post_type_id":"1","score":"0","tags":"php|phpactiverecord","view_count":"533"} +{"id":"33200148","title":"Struts 1.2.9 - Questions around custom internationalization","body":"\u003cp\u003eWe have a legacy application that uses Struts 1.2.9. The app is currently internationalized the standard way - \u003ccode\u003e.properties\u003c/code\u003e files for all UI labels, errors, messages, etc; \u003ccode\u003e\u0026lt;message-resouces\u0026gt;\u003c/code\u003e definition for each .properties file in \u003ccode\u003estruts-config.xml\u003c/code\u003e using default \u003ccode\u003eFactory\u003c/code\u003e \u0026amp; \u003ccode\u003eMessageResources\u003c/code\u003e definitions; \u003ccode\u003e\u0026lt;bean:message\u0026gt;\u003c/code\u003e usage in all JSPs. This has worked great till now, but for the fact that the application itself a framework for services used by a few hundred (yes 100's!) other applications internally.\u003c/p\u003e\n\n\u003cp\u003eWe have a requirement to extend the i18n functionality as follows:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eDefine a custom directory for \u003ccode\u003e.properties\u003c/code\u003e files - so this would be outside the scope of the classpath; basically not inside the \u003ccode\u003e.war\u003c/code\u003e package. The idea is to support just message string changes w/o really having to redeploy the entire application.\u003c/li\u003e\n\u003cli\u003eThis custom directory will also contain per supported applications messages - this could be just a subset of the existing ones or the entire set of resources tailored specifically to that application.\u003c/li\u003e\n\u003cli\u003eCustom way of supporting per request basis \u003ccode\u003eLocale\u003c/code\u003e setting - barring all other considerations (default stack, classpath/package lookups, etc.) this is analogous to the way \u003ccode\u003eI18nInterceptor\u003c/code\u003e works in Struts2 with the \u003ccode\u003erequestOnlyParameterName\u003c/code\u003e attribute set to \u003ccode\u003etrue\u003c/code\u003e.\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eYes, I do understand that a few 100 bundles loaded at the same time will be memory intensive, but that is acceptable in our case.\u003c/p\u003e\n\n\u003cp\u003eAny help is appreciated - be it direction, sample code, etc.\u003c/p\u003e\n\n\u003cp\u003eNote: I completely agree that moving onto a newer UI platform is probably the best solution. But we can't.\u003c/p\u003e\n\n\u003cp\u003eTIA.\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2015-10-18 16:12:05.557 UTC","last_activity_date":"2015-11-10 20:53:43.09 UTC","last_edit_date":"2015-10-18 19:07:39.85 UTC","last_editor_display_name":"","last_editor_user_id":"912947","owner_display_name":"","owner_user_id":"912947","post_type_id":"1","score":"6","tags":"java|internationalization|customization|struts-1","view_count":"114"} +{"id":"8649068","title":"Working with Text Files Two","body":"\u003cp\u003eA couple of questions really about the code below from which I gained assistance in a previous post. \u003c/p\u003e\n\n\u003cp\u003e1). Any ideas why at the end of the ouput, I get a random garbage character printed? I am freeing the files etc and checking for EOF.\u003c/p\u003e\n\n\u003cp\u003e2). The idea is that it can work with multiple file arguements, so I want to create new file names which increment, i.e. out[i].txt, is that possible in C? \u003c/p\u003e\n\n\u003cp\u003eThe code itself takes a file containing words all separated by spaces, like a book for example, then loops through, and replaces each space with a \\n so that it forms a list, please find the code below:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;stdlib.h\u0026gt;\n#include \u0026lt;ctype.h\u0026gt;\n#include \u0026lt;string.h\u0026gt;\n#include \u0026lt;stdio.h\u0026gt;\n\n/*\n * \n */\nint main(int argc, char** argv) {\n\nFILE *fpIn, *fpOut;\nint i;\nchar c;\nwhile(argc--) {\n for(i = 1; i \u0026lt;= argc; i++) {\n fpIn = fopen(argv[i], \"rb\");\n fpOut= fopen(\"tmp.out\", \"wb\");\n while (c != EOF) {\n c = fgetc(fpIn);\n if (isspace(c)) \n c = '\\n';\n fputc(c, fpOut );\n }\n }\n}\nfclose(fpIn);\nfclose(fpOut);\nreturn 0;\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"8649137","answer_count":"2","comment_count":"2","creation_date":"2011-12-27 20:39:34.967 UTC","favorite_count":"0","last_activity_date":"2011-12-27 20:59:56.53 UTC","last_edit_date":"2011-12-27 20:51:00.21 UTC","last_editor_display_name":"","last_editor_user_id":"560648","owner_display_name":"","owner_user_id":"1048116","post_type_id":"1","score":"-1","tags":"c|io|fopen|fclose","view_count":"393"} +{"id":"5785613","title":"What is the advantage of defining an interface for .NET classes exposed to COM?","body":"\u003cp\u003eI am building a library which needs to be referenced from VBA so I need to provide a type library to support early binding. Most of the examples I have seen define a interface for classes which are exposed to COM e.g.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[Guid(\"D6F88E95-8A27-4ae6-B6DE-0542A0FC7039\")] \n[InterfaceType(ComInterfaceType.InterfaceIsDual)] \npublic interface IMyClass \n\n[Guid(\"13FE32AD-4BF8-495f-AB4D-6C61BD463EA4\")] \n[ClassInterface(ClassInterfaceType.None)] \n[ProgId(\"MyNamespace.MyClass\")] \npublic class MyClass : IMyClass\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs there any disadvantage in having a class implement the interface directly using ClassInterface.AutoDual? For more complex classes I like having interfaces to clearly define which members are exposed com without having to use the ComVisible attribute everywhere. But I will also have a number of fairly trivial data classes like event args which will be exposed to COM in their entirety. I have also seen examples which explicitly set dispids on interfaces - is there any advantage in doing this? \u003c/p\u003e","accepted_answer_id":"5785826","answer_count":"1","comment_count":"1","creation_date":"2011-04-26 03:33:06.23 UTC","last_activity_date":"2011-04-26 04:08:29.837 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"276779","post_type_id":"1","score":"2","tags":".net|com","view_count":"443"} +{"id":"11375311","title":"How to get piece by piece data from WCF service","body":"\u003cp\u003eI have created a .Net app which allows to query IIS logs of some web servers.\nThe app calls WCF service to get data. WCF service location has the IIS logs in place.\nThe WCF service internally calls Logparser on the IIS log files and returns the result.\nThere are multiple IIS log files.\nIf I run logparser on all of them in one go, it takes a lot of time to return as there are about 30 huge IIS log files which are queried.\nI want to run logparser on each of these IIS logs one by one and return result one by one.\u003c/p\u003e\n\n\u003cp\u003eI am looking for a framework which works over WCF and allows piece by piece data retrieval from the WCF service.\nSo I want to get result of IISlogfile1, then of IISlogfile2, and so on.\nOtherwise the UI will have to wait for a very long time to get full result in one go.\u003c/p\u003e\n\n\u003cp\u003eDo you know of any existing framework which allows part by part retrieval of data from WCF service?\u003c/p\u003e\n\n\u003cp\u003ePS: The workaround I have is to call the service multiple times, once for each IIS log file, till it responses that all data is sent. But I am looking for a cleaner solution.\u003c/p\u003e","accepted_answer_id":"11388832","answer_count":"2","comment_count":"1","creation_date":"2012-07-07 13:16:20.393 UTC","favorite_count":"1","last_activity_date":"2012-07-09 03:57:35.523 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"442465","post_type_id":"1","score":"1","tags":"wcf|service|logparser|piecewise|iis-logs","view_count":"196"} +{"id":"38067898","title":"Find all elements in a list that contain values in string array","body":"\u003cp\u003eIf i have two elements in an array;\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eFirstName,LastName,Company\nDonald,Duck,Disney\nDaffey,Duck,Warner Brothers\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow my user enters \"d\", i should get both records.\u003c/p\u003e\n\n\u003cp\u003eNow my user enters \"duck\" and again i should get both records.\u003c/p\u003e\n\n\u003cp\u003eNow my user enters \"duck disn\" and i should only get the first record.\u003c/p\u003e\n\n\u003cp\u003eIs there a way to do this in linq?\u003c/p\u003e\n\n\u003cp\u003e\u003cem\u003eedit\u003c/em\u003e\u003c/p\u003e\n\n\u003cp\u003eI have tried a few things, the latest is this;\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar searchTerms = searchText.Split(\" \".ToCharArray());\n\nenquiryList = enquiryList.Where(x =\u0026gt; \n searchTerms.Contains(x.CompanyName.ToLower()) || \n searchTerms.Contains(x.FirstName.ToLower()) || \n searchTerms.Contains(x.LastName.ToLower())).ToList();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut this only works if i enter the full words like disney and not part words like dis\u003c/p\u003e","accepted_answer_id":"38068010","answer_count":"3","comment_count":"0","creation_date":"2016-06-28 05:41:24.277 UTC","last_activity_date":"2016-06-28 06:22:56.207 UTC","last_edit_date":"2016-06-28 05:57:12.287 UTC","last_editor_display_name":"","last_editor_user_id":"2528063","owner_display_name":"","owner_user_id":"129195","post_type_id":"1","score":"-1","tags":"c#|linq","view_count":"64"} +{"id":"39724630","title":"How to count the number of instances a pattern is matched in Redshift/Postgresql","body":"\u003cp\u003eFor demo purposes, say I have a large table (billion rows+) in Redshift, with two fields:\n\u003ccode\u003eid\u003c/code\u003e and \u003ccode\u003ewin\u003c/code\u003e. \u003ccode\u003ewin\u003c/code\u003e can be \u003ccode\u003e0\u003c/code\u003e or \u003ccode\u003e1\u003c/code\u003e. \u003c/p\u003e\n\n\u003cp\u003eIs there an efficient way to count the number of times a win sequence of the following type is matched: \u003ccode\u003e1000\u003c/code\u003e? In other words, if the table contained this data:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e+-----+-----+\n| id | win |\n+-----+-----+\n| 0 | 0 |\n| 1 | 1 |\n| 2 | 0 |\n| 3 | 1 |\n| 4 | 0 |\n| 5 | 0 |\n| 6 | 0 |\n| 7 | 1 |\n+-----+-----+\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethe query would return 1.\u003c/p\u003e\n\n\u003cp\u003eI guess this question can be answered in \u003cstrong\u003ePostgreSQL\u003c/strong\u003e, and possibly in SQL.\u003cbr\u003e\nThanks.\u003c/p\u003e","answer_count":"1","comment_count":"8","creation_date":"2016-09-27 12:24:45.317 UTC","last_activity_date":"2016-09-27 12:28:14.177 UTC","last_edit_date":"2016-09-27 12:28:14.177 UTC","last_editor_display_name":"","last_editor_user_id":"3682162","owner_display_name":"","owner_user_id":"374253","post_type_id":"1","score":"0","tags":"sql|postgresql|amazon-redshift","view_count":"38"} +{"id":"47317435","title":"using GET to get JSON data from multiple pages","body":"\u003cp\u003eI need to get data from URL. \u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003e\u003cp\u003eThe code below gives the error \"reading past end of file\". Yet the URL is correct, can paste in into browser and see results. Couple of time I got \"time limit exceeded\" error, not sure if there is anything I can do about that.\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eThe problem is that data can be on several pages.Do I have to pick total_pages from page1 and do a loop? Is there a better solution?\u003c/p\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eHere is the code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003estring url=\"https://jsonmock.hackerrank.com/api/movies/search/?Title=spiderman\u0026amp;page=1\";\nstring res=MakeRequest(url);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMakeRequest:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003estatic public string MakeRequest(string url)\n{\n\n HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);\n request.ContentType = \"application/json; charset=utf-8\";\n request.PreAuthenticate = true;\n\n HttpWebResponse response = request.GetResponse() as HttpWebResponse;\n using (Stream responseStream = response.GetResponseStream())\n {\n StreamReader reader = new StreamReader(responseStream, Encoding.UTF8);\n return (reader.ReadToEnd());\n\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is what the data (page2) looks like\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\"page\":\"2\",\"per_page\":10,\"total\":13,\"total_pages\":2,\"data\":[{\"Poster\":\"N/A\",\"Title\":\"They Call Me Spiderman\",\"Type\":\"movie\",\"Year\":2016,\"imdbID\":\"tt5861236\"},{\"Poster\":\"N/A\",\"Title\":\"The Death of Spiderman\",\"Type\":\"movie\",\"Year\":2015,\"imdbID\":\"tt5921428\"},{\"Poster\":\"https://images-na.ssl-images-amazon.com/images/M/MV5BZDlmMGQwYmItNTNmOS00OTNkLTkxNTYtNDM3ZWVlMWUyZDIzXkEyXkFqcGdeQXVyMTA5Mzk5Mw@@._V1_SX300.jpg\",\"Title\":\"Spiderman in Cannes\",\"Type\":\"movie\",\"Year\":2016,\"imdbID\":\"tt5978586\"}]}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"4","creation_date":"2017-11-15 21:19:40.057 UTC","last_activity_date":"2017-11-16 21:34:18.353 UTC","last_edit_date":"2017-11-15 21:50:05.537 UTC","last_editor_display_name":"","last_editor_user_id":"1271037","owner_display_name":"","owner_user_id":"5600284","post_type_id":"1","score":"3","tags":"c#|json","view_count":"67"} +{"id":"40016811","title":"How to make a new line and print the same characters in new line","body":"\u003cp\u003eI'm trying to learn assembly. I saw this example in printing \"Hello World!(red text) with a backgound color(yellow)\"\u003c/p\u003e\n\n\u003cp\u003eI managed to edit the code to just print spaces with yellow background by trial and error. However I cannot print a new line. if I add a new \u003ccode\u003emov [200], ' '\u003c/code\u003e for example (dont know if this is correct) it adds a character on a different line but a different color.. if I add \u003ccode\u003e00010001b\u003c/code\u003e after the comma if prints a different color which should blue. \u003c/p\u003e\n\n\u003cp\u003ecan anyone give me a head start tutorial in this code. I just want to print another line for now.. Here is the working code so far.. it prints a whole line of yellow \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ename \"hi-world\"\n\n\n; hex bin color ; ; 0 0000 black ; 1 0001 blue ; 2 0010 green ; 3 0011 cyan ; 4 0100 red ; 5 0101 magenta ; 6 0110 brown ; 7 0111 light gray ; 8 1000 dark gray ; 9 1001 light blue ; a 1010 light green ; b 1011 light cyan ; c 1100 light red ; d 1101 light magenta ; e 1110 yellow ; f 1111 white\n\n\n\norg 100h\n\n; set video mode mov ax, 3 ; text mode 80x25, 16 colors, 8 pages (ah=0, al=3) int 10h ; do it!\n\n; cancel blinking and enable all 16 colors: mov ax, 1003h mov bx, 0 int 10h\n\n\n; set segment register: mov ax, 0b800h mov ds, ax\n\n; print \"hello world\" ; first byte is ascii code, second byte is color code.\n\nmov [02h], ' '\n\nmov [04h], ' '\n\nmov [06h], ' '\n\nmov [08h], ' '\n\nmov [0ah], ' '\n\nmov [0ch], ' '\n\nmov [0eh], ' ' \n\nmov [10h], ' '\n\nmov [12h], ' '\n\nmov [14h], ' '\n\nmov [16h], ' '\n\nmov [18h], ' '\n\nmov [1ah], ' '\n\nmov [1ch], ' '\n\nmov [1eh], ' ' \n\nmov [20h], ' '\n\n\n; color all characters: mov cx, 34 ; number of characters. mov di, 03h ; start from byte after 'h'\n\nc: mov [di], 11101100b ; light red(1100) on yellow(1110)\n add di, 2 ; skip over next ascii code in vga memory.\n loop c\n\n; wait for any key press: mov ah, 0 int 16h\n\nret\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"40018198","answer_count":"1","comment_count":"0","creation_date":"2016-10-13 09:13:02.21 UTC","last_activity_date":"2016-10-13 11:43:31.407 UTC","last_edit_date":"2016-10-13 11:43:31.407 UTC","last_editor_display_name":"","last_editor_user_id":"3494013","owner_display_name":"","owner_user_id":"5030083","post_type_id":"1","score":"0","tags":"assembly|emu8086","view_count":"361"} +{"id":"18842449","title":"AngularJS REST Example DELETE method Bad Request 400","body":"\u003cp\u003eI'm new to AngularJS and I'm trying to implement a CRUD REST Angular Application.\nAs Server for the REST Services I'm using a tomcat 7 server with Jersey.\u003c/p\u003e\n\n\u003cp\u003eUntil now I managed to implement the GET and POST METHOD as REST services, and they work.\nActually I'm trying to implment the DELETE Method, but I continue retreiving HTTP Error 400 Bad Request in the Browser. \nUsed Browser is Chrome 29 running on ubuntu OS.\u003c/p\u003e\n\n\u003cp\u003eMy REST Services\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport javax.ws.rs.Consumes;\nimport javax.ws.rs.DELETE;\nimport javax.ws.rs.GET;\nimport javax.ws.rs.PUT;\nimport javax.ws.rs.Path;\nimport javax.ws.rs.PathParam;\nimport javax.ws.rs.Produces;\nimport javax.ws.rs.core.Context;\nimport javax.ws.rs.core.MediaType;\nimport javax.ws.rs.core.Request;\nimport javax.ws.rs.core.Response;\nimport javax.ws.rs.core.UriInfo;\nimport javax.xml.bind.JAXBElement;\n\n@Path(\"/recipe\")\npublic class RecipeResource {\n\n @Context\n private UriInfo uriInfo;\n @Context\n private Request request;\n\n private String id;\n\n @GET\n @Produces({ MediaType.APPLICATION_JSON })\n public List\u0026lt;Recipe\u0026gt; getRecipes() {\n List\u0026lt;Recipe\u0026gt; dummyData = new ArrayList\u0026lt;\u0026gt;();\n dummyData.add(new Recipe(new Long(1), \"Recipe1\", \"Description1\", null));\n dummyData.add(new Recipe(new Long(2), \"Recipe2\", \"Description2\", null));\n dummyData.add(new Recipe(new Long(3), \"Recipe3\", \"Description3\", null));\n dummyData.add(new Recipe(new Long(4), \"Recipe4\", \"Description4\", null));\n dummyData.add(new Recipe(new Long(5), \"Recipe5\", \"Description5\", null));\n dummyData.add(new Recipe(new Long(6), \"Recipe6\", \"Description6\", null));\n dummyData.add(new Recipe(new Long(7), \"Recipe7\", \"Description7\", null));\n dummyData.add(new Recipe(new Long(8), \"Recipe8\", \"Description8\", null));\n dummyData.add(new Recipe(new Long(9), \"Recipe9\", \"Description9\", null));\n System.out\n .println(\"REST Service Method getRecipes called by JSON Client\");\n\n System.out.println(\"Called URI: \" + uriInfo.getAbsolutePath());\n return dummyData;\n }\n\n @GET\n @Produces({ MediaType.TEXT_XML, MediaType.APPLICATION_XML })\n public List\u0026lt;Recipe\u0026gt; getRecipesBrowser() {\n System.out.println(\"REST Service Method getRecipesBrowser called\");\n System.out.println(\"Called URI: \" + uriInfo.getAbsolutePath());\n List\u0026lt;Recipe\u0026gt; dummyData = new ArrayList\u0026lt;\u0026gt;();\n dummyData.add(new Recipe(new Long(1), \"Recipe1\", \"Description1\", null));\n dummyData.add(new Recipe(new Long(2), \"Recipe2\", \"Description2\", null));\n dummyData.add(new Recipe(new Long(3), \"Recipe3\", \"Description3\", null));\n dummyData.add(new Recipe(new Long(4), \"Recipe4\", \"Description4\", null));\n dummyData.add(new Recipe(new Long(5), \"Recipe5\", \"Description5\", null));\n dummyData.add(new Recipe(new Long(6), \"Recipe6\", \"Description6\", null));\n dummyData.add(new Recipe(new Long(7), \"Recipe7\", \"Description7\", null));\n dummyData.add(new Recipe(new Long(8), \"Recipe8\", \"Description8\", null));\n dummyData.add(new Recipe(new Long(9), \"Recipe9\", \"Description9\", null));\n\n return dummyData;\n }\n\n @GET\n @Path(\"/{id}\")\n @Produces({ MediaType.APPLICATION_JSON, MediaType.TEXT_XML,\n MediaType.APPLICATION_XML })\n public Recipe getRecipeById(@PathParam(\"id\") int id) {\n System.out.println(\"REST Service Method getRecipeById called\");\n System.out.println(\"Called URI: \" + uriInfo.getAbsolutePath());\n // if (id.equals(\"1\")) {\n // return new Recipe(new Long(3), \"Recipe3\", \"Description3\", null);\n // }\n if (id \u0026lt;= 10) {\n return new Recipe(new Long(id), \"Recipe\" + id, \"Description\" + id,\n null);\n }\n\n return null;\n }\n\n @PUT\n @Path(\"/{id}\")\n @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })\n public Response updateRecipe(JAXBElement\u0026lt;Recipe\u0026gt; recipe) {\n System.out.println(\"REST Service Method updateRecipe called\");\n System.out.println(\"Called URI: \" + uriInfo.getAbsolutePath());\n Recipe newRecipe = recipe.getValue();\n return Response.created(uriInfo.getAbsolutePath()).build();\n }\n\n @DELETE\n @Path(\"/{id}\")\n @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })\n public Response deleteRecipe(JAXBElement\u0026lt;Recipe\u0026gt; recipe) {\n System.out.println(\"REST Service Method deleteRecipe called\");\n System.out.println(\"Called URI: \" + uriInfo.getAbsolutePath());\n Recipe newRecipe = recipe.getValue();\n return Response.created(uriInfo.getAbsolutePath()).build();\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe web.xml of my webapp:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" encoding=\"UTF-8\"?\u0026gt;\n\u0026lt;web-app xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n xmlns=\"http://java.sun.com/xml/ns/javaee\" xmlns:web=\"http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd\"\n xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd\"\n id=\"WebApp_ID\" version=\"2.5\"\u0026gt;\n \u0026lt;display-name\u0026gt;com.example.webservice\u0026lt;/display-name\u0026gt;\n \u0026lt;servlet\u0026gt;\n \u0026lt;servlet-name\u0026gt;Jersey REST Service\u0026lt;/servlet-name\u0026gt;\n \u0026lt;servlet-class\u0026gt;com.sun.jersey.spi.container.servlet.ServletContainer\u0026lt;/servlet-class\u0026gt;\n \u0026lt;init-param\u0026gt;\n \u0026lt;param-name\u0026gt;com.sun.jersey.config.property.packages\u0026lt;/param-name\u0026gt;\n \u0026lt;param-value\u0026gt;com.xxxx.yyyyy.services\u0026lt;/param-value\u0026gt;\n \u0026lt;/init-param\u0026gt;\n \u0026lt;init-param\u0026gt;\n \u0026lt;param-name\u0026gt;readonly\u0026lt;/param-name\u0026gt;\n \u0026lt;param-value\u0026gt;false\u0026lt;/param-value\u0026gt;\n \u0026lt;/init-param\u0026gt;\n \u0026lt;load-on-startup\u0026gt;1\u0026lt;/load-on-startup\u0026gt;\n \u0026lt;/servlet\u0026gt;\n \u0026lt;servlet-mapping\u0026gt;\n \u0026lt;servlet-name\u0026gt;Jersey REST Service\u0026lt;/servlet-name\u0026gt;\n \u0026lt;url-pattern\u0026gt;/rest/*\u0026lt;/url-pattern\u0026gt;\n \u0026lt;/servlet-mapping\u0026gt;\n \u0026lt;filter\u0026gt;\n \u0026lt;filter-name\u0026gt;CorsFilter\u0026lt;/filter-name\u0026gt;\n \u0026lt;filter-class\u0026gt;org.apache.catalina.filters.CorsFilter\u0026lt;/filter-class\u0026gt;\n \u0026lt;init-param\u0026gt;\n \u0026lt;param-name\u0026gt;cors.allowed.origins\u0026lt;/param-name\u0026gt;\n \u0026lt;param-value\u0026gt;*\u0026lt;/param-value\u0026gt;\n \u0026lt;/init-param\u0026gt;\n \u0026lt;init-param\u0026gt;\n \u0026lt;param-name\u0026gt;cors.allowed.methods\u0026lt;/param-name\u0026gt;\n \u0026lt;param-value\u0026gt;GET,POST,HEAD,OPTIONS,PUT,DELETE\u0026lt;/param-value\u0026gt;\n \u0026lt;/init-param\u0026gt;\n \u0026lt;init-param\u0026gt;\n \u0026lt;param-name\u0026gt;cors.allowed.headers\u0026lt;/param-name\u0026gt;\n \u0026lt;param-value\u0026gt;Content-Type,X-Requested-With,accept,Origin,Access-Control-Request-Method,Access-Control-Request-Headers\u0026lt;/param-value\u0026gt;\n \u0026lt;/init-param\u0026gt;\n \u0026lt;init-param\u0026gt;\n \u0026lt;param-name\u0026gt;cors.exposed.headers\u0026lt;/param-name\u0026gt;\n \u0026lt;param-value\u0026gt;Access-Control-Allow-Origin,Access-Control-Allow-Credentials\u0026lt;/param-value\u0026gt;\n \u0026lt;/init-param\u0026gt;\n \u0026lt;init-param\u0026gt;\n \u0026lt;param-name\u0026gt;cors.support.credentials\u0026lt;/param-name\u0026gt;\n \u0026lt;param-value\u0026gt;true\u0026lt;/param-value\u0026gt;\n \u0026lt;/init-param\u0026gt;\n \u0026lt;init-param\u0026gt;\n \u0026lt;param-name\u0026gt;cors.preflight.maxage\u0026lt;/param-name\u0026gt;\n \u0026lt;param-value\u0026gt;10\u0026lt;/param-value\u0026gt;\n \u0026lt;/init-param\u0026gt;\n\n \u0026lt;/filter\u0026gt;\n \u0026lt;filter-mapping\u0026gt;\n \u0026lt;filter-name\u0026gt;CorsFilter\u0026lt;/filter-name\u0026gt;\n \u0026lt;url-pattern\u0026gt;/*\u0026lt;/url-pattern\u0026gt;\n\n \u0026lt;/filter-mapping\u0026gt;\n\u0026lt;/web-app\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd here is the resource defintion from my AngularJS project:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eangular.module('myApp.recipeService', ['ngResource']).\nfactory('RecipeService', function($resource){\n return $resource('http://localhost\\\\:10080/CookstarServices/rest/recipe/:recipeId', {}, {\n getRecipes: {method:'GET', params:{recipeId: ''}, isArray:false},\n post: {method:'POST'},\n update: {method:'PUT', params: {recipeId: '@recipeId'}},\n remove: {method:'DELETE'}\n });\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHas anyone tell me why I getting a Bad Request when trying to call the DELETE method ?\nAny ideas hints are appreciated.\u003c/p\u003e","accepted_answer_id":"18844122","answer_count":"1","comment_count":"0","creation_date":"2013-09-17 06:10:19.31 UTC","last_activity_date":"2015-08-25 19:48:03.377 UTC","last_edit_date":"2015-08-25 19:48:03.377 UTC","last_editor_display_name":"","last_editor_user_id":"4370109","owner_display_name":"","owner_user_id":"2784507","post_type_id":"1","score":"1","tags":"angularjs|jersey|tomcat7|http-status-code-400|http-delete","view_count":"3446"} +{"id":"44429415","title":"Illegal Configuration: Compiling IB documents for earlier than iOS 7 is no longer supported","body":"\u003cp\u003eI recently updated to \u003cstrong\u003eXCode 9\u003c/strong\u003e. When I build the app it says \u003cstrong\u003e\"illegal configuration\"\u003c/strong\u003e for some storyboards in my pod files. I tried to recreate the storyboard files but it doesn't help.\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/fHjiM.png\" alt=\"[1]\"\u003e\u003c/p\u003e","accepted_answer_id":"44430034","answer_count":"2","comment_count":"0","creation_date":"2017-06-08 07:34:46.307 UTC","favorite_count":"2","last_activity_date":"2017-10-13 22:24:04.177 UTC","last_edit_date":"2017-06-08 08:09:44.65 UTC","last_editor_display_name":"","last_editor_user_id":"4744975","owner_display_name":"","owner_user_id":"8129895","post_type_id":"1","score":"65","tags":"storyboard|xcode9-beta","view_count":"14985"} +{"id":"3848142","title":"Internationalizing Bash scripts","body":"\u003cp\u003eI've been following a \u003ca href=\"http://www.linuxjournal.com/content/internationalizing-those-bash-scripts\" rel=\"nofollow\"\u003etutorial\u003c/a\u003e from a recent edition of the \u003cem\u003eLinux Journal\u003c/em\u003e which teaches how to internationalize Bash scripts. However, I'm having trouble getting it to work on my system (Ubuntu 10.04.) When I get to the part where I'm supposed to call \"gettext,\" after setting the environment variable TEXTDOMAINDIR, I get:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etoby@toby-laptop:~/Desktop/i18n$ gettext -s \"Greeting\"\nGreeting\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut it should be printing a message that says \"Hello, I can generate a random number between 2 numbers that you provide\" instead of just \"Greeting.\" Can anybody replicate this problem? Any ideas what I'm doing wrong? Thanks!\u003c/p\u003e","accepted_answer_id":"3848843","answer_count":"1","comment_count":"0","creation_date":"2010-10-03 01:08:15.11 UTC","favorite_count":"2","last_activity_date":"2010-10-03 06:33:02.623 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"464259","post_type_id":"1","score":"4","tags":"bash|ubuntu|internationalization|shell","view_count":"722"} +{"id":"9809339","title":"Multirow subselect as parameter to `execute using`","body":"\u003cp\u003eThe multirow subselect will be used in the right hand side of the \u003ccode\u003ein\u003c/code\u003e operator in the \u003ccode\u003ewhere\u003c/code\u003e clause:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecreate table t (a integer);\ninsert into t (a) values (1), (9);\n\ndrop function if exists f();\n\ncreate function f()\nreturns void as $$\nbegin\nexecute '\n select a\n from t\n where a in $1\n' using (select 1 union select 2);\nend;$$\nlanguage plpgsql;\n\nselect f();\n\nERROR: more than one row returned by a subquery used as an expression\nCONTEXT: SQL statement \"SELECT (select 1 union select 2)\"\nPL/pgSQL function \"f\" line 3 at EXECUTE statement\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow to achieve what the above function would if it worked?\u003c/p\u003e","accepted_answer_id":"9810832","answer_count":"2","comment_count":"0","creation_date":"2012-03-21 17:00:56.443 UTC","last_activity_date":"2012-03-21 21:42:18.133 UTC","last_edit_date":"2012-03-21 17:07:12.73 UTC","last_editor_display_name":"","last_editor_user_id":"131874","owner_display_name":"","owner_user_id":"131874","post_type_id":"1","score":"0","tags":"postgresql|stored-procedures|plpgsql|postgresql-9.1|dynamicquery","view_count":"733"} +{"id":"16012135","title":"Is it possible to run an application in Windows Phone in background?","body":"\u003cp\u003eIs it possible to run an application in Windows Phone in background?\u003c/p\u003e\n\n\u003cp\u003eI want to port a chat application from Android to Windows Phone, that requires to have a persistent Internet connection, so user doesn't need to keep that application opened. When application received a message - need to show a notification.\u003c/p\u003e\n\n\u003cp\u003eOn Android the connection logic was located in \u003ccode\u003eService\u003c/code\u003e, but I didn't find analogues for Windows Phone.\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","accepted_answer_id":"16013995","answer_count":"1","comment_count":"1","creation_date":"2013-04-15 09:47:10.867 UTC","last_activity_date":"2013-04-15 11:38:28.017 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1140570","post_type_id":"1","score":"1","tags":"windows-phone-7|background|windows-phone-8|windows-phone","view_count":"255"} +{"id":"2262899","title":"float: right doesn't work","body":"\u003cp\u003eI have two div's which classes are left and right. left is floated to left and right div is floated to right, but float doesn't work, I don't know why... I can't setup width in left div because I don't know right div images width's. So it's need to be fluid...\nhere is page:\nlink removed. sorry\u003c/p\u003e\n\n\u003cp\u003eand here is page where it's work's.\n\u003ca href=\"http://www.france24.com/en/20100111-freud-monet-basquiat-view-paris-2010\" rel=\"nofollow noreferrer\"\u003ehttp://www.france24.com/en/20100111-freud-monet-basquiat-view-paris-2010\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI spend on this 3 hours, I don't know why right is not floating...\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eUpd\u003c/strong\u003e: The problem fixed! Thank you ;)\u003c/p\u003e","accepted_answer_id":"2262933","answer_count":"4","comment_count":"1","creation_date":"2010-02-14 21:36:03.617 UTC","last_activity_date":"2017-02-27 22:24:50.5 UTC","last_edit_date":"2010-02-14 22:00:01.04 UTC","last_editor_display_name":"","last_editor_user_id":"246909","owner_display_name":"","owner_user_id":"246909","post_type_id":"1","score":"4","tags":"html|css|xhtml","view_count":"9949"} +{"id":"30217628","title":"Controls(textbox, label etc.,) are not display in simulator","body":"\u003cp\u003eWe are performing navigation from one viewcontroller(Login) to another viewcontroller(Home).In HomeViewController we are generating the buttons dynamically, and also need some static controls(label,textbox etc.,), but static controls are not display in simulator.\u003cimg src=\"https://i.stack.imgur.com/9Q1lh.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003ethis \"welcome\" and \"select route:\" labels are not showing in simulator, simulator showing only dynamic buttons as follows:\u003cimg src=\"https://i.stack.imgur.com/8OTXv.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eThanks in advance.\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2015-05-13 14:19:35.203 UTC","last_activity_date":"2015-05-13 14:29:35.967 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"552236","post_type_id":"1","score":"0","tags":"ios|objective-c|xcode6","view_count":"44"} +{"id":"39543512","title":"Json Array Request with volley not works","body":"\u003cp\u003eI have Json value like this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n\"events\": [2]\n0: {\n\"no\": 1\n\"id\": \"2\"\n\"nama\": \"Meja dengan kaki kuda\"\n\"harga\": 700000\n\"gambar\": \"poster/Donor_darah.jpg\"\n\"stok\": 39\n\"qty\": 3\n\"status\": 0\n\"total\": 2100000\n}-\n1: {\n\"no\": 2\n\"id\": \"1\"\n\"nama\": \"Lemari\"\n\"harga\": 500000\n\"gambar\": \"poster/grand-launching-gerakan-ui-mengajar-51.png\"\n\"stok\": 0\n\"qty\": 4\n\"status\": 0\n\"total\": 2000000\n}-\n-\n\"total\": 4100000\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand then I want to retrieve it in my android app with volley like this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eJsonArrayRequest arrReq = new JsonArrayRequest(Request.Method.POST, DATA_GET_NOTIF + page,null,\n new Response.Listener\u0026lt;JSONArray\u0026gt;() {\n @Override\n public void onResponse(JSONArray response) {\n Log.d(TAG, response.toString());\n\n if (response.length() \u0026gt; 0) {\n try {\n for (int a = 0; a \u0026lt; response.length(); a++) {\n JSONObject obj = response.getJSONObject(a);\n JSONArray event = obj.getJSONArray(\"events\");\n Log.d(\"JsonArray\",response.toString());\n\n // Parsing json\n for (int i = 0; i \u0026lt; event.length(); i++) {\n\n JSONObject jb = (JSONObject) event.get(i);\n Cart news = new Cart();\n\n int total = 0;\n no = jb.getInt(\"no\");\n\n news.setId(jb.getString(\"id\"));\n news.setJudul(jb.getString(\"nama\"));\n news.setHarga(jb.getInt(\"harga\"));\n news.setStok(jb.getInt(\"stok\"));\n news.setQty(jb.getInt(\"qty\"));\n news.setStatus(jb.getInt(\"status\"));\n news.setTotal(jb.getInt(\"total\"));\n\n\n if (jb.getString(\"gambar\") != \"\") {\n news.setImageUrl(jb.getString(\"gambar\"));\n }\n\n\n // adding news to news array\n eventList.add(news);\n\n if (no \u0026gt; offSet)\n offSet = no;\n\n Log.d(TAG, \"offSet \" + offSet);\n\n\n // notifying list adapter about data changes\n // so that it renders the list view with updated data\n adapter.notifyDataSetChanged();\n }\n }\n }catch (JSONException e) {\n e.printStackTrace();\n }\n }\n swipe.setRefreshing(false);\n }\n\n }, new Response.ErrorListener() {\n\n @Override\n public void onErrorResponse(VolleyError error) {\n VolleyLog.d(TAG, \"Error: \" + error.getMessage());\n swipe.setRefreshing(false);\n }\n\n }){\n @Override\n public Map\u0026lt;String, String\u0026gt; getHeaders() throws AuthFailureError {\n HashMap\u0026lt;String, String\u0026gt; params = new HashMap\u0026lt;String, String\u0026gt;();\n params.put(\"authorization\", apikeys);\n return params;\n }};\n\n // Adding request to request queue\n AppController.getInstance().addToRequestQueue(arrReq);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhy it is not appear in my app. because it works before I add \"events\" array in my json value. so before I add events array my json value justlike this \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[2]\n0: {\n\"no\": 1\n\"id\": \"17\"\n\"judul\": \"Compfest 8 Seminar\"\n\"deskripsi\": \"tes\"\n\"duit\": 47\n\"persen\": 47\n\"sisahari\": 47\n}-\n1: {\n\"no\": 2\n\"id\": \"19\"\n\"judul\": \"Grand Launching Gerakan UI Mengajar 5\"\n\"deskripsi\": \"tes\"\n\"duit\": 80\n\"persen\": 80\n\"sisahari\": 80\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand my code when it works like this :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eJsonArrayRequest arrReq = new JsonArrayRequest(Request.Method.POST, DATA_GET_NOTIF + page,null,\n new Response.Listener\u0026lt;JSONArray\u0026gt;() {\n @Override\n public void onResponse(JSONArray response) {\n Log.d(TAG, response.toString());\n\n if (response.length() \u0026gt; 0) {\n // Parsing json\n for (int i = 0; i \u0026lt; response.length(); i++) {\n try {\n\n\n JSONObject obj = response.getJSONObject(i);\n Cart news = new Cart();\n\n int total = 0;\n no = obj.getInt(\"no\");\n\n news.setId(obj.getString(\"id\"));\n news.setJudul(obj.getString(\"nama\"));\n news.setHarga(obj.getInt(\"harga\"));\n news.setStok(obj.getInt(\"stok\"));\n news.setQty(obj.getInt(\"qty\"));\n news.setStatus(obj.getInt(\"status\"));\n news.setTotal(obj.getInt(\"total\"));\n\n\n if (obj.getString(\"gambar\") != \"\") {\n news.setImageUrl(obj.getString(\"gambar\"));\n }\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"39543649","answer_count":"1","comment_count":"2","creation_date":"2016-09-17 06:20:55.747 UTC","favorite_count":"1","last_activity_date":"2016-09-17 06:39:00.383 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5779295","post_type_id":"1","score":"1","tags":"android|arrays|json|android-volley","view_count":"153"} +{"id":"43836896","title":"How to access variable outside the function in which it was defined?","body":"\u003cp\u003eI can't seem to use the variable that is defined within a jQuery click function. I know the difference between global and local variables, but creating the variable outside the function doesn't seem to help.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar $genre;\n$('#search').click(function() {\n $genre = $(this).attr('value');\n});\nconsole.log($genre);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThere has to be some simple solution that I'm just not thinking of.\u003c/p\u003e","answer_count":"3","comment_count":"4","creation_date":"2017-05-07 21:27:17.143 UTC","last_activity_date":"2017-05-07 22:24:49.957 UTC","last_edit_date":"2017-05-07 21:32:45.3 UTC","last_editor_display_name":"","last_editor_user_id":"616443","owner_display_name":"","owner_user_id":"7977725","post_type_id":"1","score":"-2","tags":"javascript|jquery","view_count":"708"} +{"id":"46997713","title":"Changing button colour using CSS","body":"\u003cp\u003eI have this html, that uses a bit of Javascript. I am trying to change the colour of the button using CSS. The CSS is in a file called getreplies.css and contains\u003c/p\u003e\n\n\u003cp\u003e\u003cdiv class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\"\u003e\r\n\u003cdiv class=\"snippet-code\"\u003e\r\n\u003cpre class=\"snippet-code-css lang-css prettyprint-override\"\u003e\u003ccode\u003e.button {\r\n color: red;\r\n}\u003c/code\u003e\u003c/pre\u003e\r\n\u003cpre class=\"snippet-code-html lang-html prettyprint-override\"\u003e\u003ccode\u003e\u0026lt;!DOCTYPE html\u0026gt;\r\n\u0026lt;html\u0026gt;\r\n\r\n\u0026lt;head\u0026gt;\r\n \u0026lt;link rel=\"stylesheet\" href=\"getreplies.css\"\u0026gt;\r\n\u0026lt;/head\u0026gt;\r\n\u0026lt;input class=\"button\" type=\"button\" onclick=\"location.href='path/messages.pl?name=\u0026lt;TMPL_VAR NAME=name\u0026gt;\u0026amp;page=\u0026lt;TMPL_VAR NAME=page\u0026gt;';\" value=\"\u0026lt;TMPL_VAR NAME=page\u0026gt;\"\u0026gt;\r\n\r\n\u0026lt;/html\u0026gt;\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003c/p\u003e\n\n\u003cp\u003eBut it doesn't work. I don't see any changes. Also, can someone tell me how I can centre these buttons using CSS as well? Thanks for any help!\u003c/p\u003e\n\n\u003cp\u003eP.S. if it helps, then I am doing this within a perl cgi script.\u003c/p\u003e","answer_count":"6","comment_count":"0","creation_date":"2017-10-29 07:10:25.18 UTC","last_activity_date":"2017-10-29 08:20:03.21 UTC","last_edit_date":"2017-10-29 07:52:00.727 UTC","last_editor_display_name":"","last_editor_user_id":"19068","owner_display_name":"","owner_user_id":"8289954","post_type_id":"1","score":"0","tags":"javascript|html|css|cgi","view_count":"57"} +{"id":"456551","title":"In the Dispose(bool) method implementation, Shouldn't one set members to null?","body":"\u003cp\u003eNone of the guides/notes/articles that discuss \u003ccode\u003eIDisposable\u003c/code\u003e pattern suggest that one should set the internal members to \u003ccode\u003enull\u003c/code\u003e in the \u003ccode\u003eDispose(bool)\u003c/code\u003e method (especially if they are memory hogging beasts).\u003c/p\u003e\n\n\u003cp\u003eI've come to realize the importance of it while debugging an internal benchmark tool. What used to happen was that, there was this buffer that contained a big array inside it. We used to use a static buffer for the whole benchmark program. Once we're done with the buffer, there was no way we could release this internal array, neither could we make this buffer releasable (as it was static).\u003c/p\u003e\n\n\u003cp\u003eSo, I believe that, after \u003ccode\u003eDispose()\u003c/code\u003e is called, the class should do everything it can so that it releases all the resources it is using and make them available again, even if the object being disposed itself is not collected back by GC, and not setting members to null, thereby, not allowing the internal objects to be collected by the GC implies that the Dispose implementation is not perfect. \u003c/p\u003e\n\n\u003cp\u003eWhat's your opinion on this ?\u003c/p\u003e","accepted_answer_id":"456572","answer_count":"3","comment_count":"0","creation_date":"2009-01-19 04:45:54.58 UTC","favorite_count":"1","last_activity_date":"2009-02-11 20:57:08.73 UTC","last_edit_date":"2009-02-11 20:57:08.73 UTC","last_editor_display_name":"Scott Dorman","last_editor_user_id":"1559","owner_display_name":"mherle","owner_user_id":"42913","post_type_id":"1","score":"4","tags":"c#|.net|memory-management|garbage-collection|dispose","view_count":"1498"} +{"id":"28305669","title":"Project multiple rows into a single row based on columns values in sql","body":"\u003cp\u003eI would like to know how you project multiple related rows into a single row, for example, a product that comes in multiple parts will have multiple SKUs but I want to project the multiple parts into a single row.\u003c/p\u003e\n\n\u003cp\u003eI'm sure this is possible but struggling to define the query for the desired result.\u003c/p\u003e\n\n\u003cp\u003eGiven the example dataset\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/cXUHc.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eI would like to project my result to the following\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/zKxJJ.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eWhat ends up in the product code or product name columns is irrelevant, essentially I just need a single row to represent these two rows.\u003c/p\u003e\n\n\u003cp\u003eHow would I achieve this?\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2015-02-03 18:02:10.157 UTC","last_activity_date":"2015-08-13 07:43:02.957 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"787317","post_type_id":"1","score":"1","tags":"sql","view_count":"441"} +{"id":"20894801","title":"Saas application implementation of subscription levels","body":"\u003cp\u003eI am in the final stages of a SaaS application (Software as service) I am in a little bind that I don't know which route to take. \u003c/p\u003e\n\n\u003cp\u003eI need to check the current user's subscription level and see if they can use the resource they are trying to reach.\u003c/p\u003e\n\n\u003cp\u003eThe way I am currently handling this (lack of experience) is that on every action that needs this check I'm hitting the repository and getting their subscription and making the decisions based on the returned data from SQL Server. I personally believe this is the worst way of doing this and don't like it.\u003c/p\u003e\n\n\u003cp\u003eI thought about making an action attribute that would make the check. Although I believe this is a better way to go (less code rewrite and maintenance) I'm thinking there must be a better way.\u003c/p\u003e\n\n\u003cp\u003eI also thought about making a helper and calling it every-time and storing the result in a session but I don't have much experience with sessions and have heard and read horror stories about it and azure (cloud platform in general)\u003c/p\u003e\n\n\u003cp\u003eAny Ideas?\u003c/p\u003e","accepted_answer_id":"20898795","answer_count":"1","comment_count":"0","creation_date":"2014-01-03 01:06:15.01 UTC","favorite_count":"1","last_activity_date":"2014-01-03 07:33:29.203 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1244328","post_type_id":"1","score":"0","tags":"c#|asp.net-mvc|asp.net-mvc-4|inversion-of-control","view_count":"112"} +{"id":"43659528","title":"Tweaking the look of the standard HTML5 audio player","body":"\u003cp\u003eI need a audio player with a progress-bar occupying 100% of its width and positioned at the bottom of the player.\nI know that I can find alternative players and skins online, but instead of include other libraries I would like to use the original audio tag and tweak its look in order to get what I need.\u003c/p\u003e\n\n\u003cp\u003eThe problem is that I do not know how to make these changes.\u003c/p\u003e\n\n\u003cp\u003eCan anyone help, please?\nJust to reinforce: I do not want to re-write the player from scratch.\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2017-04-27 13:37:11.71 UTC","last_activity_date":"2017-04-27 16:09:25.133 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7931495","post_type_id":"1","score":"0","tags":"css|html5-audio","view_count":"32"} +{"id":"43737237","title":"Crash logs not appearing in DashBoard","body":"\u003cp\u003eI have implemented crashlytics with cocoa Pods and have implemented the crash method provided and it does not reporting any crash logs in my dashboard.\nIn MyAppdeledate \"DidFinishLaunching\" method I have included this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[Crashlytics startWithAPIKey:@\"xxxxxxx\"];\n[[Twitter sharedInstance] startWithConsumerKey:@\"xxxx\" consumerSecret:@\"yyyyyyyy\"];\n [Fabric with:@[[Crashlytics class], [Twitter class]]];\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-05-02 11:55:43.903 UTC","last_activity_date":"2017-05-02 18:05:18.89 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2282030","post_type_id":"1","score":"0","tags":"ios|objective-c|crashlytics","view_count":"73"} +{"id":"46261633","title":"when second or any other image radio button is clicked, the first one gets updated","body":"\u003cp\u003eI have a form where menu has to be uploaded with menu title and type. The type can be food-menu and beverage-menu. Each type will have only 3 images. I have done that part \nbut when selecting the radio button for menu type, if i select second or other than first radio button, the first radio button gets selected. How do I solve this issue? \u003c/p\u003e\n\n\u003cp\u003eThe code can be large so here is the demo \u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://codesandbox.io/s/zxxrnw2qx4\" rel=\"nofollow noreferrer\"\u003ehttps://codesandbox.io/s/zxxrnw2qx4\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003ehere is the code in brief\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003econst Preview = props =\u0026gt; {\n return (\n \u0026lt;div\u0026gt;\n {props.files.map((file, index) =\u0026gt; {\n if (['image/png', 'image/jpg', 'image/jpeg'].includes(file.type)) {\n return (\n \u0026lt;ClientUploadedImage\n key={index}\n file={file}\n id={index}\n menu_title={props.menu_title}\n type={props.type}\n foodmenuError={props.foodmenuError}\n handleChange={props.handleChange}\n handleTypeChange={props.handleTypeChange}\n /\u0026gt;\n );\n }\n return \u0026lt;div\u0026gt;No File to Show Preview\u0026lt;/div\u0026gt;;\n })}\n \u0026lt;/div\u0026gt;\n );\n};\n\n\nconst ClientUploadedImage = props =\u0026gt; {\n return (\n \u0026lt;section id=\"menus-photo\"\u0026gt;\n \u0026lt;img src={props.file.preview} width={'400px'} height={'auto'} /\u0026gt;\n \u0026lt;div className=\"content\"\u0026gt;\n \u0026lt;form className=\"form\"\u0026gt;\n \u0026lt;Radio\n value=\"food-menu\"\n label={`Food Menu${props.id}`}\n name={props.id}\n handleChangeEvent={props.handleTypeChange}\n isChecked={props.type[props.id] === 'food-menu'}\n /\u0026gt;\n \u0026lt;Radio\n value=\"beverages-menu\"\n label={'Beverages Menu'}\n name={props.id}\n handleChangeEvent={props.handleTypeChange}\n isChecked={props.type[props.id] === 'beverages-menu'}\n /\u0026gt;\n \u0026lt;InputField\n name={props.id}\n type=\"text\"\n label=\"Menu Title\"\n onChange={props.handleChange}\n value={props.menu_title[props.id]}\n /\u0026gt;\n \u0026lt;/form\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/section\u0026gt;\n );\n};\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-09-17 07:18:29.873 UTC","favorite_count":"1","last_activity_date":"2017-09-17 09:45:34.087 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5765719","post_type_id":"1","score":"0","tags":"javascript|reactjs","view_count":"41"} +{"id":"2779622","title":"overloading new/delete problem","body":"\u003cp\u003eThis is my scenario, Im trying to overload new and delete globally. I have written my allocator class in a file called allocator.h. And what I am trying to achieve is that if a file is including this header file, my version of new and delete should be used.\u003c/p\u003e\n\n\u003cp\u003eSo in a header file \"allocator.h\" i have declared the two functions \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eextern void* operator new(std::size_t size);\nextern void operator delete(void *p, std::size_t size);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI the same header file I have a class that does all the allocator stuff,\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass SmallObjAllocator\n{\n ...\n};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to call this class from the new and delete functions and I would like the class to be static, so I have done this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etemplate\u0026lt;unsigned dummy\u0026gt;\nstruct My_SmallObjectAllocatorImpl\n{\n static SmallObjAllocator myAlloc;\n};\n\ntemplate\u0026lt;unsigned dummy\u0026gt;\nSmallObjAllocator My_SmallObjectAllocatorImpl\u0026lt;dummy\u0026gt;::myAlloc(DEFAULT_CHUNK_SIZE, MAX_OBJ_SIZE);\n\ntypedef My_SmallObjectAllocatorImpl\u0026lt;0\u0026gt; My_SmallObjectAllocator;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand in the cpp file it looks like this: allocator.cc\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evoid* operator new(std::size_t size)\n{\n\n std::cout \u0026lt;\u0026lt; \"using my new\" \u0026lt;\u0026lt; std::endl;\n\n if(size \u0026gt; MAX_OBJ_SIZE)\n return malloc(size);\n else\n return My_SmallObjectAllocator::myAlloc.allocate(size);\n}\n\nvoid operator delete(void *p, std::size_t size)\n{\n if(size \u0026gt; MAX_OBJ_SIZE)\n free(p);\n else\n My_SmallObjectAllocator::myAlloc.deallocate(p, size);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe problem is when I try to call the constructor for the class SmallObjAllocator which is a static object. For some reason the compiler are calling my overloaded function new when initializing it. So it then tries to use My_SmallObjectAllocator::myAlloc.deallocate(p, size); which is not defined so the program crashes.\u003c/p\u003e\n\n\u003cp\u003eSo why are the compiler calling new when I define a static object? and how can I solve it?\u003c/p\u003e","answer_count":"1","comment_count":"4","creation_date":"2010-05-06 08:34:15.813 UTC","last_activity_date":"2010-05-06 10:16:43.88 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"305160","post_type_id":"1","score":"0","tags":"c++|templates|memory-management|static-members","view_count":"366"} +{"id":"33596835","title":"Non Exhaustive Pattern Matching? (Haskell)","body":"\u003cp\u003eFor some reason, when I run the code with for exmaple let's say split1 [1,2,3,4,5,6,7,8,9,10] I get an error\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ep :: Int -\u0026gt; Bool\np x = if x \u0026lt; 5 then True else False\n\nsplit1 [xs] = [([x,y]) | x \u0026lt;- [xs], y \u0026lt;- [xs], p x == True, p y == False]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eEven if I run it with split1 [1] I get an empty set. Can someone tell me where i'm wrong? Thanks. \u003c/p\u003e","accepted_answer_id":"33596958","answer_count":"1","comment_count":"1","creation_date":"2015-11-08 17:30:05.063 UTC","last_activity_date":"2015-11-08 17:42:01.097 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4440962","post_type_id":"1","score":"0","tags":"haskell|list-comprehension","view_count":"54"} +{"id":"37246262","title":"Oracle to MySQL migration using Spring Boot","body":"\u003cp\u003eIs there any available/aiding tool in java/Spring to do read data from Oracle (old/existing table structure), do some transformation and basically send to Spring-data-REST exposed MySQL database(new table structure).\u003c/p\u003e\n\n\u003cp\u003eBasically, want to build a Spring boot application/service which does the same. \nP.S.,we have a audit log table in Oracle which we want to use it to drive/sync from Oracle to MySQL.\u003c/p\u003e\n\n\u003cp\u003eDoes Flyway support this?\u003c/p\u003e\n\n\u003cp\u003eThanks\nBharath\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2016-05-16 03:25:23.16 UTC","last_activity_date":"2016-05-16 03:25:23.16 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1664288","post_type_id":"1","score":"1","tags":"java|spring-boot|spring-data-rest","view_count":"53"} +{"id":"8593114","title":"YouTube replace url with video ID using JavaScript and jQuery","body":"\u003cp\u003ei have taken the regex from this \u003ca href=\"http://jsfiddle.net/HfqmE/1/\" rel=\"nofollow\"\u003ehttp://jsfiddle.net/HfqmE/1/\u003c/a\u003e\nI have the HTML\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;span class=\"yturl\"\u0026gt;http://www.youtube.com/watch?feature=endscreen\u0026amp;NR=1\u0026amp;v=jSAwWrbdoEQ\u0026lt;/span\u0026gt;\n\u0026lt;span class=\"yturl\"\u0026gt;http://www.youtube.com/watch?v=jSAwWrbdoEQ\u0026amp;feature=feedrec_grec_index\u0026lt;/span\u0026gt;\n\u0026lt;span class=\"yturl\"\u0026gt;http://youtu.be/jSAwWrbdoEQ\u0026lt;/span\u0026gt;\n\u0026lt;span class=\"yturl\"\u0026gt;http://www.youtube.com/embed/jSAwWrbdoEQ\u0026lt;/span\u0026gt;\n\u0026lt;span class=\"yturl\"\u0026gt;http://www.youtube.com/v/jSAwWrbdoEQ?version=3\u0026amp;amp;hl=en_US\u0026lt;/span\u0026gt;\n\u0026lt;span class=\"yturl\"\u0026gt;http://www.youtube.com/watch?NR=1\u0026amp;feature=endscreen\u0026amp;v=jSAwWrbdoEQ\u0026lt;/span\u0026gt;\n\u0026lt;span class=\"yturl\"\u0026gt;http://www.youtube.com/user/TheGameVEVO#p/a/u/1/jSAwWrbdoEQ\u0026lt;/span\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003efor each \u003ccode\u003espan.yturl\u003c/code\u003e I am trying to extract the id from the youtube url it contains i have attempted \u003ca href=\"http://jsfiddle.net/HfqmE/40/\" rel=\"nofollow\"\u003ehttp://jsfiddle.net/HfqmE/40/\u003c/a\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(\"span.yturl\").each(function(){\n var regex = /(\\?v=|\\\u0026amp;v=|\\/\\d\\/|\\/embed\\/|\\/v\\/|\\.be\\/)([a-zA-Z0-9\\-\\_]+)/;\n var youtubeurl = $(\"span.yturl\").html();\n var regexyoutubeurl = youtubeurl.match(regex);\n $(\"span.yturl\").html(regexyoutubeurl);\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethis however just leaves the outcome blank please help!!\u003c/p\u003e","accepted_answer_id":"8593188","answer_count":"2","comment_count":"0","creation_date":"2011-12-21 16:32:33.243 UTC","favorite_count":"1","last_activity_date":"2015-02-14 19:11:13.953 UTC","last_edit_date":"2012-08-29 19:00:11.343 UTC","last_editor_display_name":"","last_editor_user_id":"254318","owner_display_name":"","owner_user_id":"1742280","post_type_id":"1","score":"3","tags":"javascript|jquery|regex|parsing|youtube","view_count":"1363"} +{"id":"24487100","title":"Distinct on Multiple columns of a pig","body":"\u003cp\u003eI have a file \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e (1,1,100)\n (1,1,200)\n (1,2,300)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow I want the distinct to be applied on two columns and want the output to be \u003c/p\u003e\n\n\u003cp\u003eI did this \u003c/p\u003e\n\n\u003cp\u003eGroup on all the other columns, project just the columns of interest into a bag, and then use FLATTEN to expand them out again:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eA_unique =\n FOREACH (GROUP A BY id3) {\n b = A.(id1,id2);\n s = DISTINCT b;\n GENERATE FLATTEN(s);\n };\n\nDUMP A_unique;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOutput comes out to be \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e(1,1)\n(1,1)\n(1,2)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI expected it to be\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e(1,1)\n(1,2)\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"0","creation_date":"2014-06-30 09:37:09.833 UTC","last_activity_date":"2015-03-25 22:34:01.83 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1727888","post_type_id":"1","score":"-1","tags":"apache-pig","view_count":"985"} +{"id":"20904367","title":"Storing/adding a non predefined number of values from a single input (Python)","body":"\u003cp\u003eI am writing a small programm for a school assingment and for this assingment we have to input multiple values and then add them. The only problem is the number of values isn't predefined so a line such as \u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003ea, b, c, d = input(\"Enter four numbers separated by commas: \").split(',')\u003c/code\u003e \u003c/p\u003e\n\n\u003cp\u003ewon't work because the number of varibles isn't pre defined. Now my question was if there is a way to input a number of ints in a single input and then add them. I want somthing along the lines of\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eXnumber_of_varibles = input(\"enter x number of numbers separrated by comma's\").split(',')\nX1+x2+x3+x4 etc = awnser\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI also thought about making a loop but this would be a lot of work so i thought there might be a better option.\u003c/p\u003e","answer_count":"4","comment_count":"0","creation_date":"2014-01-03 13:05:08.237 UTC","last_activity_date":"2014-01-03 15:02:02.797 UTC","last_edit_date":"2014-01-03 13:12:39.36 UTC","last_editor_display_name":"","last_editor_user_id":"2425215","owner_display_name":"","owner_user_id":"3157264","post_type_id":"1","score":"1","tags":"python|variables|input|int","view_count":"71"} +{"id":"43646339","title":"Custom labels using geom_bin2d with ggplot2","body":"\u003cp\u003eI am trying to make a 2d plot where the boxes/tiles are labelled according to a column for the input data frame. I've used geom_bin2d (and stat_bin2d) to do similar things before but it seems to only allow count or density to be the actual plotted material. Example code is this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edf \u0026lt;- data.frame(Year = c(rep(2010, 4), rep(2011, 4), rep(2012, 4)), Rank = rep(1:4, 3), \n Diff = c(rep(0, 3), 1, 0, -1, 2, 0, -3, rep(0, 3)))\n\n\nggplot(df, aes(Year, Rank, Diff)) +\n geom_bin2d() +\n scale_fill_gradient(low='gray', high='red')\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat I want is something like this but with the guide bar also corresponding to the data displayed in the boxes. Note I added these numbers by hand for illustration purposes. Any help? \u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/wAoQe.jpg\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/wAoQe.jpg\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"43646481","answer_count":"1","comment_count":"0","creation_date":"2017-04-26 23:45:47.397 UTC","last_activity_date":"2017-04-27 22:57:03.71 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6477651","post_type_id":"1","score":"0","tags":"r|ggplot2","view_count":"37"} +{"id":"15563220","title":"Login In Storyboard","body":"\u003cp\u003eI have to implement login functionality to my application. The appropriate credentials like \"Username\" \u0026amp; \"Password\" are saved in an XML file. My requirement is to create an application using storyboard.\u003c/p\u003e\n\n\u003cp\u003eThe segue should have a conditional property and the next view should only be displayed when the correct credentials are entered.\u003c/p\u003e\n\n\u003cp\u003eIf i could get a tutorial to explain the same it would be great.\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2013-03-22 05:17:09.337 UTC","last_activity_date":"2013-03-22 05:17:09.337 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2173317","post_type_id":"1","score":"0","tags":"xml|login|xcode-storyboard","view_count":"54"} +{"id":"45885815","title":"Is there an automated way to see if AWS account has Premium Support Subscription","body":"\u003cp\u003eI have multiple AWS accounts and need an automated way (CLI or SDK) to find out if the account has a Premium Support Subscription.\u003c/p\u003e\n\n\u003cp\u003eEssentially I want to know whether I can use cloudwatch events from Trusted Advisor to trigger Lambda functions on a particular account.\u003c/p\u003e\n\n\u003cp\u003eOn the cli I can run:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eaws support \u0026lt;command\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand will get an error if Premium Support isn't enabled, but is there a better way to find this out?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-08-25 16:30:44.44 UTC","last_activity_date":"2017-08-25 16:46:13.763 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1706504","post_type_id":"1","score":"1","tags":"amazon-web-services|aws-sdk|aws-cli","view_count":"53"} +{"id":"43622460","title":"PassportJS's serializeUser not setting session","body":"\u003cp\u003e** I just discovered that this works on Heroku, but not on my local machine **\u003c/p\u003e\n\n\u003cp\u003eAfter the user goes through the signup process I call authenticate, which is supposed to call login by default, but I put an extra call to login for good measure to set the session, and still the session isn't storing the \u003ccode\u003eserializeUser\u003c/code\u003e contents of \u003ccode\u003e_id\u003c/code\u003e. The end goal is to call \u003ccode\u003ereq.user\u003c/code\u003e to get the currently logged in user, but nothing is returned.\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003cp\u003eI'm running my Angular2 app on \u003ccode\u003elocalhost:4200\u003c/code\u003e, NodeJS server on \u003ccode\u003elocalhost:8080\u003c/code\u003e, and my redis server from port \u003ccode\u003e6379\u003c/code\u003e.\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eThe user id to user vice versa in \u003ccode\u003eserializeUser\u003c/code\u003e and \u003ccode\u003edeserializeUser\u003c/code\u003e is correct.\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eMy \u003ccode\u003eserializeUser\u003c/code\u003e function is called, but my \u003ccode\u003edeserializeUser\u003c/code\u003e function isn't.\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eMy redis server does work and is receiving session strings, but they are formatted incorrectly like below.\u003c/p\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eHere's my session, it's missing the \u003ccode\u003e_id\u003c/code\u003e (user id) data.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\"data\":{\"cookie\":{\"originalMaxAge\":300000,\"expires\":\"2017-04-25T22:43:32.605Z\",\"secure\":false,\"httpOnly\":true,\"path\":\"/\"}}}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eserver.js\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e...\nconst passport = require(\"passport\");\nconst LocalStrategy = require(\"passport-local\").Strategy;\nconst session = require(\"express-session\");\nvar RedisStore = require(\"connect-redis\")(session);\n\napp.use(function(req, res, next){\n res.header(\"Access-Control-Allow-Origin\", \"*\");\n res.header(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept\");\n res.header('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, PATCH, DELETE');\n res.header('Access-Control-Allow-Credentials', \"true\");\n next();\n});\n\nvar options = {\n \"port\": nconf.get(\"redis:urlPort\"),\n \"host\": nconf.get(\"redis:urlURI\")\n};\n\napp.use(session({\n store: new RedisStore(options),\n cookie: {\n secure: false,\n maxAge: 300000\n },\n secret: 'starbucks-sucks',\n resave: true, \n saveUninitialized: true \n}));\n\napp.use(passport.initialize());\napp.use(passport.session());\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eserver.js: serializeUser \u0026amp; deserializeUser\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epassport.serializeUser(function(user, done) {\n done(null, user._id);\n});\n\npassport.deserializeUser(function(user_id, done) {\n db.collection(USERS_COLLECTION).findOne({_id: new ObjectID(user_id) }, function(err, doc){\n if(err){\n handleError(res, err.message, \"Failed to get user\");\n } else{\n done(null, doc);\n }\n });\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eserver.js: other\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epassport.use(new LocalStrategy({\n usernameField: \"phone\",\n passwordField: \"auth_code\"\n},function(username, password, done) {\n db.collection(USERS_COLLECTION).findOne({\"phone\": username})\n .then(function(data){\n if(data.auth_code === password){ return done(null, data); }\n else{ done(null, false, {message: \"Verification code is incorrect.\"}); }\n }, function(err){\n done(err);\n });\n}));\n\napp.post(\"/login\", function(req, res, next) {\n passport.authenticate(\"local\", function (err, user, info) {\n if (err) { next(err); }\n if (!user){ next(err); }\n\n req.login(user, function(err){\n if(err){ return next(err); }\n res.status(200).json(user);\n });\n })(req, res, next);\n});\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-04-25 23:14:13.467 UTC","last_activity_date":"2017-04-26 03:07:17.7 UTC","last_edit_date":"2017-04-26 03:07:17.7 UTC","last_editor_display_name":"","last_editor_user_id":"924814","owner_display_name":"","owner_user_id":"924814","post_type_id":"1","score":"0","tags":"node.js|session|redis|passport.js|passport-local","view_count":"38"} +{"id":"24756748","title":"how to parse JSON data with the HTTP post method in android?","body":"\u003cp\u003eI want to parse JSON data as a string parameter to the web service. \u003c/p\u003e\n\n\u003cp\u003eMy class is mentioned below.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@Override\nprotected String doInBackground(String... params) {\n // TODO Auto-generated method stub\n HttpClient httpclient = new DefaultHttpClient();\n //URL url = new URL(\"http://192.168.1.44:8080/api/BeVoPOSAPI/checklogin?nodeid=2\");\n //Log.d(\"shankar: \", ip+\":\"+port+\"/\"+node);\n //String url = \"http://\"+ip+\":\"+port+\"/api/BeVoPOSAPI/checklogin?nodeid=\"+node+\"\u0026amp;login=\";\n //String url = \"http://\"+ip+\":\"+port+\"/api/BeVoPOSAPI/checklogin?nodeid=\"+node+\"\u0026amp;login=\";\n //String url = \"http://192.168.1.60:8081/api/BeVoPOSAPI/checklogin?nodeid=2\u0026amp;login=\";\n String url = \"http://ipa.azurewebsites.net/pos/savecheck?nodeid=2\u0026amp;checkxml=\";\n try {\n // Add your data\n String checkxml = new String(params[0]);\n ;\n url = url.concat(checkxml);\n Log.d(\"password\", checkxml);\n //HttpPost httppost = new HttpPost(url);\n\n //HttpParams httpParameters = new BasicHttpParams();\n //HttpConnectionParams.setConnectionTimeout(httpParameters, 1000);\n //HttpConnectionParams.setSoTimeout(httpParameters, 1000);\n\n //HttpClient httpClient = new DefaultHttpClient(httpParameters);\n //HttpContext localContext = new BasicHttpContext();\n\n HttpPost httpget = new HttpPost(url);\n HttpParams httpParameters = new BasicHttpParams();\n // Set the timeout in milliseconds until a connection is established.\n // The default value is zero, that means the timeout is not used.\n int timeoutConnection = 300;\n HttpConnectionParams.setConnectionTimeout(httpParameters, timeoutConnection);\n // Set the default socket timeout (SO_TIMEOUT)\n // in milliseconds which is the timeout for waiting for data.\n int timeoutSocket = 500;\n HttpConnectionParams.setSoTimeout(httpParameters, timeoutSocket);\n /*List\u0026lt;NameValuePair\u0026gt; nameValuePairs = new ArrayList\u0026lt;NameValuePair\u0026gt;(1);\n Log.d(\"password\", password_check);\n nameValuePairs.add(new BasicNameValuePair(\"login\", password_check));\n httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));*/\n // Execute HTTP Post Request\n DefaultHttpClient httpClient = new DefaultHttpClient(httpParameters);\n httpClient.setParams(httpParameters);\n HttpResponse response = httpclient.execute(httpget);\n Log.d(\"Status\", response.toString());\n int responseCode = response.getStatusLine().getStatusCode();\n String str = Integer.toString(responseCode);\n Log.d(\"Responce code\", str);\n switch (responseCode) {\n case 200:\n HttpEntity entity = response.getEntity();\n if (entity != null) {\n String responseBody = EntityUtils.toString(entity);\n Log.d(\"Responce\", responseBody.toString());\n String jsonString = responseBody.toString();\n\n }\n break;\n }\n } catch (SocketTimeoutException e) {\n error = \"SocketTimeoutException\";\n } catch (ConnectTimeoutException e) {\n error = \"connectionTimeoutException\";\n } catch (ClientProtocolException e) {\n // TODO Auto-generated catch block\n //Log.d(\"Error\", e.toString());\n error = \"ClientProtocolException\";\n } catch (IOException e) {\n // TODO Auto-generated catch block\n //Log.d(\"Error\", e.toString());\n error = \"IOException\";\n }\n return null;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI parsed the checkxml string from another method.\u003c/p\u003e\n\n\u003cp\u003eThe checkxml consists of the details below as a string.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e {\n \"layoutid\": 1,\n \"total\": \"2.95\",\n \"checkdiscountpercentage\": 0,\n \"gratuityid\": \"\",\n \"status\": 141,\n \"checkdiscountshiftlevelid\": \"\",\n \"checktimeeventid\": \"\",\n \"isprintonbill\": \"\",\n \"userid\": 1,\n \"gratuitypercentage\": \"\",\n \"checkdiscountreason\": \"\",\n \"ordertype\": 210,\n \"noofcustomer\": 1,\n \"generatedon\": \"\",\n \"istaxexcemt\": 0,\n \"checkdefinitiontype\": \"\",\n \"tableid\": 1,\n \"customerid\": 0,\n \"ticket\": \"new\",\n \"checkdiscountamount\": \"0\",\n \"tablename\": 100,\n \"checkdiscountistaxadjust\": \"1\",\n \"checkdiscounttax\": \"0\",\n \"products\": [\n {\n \"menuitemname\": \"2\",\n \"menuitemid\": 1,\n \"reason\": \"\",\n \"discountpercentage\": 0,\n \"seatid\": 1,\n \"timeeventid\": \"\",\n \"SaleDetailsMenuItem_ID\": \"2\",\n \"istaxexcemt\": \"2\",\n \"taxamount\": \"0.2100\",\n \"discounttax\": \"0\",\n \"definitiontype\": \"\",\n \"modifiers\": [\n {}\n ],\n \"discountamount\": \"0\",\n \"istaxinclude\": \"2\",\n \"seatname\": \"\",\n \"shiftlevelid\": \"2\",\n \"discountshiftlevelid\": \"\",\n \"discountreason\": \"\",\n \"status\": \"2\",\n \"coursingid\": \"\",\n \"qty\": 2,\n \"ordertype\": \"\",\n \"taxpercent\": \"2\",\n \"taxids\": [\n {\n \"taxpercent\": \"7\",\n \"Amount\": \"0.21\",\n \"taxid\": \"1\"\n }\n ],\n \"holdtime\": 0,\n \"price\": 2.95,\n \"discountistaxadjust\": 1,\n \"price2\": 3\n }\n ]\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt threw an \u003ccode\u003eillegal argument\u003c/code\u003e and \u003ccode\u003ethread pool exception\u003c/code\u003e. Please let me know how to parse this data as a parameter to the above url.\u003c/p\u003e","accepted_answer_id":"24756954","answer_count":"2","comment_count":"4","creation_date":"2014-07-15 11:14:17.667 UTC","favorite_count":"2","last_activity_date":"2015-05-09 10:26:50.693 UTC","last_edit_date":"2015-05-09 10:26:50.693 UTC","last_editor_display_name":"user3787700","last_editor_user_id":"325479","owner_display_name":"","owner_user_id":"2512822","post_type_id":"1","score":"1","tags":"java|android|json|http|httprequest","view_count":"7012"} +{"id":"39529166","title":"$setValidity is not working for my validation","body":"\u003cp\u003eI have a form called ganesConfig and based on some condition i want to show the error message.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;form method=\"post\" name=\"gamesConfig\" novalidate\u0026gt;\n \u0026lt;p ng-show=\"gamesConfig.selectedGames.$invalid.gamesduplicate\"\u0026gt;Already Exists. Please try another\u0026lt;/p\u0026gt;\n\u0026lt;/form\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethe condition is as follows\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$scope.gamesConfig.selectedGames.$setValidity(\"gamesduplicate\", false);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut not showing the error message.\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2016-09-16 10:25:27.927 UTC","last_activity_date":"2016-09-16 14:12:01.183 UTC","last_edit_date":"2016-09-16 10:49:55.087 UTC","last_editor_display_name":"","last_editor_user_id":"5471522","owner_display_name":"","owner_user_id":"5471522","post_type_id":"1","score":"0","tags":"angularjs","view_count":"354"} +{"id":"47106087","title":"Bokeh simple bar chart","body":"\u003cp\u003eI'm new to the method. I created the following input, but it gives me an empty output. What did I miss? Thank you.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport pandas as pd\nfrom bokeh.charts import Bar\nimport pandas as pd\nfrom bokeh.plotting import figure, output_file, show\nmortality_age = pd.read_csv(\"mortality_by_age.csv\")\nx=mortality_age[\"Age Range\"]\ny=mortality_age[\"Deaths per 100,000 Live Births:\"]\nplot = figure(title=\"Example of a vertical bar chart\")\nplot.vbar(x, top=y, width=0.5,color=\"#CAB2D6\")\noutput_file(\"vertical_bar.html\", mode=\"inline\")\nshow(plot)\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-11-04 00:21:35.757 UTC","last_activity_date":"2017-11-05 09:06:22.44 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"8678766","post_type_id":"1","score":"0","tags":"bokeh","view_count":"35"} +{"id":"12424346","title":"Make a bouncing ListView in Android","body":"\u003cp\u003eI'm trying to make my listview \"bounce\". To explain myself, I want the ListView to have the same behavior as the iOs List View object. On the top and on the bottom of the list, the user can go over the list by swiping his finger.\u003c/p\u003e\n\n\u003cp\u003eThat behavior existed on Android 2.2 Samsung devices (Galaxy Tab GT1000 for instance).\u003c/p\u003e\n\n\u003cp\u003eOn the most devices I tested, the list is now acting different on scrolling, it displays a blue line that gets brighter when you swipe your finger moreover.\u003c/p\u003e\n\n\u003cp\u003eI found the BounceListView like this one :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class BounceListView extends ListView\n{\n private static final int MAX_Y_OVERSCROLL_DISTANCE = 200;\n\n private Context mContext;\n private int mMaxYOverscrollDistance;\n\n public BounceListView(Context context) \n {\n super(context);\n mContext = context;\n initBounceListView();\n }\n\n public BounceListView(Context context, AttributeSet attrs) \n {\n super(context, attrs);\n mContext = context;\n initBounceListView();\n }\n\n public BounceListView(Context context, AttributeSet attrs, int defStyle) \n {\n super(context, attrs, defStyle);\n mContext = context;\n initBounceListView();\n }\n\n private void initBounceListView()\n {\n //get the density of the screen and do some maths with it on the max overscroll distance\n //variable so that you get similar behaviors no matter what the screen size\n\n final DisplayMetrics metrics = mContext.getResources().getDisplayMetrics();\n final float density = metrics.density;\n\n mMaxYOverscrollDistance = (int) (density * MAX_Y_OVERSCROLL_DISTANCE);\n }\n\n @Override\n protected boolean overScrollBy(int deltaX, int deltaY, int scrollX, int scrollY, int scrollRangeX, int scrollRangeY, int maxOverScrollX, int maxOverScrollY, boolean isTouchEvent) \n { \n //This is where the magic happens, we have replaced the incoming maxOverScrollY with our own custom variable mMaxYOverscrollDistance; \n return super.overScrollBy(deltaX, deltaY, scrollX, scrollY, scrollRangeX, scrollRangeY, maxOverScrollX, mMaxYOverscrollDistance, isTouchEvent); \n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut the problem of this ListView is that it doesn't go back to the first or to the last item after a scroll over the list... It stays on a position where list is not filled.\u003c/p\u003e\n\n\u003cp\u003eAnyone got an idea to make it work ?\u003c/p\u003e\n\n\u003cp\u003eThanks in advance!\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2012-09-14 12:13:42.843 UTC","favorite_count":"2","last_activity_date":"2014-05-06 09:36:06.443 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"969881","post_type_id":"1","score":"4","tags":"android|listview","view_count":"6485"} +{"id":"5011750","title":"Detect if USTREAM is broadcasting (on-air)","body":"\u003cp\u003eWhat is the best way to detect if a broadcast is live coming from USTREAM? I've got a church site that uses USTREAM and they would like to have the embeded player show up when the broadcast is live and disappear when the broadcast is off-air. \u003c/p\u003e\n\n\u003cp\u003eIs this possible with ColdFusion or some kind of javascript/ajax?\u003c/p\u003e","accepted_answer_id":"5011769","answer_count":"2","comment_count":"0","creation_date":"2011-02-16 01:57:17.493 UTC","last_activity_date":"2012-09-17 23:02:20.72 UTC","last_edit_date":"2011-02-27 21:01:11.457 UTC","last_editor_display_name":"","last_editor_user_id":"49246","owner_display_name":"","owner_user_id":"370415","post_type_id":"1","score":"1","tags":"ajax|coldfusion|video-streaming|embedded-video","view_count":"1583"} +{"id":"35918627","title":"SQL - SELECT DISTINCT user, when they match COLUMN1 VALUEA but do NOT have COLUMN1 VALUEB","body":"\u003cp\u003eI have the following table; \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e user | column2 |\n--------+------------+\n tom | Created |\n test | Created |\n fred | Removed |\n tom | Removed |\n fred | Created |\n holly | Created |\n test | Modified |\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am looking to query the table to return users who have CREATED and no users who also have a REMOVED value. Also, users with MODIFIED can appear but not the row with their MODIFIED value. \u003c/p\u003e\n\n\u003cp\u003eResult should be:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e user | column2 |\n-------+------------+\n test | Created |\n Holly | Created |\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have only been using WHERE clauses, is there another way to achieve this?\u003c/p\u003e\n\n\u003cp\u003eReally appreciate any advice given\u003c/p\u003e","accepted_answer_id":"35918679","answer_count":"3","comment_count":"0","creation_date":"2016-03-10 14:02:07.707 UTC","last_activity_date":"2016-03-10 15:02:55.217 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5409483","post_type_id":"1","score":"-1","tags":"sql|sql-server","view_count":"39"} +{"id":"16410676","title":"what's the difference between javascript PACKED and PACKER","body":"\u003cp\u003eI found two difference way to pack javascript file, there's packed and packer.\nthe encode js file after packed looks like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eeval(function(p,a,c,k,e,d){..});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eeval(function(p,a,c,k,e,r){...});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhat is the difference of two kinds?\nI know the way to pack in second type (packer), but don't know how to pack in first way (packed)\nanyone can help me?\u003c/p\u003e","answer_count":"0","comment_count":"6","creation_date":"2013-05-07 03:21:03.017 UTC","last_activity_date":"2013-05-07 03:21:03.017 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2231331","post_type_id":"1","score":"0","tags":"javascript|compression|decompression|packed","view_count":"702"} +{"id":"38838604","title":"Ordering Searchkick's search result by act_as_votable vote score","body":"\u003cp\u003eI'm using act as votable for voting on my rails app and searchkick for search. But i want searchkick's search results to be order by vote score. I really need guys, please anybody? Here is what I have at the moment. And it's not working\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef search\n\n if params[:search].present?\n @peegins = Peegin.search(params[:search]).order(:cached_votes_score =\u0026gt; :desc)\n\n else\n redirect_to peegins_path\nend\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"38855403","answer_count":"1","comment_count":"0","creation_date":"2016-08-08 21:12:17.817 UTC","last_activity_date":"2016-08-09 15:54:52.83 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3871657","post_type_id":"1","score":"0","tags":"ruby-on-rails|ruby|elasticsearch|searchkick|vote","view_count":"51"} +{"id":"27368459","title":"using a dynamic vector as an index value in for loop in Matlab","body":"\u003cpre\u003e\u003ccode\u003ea=1:5\nfor k=a\n if k\u0026lt;3\n a=[a k+5];\n end\ndisp(k)\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I run this code, I get these results:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e1\n2\n3\n4\n5\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ek uses only the initial vector when it enters to the loop. I want it to update the values of a and take the new values of a too.\nThus, my question is how do I get this result:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e1\n2\n3\n4\n5\n6\n7\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"27368531","answer_count":"2","comment_count":"1","creation_date":"2014-12-08 22:49:36.037 UTC","last_activity_date":"2014-12-09 06:48:34.147 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4339240","post_type_id":"1","score":"2","tags":"matlab|loops|for-loop|dynamic|vector","view_count":"47"} +{"id":"30132874","title":"Can't connect to host, but the URL works fine in actual web browser","body":"\u003cp\u003eI'm behind a VPN. And I think whoever administers it must have done some weird change lately because suddenly my script doesn't work. \u003c/p\u003e\n\n\u003cp\u003eIt's not terribly important to know what the below is doing, basically logging into SFDC so that I can later download a CSV.. \u003c/p\u003e\n\n\u003cp\u003eThe point is that if I were to simply plop in the url string (\u003ca href=\"https://login.salesforce.com/?un=username@domain.com\u0026amp;pw=password\" rel=\"nofollow\"\u003ehttps://login.salesforce.com/?un=username@domain.com\u0026amp;pw=password\u003c/a\u003e) into my web browser, it will work no problem. So why, with the EXACT same URL, is R unable to connect to host?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elibrary(RCurl)\n\nagent=\"Firefox/23.0\" \n\noptions(RCurlOptions = list(cainfo = system.file(\"CurlSSL\", \"cacert.pem\", package = \"RCurl\")))\ncurl = getCurlHandle()\n\ncurlSetOpt(\n cookiejar = 'cookies.txt' ,\n useragent = agent,\n followlocation = TRUE ,\n autoreferer = TRUE ,\n curl = curl\n)\nun=\"username@domain.com\"\npw=\"password\"\n\nhtml = postForm(paste(\"https://login.salesforce.com/?un=\", un, \"\u0026amp;pw=\", pw, sep=\"\"), curl=curl)\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"30354267","answer_count":"1","comment_count":"5","creation_date":"2015-05-08 21:08:32.91 UTC","last_activity_date":"2015-05-20 15:36:39.683 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3562196","post_type_id":"1","score":"0","tags":"r","view_count":"629"} +{"id":"25824123","title":"Robust comparison of positive/negative numbers value by a threshold value","body":"\u003cp\u003eI would like to calculate whether a variable \u003ccode\u003eaverage\u003c/code\u003e differs from another variable \u003ccode\u003etrackingAmount\u003c/code\u003e by a certain \u003ccode\u003ethreshold\u003c/code\u003e either positively(+) or negatively (-).\u003c/p\u003e\n\n\u003ch2\u003eThese are the constraints:\u003c/h2\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003cp\u003eIf the difference (+/-) between \u003ccode\u003eaverage\u003c/code\u003e and \u003ccode\u003etrackingAmount\u003c/code\u003e exceeds the\n\u003ccode\u003ethreshold\u003c/code\u003e value then I would like to trigger a function\n\u003ccode\u003ecalcMultiTrack()\u003c/code\u003e\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eThreshold value in the example is called \u003ccode\u003etrackTolerance\u003c/code\u003e\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003e\u003ccode\u003eaverage\u003c/code\u003e can be positive or negative, same goes for \u003ccode\u003etrackingAmount\u003c/code\u003e\u003c/p\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eWhat is the most robust, \u003cem\u003e(maybe \u003cstrong\u003eelegant\u003c/strong\u003e is a better word here)\u003c/em\u003e, way\n to handle such cases?\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003ch2\u003eThis is what I do so far.\u003c/h2\u003e\n\n\u003cpre\u003e\u003ccode\u003e average = average / (selItemsDimArray.length - 1); \n var trackingAmount = 3 \n var trackTolerance = 0.2 \n\n //If number is positive \n if (average \u0026gt;= 0) {\n if (average \u0026lt; (trackingAmount - trackTolerance) || average \u0026gt; (trackingAmount + trackTolerance)) {\n calcMultiTrack(); //This is the function I want to call if the numbers are not the same(threshold value applies)\n console.log(\"Positive average that differs with trackingAmount by more than +- tolerance\");\n }\n }\n //Else number is negative\n else {\n if (average \u0026lt; (-(trackingAmount - trackTolerance)) || average \u0026gt; (-(trackingAmount + trackTolerance))) {\n calcMultiTrack();\n console.log(\"Negative average that differs with trackingAmount by more than +- tolerance\");\n }\n }\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"25824142","answer_count":"2","comment_count":"0","creation_date":"2014-09-13 14:21:20.7 UTC","favorite_count":"1","last_activity_date":"2014-09-15 06:09:22.687 UTC","last_edit_date":"2014-09-15 06:09:22.687 UTC","last_editor_display_name":"","last_editor_user_id":"1814486","owner_display_name":"","owner_user_id":"1814486","post_type_id":"1","score":"2","tags":"javascript|coding-style","view_count":"283"} +{"id":"28581204","title":"Only first function in header works but the last two don't in c","body":"\u003cp\u003eI made this header for some program functions:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#ifndef STRING_H_INCLUDED\n#define STRING_H_INCLUDED\n\n#include \u0026lt;stdio.h\u0026gt;\n\nint s_length(char *test_string){ //returns string length\n int i=0;\n while(*test_string){\n i++;\n test_string++;\n }\n return i;\n};\n\nvoid s_insert(char *string_one){ //inserts string\n scanf(\"%s\",string_one);\n};\n\nvoid s_output(char *string_one){ //outputs string\n printf(\"%s\",string_one);\n};\n\n#endif\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand I call the functions in the c file like 2 times each. But the last 2 of them get this: \u003ccode\u003ewarning: implicit declaration of function ‘s_insert’\u003c/code\u003e and \u003ccode\u003eundefined reference to 's_insert'\u003c/code\u003e. for both functions.\u003c/p\u003e\n\n\u003cp\u003eWhat does this mean, and what did I do wrong?\u003c/p\u003e\n\n\u003cp\u003eIt might have to do with the main c file in which I call the functions.\u003c/p\u003e\n\n\u003cp\u003emain progam:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;stdio.h\u0026gt;\n#include \u0026lt;stdlib.h\u0026gt;\n#include \"string.h\"\n\nchar *name,*surname;\n\n\nvoid menu(){\n int choise;\n do{\n printf(\"1: incerici dati\\n\");\n printf(\"2: output dati\\n\");\n printf(\"3: calcola lungezza\\n\");\n printf(\"0: ecsi\\n\");\n printf(\"incerici: \");\n scanf(\"%d\", \u0026amp;choise);\n printf(\"------------------\\n\");\n switch(choise){\n case 1:\n printf(\"String 1:\");\n s_insert(name);\n printf(\"String 2:\");\n s_insert(surname);\n printf(\"------------------\\n\");\n break;\n case 2:\n s_output(name);\n s_output(surname);\n printf(\"------------------\\n\");\n break;\n case 3:\n printf(\"string 1: %s lungezza: %d \\n\",name,s_length(name));\n printf(\"string 2: %s lungezza: %d \\n\",surname,s_length(surname));\n printf(\"------------------\\n\");\n break;\n case 0:\n printf(\"prgram closed!!\\n\");\n break;\n default:\n printf(\"Errore: %d schelta invalida\\n\",choise);\n break;\n }\n }while(choise);\n};\n\nint main(int argc, char *argv[]){\n name=malloc(sizeof(char)*20);\n surname=malloc(sizeof(char)*30);\n menu();\n return 0;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eps fot the people wondering, the printed text is italian because it's a school exercice.\u003c/p\u003e","accepted_answer_id":"28581640","answer_count":"2","comment_count":"16","creation_date":"2015-02-18 10:25:15.763 UTC","last_activity_date":"2015-02-18 11:14:34.667 UTC","last_edit_date":"2015-02-18 10:54:59.03 UTC","last_editor_display_name":"","last_editor_user_id":"4454435","owner_display_name":"","owner_user_id":"4454435","post_type_id":"1","score":"1","tags":"c","view_count":"88"} +{"id":"30789826","title":"CategoryItemField - How to get a list of option id's and text values","body":"\u003cp\u003eI am trying to create a new entry into podio via the API I can set text type fields and date type fields but I cannot seem to sort out how to set a category type field. The example for .NET shows setting the OptionId = x where x is a int value of the category field. But what if I do not know that Id value. I have a string value from my DB that matches the text value found in the category (dropdown style) field but not sure I can use that to set it?\u003c/p\u003e\n\n\u003cp\u003eThis example doesn't work b/c it has no values in option.\u003c/p\u003e\n\n\u003cp\u003evar typeCategory_ModuleStr = podioNewItem.Field(\"module\");\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e IEnumerable\u0026lt;CategoryItemField.Option\u0026gt; categories = typeCategory_ModuleStr.Options;\n List\u0026lt;CategoryItemField.Option\u0026gt; moduleOptions = categories.ToList();\n foreach (CategoryItemField.Option option in moduleOptions)\n {\n if (option.Text == tableRow[\"MODULE\"].ToString())\n {\n typeCategory_ModuleStr.OptionId = Convert.ToInt32(option.Id);\n }\n\n }\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"1","creation_date":"2015-06-11 19:31:18.09 UTC","last_activity_date":"2017-01-06 07:14:08.347 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4854841","post_type_id":"1","score":"0","tags":"c#|.net|podio","view_count":"110"} +{"id":"10449533","title":"C RS232 comm. How to compare CPU time?","body":"\u003cp\u003eFirst time posting so there's probably gonna be more info than necessary but I wanna be thorough:\u003c/p\u003e\n\n\u003cp\u003eOne of our exercises in C was to create sender and receiver programs that would exchange data via RS232 serial communication with null modem. We used a virtual port program (I used the trial version of Virtual Serial Port by eltima software if you want to test). We were required to do 4 versions:\u003c/p\u003e\n\n\u003cp\u003e1) Using a predetermined library created by a previous student that had sender and reveiver etc. premade functions\n2) Using the inportb and outportb functions\n3) Using OS interrupt int86 and giving register values through the REGS union\n4) Using inline assembly\u003c/p\u003e\n\n\u003cp\u003eCompiler: DevCPP (Bloodshed).\u003c/p\u003e\n\n\u003cp\u003eAll worked, but now we are required to compare all the different versions based on the CPU time that is spent to send and receive a character. It specifically says that we have to find the following:\u003c/p\u003e\n\n\u003cp\u003eaverage, standard deviation, min, max and 99,5 %\u003c/p\u003e\n\n\u003cp\u003eNothing was explained in class so I'm a little lost here...I'm guessing those are statistical numbers after many trials of the normal distribution? But even then how do I actually measure CPU cycles on this? I'll keep searching but I'm posting here in the mean time 'cause the deadline is in 3 days :D.\u003c/p\u003e\n\n\u003cp\u003eCode sample of the int86 version:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;stdio.h\u0026gt;\n#include \u0026lt;stdlib.h\u0026gt;\n#include \u0026lt;dos.h\u0026gt;\n\n#define RS232_INIT_FUNCTION 0\n#define RS232_SEND_FUNCTION 1\n#define RS232_GET_FUNCTION 2\n#define RS232_STATUS_FUNCTION 3\n#define DATA_READY 0x01\n\n#define PARAM 0xEF\n#define COM1 0\n#define COM2 1\n\n\nvoid rs232init (int port, unsigned init_code)\n{\n union REGS inregs;\n inregs.x.dx=port;\n inregs.h.ah=RS232_INIT_FUNCTION;\n inregs.h.al=init_code;\n int86(0x14,\u0026amp;inregs,\u0026amp;inregs);\n}\n\nunsigned char rs232transmit (int port, char ch)\n{\n union REGS inregs;\n inregs.x.dx=port;\n inregs.h.ah=RS232_SEND_FUNCTION;\n inregs.h.al=ch;\n int86(0x14,\u0026amp;inregs,\u0026amp;inregs);\n return (inregs.h.ah);\n}\n\nunsigned char rs232status(int port){\n union REGS inregs;\n inregs.x.dx=port;\n inregs.h.ah=RS232_STATUS_FUNCTION;\n int86(0x14, \u0026amp;inregs, \u0026amp;inregs);\n return (inregs.h.ah); //Because we want the second byte of ax\n }\n\nunsigned char rs232receive(int port)\n{\n int x,a;\n union REGS inregs;\n while(!(rs232status(port) \u0026amp; DATA_READY))\n {\n if(kbhit()){\n getch();\n exit(1); \n }\n };\n inregs.x.dx=port;\n inregs.h.ah=RS232_GET_FUNCTION;\n int86(0x14,\u0026amp;inregs,\u0026amp;inregs);\n if(inregs.h.ah \u0026amp; 0x80)\n {\n printf(\"ERROR\");\n return -1;\n }\n return (inregs.h.al);\n}\n\nint main(){\n unsigned char ch;\n int d,e,i;\n\n do{\n puts(\"What would you like to do?\");\n puts(\"1.Send data\");\n puts(\"2.Receive data\");\n puts(\"0.Exit\");\n scanf(\"%d\",\u0026amp;i);\n getchar();\n\n if(i==1){\n rs232init(COM1, PARAM);\n\n puts(\"Which char would you like to send?\");\n scanf(\"%c\",\u0026amp;ch);\n getchar();\n while(!rs232status(COM1));\n d=rs232transmit(COM1,ch);\n if(d \u0026amp; 0x80) puts(\"ERROR\"); //Checks the bit 7 of ah for error\n }\n else if(i==2){\n rs232init(COM1,PARAM);\n puts(\"Receiving character...\");\n ch=rs232receive(COM1);\n printf(\"%c\\n\",ch);\n }\n }while(i != 0);\n\n system(\"pause\");\n return 0;\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"2","creation_date":"2012-05-04 13:12:28.173 UTC","last_activity_date":"2012-05-06 11:05:04.473 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1374987","post_type_id":"1","score":"0","tags":"c|time|serial-port|cpu","view_count":"332"} +{"id":"9339203","title":"Using ant build for my web project","body":"\u003cp\u003eI have my personal website and it is almost static with only a few instances of dynamic server-side code. Is it a good idea to build my project using Ant script? If yes, how to do it on an windows environment?\nWhile reading \u003ca href=\"https://github.com/h5bp/ant-build-script/wiki\" rel=\"nofollow\"\u003eHtml5BolilerPlate related build script\u003c/a\u003e,I thought to migrate on H5BP and use their script. Is that advisable?\u003c/p\u003e","accepted_answer_id":"9339922","answer_count":"1","comment_count":"1","creation_date":"2012-02-18 06:31:34.24 UTC","last_activity_date":"2012-02-18 08:56:36.427 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"682064","post_type_id":"1","score":"1","tags":"ant|web|html5boilerplate","view_count":"194"} +{"id":"26237216","title":"PostgreSql: cannot use aggregate function in UPDATE","body":"\u003cp\u003eI have an Oracle query that I ported to PostgreSql:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eUPDATE \"SPD_PG\".\"TT_SPLDR_11A2F324_29\" \nSET \"SECT_ORDER\" = MAX(\"SECTIONS\".\"SECT_ORDER\")+1 FROM \"SPD_PG\".\"SECTIONS\"\nINNER JOIN \"SPD_PG\".\"META_SECTIONS\" ON (\"SECTIONS\".\"META_SECT_ID\"=\"META_SECTIONS\".\"META_SECT_ID\")\nWHERE (\"META_SECTIONS\".\"META_SECT_ORDER\"=\"TT_SPLDR_11A2F324_29\".\"META_SECT_ORDER\"-1)\nAND (\"SECTIONS\".\"DOC_ID\"=\"TT_SPLDR_11A2F324_29\".\"DOC_ID\")\nAND (\"TT_SPLDR_11A2F324_29\".\"META_SECT_ORDER\"\u0026gt;0)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis give me: \u003ccode\u003eERROR: cannot use aggregate function in UPDATE\u003c/code\u003e, seems PostgreSql doesn't support \u003ccode\u003eMAX\u003c/code\u003e in Update statements.\u003c/p\u003e\n\n\u003cp\u003eHowever if I rewrite the query as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eUPDATE \"SPD_PG\".\"TT_SPLDR_11A2F324_29\" \nSET \"SECT_ORDER\" = \"MAX_VALUE\" FROM (\n SELECT MAX(\"SECTIONS\".\"SECT_ORDER\")+1 AS \"MAX_VALUE\" FROM \"SPD_PG\".\"SECTIONS\"\n INNER JOIN \"SPD_PG\".\"META_SECTIONS\" ON (\"SECTIONS\".\"META_SECT_ID\"=\"META_SECTIONS\".\"META_SECT_ID\")\n WHERE (\"META_SECTIONS\".\"META_SECT_ORDER\"=\"TT_SPLDR_11A2F324_29\".\"META_SECT_ORDER\"-1)\n AND (\"SECTIONS\".\"DOC_ID\"=\"TT_SPLDR_11A2F324_29\".\"DOC_ID\")\n AND (\"TT_SPLDR_11A2F324_29\".\"META_SECT_ORDER\"\u0026gt;0)\n) \"TBL_ALIAS\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eit says \u003ccode\u003eERROR: subquery in FROM cannot refer to other relations of same query level\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eSo I can't figure out how to write this query.\u003c/p\u003e","accepted_answer_id":"26237336","answer_count":"1","comment_count":"2","creation_date":"2014-10-07 13:30:08.393 UTC","last_activity_date":"2014-10-07 13:36:44.49 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1409881","post_type_id":"1","score":"1","tags":"postgresql|sql-update|aggregate-functions","view_count":"2489"} +{"id":"24980357","title":"Kendo Grid edit popup complex model submitting","body":"\u003cp\u003eI’m trying to use complex models with Kendo grid edit popup. When submitting ALResults object properties are always null. It works fine when I’m not using Kendo. Is there a problem with kendo complex model submitting?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class InitialApplicantLevel2Model\n {\n public InitialApplicantLevel2Model()\n {\n\n alResultsModel = new ALResults();\n }\n\n public int InitialApplicantLevel2ID { get; set; }\n public string ApplicantName { get; set; }\n public string ContactNumber { get; set; }\n public string School { get; set; }\n\n [Required(ErrorMessage=\"Ref No. required.\")]\n public int? EnquiryID { get; set; }\n\n\n\n public ALResults alResultsModel { get; set; }\n\n\n\n\n }\n\npublic class ALResults\n {\n public int ResultsID { get; set; }\n public int InitialApplicantLevel2ID { get; set; }\n public string Stream { get; set; }\n public string Grading { get; set; }\n public string IndexNo { get; set; }\n public int? Year { get; set; }\n public int? Attempt { get; set; }\n public double? ZScore { get; set; }\n public string Medium { get; set; }\n }\n\n\n\n@model SIMS.Models.StudentIntake.InitialApplicantLevel2Model \n\u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;Year: \u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;@Html.TextBoxFor(o=\u0026gt;o.alResultsModel.Year)\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;Index No: \u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;@Html.TextBoxFor(o=\u0026gt;o.alResultsModel.IndexNo)\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;Medium: \u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;@Html.TextBoxFor(o=\u0026gt;o.alResultsModel.Medium)\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;Stream: \u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;@Html.TextBoxFor(o=\u0026gt;o.alResultsModel.Stream)\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;Attempt: \u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;@Html.TextBoxFor(o=\u0026gt;o.alResultsModel.Attempt)\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;Zscore: \u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\n @Html.TextBoxFor(o=\u0026gt;o.alResultsModel.ZScore)\n\n \u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/3T0e8.jpg\" alt=\"enter image description here\"\u003e\u003c/p\u003e","accepted_answer_id":"24982531","answer_count":"1","comment_count":"0","creation_date":"2014-07-27 11:14:38.987 UTC","last_activity_date":"2014-07-27 15:40:13.78 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"367562","post_type_id":"1","score":"0","tags":"asp.net-mvc|kendo-ui|kendo-grid","view_count":"391"} +{"id":"35704209","title":"access wcf self service host using js","body":"\u003cp\u003eI created a wcf self service host \nI can access it , and see it's wsdl\nbut when trying to add the /js extension to the path I get 405 error.\nI cannot understand why, while doing the same with a asp.net web applicaton it worked ok.\u003c/p\u003e\n\n\u003cp\u003ewcf class :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enamespace A\n{\n\n [ServiceBehavior(IncludeExceptionDetailInFaults=true)]\n [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]\n public class Hello : IHello\n {\n\n public string SayHi()\n {\n return \"Hiush !\";\n }\n\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewcf interface:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enamespace A\n{\n\n [ServiceContract]\n public interface IHello\n\n {\n [OperationContract]\n string SayHi();\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewcf svc file:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;%@ ServiceHost Language=\"C#\" Debug=\"true\" Service=\"A.Hello\" %\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethe self service host:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enamespace SelfServiceHost\n{\n\n class Program\n {\n\n static void Main(string[] args)\n {\n using (ServiceHost helloHost = new ServiceHost(typeof(A.Hello)))\n {\n helloHost.Open();\n Console.WriteLine(\"HelloHost started @ \" + DateTime.Now);\n Console.ReadKey();\n } \n }\n\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eself service host app.config:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\"?\u0026gt;\n\u0026lt;configuration\u0026gt;\n \u0026lt;system.web\u0026gt;\n \u0026lt;compilation debug=\"true\"/\u0026gt;\n \u0026lt;/system.web\u0026gt;\n\n \u0026lt;!-- When deploying the service library project, the content of the config file must be added to the host's \n app.config file. System.Configuration does not support config files for libraries. --\u0026gt;\n \u0026lt;system.serviceModel\u0026gt;\n \u0026lt;bindings\u0026gt;\n \u0026lt;basicHttpBinding\u0026gt;\n \u0026lt;binding name=\"\" closeTimeout=\"00:01:00\"\n openTimeout=\"00:01:00\" receiveTimeout=\"00:10:00\" sendTimeout=\"00:01:00\"\n allowCookies=\"false\" bypassProxyOnLocal=\"true\" hostNameComparisonMode=\"StrongWildcard\"\n maxBufferSize=\"524288\" maxBufferPoolSize=\"524288\" maxReceivedMessageSize=\"524288\"\n messageEncoding=\"Text\" textEncoding=\"utf-8\" transferMode=\"Buffered\"\n useDefaultWebProxy=\"true\"\u0026gt;\n \u0026lt;readerQuotas maxDepth=\"32\" maxStringContentLength=\"524288\" maxArrayLength=\"16384\"\n maxBytesPerRead=\"4096\" maxNameTableCharCount=\"16384\" /\u0026gt;\n \u0026lt;!--\u0026lt;security mode=\"TransportCredentialOnly\"\u0026gt;\n \u0026lt;transport clientCredentialType=\"Windows\" proxyCredentialType=\"None\"\n realm=\"\" /\u0026gt;\n \u0026lt;message clientCredentialType=\"UserName\" algorithmSuite=\"Default\" /\u0026gt;\n \u0026lt;/security\u0026gt;--\u0026gt;\n \u0026lt;/binding\u0026gt;\n \u0026lt;/basicHttpBinding\u0026gt;\n \u0026lt;/bindings\u0026gt;\n \u0026lt;services\u0026gt;\n \u0026lt;service name=\"A.Hello\"\u0026gt;\n \u0026lt;endpoint address=\"PINCalc\" behaviorConfiguration=\"AAA\" \n binding=\"webHttpBinding\" contract=\"A.IHello\"\u0026gt;\n \u0026lt;!--\u0026lt;identity\u0026gt;\n \u0026lt;dns value=\"localhost\"/\u0026gt;\n \u0026lt;/identity\u0026gt;--\u0026gt;\n \u0026lt;/endpoint\u0026gt;\n \u0026lt;host\u0026gt;\n \u0026lt;baseAddresses\u0026gt;\n \u0026lt;add baseAddress=\"http://localhost:3020/Hello.svc\"/\u0026gt;\n \u0026lt;/baseAddresses\u0026gt;\n \u0026lt;/host\u0026gt;\n \u0026lt;!-- Service Endpoints --\u0026gt;\n \u0026lt;!-- Unless fully qualified, address is relative to base address supplied above --\u0026gt;\n \u0026lt;/service\u0026gt;\n \u0026lt;/services\u0026gt;\n \u0026lt;behaviors\u0026gt;\n \u0026lt;serviceBehaviors\u0026gt;\n \u0026lt;behavior\u0026gt;\n \u0026lt;serviceMetadata httpGetEnabled=\"True\"/\u0026gt;\n \u0026lt;serviceDebug includeExceptionDetailInFaults=\"True\"/\u0026gt;\n \u0026lt;/behavior\u0026gt;\n \u0026lt;/serviceBehaviors\u0026gt;\n \u0026lt;endpointBehaviors\u0026gt;\n \u0026lt;behavior name=\"AAA\"\u0026gt;\n \u0026lt;enableWebScript/\u0026gt;\n \u0026lt;/behavior\u0026gt;\n \u0026lt;/endpointBehaviors\u0026gt;\n \u0026lt;/behaviors\u0026gt;\n \u0026lt;serviceHostingEnvironment aspNetCompatibilityEnabled=\"true\" multipleSiteBindingsEnabled=\"true\"/\u0026gt;\n \u0026lt;/system.serviceModel\u0026gt; \n\u0026lt;startup\u0026gt;\u0026lt;supportedRuntime version=\"v4.0\" sku=\".NETFramework,Version=v4.0\"/\u0026gt;\u0026lt;/startup\u0026gt;\u0026lt;/configuration\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"4","creation_date":"2016-02-29 16:12:12.517 UTC","last_activity_date":"2016-02-29 16:19:41.65 UTC","last_edit_date":"2016-02-29 16:19:41.65 UTC","last_editor_display_name":"","last_editor_user_id":"2399775","owner_display_name":"","owner_user_id":"5967729","post_type_id":"1","score":"0","tags":"javascript|c#|asp.net|web-services|wcf","view_count":"52"} +{"id":"7642356","title":"How can i get a hash into an array, state and acronym?","body":"\u003cpre\u003e\u003ccode\u003eArray = [{:acronym =\u0026gt; \"AC\", :fullname =\u0026gt; \"Acre\"}, {:acronym =\u0026gt; \"AL\", :fullname =\u0026gt; \"Alagoas\"}, {:acronym =\u0026gt; \"AP\", :fullname =\u0026gt; \"Amapá\"}, {:acronym =\u0026gt; \"AM\", :fullname =\u0026gt; \"Amazonas\"}, {:acronym =\u0026gt; \"BA\", :fullname =\u0026gt; \"Bahia\"}, {:acronym =\u0026gt; \"CE\", :fullname =\u0026gt; \"Ceará\"}, {:acronym =\u0026gt; \"DF\", :fullname =\u0026gt; \"Distrito Federal\"}, {:acronym =\u0026gt; \"ES\", :fullname =\u0026gt; \"Espírito Santo\"}, {:acronym =\u0026gt; \"GO\", :fullname =\u0026gt; \"Goiás\"}, {:acronym =\u0026gt; \"MA\", :fullname =\u0026gt; \"Maranhão\"}, {:acronym =\u0026gt; \"MT\", :fullname =\u0026gt; \"Mato Grosso\"}, {:acronym =\u0026gt; \"MS\", :fullname =\u0026gt; \"Mato Grosso do Sul\"}, {:acronym =\u0026gt; \"MG\", :fullname =\u0026gt; \"Minas Gerais\"}, {:acronym =\u0026gt; \"PA\", :fullname =\u0026gt; \"Pará\"}, {:acronym =\u0026gt; \"PB\", :fullname =\u0026gt; \"Paraíba\"}, {:acronym =\u0026gt; \"PR\", :fullname =\u0026gt; \"Paraná\"}, {:acronym =\u0026gt; \"PE\", :fullname =\u0026gt; \"Pernambuco\"}, {:acronym =\u0026gt; \"PI\", :fullname =\u0026gt; \"Piauí\"}, {:acronym =\u0026gt; \"RR\", :fullname =\u0026gt; \"Roraima\"}, {:acronym =\u0026gt; \"RO\", :fullname =\u0026gt; \"Rondônia\"}, {:acronym =\u0026gt; \"RJ\", :fullname =\u0026gt; \"Rio de Janeiro\"}, {:acronym =\u0026gt; \"RN\", :fullname =\u0026gt; \"Rio Grande do Norte\"}, {:acronym =\u0026gt; \"RS\", :fullname =\u0026gt; \"Rio Grande do Sul\"}, {:acronym =\u0026gt; \"SC\", :fullname =\u0026gt; \"Santa Catarina\"}, {:acronym =\u0026gt; \"SP\", :fullname =\u0026gt; \"São Paulo\"}, {:acronym =\u0026gt; \"SE\", :fullname =\u0026gt; \"Sergipe\"}, {:acronym =\u0026gt; \"TO\", :fullname =\u0026gt; \"Tocantins\"}]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow can I compare a variable with \u003ccode\u003e:acronym\u003c/code\u003e and return the \u003ccode\u003e:fullname\u003c/code\u003e in other variable?\nI'm trying to do this using a Rails helper.\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2011-10-04 01:13:10.923 UTC","last_activity_date":"2011-10-04 01:41:31.417 UTC","last_edit_date":"2011-10-04 01:28:58.533 UTC","last_editor_display_name":"","last_editor_user_id":"479863","owner_display_name":"","owner_user_id":"977653","post_type_id":"1","score":"0","tags":"ruby|ruby-on-rails-3|state|helper|acronym","view_count":"102"} +{"id":"7023664","title":"How to get all folders in a SPList, then checking permission \"Contribute\" for current user","body":"\u003cp\u003eI have a sharepoint list like that:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eList\n---------Folder 1\n-----------------Item 1\n-----------------Item 2\n---------Folder 2\n-----------------Item 1\n-----------------Item 2\n---------Folder 3\n-----------------Item 1\n-----------------Item 2\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003col\u003e\n\u003cli\u003e\u003cp\u003eHow can I get all Folders in \u003ccode\u003eList\u003c/code\u003e?\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eAfter that checking if current user has \u003ccode\u003eContribute\u003c/code\u003e permission on \u003ccode\u003eFolder 1\u003c/code\u003e, \u003ccode\u003eFolder 2\u003c/code\u003e, \u003ccode\u003eFolder 3\u003c/code\u003e?\u003c/p\u003e\u003c/li\u003e\n\u003c/ol\u003e","answer_count":"3","comment_count":"0","creation_date":"2011-08-11 09:31:48.2 UTC","favorite_count":"1","last_activity_date":"2017-04-07 16:46:21.353 UTC","last_edit_date":"2017-04-07 16:37:11.307 UTC","last_editor_display_name":"","last_editor_user_id":"285795","owner_display_name":"","owner_user_id":"889597","post_type_id":"1","score":"6","tags":"sharepoint|caml|spquery","view_count":"8568"} +{"id":"34289399","title":"Display dates between two dates in asp.net","body":"\u003cp\u003eI have two calendars in my aspx and I want to display records between selected dates of these calendars. My 'TeklifTarih' database attribute is a date type attribute.\nHere is my aspx:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;asp:Calendar ID=\"Calendar1\" runat=\"server\"\u0026gt;\u0026lt;/asp:Calendar\u0026gt;\u0026lt;br /\u0026gt;\n\u0026lt;asp:Calendar ID=\"Calendar2\" runat=\"server\"\u0026gt;\u0026lt;/asp:Calendar\u0026gt;\u0026lt;br/\u0026gt;\n\u0026lt;asp:Button ID=\"btnClendar\" runat=\"server\" Text=\"İstatistikleri Filtrele\" OnClick=\"btnClendar_Click\"/\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd my onclick method:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprotected void btnClendar_Click(object sender, EventArgs e)\n {\n string baslangicTarihi = Calendar1.SelectedDate.ToString();\n string bitisTarihi = Calendar2.SelectedDate.ToString();\n EntityDataSourcePersonel.CommandText =\n \"SELECT COUNT(TeklifTable.TeklifHazirlayan) AS Basari, EmployeeTable.Name, EmployeeTable.Surname, SUM(TeklifTable.TeklifTutar) AS ToplamSatis FROM EmployeeTable JOIN TeklifTable ON TeklifTable.TeklifHazirlayan = EmployeeTable.EmployeeId WHERE TeklifTable.TeklifTarih \u0026gt;= \" + baslangicTarihi + \" AND TeklifTable.TeklifTarih \u0026lt;= \" + bitisTarihi + \" GROUP BY EmployeeTable.Name,EmployeeTable.Surname\";\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI need to display datas with this commandtext and it works when I remove where command of query but I need to filter with these two dates.\u003c/p\u003e","answer_count":"3","comment_count":"4","creation_date":"2015-12-15 12:31:37.747 UTC","last_activity_date":"2015-12-16 02:25:42.16 UTC","last_edit_date":"2015-12-15 13:01:21.017 UTC","last_editor_display_name":"","last_editor_user_id":"3706016","owner_display_name":"","owner_user_id":"3173750","post_type_id":"1","score":"0","tags":"c#|sql|asp.net|sql-server|date","view_count":"251"} +{"id":"41760371","title":"Ajax alert on validation error","body":"\u003cp\u003eI have made this ajax call:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$.ajax({\n type: myMethod,\n url: myRoute,\n headers: { 'X-CSRF-TOKEN': \"{{csrf_token()}}\" },\n data: form.serializeArray(),\n dataType: 'json',\n success: function(data){\n console.log('validated!');\n },\n error: function(data) {\n var errors = data.responseJSON;\n for (error in errors) {\n alert(error);\n }\n console.log(errors);\n }\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI get this response in the console:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/u8qo9.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/u8qo9.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eAnd my alerts are those field names:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eevent_end_date\nevent_start_date\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd what i want is to print those messages:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eEndzeitpunkt muss ausgefüllt sein.\nStartzeitpunkt muss ausgefüllt sein.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow to get them in alert?\u003c/p\u003e","accepted_answer_id":"41760402","answer_count":"1","comment_count":"0","creation_date":"2017-01-20 09:40:08.483 UTC","last_activity_date":"2017-01-20 09:43:57.287 UTC","last_edit_date":"2017-01-20 09:43:57.287 UTC","last_editor_display_name":"","last_editor_user_id":"519413","owner_display_name":"","owner_user_id":"2502731","post_type_id":"1","score":"2","tags":"jquery|ajax","view_count":"24"} +{"id":"37929244","title":"Generate link to PDF asset in MODX with PHP","body":"\u003cp\u003eMy SimpleSearch is configured to return both Resource hits and PDF hits from my assets/pdfs folder (using Solr). The results are more-or-less working properly, but I'm unable to generate links to PDF hits as SimpleSearch uses \u003ccode\u003emakeUrl()\u003c/code\u003e for Resource links, but it only take an integer and doesn't like the file path that is sent for a PDF hit. Here's the section of SimpleSearch snippet I'm working on:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eif ($extract) {\n $resourceArray['link'] = $modx-\u0026gt;makeUrl($resourceArray['id'],'$ctx',$args);\n\n} else {\n $resourceArray['link'] = 'http://google.ca';\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm using \u003ccode\u003eif ($extract)\u003c/code\u003e as PDF hits don't have an extract generated... And it's working! When I look at the html of a search result, all the PDF hits get \u003ccode\u003e'http://google.ca'\u003c/code\u003e while Resource hits have their link generated properly by \u003ccode\u003emakeUrl()\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eSo how do I generate links to the PDF hits?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-06-20 18:20:43.037 UTC","last_activity_date":"2016-06-20 21:27:45.377 UTC","last_edit_date":"2016-06-20 21:27:45.377 UTC","last_editor_display_name":"","last_editor_user_id":"3995261","owner_display_name":"","owner_user_id":"5661572","post_type_id":"1","score":"0","tags":"php|solr|modx|modx-revolution","view_count":"53"} +{"id":"28328868","title":"There is already an open DataReader associated with this Command which must be closed first - WCF","body":"\u003cp\u003eI have functions that is being called within a WCF service function and I get the exception stated above at the subcategoriesGenerator function on the excute reader line \nisn't it supposed for the cmd created in the second function to a completely different instance than the other one\nplease I'm confused and I need help ant suggestions?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic static List\u0026lt;Category\u0026gt; categoryGenerator(ref SqlConnection con)\n {\n Category category = null;\n List\u0026lt;Category\u0026gt; list = null;\n List\u0026lt;SubCategory\u0026gt; subcategoryList = null;\n string categoryName = null;\n string categoryLink = null;\n SqlCommand cmd = new SqlCommand(\"sp_categoriesgenerator\", con);\n SqlDataReader reader = cmd.ExecuteReader(CommandBehavior.CloseConnection);\n\n while(reader.Read())\n {\n categoryName = reader[\"CategoryName\"].ToString();\n categoryLink = reader[\"CategorySEO\"].ToString() + \"/\";\n subcategoryList = subcategoriesGenerator(ref con, Convert.ToInt32(reader[\"CategoryId\"].ToString()));\n\n category.categoryName = categoryName;\n category.categoryLink = categoryLink;\n category.subcategories = subcategoryList;\n\n list.Add(category);\n\n category = null;\n }\n reader.Close();\n return list;\n }//end CategoryGenerator\n\n public static List\u0026lt;SubCategory\u0026gt; subcategoriesGenerator(ref SqlConnection con, int categoryId)\n {\n SubCategory subcategory = null;\n List\u0026lt;SubCategory\u0026gt; list = null;\n string SubCategoryName = null;\n string SubCategoryLink = null;\n SqlCommand cmd = new SqlCommand(\"sp_subcategoriesgenerator\", con);\n cmd.Parameters.AddWithValue(\"@categoryID\", categoryId);\n SqlDataReader reader = cmd.ExecuteReader();\n\n while(reader.Read())\n {\n SubCategoryName = reader[\"SubcategoryName\"].ToString();\n SubCategoryLink = reader[\"CategorySEO\"].ToString() + \"/\" + reader[\"SubcategorySEO\"] + \"/\";\n subcategory.subcategoryName = SubCategoryName;\n subcategory.subcategoryLink = SubCategoryLink;\n list.Add(subcategory);\n subcategory = null;\n }\n reader.Close();\n\n return list;\n }// end subcategoriesGenerator\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"28331442","answer_count":"1","comment_count":"0","creation_date":"2015-02-04 18:37:27.05 UTC","last_activity_date":"2015-02-04 21:06:21.237 UTC","last_edit_date":"2015-02-04 18:53:27.543 UTC","last_editor_display_name":"","last_editor_user_id":"2277325","owner_display_name":"","owner_user_id":"2277325","post_type_id":"1","score":"0","tags":"sql-server|web-services|wcf|exception|sqldatareader","view_count":"547"} +{"id":"8988302","title":"Flash - Managing a large project","body":"\u003cp\u003eWe are prototyping using Autodesk Scaleform and building our game UI using Flash. We will need to be able to run a large project with a team of 3-4 artists and 10+ programmers. We use Perforce source control system for storage of all code and assets. We need to be able to manage a project with multiple shared resources and multiple people (artists \u0026amp; programmers) working on screens and controls.\u003c/p\u003e\n\n\u003cp\u003eOur problem is as follows:\u003c/p\u003e\n\n\u003cp\u003eWe want to be able to create skinned graphical custom components, such as buttons, sliders, checkboxes as well as more complex controls such as tables and game specific elements.\nWe want to be able to share graphics assets in a single location and allow multiple artists and coders to work on shared components simultaneously. We need all of this to be stored in a Perforce source control repository.\u003c/p\u003e\n\n\u003cp\u003eFor AS3 code this is all fairly straight forward. It works like any other codebase and we have set up FlashBuilder and FlashDevelop projects.\u003c/p\u003e\n\n\u003cp\u003eNow, the options seem to be as follows:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eCreate a flash project or projects. The problem here is that all of the assets are copied into AuthortimeSharedAssts.fla. This means that, because FLA is a binary format, our source control cannot allow more than one person to edit any shared resource at the same time.\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eSet up manual authortime sharing. This will allow work on multiple shared components because individuals can update a small discrete FLA file and this will automatically update a larger shared librar. The problem is that this does not allow sharing of graphics assets, which means that, if an artist updates a graphic, this does not filter down to individual flash files.\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eUse the XFL format. This would allow us to merge files when checking in to source control as they are plain text and it saves out individual assets as separate files, which looks perfect. The problem is that I can't see how to make a project, which entirely uses XFL files (i.e. makes something like AuthortimeSharedAssets.xfl).\u003c/p\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eAt the moment I can't see any obvious, sensible way of running a large project in Flash. We cannot be the first to do this sort of thing though.\u003c/p\u003e\n\n\u003cp\u003eCan anyone help or explain how we should do it?\u003c/p\u003e","answer_count":"5","comment_count":"3","creation_date":"2012-01-24 14:15:18.993 UTC","favorite_count":"4","last_activity_date":"2013-01-30 13:50:26.037 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1167174","post_type_id":"1","score":"7","tags":"flash|actionscript-3|actionscript|projects-and-solutions","view_count":"1724"} +{"id":"26416944","title":"Can i write file in root direcotry android?","body":"\u003cp\u003ei have a question that i can write a file in root directory by this code?\nwhen i test on emulator then it can write at path: /data/data/com.example.test/files/g.gc\nbut i donot know that i can write file on device, because i donot have any device to check it.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic static void saveFile(Context context, String content) {\n try {\n\n FileOutputStream fw = context.openFileOutput(\"g.gc\", Context.MODE_PRIVATE);\n\n fw.write( content);\n\n fw.close();\n\n } catch (IOException e) {}\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-10-17 02:24:55.28 UTC","last_activity_date":"2014-10-17 07:02:40.253 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3967448","post_type_id":"1","score":"-1","tags":"android|android-emulator","view_count":"29"} +{"id":"42827305","title":"kill my previous file on local host","body":"\u003cp\u003eI connected my file \"smap\" to \u003cstrong\u003elocalhost:3000\u003c/strong\u003e couple month ago when I was learning the npm. \u003c/p\u003e\n\n\u003cp\u003eRight now, I cannot remove it from \u003cstrong\u003elocalhost:3000\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eIt keeps showing me old file:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003esmap@1.0.0 start /Users/Han\n cross-env NODE_ENV=development ./node_modules/.bin/hjs-dev-server\n Listening at \u003ca href=\"http://localhost:3000\" rel=\"nofollow noreferrer\"\u003ehttp://localhost:3000\u003c/a\u003e\n webpack built 2f3c2c9a3eec810b8e79 in 2453ms\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eDoes anyone know how can I remove it from my local host? I tried \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eFind: lsof -i :3000\nKill: kill -9 \u0026lt;PID\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut it did not work.\u003c/p\u003e\n\n\u003cp\u003eSince I get a new file, want to connect it with localhost.\u003c/p\u003e","answer_count":"1","comment_count":"8","creation_date":"2017-03-16 07:01:40.507 UTC","last_activity_date":"2017-03-16 12:43:14.837 UTC","last_edit_date":"2017-03-16 09:20:26.877 UTC","last_editor_display_name":"","last_editor_user_id":"3687463","owner_display_name":"","owner_user_id":"7719470","post_type_id":"1","score":"0","tags":"node.js|npm|localhost","view_count":"45"} +{"id":"39844052","title":"Codeigniter form serialize not working","body":"\u003cp\u003ei'm triying to pass data from form to controller in codeigniter...but when I want to print a table with the results...i'm getting null on every row of the table. Here is my code: \u003c/p\u003e\n\n\u003cp\u003eFORM \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;form class=\"col s12\" id=\"update_form\" name=\"update_form\" method=\"post\" \u0026gt;\n \u0026lt;div class=\"row\"\u0026gt;\n \u0026lt;div class=\"input-field col s6\"\u0026gt;\n \u0026lt;input id=\"update_name\" type=\"text\" name=\"name\" class=\"validate\"\u0026gt;\n \u0026lt;label for=\"first_name\"\u0026gt;Nombre\u0026lt;/label\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"input-field col s6\"\u0026gt;\n \u0026lt;input id=\"update_last_name\" name=\"lastname\" type=\"text\" class=\"validate\"\u0026gt;\n \u0026lt;label for=\"last_name\"\u0026gt;Apellido\u0026lt;/label\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"row\"\u0026gt;\n \u0026lt;div class=\"input-field col s6\"\u0026gt;\n \u0026lt;input id=\"update_side\" type=\"text\" name=\"side\" class=\"validate\"\u0026gt;\n \u0026lt;label for=\"partido\"\u0026gt;Partido\u0026lt;/label\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"input-field col s6\"\u0026gt;\n \u0026lt;input id=\"update_charge\" type=\"text\" name=\"charge\" class=\"validate\"\u0026gt;\n \u0026lt;label for=\"cargo\"\u0026gt;Cargo\u0026lt;/label\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"row\"\u0026gt;\n \u0026lt;div class=\"input-field col s6\"\u0026gt;\n \u0026lt;div class=\"file-field input-field no-margin-top\"\u0026gt;\n \u0026lt;div class=\"btn light-blue darken-4\"\u0026gt;\n \u0026lt;span\u0026gt;Animación\u0026lt;/span\u0026gt;\n \u0026lt;input type=\"file\"\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"file-path-wrapper\"\u0026gt;\n \u0026lt;input class=\"file-path validate\" name=\"animation\" type=\"text\"\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n\n \u0026lt;div class=\"input-field col s6\"\u0026gt;\n \u0026lt;select id=\"update_section\" name=\"section\" autocomplete=\"off\"\u0026gt;\n \u0026lt;option value=\"\" disabled selected\u0026gt;Seleccione una opción\u0026lt;/option\u0026gt;\n \u0026lt;option value=\"1\"\u0026gt;Presidencia\u0026lt;/option\u0026gt;\n \u0026lt;option value=\"2\"\u0026gt;Senadores\u0026lt;/option\u0026gt;\n \u0026lt;option value=\"3\"\u0026gt;Diputados\u0026lt;/option\u0026gt;\n \u0026lt;/select\u0026gt;\n \u0026lt;label\u0026gt;Sección\u0026lt;/label\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;input type=\"hidden\" name=\"update_politic_hide\" id=\"update_politic_hdn\" value=\"\"\u0026gt;\n \u0026lt;/form\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eJquery\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(\"#update_politic_btn\").click(function(event) {\n /* Act on the event */\n\n var chango = $(\"#update_form\").serialize();\n alert(chango);\n $.post(baseurl + 'admin/update_politic', {\n data: chango\n },\n function(data) {\n console.log(data);\n list_politic();\n });\n event.preventDefault();\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eController\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic function update_politic(){\n\n if ($this-\u0026gt;input-\u0026gt;is_ajax_request()) {\n\n\n $params[\"name\"] = $this-\u0026gt;input-\u0026gt;post(\"name\");\n $params[\"lastname\"] = $this-\u0026gt;input-\u0026gt;post(\"lastname\");\n $params[\"side\"] = $this-\u0026gt;input-\u0026gt;post(\"side\");\n $params[\"charge\"] = $this-\u0026gt;input-\u0026gt;post(\"charge\");\n $params[\"animation\"] = $this-\u0026gt;input-\u0026gt;post(\"animation\");\n $params[\"section\"] = $this-\u0026gt;input-\u0026gt;post(\"section\");\n $params[\"id\"] = $this-\u0026gt;input-\u0026gt;post(\"update_politic_hide\");\n\n if ($params[\"section\"]==\"Presidencia\") {\n $params[\"section\"]=1;\n }\n\n if ($params[\"section\"]==\"Senadores\") {\n $params[\"section\"]=2;\n }\n\n if ($params[\"section\"]==\"Diputados\") {\n $params[\"section\"]=3;\n }\n\n $this-\u0026gt;load-\u0026gt;model(\"politic\");\n $this-\u0026gt;politic-\u0026gt;update($params);\n}\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMODEL\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic function update($param){\n\n $id = $param[\"id\"];\n $values = array(\n\n \"POLITIC_NAME\" =\u0026gt; $param[\"name\"],\n \"POLITIC_LASTNAME\" =\u0026gt; $param[\"lastname\"],\n \"POLITIC_SIDE\" =\u0026gt; $param[\"side\"],\n \"POLITIC_CHARGE\" =\u0026gt; $param[\"charge\"],\n //\"animation\" =\u0026gt; $param[\"animation\"],\n \"SECTION_ID\" =\u0026gt; $param[\"section\"],\n );\n\n\n $this-\u0026gt;db-\u0026gt;update(\"politics\",$values);\n $this-\u0026gt;db-\u0026gt;where(\"POLITIC_ID\",$id);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHELP!!! I don't understan why i'm getting null values once I want print results!!\u003c/p\u003e","accepted_answer_id":"39844173","answer_count":"1","comment_count":"4","creation_date":"2016-10-04 04:12:35.307 UTC","last_activity_date":"2016-10-04 04:57:22.403 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6841205","post_type_id":"1","score":"0","tags":"javascript|php|jquery|codeigniter|serialization","view_count":"99"} +{"id":"14737392","title":"GroupBox: Adjust size according to text length","body":"\u003cp\u003eIs there an easy way to have a \u003ccode\u003eGroupBox\u003c/code\u003e \u003cem\u003eauto resize\u003c/em\u003e its width depending on the \u003cem\u003elength\u003c/em\u003e of the string in the \u003ccode\u003eText\u003c/code\u003e property? \u003c/p\u003e\n\n\u003cp\u003eSay I fit the width by hand (in \u003cem\u003eDesign Mode\u003c/em\u003e) when the \u003ccode\u003eText = \"Text1\"\u003c/code\u003e then, when the program is running, I update it to \u003ccode\u003eText = \"This is the new text!\"\u003c/code\u003e I would like the width to \u003cem\u003eauto expand\u003c/em\u003e instead of \u003cem\u003ewrapping\u003c/em\u003e over to the next line.\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","accepted_answer_id":"14737561","answer_count":"2","comment_count":"4","creation_date":"2013-02-06 19:41:32.623 UTC","last_activity_date":"2016-12-31 14:10:17.22 UTC","last_edit_date":"2013-02-06 19:57:07.013 UTC","last_editor_display_name":"","last_editor_user_id":"1628280","owner_display_name":"","owner_user_id":"2048267","post_type_id":"1","score":"0","tags":"c#|winforms|groupbox","view_count":"3736"} +{"id":"18767621","title":"Is it possible to serialize two forms in one ajax function?","body":"\u003cp\u003eI need to serialize two forms in the same ajax function with one call. I have tried the following but it just serialize the last one.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e function sssssss2(page){\n var form1 = document.myform1;\n var form2 = document.myform2;\n var dataString1 = $(form1).serialize() + '\u0026amp;page=' + page;\n var dataString2 = $(form2).serialize() + '\u0026amp;page=' + page;\n $.ajax\n ({\n type: \"GET\",\n url: \"load_data.php\",\n data: {dataString1, dataString2}\n success: function(ccc)\n {\n $(\"#container\").html(ccc);\n }\n });\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt doesn't work. How may I serialize both of them within the same function?\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2013-09-12 14:53:23.64 UTC","last_activity_date":"2013-12-06 10:16:10.897 UTC","last_edit_date":"2013-12-06 10:16:10.897 UTC","last_editor_display_name":"","last_editor_user_id":"759866","owner_display_name":"","owner_user_id":"2635574","post_type_id":"1","score":"0","tags":"php|ajax|serialization","view_count":"89"} +{"id":"19137324","title":"Adding a Equinox OSGI hook throwing ClassNotFoundException","body":"\u003cp\u003eI'm trying to add a BundleWatcher hook in my OSGi container so that I can monitor bundles as they are loaded. I have made the following changes in config.ini,\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003e\u003cp\u003eAdded a reference to my jar in the osgi.bundles property like so,\nosgi.bundles = , reference\\:file\\:../lib/my.jar@2:start\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eSet the property osgi.framework.extensions = mybundle\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eAdd MyBundleWatcher as a hook in osgi.hook.configurators.include\u003c/p\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eAlso my jar file is in the same directory as the OSGi bundle.\u003c/p\u003e\n\n\u003cp\u003eWhen I run my app I get a ClassNotFoundException for my BundleWatcher.\u003c/p\u003e\n\n\u003cp\u003eI can confirm however that my bundle (which contains the BundleWatcher) is indeed started as the start method of the Activator in my bundle is called.\u003c/p\u003e\n\n\u003cp\u003eWhat am I doing wrong?\u003c/p\u003e\n\n\u003cp\u003eAs a background here are a couple of articles I followed,\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://wiki.eclipse.org/index.php/Adaptor_Hooks\" rel=\"nofollow\"\u003ehttp://wiki.eclipse.org/index.php/Adaptor_Hooks\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://eclipsesource.com/blogs/2013/01/23/how-to-track-lifecycle-changes-of-osgi-bundles/\" rel=\"nofollow\"\u003ehttp://eclipsesource.com/blogs/2013/01/23/how-to-track-lifecycle-changes-of-osgi-bundles/\u003c/a\u003e\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2013-10-02 12:51:21.78 UTC","favorite_count":"1","last_activity_date":"2013-10-04 08:44:16.887 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"420504","post_type_id":"1","score":"0","tags":"java|eclipse|osgi|equinox","view_count":"306"} +{"id":"20896110","title":"QTreeView and QTabWidget to display only selected items of QTableViews","body":"\u003cp\u003eGiven two SQLite tables \u003cstrong\u003eaddresses\u003c/strong\u003e and \u003cstrong\u003emessages\u003c/strong\u003e, what is the best way to map them to a \u003ccode\u003eQTreeView\u003c/code\u003e and \u003ccode\u003eQTabWidget\u003c/code\u003e in such a way, that if I select one row in a \u003ccode\u003eQTableView\u003c/code\u003e (which is either mapped to addresses or messages), the selected item is\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eopened as a new tab to display its contents, and\u003c/li\u003e\n\u003cli\u003einserted as an item in the \u003ccode\u003eQTreeView\u003c/code\u003e to represent an \"opened\" item.\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eI've managed to open new tabs by creating two custom \u003ccode\u003eQWidgets\u003c/code\u003e, one for addresses and one for messages. On selecting a row in the \u003ccode\u003eQTableView\u003c/code\u003e, the correct (either addresses or messages) \u003ccode\u003eQWidget\u003c/code\u003e is created and fed with the SQL model and the index. The widget then creates a \u003ccode\u003eQDataWidgetMapper\u003c/code\u003e and displays the given index. \u003ccode\u003eAddressWidget\u003c/code\u003e example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eAddressWidget::AddressWidget(QSqlRelationalTableModel *model, QModelIndex \u0026amp;index, QWidget *parent) :\n QWidget(parent)\n{\n // ...\n\n // set up widget mapper\n mapper = new QDataWidgetMapper(this);\n mapper-\u0026gt;setModel(this-\u0026gt;model);\n mapper-\u0026gt;addMapping(streetEdit, this-\u0026gt;model-\u0026gt;fieldIndex(\"street\"));\n mapper-\u0026gt;addMapping(houseNumberEdit, this-\u0026gt;model-\u0026gt;fieldIndex(\"houseNumber\"));\n mapper-\u0026gt;addMapping(zipEdit, this-\u0026gt;model-\u0026gt;fieldIndex(\"zip\"));\n mapper-\u0026gt;addMapping(cityEdit, this-\u0026gt;model-\u0026gt;fieldIndex(\"city\"));\n mapper-\u0026gt;setCurrentModelIndex(index);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow can I extend this to the \u003ccode\u003eQTreeView\u003c/code\u003e, so that the tree displays opened items? Each tab in the \u003ccode\u003eQTabWidget\u003c/code\u003e should have a corresponding item in the \u003ccode\u003eQTreeView\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eIf there is a \u003cem\u003eright\u003c/em\u003e way of doing this, please add it or replace my scenario entirely.\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2014-01-03 03:37:15.073 UTC","favorite_count":"1","last_activity_date":"2014-01-03 03:58:13.297 UTC","last_edit_date":"2014-01-03 03:58:13.297 UTC","last_editor_display_name":"","last_editor_user_id":"2677179","owner_display_name":"","owner_user_id":"3146528","post_type_id":"1","score":"1","tags":"c++|sql|qt|model-view","view_count":"283"} +{"id":"6572867","title":"I want to know how i can return Json in my cakephp when i perform a Get request?","body":"\u003cp\u003eI'm new to cakephp and json. I've recently build a rest service with cakephp. Everything seems to be working. When i query a link using this code beneath that is stored in a separate file:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\n\n$request = 'http://localhost/tut_blog/posts/'; \n$response = file_get_contents($request);\necho $response;\n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI get the return in html because i programmed my view file that way. Her is my view file: index.ctp\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;h2\u0026gt;View all posts\u0026lt;/h2\u0026gt;\n\n \u0026lt;table\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;th\u0026gt;Title\u0026lt;/th\u0026gt;\n \u0026lt;th\u0026gt;Body\u0026lt;/th\u0026gt;\n \u0026lt;/tr\u0026gt;\n\n\u0026lt;?php foreach($posts as $post):?\u0026gt; // met de functie foreach wordt er hier geloopt door de variable $posts die we eerder in de controller hadden aangemaakt en die alle waarden bezit van de query die we eerder hadden opgesteld.\n\n\u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;?php echo $post['Post']['title'];?\u0026gt;\u0026lt;/td\u0026gt; // de $posts array bevat 2 sleutels nr 1 = naam van de model, nr 2 = de naam van de veld in je tabel.\n \u0026lt;td\u0026gt;\u0026lt;?php echo $post['Post']['body'];?\u0026gt;\u0026lt;/td\u0026gt;\n\u0026lt;/tr\u0026gt;\n\n\u0026lt;?php endforeach; ?\u0026gt;\n \u0026lt;/table\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to know how i can get this same data but then in JSON output.\nHere's my controller file as well:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;?php \n\nclass PostsController extends AppController{\n\nvar $name = 'Posts';\n\nvar $components = array('RequestHandler');\n\n function hello_world(){\n\n\n }\n\n\n function index(){\n\n\n $this-\u0026gt;set('posts',$this-\u0026gt;Post-\u0026gt;find('all')); \n\n }\n\n function view($id = NULL){ \n\n\n $this-\u0026gt;set('post',$this-\u0026gt;Post-\u0026gt;read(NULL, $id));\n\n }\n\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e?\u003e\u003c/p\u003e","accepted_answer_id":"6575420","answer_count":"2","comment_count":"0","creation_date":"2011-07-04 14:35:39.527 UTC","last_activity_date":"2011-10-28 12:08:30.577 UTC","last_edit_date":"2011-10-28 12:08:30.577 UTC","last_editor_display_name":"","last_editor_user_id":"399904","owner_display_name":"","owner_user_id":"801423","post_type_id":"1","score":"0","tags":"android|web-services|json|cakephp","view_count":"574"} +{"id":"19848025","title":"css - how to get floated divs to stack when you zoom in","body":"\u003cp\u003eIn this responsive design I am trying for, I have three divs floating side-by-side, which get narrower and narrower when you zoom in on them. I would like them to keep their size and stack instead. How do I do this? I am beginning jquery, but for this would prefer to stick to css if possible. \u003c/p\u003e\n\n\u003cp\u003eHere is the relevant styling I have for the divs and their parent container div:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#container {\nmargin-left:auto;\nmargin-right:auto;\nwidth:110%}\n\n.floating-div {\nwidth:27%;\nmin-width:27%;\nheight:420px;\nfloat:left;}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks for reading~\u003c/p\u003e","accepted_answer_id":"20502821","answer_count":"2","comment_count":"2","creation_date":"2013-11-07 22:29:39.99 UTC","last_activity_date":"2013-12-10 18:48:51.867 UTC","last_editor_display_name":"","owner_display_name":"user2961861","post_type_id":"1","score":"0","tags":"css|stack|inline","view_count":"39"} +{"id":"10469703","title":"Is it possible to set an element to display only when the \u003cimg\u003e element is removed?","body":"\u003cp\u003eFor printing purposes, I removed the IMG element, but I wanted an H1 element to be displayed on another portion of the site when the IMG element is removed.\u003c/p\u003e\n\n\u003cp\u003eIs this possible?\u003c/p\u003e","accepted_answer_id":"10469823","answer_count":"1","comment_count":"1","creation_date":"2012-05-06 10:08:18.743 UTC","last_activity_date":"2012-05-06 10:36:57 UTC","last_edit_date":"2012-05-06 10:36:57 UTC","last_editor_display_name":"","last_editor_user_id":"635608","owner_display_name":"","owner_user_id":"1364032","post_type_id":"1","score":"0","tags":"html","view_count":"38"} +{"id":"35050651","title":"rails 4 justifiedGallery script only load the latest post with images","body":"\u003cp\u003eWhen i create a new post with images it works, but when i create a new post with images, justifiedGallery doesnt apply the jquery script to the previous post, why?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ejQuery -\u0026gt; //when dom is ready\n $(\"#userindex\").justifiedGallery(\n lastRow : 'justify',\n captions: false,\n randomize: false,\n rowHeight: 80,\n )\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eView to render post with image\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div id=\"userindex\"\u0026gt;\n \u0026lt;% img.each do |link| %\u0026gt;\n \u0026lt;div\u0026gt;\n \u0026lt;%= image_tag(link) %\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;% end %\u0026gt; \n\u0026lt;/div\u0026gt; \n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"35050781","answer_count":"1","comment_count":"0","creation_date":"2016-01-28 00:10:04.073 UTC","favorite_count":"1","last_activity_date":"2016-01-28 00:31:15.49 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5213790","post_type_id":"1","score":"1","tags":"javascript|jquery|ruby-on-rails|ruby-on-rails-3|ruby-on-rails-4","view_count":"29"} +{"id":"24447322","title":"cmake failed building project on mac","body":"\u003cp\u003eI'm trying to build a project on my new macbook which was previously built normally on linux computers.\u003c/p\u003e\n\n\u003cp\u003eat first when i run \u003ccode\u003ecmake\u003c/code\u003e, i get a the following:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e-- The C compiler identification is Clang 5.1.0\n-- The CXX compiler identification is Clang 5.1.0\n-- Check for working C compiler: /usr/bin/cc\n-- Check for working C compiler: /usr/bin/cc -- works\n-- Detecting C compiler ABI info\n-- Detecting C compiler ABI info - done\n-- Check for working CXX compiler: /usr/bin/c++\n-- Check for working CXX compiler: /usr/bin/c++ -- works\n-- Detecting CXX compiler ABI info\n-- Detecting CXX compiler ABI info - done\n-- Performing Test HAVE_CLOCK_GETTIME\n-- Performing Test HAVE_CLOCK_GETTIME - Failed\n-- Boost version: 1.55.0\n-- Found the following Boost libraries:\n-- graph\n-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) \n-- -\u0026gt; doxygen not found -\u0026gt; api-doc will not be created\n-- Configuring done\n-- Generating done\n-- Build files have been written to: /path/to/folder\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand then when i run \u003ccode\u003emake\u003c/code\u003e, it works till around 30% and then it stop with this error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e/path/to/project/lib/helpers.cpp:555:2: error: use of undeclared identifier 'gettimeofday'\n gettimeofday(\u0026amp;tv, NULL);\n ^\n1 error generated.\nmake[2]: *** [lib/CMakeFiles/genom.dir/helpers.cpp.o] Error 1\nmake[1]: *** [lib/CMakeFiles/genom.dir/all] Error 2\nmake: *** [all] Error 2\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI looked online, there was some suggestions for changing \u003ccode\u003eclock_gettime(CLOCK_REALTIME, \u0026amp;t);\u003c/code\u003e to \u003ccode\u003eclock_get_time(CLOCK_REALTIME, \u0026amp;t);\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003ebut they didnt work.\u003c/p\u003e","accepted_answer_id":"24447515","answer_count":"1","comment_count":"0","creation_date":"2014-06-27 08:29:08.83 UTC","last_activity_date":"2014-06-27 08:41:01.99 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1187897","post_type_id":"1","score":"0","tags":"osx","view_count":"542"} +{"id":"25968793","title":"iOS 8 :MFMailComposeViewController automatic called cancel button","body":"\u003cp\u003eiOS 7 email send work perfectly but iOS 8 view automatic disappear and send button also not enable.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eerror is :timed out waiting for fence barrier from com.apple.MailCompositionService\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"26059666","answer_count":"1","comment_count":"2","creation_date":"2014-09-22 07:33:33.673 UTC","favorite_count":"2","last_activity_date":"2014-09-26 12:32:47.633 UTC","last_edit_date":"2014-09-22 12:36:33.093 UTC","last_editor_display_name":"","last_editor_user_id":"3752143","owner_display_name":"","owner_user_id":"3752143","post_type_id":"1","score":"1","tags":"ios|iphone|ios7|ios8","view_count":"339"} +{"id":"33796059","title":"Rails: Many to Many relationship setup (ActiveRecord and ActiveAdmin)","body":"\u003cp\u003eI added a has_and_belongs_to_many between Product and Brand tables/models\u003c/p\u003e\n\n\u003cp\u003eThis is how the models look like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass Brand \u0026lt; ActiveRecord::Base\n has_and_belongs_to_many :products\n\n default_scope { order('name asc')}\nend\n\nclass Product \u0026lt; ActiveRecord::Base\n has_and_belongs_to_many :brands\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThese are the existing columns in the table:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[13] pry(main)\u0026gt; Brand\n=\u0026gt; Brand(id: integer, name: string, created_at: datetime, updated_at: datetime, product_id: integer)\n\n[11] pry(main)\u0026gt; Product\n=\u0026gt; Product(id: integer, name: string, created_at: datetime, updated_at: datetime)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eJoin table db migration:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass CreateJoinTableProductsBrands \u0026lt; ActiveRecord::Migration\n def change\n create_join_table :products, :brands do |t|\n t.integer :product_id\n t.integer :brand_id\n t.index [:product_id, :brand_id]\n t.index [:brand_id, :product_id]\n end\n end\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eQuestions:\u003c/strong\u003e\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eAs you will notice, the Brand table already had the product_id column. Should I change it to an array product_ids column? (I am using postgres)\u003c/li\u003e\n\u003cli\u003eShould I add brand_ids column to Product\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eShould I add ProductBrand model. I tried it but seems like Rails console didnt recognize it\u003c/p\u003e\n\n\u003cp\u003eclass ProductBrand \u0026lt; ActiveRecord::Base\u003c/p\u003e\n\n\u003cp\u003eend\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eIn ActiveAdmin what's the correct way of creating a new entry for Product or Brand such that a new record correctly links Product, Brand and ProductBrand entry?\u003c/p\u003e\u003c/li\u003e\n\u003c/ol\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-11-19 05:39:48.06 UTC","last_activity_date":"2015-11-19 05:56:58.003 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"250304","post_type_id":"1","score":"0","tags":"ruby-on-rails|activerecord|many-to-many|associations|activeadmin","view_count":"51"} +{"id":"40532499","title":"How to escape a systemd Specifier to pass to the command in ExecStart","body":"\u003cp\u003eI've written the following systemd service \u003ccode\u003etcpdumpd.service\u003c/code\u003e to kick off a persistent tcpdump recording.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[Unit]\nDescription=TCPDumpd\nAfter=multi-user.target network.target\n\n[Service]\nType=simple\nExecStart=/usr/sbin/tcpdump -pni eth0 -s65535 -G 3600 -w '/var/log/tcpdump/trace_%Y-%m-%d_%H:%M:%S.pcap' -z gzip\nRestart=on-abort\n\n[Install]\nWantedBy=multi-user.target\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003etcpdump allows strftime-placeholders like %H for hour, %M for minute and so on to allow you to create time stamped files.\u003c/p\u003e\n\n\u003cp\u003eHowever, systemd has special specifiers than can be used in it, like (%n, %N, %p, %i, %U, %u, %m, %H, %b, %v) So any of the specifiers that overlap, like %m and %H pass through the information from systemd and don't allow the placeholder to be passed through to tcpdump to make the time stamp.\u003c/p\u003e\n\n\u003cp\u003eDoes anyone know if there is a way to escape the specifiers in systemd so I can pass the %m and %H through to tcpdump? \u003c/p\u003e","accepted_answer_id":"40533049","answer_count":"1","comment_count":"0","creation_date":"2016-11-10 16:28:19.79 UTC","last_activity_date":"2016-11-10 17:03:16.71 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6819500","post_type_id":"1","score":"2","tags":"tcpdump|systemd","view_count":"379"} +{"id":"1023786","title":"What's the best approach in auditing a big java/j2ee web application","body":"\u003cp\u003eI have to audit a large web Java/J2ee application that has evolved over several\nyears. It's been written by some other company, not the one I'm working for. In\nit's current state it has become hard to evolve and maintain, new\nfunctionalities are hard to add and often lead to bugs that sometime show up in\nproduction. There seem to be some copy/pasted code which resulted in code duplication. \nThe current app is some kind of online shopping with some cms-like content here and there.\nIt's mostly Struts and some Spring in newer parts of the code, maybe some ejbs thrown in for\ngood measure. There are some unit tests available, but not a lot of them.\nThese are things I've been told, I haven't seen yet the actual code.\u003c/p\u003e\n\n\u003cp\u003eMy company will make a proposition to rewrite parts of this app in order to reduce\ncomplexity, improve quality and modularity, and make it possible to add easier\nnew functionalities without regressions.\nBefore making any commitement, they would like to have some kind of appreciation\nof the quality of the existing code and to asses how much of it can be reused, in order\nto have more than a guess in what there will have to be done - full rewrite or partial\nrewrite.\u003c/p\u003e\n\n\u003cp\u003eThe catch is that I'll have to do this in a very short period ( a couple of days ) so I'm\ntrying to work out a plan for what can be done in such a short time. What I'm thiking is :\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003echeck out \"basic\" things - exceptions treatment, logging\u003c/li\u003e\n\u003cli\u003echeck out the level of layering ( views, controllers, dao layer )\u003c/li\u003e\n\u003cli\u003emeasure the actual coverage of the unit tests\u003c/li\u003e\n\u003cli\u003emaybe run some Checkstyle, Findbugs and PMD over the projects\u003c/li\u003e\n\u003cli\u003e...\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eSo the actual question is what other things should I take into account/check/measure/etc ?\u003c/p\u003e\n\n\u003cp\u003eI'm not sure what kind of numbers I could get out of this and if it would really mean\nsomething, I have the feeling that what the management is asking is kind of the wrong\napproach, so the second question would be : does anyone has a better idea ?\u003c/p\u003e\n\n\u003cp\u003eI'll appreciate any idea, suggestion, comment on this.\u003c/p\u003e\n\n\u003cp\u003eEdit: I'll be adding two dead code detectors to the mix : \u003ca href=\"http://www.ucdetector.org/\" rel=\"noreferrer\"\u003eUCD\u003c/a\u003e and \u003ca href=\"https://dcd.dev.java.net/\" rel=\"noreferrer\"\u003eDCD\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"1024476","answer_count":"4","comment_count":"1","creation_date":"2009-06-21 12:25:30.95 UTC","favorite_count":"5","last_activity_date":"2009-06-22 08:41:19.467 UTC","last_edit_date":"2009-06-22 08:41:19.467 UTC","last_editor_display_name":"","last_editor_user_id":"116463","owner_display_name":"","owner_user_id":"116463","post_type_id":"1","score":"12","tags":"java|java-ee|audit","view_count":"4861"} +{"id":"20554185","title":"Android Timer Example","body":"\u003cp\u003eI'm developing a game via Andengine for Android. There is a player on my game scene. When the player pass finish line(800,0), the game will end. So I wanna show every passed seconds to user on scene. And finally I wanna show how much time passed till the finish.\nHow can I do that? \u003c/p\u003e\n\n\u003cp\u003eI tried this but doen'T work:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eTimerHandler timerHandler = new TimerHandler(0.1f, true, new ITimerCallback(){\n\n @Override\n public void onTimePassed(TimerHandler pTimerHandler) {\n time.setText(\"\"+pTimerHandler.getTimerSeconds());\n }\n });\nregisterUpdateHandler(timerHandler);\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"4","creation_date":"2013-12-12 21:02:42.453 UTC","last_activity_date":"2016-07-15 04:25:51.543 UTC","last_edit_date":"2016-07-15 04:25:51.543 UTC","last_editor_display_name":"","last_editor_user_id":"3134215","owner_display_name":"","owner_user_id":"3076301","post_type_id":"1","score":"1","tags":"android|timer|andengine|counter","view_count":"1646"} +{"id":"24320017","title":"R plot: How to use mtext to get top-aligned vertical label with las=1","body":"\u003cp\u003eI'm trying to get a label on my vertical axis using \u003ccode\u003emtext\u003c/code\u003e that is read horizontally (\u003ccode\u003elas=1\u003c/code\u003e) and is at the top of the axis.\u003c/p\u003e\n\n\u003cp\u003eMy attempt is to use \u003ccode\u003elas=1, adj=1\u003c/code\u003e. I can get the desired placement when I don't specify \u003ccode\u003elas=1\u003c/code\u003e, but as soon as I add the \u003ccode\u003elas=1\u003c/code\u003e argument the \u003ccode\u003eadj=1\u003c/code\u003e placement goes away. Here's a picture with code. The left plot shows correct placement, but without \u003ccode\u003elas=1\u003c/code\u003e. The right plot shows both arguments present.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epar(mfrow=c(1,2), mar=c(2,3,2,1))\n\nplot(1, 1, ann=F)\nmtext(col=\"blue\", \"y\", side=2, line=2, adj=1)\nmtext(side=3, \"col=blue, side=2, adj=1\")\n\nplot(1, 1, ann=F)\nmtext(col=\"red\", \"y\", side=2, line=2, adj=1, las=1)\nmtext(side=3, \"col=red, side=2, adj=1, las=1\")\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/hDDfm.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eI've tried fussing around with padj, but that only moves the label up \u0026amp; down a little. Also, I know that the \u003ccode\u003eat\u003c/code\u003e argument can, but that feels a bit too manual.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-06-20 04:33:42.077 UTC","favorite_count":"1","last_activity_date":"2014-06-20 05:35:29.91 UTC","last_edit_date":"2014-06-20 05:02:04.947 UTC","last_editor_display_name":"","last_editor_user_id":"1745884","owner_display_name":"","owner_user_id":"1745884","post_type_id":"1","score":"4","tags":"r|plot","view_count":"2420"} +{"id":"16894715","title":"Hadoop, \"Browse the filesystem\" broken link on ec2","body":"\u003cp\u003eI am newbie to setting hadoop on EC2. I am trying to set-up single node hadoop setup. I have successfully installed and ran Hadoop 1.1.2 on one of the Amazon EC2 instance. All nodes, namenode, datanode, jobtracker, mapred node are on the same machine.\u003c/p\u003e\n\n\u003cp\u003eMy core-site cofiguration is \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;property\u0026gt;\n \u0026lt;name\u0026gt;fs.default.name\u0026lt;/name\u0026gt;\n \u0026lt;value\u0026gt;hdfs://localhost:9000\u0026lt;/value\u0026gt;\n\u0026lt;/property\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I start the Hadoop, and go to web ui, namenode UI opens without any problem.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ehttp://\u0026lt;namenode\u0026gt;:50070/dfshealth.jsp\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut when clicked on the \"Browse the filesystem\", it redirects to \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ehttp://localhost:50075\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhich is incorrect. It should be something \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ehttp://\u0026lt;namenode\u0026gt;:50075. \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut in this case it failes.\u003c/p\u003e\n\n\u003cp\u003ePlease help me to figure out the problem.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-06-03 10:30:35.723 UTC","last_activity_date":"2013-06-03 15:48:11.613 UTC","last_edit_date":"2013-06-03 10:35:48.383 UTC","last_editor_display_name":"","last_editor_user_id":"756796","owner_display_name":"","owner_user_id":"756796","post_type_id":"1","score":"1","tags":"ubuntu|hadoop|ubuntu-12.04","view_count":"1405"} +{"id":"19598185","title":"Parse XML partially","body":"\u003cp\u003ei have a problem parsing following (shortened) XML-file:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" encoding=\"UTF-8\"?\u0026gt;\n\u0026lt;!-- DOCTYPE nitf PUBLIC \"-//IPTC-NAA//DTD NITF-XML 3.0//EN\" \"nitf.dtd\" --\u0026gt;\n\u0026lt;nitf\u0026gt; \n \u0026lt;head\u0026gt; \n \u0026lt;title\u0026gt;EU-Regierungschefs streiten über Waffen für Syrien\u0026lt;/title\u0026gt; \n \u0026lt;/head\u0026gt; \n \u0026lt;body\u0026gt; \n \u0026lt;body.head\u0026gt; \n \u0026lt;hedline\u0026gt; \n \u0026lt;hl1\u0026gt;EU-Regierungschefs streiten über Waffen für Syrien\u0026lt;/hl1\u0026gt; \n \u0026lt;/hedline\u0026gt; \n \u0026lt;/body.head\u0026gt; \n \u0026lt;body.content\u0026gt;\n \u0026lt;p\u0026gt; [...] \u0026lt;/p\u0026gt;\n\n \u0026lt;block style=\"EXTERNAL-LINKS\"\u0026gt; \n \u0026lt;p\u0026gt; \n \u0026lt;a href=\"http://dpaq.de/CyyZL\"\u0026gt;EU und Syrien\u0026lt;/a\u0026gt; \n \u0026lt;/p\u0026gt; \n \u0026lt;p\u0026gt; \n \u0026lt;a href=\"http://dpaq.de/WzLWU\"\u0026gt;EU und Russland\u0026lt;/a\u0026gt; \n \u0026lt;/p\u0026gt; \n \u0026lt;/block\u0026gt; \n \u0026lt;media media-type=\"image\"\u0026gt;\n \u0026lt;media-reference alternate-text=\"Merkel und Barroso\" height=\"600\" mime-type=\"image/jpeg\" name=\"large_4_3\" source=\"../dpa-bzv_myline-images/large/jpeg-1484DE008774AFFD-20130315-img_41077628.original.large-4-3-800-252-0-2976-2041.jpg\" width=\"800\"/\u0026gt; \n \u0026lt;media-caption\u0026gt; \n \u0026lt;p\u0026gt; [...] \u0026lt;/p\u0026gt; \n \u0026lt;/media-caption\u0026gt; \n \u0026lt;/media\u0026gt; \n \u0026lt;/body.content\u0026gt; \n \u0026lt;body.end/\u0026gt; \n \u0026lt;/body\u0026gt; \n\u0026lt;/nitf\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe PHP-part looks like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eif (file_exists($path)) {\n $xml = simplexml_load_file($path);\n var_dump($xml-\u0026gt;body-\u0026gt;{'body.content'});\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAs expected, the XML-content is parsed correctly. This is, where my problem begins. \u003ccode\u003e\u0026lt;body.content\u0026gt;\u003c/code\u003e contains HTML-tags, which are parsed, too, but i would like the content to be treated as a string, to output it directly to display the HTML as it is.\u003c/p\u003e\n\n\u003cp\u003eWhat would be the best way to solve this? \u003c/p\u003e","accepted_answer_id":"19607599","answer_count":"1","comment_count":"3","creation_date":"2013-10-25 19:42:17.61 UTC","last_activity_date":"2013-10-26 14:02:11.03 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2355392","post_type_id":"1","score":"-3","tags":"php|xml|simplexml","view_count":"143"} +{"id":"35557790","title":"Can I call a 64bit DLL from a 32bit version of Excel VBA?","body":"\u003cp\u003eI'm in the unusual situation of having a 32bit install of Excel and some libraries I call have been compiled as 64bit libraries but when I try to call the functions I get an error \"Cannot find xyz.dll\".\u003c/p\u003e\n\n\u003cp\u003eI know you can't call 32bit processes (easily) from 64bit ones, but what about vice versa?\u003c/p\u003e","accepted_answer_id":"35557902","answer_count":"1","comment_count":"0","creation_date":"2016-02-22 15:40:14.523 UTC","last_activity_date":"2016-02-22 15:46:45.497 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5963834","post_type_id":"1","score":"1","tags":"excel-vba|64bit","view_count":"170"} +{"id":"22402539","title":"Simulate application on an iPad mini w/ Flashbuilder","body":"\u003cp\u003eI'm almost ready to launch my app on the store. But i found some issues with the display of components on an iPad Mini. It all works on a regular ipad and a ipad retina.\u003c/p\u003e\n\n\u003cp\u003eSimple question, is there any way to simulate the app on an iPad Mini (or more devices from Apple) with FlashBuilder?\u003c/p\u003e\n\n\u003cp\u003eInfo app:\n- Flex mobile project\n- made in FlashBuilder\u003c/p\u003e","answer_count":"1","comment_count":"5","creation_date":"2014-03-14 10:33:08.4 UTC","last_activity_date":"2014-04-30 00:20:58.817 UTC","last_edit_date":"2014-03-14 11:02:44.443 UTC","last_editor_display_name":"","last_editor_user_id":"3419412","owner_display_name":"","owner_user_id":"3416027","post_type_id":"1","score":"1","tags":"ios|flex|air|adobe|flash-builder","view_count":"185"} +{"id":"14958741","title":"php object oriented overloading","body":"\u003cp\u003eI came across the following code and could not figure out why the output of the script came out in a non-intuitive sequence using php's get and set magic methods.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass Magic\n{\n public $a = \"A\";\n protected $b = array(\"a\" =\u0026gt; \"A\", \"b\" =\u0026gt; \"B\", \"c\" =\u0026gt; \"C\");\n protected $c = array(1,2,3);\n\n public function __get($v)\n {\n echo \"$v\";\n return $this-\u0026gt;b[$v];\n }\n public function __set($var, $val)\n {\n echo \"$var: $val\";\n $this-\u0026gt;$var = $val;\n }\n}\n$m = new Magic();\necho $m-\u0026gt;a . \",\" . $m-\u0026gt;b . \",\" . $m-\u0026gt;c . \",\";\n$m-\u0026gt;c = \"CC\";\necho $m-\u0026gt;a . \",\" . $m-\u0026gt;b . \",\" . $m-\u0026gt;c;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOut put was:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ebcA,B,C,c\nCCbcA,B,C\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFirst of all why is it no outputting A as the first thing? The sequence of output doesn't make sense.\u003c/p\u003e","accepted_answer_id":"14958908","answer_count":"3","comment_count":"1","creation_date":"2013-02-19 13:28:48.49 UTC","last_activity_date":"2013-02-19 13:38:29.003 UTC","last_edit_date":"2013-02-19 13:33:10.283 UTC","last_editor_display_name":"","last_editor_user_id":"1073758","owner_display_name":"","owner_user_id":"1798677","post_type_id":"1","score":"1","tags":"php|overloading|magic-methods","view_count":"184"} +{"id":"36776983","title":"how to output the incremented list of years/current pop?","body":"\u003cp\u003eI'm doing an assignment for class where I need to output my program to look something like this. Right now I'm stuck on how to output the years like that. \u003c/p\u003e\n\n\u003cp\u003eI've added a counter for years and asked for current year as an input? \u003c/p\u003e\n\n\u003cp\u003eCan someone lend me a hand? \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Town A Town B\n 8.5% 0.3%\nYear 5000 8000\n-------------------------------------------\n2016 5425 8024\n2017 5886 8048\n2018 6386 8072\n2019 6929 8096\n2020 7518 8121\n2021 8157 8145\n\n cout \u0026lt;\u0026lt; \"What year is it? \";\n cin \u0026gt;\u0026gt; curYear;\n cout \u0026lt;\u0026lt; \"Enter the population of town A: \";\n cin \u0026gt;\u0026gt; townA;\n cout \u0026lt;\u0026lt; \"Enter the growth rate of town A: \";\n cin \u0026gt;\u0026gt; growthA;\n cout \u0026lt;\u0026lt; \"Enter the population of town B: \";\n cin \u0026gt;\u0026gt; townB;\n cout \u0026lt;\u0026lt; \"Enter the growth rate of town B: \";\n cin \u0026gt;\u0026gt; growthB;\n\n while ((townA \u0026lt;= 0) \u0026amp;\u0026amp; (growthA \u0026lt;=0) \u0026amp;\u0026amp; (townB \u0026gt; townA) \u0026amp;\u0026amp; (growthB \u0026lt; growthA) \u0026amp;\u0026amp; (growthB \u0026gt; 0))\n {\n cout \u0026lt;\u0026lt; \"Error: Values must be positive, please try again.\" \u0026lt;\u0026lt; endl;\n cout \u0026lt;\u0026lt; \"Enter the population of town A: \";\n cin \u0026gt;\u0026gt; townA;\n cout \u0026lt;\u0026lt; \"Enter the growth rate of town A: \";\n cin \u0026gt;\u0026gt; growthA;\n cout \u0026lt;\u0026lt; \"Enter the population of town B: \";\n cin \u0026gt;\u0026gt; townB;\n cout \u0026lt;\u0026lt; \"Enter the growth rate of town B: \";\n cin \u0026gt;\u0026gt; growthB;\n cout \u0026lt;\u0026lt; endl;\n }\n\n years = 0;\n while (townA \u0026lt;= townB)\n {\n finalA = ((growthA / 100) * (townA)) + townA;\n finalB = ((growthB / 100) * (townB)) + townB;\n cout \u0026lt;\u0026lt; \"Town A \" \u0026lt;\u0026lt; finalA \u0026lt;\u0026lt; endl;\n cout \u0026lt;\u0026lt; \"Town B \" \u0026lt;\u0026lt; finalB \u0026lt;\u0026lt; endl;\n years++;\n curYear++;\n townA = finalA;\n townB = finalB;\n }\n\n cout \u0026lt;\u0026lt; \"\\n\\n\" \u0026lt;\u0026lt; endl;\n cout \u0026lt;\u0026lt; setw(3) \u0026lt;\u0026lt; \"Town A\" \u0026lt;\u0026lt; setw(15) \u0026lt;\u0026lt; \"Town B\" \u0026lt;\u0026lt; endl;\n cout \u0026lt;\u0026lt; setw(3) \u0026lt;\u0026lt; growthA \u0026lt;\u0026lt; \"%\" \u0026lt;\u0026lt; setw(14) \u0026lt;\u0026lt; growthB \u0026lt;\u0026lt; \"%\" \u0026lt;\u0026lt; endl;\n cout \u0026lt;\u0026lt; setw(4) \u0026lt;\u0026lt; townA \u0026lt;\u0026lt; setw(16) \u0026lt;\u0026lt; townB \u0026lt;\u0026lt; endl;\n cout \u0026lt;\u0026lt; \"Year\" \u0026lt;\u0026lt; endl;\n cout \u0026lt;\u0026lt; curYear \u0026lt;\u0026lt; endl;\n cout \u0026lt;\u0026lt; \"--------------------------------------------\" \u0026lt;\u0026lt; endl;\n cout \u0026lt;\u0026lt; endl;\n cout \u0026lt;\u0026lt; \"It took Town A \" \u0026lt;\u0026lt; years \u0026lt;\u0026lt; \" years to exceed the population of Town B.\" \u0026lt;\u0026lt; endl;\n\n return 0;\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"4","creation_date":"2016-04-21 17:49:50.483 UTC","last_activity_date":"2016-04-21 18:09:59.41 UTC","last_edit_date":"2016-04-21 18:07:31.32 UTC","last_editor_display_name":"","last_editor_user_id":"225074","owner_display_name":"","owner_user_id":"6146792","post_type_id":"1","score":"0","tags":"c++","view_count":"21"} +{"id":"3872267","title":"How to update widget every minute","body":"\u003cp\u003ecan anyone tell me the best way to update widget every minute.\u003c/p\u003e\n\n\u003cp\u003eNow i'm using thread inside the AppWidget, but sometimes i get error FAILED BINDER TRANSACTION !!! After that error, i always got a lot of error like that all the time and i can't change the view in my widget again.\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","accepted_answer_id":"3872334","answer_count":"2","comment_count":"1","creation_date":"2010-10-06 12:14:12.903 UTC","favorite_count":"3","last_activity_date":"2015-09-20 00:17:43.64 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"430926","post_type_id":"1","score":"4","tags":"android|android-widget","view_count":"3798"} +{"id":"15737524","title":"AND a mask to address (lower bits needed) C#","body":"\u003cp\u003eSo I know I can bit shift a mask of 0xFFFFFFFF by say 8 for example to get 0xFFFFFF00 \u0026amp; it with an address and get everything but the last 8 bits, but I would like to go the other way so I can grab the bottom end of an address with a mask like 0x000000FF, however bit shifting right wont work obviously. Any ideas? \u003c/p\u003e\n\n\u003cp\u003eHere is the code for the first type bit shift I mentioned.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic int Block_tag(int address, int block_size, int max_address)\n {\n int bit_shift = (int)Math.Log(block_size, 2);\n int bit_mask = max_address \u0026lt;\u0026lt; bit_shift;\n return (address \u0026amp; bit_mask);\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI could do it by hand with about 12 \"If\" statements but that isn't very clean. \u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","accepted_answer_id":"15737558","answer_count":"2","comment_count":"2","creation_date":"2013-04-01 04:12:41.597 UTC","last_activity_date":"2013-04-01 04:28:45.457 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2036351","post_type_id":"1","score":"2","tags":"c#","view_count":"316"} +{"id":"37546657","title":"Task 'default' is not in your gulpfile after npm link gulp","body":"\u003cp\u003eI´m using gulp and defined my gulp task in the gulpfile.js\nBecause i don´t want to install gulp every time i used the \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enpm install gulp -g\nnpm link gulp \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e( the link command in my directory where i want to execute gulp )\nafter that the command \"gulp\" is available on my working directory, but it outputs:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eTask 'default' is not in your gulpfile\n Blockquote\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eIf I put a console log in the beginning of my gulpfile.js, I can see that he outputs the log and can find the gulpfile.js\u003c/p\u003e\n\n\u003cp\u003eCan anyone tell me where my problem is ?\u003c/p\u003e\n\n\u003cp\u003eI found this article but it did not helped me\n\u003ca href=\"https://stackoverflow.com/questions/28972330/task-is-not-in-your-gulpfile-when-using-npm-link\"\u003eHow to fix \u0026quot;Task is not in your gulpfile\u0026quot; error when using npm link?\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThanks so much\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-05-31 13:08:12.06 UTC","favorite_count":"1","last_activity_date":"2016-05-31 13:43:10.927 UTC","last_edit_date":"2017-05-23 10:30:42.197 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"6355790","post_type_id":"1","score":"0","tags":"javascript|node.js|gulp","view_count":"1036"} +{"id":"29347636","title":"Can Moqui implement a form with dynamic fields","body":"\u003cp\u003eI have two list \u003ccode\u003elistRowKey\u003c/code\u003e and \u003ccode\u003elistColKey\u003c/code\u003e and a nested map \u003ccode\u003emap\u0026lt;Row, Map\u0026lt;Col, String\u0026gt;\u0026gt;\u003c/code\u003e, I want to create a table to input content into map, the rows and cols of table is generated from two list. I don't known how to use a nested loop to add fields into form.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-03-30 13:34:37.603 UTC","last_activity_date":"2015-03-31 05:35:12.607 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"244431","post_type_id":"1","score":"0","tags":"moqui","view_count":"39"} +{"id":"24866621","title":"Android Calendar Provider: How can I delete my own local calendars?","body":"\u003cp\u003eI am just learning how to work with the Android Calendars. So far, I am able to display the info about existing calendars. I can also create my own local calendars -- the test code like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate void createCalendarTest()\n{\n Uri.Builder builder = Calendars.CONTENT_URI.buildUpon();\n builder.appendQueryParameter(android.provider.CalendarContract.CALLER_IS_SYNCADAPTER, \"true\")\n .appendQueryParameter(Calendars.ACCOUNT_NAME, \"private\")\n .appendQueryParameter(Calendars.ACCOUNT_TYPE, CalendarContract.ACCOUNT_TYPE_LOCAL);\n\n Uri uri = builder.build();\n\n ContentValues values = new ContentValues();\n values.put(Calendars.NAME, \"TEST\");\n values.put(Calendars.CALENDAR_DISPLAY_NAME, \"Calendar named TEST\");\n values.put(Calendars.SYNC_EVENTS, false);\n values.put(Calendars.VISIBLE, true);\n\n getContentResolver().insert(uri, values);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eActually, I can create many calendars that differ only in \u003ccode\u003e_ID\u003c/code\u003e. I have read elsewhere that I can create a calendar only when using the sync adapter. Now, how can I delete the calendar? I expect the URI must also contain the sync adapter info, and the \u003ccode\u003e_ID\u003c/code\u003e of the deleted calendar. I tried the following code, but I was unsuccessful:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate void deleteCalendarTest()\n{\n Uri.Builder builder = Calendars.CONTENT_URI.buildUpon();\n builder.appendPath(\"6\") // here for testing; I know the calender has this ID\n .appendQueryParameter(android.provider.CalendarContract.CALLER_IS_SYNCADAPTER, \"true\")\n .appendQueryParameter(Calendars.ACCOUNT_NAME, \"private\")\n .appendQueryParameter(Calendars.ACCOUNT_TYPE, CalendarContract.ACCOUNT_TYPE_LOCAL);\n\n Uri uri = builder.build();\n\n getContentResolver().delete(uri, null, null);\n Toast.makeText(this, \"??? deleteCalendarTest() not working\", Toast.LENGTH_SHORT).show();\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow can I fix it?\u003c/p\u003e","accepted_answer_id":"30759040","answer_count":"1","comment_count":"3","creation_date":"2014-07-21 13:43:24.107 UTC","favorite_count":"1","last_activity_date":"2015-06-10 14:17:11.157 UTC","last_edit_date":"2014-07-22 14:02:37.53 UTC","last_editor_display_name":"","last_editor_user_id":"1346705","owner_display_name":"","owner_user_id":"1346705","post_type_id":"1","score":"5","tags":"android|android-calendar","view_count":"1307"} +{"id":"1477144","title":"Compile Matplotlib for Python on Snow Leopard","body":"\u003cp\u003eI've killed half a day trying to compile matplotlib for python on Snow Leopard. I've used the googles and found this helpful page (\u003ca href=\"http://blog.hyperjeff.net/?p=160\" rel=\"noreferrer\"\u003ehttp://blog.hyperjeff.net/?p=160\u003c/a\u003e) but I still can't get it to compile. I see comments from other users on that page, so I know I'm not alone.\u003c/p\u003e\n\n\u003cp\u003eI already installed zlib, libpng and freetype independently.\u003c/p\u003e\n\n\u003cp\u003eI edited the make.osx file to contain this at the top:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ePREFIX=/usr/local\n\nPYVERSION=2.6\nPYTHON=python${PYVERSION}\nZLIBVERSION=1.2.3\nPNGVERSION=1.2.33\nFREETYPEVERSION=2.3.5\nMACOSX_DEPLOYMENT_TARGET=10.6\n\n## You shouldn't need to configure past this point\n\nPKG_CONFIG_PATH=\"${PREFIX}/lib/pkgconfig\"\nCFLAGS=\"-Os -arch x86_64 -arch i386 -I${PREFIX}/include\"\nLDFLAGS=\"-arch x86_64 -arch i386 -L${PREFIX}/lib\"\nCFLAGS_DEPS=\"-arch i386 -arch x86_64 -I${PREFIX}/include -I${PREFIX}/include/freetype2 -isysroot /Developer/SDKs/MacOSX10.6.sdk\"\nLDFLAGS_DEPS=\"-arch i386 -arch x86_64 -L${PREFIX}/lib -syslibroot,/Developer/SDKs/MacOSX10.6.sdk\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI then run:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esudo make -f make.osx mpl_build\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhich gives me:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eexport PKG_CONFIG_PATH=\"/usr/local/lib/pkgconfig\" \u0026amp;\u0026amp;\\\n export MACOSX_DEPLOYMENT_TARGET=10.6 \u0026amp;\u0026amp;\\\n export CFLAGS=\"-Os -arch x86_64 -arch i386 -I/usr/local/include\" \u0026amp;\u0026amp;\\\n export LDFLAGS=\"-arch x86_64 -arch i386 -L/usr/local/lib\" \u0026amp;\u0026amp;\\\n python2.6 setup.py build\n\n... snip ...\n\ngcc-4.2 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -Os -arch x86_64 -arch i386 -I/usr/local/include -pipe -DPY_ARRAYAUNIQUE_SYMBOL=MPL_ARRAY_API -I/Library/Python/2.6/site-packages/numpy/core/include -I. -I/Library/Python/2.6/site-packages/numpy/core/include/freetype2 -I./freetype2 -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c src/ft2font.cpp -o build/temp.macosx-10.6-universal-2.6/src/ft2font.o\ncc1plus: warning: command line option \"-Wstrict-prototypes\" is valid for C/ObjC but not for C++\nIn file included from src/ft2font.h:13,\n from src/ft2font.cpp:1:\n/usr/local/include/ft2build.h:56:38: error: freetype/config/ftheader.h: No such file or directory\n\n... snip ...\n\nsrc/ft2font.cpp:98: error: ‘FT_Int’ was not declared in this scope\n/Library/Python/2.6/site-packages/numpy/core/include/numpy/__multiarray_api.h:1174: warning: ‘int _import_array()’ defined but not used\nlipo: can't open input file: /var/tmp//ccDOGx37.out (No such file or directory)\nerror: command 'gcc-4.2' failed with exit status 1\nmake: *** [mpl_build] Error 1\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm just lost.\u003c/p\u003e","accepted_answer_id":"1477394","answer_count":"7","comment_count":"1","creation_date":"2009-09-25 12:56:40.887 UTC","favorite_count":"14","last_activity_date":"2013-04-17 20:51:33.177 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"148621","post_type_id":"1","score":"20","tags":"python|osx-snow-leopard|numpy|compilation|matplotlib","view_count":"9799"} +{"id":"2732637","title":"Does an HttpHandler require an aspnet_isapi.dll mapping","body":"\u003cp\u003eIf I configure (via web.config) an httphandler to handle all .gif requests for a specific folder, is it absolutely essential for me to map .gif requests to aspnet_isapi.dll in IIS?\u003c/p\u003e\n\n\u003cp\u003eIs there any other way of ensuring that the .gif http request will be handled by aspnet_isapi.dll?\u003c/p\u003e\n\n\u003cp\u003eI have a server configured where the virtual dir that contained the .gif-\u003easpnet_isapi.dll mapping has been deleted, but the .gif requests are still being passed to the handler. Anyone know how this might be being done, and where the setting might be lurking?\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","accepted_answer_id":"2732717","answer_count":"1","comment_count":"3","creation_date":"2010-04-28 19:46:36.017 UTC","last_activity_date":"2010-04-28 20:03:34.043 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"187182","post_type_id":"1","score":"0","tags":"asp.net|iis|httphandler|web-config","view_count":"1255"} +{"id":"35586991","title":"Handle Twitter / Facebook Authentication in App","body":"\u003cp\u003eI want users of my app to be able to authenticate with Twitter and Facebook. This way I know they are a real user. Once they've authenticated once I don't want to have to worry about them logging out or re-authenticating unless they explicitly do so.\u003c/p\u003e\n\n\u003cp\u003eI'm storing/displaying the users avatar image. How might I handle if the user were to update this on their given platform? My stored image URL will now be out of date correct? User would essentially have to logoff and re-authenticate in order to have their data updated which isn't ideal...\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2016-02-23 19:57:41.2 UTC","last_activity_date":"2016-02-23 19:57:41.2 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"20446","post_type_id":"1","score":"0","tags":"facebook|facebook-graph-api|twitter","view_count":"22"} +{"id":"15072736","title":"Extracting a region from an image using slicing in Python, OpenCV","body":"\u003cp\u003eI have an image and I want to extract a region from it. I have coordinates of left upper corner and right lower corner of this region. In gray scale I do it like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eI = cv2.imread(\"lena.png\")\nI = cv2.cvtColor(I, cv2.COLOR_RGB2GRAY)\nregion = I[248:280,245:288]\ntools.show_1_image_pylab(region)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI can't figure it out how to do it in color. I thought of extracting each channel R, G, B; slicing this region from each of the channels and to merge them back together but there is gotta be a shorter way. \u003c/p\u003e","accepted_answer_id":"15074748","answer_count":"2","comment_count":"8","creation_date":"2013-02-25 17:26:20.953 UTC","favorite_count":"23","last_activity_date":"2016-10-09 13:05:16.117 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"957375","post_type_id":"1","score":"31","tags":"python|opencv|image-processing","view_count":"26820"} +{"id":"30651529","title":"Wordpress URL - Sessions, Cookies or GET using different Custom Post Types","body":"\u003cp\u003eProjetct of Advertisement System\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eCustom Post Types:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eStates/Cities - localhost/category/state/city\u003c/li\u003e\n\u003cli\u003eCoupons - localhost/site/coupons/post-name\u003c/li\u003e\n\u003cli\u003eAds - localhost/site/ads/post-name\u003c/li\u003e\n\u003cli\u003eEnterprises - localhost/site/enterprises/post-name\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003chr\u003e\n\n\u003cp\u003eUsers use a select to choose state and city (it's required).\u003c/p\u003e\n\n\u003cp\u003eSo, they are redirected to a page url like: \u003ca href=\"http://localhost/sp/jundiai/\" rel=\"nofollow\"\u003ehttp://localhost/sp/jundiai/\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThis page is a subcategory. City(Jundiaí) is children of State (SP).\u003c/p\u003e\n\n\u003cp\u003eCoupons, Ads and Enterprises can be from any city.\nBut, when I access an enterprise for example, I got this URL: \u003ca href=\"http://localhost/site/enterprises/post-name\" rel=\"nofollow\"\u003ehttp://localhost/site/enterprises/post-name\u003c/a\u003e. Ok but. The Loop of this page, should know that the user is at the city he choose before in the select.\u003c/p\u003e\n\n\u003cp\u003eI thought to use JS/HTML5 LocalStorage to set two values, then return them into PHP. But seems not possible.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elocalStorage.setItem('state','value');\nlocalStorage.setItem('city','value');\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo in the loop of Coupons / Ads / Enterprise, I could use these values to make de wp-query.\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003e\u003cstrong\u003eWhat I need is:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eA way using sessions, cookies, localstorage or anything to \"record\" the state/city values and pass them to the queries.\nAnd if user changes city, theses values also changes.\u003c/p\u003e\n\n\u003cp\u003eAny ideas?\nThanks!\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2015-06-04 18:33:58.407 UTC","favorite_count":"1","last_activity_date":"2015-06-04 18:39:09.203 UTC","last_edit_date":"2015-06-04 18:39:09.203 UTC","last_editor_display_name":"","last_editor_user_id":"4971280","owner_display_name":"","owner_user_id":"4971280","post_type_id":"1","score":"1","tags":"php|wordpress|session|cookies|custom-post-type","view_count":"118"} +{"id":"43390697","title":"Python 3: creating a dictionary/ adding values to a nested dictionary","body":"\u003cp\u003ethanks for help in advance!\u003c/p\u003e\n\n\u003cp\u003eI try to simplify my problem:\nI have a nested dict looking like:\nafter that I wrote a for loop to calculate a ratio of the nested dict values\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ed={'a' :{ '1990': 10, '1991':20, '1992':30},'b':{ '1990':15, '1991':40, '1992':50}}\nfor key in d:\n rate = d[key]['1990']/d[key]['1992']\n print(rate)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003enow I would like to create a new key value pair for each nested dict, so that in the end it looks like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ed = {'a' :{ '1990': 10, '1991':20, '1992':30, 'rate':0.33333},'b':{ '1990':15, '1991':40, '1992':50, 'rate':0.3}}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eor creating a new dict looking like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ed2 = {'a':{'rate':0.3333}, 'b':{'rate':0.3}}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eplease help with the solution easiest for you, I think adding to the existing dict would be better?\u003c/p\u003e\n\n\u003cp\u003ethank you!\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2017-04-13 11:10:37.067 UTC","last_activity_date":"2017-04-13 11:26:13.467 UTC","last_edit_date":"2017-04-13 11:15:07.167 UTC","last_editor_display_name":"","last_editor_user_id":"283649","owner_display_name":"","owner_user_id":"7861519","post_type_id":"1","score":"0","tags":"python|dictionary|nested","view_count":"118"} +{"id":"15503734","title":"Alternative to using LinkedQueue?","body":"\u003cp\u003eI was wondering which is the best alternative to using \u003ccode\u003eEDU.oswego.cs.dl.util.concurrent.LinkedQueue\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eIn the following situation:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class testQueue extends LinkedQueue implements TestInterface {\n\npublic void putTestObject (TestObject to) {\n put(to);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eShould I be using \u003ccode\u003eLinkedBlockingQueue\u003c/code\u003e or \u003ccode\u003eLinkedTransferQueue\u003c/code\u003e? \u003c/p\u003e\n\n\u003cp\u003eI am only using the \u003ccode\u003eput()\u003c/code\u003e, \u003ccode\u003etake()\u003c/code\u003e, and \u003ccode\u003eisEmpty()\u003c/code\u003e methods\u003c/p\u003e","answer_count":"2","comment_count":"2","creation_date":"2013-03-19 15:32:03.227 UTC","favorite_count":"0","last_activity_date":"2013-03-19 15:49:55.563 UTC","last_edit_date":"2013-03-19 15:43:45.4 UTC","last_editor_display_name":"","last_editor_user_id":"40342","owner_display_name":"","owner_user_id":"1833969","post_type_id":"1","score":"2","tags":"java|concurrency|queue","view_count":"238"} +{"id":"27730805","title":"Android, Xamarin, Rest - how to pass object in the request","body":"\u003cp\u003eI have a simple server rest endpoint running Spring - \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@RestController\n@RequestMapping(\"/services\")\n@Transactional\npublic class CustomerSignInService {\n\n @Autowired\n private CustomerDAO customerDao;\n\n @RequestMapping(\"/customer/signin\")\n public Customer customerSignIn(@RequestParam(value = \"customer\") Customer customer) {\n //Some Code Here...\n return customer;\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm trying to pass a Customer object from my Xamarin Android App using this method -\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic JsonValue send(String url, SmartJsonSerializer obj)\n{\n HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(new Uri(url));\n request.ContentType = \"application/json\";\n request.Method = \"POST\";\n\n using (var streamWriter = new StreamWriter(request.GetRequestStream()))\n {\n streamWriter.Write(obj.toJsonString());\n }\n\n using (WebResponse response = request.GetResponse())\n {\n using (Stream stream = response.GetResponseStream())\n {\n return JsonObject.Load(stream);\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut i keep getting Bad Request Exception (Http Error 400) and obviously my code at the server side is not triggered.\u003c/p\u003e\n\n\u003cp\u003eSmartJsonSerializer uses JSON.NET to serialize the Customer object to string - \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eusing System;\nusing Newtonsoft.Json;\n\nnamespace Shared\n{\n public class SmartJsonSerializer\n { \n public string toJson()\n {\n return JsonConvert.SerializeObject(this);\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny help appreciated,\nthnx!\u003c/p\u003e","accepted_answer_id":"27752090","answer_count":"2","comment_count":"0","creation_date":"2015-01-01 12:28:37.79 UTC","last_activity_date":"2015-01-22 10:05:56.62 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2851619","post_type_id":"1","score":"0","tags":"android|spring|rest|xamarin","view_count":"888"} +{"id":"46819346","title":"Delphi android java path error","body":"\u003cp\u003eI have a problem which is this:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/uZucW.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/uZucW.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eIt's different from \u003ca href=\"https://stackoverflow.com/questions/41939719/delphi-path-error-on-android-compiler\"\u003ethis\u003c/a\u003e. Delphi was working fine but then I removed the jdk 1.8.0 and I have installed the jdk 1.9.0 because I have to work with IntelliJ IDEA (Java).\u003c/p\u003e\n\n\u003cp\u003eDelphi (android) is not working anymore because I've removed ( = uninstalled) the 1.8.0 jdk. How do I fix the problem? How can I tell Delphi to use the new 1.9.0 JDK?\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003eI am using Delphi Tokyo. I have edited the windows \u003ccode\u003ePATH\u003c/code\u003e variable adding the path to the jdk (C:\\Program Files\\Java\\jdk-9.0.1) but it's not working.\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2017-10-18 21:13:55.237 UTC","last_activity_date":"2017-10-18 21:13:55.237 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2498840","post_type_id":"1","score":"0","tags":"delphi","view_count":"60"} +{"id":"38213526","title":"No nodes connecting to host in docker swarm","body":"\u003cp\u003eI just followed this tutorial step by step for setting up a docker swarm in EC2 -- \u003ca href=\"https://docs.docker.com/swarm/install-manual/\" rel=\"nofollow noreferrer\"\u003ehttps://docs.docker.com/swarm/install-manual/\u003c/a\u003e \u003c/p\u003e\n\n\u003cp\u003eI created 4 Amazon Servers using the Amazon Linux AMI. \u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003emanager + consul \u003c/li\u003e\n\u003cli\u003emanager \u003c/li\u003e\n\u003cli\u003enode1\u003c/li\u003e\n\u003cli\u003enode2 \u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eI followed the instructions to start the swarm and everything seems to go ok regarding making the docker instances. \u003c/p\u003e\n\n\u003ch3\u003eServer 1\u003c/h3\u003e\n\n\u003cp\u003eRunning \u003ccode\u003edocker ps\u003c/code\u003e gives:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/18vSq.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/18vSq.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThe Consul logs show this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e2016/07/05 20:18:47 [INFO] serf: EventMemberJoin: 729a440e5d0d 172.17.0.2\n2016/07/05 20:18:47 [INFO] serf: EventMemberJoin: 729a440e5d0d.dc1 172.17.0.2\n2016/07/05 20:18:48 [INFO] raft: Node at 172.17.0.2:8300 [Follower] entering Follower state\n2016/07/05 20:18:48 [INFO] consul: adding server 729a440e5d0d (Addr: 172.17.0.2:8300) (DC: dc1)\n2016/07/05 20:18:48 [INFO] consul: adding server 729a440e5d0d.dc1 (Addr: 172.17.0.2:8300) (DC: dc1)\n2016/07/05 20:18:48 [ERR] agent: failed to sync remote state: No cluster leader\n2016/07/05 20:18:49 [WARN] raft: Heartbeat timeout reached, starting election\n2016/07/05 20:18:49 [INFO] raft: Node at 172.17.0.2:8300 [Candidate] entering Candidate state\n2016/07/05 20:18:49 [INFO] raft: Election won. Tally: 1\n2016/07/05 20:18:49 [INFO] raft: Node at 172.17.0.2:8300 [Leader] entering Leader state\n2016/07/05 20:18:49 [INFO] consul: cluster leadership acquired\n2016/07/05 20:18:49 [INFO] consul: New leader elected: 729a440e5d0d\n2016/07/05 20:18:49 [INFO] raft: Disabling EnableSingleNode (bootstrap)\n2016/07/05 20:18:49 [INFO] consul: member '729a440e5d0d' joined, marking health alive\n2016/07/05 20:18:50 [INFO] agent: Synced service 'consul'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI registered each node using the following command with appropriate IP's\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edocker run -d swarm join --advertise=x-x-x-x:2375 consul://x-x-x-x:8500\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eEach of those created a docker instance\u003c/p\u003e\n\n\u003ch3\u003eNode1\u003c/h3\u003e\n\n\u003cp\u003eRunning \u003ccode\u003edocker ps\u003c/code\u003e gives:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/x2ivn.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/x2ivn.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eWith logs that suggest there's a problem: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etime=\"2016-07-05T21:33:50Z\" level=info msg=\"Registering on the discovery service every 1m0s...\" addr=\"172.31.17.35:2375\" discovery=\"consul://172.31.3.233:8500\" \ntime=\"2016-07-05T21:36:20Z\" level=error msg=\"cannot set or renew session for ttl, unable to operate on sessions\" \ntime=\"2016-07-05T21:37:20Z\" level=info msg=\"Registering on the discovery service every 1m0s...\" addr=\"172.31.17.35:2375\" discovery=\"consul://172.31.3.233:8500\" \ntime=\"2016-07-05T21:39:50Z\" level=error msg=\"cannot set or renew session for ttl, unable to operate on sessions\" \ntime=\"2016-07-05T21:40:50Z\" level=info msg=\"Registering on the discovery service every 1m0s...\" addr=\"172.31.17.35:2375\" discovery=\"consul://172.31.3.233:8500\" \n...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd lastly when I get to the last step of trying to get host information like so on my Consul machine, \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edocker -H :4000 info\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI see no nodes. Lastly when I try the step of running an app, I get the obvious error: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[ec2-user@ip-172-31-3-233 ~]$ docker -H :4000 run hello-world\ndocker: Error response from daemon: No healthy node available in the cluster.\nSee 'docker run --help'.\n[ec2-user@ip-172-31-3-233 ~]$ \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks for any insight on this. I'm still pretty confused by much of the swarm model and not sure where to go from here to diagnose. \u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2016-07-05 22:01:03 UTC","last_activity_date":"2016-07-11 08:16:31.513 UTC","last_edit_date":"2016-07-11 08:16:31.513 UTC","last_editor_display_name":"","last_editor_user_id":"92463","owner_display_name":"","owner_user_id":"377044","post_type_id":"1","score":"0","tags":"docker|docker-swarm","view_count":"564"} +{"id":"36928089","title":"JavaCPP problems compiling the example Callback function","body":"\u003cp\u003eI just wanted to test Callback function example from the webpage.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://github.com/bytedeco/javacpp#creating-callback-functions\" rel=\"nofollow\"\u003ehttps://github.com/bytedeco/javacpp#creating-callback-functions\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eIn file foo.cpp\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;iostream\u0026gt;\n#include \"jniFoo.h\"\n\nint main() {\n JavaCPP_init(0, NULL);\n try {\n foo(6, 7);\n } catch (std::exception \u0026amp;e) {\n std::cout \u0026lt;\u0026lt; e.what() \u0026lt;\u0026lt; std::endl;\n }\n JavaCPP_uninit();\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFoo.java where function foo performs\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport org.bytedeco.javacpp.*;\nimport org.bytedeco.javacpp.annotation.*;\n\n@Platform(include=\"\u0026lt;algorithm\u0026gt;\")\n@Namespace(\"std\")\npublic class Foo {\n static { Loader.load(); }\n\n public static class Callback extends FunctionPointer {\n // Loader.load() and allocate() are required only when explicitly creating an instance\n static { Loader.load(); }\n protected Callback() { allocate(); }\n private native void allocate();\n\n public @Name(\"foo\") boolean call(int a, int b) throws Exception { \n throw new Exception(\"bar \" + a * b);\n }\n }\n\n // We can also pass (or get) a FunctionPointer as argument to (or return value from) other functions\n public static native void stable_sort(IntPointer first, IntPointer last, Callback compare);\n\n // And to pass (or get) it as a C++ function object, annotate with @ByVal or @ByRef\n public static native void sort(IntPointer first, IntPointer last, @ByVal Callback compare);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBuilding and running this sample code with these commands under Linux x86_64:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ejavac -cp javacpp.jar Foo.java\njava -jar javacpp.jar Foo -header\ng++ -I/usr/lib/jvm/java-8-oracle/include/ -I/usr/lib/jvm/java-8-oracle/include/linux/ linux-x86_64/libjniFoo.so foo.cpp -o Foo\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn the third command, I got error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e/tmp/ccvrmILI.o: In function `main':\nfoo.cpp:(.text+0x14): undefined reference to `JavaCPP_init'\nfoo.cpp:(.text+0x1e): undefined reference to `onAddTwoInteger'\nfoo.cpp:(.text+0x23): undefined reference to `JavaCPP_uninit'\ncollect2: error: ld returned 1 exit status \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhy do I get it?\u003c/p\u003e","accepted_answer_id":"36952691","answer_count":"1","comment_count":"0","creation_date":"2016-04-29 01:29:16.677 UTC","last_activity_date":"2016-04-30 08:36:47.76 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5805857","post_type_id":"1","score":"1","tags":"jni|javacpp","view_count":"103"} +{"id":"14584709","title":"Close JDialog from JavaFx Button","body":"\u003cp\u003eI need to close my JDialog from JavaFx Button defined in my FXML file.\nI post code of my class called by Main Application:\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eExampleWindow.java\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class ExampleWindow extends JDialog \n{\n@FXML\nButton closeButton;\n\npublic ExampleWindow()\n{\n}\n\npublic void initAndShowGUI()\n{\n final JFXPanel fxPanel = new JFXPanel();\n add(fxPanel);\n\n Platform.runLater(new Runnable()\n {\n @Override\n public void run()\n {\n AnchorPane parent = null;\n FXMLLoader fxmlLoader = new FXMLLoader();\n\n fxmlLoader.setRoot(this);\n try {\n parent = fxmlLoader.load(getClass().getResource(\"WindowControlPanel.fxml\"));\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n\n scene = new Scene(parent);\n fxPanel.setScene(scene);\n }\n });\n}\n\npublic void onAction(ActionEvent ac)\n{\nthis.dispose();\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e}\u003c/p\u003e\n\n\u003cp\u003eMethod onAction is called by JavaFx Button (on FXML file)\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eWindowControlPanel.fxml\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;AnchorPane id=\"AnchorPane\" fx:id=\"windowPanel\" maxHeight=\"-Infinity\" maxWidth=\"-Infinity\" minHeight=\"-Infinity\" minWidth=\"-Infinity\" prefHeight=\"50.0\" prefWidth=\"1024.0\" style=\"-fx-border-color: white, grey; -fx-border-width: 2, 1; -fx-border-insets: 0, 0 1 1 0\" xmlns:fx=\"http://javafx.com/fxml\" fx:controller=\"ExampleWindow\"\u0026gt;\n\u0026lt;children\u0026gt;\n\u0026lt;FlowPane alignment=\"CENTER_RIGHT\" columnHalignment=\"CENTER\" prefHeight=\"50.0\" prefWidth=\"1024.0\" AnchorPane.bottomAnchor=\"0.0\" AnchorPane.leftAnchor=\"0.0\" AnchorPane.rightAnchor=\"0.0\" AnchorPane.topAnchor=\"0.0\"\u0026gt;\n \u0026lt;children\u0026gt;\n \u0026lt;Button fx:id=\"closeButton\" mnemonicParsing=\"false\" onAction=\"#onAction\" prefHeight=\"35.0\" prefWidth=\"100.0\" text=\"Close\"\u0026gt;\n \u0026lt;FlowPane.margin\u0026gt;\n \u0026lt;Insets bottom=\"5.0\" left=\"20.0\" right=\"20.0\" top=\"5.0\" /\u0026gt;\n \u0026lt;/FlowPane.margin\u0026gt;\n \u0026lt;/Button\u0026gt;\n \u0026lt;/children\u0026gt;\n\u0026lt;/FlowPane\u0026gt;\n\u0026lt;/children\u0026gt;\n\u0026lt;/AnchorPane\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I pressed closeButton, method onAction is correctly called, but my JDialog doesn't close. Any ideas? Where am I wrong?\u003c/p\u003e","answer_count":"0","comment_count":"6","creation_date":"2013-01-29 13:59:34.513 UTC","last_activity_date":"2013-11-09 14:57:24.233 UTC","last_edit_date":"2013-11-09 14:57:24.233 UTC","last_editor_display_name":"","last_editor_user_id":"759866","owner_display_name":"","owner_user_id":"1131641","post_type_id":"1","score":"1","tags":"java|swing|javafx-2","view_count":"393"} +{"id":"44900125","title":"Insert \"-\" in the name of all files in a folder at position 4 and 6","body":"\u003cp\u003eI got a bunch of PDFs in a folder which must be renamed. They are all built like this: \u003ccode\u003eYYYYMMDD_Text.pdf\u003c/code\u003e. The system is Windows\u0026nbsp;7.\u003c/p\u003e\n\n\u003cp\u003eI want to insert a \u003ccode\u003e-\u003c/code\u003e between the dates, so the documents look like:\n\u003ccode\u003eYYYY-MM-DD_Text.pdf\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eThis is what I got, but it's not working and I searched a dozen threads but could not find the solution:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Ordner = \"C:\\xte Stelle\\Test Doku\"\n\n Set fso = CreateObject(\"Scripting.FileSystemObject\")\n Set Fld = fso.GetFolder(Ordner)\n\n For i = 0 To UBound(Arr)\n WScript.Echo i \u0026amp; vbTab \u0026amp; Arr(i)\n Next\n\n For Each File In Folder.Files\n File.Name = Left(File.Name, 4) \u0026amp; \"-\" \u0026amp; Mid(File.Name, 6) \u0026amp; \"-\" \u0026amp; Mid(File.Name, 8)\nEnd Sub\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdit:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eThis is what I got now. I can run it and it does not crash, but does not function either. It simply does nothing. Any idea on that?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eOrdner = \"C:\\xte Stelle\\Test Doku\"\n\nSet fso = CreateObject(\"Scripting.FileSystemObject\")\nSet Fld = fso.GetFolder(Ordner)\n\nSub test\n For Each File In Fld.Files\n File.Name = Left(File.Name, 4) \u0026amp; \"-\" \u0026amp; Mid(File.Name, 5, 2) \u0026amp; \"-\" \u0026amp; Mid(File.Name, 7)\n Next\nEnd Sub\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"44900838","answer_count":"1","comment_count":"2","creation_date":"2017-07-04 07:55:17.287 UTC","last_activity_date":"2017-07-05 08:20:09.427 UTC","last_edit_date":"2017-07-04 10:17:49.39 UTC","last_editor_display_name":"","last_editor_user_id":"1630171","owner_display_name":"","owner_user_id":"7750413","post_type_id":"1","score":"0","tags":"windows|vbscript|rename","view_count":"51"} +{"id":"23222721","title":"Differences between Sphinx local and readthedocs.org","body":"\u003cp\u003eI have created a set of documentation for my \u003ccode\u003eDjango\u003c/code\u003e app using \u003ccode\u003eSphinx\u003c/code\u003e. I use \u003ccode\u003ereadthedocs.org\u003c/code\u003e to create a public version of that documentation. This works well but for one oddity. On \u003ccode\u003ereadthedocs.org\u003c/code\u003e some of my documentation generates differently from a local build. For example for my \u003ccode\u003emodels.py\u003c/code\u003e I created \u003ccode\u003emodels.rst\u003c/code\u003e, which looks like this: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eModels\n======\n\n.. automodule:: my_app.models\n\nAgents\n------\n\nAgent\n`````\n.. autoclass:: Agent\n :members:\n\netc...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFor a local build this creates a document with model names as titles, their docstring and their members with docstrings where a \u003ccode\u003e#: comment...\u003c/code\u003e was added.\u003c/p\u003e\n\n\u003cp\u003eHowever on \u003ccode\u003ereadthedocs.org\u003c/code\u003e only a title entry for each model is generated and nothing more.\u003c/p\u003e\n\n\u003cp\u003eIt appears as if \u003ccode\u003ereadthedocs.org\u003c/code\u003e ignores the \u003ccode\u003eautomodule\u003c/code\u003e and \u003ccode\u003eautoclass\u003c/code\u003e directives.\u003c/p\u003e\n\n\u003cp\u003eInitially I thought this was caused by the difference in theme (I use the \u003ccode\u003ebootstrap\u003c/code\u003e theme locally and the \u003ccode\u003ereadthedocs\u003c/code\u003e theme on \u003ccode\u003ereadthedocs.org\u003c/code\u003e), but after setting up a \u003ccode\u003evirtualenv\u003c/code\u003e on \u003ccode\u003ereadthedocs.org\u003c/code\u003e and using the \u003ccode\u003ebootstrap\u003c/code\u003e theme there as well, nothing changed. The build completes, but documentation for my models remains absent.\u003c/p\u003e\n\n\u003cp\u003eLocally I use \u003ccode\u003eSphinx 1.2.2\u003c/code\u003e. I'm not sure which version is used on readthedocs.org but I presume a 1.2.x release.\u003c/p\u003e\n\n\u003cp\u003eAny ideas on what might cause this?\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2014-04-22 14:40:28.797 UTC","favorite_count":"2","last_activity_date":"2014-04-22 14:57:08.04 UTC","last_edit_date":"2014-04-22 14:57:08.04 UTC","last_editor_display_name":"","last_editor_user_id":"407651","owner_display_name":"","owner_user_id":"942534","post_type_id":"1","score":"3","tags":"python-sphinx","view_count":"178"} +{"id":"23840151","title":"Cloud performance vs Desktop","body":"\u003cp\u003eI have developed an app to analyze videos using OpenCV and Visual Studio 2013. I was planning to run this app in the Azure assuming that it will run faster in cloud. However, to my surprise, the app ran slower than my desktop, taking about twice the time when I configured the Azure instance with 8 cores. It is a 64-bit app, compiled with appropriate compiler optimization. Can someone help me understand why am I losing time in the cloud, and is there a way to improve the timing there?\u003c/p\u003e\n\n\u003cp\u003eThe app takes as input a video (locally in each case) and outputs a flat file with the analysis data.\u003c/p\u003e\n\n\u003cp\u003eI am not sure why people are voting to close this question. This is very much about programming and if possible, please help me in pinpointing the problem.\u003c/p\u003e","answer_count":"1","comment_count":"6","creation_date":"2014-05-24 00:43:14.507 UTC","last_activity_date":"2014-05-24 03:23:47.057 UTC","last_edit_date":"2014-05-24 02:14:10.363 UTC","last_editor_display_name":"","last_editor_user_id":"1202400","owner_display_name":"","owner_user_id":"1202400","post_type_id":"1","score":"3","tags":"performance|opencv|azure|visual-studio-2013","view_count":"121"} +{"id":"18024073","title":"Create Trac ticket from Google Form GAS script?","body":"\u003cp\u003eThis is a followup question to my original question \u003ca href=\"https://stackoverflow.com/questions/17950617/is-there-a-simple-bugzilla-trac-client-for-use-by-non-software-folks\"\u003ehere\u003c/a\u003e. The decision between Bugzilla \u0026amp; Trac seems to have been made for us, and Trac it is. Here are the options I've found so far: \u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003cp\u003eLeverage our current Google Form based bug report by modifying the GAS script that is doing our email notification. So far I've been unable to find an example, but it would appear that you can modify the email portion of the GAS script to send email to the Trac server to open a ticket automatically. This is my preferred option, but I'd like to see an example if possible. \u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eCreate something using \u003ca href=\"http://trac-hacks.org/wiki/TracCmdScript\" rel=\"nofollow noreferrer\"\u003eTracCmdScript\u003c/a\u003e, but the site hasn't been updated in three years, and it appears to use python, a language I'm not proficient at (although I'd like to be) and the \u003ca href=\"http://trac-hacks.org/wiki/XmlRpcPlugin\" rel=\"nofollow noreferrer\"\u003eXmlRpcPlugin\u003c/a\u003e, which seems to be under current development.\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eThere's also an email option website cited on this SO page to use \u003ca href=\"https://stackoverflow.com/questions/3926554/creating-trac-tickets-from-website\"\u003eemail2trac\u003c/a\u003e, but the cited site appears to be dead. \u003cstrong\u003eEdit\u003c/strong\u003e: here's the new site: \u003ca href=\"https://oss.trac.surfsara.nl/email2trac/wiki/Email2tracInstallation/Windows\" rel=\"nofollow noreferrer\"\u003eemail2trac\u003c/a\u003e which still hasn't been touched in a couple of years, but seems to be functional.\u003c/p\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eI'm open to any other suggestions the SO folks might have.\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2013-08-02 18:47:40.82 UTC","last_activity_date":"2014-01-15 18:45:16.287 UTC","last_edit_date":"2017-05-23 11:50:13.003 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"811329","post_type_id":"1","score":"1","tags":"google-apps-script|trac|google-form","view_count":"239"} +{"id":"18157227","title":"Bringing up the iPad keyboard which is predominantly symbols","body":"\u003cp\u003eApologies in advance if this is answered but I genuinely couldn't find it. I'm trying to bring up the keyboard type on iPad which appears when pressing the \"#+=\" button. I've tried going through all the types on the docs and I'm sure that this wasn't successful. Am I missing something or does the user have to click this button every time?\u003c/p\u003e\n\n\u003cp\u003eEdit: this question was closed as \"off-topic\" because it didn't include code or ideas or what I've tried already... Therefore for a bit of extra detail, I used EVERY keyboard type that is available on the docs e.g.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etheTextField.keyboardType = UIKeyboardTypeNumberPad;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis did not yield the results that I require, which is the keyboard plane that appears when you press the #+= button because I wanted users to go straight to that one.\u003c/p\u003e","accepted_answer_id":"18349825","answer_count":"2","comment_count":"2","creation_date":"2013-08-09 23:44:09.933 UTC","favorite_count":"1","last_activity_date":"2013-08-24 23:02:03.393 UTC","last_edit_date":"2013-08-23 09:41:18.537 UTC","last_editor_display_name":"","last_editor_user_id":"1301871","owner_display_name":"","owner_user_id":"1301871","post_type_id":"1","score":"4","tags":"objective-c|cocoa","view_count":"220"} +{"id":"23220623","title":"How to create an image pattern for a path with Snap.svg?","body":"\u003cp\u003eFailing to create an image pattern for a path element through \u003ca href=\"http://snapsvg.io/docs/#Element.pattern\" rel=\"nofollow\"\u003eSnap.svg\u003c/a\u003e library. Is it possible?\u003c/p\u003e\n\n\u003cp\u003eCreating a \u003ccode\u003ePaper.image()\u003c/code\u003e and then trying to call \u003ccode\u003eElement.pattern()\u003c/code\u003e on it doesn't seem to be an option or a working solution.\u003c/p\u003e\n\n\u003cp\u003eSo i wonder whether it's possible to do so using Snap.svg lib. or Should i generate the needed , elements myself and then append them to the needed svg 'by hands'?\u003c/p\u003e\n\n\u003cp\u003eThanks in advance!\u003c/p\u003e","accepted_answer_id":"23220828","answer_count":"1","comment_count":"0","creation_date":"2014-04-22 13:10:19.49 UTC","last_activity_date":"2014-04-22 13:18:31.013 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1200683","post_type_id":"1","score":"1","tags":"javascript|svg|snap.svg","view_count":"1860"} +{"id":"8048590","title":"Error with Ruby Exception","body":"\u003cp\u003eI have an array defined like this, \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eresult = [\"true\",\"false\",\"false\",\"false\"]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn my code I iterate through the array and raise an exception when i come across false. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ebegin result.each do |method| \n raise if (method == false) {\n rescue Exception =\u0026gt; Form_Validation_Failure\n puts \"fail!\"\n end } \n end\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThere is an error when i execute the code.Is this is the right way to raise and exception in Ruby? Could somebody help with this please. \u003c/p\u003e\n\n\u003cp\u003eCheers!\u003c/p\u003e","accepted_answer_id":"8048724","answer_count":"2","comment_count":"0","creation_date":"2011-11-08 09:55:16.18 UTC","last_activity_date":"2011-11-08 10:30:13.09 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"861339","post_type_id":"1","score":"0","tags":"ruby|exception","view_count":"107"} +{"id":"41087835","title":"Ng-Change Not firing second time","body":"\u003cp\u003eI have the following select:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;div class=\"form-group\"\u0026gt;\n \u0026lt;label class=\"col-md-4 control-label\" for=\"activity\"\u0026gt;Activity\u0026lt;/label\u0026gt;\n \u0026lt;div class=\"col-md-4\"\u0026gt;\n \u0026lt;select id=\"activity\" name=\"activity\" class=\"inputsvalues\" ng-model=\"activitymodel.deptid\" ng-change=\"getUsers(activitymodel.deptid)\" ng-options=\"activity.DepartmentId as activity.ActivityDescription for activity in activities\"\u0026gt;\u0026lt;/select\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe controller code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e $scope.getUsers = function (id) {\n\n $http({\n method: 'GET',\n url: 'api/User/GetUsers/' + id,\n\n\n }).success(function (data, status, header) {\n $scope.users = data;\n\n }).error(function (data, status, headers, config) {\n $scope.status = status + ' ' + headers;\n });\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe problem is that the ng-change function gets fired the first timeI select something. Second time onwards, it doesnt hit the controller. What could be wrong here?\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2016-12-11 15:31:10.34 UTC","last_activity_date":"2017-06-12 10:07:53.337 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6662109","post_type_id":"1","score":"1","tags":"angularjs|angularjs-ng-change","view_count":"276"} +{"id":"17613814","title":"BlackBerry - Create image viewer","body":"\u003cp\u003eI need to create an image slideshow in my app (\u003cem\u003ei.e.\u003c/em\u003e the image should be changed at a regular interval of time with a fade in / fade out effect). I have tried some code, but it throws illegal exception.\u003c/p\u003e\n\n\u003cp\u003eIs there any option to change images in picture scroll field programatically? \u003cem\u003ei.e.\u003c/em\u003e from a thread or something?\u003c/p\u003e\n\n\n\n\u003cpre class=\"lang-java prettyprint-override\"\u003e\u003ccode\u003epublic class SlideTransition extends MainScreen {\n\n final Bitmap image000 = Bitmap.getBitmapResource(\"img1.jpg\");\n final Bitmap image001 = Bitmap.getBitmapResource(\"img2.jpg\");\n final Bitmap image002 = Bitmap.getBitmapResource(\"img3.jpg\");\n\n final BitmapField animationField = new BitmapField(image000);\n int counter = 0;\n Timer animationTimer = new Timer();\n TimerTask animationTask;\n\n public SlideTransition() {\n animationTask = new TimerTask() {\n\n public void run() {\n if (counter == 0) {\n\n animationField.setBitmap(image000);\n }\n\n if (counter == 1) {\n animationField.setBitmap(image001);\n }\n if (counter == 2) {\n animationField.setBitmap(image002);\n counter = -1;\n }\n counter++;\n }\n };\n animationTimer.scheduleAtFixedRate(animationTask, 0, 100);\n add(animationField);\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"17628520","answer_count":"1","comment_count":"5","creation_date":"2013-07-12 11:21:32.687 UTC","last_activity_date":"2013-07-13 21:20:23.183 UTC","last_edit_date":"2013-07-13 21:14:24.793 UTC","last_editor_display_name":"","last_editor_user_id":"119114","owner_display_name":"","owner_user_id":"790928","post_type_id":"1","score":"1","tags":"blackberry|blackberry-eclipse-plugin","view_count":"141"} +{"id":"25722843","title":"Android IMAGE_CAPTURE always returns Activity.RESULT_CANCELED","body":"\u003cp\u003eI want to take a photo in my app. On the emulator everything works fine.\nBut on the tablet, the Intent immediately returns Activity.RESULT_CANCELED in onActivityResult. The picture is saved on the SD Card. \u003c/p\u003e\n\n\u003cp\u003eHere is the code for taking picture:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eIntent intent = new Intent(\"android.media.action.IMAGE_CAPTURE\");\nString tmpFile = CommonFunctions.generateRandomFileName() + \".jpg\";\nString fileName = CommonFunctions.getNoticeSavePath() + tmpFile;\nSystem.out.println(\"Filename \" + fileName);\nintent.putExtra(MediaStore.EXTRA_OUTPUT, \nUri.fromFile(new File(fileName)));\nnotice.setBild(tmpFile);\nstartActivityForResult(intent, RESULT_PICTURE);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCode for onActivityResult:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n\n\n switch (requestCode) {\n\n case RESULT_PICTURE:\n System.out.println(\"ResultCode\" + resultCode);\n if (resultCode == Activity.RESULT_OK) {\n\n }\n else if (resultCode == Activity.RESULT_CANCELED){\n notice.setBild(\"\");\n Toast.makeText(getBaseContext(), \"Bild wurde nicht hinzugefügt\", Toast.LENGTH_LONG).show();\n }\n break;\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ePermissions are set:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/\u0026gt;\n\u0026lt;uses-permission android:name=\"android.permission.CAMERA\"/\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe result is always RESULT_CANCELED, but the photo is stored correctly on the sd card.\nWhat could the problem be?\u003c/p\u003e","answer_count":"1","comment_count":"5","creation_date":"2014-09-08 11:05:17.933 UTC","last_activity_date":"2014-10-08 19:54:38.023 UTC","last_edit_date":"2014-09-08 11:42:07.923 UTC","last_editor_display_name":"","last_editor_user_id":"898423","owner_display_name":"","owner_user_id":"598596","post_type_id":"1","score":"0","tags":"android|camera","view_count":"446"} +{"id":"44577622","title":"Lambda data frame reference a value in another column","body":"\u003cp\u003eHow do I correctly reference another column value when using a Lambda in a pandas dataframe. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edfresult_tmp2['Retention_Rolling_temp'] = dfresult_tmp2['Retention_tmp'].apply(lambda x: x if x['Count Billings']/4 \u0026lt; 0.20 else '')\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe above code gives me this error.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eTypeError: 'float' object is not subscriptable\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"44577818","answer_count":"1","comment_count":"0","creation_date":"2017-06-15 21:52:59.963 UTC","last_activity_date":"2017-06-15 22:18:27.117 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2386086","post_type_id":"1","score":"1","tags":"python|pandas|lambda","view_count":"77"} +{"id":"15599918","title":"tracking down AWT exception in Clojure UI app under Leiningen","body":"\u003cp\u003eReferring to this SO \u003ca href=\"https://stackoverflow.com/questions/2792451/improving-my-first-clojure-program\"\u003equestion on a first UI program in Clojure\u003c/a\u003e, I created a new \u003ccode\u003eLeiningen\u003c/code\u003e app project:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elein new app a-ui-app\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ecopied the source into the \u003ccode\u003ecore.clj\u003c/code\u003e that leiningen generated and modified the \u003ccode\u003e-main\u003c/code\u003e routine to call it\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e(defn -main\n \"See https://stackoverflow.com/questions/2792451/improving-my-first-clojure-program?rq=1.\"\n [\u0026amp; args]\n ;; work around dangerous default behaviour in Clojure\n (alter-var-root #'*read-eval* (constantly false))\n\n (doto panel\n (.setFocusable true)\n (.addKeyListener panel))\n\n (doto frame\n (.add panel)\n (.pack)\n (.setDefaultCloseOperation JFrame/EXIT_ON_CLOSE)\n (.setVisible true))\n\n (loop []\n (draw-rectangle panel @x @y)\n (Thread/sleep 10)\n (recur))\n )\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI then run it via either\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elein run\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eor \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elein uberjar\njava -jar ./target/a-ui-app-0.1.0-SNAPSHOT-standalone.jar \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn both cases, the app works well, but in the terminal that I used to start it up, I get an exception after a random delay of several seconds:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eException in thread \"AWT-EventQueue-0\"\n java.lang.IllegalArgumentException: No matching clause: 157 at\n a_ui_app.core$fn__16$fn__21$fn__22.invoke(core.clj:19) at\n clojure.lang.AFn.call(AFn.java:18) at\n clojure.lang.LockingTransaction.run(LockingTransaction.java:263) at\n clojure.lang.LockingTransaction.runInTransaction(LockingTransaction.java:231)\n at a_ui_app.core$fn__16$fn__21.invoke(core.clj:17) at\n a_ui_app.core.proxy$javax.swing.JPanel$KeyListener$6c415903.keyPressed(Unknown\n Source) at java.awt.Component.processKeyEvent(Component.java:6340) at\n javax.swing.JComponent.processKeyEvent(JComponent.java:2809) at\n a_ui_app.core.proxy$javax.swing.JPanel$KeyListener$6c415903.processKeyEvent(Unknown\n Source) at java.awt.Component.processEvent(Component.java:6159) at\n java.awt.Container.processEvent(Container.java:2083) many more\n lines...\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI made no changes to \u003ccode\u003eproject.clj\u003c/code\u003e -- just used the leiningen-generated one.\u003c/p\u003e\n\n\u003cp\u003eI'd like to understand what's going on. I am by no means knowledgeable in Java Threading. Is the problem related to the way leiningen launches the app's Java threads? Is it unavoidable? If not, how can I fix it, both for this little sample program and going forward, as a project pattern for future projects using the UI thread (which I think is \u003ccode\u003eAWT-EventQueue-0\u003c/code\u003e).\u003c/p\u003e","accepted_answer_id":"15602460","answer_count":"1","comment_count":"1","creation_date":"2013-03-24 14:53:20.443 UTC","last_activity_date":"2013-03-25 00:22:52.07 UTC","last_edit_date":"2017-05-23 12:04:56.033 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"520997","post_type_id":"1","score":"3","tags":"clojure|awt|leiningen","view_count":"241"} +{"id":"5451932","title":"Right to left asp.net menu - Help me setup my CSS","body":"\u003cp\u003eCoders, I am trying to style my Asp.net menu control and I have a set of CSS definitions that styles my menu:\nHere is the CSS:\u003c/p\u003e\n\n\u003cpre\u003e\n.MainMenu\n{\n\n background: url(\"http://cables.com.sa/en/ddtabmenufiles/media/blockdefault.gif\") repeat-x scroll center center black;\n border-color: #625E00;\n border-style: solid;\n border-width: 1px 0;\n float: right;\n font: bold 13px Arial;\n margin: 0;\n padding: 0;\n width: 100%;\n}\n\n.MainMenu a {\n float: right;\n}\n\n.MainMenu li {\n display: inline;\n float: right;\n}\n\n.MainMenu li a {\n border-right: 1px solid white;\n color: white;\n float: right;\n padding: 9px 11px;\n text-decoration: none;\n}\n\n.MainMenu li a:visited \n{\n color: white;\n}\n\n\n.MainMenu li a:hover, .MainMenu li a.current {\n background: url(\"http://cables.com.sa/en/ddtabmenufiles/media/blockactive.gif\") repeat-x scroll center center transparent;\n color: white;\n}\n\u003c/pre\u003e\n\n\u003cp\u003eAnd here is the Asp.net Masterpage code:\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;asp:Menu ID=\"NavigationMenu\" runat=\"server\" CssClass=\"MainMenu\" EnableViewState=\"False\"\n IncludeStyleBlock=\"False\" Orientation=\"Horizontal\"\u0026gt;\n \u0026lt;Items\u0026gt;\n \u0026lt;asp:MenuItem NavigateUrl=\"~/Default.aspx\" Text=\"Home\" /\u0026gt;\n \u0026lt;asp:MenuItem NavigateUrl=\"~/About.aspx\" Text=\"About\" /\u0026gt;\n \u0026lt;/Items\u0026gt;\n \u0026lt;/asp:Menu\u0026gt; \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eNotice that in the CSS I have setup the floating to be ‘float: right’ because I am using this CSS style for an Arabic menu (ie: text direction: right to left + float: right). But the problem is that my menu items are still showing on the left side.\u003c/p\u003e\n\n\u003cp\u003eMy question is, how do I set my CSS to show my menu items on the left side?\u003c/p\u003e\n\n\u003cp\u003eRemarks: I want my menu items to appear like this website: \nwww.tech-nuke.com\nAnd I am taking my current style from:\n\u003ca href=\"http://cables.com.sa/en/index.php?p=home\" rel=\"nofollow\"\u003ehttp://cables.com.sa/en/index.php?p=home\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThanks in advance.\u003c/p\u003e","answer_count":"4","comment_count":"0","creation_date":"2011-03-27 19:53:06.443 UTC","favorite_count":"1","last_activity_date":"2015-03-21 09:46:54.673 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"485909","post_type_id":"1","score":"0","tags":"asp.net|css|menu","view_count":"5810"} +{"id":"13474897","title":"Select distinct records with Min Date from two tables with Left Join","body":"\u003cp\u003eI'm trying to retrieve all distinct AccountId’s as well as the earliest InsertDate for each. Occasionally the AccountId is not known and although the transactions may be distinct I want to bucket all of the ‘-1’s into their own group. \u003c/p\u003e\n\n\u003cp\u003eThis is what I have attempted so far along with the schemas.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e CREATE TABLE #tmpResults (\n Trans Varchar(12), \n AccountId Varchar(50), \nEarlyDate DateTime DEFAULT getdate(), CardType Varchar(16))\n\ninsert #tmpResults\n select [Trans] = convert(varchar(12),'CashSale')\n , [AccountId] = b.AccountId\n , [EarlyDate] = min(b.InsertDate)\n , case when c.name LIKE '%VISA%' then 'VISA'\n when c.name LIKE '%MasterCard%' then 'MasterCard'\n when c.name LIKE '%AMEX%' then 'AMEX'\n else 'Other'\n end as [CardType] \n from TransBatch b\n left join CardVer_3 c WITH (NOLOCK) ON c.Id = B.BatchId\n left join TransBatch b2\n on (b.accountid = b2.accountid and (b.InsertDate \u0026gt; b2.InsertDate or b.InsertDate = b2.InsertDate))\n and b2.accountid is NULL\n group by b.accountid, b.InsertDate,c.name \n order by b.accountid DESC\n\n select * from #tmpResults\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe table schemas are like so: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e**TransBatch** \nRecordId |BatchId |InsertDate | AccountId | AccNameHolder \n6676 | 11 | 2012-11-01 05:19:04.000 | 12345 | Account1 \n6677 | 11 | 2012-11-01 05:19:04.000 | 12345 | Account1 \n6678 | 11 | 2012-11-01 05:19:04.000 | 55555 | Account2 \n6679 | 11 | 2012-11-01 05:19:04.000 | -1 | NULL \n6680 | 12 | 2012-11-02 05:20:04.000 | 12345 | Account1 \n6681 | 12 | 2012-11-02 05:20:04.000 | 55555 | Account2 \n6682 | 13 | 2012-11-04 06:20:04.000 | 44444 | Account3 \n6683 | 14 | 2012-11-05 05:30:04.000 | 44444 | Account3 \n6684 | 14 | 2012-11-05 05:31:04.000 | -1 | NULL \n\n\n**CardVer_3** \nBatchId |Name \n11 |MasterCard \n12 |Visa \n13 |AMEX \n14 |GoCard\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis will be an intermediate table, the output is planned to look like the attached.\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.imgur.com/g1uLp.png\" alt=\"No of distinct accounts per cardtype grouped by min age (date from today)\"\u003e\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2012-11-20 14:03:49.5 UTC","last_activity_date":"2012-11-21 14:03:30.01 UTC","last_edit_date":"2012-11-20 23:17:30.41 UTC","last_editor_display_name":"","last_editor_user_id":"1773949","owner_display_name":"","owner_user_id":"1773949","post_type_id":"1","score":"1","tags":"sql|sql-server|sql-server-2008|tsql","view_count":"351"} +{"id":"12199624","title":"Nil NSString method","body":"\u003cp\u003eI have an \u003ccode\u003eNSString\u003c/code\u003e that is stored in Core Data. It is optional, which I believe in the sqlite db means it can be null. I have a convenience method I call 'isEmptyOrWhitespace' shown here:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e- (BOOL)isEmptyOrWhiteSpace {\n return self == nil ||\n self.length == 0 ||\n [self stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]].length == 0;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen my string from Core Data is nil, it doesn't seem to call this method, that is the breakpoints are never hit. This is particularly annoying because a code chunk like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eif(![string isEmptyOrWhitespace]) {\n [string doSomething];\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003ccode\u003edoSomething\u003c/code\u003e is being run if string is nil, obviously not my intent. Is there a way to get around this without checking if my string is nil before calling a method on it? Or is this a \"feature\" of Objective-C that methods aren't run on nil objects?\u003c/p\u003e","accepted_answer_id":"12199669","answer_count":"2","comment_count":"2","creation_date":"2012-08-30 14:49:11.737 UTC","last_activity_date":"2012-08-30 15:11:09.42 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"350538","post_type_id":"1","score":"0","tags":"objective-c|nsstring","view_count":"156"} +{"id":"42113674","title":"Unit testing a jee filter","body":"\u003cp\u003eI am trying to test this filter:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class HttpMethodOverrideHeaderFilter extends OncePerRequestFilter {\n private static final String X_HTTP_METHOD_OVERRIDE_HEADER = \"X-HTTP-Method-Override\";\n\n @Override\n protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain)\n throws ServletException, IOException {\n\n if (isMethodOverriden(request)) {\n HttpServletRequest wrapper = new HttpMethodRequestWrapper(request, request.getHeader(X_HTTP_METHOD_OVERRIDE_HEADER).toUpperCase(Locale.ENGLISH));\n filterChain.doFilter(wrapper, response);\n }\n else {\n filterChain.doFilter(request, response);\n }\n\n }\n\n private boolean isMethodOverriden(HttpServletRequest request) {\n String methodOverride = request.getHeader(X_HTTP_METHOD_OVERRIDE_HEADER);\n return RequestMethod.POST.name().equalsIgnoreCase(request.getMethod()) \u0026amp;\u0026amp;\n (RequestMethod.PUT.name().equalsIgnoreCase(methodOverride) || RequestMethod.DELETE.name().equalsIgnoreCase(methodOverride));\n }\n\n protected static class HttpMethodRequestWrapper extends HttpServletRequestWrapper {\n private final String method;\n\n public HttpMethodRequestWrapper(HttpServletRequest request, String method) {\n super(request);\n this.method = method;\n }\n\n @Override\n public String getMethod() {\n return this.method;\n }\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd this is the unit test:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@RunWith(MockitoJUnitRunner.class)\npublic class HttpMethodOverrideHeaderFilterTest {\n\n private static final String X_HTTP_METHOD_OVERRIDE_HEADER = \"X-HTTP-Method-Override\";\n\n private HttpMethodOverrideHeaderFilter httpMethodOverrideHeaderFilter;\n\n @Mock\n private HttpServletRequest httpServletRequest;\n\n @Mock\n private HttpServletResponse httpServletResponse;\n\n @Mock\n private FilterChain filterChain;\n\n @Before\n public void setUp() {\n httpMethodOverrideHeaderFilter = new HttpMethodOverrideHeaderFilter();\n }\n\n @Test\n public void testDoFilterInternalWithPUTMethodAsOverrideHeader() throws Exception {\n when(httpServletRequest.getHeader(X_HTTP_METHOD_OVERRIDE_HEADER)).thenReturn(\"PUT\");\n when(httpServletRequest.getMethod()).thenReturn(\"POST\");\n\n HttpServletRequest wrapper = new HttpMethodOverrideHeaderFilter.HttpMethodRequestWrapper(httpServletRequest, \"PUT\");\n\n httpMethodOverrideHeaderFilter.doFilterInternal(httpServletRequest, httpServletResponse, filterChain);\n verify(filterChain).doFilter(wrapper, httpServletResponse);\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe test is not passing as wrapper is not the same instance. Basically what I need to know is if the wrapper was set the PUT method. Any ideas?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-02-08 12:52:42.703 UTC","last_activity_date":"2017-02-08 13:16:54.687 UTC","last_edit_date":"2017-02-08 12:53:51.77 UTC","last_editor_display_name":"","last_editor_user_id":"3885376","owner_display_name":"","owner_user_id":"1990218","post_type_id":"1","score":"0","tags":"testing|junit","view_count":"47"} +{"id":"29981620","title":"Laravel Homestead composer errors","body":"\u003cp\u003eWhen I try to 'vagrant up' on a Homestead 5 box following the instructions on \u003ca href=\"http://laravel.com/docs/5.0/homestead\" rel=\"nofollow\"\u003ehttp://laravel.com/docs/5.0/homestead\u003c/a\u003e ,I get the following error. I am behind a proxy, however I believe I have it setup correctly in the Vagrantfile. \u003c/p\u003e\n\n\u003cp\u003eI have not installed composer locally (as the instructions did not include this), is that something I need to do? \u003c/p\u003e\n\n\u003cp\u003eIs there a way to confirm this is not an issue with my proxy settings in Vagrantfile?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e==\u0026gt; default: [Composer\\Downloader\\TransportException]\n\n==\u0026gt; default: The \"https://getcomposer.org/version\" file could not be downloaded: failed to open stream: Cannot connect to HTTPS server through proxy\n\n==\u0026gt; default:\n\n==\u0026gt; default:\n\n==\u0026gt; default:\n\n==\u0026gt; default: self-update [-r|--rollback] [--clean-backups] [--no-progress] [version]\nThe SSH command responded with a non-zero exit status. Vagrant\nassumes that this means the command failed. The output for this command\nshould be in the log above. Please read the output to determine what\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"2","creation_date":"2015-05-01 04:29:57.713 UTC","last_activity_date":"2015-05-01 04:29:57.713 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1031563","post_type_id":"1","score":"0","tags":"laravel|vagrant|composer-php","view_count":"570"} +{"id":"25503735","title":"Convert Pdf to Image as per the pdf page","body":"\u003cp\u003eI want to upload a pdf then after I want to convert to image as per the pdf page means that If pdf have 2 pages then 2 images will generate.\u003c/p\u003e\n\n\u003cp\u003eAfter generate this image I want to store into table.\u003c/p\u003e\n\n\u003cp\u003eFor example\u003c/p\u003e\n\n\u003cp\u003eI have a pdf table in that I upload a PDF and another table is image that I want to store pdf's images that newly generated.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eI just need help for how to generate images from pdf as per the page\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eso How can i do this?\u003c/p\u003e\n\n\u003cp\u003ePlease Help me?\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-08-26 10:37:33.197 UTC","last_activity_date":"2014-08-26 18:03:07.29 UTC","last_edit_date":"2014-08-26 10:44:25.247 UTC","last_editor_display_name":"user3794252","owner_display_name":"user3794252","post_type_id":"1","score":"0","tags":"ruby-on-rails|pdf|ruby-on-rails-4","view_count":"1855"} +{"id":"5973329","title":"Play Framework: How to validate a subset of fields in an object?","body":"\u003cp\u003eI have an User object that has many attributes. In my edit profile screen I'm displaying a subset of those attributes. In the corresponding controller action how can I validate only those fields that are being edited and not all the fields in the User object? \u003c/p\u003e\n\n\u003cp\u003eI have annotated the fields in the User object with the MaxSize, Email, URL, etc. constraints and don't want to repeat them again by validating each field manually. \u003c/p\u003e\n\n\u003cp\u003eAny pointers would be greatly appreciated. Thanks!\u003c/p\u003e","accepted_answer_id":"5975444","answer_count":"1","comment_count":"0","creation_date":"2011-05-12 04:33:39.853 UTC","last_activity_date":"2011-05-12 21:07:41.36 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"751355","post_type_id":"1","score":"5","tags":"java|playframework","view_count":"832"} +{"id":"16307290","title":"PowerShell match names with user email addresses and format as mailto","body":"\u003cp\u003eSo i have the below script which scans a drive for folders, it then pulls in a csv with folder names and folder owners and then matches them and outputs to HTML.\u003c/p\u003e\n\n\u003cp\u003eI am looking for a way to within this use PS to look up the users names in the csv grab their email address from AD and then in the output of the HTML put them as mailto code.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction name($filename, $folderowners, $directory, $output){\n $server = hostname\n $date = Get-Date -format \"dd-MMM-yyyy HH:mm\"\n $a = \"\u0026lt;style\u0026gt;\"\n $a = $a + \"TABLE{border-width: 1px;border-style: solid;border-color:black;}\"\n $a = $a + \"Table{background-color:#ffffff;border-collapse: collapse;}\"\n $a = $a + \"TH{border-width:1px;padding:0px;border-style:solid;border-color:black;}\"\n $a = $a + \"TR{border-width:1px;padding-left:5px;border-style:solid;border- \n color:black;}\"\n$a = $a + \"TD{border-width:1px;padding-left:5px;border-style:solid;border-color:black;}\"\n$a = $a + \"body{ font-family:Calibri; font-size:11pt;}\"\n$a = $a + \"\u0026lt;/style\u0026gt;\"\n\n$c = \" \u0026lt;br\u0026gt;\u0026lt;/br\u0026gt; Content\"\n\n$b = Import-Csv $folderowners\n$mappings = @{}\n$b | % { $mappings.Add($_.FolderName, $_.Owner) }\n\n\n\nGet-ChildItem $directory | where {$_.PSIsContainer -eq $True} | select Name, \n@{n=\"Owner\";e={$mappings[$_.Name]}} | sort -property Name | \nConvertTo-Html -head $a -PostContent $c | \nOut-File $output\n}\n\nname \"gdrive\" \"\\\\server\\location\\gdrive.csv\" \"\\\\server\\location$\" \n\"\\\\server\\location\\gdrive.html\"\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"16307708","answer_count":"2","comment_count":"0","creation_date":"2013-04-30 19:12:13.543 UTC","last_activity_date":"2013-04-30 21:16:55.96 UTC","last_editor_display_name":"","owner_display_name":"user2299515","post_type_id":"1","score":"2","tags":"html|powershell","view_count":"421"} +{"id":"40976405","title":"Access a mesos-master behind a domain name (not an IP)","body":"\u003cp\u003eIs it possible to run and access a mesos master on a machine that is placed behind a proxy?\u003c/p\u003e\n\n\u003cp\u003eI have successfully succeeded to deployed a MesosMaster/Marathon/MesosSalve on my local infrastructure.\u003c/p\u003e\n\n\u003cp\u003eThe problem arises when I want to put the MesosSlave somewhere in the internet, so that MesosSlave and MesosMaster shall communicate through public IPs\u003c/p\u003e\n\n\u003cp\u003eMy conf is the following:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Internet My Infra\n\n .----------------------. .-----------------. .-----------------. .-------------------------------------------------.\n | Mesos Slave VM | | Front Machine | | Proxy | | Tool-VM |\n | 178.22.17.248 | | 39.224.147.94 | | 10.2.0.57 | | 10.1.10.176 |\n |----------------------| | my.domain.com | |-----------------| | 192.168.5.1 (docker bridge) |\n | | |-----------------| | | |-------------------------------------------------|\n | | | | | | | |\n | __________ | | __________ | | __________ | | .-----------------------------. |\n | [_...__..5051.°]| |[_..5050.__...°] |\u0026lt;---|[_..5050.__...°] |\u0026lt;------------^| | Mesos-Master Container | |\n | | | | | | \\ __________ | 192.168.5.4 (docker bridge) | |\n | | | __________ | | __________ | |[_..5050.__...°]^|-----------------------------| |\n | | |[_..2181.__...°] |\u0026lt;---|[_..2181.__...°] |\u0026lt;------------^| \\ __________ | |\n | | | | | | \\ __________ |[_..5050.__...°] | |\n | | | | | | |[_..2181.__...°]^| __________ | |\n | | | | | | | \\[_..2181.__...°] | |\n | | | | | | | '-----------------------------' |\n '----------------------' '-----------------' '-----------------' '-------------------------------------------------'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eMy domain infra redirect everthing that arrives from outside on ports 5050 (for Mesos) and port 2181 (zookeeper) \u003cstrong\u003eONLY\u003c/strong\u003e for requests that are addressed to the domain 'my.domain.com' (which is a virtualhost of 39.224.147.94). But not for the other requests (that are arriving on 39.224.147.94).\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eSo I try to execute the service through CLI for the moment:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eExecute \u003cstrong\u003eMesos Master\u003c/strong\u003e(in Mesos Master Container)\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003e\u003ccode\u003e/usr/sbin/mesos-master --ip=192.168.5.4 --work_dir=~/Mesos/mesos-0.23.0/workdir/ --zk=zk://192.168.5.4:2181/mesos --quorum=1 --log_dir=/var/log/mesos --external_log_file=/dev/stdout\u003c/code\u003e\u003c/p\u003e\n\n\u003col start=\"2\"\u003e\n\u003cli\u003eExecute \u003cstrong\u003eMarathon\u003c/strong\u003e (in Mesos Master Container)\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003e\u003ccode\u003e/usr/bin/marathon --zk zk://192.168.5.4:2181/marathon --master zk://my.domain.com:2181/mesos\u003c/code\u003e\u003c/p\u003e\n\n\u003col start=\"3\"\u003e\n\u003cli\u003eExecute \u003cstrong\u003eMesos Slave\u003c/strong\u003e (in Mesos Slave VM)\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003e\u003ccode\u003e/usr/sbin/mesos-slave --master=my.domain.com:5050 --work_dir=/var/lib/mesos/agent --port=8009 --containerizers=docker --executor_registration_timeout=3mins --log_dir=/var/log/mesos\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eThe Mesos Master can see the Slave resources.\nHowever, when I send a Job through Marathon, this job stay in a \u003cstrong\u003ewaiting\u003c/strong\u003e state.\u003c/p\u003e\n\n\u003cp\u003eIt seems that the slave is not able to communicate on the hostname of the Master, but only using it's public IP:\u003c/p\u003e\n\n\u003cp\u003eI have this in the Slave logs:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eNew master detected at master@39.224.147.94:5050\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eHowever incoming traffic on \u003cstrong\u003e39.224.147.94:5050\u003c/strong\u003e is blocked by my infra (only \u003cstrong\u003emy.domain.com:5050\u003c/strong\u003e is accepted)\u003c/p\u003e\n\n\u003cp\u003eSo, is it possible to create a connection between Master and Slaves, using domain names, but not IPs?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-12-05 14:20:34.99 UTC","last_activity_date":"2016-12-06 12:25:40.17 UTC","last_edit_date":"2016-12-06 09:25:57.333 UTC","last_editor_display_name":"","last_editor_user_id":"1264339","owner_display_name":"","owner_user_id":"1264339","post_type_id":"1","score":"0","tags":"deployment|containers|mesos|marathon","view_count":"66"} +{"id":"41786937","title":"Color Text Only Partially Working","body":"\u003cp\u003eWhen I input something like:\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eprint('\\x1b[6;30;42m' + 'Success!' + '\\x1b[0m')\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003ethe output I get is:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/9BKZT.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/9BKZT.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eWith no color.\u003c/p\u003e\n\n\u003cp\u003eI've heard you any need to enable vt100 emulation for windows, but when I search for how to do that, I haven't seen any answers.\u003c/p\u003e\n\n\u003cp\u003eAll answers are very appreciated!\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2017-01-22 03:14:12.537 UTC","last_activity_date":"2017-01-22 03:39:54.217 UTC","last_edit_date":"2017-01-22 03:21:45.77 UTC","last_editor_display_name":"","last_editor_user_id":"6622587","owner_display_name":"","owner_user_id":"7423140","post_type_id":"1","score":"0","tags":"python|python-3.x","view_count":"33"} +{"id":"24123585","title":"Java : image processing - how to get set of images to same standard","body":"\u003cp\u003eI need to develop the simple skin disease diagnose system using image processing and neural network. To use images in neural network, image should be same standard and, To identify the skin disease we should apply some image processing technique as well.\u003c/p\u003e\n\n\u003cp\u003eBut I don't know what image processing technique apply first and what are they? \n As I read from references I think I need to apply image filtering technique, edge detection technique , etc...\u003c/p\u003e\n\n\u003cp\u003eCan someone who is expert in this please specify the image processing technique step by step. no need coding I just want to know image processing technique names and there order.\u003c/p\u003e\n\n\u003cp\u003eThis is reference:\n\u003ca href=\"http://www.academia.edu/3131130/DERMATOLOGICAL_DISEASE_DIAGNOSIS_USING_COLOR-SKIN_IMAGES\" rel=\"nofollow\"\u003ereference\u003c/a\u003e \u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-06-09 15:30:51.693 UTC","last_activity_date":"2014-06-10 14:49:01.627 UTC","last_edit_date":"2014-06-10 14:49:01.627 UTC","last_editor_display_name":"","last_editor_user_id":"2420599","owner_display_name":"","owner_user_id":"3565768","post_type_id":"1","score":"0","tags":"java|image-processing|neural-network|edge-detection","view_count":"242"} +{"id":"13427564","title":"Getting exceptions in dialog box having endless adapter implementation for its listview","body":"\u003cp\u003eThis is my Demo Adapter.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class DemoAdapter extends EndlessAdapter {\n\n private RotateAnimation rotate = null;\n private View pendingView = null;\n private ArrayList\u0026lt;ShipTo\u0026gt; next;\n private static ArrayList\u0026lt;ShipTo\u0026gt; list;\n private int pageFrom = 1;\n private static Activity act;\n\n DemoAdapter(Context ctxt, ArrayList\u0026lt;ShipTo\u0026gt; list) {\n super(new Adapater());\n act = (Activity) ctxt;\n DemoAdapter.list = list;\n rotate = new RotateAnimation(0f, 360f, Animation.RELATIVE_TO_SELF,\n 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);\n rotate.setDuration(600);\n rotate.setRepeatMode(Animation.RESTART);\n rotate.setRepeatCount(Animation.INFINITE);\n }\n\n @Override\n protected View getPendingView(ViewGroup parent) {\n View row = LayoutInflater.from(parent.getContext()).inflate(\n R.layout.row, null);\n\n pendingView = row.findViewById(android.R.id.text1);\n pendingView.setVisibility(View.GONE);\n pendingView = row.findViewById(R.id.throbber);\n pendingView.setVisibility(View.VISIBLE);\n startProgressAnimation();\n\n return (row);\n }\n\n @Override\n protected boolean cacheInBackground() {\n // SystemClock.sleep(1000); // pretend to do work\n pageFrom += 10;\n next = ItemController.getInstance().getShipTo(pageFrom + \"\", \"10\", \"0\");\n return (ItemController.moreShipTo.equalsIgnoreCase(\"1\")) ? true : false;\n }\n\n @Override\n protected void appendCachedData() {\n if (next != null)\n list.addAll(next);\n if (!(ItemController.moreShipTo.equalsIgnoreCase(\"1\")) ? true : false)\n Toast.makeText(act, \"No More Category found\", Toast.LENGTH_SHORT)\n .show();\n\n }\n\n void startProgressAnimation() {\n if (pendingView != null) {\n pendingView.startAnimation(rotate);\n }\n }\n\n private static class Adapater extends BaseAdapter {\n\n private class ViewHolder {\n private TextView tv;\n }\n\n @Override\n public int getCount() {\n return list.size();\n }\n\n @Override\n public ShipTo getItem(int arg0) {\n return null;\n }\n\n @Override\n public long getItemId(int arg0) {\n return 0;\n }\n\n @Override\n public View getView(int arg0, View arg1, ViewGroup arg2) {\n\n try {\n ViewHolder viewHolder = null;\n ShipTo shipTo = list.get(arg0);\n LayoutInflater lf = (LayoutInflater) act\n .getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n // if (arg1 == null) {\n viewHolder = new ViewHolder();\n arg1 = lf.inflate(R.layout.category_spinner_textview, null);\n viewHolder.tv = (TextView) arg1\n .findViewById(R.id.textView1_cat_spinner);\n\n arg1.setTag(viewHolder);\n /*\n * } else { viewHolder = (ViewHolder) arg1.getTag(); }\n */\n\n viewHolder.tv.setText(shipTo.getName());\n arg1.setTag(R.layout.category_spinner_textview, shipTo);\n viewHolder.tv.setPadding(5, 10, 0, 10);\n\n } catch (Exception e) {\n e.printStackTrace();\n\n }\n return arg1;\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is my activity for showing listview using endless adapter in Dialog box.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class EndlessAdapterDemo extends Activity {\n public ArrayList\u0026lt;ShipTo\u0026gt; shipToList;\n\n @Override\n public void onCreate(Bundle icicle) {\n super.onCreate(icicle);\n setContentView(R.layout.main);\n Button button = (Button) findViewById(R.id.button1);\n\n button.setOnClickListener(new OnClickListener() {\n @Override\n public void onClick(View arg0) {\n new Thread(new Runnable() {\n @Override\n public void run() {\n shipToList = ItemController.getInstance().getShipTo(\n \"1\", \"10\", \"0\");\n\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n showCategoryList();\n }\n });\n }\n }).start();\n\n }\n });\n\n }\n\n private void showCategoryList() {\n final Dialog categoryDialog = new Dialog(this);\n categoryDialog.setTitle(\"Select Category\");\n categoryDialog.setContentView(R.layout.custumdialoglstview);\n ListView lv = (ListView) categoryDialog.findViewById(R.id.listView1);\n\n DemoAdapter adapter = null;\n\n if (adapter == null) {\n adapter = new DemoAdapter(EndlessAdapterDemo.this, shipToList);\n }\n lv.setAdapter(adapter);\n lv.setOnItemClickListener(new OnItemClickListener() {\n @Override\n public void onItemClick(AdapterView\u0026lt;?\u0026gt; arg0, View arg1, int arg2,\n long arg3) {\n System.out.println(arg1.getTag().getClass().getName());\n ShipTo temp = (ShipTo) arg1\n .getTag(R.layout.category_spinner_textview);\n categoryDialog.dismiss();\n\n }\n });\n categoryDialog.show();\n\n\n }\n\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I run the above code it throws illegal state exception or null pointer exception. \u003c/p\u003e\n\n\u003cp\u003eFollowing is my logcat details\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e11-17 09:40:08.532: D/AndroidRuntime(331): Shutting down VM\n11-17 09:40:08.532: W/dalvikvm(331): threadid=1: thread exiting with uncaught exception (group=0x40015560)\n11-17 09:40:08.541: E/AndroidRuntime(331): FATAL EXCEPTION: main\n11-17 09:40:08.541: E/AndroidRuntime(331): java.lang.NullPointerException\n11-17 09:40:08.541: E/AndroidRuntime(331): at android.widget.ListView.measureScrapChild(ListView.java:1135)\n11-17 09:40:08.541: E/AndroidRuntime(331): at android.widget.ListView.measureHeightOfChildren(ListView.java:1218)\n11-17 09:40:08.541: E/AndroidRuntime(331): at android.widget.ListView.onMeasure(ListView.java:1127)\n11-17 09:40:08.541: E/AndroidRuntime(331): at android.view.View.measure(View.java:8313)\n11-17 09:40:08.541: E/AndroidRuntime(331): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3138)\n11-17 09:40:08.541: E/AndroidRuntime(331): at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1017)\n11-17 09:40:08.541: E/AndroidRuntime(331): at android.widget.LinearLayout.measureVertical(LinearLayout.java:386)\n11-17 09:40:08.541: E/AndroidRuntime(331): at android.widget.LinearLayout.onMeasure(LinearLayout.java:309)\n11-17 09:40:08.541: E/AndroidRuntime(331): at android.view.View.measure(View.java:8313)\n11-17 09:40:08.541: E/AndroidRuntime(331): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3138)\n11-17 09:40:08.541: E/AndroidRuntime(331): at android.widget.FrameLayout.onMeasure(FrameLayout.java:250)\n11-17 09:40:08.541: E/AndroidRuntime(331): at android.view.View.measure(View.java:8313)\n11-17 09:40:08.541: E/AndroidRuntime(331): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3138)\n11-17 09:40:08.541: E/AndroidRuntime(331): at android.widget.FrameLayout.onMeasure(FrameLayout.java:250)\n11-17 09:40:08.541: E/AndroidRuntime(331): at android.view.View.measure(View.java:8313)\n11-17 09:40:08.541: E/AndroidRuntime(331): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3138)\n11-17 09:40:08.541: E/AndroidRuntime(331): at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1017)\n11-17 09:40:08.541: E/AndroidRuntime(331): at android.widget.LinearLayout.measureVertical(LinearLayout.java:386)\n11-17 09:40:08.541: E/AndroidRuntime(331): at android.widget.LinearLayout.onMeasure(LinearLayout.java:309)\n11-17 09:40:08.541: E/AndroidRuntime(331): at android.view.View.measure(View.java:8313)\n11-17 09:40:08.541: E/AndroidRuntime(331): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3138)\n11-17 09:40:08.541: E/AndroidRuntime(331): at android.widget.FrameLayout.onMeasure(FrameLayout.java:250)\n11-17 09:40:08.541: E/AndroidRuntime(331): at android.view.View.measure(View.java:8313)\n11-17 09:40:08.541: E/AndroidRuntime(331): at android.view.ViewRoot.performTraversals(ViewRoot.java:839)\n11-17 09:40:08.541: E/AndroidRuntime(331): at android.view.ViewRoot.handleMessage(ViewRoot.java:1859)\n11-17 09:40:08.541: E/AndroidRuntime(331): at android.os.Handler.dispatchMessage(Handler.java:99)\n11-17 09:40:08.541: E/AndroidRuntime(331): at android.os.Looper.loop(Looper.java:123)\n11-17 09:40:08.541: E/AndroidRuntime(331): at android.app.ActivityThread.main(ActivityThread.java:3683)\n11-17 09:40:08.541: E/AndroidRuntime(331): at java.lang.reflect.Method.invokeNative(Native Method)\n11-17 09:40:08.541: E/AndroidRuntime(331): at java.lang.reflect.Method.invoke(Method.java:507)\n11-17 09:40:08.541: E/AndroidRuntime(331): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)\n11-17 09:40:08.541: E/AndroidRuntime(331): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)\n11-17 09:40:08.541: E/AndroidRuntime(331): at dalvik.system.NativeStart.main(Native Method)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat might be the problem?\u003c/p\u003e","accepted_answer_id":"17723143","answer_count":"1","comment_count":"5","creation_date":"2012-11-17 04:04:32.19 UTC","last_activity_date":"2014-06-16 17:39:58.937 UTC","last_edit_date":"2014-06-16 17:39:58.937 UTC","last_editor_display_name":"","last_editor_user_id":"115145","owner_display_name":"","owner_user_id":"1081355","post_type_id":"1","score":"3","tags":"android|commonsware-cwac","view_count":"342"} +{"id":"23279586","title":"Vb.net get username that is running process","body":"\u003cp\u003eI'm making a program that looks for processes and can see which user is using them. I've got the scanning code, but not the username code. The username has to be a string. For example: I have 2 people running some processes and the processes will show in the listview. The first column is for processes and the second is for the username. I want it to be like:\u003c/p\u003e\n\n\u003cp\u003e(process here) (username here)\u003c/p\u003e\n\n\u003cp\u003e(process here) (username here)....\u003c/p\u003e\n\n\u003cp\u003eYou get the point I think and there's much more processes than that running on the computer. The question is: How do you get the username for someone using the process?\u003c/p\u003e\n\n\u003cp\u003eEdit: The code. This is my code.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eFor Each pr As Process In Process.GetProcesses\nDim lvi As ListViewItem = ListView1.Items.Add(CStr(pr.ProcessName))\n'Now I need something to put for the username\nNext\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is the other one that is most common.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ePublic Function GetProcessOwner(processId As Integer) As String\n Dim query As String = \"Select * From Win32_Process Where ProcessID = \" + processId\n Dim searcher As New ManagementObjectSearcher(query)\n Dim processList As ManagementObjectCollection = searcher.[Get]()\n\n For Each obj As ManagementObject In processList\n Dim argList As String() = New String() {String.Empty, String.Empty}\n Dim returnVal As Integer = Convert.ToInt32(obj.InvokeMethod(\"GetOwner\", argList))\n If returnVal = 0 Then\n ' argList(0) == User\n ' argList(1) == DOMAIN\n Return argList(0)\n End If\n Next\n\n Return \"NO OWNER\"\nEnd Function\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"23280172","answer_count":"1","comment_count":"1","creation_date":"2014-04-24 20:53:29.75 UTC","last_activity_date":"2014-04-27 21:21:18.123 UTC","last_edit_date":"2014-04-24 21:05:33.713 UTC","last_editor_display_name":"user2913540","owner_display_name":"user2913540","post_type_id":"1","score":"1","tags":"vb.net|process","view_count":"5200"} +{"id":"27499438","title":"sencha app build package gives me a java.lang.NullPointerException","body":"\u003cp\u003eI use sencha architect to build an app. \u003c/p\u003e\n\n\u003cp\u003eThen I copy the project files such as app, packages, resources, touch, app.js, index,html to a empty app built by sencha cmd. Then I use sencha app build package to build a package, but the error comes. The cmd window are as the follow picture, can anyone help me? \u003c/p\u003e\n\n\u003cp\u003eI use win7+sencha cmd4.0+cordova+touch-2.4.1\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/u2q4L.png\" alt=\"i use \u0026quot;sencha app build package\u0026quot; and the result is as the pic\"\u003e\u003c/p\u003e","answer_count":"0","comment_count":"6","creation_date":"2014-12-16 07:17:09.653 UTC","last_activity_date":"2014-12-16 07:45:23.733 UTC","last_edit_date":"2014-12-16 07:45:23.733 UTC","last_editor_display_name":"","last_editor_user_id":"368070","owner_display_name":"","owner_user_id":"4365255","post_type_id":"1","score":"0","tags":"android|extjs|sencha-touch|sencha-architect","view_count":"310"} +{"id":"24612537","title":"Unable to set product's category by code","body":"\u003cp\u003eAccording to\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eMage::app()-\u0026gt;getWebsite(true)-\u0026gt;getDefaultStore()-\u0026gt;getRootCategoryId();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eID of the default product category is \u003ccode\u003e'2'\u003c/code\u003e but:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic function initProduct(Varien_Event_Observer $observer) \n// catalog_product_new_action event\n{\n $product = $observer-\u0026gt;getEvent()-\u0026gt;getProduct();\n (...)\n\n $productCatalog = Mage::getModel('catalog/product')-\u0026gt;load($product-\u0026gt;getId()); \n $productCatalog-\u0026gt;setCategoryIds(array(\"2\"));\n $productCatalog-\u0026gt;save();\n $product-\u0026gt;save();\n (...)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003edoesn't change product's category at all. It's either wrong ID or wrong way of changing the category.\u003c/p\u003e","accepted_answer_id":"24613598","answer_count":"1","comment_count":"1","creation_date":"2014-07-07 14:06:34.713 UTC","last_activity_date":"2014-07-07 14:55:26.09 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1650907","post_type_id":"1","score":"0","tags":"php|magento|magento-1.9","view_count":"39"} +{"id":"41675228","title":"WebView drawn to Android Bitmap from java to Qt C++","body":"\u003cp\u003eI'm trying to generate a webview in Java (Android) and return an Android Bitmap back to Qt C++. So far I am getting an invalid object.\u003c/p\u003e\n\n\u003cp\u003eThe static java funtion: (in android/src/com/parity/jni/JniExtras.java)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epackage com.parity.jni;\n\nimport android.graphics.Bitmap;\nimport android.graphics.Bitmap.Config;\nimport android.graphics.Canvas;\nimport android.graphics.Paint;\nimport android.webkit.WebView;\n\npublic class JniExtras {\n public static Bitmap htmlToBitmap(String html, float scale, int w, int h, int r, int g, int b, int a) {\n int color = (r \u0026lt;\u0026lt; 24) | (g \u0026lt;\u0026lt; 16) | (b \u0026lt;\u0026lt; 8) | a;\n\n WebView web = new WebView(null);\n web.loadData(html, \"text/html\", \"UTF-8\");\n web.layout(0, 0, (int)((float)w / scale), (int)((float)h / scale));\n\n Bitmap bitmap = Bitmap.createBitmap(w, h, Config.ARGB_8888);\n\n Canvas canvas = new Canvas(bitmap);\n\n Paint paint = new Paint();\n paint.setColor(color);\n\n canvas.drawPaint(paint);\n canvas.scale(scale, scale);\n\n web.draw(canvas);\n\n return bitmap;\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd I'm trying to fetch the Bitmap in QT with:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eQAndroidJniObject jni_html = QAndroidJniObject::fromString(html);\nQAndroidJniObject bitmap = QAndroidJniObject::callStaticObjectMethod(\n \"com/parity/jni/JniExtras\",\n \"htmlToBitmap\",\n \"(Ljava/lang/String;FIIIIII)Ljava/lang/Object;\",\n jni_html.object\u0026lt;jstring\u0026gt;(),\n scale,\n w, h,\n r, g, b, a);\n\nif (!bitmap.isValid()) {\n qDebug(\"Java call failed to get android bitmap\");\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCan anybody tell me what it is I am doing wrong?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdit 1:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eIn the meantime I am trying to get the WebView to draw to a Bitmap in an Android Studio project. Here's what I've got so far:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epackage com.parity.webviewtest;\n\nimport android.content.Context;\nimport android.graphics.Bitmap;\nimport android.graphics.Canvas;\nimport android.graphics.Paint;\nimport android.support.v7.app.AppCompatActivity;\nimport android.os.Bundle;\nimport android.util.Log;\nimport android.view.View;\nimport android.webkit.WebView;\nimport android.widget.ImageView;\nimport android.widget.TextView;\n\npublic class MainActivity extends AppCompatActivity {\n\n String tag = \"WLGfx\";\n\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n\n int wid = 1000;\n int hgt = 1000;\n\n String html = \"\u0026lt;div align=\\\"center\\\"\u0026gt;\u0026lt;font face=\\\"FreeMono\\\"\u0026gt;\u0026lt;b\u0026gt;\u0026lt;font color=\\\"#FF0000\\\"\u0026gt;\u0026lt;font size=\\\"6\\\"\u0026gt;Title of report\u0026lt;/font\u0026gt;\u0026lt;/font\u0026gt;\u0026lt;/b\u0026gt;\u0026lt;/font\u0026gt;\u0026lt;br\u0026gt;\u0026lt;/div\u0026gt;\u0026lt;font face=\\\"FreeSerif\\\" color=\\\"#0000FF\\\"\u0026gt;Now as we enter a new era of stuff to do some really amazing and weird things, we notice that our distractions are seemingly taking our focus away from the smaller and more important things that we should be thoroughly immersed in. Either way, this will test out a formatted paragraph.\u0026lt;/font\u0026gt;\u0026lt;font face=\\\"FreeSerif\\\"\u0026gt;\u0026lt;br\u0026gt;\u0026lt;/font\u0026gt;\u0026lt;ol\u0026gt;\u0026lt;li\u0026gt;\u0026lt;font face=\\\"FreeSerif\\\" color=\\\"#008000\\\"\u0026gt;Throw away old bins\u0026lt;/font\u0026gt;\u0026lt;/li\u0026gt;\u0026lt;li\u0026gt;\u0026lt;font face=\\\"FreeSerif\\\" color=\\\"#008000\\\"\u0026gt;Buy new bins\u0026lt;/font\u0026gt;\u0026lt;/li\u0026gt;\u0026lt;li\u0026gt;\u0026lt;font face=\\\"FreeSerif\\\" color=\\\"#008000\\\"\u0026gt;Fill the new bins\u0026lt;/font\u0026gt;\u0026lt;/li\u0026gt;\u0026lt;/ol\u0026gt;\u0026lt;div align=\\\"center\\\"\u0026gt;\u0026lt;font face=\\\"FreeSerif\\\" color=\\\"#993300\\\"\u0026gt;\u0026lt;i\u0026gt;The quick brown fox does stuff\u0026lt;/i\u0026gt;\u0026lt;/font\u0026gt;\u0026lt;br\u0026gt;\u0026lt;/div\u0026gt;\";\n //String html = \"Some line of text to test out...\";\n\n Log.d(tag, html);\n\n Context context = this.getApplicationContext();\n\n WebView web = new WebView(context);\n web.setLayerType(View.LAYER_TYPE_SOFTWARE, null);\n web.layout(0,0,wid,hgt);\n web.loadData(html, \"text/html\", \"UTF-8\");\n web.buildDrawingCache();\n\n Paint paint = new Paint();\n paint.setColor(0xffffffff);\n\n Bitmap bitmap = Bitmap.createBitmap(wid, hgt, Bitmap.Config.ARGB_8888);\n Canvas canvas = new Canvas(bitmap);\n\n web.draw(canvas);\n\n ImageView img = (ImageView)findViewById(R.id.imageView);\n img.setImageBitmap(bitmap);\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eStill I am getting a blank bitmap.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdit 2:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eAs suggested in comments, I've tried both capturePicture() and getDrawingCache() and neither are working in the Android Studio test project:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eContext context = getApplicationContext();\n\nWebView web = new WebView(context);\nweb.setEnabled(true);\n//web.loadUrl(html);\nweb.setLayerType(View.LAYER_TYPE_SOFTWARE, null);\nweb.layout(0,0,wid,hgt);\nweb.loadData(html, \"text/html\", \"UTF-8\");\n\nweb.setDrawingCacheEnabled(true);\nweb.buildDrawingCache();\n\nPicture picture = web.capturePicture();\nBitmap bitmap = Bitmap.createBitmap(picture.getWidth(), picture.getHeight(), Bitmap.Config.ARGB_8888);\nCanvas canvas = new Canvas(bitmap);\n//picture.draw(canvas);\ncanvas.drawPicture(picture);\n\nLog.d(tag, \"Picture: \" + picture.getWidth() + \"x\" + picture.getHeight());\n\n//Bitmap bitmap = Bitmap.createBitmap(web.getDrawingCache());\n//web.setDrawingCacheEnabled(false);\n\n//Paint paint = new Paint();\n//paint.setColor(0xffffffff);\n\n//Bitmap bitmap = Bitmap.createBitmap(wid, hgt, Bitmap.Config.ARGB_8888);\n//Canvas canvas = new Canvas(bitmap);\n//web.draw(canvas);\n\nImageView img = (ImageView)findViewById(R.id.imageView);\nimg.setImageBitmap(bitmap);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe main reason I want to render html to a bitmap is so I only have to transfer simple html strings across the network to devices and not have the server render the images and send them.\u003c/p\u003e","answer_count":"0","comment_count":"13","creation_date":"2017-01-16 11:21:16.29 UTC","last_activity_date":"2017-01-16 14:55:58.28 UTC","last_edit_date":"2017-01-16 14:55:58.28 UTC","last_editor_display_name":"","last_editor_user_id":"2979092","owner_display_name":"","owner_user_id":"2979092","post_type_id":"1","score":"0","tags":"android|qt|qandroidjniobject","view_count":"95"} +{"id":"5147200","title":"Equivalent to ASP.NET WebForms URL Authorization in MVC","body":"\u003cp\u003eWe're considering making the move from WebForms to MVC for our (quite substantial) intranet application.\u003c/p\u003e\n\n\u003cp\u003eThe intranet app currently uses Windows authentication. Authorization to particular folders is controlled by web.config files inside each folder. The app also uses a Menu control which picks all this up and only shows users menu links to pages they are authorised to view. All this functionality comes out of the box with WebForms.\u003c/p\u003e\n\n\u003cp\u003eIn terms of the conversion to MVC, I think that replacing this functionality is going to be one of the key challenges.\u003c/p\u003e\n\n\u003cp\u003eCan anyone tell me what tools are available in MVC to:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003erestrict users' access to certain\npages / views whatever based on\ntheir Active Directory group\nmembership \u003c/li\u003e\n\u003cli\u003egenerate markup for a\nmenu which is aware of the users'\nauthorisation to certain pages /\nviews\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eThat would be mighty helpful.\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2011-02-28 20:28:55.723 UTC","favorite_count":"1","last_activity_date":"2011-06-22 17:54:15.857 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"164923","post_type_id":"1","score":"0","tags":"asp.net-mvc-2|authentication|sitemapprovider","view_count":"730"} +{"id":"33532745","title":"How does DelegatingVehicleTracker (p. 65 Goetz) return a \"live\" view?","body":"\u003cp\u003eOn page 65 and 66 of Java Concurrency in Practice Brian Goetz lists the following code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@ThreadSafe\npublic class DelegatingVehicleTracker {\nprivate final ConcurrentMap\u0026lt;String, Point\u0026gt; locations;\nprivate final Map\u0026lt;String, Point\u0026gt; unmodifiableMap;\n\npublic DelegatingVehicleTracker(Map\u0026lt;String, Point\u0026gt; points) {\n locations = new ConcurrentHashMap\u0026lt;String, Point\u0026gt;(points);\n unmodifiableMap = Collections.unmodifiableMap(locations);\n}\n\npublic Map\u0026lt;String, Point\u0026gt; getLocations() {\n return unmodifiableMap;\n}\n\npublic Point getLocation(String id) {\n return locations.get(id);\n}\n\npublic void setLocation(String id, int x, int y) {\n if (locations.replace(id, new Point(x, y)) == null)\n throw new IllegalArgumentException(\"invalid vehicle name: \" + id);\n}\n\n// Alternate version of getLocations (Listing 4.8)\npublic Map\u0026lt;String, Point\u0026gt; getLocationsAsStatic() {\n return Collections.unmodifiableMap(\n new HashMap\u0026lt;String, Point\u0026gt;(locations));\n}\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAbout this class Goetz writes:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e\"...the delegating version [the code above] returns an unmodifiable but \n 'live' view of the vehicle locations. This means that if thread A calls\n getLocations() and thread B later modifies the location of some of the \n points, those changes are reflected in the map returned to thread A.\" \u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eIn what sense would Thread A's unmodifiableMap be \"live\"? I do not see how changes made by Thread B via calls to setLocation() would be reflected in Thread A's unmodifiableMap. This would seem the case only if Thread A constructed a new instance of DelegatingVehicleTracker. But were Thread A to hold a reference to this class, I do not see how this is possible. \u003c/p\u003e\n\n\u003cp\u003eGoetz goes on to say that getLocationsAsStatic() could be called were an \"unchanging view of the fleet required.\" I am confused. It seems to me that precisely the opposite is the case, that a call to getLocationsAsStatic() would indeed return the \"live\" view, and a call to getLocations(), were the class not constructed anew, would return the static, unchanging view of the fleet of cars.\u003c/p\u003e\n\n\u003cp\u003eWhat am I missing here in this example?\u003c/p\u003e\n\n\u003cp\u003eAny thoughts or perspectives are appreciated! \u003c/p\u003e","accepted_answer_id":"33533324","answer_count":"3","comment_count":"0","creation_date":"2015-11-04 21:51:44.2 UTC","favorite_count":"1","last_activity_date":"2015-11-05 11:43:45.51 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2665148","post_type_id":"1","score":"5","tags":"java|multithreading|concurrency|delegation","view_count":"94"} +{"id":"43021245","title":"How to deploy google firebase functions using cmd?","body":"\u003cp\u003eI have a problem with a web hosting project. I created a new proyect in google firebase, and I executed the following commands:\u003c/p\u003e\n\n\u003cp\u003eC:\\myproject\u003efirebase init functions\u003c/p\u003e\n\n\u003cp\u003eC:\\myproject\u003efirebase deploy --only functions\u003c/p\u003e\n\n\u003cp\u003eBut the site says this:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eSite Not Found\u003cbr\u003e\u003cbr\u003e\n Why am I seeing this?\u003cbr\u003e\u003cbr\u003e\u003c/p\u003e\n \n \u003col\u003e\n There are a few potential reasons:\u003cbr\u003e\u003cbr\u003e\n \u003cli\u003eYou haven't deployed an app yet.\u003cbr\u003e\n \u003cli\u003eYou may have deployed an empty directory.\u003cbr\u003e\n \u003cli\u003eThis is a custom domain, but we haven't finished setting it up yet.\u003cbr\u003e\n \u003c/ol\u003e\n \n \u003cp\u003eHow can I deploy my first app?\u003cbr\u003e\u003cbr\u003e\n Refer to our hosting documentation to get started.\u003cbr\u003e\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eWhat could I do for show, at least, some text when an user go to my project url?\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2017-03-25 19:55:16.567 UTC","last_activity_date":"2017-03-26 22:57:24.623 UTC","last_edit_date":"2017-03-26 01:22:12.48 UTC","last_editor_display_name":"","last_editor_user_id":"209103","owner_display_name":"","owner_user_id":"6879068","post_type_id":"1","score":"0","tags":"firebase|firebase-hosting|firebase-tools","view_count":"146"} +{"id":"28191364","title":"Android location accuracy","body":"\u003cp\u003eI have the following code implemented to retrieve location values on Android:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emLocationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);\nmLocationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, this);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOn Android 2.3 and 4.1 this works great and returns updates at 180 samples per hour with a resolution down to 100m or less.\u003c/p\u003e\n\n\u003cp\u003eHowever, on Android 4.3 something has changed so this only provides updates at 5 samples per hour and a resolution at 2km. I haven't tested on later versions.\u003c/p\u003e\n\n\u003cp\u003eWhat has changed? Is it possible to return to the old accuracy levels again? I don't want to force GPS for power reasons. The app has \u003ccode\u003eACCESS_COARSE_LOCATION\u003c/code\u003e permissions.\u003c/p\u003e\n\n\u003cp\u003eI have been testing this on a Samsung S3 if it makes a difference.\u003c/p\u003e","answer_count":"2","comment_count":"1","creation_date":"2015-01-28 11:40:03.667 UTC","last_activity_date":"2015-01-28 11:52:08.613 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2433501","post_type_id":"1","score":"0","tags":"android|android-location","view_count":"249"} +{"id":"2539576","title":"Lucene.NET and searching on multiple fields with specific values","body":"\u003cp\u003eI've created an index with various bits of data for each document I've added, each document can differ in it field name.\u003c/p\u003e\n\n\u003cp\u003eLater on, when I come to search the index I need to query it with exact field/ values - for example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eFieldName1 = X AND FieldName2 = Y AND FieldName3 = Z\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat's the best way of constructing the following using Lucene .NET:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eWhat analyser is best to use for this exact match type?\u003c/li\u003e\n\u003cli\u003eUpon retrieving a match, I only need one specific field to be returned (which I add to each document) - should this be the only one stored?\u003c/li\u003e\n\u003cli\u003eLater on I'll need to support keyword searching (so a field can have a list of values and I'll need to do a partial match).\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eThe fields and values come from a \u003ccode\u003eDictionary\u0026lt;string, string\u0026gt;\u003c/code\u003e. It's not user input, it's constructed from code.\u003c/p\u003e\n\n\u003cp\u003eThanks,\u003cbr /\u003e\nKieron\u003c/p\u003e","accepted_answer_id":"2560719","answer_count":"1","comment_count":"0","creation_date":"2010-03-29 16:28:42.363 UTC","favorite_count":"1","last_activity_date":"2010-04-06 09:29:47.407 UTC","last_edit_date":"2010-03-30 14:43:20.103 UTC","last_editor_display_name":"","last_editor_user_id":"5791","owner_display_name":"","owner_user_id":"5791","post_type_id":"1","score":"7","tags":"c#|lucene.net","view_count":"3181"} +{"id":"38855808","title":"Ignore some files in IPython tab completion in linux","body":"\u003cp\u003eWhen I am working in IPython 5.0, sometimes I want to run a script with \u003ccode\u003erun script.py\u003c/code\u003e, but the tab completion will show me options \u003ccode\u003erun script.py\u003c/code\u003e and \u003ccode\u003erun script.py~\u003c/code\u003e, that is, Emacs backup files. How can I set to ignore these and other files like one does with \u003ccode\u003eFIGNORE\u003c/code\u003e in bash?\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2016-08-09 16:15:59.687 UTC","last_activity_date":"2016-08-10 09:18:22.07 UTC","last_edit_date":"2016-08-10 09:18:22.07 UTC","last_editor_display_name":"","last_editor_user_id":"3250500","owner_display_name":"","owner_user_id":"3250500","post_type_id":"1","score":"1","tags":"ipython","view_count":"11"} +{"id":"34985489","title":"Sum based on chart of Account Name","body":"\u003cp\u003eI'm trying to create a Report Dimension (Income Statement Report) in my Cube and would like to perform calculation (Sum or Divide) based on Report Action attribute. The Dimension table looks like below\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/CF2RD.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/CF2RD.png\" alt=\"Report Dimension Table\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eCould you kindly let me know if I could achieve this by MDX script? Thanks a lot for your help!\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-01-25 05:05:28.44 UTC","last_activity_date":"2016-01-28 04:09:37.973 UTC","last_edit_date":"2016-01-25 06:14:16.62 UTC","last_editor_display_name":"","last_editor_user_id":"338249","owner_display_name":"","owner_user_id":"5627238","post_type_id":"1","score":"0","tags":"ssas|mdx","view_count":"63"} +{"id":"24647917","title":"Can not fetch value from REST service in AngularJS","body":"\u003cp\u003eI'm trying fetch data by calling Java REST service from AngularJS web portal. I'm using ngResource. \u003c/p\u003e\n\n\u003cp\u003eCall From Angular Service :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eBankingModule.factory('UserFactory', function ($resource) {\n return $resource('http://localhost:8080/demoApp/service/users', {}, {\n show: { method: 'GET', isArray: true },\n update: { method: 'PUT', params: {id: '@id'} },\n delete: { method: 'DELETE', params: {id: '@id'} }\n })\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt is calling Service perfectly and even I can get the result if I put the URL directly at the browser :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eURL : http://localhost:8080/demoApp/service/users\n\nRESULT : [{\"id\":1,\"firstName\":\"Jayanta\",\"lastName\":\"Pramanik\"}]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut Angular-JS controller I can not get any result !!\u003c/p\u003e\n\n\u003cp\u003eFor your understanding -\nHere is my Service method definition -\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@GET\n@Produces(MediaType.APPLICATION_JSON)\npublic List\u0026lt;User\u0026gt; getAllUsersInJSON() {\n /* ------ Some Hard coded values are set into an ArrayList ------*/\n List\u0026lt;User\u0026gt; userList = new ArrayList\u0026lt;User\u0026gt;();\n User usr1 = new User();\n usr1.setId(1);\n usr1.setFirstName(\"Jayanta\");\n usr1.setLastName(\"Pramanik\");\n\n userList.add(usr1);\n\n return userList;\n} \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny idea please !\u003c/p\u003e\n\n\u003cp\u003eThanks in advance -\u003c/p\u003e\n\n\u003cp\u003eJayanta P.\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2014-07-09 07:39:48.327 UTC","last_activity_date":"2014-07-09 07:39:48.327 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1945415","post_type_id":"1","score":"0","tags":"java|angularjs|rest|resources|ngresource","view_count":"127"} +{"id":"47178258","title":"SQL how to count census points occurring between date records","body":"\u003cp\u003eI’m using MS-SQL-2008 R2 trying to write a script that calculates the Number of Hospital Beds occupied on any given day, at 2 census points: midnight, and 09:00.\u003c/p\u003e\n\n\u003cp\u003eI’m working from a data set of patient Ward Stays. Basically, each row in the table is a record of an individual patient's stay on a single ward, and records the date/time the patient is admitted onto the ward, and the date/time the patient leaves the ward.\u003c/p\u003e\n\n\u003cp\u003eA sample of this table is below:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eWard_Stay_Primary_Key | Ward_Start_Date_Time | Ward_End_Date_Time\n 1 | 2017-09-03 15:04:00.000 | 2017-09-27 16:55:00.000\n 2 | 2017-09-04 18:08:00.000 | 2017-09-06 18:00:00.000\n 3 | 2017-09-04 13:00:00.000 | 2017-09-04 22:00:00.000\n 4 | 2017-09-04 20:54:00.000 | 2017-09-08 14:30:00.000\n 5 | 2017-09-04 20:52:00.000 | 2017-09-13 11:50:00.000\n 6 | 2017-09-05 13:32:00.000 | 2017-09-11 14:49:00.000\n 7 | 2017-09-05 13:17:00.000 | 2017-09-12 21:00:00.000\n 8 | 2017-09-05 23:11:00.000 | 2017-09-06 17:38:00.000\n 9 | 2017-09-05 11:35:00.000 | 2017-09-14 16:12:00.000\n 10 | 2017-09-05 14:05:00.000 | 2017-09-11 16:30:00.000\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe key thing to note here is that a patient’s Ward Stay can span any length of time, from a few hours to many days.\u003c/p\u003e\n\n\u003cp\u003eThe following code enables me to calculate the number of beds at both census points for any given day, by specifying the date in the case statement:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT \n '05/09/2017' [Date]\n ,SUM(case when Ward_Start_Date_Time \u0026lt;= '05/09/2017 00:00:00.000' AND (Ward_End_Date_Time \u0026gt;= '05/09/2017 00:00:00.000' OR Ward_End_Date_Time IS NULL)then 1 else 0 end)[No. Beds Occupied at 00:00]\n ,SUM(case when Ward_Start_Date_Time \u0026lt;= '05/09/2017 09:00:00.000' AND (Ward_End_Date_Time \u0026gt;= '05/09/2017 09:00:00.000' OR Ward_End_Date_Time IS NULL)then 1 else 0 end)[No. Beds Occupied at 09:00] \n\nFROM \n WardStaysTable\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd, based on the sample 10 records above, generates this output:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Date | No. Beds Occupied at 00:00 | No. Beds Occupied at 09:00\n05/09/2017 | 4 | 4\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eTo perform this for any number of days is obviously onerous, so what I’m looking to create is a query where I can specify a start/end date parameter (e.g. 1st-5th Sept), and for the query to then evaluate the Ward_Start_Date_Time and Ward_End_Date_Time variables for each record, and – grouping by the dates defined in the date parameter – count each time the 00:00:00.000 and 09:00:00.000 census points fall between these 2 variables, to give an output something along these lines (based on the above 10 records):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Date | No. Beds Occupied at 00:00 | No. Beds Occupied at 09:00 \n01/09/2017 | 0 | 0\n02/09/2017 | 0 | 0 \n03/09/2017 | 0 | 0\n04/09/2017 | 1 | 1\n05/09/2017 | 4 | 4\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI’ve approached this (perhaps naively) thinking that if I use a cte to create a table of dates (defined by the input parameters), along with associated midnight and 9am census date/time points, then I could use these variables to group and evaluate the dataset.\u003c/p\u003e\n\n\u003cp\u003eSo, this code generates the grouping dates and census date/time points:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eDECLARE \n @StartDate DATE = '01/09/2017'\n ,@EndDate DATE = '05/09/2017'\n ,@0900 INT = 540\n\nSELECT \n DATEADD(DAY, nbr - 1, @StartDate) [Date]\n ,CONVERT(DATETIME,(DATEADD(DAY, nbr - 1, @StartDate))) [MidnightDate]\n ,DATEADD(mi, @0900,(CONVERT(DATETIME,(DATEADD(DAY, nbr - 1, @StartDate))))) [0900Date]\n\nFROM \n( \nSELECT \nROW_NUMBER() OVER ( ORDER BY c.object_id ) AS nbr\nFROM sys.columns c\n) nbrs\n\nWHERE nbr - 1 \u0026lt;= DATEDIFF(DAY, @StartDate, @EndDate)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe stumbling block I’ve hit is how to join the cte to the WardStays dataset, because there’s no appropriate key… I’ve tried a few iterations of using a subquery to make this work, but either I’m taking the wrong approach or I’m getting my syntax in a mess.\u003c/p\u003e\n\n\u003cp\u003eIn simple terms, the logic I’m trying to create to get the output is something like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT\n[Date]\n,SUM (case when WST.Ward_Start_Date_Time \u0026lt;= [MidnightDate] AND (WST.Ward_End_Date_Time \u0026gt;= [MidnightDate] OR WST.Ward_End_Date_Time IS NULL then 1 else 0 end) [No. Beds Occupied at 00:00]\n,SUM (case when WST.Ward_Start_Date_Time \u0026lt;= [0900Date] AND (WST.Ward_End_Date_Time \u0026gt;= [0900Date] OR WST.Ward_End_Date_Time IS NULL then 1 else 0 end) [No. Beds Occupied at 09:00]\n\nFROM WardStaysTable WST\n\nGROUP BY [Date]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs the above somehow possible, or am I barking up the wrong tree and need to take a different approach altogether? Appreciate any advice.\u003c/p\u003e","accepted_answer_id":"47178757","answer_count":"2","comment_count":"0","creation_date":"2017-11-08 11:13:39.507 UTC","last_activity_date":"2017-11-08 13:40:41.647 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3834961","post_type_id":"1","score":"0","tags":"sql|sql-server|sql-server-2008|tsql","view_count":"55"} +{"id":"11546048","title":"Regular Expression for Removing (nested) Parentheses","body":"\u003cp\u003eI am using DOM to get a Wikipedia article as a NSString and then using NSString stringByReplacingOccurrencesOfString:withString:options:range: to remove unneeded things. I'm using regular expressions, which I don't have much experience with. From reading Apple's documentation and just trying things I was able to make this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\"\\\\[[\\\\w]+\\\\]\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eregular expression which removes the brackets from the Wikipedia article. This works perfectly fine because brackets aren't nested.\u003c/p\u003e\n\n\u003cp\u003eNow I am trying to remove parentheses (including everything inside them (and nested ones)) from the NSString. I'm having problems with the nesting part. With this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\\\\s+\\\\([^\\\\)]*+\\\\)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eregular expression I was able to remove a set of parentheses including the space before it (so I don't end up with duplicate spaces after is removed). What regular expression could I use to do this same thing but also remove nested parentheses instead?\u003c/p\u003e\n\n\u003cp\u003eMy current implementation will change this\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eThe quick brown (slightly reddish) fox jumped over the lazy (he was old (26 years) and exhausted) dog.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003einto this\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eThe quick brown fox jumped over the lazy and exhausted) dog.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003ewhile the desired result is this\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eThe quick brown fox jumped over the lazy dog.\u003c/p\u003e\n\u003c/blockquote\u003e","accepted_answer_id":"11547880","answer_count":"1","comment_count":"7","creation_date":"2012-07-18 16:28:05.143 UTC","last_activity_date":"2012-07-18 18:22:53.227 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"913052","post_type_id":"1","score":"3","tags":"objective-c|regex|nsstring","view_count":"957"} +{"id":"42625736","title":"How can I draw simple lines (flows) between arcs in D3.js?","body":"\u003cp\u003eThis is my circle. I want to draw flow lines between the circle arcs. How can I do it in D3.js. \u003c/p\u003e\n\n\u003cp\u003eFYI I know about \u003ca href=\"https://bl.ocks.org/mbostock/4062006\" rel=\"nofollow noreferrer\"\u003ehttps://bl.ocks.org/mbostock/4062006\u003c/a\u003e. What I want is instead of those wide chords I want simple lines like so.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/1JFzh.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/1JFzh.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar arcGenerator = d3.arc()\n .innerRadius(80)\n .outerRadius(100)\n .padAngle(.02)\n .padRadius(100)\n .cornerRadius(4);\n\nvar arcData = [\n {startAngle: 0, endAngle: 1.3},\n {startAngle: 1.3, endAngle: 2.6},\n {startAngle: 2.6, endAngle: 3},\n {startAngle: 3, endAngle: 4},\n {startAngle: 4, endAngle: 2* Math.PI}\n];\n\nd3.select('g')\n .selectAll('path')\n .data(arcData)\n .enter()\n .append('path')\n .attr('d', arcGenerator);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is a simple codepen: \n \u003ca href=\"http://codepen.io/ioan-ungurean/pen/aJNWMM\" rel=\"nofollow noreferrer\"\u003ehttp://codepen.io/ioan-ungurean/pen/aJNWMM\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"42786939","answer_count":"2","comment_count":"0","creation_date":"2017-03-06 12:31:16.213 UTC","last_activity_date":"2017-03-14 13:10:40.143 UTC","last_edit_date":"2017-03-06 12:43:53.497 UTC","last_editor_display_name":"","last_editor_user_id":"6055311","owner_display_name":"","owner_user_id":"6055311","post_type_id":"1","score":"0","tags":"javascript|d3.js","view_count":"59"} +{"id":"29789609","title":"Best way for images css","body":"\u003cp\u003eOops, wrong snippet– had to change it back. Creating new question now\u003c/p\u003e","answer_count":"2","comment_count":"7","creation_date":"2015-04-22 06:38:16.177 UTC","last_activity_date":"2015-04-25 05:36:04.437 UTC","last_edit_date":"2015-04-25 05:36:04.437 UTC","last_editor_display_name":"","last_editor_user_id":"622537","owner_display_name":"","owner_user_id":"622537","post_type_id":"1","score":"-3","tags":"javascript|jquery|css","view_count":"55"} +{"id":"21378712","title":"How to use fields in Comfortable Mexican Sofa?","body":"\u003cp\u003eI have seen in documentation that fields are not rendered in the view, and instead it can be used in helpers, partials etc. but I can't find a way how they are used.\nThe documentation says to use it like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{{ cms:field:some_label }} \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut I am courios how can I use that? I wanted to be able to define some text in the snippet and then, use that field in my partial or in my helper function to form some data that will be used in the view. Can somebody tell me how can I use fields in this CMS?\u003c/p\u003e","accepted_answer_id":"21392168","answer_count":"1","comment_count":"3","creation_date":"2014-01-27 10:43:35.757 UTC","last_activity_date":"2015-04-22 23:33:57.62 UTC","last_edit_date":"2014-01-27 21:36:58.85 UTC","last_editor_display_name":"","last_editor_user_id":"442637","owner_display_name":"","owner_user_id":"1612469","post_type_id":"1","score":"3","tags":"ruby-on-rails|comfortable-mexican-sofa","view_count":"1208"} +{"id":"6104991","title":"Transparent colors Tkinter","body":"\u003cp\u003eIs it possible to change the color of a frame background or any other widget to transparent light blue or any other transparent color?\u003c/p\u003e","accepted_answer_id":"6107006","answer_count":"1","comment_count":"0","creation_date":"2011-05-24 01:58:42.903 UTC","favorite_count":"0","last_activity_date":"2011-05-24 07:57:18.663 UTC","last_edit_date":"2011-05-24 02:26:49.877 UTC","last_editor_display_name":"","last_editor_user_id":"365102","owner_display_name":"","owner_user_id":"724408","post_type_id":"1","score":"4","tags":"tkinter","view_count":"5067"} +{"id":"11345203","title":"jQuery: Pause or delay a function","body":"\u003cp\u003eSo here's the situation:\u003c/p\u003e\n\n\u003cp\u003eI have a recursive, asynchronous AJAX call which is pulling data from the server. This recursive call happens only once when the user logs in. \nI have another page which requires AJAX calls in order to navigate (basically a lazy-loaded tree). While the first AJAX call is happening, these other calls are taking a while to go through, and since the first could make as many as 2,000 requests, this delay can sometimes be fairly long.\u003c/p\u003e\n\n\u003cp\u003eBasically what I would like to achieve is to \"pause\" the recursive call when the other call is made. Pseudo code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction recursiveAjax(){ \n $.ajax( {\n async : true,\n url : 'someurl',\n dataType : 'json',\n beforeSend : function(xhr) {\n // do stuff\n },\n error : function(xhr, ajaxOptions, thrownError) {\n // handle errors\n },\n success : function(data) {\n //conditions\n recursiveAjax();\n }\n });\n}\n\nfunction navigationAjax(){ \n $.ajax( {\n async : true,\n url : 'someurl',\n dataType : 'json',\n beforeSend : function(xhr) {\n // pause recursiveAjax();\n },\n error : function(xhr, ajaxOptions, thrownError) {\n // handle errors\n },\n success : function(data) {\n //conditions\n // resume recursiveAjax();\n }\n });\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"11345599","answer_count":"3","comment_count":"2","creation_date":"2012-07-05 13:20:09.477 UTC","last_activity_date":"2016-05-29 13:48:29.353 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1341766","post_type_id":"1","score":"0","tags":"jquery|ajax","view_count":"750"} +{"id":"47462512","title":"HtmlService.createTemplateFromFile does not output","body":"\u003cp\u003eI am not a software engineer but wrote quite some Google Apps scripts. However I've got virtually no experience on the GUI side, but now I implemented a script for seat reservations which requires an input dialog (working) and a confirmation page (the problem).\u003c/p\u003e\n\n\u003cp\u003eThe entire script works, but the resulting confirmation page remains empty. \u003c/p\u003e\n\n\u003cp\u003eThe relevant code snipplet (all used variables are properly defined):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e// Make a web page\nvar template = HtmlService.createTemplateFromFile('thank_you.html');\ntemplate.msg = 'Eine Buchung erscheint demnächst in Ihrem \u0026lt;a target=\"_blank\" href=\"https://www.google.com/calendar/\"\u0026gt;persönlichen Kalender\u0026lt;/a\u0026gt;.';\ntemplate.email = email;\ntemplate.header = title;\nLogger.log(template.getCodeWithComments());\nreturn template.evaluate().setTitle('Vielen Dank für Ihre Buchung');\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd the getCSS() function:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction getCSS(){\n var template = HtmlService.createTemplateFromFile('css.html');\n return template.getRawContent();\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am am using the same approach to create the input form which is working,but this simple confirmation page remains emppty.\nI tried many different approaches for hours but I do not see the problem! What am I missing?\u003c/p\u003e\n\n\u003cp\u003eThe resulting execution log does not show any problem, as far as I can see it, at least I can see, that values are assigned:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e[17-11-23 11:36:33:447 PST]\n HtmlService.createTemplateFromFile([thank_you.html]) [0.001 seconds]\n [17-11-23 11:36:33:451 PST] Function.apply([[]]) [0.004 seconds]\n [17-11-23 11:36:33:452 PST] Logger.log([(function() { return eval('var\n output = HtmlService.initTemplate(); output._ = \\'\\n\\';\\n' + \n // 'output._ = \\'\\n\\' +\\n' +\u003cbr\u003e\n , []]...) [0 seconds] [17-11-23 11:36:33:453 PST] Function.apply([[]])\n [0 seconds] [17-11-23 11:36:33:453 PST] HtmlService.createHtmlOutput()\n [0 seconds] [17-11-23 11:36:33:454 PST] HtmlOutput.append([ ])\n [0 seconds] [17-11-23 11:36:33:455 PST] HtmlOutput.append([\n ]) [0 seconds] [17-11-23 11:36:33:457 PST] HtmlService.createTemplateFromFile([css.html]) [0.001 seconds]\n [17-11-23 11:36:33:457 PST] Function.apply([[]]) [0 seconds] [17-11-23\n 11:36:33:458 PST] HtmlOutput.append([\u003c/p\u003e\n \n \u003ch1\u003epage{\u003c/h1\u003e\n\n\u003cpre\u003e\u003ccode\u003e font-family: Arial, Helvetica, sans-serif;\n margin-top:50px;\n padding-top:260px;\n text-align: left;\n font-size: 1.3em;\n background: no-repeat 0px 0px; ]...) [0 seconds] [17-11-23 11:36:33:458 PST] HtmlOutput.append([ \u0026lt;/head\u0026gt; ]) [0 seconds]\n\u003c/code\u003e\u003c/pre\u003e\n \n \u003cp\u003e[17-11-23 11:36:33:459 PST] HtmlOutput.append([ \n \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;h3\u0026gt;]) [0 seconds] [17-11-23 11:36:33:459 PST] HtmlOutput.appendUntrusted([Buchung Scheibe 1]) [0 seconds] [17-11-23\n\u003c/code\u003e\u003c/pre\u003e\n \n \u003cp\u003e11:36:33:460 PST] HtmlOutput.append([ ]) [0 seconds] [17-11-23\n 11:36:33:460 PST] HtmlOutput.append([\u003cbr\u003e\n \u003cp\u003e\n ]) [0 seconds] [17-11-23 11:36:33:460 PST] HtmlOutput.appendUntrusted([heinz.ruffieux@ondemandmanagement.net]) [0\n seconds] [17-11-23 11:36:33:461 PST] HtmlOutput.append([ \u003c/p\u003e\n ]) [0 seconds] [17-11-23 11:36:33:461 PST] HtmlOutput.append([ \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;p\u0026gt;]) [0 seconds] [17-11-23 11:36:33:462 PST] HtmlOutput.append([Eine Buchung erscheint demnächst in Ihrem \u0026lt;a\n\u003c/code\u003e\u003c/pre\u003e\n \n \u003cp\u003etarget=\"_blank\" href=\"https://www.google.com/calendar/\"\u003epersönlichen\n Kalender.]) [0 seconds] [17-11-23 11:36:33:462 PST]\n HtmlOutput.append([\u003c/p\u003e ]) [0 seconds] [17-11-23 11:36:33:463 PST]\n HtmlOutput.append([ \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;/div\u0026gt;\n \u0026lt;/body\u0026gt; \u0026lt;/html\u0026gt; ]) [0 seconds] [17-11-23 11:36:33:463 PST] HtmlOutput.append([]) [0 seconds] [17-11-23 11:36:33:464 PST]\n\u003c/code\u003e\u003c/pre\u003e\n \n \u003cp\u003eHtmlOutput.setTitle([Vielen Dank für Ihre Buchung]) [0 seconds]\n [17-11-23 11:36:33:549 PST] HtmlOutput.getContent() [0 seconds]\n [17-11-23 11:36:33:549 PST] HtmlOutput.getTitle() [0 seconds]\n [17-11-23 11:36:33:551 PST] Execution succeeded [0.506 seconds total\n runtime]\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eHowever, the Logger.log(template.getCodeWithComments()); then shows the following, empty output:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edoPost()\n(function() { return eval('var output = HtmlService.initTemplate(); output._ = \\'\u0026lt;html\u0026gt;\\\\n\\';\\n' + // \u0026lt;html\u0026gt;\n 'output._ = \\'\u0026lt;head\u0026gt;\\\\n\\' +\\n' + // \u0026lt;head\u0026gt;\n ' \\' \\'; output._ = getCSS(); \\n' + // \u0026lt;?!= getCSS()?\u0026gt;\n 'output._ = \\' \u0026lt;/head\u0026gt;\\\\n\\';\\n' + // \u0026lt;/head\u0026gt;\n 'output._ = \\' \\\\n\\' +\\n' + // \n ' \\' \u0026lt;body\u0026gt;\\\\n\\' +\\n' + // \u0026lt;body\u0026gt;\n ' \\' \u0026lt;div id=\\\\\\\"page\\\\\\\" \u0026gt;\\\\n\\' +\\n' + // \u0026lt;div id=\"page\" \u0026gt;\n ' \\' \\\\n\\' +\\n' + // \n ' \\' \u0026lt;h3\u0026gt;\\'; output._$ = header ; output._ = \\'\u0026lt;/h3\u0026gt;\\\\n\\';\\n' + // \u0026lt;h3\u0026gt;\u0026lt;?= header ?\u0026gt;\u0026lt;/h3\u0026gt;\n 'output._ = \\' \\\\n\\' +\\n' + // \n ' \\' \u0026lt;p\u0026gt;\\\\n\\' +\\n' + // \u0026lt;p\u0026gt;\n ' \\' \\'; output._$ = email; \\n' + // \u0026lt;?= email?\u0026gt;\n 'output._ = \\' \u0026lt;/p\u0026gt;\\\\n\\';\\n' + // \u0026lt;/p\u0026gt;\n 'output._ = \\' \\\\n\\' +\\n' + // \n ' \\' \u0026lt;p\u0026gt;\\'; output._ = msg ; output._ = \\'\u0026lt;/p\u0026gt;\\\\n\\';\\n' + // \u0026lt;p\u0026gt;\u0026lt;?!= msg ?\u0026gt;\u0026lt;/p\u0026gt;\n 'output._ = \\' \\\\n\\' +\\n' + // \n ' \\' \\\\n\\' +\\n' + // \n ' \\'\\\\n\\' +\\n' + // \n ' \\' \\\\n\\' +\\n' + // \n ' \\' \u0026lt;/div\u0026gt;\\\\n\\' +\\n' + // \u0026lt;/div\u0026gt;\n ' \\' \\\\n\\' +\\n' + // \n ' \\' \\\\n\\' +\\n' + // \n ' \\' \u0026lt;/body\u0026gt;\\\\n\\' +\\n' + // \u0026lt;/body\u0026gt;\n ' \\'\u0026lt;/html\u0026gt;\\\\n\\';\\n' + // \u0026lt;/html\u0026gt;\n '\\n' + // \n '/* End of user code */\\n' +\n 'output.$out.append(\\'\\');');\n})();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe thank_you.html file:\u003c/p\u003e\n\n\u003cblockquote\u003e\n\u003cpre\u003e\u003ccode\u003e\u0026lt;html\u0026gt; \u0026lt;head\u0026gt;\n\u0026lt;?!= getCSS()?\u0026gt; \u0026lt;/head\u0026gt;\n \u0026lt;body\u0026gt;\n \u0026lt;div id=\"page\" \u0026gt;\n\n \u0026lt;h3\u0026gt;\u0026lt;?= header ?\u0026gt;\u0026lt;/h3\u0026gt;\n\n \u0026lt;p\u0026gt;\n \u0026lt;?= email?\u0026gt;\n \u0026lt;/p\u0026gt;\n\n \u0026lt;p\u0026gt;\u0026lt;?!= msg ?\u0026gt;\u0026lt;/p\u0026gt;\n\n \u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n \n \u003cp\u003e \u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eThe css file (used in the working form as well):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;style\u0026gt;\n\n\n#page{\n font-family: Arial, Helvetica, sans-serif;\n margin-top:50px;\n padding-top:260px;\n text-align: left;\n font-size: 1.3em;\n background: no-repeat 0px 0px;\n width:600px;\n margin-left:auto;\n margin-right:auto;\n border:1px solid #DDD;\n padding-bottom:20px;\n padding-left:20px;\n }\n\n input#email{\n font-size:1.1em;\n }\n\n input#submit{\n -webkit-appearance: button;\n margin-top:10px;\n height: 50px;\n font-size:1.7em;\n\n }\n\n .submitbutton {\n -webkit-appearance: button;\n font-size:30px;\n }\n\n .small{\n font-size:12px;\n }\n\u0026lt;/style\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs there anyone who sees the problem?\u003c/p\u003e\n\n\u003cp\u003eThanks a lot for your help.\u003c/p\u003e\n\n\u003cp\u003eHeinz\u003c/p\u003e","answer_count":"0","comment_count":"5","creation_date":"2017-11-23 19:50:43.917 UTC","last_activity_date":"2017-11-24 13:38:34.6 UTC","last_edit_date":"2017-11-24 10:35:24.477 UTC","last_editor_display_name":"","last_editor_user_id":"1955916","owner_display_name":"","owner_user_id":"1955916","post_type_id":"1","score":"1","tags":"html|css|google-apps-script","view_count":"38"} +{"id":"13062784","title":"Why is the entire HorizontalFieldManager clickable?","body":"\u003cp\u003eI have added buttons on my setStatus method in the MainScreen. Now the entire HFM is clickable I don't know why? Please guide. Here's the code:\n\u003cbr/\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e setStatus(setFooter());\n ...\n public Field setFooter() {\n\n HorizontalFieldManager hfm1 = new HorizontalFieldManager(USE_ALL_WIDTH|Manager.NO_HORIZONTAL_SCROLL|Manager.NO_HORIZONTAL_SCROLLBAR);\n\n Bitmap bm;\n bm = Bitmap.getBitmapResource(\"statusImage.PNG\");\n Background bg = BackgroundFactory.createBitmapBackground(bm, Background.POSITION_X_LEFT, Background.POSITION_Y_BOTTOM, Background.REPEAT_SCALE_TO_FIT);\n hfm1.setBackground(bg);\n hfm1.add(new DummyField(bm.getHeight()));\n hfm1.add(backButton);\n hfm1.add(nextButton);\n\n return hfm1;\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe dummy field: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass DummyField extends Field {\n private int logoHeight;\n\n public DummyField(int height) {\n logoHeight = height;\n }\n\n protected void layout(int width, int height) {\n setExtent(1, logoHeight);\n }\n\n protected void paint(Graphics graphics) {\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have also overridden these methods(\u003ca href=\"http://supportforums.blackberry.com/t5/Java-Development/navigationClick-invoked-when-clicking-outside-of-a-field/m-p/270517#M45052\" rel=\"nofollow\"\u003elionscribe implementation\u003c/a\u003e) to avoid HFM from being clickable but it doesn't work: \n\u003cbr/\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprotected boolean touchEvent(TouchEvent message)\n {\n int event = message.getEvent();\n if (event == TouchEvent.CLICK || event == TouchEvent.UNCLICK)\n {\n // Ignore clcik events that happen outside any fields\n if (getFieldAtLocation(message.getX(1), message.getY(1)) == -1)\n return true; // kill the event\n }\n return super.touchEvent(message);\n }\n\n // The regular getFieldAtLocation returns wrong values in open spaces in complex managers, so we override it\n public int getFieldAtLocation(int x, int y)\n {\n XYRect rect = new XYRect();\n int index = getFieldCount() -1;\n while (index \u0026gt;= 0)\n {\n getField(index).getExtent(rect);\n if (rect.contains(x, y))\n break;\n --index;\n }\n return index;\n }\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2012-10-25 06:25:14.973 UTC","last_activity_date":"2012-10-29 06:05:52.453 UTC","last_edit_date":"2012-10-25 08:43:47.887 UTC","last_editor_display_name":"","last_editor_user_id":"813951","owner_display_name":"","owner_user_id":"1421553","post_type_id":"1","score":"0","tags":"java|blackberry|blackberry-eclipse-plugin|blackberry-jde","view_count":"77"} +{"id":"46524485","title":"Optimizing query with left outer join and comma-separated-string","body":"\u003cp\u003eI have tables in my db called Items, which are in a relationships with ItemParents table. One item can have one parent, one parent can have multiple items (something like file-folder tree structure). I have a third table called ParentPermissions and in this table I have the permissions if a user depending on its role can view the parent. If he can view the parent, he can view the item too. In this table we save the relationships between the parent and the userroles that CAN NOT view the parent.\u003c/p\u003e\n\n\u003cp\u003eFor example, for parentId = 1, if there is no data in the table ParentPermissions for this parent, all users can see it. If there is data with values \"5,6\" in ParentPermissions for parentId = 1, then the users with roles 5 and6 can't see this folder. Users with role 4 can see it.\u003c/p\u003e\n\n\u003cp\u003eThis is my query:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT count(*)\nFROM Items item\nINNER JOIN ItemParents parent ON parent.id = item.parentId\nLEFT OUTER JOIN ParentPermissions permissions ON permissions.folderId = parent.id\nWHERE permissions.view IS NULL OR (permissions.view != CONVERT(VARCHAR(5), @userRole + ',%') AND permissions.view != CONVERT(VARCHAR(5), @userRole) AND permissions.view != CONVERT(VARCHAR(5), '%,' + @userRole))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to somehow optimize this query because it is called a lot of times. How do I do that?\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2017-10-02 11:20:16.467 UTC","last_activity_date":"2017-10-02 11:38:32.257 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"966638","post_type_id":"1","score":"0","tags":"tsql","view_count":"22"} +{"id":"2901173","title":"Moq basic questions","body":"\u003cp\u003eI made the following test for my class:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar mock = new Mock\u0026lt;IRandomNumberGenerator\u0026gt;();\nmock.Setup(framework =\u0026gt; framework.Generate(0, 50))\n .Returns(7.0);\n\nvar rnac = new RandomNumberAverageCounter(mock.Object, 1, 100);\nrnac.Run();\ndouble result = rnac.GetAverage();\nAssert.AreEqual(result, 7.0, 0.1);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe problem here was that I changed my mind about what range of values \u003ccode\u003eGenerate(int min, int max)\u003c/code\u003e would use. So in \u003ccode\u003eMock.Setup()\u003c/code\u003e I defined the range as from \u003ccode\u003e0 to 50\u003c/code\u003e while later I actually called the \u003ccode\u003eGenerate()\u003c/code\u003e method with a range from \u003ccode\u003e1 to 100\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eI ran the test and it failed. I know that that is what it's supposed to happen but I was left wondering if isn't there a way to launch an exception or throw in a message when trying to run the method with wrong params.\u003c/p\u003e\n\n\u003cp\u003eAlso, if I want to run this Generate() method 10 times with different values (let's say, from 1 to 10), will I have to make 10 mock setups or something, or is there a special method for it? The best I could think of is this (which isn't bad, I'm just asking if there is other better way):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efor (int i = 1; i \u0026lt; 10; ++i) {\n mock.Setup(framework =\u0026gt; framework.Generate(1, 100))\n .Returns((double)i);\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2010-05-24 23:56:34.207 UTC","last_activity_date":"2010-06-15 20:48:24.967 UTC","last_edit_date":"2010-06-15 20:45:17.827 UTC","last_editor_display_name":"","last_editor_user_id":"11635","owner_display_name":"","owner_user_id":"130758","post_type_id":"1","score":"1","tags":"mocking|moq","view_count":"229"} +{"id":"409612","title":"What architecture do VoIP applications use, P2P or Client-Server?","body":"\u003cp\u003ePlease let me know what architecture do VoIP applications use, P2P or Client-Server?\u003c/p\u003e\n\n\u003cp\u003eThank you.\u003c/p\u003e","accepted_answer_id":"409638","answer_count":"2","comment_count":"0","creation_date":"2009-01-03 19:13:51.907 UTC","favorite_count":"1","last_activity_date":"2009-01-03 19:30:33.543 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"50819","post_type_id":"1","score":"4","tags":"p2p|voip","view_count":"1774"} +{"id":"37642378","title":"How do I divide my Rust code between two source files?","body":"\u003cp\u003eUpdated in response to \"possible duplicate\"\u003c/p\u003e\n\n\u003cp\u003eYes, the indicated question, \u003ca href=\"https://stackoverflow.com/questions/37610079\"\u003e\"Can't understand Rust module system\"\u003c/a\u003e solved my problem, for which my thanks.\u003c/p\u003e\n\n\u003cp\u003eHowever, as part of my question, I also asked for pointers into the documentation \"where I missed this\"; it would be nice to have an answer to that, too, even if the answer is \"it's not explained simply\". (which is OK - I appreciate there's lots of work done and to do.)\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003eI'm starting to learn Rust, from a background of z/Assembler, Python, Go, and some C; but no C++ or Java.\u003c/p\u003e\n\n\u003cp\u003eI've successfully built and executed the \"Hello World!\" example, and a couple of other monolithic \u003ccode\u003emain.rs\u003c/code\u003e. For one of these, I've tried to separate my utility functions into a separate source file, but I can't get it to build, and I confess I find the documentation a bit incomprehensible. (All due respect to the authors; I'm sure it's me.)\u003c/p\u003e\n\n\u003cp\u003eSo for a minimum non-working example, I went back to hallo world.\u003c/p\u003e\n\n\u003cp\u003eIn my src/ directory, I have two files:\u003c/p\u003e\n\n\u003cp\u003esay.rs:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emod say {\n pub fn say() {\n println!(\"Hello, world!\");\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003emain.rs:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epub mod say;\nfn main() {\n say();\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003ccode\u003ecargo build\u003c/code\u003e gives me this error message:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eD:\\Development\\Rust\\hw\\src\u0026gt;cargo build\n Compiling hw v0.1.0 (file:///D:/Development/Rust/hw)\nmain.rs:3:5: 3:8 error: unresolved name `say` [E0425]\nmain.rs:3 say();\n ^~~\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eetc. I've also tried calling as \u003ccode\u003esay::say()\u003c/code\u003e, but with the same answer.\u003c/p\u003e\n\n\u003cp\u003eI've come to the conclusion that I'm missing something pretty fundamental here. Could someone please explain where I've gone wrong, and, hopefully, give a pointer into the book where I should have seen this?\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2016-06-05 13:19:11.33 UTC","last_activity_date":"2016-06-05 14:35:30.233 UTC","last_edit_date":"2017-05-23 11:58:46.867 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"9634","post_type_id":"1","score":"0","tags":"module|include|rust","view_count":"51"} +{"id":"246495","title":"What mutation-testing frameworks exist?","body":"\u003cp\u003eIn another \u003ca href=\"https://stackoverflow.com/questions/242650/is-mutation-testing-useful-in-practice\"\u003equestion\u003c/a\u003e I asked if \u003ca href=\"http://en.wikipedia.org/wiki/Mutation_testing\" rel=\"nofollow noreferrer\"\u003emutation-testing\u003c/a\u003e is useful in practice. As I didn't get any answers that satisfy me, I want to check the current tools myself. So I need an overview about current existing mutation-test-frameworks. Which of them are most usable and why?\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eI program in Java, so I would prefer Java-tools, but I would risk a look at interesting frameworks for different languages.\u003c/li\u003e\n\u003cli\u003eI want to integrate in an automatic build-process, so I would prefer tools that can be executed through command-line.\u003c/li\u003e\n\u003c/ul\u003e","answer_count":"11","comment_count":"0","creation_date":"2008-10-29 11:47:13.19 UTC","favorite_count":"15","last_activity_date":"2012-10-22 13:46:00.997 UTC","last_edit_date":"2017-05-23 12:17:05.463 UTC","last_editor_display_name":"Harleqin","last_editor_user_id":"-1","owner_display_name":"Mnementh","owner_user_id":"21005","post_type_id":"1","score":"30","tags":"unit-testing|frameworks|mutation-testing","view_count":"6147"} +{"id":"43201036","title":"Converting varchar values to decimal while handling NULLs and EMPTY strings as 0","body":"\u003cp\u003eI have a column of varchar datatype populated with a mix of values such as 1.2, 5.33 while also having NULLs and EMPTY strings.\nI want to convert all the values to decimal while treating NULLs and EMPTY strings as 0.\u003c/p\u003e\n\n\u003cp\u003eI can change the NULLs or EMPTY strings using the CONVERT function like below. Like this I replace the NULLs and EMPTY strings with a varhcar 0.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCASE WHEN Column1 = '' OR Column1= NULL THEN '0' ELSE Column1 END AS 'NewColumn1'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever what I want to do is to be able to then convert this data (output of NewColumn1) into decimal but when I place the CASE statement into a CONVERT or a CAST function I will have errors.\u003c/p\u003e\n\n\u003cp\u003eI also tried the following.\nC\u003ccode\u003eONVERT(DECIMAL(10,4), ISNULL(Column1, '0'))\u003c/code\u003e however it fails since here I am not handling the EMPTY strings.\u003c/p\u003e\n\n\u003cp\u003eAny ideas how can I solve this problem.\u003c/p\u003e","accepted_answer_id":"43201124","answer_count":"2","comment_count":"2","creation_date":"2017-04-04 07:37:03.363 UTC","last_activity_date":"2017-10-11 10:06:27.203 UTC","last_edit_date":"2017-10-11 10:06:27.203 UTC","last_editor_display_name":"","last_editor_user_id":"1000551","owner_display_name":"","owner_user_id":"2307236","post_type_id":"1","score":"0","tags":"sql|sql-server|string|tsql|sql-convert","view_count":"593"} +{"id":"15286232","title":"How to trigger the java agent from xpage button click event?","body":"\u003cp\u003eI'd like to test java agent to clear all the documents in a view by triggering the button click event on my xpage. I have no errors in java agent, but it is not working. Could you help me out to get through this stage?\u003c/p\u003e\n\n\u003cp\u003e\u003cem\u003eButton click event:\u003c/em\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar serverName=session.getCurrentDatabase().getServer();\n//@WarningMessage(\"current one\");\n//@WarningMessage(\"server=\" + serverName);\n//var db:NotesDatabase = session.getDatabase(session.getCurrentDatabase().getServer(), \"\\ProTexII.nsf\");\nvar db:NotesDatabase=session.getCurrentDatabase();\n@WarningMessage(\"db=\" + db);\n\nvar agent:NotesAgent = db.getAgent(\"SnapShotUpdate\");\n@WarningMessage(\"agent\" + agent);\n\nif (agent!=null){\n\n agent.run();\n @WarningMessage(\"view is fired!\");\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cem\u003eJava agent:\u003c/em\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epackage javaPkg;\nimport java.io.PrintWriter;\n\nimport lotus.domino.*;\n\npublic class SnapShotUpdate extends AgentBase{\n\n public void NotesMain() {\n try {\n\n //String p = session.getPlatform();\n //PrintWriter out=getAgentOutput();\n\n System.out.println(\"Hello i never give it up!!\");\n\n\n Session session = getSession();\n AgentContext agentContext =session.getAgentContext();\n Database db=session.getCurrentDatabase();\n\n\n //**clear view \"vActualSalesFromSD\" before copying documents into it\n\n DocumentCollection dc= db.createDocumentCollection();\n View view= db.getView(\"vActualSalesFromSD\");\n Document docToBeCleared= view.getFirstDocument();\n\n while (docToBeCleared != null) {\n\n {\n dc.addDocument(docToBeCleared);\n }\n\n docToBeCleared = view.getNextDocument(docToBeCleared);\n }\n\n dc.removeAll(true);\n } catch(Exception e) {\n e.printStackTrace();\n }\n }\n\n\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"4","creation_date":"2013-03-08 03:30:35.87 UTC","last_activity_date":"2013-03-08 06:14:29.9 UTC","last_edit_date":"2013-03-08 03:34:01.47 UTC","last_editor_display_name":"","last_editor_user_id":"964135","owner_display_name":"","owner_user_id":"1371725","post_type_id":"1","score":"0","tags":"java|xpages|lotus-domino|lotus","view_count":"1425"} +{"id":"44681702","title":"Spring Quartz entries missing in some tables","body":"\u003cp\u003eIn Spring 4.x and Quartz 2.3.x, the creation of new jobs in the database is failing due to \u003ccode\u003eDeadlock found when trying to get lock; try restarting transaction\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eAnd I have a similar process running on a different set of Quartz Mysql database tables, which doesn't have this issue. The number of jobs in these tables are almost 3 times the other table.\u003c/p\u003e\n\n\u003cp\u003eSo I don't understand why the it is happening on tables with low volume.\u003c/p\u003e\n\n\u003cp\u003eAlso even with deadlock the entries are made into jobs table, but not into simple triggers and triggers table. Why would this happen ?\u003c/p\u003e\n\n\u003cp\u003eBelow is detailed stack trace.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eorg.quartz.JobPersistenceException: Couldn't store trigger 'SDTriggerGroup.SDTrigger__10416434' for 'SDJobGroup.SDJob__10416434' job:Deadlock found when trying to get lock; try restarting transaction [See nested exception: com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Deadlock found when trying to get lock; try restarting transaction] at org.quartz.impl.jdbcjobstore.JobStoreSupport.storeTrigger(JobStoreSupport.java:1223) at org.quartz.impl.jdbcjobstore.JobStoreSupport$2.executeVoid(JobStoreSupport.java:1063) at org.quartz.impl.jdbcjobstore.JobStoreSupport$VoidTransactionCallback.execute(JobStoreSupport.java:3719) at org.quartz.impl.jdbcjobstore.JobStoreSupport$VoidTransactionCallback.execute(JobStoreSupport.java:3717) at org.quartz.impl.jdbcjobstore.JobStoreCMT.executeInLock(JobStoreCMT.java:245) at org.quartz.impl.jdbcjobstore.JobStoreSupport.storeJobAndTrigger(JobStoreSupport.java:1058) at org.quartz.core.QuartzScheduler.scheduleJob(QuartzScheduler.java:886) at org.quartz.impl.StdScheduler.scheduleJob(StdScheduler.java:249)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny clues on how to handle this gracefully ?\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-06-21 16:36:33.31 UTC","last_activity_date":"2017-06-21 16:36:33.31 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"898801","post_type_id":"1","score":"0","tags":"java|spring|quartz-scheduler","view_count":"26"} +{"id":"8358809","title":"makefile with categories","body":"\u003cp\u003eImagine I have files that are categorized in my mind but cannot be distinguished by any kind of naming scheme, and they reside in the same directory:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eapple cherry celery onion\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have two rules, one recipe for pie and one for soup.\u003c/p\u003e\n\n\u003cp\u003eIf I implement these recipes as implicit rules:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efruits:= apple cherry\nvegetables:= celery onion\n\n%.soup : %\n @echo \"making soup\"\n cp $\u0026lt; $@\n\n%.pie : %\n @echo \"making pie\"\n cp $\u0026lt; $@\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThen I allow terrible meals to be constructed:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026gt; touch celery\n\u0026gt; make celery.pie\nmaking pie \ncp celery celery.pie #bleech this should not be allowed\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut if I use explicit rules:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efruits:= apple cherry\nvegetables:= celery onion\n\npies:=$(addsuffix .pie,$(fruits))\nsoups:=$(addsuffix .soup,$(vegetables))\n\n$(pies) : $(fruits)\n @echo \"making pie\"\n cp $\u0026lt; $@\n\n\n$(soups) : $(vegetables)\n @echo \"making soup\"\n cp $\u0026lt; $@\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am forced to establish dependencies that don't exist in reality:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026gt; touch apple\n\u0026gt; make apple.pie\nmake: *** No rule to make target `cherry', needed by `apple.pie'. Stop.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow can I tell Make about file categories?\u003c/p\u003e","accepted_answer_id":"8360005","answer_count":"1","comment_count":"0","creation_date":"2011-12-02 15:43:12.96 UTC","last_activity_date":"2011-12-02 17:11:29.8 UTC","last_edit_date":"2011-12-02 15:49:25.907 UTC","last_editor_display_name":"","last_editor_user_id":"264696","owner_display_name":"","owner_user_id":"264696","post_type_id":"1","score":"1","tags":"makefile","view_count":"71"} +{"id":"20750139","title":"declared variable doesn't seem global","body":"\u003cp\u003eI declared my variable first - then have my jquery : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar cimg = '';\njQuery(function($) {\n $(\".trigger\").click(function() {\n var cimg = event.target.id;\n clickedimage();\n loadPopup();\n});\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThen the script outside the jquery :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction clickedimage()\n {\n var xmargin = $(cimg).width()/2;\n var ymargin = $(cimg).height()/2;\n $(\"#popupimage\").css('margin-left',-xmargin+'px')\n $(\"#popupimage\").css('margin-top',-ymargin+'px')\n var Clicked = cimg.src;\n $('#popupimage').attr('src',Clicked);\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt doesn't seem to want to take on the cimg value supplied from the \u003ccode\u003e.trigger\u003c/code\u003e clicked event \u003c/p\u003e\n\n\u003cp\u003eWhat am I doing wrong here?\u003c/p\u003e","accepted_answer_id":"20750161","answer_count":"2","comment_count":"0","creation_date":"2013-12-23 19:43:54.327 UTC","last_activity_date":"2013-12-23 19:58:36.6 UTC","last_edit_date":"2013-12-23 19:47:36.317 UTC","last_editor_display_name":"","last_editor_user_id":"128165","owner_display_name":"","owner_user_id":"877423","post_type_id":"1","score":"2","tags":"javascript|jquery","view_count":"48"} +{"id":"2120035","title":"Highlight Text in TextView or WebView","body":"\u003cp\u003eIs it possible to Highlight text in a \u003ccode\u003eTextView\u003c/code\u003e or \u003ccode\u003eWebView\u003c/code\u003e?\u003c/p\u003e\n\n\u003cp\u003eI see it is possible in a \u003ccode\u003eEditText\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://stackoverflow.com/questions/1529068/android-is-it-possible-to-have-multiple-styles-inside-a-textview\"\u003eHighligh text in a EditText\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI'd like to do the same in \u003ccode\u003eTextView\u003c/code\u003e or \u003ccode\u003eWebView\u003c/code\u003e.\u003cbr/\u003e\nThats Possible?\u003c/p\u003e","accepted_answer_id":"2120190","answer_count":"3","comment_count":"2","creation_date":"2010-01-22 19:51:28.237 UTC","favorite_count":"17","last_activity_date":"2014-01-02 18:00:36.73 UTC","last_edit_date":"2017-05-23 12:25:13.667 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"Alexi","post_type_id":"1","score":"19","tags":"android|android-widget","view_count":"33290"} +{"id":"13066066","title":"Create a iOS6 Maps MKUserTrackingBarButtonItem button","body":"\u003cp\u003eI want to create a MKUserTrackingBarButtonItem the same way iOS6 have it. Like a floating UIBarButtonItem. ( \u003ca href=\"http://cl.ly/image/1Q1K2S1A1H3N\" rel=\"nofollow\"\u003ehttp://cl.ly/image/1Q1K2S1A1H3N\u003c/a\u003e )\u003c/p\u003e\n\n\u003cp\u003eCan you give some advice in how to achieve this?\u003c/p\u003e\n\n\u003cp\u003eThx!\u003c/p\u003e","answer_count":"2","comment_count":"5","creation_date":"2012-10-25 09:57:56 UTC","favorite_count":"2","last_activity_date":"2013-09-30 17:35:43.363 UTC","last_edit_date":"2012-10-25 10:06:15.513 UTC","last_editor_display_name":"","last_editor_user_id":"687684","owner_display_name":"","owner_user_id":"687684","post_type_id":"1","score":"2","tags":"iphone|ios6|mkmapview|uibarbuttonitem|userlocation","view_count":"2736"} +{"id":"25354579","title":"UITableView won't present","body":"\u003cp\u003eI have a very strange situation in my app and i can't explain or locate the bug.\nI have a UIViewController with a tableView in it.\nIn the table view I have 3 prototype cells, also i have 2 section that are divided like so:\u003c/p\u003e\n\n\u003cp\u003efirst section: row 0 (cell ID: episodeScrollersCell)\nsecond section: row 0 (cell ID: addCommentsCell)\n : row 1+ (cell ID: commentCell)\u003c/p\u003e\n\n\u003cp\u003eThe required methods in the protocol are listed below.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView\n{\n return 2;\n}\n\n- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section\n{\n NSInteger rowNum;\n if(section == 0){\n rowNum = 1;\n }else{\n rowNum = 1; // here is the problem. If i change the number of row to above 1\n }\n return rowNum;\n}\n\n- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath\n{\n static NSString *cellIdentifier;\n if(indexPath.section == 0){\n cellIdentifier = episodeScrollersCell;\n }else if (indexPath.section == 1 \u0026amp;\u0026amp; indexPath.row == 0){\n cellIdentifier = addCommentsCell;\n }else{\n cellIdentifier = commentCell;\n }\n UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];\n\n return cell;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow the problem arises when I want to have 2 rows or above in the second section (i.e to have 2 prototype cells in one section), the view Controller won't show. I've logged the cellForRowAtIndexPath: method to see if the cells gets loaded and they do.\u003c/p\u003e\n\n\u003cp\u003eAny advice?\nThanks, \u003c/p\u003e","answer_count":"1","comment_count":"8","creation_date":"2014-08-17 23:25:56.81 UTC","last_activity_date":"2014-08-18 03:51:45.823 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1738060","post_type_id":"1","score":"0","tags":"ios|objective-c|uitableview","view_count":"56"} +{"id":"8770310","title":"Extending the Android application certificate past its expiration","body":"\u003cp\u003eRecently I saw this:\n\u003cimg src=\"https://i.stack.imgur.com/hD7BY.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eIn the unlikelihood any of my apps survive (and I survive and everything else dependent survives) until 2037, will my apps have to be re-released with a new package name because of needing a new certificate?\u003c/p\u003e\n\n\u003cp\u003eIs there no way to extend a certificate?\u003c/p\u003e","accepted_answer_id":"8770368","answer_count":"1","comment_count":"4","creation_date":"2012-01-07 14:16:15.56 UTC","favorite_count":"1","last_activity_date":"2012-01-07 15:48:01.193 UTC","last_edit_date":"2012-01-07 15:48:01.193 UTC","last_editor_display_name":"","last_editor_user_id":"105971","owner_display_name":"","owner_user_id":"805031","post_type_id":"1","score":"5","tags":"android|certificate|google-play","view_count":"1590"} +{"id":"34808602","title":"Apache(2.2.22) not starting after enabling SSL on windows7","body":"\u003cp\u003eInstalled Apache on win 7 and previously(without enabling SSL) its worked successfully. After Configuring SSL on httpd.conf,while trying to restart through monitor(stop then start) its prompting below error. please help me otu of this issue.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e The Request Operation has failed\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhile trying start apache through services getting below error\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\"Windows couldn't start Apache 2.2 on local PC. For more information check system events log. If it's not a windows service contact service provider and reference the code:1\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eApache Verion is\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ec:\\Program Files (x86)\\Apache Software Foundation\\Apache2.2\\bin\u0026gt;httpd.exe -v\nServer version: Apache/2.2.22 (Win32)\nServer built: Jan 28 2012 11:16:39\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhile executing httpd.exe -e debug,\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ec:\\Program Files (x86)\\Apache Software Foundation\\Apache2.2\\bin\u0026gt;httpd.exe -e debug\n[Fri Jan 15 15:06:51 2016] [debug] mod_so.c(246): loaded module actions_module\n[Fri Jan 15 15:06:51 2016] [debug] mod_so.c(246): loaded module alias_module\n[Fri Jan 15 15:06:51 2016] [debug] mod_so.c(246): loaded module asis_module\n[Fri Jan 15 15:06:51 2016] [debug] mod_so.c(246): loaded module auth_basic_module\n[Fri Jan 15 15:06:51 2016] [debug] mod_so.c(246): loaded module authn_default_module\n[Fri Jan 15 15:06:51 2016] [debug] mod_so.c(246): loaded module authn_file_module\n[Fri Jan 15 15:06:51 2016] [debug] mod_so.c(246): loaded module authz_default_module\n[Fri Jan 15 15:06:51 2016] [debug] mod_so.c(246): loaded module authz_groupfile_module\n[Fri Jan 15 15:06:51 2016] [debug] mod_so.c(246): loaded module authz_host_module\n[Fri Jan 15 15:06:51 2016] [debug] mod_so.c(246): loaded module authz_user_module\n[Fri Jan 15 15:06:51 2016] [debug] mod_so.c(246): loaded module autoindex_module\n[Fri Jan 15 15:06:51 2016] [debug] mod_so.c(246): loaded module cgi_module\n[Fri Jan 15 15:06:51 2016] [debug] mod_so.c(246): loaded module dir_module\n[Fri Jan 15 15:06:51 2016] [debug] mod_so.c(246): loaded module env_module\n[Fri Jan 15 15:06:51 2016] [debug] mod_so.c(246): loaded module imagemap_module\n[Fri Jan 15 15:06:51 2016] [debug] mod_so.c(246): loaded module include_module\n[Fri Jan 15 15:06:51 2016] [debug] mod_so.c(246): loaded module isapi_module\n[Fri Jan 15 15:06:51 2016] [debug] mod_so.c(246): loaded module log_config_module\n[Fri Jan 15 15:06:51 2016] [debug] mod_so.c(246): loaded module mime_module\n[Fri Jan 15 15:06:51 2016] [debug] mod_so.c(246): loaded module negotiation_module\n[Fri Jan 15 15:06:51 2016] [debug] mod_so.c(246): loaded module setenvif_module\n[Fri Jan 15 15:06:51 2016] [debug] mod_so.c(246): loaded module userdir_module\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ein httpd.con file,updated the below entries\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eListen \u0026lt;ipadress\u0026gt;:81\nServerAdmin admin@www.d235y.com =\u0026gt; www.d235y.com-\u0026gt;domain name created after executing \"openssl\" command=\u0026gt; openssl req -new -out server.csr\n # Secure (SSL/TLS) connections\nInclude conf/extra/httpd-ssl.conf\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ein httpd-ssl.conf file,\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eListen 10.94.2.44:8443\n\u0026lt;VirtualHost _default_:443\u0026gt;\n# General setup for the virtual host\nDocumentRoot \"C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs\"\nServerName www.d235y.com:443\nServerAlias d235y.com:443\nServerAdmin admin@www.d235y.com\nErrorLog \"C:/Program Files (x86)/Apache Software Foundation/Apache2.2/logs/error.log\"\nTransferLog \"C:/Program Files (x86)/Apache Software Foundation/Apache2.2/logs/access.log\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ecertificates file entries are as follows\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSSLCertificateFile \"C:/Program Files (x86)/Apache Software Foundation/Apache2.2/conf/server.cert\"\nSSLCertificateKeyFile \"C:/Program Files (x86)/Apache Software Foundation/Apache2.2/conf/server.key\"\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"2","creation_date":"2016-01-15 10:04:20.13 UTC","favorite_count":"1","last_activity_date":"2016-01-18 11:32:50.747 UTC","last_edit_date":"2016-01-18 11:32:50.747 UTC","last_editor_display_name":"","last_editor_user_id":"5735703","owner_display_name":"","owner_user_id":"5735703","post_type_id":"1","score":"0","tags":"apache|ssl|openssl","view_count":"282"} +{"id":"24512746","title":"How to create context menus that modify the Current Control?","body":"\u003cp\u003eIn my application, a \u003ccode\u003eRichTextBox\u003c/code\u003e is dynamically created when a certain form is opened. Currently, clicking on the box opens up an \u003ccode\u003eOpenFileDialog\u003c/code\u003e, where the user selects a file, and then the file location is put into the \u003ccode\u003eRichTextBox\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eMy end user told me yesterday that he instead wants the following:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eLeft-clicking the \u003ccode\u003eRichTextBox\u003c/code\u003e should open the specified file in explorer\u003c/li\u003e\n\u003cli\u003eRight-clicking should open up a \u003ccode\u003eContextMenuStrip\u003c/code\u003e, with one of the options in the strip being \"Select File\".\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eMy revised code is contained in the following Gists:\u003c/p\u003e\n\n\u003cp\u003eMy \u003ca href=\"https://gist.github.com/JPeroutek/da8c45f10e9bd52411aa\" rel=\"nofollow\"\u003eopenFileDialog\u003c/a\u003e sub, which handle the \u003ccode\u003e.Click\u003c/code\u003e event for the \u003ccode\u003eToolStripMenuItem\u003c/code\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSub openFileDialog(ByVal sender As System.Windows.Forms.ToolStripMenuItem, ByVal e As System.EventArgs)\n Dim myOpenFileDialog As New OpenFileDialog()\n\n If Not sender.GetCurrentParent().Parent.Text = \"\" Then\n myOpenFileDialog.InitialDirectory = sender.GetCurrentParent().Parent.Text\n Else\n myOpenFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)\n End If\n\n myOpenFileDialog.Filter = \"All files (*.*)|*.*\"\n myOpenFileDialog.FilterIndex = 1\n myOpenFileDialog.RestoreDirectory = True\n\n If myOpenFileDialog.ShowDialog() = System.Windows.Forms.DialogResult.OK Then\n sender.GetCurrentParent().Parent.Text = myOpenFileDialog.FileName\n End If\nEnd Sub\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy \u003ca href=\"https://gist.github.com/JPeroutek/e179a3414eac3bd3294e\" rel=\"nofollow\"\u003efileControlRightClicked\u003c/a\u003e sub, which handle the right-clicking of the \u003ccode\u003eRichTextBox\u003c/code\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSub fileControlRightClicked(ByVal sender As System.Windows.Forms.RichTextBox, ByVal e As System.Windows.Forms.MouseEventArgs)\n If e.Button \u0026lt;\u0026gt; Windows.Forms.MouseButtons.Right Then Return\n\n Dim cms = New ContextMenuStrip\n 'cms.Parent = sender\n Dim item1 = cms.Items.Add(\"Select File\")\n item1.Tag = 1\n AddHandler item1.Click, AddressOf openFileDialog\n cms.Show(sender, e.Location)\nEnd Sub\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOther than those two pieces of code, then only relevant code I can think of is \u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eAddHandler .MouseUp, AddressOf fileControlRightClicked\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eWhich is used when the \u003ccode\u003eRichTextBox\u003c/code\u003e is declared.\u003c/p\u003e\n\n\u003cp\u003eHow do I reference the specific instance of \u003ccode\u003eRichTextBox\u003c/code\u003e that is clicked?\u003c/p\u003e\n\n\u003cp\u003eClearly, using \u003ccode\u003esender.GetCurrentParent().Parent\u003c/code\u003e does not work, and neither does \u003ccode\u003esender.GetCurrentParent.SourceControl\u003c/code\u003e. (These can be seen in the openFileDialog gist above)\u003c/p\u003e\n\n\u003cp\u003eIf I left out any relevant information or code, or was unclear about the problem I am having, please comment, and I will correct/add any necessary information.\u003c/p\u003e","accepted_answer_id":"24519353","answer_count":"1","comment_count":"0","creation_date":"2014-07-01 14:26:48.84 UTC","last_activity_date":"2014-07-01 21:14:04.923 UTC","last_edit_date":"2014-07-01 14:47:36.047 UTC","last_editor_display_name":"","last_editor_user_id":"3185357","owner_display_name":"","owner_user_id":"2491299","post_type_id":"1","score":"0","tags":".net|vb.net|winforms","view_count":"74"} +{"id":"24238077","title":"Why should we override a method?","body":"\u003cp\u003eRecently I was asked this question \"why should one override a method? \" \u003c/p\u003e\n\n\u003cp\u003eI replied, if I have a class with 10 methods and I want to use all of its functionality except one method, then I will override that method to have my own functionality.\u003c/p\u003e\n\n\u003cp\u003eThen the interviewer replied in that case why cant we write a new method with a different name and use that method instead. \u003c/p\u003e\n\n\u003cp\u003eYes this is also right. Now I am confused. What is the real objective in overriding a method?\u003c/p\u003e\n\n\u003cp\u003eCan anyone please tell me? Thank you all in advance. \u003c/p\u003e","accepted_answer_id":"24238132","answer_count":"8","comment_count":"3","creation_date":"2014-06-16 06:55:08.523 UTC","favorite_count":"1","last_activity_date":"2014-06-16 07:13:42.287 UTC","last_edit_date":"2014-06-16 07:00:36.51 UTC","last_editor_display_name":"","last_editor_user_id":"1814867","owner_display_name":"","owner_user_id":"1912429","post_type_id":"1","score":"3","tags":"java|oop|method-overriding","view_count":"262"} +{"id":"13201768","title":"Finding an element in a javascript array and returning the position of the matched element","body":"\u003cp\u003eI'm plucking my brain away at this but was hoping someone could help after several failed attempts.\u003c/p\u003e\n\n\u003cp\u003eI have an HTML list like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;ul\u0026gt;\n\u0026lt;li\u0026gt;\u0026lt;span class=\"current\"\u0026gt;\u0026lt;/span\u0026gt;\u0026lt;/li\u0026gt;\n\u0026lt;li\u0026gt;\u0026lt;span class=\"normal\"\u0026gt;\u0026lt;/span\u0026gt;\u0026lt;/li\u0026gt;\n\u0026lt;/ul\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm trying to figure out a way to find the li element in this list which has the span with the class current with the number it is at in the ul. So, in this case, it would be 1.\u003c/p\u003e\n\n\u003cp\u003eI tried using different jquery functions but I seem to be getting nowhere. This is what it looks like right now:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar list = $('ul li');\n$.each(list, function(key, value) {\n if( $(this).find('.current') ) {\n alert(key);\n }\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis just alerts 0, and 1, essentially meaning that it doesn't work. Does anyone have any idea what is wrong with what I'm doing?\u003c/p\u003e","accepted_answer_id":"13201782","answer_count":"3","comment_count":"0","creation_date":"2012-11-02 19:25:22.013 UTC","last_activity_date":"2012-11-02 19:46:18.467 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"868186","post_type_id":"1","score":"0","tags":"javascript|jquery","view_count":"50"} +{"id":"4769282","title":"Removing strings from another string in java","body":"\u003cp\u003eLets say I have this list of words:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e String[] stopWords = new String[]{\"i\",\"a\",\"and\",\"about\",\"an\",\"are\",\"as\",\"at\",\"be\",\"by\",\"com\",\"for\",\"from\",\"how\",\"in\",\"is\",\"it\",\"not\",\"of\",\"on\",\"or\",\"that\",\"the\",\"this\",\"to\",\"was\",\"what\",\"when\",\"where\",\"who\",\"will\",\"with\",\"the\",\"www\"};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThan I have text\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e String text = \"I would like to do a nice novel about nature AND people\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs there method that matches the stopWords and removes them while ignoring case; like this somewhere out there?:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e String noStopWordsText = remove(text, stopWords);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eResult:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \" would like do nice novel nature people\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf you know about regex that wold work great but I would really prefer something like commons solution that is bit more performance oriented. \u003c/p\u003e\n\n\u003cp\u003eBTW, right now I'm using this commons method which is lacking proper insensitive case handling:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e private static final String[] stopWords = new String[]{\"i\", \"a\", \"and\", \"about\", \"an\", \"are\", \"as\", \"at\", \"be\", \"by\", \"com\", \"for\", \"from\", \"how\", \"in\", \"is\", \"it\", \"not\", \"of\", \"on\", \"or\", \"that\", \"the\", \"this\", \"to\", \"was\", \"what\", \"when\", \"where\", \"who\", \"will\", \"with\", \"the\", \"www\", \"I\", \"A\", \"AND\", \"ABOUT\", \"AN\", \"ARE\", \"AS\", \"AT\", \"BE\", \"BY\", \"COM\", \"FOR\", \"FROM\", \"HOW\", \"IN\", \"IS\", \"IT\", \"NOT\", \"OF\", \"ON\", \"OR\", \"THAT\", \"THE\", \"THIS\", \"TO\", \"WAS\", \"WHAT\", \"WHEN\", \"WHERE\", \"WHO\", \"WILL\", \"WITH\", \"THE\", \"WWW\"};\n private static final String[] blanksForStopWords = new String[]{\"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\"};\n\n noStopWordsText = StringUtils.replaceEach(text, stopWords, blanksForStopWords); \n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"4770009","answer_count":"4","comment_count":"2","creation_date":"2011-01-22 17:15:56.967 UTC","favorite_count":"1","last_activity_date":"2014-06-15 04:25:47.707 UTC","last_edit_date":"2011-01-22 17:38:40.577 UTC","last_editor_display_name":"","last_editor_user_id":"465179","owner_display_name":"","owner_user_id":"465179","post_type_id":"1","score":"6","tags":"java|string","view_count":"13000"} +{"id":"32208230","title":"Java Criteria API and operations on java.util.Date columns","body":"\u003cp\u003eIs there a way to convert java.util.Date column to unix time and perform operations on that instead.\u003c/p\u003e\n\n\u003cp\u003eI've tried \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCriteriaBuilder cb = entityManager.getCriteriaBuilder();\nRoot\u0026lt;Trip\u0026gt; table = cq.from(Trip.class);\ntable.get(Trip_.endTime).as(Long.class)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut it doesn't seem to work (endTime is of type java.util.Date (DATETIME in database))\u003c/p\u003e\n\n\u003cp\u003eOR\u003c/p\u003e\n\n\u003cp\u003eIs there a way to get number of seconds between two java.util.Date columns\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","accepted_answer_id":"32225411","answer_count":"1","comment_count":"2","creation_date":"2015-08-25 15:35:06.273 UTC","last_activity_date":"2015-08-26 11:28:23.313 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1247283","post_type_id":"1","score":"1","tags":"java|date|criteria-api|timespan","view_count":"182"} +{"id":"18070482","title":"Embed content from a different server","body":"\u003cp\u003eI have a landing page (mainly CSS and HTML) that I want to add content to. The issue is that the server that deploys the page is outdated and I'd rather run my content from another server. The content I want to add is a cgi script written in Python. Is it possible to run this script from within another server on the landing page. Ultimately, the page will load content from two different servers. \u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2013-08-06 01:38:10.92 UTC","last_activity_date":"2013-08-06 01:38:10.92 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1119779","post_type_id":"1","score":"0","tags":"python|html|cgi","view_count":"28"} +{"id":"24425392","title":"Intertistitial ADMOB and external/chromium/net/disk_cache/backend_impl.cc","body":"\u003cp\u003eI've installed a Interstitial on my first app. It's my first time and error rains from the aindroid sky... I've solved a lot of them thanks to StackOverflow, but this is a strange error, maybe someone could help me:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e06-26 09:48:56.221 604-629/com.armadillo.sh5 E/chromium﹕ external/chromium/net/disk_cache/backend_impl.cc:1097: [0626/094856:ERROR:backend_impl.cc(1097)] Critical error found -8\n06-26 09:48:56.531 604-629/com.armadillo.sh5 W/chromium﹕ external/chromium/net/disk_cache/storage_block-inl.h:119: [0626/094856:WARNING:storage_block-inl.h(119)] Failed data load.\n06-26 09:48:56.544 604-629/com.armadillo.sh5 W/chromium﹕ external/chromium/net/disk_cache/storage_block-inl.h:119: [0626/094856:WARNING:storage_block-inl.h(119)] Failed data load.\n06-26 09:48:56.544 604-629/com.armadillo.sh5 W/chromium﹕ external/chromium/net/disk_cache/storage_block-inl.h:119: [0626/094856:WARNING:storage_block-inl.h(119)] Failed data load.\n06-26 09:48:56.571 604-629/com.armadillo.sh5 W/chromium﹕ external/chromium/net/disk_cache/storage_block-inl.h:119: [0626/094856:WARNING:storage_block-inl.h(119)] Failed data load.\n06-26 09:48:56.601 604-629/com.armadillo.sh5 E/chromium﹕ external/chromium/net/disk_cache/entry_impl.cc:830: [0626/094856:ERROR:entry_impl.cc(830)] Failed to save user data\n06-26 09:48:56.601 604-629/com.armadillo.sh5 E/chromium﹕ external/chromium/net/disk_cache/entry_impl.cc:830: [0626/094856:ERROR:entry_impl.cc(830)] Failed to save user data\n06-26 09:49:01.051 604-604/com.armadillo.sh5 I/Ads﹕ Ad finished loading.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSoftware is running anyway but no ADS appear. What could be the problem? Seems android cannot download (or save after download) the interstitial image from internet... I'm right?\nI'm working on Android Studio. Thanks for any help!\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2014-06-26 08:04:51.623 UTC","last_activity_date":"2014-06-26 08:04:51.623 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3661112","post_type_id":"1","score":"0","tags":"android|admob|interstitial","view_count":"237"} +{"id":"43699582","title":"Convert image to byte array without using SwingFXUtils","body":"\u003cp\u003eIn the answer of the question \u003ca href=\"https://stackoverflow.com/questions/42038942/getpublicstoragepictures-lists-no-files\"\u003egetPublicStorage(“Pictures”) lists no files\u003c/a\u003e we have tried solution 1 and 2 but in the byte array process seems the array does not represent the actual image. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eUsed code:\nServices.get(PicturesService.class).ifPresent(service -\u0026gt; {\n            service.takePhoto(false).ifPresent(image -\u0026gt; {\n                imageView.setImage(image);\n \n                PixelReader pixelReader = image.getPixelReader();\n                int width = (int) image.getWidth();\n                int height = (int) image.getHeight();\n                byte[] buffer = new byte[width * height * 4];\n                pixelReader.getPixels(0, 0, width, height, PixelFormat.getByteBgraInstance(), buffer, 0, width * 4);\n \n                //Test\n                ByteArrayInputStream in = new ByteArrayInputStream(buffer);\n                Image image2 = new Image(in);\n \n                try {\n                    in.close();\n                } catch (IOException e) {\n                    e.printStackTrace();\n                }\n \n                imageView.setImage(image2);\n                //Test\n \n                proceedImage(buffer);\n            });\n        });\n \nprivate void proceedImage(byte[] arrayImage) {\n        this.arrayImage = arrayImage;\n \n        enableZoom(true);\n \n        apply = true;\n    }\n\nException:\nW/System.err(15096): com.sun.javafx.iio.ImageStorageException: No loader for image data\nW/System.err(15096):    at com.sun.javafx.iio.ImageStorage.loadAll(ImageStorage.java:276)\nW/System.err(15096):    at com.sun.javafx.tk.quantum.PrismImageLoader2.loadAll(PrismImageLoader2.java:142)\nW/System.err(15096):    at com.sun.javafx.tk.quantum.PrismImageLoader2.\u0026lt;init\u0026gt;(PrismImageLoader2.java:77)\nW/System.err(15096):    at com.sun.javafx.tk.quantum.QuantumToolkit.loadImage(QuantumToolkit.java:740)\nW/System.err(15096):    at javafx.scene.image.Image.loadImage(Image.java:1073)\nW/System.err(15096):    at javafx.scene.image.Image.initialize(Image.java:804)\nW/System.err(15096):    at javafx.scene.image.Image.\u0026lt;init\u0026gt;(Image.java:707)\nW/System.err(15096):    at org.openjanela.dialog.ImageViewDialog.lambda$null$5(ImageViewDialog.java:260)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny idea for a fix \\ tweak \\ workaround would be much appreciated.\u003c/p\u003e","answer_count":"0","comment_count":"5","creation_date":"2017-04-29 19:19:46.44 UTC","last_activity_date":"2017-04-30 01:07:22.97 UTC","last_edit_date":"2017-05-23 12:02:16.157 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"7747892","post_type_id":"1","score":"0","tags":"javafx|javafx-2|gluon|gluon-mobile","view_count":"139"} +{"id":"5854469","title":"How can I tell if a user clicked \"Don't allow\" on a \u003cfb:login-button\u003e initiated dialog?","body":"\u003cp\u003eI have a FB login button on my site. I'd like to analyze how many people click the button, but do not proceed with the login process (i.e. close the dialog, or click \"Don't Allow\").\u003c/p\u003e\n\n\u003cp\u003eAny ideas?\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2011-05-02 07:18:54.42 UTC","last_activity_date":"2011-05-03 12:48:41.967 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"259226","post_type_id":"1","score":"0","tags":"facebook","view_count":"193"} +{"id":"44215685","title":"Undefined reference in C++ but classes are included","body":"\u003cp\u003eI have the following C++ code, which uses the PointCloud Library, and i want to extract some narf features. I use the CMAKE compiler as explained in the tutorial \u003ca href=\"http://pointclouds.org/documentation/tutorials/narf_keypoint_extraction.php#narf-keypoint-extraction\" rel=\"nofollow noreferrer\"\u003ehttp://pointclouds.org/documentation/tutorials/narf_keypoint_extraction.php#narf-keypoint-extraction\u003c/a\u003e\nI would like to keep it in the same way, as I am not so familiar with C++.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;iostream\u0026gt;\n\n#include \u0026lt;pcl/io/ply_io.h\u0026gt;\n#include \u0026lt;boost/thread/thread.hpp\u0026gt;\n#include \u0026lt;pcl/range_image/range_image.h\u0026gt;\n#include \u0026lt;pcl/point_cloud.h\u0026gt;\n#include \u0026lt;pcl/io/pcd_io.h\u0026gt;\n#include \u0026lt;pcl/visualization/range_image_visualizer.h\u0026gt;\n#include \u0026lt;pcl/visualization/pcl_visualizer.h\u0026gt;\n#include \u0026lt;pcl/features/range_image_border_extractor.h\u0026gt;\n#include \u0026lt;pcl/keypoints/narf_keypoint.h\u0026gt;\n#include \u0026lt;pcl/console/parse.h\u0026gt;\n\nint main(int argc, char** argv) {\n// Fetch point cloud filename in arguments | Works with PCD and PLY files\nstd::vector\u0026lt;int\u0026gt; filenames;\nbool file_is_pcd = false;\n\nfilenames = pcl::console::parse_file_extension_argument(argc, argv, \".ply\");\n\nif (filenames.size() != 1) {\n filenames = pcl::console::parse_file_extension_argument(argc, argv,\n \".pcd\");\n\n if (filenames.size() != 1) {\n return -1;\n } else {\n file_is_pcd = true;\n }\n}\n\n// Load file | Works with PCD and PLY files\npcl::PointCloud\u0026lt;pcl::PointXYZ\u0026gt;::Ptr source_cloud(\n new pcl::PointCloud\u0026lt;pcl::PointXYZ\u0026gt;());\n\nif (file_is_pcd) {\n if (pcl::io::loadPCDFile(argv[filenames[0]], *source_cloud) \u0026lt; 0) {\n std::cout \u0026lt;\u0026lt; \"Error loading point cloud \" \u0026lt;\u0026lt; argv[filenames[0]]\n \u0026lt;\u0026lt; std::endl \u0026lt;\u0026lt; std::endl;\n return -1;\n }\n} else {\n if (pcl::io::loadPLYFile(argv[filenames[0]], *source_cloud) \u0026lt; 0) {\n std::cout \u0026lt;\u0026lt; \"Error loading point cloud \" \u0026lt;\u0026lt; argv[filenames[0]]\n \u0026lt;\u0026lt; std::endl \u0026lt;\u0026lt; std::endl;\n return -1;\n }\n}\n\nif (pcl::console::find_argument(argc, argv, \"-m\") \u0026gt;= 0) {\n bool setUnseenToMaxRange = true;\n std::cout\n \u0026lt;\u0026lt; \"Setting unseen values in range image to maximum range readings.\\n\";\n}\nint tmp_coordinate_frame;\nif (pcl::console::parse(argc, argv, \"-c\", tmp_coordinate_frame) \u0026gt;= 0) {\n int coordinate_frame = pcl::RangeImage::CoordinateFrame(\n tmp_coordinate_frame);\n std::cout \u0026lt;\u0026lt; \"Using coordinate frame \" \u0026lt;\u0026lt; (int) coordinate_frame\n \u0026lt;\u0026lt; \".\\n\";\n}\nfloat angular_resolution = 0.5f;\nfloat support_size = 0.2f;\npcl::RangeImage::CoordinateFrame coordinate_frame =\n pcl::RangeImage::CAMERA_FRAME;\nbool setUnseenToMaxRange = false;\n\n// --------------------------------\n// -----Extract NARF keypoints-----\n// --------------------------------\npcl::RangeImageBorderExtractor range_image_border_extractor;\npcl::NarfKeypoint narf_keypoint_detector(\u0026amp;range_image_border_extractor);\nnarf_keypoint_detector.getParameters().support_size = support_size;\n//narf_keypoint_detector.getParameters ().add_points_on_straight_edges = true;\n//narf_keypoint_detector.getParameters ().distance_for_additional_points = 0.5;\n\npcl::PointCloud\u0026lt;int\u0026gt; keypoint_indices;\nnarf_keypoint_detector.compute(keypoint_indices);\nstd::cout \u0026lt;\u0026lt; \"Found \" \u0026lt;\u0026lt; keypoint_indices.points.size() \u0026lt;\u0026lt; \" key points.\\n\";\n\nreturn 0;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe thing is that when I run \"make\" in my /build folder I get this output:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eadrian@Jarvis:~/PointCloudComparator/build$ make\nScanning dependencies of target visua\n[ 50%] Building CXX object CMakeFiles/visua.dir/src/visua.cpp.o\n[100%] Linking CXX executable visua\nCMakeFiles/visua.dir/src/visua.cpp.o: En la función `main':\nvisua.cpp:(.text+0x4ea): referencia a `pcl::RangeImageBorderExtractor::RangeImageBorderExtractor(pcl::RangeImage const*)' sin definir\nvisua.cpp:(.text+0x50b): referencia a `pcl::NarfKeypoint::NarfKeypoint(pcl::RangeImageBorderExtractor*, float)' sin definir\nvisua.cpp:(.text+0x54d): referencia a `pcl::NarfKeypoint::compute(pcl::PointCloud\u0026lt;int\u0026gt;\u0026amp;)' sin definir\nvisua.cpp:(.text+0x5ad): referencia a `pcl::NarfKeypoint::~NarfKeypoint()' sin definir\nvisua.cpp:(.text+0x5bc): referencia a `pcl::RangeImageBorderExtractor::~RangeImageBorderExtractor()' sin definir\nvisua.cpp:(.text+0x6e8): referencia a `pcl::NarfKeypoint::~NarfKeypoint()' sin definir\nvisua.cpp:(.text+0x6fc): referencia a `pcl::RangeImageBorderExtractor::~RangeImageBorderExtractor()' sin definir\ncollect2: error: ld returned 1 exit status\nmake[2]: *** [visua] Error 1\nmake[1]: *** [CMakeFiles/visua.dir/all] Error 2\nmake: *** [all] Error 2\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut, as you can see, everything is imported. I thought that maybe it is a problem of compilation or cmake, I do not know. Here is also my CMakeLists:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecmake_minimum_required(VERSION 2.6 FATAL_ERROR)\n\nproject(PointCloudComparator)\n\nfind_package(PCL 1.8 REQUIRED COMPONENTS common io)\n\ninclude_directories(${PCL_INCLUDE_DIRS})\nlink_directories(${PCL_LIBRARY_DIRS})\nadd_definitions(${PCL_DEFINITIONS})\n\nadd_executable (visua src/visua.cpp)\ntarget_link_libraries (visua ${PCL_LIBRARIES})\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow can i make this work?\u003c/p\u003e\n\n\u003cp\u003eCheers\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-05-27 10:23:38.51 UTC","last_activity_date":"2017-05-27 10:53:07.903 UTC","last_edit_date":"2017-05-27 10:53:07.903 UTC","last_editor_display_name":"","last_editor_user_id":"4961771","owner_display_name":"","owner_user_id":"4961771","post_type_id":"1","score":"0","tags":"c++|reference|include|point-cloud-library|point-clouds","view_count":"32"} +{"id":"37049664","title":"Regex correct pattern matching conditions in java jdbc","body":"\u003cp\u003eI want to match with strings which is alphanumeric as well as which has special characters \u003ccode\u003e-\u003c/code\u003e, \u003ccode\u003e/\u003c/code\u003e and also white spaces\u003c/p\u003e\n\n\u003cp\u003eFor example: If the string is \u003ccode\u003eMotorola C168/CC168i-1\u003c/code\u003e , it should match\u003c/p\u003e\n\n\u003cp\u003eBut when I am using following regular expression, its not matching it right. So, what is the correct condition?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eif (line.matches(\"[A-Za-z0-9 \\\\/\\\\-]+$\") {\n .....\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"2","creation_date":"2016-05-05 11:39:49.707 UTC","last_activity_date":"2016-05-06 18:57:54.913 UTC","last_edit_date":"2016-05-06 01:40:05.753 UTC","last_editor_display_name":"","last_editor_user_id":"1400971","owner_display_name":"","owner_user_id":"5641188","post_type_id":"1","score":"0","tags":"java|regex|jdbc","view_count":"156"} +{"id":"29095153","title":"Initializing object of derived class using initializer-list","body":"\u003cp\u003eI got a \u003ccode\u003estruct B\u003c/code\u003e that is derived from a \u003ccode\u003estruct A\u003c/code\u003e.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003estruct A{\n int a; \n};\n\nstruct B : public A{\n int b;\n};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs there a straight way to initialize an object of type \u003ccode\u003eB\u003c/code\u003e without providing a constructor, let's say using initializer-list?\u003c/p\u003e\n\n\u003cp\u003e\u003cem\u003eSome more insight\u003c/em\u003e:\u003c/p\u003e\n\n\u003cp\u003eI got two \u003ccode\u003estruct\u003c/code\u003es that I use to pass data between threads; the second one holds the same data as the first one, with the addition of some \u003cem\u003esynchronization variable\u003c/em\u003e. I could make the first \u003ccode\u003estruct\u003c/code\u003e a data member of the second one, or just duplicate the declaration of data members in the second \u003ccode\u003estruct\u003c/code\u003e, to easily use the initializer-list; but I think that \u003cem\u003ein this particular application\u003c/em\u003e it would be logically more correct that the second \u003ccode\u003estruct\u003c/code\u003e extends the first one.\u003c/p\u003e","accepted_answer_id":"29095460","answer_count":"2","comment_count":"0","creation_date":"2015-03-17 09:11:49.733 UTC","last_activity_date":"2015-03-17 09:38:05.993 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2508150","post_type_id":"1","score":"1","tags":"c++|c++11|initialization|initializer-list","view_count":"146"} +{"id":"36145916","title":"Saving an image from picture box to png C#","body":"\u003cp\u003eGood Day!\nI am trying to save an image from PictureBox, however, it is giving me an error.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e pictureBox1.ImageLocation = @\"C:\\emo\\hairs\\Hair-01.png\";\n this.pictureBox1.SizeMode = PictureBoxSizeMode.Zoom;\n pictureBox1.Image.Save(@\"C:\\Coke\\res1.png\", System.Drawing.Imaging.ImageFormat.Png);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is the error:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eAn unhandled exception of type 'System.NullReferenceException' occurred in Emo.exe\n Additional information: Object reference not set to an instance of an object.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003ePlease help me identify my answer.\u003c/p\u003e","accepted_answer_id":"36146181","answer_count":"1","comment_count":"0","creation_date":"2016-03-22 04:07:02.077 UTC","last_activity_date":"2016-03-22 05:12:24.55 UTC","last_edit_date":"2016-03-22 05:12:24.55 UTC","last_editor_display_name":"","last_editor_user_id":"1560829","owner_display_name":"","owner_user_id":"5789177","post_type_id":"1","score":"2","tags":"c#|winforms|picturebox","view_count":"303"} +{"id":"42573815","title":"Posting Images to mongodb using multer MEAN stack","body":"\u003cp\u003eHello I am trying to upload images from angular to my mongodb. I am using multer on my server side and my api looks like that and it works when i insert to it static data :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eapp.post('/api/photo', function(req, res) {\n var newItem = new ItemSchema();\n // THIS WILL COME FROM ANGULAR FORM\n // newItem.img.data = fs.readFileSync(req.files.userPhoto.path)\n newItem.img.data = fs.readFileSync('/Users/heshamelmasry/Desktop/FerreroRocher.jpg')\n newItem.img.contentType = 'image/png';\n\n console.log(req.body);\n\n newItem.save();\n res.status(200);\n\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am trying on the client side to make a function to post image to the data base and use http to call my api. So in my controller for angular i tried to write a code like that :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epostImages() {\n\n\n\n var vm = this;\n\n function(this, $upload) {\n this.onFileSelect = function($files) {\n //$files: an array of files selected, each file has name, size, and type.\n for (var i = 0; i \u0026lt; $files.length; i++) {\n var file = $files[i];\n this.upload = $upload.upload({\n url: 'http://localhost:5000/api/photo', //upload.php script, node.js route, or servlet url\n data: {\n myObj: this.myModelObj\n },\n file: file,\n }).progress(function(evt) {\n console.log('percent: ' + parseInt(100.0 * evt.loaded / evt.total));\n }).success(function(data, status, headers, config) {\n // file is uploaded successfully\n console.log(data);\n });\n }\n };\n }\n\n\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand my main i have this \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;input type=\"file\" ngf-select=\"onFileSelect($files)\" multiple\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eActually this is not right IN MY client side \u003c/p\u003e\n\n\u003cp\u003ein my schema on the server side i need to pass two things buffer and content type\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimg: {\n data: Buffer,\n contentType: String\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhich is like that if i am passing it statically in my server\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enewItem.img.data = fs.readFileSync('/Users/heshamelmasry/Desktop/FerreroRocher.jpg')\n newItem.img.contentType = 'image/png'; \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eso it is the url and the content type \u003c/p\u003e\n\n\u003cp\u003emy question how i can handle this on the client side to get this url and content type from my form calling my function and the function in my controller \u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-03-03 08:17:49.917 UTC","last_activity_date":"2017-03-03 08:17:49.917 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4090987","post_type_id":"1","score":"0","tags":"node.js|multer","view_count":"155"} +{"id":"31906157","title":"WP meta_query passing an array for an IN comparison","body":"\u003cp\u003eI have a string that I want to separate into an array and then pass to the value of a meta_query and then pass with the IN operator.\u003c/p\u003e\n\n\u003cp\u003eFor example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$my_string = \"San Francisco, CA 94111\";\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd then I was thinking I would do this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$my_string = (explode(',',$my_string));\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd then in my meta_query:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e'meta_query' =\u0026gt; array(\n array(\n 'key' =\u0026gt; 'login_email',\n 'value' =\u0026gt; $my_string,\n 'compare' =\u0026gt; 'IN'\n )\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis doesn't seem to work. And I wonder if it is how the array is written with keys and passed to the value operator.\u003c/p\u003e\n\n\u003cp\u003eFor example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eArray ( [0] =\u0026gt; san francisco [1] =\u0026gt; ca 94111 )\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003evs\u003c/p\u003e\n\n\u003cp\u003eIn the Wordpress documentation it wants something like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003earray( 3, 4 ),\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBeyond what I am working on now, I thing it would be useful to be able to do something like this for a meta_query. Any ideas? Thanks\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2015-08-09 16:06:25.133 UTC","last_activity_date":"2015-08-09 16:06:25.133 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1981630","post_type_id":"1","score":"0","tags":"php|wordpress","view_count":"29"} +{"id":"42853114","title":"Android Default Browser creates Horizontal Scroll Bar for Responsive Design","body":"\u003cp\u003e\u003cstrong\u003eAndroid's default browser\u003c/strong\u003e, shows my-site wider and creates horizontal scroll bar. \u003c/p\u003e\n\n\u003cp\u003eHere the screenshots of the problem: (Chrome vs default browser)\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/a98tI.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/a98tI.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eMy viewport is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat should I do?\u003c/p\u003e","accepted_answer_id":"43636001","answer_count":"4","comment_count":"3","creation_date":"2017-03-17 08:58:18.507 UTC","last_activity_date":"2017-06-21 14:51:43.523 UTC","last_edit_date":"2017-06-21 14:51:43.523 UTC","last_editor_display_name":"","last_editor_user_id":"1235655","owner_display_name":"","owner_user_id":"1235655","post_type_id":"1","score":"6","tags":"android|css|browser|responsive-design|viewport","view_count":"310"} +{"id":"15403528","title":"Different Object of same type","body":"\u003cp\u003eI have a class\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eCartIndexViewModel\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003ein my project SportsStore. I am making calls to WCF service so I want to pass an Object of CartIndexViewModel so I copied the required .dll files in the WCF Project but its conflicting as it says there is a type mismatch.\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eSportsStore.WebUI.ServiceReference.CartIndexViewModel\n SportsStore.WebUI.Models.CartIndexViewModel\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eboth the classes are same, have same properties and methods but in different project how can i pass an object from sending side i.e SportsStore.WebUI.Models.CartIndexViewModel and the receiving end \ni.e. SportsStore.WebUI.ServiceReference.CartIndexViewModel receive the object.\nI dont have much knowledge i tried doing a lot of homework on this but couldn't get a solution.\nPlease help. Thank you.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-03-14 07:31:16.643 UTC","last_activity_date":"2013-03-14 07:35:06.597 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2128588","post_type_id":"1","score":"0","tags":"c#|.net|wcf","view_count":"71"} +{"id":"44143642","title":"Winphone project type is not supported in Visual studio 2017","body":"\u003cp\u003eI have an existing xamarin native project and It has \u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003cp\u003emyproj.iOS\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003emyproj.Droid\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003emyproj.WinPhone\u003c/p\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eI uninstalled my visual studio 2015 and installed Visual studio 2017 \u003c/p\u003e\n\n\u003cp\u003eNow in the solution explorer I can see it clearly says myproj.WinPhone (incompatible) \u003c/p\u003e\n\n\u003cp\u003eI am aware Microsoft is pushing for UWP but I still want to do as I was doing earlier like supporting windows 8.1 etc.. \u003c/p\u003e\n\n\u003cp\u003eIs it possible to downgrade this to 2015 so that I can still do myproj.WinPhone ?\u003c/p\u003e\n\n\u003cp\u003eOr is there anyother way that will solve this problem \u003c/p\u003e\n\n\u003cp\u003eFYI:\u003c/p\u003e\n\n\u003cp\u003eI tried creating a new xamarin native project but that doesn't have winphone project but it has for iOS and Android though\u003c/p\u003e","accepted_answer_id":"44191604","answer_count":"2","comment_count":"0","creation_date":"2017-05-23 19:38:17.947 UTC","last_activity_date":"2017-05-31 14:46:45.81 UTC","last_edit_date":"2017-05-31 14:46:45.81 UTC","last_editor_display_name":"","last_editor_user_id":"1046117","owner_display_name":"","owner_user_id":"8053184","post_type_id":"1","score":"1","tags":"uwp|windows-phone|visual-studio-2017|xamarin.winphone|xamarin.windows","view_count":"322"} +{"id":"4126458","title":"What is the best way to manipulate a css file using a java servlet filter?","body":"\u003cp\u003eI need to convert relative image path (inside some css files) to absolute on the fly, using a java servlet filter. \u003c/p\u003e\n\n\u003cp\u003eWhat is the best way?\u003c/p\u003e","accepted_answer_id":"4126482","answer_count":"2","comment_count":"0","creation_date":"2010-11-08 17:48:24.963 UTC","last_activity_date":"2010-11-09 00:58:04.467 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"497833","post_type_id":"1","score":"0","tags":"java|css","view_count":"359"} +{"id":"41607616","title":"What is difference between escape sequence in Single quotes and Double quotes in Ruby","body":"\u003cp\u003eI have the following string and want to replace \\n with \u0026lt; br\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003estring = \"Subject: [Information] \\n Hi there, \\n...\\n\\n\\n\\\\ud83d\\\\ude00\\n--\\n\"\nstring.gsub('\\n','\u0026lt;br\u0026gt;') #don't work\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThan I tried\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003estring.gsub(\"\\n\",'\u0026lt;br\u0026gt;')\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt works, can explain this to me. String in double quotes are different from string in single quotes or it has to do with escape sequence.\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-01-12 07:43:20.313 UTC","last_activity_date":"2017-01-12 07:45:44.397 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1969191","post_type_id":"1","score":"-1","tags":"ruby-on-rails|ruby","view_count":"74"} +{"id":"30743825","title":"Perl multiline search replace","body":"\u003cp\u003eI want to find and corresponding block and uncomment the second line in text file using perl one-liner. Im fairly new to using complex regex, so your help is very much appreciated! Also is there a way to debug one-liners?\u003c/p\u003e\n\n\u003cp\u003eHere is what I have so far, which does not work even though I tested it using a interactive regex tester:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eperl -p -i.bak -e 's/#[\\s]*label2[\\n]#(.*)/${1}/gi;' file.txt\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe text file looks like the following\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e# label1\n#variable=foobar1\n\n# label2\n#variable=foobar2\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"30743969","answer_count":"2","comment_count":"0","creation_date":"2015-06-09 22:20:47.197 UTC","last_activity_date":"2015-06-09 23:53:10.3 UTC","last_edit_date":"2015-06-09 22:34:35.483 UTC","last_editor_display_name":"","last_editor_user_id":"1940015","owner_display_name":"","owner_user_id":"1940015","post_type_id":"1","score":"0","tags":"regex|perl","view_count":"70"} +{"id":"47287559","title":"Import jest object when not using jest runner","body":"\u003cp\u003eWhat do I need to import/require in order to access the magic \u003ca href=\"https://facebook.github.io/jest/docs/en/jest-object.html\" rel=\"nofollow noreferrer\"\u003e\u003ccode\u003ejest\u003c/code\u003e object\u003c/a\u003e that contains \u003ccode\u003ejest.fn\u003c/code\u003e when not running my code with jest?\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-11-14 13:51:57.347 UTC","last_activity_date":"2017-11-14 13:58:36.74 UTC","last_edit_date":"2017-11-14 13:58:36.74 UTC","last_editor_display_name":"","last_editor_user_id":"65311","owner_display_name":"","owner_user_id":"65311","post_type_id":"1","score":"0","tags":"jestjs","view_count":"10"} +{"id":"32837639","title":"NullPointerException: key == null || value == null","body":"\u003cp\u003eI have a Adapter in my application which inflates posts and shows them in a \u003ccode\u003eListView\u003c/code\u003e. Each post has an image, so it uses \u003ccode\u003eLruCache\u003c/code\u003e to store images.\u003c/p\u003e\n\n\u003cp\u003eThe app works well completely, but it crashed two or three times and I couldn't realize what was the problem. Only last time, I could get this log from LogCat:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eE/AndroidRuntime(2407): Caused by: java.lang.NullPointerException: key\n == null || value == null\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eThe crashes happen only when app is recently installed (When I delete the app from the device and install it again)! When I open the app for the first time and start scrolling up and down so fast, sometimes it crashes. (It won't happen all the time, it's completely random!)\u003c/p\u003e\n\n\u003cp\u003eAnd after that, it won't crash anymore... :/\u003c/p\u003e\n\n\u003cp\u003eI think it has something to do with LruCache and empty cache. I saw \u003cstrong\u003e\u003ca href=\"https://stackoverflow.com/questions/24921696/support-lib-lrucache-throws-nullpointerexception-key-null-value-null-f\"\u003ethis question\u003c/a\u003e\u003c/strong\u003e, but that wasn't my problem! I did check for null cache in my code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eif (MainActivity.thumbnailsCache.get(postID) != null)\n {\n imageViewThumbnail.setImageBitmap(MainActivity.thumbnailsCache.get(postID));\n } else {\n new DownloadAndSetImageTask(thumbnailURL).execute();\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny suggestion?\u003c/p\u003e\n\n\u003cp\u003eP.S.: I know my question doesn't have enough details, but that's all the information I have!\u003c/p\u003e","answer_count":"2","comment_count":"1","creation_date":"2015-09-29 07:00:54.09 UTC","last_activity_date":"2015-09-29 07:18:50.91 UTC","last_edit_date":"2017-05-23 12:22:23.407 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"1930153","post_type_id":"1","score":"2","tags":"java|android|nullpointerexception|key|android-lru-cache","view_count":"742"} +{"id":"29590344","title":"Jenkins: how to limit checkouts to a few projects only (not the entire SVN)?","body":"\u003cp\u003eI am a complete newbie to Jenkins - so bear with me! I am sure that info sits somewhere out there, but I am currently still a bit swamped with Jenkins info...\u003c/p\u003e\n\n\u003cp\u003eOur project's SVN root contains many more projects than what is actually needed to build the release that I am supposed to create. Jenkins by default seems to check out the HEAD version of ALL projects found under the supplied repository URL. How/where can I specify that it needs to checkout (and later monitor) about 10 relevant projects only (and not all that are found in our SVN)?\u003c/p\u003e\n\n\u003cp\u003eI tried to specify that using Configure =\u003e Source Code Management =\u003e Advanced =\u003e Included Regions but apparently that's a different pair of shoes.\u003c/p\u003e","answer_count":"2","comment_count":"1","creation_date":"2015-04-12 14:10:29.27 UTC","last_activity_date":"2015-04-13 05:59:15.55 UTC","last_edit_date":"2015-04-13 05:28:26.433 UTC","last_editor_display_name":"","last_editor_user_id":"1754255","owner_display_name":"","owner_user_id":"423411","post_type_id":"1","score":"0","tags":"jenkins","view_count":"48"} +{"id":"24710609","title":"Swift: Setting SCNMaterial works for SCNBox but not for SCNGeometry loaded from Wings3D DAE","body":"\u003cp\u003eThis code excerpt (scene, camera, light, etc. cut out of the code) works in Swift on an iOS simulator:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e let boxNode = SCNNode()\n\n // Create a box\n boxNode.geometry = SCNBox(width: 1, height: 1, length: 1, chamferRadius: 0.1)\n let numFaces = 6\n\n scene.rootNode.addChildNode(boxNode)\n\n // create and configure a material for each face\n var materials: [SCNMaterial] = Array()\n\n for i in 1...numFaces\n {\n let material = SCNMaterial()\n material.diffuse.contents = UIImage(named: \"texture\")\n materials += material\n }\n\n // set the material to the 3d object geometry\n boxNode.geometry.materials = materials\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt generates a box with each face being the checkered image.\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/hhIrH.png\" alt=\"SCNBox in App\"\u003e\u003c/p\u003e\n\n\u003cp\u003eTrying the same thing with a simple stock geometry created in Wings3D, saved to a DAE, and loaded in the app gives me an appropriate shape, but no shading and image on the faces:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e let boxNode = SCNNode()\n\n // Load the geometry\n let urlToColladaFile = NSBundle.mainBundle().URLForResource(\"Objects\", withExtension:\"dae\")\n let sceneSource = SCNSceneSource(URL:urlToColladaFile, options:nil)\n\n boxNode.geometry = sceneSource.entryWithIdentifier(\"dodecahedron3-0\", withClass:SCNGeometry.self) as SCNGeometry\n let numFaces = 10\n\n scene.rootNode.addChildNode(boxNode)\n\n // create and configure a material for each face\n var materials: [SCNMaterial] = Array()\n\n for i in 1...numFaces\n {\n let material = SCNMaterial()\n material.diffuse.contents = UIImage(named: \"texture\")\n materials += material\n }\n\n // set the material to the 3d object geometry\n boxNode.geometry.materials = materials\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/jjCd7.png\" alt=\"Dodecahedron from Wings3D\"\u003e\u003c/p\u003e\n\n\u003cp\u003eWhat am I missing?\u003c/p\u003e","accepted_answer_id":"24768035","answer_count":"3","comment_count":"0","creation_date":"2014-07-12 07:13:33.527 UTC","favorite_count":"3","last_activity_date":"2016-04-11 07:53:51.203 UTC","last_edit_date":"2014-07-17 04:00:18.76 UTC","last_editor_display_name":"","last_editor_user_id":"1849664","owner_display_name":"","owner_user_id":"453398","post_type_id":"1","score":"6","tags":"uiimage|swift|scenekit","view_count":"5936"} +{"id":"2475744","title":"topics in distributed systems","body":"\u003cp\u003ewhat do you think is an interesting topic in distributed systems.\u003cbr\u003e\ni should pic a topic and present it on monday. at first i chose to talk about Wuala, but after reading about it, i don't think its that interesting.\u003cbr\u003e\nso what is an interesting (new) topic in distributed systems that i can research about.\u003cbr\u003e\nsorry if this is the wrong place to post.\u003c/p\u003e","accepted_answer_id":"2476009","answer_count":"2","comment_count":"0","creation_date":"2010-03-19 08:00:50.547 UTC","last_activity_date":"2017-11-09 04:10:04.227 UTC","last_edit_date":"2010-03-19 08:19:47.693 UTC","last_editor_display_name":"","last_editor_user_id":"21234","owner_display_name":"","owner_user_id":"274359","post_type_id":"1","score":"0","tags":"distributed|system","view_count":"1227"} +{"id":"10356175","title":"Android Custom Preference changing Override","body":"\u003cp\u003eMy custom preference class helps color picking.\u003cbr\u003e\nThe custom-preference calls GridView Intent it's include 9 colors.\u003cbr\u003e\nBut My custom class can't refresh color which user-selected on gridview\u003cbr\u003e\u003cbr\u003e\nWhen I finish the preference intent, then re-launch preference,\u003cbr\u003e\nThe Color showing up me as I selected.\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eonBindView()\u003c/code\u003e Method, I overried. It's perfect.\u003cbr\u003e\n\u003cstrong\u003eBut I don't know what method I must override to refresh color.\u003c/strong\u003e\n\u003cbr\u003e\u003cbr\u003e\n\u003cimg src=\"https://i.stack.imgur.com/7OfZt.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cbr\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class ConfigImage extends Preference\n{\n Context mContext;\n\n public ConfigImage(Context context, AttributeSet attrs)\n {\n this(context, attrs, 0);\n this.mContext = context;\n }\n\n public ConfigImage(Context context, AttributeSet attrs, int defStyle)\n {\n super(context, attrs, defStyle);\n this.mContext = context;\n setLayoutResource(R.layout.preference_image);\n }\n\n @Override\n public void onBindView(View view)\n {\n super.onBindView(view);\n ImageView imageView = (ImageView) view.findViewById(R.id.preference_image_iv_color);\n if (imageView != null)\n {\n SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(mContext);\n int colorIndex = sharedPref.getInt(\"setting_color_default\", 3);\n imageView.setBackgroundColor(Color.parseColor(ColorStorage.colors[colorIndex]));\n }\n }\n}\n\n\u0026lt;PreferenceCategory\n android:key=\"setting_color_info\"\n android:title=\"색상\" \u0026gt;\n\n \u0026lt;com.pack.ConfigImage\n android:id=\"@+id/setting_color_default\"\n android:key=\"setting_color_default\"\n android:selectable=\"true\"\n android:summary=\"Choose default color\"\n android:title=\"Default Color\"\n settings:background=\"#FFFFFFFF\" /\u0026gt;\n\u0026lt;/PreferenceCategory\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2012-04-27 18:46:33.203 UTC","last_activity_date":"2013-04-01 09:08:43.113 UTC","last_edit_date":"2012-06-23 22:41:39.547 UTC","last_editor_display_name":"","last_editor_user_id":"168868","owner_display_name":"","owner_user_id":"954511","post_type_id":"1","score":"3","tags":"android|preference","view_count":"1691"} +{"id":"19480904","title":"Code breaks when anchors overlap KineticJS","body":"\u003cp\u003eCode breaks when anchors overlap. I have anchors for resizing draggable groups of shapes as given in below tutorial. I also have the functionality to delete the selected group. The delete functionality breaks the code when anchors (of two different groups) overlap and overlapping anchor is selected (mousedown).\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e if (layer !== null \u0026amp;\u0026amp; e.keyCode == 46) { //Delete Key = 46\n SelectedShape.remove();\n layer.batchDraw();\n }\n });\n\n //Selecting on mousedown\n layer.on('mousedown', function (evt) {\n SelectedShape = evt.targetNode.getParent();\n });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eError message: Cannot get parent of a null or undefined reference.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003e\u003ca href=\"http://www.html5canvastutorials.com/labs/html5-canvas-drag-and-drop-resize-and-invert-images/\" rel=\"nofollow\"\u003ehttp://www.html5canvastutorials.com/labs/html5-canvas-drag-and-drop-resize-and-invert-images/\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eSample code\n \n \n \n \n \n \n \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e var SelectedShape = null;\n\n function update(activeAnchor) {\n var group = activeAnchor.getParent();\n var topLeft = group.get('.topLeft')[0];\n var topRight = group.get('.topRight')[0];\n var bottomRight = group.get('.bottomRight')[0];\n var bottomLeft = group.get('.bottomLeft')[0];\n var rect = group.get('.rect')[0];\n\n var anchorX = activeAnchor.getX();\n var anchorY = activeAnchor.getY();\n\n // update anchor positions\n switch (activeAnchor.getName()) {\n case 'topLeft':\n topRight.setY(anchorY);\n bottomLeft.setX(anchorX);\n break;\n case 'topRight':\n topLeft.setY(anchorY);\n bottomRight.setX(anchorX);\n break;\n case 'bottomRight':\n bottomLeft.setY(anchorY);\n topRight.setX(anchorX);\n break;\n case 'bottomLeft':\n bottomRight.setY(anchorY);\n topLeft.setX(anchorX);\n break;\n }\n\n rect.setPosition(topLeft.getPosition());\n\n var width = topRight.getX() - topLeft.getX();\n var height = bottomLeft.getY() - topLeft.getY();\n if (width \u0026amp;\u0026amp; height) {\n rect.setSize(width, height);\n }\n }\n function addAnchor(group, x, y, name) {\n var stage = group.getStage();\n var layer = group.getLayer();\n\n var anchor = new Kinetic.Circle({\n x: x,\n y: y,\n stroke: '#666',\n fill: '#ddd',\n strokeWidth: 2,\n radius: 8,\n name: name,\n draggable: true,\n dragOnTop: false\n });\n\n anchor.on('dragmove', function () {\n update(this);\n layer.draw();\n });\n anchor.on('mousedown touchstart', function () {\n group.setDraggable(false);\n this.moveToTop();\n });\n anchor.on('dragend', function () {\n group.setDraggable(true);\n layer.draw();\n });\n group.add(anchor);\n }\n\n var stage = new Kinetic.Stage({\n container: 'container',\n width: 578,\n height: 400\n });\n var darthVaderGroup = new Kinetic.Group({\n x: 270,\n y: 100,\n draggable: true\n });\n var yodaGroup = new Kinetic.Group({\n x: 100,\n y: 110,\n draggable: true\n });\n\n var Group3 = new Kinetic.Group({\n x: 100,\n y: 300,\n draggable: true\n });\n var layer = new Kinetic.Layer();\n\n /* add the groups to the layer and the layer to the stage*/\n layer.add(darthVaderGroup);\n layer.add(yodaGroup);\n layer.add(Group3);\n stage.add(layer);\n\n // darth vader\n var darthVaderImg = new Kinetic.Rect({\n x: 0,\n y: 0,\n width: 200,\n height: 138,\n fill: 'green',\n stroke: 'black',\n strokeWidth: 4,\n name: 'rect'\n });\n\n darthVaderGroup.add(darthVaderImg);\n addAnchor(darthVaderGroup, 0, 0, 'topLeft');\n addAnchor(darthVaderGroup, 200, 0, 'topRight');\n addAnchor(darthVaderGroup, 200, 138, 'bottomRight');\n addAnchor(darthVaderGroup, 0, 138, 'bottomLeft');\n\n darthVaderGroup.on('dragstart', function () {\n this.moveToTop();\n });\n // yoda\n var yodaImg = new Kinetic.Rect({\n x: 0,\n y: 0,\n width: 93,\n height: 104,\n fill: 'red',\n stroke: 'black',\n strokeWidth: 4,\n name: 'rect'\n });\n\n yodaGroup.add(yodaImg);\n addAnchor(yodaGroup, 0, 0, 'topLeft');\n addAnchor(yodaGroup, 93, 0, 'topRight');\n addAnchor(yodaGroup, 93, 104, 'bottomRight');\n addAnchor(yodaGroup, 0, 104, 'bottomLeft');\n\n yodaGroup.on('dragstart', function () {\n this.moveToTop();\n });\n\n var rect3 = new Kinetic.Rect({\n x: 0,\n y: 0,\n width: 93,\n height: 104,\n fill: 'blue',\n stroke: 'black',\n strokeWidth: 4,\n name: 'rect'\n });\n\n Group3.add(rect3);\n addAnchor(Group3, 0, 0, 'topLeft');\n addAnchor(Group3, 93, 0, 'topRight');\n addAnchor(Group3, 93, 104, 'bottomRight');\n addAnchor(Group3, 0, 104, 'bottomLeft');\n\n Group3.on('dragstart', function () {\n this.moveToTop();\n });\n\n stage.draw();\n\n //Deleting selected shape \n window.addEventListener('keydown', function (e) {\n if (layer !== null \u0026amp;\u0026amp; e.keyCode == 46) { //Delete Key = 46\n SelectedShape.remove();\n layer.batchDraw();\n }\n });\n\n //Selecting on mousedown\n layer.on('mousedown', function (evt) {\n SelectedShape = evt.targetNode.getParent();\n });\n\u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\n\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2013-10-20 18:03:54.55 UTC","last_activity_date":"2014-05-28 11:07:44.39 UTC","last_edit_date":"2013-10-22 02:41:43.087 UTC","last_editor_display_name":"","last_editor_user_id":"2330678","owner_display_name":"","owner_user_id":"2330678","post_type_id":"1","score":"0","tags":"javascript|html|html5|kineticjs","view_count":"206"} +{"id":"32842590","title":"grep and regex : Print lines that contain character N times in unknown combinations","body":"\u003cp\u003eI have a file containing strings like \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003exxxbbxxxbxbx\nxxxbxxxxbxxx\nxxbxxxbxxbxx\nbbbbxxxxxxxx\nbxxxxxxxxxxx\nxxxxbxxxxxxx\nxxxxbbxxbbxx\nxxxxbbbbxxxx\nxxxxbbbbbxxx\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn reality the file \u003ccode\u003ex\u003c/code\u003e is really a variety of uninteresting alphabetical characters. I want to use grep to print out all the lines where \u003ccode\u003eb\u003c/code\u003e occurs \u003cem\u003eexactly\u003c/em\u003e four times. \u003c/p\u003e\n\n\u003cp\u003eIf I use \u003ccode\u003egrep -e \"[^b]b[^b]\\{0,4\\}b[^b]\\{0,4\\}b[^b]\\{0,4\\}b[^b]\\{1,4\\}\" test.txt\u003c/code\u003e it excludes the last line (I want), but also excludes line 4 (I don't want) where the line starts with \u003ccode\u003eb\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eIf I use \u003ccode\u003egrep -e \"b[^b]\\{0,4\\}b[^b]\\{0,4\\}b[^b]\\{0,4\\}b[^b]\\{1,4\\}\" test.txt\u003c/code\u003e, it catches line 4 (I want) but also the last line (I don't want).\u003c/p\u003e","accepted_answer_id":"32842749","answer_count":"2","comment_count":"0","creation_date":"2015-09-29 11:21:12.437 UTC","last_activity_date":"2015-09-29 11:29:39.187 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4021436","post_type_id":"1","score":"1","tags":"regex|grep","view_count":"53"} +{"id":"9654230","title":"I have four buttons directing to a single activity, how to findout which button caused the activity to open?","body":"\u003cpre\u003e\u003ccode\u003eButton novice = (Button) findViewById(R.id.novice);\n\nnovice.setOnClickListener(new OnClickListener(){\n\n public void onClick(View v) {\n Intent nov = new Intent(getApplicationContext(), gameface.class);\n startActivity(nov);\n nov.putExtra(\"lvl\", \"1\");\n }\n});\n\nButton easy1 = (Button) findViewById(R.id.easy);\neasy1.setOnClickListener(new OnClickListener(){\n public void onClick(View v) {\n Intent eas = new Intent(getApplicationContext(), gameface.class);\n startActivity(eas);\n eas.putExtra(\"lvl\", \"2\");\n }\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eTHis is my code so i tried sending data with the button press and thought of using\nthis \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eIntent g = getIntent();\nString x = g.getStringExtra(\"lvl\");\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eon the new activity to capture which button it was but it doesnt work. \u003c/p\u003e\n\n\u003cp\u003ecan someone tell me whats up?\u003c/p\u003e","accepted_answer_id":"9654245","answer_count":"3","comment_count":"1","creation_date":"2012-03-11 10:39:53.463 UTC","last_activity_date":"2012-03-11 10:53:19.377 UTC","last_edit_date":"2012-03-11 10:42:25.01 UTC","last_editor_display_name":"","last_editor_user_id":"464988","owner_display_name":"","owner_user_id":"1262129","post_type_id":"1","score":"0","tags":"android|android-intent|android-activity","view_count":"81"} +{"id":"12675734","title":"NSTextField lags when changing frame","body":"\u003cp\u003eI am building my first application for osx and have run into trouble when i try to change the frame of a NSTextField.\u003c/p\u003e\n\n\u003cp\u003eI am trying to change the frame of the text field inside an animation (so close to 60 fps) and it works when my window is really small and the textfield is empty. But when i enter a lot of text into the text field or just make it much bigger the animation will lagg horribly. This can also be seen when i resize the window containing the text field.\u003c/p\u003e\n\n\u003cp\u003eResizing the window in the TextEdit application works at close to 60 fps so i would like some help to achieve similar performance.\u003c/p\u003e\n\n\u003cp\u003eCurrently i do something similar to below on every frame of the animation.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eNSRect rect = NSMakeRect(0, 0, width, height);\nself.textField.frame = rect;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2012-10-01 14:55:15.99 UTC","last_activity_date":"2012-10-01 21:29:41.35 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"662994","post_type_id":"1","score":"0","tags":"cocoa","view_count":"127"} +{"id":"18975074","title":"SQL Filter the output based on decimal format","body":"\u003cp\u003eI'm using SQL Server 2008, and I have an output like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eOrderNo Amount1 Amount2 Amount3 Amount4 \n----------------------------------------------------------------\n20001 473.050000 24.080000 528.050000 63.040000\n20002 473.052854 24.081236 528.054536 63.044256\n20003 563.960000 35.220000 679.050000 95.780000\n20004 563.963566 35.223569 679.052122 95.784569\n20005 897.050000 96.960000 346.120000 33.940000\n20006 897.052365 96.964568 346.121897 33.944544\n20007 268.550000 19.660000 986.330000 81.550000\n20007 268.551778 19.663655 986.333566 81.553365 \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow can I filter the output and remove the number with decimal format like \"123.456789\" and the remaining will be \"123.450000\" as shown below:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eOrderNo Amount1 Amount2 Amount3 Amount4 \n----------------------------------------------------------------\n20001 473.050000 24.080000 528.050000 63.040000\n20003 563.960000 35.220000 679.050000 95.780000\n20005 897.050000 96.960000 346.120000 33.940000\n20007 268.550000 19.660000 986.330000 81.550000\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks,\u003c/p\u003e","accepted_answer_id":"18975127","answer_count":"1","comment_count":"0","creation_date":"2013-09-24 07:05:42.873 UTC","last_activity_date":"2013-09-24 07:50:22.56 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1787519","post_type_id":"1","score":"0","tags":"sql|sql-server|sql-server-2008","view_count":"72"} +{"id":"17478695","title":"What happens when auto increment primary key in MySQL comes to maximum","body":"\u003cp\u003eI have auto increment, primary key in MySQL called ID and it is INT.\nAs my app grows and I'm getting more users they are making more entries. What happens when my INT comes to its maximum value 2 147 483 647?\nCan I just switch to BIGINT?\u003c/p\u003e","accepted_answer_id":"17478718","answer_count":"3","comment_count":"6","creation_date":"2013-07-04 22:12:52.88 UTC","favorite_count":"1","last_activity_date":"2015-11-26 19:11:50.29 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1860890","post_type_id":"1","score":"7","tags":"mysql|int|primary-key|auto-increment","view_count":"5215"} +{"id":"46324713","title":"Notify on incomming commits in Visual Studio?","body":"\u003cp\u003eIs there an extention to visual studio which will notify me when there are new commits pushed to my branch?\u003c/p\u003e\n\n\u003cp\u003eI like how Visual Studio Code shows \"incomming commits\" in the status bar and I miss this feature in Visual Studio.\u003c/p\u003e\n\n\u003cp\u003eThe reason I would like to be notified is that I usually want to pull incomming commits as soon as possible so I can avoid merge commits.\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2017-09-20 14:25:13.027 UTC","last_activity_date":"2017-09-21 10:11:25.44 UTC","last_edit_date":"2017-09-21 10:11:25.44 UTC","last_editor_display_name":"","last_editor_user_id":"475727","owner_display_name":"","owner_user_id":"475727","post_type_id":"1","score":"0","tags":"git|visual-studio|visual-studio-2017|visual-studio-extensions","view_count":"25"} +{"id":"13369364","title":".htaccess mod_rewrite not working. redirects to 404 error","body":"\u003cp\u003eI am working on a project for a client who has a blog/news page as part of their website. This is all fine however they have requested that they have custom permalinks instead of the standard issue php variables.\u003c/p\u003e\n\n\u003cp\u003eI have used the generator at searchfriendlyurls.com to create the rewrite rule. I have added this to my .htaccess file which is located in the root folder of the website however when I click on the link it just sends me to my hosts 404 error page. Any suggestions. .htaccess file below: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eOptions -Multiviews\n\nRewriteEngine On\nRewriteBase /\n\n# Force search engines to use domain.example.org.uk\nRewriteCond %{HTTP_HOST} !^domain\\.example\\.org\\.uk$\nRewriteRule ^(.*) http://domain.example.org.uk/$1 [R=301,L]\n\n# Specify search friendly URLs\nRewriteRule ^media/news/([a-z]+)/([a-z]+)/([a-z]+)/([a-z]+)$ /media/news/article.php?article_url_year=$1\u0026amp;article_url_month=$2\u0026amp;article_url_title=$3\u0026amp;article_id=$4 [L]\n\n# Generated for free at SearchFriendlyURLs.com\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny suggestions would be much appreciated\u003c/p\u003e","accepted_answer_id":"13372674","answer_count":"2","comment_count":"2","creation_date":"2012-11-13 21:45:24.867 UTC","last_activity_date":"2012-11-14 21:09:32.63 UTC","last_edit_date":"2012-11-14 17:41:50.233 UTC","last_editor_display_name":"","last_editor_user_id":"1822129","owner_display_name":"","owner_user_id":"1822129","post_type_id":"1","score":"0","tags":"php|.htaccess|mod-rewrite","view_count":"437"} +{"id":"14280136","title":"Line Graph for dates upon which variable a exists with variable b?","body":"\u003cp\u003eI'm new to stats, R, and programming in general, having only had a short course before being thrown in at the deep end. I am keen to work things out for myself, however.\u003c/p\u003e\n\n\u003cp\u003eMy first task is to check the data I have been given for anomalies. I have been given a spreadsheet with columns \u003ccode\u003eDate\u003c/code\u003e, \u003ccode\u003ePersonID\u003c/code\u003e and \u003ccode\u003ePlaceID\u003c/code\u003e. I assumed that if I plotted each factor of \u003ccode\u003ePersonID\u003c/code\u003e against \u003ccode\u003eDate\u003c/code\u003e, a straight line would show that there were no anomalies, as \u003ccode\u003ePersonID\u003c/code\u003e should only be able to exist in one place at one time. However, I am concerned that if there are 2 of the same \u003ccode\u003ePersonID\u003c/code\u003e on one \u003ccode\u003eDate\u003c/code\u003e, my plot has no way of showing this.\u003c/p\u003e\n\n\u003cp\u003eI used the simple code: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003erequire(ggplot2)\nqplot(Date,PersonID)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy issue is that I am unsure of how to factor the \u003ccode\u003eDate\u003c/code\u003e into this problem. Essentially, I am trying to check that no \u003ccode\u003ePersonID\u003c/code\u003e appears in more than one \u003ccode\u003ePlaceID\u003c/code\u003e on the same \u003ccode\u003eDate\u003c/code\u003e, and having been trying for 2 days, cannot figure out how to put all 3 of these variables on the same plot.\u003c/p\u003e\n\n\u003cp\u003eI am not asking for someone to write the code for me. I just want to know if I am on the right train of thought, and if so, how I should think about asking R to plot this. Can anybody help me? Apologies if this question is rather long winded, or posted in the wrong place.\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2013-01-11 12:42:44.137 UTC","last_activity_date":"2013-01-11 15:29:34.06 UTC","last_edit_date":"2013-01-11 14:50:37.66 UTC","last_editor_display_name":"","last_editor_user_id":"947305","owner_display_name":"Craig","owner_user_id":"1973327","post_type_id":"1","score":"0","tags":"r|data-visualization","view_count":"78"} +{"id":"27786484","title":"Create Heroku app with ruby 2.1.0 and rails 4.2.0 error","body":"\u003cp\u003eI'm trying to create a app on Heroku, but when I try to push to Heroku, I get this error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eremote: Compressing source files... done.\nremote: Building source:\nremote: \nremote: -----\u0026gt; Ruby app detected\nremote: -----\u0026gt; Compiling Ruby/Rails\nremote: !\nremote: ! An error occurred while installing Ruby ruby-2.1.0\nremote: ! For supported Ruby versions see https://devcenter.heroku.com/articles/ruby-support#supported-runtimes\nremote: ! Note: Only the most recent version of Ruby 2.1 is supported on Cedar-14\nremote: ! Command: 'set -o pipefail; curl --fail --retry 3 --retry-delay 1 --connect-timeout 3 --max-time 30 https://s3-external-1.amazonaws.com/heroku-buildpack-ruby/cedar-14/ruby-2.1.0.tgz -s -o - | tar zxf - ' failed unexpectedly:\nremote: ! \nremote: ! gzip: stdin: unexpected end of file\nremote: ! tar: Child returned status 1\nremote: ! tar: Error is not recoverable: exiting now\nremote: !\nremote: \nremote: ! Push rejected, failed to compile Ruby app\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow do I solve this?\u003c/p\u003e","accepted_answer_id":"27786545","answer_count":"2","comment_count":"1","creation_date":"2015-01-05 19:30:08.127 UTC","last_activity_date":"2015-01-05 19:51:05.893 UTC","last_edit_date":"2015-01-05 19:51:05.893 UTC","last_editor_display_name":"","last_editor_user_id":"1174001","owner_display_name":"","owner_user_id":"3669929","post_type_id":"1","score":"4","tags":"ruby-on-rails|ruby|heroku","view_count":"709"} +{"id":"41871352","title":".Net ; Read stable weight from RS232","body":"\u003cp\u003eI have a small application that can read weigh scale weights continuously.\u003c/p\u003e\n\n\u003cp\u003eI want users to only capture when the weight stabilizes for about 3 seconds.\u003c/p\u003e\n\n\u003cp\u003eHow can I achieve that?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-01-26 10:23:23.447 UTC","last_activity_date":"2017-01-27 06:14:57.48 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7473192","post_type_id":"1","score":"0","tags":"vb.net|compact-framework","view_count":"44"} +{"id":"40016255","title":"Combining jQuery functions into one function","body":"\u003cp\u003eI am making a kind of job board and there are two modals to be triggered from one page NOT in the same time. I have created these functions to trigger the modals. Can You please suggest me how to write it the shortest way (if its possible). Thank You.\nso this is main part of my html code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;!-- START main part --\u0026gt;\n\u0026lt;div class=\"container-fluid\"\u0026gt;\n \u0026lt;div class=\"container\"\u0026gt;\n \u0026lt;div class=\"well well-colour cien space\"\u0026gt;\n \u0026lt;div class=\"row text-center\"\u0026gt;\n \u0026lt;!-- START --\u0026gt;\n \u0026lt;div class=\"col-md-9\"\u0026gt;\n \u0026lt;a id=\"test\" href=\"#destination\"\u0026gt;FIRST modal\u0026lt;/a\u0026gt;\n \u0026lt;!-- Modal --\u0026gt;\n \u0026lt;div id=\"destination\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;div class=\"modal fade\" id=\"myModal\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"myModalLabel\" aria-hidden=\"true\"\u0026gt;\n \u0026lt;div class=\"modal-dialog\"\u0026gt;\n \u0026lt;div class=\"modal-content\"\u0026gt;\n \u0026lt;div class=\"modal-header\"\u0026gt;\n \u0026lt;button type=\"button\" class=\"close\" data-dismiss=\"modal\"\u0026gt;\u0026lt;span aria-hidden=\"true\"\u0026gt;\u0026amp;times;\u0026lt;/span\u0026gt;\u0026lt;span class=\"sr-only\"\u0026gt;Close\u0026lt;/span\u0026gt;\u0026lt;/button\u0026gt;\n \u0026lt;h4 class=\"modal-title\" id=\"myModalLabel\"\u0026gt;Modal title\u0026lt;/h4\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"modal-body\"\u0026gt;\n \u0026lt;h3\u0026gt;First Modal\u0026lt;/h3\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"modal-footer\"\u0026gt;\n \u0026lt;button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\"\u0026gt;Close\u0026lt;/button\u0026gt;\n \u0026lt;button type=\"button\" class=\"btn btn-primary\"\u0026gt;Save changes\u0026lt;/button\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt; \u0026lt;!-- END First --\u0026gt;\n\n \u0026lt;a id=\"test2\" href=\"#destination2\"\u0026gt;SECOND modal\u0026lt;/a\u0026gt;\n \u0026lt;!-- Modal --\u0026gt;\n \u0026lt;div id=\"destination2\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;div class=\"modal fade\" id=\"myModal2\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"myModalLabel\" aria-hidden=\"true\"\u0026gt;\n \u0026lt;div class=\"modal-dialog\"\u0026gt;\n \u0026lt;div class=\"modal-content\"\u0026gt;\n \u0026lt;div class=\"modal-header\"\u0026gt;\n \u0026lt;button type=\"button\" class=\"close\" data-dismiss=\"modal\"\u0026gt;\u0026lt;span aria-hidden=\"true\"\u0026gt;\u0026amp;times;\u0026lt;/span\u0026gt;\u0026lt;span class=\"sr-only\"\u0026gt;Close\u0026lt;/span\u0026gt;\u0026lt;/button\u0026gt;\n \u0026lt;h4 class=\"modal-title\" id=\"myModalLabel\"\u0026gt;Modal title\u0026lt;/h4\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"modal-body\"\u0026gt;\n\n \u0026lt;h3\u0026gt;Second Modal\u0026lt;/h3\u0026gt;\n\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"modal-footer\"\u0026gt;\n \u0026lt;button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\"\u0026gt;Close\u0026lt;/button\u0026gt;\n \u0026lt;button type=\"button\" class=\"btn btn-primary\"\u0026gt;Save changes\u0026lt;/button\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt; \u0026lt;!-- END Second --\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt; \n \u0026lt;/div\u0026gt;\n \u0026lt;!-- END main part--\u0026gt;\n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand Jquery I would like to \"shorten\"\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ejQuery(function (){\n $('#test').click(function(){\n $('#myModal').modal('show');\n });\n $('#test2').click(function(){\n $('#myModal2').modal('show');\n });\n});\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"40016353","answer_count":"2","comment_count":"4","creation_date":"2016-10-13 08:45:43.53 UTC","last_activity_date":"2016-10-13 11:33:53.207 UTC","last_edit_date":"2016-10-13 11:33:53.207 UTC","last_editor_display_name":"","last_editor_user_id":"519413","owner_display_name":"","owner_user_id":"5565282","post_type_id":"1","score":"-1","tags":"jquery","view_count":"38"} +{"id":"46889991","title":"SwiftMailer and SMTP logger: how to get output using disk spooler?","body":"\u003cp\u003eI'm using Swift Mailer with the Logger plugin to get SMTP output, and everything is working.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$smtp_transport = (new Swift_SmtpTransport('mail.mydomain.com', 25))\n -\u0026gt;setUsername('my_smtp_username')\n -\u0026gt;setPassword('my_smtp_pwd');\n\n$mailer = new Swift_Mailer($smtp_transport);\n$logger = new Swift_Plugins_Loggers_ArrayLogger();\n$mailer-\u0026gt;registerPlugin(new Swift_Plugins_LoggerPlugin($logger));\n\n$message = (new Swift_Message('My subject'))\n -\u0026gt;setFrom('from@mydomain.com', 'My Name')\n -\u0026gt;setTo('to@otherdomain.com')\n -\u0026gt;setBody('My body', 'text/html');\n\n$mailer-\u0026gt;send($message);\n\necho $logger-\u0026gt;dump();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe next step is to implement a sort of queue. I tried to use Swift Mailer's disk spooler and I think it works great for my needs.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$spool = new Swift_FileSpool('/path/to/spool');\n$spool-\u0026gt;setMessageLimit(3);\n\n$spool_transport = new Swift_SpoolTransport($spool);\n$mailer = new Swift_Mailer($spool_transport);\n$logger = new Swift_Plugins_Loggers_ArrayLogger();\n$mailer-\u0026gt;registerPlugin(new Swift_Plugins_LoggerPlugin($logger));\n\n$message = (new Swift_Message('My subject'))\n -\u0026gt;setFrom('from@mydomain.com', 'My Name')\n -\u0026gt;setTo('to@otherdomain.com')\n -\u0026gt;setBody('My body', 'text/html');\n\n/* Not really sent, just sent to disk spool */\n$mailer-\u0026gt;send($message);\n\n$smtp_transport = (new Swift_SmtpTransport('mail.mydomain.com', 25))\n -\u0026gt;setUsername('my_smtp_username')\n -\u0026gt;setPassword('my_smtp_pwd');\n\n/* Now it has been sent */\n$spool-\u0026gt;flushQueue($smtp_transport);\n\n/* But I lost SMTP debug... */\necho $logger-\u0026gt;dump();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut I lost any SMTP debug!\nI tried using 2 different instances of SwiftMailer, but the result is the same: the method flushQueue doesn't fill any log, so the SMTP output is lost.\u003c/p\u003e\n\n\u003cp\u003eIs there a way to solve?\nThank you\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-10-23 12:59:25.89 UTC","last_activity_date":"2017-10-23 12:59:25.89 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2029958","post_type_id":"1","score":"0","tags":"php|email|logging|smtp|swiftmailer","view_count":"20"} +{"id":"33154338","title":"Internet connection exception fail","body":"\u003cp\u003eHi I try to change the normal \"No internet connection\" page from android browser to a costum error page within my webapp. While doing this I found this \u003ca href=\"https://stackoverflow.com/questions/6552160/prevent-webview-from-displaying-web-page-not-available\"\u003elink\u003c/a\u003e and in the answer was a well solution for binding a error page into my activity.\u003c/p\u003e\n\n\u003cp\u003eThe problem with this solution is that my Url \u003ccode\u003ehttp://192.167.0.45/loc/index.php\u003c/code\u003e wont become loaded and only after any seconds the file \u003ccode\u003emyerrorpage.html\u003c/code\u003e become showed . How can my url become loaded and the other url only in error case? It look like the second \u003ccode\u003emWebview.loadUrl\u003c/code\u003e override the first...\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@Override\npublic void onCreate(Bundle savedInstanceState) {\n\n\n setContentView(R.layout.activity_localy);\n mWebView = (WebView) findViewById(R.id.webview);\n // Brower niceties -- pinch / zoom, follow links in place\n mWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);\n mWebView.setWebViewClient(new GeoWebViewClient());\n // Below required for geolocation\n mWebView.getSettings().setJavaScriptEnabled(true);\n mWebView.getSettings().setGeolocationEnabled(true);\n mWebView.setWebChromeClient(new GeoWebChromeClient()); \n // Load google.com\n mWebView.loadUrl(\"http://192.167.0.45/loc/index.php\");\n\n super.onCreate(savedInstanceState); mWebView.setWebViewClient(new WebViewClient() {\n public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {\n mWebView.loadUrl(\"file:///android_asset/myerrorpage.html\");\n\n }\n }); \n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"33154441","answer_count":"1","comment_count":"0","creation_date":"2015-10-15 16:58:48.813 UTC","last_activity_date":"2015-10-15 17:04:17.477 UTC","last_edit_date":"2017-05-23 11:59:49.3 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"5274362","post_type_id":"1","score":"0","tags":"java|android|android-webview|internet-connection","view_count":"44"} +{"id":"13857677","title":"UIView change background transparency","body":"\u003cp\u003eI am working on an Iphone Application.\u003c/p\u003e\n\n\u003cp\u003eI am creating a UIView:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eUIView *popupView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 250, 250)];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThen I want to use an image as a background for the view:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eUIColor * bgColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@\"blue_bg.png\"]];\n\npopupView.backgroundColor = bgColor;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs there a way I can make that background semi transparent? maybe set the alfa value to 0.5 or give it an opacity.\u003c/p\u003e\n\n\u003cp\u003eI tried to make the image transparent using photoshop but when I set it as a background it is no longer transparent.\u003c/p\u003e\n\n\u003cp\u003eNote that I need only the background to be transparent not the subviews\u003c/p\u003e\n\n\u003cp\u003eThanks a lot for any help \u003c/p\u003e","accepted_answer_id":"13857817","answer_count":"2","comment_count":"3","creation_date":"2012-12-13 10:19:39.8 UTC","last_activity_date":"2012-12-13 10:28:17.123 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"887835","post_type_id":"1","score":"3","tags":"iphone|objective-c|background|transparency","view_count":"7517"} +{"id":"43619034","title":"How to change the color of a list according to a randomly generated banner image?","body":"\u003cp\u003eI made an array of images to give me a random banner each time I refresh my website. I need the navigation bar under the banner to change to specific colors to match each banner and I can't for the life of me figure it out. \nHere is the array\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;script type=\"text/javascript\"\u0026gt; \n\n \u0026lt;!--//Random Banner image on Page Reload \n\n //store the images in arrays below \n\n images = new Array(3); \n\n images[0] = \"\u0026lt;a href='#'\u0026gt;\u0026lt;img src='newsbanner1.jpg' \u0026lt;/a\u0026gt;\";\n images[1] = \"\u0026lt;a href='#'\u0026gt;\u0026lt;img src='newsbanner2.jpg' \u0026lt;/a\u0026gt;\"; \n images[2] = \"\u0026lt;a href='#'\u0026gt;\u0026lt;img src='newsbanner3.jpg' \u0026lt;/a\u0026gt;\";\n index = Math.floor(Math.random() * images.length); \n document.write(images[index]);\n\n //done \n // --\u0026gt; \n \u0026lt;/script\u0026gt; \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow I just need the list that I made as the navigation menu to change background colors to match each image. For example, purple for newsbanner1.jpg, blue for newsbanner2.jpg, and yellow for newsbanner3.jpg. Any help would be greatly appreciated.\u003c/p\u003e","answer_count":"2","comment_count":"1","creation_date":"2017-04-25 19:10:42.69 UTC","last_activity_date":"2017-04-25 19:22:50.76 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7921346","post_type_id":"1","score":"0","tags":"javascript|html|css","view_count":"25"} +{"id":"23296361","title":"JVM Tunning of Java Class","body":"\u003cp\u003eMy java class reads in a 60MB file and produces a \u003ccode\u003eHashMap\u003c/code\u003e of a \u003ccode\u003eHashMap\u003c/code\u003e with over 300 million records.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eHashMap\u0026lt;Integer, HashMap\u0026lt;Integer, Double\u0026gt;\u0026gt; pairWise =\n new HashMap\u0026lt;Integer, HashMap\u0026lt;Integer, Double\u0026gt;\u0026gt;();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI already tunned the VM argument to be:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e-Xms512M -Xmx2048M\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut system still goes for:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eException in thread \"main\" java.lang.OutOfMemoryError: Java heap space\n at java.util.HashMap.createEntry(HashMap.java:869)\n at java.util.HashMap.addEntry(HashMap.java:856)\n at java.util.HashMap.put(HashMap.java:484)\n at com.Kaggle.baseline.BaselineNew.createSimMap(BaselineNew.java:70)\n at com.Kaggle.baseline.BaselineNew.\u0026lt;init\u0026gt;(BaselineNew.java:25)\n at com.Kaggle.baseline.BaselineNew.main(BaselineNew.java:315)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow big of the heap will it take to run without failing with an OOME?\u003c/p\u003e","answer_count":"3","comment_count":"2","creation_date":"2014-04-25 14:48:28.767 UTC","last_activity_date":"2014-04-25 15:29:41.773 UTC","last_edit_date":"2014-04-25 14:51:35.497 UTC","last_editor_display_name":"","last_editor_user_id":"738746","owner_display_name":"","owner_user_id":"2766380","post_type_id":"1","score":"1","tags":"java|jvm|heap-memory|jvm-arguments","view_count":"119"} +{"id":"10246690","title":"Error when using Frame/RelativeLayout inside Gridview","body":"\u003cp\u003eI'm creating a custom Gridview, each cell represented by a layout containing\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003e1) a custom RatingBar\u003c/li\u003e\n\u003cli\u003e2) ImageView\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eI inflate them inside the getView() of Adaptor.\u003c/p\u003e\n\n\u003cp\u003eIt works fine is the said layout is of type Linear. But if I replace it with Frame/relative layout, it crashes with this in Logcat.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e04-20 18:19:16.921: E/AndroidRuntime(24111): FATAL EXCEPTION: main\n04-20 18:19:16.921: E/AndroidRuntime(24111): java.lang.ClassCastException: android.widget.AbsListView$LayoutParams\n04-20 18:19:16.921: E/AndroidRuntime(24111): at android.widget.RelativeLayout$DependencyGraph.findRoots(RelativeLayout.java:1303)\n04-20 18:19:16.921: E/AndroidRuntime(24111): at android.widget.RelativeLayout$DependencyGraph.getSortedViews(RelativeLayout.java:1250)\n04-20 18:19:16.921: E/AndroidRuntime(24111): at android.widget.RelativeLayout.sortChildren(RelativeLayout.java:281)\n04-20 18:19:16.921: E/AndroidRuntime(24111): at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:303)\n04-20 18:19:16.921: E/AndroidRuntime(24111): at android.view.View.measure(View.java:8313)\n04-20 18:19:16.921: E/AndroidRuntime(24111): at android.widget.GridView.onMeasure(GridView.java:950)\n04-20 18:19:16.921: E/AndroidRuntime(24111): at android.view.View.measure(View.java:8313)\n04-20 18:19:16.921: E/AndroidRuntime(24111): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3138)\n04-20 18:19:16.921: E/AndroidRuntime(24111): at android.widget.FrameLayout.onMeasure(FrameLayout.java:250)\n04-20 18:19:16.921: E/AndroidRuntime(24111): at android.view.View.measure(View.java:8313)\n04-20 18:19:16.921: E/AndroidRuntime(24111): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3138)\n04-20 18:19:16.921: E/AndroidRuntime(24111): at android.widget.FrameLayout.onMeasure(FrameLayout.java:250)\n04-20 18:19:16.921: E/AndroidRuntime(24111): at android.view.View.measure(View.java:8313)\n04-20 18:19:16.921: E/AndroidRuntime(24111): at android.view.ViewRoot.performTraversals(ViewRoot.java:839)\n04-20 18:19:16.921: E/AndroidRuntime(24111): at android.view.ViewRoot.handleMessage(ViewRoot.java:1859)\n04-20 18:19:16.921: E/AndroidRuntime(24111): at android.os.Handler.dispatchMessage(Handler.java:99)\n04-20 18:19:16.921: E/AndroidRuntime(24111): at android.os.Looper.loop(Looper.java:123)\n04-20 18:19:16.921: E/AndroidRuntime(24111): at android.app.ActivityThread.main(ActivityThread.java:3683)\n04-20 18:19:16.921: E/AndroidRuntime(24111): at java.lang.reflect.Method.invokeNative(Native Method)\n04-20 18:19:16.921: E/AndroidRuntime(24111): at java.lang.reflect.Method.invoke(Method.java:507)\n04-20 18:19:16.921: E/AndroidRuntime(24111): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)\n04-20 18:19:16.921: E/AndroidRuntime(24111): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)\n04-20 18:19:16.921: E/AndroidRuntime(24111): at dalvik.system.NativeStart.main(Native Method)\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2012-04-20 12:56:31.45 UTC","favorite_count":"1","last_activity_date":"2017-04-17 13:29:14.9 UTC","last_edit_date":"2017-04-17 13:29:14.9 UTC","last_editor_display_name":"","last_editor_user_id":"13302","owner_display_name":"","owner_user_id":"219899","post_type_id":"1","score":"1","tags":"android","view_count":"472"} +{"id":"4387812","title":"VisualStudio bug?","body":"\u003cp\u003eIn VS 2010 created a new \u003ccode\u003eWinForm\u003c/code\u003e project. Added a new UserControl WPF.\u003c/p\u003e\n\n\u003cp\u003e2 compile-time errors appeared:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eError 1 The type\n 'System.Windows.Markup.IQueryAmbient'\n is defined in an assembly that is not\n referenced. You must add a reference\n to assembly 'System.Xaml,\n Version=4.0.0.0, Culture=neutral,\n PublicKeyToken=b77a5c561934e089'. D:\\Projets\\WindowsFormsApplication2\\UserControl1.xaml.cs 20 26 WindowsFormsApplication2\u003c/p\u003e\n \n \u003cp\u003eError 2 The type name\n 'IComponentConnector' could not be\n found in the namespace\n 'System.Windows.Markup'. This type has\n been forwarded to assembly\n 'System.Xaml, Version=4.0.0.0,\n Culture=neutral,\n PublicKeyToken=b77a5c561934e089'\n Consider adding a reference to that\n assembly. D:\\Projets\\WindowsFormsApplication2\\obj\\x86\\Debug\\UserControl1.g.cs 41 100 WindowsFormsApplication2\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003e\u003cstrong\u003eNB.\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eReferences like \u003ccode\u003ePresenationCore.dll\u003c/code\u003e, \u003ccode\u003ePresenationFramework.dll\u003c/code\u003e, \u003ccode\u003eWindowsBase.dll\u003c/code\u003e are added automatically when adding a new WPF UserControl to the WinForm project, so why not \u003ccode\u003eSystem.Xaml.dll\u003c/code\u003e too?\u003c/p\u003e\n\n\u003cp\u003e==============\u003c/p\u003e\n\n\u003cp\u003eBug reported on \u003cstrong\u003e\u003ca href=\"https://connect.microsoft.com/VisualStudio/feedback/details/629731/not-all-references-are-added-when-addind-a-wpf-usercontrol-to-a-winform-project\" rel=\"noreferrer\"\u003eMicrosoft Connect\u003c/a\u003e\u003c/strong\u003e.\u003c/p\u003e","accepted_answer_id":"4387824","answer_count":"2","comment_count":"2","creation_date":"2010-12-08 13:12:31.123 UTC","favorite_count":"2","last_activity_date":"2010-12-08 13:29:39.64 UTC","last_edit_date":"2010-12-08 13:29:39.64 UTC","last_editor_display_name":"","last_editor_user_id":"185593","owner_display_name":"","owner_user_id":"185593","post_type_id":"1","score":"33","tags":".net|wpf|visual-studio|winforms","view_count":"12171"} +{"id":"34090427","title":"VectorDrawable is scaled and unsharp","body":"\u003cp\u003e\u003cstrong\u003eVector xml in Android Studio:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\nandroid:width=\"24dp\"\nandroid:height=\"24dp\"\nandroid:viewportHeight=\"24.0\"\nandroid:viewportWidth=\"24.0\"\u0026gt;\n\u0026lt;path\n android:fillColor=\"#FF000000\"\n android:pathData=\"M12,15C7.58,15 4,16.79 4,19V21H20V19C20,16.79 16.42,15 12,15M8,9A4,4 0,0 0,12 13A4,4 0,0 0,16 9M11.5,2C11.2,2 11,2.21 11,2.5V5.5H10V3C10,3 7.75,3.86 7.75,6.75C7.75,6.75 7,6.89 7,8H17C16.95,6.89 16.25,6.75 16.25,6.75C16.25,3.86 14,3 14,3V5.5H13V2.5C13,2.21 12.81,2 12.5,2H11.5Z\" /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eThe result:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/3unWq.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/3unWq.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eChanging \u003ccode\u003e24dp\u003c/code\u003e to \u003ccode\u003e96dp\u003c/code\u003e, result:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/8iEp2.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/8iEp2.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eMenu xml in Android Studio:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e...\n\u0026lt;!-- Sperren --\u0026gt;\n\u0026lt;TextView\n android:id=\"@+id/suppress_button\"\n style=\"@style/TextAppearance.MaterialSheetFab.Sheet.Item\"\n android:drawableLeft=\"@drawable/ic_assignment_return\"\n android:drawableStart=\"@drawable/ic_assignment_return\"\n android:text=\"Sperren\" /\u0026gt;\n\n \u0026lt;!-- IH-Auftrag --\u0026gt;\n \u0026lt;TextView\n android:id=\"@+id/setup_maintenance_order_button\"\n style=\"@style/TextAppearance.MaterialSheetFab.Sheet.Item\"\n android:drawableLeft=\"@drawable/ic_ih_auftraege\"\n android:drawableStart=\"@drawable/ic_ih_auftraege\"\n android:text=\"IH-Auftrag\" /\u0026gt;\n ...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo my question now is, how to change the size automatically like a svg normally should do?\u003c/p\u003e","answer_count":"1","comment_count":"5","creation_date":"2015-12-04 14:20:14.487 UTC","last_activity_date":"2016-03-03 02:41:33.96 UTC","last_edit_date":"2015-12-04 14:35:08.537 UTC","last_editor_display_name":"","last_editor_user_id":"2649012","owner_display_name":"","owner_user_id":"4406921","post_type_id":"1","score":"1","tags":"android|vectordrawable","view_count":"351"} +{"id":"15422275","title":"Is there an easy way to determine which parts of a vb.net project is still used?","body":"\u003cp\u003eI maintain an old vb.net project that I didn't make and I was wondering if there's an easy way to determine which parts of the software is still used today by the staff where I work.\u003c/p\u003e\n\n\u003cp\u003eI would like to log all function calls without having to edit each one of them if possible.\u003c/p\u003e\n\n\u003cp\u003eThe project has 27 forms and 6 modules.\u003c/p\u003e\n\n\u003cp\u003eAny ideas?\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2013-03-14 23:43:30.887 UTC","last_activity_date":"2013-03-14 23:50:41.437 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"35084","post_type_id":"1","score":"1","tags":"vb.net|usage-statistics","view_count":"85"} +{"id":"19588621","title":"PHP: Is it possible to do a task on the server without the user noticing a difference in load time?","body":"\u003cp\u003eI've got a form upload where I'm adding user's input to the database. As part of the process I also send an email to myself with an attachment of a file (that the user uploaded).\u003c/p\u003e\n\n\u003cp\u003eThe code structure is quite simple:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e//Establishing the $_POST[] vars\n//Log them in DB\n// Send out the email \u0026lt;-- This part adds 5 seconds to load time!!\n//Redirect user to a success page\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe bit where I send the email to myself makes up a 5 second difference to the load time between when the user hits 'Submit' and sees the 'Success' page!!\u003c/p\u003e\n\n\u003cp\u003eThe code for sending out the email looks like this: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$to = \"test@test.com\";\n$subject = \"new Image\";\nrequire_once('../api/class.phpmailer.php');\n$mail = new PHPMailer(true); \n$mail-\u0026gt;IsSMTP(); // telling the class to use SMTP\n$mail-\u0026gt;Host = $smtp_host;\n$mail-\u0026gt;SMTPAuth = true; // enable SMTP authentication\n$mail-\u0026gt;Host = $smtp_host;\n$mail-\u0026gt;Port = $smpt_port;\n$mail-\u0026gt;Username = $smpt_email_username;\n$mail-\u0026gt;Password = $smpt_email_pass;\n$mail-\u0026gt;AddAddress($to, '');\n$mail-\u0026gt;SetFrom($set_from_email, $set_from_name);\n$mail-\u0026gt;AddReplyTo($replyto_email, $replyto_name);\n$mail-\u0026gt;Subject = \"new image\";\n$mail-\u0026gt;AltBody = $mail_altbody;\n$mail-\u0026gt;AddEmbeddedImage('../uploads/'.$image, 't');\n$mail-\u0026gt;IsHTML(true); \n$mail-\u0026gt;MsgHTML('\u0026lt;img src=\"cid:t\" /\u0026gt;');\n$mail-\u0026gt;Send();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy question is - is it possible to send the email asynchronously, so it can take place in the server by itself, eliminating the need for the user to wait for the additional time while the email is being sent?\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","answer_count":"2","comment_count":"1","creation_date":"2013-10-25 11:29:43.657 UTC","last_activity_date":"2013-10-25 11:40:08.93 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1775598","post_type_id":"1","score":"0","tags":"php|email|email-attachments","view_count":"59"} +{"id":"13516958","title":"How to consume WCF Stream service in Java client?","body":"\u003cp\u003eI am developing a java client to consume the WCF service below. Since the WCF service is using the Stream tech, I also hope to use the stream tech in java client code to reduce the memory use. Is there anyone can provide me an advice about how to write it? Thanks.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enamespace TmpWcfStream\n{\n [MessageContract]\n public class InputMessage\n {\n [MessageHeader(MustUnderstand = true)]\n public string TranName { get; set; }\n\n [MessageBodyMember(Order=1)]\n public Stream FileData { get; set; }\n }\n\n [MessageContract]\n public class OutputMessage\n {\n [MessageBodyMember(Order = 100)]\n public bool Success { get; set; }\n\n [MessageBodyMember(Order = 200)]\n public string ErrorMsg { get; set; }\n }\n}\n\nnamespace TmpWcfStream\n{\n public class UploadDataSvc : UploadSvcContract\n {\n private const int bufferLen = 4096;\n\n public OutputMessage UploadData(InputMessage msg)\n {\n OutputMessage outputMsg = new OutputMessage { ErrorMsg = string.Empty, Success = true };\n\n try\n {\n Stream inputStream = msg.FileData;\n String filePath = @\"C:\\tmp\\output.txt\";\n\n using (FileStream targetStream = new FileStream(filePath, FileMode.Create, FileAccess.Write, FileShare.None))\n {\n byte[] buffer = new byte[bufferLen];\n int count = 0;\n while ((count = inputStream.Read(buffer, 0, bufferLen)) \u0026gt; 0)\n {\n targetStream.Write(buffer, 0, count);\n }\n }\n inputStream.Close();\n }\n catch(Exception e)\n {\n outputMsg.Success = false;\n outputMsg.ErrorMsg = e.ToString();\n }\n\n return outputMsg;\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"0","creation_date":"2012-11-22 16:40:37.203 UTC","favorite_count":"2","last_activity_date":"2015-11-13 13:45:26.923 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"534590","post_type_id":"1","score":"8","tags":"java|wcf|stream|interop","view_count":"597"} +{"id":"6062023","title":"Error when trying to create subscriptions in reporting services","body":"\u003cp\u003eI am trying to set up reporting emailing SQL Server 2005 Reporting Services. When I click to save a subscription I recieve the following error:\u003c/p\u003e\n\n\u003cp\u003eAn internal error occurred on the report server. See the error log for more details. (rsInternalError) Get Online Help The SELECT permission was denied on the object 'sysservers', database 'mssqlsystemresource', schema 'sys'. \u003c/p\u003e\n\n\u003cp\u003eI was under the impression Reporting Services uses the role RSExecRole which is created during installation. Isn't mssqlsystemresources something that is not supposed to, and not easily touched?\u003c/p\u003e","accepted_answer_id":"6062337","answer_count":"1","comment_count":"0","creation_date":"2011-05-19 16:48:18.683 UTC","last_activity_date":"2011-05-19 17:15:14.047 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"538429","post_type_id":"1","score":"0","tags":"sql-server-2005|reporting-services","view_count":"515"} +{"id":"19205684","title":"NavigationDrawer with Fragments or Activities? Also, please school me on proper Fragment management","body":"\u003cp\u003eMy app uses the \u003ccode\u003eActionBarCompat\u003c/code\u003e and \u003ccode\u003eNavigationDrawer\u003c/code\u003e, which begs the question of how is one supposed to structure the navigation? I see two options:\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003e1) Use a single \u003ccode\u003eActivity\u003c/code\u003e and swap out \u003ccode\u003eFragments\u003c/code\u003e.\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003e2) Use multiple \u003ccode\u003eActivities\u003c/code\u003e, and transition between them.\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eThe \u003cstrong\u003elatter\u003c/strong\u003e seems to be the correct way, however this means that each \u003ccode\u003eActivity\u003c/code\u003e must get and build the \u003ccode\u003eActionBar\u003c/code\u003e and \u003ccode\u003eNavigationDrawer\u003c/code\u003e when called from another \u003ccode\u003eActivity\u003c/code\u003e. \u003c/p\u003e\n\n\u003cp\u003eHow will this affect my transition animations? If I have a left-to-right transition effect when a navigation item is clicked, will it transition the entire \u003ccode\u003eActivity\u003c/code\u003e or everything below the \u003ccode\u003eActionBar\u003c/code\u003e?\u003c/p\u003e\n\n\u003cp\u003eThe \u003cstrong\u003eformer\u003c/strong\u003e seems fraught with issues. A single .java class file could get really heavy and difficult to manage. \u003c/p\u003e\n\n\u003cp\u003e\u003cem\u003eBut while we're on the subject of \u003ccode\u003eFragments\u003c/code\u003e, please consider this situation and school me on proper Fragment management:\u003c/em\u003e\u003c/p\u003e\n\n\u003cp\u003eA blank \u003ccode\u003eActivity\u003c/code\u003e with just a \u003ccode\u003eLinearLayout\u003c/code\u003e attaches a new \u003ccode\u003eFragment\u003c/code\u003e to it that contains a \u003ccode\u003eButton\u003c/code\u003e. Inside the \u003ccode\u003eFragment\u003c/code\u003e class, this button gets an \u003ccode\u003eonClickListener\u003c/code\u003e and when the button is clicked, another of the same kind of \u003ccode\u003eFragment\u003c/code\u003e should be attached to the \u003ccode\u003eLinearLayout\u003c/code\u003e inside the \u003ccode\u003eActivity\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eA) Should the \u003ccode\u003eFragment\u003c/code\u003e class communicate to the \u003ccode\u003eActivity\u003c/code\u003e that a new \u003ccode\u003eFragment\u003c/code\u003e should be attached? This could be done with a custom \u003ccode\u003epublic interface\u003c/code\u003e and the callback being executed within the \u003ccode\u003eonClickListener\u003c/code\u003e in the \u003ccode\u003eFragment\u003c/code\u003e class.\u003c/p\u003e\n\n\u003cp\u003eB) Or, should the \u003ccode\u003eFragment\u003c/code\u003e handle attaching the new instance inside the \u003ccode\u003eonClickListener\u003c/code\u003e, making the \u003ccode\u003eActivity\u003c/code\u003e work less? By simply bridging the clicked \u003ccode\u003eButton\u003c/code\u003e and calling .getParent() until the \u003ccode\u003eLinearLayout\u003c/code\u003e is reached, then attaching it there.\u003c/p\u003e","accepted_answer_id":"19205748","answer_count":"1","comment_count":"0","creation_date":"2013-10-06 05:17:25.347 UTC","favorite_count":"1","last_activity_date":"2013-10-06 05:36:56.513 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2193290","post_type_id":"1","score":"1","tags":"java|android|android-fragments","view_count":"72"} +{"id":"30180306","title":"Load 2 files .so native lib from 2 different projects in android","body":"\u003cp\u003eI have two projects A and B. Both of them are using native code.\u003c/p\u003e\n\n\u003cp\u003eNow, I set A as a java library.\u003c/p\u003e\n\n\u003cp\u003eThen, add Library A into B.\u003c/p\u003e\n\n\u003cp\u003eWhen I run B, Project B can not load native lib in B.\u003c/p\u003e\n\n\u003cp\u003ePlease give me a instruction!\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2015-05-12 01:33:11.713 UTC","last_activity_date":"2015-05-12 10:48:36.837 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4772249","post_type_id":"1","score":"0","tags":"android|android-ndk|jni","view_count":"38"} +{"id":"43997873","title":"Text fades in/out on new bootstrap carousel slide","body":"\u003cp\u003eI have built a bootstrap carousel that changes a p tag's text depending on the active carousel slide. How would I go about fading that text out when a slide's interval is about to end, and fade in the new, altered text upon the new slide becoming active?\u003c/p\u003e\n\n\u003cp\u003eHere is the jQuery (JSFiddle example below):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(document).ready(function () {\n$('.carousel').carousel({\n interval: 2000\n});\n\nvar arrMessages = [\"Text for Image 1 class!\", \n \"Text for Image 2 class!\",\n \"Text for Image 3 class!\"]\n\nvar $msg = $(\"#sticksCarouselMessage\");\n$('#sticksCarousel').on('slid.bs.carousel', function () {\n\n var text = \"\", \n $active = $('div.active'),\n index = $('div.item').index($active);\n\n $msg.text(arrMessages[index]);\n\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e});\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eJSFIDDLE:\u003c/strong\u003e \u003ca href=\"https://jsfiddle.net/CharlieMcShane/hja32vjn/\" rel=\"nofollow noreferrer\"\u003ehttps://jsfiddle.net/CharlieMcShane/hja32vjn/\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"43998064","answer_count":"2","comment_count":"1","creation_date":"2017-05-16 09:42:58.253 UTC","last_activity_date":"2017-05-16 10:16:14.793 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1634353","post_type_id":"1","score":"1","tags":"jquery|html|css|twitter-bootstrap|carousel","view_count":"131"} +{"id":"13394740","title":"How to remove or display no arrows in WEPopover","body":"\u003cp\u003emy question is if it is posible to display no arrows with the WEPopover or if there are any way to display a popover without arrows in Iphone.\nI could do that with a subview but in do know how to programing it.\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2012-11-15 09:38:07.877 UTC","last_activity_date":"2012-11-15 09:54:12.33 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1826177","post_type_id":"1","score":"1","tags":"iphone|ios|xcode|popup|popover","view_count":"169"} +{"id":"25038720","title":"Handling concurrency exceptions when passing the objects ids and timestamps using jQuery","body":"\u003cp\u003eI have the following business scenario inside my Asp.net MVC 4 asset management system :-\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eScenario 1) A user selects multiple servers , then he selects a Rack Tag ,and click on\n assign . so the selected servers will be assigned to the new Rack.\u003c/p\u003e\n \n \u003cp\u003eScenario 2) And i want to check for any concurrency exception , if for example the selected\n servers have been modified by another user since they were retrieved .\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eso i have wrote the following jQuery which will send the object ids+timestamps to the action method:-\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$('body').on(\"click\", \"#transferSelectedAssets\", function () {\n var boxData = [];\n $(\"input[name='CheckBoxSelection']:checked\").each(function () {\n boxData.push($(this).val());\n });\n\n var URL = \"@Url.Content(\"~/Server/TransferSelectedServers\")\";\n\n\n $.ajax({\n type: \"POST\",\n url: URL,\n data: { ids: boxData.join(\",\"), rackTo: $(\"#rackIDTo\").val()}\n ,\n success: function (data) {\n addserver(data); })});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand inside the action method i have the following code:-\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic ActionResult TransferSelectedServers(string ids, int? rackTo)\n{\n\n if (ModelState.IsValid)\n {\n try\n {\n var serverIDs = ids.Split(',');\n int i = 0;\n foreach (var serverinfo in serverIDs)\n {\n var split = serverinfo.Split('~');\n\n var name = split[0];\n //System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();\n\n byte[] bytearray = Encoding.Default.GetBytes(split[1]);\n i++;\n var server = repository.FindServer_JTechnology(Int32.Parse(name));\n if (server == null)\n return Json(new { IsSuccess = false, reload = true, description = \" Some Servers might have been deleted, Transferre process has been cancelled .\", rackid = rackFrom }, JsonRequestBehavior.AllowGet);\n\n server.RackID = rackTo;\n server.timestamp = bytearray;\n string ADusername = User.Identity.Name.Substring(User.Identity.Name.IndexOf(\"\\\\\") + 1);\n repository.InsertOrUpdateServer(server, ADusername, server.Technology.IT360ID.Value, server.IT360SiteID, new bool(), server.Technology);\n }\n\n repository.Save();\n\n\n return Json(new { IsSuccess = true, description = i + \" Server/s Transferred Successfully To Rack \" + }, JsonRequestBehavior.AllowGet);\n }\n catch (DbUpdateConcurrencyException e)\n {\n return Json(new { IsSuccess = false, reload = true, description = \"records has been modified by antoehr user\" }, JsonRequestBehavior.AllowGet);\n\n\n }\n catch (Exception e)\n {\n return Json(new { IsSuccess = false, reload = true, description = \" Server/s Can not Be Transferred to the Selected Rack \" }, JsonRequestBehavior.AllowGet);\n\n\n }\n }\n return RedirectToAction(\"Details\", new { id = rackTo });\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand the repository method looks as follow:-\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic void InsertOrUpdateServer(TMSServer server, string username, long assetid, long? siteid = 0, bool isTDMHW = false, Technology t = null)\n {\n\n server.IT360SiteID = siteid.Value;\n tms.Entry(server).State = EntityState.Modified;\n var technology = tms.Technologies.Single(a =\u0026gt; a.TechnologyID == server.TMSServerID);\n technology.IsManaged = t.IsManaged;\n tms.Entry(technology).State = EntityState.Modified;\n InsertOrUpdateTechnologyAudit(auditinfo);\n\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut currently if two users selects the same servers and assign them to tow different racks , no concurrency exception will be raised ?\nCan anyone advice ? baring in mind that if two users edit single object then one of them will get an concurrent exception message. so my timestamp column is defined correctly.\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","answer_count":"0","comment_count":"6","creation_date":"2014-07-30 13:54:59.823 UTC","last_activity_date":"2014-07-30 13:54:59.823 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1146775","post_type_id":"1","score":"1","tags":"entity-framework|concurrency|entity-framework-4|asp.net-mvc-5|model-binding","view_count":"92"} +{"id":"40356061","title":"Field type is less accessible than field","body":"\u003cp\u003eI have the following declarations:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic static class Helper\n{\n public static Func\u0026lt;T1,T2, string\u0026gt; myFunc = (t1, t2) =\u0026gt;\n {\n var result = string.Empty\n //do some things with params t1 and t2, and build a string\n return result\n };\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand I am consuming it like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar myString = Helper.myFunc(t1, t2);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ein a different class. \nIt does not compile, it says \"Inconsistent accesibility: field type ... is less accessible than field Helper.myFunc\"\nI understand that it has to do with the anonymus declaration, but how can it be solved?\u003c/p\u003e","accepted_answer_id":"40356132","answer_count":"1","comment_count":"6","creation_date":"2016-11-01 07:52:50.023 UTC","last_activity_date":"2016-11-01 08:00:03.41 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1996226","post_type_id":"1","score":"0","tags":"c#|func|anonymous-delegates","view_count":"296"} +{"id":"5183831","title":"jQuery.getJSON not working for twitter","body":"\u003cp\u003ecan any one please tell me why this jQuery function is not working. It raises no \u003ccode\u003ealert\u003c/code\u003e.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$.getJSON('http://api.twitter.com/1/statuses/user_timeline.json?',\n {\n screen_name: 'samajshekhar',\n count: '5',\n },\n function (data) {\n alert('hello world from twitter');\n }); \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn fiddler i can see that expected JSON has been returned.\u003c/p\u003e\n\n\u003cp\u003eHowever when calling flicker's api using the example code at jQuery documentation it gives an \u003ccode\u003ealert\u003c/code\u003e as expected\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$.getJSON('http://api.flickr.com/services/feeds/photos_public.gne?jsoncallback=?',\n {\n tags: 'cat',\n tagmode: 'any',\n format: 'json'\n },\n function(data) {\n alert('hello world from flicker'); \n });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is the \u003ca href=\"http://jsbin.com/usuri3/2/edit\" rel=\"nofollow\"\u003esample code on JS Bin\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI tried even with facebook's graph API still no \u003ccode\u003ealert\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eIn \u003ca href=\"http://jsbin.com/usuri3/2/edit\" rel=\"nofollow\"\u003esample code\u003c/a\u003e i tried getJSON calls to facebook,twitter,flicker and only the flicker's call's \u003ccode\u003ealert\u003c/code\u003e is raised.\u003c/p\u003e","accepted_answer_id":"5183867","answer_count":"3","comment_count":"0","creation_date":"2011-03-03 16:52:06.847 UTC","favorite_count":"1","last_activity_date":"2011-03-03 17:12:06.017 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"399722","post_type_id":"1","score":"0","tags":"jquery|facebook|twitter|getjson","view_count":"3202"} +{"id":"36672258","title":"How to make characters in a string repeat using Javascript?","body":"\u003cp\u003eHow can I make individual characters within a string repeat a given amount of times?\u003c/p\u003e\n\n\u003cp\u003eThat is, how do I turn \"XyZ\" into \"XXXyyyZZZ\"?\u003c/p\u003e","accepted_answer_id":"36672396","answer_count":"4","comment_count":"0","creation_date":"2016-04-17 03:08:08.903 UTC","last_activity_date":"2016-04-17 05:49:43.767 UTC","last_edit_date":"2016-04-17 05:49:43.767 UTC","last_editor_display_name":"","last_editor_user_id":"5812121","owner_display_name":"","owner_user_id":"6214823","post_type_id":"1","score":"1","tags":"javascript|string","view_count":"59"} +{"id":"40538721","title":"Custom Toolbar overlapping Fragment","body":"\u003cp\u003eSo basically i'm trying to set a fragment up so that it shows my badges and for some reason it just won't fit the screen and starts from the top. It seems this results in the toolbar floating over the whole fragment. Is there something i'm doing wrong that anyone can point out? I'm using three fragments with a tabbing system.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/VO7fy.jpg\" rel=\"nofollow noreferrer\"\u003eHere is the screenshot\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e1) Fragment (myFragment.java)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class myFragment extends Fragment {\n\n\npublic myFragment() {\n // Required empty public constructor\n}\nprivate RecyclerView recyclerView;\nprivate badgeAdapter adapter;\nprivate List\u0026lt;hatBadge\u0026gt; badge;\n\n@Override\npublic View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n\n final View view = inflater.inflate(R.layout.fragment_my_closet, container, false);\n final FragmentActivity c = getActivity();\n final RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.recycler_view);\n\n badge = new ArrayList\u0026lt;\u0026gt;();\n\n adapter = new badgeAdapter(getContext(), badge);\n\n RecyclerView.LayoutManager mLayoutManager = new GridLayoutManager(getContext(), 2);\n recyclerView.setLayoutManager(mLayoutManager);\n recyclerView.addItemDecoration(new myFragment.GridSpacingItemDecoration(2, dpToPx(10), true));\n recyclerView.setItemAnimator(new DefaultItemAnimator());\n new Thread(new Runnable() {\n @Override\n public void run() {\n c.runOnUiThread(new Runnable() {\n @Override\n public void run() {\n recyclerView.setAdapter(adapter);\n\n }\n });\n }\n }).start();\n\n prepareAlbums();\n\n return view;\n}\n/**\n * Adding few albums for testing\n */\nprivate void prepareAlbums() {\n int[] covers = new int[]{\n R.drawable.nike,\n R.drawable.nike,\n R.drawable.nike,\n R.drawable.nike};\n\n hatBadge a = new hatBadge(\"Hat 1\", 13, covers[0]);\n badge.add(a);\n\n a = new hatBadge(\"Hat 1\", 8, covers[1]);\n badge.add(a);\n\n a = new hatBadge(\"Hat 5\", 11, covers[2]);\n badge.add(a);\n\n a = new hatBadge(\"Hat 5\", 11, covers[2]);\n badge.add(a);\n\n\n adapter.notifyDataSetChanged();\n}\n\n/**\n * RecyclerView item decoration - give equal margin around grid item\n */\npublic class GridSpacingItemDecoration extends RecyclerView.ItemDecoration {\n\n private int spanCount;\n private int spacing;\n private boolean includeEdge;\n\n public GridSpacingItemDecoration(int spanCount, int spacing, boolean includeEdge) {\n this.spanCount = spanCount;\n this.spacing = spacing;\n this.includeEdge = includeEdge;\n }\n\n @Override\n public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {\n int position = parent.getChildAdapterPosition(view); // item position\n int column = position % spanCount; // item column\n\n if (includeEdge) {\n outRect.left = spacing - column * spacing / spanCount; // spacing - column * ((1f / spanCount) * spacing)\n outRect.right = (column + 1) * spacing / spanCount; // (column + 1) * ((1f / spanCount) * spacing)\n\n if (position \u0026lt; spanCount) { // top edge\n outRect.top = spacing;\n }\n outRect.bottom = spacing; // item bottom\n } else {\n outRect.left = column * spacing / spanCount; // column * ((1f / spanCount) * spacing)\n outRect.right = spacing - (column + 1) * spacing / spanCount; // spacing - (column + 1) * ((1f / spanCount) * spacing)\n if (position \u0026gt;= spanCount) {\n outRect.top = spacing; // item top\n }\n }\n }\n}\n\n/**\n * Converting dp to pixel\n */\nprivate int dpToPx(int dp) {\n Resources r = getResources();\n return Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, r.getDisplayMetrics()));\n}\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e2) Activity running Fragment (myActivity.java)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class myActivity extends ActionBarActivity {\n\nToolbar toolbar;\nTabLayout tabLayout;\nViewPager viewPager;\nViewPagerAdapter viewPagerAdapter;\n\n@Override\nprotected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n //Remove title bar\n this.requestWindowFeature(Window.FEATURE_NO_TITLE);\n this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);\n\n setContentView(R.layout.activity_tab);\n\n toolbar = (Toolbar)findViewById(R.id.toolBar);\n setSupportActionBar(toolbar);\n tabLayout = (TabLayout)findViewById(R.id.tabLayout);\n viewPager = (ViewPager)findViewById(R.id.viewPager);\n viewPagerAdapter = new ViewPagerAdapter(getSupportFragmentManager());\n viewPagerAdapter.addFragments(new homeFragment(), \"Info\");\n viewPagerAdapter.addFragments(new myFragment(), \"my Fragment\");\n viewPagerAdapter.addFragments(new careFragment(), \"Care\");\n viewPager.setAdapter(viewPagerAdapter);\n tabLayout.setupWithViewPager(viewPager);\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e3) fragment_my_closet.xml\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\nxmlns:app=\"http://schemas.android.com/apk/res-auto\"\nxmlns:tools=\"http://schemas.android.com/tools\"\nandroid:layout_width=\"match_parent\"\nandroid:layout_height=\"match_parent\"\nandroid:background=\"@color/viewBg\"\n\u0026gt;\n\n \u0026lt;android.support.v7.widget.RecyclerView\n android:id=\"@+id/recycler_view\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\"\n android:scrollbars=\"vertical\"\n android:clipToPadding=\"false\" /\u0026gt;\n\n\u0026lt;/RelativeLayout\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e4) Activity_tab.xml\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;?xml version=\"1.0\" encoding=\"utf-8\"?\u0026gt;\n\u0026lt;RelativeLayout\n xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:layout_width=\"match_parent\" android:layout_height=\"match_parent\"\u0026gt;\n\n \u0026lt;android.support.design.widget.AppBarLayout\n android:layout_height=\"wrap_content\"\n android:layout_width=\"match_parent\"\n app:theme=\"@style/AppTheme\"\n \u0026gt;\n \u0026lt;include\n android:layout_height=\"wrap_content\"\n android:layout_width=\"match_parent\"\n layout=\"@layout/toolbar_layout\"\n /\u0026gt;\n \u0026lt;android.support.design.widget.TabLayout\n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\"\n android:id=\"@+id/tabLayout\"\n app:tabMode=\"fixed\"\n app:tabGravity=\"fill\"\n \u0026gt;\u0026lt;/android.support.design.widget.TabLayout\u0026gt;\n\n\n \u0026lt;/android.support.design.widget.AppBarLayout\u0026gt;\n \u0026lt;android.support.v4.view.ViewPager\n android:layout_width=\"match_parent\"\n android:layout_height=\"match_parent\"\n android:id=\"@+id/viewPager\"\n \u0026gt;\u0026lt;/android.support.v4.view.ViewPager\u0026gt;\n\u0026lt;/RelativeLayout\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e5) toolbar_layout.xml\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" encoding=\"utf-8\"?\u0026gt;\n\u0026lt;android.support.v7.widget.Toolbar\nxmlns:app=\"http://schemas.android.com/apk/res-auto\"\nxmlns:android=\"http://schemas.android.com/apk/res/android\"\nandroid:layout_width=\"match_parent\" android:layout_height=\"wrap_content\"\nandroid:background=\"?attr/colorPrimaryDark\"\n\nandroid:fitsSystemWindows=\"true\"\nandroid:id=\"@+id/toolBar\"\napp:theme=\"@style/Theme.AppCompat.Light.NoActionBar\"\u0026gt;\n\n\u0026lt;/android.support.v7.widget.Toolbar\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"3","creation_date":"2016-11-10 23:20:50.26 UTC","last_activity_date":"2016-11-11 00:13:16.293 UTC","last_edit_date":"2016-11-10 23:34:03.87 UTC","last_editor_display_name":"","last_editor_user_id":"2420959","owner_display_name":"","owner_user_id":"2420959","post_type_id":"1","score":"0","tags":"java|android|xml|toolbar","view_count":"134"} +{"id":"20147788","title":"How to detect a youtube commercial skip","body":"\u003cp\u003eIs there a way to detect if a commercial was skipped or not in youtube?\u003c/p\u003e\n\n\u003cp\u003e(if a user clicks on the skip button)\u003c/p\u003e\n\n\u003cp\u003eAlso, is there a way to force a youtube video to always have an ad in it?\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2013-11-22 14:54:12.47 UTC","last_activity_date":"2013-11-22 15:05:31.057 UTC","last_edit_date":"2013-11-22 15:05:31.057 UTC","last_editor_display_name":"","last_editor_user_id":"972789","owner_display_name":"","owner_user_id":"972789","post_type_id":"1","score":"0","tags":"javascript|youtube|youtube-api","view_count":"138"} +{"id":"45991850","title":"React Router Link, onClick Action Not Firing","body":"\u003cp\u003eI'm using React Router Dom Link. I'd like to fire an action before I render a new page. The new page's componentDidMount() lifecycle method depends the action firing when a user clicks a username of a post. \u003c/p\u003e\n\n\u003cp\u003ecode example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;Link to={`/Profile/${post.uid}`}\n onClick={(e) =\u0026gt; this.handleItemClick(post.uid)}\u0026gt;{post.name}\u0026lt;/Link\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ehandItemClick\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ehandleItemClick = (uid) =\u0026gt; {changeUserUidState(uid)}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003echangeUserUidState is the action creator being dispatched. I am using in line mapStateToProp and mapDispatchToProp like below\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eexport default connect(({posts, userData}) =\u0026gt; ({posts, userData}), ({changeUserUidState}))(Feeds);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAction Creator \nconst changeUid = (uid) =\u003e {return uid}\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eexport const changeUserUidState = uid =\u0026gt; ({\n type: 'UPDATE_UID', payload: changeUid(uid),\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy payload should only return the uid, which I can simply return rather than invoking changeUid. But, I'm including this code to say that I can console.log() inside of changeUid once the user clicks on a user name, but my redux tools never fire 'UPDATE_UID' and my store never updates the uid. \u003c/p\u003e\n\n\u003cp\u003eHow can I invoke an action, but the type of action never fires?\u003c/p\u003e\n\n\u003cp\u003emy reducer \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport initialState from './initialState';\n\nexport default function (userUid = initialState.userUid, action) {\n switch (action.type) {\n case 'UPDATE_UID':\n return action.payload;\n default:\n return userUid;\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand intialState for userUid is an empty string. \u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2017-09-01 00:32:42.923 UTC","last_activity_date":"2017-09-01 01:24:22.593 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6110621","post_type_id":"1","score":"1","tags":"reactjs|redux|react-redux|action|react-router-dom","view_count":"73"} +{"id":"26128680","title":"Linear regression in R between two data frames","body":"\u003cp\u003eI have two data frames, one with predictor information and one with response data. Both matrices have row names expressing the same sample IDs in the same order (i.e. \"TCGA_5896,\" \"TCGA_5133\"...)\u003c/p\u003e\n\n\u003cp\u003eTo give you an idea of the format, the predictor matrix is of the form:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e NM_001010909_461 NM_002769_507 NM_005228_864 NM_001039703_3717 ...\nTCGA_5896 0/0 0/1 0/0 0/0\nTCGA_5133 0/0 0/0 0/0 1/0\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd the response matrix of the form:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e X1007_s_at X160020_at X179_at X200004_at X200005_at X200008_s_at ...\nTCGA_5896 12.20168 5.705052 4.945441 12.13968 9.004182 9.113377\nTCGA_5133 11.11169 4.885993 5.523197 11.64979 10.705409 8.680666\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow can I do a simple pairwise linear regression between the two matrices and ensure the regression matrix takes all pairs into account? [I want to be sure that the same information for the same sample ID are being regressed together]\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2014-09-30 19:33:58.247 UTC","last_activity_date":"2016-08-16 17:50:36.617 UTC","last_edit_date":"2016-08-16 17:50:36.617 UTC","last_editor_display_name":"","last_editor_user_id":"3885376","owner_display_name":"","owner_user_id":"3071596","post_type_id":"1","score":"-2","tags":"r|regression|linear-regression|lm","view_count":"409"} +{"id":"21397731","title":"Can't adjust column width in swing","body":"\u003cp\u003eI am testing table model and render. But I faced some problem in adjusting column width, I can't adjust column width as it's content text. I used JWindow and hide JFrame .I want to adjust column width of this table as I like........\nbut I can't though I used this code.......\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efor(int i=0;i\u0026lt;header.length;i++){\n TableColumn col=table.getColumnModel().getColumn(i);\n if(i==0)\n col.setWidth(106);\n if(i==1)\n col.setWidth(157);\n if(i==2)\n col.setWidth(103);\n if(i==3)\n col.setWidth(103);\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethis is my whole code ....check this...pls...........\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport java.awt.AWTEvent;\nimport java.awt.Color;\nimport java.awt.Component;\nimport java.awt.Dimension;\nimport java.awt.Font;\nimport java.awt.GridBagConstraints;\nimport java.awt.GridBagLayout;\nimport java.awt.MouseInfo;\nimport java.awt.Point;\nimport java.awt.Toolkit;\nimport java.awt.Window;\nimport java.awt.event.AWTEventListener;\nimport java.awt.event.ActionEvent;\nimport java.awt.event.ActionListener;\nimport java.awt.event.MouseEvent;\nimport java.awt.event.MouseListener;\nimport java.sql.SQLException;\nimport javax.swing.BorderFactory;\nimport javax.swing.JButton;\nimport javax.swing.JFrame;\nimport javax.swing.JLabel;\nimport javax.swing.JPanel;\nimport javax.swing.JScrollPane;\nimport javax.swing.JTable;\nimport javax.swing.JWindow;\nimport javax.swing.table.DefaultTableCellRenderer;\nimport javax.swing.table.DefaultTableModel;\nimport javax.swing.table.TableCellRenderer;\nimport javax.swing.table.TableColumn;\nimport com.mysql.jdbc.ResultSet;\nimport com.mysql.jdbc.Statement;\n\npublic class ReportDamage extends JPanel {\n /**\n * \n */\n private static final long serialVersionUID = 1L;\n private static JFrame f = new JFrame();\n private static JTable table = new JTable();\n private String[] header = { \"Damage_Id\", \"Supplier_Stock_Id\", \"Quantity\",\n \"Date\" };\n private String[][] data = null;\n private DefaultTableModel table_model = new TableModel();\n private static JLabel move;\n private JScrollPane scroll = new JScrollPane(table);\n private static JButton ok = new JButton(\"OK\");\n private JPanel bpanel=new JPanel();\n static Window container = f;\n static JWindow window = new JWindow(container);\n private JPanel bar=new JPanel(new GridBagLayout());\n private JLabel title=new JLabel(\"Damage Table\");\n static Point windowp, mouse, movep;\n private boolean flag=false;\n\n public ReportDamage() throws SQLException {\n super(new GridBagLayout());\n table.setModel(table_model);\n table.setRowHeight(25);\n table.getTableHeader().setFont(\n new Font(\"Times New Roman\", Font.BOLD, 16));\n table.getTableHeader().setBackground(new Color(24, 36, 233));\n table.getTableHeader().setForeground(new Color(255, 255, 255));\n //table.getTableHeader().setEnabled(false);\n table.setFont(new Font(\"Zawgyi-One\", Font.PLAIN, 14));\n table.setDefaultRenderer(Object.class,\n (TableCellRenderer) new Renderer());\n for(int i=0;i\u0026lt;header.length;i++){\n TableColumn col=table.getColumnModel().getColumn(i);\n if(i==0)\n col.setWidth(106);\n if(i==1)\n col.setWidth(157);\n if(i==2)\n col.setWidth(103);\n if(i==3)\n col.setWidth(103);\n }\n scroll.setBorder(BorderFactory.createCompoundBorder(\n BorderFactory.createLineBorder(Color.white,3),\n BorderFactory.createEmptyBorder(5, 5, 5, 5)));\n scroll.setBackground(Color.white);\n Toolkit.getDefaultToolkit().addAWTEventListener(\n new listener(),\n AWTEvent.MOUSE_MOTION_EVENT_MASK\n | AWTEvent.MOUSE_EVENT_MASK);\n move = new JLabel(\"+\");\n move.setFont(new Font(\"Times New Roman\", Font.BOLD, 19));\n move.addMouseListener(new MouseListener() {\n\n @Override\n public void mouseReleased(MouseEvent arg0) {\n // TODO Auto-generated method stub\n flag=false;\n }\n\n @Override\n public void mousePressed(MouseEvent arg0) {\n // TODO Auto-generated method stub\n flag=true;\n }\n\n @Override\n public void mouseExited(MouseEvent arg0) {\n // TODO Auto-generated method stub\n\n }\n\n @Override\n public void mouseEntered(MouseEvent arg0) {\n // TODO Auto-generated method stub\n\n }\n\n @Override\n public void mouseClicked(MouseEvent arg0) {\n // TODO Auto-generated method stub\n\n }\n });\n\n ok.setForeground(Color.black);\n ok.setFont(new Font(\"Times New Roman\", Font.BOLD, 17));\n ok.setBackground(new Color(33, 33, 250));\n ok.setBorder(BorderFactory.createCompoundBorder(\n BorderFactory.createRaisedBevelBorder(),\n BorderFactory.createEmptyBorder(5, 18, 5, 18)));\n ok.addActionListener(new ActionListener() {\n\n @Override\n public void actionPerformed(ActionEvent arg0) {\n // TODO Auto-generated method stub\n f.dispose();\n for(int i=0;i\u0026lt;header.length;i++){\n TableColumn col=table.getColumnModel().getColumn(i);\n System.out.println(col.getWidth()+ \" width of col \"+ i);\n }\n }\n });\n\n ok.addMouseListener(new MouseListener() {\n\n @Override\n public void mouseReleased(MouseEvent arg0) {\n // TODO Auto-generated method stub\n ok.setBorder(BorderFactory.createCompoundBorder(\n BorderFactory.createRaisedBevelBorder(),\n BorderFactory.createEmptyBorder(5, 18, 5, 18)));\n }\n\n @Override\n public void mousePressed(MouseEvent arg0) {\n // TODO Auto-generated method stub\n ok.setBorder(BorderFactory.createCompoundBorder(\n BorderFactory.createBevelBorder(1),\n BorderFactory.createEmptyBorder(5, 18, 5, 18)));\n }\n\n @Override\n public void mouseExited(MouseEvent arg0) {\n // TODO Auto-generated method stub\n ok.setForeground(Color.black);\n }\n\n @Override\n public void mouseEntered(MouseEvent arg0) {\n // TODO Auto-generated method stub\n\n ok.setForeground(Color.white);\n }\n\n @Override\n public void mouseClicked(MouseEvent arg0) {\n // TODO Auto-generated method stub\n\n }\n });\n\n GridBagLayout gbb = (GridBagLayout) getLayout();\n GridBagConstraints cb = new GridBagConstraints();\n\n cb.fill=0;cb.gridwidth=1;\n gbb.setConstraints(move, cb);\n add(move);\n gbb.setConstraints(title, cb);\n add(title);\n\n\n title.setFont(new Font(\"Times New Roman\",Font.BOLD,18));\n //fillTable();\n\n GridBagLayout gb = (GridBagLayout) getLayout();\n GridBagConstraints c = new GridBagConstraints();\n\n bpanel.add(ok);\n c.fill = 0;\n c.gridwidth = 0;\n gb.setConstraints(bar, c);\n add(bar);\n gb.setConstraints(scroll, c);\n add(scroll);\n gb.setConstraints(bpanel,c);\n add(bpanel);\n\n title.setForeground(Color.white);\n title.setBorder(BorderFactory.createEmptyBorder(4,9,15,0));\n move.setBorder(BorderFactory.createEmptyBorder(-5,0,35,15));\n move.setForeground(Color.white);\n bpanel.setBackground(Color.black);\n ok.setEnabled(true);\n setBorder(BorderFactory.createCompoundBorder(BorderFactory.createLineBorder(Color.gray,3),BorderFactory.createBevelBorder(1)));\n setBackground(Color.black);\n }\n\n private void fillTable() throws SQLException {\n // TODO Auto-generated method stub\n Statement st = (Statement) sqlCloseOrOpen.connect().createStatement();\n ResultSet rs = (ResultSet) st.executeQuery(\"Select * from damage\");\n\n DefaultTableModel tm = (DefaultTableModel) table.getModel();\n String[] array = new String[4];\n while (rs.next()) {\n array[0] = rs.getInt(1) + \"\";\n array[1] = rs.getInt(2) + \"\";\n array[2] = rs.getInt(3) + \"\";\n array[3] = rs.getString(4);\n tm.addRow(array);\n }\n\n }\n\n public static void showGUI() throws SQLException {\n\n window.getContentPane().removeAll();\n window.getContentPane().add(new ReportDamage());\n // f.setResizable(false);\n f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n f.pack();\n container.pack();\n // f.setContentPane(new ReportDamage());\n window.setOpacity(.8f);\n window.setVisible(true);\n window.setLocation(140, 150);\n window.pack();\n }\n\n public static void main(String args[]) throws SQLException {\n showGUI();\n }\n\n public class Renderer extends DefaultTableCellRenderer {\n\n /**\n * \n */\n private static final long serialVersionUID = 1L;\n\n Renderer() {\n super();\n setOpaque(true);\n setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));\n }\n\n public Component getTableCellRendererComponent(JTable table,\n Object value, boolean isSelected, boolean hasFocus, int row,\n int column) {\n\n super.getTableCellRendererComponent(table, value, isSelected,\n hasFocus, row, column);\n\n int r = table.getSelectedRow();\n if (row == r) {\n setBackground(new Color(110, 40, 40));\n setForeground(new Color(255, 255, 255));\n setFont(new Font(\"Times New Roman\", Font.BOLD, 16));\n } else {\n setForeground(Color.black);\n setFont(new Font(\"Zawgyi-One\", Font.PLAIN, 14));\n if (row % 2 == 0) {\n setBackground(new Color(223, 223, 223));\n } else {\n setBackground(new Color(255, 255, 255));\n }\n }\n\n setHorizontalAlignment(CENTER);\n\n return this;\n }\n }\n\n public class listener implements AWTEventListener {\n\n @Override\n public void eventDispatched(AWTEvent arg0) {\n // TODO Auto-generated method stub\n\n if (arg0.paramString().startsWith(\"MOUSE_DRAGGED\")\u0026amp;\u0026amp; flag==true) {\n windowp = window.getLocation();\n movep = move.getLocation();\n mouse = MouseInfo.getPointerInfo().getLocation();\n window.setLocation((mouse.x - movep.x) - 5,\n (mouse.y - movep.y) - 10);\n }\n\n }\n\n }\n\n public class TableModel extends DefaultTableModel{\n\n TableModel(){\n super(data, header);\n }\n\n public boolean isCellEditable(int row ,int column){\n\n return false;\n } \n\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e`\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2014-01-28 05:41:09 UTC","last_activity_date":"2014-01-28 06:31:45.517 UTC","last_edit_date":"2014-01-28 06:31:45.517 UTC","last_editor_display_name":"","last_editor_user_id":"714968","owner_display_name":"","owner_user_id":"3152790","post_type_id":"1","score":"0","tags":"java|swing|jtable|jtableheader|preferredsize","view_count":"126"} +{"id":"22439658","title":"go from one UIViewController to another without using navigation (segue) iOS 6","body":"\u003cp\u003eIn my program I have \u003ccode\u003eUIViewController\u003c/code\u003e which has two buttons, one is \"signIN\" and other is \"register\". When \"Sign IN\" button is pressed, it should go to next \u003ccode\u003eviewController\u003c/code\u003e without using segue and when \"register\" button is pressed, it should move to next \u003ccode\u003eUIViewController\u003c/code\u003e by using segue.\u003c/p\u003e","accepted_answer_id":"22483751","answer_count":"3","comment_count":"2","creation_date":"2014-03-16 16:39:27.953 UTC","last_activity_date":"2016-05-03 18:54:22.053 UTC","last_edit_date":"2014-03-16 16:46:10.21 UTC","last_editor_display_name":"","last_editor_user_id":"2115477","owner_display_name":"","owner_user_id":"3426161","post_type_id":"1","score":"0","tags":"ios|objective-c|ios6","view_count":"4268"} +{"id":"14207375","title":"jquery touchwipe how to get $(this)","body":"\u003cp\u003eI am using the jquery touchwipe plugin on my scroll list, and i can't get\u003cbr\u003e\nattribute from $(this).I want to use $(this) to get its children elment class=\"t7 edit\" and add class 'show' to it.Does anyone know how to fix it?\u003c/p\u003e\n\n\u003cp\u003ehtml:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;div id=\"main_list_wrapper\"\u0026gt;\n \u0026lt;div class=\"item\"\u0026gt;\n \u0026lt;div class=\"t7 edit\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;div class=\"t8 cancel\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"item\"\u0026gt;\n \u0026lt;div class=\"t7 edit\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;div class=\"t8 cancel\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"item\"\u0026gt;\n \u0026lt;div class=\"t7 edit\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;div class=\"t8 cancel\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"item\"\u0026gt;\n \u0026lt;div class=\"t7 edit\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;div class=\"t8 cancel\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"item\"\u0026gt;\n \u0026lt;div class=\"t7 edit\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;div class=\"t8 cancel\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003escript code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar $main_list_wrapper = $(\"#main_list_wrapper\").find('.item');\n\n$main_list_wrapper.touchwipe({\n preventDefaultEvents: false,\n wipeLeft: function() { \n $(this).find('.t8.cancel').removeClass('show');\n $(this).find('.t7.edit').removeClass('show');\n var thisclass = $(this).attr('class');\n alert(thisclass);\n return false;\n },\n wipeRight: function() { \n $sb(this).find('.t8.cancel').addClass('show');\n $sb(this).find('.t7.edit').addClass('show');\n return false;\n }\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eLike alert(thisclass). It shows \"undefine\".\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003eThank you all.my friend write this to me, and it work!\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$main_list_wrapper.each(function () {\n var $this = $sb(this);\n\n $this.touchwipe({\n preventDefaultEvents: false,\n wipeLeft: function() { \n var $pcs = $this;\n $pcs.find('.t8').removeClass('show');\n $pcs.find('.t7').removeClass('show');\n return false;\n },\n wipeRight: function() { \n var $pcs = $this;\n $pcs.find('.t8').addClass('show');\n $pcs.find('.t7').addClass('show');\n return false;\n }\n });\n});\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"4","creation_date":"2013-01-08 02:33:44.623 UTC","favorite_count":"0","last_activity_date":"2013-01-08 05:36:28.577 UTC","last_edit_date":"2013-01-08 05:36:28.577 UTC","last_editor_display_name":"","last_editor_user_id":"1956742","owner_display_name":"","owner_user_id":"1956742","post_type_id":"1","score":"1","tags":"javascript|jquery|web-applications|mobile|touch","view_count":"908"} +{"id":"6631606","title":"Why is it bad design for a UITableViewCell to send messages to the controller in MVC design?","body":"\u003cp\u003eI'm wondering what the reasoning is behind apple's decision not to have UITableViewCells know their row and section, even to the point where implementing a custom accessory button is seemingly non trivial and tricky. I thought it was correct to have the controller receive messages from both sides and mediate per se, could anyone explain this? Or is it maybe just a feature they haven't gotten to yet?\u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","accepted_answer_id":"6631646","answer_count":"1","comment_count":"0","creation_date":"2011-07-08 23:29:18.237 UTC","last_activity_date":"2011-07-08 23:38:17.057 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"240655","post_type_id":"1","score":"0","tags":"model-view-controller|uitableview","view_count":"68"} +{"id":"27497036","title":"Create NSTableView using Storyboard","body":"\u003ch3\u003eMy steps using storyboard\u003c/h3\u003e\n\n\u003col\u003e\n\u003cli\u003eCreate a Mac Cocoa app using storyboard. Drag a Table View from the right sidebar onto the storyboard.\u003c/li\u003e\n\u003cli\u003eLet the pre-existing ViewController to follow \u003ccode\u003eNSTableViewDataSource\u003c/code\u003e protocol. Implement two methods in \u003ccode\u003eViewController.m\u003c/code\u003e: \u003ccode\u003enumberOfRowsInTableView:\u003c/code\u003e returns 10 and \u003ccode\u003etableView:objectValueForTableColumn:row:\u003c/code\u003e returns @\"321\". \u003c/li\u003e\n\u003cli\u003eIn storyboard, connect the Table View's delegate and dataSource to (the only) View Controller.\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003ch3\u003eThe Problem\u003c/h3\u003e\n\n\u003cp\u003eEvery cell displays \"Table View Cell\" rather than the data I want to fill. In spite of that, \u003ccode\u003etableView:objectValueForTableColumn:row:\u003c/code\u003e was indeed called 10 times.\u003c/p\u003e\n\n\u003ch3\u003eThe alternative using .xib\u003c/h3\u003e\n\n\u003cp\u003e\u003ca href=\"https://www.youtube.com/watch?v=p5U94-uRCOo\" rel=\"nofollow\"\u003ehttps://www.youtube.com/watch?v=p5U94-uRCOo\u003c/a\u003e\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eUse .xib rather than .storyboard. Drag a Table View from the right sidebar onto the storyboard.\u003c/li\u003e\n\u003cli\u003eCreate a class MyTableViewController who follows \u003ccode\u003eNSTableViewDataSource\u003c/code\u003e protocol. Implement the same two methods.\u003c/li\u003e\n\u003cli\u003eIn xib, drag a new object to the object. Change its class to MyTableViewController and connect the object to the table view's dataSource.\u003c/li\u003e\n\u003c/ol\u003e","accepted_answer_id":"27504193","answer_count":"1","comment_count":"0","creation_date":"2014-12-16 03:26:22.48 UTC","last_activity_date":"2014-12-16 12:00:20.047 UTC","last_edit_date":"2014-12-16 03:42:26.487 UTC","last_editor_display_name":"","last_editor_user_id":"149008","owner_display_name":"","owner_user_id":"4293046","post_type_id":"1","score":"0","tags":"objective-c|cocoa|nstableview","view_count":"960"} +{"id":"44108390","title":"Register Jersey message reader for contained object jersey","body":"\u003cpre\u003e\u003ccode\u003eimport java.util.ArrayList;\nimport java.util.List;\nimport javax.annotation.Generated;\nimport com.fasterxml.jackson.annotation.JsonInclude;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport com.fasterxml.jackson.annotation.JsonPropertyOrder;\n\n@JsonInclude(JsonInclude.Include.NON_NULL)\n@Generated(\"org.jsonschema2pojo\")\n@JsonPropertyOrder({\n \"id\",\n \"version\",\n \"scope\",\n \"description\",\n \"dependencies\",\n \"schema\",\n \"thingTypes\",\n \"propertySetTypes\",\n \"annotations\"\n})\npublic class Configuration {\n\n @JsonProperty(\"id\")\n private String id;\n @JsonProperty(\"description\")\n private Description description;\n\n @JsonProperty(\"id\")\n public String getId() {\n return id;\n }\n\n @JsonProperty(\"id\")\n public void setId(String id) {\n this.id = id;\n }\n\n @JsonProperty(\"description\")\n public Description getDescription() {\n return description;\n }\n\n @JsonProperty(\"description\")\n public void setDescription(Description description) {\n this.description = description;\n }\n\n}\n\nimport java.util.HashMap;\nimport java.util.Map;\nimport javax.annotation.Generated;\nimport com.fasterxml.jackson.annotation.JsonAnyGetter;\nimport com.fasterxml.jackson.annotation.JsonAnySetter;\nimport com.fasterxml.jackson.annotation.JsonIgnore;\nimport com.fasterxml.jackson.annotation.JsonInclude;\n\n@JsonInclude(JsonInclude.Include.NON_NULL)\n@Generated(\"org.jsonschema2pojo\")\npublic class Description {\n\n @JsonIgnore\n private Map\u0026lt;String, String\u0026gt; additionalProperties = new HashMap\u0026lt;String, String\u0026gt;();\n\n @JsonAnyGetter\n public Map\u0026lt;String, String\u0026gt; getAdditionalProperties() {\n return this.additionalProperties;\n }\n\n @JsonAnySetter\n public void setAdditionalProperty(String name, String value) {\n this.additionalProperties.put(name, value);\n }\n\n public Description withAdditionalProperty(String name, String value) {\n this.additionalProperties.put(name, value);\n return this;\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eClass Description is within class Configuration.\nMy API endpoint accepts an object of Type Configuration.\nI have written a Jersey Message reader for class Configuration as:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class ConfigMsgBodyReader implements MessageBodyReader\u0026lt;Configuration\u0026gt;{\n\n private static final ObjectMapper mapper = new ObjectMapper();\n\n static{\n final SimpleModule module = new SimpleModule();\n module.addDeserializer(String.class, new JsonDeserializer\u0026lt;String\u0026gt;() {\n\n @Override\n public String deserialize(JsonParser arg0, DeserializationContext arg1)\n throws IOException, JsonProcessingException {\n String val = arg0.getValueAsString();\n\u0026lt;SomeProcessing\u0026gt;\n return val;\n }\n });\n\n mapper.registerModule(module);\n }\n\n @Override\n public boolean isReadable(Class\u0026lt;?\u0026gt; type, Type arg1, Annotation[] arg2, MediaType arg3) {\n return type == Configuration.class;\n }\n\n @Override\n public Configuration readFrom(Class\u0026lt;Configuration\u0026gt; arg0, Type arg1, Annotation[] annotation, MediaType mediaType,\n MultivaluedMap\u0026lt;String, String\u0026gt; arg4, InputStream inputStream) throws IOException, WebApplicationException {\n Configuration config = mapper.readValue(inputStream, Configuration.class);\n return config;\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have registered the ConfigMsgBodyReader and it works fine.\u003c/p\u003e\n\n\u003cp\u003eMy requirement is to do the processing on the inner object, Description [Present within Configuration].\nIs there a possibility to write a message reader for Description Class?\nIf so, can anyone share an example?\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-05-22 08:43:52.14 UTC","last_activity_date":"2017-05-22 08:43:52.14 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6779535","post_type_id":"1","score":"0","tags":"jackson|jersey-2.0|jackson-databind","view_count":"27"} +{"id":"3769171","title":"CSS Holy Grail layout","body":"\u003cp\u003eCan someone break down for me the pieces that compose the Holy Grail Layout with switched div positioning as seen here? \u003ca href=\"http://matthewjamestaylor.com/blog/perfect-3-column.htm\" rel=\"nofollow noreferrer\"\u003ehttp://matthewjamestaylor.com/blog/perfect-3-column.htm\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThe way I understand is that:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003cp\u003ecolmask is just a wrapper to position the content between header and footer\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003ecolmid is another wrapper that i guess accomodates some browsers such as IE7\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003ecolleft is the wrapper of the real thing (not sure why so many wrappers)\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003ecol1, col2 and col3 are the real thing and are all floating left and set their margins to adjust their appearance on the screen\u003c/p\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eCan someone explain better what's the Zen of that design? I'm trying to apply it to a real world scenario and it's not really working.\u003c/p\u003e","answer_count":"2","comment_count":"2","creation_date":"2010-09-22 12:26:45.513 UTC","last_activity_date":"2013-06-03 17:30:03.4 UTC","last_edit_date":"2011-10-23 21:22:56.213 UTC","last_editor_display_name":"","last_editor_user_id":"963791","owner_display_name":"","owner_user_id":"192337","post_type_id":"1","score":"1","tags":"css","view_count":"2459"} +{"id":"20803032","title":"Can not access a member of class \"com.ABC$XYZ\" with modifiers \"synchronized\"","body":"\u003cp\u003eI'm trying to retrieve synchronized method using reflection API. \u003c/p\u003e\n\n\u003cp\u003eSample code snippet given below:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass ABC {\n class XYZ {\n synchronized List methodOfXYZ() {\n System.out.println(\"Im in Method\");\n // do sum stuff\n return \u0026lt;Obj-List\u0026gt;;\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm getting the runtime exception like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ejava.lang.IllegalAccessException: Class \"com.TestReflection\" can not access a member of class \"com.ABC$XYZ\" with modifiers \"synchronized\".\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"2","creation_date":"2013-12-27 15:16:52.4 UTC","last_activity_date":"2013-12-27 15:36:33.677 UTC","last_edit_date":"2013-12-27 15:26:58.833 UTC","last_editor_display_name":"","last_editor_user_id":"1393766","owner_display_name":"","owner_user_id":"3134105","post_type_id":"1","score":"-1","tags":"java|reflection|inner-classes|synchronized|illegalaccessexception","view_count":"1862"} +{"id":"69695","title":"stringstream manipulators \u0026 vstudio 2003","body":"\u003cp\u003eI am trying to use a stringstream object in VC++ (VStudio 2003) butI am getting an error when I use the overloaded \u0026lt;\u0026lt; operator to try and set some manipulators. \u003c/p\u003e\n\n\u003cp\u003eI am trying the following: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eint SomeInt = 1; \nstringstream StrStream; \nStrStream \u0026lt;\u0026lt; std::setw(2) \u0026lt;\u0026lt; SomeInt; \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis will not compile (error C2593: 'operator \u0026lt;\u0026lt;' is ambiguous).\u003cbr\u003e\nDoes VStudio 2003 support using manipulators in this way?\u003cbr\u003e\nI know that I can just set the width directly on the stringstream object e.g. StrStream.width(2);\u003cbr\u003e\nI was wondering why the more usual method doesn't work?\u003c/p\u003e","accepted_answer_id":"69721","answer_count":"3","comment_count":"0","creation_date":"2008-09-16 05:59:39.3 UTC","last_activity_date":"2013-12-02 13:38:38.773 UTC","last_edit_date":"2013-12-02 13:38:38.773 UTC","last_editor_display_name":"","last_editor_user_id":"2432317","owner_display_name":"Anthony K","owner_user_id":"1682","post_type_id":"1","score":"0","tags":"visual-studio|stl","view_count":"480"} +{"id":"45371157","title":"gRPC in Java - Blocking/nonblocking stubs","body":"\u003cp\u003eI am attempting to create a java grpc client to communicate with a server in go. I am new to grpc so am following this tutorial \u003ca href=\"https://grpc.io/docs/tutorials/basic/java.html\" rel=\"nofollow noreferrer\"\u003egRPC Java Tutorial\u003c/a\u003e. In these examples they refer to blocking and nonblocking stubs which they appear to import from elsewhere in their \u003ca href=\"https://github.com/grpc/grpc-java/tree/master/examples/src/main/java/io/grpc/examples/routeguide\" rel=\"nofollow noreferrer\"\u003egithub\u003c/a\u003e.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport io.grpc.examples.routeguide.RouteGuideGrpc.RouteGuideBlockingStub;\nimport io.grpc.examples.routeguide.RouteGuideGrpc.RouteGuideStub;\n...\n... \nblockingStub = RouteGuideGrpc.newBlockingStub(channel);\nasyncStub = RouteGuideGrpc.newStub(channel);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever I cannot find these classes in their repo. I am still hazy on exactly what they are for, should they have been produced when compiling the .proto file? Any help/pointers would be appreciated. Thanks.\u003c/p\u003e","accepted_answer_id":"45380216","answer_count":"2","comment_count":"0","creation_date":"2017-07-28 10:30:55.91 UTC","last_activity_date":"2017-07-28 19:45:00.887 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7819897","post_type_id":"1","score":"0","tags":"java|grpc|grpc-java","view_count":"376"} +{"id":"28805823","title":"Control Timestamp precision of random timestamps","body":"\u003cp\u003eI've a code for generating random date strings. However I came to find that when I generate a random timestamp, it contains some precision decimal points to seconds field. How ever my SimpleDateFormat does not contain such precision values, does anyone know what is wrong here, and how can I remove or control the precision values ?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eCode\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elong rangeBegin = Timestamp.valueOf(\"2015-01-01 00:00:00\").getTime();\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n Date currentDate = new Date();\n String currentDateString = simpleDateFormat.format(currentDate);\n long rangeEnd = Timestamp.valueOf(currentDateString).getTime();\n long diff = rangeEnd - rangeBegin + 1;\n Timestamp randomTimestamp = new Timestamp(rangeBegin + (long)(Math.random() * diff));\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eSample output\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003erandomTimestamp = 2015-02-20 02:36:00.\u003cstrong\u003e646\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdit\u003c/strong\u003e :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eString randomTimestampString = String.valueOf(randomTimestamp).split(\"\\\\.\")[0];\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"2","creation_date":"2015-03-02 08:57:56.263 UTC","last_activity_date":"2015-12-11 14:07:29.993 UTC","last_edit_date":"2015-12-11 14:07:29.993 UTC","last_editor_display_name":"","last_editor_user_id":"2604735","owner_display_name":"","owner_user_id":"2604735","post_type_id":"1","score":"-2","tags":"java|random|timestamp|simpledateformat|precision","view_count":"107"} +{"id":"36729973","title":"When is it necessary to use the Object.assign() method to copy an instance of an object?","body":"\u003cp\u003e\u003cstrong\u003eThe following is an example scenario I made up for my own practice of this problem. If you want to skip straight to the technical details, please see 'Technical Details' below.\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI have a personal project I've been working on to learn JavaScript. Basically, the user can design a shoe by picking available options.\u003c/p\u003e\n\n\u003cp\u003eThe trick is that the left and right shoe must have the same size, among other properties, but things like color, shoe lace texture, etc. can be independent properties per shoe. (I figured this was a decent way for me to practice object manipulation and inheritance).\u003c/p\u003e\n\n\u003cp\u003eThe user starts off with designing the right shoe; when the \"swap\" button is clicked to look at the left shoe, the user currently sees a copy of the right shoe (but inverted). \u003cstrong\u003eOnly on the first swapping of shoes is the left shoe generated and made an exact copy of the right shoe. From then onwards, unique options per shoe orientation are preserved.\u003c/strong\u003e Then, if the user makes specific changes to \u003cem\u003ethat\u003c/em\u003e left-shoe model, and then switches to the right shoe, the user is supposed to see the exact same right shoe that they had originally designed before they clicked the \"swap\" button.\u003c/p\u003e\n\n\u003cp\u003eSo if their right shoe had red laces, they switch to the left shoe view and make the left shoe have a blue lace, then when switching back to the right shoe the user should see red laces!\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003e\u003cstrong\u003eTechnical Details\u003c/strong\u003e \u003c/p\u003e\n\n\u003cp\u003eWhen I was writing the code for my main project I was running into trouble with the unique options being perserved. For example, if I made the laces green for the left shoe, the right shoe would always have green laces. Troubleshooting down to the problem was easy because the only time the right shoe was losing it's unique options, such as a red lace, was when I would set the lace color for the left shoe.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003econsole.log(\"THE RIGHT LACE BEFORE: \" + rightShoe.laceId);\nleftShoe.laceId = 'green';\nconsole.log(\"THE RIGHT LACE AFTER: \" + rightShoe.laceId);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat would log to the console was:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eTHE RIGHT LACE BEFORE: red\u003c/p\u003e\n \n \u003cp\u003eTHE RIGHT LACE AFTER: green\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eEven though I wasn't changing the \u003ccode\u003erightShoe\u003c/code\u003e, it was being changed whenever I changed the \u003ccode\u003eleftShoe\u003c/code\u003e property.\u003c/p\u003e\n\n\u003cp\u003eSo I went back to where I first define the \u003ccode\u003eleftShoe\u003c/code\u003e object, which is when the user clicks \"swap\" for the first time in the life of the script (My amateur thought was \u003cem\u003ewhy propagate and fill the \u003ccode\u003eleftShoe\u003c/code\u003e object if the user possibly never customizes the left shoe?\u003c/em\u003e Maybe it's being unnecessarily stingy with data, I don't know). From then onward, \u003cem\u003eI never redefined the \u003ccode\u003eleftShoe\u003c/code\u003e to be a copy of \u003ccode\u003erightShoe\u003c/code\u003e\u003c/em\u003e or vice versa. I figured that I was getting hung up by the fact that I was probably doing object referencing and, just like with other languages, I was changing the \u003cem\u003ereference\u003c/em\u003e and not the value.\u003c/p\u003e\n\n\u003cp\u003eBefore coming to SO with my troubles, I wanted to make a JSFiddle to recreate the problem. Being that my project is lengthy (around ~1500 lines, including some \u003cstrong\u003eTHREE.js\u003c/strong\u003e for graphics), I did my best to emulate the process. And so \u003ca href=\"https://jsfiddle.net/fuayzgxn/2/\"\u003ehere it is\u003c/a\u003e.\u003c/p\u003e\n\n\u003cp\u003e\u003cem\u003eExcept the JSFiddle worked exactly as I expected it to!\u003c/em\u003e The left model preserved it's unique attribute and data set to that attribute. So, I did a little more digging and read about the \u003cstrong\u003eObject.assign()\u003c/strong\u003e method. So in my original project code (\u003cem\u003enot\u003c/em\u003e the fiddle), I changed this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eleftShoe = rightShoe;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eto this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eleftShoe = Object.assign({}, rightShoe);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAs excited as I am to have finally gotten this to work, I am equally amused and perplexed because I don't understand why my JSFiddle didn't need the \u003ccode\u003eassign()\u003c/code\u003e method but my identical project code did. Thank you.\u003c/p\u003e","accepted_answer_id":"36730060","answer_count":"1","comment_count":"14","creation_date":"2016-04-19 21:39:01.063 UTC","last_activity_date":"2016-04-19 22:02:46.1 UTC","last_edit_date":"2016-04-19 22:02:46.1 UTC","last_editor_display_name":"","last_editor_user_id":"5137782","owner_display_name":"","owner_user_id":"5137782","post_type_id":"1","score":"10","tags":"javascript|jquery|object|constructor","view_count":"257"} +{"id":"33172645","title":"Looping over an AngularJS grid","body":"\u003cp\u003eI'm trying to loop over an AngularJS grid looking for a row that has an ID I want to delete. I know I need to use the foreach statement, but am unfamiliar with it even after looking at the documentation. An example using the below criteria would be more useful.\u003c/p\u003e\n\n\u003cp\u003eHow would I accomplish this?\u003c/p\u003e\n\n\u003cp\u003eI have the following function that has the grid and row objects.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eviewModel.viewRow = function (grid, row)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm trying to compare the row within the grid that has the same ID value as the following: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003erow.entity.CheckDepositHeaderId\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAfter I find it, I simply want to remove the row from the grid collection.\u003c/p\u003e\n\n\u003cp\u003eThanks in advance...\u003c/p\u003e","accepted_answer_id":"35007361","answer_count":"1","comment_count":"0","creation_date":"2015-10-16 14:13:42.09 UTC","last_activity_date":"2016-01-26 05:07:13.873 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"856488","post_type_id":"1","score":"0","tags":"angularjs","view_count":"41"} +{"id":"29810589","title":"android AppCompat v22.1.0 button styling","body":"\u003cp\u003eProblem: cant set style to my buttons correctly\u003c/p\u003e\n\n\u003cp\u003esource is devilishly simple:\u003c/p\u003e\n\n\u003cp\u003estyles.xml:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;style name=\"AppTheme\" parent=\"Theme.AppCompat.Light.DarkActionBar\"\u0026gt;\n \u0026lt;item name=\"colorPrimary\"\u0026gt;#FF00FF\u0026lt;/item\u0026gt;\n \u0026lt;item name=\"colorSecondary\"\u0026gt;#00FFFF\u0026lt;/item\u0026gt;\n \u0026lt;item name=\"colorControlNormal\"\u0026gt;#FF0000\u0026lt;/item\u0026gt;\n \u0026lt;item name=\"android:textColor\"\u0026gt;#0030FF\u0026lt;/item\u0026gt;\n \u0026lt;item name=\"android:textColorPrimary\"\u0026gt;#00FF00\u0026lt;/item\u0026gt;\n \u0026lt;item name=\"android:textColorSecondary\"\u0026gt;#800080\u0026lt;/item\u0026gt;\n\u0026lt;/style\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003c/p\u003e\n\n\u003cp\u003elayout (applied to AppCompatActivity):\n \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;TextView\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:text=\"TEXTVIEW\"/\u0026gt;\n\n\u0026lt;Button\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:text=\"BUTTON\"\n /\u0026gt;\n\n\u0026lt;CheckBox\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003c/p\u003e\n\n\u003cp\u003emanifest:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;application\n android:theme=\"@style/AppTheme\" \u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eProblem 1 is: colorControlNormal doesn't affect Button (but affects CheckBox). How can I apply any color to all buttons?\u003c/p\u003e\n\n\u003cp\u003eProblem 2 is: android:textColorPrimary attribute sets color for Button text, but attribute android:textColor overlaps it, setting color both to TextView and Button texts. How can i set them separately? \u003c/p\u003e","accepted_answer_id":"29822016","answer_count":"1","comment_count":"2","creation_date":"2015-04-22 23:09:56.797 UTC","favorite_count":"1","last_activity_date":"2015-04-23 11:24:33.01 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4821068","post_type_id":"1","score":"1","tags":"android|button|android-support-library|android-styles","view_count":"670"} +{"id":"28969468","title":"Javascript Regular Expressions: obtain last two segments, divided by a dot","body":"\u003cp\u003eI have a variable value that can have multiple segments separated by a dot. For example: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar value = \"abc.def.hij.asd.local\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen the variable is passed in I don't know how many segments it will have. It can have 3 or more. For example: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar value1 = \"abc.cda.bds\";\nvar value2 = \"fdf.sdfsdf.dsds.sdfsdf.sdfds\";\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow do I use regular expressions in Javascript to get only the last two segments. For example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar value1 = \"asda.dfgd.ghghg.hjkhj\";\n// return \"ghghg.hjkhj\"\n\nvar value2 = \"dfgdf.fghfg.fgfh\";\n// return \"ghfg.fgfh\"\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"3","creation_date":"2015-03-10 16:48:06.97 UTC","last_activity_date":"2015-03-11 01:51:21.323 UTC","last_edit_date":"2015-03-11 01:51:21.323 UTC","last_editor_display_name":"","last_editor_user_id":"2743458","owner_display_name":"","owner_user_id":"4654903","post_type_id":"1","score":"-7","tags":"javascript|regex","view_count":"76"} +{"id":"467172","title":"Hibernate Criteria API - HAVING clause work arounds","body":"\u003cp\u003eI've written a query using Hibernate Criteria API to grab a summation of a particular value, now I need to be able to restrict the result to rows where that sum is greater or equal to a particular value.\u003c/p\u003e\n\n\u003cp\u003eNormally I would use a HAVING clause in my SQL to do this, but the Criteria API doesn't seem to support that at this moment. \u003c/p\u003e\n\n\u003cp\u003eIn raw SQL this is what I need it to do:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT user_pk, sum(amount) as amountSum\nFROM transaction\nGROUP BY user_pk\nHAVING amountSum \u0026gt;=50;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOne work-around that I thought of is to use a subquery in the FROM clause that grabs this summation value and use an outer query to restrict it using a WHERE clause. \u003c/p\u003e\n\n\u003cp\u003eSo, in raw SQL it will look something like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT user_pk, amountSum\nFROM (SELECT user_pk, sum(amount) as amountSum\n FROM transaction\n GROUP BY user_pk)\nWHERE amountSum \u0026gt; 50;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCan anyone point me in the right direction as to how I could write this using Criteria API, or any other suggestions/work-arounds I can use to solve the HAVING issue?\u003c/p\u003e\n\n\u003cp\u003eThis is the Criteria API code I have for the above example\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eDetachedCriteria criteria = DetachedCriteria.forClass(Transaction.class,\"transaction\");\ncriteria.setProjection(criteria.setProjection(Projections.projectionList().add(\n Projections.groupProperty(\"user.userPK\").as(\"user_pk\")).add(\n Projections.sum(\"transaction.amount\").as(\"amountSum\")));\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","answer_count":"3","comment_count":"0","creation_date":"2009-01-21 21:50:43.887 UTC","favorite_count":"2","last_activity_date":"2017-02-10 15:33:50.71 UTC","last_edit_date":"2009-01-22 15:00:06.51 UTC","last_editor_display_name":"","last_editor_user_id":"57701","owner_display_name":"","owner_user_id":"57701","post_type_id":"1","score":"10","tags":"hibernate|criteria|having","view_count":"22076"} +{"id":"3645008","title":"Is my Windows Phone 7 app restricted to SMSComposeTask?","body":"\u003cp\u003eThe documentation is somewhat scarce, but my search has not turned up anything but \u003ccode\u003eSMSComposeTask\u003c/code\u003e for sending text messages from an app.\u003c/p\u003e\n\n\u003cp\u003eWill this be the only way to send SMS messages in Windows Phone 7 from an app? Does Android and iOS (4 or previous) place similar restrictions on sending SMS messages from an app?\u003c/p\u003e","accepted_answer_id":"3645088","answer_count":"2","comment_count":"0","creation_date":"2010-09-05 04:24:38.487 UTC","last_activity_date":"2010-09-05 05:12:28.66 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"160823","post_type_id":"1","score":"1","tags":"sms|windows-phone-7|mobile-application","view_count":"783"} +{"id":"41744461","title":"Invalidate all shared ptrs toward a specific managed object","body":"\u003cp\u003eIs it possible, in C++11, to have an object managed by several \u003ccode\u003estd::shared_ptr\u003c/code\u003es. I want to delete the object via one \u003ccode\u003estd::shared_ptr\u003c/code\u003e and have the other \u003ccode\u003eshared_ptr\u003c/code\u003es invalidated (set empty or null), is this possible? If not, what is the best method to inform all other \"references\" (in a liberal use of the word) that the object is no longer valid? \u003c/p\u003e","accepted_answer_id":"41744787","answer_count":"2","comment_count":"4","creation_date":"2017-01-19 14:37:46.96 UTC","last_activity_date":"2017-01-19 15:11:57.267 UTC","last_edit_date":"2017-01-19 14:59:53.01 UTC","last_editor_display_name":"","last_editor_user_id":"636019","owner_display_name":"","owner_user_id":"3667450","post_type_id":"1","score":"4","tags":"c++|c++11|shared-ptr","view_count":"215"} +{"id":"40389384","title":"Bootstrap how to style nav lists","body":"\u003cp\u003eI'm using a bootstram menu as with two level list with drop down. Exemple of code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;ul class=\"nav navbar-nav\"\u0026gt; \n\n\u0026lt;li class=\"dropdown\"\u0026gt;\u0026lt;a class=\"dropdown-toggle\" data-toggle=\"dropdown\" href=\"#\"\u0026gt;Item0\u0026lt;span\u0026gt; class=\"caret\"\u0026gt;\u0026lt;/span\u0026gt;\u0026lt;/a\u0026gt;\n \u0026lt;ul class=\"dropdown-menu\"\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#Item1\"\u0026gt;Item1\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#Item2\"\u0026gt;Item2\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#Item3\"\u0026gt;Item3\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#Item4\"\u0026gt;Item4\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#Item5\"\u0026gt;Item5\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n\n \u0026lt;/ul\u0026gt;\n\u0026lt;/li\u0026gt;\n\u0026lt;li\u0026gt;\n \u0026lt;ul class=\"nav navbar-nav\"\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#Item1\"\u0026gt;Item13\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;ul class=\"dropdown-menu\"\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#Item1\"\u0026gt;Item131\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#Item2\"\u0026gt;Item132\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#Item3\"\u0026gt;Item133\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#Item4\"\u0026gt;Item134\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#Item5\"\u0026gt;Item135\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n\n \u0026lt;/ul\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#Item2\"\u0026gt;Item23\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#Item3\"\u0026gt;Item33\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n\u0026lt;/li\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003c/p\u003e\n\n\u003cp\u003eCss is bootstrap where i would like to make some modyfications of colours. However, when I make a change in:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e.navbar-default .nav li a{\n ...\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eit changes all list elements colours. Is it possible to style nested lists in in different colour while level up list has a different one?\u003c/p\u003e\n\n\u003cp\u003ee.g. \"Item0, Item13 Item23 Item33\" in red, \"Item1 .. Item5\" in blue and so on... \u003c/p\u003e","answer_count":"4","comment_count":"0","creation_date":"2016-11-02 20:38:42.56 UTC","last_activity_date":"2016-11-03 19:02:01.167 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7055177","post_type_id":"1","score":"0","tags":"list|menu|styles","view_count":"28"} +{"id":"28638868","title":"Assign event handler to each button in a for loop","body":"\u003cp\u003eI am attempting to assign an onclick attribute to each button generated through a for loop, without success. The loop generates a table that is populated with search results and the button has to pass a value to JPlayer. The following code, using the class of the button + i plain doesn't work, although I'm not sure why. Removing the i variable will obviously just assign the event handler to the last element in the array, which indeed it does. I've looked through a few similar questions here, as I gather this is a common pitfall with JS loops, but I can't make any of the answers work for this situation. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction displayResults(searchData){\n\n var numResults = searchData.results.length;\n\n $(\"#searchResults\").html(\"\");\n\n var table = document.createElement(\"table\");\n table.setAttribute(\"class\", \"table\");\n\n\n for(var i = 0;i \u0026lt; numResults; i++) {\n var resultTr = document.createElement(\"tr\");\n var results = searchData.results[i];\n\n var resultArtist = document.createElement(\"td\");\n resultArtist.appendChild(document.createTextNode(results.artist));\n var resultSong = document.createElement(\"td\");\n resultSong.appendChild(document.createTextNode(results.songTitle));\n var resultAlbum = document.createElement(\"td\");\n resultAlbum.appendChild(document.createTextNode(results.album));\n var resultDisk = document.createElement(\"button\"); \n resultDisk.setAttribute(\"class\", \"playButton\" +i); \n\n $( \".playButton\" +i).on( \"click\", { value: results.diskLocation }, function( event ) {\n\n player(event.data.value);\n });\n\n resultDisk.appendChild(document.createTextNode(\"play\"));\n\n resultTr.appendChild(resultArtist);\n resultTr.appendChild(resultSong);\n resultTr.appendChild(resultAlbum);\n resultTr.appendChild(resultDisk);\n table.appendChild(resultTr);\n $(\"#searchResults\").append(table);\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI've tried using \u003ccode\u003ethis\u003c/code\u003e, but I cannot seem to make that work either. So, how does one correctly assign event handlers to dynamically-produced elements in a loop? \u003c/p\u003e","accepted_answer_id":"28638985","answer_count":"1","comment_count":"3","creation_date":"2015-02-20 21:52:44.42 UTC","last_activity_date":"2015-02-20 22:01:36.7 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4479055","post_type_id":"1","score":"0","tags":"javascript|jquery","view_count":"55"} +{"id":"5917249","title":"Git Symlinks in Windows","body":"\u003cp\u003eThe problem:\nOur developers use a mix of Windows and Unix based OS's. Therefore, symlinks created on Unix machines become a problem for Windows developers. In windows (msysgit), the symlink is converted to a text file with a path to the file it points to. Instead, I'd like to convert the symlink into an actual Windows symlink.\u003c/p\u003e\n\n\u003cp\u003eThe (\u003cstrong\u003eupdated\u003c/strong\u003e) solution I have to this is:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eWrite a post-checkout script that will recursively look for \"symlink\" text files.\u003c/li\u003e\n\u003cli\u003eReplace them with windows symlink (using mklink) with same name and extension as dummy \"symlink\"\u003c/li\u003e\n\u003cli\u003eIgnore these windows symlink by adding entry into .git/info/exclude \u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eI have not implemented this, but I believe this is a solid approach to this problem. \u003c/p\u003e\n\n\u003cp\u003eThe question I have for you is:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eWhat, if any, downsides do you see to this approach?\u003c/li\u003e\n\u003cli\u003eIs this post-checkout script even implementable? i.e. can I recursively find out the dummy \"symlink\" files git creates?\u003c/li\u003e\n\u003cli\u003eHas anybody already worked on such script? =)\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eThanks a bunch!\u003c/p\u003e","accepted_answer_id":"5930443","answer_count":"10","comment_count":"8","creation_date":"2011-05-06 21:33:50.39 UTC","favorite_count":"92","last_activity_date":"2017-09-29 17:32:36.557 UTC","last_edit_date":"2011-05-07 16:09:52.723 UTC","last_editor_display_name":"","last_editor_user_id":"615315","owner_display_name":"","owner_user_id":"615315","post_type_id":"1","score":"159","tags":"windows|git|symlink","view_count":"59367"} +{"id":"37007539","title":"Probability of finding a prime (using miller-rabin test)","body":"\u003cp\u003eI've implemented Miller-Rabin primality test and every function seems to be working properly in isolation. However, when I try to find a prime by generating random numbers of 70 bits my program generates in average more than 100000 numbers before finding a number that passes the Miller-Rabin test (10 steps). This is very strange, the probability of being prime for a random odd number of less than 70 bits should be very high (more than 1/50 according to Hadamard-de la Vallée Poussin Theorem). What could be wrong with my code? Would it be possible that the random number generator throws prime numbers with very low probability? I guess not... Any help is very welcome.\u003c/p\u003e\n\n\u003cpre class=\"lang-python prettyprint-override\"\u003e\u003ccode\u003eimport random\n\n\ndef miller_rabin_rounds(n, t):\n '''Runs miller-rabin primallity test t times for n'''\n\n # First find the values r and s such that 2^s * r = n - 1\n r = (n - 1) / 2\n s = 1\n while r % 2 == 0:\n s += 1\n r /= 2\n\n # Run the test t times\n for i in range(t):\n a = random.randint(2, n - 1)\n y = power_remainder(a, r, n)\n\n if y != 1 and y != n - 1:\n # check there is no j for which (a^r)^(2^j) = -1 (mod n)\n j = 0\n while j \u0026lt; s - 1 and y != n - 1:\n y = (y * y) % n\n if y == 1:\n return False\n j += 1\n if y != n - 1:\n return False\n\n return True\n\n\ndef power_remainder(a, k, n):\n '''Computes (a^k) mod n efficiently by decomposing k into binary'''\n r = 1\n while k \u0026gt; 0:\n if k % 2 != 0:\n r = (r * a) % n\n a = (a * a) % n\n k //= 2\n return r\n\n\ndef random_odd(n):\n '''Generates a random odd number of max n bits'''\n a = random.getrandbits(n)\n if a % 2 == 0:\n a -= 1\n return a\n\nif __name__ == '__main__':\n t = 10 # Number of Miller-Rabin tests per number\n bits = 70 # Number of bits of the random number\n a = random_odd(bits)\n count = 0\n while not miller_rabin_rounds(a, t):\n count += 1\n if count % 10000 == 0:\n print(count)\n a = random_odd(bits)\n print(a)\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"37288185","answer_count":"1","comment_count":"3","creation_date":"2016-05-03 14:55:39.93 UTC","last_activity_date":"2016-06-14 22:34:38.09 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6286345","post_type_id":"1","score":"2","tags":"python|cryptography|primes","view_count":"267"} +{"id":"39361601","title":"Ruby Checking one array string against another array string for similarities","body":"\u003cp\u003eThe goal is to check if it is one off. If, for instance, the \u003cstrong\u003ewinning ticket is 1234\u003c/strong\u003e, and \u003cstrong\u003emy ticket is 1233\u003c/strong\u003e, or \u003cb\u003e2234\u003c/b\u003e, or \u003cb\u003e1334\u003c/b\u003e that should pass as true, as the ticket is one off. Non regex involved please as this was for beginners.\u003c/p\u003e\n\n\u003cp\u003eIf it is exact, then it fails. If it is more than one number off, it fails. This is what I have so far.\u003c/p\u003e\n\n\u003cp\u003eHere is my function:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003erequire \"minitest/autorun\"\nrequire_relative \"offbyone.rb\"\n\nclass TestLottoFunction \u0026lt; Minitest::Test\n\ndef test_a_matching_ticket_returns_false\n my_ticket = \"1234\"\n winning_tickets = \"1234\"\n assert_equal(false, off(my_ticket, winning_tickets))\n end\n\ndef test_a_one_off_ticket\n my_ticket = \"1234\"\n winning_tickets = \"1235\"\n assert_equal(true, off(my_ticket, winning_tickets)) \nend\n\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI tried to spell it out in a more complicated way of what my goal was exactly, seeing if that would work, and it didn't. I got the same error message, telling me it is line 9 and 15, telling me that the function is expecting either true or false, and it is receiving nil. This is the code that I have.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef off(my_ticket, winning_tickets)\n i = 0\n c = 0\n\n4.times do\n\n if winning_tickets[0][i] == my_ticket[0][i]\n c+=1\n end\n\n i+=1\n\n end\nif c==3\n true\nend\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI just changed \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e if winning_tickets[i] == my_tickets [i]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eto include \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ewinning_tickets[0][i] == my_tickets [0][i] \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand it got rid of one error, but created a new one. \u003c/p\u003e\n\n\u003cp\u003eIf I don't include the [0][i], I get an error message saying that I have 2 errors, both on the assert_equal lines, both saying they are receiving \u003cstrong\u003enil\u003c/strong\u003e instead of true or false. \u003c/p\u003e\n\n\u003cp\u003eIf I add the [0][i] to both lines, I get 1 error, saying my error was in the matching ticket, saying it was expecting true and received false. \u003c/p\u003e\n\n\u003cp\u003eAny help with this? \u003c/p\u003e\n\n\u003cp\u003eI am actually curious as to why I am receiving nil. Where in the array am I going wrong to get nil. Please point out my mistakes.\u003c/p\u003e","answer_count":"2","comment_count":"1","creation_date":"2016-09-07 05:08:33.667 UTC","favorite_count":"1","last_activity_date":"2017-06-29 21:13:31.14 UTC","last_edit_date":"2017-06-29 21:13:31.14 UTC","last_editor_display_name":"","last_editor_user_id":"6196389","owner_display_name":"","owner_user_id":"6196389","post_type_id":"1","score":"0","tags":"arrays|ruby|string|numbers|comparison","view_count":"45"} +{"id":"31221746","title":"Do you have better solutions for Sprite spawning like jetpack joyride cocos2d-x?","body":"\u003cp\u003eFirst of all I'm using cocos2d-x on android with c++ language.\nI'm trying to make a game similar to jetpack joyride.The problem is that I didn't find an efficient way to spawn my obstacles. Here is the way I'm using :\u003c/p\u003e\n\n\u003cp\u003eI'm repeating endlessly this method but the game is really slow and sometimes it doesn't even start and my application crashes\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evoid myClass::SpawnSprite(float dt){\n\n// The sprites are moving with moveBy...\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eDo you have a better solution ?\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2015-07-04 14:29:15.177 UTC","last_activity_date":"2015-07-04 17:38:01.993 UTC","last_edit_date":"2015-07-04 14:30:18.163 UTC","last_editor_display_name":"","last_editor_user_id":"1413395","owner_display_name":"","owner_user_id":"4871184","post_type_id":"1","score":"-1","tags":"c++|cocos2d-x-3.0","view_count":"99"} +{"id":"2190577","title":"MSBuild and TeamBuild - how to get post build files into BinariesRoot?","body":"\u003cp\u003eI wonder how to solve the following task:\u003c/p\u003e\n\n\u003cp\u003eI build additional files in the AfterCompile Target in an MSBuild File. The Post Build Files should be copied somewhere, so that they are put to BinariesRoot automatically on TFS later on.\u003c/p\u003e\n\n\u003cp\u003eThe Post Build files references obj/Release/some.dll, so it must happen after some.dll was compiled, but before the files get copied to the output directory BinariesRoot.\u003c/p\u003e\n\n\u003cp\u003eCan I add them to the Target \"CopyFilesToOutputDirectory\" somehow? \u003c/p\u003e\n\n\u003cp\u003eAny idea?\u003c/p\u003e\n\n\u003cp\u003eThanks, Marco\u003c/p\u003e","accepted_answer_id":"2198399","answer_count":"1","comment_count":"0","creation_date":"2010-02-03 08:26:55.727 UTC","last_activity_date":"2010-02-04 09:04:13.21 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"260865","post_type_id":"1","score":"2","tags":"msbuild","view_count":"2398"} +{"id":"46415852","title":"Why can't Acumatica find a view?","body":"\u003cp\u003eI created a DAC extension mapped to an extension table off of SOShipment. I have two custom fields in the extension table that I'd like to add to the Sales Orders entry form, specifically the grid in the Shipments tab. When I go to the layout editor for this form and select the Grid: ShipmentList under the Shipments tab, there are no fields in the Add Data Fields tab on the right. Also, I see a yellow circle with this error in several places:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eThe \"ShipmentList\" view is not found. Try to publish the customization project.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI published the customization project, but the error persists. To my knowledge, we haven't done any customization that would've touched the ShipmentList view. What is the issue here and how do I resolve it?\u003c/p\u003e","accepted_answer_id":"46433472","answer_count":"1","comment_count":"2","creation_date":"2017-09-25 23:58:16.093 UTC","last_activity_date":"2017-09-26 19:19:28.01 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4130587","post_type_id":"1","score":"0","tags":"acumatica","view_count":"46"} +{"id":"14362039","title":"arm-eabi-gcc :command not found when trying to set up LiME","body":"\u003cp\u003eI am out of idea's. I feel like I've done everything correctly. I'm trying to capture a memory image from android using LiME. If I do the following...\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e $ cd $my_android_ndk_path/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/\n $ make ARCH=arm CROSS_COMPILE=arm-eabi- modules_prepare\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eit returns\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e make: *** No rule to make target `modules_prepare'. Stop.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf i type the same command from my Kernel Source (where my .config is located)\n $ make ARCH=arm CROSS_COMPILE=path/to/android_ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-eabi- modules_prepare\u003c/p\u003e\n\n\u003cp\u003eit returns\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e make: /path/to/android_ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-eabi-gcc: Command not found\n CHK include/linux/version.h\n make[1]: `include/asm-arm/mach-types.h' is up to date.\n CHK include/linux/utsrelease.h\n SYMLINK include/asm -\u0026gt; include/asm-arm\n CC kernel/bounds.s\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am sure my directories are right. Does anyone have any idea what i could be doing wrong. I'm not using any particular tool for the ndk. I just unzipped the ndk and sdk seperatly and installaled JDK. Everything should work but it doesn't.\u003c/p\u003e","answer_count":"2","comment_count":"4","creation_date":"2013-01-16 15:35:08.07 UTC","last_activity_date":"2013-03-19 10:54:27.953 UTC","last_edit_date":"2013-01-16 20:33:50.167 UTC","last_editor_display_name":"","last_editor_user_id":"1461212","owner_display_name":"","owner_user_id":"1461212","post_type_id":"1","score":"0","tags":"android|compilation","view_count":"5859"} +{"id":"41191058","title":"how to add more prototype cells in a tableview?","body":"\u003cp\u003eUnable to add more prototype cells after the view's height is reached.\nHow to add more prototype cells on the view. Please find the image below to see my problem\u003ca href=\"https://i.stack.imgur.com/gJ3Ci.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/gJ3Ci.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eHow to add more prototype cells after that . I am not able to scroll.\nPlease suggest.\u003c/p\u003e","accepted_answer_id":"41191527","answer_count":"2","comment_count":"1","creation_date":"2016-12-16 19:15:47.273 UTC","last_activity_date":"2016-12-16 21:32:03.78 UTC","last_edit_date":"2016-12-16 19:46:34.323 UTC","last_editor_display_name":"","last_editor_user_id":"1226963","owner_display_name":"","owner_user_id":"6707243","post_type_id":"1","score":"1","tags":"ios|uitableview|tableview","view_count":"253"} +{"id":"3638522","title":"How do I express “not in” using lambdas?","body":"\u003cp\u003eI'm trying to create a \u003ccode\u003enot in\u003c/code\u003e clause with the NHibernate Criteria API using NHLambdaExtensions. Reading the documentation I was able to implement the \u003ccode\u003ein\u003c/code\u003e clause by doing\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e.Add(SqlExpression.In\u0026lt;Zone\u0026gt;(z =\u0026gt; zoneAlias.ZoneId, new int[] { 1008, 1010 }))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, when I wrap it around \u003ccode\u003eSqlExpression.Not\u003c/code\u003e I get the error\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eError 5 The best overloaded method match for 'NHibernate.LambdaExtensions.SqlExpression.Not\u0026lt;oms_dal.Models.Zone\u0026gt;(System.Linq.Expressions.Expression\u0026lt;System.Func\u0026lt;oms_dal.Models.Zone,bool\u0026gt;\u0026gt;)' has some invalid arguments\nError 6 Argument '1': cannot convert from 'NHibernate.Criterion.ICriterion' to 'System.Linq.Expressions.Expression\u0026lt;System.Func\u0026lt;oms_dal.Models.Zone,bool\u0026gt;\u0026gt;'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm using this piece of code\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e.Add(SqlExpression.Not\u0026lt;Zone\u0026gt;(SqlExpression.In\u0026lt;Zone\u0026gt;(x =\u0026gt; zoneAlias.ZoneId, new int[] { 1008, 1010 })))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow can I accomplish this? Using the regular Criteria API I was able to do this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e.Add(Restrictions.Not(Restrictions.In(\"z.ZoneId\", new[] { 1008, 1010 })))\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"3638876","answer_count":"2","comment_count":"0","creation_date":"2010-09-03 18:24:46.863 UTC","favorite_count":"0","last_activity_date":"2010-12-23 11:48:37.597 UTC","last_edit_date":"2010-09-03 18:36:29.067 UTC","last_editor_display_name":"","last_editor_user_id":"25371","owner_display_name":"","owner_user_id":"25371","post_type_id":"1","score":"7","tags":"c#|nhibernate|nhlambdaextensions","view_count":"569"} +{"id":"15075605","title":"Check GCC_PREPROCESSOR_DEFINITIONS parameters in a script","body":"\u003cp\u003eIn the Build Settings of my project's target, I have preprocessor Macros configured as following:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eDebug FILE_SHARE = 1\nAdhoc FILE_SHARE = 1\nRelease FILE_SHARE = 2\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to change the \u003ccode\u003eUIFileSharingEnabled\u003c/code\u003e flag based on those settings values in a script, something like the following:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#!/bin/bash\nif [${buildSettings}/${GCC_PREPROCESSOR_DEFINITIONS}/${FILE_SHARE} = 1 ]; then\n /usr/libexec/PlistBuddy -c \"Set :UIFileSharingEnabled YES\" \"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}\"\nelse\n usr/libexec/PlistBuddy -c \"Set :UIFileSharingEnabled NO\" \"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}\"\nfi\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI know \u003ccode\u003e${buildSettings}/${GCC_PREPROCESSOR_DEFINITIONS}/${FILE_SHARE} = 1\u003c/code\u003e is the wrong syntax, but I cannot figure out what should be right syntax.\u003c/p\u003e","accepted_answer_id":"15077136","answer_count":"1","comment_count":"2","creation_date":"2013-02-25 20:12:33.88 UTC","favorite_count":"3","last_activity_date":"2015-03-25 20:03:50.9 UTC","last_edit_date":"2013-02-25 20:14:14.913 UTC","last_editor_display_name":"","last_editor_user_id":"603977","owner_display_name":"","owner_user_id":"2044290","post_type_id":"1","score":"3","tags":"xcode|bash","view_count":"1362"} +{"id":"5921781","title":"Java Date.parse or new Date(String) replacement?","body":"\u003cp\u003eSo I am coming back to Java after a few years of .NET programming and I am trying to update my Java knowledge but am having some problems with the now deprecated Date.parse() function that I once knew. I am trying to indiscriminately parse a string to a date. I do NOT want to have to use the SimpleDateFormtter where I need to specify every acceptable format. I just want to do what Date.parse(String anyStringFormat) to get epoch or new Date(String anyStringFormat) to get new date - what these guys used to do. Every document I keep getting directed to says I have to use the SimpleDateFormat with a specified date format. I do not wish to use a specific date format - what is the new way to do this without a specific date format? I must be missing something, as I can't imagine they would remove such a feature.\u003c/p\u003e","accepted_answer_id":"5921847","answer_count":"3","comment_count":"11","creation_date":"2011-05-07 14:47:11.697 UTC","last_activity_date":"2016-02-23 23:13:11.633 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"743115","post_type_id":"1","score":"1","tags":"java|parsing|date","view_count":"5149"} +{"id":"23211436","title":"Why does excel file has been created with php, is not the same with tabel in browser?","body":"\u003cp\u003ePlease help, I am trying to sort out the data from mysql table into an excel file by city (kol_17). And the code as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$rslt = mysql_query(\"SELECT DISTINCT kol_17 AS bmcity FROM temp_table ORDER BY kol_17 ASC\");\nwhile ($rowgroup = mysql_fetch_array($rslt)) {\n $bm_city = $rowgroup['bmcity'];\n echo \"\u0026lt;br\u0026gt;Event City: \u0026lt;b\u0026gt;$bm_city\u0026lt;/b\u0026gt;\";\n echo \"\u0026lt;table border='1'\u0026gt;\";\n echo \"\u0026lt;tr\u0026gt;\";\n echo \"\u0026lt;td bgcolor='#C0C0C0'\u0026gt;Order Number\u0026lt;/td\u0026gt;\";\n echo \"\u0026lt;td bgcolor='#C0C0C0'\u0026gt;Item Code\u0026lt;/td\u0026gt;\";\n echo \"\u0026lt;td bgcolor='#C0C0C0'\u0026gt;Deposit\u0026lt;/td\u0026gt;\";\n echo \"\u0026lt;td bgcolor='#C0C0C0'\u0026gt;Total\u0026lt;/td\u0026gt;\";\n echo \"\u0026lt;td bgcolor='#C0C0C0'\u0026gt;Price\u0026lt;/td\u0026gt;\";\n echo \"\u0026lt;td bgcolor='#C0C0C0'\u0026gt;Trx MSISDN\u0026lt;/td\u0026gt;\";\n echo \"\u0026lt;td bgcolor='#C0C0C0'\u0026gt;Communication MSISDN\u0026lt;/td\u0026gt;\";\n echo \"\u0026lt;td bgcolor='#C0C0C0'\u0026gt;BM City\u0026lt;/td\u0026gt;\";\n echo \"\u0026lt;td bgcolor='#C0C0C0'\u0026gt;Se Area\u0026lt;/td\u0026gt;\";\n echo \"\u0026lt;td bgcolor='#C0C0C0'\u0026gt;Type of Sale\u0026lt;/td\u0026gt;\";\n echo \"\u0026lt;/tr\u0026gt;\";\n\n $objPHPExcel-\u0026gt;setActiveSheetIndex(0);\n\n $objPHPExcel-\u0026gt;getActiveSheet()-\u0026gt;SetCellValue('A1', 'Order Number');\n $objPHPExcel-\u0026gt;getActiveSheet()-\u0026gt;SetCellValue('B1', 'Item Code');\n $objPHPExcel-\u0026gt;getActiveSheet()-\u0026gt;SetCellValue('C1', 'DuiTRI');\n $objPHPExcel-\u0026gt;getActiveSheet()-\u0026gt;SetCellValue('D1', 'Total');\n $objPHPExcel-\u0026gt;getActiveSheet()-\u0026gt;SetCellValue('E1', 'Price');\n $objPHPExcel-\u0026gt;getActiveSheet()-\u0026gt;SetCellValue('F1', 'Trx MSISDN');\n $objPHPExcel-\u0026gt;getActiveSheet()-\u0026gt;SetCellValue('G1', 'Communication MSISDN');\n $objPHPExcel-\u0026gt;getActiveSheet()-\u0026gt;SetCellValue('H1', 'BM City');\n $objPHPExcel-\u0026gt;getActiveSheet()-\u0026gt;SetCellValue('I1', 'Se Area');\n $objPHPExcel-\u0026gt;getActiveSheet()-\u0026gt;SetCellValue('J1', 'Type of Sale');\n $result = mysql_query(\"SELECT kol_0, kol_5, kol_8, kol_9, kol_10, kol_14, kol_15, kol_17, kol_18, kol_20 from temp_table WHERE kol_17 = '$bm_city' AND kol_5 like '70%'\");\n\n $colnum=1; \n while ($row = mysql_fetch_array($result)){\n echo \"\u0026lt;tr\u0026gt;\";\n echo \"\u0026lt;td\u0026gt;\" . $row['kol_0'] . \"\u0026lt;/td\u0026gt;\";\n echo \"\u0026lt;td\u0026gt;\" . $row['kol_5'] . \"\u0026lt;/td\u0026gt;\";\n echo \"\u0026lt;td\u0026gt;\" . $row['kol_8'] . \"\u0026lt;/td\u0026gt;\";\n echo \"\u0026lt;td\u0026gt;\" . $row['kol_9'] . \"\u0026lt;/td\u0026gt;\";\n echo \"\u0026lt;td\u0026gt;\" . $row['kol_10'] . \"\u0026lt;/td\u0026gt;\";\n echo \"\u0026lt;td\u0026gt;\" . $row['kol_14'] . \"\u0026lt;/td\u0026gt;\";\n echo \"\u0026lt;td\u0026gt;\" . $row['kol_15'] . \"\u0026lt;/td\u0026gt;\";\n echo \"\u0026lt;td\u0026gt;\" . $row['kol_17'] . \"\u0026lt;/td\u0026gt;\";\n echo \"\u0026lt;td\u0026gt;\" . $row['kol_18'] . \"\u0026lt;/td\u0026gt;\";\n echo \"\u0026lt;td\u0026gt;\" . $row['kol_20'] . \"\u0026lt;/td\u0026gt;\";\n echo \"\u0026lt;/tr\u0026gt;\";\n $colnum++;\n $objPHPExcel-\u0026gt;getActiveSheet()-\u0026gt;SetCellValue('A'.\"$colnum\", $row[\"kol_0\"]);\n $objPHPExcel-\u0026gt;getActiveSheet()-\u0026gt;SetCellValue('B'.\"$colnum\", $row[\"kol_5\"]);\n $objPHPExcel-\u0026gt;getActiveSheet()-\u0026gt;SetCellValue('C'.\"$colnum\", $row[\"kol_8\"]);\n $objPHPExcel-\u0026gt;getActiveSheet()-\u0026gt;SetCellValue('D'.\"$colnum\", $row[\"kol_9\"]);\n $objPHPExcel-\u0026gt;getActiveSheet()-\u0026gt;SetCellValue('E'.\"$colnum\", $row[\"kol_10\"]);\n $objPHPExcel-\u0026gt;getActiveSheet()-\u0026gt;SetCellValue('F'.\"$colnum\", $row[\"kol_14\"]);\n $objPHPExcel-\u0026gt;getActiveSheet()-\u0026gt;SetCellValue('G'.\"$colnum\", $row[\"kol_15\"]);\n $objPHPExcel-\u0026gt;getActiveSheet()-\u0026gt;SetCellValue('H'.\"$colnum\", $row[\"kol_17\"]);\n $objPHPExcel-\u0026gt;getActiveSheet()-\u0026gt;SetCellValue('I'.\"$colnum\", $row[\"kol_18\"]);\n $objPHPExcel-\u0026gt;getActiveSheet()-\u0026gt;SetCellValue('J'.\"$colnum\", $row[\"kol_20\"]);\n }\n echo \"\u0026lt;/table\u0026gt;\";\n\n $objPHPExcel-\u0026gt;getActiveSheet()-\u0026gt;setTitle('Upload');\n $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');\n $sFileName = \"preorder_\".$rowgroup[0].\".xlsx\";\n $objWriter-\u0026gt;save('upload/'.$sFileName);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe result, in the excel file still contained the same city that should not be, but in the browser is correct.\u003c/p\u003e\n\n\u003cp\u003eThank You.\u003c/p\u003e","accepted_answer_id":"23214153","answer_count":"1","comment_count":"9","creation_date":"2014-04-22 05:52:54.59 UTC","last_activity_date":"2014-04-22 08:18:27.093 UTC","last_edit_date":"2014-04-22 06:56:19.34 UTC","last_editor_display_name":"","last_editor_user_id":"3373432","owner_display_name":"","owner_user_id":"3373432","post_type_id":"1","score":"0","tags":"php|mysql|phpexcel","view_count":"43"} +{"id":"12893882","title":"Encryption - different results in Ruby and ColdFusion","body":"\u003cp\u003eI have data encrypted in ColdFusion which I am trying to decrypt in Ruby. I can't get the output to match though.\u003c/p\u003e\n\n\u003cp\u003eOn the ColdFusion side I have something like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;cfset key = 'DiYVka4mAYk=' /\u0026gt; \n\u0026lt;cfset str = 'hello' /\u0026gt;\n\n\u0026lt;cfset enc = encrypt(str, key, 'des', \"base64\") /\u0026gt;\n\u0026lt;cfset dec = decrypt(enc, key, 'des', \"base64\") /\u0026gt;\n\n\u0026lt;cfoutput\u0026gt;\n#str# \u0026lt;!--- 'hello' ---\u0026gt;\n\u0026lt;br /\u0026gt;\n#enc# \u0026lt;!--- '3rNKAnEu+VA=' ---\u0026gt;\n\u0026lt;br /\u0026gt;\n#dec# \u0026lt;!--- 'hello' ---\u0026gt;\n\u0026lt;/cfoutput\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe same, implemented in Ruby:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003erequire 'openssl'\nrequire 'base64'\n\nstr = 'hello'\nkey = 'DiYVka4mAYk='\n\ndes = OpenSSL::Cipher.new('des')\n\ndes.encrypt \ndes.key = key\ndata = des.update(str) + des.final \nenc = Base64.encode64(data)\n\ndes.decrypt\ndes.key = key\ndec = des.update(Base64.decode64(enc)) + des.final \n\nputs str # =\u0026gt; 'hello'\nputs enc # =\u0026gt; 'wVQs6NjOZwM='\nputs dec # =\u0026gt; 'hello'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBoth work, but the encrypted strings are different. So passing encrypted data between ColdFusion and Ruby is not going to work.\u003c/p\u003e\n\n\u003cp\u003eThe key was generated using ColdFusion's \u003ccode\u003egenerateSecretKey()\u003c/code\u003e function. It looks Base64 encoded, so I tried setting the key like this in Ruby:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ekey = Base64.decode64('DiYVka4mAYk=')\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAgain, the code works but the encrypted string is different.\u003c/p\u003e\n\n\u003cp\u003eIs there anything I am missing regards key encoding?\u003c/p\u003e\n\n\u003cp\u003eAlso, I thought maybe there is more info \u003cem\u003eimplied\u003c/em\u003e when setting the algorithm to 'des' in ColdFusion. So I tried creating the Cipher in ruby with the following:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003edes \u003c/li\u003e\n\u003cli\u003edes-cbc\u003c/li\u003e\n\u003cli\u003edes-cfb \u003c/li\u003e\n\u003cli\u003edes-ecb \u003c/li\u003e\n\u003cli\u003edes-ede \u003c/li\u003e\n\u003cli\u003edes-ede-cbc \u003c/li\u003e\n\u003cli\u003edes-ede-cfb\u003c/li\u003e\n\u003cli\u003edes-ede-ofb \u003c/li\u003e\n\u003cli\u003edes-ofb\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eAgain, some variation in the encrypted string. But none matching the original ColdFusion version.\u003c/p\u003e\n\n\u003cp\u003eNote: the ColdFusion encryption has been in use for a long time, so I can't make any edits on that side. The 'fix' must be in Ruby.\u003c/p\u003e","accepted_answer_id":"12946457","answer_count":"1","comment_count":"7","creation_date":"2012-10-15 10:40:02.443 UTC","favorite_count":"1","last_activity_date":"2012-10-18 03:05:04.833 UTC","last_edit_date":"2012-10-15 15:02:34.133 UTC","last_editor_display_name":"","last_editor_user_id":"89025","owner_display_name":"","owner_user_id":"89025","post_type_id":"1","score":"2","tags":"ruby|coldfusion|openssl","view_count":"502"} +{"id":"23268880","title":"Adding Strings in NSMutableArray","body":"\u003cp\u003eI am in my IOS application in which i am getting ID from server which i am saving in string and then add strings in NSMutableArray.I am not getting perfect method by which i can add the strings in array and use the array outside the scope.\nHere is my code Please help me out::\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e- (void)flickrAPIRequest:(OFFlickrAPIRequest *)inRequest didCompleteWithResponse:(NSDictionary *)inResponseDictionary\n{\nNSMutableArray *array=[[NSMutableArray alloc]init];\n i=0;\n NSLog(@\"%s %@ %@\", __PRETTY_FUNCTION__, inRequest.sessionInfo, inResponseDictionary);\n if (inRequest.sessionInfo == kUploadImageStep)\n {\n snapPictureDescriptionLabel.text = @\"Setting properties...\";\n NSLog(@\"%@\", inResponseDictionary);\n\n NSString* photoID =[[inResponseDictionary valueForKeyPath:@\"photoid\"] textContent];\n flickrRequest.sessionInfo = kSetImagePropertiesStep;\n\n// for uploading pics on flickr we call this method\n [flickrRequest callAPIMethodWithPOST:@\"flickr.photos.setMeta\" arguments:[NSDictionary dictionaryWithObjectsAndKeys:photoID, @\"photo_id\", @\"PicBackMan\", @\"title\", @\"Uploaded from my iPhone/iPod Touch\", @\"description\", nil]];\n [self.array addObject:photoID];\n arr=array[0];\n counterflicker++;\n NSLog(@\" Count : %lu\", (unsigned long)[array count]);\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow can i add the photoID(Strings) in the array?\nPlease help me out..\u003c/p\u003e","answer_count":"3","comment_count":"7","creation_date":"2014-04-24 12:27:57.143 UTC","last_activity_date":"2014-04-24 14:09:59.857 UTC","last_edit_date":"2014-04-24 14:09:59.857 UTC","last_editor_display_name":"","last_editor_user_id":"1226963","owner_display_name":"","owner_user_id":"3471311","post_type_id":"1","score":"0","tags":"ios","view_count":"108"} +{"id":"20496213","title":"Chrome Extension using jQuery not working","body":"\u003cp\u003eI'm trying to build a very simple Chrome Extension with a jQuery menu - it's based in some code I gathered online. When I test the HTML in a browser it works, the problem is when I test as a Chrome Extension.\u003c/p\u003e\n\n\u003cp\u003eIs there anything missing in the manifest file?\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e\n\n\u003cp\u003eHere are the files:\u003c/p\u003e\n\n\u003cp\u003emanifest.json\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n\"name\": \"name\",\n\"description\": \"desc\",\n\"version\": \"1.4\",\n\n\"manifest_version\": 2,\n\n\"browser_action\": {\n \"default_icon\": \"ari.png\",\n \"default_popup\": \"popup.html\"\n },\n \"permissions\": [\n \"tabs\",\n \"http://*/\",\n \"https://*/\",\n \"file:///*/*\",\n \"https://*.google.com/\"\n ]\n\n\"content_scripts\": [{\n \"matches\": [\"http://*/*\"]\n \"js\": [\n \"jquery.js\",\n \"popup.js\"\n ],\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003epopup.html\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;!doctype html\u0026gt;\n\u0026lt;html\u0026gt;\n\u0026lt;head\u0026gt;\n\u0026lt;meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"\u0026gt;\n\u0026lt;title\u0026gt;title\u0026lt;/title\u0026gt;\n\u0026lt;script src=\"jquery.js\"\u0026gt;\u0026lt;/script\u0026gt;\n\u0026lt;script src=\"popup.js\"\u0026gt;\u0026lt;/script\u0026gt;\n\n\u0026lt;style\u0026gt;\n\u0026lt;/style\u0026gt;\n\n\u0026lt;!--\n - JavaScript and HTML must be in separate files: see our Content Security\n - Policy documentation[1] for details and explanation.\n -\n - [1]: http://developer.chrome.com/extensions/contentSecurityPolicy.html\n--\u0026gt;\n\n\n\n\u0026lt;/head\u0026gt;\n\n\u0026lt;body\u0026gt;\n\n\u0026lt;div style=\"float:left\" \u0026gt; \u0026lt;!--This is the first division of left--\u0026gt;\n\u0026lt;p\u0026gt;\u0026lt;strong\u0026gt;Report by region\u0026lt;/strong\u0026gt;\u0026lt;/p\u0026gt;\n\u0026lt;div id=\"firstpane\" class=\"menu_list\"\u0026gt; \u0026lt;!--Code for menu starts here--\u0026gt;\n \u0026lt;p class=\"menu_head\"\u0026gt;Header-1\u0026lt;/p\u0026gt;\n \u0026lt;div class=\"menu_body\"\u0026gt;\n \u0026lt;a href=\"#\"\u0026gt;Link-1\u0026lt;/a\u0026gt;\n \u0026lt;a href=\"#\"\u0026gt;Link-2\u0026lt;/a\u0026gt;\n \u0026lt;a href=\"#\"\u0026gt;Link-3\u0026lt;/a\u0026gt; \n \u0026lt;/div\u0026gt;\n \u0026lt;p class=\"menu_head\"\u0026gt;Header-2\u0026lt;/p\u0026gt;\n \u0026lt;div class=\"menu_body\"\u0026gt;\n \u0026lt;a href=\"#\"\u0026gt;Link-1\u0026lt;/a\u0026gt;\n \u0026lt;a href=\"#\"\u0026gt;Link-2\u0026lt;/a\u0026gt;\n \u0026lt;a href=\"#\"\u0026gt;Link-3\u0026lt;/a\u0026gt; \n \u0026lt;/div\u0026gt;\n \u0026lt;p class=\"menu_head\"\u0026gt;Header-3\u0026lt;/p\u0026gt;\n \u0026lt;div class=\"menu_body\"\u0026gt;\n \u0026lt;a href=\"#\"\u0026gt;Link-1\u0026lt;/a\u0026gt;\n \u0026lt;a href=\"#\"\u0026gt;Link-2\u0026lt;/a\u0026gt;\n \u0026lt;a href=\"#\"\u0026gt;Link-3\u0026lt;/a\u0026gt; \n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt; \u0026lt;!--Code for menu ends here--\u0026gt;\n\u0026lt;/div\u0026gt;\n\n\u0026lt;div style=\"float:left; margin-left:20px;\"\u0026gt; \u0026lt;!--This is the second division of right--\u0026gt;\n\u0026lt;p\u0026gt;\u0026lt;strong\u0026gt;Works with mouse over\u0026lt;/strong\u0026gt;\u0026lt;/p\u0026gt;\n\u0026lt;div class=\"menu_list\" id=\"secondpane\"\u0026gt; \u0026lt;!--Code for menu starts here--\u0026gt;\n \u0026lt;p class=\"menu_head\"\u0026gt;Header-1\u0026lt;/p\u0026gt;\n \u0026lt;div class=\"menu_body\"\u0026gt;\n \u0026lt;a href=\"#\"\u0026gt;Link-1\u0026lt;/a\u0026gt;\n \u0026lt;a href=\"#\"\u0026gt;Link-2\u0026lt;/a\u0026gt;\n \u0026lt;a href=\"#\"\u0026gt;Link-3\u0026lt;/a\u0026gt; \n \u0026lt;/div\u0026gt;\n \u0026lt;p class=\"menu_head\"\u0026gt;Header-2\u0026lt;/p\u0026gt;\n \u0026lt;div class=\"menu_body\"\u0026gt;\n \u0026lt;a href=\"#\"\u0026gt;Link-1\u0026lt;/a\u0026gt;\n \u0026lt;a href=\"#\"\u0026gt;Link-2\u0026lt;/a\u0026gt;\n \u0026lt;a href=\"#\"\u0026gt;Link-3\u0026lt;/a\u0026gt; \n \u0026lt;/div\u0026gt;\n \u0026lt;p class=\"menu_head\"\u0026gt;Header-3\u0026lt;/p\u0026gt;\n \u0026lt;div class=\"menu_body\"\u0026gt;\n \u0026lt;a href=\"#\"\u0026gt;Link-1\u0026lt;/a\u0026gt;\n \u0026lt;a href=\"#\"\u0026gt;Link-2\u0026lt;/a\u0026gt;\n \u0026lt;a href=\"#\"\u0026gt;Link-3\u0026lt;/a\u0026gt; \n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt; \u0026lt;!--Code for menu ends here--\u0026gt;\n\u0026lt;/div\u0026gt;\n\n\u0026lt;/body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003epopup.js\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;!--//---------------------------------+\n// Developed by Roshan Bhattarai \n// Visit http://roshanbh.com.np for this script and more.\n// This notice MUST stay intact for legal use\n// ---------------------------------\u0026gt;\n\n$(document).ready(function()\n{\n //slides the element with class \"menu_body\" when paragraph with class \"menu_head\" is clicked \n $(\"#firstpane p.menu_head\").click(function()\n{\n $(this).css({backgroundImage:\"url(down.png)\"}).next(\"div.menu_body\").slideToggle(300).siblings(\"div.menu_body\").slideUp(\"slow\");\n $(this).siblings().css({backgroundImage:\"url(left.png)\"});\n});\n//slides the element with class \"menu_body\" when mouse is over the paragraph\n$(\"#secondpane p.menu_head\").mouseover(function()\n{\n $(this).css({backgroundImage:\"url(down.png)\"}).next(\"div.menu_body\").slideDown(500).siblings(\"div.menu_body\").slideUp(\"slow\");\n $(this).siblings().css({backgroundImage:\"url(left.png)\"});\n});\n});\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"2","creation_date":"2013-12-10 13:45:50.527 UTC","last_activity_date":"2015-10-21 17:26:26.667 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2103505","post_type_id":"1","score":"0","tags":"javascript|jquery|google-chrome-extension","view_count":"168"} +{"id":"7891635","title":"Changing the parameter submitted for a Drop Down Menu","body":"\u003cp\u003eI have a drop-down form that contains 4 different types of IDs which then queries a database. How do I change the parameter which is submitted to the action page? It always submits the same input name rather than the value selected in the dropdown box. \u003c/p\u003e","accepted_answer_id":"7892487","answer_count":"1","comment_count":"0","creation_date":"2011-10-25 15:23:34.657 UTC","last_activity_date":"2011-10-25 16:26:20.43 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1005699","post_type_id":"1","score":"0","tags":"html|forms|jsp","view_count":"380"} +{"id":"4184022","title":"How can I safely exit a DBMS when records are locked?","body":"\u003cp\u003eI'm a hobbyist programmer but have been doing it a while. I'm writing a small document management application for use at work (in c#). When a user opens a record, I update it to indicate it's currently locked for editing. \u003c/p\u003e\n\n\u003cp\u003eWhat I'm not sure about is how to ensure the database gets updated when the application exits unsafely (eg. computer shuts down unexpectedly)? Also, how should I update it when the application exits via the computer being shut down by the user? I just want to make sure that I don't end up with records being marked as locked when nobody is viewing them.\u003c/p\u003e","accepted_answer_id":"4184102","answer_count":"5","comment_count":"0","creation_date":"2010-11-15 11:48:02.7 UTC","last_activity_date":"2016-10-27 19:12:18.433 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"508201","post_type_id":"1","score":"3","tags":"c#|sql-server|database","view_count":"128"} +{"id":"13962644","title":"How to retrieve data from a table, based on user coordinates and the radius","body":"\u003cp\u003eBasically I send a GET request to a \u003ccode\u003ephp\u003c/code\u003e file with the user lat and long values (\u003ccode\u003e$userLat, $userLong\u003c/code\u003e respectively).\n\u003cbr\u003eIn my database, I have a table 'Locations' that has the following columns:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eLocation_Name\u003c/li\u003e\n\u003cli\u003eLat\u003c/li\u003e\n\u003cli\u003eLng\u003c/li\u003e\n\u003cli\u003eRadius (in meters)\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eSo, I wanna make a query where I compare the user's coordinates with all the Locations coordinates and see if the distance between the Location and the User is \u0026lt;= the radius of that location. If so, return the name of that Location.\u003c/p\u003e\n\n\u003cp\u003e\u003cbr\u003eThe query would be something like this (pseudo-code):\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eSELECT Location_Name FROM Locations WHERE distanceBetween(($userLat, $userLong) AND (Lat, Lng)) \u0026lt;= Radius\u003c/p\u003e\n\u003c/blockquote\u003e","accepted_answer_id":"13977183","answer_count":"2","comment_count":"2","creation_date":"2012-12-19 22:56:16.593 UTC","last_activity_date":"2012-12-20 17:12:21.64 UTC","last_edit_date":"2012-12-19 23:23:26.437 UTC","last_editor_display_name":"","last_editor_user_id":"848311","owner_display_name":"","owner_user_id":"848311","post_type_id":"1","score":"2","tags":"php|mysql|geolocation|latitude-longitude","view_count":"427"} +{"id":"1735696","title":"use case tutorial","body":"\u003cp\u003eCould you suggest a comprehensive use-case tutorial? I would like something which would explain how to organize use case diagrams in packages, relationships in UC diagrams.\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2009-11-14 21:35:00.267 UTC","favorite_count":"2","last_activity_date":"2011-06-10 13:55:11.35 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"211179","post_type_id":"1","score":"2","tags":"uml","view_count":"977"} +{"id":"25305961","title":"PHP http_response_code(); versus header();","body":"\u003cp\u003eI have made a contact form based on this tutorial:\n\u003ca href=\"http://blog.teamtreehouse.com/create-ajax-contact-form\" rel=\"nofollow\"\u003ehttp://blog.teamtreehouse.com/create-ajax-contact-form\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI'm using \u003cstrong\u003ePHP Version 5.3.10-1ubuntu3.4\u003c/strong\u003e on my server and I've been having trouble with \u003ccode\u003ehttp_response_code();\u003c/code\u003e which is what the example tutorial at the above link uses. I've read \u003ccode\u003ehttp_response_code();\u003c/code\u003e only works with PHP 5.4. So instead I have reverted to using \u003ccode\u003eheader();\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eI have my form working just fine and it's displaying a success message when I submit, rather than errors when I was using \u003ccode\u003ehttp_response_code();\u003c/code\u003e but my PHP isn't that great and I am wanting to know if what I have done is acceptable or if I should be doing it a different way? Please correct my code if so.\u003c/p\u003e\n\n\u003cp\u003eHere's the contents of my mailer.php file, where you can see I've commented out \u003ccode\u003ehttp_response_code();\u003c/code\u003e and am using \u003ccode\u003eheader();\u003c/code\u003e.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eif ($_SERVER[\"REQUEST_METHOD\"] == \"POST\") {\n // Get the form fields and remove whitespace.\n $name = strip_tags(trim($_POST[\"name\"]));\n $name = str_replace(array(\"\\r\",\"\\n\"),array(\" \",\" \"),$name);\n $email = filter_var(trim($_POST[\"email\"]), FILTER_SANITIZE_EMAIL);\n $phone = trim($_POST[\"phone\"]);\n $company = trim($_POST[\"company\"]);\n $minbudget = trim($_POST[\"minbudget\"]);\n $maxbudget = trim($_POST[\"maxbudget\"]);\n $message = trim($_POST[\"message\"]);\n $deadline = trim($_POST[\"deadline\"]);\n $referred = trim($_POST[\"referred\"]);\n\n // Check that data was sent to the mailer.\n if ( empty($name) OR empty($phone) OR empty($message) OR !filter_var($email, FILTER_VALIDATE_EMAIL)) {\n // Set a 400 (bad request) response code and exit.\n //http_response_code(400);\n header(\"HTTP/1.1 400 Bad Request\");\n echo \"Error (400). That's not good, refresh and try again otherwise please email me and let me know you are having trouble submitting this form.\";\n exit;\n }\n\n // Set the recipient email address.\n // FIXME: Update this to your desired email address.\n $recipient = \"myemail@domain.com\";\n\n // Set the email subject.\n $subject = \"Website enquiry from $name\";\n\n // Build the email content.\n $email_content = \"Name: $name\\n\";\n $email_content .= \"Email: $email\\n\\n\";\n $email_content .= \"Phone: $phone\\n\";\n $email_content .= \"Company: $company\\n\\n\";\n\n $email_content .= \"Budget: $minbudget $maxbudget\\n\";\n $email_content .= \"Deadline: $deadline\\n\";\n //$email_content .= \"Max Budget: $maxbudget\\n\";\n\n $email_content .= \"\\n$message\\n\\n\"; \n\n $email_content .= \"Referred: $referred\\n\";\n\n // Build the email headers.\n $email_headers = \"From: $name \u0026lt;$email\u0026gt;\";\n\n // Send the email.\n if (mail($recipient, $subject, $email_content, $email_headers)) {\n // Set a 200 (okay) response code.\n //http_response_code(200);\n header(\"HTTP/1.1 200 OK\");\n echo \"Thank You! I'll be in touch soon.\";\n } else {\n // Set a 500 (internal server error) response code.\n //http_response_code(500);\n header(\"HTTP/1.0 500 Internal Server Error\");\n echo \"Error (500). That's not good, refresh and try again otherwise please email me and let me know you are having trouble submitting this form.\";\n }\n\n} else {\n // Not a POST request, set a 403 (forbidden) response code.\n //http_response_code(403);\n header(\"HTTP/1.1 403 Forbidden\");\n echo \"Error (403). That's not good, refresh and try again otherwise please email me and let me know you are having trouble submitting this form.\";\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"3","comment_count":"3","creation_date":"2014-08-14 10:34:58.293 UTC","favorite_count":"3","last_activity_date":"2017-01-14 01:14:26.123 UTC","last_edit_date":"2016-12-01 01:31:44.95 UTC","last_editor_display_name":"","last_editor_user_id":"93540","owner_display_name":"","owner_user_id":"3263881","post_type_id":"1","score":"6","tags":"php","view_count":"8120"} +{"id":"3763686","title":"$pscmdlet.ShouldProcess(...) returns \"Yes\" or \"Yes to All\"","body":"\u003cp\u003eI'm writing a script to create VMs, and obviously I would like to support the standard confirm/whatif semantics. However, if I have a number of machines to create, it would be good if I could differentiate between \"Yes\" and \"Yes to All\" so I don't necessarily have to reconfirm every machine. \u003c/p\u003e\n\n\u003cp\u003e$pscmdlet.ShouldProcess only returns a boolean, so how can I tell the difference?\u003c/p\u003e","accepted_answer_id":"3771963","answer_count":"1","comment_count":"2","creation_date":"2010-09-21 19:22:19.713 UTC","favorite_count":"3","last_activity_date":"2010-09-23 09:00:57.17 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"103633","post_type_id":"1","score":"8","tags":"powershell","view_count":"3346"} +{"id":"14470299","title":"Does PullToRefresh work with FragmentPagerAdapter?","body":"\u003cp\u003e\u003cstrong\u003eLibraries:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/chrisbanes/Android-PullToRefresh\" rel=\"nofollow\"\u003ehttps://github.com/chrisbanes/Android-PullToRefresh\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/JakeWharton/Android-ViewPagerIndicator\" rel=\"nofollow\"\u003ehttps://github.com/JakeWharton/Android-ViewPagerIndicator\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eIn the Sample \u003ccode\u003ePullToRefreshListInViewPagerActivity\u003c/code\u003e only works with PageAdapter.\u003c/p\u003e\n\n\u003cp\u003eI couldn't find a way to put it to work with \u003ccode\u003eFragmentPageAdapter\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eSample:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_ptr_list_in_vp);\n\n mViewPager = (ViewPager) findViewById(R.id.vp_list);\n mViewPager.setAdapter(new ListViewPagerAdapter());\n }\n\n private class ListViewPagerAdapter extends PagerAdapter {\n\n @Override\n public View instantiateItem(ViewGroup container, int position) {\n Context context = container.getContext();\n\n PullToRefreshListView plv = (PullToRefreshListView) LayoutInflater.from(context).inflate(\n R.layout.layout_listview_in_viewpager, container, false);\n\n ListAdapter adapter = new ArrayAdapter\u0026lt;String\u0026gt;(context, android.R.layout.simple_list_item_1,\n Arrays.asList(STRINGS));\n plv.setAdapter(adapter);\n\n plv.setOnRefreshListener(PullToRefreshListInViewPagerActivity.this);\n\n // Now just add ListView to ViewPager and return it\n container.addView(plv, LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);\n\n return plv;\n }\n\n @Override\n public void destroyItem(ViewGroup container, int position, Object object) {\n container.removeView((View) object);\n }\n\n @Override\n public boolean isViewFromObject(View view, Object object) {\n return view == object;\n }\n\n @Override\n public int getCount() {\n return 3;\n }\n\n }\n\n @Override\n public void onRefresh(PullToRefreshBase\u0026lt;ListView\u0026gt; refreshView) {\n new GetDataTask(refreshView).execute();\n }\n\n private static class GetDataTask extends AsyncTask\u0026lt;Void, Void, Void\u0026gt; {\n\n PullToRefreshBase\u0026lt;?\u0026gt; mRefreshedView;\n\n public GetDataTask(PullToRefreshBase\u0026lt;?\u0026gt; refreshedView) {\n mRefreshedView = refreshedView;\n }\n\n @Override\n protected Void doInBackground(Void... params) {\n // Simulates a background job.\n try {\n Thread.sleep(4000);\n } catch (InterruptedException e) {\n }\n return null;\n }\n\n @Override\n protected void onPostExecute(Void result) {\n mRefreshedView.onRefreshComplete();\n super.onPostExecute(result);\n }\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"14598528","answer_count":"1","comment_count":"0","creation_date":"2013-01-23 00:05:11.793 UTC","favorite_count":"2","last_activity_date":"2014-02-25 19:29:42.87 UTC","last_edit_date":"2014-02-25 19:29:42.87 UTC","last_editor_display_name":"","last_editor_user_id":"661589","owner_display_name":"","owner_user_id":"1323014","post_type_id":"1","score":"5","tags":"android|viewpagerindicator|pull-to-refresh","view_count":"1700"} +{"id":"43173285","title":"Tableview item dependencies javafx","body":"\u003cp\u003eGood evening,\u003c/p\u003e\n\n\u003cp\u003eI am working on a project and I'm at lost at how to configure my tableviews to depend on each other. I would like for the parts in one tableview to depend on the products in the other. How would I go about doing that? I prefer to not use sql at the moment just to keep everything simple as possible. The code snippet is listed below:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class maincontroller {\n\nprivate ObservableList\u0026lt;Part\u0026gt; parts = FXCollections.observableArrayList();\n\n private ObservableList\u0026lt;Product\u0026gt; products = FXCollections.observableArrayList();\n\n//code to swap between controllers\n\n @Override\n public void initialize(URL url, ResourceBundle rb) {\n\n partsID.setCellValueFactory(new PropertyValueFactory\u0026lt;\u0026gt;(\"partID\"));\n partsName.setCellValueFactory(new PropertyValueFactory\u0026lt;\u0026gt;(\"name\"));\n partsinvlevel.setCellValueFactory(new PropertyValueFactory\u0026lt;\u0026gt;(\"instock\"));\n partscost.setCellValueFactory(new PropertyValueFactory\u0026lt;\u0026gt;(\"price\"));\n parttable.setItems(parts);\n\n productsID.setCellValueFactory(new PropertyValueFactory\u0026lt;\u0026gt;(\"productID\"));\n\n productsName.setCellValueFactory(new PropertyValueFactory\u0026lt;\u0026gt;(\"name\"));\n productsInvlevel.setCellValueFactory(new PropertyValueFactory\u0026lt;\u0026gt;(\"instock\"));\n productsprice.setCellValueFactory(new PropertyValueFactory\u0026lt;\u0026gt;(\"price\"));\n producttable.setItems(products);\n\n\n parttable.getSelectionModel().selectedItemProperty().addListener((ObservableValue\u0026lt;? extends Part\u0026gt; observable, Part oldValue, Part newValue) -\u0026gt; {\n\n\n });\n\n\n producttable.getSelectionModel().selectedItemProperty().addListener((ObservableValue\u0026lt;? extends Product\u0026gt; observable, Product oldValue, Product newValue) -\u0026gt; {\n\n });\n\n\n } \n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"43175447","answer_count":"1","comment_count":"0","creation_date":"2017-04-02 20:38:24.917 UTC","last_activity_date":"2017-04-03 01:50:35.483 UTC","last_edit_date":"2017-04-02 20:44:30.79 UTC","last_editor_display_name":"","last_editor_user_id":"7731821","owner_display_name":"","owner_user_id":"7731821","post_type_id":"1","score":"0","tags":"javafx|dependencies|tableview","view_count":"51"} +{"id":"43448843","title":"Dependency injection : how do i resolve multiple instances at runtime?","body":"\u003cp\u003eI am using \u003ccode\u003eSimple Injector\u003c/code\u003e for my injection fun.\u003c/p\u003e\n\n\u003cp\u003eAs far as, I understand I only register and resolve with my container on my bootstrapper project.\u003c/p\u003e\n\n\u003cp\u003eSo I have this code in my console application :\u003c/p\u003e\n\n\u003cpre class=\"lang-cs prettyprint-override\"\u003e\u003ccode\u003estatic void Main(string[] args)\n{\n Container container = ComposeRoot();\n\n var controller = container.GetInstance\u0026lt;IBussinesLogicController\u0026gt;();\n controller.Execute();\n\n Console.WriteLine(\"Started\");\n Console.ReadLine();\n}\n\nprivate static Container ComposeRoot()\n{\n var container = new Container();\n\n //Bussines Logic controllers.\n container.Register\u0026lt;IBussinesLogicController, BussinesLogicController\u0026gt;(Lifestyle.Singleton);\n container.Register\u0026lt;IStationController, StationController\u0026gt;(Lifestyle.Transient);\n\n //Data Access controllers.\n container.Register\u0026lt;IDataAccessController, DataAccessController\u0026gt;(Lifestyle.Singleton);\n container.Register\u0026lt;IDirectoryStructureController, DirectoryStructureController\u0026gt;(Lifestyle.Singleton);\n\n //Shared controllers.\n container.Register\u0026lt;ILogger, LoggerController\u0026gt;(Lifestyle.Singleton);\n\n container.Verify();\n\n return container;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis will resolve my businesslogic controller and call Execute.\u003c/p\u003e\n\n\u003cp\u003eNow in execute I want to resolve 10 new instances of \u003ccode\u003eIStationController\u003c/code\u003e and add them to a list.\u003c/p\u003e\n\n\u003cpre class=\"lang-cs prettyprint-override\"\u003e\u003ccode\u003evar stations = new List\u0026lt;IStationController\u0026gt;();\nfor (int i = 0; i \u0026lt; 10; i++)\n{\n //Resolve IStationController here...\n //IStationController station = diContainer.GetInstance\u0026lt;IStationController\u0026gt;();\n //station.StationName = $\"Station {i}\";\n //stations.Add(station);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow can i do this properly, since my Business Logic project does not and is not allowed a reference to the dependency container? \u003c/p\u003e\n\n\u003cp\u003eI can resolve this easily by adding the dependency to the container but am afraid i am not following the correct patterns. \u003c/p\u003e\n\n\u003cp\u003eMy solution layout is as follows :\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eClass Library (DAL)\u003c/li\u003e\n\u003cli\u003eClass Library (BLL) \u0026lt;- IBussinesLogicController\u003c/li\u003e\n\u003cli\u003eClass Library (Models)\u003c/li\u003e\n\u003cli\u003eClass Library (Logger)\u003c/li\u003e\n\u003cli\u003eConsole Application (ConsoleApp6) \u0026lt;- ComposeRoot()\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003ePlease let me know what the right approach is to this problem. \u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","accepted_answer_id":"43449139","answer_count":"2","comment_count":"6","creation_date":"2017-04-17 09:34:25.817 UTC","last_activity_date":"2017-04-17 18:37:59.637 UTC","last_edit_date":"2017-04-17 14:22:19.167 UTC","last_editor_display_name":"","last_editor_user_id":"264697","owner_display_name":"","owner_user_id":"2565518","post_type_id":"1","score":"0","tags":"c#|design-patterns|dependency-injection|inversion-of-control|ioc-container","view_count":"185"} +{"id":"39101273","title":"KStream windowed aggregation - partition problems","body":"\u003cp\u003eI have a simple cluster setup on AWS with one kafka instance and one zookeeper. Im writing \u003ccode\u003e\u0026lt;String, String\u0026gt;\u003c/code\u003e to this and working to aggregate these values in 10 second windows.\u003c/p\u003e\n\n\u003cp\u003eError message(s) Im getting:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eDEBUG o.a.kafka.clients.NetworkClient - Sending metadata request {topics=[kafka_test1-write_aggregate-changelog]} to node 100\nDEBUG org.apache.kafka.clients.Metadata - Updated cluster metadata version 6 to Cluster(nodes = [12.34.56.78:9092 (id: 100 rack: null)], partitions = [Partition(topic = kafka_test1-write_aggregate-changelog, partition = 1, leader = 100, replicas = [100,], isr = [100,], Partition(topic = kafka_test1-write_aggregate-changelog, partition = 0, leader = 100, replicas = [100,], isr = [100,]])\nDEBUG o.a.k.c.consumer.internals.Fetcher - Attempt to fetch offsets for partition kafka_test1-write_aggregate-changelog-0 failed due to obsolete leadership information, retrying.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe \u003ccode\u003ecluster metadata\u003c/code\u003e # keeps advancing indefinitely. \u003c/p\u003e\n\n\u003cp\u003eCode:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eKStreamBuilder kStreamBuilder = new KStreamBuilder();\nKStream\u0026lt;String, String\u0026gt; lines = kStreamBuilder.stream(TOPIC);\n\nKTable\u0026lt;Windowed\u0026lt;String\u0026gt;, String\u0026gt; dbwriteTable = lines.aggregateByKey(\n new DBAggregateInit(),\n new DBAggregate(),\n TimeWindows.of(\"write_aggregate\", 10000));\n\ndbwriteTable.toStream().print();\n\nKafkaStreams kafkaStreams = new KafkaStreams(kStreamBuilder, streamsConfig);\n\nkafkaStreams.start();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhere \u003ccode\u003eDBAggregateInit\u003c/code\u003e and \u003ccode\u003eDBAggregate\u003c/code\u003e are stubbed out to log to DEBUG when anything hits them. No other function.\u003c/p\u003e\n\n\u003cp\u003eNone of these stubbed functions ever gets hit.\u003c/p\u003e\n\n\u003cp\u003eNot sure what step(s) I've missed here. If I \u003ccode\u003e.foreach()\u003c/code\u003e or do a simple read on this topic it seems to work ok.\u003c/p\u003e\n\n\u003ch3\u003eFWIW:\u003c/h3\u003e\n\n\u003cp\u003eIve had similar issues with partitions when I let kafka create my topic instead of using \u003ccode\u003ekafka-topic --create --topic ...\u003c/code\u003e. \u003c/p\u003e","accepted_answer_id":"39104526","answer_count":"1","comment_count":"0","creation_date":"2016-08-23 12:30:08.523 UTC","last_activity_date":"2016-08-23 17:55:21.227 UTC","last_edit_date":"2016-08-23 17:55:21.227 UTC","last_editor_display_name":"","last_editor_user_id":"1743580","owner_display_name":"","owner_user_id":"491682","post_type_id":"1","score":"0","tags":"java|apache-kafka|apache-kafka-streams","view_count":"80"} +{"id":"411913","title":"Silverlight XML editor / syntax highlighting","body":"\u003cp\u003eI am looking for a \u003cstrong\u003eSilverlight text editor control\u003c/strong\u003e that provides \u003cstrong\u003eXML syntax highlighting\u003c/strong\u003e. I found a few answers in \u003cem\u003eWinforms\u003c/em\u003e or \u003cem\u003eWPF\u003c/em\u003e, like \u003ca href=\"https://stackoverflow.com/questions/394751/anyone-know-a-code-editor-i-can-embed-in-a-wpf-window-or-windows-forms\"\u003ehere on Stackoverflow\u003c/a\u003e, but I didn't manage to convert them to Silverlight. The fact that Silverlight is missing System.Drawing is probably a big problem.\u003c/p\u003e\n\n\u003cp\u003eThe only text editor I found for Silverlight is \u003ca href=\"http://www.codeplex.com/richtextedit\" rel=\"nofollow noreferrer\"\u003eRichTextEdit on Codeplex\u003c/a\u003e, but I don't think it is a suitable base for real-time syntax highlighting.\u003c/p\u003e\n\n\u003cp\u003eHas anyone heard of such a control, or can provide hints on how to build one?\nMany thanks,\u003c/p\u003e\n\n\u003cp\u003eRomain\u003c/p\u003e","accepted_answer_id":"514620","answer_count":"4","comment_count":"0","creation_date":"2009-01-04 23:33:37.483 UTC","favorite_count":"4","last_activity_date":"2010-10-26 13:03:12.733 UTC","last_edit_date":"2017-05-23 10:29:35.247 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"51473","post_type_id":"1","score":"8","tags":"silverlight|editor|controls|syntax-highlighting","view_count":"8128"} +{"id":"19129836","title":"javax.security.sasl.SaslException: Authentic Failed while connecting to Jboss 7 server from remote client","body":"\u003cp\u003eI have standalone Java client(Running from within eclipse ) that I wish to connect to an external server . If the server is localhost then i see no problems at all . However whenever i try to connect to the external server where I always gets the following exception\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e- JBREM000200: Remote connection failed: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed\n- Could not register a EJB receiver for connection to remote://10.160.148.61:4447\njava.lang.RuntimeException: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have tried to follow the steps mentioned \u003ca href=\"https://docs.jboss.org/author/display/AS71/EJB+invocations+from+a+remote+client+using+JNDI\"\u003eEJB invocations from a remote client using JNDI\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThe exception tells me tthere is something wrong in my configuration files related to authentication . Here is my ejb_client_properties file \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eremote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false\n\nremote.connections=default\n\nremote.connection.default.host=10.160.148.61\nremote.connection.default.port = 4447\nremote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false\n\nremote.connection.default.username=tan\nremote.connection.default.password=f2b1c3c7d3f1e224cbf6508494cf0418\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNote : the user tan is added to my mgt.user.properties file on the server . I used add-user.bat to add a user in the server . I also added an application user . I use the same credentials to pass to the server . I cant think of anything else . \u003c/p\u003e\n\n\u003cp\u003eMy ejb calling is as follows :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e final Hashtable jndiProperties = new Hashtable();\n jndiProperties.put(Context.URL_PKG_PREFIXES, \"org.jboss.ejb.client.naming\");\n\n InitialContext aJNDI = new InitialContext(jndiProperties);\n Ppi handle = (Ppi) aJNDI\n .lookup(\"ejb:PPIEAR/PService/PConnect!com.gem.p.PConnection?stateful\");\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI see numerous threads related to the exception but unable to fix it :( Can someone help . \u003c/p\u003e\n\n\u003cp\u003eI also have a legitimate SSL certificate installed on the server . Do i need to do something extra to take care of that ?\u003c/p\u003e\n\n\u003cp\u003eAlso NOTE : My server is running in standalone mode . \u003c/p\u003e","accepted_answer_id":"19134379","answer_count":"2","comment_count":"0","creation_date":"2013-10-02 04:05:51.063 UTC","favorite_count":"2","last_activity_date":"2015-09-25 07:41:44.227 UTC","last_edit_date":"2013-10-02 06:49:43.447 UTC","last_editor_display_name":"","last_editor_user_id":"803649","owner_display_name":"","owner_user_id":"803649","post_type_id":"1","score":"9","tags":"java|jboss|ejb|jboss7.x","view_count":"26017"} +{"id":"29951841","title":"Unable to delete specific record using ajax and php-mysql","body":"\u003cp\u003eI have created an ajax based php-mysql application which shows data from mysql table using while loop. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e $ibb = mysql_query(\"select * from bill where tableno='{$tno}' ORDER BY ID ASC\");\n\nwhile($ibff = mysql_fetch_assoc($ibb))\n{\n$iidd=$ibff['ID'];\n$itemid=$ibff['itemid'];\n$amt=$ibff['amount'];\n$qty=$ibff['qty'];\n\n\necho'\u0026lt;tr\u0026gt;\n\u0026lt;td\u0026gt;'.$itemid.'\u0026lt;/td\u0026gt;\n\u0026lt;td\u0026gt;'.$amt.'\u0026lt;/td\u0026gt;\n\u0026lt;td\u0026gt;'.$qty.'\u0026lt;/td\u0026gt;\n\u0026lt;td\u0026gt;'.$total.'\u0026lt;/td\u0026gt;\n\u0026lt;td\u0026gt;\u0026lt;button name= \"'.$iidd.'\" id=\"remove\" class=\"btn btn-danger btn-sm\" onclick=\"this.disabled=true;\"\u0026gt;X\u0026lt;/button\u0026gt;\u0026lt;/td\u0026gt;\n\n\n\u0026lt;/tr\u0026gt;';\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAJAX Code is as below :-\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;script type=\"text/javascript\"\u0026gt;\njQuery('#remove').click(function(data) {\n var pid = jQuery(this).attr('name');\n var y = jQuery(this).attr('name');\n\n $.ajax({\n url: \"delitem.php?item=\"+pid+\"\u0026amp;data=\"+y,\n type: 'GET',\n success: function(s){\n var $container = $(\"#content2\");\n $container.load(\"bd.php\");\n },\n error: function(e){\n alert('Error Processing your Request!!');\n }\n });\n\n});\n\u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003edelitem.php code :-\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$idd=$_GET['item'];\n\n$ab = mysql_query(\"select * from bill where ID='{$idd}'\");\n$abf=mysql_fetch_assoc($ab);\n\n$qty = $abf['qty'];\n$name = $abf['itemid'];\n$d = date('d/m/Y');\n\n$remove= mysql_query(\"delete from reports where name='{$name}' and date='{$d}' limit $qty\");\n$delete = mysql_query(\"delete from bill where id='{$idd}'\");\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCode is working fine only if i start deleting from the very first record. It always deletes the first entry displayed on the page. Where am I doing wrong? \u003c/p\u003e","accepted_answer_id":"29952011","answer_count":"1","comment_count":"9","creation_date":"2015-04-29 18:35:54.043 UTC","last_activity_date":"2015-04-29 18:50:48.763 UTC","last_edit_date":"2015-04-29 18:50:48.763 UTC","last_editor_display_name":"","last_editor_user_id":"1011527","owner_display_name":"","owner_user_id":"4847777","post_type_id":"1","score":"-2","tags":"php|jquery|mysql|ajax","view_count":"97"} +{"id":"19253233","title":"Rails 4 Flot Uncaught Type Error \u0026 Error Displaying","body":"\u003cp\u003eI have a Rails 4 application that uses \u003cstrong\u003eflot\u003c/strong\u003e to generate charts. Currently, I have one chart that's displaying on a dashboard properly, but when I add a second chart to a different page, it fails to render. And, on both pages, I am getting the following error looking at the console:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eUncaught TypeError: Cannot call method 'replace' of undefined \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere's the CoffeeScript that's calling the two \u003cstrong\u003eflot\u003c/strong\u003e functions (same file):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ed1 = [[1, 2], [3, 4], [5, 6]]\n$.plot \"#flotchart\", [d1]\n\nd2 = [[1, 2], [3, 4], [5, 6]]\n$.plot \"#flotchart2\", [d2]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd, in the two separate files, I just have the empty divs:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div id=\"flotchart\"\u0026gt;\u0026lt;/div\u0026gt;\n\n\u0026lt;div id=\"flotchart2\"\u0026gt;\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAgain, the first one shows up just fine, but the second one doesn't show up at all and both have the uncaught type error seen above.\u003c/p\u003e\n\n\u003cp\u003eI'm guessing that the type error is due to the \u003cstrong\u003e#flotchart\u003c/strong\u003e being absent from some pages where the jQuery is still being called (as Rails loads all of them to every page in the development environment)? If so, is there any way to solve this? And then, why isn't the second chart showing up at all?\u003c/p\u003e\n\n\u003cp\u003eThanks in advance for any help!\u003c/p\u003e","accepted_answer_id":"19458325","answer_count":"1","comment_count":"1","creation_date":"2013-10-08 16:27:26.02 UTC","last_activity_date":"2013-10-18 20:16:17.11 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"642128","post_type_id":"1","score":"1","tags":"javascript|jquery|ruby-on-rails|ruby-on-rails-4|flot","view_count":"227"} +{"id":"29312686","title":"Understanding results from HKSourceQuery, or Sources in general","body":"\u003cp\u003eI just did a HKSourceQuery and got some results. When I do a \u003ccode\u003eprintln\u003c/code\u003e of the results, I got this: \u003ccode\u003e\u0026lt;HKSource:0x156c1520 \"Health\" (com.apple.Health)\u0026gt;//description of the object\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eHow do I use this to make a predicate using the \u003ccode\u003eHKQuery.predicateForObjectsFromSource(/* source goes here */)\u003c/code\u003e\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-03-28 01:38:21.153 UTC","last_activity_date":"2015-03-31 04:26:53.64 UTC","last_edit_date":"2015-03-28 15:20:46.417 UTC","last_editor_display_name":"","last_editor_user_id":"4211945","owner_display_name":"","owner_user_id":"4211945","post_type_id":"1","score":"0","tags":"ios|swift|health-monitoring|health-kit|hkhealthstore","view_count":"791"} +{"id":"39614830","title":"Inline output using query_to_xml in postgres","body":"\u003cp\u003eRunning following query in postgresql\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eselect REPLACE(\n REPLACE(\n REPLACE(\n REPLACE(\n query_to_xml(\n 'select 1 \"col1\",2 \"col2\",3 \"col3\"\n union all\n select 11 \"col1\",22 \"col2\",33 \"col3\"\n union all\n select 111 \"col1\",222 \"col2\",333 \"col3\"',\n true,\n false,\n ''\n )::text ,\n '\u0026lt; row \u0026gt;',\n '\u0026lt; Leaf \u0026gt;'\n ),\n '\u0026lt; /row \u0026gt;',\n '\u0026lt; /Leaf \u0026gt;'\n ),\n '\u0026lt; table xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" \u0026gt;',\n '\u0026lt; Tree \u0026gt;'\n ),\n '\u0026lt; /table \u0026gt;',\n '\u0026lt; /Tree \u0026gt;'\n )\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eResults in (multiple lines)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt; Tree \u0026gt;\n\n\u0026lt; Leaf \u0026gt;\n\n\u0026lt; col1 \u0026gt;1\u0026lt; /col1 \u0026gt;\n\n\u0026lt; col2 \u0026gt;2\u0026lt; /col2 \u0026gt;\n\n\u0026lt; col3 \u0026gt;3\u0026lt; /col3 \u0026gt;\n\n\u0026lt; /Leaf \u0026gt;\n\n\u0026lt; Leaf \u0026gt;\n\n\u0026lt; col1 \u0026gt;11\u0026lt; /col1 \u0026gt;\n\n\u0026lt; col2 \u0026gt;22\u0026lt; /col2 \u0026gt;\n\n\u0026lt; col3 \u0026gt;33\u0026lt; /col3 \u0026gt;\n\n\u0026lt; /Leaf \u0026gt;\n\n\u0026lt; Leaf \u0026gt;\n\n\u0026lt; col1 \u0026gt;111\u0026lt; /col1 \u0026gt;\n\n\u0026lt; col2 \u0026gt;222\u0026lt; /col2 \u0026gt;\n\n\u0026lt; col3 \u0026gt;333\u0026lt; /col3 \u0026gt;\n\n\u0026lt; /Leaf \u0026gt;\n\n\u0026lt; /Tree \u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eRequired in(i.e single line statement)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt; Tree \u0026gt; \u0026lt; Leaf \u0026gt; \u0026lt; col1 \u0026gt;1\u0026lt; /col1 \u0026gt; \u0026lt; col2 \u0026gt;2\u0026lt; /col2 \u0026gt; \u0026lt; col3 \u0026gt;3\u0026lt; /col3 \u0026gt; \u0026lt; /Leaf \u0026gt; \u0026lt; Leaf \u0026gt; \u0026lt; col1 \u0026gt;11\u0026lt; /col1 \u0026gt; \u0026lt; col2 \u0026gt;22\u0026lt; /col2 \u0026gt; \u0026lt; col3 \u0026gt;33\u0026lt; /col3 \u0026gt; \u0026lt; /Leaf \u0026gt; \u0026lt; Leaf \u0026gt; \u0026lt; col1 \u0026gt;111\u0026lt; /col1 \u0026gt; \u0026lt; col2 \u0026gt;222\u0026lt; /col2 \u0026gt; \u0026lt; col3 \u0026gt;333\u0026lt; /col3 \u0026gt; \u0026lt; /Leaf \u0026gt; \u0026lt; /Tree \u0026gt; \n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"39615092","answer_count":"1","comment_count":"0","creation_date":"2016-09-21 11:06:31.833 UTC","last_activity_date":"2016-09-21 12:44:08.067 UTC","last_edit_date":"2016-09-21 12:44:08.067 UTC","last_editor_display_name":"","last_editor_user_id":"6464308","owner_display_name":"","owner_user_id":"4299088","post_type_id":"1","score":"1","tags":"postgresql","view_count":"103"} +{"id":"31596368","title":"Call Stored Procedures from Entity Framework return value from temp tables","body":"\u003cp\u003eI am using ASP.NET MVC 4.5 and EF. I imported some stored procedures into my ADO.NET Entity Data Model. I have my \u003ccode\u003e.edmx\u003c/code\u003e and \u003ccode\u003eXX.tt\u003c/code\u003e with my \u003ccode\u003eStoreProcedure_Result.cs\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eBut there is a stored procedure that do not have a \u003ccode\u003e_result.cs\u003c/code\u003e file\u003c/p\u003e\n\n\u003cp\u003eThis is because the stored procedure returns\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e select from #TempTable\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I want to import that function to create a complex type, it sees that the function do not return any value..\u003c/p\u003e\n\n\u003cp\u003eI thinks that return value from temp tables it is not allowed.\u003c/p\u003e\n\n\u003cp\u003eAny ideas how can I solve it?\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2015-07-23 19:24:41.33 UTC","last_activity_date":"2015-07-23 19:29:01.23 UTC","last_edit_date":"2015-07-23 19:29:01.23 UTC","last_editor_display_name":"","last_editor_user_id":"13302","owner_display_name":"","owner_user_id":"3047200","post_type_id":"1","score":"0","tags":"asp.net-mvc|entity-framework|stored-procedures|ado.net-entity-data-model","view_count":"357"} +{"id":"34996765","title":"Renaming a file on a network share using PowerShell","body":"\u003cp\u003eSo I have a SQL job setup to delete a file, then copy the latest, and then the last step is to rename it. The code works fine if I run it directly in a powershell window. However as a job step it fails. It's set to run as the same user that's used for the delete and copy steps. It has full control on the path. The error in the job history just says: 'Invalid Path: '\\1.1.1.1\\Backups\\DB01_PROD_FULL_01252016.bak'.' Which is what $myfile below ends up being.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$mypath='Microsoft.PowerShell.Core\\FileSystem::\\\\1.1.1.1\\Backups\\'\n$myfile=gci $mypath | sort LastWriteTime | select -last 1 -ExpandProperty FullName\nRename-Item -path $myfile -newname 'DB.bak'\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"35001447","answer_count":"1","comment_count":"3","creation_date":"2016-01-25 15:54:27.36 UTC","last_activity_date":"2016-01-25 20:12:17.397 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"704190","post_type_id":"1","score":"0","tags":"powershell","view_count":"409"} +{"id":"13621464","title":"getting match.call() to work with *apply \u0026 plyr? (re: Referencing a dataframe recursively)","body":"\u003cp\u003eThe purpose of the functions below are to allow for self-referencing assignments more easily. (As suggested here: \u003ca href=\"https://stackoverflow.com/questions/13615385/referencing-a-dataframe-recursively/13620608\"\u003eReferencing a dataframe recursively\u003c/a\u003e )\u003c/p\u003e\n\n\u003cp\u003eSo that instead of \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e # this \n myDataFrame$variable[is.na(myDataFrame$variable)] \u0026lt;- 0\n\n # we can have this: \n NAto0(myDataFrame$variable)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe functions work well for vectors, but less so when *ply'ing \u003c/p\u003e\n\n\u003cp\u003eI'm encountering two issues with regards to the \u003ccode\u003ematch.call()\u003c/code\u003e portion of the function \u003ccode\u003eselfAssign()\u003c/code\u003e (code is below). Questions are:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eHow can I determine from within a function if it was called\nfrom an *apply-type function? \u003c/li\u003e\n\u003cli\u003eHow can I trace back up the call\nto the correct variable environment?\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eI've included the argument \u003ccode\u003en\u003c/code\u003e to \u003ccode\u003eselfAssign(.)\u003c/code\u003e which works well for the \u003ccode\u003eeval\u003c/code\u003e statement at the end. I'm wondering if I could somehow make use of \u003ccode\u003en\u003c/code\u003e something akin to \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e sapply(df, NAto0, n=2)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand perhaps in selfAssign have something like \u003ccode\u003esys.parent(n)\u003c/code\u003e (which I tried, and either I did not get it right, or it does not work)\u003c/p\u003e\n\n\u003cp\u003eAny suggestions would greatly appreciated. \u003c/p\u003e\n\n\u003cp\u003e\u003cHR\u003e\u003cHR\u003e\u003c/p\u003e\n\n\u003ch3\u003eFUNCTIONS\u003c/h3\u003e\n\n\u003cp\u003eThese functions are wrappers to selfAssign and are the ones that would be used in the \u003ccode\u003e*apply\u003c/code\u003e calls. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eNAtoNULL \u0026lt;- function(obj, n=1) {\n# replace NA's with NULL\n selfAssign(match.call()[[2]], is.na(obj), NULL, n=n+1)\n}\n\nNAto0 \u0026lt;- function(obj, n=1) {\n# replace NA's with 0\n selfAssign(match.call()[[2]], is.na(obj), 0, n=n+1)\n}\n\nNAtoVal \u0026lt;- function(obj, val, n=1) {\n selfAssign(match.call()[[2]], is.na(obj), val, n=n+1) \n}\n\nZtoNA \u0026lt;- function(obj, n=1) {\n# replace 0's with NA\n\n # TODO: this may have to be modified if obj is matrix\n ind \u0026lt;- obj == 0\n selfAssign(match.call()[[2]], ind, NA, n=n+1)\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003ccode\u003eselfAssign\u003c/code\u003e is the function performing the work and where the error is coming from \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eselfAssign \u0026lt;- function(self, ind, val, n=1, silent=FALSE) {\n## assigns val to self[ind] in environment parent.frame(n)\n## self should be a vector. Currently will not work for matricies or data frames\n\n ## GRAB THE CORRECT MATCH CALL\n #--------------------------------------\n # if nested function, match.call appropriately\n if (class(match.call()) == \"call\") {\n mc \u0026lt;- (match.call(call=sys.call(sys.parent(1)))) ## THIS LINE PROBABLY NEEDS MODIFICATION\n } else {\n mc \u0026lt;- match.call()\n }\n\n # needed in case self is complex (ie df$name)\n mc2 \u0026lt;- paste(as.expression(mc[[2]]))\n\n\n ## CLEAN UP ARGUMENT VALUES\n #--------------------------------------\n # replace logical indecies with numeric indecies\n if (is.logical(ind))\n ind \u0026lt;- which(ind) \n\n # if no indecies will be selected, stop here\n if(identical(ind, integer(0)) || is.null(ind)) {\n if(!silent) warning(\"No indecies selected\")\n return()\n }\n\n # if val is a string, we need to wrap it in quotes\n if (is.character(val))\n val \u0026lt;- paste('\"', val, '\"', sep=\"\")\n\n # val cannot directly be NULL, must be list(NULL)\n if(is.null(val))\n val \u0026lt;- \"list(NULL)\"\n\n\n ## CREATE EXPRESSIONS AND EVAL THEM\n #--------------------------------------\n # create expressions to evaluate\n ret \u0026lt;- paste0(\"'[['(\", mc2, \", \", ind, \") \u0026lt;- \", val)\n\n # evaluate in parent.frame(n)\n eval(parse(text=ret), envir=parent.frame(n))\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"5","creation_date":"2012-11-29 08:18:13.733 UTC","favorite_count":"2","last_activity_date":"2013-12-27 14:15:11.54 UTC","last_edit_date":"2017-05-23 10:24:44.743 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"1492421","post_type_id":"1","score":"3","tags":"r|plyr|apply|assign|sapply","view_count":"277"} +{"id":"37997008","title":"What is the difference between -hivevar and -hiveconf?","body":"\u003cp\u003eFrom hive -h :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e--hiveconf \u0026lt;property=value\u0026gt; Use value for given property\n--hivevar \u0026lt;key=value\u0026gt; Variable subsitution to apply to hive\n commands. e.g. --hivevar A=B\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"41880115","answer_count":"4","comment_count":"0","creation_date":"2016-06-23 16:23:39.34 UTC","last_activity_date":"2017-04-26 20:52:51.07 UTC","last_edit_date":"2016-06-24 07:31:15.677 UTC","last_editor_display_name":"","last_editor_user_id":"2577734","owner_display_name":"","owner_user_id":"3110731","post_type_id":"1","score":"6","tags":"hadoop|hive|hql","view_count":"4381"} +{"id":"27090034","title":"Ajax not working with JSP in username availability","body":"\u003cp\u003eI am trying to check database for username availability. I don't know where it went wrong but it just keep saying \"Checking availability\" and never returns the answer. Below is my code.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003e\u003ccode\u003eindex.jsp\u003c/code\u003e;\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;html\u0026gt;\n\u0026lt;head\u0026gt;\n\u0026lt;title\u0026gt;Username Availability\u0026lt;/title\u0026gt;\n\u0026lt;style type=\"text/css\"\u0026gt;\n.flable {\n color: gray;\n}\n\n.status {\n font-family: verdana;\n font-size: 12px;\n}\n\n.uname {\n color: blue;\n}\n\u0026lt;/style\u0026gt;\n\u0026lt;script type=\"text/javascript\" src=\"http://code.jquery.com/jquery-latest.min.js \"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;script type=\"text/javascript\"\u0026gt;\n $(document).ready(function(){\n $(\".uname\").change(function(){\n var uname = $(this).val();\n if(uname.length \u0026gt;= 3){\n $(\".status\").html(\"\u0026lt;img src='images/loading.gif'\u0026gt;\u0026lt;font color=gray\u0026gt; Checking availability...\u0026lt;/font\u0026gt;\");\n $.ajax({\n type: \"POST\",\n url: \"check\",\n data: \"uname=\"+ uname,\n success: function(msg){\n\n $(\".status\").ajaxComplete(function(event, request, settings){\n\n $(\".status\").html(msg);\n\n });\n }\n }); \n }\n else{\n\n $(\".status\").html(\"\u0026lt;font color=red\u0026gt;Username should be \u0026lt;b\u0026gt;3\u0026lt;/b\u0026gt; character long.\u0026lt;/font\u0026gt;\");\n }\n\n });\n });\n \u0026lt;/script\u0026gt;\n\u0026lt;/head\u0026gt;\n\u0026lt;body\u0026gt;\n \u0026lt;div\u0026gt;\n \u0026lt;label class=\"flable\"\u0026gt;User Name :\u0026lt;/label\u0026gt; \u0026lt;input type=\"text\" class=\"uname\" /\u0026gt;\u0026amp;nbsp;\u0026lt;span class=\"status\"\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;/div\u0026gt;\n\n\u0026lt;/body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003e\u003ccode\u003eCheckAvailibilty.java\u003c/code\u003e:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport java.io.*;\nimport java.sql.*;\nimport javax.servlet.ServletException;\nimport javax.servlet.http.*;\n\npublic class CheckAvailability extends HttpServlet {\n\n private static final long serialVersionUID = -734503860925086969L;\n\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n PrintWriter out = response.getWriter();\n try {\n\n String connectionURL = \"jdbc:mysql://localhost:3306/quora\"; // students is my database name\n Connection connection = null;\n Class.forName(\"com.mysql.jdbc.Driver\").newInstance();\n connection = DriverManager.getConnection(connectionURL, \"root\", \"root\");\n String uname = request.getParameter(\"uname\");\n PreparedStatement ps = connection.prepareStatement(\"select username from users where username=?\");\n ps.setString(1,uname);\n ResultSet rs = ps.executeQuery();\n\n if (!rs.next()) {\n out.println(\"\u0026lt;font color=green\u0026gt;\u0026lt;b\u0026gt;\"+uname+\"\u0026lt;/b\u0026gt; is avaliable\");\n }\n else{\n out.println(\"\u0026lt;font color=red\u0026gt;\u0026lt;b\u0026gt;\"+uname+\"\u0026lt;/b\u0026gt; is already in use\u0026lt;/font\u0026gt;\");\n }\n out.println();\n\n\n\n } catch (Exception ex) {\n\n out.println(\"Error -\u0026gt;\" + ex.getMessage());\n\n } finally {\n out.close();\n }\n }\n\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n doPost(request, response);\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003e\u003ccode\u003eweb.xml\u003c/code\u003e:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;servlet\u0026gt;\n \u0026lt;servlet-name\u0026gt;check\u0026lt;/servlet-name\u0026gt;\n \u0026lt;servlet-class\u0026gt;com.amzi.servlets.CheckAvailability\u0026lt;/servlet-class\u0026gt;\n \u0026lt;/servlet\u0026gt;\n \u0026lt;servlet-mapping\u0026gt;\n \u0026lt;servlet-name\u0026gt;check\u0026lt;/servlet-name\u0026gt;\n \u0026lt;url-pattern\u0026gt;/check\u0026lt;/url-pattern\u0026gt;\n \u0026lt;/servlet-mapping\u0026gt;\n \u0026lt;session-config\u0026gt;\n \u0026lt;session-timeout\u0026gt;\n 30\n \u0026lt;/session-timeout\u0026gt;\n \u0026lt;/session-config\u0026gt;\n \u0026lt;welcome-file-list\u0026gt;\n \u0026lt;welcome-file\u0026gt;index.jsp\u0026lt;/welcome-file\u0026gt;\n \u0026lt;/welcome-file-list\u0026gt;\n \u0026lt;/web-app\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"27091420","answer_count":"1","comment_count":"0","creation_date":"2014-11-23 14:31:51.687 UTC","favorite_count":"2","last_activity_date":"2015-08-29 11:52:16.453 UTC","last_edit_date":"2014-11-23 16:55:42.877 UTC","last_editor_display_name":"","last_editor_user_id":"573032","owner_display_name":"","owner_user_id":"3849878","post_type_id":"1","score":"1","tags":"java|jquery|ajax|jsp|servlets","view_count":"739"} +{"id":"42169556","title":"Read MediaSession inputs from NotificationListenerService","body":"\u003cp\u003eI'm currently trying to automate my Hue Lighting system with Netflix, so that whenever I start a movie/show the light goes off and when I pause it, the light goes back on.\u003c/p\u003e\n\n\u003cp\u003eTo do this I wanted to use a NotificationListenerService. I can read the Netflix Notification just fine, but I can't find any info about how to read the MediaSession information. I can read the Token just fine from the Notification.extras, can I do something with that?\u003c/p\u003e\n\n\u003cp\u003eI think I'd just have to read the icons in the MediaStyle or something like that to see if it's playing or paused?\u003c/p\u003e\n\n\u003cp\u003eThere are lots of attributes in a notification and before I start trying them all out with trial and error, I thought I'd ask here if you guys maybe know how to read the \"Media Status\" from a MediaStyle notification\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-02-10 22:18:06.57 UTC","last_activity_date":"2017-02-10 22:18:06.57 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5635385","post_type_id":"1","score":"0","tags":"android|android-notifications","view_count":"16"} +{"id":"22242239","title":"SimpleInjector RegisterWebApiRequest vs RegisterPerWebRequest","body":"\u003cp\u003eThe latest version of SimpleInjector introduced a distinction between MVC and WebApi. Are the two request registrations aliases for the same thing? Or is there underlying differences as well?\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","accepted_answer_id":"22245565","answer_count":"1","comment_count":"0","creation_date":"2014-03-07 05:27:48.1 UTC","favorite_count":"1","last_activity_date":"2016-11-22 16:31:35.6 UTC","last_edit_date":"2014-03-07 09:09:27.637 UTC","last_editor_display_name":"","last_editor_user_id":"264697","owner_display_name":"","owner_user_id":"2093807","post_type_id":"1","score":"4","tags":"asp.net-web-api|dependency-injection|simple-injector","view_count":"596"} +{"id":"5579047","title":"Block handling in bittorent","body":"\u003cp\u003eFor the work I am currently doing I need similar functionality as Bittorrent, only difference is I need to do some sort of extra analysis on every block received by client from peers. Though I am fairly new with Python, I found official Bittorrent client source code easy to understand (as compared to Transmission's C source code). But I can't seem to figure out the part in the source code where it deals/handles every block received.\nIt'd be great if anyone, who is acquainted with Bittorrent official client source code (or Transmission), can provide me some pointers for the same.\u003c/p\u003e","answer_count":"2","comment_count":"1","creation_date":"2011-04-07 09:42:06.297 UTC","favorite_count":"1","last_activity_date":"2014-09-11 04:10:41.817 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"696518","post_type_id":"1","score":"2","tags":"python|c|bittorrent","view_count":"148"} +{"id":"33920711","title":"Working with AngularJS and jquery.dataTables. Changes do not get updated","body":"\u003cp\u003eHere is the problem, \u003c/p\u003e\n\n\u003cp\u003eI actually try to get AngularJS working with jquery.dataTables. This dataTables looks pretty good and powerful. I found some interesting things about the way to make it work with angularJS and built a jsFiddle with the main ideas.\u003c/p\u003e\n\n\u003cp\u003eI have a table, built dynamically with dataTables, from a global $scope variable. This is working fine. In this table, I have a column with 3 spans : View, Edit and Delete. Each of them sets the current clicked row as the global scope $scope.currentRow variable. This table comes from a directive with isolated scope and controller (+ link).\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eapp.directive ('dtTable', function ($compile) {\n return {\n scope:{\n //whole code in fiddle\n },\n controller:function ($scope, $element) {\n //whole code in fiddle\n },\n link:function ($scope, $element, $attrs, controller){\n //whole code in fiddle\n }\n };\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eUnder the table I have 2 divs, one meant to display the currentRow data, another one to edit (and confirm by click on a button calling a scope function). They come from 2 seperated directives, without isolated scope.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eapp.directive('currentRowViewer',function(){\n return {\n restrict : 'E',\n template : '\u0026lt;div\u0026gt; VIEW CURRENT DATA : \u0026lt;/div\u0026gt;\u0026lt;div\u0026gt; ID : {{currentRow.id}} \u0026lt;/div\u0026gt;\u0026lt;div\u0026gt; DATA A : {{currentRow.dataa}} \u0026lt;/div\u0026gt;\u0026lt;div\u0026gt; DATA B : {{currentRow.datab}} \u0026lt;/div\u0026gt;\u0026lt;br/\u0026gt;\u0026lt;br/\u0026gt;'\n };\n});\n\napp.directive('currentRowEditor',function(){\n return {\n restrict : 'E',\n template : '\u0026lt;div\u0026gt; EDIT CURRENT DATA : \u0026lt;/div\u0026gt;\u0026lt;div\u0026gt; ID : {{currentRow.id}} \u0026lt;/div\u0026gt;\u0026lt;div\u0026gt; DATA A : \u0026lt;input type=\"text\" ng-model=\"currentRow.dataa\" name=\"dataaEditor\"/\u0026gt; \u0026lt;/div\u0026gt;\u0026lt;div\u0026gt; DATA B : \u0026lt;input type=\"text\" ng-model=\"currentRow.datab\" name=\"databEditor\"/\u0026gt; \u0026lt;/div\u0026gt;\u0026lt;div\u0026gt; \u0026lt;button type=\"button\" ng-click=\"confirmEdit(currentRow.index)\"\u0026gt;CONFIRM\u0026lt;/button\u0026gt;\u0026lt;/div\u0026gt;\u0026lt;br/\u0026gt;\u0026lt;br/\u0026gt;'\n };\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNotice that the 2 directives use global scope vars like currentRow.index... to \"show\" current selected data. (they are supposed to do so)\u003c/p\u003e\n\n\u003cp\u003eWhen I click on any of the span, the changes occur and the currentRow data is set. BUT this is not acting like it should since the new data does not appear into the directives under the table! It only does if I do click on something else, like the \"strange-update-thing\" button I added under the whole thing : This button is just supposed to console log a string, but click on it triggers the changes in the view! oO\u003c/p\u003e\n\n\u003cp\u003eThe opposite works(/FAILS) the same way : \u003c/p\u003e\n\n\u003cp\u003eWhen I have data to edit in the edit div under the table. If I do confirm edits, the new data is edited and goes to the table used to generate the dataTable. At that point, the $watchCollection should trigger since the item it watches changes... But it does not and the dataTable is not re-created...\u003c/p\u003e\n\n\u003cp\u003eThe issue probably comes from a misunderstanding on angularJs directives, or a logic problem in my example, but I'm a bit lost...\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eHere is the fiddle I am actually working with :\u003c/strong\u003e \u003ca href=\"http://jsfiddle.net/gea13rp2/1/\" rel=\"nofollow\"\u003ehttp://jsfiddle.net/gea13rp2/1/\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThanks for reading / help\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2015-11-25 15:43:51.167 UTC","last_activity_date":"2015-11-26 09:22:00.01 UTC","last_edit_date":"2015-11-25 18:26:19.707 UTC","last_editor_display_name":"","last_editor_user_id":"3549014","owner_display_name":"","owner_user_id":"3774191","post_type_id":"1","score":"1","tags":"javascript|jquery|html|angularjs|datatables","view_count":"538"} +{"id":"8649764","title":"WCF 4.0 Routing","body":"\u003cp\u003eScenario:\nWe have a WCF 4.0 web service which basically accepts the request and puts the messages to production Queue. We also have same UAT and DEV webservices which puts messages to UAT and DEV Queues.... The problem with this setup is that third party vendor who invokes these web services have only one environment setup on their end. This means they won't be able to invoke DEV or UAT once everything is in Production. This has caused us an issue of not being able to test for any enhancements...\u003c/p\u003e\n\n\u003cp\u003eWe have a requirement to create another layer of WCF 4.0 which acts as a proxy. This basically reads the request message and based on FLAG it then routes the request to either PROD,UAT or DEV.\u003c/p\u003e\n\n\u003cp\u003eCould anyone please suggest how this can be achieved using WCF 4.0? One way I can think of is using proxy of PROD, UAT and DEV and invoke them based on FLAG i mentioned above. This solution I think works but I'm wondering if there's way to achieve above with out creating proxy.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2011-12-27 22:04:05.57 UTC","last_activity_date":"2014-08-10 13:31:10.47 UTC","last_edit_date":"2014-08-10 13:31:10.47 UTC","last_editor_display_name":"","last_editor_user_id":"759866","owner_display_name":"","owner_user_id":"656348","post_type_id":"1","score":"3","tags":"wcf","view_count":"134"} +{"id":"24643744","title":"What kind of Apache access control is recommended when deploying a Django site","body":"\u003cp\u003eI've looked at a number of tutorials, some recommending multiple \u003ca href=\"http://httpd.apache.org/docs/2.2/howto/access.html\" rel=\"nofollow\"\u003eaccess controls\u003c/a\u003e and some none.\u003c/p\u003e\n\n\u003cp\u003eFor example, one I've come across is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;Directory /var/www/myproject\u0026gt;\nOrder allow,deny\nAllow from all\n\u0026lt;/Directory\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThat's the only control I have specified right now. \u003c/p\u003e\n\n\u003cp\u003eI'm revisiting these contorls because one of my Django URLs is returning an HTTP 405 Method Not Allowed.\u003c/p\u003e\n\n\u003cp\u003eWhat directories should be controlled?\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2014-07-09 00:39:49.64 UTC","last_activity_date":"2014-07-09 09:35:59.82 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2199852","post_type_id":"1","score":"0","tags":"django|apache|mod-wsgi","view_count":"52"} +{"id":"30944513","title":"Javascript performance of indexing","body":"\u003cp\u003eIs the following line considered unoptimal, especially considering it is being used in many places or inside of a loop:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar age = myObject[index][\"Person\"][\"Identity\"][\"Bio\"][\"Age\"]\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"30944688","answer_count":"1","comment_count":"2","creation_date":"2015-06-19 18:00:40.493 UTC","favorite_count":"0","last_activity_date":"2015-07-17 20:26:15.783 UTC","last_edit_date":"2015-06-19 18:23:00.247 UTC","last_editor_display_name":"","last_editor_user_id":"1216402","owner_display_name":"","owner_user_id":"158103","post_type_id":"1","score":"0","tags":"javascript|performance","view_count":"34"} +{"id":"13369180","title":"Client-server socket communication","body":"\u003cp\u003e\u003cstrong\u003eProblem\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eHow to send \u003cstrong\u003eUTF-8\u003c/strong\u003e data between the server and the client, if I can use on client only\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003einputStream.read()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eDocs\u003c/strong\u003e\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eReads a single byte from this stream and returns it as an integer in\n the range from 0 to 255. Returns -1 if the end of the stream has been\n reached.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eWithout reader.readLine() and any another. (With reader I cant see end of stream)\u003c/p\u003e\n\n\u003cp\u003eHelp please!\u003c/p\u003e\n\n\u003cp\u003e(full code:)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eint c;\nString str = new String();\nwhile ((c = inputStream.read( )) != -1)\n{\n char ch = (char)c;\n if(ch == '\\n')\n {\n Log.v(\"\", str);\n final String data = str;\n\n runOnUiThread(new Runnable()\n {\n @Override\n public void run()\n {\n String put[] = data.split(\"#\");\n try\n {\n //cmd parsing\n }\n catch(Exception e)\n {\n //stop connection\n }\n }\n });\n str = \"\";\n }else{\n str += Character.toString(ch);\n }\n}\n//Communication error\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHelp please\u003c/p\u003e","accepted_answer_id":"13369675","answer_count":"1","comment_count":"0","creation_date":"2012-11-13 21:32:08.63 UTC","last_activity_date":"2012-11-13 22:06:02.36 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1136218","post_type_id":"1","score":"1","tags":"android|sockets|stream","view_count":"143"} +{"id":"11237936","title":"Mobile Web - Disable long-touch/taphold text selection","body":"\u003cp\u003eI've seen/heard all about disabling text selection with the variations of \u003ccode\u003euser-select\u003c/code\u003e, but none of those are working for the problem I'm having. On Android (and I presume on iPhone), if you tap-and-hold on text, it highlights it and brings up little flags to drag and select text. I need to disable those (see image):\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/JhSpq.png\" alt=\"screenshot\"\u003e\u003c/p\u003e\n\n\u003cp\u003eI've tried \u003ccode\u003e-webkit-touch-callout\u003c/code\u003e to no avail, and even tried things like \u003ccode\u003e$('body').on('select',function(e){e.preventDefault();return;});\u003c/code\u003e to no avail. And the cheap tricks like \u003ccode\u003e::selection:rgba(0,0,0,0);\u003c/code\u003e won't work either, as hiding these won't help - selection still happens and it disrupts the UI. Plus I'm guessing those flags would still be there.\u003c/p\u003e\n\n\u003cp\u003eAny thoughts would be great. Thanks!\u003c/p\u003e","accepted_answer_id":"11368321","answer_count":"3","comment_count":"1","creation_date":"2012-06-28 04:07:11.987 UTC","favorite_count":"13","last_activity_date":"2015-05-10 13:37:26.13 UTC","last_edit_date":"2012-06-28 05:40:50.393 UTC","last_editor_display_name":"","last_editor_user_id":"1148769","owner_display_name":"","owner_user_id":"1148769","post_type_id":"1","score":"17","tags":"android|iphone|css|mobile|highlight","view_count":"27726"} +{"id":"5368821","title":"How does Google predict our words?","body":"\u003cblockquote\u003e\n \u003cp\u003e\u003cstrong\u003ePossible Duplicate:\u003c/strong\u003e\u003cbr\u003e\n \u003ca href=\"https://stackoverflow.com/questions/3670831/how-does-google-instant-work\"\u003eHow does Google Instant work?\u003c/a\u003e \u003c/p\u003e\n\u003c/blockquote\u003e\n\n\n\n\u003cp\u003eOften we use Google to search any content, but when we type any word in the text box of Google's engine, Google tries to predict the word or even recently it uses \u003ca href=\"http://en.wikipedia.org/wiki/Google_Search#Instant_Search\" rel=\"nofollow noreferrer\"\u003eGoogle Instant Search\u003c/a\u003e to produce the result on the fly. How does this work? \u003c/p\u003e\n\n\u003cp\u003eThat is without even the user have pressed the \u003cstrong\u003esearch\u003c/strong\u003e button, how does server send the result immediately? Because as a user we haven't \u003cstrong\u003erequested\u003c/strong\u003e for the result, but still server produce a result, how has this been implemented?\u003c/p\u003e","accepted_answer_id":"5368876","answer_count":"3","comment_count":"2","creation_date":"2011-03-20 13:37:56.667 UTC","last_activity_date":"2013-12-29 07:17:50.36 UTC","last_edit_date":"2017-05-23 12:19:53.817 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"576682","post_type_id":"1","score":"5","tags":"google-instant","view_count":"1647"} +{"id":"38399749","title":"Uncaught TypeError: Cannot read property 'forEach' of undefined in javascript / React-router / React","body":"\u003cp\u003eCan anybody please help with this error in java script. I am using React router to display various components of the pages. Among those one of the components is 'forEach'. The console is giving issue with \"forEach\" property. What is the problem ? Have included this js file into the main html file.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar ProductTable = React.createClass({\n render: function() {\n var rows = [];\n var lastCategory = null;\n this.props.products.forEach(function(product) {\n if (product.name.indexOf(this.props.filterText) === -1 || (!product.stocked \u0026amp;\u0026amp; this.props.inStockOnly)) {\n return ;\n }\n if (product.category !== lastCategory) {\n rows.push(React.createElement(ProductCategoryRow, { category: product.category, key: product.category }));\n }\n rows.push(React.createElement(ProductRow, { product: product, key: product.name }));\n lastCategory = product.category;\n }.bind(this));\n return (\n React.createElement(\"table\",null,\n React.createElement(\"thead\",null,\n React.createElement(\"tr\",null,\n React.createElement(\"th\",null,\"Name\"),\n React.createElement(\"th\",null,\"Price\")\n )\n ),\n React.createElement(\"tbody\",null,rows)\n )\n )\n }\n });\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"4","creation_date":"2016-07-15 15:20:45.237 UTC","last_activity_date":"2016-07-15 15:39:43.48 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6381064","post_type_id":"1","score":"1","tags":"javascript|reactjs","view_count":"971"} +{"id":"43760322","title":"How to translate a country list in a django views.py?","body":"\u003cp\u003eI am using django and the standard internationalization package as showed in the : \u003ca href=\"http://www.marinamele.com/taskbuster-django-tutorial/internationalization-localization-languages-time-zones\" rel=\"nofollow noreferrer\"\u003eexcellent marina mele tuto.\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eIn a user's form on web and mobile i have to show a list of country names in the \u003cstrong\u003euser's language\u003c/strong\u003e.\u003c/p\u003e\n\n\u003cp\u003eTo create the country list, i intend to use django-country it seems easy and well documented.\u003c/p\u003e\n\n\u003cp\u003eI could do one API, no template, to request the list of countries.\u003c/p\u003e\n\n\u003cp\u003eBut How to translate this country list in the views.py ?\u003c/p\u003e\n\n\u003cp\u003eAny example would be welcome.\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","answer_count":"3","comment_count":"0","creation_date":"2017-05-03 12:40:44.303 UTC","last_activity_date":"2017-05-03 14:27:49.053 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3872003","post_type_id":"1","score":"0","tags":"python|django|internationalization|django-countries","view_count":"93"} +{"id":"28956363","title":"Objective C protocol method is not called","body":"\u003cp\u003eI have created singleton class for AVAudioPlayer. I am able to call the methods in the class and everything works fine. When the song finishes,the method (void)audioPlayerDidFinishPlaying is called which in turn suppose to call the method ' processSuccessful' in my downloadPlay.m class. But, it is not calling the method 'processSuccessful'\u003c/p\u003e\n\n\u003cp\u003eMy codes as follows\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ePlayerManager.h \n\n#import \u0026lt;Foundation/Foundation.h\u0026gt;\n#import \u0026lt;AudioToolbox/AudioToolbox.h\u0026gt;\n#import \u0026lt;AVFoundation/AVFoundation.h\u0026gt;\n\n@protocol ProcessDataDelegate \u0026lt;NSObject\u0026gt;\n@required\n- (void) processSuccessful;\n@end\n\n@interface PlayerManager : NSObject\u0026lt;AVAudioPlayerDelegate,AVAudioSessionDelegate\u0026gt;\n{\n id \u0026lt;ProcessDataDelegate\u0026gt; delegate;\n}\n+ (PlayerManager *)sharedAudioPlayer;\n@property (nonatomic,assign) id \u0026lt;ProcessDataDelegate\u0026gt;delegate;\n@property (nonatomic, strong) AVAudioPlayer* player;\n-(void)preparesong:(NSURL *)url;\n-(void)stopsong;\n-(void)pause;\n-(void)playsong;\n-(void)prepareToPlay;\n-(BOOL)isPlaying;\n-(BOOL)isPlayerExist;\n@end\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ePlayerManager.m\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#import \"PlayerManager.h\"\n\n@interface PlayerManager()\n@end\n\n@implementation PlayerManager\n@synthesize player;\n@synthesize delegate;\n\nstatic PlayerManager *sharedAudioPlayer = nil;\n+ (PlayerManager *)sharedAudioPlayer {\n static PlayerManager *sharedAudioPlayer = nil;\n static dispatch_once_t onceToken;\n dispatch_once(\u0026amp;onceToken, ^{\n sharedAudioPlayer = [[self alloc] init];\n });\n return sharedAudioPlayer ;\n}\n\n- (void)audioPlayerEndInterruption:(AVAudioPlayer *)player withOptions:(NSUInteger)flags\n{\n\n if (flags \u0026amp; AVAudioSessionInterruptionOptionShouldResume)\n {\n [self.player play];\n\n }\n}\n- (void)audioPlayerBeginInterruption:(AVAudioPlayer *)player\n{\n\n}\n#pragma mark - AVAudioPlayerDelegate\n- (void)audioPlayerDidFinishPlaying:(AVAudioPlayer *)player successfully:(BOOL)flag\n{\n [[self delegate] processSuccessful];\n}\n\n- (void)audioPlayerDecodeErrorDidOccur:(AVAudioPlayer *)player error:(NSError *)error\n{\n\n}\n\n-(void)preparesong:(NSURL *)url\n{\n [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];\n NSError *error;\n self.player = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:\u0026amp;error];\n if(!self.player)\n {\n NSLog(@\"Error creating player: %@\", error);\n }\n self.player.delegate = self;\n [self.player prepareToPlay];\n\n}\n-(BOOL)isPlayerExist\n{\n if (player)\n return YES;\n return NO;\n\n}\n-(BOOL)isPlaying\n{\n if (player \u0026amp;\u0026amp; player.playing)\n return YES;\n return NO;\n\n}\n-(void)prepareToPlay\n{\n if (player)\n [self.player prepareToPlay];\n}\n-(void)playsong\n{\n if (player)\n [self.player play];\n\n}\n-(void)pause\n{\n if (player.playing)\n [self.player pause];\n\n}\n-(void)stopsong\n{\n if (player)\n [self.player stop];\n}\n@end\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003edownloadPlay.h\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#import \u0026lt;UIKit/UIKit.h\u0026gt;\n#import \u0026lt;AudioToolbox/AudioToolbox.h\u0026gt;\n#import \u0026lt;AVFoundation/AVFoundation.h\u0026gt;\n#import \"PlayerManager.h\"\n@interface downloadPlay: UIViewController \u0026lt;UITableViewDelegate,AVAudioPlayerDelegate,ProcessDataDelegate\u0026gt;\n{\n PlayerManager *protocolPlay;\n}\n\n@property (retain, nonatomic) IBOutlet UITableView *tblFiles;\n......\n- (void)startPlay:(id)sender;\n\n........\n@end\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003edownloadPlay.m\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport \"downloadPlay.h\"\n#import \"PlayerManager.h\"\n\n@interface downloadPlay ()\n\n@end\n\n@implementation downloadPlay\n.....\n\n- (void)processSuccessful\n{\n NSLog(@\"This method suppose to be called from the method audioPlayerDidFinishPlaying - from PlayerManager\");\n}\n\n- (void)viewDidLoad\n{\n\n [super viewDidLoad];\n // Do any additional setup after loading the view, typically from a nib.\n protocolPlay = [[PlayerManager alloc]init];\n [protocolPlay setDelegate:self];\n\n}\n\n- (void)startPlay\n{\n ............\n .........\n NSURL *destinationURL = [self.docDirectoryURL URLByAppendingPathComponent:filename];\n NSError* error = nil;\n [[PlayerManager sharedAudioPlayer]stopsong];\n [[PlayerManager sharedAudioPlayer ] preparesong:destinationURL ];\n [[PlayerManager sharedAudioPlayer]playsong];\n}\n\n@end\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"28956869","answer_count":"1","comment_count":"0","creation_date":"2015-03-10 04:48:16.44 UTC","last_activity_date":"2015-03-10 05:48:28.433 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1157801","post_type_id":"1","score":"0","tags":"objective-c|singleton|protocols|avaudioplayer","view_count":"80"} +{"id":"23402217","title":"How to add mouseover tooltip in google charts sankey diagram","body":"\u003cp\u003eand have been using Google Charts to visualize my data. I have tried to search for the answer to this question but couldn't not find anyone having the same problem as mine, or maybe my problem is really basic. Appreciate if someone can give me a hand.\u003c/p\u003e\n\n\u003cp\u003eI built a sankey diagram by following the steps listed in Google Charts - Sankey Diagram.\nHere is my chart:\n\u003ca href=\"http://kuangkeng.github.io/keng-data-journalism/procurement%20project/sankey/index.html\" rel=\"nofollow\"\u003ehttp://kuangkeng.github.io/keng-data-journalism/procurement%20project/sankey/index.html\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eHowever I would like to add tooltip to each line/path/link so when users mouseover, they can see the value and other details of the line.\u003c/p\u003e\n\n\u003cp\u003eAccording to Google Charts (the link above), I can fire a mouseover event using 'onmouseover' and 'onmouseout', but Google Charts does not show how to do it for Sankey diagram.\u003c/p\u003e\n\n\u003cp\u003eI then came over an example of using 'onmouseover' and 'onmouseout' in a Google Bar Chart:\n\u003ca href=\"https://developers.google.com/chart/interactive/docs/examples#mouseovertooltip\" rel=\"nofollow\"\u003ehttps://developers.google.com/chart/interactive/docs/examples#mouseovertooltip\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eSo I copied the code, modified and pasted into my code.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003egoogle.visualization.events.addListener(chart, 'onmouseover', barMouseOver);\ngoogle.visualization.events.addListener(chart, 'onmouseout', barMouseOut);\n\nfunction barMouseOver(e) {\nchart.setSelection([e]);\n}\n\nfunction barMouseOut(e) {\nchart.setSelection([{'row': null, 'column': null}]);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I mouseover, I got the error message \"undefined is not a function\". You can see the error message appears at the top of the chart when you mouseover the lines.\u003c/p\u003e\n\n\u003cp\u003eI tried to use another alternative showed by Google Charts documentation by adding a another column to my data and set its role as 'tooltip' but it didn't work for my chart because Google Sankey Diagram can only accept 3 columns.\u003c/p\u003e\n\n\u003cp\u003eAppreciate if someone can have a look or refer me to any solution available. Thanks.\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2014-05-01 04:54:05.407 UTC","last_activity_date":"2015-01-08 15:52:05.777 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3591660","post_type_id":"1","score":"2","tags":"google-visualization|onmouseover|onmouseout|sankey-diagram","view_count":"2619"} +{"id":"32023449","title":"Program not reading from Binary file","body":"\u003cp\u003eI'm trying to create a test program for a project that I'm doing in school.\nOne important aspect of my project is to have a login system. \nIn \u003ccode\u003eint main()\u003c/code\u003e I have a menu which calls \u003ccode\u003elogin();\u003c/code\u003e or \u003ccode\u003ecreateAccount();\u003c/code\u003e based on the users choice. \u003ccode\u003elogin();\u003c/code\u003e further calls \u003ccode\u003eloginToken();\u003c/code\u003e to generate \u003ccode\u003eint authToken\u003c/code\u003e with value \u003ccode\u003e0\u003c/code\u003e or \u003ccode\u003e1\u003c/code\u003e. It calls \u003ccode\u003eloginAuth()\u003c/code\u003e which in turn checks the value of \u003ccode\u003eauthToken\u003c/code\u003e and authenticates the login.\nIn \u003ccode\u003eint main();\u003c/code\u003e when I call \u003ccode\u003ecreateAccount()\u003c/code\u003e it writes the the vales or \u003ccode\u003enewUsername\u003c/code\u003e and \u003ccode\u003enewPassword\u003c/code\u003e into a binary file \u003ccode\u003eaccounts.bin\u003c/code\u003e. However, when I call \u003ccode\u003elogin()\u003c/code\u003e the \u003ccode\u003eif\u003c/code\u003e condition I made to check whether \u003ccode\u003eloginEntry\u003c/code\u003e is open says that it is closed, even though I just opened it the line before.\u003c/p\u003e\n\n\u003cp\u003eI'd appreciate some help because this has been bothering me for days. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include\u0026lt;iostream\u0026gt;\n#include\u0026lt;string.h\u0026gt;\n#include\u0026lt;fstream\u0026gt;\n#include \u0026lt;limits\u0026gt;\n\nusing namespace std;\n\nclass Account{\n private:\n\n char enteredUsername[20];\n char enteredPassword[20];\n int authToken;\n char newUsername[20]; \n char newPassword[20];\n ofstream loginDetails;\n ifstream loginEntry;\n\n public: \n void login(){ // to enter username or password\n cin.ignore(std::numeric_limits\u0026lt;std::streamsize\u0026gt;::max(), '\\n'); //to clear cin buffer\n\n loginEntry.open(\"account.bin\", ios::in|ios::binary); // to read newUsername and newPassword\n if (!loginDetails.is_open()) { //to check whether file is open or not\n cout\u0026lt;\u0026lt;\"File not open\";\n }\n else {\n loginEntry.read(newUsername,sizeof(newUsername));\n loginEntry.read(newPassword,sizeof(newPassword));\n }\n loginEntry.close();\n\n cout\u0026lt;\u0026lt;\"\\nEnter Username: \";\n cin.getline(enteredUsername, sizeof(enteredUsername));\n cout\u0026lt;\u0026lt;\"\\nEnter Password: \";\n cin.getline(enteredPassword, sizeof(enteredPassword));\n loginToken(); \n }\n void loginToken(){ // to generate login token if enteredUsername and enteredPassword match newUsername and newPassword in account.bin \n\n if(strcmp(enteredUsername,\"user\")==0 \u0026amp;\u0026amp; strcmp(enteredPassword,\"admin\")==0)\n authToken=1;\n\n else\n authToken=0;\n\n loginAuth(); // to check value of login token and allow or deny access\n }\n void loginAuth(){ \n if(authToken==1)\n cout\u0026lt;\u0026lt;\"Login succesfull!!\";\n else\n cout\u0026lt;\u0026lt;\"Login Failed. Returning to Menu\";\n\n getchar();\n }\n void createAccount(){ // to create newUsername and newPassword which are saved in account.bin\n cin.ignore(numeric_limits\u0026lt;streamsize\u0026gt;::max(), '\\n'); //to clear cin buffer\n\n cout\u0026lt;\u0026lt;\"\\nEnter new Username: \"; \n cin.getline(newUsername,sizeof(newUsername));\n cout\u0026lt;\u0026lt;\"\\nEnter new Password: \";\n cin.getline(newPassword,sizeof(newPassword)); \n\n loginDetails.open(\"account.bin\", ios::out|ios::binary); //writing in account.bin\n\n loginDetails.write(newUsername, sizeof(enteredUsername));\n loginDetails.write(newPassword, sizeof(enteredPassword));\n\n loginDetails.close();\n cout\u0026lt;\u0026lt;\"\\nYour account has been created. Returning to Menu\";\n getchar();\n }\n}; \n\nint main(){\nAccount test;\nint userChoice;\n\ndo{\n system(\"cls\");\n cout\u0026lt;\u0026lt;\"Welcome to xyz.com\";\n cout\u0026lt;\u0026lt;\"\\n*Press 1 to Login\\n*Not a memeber? Press 2 to create an account and be awesome!!\\n*If you're tired, press 3 to leave \"\u0026lt;\u0026lt;endl; \n cin\u0026gt;\u0026gt;userChoice;\n\n switch(userChoice){\n case 1:{\n test.login();\n break; \n }\n case 2:{\n test.createAccount();\n break;\n }\n }\n}while(userChoice!=3);\n\ncout\u0026lt;\u0026lt;\"GoodBye!! :)\";\nreturn 0;\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"32023590","answer_count":"1","comment_count":"2","creation_date":"2015-08-15 09:36:31.503 UTC","last_activity_date":"2015-08-15 10:41:09.937 UTC","last_edit_date":"2015-08-15 10:41:09.937 UTC","last_editor_display_name":"","last_editor_user_id":"5229827","owner_display_name":"","owner_user_id":"5229827","post_type_id":"1","score":"-3","tags":"c++|class|binaryfiles","view_count":"57"} +{"id":"11974190","title":"How to get subsites that a logged user has access in sharepoint 2010","body":"\u003cp\u003eI need to retrieve subsites that user has access using Client Object Model. \u003c/p\u003e\n\n\u003cp\u003eHere's what I've got:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e NetworkCredential credential = new NetworkCredential(user, pwd, domain);\n ClientContext clientContext = new ClientContext(string.Format(\"http://{0}:{1}/\", server, port));\n clientContext.Credentials = credential;\n\n Web oWebsite = clientContext.Web;\n\n clientContext.Load(oWebsite, website =\u0026gt; website.Webs, website =\u0026gt; website.Title);\n clientContext.ExecuteQuery();\n\n infos = new List\u0026lt;Infos\u0026gt;();\n\n Infos info = null;\n\n for (int i = 0; i != oWebsite.Webs.Count; i++)\n {\n info = new Infos();\n\n info.SubSite = oWebsite.Webs[i].Title;\n info.UrlSubSite = oWebsite.Webs[i].ServerRelativeUrl;\n\n ListCollection lists = oWebsite.Webs[i].Lists;\n clientContext.Load(lists);\n clientContext.ExecuteQuery();\n\n foreach (var list in lists)\n {\n Lists myList = new Lists();\n myList.Title = list.Title;\n\n info.Listas.Add(myList);\n }\n\n infos.Add(info);\n }\n\n var query = from Infos i in infos\n select i.SubSite;\n\n return query.ToList();\n }\n catch(Exception ex)\n {\n throw ex;\n }\n\n return null;\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e=====\u003c/p\u003e\n\n\u003cp\u003eUsing this code, I'm getting an \u003cstrong\u003e403 forbidden error\u003c/strong\u003e. My client user doesn't have access on the root site (that I`m using in ClientContext constructor). But he has under some subsites. I need to get the subsites that he has access (just list them all), using Client Object Model.\u003c/p\u003e\n\n\u003cp\u003eIs there another way?\u003c/p\u003e","accepted_answer_id":"17487903","answer_count":"1","comment_count":"3","creation_date":"2012-08-15 17:34:08.753 UTC","last_activity_date":"2013-07-05 11:32:17.53 UTC","last_edit_date":"2012-08-17 07:11:32.783 UTC","last_editor_display_name":"","last_editor_user_id":"366898","owner_display_name":"","owner_user_id":"1384539","post_type_id":"1","score":"1","tags":"c#|sharepoint-2010|client-object-model","view_count":"3020"} +{"id":"28439538","title":"Typescript: is there a way to restrict something to just a javascript 'object' type?","body":"\u003cp\u003eI thought using the type \u003ccode\u003eObject\u003c/code\u003e would do it, but that still allows anything. I want something like this: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction foo(arg: /* what goes here? */) { }\n\nfoo({}) // should compile\nfoo({ something: 'anything'}) // should compile\nfoo(new Object()) // should compile\n\nfoo(7) // should not compile\nfoo('hello') // should not compile\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"28440333","answer_count":"1","comment_count":"0","creation_date":"2015-02-10 18:53:33.013 UTC","last_activity_date":"2015-02-10 19:36:22.893 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4499972","post_type_id":"1","score":"0","tags":"typescript","view_count":"134"} +{"id":"22526026","title":"Reduce decimal value in label","body":"\u003cp\u003eI have a label that shows too many decimal values. \u003c/p\u003e\n\n\u003cp\u003eFor example, \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etextbox1 = 22 \ntextbox2 = 7 \nlabel1 = textbox2/textbox1\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want \u003ccode\u003elabel1\u003c/code\u003e turn to 31.8 but it always turn to 31.8181811818181818881 \u003c/p\u003e\n\n\u003cp\u003eI have already tried:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Dim label1 As String\n label1 = (CInt(Me.textbox2.Text) / CInt(Me.textbox1.Text)) * 100\n Format(label1, \"0.00\")\n Form3.label1.Text = label1 + \" %\" \n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"22526939","answer_count":"4","comment_count":"3","creation_date":"2014-03-20 07:18:36.693 UTC","last_activity_date":"2014-03-20 09:30:43.6 UTC","last_edit_date":"2014-03-20 07:43:35.82 UTC","last_editor_display_name":"","last_editor_user_id":"3077969","owner_display_name":"","owner_user_id":"3287496","post_type_id":"1","score":"1","tags":"vb.net|label|decimal","view_count":"2088"} +{"id":"24510027","title":"converting white space into line break","body":"\u003cp\u003eIs it possible to add a line break on each white space using CSS?\u003c/p\u003e\n\n\u003cp\u003eFor example, if I have string \u003ccode\u003e\"Format It\"\u003c/code\u003e I would like to display it like\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eFormat\nIt\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eusing CSS.\u003c/p\u003e","answer_count":"2","comment_count":"6","creation_date":"2014-07-01 12:15:02.097 UTC","favorite_count":"0","last_activity_date":"2014-08-18 16:25:07.217 UTC","last_edit_date":"2014-08-18 16:20:04.07 UTC","last_editor_display_name":"","last_editor_user_id":"20578","owner_display_name":"","owner_user_id":"3733648","post_type_id":"1","score":"5","tags":"css|css3","view_count":"594"} +{"id":"20206203","title":"Cannot run Oberon program in xds","body":"\u003cp\u003eI am trying to run Hello World program in Oberon in XDS compiler. \u003c/p\u003e\n\n\u003cp\u003eI can compile the hello.ob2 file, I can make hello.ob2, however when I press run it says that there is no hello.exe file.\u003c/p\u003e\n\n\u003cp\u003eI found at XDS manual that we have to do linking. It is not clear how to link it in GUI, but it is possible to do it via command line: xlink /sys=c /name=hello hello.obj d:\\xds\\lib\\x86\\libxds.lib.\u003c/p\u003e\n\n\u003cp\u003eWell, I did this using git bash, however the response is Error(0): unable to open sys=c.obj\u003c/p\u003e\n\n\u003cp\u003eI read at manual also that \"The compiler, when invoked in the PROJECT mode, may automatically produce a response file and invoke the link\". So, I assumed that Project mode means creating a new project.\u003c/p\u003e\n\n\u003cp\u003eSo, I create a new project. And now, when I run the project it says:\"No modules are in the project\".\u003c/p\u003e\n\n\u003cp\u003eCan somebody tell me how I can run this project?\u003c/p\u003e\n\n\u003cp\u003eOr may be you can recommend me other compiler with simple and clear documentation?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-11-26 00:18:06.22 UTC","favorite_count":"0","last_activity_date":"2014-02-04 17:03:50.273 UTC","last_edit_date":"2014-02-04 17:03:50.273 UTC","last_editor_display_name":"","last_editor_user_id":"321731","owner_display_name":"","owner_user_id":"2530596","post_type_id":"1","score":"0","tags":"oberon","view_count":"107"} +{"id":"1868769","title":"Zend Framework: How to retrieve the id of the last inserted row?","body":"\u003cp\u003eI'm inserting a new row into my database with this code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$data = array(\n 'key' =\u0026gt; 'value'\n);\n$this-\u0026gt;getDbTable()-\u0026gt;insert($data);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow can I get the row id of the this row that I just created?\u003c/p\u003e","answer_count":"4","comment_count":"0","creation_date":"2009-12-08 18:04:26.81 UTC","last_activity_date":"2014-01-13 08:54:27.32 UTC","last_edit_date":"2009-12-08 22:58:14.74 UTC","last_editor_display_name":"","last_editor_user_id":"70393","owner_display_name":"","owner_user_id":"48523","post_type_id":"1","score":"12","tags":"php|zend-framework|zend-db|zend-db-table","view_count":"28475"} +{"id":"5192449","title":"how to create and use zend framework model like codeigniter?","body":"\u003cp\u003eBoth frameworks have seperate Model, View, Controller directories. My doubt is how to use model in Zend Framework.\u003c/p\u003e\n\n\u003cp\u003e[ CodeIgniter Controller ]\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\nclass Users extends CI_Controller\n{\n function __construct()\n {\n parent::__construct();\n $this-\u0026gt;load-\u0026gt;model('users_model');\n }\n\n function index()\n {\n // here i am using model function //\n $this-\u0026gt;user_model-\u0026gt;login();\n }\n}\n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e[ Zend Framework Controller ]\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\nclass UsersController extends Zend_Controller_Action\n{\n public function indexAction()\n {\n // how to load model and use here ???? //\n }\n}\n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn CodeIgniter Controller I load model \"users+_model\" and used in index function. In the same way how to create zend model and use in controller? please help me, I am sorry my english is not good.\u003c/p\u003e\n\n\u003cp\u003eThanks friends,\nRajendra\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2011-03-04 10:20:06.707 UTC","last_activity_date":"2011-03-07 03:41:53.057 UTC","last_edit_date":"2011-03-04 15:39:33.387 UTC","last_editor_display_name":"","last_editor_user_id":"368375","owner_display_name":"","owner_user_id":"644529","post_type_id":"1","score":"0","tags":"zend-framework|codeigniter|model|controller","view_count":"723"} +{"id":"47029450","title":"How to create contact form and mail to the owner of website","body":"\u003cp\u003eI want to get customers details through contact form and that would be sent to my mail id. so I am trying to code but its not working. I have tried by watching YouTube videos\u003c/p\u003e\n\n\u003cp\u003eThis is my HTML Code \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;!DOCTYPE html\u0026gt;\n\u0026lt;html\u0026gt;\n\u0026lt;head\u0026gt;\n \u0026lt;title\u0026gt;Form\u0026lt;/title\u0026gt;\n\u0026lt;/head\u0026gt;\n\u0026lt;body\u0026gt;\n\u0026lt;form action=\"send.php\" method=\"POST\"\u0026gt;\nName: \u0026lt;input type=\"text\" name=\"name\" required=\"\"\u0026gt;\u0026lt;/input\u0026gt;\u0026lt;br\u0026gt;\u0026lt;br\u0026gt;\nMobile: \u0026lt;input type=\"text\" required=\"\" name=\"mobile\"\u0026gt;\u0026lt;/input\u0026gt;\u0026lt;br\u0026gt;\u0026lt;br\u0026gt;\nMessage: \u0026lt;textarea rows=\"10\" cols=\"50\" name=\"mes\" required=\"\"\u0026gt;\u0026lt;/textarea\u0026gt;\u0026lt;br\u0026gt;\u0026lt;br\u0026gt;\n\u0026lt;input type=\"submit\" value=\"Send Mail\"\u0026gt;\u0026lt;/input\u0026gt;\n\n\u0026lt;/form\u0026gt;\n\u0026lt;/body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is my PHP Code\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\n$name =$_POST['name'];\n$mobile =$_POST['mobile'];\n$mes =$_POST['mes'];\nmail(\"imjeevajk@gmail.com\",\"Contact From Site\",$mes,\"From: $name\\r\\n\",\"Mobile: $mobile\\r\\n\");\necho \"Thanks for Contacting Us\"; \n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"4","comment_count":"1","creation_date":"2017-10-31 06:52:26.47 UTC","favorite_count":"1","last_activity_date":"2017-10-31 07:48:37.377 UTC","last_edit_date":"2017-10-31 06:57:48.65 UTC","last_editor_display_name":"","last_editor_user_id":"2943403","owner_display_name":"","owner_user_id":"7163321","post_type_id":"1","score":"0","tags":"php|email|sendmail|contact-form","view_count":"30"} +{"id":"42014410","title":"jquery mobile responsive panel: open left and right panels at the same time","body":"\u003cp\u003eFor jquery mobile responsive panel on a big wide screen, left and right panels should be allowed to be opened at the same time. But currently 1.4.5, only one panel can stay open. opening one panel will close the other. Obviously this is not ideal. There is a way to keep both panels open at the same time for responsive panel?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"ui-page ui-responsive-panel\"\u0026gt;\n\n \u0026lt;div class=\"ui-panel\" data-position=\"left\"\u0026gt;\n\n \u0026lt;/div\u0026gt;\n\n \u0026lt;div class=\"ui-panel\" data-position=\"right\"\u0026gt;\n\n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-02-02 23:45:01.253 UTC","last_activity_date":"2017-02-02 23:45:01.253 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4028143","post_type_id":"1","score":"1","tags":"jquery-mobile|panel|responsive","view_count":"59"} +{"id":"9785621","title":"passing parameter from main report to subReport According To Row in JasperSoft iReport","body":"\u003cblockquote\u003e\n \u003cp\u003e\u003cstrong\u003ePossible Duplicate:\u003c/strong\u003e\u003cbr\u003e\n \u003ca href=\"https://stackoverflow.com/questions/2310188/jasperreports-how-to-pass-parameter-to-subreport\"\u003eJasperReports: How to pass parameter to subReport\u003c/a\u003e \u003c/p\u003e\n\u003c/blockquote\u003e\n\n\n\n\u003cp\u003eI have one sub Report inside the main Report. Now I have to pass parameter from the mainReport to the sub Report. I have uploaded an image to make it clear. As shown in the image I have to pass the loanId as the parameter to the subReport. I have used a parameter named Id which holds the value of the LoanId of the main Report. The parameter Id keeps changing according to the main Report's LoanId data and I have used this parameter in the where Condition of the subReport. How is it possible to pass the parameter which changes according to row from the main report to the sub report. Thanks .. !\u003cimg src=\"https://i.stack.imgur.com/uq6wO.jpg\" alt=\"enter image description here\"\u003e\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2012-03-20 11:10:10.14 UTC","last_activity_date":"2012-03-20 19:53:45.99 UTC","last_edit_date":"2017-05-23 12:13:29.27 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"871307","post_type_id":"1","score":"1","tags":"jasper-reports|ireport","view_count":"4067"} +{"id":"972874","title":"FXCop - Referenced assembly could not be found","body":"\u003cp\u003eI'm trying to use Microsoft FXCop Version 1.36 on a compact edition application but when I analyze the project I get the following error.\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eThe following referenced assembly\n could not be found. This assembly is\n required for analysis and was\n referenced by application.exe\u003c/p\u003e\n \n \u003cp\u003eSystem.Windows.Forms, Version=3.5.0.0,\n Culture=neutral,\n PublicKeyToken=969db8053d3322ac,\n Retargetable=Yes\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eIt allows me to browse to find the assembly but it won't let me select the one in the GAC.\u003c/p\u003e\n\n\u003cp\u003eThis assembly is in the GAC and the application itself works fine. Do I need to do something special to get FX Cop to find it?\u003c/p\u003e\n\n\u003cp\u003eUpdate: I've tried setting \"Search Global Assembly Cache for missing references\" under project options\u003c/p\u003e","answer_count":"2","comment_count":"1","creation_date":"2009-06-09 22:45:39.223 UTC","last_activity_date":"2011-03-15 06:16:07.23 UTC","last_edit_date":"2009-06-09 23:05:44.38 UTC","last_editor_display_name":"","last_editor_user_id":"74652","owner_display_name":"","owner_user_id":"74652","post_type_id":"1","score":"3","tags":".net|fxcop","view_count":"3005"} +{"id":"16968941","title":"Add a button on the NestedList toolbar (right aligned)","body":"\u003cp\u003eI'm trying to add a button (right aligned) on the toolbar of a nestedlist. Here is my code :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eExt.define('Test.view.NestedList', {\nextend: 'Ext.Panel',\n\nrequires: ['Ext.dataview.NestedList'],\n\nxtype: 'mynestedlist',\n\nconfig: {\n modal: true,\n centered: true,\n layout:'fit',\n width:'80%',\n height:'80%',\n items: [{\n xtype: 'nestedlist',\n fullscreen: true,\n title: 'Groceries',\n displayField: 'text',\n store: 'MyTreeStore',\n initialize: function(){\n console.log(\"Add the button on the toolbar\");\n this.getToolbar().add({xtype: 'spacer'});\n this.getToolbar().add({xtype: 'button', iconCls: 'compose', ui: 'plain', action: ''}); \n }\n }]\n\n}\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe button does not align to the right of the toolbar but appears to the left.\nDoes anyone have an idea to make this ?\u003c/p\u003e\n\n\u003cp\u003eThank you\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-06-06 17:57:11.007 UTC","last_activity_date":"2013-06-14 23:12:13.737 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2460786","post_type_id":"1","score":"0","tags":"sencha-touch-2|toolbar|nested-lists|sencha-touch-2.1","view_count":"552"} +{"id":"3180867","title":"best method to keep and update unique data entries google app engine python","body":"\u003cp\u003eWhat is the best method to create a database for the given example model and assign each entry with a unique key/name which I already have and to overwrite it if the given key/name shows up again. From what I read you are supposed to use keyname? But I am not getting it to overwrite.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass SR(db.Model):\n name = db.StringProperty()\n title = db.StringProperty()\n url = db.StringProperty()\n\ns = SR(key_name=\"t5-2rain\")\ns.name = 't5-2rain'\ns.title = 'kaja'\ns.url = 'okedoke'\ndb.put(s)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIf I enter this again with the same key name but different title value, will create another entry how do I overwrite an existing value with the same key-name.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003e\u003cem\u003eBasically how do I populate a table with unique identifiers and overwrite values if the same unique identifier already exist?\u003c/em\u003e\u003c/strong\u003e\nI realize I can search for an existing name or key name etc, call that object make the changes to the instances and repopulate but, I would imagine there has to be a better method than that for overwriting especially if I am trying to put a list where some values may be overwrites and some not.\u003c/p\u003e","accepted_answer_id":"3180933","answer_count":"1","comment_count":"0","creation_date":"2010-07-05 16:08:30.293 UTC","last_activity_date":"2010-07-05 16:20:56.983 UTC","last_edit_date":"2010-07-05 16:16:27.67 UTC","last_editor_display_name":"","last_editor_user_id":"291071","owner_display_name":"","owner_user_id":"291071","post_type_id":"1","score":"1","tags":"google-app-engine","view_count":"344"} +{"id":"46659725","title":"Laravel eloquent query 20 latest records in after an id?","body":"\u003cp\u003eI have an id of a record. I need to query 20 latest records updated before the record with the id.\u003c/p\u003e\n\n\u003cp\u003eSomething like this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$orders = Order::latest('updated_at')-\u0026gt;take(20)-\u0026gt;before(id)-\u0026gt;get();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am using laravel5.5\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdit\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eLooking at the answer I feel my question is not clear enough.\u003c/p\u003e\n\n\u003cp\u003eSay this is my db table and id i have is 5\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e---------------------------------\n|id| name | updated_at |\n|--|------|---------------------|\n|1 |a | 2017-09-21 06:27:59 |\n|2 |b | 2017-09-19 06:20:29 |\n|3 |c | 2017-09-12 05:27:59 |\n|4 |d | 2017-09-18 05:17:39 |\n|5 |e | 2017-09-17 06:27:48 |\n|6 |b | 2017-09-19 06:27:59 |\n|7 |f | 2017-09-04 06:27:58 |\n|8 |g | 2017-09-06 06:27:14 |\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want most recent updated records so\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e---------------------------------\n|id| name | updated_at |\n|--|------|---------------------|\n|1 |a | 2017-09-21 06:27:59 |\n|2 |b | 2017-09-19 06:20:29 |\n|4 |d | 2017-09-18 05:17:39 |\n|5 |e | 2017-09-17 06:27:48 |\n|3 |c | 2017-09-12 05:27:59 |\n|6 |b | 2017-09-09 06:27:59 |\n|8 |g | 2017-09-06 06:27:14 |\n|7 |f | 2017-09-04 06:27:58 |\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow 20(in this case all) records updated before record with id 5\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e---------------------------------\n|id| name | updated_at |\n|--|------|---------------------|\n|3 |c | 2017-09-12 05:27:59 |\n|6 |b | 2017-09-09 06:27:59 |\n|8 |g | 2017-09-06 06:27:14 |\n|7 |f | 2017-09-04 06:27:58 |\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is the result i need.\u003c/p\u003e","accepted_answer_id":"46660030","answer_count":"3","comment_count":"6","creation_date":"2017-10-10 06:13:19.063 UTC","favorite_count":"1","last_activity_date":"2017-10-10 15:41:46.433 UTC","last_edit_date":"2017-10-10 15:41:46.433 UTC","last_editor_display_name":"","last_editor_user_id":"3618575","owner_display_name":"","owner_user_id":"4323908","post_type_id":"1","score":"1","tags":"php|laravel|laravel-eloquent|laravel-5.5","view_count":"89"} +{"id":"2756965","title":"How to get original DataColumn value from DataRow?","body":"\u003cp\u003eI have a DataTable and i want to figure out the Original column value for all the modified data rows.\u003c/p\u003e\n\n\u003cp\u003eI am using following approach to get the Orginal column value before the DataRow was modified\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eDataRow[] dataRowArray = dataTableInstance.Select(null,null,DataViewRowState.OriginalRows);\nDataRow originalDataRow = dataRowArray[rowIndex][columnIndex, DataRowVersion.Original] \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ePlease point out what am I doing wrong here ? Above code does not give me the Original column , instead it gives me the latest modified column value.\u003c/p\u003e\n\n\u003cp\u003eThanks.\u003cbr\u003e\nNikhil\u003c/p\u003e","accepted_answer_id":"2757712","answer_count":"2","comment_count":"1","creation_date":"2010-05-03 08:46:44.777 UTC","last_activity_date":"2012-03-09 16:29:13.373 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"196458","post_type_id":"1","score":"3","tags":"c#|.net|ado.net","view_count":"10485"} +{"id":"28379806","title":"How to mock `location`, `navigator` and friends for specific page using Firefox extension?","body":"\u003cp\u003eI'm trying to develop a Firefox extension to protect user security by fighting against browser fingerprinting used for user tracking purposes.\u003c/p\u003e\n\n\u003cp\u003eMany, if not all fingerprinting techniques include recording contents of \u003ccode\u003enavigator.plugins\u003c/code\u003e, \u003ccode\u003enavigator.oscpu\u003c/code\u003e, \u003ccode\u003enavigator.platform\u003c/code\u003e, screen resolution, window toolbar height etc. Idea of an extension consists of two parts — first is to randomly filter and permutate plugins and their mime types, and induce randomness in other variables used for tracking; and second is to isolate webpage to prevent it from reusing previously hidden information — like \u003ccode\u003e.sol\u003c/code\u003e-cookies, utilizing fake \u003ccode\u003eE-Tag\u003c/code\u003es or anything not discovered yet.\u003c/p\u003e\n\n\u003cp\u003eBoth methods require reimplementing getters on non-configurable properties of privileged \u003ccode\u003enavigator\u003c/code\u003e, \u003ccode\u003escreen\u003c/code\u003e, \u003ccode\u003elocation\u003c/code\u003e objects, and this is the place where I'm stuck.\u003c/p\u003e\n\n\u003cp\u003eFor example, following straightforward code being entered in Browser Console just does not work:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eObject.defineProperty(getBrowser().contentWindow.location, 'href', {\n get: function() {\n return 'foobar';\n }\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt does not produce any errors, but does not redefine a property either. Moreover, it returns current value of \u003ccode\u003elocation\u003c/code\u003e object for some reason — something that I don't expect from \u003ccode\u003eObject.defineProperty\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eReplacing \u003ccode\u003elocation\u003c/code\u003e with \u003ccode\u003elocation.wrappedJSObject\u003c/code\u003e makes browser spit out \u003ccode\u003eTypeError: can't redefine non-configurable property 'href'\u003c/code\u003e, identical to what non-privileged code will throw.\u003c/p\u003e\n\n\u003cp\u003eI tried to track down what happens when you call \u003ccode\u003eObject.defineProperty\u003c/code\u003e on something. It seems that it starts with \u003ccode\u003ejs::obj_defineProperty()\u003c/code\u003e, then goes to \u003ccode\u003ejs::StandardDefineProperty\u003c/code\u003e, which in turn does couple of checks, and descends to \u003ccode\u003ejs::DefinePropertyOnObject\u003c/code\u003e, which has huge quantity of checks I don't fully understand yet, and finally ends with \u003ccode\u003ejs::NativeDefineProperty\u003c/code\u003e, where the actual object modification is done.\u003c/p\u003e\n\n\u003cp\u003eSo, questions are:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eIs it possible to redefine \u003ccode\u003elocation\u003c/code\u003e, \u003ccode\u003enavigator\u003c/code\u003e, \u003ccode\u003escreen\u003c/code\u003e objects for a page content sandbox entirely, replacing them with some mocked proxies, controlled by my extension?\u003c/li\u003e\n\u003cli\u003eOr, is it possible to redefine non-configurable property of aforementioned objects?\u003c/li\u003e\n\u003cli\u003eOr, is it possible to call \u003ccode\u003ejs::NativeDefineProperty\u003c/code\u003e from chrome JavaScript?\u003c/li\u003e\n\u003cli\u003eOr (less preferred), is it possible to implement binary add-on to expose \u003ccode\u003ejs::NativeDefineProperty\u003c/code\u003e to chrome as a service?\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003e\u003cstrong\u003eUpdate:\u003c/strong\u003e I've got a question at Mozilla IRC, how is location rewriting related to privacy. Just for now all windows in private browsing mode share same cookies, storage and such, so you can still be tracked even in private mode, if you don't reset it too often. How often is too often is a question — ideally, you should reset after each visited site, because each site could mark you. It would be cool, if there was an ability to adjust granularity of private mode — like, separate private windows or tabs one from another.\u003c/p\u003e\n\n\u003cp\u003eI thought about tagging all URLs with some kind of tab-unique long random tag — so \u003ccode\u003ehttp://example.com/foo\u003c/code\u003e opened in two separate private tabs becomes \u003ccode\u003ehttp://example.com.AYZYXP/foo\u003c/code\u003e and \u003ccode\u003ehttp://example.com.QUSOFX/foo\u003c/code\u003e. From the browser's point of view, these are two distinct domain names, with their own caching rules, cookies, DOM storage, IndexedDB, FlashPlayer pesistence or anything else. From webpage's point of view it's necessary to keep the impression both tabs are \u003ccode\u003ehttp://example.com/foo\u003c/code\u003e, because exposing the tag will defy the idea of tagging — and that's why I need location rewriting.\u003c/p\u003e","answer_count":"1","comment_count":"8","creation_date":"2015-02-07 07:42:25.443 UTC","favorite_count":"1","last_activity_date":"2015-02-08 10:51:29.287 UTC","last_edit_date":"2015-02-07 12:20:44.557 UTC","last_editor_display_name":"","last_editor_user_id":"472695","owner_display_name":"","owner_user_id":"472695","post_type_id":"1","score":"3","tags":"javascript|security|firefox|firefox-addon|fingerprinting","view_count":"381"} +{"id":"28285380","title":"R ReporteRs: Editing Existing Slides","body":"\u003cp\u003eI have a presentation in pptx format that I need to update frequently with graphs that I generate with an R script. I would like to automate the replacement of the graphs without having to copy and paste between screens a whole bunch of times. I have been playing with the ReporteRs package and it seems promising but I cannot figure out how to simply replace the graphs that are already in the presentation. All of the documentation on ReporteRs indicates that you have to add a new slide and then place your graphs on that new slide. Is there a way to say, 'delete the graph on slide 7 and replace it with graph XXX?' Is ReporteRs the best package for this?\u003c/p\u003e","accepted_answer_id":"28327097","answer_count":"3","comment_count":"0","creation_date":"2015-02-02 19:36:16.303 UTC","last_activity_date":"2015-02-04 16:58:59.08 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3390169","post_type_id":"1","score":"6","tags":"r|powerpoint|reporters","view_count":"1870"} +{"id":"24146586","title":"Capacity planning for service oriented architecture?","body":"\u003cp\u003eI have a collection of SOA components that can handle a series of business processes. For example one SOA component imports user data, another runs analytics on it.\u003c/p\u003e\n\n\u003cp\u003eI'm familiar with business process modeling for manufacturing, i.e. calculating WIP, throughput, cycle times, utilization etc. for each process. Little's Law, theory of constraints, etc.\u003c/p\u003e\n\n\u003cp\u003eCan I apply this approach to capacity planning for my SOA architecture, or is there a more rigorous / more widely accepted approach?\u003c/p\u003e","accepted_answer_id":"24176835","answer_count":"1","comment_count":"4","creation_date":"2014-06-10 16:46:06.28 UTC","favorite_count":"1","last_activity_date":"2014-06-12 05:09:42.93 UTC","last_edit_date":"2014-06-11 15:59:47.953 UTC","last_editor_display_name":"","last_editor_user_id":"320619","owner_display_name":"","owner_user_id":"320619","post_type_id":"1","score":"1","tags":"soa|modeling|bpm","view_count":"279"} +{"id":"23558122","title":"How to give a border to an anchor tag's background image?","body":"\u003cp\u003eHow can I give and adjust the border just around the background image of a anchor tag ?\nNow I have a border of my anchor tags as the width and height are predefined. Can I give border around the background images of these anchor tags namely \"Next\" and \"Prev\" ??\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;!DOCTYPE html\u0026gt;\n\u0026lt;html\u0026gt;\n\u0026lt;head\u0026gt;\n\n\u0026lt;title\u0026gt;jQuery UI Dialog: Hide the Close Button/Title Bar\u0026lt;/title\u0026gt;\n\n\u0026lt;script src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\n\u0026lt;script src=\"http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\n\n \u0026lt;style type=\"text/css\"\u0026gt;\n\n .mySlider\n {\n //\n }\n\n .shadow_div\n {\n //\n }\n\n .mySlider img\n {\n width:800px;\n height:480px;\n display:none;\n\n }\n\n .Parent_Slider \u0026gt; a\n {\n text-decoration:none;\n font-weight:bold;\n width:32px;\n height:32px;\n position:absolute;\n top:45%;\n text-indent:-9999px;\n }\n\n .Next_Class\n {\n right:282px;\n background-image:url(Images/rightarrow.jpg);\n border:1px solid white;\n }\n\n .Prev_Class\n {\n left:282px;\n background-image:url(Images/leftarrow.jpg);\n }\n\n ul.Round_Buttons\n {\n position:relative;\n left:35%;\n top:5px;\n text-decoration:none;\n list-style-type:none;\n text-indent:-9999px\n }\n\n ul.Round_Buttons li\n {\n float:left;\n background-color:white;\n margin:1px 5px;\n padding:0px 7px;\n border-radius:50%;\n border-width:1px;\n border:1px solid #3610a5;\n cursor:pointer;\n box-shadow:1px -1px 3px 1px #3610a5;\n transition:all 1s ease-in-out;\n -moz-transition:all 1s ease-in-out;\n -webkit-transition:all 1s ease-in-out;\n\n }\n\n ul.Round_Buttons li:hover\n {\n transform:rotate(-360deg);\n -webkit-transform:rotate(-360deg);\n -moz-transform:rotate(-360deg);\n }\n\n\n\u0026lt;/style\u0026gt;\n\n\u0026lt;script type=\"text/javascript\"\u0026gt;\n\n $(document).ready(function () {\n //\n\n\n });\n\n\u0026lt;/script\u0026gt;\n\u0026lt;/head\u0026gt;\n\n\u0026lt;body\u0026gt;\n\u0026lt;div class=\"Parent_Slider\"\u0026gt;\n \u0026lt;div id=\"my_image_slider\" class=\"mySlider\"\u0026gt;\n \u0026lt;img id=\"1\" src=\"Images/bmw.jpg\" alt=\"\" title=\"Audi India\"/\u0026gt;\n \u0026lt;img id=\"2\" src=\"Images/audi.jpg\" alt=\"\" title=\"BMW India\" /\u0026gt;\n \u0026lt;img id=\"3\" src=\"Images/aston-martin.jpg\" alt=\"\" title=\"Aston-Martin APAC\" /\u0026gt;\n \u0026lt;img id=\"4\" src=\"Images/bugatti.jpg\" alt=\"\" title=\"Buggatti APAC\" /\u0026gt;\n \u0026lt;img id=\"5\" src=\"Images/koenigsegg.jpg\" alt=\"\" title=\"Koenigsegg APAC\" /\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;a href=\"#\" class=\"Next_Class\"\u0026gt;Next\u0026lt;/a\u0026gt;\n \u0026lt;a href=\"#\" class=\"Prev_Class\"\u0026gt;Prev\u0026lt;/a\u0026gt;\n\u0026lt;/div\u0026gt;\n \u0026lt;div class=\"shadow_div\" \u0026gt;\n \u0026lt;ul class=\"Round_Buttons\"\u0026gt;\n \u0026lt;li id=\"1st_Round\"\u0026gt;\u0026lt;a href=\"#\"\u0026gt;1\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li id=\"2nd_Round\"\u0026gt;\u0026lt;a href=\"#\"\u0026gt;2\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li id=\"3rd_Round\"\u0026gt;\u0026lt;a href=\"#\"\u0026gt;3\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li id=\"4th_Round\"\u0026gt;\u0026lt;a href=\"#\"\u0026gt;4\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li id=\"5th_Round\"\u0026gt;\u0026lt;a href=\"#\"\u0026gt;5\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n \u0026lt;/div\u0026gt; \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\n\u003c/p\u003e","answer_count":"1","comment_count":"4","creation_date":"2014-05-09 06:39:19.623 UTC","last_activity_date":"2014-05-09 07:01:22.753 UTC","last_edit_date":"2014-05-09 06:49:36.463 UTC","last_editor_display_name":"","last_editor_user_id":"3250325","owner_display_name":"","owner_user_id":"3250325","post_type_id":"1","score":"-1","tags":"html|css","view_count":"1175"} +{"id":"8414102","title":"Calling web service from windows service (load balanced servers)","body":"\u003cp\u003eWe have a web service running on a server and it is invoked by a windows service running on 2 servers, in total there are 3 servers.\u003c/p\u003e\n\n\u003cp\u003eSporadically, (say once in a month / 3 months / 6 months) the windows service is logging this error message \"There were not enough free threds in the threadpool to complete the opration\".\u003c/p\u003e\n\n\u003cp\u003eThe webservice is simple, it takes a parameter and returns a string.\u003c/p\u003e\n\n\u003cp\u003eAfter the error occurs that particular windows service on the server fails for subsequent requests.\u003c/p\u003e\n\n\u003cp\u003eNot sure of this cause of this error, any help follks?\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2011-12-07 10:49:18.103 UTC","last_activity_date":"2011-12-07 17:27:30.657 UTC","last_edit_date":"2011-12-07 10:50:35.62 UTC","last_editor_display_name":"","last_editor_user_id":"621013","owner_display_name":"","owner_user_id":"1085419","post_type_id":"1","score":"1","tags":".net|web-services|windows-services","view_count":"267"} +{"id":"17112511","title":"Rails Scope, Helper Method?","body":"\u003cp\u003eI have three models. One is an Employee, one is an Item, and one is a Transaction that belongs to both Employee and Items. It's a simple app that allows Employees to check in and check out items - 'Transaction' has a boolean column for checked-in/checked-out.\u003c/p\u003e\n\n\u003cp\u003eWhat I'm trying to do is show within the employee/show view the current list of Items that an Employee has checked out. This is some rough code that I sketched out, but I'm not sure that it's going to work, and I was told not to use a lot of nested conditionals in my views anyway.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;% if @employee.transactions.exists? %\u0026gt;\n \u0026lt;h3\u0026gt;Currently Checked-OUT Items\u0026lt;/h3\u0026gt;\n \u0026lt;table\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;th\u0026gt;Item Asset Tag\u0026lt;/th\u0026gt;\n \u0026lt;th\u0026gt;Item Description\u0026lt;/th\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;% @employee.transactions.each do |transaction| %\u0026gt;\n \u0026lt;% if item.transaction.last? \u0026amp;\u0026amp; transaction.status == false %\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;% transaction.assettag %\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;% transaction.description %\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;% else %\u0026gt;\n NO CHECKED OUT ITEMS\n \u0026lt;% end %\u0026gt;\n \u0026lt;/table\u0026gt;\n \u0026lt;% end %\u0026gt;\n \u0026lt;% end %\u0026gt; \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBasically, I'm trying to:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003echecks all employee transactions \u003c/li\u003e\n\u003cli\u003ecompares the item involved in the transaction and sees if it's the .last transaction record for item \u003c/li\u003e\n\u003cli\u003eif it is, \u003cem\u003eand if it's false\u003c/em\u003e, then it's a current checkout.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eIs this a better job for a scope within the Transaction model, or a helper method? I've never used either, I'm really new at rails.\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2013-06-14 15:52:12.4 UTC","last_activity_date":"2013-06-14 18:13:38.2 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1410554","post_type_id":"1","score":"0","tags":"ruby-on-rails|ruby|erb","view_count":"792"} +{"id":"29798196","title":"How to know if there is a valid 'aps-environment' for an iOS app before submitting to itunesconnect","body":"\u003cp\u003eEach time I submit a testing application for push notifications to iTunesConnect I receive a mail saying that I should resubmit after signing your app with a Distribution provisioning profile that includes the \"aps-environment\" entitlement. \u003c/p\u003e\n\n\u003cp\u003eI've been checking and testing with differents solutions proposed on SO, no one of them works yet, but my question is:\u003c/p\u003e\n\n\u003cp\u003eIs there a way to know if the build result has a valid aps-environment BEFORE submiting to itunesconnect?\u003c/p\u003e\n\n\u003cp\u003eAlso, if I run from xCode on my plugged device, the notification works, but if I run it using a device that receive the app using testFlight, it doesnt works.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-04-22 12:52:59.833 UTC","last_activity_date":"2015-04-22 13:08:31.203 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"503831","post_type_id":"1","score":"0","tags":"ios|xcode","view_count":"98"} +{"id":"12052734","title":"Session values set outside modx are not accesible in snippet","body":"\u003cp\u003eI am trying to use captcha image in my MODx site which is already built and running. I am able to see captcha image but unfortunately captcha script not able to set session value which can be accessed in modx snippet so i cant match it with entered value. Script to create image is located in modx/assets/captcha/captcha.php.\nI have spend almost 3 days solving this problem. I tried different methods to make it work. but nothing works. Is there any solution ?? Someone came around this issue ?\u003c/p\u003e","accepted_answer_id":"12059609","answer_count":"2","comment_count":"0","creation_date":"2012-08-21 10:14:43.73 UTC","favorite_count":"1","last_activity_date":"2012-08-21 16:56:56.233 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"929265","post_type_id":"1","score":"1","tags":"captcha|modx|modx-revolution","view_count":"993"} +{"id":"13244081","title":"Can I insert deletable characters in python input buffer?","body":"\u003cp\u003eI want to automatically indent the next line of a console app but the user needs to be able to remove it. \u003ccode\u003esys.stdout.write\u003c/code\u003e and \u003ccode\u003eprint\u003c/code\u003e make undeletable characters and I can't write to sys.stdin (as far as I know). I'm essentially trying to get smart indenting but I can only nest deeper and deeper. Any ideas on how to climb back out?\u003c/p\u003e\n\n\u003cp\u003eEdit: I should have noted that this is part of a Windows program that uses IronPython. While I could do something much fancier (and might in the future), I am hoping to quickly get a reasonably pleasant experience with very little effort as a starting point.\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2012-11-06 03:49:46.617 UTC","favorite_count":"2","last_activity_date":"2012-11-18 07:16:28.583 UTC","last_edit_date":"2012-11-06 17:26:22.813 UTC","last_editor_display_name":"","last_editor_user_id":"677114","owner_display_name":"","owner_user_id":"677114","post_type_id":"1","score":"7","tags":"python","view_count":"215"} +{"id":"47473021","title":"Running multiple tests cause interference in nosetests when patching with @mock.patch.object but not when using `with mock.patch.object`","body":"\u003cp\u003eI have observe a very strange behaviour of nosetests when using the @mock.patch.object function:\u003c/p\u003e\n\n\u003cp\u003eWhen i run multiple tests at the same time I get different results than when I run them individually. Specifically it happens, that the override with @mock.patch.object seems to have no effect, in certain cases when I run multiple nosetests together. When I apply the patch with \u003ccode\u003ewith\u003c/code\u003e, this problem does not occur.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@patch.object(ObjectToOverride,....)\ndef test_mytest()\n # check the override\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen using the\u003ccode\u003ewith\u003c/code\u003e method to apply the patch, subsequent tests are not affected by previous tests.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef test_mytest()\n with patch.object(ObjectToOverride,....):\n # check the override\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny suggestions what could cause this behaviour are appreciated.\u003c/p\u003e\n\n\u003cp\u003eWhen I run multiple tests, the ObjectToOverride will be loaded and used by previous tests. But I don't see why using with or decorator makes a difference whether the object can still be patched after that.\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-11-24 12:09:02.83 UTC","last_activity_date":"2017-11-24 12:15:27.62 UTC","last_edit_date":"2017-11-24 12:15:27.62 UTC","last_editor_display_name":"","last_editor_user_id":"5181181","owner_display_name":"","owner_user_id":"5181181","post_type_id":"1","score":"0","tags":"python|mocking|nose","view_count":"9"} +{"id":"19015680","title":"Audio recording and playback with libgdx","body":"\u003cp\u003eI was wondering if anyone has any luck with audio recording and playback using libgdx. I'm currently using 0.9.8 and just messing around trying to make a simple voice chat app. \u003c/p\u003e\n\n\u003cp\u003eI create my audio device using\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eint samples = 44100;\nint seconds = 5;\nboolean isMono = true;\nshort[] data = new short[samples*seconds];\n\nAudioRecorder recorder = Gdx.audio.newAudioRecorder(samples, isMono);\nAudioDevice player = Gdx.audio.newAudioDevice(samples, isMono);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOn a button press I kick of a new thread to record the data. (I know this is a messy to kick off a new thread, but i'm only trying to play with audio recording)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enew Thread(new Runnable() {\n @Override\n public void run() {\n System.out.println(\"Record: Start\");\n recorder.read(data, 0, data.length);\n System.out.println(\"Record: End\");\n }\n}).start();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAfter the recording I play back the recorded data using \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enew Thread(new Runnable() {\n@Override\npublic void run() {\n System.out.println(\"Play : Start\");\n player.writeSamples(data, samples, data.length);\n System.out.println(\"Play : End\");\n}\n}).start();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOn my laptop the recording and playback seems to work fine. I can record the data and then playback works great. \nThe problem happens on Android. I've tried it on three devices (Samsung S3, Samsung Galaxy Mini and a Nexus 10). In all cases, the recording works perfectly, the issue occurs when I attempt the playback it just locks up in the player.writeSamples and nothing is played. I've left it 10 min and never prints \"Record : End\". \u003c/p\u003e\n\n\u003cp\u003eHas anyone ever got audio playback working? Am I missing something?\u003c/p\u003e","accepted_answer_id":"19669715","answer_count":"1","comment_count":"0","creation_date":"2013-09-25 21:43:15.987 UTC","last_activity_date":"2013-10-29 21:40:45.483 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1878918","post_type_id":"1","score":"2","tags":"java|libgdx","view_count":"1671"} +{"id":"28019046","title":"In R, how to add a column to a data frame based on the contents of the first column?","body":"\u003cp\u003eI have a data frame of just one column that looks like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026gt;df\n\n Sample_Name\n1 GW16F1_A-1\n2 GW16F1_A-10\n3 GW16F1_A-12\n4 GW16F2_A-2\n5 GW16F2_A-3\n6 GW16F2_A-5\n7 GW16V1_A-6\n8 GW16V1_A-7\n9 GW16V2_A-8\n10 GW16V2_A-9\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want to append a second column to this data frame based on the contents of the Sample_Name column, so the output would look like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026gt;df\n SampleName SampleGroup\n1 GW16F1_A-1 F1\n2 GW16F1_A-10 F1\n3 GW16F1_A-12 F1\n4 GW16F2_A-2 F2\n5 GW16F2_A-3 F2\n6 GW16F2_A-5 F2\n7 GW16V1_A-6 V1\n8 GW16V1_A-7 V1\n9 GW16V2_A-8 V2\n10 GW16V2_A-9 V2\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs there a function that will read through the contents of a column and output a new vector based on it?\u003c/p\u003e","accepted_answer_id":"28019075","answer_count":"2","comment_count":"8","creation_date":"2015-01-19 06:29:24.397 UTC","favorite_count":"1","last_activity_date":"2015-01-19 07:00:39.073 UTC","last_edit_date":"2015-01-19 07:00:39.073 UTC","last_editor_display_name":"","last_editor_user_id":"4463919","owner_display_name":"","owner_user_id":"4463919","post_type_id":"1","score":"1","tags":"r|matrix|vector|pattern-matching|substr","view_count":"75"} +{"id":"2892302","title":"rails use counts in different views","body":"\u003cp\u003eHello i \u003cstrong\u003eguess\u003c/strong\u003e this is going to be pretty noob question.. But..\u003c/p\u003e\n\n\u003cp\u003eI have an scaffold called list, which has_many :wishes. And with that information in my model, I can in my list view use this code \u003c/p\u003e\n\n\u003cblockquote\u003e\n \n\u003c/blockquote\u003e\n\n\u003cp\u003ewell now I have made an controller called statusboard..\nAnd in that' I have 3 functions.. Or how to say it.. but it is Index, loggedin, loggedout.. And .. In loggedin and in the file #app/views/statusboard/loggedin.html.erb i want to display this..\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eHowdy {Username}, you have made {count lists} lists, and {count wishes} wishes\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003ehere is that i figured i should write in my file..\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eHowdy {Username}, you have made \u0026lt;%=h @user.list.count %\u003e lists, and \u0026lt;%=h @user.wishes.count %\u003e wishes\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003emy list model is like this =\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eclass List \u0026lt; ActiveRecord::Base\u003c/p\u003e\n \n \u003cp\u003e\u0026nbsp;\u0026nbsp;attr_accessible :user_id, :name, :description\u003c/p\u003e\n \n \u003cp\u003e\u0026nbsp;\u0026nbsp;belongs_to :users\u003c/p\u003e\n \n \u003cp\u003e\u0026nbsp;\u0026nbsp;has_many :wishes \u003c/p\u003e\n \n \u003cp\u003eend\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eand my wish model is like this =\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eclass Wish \u0026lt; ActiveRecord::Base\u003c/p\u003e\n \n \u003cp\u003e\u0026nbsp;\u0026nbsp;attr_accessible :list_id, :name, :price, :link, :rating, :comment\u003c/p\u003e\n \n \u003cp\u003e\u0026nbsp;\u0026nbsp;belongs_to :list\u003c/p\u003e\n \n \u003cp\u003eend\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eand last my user model is like this =\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eclass User \u0026lt; ActiveRecord::Base\u003c/p\u003e\n \n \u003cp\u003e\u0026nbsp;\u0026nbsp;# Include default devise modules. Others available are:\u003c/p\u003e\n \n \u003cp\u003e\u0026nbsp;\u0026nbsp;# :token_authenticatable, :lockable and :timeoutable\u003c/p\u003e\n \n \u003cp\u003e\u0026nbsp;\u0026nbsp;devise :database_authenticatable, :registerable,# :confirmable,\u003c/p\u003e\n \n \u003cp\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;:recoverable, :rememberable, :trackable, :validatable\u003c/p\u003e\n \n \u003cp\u003e\u0026nbsp;\u0026nbsp;# Setup accessible (or protected) attributes for your model\u003c/p\u003e\n \n \u003cp\u003e\u0026nbsp;\u0026nbsp;attr_accessible :email, :password, :password_confirmation\u003c/p\u003e\n \n \u003cp\u003e\u0026nbsp;\u0026nbsp;has_many :lists\u003c/p\u003e\n \n \u003cp\u003eend\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003ei hope someone can help me :-)!\n/ Oluf Nielsen \u003c/p\u003e","accepted_answer_id":"2893409","answer_count":"3","comment_count":"0","creation_date":"2010-05-23 15:23:22.637 UTC","last_activity_date":"2013-02-25 21:07:20.267 UTC","last_edit_date":"2013-02-25 21:07:20.267 UTC","last_editor_display_name":"","last_editor_user_id":"1900417","owner_display_name":"","owner_user_id":"330708","post_type_id":"1","score":"0","tags":"ruby-on-rails|ruby|rails-models|grails-controller","view_count":"107"} +{"id":"30754293","title":"Getting the messages back to the same command line from where the MFC application was launched","body":"\u003cp\u003eI am executing an \u003cstrong\u003eMFC Application\u003c/strong\u003e from command line which takes four command line arguments.One of the argument is the directory path.\nIf the path is wrong then I want to show a Message \"Bad Path\" on the same \u003cstrong\u003ecommand line\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eNote : For showing I don't want to take a new command line .\u003c/strong\u003e \u003c/p\u003e","accepted_answer_id":"30769051","answer_count":"1","comment_count":"2","creation_date":"2015-06-10 10:57:14.113 UTC","last_activity_date":"2015-06-10 23:29:30.78 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4948953","post_type_id":"1","score":"0","tags":"c++|mfc","view_count":"76"} +{"id":"7582284","title":"Apply TreeView bindings to non-expanded notes","body":"\u003cp\u003eI want to use a hierarchical TreeView which I will populate programmatically.\u003c/p\u003e\n\n\u003cp\u003eMy XAML file is as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;Window.Resources\u0026gt;\n \u0026lt;HierarchicalDataTemplate \n DataType=\"{x:Type local:MyTreeViewItem}\" \n ItemsSource=\"{Binding Path=Children}\"\u0026gt;\n \u0026lt;TextBlock Text=\"{Binding Path=Header}\"/\u0026gt;\n \u0026lt;/HierarchicalDataTemplate\u0026gt;\n\u0026lt;/Window.Resources\u0026gt;\n\n\n\u0026lt;Grid\u0026gt;\n \u0026lt;TreeView Margin=\"12,12,422,33\" Name=\"treeView1\" SelectedItemChanged=\"treeView1_SelectedItemChanged\" MouseDoubleClick=\"treeView1_MouseDoubleClick\"\u0026gt;\n \u0026lt;TreeView.ItemContainerStyle\u0026gt;\n \u0026lt;Style TargetType=\"{x:Type TreeViewItem}\"\u0026gt;\n \u0026lt;Setter Property=\"IsSelected\" Value=\"{Binding IsSelected, Mode=TwoWay}\"/\u0026gt;\n \u0026lt;Setter Property=\"IsExpanded\" Value=\"{Binding IsExpanded, Mode=TwoWay}\"/\u0026gt;\n \u0026lt;/Style\u0026gt;\n \u0026lt;/TreeView.ItemContainerStyle\u0026gt;\n \u0026lt;/TreeView\u0026gt;\n\u0026lt;/Grid\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe problem I'm having is that it seems that the bindings are applied only once the item is visible.\u003c/p\u003e\n\n\u003cp\u003eSuppose I populate the TreeView as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate ObservableCollection\u0026lt;MyTreeViewItem\u0026gt; m_items;\nprivate MyTreeViewItem m_item1;\nprivate MyTreeViewItem m_item2;\n\npublic MainWindow()\n{\n InitializeComponent();\n m_items = new ObservableCollection\u0026lt;MyTreeViewItem\u0026gt;();\n m_item1 = new MyTreeViewItem(null) {Header = \"Item1\"};\n m_item2 = new MyTreeViewItem(null) {Header = \"Item2\"};\n m_item1.Children.Add(m_item2);\n m_items.Add(m_item1);\n treeView1.ItemsSource = m_items;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI also have a button that selects m_item2:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate void button2_Click(object sender, RoutedEventArgs e)\n{\n m_item2.IsSelected = true;\n m_item2.IsExpanded = true;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow, if I launch the program and the TreeView only shows Item1 (Item2 is hidden because Item1 is not expanded), then clicking the button won't select m_item2. If I expand Item1 (thus making Item2 visible), the button will select m_item2.\u003c/p\u003e\n\n\u003cp\u003eExamining the PropertyChanged event on m_item2, I see that it is set to null initially, and a delegate is registered only once it is visible.\u003c/p\u003e\n\n\u003cp\u003eThis is a problem for me because I want to be able to programmatically select an item, even if its parent has not yet been expanded (e.g. I want to be able to find a node in the tree).\u003c/p\u003e\n\n\u003cp\u003eI suppose I can programmatically expand and collapse all nodes, but it seems there should be a better way. Can someone suggest a solution?\u003c/p\u003e","accepted_answer_id":"7582421","answer_count":"1","comment_count":"0","creation_date":"2011-09-28 11:09:08.647 UTC","last_activity_date":"2011-09-28 11:20:18.247 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"447202","post_type_id":"1","score":"1","tags":"wpf|treeview","view_count":"214"} +{"id":"12660841","title":"Making my POS : Error on DataGridview","body":"\u003cp\u003eI am trying to make a simple POS system with VB.NET, but since I don't know how to start, i ask for my friends to give me sample source code. I planning to use MySQL for my database rather than Microsoft Access because our school uses it.\nBelow is a sample code of the source code :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ePublic Sub FillDGVWithReceiptInfo(ByVal DGV As DataGridView)\n DGV.Rows.Clear()\n Dim TA As New POSDSTableAdapters.ItemsTableAdapter\n\n For i = 0 To Me.ReceiptDetailsList.Count - 1\n Dim T1 = Me.ReceiptDetailsList(i).Barcode\n Dim T2 = Me.ReceiptDetailsList(i).ItemBuyPrice\n Dim T3 = Me.ReceiptDetailsList(i).ItemCount\n Dim T4 = Me.ReceiptDetailsList(i).ItemSellPrice\n Dim T5 = T3 * T4\n Dim T6 = TA.GetDataByBarcode(T1).Rows(0).Item(\"ItemName\")\n\n DGV.Rows.Add(T1, T6, T2, T4, T3, T5)\n\n Next\n End Sub\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ei am trying to convert it to an \"OdBC\" kind of format. so i came up with this (also, this is the part where i get some error) :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Public Sub FillDGVWithReceiptInfo(ByVal DGV As DataGridView)\n DGV.Rows.Clear()\n\n For i = 0 To Me.ReceiptDetailsList.Count - 1\n Dim T1 = Me.ReceiptDetailsList(i).ganoProdID\n Dim T3 = Me.ReceiptDetailsList(i).ItemCount\n Dim T4 = Me.ReceiptDetailsList(i).ganoItemPrice\n Dim T5 = T3 * T4\n\n Dim TA As New OdbcDataAdapter(\"SELECT * FROM gano_inventory WHERE gano_proID = \" \u0026amp; T1 \u0026amp; \";\", conn)\n Dim R As New DataTable\n TA.Fill(R)\n\n Dim T6 = R.Rows(0).Item(\"gano_item\")\n\n DGV.Rows.Add(T1, T6, T4, T3, T5)\n\n Next\n End Sub\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethis is the code's error :\n\u003cem\u003eNo row can be added to a DataGridView control that does not have columns. Columns must be added first.\u003c/em\u003e in this line : \u003cstrong\u003eDGV.Rows.Add(T1, T6, T4, T3, T5)\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003ecan someone please help me with it? thank you in advance!\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2012-09-30 11:21:01.953 UTC","last_activity_date":"2013-06-18 21:27:31.37 UTC","last_edit_date":"2012-09-30 13:34:48.07 UTC","last_editor_display_name":"","last_editor_user_id":"1643554","owner_display_name":"","owner_user_id":"1643554","post_type_id":"1","score":"0","tags":"vb.net|datagridview|odbc","view_count":"644"} +{"id":"33016898","title":"Elasticsearch request optimisation (strange script_score in Java API with bool query)","body":"\u003cp\u003eWith Elasticsearch 1.7.0, I'd like to make a query on a text field of my documents. I need to get all the documents which:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003e\u003cp\u003ematch partially (all the word needs to exist with synonyms et fuzzy)\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003ematch fuzzy (all the word needs to exist + fuzzy + phonetic)\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003ematch related (50% of the word need to be found)\u003c/p\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eI made a Java program with 3 Elasticsearch requests but those queries were too long so I've tried to use one query for all that:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n \"query\": \n {\"bool\": {\n \"should\": [\n {\n \"function_score\": {\n \"boost_mode\": \"replace\",\n \"query\": {\n \"match\": {\n \"text.syn\": {\n \"query\": \"sorbone\",\n \"operator\": \"and\",\n \"fuzziness\": 1,\n \"minimum_should_match\": \"100%\"\n }\n }\n },\n \"script_score\": {\n \"script\": \"1\"\n }\n }\n },\n {\n \"function_score\": {\n \"boost_mode\": \"replace\",\n \"query\": {\n \"match\": {\n \"text.phonetic\": {\n \"query\": \"sorbone\",\n \"operator\": \"and\",\n \"fuzziness\": 1,\n \"minimum_should_match\": \"100%\"\n }\n }\n },\n \"script_score\": {\n \"script\": \"3\"\n }\n }\n },\n {\n \"function_score\": {\n \"boost_mode\": \"replace\",\n \"query\": {\n \"match\": {\n \"text.phonetic\": {\n \"query\": \"sorbone\",\n \"operator\": \"or\", \n \"minimum_should_match\": \"50%\"\n }\n }\n },\n \"script_score\": {\n \"script\": \"7\"\n }\n }\n }\n ]\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe idea is to use a bool_query with a specific score for each document returned. It works well but when I try to convert it using Java API, I have a score strangely calculated, instead there are decimals in the score and I was waiting to have numbers like 7 3 1 4 10 8 which correspond to sum of score.\u003c/p\u003e\n\n\u003cp\u003eThe code I used:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e .operator(org.elasticsearch.index.query.MatchQueryBuilder.Operator.AND)\n .fuzziness(Fuzziness.ONE)\n .minimumShouldMatch(\"100%\");\n QueryBuilder termsPhon = matchQuery(\"text.phonetic\", \"sorbonne\")\n .operator(org.elasticsearch.index.query.MatchQueryBuilder.Operator.AND)\n .fuzziness(Fuzziness.ONE)\n .minimumShouldMatch(\"100%\");\n QueryBuilder termsText = matchQuery(\"text\", \"sorbonne\")\n .operator(org.elasticsearch.index.query.MatchQueryBuilder.Operator.OR)\n .minimumShouldMatch(\"50%\");\n QueryBuilder functionScorePartial = functionScoreQuery(termsSyn)\n .add(ScoreFunctionBuilders.scriptFunction(\"1\"))\n .boostMode(\"replace\"); \n\n\nQueryBuilder functionScoreFuzzy = functionScoreQuery(termsPhon)\n .add(ScoreFunctionBuilders.scriptFunction(\"7\"))\n .boostMode(\"replace\"); \n\nQueryBuilder functionScoreRelated = functionScoreQuery(termsText)\n .add(ScoreFunctionBuilders.scriptFunction(\"15\"))\n .boostMode(\"replace\")\n ; \n\nQueryBuilder boolQ = boolQuery()\n .should(functionScorePartial)\n .should(functionScoreFuzzy)\n .should(functionScoreRelated);\n\nsqb.setQuery(boolQ);\n\n\nSearchResponse response = sqb.execute().actionGet();\nSearchHits hits = response.getHits();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I look to the generated JSON I see that the script function is not generated the same way. In the original REST I've got:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\"functions\" : [ {\n \"script_score\" : {\n \"script\" : \"1\"\n }\n } ],\n \"boost_mode\" : \"replace\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn the generated JSON, there's no \"functions\" array:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \"script_score\": {\n \"script\": \"1\"\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs it a bug in the Elasticsearch Java API?\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2015-10-08 13:12:43.48 UTC","last_activity_date":"2015-10-13 17:38:20.99 UTC","last_edit_date":"2015-10-08 13:46:35.513 UTC","last_editor_display_name":"","last_editor_user_id":"880772","owner_display_name":"","owner_user_id":"5061275","post_type_id":"1","score":"0","tags":"java|elasticsearch","view_count":"193"} +{"id":"6719069","title":"WP7 7.1 (Mango) Database Versioning","body":"\u003cp\u003eI have a class structure that's saved to the local SQL DB on the phone. In the next version of the app, the class structure has changed.\u003c/p\u003e\n\n\u003cp\u003eHow does the SQL DB deserialize the data into the changed objects/structure?\u003c/p\u003e","accepted_answer_id":"6748873","answer_count":"1","comment_count":"0","creation_date":"2011-07-16 17:34:45.21 UTC","last_activity_date":"2011-07-28 23:27:26.86 UTC","last_edit_date":"2011-07-28 23:27:26.86 UTC","last_editor_display_name":"","last_editor_user_id":"149573","owner_display_name":"","owner_user_id":"68499","post_type_id":"1","score":"0","tags":"database|windows-phone-7","view_count":"242"} +{"id":"37657474","title":"Google classroom api doesn't return the alias when a course is created","body":"\u003cp\u003eBackground: We currently have a database with every course, teacher and student in our school board. I am basically trying to build a system to sync this with our Google Classroom environment, so every teacher will have their courses, students will be enrolled ect.\u003c/p\u003e\n\n\u003cp\u003eProblem: We have over 8000 courses to create and want to use the batch system or at least create them asynchronously. We pass our internal unique course ID in the create call through the alias. However in the callback method this value is not passed back. This means we have no way of linking the google unique ID to ours, and no way of knowing if something goes wrong, which courses were not created.\u003c/p\u003e\n\n\u003cp\u003eExample: I want to create 5 courses with the following ids:\n1234\n1235\n1236\n1237\n1238\u003c/p\u003e\n\n\u003cp\u003eSo I create a batch request and the call back gets called 5 times. The data in the call back does not contain the IDs I sent in though if only contains the google IDs:\u003c/p\u003e\n\n\u003cp\u003e9876\n9875\nError\n9873\n9872\u003c/p\u003e\n\n\u003cp\u003eThe API specifically mentions that the order cannot be trusted. So how can I tell which google ID belong to which course and how can I tell witch course had the error?\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2016-06-06 12:27:08.82 UTC","last_activity_date":"2016-08-10 19:10:24.06 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5326876","post_type_id":"1","score":"0","tags":"google-classroom","view_count":"74"} +{"id":"3761021","title":"Toolbar package missing in sdk 6.0","body":"\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/AxN3P.png\" alt=\"alt text\"\u003e\u003c/p\u003e\n\n\u003cp\u003eI can not use the toolbar lib even with sdk 6.0\u003c/p\u003e\n\n\u003cp\u003eI am using 6.0\u003c/p\u003e\n\n\u003cp\u003eCan anyone help me .. i m stuck here \u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2010-09-21 13:55:38.947 UTC","last_activity_date":"2010-09-21 15:34:28.76 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"410693","post_type_id":"1","score":"0","tags":"java|blackberry","view_count":"36"} +{"id":"11888343","title":"How make OR condition between LIKE with Datamapper?","body":"\u003cp\u003eI have 3 related models:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass Transaction\n include DataMapper::Resource \n property :id, Serial \n property :volume, Float\n property :deal_date, Date \n belongs_to :buyer\n belongs_to :seller\nend\n\nclass Seller\n include DataMapper::Resource \n property :id, Serial\n property :name, String \n has n, :transactions\nend\n\nclass Buyer\n include DataMapper::Resource \n property :id, Serial\n property :name, String, :length =\u0026gt; 255, :index =\u0026gt; true, :unique =\u0026gt; true\n has n, :transactions\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI want make a query to tranactions with some conditions:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ex \u0026lt; volume \u0026lt; y\nand\na \u0026lt; deal_date \u0026lt; b\nand\n( buyer.name like key_word OR seller.name like key_word )\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow can I make OR condition between two LIKE with Datamapper?\u003c/p\u003e","accepted_answer_id":"11896878","answer_count":"2","comment_count":"0","creation_date":"2012-08-09 16:58:34.583 UTC","favorite_count":"3","last_activity_date":"2014-09-23 22:28:15.51 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1556964","post_type_id":"1","score":"3","tags":"ruby|sinatra|datamapper","view_count":"1276"} +{"id":"15057313","title":"Display 3 random images in Javascript from an javascript array of image links that have come from a database","body":"\u003cp\u003eI am struggling to take 3 random images (No repeat) out of my Javascript array and print them on screen within separate Divs.\u003c/p\u003e\n\n\u003cp\u003eMy Javascript array is being populated by a database which contains the links/location of the images on the server. \u003c/p\u003e\n\n\u003cp\u003eCurrently my page looks like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;html\u0026gt;\n \u0026lt;head\u0026gt;\n \u0026lt;/head\u0026gt;\n \u0026lt;body\u0026gt;\n \u0026lt;div\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;script\u0026gt;\n var items = [\n {name:'Coch',image:'upload/coch.png'},{name:'Glas',image:'upload/glas.png'}, {name:'Melyn',image:'upload/melyn.png'},{name:'Ci',image:'upload/dog.jpg'}, {name:'Cath',image:'upload/cath.jpg'},{name:'Gwyrdd',image:'upload/gwyrdd.png'},{name:'Un',image:'upload/un.jpg'},{name:'Dau',image:'upload/dau.jpg'},{name:'Tri',image:'upload/tri.jpg'},{name:'Bochdew',image:'upload/bochdew.jpg'},{name:'Piws',image:'upload/piws.png'} ];\n for (var i = 0; i \u0026lt; items.length; i += 1) {\n document.getElementsByTagName('div')[0].innerHTML += items[i].name + \" / \" + items[i].image + \"\u0026lt;br /\u0026gt;\\n\";\n } \n \u0026lt;/script\u0026gt;\n \u0026lt;/body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis code simply takes the image links from the database and inserts them into a javascipt array. (And prints the links on screen at the moment)\u003c/p\u003e\n\n\u003cp\u003eCan anyone give me any help on how to get this to work?\nTake 3 random images links from that array (No duplication's), and display the 3 images on screen in 3 different divs.\u003c/p\u003e\n\n\u003cp\u003eI am not good with javascipt at all and any code examples would be great.\u003c/p\u003e\n\n\u003cp\u003eThank You in advance for any replies.\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2013-02-24 22:16:51.723 UTC","last_activity_date":"2013-02-24 22:46:19.197 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2043964","post_type_id":"1","score":"1","tags":"javascript|arrays|image|random","view_count":"2559"} +{"id":"19399492","title":"How to fetch custom field values in a custom object in Salesforce using Visual Force and Javascript?","body":"\u003cp\u003eI have created a custom object MyObj_\u003cem\u003ec. Then I created a field MyField\u003c/em\u003e_c. Now I created a separate tab for this where I can input values for that field. I entered some values to store in a record.\u003c/p\u003e\n\n\u003cp\u003eNow I need to access the value of that field from a VisualForce page using JavsScript. How can I do that ???\u003c/p\u003e\n\n\u003cp\u003eWhen I tried \u003ccode\u003e\u0026lt;apex:outputField value=\"{!MyObj__c.MyField__c}\" id=\"abcd\"/\u0026gt;\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eI get the default value of that field, not the value stored in that record.\u003c/p\u003e","accepted_answer_id":"19405034","answer_count":"1","comment_count":"0","creation_date":"2013-10-16 09:17:09.547 UTC","last_activity_date":"2013-10-16 13:59:32.16 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2473505","post_type_id":"1","score":"0","tags":"javascript|salesforce|visualforce","view_count":"955"} +{"id":"42519562","title":"How to return a variable in java constructor","body":"\u003cp\u003eI use constructor Calcu_weight to assign values to \"weight\" and \"sumweight\". The problem is once I call the Calcu_weight, it assign values to weight and sumweight, but when I call it again, weight and sumweight are already assigned, which influence the second constructor.\nI wonder how can I use the constructor \"Calcul_weight\" a lot of times, and return those two TreeMap variables, but the later ones will not influence previous ones.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class Calcul_weight {\n\n private TreeMap\u0026lt;int[],Double\u0026gt; weight = new TreeMap\u0026lt;int[],Double\u0026gt;(new SerializableIntegerArrayKeyComparator());\n private TreeMap \u0026lt;Integer,Double\u0026gt; sumweight = new TreeMap \u0026lt;Integer, Double\u0026gt;();\n\n public Calcu_weight(int originID,int dest, Network network, Dijkstra dijkstra){\n // calculate weight for links. network and dijkstra are another two constructors\n }\n\n public TreeMap\u0026lt;int[],Double\u0026gt; getWeight(){\n return weight;\n }\n public TreeMap\u0026lt;Integer,Double\u0026gt; getSumweight(){\n return sumweight;\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"14","creation_date":"2017-02-28 22:02:53.157 UTC","last_activity_date":"2017-03-02 00:16:11.543 UTC","last_edit_date":"2017-03-02 00:16:11.543 UTC","last_editor_display_name":"","last_editor_user_id":"7400183","owner_display_name":"","owner_user_id":"7400183","post_type_id":"1","score":"-4","tags":"java|constructor","view_count":"47"} +{"id":"4683846","title":"Cannot get rounded corners on a table","body":"\u003cp\u003eI have a flash website with an ugly form (constructed via a table) on it. (I need to use flash because I am using one of those template sites.) \u003c/p\u003e\n\n\u003cp\u003eI am trying to round the top corners of the header (title area) and the bottom corners of the footer (submit area) that works with IE too. \u003c/p\u003e\n\n\u003cp\u003eI have seen several websites describing how to round textboxes (or text areas) but none for tables except with graphics via photoshop. I have tried to do that, but it is apparently above my skill level because it is not working! \u003c/p\u003e\n\n\u003cp\u003eI have had a little luck with generateit.net which provides an html snippet. But, it is also designed for a textbox and I am getting erratic results. \u003c/p\u003e\n\n\u003cp\u003eI would post my webpage but I have not yet published it. I can see it on my account at the template website. Trust me, though. They are erratic. Can anyone point me to a website that can help me with html code for a table with rounded edges (without graphics)? \u003c/p\u003e\n\n\u003cp\u003eThank you very much!\u003c/p\u003e","answer_count":"1","comment_count":"6","creation_date":"2011-01-13 18:39:05.49 UTC","last_activity_date":"2011-01-15 16:15:02.737 UTC","last_edit_date":"2011-01-13 18:47:23.803 UTC","last_editor_display_name":"","last_editor_user_id":"527185","owner_display_name":"","owner_user_id":"574713","post_type_id":"1","score":"0","tags":"html","view_count":"861"} +{"id":"28510166","title":"Can I send commands to a program I opened in a .bat file?","body":"\u003cp\u003eI want to create a batch file that I can click on that launches all of the stuff I need for rails development:\u003c/p\u003e\n\n\u003cp\u003e1)A command prompt opened to the folder the code for the project is in\u003c/p\u003e\n\n\u003cp\u003e2)A command prompt opened to the folder the project is in\n -Then I want to have that window call \"rails s\"\u003c/p\u003e\n\n\u003cp\u003e3)Send the windows key + left-arrow to the first command prompt to move it to the left side of the screen\u003c/p\u003e\n\n\u003cp\u003e4)Do (3) with the second window, but with the right side of the screen\u003c/p\u003e\n\n\u003cp\u003e5)Open up a file explorer to the folder I am developing in\u003c/p\u003e\n\n\u003cp\u003e6)Open up sublime text to the folder that I am developing in\u003c/p\u003e\n\n\u003cp\u003eWhat I have so far is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@echo off\nstart cmd /k cd C:\\projects directory\\code\nstart cmd /k cd C:\\projects directory\\code\nsubl C:\\\\\"projects directory\"\\code\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs what I want to do possible?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-02-13 22:56:23.833 UTC","last_activity_date":"2015-02-14 00:04:34.283 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4204030","post_type_id":"1","score":"0","tags":"windows|batch-file","view_count":"26"} +{"id":"8364411","title":"Scripting Eclipse .. or alternatives","body":"\u003cp\u003eI have written an android application. I would like to be able to customize the app programmatically. For example, change logos/titles within the application.\u003c/p\u003e\n\n\u003cp\u003eAssume I have a simple web server that displays a form with fields to input text, upload images etc. Upon submission of this form, I would like to generate an apk file available for download for the user. \u003c/p\u003e\n\n\u003cp\u003eIs there a way to script eclipse to achieve this? Is that even where I should be looking? If anyone has done something like this, (or have some ideas), please let me know!\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2011-12-03 00:31:11.647 UTC","last_activity_date":"2011-12-03 00:47:29.3 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"304658","post_type_id":"1","score":"0","tags":"java|android|eclipse|scripting","view_count":"90"} +{"id":"18610809","title":"Cannot see xpath / html code / firepath for popup window","body":"\u003cp\u003eI am using firebug and firepath to see xpath or html code to use in my Selenium tests. But for one popup window I cannot see any html code or firepath... \nI also tried to right click to see xpath but I do not get any menu when right clicking on the popup.\nIt works fine on the rest of the wesite it is only this popup.. Is there any setting or something I have to do?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-09-04 09:58:45.843 UTC","last_activity_date":"2014-11-21 09:16:10.48 UTC","last_edit_date":"2014-11-21 09:16:10.48 UTC","last_editor_display_name":"","last_editor_user_id":"617450","owner_display_name":"","owner_user_id":"2746221","post_type_id":"1","score":"0","tags":"firefox|selenium|firebug|firepath","view_count":"1760"} +{"id":"1786752","title":"rotating UITableViewController manually","body":"\u003cp\u003eI am trying to do something I am not really sure is possible :)\u003c/p\u003e\n\n\u003cp\u003eI have application that is in portrait mode and doesn't react to device rotation. Almost all parts of app work best in portrait so I disabled autorotation. \nBut one part should be viewed in landscape. I just drawed my view rotated by 90 degrees and with this forced user to rotate device (again no autorotation). Everything was ok until I added UITableViewController that is invoked from this (and only from this) rotated view. Table view is of course in portrait mode, so user has to rotate device again, which is not really user friendly experience. \nMy problem is, how to manually rotate table view so it is in landscape mode without using autorotation feature. I was able to rotate it using transform, but I can't position it properly. Is this right way of doing this or did I missed something that would make this trivial task?\u003c/p\u003e\n\n\u003cp\u003eI don't want to use autorotation because both part are pretty separated from each other and each of them would be almost useless in other's mode\u003c/p\u003e","accepted_answer_id":"1787046","answer_count":"1","comment_count":"0","creation_date":"2009-11-23 23:18:57.12 UTC","last_activity_date":"2010-07-21 16:17:27.713 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"124649","post_type_id":"1","score":"0","tags":"iphone|cocoa-touch","view_count":"631"} +{"id":"14825467","title":"How to exit an IOS application when License Agreement is not accepted by user?","body":"\u003cp\u003eI am aware apple won't support exiting an application programmatically, But I want to exit my application if the user not agreed to the license agreement? Is it possible to restrict the application loading if declined? or What can I do in this case?\u003c/p\u003e","accepted_answer_id":"14825547","answer_count":"8","comment_count":"0","creation_date":"2013-02-12 04:38:49.363 UTC","favorite_count":"1","last_activity_date":"2013-02-12 22:32:18.45 UTC","last_edit_date":"2013-02-12 04:50:38.093 UTC","last_editor_display_name":"","last_editor_user_id":"603977","owner_display_name":"","owner_user_id":"1587011","post_type_id":"1","score":"2","tags":"ios|user-interface","view_count":"904"} +{"id":"14545644","title":"How to set up .cabal test-suite when test file and the file under test is in different folder","body":"\u003cp\u003eI am trying to structure my simple project in a way that it's easy for me to develop in the future. Basically I've used \u003ccode\u003ecabal init\u003c/code\u003e to get the basic stuff, then I created a src folder, inside that i created a main folder and a test folder, the main is for holding all source code and the test is to put all test source code. Inside .cabal I have the following:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e.\n.\n.\n.\ntest-suit Test\n type: exitcode-stdio-1.0\n hs-source-dirs: src/test\n main-is: Test.hs\n build-depends: base\n\nexecutable Finance\n hs-source-dirs: src/main\n main-is: Main.hs\n build-depends: base\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThere are only three files Main.hs, Methods.hs, Test.hs. The Methods.hs is imported in Main.hs to get executed, and the Test.hs imports Methods.hs and tests the methods. My goal is to be able to do \u003ccode\u003ecabal --enable-tests configure\u003c/code\u003e then \u003ccode\u003ecabal build\u003c/code\u003e then \u003ccode\u003ecabal test\u003c/code\u003e then \u003ccode\u003ecabal install\u003c/code\u003e. But at the build stage I'm getting the error \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esrc/test/Test.hs:2:8:\n Could not find module `Methods`\n Use -v to see a list of the files search for.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow do I let cabal know where Methods.hs is? Also, is there a better way to set the project up?\u003c/p\u003e","accepted_answer_id":"14546011","answer_count":"1","comment_count":"0","creation_date":"2013-01-27 08:18:44.94 UTC","favorite_count":"1","last_activity_date":"2013-01-27 09:16:42.07 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1119141","post_type_id":"1","score":"4","tags":"unit-testing|haskell|automated-tests|cabal|cabal-install","view_count":"1370"} +{"id":"41038457","title":"music21: picking out melody track","body":"\u003cp\u003eI'm processing a bulk of midi files that are made for existing pop songs using music21.\u003c/p\u003e\n\n\u003cp\u003eWhile channel 10 is reserved for percussions, melodic tracks are all over different channels, so I was wondering if there is an efficient way to pick out the main melody (vocal) track.\u003c/p\u003e\n\n\u003cp\u003eI'm guessing one way to do it is to pick a track that consists of single notes rather than overlapping harmonics (chords), and the one that plays throughout the song, but is there any other efficient way?\u003c/p\u003e","accepted_answer_id":"41043870","answer_count":"2","comment_count":"0","creation_date":"2016-12-08 11:32:16.57 UTC","favorite_count":"1","last_activity_date":"2016-12-08 16:10:24.643 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"639973","post_type_id":"1","score":"1","tags":"python|midi|music21","view_count":"100"} +{"id":"24228748","title":"LibGDX - Stage.setViewport(new Viewport()) black screen","body":"\u003cp\u003eFor organization's sake, I use multiple scenes for my game and rather than having each scene have a constructor that receives a Viewport (my game is scalable), I would like to set each stage's viewport separate of the constructor, then after the viewport is set, add the actors. In the main class, it would happen like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic void setStage(Stage s)\n{\n if(currentStage != null)\n currentStage.dispose();\n currentStage = s;\n currentStage.setViewport(view);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eTo make this go fluidly, each stage has an init method that is called within an overriden setViewport:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@Override\npublic void setViewport(Viewport v)\n{\n super.setViewport(v);\n init();\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, all this gives me is a black screen... I have tried updating the camera and viewport, but no avail (note that the actors are having their render methods called).\u003c/p\u003e\n\n\u003cp\u003eWhy am I getting this black screen and how do I fix it? If it's not possible I'll just revert to using the constructor.\u003c/p\u003e","accepted_answer_id":"24230146","answer_count":"2","comment_count":"0","creation_date":"2014-06-15 10:35:19.847 UTC","favorite_count":"1","last_activity_date":"2014-06-17 08:30:40.75 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2514585","post_type_id":"1","score":"2","tags":"java|libgdx|render|viewport","view_count":"4725"} +{"id":"18166543","title":"MYSQLDUMP failing. Couldn't execute 'SHOW TRIGGERS LIKE errors like (Errcode: 13) (6) and (1036)","body":"\u003cp\u003eDoes anyone know why MYSQLDUMP would only perform a partial backup of a database when run with the following instruction:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\"C:\\Program Files\\MySQL\\MySQL Server 5.5\\bin\\mysqldump\" databaseSchema -u root --password=rootPassword \u0026gt; c:\\backups\\daily\\mySchema.dump\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSometimes a full backup is performed, at other times the backup will stop after including only a fraction of the database. This fraction is variable.\u003c/p\u003e\n\n\u003cp\u003eThe database does have several thousand tables totalling about 11Gb. But most of these tables are quite small with only about 1500 records, many only have 150 - 200 records. The column counts of these tables can be in the hundreds though because of the frequency data stored. \u003c/p\u003e\n\n\u003cp\u003eBut I am informed that the number of tables in a schema in MySQL is not an issue. There are also no performance issues during normal operation.\u003c/p\u003e\n\n\u003cp\u003eAnd the alternative of using a single table is not really viable because all of these tables have different column name signatures.\u003c/p\u003e\n\n\u003cp\u003eI should add that the database is in use during the backup.\u003c/p\u003e\n\n\u003cp\u003eWell after running the backup with instruction set:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\"C:\\Program Files\\MySQL\\MySQL Server 5.5\\bin\\mysqldump\" mySchema -u root --password=xxxxxxx -v --debug-check --log-error=c:\\backups\\daily\\mySchema_error.log \u0026gt; c:\\backups\\daily\\mySchema.dump\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI get this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emysqldump: Couldn't execute 'SHOW TRIGGERS LIKE '\\_dm\\_10730\\_856956\\_30072013\\_1375194514706\\_keyword\\_frequencies'': Error on delete of 'C:\\Windows\\TEMP\\#sql67c_10_8c5.MYI' (Errcode: 13) (6)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhich I think is a permissions problem.\u003c/p\u003e\n\n\u003cp\u003eI doubt any one table in my schema is in the 2GB range.\u003c/p\u003e\n\n\u003cp\u003eI am using MySQL Server 5.5 on a Windows 7 64 bit server with 8 Gb of memory.\u003c/p\u003e\n\n\u003cp\u003eAny ideas?\u003c/p\u003e\n\n\u003cp\u003eI am aware that changing the number of files which MySQL can open, the open_files_limit parameter, may cure this matter.\u003c/p\u003e\n\n\u003cp\u003eAnother possibility is interference from anti virus products as described here:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://beerpla.net/2010/01/05/how-to-fix-intermittent-mysql-errcode-13-errors-on-windows/\" rel=\"nofollow\"\u003eHow To Fix Intermittent MySQL Errcode 13 Errors On Windows\u003c/a\u003e\u003c/p\u003e","answer_count":"1","comment_count":"7","creation_date":"2013-08-10 21:30:34.813 UTC","favorite_count":"1","last_activity_date":"2013-09-04 14:45:59.193 UTC","last_edit_date":"2013-09-04 14:45:59.193 UTC","last_editor_display_name":"","last_editor_user_id":"953331","owner_display_name":"","owner_user_id":"953331","post_type_id":"1","score":"6","tags":"mysql|mysqldump","view_count":"9429"} +{"id":"24022737","title":"Solution for payment process required","body":"\u003cp\u003eWe have the following requirements for an online payment solution:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eThere are two types of users: Buyers and sellers.\u003c/li\u003e\n\u003cli\u003eOnly digital stuff is exchanged.\u003c/li\u003e\n\u003cli\u003eWhen a buyer buys content, money is sent to the seller immediately as well as a small fraction of the money to the website owners.\u003c/li\u003e\n\u003cli\u003eA buyer must before he can sell his offerings connect his account (that may be PayPal or any other service) to the platform to be able to receive money.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eNow, I'm not an expert in this field but my initial idea was to have a PayPal account with Mass Transactions enabled for this website which will receive all payments and then send money out to the sellers via API calls.\u003c/p\u003e\n\n\u003cp\u003eHowever, it would be very nice if it is possible to make this process completely external, a.k.a. use a service for payment which sends the bulk of the money to the seller but a small fraction to the shareholders (website owners). Of course, a seller must first connect his account to the platform to make sure in case one of his offerings was bought he can receive money.\u003c/p\u003e\n\n\u003cp\u003eAny ideas are well appreciated.\u003c/p\u003e","accepted_answer_id":"24023093","answer_count":"1","comment_count":"0","creation_date":"2014-06-03 18:51:07.193 UTC","last_activity_date":"2014-06-03 19:11:02.563 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"420097","post_type_id":"1","score":"1","tags":"paypal|payment|payment-processing","view_count":"79"} +{"id":"14815717","title":"Multiple modules overriding same core file in Magento","body":"\u003cp\u003eHow does Magento handle multiple modules overriding the same core file? Is it possible? How is it done?\u003c/p\u003e","accepted_answer_id":"14815808","answer_count":"1","comment_count":"0","creation_date":"2013-02-11 15:52:54.083 UTC","favorite_count":"4","last_activity_date":"2013-05-19 19:40:56.093 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"821843","post_type_id":"1","score":"9","tags":"magento","view_count":"6350"} +{"id":"24812004","title":"Charfield not showing up in django form","body":"\u003cp\u003eI am creating a basic django site that uses django-userena. I am overriding the default signup form by creating a EditProfileFormExtra class on my forms.py. However, I am finding a very strange problem. The fields \"latitude\" and \"longitude\" do not show up. Changing the name of the fields seems to make them show up, but naming them \"lat\" or \"latitude\" and \"long\" or \"longitude\" makes them dissappear ?! Why is this?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efrom django import forms\nfrom django.utils.translation import ugettext_lazy as _\nfrom userena.forms import SignupForm\nfrom userena.forms import EditProfileForm\nfrom Couches.models import Location\nfrom django.core.validators import RegexValidator\n\n\n# Code adapted from: http://django-userena.readthedocs.org/en/latest/faq.html#how-do-i-add-extra-fields-to-forms\nclass SignupFormExtra(SignupForm):\n first_name = forms.CharField(label=_(u'First name'),\n max_length=30,\n required=True)\n last_name = forms.CharField(label=_(u'Last name'),\n max_length=30,\n required=True)\n latitude = forms.CharField(label=_(u'Latitude'),\n max_length=30,\n required=False,\n validators=[RegexValidator(regex='^[-+]?[0-9]*\\.?[0-9]+$'),])\n longitude = forms.CharField(label=_(u'Longitude'),\n max_length=30,\n required=False,\n validators=[RegexValidator(regex='^[-+]?[0-9]*\\.?[0-9]+$'),])\n\n def save(self):\n # First save the parent form and get the user.\n new_user = super(SignupFormExtra, self).save()\n new_user.first_name = self.cleaned_data['first_name']\n new_user.last_name = self.cleaned_data['last_name']\n new_user.save()\n\n Location.objects.create(available=True,\n user=new_user,\n latitude=self.cleaned_data['latitude'],\n longitude=self.cleaned_data['longitude'])\n\n return new_user\n\n\nclass EditProfileFormExtra(EditProfileForm):\n description = forms.CharField(label=_(u'Description'),\n max_length=300,\n required=False,\n widget=forms.Textarea)\n contact_information = forms.CharField(label=_(u'Contact Information'),\n max_length=300,\n required=False,\n widget=forms.Textarea)\n graduation_year = forms.CharField(label=_(u'Graduation Year'),\n max_length=4,\n required=False,\n validators=[RegexValidator(regex='^\\d{4}$'), ])\n address = forms.CharField(label=_(u'Contact Information'),\n max_length=100,\n required=False)\n # BUG: the two fields below do not appear on the form\n latitude = forms.CharField(label=_(u'Latitude'),\n max_length=30,\n required=False,\n validators=[RegexValidator(regex='^[-+]?[0-9]*\\.?[0-9]+$'), ])\n longitude = forms.CharField(label=_(u'lon'),\n max_length=30,\n required=False,\n validators=[RegexValidator(regex='^[-+]?[0-9]*\\.?[0-9]+$'), ])\n\n def save(self, force_insert=False, force_update=False, commit=True):\n profile = super(EditProfileFormExtra, self).save()\n profile.description = self.cleaned_data['description']\n profile.contact_information = self.cleaned_data['contact_information']\n profile.graduation_year = self.cleaned_data['graduation_year']\n\n location = Location.objects.get(user = profile.user)\n if(location):\n location.latitude = self.cleaned_data['latitude']\n location.longitude = self.cleaned_data['longitude']\n location.save()\n\n return profile\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is the template that shows the form:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{% extends 'base.html' %}\n{% load i18n %}\n{% load url from future %}\n\n{% block title %}{% trans \"Account setup\" %}{% endblock %}\n\n{% block content_title %}\u0026lt;h2\u0026gt;{% blocktrans with profile.user.username as username %}Account \u0026amp;raquo; {{ username }}{% endblocktrans %}\u0026lt;/h2\u0026gt;{% endblock %}\n\n{% block content %}\n\nEdit your very own profile.\n\n\u0026lt;form action=\"\" enctype=\"multipart/form-data\" method=\"post\"\u0026gt;\n \u0026lt;ul id=\"box-nav\"\u0026gt;\n \u0026lt;li class=\"first\"\u0026gt;\u0026lt;a href=\"{% url 'userena_profile_detail' user.username %}\"\u0026gt;\u0026lt;span\u0026gt;{% trans 'View profile' %}\u0026lt;/span\u0026gt;\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li class=\"selected\"\u0026gt;\u0026lt;a href=\"{% url 'userena_profile_edit' user.username %}\"\u0026gt;{% trans \"Edit profile\" %}\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"{% url 'userena_password_change' user.username %}\"\u0026gt;{% trans \"Change password\" %}\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li class=\"last\"\u0026gt;\u0026lt;a href=\"{% url 'userena_email_change' user.username %}\"\u0026gt;{% trans \"Change email\" %}\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n {% csrf_token %}\n \u0026lt;fieldset\u0026gt;\n \u0026lt;legend\u0026gt;{% trans \"Edit Profile\" %}\u0026lt;/legend\u0026gt;\n {{ form.as_p }}\n \u0026lt;/fieldset\u0026gt;\n \u0026lt;input type=\"submit\" value=\"{% trans \"Save changes\" %}\" /\u0026gt;\n\u0026lt;/form\u0026gt;\n{% endblock %}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is the model:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efrom django.db import models\nfrom django.contrib.auth.models import User\nfrom django.utils.translation import ugettext as _\nfrom userena.models import UserenaBaseProfile\nfrom django.core.validators import RegexValidator\n\n\nclass UserProfile(UserenaBaseProfile):\n user = models.OneToOneField(User,\n unique=True,\n verbose_name=_('user'),\n related_name='my_profile')\n\n first_name = models.TextField()\n last_name = models.TextField()\n description = models.CharField(max_length=300, blank=True)\n contact_information = models.CharField(max_length=300, blank=True) # extra contact information that the user wishes to include\n graduation_year = models.CharField(max_length=300, blank=True)\n address = models.CharField(max_length=100, blank=False)\n created_at = models.DateTimeField(auto_now_add=True)\n updated_at = models.DateTimeField(auto_now=True)\n\n def __unicode__(self):\n return u'%s %s' % (self.first_name, self.last_name)\n\n\nclass Location(models.Model):\n user = models.ForeignKey(User)\n available = models.BooleanField(default=True) # Is this location available to couchsurf\n\n latitude = models.CharField(max_length=30, validators=[RegexValidator(regex='^[-+]?[0-9]*\\.?[0-9]+$'),]) # floating point validator\n longitude = models.CharField(max_length=30, validators=[RegexValidator(regex='^[-+]?[0-9]*\\.?[0-9]+$'),]) # floating point validator\n\n created_at = models.DateTimeField(auto_now_add=True)\n updated_at = models.DateTimeField(auto_now=True)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is the view from django-userena (\u003ca href=\"https://github.com/bread-and-pepper/django-userena/blob/master/userena/views.py\" rel=\"nofollow\"\u003ehttps://github.com/bread-and-pepper/django-userena/blob/master/userena/views.py\u003c/a\u003e)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eAdef profile_edit(request, username, edit_profile_form=EditProfileForm,\n template_name='userena/profile_form.html', success_url=None,\n extra_context=None, **kwargs):\n \"\"\"\nEdit profile.\n\nEdits a profile selected by the supplied username. First checks\npermissions if the user is allowed to edit this profile, if denied will\nshow a 404. When the profile is successfully edited will redirect to\n``success_url``.\n\n:param username:\nUsername of the user which profile should be edited.\n\n:param edit_profile_form:\n\nForm that is used to edit the profile. The :func:`EditProfileForm.save`\nmethod of this form will be called when the form\n:func:`EditProfileForm.is_valid`. Defaults to :class:`EditProfileForm`\nfrom userena.\n\n:param template_name:\nString of the template that is used to render this view. Defaults to\n``userena/edit_profile_form.html``.\n\n:param success_url:\nNamed URL which will be passed on to a django ``reverse`` function after\nthe form is successfully saved. Defaults to the ``userena_detail`` url.\n\n:param extra_context:\nDictionary containing variables that are passed on to the\n``template_name`` template. ``form`` key will always be the form used\nto edit the profile, and the ``profile`` key is always the edited\nprofile.\n\n**Context**\n\n``form``\nForm that is used to alter the profile.\n\n``profile``\nInstance of the ``Profile`` that is edited.\n\n\"\"\"\n user = get_object_or_404(get_user_model(),\n username__iexact=username)\n\n profile = user.get_profile()\n\n user_initial = {'first_name': user.first_name,\n 'last_name': user.last_name}\n\n form = edit_profile_form(instance=profile, initial=user_initial)\n\n if request.method == 'POST':\n form = edit_profile_form(request.POST, request.FILES, instance=profile,\n initial=user_initial)\n\n if form.is_valid():\n profile = form.save()\n\n if userena_settings.USERENA_USE_MESSAGES:\n messages.success(request, _('Your profile has been updated.'),\n fail_silently=True)\n\n if success_url:\n # Send a signal that the profile has changed\n userena_signals.profile_change.send(sender=None,\n user=user)\n redirect_to = success_url\n else: redirect_to = reverse('userena_profile_detail', kwargs={'username': username})\n return redirect(redirect_to)\n\n if not extra_context: extra_context = dict()\n extra_context['form'] = form\n extra_context['profile'] = profile\n return ExtraContextTemplateView.as_view(template_name=template_name,\n extra_context=extra_context)(request)\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"7","creation_date":"2014-07-17 19:33:49.62 UTC","last_activity_date":"2014-07-20 23:36:40.167 UTC","last_edit_date":"2014-07-20 23:36:40.167 UTC","last_editor_display_name":"","last_editor_user_id":"2624442","owner_display_name":"","owner_user_id":"2624442","post_type_id":"1","score":"0","tags":"python|django|forms","view_count":"227"} +{"id":"26138958","title":"Mongo Update value, inside an array inside an array for aggregation","body":"\u003cp\u003eI have this kind of document:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n \"_id\" : 1,\n \"bMeta\" : [\n \"c33b9ce5ca46075336134a8092bebbbf\"\n ],\n \"ip\" : [\n \"a17bdc3ee98c002570b032dfe67f9680\"\n ],\n \"history\" : [\n {\n \"type\" : \"pType\",\n \"name\" : \"home\",\n \"score\" : 0,\n \"seen\" : [\n {\n \"year\" : 2014,\n \"week\" : 40,\n \"score\" : 0\n },\n {\n \"year\" : 2013,\n \"week\" : 51,\n \"score\" : 0\n }\n ]\n }\n ]\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'd like to update ($inc) the 'score' values for \u003ccode\u003ehistory.$.score\u003c/code\u003e and \u003ccode\u003ehistory.$.seen.$.score\u003c/code\u003e where \u003ccode\u003eseen.year\u003c/code\u003e = 2014.\u003c/p\u003e\n\n\u003cp\u003eOf course, I can't use more than one \u003ccode\u003e$\u003c/code\u003e so it's not working like that. It's just to show what I need to do.\u003c/p\u003e\n\n\u003cp\u003eHow would you update it? Knowing that the main goal is to be able to aggregate value with somethink like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edb.users.aggregate([\n {\n '$match':\n {\n '_id' : 1\n }\n },\n { '$unwind': '$history' },\n {\n '$match':\n {\n 'history.type' : 'pType',\n 'history.name' : 'home'\n }\n },\n { '$unwind': '$history.seen' },\n { '$match': { 'history.seen.year' : 2014 } },\n { '$match': { 'history.seen.week' : { $gte: 27 } } },\n { '$group': { _id: '$history.name', total_recent_score: { \"$sum\": \"$history.seen.score\" } } },\n { '$sort': { total_recent_score: -1 } },\n { '$limit': 5 }\n]).pretty();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eDo you think of a better document structure to achieve that?\u003c/p\u003e","answer_count":"0","comment_count":"4","creation_date":"2014-10-01 10:09:33.84 UTC","favorite_count":"1","last_activity_date":"2014-10-01 17:07:15.573 UTC","last_edit_date":"2014-10-01 13:21:00.87 UTC","last_editor_display_name":"","last_editor_user_id":"2667369","owner_display_name":"","owner_user_id":"2667369","post_type_id":"1","score":"1","tags":"mongodb|mongodb-query|aggregation-framework","view_count":"114"} +{"id":"15826085","title":"server side scripting in to javascript","body":"\u003cp\u003ei am try to get latitude and longitude value from ip address \u003cbr\u003e\nafter getting lat and lng value POST in to php file using AJAX and generate new xml file\u003cbr\u003e\u003c/p\u003e\n\n\u003cp\u003ethis is my html file:-\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;html xmlns=\"http://www.w3.org/1999/xhtml\"\u0026gt;\n \u0026lt;head\u0026gt;\n \u0026lt;script type=\"text/javascript\" src=\"http://j.maxmind.com/app/geoip.js\" \u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;script src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;script\u0026gt;\n function getlg(){\n var lan=geoip_latitude();\n var lng=geoip_longitude();\n var gen = $('#Sex').val();\n var date = $('#date').val();\n $.ajax({ \n type: \"POST\",\n url: \"http://localhost/SVN/trunk/home/url.php?lat=\"+lan+\"\u0026amp;lng=\"+lng+'\u0026amp;radius'+$('#radius1').val(),\n contentType: \"text/html\",\n success: function(token) {\n\n },\n error:function (xhr, ajaxOptions, thrownError){\n alert(xhr.statusText);\n alert(thrownError);\n } \n });\n\n }\n \u0026lt;/script\u0026gt;\n \u0026lt;body\u0026gt;\n\u0026lt;div id=\"region\"\u0026gt;\u0026lt;h5\u0026gt;\u0026lt;/h5\u0026gt;\u0026lt;/div\u0026gt;\nEnter Radius: \u0026lt;input type=\"text\" id=\"radius1\"\u0026gt;\u0026lt;/input\u0026gt;\n\u0026lt;input type=\"button\" id=\"filter\"onclick=\"getlg()\" value=\"Go\"\u0026gt;\n\u0026lt;/body\u0026gt;\n\u0026lt;/head\u0026gt;\n\u0026lt;/html\u0026gt; \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cbr\u003e\nthis is my php file:-\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\nfunction convertNodeValueChars($node) {\n if ($node-\u0026gt;hasChildNodes()) {\n foreach ($node-\u0026gt;childNodes as $childNode) {\n if ($childNode-\u0026gt;nodeType == XML_TEXT_NODE) {\n $childNode-\u0026gt;nodeValue = iconv('utf-8', 'ascii//TRANSLIT', $childNode-\u0026gt;nodeValue);\n }\n convertNodeValueChars($childNode); \n }\n } \n } \n$url='http://services.gisgraphy.com/geoloc/search?lat='.$_GET['lat'].'\u0026amp;lng='.$_GET['lng'].'\u0026amp;radius='.$_GET['radius'];\n $doc = new DOMDocument();\n $doc-\u0026gt;load($url);\n $doc-\u0026gt;save('General.xml');\n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ein this file i am try to Get lat and long and radius from html ajax function and getting one new xml file with help of url.\u003cbr\u003e\nbut its take so much time if radius is biggest. \u003cbr\u003e\ni want to try this php code in java script dont like server side scripting.\u003cbr\u003e\nplease help me out with this...\u003cbr\u003e\nthanks...\u003c/p\u003e","accepted_answer_id":"15826323","answer_count":"1","comment_count":"0","creation_date":"2013-04-05 04:46:34.707 UTC","last_activity_date":"2013-05-27 10:35:30.277 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2156869","post_type_id":"1","score":"0","tags":"javascript|jquery|xml|url","view_count":"189"} +{"id":"35867030","title":"How to change reactid suffix in react component","body":"\u003cp\u003eHow to change \u003ccode\u003edata-reactid\u003c/code\u003e attributes to my custom attributes like \u003ccode\u003edata-hello=\"world\"\u003c/code\u003e in react?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;a data-reactid=\"......\" \u0026gt;\u0026lt;/a\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"35970533","answer_count":"2","comment_count":"7","creation_date":"2016-03-08 12:10:01.163 UTC","favorite_count":"1","last_activity_date":"2016-04-27 23:14:58.92 UTC","last_edit_date":"2016-04-27 23:14:58.92 UTC","last_editor_display_name":"","last_editor_user_id":"759866","owner_display_name":"","owner_user_id":"5720647","post_type_id":"1","score":"0","tags":"javascript|reactjs","view_count":"349"} +{"id":"10416752","title":"Build and reference my own local package in Go","body":"\u003cp\u003eI'm playing with Google Go and I'm having fun (!), but I'm having some problems with package subsystem.\u003c/p\u003e\n\n\u003cp\u003eI'm running \u003cstrong\u003eGo 1.0.1\u003c/strong\u003e on Mac OS X Lion. I've build also various single file programs without problems (I've also build a small webapp using html/templates without problems and it compiles and runs without any error).\u003c/p\u003e\n\n\u003cp\u003eI've defined a \"reusable\" package (even.go):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epackage even\n\nfunc Even(i int) bool {\n return i % 2 == 0\n}\n\nfunc Odd(i int) bool {\n return i % 2 == 1\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand a consumer program (useeven.go):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epackage main\n\nimport (\n \"./even\"\n \"fmt\"\n)\n\nfunc main() {\n a := 5\n b := 6\n\n fmt.Printf(\"%d is even %v?\\n\", a, even.Even(a))\n fmt.Printf(\"%d is odd %v?\\n\", b, even.Odd(b))\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut when I compile the \"library\" using\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ego build even.go\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI got nothing... No errors, no message... What happens?\u003c/p\u003e\n\n\u003cp\u003eHow should I do this?\u003c/p\u003e","accepted_answer_id":"10417714","answer_count":"2","comment_count":"2","creation_date":"2012-05-02 15:22:31.863 UTC","favorite_count":"1","last_activity_date":"2014-11-07 11:35:00.57 UTC","last_edit_date":"2014-11-07 11:35:00.57 UTC","last_editor_display_name":"","last_editor_user_id":"13860","owner_display_name":"","owner_user_id":"1035792","post_type_id":"1","score":"12","tags":"compilation|package|go","view_count":"12786"} +{"id":"25616693","title":"Why won't this compile in VS Express 2013, though it compiles in MinGW?","body":"\u003cp\u003eHere's a compilable sample I stitched together from several header files. The code won't make sense because I gutted all the irrelevant parts, but the gist is that I'm implementing Scott Meyers' data proxy technique (mentioned \u003ca href=\"https://stackoverflow.com/questions/7410559/c-overloading-operators-based-on-the-side-of-assignment/7411385#7411385\"\u003ehere\u003c/a\u003e), though it's evolved into more of a wrapper than a temporary proxy. None of that should matter though—my question seems to be purely regarding a difference in compiler behaviors.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;iostream\u0026gt;\n#include \u0026lt;vector\u0026gt;\n\ntemplate\u0026lt;typename T\u0026gt;\nclass Proxy\n{\npublic:\n enum class State\n {\n NEVER_SET = 0,\n SET,\n UNSET\n };\n operator const T\u0026amp; () const\n {\n if ( _state != State::SET )\n {\n std::cout \u0026lt;\u0026lt; \"EXCEPTION\" \u0026lt;\u0026lt; std::endl;\n // TODO throw exception\n }\n return _data;\n }\n Proxy\u0026lt;T\u0026gt;\u0026amp; operator=(const T\u0026amp; val)\n {\n _data = val;\n _state = State::SET;\n return (*this);\n }\n Proxy\u0026lt;T\u0026gt;\u0026amp; operator+=(const T\u0026amp; val)\n {\n _data = (*this) + val;\n _state = State::SET;\n return (*this);\n }\nprivate:\n T _data;\n State _state = State::NEVER_SET;\n};\n\nclass Tape\n{\n};\n\ntemplate\u0026lt;typename T\u0026gt;\nclass tape : public Tape\n{\npublic:\n const Proxy\u0026lt;T\u0026gt;\u0026amp; operator[](int idx) const\n {\n return operator[](idx);\n }\n Proxy\u0026lt;T\u0026gt;\u0026amp; operator[](int idx)\n {\n if ( idx \u0026gt;= data.size() )\n {\n data.resize(idx + 1);\n }\n return data[idx];\n }\nprivate:\n std::vector\u0026lt; Proxy\u0026lt;T\u0026gt; \u0026gt; data;\n};\n\nclass CRIXUS\n{\npublic:\n virtual void Go() final {};\nprotected:\n virtual void Pre() {};\n virtual void Post() {};\n virtual void Step() = 0;\n};\n\nclass CRIXUS_MA : public CRIXUS\n{\npublic:\n int window = 30;\n tape\u0026lt;double\u0026gt; input;\n tape\u0026lt;double\u0026gt; output;\nprotected:\n virtual void Step()\n {\n double sum = 0;\n for ( int j = 0; j \u0026lt; window; j++ )\n {\n sum += input[-j];\n }\n output[0] = sum / window;\n }\n};\n\nint main()\n{\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt compiles fine on \u003ca href=\"http://ideone.com/EC8gwB\" rel=\"nofollow noreferrer\"\u003eIdeone\u003c/a\u003e as well as via Jetbrain's CLion (Toolchain: MinGW 3.20, CMake 2.8.12.2):\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/gq7ma.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eHowever it won't compile on VS Express 2013:\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/d8yhg.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eRunning the full code from CLion (which involves reading a .csv file of numbers and outputting a moving average), I can verify that the output is correct. It's just that VS won't compile the code.\u003c/p\u003e\n\n\u003cp\u003eAs far as I can tell, the cast operator\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e operator const T\u0026amp; () const\n {\n if ( _state != State::SET )\n {\n std::cout \u0026lt;\u0026lt; \"EXCEPTION\" \u0026lt;\u0026lt; std::endl;\n // TODO throw exception\n }\n return _data;\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eshould convert the \u003ccode\u003eProxy\u0026lt;T\u0026gt;\u003c/code\u003e to \u003ccode\u003eT\u003c/code\u003e, \u003cem\u003ei.e.\u003c/em\u003e \u003ccode\u003eProxy\u0026lt;double\u0026gt;\u003c/code\u003e to \u003ccode\u003edouble\u003c/code\u003e. And when I forcibly cast the offending line,\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e sum += (double)input[-j];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eit works fine. Any ideas?\u003c/p\u003e","accepted_answer_id":"25617043","answer_count":"1","comment_count":"10","creation_date":"2014-09-02 05:52:47.397 UTC","last_activity_date":"2014-09-02 06:23:06.52 UTC","last_edit_date":"2017-05-23 11:57:15.46 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"925913","post_type_id":"1","score":"3","tags":"c++|compiler-errors|visual-studio-2013|mingw|visual-studio-express","view_count":"136"} +{"id":"18901722","title":"Temp table from two functions into a pivot table","body":"\u003cp\u003eI need to create a pivot table from two functions, because of the number of records involved in this, I want to use a temp table.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT [OrderNumber]\n ,[OrderName]\n ,[Code]\n ,[Amount1]\n INTO #TempPayment \nFROM [dbo].[fn_Reconciliation_PaymentByDateRange](@BeginDate,@EndDate) \n\nSELECT [OrderNumber]\n ,[OrderName]\n ,[Code]\n ,[Amount1]\n INTO #TempInvoice\nFROM [dbo].[fn_Reconciliation_InvoiceByDateRange](@BeginDate,@EndDate) \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe above is what I was using for creating 2 temp tables, but I would like to see if I could condense it down into one temp table.\u003c/p\u003e\n\n\u003cp\u003eEnd result of this is that I need to be able to pull the \"Select\" portion listed above and then \u003ccode\u003epivot\u003c/code\u003e them on the \u003ccode\u003eCode\u003c/code\u003e Column. I can handle that, but I don't really want to end up generating a 3rd Temp table, but I think I might end up needing to.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-09-19 17:53:27.393 UTC","last_activity_date":"2013-09-19 18:36:45.003 UTC","last_edit_date":"2013-09-19 17:58:20.913 UTC","last_editor_display_name":"","last_editor_user_id":"2055998","owner_display_name":"","owner_user_id":"2217517","post_type_id":"1","score":"0","tags":"sql|sql-server|function|pivot","view_count":"48"} +{"id":"13498395","title":"Left join on character + linking value","body":"\u003cp\u003eI'll keep this simple. I need to left join 2 tables, Master \u0026amp; Child both with a PartNum field. Values for the fields are like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eMaster\n-----\n1003\n1004\n1005\n...\n\nChild\n-----\n1003\nC1003\nK1003\npp1003\ncc1003\n1004\n...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI only want to join on child records beginning with a single 'C', \u003c/p\u003e\n\n\u003cp\u003eso...\u003c/p\u003e\n\n\u003cp\u003e1003 would only return C1003\u003c/p\u003e\n\n\u003cp\u003eAny help for this MySql newbie would be appreciated.\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2012-11-21 17:07:17.453 UTC","last_activity_date":"2012-11-21 17:16:41.75 UTC","last_edit_date":"2012-11-21 17:10:23.967 UTC","last_editor_display_name":"","last_editor_user_id":"426671","owner_display_name":"","owner_user_id":"1842670","post_type_id":"1","score":"2","tags":"mysql","view_count":"77"} +{"id":"24182509","title":"Catch error messages from ksh script executed by getRuntime().exec using getErrorStream?","body":"\u003cp\u003eI need to execute ksh script from java, where I want to exit with error and provide error message.\u003c/p\u003e\n\n\u003cp\u003eexit 1 - exits with error code 1 \u003c/p\u003e\n\n\u003cp\u003eBut what should I do in script in order to catch the error message with getErrorStream?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e proc = Runtime.getRuntime().exec(SCRIPT_PATH);\n\n int exitV = proc.waitFor();\nif(exitV !=0){\n InputStream iputStream= proc.getErrorStream();\n BufferedReader iput = new BufferedReader(new InputStreamReader(iputStream));\n while ((line = iput.readLine()) != null){\n msg.append(line);\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-06-12 10:48:20.07 UTC","last_activity_date":"2014-06-12 10:50:36.043 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1847484","post_type_id":"1","score":"0","tags":"java|unix|ksh","view_count":"92"} +{"id":"20543282","title":"accessing phonegap database in android native","body":"\u003cp\u003eI m new to phone gap platform.\nI'm facing a issue in accessing the phone gap db in android native code.\u003c/p\u003e\n\n\u003cp\u003eIn one of the application I want to do a synch mechanism\nFor every 10 minutes the alarm broadcast receiver will wake up the class and start a background service. In that service we are accessing the phone gap db . if in case the db is being used by the JavaScript code, n I start to fetch the record from the same db , I'm getting an exception SQL ITE database locked exception .. Please help me in sorting out this problem.\u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2013-12-12 12:15:04.643 UTC","favorite_count":"1","last_activity_date":"2013-12-12 12:15:04.643 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"831051","post_type_id":"1","score":"2","tags":"cordova","view_count":"200"} +{"id":"42944520","title":"Installing Wordpress in Windows Hosting Godaddy Subfolder: 500 Server Error","body":"\u003cp\u003eI have a newly purchased Windows Hosting in GoDaddy with its own domain name. Before anything else, I wanted to install a wordpress blog in the subfolder of the domain like so: \u003ccode\u003ehttp://example.com/blog\u003c/code\u003e. I followed the step by step tutorial provided by GoDaddy but when I try to browse example.com/blog it throws 500 server error. \u003c/p\u003e\n\n\u003cp\u003eI tried doing the same installation procedure but this time using the subdomain like so: \u003ccode\u003eblog.example.com\u003c/code\u003e and it worked without problem. I would like to use a subfolder in my domain instead of a subdomain. Is there a pre-configuration steps (nowhere to be found in the installation guide) I have to do in order to do so?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eUPDATE\u003c/strong\u003e: I tried browsing for solutions and it seemed to me that my problem might be about \u003ccode\u003e.htaccess\u003c/code\u003e but I don't exactly know how to configure or where to find it (im a total newbie in web hosting esp godaddy). Please ask if you need more details. Thank you.\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2017-03-22 06:46:52.933 UTC","last_activity_date":"2017-03-22 06:52:16.573 UTC","last_edit_date":"2017-03-22 06:52:16.573 UTC","last_editor_display_name":"","last_editor_user_id":"4771953","owner_display_name":"","owner_user_id":"4771953","post_type_id":"1","score":"0","tags":"wordpress","view_count":"127"} +{"id":"42442830","title":"Custom event initialisation issue","body":"\u003cp\u003eI use custom events on my graphic objects to notify of object's changes :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class OnLabelWidthChangedEventArgs : EventArgs\n{\n private float _width;\n\n public float Width\n {\n get { return _width; }\n set { _width = value; }\n }\n\n public OnLabelWidthChangedEventArgs(float widthParam) : base()\n {\n Width = widthParam;\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is the object firing this event :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class DisplayLabel : DisplayTextObject\n{\n public event EventHandler\u0026lt;OnLabelWidthChangedEventArgs \u0026gt; OnLabelSizeChanged;\n\n public DisplayLabel(ScreenView _screenParam, IXapGraphicObject obj) : base(_screenParam, obj)\n {\n l = new Label();\n SetSize();\n }\n\n public override void SetSize()\n {\n Width = w;\n Height = h;\n if(OnLabelWidthChanged != null)\n OnLabelSizeChanged.Invoke(this, new OnLabelWidthChangedEventArgs(w)); // OnLabelSizeChanged is null\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe \u003ccode\u003eOnLabelSizeChanged\u003c/code\u003e is always null, how can I initialise it.\u003c/p\u003e\n\n\u003cp\u003eI have a working solution with delegates instead of custom events:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public event OnWidthChanged WidthChanged = delegate { };\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut I'd like to know how to solve this issue with custom events.\u003c/p\u003e\n\n\u003cp\u003eThank you for your help.\u003c/p\u003e","accepted_answer_id":"42442973","answer_count":"1","comment_count":"2","creation_date":"2017-02-24 15:49:13.053 UTC","last_activity_date":"2017-02-24 17:23:59.51 UTC","last_edit_date":"2017-02-24 17:23:59.51 UTC","last_editor_display_name":"","last_editor_user_id":"13302","owner_display_name":"","owner_user_id":"5065750","post_type_id":"1","score":"-2","tags":"c#|events","view_count":"32"} +{"id":"6609587","title":"alternative to firefox (firebug) for developers","body":"\u003cp\u003eHi I am big fan of firebug and firefox. Cant imagine development without them. But the problem is end of the day firefox heaps up to 1GB of ram. I wish to see if there is an alternative. I know chrome exists but I didnt find it so comfortable. \n\u003cbr /\u003e \n\u003cbr /\u003e \nIs it (chrome) really worth to learn from scratch \u003cbr /\u003e\u003cbr /\u003e\nP.S. If there exists a Question already , Please direct me there. Alternative to firefox !! \u003c/p\u003e","accepted_answer_id":"6609668","answer_count":"1","comment_count":"7","creation_date":"2011-07-07 11:03:33.837 UTC","favorite_count":"1","last_activity_date":"2011-07-07 11:10:16.787 UTC","last_edit_date":"2011-07-07 11:08:46.37 UTC","last_editor_display_name":"","last_editor_user_id":"413418","owner_display_name":"","owner_user_id":"413418","post_type_id":"1","score":"2","tags":"firefox|google-chrome|firebug","view_count":"1843"} +{"id":"9003646","title":"Parsing pdf to populate tableview","body":"\u003cp\u003eI am working on an app.The requirement is I need to populate the tableViewCells based on a pdf file.Like for example the headers of the table view will be a topic name from pdf and the contents will be the data inside the header.\nI tried googling out but didn't find anything useful.Earlier I thought of parsing the pdf but this approach doesnot seems to be useful because i didn't find any pdf parser useful.\nThe last approach I thought is adding the contents in a plist file and parsing that plist,but i know this is not best way to do it.\u003c/p\u003e\n\n\u003cp\u003eSo guys please suugest some better approach.\u003c/p\u003e\n\n\u003cp\u003eThank you\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2012-01-25 13:39:58.59 UTC","last_activity_date":"2012-01-25 13:39:58.59 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"997043","post_type_id":"1","score":"1","tags":"iphone|parsing|pdf","view_count":"91"} +{"id":"47212180","title":"How to free allocated data in linux - Init and Idel proccess before termination","body":"\u003cp\u003eI allocate an array in each process' task_struct. For regular proccess I changed sys_wait4 inside exit to free the allocated array just before changing from zombie to fully terminated. But does it also works for Init and Idle? (pid 1 and 0 respectivly) Do I need to do something else to free the allocated space?\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-11-09 21:51:23.017 UTC","last_activity_date":"2017-11-09 21:51:23.017 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5721565","post_type_id":"1","score":"0","tags":"linux|linux-kernel","view_count":"19"} +{"id":"31361278","title":"Converting \"document format\" / XML to CSV","body":"\u003cp\u003eI'm trying to convert:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;doc id=\"123\" url=\"http://url.org/thing?curid=123\" title=\"title\"\u0026gt; \nTitle\n\ntext text text more text\n\n\u0026lt;/doc\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003einto a CSV file (the file has a ton of similarly formatted \"documents\"). If it was a regular XML file I think I would be able to figure it out with a solution like \u003ca href=\"https://stackoverflow.com/questions/365312/xml-to-csv-using-xslt\"\u003ethis\u003c/a\u003e but since the above code is not in regular XML format I'm stuck. \u003c/p\u003e\n\n\u003cp\u003eWhat I'm trying to do is import data into postgresql, and from what I gather it would be easier to import this information if it's in CSV format, (if there's another way, please let me know). What I need is to separate out \"id\", \"url\" \"title\" and \"text/body\". \u003c/p\u003e\n\n\u003cp\u003eBonus question: the first line in the text/body is the title of the document, would it be possible to remove/manipulate this first line in the conversion? \u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","accepted_answer_id":"31361890","answer_count":"1","comment_count":"3","creation_date":"2015-07-11 20:01:47.31 UTC","favorite_count":"1","last_activity_date":"2015-07-12 21:12:22.523 UTC","last_edit_date":"2017-05-23 12:08:06.007 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"5106578","post_type_id":"1","score":"0","tags":"python|xml|postgresql|csv|xslt","view_count":"556"} +{"id":"5353291","title":"Multiple inheritance without virtual functions in c++","body":"\u003cp\u003eI came across the diamond problem and found different solutions for different cases with a single diamond. However I couldn't find a solution for 'chained' diamonds.\u003c/p\u003e\n\n\u003cp\u003eAccording to the structure: yes, I want to have multiple baseclasses everytime, so virtual inheritance isn't a solution (is it even called diamond then?). I also wanted to avoid get/set-functions for every middle-layer of a diamond.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ep p\n| |\nk k\n \\ /\n s\n\nclass parent { int val; };\nclass kid1 : public parent {};\nclass kid2 : public parent {};\nclass school : public kid1, public kid2 {};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAccessing val in the parent class works now like follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eschool* s = new school;\ns-\u0026gt;kid1::val=1; // works\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut what about the next 'chained' diamond:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ep p p p\n| | | |\nk k k k\n \\ / \\ /\n s s\n | |\n c c\n \\ /\n w\n\nclass country1 : public school {};\nclass country2 : public school {};\nclass world : public country1, public country2 {};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAccessing val via:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eworld* w = new world;\nw-\u0026gt;country1::kid1::val=1; // error\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eresults in: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eerror: ‘kid1’ is an ambiguous base of ‘world’\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhy? Isn't the route to the value well defined?\u003c/p\u003e","accepted_answer_id":"5353451","answer_count":"2","comment_count":"6","creation_date":"2011-03-18 14:19:38.81 UTC","favorite_count":"3","last_activity_date":"2016-07-08 20:46:54.63 UTC","last_edit_date":"2016-07-08 20:46:54.63 UTC","last_editor_display_name":"","last_editor_user_id":"1783163","owner_display_name":"","owner_user_id":"666168","post_type_id":"1","score":"11","tags":"c++|inheritance|diamond-problem","view_count":"465"} +{"id":"2701538","title":"String Formatting Tricks/Docs","body":"\u003cp\u003eWas reading the response by Shaggy Frog to \u003ca href=\"https://stackoverflow.com/questions/2700909/nsstring-stringwithformat-question\"\u003ethis post\u003c/a\u003e and was intrigued by the following line of code: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eNSLog(@\"%@\", [NSString stringWithFormat:@\"%@:%*s%5.2f\", key, padding, \" \", [object floatValue]]);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI know string formatting is an age old art but I'm kinda doing the end around into Cocoa/Obj-C programming and skipped a few grades along the way. Where is a good (best) place to learn all the string formatting tricks allowed in NSString's \u003ccode\u003estringWithFormat\u003c/code\u003e? I'm familiar with Apple's \u003ca href=\"http://developer.apple.com/mac/library/documentation/cocoa/conceptual/Strings/Articles/formatSpecifiers.html\" rel=\"nofollow noreferrer\"\u003eString Format Specifiers\u003c/a\u003e page but from what I can tell it doesn't shed light on whatever is happening with \u003ccode\u003e%*s\u003c/code\u003e or the \u003ccode\u003e%5.2f\u003c/code\u003e (not to mention the 3 apparent placeholders followed by 4 arguments) above?!? \u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2010-04-23 19:47:00.407 UTC","last_activity_date":"2010-04-23 20:11:53.247 UTC","last_edit_date":"2017-05-23 10:32:34.69 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"63761","post_type_id":"1","score":"1","tags":"c|objective-c|cocoa|string","view_count":"722"} +{"id":"8781926","title":"IE Error : Unable to set value of the property 'innerHTML': object is null or undefined","body":"\u003cp\u003eThis simple piece of code (progress bar) works fine everywhere except IE (tried 9 and 8) :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;!-- Progress bar holder --\u0026gt;\n \u0026lt;div id=\"progress\" style=\"width:500px;border:1px solid #eee;\"\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;!-- Progress information --\u0026gt;\n \u0026lt;div id=\"information\" style=\"width\"\u0026gt;\u0026lt;/div\u0026gt;\n\n \u0026lt;?php\n\n // Total processes\n $total = 10;\n\n // Loop through process\n for($i=1; $i\u0026lt;=$total; $i++){\n // Calculate the percentation\n $percent = intval($i/$total * 100).\"%\";\n\n // Javascript for updating the progress bar and information\n echo '\u0026lt;script language=\"javascript\"\u0026gt;\n document.getElementById(\"progress\").innerHTML=\"\u0026lt;div style=\\\"width:'.$percent.'; background-color:#ddd;\\\"\u0026gt;\u0026amp;nbsp;\u0026lt;/div\u0026gt;\";\ndocument.getElementById(\"information\").innerHTML=\"'.$i.' row(s) processed.\";\n\u0026lt;/script\u0026gt;';\n\n// This is for the buffer achieve the minimum size in order to flush data\necho str_repeat(' ',1024*64);\n\n// Send output to browser immediately\nflush();\n\n// Sleep one second so we can see the delay\nsleep(1);\n}\n\n// Tell user that the process is completed\necho '\u0026lt;script language=\"javascript\"\u0026gt;document.getElementById(\"information\").innerHTML=\"Process completed\"\u0026lt;/script\u0026gt;';\n\n ?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIE shows the error \" Unable to set value of the property 'innerHTML': object is null or undefined \".\nThe problem seems to be here :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e document.getElementById(\"progress\").innerHTML=\"\u0026lt;div style=\\\"width:'.$percent.';background-color:#ddd;\\\"\u0026gt;\u0026amp;nbsp;\u0026lt;/div\u0026gt;\";\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ediv in this case doesn't work properly in IE (at least as far as I understood)\u003c/p\u003e\n\n\u003cp\u003eTried to fix it by myself, but it's too complicated for me. Any help will be much appreciated.\nThanks )\u003c/p\u003e","answer_count":"2","comment_count":"7","creation_date":"2012-01-08 22:27:53.527 UTC","favorite_count":"1","last_activity_date":"2013-06-25 08:01:46.907 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1137647","post_type_id":"1","score":"3","tags":"internet-explorer|innerhtml","view_count":"11910"} +{"id":"9433216","title":"Compiling Speex successful on iPhone simulator but failed on iOS device","body":"\u003cp\u003eI tried to compile Speex library on iOS following \u003ca href=\"http://codeforfun.wordpress.com/2010/04/29/compile-speex-for-iphone/\" rel=\"nofollow\"\u003ethis tutorial\u003c/a\u003e and succeeded to do it in the iPhone simulator, but the build fails on a real device. I get some errors like \u003ccode\u003e\"Use of undeclared identifier __m128\"\u003c/code\u003e, which looks like there are some problems with compiling C/C++ sources on a real device. I would be very thankful if someone could propose a solution.\u003c/p\u003e\n\n\u003cp\u003eHere is also my source code: \u003ca href=\"https://github.com/artem888/SpeexTest\" rel=\"nofollow\"\u003ehttps://github.com/artem888/SpeexTest\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eArtem\u003c/p\u003e","accepted_answer_id":"9600030","answer_count":"2","comment_count":"2","creation_date":"2012-02-24 15:22:56.917 UTC","favorite_count":"2","last_activity_date":"2013-12-09 21:08:13.573 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"894738","post_type_id":"1","score":"1","tags":"iphone|ios|speex","view_count":"1564"} +{"id":"16810125","title":"Improve efficiency of modules","body":"\u003cp\u003eI am running the loop in this method for around 1 million times but it is taking a lot of time maybe due O(n^2) , so is there any way to improve these two modules :- \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef genIndexList(length,ID):\n indexInfoList = []\n id = list(str(ID))\n for i in range(length):\n i3 = (str(decimalToBase3(i)))\n while len(i3) != 12:\n i3 = '0' + i3\n p = (int(str(ID)[0]) + int(i3[0]) + int(i3[2]) + int(i3[4]) + int(i3[6]) + int(i3[8]) + int(i3[10]))%3\n indexInfoList.append(str(ID)+i3+str(p))\n return indexInfoList \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand here is the method for to convert number to base3 :- \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef decimalToBase3(num):\n i = 0\n if num != 0 and num != 1 and num != 2:\n number = \"\"\n while num != 0 :\n remainder = num % 3 \n num = num / 3 \n number = str(remainder) + number\n return int(number)\n else:\n return num\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am using python to make a software and these 2 functions are a part of it.Please suggest why these 2 methods are so slow and how to improve efficiency of these methods.\u003c/p\u003e","accepted_answer_id":"16810684","answer_count":"1","comment_count":"8","creation_date":"2013-05-29 09:23:58.433 UTC","last_activity_date":"2013-05-29 10:18:01.137 UTC","last_edit_date":"2013-05-29 09:46:59.58 UTC","last_editor_display_name":"","last_editor_user_id":"1833901","owner_display_name":"","owner_user_id":"1833901","post_type_id":"1","score":"0","tags":"algorithm|python-2.7|big-o|performance","view_count":"36"} +{"id":"22853816","title":"How to return text to a span in a .cshtml from a controller in c# asp.net","body":"\u003cp\u003eI just have a question that I do not know if it is even possible. I have been searching around and have not found anything. I am curious that if there is anyway that in my Login Controller. If one of my if statements fail is there any way that I could return some text to a span on my Login view?\u003c/p\u003e\n\n\u003cp\u003eSo say this fails during my log in method in my login controller:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eif (BadCredentials(checkLogin) == null)\n{\n return RedirectToAction(\"Login\", \"Login\"); \n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs there any way that I could set that to return text to this span instead of a redirect?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;span class=\"help-block\"\u0026gt;\u0026lt;/span\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"22853843","answer_count":"4","comment_count":"0","creation_date":"2014-04-04 04:49:54.073 UTC","favorite_count":"1","last_activity_date":"2017-09-01 10:06:22.727 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2218458","post_type_id":"1","score":"0","tags":"c#|html|asp.net|asp.net-mvc|razor","view_count":"1163"} +{"id":"1892021","title":"Cookie: ASP.NET SessionId Issue","body":"\u003cp\u003eI have a load generator that appends a ASP.NET_SessionId to the Cookie when making a Soap test call from Machine A to Machine B.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCookie: ASP.NET_SessionId=gf0ouay24sdneiuicpiggn45;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, when I'm running the soap test hitting my local server it doesn't have an ASP.NET_Session variable in the cookie.\u003c/p\u003e\n\n\u003cp\u003eWhy is this happening?\u003c/p\u003e\n\n\u003cp\u003eUPDATE:\u003c/p\u003e\n\n\u003cp\u003eI'm getting this issue now on the server:\u003c/p\u003e\n\n\u003cp\u003eForms authentication failed for the request. Reason: The ticket supplied was invalid. \u003c/p\u003e\n\n\u003cp\u003eI've followed this: \u003ca href=\"http://msmvps.com/blogs/omar/archive/2006/08/20/108307.aspx\" rel=\"nofollow noreferrer\"\u003ehttp://msmvps.com/blogs/omar/archive/2006/08/20/108307.aspx\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eBut to no avail.\u003c/p\u003e","answer_count":"2","comment_count":"3","creation_date":"2009-12-12 02:15:17.533 UTC","favorite_count":"1","last_activity_date":"2010-03-17 03:00:03.853 UTC","last_edit_date":"2009-12-12 03:32:14.01 UTC","last_editor_display_name":"","last_editor_user_id":"59035","owner_display_name":"","owner_user_id":"59035","post_type_id":"1","score":"0","tags":".net|asp.net|session|cookies","view_count":"1978"} +{"id":"6867588","title":"How to convert escaped characters in Python?","body":"\u003cp\u003eI want to convert strings containing escaped characters to their normal form, the same way Python's lexical parser does:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026gt;\u0026gt;\u0026gt; escaped_str = 'One \\\\\\'example\\\\\\''\n\u0026gt;\u0026gt;\u0026gt; print(escaped_str)\nOne \\'Example\\'\n\u0026gt;\u0026gt;\u0026gt; normal_str = normalize_str(escaped_str)\n\u0026gt;\u0026gt;\u0026gt; print(normal_str)\nOne 'Example'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eOf course the boring way will be to replace all known escaped characters one by one:\n\u003ca href=\"http://docs.python.org/reference/lexical_analysis.html#string-literals\" rel=\"nofollow\"\u003ehttp://docs.python.org/reference/lexical_analysis.html#string-literals\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eHow would you implement \u003ccode\u003enormalize_str()\u003c/code\u003e in the above code?\u003c/p\u003e","accepted_answer_id":"6868026","answer_count":"4","comment_count":"2","creation_date":"2011-07-29 01:08:01.84 UTC","favorite_count":"1","last_activity_date":"2017-10-13 19:51:40.783 UTC","last_edit_date":"2011-07-29 17:27:39.447 UTC","last_editor_display_name":"","last_editor_user_id":"529508","owner_display_name":"","owner_user_id":"529508","post_type_id":"1","score":"5","tags":"python|string-formatting","view_count":"10423"} +{"id":"16636996","title":"Replace or delete certain characters from filenames of all files in a folder","body":"\u003cp\u003eHow do I delete certain characters or replace certain characters with other characters by some batch file execution, for filenames of all files in a Windows folder in one go, is there a DOS command for that?\u003c/p\u003e","accepted_answer_id":"16638371","answer_count":"5","comment_count":"0","creation_date":"2013-05-19 16:43:26.84 UTC","favorite_count":"24","last_activity_date":"2017-07-24 21:33:04.077 UTC","last_edit_date":"2015-01-13 00:20:31.287 UTC","last_editor_display_name":"","last_editor_user_id":"3826372","owner_display_name":"","owner_user_id":"885920","post_type_id":"1","score":"35","tags":"windows|file|powershell|batch-file|cmd","view_count":"123902"} +{"id":"36439675","title":"Refactoring Async/Await out for parallel processing","body":"\u003cp\u003eStill going through a learning phase with C# and ran into a question I needed help with. Considering the following code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate async Task\u0026lt;String\u0026gt; PrintTask()\n{\n await Task.Delay(3000);\n return \"Hello\";\n}\n\nprivate async void SayHelloTwice()\n{\n string firstHello = await PrintTask();\n string secondHello = await PrintTask();\n\n Console.WriteLine(firstHello);\n Console.WriteLine(secondHello);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eRight now SayHelloTwice() will take 6 seconds to complete. However, I want the retrieval tasks to be ran in parallel so that it only takes 3 seconds to complete. How would I refactor my code to achieve that? Thanks!\u003c/p\u003e","accepted_answer_id":"36439960","answer_count":"3","comment_count":"1","creation_date":"2016-04-06 01:03:57.87 UTC","favorite_count":"2","last_activity_date":"2016-04-06 09:54:32.6 UTC","last_edit_date":"2016-04-06 09:54:32.6 UTC","last_editor_display_name":"","last_editor_user_id":"41071","owner_display_name":"","owner_user_id":"4263318","post_type_id":"1","score":"4","tags":"c#|asynchronous|parallel-processing|async-await|task","view_count":"230"} +{"id":"25419004","title":"check if session is valid or not in servlet","body":"\u003cp\u003e/****NOTE****/\nin WEB.XML file I am setting session timeout property,\nso may be session is expired.\n/************/\u003c/p\u003e\n\n\u003cp\u003eI am using HttpSession object to manage session\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eHttpSesion session = myPersonalMethodThatReturnHttpSessionObject();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e//I am using Eclipse and it provide me following details in Debug view I put Image Below \u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/hqizQ.png\" alt=\"In this Image session has field isValid \"\u003e\u003c/p\u003e\n\n\u003cp\u003e//so how can i get value of isValid field or method so here i can put in if condition\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eif(session != null)\n{\n //removing attributes from session \n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e/*************************************More Description*******************************************/\u003c/p\u003e\n\n\u003cp\u003eMy Problem is...\nnote1 --\u003e session timeout is 30 min.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eStep1 some one login my web apllication\nStep2 session is created.\nStep3 if user close web application without signout\nStep4 all session attribute is there \nStep5 if another user try to login.\nStep6 I try to remove all session attribute and store new attribute value.\nStep7 Above functionality work properly but, while session is invalidate can't remove session attribute so i need to put condition in if session is valid that remove attribute else do nothing so I need to check session is valod or not. \n\u003c/code\u003e\u003c/pre\u003e","answer_count":"5","comment_count":"2","creation_date":"2014-08-21 05:44:49.773 UTC","last_activity_date":"2014-08-22 08:02:09.09 UTC","last_edit_date":"2014-08-22 04:42:40.64 UTC","last_editor_display_name":"","last_editor_user_id":"3418782","owner_display_name":"","owner_user_id":"3418782","post_type_id":"1","score":"1","tags":"java|session|servlets","view_count":"3797"} +{"id":"3621121","title":"SQL Server nullable values storage impact","body":"\u003cp\u003eIn SQL server, do null values occupy less space than non-null values, or is null represented as a flag indicating that no value is stored (and thus actually requiring MORE space to store null values).\u003c/p\u003e\n\n\u003cp\u003eThe comparisons would not be null values vs. not null values stored in the same column, but null values stored in a nullable column and actual values stored in a not-null column.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eI understand it may be common knowledge that NULL occupies less space, but with optimization, is there an actual significant impact?\u003c/strong\u003e\u003c/p\u003e","answer_count":"3","comment_count":"6","creation_date":"2010-09-01 18:40:28.343 UTC","last_activity_date":"2010-09-02 14:37:32.053 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"143095","post_type_id":"1","score":"4","tags":"sql-server|storage|nullable","view_count":"1414"} +{"id":"37765673","title":"Changing hover style for QComboBox","body":"\u003cp\u003eI am using Qt 5.1.1\nI am trying to change the background color and text color for an element when the cursor is on that element. I have tried the following style sheet:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eQComboBox QAbstractItemView::item:hover {color: black;background: white }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut this and too many tried CSS code hasn't worked. What is the correct way?\u003c/p\u003e","accepted_answer_id":"37774287","answer_count":"2","comment_count":"0","creation_date":"2016-06-11 15:54:10.293 UTC","last_activity_date":"2017-05-21 15:25:51.243 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1378496","post_type_id":"1","score":"0","tags":"css|qt","view_count":"249"} +{"id":"12039194","title":"get a specific number in a string","body":"\u003cp\u003eI am trying to parse a text and get a value from a text like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ePage 1 of 6\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am looking at extracting the end number using java.\nso my out put in this case should be 6.\u003c/p\u003e\n\n\u003cp\u003eis there any java string functions I can use? (or) any other way? \u003c/p\u003e","accepted_answer_id":"12039211","answer_count":"5","comment_count":"3","creation_date":"2012-08-20 14:05:47.94 UTC","last_activity_date":"2012-08-20 14:25:49.093 UTC","last_edit_date":"2012-08-20 14:25:49.093 UTC","last_editor_display_name":"","last_editor_user_id":"1460628","owner_display_name":"","owner_user_id":"1530845","post_type_id":"1","score":"0","tags":"java|parsing","view_count":"170"} +{"id":"37954429","title":"Disable next navigation link in bootstrap wizard","body":"\u003cp\u003eI have a simple bootstrap wizard. I want to disable the next navigation link based on some condition. Can someone please tell me how to do it using jQuery or CSS or any other method.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;div id=\"rootwizard\"\u0026gt;\n \u0026lt;div class=\"navbar\"\u0026gt;\n \u0026lt;div class=\"navbar-inner\"\u0026gt;\n \u0026lt;div class=\"container\"\u0026gt;\n \u0026lt;ul\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#tab1\" data-toggle=\"tab\"\u0026gt;Item Search\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#tab2\" data-toggle=\"tab\"\u0026gt;Item Details\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li\u0026gt;\u0026lt;a href=\"#tab3\" data-toggle=\"tab\"\u0026gt;Add SPR\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n\n \u0026lt;div class=\"tab-content\"\u0026gt;\n \u0026lt;ul class=\"pager wizard\"\u0026gt;\n \u0026lt;li class=\"previous first\" style=\"display: none;\"\u0026gt;\u0026lt;a href=\"#\"\u0026gt;First\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li class=\"previous\"\u0026gt;\u0026lt;a href=\"#\"\u0026gt;Previous\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li class=\"next last\" style=\"display: none;\"\u0026gt;\u0026lt;a href=\"#\"\u0026gt;Last\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;li class=\"next\"\u0026gt;\u0026lt;a href=\"#\"\u0026gt;Next\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","accepted_answer_id":"37954648","answer_count":"3","comment_count":"2","creation_date":"2016-06-21 20:56:29.877 UTC","last_activity_date":"2016-06-21 21:15:08.617 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3637345","post_type_id":"1","score":"-1","tags":"javascript|jquery|css|twitter-bootstrap","view_count":"923"} +{"id":"14038619","title":"How can I create popup window by jquery to external page and get a value from it to the parent page when I click a button there?","body":"\u003cp\u003eHow can I create popup window by jquery to external page that contain a form and get a value from that external page to the parent page when I click a button there?\u003c/p\u003e","answer_count":"2","comment_count":"3","creation_date":"2012-12-26 09:38:30.803 UTC","favorite_count":"1","last_activity_date":"2012-12-26 09:42:21.757 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1929518","post_type_id":"1","score":"1","tags":"jquery|popupwindow","view_count":"2672"} +{"id":"41540626","title":"i got 400 error in google webmaster using codeigniter3 but site works well in browser","body":"\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/OXfiB.png\" rel=\"nofollow noreferrer\"\u003e400 error found in google webmaster\u003c/a\u003e\n%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 url problem in google webmaster area only..\ni use codeinter3 and apache2\nmy .ht-access file content is here\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;IfModule mod_rewrite.c\u0026gt;\nRewriteEngine On\nRewriteBase /\nRewriteCond %{REQUEST_URI} ^system.*\nRewriteRule ^(.*)$ /index.php?/$1 [L]\nRewriteCond %{REQUEST_URI} ^application.*\nRewriteRule ^(.*)$ /index.php?/$1 [L]\nRewriteCond %{REQUEST_FILENAME} !-f\nRewriteCond %{REQUEST_FILENAME} !-d\nRewriteRule ^(.*)$ index.php?/$1 [L]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-01-09 03:32:11.29 UTC","last_activity_date":"2017-01-09 03:32:11.29 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7392621","post_type_id":"1","score":"0","tags":"apache|codeigniter-3|google-webmaster-tools|google-pagespeed","view_count":"18"} +{"id":"5710180","title":"how to make sure that the value in a dynamic textbox is not empty using javascript","body":"\u003cp\u003eI have nearly 80 textbox controls being created dynamically on the change of a dropdownlist item.\u003c/p\u003e\n\n\u003cp\u003eI need to make sure that none of these textboxes are empty when the user clicks on add item button.\u003c/p\u003e\n\n\u003cp\u003eI am aware of document.getElementbyid , however it does not serve my purpose as I will not know the id of the textboxes. The ids of the textboxes created start with \"txt\".\u003c/p\u003e\n\n\u003cp\u003eCan anyone paste a sample code of how to achieve this.\u003c/p\u003e\n\n\u003cp\u003eThanks in advance.\u003c/p\u003e","accepted_answer_id":"5710199","answer_count":"1","comment_count":"1","creation_date":"2011-04-19 00:02:58.657 UTC","last_activity_date":"2011-04-19 00:07:38.763 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"714330","post_type_id":"1","score":"0","tags":"asp.net","view_count":"207"} +{"id":"47095293","title":"RasterLayer 64-bits into a RasterLayer 8-bits with R","body":"\u003cp\u003eI am working with R and use the following libraries: raster, sp, rgeos, rgdal\u003c/p\u003e\n\n\u003cp\u003eI created a RasterLayer from a SpatialPointsDataFrame. \nThis raster can easily be exported using \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eraster::writeRaster(ras8b,\n filename=\"filepath\", format=\"GTiff\" ,\n datatype='INT1U')\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe problem which I run in is the following: \nI need a 8BitsPerPixel GeoTiff. But the code I use saves the raster to an 64 BitsPerPixel Raster.\u003c/p\u003e\n\n\u003cp\u003eI tried to solve the problem already following several options I found on StackOverflow. For example:\n\u003ca href=\"https://stackoverflow.com/questions/31953180/rasterlayer-16-bits-into-a-rasterlayer-8-bits\"\u003eRasterLayer 16-bits into a RasterLayer 8-bits\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThis first option gave me a 8 BitsPerPixel raster, but no values in it, just NAs.\u003c/p\u003e\n\n\u003cp\u003eOr I converted the RasterLayer in R to integer following this post:\n\u003ca href=\"https://gis.stackexchange.com/questions/175383/round-does-not-return-an-integer-raster-in-r/175384\"\u003ehttps://gis.stackexchange.com/questions/175383/round-does-not-return-an-integer-raster-in-r/175384\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eBut R continues to store the Raster as 64 BitsPerPixel Raster.\u003c/p\u003e\n\n\u003cp\u003eSomebody has a solution?\nIf you need more information just let me know. \nThanks a lot. Best regards.\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2017-11-03 12:00:34.913 UTC","last_activity_date":"2017-11-09 06:08:08.997 UTC","last_edit_date":"2017-11-03 13:42:25.643 UTC","last_editor_display_name":"","last_editor_user_id":"8880376","owner_display_name":"","owner_user_id":"8880376","post_type_id":"1","score":"0","tags":"r|types|geotiff","view_count":"22"} +{"id":"16379786","title":"Cannot unload previous swf while loading the new ones","body":"\u003cp\u003eI have made a main navigation page in adobe flash and 3 buttons in it. I have used this code in order to call some external swf's according to the button pressed. Problem is that when i press the button to load one swf i want the previous one to be unloaded. How can i do that i have tried everything\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar myLoader:Loader = new Loader(); \nvar myLoaderMain:URLRequest = new URLRequest(\"main1.swf\");\nvar myLoaderQuiz:URLRequest = new URLRequest(\"quiz.swf\");\nvar myLoaderAnimation:URLRequest = new URLRequest(\"athens_animation.swf\");\nvar myLoaderVideo:URLRequest = new URLRequest(\"videogallery.swf\");\n\n\nvideogallerybtn.addEventListener(MouseEvent.CLICK, videoFunc);\n\nfunction videoFunc(curEvt:MouseEvent) {\nmyLoader.load(myLoaderVideo);\naddChild(myLoader); \n }\n\n Quizbtn.addEventListener(MouseEvent.CLICK, quizFunc);\n function quizFunc(curEvt:MouseEvent) {\nmyLoader.load(myLoaderQuiz);\naddChild(myLoader);\n\n }\n\n Animationbtn.addEventListener(MouseEvent.CLICK, AnimationFunc);\n\n function AnimationFunc(curEvt:MouseEvent) {\nmyLoader.load(myLoaderAnimation);\naddChild(myLoader);\n }\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"1","creation_date":"2013-05-04 23:08:53.583 UTC","last_activity_date":"2013-05-08 16:38:22.01 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2350878","post_type_id":"1","score":"0","tags":"flash|actionscript","view_count":"74"} +{"id":"36698548","title":"Ansible exit code for a role or a playbook, not each individual task","body":"\u003cp\u003eIs it possible to capture an exit code for an Ansible role or playbook (not each individual task) and branch depending on the exit code?\u003c/p\u003e\n\n\u003cp\u003eWe have an application that needs to create a specific flag (success/failure) for each Ansible ROLE, not task. One exit code per role.\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2016-04-18 15:39:46.317 UTC","last_activity_date":"2016-04-20 12:34:22.893 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3846647","post_type_id":"1","score":"0","tags":"ansible|ansible-playbook|exit-code|ansible-role","view_count":"370"} +{"id":"24007072","title":"What do the position and original_position fields mean in the github pull request comments API?","body":"\u003cp\u003eThe github v3 API lets you \u003ca href=\"https://developer.github.com/v3/pulls/comments/#list-comments-on-a-pull-request\" rel=\"nofollow\"\u003elist comments on a pull request\u003c/a\u003e via\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecurl 'https://api.github.com/repos/danvk/dygraphs/pulls/296/comments'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe response looks something like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[\n {\n \"id\": 11908831,\n \"diff_hunk\": \"@@ -1521,16 +1576,6 @@ Dygraph.prototype.doZoomX_ = function(lowX, highX) {\\n };\\n \\n /**\\n- * Transition function to use in animations. Returns values between 0.0\\n- * (totally old values) and 1.0 (totally new values) for each frame.\\n- * @private\\n- */\\n-Dygraph.zoomAnimationFunction = function(frame, numFrames) {\",\n \"path\": \"dygraph.js\",\n \"position\": 140,\n \"original_position\": 140,\n \"commit_id\": \"bacf5ce283d6871ce1c090f29bf5411341622248\",\n \"original_commit_id\": \"335011fd4473f55aaaceb69726d15e0063373149\",\n \"user\": { ... }\n \"body\": \"I'm not sure why this is showing up in the diff -- did you move it?\",\n }\n]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e(You can see this comment on github \u003ca href=\"https://github.com/danvk/dygraphs/pull/296#discussion_r11908831\" rel=\"nofollow\"\u003ehere\u003c/a\u003e.)\u003c/p\u003e\n\n\u003cp\u003eMy question is: what exactly do the 140's in the \"position\" and \"original_position\" fields mean?\u003c/p\u003e\n\n\u003cp\u003eI'd like to translate this to/from line numbers on a particular commit. The \u003ca href=\"https://developer.github.com/v3/pulls/comments/#review-comments\" rel=\"nofollow\"\u003eAPI documentation\u003c/a\u003e indicates that this is a line number in a unified diff, but I can't tell which unified diff it's indexing into. \"dygraph.js\" did not change from 335011f..bacf5ce, i.e. original_commit_id..commit_id.\u003c/p\u003e","accepted_answer_id":"24007465","answer_count":"1","comment_count":"0","creation_date":"2014-06-03 04:20:49.093 UTC","favorite_count":"1","last_activity_date":"2014-06-03 05:03:37.357 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"388951","post_type_id":"1","score":"3","tags":"github|github-api|pull-request","view_count":"226"} +{"id":"31370293","title":"CronTrigger is not triggering at specified time but instead sends multiple push notifications at wrong times","body":"\u003cp\u003eI am using Amazon Push Notifications in my Spring MVC 4 project. I have used CronTrigger to send push notifications to Android app everyday at 8am. I have also used Timezone along with CronTrigger so that users get notifications according to their respective timezones.\u003c/p\u003e\n\n\u003cp\u003eHere is my \u003cstrong\u003eWebConfig.java:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@Configuration\n@EnableScheduling\n@EnableWebMvc\n@ComponentScan(basePackages=\"com.project\")\npublic class WebConfig implements SchedulingConfigurer \n{ \n protected static final Logger slf4jLogger = Logger.getLogger(WebConfig.class.getName());\nprivate static final String cronExpression = \"0 8 * * * ?\";\n\n\n\n/*@Bean\npublic MobileNotifSchedulerBean schedulerbean()\n{\n return new MobileNotifSchedulerBean();\n}*/\n\n@Bean\npublic InternalResourceViewResolver getInternalResourceViewResolver()\n{\n InternalResourceViewResolver resolver = new InternalResourceViewResolver();\n resolver.setPrefix(\"/WEB-INF/jsp/\");\n resolver.setSuffix(\".jsp\");\n resolver.setSuffix(\".html\");\n resolver.setSuffix(\".htm\");\n return resolver;\n}\n\n@Bean\nCronTrigger cronTrigger() \n{\n //The code in FetchUserTimeZones.java fetches all the user timezones which are stored in DynamoDb. Eg timeZone = \"Asia/Calcutta\";\n String timeZone = null;\n HashSet\u0026lt;String\u0026gt; userTimeZonesfromDB = FetchUserTimeZones.fetchUserTimeZone();\n for (String s : userTimeZonesfromDB) \n {\n timeZone = s;\n slf4jLogger.info(s);\n }\n return new CronTrigger(cronExpression, TimeZone.getTimeZone(timeZone));\n}\n\n\n@Override\npublic void configureTasks(ScheduledTaskRegistrar taskRegistrar) \n{\n\n taskRegistrar.addCronTask(new CronTask(new MobileNotifSchedulerBean(), cronTrigger()));\n}\n\n@Bean(destroyMethod=\"shutdown\")\npublic Executor taskExecutor() \n{\n return Executors.newScheduledThreadPool(1);\n } \n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is my \u003cstrong\u003eMobileNotifSchedulerBean:\u003c/strong\u003e\nThis code fetches a random question from DynamoDb and send them in Push Notification for each GCM registrationID with help of the CronTrigger set to time (8am). I have used \u003cstrong\u003esnsmobilepush.zip\u003c/strong\u003e from \u003ca href=\"http://docs.aws.amazon.com/sns/latest/dg/mobile-push-gcm.html\" rel=\"nofollow\"\u003ehttp://docs.aws.amazon.com/sns/latest/dg/mobile-push-gcm.html\u003c/a\u003e. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@EnableScheduling\npublic class MobileNotifSchedulerBean implements Runnable \n{\n protected static final Logger slf4jLogger = Logger.getLogger(MobileNotifSchedulerBean.class.getName());\n\npublic MobileNotifSchedulerBean()\n{\n run();\n}\n\npublic void sendQuestionNotif() \n{\n try \n {\n HashSet\u0026lt;String\u0026gt; reg_ids = FetchRegistrationIDs.fetchItems();\n for (String s : reg_ids) \n {\n String REGISTRATION_IDs = s;\n slf4jLogger.info(s); \n MobileSNSPushNotification.sendNotification(REGISTRATION_IDs);\n }\n } \n catch (IOException e) \n {\n //e.printStackTrace();\n slf4jLogger.error(e);\n slf4jLogger.error(e.getMessage());\n slf4jLogger.error(e.getStackTrace());\n }\n}\n\n\n@Override\npublic void run() \n{\n sendQuestionNotif();\n}\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ePlease help me where I have went wrong. Only problem is push notifications are going in wrong times and also multiple number of notifications instead of going only 1 push notification per user, per day(8am).\n TIA.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eUpdate:\u003c/strong\u003e There was a correction in Cron Expression. I corrected it. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate static final String cronExpression = \"0 0 8 * * ?\"; // For everyday 8 am. \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut still problem hasn't fixed\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-07-12 17:00:00.737 UTC","last_activity_date":"2015-07-27 12:47:56.99 UTC","last_edit_date":"2015-07-20 04:53:45.06 UTC","last_editor_display_name":"","last_editor_user_id":"2475091","owner_display_name":"","owner_user_id":"2475091","post_type_id":"1","score":"0","tags":"java|spring-mvc|amazon-web-services|cron|push-notification","view_count":"359"} +{"id":"21659643","title":"Object lookup with optional help of a lookup table which must be optimized away if unused","body":"\u003cp\u003eI want to speed up glyph lookup in my Cortex-M4 application for those fonts that are heavily used, by adding an optional lookup table. What I have now is - simplified and pseudo-ish - this:\u003c/p\u003e\n\n\u003cp\u003ein fontname-font.cpp:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003estatic const uint8_t someFont = {\n headerbytes[knownHeaderSize],\n glyph[knownGlyphCount]\n};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe size of each glyph depends on the glyph. Some are basically empty (space, for example), some are larger (like 'M'). The size of each glyph is stored in the glyph's header, so I can loop through the font and find out at which offset (\u003ccode\u003esomeFont[offset]\u003c/code\u003e) a glyph with code \u003ccode\u003ecode\u003c/code\u003e starts.\u003c/p\u003e\n\n\u003cp\u003ein fontname-map.cpp:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003estatic const uint16_t someFont_lut[knownGlyphCount];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eso I can use \u003ccode\u003esomeFont[someFont_lut[code]]\u003c/code\u003e if the LUT is included.\u003c/p\u003e\n\n\u003cp\u003eHow can I combine the font and an optional LUT in a class that provides a convenient interface? It seems to me that splitting the information into two files is already a bad idea (I can change that, though), but even if they were in the same file, how can I design a class that allows optional usage of a LUT, and allows the LUT to be optimized away if it is not used?\u003c/p\u003e\n\n\u003cp\u003eI'd like reduce the application interface to something like\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eGlyph Font::operator[](const char\u0026amp; c);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhere \u003ccode\u003eGlyph\u003c/code\u003e can be just a pointer to the glyph stored in flash or a proxy object that can be used to retrieve glyph data from flash. Existence and usage of the LUT should be hidden behind this operator.\u003c/p\u003e\n\n\u003cp\u003eI'm using gcc, and suggestions may be gcc-specific. Which fonts should contain a LUT is known at compile-time.\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003e\u003cstrong\u003eAdded:\u003c/strong\u003e I'd like the solution to prevent me from mixing one font's glyphs with another font's LUT. I want to specify \u003cem\u003eif\u003c/em\u003e the LUT is to used, not \u003cem\u003ewhich\u003c/em\u003e that is. The font reading class must find it on its own. \u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2014-02-09 13:32:52.803 UTC","favorite_count":"1","last_activity_date":"2014-02-09 14:58:02.457 UTC","last_edit_date":"2014-02-09 14:58:02.457 UTC","last_editor_display_name":"","last_editor_user_id":"692359","owner_display_name":"","owner_user_id":"692359","post_type_id":"1","score":"0","tags":"c++|gcc|lookup-tables","view_count":"86"} +{"id":"38244048","title":"Bloodhound limit not working","body":"\u003cp\u003ei am using the following code to enable typeahead on input field\nsome times the regions are not displayed but when i see the \"network xhr request\" in inspect element. the url does return data. \u003c/p\u003e\n\n\u003cp\u003eAnother issue the limit is not working in this example. i have tried different numbers but none of them works\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar Regions = new Bloodhound({\n datumTokenizer: Bloodhound.tokenizers.obj.whitespace('label'),\n queryTokenizer: Bloodhound.tokenizers.whitespace,\n remote: {\n url: 'https://www.domain.com/getcities?query=%QUERY',wildcard: '%QUERY'\n },\n limit: 10\n});\nRegions.initialize();\nvar hotels = new Bloodhound({\n datumTokenizer: function (datum) {\n return Bloodhound.tokenizers.whitespace(datum.value);\n },\n queryTokenizer: Bloodhound.tokenizers.whitespace,\n remote: {\n url: 'https://www.domain.com/gethotels?query=%QUERY',\n wildcard: '%QUERY', \n },\n limit: 10\n\n});\nhotels.initialize();\n\nfunction typeAhead()\n{\n\n\n\n$('#myinput').typeahead({\n hint: true,\n highlight: true,\n minLength: 2\n},\n{\n name: 'nba-teams',\n displayKey: 'label',\n source: Regions.ttAdapter() ,\n templates: {\n header: '\u0026lt;h3 class=\"league-name\"\u0026gt;Cities and regions\u0026lt;/h3\u0026gt;'\n }\n},\n{\n name: 'nhl-teams',\n displayKey: 'label',\n source: hotels.ttAdapter() ,\n templates: {\n header: '\u0026lt;h3 class=\"league-name\"\u0026gt;Hotels\u0026lt;/h3\u0026gt;'\n }\n});\n\n\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"1","creation_date":"2016-07-07 11:14:04.197 UTC","last_activity_date":"2016-07-19 11:28:30.073 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6560404","post_type_id":"1","score":"0","tags":"typeahead|bloodhound","view_count":"323"} +{"id":"38101991","title":"How to lower the width of a XAML ToggleSwitch (Width attribute not working for me)?","body":"\u003cp\u003eI do not manage to properly set the width of my XAML ToggleSwitch.\u003c/p\u003e\n\n\u003cp\u003eMy code is as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;Controls:ToggleSwitch OnLabel=\"True\" \n OffLabel=\"False\" \n IsEnabled=\"{Binding CheckValueEnable}\" \n IsChecked=\"{Binding CheckValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}\" Width=\"250\" \u0026gt;\n\u0026lt;/Controls:ToggleSwitch\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhatever Width value I set, there is a too big spacing between the text (true / false) and the visual toggle button.\nHow can I decrease this spacing?\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2016-06-29 14:03:34.817 UTC","last_activity_date":"2016-06-29 15:59:45.237 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5317085","post_type_id":"1","score":"0","tags":"c#|wpf|xaml","view_count":"40"} +{"id":"15024636","title":"How to create an in-memory image","body":"\u003cp\u003eI want to optimise my cairo drawing. I have an unchanging background on top of which Cairo graphics is drawn. The background can be different for each instance of the class so it cannot be a static file. To draw the background, I would like to do something like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e if self.pixbuf is None:\n self.pixbuf = self.draw_background(cr, width, height)\n #self.pixbuf = gtk.gdk.pixbuf_new_from_file(\"/path/to/file.png\")\n\n cr.set_source_pixbuf(self.pixbuf, 0, 0)\n cr.paint()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo that I only create the background once and then display it as an image and draw things on top of it. This is to save time instead of re-drawing the whole unchanging background every time someone else changes. The commented out line of code works fine but I really do not want to create a png, save it to a temporary file, then load that file. It seems like a waste of IO.\u003c/p\u003e\n\n\u003cp\u003eI tried this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eself draw_background (self, cr, width, height)\n pixbuf = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, True, 8, int(width), int(height))\n\n cr.set_source_color(gtk.gdk.color_parse('black'))\n cr.set_line_width(2)\n cr.rectangle(0, 0, width, height)\n cr.stroke()\n\n cr.paint()\n return pixbuf\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut no background is displayed.\u003c/p\u003e\n\n\u003cp\u003eWhat am I doing wrong?\u003c/p\u003e","answer_count":"1","comment_count":"6","creation_date":"2013-02-22 12:48:43.41 UTC","favorite_count":"1","last_activity_date":"2013-03-01 11:22:34.56 UTC","last_edit_date":"2013-03-01 11:22:34.56 UTC","last_editor_display_name":"","last_editor_user_id":"232794","owner_display_name":"","owner_user_id":"232794","post_type_id":"1","score":"1","tags":"python|cairo","view_count":"198"} +{"id":"1372604","title":"Side-by-side assemblies, Windows 7, and Visual Studio 2005","body":"\u003cp\u003eI have a Windows 7 machine with Visual Studio 2005 SP1 installed. Using this, I build an application which loads a DLL at runtime compiled with VS2005 SP1 but on Windows XP. This fails, with the following error:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e\"...\\foo.dll\": The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eThe DLL loaded is compiled against the debug CRT. The answer to \u003ca href=\"https://stackoverflow.com/questions/985277/application-has-failed-to-start-because-the-side-by-side-configauration-is-incorr\"\u003ethis question\u003c/a\u003e hints that vcredist_x86.exe only contains release-versions of the CRT. I'm not sure if that is relevant in this case, since both my machine and the machine on which the DLL was compiled on both have the full VS2005 SP1 installed.\u003c/p\u003e\n\n\u003cp\u003eShould I attempt to rebuild the DLL on Windows 7 (I'd prefer not to), and will that cause the DLL to become unusable on the Windows XP machine?\u003c/p\u003e","accepted_answer_id":"1372930","answer_count":"1","comment_count":"0","creation_date":"2009-09-03 10:17:14.437 UTC","last_activity_date":"2009-09-03 11:44:40.28 UTC","last_edit_date":"2017-05-23 12:04:24.003 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"13051","post_type_id":"1","score":"4","tags":"visual-studio-2005|windows-7|windows-xp|side-by-side","view_count":"6669"} +{"id":"4401499","title":"Blocking an Android thread with a dialog","body":"\u003cp\u003eI have an Android application that connects to Bluetooth devices somewhat freely. When I attempt to connect to a device that isn't paired with the phone, a dialog will prompt the user for a passkey. The passkey is known a priori, but as there is no method to programatically enter it (in the standard Android APIs at least), it must be shown to the user then entered.\u003c/p\u003e\n\n\u003cp\u003eWhat I have presently is a thread that initiates a connection by grabbing a \u003ccode\u003eBluetoothSocket\u003c/code\u003e and calling \u003ccode\u003e.connect()\u003c/code\u003e on it. If pairing is required, that call will block until the user enters a passkey in the dialog.\u003c/p\u003e\n\n\u003cp\u003eIn order to preempt that, I added to my activity's handler something to display dialogs. Before sending the message I made a dummy object to pass along, and between sending the message and attempting to connect, called \u003ccode\u003e.wait()\u003c/code\u003e on it, figuring that I could \u003ccode\u003e.notify()\u003c/code\u003e after receiving an \u003ccode\u003eOnClick\u003c/code\u003e from the dialog, however I'm unable to refer to the handled message in the inner \u003ccode\u003eAlertDialog\u003c/code\u003e class, as is the problem in \u003ca href=\"https://stackoverflow.com/questions/2028697/dialogs-alertdialogs-how-to-block-execution-while-dialog-is-up-net-style\"\u003ethis question\u003c/a\u003e.\u003c/p\u003e\n\n\u003cp\u003eI could have it do a call back up to the class holding the thread, but it seems a little clunky, leading me to the core question: \u003cem\u003eis my structure fundamentally broken? How should I go about it?\u003c/em\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://stackoverflow.com/questions/1027149/popup-dialog-android-from-background-thread\"\u003eAnother related question\u003c/a\u003e suggests to use the notification system, however it seems much better design here to mirror the passkey dialog with another dialog.\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2010-12-09 17:59:59.847 UTC","last_activity_date":"2011-07-28 14:17:29.35 UTC","last_edit_date":"2017-05-23 12:10:52.357 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"194586","post_type_id":"1","score":"2","tags":"java|android|multithreading","view_count":"1543"} +{"id":"10092131","title":"BroadcastReceiver, IntentService and GPS callbacks","body":"\u003cp\u003eI'm using a BroadcastReceiver and need to find the GPS location for the phone based on incoming SMS messages.\u003c/p\u003e\n\n\u003cp\u003eI'm using a pretty standard class that returns a LocationResult on a callback but if I use that in the BroadcastReceiver class then it can take too long and get killed by the OS.\u003c/p\u003e\n\n\u003cp\u003eI've tried using a service but it causes ANR problems if two events happen at the same time.\u003c/p\u003e\n\n\u003cp\u003eI've heard that uses threads in a BroadcastReceiver is a recipe for disaster so didn't even try that.\u003c/p\u003e\n\n\u003cp\u003eI'm now using an IntentService to queue up incoming requests and handle the GPS location finder. My question is how to use code with a callback so that it doesn't die when onHandleIntent finishes? I thought about using sleep instead but it doesn't seem like a polished solution.\u003c/p\u003e\n\n\u003cp\u003eIs there a better way to do this? I have to use a BroadcastReceiver but need a smart way of letting the GPS find the location over a 15-20 second period. \u003c/p\u003e\n\n\u003cp\u003eAny ideas would be most appreciated! (Android noob here).\u003c/p\u003e","accepted_answer_id":"10092250","answer_count":"1","comment_count":"0","creation_date":"2012-04-10 15:54:53.26 UTC","last_activity_date":"2012-04-10 16:02:44.193 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1324483","post_type_id":"1","score":"1","tags":"android|callback|gps|broadcastreceiver|intentservice","view_count":"743"} +{"id":"1548017","title":"How to include a newline in a C++ macro or how to use C++ templates to do the same?","body":"\u003cp\u003eI saw the following question:\n\u003ca href=\"https://stackoverflow.com/questions/98944/how-to-generate-a-newline-in-a-cpp-macro\"\u003eHow to generate a newline in a cpp macro?\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eLet me give a brief requirement of a need in newline in a C++ preprocessor. Am working on ARM Realview compiler 3.1 on a code which uses embedded assembly code with C++ code.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#define DEFINE_FUNCTION(rtype, op, val) \\\n __asm rtype nt_##op(void*) { \\ \n str lr, [sp, ##val];bl vThunk_##op;ldr lr, [sp,##val];bx lr; \\\n } \\\n void vThunk_##op(void*)\n\nDEFINE_FUNCTION(void*, mov_lt, #0x04)\n{\n // do some operation\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe above macro declares a embedded assembly function which forcefully requires newline between each statements in the function body. \u003c/p\u003e\n\n\u003cp\u003eI think this is because the text in the function body is sent blindly to ARM assembler by ARM compiler.\u003c/p\u003e\n\n\u003cp\u003eWhy C++ preprocessor is still now not supporting multi-line replacements ? and also i cannot use # in the replacement string. for example, for this kind of assembly,\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003estr lr, [sp, #0x04]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI tried lots of methods and ways, but nothing really worked out. ARM assembler/compiler is so basic that there is no API like asm volatile in GCC.\u003c/p\u003e\n\n\u003cp\u003eDEFINE_FUNCTION macro is used at lots of places, so cannot ignore it also.\u003c/p\u003e\n\n\u003cp\u003eSo, at final resort thinking about the following solutions:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eUsing m4 preprocessor instead of C++ preprocesser\u003c/li\u003e\n\u003cli\u003eUse C++ templates to somehow achieve this and replace DEFINE_FUNCTION using grep/sed\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eCan anyone give me pointers or ways to do the above things ? I cannot use any compiler other than ARM Realview compiler 3.1.\u003c/p\u003e\n\n\u003cp\u003eI need some expansion like below with new line for, \u003ccode\u003eDEFINE_FUNCTION(void*, mov_lt, #0x04) {}\u003c/code\u003e,\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e__asm void* nt_mov_lt(void*) { \n str lr, [sp, 0x04];\n bl vThunk_mov_lt;\n ldr lr, [sp,0x04];\n bx lr;\n }\n void vThunk_mov_lt(void*)\n {\n // do something\n }\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"1553978","answer_count":"3","comment_count":"2","creation_date":"2009-10-10 13:54:36.383 UTC","last_activity_date":"2016-06-08 21:32:53.02 UTC","last_edit_date":"2017-05-23 12:30:28.047 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"156437","post_type_id":"1","score":"3","tags":"c++|assembly|arm|c-preprocessor|realview","view_count":"2500"} +{"id":"28676739","title":"How to suppress push toast notification only when App in foreground?","body":"\u003cp\u003e\u003cstrong\u003eNote:\u003c/strong\u003e I have only tested this using the emulator, and pushing toasts using the built in functionality. I am assuming this isn't an emulator issue.\u003c/p\u003e\n\n\u003cp\u003eI followed \u003ca href=\"https://msdn.microsoft.com/en-us/library/windows/apps/xaml/jj709907.aspx\" rel=\"nofollow\"\u003ethis guide\u003c/a\u003e in order to intercept push toast notifications while the app is running. However, I only want to suppress the toast notification when the app is in the foreground. It should still display when another app is in the foreground. So I wrote the following handler in \u003ccode\u003eApp.xaml.cs\u003c/code\u003e (and subscribed to the PushNotificationReceived event):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate async void OnPushNotification(PushNotificationChannel sender, PushNotificationReceivedEventArgs e)\n {\n string msg = \"\";\n if (e.NotificationType == PushNotificationType.Toast)\n {\n await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =\u0026gt;\n {\n if (Window.Current.Visible)\n {\n msg += \" Toast canceled.\";\n e.ToastNotification.SuppressPopup = true;\n }\n });\n\n if (true) // actually determines if it's a certain type of toast\n {\n await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =\u0026gt;\n {\n ConfirmationContentDialog confirmationDialog = new ConfirmationContentDialog();\n confirmationDialog.SetMessage(\"Please confirm that you like turtles.\" + msg);\n await confirmationDialog.ShowAsync();\n });\n }\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo this works, in the sense that I only see the \"toast canceled\" message when the app was in the foreground when receiving the push notification. When I'm on the start screen or somewhere else I always get the toast. This is good. However, when the app is in the foreground, sometimes (usually after sending the second push) the toast shows up anyway (even though \"Toast canceled\" displays). But sometimes it doesn't. It's rather inconsistent.\u003c/p\u003e\n\n\u003cp\u003eThis is leading me to believe that due to the await, sometimes the toast gets through before the code gets run on the UI thread to check whether the app is visible or not. However, I can't access Window.Current.Visible from here without using the dispatcher. I even tried \u003ccode\u003eCoreApplication.MainView.CoreWindow.Visible\u003c/code\u003e but that gives me \"interface marshalled for different thread etc\" exception. Speaking of which, I don't understand how \u003ccode\u003eCoreApplication.MainView.CoreWindow.Dispatcher\u003c/code\u003e can be called from anywhere but \u003ccode\u003eCoreApplication.MainView.CoreWindow.Visible\u003c/code\u003e not? How does that even work.\u003c/p\u003e\n\n\u003cp\u003eAnyway, how do I fix this? I would like to keep this within \u003ccode\u003eApp.xaml.cs\u003c/code\u003e because I have a number of pages in this app, but this content dialog needs to be shown no matter which page the user is on, and without the user being redirected to a different page. However, I am of course open for new suggestions.\u003c/p\u003e","accepted_answer_id":"28693976","answer_count":"1","comment_count":"4","creation_date":"2015-02-23 15:04:04.173 UTC","favorite_count":"1","last_activity_date":"2015-02-24 11:03:10.947 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4042002","post_type_id":"1","score":"0","tags":"c#|windows-runtime|windows-phone-8.1","view_count":"621"} +{"id":"20110885","title":"ActionListener not working correctly","body":"\u003cp\u003ei just want to say that i am new to java and i am doing tuts to help me better understand and what not.\u003c/p\u003e\n\n\u003cp\u003enow i am trying to write a program that is a Instant Messenger, the first problem is the ActionListener() it is coded right as far as i know but it just dont seem to be working.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e//constructor\npublic imserver (){\n super (\"Justins Instant Messenger\");\n userText = new JTextField();\n userText.setEditable(false);\n userText.addActionListener(\n new ActionListener(){\n public void ActionPerformed(ActionEvent event){\n sendMessage(event.getActionCommaned());\n userText.setText(\"\");\n }\n }\n );\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eany help would be great thanks,\u003c/p\u003e\n\n\u003cp\u003eand this is the link to the tut im using \u003ca href=\"http://www.youtube.com/watch?v=pr02nyPqLBU\" rel=\"nofollow\"\u003ehttp://www.youtube.com/watch?v=pr02nyPqLBU\u003c/a\u003e\u003c/p\u003e","answer_count":"0","comment_count":"9","creation_date":"2013-11-21 01:43:01.733 UTC","last_activity_date":"2013-11-21 07:55:49.623 UTC","last_edit_date":"2013-11-21 07:52:04.813 UTC","last_editor_display_name":"","last_editor_user_id":"714968","owner_display_name":"","owner_user_id":"3015618","post_type_id":"1","score":"1","tags":"java|swing|actionlistener|jtextfield","view_count":"66"} +{"id":"24283516","title":"eval gets executed even thought ng-csp directive is used","body":"\u003cp\u003eI have enabled ngCsp using the ng-csp directive:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;body ng-app=\"PM\" ng-csp ng-cloak\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhy I am still able to execute the following \u003ccode\u003eeval\u003c/code\u003e in my code without any angular errors?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$scope.searchform = {\n searchExpression : \"alert('hi')\"\n}\n\n$scope.handleChange = function () {\n eval($scope.searchform.searchExpression);\n}\n\n\u0026lt;input type=\"text\" ng-model=\"searchform.searchExpression\" ng-change=\"handleChange(searchform.searchExpression)\"\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAm I not understanding what ng-csp is supposed to do?\u003c/p\u003e","accepted_answer_id":"24284269","answer_count":"1","comment_count":"0","creation_date":"2014-06-18 10:44:28.35 UTC","last_activity_date":"2014-06-18 11:24:06.357 UTC","last_edit_date":"2014-06-18 11:21:32.177 UTC","last_editor_display_name":"","last_editor_user_id":"142191","owner_display_name":"","owner_user_id":"142191","post_type_id":"1","score":"0","tags":"javascript|angularjs|content-security-policy","view_count":"606"} +{"id":"39868999","title":"Displaying records that have more than 5 days inbetween them","body":"\u003cp\u003eI have 2 tables, \u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003etblCustomer\u003c/strong\u003e\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eCustomerID(PK), FirstName, Surname)\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003e\u003cstrong\u003etblPurchases\u003c/strong\u003e\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003ePurchaseID(PK), PurchaseDate, Qty, CustomerID(FK). \u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI want to display all the customers who purchased products after five (5) days or more since their last purchase in the following manner.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eFirstName diff in days since last purchase\nAlex 7\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","accepted_answer_id":"39869077","answer_count":"4","comment_count":"1","creation_date":"2016-10-05 08:30:43.037 UTC","last_activity_date":"2016-10-05 09:06:33.307 UTC","last_edit_date":"2016-10-05 08:32:14.513 UTC","last_editor_display_name":"","last_editor_user_id":"2294978","owner_display_name":"","owner_user_id":"5539221","post_type_id":"1","score":"-1","tags":"sql|sql-server|tsql|join|datediff","view_count":"282"} +{"id":"41706625","title":"Why is Redux able to change my CONSTANT output from an initializing reducer?","body":"\u003cp\u003eI am running into really, really weird behavior with Redux. Basically I have a game with a static map where the player moves around on the map. The map and the player is represented by colored \u003ccode\u003ediv\u003c/code\u003e's. That's all I'm trying to do and I was briefly able to get it working.\u003c/p\u003e\n\n\u003cp\u003eI create the movement by first getting the empty map (which is a hardcoded \u003ccode\u003econst\u003c/code\u003e array of arrays) and then adding the player's (new) position at the correct coordinates. Then I render it to the view layer in React. The outputted new map with the player's position is \u003cem\u003enot\u003c/em\u003e named the same as the empty map. \u003c/p\u003e\n\n\u003cp\u003eHowever something very weird is happening with Redux where it is somehow \u003cstrong\u003echanging\u003c/strong\u003e the hardcoded \u003ccode\u003econst\u003c/code\u003e array of arrays when I render it. Putting in a ton of console.logs to see what is going on with the variables confirm that this is what is happening. Could someone please have a look at this codepen: \u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://codepen.io/swyx/pen/MJbezj?editors=1010\" rel=\"nofollow noreferrer\"\u003ehttp://codepen.io/swyx/pen/MJbezj?editors=1010\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eand teach me how to trace what on earth is going on with my mutable const?\u003c/p\u003e\n\n\u003cp\u003eEDIT:\nhere is the relevant code (constMap is a const array of arrays)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003econst InitMap = function() {\n console.log('InitMap')\n return constMap /// why is this changing every single time???\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethis is later combined with the other reducers:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003econst rootReducer = combineReducers({\n gamemap: InitMap,\n user: InitUser,\n userMove: UserMove\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand then used in the relevant mapStateToProps function:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction GMmapStateToProps(state){\n //from here goes into this.props\n console.log('GMmapStateToProps')\n console.log(state)\n console.log(constMap)\n var newgamemap = constMap, //state.gamemap also doesnt work,\n newuser = state.user\n console.log(newgamemap)\n if (state.userMove) {\n //check if is whitespace\n var x2 = newuser.location.x + state.userMove.vector.x\n var y2 = newuser.location.y + state.userMove.vector.y\n if (newgamemap[y2][x2] === 1) {\n newuser.location.x = x2\n newuser.location.y = y2\n //add user\n newgamemap[newuser.location.y][newuser.location.x] = 9\n }\n } else { \n //add user\n newgamemap[newuser.location.y][newuser.location.x] = 9\n }\n console.log(newgamemap)\n return{\n xgamemap: newgamemap,\n user: newuser\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhat is ridiculous is the value of \u003ccode\u003econstMap\u003c/code\u003e keeps changing every time i call this! why/how? it is making me question my sanity. \u003c/p\u003e","answer_count":"2","comment_count":"3","creation_date":"2017-01-17 20:43:45.37 UTC","last_activity_date":"2017-01-18 08:41:36.873 UTC","last_edit_date":"2017-01-17 20:57:42.96 UTC","last_editor_display_name":"","last_editor_user_id":"1106414","owner_display_name":"","owner_user_id":"1106414","post_type_id":"1","score":"0","tags":"reactjs|redux|react-redux","view_count":"46"} +{"id":"13183806","title":"C# stored procedure returning -1 Repeatedly","body":"\u003cp\u003eI have repeatedly test this #blankety-blank# stored procedure on SQL Server, and it returns either 0 or number of rows, but in C# I am always getting -1. I have been debugging this #blank# thing for hours and always -1. \u003c/p\u003e\n\n\u003cp\u003eHere's the stored procedure code. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCreate procedure [dbo].[sp_enter_new_student] \n @Prenom_detudiant [varchar](50) = NULL, \n @nom_detudiant [varchar](50) = NULL,\n @nationalite_detudiant [varchar](40) = NULL,\n @langue_parle [varchar](15) = NULL,\n @nombre_denfants [int] = NULL,\n @sexe_detudiant [char](1) = NULL,\n @program_pk [int] = NULL,\n @Numero_detudiant int = NULL\nAs \nDeclare @numOfRowsBefore int = 0; \ndeclare @numOfRowsAfter int = 0; \ndeclare @Error int = -100; \nBEGIN \n SET NOCOUNT ON; \n select @numOfRowsBefore = COUNT(*) from tbl_students where Numero_detudiant = @Numero_detudiant; \n\n if (@numOfRowsBefore \u0026gt; 0)\n begin\n Print \"Student already exists, Insertion will fail!\";\n Print \"Insertion Failure ! \" + CONVERT(varchar(10), @numOfRowsBefore);\n return @numOfRowsBefore; --\u0026gt; -1 indicates insertion failure\n End\n else if (@numOfRowsBefore = 0)\n begin\n Print \"Student doesn't exists, Insertion will be Success!\";\n Print \"Insertion Success ! \" + CONVERT(varchar(10), @numOfRowsBefore);\n return @numOfRowsBefore; --\u0026gt; -1 indicates insertion failure\n End\n\nEND \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003chr\u003e\n\n\u003cp\u003eAnd here's a C# code \u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic int enregistreNouveauEtudiant(string Prenom_detudiant, string nom_detudiant, string nationalite_detudiant, string langue_parle, string nombre_denfants, string sexe_detudiant, string program_pk, string Numero_detudiant)\n{\n int numberOfRowsInserted = 0;\n //try\n //{ \n\n SqlConnection connection = this.GetConnection();\n SqlCommand insertStudentCommand = new SqlCommand(\"sp_enter_new_student\", connection);\n connection.Open();\n insertStudentCommand.CommandType = CommandType.StoredProcedure;\n\n //insertStudentCommand.Parameters.Add(\"@ID\", SqlDbType.Int);\n //insertStudentCommand.Parameters[\"@ID\"].Direction = ParameterDirection.Output;\n\n insertStudentCommand.Parameters.Add(\"@Prenom_detudiant\", SqlDbType.VarChar, 50).Value = Prenom_detudiant;\n insertStudentCommand.Parameters.Add(\"@nom_detudiant\", SqlDbType.VarChar, 50).Value = nom_detudiant;\n insertStudentCommand.Parameters.Add(\"@nationalite_detudiant\", SqlDbType.VarChar, 40).Value = nationalite_detudiant;\n insertStudentCommand.Parameters.Add(\"@langue_parle\", SqlDbType.VarChar, 15).Value = langue_parle;\n insertStudentCommand.Parameters.Add(\"@nombre_denfants\", SqlDbType.Int).Value = nombre_denfants;\n insertStudentCommand.Parameters.Add(\"@sexe_detudiant\", SqlDbType.Char, 1).Value = sexe_detudiant;\n insertStudentCommand.Parameters.Add(\"@program_pk\", SqlDbType.Int).Value = program_pk;\n insertStudentCommand.Parameters.Add(\"@Numero_detudiant\", SqlDbType.Int).Value = Numero_detudiant;\n\n numberOfRowsInserted = insertStudentCommand.ExecuteNonQuery();\n\n connection.Close();\n\n return numberOfRowsInserted;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCan anyone have a look at this problem please? I used try and catch block as well, it's absolutely useless in this case. \u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","accepted_answer_id":"13183849","answer_count":"2","comment_count":"0","creation_date":"2012-11-01 19:03:38.3 UTC","favorite_count":"2","last_activity_date":"2012-11-01 20:16:03.343 UTC","last_edit_date":"2012-11-01 19:28:10.663 UTC","last_editor_display_name":"","last_editor_user_id":"656243","owner_display_name":"","owner_user_id":"1792253","post_type_id":"1","score":"5","tags":"c#|stored-procedures|sql-server-2008-r2","view_count":"574"} +{"id":"15231373","title":"msg plugin in ajax request","body":"\u003cp\u003eI am currently looking at this \u003ca href=\"http://dreamerslab.com/demos/jquery-blockui-alternative-with-jquery-msg-plugin\" rel=\"nofollow\"\u003eplugin\u003c/a\u003e as blockui does not seem to work for me. I am using:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ebeforeSend: function () {\n $.msg({\n autoUnblock: false\n });\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand would like to 'unblock' it in success, error etc.\u003c/p\u003e\n\n\u003cp\u003eWould this be possible? Thanks.\u003c/p\u003e","accepted_answer_id":"15232315","answer_count":"1","comment_count":"3","creation_date":"2013-03-05 18:30:02.903 UTC","last_activity_date":"2013-03-05 21:02:49.58 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"283538","post_type_id":"1","score":"1","tags":"jquery","view_count":"399"} +{"id":"16450137","title":"How to solve jQuery-File-Upload / Classic-ASP error ASP 0177 - 800401f3?","body":"\u003cp\u003eI'm trying to use '\u003ca href=\"http://blueimp.github.io/jQuery-File-Upload/\" rel=\"nofollow noreferrer\"\u003ejQuery-File-Upload\u003c/a\u003e' as a solution for uploading files to an \u003ccode\u003eIIS/Classic ASP\u003c/code\u003e application. On the jQuery-File-Upload project wiki I found out someone who did a \u003ca href=\"https://github.com/blueimp/jQuery-File-Upload/wiki/Classic-ASP\" rel=\"nofollow noreferrer\"\u003every good work (click here to see)\u003c/a\u003e, but when I try to use is I am receiving an strange error on file \u003ccode\u003eupload.asp\u003c/code\u003e, line 303 as bellow:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e'Persits ASPUpload\nSet Upload = Server.CreateObject(\"Persits.Upload\")\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/OHrQi.png\" alt=\"Image error\"\u003e\u003c/p\u003e\n\n\u003cp\u003eDoes anybody here has any idea of what is happening?\u003c/p\u003e\n\n\u003cp\u003eThank you very much, and sorry for my terrible English.\u003c/p\u003e","accepted_answer_id":"16453396","answer_count":"1","comment_count":"1","creation_date":"2013-05-08 21:03:13.293 UTC","last_activity_date":"2013-05-09 02:29:55.38 UTC","last_edit_date":"2013-05-08 21:12:25.793 UTC","last_editor_display_name":"","last_editor_user_id":"845756","owner_display_name":"","owner_user_id":"845756","post_type_id":"1","score":"0","tags":"jquery|iis-7|asp-classic","view_count":"565"} +{"id":"20823333","title":"Working with digits","body":"\u003cp\u003eI need an explanation for the pattern before the \u003ccode\u003e%\u003c/code\u003e mark in:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e(\"%012d\" % 10)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat is the role of \u003ccode\u003e%\u003c/code\u003e operator in this?\u003c/p\u003e","accepted_answer_id":"20823393","answer_count":"1","comment_count":"1","creation_date":"2013-12-29 08:14:15.437 UTC","last_activity_date":"2013-12-29 08:34:04.21 UTC","last_edit_date":"2013-12-29 08:24:44.057 UTC","last_editor_display_name":"","last_editor_user_id":"314166","owner_display_name":"","owner_user_id":"2487790","post_type_id":"1","score":"0","tags":"ruby|string","view_count":"107"} +{"id":"33668278","title":"how to combine two ImmutableMap\u003cString,String\u003e in Java 8?","body":"\u003cp\u003eI have tried this code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e final ImmutableMap\u0026lt;String, String\u0026gt; map1 = ImmutableMap.of(\"username\", userName, \"email\", email1, \"A\", \"A1\",\n \"l\", \"500L\");\n final ImmutableMap\u0026lt;String, String\u0026gt; map2 = ImmutableMap.of(\"b\", \"ture\", \"hashed_passwords\", \"12345\", \"e\",\n \"TWO\", \"fakeProp\", \"fakeVal\");\n\n final ImmutableMap\u0026lt;String, String\u0026gt; map3 = ImmutableMap.builder().putAll(map1).putAll(map2).build();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut got an error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eError:(109, 105) java: incompatible types: com.google.common.collect.ImmutableMap\u0026lt;java.lang.Object,java.lang.Object\u0026gt; cannot be converted to com.google.common.collect.ImmutableMap\u0026lt;java.lang.String,java.lang.String\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ehow can I cast it otherwise?\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2015-11-12 09:36:31.483 UTC","last_activity_date":"2015-11-12 09:36:31.483 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"311130","post_type_id":"1","score":"0","tags":"java|hashmap|hashtable|immutability","view_count":"433"} +{"id":"19952619","title":"a faster solution for random text w/r in Python","body":"\u003cp\u003eI need a fast solution for random w/r of text snippets in Python. What I want to do is like this:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eWrite the snippet and record a pointer\u003c/li\u003e\n\u003cli\u003eUse the pointer to retrieve the snippet\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eThe snippets are of arbitrary length and I choose not to use a database to store them, but only the pointers. By simply replacing Python file methods with C functions (solution 1), it's been pretty fast and the pointers consist of only \"where\" and \"how long\" of the snippet. After that, I experimented what I thought is the real thing that works with Berkeley DB. I don't know what to call it, a \"paging\" something perhaps?\u003c/p\u003e\n\n\u003cp\u003eThe thing is, this code definitely works, 1.5 to 2 times faster than solution 1, but it isn't a lot faster and needs to use a 4-part pointer. \u003cstrong\u003ePerhaps this is not a worthy method, but is there any room to significantly improve it?\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eThe following is the code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efrom collections import namedtuple\nfrom ctypes import cdll,c_char_p,\\\n c_void_p,c_size_t,c_long,\\\n c_int,create_string_buffer\nlibc = cdll.msvcrt\nfopen = libc.fopen\nfread = libc.fread\nfwrite = libc.fwrite\nfseek = libc.fseek\nftell = libc.ftell\nfflush = libc.fflush\nfclose = libc.fclose\n\n#######################################################\n# The following is how to write a snippet into the SnippetBase file\n\nptr = namedtuple('pointer','blk1, start, nblk, length')\nsnippet = '''\nblk1: the first blk where the snippet is\nstart: the start of this snippet\nnblk: number of blocks this snippet takes\nlength: length of this snippet\n'''\nbsize = 4096 # bsize: block size\n\nfh = fopen('.\\\\SnippetBase.txt','wb')\nfseek(fh,0,2)\npos1 = divmod(ftell(fh),bsize)\nfwrite(snippet,c_size_t(len(snippet)),1,fh)\nfflush(fh)\npos2 = divmod(ftell(fh),bsize)\nptr = ptr(pos1[0],pos1[1],pos2[0]-pos1[0]+1,len(snippet))\nfclose(fh)\n\n\n#######################################################\n# The following is how to read the snippet from the SnippetBase file\n\nfh = fopen('.\\\\SnippetBase.txt','rb')\nfseek(fh,c_long(ptr.blk1*bsize),1)\nbuff = create_string_buffer(ptr.nblk*bsize)\nfread(buff,c_size_t(ptr.nblk*bsize),1,fh)\nprint buffer(buff,ptr.start,ptr.length)\nfclose(fh)\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"19953261","answer_count":"1","comment_count":"2","creation_date":"2013-11-13 11:30:23.287 UTC","last_activity_date":"2013-11-13 18:36:16.34 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2871934","post_type_id":"1","score":"0","tags":"python|randomaccessfile","view_count":"144"} +{"id":"1733358","title":"Javascript in a PDF?","body":"\u003cp\u003eI made up an editable PDF for students to request transcripts. Now, I want to constrain the input. For example, I want only numbers for their ID number, and I want only letters (no special characters) in the name fields, etc. In addition, there's an input called \"Year Last Attended\" where they enter the last academic year the user attended the university. If the value entered is within 5 years of the current date, then the user should alerted that he/she can request a transcript through another website.\u003c/p\u003e\n\n\u003cp\u003eCan JS do this? If so, how would you do this? I just need examples for the things I've listed above, and I can work from there. If not, how would I do this in a PDF (Acrobat Pro)?\u003c/p\u003e\n\n\u003cp\u003eAnyone have suggestions for tutorials in Javascript specifically for PDF?\u003c/p\u003e","accepted_answer_id":"1733367","answer_count":"1","comment_count":"0","creation_date":"2009-11-14 05:20:32.957 UTC","last_activity_date":"2009-11-14 05:31:55.88 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"177541","post_type_id":"1","score":"2","tags":"javascript|acrobat","view_count":"788"} +{"id":"46226397","title":"Setting Wallpaper based on how it is currently viewed and zooming/dragging inside imageview","body":"\u003cp\u003eI'm trying to recreate Google Wallpaper app, where you select a photo then based on how it is seen that is how it should put the wallpaper.\u003c/p\u003e\n\n\u003cp\u003eThis is how it currently looks: This is the result:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/zGP0wm.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/zGP0wm.png\" alt=\"App\"\u003e\u003c/a\u003e \n\u003ca href=\"https://i.stack.imgur.com/dXX1Am.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/dXX1Am.png\" alt=\"Result\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI tried resizing but nothing seems to work.\nAnd any ideas how should i make it so user could zoom in and drag the screen as he pleases, when he is satisfied the he should just press Set wallpaper the image would be setted up like it is on screen. Even if he wants the black lines. So basicly like default Google Wallpaper.\u003c/p\u003e\n\n\u003cp\u003eIf i use the code from:\n\u003ca href=\"https://stackoverflow.com/questions/23536342/how-to-set-wallpaper-of-image-with-its-actual-size\"\u003eStackOverFlow Question: How to Set wallpaper of image with its actual size?\u003c/a\u003e\nthat is the result.\u003c/p\u003e\n\n\u003cp\u003eAny advice how should have I implement that function that i mentioned before? \nI was looking at the: \u003ca href=\"https://github.com/ArthurHub/Android-Image-Cropper\" rel=\"nofollow noreferrer\"\u003eLibrary\u003c/a\u003e but i don't need that much, because it the image is always fixed.\nThanks for the help.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdit 1\u003c/strong\u003e: I'm now using PhotoView library for zooming and dragging. The question remains. How can you set the wallpaper based on what is in view of imageview or in this case PhotoView which extends ImageView?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdit 2\u003c/strong\u003e: If i use \u003ccode\u003eIntent intent = mWallpaperManager.getCropAndSetWallpaperIntent(getImageUri(activity, wallpaperBitmap));\u003c/code\u003e\nThen that is the similar result i wanted, \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003ebut i want to custimize the view, so you can zoom in/out and set it as\n you want it\u003c/p\u003e\n\u003c/blockquote\u003e","accepted_answer_id":"46622392","answer_count":"1","comment_count":"0","creation_date":"2017-09-14 18:54:28.077 UTC","last_activity_date":"2017-10-07 16:17:46.08 UTC","last_edit_date":"2017-09-15 10:23:04.71 UTC","last_editor_display_name":"","last_editor_user_id":"4527839","owner_display_name":"","owner_user_id":"4527839","post_type_id":"1","score":"0","tags":"android|android-imageview|crop|image-zoom|android-wallpaper","view_count":"17"} +{"id":"27566996","title":"Clent send message server not recived message in tcp/ip socket program","body":"\u003cp\u003eTCP/IP socket program client send text server receive and store database table. I'm righting code below but i have error text reeving time.\u003c/p\u003e\n\n\u003ch2\u003eThis is Client Side Code\u003c/h2\u003e\n\n\u003cpre\u003e\u003ccode\u003e using System;\n using System.Collections.Generic;\n using System.Linq;\n using System.Text;\n using System.Net;\n using System.Net.Sockets;\n using System.Threading.Tasks;\n using System.IO;\n\n\n namespace ClientApplication\n {\n class Client\n {\n static void Main(string[] args)\n {\n try\n {\n TcpClient tcpclnt = new TcpClient();\n Console.WriteLine(\"Connecting.....\");\n\n //tcpclnt.Connect(\"162.144.85.232\", 8080);\n tcpclnt.Connect(\"162.144.85.232\", 4489);\n\n\n Console.WriteLine(\"Connected\");\n Console.Write(\"Enter the string to be Sent : \");\n\n String str = Console.ReadLine();\n Stream stm = tcpclnt.GetStream();\n\n ASCIIEncoding asen = new ASCIIEncoding();\n byte[] ba = asen.GetBytes(str);\n System.Net.ServicePointManager.Expect100Continue = false;\n Console.WriteLine(\"Sending.....\");\n\n stm.Write(ba, 0, ba.Length);\n\n byte[] bb = new byte[100];\n int k = stm.Read(bb, 0, 100);\n\n for (int i = 0; i \u0026lt; k; i++)\n Console.Write(Convert.ToChar(bb[i]));\n\n Console.ReadLine();\n\n tcpclnt.Close();\n Console.ReadLine();\n }\n\n catch (Exception e)\n {\n Console.WriteLine(\"Error..... \" + e.StackTrace);\n Console.ReadLine();\n }\n }\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003ch2\u003eThis Is Server Side Code\u003c/h2\u003e\n\n\u003cpre\u003e\u003ccode\u003eusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Net;\nusing System.Net.Sockets;\n\nnamespace ServerApplication\n{\n class Server\n {\n static void Main(string[] args)\n {\n try\n {\n IPAddress ipadd = IPAddress.Parse(\"192.168.1.7\");\n TcpListener list = new TcpListener(ipadd, 8080);\n list.Start();\n Console.WriteLine(\"The server is running at port 8080...\");\n Console.WriteLine(\"The Local End point Is:\" + list.LocalEndpoint);\n System.Net.ServicePointManager.Expect100Continue = false;\n Socket s = list.AcceptSocket();\n Console.WriteLine(\"Connections Accepted from:\" + s.RemoteEndPoint);\n byte[] b = new byte[100];\n int k = s.Receive(b);\n Console.WriteLine(\"Recived...\");\n for (int i = 0; i \u0026lt; k; i++)\n Console.WriteLine(Convert.ToChar(b[i]));\n ASCIIEncoding asen = new ASCIIEncoding();\n s.Send(asen.GetBytes(\"The String Was Recived throw Server\"));\n Console.WriteLine(\"\\n Sent Acknowlegment\");\n s.Close();\n list.Stop();\n\n\n }\n catch (Exception e)\n {\n Console.WriteLine(\"Error..... \" + e.StackTrace);\n\n }\n\n }\n}\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm trying to execute this code i have error happen like this \nUnable to read data from the transport connection: An existing connection was forcibly closed by the remote host. Please resolve my issue .\u003c/p\u003e","accepted_answer_id":"27570895","answer_count":"1","comment_count":"8","creation_date":"2014-12-19 13:18:24.13 UTC","favorite_count":"1","last_activity_date":"2014-12-19 17:20:43.917 UTC","last_edit_date":"2014-12-19 13:40:47.3 UTC","last_editor_display_name":"","last_editor_user_id":"4377799","owner_display_name":"","owner_user_id":"4377799","post_type_id":"1","score":"-1","tags":"c#|sockets|client-server|tcp-ip","view_count":"1004"} +{"id":"14267258","title":"NullPointerException error in Eclipse","body":"\u003cp\u003eCode as it stands right now: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport java.io.File;\nimport java.io.IOException;\nimport java.util.Scanner;\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport static java.lang.System.*;\n\npublic class MadLib\n{\nprivate ArrayList\u0026lt;String\u0026gt; verbs = new ArrayList\u0026lt;String\u0026gt;();\nprivate ArrayList\u0026lt;String\u0026gt; nouns = new ArrayList\u0026lt;String\u0026gt;();\nprivate ArrayList\u0026lt;String\u0026gt; adjectives = new ArrayList\u0026lt;String\u0026gt;();\n\npublic MadLib()\n{\n}\n\npublic MadLib(String fileName)\n{\n //load stuff\n try{\n Scanner file = new Scanner(new File(fileName));\n }\n catch(Exception e)\n {\n out.println(\"Houston we have a problem!\");\n }\n}\n\npublic void loadNouns()\n{\n nouns = new ArrayList\u0026lt;String\u0026gt;();\n try{ \n Scanner chopper = new Scanner(\"nouns.dat\");\n while(chopper.hasNext()){\n nouns.add(chopper.next());\n }\n chopper.close();\n out.println(nouns);\n }\n catch(Exception e)\n {\n out.println(\"Will\");\n } \n}\n\npublic void loadVerbs()\n{\n verbs = new ArrayList\u0026lt;String\u0026gt;();\n try{\n Scanner chopper = new Scanner(\"verbs.dat\");\n while(chopper.hasNext()){\n verbs.add(chopper.next());\n }\n chopper.close();\n }\n catch(Exception e)\n {\n out.println(\"run\");\n }\n}\n\npublic void loadAdjectives()\n{\n adjectives = new ArrayList\u0026lt;String\u0026gt;();\n try{\n Scanner chopper = new Scanner(\"adjectives.dat\");\n while(chopper.hasNext()){\n adjectives.add(chopper.next());\n }\n chopper.close();\n }\n catch(Exception e)\n {\n }\n}\n\npublic String getRandomVerb()\n{\n String verb = \"\";\n int num = 0;\n num = (int)(Math.random()*verbs.size());\n verb = verbs.get(num);\n return verb;\n}\n\npublic String getRandomNoun()\n{\n String noun = \"\";\n int num = 0;\n num = (int)(Math.random()*nouns.size());\n noun = nouns.get(num);\n return noun;\n}\n\npublic String getRandomAdjective()\n{\n String adj = \"\";\n int num = 0;\n num = (int)(Math.random()*adjectives.size());\n adj = adjectives.get(num);\n return adj;\n} \n\npublic String toString()\n{\n String output = \"The \" + getRandomNoun() + getRandomVerb() + \" after the \" + getRandomAdjective() + getRandomAdjective() + getRandomNoun() + \" while the \" + getRandomNoun() + getRandomVerb() + \" the \" + getRandomNoun();\n return output;\n}\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eEclipse is pointing to the issue occurring at the line\u003ccode\u003enum = (int)(Math.random()*nouns.size());\u003c/code\u003e but this seems to not make much since to me. \u003c/p\u003e\n\n\u003cp\u003eI have the private \u003ccode\u003eArrayList\u0026lt;String\u0026gt;\u003c/code\u003e initialized at the method \u003ccode\u003eloadNouns\u003c/code\u003e. I origianlly had \u003ccode\u003eArrayList\u0026lt;String\u0026gt; nouns\u003c/code\u003e initialized at \u003ccode\u003egetRandomNoun()\u003c/code\u003e but that threw a different error so I was advised to move the initialization statement to the \u003ccode\u003eloadNouns\u003c/code\u003e method.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eRunner Class\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport static java.lang.System.*;\n\npublic class Lab16d\n{\npublic static void main( String args[] )\n{\n //make a new MadLib\n MadLib fun = new MadLib();\n out.println(fun);\n}\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eUPDATE\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003ethe real issue appears to be that \u003ccode\u003eArrayList\u0026lt;String\u0026gt; nouns\u003c/code\u003e never is \"loaded up\" with the separate strings which are supposed to be scanned in from the nouns.dat file\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eUPDATE2\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport java.io.File;\nimport java.io.IOException;\nimport java.util.Scanner;\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport static java.lang.System.*;\n\npublic class MadLib\n{\nprivate ArrayList\u0026lt;String\u0026gt; verbs = new ArrayList\u0026lt;String\u0026gt;();\nprivate ArrayList\u0026lt;String\u0026gt; nouns = new ArrayList\u0026lt;String\u0026gt;();\nprivate ArrayList\u0026lt;String\u0026gt; adjectives = new ArrayList\u0026lt;String\u0026gt;();\n\npublic MadLib()\n{\n loadNouns();\n loadVerbs();\n loadAdjectives();\n out.println(nouns);\n}\n\npublic MadLib(String fileName)\n{\n //load stuff\n loadNouns();\n loadVerbs();\n loadAdjectives();\n\n\n try{\n Scanner file = new Scanner(new File(fileName));\n\n\n\n\n\n\n\n\n\n }\n catch(Exception e)\n {\n out.println(\"Houston we have a problem!\");\n }\n\n}\n\npublic void loadNouns()\n{\n nouns = new ArrayList\u0026lt;String\u0026gt;();\n try{\n //nouns = new ArrayList\u0026lt;String\u0026gt;();\n String nou = \"\";\n Scanner chopper = new Scanner(new File (\"nouns.dat\"));\n\n //chopper.nextLine();\n while(chopper.hasNext()){\n nou = chopper.next();\n out.println(nou);\n nouns.add(nou);\n //chopper.nextLine();\n }\n //chopper.close();\n out.println(nouns.size());\n }\n catch(Exception e)\n {\n out.println(\"Will\");\n } \n\n}\n\npublic void loadVerbs()\n{\n verbs = new ArrayList\u0026lt;String\u0026gt;();\n try{\n Scanner chopper = new Scanner(new File(\"verbs.dat\"));\n while(chopper.hasNext()){\n verbs.add(chopper.next());\n chopper.nextLine();\n }\n chopper.close();\n }\n catch(Exception e)\n {\n out.println(\"run\");\n }\n}\n\npublic void loadAdjectives()\n{\n adjectives = new ArrayList\u0026lt;String\u0026gt;();\n try{\n Scanner chopper = new Scanner(new File(\"adjectives.dat\"));\n while(chopper.hasNext()){\n adjectives.add(chopper.next());\n chopper.nextLine();\n }\n chopper.close();\n }\n catch(Exception e)\n {\n }\n}\n\npublic String getRandomVerb()\n{\n\n String verb = \"\";\n int num = 0;\n num = (int)(Math.random()*(verbs.size()-1));\n verb = verbs.get(num);\n return verb;\n}\n\npublic String getRandomNoun()\n{\n\n String noun = \"\";\n int num = 0;\n if(nouns == null){\n loadNouns();\n }\n double rand = (Math.random());\n num = (int)(rand * (nouns.size()-1));\n out.println(num);\n noun = nouns.get((int) num);\n out.print(noun);\n return noun;\n}\n\npublic String getRandomAdjective()\n{\n\n String adj = \"\";\n int num = 0;\n num = (int)(Math.random()*(adjectives.size()-1));\n adj = adjectives.get(num);\n return adj;\n} \n\npublic String toString()\n{\n String output = \"The \" + getRandomNoun() + getRandomVerb() + \" after the \" + getRandomAdjective() + getRandomAdjective() + getRandomNoun() + \" while the \" + getRandomNoun() + getRandomVerb() + \" the \" + getRandomNoun();\n return output;\n}\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"14268143","answer_count":"1","comment_count":"10","creation_date":"2013-01-10 21:05:43.013 UTC","last_activity_date":"2013-01-10 22:34:17.487 UTC","last_edit_date":"2013-01-10 22:34:17.487 UTC","last_editor_display_name":"","last_editor_user_id":"1184413","owner_display_name":"","owner_user_id":"1184413","post_type_id":"1","score":"-1","tags":"java|arrays|arraylist","view_count":"438"} +{"id":"16192109","title":"JasperReports: Ordering records from XMLDataSource","body":"\u003cp\u003eI recently converted a JasperReport to use the XMLDataSource instead of getting the data from the DB. This was done for performance reasons.\u003c/p\u003e\n\n\u003cp\u003eOne of the requests was to group certain records together.\u003c/p\u003e\n\n\u003cp\u003eI thought I had it working, but this was because my records that were grouped, followed sequentially in the XML file I used to test. So they were already \"grouped/ordered\" in the XML.\u003c/p\u003e\n\n\u003cp\u003eNow that the report is being used in a Live environment, we have picked up that the grouping is not actually working.\u003c/p\u003e\n\n\u003cp\u003eAfter doing some searching and reading, it seems that this cannot be easily done. Because we cannot sort the records from the XMLDataSource.\u003c/p\u003e\n\n\u003cp\u003eSo my question: Is there a way to sort/order the records from the XMLDataSource so that they will correctly group, without using a XSLT. \u003c/p\u003e\n\n\u003cp\u003eI only want to transform the XML as a last resort. Hoping there is another way I can do it.\u003c/p\u003e","accepted_answer_id":"16192642","answer_count":"1","comment_count":"0","creation_date":"2013-04-24 12:30:29.68 UTC","last_activity_date":"2013-04-24 12:57:33.89 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1540695","post_type_id":"1","score":"0","tags":"jasper-reports|xmldatasource","view_count":"572"} +{"id":"14792680","title":"Summation of a set of vectors in Prolog","body":"\u003cp\u003eI am trying to sum up a set of vectors in Prolog.\u003c/p\u003e\n\n\u003cp\u003eI have the code for summing up the elements in one vector but I am not sure how to extend it to multiple vectors.\u003c/p\u003e\n\n\u003cp\u003eI have this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eset_addtion([],0). \nset_addtion([Head | Tail], TotalSum) :-\n set_addtion(Tail, Sum1),\n TotalSum is Head + Sum1.\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"0","creation_date":"2013-02-09 23:09:31.29 UTC","last_activity_date":"2014-02-02 21:28:46.89 UTC","last_edit_date":"2014-02-02 21:28:46.89 UTC","last_editor_display_name":"","last_editor_user_id":"772868","owner_display_name":"","owner_user_id":"1529679","post_type_id":"1","score":"1","tags":"prolog","view_count":"470"} +{"id":"46871894","title":"xcode folders auto expanding so a particular state everytime","body":"\u003cp\u003eI am seeing my file manager constantly auto expand folders to a particular state. I am not using a workspace or cocoapods in my app, although I had in the past.\u003c/p\u003e\n\n\u003cp\u003eNot sure how to reset the behavior so that it remembers the state I have selected and not that same state from the past.\u003c/p\u003e\n\n\u003cp\u003eI have seen threads advising to delete:\u003c/p\u003e\n\n\u003cp\u003eMyProjectName.xcodeproj \u003e project.xcworkspace \u003e xcuserdata \u003e myusername.xcuserdatad \u003e UserInterfaceState.xcuserstate\u003c/p\u003e\n\n\u003cp\u003ebut I am not using a workspace so that is not applicable to me. \u003c/p\u003e\n\n\u003cp\u003eI am using source control and worried there may be some file from a previous workspace that is not being removed.\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-10-22 08:12:32.577 UTC","last_activity_date":"2017-10-22 12:00:19.063 UTC","last_edit_date":"2017-10-22 12:00:19.063 UTC","last_editor_display_name":"","last_editor_user_id":"2227743","owner_display_name":"","owner_user_id":"4718413","post_type_id":"1","score":"1","tags":"xcode","view_count":"39"} +{"id":"23348520","title":"RestKit 0.20 Posting object's attributes on conditional basis","body":"\u003cp\u003eI have complex JSON handling large amount of data, I need to optimise network traffic by sending only required attributes of mapped object to server. \u003c/p\u003e\n\n\u003cp\u003eFor simplicity lets say I have following User class : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@property (nonatomic, retain) NSString *email;\n@property (nonatomic, retain) NSString *fname;\n@property (nonatomic, retain) NSString *password;\n@property (nonatomic, retain) NSString *profilePic;\n@property (nonatomic, retain) NSString *sname;\n@property (nonatomic, retain) NSString *status;\n@property (nonatomic, retain) NSString *token;\n@property (nonatomic, retain) NSString *username;\n@property (nonatomic, retain) NSNumber *isLoggedIn;\n@property (nonatomic, retain) NSDate *dateCreated;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand my attributes mapping dictionary is following :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[dic addEntriesFromDictionary:@{\n @\"fname\": @\"fname\",\n @\"sname\": @\"sname\",\n @\"profilePic\": @\"profilePic\",\n @\"email\": @\"email\",\n @\"username\": @\"username\",\n @\"password\": @\"password\",\n @\"status\": @\"status\",\n @\"token\": @\"token\",\n @\"isLoggedIn\": @\"isLoggedIn\",\n @\"dateCreated\": @\"dateCreated\"\n }];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFor Signin call I needs to post just username \u0026amp; password as following JSON :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n \"user\": {\n \"password\": \"password\",\n \"username\": \"demouser\"\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhile for Signup call I needs to POST entire User object so I cant downsize mapping dictionary. I needs to apply same procedure to lot more complex JSON. \u003c/p\u003e\n\n\u003cp\u003eHow can I send required attributes of an object in POST call on conditional basis in an optimal fashion?\u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-04-28 18:26:06.65 UTC","favorite_count":"1","last_activity_date":"2014-04-29 11:41:16.227 UTC","last_edit_date":"2014-04-29 07:53:36.133 UTC","last_editor_display_name":"","last_editor_user_id":"1996802","owner_display_name":"","owner_user_id":"1996802","post_type_id":"1","score":"1","tags":"ios|restkit|restkit-0.20","view_count":"159"} +{"id":"12806944","title":"GWT and Google Eclipse Plugin: is it possible to run the server in a separate JVM?","body":"\u003cp\u003eI have a GWT project that contains both the GWT UI and the server backend. The server backend contains the \u003ca href=\"https://developers.google.com/web-toolkit/doc/latest/DevGuideServerCommunication#DevGuideRemoteProcedureCalls\" rel=\"nofollow\"\u003eJava GWT Services\u003c/a\u003e that are exposed via GWT's RPC to the UI.\u003c/p\u003e\n\n\u003cp\u003eSince the project has grown quite a bit, with the backend requiring more and more time to start, I am considering moving the UI to a separate project, with the idea to \u003cem\u003erun the backend in a separate VM\u003c/em\u003e. The backend is relatively stable, and it is the UI where we spent most time. With the two in separate VMs, we could work on the UI much more efficiently, since we would only reload the UI (in GWT development mode) and leave the backend running.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eMy question:\u003c/strong\u003e Is it possible to configure the Google Eclipse Plugin in such a way that it runs the UI and backend in separate VMs and I can still use the GWT development mode?\u003c/p\u003e\n\n\u003cp\u003eThe project uses GWT 2.4 and we will update to 2.5 as soon as it is out. We use Maven as the build system.\u003c/p\u003e","accepted_answer_id":"12807300","answer_count":"1","comment_count":"0","creation_date":"2012-10-09 19:22:26.767 UTC","last_activity_date":"2012-10-09 20:29:40.673 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"734191","post_type_id":"1","score":"1","tags":"gwt|gwt-rpc","view_count":"222"} +{"id":"47157182","title":"ComponentWillMount renders again after onclick","body":"\u003cp\u003eWhen you load the page \u003ccode\u003eComponentWillMount\u003c/code\u003e triggers \u003ccode\u003egetLocalStorage\u003c/code\u003e function. This has several checks and triggers the \u003ccode\u003esearch\u003c/code\u003e function. When you load the page it is trying to retrieve the query from localStorage. When you change the input(which changes the query) and submit, the \u003ccode\u003esearch\u003c/code\u003e function should trigger but does not fetch.. instead it refreshes the page and load componentDidMount again? Then after the refresh it works perfectly. Why is it only refreshing one time?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ecomponentWillMount(){\n this.getLocalStorage();\n};\n\ngetLocalStorage = () =\u0026gt; {\n //Check if localstorage is supported by browser\n if (typeof(Storage) !== \"undefined\") {\n\n //Check if localstorage item query is defined\n if (localStorage.getItem(\"query\") !== null) {\n\n //Set query to localstorage item and go to search function\n //This works and triggers the search function\n this.setState({\n query: localStorage.getItem(\"query\")\n },() =\u0026gt; {\n this.search();\n });\n }\n\n // If localstorage item is not defined go to location\n else{\n this.getLocation();\n }\n }\n\n // If localstorage is not supported by the browser go to location\n else {\n this.getLocation();\n }\n};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen you click on the button it triggers the search function but does not fetch. Instead it trigger componentDidMount again?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;input type=\"text\" onChange={this.handleChange} placeholder=\"Find your location...\"/\u0026gt;\n\u0026lt;button onClick={this.search}\u0026gt;Submit\u0026lt;/button\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSearch function\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003esearch = () =\u0026gt; {\n\n this.setState({\n secondLoader:true\n });\n\n let BASE_URL = \"https://maps.googleapis.com/maps/api/geocode/json?\";\n let ACCES_TOKEN = \"token\";\n let FETCH_URL = `${BASE_URL}address=${this.state.query}\u0026amp;key=${ACCES_TOKEN}`;\n\n alert('the search function does not fetch like below instead it trigger componentDidMount again');\n\n\n fetch(FETCH_URL, {\n method: \"GET\"\n\n })\n .then(response =\u0026gt; response.json())\n .then(json =\u0026gt; {\n //If repsonse got zero results use amsterdam location\n if(json.status === 'ZERO_RESULTS'){\n this.setState({\n query: 'Amsterdam'\n });\n }\n\n //Otherwise use query\n else {\n const geocode = json.results[0].geometry.location;\n\n this.setState({\n latitude: geocode.lat,\n longitude: geocode.lng\n });\n }\n\n const BASE_URL = \"https://api.darksky.net/forecast/\";\n const ACCES_TOKEN = \"token\";\n const FETCH_URL = `${BASE_URL}${ACCES_TOKEN}/${this.state.latitude},${this.state.longitude}?lang=nl\u0026amp;units=si`;\n\n fetch(FETCH_URL, {\n method: \"GET\",\n })\n .then(response =\u0026gt; response.json())\n .then(json =\u0026gt; {\n const data = json;\n this.setState({\n weather: data,\n loader: false,\n secondLoader: false\n });\n })\n })\n};\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"47158254","answer_count":"1","comment_count":"7","creation_date":"2017-11-07 11:47:23.027 UTC","last_activity_date":"2017-11-07 12:46:17.51 UTC","last_edit_date":"2017-11-07 12:46:17.51 UTC","last_editor_display_name":"","last_editor_user_id":"3960122","owner_display_name":"","owner_user_id":"3960122","post_type_id":"1","score":"0","tags":"javascript|reactjs","view_count":"45"} +{"id":"4841038","title":"Force MySQL to use two indexes on a Join","body":"\u003cp\u003eI am trying to force my SQL to use a two indexes. I am joining a table and I want them to utilizes the cross between two indexes. The specific term is Using intersect and here is a link to MySQL documentation: \u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://dev.mysql.com/doc/refman/5.0/en/index-merge-optimization.html\" rel=\"noreferrer\"\u003ehttp://dev.mysql.com/doc/refman/5.0/en/index-merge-optimization.html\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eIs there any way to force this implementation? My query was using it (and it sped stuff up), but now for whatever reason it has stopped.\u003c/p\u003e\n\n\u003cp\u003eHere is the JOIN I want to do this on. The two indexes I want the query to use are scs.CONSUMER_ID_1 and scs_CONSUMER_ID_2\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eJOIN survey_customer_similarity AS scs\n ON cr.CONSUMER_ID=scs.CONSUMER_ID_2 \n AND cal.SENDER_CONSUMER_ID=scs.CONSUMER_ID_1 \n OR cr.CONSUMER_ID=scs.CONSUMER_ID_1 \n AND cal.SENDER_CONSUMER_ID=scs.CONSUMER_ID_2\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"4841062","answer_count":"2","comment_count":"2","creation_date":"2011-01-30 03:50:21.777 UTC","favorite_count":"4","last_activity_date":"2015-02-03 03:12:57.333 UTC","last_edit_date":"2011-01-30 04:19:30.76 UTC","last_editor_display_name":"","last_editor_user_id":"573261","owner_display_name":"","owner_user_id":"440266","post_type_id":"1","score":"7","tags":"sql|mysql|query-optimization|intersect","view_count":"28404"} +{"id":"39457824","title":"301 status code after PostForm","body":"\u003cp\u003eI am trying to write a program which will login to \u003ccode\u003eahrefs.com\u003c/code\u003e and parse some data.\nAt first I am sending GET request to \u003ccode\u003eahrefs.com\u003c/code\u003e to get cookies and html to parse needed token:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e client := \u0026amp;http.Client{}\n jar := \u0026amp;myjar{}\n jar.jar = make(map[string] []*http.Cookie)\n client.Jar = jar\n resp, _ := client.Get(\"https://ahrefs.com\")\n\n root, _ := html.Parse(resp.Body)\n element, _ := getElementByName(\"_token\", root)\n token := \"\"\n for _, a := range element.Attr {\n if a.Key == \"value\" {\n token = a.Val\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThen I am sending POST request using \u003ccode\u003ePostForm\u003c/code\u003e to \u003ccode\u003eahrefs.com/user/login/\u003c/code\u003e. I fill the fields with correct data (tested it via browser). When I submit form in browser it has field \u003ccode\u003ereturn_to\u003c/code\u003e with value of main page of the site, which should redirect to \u003ccode\u003eahrefs.com/dashboard/metrics/\u003c/code\u003e (the page from I want to parse data). But my program's behavior is different. After \u003ccode\u003ePostForm\u003c/code\u003e I got \u003ccode\u003e301\u003c/code\u003e status code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eresp, _ = client.PostForm(\n \"https://ahrefs.com/user/login/\",\n url.Values{\n \"email\": {\"djviman@gmail.com\"},\n \"password\": {\"Aau4bqRxfc4ZEvu\"},\n \"_token\": {token},\n \"return_to\": {\"https://ahrefs.com/\"},\n })\n log.Println(resp.Status)\n resp.Body.Close()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThen I am sending GET request to \u003ccode\u003eahrefs.com/dashboard/metrics/\u003c/code\u003e but it redirects me to the home page, like I'm not logged in:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eresp, _ = client.Get(\"https://ahrefs.com/\")\n log.Println(resp.Status)\n resp.Body.Close()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eQuestions are: what I am doing wrong? And hot to successfully log in to this site?\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2016-09-12 19:54:41.413 UTC","last_activity_date":"2016-09-12 19:54:41.413 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2539622","post_type_id":"1","score":"0","tags":"http|go|httpclient","view_count":"36"} +{"id":"1476971","title":"Returning a inherited class as base class type with Web Services","body":"\u003cp\u003eI suspect I am being very silly here but I have the following setup \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eClass MustInherit myBaseClass\n'some stuff\n\nEnd Class\n\nClass myInheritedClassA \n inherits myBaseClass\n\n'some more stuff\nEnd Class\n\n\nClass myInheritedClassB \n inherits myBaseClass\n\n'some more stuff\nEnd Class\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI then have a web service that has a method \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eFunction getSomeClass(id) as myBaseClass\n'a factory here dependent on the id will generate a myInherited Class\nreturn CType(aInstanceOfInheritedClass, mybaseClass)\n\nEnd function\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eRunning this results in the following error\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eUnhandled Exception: System.InvalidOperationException: \n There was an error generating the XML document. ---\u0026gt; \n System.InvalidOperationException: \n The type \u0026lt;type\u0026gt; was not expected. \n Use the XmlInclude or SoapInclude attribute to specify types \n that are not known statically.\" \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo my question is, is there any way of 'Widening' the inherited class to the base class so this would work? \u003c/p\u003e\n\n\u003cp\u003eEDIT: RE: the suggestion regarding XmlInclude(typeof inheritedClass), currently this method could potentially return a number of types of inherited class (i.e myInheritedClassA and myInheritedClassB) is it case of simply having to add each of the inheritedTypes in this tag? \u003c/p\u003e\n\n\u003cp\u003eI have amended the example to hopefully make things clearer\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2009-09-25 12:13:54.487 UTC","favorite_count":"0","last_activity_date":"2009-09-28 08:07:30.14 UTC","last_edit_date":"2009-09-28 08:07:30.14 UTC","last_editor_display_name":"","last_editor_user_id":"11802","owner_display_name":"","owner_user_id":"11802","post_type_id":"1","score":"1","tags":"vb.net|web-services|design-patterns","view_count":"2517"} +{"id":"20050536","title":"How to catch accents in the URL?","body":"\u003cp\u003eMy users type URL's like: \u003c/p\u003e\n\n\u003cp\u003ewww.mydomain.com/library/search/animals/\u003cstrong\u003eiçara\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eBut when it gets to the PHP script, it becomes \u003cstrong\u003eiçara\u003c/strong\u003e.\u003c/p\u003e\n\n\u003cp\u003eIs there any way I can fix it before using this data?\u003c/p\u003e","accepted_answer_id":"20050732","answer_count":"1","comment_count":"0","creation_date":"2013-11-18 14:44:53.5 UTC","favorite_count":"1","last_activity_date":"2013-11-18 14:52:34.233 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1062933","post_type_id":"1","score":"1","tags":"php","view_count":"41"} +{"id":"13359448","title":"Skip Main Menu at the second application launch","body":"\u003cp\u003eI'm new here and a beginner in Xcode, and I'm trying to do an app with 5 pages. The first one is a menu page with 4 buttons, each leading to a different page. When you first launch the application you can choose which page to go to (from the other 4). What I'd like to do is make the application skip the menu page at the second time you launch it (go directly to the page you selected before). Can anyone give me some directions on where to find tips about this, or give an example related to this?\u003c/p\u003e","accepted_answer_id":"13359644","answer_count":"3","comment_count":"0","creation_date":"2012-11-13 10:52:29.013 UTC","last_activity_date":"2012-11-13 11:05:17.973 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1820563","post_type_id":"1","score":"2","tags":"iphone|xcode|xcode4.5","view_count":"42"} +{"id":"11570470","title":"Update devise user from multiple forms","body":"\u003cp\u003eI'm working on a site where the sign-up process is multi-step.. so many little forms all update the user model (i'm using the devise gem for user authentication).\u003c/p\u003e\n\n\u003cp\u003eShould I post each of these steps to the same update action (overriding the RegistrationController update action)? Each form may require some logic before the update occurs, therefore the forms will require some way of figuring out what form it's currently processing (either a hidden field or trying to establish from what params exist)\u003c/p\u003e\n\n\u003cp\u003e..or should I be posting the forms to individual actions (which isn't very RESTful)?\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","accepted_answer_id":"11570531","answer_count":"1","comment_count":"0","creation_date":"2012-07-19 22:51:43.34 UTC","last_activity_date":"2012-07-19 22:57:30.263 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"413986","post_type_id":"1","score":"0","tags":"ruby-on-rails|ruby|devise","view_count":"275"} +{"id":"44760200","title":"How to read meta property of a document using AngularJS?","body":"\u003cp\u003eI am using AngularJS 1.6.3. I need to read meta properties of the Html document inside and AngularJS service. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;html\u0026gt;\n\u0026lt;head\u0026gt;\n \u0026lt;meta name=\"keys\" content=\"key1, key2\"/\u0026gt;\n \u0026lt;!-- ... --\u0026gt;\n\u0026lt;/head\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eDoes AngularJS provide something like \u003ccode\u003eCookieService ($cookies)\u003c/code\u003e for Meta tags?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-06-26 12:52:13.89 UTC","last_activity_date":"2017-06-26 13:04:00.707 UTC","last_edit_date":"2017-06-26 12:57:22.363 UTC","last_editor_display_name":"","last_editor_user_id":"248827","owner_display_name":"","owner_user_id":"248827","post_type_id":"1","score":"0","tags":"javascript|html|angularjs|dom|meta","view_count":"37"} +{"id":"45336934","title":"Preprocess suggestions in Drupal 7 without Devel Theme Developer module","body":"\u003cp\u003eIs there any alternative way to get preprocess/process suggestions without using Devel themer (Theme developer) module?\u003c/p\u003e\n\n\u003cp\u003eApparently I can use $conf['theme_debug'] = TRUE; to get template suggestions, and dpm or var_dump to list available vars, but I can't seem to find a way to list preprocess/process function suggestions like devel themer does\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2017-07-26 20:36:54.81 UTC","last_activity_date":"2017-11-21 04:06:26.883 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2250470","post_type_id":"1","score":"0","tags":"drupal|drupal-7|drupal-theming|drupal-preprocess","view_count":"35"} +{"id":"41901125","title":"Update pyspark's dataframe column","body":"\u003cp\u003eI'm trying to create a new dataframe from an older one modifying the element that appears in it. I have a dataframe like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e+-------+--------------------+--------------------+\n| A | B | C|\n+-------+--------------------+--------------------+\n| 224.39|[2533695.47884,25...|[2.53311343446655...|\n| 398.56|[2551303.18964,25...|[6740638.70550121...|\n|1445.59|[2530998.06972,25...|[7839490.11546087...|\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn columns B and C there are lists of elements (approx. 100 in each row of each column). I would like to create a new dataframe from this one selecting only, for instance, 5 elements in the column C for each row. It would be something like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e+-------+--------------------+--------------------+\n| A | B | C|\n+-------+--------------------+--------------------+\n| 224.39|[2533695.47884,25...|[1,2,3,4,5] |\n| 398.56|[2551303.18964,25...|[1,2,3,4,5] |\n|1445.59|[2530998.06972,25...|[1,2,3,4,5] |\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo far I've only managed to extract in a new dataframe the column C and I tried to use \u003ccode\u003eforeach(lambda x: x[0:5])\u003c/code\u003e, but the dataframe after this foreach is a NoneType element and it doesn't work. \u003c/p\u003e\n\n\u003cp\u003eThanks in advance.\u003c/p\u003e","accepted_answer_id":"42097841","answer_count":"1","comment_count":"0","creation_date":"2017-01-27 18:56:19.76 UTC","favorite_count":"0","last_activity_date":"2017-02-07 19:02:40.65 UTC","last_edit_date":"2017-01-31 23:07:49.093 UTC","last_editor_display_name":"","last_editor_user_id":"6588261","owner_display_name":"","owner_user_id":"6588261","post_type_id":"1","score":"1","tags":"python-2.7|dataframe|pyspark|apache-spark-mllib","view_count":"152"} +{"id":"29033666","title":"Set height 100% but css div does not expand","body":"\u003cp\u003eI have experimented with CSS and found one problem. According to my code (\u003ca href=\"http://jsbin.com/daguviluwo/1/edit?html,output\" rel=\"nofollow\"\u003ehttp://jsbin.com/daguviluwo/1/edit?html,output\u003c/a\u003e), I would like to create two boxes with \"float:left\" which automatically adjust their heights to be equal (=the maximum height). Therefore, I create their parent(id=\"content\"). I thought that the parent's height should be adjusted according to the maximum height of its children (but it is not!). Then, the children with property \"height:100%\" (red box) should have the height as the same as this parent and also the same as the child with maximum height (green box). However, it does not work.\u003c/p\u003e","accepted_answer_id":"29034694","answer_count":"2","comment_count":"2","creation_date":"2015-03-13 13:37:09.897 UTC","favorite_count":"1","last_activity_date":"2015-03-17 18:53:13.79 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4346332","post_type_id":"1","score":"2","tags":"html|css","view_count":"993"} +{"id":"22669997","title":"Issue passing options for a representable - wrong number of arguments (1 for 0)","body":"\u003cp\u003eI'm trying to use passing options in \u003ca href=\"https://github.com/apotonick/representable#passing-options\" rel=\"nofollow\"\u003erepresenters gem\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI have a decorator:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass ProductDecorator \u0026lt; Representable::Decorator\n include Representable::JSON\n\n property :code\n property :name\n\n property :store_id, getter: lambda { |opts| opts[:store_id] },\n type: Integer\n\n property :url, decorator_scope: true, getter: lambda { |options|\n File.join(options.fetch(:site,\"\"), url)\n }, type: String\n\n def url\n File.join(represented.path ,\"p\")\n end\n\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut when I try to pass my options using:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eProductDecorator.new(product).\n to_hash(store_id: 1, site: \"my_url\")\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm getting the message \u003ccode\u003ewrong number of arguments (1 for 0)\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eI've tried many options, but I could find what's going on.\u003c/p\u003e","accepted_answer_id":"22670480","answer_count":"1","comment_count":"0","creation_date":"2014-03-26 18:30:13.387 UTC","last_activity_date":"2014-03-26 19:23:52.47 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"339810","post_type_id":"1","score":"0","tags":"ruby-on-rails|ruby","view_count":"200"} +{"id":"6165428","title":"SendInput to minimized window","body":"\u003cp\u003eIs it possible to utilize the sendInput function on windows that currently do not have focus, and maybe through the use of multithreading, sendinput to multiple minimized windows at the same time, or send input to one window while you're working on another window?\u003c/p\u003e\n\n\u003cp\u003eI'd like to do something like this in c#\u003c/p\u003e\n\n\u003cp\u003ethanks in advance.\u003c/p\u003e","accepted_answer_id":"6165532","answer_count":"2","comment_count":"4","creation_date":"2011-05-29 01:32:41.197 UTC","favorite_count":"1","last_activity_date":"2011-09-16 20:38:35.27 UTC","last_edit_date":"2011-05-29 16:46:37.42 UTC","last_editor_display_name":"","last_editor_user_id":"774766","owner_display_name":"","owner_user_id":"774766","post_type_id":"1","score":"6","tags":"c#","view_count":"5220"} +{"id":"15532107","title":"vTiger webservice \"ACCESS_DENIED : Permission to perform the operation is denied for id\"","body":"\u003cp\u003eI want to add SalesOrder through vTiger webservice. I'm using for this vtwsclib. Here is the code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\ninclude_once('vtwsclib/Vtiger/WSClient.php');\n$url = 'http://localhost:8888';\n$client = new Vtiger_WSClient($url);\n$login = $client-\u0026gt;doLogin('admin', 'zzzzzzzz');\nif(!$login) echo 'Login Failed';\nelse {\n\n $data = array(\n 'subject' =\u0026gt; 'Test SalesOrder',\n 'sostatus' =\u0026gt; 'Created',\n 'invoicestatus'=\u0026gt;'AutoCreated',\n 'account_id'=\u0026gt; '46', // Existing account id\n 'bill_street' =\u0026gt; 'Bill Street',\n 'ship_street' =\u0026gt; 'Ship Street',\n );\n $record = $client-\u0026gt;doCreate('SalesOrder', $data);\n\n$error = $client-\u0026gt;lasterror();\n if($error) {\n echo $error['code'] . ' : ' . $error['message'];\n}\n\nif($record) {\n $salesorderid = $client-\u0026gt;getRecordId($record['id']);\n}\n\n}\n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd I get only: \"ACCESS_DENIED : Permission to perform the operation is denied for id\".\u003c/p\u003e\n\n\u003cp\u003eAccount_id exists in database. Other SalesOrder was added with the same account_id but through webpage. I have also tried variant with accout_id = \"6x46\" where 6 is module_id. It also didn't work. Any ideas how to solve this problem?\u003c/p\u003e","answer_count":"2","comment_count":"2","creation_date":"2013-03-20 18:43:19.227 UTC","favorite_count":"1","last_activity_date":"2015-08-27 17:14:23.77 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"784729","post_type_id":"1","score":"2","tags":"php|web-services|api|vtiger","view_count":"4959"} +{"id":"30303652","title":"WPF: add dynamic ToolTip to DataGridCell","body":"\u003cp\u003eI'm developing my first WPF application that queries a database and shows some records of some tables in \u003ccode\u003eTabControl\u003c/code\u003e if one or more fields of these records not satisfy certain condition.\u003c/p\u003e\n\n\u003cp\u003eI have a \u003ccode\u003eDataTable\u003c/code\u003e as data source and I use a \u003ccode\u003eDataGrid\u003c/code\u003e to show results (i.e. the wrong records). I'd like to use \u003ccode\u003eToolTip\u003c/code\u003e on \u003ccode\u003eDataGridCell\u003c/code\u003e to indicate why a field is considered wrong. There's a way to iterate over the \u003ccode\u003eDataGridRow\u003c/code\u003e and the \u003ccode\u003eDataGridCell\u003c/code\u003e so that I can set dynamic \u003ccode\u003eToolTip\u003c/code\u003efor every specific field?\u003c/p\u003e\n\n\u003cp\u003eThanks in advance.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-05-18 12:49:00.06 UTC","last_activity_date":"2015-05-18 13:12:49.337 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4026277","post_type_id":"1","score":"0","tags":"c#|wpf|datagrid|tooltip|datagridcell","view_count":"69"} +{"id":"21871658","title":"ImageView not moving as I want","body":"\u003cp\u003eI'm implementing the \u003ccode\u003eonTouchListener\u003c/code\u003e demo. In that I want to generate \u003ccode\u003eimageView\u003c/code\u003e dynamically and move it throughout the \u003ccode\u003eframeLayout\u003c/code\u003e.I done with \u003ccode\u003eimageView\u003c/code\u003e creation and also implement the \u003ccode\u003eonTouchListener\u003c/code\u003e but the \u003ccode\u003eimageView\u003c/code\u003e is not moving as I want..Folloing is my code..\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epackage your.packagename;\n\nimport android.app.Activity;\nimport android.graphics.Point;\nimport android.os.Bundle;\nimport android.view.Display;\nimport android.view.MotionEvent;\nimport android.view.View;\nimport android.widget.Button;\nimport android.widget.FrameLayout;\nimport android.widget.ImageView;\n\npublic class MainActivity extends Activity {\n Button b1;\n Button b2;\n FrameLayout f;\n ImageView imageview;\n int windowwidth;\n int windowheight;\n private android.widget.FrameLayout.LayoutParams layoutParams;\n\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n b1 = (Button) findViewById(R.id.button1);\n b2 = (Button) findViewById(R.id.button2);\n f = (FrameLayout) findViewById(R.id.framelayout);\n Display display = getWindowManager().getDefaultDisplay();\n Point size = new Point();\n display.getSize(size);\n windowwidth = size.x;\n windowheight = size.y;\n b1.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n imageview = new ImageView(getBaseContext());\n imageview.setId(1);\n registerForContextMenu(imageview);\n imageview.setBackgroundResource(R.drawable.ic_launcher);\n FrameLayout.LayoutParams ivparam = new FrameLayout.LayoutParams(100, 100);\n imageview.setLayoutParams(ivparam);\n f.addView(imageview);\n imageview.setOnTouchListener(new View.OnTouchListener() {\n @Override\n public boolean onTouch(View v, MotionEvent event) {\n layoutParams = (FrameLayout.LayoutParams) imageview.getLayoutParams();\n switch (event.getAction()) {\n case MotionEvent.ACTION_DOWN:\n break;\n case MotionEvent.ACTION_MOVE:\n int x_cord = (int) event.getRawX();\n int y_cord = (int) event.getRawY();\n if (x_cord \u0026gt; windowwidth) {\n x_cord = windowwidth;\n }\n if (y_cord \u0026gt; windowheight) {\n y_cord = windowheight;\n }\n layoutParams.leftMargin = x_cord - 25;\n layoutParams.topMargin = y_cord - 25;\n imageview.setLayoutParams(layoutParams);\n break;\n default:\n break;\n }\n return true;\n }\n });\n }\n });\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ePlease tell me am I going wrong or should I use any another way.\u003c/p\u003e","answer_count":"0","comment_count":"4","creation_date":"2014-02-19 05:15:28.707 UTC","last_activity_date":"2015-01-07 07:26:34.823 UTC","last_edit_date":"2015-01-07 07:26:34.823 UTC","last_editor_display_name":"","last_editor_user_id":"560600","owner_display_name":"","owner_user_id":"3283568","post_type_id":"1","score":"0","tags":"android|imageview|ontouchlistener","view_count":"131"} +{"id":"27082161","title":"MvvmCross DownloadCache plugin breaks bindings in custom controls on Android","body":"\u003cp\u003eI've wanted to use DownloadCache plugin in my MvvmCross project, but when I've added this package from nugget it broken bindings in custom controls on Android.\u003cbr\u003e\nI'm using MvvmCross v.3.1.1\u003cbr\u003e\nI have tried:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eUpdating MvvmCross and all plugins to v.3.2.2, but this did't helped.\u003c/li\u003e\n\u003cli\u003eUsing target bindings instead of custom control properties, this has helped me, but this solution is not satisfying, because I have lots of custom controls where bindings are broken.\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eAlso I can see an error in output saying:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eMvxBind:Warning: 41,01 Failed to create target binding for binding ControlProperty for ViewModelProperty\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eThanks for any help.\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2014-11-22 20:26:36.537 UTC","last_activity_date":"2014-11-22 20:26:36.537 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1346022","post_type_id":"1","score":"0","tags":"xamarin.android|mvvmcross","view_count":"87"} +{"id":"18422987","title":"detect if Chrome extension content script has been injected / content script include guard","body":"\u003cp\u003eI want to execute a content script function whenever a tab is updated. The problem is that, sometimes the tab update is ajax (without a page reload), while still changing the page's url. Therefore the old content script injected still exists on the page. The result is multiple instances of content script injected and running on the same page.\u003c/p\u003e\n\n\u003cp\u003eSo, I'm looking for a mechanism to inject a content script, only if no same content script has been injected before. Any ideas?\u003c/p\u003e","accepted_answer_id":"18426231","answer_count":"2","comment_count":"2","creation_date":"2013-08-24 20:49:14.897 UTC","favorite_count":"4","last_activity_date":"2016-03-17 06:25:25.02 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2309451","post_type_id":"1","score":"7","tags":"javascript|google-chrome-extension|include","view_count":"4474"} +{"id":"26842805","title":"I want export report using datatable in codeigniter","body":"\u003cp\u003eI am using datatable ( they are provide filtering) and after filtering i want to export in csv.\nExport only filtering data only. How to possible in codeingniter?\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2014-11-10 11:30:29.7 UTC","favorite_count":"1","last_activity_date":"2014-11-10 11:30:29.7 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1537006","post_type_id":"1","score":"0","tags":"php|ajax|codeigniter|dom","view_count":"530"} +{"id":"15893267","title":"extjs 4 dinamyc store","body":"\u003cp\u003eI must to update some label that takes data from a store. I must load into the store new data for ex. each 10 seconds.\nIt's easy - use \u003ccode\u003esetInternal()\u003c/code\u003e (because TaskRunner isn't work o_0)_ and call the store.load event.\nBut my task much more specific. \nI also have a grid that contains of two columns and takes some data from the store and some data is custom.\nIt means that before columns with a clear store dataindexes there are a few new records in a store with custom string data and some numeric data...\nIt's may be hard to explain by word, but in code it looks so:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e//---Store---\nExt.define('App.store.Data', {\n extend: 'Ext.data.Store',\n autoLoad: false,\n storeId:'Data',\n model: 'App.model.DataModel',\n proxy : {\n type : 'ajax',\n url: 'http://mybackend',\n reader: {\n type: 'json'\n } \n },\n data:[first = true],\n listeners:{\n load: function()\n {\n if(first){\n first=false;\n myApp.getController('App.controller.Controller').StoreLoadHandler();\n setInterval(function (){myApp.getController('App.controller.Controller').StoreLoadHandler();},10000);\n }\n\n }\n }\n});\n//---Controller---\nStoreLoadHandler: function(){\n var store = this.getStore('Data');\n //upload data from base into store\n store.reload(); \n store.add(\n [\n {\n fio: 'somedata',\n //calculate some data and write it into store. All dataindexes are existsin model \n operCount: parseInt(this.getStore('Data').first().get('isQuick')),\n opersvod: (this.getStore('Data').first().get('opersvod')),\n isQuick:parseInt(this.getStore('Data').first().get('isQuick')),\n ipk: (this.getStore('Data').first().get('ipk')),\n allCount: (this.getStore('Data').first().get('allCount')),\n id: 0\n },\n {\n fio: \n ...\n id: 1\n },\n {\n fio: \n ...\n id: 2\n } \n ]\n );\n\n\n\n //takes my labels and use setText, works brilliant\n Ext.ComponentQuery.query('#TopPanel')[0].items.getAt(0).items.get('inW').setText(this.StoreCalc('iw'));\n Ext.ComponentQuery.query('#TopPanel')[0].items.getAt(1).items.get('isClose').setText(this.StoreCalc('isClose'));\n Ext.ComponentQuery.query('#TopPanel')[0].items.getAt(2).items.get('denied').setText(this.StoreCalc('denied'));\n Ext.ComponentQuery.query('#BottomPanel')[0].items.getAt(0).items.get('allCount').setText(store.getAt(3).get('allCount'));\n\n //use sort\n store.sort([\n {\n property : 'id',\n direction: 'ASC'\n },\n {\n property : 'fio',\n direction: 'ASK'//'DESC'\n }\n ]);\n store.destroy();\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn this case when I call a \u003ccode\u003estore.load()\u003c/code\u003e method or \u003ccode\u003estore.reload()\u003c/code\u003e my custom records in store are lost.\nIf I delete this operation from listing my custom data is saves and render in grid with 2 columns (dataindexes are - 'fio' and 'operCount')...\nWhere problem is? \u003c/p\u003e","accepted_answer_id":"15899628","answer_count":"1","comment_count":"0","creation_date":"2013-04-09 04:24:35.183 UTC","last_activity_date":"2015-12-25 12:37:53.207 UTC","last_edit_date":"2015-12-25 12:37:53.207 UTC","last_editor_display_name":"","last_editor_user_id":"4370109","owner_display_name":"","owner_user_id":"2257687","post_type_id":"1","score":"1","tags":"javascript|extjs|load|store","view_count":"359"} +{"id":"40516666","title":"Convert array of key-value pairs into associative array without using column names","body":"\u003cp\u003eI have an array from a database query:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eArray (\n [0] =\u0026gt; Array ( [div_id] =\u0026gt; 21 [div_name] =\u0026gt; \"Alphabet\" )\n [1] =\u0026gt; Array ( [div_id] =\u0026gt; 16 [div_name] =\u0026gt; \"Elementary\" )\n [2] =\u0026gt; Array ( [div_id] =\u0026gt; 19 [div_name] =\u0026gt; \"Preschool\" )\n [3] =\u0026gt; Array ( [div_id] =\u0026gt; 20 [div_name] =\u0026gt; \"Secondary\" )\n)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI would like to transform it into:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eArray ( \n [21] =\u0026gt; \"Alphabet\"\n [16] =\u0026gt; \"Elementary\"\n [19] =\u0026gt; \"Preschool\"\n [20] =\u0026gt; \"Secondary\"\n)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, \u003cstrong\u003eI can't use the key names\u003c/strong\u003e. I need to reference them as the first and second columns, since in my context I can't control the keys of the source data. I need to use the same algorithm on data with different key names, for example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eArray (\n [0] =\u0026gt; Array ( [unknown_id] =\u0026gt; 21 [random] =\u0026gt; \"Alphabet\" )\n [1] =\u0026gt; Array ( [unknown_id] =\u0026gt; 16 [random] =\u0026gt; \"Elementary\" )\n [2] =\u0026gt; Array ( [unknown_id] =\u0026gt; 19 [random] =\u0026gt; \"Preschool\" )\n [3] =\u0026gt; Array ( [unknown_id] =\u0026gt; 20 [random] =\u0026gt; \"Secondary\" )\n)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe question is very similar to \u003ca href=\"https://stackoverflow.com/questions/27550173/convert-array-of-key-value-pairs-into-associative-array\"\u003eConvert array of key-value pairs into associative array\u003c/a\u003e but that had [0] and [1] for the keys, and I have text keys but still need to reference the first and second items of the arrays.\u003c/p\u003e","accepted_answer_id":"40516814","answer_count":"2","comment_count":"1","creation_date":"2016-11-09 21:54:47.627 UTC","last_activity_date":"2016-11-09 22:30:04.327 UTC","last_edit_date":"2017-05-23 12:30:37.323 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"6942328","post_type_id":"1","score":"1","tags":"php|arrays","view_count":"55"} +{"id":"30479391","title":"Docker commit crashes terminal","body":"\u003cp\u003eSo I have a container, installed what I wanted etc. and now I have a game server container. What I want to do is to commit the changes but when I run \u003ccode\u003esudo docker commit 596e043d2d8a csgoserver\u003c/code\u003e or \u003ccode\u003esudo docker commit 596e043d2d8a\u003c/code\u003e the terminal asks for my password and after that there is no more feedback. Nothing I write in the terminal has any effect. When I reopen ssh and attach to the container (name hasn't changed) everything I have done is still there. Now I'm not sure if the changes have been commited and I don't wanna take chances here. How should I go about commiting changes?\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2015-05-27 10:09:14.67 UTC","last_activity_date":"2015-05-27 10:09:14.67 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4944147","post_type_id":"1","score":"1","tags":"docker|containers|commit","view_count":"53"} +{"id":"9179578","title":"Embedded flash media player is not starting automatically upon web page load","body":"\u003cp\u003eMy flash media player is not playing automatically when my webpage loads. I have changed the settings from 0 to 1 (which should auto start the file), but still does not start the song automatically. This occurs in IE, FF, and Chrome. Thanks for any help. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;object type=\"application/x-shockwave-flash\" data=\"http://flash-mp3-player.net/medias/player_mp3_maxi.swf\" width=\"200\" height=\"20\"\u0026gt;\n \u0026lt;param name=\"movie\" value=\"http://flash-mp3-player.net/medias/player_mp3_maxi.swf\" /\u0026gt;\n \u0026lt;param name=\"bgcolor\" value=\"#ffffff\" /\u0026gt;\n \u0026lt;param name=\"FlashVars\" value=\"mp3=/NewAYSsite/music/Great_is_Thy_Faithfulness_Crystal_Lewis.mp3\u0026amp;amp;autoplay=0\u0026amp;amp;autoload=1\u0026amp;amp;showstop=1\u0026amp;amp;showvolume=1\u0026amp;amp;bgcolor1=ffa50b\u0026amp;amp;bgcolor2=d07600\" /\u0026gt;\n\u0026lt;/object\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"9180926","answer_count":"2","comment_count":"0","creation_date":"2012-02-07 16:05:09.353 UTC","last_activity_date":"2012-09-16 14:14:40.023 UTC","last_edit_date":"2012-02-07 17:53:56.78 UTC","last_editor_display_name":"","last_editor_user_id":"616443","owner_display_name":"","owner_user_id":"706808","post_type_id":"1","score":"0","tags":"html|css|flash","view_count":"3475"} +{"id":"23377562","title":"Glyphicons \u003c and \u003e appearing as E079 and E080 in little squares in the Bootstrap 3 Carousel","body":"\u003cp\u003eI have used the design found at \u003ca href=\"http://getbootstrap.com/examples/carousel/\" rel=\"nofollow\"\u003ehttp://getbootstrap.com/examples/carousel/\u003c/a\u003e\nI have downloaded the versions of CSS and JS used on the page:\u003c/p\u003e\n\n\u003cp\u003eCSS\u003cbr\u003e\n\u003ca href=\"http://getbootstrap.com/dist/css/bootstrap.min.css\" rel=\"nofollow\"\u003ehttp://getbootstrap.com/dist/css/bootstrap.min.css\u003c/a\u003e\u003cbr\u003e\n\u003ca href=\"http://getbootstrap.com/examples/carousel/carousel.css\" rel=\"nofollow\"\u003ehttp://getbootstrap.com/examples/carousel/carousel.css\u003c/a\u003e \u003c/p\u003e\n\n\u003cp\u003eJavascript:\u003cbr\u003e\n\u003ca href=\"https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js\" rel=\"nofollow\"\u003ehttps://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js\u003c/a\u003e\u003cbr\u003e\n\u003ca href=\"http://getbootstrap.com/dist/js/bootstrap.min.js\" rel=\"nofollow\"\u003ehttp://getbootstrap.com/dist/js/bootstrap.min.js\u003c/a\u003e\u003cbr\u003e\n\u003ca href=\"http://getbootstrap.com/assets/js/docs.min.js\" rel=\"nofollow\"\u003ehttp://getbootstrap.com/assets/js/docs.min.js\u003c/a\u003e \u003c/p\u003e\n\n\u003cp\u003eThe scrolling is working ok and my image changes are fine.\nI have put the files together on a windows machine.\u003c/p\u003e\n\n\u003cp\u003eAny ideas as to what I am doing wrong? \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;a class=\"left carousel-control\" href=\"#myCarousel\" data-slide=\"prev\"\u0026gt;\u0026lt;span class=\"glyphicon glyphicon-chevron-left\"\u0026gt;\u0026lt;/span\u0026gt;\u0026lt;/a\u0026gt;\n\u0026lt;a class=\"right carousel-control\" href=\"#myCarousel\" data-slide=\"next\"\u0026gt;\u0026lt;span class=\"glyphicon glyphicon-chevron-right\"\u0026gt;\u0026lt;/span\u0026gt;\u0026lt;/a\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"25382426","answer_count":"4","comment_count":"3","creation_date":"2014-04-30 00:21:37.717 UTC","favorite_count":"1","last_activity_date":"2017-04-18 07:51:15.137 UTC","last_edit_date":"2014-04-30 01:42:19.963 UTC","last_editor_display_name":"","last_editor_user_id":"283318","owner_display_name":"","owner_user_id":"283318","post_type_id":"1","score":"0","tags":"css|twitter-bootstrap","view_count":"9666"} +{"id":"14848596","title":"NSUrl FileUrlWith Path is appending \" -- file://localhost/\" at end","body":"\u003cp\u003eI am using MPMoviePlayerController to play a video from url.\nfor this i am getting the link from Xml parser.which is fine.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e NSString *path=[[self.items objectAtIndex:videoIndex]objectForKey:@\"link\"];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ei am assigning that path to NSURL fileWithPath as below.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e NSURL *mediaUrl = [NSURL fileURLWithPath:path];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhile printing the mediaUrl, NSLog is giving \"\u003ca href=\"http://example.com\" rel=\"nofollow\"\u003ehttp://example.com\u003c/a\u003e -- file://localhost/\n\"\u003c/p\u003e\n\n\u003cp\u003eWhy the -- file://localhost/ is appended to the url,Because of this video is not palying.\nAny help Please.\nThanks.\u003c/p\u003e","answer_count":"2","comment_count":"3","creation_date":"2013-02-13 07:37:34.827 UTC","last_activity_date":"2013-09-13 19:45:38.74 UTC","last_edit_date":"2013-04-10 18:12:30.03 UTC","last_editor_display_name":"","last_editor_user_id":"28768","owner_display_name":"","owner_user_id":"1931314","post_type_id":"1","score":"3","tags":"iphone|ios|nsurl","view_count":"1869"} +{"id":"45528053","title":"Using map in pair with orElse in Java 8","body":"\u003cp\u003eHaving to two different collection of objects say Set say A and List say B.\u003c/p\u003e\n\n\u003cp\u003eIf set contains any object need to get the firstobject a string variable say objectA.getName() or else need to get the firstobject in List ObjectB.getPerson().getName() and if both the collection is empty null should be assigned to the string.\u003c/p\u003e\n\n\u003cp\u003eBelow is my code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eOptional\u0026lt;String\u0026gt; name1 =a.stream().findfirst().map(P-\u0026gt;p.getName());\n\nString output = null;\n\nif (name1.ispresent()) {\n output = name1.get(); \n} else {\n Optional\u0026lt;String\u0026gt; name2 =a.stream().findfirst().map(p1-\u0026gt;p1.getPerson().getName());\n\n if (name2.ispresent()) {\n output = name2.get();\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere I am getting the correct value. Please help me to attain same using map in pair with orElse.\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2017-08-06 02:31:42.45 UTC","last_activity_date":"2017-08-08 09:09:11.877 UTC","last_edit_date":"2017-08-06 05:50:27.427 UTC","last_editor_display_name":"","last_editor_user_id":"5624053","owner_display_name":"","owner_user_id":"8422422","post_type_id":"1","score":"-2","tags":"java|java-8","view_count":"126"} +{"id":"4399740","title":"How to smoothly toggle border-width with jquery?","body":"\u003cp\u003eI'm trying to smoothly toggle the border-width of a span between 0 and 5.\nThis is the code I have tried, developing in firefox\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e function anim()\n {\n this.sw=!this.sw;\n if(this.sw)\n {\n //lower\n $('.cell_action').animate(\n {\n 'border-width':'0px',\n 'margin':0\n },\n 600\n );\n }\n else\n {\n //raise\n $('.cell_action').animate(\n {\n 'border-width':'5px',\n 'margin':-5\n },\n 600\n );\n }\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I try to go to 5px, it seems to work, but when I run the function again to animate back to 0, the border is set immediately to 0 and only the margin animates.\u003c/p\u003e","accepted_answer_id":"4726429","answer_count":"1","comment_count":"0","creation_date":"2010-12-09 15:15:41.347 UTC","favorite_count":"2","last_activity_date":"2011-01-23 22:30:20.457 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"470146","post_type_id":"1","score":"4","tags":"jquery-animate","view_count":"4278"} +{"id":"39254263","title":"LINQ - search between IList and list of strings","body":"\u003cp\u003eIm not very well versed in LINQ and I think this problem could be solved with it.\u003c/p\u003e\n\n\u003cp\u003eI have a list of objects:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eIList\u0026lt;Aclass\u0026gt; allADs;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eClass:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic static class Aclass\n{\n private string myName { get; set; }\n //And more attributes.\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd I have a list of strings:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eList\u0026lt;string\u0026gt; lstGroups = new List\u0026lt;string\u0026gt;();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAt this point in my code both my list of objects and the list of strings are full. What I want is a list of \u003ccode\u003eAclass\u003c/code\u003e that matches the property \u003ccode\u003emyName\u003c/code\u003e with the strings of the list. the list of strings have unique elements, there is no repetition.\u003c/p\u003e","accepted_answer_id":"39254297","answer_count":"2","comment_count":"0","creation_date":"2016-08-31 16:03:35.613 UTC","last_activity_date":"2016-08-31 17:25:05.03 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3442470","post_type_id":"1","score":"2","tags":"c#|linq","view_count":"84"} +{"id":"25569074","title":"Dynamic created variables inside for loop, Javascript","body":"\u003cp\u003eCreating static variables is not an option in this case becouse it would take to long time and ineffective to what im trying to accomplish. I have an \u003ccode\u003eArray\u003c/code\u003e with images and I'm trying to create a way to make divs according to the length of the array. 1,2,3,4 etc.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar images = ['image1.JPG', 'image2.JPG', 'image3.JPG'];\nvar totalimages = images.length;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhich will result in an \u003ccode\u003earray\u003c/code\u003e length of 3. I would like to create 3 variables for this.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efor (var i = 0; i \u0026gt; totalimages; i++){\n var div[i] = document.createElement('div');\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis seems not to be working for some reason. I tried to create a div array/list outside the for loop aswell.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar div = [];\n\nfor (var i = 0; i \u0026gt; totalimages; i++){\n var div[i] = document.createElement('div');\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eStill not working. I dunno why this is not working. Javascript only\u003c/p\u003e\n\n\u003cp\u003eEDIT: (not working) i mean it gives me syntax error.\u003c/p\u003e","accepted_answer_id":"25569105","answer_count":"3","comment_count":"4","creation_date":"2014-08-29 13:15:11.26 UTC","last_activity_date":"2014-08-29 13:28:08.24 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3721495","post_type_id":"1","score":"0","tags":"javascript","view_count":"51"} +{"id":"17091843","title":"SQL Query, return all children in a one-to-many relationship when one child matches","body":"\u003cp\u003eI'm working on enhancing a query for a DB2 database and I'm having some problems getting acceptable performance due to the number of joins across large tables that need to be performed to get all of the data and I'm hoping that there's a SQL function or technique that can simplify and speed up the process.\u003c/p\u003e\n\n\u003cp\u003eTo break it down, let's say there are two tables: People and Groups. Groups contain multiple people, and a person can be part of multiple groups. It's a many-to-many, but bear with me. Basically, there's a subquery that will return a set of groups. From that, I can join to People (which requires additional joins across other tables) to get all of the people from those groups. However, I also need to know all of the groups that those people are in, which means joining back to the Groups table again (several more joins) to get a superset of the original subquery. There are additional joins in the query as well to get other pieces of relevant data, and the cost is adding up in a very ugly way. I also need to return information from both tables, so that rules out a number of techniques.\u003c/p\u003e\n\n\u003cp\u003eWhat I'd like to do is be able to start with the People table, join it to Groups, and then compare Groups with the subquery. If the Groups attached to one person has one match in the subquery, it should return ALL Group items associated with that person.\u003c/p\u003e\n\n\u003cp\u003eEssentially, let's say that Bob is part of Group A, B, and C. Currently, I start with groups, and let's say that only Group A comes out of the subquery. Then I join A to Bob, but then I have to come back and join Bob to Group again to get B and C. SQL example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT p.*, g2.*\nFROM GROUP g\nJOIN LINKA link\nON link.GROUPID = g.GROUPID\nJOIN LINKB link1\nON link1.LISTID = link.LISTID\nJOIN PERSON p\nON link1.PERSONID = p.PERSONID\nJOIN LINKB link2\nON link2.PERSONID = p.PERSONID\nJOIN LINKA link3\nON link2.LISTID = link3.LISTID\nJOIN GROUP g2\nON link3.GROUPID = g2.GROUPID\nWHERE\ng.GROUPID IN (subquery)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eYes, the linking tables aren't ideal, but they're basically normalized tables containing additional information that is not relevant to the query I'm running. We have to start with a filtered Group set, join to People, then come back to get all of the Groups that the People are associated to.\u003c/p\u003e\n\n\u003cp\u003eWhat I'd like to do is start with People, join to Group, and if ANY Group that Bob is in returns from the subquery, ALL should be returned, so if we have Bob joined to A, B, and C, and A is in the subquery, it will return three rows of Bob to A, B, and C as there was at least one match. In this way, it could be treated as a one-to-many relationship if we're only concerned with the Groups for each Person and not the other way around. SQL example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSELECT p.*, g.*\nFROM PEOPLE p\nJOIN LINKB link\nON link.PERSONID = p.PERSONID\nJOIN LINKA link1\nON link.LISTID = link1.LISTID\nJOIN GROUP g\nON link1.GROUPID = g.GROUPID\nWHERE\n--SQL function, expression, or other method to return \n--all groups for any person who is part of any group contained in the subquery\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe number of joins in the first query make it largely unusable as these are some pretty big tables. The second would be far more ideal if this sort of thing is possible.\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2013-06-13 16:06:05.61 UTC","last_activity_date":"2013-06-13 16:29:52.583 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1017413","post_type_id":"1","score":"0","tags":"sql|db2|one-to-many","view_count":"897"} +{"id":"867917","title":"web.config ignoring certain files from requiring authentication","body":"\u003cp\u003eIn my asp.net web application, I have a folder in which I have a few html and jpeg files. some of these files do not need a user to login while the others do. How do I exclude the files that are free for view to be displayed without logging in while still maintaining the user to login for viewing other files in the same folder using just the config file. I wasnt able to find something relevant in the config file or maybe I overlooked it. If anyone knows please reply.\u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2009-05-15 10:30:43.883 UTC","last_activity_date":"2009-05-15 10:43:44.257 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"20358","post_type_id":"1","score":"0","tags":"asp.net|web-config","view_count":"676"} +{"id":"13220455","title":"saving data to mongodb using pymongo","body":"\u003cp\u003eI am having an issue trying to save data to MongoDB.\u003c/p\u003e\n\n\u003cp\u003eI first run this python program:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport pymongo\nimport sys\n\ndef main():\n connection = pymongo.Connection(\"mongodb://localhost\", safe = True) \n\n db = connection.m101\n people = db.people\n\n person = {'name':'Barack Obama', 'role':'president'}\n people.insert(person)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut then, when i try to retrieve the data from the mongoshell:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026gt; use m101\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eswitched to db m101\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026gt; db.people.find()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ereturns nothing! I'm not sure what is going on. Thanks for your help.\u003c/p\u003e","accepted_answer_id":"13220546","answer_count":"2","comment_count":"0","creation_date":"2012-11-04 16:29:45.693 UTC","favorite_count":"1","last_activity_date":"2014-06-13 20:57:21.403 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1106074","post_type_id":"1","score":"1","tags":"python|mongodb|pymongo","view_count":"1754"} +{"id":"25686490","title":"iOS 8 Auto cell height - Can't scroll to last row","body":"\u003cp\u003eI am using iOS 8 new self-sizing cells. Visually it works good - each cell gets its right size. However, if I try to \u003cstrong\u003escroll to the last row\u003c/strong\u003e, the table view doesn't seem to know its right size. Is this a bug or is there a fix for that?\u003c/p\u003e\n\n\u003ch2\u003eHere's how to recreate the problem:\u003c/h2\u003e\n\n\u003cp\u003eUsing this project - \u003ca href=\"https://github.com/smileyborg/TableViewCellWithAutoLayoutiOS8\" rel=\"nofollow noreferrer\"\u003eTableViewCellWithAutoLayoutiOS8\u003c/a\u003e (referenced from \u003ca href=\"https://stackoverflow.com/a/18746930/442896\"\u003ethis SO answer\u003c/a\u003e), I got the auto-resizing cells as expected. \u003c/p\u003e\n\n\u003cp\u003eHowever, if I am calling the \u003cem\u003escrollToRowAtIndexPath\u003c/em\u003e function, like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etableView.scrollToRowAtIndexPath(NSIndexPath(forRow: model.dataArray.count - 1, inSection: 0), atScrollPosition: .Bottom, animated: true)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI \u003cstrong\u003edo not get to the last row\u003c/strong\u003e - It only gets me around halfway there. \u003c/p\u003e\n\n\u003cp\u003eEven by trying to use a lower level function like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etableView.setContentOffset(CGPointMake(0, tableView.contentSize.height - tableView.frame.size.height), animated: true)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe result is not as expected, it won't get to the end. If I click it a lot of times or wait a few moments, eventually it will get to the right place. It seems the tableView.contentSize.height is not set correctly, so the iOS \"doesn't know\" where that last cell is.\u003c/p\u003e\n\n\u003cp\u003eWould appreciate any help.\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","accepted_answer_id":"25800080","answer_count":"11","comment_count":"7","creation_date":"2014-09-05 12:57:35.917 UTC","favorite_count":"28","last_activity_date":"2016-08-10 10:42:44.633 UTC","last_edit_date":"2017-05-23 12:17:31.937 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"442896","post_type_id":"1","score":"54","tags":"ios|uitableview|swift|ios8","view_count":"20611"} +{"id":"28456782","title":"How to proper align after CSS column-count","body":"\u003cp\u003eI'm working on an unordered list. I'm trying to display the content in multiple columns. I've managed to do this with CSS's column-count, however the content is not displayed properly. It seems like the first item of the list is placed on the second position, resulting in a crooked list.\u003c/p\u003e\n\n\u003cp\u003eInstead of this output:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eA F K\nB G L\nC H M\nD I N\nE J O\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI get:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e E J O \nA F K \nB G L \nC H M\nD I N\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eor, when I have two items to place in two columns, I want:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eA B \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut I get:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e A B\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo it seems like the first position is always skipped. I've looked for ways t solve this but couldn't find others with this problem, mostly people have other alignment issues. This is the CSS of the div that contains the ul:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ediv.partlist { \n-moz-column-count: 3;\n-moz-column-gap: 10px;\n-webkit-column-count: 3;\n-webkit-column-gap: 10px;\ncolumn-count: 3;\ncolumn-gap: 10px;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnyone any thoughts?\u003c/p\u003e","accepted_answer_id":"28457256","answer_count":"1","comment_count":"2","creation_date":"2015-02-11 14:27:43.873 UTC","favorite_count":"1","last_activity_date":"2015-02-11 14:49:50.65 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4222555","post_type_id":"1","score":"0","tags":"html|css|multiple-columns","view_count":"911"} +{"id":"34311954","title":"Passing variables to Symfony2 service constructor","body":"\u003cp\u003eI have a Symfony2 application (a bridge to third party API) consisting mostly of console commands. Each console command takes an \"organizationId\" argument which is used to resolve various options of the API, such as API key, url, available languages etc. 90% of services in the application use these parameters either for calling the API, or for fetching/storing data in the local database.\u003c/p\u003e\n\n\u003cp\u003eI use Symfony DI to construct the services, and each service has public method \u003ccode\u003esetOrganization(Organization $organization)\u003c/code\u003e which is called after getting the service. E.g. (simplified code):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprotected function execute(InputInterface $input, OutputInterface $output)\n{\n $organization = $this\n -\u0026gt;getContainer()\n -\u0026gt;get('doctrine')\n -\u0026gt;getRepository('CoreBundle:Organization')\n -\u0026gt;find($input-\u0026gt;getArgument('organizationId'));\n\n $personService = $this-\u0026gt;getContainer()\n -\u0026gt;get('person')\n -\u0026gt;setOrganization($organization); // I want to get rid of this\n $personService-\u0026gt;doStuff();\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eService definition:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eperson:\n class: AppBundle\\Services\\Person\n arguments: [\"@buzz\", \"@doctrine.orm.entity_manager\", \"@organization_settings_resolver\", \"%media_service%\"]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am looking for a way to refactor code so that I don't need to call \u003ccode\u003esetOrganization()\u003c/code\u003e whenever I use any service. Is it possible to pass an object or a command line parameter to the constructor without passing the whole service container?\nMaybe there should be a different approach, e.g. something like \u003ccode\u003esecurity.token_storage\u003c/code\u003e layer, which would store something like \"session information\" but in a console way?\nWhat would be the best architectural and Symfony-way solution here?\u003c/p\u003e","answer_count":"2","comment_count":"1","creation_date":"2015-12-16 12:23:01.723 UTC","last_activity_date":"2015-12-16 12:57:21.013 UTC","last_edit_date":"2015-12-16 12:57:21.013 UTC","last_editor_display_name":"","last_editor_user_id":"457268","owner_display_name":"","owner_user_id":"1281860","post_type_id":"1","score":"2","tags":"php|symfony|dependency-injection","view_count":"377"} +{"id":"6213677","title":"Unable to run a JBehave story","body":"\u003cp\u003eCan someone help me to run a JBehave story? I've got a Maven project in Eclipse.\u003c/p\u003e\n\n\u003cp\u003eThe story is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eMeta:\n@author Nikolay Vasilev\n@bdd-talk: BG JUG\n\nScenario: Validating BMI calculator\n\nGiven a body mass index calculator\nWhen a doctor populates health record of a patient with mass 90 kg and 175 cm tall\nThen patient's body mass index is 23\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt is stored in \u003ccode\u003esrc/test/resources/stories\u003c/code\u003e, which is reflected in the \u003ccode\u003epom.xml\u003c/code\u003e:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;build\u0026gt;\n \u0026lt;testResources\u0026gt;\n \u0026lt;testResource\u0026gt;\n \u0026lt;directory\u0026gt;src/test/resources/stories\u0026lt;/directory\u0026gt;\n \u0026lt;/testResource\u0026gt;\n \u0026lt;/testResources\u0026gt;\n ...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe steps class is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class MetricBMICalculatorSteps {\n private HealthRecord healthRecord;\n private MetricBMICalculator bmiCalculator;\n private BodyMassIndex bmi;\n\n @Given(\"a body mass index calculator\")\n public void initBMICalculator() {\n bmiCalculator = new MetricBMICalculator();\n }\n\n @When(\"a doctor populates health record of a patient with mass $weight kg and $height cm tall\")\n public void populateHealthRecord(@Named(\"weight\") float weight, @Named(\"height\") float height) {\n healthRecord = new ISUHealthRecord();\n healthRecord.setWeight(weight);\n healthRecord.setHeight(height);\n bmi = bmiCalculator.calculate(healthRecord);\n }\n\n @Then(\"Then patient's body mass index is $bmi\")\n public void checkBmi(@Named(\"bmi\") double bmiValue) {\n Assert.assertEquals(bmiValue, bmi.value());\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy Embedder is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class MyEmbedder extends Embedder {\n\n // --- Constants -----------------------------------------------------------\n\n private Configuration configuration;\n\n // --- Constructors --------------------------------------------------------\n\n public MyEmbedder() {\n configuration = loadConfiguration();\n }\n\n // --- Methods -------------------------------------------------------------\n\n @Override\n public Configuration configuration() {\n return configuration;\n }\n\n // Here we specify the steps classes\n @Override\n public List\u0026lt;CandidateSteps\u0026gt; candidateSteps() {\n // varargs, can have more that one steps classes\n return new InstanceStepsFactory(configuration(), new MetricBMICalculatorSteps()).createCandidateSteps();\n }\n\n // --- Methods (Auxiliary) -------------------------------------------------\n\n private Configuration loadConfiguration() {\n Configuration configuration = new MostUsefulConfiguration();\n configuration.useStoryLoader(loadStoryLoader());\n configuration.useStoryReporterBuilder(loadStoryReporterBuilder());\n configuration.useStepMonitor(new SilentStepMonitor());\n\n return configuration;\n }\n\n // where to find the stories\n private StoryLoader loadStoryLoader() {\n return new LoadFromRelativeFile(\n CodeLocations.codeLocationFromClass(this.getClass()));\n }\n\n private StoryReporterBuilder loadStoryReporterBuilder() {\n // CONSOLE and TXT reporting\n StoryReporterBuilder storyReporterBuilder = new StoryReporterBuilder();\n storyReporterBuilder.withDefaultFormats();\n storyReporterBuilder.withFormats(Format.CONSOLE, Format.TXT);\n return storyReporterBuilder;\n }\n\n public void runStory(String story) {\n if (story != null \u0026amp;\u0026amp; story.endsWith(\".story\")) {\n this.runStoriesAsPaths(Arrays.asList(story));\n } else {\n throw new RuntimeException(\"Problem locating .story file:\" + story);\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I try to run it with:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eString storyRelativePath = \"health/steps/MetricBMICalculator.story\";\nMyEmbedder eclipseEmbedder = new MyEmbedder(storyRelativePath);\neclipseEmbedder.runStory(storyRelativePath);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eit seems to me that the steps file is not executed whatsoever (at least during debugging the execution doesn't stop on the breakpoints in the steps class which I put). Here is the output from the execution:\u003c/p\u003e\n\n\u003cpre class=\"lang-none prettyprint-override\"\u003e\u003ccode\u003eProcessing system properties {}\n\n(BeforeStories)\nUsing 1 threads\nRunning story health/steps/MetricBMICalculator.story\n\n(AfterStories)\nGenerating reports view to 'D:\\workspace\\bg-jug-bdd\\jug-bdd-jbehave-maven\\target\\jbehave'\n\nusing formats `[stats, console, txt]`\n\nand view properties\n{defaultFormats=stats, decorateNonHtml=true, viewDirectory=view, decorated=ftl/jbehave-report-decorated.ftl, reports=ftl/jbehave-reports-with-totals.ftl, maps=ftl/jbehave-maps.ftl, navigator=ftl/jbehave-navigator.ftl, views=ftl/jbehave-views.ftl, nonDecorated=ftl/jbehave-report-non-decorated.ftl}\nReports view generated with 2 stories (of which 0 pending) containing 0 scenarios (of which 0 failed and 0 pending)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eDoes anyone have a clue what I am supposed to do in order to run that story?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2011-06-02 11:02:17.56 UTC","last_activity_date":"2013-07-03 01:47:37.457 UTC","last_edit_date":"2013-07-03 01:47:37.457 UTC","last_editor_display_name":"","last_editor_user_id":"122607","owner_display_name":"","owner_user_id":"777531","post_type_id":"1","score":"3","tags":"java|maven|jbehave","view_count":"9426"} +{"id":"939579","title":"Detect if Tooltip is shown?","body":"\u003cp\u003eI am manually displaying a System.Windows.Forms.Tooltip on a control using the show method, but how can I detect if a tooltip is currently shown?\u003c/p\u003e\n\n\u003cp\u003eIf I need to change the method for showing it to find out, that is fine.\u003c/p\u003e","accepted_answer_id":"959885","answer_count":"3","comment_count":"3","creation_date":"2009-06-02 13:35:17.99 UTC","favorite_count":"1","last_activity_date":"2012-11-03 20:40:22.78 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"53236","post_type_id":"1","score":"4","tags":"c#|winforms|tooltip|visibility","view_count":"5971"} +{"id":"28426511","title":"How can we import files from PC directly in SAS University Edition?","body":"\u003cp\u003eI am using SAS University Edition and i have to import files into SAS software. I have tried using 'infile' and 'proc import' statements but these are not working when accessing the files directly from PC.\u003c/p\u003e\n\n\u003cp\u003eIs there a way to access the files directly from PC in SAS UE?\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2015-02-10 07:45:59.69 UTC","favorite_count":"1","last_activity_date":"2016-07-27 03:09:43.323 UTC","last_edit_date":"2016-07-27 03:09:43.323 UTC","last_editor_display_name":"","last_editor_user_id":"1623007","owner_display_name":"","owner_user_id":"4510491","post_type_id":"1","score":"2","tags":"sas|sas-studio","view_count":"1806"} +{"id":"33480705","title":"Python - Network WMI remotely run exe, and grab the text result","body":"\u003cp\u003eI have a python project called the \"Remote Dongle Reader\". There are about 200 machines that have a \"Dongle\" attached, and a corresponding .exe called \"Dongle Manager\". Running the Dongle Manager spits out a \"Scan\" .txt file with information from the dongle. \u003c/p\u003e\n\n\u003cp\u003eI am trying to write a script, which runs from a central location, which has administrative domain access to the entire network. It will read a list of hostnames, go through each one, and bring back all the files. Once it brings back all the files, it will compile to a csv.\u003c/p\u003e\n\n\u003cp\u003eI have it working on my Lab/Test servers, but in production systems, it does nto work. I am wondering if this is some sort of login issue since people may be actively using the system. THe process needs to launch silently, and do everything int he background. However since I am connecting to the administrator user, I wonder if there is a clash. \u003c/p\u003e\n\n\u003cp\u003eI am not sure what's going on other than tge application works up until the point I expect the file to be there. The \"Dongle Manager\" process starts, but it doesnt appear to be spitting the scan out on any machine not logged in as administrator (the account I am running off of).\u003c/p\u003e\n\n\u003cp\u003eBelow is the snippet of the WMI section of the code. This was a very quick script so I apoliogize for any non pythonic statements. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e c = wmi.WMI(ip, user=username, password=password)\n\n process_startup = c.Win32_ProcessStartup.new()\n process_startup.ShowWindow = SW_SHOWNORMAL\n cmd = r'C:\\Program Files\\Avid\\Utilities\\DongleManager\\DongleManager.exe'\n process_id, result = c.Win32_Process.Create(CommandLine=cmd,\n ProcessStartupInformation=process_startup)\n if result == 0:\n print(\"Process started successfully: %d\" % process_id)\n else:\n print(\"Problem creating process: %d\" % result)\n while not os.path.exists((\"A:/\"+scan_folder)):\n time.sleep(1)\n counter += 1\n if counter \u0026gt; 20:\n failed.append(hostname)\n print(\"A:/\"+scan_folder+\"does not exist\")\n return\n\n time.sleep(4)\n\n scan_list = os.listdir(\"A:/\"+scan_folder)\n scan_list.sort(key=lambda x: os.stat(os.path.join(\"A:/\"+scan_folder, x)).st_mtime, reverse=True)\n if scan_list is []:\n failed.append(hostname)\n return\n\n recursive_overwrite(\"A:/\"+scan_folder+\"/\"+scan_list[0],\n \"C:\\\\AvidTemp\\\\Dongles\\\\\"+hostname+\".txt\")\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAssuming I get a connection (computer on), it usually fails at the point where it either waits for teh folder to be created, or expects something in the list of scan_folder... either way, something is stopping the scan from being created, even though the process is starting \u003c/p\u003e\n\n\u003cp\u003eEdit, I am mounting as A:/ elsewhere in the code\u003c/p\u003e","accepted_answer_id":"33505781","answer_count":"1","comment_count":"4","creation_date":"2015-11-02 15:06:39.777 UTC","last_activity_date":"2015-11-21 23:26:01.307 UTC","last_edit_date":"2015-11-21 23:26:01.307 UTC","last_editor_display_name":"","last_editor_user_id":"1505120","owner_display_name":"","owner_user_id":"2653384","post_type_id":"1","score":"2","tags":"python|dns|wmi","view_count":"108"} +{"id":"28348253","title":"Django-dashing creating your own widgets","body":"\u003cp\u003eIve been trying to create a custom widget for my dashboard which runs using the django-dashing framework\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://github.com/talpor/django-dashing\" rel=\"nofollow\"\u003ehttps://github.com/talpor/django-dashing\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://django-dashing.readthedocs.org/en/latest/\" rel=\"nofollow\"\u003ehttp://django-dashing.readthedocs.org/en/latest/\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eMy CustomWidget is defined like so:\u003c/p\u003e\n\n\u003cp\u003eCustomWidget.py:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efrom dashing.widgets import Widget\n\nclass CustomWidget(Widget):\n title = ''\n more_info = ''\n updated_at = ''\n detail = ''\n value = ''\n\n def get_title(self):\n return self.title\n\n def get_more_info(self):\n return self.more_info\n\n def get_updated_at(self):\n return self.updated_at\n\n def get_detail(self):\n return self.detail\n\n def get_value(self):\n return \"$67\"\n #return self.value\n\n def get_context(self):\n return {\n 'title': self.get_title(),\n 'more_info': self.get_more_info(),\n 'updated_at': self.get_updated_at(),\n 'detail': self.get_detail(),\n 'value': self.get_value(),\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003estatic/widgets/custom_widget/custom_widget.css:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e.widget-custom_widget {\n background-color: #96bf48;\n}\n\n.widget-custom_widget h1 { \n color: rgba(255, 255, 255, 0.7);\n}\n\n.widget-custom_widget h2 {\n color: #fff;\n}\n\n.widget-custom_widget .detail {\n font-weight: 500;\n font-size: 30px;\n color: #fff;\n}\n\n.widget-custom_widget .more-info {\n color: rgba(255, 255, 255, 0.7);\n}\n\n.widget-custom_widget .updated-at {\n color: rgba(0, 0, 0, 0.3);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003estatic/widgets/custom_widget/custom_widget.html:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div\u0026gt;\n \u0026lt;h1\u0026gt;{ data.title }\u0026lt;/h1\u0026gt;\n \u0026lt;h2\u0026gt;{ data.value }\u0026lt;/h2\u0026gt;\n \u0026lt;p class=\"detail\"\u0026gt;{ data.detail }\u0026lt;/p\u0026gt;\n \u0026lt;p class=\"more-info\"\u0026gt;{ data.more_info }\u0026lt;/p\u0026gt;\n \u0026lt;p class=\"updated-at\"\u0026gt;{ data.updated_at }\u0026lt;/p\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003estatic/widgets/custom_widget/custom_widget.js:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e/* global $, rivets, Dashing, Dashboard */\n\nDashing.widgets.CustomWidget = function (dashboard) {\n var self = this,\n widget;\n this.__init__ = Dashing.utils.widgetInit(dashboard, 'custom_widget');\n this.row = 1;\n this.col = 1;\n this.color = '#96bf48';\n this.data = {};\n this.getWidget = function () {\n return widget;\n };\n this.getData = function () {};\n this.interval = 1000;\n};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003estatic/dashing-config.js:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar dashboard = new Dashboard();\n\ndashboard.addWidget('custom_widget_that_does_stuff', 'CustomWidget', {\n getData: function () {\n $.extend(this.data, {\n title: 'Current Valuation',\n more_info: 'In billions',\n updated_at: 'Last updated at 14:10',\n detail: '64%',\n value: '$35'\n });\n\n }\n});\ndashboard.publish('custom_widget/getData')\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy question is the following: \nHow can i get my widget to update?\n(the widget itself appears, but only with the default settings)\u003c/p\u003e\n\n\u003cp\u003eif i hit the url:\nDashboard/widgets/custom_widget - I can see the custom data that im returning from my CustomWidget class.\u003c/p\u003e\n\n\u003cp\u003eI read in the documentation that the correct way to do this is to call:\u003c/p\u003e\n\n\u003cp\u003edashboard.publish('custom_widget/getData')\nHowever this yields nothing.\u003c/p\u003e\n\n\u003cp\u003eHas anyone got any ideas why this wouldnt be working? or a link to a tutorial ? (I wasnt able to find anything other than the document i linked above)\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","accepted_answer_id":"28365535","answer_count":"1","comment_count":"0","creation_date":"2015-02-05 15:49:56.103 UTC","last_activity_date":"2015-10-11 20:18:56.183 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4050144","post_type_id":"1","score":"1","tags":"javascript|python|django|widget","view_count":"1325"} +{"id":"34282622","title":"Uploading Mapbox Style (Studio) to CartoDB?","body":"\u003cp\u003eMy basemap made in Mapbox Studio is not uploading to CartoDB. I enter the URL and my Access Token but it just says \"This URL not valid\" \u003c/p\u003e\n\n\u003cp\u003eThis is the URL, copied straight from the Mapbox \"Share this style\" box:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://api.mapbox.com/styles/v1/s\" rel=\"nofollow\"\u003ehttps://api.mapbox.com/styles/v1/s\u003c/a\u003e****/cii6i33h6009t91m148mn7y90.html?title=true\u0026amp;access_token=pk.eyJ1Ijoic2hhbmVnYWx3YXkiLCJhIjoiY2lpMWIwMGs5MDA2ZXQza2Zob2NjOWgwNyJ9.EtwsJtB5yhV75-fO9L1yXA#13.007195441591573/42.34777164609585/-71.09705213424535/0\u003c/p\u003e","accepted_answer_id":"34283921","answer_count":"1","comment_count":"0","creation_date":"2015-12-15 06:43:04.783 UTC","last_activity_date":"2015-12-15 08:09:48.267 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5460755","post_type_id":"1","score":"1","tags":"mapbox|cartodb","view_count":"209"} +{"id":"11170207","title":"Visual Studio 2010 crashes on view properties","body":"\u003cp\u003eSomehow my Properties window has become detached. When I view properties of any item in the Solution Explorer, it pops up but then I get a message that Visual Studio has stopped unexpectedly. \u003c/p\u003e\n\n\u003cp\u003eI've gone through my solution and deleted all .user and .suo files, but it still happens. I've also tried the reset layout option and no luck. \u003c/p\u003e\n\n\u003cp\u003eThere must be a docking information file somewhere that I could delete or edit.\u003c/p\u003e\n\n\u003cp\u003eHow can this be solved?\u003c/p\u003e","accepted_answer_id":"11170244","answer_count":"1","comment_count":"1","creation_date":"2012-06-23 14:18:51.073 UTC","favorite_count":"1","last_activity_date":"2012-06-23 14:24:19.023 UTC","last_edit_date":"2012-06-23 14:22:00.193 UTC","last_editor_display_name":"","last_editor_user_id":"23199","owner_display_name":"","owner_user_id":"1451295","post_type_id":"1","score":"0","tags":"visual-studio-2010","view_count":"183"} +{"id":"37740938","title":"Run two jquery with order","body":"\u003cp\u003eI have a problem with tow jquery function, I have a autocomplete search box on form and tow function in script part. I want a function fetch a list and other one autocomplete text box but can`t call fetch function at first. It run after autocomplete function all the time.Can every one help me?\u003c/p\u003e\n\n\u003cp\u003e1- fetch list function is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(function () \n{\n $.ajax({\n url: 'fetch_user_list_from_user_table.php',\n data: \"{}\",\n dataType: 'text',\n success: function(data)\n { \n user_list=data;\n alert(\"list is: \" + user_list);\n },\n error: function()\n {\n $('#output').html(\"Error\");\n }\n });\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e2- autocomplete function \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(function ()\n{\n var availableTags;\n availableTags =user_list;\n alert(\"tags are\"+availableTags);\n $( \"#tags\" ).autocomplete(\n {\n source: availableTags\n });\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e3- html part\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;input id=\"tags\" type=\"text\" name=\"message_receiver_title\"\u0026gt; \u0026lt;/input\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"1","creation_date":"2016-06-10 06:03:52.89 UTC","last_activity_date":"2016-06-10 06:42:08.243 UTC","last_edit_date":"2016-06-10 06:06:23.87 UTC","last_editor_display_name":"","last_editor_user_id":"4119808","owner_display_name":"","owner_user_id":"6448515","post_type_id":"1","score":"0","tags":"jquery","view_count":"44"} +{"id":"21868171","title":"How to run cron job periodically within time range on linux?","body":"\u003cp\u003eI would like a cronjob that runs every 5min with the condition that it doesn't start at time 0.\u003c/p\u003e\n\n\u003cp\u003eCurrent schedule is:\n*/5 * * * *\u003c/p\u003e\n\n\u003cp\u003eHowever, this will kick off the script at 00:00. I need something like (5-60)/5 * * * *\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","answer_count":"1","comment_count":"4","creation_date":"2014-02-18 23:58:23.35 UTC","last_activity_date":"2014-02-19 00:29:29.05 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2799603","post_type_id":"1","score":"-1","tags":"linux|cron|crontab","view_count":"161"} +{"id":"44379560","title":"How to enable CORS in ASP.net Core WebAPI","body":"\u003cp\u003e\u003cstrong\u003eWhat I am trying to do\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI have a backend ASP.Net Core Web API hosted on an Azure Free Plan (\u003ca href=\"http://andrewgodfroyportfolioapi.azurewebsites.net/swagger/\" rel=\"noreferrer\"\u003ehttp://andrewgodfroyportfolioapi.azurewebsites.net/swagger/\u003c/a\u003e) (Source Code: \u003ca href=\"https://github.com/killerrin/Portfolio-Backend\" rel=\"noreferrer\"\u003ehttps://github.com/killerrin/Portfolio-Backend\u003c/a\u003e). \u003c/p\u003e\n\n\u003cp\u003eI also have a Client Website which I want to make consume that API. The Client Application will not be hosted on Azure, but rather will be hosted on Github Pages or on another Web Hosting Service that I have access to. Because of this the domain names won't line up. \u003c/p\u003e\n\n\u003cp\u003eLooking into this, I need to enable CORS on the Web API side, however I have tried just about everything for several hours now and it is refusing to work.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eHow I have the Client Setup\u003c/strong\u003e\nIts just a simple client written in React.js. I'm calling the APIs through AJAX in Jquery. The React site works so I know its not that. The Jquery API call works as I confirmed in Attempt 1. Here is how I make the calls\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e var apiUrl = \"http://andrewgodfroyportfolioapi.azurewebsites.net/api/Authentication\";\n //alert(username + \"|\" + password + \"|\" + apiUrl);\n $.ajax({\n url: apiUrl,\n type: \"POST\",\n data: {\n username: username,\n password: password\n },\n contentType: \"application/json; charset=utf-8\",\n dataType: \"json\",\n success: function (response) {\n var authenticatedUser = JSON.parse(response);\n //alert(\"Data Loaded: \" + authenticatedUser);\n if (onComplete != null) {\n onComplete(authenticatedUser);\n }\n },\n error: function (xhr, status, error) {\n //alert(xhr.responseText);\n if (onComplete != null) {\n onComplete(xhr.responseText);\n }\n }\n });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003chr\u003e\n\n\u003cp\u003e\u003cstrong\u003eWhat I have tried\u003c/strong\u003e\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003e\u003cstrong\u003eAttempt 1 - The 'proper' way\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://docs.microsoft.com/en-us/aspnet/core/security/cors\" rel=\"noreferrer\"\u003ehttps://docs.microsoft.com/en-us/aspnet/core/security/cors\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI have followed this tutorial on the Microsoft Website to a T, trying all 3 options of enabling it Globally in the Startup.cs, Setting it up on every controller and Trying it on every Action. \u003c/p\u003e\n\n\u003cp\u003eFollowing this method, the Cross Domain works, but only on a single Action on a single controller (POST to the AccountController). For everything else, the \u003ccode\u003eMicrosoft.AspNetCore.Cors\u003c/code\u003e middleware refuses to set the headers.\u003c/p\u003e\n\n\u003cp\u003eI installed \u003ccode\u003eMicrosoft.AspNetCore.Cors\u003c/code\u003e through NUGET and the version is \u003ccode\u003e1.1.2\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eHere is how I have it setup in Startup.cs\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e // This method gets called by the runtime. Use this method to add services to the container.\n public void ConfigureServices(IServiceCollection services)\n {\n // Add Cors\n services.AddCors(o =\u0026gt; o.AddPolicy(\"MyPolicy\", builder =\u0026gt;\n {\n builder.AllowAnyOrigin()\n .AllowAnyMethod()\n .AllowAnyHeader();\n }));\n\n // Add framework services.\n services.AddMvc();\n services.Configure\u0026lt;MvcOptions\u0026gt;(options =\u0026gt;\n {\n options.Filters.Add(new CorsAuthorizationFilterFactory(\"MyPolicy\"));\n });\n\n ...\n ...\n ...\n }\n\n // This method gets called by the runtime. Use this method to configure \n //the HTTP request pipeline.\n public void Configure(IApplicationBuilder app, IHostingEnvironment env,\n ILoggerFactory loggerFactory)\n {\n loggerFactory.AddConsole(Configuration.GetSection(\"Logging\"));\n loggerFactory.AddDebug();\n\n // Enable Cors\n app.UseCors(\"MyPolicy\");\n\n //app.UseMvcWithDefaultRoute();\n app.UseMvc();\n\n ...\n ...\n ...\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAs you can see, I am doing everything as told. I add Cors before MVC both times, and when that didn't work I attempted putting \u003ccode\u003e[EnableCors(\"MyPolicy\")]\u003c/code\u003e on every controller as so\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[Route(\"api/[controller]\")]\n[EnableCors(\"MyPolicy\")]\npublic class AdminController : Controller\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003chr\u003e\n\n\u003cp\u003e\u003cstrong\u003eAttempt 2 - Brute Forcing it\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://andrewlock.net/adding-default-security-headers-in-asp-net-core/\" rel=\"noreferrer\"\u003ehttps://andrewlock.net/adding-default-security-headers-in-asp-net-core/\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eAfter several hours of trying on the previous attempt, I figured I would try to bruteforce it by trying to set the headers manually, forcing them to run on every response. I did this following this tutorial on how to manually add headers to every response.\u003c/p\u003e\n\n\u003cp\u003eThese are the headers I added\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e.AddCustomHeader(\"Access-Control-Allow-Origin\", \"*\")\n.AddCustomHeader(\"Access-Control-Allow-Methods\", \"*\")\n.AddCustomHeader(\"Access-Control-Allow-Headers\", \"*\")\n.AddCustomHeader(\"Access-Control-Max-Age\", \"86400\")\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThese are other headers I tried which failed\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e.AddCustomHeader(\"Access-Control-Allow-Methods\", \"GET, POST, PUT, PATCH, DELETE\")\n.AddCustomHeader(\"Access-Control-Allow-Headers\", \"content-type, accept, X-PINGOTHER\")\n.AddCustomHeader(\"Access-Control-Allow-Headers\", \"X-PINGOTHER, Host, User-Agent, Accept, Accept: application/json, application/json, Accept-Language, Accept-Encoding, Access-Control-Request-Method, Access-Control-Request-Headers, Origin, Connection, Content-Type, Content-Type: application/json, Authorization, Connection, Origin, Referer\")\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWith this method, the Cross Site headers are being properly applied and they show up in my developer console and in Postman. The problem however is that while it passes the \u003ccode\u003eAccess-Control-Allow-Origin\u003c/code\u003e check, the webbrowser throws a hissy fit on (I believe) \u003ccode\u003eAccess-Control-Allow-Headers\u003c/code\u003e stating \u003ccode\u003e415 (Unsupported Media Type)\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eSo the brute force method doesn't work either\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003e\u003cstrong\u003eFinally\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eHas anyone gotten this to work and could lend a hand, or just be able to point me in the right direction?\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eSo to get the API calls to go through, I had to stop using JQuery and switch to a Pure Javascript \u003ccode\u003eXMLHttpRequest\u003c/code\u003e format.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eAttempt 1\u003c/strong\u003e \u003c/p\u003e\n\n\u003cp\u003eI managed to get the \u003ccode\u003eMicrosoft.AspNetCore.Cors\u003c/code\u003e to work by following MindingData's answer, except within the \u003ccode\u003eConfigure\u003c/code\u003e Method putting the \u003ccode\u003eapp.UseCors\u003c/code\u003e before \u003ccode\u003eapp.UseMvc\u003c/code\u003e. \u003c/p\u003e\n\n\u003cp\u003eIn addition, when mixed with the Javascript API Solution \u003ccode\u003eoptions.AllowAnyOrigin()\u003c/code\u003e for wildcard support began to work as well.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eAttempt 2\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eSo I have managed to get Attempt 2 (brute forcing it) to work... with the only exception that the Wildcard for \u003ccode\u003eAccess-Control-Allow-Origin\u003c/code\u003e doesn't work and as such I have to manually set the domains that have access to it. \u003c/p\u003e\n\n\u003cp\u003eIts obviously not ideal since I just want this WebAPI to be wide opened to everyone, but it atleast works for me on a separate site, which means it's a start\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eapp.UseSecurityHeadersMiddleware(new SecurityHeadersBuilder()\n .AddDefaultSecurePolicy()\n .AddCustomHeader(\"Access-Control-Allow-Origin\", \"http://localhost:3000\")\n .AddCustomHeader(\"Access-Control-Allow-Methods\", \"OPTIONS, GET, POST, PUT, PATCH, DELETE\")\n .AddCustomHeader(\"Access-Control-Allow-Headers\", \"X-PINGOTHER, Content-Type, Authorization\"));\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"44379971","answer_count":"6","comment_count":"1","creation_date":"2017-06-06 00:14:59.73 UTC","favorite_count":"9","last_activity_date":"2017-10-14 10:06:44.257 UTC","last_edit_date":"2017-06-08 01:36:29.377 UTC","last_editor_display_name":"","last_editor_user_id":"2419382","owner_display_name":"","owner_user_id":"2419382","post_type_id":"1","score":"14","tags":"c#|rest|asp.net-core|cors|cross-domain","view_count":"8313"} +{"id":"43995958","title":"Angular2 Global Variable service","body":"\u003cp\u003ei am trying to make a global variable to handle when to show the loader on my website. I followed \u003ca href=\"https://stackoverflow.com/questions/35985009/angular-2-what-is-equivalent-to-root-scope\"\u003ethis\u003c/a\u003e but i get the following errors.\u003c/p\u003e\n\n\u003cp\u003eGeneric Type 'Observer' requires 1 type argument(s) on this line\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ethis.ShowLoaderChange = new Observable((observer:Observer){\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ealso i can't seem to see where they declared the variable for the ChangeObserver as i am using here:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ethis.ShowLoaderChangeObserver = observer;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand here\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ethis.ShowLoaderChangeObserver.next(this.ShowLoader);\n\n\nimport { Observer } from 'rxjs/Observer';\nimport { Observable } from 'rxjs/Observable';\nimport { Injectable } from 'angular2/core';\nimport { Subject } from 'rxjs/Subject';\n\n@Injectable()\nexport class LoaderService {\n public ShowLoader;\n ShowLoaderChange: Observable\u0026lt;any\u0026gt;;\n\n constructor() {\n this.ShowLoaderChange = new Observable((observer:Observer){\n this.ShowLoaderChangeObserver = observer;\n })\n }\n\n setData() {\n this.ShowLoader = !this.ShowLoader;\n this.ShowLoaderChangeObserver.next(this.ShowLoader);\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT\u003c/strong\u003e:\nAfter changing my code as per the answer below and it making sense it get TypeError: Cannot read property 'next' of undefined in [null]\nthis comes from the line\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ethis.ShowLoaderChangeObserver.next(this.ShowLoader);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am calling the function like this\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport {LoaderService} from '../LoaderService'\nexport class AdminDashboardComponent implements OnInit{\nconstructor (private loader:LoaderService){}\n\nngOnInit():any{\n this.loader.setData();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e}\n}\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT: NEW SERVICE\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport { Observer } from 'rxjs/Observer';\nimport { Observable } from 'rxjs/Observable';\nimport { Injectable } from 'angular2/core';\nimport { Subject } from 'rxjs/Subject';\n\n@Injectable()\nexport class LoaderService {\n public ShowLoader: boolean;\n ShowLoaderChange: Observable\u0026lt;boolean\u0026gt;;\n ShowLoaderChangeObserver: Observer\u0026lt;boolean\u0026gt;;\n\n constructor() {\n this.ShowLoaderChange = new Observable((observer:Observer\u0026lt;boolean\u0026gt;) \n =\u0026gt; {\n this.ShowLoaderChangeObserver = observer;\n })\n }\n\n setData() {\n this.ShowLoader = !this.ShowLoader;\n this.ShowLoaderChangeObserver.next(this.ShowLoader);\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e}\u003c/p\u003e","accepted_answer_id":"43996751","answer_count":"1","comment_count":"0","creation_date":"2017-05-16 08:16:17.883 UTC","favorite_count":"1","last_activity_date":"2017-05-16 13:42:21.92 UTC","last_edit_date":"2017-05-23 11:47:16.49 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"3767573","post_type_id":"1","score":"0","tags":"angular|typescript|angular-services","view_count":"732"} +{"id":"40962914","title":"Code patterns for JavaScript libraries","body":"\u003cp\u003eAmong JavaScript libraries (jQuery, MathJax, marked Markdown rendering library, etc.), I often see various patterns:\u003c/p\u003e\n\n\u003ch2\u003ePattern #1\u003c/h2\u003e\n\n\u003cp\u003eindex.html\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e...\n\u0026lt;script src=\"mylibrary.js\"\u0026gt;\u0026lt;/script\u0026gt;\n\u0026lt;/body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003emylibrary.js\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar mylibrary = (function() {\n ...\n var myVar = ...\n ...\n})();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003chr\u003e\n\n\u003ch2\u003ePattern #2\u003c/h2\u003e\n\n\u003cp\u003eindex.html\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;html\u0026gt;\n\u0026lt;head\u0026gt;\n...\n\u0026lt;script src=\"mylibrary.js\"\u0026gt;\u0026lt;/script\u0026gt;\n\u0026lt;/head\u0026gt;\n\u0026lt;body\u0026gt;\n...\n\u0026lt;/body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSame mylibrary.js\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003ch2\u003ePattern #3\u003c/h2\u003e\n\n\u003cp\u003eindex.html\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;html\u0026gt;\n\u0026lt;head\u0026gt;\n...\n\u0026lt;script src=\"mylibrary.js\"\u0026gt;\u0026lt;/script\u0026gt;\n\u0026lt;/head\u0026gt;\n\u0026lt;body\u0026gt;\n...\n\u0026lt;script\u0026gt;\nmylibrary.run(); // explicitly needs to be run\n\u0026lt;/script\u0026gt;\n\u0026lt;/body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSame mylibrary.js\u003c/p\u003e\n\n\u003ch1\u003eQuestions:\u003c/h1\u003e\n\n\u003col\u003e\n\u003cli\u003e\u003cp\u003eWhat's the purpose of the \u003ccode\u003evar mylibrary = (function() { ... })();\u003c/code\u003e trick? \u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eIs there a difference between pattern #1 and #2? (I would say no)\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eIs there any reason to prefer #3 rather than #2?\u003cbr\u003e\nIt seems that both could be interesting. Example for \u003ca href=\"http://mathjax.org\" rel=\"nofollow noreferrer\"\u003eMathJax\u003c/a\u003e: pattern #2 makes sense (it would autoparse the DOM and render math formulas), it's what has been chosen by them (see \u003ca href=\"https://cdn.mathjax.org/mathjax/latest/test/sample-tex.html\" rel=\"nofollow noreferrer\"\u003ethis example\u003c/a\u003e). Pattern #3, requiring an action to \u003cem\u003eactually run the rendering\u003c/em\u003e would make sense as well.\u003c/p\u003e\u003c/li\u003e\n\u003c/ol\u003e","accepted_answer_id":"40962947","answer_count":"2","comment_count":"5","creation_date":"2016-12-04 19:50:48.67 UTC","favorite_count":"1","last_activity_date":"2016-12-04 20:34:48.693 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1422096","post_type_id":"1","score":"0","tags":"javascript|design-patterns","view_count":"28"} +{"id":"16527648","title":"how can I create a dynamic video file?","body":"\u003cp\u003eI want to create a video file with dynamic content.\u003c/p\u003e\n\n\u003cp\u003especifically,I want to:\n- read a number from an extrnal text file\n- show the number in the video\n- add voice announcing the number\u003c/p\u003e\n\n\u003cp\u003eI want this file to be updated once an hour,so the number will be different each time the file is created.\u003c/p\u003e\n\n\u003cp\u003eany programming language or video editor is ok.\nAny Idea?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-05-13 17:21:55.613 UTC","favorite_count":"1","last_activity_date":"2013-05-13 17:38:19.693 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2378686","post_type_id":"1","score":"2","tags":"java|video|dynamic|video-processing","view_count":"498"} +{"id":"27651532","title":"Insert number of days into database according to month","body":"\u003cp\u003eI've a table \u003ccode\u003etbl_month\u003c/code\u003e with col \u003ccode\u003emonth\u003c/code\u003e and \u003ccode\u003eyear\u003c/code\u003e containing values like\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emonth year\n 1 2015\n 2 2015\n 3 2015\n 4 2015\n 5 2015\n............\n 12 2015\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFrom above table, I'm fetching month and year and want to insert the number of days into table \u003ccode\u003etbl_days\u003c/code\u003e according to month, so far I be able to insert 30 days with following code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efor($count=1;$count\u0026lt;31;$count++) {\n $query=\"INSERT INTO tbl_days (day_no, brand_id) VALUES ('\".$count.\"','\".$_POST['brand_id_'.$count].\"')\";\n mysql_query($query);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow can I insert number of days according to month into table \u003ccode\u003etbl_days\u003c/code\u003e e.g for month 12 (December), 31 days and if month 1 (January) again 31 days but for month 2 (Feb) 28 days and if leap year (Feb) 29 days?\u003c/p\u003e","accepted_answer_id":"27651746","answer_count":"1","comment_count":"3","creation_date":"2014-12-25 23:26:17.503 UTC","last_activity_date":"2015-09-21 10:12:20.69 UTC","last_edit_date":"2015-09-21 10:12:20.69 UTC","last_editor_display_name":"","last_editor_user_id":"4258081","owner_display_name":"","owner_user_id":"4258081","post_type_id":"1","score":"-1","tags":"php|mysql|counter","view_count":"125"} +{"id":"35812319","title":"How to do git add . with fugitive?","body":"\u003cp\u003eHow do you do \u003ccode\u003egit add .\u003c/code\u003e in Fugitive for vim?\u003c/p\u003e\n\n\u003cp\u003eTHe command \u003ccode\u003e:Git add .\u003c/code\u003e is not doing adding anything\u003c/p\u003e","accepted_answer_id":"35812609","answer_count":"2","comment_count":"3","creation_date":"2016-03-05 09:17:17.81 UTC","last_activity_date":"2016-03-06 01:56:28.037 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1196150","post_type_id":"1","score":"2","tags":"vim|vim-fugitive","view_count":"928"} +{"id":"16679418","title":"PHP Redirect Not Working When Using Form Action to Submit to PHP Page","body":"\u003cp\u003eSo I am using this form to submit to PHP file. PHP file has a redirect header that WORKS when I call the php file directly in browser, but when it is accessed via the action attribute in the form, it does nothing. There was a time I could make it redirect without the refresh: 2, but then the issue arose that it was only including the redirected file within the php document itself, so my javascript and submit functions would fail... Weird? Please advise! What's going on?\u003c/p\u003e\n\n\u003cp\u003eHTML\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;form name=\"ats_routing\" id=\"ats_routing\" method=\"post\" action=\"php/upload.php\" enctype=\"multipart/form-data\"\u0026gt;\n\n \u0026lt;!-- Some html generated by codiqa --\u0026gt;\n\n \u0026lt;a onclick=\"submitForm();\" data-transition=\"flip\" data-theme=\"\" data-icon=\"check\"\u0026gt;\n Submit\n \u0026lt;/a\u0026gt;\n\u0026lt;/form\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eJavascript part\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e/****CREATE JQUERY SUBMIT FUNCTION FOR IFRAME VALIDATION CHECK FOR Codiqa****/\nfunction submitForm() {\n if ($(\"#ats_routing\").valid()) {\n //alert(\"Thank You. Your Routing Form Has Been Submitted.\");\n $('#ats_routing').submit();\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ePHP that form redirects to (upload.php)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\nheader(\"Refresh: 2; URL=/ats-routing/\"); /* Redirect browser */\n\n//Parse and store the db ini file, this will return an associative array\ndb_config_ats_ibutton();\ndb_connect();\n\n$total_weight = $_POST['total_weight'];\n$uf = $_POST['number_uf'];\n\n\n$query=\"INSERT INTO datbasae (\n lbs_uf,\n total_weight,\n district)\n\n VALUES(\n '$uf',\n '$total_weight',\n '$district')\";\n\nquery_db($query);\n?\u0026gt;\n\u0026lt;!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n\"http://www.w3.org/TR/html4/loose.dtd\"\u0026gt;\n\u0026lt;html lang=\"en\"\u0026gt;\n\u0026lt;head\u0026gt;\n \u0026lt;title\u0026gt;ATS Routing\u0026lt;/title\u0026gt;\n \u0026lt;link rel=\"stylesheet\" href=\"https://d10ajoocuyu32n.cloudfront.net/mobile/1.3.1/jquery.mobile-1.3.1.min.css\"\u0026gt;\n\u0026lt;link rel=\"stylesheet\" href=\"http://dev.rs.idmyasset.com/ats-routing/css/theme.css\"\u0026gt;\n\u0026lt;!-- Extra Codiqa features --\u0026gt;\n\u0026lt;link rel=\"stylesheet\" href=\"https://codiqa.com/view/bb40208d/css\"\u0026gt;\n\u0026lt;!-- jQuery and jQuery Mobile --\u0026gt;\n\u0026lt;script src=\"https://d10ajoocuyu32n.cloudfront.net/jquery-1.9.1.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\n\u0026lt;script src=\"https://d10ajoocuyu32n.cloudfront.net/mobile/1.3.1/jquery.mobile-1.3.1.min.js\"\u0026gt; \u0026lt;/script\u0026gt;\n\u0026lt;meta http-equiv=\"refresh\" content=\"2; url=http://dev.rs.idmyasset.com/ats-routing/\"\u0026gt;\n\u0026lt;/head\u0026gt;\n\n\u0026lt;body\u0026gt;\n\u0026lt;!-- Home --\u0026gt;\n\u0026lt;div data-role=\"page\" id=\"page1\"\u0026gt;\n \u0026lt;div id=\"header\" data-theme=\"\" data-role=\"header\"\u0026gt;\n \u0026lt;h3 id=\"header\"\u0026gt;\n ATS Routing Data\n \u0026lt;/h3\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div data-role=\"content\"\u0026gt;\n \u0026lt;h1 align=\"center\"\u0026gt;Thank You\u0026lt;/h1\u0026gt;\n \u0026lt;h1 align=\"center\"\u0026gt;Your Form Has Been Submitted!\u0026lt;/h1\u0026gt;\n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u0026lt;/body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"16680027","answer_count":"2","comment_count":"3","creation_date":"2013-05-21 21:00:52.01 UTC","favorite_count":"1","last_activity_date":"2014-07-12 05:21:51.15 UTC","last_edit_date":"2013-05-21 21:24:50.647 UTC","last_editor_display_name":"","last_editor_user_id":"2263684","owner_display_name":"","owner_user_id":"2036030","post_type_id":"1","score":"-1","tags":"php|forms","view_count":"2475"} +{"id":"10969889","title":"Can boost::atomic really improve performance by reducing overhead of sys calls (in mutex/semaphore) in multithreading?","body":"\u003cp\u003eI am trying to compare the performance of boost::atomic and pthread mutex on Linux:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER ;\n int g = 0 ;\n\n void f()\n {\n\n pthread_mutex_lock(\u0026amp;mutex);\n ++g;\n pthread_mutex_unlock(\u0026amp;mutex);\n return ;\n }\n const int threadnum = 100;\n int main() \n {\n boost::threadpool::fifo_pool tp(threadnum);\n for (int j = 0 ; j \u0026lt; 100 ; ++j)\n {\n for (int i = 0 ; i \u0026lt; threadnum ; ++i)\n tp.schedule(boost::bind(f));\n tp.wait();\n }\n std::cout \u0026lt;\u0026lt; g \u0026lt;\u0026lt; std::endl ;\n return 0 ; \n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eits time:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e real 0m0.308s\n user 0m0.176s\n sys 0m0.324s\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI also tried boost::atomic: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e boost::atomic\u0026lt;int\u0026gt; g(0) ;\n\n void f()\n {\n\n ++g;\n return ;\n }\n const int threadnum = 100;\n int main()\n {\n boost::threadpool::fifo_pool tp(threadnum);\n for (int j = 0 ; j \u0026lt; 100 ; ++j)\n {\n for (int i = 0 ; i \u0026lt; threadnum ; ++i)\n tp.schedule(boost::bind(f));\n tp.wait() ;\n }\n std::cout \u0026lt;\u0026lt; g \u0026lt;\u0026lt; std::endl ;\n return 0 ;\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eits time: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e real 0m0.344s\n user 0m0.250s\n sys 0m0.344s\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI run them many times but the timing results are similar. \u003c/p\u003e\n\n\u003cp\u003eCan atomic really help avoid overhead of sys calls caused by mutex/semaphore ? \u003c/p\u003e\n\n\u003cp\u003eAny help will be appreciated. \u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eUPDATE : increase the loop number to 1000000 for\u003c/strong\u003e \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e for (int i = 0 ; i \u0026lt; 1000000 ; ++i)\n {\n pthread_mutex_lock(\u0026amp;mutex);\n ++g;\n pthread_mutex_unlock(\u0026amp;mutex);\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003esimilar to boost::atomic .\u003c/p\u003e\n\n\u003cp\u003etest the time by \"time ./app\"\u003c/p\u003e\n\n\u003cp\u003euse boost:atomic: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ereal 0m13.577s\nuser 1m47.606s\nsys 0m0.041s\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003euse pthread mutex:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ereal 0m17.478s\nuser 0m8.623s\nsys 2m10.632s\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eit seems that boost:atomic is faster because pthread use more time for sys calls.\u003c/p\u003e\n\n\u003cp\u003eWhy user time + sys is larger than real time ? \u003c/p\u003e\n\n\u003cp\u003eAny comments are welcome !\u003c/p\u003e","accepted_answer_id":"10969952","answer_count":"1","comment_count":"6","creation_date":"2012-06-10 15:18:34.04 UTC","favorite_count":"1","last_activity_date":"2012-06-10 22:31:20.723 UTC","last_edit_date":"2012-06-10 22:31:20.723 UTC","last_editor_display_name":"","last_editor_user_id":"283302","owner_display_name":"","owner_user_id":"1000107","post_type_id":"1","score":"3","tags":"c++|multithreading|boost|pthreads|atomic","view_count":"1788"} +{"id":"28026332","title":"boost python boost:shared_ptr to boost::any convertible","body":"\u003cp\u003eI am new to the boost python framework. After following some example code in the internet, I am reaching the following situation: I use a static member function to create a shared_ptr of the object of class C and use another static function to visit the shared_ptr to the object of class C, that works fine. However, in some situation, I need boost::any as argument for the visit function e.g. visitAny in the code, then I will check if the boost::any is the required type. I am now missing the conversion function to convert the boost::shared_ptr to boost::any before I am calling the visitAny function, could anyone kindly point out where and how should I implement the conversion function.\u003c/p\u003e\n\n\u003cp\u003eThank you in advance.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass C {\npublic:\n C() : member_(0) {};\n static boost::shared_ptr\u0026lt;C\u0026gt; create();\n static int visit(boost::shared_ptr\u0026lt;C\u0026gt;\u0026amp; c);\n static int C::visitAny(boost::shared_ptr\u0026lt;boost::any\u0026gt;\u0026amp; c);\n int member_;\n};\n\nboost::shared_ptr\u0026lt;C\u0026gt; C::create() {\n return boost::shared_ptr\u0026lt;C\u0026gt;(new C());\n}\n\nint C::visit(boost::shared_ptr\u0026lt;C\u0026gt;\u0026amp; c) {\n return c-\u0026gt;member_;\n}\n\nint C::visitAny(boost::shared_ptr\u0026lt;boost::any\u0026gt;\u0026amp; c) {\n if (c-\u0026gt;type() == typeid(boost::shared_ptr\u0026lt;C\u0026gt;))\n return boost::any_cast\u0026lt;boost::shared_ptr\u0026lt;C\u0026gt;\u0026gt;(c)-\u0026gt;member_;\n else\n return 100;\n}\n\n\nBOOST_PYTHON_MODULE(boostPythonTest)\n{\n\n class_\u0026lt;C, boost::shared_ptr\u0026lt;C\u0026gt;, boost::noncopyable\u0026gt;(\"C\", boost::python::no_init)\n .def(\"create\", \u0026amp;C::create)\n .staticmethod(\"create\")\n .def(\"visit\", \u0026amp;C::visit)\n .staticmethod(\"visit\")\n .def(\"visitAny\", \u0026amp;C::visitAny)\n .staticmethod(\"visitAny\");\n\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"2","creation_date":"2015-01-19 14:00:00.583 UTC","last_activity_date":"2015-01-19 14:05:53.21 UTC","last_edit_date":"2015-01-19 14:05:53.21 UTC","last_editor_display_name":"","last_editor_user_id":"4196961","owner_display_name":"","owner_user_id":"4196961","post_type_id":"1","score":"0","tags":"python|c++|boost|type-conversion","view_count":"247"} +{"id":"36942555","title":"Does the electron framework allow multi-threading through web workers?","body":"\u003cp\u003eI am having a hard time googling how I would do multi-threading if I made an electron app. Would it be with web workers?\u003c/p\u003e","answer_count":"4","comment_count":"2","creation_date":"2016-04-29 15:44:36.627 UTC","favorite_count":"1","last_activity_date":"2017-10-18 17:44:11.963 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1202394","post_type_id":"1","score":"3","tags":"javascript|electron","view_count":"7269"} +{"id":"41630933","title":"How to overcome \"Could not load type 'Microsoft.Cct.Services.Sqm.IWatSqmService'\" without updating?","body":"\u003cp\u003eI'm getting the same error message as in this question: \u003ca href=\"https://stackoverflow.com/q/40861057/50151\"\u003eCould not load type 'Microsoft.Cct.Services.Sqm.IWatSqmService'\u003c/a\u003e Unfortunately, I cannot upgrade to Azure SDK 2.9, as the top answer there suggests.\u003c/p\u003e\n\n\u003cp\u003eSpecifically, I get this error in a message box whenever I try to package my Azure Cloud Service project:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/pIOWo.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/pIOWo.png\" alt=\"Error message saying Could not load type \u0026#39;Microsoft.Cct.Services.Sqm.IWatSqmService\u0026#39; from assembly \u0026#39;Microsoft.VisualStudio.WindowsAzure.Services, Version=1.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\u0026#39;.\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eWhat's interesting is that I can start the same project in the emulator, which I would assume involves packaging it.\u003c/p\u003e\n\n\u003cp\u003eThings I've tried:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eEnsuring that I only have version 2.8.2 of the emulator installed (I may have had 2.9 installed initially)\u003c/li\u003e\n\u003cli\u003eReinstalling version 2.8.2 of the SDK\u003c/li\u003e\n\u003cli\u003eManually copying the \u003ccode\u003eWindows Azure Tools\u003c/code\u003e from \u003ccode\u003eC:\\Program Files (x86)\\MSBuild\\Microsoft\\VisualStudio\\v10.0\u003c/code\u003e to the \u003ccode\u003ev14.0\u003c/code\u003e equivalent.\u003c/li\u003e\n\u003cli\u003eEnsuring that \u003ccode\u003eC:\\Program Files\\Microsoft SDKs\\Azure\\.NET SDK\\v2.8\u003c/code\u003e exists\u003c/li\u003e\n\u003cli\u003eReinstalling Visual Studio (so you know I'm desperate!)\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eAnd I've no idea what to try next. I can't work out which DLL is supposed to hold the \u003ccode\u003eMicrosoft.VisualStudio.WindowsAzure.Services\u003c/code\u003e assembly, I can't find any references in any config files, and all the Google hits seem to point back to the SO question linked above.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eWhat's going on? And how can I fix it?\u003c/strong\u003e\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003eIn case I'm being an idiot, here's all the Azure-related things I've got installed:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/4fDAr.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/4fDAr.png\" alt=\"Screenshot of installed Azure programs\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eAlso (just in case it's relevant) I'm on Windows 7 SP1.\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003e\u003cstrong\u003eUpdate 17/01/16\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eFollowing some advice from the excellent \u003ca href=\"http://azured.io/\" rel=\"nofollow noreferrer\"\u003eRest Azured Slack channel\u003c/a\u003e, I've tried using ProcMon and Fusion Log to diagnose this (\u003cem\u003espoiler: without success\u003c/em\u003e)\u003c/p\u003e\n\n\u003cp\u003eProcMon filtered to that assembly returns nothing:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/hT4iy.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/hT4iy.png\" alt=\"Screenshot of ProcMon showing no results\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eFusion log (set to log everything) yields lots of entries like this:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e\u003cstrong\u003e* Assembly Binder Log Entry (17/01/2017 @ 11:52:02) *\u003c/strong\u003e\u003c/p\u003e\n \n \u003cp\u003eThe operation was successful. Bind result: hr = 0x0. The operation\n completed successfully.\u003c/p\u003e\n \n \u003cp\u003eAssembly manager loaded from: \n C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\clr.dll Running under\n executable C:\\Program Files (x86)\\Microsoft Visual Studio\n 14.0\\Common7\\IDE\\devenv.exe\n --- A detailed error log follows. \u003c/p\u003e\n \n \u003cp\u003e=== Pre-bind state information === LOG: DisplayName = Microsoft.VisualStudio.WindowsAzure.Services, Version=1.1.0.0,\n Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a (Fully-specified)\n LOG: Appbase = file:///C:/Program Files (x86)/Microsoft Visual Studio\n 14.0/Common7/IDE/ LOG: Initial PrivatePath = NULL LOG: Dynamic Base = NULL LOG: Cache Base = NULL LOG: AppName = devenv.exe Calling assembly\n : Microsoft.VisualStudio.WindowsAzure, Version=2.9.0.0,\n Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.\n === WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with\n Assembly.Load(). WRN: No matching native image found. LOG: IL assembly\n loaded from C:\\Program Files (x86)\\Microsoft Visual Studio\n 14.0\\Common7\\IDE\\Extensions\\Microsoft\\Windows Azure Tools\\Microsoft.VisualStudio.WindowsAzure.Services.dll.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eWhen I explore the DLL mentioned, I can find \u003ccode\u003eMicrosoft.Cct.Services.Sqm\u003c/code\u003e, but it doesn't contain a type \u003ccode\u003eIWatSqlService\u003c/code\u003e:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/YfnPK.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/YfnPK.png\" alt=\"Screenshot of assembly explorer showing lack of IWatSqlService\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThis feels like it's the crux of the issue, but I've no idea what to do next. Presumably I'd need to replace the DLL with a version that does define \u003ccode\u003eIWatSqlService\u003c/code\u003e, but I'm not sure where I'd get one. Or, for that matter, why it would even be necessary.\u003c/p\u003e\n\n\u003cp\u003eNext stop is probably a full wipe of the machine.\u003c/p\u003e","accepted_answer_id":"42390949","answer_count":"3","comment_count":"5","creation_date":"2017-01-13 09:08:53.82 UTC","last_activity_date":"2017-08-03 00:58:25.043 UTC","last_edit_date":"2017-05-23 12:24:56.457 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"50151","post_type_id":"1","score":"0","tags":"visual-studio|visual-studio-2015|azure-sdk-.net","view_count":"1061"} +{"id":"21044015","title":"Django 1.6 - Messages not showing","body":"\u003cp\u003eIm trying to get the message framework in django to work.\u003c/p\u003e\n\n\u003cp\u003eHere is the interesting bits of my settings.py\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eINSTALLED_APPS = (\n 'django.contrib.sessions',\n 'django.contrib.messages',\n)\n\nMIDDLEWARE_CLASSES = (\n 'django.contrib.sessions.middleware.SessionMiddleware',\n 'django.middleware.common.CommonMiddleware',\n 'django.middleware.csrf.CsrfViewMiddleware',\n 'django.contrib.auth.middleware.AuthenticationMiddleware',\n 'django.contrib.messages.middleware.MessageMiddleware',\n 'django.middleware.clickjacking.XFrameOptionsMiddleware',\n 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',\n)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have not added anything to \u003ccode\u003eTEMPLATE_CONTEXT_PROCESSORS\u003c/code\u003e, so it is the default value.\u003c/p\u003e\n\n\u003cp\u003eMy view, where I want the message to display:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efrom django.contrib.messages import get_messages\n\nclass ProfileFrontpage(TemplateView):\n\n def get(self, request, *args, **kwargs):\n if request.user.is_authenticated():\n\n #Get messages\n messages = get_messages(request)\n\n #Get the user \n user = self.request.user\n\n #Used benefit\n used_benefit_list = Benefit.published.filter(used_benefit__user = user)\n\n return render(request, \"accounts/frontpage.html\", {\"messages\": messages, \"used_benefit_list\": used_benefit_list})\n else:\n return render(request, 'accounts/not_authenticated.html')\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eTemplate:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{% if messages %}\n {% for message in messages %}\n \u0026lt;div class=\"alert {{ message.tags }}\"\u0026gt;\n \u0026lt;button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\"\u0026gt;\u0026amp;times;\u0026lt;/button\u0026gt;\n {{ message }}\n \u0026lt;/div\u0026gt;\n {% endfor %} \n{% endif %}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd here is my form that should create a message when the form is valid:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef show_profileform(request): \n if request.user.is_authenticated():\n user = request.user\n\n ProfileFormInlineFormSet = inlineformset_factory(User, Profile, form=ProfileForm, can_delete=False)\n\n if request.method == \"POST\":\n form = UserForm(request.POST, request.FILES, instance=request.user, prefix=\"main\")\n formset = ProfileFormInlineFormSet(request.POST, request.FILES, instance=request.user, prefix=\"nested\") \n if 'submit' in request.POST:\n if form.is_valid() and formset.is_valid():\n\n u = User.objects.get(username = request.user) \n\n #Save to database\n user = form.save()\n profile = formset.save()\n\n messages.success(request, \"Settings updated\", extra_tags='alert-success')\n\n return HttpResponseRedirect('/accounts/')\n\n else:\n form = UserForm(instance=request.user, prefix=\"main\")\n formset = ProfileFormInlineFormSet(instance=request.user, prefix=\"nested\")\n\n return render(request, \"accounts/form.html\", {\"form\":form, \"formset\":formset})\n else:\n return render(request, 'accounts/not_authenticated.html')\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnyone know why the message is not visible?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-01-10 12:08:45.67 UTC","last_activity_date":"2014-01-10 12:42:44.24 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"674613","post_type_id":"1","score":"1","tags":"python|django|django-messages","view_count":"490"} +{"id":"10027503","title":"C++ Constructor Understanding","body":"\u003cp\u003eConsider this constructor: \u003ccode\u003ePacket() : bits_(0), datalen_(0), next_(0) {}\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eNote that \u003ccode\u003ebits_\u003c/code\u003e, \u003ccode\u003edatalen_\u003c/code\u003e and \u003ccode\u003enext_\u003c/code\u003e are fields in the class Packet defined as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eu_char* bits_;\nu_int datalen_;\nPacket* next_;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat does this part of the constructor mean? \u003ccode\u003ebits_(0), datalen_(0), next_(0)\u003c/code\u003e\u003c/p\u003e","accepted_answer_id":"10027521","answer_count":"3","comment_count":"0","creation_date":"2012-04-05 11:13:27.45 UTC","favorite_count":"1","last_activity_date":"2012-04-05 11:27:27.997 UTC","last_edit_date":"2012-04-05 11:22:46.357 UTC","last_editor_display_name":"","last_editor_user_id":"97554","owner_display_name":"","owner_user_id":"914229","post_type_id":"1","score":"4","tags":"c++|constructor|initialization|initialization-list","view_count":"137"} +{"id":"20143972","title":"how to access c# code values into javascript?","body":"\u003cp\u003eI have code like following\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e function AddValidation() {\n var distance=@Utilities.getConfiguration(Configuration.DistanceUOM);\n\n $(\"#km\").rules('add', { chekrule: [\"#PerKm\", \"Cost Per \" +distance +\"should be positive.\"] });\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm getting error for \u003ccode\u003edistance\u003c/code\u003e as undefined.\u003c/p\u003e\n\n\u003cp\u003eunable to get the proper value of \u003ccode\u003e@Utilities.getConfiguration(Configuration.DistanceUOM);\u003c/code\u003e in java script function \u003c/p\u003e\n\n\u003cp\u003eplease correct me in syntax.\u003c/p\u003e","accepted_answer_id":"20144091","answer_count":"1","comment_count":"1","creation_date":"2013-11-22 11:36:05.253 UTC","favorite_count":"1","last_activity_date":"2013-11-22 11:42:06.617 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"428073","post_type_id":"1","score":"2","tags":"c#|javascript|jquery","view_count":"51"} +{"id":"25362553","title":"can't verify pdf signatures. itext, pdf, GOST3410","body":"\u003cp\u003eI'am trying to verify signatures in pdf file. There are three of them. I have signed that file with the code i've found in internet and adopted to my needs, so it might be encorrect too. Here is that signed file \u003ca href=\"https://drive.google.com/file/d/0BzvxMECF2kZrYUVCam44NHA1cms/edit?usp=sharing\" rel=\"nofollow\"\u003epdf file\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eVerifier code here:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epackage com.mycompany.verifysignature;\n\nimport java.io.ByteArrayOutputStream;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.util.ArrayList;\nimport java.util.HashMap;\nimport java.util.Map;\nimport org.bouncycastle.crypto.digests.GOST3411Digest;\nimport ru.CryptoPro.CAdES.CAdESSignature;\nimport ru.CryptoPro.CAdES.CAdESType;\n\npublic class Main {\n\npublic static void main(String args[]) {\n\n try {\n ArrayList\u0026lt;Map\u0026lt;String, String\u0026gt;\u0026gt; resList = new ArrayList\u0026lt;Map\u0026lt;String, String\u0026gt;\u0026gt;();\n\n InputStream pdfIs = new FileInputStream(\"/home/user1/Desktop/321-17.pdf\");\n\n com.itextpdf.text.pdf.PdfReader reader = new com.itextpdf.text.pdf.PdfReader(pdfIs);\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n com.itextpdf.text.pdf.PdfStamper stamper = com.itextpdf.text.pdf.PdfStamper.createSignature(reader, baos, '\\0');\n com.itextpdf.text.pdf.PdfSignatureAppearance sap = stamper.getSignatureAppearance();\n\n com.itextpdf.text.pdf.AcroFields fields = reader.getAcroFields();\n for (String signame : fields.getSignatureNames()) {\n HashMap\u0026lt;String, String\u0026gt; m = new HashMap();\n m.put(\"name\", signame.toString());\n System.out.println(\"name:\"+signame);\n com.itextpdf.text.pdf.PdfDictionary sig = fields.getSignatureDictionary(signame);\n if (sig != null \u0026amp;\u0026amp; sig.getAsString(com.itextpdf.text.pdf.PdfName.REASON) != null) {\n m.put(\"reason\", sig.getAsString(com.itextpdf.text.pdf.PdfName.REASON).toString()\n .replaceAll(\"\\\"\", \"\\\\\\\"\"));\n System.out.println(\"reason:\"+sig.getAsString(com.itextpdf.text.pdf.PdfName.REASON).toString()\n .replaceAll(\"\\\"\", \"\\\\\\\"\"));\n } else {\n m.put(\"reason\", \"undefined\");\n System.out.println(\"reason:undefined\");\n }\n\n\n byte signature[] = null;\n\n if (sig != null \u0026amp;\u0026amp; sig.getBytes() != null) {\n signature = sig.getBytes();\n }\n\n byte hash[] = calcHash(sap.getRangeStream());\n\n if (hash != null) {\n\n CAdESSignature cadesSignature = new CAdESSignature(signature, hash, CAdESType.CAdES_X_Long_Type_1);\n\n try {\n cadesSignature.verify(null);\n m.put(\"valid\", \"true\");\n System.out.println(\"valid:true\");\n } catch(Exception ex) {\n m.put(\"valid\", \"false\");\n System.out.println(\"valid:false\");\n }\n } else {\n m.put(\"valid\", \"\\\"undefined\\\"\");\n System.out.println(\"valid:undefined\");\n }\n\n\n// com.itextpdf.text.pdf.security.PdfPKCS7 pk = fields.verifySignature(signame);\n// \n// m.put(\"valid\", new Boolean(pk.verify()).toString());\n// System.out.println(\"valid:\"+new Boolean(pk.verify()).toString());\n\n resList.add(m);\n }\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n\n}\n\n\n\npublic static byte[] calcHash(InputStream is) {\n if (is == null) return null;\n try {\n GOST3411Digest digest = new GOST3411Digest();\n\n byte node[] = readBytesFromStream(is);\n digest.update(node, 0, node.length);\n\n byte[] resBuf = new byte[digest.getDigestSize()];\n digest.doFinal(resBuf, 0);\n\n return resBuf;\n } catch (Throwable e) {\n e.printStackTrace();\n //throw new Exception(e);\n }\n return null;\n} \n\nprivate static byte[] readBytesFromStream(InputStream is) throws Exception {\n ArrayList\u0026lt;Object[]\u0026gt; c = new ArrayList();\n int n, size = 0;\n byte b[] = null;\n if (is == null) throw new Exception(\"input stream is null\");\n try {\n while ((n = is.read(b = new byte[1024])) \u0026gt; 0) {\n c.add(new Object[] { n, b });\n size += n;\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n byte rv[] = new byte[size];\n int pos = 0;\n for (Object[] bb : c) {\n for (int i = 0; i \u0026lt; (Integer) bb[0]; i++) {\n rv[pos++] = ((byte[]) bb[1])[i];\n }\n }\n return rv;\n}\n\n\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have signed file's digest, made with GOST3411, with test certificate, that is generated on cryptopro site. \u003c/p\u003e\n\n\u003cp\u003eWhen I open this file with pdf reader, it says there are 3 signatures. I have realy signed it three times. But the code above takes out from the pdf signature names that are not equal to the names I wrote. They are look like Signature1, Signature2 etc. There should be written \"CN\" in all three cases. Please help. What I have made wrong?\u003c/p\u003e","answer_count":"1","comment_count":"5","creation_date":"2014-08-18 11:45:31.647 UTC","favorite_count":"0","last_activity_date":"2016-05-19 09:12:53.373 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2426923","post_type_id":"1","score":"0","tags":"java|pdf|itext|gost3410","view_count":"496"} +{"id":"16524291","title":"access Web API from windows web service","body":"\u003cp\u003eI am developing a Windows service to run maintenance tasks on our customer's servers which returns results to a web service running in our headquarters.\u003c/p\u003e\n\n\u003cp\u003eI ran into the Web API as a new and simple alternative to build intuitive web services over HTTP.\nSo the question is whether or not it's possible to host a Web API web service in IIS 7 at our HQ which is accessed from several remote windows services to return result sets?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-05-13 14:17:12.947 UTC","last_activity_date":"2013-05-15 13:00:51.65 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1749272","post_type_id":"1","score":"0","tags":"windows-services|asp.net-web-api","view_count":"152"} +{"id":"3799469","title":"Why do I get 401 UNAUTHORIZED when I'm entering to WSS 3.0 site?","body":"\u003cp\u003eWhen I'm opening for the first time my webpage on WSS 3.0 I always get 401 UNAUTHORIZED.\nI was trying a lot of resolutions from Google results. I disabled loop back check. Added administrator rights for sharepoint account. I have to add that I'm using anonymous access to default site.\nCan anybody help me to resolve this issue? Please.\u003c/p\u003e\n\n\u003cp\u003eI was tried resolutions from here:\n\u003ca href=\"http://mossformsfeature.codeplex.com/Thread/View.aspx?ThreadId=9702\" rel=\"nofollow\"\u003ecodeplex\u003c/a\u003e\nIt didn't help as well. :(\u003c/p\u003e","accepted_answer_id":"3816893","answer_count":"4","comment_count":"5","creation_date":"2010-09-26 19:37:25.987 UTC","last_activity_date":"2010-10-03 12:20:57.32 UTC","last_edit_date":"2010-09-28 20:37:53.063 UTC","last_editor_display_name":"","last_editor_user_id":"262693","owner_display_name":"","owner_user_id":"262693","post_type_id":"1","score":"3","tags":"sharepoint|sharepoint-2007|wss|wss-3.0","view_count":"4206"} +{"id":"26973161","title":"Tags not firing in HTML 'li' element with 'id' attribute?","body":"\u003cp\u003eI have written an Event Based rule in DTM. Below is the code where I am applying rule:\u003c/p\u003e\n\n\u003cp\u003e` \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;li class=\"\" id=\"204\"\u0026gt;Element 1\u0026lt;/li\u0026gt;\n\n\u0026lt;li class=\"\" id=\"227\"\u0026gt;Element 2\u0026lt;/li\u0026gt;\n\n\u0026lt;li class=\"\" id=\"135\"\u0026gt;Element 3\u0026lt;/li\u0026gt;\n\n\u0026lt;li class=\"\" id=\"235\"\u0026gt;Element 4\u0026lt;/li\u0026gt;\n\n\u0026lt;li class=\"active\" id=\"201\"\u0026gt;Element 5\u0026lt;/li\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e `\u003c/p\u003e\n\n\u003cp\u003eSo, in the Event rule section, I have selected the Event type as 'click', Element Tag as 'LI', and then manually assigned properties \u0026amp; attributes as :\nid = 201 (for \"Element 5\", in this case).\u003c/p\u003e\n\n\u003cp\u003eBut the tag on the page is not firing, when I am clicking on 'Element 5' section. Not really sure, why.\u003c/p\u003e\n\n\u003cp\u003eThis is basic most thing in DTM, but this is unexpectedly not working in my case.\u003c/p\u003e\n\n\u003cp\u003eCan someone please help.\u003c/p\u003e\n\n\u003cp\u003eThanks,\u003c/p\u003e\n\n\u003cp\u003eAdi\u003c/p\u003e","answer_count":"0","comment_count":"11","creation_date":"2014-11-17 12:52:42.147 UTC","last_activity_date":"2014-11-17 12:52:42.147 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4086798","post_type_id":"1","score":"0","tags":"adobe|adobe-analytics","view_count":"129"} +{"id":"7858240","title":"How can i save my listbox to ObservableCollection\u003c\u003e","body":"\u003cp\u003eMyDoc.cs\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class MyDoc\n{\n\n public string Private {set;get;}\n public string Public {set;get;}\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMyFind.cs\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class MyFind\n{\n public string Find {set;get;}\n public string News {set;get;}\n\n private ObservableCollection\u0026lt;MyDoc\u0026gt; _list;\n public ObservableCollection\u0026lt;MyDoc\u0026gt; List\n {\n get\n {\n if (_list == null)\n {\n _list = new ObservableCollection\u0026lt;MyDoc\u0026gt;();\n }\n return _list;\n }\n set\n {\n if (_list != value)\n {\n _list = value;\n }\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn Page1.xaml.cs\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eMyFind myfind = new MyFind();\nmyfind.Find = Findtextbox.Text;//string = string\nmyfind.News = Newstextbox.Text;//string = string\nmyfind.List = ??? \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eObservableCollection = listbox1.??? (??? = Items,or ItemsSources,or something,...May I use Convert ?)\u0026lt;------------ I don't have any ideas ! Help me !\u003c/p\u003e","answer_count":"3","comment_count":"0","creation_date":"2011-10-22 08:13:08.45 UTC","last_activity_date":"2011-10-22 10:01:38.007 UTC","last_edit_date":"2011-10-22 10:01:38.007 UTC","last_editor_display_name":"","last_editor_user_id":"6448","owner_display_name":"","owner_user_id":"1008301","post_type_id":"1","score":"0","tags":"c#|observable","view_count":"210"} +{"id":"11187198","title":"Fade in and out to happen simultaneously on page","body":"\u003cp\u003eI have a jquery animate function that fades two div's in and out on mouse hover / exit.\u003c/p\u003e\n\n\u003cp\u003eHowever, I need to execute the fade in and out simultaneously - currently the first div fades in, then the second div fades out - I need the two happening at the same time. Current code below:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar showElements = function(){\n $('#hover-advanced').animate({opacity: \"1.0\"}, 300),$('#hover-standard').animate({opacity: \"0.3\"}, 300);\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eDoes anyone know if this is possible?\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","accepted_answer_id":"11187267","answer_count":"2","comment_count":"1","creation_date":"2012-06-25 10:04:44.123 UTC","last_activity_date":"2012-07-14 16:33:41.25 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"950182","post_type_id":"1","score":"0","tags":"jquery","view_count":"684"} +{"id":"34128643","title":"How to Iterate a list and add a element into list with index","body":"\u003cp\u003eI am using below code to iterate \u003ccode\u003elist\u003c/code\u003e and to add element into \u003ccode\u003elist with index\u003c/code\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ehierhier.each() { k, v -\u0026gt;\n println 'k---------' + k\n if(k == 0){\n dataList += v\n println \"dataList first ----------- \" + dataList\n }else{\n dataList.eachWithIndex {list,index-\u0026gt; // line no 2566\n if(dataList[index].get(primaryField) == k){\n //println \"index---------\" + dataList[index].get(index)\n int position = index\n println 'position--------- ' + ++position\n v.each {it -\u0026gt;\n //dataList[index] = v\n dataList.add(position,it)\n position++\n println \"dataList----------- \" + dataList\n }\n }\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut its throwing error \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003ejava.util.ConcurrentModificationException\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eWhile first time I mean for \u003cstrong\u003efirst iterator its working fine\u003c/strong\u003e but the next iterator i.e. second iterator its not working. How can I resolve this issue with matching my requirement.\u003c/p\u003e\n\n\u003cp\u003eOutput:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eError |\n java.util.ConcurrentModificationException \u003c/p\u003e\n \n \u003cp\u003eError |\n com.acumetric.hrat.aggregator.yourService$_$tt__getDataForGrid_closure84$$EPWABwO5.doCall(DataImportService.groovy:2566)\u003c/p\u003e\n\u003c/blockquote\u003e","answer_count":"2","comment_count":"7","creation_date":"2015-12-07 07:45:37.317 UTC","last_activity_date":"2015-12-09 13:32:57.797 UTC","last_edit_date":"2015-12-07 09:09:15.777 UTC","last_editor_display_name":"user4408375","owner_display_name":"user4408375","post_type_id":"1","score":"0","tags":"list|groovy","view_count":"116"} +{"id":"9101418","title":"How to hide the default minimize/maximize and close buttons on JFrame window in Java?","body":"\u003cp\u003eI would like to know if it is possible to create a Jframe window which has no default maximize/minimize(-) and close(x) buttons! I have added custom buttons on each frame so that the user does not have to mess around with the default ones on the top right corner of the window!\u003c/p\u003e","answer_count":"5","comment_count":"1","creation_date":"2012-02-01 18:46:32.623 UTC","favorite_count":"3","last_activity_date":"2016-05-11 14:26:34.413 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1031322","post_type_id":"1","score":"6","tags":"java|swing|user-interface|jframe","view_count":"25900"} +{"id":"18981214","title":"why should i use telerik radcontrols over visual studio built-in controls?","body":"\u003cp\u003ewhy should i use telerik radcontrols over visual studio built-in controls. Basically i want to know the pros and cons of telerik controls.\nI am new in telerik. I really get very less time for learn something new.\nSo is it worthwhile to choose telerik over other new technologies. \u003c/p\u003e","accepted_answer_id":"18982216","answer_count":"3","comment_count":"0","creation_date":"2013-09-24 12:07:52.617 UTC","favorite_count":"1","last_activity_date":"2013-09-24 13:06:29.717 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2767928","post_type_id":"1","score":"3","tags":"asp.net|telerik|telerik-mvc","view_count":"8501"} +{"id":"46758764","title":"Metal Best Practice: Triple-buffering – Textures too?","body":"\u003cp\u003eIn the \u003ca href=\"https://developer.apple.com/library/content/documentation/3DDrawing/Conceptual/MTLBestPracticesGuide/TripleBuffering.html\" rel=\"nofollow noreferrer\"\u003e\u003cem\u003eMetal Best Practices Guide\u003c/em\u003e\u003c/a\u003e, it states that for best performance one should \"implement a triple buffering model to update dynamic buffer data,\" and that \"dynamic buffer data refers to frequently updated data stored in a buffer.\"\u003c/p\u003e\n\n\u003cp\u003eDoes an \u003ccode\u003eMTLTexture\u003c/code\u003e qualify as \"frequently updated data stored in a buffer\" if it needs to be updated every frame? All the examples in the guide above focus on \u003ccode\u003eMTLBuffer\u003c/code\u003es.\u003c/p\u003e\n\n\u003cp\u003eI notice Apple's implementation in MetalKit has a concept of a \u003ccode\u003enextDrawable\u003c/code\u003e, so perhaps that's what's happening here?\u003c/p\u003e","accepted_answer_id":"46759815","answer_count":"1","comment_count":"0","creation_date":"2017-10-15 18:50:12.4 UTC","last_activity_date":"2017-10-15 20:46:18.723 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"113461","post_type_id":"1","score":"2","tags":"ios|metal|metalkit","view_count":"52"} +{"id":"32292826","title":"Cython create array of array / list of lists , but should be used inside a gil","body":"\u003cp\u003eI want to create an array of arrays . Like ,\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[ [ 'hello', 'world' ] , ['hello'] , ['how' , 2, 5 ] ]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo, the size of the internal arrays are not fixed . Finally , it shouldn't be a Python object. Because , i need to use it inside gil for some manipulation . What i got is follows, which can be used inside \"with nogil\" , I guess. But, how to modify the following A matrix, so that I can add dynamic sub arrays .\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e%%cython --cplus\nimport numpy\n\n\ndef thing(int m, int n):\n cdef int i, j\n cdef object[:, :] A = numpy.empty((m, n), dtype=object)\n\nfor i in range(A.shape[0]):\n for j in range(A.shape[1]):\n A[i, j] = numpy.zeros(min(i, j))\n\nreturn A\nx = thing(5,3) \n\nfor i in range(x.shape[0]):\n for j in range(x.shape[1]):\n x[i][j] = add some values ######\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"12","creation_date":"2015-08-30 03:18:27.27 UTC","last_activity_date":"2015-08-30 06:03:34.13 UTC","last_edit_date":"2015-08-30 06:03:34.13 UTC","last_editor_display_name":"","last_editor_user_id":"4763311","owner_display_name":"","owner_user_id":"4763311","post_type_id":"1","score":"2","tags":"python|c++|cython","view_count":"242"} +{"id":"11880138","title":"aptana 3 (eclipse?) memory usage grows quickly","body":"\u003cp\u003eI use Aptana 3 (the standalone version), but I have a problem when I use it in huge javascript files like libraries. Memory usage grow up fastly when I code and it become laggy, in task manager it grow up from nearly 150mb to 600+mb, then it become unusable so I have to close and reopen Aptana.\nI googled to solve my problem but nothing was useful. Is it possible to change some parameter to adjust memory usage? (maybe at 600+mb it swap?)\nThis is wat I get from diagnostic test\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eHost OS: Windows 7\nJRE Version: 1.6.0_24\nVersion: 3.2.1.201207261642\nVM Arguments: -Xms40m\n-Xmx512m\n-Declipse.p2.unsignedPolicy=allow\n-Declipse.log.size.max=10000\n-Declipse.log.backup.max=5\n-Djava.awt.headless=true\n-XX:MaxPermSize=256m\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2012-08-09 09:12:31.44 UTC","last_activity_date":"2013-01-11 06:05:59.21 UTC","last_edit_date":"2013-01-11 06:05:59.21 UTC","last_editor_display_name":"","last_editor_user_id":"72882","owner_display_name":"","owner_user_id":"1303090","post_type_id":"1","score":"0","tags":"eclipse|eclipse-plugin|aptana","view_count":"881"} +{"id":"5396285","title":"Java Index Does Not Exist In ArrayList\u003cDouble\u003e","body":"\u003cp\u003eI currently have an ArrayList which houses the first 1000 prime numbers. I am able to successfully print the list to the console.\u003c/p\u003e\n\n\u003cp\u003eI am then applying the following method:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic static ScalesSolution RMHC(ArrayList\u0026lt;Double\u0026gt; weights, int n, int iter){\n\n private String scasol;\n\n ScalesSolution sol = new ScalesSolution(n);\n\n for(int i = 1; i \u0026lt;= iter; i++){\n\n double oldsol = sol.ScalesFitness(weights);\n\n sol.smallChange(n);\n sol.println();\n\n double newsol = sol.ScalesFitness(weights);\n\n if(newsol \u0026gt; oldsol){\n newsol = oldsol;\n }\n }\n return(sol);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMain method:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic static void main(String[] args){\n\n ArrayList\u0026lt;Double\u0026gt; primes = new ArrayList\u0026lt;Double\u0026gt;();\n\n primes.addAll(CS2004.ReadNumberFile(\"1000 Primes.txt\"));\n\n RMHC(primes, 10, 50);\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eScalesSolution class:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class ScalesSolution{\n\npublic void smallChange(int n)\n{\n Random rand = new Random();\n int p = (rand.nextInt(n) - 1);\n\n //Checks if p \u0026lt; 0. If so, then p will not have 1 subtracted from it.\n if(p \u0026lt; 0){\n p = (rand.nextInt(n));\n }\n\n String x = new String();\n\n x = scasol.substring(0, p);\n\n if (scasol.charAt(p) == '0')\n scasol.replace('0', '1');\n else if (scasol.charAt(p) == '1')\n scasol.replace('1', '0');\n scasol = x;\n}//End smallChange()\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhenever I call the method, however, I receive the following error no matter what I enter for the parameters. (FYI, \u003ccode\u003eArrayList\u0026lt;Double\u0026gt; weights\u003c/code\u003e is the list of primes, \u003ccode\u003eint n\u003c/code\u003e is the size of the solution to look for and \u003ccode\u003eiter\u003c/code\u003e is the number of iterations that the algorithm will run for.)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eException in thread \"main\" java.lang.StringIndexOutOfBoundsException: String index out of range: 6\nat java.lang.String.substring(Unknown Source)\nat ScalesSolution.smallChange(ScalesSolution.java:90)\nat Lab8.RMHC(Lab8.java:15)\nat Lab8.main(Lab8.java:46)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAs mentioned above, the list contains 1000 elements (1000 - 1 indices), however I always receive the error above.\u003c/p\u003e\n\n\u003cp\u003eAs you can see, it points to an error at index position 6, but there are \u003ccode\u003e1000 - 1\u003c/code\u003e index positions, so why does this happen? The index position changes with each run, but each and every time I run it, the error arises.\u003c/p\u003e\n\n\u003cp\u003eThank you.\u003c/p\u003e","accepted_answer_id":"5396322","answer_count":"5","comment_count":"3","creation_date":"2011-03-22 18:47:09.207 UTC","favorite_count":"1","last_activity_date":"2011-03-22 23:10:03.767 UTC","last_edit_date":"2011-03-22 23:10:03.767 UTC","last_editor_display_name":"","last_editor_user_id":"636987","owner_display_name":"","owner_user_id":"636987","post_type_id":"1","score":"0","tags":"java|indexing","view_count":"864"} +{"id":"34592409","title":"How to map query parameters with dashes in their names","body":"\u003cp\u003eIs there a way to map the query string parameter \u003ccode\u003emy-param\u003c/code\u003e to the controller method parameter \u003ccode\u003emyParam\u003c/code\u003e in Web API 2 (preferably using attribute routing)?\u003c/p\u003e\n\n\u003cp\u003eThis means a URI like...\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elibrary.com/books?search-text=REST\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e...should be routed to the controller method\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[HttpGet, Route(\"books/{search-text?}\")]\npublic IEnumerable\u0026lt;Book\u0026gt; Get(string searchText = \"\") { ... }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs this possible? The \u003ca href=\"http://www.asp.net/web-api/overview/web-api-routing-and-actions/attribute-routing-in-web-api-2\" rel=\"nofollow\"\u003eMicrosoft documentation\u003c/a\u003e does not provide an example for that case. But it also doesn't provide some kind of grammar for route parameters, hence I'm not sure if it's exhaustive.\u003c/p\u003e","accepted_answer_id":"34592977","answer_count":"1","comment_count":"0","creation_date":"2016-01-04 13:36:16.023 UTC","last_activity_date":"2016-01-04 18:57:45.927 UTC","last_edit_date":"2016-01-04 13:42:48.39 UTC","last_editor_display_name":"","last_editor_user_id":"1025555","owner_display_name":"","owner_user_id":"1025555","post_type_id":"1","score":"1","tags":"c#|routes|asp.net-web-api2|attributerouting","view_count":"596"} +{"id":"27713633","title":"NodeJS Aerospike UDF execute memory leak","body":"\u003cp\u003eI'm executing a UDF a few thousand times per second. This causes NodeJS's RSS memory usage to slowly climb, seemingly without limit, a few kb per execute. The problem persists even if I periodically close the connection and open a new client.\u003c/p\u003e\n\n\u003cp\u003eReproduction is very easy: Just execute a UDF (that returns a few values) on random keys a thousand times a second over the same connection. Cluster configuration doesn't effect it.\u003c/p\u003e\n\n\u003cp\u003eAny insights or advice to debug this problem?\u003c/p\u003e","accepted_answer_id":"27716552","answer_count":"1","comment_count":"0","creation_date":"2014-12-30 22:42:55.45 UTC","last_activity_date":"2015-01-06 13:01:15.677 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1261942","post_type_id":"1","score":"0","tags":"node.js|aerospike","view_count":"148"} +{"id":"40665265","title":"NetSuite SuiteTalk: SavedSearch for \"Deleted Record\" Type","body":"\u003cp\u003eHow does one get the results of a \"Saved Search\" of Type \"Deleted Record\" in NetSuite? Other search types are obvious(CustomerSearchAdvanced, ItemSearchAdvanced, etc...) but this one seems to have no reference online, just documentation around \u003ca href=\"https://docs.tibco.com/pub/bwpluginnetsuite/6.0.1/doc/html/GUID-6668CF65-C79C-43AF-8317-CC2071326260.html\" rel=\"nofollow noreferrer\"\u003edeleting records\u003c/a\u003e, not running saved searches on them.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eUpdate 1\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI should clarify a little bit more what I'm trying to do. In NetSuite you can run(and Save) Saved Search's on the record type \"Deleted Record\", I believe you are able to access at least 5 columns(excluding user defined ones) through this process from the web interface:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eDate Deleted \u003c/li\u003e\n\u003cli\u003eDeleted By \u003c/li\u003e\n\u003cli\u003eContext \u003c/li\u003e\n\u003cli\u003eRecord Type \u003c/li\u003e\n\u003cli\u003eName\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eYou are also able to setup search criteria as part of the \"Saved Search\". I would like to access a series of these \"Saved Search's\" already present in my system utilizing their already setup search criteria and retrieving data from all 5 of their displayed columns.\u003c/p\u003e","accepted_answer_id":"40665345","answer_count":"2","comment_count":"0","creation_date":"2016-11-17 21:22:11.36 UTC","last_activity_date":"2016-11-18 17:05:25.923 UTC","last_edit_date":"2016-11-17 22:33:43.11 UTC","last_editor_display_name":"","last_editor_user_id":"2912011","owner_display_name":"","owner_user_id":"2912011","post_type_id":"1","score":"0","tags":"c#|web-services|soap|netsuite|suitetalk","view_count":"265"} +{"id":"11362339","title":"raty star rating plugin for storing data from multiple ratings","body":"\u003cp\u003eI am using the raty star rating jQuery plugin from this site : \u003ca href=\"http://www.wbotelhos.com/raty/\" rel=\"nofollow\"\u003ehttp://www.wbotelhos.com/raty/\u003c/a\u003e by Washington Botelho.\u003cbr\u003e\nI am using multiple ratings in my single form. The different ratings are like this :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div id='star1' class='star'\u0026gt;\u0026lt;/div\u0026gt;\n\u0026lt;input name='score1' type='hidden' id='score-target' /\u0026gt;\n\n\u0026lt;div id='star2' class='star'\u0026gt;\u0026lt;/div\u0026gt;\n\u0026lt;input name='score2' type='hidden' id='score-target' /\u0026gt;\n\n\u0026lt;div id='star3' class='star'\u0026gt;\u0026lt;/div\u0026gt;\n\u0026lt;input name='score3' type='hidden' id='score-target' /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow i am not much familiar with jQuery, but i tried a lot to go through and understand its js files. I wrote the javascript code like this :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;script type=\"text/javascript\"\u0026gt;\n $(function() {\n\n $('.star').raty({\n cancel : true,\n targetKeep : true,\n targetType : 'number',\n targetText : '0',\n target : '#score-target'\n });\n\n $('#score').raty({\n score: function() {\n return $(this).attr('data-rating');\n }\n });\n });\n\u0026lt;/script\u0026gt; \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe problem is that only the score from the last rating is getting stored in my inputs, the first 2 inputs are storing null values. Im not using Ajax as i am not familiar with it. I am using php to get the data from the form and then storing it in a table. Can anyone help me with the javascript code to store the different values in the different hiddne input fields? \u003c/p\u003e","answer_count":"2","comment_count":"2","creation_date":"2012-07-06 12:36:47.057 UTC","last_activity_date":"2013-04-14 23:08:44.237 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1457882","post_type_id":"1","score":"2","tags":"php|jquery|forms","view_count":"1129"} +{"id":"4977283","title":"UIScrollView with multiple UIViewControllers","body":"\u003cp\u003ei have one scrollview and 4 UIviewcontrollers with xib files now i want to add 4 viewcontrollers to scrollview\u003c/p\u003e\n\n\u003cp\u003eand also the scroll is enabled for four viewcontrollers\u003c/p\u003e\n\n\u003cp\u003eany one know this plz answer this problem\u003c/p\u003e","accepted_answer_id":"4977296","answer_count":"2","comment_count":"0","creation_date":"2011-02-12 09:16:23.027 UTC","favorite_count":"4","last_activity_date":"2012-03-01 17:23:48.19 UTC","last_edit_date":"2011-02-12 11:20:15.743 UTC","last_editor_display_name":"","last_editor_user_id":"564963","owner_display_name":"","owner_user_id":"564963","post_type_id":"1","score":"2","tags":"iphone|sdk","view_count":"4730"} +{"id":"28350642","title":"How to send log entries from non ATG java code to ATG logs","body":"\u003cp\u003eOur application is running on weblogic and uses ATG also. We have some non-ATG based java components for which we use Log4j for logging and logging happens fine in weblogic server. We are trying to centralize the logging hence we want to send the log entries of non-ATG components to ATG logs too. Is there a way to do that?\u003c/p\u003e\n\n\u003cp\u003eSample code used for weblogic logging:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Logger logger =\n weblogic.logging.log4j.Log4jLoggingHelper.getLog4jServerLogger();\n logger.info(\"Test message\");;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-02-05 17:45:24.78 UTC","last_activity_date":"2015-02-12 07:27:52.11 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"955140","post_type_id":"1","score":"0","tags":"log4j|weblogic|atg","view_count":"273"} +{"id":"37250868","title":"Doctrine - Not equal to some value","body":"\u003cp\u003eI want to detect id that are not equal to \u003cem\u003e1,2,3\u003c/em\u003e or NULL . here is my query:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$qb = $this-\u0026gt;_em-\u0026gt;createQueryBuilder()\n -\u0026gt;select('u.cityId')\n -\u0026gt;from('.....\\Entities\\Cities', 'u')\n -\u0026gt;where(\"u.cityId is null OR u.cityId NOT IN (:parentType) \")\n -\u0026gt;setParameter('parentType' , \"2,3,10\");\n$qb = $qb-\u0026gt;getQuery();\nreturn $qb-\u0026gt;getResult();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAlthough it shows me \u003cem\u003eid\u003c/em\u003e which are NULL or not equal to 2 and another values. It's not restrict 3,10. Any suggestion?\u003c/p\u003e","accepted_answer_id":"37251175","answer_count":"1","comment_count":"0","creation_date":"2016-05-16 09:40:30.46 UTC","last_activity_date":"2016-05-16 09:56:04.75 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2768363","post_type_id":"1","score":"1","tags":"mysql|select|doctrine2","view_count":"238"} +{"id":"8099138","title":"How to set up Monitoring for queue in activemq","body":"\u003cp\u003eI read in ActiveMQ page, using JMX we can monitor queues in activemq. How can we get notified if a queue has messages (depth high) or service interval is high in ActiveMQ. Without using any shell scripts in unix environment. Is it possible through Java program? If yes, give me some ideas to get this done. \u003c/p\u003e","accepted_answer_id":"15002566","answer_count":"3","comment_count":"0","creation_date":"2011-11-11 19:47:40.52 UTC","last_activity_date":"2017-08-02 19:52:22.09 UTC","last_edit_date":"2016-09-21 01:49:42.76 UTC","last_editor_display_name":"","last_editor_user_id":"2439220","owner_display_name":"","owner_user_id":"642793","post_type_id":"1","score":"9","tags":"activemq|monitoring|jmx","view_count":"10343"} +{"id":"18385090","title":"Serial Terminal Programs and Binary Data Logging","body":"\u003cp\u003eI had a very frustrating experience recently and I don't understand the cause. Using freely available terminal programs (putty, termite, teraterm, etc) on Windows 7 I was configuring them to write the incoming raw binary data to file, but the data was corrupted on review. It turns out, I determined painstakingly, that the logged data had quietlty dropped out binary values 0x00 through 0x08. These data values were \u003cem\u003edisplayed\u003c/em\u003e in binary viewing mode on termite, but without question those same data values were omitted from the log file. My recourse is going to be to write a little python script to log my traffic using pyserial, but I am really bothered by the experience, and would love to understand what was going on here. Can anyone shed insight on the matter?\u003c/p\u003e","answer_count":"2","comment_count":"1","creation_date":"2013-08-22 15:41:39.023 UTC","last_activity_date":"2013-08-23 20:13:17.48 UTC","last_edit_date":"2013-08-22 17:43:54.967 UTC","last_editor_display_name":"","last_editor_user_id":"58074","owner_display_name":"","owner_user_id":"212215","post_type_id":"1","score":"0","tags":"logging|binary|terminal|serial-port","view_count":"2270"} +{"id":"1488883","title":"MySQL: Update all Columns With Values From A Separate Table","body":"\u003cp\u003eSometimes if I want to quickly copy records from one table to another (that has the same structure) I use a query like this:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eINSERT INTO table2 SELECT * FROM\n table1 WHERE id = SOME_VALUE\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eHow can I add a ON DUPLICATE KEY UPDATE to this statement? I tried this:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eINSERT INTO SELECT * FROM table1 WHERE\n id = 1 ON DUPLICATE KEY UPDATE SELECT\n * FROM table1 WHERE id = 1\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eBut I get an error. Is there away to accomplish the query above with out individually listing each column in the query?\u003c/p\u003e\n\n\u003cp\u003eP.S. Yes, I realize that it is not good practice to have multiple tables with identical structures, but sometimes you just don't get control over everything in the workplace!\u003c/p\u003e","accepted_answer_id":"1489008","answer_count":"2","comment_count":"1","creation_date":"2009-09-28 19:22:49.363 UTC","favorite_count":"1","last_activity_date":"2009-09-28 20:23:09.93 UTC","last_edit_date":"2009-09-28 19:44:48.407 UTC","last_editor_display_name":"","last_editor_user_id":"15168","owner_display_name":"","owner_user_id":"46540","post_type_id":"1","score":"0","tags":"mysql|select","view_count":"3084"} +{"id":"24210948","title":"Replacing elements with value is not the same","body":"\u003cp\u003eI do:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eT = inv([1.0 0.956 0.621; 1.0 -0.272 -0.647; 1.0 -1.106 1.703]);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eobtaining:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eT =\n\n0.2989 0.5870 0.1140\n0.5959 -0.2744 -0.3216\n0.2115 -0.5229 0.3114\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eif I do \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e T(1,1)==0.2989\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ei obtain\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eans =\n\n 0 \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003esame for other elements.\nwhy this?\u003c/p\u003e","accepted_answer_id":"24211128","answer_count":"3","comment_count":"0","creation_date":"2014-06-13 17:36:23.413 UTC","last_activity_date":"2014-06-13 17:51:11.9 UTC","last_edit_date":"2014-06-13 17:48:41 UTC","last_editor_display_name":"","last_editor_user_id":"128660","owner_display_name":"","owner_user_id":"1973451","post_type_id":"1","score":"0","tags":"matlab|variables|precision|numeric|floating-point-precision","view_count":"44"} +{"id":"45797203","title":"SHA256 in Crypto++ library","body":"\u003cp\u003eLet us focus on SHA256.\u003c/p\u003e\n\n\u003cp\u003eAccording to the following website,\n\u003ca href=\"http://www.fileformat.info/tool/hash.htm\" rel=\"nofollow noreferrer\"\u003ehttp://www.fileformat.info/tool/hash.htm\u003c/a\u003e, the 'Binary hash' of 123 is 3d73c0...... and the 'String hash' of 123 is a665a4.......\u003c/p\u003e\n\n\u003cp\u003eI can obtain the 'String hash' by using the library of crypto++ as the following code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCryptoPP::SHA256 hash;\nstring digest;\nCryptoPP::StringSource d1pk(\"123\", true, new CryptoPP::HashFilter(hash, new HexEncoder(new CryptoPP::StringSink(digest))));\n\ncout\u0026lt;\u0026lt; \"digest : \" \u0026lt;\u0026lt; digest \u0026lt;\u0026lt;endl;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow can I obtain the 'Binary hash' by using the library of crypto++?\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2017-08-21 12:30:40.997 UTC","last_activity_date":"2017-08-21 12:34:58.58 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7894151","post_type_id":"1","score":"0","tags":"c++|crypto++","view_count":"90"} +{"id":"27002328","title":"Qt: printscreen key in keyPressEvent","body":"\u003cp\u003eWhen I pressing keys, this code works, but not with Print Screen key.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evoid KeyHooker::keyPressEvent(QKeyEvent *event)\n{\n qDebug() \u0026lt;\u0026lt; event-\u0026gt;key();\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eQ.\u003c/strong\u003e How can I grab Print Screen key?\u003c/p\u003e","accepted_answer_id":"27002648","answer_count":"1","comment_count":"2","creation_date":"2014-11-18 19:24:38.01 UTC","last_activity_date":"2014-11-18 19:43:16.003 UTC","last_edit_date":"2014-11-18 19:41:36.383 UTC","last_editor_display_name":"","last_editor_user_id":"1162412","owner_display_name":"","owner_user_id":"4062717","post_type_id":"1","score":"3","tags":"c++|qt|events|printing|screen","view_count":"699"} +{"id":"42809799","title":"How to set the color gradient of a progress bar programmatically?","body":"\u003cp\u003eI made some progress bars like you can see in this picture:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/sCAV8l.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/sCAV8l.png\" alt=\"progress bars\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI've been using gradients to make the progress bars more appealing, but I want to use color zones (e.g. 30% full is green, 65% full is yellow, 85% full is orange, 95+% full is red).\u003c/p\u003e\n\n\u003cp\u003eI've seen posts how to change the color, but I would like to change the gradient itself, so I need to pass the startColor, the centerColor and the endColor.\u003c/p\u003e\n\n\u003cp\u003eIs there a way how I can do this?\u003c/p\u003e\n\n\u003cp\u003eThis is what my progress bar looks like in the xml:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;ProgressBar\n android:id=\"@+id/proteinProgressBar\"\n style=\"@android:style/Widget.ProgressBar.Horizontal\"\n android:layout_width=\"32dp\"\n android:layout_height=\"150dp\"\n android:layout_marginStart=\"12dp\"\n android:progressDrawable=\"@drawable/progressbar_states\" /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd this is what the progressbar_states drawable looks like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" encoding=\"utf-8\"?\u0026gt;\n\u0026lt;layer-list xmlns:android=\"http://schemas.android.com/apk/res/android\"\u0026gt;\n \u0026lt;item android:id=\"@android:id/background\"\u0026gt;\n \u0026lt;shape\u0026gt;\n \u0026lt;gradient\n android:startColor=\"#b7b7b5\"\n android:centerColor=\"#e5e5e3\"\n android:endColor=\"#FFF\" /\u0026gt;\n\n \u0026lt;!--\u0026lt;gradient--\u0026gt;\n \u0026lt;!--android:startColor=\"#777\"--\u0026gt;\n \u0026lt;!--android:centerColor=\"#CCC\"--\u0026gt;\n \u0026lt;!--android:endColor=\"#FFF\" /\u0026gt;--\u0026gt;\n\n \u0026lt;corners android:radius=\"10dp\" /\u0026gt;\n \u0026lt;/shape\u0026gt;\n \u0026lt;/item\u0026gt;\n \u0026lt;item android:id=\"@android:id/progress\"\u0026gt;\n \u0026lt;clip\n android:clipOrientation=\"vertical\"\n android:gravity=\"bottom\"\u0026gt;\n \u0026lt;shape\u0026gt;\n \u0026lt;gradient\n android:startColor=\"#32A6FF\"\n android:centerColor=\"#0090FF\"\n android:endColor=\"#3232FF\" /\u0026gt;\n \u0026lt;corners android:radius=\"10dp\" /\u0026gt;\n \u0026lt;/shape\u0026gt;\n \u0026lt;/clip\u0026gt;\n \u0026lt;/item\u0026gt;\n\u0026lt;/layer-list\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"42831366","answer_count":"1","comment_count":"0","creation_date":"2017-03-15 12:30:14.197 UTC","last_activity_date":"2017-03-16 10:27:42.497 UTC","last_edit_date":"2017-03-15 16:01:48.203 UTC","last_editor_display_name":"","last_editor_user_id":"3801533","owner_display_name":"","owner_user_id":"3801533","post_type_id":"1","score":"0","tags":"android|css|progress-bar|gradient","view_count":"656"} +{"id":"4663577","title":"AutoMapper vs ValueInjecter","body":"\u003cp\u003eEverytime I'm looking for \u003ca href=\"http://automapper.codeplex.com/\" rel=\"noreferrer\"\u003eAutoMapper\u003c/a\u003e stuff on StackOverflow, I'm reading something about \u003ca href=\"http://valueinjecter.codeplex.com/\" rel=\"noreferrer\"\u003eValueInjecter\u003c/a\u003e.\u003c/p\u003e\n\n\u003cp\u003eCan somebody tell me the pros and cons between them (performance, features, API usage, extensibility, testing) ?\u003c/p\u003e","accepted_answer_id":"4673771","answer_count":"4","comment_count":"3","creation_date":"2011-01-11 22:49:45.7 UTC","favorite_count":"121","last_activity_date":"2013-12-05 14:45:49.09 UTC","last_edit_date":"2013-12-05 14:45:49.09 UTC","last_editor_display_name":"","last_editor_user_id":"175399","owner_display_name":"","owner_user_id":"175399","post_type_id":"1","score":"210","tags":"c#|.net|automapper|valueinjecter|object-object-mapping","view_count":"46705"} +{"id":"13515767","title":"how to change background color of selected items in multiselect dropdown box?","body":"\u003cp\u003eI want to give the yellow color to the selected items in multiselect dropdown box. By default it has gray background after selecting,\nI want to do this in \u003ccode\u003eHTML, CSS\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eCan any one help in this?\u003c/p\u003e","accepted_answer_id":"17509657","answer_count":"6","comment_count":"0","creation_date":"2012-11-22 15:23:17.08 UTC","favorite_count":"1","last_activity_date":"2016-12-14 13:24:32.18 UTC","last_edit_date":"2013-02-07 13:55:08.383 UTC","last_editor_display_name":"","last_editor_user_id":"1914192","owner_display_name":"","owner_user_id":"1460692","post_type_id":"1","score":"5","tags":"css|multi-select|html.dropdownlistfor","view_count":"25063"} +{"id":"41521336","title":"Android: for cycle to handle lost focus on TextEdit fields","body":"\u003cp\u003eI searched for long without success about making this piece of code in one shot by means, for instance, of a \u003cem\u003efor\u003c/em\u003e cycle rather than repeating it 10 times (D1 d1, D2 d2, ..., D10 d10):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e //\n // -------------- DIAMETRO 1 -----------------------------------\n //\n final EditText D1 = (EditText)findViewById(R.id.d1);\n int d1 = mast.getInstance().getd1();\n Log.d(\"Diametro 1 =\", Integer.toString(d1));\n D1.setText(Integer.toString(d1));\n //\n // Perdita del focus del diametro 1\n //\n D1.setOnFocusChangeListener(new View.OnFocusChangeListener() {\n\n @Override\n public void onFocusChange(View v, boolean hasFocus) {\n /* When focus is lost check that the text field\n * has valid values.\n */\n if (!hasFocus) {\n String strD1=D1.getText().toString();\n mast.getInstance().setd1(Integer.valueOf(strD1));\n }\n }\n });\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"1","creation_date":"2017-01-07 12:15:47.323 UTC","last_activity_date":"2017-02-28 19:36:32.907 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7387567","post_type_id":"1","score":"0","tags":"java|android|android-studio|lost-focus","view_count":"53"} +{"id":"34537903","title":"Slick Carousel - How To Change Default Buttons","body":"\u003cp\u003eI'm working with \u003ca href=\"http://kenwheeler.github.io/slick/\" rel=\"nofollow\"\u003eSlick Carousel\u003c/a\u003e for the first time. The project i'm currently working on needs most of the files loaded through a CDN. How can i replace the default buttons for \"Next\" and \"Previous\" that's loaded through their hosted Jquery? \u003c/p\u003e\n\n\u003cp\u003eAs of now it's just a button with Text, i'd like to replace it with a FontAwesome icon of arrows. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;h1\u0026gt; One Slider At a Time \u0026lt;/h1\u0026gt;\n\u0026lt;div class=\"slider\"\u0026gt;\n \u0026lt;div\u0026gt;\u0026lt;h3\u0026gt;1\u0026lt;/h3\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;div\u0026gt;\u0026lt;h3\u0026gt;2\u0026lt;/h3\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;div\u0026gt;\u0026lt;h3\u0026gt;3\u0026lt;/h3\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is my \u003ca href=\"http://codepen.io/stinkytofu3311/pen/JGbwOV\" rel=\"nofollow\"\u003eDemo\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"34538047","answer_count":"1","comment_count":"0","creation_date":"2015-12-30 22:01:24.807 UTC","last_activity_date":"2016-01-05 18:37:11.83 UTC","last_edit_date":"2016-01-05 18:37:11.83 UTC","last_editor_display_name":"","last_editor_user_id":"3076758","owner_display_name":"","owner_user_id":"3076758","post_type_id":"1","score":"0","tags":"javascript|jquery|css|carousel","view_count":"561"} +{"id":"24435280","title":"Composer packages, specifying package root","body":"\u003cp\u003ePerhaps I've simply missed something basic (\u003cem\u003ehopefully\u003c/em\u003e) but I can't quite figure this out.\u003c/p\u003e\n\n\u003cp\u003eI have a pair of PHP projects, each initialized as a git repo/Composer package; \u003ccode\u003efoobar/package-a\u003c/code\u003e which depends on \u003ccode\u003efoobar/package-b\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003ePackageA\u003c/code\u003e is structured as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ePackageB\n +- src\n | +- PackageB\n | +- Namespace1\n | | +- \u0026lt;files\u0026gt;\n | +- Namespace2\n | | +- \u0026lt;files\u0026gt;\n | +- Namespace3\n | +- \u0026lt;files\u0026gt;\n +- docs\n +- other\n +- things\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003ccode\u003ePackageA\u003c/code\u003e is structured similarly:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e PackageA\n +- src\n | +- PackageA\n | +- \u0026lt;files\u0026gt;\n +- vendor\n +- \u0026lt;files\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnyway, I'm targeting \u003ccode\u003epackage-b\u003c/code\u003e as a dependency from \u003ccode\u003epackage-a\u003c/code\u003e, just using the local git repository.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e# PackageA's composer.json\n\"require\": {\n \"foobar/package-b\": \"dev-master\"\n},\n\"repositories\": [\n {\n \"type\": \"vcs\",\n \"url\": \"path/to/foobar/PackageB\"\n }\n]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, from \u003ccode\u003epackage-b\u003c/code\u003e's side, I only wish to expose everything under \u003ccode\u003e/src/PackageB\u003c/code\u003e, excluding the \u003ccode\u003e/docs\u003c/code\u003e, and \u003ccode\u003e/other\u003c/code\u003e, \u003ccode\u003e/things\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eI was surprised to learn that there isn't a \u003ccode\u003epackage-root\u003c/code\u003e key in the Composer schema, to indicate that I'd like dependent projects to only pull from a certain directory:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e# hypothetical in PackageB's composer.json\n\"package-root\": \"/src/PackageB\" \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs there any way using Composer to indicate to consumers that the files are located somewhere other than the package's root directory?\u003c/p\u003e\n\n\u003cp\u003eCurrently, I'm ending up with \u003cem\u003eeverything\u003c/em\u003e from the \u003ccode\u003ePackageB\u003c/code\u003e root (\u003ccode\u003e/src\u003c/code\u003e, \u003ccode\u003e/docs\u003c/code\u003e, etc.) in the \u003ccode\u003evendor\u003c/code\u003e directory of \u003ccode\u003ePackageA\u003c/code\u003e.\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003ch3\u003eAddendum\u003c/h3\u003e\n\n\u003cul\u003e\n\u003cli\u003eI'm now aware of the \u003ca href=\"https://getcomposer.org/doc/04-schema.md#archive\" rel=\"nofollow\"\u003e\u003ccode\u003eexclude\u003c/code\u003e\u003c/a\u003e key, though I'm looking to actually re-root the package and not just ignore the other directories. Moreover, I'm not sure if that'd apply here anyway.\u003c/li\u003e\n\u003c/ul\u003e","answer_count":"0","comment_count":"3","creation_date":"2014-06-26 16:02:48.49 UTC","last_activity_date":"2014-06-26 16:10:14.123 UTC","last_edit_date":"2014-06-26 16:10:14.123 UTC","last_editor_display_name":"","last_editor_user_id":"409279","owner_display_name":"","owner_user_id":"409279","post_type_id":"1","score":"0","tags":"php|directory|composer-php","view_count":"68"} +{"id":"15913154","title":"How do I add a base target=\"_self\" to my Joomla site's header?","body":"\u003cp\u003eI'm trying to add a simple base \u003ccode\u003etarget=\"_self\"\u003c/code\u003e to my Joomla! 2.5 site's head HTML file. Where do I find that? Thanks! \u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2013-04-09 21:44:44.72 UTC","last_activity_date":"2013-04-09 22:48:55.87 UTC","last_edit_date":"2013-04-09 21:47:58.19 UTC","last_editor_display_name":"","last_editor_user_id":"986618","owner_display_name":"","owner_user_id":"2263700","post_type_id":"1","score":"0","tags":"joomla|head","view_count":"200"} +{"id":"34265768","title":"What is a tensorflow float ref?","body":"\u003cp\u003eTrying to run the following basic example to run a conditional calculation I got the following error message:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e'x' was passed float incompatible with expected float_ref\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003ewhat is a tensorflow float_ref and how does the code have to be modified?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport tensorflow as tf\nfrom tensorflow.python.ops.control_flow_ops import cond\n\na = tf.Variable(tf.constant(0.),name=\"a\")\nb = tf.Variable(tf.constant(0.),name=\"b\")\nx = tf.Variable(tf.constant(0.),name=\"x\")\n\ndef add():\n x.assign( a + b)\n return x\n\ndef last():\n return x\n\ncalculate= cond(x==0.,add,last)\n\nwith tf.Session() as s:\n val = s.run([calculate], {a: 1., b: 2., x: 0.})\n print(val) # 3\n val=s.run([calculate],{a:4.,b:5.,x:val})\n print(val) # 3\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"34269302","answer_count":"2","comment_count":"0","creation_date":"2015-12-14 11:21:11.013 UTC","favorite_count":"1","last_activity_date":"2017-11-30 12:34:56.383 UTC","last_edit_date":"2017-08-20 20:44:24.213 UTC","last_editor_display_name":"","last_editor_user_id":"249341","owner_display_name":"","owner_user_id":"2505295","post_type_id":"1","score":"4","tags":"python|tensorflow","view_count":"1423"} +{"id":"44117175","title":"Is there a way to recover Visual Studio Projects after a hard drive failure?","body":"\u003cp\u003eRecently i have experienced an external hard drive failure. Unfortunately I keep all of my projects on this HDD, and I have no additional backups (this disk was THE backup, and it is three months old).\u003c/p\u003e\n\n\u003cp\u003eI know that Visual Studio have some recovery options, but I never had to use them. Is there any way to recover my projects, from some sort of Visual Studio's temporary or recovery folders? Or perhaps Windows features could help somehow? \u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eAny advice is appreciated...\u003c/strong\u003e \u003cbr\u003e\nI have lost over 80 projects...\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003e\u003cstrong\u003eAdditional info:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eDisk:\u003c/strong\u003e WD My Passport Ultra 2.0 TB USB 3.0 \u003cbr\u003e\n\u003cstrong\u003eVS IDE:\u003c/strong\u003e Visual Studio 2015 Enterprise. \u003cbr\u003e\n\u003cstrong\u003eOS:\u003c/strong\u003e Windows 10 x64 Pro. \u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eDisk failure:\u003c/strong\u003e It boots directly into \u003ccode\u003eEmergency mode\u003c/code\u003e. Someone told me it is a \u003ccode\u003eSATA -\u0026gt; USB Bridge\u003c/code\u003e failure, but i have no way of testing it. I can post some additional data. I did not post them because this question is about VS recovery options, not about disk recovery, \u003c/p\u003e\n\n\u003cp\u003eI sent this disc to a data-recovery specialist, but he estimated the recovery cost for several thousands (in my native currency) and this is a value equivalent to a new computer.\u003c/p\u003e","accepted_answer_id":"44122037","answer_count":"1","comment_count":"0","creation_date":"2017-05-22 15:51:13.91 UTC","last_activity_date":"2017-05-22 20:57:16.07 UTC","last_edit_date":"2017-05-22 20:51:24.78 UTC","last_editor_display_name":"","last_editor_user_id":"5098833","owner_display_name":"","owner_user_id":"5098833","post_type_id":"1","score":"1","tags":"visual-studio|recovery","view_count":"43"} +{"id":"36779892","title":"How do i use relativelayout as header to listview","body":"\u003cp\u003eI have a simple app that allows users top post messages that others can comment on.I have two activities the mainActivity and the commentActivity.On the mainActivity when a user clicks on a post on the list view\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eIntent intent = new Intent(MainActivity.this, CommentActivity.class);\nintent.putExtra(\"Appid\", post.getObjectId());\nintent.putExtra(\"Username\", post.getUser().getUsername());\nintent.putExtra(\"Text\", post.getText());\nintent.putExtra(\"vote\",Integer.toString(post.getVote()));\nintent.putExtra(\"Timestamp\",Long.toString(post.getTimestamp()));\nstartActivity(intent);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eon the comment activity I retrieve \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eString username = intent.getStringExtra(\"Username\");\nString text = intent.getStringExtra(\"Text\");\npost_id = intent.getStringExtra(\"Appid\");\nString sum = intent.getStringExtra(\"vote\");\nString time = intent.getStringExtra(\"Timestamp\");\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd displays them on a relative layout that is above a listview. What I want is for the relative layout to scroll together with the listview as 1 . What I did is have a separate xml for the relative layout that is called header .xml that is separate from comment_activity.xml . on the commentActivity i tried to inflate the header.xml and use it as a header to the listview \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eView view= getLayoutInflater().inflate(R.layout.header,null); \nTextView vote_count = (TextView) view.findViewById(R.id.txtVote_Count);\nTextView txtusername =(TextView) view.findViewById(R.id.txtUsername_view_Respond);\nTextView Statusmsg =(TextView) view.findViewById(R.id.txtContent_view_Respond);\n\n\ntxtusername.setText(username);\nStatusmsg.setText(text);\ntimestamp.setText(timeAgo);\n\nListView listView = (ListView) \nfindViewById(R.id.comment_list_view);\nlistView.addHeaderView(view);\nlistView.setAdapter(Adapter); \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e`\u003c/p\u003e\n\n\u003cp\u003eI get a java.lang.NullPointerException. \nHere is my stack trace `\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e 04-20 20:13:29.737 20254-20254/com.example.machimanapc.howzit W/System.err? at android.os.Looper.loop(Looper.java:193)\n04-20 20:13:29.737 20254-20254/com.example.machimanapc.howzit W/System.err? at android.app.ActivityThread.main(ActivityThread.java:5299)\n04-20 20:13:29.737 20254-20254/com.example.machimanapc.howzit W/System.err? at java.lang.reflect.Method.invokeNative(Native Method)\n04-20 20:13:29.737 20254-20254/com.example.machimanapc.howzit W/System.err? at java.lang.reflect.Method.invoke(Method.java:515)\n04-20 20:13:29.739 20254-20254/com.example.machimanapc.howzit W/System.err? at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:825)\n04-20 20:13:29.740 20254-20254/com.example.machimanapc.howzit W/System.err? at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:641)\n04-20 20:13:29.740 20254-20254/com.example.machimanapc.howzit W/System.err? at dalvik.system.NativeStart.main(Native Method)\n04-20 20:13:29.740 20254-20254/com.example.machimanapc.howzit W/System.err? Caused by: java.lang.NullPointerException\n04-20 20:13:29.746 20254-20254/com.example.machimanapc.howzit W/System.err? at com.example.machimanapc.howzit.CommentActivity.onCreate(CommentActivity.java:196)\n04-20 20:13:29.746 20254-20254/com.example.machimanapc.howzit W/System.err? at android.app.Activity.performCreate(Activity.java:5264)\n04-20 20:13:29.746 20254-20254/com.example.machimanapc.howzit W/System.err? at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1088)\n04-20 20:13:29.746 20254-20254/com.example.machimanapc.howzit W/System.err? at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2302)\n04-20 20:13:29.746 20254-20254/com.example.machimanapc.howzit W/System.err? ... 11 more\n04-20 20:13:29.746 20254-20254/com.example.machimanapc.howzit W/dalvikvm? threadid=1: calling UncaughtExceptionHandler\n04-20 20:13:29.751 20254-20254/com.example.machimanapc.howzit E/AndroidRuntime? FATAL EXCEPTION: main\n Process: com.example.machimanapc.howzit, PID: 20254\n java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.machimanapc.howzit/com.example.machimanapc.howzit.CommentActivity}: java.lang.NullPointerException\n at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2338)\n at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2390)\n at android.app.ActivityThread.access$800(ActivityThread.java:151)\n at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1321)\n at android.os.Handler.dispatchMessage(Handler.java:110)\n at android.os.Looper.loop(Looper.java:193)\n at android.app.ActivityThread.main(ActivityThread.java:5299)\n at java.lang.reflect.Method.invokeNative(Native Method)\n at java.lang.reflect.Method.invoke(Method.java:515)\n at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:825)\n at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:641)\n at dalvik.system.NativeStart.main(Native Method)\n Caused by: java.lang.NullPointerException\n at com.example.machimanapc.howzit.CommentActivity.onCreate(CommentActivity.java:196)\n at android.app.Activity.performCreate(Activity.java:5264)\n at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1088)\n at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2302)\n            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2390)\n            at android.app.ActivityThread.access$800(ActivityThread.java:151)\n            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1321)\n            at android.os.Handler.dispatchMessage(Handler.java:110)\n            at android.os.Looper.loop(Looper.java:193)\n            at android.app.ActivityThread.main(ActivityThread.java:5299)\n            at java.lang.reflect.Method.invokeNative(Native Method)\n            at java.lang.reflect.Method.invoke(Method.java:515)\n            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:825)\n            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:641)\n            at dalvik.system.NativeStart.main(Native Method)\n04-20 20:13:30.053 20254-23455/com.example.machimanapc.howzit D/dalvikvm? create interp thread : stack size=128KB\n04-20 20:13:30.053 20254-23455/com.example.machimanapc.howzit D/dalvikvm? create new thread\n04-20 20:13:30.053 20254-23455/com.example.machimanapc.howzit D/dalvikvm? new thread created\n04-20 20:13:30.053 20254-23455/com.example.machimanapc.howzit D/dalvikvm? update thread list\n04-20 20:13:30.055 20254-23457/com.example.machimanapc.howzit D/dalvikvm? threadid=14: interp stack at 0x551f9000\n04-20 20:13:30.055 20254-23457/com.example.machimanapc.howzit D/dalvikvm? init ref table\n04-20 20:13:30.055 20254-23457/com.example.machimanapc.howzit D/dalvikvm? init mutex\n04-20 20:13:30.055 20254-23457/com.example.machimanapc.howzit D/dalvikvm? threadid=14: created from interp\n04-20 20:13:30.055 20254-23455/com.example.machimanapc.howzit D/dalvikvm? start new thread\n04-20 20:13:30.055 20254-23457/com.example.machimanapc.howzit D/dalvikvm? threadid=14: notify debugger\n04-20 20:13:30.055 20254-23457/com.example.machimanapc.howzit D/dalvikvm? threadid=14 (Task.BACKGROUND_EXECUTOR-thread-13): calling run()\n04-20 20:13:30.056 20254-23457/com.example.machimanapc.howzit D/dalvikvm? create interp thread : stack size=128KB\n04-20 20:13:30.057 20254-23457/com.example.machimanapc.howzit D/dalvikvm? create new thread\n04-20 20:13:30.057 20254-23457/com.example.machimanapc.howzit D/dalvikvm? new thread created\n04-20 20:13:30.057 20254-23457/com.example.machimanapc.howzit D/dalvikvm? update thread list\n04-20 20:13:30.059 20254-23458/com.example.machimanapc.howzit D/dalvikvm? threadid=15: interp stack at 0x55219000\n04-20 20:13:30.059 20254-23458/com.example.machimanapc.howzit D/dalvikvm? init ref table\n04-20 20:13:30.059 20254-23458/com.example.machimanapc.howzit D/dalvikvm? init mutex\n04-20 20:13:30.059 20254-23458/com.example.machimanapc.howzit D/dalvikvm? threadid=15: created from interp\n04-20 20:13:30.059 20254-23457/com.example.machimanapc.howzit D/dalvikvm? start new thread\n04-20 20:13:30.059 20254-23458/com.example.machimanapc.howzit D/dalvikvm? threadid=15: notify debugger\n04-20 20:13:30.059 20254-23458/com.example.machimanapc.howzit D/dalvikvm? threadid=15 (Task.BACKGROUND_EXECUTOR-thread-14): calling run()\n04-20 20:13:30.060 20254-20272/com.example.machimanapc.howzit D/dalvikvm? create interp thread : stack size=128KB\n04-20 20:13:30.060 20254-20272/com.example.machimanapc.howzit D/dalvikvm? create new thread\n04-20 20:13:30.060 20254-20272/com.example.machimanapc.howzit D/dalvikvm? new thread created\n04-20 20:13:30.060 20254-20272/com.example.machimanapc.howzit D/dalvikvm? update thread list\n04-20 20:13:30.061 20254-23460/com.example.machimanapc.howzit D/dalvikvm? threadid=20: interp stack at 0x55239000\n04-20 20:13:30.061 20254-23460/com.example.machimanapc.howzit D/dalvikvm? init ref table\n04-20 20:13:30.061 20254-23460/com.example.machimanapc.howzit D/dalvikvm? init mutex\n04-20 20:13:30.061 20254-23460/com.example.machimanapc.howzit D/dalvikvm? threadid=20: created from interp\n04-20 20:13:30.061 20254-20272/com.example.machimanapc.howzit D/dalvikvm? start new thread\n04-20 20:13:30.061 20254-23460/com.example.machimanapc.howzit D/dalvikvm? threadid=20: notify debugger\n04-20 20:13:30.061 20254-23460/com.example.machimanapc.howzit D/dalvikvm? threadid=20 (Task.BACKGROUND_EXECUTOR-thread-15): calling run()\n04-20 20:13:31.056 20254-23455/com.example.machimanapc.howzit D/dalvikvm? threadid=12: exiting\n04-20 20:13:31.056 20254-23455/com.example.machimanapc.howzit D/dalvikvm? threadid=12: bye!\n04-20 20:13:31.060 20254-23457/com.example.machimanapc.howzit D/dalvikvm? threadid=14: exiting\n04-20 20:13:31.060 20254-23457/com.example.machimanapc.howzit D/dalvikvm? threadid=14: bye!\n04-20 20:13:31.061 20254-23458/com.example.machimanapc.howzit D/dalvikvm? threadid=15: exiting\n04-20 20:13:31.061 20254-23458/com.example.machimanapc.howzit D/dalvikvm? threadid=15: bye!\n04-20 20:13:31.064 20254-23460/com.example.machimanapc.howzit D/dalvikvm? threadid=20: exiting\n04-20 20:13:31.064 20254-23460/com.example.machimanapc.howzit D/dalvikvm? threadid=20: bye!\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e`\u003c/p\u003e","answer_count":"1","comment_count":"6","creation_date":"2016-04-21 20:33:19.91 UTC","last_activity_date":"2016-05-02 21:44:43.437 UTC","last_edit_date":"2016-04-23 11:27:18.117 UTC","last_editor_display_name":"","last_editor_user_id":"5684043","owner_display_name":"","owner_user_id":"5684043","post_type_id":"1","score":"-1","tags":"android|listview|android-intent","view_count":"40"} +{"id":"45429876","title":"How to solve the interrupt by signal 9: SIGKILL?","body":"\u003cp\u003eBelow is my code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e with open(filename, 'r') as f:\n vectors = {}\n for line in f:\n vals = line.rstrip().split(' ')\n vectors[vals[0]] = vals[1:]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd it got this: Process finished with exit code 137 (interrupted by signal 9: SIGKILL). How should I optimize my code?\u003c/p\u003e","answer_count":"1","comment_count":"6","creation_date":"2017-08-01 05:52:09.997 UTC","last_activity_date":"2017-08-01 06:00:13.717 UTC","last_edit_date":"2017-08-01 05:54:05.17 UTC","last_editor_display_name":"","last_editor_user_id":"1735406","owner_display_name":"","owner_user_id":"8000479","post_type_id":"1","score":"0","tags":"python","view_count":"465"} +{"id":"19146145","title":"Tcl List output modification","body":"\u003cp\u003eI have a list named \"a\" and need to perform some basic list operations and commands to get the desired result in another list \"b\" \u003c/p\u003e\n\n\u003cp\u003eThis list \"a\" can contain more elements in any order I have shown one example below\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e(%) set a {{123.4:xyz {p_q[5]}} {123.4:abc {r_s[6]}} mno}\n\n {{123.4:xyz {p_q[5]}} {123.4:abc {r_s[6]} mno}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCurrently, I tried this and got\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e(%) set b \"\"\n(%) \n(%) foreach l $a {\n lappend b [regsub -all [lindex $l 0] $l \"\"]\n }\n(%) puts $b\n\n {{p_q[5]}} {{r_s[6]}} {}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eInstead I want \"b\" to have output as follows\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ep_q[5] r_s[6] mno\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eTcl version: 8.4.6\u003c/p\u003e","accepted_answer_id":"19151399","answer_count":"2","comment_count":"4","creation_date":"2013-10-02 20:22:26.153 UTC","last_activity_date":"2013-10-03 16:43:30.183 UTC","last_edit_date":"2013-10-03 04:03:44.517 UTC","last_editor_display_name":"","last_editor_user_id":"1578604","owner_display_name":"","owner_user_id":"2643899","post_type_id":"1","score":"2","tags":"regex|tcl","view_count":"130"} +{"id":"39011661","title":"DirectX and Cuda performance","body":"\u003cp\u003eI started Cuda recently and studied samples. I found somewhat strange.\u003c/p\u003e\n\n\u003cp\u003eAt 'fluidsD3D9' sample DirectX present funtction takes 15~20 milisec.\nI Checked Time like source code below. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eLARGE_INTEGER start, end, f;\nQueryPerformanceFrequency(\u0026amp;f);\nQueryPerformanceCounter(\u0026amp;start);\nhr = g_pD3DDevice-\u0026gt;Present(NULL, NULL, NULL, NULL);\nQueryPerformanceCounter(\u0026amp;end);\n\nfloat finterval = (float)(end.QuadPart - start.QuadPart) / \n (float)(f.QuadPart / 1000);\n\nprintf(\"\\nPresent : %f\\n\", finterval);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut SwapBuffer does not takes time at 'fluidsGL' sample.\nIt seems that block occur at 'fluidsD3D9' sample.\nFPS also differ DirectX and OpenGL Sample because of this time.\u003c/p\u003e\n\n\u003cp\u003eHow can I solve this problem?\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/nzhm1.jpg\" alt=\"enter image description here\"\u003e\n\u003cimg src=\"https://i.stack.imgur.com/QsyKO.jpg\" alt=\"enter image description here\"\u003e\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2016-08-18 06:52:29.303 UTC","last_activity_date":"2016-08-19 07:19:10.033 UTC","last_edit_date":"2016-08-18 07:19:12.49 UTC","last_editor_display_name":"","last_editor_user_id":"174843","owner_display_name":"","owner_user_id":"6563858","post_type_id":"1","score":"1","tags":"directx","view_count":"31"} +{"id":"43757656","title":"Can apache Heron be run on windows","body":"\u003cp\u003eI have been attempting to run a storm topology useing Heron which I believe is a relatively simple process. However, it seems there is no support for windows on the Heron site. Can I manually build Heron on windows or is it only supported on linux and OS X?\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-05-03 10:37:49.02 UTC","last_activity_date":"2017-05-03 10:37:49.02 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7014105","post_type_id":"1","score":"0","tags":"java|windows|apache-storm","view_count":"23"} +{"id":"16829765","title":"MySQL - SQLSTATE Values","body":"\u003cp\u003eI created a procedure in which if the input is equal to 0, the procedure will throw an SQLException with an error message of 'dwa'. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCREATE PROCEDURE enter_the_dragon(test INT)\n\nBEGIN\n\n DECLARE test_error CONDITION FOR SQLSTATE '42123';\n\n IF test = 0 THEN\n\n SIGNAL test_error\n SET MESSAGE_TEXT = 'dwa';\n\n END IF;\n\nEND;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am aware that SQLSTATE value '00000' means there's no error and SQLSTATE that starts with '01' is a warning. Does that mean that every SQLSTATE that doesn't collide with these two rules is an error?\u003cbr\u003e\nConsidering this rules, are there any other rules on SQLSTATE? Format? Or I am free to create my own SQLSTATE (ex. 01123 (warning) etc.)?\u003c/p\u003e","accepted_answer_id":"20219717","answer_count":"1","comment_count":"0","creation_date":"2013-05-30 06:53:33.183 UTC","last_activity_date":"2013-11-26 14:25:18.383 UTC","last_edit_date":"2013-05-31 01:15:55.457 UTC","last_editor_display_name":"","last_editor_user_id":"1844263","owner_display_name":"","owner_user_id":"1844263","post_type_id":"1","score":"1","tags":"mysql|stored-procedures|signals|sqlexception","view_count":"2245"} +{"id":"34333247","title":"How can I add a number from a cell to be a coordinate in a function?","body":"\u003cp\u003eLike: I have the number \u003ccode\u003e2\u003c/code\u003e in A2 and in another cell I have \u003ccode\u003e=C2\u003c/code\u003e. \u003c/p\u003e\n\n\u003cp\u003eHow can I make the \"2\" in \"C2\" be read from cell A2?\u003c/p\u003e\n\n\u003cp\u003eImage with Problem:\n\u003cimg src=\"https://i.stack.imgur.com/Eqk4e.png\" alt=\"\"\u003e\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2015-12-17 11:17:07.057 UTC","last_activity_date":"2015-12-17 12:24:52.493 UTC","last_edit_date":"2015-12-17 11:25:51.69 UTC","last_editor_display_name":"","last_editor_user_id":"1505120","owner_display_name":"","owner_user_id":"5690657","post_type_id":"1","score":"0","tags":"excel","view_count":"33"} +{"id":"12563144","title":"How SetAuthCookie works for two different site","body":"\u003cp\u003eI would like know how \u003ccode\u003eSetAuthCookie\u003c/code\u003e works for different application on same server?\u003c/p\u003e\n\n\u003cp\u003eCurrently I have two similar applications with different virtual directories.\u003c/p\u003e\n\n\u003cp\u003eHow can I make it so that if I login to one of them then it doesn't ask me for login on the other application, and the same for logout?\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2012-09-24 10:27:34.287 UTC","last_activity_date":"2013-03-04 15:03:20.343 UTC","last_edit_date":"2012-09-24 11:32:42.973 UTC","last_editor_display_name":"","last_editor_user_id":"905","owner_display_name":"","owner_user_id":"1694127","post_type_id":"1","score":"-1","tags":"asp.net|authentication|cookies","view_count":"896"} +{"id":"28440799","title":"Does static_cast affect Boost for simple type float?","body":"\u003cp\u003eIn \u003ca href=\"http://www.boost.org/doc/libs/1_57_0/boost/numeric/odeint/stepper/runge_kutta_dopri5.hpp\" rel=\"nofollow\"\u003eBoost ODEINT\u003c/a\u003e library, you can find a lot of \u003ccode\u003estatic_cast\u003c/code\u003e keyword such as:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etemplate\u0026lt;\nclass State ,\nclass Value = double ,\nclass Deriv = State ,\nclass Time = Value ,\nclass Algebra = typename algebra_dispatcher\u0026lt; State \u0026gt;::algebra_type ,\nclass Operations = typename operations_dispatcher\u0026lt; State \u0026gt;::operations_type ,\nclass Resizer = initially_resizer\n\u0026gt;\nclass runge_kutta_dopri5: ....\n{\n ...\n typedef typename stepper_base_type::value_type value_type;\n ...\n template\u0026lt; class System , class StateIn , class DerivIn , class StateOut , class DerivOut \u0026gt;\n void do_step_impl( System system , const StateIn \u0026amp;in , const DerivIn \u0026amp;dxdt_in , time_type t ,\n StateOut \u0026amp;out , DerivOut \u0026amp;dxdt_out , time_type dt )\n {\n const value_type a2 = static_cast\u0026lt;value_type\u0026gt; ( 1 ) / static_cast\u0026lt;value_type\u0026gt;( 5 );\n const value_type a3 = static_cast\u0026lt;value_type\u0026gt; ( 3 ) / static_cast\u0026lt;value_type\u0026gt; ( 10 );\n const value_type a4 = static_cast\u0026lt;value_type\u0026gt; ( 4 ) / static_cast\u0026lt;value_type\u0026gt; ( 5 );\n const value_type a5 = static_cast\u0026lt;value_type\u0026gt; ( 8 )/static_cast\u0026lt;value_type\u0026gt; ( 9 );\n .... \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhere \u003ccode\u003evalue_type\u003c/code\u003e is determined by template. \u003c/p\u003e\n\n\u003cp\u003eMy question is that if \u003ccode\u003evalue_type\u003c/code\u003e is a simple type like \u003ccode\u003edouble\u003c/code\u003e, is there any difference between \u003ccode\u003estatic_cast\u0026lt;value_type\u0026gt; ( 5 )\u003c/code\u003e and \u003ccode\u003e(double)5\u003c/code\u003e ? I wonder why they have used such casting. Is it the same if \u003ccode\u003evalue_type\u003c/code\u003e is \u003ccode\u003edouble\u0026amp;\u003c/code\u003e or \u003ccode\u003edouble\u0026amp;\u0026amp;\u003c/code\u003e?\u003c/p\u003e","accepted_answer_id":"28441039","answer_count":"1","comment_count":"0","creation_date":"2015-02-10 20:06:18.887 UTC","favorite_count":"1","last_activity_date":"2015-02-10 20:27:14.073 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4550254","post_type_id":"1","score":"2","tags":"c++|boost|casting|type-conversion|odeint","view_count":"58"} +{"id":"7514713","title":"Why isn't my data getting saved in Core Data?","body":"\u003cp\u003eI am trying to save multiple rows into my coredata database using the following code. It only saves the last row. Why is it doing that?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ensManagedObject1.column1 = @\"First row\";\nnsManagedObject1.column2 = @\"Test 2\";\n\n//insert first row\nif (![context save:\u0026amp;error]) {\n NSLog(@\"Could not save the data: %@\",[error localizedDescription]);\n}\n\n//insert second row\nnsManagedObject1.column1 = @\"Second row\";\nnsManagedObject1.column2 = @\"Test 2\";\n\nif (![context save:\u0026amp;error]) {\n NSLog(@\"Could not save the data: %@\",[error localizedDescription]);\n}\n\n//see how many rows exist in the database\nNSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];\nNSEntityDescription *entity = [NSEntityDescription entityForName:@\"TestDB\" inManagedObjectContext:context];\n[fetchRequest setEntity:entity];\n\nNSArray *fetchedObjects = [context executeFetchRequest:fetchRequest error:\u0026amp;error];\nNSLog(@\"Number of rows: %d\",[fetchedObjects count]);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn the count, I get only one row. When I print the data in the rows, it only finds the last row that I entered into the database. Why is it doing that? Since I did save on the context, I was expecting the two rows to be available in the database. Please help! I also do not get any errors.\u003c/p\u003e\n\n\u003cp\u003ePS - I know that I should not be doing this but I feel that I should understand why all the rows are NOT getting saved.\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2011-09-22 12:27:49.697 UTC","last_activity_date":"2011-09-22 12:38:59.96 UTC","last_edit_date":"2011-09-22 12:38:59.96 UTC","last_editor_display_name":"","last_editor_user_id":"106435","owner_display_name":"","owner_user_id":"959087","post_type_id":"1","score":"0","tags":"objective-c|cocoa|core-data","view_count":"132"} +{"id":"23746878","title":"Why isn't my AJAX form working?","body":"\u003cp\u003eI'm learning Rails and am trying to implement AJAX to my sample app. I'm following this \u003ca href=\"http://railscasts.com/episodes/136-jquery-ajax-revised\" rel=\"nofollow\"\u003eRailscast\u003c/a\u003e and I think I'm doing everything it said, but it isn't working and I can't seem to figure out why.\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eI've got \u003ccode\u003eremote: true\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003eI have the \u003ccode\u003erespond_to\u003c/code\u003e block where I respond to the \u003ccode\u003ejs\u003c/code\u003e format.\u003c/li\u003e\n\u003cli\u003eI render \u003ccode\u003ecreate.js.erb\u003c/code\u003e if the format is \u003ccode\u003ejs\u003c/code\u003e.\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eThe code in \u003ccode\u003ecreate.js.erb\u003c/code\u003e isn't being executed. I've got a \u003ccode\u003ealert('test');\u003c/code\u003e that isn't appearing. However, if I refresh the page, the new comment is shown. What am I doing wrong?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003e_form.html.erb\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;%= simple_form_for [@article, @comment], remote: true do |f| %\u0026gt;\n \u0026lt;%= f.input :author, label: 'Name' %\u0026gt;\n \u0026lt;%= f.input :body %\u0026gt;\n \u0026lt;%= f.button :submit %\u0026gt;\n\u0026lt;% end %\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003ecomments_controller.rb\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass CommentsController \u0026lt; ApplicationController\n def create\n @comment = Comment.new(comment_params)\n @comment.article_id = params[:article_id]\n if @comment.save\n respond_to do |f|\n f.html { redirect_to article_path(params[:article_id]), notice: 'Comment created!' }\n f.js { render 'create.js.erb' }\n end\n else\n redirect_to article_path(params[:article_id]), warning: 'Unable to create comment.'\n end\n end\n\n private\n\n def comment_params\n params.require(:comment).permit(:author, :body)\n end\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003ecreate.js.erb\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(document).ready(function() {\n alert('test');\n $('#comments').html(\"\u0026lt;%= j render('comments/list_comments') %\u0026gt;\");\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003estack trace\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ePOST http://localhost:3000/articles/2/comments 500 (Internal Server Error) jquery.js?body=1:9667\nsend jquery.js?body=1:9667\njQuery.extend.ajax jquery.js?body=1:9212\n$.rails.rails.ajax jquery_ujs.js?body=1:81\n$.rails.rails.handleRemote jquery_ujs.js?body=1:157\n(anonymous function) jquery_ujs.js?body=1:364\njQuery.event.dispatch jquery.js?body=1:4625\nelemData.handle\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eupdated stack trace\u003c/strong\u003e last line is slightly different\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ePOST http://localhost:3000/articles/2/comments 500 (Internal Server Error) jquery.js?body=1:9667\nsend jquery.js?body=1:9667\njQuery.extend.ajax jquery.js?body=1:9212\n$.rails.rails.ajax jquery_ujs.js?body=1:81\n$.rails.rails.handleRemote jquery_ujs.js?body=1:157\n(anonymous function) jquery_ujs.js?body=1:364\njQuery.event.dispatch jquery.js?body=1:4625\nelemData.handle jquery.js?body=1:4293\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eRails console output\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eStarted POST \"/articles/2/comments\" for 127.0.0.1 at 2014-05-19 17:12:16 -0400\nProcessing by CommentsController#create as JS\n Parameters: {\"utf8\"=\u0026gt;\"✓\", \"comment\"=\u0026gt;{\"author\"=\u0026gt;\"hhh\", \"body\"=\u0026gt;\"hhh\"}, \"commit\"=\u0026gt;\"Create Comment\", \"article_id\"=\u0026gt;\"2\"}\n (0.1ms) begin transaction\n SQL (2.0ms) INSERT INTO \"comments\" (\"article_id\", \"author\", \"body\", \"created_at\", \"updated_at\") VALUES (?, ?, ?, ?, ?) [[\"article_id\", 2], [\"author\", \"hhh\"], [\"body\", \"hhh\"], [\"created_at\", Mon, 19 May 2014 21:12:16 UTC +00:00], [\"updated_at\", Mon, 19 May 2014 21:12:16 UTC +00:00]]\n (31.2ms) commit transaction\n Rendered comments/_list_comments.html.erb (1.3ms)\n Rendered comments/create.js.erb (2.7ms)\nCompleted 500 Internal Server Error in 56ms\n\nActionView::Template::Error (undefined method `each' for nil:NilClass):\n 1: \u0026lt;div id=\"comments\"\u0026gt;\n 2: \u0026lt;% @comments.each do |comment| %\u0026gt;\n 3: \u0026lt;hr /\u0026gt;\n 4: \u0026lt;p\u0026gt;\u0026lt;small\u0026gt;\u0026lt;%= comment.author %\u0026gt;\u0026lt;/small\u0026gt;\u0026lt;/p\u0026gt;\n 5: \u0026lt;p\u0026gt;\u0026lt;%= comment.body %\u0026gt;\u0026lt;/p\u0026gt;\n app/views/comments/_list_comments.html.erb:2:in `_app_views_comments__list_comments_html_erb__1695291160912137125_70349468259020'\n app/views/comments/create.js.erb:1:in `_app_views_comments_create_js_erb___4307677746730482839_70349467492020'\n app/controllers/comments_controller.rb:6:in `create'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003e_list_comments.html.erb\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div id=\"comments\"\u0026gt;\n \u0026lt;% @comments.each do |comment| %\u0026gt;\n \u0026lt;hr /\u0026gt;\n \u0026lt;p\u0026gt;\u0026lt;small\u0026gt;\u0026lt;%= comment.author %\u0026gt;\u0026lt;/small\u0026gt;\u0026lt;/p\u0026gt;\n \u0026lt;p\u0026gt;\u0026lt;%= comment.body %\u0026gt;\u0026lt;/p\u0026gt;\n \u0026lt;% end %\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"23747158","answer_count":"1","comment_count":"18","creation_date":"2014-05-19 20:44:18.863 UTC","last_activity_date":"2014-05-19 21:23:26.38 UTC","last_edit_date":"2014-05-19 21:23:26.38 UTC","last_editor_display_name":"","last_editor_user_id":"1927876","owner_display_name":"","owner_user_id":"1927876","post_type_id":"1","score":"0","tags":"ruby-on-rails|ajax|forms","view_count":"188"} +{"id":"11842707","title":"Knockout.js ko.applyBindings() bind part of a viewmodel to a separate div","body":"\u003cp\u003eI have a view model which I map using the knockout mapper to create observable properties from it. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar viewModel= {\n \"Name\": \"Josh\",\n \"Position\": \"Developer\",\n \"PersonalInfo\": [{\n \"CashierMail\": \"Test@testin.com\",\n \"Phone\": \"1234\",\n\n }] \n }\n\nvar myViewModel = ko.mapping.fromJS(viewModel); \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have the following html:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div\u0026gt;\nThe name is \u0026lt;span data-bind=\"text: Name\"\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;div id=\"info\"\u0026gt;\n Mail is \u0026lt;span data-bind=\"text: CashierMail\"\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;br\u0026gt;\n Position is \u0026lt;span data-bind=\"text: Position\"\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;br\u0026gt;\n Phone is \u0026lt;span data-bind=\"text: Phone\"\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is my original code using only one binding from myViewModel and it works: \u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://jsfiddle.net/KHFn8/837/\" rel=\"nofollow noreferrer\"\u003ehttp://jsfiddle.net/KHFn8/837/\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eWhat I want to accomplish is the fields in the div with id \"info\" to be populated with the data from Personal Info observable array. With other words if \u003ccode\u003e\u0026lt;div id=\"info\"\u0026gt;\u003c/code\u003e is a component - to be populated with its own datasource.\u003c/p\u003e\n\n\u003cp\u003eSo I try something like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eko.applyBindings(myViewModel);\nko.applyBindings(myViewModel.PersonalInfo[0], document.getElementById(\"info\"));\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut it does not work.\u003c/p\u003e\n\n\u003cp\u003eBut I want to do the things as I described above. Here is the code that is not working:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://jsfiddle.net/KHFn8/833/\" rel=\"nofollow noreferrer\"\u003ehttp://jsfiddle.net/KHFn8/833/\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI read this topic which is similar to my case but still couldn't make it work:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://stackoverflow.com/questions/9256938/knockout-js-ko-applybindings-hierarchy-binding\"\u003eKnockout.js ko.applyBindings() hierarchy binding\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI am rather new to javascript and knockout and any help with working code will be greatly appreciated. Thank You for your time and effort.\u003c/p\u003e","accepted_answer_id":"11847368","answer_count":"1","comment_count":"0","creation_date":"2012-08-07 09:12:12.17 UTC","favorite_count":"1","last_activity_date":"2012-08-07 13:45:06.757 UTC","last_edit_date":"2017-05-23 12:12:17.82 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"1309076","post_type_id":"1","score":"0","tags":"knockout.js","view_count":"6945"} +{"id":"6904905","title":"Is this a valid regular expression in IIS 7?","body":"\u003cp\u003eFurther to my question at \u003ca href=\"https://stackoverflow.com/questions/6893620/how-do-write-a-rewrite-rule-in-iis-that-allows-html-anchors\"\u003eHow do write a rewrite rule in IIS that allows HTML anchors?\u003c/a\u003e I was wondering if I can do the following or alternatively if there is a similar option to what is available in Apache e.g. \u003ca href=\"https://stackoverflow.com/questions/2686075/mod-rewrite-with-anchor-link\"\u003emod_rewrite with anchor link\u003c/a\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;match url=\"^ts\\/tcs\\.aspx$\" /\u0026gt;\n\u0026lt;action type=\"Redirect\" url=\"http://www.abc.com\" /\u0026gt;\n\u0026lt;conditions\u0026gt;\n \u0026lt;add input=\"{UrlEncode:{URL}}\" pattern=\"#\" /\u0026gt;\n\u0026lt;/conditions\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"6905801","answer_count":"1","comment_count":"8","creation_date":"2011-08-01 21:49:04.393 UTC","last_activity_date":"2011-08-01 23:48:09.053 UTC","last_edit_date":"2017-05-23 11:47:52.093 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"700543","post_type_id":"1","score":"0","tags":"regex|iis","view_count":"120"} +{"id":"31649314","title":"How to create empty wordpress permalink and redirect it into django website?","body":"\u003cp\u003eI need to do such thing, but I don't even know if it is possible to accomplish and if so, how to do this. \u003c/p\u003e\n\n\u003cp\u003eI wrote an Django application which I would like to 'attach' to my wordpress blog. However, I need a permalink (but no page in wordpress pages section) which would point to Django application on the same server. Is that possible?\u003c/p\u003e","accepted_answer_id":"31649595","answer_count":"2","comment_count":"0","creation_date":"2015-07-27 09:21:11.48 UTC","last_activity_date":"2015-07-27 09:35:04.537 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1376444","post_type_id":"1","score":"0","tags":"python|django|wordpress","view_count":"59"} +{"id":"20617600","title":"Travis special requirements for each python version","body":"\u003cp\u003eI need unittest2 and importlib for python 2.6 that is not required for other python versions that travis tests against.\u003c/p\u003e\n\n\u003cp\u003eIs there a way to tell Travis-CI to have different requirements.txt files for each python version?\u003c/p\u003e","accepted_answer_id":"20621143","answer_count":"2","comment_count":"1","creation_date":"2013-12-16 17:59:30.287 UTC","favorite_count":"4","last_activity_date":"2016-05-02 09:13:40.197 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"325809","post_type_id":"1","score":"25","tags":"python|travis-ci|requirements.txt","view_count":"2251"} +{"id":"2271183","title":"UDP packet capturing in c#","body":"\u003cp\u003eWireshark captures UDP packets in my LAN with follwoing details\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSource IP 192.168.1.2\nDestination IP 233.x.x.x\nSource Port 24098\nDestination Port 12074,12330\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ehow can i capture it in c#?\u003c/p\u003e","accepted_answer_id":"2387038","answer_count":"5","comment_count":"0","creation_date":"2010-02-16 07:13:59.183 UTC","favorite_count":"5","last_activity_date":"2017-09-21 19:54:27.393 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"150174","post_type_id":"1","score":"12","tags":"c#|sockets|udp","view_count":"23190"} +{"id":"34270114","title":"Tab gets displayed in next line with visible class","body":"\u003cp\u003eI have a simple bootstrap breadcrumb:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;ul class=\"breadcrumb\" id=\"tree_form_selector\"\u0026gt;\n \u0026lt;li data-tabselector=\"allgemeine_angaben\" class=\"active tabselector\" \u0026gt;\n Allgemeine Angaben\n \u0026lt;/li\u0026gt;\n \u0026lt;li data-tabselector=\"pflegezustand\" class=\"tabselector\"\u0026gt;\n \u0026lt;a href=\"#\" \u0026gt;Pflegezustand\u0026lt;/a\u0026gt;\n \u0026lt;/li\u0026gt;\n \u0026lt;li data-tabselector=\"blüte_und_ertrag\" class=\"tabselector\"\u0026gt;\n \u0026lt;a href=\"#\" \u0026gt;Blüte und Ertrag\u0026lt;/a\u0026gt;\n \u0026lt;/li\u0026gt;\n \u0026lt;!-- Wird nur bei computernn/nicht bei mobile gezeigt --\u0026gt;\n \u0026lt;li data-tabselector=\"qr_code\" class=\"visible-md tabselector\"\u0026gt;\n \u0026lt;a href=\"#\" \u0026gt;QR-Code\u0026lt;/a\u0026gt;\n \u0026lt;/li\u0026gt;\n \u0026lt;!-- Wird nur bei mobile gezeigt --\u0026gt;\n \u0026lt;li data-tabselector=\"camera\" class=\"visible-xs tabselector\"\u0026gt;\n \u0026lt;a href=\"#\" \u0026gt;Kamera\u0026lt;/a\u0026gt;\n \u0026lt;/li\u0026gt;\n \u0026lt;/ul\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAs you can see the tabs with the tabselectors \u003ccode\u003ecamera\u003c/code\u003e and \u003ccode\u003eqr_code\u003c/code\u003e both have a visible class.\u003c/p\u003e\n\n\u003cp\u003eBecause of that the tabs are \u003cb\u003edisplayed in a new line\u003c/b\u003e. \u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/mxngU.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/mxngU.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cb\u003eHow can I prevent this? Or how can I display them only on specific viewport-sizes?\u003c/b\u003eThanks\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://jsfiddle.net/52VtD/13428/\" rel=\"nofollow noreferrer\"\u003ehttp://jsfiddle.net/52VtD/13428/\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"34270513","answer_count":"3","comment_count":"0","creation_date":"2015-12-14 14:58:42.987 UTC","last_activity_date":"2015-12-14 15:21:32.573 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2639304","post_type_id":"1","score":"3","tags":"html|css|twitter-bootstrap","view_count":"48"} +{"id":"17280958","title":"multiple print css for same page","body":"\u003cp\u003eI am building an order entry system for a local company that sells health products. I am using asp.net with C#. When the user clicks print on the final invoice I actually want to print a couple copies of the invoice but I want each copy to show / hide different fields. Is there a way to create multiple print css' and when print is hit I could call print function using different css each time. I want to print an invoice for the customer with just the fields they need but also an invoice for the packer displaying any extra packing notes but not displaying money values, and then a final copy for the business records with all data.\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2013-06-24 17:00:35.58 UTC","last_activity_date":"2015-09-12 15:16:17.35 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1740003","post_type_id":"1","score":"0","tags":"css|printing","view_count":"682"} +{"id":"39702669","title":"cannot modify specific element in array of objects","body":"\u003cpre\u003e\u003ccode\u003e(defclass schedule ()\n ((day :accessor schedule-day :initarg :day)))\n(setf october \n (make-array '(31) \n :element-type 'schedule \n :initial-element \n (make-instance 'schedule :day 0)))\n(setq searcher (read))\n(setf (schedule-day (aref october (- searcher 1))) searcher)\n\n(dotimes (i 31)\n (format t \"-month:10 day:~S~%\" (schedule-day (aref october i))))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is part of my october scheduling program. \nThis part should get the day I typed and change that day's day element, and print every october schedule.\u003c/p\u003e\n\n\u003cp\u003ehowever, \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e(setq searcher (read))\n(setf (schedule-day (aref october (- searcher 1))) searcher)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have trouble in this. if I type 17, then only 17th day of \u003ccode\u003eoctober\u003c/code\u003e should affected and printed like this,\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e-month:10 day:0\n-month:10 day:0\n...\n-month:10 day:17\n-month:10 day:0 \n...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut what I really got is\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e-month:10 day:17\n-month:10 day:17\n-month:10 day:17\n...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhy I can't change only one element? I managed to do this in c++ like,\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eoctober[searcher - 1].setDay(searcher);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIt seems \u003ccode\u003esetf\u003c/code\u003e affects the class itself, not class object. can you help me? Thanks. \u003c/p\u003e","accepted_answer_id":"39703615","answer_count":"2","comment_count":"3","creation_date":"2016-09-26 12:21:05.52 UTC","last_activity_date":"2016-09-26 18:03:32.9 UTC","last_edit_date":"2016-09-26 17:57:21.193 UTC","last_editor_display_name":"","last_editor_user_id":"69545","owner_display_name":"","owner_user_id":"3026854","post_type_id":"1","score":"3","tags":"arrays|lisp|common-lisp","view_count":"49"} +{"id":"15601987","title":"How To change opacity of sprite during animation in cocos2d iphone? COCOS2D","body":"\u003cp\u003eI want to change the opacity of sprite during repeat forever moving animation. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eHow can I solve this?\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"0","creation_date":"2013-03-24 17:56:59.397 UTC","last_activity_date":"2016-12-23 09:56:03.117 UTC","last_edit_date":"2013-03-25 02:58:48.987 UTC","last_editor_display_name":"","last_editor_user_id":"1308066","owner_display_name":"","owner_user_id":"799569","post_type_id":"1","score":"0","tags":"iphone|cocos2d-iphone|ccsprite","view_count":"1518"} +{"id":"47380334","title":"How to reduce too many shuffle using groupByKey()","body":"\u003cp\u003eThe RDD is key-value pair. groupByKey() could create a lot of shuffle which harms the performance. I was wondering how to reduce unnecessary shuffle using groupByKey()\u003c/p\u003e\n\n\u003cp\u003eIf I first repartition RDD first, and then groupByKey, will it help?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eval inputRdd2 = inputRdd.partitionBy(new HashPartitioner(partitions=500) )\n\ninputRdd2.groupByKey()\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eDoes partitionBy() also create shuffle? Thanks\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-11-19 18:17:56.597 UTC","last_activity_date":"2017-11-19 20:16:30.89 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4267387","post_type_id":"1","score":"0","tags":"apache-spark|rdd","view_count":"24"} +{"id":"16535619","title":"Firefox Not Showing CSS3 Animations","body":"\u003cp\u003eWhat's wrong with this (in Firefox)? In Chrome, everything works fairly smoothly (except for a small backflip wheni reaches a certain position. What am I doing wrong?\u003c/p\u003e\n\n\u003cp\u003eKeyframes:\u003c/p\u003e\n\n\u003cpre class=\"lang-css prettyprint-override\"\u003e\u003ccode\u003e@keyframes \"grow\" {\n from {\n -webkit-transform: scale(1);\n -moz-transform: scale(1);\n -o-transform: scale(1);\n -ms-transform: scale(1);\n transform: scale(1);\n }\n to {\n -webkit-transform: scale(2) rotate(180deg);\n -moz-transform: scale(2) rotate(180deg);\n -o-transform: scale(2) rotate(180deg);\n -ms-transform: scale(2) rotate(180deg);\n transform: scale(2) rotate(180deg);\n }\n}\n\n@-moz-keyframes grow {\n from {\n -moz-transform: scale(1);\n transform: scale(1);\n }\n to {\n -moz-transform: scale(2) rotate(180deg);\n transform: scale(2) rotate(180deg);\n }\n}\n\n@-webkit-keyframes \"grow\" {\n from {\n -webkit-transform: scale(1);\n transform: scale(1);\n }\n to {\n -webkit-transform: scale(2) rotate(180deg);\n transform: scale(2) rotate(180deg);\n }\n}\n\n@-ms-keyframes \"grow\" {\n from {\n -ms-transform: scale(1);\n transform: scale(1);\n }\n to {\n -ms-transform: scale(2) rotate(180deg);\n transform: scale(2) rotate(180deg);\n }\n}\n\n@-o-keyframes \"grow\" {\n from {\n -o-transform: scale(1);\n transform: scale(1);\n }\n to {\n -o-transform: scale(2) rotate(180deg);\n transform: scale(2) rotate(180deg);\n }\n}\n\n@keyframes \"spin\" {\n from {\n -webkit-transform: scale(2) rotate(0deg);\n -moz-transform: scale(2) rotate(0deg);\n -o-transform: scale(2) rotate(0deg);\n -ms-transform: scale(2) rotate(0deg);\n transform: scale(2) rotate(0deg);\n }\n to {\n -webkit-transform: scale(2) rotate(360deg);\n -moz-transform: scale(2) rotate(360deg);\n -o-transform: scale(2) rotate(360deg);\n -ms-transform: scale(2) rotate(360deg);\n transform: scale(2) rotate(360deg);\n }\n}\n\n@-moz-keyframes spin {\n from {\n -moz-transform: scale(2) rotate(0deg);\n transform: scale(2) rotate(0deg);\n }\n to {\n -moz-transform: scale(2) rotate(360deg);\n transform: scale(2) rotate(360deg);\n }\n}\n\n@-webkit-keyframes \"spin\" {\n from {\n -webkit-transform: scale(2) rotate(0deg);\n transform: scale(2) rotate(0deg);\n }\n to {\n -webkit-transform: scale(2) rotate(360deg);\n transform: scale(2) rotate(360deg);\n }\n}\n\n@-ms-keyframes \"spin\" {\n from {\n -ms-transform: scale(2) rotate(0deg);\n transform: scale(2) rotate(0deg);\n }\n to {\n -ms-transform: scale(2) rotate(360deg);\n transform: scale(2) rotate(360deg);\n }\n}\n\n@-o-keyframes \"spin\" {\n from {\n -o-transform: scale(2) rotate(0deg);\n transform: scale(2) rotate(0deg);\n }\n to {\n -o-transform: scale(2) rotate(360deg);\n transform: scale(2) rotate(360deg);\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI then applied to specific elements:\u003c/p\u003e\n\n\u003cpre class=\"lang-css prettyprint-override\"\u003e\u003ccode\u003e.radial_div_item img:hover {\n -webkit-animation: spin 1s infinite linear, grow .5s 1 linear;\n -moz-animation: spin 1s infinite linear, grow .5s 1 linear;\n -ms-animation: spin 1s infinite linear, grow .5s 1 linear;\n -o-animation: spin 1s infinite linear, grow .5s 1 linear;\n animation: spin 1s infinite linear, grow .5s 1 linear;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHTML for icons:\u003c/p\u003e\n\n\u003cpre class=\"lang-html prettyprint-override\"\u003e\u003ccode\u003e\u0026lt;div class=\"radial_div\" style=\"position: relative\"\u0026gt;\n\n \u0026lt;div class=\"radial_div_item\" style=\"position: absolute; left: 155px; top: -5px;\"\u0026gt;\u0026lt;a href=\"http://www.facebook.com/TerrasoftCorporation\"\u0026gt;\u0026lt;img src=\"img/menu/fb.png\" title=\"Like Us on Facebook!\" width=\"48\" /\u0026gt;\u0026lt;/a\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;div class=\"radial_div_item\" style=\"position: absolute; left: 315px; top: 85px;\"\u0026gt;\u0026lt;a href=\"http://www.twitter.com/terrasoftlabs\"\u0026gt;\u0026lt;img src=\"img/menu/twit.png\" title=\"Follow Us on Twitter!\" width=\"48\" /\u0026gt;\u0026lt;/a\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;div class=\"radial_div_item\" style=\"position: absolute; left: 315px; top: 280px;\"\u0026gt;\u0026lt;a href=\"http://gplus.to/tsoft\"\u0026gt;\u0026lt;img src=\"img/menu/plus.png\" title=\"Add Us on Google+!\" width=\"48\" /\u0026gt;\u0026lt;/a\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;div class=\"radial_div_item\" style=\"position: absolute; left: 155px; top: 370px;\"\u0026gt;\u0026lt;a href=\"http://prj.terrasoft.x10.mx\"\u0026gt;\u0026lt;img src=\"img/menu/prj.png\" title=\"Our Project Directory!\" width=\"48\" /\u0026gt;\u0026lt;/a\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;div class=\"radial_div_item\" style=\"position: absolute; left: -15px; top: 280px;\"\u0026gt;\u0026lt;a href=\"#contact\" target=\"_self\"\u0026gt;\u0026lt;img id=\"contactOpener\" src=\"img/menu/mail.png\" title=\"Contact Us!\" width=\"48\" /\u0026gt;\u0026lt;/a\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;div class=\"radial_div_item\" style=\"position: absolute; left: -27px; top: 75px;\"\u0026gt;\u0026lt;a href=\"https://github.com/gabrielnahmias/\"\u0026gt;\u0026lt;img src=\"img/menu/hub.png\" title=\"Check Out Our GitHub!\" width=\"72\" /\u0026gt;\u0026lt;/a\u0026gt;\u0026lt;/div\u0026gt;\n\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAny ideas?\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2013-05-14 05:17:00.177 UTC","favorite_count":"1","last_activity_date":"2015-07-09 05:15:26.197 UTC","last_edit_date":"2013-05-16 11:10:10.893 UTC","last_editor_display_name":"","last_editor_user_id":"2114145","owner_display_name":"","owner_user_id":"2114145","post_type_id":"1","score":"1","tags":"css|css3|animation","view_count":"176"} +{"id":"42099939","title":"Laravel \u0026 Ajax - foreach json object \u0026 dealing with duplicates","body":"\u003cp\u003eim trying to make a simple notification system using Ajax and Jquery. \u003c/p\u003e\n\n\u003ch2\u003eWhat i've done so far is:\u003c/h2\u003e\n\n\u003cul\u003e\n\u003cli\u003eCreated a php file from which i load \u003cstrong\u003elatest\u003c/strong\u003e post and its title\u003c/li\u003e\n\u003cli\u003eReturn \u003cstrong\u003ejson\u003c/strong\u003e from php file mentioned above containing latest post and it's title\u003c/li\u003e\n\u003cli\u003eCreated ajax \u003cstrong\u003epost\u003c/strong\u003e request that fetches the latest post from the json and its name using the \u003ccode\u003edata\u003c/code\u003e parameter in \u003ccode\u003esuccess: function(data)\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003eSet an interval that repeats ajax call every 5 seconds\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eprepend\u003c/strong\u003e the latest post title in notification div\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003ch2\u003eProblems i have are:\u003c/h2\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003cp\u003eIf i set the interval on 1 minute and create 2 or more new posts it will only give the newer one (obviously since i called \u003ccode\u003e-\u0026gt;first()\u003c/code\u003e from my \u003ccode\u003e-\u0026gt;latest()\u003c/code\u003e, otherwise it wont load anything)\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eAs i mentioned before, my \u003ccode\u003esetInterval\u003c/code\u003e is set to 5 seconds, and then it loads the latest post, and it does that every 5 seconds so i have an identical new post every 5 seconds until the newer one comes, i tried fixing it by prepending only higher id than the last one, but im not sure how reliable is that\u003c/p\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003ch2\u003eScripts:\u003c/h2\u003e\n\n\u003cp\u003eNotification.php:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$post = Post::latest()-\u0026gt;first();\n$post_title = $post-\u0026gt;title;\n\nreturn response-\u0026gt;json(array('post' =\u0026gt; $post, 'post_title' =\u0026gt; $post));\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eView with AJAX:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction getnewnotif()\n{\n$.ajax({\ntype:'POST',\nurl: url_to_notification.php,\nsuccess: function(data){\n$('#notif').prepend(data.post_title);\n}\n});\n}\n\nsetInterval(getnewnotif(), 5000);\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"42100172","answer_count":"1","comment_count":"0","creation_date":"2017-02-07 21:02:13.64 UTC","last_activity_date":"2017-02-07 21:17:04.75 UTC","last_edit_date":"2017-02-07 21:13:56.193 UTC","last_editor_display_name":"","last_editor_user_id":"7531067","owner_display_name":"","owner_user_id":"7531067","post_type_id":"1","score":"1","tags":"javascript|php|jquery|json|ajax","view_count":"35"} +{"id":"21139227","title":"GtkPaned widget for arbitrary geometries?","body":"\u003cp\u003eI would like my application window to be divided into rectangles with sides perpendicular to the window borders. The number of rectangles would normally be quite large, and the user should be able to resize the rectangles.\u003c/p\u003e\n\n\u003cp\u003eIs there a Gtk widget which would allow for that? GTkPaned comes close - by embedding several GtkPaned widgets one can get such rectangle disivisons, but not all of them are possible - one obvious constraint is that there must be an edge which spans the whole window either horizontally or vertically. The simplest arrangement I know of which doesn't have this property, and so can't be built with Gtkpaned, is: one square in the middle and four rectangles of the same size each, around the square. \u003c/p\u003e\n\n\u003cp\u003eIs there a widget which allows for such arbitrary resizable rectangle arrangements in Gtk?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-01-15 13:50:37.143 UTC","last_activity_date":"2014-01-17 01:49:28.56 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1079234","post_type_id":"1","score":"0","tags":"gtk|panes","view_count":"58"} +{"id":"41395555","title":"Google Script for line chart.","body":"\u003cp\u003eI want to create line chart (dashboard) using google script for the data that looks like this - \u003ca href=\"https://docs.google.com/spreadsheets/d/1fmbtvc2nM06L1t6T-un_q3LGtEDY-3fzOJ-NxbtxwGU/edit#gid=0\" rel=\"nofollow noreferrer\"\u003eSample Data\u003c/a\u003e. I want to plot the line chart for price saved (col D) against Total weight ordered (col E) with the category filter of suppliers (col A). \u003c/p\u003e\n\n\u003cp\u003eI tried editing the code available online (shown below), but I have been getting several errors. For example - ReferenceError: \"data\" is not defined. (line 9, file \"Code\"). It would be of great help if someone could help me to get rid of these errors. \u003c/p\u003e\n\n\u003cp\u003ePS: I don’t have any knowledge of programming and so have posted this question which seems to be bit subjective. \u003c/p\u003e\n\n\u003cp\u003e\u003cdiv class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\"\u003e\r\n\u003cdiv class=\"snippet-code\"\u003e\r\n\u003cpre class=\"snippet-code-js lang-js prettyprint-override\"\u003e\u003ccode\u003e function doGet() {\r\n var uiApp = UiApp.createApplication();\r\n var ssKey = (\"1fmbtvc2nM06L1t6T-un_q3LGtEDY-3fzOJ-NxbtxwGU\");\r\n var ss = SpreadsheetApp.openById('1fmbtvc2nM06L1t6T-un_q3LGtEDY-3fzOJ-NxbtxwGU');\r\n var sss = ss.getSheetByName(\"Sheet1\");\r\n \r\n \r\n var dataTable = Charts.newDataTable();\r\n for( var j in data[0])\r\n dataTable.addColumn(Charts.ColumnType.STRING, data[0][j]);\r\n for( var i = 1; i \u0026lt; data.length; ++i )\r\n dataTable.addRow(data[i].map(String));\r\n \r\n \r\n var dashboard = Charts.newDashboardPanel().setDataTable(dataTable);\r\n \r\n \r\n var supplierFilter = Charts.categoryFilter()\r\n .setFilterColumnLabel(\"Supplier\")\r\n .build();\r\n\r\n\r\n var chartBuilder = Charts.newLineChart()\r\n .setTitle('price vs volume')\r\n .setXAxisTitle('price Saved')\r\n .setYAxisTitle('Total Price')\r\n .setDimensions(600, 500)\r\n .setCurveStyle(Charts.CurveStyle.SMOOTH)\r\n .setPointStyle(Charts.PointStyle.MEDIUM);\r\n \r\n \r\n var chart = chartBuilder.build();\r\n \r\n\r\n \r\n var dashboard = Charts.newDashboardPanel()\r\n .setDataTable(dataTable)\r\n .bind([supplierFilter], [lineChart])\r\n .build();\r\n \r\n dashboard.add(uiApp.createVerticalPanel()\r\n .add(uiApp.createHorizontalPanel()\r\n .add(supplierFilter)\r\n .setSpacing(70))\r\n .add(uiApp.createHorizontalPanel()\r\n .add(pieChart).add(tableChart)\r\n .setSpacing(10)));\r\n uiApp.add(dashboard);\r\n \r\n }\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-12-30 11:30:40.563 UTC","favorite_count":"1","last_activity_date":"2016-12-30 12:23:09.493 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5389035","post_type_id":"1","score":"0","tags":"javascript|excel|vba|google-spreadsheet|google-visualization","view_count":"103"} +{"id":"25275649","title":"rerouting a URL with querystring through an anchor link","body":"\u003cp\u003eThe setup is basically having Page A with anchor links as such\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;a href=\"/index.php/iframe-wrapper?http://www.[desired link].com\"\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eupon click, the URL is written as such in the users browser\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ehttp://www.[site].com/index.php/iframe-wrapper?http://www.[desired link].com\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ean iframe calls what comes after the querystring through javascript and displays it in the frame through \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar query = window.location.search.slice(1); \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebasically being able to have URLs on Page A display in an iframe on Page B\u003c/p\u003e\n\n\u003cp\u003eim stumped on how to remove the querystring from the end result (maybe through htaccess?) (as it is modifiable on any user browser leading to all sorts of vulnerabilities)\u003c/p\u003e\n\n\u003cp\u003eif anyone would be able to help me out with htaccess or some other similar method, i will be deeply grateful\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-08-12 23:18:40.043 UTC","last_activity_date":"2014-08-13 00:58:02.227 UTC","last_edit_date":"2014-08-13 00:58:02.227 UTC","last_editor_display_name":"","last_editor_user_id":"170253","owner_display_name":"","owner_user_id":"170253","post_type_id":"1","score":"0","tags":"javascript|jquery|html|string|.htaccess","view_count":"46"} +{"id":"43672570","title":"Dynamic number of arguments in bind_param","body":"\u003cp\u003eI have been trying to use \u003ccode\u003ecall_user_func_array()\u003c/code\u003ebut dont seem to get it right.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$sql_sentence = \"SELECT * FROM test_table WHERE Fag = ? AND (\" . $sql_subject . \") AND (\" . $sql_grade . \") AND (\" . $sql_type . \")\";\n $sql = $conn-\u0026gt;prepare($sql_sentence);\n\n$allarrays = array_merge(array('ssss'),array($_POST['Fag']),$_POST['subject'],$_POST['Grade'],$_POST['Type']);\n\n//testing to see if it prints out right values of array.\nfor ($x = 0; $x \u0026lt; count($allarrays); $x++) {\n echo \"The number $x is $allarrays[$x] \u0026lt;br\u0026gt;\";\n} \n\ncall_user_func_array(array($sql, \"bind_param\"),$allarrays);\n$sql-\u0026gt;execute();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut I get this error \u003cstrong\u003eWarning: Parameter 2 to mysqli_stmt::bind_param() expected to be a reference\u003c/strong\u003e, and it points it to line \u003ccode\u003ecall_user_func...\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eWhen I print out the SQL sentence it looks like this:\n\u003ccode\u003eSELECT * FROM test_table WHERE Fag = ? AND (Subject LIKE ?) AND (Grade LIKE ?) AND (Type LIKE ?)\u003c/code\u003e\nand all array-values are right, and the first array value is 'ssss', and after the first array comes four arrays with different values.\u003c/p\u003e\n\n\u003cp\u003eHave I done anything wrong here?\nDo you need more code?\u003c/p\u003e\n\n\u003cp\u003eEDIT: Can you open this question. I found an answer which was different than the similar question! Think it should be printed here.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-04-28 05:26:30.347 UTC","last_activity_date":"2017-04-30 07:45:20.05 UTC","last_edit_date":"2017-04-30 07:45:20.05 UTC","last_editor_display_name":"","last_editor_user_id":"7865951","owner_display_name":"","owner_user_id":"7865951","post_type_id":"1","score":"0","tags":"php|mysqli","view_count":"59"} +{"id":"24766257","title":"How to specify adUnitId programmatically for AdMob?","body":"\u003cp\u003eI'm trying to set adUnitId programmatically to ads from the new Google Play services (old AdMob).\u003c/p\u003e\n\n\u003cp\u003eI have this in XML (used in an \u003ccode\u003e\u0026lt;include\u0026gt;\u003c/code\u003e):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;com.google.android.gms.ads.AdView\n xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:ads=\"http://schemas.android.com/apk/res-auto\"\n android:id=\"@+id/adView\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\"\n ads:adSize=\"BANNER\"/\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand this in onCreate():\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eAdView mAdview = (AdView)findViewById(R.id.adView);\n mAdview.setAdUnitId(((App)getApplication()).getAdmobKey());\n\n mAdview.setAdListener(new AdListener() {\n @Override\n public void onAdLoaded() {\n super.onAdLoaded();\n findViewById(R.id.adView).setVisibility(View.VISIBLE);\n }\n });\n\n AdRequest adRequest = new AdRequest.Builder()\n .addTestDevice(AdRequest.DEVICE_ID_EMULATOR)\n .build();\n mAdview.loadAd(adRequest);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd I get:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eThe ad size and ad unit ID must be set before loadAd is called.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eSo the second option was to make the ad programmatically. \u003c/p\u003e\n\n\u003cp\u003eThe new XML:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;LinearLayout\n xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:layout_height=\"wrap_content\"\n android:layout_width=\"match_parent\"\n android:id=\"@+id/adView\"\n /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe new code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eAdView mAdview = new AdView(this);\n...\n((LinearLayout)findViewById(R.id.adView)).addView(mAdview);\nmAdview.loadAd(adRequest);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut I get the same error.\u003c/p\u003e\n\n\u003cp\u003eI tried also to inherit from com.google.android.gms.ads.AdView to make a custom view, but it's final.\u003c/p\u003e\n\n\u003cp\u003eAny suggestion?\u003c/p\u003e","accepted_answer_id":"24776339","answer_count":"1","comment_count":"5","creation_date":"2014-07-15 19:10:34.373 UTC","favorite_count":"1","last_activity_date":"2017-06-13 13:33:16.11 UTC","last_edit_date":"2016-02-15 03:54:54.623 UTC","last_editor_display_name":"","last_editor_user_id":"1402846","owner_display_name":"","owner_user_id":"710162","post_type_id":"1","score":"9","tags":"android|admob|adview","view_count":"5282"} +{"id":"42678395","title":"How to get the list of recently logged in user in asp.net core MVC?","body":"\u003cp\u003eI want to get the list of recently logged in user , how can I get the list of recently logged in user in asp.net core MVC ?\u003c/p\u003e","accepted_answer_id":"42679257","answer_count":"1","comment_count":"0","creation_date":"2017-03-08 17:49:26.583 UTC","last_activity_date":"2017-03-08 23:14:17.093 UTC","last_edit_date":"2017-03-08 23:14:17.093 UTC","last_editor_display_name":"","last_editor_user_id":"3559349","owner_display_name":"","owner_user_id":"5678666","post_type_id":"1","score":"0","tags":"asp.net-core|asp.net-identity|asp.net-core-mvc","view_count":"113"} +{"id":"25823546","title":"external performClick() on android","body":"\u003cp\u003eI want to \u003ccode\u003eperformClick()\u003c/code\u003e to coordinates on android. it should be able to interact external apps. similar to the ghost mouse on windows.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-09-13 13:08:33.067 UTC","last_activity_date":"2014-09-13 15:37:45.14 UTC","last_edit_date":"2014-09-13 13:17:23.423 UTC","last_editor_display_name":"","last_editor_user_id":"3892259","owner_display_name":"","owner_user_id":"1094001","post_type_id":"1","score":"0","tags":"java|android","view_count":"272"} +{"id":"2154311","title":"C++ equivalent of .net Stream?","body":"\u003cp\u003eWhat is the base class of all the streams in C++?\u003c/p\u003e\n\n\u003cp\u003eAlso what is the equivalent of MemoryStream in C++?\u003c/p\u003e","answer_count":"4","comment_count":"0","creation_date":"2010-01-28 12:05:55.67 UTC","last_activity_date":"2010-01-28 16:10:28.87 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"230821","post_type_id":"1","score":"1","tags":"c++|visual-studio-2008","view_count":"620"} +{"id":"5883652","title":"How to query a collection of embedded mongo documents to extract specific document with a list of criteria?","body":"\u003cp\u003eI am trying to select a collection of document based on the content of their embedded documents.\u003c/p\u003e\n\n\u003cp\u003eMy model looks like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass box\n embeds_many :items\n field :stuff\nend\n\nclass item\n field :attrib1\n field :attrib2\n field :array\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo with this structure I can query with the following to extract a collection of boxes bases on it's item's attributes:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eBox.any_in(:'items.array' =\u0026gt; [:value1, :value2]).where(:'items.attrib1'=\u0026gt; 'x', :'items.attrib2' =\u0026gt; 'y').order_by([:stuff, :asc])\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo this query gives me a collection of box that contains items with attributes 1 = x and attributes 2 = y and array that contains value1 or value2\u003c/p\u003e\n\n\u003cp\u003eThis is all great, but the problem is that I need to tie up all the attributes into 1 item. What I mean is that this query will return me box like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e box\n {\n items\n [\n {array =\u0026gt; [value1], attrib1 =\u0026gt; \"x\", attrib2 =\u0026gt; \"z\"}\n {array =\u0026gt; [value1], attrib1 =\u0026gt; \"h\", attrib2 =\u0026gt; \"y\"} \n ]\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe criteria's of the query are respected because it's true that attrib1 = 'x' and attrib2 = 'y' in that box, but unfortunately not within the same item.\u003c/p\u003e\n\n\u003cp\u003eThat's what I need, the list of boxes contains items that have all the desired values within the same item.\u003c/p\u003e\n\n\u003cp\u003eHow can I do that ? I have just no idea ? I hope I made myself clear, I wasn't really sure how to explain my problem\u003c/p\u003e\n\n\u003cp\u003eThanks,\u003c/p\u003e\n\n\u003cp\u003eAlex\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2011-05-04 12:49:21.52 UTC","favorite_count":"1","last_activity_date":"2011-05-04 17:46:00.623 UTC","last_edit_date":"2011-05-04 13:13:18.077 UTC","last_editor_display_name":"","last_editor_user_id":"117160","owner_display_name":"","owner_user_id":"523811","post_type_id":"1","score":"2","tags":"ruby-on-rails-3|collections|mongodb|mongoid","view_count":"482"} +{"id":"25751360","title":"How to read an ISO timezone with boost::date_time?","body":"\u003cp\u003eI'm flabbergasted that it seems that boost::date_time can write date/time strings that it cannot read.\u003c/p\u003e\n\n\u003cp\u003eConsider the following example code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#include \u0026lt;boost/date_time/local_time/local_time.hpp\u0026gt;\n#include \u0026lt;iostream\u0026gt;\n#include \u0026lt;locale\u0026gt;\n\nclass PointTime : public boost::local_time::local_date_time {\n typedef boost::local_time::local_time_input_facet input_facet_t;\n typedef boost::local_time::local_time_facet output_face_t;\n\n public:\n static input_facet_t const s_input_facet;\n static output_face_t const s_output_facet;\n static std::locale const s_input_locale;\n static std::locale const s_output_locale;\n\n public:\n PointTime(std::string const\u0026amp; str);\n};\n\nPointTime::input_facet_t const PointTime::s_input_facet(\"%Y-%m-%dT%H:%M:%S%q\", 1);\nPointTime::output_face_t const PointTime::s_output_facet(\"%Y-%m-%dT%H:%M:%S%q\",\n boost::local_time::local_time_facet::period_formatter_type(),\n boost::local_time::local_time_facet::special_values_formatter_type(),\n boost::local_time::local_time_facet::date_gen_formatter_type(),\n 1);\nstd::locale const PointTime::s_input_locale(std::locale::classic(), \u0026amp;PointTime::s_input_facet);\nstd::locale const PointTime::s_output_locale(std::locale::classic(), \u0026amp;PointTime::s_output_facet);\n\nPointTime::PointTime(std::string const\u0026amp; str) : boost::local_time::local_date_time(boost::local_time::not_a_date_time)\n{\n std::istringstream is(str);\n is.imbue(s_input_locale);\n is \u0026gt;\u0026gt; *this;\n std::string s;\n is \u0026gt;\u0026gt; s;\n std::cout \u0026lt;\u0026lt; \"Left after parsing: \\\"\" \u0026lt;\u0026lt; s \u0026lt;\u0026lt; \"\\\".\" \u0026lt;\u0026lt; std::endl;\n}\n\nint main()\n{\n std::string ts(\"2005-10-15T13:12:11-0700\");\n std::cout \u0026lt;\u0026lt; \"ts = \" \u0026lt;\u0026lt; ts \u0026lt;\u0026lt; std::endl;\n\n try\n {\n PointTime t(ts);\n std::cout.imbue(PointTime::s_output_locale);\n std::cout \u0026lt;\u0026lt; \"t = \" \u0026lt;\u0026lt; t \u0026lt;\u0026lt; std::endl;\n }\n catch (boost::bad_lexical_cast const\u0026amp; error)\n {\n std::cout \u0026lt;\u0026lt; error.what() \u0026lt;\u0026lt; std::endl;\n }\n\n return 0;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis outputs:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003ets = 2005-10-15T13:12:11-0700\u003cbr\u003e\n Left after parsing: \"-0700\".\u003cbr\u003e\n t = 2005-10-15T13:12:11Z\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI understand why it does this: the %q format is documented to be \"output only\",\nbut I can't find a way to actually read back this string?! How should I do this?\u003c/p\u003e","accepted_answer_id":"25768238","answer_count":"2","comment_count":"6","creation_date":"2014-09-09 18:25:14.013 UTC","favorite_count":"2","last_activity_date":"2014-09-10 15:37:22.233 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1487069","post_type_id":"1","score":"4","tags":"c++|datetime|boost","view_count":"1512"} +{"id":"17195139","title":"How to insert data from one table to anther table?","body":"\u003cp\u003eI have two tables, \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etblA(id, num, col1, col2, col3), \ntblB(col1, col2, col3)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ecol1, col2 and col3 are the same in both tables. Now I have following sql:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edeclare @num...(same type as num)\n\ninsert into tblA\nselect @num, * from tblB\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eid in tblA is an indentity column. \u003c/p\u003e\n\n\u003cp\u003eBut I got following error, \nColumn name or number of supplied values does not match table definition.\u003c/p\u003e\n\n\u003cp\u003eCan anyone help me to fix it?\u003c/p\u003e","answer_count":"4","comment_count":"4","creation_date":"2013-06-19 15:22:57.83 UTC","favorite_count":"1","last_activity_date":"2013-06-19 15:47:25.75 UTC","last_edit_date":"2013-06-19 15:43:05.293 UTC","last_editor_display_name":"","last_editor_user_id":"73226","owner_display_name":"","owner_user_id":"968273","post_type_id":"1","score":"1","tags":"sql-server-2008|insert","view_count":"95"} +{"id":"23101311","title":"Bash: text formatting","body":"\u003cp\u003eIn my shell script, I want to log status messages with text alignment. for example\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSTATUS 1 [OK]\nSTATUS 2 [FAILED]\nPROCESS [OK]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI tried \u003ccode\u003eecho -e\u003c/code\u003e with \u003ccode\u003e\\t\u003c/code\u003e option, but I have to manually format the alignment\u003c/p\u003e\n\n\u003cp\u003e[EDIT]\u003c/p\u003e\n\n\u003cp\u003eThis is the part I want text alignment\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eif [ $? -eq 0 ];then\n echo -e \"[$(date +%F_%T)] Alter table $DB.$table\\t\\t\\t\\t\\t\\t[OK]\"\u0026gt;\u0026gt;$log\n sleep 1\nelse\n echo -e \"[$(date +%F_%T)] Alter table $DB.$table\\t\\t\\t\\t\\t\\t[FAIL]\"\u0026gt;\u0026gt;$log\n exit\nfi\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003e[SOLUTION]\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eFound a solution thanks to @Jayesh and @evading\u003c/p\u003e\n\n\u003cp\u003eCreated \u003ccode\u003ewriteLog\u003c/code\u003e function \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction writeLog(){\n printf \"%s %`expr 100 - ${#1}`s\\n\" \"$1\" \"$2\"\u0026gt;\u0026gt;$log\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCall the function like this\u003c/p\u003e\n\n\u003cp\u003ewriteLog \"STATUS1\" \"OK\"\u003c/p\u003e","accepted_answer_id":"23101452","answer_count":"1","comment_count":"7","creation_date":"2014-04-16 06:08:40.43 UTC","last_activity_date":"2014-04-17 03:37:52.827 UTC","last_edit_date":"2014-04-17 03:37:52.827 UTC","last_editor_display_name":"","last_editor_user_id":"3488182","owner_display_name":"","owner_user_id":"3488182","post_type_id":"1","score":"0","tags":"linux|bash|shell","view_count":"270"} +{"id":"6044876","title":"SSO Between Websphere Portal and .NET Application","body":"\u003cp\u003eWhat's the best way to configure SSO between a WebSphere Portal Portlet and a .NET application?\u003c/p\u003e\n\n\u003cp\u003eWe are using WebSphere Portal 6.1.5 and the portlet should just redirect to the .NET application, but not require the user to login since they already did on portal. Both Portal and .NET app are using same Active Directory(LDAP) for authentication.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2011-05-18 12:47:19.973 UTC","favorite_count":"1","last_activity_date":"2011-05-18 23:53:25.9 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"113213","post_type_id":"1","score":"1","tags":"websphere|portal|websphere-portal|jsr286|jsr168","view_count":"647"} +{"id":"43688619","title":"2 Email contact form Validation with security code in PHP","body":"\u003cp\u003eI'm having trouble making this properly work.\u003c/p\u003e\n\n\u003cp\u003eWhat I want to happen is for someone to be able to fill out the given information but there's an email validation which is just you put your email in Email: and is suppose to match in Verify Email: then in hopes that they did that write and if they answer the spam question right which is just \"what is 5+5?\" then the form will send to my email\u003c/p\u003e\n\n\u003cp\u003eThe problem is that, although the email validation is working, the spam question even if you write the answer wrong, the form is still sent. I need it so that the spam and the email validation either or must be correct or the form won't send.\u003c/p\u003e\n\n\u003cp\u003eI hope made this simple for some to understand and help me out! Here's my PHP code. Let me know what I'm doing wrong. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;script\u0026gt;\n\n\n\u0026lt;?php\n\n$email1=$_POST['Email1'];\n$email2=$_POST['Email2'];\n$from=$_POST['Email1'];\n$email=\"!YOUREMAIL@GOES.HERE!\";\n$subject=\"maintenance Request\";\n$message=$_POST['Box'];\n$select=$_POST['Select'];\n$name=$_POST['Name'];\n$number=$_POST['Question'];\n$message=\"Name: \".$name. \"\\r\\n\" .\"\\r\\n\" . \"Email: \" .$from .\"\\r\\n\" . \"\\r\\n\" . \"Comment: \" .$message .\"\\r\\n\" . \"\\r\\n\" . \"Selected Machine: \" .$select;\n\n\nif($number==10) {\n\n}\n\n\nif(filter_var($email1, FILTER_VALIDATE_EMAIL)) {\n}\nif (filter_var($email2, FILTER_VALIDATE_EMAIL)) {\nmail ($email, $subject, $message, \"from:\".$from);\necho 'Thanks You for the Maintenance Request! We will Contact you shortly. ';\n}\nelse {\n echo \"This ($email2) email address is different from ($email1).\\n\";\n}\n\n?\u0026gt;\n\u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"43689279","answer_count":"1","comment_count":"4","creation_date":"2017-04-28 20:44:32.23 UTC","last_activity_date":"2017-04-29 01:48:09.857 UTC","last_edit_date":"2017-04-29 01:48:09.857 UTC","last_editor_display_name":"","last_editor_user_id":"1402846","owner_display_name":"","owner_user_id":"7938426","post_type_id":"1","score":"0","tags":"php|forms|email|contact-form","view_count":"122"} +{"id":"7067891","title":"How to handle overflow in numeric pixel operations with boost::gil?","body":"\u003cp\u003eThe numeric extension for boost::gil contains algorithms like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etemplate \u0026lt;typename Channel1,typename Channel2,typename ChannelR\u0026gt;\nstruct channel_plus_t : public std::binary_function\u0026lt;Channel1,Channel2,ChannelR\u0026gt; {\n ChannelR operator()(typename channel_traits\u0026lt;Channel1\u0026gt;::const_reference ch1,\n typename channel_traits\u0026lt;Channel2\u0026gt;::const_reference ch2) const {\n return ChannelR(ch1)+ChannelR(ch2);\n }\n};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen filled with two uint8 channel values, an overflow will occur if ChannelR is also uint8.\u003c/p\u003e\n\n\u003cp\u003eI think the calculation should\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003euse a different type for the processing (how to derive this from the templated channel types?)\u003c/li\u003e\n\u003cli\u003eclip the result to the range of the ChannelR type to get a saturated result (using \u003ccode\u003eboost::gil::channel_traits\u0026lt;ChannelR\u0026gt;::min_value()\u003c/code\u003e / ...\u003ccode\u003emax_value()\u003c/code\u003e?)\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eHow to do this in a way that allows for performance-optimized results?\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eConvert to the biggest possible type? Sounds counter productive...\u003c/li\u003e\n\u003cli\u003eProvide an arsenal of template specializations? Any better idea?\u003c/li\u003e\n\u003c/ul\u003e","answer_count":"1","comment_count":"1","creation_date":"2011-08-15 16:45:07.327 UTC","favorite_count":"1","last_activity_date":"2012-06-22 11:09:20.303 UTC","last_edit_date":"2011-08-15 19:27:59.09 UTC","last_editor_display_name":"","last_editor_user_id":"636019","owner_display_name":"","owner_user_id":"286303","post_type_id":"1","score":"1","tags":"c++|boost|image-processing|boost-gil","view_count":"232"} +{"id":"34599857","title":"let array behavior in Swift 2.1","body":"\u003cp\u003eI am befuddled by the current array behavior in Swift 2.1. I have read the docs and many posts (which could be out-of-date) and am no closer to understanding.\u003c/p\u003e\n\n\u003cp\u003eHere's my code for separating a deck of cards into wildCards and non-wildcards:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e let wildCards : [Card] = []\n let nonWildCards : [NonJoker] = []\n Meld.sortAndSeparateWildCards(wildCardRank, cards: self.cards, nonWildCards: nonWildCards, wildCards: wildCards)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e...\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003estatic func sortAndSeparateWildCards(wildCardRank : Rank, var cards : [Card], var nonWildCards : [NonJoker], var wildCards : [Card]) {\n //cards contains the list to be sorted\n if cards.isEmpty {return}\n nonWildCards.removeAll()\n wildCards.removeAll()\n for card in cards {\n if (card.isWildCard(wildCardRank)!) {wildCards.append(card)}\n else {nonWildCards.append(card as! NonJoker)}\n }\n cards = nonWildCards.sort(NonJoker.cardComparatorRankFirstDesc)\n cards += wildCards\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat I don't understand:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eXcode \u003cem\u003einsists\u003c/em\u003e that I should change wildCards and nonWildCards to \u003ccode\u003elet\u003c/code\u003e constants, even though I am mutating the arrays by adding values to them (many of the posts I have read say that \u003ccode\u003elet\u003c/code\u003e behavior prevents adding to or removing elements from an Array)\u003c/li\u003e\n\u003cli\u003eI originally had these arrays passed as inout variables, because I thought that Arrays were passed by value and not by reference (the docs suggest that they are treated this way; see the bottom of this page \u003ca href=\"https://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/ClassesAndStructures.html#//apple_ref/doc/uid/TP40014097-CH13-ID82\" rel=\"nofollow\"\u003ehttps://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/ClassesAndStructures.html#//apple_ref/doc/uid/TP40014097-CH13-ID82\u003c/a\u003e)\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eEDIT: I thought the code was working, but I was confused. \nCorrected code, per the answer below, with the bad behavior that isEmpty returns nil.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e var wildCards : [Card] = []\n var nonWildCards : [NonJoker] = []\n Meld.sortAndSeparateWildCards(wildCardRank, cards: \u0026amp;self.cards, nonWildCards: \u0026amp;nonWildCards, wildCards: \u0026amp;wildCards)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e...\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003estatic func sortAndSeparateWildCards(wildCardRank : Rank, inout cards : [Card], inout nonWildCards : [NonJoker], inout wildCards : [Card]) {\n //cards contains the list to be sorted\n if cards.isEmpty {return}\n nonWildCards.removeAll()\n wildCards.removeAll()\n for card in cards {\n if (card.isWildCard(wildCardRank)!) {wildCards.append(card)}\n else {nonWildCards.append(card as! NonJoker)}\n }\n cards = nonWildCards.sort(NonJoker.cardComparatorRankFirstDesc)\n cards += wildCards\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"34600065","answer_count":"2","comment_count":"0","creation_date":"2016-01-04 21:07:20.693 UTC","favorite_count":"1","last_activity_date":"2016-01-04 21:41:17.423 UTC","last_edit_date":"2016-01-04 21:41:17.423 UTC","last_editor_display_name":"","last_editor_user_id":"4266886","owner_display_name":"","owner_user_id":"4266886","post_type_id":"1","score":"0","tags":"ios|arrays|swift","view_count":"87"} +{"id":"20719500","title":"Why does the java enhanced for loop give different results than the \"traditional\"?","body":"\u003cp\u003eI assumed that the enhanced for loop was just some syntactic sugar and behaves exactly like the \"traditional\" for loop. I prepared some code below which does indicate that this is not the case.\u003cbr\u003eWhat is the reason for the different outputs? Or did I miss something and I should stop writing my code this way?\u003c/p\u003e\n\n\u003cp\u003eWhy does t not refer to temp[(current index)]? For me it does not make sense that it does \u003cem\u003enot\u003c/em\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eString temp[] = { \"foo:bar\" };\nfor (String t : temp)\n t = t.split(\":\", 2)[1];\nSystem.out.println(temp[0].startsWith(\"foo\")); //true\nfor (int t = 0; t \u0026lt; temp.length; t++)\n temp[t] = temp[t].split(\":\", 2)[1];\nSystem.out.println(temp[0].startsWith(\"foo\")); //false\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"20719535","answer_count":"3","comment_count":"5","creation_date":"2013-12-21 13:27:04.92 UTC","favorite_count":"0","last_activity_date":"2013-12-21 13:35:21.703 UTC","last_edit_date":"2013-12-21 13:35:21.703 UTC","last_editor_display_name":"","last_editor_user_id":"2084795","owner_display_name":"","owner_user_id":"2084795","post_type_id":"1","score":"-3","tags":"java|foreach","view_count":"147"} +{"id":"41872729","title":"SCRIPT Expect - Waiting for the end of an exec","body":"\u003cp\u003eI have an expect script that has to launch a ssh session and expect the result of it.\u003c/p\u003e\n\n\u003cp\u003eWhen it raises a RSA key error, it has to call a bash script which have to erase one line of a file and call the script back to test the ssh connection again.\u003c/p\u003e\n\n\u003cp\u003eBut, this script is also launched from a bash script a certain number of times. (the number of IP in a file)\u003c/p\u003e\n\n\u003cp\u003e\u003cem\u003e\u003e bash ssh_bash.sh ipfile.txt cmdfile.txt user pwd\u003c/em\u003e\u003c/p\u003e\n\n\u003cp\u003eHere is my code:\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003e[ssh_bash.sh]\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#!/bin/bash\n\nrow=$(cat $1 | wc -l)\nmodulus=$(($row%$4))\ndeclare -A tab\ndeclare -A tabthread\n\nfor rows in $(cat $1);do\n tab[$compt]=$rows\n compt=`expr $compt + 1`\ndone\n\ntabthread[0]=\"LOGG/_ssh-1-\"`date +%Y%m%d%H%M`\".temp\"\ncompt=0\nfor k in `seq 0 $(($modulus-1))`;do\n ./ssh_bash.expect ${tab[$compt]} $2 ${tabthread[0]} $3 $4 \u0026amp;\n compt=`expr $compt + 1`\n wait\ndone\nfi\n\n#sleep 5\n\ntouch $log\nfor logfiles in \"${tabthread[@]}\";do\n cat $logfiles \u0026gt;\u0026gt; $log\n rm -f $logfiles\n compt=`expr $compt + 1`\ndone\n\necho \"Process finished!\"\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003e[ssh_bash.expect]\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#!/usr/bin/expect -f\n\nset ip [lindex $argv 0];\nset cmdfile [lindex $argv 1];\nset log [lindex $argv 2];\nset _user [lindex $argv 3];\nset _pwd [lindex $argv 4];\nset _timeout 0\nset _issue 0\n\nlog_file $log\nlog_user 0\n\nspawn ssh -o ConnectTimeout=5 $_user@$ip\n\nexpect {\n \"assword\" { send \"$_pwd\\r\" }\n \"yes/no\" { send \"yes\\r\"\n exp_continue }\n \"port 22: Connection timed out\" { set _timeout 1 }\n \"verification failed\" { exec bash rsa_eraser.sh ${ip} ${cmdfile} ${log} ${_user} ${_pwd} \u0026amp;\n wait\n set _issue 1 }\n }\n\nif {$_timeout == 0 \u0026amp;\u0026amp; $_issue == 0} {\n send \"$cmd\\r\"\n expect {\n \"OK\" { puts \"$ip | $cmd : OK\" }\n \"ERROR\" { puts \"$ip | $cmd : ERROR\"\n set _error 1 }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003e[rsa_eraser.sh]\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#!/bin/bash\n\ncp -f /root/.ssh/known_hosts /root/.ssh/known_hosts.back\nligne=`grep -n $1 \"/root/.ssh/known_hosts\" | cut -d: -f1`\nsed -i \"$ligne d\" \"/root/.ssh/known_hosts\"\necho \"Erasing existing RSA...done!\"\n./ssh_bash.expect $1 $2 $3 $4 $5\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFor example there is only one IP on the ipfile.\nSo, \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efor k in `seq 0 $(($modulus-1))`;do\n ./ssh_bash.expect ${tab[$compt]} $2 ${tabthread[0]} $3 $4 \u0026amp;\n compt=`expr $compt + 1`\n wait\ndone\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eLoops only one time.\nBut if the RSA error raises, the script doesn't wait the end of the :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e./ssh_bash.expect $1 $2 $3 $4 $5\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eof the rsa_eraser.sh script.\u003c/p\u003e\n\n\u003cp\u003eThe only way I found to solve this issue is to put a \"sleep 5\" just before logging in the \"ssh_bash.sh\" script.\nThanks!\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2017-01-26 11:43:27.967 UTC","last_activity_date":"2017-01-27 08:50:57.767 UTC","last_edit_date":"2017-01-27 08:50:57.767 UTC","last_editor_display_name":"","last_editor_user_id":"6457176","owner_display_name":"","owner_user_id":"6457176","post_type_id":"1","score":"0","tags":"linux|bash|wait|expect","view_count":"57"} +{"id":"14715439","title":"How to put object in ThreadLocal in Struts 2?","body":"\u003cp\u003eI am trying to open Hibernate \u003ccode\u003eSession\u003c/code\u003e on each request and close it at the end.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://stackoverflow.com/questions/5901137/hiberate-with-struts2-use-full-hibernate-plugin-or-another-method-to-close-ses\"\u003eThis\u003c/a\u003e seems like it could work, but I have now idea how am I supposed to put my \u003ccode\u003eSession\u003c/code\u003e object in \u003ccode\u003eThreadLocal\u003c/code\u003e and answer does not explain that.\u003c/p\u003e\n\n\u003cp\u003eIs there any Struts2 specific way to do this?\u003c/p\u003e","accepted_answer_id":"14715806","answer_count":"1","comment_count":"1","creation_date":"2013-02-05 19:34:26.437 UTC","last_activity_date":"2016-10-28 07:35:53.83 UTC","last_edit_date":"2017-05-23 10:34:15.287 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"1136542","post_type_id":"1","score":"0","tags":"java|hibernate","view_count":"510"} +{"id":"26273917","title":"How to bind a variant apply_visitor?","body":"\u003cp\u003eI've got this (C++03) code, but somehow, \u003ccode\u003ebind\u003c/code\u003e refuses to work. Any ideas why?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etypedef boost::variant\u0026lt;int, string\u0026gt; Container;\nstd::vector\u0026lt;Container\u0026gt; v; \n...\nclass IsBad: public boost::static_visitor\u0026lt;\u0026gt;\n{\npublic:\n typedef bool result_type;\n result_type operator()(int\u0026amp; t) const { return i % 2; }\n result_type operator()(string\u0026amp; s) const { return s == \"foo\"; }\n};\nIsBad isBad;\nstd::vector\u0026lt;Container\u0026gt;::iterator it2 = \n std::find_if(it, itEnd, bind(apply_visitor(isBad, _1)));\n// bool is not a class, struct or union type\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"26274122","answer_count":"1","comment_count":"1","creation_date":"2014-10-09 08:38:44.903 UTC","last_activity_date":"2014-10-09 09:00:17.747 UTC","last_edit_date":"2014-10-09 08:49:17.46 UTC","last_editor_display_name":"","last_editor_user_id":"3747990","owner_display_name":"","owner_user_id":"981773","post_type_id":"1","score":"0","tags":"c++|boost|bind|variant","view_count":"225"} +{"id":"15484635","title":"Sort a collection of randomly generated numbers","body":"\u003cp\u003eI am creating a random number generator in c#\u003c/p\u003e\n\n\u003cp\u003eI generate the numbers as so\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eRandom RandomClass = new Random();\n\nNum1.text = RandomClass.Next(1,49).ToString();\nNum2.text = RandomClass.Next(1,49).ToString();\nNum3.text = RandomClass.Next(1,49).ToString();\nNum4.text = RandomClass.Next(1,49).ToString();\nNum5.text = RandomClass.Next(1,49).ToString();\nNum6.text = RandomClass.Next(1,49).ToString();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe user clicks a button and the numbers are generated, what I want is for there to be a button which can sort the numbers, so for example smallest to lowest.\u003c/p\u003e\n\n\u003cp\u003eCould I turn the numbers generated into an array and call .ToArray and then sort from there? I am unsure how to group the random numbers together to then call a sorting method on them.\u003c/p\u003e","accepted_answer_id":"15484746","answer_count":"5","comment_count":"3","creation_date":"2013-03-18 18:54:10.973 UTC","last_activity_date":"2013-03-18 19:45:24.883 UTC","last_edit_date":"2013-03-18 18:56:48.27 UTC","last_editor_display_name":"","last_editor_user_id":"76337","owner_display_name":"","owner_user_id":"1313306","post_type_id":"1","score":"0","tags":"c#|random","view_count":"1249"} +{"id":"20430276","title":"Android 4.1 stock browser: Can't open links in new tab","body":"\u003cp\u003eI am having an issue opening links in a new tab, specifically a link to google maps with location data. It opens in a new tab fine on iOS 6/7, and Chrome Browsers.\u003c/p\u003e\n\n\u003cp\u003eHere is the tags I am using:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;a class=\"location\" href=\"https://maps.google.com/maps?q={{ eventDetails.location.latitude }},{{ eventDetails.location.longitude }}\" target=\"_blank\"\u0026gt;View on map\u0026lt;/a\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe templates are from AngularJS. I thought \u003ccode\u003e_blank\u003c/code\u003e would be enough to get this browser to pop into a new tab, however the page is loading in the same window.\u003c/p\u003e\n\n\u003cp\u003eThe device is on a Galaxy S3 with Android 4.1.1 installed. The user agent string says \u003ccode\u003eAppleWebKit/534.30 Version/4.0 Mobile Safari/534.30\u003c/code\u003e\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2013-12-06 17:46:08.857 UTC","last_activity_date":"2014-11-22 04:41:22.837 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1687443","post_type_id":"1","score":"2","tags":"android|html|angularjs|android-browser","view_count":"496"} +{"id":"42111404","title":"removeEventlistener not working as expected with arrow function and parameter","body":"\u003cp\u003eI've got a page which can hold multiple editable contents. I want to fire some kind of check event whenever the content is edited.\u003c/p\u003e\n\n\u003cp\u003eMy code to achieve this looks like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e// Find all editable elements.\nlet allEditableElements = document.querySelectorAll('[contenteditable=\"true\"]');\n\nfor(let i = 0; i \u0026lt; allEditableElements.length; i++){\n\n //Remove eventListener to prevent duplicate events.\n allEditableElements[i].removeEventListener('input', (event) =\u0026gt; {myClass.myEventMethod(event);}, false);\n\n // Add event.\n allEditableElements[i].addEventListener('input', (event) =\u0026gt; {myClass.myEventMethod(event);}, false);\n} \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eEverything works fine so far. But as I said users can edit the content, which includes adding new editable contents to the page itself. At that point the events will be set again, which is why I'm trying to remove the \u003ccode\u003eevent\u003c/code\u003e beforehand.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eMy question is why would the \u003ccode\u003eremoveEventListener\u003c/code\u003e function not work as expected? And isn't there a way to name given events like so:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e// With eventNameGivenByUser an event could be removed just by its name.\naddEventListener('eventTriggerName', 'eventNameGivenByUser', function(), [, options]);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003chr\u003e\n\n\u003cp\u003eOf course I did some research and found out that the code itself would work like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e// Find all editable elements.\n\nlet allEditableElements = document.querySelectorAll('[contenteditable=\"true\"]');\n\nfor(let i = 0; i \u0026lt; allEditableElements.length; i++){\n\n //Remove eventListener to prevent duplicate events.\n allEditableElements[i].removeEventListener('input', myClass.myEventMethod, false);\n\n // Add event.\n allEditableElements[i].addEventListener('input', myClass.myEventMethod, false);\n} \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever this is without passing parameters, which is mandatory in such a dynamic setup...\u003c/p\u003e\n\n\u003cp\u003eHope someone will tell me that in 2017 there is a nice and decent way without using libraries.\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdit 08.02.2017:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eJust for the curious ones:\nThe Solution is to not pass any parameter to the listener:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e// as you can see there is no (event) and no arrow function either.\naddEventListener('input', myClass.myEventMethod, false);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAll there is to do now is to call prepare the method like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e// The Parameter will be passed through anyway!\nmyEventMethod(event) {\n\n /**\n * Do stuff with event parameter.\n */\n\n};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAfter that the listener can be removed like so:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eremoveEventListener('input', myClass.myEventMethod, false);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003chr\u003e\n\n\u003cp\u003e\u003cstrong\u003eSidenote:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eI'm using electron and do not need cross browser support. It just has to be compatible with \u003ccode\u003eChromium: 56.0.2924.87\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eRegards, Megajin\u003c/p\u003e","accepted_answer_id":"42111869","answer_count":"2","comment_count":"2","creation_date":"2017-02-08 11:05:44.987 UTC","last_activity_date":"2017-02-08 12:17:12.647 UTC","last_edit_date":"2017-02-08 12:17:12.647 UTC","last_editor_display_name":"","last_editor_user_id":"4457744","owner_display_name":"","owner_user_id":"4457744","post_type_id":"1","score":"2","tags":"javascript|ecmascript-6","view_count":"281"} +{"id":"33379589","title":"map showing gray on an Android Wear Emulator","body":"\u003cp\u003ei am using Android Studio, i created a wear AVD with API 22, Activated debugging on the device an obtained the google map API key, i used the example provided by google for a simple Wear application using Google Maps API :\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://developers.google.com/maps/documentation/android-api/wear\" rel=\"nofollow\"\u003ehttps://developers.google.com/maps/documentation/android-api/wear\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eproject's files are provided here :\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://github.com/googlemaps/android-samples/tree/master/AndroidWearMap\" rel=\"nofollow\"\u003ehttps://github.com/googlemaps/android-samples/tree/master/AndroidWearMap\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003ethe application start but show a gray map without changes.\u003c/p\u003e\n\n\u003cp\u003ei think it is a problem of connectivity since the wear AVD is not connected to the internet like a Handled AVD so it can't download the map files.\u003c/p\u003e\n\n\u003cp\u003ei didn't try to connect the wear AVD with my Android Phone because the Android version it is using is not compatible with the Android Wear application required to connect a wear to Handled devices and and it doesn\"t support higher versions.\u003c/p\u003e\n\n\u003cp\u003eis there a solution to let the wear AVD use my computer internet, or another way to use Google Maps on wear AVD ?\u003c/p\u003e\n\n\u003cp\u003ecan i show the map correctly if i connect my wear AVD to a Handled Device ?\u003c/p\u003e\n\n\u003cp\u003ethanks for your suggestions.\u003c/p\u003e","accepted_answer_id":"35382985","answer_count":"2","comment_count":"0","creation_date":"2015-10-27 22:28:34.41 UTC","favorite_count":"1","last_activity_date":"2016-02-13 17:28:50.49 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4043486","post_type_id":"1","score":"1","tags":"android|google-maps|android-wear|google-maps-api-2|android-wear-data-api","view_count":"300"} +{"id":"21241839","title":"Java code automated documentation /presentation","body":"\u003cp\u003eIs there a tool to create from custom Java code documentation similar to what you can find on \u003ca href=\"http://developer.android.com/reference/android/widget/ArrayAdapter.html\" rel=\"nofollow\"\u003ethis page\u003c/a\u003e?\u003c/p\u003e\n\n\u003cp\u003eBy this I mean listing in a clear way: methods of a class, different types of fields, inheritance, interfaces it implements etc. I want to do this for a library I created. I'm aware that all this information could be found inside the code, but sometimes you don't have time to open every single source file. Preferable html output.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-01-20 18:50:38.88 UTC","last_activity_date":"2014-01-20 23:25:58.107 UTC","last_edit_date":"2014-01-20 23:25:58.107 UTC","last_editor_display_name":"","last_editor_user_id":"321731","owner_display_name":"","owner_user_id":"3216352","post_type_id":"1","score":"0","tags":"java|documentation|creation","view_count":"51"} +{"id":"35600476","title":"Securely transmitting password over TCP Socket in Java","body":"\u003cp\u003eI want to write a secure method of authentication over TCP sockets in Java. I've read reasonably extensively on the subject, but I am by no means an expert. There seems to be a bit of variance in opinion on how this is best done.\u003c/p\u003e\n\n\u003cp\u003eI know pretty well had to generate my password hashes, but that doesn't do me a whole lot of good if an attacker can simply glean the passwords/password hashes while in transit. So I want to create a reasonably secure method of sending this data across.\u003c/p\u003e\n\n\u003cp\u003eThe most popular method seems to be using SSL sockets. However, my code will not be used as a single server (as an online game might be) but instead will have many instances run by various consumers. I personally don't have a means to purchase an SSL certificate, and I can't really ask my consumers to do that either. Creating self-signed certificates and then installing them in a keystore for each client seems both difficult and a little insecure. If I were handling all server instances, this would be a much more viable option, since I would only need one certificate, but as it stands now \u003c/p\u003e\n\n\u003cp\u003eSo I worked on simply securing the TCP socket while performing log ins. I can do this pretty well using a Diffie-Hellman algorithm. However, as I research this, people kept saying to use SSL instead. \u003c/p\u003e\n\n\u003cp\u003eHow can I securely transmit passwords over Java TCP sockets in an efficient but portable manner?\u003c/p\u003e","answer_count":"2","comment_count":"5","creation_date":"2016-02-24 11:10:01.37 UTC","last_activity_date":"2016-02-24 11:44:42.903 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2719960","post_type_id":"1","score":"0","tags":"java|sockets|security|tcp","view_count":"200"} +{"id":"11120835","title":"Why QGraphicsScene::advance() doesn't repaint my item?","body":"\u003cp\u003eI'm trying to move a sprite in a QGraphicsView. I use :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003econnect(timer, SIGNAL(timeout()), scene, SLOT(advance()));\ntimer-\u0026gt;start(1000/33);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut my sprite is not repainted. I've to do alt-tab to update the view.\u003c/p\u003e","accepted_answer_id":"11121026","answer_count":"2","comment_count":"0","creation_date":"2012-06-20 13:35:18.617 UTC","last_activity_date":"2012-12-20 10:02:19.91 UTC","last_edit_date":"2012-12-20 10:02:19.91 UTC","last_editor_display_name":"","last_editor_user_id":"851404","owner_display_name":"","owner_user_id":"1312748","post_type_id":"1","score":"1","tags":"qt|qgraphicsview","view_count":"1501"} +{"id":"24102675","title":"Using font awesome over container that already has pseudo elements","body":"\u003cp\u003eI need to display font awesome icons on a div that already has pseudo elements (before and after) applied. Say I have a div, a 3d effect paper, which uses pseudo elements. Now I want to draw a contact us form, which uses font awesome icons. But the font awesome icons are not displaying.\u003c/p\u003e\n\n\u003cp\u003eI tried to keep a dummy div around the contact us form, with clear fix. But still didn't work\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eUPDATE:\u003c/strong\u003e \u003ca href=\"http://jsfiddle.net/tss5Z/\" rel=\"nofollow\"\u003ehttp://jsfiddle.net/tss5Z/\u003c/a\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"slickbox row\"\u0026gt;\n \u0026lt;div class=\"col-md-6\"\u0026gt;\n \u0026lt;div class=\"input-group\"\u0026gt;\n \u0026lt;span class=\"input-group-addon\"\u0026gt;\u0026lt;i class=\"fa fa-envelope\"\u0026gt;\u0026lt;/i\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;input type=\"text\" class=\"form-control\" placeholder=\"Name\"\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"clear\"\u0026gt;\u0026lt;/div\u0026gt;\n\n\u0026lt;/div\u0026gt;\n\u0026lt;div class=\"input-group\"\u0026gt;\n \u0026lt;span class=\"input-group-addon\"\u0026gt;\u0026lt;i class=\"fa fa-envelope\"\u0026gt;\u0026lt;/i\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;input type=\"text\" class=\"form-control\" placeholder=\"Name\"\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"24103047","answer_count":"1","comment_count":"1","creation_date":"2014-06-08 03:18:45.423 UTC","last_activity_date":"2014-06-08 07:18:59.007 UTC","last_edit_date":"2014-06-08 07:18:59.007 UTC","last_editor_display_name":"","last_editor_user_id":"2126792","owner_display_name":"","owner_user_id":"2143314","post_type_id":"1","score":"1","tags":"html|css|font-awesome|pseudo-element","view_count":"274"} +{"id":"33431590","title":"Zip files in a folder and give the archive folder's name","body":"\u003cp\u003eI'm very new to php and I just made my first script, which is working fine, but is missing a final touch.\nThe script zips all files in the folder containing the php and creates a downloadable archive.\nHere's the code\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\n\n$zipname = 'test.zip';\n$zip = new ZipArchive;\n$zip-\u0026gt;open('D://mypath//zip//$zipname', ZipArchive::CREATE);\nif ($dir_handle = opendir('./')) {\n while (false !== ($entry = readdir($dir_handle))) {\n if ($entry != \".\" \u0026amp;\u0026amp; $entry != \"..\" \u0026amp;\u0026amp; !strstr($entry,'.php') \u0026amp;\u0026amp; !strstr($entry,'.zip')) {\n $zip-\u0026gt;addFile($entry);\n }\n }\n closedir($dir_handle);\n}\nelse {\n die('file not found');\n}\n\n$zip-\u0026gt;close();\n\nheader('Content-Type: application/zip');\nheader(\"Content-Disposition: attachment; filename=$zipname\");\nheader('Content-Length: ' . filesize($zipname));\nheader(\"Location: $zipname\");\n\n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat I'd like to achieve is having $zipname = \"the name of the folder.zip\" \nSo, if the php is inside \"/mypath/blablabla/\" i want my zip $zipname to be \"blablabla.zip\"\u003c/p\u003e\n\n\u003cp\u003eAny help will be appreciated!\u003c/p\u003e\n\n\u003cp\u003eEDIT: \nhere's the working code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\n$zipname = getcwd();\n$zipname = substr($zipname,strrpos($zipname,'\\\\')+1);\n$zipname = $zipname.'.zip';\n$zip = new ZipArchive;\n$zip-\u0026gt;open('D:/inetpub/webs/mydomaincom/zip/'.basename($zipname).'', ZipArchive::CREATE);\nif ($dir_handle = opendir('./')) {\n while (false !== ($entry = readdir($dir_handle))) {\nif ($entry != \".\" \u0026amp;\u0026amp; $entry != \"..\" \u0026amp;\u0026amp; !strstr($entry,'.php')) {\n $zip-\u0026gt;addFile($entry);\n}\n}\nclosedir($dir_handle);\n}\nelse {\ndie('file not found');\n}\n\n$zip-\u0026gt;close();\n\nheader('Content-Type: application/zip');\nheader('Content-Disposition: attachment; filename=\"'.basename($zipname).'\"');\nheader('Content-Length: ' . filesize($zipname));\nheader('Location: /zip/'.$zipname);\n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"33431646","answer_count":"2","comment_count":"1","creation_date":"2015-10-30 08:28:38.48 UTC","last_activity_date":"2015-11-03 09:41:59.527 UTC","last_edit_date":"2015-10-30 13:18:57.937 UTC","last_editor_display_name":"","last_editor_user_id":"5506241","owner_display_name":"","owner_user_id":"5506241","post_type_id":"1","score":"0","tags":"php|ziparchive","view_count":"179"} +{"id":"44968944","title":"simple flexbox grid overflow fit to row height","body":"\u003cp\u003eI have a very simple grid using flexbox where I want to display multi-line data in a scrollable box. I might be missing a trivial property but the row height doesn't appear to adjust itself properly to the height of it's content.\u003c/p\u003e\n\n\u003cp\u003eAn example: \u003ca href=\"https://plnkr.co/edit/rCXfvd4Vsh8RgoFja89A?p=preview\" rel=\"nofollow noreferrer\"\u003ehttps://plnkr.co/edit/rCXfvd4Vsh8RgoFja89A?p=preview\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cdiv class=\"snippet\" data-lang=\"js\" data-hide=\"true\" data-console=\"true\" data-babel=\"false\"\u003e\r\n\u003cdiv class=\"snippet-code snippet-currently-hidden\"\u003e\r\n\u003cpre class=\"snippet-code-css lang-css prettyprint-override\"\u003e\u003ccode\u003e.grid {\r\n display: flex;\r\n flex-flow: column;\r\n max-height: 400px;\r\n overflow-y: auto;\r\n}\r\n\r\n.grid .header {\r\n font-weight: 700;\r\n margin-bottom: 6px;\r\n border-bottom: 3px solid black;\r\n}\r\n\r\n.grid .row {\r\n flex: 1;\r\n display: flex;\r\n flex-flow: row;\r\n}\r\n\r\n.grid .row:nth-child(even) {\r\n background: #CCC;\r\n}\r\n\r\n.grid .col-1 {\r\n flex: 0 0 60px;\r\n}\r\n\r\n.grid .col-2 {\r\n flex: 1 0 200px;\r\n white-space: pre;\r\n}\u003c/code\u003e\u003c/pre\u003e\r\n\u003cpre class=\"snippet-code-html lang-html prettyprint-override\"\u003e\u003ccode\u003e\u0026lt;h1\u0026gt;Flexbox grid\u0026lt;/h1\u0026gt;\r\n\r\n\u0026lt;h3\u0026gt;Overflow example\u0026lt;/h3\u0026gt;\r\n\r\n\u0026lt;div class=\"grid\"\u0026gt;\r\n \u0026lt;div class=\"row header\"\u0026gt;\r\n \u0026lt;div class=\"col-1\"\u0026gt;Col 1\u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"col-2\"\u0026gt;Col 2\u0026lt;/div\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"row body\"\u0026gt;\r\n \u0026lt;div class=\"col-1\"\u0026gt;DATA\u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"col-2\"\u0026gt;One Line\u0026lt;/div\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"row body\"\u0026gt;\r\n \u0026lt;div class=\"col-1\"\u0026gt;DATA\u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"col-2\"\u0026gt;One Line\u0026lt;/div\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"row body\"\u0026gt;\r\n \u0026lt;div class=\"col-1\"\u0026gt;DATA\u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"col-2\"\u0026gt;Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled\u0026lt;/div\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"row body\"\u0026gt;\r\n \u0026lt;div class=\"col-1\"\u0026gt;DATA\u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"col-2\"\u0026gt;Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled\u0026lt;/div\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"row body\"\u0026gt;\r\n \u0026lt;div class=\"col-1\"\u0026gt;DATA\u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"col-2\"\u0026gt;Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled\u0026lt;/div\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"row body\"\u0026gt;\r\n \u0026lt;div class=\"col-1\"\u0026gt;DATA\u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"col-2\"\u0026gt;Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled\u0026lt;/div\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"row body\"\u0026gt;\r\n \u0026lt;div class=\"col-1\"\u0026gt;DATA\u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"col-2\"\u0026gt;Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled\u0026lt;/div\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"row body\"\u0026gt;\r\n \u0026lt;div class=\"col-1\"\u0026gt;DATA\u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"col-2\"\u0026gt;Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled\u0026lt;/div\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"row body\"\u0026gt;\r\n \u0026lt;div class=\"col-1\"\u0026gt;DATA\u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"col-2\"\u0026gt;Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled\u0026lt;/div\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"row body\"\u0026gt;\r\n \u0026lt;div class=\"col-1\"\u0026gt;DATA\u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"col-2\"\u0026gt;Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled\u0026lt;/div\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"row body\"\u0026gt;\r\n \u0026lt;div class=\"col-1\"\u0026gt;DATA\u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"col-2\"\u0026gt;Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled\u0026lt;/div\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"row body\"\u0026gt;\r\n \u0026lt;div class=\"col-1\"\u0026gt;DATA\u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"col-2\"\u0026gt;Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled\u0026lt;/div\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"row body\"\u0026gt;\r\n \u0026lt;div class=\"col-1\"\u0026gt;DATA\u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"col-2\"\u0026gt;Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled\u0026lt;/div\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"row body\"\u0026gt;\r\n \u0026lt;div class=\"col-1\"\u0026gt;DATA\u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"col-2\"\u0026gt;Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled\u0026lt;/div\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n\u0026lt;/div\u0026gt;\r\n\r\n\u0026lt;h3\u0026gt;No overflow example\u0026lt;/h3\u0026gt;\r\n\r\n\u0026lt;div class=\"grid\"\u0026gt;\r\n \u0026lt;div class=\"row header\"\u0026gt;\r\n \u0026lt;div class=\"col-1\"\u0026gt;Col 1\u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"col-2\"\u0026gt;Col 2\u0026lt;/div\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"row body\"\u0026gt;\r\n \u0026lt;div class=\"col-1\"\u0026gt;DATA\u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"col-2\"\u0026gt;Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled\u0026lt;/div\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"row body\"\u0026gt;\r\n \u0026lt;div class=\"col-1\"\u0026gt;DATA\u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"col-2\"\u0026gt;Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled\u0026lt;/div\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n\u0026lt;/div\u0026gt;\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://i.stack.imgur.com/mBnWP.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/mBnWP.png\" alt=\"enter image description here\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eTo keep everything simple I my columns are fixed size and all the data I want to display is loaded into the grid (instead of using a virtual grid). Is there a way to fix my example so that the rows adjust itself to the content?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT\u003c/strong\u003e: \u003cstrong\u003eSOLVED!\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eAs user @bhv pointed out I should have disabled shrink on \u003ccode\u003e.row\u003c/code\u003e by applying \u003ccode\u003eflex: 1 0 auto\u003c/code\u003e instead of \u003ccode\u003eflex+:1 (1 auto)\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003e\u003cdiv class=\"snippet\" data-lang=\"js\" data-hide=\"true\" data-console=\"true\" data-babel=\"false\"\u003e\r\n\u003cdiv class=\"snippet-code snippet-currently-hidden\"\u003e\r\n\u003cpre class=\"snippet-code-css lang-css prettyprint-override\"\u003e\u003ccode\u003e.grid {\r\n display: flex;\r\n flex-flow: column;\r\n max-height: 400px;\r\n overflow-y: auto;\r\n}\r\n\r\n.grid .header {\r\n font-weight: 700;\r\n margin-bottom: 6px;\r\n border-bottom: 3px solid black;\r\n}\r\n\r\n.grid .row {\r\n flex: 1;\r\n display: flex;\r\n flex-flow: row;\r\n flex-shrink: 0;\r\n}\r\n\r\n.grid .row:nth-child(even) {\r\n background: #CCC;\r\n}\r\n\r\n.grid .col-1 {\r\n flex: 0 0 60px;\r\n}\r\n\r\n.grid .col-2 {\r\n flex: 1 0 200px;\r\n white-space: pre;\r\n}\u003c/code\u003e\u003c/pre\u003e\r\n\u003cpre class=\"snippet-code-html lang-html prettyprint-override\"\u003e\u003ccode\u003e\u0026lt;h1\u0026gt;Flexbox grid\u0026lt;/h1\u0026gt;\r\n\r\n\u0026lt;h3\u0026gt;Overflow example\u0026lt;/h3\u0026gt;\r\n\r\n\u0026lt;div class=\"grid\"\u0026gt;\r\n \u0026lt;div class=\"row header\"\u0026gt;\r\n \u0026lt;div class=\"col-1\"\u0026gt;Col 1\u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"col-2\"\u0026gt;Col 2\u0026lt;/div\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"row body\"\u0026gt;\r\n \u0026lt;div class=\"col-1\"\u0026gt;DATA\u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"col-2\"\u0026gt;One Line\u0026lt;/div\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"row body\"\u0026gt;\r\n \u0026lt;div class=\"col-1\"\u0026gt;DATA\u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"col-2\"\u0026gt;One Line\u0026lt;/div\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"row body\"\u0026gt;\r\n \u0026lt;div class=\"col-1\"\u0026gt;DATA\u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"col-2\"\u0026gt;Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled\u0026lt;/div\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"row body\"\u0026gt;\r\n \u0026lt;div class=\"col-1\"\u0026gt;DATA\u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"col-2\"\u0026gt;Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled\u0026lt;/div\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"row body\"\u0026gt;\r\n \u0026lt;div class=\"col-1\"\u0026gt;DATA\u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"col-2\"\u0026gt;Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled\u0026lt;/div\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"row body\"\u0026gt;\r\n \u0026lt;div class=\"col-1\"\u0026gt;DATA\u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"col-2\"\u0026gt;Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled\u0026lt;/div\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"row body\"\u0026gt;\r\n \u0026lt;div class=\"col-1\"\u0026gt;DATA\u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"col-2\"\u0026gt;Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled\u0026lt;/div\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"row body\"\u0026gt;\r\n \u0026lt;div class=\"col-1\"\u0026gt;DATA\u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"col-2\"\u0026gt;Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled\u0026lt;/div\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"row body\"\u0026gt;\r\n \u0026lt;div class=\"col-1\"\u0026gt;DATA\u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"col-2\"\u0026gt;Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled\u0026lt;/div\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"row body\"\u0026gt;\r\n \u0026lt;div class=\"col-1\"\u0026gt;DATA\u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"col-2\"\u0026gt;Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled\u0026lt;/div\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"row body\"\u0026gt;\r\n \u0026lt;div class=\"col-1\"\u0026gt;DATA\u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"col-2\"\u0026gt;Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled\u0026lt;/div\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"row body\"\u0026gt;\r\n \u0026lt;div class=\"col-1\"\u0026gt;DATA\u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"col-2\"\u0026gt;Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled\u0026lt;/div\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"row body\"\u0026gt;\r\n \u0026lt;div class=\"col-1\"\u0026gt;DATA\u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"col-2\"\u0026gt;Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled\u0026lt;/div\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"row body\"\u0026gt;\r\n \u0026lt;div class=\"col-1\"\u0026gt;DATA\u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"col-2\"\u0026gt;Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled\u0026lt;/div\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n\u0026lt;/div\u0026gt;\r\n\r\n\u0026lt;h3\u0026gt;No overflow example\u0026lt;/h3\u0026gt;\r\n\r\n\u0026lt;div class=\"grid\"\u0026gt;\r\n \u0026lt;div class=\"row header\"\u0026gt;\r\n \u0026lt;div class=\"col-1\"\u0026gt;Col 1\u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"col-2\"\u0026gt;Col 2\u0026lt;/div\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"row body\"\u0026gt;\r\n \u0026lt;div class=\"col-1\"\u0026gt;DATA\u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"col-2\"\u0026gt;Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled\u0026lt;/div\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"row body\"\u0026gt;\r\n \u0026lt;div class=\"col-1\"\u0026gt;DATA\u0026lt;/div\u0026gt;\r\n \u0026lt;div class=\"col-2\"\u0026gt;Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled\u0026lt;/div\u0026gt;\r\n \u0026lt;/div\u0026gt;\r\n\u0026lt;/div\u0026gt;\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://plnkr.co/edit/jIoaME?p=preview\" rel=\"nofollow noreferrer\"\u003ehttps://plnkr.co/edit/jIoaME?p=preview\u003c/a\u003e\u003c/p\u003e","accepted_answer_id":"44971615","answer_count":"1","comment_count":"2","creation_date":"2017-07-07 10:49:48.56 UTC","last_activity_date":"2017-07-07 20:52:38.377 UTC","last_edit_date":"2017-07-07 20:52:38.377 UTC","last_editor_display_name":"","last_editor_user_id":"1548895","owner_display_name":"","owner_user_id":"557552","post_type_id":"1","score":"2","tags":"css|css3|sass|flexbox|overflow","view_count":"54"} +{"id":"44056690","title":"Order WooCommerce Products by Rating","body":"\u003cp\u003eIn the latest version of Woocommerce API, (the WP REST API v2), the filters have been removed. Earlier I was using the following URL to get products ordered by their \u003ccode\u003eaverage_rating\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eproducts?search=helloWorld\u0026amp;order=desc\u0026amp;filter[orderby]=meta_value_num\u0026amp;filter[orderby_meta_key]=_wc_average_rating\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eNow since filters have been removed, I am struggling to get the same output without using filters. I could not find anyway to order products according to their rating. I am also aware of the \u003ca href=\"https://github.com/WP-API/rest-filter\" rel=\"nofollow noreferrer\"\u003eREST Filter Plugin\u003c/a\u003e but before going forward that direction, I want to make sure if there is an alternative way.\u003c/p\u003e\n\n\u003cp\u003eAny help is highly appreciated.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-05-18 19:53:11.833 UTC","last_activity_date":"2017-07-18 00:51:08.597 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1533368","post_type_id":"1","score":"0","tags":"wordpress|rest|wordpress-rest-api|woocommerce-rest-api","view_count":"119"} +{"id":"3692954","title":"Add custom messages in assert?","body":"\u003cp\u003eIs there a way to add or edit the message thrown by assert? I'd like to use something like \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eassert(a == b, \"A must be equal to B\");\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThen, the compiler adds \u003cem\u003eline\u003c/em\u003e, \u003cem\u003etime\u003c/em\u003e and so on...\u003c/p\u003e\n\n\u003cp\u003eIs it possible?\u003c/p\u003e","accepted_answer_id":"3692961","answer_count":"8","comment_count":"1","creation_date":"2010-09-11 22:39:24.507 UTC","favorite_count":"19","last_activity_date":"2017-05-19 09:32:38.86 UTC","last_edit_date":"2012-01-08 05:45:50.85 UTC","last_editor_display_name":"","last_editor_user_id":"396583","owner_display_name":"","owner_user_id":"444423","post_type_id":"1","score":"82","tags":"c++|assert","view_count":"32621"} +{"id":"8662017","title":"RC0 Denali - Adding BI Time Intelligence - Error: a time dimension is required in order to add time intelligence","body":"\u003cp\u003eCurrently, working with Denali RC0 and unable to add BI Time Intelligence to the cube. I have checked the types of the hierachy (type years) and dimension (type time) and created the Time Dimension via the wizard (defaults).\u003c/p\u003e\n\n\u003cp\u003eI have scoured the web and have had no luck finding any info regarding this issue other than checking the types associated with the dimension and its hierarchies. (I have done this)\u003c/p\u003e\n\n\u003cp\u003eSo, basically, I am unable to add the time intelligence component to my cube. I feel as if i am missing a basic step.\u003c/p\u003e","accepted_answer_id":"8703456","answer_count":"1","comment_count":"0","creation_date":"2011-12-28 22:28:37.897 UTC","last_activity_date":"2015-09-06 19:07:15.467 UTC","last_edit_date":"2015-09-06 19:07:15.467 UTC","last_editor_display_name":"","last_editor_user_id":"3204551","owner_display_name":"","owner_user_id":"1028312","post_type_id":"1","score":"2","tags":"sql|sql-server|ssis|sql-server-2012|ssas","view_count":"106"} +{"id":"14474145","title":"url of second button needs two clicks to return?","body":"\u003cp\u003eMy app has two buttons that each open different webpages.\nEach button references an onClick event and Intent that\ndiffers only in the URL. The main and webview activity are below.\nThe second button, however, requires\ntwo clicks to return to the main view. How can I fix this?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class MainActivity extends Activity {\n\nprivate Button button;\nprivate Button button1;\n\npublic void onCreate(Bundle savedInstanceState) {\n final Context context = this;\n\n super.onCreate(savedInstanceState);\n setContentView(R.layout.main);\n\n button = (Button) findViewById(R.id.buttonUrl);\n button.setOnClickListener(new OnClickListener() {\n\n @Override\n public void onClick(View arg0) {\n\n Intent intent = new Intent(context, WebViewActivity.class);\n intent.putExtra(\"google.com\", \"http://www.google.com\");\n startActivity(intent);\n }\n });\n\n button1 = (Button) findViewById(R.id.button1);\n button1.setOnClickListener(new OnClickListener() {\n\n @Override\n public void onClick(View arg0) {\n\n Intent intent = new Intent(context, WebViewActivity.class); \n intent.putExtra(\"yahoo.com\", \"http://www.yahoo.com\");\n startActivity(intent);\n }\n });\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eWebviewActivity\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class WebViewActivity extends Activity {\n\nprivate WebView webView;\n\npublic void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.webview);\n\n webView = (WebView) findViewById(R.id.webView1);\n webView.getSettings().setJavaScriptEnabled(true);\n\n Bundle extras = getIntent().getExtras();\n if (extras != null){\n String googleUrl = extras.getString(\"google.com\");\n String yahooUrl = extras.getString(\"yahoo.com\");\n if (googleUrl != null)\n webView.loadUrl(\"http://www.google.com\");\n else if (yahooUrl != null)\n webView.loadUrl(\"http://www.yahoo.com\");\n }\n }\n}\n\nmain.xml\n\n\u0026lt;?xml version=\"1.0\" encoding=\"utf-8\"?\u0026gt;\n\u0026lt;LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:layout_width=\"fill_parent\"\n android:layout_height=\"fill_parent\"\n android:orientation=\"vertical\" \u0026gt;\n\n \u0026lt;Button\n android:id=\"@+id/buttonUrl\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:text=\"Go to http://www.google.com\" /\u0026gt;\n \u0026lt;Button\n android:id=\"@+id/button1\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:text=\"Go to http://www.yahoo.com\" /\u0026gt;\n\n\u0026lt;/LinearLayout\u0026gt;\n\nwebview.xml\n\n\u0026lt;?xml version=\"1.0\" encoding=\"utf-8\"?\u0026gt;\n\u0026lt;WebView xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:id=\"@+id/webView1\"\n android:layout_width=\"fill_parent\"\n android:layout_height=\"fill_parent\"\n/\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"2","creation_date":"2013-01-23 07:02:49.22 UTC","last_activity_date":"2013-01-23 07:24:35.713 UTC","last_edit_date":"2013-01-23 07:24:35.713 UTC","last_editor_display_name":"","last_editor_user_id":"2002858","owner_display_name":"","owner_user_id":"2002858","post_type_id":"1","score":"1","tags":"android|android-layout|android-intent","view_count":"192"} +{"id":"19969214","title":"Titanium Studio on Mac Android device not found","body":"\u003cp\u003eI'm on OS 10.9, Titanium 3.1.3.201309132423, Latest and greatest SDK - Nexus 4 on 4.3 with UBS Debugging checked, Unknown sources allowed. If I plug in the device Titanium does not see the device, however under Eclips I can install/debug on the device just fine. I have Googled to my hearts end with no luck... Sooo, any ideas what I could be doing wrong in Titanium?\u003c/p\u003e","accepted_answer_id":"19969884","answer_count":"1","comment_count":"0","creation_date":"2013-11-14 03:51:00.467 UTC","last_activity_date":"2013-11-14 04:58:44.633 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"597737","post_type_id":"1","score":"1","tags":"titanium","view_count":"2636"} +{"id":"8580333","title":"Why the 404 error in my ttf font?","body":"\u003cp\u003eOn my site, I use \u003ca href=\"http://sass-lang.com/\" rel=\"nofollow noreferrer\"\u003eSASS\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI have the following code:\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003e--- Edit ---\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@font-face {\n font-family: 'BauhausBold';\n src: url('/Type/bauhaus_bold.eot');\n src: url('/Type/bauhaus_bold.eot?#iefix') format('embedded-opentype'),\n url('/Type/bauhaus_bold.woff') format('woff'),\n url('/Type/bauhaus_bold.ttf') format('truetype'),\n url('/Type/bauhaus_bold.svg#BauhausBold') format('svg');\n font-weight: normal;\n font-style: normal;\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eTo use this font:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efont-family: quote('bind'), arial;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut we always get the error 404 on my site. See the image:\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/jAhWY.png\" alt=\"Error 404\"\u003e\u003c/p\u003e\n\n\u003cp\u003eFull image: \u003ca href=\"https://i.stack.imgur.com/jAhWY.png\" rel=\"nofollow noreferrer\"\u003ehttp://i.stack.imgur.com/jAhWY.png\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eYou can access the site: \u003ca href=\"http://bindsolution.com\" rel=\"nofollow noreferrer\"\u003ebindsolution.com\u003c/a\u003e if they wish.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eThank you all for your help!\u003c/strong\u003e\u003c/p\u003e","answer_count":"1","comment_count":"5","creation_date":"2011-12-20 18:42:55.027 UTC","last_activity_date":"2016-09-24 21:12:22.44 UTC","last_edit_date":"2011-12-21 10:24:45.273 UTC","last_editor_display_name":"","last_editor_user_id":"491181","owner_display_name":"","owner_user_id":"491181","post_type_id":"1","score":"1","tags":"http-status-code-404|font-face|sass","view_count":"1212"} +{"id":"8736971","title":"Understanding Threading in python: How to tell `run()` to return processed data?","body":"\u003cp\u003eI read up about threading in the \u003ca href=\"http://www.ibm.com/developerworks/aix/library/au-threadingpython/\" rel=\"nofollow\"\u003eIBM developer sources\u003c/a\u003e and found the following example.\u003c/p\u003e\n\n\u003cp\u003eIn general I understand what happens here, except for \u003cstrong\u003eone\u003c/strong\u003e important thing. The work seems to be done in the \u003ccode\u003erun()\u003c/code\u003e function. In this example \u003ccode\u003erun()\u003c/code\u003e only prints a line and signals to the queue, that the job is done.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eWhat if I had to return some processed data? I thought about caching it in a global variable, and to access this one later, but this seems not the right way to go.\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eAny advice?\u003c/p\u003e\n\n\u003cp\u003e\u003cem\u003ePerhaps I should clearify:\u003c/em\u003e My intuition tells me to add \u003ccode\u003ereturn processed_data\u003c/code\u003e to \u003ccode\u003erun()\u003c/code\u003e right after \u003ccode\u003eself.queue.task_done()\u003c/code\u003e, but I can't figure out where to catch that return, since it is not obvious to me where \u003ccode\u003erun()\u003c/code\u003e is called.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e#!/usr/bin/env python\nimport Queue\nimport threading\nimport urllib2\nimport time\n\nhosts = [\"http://yahoo.com\", \"http://google.com\", \"http://amazon.com\",\n\"http://ibm.com\", \"http://apple.com\"]\n\nqueue = Queue.Queue()\n\nclass ThreadUrl(threading.Thread):\n \"\"\"Threaded Url Grab\"\"\"\n def __init__(self, queue):\n threading.Thread.__init__(self)\n self.queue = queue\n\n def run(self):\n while True:\n #grabs host from queue\n host = self.queue.get()\n\n #grabs urls of hosts and prints first 1024 bytes of page\n url = urllib2.urlopen(host)\n print url.read(1024)\n\n #signals to queue job is done\n self.queue.task_done()\n\nstart = time.time()\ndef main():\n\n #spawn a pool of threads, and pass them queue instance \n for i in range(5):\n t = ThreadUrl(queue)\n t.setDaemon(True)\n t.start()\n\n #populate queue with data \n for host in hosts:\n queue.put(host)\n\n #wait on the queue until everything has been processed \n queue.join()\n\nmain()\nprint \"Elapsed Time: %s\" % (time.time() - start)\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"8737536","answer_count":"2","comment_count":"0","creation_date":"2012-01-05 02:44:43.38 UTC","favorite_count":"1","last_activity_date":"2013-11-13 03:02:06.757 UTC","last_edit_date":"2012-01-05 02:53:17.52 UTC","last_editor_display_name":"","last_editor_user_id":"641514","owner_display_name":"","owner_user_id":"641514","post_type_id":"1","score":"0","tags":"python|multithreading|return-value","view_count":"1776"} +{"id":"44746404","title":"cant able to close the window when clicked","body":"\u003cp\u003eI cant able to close the window when clicked ok button in PyQt4 application, i tried a lot but nothing worked, iam posting my code below to your reference. \nplease do help me...thank you\u003c/p\u003e\n\n\u003cp\u003eI cant able to close the window when clicked ok button in PyQt4 application, i tried a lot but nothing worked, iam posting my code below to your reference. \nplease do help me...thank you\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e# -*- coding: utf-8 -*-\n\n# Form implementation generated from reading ui file 'GUIAPP.ui'\n#\n# Created by: PyQt4 UI code generator 4.11.4\n#\n# WARNING! All changes made in this file will be lost!\n\nfrom PyQt4 import QtCore, QtGui\nfrom PyQt4.QtGui import QDialog\n\ntry:\n _fromUtf8 = QtCore.QString.fromUtf8\nexcept AttributeError:\n def _fromUtf8(s):\n return s\n\ntry:\n _encoding = QtGui.QApplication.UnicodeUTF8\n def _translate(context, text, disambig):\n return QtGui.QApplication.translate(context, text, disambig, _encoding)\nexcept AttributeError:\n def _translate(context, text, disambig):\n return QtGui.QApplication.translate(context, text, disambig)\n\nclass Ui_Dialog(object):\n def setupUi(self, Dialog):\n Dialog.setObjectName(_fromUtf8(\"Dialog\"))\n Dialog.resize(400, 300)\n self.label = QtGui.QLabel(Dialog)\n self.label.setGeometry(QtCore.QRect(60, 60, 281, 41))\n font = QtGui.QFont()\n font.setFamily(_fromUtf8(\"Times New Roman\"))\n font.setPointSize(14)\n font.setBold(False)\n font.setWeight(50)\n self.label.setFont(font)\n self.label.setLayoutDirection(QtCore.Qt.RightToLeft)\n self.label.setIndent(0)\n self.label.setObjectName(_fromUtf8(\"label\"))\n self.pushButton = QtGui.QPushButton(Dialog)\n self.pushButton.setGeometry(QtCore.QRect(80, 170, 81, 21))\n self.pushButton.setObjectName(_fromUtf8(\"pushButton\"))\n self.pushButton_2 = QtGui.QPushButton(Dialog)\n self.pushButton_2.setGeometry(QtCore.QRect(240, 170, 81, 23))\n self.pushButton_2.setObjectName(_fromUtf8(\"pushButton_2\"))\n self.pushButton_2.clicked.connect(self.closeEvent)\n\n self.retranslateUi(Dialog)\n QtCore.QMetaObject.connectSlotsByName(Dialog)\n\n def retranslateUi(self, Dialog):\n Dialog.setWindowTitle(_translate(\"Dialog\", \"Dialog\", None))\n self.label.setText(_translate(\"Dialog\", \"DO YOU WANT TO CONTINUE\", None))\n self.pushButton.setText(_translate(\"Dialog\", \"ok\", None))\n self.pushButton_2.setText(_translate(\"Dialog\", \"cancel\", None))\n\n def closeEvent(self):\n self.close()\nif __name__ == \"__main__\":\n import sys\n app = QtGui.QApplication(sys.argv)\n Dialog = QtGui.QDialog()\n ui = Ui_Dialog()\n ui.setupUi(Dialog)\n Dialog.show()\n sys.exit(app.exec_())\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"44751375","answer_count":"1","comment_count":"0","creation_date":"2017-06-25 12:32:03.497 UTC","last_activity_date":"2017-06-25 23:09:41.09 UTC","last_edit_date":"2017-06-25 17:44:47.84 UTC","last_editor_display_name":"","last_editor_user_id":"8078549","owner_display_name":"","owner_user_id":"8086589","post_type_id":"1","score":"0","tags":"python|python-2.7|pyqt|pyqt4|qdialog","view_count":"34"} +{"id":"5549895","title":"ToolstripTextBox customisation","body":"\u003cp\u003eI would like to develop a custom Toolstrip control. The control would be like a ToolStrip but with the following features :\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eThe textbox would be proceeded by a label\u003c/li\u003e\n\u003cli\u003eThe textbox would have two buttons after it.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eI guess to implement this then a user drawn control would be required. Does anyone know of any resources available on the web to get me started on this.\u003c/p\u003e","accepted_answer_id":"5550390","answer_count":"1","comment_count":"3","creation_date":"2011-04-05 09:37:06.12 UTC","last_activity_date":"2011-04-05 11:57:31.713 UTC","last_edit_date":"2011-04-05 11:57:31.713 UTC","last_editor_display_name":"","last_editor_user_id":"366904","owner_display_name":"","owner_user_id":"240218","post_type_id":"1","score":"0","tags":"c#|winforms|user-controls|custom-controls|toolstrip","view_count":"1968"} +{"id":"46532494","title":"Merge rows which have the same date within a data frame","body":"\u003cp\u003eI have a data.frame as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e timestamp index negative positive sentiment\n \u0026lt;dttm\u0026gt; \u0026lt;dbl\u0026gt; \u0026lt;dbl\u0026gt; \u0026lt;dbl\u0026gt; \u0026lt;dbl\u0026gt;\n1 2015-10-29 15:00:10 0 11 10 -1\n2 2015-10-29 17:26:48 0 1 5 4\n3 2015-10-29 17:30:07 0 10 22 12\n4 2015-10-29 20:13:22 0 5 6 1\n5 2015-10-30 14:25:26 0 3 2 -1\n6 2015-10-30 18:22:30 0 14 15 1\n7 2015-10-31 14:16:00 0 10 23 13\n8 2015-11-02 20:30:18 0 14 7 -7\n9 2015-11-03 14:15:00 0 8 26 18\n10 2015-11-03 16:52:30 0 12 34 22\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI would like to know if there is a possibility to merge rows with equal days such that i have a scoring for each day, since I have absolutely no clue how to approach this problem because I dont even know how to unlist each date and write a function which merges only equal dates, because the time differs in each day . I would like to obtain a data.frame which has the following form:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e timestamp index negative positive sentiment \n \u0026lt;dttm\u0026gt; \u0026lt;dbl\u0026gt; \u0026lt;dbl\u0026gt; \u0026lt;dbl\u0026gt; \u0026lt;dbl\u0026gt;\n 1 2015-10-29 0 27 43 16\n 2 2015-10-30 0 3 2 -1\n 3 2015-10-31 0 17 17 0\n 4 2015-11-02 0 14 7 -7\n 5 2015-11-03 0 20 60 40\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIs there any possibility to get around to this result? I would be thankful for any hint.\u003c/p\u003e","accepted_answer_id":"46533057","answer_count":"1","comment_count":"1","creation_date":"2017-10-02 19:33:45.647 UTC","last_activity_date":"2017-10-02 22:53:08.977 UTC","last_edit_date":"2017-10-02 22:53:08.977 UTC","last_editor_display_name":"","last_editor_user_id":"3817004","owner_display_name":"","owner_user_id":"7152726","post_type_id":"1","score":"-1","tags":"r|date|aggregate","view_count":"31"} +{"id":"24863639","title":"pull userId from DB with email and store user ID in session","body":"\u003cp\u003eSo here is my code for the login page for my site, I want it to pull the user ID from the DB when the user logs in and store it in the session data. WHich I will be using in another page to pull a value from a different table.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\nsession_start();\n//Connect to DB\ninclude_once 'db_connect.php';\n\n// escape variables for security\n$Email = mysqli_real_escape_string($mysqli, $_POST['email']);\n$Password = mysqli_real_escape_string($mysqli, $_POST['password']);\n//password hashing\n$Password = hash(\"sha256\", $Password);\n\n$sqli=\"SELECT * FROM users WHERE Email='$Email' and Password='$Password'\";\n$result=mysqli_query($mysqli, $sqli);\n\n//Mysql_num_row is counting table row\n$count=mysqli_num_rows($result);\n\n\n\n// If result matched $Email and $Password, table row must be 1 row\nif($count==1){\n\n//redirect to file \"menu.html\"\n\nheader(\"location:menu.html\");\n}\n//If all else fails they shall not pass!\nelse {\necho \"Wrong Email or Password. YOU SHALL NOT PASS!\";\n}\n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"24863741","answer_count":"3","comment_count":"4","creation_date":"2014-07-21 11:09:07.833 UTC","last_activity_date":"2014-07-21 11:37:54.9 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3845071","post_type_id":"1","score":"0","tags":"php|mysql","view_count":"477"} +{"id":"12609815","title":"Remove some info such as softlinks from the rpm packages on Linux","body":"\u003cp\u003eHere is a situation that I am currently dealing with.\u003c/p\u003e\n\n\u003cp\u003eI provide a rpm package that contains both 32-bit and 64-bit application and can be installed on both modes i.e. on both 64-bit and 32-bit platforms.\u003c/p\u003e\n\n\u003cp\u003eAs the package contains both applications so, when trying to install the rpm package on 32-bit only Linux machine. It creates soft links for 64-bit application too along with 32-bit application. And during post-install I remove the soft-links for 64-bit application as we can not install it on a 32-bit machine.\u003c/p\u003e\n\n\u003cp\u003eNow, The issue arises, as the package is already installed on 32-bit machine and I have removed the soft-links for 64-bit application as a part of post-install but the rpm still contains info for these 64-bit application soft-links and could be seen when queried through the rpm command but in reality these should not be.\u003c/p\u003e\n\n\u003cp\u003eSo, any one has some idea to query through rpm and remove the extra info for a 32-bit application. And this should be done during installation of the 32-bit package may be in post-install.\u003c/p\u003e\n\n\u003cp\u003eAny help/idea will be appreciated.\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2012-09-26 20:26:31.337 UTC","last_activity_date":"2012-10-02 22:26:53.27 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1701433","post_type_id":"1","score":"1","tags":"rpm|rpmbuild|rpm-spec","view_count":"117"} +{"id":"9826048","title":"How could i parse out and count up distinct list in Excel?","body":"\u003cp\u003eI have an excel column that looks like this:\u003c/p\u003e\n\n\u003cp\u003ePerson 1, Person 2\u003cbr\u003e\nPerson 3\u003cbr\u003e\nPerson 4\u003cbr\u003e\nPerson 5\u003cbr\u003e\nPerson 1\nPerson 1, Person 4\u003c/p\u003e\n\n\u003cp\u003eSo in each cell, there is either a single person or a list of people. I want to count these up to be able to generate a count of each person like this from the structure above\u003c/p\u003e\n\n\u003cp\u003ePerson 1: 3\u003cbr\u003e\nPerson 2: 1\u003cbr\u003e\nPerson 3: 1\u003cbr\u003e\nPerson 4: 2\u003cbr\u003e\nPerson 5: 1 \u003c/p\u003e\n\n\u003cp\u003eIs there any good way of doing this in VBA?\u003c/p\u003e","accepted_answer_id":"9826834","answer_count":"3","comment_count":"2","creation_date":"2012-03-22 16:01:26.487 UTC","last_activity_date":"2012-03-22 16:53:40.133 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4653","post_type_id":"1","score":"-1","tags":"excel|list|vba","view_count":"385"} +{"id":"8850081","title":"Get php sub array from html input name","body":"\u003cp\u003eI have an input :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;input name=\"subscription[login]\" /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm creating a function that take an array (\u003ccode\u003e$_POST\u003c/code\u003e for the example) and the html name (\u003ccode\u003esubscription[login]\u003c/code\u003e).\u003c/p\u003e\n\n\u003cp\u003eIt should return me a reference to \u003ccode\u003e$_POST['subscripton']['login']\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eSo i made :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic static function \u0026amp;getSubArrayRefFromPath($arr, $arrPath) {\n if(!is_array($arrPath)) {\n throw new Exception('$arrPath is not an array');\n }\n else {\n $el = $arr;\n\n foreach($arrPath as $k) {\n $el \u0026amp;= $el[$k];\n }\n\n return $el;\n }\n}\n\npublic static function \u0026amp;getSubArrayRefFromHtmlPath($arr, $htmlPath) {\n $regex = '#^([a-z]+)(?:\\[([a-z]+)\\]){2}(\\[\\])?$#i';\n\n preg_match($regex, $htmlPath, $rawKeys);\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut i can't retrieve all the values with the regex :\u003c/p\u003e\n\n\u003cp\u003ei get this in rawKeys :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003earray\n 0 =\u0026gt; string 'abc[def][ghi]' (length=13)\n 1 =\u0026gt; string 'abc' (length=3)\n 2 =\u0026gt; string 'ghi' (length=3)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm probably missing something..\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2012-01-13 11:46:39.2 UTC","last_activity_date":"2014-02-28 01:35:07.54 UTC","last_edit_date":"2012-01-13 15:02:33.3 UTC","last_editor_display_name":"","last_editor_user_id":"1143495","owner_display_name":"","owner_user_id":"894097","post_type_id":"1","score":"0","tags":"php|html|regex","view_count":"461"} +{"id":"32953228","title":"git \"expected shallow list\" error when shallow had tested as true","body":"\u003cp\u003eI have a repo that, when tested on Travis, consistently gives an error like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e$ if [[ -a .git/shallow ]]; then git fetch --unshallow; fi\nfatal: git fetch-pack: expected shallow list\nThe command \"if [[ -a .git/shallow ]]; then git fetch --unshallow; fi\" failed and exited with 128 during .\nYour build has been stopped.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eYou can see \u003ca href=\"https://travis-ci.org/JuliaGraphics/Immerse.jl/builds/83426931\" rel=\"nofollow\"\u003ean example here\u003c/a\u003e, although it's possible that link requires authorization.\u003c/p\u003e\n\n\u003cp\u003eWhat I find strange about this that it seems the \u003ccode\u003egit fetch --unshallow\u003c/code\u003e should run only if it's already determined that it is shallow. I should add that I've used this construct in many other repositories and never had a problem.\u003c/p\u003e\n\n\u003cp\u003eOn my local machine, the contents of \u003ccode\u003e.git\u003c/code\u003e are:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emyrepo.git$ ls -a\n. branches config FETCH_HEAD HEAD index logs ORIG_HEAD \n.. COMMIT_EDITMSG description gitk.cache hooks info objects refs\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"1","creation_date":"2015-10-05 16:19:45.393 UTC","last_activity_date":"2016-08-10 14:17:17.48 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1939814","post_type_id":"1","score":"2","tags":"travis-ci","view_count":"602"} +{"id":"4481951","title":"IntelliJ IDEA JDK configuration on Mac OS","body":"\u003cp\u003eI am using IntelliJ IDEA 10. Every time when I create a new project, it is asking me to choose JDK for this project. Anyone know how I can configure it and make it easy to use?\u003c/p\u003e","accepted_answer_id":"4482827","answer_count":"4","comment_count":"2","creation_date":"2010-12-19 06:53:22.937 UTC","favorite_count":"35","last_activity_date":"2017-11-16 23:35:29.527 UTC","last_edit_date":"2014-11-26 19:06:09.627 UTC","last_editor_display_name":"","last_editor_user_id":"3885376","owner_display_name":"","owner_user_id":"435645","post_type_id":"1","score":"97","tags":"osx|intellij-idea","view_count":"103667"} +{"id":"40222418","title":"Angular 2 save data in services","body":"\u003cp\u003eI have a set of sub components, all get a part of data from one other component. They only get data they need to display. Now I want to implement and service which requesting an server. For the request I needs an id that is saved in the main component. I do not want to give each sub component the id, so I try to save it in the service, where it is needed.\u003c/p\u003e\n\n\u003cp\u003eBut if I call the service from an sub component the value is not set. How could I save the id global and make it reachable for the service?\u003c/p\u003e","accepted_answer_id":"40222502","answer_count":"1","comment_count":"0","creation_date":"2016-10-24 15:43:37.733 UTC","last_activity_date":"2016-10-24 15:51:20.85 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6565711","post_type_id":"1","score":"0","tags":"angular|angular2-services","view_count":"1238"} +{"id":"44583980","title":"how to fix NoReverseMatch at? work if you not authorized","body":"\u003cblockquote\u003e\n \u003cp\u003eIf you are not authorized, then everything will work fine, as soon as\n you authorize, for example, adeline, this error will be issued, I do\n not know what happened!\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eNoReverseMatch at /series/Colony/Season_1/Episode_1/\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eReverse for 'post_of_serie' with no arguments not found. 1 pattern(s) tried: ['series/(?P\u0026lt;serial_slug\u0026gt;[\\\\w-]+)/(?P\u0026lt;season_slug\u0026gt;[\\\\w-]+)/(?P\u0026lt;series_slug\u0026gt;[\\\\w-]+)/$']\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003emain urls.py\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efrom django.conf.urls import include, url\nfrom django.contrib import admin\nfrom django.conf import settings\nfrom django.conf.urls.static import static\n\nurlpatterns = [\n url(r'^admin/', admin.site.urls),\n\n url(r'^series/', include(\"serials.urls\", namespace='series')),\n url(r'^', include(\"serials.urls\", namespace='homeview')),\n\n\n\n]+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)\nstatic(settings.STATIC_URL, document_root=settings.STATIC_ROOT)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003esecond urls.py to app(series)\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efrom django.conf.urls import include, url\nfrom .views import homeview, post_of_serial, post_of_season, post_of_serie, validate_email, mark_and_unmark_this_episode\n\nurlpatterns = [\n url(r'^$', homeview, name='homeview'),\n url(r'^subscribe/$', validate_email, name='subscribe'), # /series/\n url(r'^mark_or_unmark_this_episode/$', mark_and_unmark_this_episode, name=\"mark_and_unmark_this_episode\"),\n url(r'^(?P\u0026lt;serial_slug\u0026gt;[\\w-]+)/$', post_of_serial, name='post_of_serial'), # /series/Prison_Break/\n url(r'^(?P\u0026lt;serial_slug\u0026gt;[\\w-]+)/(?P\u0026lt;season_slug\u0026gt;[\\w-]+)/$', post_of_season, name='post_of_season'), # /series/Prison_Break/season_5/\n url(r'^(?P\u0026lt;serial_slug\u0026gt;[\\w-]+)/(?P\u0026lt;season_slug\u0026gt;[\\w-]+)/(?P\u0026lt;series_slug\u0026gt;[\\w-]+)/$', post_of_serie, name='post_of_serie'), # /series/Prison_Break/season_5/2/ \n]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eerror \u003ca href=\"https://i.stack.imgur.com/66a2h.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/66a2h.png\" alt=\"ERROR\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003ethis is part of view.py\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef post_of_serie(request, serial_slug=None, season_slug=None, series_slug=None):\n serie = get_object_or_404(Series, serial_of_this_series__slug=serial_slug, season_of_this_series__slug=season_slug, slug=series_slug)\n #print(serie)\n title = serie.serial_of_this_series.rus_name_of_seriall\n full_path = All_Images_Of_The_Series.objects.filter(to_series__serial_of_this_series__slug=serial_slug, to_series__season_of_this_series__slug=season_slug, to_series__slug=series_slug, is_poster=True)\n\n context = {\"serie\":serie, \"full_path\":full_path, \"title\":title,}\n try:\n userr = request.user \n check_button = watched_series.objects.filter(user=request.user, watched_serial__slug=serial_slug, watched_serie__season_of_this_series__slug=season_slug, watched_serie__slug=series_slug )\n context[\"check_button\"] = check_button\n context[\"userr\"] = userr\n except:\n pass\n\n\n return render(request, 'series.html', context)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eif delete somethig in views.py nothing change!!!\u003c/p\u003e\n\n\u003cp\u003emain html\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{% load staticfiles %}\n\n\u0026lt;!DOCTYPE html\u0026gt;\n\u0026lt;html lang=\"en\"\u0026gt;\n \u0026lt;head\u0026gt;\n \u0026lt;meta charset=\"utf-8\"\u0026gt;\n \u0026lt;meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"\u0026gt;\n \u0026lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"\u0026gt;\n \u0026lt;!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --\u0026gt;\n \u0026lt;title\u0026gt;{{ title }}\u0026lt;/title\u0026gt;\n\n \u0026lt;!-- Bootstrap --\u0026gt;\n \u0026lt;link href=\"{% static \"css/bootstrap.min.css\"%}\" rel=\"stylesheet\"\u0026gt;\n \u0026lt;link href=\"{% static \"css/footer.css\"%}\" rel=\"stylesheet\"\u0026gt;\n \u0026lt;link href=\"{% static \"css/main.css\"%}\" rel=\"stylesheet\"\u0026gt;\n {% block styles %}{% endblock styles %}\n\n\n \u0026lt;/head\u0026gt;\n \u0026lt;body\u0026gt;\n \u0026lt;a href=\"{{ advertise_for_header.link_for_advertise }}\"\u0026gt;\u0026lt;div class=\"advertises\" \u0026gt;\u0026lt;/div\u0026gt;\u0026lt;/a\u0026gt;\n \u0026lt;div class=\"wrapper\"\u0026gt;\n \u0026lt;div class=\"wrapper-content\"\u0026gt;\n {% include \"navbar.html\" %}\n {% block content %}\n {% endblock content %}\n \u0026lt;/div\u0026gt;\n {% include \"footer.html\" %}\n \u0026lt;/div\u0026gt;\n\n \u0026lt;script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.js\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;script src=\"{% static \"js/bootstrap.min.js\"%}\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;script src=\"{% static \"js/smooth-scroll.js\"%}\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;script src=\"{% static \"js/script.js\" %}\"\u0026gt;\u0026lt;/script\u0026gt;\n\n \u0026lt;/body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eseries.html where is up error!\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{% extends \"base.html\" %}\n{% load staticfiles %}\n\n{% block content %}\n \u0026lt;div class=\"container\"\u0026gt;\n \u0026lt;div class=\"row\"\u0026gt;\n \u0026lt;div class=\"col-sm-8 her\"\u0026gt;\n \u0026lt;span class=\"links\" \u0026gt;\n \u0026lt;a class=\"a-link\" href=\"{{ serie.serial_of_this_series.get_absolute_url }}\"\u0026gt;{{ serie.serial_of_this_series.rus_name_of_seriall }} \u0026lt;img src=\"{% static \"img/breadcrumbs-arrow.png\" %}\" class=\"arrow\" \u0026gt; \u0026lt;/a\u0026gt;\n\n \u0026lt;a class=\"a-link\" href=\"{{ serie.season_of_this_series.get_absolute_url }}\"\u0026gt;{{ serie.season_of_this_series.name_of_the_season }}\u0026lt;img src=\"{% static \"img/breadcrumbs-arrow.png\" %}\" class=\"arrow\" \u0026gt;\u0026lt;/a\u0026gt;\n\n \u0026lt;a class=\"a-link\" href=\"{{ serie.get_absolute_url }}\"\u0026gt;{{ serie.rus_name }}\u0026lt;img src=\"{% static \"img/breadcrumbs-arrow.png\" %}\" class=\"arrow\" \u0026gt;\u0026lt;/a\u0026gt;\n \u0026lt;/span\u0026gt;\n\n \u0026lt;div class=\"title-block\" \u0026gt;\n \u0026lt;h3 class=\"seria-header\"\u0026gt;\n \u0026lt;img src=\"{{ serie.serial_of_this_series.preview_of_serial.url }}\" class=\"thumb\"\u0026gt;\n \u0026lt;span class=\"titles\" \u0026gt;\n \u0026lt;div class=\"title-ru\"\u0026gt;{{ serie.rus_name }}\u0026lt;/div\u0026gt;\n \u0026lt;div class=\"title-en\"\u0026gt;{{ serie.eng_name }}\u0026lt;/div\u0026gt;\n \u0026lt;/span\u0026gt;\n \u0026lt;/h3\u0026gt;\n {% if user.is_authenticated %}\n \u0026lt;form class=\"watch_button\" method=\"POST\" action=\"{% url 'series:post_of_serie' %}\" \u0026gt; {% csrf_token %}\n \u0026lt;div class=\"buttons\" \u0026gt;\n \u0026lt;div class=\"second_section_of_buttons\" \u0026gt;\n {% if check_button %}\n \u0026lt;div class=\"isawthat-btn checcked\" title=\"Серия просмотрена. Убрать пометку?\" \u0026gt;\u0026lt;img src=\"{% static \"img/white-eye-icon.png\" %}\" class=\"iccon\"/\u0026gt;\u0026lt;span class=\"text_button\" \u0026gt;Серия просмотрена\u0026lt;/span\u0026gt;\u0026lt;/div\u0026gt;\n {% else %}\n \u0026lt;div class=\"isawthat-btn\" title=\"Пометить серию как просмотренную\" \u0026gt;\u0026lt;img src=\"{% static \"img/pink-eye-icon.png\" %}\" class=\"iccon\"/\u0026gt;\u0026lt;span class=\"text_button\" \u0026gt;Серия Не просмотрена\u0026lt;/span\u0026gt;\u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n {% endif %}\n \u0026lt;/div\u0026gt;\n \u0026lt;p class=\"user hidden\" \u0026gt;{{ userr }}\u0026lt;/p\u0026gt;\n \u0026lt;p class=\"watched_serial hidden\" \u0026gt;{{ serie.serial_of_this_series }}\u0026lt;/p\u0026gt;\n \u0026lt;p class=\"watched_serie hidden\" \u0026gt;{{ serie }}\u0026lt;/p\u0026gt;\n \u0026lt;p class=\"minutes_of_series hidden\" \u0026gt;{{ serie }}\u0026lt;/p\u0026gt;\n \u0026lt;p class=\"serial_slug hidden\" \u0026gt; {{ serie.serial_of_this_series.slug }} \u0026lt;/p\u0026gt;\n \u0026lt;p class=\"season_slug hidden\" \u0026gt; {{ serie.season_of_this_series.slug }} \u0026lt;/p\u0026gt;\n \u0026lt;p class=\"series_slug hidden\" \u0026gt; {{ serie.slug }} \u0026lt;/p\u0026gt;\n \u0026lt;/form\u0026gt;\n {% endif %}\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n\n \u0026lt;div class=\"col-sm-3\"\u0026gt;\n\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n\n \u0026lt;/div\u0026gt;\n\n{% endblock content %}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"44584149","answer_count":"1","comment_count":"2","creation_date":"2017-06-16 08:02:33.463 UTC","last_activity_date":"2017-06-16 08:28:06.237 UTC","last_edit_date":"2017-06-16 08:23:08.82 UTC","last_editor_display_name":"","last_editor_user_id":"8113566","owner_display_name":"","owner_user_id":"8113566","post_type_id":"1","score":"0","tags":"django|view|django-views|url-routing","view_count":"45"} +{"id":"34354358","title":"Spring predicate jpa query issue","body":"\u003cp\u003eI am written a predicate query to concat firstname and lastname and compare with entered character.But, I am not able to get the desired result.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eQUser user = QUser.suer;\nBooleanExpression exp = user.isNotNull();\nString received = \"Jack Jones\"\nexpression = expression.and((userProfile.firstName.toLowerCase().concat(\" \" + userProfile.lastName.toLowerCase())).like('%'+(received)+'%'));\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am not getting the record with Jack Joneas when I type in front end. What is need to be done to resolve issue.\u003c/p\u003e","accepted_answer_id":"34433854","answer_count":"1","comment_count":"3","creation_date":"2015-12-18 11:14:11.713 UTC","last_activity_date":"2015-12-23 10:43:16.59 UTC","last_edit_date":"2015-12-18 11:26:35.47 UTC","last_editor_display_name":"","last_editor_user_id":"4231911","owner_display_name":"","owner_user_id":"4231911","post_type_id":"1","score":"0","tags":"java|mysql|spring-data|querydsl","view_count":"121"} +{"id":"34193804","title":"Missing files after VSTS Migration with Opshub","body":"\u003cp\u003eI just completed a migration using OpsHub Visual Studio Online Migration Utility and it completed 'successfully'.\u003c/p\u003e\n\n\u003cp\u003eWe tested our CI builds and they failed due to missing files, we have compared the source TFS to the target VSTS and found that there are files missing in VSTS.\u003c/p\u003e\n\n\u003cp\u003eWe are using version v2.0.0.002 of the migration utility.\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2015-12-10 04:40:55.05 UTC","last_activity_date":"2016-01-18 14:17:24.763 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5662271","post_type_id":"1","score":"0","tags":"opshub","view_count":"78"} +{"id":"13204062","title":"Assembly Code- Loop","body":"\u003cp\u003eI know there is a loop here, but I can't figure out what is going on. To be more precise, what is going on in the first three lines?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e0x08048d45 \u0026lt;phase_2+42\u0026gt;: lea -0x14(%ebp),%ebx\n0x08048d48 \u0026lt;phase_2+45\u0026gt;: mov -0x8(%ebx),%eax\n0x08048d4b \u0026lt;phase_2+48\u0026gt;: add -0x4(%ebx),%eax\n0x08048d4e \u0026lt;phase_2+51\u0026gt;: cmp %eax,(%ebx) //compare register values\n0x08048d50 \u0026lt;phase_2+53\u0026gt;: je 0x8048d57 \u0026lt;phase_2+60\u0026gt; // if true, jump to 0x08048d57\n0x08048d52 \u0026lt;phase_2+55\u0026gt;: call 0x8049155 \u0026lt;func\u0026gt; //calls func otherwise\n0x08048d57 \u0026lt;phase_2+60\u0026gt;: add $0x4,%ebx //add 4 to ebx\n0x08048d5a \u0026lt;phase_2+63\u0026gt;: lea -0x4(%ebp),%eax\n0x08048d5d \u0026lt;phase_2+66\u0026gt;: cmp %eax,%ebx //compare register values\n0x08048d5f \u0026lt;phase_2+68\u0026gt;: jne 0x8048d48 \u0026lt;phase_2+45\u0026gt; // if true, jump to 0x08048d48 \n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"13204330","answer_count":"2","comment_count":"0","creation_date":"2012-11-02 22:46:57.37 UTC","last_activity_date":"2013-06-18 12:29:34.94 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1721457","post_type_id":"1","score":"0","tags":"assembly|x86|disassembly","view_count":"584"} +{"id":"37800465","title":"Firebase suddenly stopped working, using Anonymous Auth","body":"\u003cp\u003ei have set up firebase storage for my app, and added the code for anonymous auth on the app and on the firebase console.\u003c/p\u003e\n\n\u003cp\u003eit worked at first, but i dont know why it stopped working, saying that the user does not have permission to access the object\u003c/p\u003e\n\n\u003cp\u003eAnonymous auth is correctly set up and i did see it working, code is almost like Google Firebase docs\u003c/p\u003e\n\n\u003cp\u003elogcat:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eD/FirebaseAuth: signInAnonymously:onComplete:true\u003cbr\u003e\n D/FirebaseAuth:\n onAuthStateChanged:signed_in: (Random auth user id)\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003e... When i request the item from firebase\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eE/StorageUtil: error getting token java.util.concurrent.ExecutionException: com.google.firebase.FirebaseException: An internal error has occured. [Internal error encountered.] \n I/DpmTcmClient: RegisterTcmMonitor\n from: com.android.okhttp.TcmIdleTimerMonitor W/NetworkRequest: no auth\n token for request E/StorageException: StorageException has occurred.\n User does not have permission to access this object.\n Code: -13021 HttpResult: 403\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eCan Someone help?\u003c/p\u003e\n\n\u003cp\u003eDeclaring Variables\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate FirebaseAuth mAuth;\nprivate FirebaseAuth.AuthStateListener mAuthListener;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eon the OnCreate method\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003emAuthListener = new FirebaseAuth.AuthStateListener() {\n @Override\n public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {\n FirebaseUser user = firebaseAuth.getCurrentUser();\n if (user != null) {\n // User is signed in\n Log.d(\"FirebaseAuth\", \"onAuthStateChanged:signed_in:\" + user.getUid());\n } else {\n // User is signed out\n Log.d(\"FirebaseAuth\", \"onAuthStateChanged:signed_out\");\n }\n // ...\n }\n };\n mAuth.signInAnonymously()\n .addOnCompleteListener(this, new OnCompleteListener\u0026lt;AuthResult\u0026gt;() {\n @Override\n public void onComplete(@NonNull Task\u0026lt;AuthResult\u0026gt; task) {\n Log.d(\"FirebaseAuth\", \"signInAnonymously:onComplete:\" + task.isSuccessful());\n\n // If sign in fails, display a message to the user. If sign in succeeds\n // the auth state listener will be notified and logic to handle the\n // signed in user can be handled in the listener.\n if (!task.isSuccessful()) {\n Log.w(\"FirebaseAuth\", \"signInAnonymously\", task.getException());\n Toast.makeText(SingleMemeEditor.this, \"Authentication failed.\",\n Toast.LENGTH_SHORT).show();\n }\n\n // ...\n }\n });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand the method that gets from storage:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Bitmap bmp;\n final Context lContext = context; //getting the MainActivity Context\n final String lFileName = fileName; //filename to download\n final String lCatPath = catPath; //internal categorization folder\n\n FirebaseStorage storage = FirebaseStorage.getInstance();\n // Create a storage reference from our app\n StorageReference storageRef = storage.getReferenceFromUrl(context.getResources().getString(R.string.firebase_bucket));\n // Create a reference with an initial file path and name\n StorageReference filesRef = storageRef.child(\"files/\" + fileName);\n try\n {\n final File localFile = File.createTempFile(\"images\", \"jpg\");\n\n filesRef.getFile(localFile).addOnSuccessListener(new OnSuccessListener\u0026lt;FileDownloadTask.TaskSnapshot\u0026gt;()\n {\n @Override\n public void onSuccess(FileDownloadTask.TaskSnapshot taskSnapshot)\n {\n // Local temp file has been created\n File file = new File(getDirectory(lContext)\n + File.separator + lCatPath + File.separator + lFileName);\n try\n {\n Boolean b = file.createNewFile();\n if(b)\n {\n FileInputStream in = new FileInputStream(localFile);\n FileOutputStream out = new FileOutputStream(file);\n\n // Transfer bytes from in to out\n byte[] buf = new byte[(int)localFile.length()];\n int len;\n while ((len = in.read(buf)) \u0026gt; 0) {\n out.write(buf, 0, len);\n }\n in.close();\n out.close();\n }\n Drawable.createFromPath(file.getPath())).getBitmap());\n }\n catch (IOException ex)\n {\n // Handle any errors\n Log.e(\"CopyingFromTemp\", ex.getMessage());\n }\n\n }\n }).addOnFailureListener(new OnFailureListener()\n {\n @Override\n public void onFailure(@NonNull Exception ex)\n {\n // Handle any errors\n Log.e(\"FirebaseDownloadError\", ex.getMessage());\n }\n });\n }\n catch(Exception ex)\n {\n Log.e(\"FirebaseDownloadError\", ex.getMessage());\n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ealso i'm using standard security rules:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ematch /{allPaths=**} {\n allow read, write: if request.auth != null;\n }\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"37811112","answer_count":"3","comment_count":"4","creation_date":"2016-06-13 23:01:36.317 UTC","favorite_count":"1","last_activity_date":"2016-07-10 14:21:37.96 UTC","last_edit_date":"2016-06-14 01:20:25.733 UTC","last_editor_display_name":"","last_editor_user_id":"4027870","owner_display_name":"","owner_user_id":"4027870","post_type_id":"1","score":"4","tags":"android|firebase|firebase-storage","view_count":"3464"} +{"id":"22145745","title":"Regex for django api","body":"\u003cp\u003eI want to use following urls in my api, using a single \u003ccode\u003eregex\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eThe urls I needed are \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etestapi/type1/ \n\ntestapi/type2/ \n\ntestapi/type2/subtype1/ \n\ntestapi/type2/subtype2/ \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe regex now I use:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e(r'^testapi/(?P\u0026lt;type\u0026gt;type1|type2|type3)/(?P\u0026lt;subtype\u0026gt;.*)/$', my_handler),\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow the issue is not page not fond for urls like \u003ccode\u003emyapi/type1/\u003c/code\u003e [urls doesn't have subtype]\u003c/p\u003e\n\n\u003cp\u003eWhat is the best solution\u003c/p\u003e","accepted_answer_id":"22146152","answer_count":"3","comment_count":"1","creation_date":"2014-03-03 11:35:20.597 UTC","last_activity_date":"2014-03-04 09:05:23.793 UTC","last_edit_date":"2014-03-03 11:39:11.883 UTC","last_editor_display_name":"","last_editor_user_id":"2746474","owner_display_name":"","owner_user_id":"658976","post_type_id":"1","score":"0","tags":"python|regex|django-urls","view_count":"73"} +{"id":"28605193","title":"MYSQL Select first rows after specified","body":"\u003cp\u003eI have table with positions of car (from gps tracker) and I want to select positions of start and end of drive. So I should select first row where speed \u003e0 and last where speed was \u003e0 with specific date (day). How can I do this?\u003c/p\u003e\n\n\u003cp\u003eFor example I have table with values:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e+------+-------+---------------------+\n| id | speed | date |\n+------+-------+---------------------+\n| 1 | 0 | 2015-02-03 10:00:00 |\n| 2 | 10 | 2015-02-03 10:00:10 |\n| 3 | 50 | 2015-02-03 10:00:20 |\n| 4 | 100 | 2015-02-03 10:00:30 |\n| 5 | 50 | 2015-02-03 10:01:00 |\n| 6 | 0 | 2015-02-03 10:01:10 |\n| 7 | 10 | 2015-02-03 12:00:10 |\n| 8 | 50 | 2015-02-03 12:00:20 |\n| 9 | 100 | 2015-02-03 12:00:30 |\n| 10 | 50 | 2015-02-03 12:01:00 |\n| 11 | 0 | 2015-02-03 12:01:10 |\n+------+-------+---------------------+\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd I need to select records with ids: 2,5,7,11\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eThis is the full list of columns : id (identity), car_id,altitude,latitude,longitude,speed,date\u003c/p\u003e\n\n\u003cp\u003eI need to calculate each track distance. (one car may drive many times in 1 day - it can drive from 6 am to 10 am, then stop on parking from 10 am to 1 pm and then again drive from 1pm to 5 pm.) So first I need to \"detect\" start and stop of driving (car also send data to database when it keeps on parking (speed=0) ),then calculate distance using something like this \u003ca href=\"https://stackoverflow.com/questions/3986556/distance-calculations-in-mysql-queries\"\u003edistance calculations in mysql queries\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eThis is the database from \u003ca href=\"http://www.traccar.org/\" rel=\"nofollow noreferrer\"\u003ehttp://www.traccar.org/\u003c/a\u003e project.\u003c/p\u003e","answer_count":"2","comment_count":"2","creation_date":"2015-02-19 11:28:31.243 UTC","last_activity_date":"2015-02-19 15:54:32.313 UTC","last_edit_date":"2017-05-23 11:43:51.717 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"1762186","post_type_id":"1","score":"0","tags":"mysql|rows","view_count":"215"} +{"id":"14990773","title":"updating user session from backend requests","body":"\u003cp\u003eI have an app that stores the user data in the session. Whenever I make changes to the user on the back end, I have to remember to also update the session data. This is fine except when I make changes to the user that aren't initiated by his actions. Then I don't have access to his request and therefore no access to his session. This means that the user won't see the updates to his user record and even worse, if he makes a change to the user record before the session is updated he could wipe out changes made by the system. \u003c/p\u003e\n\n\u003cp\u003eMy only solution is that I pull from the datastore instead of the session when saving changes. This way I will never overwrite good data with outdated data. \u003c/p\u003e\n\n\u003cp\u003eSimple example if stackoverflow was coded like my site:\u003c/p\u003e\n\n\u003cp\u003eUser reputation number is stored in the session, if someone upvotes one of their answers their reputation in the datastore increases, but this doesn't propagate to the session. The user could now update their about field and wipe out the reputation they just gained. \u003c/p\u003e\n\n\u003cp\u003eHope this all makes sense, feel free to ask for any details I might have missed. \u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2013-02-20 22:01:50.247 UTC","last_activity_date":"2013-02-20 22:33:04.793 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"190629","post_type_id":"1","score":"0","tags":"java|google-app-engine|session","view_count":"76"} +{"id":"25289103","title":"Duplicating Questions in a userform through the push of a button","body":"\u003cp\u003eI have created a userform through Execl VBA and on the userform I currently have a frame (ID: Frame1) and within this frame I have a question:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e 1) How many dogs do you have\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut the problem is, I want to have a button underneath the question (still within the frame) that will allow me to duplicate the frame and the question within the frame below the existing frame. I have searched high and low for information on this and I can't seem to obtain it from anywhere.\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2014-08-13 14:38:59.707 UTC","last_activity_date":"2014-08-13 15:31:03.01 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3538102","post_type_id":"1","score":"0","tags":"vba|excel-vba","view_count":"36"} +{"id":"39771046","title":"Lambda as typename parameter","body":"\u003cp\u003eSo I have the following code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eenum class UnitType { yearType, monthType, dayType };\n\nstruct NoValidation {\n void operator()(int x) const {}\n};\n\ntemplate \u0026lt;UnitType U, typename Validator=NoValidation\u0026gt;\nclass Unit {\n public:\n explicit Unit(int v) : value(v) {\n Validator()(v);\n }\n int query() const { return value; }\n private:\n int value;\n};\n\nauto validateYear = [](int x){\n if(x \u0026lt; 0)\n throw std::invalid_argument(\"Year is negative\");\n};\n\nusing Year = Unit\u0026lt;UnitType::yearType,decltype(validateYear)\u0026gt;;\nusing Month = Unit\u0026lt;UnitType::monthType\u0026gt;;\nusing Day = Unit\u0026lt;UnitType::dayType\u0026gt;;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe declaration of Month and Day works fine, but Year does not.\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eerror: no matching constructor for initialization of '(lambda\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eIs there any way that I could modify this code to work with lambdas? Without passing the lambda as a parameter to the constructor, just as a template parameter. In theory a lambda is just syntactic sugar for a Functor, so why doesn't this work?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEdit\u003c/strong\u003e\nI'd like to open this issue so that @Yakk can post his solution directly too my question.\u003c/p\u003e","answer_count":"0","comment_count":"5","creation_date":"2016-09-29 12:59:35.247 UTC","last_activity_date":"2016-09-29 23:23:37.677 UTC","last_edit_date":"2016-09-29 13:13:13.457 UTC","last_editor_display_name":"","last_editor_user_id":"359825","owner_display_name":"","owner_user_id":"359825","post_type_id":"1","score":"0","tags":"c++|lambda|c++14|clang++","view_count":"97"} +{"id":"47155926","title":"ConstraintLayout margins","body":"\u003cp\u003eI have a simple layout.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?xml version=\"1.0\" encoding=\"utf-8\"?\u0026gt;\n\u0026lt;android.support.constraint.ConstraintLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\"\n android:background=\"@color/colorDarkGray\"\u0026gt;\n\n\n \u0026lt;RelativeLayout\n android:id=\"@+id/container3\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_marginBottom=\"8dp\"\n android:layout_marginStart=\"8dp\"\n android:layout_marginLeft=\"8dp\"\n android:layout_marginRight=\"8dp\"\n android:layout_marginEnd=\"8dp\"\n android:layout_marginTop=\"8dp\"\n app:layout_constraintBottom_toBottomOf=\"parent\"\n app:layout_constraintStart_toStartOf=\"parent\"\n app:layout_constraintEnd_toEndOf=\"parent\"\n app:layout_constraintTop_toTopOf=\"parent\"\u0026gt;\n\n \u0026lt;TextView\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_centerVertical=\"true\"\n android:alpha=\"0.7\"\n android:fontFamily=\"sans-serif\"\n android:letterSpacing=\"0.03\"\n android:text=\"Another text\"\n android:textColor=\"@color/colorWhite\"\n android:textSize=\"11sp\"\n android:textStyle=\"normal\" /\u0026gt;\n\n \u0026lt;TextView\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_alignParentRight=\"true\"\n android:layout_centerVertical=\"true\"\n android:fontFamily=\"sans-serif\"\n android:letterSpacing=\"0.03\"\n android:text=\"Some text\"\n android:textColor=\"@color/colorWhite\"\n android:textSize=\"11sp\"\n android:textStyle=\"normal\" /\u0026gt;\n \u0026lt;/RelativeLayout\u0026gt;\n\u0026lt;/android.support.constraint.ConstraintLayout\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn design view, it looks so \u003ca href=\"https://i.stack.imgur.com/zRw6h.png\" rel=\"nofollow noreferrer\"\u003e\u003cimg src=\"https://i.stack.imgur.com/zRw6h.png\" alt=\"looks so\"\u003e\u003c/a\u003e\nAs you can see there is no left and right margins. Top and bottom margins work well. If I remove left or right margin my relative layout moves beyond the screen a bit.\nGuess I can do it without a relative layout at all, BUT I'm interested why that happened.\u003c/p\u003e","accepted_answer_id":"47156131","answer_count":"3","comment_count":"2","creation_date":"2017-11-07 10:44:16.21 UTC","last_activity_date":"2017-11-07 12:15:42.473 UTC","last_edit_date":"2017-11-07 11:04:04.157 UTC","last_editor_display_name":"","last_editor_user_id":"2649012","owner_display_name":"","owner_user_id":"4182946","post_type_id":"1","score":"1","tags":"android|android-constraintlayout","view_count":"89"} +{"id":"29097051","title":"Reload web page when mobile device wakes from sleep","body":"\u003cp\u003eI have created a countdown clock that works with Javascript/HTML/PHP/MySQL.\u003c/p\u003e\n\n\u003cp\u003eAs soon as you click \"Start Countdown\", the epoch time is stored in the database and the countdown starts.\u003c/p\u003e\n\n\u003cp\u003eWhen you reload the page, it goes to the database, fetches the epoch time the countdown started, compares it with the time the page was reloaded and calculates the remaining time. Then the JS kicks in and continues the countdown correctly without starting from the start. For example:\u003c/p\u003e\n\n\u003cp\u003eI set the countdown time to 100 seconds.\u003c/p\u003e\n\n\u003cp\u003eI click: Start countdown\u003c/p\u003e\n\n\u003cp\u003e100, 99, 98, 97, 96...\u003c/p\u003e\n\n\u003cp\u003eI reload the page (lets say it takes 2 seconds to load)\u003c/p\u003e\n\n\u003cp\u003eIt continues counting down from where it should be: 94, 93, 92, 91 ... 0\u003c/p\u003e\n\n\u003cp\u003eThis works perfectly on every web browser (Yes, even Internet Explorer), but i have a problem with mobile devices: When a mobile device sleeps the countdown stops (i assume that its like closing the browser on a PC), and when i wake it up it continues counting from where i left it instead from where i left it minus the total seconds the device was sleeping.\u003c/p\u003e\n\n\u003cp\u003eMy question is: Is there an event in JavaScript/Jquery that will fire as soon as a mobile device wakes up?\u003c/p\u003e\n\n\u003cp\u003eChecking online i found this : \u003ca href=\"https://stackoverflow.com/questions/13798516/javascript-event-for-mobile-browser-re-launch-or-device-wake\"\u003eJavascript event for mobile browser re-launch or device wake\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eIts a nice solution but it will contact the server every X seconds (in this case 5 seconds) when the user is at the page. This will cause a lot of traffic at the page and i want to prevent it. [Please correct me if i am wrong].\u003c/p\u003e\n\n\u003cp\u003eAny solution will be much appreciated!\u003c/p\u003e","accepted_answer_id":"29097131","answer_count":"1","comment_count":"0","creation_date":"2015-03-17 10:44:11.083 UTC","favorite_count":"1","last_activity_date":"2015-03-17 10:48:11.49 UTC","last_edit_date":"2017-05-23 12:23:04.047 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"3185108","post_type_id":"1","score":"1","tags":"javascript|android|jquery|ajax","view_count":"463"} +{"id":"4659186","title":"TreeView.Items.Filter Memory Leak, HELP!","body":"\u003cp\u003eI'm having this terrible problem, i have a tree view and i'm using the it's Items.Filter to support search options. \u003c/p\u003e\n\n\u003cp\u003eMy TreeView is also virtualized cuase it contains tones of items and if not virtualized it takes a minute for the UI to load.\u003c/p\u003e\n\n\u003cp\u003eMy problem is that whenever i set a filter it seems that the memory usage grows by 20M!!!\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eI don't understand why the ListBox won't use the items it already has and why it needs to create new items (i see calls to the child item's constructors)\u003c/li\u003e\n\u003cli\u003eWhy the hell won't it release the old UI elements from the memory?!\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003ePLEASE HELP!!!\nGili\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2011-01-11 15:22:28.637 UTC","last_activity_date":"2011-01-11 15:28:16.343 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"359417","post_type_id":"1","score":"0","tags":"wpf|memory-leaks|listbox|virtualization","view_count":"304"} +{"id":"44791076","title":"Face detection confidence value","body":"\u003cp\u003eThe legacy implementation of face detection\u003c/p\u003e\n\n\u003cp\u003e(\u003ccode\u003eandroid.media.FaceDetector.Face\u003c/code\u003e)\u003c/p\u003e\n\n\u003cp\u003eHas a confidence attribute: \u003ccode\u003econfidence()\u003c/code\u003e\n // Returns a confidence factor between 0 and 1.\u003c/p\u003e\n\n\u003cp\u003eWhereas the new version doesn't seem to provide this.\u003c/p\u003e\n\n\u003cp\u003e(\u003ccode\u003ecom.google.android.gms.vision.face.Face\u003c/code\u003e)\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003e\u003cem\u003eIs anyone aware if an internal confidence value (without computing one myself) is available in the new API?\u003c/em\u003e\u003c/strong\u003e\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-06-27 22:44:03.627 UTC","last_activity_date":"2017-06-27 22:44:03.627 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2202359","post_type_id":"1","score":"0","tags":"face-detection|google-vision|android-vision","view_count":"129"} +{"id":"35478541","title":"Can I use a resource (resx) file as an \"Embedded Resource\" *as well as* as \"Content\"?","body":"\u003cp\u003eI have a resx file in the App_GlobalResources folder of my ASP.NET web application.\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003cp\u003eIts build property must be set to \"Content\", so that the file is automatically included during publishing and I can use \u003ccode\u003e\u0026lt;%$ Resources: ... %\u0026gt;\u003c/code\u003e expressions.\u003c/p\u003e\u003c/li\u003e\n\u003cli\u003e\u003cp\u003eIts build property must be set to \"Embedded Resource\", \u003ca href=\"https://stackoverflow.com/q/4153748/87698\"\u003eso that my unit tests can access the resources\u003c/a\u003e.\u003c/p\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eIs there some trick that I can use to have both?\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp\u003eNote: The solutions in the linked question won't work, since \u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003emocking HttpContext won't give the unit test access to non-embedded resources, and \u003c/li\u003e\n\u003cli\u003emoving the resources out of App_GlobalResources breaks \u003ccode\u003e\u0026lt;%$ Resources: ... %\u0026gt;\u003c/code\u003e support after deployment.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eIs there any solution that I have missed?\u003c/p\u003e","accepted_answer_id":"38009543","answer_count":"1","comment_count":"0","creation_date":"2016-02-18 10:13:57.703 UTC","last_activity_date":"2016-06-24 09:07:35.803 UTC","last_edit_date":"2017-05-23 12:22:42.603 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"87698","post_type_id":"1","score":"2","tags":"c#|asp.net|unit-testing|resx|app-globalresources","view_count":"471"} +{"id":"18957764","title":"Submitting list of items with removed first one deletes all items","body":"\u003cp\u003ei have a model that has a list of sub items in it , something like this : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass MyObj {\n public string Name {get;set;}\n public List\u0026lt;mySubObject\u0026gt; Items {get;set;} \n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass mySubObject { \n public string Name {get;set;}\n public int Order {get;set;}\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow, when i render the list with a for loop and editorFor, the html i get is somethign like this : \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;input type=\"text\" name=\"Items[0].Name\"\u0026gt;\n\u0026lt;input type=\"Number\" name=\"Items[0].Order\"\u0026gt;\n\u0026lt;input type=\"text\" name=\"Items[1].Name\"\u0026gt;\n\u0026lt;input type=\"number\" name=\"Items[1].Order\"\u0026gt;\n...\n\u0026lt;input type=\"text\" name=\"Items[9].Name\"\u0026gt;\n\u0026lt;input type=\"number\" name=\"Items[9].Order\"\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow imagine remove the first element from the HTML via jQuery because i no longer want it in my list, and then save the list. The data that goes back is without the first \u003ccode\u003e[0]\u003c/code\u003e element\nand all the elements from 1 to 9 go to the server but the model binding fails and it displays (on the server) that the list of items is \u003ccode\u003enull\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eWhat am i doing wrong ? \u003c/p\u003e\n\n\u003cp\u003eIs this a bug of the default model binder ? \u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-09-23 11:09:23.44 UTC","last_activity_date":"2013-09-23 11:18:19.917 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"122765","post_type_id":"1","score":"0","tags":"forms|asp.net-mvc-4|defaultmodelbinder","view_count":"296"} +{"id":"45146500","title":"Passing variable to Json API and showing response with ng-repeat","body":"\u003cp\u003eI'm pretty new to AngularJS. I have two tables, one has a list of people that need interviews\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e// From vol.xslt\n\u0026lt;section id=\"requested_interviews\" class=\"row\"\u0026gt;\n\u0026lt;h3\u0026gt;Unassigned Requests\u0026lt;/h3\u0026gt;\n\u0026lt;div class=\"table-responsive\"\u0026gt;\n \u0026lt;table id=\"unassigned_table\" class=\"table table-condensed\"\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;th\u0026gt;Requested\u0026lt;/th\u0026gt;\n \u0026lt;th\u0026gt;First\u0026lt;/th\u0026gt;\n \u0026lt;th\u0026gt;Last\u0026lt;/th\u0026gt;\n \u0026lt;th\u0026gt;City\u0026lt;/th\u0026gt;\n \u0026lt;th\u0026gt;Region\u0026lt;/th\u0026gt;\n \u0026lt;th\u0026gt;Zip\u0026lt;/th\u0026gt;\n \u0026lt;th\u0026gt;Country\u0026lt;/th\u0026gt;\n \u0026lt;th\u0026gt;Action\u0026lt;/th\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr ng-repeat=\"p in prospects\"\u0026gt;\n \u0026lt;td\u0026gt;{{ p.Requested }}\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;{{ p.First }}\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;{{ p.Last }}\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;{{ p.City }}\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;{{ p.Region }}\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;{{ p.Zip }}\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;{{ p.Country }}\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\n \u0026lt;button class=\"btn btn-small btn-default btn-block\" ng-click=\"haversine( {{{{p.lat}}}}, {{{{p.lng}}}} )\"\u0026gt;Find Matches\u0026lt;/button\u0026gt;\n \u0026lt;button class=\"btn btn-small btn-default btn-block\" ng-click=\"viewProspectDetais()\"\u0026gt;Prospect Details\u0026lt;/button\u0026gt;\n \u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;/table\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003c/p\u003e\n\n\u003cp\u003eWhen the user clicks the Find Matches button, the haversine function is called, which passes the latitude and longitude of the person into it, and the api responds with volunteers in that person's area:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e// From controller\n// Volunteer enpoint\n$scope.haversine = function(lat, lng) {\n $http.get(-- redact api url --).then(function(response) {\n $scope.volunteers = response.data.row;\n });\n};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow, when the function is triggered, it should update the view, and I think that's what I am having trouble with:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e// From vol.xslt\n\u0026lt;section id=\"potential_volunteers\" class=\"row\"\u0026gt;\n\u0026lt;h3\u0026gt;Potential Volunteers\u0026lt;/h3\u0026gt;\n\u0026lt;table class=\"table table-hover table-condensed\"\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;th\u0026gt;First\u0026lt;/th\u0026gt;\n \u0026lt;th\u0026gt;Last\u0026lt;/th\u0026gt;\n \u0026lt;th\u0026gt;Street\u0026lt;/th\u0026gt;\n \u0026lt;th\u0026gt;Street 2\u0026lt;/th\u0026gt;\n \u0026lt;th\u0026gt;Street 3\u0026lt;/th\u0026gt;\n \u0026lt;th\u0026gt;City\u0026lt;/th\u0026gt;\n \u0026lt;th\u0026gt;Region\u0026lt;/th\u0026gt;\n \u0026lt;th\u0026gt;Zip\u0026lt;/th\u0026gt;\n \u0026lt;th\u0026gt;Country\u0026lt;/th\u0026gt;\n \u0026lt;th\u0026gt;Action\u0026lt;/th\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr ng-repeat=\"v in volunteers\"\u0026gt;\n \u0026lt;td\u0026gt;{{ v.First }}\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;{{ v.Last }}\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;{{ v.Street_1 }}\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;{{ v.Street_2 }}\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;{{ v.Street_3 }}\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;{{ v.City }}\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;{{ v.Region }}\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;{{ v.Postal }}\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;{{ v.Country }}\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;\n \u0026lt;button class=\"btn btn-small btn-default btn-block\" ng-href=\"assignInterview()\"\u0026gt;Assign\u0026lt;/button\u0026gt;\n \u0026lt;button class=\"btn btn-small btn-default btn-block\" ng-href=\"viewVolDetails()\"\u0026gt;Volunteer Details\u0026lt;/button\u0026gt;\n \u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n\u0026lt;/table\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003c/p\u003e\n\n\u003cp\u003eI've verified that the endpoint works, and that my variables are showing up correctly within the button (XSLT requires my to use double braces for angular variables).\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2017-07-17 14:09:04.283 UTC","last_activity_date":"2017-07-17 14:32:36.607 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7064758","post_type_id":"1","score":"0","tags":"javascript|angularjs|json|xslt","view_count":"20"} +{"id":"47142216","title":"Xcode 9.1 : module compiled with Swift 4.0 cannot be imported in Swift 3.2.2","body":"\u003cp\u003eI updated xCode from 9.0.1 to 9.1. Everything was ok before, but now, I have this error when I try to build my project (with Carthage) :\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003emodule compiled with Swift 4.0 cannot be imported in Swift 3.2.2\u003c/code\u003e (or 4.0.2 for SWIFT 4 users)\u003c/p\u003e\n\n\u003cp\u003eDon't need to let you know the module because it doesn't depend on it (because when I comment the import line concerned, the mistake his misplaced to the next import, so for another module).\u003c/p\u003e\n\n\u003cp\u003eI tried everything I saw : \u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eClean the project\u003c/li\u003e\n\u003cli\u003eClean the Carthage folder\u003c/li\u003e\n\u003cli\u003eClean Derived Data folder:\u003cbr\u003e\n\u003ccode\u003erm -rf ~/Library/Caches/org.carthage.CarthageKit/DerivedData\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003eUpdate with Carthage: \u003ccode\u003ecarthage update --platform iOS\u003c/code\u003e (with or not \u003ccode\u003e--no-use-binaries\u003c/code\u003e)\u003c/li\u003e\n\u003cli\u003eUpdate Modules\u003c/li\u003e\n\u003cli\u003eBuild again\u003c/li\u003e\n\u003cli\u003eClose and Reopen Xcode\u003c/li\u003e\n\u003cli\u003epray \u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eCarthage (0.26.2) and MacOS (High Sierra) are up to date.\u003c/p\u003e\n\n\u003cp\u003eSo, my last supposition (as I can read) is that Xcode 9.1 not allow us to use modules not build with Xcode 9.1. So I can come back to Xcode 9.0.1 but I will unable to deliver my project to Xcode 9.1 users. I cannot imagine to wait the update of all the modules. So do you have an idea, please ?\u003c/p\u003e\n\n\u003cp\u003eThanks you !\u003c/p\u003e","answer_count":"1","comment_count":"6","creation_date":"2017-11-06 17:08:52.977 UTC","favorite_count":"1","last_activity_date":"2017-11-12 12:53:05.21 UTC","last_edit_date":"2017-11-07 14:02:13.4 UTC","last_editor_display_name":"","last_editor_user_id":"3968157","owner_display_name":"","owner_user_id":"3968157","post_type_id":"1","score":"1","tags":"ios|swift|xcode|swift4|xcode9.1","view_count":"1001"} +{"id":"28372282","title":"How can i get mod_rewrite and .htaccess working with cakephp?","body":"\u003cp\u003eI'm trying to get cakephp working locally on my mac - yosemite. I have apache and php working locally in my /~user/Sites directory... I can hit a php ini file ok and have an install of wordpress in another directory.\u003c/p\u003e\n\n\u003cp\u003eI've hooked it all up apart from getting the urls rewriting... I followed the steps on the cake site: \u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://book.cakephp.org/2.0/en/installation/url-rewriting.html\" rel=\"nofollow\"\u003ehttp://book.cakephp.org/2.0/en/installation/url-rewriting.html\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eNow all I get is 404 not found!.\u003c/p\u003e\n\n\u003cp\u003eThe three .htaccess files have the default content with an additional RewriteBase pointing to the folder its installed in, in my Sites folder.\u003c/p\u003e\n\n\u003cp\u003eAny ideas what I'm doing wrong? I've read the other posts on this and none of them helped!\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-02-06 18:21:13.127 UTC","last_activity_date":"2015-02-06 18:26:32.653 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4538389","post_type_id":"1","score":"0","tags":".htaccess|cakephp|mod-rewrite","view_count":"75"} +{"id":"43907820","title":"git error for Windows 10: \"Unable to determine absolute path of git directory\"","body":"\u003cp\u003eI am starting to get the following error from git after I switch to Winodows 10 recently. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003egit submodule -q update --init --recursive: Unable to determine absolute path of git directory\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eDoes anyone know what this error means and how to fix it?\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2017-05-11 06:13:49.153 UTC","last_activity_date":"2017-05-16 02:03:44.073 UTC","last_edit_date":"2017-05-16 02:03:44.073 UTC","last_editor_display_name":"","last_editor_user_id":"3034990","owner_display_name":"","owner_user_id":"3034990","post_type_id":"1","score":"0","tags":"git|windows-10|git-submodules","view_count":"41"} +{"id":"39532027","title":"Xcode 8 importing StoreKit.framework cause error while archiving","body":"\u003cp\u003ein my app I imported \u003ccode\u003eTune.framework\u003c/code\u003e for monitoring install, updates and other custom event. Now I have upgraded from Xcode7 to Xcode8 and I need to import \u003ccode\u003eStoreKit.framework\u003c/code\u003e which causes the enablement of \u003ccode\u003eIn-app purchase\u003c/code\u003e capabilities.\u003c/p\u003e\n\n\u003cp\u003eSo far, so good... the problem came when I try to archive the app with my In-house provisioning (i.e. an enterprise distribution) and I receive the error \u003cstrong\u003eProvisioning profile \"xxx-InHouse\" doesn't support the In-App Purchase capability.\nCode signing is required for product type 'Application' in SDK 'iOS 10.0'\u003c/strong\u003e.\u003c/p\u003e\n\n\u003cp\u003eThis provisioning is a wild card app Id, so I can enable the In-app purchase on app Id and I'm stuck.\u003c/p\u003e\n\n\u003cp\u003eIdeas? \u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-09-16 12:53:32.54 UTC","last_activity_date":"2016-10-13 13:37:05.697 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1006113","post_type_id":"1","score":"1","tags":"ios|xcode|in-app-purchase|ios10|xcode8","view_count":"345"} +{"id":"18263611","title":"multiple dialogs in primefaces","body":"\u003cp\u003eI have a table with two dialogs, one to delete and other to add new accounts.\nWhen I click on both buttons allways one dialog is displayed.\nWhat I am doing wrong?\nHere is my front end the code\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;ui:composition template=\"/WEB-INF/templates/default.xhtml\"\nxmlns:ui=\"http://java.sun.com/jsf/facelets\"\nxmlns:h=\"http://java.sun.com/jsf/html\"\u0026gt;\n\n\u0026lt;ui:param name=\"hideHeaderAndFooter\" value=\"false\" /\u0026gt;\n\u0026lt;ui:param name=\"navigationAndMain\" value=\"false\" /\u0026gt;\n\u0026lt;ui:param name=\"login\" value=\"false\" /\u0026gt;\n\n\u0026lt;ui:define name=\"mainContent\"\u0026gt;\n \u0026lt;div xmlns=\"http://www.w3.org/1999/xhtml\"\n xmlns:f=\"http://java.sun.com/jsf/core\"\n xmlns:p=\"http://primefaces.org/ui\"\u0026gt;\n \u0026lt;h:form id=\"form\"\u0026gt;\n \u0026lt;p:growl id=\"messages\" showDetail=\"true\" /\u0026gt;\n \u0026lt;p:growl id=\"growl\" showDetail=\"true\" /\u0026gt;\n \u0026lt;p:growl id=\"messageyesno\" /\u0026gt;\n \u0026lt;p:growl id=\"messageadd\" /\u0026gt;\n\n \u0026lt;p:dataTable var=\"account\"\n value=\"#{accountManagedBeanTran.accountDataModel}\"\n sortMode=\"multiple\" paginator=\"true\" rows=\"10\"\n paginatorTemplate=\"{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}\"\n rowsPerPageTemplate=\"5,10,15\" editable=\"true\"\n resizableColumns=\"true\" draggableColumns=\"true\"\n selection=\"#{accountManagedBeanTran.selectedAccounts}\"\u0026gt;\n\n \u0026lt;f:facet name=\"header\"\u0026gt;List of Users\u0026lt;/f:facet\u0026gt;\n\n \u0026lt;p:ajax event=\"rowEdit\" listener=\"#{accountManagedBeanTran.onEdit}\"\n update=\":form:messages\"\u0026gt;\u0026lt;/p:ajax\u0026gt;\n \u0026lt;p:ajax event=\"rowEditCancel\"\n listener=\"#{accountManagedBeanTran.onCancel}\"\n update=\":form:messages\"\u0026gt;\u0026lt;/p:ajax\u0026gt;\n \u0026lt;p:ajax event=\"colResize\" update=\":form:growl\"\n listener=\"#{accountManagedBeanTran.onResize}\"\u0026gt;\u0026lt;/p:ajax\u0026gt;\n\n \u0026lt;p:column selectionMode=\"multiple\" style=\"width:2%\" /\u0026gt;\n\n \u0026lt;p:column sortBy=\"#{account.username}\" headerText=\"User Name\"\n filterBy=\"#{account.username}\" filterMatchMode=\"contains\"\n style=\"width:30%\"\u0026gt;\n\n \u0026lt;p:cellEditor\u0026gt;\n \u0026lt;f:facet name=\"output\"\u0026gt;\n \u0026lt;h:outputText value=\"#{account.username}\" /\u0026gt;\n \u0026lt;/f:facet\u0026gt;\n \u0026lt;f:facet name=\"input\"\u0026gt;\n \u0026lt;p:inputText value=\"#{account.username}\" style=\"width:100%\" /\u0026gt;\n \u0026lt;/f:facet\u0026gt;\n \u0026lt;/p:cellEditor\u0026gt;\n\n \u0026lt;/p:column\u0026gt;\n\n \u0026lt;p:column sortBy=\"#{account.firstName}\" headerText=\"First Name\"\n filterBy=\"#{account.firstName}\" filterMatchMode=\"contains\"\n style=\"width:20%\"\u0026gt;\n \u0026lt;p:cellEditor\u0026gt;\n \u0026lt;f:facet name=\"output\"\u0026gt;\n \u0026lt;h:outputText value=\"#{account.firstName}\" /\u0026gt;\n \u0026lt;/f:facet\u0026gt;\n \u0026lt;f:facet name=\"input\"\u0026gt;\n \u0026lt;p:inputText value=\"#{account.firstName}\" style=\"width:100%\"\n label=\"First Name\" /\u0026gt;\n \u0026lt;/f:facet\u0026gt;\n \u0026lt;/p:cellEditor\u0026gt;\n \u0026lt;/p:column\u0026gt;\n\n \u0026lt;p:column sortBy=\"#{account.lastName}\" headerText=\"Surname\"\n filterBy=\"#{account.lastName}\" filterMatchMode=\"contains\"\u0026gt;\n \u0026lt;p:cellEditor\u0026gt;\n \u0026lt;f:facet name=\"output\"\u0026gt;\n \u0026lt;h:outputText value=\"#{account.lastName}\" /\u0026gt;\n \u0026lt;/f:facet\u0026gt;\n \u0026lt;f:facet name=\"input\"\u0026gt;\n \u0026lt;p:inputText value=\"#{account.lastName}\" style=\"width:100%\"\n label=\"Last Name\" /\u0026gt;\n \u0026lt;/f:facet\u0026gt;\n \u0026lt;/p:cellEditor\u0026gt;\n \u0026lt;/p:column\u0026gt;\n\n \u0026lt;p:column sortBy=\"#{account.email}\" headerText=\"Email\"\n filterBy=\"#{account.email}\" filterMatchMode=\"contains\"\u0026gt;\n \u0026lt;p:cellEditor\u0026gt;\n \u0026lt;f:facet name=\"output\"\u0026gt;\n \u0026lt;h:outputText value=\"#{account.email}\" /\u0026gt;\n \u0026lt;/f:facet\u0026gt;\n \u0026lt;f:facet name=\"input\"\u0026gt;\n \u0026lt;p:inputText value=\"#{account.email}\" style=\"width:100%\"\n label=\"Email\" /\u0026gt;\n \u0026lt;/f:facet\u0026gt;\n \u0026lt;/p:cellEditor\u0026gt;\n \u0026lt;/p:column\u0026gt;\n\n \u0026lt;p:column style=\"width:6%\"\u0026gt;\n \u0026lt;p:rowEditor /\u0026gt;\n \u0026lt;/p:column\u0026gt;\n\n \u0026lt;f:facet name=\"footer\"\u0026gt;\n\n \u0026lt;div\u0026gt;\n\n \u0026lt;p:commandButton id=\"delete\" value=\"Delete\"\n onclick=\"confirmation.show()\" type=\"button\" /\u0026gt;\n\n \u0026lt;p:confirmDialog id=\"deleteConfirmDialog\" message=\"Queres borrar el usuario?\"\n showEffect=\"drop\" hideEffect=\"drop\"\n header=\"Delete\" severity=\"alert\"\n widgetVar=\"confirmation\" modal=\"true\"\u0026gt;\n\n \u0026lt;p:commandButton value=\"Yes\" update=\":form:messageyesno\"\n oncomplete=\"confirmation.hide()\"\n actionListener=\"#{accountManagedBeanTran.onDelete}\" /\u0026gt;\n \u0026lt;p:commandButton value=\"Not\" onclick=\"confirmation.hide()\"\n type=\"button\" /\u0026gt;\n\n \u0026lt;/p:confirmDialog\u0026gt;\n\n \u0026lt;p:commandButton id=\"add\" value=\"Add\"\n onclick=\"confirmation.show()\" type=\"button\" /\u0026gt;\n\n \u0026lt;p:confirmDialog id=\"addConfirmDialog\" message=\"Queres agregar un usuario?\"\n showEffect=\"drop\" hideEffect=\"drop\"\n header=\"Add\" severity=\"alert\"\n widgetVar=\"confirmation\" modal=\"true\"\u0026gt;\n\n \u0026lt;h:form id=\"messageAddForm\"\u0026gt;\n \u0026lt;h:panelGrid columns=\"2\" style=\"margin-bottom:10px\"\u0026gt;\n \u0026lt;h:outputLabel for=\"username\" value=\"User Name:\" /\u0026gt;\n \u0026lt;p:inputText id=\"unsername\" value=\"#{accountManagedBeanTran.newAccount.username}\" /\u0026gt;\n \u0026lt;h:outputLabel for=\"password\" value=\"Password:\" /\u0026gt;\n \u0026lt;p:inputText id=\"password\" value=\"#{accountManagedBeanTran.newAccount.password}\" /\u0026gt;\n \u0026lt;h:outputLabel for=\"firstName\" value=\"First Name\" /\u0026gt;\n \u0026lt;p:inputText id=\"firstName\" value=\"#{accountManagedBeanTran.newAccount.firstName}\" /\u0026gt;\n \u0026lt;h:outputLabel for=\"lastName\" value=\"Surname\" /\u0026gt;\n \u0026lt;p:inputText id=\"lastName\" value=\"#{accountManagedBeanTran.newAccount.lastName}\" /\u0026gt;\n \u0026lt;h:outputLabel for=\"email\" value=\"Email\" /\u0026gt;\n \u0026lt;p:inputText id=\"email\" value=\"#{accountManagedBeanTran.newAccount.email}\" /\u0026gt;\n \u0026lt;h:outputText value=\"Enabled:\" /\u0026gt; \n \u0026lt;p:selectBooleanCheckbox value=\"#{accountManagedBeanTran.newAccount.enabled}\" /\u0026gt; \n \u0026lt;/h:panelGrid\u0026gt; \n \u0026lt;/h:form\u0026gt;\n\n \u0026lt;p:commandButton value=\"Save\" update=\":form:messageadd\"\n oncomplete=\"confirmation.hide()\"\n actionListener=\"#{accountManagedBeanTran.onCreate}\" /\u0026gt;\n \u0026lt;p:commandButton value=\"Cancel\" onclick=\"confirmation.hide()\"\n type=\"button\" /\u0026gt;\n\n \u0026lt;/p:confirmDialog\u0026gt;\n \u0026lt;/div\u0026gt;\n\n \u0026lt;/f:facet\u0026gt;\n\n \u0026lt;/p:dataTable\u0026gt;\n \u0026lt;/h:form\u0026gt;\n \u0026lt;/div\u0026gt;\n\u0026lt;/ui:define\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003c/p\u003e\n\n\u003cp\u003eThanks in advance.\u003c/p\u003e","accepted_answer_id":"18264101","answer_count":"1","comment_count":"0","creation_date":"2013-08-15 23:32:52.907 UTC","last_activity_date":"2013-08-16 00:41:21.34 UTC","last_edit_date":"2013-08-15 23:35:23.143 UTC","last_editor_display_name":"","last_editor_user_id":"157882","owner_display_name":"","owner_user_id":"2217011","post_type_id":"1","score":"1","tags":"jsf|primefaces","view_count":"3943"} +{"id":"24543653","title":"Executing Shrink on SQL Server database using command from linq-to-sql","body":"\u003cp\u003eI'm looking for a way to clear transaction logs; in particular, I want to shrink the logs. I know there are bad reasons for wanting to do it but in this instance, it's for a good reason.\u003c/p\u003e\n\n\u003cp\u003eI've run this in SQL Server Management:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eDBCC SHRINKFILE(DBName_log)\nDBCC SHRINKFILE(DBName)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThat does what I need. Now I want to execute this command from code using Linq-To-SQL, something like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eusing (MyDC TheDC = new MyDC())\n{\n TheDC.ExecuteCommand(....);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat command do I need to send to get both these actions executed in the database?\u003c/p\u003e\n\n\u003cp\u003eThanks.\u003c/p\u003e","accepted_answer_id":"24543743","answer_count":"1","comment_count":"0","creation_date":"2014-07-03 01:36:10.733 UTC","last_activity_date":"2014-07-03 01:49:37.403 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"565968","post_type_id":"1","score":"0","tags":"c#|sql-server|linq-to-sql","view_count":"1278"} +{"id":"32442662","title":"Update query string parameter from admin javascript","body":"\u003cp\u003eI am trying to make an admin panel and I have to edit user's details (parse.com) from this panel. \nAfter many searches on google I succeded to display the user's firstname and lastname. I made another function with query.first() but I can edit only the first user, what should I do to can edit second user or third ? \nHere is my code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;!DOCTYPE html\u0026gt;\n\u0026lt;html\u0026gt;\n\u0026lt;head\u0026gt;\n \u0026lt;script type=\"text/javascript\" src=\"js/parse-1.5.0.js\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;script src=\"https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;script src=\"https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;script type=\"text/javascript\" src=\"js/main.js\"\u0026gt;\u0026lt;/script\u0026gt;\n\u0026lt;/head\u0026gt;\n\u0026lt;body ng-app=\"demo\"\u0026gt;\n \u0026lt;div class=\"container\" ng-controller=\"adminPannel\"\u0026gt;\n \u0026lt;table class=\"table table-striped\"\u0026gt;\n \u0026lt;thead\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;th\u0026gt;Username\u0026lt;/th\u0026gt;\n \u0026lt;th\u0026gt;First Name\u0026lt;/th\u0026gt;\n \u0026lt;th\u0026gt;Last Name\u0026lt;/th\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;/thead\u0026gt;\n \u0026lt;tbody\u0026gt;\u0026lt;tr ng-repeat=\"user in users\"\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;button class=\"btn\" ng-click=\"editUser()\"\u0026gt;\u0026lt;/button\u0026gt;\u0026lt;input type=\"text\" id=\"frstName\" ng-value=\"Firstname\" ng-model=\"firstNameCh\"/\u0026gt;\u0026lt;input type=\"text\" id=\"lstName\" ng-value=\"Lastname\" ng-model=\"lastNameCh\"/\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;{{ user.firstname }}\u0026lt;/td\u0026gt;\n \u0026lt;td\u0026gt;{{ user.lastname }}\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;/tbody\u0026gt;\n \u0026lt;/table\u0026gt;\n \u0026lt;/div\u0026gt;\n\u0026lt;/body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand js:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar app=angular.module('demo',[]);\napp.controller('adminPannel',['$scope',function($scope) {\n$scope.users=[];\n\nParse.initialize(\"WnaPPAytzCE8AR7NNGENpVGMGQ6pQ9wH2LKRQ6wE\", \"2qfXZunNrQPnCgNuusPpbGCDmbRBzo7CG4X0edDF\");\n$scope.use=Parse.User.current();\nvar noname2=Parse.Object.extend(\"noname2\");\nvar query=new Parse.Query(noname2);\n//query.equalTo(\"uname\",$scope.use.get('username'));\nquery.find({\n success:function(results) {\n alert(\"success\");\n alert(results.length);\n for(var i=0;i\u0026lt;results.length;i++)\n {\n var object= results[i];\n\n $scope.users.push({'firstname':object.get('firstname') , 'lastname':object.get('lastname') ,'age':object.get('age')});\n\n }\n $scope.$apply();\n },\n error:function(error) {\n alert(\"error:\"+ error.code +\" \"+error.message);\n }\n});\n$scope.editUser = function(){\n var query = new Parse.Query(noname2);\n query.first({\n success:function(noname2){\n noname2.save(null,{\n success:function(nm2){\n nm2.set('firstname', $('#frstName').val());\n nm2.set('lastname', $('#lstName').val());\n nm2.save();\n location.reload();\n }\n });\n },\n error:function(error){\n alert('error' + error.code + ' ' + error.message);\n }\n });\n}\n}]);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI don't know what should I change in my editUser function.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-09-07 16:13:47.003 UTC","last_activity_date":"2015-09-07 16:18:02.523 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5288751","post_type_id":"1","score":"0","tags":"javascript|string|parsing|parse.com","view_count":"76"} +{"id":"37154335","title":"case expression to change the value of a column","body":"\u003cp\u003eI have two columns are \u003ccode\u003emeasurement_unit\u003c/code\u003e and \u003ccode\u003emeasurement_size\u003c/code\u003e.The values in \u003ccode\u003emeasurement_unit\u003c/code\u003e column are \u003ccode\u003eml,gm,litre\u003c/code\u003e.And \u003ccode\u003emeasurement_size\u003c/code\u003e has the values \u003ccode\u003e200,1300,2000\u003c/code\u003ei have converted all values of \u003ccode\u003emeasurement_size\u003c/code\u003e to round figure such as \u003ccode\u003e.2,1.3,2\u003c/code\u003e now i want to change the values of \u003ccode\u003emeasurement_unit\u003c/code\u003e to \u003ccode\u003eliter\u003c/code\u003e or \u003ccode\u003ekg\u003c/code\u003e and here is my case expression .But it is not working..what should i do?In addition it is not a update query i am doing this for my report..it will not change any value in database..\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e CASE WHEN MUC.name='ml' THEN (MUC.name)='Liter' \n WHEN MUC.name='gm' THEN (MUC.name)='Kg' \n END AS Measurement,\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"37154392","answer_count":"2","comment_count":"0","creation_date":"2016-05-11 06:10:40.823 UTC","last_activity_date":"2016-05-11 07:32:39.95 UTC","last_edit_date":"2016-05-11 06:15:00.917 UTC","last_editor_display_name":"","last_editor_user_id":"3477870","owner_display_name":"","owner_user_id":"3477870","post_type_id":"1","score":"0","tags":"mysql|sql","view_count":"45"} +{"id":"7305345","title":"String doesn’t seem to be passed by value","body":"\u003cp\u003eI use the following function to bind all members of a certain class to a function that changes the current page. Heres the function:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efunction _bind_menu_items() {\n var menuItems = fja.getElementsByClass(\"menuItem\"),\n index,\n elementID,\n divIdToBind;\n\n for (index in menuItems) {\n elementID = menuItems[index].id;\n divIdToBind = elementID.replace(\"Item\", \"\");\n\n menuItems[index].onclick = function() {\n fja.menu.changeActivePage(divIdToBind);\n };\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI’ve checked that everything works as expected down to the actual assignment of the onclick property. The error I’m getting is that every div belonging to the menuItem class seems to call the same onclick function... as if the divIdToBind string is the exact same for every onclick that is assigned... How can I fix this?\u003c/p\u003e","accepted_answer_id":"7305411","answer_count":"1","comment_count":"2","creation_date":"2011-09-05 08:03:26.373 UTC","favorite_count":"1","last_activity_date":"2011-09-05 08:11:03.817 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"636967","post_type_id":"1","score":"1","tags":"javascript","view_count":"64"} +{"id":"32887454","title":"How is shell sort algorithm any better than of merge sort algorithm?","body":"\u003cp\u003eI have this small presentation about algorithms with a group of nerds and i was randomly tasked to convince them that shell sort is better than merge sort algorithm... I have been reading for almost a weak But No matter how much i read on merge sort and shell sort i find the merge sort better than shell sort.. \u003c/p\u003e\n\n\u003cp\u003eAre their any advantages of shell sort on merge sort? I mean on what circumstances is shell sort better than merge sort. I might have missed something but i dont know what.\u003c/p\u003e\n\n\u003cp\u003eAny tips would be fine or if possible can you link me to something helpful..\u003c/p\u003e","answer_count":"3","comment_count":"2","creation_date":"2015-10-01 12:19:16.07 UTC","last_activity_date":"2015-10-01 17:33:09.303 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4966206","post_type_id":"1","score":"1","tags":"java|algorithm|shell|sorting|merge","view_count":"862"} +{"id":"41084598","title":"Count number of items in pandas","body":"\u003cp\u003eI know this question is quite trivial, but this is my first day of using pandas, so please at least post a link to the document which I should read.\u003c/p\u003e\n\n\u003cp\u003eBasically, I don't know how to count the number of items of each column. Suppose I have a data frame like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edf = pandas.DataFrame({\n \"Grade\": [1, 2, 1, 1, 2, 1, 2, 2, 1],\n \"Major\": [\"Science\", \"Art\", \"Engineering\", \"Science\", \"Science\", \"Science\", \"Science\", \"Engineering\", \"Engineering\"]})\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI expect the following result:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eGrade Major Number\n1 Science 3\n1 Engineering 2\n1 Art 0\n2 Science 2\n2 Engineering 1\n2 Art 1\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"41084621","answer_count":"1","comment_count":"0","creation_date":"2016-12-11 09:13:23.353 UTC","last_activity_date":"2016-12-11 09:15:45.833 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5399734","post_type_id":"1","score":"-1","tags":"python|pandas|numpy","view_count":"63"} +{"id":"43341743","title":"tensorflow distributed train worker process supervisor init twice","body":"\u003cp\u003eI'm trying to write distribued tensorflow program, But something odd for me, especially the multi-distributed-workers exported model predicted result almost 0.00003(max:0.000031, min:0.00000001, var:0.00001, mean: 0.00003, learning rate is 0.00125, model: logistic regression, sigmoid actvation as last), while it works fine when i use only one worker process(predicted result mean value: 0.478, var: 0.41, max: 0.999, min:0.00000001).\u003c/p\u003e\n\n\u003cp\u003eMy Code structure as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e with K.tf.device(\n K.tf.train.replica_device_setter(\n ps_device=\"/job:servers\",\n worker_device=\"/job:%s/task:%d/cpu:0\" % (\n self.job_name + 's', self.train_id),\n cluster=self.cluster)):\n self._build_model(self.job_name)\n self._build_data_pipeline(self.job_name, role=['train'])\n self._build_monitors(self.job_name)\n self._build_algo(self.job_name)\n self._build_summaries(self.job_name)\n self._build_save_model(self.job_name)\n self._build_train_conf(self.job_name)\n self._build_supervisor(self.job_name)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand my supervisor and managed_session codes as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e logging.info('[is_chief] %s', is_chief)\n sv = K.tf.train.Supervisor(\n is_chief=is_chief,\n logdir=self.model_conf['export_dir'] + '/save',\n init_op=self.init_op,\n summary_op=self.summary_op,\n save_model_secs=0,\n save_summaries_secs=self.save_summaries_seconds,\n saver=self.saver,\n global_step=self.global_step)\n\n\n logging.info('sess target: %s', self.server.target)\n with sv.managed_session(\n master=self.server.target,\n config=threads_config,\n start_standard_services=False) as sess:\n sv.start_queue_runners(sess)\n\n do the training steps.\n when finished input data, export model manually.\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ebut I found that master session occurred twice, what does it mean?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eI 2017-04-11 08:59:38 framework.framework:3020 ============After build model==============\nI 2017-04-11 08:59:38 framework.framework:3027 [is_chief] False\nI 2017-04-11 08:59:38 framework.framework:2077 RUNTIME CHECKING ...\nI 2017-04-11 08:59:38 framework.framework:2026 [CHECKER] ModelSize Checking ...\nI 2017-04-11 08:59:38 framework.framework:2064 [CHECKER] GraphNotNone Checking ...\nI 2017-04-11 08:59:38 framework.framework:2082 Runtime Checker result: True\nI 2017-04-11 08:59:38 framework.framework:3094 sess target: b'grpc://localhost:15926'\nI tensorflow/core/distributed_runtime/master_session.cc:928] Start master session 74d502743e860d45 with config:\nuse_per_session_threads: true\n\nI tensorflow/core/distributed_runtime/master_session.cc:928] Start master session 12114aca8d44d336 with config:\nuse_per_session_threads: true\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"1","creation_date":"2017-04-11 09:19:59.953 UTC","last_activity_date":"2017-04-11 09:19:59.953 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5611838","post_type_id":"1","score":"2","tags":"session|tensorflow|distributed|managed|supervisor","view_count":"53"} +{"id":"47406832","title":"How to compare strings of lines from two different files using python?","body":"\u003cp\u003eI want to find the matching email in two files and sent date by comparing emails from two files. I have two files 1) maillog.txt(postfix maillog) and 2)testmail.txt(contains emails separated by newline) i have used \u003ccode\u003ere\u003c/code\u003e to extract the email and sent date from maillog.txt file which looks like below, \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eNov 3 10:08:43 server postfix/smtp[150754]: 78FA8209EDEF: to=\u0026lt;adamson@example.com\u0026gt;, relay=aspmx.l.google.com[74.125.24.26]:25, delay=3.2, delays=0.1/0/1.6/1.5, dsn=2.0.0, status=sent (250 2.0.0 OK 1509718076 m11si5060862pls.447 - gsmtp)\nNov 3 10:10:45 server postfix/smtp[150754]: 7C42A209EDEF: to=\u0026lt;addison@linux.com\u0026gt;, relay=mxa-000f9e01.gslb.pphosted.com[67.231.152.217]:25, delay=5.4, delays=0.1/0/3.8/1.5, dsn=2.0.0, status=sent (250 2.0.0 2dvkvt5tgc-1 Message accepted for delivery)\nNov 3 10:15:45 server postfix/smtp[150754]: 83533209EDE8: to=\u0026lt;johndoe@carchcoal.com\u0026gt;, relay=mxa-000f9e01.gslb.pphosted.com[67.231.144.222]:25, delay=4.8, delays=0.1/0/3.3/1.5, dsn=2.0.0, status=sent (250 2.0.0 2dvm8yww64-1 Message accepted for delivery)\nNov 3 10:16:42 server postfix/smtp[150754]: 83A5E209EDEF: to=\u0026lt;jackn@alphanr.com\u0026gt;, relay=aspmx.l.google.com[74.125.200.27]:25, delay=1.6, delays=0.1/0/0.82/0.69, dsn=2.0.0, status=sent (250 2.0.0 OK 1509718555 j186si6198120pgc.455 - gsmtp)\nNov 3 10:17:44 server postfix/smtp[150754]: 8636D209EDEF: to=\u0026lt;sbins@archcoal.com\u0026gt;, relay=mxa-000f9e01.gslb.pphosted.com[67.231.144.222]:25, delay=4.1, delays=0.11/0/2.6/1.4, dsn=2.0.0, status=sent (250 2.0.0 2dvm8ywwdh-1 Message accepted for delivery)\nNov 3 10:18:42 server postfix/smtp[150754]: 8A014209EDEF: to=\u0026lt;leo@adalphanr.com\u0026gt;, relay=aspmx.l.google.com[74.125.200.27]:25, delay=1.9, delays=0.1/0/0.72/1.1, dsn=2.0.0, status=sent (250 2.0.0 OK 1509718675 o2si6032950pgp.46 - gsmtp)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is my another file \u003ccode\u003etestmail.txt\u003c/code\u003e :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eadamson@example.com\njdswson@gmail.com\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBelow is what i have tried and it works too but \u003cstrong\u003eI want to know if there is more efficient way to do this for large number of maillogs and email addresses\u003c/strong\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport re\npattern=r'(?P\u0026lt;month\u0026gt;[A-Za-z]{3})\\s{1,3}(?P\u0026lt;day\u0026gt;\\d{1,2})\\s{1,2}(?P\u0026lt;ts\u0026gt;\\d+:\\d+:\\d+).*to=\u0026lt;(?P\u0026lt;email\u0026gt;([\\w\\.-]+)@([\\w\\.-]+))'\nwith open(\"testmail.txt\") as fh1:\n for addr in fh1:\n if addr:\n with open(\"maillog.txt\") as fh:\n for line in fh:\n if line:\n match=re.finditer(pattern,line)\n for obj in match:\n addr=addr.strip()\n addr2=obj.group('email').strip()\n if addr == addr2:\n print(obj.groupdict('email'))\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethis will print out put like if match is found:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{'month': 'Nov', 'day': '3', 'ts': '10:08:43', 'email': 'adamson@example.com'}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"47409330","answer_count":"4","comment_count":"4","creation_date":"2017-11-21 06:47:11.827 UTC","last_activity_date":"2017-11-21 09:16:20.73 UTC","last_edit_date":"2017-11-21 07:03:55.707 UTC","last_editor_display_name":"","last_editor_user_id":"2136297","owner_display_name":"","owner_user_id":"2136297","post_type_id":"1","score":"0","tags":"python|python-3.x","view_count":"62"} +{"id":"30298016","title":"error in python idfs implementation","body":"\u003cp\u003eI am new in python, there is this error in the if else statement \u003ccode\u003e\"unindent does not match any outer indentation level\"\u003c/code\u003e, can anyone tell me what is the problem with if else statements?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef idfs(graph, start, end,limit):\n # maintain a queue of paths\n count=0\n queue = []\n\n # push the first path into the queue\n queue.append([start])\n #print queue\n\n while queue:\n count +=1\n # get the first path from the queue\n path = queue.pop(0)\n\n # get the last node from the path\n node = path[-1]\n\n # path found\n if node == end and count==2:\n return path\n elif node!=end and count==2:\n print 'goal not found'\n limit=input('Enter the limit again')\n path=idfs(graph,node,goal,limit)\n return path\n\n\n\n\n # enumerate all adjacent nodes, construct a new path and push it into the queue\n for adjacent in graph.get(node, []):\n new_path = list(path)\n print new_path\n new_path.append(adjacent)\n print new_path\n queue.append(new_path)\n print queue\n\n\n# example execution of code\nstart = input('Enter source node: ')\ngoal = input('Enter goal node: ')\nlimit=input('Enter the limit')\n\nprint(idfs(graph,start,goal,limit))\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"2","creation_date":"2015-05-18 08:08:02.597 UTC","last_activity_date":"2015-05-18 08:12:15.78 UTC","last_edit_date":"2015-05-18 08:10:45.48 UTC","last_editor_display_name":"","last_editor_user_id":"637284","owner_display_name":"","owner_user_id":"4516551","post_type_id":"1","score":"-3","tags":"python","view_count":"31"} +{"id":"12776936","title":"Extracting text pattern using regular expression","body":"\u003cp\u003eI want to extract a code from an input string from different pages. Sample code is \n'110-PT-0988'. \u003c/p\u003e\n\n\u003cp\u003eThis RegExp fits other possible cases \u003ccode\u003e'^\\d{3}-[A-Z]{1,6}-\\d{4}[A-Z]{0,2}$'\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eI want to return a string variable containing the code within the input string e.g. for an input string \u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003e'Code part: xx Code No: 120-PXT-2234X System Process .....xyz blah blah'.\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eI want the return string to be \u003ccode\u003e'120-PXT-2234X'\u003c/code\u003e\u003c/p\u003e","answer_count":"2","comment_count":"8","creation_date":"2012-10-08 07:13:33.267 UTC","last_activity_date":"2012-10-09 08:55:51.133 UTC","last_edit_date":"2012-10-09 08:55:51.133 UTC","last_editor_display_name":"","last_editor_user_id":"626273","owner_display_name":"","owner_user_id":"1727936","post_type_id":"1","score":"2","tags":"regex|vb.net","view_count":"120"} +{"id":"26494008","title":"What is the best way in Excel formula to parse out this string?","body":"\u003cp\u003eI have a column of data and each cell has something like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Last First (Id)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003esuch as :\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Thompson Joe (ABC12323)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand i want to parse out the:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e ABC12323\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNOTE: in some rare cases I see there are two ids listed like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Thompson Joe (ABC12323) (DEF1123432)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand in this case i would want to parse out the second one\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e DEF1123432\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ewhat is the easiest way to do this in an excel formula?\u003c/p\u003e","accepted_answer_id":"26494172","answer_count":"2","comment_count":"0","creation_date":"2014-10-21 18:45:55.523 UTC","last_activity_date":"2014-10-21 19:00:40.573 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4653","post_type_id":"1","score":"0","tags":"string|excel|parsing","view_count":"60"} +{"id":"21783983","title":"PFQuery possible bug when updating key value","body":"\u003cp\u003eI have the following code to retrieve all new 'Departments' from my Parse table...\u003c/p\u003e\n\n\u003cp\u003eUpon first application run on device, I create a date for last year.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eNSDate *now = [NSDate date];\nNSDateComponents *days = [NSDateComponents new];\n[days setDay:-365];\nNSCalendar *calendar = [NSCalendar currentCalendar];\nNSDate *lastYear = [calendar dateByAddingComponents:days toDate:now options:0];\n[NSUserDefaults standardUserDefaults] setObject:lastYear forKey:@\"lastUpdate\";\n[NSUserDefaults standardUserDefaults] synchronize];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThen I run a background PFQuery ...\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elastDate = [NSUserDefaults standardUserDefaults] objectForKey:@\"lastUpdate\";\nPFQuery *query = [PFQuery queryWithClassName:@\"Departments\"];\n[query whereKey:@\"createdAt\" greaterThan:lastDate];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis query works. Once the appropriate departments are returned, I place the updated (current date) in the NSUserDefaults.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[NSUserDefaults standardUserDefaults] setObject:[NSDate date] forKey:@\"lastUpdate\"];\n[NSUserDefaults standardUserDefaults] synchronize];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I run this query again (see below), without any update to my 'Departments' table on the backend, I should receive NO Departments ( device update date is now greater ). \u003c/p\u003e\n\n\u003cp\u003eHowever, I get the same result set returned again when I run against the new date...\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elastDate = [NSUserDefaults standardUserDefaults] objectForKey:@\"lastUpdate\";\nPFQuery *query = [PFQuery queryWithClassName:@\"Departments\"];\n[query whereKey:@\"createdAt\" greaterThan:lastDate];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNote: I've logged all dates and the dates in NSUserDefaults are correct. I've also checked the dates in the backend and everything looks right. I've also cleared the PFQuery cache before each run and set the cache policy to network only, just to remove caching weirdness.\u003c/p\u003e\n\n\u003cp\u003eWhat's really strange is that if I kill the app and run it again, the query then works as expected ( no results )...\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003elastDate = [NSUserDefaults standardUserDefaults] objectForKey:@\"lastUpdate\";\nPFQuery *query = [PFQuery queryWithClassName:@\"Departments\"];\n[query whereKey:@\"createdAt\" greaterThan:lastDate];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAfter playing with this for a couple days, the only conclusion I can come to is that this is a bug in PFQuery. I'm changing the value, but the query is not adhering to this updated value in which it to check against, unless I kill the app and run it again.\u003c/p\u003e\n\n\u003cp\u003eThanks in advance for any suggestions.\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2014-02-14 16:05:23.487 UTC","last_activity_date":"2014-02-14 16:05:23.487 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1329445","post_type_id":"1","score":"1","tags":"ios|parse.com|pfquery","view_count":"144"} +{"id":"3073264","title":"HTML elements: How can I simulate pressing the 'tab' key","body":"\u003cp\u003eI want to trigger the same effect than when pressing the tab key on an element that has the focus. Is there any way of doing this? I am trying to make the focus jump to the next element.\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e\n\n\u003cp\u003e(jQuery is an option)\u003c/p\u003e","answer_count":"2","comment_count":"4","creation_date":"2010-06-18 21:47:11.963 UTC","favorite_count":"0","last_activity_date":"2012-08-13 21:33:22.11 UTC","last_edit_date":"2012-08-13 21:33:22.11 UTC","last_editor_display_name":"","last_editor_user_id":"606371","owner_display_name":"","owner_user_id":"102957","post_type_id":"1","score":"2","tags":"javascript|jquery|tabs|focus|elements","view_count":"1374"} +{"id":"38828645","title":"Split a vector into multiple vectors in R","body":"\u003cp\u003eI want to split one vector(x) into multiple vectors(x1, x2 ,... , xn).\u003c/p\u003e\n\n\u003cp\u003eMy input: x \u0026lt;- 1:10\u003c/p\u003e\n\n\u003cp\u003eMy desire output:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ex1 \u0026lt;- c(1,2,3,4)\nx2 \u0026lt;- c(2,3,4,5)\nx3 \u0026lt;- c(3,4,5,6)\nx4 \u0026lt;- c(4,5,6,7)\nx5 \u0026lt;- c(5,6,7,8)\nx6 \u0026lt;- c(6,7,8,9)\nx7 \u0026lt;- c(7,8,9,10)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy code(thanks to Mrs.Richard Herron for inspiration):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ex \u0026lt;- 1:10\nn \u0026lt;-3\nvectors \u0026lt;- function(x, n) split(x, sort(rank(x) %% n))\nvectors(x,n)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks very much!\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2016-08-08 11:58:41.15 UTC","last_activity_date":"2016-08-08 12:26:04.997 UTC","last_edit_date":"2016-08-08 12:26:04.997 UTC","last_editor_display_name":"","last_editor_user_id":"2963704","owner_display_name":"","owner_user_id":"1032066","post_type_id":"1","score":"2","tags":"r","view_count":"177"} +{"id":"45160204","title":"Need a php script that matches nested opening and closing brackets and change them with tree level number?","body":"\u003cp\u003eI am trying to write a sript which matches nested brackets and change them with level number\nOpening bracket \"{\" to be changed with level number and closing bracket \"}\" to be changed with level number with a dash before.\nEG: \nlevel1 opening bracket \"{\" to be changed with \"[level1]\" and closing bracket \"}\" to be changed with \"[/level1]\"\nlevel2 opening bracket \"{\" to be changed with \"[level2]\" and closing bracket \"}\" to be changed with \"[/level2]\"\u003c/p\u003e\n\n\u003cp\u003eOther example:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{{{{text{text}}}}{text text}{new text {} {another text{some other {text} here}}}}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand change them with level number (open+close) like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[level1]\n [level2]\n [level3]\n [level4]text\n [level5]text[/level5]\n [/level4]\n [/level3]\n [/level2]\n [level2]text text[/level2]\n [level]new text \n [level3][/level3] \n [level3]another text\n [level4]some other \n [level5]text[/level5] here\n [/level4]\n [/level3]\n [/level2]\n[/level1]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe regex I use to find each level is this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e'/\\{(((?\u0026gt;[^\\{\\}]+)|(?R))*)\\}/x'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut I couldn't find a way to change brackets with corresponding level.\nI would appreciate any help I can get. Thanks\u003c/p\u003e","accepted_answer_id":"45165440","answer_count":"3","comment_count":"1","creation_date":"2017-07-18 07:26:49.803 UTC","favorite_count":"0","last_activity_date":"2017-07-19 15:50:21.56 UTC","last_edit_date":"2017-07-19 15:50:21.56 UTC","last_editor_display_name":"","last_editor_user_id":"2627132","owner_display_name":"","owner_user_id":"2627132","post_type_id":"1","score":"2","tags":"php|regex","view_count":"63"} +{"id":"16813012","title":"Multiple Thread with main thread exiting , is it possible that other thread may run infinitely","body":"\u003cp\u003eI have a main thread which creates other thread(Name = TASK) which has task independent of main thread.\nIf main thread finishes it works then is it possible that main exits and still other thread(TASK) can continue it's execution with out being a deamon thread.\nI am aware of the concept of deamon thread but we can't use it as when main thread exits,all other deamon threads die.\nIf it's not possible then is there any workaround.\u003c/p\u003e","accepted_answer_id":"16813064","answer_count":"1","comment_count":"0","creation_date":"2013-05-29 11:46:15.263 UTC","favorite_count":"1","last_activity_date":"2013-05-29 11:55:10.367 UTC","last_edit_date":"2013-05-29 11:50:29.707 UTC","last_editor_display_name":"","last_editor_user_id":"1886855","owner_display_name":"","owner_user_id":"1559426","post_type_id":"1","score":"1","tags":"java|multithreading","view_count":"656"} +{"id":"13415626","title":"How to connect MAMP based MYSQL in Python?","body":"\u003cp\u003eI recently upgraded Python on my Macbook to 2.7 via Macport and eventually I had to upgrade MySQL driver too. I tried to install it via Macport but that guy installed another copy of MySQL server too. I want to use MAMP based MYSQL in Python. On connection I am getting error:\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003e_mysql_exceptions.OperationalError: (2002, \"Can't connect to local MySQL server through socket '/opt/local/var/run/mysql5/mysqld.sock'\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eHow do I point it out to MAMP based MySQL?\u003c/p\u003e\n\n\u003cp\u003eThanks\u003c/p\u003e","answer_count":"0","comment_count":"1","creation_date":"2012-11-16 11:24:22.243 UTC","favorite_count":"1","last_activity_date":"2012-11-16 11:24:22.243 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"275002","post_type_id":"1","score":"2","tags":"python-2.7|mamp|mysql-python","view_count":"204"} +{"id":"25675686","title":"MongoDB locking until result is found","body":"\u003cp\u003eI am using MongoDB and Morphia, my goal is to make a chat.\u003c/p\u003e\n\n\u003cp\u003eMy idea is to request all the messages that have a bigger sequential number than a specified number.\u003c/p\u003e\n\n\u003cp\u003eFor example if you request message 0, you will receive all messages, but if you request message 100, you will only receive messages with sequential number greater than 100.\u003c/p\u003e\n\n\u003cp\u003eIf there is no message found, the requester should be locked until a message appears, by other words, the requester waits for future messages.\u003c/p\u003e\n\n\u003cp\u003eMy question is, how is that implemented with MongoDB and Morphia? I don't want to query if there is a newer message periodically...\u003c/p\u003e\n\n\u003cp\u003eDoes MongoDB supports locking until there is a result?\u003c/p\u003e\n\n\u003cp\u003eThank you ;-)\u003c/p\u003e","accepted_answer_id":"25676025","answer_count":"3","comment_count":"0","creation_date":"2014-09-04 22:05:06.173 UTC","last_activity_date":"2014-09-05 12:21:26.257 UTC","last_edit_date":"2014-09-04 22:12:58.067 UTC","last_editor_display_name":"","last_editor_user_id":"949682","owner_display_name":"","owner_user_id":"949682","post_type_id":"1","score":"0","tags":"java|mongodb|chat|morphia","view_count":"56"} +{"id":"27327458","title":"Getting time difference using a time_t converted from a string","body":"\u003cp\u003eI am trying to get the diff between two dates.\nOne date being right now and the other is a date converted to time_t from a string representation of a date.\u003c/p\u003e\n\n\u003cp\u003eMy code is as follows\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e const char *time_details = \"12/03/2014\";\n struct tm tm;\n strptime(time_details, \"%m/%d/%Y\", \u0026amp;tm);\n time_t mytime = mktime(\u0026amp;tm);\n\n time_t now;\n time(\u0026amp;now);\n double seconds = difftime(now, mytime);\n\n LOGG(\"now = %d\", now);\n\n LOGG(\"mytime = %d\", mytime);\n LOGG(\"unsigned int mytime = %d\", (int)mytime);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eMy output looks like so:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003enow = 1417830679\nmytime = -1\nseconds = 1610001720\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003emytime always comes out to -1\nAnd, the value for seconds is not correct either.\u003c/p\u003e","accepted_answer_id":"27327646","answer_count":"1","comment_count":"4","creation_date":"2014-12-06 01:56:40.777 UTC","last_activity_date":"2014-12-06 03:07:33.3 UTC","last_edit_date":"2014-12-06 02:04:54.353 UTC","last_editor_display_name":"","last_editor_user_id":"2917608","owner_display_name":"","owner_user_id":"2917608","post_type_id":"1","score":"0","tags":"c++","view_count":"151"} +{"id":"47190766","title":"wordpress search function with 2 search input","body":"\u003cp\u003eI have to make a search funtion with 2 input fields.\u003c/p\u003e\n\n\u003cp\u003eI have both fields running at the same time but in the search it wil not combine the keywords that are used. So what i want to achive is dat both keywords need to be found in a post before the content wil be shown in the search results.\u003c/p\u003e\n\n\u003cp\u003esearchform.php:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;form class=\"main-search\" method=\"GET\" action=\"\u0026lt;?php echo esc_url( \ncouponis_get_permalink_by_tpl( 'page-tpl_search' ) ) ?\u0026gt;\"\u0026gt;\n\n \u0026lt;input type=\"text\" name=\"keyword\" class=\"form-control\" placeholder=\"\u0026lt;?php esc_html_e( 'Wat...', 'couponis' ) ?\u0026gt;\"\u0026gt;\n\n \u0026lt;input type=\"text\" name=\"location\" class=\"form-control\" placeholder=\"\u0026lt;?php esc_html_e( 'Waar...', 'couponis' ) ?\u0026gt;\"\u0026gt;\n\n \u0026lt;a href=\"javascript:;\" class=\"submit-form\"\u0026gt;\u0026lt;?php esc_html_e( 'Zoeken', 'couponis' ) ?\u0026gt;\u0026lt;/a\u0026gt;\n\n \u0026lt;/form\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003epage-tpl_search:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\n/*\n Template Name: Search Page\n*/\n?\u0026gt;\n\n\u0026lt;?php \nget_header();\n$cur_page = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; \n//get curent page\n\n$category = !empty( $_GET['category'] ) ? $_GET['category'] : '';\n$store = !empty( $_GET['store'] ) ? $_GET['store'] : '';\n$keyword = !empty( $_GET['keyword'] ) ? $_GET['keyword'] : '';\n$location = !empty( $_GET['location'] ) ? $_GET['location'] : '';\n$type = !empty( $_GET['type'] ) ? explode( ',', $_GET['type'] ) : array();\n\n$cur_page = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; \n//get curent page\n\n$selected_orderby = couponis_get_search_orderby_cookie();\n\n$search_args = array(\n 'post_status' =\u0026gt; 'publish',\n 'orderby' =\u0026gt; 'expire',\n 'order' =\u0026gt; 'ASC',\n 'paged' =\u0026gt; $cur_page\n);\n\nif( !empty( $selected_orderby ) ){\n $search_args['orderby'] = $selected_orderby;\n if( $selected_orderby == 'expire' || $selected_orderby == 'name' ){\n $search_args['order'] = 'ASC';\n }\n else{\n $search_args['order'] = 'DESC'; \n }\n}\n\nif( !empty( $category ) ){\n $search_args['tax_query'] = array(\n array(\n 'taxonomy' =\u0026gt; 'coupon-category',\n 'terms' =\u0026gt; $category,\n ),\n );\n}\n\nif( !empty( $store ) ){\n $search_args['tax_query'] = array(\n array(\n 'taxonomy' =\u0026gt; 'coupon-store',\n 'terms' =\u0026gt; $store,\n ),\n );\n}\n\nif( !empty( $keyword ) ){\n $search_args['s'] = $keyword;\n}\n\nif( !empty( $location ) ){\n $search_args['s'] = $location;\n}\n\nif( !empty( $type ) ){\n $search_args['type'] = $type;\n}\n\n$coupons = new WP_Coupons_Query( $search_args );\n\n$page_links_total = $coupons-\u0026gt;max_num_pages;\n$page_links = paginate_links( \n array(\n 'prev_next' =\u0026gt; true,\n 'end_size' =\u0026gt; 2,\n 'mid_size' =\u0026gt; 2,\n 'total' =\u0026gt; $page_links_total,\n 'current' =\u0026gt; $cur_page, \n 'prev_next' =\u0026gt; false,\n 'type' =\u0026gt; 'array'\n )\n); \n$pagination = couponis_format_pagination( $page_links );\n\n$coupon_listing_style = couponis_get_listing_style();\n\n?\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSome help would be nice thank you ver much!\u003c/p\u003e","answer_count":"0","comment_count":"0","creation_date":"2017-11-08 22:26:27.43 UTC","last_activity_date":"2017-11-08 22:26:27.43 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"8909976","post_type_id":"1","score":"-1","tags":"php|wordpress|forms|search","view_count":"20"} +{"id":"37868016","title":"Excel - Microsoft Query - SQL Server login - \"Use Trusted Connection\" default setting","body":"\u003cp\u003eCouple of years using this site is as an invaluable resource, but first time posting.\u003c/p\u003e\n\n\u003cp\u003eI am having a little trouble with external data connections in Excel, specifically connecting to SQL Server through Microsoft Query. \u003c/p\u003e\n\n\u003cp\u003eWhenever I click \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[Get External Data \u0026gt; \n From Other Sources \u0026gt; \n From Microsoft Query \u0026gt; \n Choose Data Source: SQL Server]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eit takes about 20 seconds before an error pops up:\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://i.stack.imgur.com/LdKOx.png\" rel=\"nofollow\"\u003eError 18452 Login Failed Untrusted Domain\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eAfter I click OK a SQL Server Login dialog box pops up with \"Use Trusted Connection\" pre-checked. Each time I create a new data connection in Excel (I do this dozens of times per project), I have to uncheck that box and enter a login ID/pw instead for it to work. Add all those 20 seconds up and it's actually a pretty big annoyance for the type of work I do.\u003c/p\u003e\n\n\u003cp\u003eMy question: how do I change the connection properties to where \"Use Trusted Connection\" is \u003cem\u003eunchecked\u003c/em\u003e by default and the Login ID and Password fields are pre-filled?\u003c/p\u003e\n\n\u003cp\u003eHere is what the connection string portion of the HTML code looks like when I right-click the appropriate .odc file in [Documents \u003e My Data Sources] and click 'edit in notepad':\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;odc:ConnectionString\u0026gt;Provider=SQLOLEDB.1;Persist Security Info=True;User ID=xx_xxxxxx;Password=xxxxxxxx;Data Source=XX.XX.XX.XX;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=XXXXXXX;Use Encryption for Data=False;Tag with column collation when possible=False;Initial Catalog=Data_Warehouse\u0026lt;/odc:ConnectionString\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI did look through the archives and found a few related discussions but none that addressed this question specifically. Thanks for your help. Please excuse any incorrect use of syntax and I hope I explained things clearly enough for a newbie.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-06-16 19:38:07.803 UTC","last_activity_date":"2016-07-19 09:35:34.167 UTC","last_edit_date":"2016-06-16 21:55:13 UTC","last_editor_display_name":"","last_editor_user_id":"4979197","owner_display_name":"","owner_user_id":"6475619","post_type_id":"1","score":"0","tags":"excel|odbc|ms-query","view_count":"612"} +{"id":"6029063","title":"reading xls file in php using codeigniter with Spreadsheet_Excel_Reader library","body":"\u003cp\u003eam trying to read an excel file (i.e xls) and import the data to mysql database and am using codeigniter 2.0.1 framework. \u003c/p\u003e\n\n\u003cp\u003ehere are the codes to generate query\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public function read_file($table = 'organization', $filename = 'test.xls') {\n\n $pathToFile = './uploads/' . $filename;\n $this-\u0026gt;load-\u0026gt;library('Spreadsheet_Excel_Reader');\n $data = new Spreadsheet_Excel_Reader($pathToFile);\n $sql = \"INSERT INTO $table (\";\n for($index = 1;$index \u0026lt;= $data-\u0026gt;sheets[0]['numCols']; $index++){\n $sql.= strtolower($data-\u0026gt;sheets[0]['cells'][1][$index]) . \", \";\n }\n\n $sql = rtrim($sql, \", \").\" ) VALUES ( \";\n for ($i = 2; $i \u0026lt;= $data-\u0026gt;sheets[0]['numRows']; $i++) {\n for ($j = 1; $j \u0026lt;= $data-\u0026gt;sheets[0]['numCols']; $j++) {\n $sql .= \"\\\"\" . $data-\u0026gt;sheets[0]['cells'][$i][$j] . \"\\\", \";\n }\n echo rtrim($sql, \", \").\" ) \u0026lt;br\u0026gt;\";\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethe values generated in the loop are duplicated , i cant find the problem with the loop...\u003c/p\u003e\n\n\u003cp\u003eHere is the result after running the function above:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eINSERT INTO organization (userid, datestamp, kata, kaya, kaya_zenye_vuoo, vyoo_vyenye_bamba, mifuniko, matumizi_mifuniko, uzuiaji_inzi, usafishikaji_sakafu, usitiri, uezekaji, milango_inayofungika, harufu, wadudu, sabuni, maji, vibuyuchirizi ) VALUES ( \"mpwapwa@live.com\", \"2011-04-10 08:21\", \"Chunyu\", \"2\", \"4\", \"5\", \"3\", \"56\", \"5\", \"6\", \"8\", \"45\", \"7\", \"8\", \"9\", \"8\", \"9\", \"8\" ) \nINSERT INTO organization (userid, datestamp, kata, kaya, kaya_zenye_vuoo, vyoo_vyenye_bamba, mifuniko, matumizi_mifuniko, uzuiaji_inzi, usafishikaji_sakafu, usitiri, uezekaji, milango_inayofungika, harufu, wadudu, sabuni, maji, vibuyuchirizi ) VALUES ( \"mpwapwa@live.com\", \"2011-04-10 08:21\", \"Chunyu\", \"2\", \"4\", \"5\", \"3\", \"56\", \"5\", \"6\", \"8\", \"45\", \"7\", \"8\", \"9\", \"8\", \"9\", \"8\", \"annie@yahoo.com\", \"2011-04-10 08:21\", \"Chunyu\", \"2\", \"4\", \"5\", \"3\", \"56\", \"5\", \"6\", \"8\", \"45\", \"7\", \"8\", \"9\", \"8\", \"9\", \"8\" ) \nINSERT INTO organization (userid, datestamp, kata, kaya, kaya_zenye_vuoo, vyoo_vyenye_bamba, mifuniko, matumizi_mifuniko, uzuiaji_inzi, usafishikaji_sakafu, usitiri, uezekaji, milango_inayofungika, harufu, wadudu, sabuni, maji, vibuyuchirizi ) VALUES ( \"mpwapwa@live.com\", \"2011-04-10 08:21\", \"Chunyu\", \"2\", \"4\", \"5\", \"3\", \"56\", \"5\", \"6\", \"8\", \"45\", \"7\", \"8\", \"9\", \"8\", \"9\", \"8\", \"annie@yahoo.com\", \"2011-04-10 08:21\", \"Chunyu\", \"2\", \"4\", \"5\", \"3\", \"56\", \"5\", \"6\", \"8\", \"45\", \"7\", \"8\", \"9\", \"8\", \"9\", \"8\", \" sam@yahoo.com\", \"2011-04-10 08:21\", \"Chunyu\", \"2\", \"4\", \"5\", \"3\", \"56\", \"5\", \"6\", \"8\", \"45\", \"7\", \"8\", \"9\", \"8\", \"9\", \"8\" ) \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSorry i cant post images as i'm a newbie.\u003c/p\u003e\n\n\u003cp\u003eThanx in advance..Cheers\u003c/p\u003e","accepted_answer_id":"6029143","answer_count":"1","comment_count":"0","creation_date":"2011-05-17 09:46:25.843 UTC","favorite_count":"1","last_activity_date":"2011-05-17 09:55:31.313 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"577446","post_type_id":"1","score":"2","tags":"php|codeigniter|programming-languages","view_count":"6013"} +{"id":"19150293","title":"Sublime Text 2 / sublimeLinter: only Python is real-time background linted","body":"\u003cp\u003eI've already spent a few hour on this with not much progress. I'm running Sublime Text 2.0.2 with SublimeLinter v1.7 [1]. It real-time lints Python beautifully, but for many of the other languages I use day-to-day [Javascript, Ruby, CSS/SCSS, etc] it will only display badly-formated warnings via the console when saving[2]. I've tried a number of settings for the executable map. I current have:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\"sublimelinter_executable_map\":\n{ \n \"javascript\": \"/usr/local/bin/node\",\n \"node\": \"/usr/local/bin/node\"\n},\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI've also had just \"javascript\": \"/usr/local/bin/node\" in there as well. I've also tried using both jshint and jslint as the \"javascript_linter\" option. \u003c/p\u003e\n\n\u003cp\u003eThe console shows SublimeLinter loading and enabling javascript, CSS and Ruby (using node, ruby and node, respectively). \u003c/p\u003e\n\n\u003cp\u003eAfter the enable message on the console I get:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eTraceback (most recent call last):\n File \"./SublimeLinter.py\", line 431, in _update_view\n File \"./SublimeLinter.py\", line 143, in run_once\n File \"./sublimelinter/modules/base_linter.py\", line 291, in run\n File \"./sublimelinter/modules/javascript.py\", line 72, in parse_errors\nValueError: Error from jslint: util.puts: Use console.log instead\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ealso:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSublimeLinter: css enabled (using node.js)\nTraceback (most recent call last):\n File \"./SublimeLinter.py\", line 431, in _update_view\n File \"./SublimeLinter.py\", line 143, in run_once\n File \"./sublimelinter/modules/base_linter.py\", line 291, in run\n File \"./sublimelinter/modules/css.py\", line 24, in parse_errors\nValueError: Error from csslint: util.puts: Use console.log instead\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis is followed by raw linting messages such as:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[{\"id\":\"(error)\",\"raw\":\"Use spaces, not tabs.\",\"evidence\":\"\\t\\\"published\\\": \n\\\"#444444\\\",\",\"line\":4,\"character\":1,\"reason\":\"Use spaces, not tabs.\"},{\"id\":\" \n(error)\",\"raw\":\"Expected '{a}' at column {b}, not column \n{c}.\",\"evidence\":\"\\t\\\"published\\\": \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e[1] As per \u003ca href=\"https://github.com/SublimeLinter/SublimeLinter/issues/512\" rel=\"noreferrer\"\u003ehttps://github.com/SublimeLinter/SublimeLinter/issues/512\u003c/a\u003e I rolled back to v1.7 to get PEP8 linting working.\u003c/p\u003e\n\n\u003cp\u003e[2] Coffeescript gets real-time linting, which is nice. \u003c/p\u003e","accepted_answer_id":"23858491","answer_count":"1","comment_count":"0","creation_date":"2013-10-03 03:36:21.49 UTC","last_activity_date":"2014-05-25 18:18:56.937 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2557196","post_type_id":"1","score":"6","tags":"sublimetext2|sublimelinter","view_count":"559"} +{"id":"3440975","title":"JSF2: ui:include: Component ID must be unique","body":"\u003cp\u003eBasic question:\u003c/p\u003e\n\n\u003cp\u003eIncluding a page, that contains a component with component id, multiple times cannot be done. But how can i have a reference to that component iside that included page?\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eExample:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cem\u003eincluded.xhtml\u003c/em\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e....\n\u0026lt;h:form id=\"foo\"/\u0026gt;\n....\n\u0026lt;!-- here i need reference to foo component of this page --\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cem\u003eindex.xhtml\u003c/em\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e....\n\u0026lt;ui:include src=\"included.xhtml\" /\u0026gt;\n\u0026lt;ui:include src=\"included.xhtml\" /\u0026gt;\n\u0026lt;ui:include src=\"included.xhtml\" /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"3441085","answer_count":"1","comment_count":"2","creation_date":"2010-08-09 14:25:52.953 UTC","favorite_count":"2","last_activity_date":"2010-08-09 14:41:34.237 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"238389","post_type_id":"1","score":"2","tags":"java|jsf|facelets|jsf-2","view_count":"3542"} +{"id":"38635375","title":"Why does specifying Map's initial capacity cause subsequent serializations to give different results?","body":"\u003cp\u003eI am trying to compare 2 \u003ccode\u003ebyte[]\u003c/code\u003e which are the results of serialization of the same object:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003e1 \u003ccode\u003ebyte[]\u003c/code\u003e is created by serializing the object\u003c/li\u003e\n\u003cli\u003ethe other by deserializing the 1st \u003ccode\u003ebyte[]\u003c/code\u003e and then serializing it again.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eI do not understand how these 2 arrays can be different. Deserializing the first \u003ccode\u003ebyte[]\u003c/code\u003e should reconstruct the original object, and serializing that object is the same as serializing the original one. So, the 2 \u003ccode\u003ebyte[]\u003c/code\u003e should be the same. However, under certain circumstances they can be different, apparently.\u003c/p\u003e\n\n\u003cp\u003eThe object I am serializing (\u003ccode\u003eState\u003c/code\u003e) holds a list of another object (\u003ccode\u003eMapWrapper\u003c/code\u003e) which in turn holds a single collection. Depending on the collection, I get different results from my comparison code.\u003c/p\u003e\n\n\u003cp\u003eHere is the MCVE:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport java.io.ByteArrayInputStream;\nimport java.io.ByteArrayOutputStream;\nimport java.io.IOException;\nimport java.io.ObjectInputStream;\nimport java.io.ObjectOutputStream;\nimport java.io.Serializable;\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\n\npublic class Test {\n\n public static void main(String[] args) {\n\n State state = new State();\n state.maps.add(new MapWrapper());\n\n byte[] pBA = stateToByteArray(state);\n State pC = byteArrayToState(pBA);\n byte[] zero = stateToByteArray(pC);\n System.out.println(Arrays.equals(pBA, zero)); // see output below\n State pC2 = byteArrayToState(pBA);\n byte[] zero2 = stateToByteArray(pC2);\n System.out.println(Arrays.equals(zero2, zero)); // always true\n }\n\n public static byte[] stateToByteArray(State s) {\n\n try {\n ByteArrayOutputStream bos = new ByteArrayOutputStream();\n ObjectOutputStream oos = new ObjectOutputStream(bos);\n oos.writeObject(s);\n return bos.toByteArray();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return null;\n }\n\n public static State byteArrayToState(byte[] bytes) {\n\n ObjectInputStream ois;\n try {\n ois = new ObjectInputStream(new ByteArrayInputStream(bytes));\n return (State) ois.readObject();\n } catch (IOException | ClassNotFoundException e) {\n e.printStackTrace();\n }\n return null;\n }\n}\n\nclass State implements Serializable {\n\n private static final long serialVersionUID = 1L;\n\n List\u0026lt;MapWrapper\u0026gt; maps = new ArrayList\u0026lt;\u0026gt;();\n}\n\nclass MapWrapper implements Serializable {\n\n private static final long serialVersionUID = 1L;\n\n // Different options, choose one!\n// List\u0026lt;Integer\u0026gt; ints = new ArrayList\u0026lt;\u0026gt;(); true\n// List\u0026lt;Integer\u0026gt; ints = new ArrayList\u0026lt;\u0026gt;(3); true\n// Map\u0026lt;String, Integer\u0026gt; map = new HashMap\u0026lt;\u0026gt;(); true\n// Map\u0026lt;String, Integer\u0026gt; map = new HashMap\u0026lt;\u0026gt;(2); false\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFor some reason, if \u003ccode\u003eMapWrapper\u003c/code\u003e contains a \u003ccode\u003eHashMap\u003c/code\u003e (or \u003ccode\u003eLinkedHashMap\u003c/code\u003e) \u003cem\u003eand\u003c/em\u003e is initialized with an initial capacity, the serialization gives a different result than a serialization-deserialization-serialization.\u003c/p\u003e\n\n\u003cp\u003eI added a 2nd iteration of deserialization-serialization and compared to the 1st. They are always equal. The difference manifests only after the first iteration.\u003c/p\u003e\n\n\u003cp\u003eNote that I must create a \u003ccode\u003eMapWrapper\u003c/code\u003e and add it to the list in \u003ccode\u003eState\u003c/code\u003e, as done in the start of \u003ccode\u003emain\u003c/code\u003e, to cause this.\u003c/p\u003e\n\n\u003cp\u003eAs much as I know, the initial capacity is a performance parameter \u003cem\u003eonly\u003c/em\u003e. Using the default one or a specified one should not change behavior or functionality.\u003c/p\u003e\n\n\u003cp\u003eI am using jdk1.8.0_25 and Windows7.\u003c/p\u003e\n\n\u003cp\u003eWhy does this happen?\u003c/p\u003e","accepted_answer_id":"38635690","answer_count":"1","comment_count":"2","creation_date":"2016-07-28 11:43:24.453 UTC","last_activity_date":"2016-07-28 12:02:00.333 UTC","last_edit_date":"2016-07-28 11:58:31.013 UTC","last_editor_display_name":"","last_editor_user_id":"1803551","owner_display_name":"","owner_user_id":"1803551","post_type_id":"1","score":"3","tags":"java|serialization|hashmap|linkedhashmap","view_count":"43"} +{"id":"25520025","title":"Google Drive error on import","body":"\u003cp\u003eI have followed the tutorial provided by Google. But I am experiencing error on the following imports:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport com.google.android.gms.common.api.GoogleApiClient;\nimport com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks;\nimport com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener;\nimport com.google.android.gms.common.api.ResultCallback;\nimport com.google.android.gms.drive.Drive;\nimport com.google.android.gms.drive.DriveApi.ContentsResult;\nimport com.google.android.gms.drive.MetadataChangeSet;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have already added Drive API and google_play_services library in my project. And Target SDK is 4.0 compiled with google APIs 4.0. And this is my Manifest. Please help.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\npackage=\"com.example.googledrivetest\"\nandroid:versionCode=\"1\"\nandroid:versionName=\"1.0\" \u0026gt;\n\n\u0026lt;uses-sdk\n android:minSdkVersion=\"8\"\n android:targetSdkVersion=\"14\" /\u0026gt;\n\n\u0026lt;application\n android:allowBackup=\"true\"\n android:icon=\"@drawable/ic_launcher\"\n android:label=\"@string/app_name\"\n android:theme=\"@style/AppTheme\" \u0026gt;\n \u0026lt;activity\n android:name=\"com.example.googledrivetest.MainActivity\"\n android:label=\"@string/app_name\" \u0026gt;\n \u0026lt;intent-filter\u0026gt;\n \u0026lt;action android:name=\"android.intent.action.MAIN\" /\u0026gt;\n\n \u0026lt;category android:name=\"android.intent.category.LAUNCHER\" /\u0026gt;\n \u0026lt;/intent-filter\u0026gt;\n \u0026lt;/activity\u0026gt;\n\n \u0026lt;meta-data android:name=\"com.google.android.gms.version\"\n android:value=\"@integer/google_play_services_version\" /\u0026gt;\n\n\u0026lt;/application\u0026gt;\n\n\u0026lt;uses-permission android:name=\"android.permission.INTERNET\" /\u0026gt;\n\u0026lt;uses-permission android:name=\"android.permission.GET_ACCOUNTS\" /\u0026gt;\n\u0026lt;uses-permission android:name=\"android.permission.USE_CREDENTIALS\" /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003c/p\u003e","accepted_answer_id":"25520115","answer_count":"1","comment_count":"6","creation_date":"2014-08-27 06:07:22.053 UTC","last_activity_date":"2014-08-27 06:13:09.44 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3835359","post_type_id":"1","score":"2","tags":"java|android|google-drive-sdk","view_count":"268"} +{"id":"2774808","title":"Escape double and single backslashes in a string in Ruby","body":"\u003cp\u003eI'm trying to access a network path in my ruby script on a windows platform in a format like this.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\\\\servername\\some windows share\\folder 1\\folder2\\\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow If I try to use this as a path, it won't work. Single backslashes are not properly escaped for this script.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epath = \"\\\\servername\\some windows share\\folder 1\\folder2\\\"\nd = Dir.new(path)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI tried everything I could think of to properly escape slashes in the path. However I can't escape that single backslash - because of it's special meaning. I tried single quotes, double quotes, escaping backslash itself, using alternate quotes such as %Q{} or %q{}, using ascii to char conversion. Nothing works in a sense that I'm not doing it right. :-) Right now the temp solution is to Map a network drive N:\\ pointing to that path and access it that way, but that not a solution.\u003c/p\u003e\n\n\u003cp\u003eDoes anyone have any idea how to properly escape single backslashes?\u003c/p\u003e\n\n\u003cp\u003eThank you\u003c/p\u003e","accepted_answer_id":"2774837","answer_count":"2","comment_count":"0","creation_date":"2010-05-05 15:54:21.203 UTC","favorite_count":"5","last_activity_date":"2013-06-13 16:13:26.73 UTC","last_edit_date":"2013-06-13 16:13:26.73 UTC","last_editor_display_name":"","last_editor_user_id":"329700","owner_display_name":"","owner_user_id":"198424","post_type_id":"1","score":"14","tags":"ruby-on-rails|ruby|escaping|backslash","view_count":"20096"} +{"id":"33313083","title":"(Java) Code works when using subclass, but using superclass causes a null pointer error?","body":"\u003cp\u003eI am writing a program to play spades. \u003c/p\u003e\n\n\u003cp\u003eI have a class, GenericSpadesPlayer\u003c/p\u003e\n\n\u003cp\u003eand two subclasses\u003c/p\u003e\n\n\u003cp\u003eSpadesPlayer extends GenericSpadesPlayer (these are computer players.), and\nHumanSpadesPlayer extends GenericSpadesPlayer\u003c/p\u003e\n\n\u003cp\u003eThe GenericSpadesPlayerClass, in its entirety, is as follows: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport java.io.*;\nimport java.util.*;\n\n public abstract class GenericSpadesPlayer{\n\n Set\u0026lt;Card\u0026gt; hand;\n int playerKey;\n\n public abstract Card playCard(Card[] playedCards, int[] bids, int[] tricksTaken, int leadSuit);\n public abstract int getBid();\n\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eEach of these member variables and methods are implemented in the SpadesPlayer and HumanSpadesPlayer classes, and both classes compile without errors.\u003c/p\u003e\n\n\u003cp\u003eThe problem is in the main method of the class that runs the game. Originally, I had only created SpadesPlayer objects, and my code read:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSpadesPlayer north = new SpadesPlayer(3);\nSpadesPlayer south = new SpadesPlayer(1);\nSpadesPlayer east = new SpadesPlayer(4);\nSpadesPlayer west = new SpadesPlayer(2);\n\nSpadesPlayer[] rotation = {south, west, north, east};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand then, when I dealt the cards:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003efor (int i=0; i\u0026lt;deck.deck.length; i++){\n rotation[currentPos].hand.add(deck.dealCard()); //currentPos is initialized to be 1\n currentPos = (currentPos + 1) % 4;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eEverything works fine.\u003c/p\u003e\n\n\u003cp\u003eThe problem came when I developed the GenericSpadesPlayer class and allowed SpadesPlayer and HumanSpadesPlayer to inherit from it. When I changed:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSpadesPlayer[] rotation = {south, west, north, east};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eto\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eGenericSpadesPlayer[] rotation = {south, west, north, east};\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e, I got an error on the following line:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003erotation[currentPos].hand.add(deck.dealCard());\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAfter attempting to debug, the program says that rotation[currentPos].hand is null. Hand is not initialized in GenericSpadesPlayer because it is an abstract class; however, south, west, north, and east (all the elements of the rotation array) are all SpadesPlayers or HumanSpadesPlayers, and hand is initialized in their constructors. It should also be noted that no matter what combination of SpadesPlayers or HumanSpadesPlayers I include in the rotation array, I always get this error, as long as rotation is declared to be an array of GenericSpadesPlayers and not SpadesPlayers.\u003c/p\u003e\n\n\u003cp\u003eAny advice? I thought making an array of GenericSpadesPlayers would allow me to populate it with both SpadesPlayers and HumanSpadesPlayers, but I appear to be running into issues.\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2015-10-23 23:59:52.82 UTC","last_activity_date":"2015-10-24 00:29:11.347 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5482101","post_type_id":"1","score":"0","tags":"java|nullpointerexception","view_count":"334"} +{"id":"41612004","title":"A4J:support doesn't work when javascript event is setted into h:inputText","body":"\u003cp\u003eI'm maintaining a JSF legacy system and I have a following problem:\nThere is a:inputText component with events onchange, onkeyup and onkeydown triggering javascript function, like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;h:inputText id=\"idX\" \n value=\"#{myBackingbean.myProperty}\"\n maxlength=\"14\" size=\"14\"\n onkeypress=\"return javascriptMethodOne(event);\"\n onkeyup=\"javascriptMethodTwo(this, 1), javascriptMethodThree('idX','other_ID',14,event);\"\n onchange=\"javascriptMethodTwo(this, 1); javascriptMethodFour(JS_CONST);\" /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI need call a backing bean method from h:inputText and I thought add a a4j:support into h:inputText, like this code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;h:inputText ... \u0026gt;\n \u0026lt;a4j:support .../\u0026gt;\n\u0026lt;/h:inputText\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe problem is a4j:support doesn't work when events are setted in componet h:inputText. \u003c/p\u003e\n\n\u003cp\u003eSo, keeping the calls of javascript functions, how I can do to call a backing bean method when onchange, onkeyup or onkeydown is triggered?\u003c/p\u003e\n\n\u003cp\u003eThe following code doesn't work:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;h:inputText id=\"idX\" \n value=\"#{myBackingbean.myProperty}\"\n maxlength=\"14\" size=\"14\"\n onkeypress=\"return javascriptMethodOne(event);\"\n onkeyup=\"javascriptMethodTwo(this, 1), javascriptMethodThree('idX','other_ID',14,event);\"\n onchange=\"javascriptMethodTwo(this, 1); javascriptMethodFour(JS_CONST);\"\u0026gt;\n\n\u0026lt;a4j:support action=\"#{myBackingbean.myMethod}\" event=\"onchange\"/\u0026gt;\n\n \u0026lt;a4j:support action=\"#{myBackingbean.myMethod}\" event=\"onkeyup\"/\u0026gt;\n\n \u0026lt;a4j:support action=\"#{myBackingbean.myMethod}\" event=\"onkeydown\"/\u0026gt;\n\n\u0026lt;/h:inputText\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThx!\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2017-01-12 11:24:54.813 UTC","last_activity_date":"2017-01-12 11:24:54.813 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4886979","post_type_id":"1","score":"0","tags":"javascript|ajax|jsf|richfaces|ajax4jsf","view_count":"64"} +{"id":"16522450","title":"What is the class for a jQuery tooltip?","body":"\u003cp\u003eI've looked around as this would seem a duplicate sort of question, but it hasn't shown up in my search.\u003c/p\u003e\n\n\u003cp\u003eWhen using jQuery's jQuery(document).tooltip(), what CSS selectors apply to the tooltip?\u003c/p\u003e\n\n\u003cp\u003eThanks,\u003c/p\u003e","answer_count":"1","comment_count":"4","creation_date":"2013-05-13 12:47:15.673 UTC","last_activity_date":"2013-05-13 13:47:13.36 UTC","last_edit_date":"2013-05-13 12:49:40.317 UTC","last_editor_display_name":"","last_editor_user_id":"447356","owner_display_name":"","owner_user_id":"116906","post_type_id":"1","score":"0","tags":"jquery|jquery-ui|jquery-tooltip","view_count":"91"} +{"id":"7561658","title":"How to change the page/plot two figures","body":"\u003cp\u003eI am developing a tool that should produce 3 plots. Two of those are related and therefor I have created them using the the pyplot.subplot. The third one needs more space, and I would like to create it on a single chart. \n\u003cimg src=\"https://i.stack.imgur.com/vPWmj.png\" alt=\"What for are the arrows??\"\u003e\u003c/p\u003e\n\n\u003cp\u003eIt is clear to me, that I could plot two figures. But I would like to know how to get them showed in this same window, So that they can be accessed with these arrows.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2011-09-26 21:38:51.11 UTC","last_activity_date":"2011-09-28 10:34:54.777 UTC","last_edit_date":"2011-09-27 07:12:39.023 UTC","last_editor_display_name":"","last_editor_user_id":"502381","owner_display_name":"","owner_user_id":"959888","post_type_id":"1","score":"0","tags":"matplotlib|figures","view_count":"133"} +{"id":"43711110","title":"Google Cloud Platform access tensorboard","body":"\u003cp\u003eI am new to Google Cloud (and unix) and have been using \u003ccode\u003eml-engine\u003c/code\u003e to train a neural net using Tensorflow.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://cloud.google.com/ml-engine/docs/how-tos/monitor-training\" rel=\"nofollow noreferrer\"\u003eHere\u003c/a\u003e it says that you can monitor the app using \u003ccode\u003etensorboard\u003c/code\u003e. How can I access the \u003ccode\u003etensorboard\u003c/code\u003e panel? When I run it (from the Cloud Shell Access console) it says it's running at \u003ca href=\"http://0.0.0.0:6006\" rel=\"nofollow noreferrer\"\u003ehttp://0.0.0.0:6006\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI don't know the IP of the Cloud Shell console, how can I access the tensorboard panel?\u003c/p\u003e\n\n\u003cp\u003eThe command I run (and output):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etensorboard --logdir=gs://model_output\nStarting TensorBoard 47 at http://0.0.0.0:6006\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","accepted_answer_id":"43711902","answer_count":"1","comment_count":"0","creation_date":"2017-04-30 20:42:21.673 UTC","last_activity_date":"2017-04-30 22:15:38.287 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"407650","post_type_id":"1","score":"1","tags":"unix|google-cloud-platform|tensorboard","view_count":"412"} +{"id":"46972399","title":"Crash when applying filter to AVVideoComposition","body":"\u003cp\u003eI want to apply filter to AVVideoComposition by function:\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003einit(asset: AVAsset, applyingCIFiltersWithHandler: (AVAsynchronousCIImageFilteringRequest) -\u0026gt; Void)\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eIn which, the \u003ccode\u003easset\u003c/code\u003e is \u003ccode\u003eAVComposition\u003c/code\u003e. When an \u003ccode\u003eAVPlayerItem\u003c/code\u003e plays this composition with the videoComposition, app crashes with error:\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003ereason: '*** -[AVCoreImageFilterCustomVideoCompositor startVideoCompositionRequest:] Expecting video composition to contain only AVCoreImageFilterVideoCompositionInstruction'\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eI wonder how to fix the crash.\u003c/p\u003e\n\n\u003cp\u003ePS: I have two videoTracks in composition, each timeRange has its instruction\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-10-27 09:58:48.487 UTC","last_activity_date":"2017-11-16 14:07:19.387 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"8842218","post_type_id":"1","score":"0","tags":"ios|video|filter","view_count":"27"} +{"id":"34962104","title":"Pandas: How can I use the apply() function for a single column?","body":"\u003cp\u003eI have a pandas data frame with two columns. I need to change the values of the first column without affecting the second one and get back the whole data frame with just first column values changed. How can I do that using apply in pandas?\u003c/p\u003e","accepted_answer_id":"34962199","answer_count":"3","comment_count":"2","creation_date":"2016-01-23 10:04:27.58 UTC","favorite_count":"8","last_activity_date":"2017-08-22 16:18:07.417 UTC","last_edit_date":"2017-04-19 12:44:24.76 UTC","last_editor_display_name":"","last_editor_user_id":"2699288","owner_display_name":"","owner_user_id":"852063","post_type_id":"1","score":"41","tags":"python|pandas|dataframe|python-3.5","view_count":"55474"} +{"id":"18939712","title":"How to compute the Class Interval Arithmetic Mean?","body":"\u003cp\u003eI'm making a program that computes the class interval arithmetic mean but there is a little bit error in its error...\u003c/p\u003e\n\n\u003cp\u003eFor example:\nI will input (10-20,21-30) in my interval_Values and i will input(1,2) in my frequency_values and the computation goes this way:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e((10+20)/2),((21+30)/2)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand it will give\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e15,25.5\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ethen again it will multiply these values to the value of frequency_Values\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e(15*1)+(25.5*2)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand this will give the result of\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e(15+51)=66\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand after these. It will going to divide 66 to the sum of the frequency_Values which is\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e(1+3)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e66/3=22\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn my program when i input these values, it gives the result of 15. What would be the error.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e final AutoCompleteTextView interval_Values = (AutoCompleteTextView) findViewById(R.id.interval_Values);\n final AutoCompleteTextView frequency_Values = (AutoCompleteTextView) findViewById(R.id.frequency_Values);\n final TextView txtSummation = (TextView) findViewById(R.id.txtSummation);\n final TextView txtArithmetic = (TextView) findViewById(R.id.txtArithmetic);\n\n Button btncalculate = (Button) findViewById(R.id.btncalculate);\n btncalculate.setOnClickListener(new OnClickListener(){\n\n @Override\n public void onClick(View v) {\n String[] interval = interval_Values.getText().toString().split(\",\");\n String[] frequency= frequency_Values.getText().toString().split(\",\");\n double [] x = new double[interval.length];\n double [] y = new double[frequency.length];\n\n double freq=0;\n double xy=0;\n double result=0;\n\n for(int j=0;j\u0026lt;interval.length;j++){\n String[] intr=interval[j].split(\"-\");\n x[j]=Double.parseDouble(intr[j]);\n\n double midpoint=((x[0])+(x[1]))/2;\n\n y[j]=Double.parseDouble(frequency[j]);\n freq+=y[j];\n xy+=midpoint*y[j];\n result =xy/freq;\n\n }\n txtArithmetic.setText(Double.toString(result));\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2013-09-22 02:35:48.277 UTC","last_activity_date":"2013-09-23 04:24:35.283 UTC","last_edit_date":"2013-09-23 04:24:35.283 UTC","last_editor_display_name":"","last_editor_user_id":"2636191","owner_display_name":"","owner_user_id":"2636191","post_type_id":"1","score":"0","tags":"java|android","view_count":"150"} +{"id":"15104207","title":"PHP file won't pass Wordpress Variable Properly","body":"\u003cp\u003eHave a really weird problem and can't figure out. I'm using 'UPLOADIFY' to upload images from a small web app. It was working perfectly for months, then all of a sudden stopped working. Ideally I want to grab the logged in Wordpress user's username and add it to the image filename.\u003c/p\u003e\n\n\u003cp\u003eHere is part of my uploadify file:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;?php\ninclude_once($_SERVER['DOCUMENT_ROOT'] .'/wp-config.php');\ninclude_once($_SERVER['DOCUMENT_ROOT'] .'/wp-load.php');\ninclude_once($_SERVER['DOCUMENT_ROOT'] .'/wp-includes/wp-db.php');\nglobal $user_login , $user_email;\n get_currentuserinfo();\n\n$variableuser_id = $user_login;\n$ses_id = $variableuser_id;\n$ses_id = \"1\" . $ses_id . \"z\";\necho \"This is a test \" . $ses_id;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThen later in uploadify I have:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eif (!empty($_FILES)) {\n $tempFile = $_FILES['Filedata']['tmp_name'];\n $targetPath = $_SERVER['DOCUMENT_ROOT'] . $targetFolder;\n $targetFile = rtrim($targetPath,'/') . '/' . $ses_id . \"-\" . str_replace(\" \", \"\", $_FILES['Filedata']['name']);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eSo...when I upload an image using uploadify it will not add the username into the image name, it does ad the \"1\" and the \"z\" to the file name but is totally missing the username in the middle.\u003c/p\u003e\n\n\u003cp\u003eIf I launch the uploadify.php file regular in my browser it will display \"This is a test 1adminz\" as it should for being logged in as admin. Any ideas? I'm stumped! BTW I know $ses_id isn't ideal varname but it was just carrying over in my code from when I had a session ID named that.\u003c/p\u003e","accepted_answer_id":"15138280","answer_count":"2","comment_count":"1","creation_date":"2013-02-27 04:25:32.873 UTC","last_activity_date":"2013-02-28 14:41:53.407 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"2113861","post_type_id":"1","score":"0","tags":"php|wordpress|uploadify","view_count":"89"} +{"id":"22056179","title":"Python self.assertRaises","body":"\u003cp\u003eI have a small code as below, please help me how to write this in a correct way. I want to check if ID is present in the \u003ccode\u003evalue\u003c/code\u003e and if not then it raises an exception.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evalue = ({'av' : '123', 'user' : 'abc', 'version' : 'xyz'})\n\nwith self.assertRaises(IndexError, value[0][\"ID\"]):\n print \"not an error\"\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"1","creation_date":"2014-02-26 23:55:24.06 UTC","last_activity_date":"2014-02-27 20:33:06.063 UTC","last_edit_date":"2014-02-27 00:07:14.197 UTC","last_editor_display_name":"","last_editor_user_id":"472695","owner_display_name":"","owner_user_id":"2511126","post_type_id":"1","score":"1","tags":"python|unit-testing|pyunit|assertraises","view_count":"3517"} +{"id":"9109851","title":"Creating tree grid using jqGrid with json data","body":"\u003cp\u003eI'm trying to create tree using json data\u003c/p\u003e\n\n\u003cp\u003eI have:\u003c/p\u003e\n\n\u003cp\u003ejson data:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e{\n \"page\":\"1\",\n \"total\":4,\n \"records\":36,\n \"rows\":{\n \"1\":{\n \"taxonomy_id\":\"1\",\n \"taxonomy_type_id\":\"product\",\n \"parent_id\":null,\n \"name\":\"Agriculture\",\n \"slug\":\"agriculture\",\n \"description\":\"Agriculture\",\n \"sort_order\":\"0\",\n \"is_visible\":\"1\",\n \"data\":null,\n \"parent_name\":null,\n \"level\":1,\n \"is_leaf\":true\n },\n \"4\":{\n \"taxonomy_id\":\"4\",\n \"taxonomy_type_id\":\"product\",\n \"parent_id\":\"1\",\n \"name\":\"Rice\",\n \"slug\":\"rice\",\n \"description\":\"Rice\",\n \"sort_order\":\"0\",\n \"is_visible\":\"1\",\n \"data\":null,\n \"parent_name\":\"Agriculture\",\n \"level\":2,\n \"is_leaf\":true\n },\n \"5\":{\n \"taxonomy_id\":\"5\",\n \"taxonomy_type_id\":\"product\",\n \"parent_id\":\"1\",\n \"name\":\"Apples\",\n \"slug\":\"apples\",\n \"description\":\"Apples\",\n \"sort_order\":\"0\",\n \"is_visible\":\"1\",\n \"data\":null,\n \"parent_name\":\"Agriculture\",\n \"level\":2,\n \"is_leaf\":true\n },\n \"6\":{\n \"taxonomy_id\":\"6\",\n \"taxonomy_type_id\":\"product\",\n \"parent_id\":\"1\",\n \"name\":\"Olive Oil\",\n \"slug\":\"olive-oil\",\n \"description\":\"Olive Oil\",\n \"sort_order\":\"0\",\n \"is_visible\":\"1\",\n \"data\":\"\",\n \"parent_name\":\"Agriculture\",\n \"level\":2,\n \"is_leaf\":true\n },\n \"2\":{\n \"taxonomy_id\":\"2\",\n \"taxonomy_type_id\":\"product\",\n \"parent_id\":null,\n \"name\":\"Apparel\",\n \"slug\":\"apparel\",\n \"description\":\"Apparel\",\n \"sort_order\":\"0\",\n \"is_visible\":\"1\",\n \"data\":null,\n \"parent_name\":null,\n \"level\":1,\n \"is_leaf\":true\n },\n \"7\":{\n \"taxonomy_id\":\"7\",\n \"taxonomy_type_id\":\"product\",\n \"parent_id\":\"2\",\n \"name\":\"Clothes\",\n \"slug\":\"clothes-2\",\n \"description\":\"Clothes\",\n \"sort_order\":\"0\",\n \"is_visible\":\"1\",\n \"data\":null,\n \"parent_name\":\"Apparel\",\n \"level\":2,\n \"is_leaf\":true\n },\n \"8\":{\n \"taxonomy_id\":\"8\",\n \"taxonomy_type_id\":\"product\",\n \"parent_id\":\"7\",\n \"name\":\"Men's Clothing\",\n \"slug\":\"mens-clothing\",\n \"description\":\"Men's Clothing\",\n \"sort_order\":\"0\",\n \"is_visible\":\"1\",\n \"data\":null,\n \"parent_name\":\"Clothes\",\n \"level\":3,\n \"is_leaf\":true\n },\n \"3\":{\n \"taxonomy_id\":\"3\",\n \"taxonomy_type_id\":\"product\",\n \"parent_id\":null,\n \"name\":\"Automobiles \u0026amp; Motorcycles\",\n \"slug\":\"automobiles-motorcycles\",\n \"description\":\"Automobiles \u0026amp; Motorcycles\",\n \"sort_order\":\"0\",\n \"is_visible\":\"1\",\n \"data\":null,\n \"parent_name\":null,\n \"level\":1,\n \"is_leaf\":true\n },\n \"9\":{\n \"taxonomy_id\":\"9\",\n \"taxonomy_type_id\":\"product\",\n \"parent_id\":null,\n \"name\":\"Hardware\",\n \"slug\":\"hardware\",\n \"description\":\"Hardware\",\n \"sort_order\":\"0\",\n \"is_visible\":\"1\",\n \"data\":null,\n \"parent_name\":null,\n \"level\":1,\n \"is_leaf\":true\n },\n \"10\":{\n \"taxonomy_id\":\"10\",\n \"taxonomy_type_id\":\"product\",\n \"parent_id\":null,\n \"name\":\"Computer Hardware \u0026amp; Software\",\n \"slug\":\"computer-hardware-software\",\n \"description\":\"Computer Hardware \u0026amp; Software\",\n \"sort_order\":\"0\",\n \"is_visible\":\"1\",\n \"data\":null,\n \"parent_name\":null,\n \"level\":1,\n \"is_leaf\":true\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ejavascript code like this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e/* grid */ \n $('#the-grid').jqGrid({\n url: SITE_URL+'/admin/taxonomy/taxo_data/category',\n datatype: 'json',\n mtype: 'GET',\n colNames:['ID', 'Parent ID', 'Parent', 'Name', 'Description', 'Machine Code', 'Sort Order', 'Is Visible', 'Data', 'Type'], \n colModel:[ \n {name:'taxonomy_id',index:'taxonomy_id', width:15, jsonmap: 'taxonomy_id'}, \n {name:'parent_id',index:'parent_id', width:15, jsonmap: 'parent_id'}, \n {name:'parent_name',index:'parent_name', width:15, jsonmap: 'parent_name'}, \n {name:'name',index:'name', width:15, jsonmap: 'name'}, \n {name:'description',index:'description', width:15, jsonmap: 'description'}, \n {name:'slug',index:'slug', width:15, jsonmap: 'slug'}, \n {name:'sort_order',index:'sort_order', width:15, jsonmap: 'sort_order', align: 'right'}, \n {name:'is_visible',index:'is_visible', width:15, jsonmap: 'is_visible', formatter: boolFormatter, unformat: boolUnFormatter, formatoptions: {iconTrue: 'ui-icon-check', iconFalse: 'ui-icon-minus'}, align:'center'}, \n {name:'data',index:'data', width:15, jsonmap: 'data', hidden:true}, \n {name:'taxonomy_type_id',index:'taxonomy_type_id', width:15, jsonmap: 'taxonomy_type_id', hidden:true}\n ],\n editurl:SITE_URL+'/admin/taxonomy/taxo_crud',\n rowNum: 10,\n rowList: [10, 25, 50, 75, 100],\n pager: '#the-grid-pager',\n autowidth: true,\n sortname: 'taxonomy_id',\n sortorder: 'ASC',\n height: 400,\n viewrecords: true,\n treeGridModel:'adjacency',\n caption: 'Taxonomy Items',\n jsonReader : { \n root: \"rows\", \n page: \"page\", \n total: \"total\", \n records: \"records\", \n repeatitems: false, \n cell: \"\", \n id: \"taxonomy_id\"\n }\n });\n $('#the-grid').jqGrid('navGrid','#the-grid-pager',{edit:false,add:false,del:false, search: false});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eData is loaded, but the grid is not shown up. What could be the problem ?Is my json data format correct ?\u003c/p\u003e","accepted_answer_id":"9111350","answer_count":"1","comment_count":"0","creation_date":"2012-02-02 09:26:55.367 UTC","favorite_count":"1","last_activity_date":"2015-10-28 16:54:01.53 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"203211","post_type_id":"1","score":"0","tags":"jqgrid","view_count":"2867"} +{"id":"33925330","title":"Function in Controller not being hit","body":"\u003cp\u003eFirst time asking a q, so if I'm doing something wrong, please let me know so I can fix it as I have tried finding the answer on here, but can not, so any and all help would be greatly appreciated.\u003c/p\u003e\n\n\u003cp\u003eI'm trying to load a list of \"Countries\" using a controller and all seems to be going well, no errors, no warnings, it loads the module and hits the angular controller, but it never hits the function/goes into the code inside the function of the controller. Am I missing something? Am I doing something wrong?\u003c/p\u003e\n\n\u003cp\u003eRegister.cshtml\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div ng-app=\"RegisterApp\" class=\"form-group\" ng-controller=\"CountriesController as CountriesCtrl\"\u0026gt;\n \u0026lt;label class=\"input-desc\"\u0026gt;Country\u0026lt;/label\u0026gt;\n \u0026lt;select ng-model=\"country\" \n ng-options=\"country.Id as country.Name for country in countries\"\u0026gt;\n \u0026lt;option value=\"{{CountriesCtrl.country.Id}}\"\u0026gt;{{CountriesCtrl.country.Name}}\u0026lt;/option\u0026gt;\n \u0026lt;/select\u0026gt;\n\u0026lt;/div\u0026gt;\u0026lt;!-- End .from-group --\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eRegisterApp.js\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar app = angular.module(\"RegisterApp\", []);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCountriesService.js\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e/// \u0026lt;reference path=\"../App.js\" /\u0026gt;\n\nangular.module(\"RegisterApp\").service(\"CountriesService\", function ($http) {\n this.getCountries = function () {\n return $http({\n method: \"Get\",\n url: \"/Account/GetCountries\"\n });\n };\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eCountriesController.js\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e/// \u0026lt;reference path=\"../Services/CountriesService.js\" /\u0026gt;\n\nangular.module(\"RegisterApp\").controller(\"CountriesController\", function ($scope, CountriesService) {\n getCountries();\n\n function getCountries() {\n CountriesService.getCountries()\n .success(function (data, status, headers, config) {\n $scope.countries = data;\n $scope.country = $scope.countries[0];\n })\n .error(function (data, status, headers, config) {\n $scope.message = 'Unexpected Error';\n });\n }\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eEdit: Moved the ng-app, was mistakenly copied over like that, was a change I made just to try something before posting the q, sorry for that\u003c/p\u003e","accepted_answer_id":"33942281","answer_count":"2","comment_count":"3","creation_date":"2015-11-25 19:55:53.037 UTC","last_activity_date":"2015-11-30 08:53:59.71 UTC","last_edit_date":"2015-11-26 15:41:14.137 UTC","last_editor_display_name":"","last_editor_user_id":"5584786","owner_display_name":"","owner_user_id":"5584786","post_type_id":"1","score":"0","tags":"javascript|angularjs|html5|angularjs-controller","view_count":"274"} +{"id":"20795016","title":"Delete posts of deleted user wordpress","body":"\u003cp\u003eI am using buddypress with \u003ccode\u003ewordpress\u003c/code\u003e.I accidentally deleted a user directly in data base table \u003ccode\u003ewp_users\u003c/code\u003e. Therefore just the user only deleted but the posts posted by him remains in the site. How to \u003ccode\u003edelete all the posts\u003c/code\u003e related to that deleted user. Is there any way?\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2013-12-27 04:58:48.077 UTC","last_activity_date":"2013-12-27 14:18:58.34 UTC","last_edit_date":"2013-12-27 14:18:58.34 UTC","last_editor_display_name":"","last_editor_user_id":"2693568","owner_display_name":"","owner_user_id":"1986080","post_type_id":"1","score":"0","tags":"database|wordpress","view_count":"100"} +{"id":"27193506","title":"iOS Handle push notification when app is not running","body":"\u003cp\u003eI'm trying to use push notifications for my app. It's working when the app is running or when it's in background. But if the user \"kills\" the app and if I send a push notification, when the user taps on the notification, the app doesn't open to handle it.\u003c/p\u003e\n\n\u003cp\u003eHow can I do this? I want to call a specific view when the user taps on a notification.\u003c/p\u003e\n\n\u003cp\u003eIn my function \u003ccode\u003edidFinishLaunchingWithOptions:\u003c/code\u003e, I wrote this:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eif (launchOptions != nil){\n [self callView];\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI call the same function, \u003ccode\u003e[self callView];\u003c/code\u003e, in \u003ccode\u003edidReceiveRemoteNotification:\u003c/code\u003e. But it's not working unless the app is active or in the background.\u003c/p\u003e","answer_count":"0","comment_count":"10","creation_date":"2014-11-28 17:27:09.14 UTC","last_activity_date":"2015-02-26 09:24:48.077 UTC","last_edit_date":"2014-11-28 17:51:22.753 UTC","last_editor_display_name":"","last_editor_user_id":"2274694","owner_display_name":"","owner_user_id":"3307021","post_type_id":"1","score":"0","tags":"ios|iphone|notifications|push|handle","view_count":"1237"} +{"id":"46183665","title":"excel VBA 1004 error when copying multiple tabs into one tab from a folder","body":"\u003cp\u003eI am getting a 1004 error when I try and combine workbook pages into one master document. The code works correctly on my device, but when I attempt to run the code on my friends device it throw a 1004 error. I believe he is on excel 2013, I am on excel 2016. Is there any way to convert my code into something that can be used on both devices? \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eSub CombineSheets()\nDim sPath As String\nDim sFname As String\nDim wBk As Workbook\nDim wSht As Variant\n\nApplication.EnableEvents = False\nApplication.ScreenUpdating = False\nsPath = InputBox(\"Enter a full path to workbooks\")\nChDir sPath\nsFname = InputBox(\"Enter a filename pattern\")\nsFname = Dir(sPath \u0026amp; \"\\\" \u0026amp; sFname \u0026amp; \".xl*\", vbNormal)\nwSht = InputBox(\"Enter a worksheet name to copy\")\nDo Until sFname = \"\"\n Set wBk = Workbooks.Open(sFname)\n Windows(sFname).Activate\n Sheets(wSht).Copy Before:=ThisWorkbook.Sheets(1)\n wBk.Close False\n sFname = Dir()\nLoop\nActiveWorkbook.Save\nApplication.EnableEvents = True\nApplication.ScreenUpdating = True\nEnd Sub\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThis works correctly when I run it, prompts for the folder location, asks which files it should copy from (usually *), and then copies from specifically the worksheet name entered.\u003c/p\u003e\n\n\u003cp\u003eRealistically all I need is code that can extract one worksheet from several hundred excel files and combine them into one master document. being able to pick and choose which worksheets would just be a bonus.\u003c/p\u003e\n\n\u003cp\u003eThank you!\u003c/p\u003e","answer_count":"1","comment_count":"6","creation_date":"2017-09-12 19:02:34.48 UTC","last_activity_date":"2017-09-12 20:55:02.563 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"8599517","post_type_id":"1","score":"1","tags":"excel|vba|excel-vba","view_count":"29"} +{"id":"45181560","title":"Concourse CI windows/strict mime type checking","body":"\u003cp\u003eWhen running concourse ci v3.3.2 locally on Windows I get these errors:\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eRefused to execute script from\n '\u003ca href=\"http://192.168.178.29:8080/public/index.js?id=932c553753eec4ef375e1c17f4b28c10\" rel=\"nofollow noreferrer\"\u003ehttp://192.168.178.29:8080/public/index.js?id=932c553753eec4ef375e1c17f4b28c10\u003c/a\u003e' because its MIME type ('text/plain') is not executable, and strict\n MIME type checking is enabled.\n 192.168.178.29/:1 Refused to execute script from '\u003ca href=\"http://192.168.178.29:8080/public/d3.v355.min.js?id=5936da7688d010c60aaf8374f90fcc2b\" rel=\"nofollow noreferrer\"\u003ehttp://192.168.178.29:8080/public/d3.v355.min.js?id=5936da7688d010c60aaf8374f90fcc2b\u003c/a\u003e' because its MIME type ('text/plain') is not executable, and strict\n MIME type checking is enabled.\n 192.168.178.29/:1 Refused to execute script from '\u003ca href=\"http://192.168.178.29:8080/public/graph.js?id=3e2a3f561ec6c52216e80266ef0212d2\" rel=\"nofollow noreferrer\"\u003ehttp://192.168.178.29:8080/public/graph.js?id=3e2a3f561ec6c52216e80266ef0212d2\u003c/a\u003e' because its MIME type ('text/plain') is not executable, and strict\n MIME type checking is enabled.\n 192.168.178.29/:1 Refused to execute script from '\u003ca href=\"http://192.168.178.29:8080/public/jquery-2.1.1.min.js?id=e40ec2161fe7993196f23c8a07346306\" rel=\"nofollow noreferrer\"\u003ehttp://192.168.178.29:8080/public/jquery-2.1.1.min.js?id=e40ec2161fe7993196f23c8a07346306\u003c/a\u003e'\n because its MIME type ('text/plain') is not executable, and strict\n MIME type checking is enabled.\n 192.168.178.29/:1 Refused to execute script from '\u003ca href=\"http://192.168.178.29:8080/public/concourse.js?id=b4688d002041187f6c55f6e8699442ba\" rel=\"nofollow noreferrer\"\u003ehttp://192.168.178.29:8080/public/concourse.js?id=b4688d002041187f6c55f6e8699442ba\u003c/a\u003e' because its MIME type ('text/plain') is not executable, and strict\n MIME type checking is enabled. (index):1 Refused to execute script\n from\n '\u003ca href=\"http://192.168.178.29:8080/public/elm.min.js?id=d38f054604f3aaf5cd4eb0616b3cb3ef\" rel=\"nofollow noreferrer\"\u003ehttp://192.168.178.29:8080/public/elm.min.js?id=d38f054604f3aaf5cd4eb0616b3cb3ef\u003c/a\u003e' because its MIME type ('text/plain') is not executable, and strict\n MIME type checking is enabled. (index):20 Uncaught ReferenceError: Elm\n is not defined\n at (index):20\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eIt's probably something obvious but couldn't find anything on google/stack overflow for these errors in combination with Concourse\u003c/p\u003e","answer_count":"0","comment_count":"4","creation_date":"2017-07-19 05:21:04.183 UTC","last_activity_date":"2017-07-19 05:26:12.667 UTC","last_edit_date":"2017-07-19 05:26:12.667 UTC","last_editor_display_name":"","last_editor_user_id":"22180","owner_display_name":"","owner_user_id":"22180","post_type_id":"1","score":"0","tags":"concourse","view_count":"28"} +{"id":"17617481","title":"Android - hidden text --\u003e show text for 2 seconds --\u003e hide text again","body":"\u003cp\u003eI am developing a board game that user plays with android. Since android is quite fast, I want to fake that android is performing some tough calculations and thus needs time for its next move.\u003c/p\u003e\n\n\u003cp\u003eWhat I want to do:-\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003eUser turn - he moves.\u003c/li\u003e\n\u003cli\u003eAndroid turn - android shows text \"I am thinking\" for 2 seconds\u003c/li\u003e\n\u003cli\u003eAndroid hides that text and \u003cstrong\u003eand only after that\u003c/strong\u003e moves his turn.\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eI tried doing:-\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eonAndroidTurn(){\n textView1.setVisibility(View.VISIBLE);\n Thread.sleep(2000);\n textView2.setVisibility(View.GONE);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut what happens is that thread sleeps but text is not shown (okay I know why).\u003c/p\u003e\n\n\u003cp\u003eThen searching on stackoverflow, I learnt a way:-\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eonAndroidTurn(){\n textView1.setVisibility(View.VISIBLE);\n new Handler().postDelayed(new Runnable(){\n void run() {\n textView1.setVisibility(View.GONE);\n }\n }, 2000);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow what this does is that it runs that text in another thread and android's turn is updated on screen and after moving it's turn android showing \"Thinking\" is total stupidity.\u003c/p\u003e\n\n\u003cp\u003eWhat can I do for this?\u003c/p\u003e","accepted_answer_id":"17618131","answer_count":"3","comment_count":"6","creation_date":"2013-07-12 14:37:39.83 UTC","last_activity_date":"2017-10-08 18:10:50.23 UTC","last_edit_date":"2017-10-08 18:10:50.23 UTC","last_editor_display_name":"","last_editor_user_id":"2365197","owner_display_name":"","owner_user_id":"2365197","post_type_id":"1","score":"0","tags":"java|android|multithreading|thread-sleep","view_count":"1436"} +{"id":"32579379","title":"AngularJS does not evaluate expression","body":"\u003cp\u003eI am beginner in AngularJS, so I try to run basic code. However, this simple code does not work in a way I want. The html code is the following:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;!DOCTYPE html\u0026gt;\n\u0026lt;html ng-app\u0026gt; \n\u0026lt;head\u0026gt;\n \u0026lt;script src=\"js/angular.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\n \u0026lt;script\u0026gt; \n function MyFirstCtrl($scope) { \n var employees = ['Jon Doe', 'Abe Lincoln', 'Hugh Grant']; \n $scope.ourEmployees = employees;\n } \n \u0026lt;/script\u0026gt;\n\u0026lt;/head\u0026gt; \n\u0026lt;body ng-controller='MyFirstCtrl'\u0026gt; \n \u0026lt;h2\u0026gt;Number of Employees: {{ourEmployees.length}}\u0026lt;/h2\u0026gt; \n\u0026lt;/body\u0026gt;\n\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'd expect that the correct result is \u003cstrong\u003eNumber of Employees: 3\u003c/strong\u003e\nInstead of this, the browser (both Firefox and Edge) shows the following: \u003cstrong\u003eNumber of Employees: {{ourEmployees.length}}\u003c/strong\u003e. Since other simple codes did work, the problem is surely not the reference to the \u003cem\u003eangular.min.js\u003c/em\u003e file.\u003c/p\u003e\n\n\u003cp\u003eThanks in advance.\u003c/p\u003e","accepted_answer_id":"32579748","answer_count":"1","comment_count":"1","creation_date":"2015-09-15 06:43:47.62 UTC","last_activity_date":"2015-09-15 07:05:10.467 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4386646","post_type_id":"1","score":"0","tags":"javascript|angularjs","view_count":"235"} +{"id":"31582827","title":"Disable Volley logs in Android application","body":"\u003ch1\u003eThe problem\u003c/h1\u003e\n\n\u003cp\u003eI'm developing a SDK with using \u003ca href=\"http://developer.android.com/intl/zh-cn/training/volley/index.html\" rel=\"nofollow\"\u003ethe Volley library\u003c/a\u003e for http(s) calls.\u003c/p\u003e\n\n\u003cp\u003eI'm able to hide my application logs using a customize Log class wrapper, and I would like to disable every log level printing of \u003ccode\u003eVolley\u003c/code\u003e, because it might expose sensitive information sent by HTTPS.\u003c/p\u003e\n\n\u003cp\u003eI know you can use \u003ca href=\"http://sourceforge.net/projects/proguard/\" rel=\"nofollow\"\u003eproguard\u003c/a\u003e to disable logging of application, but I also want to be able to toggle logging on and off from the server side for debugging specific scenarios.\u003c/p\u003e\n\n\u003ch1\u003eWhat have I tried\u003c/h1\u003e\n\n\u003cp\u003eI took a look at the source, and it seems that the \u003ca href=\"https://github.com/google/iosched/blob/master/third_party/volley/src/com/android/volley/VolleyLog.java\" rel=\"nofollow\"\u003eDEBUG flag in the VolleyLog\u003c/a\u003e class only changes the log level, but keeps \u003ccode\u003eERROR\u003c/code\u003e calls in the log, so it isn't a solution for me.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eIs it possible to hide all \u003ccode\u003eVolley\u003c/code\u003e logs ?\u003c/strong\u003e\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2015-07-23 09:05:18.01 UTC","favorite_count":"3","last_activity_date":"2015-08-02 06:44:02.9 UTC","last_edit_date":"2015-07-27 08:15:38.233 UTC","last_editor_display_name":"","last_editor_user_id":"51197","owner_display_name":"","owner_user_id":"3979963","post_type_id":"1","score":"6","tags":"android|logging|android-volley","view_count":"2137"} +{"id":"13628032","title":"How to properly setup CucumberJS in a rails app with backbone front-end developed with backbone-on-rails gem","body":"\u003cp\u003eI am developing a rails 3.2 app with Cucumber/capybara/rspec and the backbone-on-rails gem for front-end dev. I would like to use CucumberJS and Jasmine for testing the front-end, but I can't manage to properly setup CucumberJS.\u003c/p\u003e","answer_count":"0","comment_count":"2","creation_date":"2012-11-29 14:33:45.507 UTC","last_activity_date":"2017-04-24 12:12:23.247 UTC","last_edit_date":"2017-04-24 12:12:23.247 UTC","last_editor_display_name":"","last_editor_user_id":"1033581","owner_display_name":"","owner_user_id":"318722","post_type_id":"1","score":"0","tags":"backbone.js|cucumber|ruby-on-rails-3.2","view_count":"101"} +{"id":"5320766","title":"Why is not the MongoId 12-byte long but the 24-byte?","body":"\u003cp\u003eAccording to the official document: \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eA BSON ObjectID is a 12-byte value\n consisting of a 4-byte timestamp\n (seconds since epoch), a 3-byte\n machine id, a 2-byte process id, and a\n 3-byte counter\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eBut actually it's a 24-byte value like 4d7f4787ac6d604009000000\u003c/p\u003e\n\n\u003cp\u003eWhy does this happen ?\u003c/p\u003e","accepted_answer_id":"5320780","answer_count":"1","comment_count":"1","creation_date":"2011-03-16 03:33:59.6 UTC","favorite_count":"1","last_activity_date":"2011-03-16 03:35:46.34 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"661747","post_type_id":"1","score":"3","tags":"php|mongodb|mongodb-php","view_count":"337"} +{"id":"45649535","title":"Getting TypeError: 'NoneType' object is not iterable when sending ajax post request django views","body":"\u003cp\u003eI want to print the list of all my checked choices in my django view function,but when i send throught ajax selected data,i get the following error in my console: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eTraceback (most recent call last):\n File \"C:\\Users\\lislis\\DJANGO~2\\DJANGO~1.2\\lib\\site-packages\\django\\core\\handlers\\exception.py\", line 41, in inner\n response = get_response(request)\n File \"C:\\Users\\lislis\\DJANGO~2\\DJANGO~1.2\\lib\\site-packages\\django\\core\\handlers\\base.py\", line 187, in _get_response\n response = self.process_exception_by_middleware(e, request)\n File \"C:\\Users\\lislis\\DJANGO~2\\DJANGO~1.2\\lib\\site-packages\\django\\core\\handlers\\base.py\", line 185, in _get_response\n response = wrapped_callback(request, *callback_args, **callback_kwargs)\n File \"C:\\Users\\lislis\\Django-VEnvs-Projects\\django 1.11.2\\src\\rapport_sante\\papa\\views.py\", line 78, in stat_ajax\n for d in tb_ids:\nTypeError: 'NoneType' object is not iterable\n[12/Aug/2017 11:53:07] \"POST /sante/stat-ajax/ HTTP/1.1\" 500 19573\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is a part of my ajax post request:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e var data =[];\n $(\":checkbox:checked\").each(function() {\n data.push($(this).val());\n });\n\n if(data.length==0)\n {\n alert(\"Veuillez cocher au moins une dps\");\n alert(data.length);\n }\n else\n {\n\n $.ajax({\n url: \"{% url 'papa:stat-ajax' %}\",\n type:\"post\",\n data: {dpsID:data,csrfmiddlewaretoken: '{{ csrf_token }}'},\n success:function(data) \n {\n //Some code\n }\n });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHere is my view function,where i would like to display all the data contained in the \u003ccode\u003edpsID\u003c/code\u003e of my ajax POST request:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003edef stat_ajax(request):\n tb_ids=request.POST.get('dpsID')\n for d in tb_ids:\n print(d)\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"45650558","answer_count":"2","comment_count":"0","creation_date":"2017-08-12 11:08:43.677 UTC","last_activity_date":"2017-08-12 12:59:18.553 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"8121151","post_type_id":"1","score":"1","tags":"javascript|jquery|python|ajax|django","view_count":"82"} +{"id":"7587403","title":"List all system certificate stores","body":"\u003cp\u003eI'm looking for a way to get all system certificate stores, in any \u003ca href=\"http://msdn.microsoft.com/en-us/library/system.security.cryptography.x509certificates.storelocation.aspx\" rel=\"nofollow\"\u003elocation\u003c/a\u003e (\u003ccode\u003eCurrentUser\u003c/code\u003e or \u003ccode\u003eLocalMachine\u003c/code\u003e).\u003c/p\u003e\n\n\u003cp\u003eThe \u003ccode\u003eStoreLocation\u003c/code\u003e enumeration clearly won't include user-defined certificate stores created with \u003ccode\u003eX509Store(String)\u003c/code\u003e or \u003ccode\u003eX509Store(String, StoreLocation)\u003c/code\u003e. Also this doesn't define \u003ca href=\"http://technet.microsoft.com/en-us/library/cc961648.aspx\" rel=\"nofollow\"\u003eother standard stores\u003c/a\u003e such as \u003ccode\u003eSPC\u003c/code\u003e or \u003ccode\u003eRequest\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eI've looked at the \u003ccode\u003ecrypto32.dll\u003c/code\u003e API and I couldn't see anything relevant in there apart from register/unregister.\u003c/p\u003e\n\n\u003cp\u003eNon file-system based stores appear in the registry (eg \u003ccode\u003eHKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\SystemCertificates\\Root\u003c/code\u003e). The \u003ca href=\"http://technet.microsoft.com/en-us/library/dd347615.aspx\" rel=\"nofollow\"\u003ePowerShell Certificate Provider\u003c/a\u003e can interrogate stores. Is this -- querying the registry -- what it's doing under the hood? Would such a hand-rolled solution be portable between XP/Vista/7/8?\u003c/p\u003e","accepted_answer_id":"7587679","answer_count":"1","comment_count":"0","creation_date":"2011-09-28 17:52:53.623 UTC","last_activity_date":"2011-09-28 18:20:40.31 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"39443","post_type_id":"1","score":"1","tags":"c#|certificate|pki","view_count":"790"} +{"id":"6166906","title":"Wait for user action in while loop - JAVA","body":"\u003cp\u003eI am writing a Reversi application. I implemented the turns manager class, but I have a little problem in the while loop.\u003c/p\u003e\n\n\u003cp\u003eThis is my snippet:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003ewhile (!table.isFull() || passFlag != 2) {\n if (player1.isActive()) {\n for (int i = 0; i \u0026lt; table.getSize(); i++) {\n for (int j = 0; j \u0026lt; table.getSize(); j++) {\n table.getField(i, j).addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent e) {\n if (e.getSource() instanceof Field) {\n ((Field) e.getSource()).changeToBlack();\n }\n }\n });\n }\n }\n }\n if (player2.isActive()) {\n for (int i = 0; i \u0026lt; table.getSize(); i++) {\n for (int j = 0; j \u0026lt; table.getSize(); j++) {\n table.getField(i, j).addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent e) {\n if (e.getSource() instanceof Field) {\n ((Field) e.getSource()).changeToWhite();\n }\n }\n });\n }\n }\n }\n sentinel.changeActivePlayer(player1, player2);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe table is a grid of buttons, and the fields are the buttons. The loop does not wait for the player interaction. How can I implement the code so that it waits for the user's mouse click?\u003c/p\u003e\n\n\u003cp\u003eThis is the full code of this class\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epackage Core;\n\nimport GUILayer.Field;\nimport GUILayer.MainFrame;\nimport elements.Player;\nimport elements.Table;\nimport java.awt.event.ActionEvent;\nimport java.awt.event.ActionListener;\n\npublic class TurnManager {\n\n int passFlag = 0;\n int TurnFlag = 0;\n Sentinel sentinel = new Sentinel();\n\n public TurnManager() {\n }\n\n public void manage(MainFrame mainframe, Table table, Player player1, Player player2) {\n\n while (!table.isFull() || passFlag != 2) {\n if (player1.isActive()) {\n for (int i = 0; i \u0026lt; table.getSize(); i++) {\n for (int j = 0; j \u0026lt; table.getSize(); j++) {\n table.getField(i, j).addActionListener(\n new ActionListener() {\n\n public void actionPerformed(ActionEvent e) {\n if (e.getSource() instanceof Field) {\n ((Field) e.getSource()).changeToBlack();\n }\n }\n });\n }\n }\n }\n if (player2.isActive()) {\n for (int i = 0; i \u0026lt; table.getSize(); i++) {\n for (int j = 0; j \u0026lt; table.getSize(); j++) {\n table.getField(i, j).addActionListener(\n new ActionListener() {\n\n public void actionPerformed(ActionEvent e) {\n if (e.getSource() instanceof Field) {\n ((Field) e.getSource()).changeToWhite();\n }\n }\n });\n }\n }\n }\n sentinel.changeActivePlayer(player1, player2);\n }\n }\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"6167260","answer_count":"3","comment_count":"2","creation_date":"2011-05-29 09:23:51.81 UTC","last_activity_date":"2011-05-29 11:52:46.273 UTC","last_edit_date":"2011-05-29 09:57:59.793 UTC","last_editor_display_name":"","last_editor_user_id":"83075","owner_display_name":"","owner_user_id":"774985","post_type_id":"1","score":"0","tags":"java|events|loops|listener","view_count":"2719"} +{"id":"20708871","title":"Search with grep SQL numeric data types","body":"\u003cp\u003eI'm trying to do a grep to list all files in a directory containing a specific string variation on a linux system. The files are DDLs for stored procedures and I'm looking for all files that have a NUMERIC or DECIMAL declaration with a precision of 2 (i.e. DECIMAL(x,2) or NUMERIC(x,2)). Case insensitive, and Whitespace is to be ignored. \u003c/p\u003e\n\n\u003cp\u003eExamples:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eDECIMAL(13,2)\nDECIMAL(13, 2)\nDECIMAL( 13, 2 )\nDecimal(13 , 2)\nDECIMAL ( 13, 2 )\nNUMERIC(13 , 2)\nnumeric ( 13 , 2)\nNUMERIC(8,2 )\nCAST(INT (PURCHASE_DATE ) AS NUMERIC(8,0)) AS BUYDATE;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat I've come up with thus far is:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003egrep --include='*.DDL' -inP 'sproc' -e '.*Numeric|Decimal *\\( *[0-9] *\\, *2 *\\).*'\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut of course, its not working and I'm simply missing the reason why. Any help would be greatly appreciated.\u003c/p\u003e","answer_count":"2","comment_count":"2","creation_date":"2013-12-20 17:24:21.267 UTC","favorite_count":"0","last_activity_date":"2013-12-27 22:00:17.293 UTC","last_edit_date":"2013-12-27 21:59:46.69 UTC","last_editor_display_name":"","last_editor_user_id":"955143","owner_display_name":"","owner_user_id":"3123520","post_type_id":"1","score":"-1","tags":"regex|linux|grep","view_count":"105"} +{"id":"45983017","title":"Extracting an element of a list in a pandas column","body":"\u003cp\u003eI have a DataFrame that contains a list on each column as shown in the example below with only two columns. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Gamma Beta\n0 [1.4652917656926299, 0.9326935235505321, float] [91, 48.611034768515864, int]\n1 [2.6008354611105995, 0.7608529935313189, float] [59, 42.38646954167245, int]\n2 [2.6386970166722348, 0.9785848171888037, float] [89, 37.9011122659478, int]\n3 [3.49336632573625, 1.0411524946972244, float] [115, 36.211134224288344, int]\n4 [2.193991200007534, 0.7955134305428825, float] [128, 50.03563864975485, int]\n5 [3.4574527664490997, 0.9399880977511021, float] [120, 41.841146628802875, int]\n6 [3.1190582380554863, 1.0839109431114795, float] [148, 55.990072419824514, int]\n7 [2.7757359940789916, 0.8889801332053203, float] [142, 51.08885697101243, int]\n8 [3.23820908493237, 1.0587479742892683, float] [183, 43.831293356668425, int]\n9 [2.2509032790941985, 0.8896196407231622, float] [66, 35.9377662201882, int]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'd like to extract for every column the first position of the list on each row to get a DataFrame looking as follows.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e Gamma Beta\n0 1.4652917656926299 91\n1 2.6008354611105995 59\n2 2.6386970166722348 89\n...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eUp to now, my solution would be like \u003ccode\u003e[row[1][0] for row in df_params.itertuples()]\u003c/code\u003e, which I could iterate for every column index of the row and then compose my new DataFrame.\u003c/p\u003e\n\n\u003cp\u003eAn alternative is \u003ccode\u003enew_df = df_params['Gamma'].apply(lambda x: x[0])\u003c/code\u003e and then to iterate to go through all the columns.\u003c/p\u003e\n\n\u003cp\u003eMy question is, is there a less cumbersome way to perform this operation?\u003c/p\u003e","accepted_answer_id":"45983226","answer_count":"2","comment_count":"0","creation_date":"2017-08-31 13:44:26.213 UTC","favorite_count":"1","last_activity_date":"2017-08-31 13:55:50.847 UTC","last_edit_date":"2017-08-31 13:52:12.56 UTC","last_editor_display_name":"","last_editor_user_id":"5276797","owner_display_name":"","owner_user_id":"2244081","post_type_id":"1","score":"1","tags":"python|python-3.x|pandas","view_count":"71"} +{"id":"23420020","title":"onCreate(Unknown Source) for Application class with Proguard (only happens on Samsung devices)","body":"\u003cp\u003eI've been testing my app on Sony and Nexus devices as well as multiple emulators (API 10 - 19) for several weeks and things seem fine, however, two of my testers (who live remotely) are experiencing crashes during startup and ACRA isn't offering the option to send a crash log email, which leads me to believe it's a crash before ACRA is even instantiated. ACRA works as expected on my devices and emulators and offers to send an email (via default app).\u003c/p\u003e\n\n\u003cp\u003eAre Samsung phones doing some special initialization? Am I doing anything in the following code which could cause a crash?\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@ReportsCrashes(\n formKey = \"\", // This is required for backward compatibility but not used\n mailTo = \"crash@mydomain.com\",\n customReportContent = {\n ReportField.APP_VERSION_CODE,\n ReportField.APP_VERSION_NAME,\n ReportField.ANDROID_VERSION,\n ReportField.PHONE_MODEL,\n ReportField.CUSTOM_DATA,\n ReportField.STACK_TRACE,\n ReportField.LOGCAT }\n)\npublic class AppState extends Application {\n\n private static final String DIRECTORY_ROOT = Environment.getExternalStorageDirectory();\n private static final String DIRECTORY_PICTURES_APP = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES).getAbsolutePath() + File.separator + \"MyApp\";\n\n private static final LogConfigurator logConfigurator = new LogConfigurator();\n private static final Logger logger = Logger.getLogger(AppState.class);\n\n @Override\n public void onCreate() {\n super.onCreate();\n\n ACRA.init(this);\n\n // try to create log file and directory; if successful, configure ACRA to include last lines with crash report\n if (createLogFile()) {\n ACRAConfiguration config = ACRA.getConfig();\n config.setApplicationLogFile(LOGGER_FILENAME);\n ACRA.setConfig(config);\n }\n\n ...log4j, database init, etc...\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe source for the project is \u003ca href=\"https://sourceforge.net/p/dumpsterdiver/code/\" rel=\"nofollow\"\u003elocated here on SourceForge\u003c/a\u003e.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT #1:\u003c/strong\u003e \u003c/p\u003e\n\n\u003cp\u003eFinally got one of the Samsung Remote Test Lab devices working! Screen still isn't visible, but I can at least see logcat. Here is the reason for the crash:\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eERROR AndroidRuntime at org.dumpsterdiver.sync.AppState.onCreate(Unknown Source)\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eSo that means the system is unable to find my Application class? After a bit of Googling similar problems, I think it might be a proguard error (sigh, again), so I've been playing with various suggestions from other answers. None of these have helped so far (still experimenting with various values):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e-keep public class org.dumpsterdiver.sync.AppState\n-keep public class * extends android.app.Application\n-keep public class * extends com.actionbarsherlock.app.SherlockActivity\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eEDIT #2:\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eAdding this line to my proguard config file seems to fix the problem:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e-keep class * { *; }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut my APK is 500 KB larger (3.7 -\u003e 4.2 MB) and I suspect this probably defeats half the point of using proguard in the first place? Is there a better solution?\u003c/p\u003e","accepted_answer_id":"24107672","answer_count":"1","comment_count":"5","creation_date":"2014-05-02 02:53:14.267 UTC","last_activity_date":"2014-06-08 15:26:53.84 UTC","last_edit_date":"2014-05-02 22:30:18.42 UTC","last_editor_display_name":"","last_editor_user_id":"209866","owner_display_name":"","owner_user_id":"209866","post_type_id":"1","score":"1","tags":"android|proguard|samsung-mobile","view_count":"827"} +{"id":"10605549","title":"RoR generated sql has where","body":"\u003cp\u003eI have 3 tables stauscode, worequest and employee. Worequest belongs to employee and employee has_many worequests. Worequest belongs to statuscode and statuscode has many worequests.\u003c/p\u003e\n\n\u003cp\u003eI also have a scope for worequest:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e scope :notcompl, where(:statuscode_id != Statuscode.last, true) \n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI'm trying to display the worequests for the employee that are not completed:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;% @employee.worequests.notcompl.each do |worequest| %\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe error I get:\nG::Error: ERROR: argument of AND must be type boolean, not type integer\nLINE 1: ...uests\" WHERE \"worequests\".\"employee_id\" = 2 AND (1) ORDER B...\u003c/p\u003e\n\n\u003cp\u003eI'm trying to view employee number 2. I can't figure out why it's putting the \"and (1)\" into the SQL.\u003c/p\u003e\n\n\u003cp\u003eAny ideas?\u003c/p\u003e\n\n\u003cp\u003eThanks!\u003c/p\u003e","accepted_answer_id":"10605802","answer_count":"2","comment_count":"1","creation_date":"2012-05-15 17:03:52.337 UTC","last_activity_date":"2012-05-15 17:35:23.91 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1068420","post_type_id":"1","score":"0","tags":"ruby-on-rails","view_count":"54"} +{"id":"24890300","title":"One to many join to last modified record in the most efficient way","body":"\u003cp\u003eI realise that variations of this question have been asked before but I'd like to know the most efficient solution to my particular issue.\u003c/p\u003e\n\n\u003cp\u003eI have two tables...\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eEvent\u003c/strong\u003e (event_id, customer_email...)\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eCustomer\u003c/strong\u003e (customer_email, last_modified...)\u003c/p\u003e\n\n\u003cp\u003eI'm joining these two tables and only want the customer with the greatest last_modified date. The customer table is absolutely huge so was wondering the best way to go about this.\u003c/p\u003e","answer_count":"2","comment_count":"2","creation_date":"2014-07-22 14:36:15.443 UTC","last_activity_date":"2014-07-22 14:59:43.777 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1083811","post_type_id":"1","score":"0","tags":"sql-server|performance|join|one-to-many","view_count":"37"} +{"id":"28131736","title":"How do I wait for a yield?","body":"\u003cp\u003eI have a function \u003ccode\u003efindOrCreateUser\u003c/code\u003e that returns a generator. But I need to call a callback \u003ccode\u003edone\u003c/code\u003e when the function has completed. How do I do this?\u003c/p\u003e\n\n\u003cp\u003eI tried calling \u003ccode\u003enext()\u003c/code\u003e on the generator but the result was pending.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epassport.use(new FacebookStrategy({\n clientID: fbConfig.appId,\n clientSecret: fbConfig.appSecret,\n callbackURL: 'http://localhost:' + (process.env.PORT || 3000) + '/auth/facebook/callback'\n },\n function(token, tokenSecret, profile, done) {\n\n var user = yield userRepository.findOrCreateUser(\n profile.id,\n profile.name,\n 'pic');\n\n return user;\n })\n);\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"28131880","answer_count":"1","comment_count":"0","creation_date":"2015-01-25 00:04:37.113 UTC","last_activity_date":"2015-01-25 00:48:23.753 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"221683","post_type_id":"1","score":"1","tags":"javascript|node.js|callback|generator|passport.js","view_count":"275"} +{"id":"36432152","title":"ANDROID Volley + Gson (POST)","body":"\u003cp\u003ehello.\u003c/p\u003e\n\n\u003cp\u003eI want to make a post request using gson.\u003c/p\u003e\n\n\u003cp\u003eI got the class implemented into android website...\n\u003ca href=\"http://developer.android.com/intl/pt-br/training/volley/request-custom.html\" rel=\"nofollow\"\u003ehttp://developer.android.com/intl/pt-br/training/volley/request-custom.html\u003c/a\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eUserRequestHelper.userRequest(Request.Method.POST, EndpointURL.USUARIO, null, new Response.Listener\u0026lt;Usuario\u0026gt;() {\n @Override\n public void onResponse(Usuario response) {\n Toast.makeText(getActivity(), \"Cadastro realizado com sucesso!\", Toast.LENGTH_SHORT).show();\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n Toast.makeText(getActivity(), \"Erro ao realizar cadastro.\", Toast.LENGTH_SHORT).show();\n }\n });\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI need a body to send the user? How i send the object user to make a post request?\u003c/p\u003e\n\n\u003cp\u003eCould someone help me with this?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-04-05 16:35:12.197 UTC","last_activity_date":"2016-04-06 12:21:01.667 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"4175402","post_type_id":"1","score":"1","tags":"android|android-volley|android-gson","view_count":"1937"} +{"id":"40372195","title":"Update DOM in Ruby on Rails 5","body":"\u003cp\u003eHave a problem with my app on ruby on rails 5, after ajax request cannot run javascript. I think this is problem with DOM, but I not have a good knowledge with JavaScript and cannot fix this problem. Will be very\u003cbr\u003e\nappreciation everyone who will try to help me.\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003emovies_controller.rb\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cpre\u003e\u003ccode\u003e def home\nif params[:search]\n @movies = Movie.search(params[:search]).order('created_at DESC').page(params[:page]).per(20)\n @movies = @movies.genre(params[:genre]).order('created_at DESC').page(params[:page]).per(20)\n @movies = @movies.date_relist(params[:date_relist]).order('created_at DESC').page(params[:page]).per(20)\n @movies = @movies.rating(params[:rating]).order('created_at DESC').page(params[:page]).per(20)\nelse\n @movies = Movie.all.order('created_at DESC').page(params[:page]).per(20)\n @movies_genre = Movie.all.select(:genre).uniq.order('genre ASC')\n @date_relist = Movie.all.select(:date_relist).uniq.order('date_relist DESC')\n @rating = (Movie.all.select(:rating).uniq).order('rating DESC')\nend\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eend\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003ehome.html.erb\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"container\"\u0026gt;\n\u0026lt;%= form_for root_path, method: :get, id: \"movies_search\", remote: true do %\u0026gt;\n\u0026lt;%= label_tag :search %\u0026gt;\n\u0026lt;%= text_field_tag :search, params[:search]%\u0026gt;\n\u0026lt;%= label_tag :genre %\u0026gt;\n\u0026lt;%= select_tag :genre, options_from_collection_for_select(@movies_genre, \"genre\", \"genre\") %\u0026gt;\n\u0026lt;%= label_tag :date_relist %\u0026gt;\n\u0026lt;%= select_tag :date_relist, options_from_collection_for_select(@date_relist, \"date_relist\", \"date_relist\"), include_blank: true %\u0026gt;\n \u0026lt;%= label_tag :rating %\u0026gt;\n\u0026lt;%= select_tag :rating, options_from_collection_for_select(@rating, \"rating\", \"rating\"), include_blank: true %\u0026gt;\n\u0026lt;%= submit_tag \"Search\", name: nil %\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;div class=\"content\"\u0026gt;\n\u0026lt;div class=\"wrapper\"\u0026gt;\n \u0026lt;div id=\"movies\"\u0026gt; \u0026lt;%= render partial: 'movies' %\u0026gt;\n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003ehome.js.erb\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cpre\u003e\u003ccode\u003e$(\"#movies, .pagination\").html(\"\u0026lt;%= escape_javascript(render(\"movies\")) %\u0026gt;\")\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003e_movies.html.erb\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;% @movies.each do |m| %\u0026gt;\n\n\u0026lt;div class=\"card\"\u0026gt;\n \u0026lt;div class=\"card__container card__container--closed\"\u0026gt;\n \u0026lt;svg class=\"card__image\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" viewBox=\"0 0 1920 1200\" preserveAspectRatio=\"xMidYMid slice\"\u0026gt;\n \u0026lt;defs\u0026gt;\n \u0026lt;clipPath id=\"clipPath\u0026lt;%=m.id%\u0026gt;\"\u0026gt;\n \u0026lt;polygon class=\"clip\" points=\"0,1200 0,0 1920,0 1920,1200\"\u0026gt;\u0026lt;/polygon\u0026gt;\n \u0026lt;/clipPath\u0026gt;\n \u0026lt;/defs\u0026gt;\n \u0026lt;image clip-path=\"url(#clipPath\u0026lt;%=m.id%\u0026gt;)\" width=\"1920\" height=\"1200\" xlink:href=\"/pictures/\u0026lt;%= m.img %\u0026gt;\"\u0026gt;\u0026lt;/image\u0026gt;\n \u0026lt;/svg\u0026gt;\n \u0026lt;div class=\"card__content\"\u0026gt;\n \u0026lt;i class=\"card__btn-close fa fa-times\"\u0026gt;\u0026lt;/i\u0026gt;\n \u0026lt;div class=\"card__caption\"\u0026gt;\n \u0026lt;h2 class=\"card__title\"\u0026gt;\u0026lt;%= m.title %\u0026gt;\u0026lt;/h2\u0026gt;\n \u0026lt;p class=\"card__subtitle\"\u0026gt;Genre - \u0026lt;%= m.genre %\u0026gt;\u0026lt;/p\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"card__copy\"\u0026gt;\n \u0026lt;div class=\"meta\"\u0026gt;\n \u0026lt;img class=\"meta__avatar\" src=\"/pictures/\u0026lt;%= m.img %\u0026gt;\" alt=\"author01\" /\u0026gt;\n \u0026lt;img class=\"krug\"/\u0026gt;\n \u0026lt;div class=\"description\"\u0026gt;\n \u0026lt;span class=\"meta__author\"\u0026gt;Running Time - \u0026lt;%= m.runtime %\u0026gt;\u0026lt;/span\u0026gt;\u0026lt;br\u0026gt;\n \u0026lt;span class=\"meta__date\"\u0026gt;Release Date - \u0026lt;%= m.date_relist %\u0026gt;\u0026lt;/span\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div class=\"text\" style=\"text-align: center\"\u0026gt;\n \u0026lt;p\u0026gt;\n \u0026lt;%= raw(m.trailer) %\u0026gt;\n \u0026lt;br\u0026gt;\n \u0026lt;%= m.desc %\u0026gt;\n \u0026lt;/p\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"3","creation_date":"2016-11-02 03:50:20.123 UTC","last_activity_date":"2016-11-02 03:50:20.123 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"7102620","post_type_id":"1","score":"0","tags":"javascript|ruby-on-rails|ruby|dom|ruby-on-rails-5","view_count":"65"} +{"id":"18494812","title":"How can I access Dropwizard Resource directly, and not via REST","body":"\u003cp\u003eI've create Dropwizard Resource and mapped it to REST API.\nNow I want to reuse this Resource API from other points in my code as a JAVA API.\nHow can I do it?\u003c/p\u003e\n\n\u003cp\u003eThis is the Resource class:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e@Path(\"/providers_new\")\npublic class ProviderResource {\n private ProviderDAO dao;\n\n public ProviderResource(ProviderDAO dao) {\n this.dao = dao;\n }\n\n @GET\n @Path(\"/get\")\n @Produces(\"application/json\")\n public List\u0026lt;Provider\u0026gt; getAll() {\n return dao.getAllProviders();\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ePlease note that ProviderResource is initialized with dao:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class EntitiesService extends Service\u0026lt;EntitiesServiceConfiguration\u0026gt; {\n public static void main(String[] args) throws Exception {\n new EntitiesService().run(args);\n }\n\n @Override\n public void initialize(Bootstrap\u0026lt;EntitiesServiceConfiguration\u0026gt; bootstrap) {\n bootstrap.setName(\"entities\");\n ...\n }\n\n @Override\n public void run(EntitiesServiceConfiguration configuration,\n Environment environment) throws ClassNotFoundException {\n final DBIFactory factory = new DBIFactory();\n final DBI jdbi = factory.build(environment, configuration.getDatabaseConfiguration(), \"my_db\");\n final ProviderDAO dao = jdbi.onDemand(ProviderDAO.class);\n environment.addResource(new ProviderResource(dao));\n ...\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eNow that ProviderResource is on the air, I would like to use it from my code. Something like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eArrayList\u0026lt;Provider\u0026gt; providers = iDontKnowHowToGetProviderResource.getAll();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhat do you say?\u003c/p\u003e","accepted_answer_id":"18737183","answer_count":"2","comment_count":"0","creation_date":"2013-08-28 17:47:40.02 UTC","last_activity_date":"2013-09-11 09:17:29.12 UTC","last_edit_date":"2013-08-28 19:39:47.783 UTC","last_editor_display_name":"","last_editor_user_id":"647271","owner_display_name":"","owner_user_id":"647271","post_type_id":"1","score":"2","tags":"java|rest|dao|dropwizard","view_count":"3632"} +{"id":"7061711","title":"NHibernate - Performance Tuning with Native SQL","body":"\u003cp\u003eI am trying to use NHibernate to map a graph built with the following entites to the relational database (The code is incomplete and just for demo purpose, which should look straightforward). Potentially Node and Edge classes may have subclases and there are already a string of subclasses defined inherited from Node class. For all the inheritance relationships in this model, the mapping type used is joined-subclass (table-per-subclass); \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eclass GraphObject { ... }\n\nclass Node : GraphObject {\n List\u0026lt;Edge\u0026gt; IngoingEdges;\n List\u0026lt;Edge\u0026gt; OutgoingEdges;\n}\n\nclass Edge : GraphObject {\n Node StartNode { get; set; }\n Node EndNode { get; set; }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFor connections between nodes and edges a dual many-to-one mapping is used as follows, \u003c/p\u003e\n\n\u003cp\u003emany-to-one from Edge.StartNode to nodes(.OutgoingEdges); \nmany-to-one from Edge.EndNode to nodes(.IngoingEdges)\u003c/p\u003e\n\n\u003cp\u003eSince there's a need to work with huge volume data in our project (millions of nodes and edges) and we would like to both keep having the benefits NHibernate provides and minimize the performance issues. Unfortunately it seems to take nearly an hour to save or load such a model. What I'm currently doing is trying to figure out a way to finish loading in one statement and see how long it takes. I made a few attempts and I used NHibernate Profiler to keep track of the SQL statements generated by the NHibernate framework when doing things like loading the entire graph from the data persistence, but so far I haven't managed to eliminate that huge amount of individual queries apparently for determining which are the start and end nodes for specific edges which look like\u003c/p\u003e\n\n\u003cp\u003eselect ...StartNode as .., ..Id as .., ... from Link link where link.StartNode=10 (a number indicating node id)\u003c/p\u003e\n\n\u003cp\u003ewhich means I am kind of suffering from the so-called N+1 issues.\nSo is there anyone wo has come across a similar problem and can give me some idea, either in native SQLs or improving performance for this particular case by other approaches. I would really appreciate that. Any questions regarding points unclear are also welcome. \u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2011-08-15 04:26:08.433 UTC","last_activity_date":"2011-08-16 00:29:45.117 UTC","last_edit_date":"2011-08-16 00:29:45.117 UTC","last_editor_display_name":"","last_editor_user_id":"894495","owner_display_name":"","owner_user_id":"894495","post_type_id":"1","score":"0","tags":"sql|nhibernate","view_count":"429"} +{"id":"9337764","title":"IIS AppDomain unloading in an Azure environemnt","body":"\u003cp\u003eAs far as I understand, in a Windows Azure web role - every .svc is loaded in it's own App Domain. Does IIS ever unload the AppDomain duirng its process lifetime so that invocation (typically via a HTTP call) of the svc will trigger Application_Start() (again)?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2012-02-18 01:41:59.543 UTC","last_activity_date":"2012-02-18 02:09:48.703 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"588681","post_type_id":"1","score":"1","tags":"iis|azure|appdomain","view_count":"274"} +{"id":"40409465","title":"Orca Power Shell","body":"\u003cp\u003eI am trying to create a transform using Orca so that I can automate the install of an msi file. The problem is I struggling to find out how I automate the clicking of a 'Next' button that would appear in the Wizard. I thought that I needed to create a property name for the 'Next Button' in the 'Controls' table in Orca then add a new row into the 'Property' table in Orca. Then add the value of '1' to the value of the newly craeted property. Bu this didnt work when I generated the transform file and ran the following command line -\u003c/p\u003e\n\n\u003cp\u003emsiexec /I \"msiName.msi\" TRANSFORM=\"transformName.mst\"\u003c/p\u003e\n\n\u003cp\u003eCan anybody shed any light? \u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2016-11-03 19:10:03.79 UTC","favorite_count":"0","last_activity_date":"2016-11-09 12:15:40.127 UTC","last_edit_date":"2016-11-03 21:26:19.59 UTC","last_editor_display_name":"","last_editor_user_id":"3677139","owner_display_name":"","owner_user_id":"3922677","post_type_id":"1","score":"-1","tags":"msiexec|orca","view_count":"47"} +{"id":"19908092","title":"Solving StringIndexOutOfBoundsException","body":"\u003cp\u003eI received a crash report, which is about \u003ccode\u003ejava.lang.StringIndexOutOfBoundsException in ZhuangDictActivity$SearchDicAsyncTask.doInBackground\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003eHere is the ZhuangDictActivity$SearchDicAsyncTask.doInBackground:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eprivate class SearchDicAsyncTask extends AsyncTask\u0026lt;String, Integer, String\u0026gt; {\n\n private byte searchStatus;\n\n @Override\n protected String doInBackground(String... params) {\n if (params[0].length() \u0026gt; 0) {\n word = params[0].trim();\n long[] index = null;\n\n FileAccessor in = null;\n DictZipInputStream din = null;\n try {\n\n char key = GB2Alpha.Char2Alpha(word.charAt(0));\n tableName = DatabaseHelper.transTableName(key);\n\n index = databaseHelper.queryTable(tableName, word);\n\n if (index != null) {\n in = new FileAccessor(new File(dictFileName), \"r\");\n byte[] bytes = new byte[(int) index[1]];\n if (isDZDict) {\n din = new DictZipInputStream(in);\n DictZipHeader h = din.readHeader();\n int idx = (int) index[0] / h.getChunkLength();\n int off = (int) index[0] % h.getChunkLength();\n long pos = h.getOffsets()[idx];\n in.seek(pos);\n byte[] b = new byte[off + (int) index[1]];\n din.readFully(b);\n System.arraycopy(b, off, bytes, 0, (int) index[1]);\n } else {\n in.seek(index[0]);\n in.read(bytes);\n }\n\n wordDefinition = new String(bytes, \"UTF-8\");\n } else {\n searchStatus = 0;\n return null;\n }\n } catch (FileNotFoundException ffe) {\n searchStatus = 1;\n return null;\n } catch (IOException ex) {\n ex.printStackTrace();\n searchStatus = 2;\n return null;\n } finally {\n try {\n if (din != null)\n din.close();\n if (in != null)\n in.close();\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n }\n\n }\n return wordDefinition;\n } \n }\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe complete code is available \u003ca href=\"http://code.google.com/p/zhuang-dict/source/browse/trunk/ZhuangDict/src/cn/wangdazhuang/zdict/ZhuangDictActivity.java\" rel=\"nofollow\"\u003ehere\u003c/a\u003e.\nI have limited knowledge in Java and Android development. How should I solve this? I intended to post the complete stack traces but stackoverflow do not allow me to do so because it stated my question has too many code. Anyway, the line which is causing the problem is \u003ccode\u003echar key = GB2Alpha.Char2Alpha(word.charAt(0));\u003c/code\u003e.\u003c/p\u003e","answer_count":"1","comment_count":"9","creation_date":"2013-11-11 13:54:09.15 UTC","last_activity_date":"2013-11-11 14:22:06.54 UTC","last_edit_date":"2013-11-11 14:20:21.523 UTC","last_editor_display_name":"","last_editor_user_id":"2872856","owner_display_name":"","owner_user_id":"2872856","post_type_id":"1","score":"0","tags":"android","view_count":"88"} +{"id":"6977223","title":"Joomla Components are not working on webserver, but working on WAMP Server(Localhost), Why?","body":"\u003cp\u003eI am using Joomla1.5, Here some Components (TPJOBS) working very well on WAMP Server 2.1 (Localhost) but When I upload on Web Server , Components are not working . Can anybody tell why this is happening , What changes I need in Web Server to run Components as they are working well on WAMP Server.\u003c/p\u003e","answer_count":"1","comment_count":"2","creation_date":"2011-08-08 02:22:07.59 UTC","last_activity_date":"2011-08-10 09:08:30.78 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"883335","post_type_id":"1","score":"-1","tags":"php|joomla|wamp","view_count":"129"} +{"id":"1341767","title":"Question regarding creating windows service","body":"\u003cp\u003eI have got few questions regarding creating windows service.\nI have created a windows service.But Im getting an error reagrding that.\npublic partial class xyz : servicebase\n{\npublic xyz()\n{\nInitializeCompoenent();\n}\n} \u003c/p\u003e\n\n\u003cp\u003eit couldn't resolve InitializeComponent().Does anybody any reason.\nI have set it up out as console application instead of windows application.\u003c/p\u003e","accepted_answer_id":"1341799","answer_count":"3","comment_count":"4","creation_date":"2009-08-27 15:17:13.973 UTC","last_activity_date":"2009-08-28 18:15:22.127 UTC","last_edit_date":"2009-08-27 15:21:48.707 UTC","last_editor_display_name":"","last_editor_user_id":"3863","owner_display_name":"","owner_user_id":"21918","post_type_id":"1","score":"0","tags":"c#|windows-services","view_count":"149"} +{"id":"24084639","title":"Android Read Text and split into multidimensional array dynamically","body":"\u003cp\u003eI read \u003ca href=\"https://stackoverflow.com/questions/17824936/read-and-split-text-file-into-an-array-android\"\u003ethis thread\u003c/a\u003e, but, how can I put text from a file dynamically into multidimensional array?\u003c/p\u003e\n\n\u003cp\u003eData like:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e1,4,5,7,nine\n\n11,19\n\n22,twenty-three,39\n\n30,32,38\n..\n..\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"24084923","answer_count":"2","comment_count":"1","creation_date":"2014-06-06 14:45:51.71 UTC","last_activity_date":"2014-09-24 05:54:37.983 UTC","last_edit_date":"2017-05-23 12:27:25.83 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"1009225","post_type_id":"1","score":"0","tags":"android|arrays|file-io|multidimensional-array","view_count":"320"} +{"id":"27609406","title":"How can I find which java class reads a particular xml file?","body":"\u003cp\u003eI'm workin on a java application for which i don't have all the source codes. The application is based on spring framework, and at startup it parses lots of xml files from different directories. Then it makes an internal cache of the given xml content which I would like to disable and make changes in the class to read the xml content when it's needed and don't cache them. For this reason i have to find out which class opens my xml.\u003c/p\u003e\n\n\u003cp\u003e(If i can find it out, then i can ask for source code access, but till then i wont get access to it.)\u003c/p\u003e\n\n\u003cp\u003eWhat else i know about this class is it parses lots of xmls from different directories so the filename wont be hardcoded into the class.\u003c/p\u003e\n\n\u003cp\u003eI was thinking of to use a decompiler to reverse engineer the class files, but there are a lot, and the package hierarchy is too deep to do it one by one. Maybe there is a way to decompile whole jar files at once with an eclipse plugin or a command line tool, but i don't know how. Anyway maybe there is a much simpler solution.\u003c/p\u003e\n\n\u003cp\u003eAny ideas?\u003c/p\u003e","accepted_answer_id":"27610048","answer_count":"1","comment_count":"3","creation_date":"2014-12-22 19:44:53.487 UTC","last_activity_date":"2014-12-22 20:36:44.407 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"3203945","post_type_id":"1","score":"0","tags":"java|decompiling","view_count":"94"} +{"id":"33478441","title":"How to simulate a service killed by the Android system","body":"\u003cp\u003eWhile developing I wanted to test the situation where the system kills a service. This is because I'm loosing connection when communicating between the Android Wear and the handheld. And I think that it is related with the system killing some services.\u003c/p\u003e\n\n\u003cp\u003eDoes anyone have a suggestion on how to approach this?\u003c/p\u003e","accepted_answer_id":"33544779","answer_count":"2","comment_count":"3","creation_date":"2015-11-02 13:11:59.24 UTC","last_activity_date":"2017-02-22 05:48:23.52 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1277555","post_type_id":"1","score":"4","tags":"android|android-service|android-wear","view_count":"400"} +{"id":"40411884","title":"WPF Multiple triggers on the same property not working right","body":"\u003cp\u003eI have 2 triggers on the same property of a checkbox, and it doesn't work quite right.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;ControlTemplate.Triggers\u0026gt;\n\n \u0026lt;Trigger Property=\"IsChecked\" Value=\"False\"\u0026gt;\n \u0026lt;Setter TargetName=\"InnerText\" Property=\"Text\" Value=\"False\" /\u0026gt;\n \u0026lt;Trigger.EnterActions\u0026gt;\n \u0026lt;BeginStoryboard Storyboard=\"{StaticResource OnUnCheck}\"/\u0026gt;\n \u0026lt;/Trigger.EnterActions\u0026gt;\n \u0026lt;/Trigger\u0026gt;\n\n \u0026lt;Trigger Property=\"IsChecked\" Value=\"True\"\u0026gt;\n \u0026lt;Setter TargetName=\"InnerText\" Property=\"Text\" Value=\"True\" /\u0026gt;\n \u0026lt;Trigger.EnterActions\u0026gt;\n \u0026lt;BeginStoryboard Storyboard=\"{StaticResource OnCheck}\"/\u0026gt;\n \u0026lt;/Trigger.EnterActions\u0026gt;\n \u0026lt;/Trigger\u0026gt;\n\n\u0026lt;/ControlTemplate.Triggers\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eWhen I uncheck the CheckBox, the text is set, and the storyboard gets called just fine. But then when I check the CheckBox, the text gets set properly, but the storyboard isn't called. I can then uncheck the CheckBox, and that storyboard still works.\u003c/p\u003e\n\n\u003cp\u003eThen, if I swap the Trigger order, so \u003ccode\u003eValue=\"True\"\u003c/code\u003e is the first one, only that storyboard works. In both cases the text is set just fine, and it confirms that both storyboards work. Its just the storyboard in the second Trigger doesn't get called in either case. Do I need to use a MultiTrigger...?\u003c/p\u003e\n\n\u003cp\u003eEdit: My storyboards were backward, so it's the first Trigger not calling the storyboard, not the second\u003c/p\u003e","accepted_answer_id":"40412982","answer_count":"1","comment_count":"0","creation_date":"2016-11-03 21:55:06.927 UTC","last_activity_date":"2016-11-03 23:34:32.677 UTC","last_edit_date":"2016-11-03 22:09:58.657 UTC","last_editor_display_name":"","last_editor_user_id":"6732861","owner_display_name":"","owner_user_id":"6732861","post_type_id":"1","score":"-1","tags":"c#|wpf|xaml|triggers","view_count":"94"} +{"id":"31356115","title":"Speed up reading results in batch script","body":"\u003cp\u003eWhat I am trying to do, is speed up my reading results of batch file. \u003c/p\u003e\n\n\u003cp\u003eAm trying to get different values using netsh commands and then present them in my script console but it takes to long.\nSee below a small part of my script to get the idea. (this is just a small part, I'm actually getting around 50 different values and using more netsh commands)\u003c/p\u003e\n\n\u003cp\u003eDoes anybody know a way to speed up the process? \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e.\n.\n.\nnetsh interface ipv4 show config %AdapterLAN% \u0026gt;temp\nfor /f \"tokens=3\" %%i in ('findstr \"IP Address\" temp') do set ip=%%i\necho. IP Address : %ip%\n\nfor /f \"tokens=5 delims=) \" %%i in ('findstr \"Subnet Prefix\" temp') do set mask=%%i\necho. Mask : %mask%\n\nfor /f \"tokens=3\" %%i in ('findstr \"Gateway:\" temp') do set gateway=%%i\necho. Gateway : %gateway%\n\nfor /f \"tokens=1,5,6\" %%a in ('findstr \"DNS\" temp') do set dns1=%%a\u0026amp;set dns5=%%b\u0026amp;set dns6=%%c\nIf \"%dns1%\"==\"Statically\" set dns=%dns5%\nif \"%dns1%\"==\"DNS\" set dns=%dns6% \necho. DNS Server : %dns%\n\nfor /f \"tokens=3\" %%i in ('findstr \"Gateway Metric\" temp') do set GMetric=%%i\nfor /f \"tokens=2\" %%i in ('findstr \"InterfaceMetric\" temp') do set IMetric=%%i\nset /a metricLAN=Gmetric + imetric \necho. Metric : %metricLAN%\n\nfor /f \"tokens=3\" %%i in ('find \"DHCP enabled\" temp') do set LANDHCP=%%i\nIf \"%dns1%\"==\"Statically\" set xx=Static\nif \"%dns1%\"==\"DNS\" set xx=DHCP \nIf /i %LANDHCP%==No set LANDHCP=Static\nif /i %LANDHCP%==YES set LANDHCP=DHCP\necho. Obtained IP : %LANDHCP%\necho. Obtained DNS : %xx%\nfor /f \"tokens=3 delims=,\" %%a in ('getmac /v /fo csv ^| find \"\"\"%AdapterLAN-without-Q%\"\"\" ') do set macLAN=%%a\necho. MAC-Addres : %macLAN%\ndel temp\n.\n.\n.\nnetsh wlan show profile \u0026gt;temp\n.\nDo a similar process of getting values from another netsh command sent them\nin the temp file …echo the one I want on the screen ..delete the file etc.\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"1","creation_date":"2015-07-11 10:19:55.49 UTC","favorite_count":"1","last_activity_date":"2015-07-13 10:44:28.507 UTC","last_edit_date":"2015-07-11 10:41:13.04 UTC","last_editor_display_name":"","last_editor_user_id":"2086682","owner_display_name":"","owner_user_id":"2086682","post_type_id":"1","score":"1","tags":"batch-file|batch-processing|netsh","view_count":"117"} +{"id":"27420478","title":"convert date time from EU time zone to PST","body":"\u003cp\u003ei have a list of datetimes in EU time zone:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e[u'2014-11-01T09:00:00+01:00', u'2014-11-02T00:00:00+01:00', u'2014-11-03T00:00:00+01:00', u'2014-11-04T00:00:00+01:00', u'2014-11-05T00:00:00+01:00', u'2014-11-06T00:00:00+01:00', u'2014-11-07T00:00:00+01:00', u'2014-11-08T00:00:00+01:00', u'2014-11-09T00:00:00+01:00', u'2014-11-10T00:00:00+01:00', u'2014-11-11T00:00:00+01:00', u'2014-11-12T00:00:00+01:00', u'2014-11-13T00:00:00+01:00', u'2014-11-14T00:00:00+01:00', u'2014-11-15T00:00:00+01:00', u'2014-11-16T00:00:00+01:00', u'2014-11-17T00:00:00+01:00', u'2014-11-18T00:00:00+01:00', u'2014-11-19T00:00:00+01:00', u'2014-11-20T00:00:00+01:00', u'2014-11-21T00:00:00+01:00', u'2014-11-22T00:00:00+01:00', u'2014-11-23T00:00:00+01:00', u'2014-11-24T00:00:00+01:00', u'2014-11-25T00:00:00+01:00', u'2014-11-26T00:00:00+01:00', u'2014-11-27T00:00:00+01:00', u'2014-11-28T00:00:00+01:00', u'2014-11-29T00:00:00+01:00', u'2014-11-30T00:00:00+01:00', u'2014-12-01T00:00:00+01:00']\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHow do i convert each of them to PST time zone?\u003c/p\u003e","answer_count":"2","comment_count":"1","creation_date":"2014-12-11 10:23:44.927 UTC","last_activity_date":"2015-02-04 10:08:16.123 UTC","last_edit_date":"2015-02-04 10:08:16.123 UTC","last_editor_display_name":"","last_editor_user_id":"4279","owner_display_name":"","owner_user_id":"2800939","post_type_id":"1","score":"1","tags":"python|datetime|timezone|pytz|rfc3339","view_count":"403"} +{"id":"8496476","title":"How can I conditionally include a file based on build configuration in Xcode?","body":"\u003cp\u003eI have an Xcode project with a large number of targets where I would like to include a settings bundle for apps built under the Ad-hoc and Debug configurations, but not under the Release configuration. \u003c/p\u003e\n\n\u003cp\u003eBuild Phases don't seem to allow for making themselves conditional on configuration (they can obviously be conditional on target, but doubling the number of targets in the project would make it completely unusable). \u003c/p\u003e\n\n\u003cp\u003eThat leaves writing a custom Build Rule. My plan is to exclude the Settings.bundle from all targets, and create a build rule that conditionally copies it into the product package, but applicable examples are really hard to find. \u003c/p\u003e\n\n\u003cp\u003eThe build rule I've started has the Process setting set to \"Source files with names matching:\" and Settings.bundle as the name. The Using setting is \"Custom script:\". \u003c/p\u003e\n\n\u003cp\u003eMy custom script is as follows (with the caveat that my bash scripting is on a cargo cult level):\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eif [${CONFIGURATION} = 'Debug'] then\n cp -r ${INPUT_FILE_PATH} ${DERIVED_FILES_DIR}/.\nfi\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFinally, I have \u003ccode\u003e${DERIVED_FILES_DIR}/Settings.bundle\u003c/code\u003e listed as an output file. \u003c/p\u003e\n\n\u003cp\u003eSince I'm here, it should be obvious that it's not working. My first question is whether there is somewhere I can view the output of the build rules as the execute to make sure that 1) it's actually being executed and that 2) I don't have a stupid syntax error somewhere. \u003c/p\u003e\n\n\u003cp\u003eAlso, what's the proper location (in the form of an environment variable) to copy the output to?\u003c/p\u003e","accepted_answer_id":"9220345","answer_count":"5","comment_count":"0","creation_date":"2011-12-13 21:34:00.703 UTC","favorite_count":"32","last_activity_date":"2016-04-07 17:22:32.52 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"27951","post_type_id":"1","score":"55","tags":"xcode|build-rules","view_count":"13779"} +{"id":"4161223","title":"django unit testing on multiple databases","body":"\u003cp\u003eI'm working on a django project where all my unit test cases were working perfectly. \u003c/p\u003e\n\n\u003cp\u003eAss soon as I introduced a second database all my test cases that inherit from TestCase are broken. At this stage I haven't build any test case for that second database but my router is working fine.\u003c/p\u003e\n\n\u003cp\u003eWhen I run the tests I get the error, \u003c/p\u003e\n\n\u003cp\u003e\"KeyError: 'SUPPORTS_TRANSACTIONS'\"\u003c/p\u003e\n\n\u003cp\u003eIt appears to me that is trying to check that that all the databases that I've got setup support transactions but the second database is never created.\u003c/p\u003e\n\n\u003cp\u003eAny ideas on how to have the test script to build the second database.\u003c/p\u003e","answer_count":"4","comment_count":"0","creation_date":"2010-11-12 02:53:50.587 UTC","last_activity_date":"2016-09-18 07:53:53.307 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"298404","post_type_id":"1","score":"3","tags":"django|multiple-databases","view_count":"2292"} +{"id":"21753004","title":"Hash Array Mapped Trie performance","body":"\u003cp\u003eI'm trying to implement Hash Array Mapped Trie in Java. Before, I thought that this data structure should be more memory efficient than Hash Map, but when i made first memory measurements using Visual Vm, i found that my implementation require more memory then Hash Map (also \"put\" operation is slower). I can't understand : HAMT really requires more memory or i made mistake in implementation.\nSimilar performance results as \u003ca href=\"https://stackoverflow.com/questions/19714795/hash-array-mapped-trie-hamt\"\u003ein this question\u003c/a\u003e. \u003c/p\u003e\n\n\u003cp\u003eHas \"Hash Array Mapped Trie\" performance advantages over \"Hash Table\" (\"Hash Map\")?\u003c/p\u003e","answer_count":"1","comment_count":"4","creation_date":"2014-02-13 11:32:22.56 UTC","last_activity_date":"2016-08-18 13:22:58.667 UTC","last_edit_date":"2017-05-23 12:16:25.113 UTC","last_editor_display_name":"","last_editor_user_id":"-1","owner_display_name":"","owner_user_id":"3298917","post_type_id":"1","score":"0","tags":"algorithm|hashmap|hashtable|trie","view_count":"494"} +{"id":"18415904","title":"What does mode_t 0644 mean?","body":"\u003cpre\u003e\u003ccode\u003e#define COPYMODE 0644\ncreat(argV[2],COPYMODE);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have these two lines of code in a copy.c file.\nI don't know what it means.\nPlease give some example about it\u003c/p\u003e","answer_count":"2","comment_count":"2","creation_date":"2013-08-24 06:57:15.387 UTC","favorite_count":"3","last_activity_date":"2015-06-08 05:23:28.267 UTC","last_edit_date":"2013-08-24 13:03:02.9 UTC","last_editor_display_name":"","last_editor_user_id":"694576","owner_display_name":"","owner_user_id":"2681412","post_type_id":"1","score":"3","tags":"c|file-permissions","view_count":"33667"} +{"id":"38617155","title":"Limit number of file watched with nodejs","body":"\u003cp\u003eI have a script written in \u003ccode\u003enodejs\u003c/code\u003e with \u003ccode\u003echokidar\u003c/code\u003e where I listen into a folder when a file is added. \u003c/p\u003e\n\n\u003cp\u003eWhen a file is added start a function with many loop.\u003c/p\u003e\n\n\u003cp\u003eSometimes the system add 100 or more files at the same time so the event \u003ccode\u003eadd\u003c/code\u003e is called 100 times and the server can crash.\u003c/p\u003e\n\n\u003cp\u003eIs there a way to limit watched file and the others wait until watched file are closed?\u003c/p\u003e\n\n\u003cp\u003eFor example I decide that I can't watch more than 10 files at the same time, the other files wait until first 10 finished their thing.\u003c/p\u003e\n\n\u003cp\u003eIs possible?\u003c/p\u003e\n\n\u003cp\u003eThis is my script:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003evar chokidar = require('chokidar');\nvar sys = require('sys')\nvar exec = require('child_process').exec;\n\nvar folder = process.argv[2];\nvar watcher = chokidar.watch('tmp/xml/' + folder + '/', {ignored: /^\\./, persistent: true});\nwatcher\n .on('add', function(path) {\n var filenameArr = path.split('/');\n filename = folder + '/' + filenameArr[filenameArr.length - 1];\n\n function puts(error, stdout, stderr) { sys.puts(stdout) }\n exec('bin/cake manager readXmlAndSave ' + filename, puts);\n})\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"0","comment_count":"9","creation_date":"2016-07-27 15:20:04.517 UTC","last_activity_date":"2016-07-27 15:30:24.01 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1427138","post_type_id":"1","score":"0","tags":"javascript|node.js","view_count":"62"} +{"id":"27092486","title":"Understanding exchangeArray function in Table Gateway pattern in ZF2","body":"\u003cp\u003eI am new in ZF2 and i created one module in my application where i have used Table Gateway pattern, I observed that for table gateway exchangeArray() function is being used. \u003c/p\u003e\n\n\u003cp\u003eCan Anyone briefed about how exchangeArray() function works internally.\u003c/p\u003e\n\n\u003cp\u003eThanks In Advance !!\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-11-23 18:13:01.137 UTC","last_activity_date":"2014-11-30 11:14:02.173 UTC","last_edit_date":"2014-11-30 11:14:02.173 UTC","last_editor_display_name":"","last_editor_user_id":"199593","owner_display_name":"","owner_user_id":"2842159","post_type_id":"1","score":"0","tags":"php|zend-framework2","view_count":"1379"} +{"id":"34386825","title":"Python 3.5: FileNotFoundError: [Errno 2] No such file or directory","body":"\u003cp\u003eI learned Python but hadn't used it in a few months so I am perhaps rusty. I am just trying to start a project by reading from a csv text file. I understand that there are several questions on this site about this error, but I haven't found one that fixes the issue. This is probably really basic and I wanted to figure this out without posting a question, but after several hours I really don't get it. Sorry if I missed a question that has answered this, but I have checked a lot of questions first. Here is all of my code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eimport csv\nwith open('C:\\\\Users\\\\Ben.Brittany-PC\\\\Documents\\\\stats.txt', 'rb') as csvfile:\n reader = csv.reader(csvfile, delimiter=' ', quotechar='|')\n for row in reader:\n print(row)\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eand the error:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eFileNotFoundError: [Errno 2] No such file or directory: 'C:\\\\Users\\\\Ben.Brittany-PC\\\\Documents\\\\stats.txt'\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"2","comment_count":"1","creation_date":"2015-12-20 22:59:35.447 UTC","last_activity_date":"2015-12-20 23:09:09.1 UTC","last_edit_date":"2015-12-20 23:09:09.1 UTC","last_editor_display_name":"","last_editor_user_id":"100297","owner_display_name":"","owner_user_id":"5701554","post_type_id":"1","score":"0","tags":"python|csv|errno","view_count":"2877"} +{"id":"22131976","title":"Entity Framework not updating naviation proprties with automatic change tracking disabled","body":"\u003cp\u003eI have one unitOfWork in my Domain Logic that retrieves tens of thousands of XML nodes, creates disconnected entities called \"retreivedBooks\" from the XML and updates Book entities in the database based on the retreivedBooks. For this particular unitOfWork's dbContext in my application, I have disabled change tracking due to very bad performance when there are lots of entities in the database. This has improved performance - great. \u003c/p\u003e\n\n\u003cp\u003eHowever it is no longer updating navigation properties. Here is a made up example to demonstrate the problem:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e public class Book\n {\n public string Title;\n public string Author;\n public virtual List\u0026lt;Page\u0026gt; Pages;\n }\n\n_unitOfWork.Context.Configuration.AutoDetectChangesEnabled = false;\n_unitOfWork.Context.Configuration.ValidateOnSaveEnabled = false;\n\nforeach(Book retreivedBook in retreivedBooks )\n{\n Book existingBook= _unitOfWork.BookRepository.SingleOrDefault(b=\u0026gt;b.Id=retreivedBook.Id);\n if(book!=null)\n {\n existingBook.Title=retreivedBook.Title;\n existingBook.Author=retreivedBook.Author;\n existingBook.Pages=retreivedBook.Pages;\n _unitOfWork.Context.Entry(existingBook).State = EntityState.Modified; \n }\n}\n_unitOfWork.Save();\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn the example above, the Title and Author properties of books in the database get updated correctly, but the list of Pages does not.\u003c/p\u003e\n\n\u003cp\u003eBy the way, I don't check for existing Pages based on retreived Pages. We can assume that pages are always different every time so the book.Pages property will be replaced on every update.\u003c/p\u003e\n\n\u003cp\u003eCan anyone help to explain why the pages property does not get updated in the database?\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2014-03-02 19:03:48.067 UTC","last_activity_date":"2014-03-02 20:38:23.63 UTC","last_edit_date":"2014-03-02 19:22:05.523 UTC","last_editor_display_name":"","last_editor_user_id":"1728372","owner_display_name":"","owner_user_id":"1728372","post_type_id":"1","score":"1","tags":"entity-framework","view_count":"191"} +{"id":"27260138","title":"How to fix font baseline in Android Lollipop when working with custom icon fonts?","body":"\u003cp\u003eI am currently using FontAwesome in one of my Android projects. I primarily use it to display icons to the left of text on certain buttons. I noticed that since upgrading one of my test devices to Lollipop, the icons began sagging below the baseline of the text on the button.\nPlease see the images below:\u003c/p\u003e\n\n\u003ch2\u003eAndroid KitKat (Nexus 7) - good:\u003c/h2\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/zxnsv.png\" alt=\"KitKat\"\u003e\u003c/p\u003e\n\n\u003ch2\u003eAndroid Lollipop (Nexus 4) - bad:\u003c/h2\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/MkGS9.png\" alt=\"Lollipop\"\u003e\u003c/p\u003e\n\n\u003cp\u003ePlease note that the bottom of the icon in the first image sits on the baseline of the text, while the bottom of the icon in the second image is below the baseline.\u003c/p\u003e\n\n\u003ch2\u003eCode:\u003c/h2\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;string name=\"button_text_logout\"\u0026gt; LOG OUT\u0026lt;/string\u0026gt;\n\n\u0026lt;TextView\n android:layout_width=\"wrap_content\"\n android:layout_height=\"match_parent\"\n android:textSize=\"@dimen/text_size_menu_item\"\n android:textColor=\"@color/white\"\n android:gravity=\"center_vertical\"\n android:text=\"@string/button_text_logout\"\n android:paddingLeft=\"@dimen/action_item_padding\"\n android:paddingRight=\"@dimen/action_item_padding\"/\u0026gt;\n\nTypeface typeface = Typeface.createFromAsset(context.getAssets(), \"fontawesome-webfont.ttf\");\nlogOutTextView.setTypeface(typeface);\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI am using the \u003ca href=\"http://fortawesome.github.io/Font-Awesome/icon/sign-out/\" rel=\"nofollow noreferrer\"\u003efa-sign-out\u003c/a\u003e icon. The code works fine on all devices running versions of Android prior to 5.0. Is there any way to fix this?\u003c/p\u003e","accepted_answer_id":"47124375","answer_count":"1","comment_count":"4","creation_date":"2014-12-02 22:20:46.913 UTC","favorite_count":"2","last_activity_date":"2017-11-06 17:34:32.883 UTC","last_edit_date":"2017-11-06 17:34:32.883 UTC","last_editor_display_name":"","last_editor_user_id":"379245","owner_display_name":"","owner_user_id":"379245","post_type_id":"1","score":"5","tags":"android|android-layout|android-textview|font-awesome|android-5.0-lollipop","view_count":"1143"} +{"id":"104920","title":"Is there a .NET performance counter to show the rate of p/invoke calls being made?","body":"\u003cp\u003eIs there a .NET performance counter to show the rate of p/invoke calls made? I've just noticed that the application I'm debugging was making a call into native code from managed land within a tight loop. The intended implementation was for a p/invoke call to be made once and then cached. I'm wondering if I could have noticed this mistake via a CLR Interop or Remoting .NET performance counter. Any ideas?\u003c/p\u003e","accepted_answer_id":"105011","answer_count":"1","comment_count":"0","creation_date":"2008-09-19 19:44:41.277 UTC","last_activity_date":"2008-09-19 19:57:57.19 UTC","last_editor_display_name":"","owner_display_name":"Jeffrey LeCours","owner_user_id":"18051","post_type_id":"1","score":"2","tags":".net|performance|interop|pinvoke|analysis","view_count":"581"} +{"id":"29996378","title":"Webgl Framebuffer low Picture - Quality","body":"\u003cp\u003eMy framebuffer has very low picture- quality (Android). What can I do to get better quality? Hier is a screen shot:\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://i.stack.imgur.com/UaZ2C.png\" alt=\"enter image description here\"\u003e\u003c/p\u003e\n\n\u003cp\u003eHier is a part of my code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eRenderingEngine.prototype.getPixel = function(x, y, drawObjects){\nvar framebuffer = gl.createFramebuffer();\ngl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);\nframebuffer.width = this.canvas.width;\nframebuffer.height = this.canvas.height;\n\nvar depthBuffer = gl.createRenderbuffer();\ngl.bindRenderbuffer(gl.RENDERBUFFER, depthBuffer);\n\n// allocate renderbuffer\ngl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_COMPONENT16, framebuffer.width, framebuffer.height); \n\n// attach renderebuffer\ngl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, depthBuffer);\n\nvar colorBuffer = gl.createRenderbuffer();\ngl.bindRenderbuffer(gl.RENDERBUFFER, colorBuffer);\n// allocate colorBuffer\ngl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, framebuffer.width, framebuffer.height); \n\n// attach colorbuffer\ngl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, colorBuffer);\n\nif (gl.checkFramebufferStatus(gl.FRAMEBUFFER) != gl.FRAMEBUFFER_COMPLETE) {\n alert(\"this combination of attachments does not work\");\n}\n\ngl.clearColor(1, 1, 1, 1); \ngl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n\nrenderingEngine.draw(drawObjects);\nvar pixel = new Uint8Array(4);\ngl.readPixels(x, this.canvas.height - y, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, pixel);\ngl.bindFramebuffer(gl.FRAMEBUFFER, null);\ngl.bindRenderbuffer(gl.RENDERBUFFER, null);\nreturn pixel;\n }\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"1","comment_count":"0","creation_date":"2015-05-01 23:02:47.857 UTC","last_activity_date":"2015-05-03 02:19:21.897 UTC","last_edit_date":"2015-05-02 07:24:06.37 UTC","last_editor_display_name":"","last_editor_user_id":"128511","owner_display_name":"","owner_user_id":"4777113","post_type_id":"1","score":"0","tags":"android|image|webgl|framebuffer","view_count":"91"} +{"id":"39577017","title":"How to execut an SQL query in a vba module","body":"\u003cp\u003eI am currently stuck on trying to execute an SQL query to a vba module.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eOption Explicit\nPublic con As ADODB.Connection\nPublic Const CONNECTION_STRING As String = \"Provider=SQLOLEDB; uid=;pwd=; DATABASE=MFBPRD; SERVER=MCPLONSQL01;Integrated Security=SSPI;\"\n\n Function Run()\n Call ConnectDB\n Dim Cmd As ADODB.Command\n Dim rcs As ADODB.Recordset\n Dim SQL As String\n Dim res() As String\n\n Set Cmd = New ADODB.Command\n Set Cmd.ActiveConnection = con\n\n SQL = \"select tl.id, al.price_crossing, al.price_exchange_fees, tl.charges_execution, tl.charges_mariana, tl.charges_exchange, tl.trade_date, un.value, tl.nb_crossing from mfb.trade_leg tl\"\n SQL = SQL \u0026amp; \"inner join mfb.trade t on t.id = tl.id_trade\"\n SQL = SQL \u0026amp; \"inner join mfb.instrument i on t.id_instrument = i.id\"\n SQL = SQL \u0026amp; \"inner join mfb.instrument_type it on it.id = i.id_instrument_type\"\n SQL = SQL \u0026amp; \"inner join mfb.options o on o.id_instrument = i.id\"\n SQL = SQL \u0026amp; \"inner join mfbref.mfb.underlying un on un.id = o.id_underlying\"\n SQL = SQL \u0026amp; \"inner join mfb.allocation_leg al on al.id_trade_leg = tl.id\"\n SQL = SQL \u0026amp; \"where tl.trade_date \u0026gt; '20160101' and t.state = 3\"\n\n Cmd.CommandText = SQL\n Set rcs = Cmd.Execute()\n\nEnd Function\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eUnder this I added the code to call ConnectDB.\u003c/p\u003e","answer_count":"0","comment_count":"5","creation_date":"2016-09-19 15:39:05.57 UTC","favorite_count":"1","last_activity_date":"2016-09-20 09:33:47.417 UTC","last_edit_date":"2016-09-20 09:33:47.417 UTC","last_editor_display_name":"","last_editor_user_id":"6849552","owner_display_name":"","owner_user_id":"6849552","post_type_id":"1","score":"0","tags":"excel-vba","view_count":"69"} +{"id":"31047117","title":"naming convention when typedef standard collections","body":"\u003cp\u003eI am looking for naming conventions for typedef of lengthy collections definitions. We have some c++ code which used \u003ccode\u003eauto\u003c/code\u003e to get away with style murder, but we need to make this code compiling on a non c++11 compiler. We are looking to establish a convention for \u003ccode\u003etypedef\u003c/code\u003e of collections, which can become quite lengthy\u003c/p\u003e\n\n\u003cp\u003eFor instance\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003etypedef std::map\u0026lt;enum MyFirstEnum,enum MySecondEnum\u0026gt; map_enum2_by_enum1_t\ntypedef map_enum2_by_enum1_t::value_type vtype_map_enum2_by_enum1_t\ntypedef map_enum2_by_enum1_t::iterator map_iterator_enum2_by_enum1_t\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThere are so many nuances (\u003ccode\u003eiterator\u003c/code\u003e before \u003ccode\u003et\u003c/code\u003e than at beginning, using type rather than t, ditching the prefix \u003ccode\u003emap\u003c/code\u003e, etc...) that half of the time you select one nuance, half of the time you select the other.\nAt the end no typedef look like the other. \u003c/p\u003e","accepted_answer_id":"31048421","answer_count":"3","comment_count":"1","creation_date":"2015-06-25 10:00:24.337 UTC","last_activity_date":"2015-06-25 12:17:51.473 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1122645","post_type_id":"1","score":"1","tags":"c++|naming-conventions","view_count":"328"} +{"id":"21825615","title":"Why SQL Server DATETIME type saves time in ticks of 1/300 of a sec?","body":"\u003cp\u003eSQLServer datetime format is stored as 8 bytes where the first four bytes are number of days since Jan 1, 1900 and the other four bytes are number of ticks since midnight. And the tick is 1/300 of the second.\u003c/p\u003e\n\n\u003cp\u003eI'm wondering why is that? Where is that 1/300 came from? There must be some historic reason for that.\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2014-02-17 09:47:59.79 UTC","favorite_count":"1","last_activity_date":"2014-02-17 12:16:50.913 UTC","last_edit_date":"2014-02-17 11:04:52.083 UTC","last_editor_display_name":"","last_editor_user_id":"73226","owner_display_name":"","owner_user_id":"472772","post_type_id":"1","score":"7","tags":"sql-server|datetime|sybase|history","view_count":"748"} +{"id":"46985460","title":"How to point a sprite in a specified direction in micro:bit?","body":"\u003cp\u003eI'm working on a basic game for micro:bit just as a way to learn the technology, and I was hoping that one of the sprites would move in the direction of the compass.\u003c/p\u003e\n\n\u003cp\u003eIs there a way to do this?\u003c/p\u003e","accepted_answer_id":"47106450","answer_count":"1","comment_count":"4","creation_date":"2017-10-28 01:39:10.423 UTC","favorite_count":"0","last_activity_date":"2017-11-04 01:24:01.973 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"8022771","post_type_id":"1","score":"0","tags":"bbc-microbit","view_count":"29"} +{"id":"11387947","title":"Why I can not find my Iphone device in xcode","body":"\u003cp\u003eI have added my iphone as device and associate it with provisioning. Then I download the newest provisioning and install it (I have successed added ipad as test device before). \u003c/p\u003e\n\n\u003cp\u003eNow, in the \"Organizer\", I can see the iphone device but when I connect iphone device I can not find the iphone device to run my app. My software version is 4.2.1, is it the version not the latest that lead to this problem? Or what is the possible reason?\u003c/p\u003e","accepted_answer_id":"11388262","answer_count":"1","comment_count":"3","creation_date":"2012-07-09 00:48:18.647 UTC","last_activity_date":"2012-07-09 03:09:43.783 UTC","last_edit_date":"2012-07-09 00:59:01.187 UTC","last_editor_display_name":"","last_editor_user_id":"69634","owner_display_name":"","owner_user_id":"1363730","post_type_id":"1","score":"1","tags":"iphone|ios","view_count":"1294"} +{"id":"9738535","title":"Powershell test for noninteractive mode","body":"\u003cp\u003eI have a script that may be run manually or may be run by a scheduled task. I need to programmatically determine if I'm running in -noninteractive mode (which is set when run via scheduled task) or normal mode. I've googled around and the best I can find is to add a command line parameter, but I don't have any feasible way of doing that with the scheduled tasks nor can I reasonably expect the users to add the parameter when they run it manually.\nDoes noninteractive mode set some kind of variable or something I could check for in my script?\u003c/p\u003e\n\n\u003cp\u003eEdit:\nI actually inadvertently answered my own question but I'm leaving it here for posterity.\u003c/p\u003e\n\n\u003cp\u003eI stuck a read-host in the script to ask the user for something and when it ran in noninteractive mode, boom, terminating error. Stuck it in a try/catch block and do stuff based on what mode I'm in.\u003c/p\u003e\n\n\u003cp\u003eNot the prettiest code structure, but it works. If anyone else has a better way please add it! \u003c/p\u003e","accepted_answer_id":"9739171","answer_count":"9","comment_count":"0","creation_date":"2012-03-16 13:54:52.99 UTC","last_activity_date":"2017-09-22 16:17:33.36 UTC","last_edit_date":"2012-03-16 14:30:40.133 UTC","last_editor_display_name":"","last_editor_user_id":"160888","owner_display_name":"","owner_user_id":"160888","post_type_id":"1","score":"12","tags":"powershell","view_count":"10090"} +{"id":"28326900","title":"How to set up HotSwap in Eclipse","body":"\u003cp\u003eI am new to Eclipse thus this may be really beginner questions from me.\nI want to set up hot-swap in Eclipse so non structural changes can be done and seen right in the running application. (Game development)\u003c/p\u003e\n\n\u003cp\u003eI think I have to have tomcat running. I don`t know how it works, never tried it but I have it in my Eclipse Servers tab configured, I can run it but it will generate bunch of errors when I debug with tomcat: \u003c/p\u003e\n\n\u003cblockquote\u003e\n \u003cp\u003eINFO: At least one JAR was scanned for TLDs yet contained no TLDs.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003ePlease, could you navigate me in depth step by step how to set up the code replace in Eclipse? Also there are some External Web modules etc. Do I need it with Tomcat for hotswap?\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2015-02-04 16:49:48.227 UTC","last_activity_date":"2016-10-21 17:25:00.763 UTC","last_edit_date":"2016-10-21 17:25:00.763 UTC","last_editor_display_name":"","last_editor_user_id":"1486275","owner_display_name":"","owner_user_id":"3741301","post_type_id":"1","score":"0","tags":"eclipse|hotswap","view_count":"3541"} +{"id":"17397706","title":"How to save a component of a xml string in a file(Windows Phone memory) which is a response of server?","body":"\u003cp\u003eI am getting a responce from server in xml form in windows phone silverlight project. I want to store a special component of the string in a file (Windows Phone memory). For example, I am getting the following responce from server\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;SJK\u0026gt;\u0026lt;tableid\u0026gt;919844444444\u0026lt;/tableid\u0026gt;\u0026lt;Result_Code\u0026gt;0\u0026lt;/Result_Code\u0026gt;\u0026lt;Str_Result\u0026gt;\u0026lt;mykey\u0026gt;\u0026lt;Modulus\u0026gt;d534257d63f07f53d\u0026lt;/Modulus\u0026gt;\u0026lt;Exponent\u0026gt;010011\u0026lt;/Exponent\u0026gt;\u0026lt;/mykey\u0026gt;\u0026lt;/Str_Result\u0026gt;\u0026lt;/SJK\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eFrom this string, I want to store d534257d63f07f53d which is enclosed in \u003ccode\u003e\u0026lt;Modulus\u0026gt;d534257d63f07f53d\u0026lt;/Modulus\u0026gt;\u003c/code\u003e and also 010011 which is enclosed in \u003ccode\u003e\u0026lt;Exponent\u0026gt;010011\u0026lt;/Exponent\u0026gt;\u003c/code\u003e\u003c/p\u003e\n\n\u003cp\u003ePlease help me out.\u003c/p\u003e","answer_count":"0","comment_count":"3","creation_date":"2013-07-01 05:01:42.497 UTC","last_activity_date":"2013-07-01 05:13:38.22 UTC","last_edit_date":"2013-07-01 05:13:38.22 UTC","last_editor_display_name":"","last_editor_user_id":"2135570","owner_display_name":"","owner_user_id":"2135570","post_type_id":"1","score":"0","tags":"c#|windows-phone-7","view_count":"32"} +{"id":"6329553","title":"How to retrieve the result value and a select statement of a stored procedure at the same time in C#?","body":"\u003cp\u003eOK so this might sound a bit weird!\u003cbr\u003e\nThe thing is that in a project there are many stored procedure already written like this: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eCREATE PROCEDURE [Status_Insert]\n\n @StatusId int OUTPUT,\n @Status nvarchar (50),\n @IsDeleted bit = 0\n\nAS\n\nSET NOCOUNT ON;\n\nBEGIN TRY\nBEGIN TRAN\n\nINSERT INTO dbo.[Status]\n(\n [Status],\n [IsDeleted]\n)\nVALUES\n(\n @Status,\n @IsDeleted\n)\n\nSET @StatusId = @@IDENTITY\n\nCOMMIT TRAN\nRETURN 1\nEND TRY\n\nBEGIN CATCH\nROLLBACK TRAN\n\nDECLARE @ErrorNumber_INT INT;\nDECLARE @ErrorSeverity_INT INT;\nDECLARE @ErrorProcedure_VC VARCHAR(200);\nDECLARE @ErrorLine_INT INT;\nDECLARE @ErrorMessage_NVC NVARCHAR(4000);\n\nSELECT\n @ErrorMessage_NVC = ERROR_MESSAGE(),\n @ErrorSeverity_INT = ERROR_SEVERITY(),\n @ErrorNumber_INT = ERROR_NUMBER(),\n @ErrorProcedure_VC = ERROR_PROCEDURE(),\n @ErrorLine_INT = ERROR_LINE()\n\nRETURN -1\nEND CATCH\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe primary key is an \u003ccode\u003eIdentity\u003c/code\u003e and an output variable is used to retrieve its value after the insert statement. (By the way, is this approach a good practice?)\u003cbr\u003e\nNow the return values are used to indicate the success or failure of the procedure. (IE. if the operation was successful 1 is returned and -1 is returned if the operation has failed)\nIf there is an error in the execution of the procedure, the last select statement will return the error to the user.\u003c/p\u003e\n\n\u003cp\u003eNow how can I call this procedure in C# and get these results at the same time?\nWhat I want to do is, execute the procedure, and get the return value, if it was 1 then get the result of the last select statement (which contains more info about the error that has occured)\nThanks in advance.\u003c/p\u003e","accepted_answer_id":"6329592","answer_count":"1","comment_count":"0","creation_date":"2011-06-13 11:02:48.333 UTC","last_activity_date":"2011-06-13 20:24:04.033 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"398316","post_type_id":"1","score":"2","tags":"c#|sql-server|stored-procedures","view_count":"785"} +{"id":"21922975","title":"Color tinted UIImages gets pixelated","body":"\u003cp\u003eI am having problem understanding the reason for the following method, to return images that are visibly pixelated. I have double checked the size of the image, and it is fine. What's more, without tinting it, the image edges are smooth, and lack pixelation.\u003c/p\u003e\n\n\u003cp\u003eThe method for tinting image, based on IOS7 ImageView's tintColor property, works fine, however I would love to find out what is wrong with the following code, because it seems to work for everybody but me. Thanks!\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e- (UIImage *)imageTintedWithColor:(UIColor *)color\n{\nif (color) {\n UIImage *img = self; // The method is a part of UIImage category, hence the \"self\"\n UIGraphicsBeginImageContext(img.size);\n\n // get a reference to that context we created\n CGContextRef context = UIGraphicsGetCurrentContext();\n\n // set the fill color\n [color setFill];\n\n // translate/flip the graphics context (for transforming from CG* coords to UI* coords\n CGContextTranslateCTM(context, 0, img.size.height);\n CGContextScaleCTM(context, 1.0, -1.0);\n\n // set the blend mode to color burn, and the original image\n CGContextSetBlendMode(context, kCGBlendModeColorBurn);\n CGRect rect = CGRectMake(0, 0, img.size.width, img.size.height);\n CGContextDrawImage(context, rect, img.CGImage);\n\n // set a mask that matches the shape of the image, then draw (color burn) a colored rectangle\n CGContextSetBlendMode(context, kCGBlendModeSourceIn);\n CGContextAddRect(context, rect);\n CGContextDrawPath(context,kCGPathFill);\n\n // generate a new UIImage from the graphics context we drew onto\n UIImage *coloredImg = UIGraphicsGetImageFromCurrentImageContext();\n UIGraphicsEndImageContext();\n\n //return the color-burned image\n return coloredImg;\n}\n\nreturn self;\n\n}\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"21923065","answer_count":"1","comment_count":"0","creation_date":"2014-02-21 00:50:36.98 UTC","favorite_count":"1","last_activity_date":"2014-02-21 00:58:50.493 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1306884","post_type_id":"1","score":"0","tags":"ios|uiimageview|uiimage|cgcontext","view_count":"322"} +{"id":"42099595","title":"disable the dates based on the date selected in the first datepicker field","body":"\u003cp\u003eI am working on angularjs application. User can select date from the From Date picker and To Date picker fields.\nI want to disable the date selection in the To Date picker based on the date user selected in From Date picker field.\neg) If user has selected 02/23/2017 in From Date picker field, all the dates before 02/23/2017 should be disabled in To Date picker.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"http://plnkr.co/edit/029JQljbNXkq0PJtrO6M?p=preview\" rel=\"nofollow noreferrer\"\u003eDemo here\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eI tried assigning model1 to the min-date attribute of To Date as shown below but that was not working. And even tried to display To-Date field date picker calendar pop up as soon as the user has selected the date in the From-Date field but ended up with javascript errors. Any suggestions would be helpful.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;input type=\"text\" uib-datepicker-popup=\"{{dateformat}}\" min-date={{model1}} ng-model=\"model2\" is-open=\"showdp\" /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBelow is the code:\u003c/p\u003e\n\n\u003cp\u003e\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e \u0026lt;div style=\"float:left\" ng-controller=\"fromDateCtrl\"\u0026gt;\n From Date:\n \u0026lt;input type=\"text\" uib-datepicker-popup=\"{{dateformat}}\" min-date=\"mindate\" ng-model=\"model1\" is-open=\"showdp\" /\u0026gt;\n \u0026lt;span\u0026gt;\n \u0026lt;button type=\"button\" class=\"btn btn-default\" ng-click=\"showcalendar($event)\"\u0026gt;\n \u0026lt;i class=\"glyphicon glyphicon-calendar\"\u0026gt;\u0026lt;/i\u0026gt;\n \u0026lt;/button\u0026gt;\n \u0026lt;/span\u0026gt;\n \u0026lt;/div\u0026gt;\n \u0026lt;div style=\"float:left\" ng-controller=\"toDateCtrl\"\u0026gt;\n To Date:\n \u0026lt;input type=\"text\" uib-datepicker-popup=\"{{dateformat}}\" min-date=\"mindate\" ng-model=\"model2\" is-open=\"showdp\" /\u0026gt;\n \u0026lt;span\u0026gt;\n \u0026lt;button type=\"button\" class=\"btn btn-default\" ng-click=\"showcalendar($event)\"\u0026gt;\n \u0026lt;i class=\"glyphicon glyphicon-calendar\"\u0026gt;\u0026lt;/i\u0026gt;\n \u0026lt;/button\u0026gt;\n \u0026lt;/span\u0026gt;\n \u0026lt;/div\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003c/p\u003e\n\n\u003cp\u003ejs code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e angular.module('plunker', ['ngAnimate', 'ui.bootstrap']);\n angular.module('plunker').controller('fromDateCtrl', function ($scope) {\n $scope.today = function () {\n $scope.model1 = new Date();\n };\n $scope.mindate = new Date();\n $scope.dateformat=\"MM/dd/yyyy\";\n $scope.today();\n $scope.showcalendar = function ($event) {\n $scope.showdp = true;\n };\n $scope.showdp = false;\n });\n\n angular.module('plunker').controller('toDateCtrl', function ($scope) {\n $scope.today = function () {\n $scope.model2 = new Date();\n };\n $scope.mindate = new Date();\n $scope.dateformat=\"MM/dd/yyyy\";\n $scope.today();\n $scope.showcalendar = function ($event) {\n $scope.showdp = true;\n };\n $scope.showdp = false;\n });\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"42099981","answer_count":"1","comment_count":"0","creation_date":"2017-02-07 20:41:23.44 UTC","last_activity_date":"2017-02-07 21:40:04.323 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6951210","post_type_id":"1","score":"0","tags":"javascript|angularjs|datepicker|angular-daterangepicker","view_count":"317"} +{"id":"20521656","title":"CheckBox On GridView Lose State after selection","body":"\u003cp\u003eI Have a Problem With GridView CheckBoxes.\n I added Selection For My GridView and Every time i Select a Row, After PostBack My Checked CheckBoxes Loss their value. any Advice ?\u003c/p\u003e\n\n\u003cp\u003eAdded Page Load.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eMy GirdView:\n----------------\n\u0026lt;asp:UpdatePanel ID=\"UpdatePanel1\" runat=\"server\"\u0026gt;\n\u0026lt;ContentTemplate\u0026gt;\n\u0026lt;asp:GridView ID=\"RulesGridView\" runat=\"server\" CellPadding=\"8\" DataSourceID=\"RulesDataSource\" ForeColor=\"#333333\" GridLines=\"None\" OnRowCreated=\"RulesGridView_RowCreated\" OnSelectedIndexChanged=\"RulesGridView_SelectedIndexChanged\" ViewStateMode=\"Enabled\"\u0026gt;\n\u0026lt;AlternatingRowStyle BackColor=\"White\" /\u0026gt;\n\u0026lt;Columns\u0026gt;\n\u0026lt;asp:TemplateField HeaderText=\"\"\u0026gt;\n\u0026lt;ItemTemplate\u0026gt;\n\u0026lt;asp:CheckBox ID=\"chkSelect\" runat=\"server\" AutoPostBack=\"false\" OnCheckedChanged=\"chkSelect_CheckedChanged\" /\u0026gt;\n\u0026lt;/ItemTemplate\u0026gt;\n\u0026lt;/asp:TemplateField\u0026gt;\n\u0026lt;/Columns\u0026gt;\n\nC# Code behind:\n-------------------\n protected void RulesGridView_RowCreated(object sender, GridViewRowEventArgs e)\n {\n if (e.Row.RowType == DataControlRowType.DataRow)\n {\n e.Row.Attributes[\"onmouseover\"] = \"this.style.cursor='pointer';this.style.textDecoration='underline';\";\n e.Row.Attributes[\"onmouseout\"] = \"this.style.textDecoration='none';\";\n e.Row.ToolTip = \"Click to select row\";\n e.Row.Attributes[\"onclick\"] = this.Page.ClientScript.GetPostBackClientHyperlink(this.RulesGridView, \"Select$\" + e.Row.RowIndex);\n }\n }\nprotected void Page_Load(object sender, EventArgs e)\n {\n if (Page.IsPostBack == false)\n {\n Session[\"RuleList\"] = new List\u0026lt;Rule\u0026gt;();\n Session.Timeout = 180;\n //LstRules.Items.Clear();\n string folder = ConfigurationManager.AppSettings[\"MovieCreatorGUIRulesFolder\"];\n XmlSerializer mySerializer = new XmlSerializer(typeof(List\u0026lt;Rule\u0026gt;));\n StreamReader reader = new StreamReader(folder + \"\\\\DB\" + txtdbnum.Text + \"Rules.xml\");\n List\u0026lt;Rule\u0026gt; RuleList = (List\u0026lt;Rule\u0026gt;)mySerializer.Deserialize(reader);\n reader.Close();\n Session[\"RuleList\"] = RuleList;\n }\n ZoomInCommon.Users.UserInfo userInfo = PublishManager.GetCurrentYoutubeUser(-1);\n if (userInfo == null)\n txtYoutubeLoginUser.Text = \"Not Logged In\";\n else\n txtYoutubeLoginUser.Text = userInfo.DisplayName;\n }\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"3","comment_count":"0","creation_date":"2013-12-11 14:24:07.767 UTC","last_activity_date":"2013-12-12 02:01:14.06 UTC","last_edit_date":"2013-12-11 16:39:15.36 UTC","last_editor_display_name":"","last_editor_user_id":"2851781","owner_display_name":"","owner_user_id":"2851781","post_type_id":"1","score":"2","tags":"c#|asp.net|gridview|checkbox","view_count":"1500"} +{"id":"7561747","title":"MFMessageComposeViewController setting the UINavigationItem titleView","body":"\u003cp\u003eI'm having a problem overriding the title view of MFMessageComposeViewController's navigation item. Here is the code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eMFMessageComposeViewController *messageViewController = [[MFMessageComposeViewController alloc] init];\nmessageViewController.body=@\"SMS Body\";\nCGRect frame = CGRectMake(0, 0, 100.0, 45.0);\nUILabel *label = [[UILabel alloc] initWithFrame:frame];\nlabel.text=@\"Title\";\nmessageViewController.navigationItem.titleView=label;\n[label release];\n[self.navigationController presentModalViewController:messageViewController animated:YES];\n[messageViewController release];\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI have also tried:\n messageViewController.navigationController.navigationItem.titleView=label;\u003c/p\u003e\n\n\u003cp\u003eI should also point out that this is for iOS 4, in iOS 5 I use the new setTitleTextAttributes method which works great.\u003c/p\u003e\n\n\u003cp\u003eThoughts?\u003c/p\u003e","accepted_answer_id":"7600991","answer_count":"1","comment_count":"1","creation_date":"2011-09-26 21:48:29.83 UTC","last_activity_date":"2011-09-29 17:21:30.513 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"965885","post_type_id":"1","score":"0","tags":"ios","view_count":"1167"} +{"id":"42753661","title":"PHP Login does not work","body":"\u003cp\u003eI have a simple Login system which won't work and I can't figure out why. Once I press the login button nothing happens, the site just reloads instead of redirecting me or giving me any error messages.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eif(!empty($_POST['email']) \u0026amp;\u0026amp; !empty($_POST['password'])){\n\n $records = $conn-\u0026gt;prepare('SELECT email, password FROM Profiles WHERE email = :email');\n $records -\u0026gt;bindParam(':email', $_POST['email']);\n $records-\u0026gt;execute();\n $results = $records-\u0026gt;fetch(PDO::FETCH_ASSOC);\n\n $message = '';\n\n if(count($results) \u0026gt; 0 \u0026amp;\u0026amp; password_verify($_POST['password'], $results['password'])){\n\n $_SESSION['user_email'] = $results['email'];\n header(\"Location: main.php\");\n }else{\n $message = 'Sorry, those credentials do not match';\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd here's the HTML form.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;form action=\"\u0026lt;?php echo htmlspecialchars($_SERVER[\"PHP_SELF\"]);?\u0026gt;\" method=\"POST\"\u0026gt;\n \u0026lt;input type=\"text\" placeholder=\"Email\" name=\"email\"\u0026gt; \u0026lt;br/\u0026gt; \u0026lt;br/\u0026gt;\n \u0026lt;input type=\"password\" placeholder=\"Password\" name=\"password\"\u0026gt; \u0026lt;br/\u0026gt; \u0026lt;br/\u0026gt;\n \u0026lt;input type=\"submit\" value=\"Login\"\u0026gt;\n\u0026lt;/form\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e","accepted_answer_id":"42754194","answer_count":"3","comment_count":"17","creation_date":"2017-03-12 21:55:14.2 UTC","favorite_count":"1","last_activity_date":"2017-03-12 22:54:05.11 UTC","last_edit_date":"2017-03-12 22:12:04.177 UTC","last_editor_display_name":"","last_editor_user_id":"2310830","owner_display_name":"","owner_user_id":"6365983","post_type_id":"1","score":"0","tags":"php|mysql|login","view_count":"55"} +{"id":"10430311","title":"How to sort NSarray in Sections for UITableview","body":"\u003cp\u003eHi how can I sort my Array in sections by Day , I get the data form my webserver (Json) and parse to NSDictionary then save to NSMutableArray... I understand I need to implement \u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003e(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView\u003c/li\u003e\n\u003cli\u003etitleForHeaderInSection:\u003c/li\u003e\n\u003cli\u003eRow for Section:\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eNSMutableArray Log\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e2012-04-26 06:12:51.256 passingdata[91699:fb03] array : (\n{\npost = {\n \"CLASS_LEVEL\" = \"Intro/General\";\n \"CLASS_TYPE\" = \"Muay Thai\";\n \"DAY_OF_WEEK\" = Sunday;\n ID = 19;\n \"ORDER_BY\" = 5;\n TIME = \"1:00pm - 2:30pm\";\n};\n}\n{\npost = {\n \"CLASS_LEVEL\" = \"General/Intermediate/Advanced\";\n \"CLASS_TYPE\" = \"Muay Thai Spar - Competitive\";\n \"DAY_OF_WEEK\" = Friday;\n ID = 27;\n \"ORDER_BY\" = 5;\n TIME = \"6:00pm - 9:00pm\";\n};\n},\n{\npost = {\n \"CLASS_LEVEL\" = \"Fighters/Advanced/Intermediate\";\n \"CLASS_TYPE\" = \"Fighters Training\";\n \"DAY_OF_WEEK\" = Monday;\n ID = 1;\n \"ORDER_BY\" = 1;\n TIME = \"9:30am - 11:00pm\";\n};\n},\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eI can Display all the Data on my table , but I want to do it by section for each day (mon ,tue , wed.. sun), I have try NSpredicate and NSSet but still not working .\u003c/p\u003e\n\n\u003cp\u003eI don't know how to group items by day and get all the information to implement all the methods.\u003c/p\u003e\n\n\u003cp\u003eAny ideas ?? Thanks\u003c/p\u003e","accepted_answer_id":"10430474","answer_count":"4","comment_count":"0","creation_date":"2012-05-03 11:21:05.093 UTC","last_activity_date":"2012-05-03 11:46:30.757 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1136845","post_type_id":"1","score":"2","tags":"iphone|xcode|uitableview","view_count":"1648"} +{"id":"13159932","title":"SSRS - RDLC Tablix Rows will not split across pages","body":"\u003cp\u003eI have a tablix with two columns of data (the section name and the section text). The section text has grown so large for some sections that the row representing the section takes up 2/3 or more of the page. THe report prints fine until on of these large rows would have to split over the end of a page and continue on the next page. In this case, and only in this case, the rows leaves large amounts of white space on current page and start on the next page (as if it had a page break before it)\u003c/p\u003e\n\n\u003cp\u003eI have already set the Tablix General Property \"keep together on one page if possible\" to true and all the other page break options for the tablix and row groups to false, to no avail.\u003c/p\u003e\n\n\u003cp\u003eDoes anyone know of a trick or work around to make the large rows split over pages??\u003c/p\u003e","accepted_answer_id":"13168228","answer_count":"2","comment_count":"0","creation_date":"2012-10-31 14:11:33.723 UTC","last_activity_date":"2013-02-14 01:52:23.277 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"311127","post_type_id":"1","score":"4","tags":"reporting-services","view_count":"13295"} +{"id":"536787","title":"Intermixing HTML form and table","body":"\u003cp\u003eFor a standard \"add item\" form page it is desirable to have two submit buttons: an \"OK\" button and a \"cancel\" button, where the former POSTs the form to one URL, and the latter GETs some other URL.\u003c/p\u003e\n\n\u003cp\u003eThis obviously means that two separate FORMs are needed, and, if laid out with tables, the markup would go as follows:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;form action=\"add.html\" method=\"post\"\u0026gt;\n \u0026lt;table\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;Enter data:\u0026lt;/td\u0026gt;\u0026lt;td\u0026gt;\u0026lt;input type=\"text\" name=\"data\"/\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;/table\u0026gt;\n \u0026lt;input type=\"submit\" value=\"OK\"/\u0026gt;\n\u0026lt;/form\u0026gt;\n\u0026lt;form action=\"index.html\" method=\"get\"\u0026gt;\n \u0026lt;input type=\"submit\" value=\"Cancel\"/\u0026gt;\n\u0026lt;/form\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eHowever, this would result in the two buttons being placed below each other. It would be desirable to have them placed side by side. The following works:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;form action=\"add.html\" method=\"post\"\u0026gt;\n \u0026lt;table\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;Enter data:\u0026lt;/td\u0026gt;\u0026lt;td\u0026gt;\u0026lt;input type=\"text\" name=\"data\"/\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;tr\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;input type=\"submit\" value=\"OK\"/\u0026gt;\u0026lt;/td\u0026gt;\n\u0026lt;/form\u0026gt;\n\u0026lt;form action=\"index.html\" method=\"get\"\u0026gt;\n \u0026lt;td\u0026gt;\u0026lt;input type=\"submit\" value=\"Cancel\"/\u0026gt;\u0026lt;/td\u0026gt;\n \u0026lt;/tr\u0026gt;\n \u0026lt;/table\u0026gt;\n\u0026lt;/form\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eBut although I've seen it used on commercial websites, I guess it's not quite legal HTML.\u003c/p\u003e\n\n\u003cp\u003eSo thus:\u003c/p\u003e\n\n\u003cp\u003e1) Since the second methods works, are there any good reasons for not using it?\u003c/p\u003e\n\n\u003cp\u003e2) Are there any better solutions?\u003c/p\u003e\n\n\u003cp\u003eEDIT: This was a silly question. The second method is unnecessary. Solution: add to the first method a CSS rule of:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eform\n{\n display: inline;\n}\n\u003c/code\u003e\u003c/pre\u003e","answer_count":"4","comment_count":"0","creation_date":"2009-02-11 13:36:53.923 UTC","last_activity_date":"2011-08-28 13:30:13.183 UTC","last_edit_date":"2009-02-11 14:21:31.713 UTC","last_editor_display_name":"Knut Arne Vedaa","last_editor_user_id":"50572","owner_display_name":"Knut Arne Vedaa","owner_user_id":"50572","post_type_id":"1","score":"2","tags":"html|user-interface","view_count":"13286"} +{"id":"4057151","title":"replicating wtikay - IE - currentStyle doesn't update when it ought to","body":"\u003cp\u003eI am trying to replicate, with my own code, the history-sniffing demo seen on \u003ca href=\"http://wtikay.com/\" rel=\"nofollow\"\u003ehttp://wtikay.com/\u003c/a\u003e and various other places. (It's a long story.)\u003c/p\u003e\n\n\u003cp\u003eI have something that works reliably in most older browsers (latest Safari and Chrome releases and Firefox 4 betas have a defense) -- but it doesn't work in IE7 or 8 (haven't tried 6), and I cannot figure out why. It seems to be that IE just isn't bothering to update its rendering when I change the \u003ccode\u003ehref\u003c/code\u003e property on an \u003ccode\u003ea\u003c/code\u003e element -- but as far as I can tell, that's exactly what wtikay does, and it works.\u003c/p\u003e\n\n\u003cp\u003eTest file:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;!doctype html\u0026gt;\n\u0026lt;html\u0026gt;\u0026lt;head\u0026gt;\n\u0026lt;title\u0026gt;gevalt\u0026lt;/title\u0026gt;\n\u0026lt;style\u0026gt;\n body { background-color: gray }\n a:link { text-decoration: none; color: black }\n a:visited { color: white }\n\u0026lt;/style\u0026gt;\n\u0026lt;body\u0026gt;\n\u0026lt;span id=\"container\"\u0026gt;\u0026lt;a href=\"\" id=\"testlink\"\u0026gt;test\u0026lt;/a\u0026gt;\u0026lt;/span\u0026gt;\n\u0026lt;a href=\"ftp://\"\u0026gt;minus\u0026lt;/a\u0026gt;\n\u0026lt;a href=\"http://www.google.com/\"\u0026gt;plus\u0026lt;/a\u0026gt;\n\u0026lt;script\u0026gt;\nwindow.onload = function()\n{\n var testlink = document.getElementById(\"testlink\");\n var results = document.getElementById(\"results\");\n var container = document.getElementById(\"container\");\n var report = \"\";\n\n testlink.href = \"ftp://\";\n container.removeChild(testlink);\n container.appendChild(testlink);\n report += \" -\" + (testlink.currentStyle || window.getComputedStyle(testlink, \"\")).color;\n\n testlink.href = \"http://www.google.com/\";\n container.removeChild(testlink);\n container.appendChild(testlink);\n report += \" +\" + (testlink.currentStyle || window.getComputedStyle(testlink, \"\")).color;\n\n results.appendChild(document.createTextNode(report));\n};\n\u0026lt;/script\u0026gt;\n\u0026lt;pre id=\"results\"\u0026gt;\n\u0026lt;/pre\u0026gt;\n\u0026lt;/body\u0026gt;\u0026lt;/html\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eIn a browser where it works, the words \"test\" and \"plus\" will be white (assuming you have visited www.google.com in that browser), the word \"minus\" will be black, and it will print something like \"\u003ccode\u003e-rgb(0,0,0) +rgb(255,255,255)\u003c/code\u003e\" underneath. In IE, \"test\" will be black instead of white, and underneath it will read \"\u003ccode\u003e-black +black\u003c/code\u003e\". Or possibly \"test\" will be white but underneath it will read \"\u003ccode\u003e-white +white\u003c/code\u003e\". Both those are failures.\u003c/p\u003e\n\n\u003cp\u003eAny help would be most appreciated.\u003c/p\u003e","accepted_answer_id":"4189658","answer_count":"1","comment_count":"0","creation_date":"2010-10-30 03:43:28.32 UTC","last_activity_date":"2010-11-15 22:51:04.817 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"388520","post_type_id":"1","score":"0","tags":"html|css|internet-explorer","view_count":"204"} +{"id":"34246557","title":"command line arguments with multiple output files","body":"\u003cp\u003eIf I want two output files from a command line argument, can I just specify a third argument? i.e. \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e infile=sys.argv[1]\n outfile1=sys.argv[2]\n outfile2=sys.argv[3]\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd then when i'm typing the command into terminal: \u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e python script.py infile.txt outfile1.txt outfield.txt\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eAnd get 2 output files?\u003c/p\u003e","answer_count":"1","comment_count":"3","creation_date":"2015-12-13 00:17:23.723 UTC","last_activity_date":"2015-12-13 00:19:16.15 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"5616621","post_type_id":"1","score":"-4","tags":"python|file|command-line-arguments","view_count":"34"} +{"id":"42365559","title":"Java HttpsServer - Forcing TLSv1.1","body":"\u003cp\u003eI am running Java 8 and using \u003ccode\u003ecom.sun.net.httpserver.HttpsServer\u003c/code\u003e to create a HTTPS server. I have a working implementation using a trusted CA signed EC certificate in a Java KeyStore.\u003c/p\u003e\n\n\u003cp\u003eI have been looking at how I could restrict what Ciphers and Protocols the server could support (similar to Apache using \"SSLProtocol\" and \"SSLCipherSuite\" in the configuration) - mainly to enforce a higher level of security by disabling the use of SHA-1.\u003c/p\u003e\n\n\u003cp\u003eNo one should really be forcing TLSv1.1 over 1.2, but I am just doing this to prove a point that the following configuration works:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003eKeyStore ks = KeyStore.getInstance(\"JKS\");\n// Load KeyStore into \"ks\"\n\nKeyManagerFactory kmf = KeyManagerFactory.getInstance(\"SunX509\");\nkmf.init(ks, jksPassword.toCharArray());\n\nTrustManagerFactory tmf = TrustManagerFactory.getInstance(\"SunX509\");\ntmf.init(ks);\n\nSSLContext sc = SSLContext.getInstance(\"TLS\");\nsc.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);\n\nHttpsServer hsS = HttpsServer.create(sBind, 0);\nhsS.setHttpsConfigurator(new HttpsConfigurator(sc) {\n @Override\n public void configure(HttpsParameters p) {\n try {\n SSLContext c = getSSLContext();\n SSLEngine e = c.createSSLEngine();\n\n p.setNeedClientAuth(false);\n p.setProtocols(new String[] { \"TLSv1.1\" });\n p.setCipherSuites(e.getEnabledCipherSuites());\n p.setSSLParameters(c.getDefaultSSLParameters());\n }\n catch (Exception e) {\n e.printStackTrace();\n }\n }\n});\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eEven though I use \u003ccode\u003esetProtocols()\u003c/code\u003e to only accept \"TLSv1.1\", this doesn't seem to stop \"TLSv1.2\" connections and everything from Chrome to IE still uses \"TLSv1.2\". If I disable the use of \"TLSv1.2\" and \"TLSv1.1\" in IE and just leave \"TLSv1.0\" enabled then it will still work and negotiate \"TLSv1.0\". The \u003ccode\u003esetProtocols()\u003c/code\u003e method doesn't seem to do anything!?!\u003c/p\u003e\n\n\u003cp\u003eIf I got this working then I was going to modify the list of Ciphers using \u003ccode\u003esetCipherSuites()\u003c/code\u003e.\u003c/p\u003e","answer_count":"1","comment_count":"0","creation_date":"2017-02-21 11:04:00.987 UTC","last_activity_date":"2017-02-21 11:07:36.543 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"1990297","post_type_id":"1","score":"0","tags":"java|ssl|encryption|ssl-certificate","view_count":"54"} +{"id":"20975375","title":"Conversion of co-ordinates from points to mm","body":"\u003cp\u003eI have a code using AWT graphics and applets.\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003epublic class Draw extends Applet{\n\n public void paint(Graphics g){\n g.drawLine(10,10,20,10);\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003eThe code above draws a line of 10 units. I am not really sure which unit is the one being used by default. However, I am looking to draw a 10mm line. Finally I would be exporting this output as a PDF and I need the PDF to have a line of required length in mm. How can this be achieved? Thanks in advance.\u003c/p\u003e","answer_count":"1","comment_count":"1","creation_date":"2014-01-07 15:23:10.55 UTC","last_activity_date":"2014-12-02 16:48:18.817 UTC","last_edit_date":"2014-01-08 05:22:11.093 UTC","last_editor_display_name":"","last_editor_user_id":"626773","owner_display_name":"","owner_user_id":"626773","post_type_id":"1","score":"-1","tags":"java|graphics|applet|itext|java-2d","view_count":"641"} +{"id":"37904155","title":"Update javascript with html select value","body":"\u003cp\u003eHere is my code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;select name=\"points\"\u0026gt;\n \u0026lt;option value=\"5\"\u0026gt;5 points\u0026lt;/option\u0026gt;\n \u0026lt;option value=\"10\"\u0026gt;10 points\u0026lt;/option\u0026gt;\n \u0026lt;option value=\"50\"\u0026gt;50 points\u0026lt;/option\u0026gt;\n\u0026lt;/select\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003ehere is my Javascript code:\u003c/p\u003e\n\n\u003cpre\u003e\u003ccode\u003e\u0026lt;script\n src=\"https://checkout.stripe.com/checkout.js\" class=\"stripe-button\"\n data-key=\"test key\"\n data-amount=\"option value here\" // i need help here\n data-name=\"Site Name\"\n data-description=\"2 widgets ($20.00)\"\n data-image=\"/128x128.png\"\u0026gt;\n\u0026lt;/script\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eThe javascript code is a button for a popup.\u003c/strong\u003e i want to get the select option value and i want to insert that into the data-amount in the js code. how can i do that?\u003c/p\u003e","answer_count":"2","comment_count":"0","creation_date":"2016-06-19 05:15:11.49 UTC","last_activity_date":"2016-06-19 05:56:24.437 UTC","last_editor_display_name":"","owner_display_name":"","owner_user_id":"6302455","post_type_id":"1","score":"0","tags":"javascript|jquery|html","view_count":"44"} diff --git a/test/types/connection-pool.test-d.ts b/test/types/connection-pool.test-d.ts new file mode 100644 index 0000000..f46f23e --- /dev/null +++ b/test/types/connection-pool.test-d.ts @@ -0,0 +1,110 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { expectType, expectAssignable } from 'tsd' +import { URL } from 'url' +import { + BaseConnectionPool, + ConnectionPool, + CloudConnectionPool, + Connection +} from '../../' + +{ + const pool = new BaseConnectionPool({ + Connection: Connection, + ssl: { ca: 'stirng' }, + emit: (event, ...args) => true, + agent: { keepAlive: true }, + auth: { username: 'username', password: 'password' } + }) + + expectType(pool) + expectType(pool.connections) + expectType(pool.size) + + expectType(pool.markAlive(new Connection())) + expectType(pool.markDead(new Connection())) + expectType(pool.getConnection({ + filter (node) { return true }, + selector (connections) { return connections[0] }, + requestId: 'id', + name: 'name', + now: Date.now() + })) + expectType(pool.addConnection({})) + expectType(pool.removeConnection(new Connection())) + expectType(pool.empty()) + expectType(pool.update([])) + expectType(pool.nodesToHost([], 'https')) + expectType<{ url: URL }>(pool.urlToHost('url')) +} + +{ + const pool = new ConnectionPool({ + Connection: Connection, + ssl: { ca: 'stirng' }, + emit: (event, ...args) => true, + agent: { keepAlive: true }, + auth: { username: 'username', password: 'password' }, + pingTimeout: 1000, + resurrectStrategy: 'ping', + sniffEnabled: true + }) + + expectAssignable(pool) + expectType(pool.connections) + expectType(pool.size) + expectType(pool.dead) + + expectAssignable(pool.markAlive(new Connection())) + expectAssignable(pool.markDead(new Connection())) + expectType(pool.getConnection({ + filter (node) { return true }, + selector (connections) { return connections[0] }, + requestId: 'id', + name: 'name', + now: Date.now() + })) + expectType(pool.addConnection({})) + expectAssignable(pool.removeConnection(new Connection())) + expectAssignable(pool.empty()) + expectAssignable(pool.update([])) + expectType(pool.nodesToHost([], 'https')) + expectType<{ url: URL }>(pool.urlToHost('url')) + expectType(pool.resurrect({ + now: Date.now(), + requestId: 'id', + name: 'name' + })) +} + +{ + const pool = new CloudConnectionPool({ + Connection: Connection, + ssl: { ca: 'stirng' }, + emit: (event, ...args) => true, + agent: { keepAlive: true }, + auth: { username: 'username', password: 'password' } + }) + + expectAssignable(pool) + expectType(pool.cloudConnection) + expectType(pool.getConnection()) +} diff --git a/test/types/connection.test-d.ts b/test/types/connection.test-d.ts new file mode 100644 index 0000000..66e9d25 --- /dev/null +++ b/test/types/connection.test-d.ts @@ -0,0 +1,54 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { expectType } from 'tsd' +import { URL } from 'url' +import { Connection } from '../../' +import { ConnectionOptions } from '../../lib/Connection' + +{ + const conn = new Connection({ + url: new URL('http://localhost:9200'), + ssl: { ca: 'string' }, + id: 'id', + headers: {}, + agent: { keepAlive: false }, + status: 'alive', + roles: { master: true }, + auth: { username: 'username', password: 'password' } + }) + + expectType(conn) + expectType(conn.url) + expectType(conn.id) + expectType>(conn.headers) + expectType(conn.deadCount) + expectType(conn.resurrectTimeout) + expectType(conn.status) +} + +{ + const conn = new Connection({ + url: new URL('http://localhost:9200'), + agent (opts) { + expectType(opts) + return 'the agent' + } + }) +} diff --git a/test/types/errors.test-d.ts b/test/types/errors.test-d.ts new file mode 100644 index 0000000..2a0d4df --- /dev/null +++ b/test/types/errors.test-d.ts @@ -0,0 +1,104 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { expectType } from 'tsd' +import { errors, ApiResponse, Connection } from '../../' + +const response = { + body: {}, + statusCode: 200, + headers: {}, + warnings: null, + meta: { + context: {}, + name: 'name', + request: { + params: { method: 'GET', path: '/' }, + options: {}, + id: 42 + }, + connection: new Connection(), + attempts: 0, + aborted: false, + } +} + +{ + const err = new errors.ElasticsearchClientError() + expectType(err.name) + expectType(err.message) +} + +{ + const err = new errors.TimeoutError('message', response) + expectType(err.name) + expectType(err.message) + expectType(err.meta) +} + +{ + const err = new errors.ConnectionError('message', response) + expectType(err.name) + expectType(err.message) + expectType(err.meta) +} + +{ + const err = new errors.NoLivingConnectionsError('message', response) + expectType(err.name) + expectType(err.message) + expectType(err.meta) +} + +{ + const err = new errors.SerializationError('message', {}) + expectType(err.name) + expectType(err.message) + expectType(err.data) +} + +{ + const err = new errors.DeserializationError('message', 'data') + expectType(err.name) + expectType(err.message) + expectType(err.data) +} + +{ + const err = new errors.ConfigurationError('message') + expectType(err.name) + expectType(err.message) +} + +{ + const err = new errors.ResponseError(response) + expectType(err.name) + expectType(err.message) + expectType(err.meta) + expectType>(err.body) + expectType(err.statusCode) + expectType>(err.headers) +} + +{ + const err = new errors.RequestAbortedError('message', response) + expectType(err.name) + expectType(err.message) + expectType(err.meta) +} \ No newline at end of file diff --git a/test/types/serializer.test-d.ts b/test/types/serializer.test-d.ts new file mode 100644 index 0000000..69c41ba --- /dev/null +++ b/test/types/serializer.test-d.ts @@ -0,0 +1,28 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { expectType } from 'tsd' +import { Serializer } from '../../' + +const serializer = new Serializer() + +expectType(serializer.serialize({})) +expectType(serializer.deserialize('')) +expectType(serializer.ndserialize([])) +expectType(serializer.qserialize({})) diff --git a/test/types/transport.test-d.ts b/test/types/transport.test-d.ts new file mode 100644 index 0000000..5fa2573 --- /dev/null +++ b/test/types/transport.test-d.ts @@ -0,0 +1,182 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { Readable as ReadableStream } from 'stream'; +import { expectType, expectAssignable, expectError } from 'tsd' +import { + Transport, + Connection, + ConnectionPool, + Serializer +} from '../..' +import { + TransportRequestParams, + TransportRequestOptions, + TransportRequestCallback, + TransportRequestPromise, + RequestEvent, + ApiError, + RequestBody, + RequestNDBody, + ApiResponse +} from '../../lib/Transport' + +const params = { + method: 'POST', + path: '/search', + body: { foo: 'bar' }, + querystring: { baz: 'faz' } +} + +const options = { + ignore: [404], + requestTimeout: 5000, + maxRetries: 3, + asStream: false, + headers: {}, + querystring: {}, + id: 'id', + context: {}, + warnings: ['warn'], + opaqueId: 'id' +} + +const response = { + body: {}, + statusCode: 200, + headers: {}, + warnings: null, + meta: { + context: {}, + name: 'name', + request: { + params, + options, + id: 'id' + }, + connection: new Connection(), + attempts: 0, + aborted: false + } +} + +expectAssignable(params) +expectAssignable({ method: 'GET', path: '/' }) +expectAssignable(options) +expectAssignable(response) +expectAssignable(response) + +// verify that RequestBody, RequestNDBody and ResponseBody works as expected +interface TestBody { hello: string } +expectAssignable({ foo: 'bar' }) +expectAssignable>({ hello: 'world' }) +expectError>({ foo: 'bar' }) +expectAssignable('string') +expectAssignable>('string') +expectAssignable(Buffer.from('hello world')) +expectAssignable(new ReadableStream()) + +expectAssignable([{ foo: 'bar' }]) +expectAssignable[]>([{ hello: 'world' }]) +expectError({ foo: 'bar' }) +expectError[]>([{ foo: 'bar' }]) +expectAssignable(['string']) +expectAssignable(Buffer.from('hello world')) +expectAssignable(new ReadableStream()) + +const transport = new Transport({ + emit: (event, ...args) => true, + serializer: new Serializer(), + connectionPool: new ConnectionPool(), + maxRetries: 5, + requestTimeout: 1000, + suggestCompression: true, + compression: 'gzip', + sniffInterval: 1000, + sniffOnConnectionFault: true, + sniffEndpoint: '/sniff', + sniffOnStart: false +}) + +expectType(transport) + +expectType(transport.request(params, options, (err, result) => {})) + +// querystring as string +transport.request({ + method: 'GET', + path: '/search', + querystring: 'baz=faz' +}, options, (err, result) => { + expectType(err) + expectType(result) +}) + +// body as object +transport.request(params, options, (err, result) => { + expectType(err) + expectType(result) +}) + +// body as string +transport.request({ + method: 'POST', + path: '/search', + body: 'hello world', + querystring: { baz: 'faz' } +}, options, (err, result) => { + expectType(err) + expectType(result) +}) + +// body as Buffer +transport.request({ + method: 'POST', + path: '/search', + body: Buffer.from('hello world'), + querystring: { baz: 'faz' } +}, options, (err, result) => { + expectType(err) + expectType(result) +}) + +// body as ReadableStream +transport.request({ + method: 'POST', + path: '/search', + body: new ReadableStream(), + querystring: { baz: 'faz' } +}, options, (err, result) => { + expectType(err) + expectType(result) +}) + +const promise = transport.request(params, options) +expectType>(promise) +promise.then(result => expectType(result)) +expectType(await promise) + +// body that does not respect the RequestBody constraint +expectError( + transport.request({ + method: 'POST', + path: '/', + body: 42 + }) +) diff --git a/test/unit/base-connection-pool.test.js b/test/unit/base-connection-pool.test.js new file mode 100644 index 0000000..d313a77 --- /dev/null +++ b/test/unit/base-connection-pool.test.js @@ -0,0 +1,505 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +'use strict' + +const { test } = require('tap') +const { URL } = require('url') +const BaseConnectionPool = require('../../lib/pool/BaseConnectionPool') +const Connection = require('../../lib/Connection') + +test('API', t => { + t.test('addConnection', t => { + const pool = new BaseConnectionPool({ Connection }) + const href = 'http://localhost:9200/' + pool.addConnection(href) + t.ok(pool.connections.find(c => c.id === href) instanceof Connection) + t.strictEqual(pool.connections.find(c => c.id === href).status, Connection.statuses.ALIVE) + t.end() + }) + + t.test('addConnection should throw with two connections with the same id', t => { + const pool = new BaseConnectionPool({ Connection }) + const href = 'http://localhost:9200/' + pool.addConnection(href) + try { + pool.addConnection(href) + t.fail('Should throw') + } catch (err) { + t.is(err.message, `Connection with id '${href}' is already present`) + } + t.end() + }) + + t.test('addConnection should handle not-friendly url parameters for user and password', t => { + const pool = new BaseConnectionPool({ Connection }) + const href = 'http://us"er:p@assword@localhost:9200/' + pool.addConnection(href) + const conn = pool.connections[0] + t.strictEqual(conn.url.username, 'us%22er') + t.strictEqual(conn.url.password, 'p%40assword') + t.match(conn.headers, { + authorization: 'Basic ' + Buffer.from('us"er:p@assword').toString('base64') + }) + t.end() + }) + + t.test('markDead', t => { + const pool = new BaseConnectionPool({ Connection, sniffEnabled: true }) + const href = 'http://localhost:9200/' + var connection = pool.addConnection(href) + t.same(pool.markDead(connection), pool) + connection = pool.connections.find(c => c.id === href) + t.strictEqual(connection.status, Connection.statuses.ALIVE) + t.end() + }) + + t.test('markAlive', t => { + const pool = new BaseConnectionPool({ Connection, sniffEnabled: true }) + const href = 'http://localhost:9200/' + var connection = pool.addConnection(href) + t.same(pool.markAlive(connection), pool) + connection = pool.connections.find(c => c.id === href) + t.strictEqual(connection.status, Connection.statuses.ALIVE) + t.end() + }) + + t.test('getConnection should throw', t => { + const pool = new BaseConnectionPool({ Connection }) + const href = 'http://localhost:9200/' + pool.addConnection(href) + try { + pool.getConnection() + t.fail('Should fail') + } catch (err) { + t.is(err.message, 'getConnection must be implemented') + } + t.end() + }) + + t.test('removeConnection', t => { + const pool = new BaseConnectionPool({ Connection }) + const href = 'http://localhost:9200/' + var connection = pool.addConnection(href) + pool.removeConnection(connection) + t.strictEqual(pool.size, 0) + t.end() + }) + + t.test('empty', t => { + const pool = new BaseConnectionPool({ Connection }) + pool.addConnection('http://localhost:9200/') + pool.addConnection('http://localhost:9201/') + pool.empty(() => { + t.strictEqual(pool.size, 0) + t.end() + }) + }) + + t.test('urlToHost', t => { + const pool = new BaseConnectionPool({ Connection }) + const url = 'http://localhost:9200' + t.deepEqual( + pool.urlToHost(url), + { url: new URL(url) } + ) + t.end() + }) + + t.test('nodesToHost', t => { + t.test('publish_address as ip address (IPv4)', t => { + const pool = new BaseConnectionPool({ Connection }) + const nodes = { + a1: { + http: { + publish_address: '127.0.0.1:9200' + }, + roles: ['master', 'data', 'ingest'] + }, + a2: { + http: { + publish_address: '127.0.0.1:9201' + }, + roles: ['master', 'data', 'ingest'] + } + } + + t.deepEqual(pool.nodesToHost(nodes, 'http:'), [{ + url: new URL('http://127.0.0.1:9200'), + id: 'a1', + roles: { + master: true, + data: true, + ingest: true, + ml: false + } + }, { + url: new URL('http://127.0.0.1:9201'), + id: 'a2', + roles: { + master: true, + data: true, + ingest: true, + ml: false + } + }]) + + t.strictEqual(pool.nodesToHost(nodes, 'http:')[0].url.host, '127.0.0.1:9200') + t.strictEqual(pool.nodesToHost(nodes, 'http:')[1].url.host, '127.0.0.1:9201') + t.end() + }) + + t.test('publish_address as ip address (IPv6)', t => { + const pool = new BaseConnectionPool({ Connection }) + const nodes = { + a1: { + http: { + publish_address: '[::1]:9200' + }, + roles: ['master', 'data', 'ingest'] + }, + a2: { + http: { + publish_address: '[::1]:9201' + }, + roles: ['master', 'data', 'ingest'] + } + } + + t.deepEqual(pool.nodesToHost(nodes, 'http:'), [{ + url: new URL('http://[::1]:9200'), + id: 'a1', + roles: { + master: true, + data: true, + ingest: true, + ml: false + } + }, { + url: new URL('http://[::1]:9201'), + id: 'a2', + roles: { + master: true, + data: true, + ingest: true, + ml: false + } + }]) + + t.strictEqual(pool.nodesToHost(nodes, 'http:')[0].url.host, '[::1]:9200') + t.strictEqual(pool.nodesToHost(nodes, 'http:')[1].url.host, '[::1]:9201') + t.end() + }) + + t.test('publish_address as host/ip (IPv4)', t => { + const pool = new BaseConnectionPool({ Connection }) + const nodes = { + a1: { + http: { + publish_address: 'example.com/127.0.0.1:9200' + }, + roles: ['master', 'data', 'ingest'] + }, + a2: { + http: { + publish_address: 'example.com/127.0.0.1:9201' + }, + roles: ['master', 'data', 'ingest'] + } + } + + t.deepEqual(pool.nodesToHost(nodes, 'http:'), [{ + url: new URL('http://example.com:9200'), + id: 'a1', + roles: { + master: true, + data: true, + ingest: true, + ml: false + } + }, { + url: new URL('http://example.com:9201'), + id: 'a2', + roles: { + master: true, + data: true, + ingest: true, + ml: false + } + }]) + + t.strictEqual(pool.nodesToHost(nodes, 'http:')[0].url.host, 'example.com:9200') + t.strictEqual(pool.nodesToHost(nodes, 'http:')[1].url.host, 'example.com:9201') + t.end() + }) + + t.test('publish_address as host/ip (IPv6)', t => { + const pool = new BaseConnectionPool({ Connection }) + const nodes = { + a1: { + http: { + publish_address: 'example.com/[::1]:9200' + }, + roles: ['master', 'data', 'ingest'] + }, + a2: { + http: { + publish_address: 'example.com/[::1]:9201' + }, + roles: ['master', 'data', 'ingest'] + } + } + + t.deepEqual(pool.nodesToHost(nodes, 'http:'), [{ + url: new URL('http://example.com:9200'), + id: 'a1', + roles: { + master: true, + data: true, + ingest: true, + ml: false + } + }, { + url: new URL('http://example.com:9201'), + id: 'a2', + roles: { + master: true, + data: true, + ingest: true, + ml: false + } + }]) + + t.strictEqual(pool.nodesToHost(nodes, 'http:')[0].url.host, 'example.com:9200') + t.strictEqual(pool.nodesToHost(nodes, 'http:')[1].url.host, 'example.com:9201') + t.end() + }) + + t.test('Should use the configure protocol', t => { + const pool = new BaseConnectionPool({ Connection }) + const nodes = { + a1: { + http: { + publish_address: 'example.com/127.0.0.1:9200' + }, + roles: ['master', 'data', 'ingest'] + }, + a2: { + http: { + publish_address: 'example.com/127.0.0.1:9201' + }, + roles: ['master', 'data', 'ingest'] + } + } + + t.strictEqual(pool.nodesToHost(nodes, 'https:')[0].url.protocol, 'https:') + t.strictEqual(pool.nodesToHost(nodes, 'http:')[1].url.protocol, 'http:') + t.end() + }) + + t.end() + }) + + t.test('update', t => { + t.test('Should not update existing connections', t => { + t.plan(2) + const pool = new BaseConnectionPool({ Connection }) + pool.addConnection([{ + url: new URL('http://127.0.0.1:9200'), + id: 'a1', + roles: { + master: true, + data: true, + ingest: true + } + }, { + url: new URL('http://127.0.0.1:9201'), + id: 'a2', + roles: { + master: true, + data: true, + ingest: true + } + }]) + + pool.update([{ + url: new URL('http://127.0.0.1:9200'), + id: 'a1', + roles: null + }, { + url: new URL('http://127.0.0.1:9201'), + id: 'a2', + roles: null + }]) + + t.ok(pool.connections.find(c => c.id === 'a1').roles !== null) + t.ok(pool.connections.find(c => c.id === 'a2').roles !== null) + }) + + t.test('Should not update existing connections (mark alive)', t => { + t.plan(5) + class CustomBaseConnectionPool extends BaseConnectionPool { + markAlive (connection) { + t.ok('called') + super.markAlive(connection) + } + } + const pool = new CustomBaseConnectionPool({ Connection }) + const conn1 = pool.addConnection({ + url: new URL('http://127.0.0.1:9200'), + id: 'a1', + roles: { + master: true, + data: true, + ingest: true + } + }) + + const conn2 = pool.addConnection({ + url: new URL('http://127.0.0.1:9201'), + id: 'a2', + roles: { + master: true, + data: true, + ingest: true + } + }) + + pool.markDead(conn1) + pool.markDead(conn2) + + pool.update([{ + url: new URL('http://127.0.0.1:9200'), + id: 'a1', + roles: null + }, { + url: new URL('http://127.0.0.1:9201'), + id: 'a2', + roles: null + }]) + + t.ok(pool.connections.find(c => c.id === 'a1').roles !== null) + t.ok(pool.connections.find(c => c.id === 'a2').roles !== null) + }) + + t.test('Should not update existing connections (same url, different id)', t => { + t.plan(3) + class CustomBaseConnectionPool extends BaseConnectionPool { + markAlive (connection) { + t.ok('called') + super.markAlive(connection) + } + } + const pool = new CustomBaseConnectionPool({ Connection }) + pool.addConnection([{ + url: new URL('http://127.0.0.1:9200'), + id: 'http://127.0.0.1:9200/', + roles: { + master: true, + data: true, + ingest: true + } + }]) + + pool.update([{ + url: new URL('http://127.0.0.1:9200'), + id: 'a1', + roles: true + }]) + + // roles will never be updated, we only use it to do + // a dummy check to see if the connection has been updated + t.deepEqual(pool.connections.find(c => c.id === 'a1').roles, { + master: true, + data: true, + ingest: true, + ml: false + }) + t.strictEqual(pool.connections.find(c => c.id === 'http://127.0.0.1:9200/'), undefined) + }) + + t.test('Add a new connection', t => { + t.plan(2) + const pool = new BaseConnectionPool({ Connection }) + pool.addConnection({ + url: new URL('http://127.0.0.1:9200'), + id: 'a1', + roles: { + master: true, + data: true, + ingest: true + } + }) + + pool.update([{ + url: new URL('http://127.0.0.1:9200'), + id: 'a1', + roles: null + }, { + url: new URL('http://127.0.0.1:9201'), + id: 'a2', + roles: null + }]) + + t.ok(pool.connections.find(c => c.id === 'a1').roles !== null) + t.ok(pool.connections.find(c => c.id === 'a2')) + }) + + t.test('Remove old connections', t => { + t.plan(3) + const pool = new BaseConnectionPool({ Connection }) + pool.addConnection({ + url: new URL('http://127.0.0.1:9200'), + id: 'a1', + roles: null + }) + + pool.update([{ + url: new URL('http://127.0.0.1:9200'), + id: 'a2', + roles: null + }, { + url: new URL('http://127.0.0.1:9201'), + id: 'a3', + roles: null + }]) + + t.false(pool.connections.find(c => c.id === 'a1')) + t.true(pool.connections.find(c => c.id === 'a2')) + t.true(pool.connections.find(c => c.id === 'a3')) + }) + + t.end() + }) + + t.test('CreateConnection', t => { + t.plan(1) + const pool = new BaseConnectionPool({ Connection }) + const conn = pool.createConnection('http://localhost:9200') + pool.connections.push(conn) + try { + pool.createConnection('http://localhost:9200') + t.fail('Should throw') + } catch (err) { + t.is(err.message, 'Connection with id \'http://localhost:9200/\' is already present') + } + }) + + t.end() +}) diff --git a/test/unit/cloud-connection-pool.test.js b/test/unit/cloud-connection-pool.test.js new file mode 100644 index 0000000..ccefcc3 --- /dev/null +++ b/test/unit/cloud-connection-pool.test.js @@ -0,0 +1,48 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +'use strict' + +const { test } = require('tap') +const { CloudConnectionPool } = require('../../lib/pool') +const Connection = require('../../lib/Connection') + +test('Should expose a cloudConnection property', t => { + const pool = new CloudConnectionPool({ Connection }) + pool.addConnection('http://localhost:9200/') + t.ok(pool.cloudConnection instanceof Connection) + t.end() +}) + +test('Get connection should always return cloudConnection', t => { + const pool = new CloudConnectionPool({ Connection }) + const conn = pool.addConnection('http://localhost:9200/') + t.deepEqual(pool.getConnection(), conn) + t.end() +}) + +test('pool.empty should reset cloudConnection', t => { + const pool = new CloudConnectionPool({ Connection }) + pool.addConnection('http://localhost:9200/') + t.ok(pool.cloudConnection instanceof Connection) + pool.empty(() => { + t.strictEqual(pool.cloudConnection, null) + t.end() + }) +}) diff --git a/test/unit/connection-pool.test.js b/test/unit/connection-pool.test.js new file mode 100644 index 0000000..bb40382 --- /dev/null +++ b/test/unit/connection-pool.test.js @@ -0,0 +1,801 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +'use strict' + +const { test } = require('tap') +const { URL } = require('url') +const ConnectionPool = require('../../lib/pool/ConnectionPool') +const Connection = require('../../lib/Connection') +const { defaultNodeFilter, roundRobinSelector } = require('../../lib/Transport').internals +const { connection: { MockConnection, MockConnectionTimeout } } = require('../utils') + +test('API', t => { + t.test('addConnection', t => { + const pool = new ConnectionPool({ Connection }) + const href = 'http://localhost:9200/' + pool.addConnection(href) + t.ok(pool.connections.find(c => c.id === href) instanceof Connection) + t.strictEqual(pool.connections.find(c => c.id === href).status, Connection.statuses.ALIVE) + t.deepEqual(pool.dead, []) + t.end() + }) + + t.test('addConnection should throw with two connections with the same id', t => { + const pool = new ConnectionPool({ Connection }) + const href = 'http://localhost:9200/' + pool.addConnection(href) + try { + pool.addConnection(href) + t.fail('Should throw') + } catch (err) { + t.is(err.message, `Connection with id '${href}' is already present`) + } + t.end() + }) + + t.test('addConnection should handle not-friendly url parameters for user and password', t => { + const pool = new ConnectionPool({ Connection }) + const href = 'http://us"er:p@assword@localhost:9200/' + pool.addConnection(href) + const conn = pool.getConnection() + t.strictEqual(conn.url.username, 'us%22er') + t.strictEqual(conn.url.password, 'p%40assword') + t.match(conn.headers, { + authorization: 'Basic ' + Buffer.from('us"er:p@assword').toString('base64') + }) + t.end() + }) + + t.test('markDead', t => { + const pool = new ConnectionPool({ Connection, sniffEnabled: true }) + const href = 'http://localhost:9200/' + var connection = pool.addConnection(href) + pool.markDead(connection) + connection = pool.connections.find(c => c.id === href) + t.strictEqual(connection.deadCount, 1) + t.true(connection.resurrectTimeout > 0) + t.deepEqual(pool.dead, [href]) + t.end() + }) + + t.test('markDead should sort the dead queue by deadTimeout', t => { + const pool = new ConnectionPool({ Connection }) + const href1 = 'http://localhost:9200/1' + const href2 = 'http://localhost:9200/2' + const conn1 = pool.addConnection(href1) + const conn2 = pool.addConnection(href2) + pool.markDead(conn2) + setTimeout(() => { + pool.markDead(conn1) + t.deepEqual(pool.dead, [href2, href1]) + t.end() + }, 10) + }) + + t.test('markDead should ignore connections that no longer exists', t => { + const pool = new ConnectionPool({ Connection, sniffEnabled: true }) + pool.addConnection('http://localhost:9200/') + pool.markDead({ id: 'foo-bar' }) + t.deepEqual(pool.dead, []) + t.end() + }) + + t.test('markAlive', t => { + const pool = new ConnectionPool({ Connection, sniffEnabled: true }) + const href = 'http://localhost:9200/' + var connection = pool.addConnection(href) + pool.markDead(connection) + pool.markAlive(connection) + connection = pool.connections.find(c => c.id === href) + t.strictEqual(connection.deadCount, 0) + t.strictEqual(connection.resurrectTimeout, 0) + t.strictEqual(connection.status, Connection.statuses.ALIVE) + t.deepEqual(pool.dead, []) + t.end() + }) + + t.test('resurrect', t => { + t.test('ping strategy', t => { + t.test('alive', t => { + const pool = new ConnectionPool({ + resurrectStrategy: 'ping', + pingTimeout: 3000, + Connection: MockConnection, + sniffEnabled: true + }) + const href = 'http://localhost:9200/' + var connection = pool.addConnection(href) + pool.markDead(connection) + const opts = { + now: Date.now() + 1000 * 60 * 3, + requestId: 1, + name: 'elasticsearch-js' + } + pool.resurrect(opts, (isAlive, connection) => { + t.true(isAlive) + connection = pool.connections.find(c => c.id === connection.id) + t.strictEqual(connection.deadCount, 0) + t.strictEqual(connection.resurrectTimeout, 0) + t.strictEqual(connection.status, Connection.statuses.ALIVE) + t.deepEqual(pool.dead, []) + t.end() + }) + }) + + t.test('dead', t => { + const pool = new ConnectionPool({ + resurrectStrategy: 'ping', + pingTimeout: 3000, + Connection: MockConnectionTimeout, + sniffEnabled: true + }) + const href = 'http://localhost:9200/' + var connection = pool.addConnection(href) + pool.markDead(connection) + const opts = { + now: Date.now() + 1000 * 60 * 3, + requestId: 1, + name: 'elasticsearch-js' + } + pool.resurrect(opts, (isAlive, connection) => { + t.false(isAlive) + connection = pool.connections.find(c => c.id === connection.id) + t.strictEqual(connection.deadCount, 2) + t.true(connection.resurrectTimeout > 0) + t.strictEqual(connection.status, Connection.statuses.DEAD) + t.deepEqual(pool.dead, [href]) + t.end() + }) + }) + + t.end() + }) + + t.test('optimistic strategy', t => { + const pool = new ConnectionPool({ + resurrectStrategy: 'optimistic', + Connection, + sniffEnabled: true + }) + const href = 'http://localhost:9200/' + var connection = pool.addConnection(href) + pool.markDead(connection) + const opts = { + now: Date.now() + 1000 * 60 * 3, + requestId: 1, + name: 'elasticsearch-js' + } + pool.resurrect(opts, (isAlive, connection) => { + t.true(isAlive) + connection = pool.connections.find(c => c.id === connection.id) + t.strictEqual(connection.deadCount, 1) + t.true(connection.resurrectTimeout > 0) + t.strictEqual(connection.status, Connection.statuses.ALIVE) + t.deepEqual(pool.dead, []) + t.end() + }) + }) + + t.test('none strategy', t => { + const pool = new ConnectionPool({ + resurrectStrategy: 'none', + Connection, + sniffEnabled: true + }) + const href = 'http://localhost:9200/' + var connection = pool.addConnection(href) + pool.markDead(connection) + const opts = { + now: Date.now() + 1000 * 60 * 3, + requestId: 1, + name: 'elasticsearch-js' + } + pool.resurrect(opts, (isAlive, connection) => { + t.ok(isAlive === null) + t.ok(connection === null) + connection = pool.connections.find(c => c.id === href) + t.strictEqual(connection.deadCount, 1) + t.true(connection.resurrectTimeout > 0) + t.strictEqual(connection.status, Connection.statuses.DEAD) + t.deepEqual(pool.dead, [href]) + t.end() + }) + }) + + t.end() + }) + + t.test('getConnection', t => { + t.test('Should return a connection', t => { + const pool = new ConnectionPool({ Connection }) + const href = 'http://localhost:9200/' + pool.addConnection(href) + t.ok(pool.getConnection() instanceof Connection) + t.end() + }) + + t.test('filter option', t => { + const pool = new ConnectionPool({ Connection }) + const href1 = 'http://localhost:9200/' + const href2 = 'http://localhost:9200/other' + pool.addConnection([href1, href2]) + + const filter = node => node.id === href1 + t.strictEqual(pool.getConnection({ filter }).id, href1) + t.end() + }) + + t.test('filter should get Connection objects', t => { + t.plan(2) + const pool = new ConnectionPool({ Connection }) + const href1 = 'http://localhost:9200/' + const href2 = 'http://localhost:9200/other' + pool.addConnection([href1, href2]) + + const filter = node => { + t.ok(node instanceof Connection) + return true + } + pool.getConnection({ filter }) + }) + + t.test('filter should get alive connections', t => { + t.plan(2) + const pool = new ConnectionPool({ Connection }) + const href1 = 'http://localhost:9200/' + const href2 = 'http://localhost:9200/other' + const conn = pool.addConnection(href1) + pool.addConnection([href2, `${href2}/stuff`]) + pool.markDead(conn) + + const filter = node => { + t.strictEqual(node.status, Connection.statuses.ALIVE) + return true + } + pool.getConnection({ filter }) + }) + + t.test('If all connections are marked as dead, getConnection should return a dead connection', t => { + const pool = new ConnectionPool({ Connection }) + const href1 = 'http://localhost:9200/' + const href2 = 'http://localhost:9200/other' + const conn1 = pool.addConnection(href1) + const conn2 = pool.addConnection(href2) + pool.markDead(conn1) + pool.markDead(conn2) + const conn = pool.getConnection() + t.ok(conn instanceof Connection) + t.is(conn.status, 'dead') + t.end() + }) + + t.end() + }) + + t.test('removeConnection', t => { + const pool = new ConnectionPool({ Connection }) + const href = 'http://localhost:9200/' + var connection = pool.addConnection(href) + t.ok(pool.getConnection() instanceof Connection) + pool.removeConnection(connection) + t.strictEqual(pool.getConnection(), null) + t.end() + }) + + t.test('empty', t => { + const pool = new ConnectionPool({ Connection }) + pool.addConnection('http://localhost:9200/') + pool.addConnection('http://localhost:9201/') + pool.empty(() => { + t.strictEqual(pool.size, 0) + t.deepEqual(pool.dead, []) + t.end() + }) + }) + + t.test('urlToHost', t => { + const pool = new ConnectionPool({ Connection }) + const url = 'http://localhost:9200' + t.deepEqual( + pool.urlToHost(url), + { url: new URL(url) } + ) + t.end() + }) + + t.test('nodesToHost', t => { + t.test('publish_address as ip address (IPv4)', t => { + const pool = new ConnectionPool({ Connection }) + const nodes = { + a1: { + http: { + publish_address: '127.0.0.1:9200' + }, + roles: ['master', 'data', 'ingest'] + }, + a2: { + http: { + publish_address: '127.0.0.1:9201' + }, + roles: ['master', 'data', 'ingest'] + } + } + + t.deepEqual(pool.nodesToHost(nodes, 'http:'), [{ + url: new URL('http://127.0.0.1:9200'), + id: 'a1', + roles: { + master: true, + data: true, + ingest: true, + ml: false + } + }, { + url: new URL('http://127.0.0.1:9201'), + id: 'a2', + roles: { + master: true, + data: true, + ingest: true, + ml: false + } + }]) + + t.strictEqual(pool.nodesToHost(nodes, 'http:')[0].url.host, '127.0.0.1:9200') + t.strictEqual(pool.nodesToHost(nodes, 'http:')[1].url.host, '127.0.0.1:9201') + t.end() + }) + + t.test('publish_address as ip address (IPv6)', t => { + const pool = new ConnectionPool({ Connection }) + const nodes = { + a1: { + http: { + publish_address: '[::1]:9200' + }, + roles: ['master', 'data', 'ingest'] + }, + a2: { + http: { + publish_address: '[::1]:9201' + }, + roles: ['master', 'data', 'ingest'] + } + } + + t.deepEqual(pool.nodesToHost(nodes, 'http:'), [{ + url: new URL('http://[::1]:9200'), + id: 'a1', + roles: { + master: true, + data: true, + ingest: true, + ml: false + } + }, { + url: new URL('http://[::1]:9201'), + id: 'a2', + roles: { + master: true, + data: true, + ingest: true, + ml: false + } + }]) + + t.strictEqual(pool.nodesToHost(nodes, 'http:')[0].url.host, '[::1]:9200') + t.strictEqual(pool.nodesToHost(nodes, 'http:')[1].url.host, '[::1]:9201') + t.end() + }) + + t.test('publish_address as host/ip (IPv4)', t => { + const pool = new ConnectionPool({ Connection }) + const nodes = { + a1: { + http: { + publish_address: 'example.com/127.0.0.1:9200' + }, + roles: ['master', 'data', 'ingest'] + }, + a2: { + http: { + publish_address: 'example.com/127.0.0.1:9201' + }, + roles: ['master', 'data', 'ingest'] + } + } + + t.deepEqual(pool.nodesToHost(nodes, 'http:'), [{ + url: new URL('http://example.com:9200'), + id: 'a1', + roles: { + master: true, + data: true, + ingest: true, + ml: false + } + }, { + url: new URL('http://example.com:9201'), + id: 'a2', + roles: { + master: true, + data: true, + ingest: true, + ml: false + } + }]) + + t.strictEqual(pool.nodesToHost(nodes, 'http:')[0].url.host, 'example.com:9200') + t.strictEqual(pool.nodesToHost(nodes, 'http:')[1].url.host, 'example.com:9201') + t.end() + }) + + t.test('publish_address as host/ip (IPv6)', t => { + const pool = new ConnectionPool({ Connection }) + const nodes = { + a1: { + http: { + publish_address: 'example.com/[::1]:9200' + }, + roles: ['master', 'data', 'ingest'] + }, + a2: { + http: { + publish_address: 'example.com/[::1]:9201' + }, + roles: ['master', 'data', 'ingest'] + } + } + + t.deepEqual(pool.nodesToHost(nodes, 'http:'), [{ + url: new URL('http://example.com:9200'), + id: 'a1', + roles: { + master: true, + data: true, + ingest: true, + ml: false + } + }, { + url: new URL('http://example.com:9201'), + id: 'a2', + roles: { + master: true, + data: true, + ingest: true, + ml: false + } + }]) + + t.strictEqual(pool.nodesToHost(nodes, 'http:')[0].url.host, 'example.com:9200') + t.strictEqual(pool.nodesToHost(nodes, 'http:')[1].url.host, 'example.com:9201') + t.end() + }) + + t.test('Should use the configure protocol', t => { + const pool = new ConnectionPool({ Connection }) + const nodes = { + a1: { + http: { + publish_address: 'example.com/127.0.0.1:9200' + }, + roles: ['master', 'data', 'ingest'] + }, + a2: { + http: { + publish_address: 'example.com/127.0.0.1:9201' + }, + roles: ['master', 'data', 'ingest'] + } + } + + t.strictEqual(pool.nodesToHost(nodes, 'https:')[0].url.protocol, 'https:') + t.strictEqual(pool.nodesToHost(nodes, 'http:')[1].url.protocol, 'http:') + t.end() + }) + + t.test('Should map roles', t => { + const pool = new ConnectionPool({ Connection }) + const nodes = { + a1: { + http: { + publish_address: 'example.com:9200' + }, + roles: ['master', 'data', 'ingest', 'ml'] + }, + a2: { + http: { + publish_address: 'example.com:9201' + }, + roles: [] + } + } + t.same(pool.nodesToHost(nodes, 'http:'), [{ + url: new URL('http://example.com:9200'), + id: 'a1', + roles: { + master: true, + data: true, + ingest: true, + ml: true + } + }, { + url: new URL('http://example.com:9201'), + id: 'a2', + roles: { + master: false, + data: false, + ingest: false, + ml: false + } + }]) + + t.end() + }) + + t.end() + }) + + t.test('update', t => { + t.test('Should not update existing connections', t => { + t.plan(2) + const pool = new ConnectionPool({ Connection }) + pool.addConnection([{ + url: new URL('http://127.0.0.1:9200'), + id: 'a1', + roles: { + master: true, + data: true, + ingest: true + } + }, { + url: new URL('http://127.0.0.1:9201'), + id: 'a2', + roles: { + master: true, + data: true, + ingest: true + } + }]) + + pool.update([{ + url: new URL('http://127.0.0.1:9200'), + id: 'a1', + roles: null + }, { + url: new URL('http://127.0.0.1:9201'), + id: 'a2', + roles: null + }]) + + t.ok(pool.connections.find(c => c.id === 'a1').roles !== null) + t.ok(pool.connections.find(c => c.id === 'a2').roles !== null) + }) + + t.test('Should not update existing connections (mark alive)', t => { + t.plan(5) + class CustomConnectionPool extends ConnectionPool { + markAlive (connection) { + t.ok('called') + super.markAlive(connection) + } + } + const pool = new CustomConnectionPool({ Connection }) + const conn1 = pool.addConnection({ + url: new URL('http://127.0.0.1:9200'), + id: 'a1', + roles: { + master: true, + data: true, + ingest: true + } + }) + + const conn2 = pool.addConnection({ + url: new URL('http://127.0.0.1:9201'), + id: 'a2', + roles: { + master: true, + data: true, + ingest: true + } + }) + + pool.markDead(conn1) + pool.markDead(conn2) + + pool.update([{ + url: new URL('http://127.0.0.1:9200'), + id: 'a1', + roles: null + }, { + url: new URL('http://127.0.0.1:9201'), + id: 'a2', + roles: null + }]) + + t.ok(pool.connections.find(c => c.id === 'a1').roles !== null) + t.ok(pool.connections.find(c => c.id === 'a2').roles !== null) + }) + + t.test('Should not update existing connections (same url, different id)', t => { + t.plan(3) + class CustomConnectionPool extends ConnectionPool { + markAlive (connection) { + t.ok('called') + super.markAlive(connection) + } + } + const pool = new CustomConnectionPool({ Connection }) + pool.addConnection([{ + url: new URL('http://127.0.0.1:9200'), + id: 'http://127.0.0.1:9200/', + roles: { + master: true, + data: true, + ingest: true + } + }]) + + pool.update([{ + url: new URL('http://127.0.0.1:9200'), + id: 'a1', + roles: true + }]) + + // roles will never be updated, we only use it to do + // a dummy check to see if the connection has been updated + t.deepEqual(pool.connections.find(c => c.id === 'a1').roles, { + master: true, + data: true, + ingest: true, + ml: false + }) + t.strictEqual(pool.connections.find(c => c.id === 'http://127.0.0.1:9200/'), undefined) + }) + + t.test('Add a new connection', t => { + t.plan(2) + const pool = new ConnectionPool({ Connection }) + pool.addConnection({ + url: new URL('http://127.0.0.1:9200'), + id: 'a1', + roles: { + master: true, + data: true, + ingest: true + } + }) + + pool.update([{ + url: new URL('http://127.0.0.1:9200'), + id: 'a1', + roles: null + }, { + url: new URL('http://127.0.0.1:9201'), + id: 'a2', + roles: null + }]) + + t.ok(pool.connections.find(c => c.id === 'a1').roles !== null) + t.ok(pool.connections.find(c => c.id === 'a2')) + }) + + t.test('Remove old connections', t => { + t.plan(3) + const pool = new ConnectionPool({ Connection }) + pool.addConnection({ + url: new URL('http://127.0.0.1:9200'), + id: 'a1', + roles: null + }) + + pool.update([{ + url: new URL('http://127.0.0.1:9200'), + id: 'a2', + roles: null + }, { + url: new URL('http://127.0.0.1:9201'), + id: 'a3', + roles: null + }]) + + t.false(pool.connections.find(c => c.id === 'a1')) + t.true(pool.connections.find(c => c.id === 'a2')) + t.true(pool.connections.find(c => c.id === 'a3')) + }) + + t.test('Remove old connections (markDead)', t => { + t.plan(5) + const pool = new ConnectionPool({ Connection, sniffEnabled: true }) + const conn = pool.addConnection({ + url: new URL('http://127.0.0.1:9200'), + id: 'a1', + roles: null + }) + + pool.markDead(conn) + t.deepEqual(pool.dead, ['a1']) + + pool.update([{ + url: new URL('http://127.0.0.1:9200'), + id: 'a2', + roles: null + }, { + url: new URL('http://127.0.0.1:9201'), + id: 'a3', + roles: null + }]) + + t.deepEqual(pool.dead, []) + t.false(pool.connections.find(c => c.id === 'a1')) + t.true(pool.connections.find(c => c.id === 'a2')) + t.true(pool.connections.find(c => c.id === 'a3')) + }) + + t.end() + }) + + t.end() +}) + +test('Node selector', t => { + t.test('round-robin', t => { + t.plan(1) + const pool = new ConnectionPool({ Connection }) + pool.addConnection('http://localhost:9200/') + t.true(pool.getConnection({ selector: roundRobinSelector() }) instanceof Connection) + }) + + t.test('random', t => { + t.plan(1) + const pool = new ConnectionPool({ Connection }) + pool.addConnection('http://localhost:9200/') + t.true(pool.getConnection({ selector: roundRobinSelector() }) instanceof Connection) + }) + + t.end() +}) + +test('Node filter', t => { + t.test('default', t => { + t.plan(1) + const pool = new ConnectionPool({ Connection }) + pool.addConnection({ url: new URL('http://localhost:9200/') }) + t.true(pool.getConnection({ filter: defaultNodeFilter }) instanceof Connection) + }) + + t.test('Should filter master only nodes', t => { + t.plan(1) + const pool = new ConnectionPool({ Connection }) + pool.addConnection({ + url: new URL('http://localhost:9200/'), + roles: { + master: true, + data: false, + ingest: false, + ml: false + } + }) + t.strictEqual(pool.getConnection({ filter: defaultNodeFilter }), null) + }) + + t.end() +}) diff --git a/test/unit/connection.test.js b/test/unit/connection.test.js new file mode 100644 index 0000000..9088e54 --- /dev/null +++ b/test/unit/connection.test.js @@ -0,0 +1,949 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +'use strict' + +const { test } = require('tap') +const { inspect } = require('util') +const { URL } = require('url') +const { Agent } = require('http') +const { Readable } = require('stream') +const hpagent = require('hpagent') +const intoStream = require('into-stream') +const { buildServer } = require('../utils') +const Connection = require('../../lib/Connection') +const { TimeoutError, ConfigurationError, RequestAbortedError } = require('../../lib/errors') + +test('Basic (http)', t => { + t.plan(4) + + function handler (req, res) { + t.match(req.headers, { + 'x-custom-test': 'true', + connection: 'keep-alive' + }) + res.end('ok') + } + + buildServer(handler, ({ port }, server) => { + const connection = new Connection({ + url: new URL(`http://localhost:${port}`) + }) + connection.request({ + path: '/hello', + method: 'GET', + headers: { + 'X-Custom-Test': true + } + }, (err, res) => { + t.error(err) + + t.match(res.headers, { + connection: 'keep-alive' + }) + + var payload = '' + res.setEncoding('utf8') + res.on('data', chunk => { payload += chunk }) + res.on('error', err => t.fail(err)) + res.on('end', () => { + t.strictEqual(payload, 'ok') + server.stop() + }) + }) + }) +}) + +test('Basic (https)', t => { + t.plan(4) + + function handler (req, res) { + t.match(req.headers, { + 'x-custom-test': 'true', + connection: 'keep-alive' + }) + res.end('ok') + } + + buildServer(handler, { secure: true }, ({ port }, server) => { + const connection = new Connection({ + url: new URL(`https://localhost:${port}`) + }) + connection.request({ + path: '/hello', + method: 'GET', + headers: { + 'X-Custom-Test': true + } + }, (err, res) => { + t.error(err) + + t.match(res.headers, { + connection: 'keep-alive' + }) + + var payload = '' + res.setEncoding('utf8') + res.on('data', chunk => { payload += chunk }) + res.on('error', err => t.fail(err)) + res.on('end', () => { + t.strictEqual(payload, 'ok') + server.stop() + }) + }) + }) +}) + +test('Basic (https with ssl agent)', t => { + t.plan(4) + + function handler (req, res) { + t.match(req.headers, { + 'x-custom-test': 'true', + connection: 'keep-alive' + }) + res.end('ok') + } + + buildServer(handler, { secure: true }, ({ port, key, cert }, server) => { + const connection = new Connection({ + url: new URL(`https://localhost:${port}`), + ssl: { key, cert } + }) + connection.request({ + path: '/hello', + method: 'GET', + headers: { + 'X-Custom-Test': true + } + }, (err, res) => { + t.error(err) + + t.match(res.headers, { + connection: 'keep-alive' + }) + + var payload = '' + res.setEncoding('utf8') + res.on('data', chunk => { payload += chunk }) + res.on('error', err => t.fail(err)) + res.on('end', () => { + t.strictEqual(payload, 'ok') + server.stop() + }) + }) + }) +}) + +test('Custom http agent', t => { + t.plan(6) + + function handler (req, res) { + t.match(req.headers, { + 'x-custom-test': 'true', + connection: 'keep-alive' + }) + res.end('ok') + } + + buildServer(handler, ({ port }, server) => { + const agent = new Agent({ + keepAlive: true, + keepAliveMsecs: 1000, + maxSockets: 256, + maxFreeSockets: 256 + }) + agent.custom = true + const connection = new Connection({ + url: new URL(`http://localhost:${port}`), + agent: opts => { + t.match(opts, { + url: new URL(`http://localhost:${port}`) + }) + return agent + } + }) + t.true(connection.agent.custom) + connection.request({ + path: '/hello', + method: 'GET', + headers: { + 'X-Custom-Test': true + } + }, (err, res) => { + t.error(err) + + t.match(res.headers, { + connection: 'keep-alive' + }) + + var payload = '' + res.setEncoding('utf8') + res.on('data', chunk => { payload += chunk }) + res.on('error', err => t.fail(err)) + res.on('end', () => { + t.strictEqual(payload, 'ok') + server.stop() + }) + }) + }) +}) + +test('Disable keep alive', t => { + t.plan(3) + + function handler (req, res) { + t.match(req.headers, { + 'x-custom-test': 'true', + connection: 'close' + }) + res.end('ok') + } + + buildServer(handler, ({ port }, server) => { + const connection = new Connection({ + url: new URL(`http://localhost:${port}`), + agent: false + }) + connection.request({ + path: '/hello', + method: 'GET', + headers: { + 'X-Custom-Test': true + } + }, (err, res) => { + t.error(err) + + t.match(res.headers, { + connection: 'close' + }) + server.stop() + }) + }) +}) + +test('Timeout support', t => { + t.plan(1) + + function handler (req, res) { + setTimeout( + () => res.end('ok'), + 1000 + ) + } + + buildServer(handler, ({ port }, server) => { + const connection = new Connection({ + url: new URL(`http://localhost:${port}`) + }) + connection.request({ + path: '/hello', + method: 'GET', + timeout: 500 + }, (err, res) => { + t.ok(err instanceof TimeoutError) + server.stop() + }) + }) +}) + +test('querystring', t => { + t.test('Should concatenate the querystring', t => { + t.plan(2) + + function handler (req, res) { + t.strictEqual(req.url, '/hello?hello=world&you_know=for%20search') + res.end('ok') + } + + buildServer(handler, ({ port }, server) => { + const connection = new Connection({ + url: new URL(`http://localhost:${port}`) + }) + connection.request({ + path: '/hello', + method: 'GET', + querystring: 'hello=world&you_know=for%20search' + }, (err, res) => { + t.error(err) + server.stop() + }) + }) + }) + + t.test('If the querystring is null should not do anything', t => { + t.plan(2) + + function handler (req, res) { + t.strictEqual(req.url, '/hello') + res.end('ok') + } + + buildServer(handler, ({ port }, server) => { + const connection = new Connection({ + url: new URL(`http://localhost:${port}`) + }) + connection.request({ + path: '/hello', + method: 'GET', + querystring: null + }, (err, res) => { + t.error(err) + server.stop() + }) + }) + }) + + t.end() +}) + +test('Body request', t => { + t.plan(2) + + function handler (req, res) { + var payload = '' + req.setEncoding('utf8') + req.on('data', chunk => { payload += chunk }) + req.on('error', err => t.fail(err)) + req.on('end', () => { + t.strictEqual(payload, 'hello') + res.end('ok') + }) + } + + buildServer(handler, ({ port }, server) => { + const connection = new Connection({ + url: new URL(`http://localhost:${port}`) + }) + connection.request({ + path: '/hello', + method: 'POST', + body: 'hello' + }, (err, res) => { + t.error(err) + server.stop() + }) + }) +}) + +test('Send body as buffer', t => { + t.plan(2) + + function handler (req, res) { + var payload = '' + req.setEncoding('utf8') + req.on('data', chunk => { payload += chunk }) + req.on('error', err => t.fail(err)) + req.on('end', () => { + t.strictEqual(payload, 'hello') + res.end('ok') + }) + } + + buildServer(handler, ({ port }, server) => { + const connection = new Connection({ + url: new URL(`http://localhost:${port}`) + }) + connection.request({ + path: '/hello', + method: 'POST', + body: Buffer.from('hello') + }, (err, res) => { + t.error(err) + server.stop() + }) + }) +}) + +test('Send body as stream', t => { + t.plan(2) + + function handler (req, res) { + var payload = '' + req.setEncoding('utf8') + req.on('data', chunk => { payload += chunk }) + req.on('error', err => t.fail(err)) + req.on('end', () => { + t.strictEqual(payload, 'hello') + res.end('ok') + }) + } + + buildServer(handler, ({ port }, server) => { + const connection = new Connection({ + url: new URL(`http://localhost:${port}`) + }) + connection.request({ + path: '/hello', + method: 'POST', + body: intoStream('hello') + }, (err, res) => { + t.error(err) + server.stop() + }) + }) +}) + +test('Should not close a connection if there are open requests', t => { + t.plan(4) + + function handler (req, res) { + setTimeout(() => res.end('ok'), 1000) + } + + buildServer(handler, ({ port }, server) => { + const connection = new Connection({ + url: new URL(`http://localhost:${port}`) + }) + + setTimeout(() => { + t.strictEqual(connection._openRequests, 1) + connection.close() + }, 500) + + connection.request({ + path: '/hello', + method: 'GET' + }, (err, res) => { + t.error(err) + t.strictEqual(connection._openRequests, 0) + + var payload = '' + res.setEncoding('utf8') + res.on('data', chunk => { payload += chunk }) + res.on('error', err => t.fail(err)) + res.on('end', () => { + t.strictEqual(payload, 'ok') + server.stop() + }) + }) + }) +}) + +test('Should not close a connection if there are open requests (with agent disabled)', t => { + t.plan(4) + + function handler (req, res) { + setTimeout(() => res.end('ok'), 1000) + } + + buildServer(handler, ({ port }, server) => { + const connection = new Connection({ + url: new URL(`http://localhost:${port}`), + agent: false + }) + + setTimeout(() => { + t.strictEqual(connection._openRequests, 1) + connection.close() + }, 500) + + connection.request({ + path: '/hello', + method: 'GET' + }, (err, res) => { + t.error(err) + t.strictEqual(connection._openRequests, 0) + + var payload = '' + res.setEncoding('utf8') + res.on('data', chunk => { payload += chunk }) + res.on('error', err => t.fail(err)) + res.on('end', () => { + t.strictEqual(payload, 'ok') + server.stop() + }) + }) + }) +}) + +test('Url with auth', t => { + t.plan(2) + + function handler (req, res) { + t.match(req.headers, { + authorization: 'Basic Zm9vOmJhcg==' + }) + res.end('ok') + } + + buildServer(handler, ({ port }, server) => { + const connection = new Connection({ + url: new URL(`http://foo:bar@localhost:${port}`), + auth: { username: 'foo', password: 'bar' } + }) + connection.request({ + path: '/hello', + method: 'GET' + }, (err, res) => { + t.error(err) + server.stop() + }) + }) +}) + +test('Url with querystring', t => { + t.plan(2) + + function handler (req, res) { + t.strictEqual(req.url, '/hello?foo=bar&baz=faz') + res.end('ok') + } + + buildServer(handler, ({ port }, server) => { + const connection = new Connection({ + url: new URL(`http://localhost:${port}?foo=bar`) + }) + connection.request({ + path: '/hello', + method: 'GET', + querystring: 'baz=faz' + }, (err, res) => { + t.error(err) + server.stop() + }) + }) +}) + +test('Custom headers for connection', t => { + t.plan(3) + + function handler (req, res) { + t.match(req.headers, { + 'x-custom-test': 'true', + 'x-foo': 'bar' + }) + res.end('ok') + } + + buildServer(handler, ({ port }, server) => { + const connection = new Connection({ + url: new URL(`http://localhost:${port}`), + headers: { 'x-foo': 'bar' } + }) + connection.request({ + path: '/hello', + method: 'GET', + headers: { + 'X-Custom-Test': true + } + }, (err, res) => { + t.error(err) + // should not update the default + t.deepEqual(connection.headers, { 'x-foo': 'bar' }) + server.stop() + }) + }) +}) + +// TODO: add a check that the response is not decompressed +test('asStream set to true', t => { + t.plan(2) + + function handler (req, res) { + res.end('ok') + } + + buildServer(handler, ({ port }, server) => { + const connection = new Connection({ + url: new URL(`http://localhost:${port}`) + }) + connection.request({ + path: '/hello', + method: 'GET', + asStream: true + }, (err, res) => { + t.error(err) + + var payload = '' + res.setEncoding('utf8') + res.on('data', chunk => { payload += chunk }) + res.on('error', err => t.fail(err)) + res.on('end', () => { + t.strictEqual(payload, 'ok') + server.stop() + }) + }) + }) +}) + +test('Connection id should not contain credentials', t => { + const connection = new Connection({ + url: new URL('http://user:password@localhost:9200') + }) + t.strictEqual(connection.id, 'http://localhost:9200/') + t.end() +}) + +test('Ipv6 support', t => { + const connection = new Connection({ + url: new URL('http://[::1]:9200') + }) + t.strictEqual(connection.buildRequestObject({}).hostname, '::1') + t.end() +}) + +test('Should throw if the protocol is not http or https', t => { + try { + new Connection({ // eslint-disable-line + url: new URL('nope://nope') + }) + t.fail('Should throw') + } catch (err) { + t.ok(err instanceof ConfigurationError) + t.is(err.message, 'Invalid protocol: \'nope:\'') + } + t.end() +}) + +// https://github.com/nodejs/node/commit/b961d9fd83 +test('Should disallow two-byte characters in URL path', t => { + t.plan(1) + + const connection = new Connection({ + url: new URL('http://localhost:9200') + }) + connection.request({ + path: '/thisisinvalid\uffe2', + method: 'GET' + }, (err, res) => { + t.strictEqual( + err.message, + 'ERR_UNESCAPED_CHARACTERS: /thisisinvalid\uffe2' + ) + }) +}) + +test('setRole', t => { + t.test('Update the value of a role', t => { + t.plan(2) + + const connection = new Connection({ + url: new URL('http://localhost:9200') + }) + + t.deepEqual(connection.roles, { + master: true, + data: true, + ingest: true, + ml: false + }) + + connection.setRole('master', false) + + t.deepEqual(connection.roles, { + master: false, + data: true, + ingest: true, + ml: false + }) + }) + + t.test('Invalid role', t => { + t.plan(2) + + const connection = new Connection({ + url: new URL('http://localhost:9200') + }) + + try { + connection.setRole('car', true) + t.fail('Shoud throw') + } catch (err) { + t.true(err instanceof ConfigurationError) + t.is(err.message, 'Unsupported role: \'car\'') + } + }) + + t.test('Invalid value', t => { + t.plan(2) + + const connection = new Connection({ + url: new URL('http://localhost:9200') + }) + + try { + connection.setRole('master', 1) + t.fail('Shoud throw') + } catch (err) { + t.true(err instanceof ConfigurationError) + t.is(err.message, 'enabled should be a boolean') + } + }) + + t.end() +}) + +test('Util.inspect Connection class should hide agent, ssl and auth', t => { + t.plan(1) + + const connection = new Connection({ + url: new URL('http://user:password@localhost:9200'), + id: 'node-id', + headers: { foo: 'bar' } + }) + + // Removes spaces and new lines because + // utils.inspect is handled differently + // between major versions of Node.js + function cleanStr (str) { + return str + .replace(/\s/g, '') + .replace(/(\r\n|\n|\r)/gm, '') + } + + t.strictEqual(cleanStr(inspect(connection)), cleanStr(`{ url: 'http://localhost:9200/', + id: 'node-id', + headers: { foo: 'bar' }, + deadCount: 0, + resurrectTimeout: 0, + _openRequests: 0, + status: 'alive', + roles: { master: true, data: true, ingest: true, ml: false }}`) + ) +}) + +test('connection.toJSON should hide agent, ssl and auth', t => { + t.plan(1) + + const connection = new Connection({ + url: new URL('http://user:password@localhost:9200'), + id: 'node-id', + headers: { foo: 'bar' } + }) + + t.deepEqual(connection.toJSON(), { + url: 'http://localhost:9200/', + id: 'node-id', + headers: { + foo: 'bar' + }, + deadCount: 0, + resurrectTimeout: 0, + _openRequests: 0, + status: 'alive', + roles: { + master: true, + data: true, + ingest: true, + ml: false + } + }) +}) + +// https://github.com/elastic/elasticsearch-js/issues/843 +test('Port handling', t => { + t.test('http 80', t => { + const connection = new Connection({ + url: new URL('http://localhost:80') + }) + + t.strictEqual( + connection.buildRequestObject({}).port, + undefined + ) + + t.end() + }) + + t.test('https 443', t => { + const connection = new Connection({ + url: new URL('https://localhost:443') + }) + + t.strictEqual( + connection.buildRequestObject({}).port, + undefined + ) + + t.end() + }) + + t.end() +}) + +test('Authorization header', t => { + t.test('None', t => { + const connection = new Connection({ + url: new URL('http://localhost:9200') + }) + + t.deepEqual(connection.headers, {}) + + t.end() + }) + + t.test('Basic', t => { + const connection = new Connection({ + url: new URL('http://localhost:9200'), + auth: { username: 'foo', password: 'bar' } + }) + + t.deepEqual(connection.headers, { authorization: 'Basic Zm9vOmJhcg==' }) + + t.end() + }) + + t.test('ApiKey (string)', t => { + const connection = new Connection({ + url: new URL('http://localhost:9200'), + auth: { apiKey: 'Zm9vOmJhcg==' } + }) + + t.deepEqual(connection.headers, { authorization: 'ApiKey Zm9vOmJhcg==' }) + + t.end() + }) + + t.test('ApiKey (object)', t => { + const connection = new Connection({ + url: new URL('http://localhost:9200'), + auth: { apiKey: { id: 'foo', api_key: 'bar' } } + }) + + t.deepEqual(connection.headers, { authorization: 'ApiKey Zm9vOmJhcg==' }) + + t.end() + }) + + t.end() +}) + +test('Should not add agent and ssl to the serialized connection', t => { + const connection = new Connection({ + url: new URL('http://localhost:9200') + }) + + t.strictEqual( + JSON.stringify(connection), + '{"url":"http://localhost:9200/","id":"http://localhost:9200/","headers":{},"deadCount":0,"resurrectTimeout":0,"_openRequests":0,"status":"alive","roles":{"master":true,"data":true,"ingest":true,"ml":false}}' + ) + + t.end() +}) + +test('Abort a request syncronously', t => { + t.plan(1) + + function handler (req, res) { + t.fail('The server should not be contacted') + } + + buildServer(handler, ({ port }, server) => { + const connection = new Connection({ + url: new URL(`http://localhost:${port}`) + }) + const request = connection.request({ + path: '/hello', + method: 'GET' + }, (err, res) => { + t.ok(err instanceof RequestAbortedError) + server.stop() + }) + request.abort() + }) +}) + +test('Abort a request asyncronously', t => { + t.plan(1) + + function handler (req, res) { + // might be called or not + res.end('ok') + } + + buildServer(handler, ({ port }, server) => { + const connection = new Connection({ + url: new URL(`http://localhost:${port}`) + }) + const request = connection.request({ + path: '/hello', + method: 'GET' + }, (err, res) => { + t.ok(err instanceof RequestAbortedError) + server.stop() + }) + setImmediate(() => request.abort()) + }) +}) + +test('Should correctly resolve request pathname', t => { + t.plan(1) + + const connection = new Connection({ + url: new URL('http://localhost:80/test') + }) + + t.strictEqual( + connection.buildRequestObject({ + path: 'hello' + }).pathname, + '/test/hello' + ) +}) + +test('Proxy agent (http)', t => { + t.plan(1) + + const connection = new Connection({ + url: new URL('http://localhost:9200'), + proxy: 'http://localhost:8080' + }) + + t.true(connection.agent instanceof hpagent.HttpProxyAgent) +}) + +test('Proxy agent (https)', t => { + t.plan(1) + + const connection = new Connection({ + url: new URL('https://localhost:9200'), + proxy: 'http://localhost:8080' + }) + + t.true(connection.agent instanceof hpagent.HttpsProxyAgent) +}) + +test('Abort with a slow body', t => { + t.plan(1) + + const connection = new Connection({ + url: new URL('https://localhost:9200'), + proxy: 'http://localhost:8080' + }) + + const slowBody = new Readable({ + read (size) { + setTimeout(() => { + this.push('{"size":1, "query":{"match_all":{}}}') + this.push(null) // EOF + }, 1000).unref() + } + }) + + const request = connection.request({ + method: 'GET', + path: '/', + body: slowBody + }, (err, response) => { + t.ok(err instanceof RequestAbortedError) + }) + + setImmediate(() => request.abort()) +}) diff --git a/test/unit/errors.test.js b/test/unit/errors.test.js new file mode 100644 index 0000000..1473043 --- /dev/null +++ b/test/unit/errors.test.js @@ -0,0 +1,105 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +'use strict' + +/* eslint no-prototype-builtins: 0 */ + +const { test } = require('tap') +const { errors } = require('../../index') + +test('ElasticsearchClientError', t => { + const err = new errors.ElasticsearchClientError() + t.true(err instanceof Error) + t.end() +}) + +test('TimeoutError', t => { + const err = new errors.TimeoutError() + t.true(err instanceof Error) + t.true(err instanceof errors.ElasticsearchClientError) + t.true(err.hasOwnProperty('meta')) + t.end() +}) + +test('ConnectionError', t => { + const err = new errors.ConnectionError() + t.true(err instanceof Error) + t.true(err instanceof errors.ElasticsearchClientError) + t.true(err.hasOwnProperty('meta')) + t.end() +}) + +test('NoLivingConnectionsError', t => { + const err = new errors.NoLivingConnectionsError() + t.true(err instanceof Error) + t.true(err instanceof errors.ElasticsearchClientError) + t.true(err.hasOwnProperty('meta')) + t.end() +}) + +test('SerializationError', t => { + const err = new errors.SerializationError() + t.true(err instanceof Error) + t.true(err instanceof errors.ElasticsearchClientError) + t.false(err.hasOwnProperty('meta')) + t.true(err.hasOwnProperty('data')) + t.end() +}) + +test('DeserializationError', t => { + const err = new errors.DeserializationError() + t.true(err instanceof Error) + t.true(err instanceof errors.ElasticsearchClientError) + t.false(err.hasOwnProperty('meta')) + t.true(err.hasOwnProperty('data')) + t.end() +}) + +test('ConfigurationError', t => { + const err = new errors.ConfigurationError() + t.true(err instanceof Error) + t.true(err instanceof errors.ElasticsearchClientError) + t.false(err.hasOwnProperty('meta')) + t.end() +}) + +test('ResponseError', t => { + const meta = { + body: 1, + statusCode: 1, + headers: 1 + } + const err = new errors.ResponseError(meta) + t.true(err instanceof Error) + t.true(err instanceof errors.ElasticsearchClientError) + t.true(err.hasOwnProperty('meta')) + t.ok(err.body) + t.ok(err.statusCode) + t.ok(err.headers) + t.end() +}) + +test('RequestAbortedError', t => { + const err = new errors.RequestAbortedError() + t.true(err instanceof Error) + t.true(err instanceof errors.ElasticsearchClientError) + t.true(err.hasOwnProperty('meta')) + t.end() +}) diff --git a/test/unit/events.test.js b/test/unit/events.test.js new file mode 100644 index 0000000..1c40f05 --- /dev/null +++ b/test/unit/events.test.js @@ -0,0 +1,258 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +'use strict' + +const { EventEmitter } = require('events') +const { test } = require('tap') +const { + Transport, + Serializer, + ConnectionPool, + events +} = require('../../index') +const { TimeoutError } = require('../../lib/errors') +const { + connection: { + MockConnection, + MockConnectionTimeout + } +} = require('../utils') + +function prepare (Connection = MockConnection) { + const ee = new EventEmitter() + const pool = new ConnectionPool({ Connection }) + pool.addConnection('http://localhost:9200') + const transport = new Transport({ + emit: ee.emit.bind(ee), + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false, + sniffEndpoint: '_nodes/_all/http', + sniffOnConnectionFault: false, + name: 'elasticsearch-js' + }) + return { transport, ee } +} + +test('Should emit a request event when a request is performed', t => { + t.plan(3) + + const { transport, ee } = prepare() + + ee.on(events.REQUEST, (err, request) => { + t.error(err) + t.match(request, { + body: null, + statusCode: null, + headers: null, + warnings: null, + meta: { + context: null, + name: 'elasticsearch-js', + request: { + params: { + method: 'GET', + path: '/test/_search', + body: '', + querystring: 'q=foo%3Abar' + }, + options: {}, + id: 1 + }, + connection: { + id: 'http://localhost:9200' + }, + attempts: 0, + aborted: false + } + }) + }) + + transport.request({ + method: 'GET', + path: '/test/_search', + querystring: { + q: 'foo:bar' + }, + body: '' + }, (err, result) => { + t.error(err) + }) +}) + +test('Should emit a request event once when a request is performed', t => { + t.plan(4) + + const { transport, ee } = prepare() + + ee.once(events.REQUEST, (err, request) => { + t.error(err) + t.match(request, { + body: null, + statusCode: null, + headers: null, + warnings: null, + meta: { + context: null, + name: 'elasticsearch-js', + request: { + params: { + method: 'GET', + path: '/test/_search', + body: '', + querystring: 'q=foo%3Abar' + }, + options: {}, + id: 1 + }, + connection: { + id: 'http://localhost:9200' + }, + attempts: 0, + aborted: false + } + }) + }) + + transport.request({ + method: 'GET', + path: '/test/_search', + querystring: { + q: 'foo:bar' + }, + body: '' + }, (err, result) => { + t.error(err) + }) + + transport.request({ + method: 'GET', + path: '/test/_search', + querystring: { + q: 'foo:bar' + }, + body: '' + }, (err, result) => { + t.error(err) + }) +}) + +test('Should emit a response event in case of a successful response', t => { + t.plan(3) + + const { transport, ee } = prepare() + + ee.on(events.RESPONSE, (err, request) => { + t.error(err) + t.match(request, { + body: { hello: 'world' }, + statusCode: 200, + headers: { + 'content-type': 'application/json;utf=8', + connection: 'keep-alive' + }, + warnings: null, + meta: { + context: null, + name: 'elasticsearch-js', + request: { + params: { + method: 'GET', + path: '/test/_search', + body: '', + querystring: 'q=foo%3Abar' + }, + options: {}, + id: 1 + }, + connection: { + id: 'http://localhost:9200' + }, + attempts: 0, + aborted: false + } + }) + }) + + transport.request({ + method: 'GET', + path: '/test/_search', + querystring: { + q: 'foo:bar' + }, + body: '' + }, (err, result) => { + t.error(err) + }) +}) + +test('Should emit a response event with the error set', t => { + t.plan(3) + + const { transport, ee } = prepare(MockConnectionTimeout) + + ee.on(events.RESPONSE, (err, request) => { + t.ok(err instanceof TimeoutError) + t.match(request, { + body: null, + statusCode: null, + headers: null, + warnings: null, + meta: { + context: null, + name: 'elasticsearch-js', + request: { + params: { + method: 'GET', + path: '/test/_search', + body: '', + querystring: 'q=foo%3Abar' + }, + options: { + requestTimeout: 500 + }, + id: 1 + }, + connection: { + id: 'http://localhost:9200' + }, + attempts: 0, + aborted: false + } + }) + }) + + transport.request({ + method: 'GET', + path: '/test/_search', + querystring: { + q: 'foo:bar' + }, + body: '' + }, { + maxRetries: 0, + requestTimeout: 500 + }, (err, result) => { + t.ok(err instanceof TimeoutError) + }) +}) diff --git a/test/unit/selectors.test.js b/test/unit/selectors.test.js new file mode 100644 index 0000000..8985f90 --- /dev/null +++ b/test/unit/selectors.test.js @@ -0,0 +1,42 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +'use strict' + +const { test } = require('tap') +const { roundRobinSelector, randomSelector } = require('../../lib/Transport').internals + +test('RoundRobinSelector', t => { + const selector = roundRobinSelector() + const arr = [0, 1, 2, 3, 4, 5] + + t.plan(arr.length + 1) + for (var i = 0; i <= arr.length; i++) { + t.strictEqual( + selector(arr), + i === arr.length ? arr[0] : arr[i] + ) + } +}) + +test('RandomSelector', t => { + t.plan(1) + const arr = [0, 1, 2, 3, 4, 5] + t.type(randomSelector(arr), 'number') +}) diff --git a/test/unit/serializer.test.js b/test/unit/serializer.test.js new file mode 100644 index 0000000..cce887e --- /dev/null +++ b/test/unit/serializer.test.js @@ -0,0 +1,159 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +'use strict' + +const { test } = require('tap') +const { stringify } = require('querystring') +const Serializer = require('../../lib/Serializer') +const { SerializationError, DeserializationError } = require('../../lib/errors') + +test('Basic', t => { + t.plan(2) + const s = new Serializer() + const obj = { hello: 'world' } + const json = JSON.stringify(obj) + t.strictEqual(s.serialize(obj), json) + t.deepEqual(s.deserialize(json), obj) +}) + +test('ndserialize', t => { + t.plan(1) + const s = new Serializer() + const obj = [ + { hello: 'world' }, + { winter: 'is coming' }, + { you_know: 'for search' } + ] + t.strictEqual( + s.ndserialize(obj), + JSON.stringify(obj[0]) + '\n' + + JSON.stringify(obj[1]) + '\n' + + JSON.stringify(obj[2]) + '\n' + ) +}) + +test('ndserialize (strings)', t => { + t.plan(1) + const s = new Serializer() + const obj = [ + JSON.stringify({ hello: 'world' }), + JSON.stringify({ winter: 'is coming' }), + JSON.stringify({ you_know: 'for search' }) + ] + t.strictEqual( + s.ndserialize(obj), + obj[0] + '\n' + + obj[1] + '\n' + + obj[2] + '\n' + ) +}) + +test('qserialize', t => { + t.plan(1) + const s = new Serializer() + const obj = { + hello: 'world', + you_know: 'for search' + } + + t.strictEqual( + s.qserialize(obj), + stringify(obj) + ) +}) + +test('qserialize (array)', t => { + t.plan(1) + const s = new Serializer() + const obj = { + hello: 'world', + arr: ['foo', 'bar'] + } + + t.strictEqual( + s.qserialize(obj), + 'hello=world&arr=foo%2Cbar' + ) +}) + +test('qserialize (string)', t => { + t.plan(1) + const s = new Serializer() + const obj = { + hello: 'world', + you_know: 'for search' + } + + t.strictEqual( + s.qserialize(stringify(obj)), + stringify(obj) + ) +}) + +test('qserialize (key with undefined value)', t => { + t.plan(1) + const s = new Serializer() + const obj = { + hello: 'world', + key: undefined, + foo: 'bar' + } + + t.strictEqual( + s.qserialize(obj), + 'hello=world&foo=bar' + ) +}) + +test('SerializationError', t => { + t.plan(1) + const s = new Serializer() + const obj = { hello: 'world' } + obj.o = obj + try { + s.serialize(obj) + t.fail('Should fail') + } catch (err) { + t.ok(err instanceof SerializationError) + } +}) + +test('SerializationError ndserialize', t => { + t.plan(1) + const s = new Serializer() + try { + s.ndserialize({ hello: 'world' }) + t.fail('Should fail') + } catch (err) { + t.ok(err instanceof SerializationError) + } +}) + +test('DeserializationError', t => { + t.plan(1) + const s = new Serializer() + const json = '{"hello' + try { + s.deserialize(json) + t.fail('Should fail') + } catch (err) { + t.ok(err instanceof DeserializationError) + } +}) diff --git a/test/unit/transport.test.js b/test/unit/transport.test.js new file mode 100644 index 0000000..1026ba0 --- /dev/null +++ b/test/unit/transport.test.js @@ -0,0 +1,2621 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +'use strict' + +const { test } = require('tap') +const { URL } = require('url') +const FakeTimers = require('@sinonjs/fake-timers') +const { createGunzip, gzipSync } = require('zlib') +const os = require('os') +const intoStream = require('into-stream') +const { + buildServer, + connection: { MockConnection, MockConnectionTimeout, MockConnectionError } +} = require('../utils') +const { + NoLivingConnectionsError, + SerializationError, + DeserializationError, + TimeoutError, + ResponseError, + ConnectionError, + ConfigurationError, + RequestAbortedError +} = require('../../lib/errors') + +const ConnectionPool = require('../../lib/pool/ConnectionPool') +const Connection = require('../../lib/Connection') +const Serializer = require('../../lib/Serializer') +const Transport = require('../../lib/Transport') + +test('Basic', t => { + t.plan(2) + function handler (req, res) { + res.setHeader('Content-Type', 'application/json;utf=8') + res.end(JSON.stringify({ hello: 'world' })) + } + + buildServer(handler, ({ port }, server) => { + const pool = new ConnectionPool({ Connection }) + pool.addConnection(`http://localhost:${port}`) + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false + }) + + transport.request({ + method: 'GET', + path: '/hello' + }, (err, { body }) => { + t.error(err) + t.deepEqual(body, { hello: 'world' }) + server.stop() + }) + }) +}) + +test('Basic (promises support)', t => { + t.plan(1) + + const pool = new ConnectionPool({ Connection: MockConnection }) + pool.addConnection('http://localhost:9200') + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false + }) + + transport + .request({ + method: 'GET', + path: '/hello' + }) + .then(({ body }) => { + t.deepEqual(body, { hello: 'world' }) + }) + .catch(t.fail) +}) + +test('Basic - failing (promises support)', t => { + t.plan(1) + + const pool = new ConnectionPool({ Connection: MockConnectionTimeout }) + pool.addConnection('http://localhost:9200') + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false + }) + + transport + .request({ + method: 'GET', + path: '/hello' + }) + .catch(err => { + t.ok(err instanceof TimeoutError) + }) +}) + +test('Basic (options + promises support)', t => { + t.plan(1) + + const pool = new ConnectionPool({ Connection: MockConnection }) + pool.addConnection('http://localhost:9200') + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false + }) + + transport + .request({ + method: 'GET', + path: '/hello' + }, { + requestTimeout: 1000 + }) + .then(({ body }) => { + t.deepEqual(body, { hello: 'world' }) + }) + .catch(t.fail) +}) + +test('Send POST', t => { + t.plan(4) + function handler (req, res) { + t.match(req.headers, { + 'content-type': 'application/json', + 'content-length': '17' + }) + var json = '' + req.setEncoding('utf8') + req.on('data', chunk => { json += chunk }) + req.on('error', err => t.fail(err)) + req.on('end', () => { + t.deepEqual(JSON.parse(json), { hello: 'world' }) + res.setHeader('Content-Type', 'application/json;utf=8') + res.end(JSON.stringify({ hello: 'world' })) + }) + } + + buildServer(handler, ({ port }, server) => { + const pool = new ConnectionPool({ Connection }) + pool.addConnection(`http://localhost:${port}`) + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false + }) + + transport.request({ + method: 'POST', + path: '/hello', + body: { hello: 'world' } + }, (err, { body }) => { + t.error(err) + t.deepEqual(body, { hello: 'world' }) + server.stop() + }) + }) +}) + +test('Send POST (ndjson)', t => { + t.plan(4) + + const bulkBody = [ + { hello: 'world' }, + { winter: 'is coming' }, + { you_know: 'for search' } + ] + + function handler (req, res) { + t.match(req.headers, { + 'content-type': 'application/x-ndjson', + 'content-length': '67' + }) + var json = '' + req.setEncoding('utf8') + req.on('data', chunk => { json += chunk }) + req.on('error', err => t.fail(err)) + req.on('end', () => { + t.strictEqual( + json, + JSON.stringify(bulkBody[0]) + '\n' + + JSON.stringify(bulkBody[1]) + '\n' + + JSON.stringify(bulkBody[2]) + '\n' + ) + res.setHeader('Content-Type', 'application/json;utf=8') + res.end(JSON.stringify({ hello: 'world' })) + }) + } + + buildServer(handler, ({ port }, server) => { + const pool = new ConnectionPool({ Connection }) + pool.addConnection(`http://localhost:${port}`) + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false + }) + + transport.request({ + method: 'POST', + path: '/hello', + bulkBody + }, (err, { body }) => { + t.error(err) + t.deepEqual(body, { hello: 'world' }) + server.stop() + }) + }) +}) + +test('Send stream', t => { + t.plan(4) + function handler (req, res) { + t.match(req.headers, { + 'content-type': 'application/json' + }) + var json = '' + req.setEncoding('utf8') + req.on('data', chunk => { json += chunk }) + req.on('error', err => t.fail(err)) + req.on('end', () => { + t.deepEqual(JSON.parse(json), { hello: 'world' }) + res.setHeader('Content-Type', 'application/json;utf=8') + res.end(JSON.stringify({ hello: 'world' })) + }) + } + + buildServer(handler, ({ port }, server) => { + const pool = new ConnectionPool({ Connection }) + pool.addConnection(`http://localhost:${port}`) + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false + }) + + transport.request({ + method: 'POST', + path: '/hello', + body: intoStream(JSON.stringify({ hello: 'world' })) + }, (err, { body }) => { + t.error(err) + t.deepEqual(body, { hello: 'world' }) + server.stop() + }) + }) +}) + +test('Send stream (bulkBody)', t => { + t.plan(4) + function handler (req, res) { + t.match(req.headers, { + 'content-type': 'application/x-ndjson' + }) + var json = '' + req.setEncoding('utf8') + req.on('data', chunk => { json += chunk }) + req.on('error', err => t.fail(err)) + req.on('end', () => { + t.deepEqual(JSON.parse(json), { hello: 'world' }) + res.setHeader('Content-Type', 'application/json;utf=8') + res.end(JSON.stringify({ hello: 'world' })) + }) + } + + buildServer(handler, ({ port }, server) => { + const pool = new ConnectionPool({ Connection }) + pool.addConnection(`http://localhost:${port}`) + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false + }) + + transport.request({ + method: 'POST', + path: '/hello', + bulkBody: intoStream(JSON.stringify({ hello: 'world' })) + }, (err, { body }) => { + t.error(err) + t.deepEqual(body, { hello: 'world' }) + server.stop() + }) + }) +}) + +test('Not JSON payload from server', t => { + t.plan(2) + function handler (req, res) { + res.setHeader('Content-Type', 'text/plain') + res.end('hello!') + } + + buildServer(handler, ({ port }, server) => { + const pool = new ConnectionPool({ Connection }) + pool.addConnection(`http://localhost:${port}`) + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false + }) + + transport.request({ + method: 'GET', + path: '/hello' + }, (err, { body }) => { + t.error(err) + t.strictEqual(body, 'hello!') + server.stop() + }) + }) +}) + +test('NoLivingConnectionsError (null connection)', t => { + t.plan(3) + const pool = new ConnectionPool({ Connection }) + pool.addConnection('http://localhost:9200') + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false, + nodeSelector (connections) { + t.is(connections.length, 1) + t.true(connections[0] instanceof Connection) + return null + } + }) + + transport.request({ + method: 'GET', + path: '/hello' + }, (err, { body }) => { + t.ok(err instanceof NoLivingConnectionsError) + }) +}) + +test('NoLivingConnectionsError (undefined connection)', t => { + t.plan(3) + const pool = new ConnectionPool({ Connection }) + pool.addConnection('http://localhost:9200') + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false, + nodeSelector (connections) { + t.is(connections.length, 1) + t.true(connections[0] instanceof Connection) + return undefined + } + }) + + transport.request({ + method: 'GET', + path: '/hello' + }, (err, { body }) => { + t.ok(err instanceof NoLivingConnectionsError) + }) +}) + +test('SerializationError', t => { + t.plan(1) + const pool = new ConnectionPool({ Connection }) + pool.addConnection('http://localhost:9200') + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false + }) + + const body = { hello: 'world' } + body.o = body + transport.request({ + method: 'POST', + path: '/hello', + body + }, (err, { body }) => { + t.ok(err instanceof SerializationError) + }) +}) + +test('SerializationError (bulk)', t => { + t.plan(1) + const pool = new ConnectionPool({ Connection }) + pool.addConnection('http://localhost:9200') + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false + }) + + const bulkBody = { hello: 'world' } + bulkBody.o = bulkBody + transport.request({ + method: 'POST', + path: '/hello', + bulkBody + }, (err, { body }) => { + t.ok(err instanceof SerializationError) + }) +}) + +test('DeserializationError', t => { + t.plan(1) + function handler (req, res) { + res.setHeader('Content-Type', 'application/json;utf=8') + res.end('{"hello)') + } + + buildServer(handler, ({ port }, server) => { + const pool = new ConnectionPool({ Connection }) + pool.addConnection(`http://localhost:${port}`) + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false + }) + + transport.request({ + method: 'GET', + path: '/hello' + }, (err, { body }) => { + t.ok(err instanceof DeserializationError) + server.stop() + }) + }) +}) + +test('TimeoutError (should call markDead on the failing connection)', t => { + t.plan(2) + + class CustomConnectionPool extends ConnectionPool { + markDead (connection) { + t.strictEqual(connection.id, 'node1') + super.markDead(connection) + } + } + + const pool = new CustomConnectionPool({ Connection: MockConnectionTimeout }) + pool.addConnection({ + url: new URL('http://localhost:9200'), + id: 'node1' + }) + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 0, + requestTimeout: 500, + sniffInterval: false, + sniffOnStart: false + }) + + transport.request({ + method: 'GET', + path: '/hello' + }, (err, { body }) => { + t.ok(err instanceof TimeoutError) + }) +}) + +test('ConnectionError (should call markDead on the failing connection)', t => { + t.plan(2) + + class CustomConnectionPool extends ConnectionPool { + markDead (connection) { + t.strictEqual(connection.id, 'node1') + super.markDead(connection) + } + } + + const pool = new CustomConnectionPool({ Connection: MockConnectionError }) + pool.addConnection({ + url: new URL('http://localhost:9200'), + id: 'node1' + }) + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 0, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false + }) + + transport.request({ + method: 'GET', + path: '/hello' + }, (err, { body }) => { + t.ok(err instanceof ConnectionError) + }) +}) + +test('Retry mechanism', t => { + t.plan(2) + + var count = 0 + function handler (req, res) { + res.setHeader('Content-Type', 'application/json;utf=8') + if (count > 0) { + res.end(JSON.stringify({ hello: 'world' })) + } else { + res.statusCode = 504 + res.end(JSON.stringify({ error: true })) + } + count++ + } + + buildServer(handler, ({ port }, server) => { + const pool = new ConnectionPool({ Connection }) + pool.addConnection([{ + url: new URL(`http://localhost:${port}`), + id: 'node1' + }, { + url: new URL(`http://localhost:${port}`), + id: 'node2' + }, { + url: new URL(`http://localhost:${port}`), + id: 'node3' + }]) + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 1, + sniffInterval: false, + sniffOnStart: false + }) + + transport.request({ + method: 'GET', + path: '/hello' + }, (err, { body }) => { + t.error(err) + t.deepEqual(body, { hello: 'world' }) + server.stop() + }) + }) +}) + +test('Should not retry if the body is a stream', t => { + t.plan(2) + + var count = 0 + function handler (req, res) { + count++ + res.setHeader('Content-Type', 'application/json;utf=8') + res.statusCode = 504 + res.end(JSON.stringify({ error: true })) + } + + buildServer(handler, ({ port }, server) => { + const pool = new ConnectionPool({ Connection }) + pool.addConnection([{ + url: new URL(`http://localhost:${port}`), + id: 'node1' + }, { + url: new URL(`http://localhost:${port}`), + id: 'node2' + }, { + url: new URL(`http://localhost:${port}`), + id: 'node3' + }]) + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 1, + sniffInterval: false, + sniffOnStart: false + }) + + transport.request({ + method: 'POST', + path: '/hello', + body: intoStream(JSON.stringify({ hello: 'world' })) + }, (err, { body }) => { + t.ok(err instanceof ResponseError) + t.strictEqual(count, 1) + server.stop() + }) + }) +}) + +test('Should not retry if the bulkBody is a stream', t => { + t.plan(2) + + var count = 0 + function handler (req, res) { + count++ + res.setHeader('Content-Type', 'application/json;utf=8') + res.statusCode = 504 + res.end(JSON.stringify({ error: true })) + } + + buildServer(handler, ({ port }, server) => { + const pool = new ConnectionPool({ Connection }) + pool.addConnection([{ + url: new URL(`http://localhost:${port}`), + id: 'node1' + }, { + url: new URL(`http://localhost:${port}`), + id: 'node2' + }, { + url: new URL(`http://localhost:${port}`), + id: 'node3' + }]) + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 1, + sniffInterval: false, + sniffOnStart: false + }) + + transport.request({ + method: 'POST', + path: '/hello', + bulkBody: intoStream(JSON.stringify([{ hello: 'world' }])) + }, (err, { body }) => { + t.ok(err instanceof ResponseError) + t.strictEqual(count, 1) + server.stop() + }) + }) +}) + +test('No retry', t => { + t.plan(2) + + var count = 0 + function handler (req, res) { + count++ + res.setHeader('Content-Type', 'application/json;utf=8') + res.statusCode = 504 + res.end(JSON.stringify({ error: true })) + } + + buildServer(handler, ({ port }, server) => { + const pool = new ConnectionPool({ Connection }) + pool.addConnection([{ + url: new URL(`http://localhost:${port}`), + id: 'node1' + }, { + url: new URL(`http://localhost:${port}`), + id: 'node2' + }, { + url: new URL(`http://localhost:${port}`), + id: 'node3' + }]) + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + sniffInterval: false, + sniffOnStart: false + }) + + transport.request({ + method: 'POST', + path: '/hello', + body: intoStream(JSON.stringify({ hello: 'world' })) + }, { + maxRetries: 0 + }, (err, { body }) => { + t.ok(err instanceof ResponseError) + t.strictEqual(count, 1) + server.stop() + }) + }) +}) + +test('Custom retry mechanism', t => { + t.plan(2) + + var count = 0 + function handler (req, res) { + res.setHeader('Content-Type', 'application/json;utf=8') + if (count > 0) { + res.end(JSON.stringify({ hello: 'world' })) + } else { + res.statusCode = 504 + res.end(JSON.stringify({ error: true })) + } + count++ + } + + buildServer(handler, ({ port }, server) => { + const pool = new ConnectionPool({ Connection }) + pool.addConnection([{ + url: new URL(`http://localhost:${port}`), + id: 'node1' + }, { + url: new URL(`http://localhost:${port}`), + id: 'node2' + }, { + url: new URL(`http://localhost:${port}`), + id: 'node3' + }]) + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 0, + sniffInterval: false, + sniffOnStart: false + }) + + transport.request({ + method: 'GET', + path: '/hello' + }, { + maxRetries: 1 + }, (err, { body }) => { + t.error(err) + t.deepEqual(body, { hello: 'world' }) + server.stop() + }) + }) +}) + +test('Should not retry on 429', t => { + t.plan(3) + + var count = 0 + function handler (req, res) { + t.strictEqual(count++, 0) + res.statusCode = 429 + res.setHeader('Content-Type', 'application/json;utf=8') + res.end(JSON.stringify({ hello: 'world' })) + } + + buildServer(handler, ({ port }, server) => { + const pool = new ConnectionPool({ Connection }) + pool.addConnection([{ + url: new URL(`http://localhost:${port}`), + id: 'node1' + }, { + url: new URL(`http://localhost:${port}`), + id: 'node2' + }, { + url: new URL(`http://localhost:${port}`), + id: 'node3' + }]) + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 5, + requestTimeout: 250, + sniffInterval: false, + sniffOnStart: false + }) + + transport.request({ + method: 'GET', + path: '/hello' + }, (err, result) => { + t.ok(err) + t.strictEqual(err.statusCode, 429) + server.stop() + }) + }) +}) + +test('Should call markAlive with a successful response', t => { + t.plan(3) + + class CustomConnectionPool extends ConnectionPool { + markAlive (connection) { + t.strictEqual(connection.id, 'node1') + super.markAlive(connection) + } + } + + const pool = new CustomConnectionPool({ Connection: MockConnection }) + pool.addConnection({ + url: new URL('http://localhost:9200'), + id: 'node1' + }) + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false + }) + + transport.request({ + method: 'GET', + path: '/hello' + }, (err, { body }) => { + t.error(err) + t.deepEqual(body, { hello: 'world' }) + }) +}) + +test('Should call resurrect on every request', t => { + t.plan(5) + + class CustomConnectionPool extends ConnectionPool { + resurrect ({ now, requestId, name }) { + t.type(now, 'number') + t.type(requestId, 'number') + t.type(name, 'string') + } + } + + const pool = new CustomConnectionPool({ Connection: MockConnection }) + pool.addConnection({ + url: new URL('http://localhost:9200'), + id: 'node1' + }) + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false, + name: 'elasticsearch-js' + }) + + transport.request({ + method: 'GET', + path: '/hello' + }, (err, { body }) => { + t.error(err) + t.deepEqual(body, { hello: 'world' }) + }) +}) + +test('Should return a request aborter utility', t => { + t.plan(1) + + const pool = new ConnectionPool({ Connection: MockConnection }) + pool.addConnection({ + url: new URL('http://localhost:9200'), + id: 'node1' + }) + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false + }) + + const request = transport.request({ + method: 'GET', + path: '/hello' + }, (err, result) => { + t.ok(err instanceof RequestAbortedError) + }) + + request.abort() +}) + +test('Retry mechanism and abort', t => { + t.plan(1) + + function handler (req, res) { + setTimeout(() => { + res.setHeader('Content-Type', 'application/json;utf=8') + res.end(JSON.stringify({ hello: 'world' })) + }, 1000) + } + + buildServer(handler, ({ port }, server) => { + const pool = new ConnectionPool({ Connection }) + pool.addConnection([{ + url: new URL(`http://localhost:${port}`), + id: 'node1' + }, { + url: new URL(`http://localhost:${port}`), + id: 'node2' + }, { + url: new URL(`http://localhost:${port}`), + id: 'node3' + }]) + + var count = 0 + const transport = new Transport({ + emit: event => { + if (event === 'request' && count++ > 0) { + request.abort() + } + }, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 2, + requestTimeout: 100, + sniffInterval: false, + sniffOnStart: false + }) + + const request = transport.request({ + method: 'GET', + path: '/hello' + }, (err, result) => { + t.ok(err instanceof RequestAbortedError) + server.stop() + }) + }) +}) + +test('Abort a request with the promise API', t => { + t.plan(1) + + const pool = new ConnectionPool({ Connection: MockConnection }) + pool.addConnection({ + url: new URL('http://localhost:9200'), + id: 'node1' + }) + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false + }) + + const request = transport.request({ + method: 'GET', + path: '/hello' + }) + + request + .then(() => { + t.fail('Should not be called') + }) + .catch(err => { + t.ok(err instanceof RequestAbortedError) + }) + + request.abort() +}) + +test('ResponseError', t => { + t.plan(3) + + function handler (req, res) { + res.statusCode = 500 + res.setHeader('Content-Type', 'application/json;utf=8') + res.end(JSON.stringify({ status: 500 })) + } + + buildServer(handler, ({ port }, server) => { + const pool = new ConnectionPool({ Connection }) + pool.addConnection(`http://localhost:${port}`) + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false + }) + + transport.request({ + method: 'GET', + path: '/hello' + }, (err, { body }) => { + t.ok(err instanceof ResponseError) + t.deepEqual(err.body, { status: 500 }) + t.strictEqual(err.statusCode, 500) + server.stop() + }) + }) +}) + +test('Override requestTimeout', t => { + t.plan(2) + function handler (req, res) { + setTimeout(() => { + res.setHeader('Content-Type', 'application/json;utf=8') + res.end(JSON.stringify({ hello: 'world' })) + }, 1000) + } + + buildServer(handler, ({ port }, server) => { + const pool = new ConnectionPool({ Connection }) + pool.addConnection(`http://localhost:${port}`) + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 500, + sniffInterval: false, + sniffOnStart: false + }) + + transport.request({ + method: 'GET', + path: '/hello' + }, { + requestTimeout: 2000 + }, (err, { body }) => { + t.error(err) + t.deepEqual(body, { hello: 'world' }) + server.stop() + }) + }) +}) + +test('sniff', t => { + t.test('sniffOnStart', t => { + t.plan(1) + + class MyTransport extends Transport { + sniff (opts) { + t.strictEqual(opts.reason, Transport.sniffReasons.SNIFF_ON_START) + } + } + + const pool = new ConnectionPool({ Connection }) + pool.addConnection('http://localhost:9200') + + // eslint-disable-next-line + new MyTransport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: true, + sniffEndpoint: '/sniff' + }) + }) + + t.test('sniffOnConnectionFault', t => { + t.plan(2) + + class MyTransport extends Transport { + sniff (opts) { + t.strictEqual(opts.reason, Transport.sniffReasons.SNIFF_ON_CONNECTION_FAULT) + } + } + + const pool = new ConnectionPool({ Connection: MockConnectionTimeout }) + pool.addConnection('http://localhost:9200') + + const transport = new MyTransport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 0, + requestTimeout: 500, + sniffInterval: false, + sniffOnConnectionFault: true, + sniffEndpoint: '/sniff' + }) + + transport.request({ + method: 'GET', + path: '/' + }, (err, { body }) => { + t.ok(err instanceof TimeoutError) + }) + }) + + t.test('sniffInterval', t => { + t.plan(6) + + const clock = FakeTimers.install({ toFake: ['Date'] }) + t.teardown(() => clock.uninstall()) + + class MyTransport extends Transport { + sniff (opts) { + t.strictEqual(opts.reason, Transport.sniffReasons.SNIFF_INTERVAL) + } + } + + const pool = new ConnectionPool({ Connection: MockConnection }) + pool.addConnection('http://localhost:9200') + + const transport = new MyTransport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 3000, + sniffInterval: 1, + sniffEndpoint: '/sniff' + }) + + const params = { method: 'GET', path: '/' } + clock.tick(100) + transport.request(params, t.error) + + clock.tick(200) + transport.request(params, t.error) + + clock.tick(300) + transport.request(params, t.error) + }) + + t.test('errored', t => { + t.plan(1) + + class CustomConnectionPool extends ConnectionPool { + nodesToHost () { + t.fail('This should not be called') + } + } + + const pool = new CustomConnectionPool({ Connection: MockConnectionError }) + pool.addConnection('http://localhost:9200') + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 0, + requestTimeout: 30000, + sniffInterval: false, + sniffEndpoint: '/sniff' + }) + + transport.sniff((err, hosts) => { + t.ok(err instanceof ConnectionError) + }) + }) + + t.end() +}) + +test(`Should mark as dead connections where the statusCode is 502/3/4 + and return a ResponseError if there are no more attempts`, t => { + ;[502, 503, 504].forEach(runTest) + + function runTest (statusCode) { + t.test(statusCode, t => { + t.plan(3) + + class CustomConnectionPool extends ConnectionPool { + markDead (connection) { + t.ok('called') + super.markDead(connection) + } + } + + const pool = new CustomConnectionPool({ Connection: MockConnection }) + pool.addConnection('http://localhost:9200') + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 0, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false + }) + + transport.request({ + method: 'GET', + path: `/${statusCode}` + }, (err, { body }) => { + t.ok(err instanceof ResponseError) + t.match(err, { + body: { hello: 'world' }, + headers: { 'content-type': 'application/json;utf=8' }, + statusCode: statusCode + }) + }) + }) + } + + t.end() +}) + +test('Should retry the request if the statusCode is 502/3/4', t => { + ;[502, 503, 504].forEach(runTest) + + function runTest (statusCode) { + t.test(statusCode, t => { + t.plan(3) + + var first = true + function handler (req, res) { + if (first) { + first = false + res.statusCode = statusCode + } + res.setHeader('Content-Type', 'application/json;utf=8') + res.end(JSON.stringify({ hello: 'world' })) + } + + class CustomConnectionPool extends ConnectionPool { + markDead (connection) { + t.ok('called') + } + } + + buildServer(handler, ({ port }, server) => { + const pool = new CustomConnectionPool({ Connection }) + pool.addConnection(`http://localhost:${port}`) + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 1, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false + }) + + transport.request({ + method: 'GET', + path: '/hello' + }, (err, { body }) => { + t.error(err) + t.deepEqual(body, { hello: 'world' }) + server.stop() + }) + }) + }) + } + + t.end() +}) + +test('Ignore status code', t => { + t.plan(4) + + const pool = new ConnectionPool({ Connection: MockConnection }) + pool.addConnection('http://localhost:9200') + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false + }) + + transport.request({ + method: 'GET', + path: '/404' + }, { + ignore: [404] + }, (err, { body }) => { + t.error(err) + t.deepEqual(body, { hello: 'world' }) + }) + + transport.request({ + method: 'GET', + path: '/404' + }, (err, { body }) => { + t.ok(err instanceof ResponseError) + }) + + transport.request({ + method: 'GET', + path: '/404' + }, { + ignore: [403, 405] + }, (err, { body }) => { + t.ok(err instanceof ResponseError) + }) +}) + +test('Should serialize the querystring', t => { + t.plan(2) + + function handler (req, res) { + t.strictEqual(req.url, '/hello?hello=world&you_know=for%20search') + res.end('ok') + } + + buildServer(handler, ({ port }, server) => { + const pool = new ConnectionPool({ Connection }) + pool.addConnection(`http://localhost:${port}`) + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false + }) + + transport.request({ + method: 'GET', + path: '/hello', + querystring: { + hello: 'world', + you_know: 'for search' + } + }, (err, { body }) => { + t.error(err) + server.stop() + }) + }) +}) + +test('timeout option', t => { + function handler (req, res) { + setTimeout(() => { + res.setHeader('Content-Type', 'application/json;utf=8') + res.end(JSON.stringify({ hello: 'world' })) + }, 1000) + } + + t.test('as number', t => { + t.test('global', t => { + t.plan(1) + + buildServer(handler, ({ port }, server) => { + const pool = new ConnectionPool({ Connection }) + pool.addConnection({ + url: new URL(`http://localhost:${port}`), + id: 'node1' + }) + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 0, + requestTimeout: 500, + sniffInterval: false, + sniffOnStart: false + }) + + transport.request({ + method: 'GET', + path: '/hello' + }, (err, { body }) => { + t.ok(err instanceof TimeoutError) + server.stop() + }) + }) + }) + + t.test('custom', t => { + t.plan(1) + + buildServer(handler, ({ port }, server) => { + const pool = new ConnectionPool({ Connection }) + pool.addConnection({ + url: new URL(`http://localhost:${port}`), + id: 'node1' + }) + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 0, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false + }) + + transport.request({ + method: 'GET', + path: '/hello' + }, { + requestTimeout: 500 + }, (err, { body }) => { + t.ok(err instanceof TimeoutError) + server.stop() + }) + }) + }) + + t.end() + }) + + t.test('as string', t => { + t.test('global', t => { + t.plan(1) + + buildServer(handler, ({ port }, server) => { + const pool = new ConnectionPool({ Connection }) + pool.addConnection({ + url: new URL(`http://localhost:${port}`), + id: 'node1' + }) + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 0, + requestTimeout: '0.5s', + sniffInterval: false, + sniffOnStart: false + }) + + transport.request({ + method: 'GET', + path: '/hello' + }, (err, { body }) => { + t.ok(err instanceof TimeoutError) + server.stop() + }) + }) + }) + + t.test('custom', t => { + t.plan(1) + + buildServer(handler, ({ port }, server) => { + const pool = new ConnectionPool({ Connection }) + pool.addConnection({ + url: new URL(`http://localhost:${port}`), + id: 'node1' + }) + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 0, + requestTimeout: '30s', + sniffInterval: false, + sniffOnStart: false + }) + + transport.request({ + method: 'GET', + path: '/hello' + }, { + requestTimeout: '0.5s' + }, (err, { body }) => { + t.ok(err instanceof TimeoutError) + server.stop() + }) + }) + }) + + t.end() + }) + + t.end() +}) + +test('Should cast to boolean HEAD request', t => { + t.test('2xx response', t => { + t.plan(3) + const pool = new ConnectionPool({ Connection: MockConnection }) + pool.addConnection('http://localhost:9200') + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false + }) + + transport.request({ + method: 'HEAD', + path: '/200' + }, (err, { body, statusCode }) => { + t.error(err) + t.strictEqual(statusCode, 200) + t.strictEqual(body, true) + }) + }) + + t.test('404 response', t => { + t.plan(3) + const pool = new ConnectionPool({ Connection: MockConnection }) + pool.addConnection('http://localhost:9200') + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false + }) + + transport.request({ + method: 'HEAD', + path: '/404' + }, (err, { body, statusCode }) => { + t.error(err) + t.strictEqual(statusCode, 404) + t.strictEqual(body, false) + }) + }) + + t.test('4xx response', t => { + t.plan(2) + + const pool = new ConnectionPool({ Connection: MockConnection }) + pool.addConnection('http://localhost:9200') + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false + }) + + transport.request({ + method: 'HEAD', + path: '/400' + }, (err, { body, statusCode }) => { + t.ok(err instanceof ResponseError) + t.strictEqual(statusCode, 400) + }) + }) + + t.test('5xx response', t => { + t.plan(2) + const pool = new ConnectionPool({ Connection: MockConnection }) + pool.addConnection('http://localhost:9200') + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false + }) + + transport.request({ + method: 'HEAD', + path: '/500' + }, (err, { body, statusCode }) => { + t.ok(err instanceof ResponseError) + t.strictEqual(statusCode, 500) + }) + }) + + t.end() +}) + +test('Suggest compression', t => { + t.plan(3) + function handler (req, res) { + t.match(req.headers, { + 'accept-encoding': 'gzip,deflate' + }) + + const body = gzipSync(JSON.stringify({ hello: 'world' })) + res.setHeader('Content-Type', 'application/json;utf=8') + res.setHeader('Content-Encoding', 'gzip') + res.setHeader('Content-Length', Buffer.byteLength(body)) + res.end(body) + } + + buildServer(handler, ({ port }, server) => { + const pool = new ConnectionPool({ Connection }) + pool.addConnection(`http://localhost:${port}`) + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false, + suggestCompression: true + }) + + transport.request({ + method: 'GET', + path: '/hello' + }, (err, { body }) => { + t.error(err) + t.deepEqual(body, { hello: 'world' }) + server.stop() + }) + }) +}) + +test('Broken compression', t => { + t.plan(2) + function handler (req, res) { + t.match(req.headers, { + 'accept-encoding': 'gzip,deflate' + }) + + const body = gzipSync(JSON.stringify({ hello: 'world' })) + res.setHeader('Content-Type', 'application/json;utf=8') + res.setHeader('Content-Encoding', 'gzip') + // we are not setting the content length on purpose + res.end(body.slice(0, -5)) + } + + buildServer(handler, ({ port }, server) => { + const pool = new ConnectionPool({ Connection }) + pool.addConnection(`http://localhost:${port}`) + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false, + suggestCompression: true + }) + + transport.request({ + method: 'GET', + path: '/hello' + }, (err, { body }) => { + t.ok(err) + server.stop() + }) + }) +}) + +test('Warning header', t => { + t.test('Single warning', t => { + t.plan(3) + + const warn = '112 - "cache down" "Wed, 21 Oct 2015 07:28:00 GMT"' + function handler (req, res) { + res.setHeader('Content-Type', 'application/json;utf=8') + res.setHeader('Warning', warn) + res.end(JSON.stringify({ hello: 'world' })) + } + + buildServer(handler, ({ port }, server) => { + const pool = new ConnectionPool({ Connection }) + pool.addConnection(`http://localhost:${port}`) + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false + }) + + transport.request({ + method: 'GET', + path: '/hello' + }, (err, { warnings }) => { + t.error(err) + t.deepEqual(warnings, [warn]) + warnings.forEach(w => t.type(w, 'string')) + server.stop() + }) + }) + }) + + t.test('Multiple warnings', t => { + t.plan(4) + + const warn1 = '112 - "cache down" "Wed, 21 Oct 2015 07:28:00 GMT"' + const warn2 = '199 agent "Error message" "2015-01-01"' + function handler (req, res) { + res.setHeader('Content-Type', 'application/json;utf=8') + res.setHeader('Warning', warn1 + ',' + warn2) + res.end(JSON.stringify({ hello: 'world' })) + } + + buildServer(handler, ({ port }, server) => { + const pool = new ConnectionPool({ Connection }) + pool.addConnection(`http://localhost:${port}`) + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false + }) + + transport.request({ + method: 'GET', + path: '/hello' + }, (err, { warnings }) => { + t.error(err) + t.deepEqual(warnings, [warn1, warn2]) + warnings.forEach(w => t.type(w, 'string')) + server.stop() + }) + }) + }) + + t.test('No warnings', t => { + t.plan(2) + + function handler (req, res) { + res.setHeader('Content-Type', 'application/json;utf=8') + res.end(JSON.stringify({ hello: 'world' })) + } + + buildServer(handler, ({ port }, server) => { + const pool = new ConnectionPool({ Connection }) + pool.addConnection(`http://localhost:${port}`) + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false + }) + + transport.request({ + method: 'GET', + path: '/hello' + }, (err, { warnings }) => { + t.error(err) + t.strictEqual(warnings, null) + server.stop() + }) + }) + }) + + t.end() +}) + +test('asStream set to true', t => { + t.plan(3) + function handler (req, res) { + res.setHeader('Content-Type', 'application/json;utf=8') + res.end(JSON.stringify({ hello: 'world' })) + } + + buildServer(handler, ({ port }, server) => { + const pool = new ConnectionPool({ Connection }) + pool.addConnection(`http://localhost:${port}`) + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false + }) + + transport.request({ + method: 'GET', + path: '/hello' + }, { + asStream: true + }, (err, { body, headers }) => { + t.error(err) + t.match(headers, { + connection: 'keep-alive', + 'content-type': 'application/json;utf=8' + }) + + var payload = '' + body.setEncoding('utf8') + body.on('data', chunk => { payload += chunk }) + body.on('error', err => t.fail(err)) + body.on('end', () => { + t.deepEqual(JSON.parse(payload), { hello: 'world' }) + server.stop() + }) + }) + }) +}) + +test('Compress request', t => { + t.test('gzip as request option', t => { + t.plan(4) + function handler (req, res) { + t.match(req.headers, { + 'content-type': 'application/json', + 'content-encoding': 'gzip' + }) + var json = '' + req + .pipe(createGunzip()) + .on('data', chunk => { json += chunk }) + .on('error', err => t.fail(err)) + .on('end', () => { + t.deepEqual(JSON.parse(json), { you_know: 'for search' }) + res.setHeader('Content-Type', 'application/json;utf=8') + res.end(JSON.stringify({ you_know: 'for search' })) + }) + } + + buildServer(handler, ({ port }, server) => { + const pool = new ConnectionPool({ Connection }) + pool.addConnection(`http://localhost:${port}`) + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false + }) + + transport.request({ + method: 'POST', + path: '/hello', + body: { you_know: 'for search' } + }, { + compression: 'gzip' + }, (err, { body }) => { + t.error(err) + t.deepEqual(body, { you_know: 'for search' }) + server.stop() + }) + }) + }) + + t.test('gzip as transport option', t => { + t.plan(4) + function handler (req, res) { + t.match(req.headers, { + 'content-type': 'application/json', + 'content-encoding': 'gzip' + }) + var json = '' + req + .pipe(createGunzip()) + .on('data', chunk => { json += chunk }) + .on('error', err => t.fail(err)) + .on('end', () => { + t.deepEqual(JSON.parse(json), { you_know: 'for search' }) + res.setHeader('Content-Type', 'application/json;utf=8') + res.end(JSON.stringify({ you_know: 'for search' })) + }) + } + + buildServer(handler, ({ port }, server) => { + const pool = new ConnectionPool({ Connection }) + pool.addConnection(`http://localhost:${port}`) + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false, + compression: 'gzip' + }) + + transport.request({ + method: 'POST', + path: '/hello', + body: { you_know: 'for search' } + }, (err, { body }) => { + t.error(err) + t.deepEqual(body, { you_know: 'for search' }) + server.stop() + }) + }) + }) + + t.test('gzip stream body', t => { + t.plan(4) + function handler (req, res) { + t.match(req.headers, { + 'content-type': 'application/json', + 'content-encoding': 'gzip' + }) + var json = '' + req + .pipe(createGunzip()) + .on('data', chunk => { json += chunk }) + .on('error', err => t.fail(err)) + .on('end', () => { + t.deepEqual(JSON.parse(json), { you_know: 'for search' }) + res.setHeader('Content-Type', 'application/json;utf=8') + res.end(JSON.stringify({ you_know: 'for search' })) + }) + } + + buildServer(handler, ({ port }, server) => { + const pool = new ConnectionPool({ Connection }) + pool.addConnection(`http://localhost:${port}`) + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false + }) + + transport.request({ + method: 'POST', + path: '/hello', + body: intoStream(JSON.stringify({ you_know: 'for search' })) + }, { + compression: 'gzip' + }, (err, { body }) => { + t.error(err) + t.deepEqual(body, { you_know: 'for search' }) + server.stop() + }) + }) + }) + + t.test('Should throw on invalid compression value', t => { + t.plan(2) + + try { + new Transport({ // eslint-disable-line + emit: () => {}, + connectionPool: new ConnectionPool({ Connection }), + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false, + compression: 'deflate' + }) + t.fail('Should throw') + } catch (err) { + t.true(err instanceof ConfigurationError) + t.is(err.message, 'Invalid compression: \'deflate\'') + } + }) + + t.test('Should skip the compression for empty strings/null/undefined', t => { + t.plan(9) + + function handler (req, res) { + t.strictEqual(req.headers['content-encoding'], undefined) + t.strictEqual(req.headers['content-type'], undefined) + res.end() + } + + buildServer(handler, ({ port }, server) => { + const pool = new ConnectionPool({ Connection }) + pool.addConnection(`http://localhost:${port}`) + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + compression: 'gzip', + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false + }) + + transport.request({ + method: 'DELETE', + path: '/hello', + body: '' + }, (err, { body }) => { + t.error(err) + transport.request({ + method: 'GET', + path: '/hello', + body: null + }, (err, { body }) => { + t.error(err) + transport.request({ + method: 'GET', + path: '/hello', + body: undefined + }, (err, { body }) => { + t.error(err) + server.stop() + }) + }) + }) + }) + }) + + t.test('Retry a gzipped body', t => { + t.plan(7) + + var count = 0 + function handler (req, res) { + t.match(req.headers, { + 'content-type': 'application/json', + 'content-encoding': 'gzip' + }) + var json = '' + req + .pipe(createGunzip()) + .on('data', chunk => { json += chunk }) + .on('error', err => t.fail(err)) + .on('end', () => { + t.deepEqual(JSON.parse(json), { you_know: 'for search' }) + res.setHeader('Content-Type', 'application/json;utf=8') + if (count++ > 0) { + res.end(JSON.stringify({ you_know: 'for search' })) + } else { + setTimeout(() => { + res.end(JSON.stringify({ you_know: 'for search' })) + }, 1000) + } + }) + } + + buildServer(handler, ({ port }, server) => { + const pool = new ConnectionPool({ Connection }) + pool.addConnection(`http://localhost:${port}`) + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 250, + sniffInterval: false, + sniffOnStart: false + }) + + transport.request({ + method: 'POST', + path: '/hello', + body: { you_know: 'for search' } + }, { + compression: 'gzip' + }, (err, { body, meta }) => { + t.error(err) + t.deepEqual(body, { you_know: 'for search' }) + t.strictEqual(count, 2) + server.stop() + }) + }) + }) + + t.end() +}) + +test('Headers configuration', t => { + t.test('Global option', t => { + t.plan(3) + function handler (req, res) { + t.match(req.headers, { 'x-foo': 'bar' }) + res.setHeader('Content-Type', 'application/json;utf=8') + res.end(JSON.stringify({ hello: 'world' })) + } + + buildServer(handler, ({ port }, server) => { + const pool = new ConnectionPool({ Connection }) + pool.addConnection(`http://localhost:${port}`) + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false, + headers: { + 'x-foo': 'bar' + } + }) + + transport.request({ + method: 'GET', + path: '/hello' + }, (err, { body }) => { + t.error(err) + t.deepEqual(body, { hello: 'world' }) + server.stop() + }) + }) + }) + + t.test('Global option and custom option', t => { + t.plan(3) + function handler (req, res) { + t.match(req.headers, { + 'x-foo': 'bar', + 'x-baz': 'faz' + }) + res.setHeader('Content-Type', 'application/json;utf=8') + res.end(JSON.stringify({ hello: 'world' })) + } + + buildServer(handler, ({ port }, server) => { + const pool = new ConnectionPool({ Connection }) + pool.addConnection(`http://localhost:${port}`) + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false, + headers: { + 'x-foo': 'bar' + } + }) + + transport.request({ + method: 'GET', + path: '/hello' + }, { + headers: { 'x-baz': 'faz' } + }, (err, { body }) => { + t.error(err) + t.deepEqual(body, { hello: 'world' }) + server.stop() + }) + }) + }) + + t.test('Custom options should override global option', t => { + t.plan(3) + function handler (req, res) { + t.match(req.headers, { 'x-foo': 'faz' }) + res.setHeader('Content-Type', 'application/json;utf=8') + res.end(JSON.stringify({ hello: 'world' })) + } + + buildServer(handler, ({ port }, server) => { + const pool = new ConnectionPool({ Connection }) + pool.addConnection(`http://localhost:${port}`) + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false, + headers: { + 'x-foo': 'bar' + } + }) + + transport.request({ + method: 'GET', + path: '/hello' + }, { + headers: { 'x-foo': 'faz' } + }, (err, { body }) => { + t.error(err) + t.deepEqual(body, { hello: 'world' }) + server.stop() + }) + }) + }) + + t.end() +}) + +test('nodeFilter and nodeSelector', t => { + t.plan(4) + + const pool = new ConnectionPool({ Connection: MockConnection }) + pool.addConnection('http://localhost:9200') + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false, + nodeFilter: () => { + t.ok('called') + return true + }, + nodeSelector: conns => { + t.ok('called') + return conns[0] + } + }) + + transport.request({ + method: 'GET', + path: '/hello' + }, (err, { body }) => { + t.error(err) + t.deepEqual(body, { hello: 'world' }) + }) +}) + +test('Should accept custom querystring in the optons object', t => { + t.test('Options object', t => { + t.plan(3) + + function handler (req, res) { + t.strictEqual(req.url, '/hello?foo=bar') + res.setHeader('Content-Type', 'application/json;utf=8') + res.end(JSON.stringify({ hello: 'world' })) + } + + buildServer(handler, ({ port }, server) => { + const pool = new ConnectionPool({ Connection }) + pool.addConnection(`http://localhost:${port}`) + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false + }) + + transport.request({ + method: 'GET', + path: '/hello' + }, { + querystring: { foo: 'bar' } + }, (err, { body }) => { + t.error(err) + t.deepEqual(body, { hello: 'world' }) + server.stop() + }) + }) + }) + + t.test('Options object and params', t => { + t.plan(3) + + function handler (req, res) { + t.strictEqual(req.url, '/hello?baz=faz&foo=bar') + res.setHeader('Content-Type', 'application/json;utf=8') + res.end(JSON.stringify({ hello: 'world' })) + } + + buildServer(handler, ({ port }, server) => { + const pool = new ConnectionPool({ Connection }) + pool.addConnection(`http://localhost:${port}`) + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false + }) + + transport.request({ + method: 'GET', + path: '/hello', + querystring: { baz: 'faz' } + }, { + querystring: { foo: 'bar' } + }, (err, { body }) => { + t.error(err) + t.deepEqual(body, { hello: 'world' }) + server.stop() + }) + }) + }) + + t.end() +}) + +test('Should add an User-Agent header', t => { + t.plan(2) + const clientVersion = require('../../package.json').version + const userAgent = `elasticsearch-js/${clientVersion} (${os.platform()} ${os.release()}-${os.arch()}; Node.js ${process.version})` + + function handler (req, res) { + t.match(req.headers, { + 'user-agent': userAgent + }) + res.setHeader('Content-Type', 'application/json;utf=8') + res.end(JSON.stringify({ hello: 'world' })) + } + + buildServer(handler, ({ port }, server) => { + const pool = new ConnectionPool({ Connection }) + pool.addConnection(`http://localhost:${port}`) + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false + }) + + transport.request({ + method: 'GET', + path: '/hello' + }, (err, { body }) => { + t.error(err) + server.stop() + }) + }) +}) + +test('Should pass request params and options to generateRequestId', t => { + t.plan(3) + + const pool = new ConnectionPool({ Connection: MockConnection }) + pool.addConnection('http://localhost:9200') + + const params = { method: 'GET', path: '/hello' } + const options = { context: { winter: 'is coming' } } + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false, + generateRequestId: function (requestParams, requestOptions) { + t.deepEqual(requestParams, params) + t.deepEqual(requestOptions, options) + return 'id' + } + }) + + transport.request(params, options, t.error) +}) + +test('Secure json parsing', t => { + t.test('__proto__ protection', t => { + t.plan(2) + function handler (req, res) { + res.setHeader('Content-Type', 'application/json;utf=8') + res.end('{"__proto__":{"a":1}}') + } + + buildServer(handler, ({ port }, server) => { + const pool = new ConnectionPool({ Connection }) + pool.addConnection(`http://localhost:${port}`) + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false + }) + + transport.request({ + method: 'GET', + path: '/hello' + }, (err, { body }) => { + t.true(err instanceof DeserializationError) + t.is(err.message, 'Object contains forbidden prototype property') + server.stop() + }) + }) + }) + + t.test('constructor protection', t => { + t.plan(2) + function handler (req, res) { + res.setHeader('Content-Type', 'application/json;utf=8') + res.end('{"constructor":{"prototype":{"bar":"baz"}}}') + } + + buildServer(handler, ({ port }, server) => { + const pool = new ConnectionPool({ Connection }) + pool.addConnection(`http://localhost:${port}`) + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false + }) + + transport.request({ + method: 'GET', + path: '/hello' + }, (err, { body }) => { + t.true(err instanceof DeserializationError) + t.is(err.message, 'Object contains forbidden prototype property') + server.stop() + }) + }) + }) + + t.end() +}) + +test('Lowercase headers utilty', t => { + t.plan(4) + const { lowerCaseHeaders } = Transport.internals + + t.deepEqual(lowerCaseHeaders({ + Foo: 'bar', + Faz: 'baz', + 'X-Hello': 'world' + }), { + foo: 'bar', + faz: 'baz', + 'x-hello': 'world' + }) + + t.deepEqual(lowerCaseHeaders({ + Foo: 'bar', + faz: 'baz', + 'X-hello': 'world' + }), { + foo: 'bar', + faz: 'baz', + 'x-hello': 'world' + }) + + t.strictEqual(lowerCaseHeaders(null), null) + + t.strictEqual(lowerCaseHeaders(undefined), undefined) +}) + +test('The callback with a sync error should be called in the next tick - json', t => { + t.plan(4) + const pool = new ConnectionPool({ Connection }) + pool.addConnection('http://localhost:9200') + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false + }) + + const body = { a: true } + body.o = body + + const transportReturn = transport.request({ + method: 'POST', + path: '/hello', + body + }, (err, { body }) => { + t.ok(err instanceof SerializationError) + }) + + t.type(transportReturn.then, 'function') + t.type(transportReturn.catch, 'function') + t.type(transportReturn.abort, 'function') +}) + +test('The callback with a sync error should be called in the next tick - ndjson', t => { + t.plan(4) + const pool = new ConnectionPool({ Connection }) + pool.addConnection('http://localhost:9200') + + const transport = new Transport({ + emit: () => {}, + connectionPool: pool, + serializer: new Serializer(), + maxRetries: 3, + requestTimeout: 30000, + sniffInterval: false, + sniffOnStart: false + }) + + const field = { a: true } + field.o = field + + const transportReturn = transport.request({ + method: 'POST', + path: '/hello', + bulkBody: [field] + }, (err, { body }) => { + t.ok(err instanceof SerializationError) + }) + + t.type(transportReturn.then, 'function') + t.type(transportReturn.catch, 'function') + t.type(transportReturn.abort, 'function') +}) diff --git a/test/utils/MockConnection.js b/test/utils/MockConnection.js new file mode 100644 index 0000000..6a031f6 --- /dev/null +++ b/test/utils/MockConnection.js @@ -0,0 +1,179 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +'use strict' + +const assert = require('assert') +const { Connection } = require('../../index') +const { + ConnectionError, + RequestAbortedError, + TimeoutError +} = require('../../lib/errors') +const intoStream = require('into-stream') + +class MockConnection extends Connection { + request (params, callback) { + var aborted = false + const stream = intoStream(JSON.stringify({ hello: 'world' })) + stream.statusCode = setStatusCode(params.path) + stream.headers = { + 'content-type': 'application/json;utf=8', + date: new Date().toISOString(), + connection: 'keep-alive', + 'content-length': '17' + } + process.nextTick(() => { + if (!aborted) { + callback(null, stream) + } else { + callback(new RequestAbortedError(), null) + } + }) + return { + abort: () => { aborted = true } + } + } +} + +class MockConnectionTimeout extends Connection { + request (params, callback) { + var aborted = false + process.nextTick(() => { + if (!aborted) { + callback(new TimeoutError('Request timed out', params), null) + } else { + callback(new RequestAbortedError(), null) + } + }) + return { + abort: () => { aborted = true } + } + } +} + +class MockConnectionError extends Connection { + request (params, callback) { + var aborted = false + process.nextTick(() => { + if (!aborted) { + callback(new ConnectionError('Kaboom'), null) + } else { + callback(new RequestAbortedError(), null) + } + }) + return { + abort: () => { aborted = true } + } + } +} + +class MockConnectionSniff extends Connection { + request (params, callback) { + var aborted = false + const sniffResult = { + nodes: { + 'node-1': { + http: { + publish_address: 'localhost:9200' + }, + roles: ['master', 'data', 'ingest'] + }, + 'node-2': { + http: { + publish_address: 'localhost:9201' + }, + roles: ['master', 'data', 'ingest'] + } + } + } + const stream = intoStream(JSON.stringify(sniffResult)) + stream.statusCode = setStatusCode(params.path) + stream.headers = { + 'content-type': 'application/json;utf=8', + date: new Date().toISOString(), + connection: 'keep-alive', + 'content-length': '191' + } + process.nextTick(() => { + if (!aborted) { + if (params.headers.timeout) { + callback(new TimeoutError('Request timed out', params), null) + } else { + callback(null, stream) + } + } else { + callback(new RequestAbortedError(), null) + } + }) + return { + abort: () => { aborted = true } + } + } +} + +function buildMockConnection (opts) { + assert(opts.onRequest, 'Missing required onRequest option') + + class MockConnection extends Connection { + request (params, callback) { + var { body, statusCode } = opts.onRequest(params) + if (typeof body !== 'string') { + body = JSON.stringify(body) + } + var aborted = false + const stream = intoStream(body) + stream.statusCode = statusCode || 200 + stream.headers = { + 'content-type': 'application/json;utf=8', + date: new Date().toISOString(), + connection: 'keep-alive', + 'content-length': Buffer.byteLength(body) + } + process.nextTick(() => { + if (!aborted) { + callback(null, stream) + } else { + callback(new RequestAbortedError(), null) + } + }) + return { + abort: () => { aborted = true } + } + } + } + + return MockConnection +} + +function setStatusCode (path) { + const statusCode = Number(path.slice(1)) + if (Number.isInteger(statusCode)) { + return statusCode + } + return 200 +} + +module.exports = { + MockConnection, + MockConnectionTimeout, + MockConnectionError, + MockConnectionSniff, + buildMockConnection +} diff --git a/test/utils/TestClient.js b/test/utils/TestClient.js new file mode 100644 index 0000000..1389c6f --- /dev/null +++ b/test/utils/TestClient.js @@ -0,0 +1,137 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +'use strict' + +const { EventEmitter } = require('events') +const { + Transport, + Connection, + ConnectionPool, + CloudConnectionPool, + Serializer +} = require('../../index') + +const kEventEmitter = Symbol('elasticsearchjs-event-emitter') + +class TestClient { + constructor (opts = {}) { + const options = Object.assign({}, { + Connection, + Transport, + Serializer, + ConnectionPool: opts.cloud ? CloudConnectionPool : ConnectionPool, + maxRetries: 3, + requestTimeout: 30000, + pingTimeout: 3000, + sniffInterval: false, + sniffOnStart: false, + sniffEndpoint: '_nodes/_all/http', + sniffOnConnectionFault: false, + resurrectStrategy: 'ping', + suggestCompression: false, + compression: false, + ssl: null, + agent: null, + headers: {}, + nodeFilter: null, + nodeSelector: 'round-robin', + generateRequestId: null, + name: 'elasticsearch-js', + auth: null, + opaqueIdPrefix: null, + context: null, + proxy: null, + enableMetaHeader: true + }, opts) + + this.name = options.name + this[kEventEmitter] = new EventEmitter() + this.serializer = new options.Serializer() + this.connectionPool = new options.ConnectionPool({ + pingTimeout: options.pingTimeout, + resurrectStrategy: options.resurrectStrategy, + ssl: options.ssl, + agent: options.agent, + proxy: options.proxy, + Connection: options.Connection, + auth: options.auth, + emit: this[kEventEmitter].emit.bind(this[kEventEmitter]), + sniffEnabled: options.sniffInterval !== false || + options.sniffOnStart !== false || + options.sniffOnConnectionFault !== false + }) + this.connectionPool.addConnection(options.node || options.nodes) + this.transport = new options.Transport({ + emit: this[kEventEmitter].emit.bind(this[kEventEmitter]), + connectionPool: this.connectionPool, + serializer: this.serializer, + maxRetries: options.maxRetries, + requestTimeout: options.requestTimeout, + sniffInterval: options.sniffInterval, + sniffOnStart: options.sniffOnStart, + sniffOnConnectionFault: options.sniffOnConnectionFault, + sniffEndpoint: options.sniffEndpoint, + suggestCompression: options.suggestCompression, + compression: options.compression, + headers: options.headers, + nodeFilter: options.nodeFilter, + nodeSelector: options.nodeSelector, + generateRequestId: options.generateRequestId, + name: options.name, + opaqueIdPrefix: options.opaqueIdPrefix, + context: options.context + }) + } + + get emit () { + return this[kEventEmitter].emit.bind(this[kEventEmitter]) + } + + get on () { + return this[kEventEmitter].on.bind(this[kEventEmitter]) + } + + get once () { + return this[kEventEmitter].once.bind(this[kEventEmitter]) + } + + get off () { + return this[kEventEmitter].off.bind(this[kEventEmitter]) + } + + request (params, options, callback) { + if (typeof options === 'function') { + callback = options + options = {} + } + if (typeof params === 'object' && params !== null && Object.keys(params).length === 0) { + params = { method: 'GET', path: '/', querystring: null, body: null } + } + if (typeof params === 'function' || params == null) { + callback = params + params = { method: 'GET', path: '/', querystring: null, body: null } + options = {} + } + params = params || { method: 'GET', path: '/', querystring: null, body: null } + return this.transport.request(params, options, callback) + } +} + +module.exports = TestClient diff --git a/test/utils/buildCluster.js b/test/utils/buildCluster.js new file mode 100644 index 0000000..2cfeea6 --- /dev/null +++ b/test/utils/buildCluster.js @@ -0,0 +1,110 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +'use strict' + +const debug = require('debug')('elasticsearch-test') +const workq = require('workq') +const buildServer = require('./buildServer') + +var id = 0 +function buildCluster (options, callback) { + const clusterId = id++ + debug(`Booting cluster '${clusterId}'`) + if (typeof options === 'function') { + callback = options + options = {} + } + + const q = workq() + const nodes = {} + const sniffResult = { nodes: {} } + + options.numberOfNodes = options.numberOfNodes || 4 + for (var i = 0; i < options.numberOfNodes; i++) { + q.add(bootNode, { id: `node${i}` }) + } + + function bootNode (q, opts, done) { + function handler (req, res) { + res.setHeader('content-type', 'application/json') + if (req.url === '/_nodes/_all/http') { + res.end(JSON.stringify(sniffResult)) + } else { + res.end(JSON.stringify({ hello: 'world' })) + } + } + + buildServer(options.handler || handler, ({ port }, server) => { + nodes[opts.id] = { + url: `http://127.0.0.1:${port}`, + server + } + sniffResult.nodes[opts.id] = { + http: { + publish_address: options.hostPublishAddress + ? `localhost/127.0.0.1:${port}` + : `127.0.0.1:${port}` + }, + roles: ['master', 'data', 'ingest'] + } + debug(`Booted cluster node '${opts.id}' on port ${port} (cluster id: '${clusterId}')`) + done() + }) + } + + function shutdown () { + debug(`Shutting down cluster '${clusterId}'`) + for (const id in nodes) { + kill(id) + } + } + + function kill (id, callback) { + debug(`Shutting down cluster node '${id}' (cluster id: '${clusterId}')`) + const node = nodes[id] + delete nodes[id] + delete sniffResult.nodes[id] + node.server.stop(callback) + } + + function spawn (id, callback) { + debug(`Spawning cluster node '${id}' (cluster id: '${clusterId}')`) + q.add(bootNode, { id }) + q.add((q, done) => { + callback() + done() + }) + } + + const cluster = { + nodes, + shutdown, + kill, + spawn + } + + q.drain(done => { + debug(`Cluster '${clusterId}' booted with ${options.numberOfNodes} nodes`) + callback(cluster) + done() + }) +} + +module.exports = buildCluster diff --git a/test/utils/buildProxy.js b/test/utils/buildProxy.js new file mode 100644 index 0000000..442df46 --- /dev/null +++ b/test/utils/buildProxy.js @@ -0,0 +1,60 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information + +'use strict' + +const proxy = require('proxy') +const { readFileSync } = require('fs') +const { join } = require('path') +const http = require('http') +const https = require('https') + +const ssl = { + key: readFileSync(join(__dirname, '..', 'fixtures', 'https.key')), + cert: readFileSync(join(__dirname, '..', 'fixtures', 'https.cert')) +} + +function createProxy () { + return new Promise((resolve, reject) => { + const server = proxy(http.createServer()) + server.listen(0, '127.0.0.1', () => { + resolve(server) + }) + }) +} + +function createSecureProxy () { + return new Promise((resolve, reject) => { + const server = proxy(https.createServer(ssl)) + server.listen(0, '127.0.0.1', () => { + resolve(server) + }) + }) +} + +function createServer (handler, callback) { + return new Promise((resolve, reject) => { + const server = http.createServer() + server.listen(0, '127.0.0.1', () => { + resolve(server) + }) + }) +} + +function createSecureServer (handler, callback) { + return new Promise((resolve, reject) => { + const server = https.createServer(ssl) + server.listen(0, '127.0.0.1', () => { + resolve(server) + }) + }) +} + +module.exports = { + ssl, + createProxy, + createSecureProxy, + createServer, + createSecureServer +} diff --git a/test/utils/buildServer.js b/test/utils/buildServer.js new file mode 100644 index 0000000..e21759b --- /dev/null +++ b/test/utils/buildServer.js @@ -0,0 +1,73 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +'use strict' + +const debug = require('debug')('elasticsearch-test') +const stoppable = require('stoppable') + +// allow self signed certificates for testing purposes +process.env.NODE_TLS_REJECT_UNAUTHORIZED = 0 + +const { readFileSync } = require('fs') +const { join } = require('path') +const https = require('https') +const http = require('http') + +const secureOpts = { + key: readFileSync(join(__dirname, '..', 'fixtures', 'https.key'), 'utf8'), + cert: readFileSync(join(__dirname, '..', 'fixtures', 'https.cert'), 'utf8') +} + +var id = 0 +function buildServer (handler, opts, cb) { + const serverId = id++ + debug(`Booting server '${serverId}'`) + if (cb == null) { + cb = opts + opts = {} + } + + const server = opts.secure + ? stoppable(https.createServer(secureOpts)) + : stoppable(http.createServer()) + + server.on('request', handler) + server.on('error', err => { + console.log('http server error', err) + process.exit(1) + }) + if (cb === undefined) { + return new Promise((resolve, reject) => { + server.listen(0, () => { + const port = server.address().port + debug(`Server '${serverId}' booted on port ${port}`) + resolve([Object.assign({}, secureOpts, { port }), server]) + }) + }) + } else { + server.listen(0, () => { + const port = server.address().port + debug(`Server '${serverId}' booted on port ${port}`) + cb(Object.assign({}, secureOpts, { port }), server) + }) + } +} + +module.exports = buildServer diff --git a/test/utils/index.js b/test/utils/index.js new file mode 100644 index 0000000..f754fd5 --- /dev/null +++ b/test/utils/index.js @@ -0,0 +1,52 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +'use strict' + +const { promisify } = require('util') +const sleep = promisify(setTimeout) +const buildServer = require('./buildServer') +const buildCluster = require('./buildCluster') +const buildProxy = require('./buildProxy') +const connection = require('./MockConnection') +const TestClient = require('./TestClient') + +async function waitCluster (client, waitForStatus = 'green', timeout = '50s', times = 0) { + if (!client) { + throw new Error('waitCluster helper: missing client instance') + } + try { + await client.cluster.health({ waitForStatus, timeout }) + } catch (err) { + if (++times < 10) { + await sleep(5000) + return waitCluster(client, waitForStatus, timeout, times) + } + throw err + } +} + +module.exports = { + buildServer, + buildCluster, + buildProxy, + connection, + waitCluster, + TestClient +}